blob: ed6e61c64ef6bea402ded7b1952afbc46d8382f3 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Srinivas Girigowdadd3c5132016-01-05 19:41:27 -08002 * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28/*
29 * This file lim_types.h contains the definitions used by all
30 * all LIM modules.
31 * Author: Chandra Modumudi
32 * Date: 02/11/02
33 * History:-
34 * Date Modified by Modification Information
35 * --------------------------------------------------------------------
36 *
37 */
38#ifndef __LIM_TYPES_H
39#define __LIM_TYPES_H
40
41#include "wni_api.h"
42#include "sir_api.h"
43#include "sir_common.h"
44#include "sir_mac_prot_def.h"
45#include "utils_api.h"
46
47#include "lim_api.h"
48#include "lim_debug.h"
49#include "lim_send_sme_rsp_messages.h"
50#include "sys_global.h"
51#include "dph_global.h"
52#include "parser_api.h"
53#include "wma_if.h"
54
55#define LINK_TEST_DEFER 1
56
57#define TRACE_EVENT_CNF_TIMER_DEACT 0x6600
58#define TRACE_EVENT_CNF_TIMER_ACT 0x6601
59#define TRACE_EVENT_AUTH_RSP_TIMER_DEACT 0x6602
60#define TRACE_EVENT_AUTH_RSP_TIMER_ACT 0x6603
61
62/* MLM message types */
63#define LIM_MLM_MSG_START 1000
64#define LIM_MLM_SCAN_REQ LIM_MLM_MSG_START
65#define LIM_MLM_SCAN_CNF (LIM_MLM_MSG_START + 1)
66#define LIM_MLM_START_REQ (LIM_MLM_MSG_START + 2)
67#define LIM_MLM_START_CNF (LIM_MLM_MSG_START + 3)
68#define LIM_MLM_JOIN_REQ (LIM_MLM_MSG_START + 4)
69#define LIM_MLM_JOIN_CNF (LIM_MLM_MSG_START + 5)
70#define LIM_MLM_AUTH_REQ (LIM_MLM_MSG_START + 6)
71#define LIM_MLM_AUTH_CNF (LIM_MLM_MSG_START + 7)
72#define LIM_MLM_AUTH_IND (LIM_MLM_MSG_START + 8)
73#define LIM_MLM_ASSOC_REQ (LIM_MLM_MSG_START + 9)
74#define LIM_MLM_ASSOC_CNF (LIM_MLM_MSG_START + 10)
75#define LIM_MLM_ASSOC_IND (LIM_MLM_MSG_START + 11)
76#define LIM_MLM_DISASSOC_REQ (LIM_MLM_MSG_START + 12)
77#define LIM_MLM_DISASSOC_CNF (LIM_MLM_MSG_START + 13)
78#define LIM_MLM_DISASSOC_IND (LIM_MLM_MSG_START + 14)
79#define LIM_MLM_REASSOC_REQ (LIM_MLM_MSG_START + 15)
80#define LIM_MLM_REASSOC_CNF (LIM_MLM_MSG_START + 16)
81#define LIM_MLM_REASSOC_IND (LIM_MLM_MSG_START + 17)
82#define LIM_MLM_DEAUTH_REQ (LIM_MLM_MSG_START + 18)
83#define LIM_MLM_DEAUTH_CNF (LIM_MLM_MSG_START + 19)
84#define LIM_MLM_DEAUTH_IND (LIM_MLM_MSG_START + 20)
85#define LIM_MLM_TSPEC_REQ (LIM_MLM_MSG_START + 21)
86#define LIM_MLM_TSPEC_CNF (LIM_MLM_MSG_START + 22)
87#define LIM_MLM_TSPEC_IND (LIM_MLM_MSG_START + 23)
88#define LIM_MLM_SETKEYS_REQ (LIM_MLM_MSG_START + 24)
89#define LIM_MLM_SETKEYS_CNF (LIM_MLM_MSG_START + 25)
90#define LIM_MLM_LINK_TEST_STOP_REQ (LIM_MLM_MSG_START + 30)
91#define LIM_MLM_PURGE_STA_IND (LIM_MLM_MSG_START + 31)
92/*
93 * Values (LIM_MLM_MSG_START + 32) through
94 * (LIM_MLM_MSG_START + 40) are unused.
95 */
96#ifdef FEATURE_OEM_DATA_SUPPORT
97#define LIM_MLM_OEM_DATA_REQ (LIM_MLM_MSG_START + 41)
98#define LIM_MLM_OEM_DATA_CNF (LIM_MLM_MSG_START + 42)
99#endif
100
101#define LIM_HASH_ADD 0
102#define LIM_HASH_UPDATE 1
103
104#define LIM_WEP_IN_FC 1
105#define LIM_NO_WEP_IN_FC 0
106
107#define LIM_DECRYPT_ICV_FAIL 1
108
109/* / Definitions to distinquish between Association/Reassociaton */
110#define LIM_ASSOC 0
111#define LIM_REASSOC 1
112
113/* / Minimum Memory blocks require for different scenario */
114#define LIM_MIN_MEM_ASSOC 4
115
116/* / Verifies whether given mac addr matches the CURRENT Bssid */
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530117#define IS_CURRENT_BSSID(pMac, addr, psessionEntry) (!qdf_mem_cmp(addr, \
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800118 psessionEntry->bssId, \
119 sizeof(psessionEntry->bssId)))
120/* / Verifies whether given addr matches the REASSOC Bssid */
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530121#define IS_REASSOC_BSSID(pMac, addr, psessionEntry) (!qdf_mem_cmp(addr, \
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800122 psessionEntry->limReAssocbssId, \
123 sizeof(psessionEntry->limReAssocbssId)))
124
125#define REQ_TYPE_REGISTRAR (0x2)
126#define REQ_TYPE_WLAN_MANAGER_REGISTRAR (0x3)
127
128#define RESP_TYPE_REGISTRAR (0x2)
129#define RESP_TYPE_ENROLLEE_INFO_ONLY (0x0)
130#define RESP_TYPE_ENROLLEE_OPEN_8021X (0x1)
131#define RESP_TYPE_AP (0x3)
132#define LIM_TX_FRAMES_THRESHOLD_ON_CHIP 300
133
134
135#define HAL_TXCOMP_REQUESTED_MASK 0x1 /* bit 0 for TxComp intr requested. */
136#define HAL_USE_SELF_STA_REQUESTED_MASK 0x2 /* bit 1 for STA overwrite with selfSta Requested. */
137#define HAL_TX_NO_ENCRYPTION_MASK 0x4 /* bit 2. If set, the frame is not to be encrypted */
138#if defined(LIBRA_WAPI_SUPPORT)
139#define HAL_WAPI_STA_MASK 0x8 /* bit 3. If set, this frame is for WAPI station */
140#endif
141
142#define HAL_TRIGGER_ENABLED_AC_MASK 0x10 /* bit 4 for data frames belonging to trigger enabled AC */
143#define HAL_USE_NO_ACK_REQUESTED_MASK 0x20
144
145#define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40 /* Bit 6 will be used to control BD rate for Management frames */
146#define HAL_USE_PEER_STA_REQUESTED_MASK 0x80 /* bit 7 will be used to control frames for p2p interface */
147
148#ifdef FEATURE_WLAN_TDLS
149#define HAL_TDLS_PEER_STA_MASK 0x80 /* bit 7 set for TDLS peer station */
150#endif
151
152
153/* enums used by LIM are as follows */
154
155enum eLimDisassocTrigger {
156 eLIM_HOST_DISASSOC,
157 eLIM_PEER_ENTITY_DISASSOC,
158 eLIM_LINK_MONITORING_DISASSOC,
159 eLIM_PROMISCUOUS_MODE_DISASSOC,
160 eLIM_HOST_DEAUTH,
161 eLIM_PEER_ENTITY_DEAUTH,
162 eLIM_LINK_MONITORING_DEAUTH,
163 eLIM_JOIN_FAILURE,
164 eLIM_REASSOC_REJECT
165};
166
167/* Reason code to determine the channel change context while sending
168 * WMA_CHNL_SWITCH_REQ message to HAL
169 */
170enum eChannelChangeReasonCodes {
171 LIM_SWITCH_CHANNEL_REASSOC,
172 LIM_SWITCH_CHANNEL_JOIN,
173 LIM_SWITCH_CHANNEL_OPERATION, /* Generic change channel */
174 LIM_SWITCH_CHANNEL_SAP_DFS, /* DFS channel change */
175};
176
177typedef struct sLimAuthRspTimeout {
178 tSirMacAddr peerMacAddr;
179} tLimAuthRspTimeout;
180
181typedef struct sLimMlmStartReq {
182 tSirMacSSid ssId;
183 tSirBssType bssType;
184 tSirMacAddr bssId;
185 tSirMacBeaconInterval beaconPeriod;
186 uint8_t dtimPeriod;
187 tSirMacCfParamSet cfParamSet;
188 tSirMacChanNum channelNumber;
189 ePhyChanBondState cbMode;
190 uint16_t atimWindow;
191 tSirMacRateSet rateSet;
192 uint8_t sessionId; /* Added For BT-AMP Support */
193
194 /* Parameters reqd for new HAL (message) interface */
195 tSirNwType nwType;
196 uint8_t htCapable;
197 tSirMacHTOperatingMode htOperMode;
198 uint8_t dualCTSProtection;
199 uint8_t txChannelWidthSet;
200 uint8_t ssidHidden;
201 uint8_t wps_state;
202 uint8_t obssProtEnabled;
203} tLimMlmStartReq, *tpLimMlmStartReq;
204
205typedef struct sLimMlmStartCnf {
206 tSirResultCodes resultCode;
207 uint8_t sessionId;
208} tLimMlmStartCnf, *tpLimMlmStartCnf;
209
210typedef struct sLimMlmScanCnf {
211 tSirResultCodes resultCode;
212 uint16_t scanResultLength;
213 tSirBssDescription bssDescription[1];
214 uint8_t sessionId;
215} tLimMlmScanCnf, *tpLimMlmScanCnf;
216
217typedef struct sLimScanResult {
218 uint16_t numBssDescriptions;
219 tSirBssDescription bssDescription[1];
220} tLimScanResult;
221
222typedef struct sLimMlmJoinCnf {
223 tSirResultCodes resultCode;
224 uint16_t protStatusCode;
225 uint8_t sessionId;
226} tLimMlmJoinCnf, *tpLimMlmJoinCnf;
227
228typedef struct sLimMlmAssocReq {
229 tSirMacAddr peerMacAddr;
230 uint32_t assocFailureTimeout;
231 uint16_t capabilityInfo;
232 tSirMacListenInterval listenInterval;
233 uint8_t sessionId;
234} tLimMlmAssocReq, *tpLimMlmAssocReq;
235
236typedef struct sLimMlmAssocCnf {
237 tSirResultCodes resultCode; /* Internal status code. */
238 uint16_t protStatusCode; /* Protocol Status code. */
239 uint8_t sessionId;
240} tLimMlmAssocCnf, *tpLimMlmAssocCnf;
241
242typedef struct sLimMlmAssocInd {
243 tSirMacAddr peerMacAddr;
244 uint16_t aid;
245 tAniAuthType authType;
246 tAniSSID ssId;
247 tSirRSNie rsnIE;
248 tSirWAPIie wapiIE;
249 tSirAddie addIE; /* additional IE received from the peer, which possibly includes WSC IE and/or P2P IE. */
250 tSirMacCapabilityInfo capabilityInfo;
251 tAniBool spectrumMgtIndicator;
252 tSirMacPowerCapInfo powerCap;
253 tSirSupChnl supportedChannels;
254 uint8_t sessionId;
255
256 tAniBool WmmStaInfoPresent;
257
258 /* Required for indicating the frames to upper layer */
259 uint32_t beaconLength;
260 uint8_t *beaconPtr;
261 uint32_t assocReqLength;
262 uint8_t *assocReqPtr;
263 tSirSmeChanInfo chan_info;
264} tLimMlmAssocInd, *tpLimMlmAssocInd;
265
266typedef struct sLimMlmReassocReq {
267 tSirMacAddr peerMacAddr;
268 uint32_t reassocFailureTimeout;
269 uint16_t capabilityInfo;
270 tSirMacListenInterval listenInterval;
271 uint8_t sessionId;
272} tLimMlmReassocReq, *tpLimMlmReassocReq;
273
274typedef struct sLimMlmReassocCnf {
275 tSirResultCodes resultCode;
276 uint16_t protStatusCode; /* Protocol Status code. */
277 uint8_t sessionId;
278} tLimMlmReassocCnf, *tpLimMlmReassocCnf;
279
280typedef struct sLimMlmReassocInd {
281 tSirMacAddr peerMacAddr;
282 tSirMacAddr currentApAddr;
283 uint16_t aid;
284 tAniAuthType authType;
285 tAniSSID ssId;
286 tSirRSNie rsnIE;
287 tSirWAPIie wapiIE;
288 tSirAddie addIE; /* additional IE received from the peer, which can be WSC IE and/or P2P IE. */
289 tSirMacCapabilityInfo capabilityInfo;
290 tAniBool spectrumMgtIndicator;
291 tSirMacPowerCapInfo powerCap;
292 tSirSupChnl supportedChannels;
293
294 tAniBool WmmStaInfoPresent;
295
296 /* Required for indicating the frames to upper layer */
297 uint32_t beaconLength;
298 uint8_t *beaconPtr;
299 uint32_t assocReqLength;
300 uint8_t *assocReqPtr;
301} tLimMlmReassocInd, *tpLimMlmReassocInd;
302
303typedef struct sLimMlmAuthCnf {
304 tSirMacAddr peerMacAddr;
305 tAniAuthType authType;
306 tSirResultCodes resultCode;
307 uint16_t protStatusCode;
308 uint8_t sessionId;
309} tLimMlmAuthCnf, *tpLimMlmAuthCnf;
310
311typedef struct sLimMlmDeauthReq {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530312 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800313 uint16_t reasonCode;
314 uint16_t deauthTrigger;
315 uint16_t aid;
316 uint8_t sessionId; /* Added for BT-AMP SUPPORT */
317
318} tLimMlmDeauthReq, *tpLimMlmDeauthReq;
319
320typedef struct sLimMlmDeauthCnf {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530321 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800322 tSirResultCodes resultCode;
323 uint16_t deauthTrigger;
324 uint16_t aid;
325 uint8_t sessionId;
326} tLimMlmDeauthCnf, *tpLimMLmDeauthCnf;
327
328typedef struct sLimMlmDeauthInd {
329 tSirMacAddr peerMacAddr;
330 uint16_t reasonCode;
331 uint16_t deauthTrigger;
332 uint16_t aid;
333} tLimMlmDeauthInd, *tpLimMlmDeauthInd;
334
335typedef struct sLimMlmDisassocReq {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530336 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800337 uint16_t reasonCode;
338 uint16_t disassocTrigger;
339 uint16_t aid;
340 uint8_t sessionId;
341} tLimMlmDisassocReq, *tpLimMlmDisassocReq;
342
343typedef struct sLimMlmDisassocCnf {
344 tSirMacAddr peerMacAddr;
345 tSirResultCodes resultCode;
346 uint16_t disassocTrigger;
347 uint16_t aid;
348 uint8_t sessionId;
349} tLimMlmDisassocCnf, *tpLimMlmDisassocCnf;
350
351typedef struct sLimMlmDisassocInd {
352 tSirMacAddr peerMacAddr;
353 uint16_t reasonCode;
354 uint16_t disassocTrigger;
355 uint16_t aid;
356 uint8_t sessionId;
357} tLimMlmDisassocInd, *tpLimMlmDisassocInd;
358
359typedef struct sLimMlmPurgeStaReq {
360 tSirMacAddr peerMacAddr;
361 uint16_t aid;
362 uint8_t sessionId; /* Added For BT-AMP Support */
363} tLimMlmPurgeStaReq, *tpLimMlmPurgeStaReq;
364
365typedef struct sLimMlmPurgeStaInd {
366 tSirMacAddr peerMacAddr;
367 uint16_t reasonCode;
368 uint16_t purgeTrigger;
369 uint16_t aid;
370 uint8_t sessionId;
371} tLimMlmPurgeStaInd, *tpLimMlmPurgeStaInd;
372
373typedef struct sLimMlmSetKeysCnf {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530374 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800375 uint16_t resultCode;
376 uint16_t aid;
377 uint8_t sessionId;
378} tLimMlmSetKeysCnf, *tpLimMlmSetKeysCnf;
379
380typedef struct sLimMlmResetReq {
381 tSirMacAddr macAddr;
382 uint8_t performCleanup;
383 uint8_t sessionId;
384} tLimMlmResetReq, *tpLimMlmResetReq;
385
386typedef struct sLimMlmResetCnf {
387 tSirMacAddr macAddr;
388 tSirResultCodes resultCode;
389 uint8_t sessionId;
390} tLimMlmResetCnf, *tpLimMlmResetCnf;
391
392typedef struct sLimMlmLinkTestStopReq {
393 tSirMacAddr peerMacAddr;
394 uint8_t sessionId;
395} tLimMlmLinkTestStopReq, *tpLimMlmLinkTestStopReq;
396
397/* Function templates */
398
399bool lim_process_sme_req_messages(tpAniSirGlobal, tpSirMsgQ);
400void lim_process_mlm_req_messages(tpAniSirGlobal, tpSirMsgQ);
401void lim_process_mlm_rsp_messages(tpAniSirGlobal, uint32_t, uint32_t *);
402void lim_process_sme_del_bss_rsp(tpAniSirGlobal, uint32_t, tpPESession);
403
404void lim_get_random_bssid(tpAniSirGlobal pMac, uint8_t *data);
405
406/* Function to handle HT and HT IE CFG parameter intializations */
407void handle_ht_capabilityand_ht_info(struct sAniSirGlobal *pMac,
408 tpPESession psessionEntry);
409
410/* Function to handle CFG parameter updates */
411void lim_handle_cf_gparam_update(tpAniSirGlobal, uint32_t);
412
413void lim_handle_param_update(tpAniSirGlobal pMac, eUpdateIEsType cfgId);
414
415/* Function to apply CFG parameters before join/reassoc/start BSS */
416void lim_apply_configuration(tpAniSirGlobal, tpPESession);
417
418void lim_set_cfg_protection(tpAniSirGlobal pMac, tpPESession pesessionEntry);
419
420/* Function to Initialize MLM state machine on STA */
421void lim_init_mlm(tpAniSirGlobal);
422
423/* Function to cleanup MLM state machine */
424void lim_cleanup_mlm(tpAniSirGlobal);
425
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800426/* Management frame handling functions */
427void lim_process_beacon_frame(tpAniSirGlobal, uint8_t *, tpPESession);
428void lim_process_beacon_frame_no_session(tpAniSirGlobal, uint8_t *);
429void lim_process_probe_req_frame(tpAniSirGlobal, uint8_t *, tpPESession);
430void lim_process_probe_rsp_frame(tpAniSirGlobal, uint8_t *, tpPESession);
431void lim_process_probe_rsp_frame_no_session(tpAniSirGlobal, uint8_t *);
432void lim_process_probe_req_frame_multiple_bss(tpAniSirGlobal, uint8_t *,
433 tpPESession);
434
435/* Process Auth frame when we have a session in progress. */
436void lim_process_auth_frame(tpAniSirGlobal, uint8_t *, tpPESession);
437#ifdef WLAN_FEATURE_VOWIFI_11R
438tSirRetStatus lim_process_auth_frame_no_session(tpAniSirGlobal pMac, uint8_t *,
439 void *body);
440#endif
441
442void lim_process_assoc_req_frame(tpAniSirGlobal, uint8_t *, uint8_t, tpPESession);
443void lim_send_mlm_assoc_ind(tpAniSirGlobal pMac, tpDphHashNode pStaDs,
444 tpPESession psessionEntry);
445
446void lim_process_assoc_rsp_frame(tpAniSirGlobal, uint8_t *, uint8_t, tpPESession);
447void lim_process_disassoc_frame(tpAniSirGlobal, uint8_t *, tpPESession);
448void lim_process_deauth_frame(tpAniSirGlobal, uint8_t *, tpPESession);
449void lim_process_action_frame(tpAniSirGlobal, uint8_t *, tpPESession);
450void lim_process_action_frame_no_session(tpAniSirGlobal pMac, uint8_t *pRxMetaInfo);
451
452void lim_populate_p2p_mac_header(tpAniSirGlobal, uint8_t *);
453void lim_populate_mac_header(tpAniSirGlobal, uint8_t *, uint8_t, uint8_t,
454 tSirMacAddr, tSirMacAddr);
455tSirRetStatus lim_send_probe_req_mgmt_frame(tpAniSirGlobal, tSirMacSSid *,
456 tSirMacAddr, uint8_t, tSirMacAddr,
457 uint32_t, uint32_t, uint8_t *);
458void lim_send_probe_rsp_mgmt_frame(tpAniSirGlobal, tSirMacAddr, tpAniSSID, short,
459 uint8_t, tpPESession, uint8_t);
460void lim_send_auth_mgmt_frame(tpAniSirGlobal, tSirMacAuthFrameBody *, tSirMacAddr,
461 uint8_t, tpPESession);
462void lim_send_assoc_req_mgmt_frame(tpAniSirGlobal, tLimMlmAssocReq *, tpPESession);
463void lim_send_reassoc_req_mgmt_frame(tpAniSirGlobal, tLimMlmReassocReq *,
464 tpPESession);
465#ifdef WLAN_FEATURE_VOWIFI_11R
466void lim_send_reassoc_req_with_ft_ies_mgmt_frame(tpAniSirGlobal pMac,
467 tLimMlmReassocReq *pMlmReassocReq,
468 tpPESession psessionEntry);
469#endif
470void lim_send_delts_req_action_frame(tpAniSirGlobal pMac, tSirMacAddr peer,
471 uint8_t wmmTspecPresent,
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530472 tSirMacTSInfo * pTsinfo,
473 tSirMacTspecIE * pTspecIe,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800474 tpPESession psessionEntry);
475void lim_send_addts_req_action_frame(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr,
476 tSirAddtsReqInfo *addts, tpPESession);
477void lim_send_addts_rsp_action_frame(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr,
478 uint16_t statusCode, tSirAddtsReqInfo *addts,
479 tSirMacScheduleIE *pSchedule, tpPESession);
480
481void lim_send_assoc_rsp_mgmt_frame(tpAniSirGlobal, uint16_t, uint16_t, tSirMacAddr,
482 uint8_t, tpDphHashNode pSta, tpPESession);
483
484void lim_send_disassoc_mgmt_frame(tpAniSirGlobal, uint16_t, tSirMacAddr,
485 tpPESession, bool waitForAck);
486void lim_send_deauth_mgmt_frame(tpAniSirGlobal, uint16_t, tSirMacAddr, tpPESession,
487 bool waitForAck);
488
489tSirResultCodes lim_mlm_add_bss(tpAniSirGlobal, tLimMlmStartReq *,
490 tpPESession psessionEntry);
491
492tSirRetStatus lim_send_channel_switch_mgmt_frame(tpAniSirGlobal, tSirMacAddr,
493 uint8_t, uint8_t, uint8_t,
494 tpPESession);
495
Abhishek Singh518323d2015-10-19 17:42:01 +0530496tSirRetStatus lim_send_extended_chan_switch_action_frame(tpAniSirGlobal mac_ctx,
497 tSirMacAddr peer, uint8_t mode, uint8_t new_op_class,
498 uint8_t new_channel, uint8_t count, tpPESession session_entry);
499
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800500tSirRetStatus lim_send_vht_opmode_notification_frame(tpAniSirGlobal pMac,
501 tSirMacAddr peer, uint8_t nMode,
502 tpPESession psessionEntry);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800503
504#if defined WLAN_FEATURE_VOWIFI
505tSirRetStatus lim_send_neighbor_report_request_frame(tpAniSirGlobal,
506 tpSirMacNeighborReportReq,
507 tSirMacAddr, tpPESession);
508tSirRetStatus lim_send_link_report_action_frame(tpAniSirGlobal, tpSirMacLinkReport,
509 tSirMacAddr, tpPESession);
510tSirRetStatus lim_send_radio_measure_report_action_frame(tpAniSirGlobal, uint8_t,
511 uint8_t,
512 tpSirMacRadioMeasureReport,
513 tSirMacAddr, tpPESession);
514#endif
515
516
517#ifdef FEATURE_WLAN_TDLS
518void lim_init_tdls_data(tpAniSirGlobal, tpPESession);
519tSirRetStatus lim_process_sme_tdls_mgmt_send_req(tpAniSirGlobal pMac,
520 uint32_t *pMsgBuf);
521tSirRetStatus lim_process_sme_tdls_add_sta_req(tpAniSirGlobal pMac,
522 uint32_t *pMsgBuf);
523tSirRetStatus lim_process_sme_tdls_link_establish_req(tpAniSirGlobal pMac,
524 uint32_t *pMsgBuf);
525tSirRetStatus lim_process_sme_tdls_del_sta_req(tpAniSirGlobal pMac,
526 uint32_t *pMsgBuf);
527void lim_send_sme_tdls_delete_all_peer_ind(tpAniSirGlobal pMac,
528 tpPESession psessionEntry);
529void lim_send_sme_mgmt_tx_completion(tpAniSirGlobal pMac, tpPESession psessionEntry,
530 uint32_t txCompleteStatus);
Masti, Narayanraddi1c630442015-11-02 12:03:50 +0530531tSirRetStatus lim_delete_tdls_peers(tpAniSirGlobal mac_ctx,
532 tpPESession session_entry);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530533QDF_STATUS lim_process_tdls_add_sta_rsp(tpAniSirGlobal pMac, void *msg, tpPESession);
Masti, Narayanraddi1c630442015-11-02 12:03:50 +0530534#else
535static inline tSirRetStatus lim_delete_tdls_peers(tpAniSirGlobal mac_ctx,
536 tpPESession session_entry)
537{
538 return eSIR_SUCCESS;
539}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800540#endif
541
542/* Algorithms & Link Monitoring related functions */
543/* / Function that handles heartbeat failure */
544void lim_handle_heart_beat_failure(tpAniSirGlobal, tpPESession);
545
546/* / Function that triggers link tear down with AP upon HB failure */
547void lim_tear_down_link_with_ap(tpAniSirGlobal, uint8_t, tSirMacReasonCodes);
548
549/* / Function that processes Max retries interrupt from TFP */
550void limHandleMaxRetriesInterrupt(uint32_t);
551
552/* / Function that processes messages deferred during Learn mode */
553void lim_process_deferred_message_queue(tpAniSirGlobal);
554
555/* / Function that defers the messages received */
556uint32_t lim_defer_msg(tpAniSirGlobal, tSirMsgQ *);
557
558/* / Function that Switches the Channel and sets the CB Mode */
559void lim_set_channel(tpAniSirGlobal pMac, uint8_t channel,
560 uint8_t ch_center_freq_seg0, uint8_t ch_center_freq_seg1,
Amar Singhala297bfa2015-10-15 15:07:29 -0700561 phy_ch_width ch_width, int8_t maxTxPower,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800562 uint8_t peSessionId);
563
564
565/* / Function that completes channel scan */
566void lim_complete_mlm_scan(tpAniSirGlobal, tSirResultCodes);
567
568#ifdef ANI_SUPPORT_11H
569/* / Function that sends Measurement Report action frame */
570tSirRetStatus lim_send_meas_report_frame(tpAniSirGlobal, tpSirMacMeasReqActionFrame,
571 tSirMacAddr, tpPESession psessionEntry);
572
573/* / Function that sends TPC Report action frame */
574tSirRetStatus lim_send_tpc_report_frame(tpAniSirGlobal, tpSirMacTpcReqActionFrame,
575 tSirMacAddr, tpPESession psessionEntry);
576#endif
577
578/* / Function that sends TPC Request action frame */
579void lim_send_tpc_request_frame(tpAniSirGlobal, tSirMacAddr,
580 tpPESession psessionEntry);
581
582/* Function(s) to handle responses received from HAL */
583void lim_process_mlm_add_bss_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ);
584void lim_process_mlm_add_sta_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQt,
585 tpPESession psessionEntry);
586void lim_process_mlm_del_sta_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ);
587void lim_process_mlm_del_bss_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,
588 tpPESession);
589void lim_process_sta_mlm_add_sta_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,
590 tpPESession psessionEntry);
591void lim_process_sta_mlm_del_sta_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,
592 tpPESession psessionEntry);
593void lim_process_sta_mlm_del_bss_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,
594 tpPESession psessionEntry);
595void lim_process_mlm_set_sta_key_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ);
596void lim_process_mlm_set_bss_key_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ);
597
598/* Function to process WMA_SWITCH_CHANNEL_RSP message */
599void lim_process_switch_channel_rsp(tpAniSirGlobal pMac, void *);
600
601void lim_covert_channel_scan_type(tpAniSirGlobal pMac, uint8_t channelNum,
602 bool passiveToActive);
603void lim_set_dfs_channel_list(tpAniSirGlobal pMac, uint8_t channelNum,
604 tSirDFSChannelList *dfsChannelList);
605void limContinueChannelLearn(tpAniSirGlobal);
606/* WLAN_SUSPEND_LINK Related */
607uint8_t lim_is_link_suspended(tpAniSirGlobal pMac);
608/* end WLAN_SUSPEND_LINK Related */
609
610#ifdef WLAN_FEATURE_11W
611/* 11w send SA query request action frame */
612tSirRetStatus lim_send_sa_query_request_frame(tpAniSirGlobal pMac, uint8_t *transId,
613 tSirMacAddr peer,
614 tpPESession psessionEntry);
615/* 11w SA query request action frame handler */
616tSirRetStatus lim_send_sa_query_response_frame(tpAniSirGlobal pMac,
617 uint8_t *transId, tSirMacAddr peer,
618 tpPESession psessionEntry);
619#endif
620
621/* Inline functions */
622
623/**
624 * lim_post_sme_message()
625 *
626 ***FUNCTION:
627 * This function is called by limProcessMlmMessages(). In this
628 * function MLM sub-module invokes MLM ind/cnf primitives.
629 *
630 ***LOGIC:
631 * Initially MLM makes an SME function call to invoke MLM ind/cnf
632 * primitive. In future this can be enhanced to 'post' messages to SME.
633 *
634 ***ASSUMPTIONS:
635 * NA
636 *
637 ***NOTE:
638 * NA
639 *
640 * @param pMac Pointer to Global MAC structure
641 * @param msgType Indicates the MLM primitive message type
642 * @param *pMsgBuf A pointer to the MLM message buffer
643 *
644 * @return None
645 */
646static inline void
647lim_post_sme_message(tpAniSirGlobal pMac, uint32_t msgType, uint32_t *pMsgBuf)
648{
649 tSirMsgQ msg;
650
651 if (pMsgBuf == NULL) {
652 lim_log(pMac, LOGE, FL("Buffer is Pointing to NULL"));
653 return;
654 }
655
656 msg.type = (uint16_t) msgType;
657 msg.bodyptr = pMsgBuf;
658 msg.bodyval = 0;
659 if (msgType > eWNI_SME_MSG_TYPES_BEGIN)
660 lim_process_sme_req_messages(pMac, &msg);
661 else
662 lim_process_mlm_rsp_messages(pMac, msgType, pMsgBuf);
663} /*** end lim_post_sme_message() ***/
664
665/**
666 * lim_post_mlm_message()
667 *
668 ***FUNCTION:
669 * This function is called by limProcessSmeMessages(). In this
670 * function SME invokes MLME primitives.
671 *
672 ***PARAMS:
673 *
674 ***LOGIC:
675 * Initially SME makes an MLM function call to invoke MLM primitive.
676 * In future this can be enhanced to 'post' messages to MLM.
677 *
678 ***ASSUMPTIONS:
679 * NA
680 *
681 ***NOTE:
682 * NA
683 *
684 * @param pMac Pointer to Global MAC structure
685 * @param msgType Indicates the MLM primitive message type
686 * @param *pMsgBuf A pointer to the MLM message buffer
687 *
688 * @return None
689 */
690static inline void
691lim_post_mlm_message(tpAniSirGlobal pMac, uint32_t msgType, uint32_t *pMsgBuf)
692{
693
694 tSirMsgQ msg;
695 if (pMsgBuf == NULL) {
696 lim_log(pMac, LOGE, FL("Buffer is Pointing to NULL"));
697 return;
698 }
699 msg.type = (uint16_t) msgType;
700 msg.bodyptr = pMsgBuf;
701 msg.bodyval = 0;
702 lim_process_mlm_req_messages(pMac, &msg);
703} /*** end lim_post_mlm_message() ***/
704
705/**
706 * lim_get_current_scan_channel()
707 *
708 ***FUNCTION:
709 * This function is called in various places to get current channel
710 * number being scanned.
711 *
712 ***PARAMS:
713 *
714 ***LOGIC:
715 *
716 ***ASSUMPTIONS:
717 * NA
718 *
719 ***NOTE:
720 * NA
721 *
722 * @param pMac Pointer to Global MAC structure
723 * @return Channel number
724 */
725static inline uint8_t lim_get_current_scan_channel(tpAniSirGlobal pMac)
726{
727 uint8_t *pChanNum =
728 pMac->lim.gpLimMlmScanReq->channelList.channelNumber;
729
730 return *(pChanNum + pMac->lim.gLimCurrentScanChannelId);
731} /*** end lim_get_current_scan_channel() ***/
732
733/**
734 * lim_get_ielen_from_bss_description()
735 *
736 ***FUNCTION:
737 * This function is called in various places to get IE length
738 * from tSirBssDescription structure
739 * number being scanned.
740 *
741 ***PARAMS:
742 *
743 ***LOGIC:
744 *
745 ***ASSUMPTIONS:
746 * NA
747 *
748 ***NOTE:
749 * NA
750 *
751 * @param pBssDescr
752 * @return Total IE length
753 */
754
755static inline uint16_t
756lim_get_ielen_from_bss_description(tpSirBssDescription pBssDescr)
757{
758 uint16_t ielen;
759
760 if (!pBssDescr)
761 return 0;
762
763 /*
764 * Length of BSS desription is without length of
765 * length itself and length of pointer
766 * that holds ieFields
767 *
768 * <------------sizeof(tSirBssDescription)-------------------->
769 * +--------+---------------------------------+---------------+
770 * | length | other fields | pointer to IEs|
771 * +--------+---------------------------------+---------------+
772 * ^
773 * ieFields
774 */
775
776 ielen = (uint16_t)(pBssDescr->length + sizeof(pBssDescr->length) -
777 GET_FIELD_OFFSET(tSirBssDescription, ieFields));
778
779 return ielen;
780} /*** end lim_get_ielen_from_bss_description() ***/
781
782/**
783 * lim_send_beacon_ind()
784 *
785 ***FUNCTION:
786 * This function is called to send the beacon indication
787 * number being scanned.
788 *
789 ***PARAMS:
790 *
791 ***LOGIC:
792 *
793 ***ASSUMPTIONS:
794 */
795
796void lim_send_beacon_ind(tpAniSirGlobal pMac, tpPESession psessionEntry);
797
798void
799lim_send_vdev_restart(tpAniSirGlobal pMac, tpPESession psessionEntry,
800 uint8_t sessionId);
801
Anurag Chouhan6d760662016-02-20 16:05:43 +0530802void lim_get_wpspbc_sessions(tpAniSirGlobal pMac, struct qdf_mac_addr addr,
Srinivas Girigowda419e36b2015-11-24 15:39:54 -0800803 uint8_t *uuid_e, eWPSPBCOverlap *overlap,
804 tpPESession psessionEntry);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800805void limWPSPBCTimeout(tpAniSirGlobal pMac, tpPESession psessionEntry);
806void lim_wpspbc_close(tpAniSirGlobal pMac, tpPESession psessionEntry);
Srinivas Girigowdaedcfab92015-11-24 15:21:41 -0800807void lim_remove_pbc_sessions(tpAniSirGlobal pMac,
Anurag Chouhan6d760662016-02-20 16:05:43 +0530808 struct qdf_mac_addr pRemoveMac,
Srinivas Girigowdaedcfab92015-11-24 15:21:41 -0800809 tpPESession psessionEntry);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800810
811#define LIM_WPS_OVERLAP_TIMER_MS 10000
812void
813lim_change_channel_with_callback(tpAniSirGlobal pMac, uint8_t newChannel,
814 CHANGE_CHANNEL_CALLBACK callback,
815 uint32_t *cbdata, tpPESession psessionEntry);
816
817void lim_send_sme_mgmt_frame_ind(tpAniSirGlobal pMac, uint8_t frameType,
818 uint8_t *frame, uint32_t frameLen,
819 uint16_t sessionId, uint32_t rxChan,
820 tpPESession psessionEntry, int8_t rxRssi);
821void lim_process_remain_on_chn_timeout(tpAniSirGlobal pMac);
822void lim_process_insert_single_shot_noa_timeout(tpAniSirGlobal pMac);
823void lim_convert_active_channel_to_passive_channel(tpAniSirGlobal pMac);
824void lim_send_p2p_action_frame(tpAniSirGlobal pMac, tpSirMsgQ pMsg);
825void lim_abort_remain_on_chan(tpAniSirGlobal pMac, uint8_t sessionId,
826 uint32_t scan_id);
827tSirRetStatus __lim_process_sme_no_a_update(tpAniSirGlobal pMac, uint32_t *pMsgBuf);
828void lim_process_regd_defd_sme_req_after_noa_start(tpAniSirGlobal pMac);
829
830void lim_process_disassoc_ack_timeout(tpAniSirGlobal pMac);
831void lim_process_deauth_ack_timeout(tpAniSirGlobal pMac);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530832QDF_STATUS lim_send_disassoc_cnf(tpAniSirGlobal pMac);
833QDF_STATUS lim_send_deauth_cnf(tpAniSirGlobal pMac);
834QDF_STATUS lim_disassoc_tx_complete_cnf(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800835 uint32_t txCompleteSuccess);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530836QDF_STATUS lim_deauth_tx_complete_cnf(tpAniSirGlobal pMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800837 uint32_t txCompleteSuccess);
838
839#ifdef WLAN_FEATURE_VOWIFI_11R
840typedef struct sSetLinkCbackParams {
841 void *cbackDataPtr;
842} tSetLinkCbackParams;
843#endif
844
845void lim_process_rx_scan_event(tpAniSirGlobal mac, void *buf);
846
847int lim_process_remain_on_chnl_req(tpAniSirGlobal pMac, uint32_t *pMsg);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530848void lim_remain_on_chn_rsp(tpAniSirGlobal pMac, QDF_STATUS status, uint32_t *data);
Masti, Narayanraddi21bde252015-10-09 19:39:47 +0530849void lim_send_sme_disassoc_deauth_ntf(tpAniSirGlobal mac_ctx,
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530850 QDF_STATUS status, uint32_t *ctx);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800851
852/* / Bit value data structure */
853typedef enum sHalBitVal /* For Bit operations */
854{
855 eHAL_CLEAR,
856 eHAL_SET
857} tHalBitVal;
858
859enum {
860 eHI_PRI,
861 ePROT,
862 eDBG
863};
864
865#endif /* __LIM_TYPES_H */