blob: 0115d4ad8981f0f69a898bccfe92726a8d4d066c [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +05302 * Copyright (c) 2012-2017 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"
Sreelakshmi Konamki544e33b2016-08-17 15:08:48 +053049#include "lim_trace.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080050#include "lim_send_sme_rsp_messages.h"
51#include "sys_global.h"
52#include "dph_global.h"
53#include "parser_api.h"
54#include "wma_if.h"
55
56#define LINK_TEST_DEFER 1
57
58#define TRACE_EVENT_CNF_TIMER_DEACT 0x6600
59#define TRACE_EVENT_CNF_TIMER_ACT 0x6601
60#define TRACE_EVENT_AUTH_RSP_TIMER_DEACT 0x6602
61#define TRACE_EVENT_AUTH_RSP_TIMER_ACT 0x6603
62
63/* MLM message types */
64#define LIM_MLM_MSG_START 1000
65#define LIM_MLM_SCAN_REQ LIM_MLM_MSG_START
66#define LIM_MLM_SCAN_CNF (LIM_MLM_MSG_START + 1)
67#define LIM_MLM_START_REQ (LIM_MLM_MSG_START + 2)
68#define LIM_MLM_START_CNF (LIM_MLM_MSG_START + 3)
69#define LIM_MLM_JOIN_REQ (LIM_MLM_MSG_START + 4)
70#define LIM_MLM_JOIN_CNF (LIM_MLM_MSG_START + 5)
71#define LIM_MLM_AUTH_REQ (LIM_MLM_MSG_START + 6)
72#define LIM_MLM_AUTH_CNF (LIM_MLM_MSG_START + 7)
73#define LIM_MLM_AUTH_IND (LIM_MLM_MSG_START + 8)
74#define LIM_MLM_ASSOC_REQ (LIM_MLM_MSG_START + 9)
75#define LIM_MLM_ASSOC_CNF (LIM_MLM_MSG_START + 10)
76#define LIM_MLM_ASSOC_IND (LIM_MLM_MSG_START + 11)
77#define LIM_MLM_DISASSOC_REQ (LIM_MLM_MSG_START + 12)
78#define LIM_MLM_DISASSOC_CNF (LIM_MLM_MSG_START + 13)
79#define LIM_MLM_DISASSOC_IND (LIM_MLM_MSG_START + 14)
80#define LIM_MLM_REASSOC_REQ (LIM_MLM_MSG_START + 15)
81#define LIM_MLM_REASSOC_CNF (LIM_MLM_MSG_START + 16)
82#define LIM_MLM_REASSOC_IND (LIM_MLM_MSG_START + 17)
83#define LIM_MLM_DEAUTH_REQ (LIM_MLM_MSG_START + 18)
84#define LIM_MLM_DEAUTH_CNF (LIM_MLM_MSG_START + 19)
85#define LIM_MLM_DEAUTH_IND (LIM_MLM_MSG_START + 20)
86#define LIM_MLM_TSPEC_REQ (LIM_MLM_MSG_START + 21)
87#define LIM_MLM_TSPEC_CNF (LIM_MLM_MSG_START + 22)
88#define LIM_MLM_TSPEC_IND (LIM_MLM_MSG_START + 23)
89#define LIM_MLM_SETKEYS_REQ (LIM_MLM_MSG_START + 24)
90#define LIM_MLM_SETKEYS_CNF (LIM_MLM_MSG_START + 25)
91#define LIM_MLM_LINK_TEST_STOP_REQ (LIM_MLM_MSG_START + 30)
92#define LIM_MLM_PURGE_STA_IND (LIM_MLM_MSG_START + 31)
93/*
94 * Values (LIM_MLM_MSG_START + 32) through
95 * (LIM_MLM_MSG_START + 40) are unused.
96 */
Krishna Kumaar Natarajanc5e06ac2016-06-30 16:49:19 -070097
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080098#define LIM_HASH_ADD 0
99#define LIM_HASH_UPDATE 1
100
101#define LIM_WEP_IN_FC 1
102#define LIM_NO_WEP_IN_FC 0
103
104#define LIM_DECRYPT_ICV_FAIL 1
105
106/* / Definitions to distinquish between Association/Reassociaton */
107#define LIM_ASSOC 0
108#define LIM_REASSOC 1
109
110/* / Minimum Memory blocks require for different scenario */
111#define LIM_MIN_MEM_ASSOC 4
112
113/* / Verifies whether given mac addr matches the CURRENT Bssid */
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530114#define IS_CURRENT_BSSID(pMac, addr, psessionEntry) (!qdf_mem_cmp(addr, \
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800115 psessionEntry->bssId, \
116 sizeof(psessionEntry->bssId)))
117/* / Verifies whether given addr matches the REASSOC Bssid */
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530118#define IS_REASSOC_BSSID(pMac, addr, psessionEntry) (!qdf_mem_cmp(addr, \
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800119 psessionEntry->limReAssocbssId, \
120 sizeof(psessionEntry->limReAssocbssId)))
121
122#define REQ_TYPE_REGISTRAR (0x2)
123#define REQ_TYPE_WLAN_MANAGER_REGISTRAR (0x3)
124
125#define RESP_TYPE_REGISTRAR (0x2)
126#define RESP_TYPE_ENROLLEE_INFO_ONLY (0x0)
127#define RESP_TYPE_ENROLLEE_OPEN_8021X (0x1)
128#define RESP_TYPE_AP (0x3)
129#define LIM_TX_FRAMES_THRESHOLD_ON_CHIP 300
130
131
132#define HAL_TXCOMP_REQUESTED_MASK 0x1 /* bit 0 for TxComp intr requested. */
133#define HAL_USE_SELF_STA_REQUESTED_MASK 0x2 /* bit 1 for STA overwrite with selfSta Requested. */
134#define HAL_TX_NO_ENCRYPTION_MASK 0x4 /* bit 2. If set, the frame is not to be encrypted */
135#if defined(LIBRA_WAPI_SUPPORT)
136#define HAL_WAPI_STA_MASK 0x8 /* bit 3. If set, this frame is for WAPI station */
137#endif
138
139#define HAL_TRIGGER_ENABLED_AC_MASK 0x10 /* bit 4 for data frames belonging to trigger enabled AC */
140#define HAL_USE_NO_ACK_REQUESTED_MASK 0x20
141
142#define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40 /* Bit 6 will be used to control BD rate for Management frames */
143#define HAL_USE_PEER_STA_REQUESTED_MASK 0x80 /* bit 7 will be used to control frames for p2p interface */
144
145#ifdef FEATURE_WLAN_TDLS
146#define HAL_TDLS_PEER_STA_MASK 0x80 /* bit 7 set for TDLS peer station */
147#endif
148
149
150/* enums used by LIM are as follows */
151
152enum eLimDisassocTrigger {
153 eLIM_HOST_DISASSOC,
154 eLIM_PEER_ENTITY_DISASSOC,
155 eLIM_LINK_MONITORING_DISASSOC,
156 eLIM_PROMISCUOUS_MODE_DISASSOC,
157 eLIM_HOST_DEAUTH,
158 eLIM_PEER_ENTITY_DEAUTH,
159 eLIM_LINK_MONITORING_DEAUTH,
160 eLIM_JOIN_FAILURE,
Sandeep Puligilla7e3e3c52016-09-02 17:54:21 -0700161 eLIM_REASSOC_REJECT,
162 eLIM_DUPLICATE_ENTRY
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800163};
164
165/* Reason code to determine the channel change context while sending
166 * WMA_CHNL_SWITCH_REQ message to HAL
167 */
168enum eChannelChangeReasonCodes {
169 LIM_SWITCH_CHANNEL_REASSOC,
170 LIM_SWITCH_CHANNEL_JOIN,
171 LIM_SWITCH_CHANNEL_OPERATION, /* Generic change channel */
172 LIM_SWITCH_CHANNEL_SAP_DFS, /* DFS channel change */
173};
174
175typedef struct sLimAuthRspTimeout {
176 tSirMacAddr peerMacAddr;
177} tLimAuthRspTimeout;
178
179typedef struct sLimMlmStartReq {
180 tSirMacSSid ssId;
181 tSirBssType bssType;
182 tSirMacAddr bssId;
183 tSirMacBeaconInterval beaconPeriod;
184 uint8_t dtimPeriod;
185 tSirMacCfParamSet cfParamSet;
186 tSirMacChanNum channelNumber;
187 ePhyChanBondState cbMode;
188 uint16_t atimWindow;
189 tSirMacRateSet rateSet;
190 uint8_t sessionId; /* Added For BT-AMP Support */
191
192 /* Parameters reqd for new HAL (message) interface */
193 tSirNwType nwType;
194 uint8_t htCapable;
195 tSirMacHTOperatingMode htOperMode;
196 uint8_t dualCTSProtection;
197 uint8_t txChannelWidthSet;
198 uint8_t ssidHidden;
199 uint8_t wps_state;
200 uint8_t obssProtEnabled;
Kondabattini, Ganeshb72e25c2016-09-02 14:43:59 +0530201 uint8_t beacon_tx_rate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800202} tLimMlmStartReq, *tpLimMlmStartReq;
203
204typedef struct sLimMlmStartCnf {
205 tSirResultCodes resultCode;
206 uint8_t sessionId;
207} tLimMlmStartCnf, *tpLimMlmStartCnf;
208
209typedef struct sLimMlmScanCnf {
210 tSirResultCodes resultCode;
211 uint16_t scanResultLength;
212 tSirBssDescription bssDescription[1];
213 uint8_t sessionId;
214} tLimMlmScanCnf, *tpLimMlmScanCnf;
215
216typedef struct sLimScanResult {
217 uint16_t numBssDescriptions;
218 tSirBssDescription bssDescription[1];
219} tLimScanResult;
220
221typedef struct sLimMlmJoinCnf {
222 tSirResultCodes resultCode;
223 uint16_t protStatusCode;
224 uint8_t sessionId;
225} tLimMlmJoinCnf, *tpLimMlmJoinCnf;
226
227typedef struct sLimMlmAssocReq {
228 tSirMacAddr peerMacAddr;
229 uint32_t assocFailureTimeout;
230 uint16_t capabilityInfo;
231 tSirMacListenInterval listenInterval;
232 uint8_t sessionId;
233} tLimMlmAssocReq, *tpLimMlmAssocReq;
234
235typedef struct sLimMlmAssocCnf {
236 tSirResultCodes resultCode; /* Internal status code. */
237 uint16_t protStatusCode; /* Protocol Status code. */
238 uint8_t sessionId;
239} tLimMlmAssocCnf, *tpLimMlmAssocCnf;
240
241typedef struct sLimMlmAssocInd {
242 tSirMacAddr peerMacAddr;
243 uint16_t aid;
244 tAniAuthType authType;
245 tAniSSID ssId;
246 tSirRSNie rsnIE;
247 tSirWAPIie wapiIE;
248 tSirAddie addIE; /* additional IE received from the peer, which possibly includes WSC IE and/or P2P IE. */
249 tSirMacCapabilityInfo capabilityInfo;
250 tAniBool spectrumMgtIndicator;
251 tSirMacPowerCapInfo powerCap;
252 tSirSupChnl supportedChannels;
253 uint8_t sessionId;
254
255 tAniBool WmmStaInfoPresent;
256
257 /* Required for indicating the frames to upper layer */
258 uint32_t beaconLength;
259 uint8_t *beaconPtr;
260 uint32_t assocReqLength;
261 uint8_t *assocReqPtr;
262 tSirSmeChanInfo chan_info;
263} tLimMlmAssocInd, *tpLimMlmAssocInd;
264
265typedef struct sLimMlmReassocReq {
266 tSirMacAddr peerMacAddr;
267 uint32_t reassocFailureTimeout;
268 uint16_t capabilityInfo;
269 tSirMacListenInterval listenInterval;
270 uint8_t sessionId;
271} tLimMlmReassocReq, *tpLimMlmReassocReq;
272
273typedef struct sLimMlmReassocCnf {
274 tSirResultCodes resultCode;
275 uint16_t protStatusCode; /* Protocol Status code. */
276 uint8_t sessionId;
277} tLimMlmReassocCnf, *tpLimMlmReassocCnf;
278
279typedef struct sLimMlmReassocInd {
280 tSirMacAddr peerMacAddr;
281 tSirMacAddr currentApAddr;
282 uint16_t aid;
283 tAniAuthType authType;
284 tAniSSID ssId;
285 tSirRSNie rsnIE;
286 tSirWAPIie wapiIE;
287 tSirAddie addIE; /* additional IE received from the peer, which can be WSC IE and/or P2P IE. */
288 tSirMacCapabilityInfo capabilityInfo;
289 tAniBool spectrumMgtIndicator;
290 tSirMacPowerCapInfo powerCap;
291 tSirSupChnl supportedChannels;
292
293 tAniBool WmmStaInfoPresent;
294
295 /* Required for indicating the frames to upper layer */
296 uint32_t beaconLength;
297 uint8_t *beaconPtr;
298 uint32_t assocReqLength;
299 uint8_t *assocReqPtr;
300} tLimMlmReassocInd, *tpLimMlmReassocInd;
301
302typedef struct sLimMlmAuthCnf {
303 tSirMacAddr peerMacAddr;
304 tAniAuthType authType;
305 tSirResultCodes resultCode;
306 uint16_t protStatusCode;
307 uint8_t sessionId;
308} tLimMlmAuthCnf, *tpLimMlmAuthCnf;
309
310typedef struct sLimMlmDeauthReq {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530311 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800312 uint16_t reasonCode;
313 uint16_t deauthTrigger;
314 uint16_t aid;
315 uint8_t sessionId; /* Added for BT-AMP SUPPORT */
316
317} tLimMlmDeauthReq, *tpLimMlmDeauthReq;
318
319typedef struct sLimMlmDeauthCnf {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530320 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800321 tSirResultCodes resultCode;
322 uint16_t deauthTrigger;
323 uint16_t aid;
324 uint8_t sessionId;
325} tLimMlmDeauthCnf, *tpLimMLmDeauthCnf;
326
327typedef struct sLimMlmDeauthInd {
328 tSirMacAddr peerMacAddr;
329 uint16_t reasonCode;
330 uint16_t deauthTrigger;
331 uint16_t aid;
332} tLimMlmDeauthInd, *tpLimMlmDeauthInd;
333
334typedef struct sLimMlmDisassocReq {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530335 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800336 uint16_t reasonCode;
337 uint16_t disassocTrigger;
338 uint16_t aid;
339 uint8_t sessionId;
340} tLimMlmDisassocReq, *tpLimMlmDisassocReq;
341
342typedef struct sLimMlmDisassocCnf {
343 tSirMacAddr peerMacAddr;
344 tSirResultCodes resultCode;
345 uint16_t disassocTrigger;
346 uint16_t aid;
347 uint8_t sessionId;
348} tLimMlmDisassocCnf, *tpLimMlmDisassocCnf;
349
350typedef struct sLimMlmDisassocInd {
351 tSirMacAddr peerMacAddr;
352 uint16_t reasonCode;
353 uint16_t disassocTrigger;
354 uint16_t aid;
355 uint8_t sessionId;
356} tLimMlmDisassocInd, *tpLimMlmDisassocInd;
357
358typedef struct sLimMlmPurgeStaReq {
359 tSirMacAddr peerMacAddr;
360 uint16_t aid;
361 uint8_t sessionId; /* Added For BT-AMP Support */
362} tLimMlmPurgeStaReq, *tpLimMlmPurgeStaReq;
363
364typedef struct sLimMlmPurgeStaInd {
365 tSirMacAddr peerMacAddr;
366 uint16_t reasonCode;
367 uint16_t purgeTrigger;
368 uint16_t aid;
369 uint8_t sessionId;
370} tLimMlmPurgeStaInd, *tpLimMlmPurgeStaInd;
371
Deepak Dhamdhere07168162016-10-19 20:45:20 -0700372/**
373 * struct sLimMlmSetKeysCnf - set key confirmation parameters
374 * @peer_macaddr: peer mac address
375 * @resultCode: Result of set key operation
376 * @aid: association id
377 * @sessionId: PE session id
378 * @key_len_nonzero: Keys are non-zero length
379 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800380typedef struct sLimMlmSetKeysCnf {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530381 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800382 uint16_t resultCode;
383 uint16_t aid;
384 uint8_t sessionId;
Deepak Dhamdhere07168162016-10-19 20:45:20 -0700385 bool key_len_nonzero;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800386} tLimMlmSetKeysCnf, *tpLimMlmSetKeysCnf;
387
388typedef struct sLimMlmResetReq {
389 tSirMacAddr macAddr;
390 uint8_t performCleanup;
391 uint8_t sessionId;
392} tLimMlmResetReq, *tpLimMlmResetReq;
393
394typedef struct sLimMlmResetCnf {
395 tSirMacAddr macAddr;
396 tSirResultCodes resultCode;
397 uint8_t sessionId;
398} tLimMlmResetCnf, *tpLimMlmResetCnf;
399
400typedef struct sLimMlmLinkTestStopReq {
401 tSirMacAddr peerMacAddr;
402 uint8_t sessionId;
403} tLimMlmLinkTestStopReq, *tpLimMlmLinkTestStopReq;
404
405/* Function templates */
406
407bool lim_process_sme_req_messages(tpAniSirGlobal, tpSirMsgQ);
408void lim_process_mlm_req_messages(tpAniSirGlobal, tpSirMsgQ);
409void lim_process_mlm_rsp_messages(tpAniSirGlobal, uint32_t, uint32_t *);
410void lim_process_sme_del_bss_rsp(tpAniSirGlobal, uint32_t, tpPESession);
411
412void lim_get_random_bssid(tpAniSirGlobal pMac, uint8_t *data);
413
414/* Function to handle HT and HT IE CFG parameter intializations */
415void handle_ht_capabilityand_ht_info(struct sAniSirGlobal *pMac,
416 tpPESession psessionEntry);
417
418/* Function to handle CFG parameter updates */
419void lim_handle_cf_gparam_update(tpAniSirGlobal, uint32_t);
420
421void lim_handle_param_update(tpAniSirGlobal pMac, eUpdateIEsType cfgId);
422
423/* Function to apply CFG parameters before join/reassoc/start BSS */
424void lim_apply_configuration(tpAniSirGlobal, tpPESession);
425
426void lim_set_cfg_protection(tpAniSirGlobal pMac, tpPESession pesessionEntry);
427
428/* Function to Initialize MLM state machine on STA */
Naveen Rawate6ddcaa2016-02-05 16:50:18 -0800429tSirRetStatus lim_init_mlm(tpAniSirGlobal);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800430
431/* Function to cleanup MLM state machine */
432void lim_cleanup_mlm(tpAniSirGlobal);
433
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800434/* Management frame handling functions */
435void lim_process_beacon_frame(tpAniSirGlobal, uint8_t *, tpPESession);
436void lim_process_beacon_frame_no_session(tpAniSirGlobal, uint8_t *);
437void lim_process_probe_req_frame(tpAniSirGlobal, uint8_t *, tpPESession);
438void lim_process_probe_rsp_frame(tpAniSirGlobal, uint8_t *, tpPESession);
439void lim_process_probe_rsp_frame_no_session(tpAniSirGlobal, uint8_t *);
440void lim_process_probe_req_frame_multiple_bss(tpAniSirGlobal, uint8_t *,
441 tpPESession);
442
443/* Process Auth frame when we have a session in progress. */
444void lim_process_auth_frame(tpAniSirGlobal, uint8_t *, tpPESession);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800445tSirRetStatus lim_process_auth_frame_no_session(tpAniSirGlobal pMac, uint8_t *,
446 void *body);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800447
448void lim_process_assoc_req_frame(tpAniSirGlobal, uint8_t *, uint8_t, tpPESession);
449void lim_send_mlm_assoc_ind(tpAniSirGlobal pMac, tpDphHashNode pStaDs,
450 tpPESession psessionEntry);
451
452void lim_process_assoc_rsp_frame(tpAniSirGlobal, uint8_t *, uint8_t, tpPESession);
453void lim_process_disassoc_frame(tpAniSirGlobal, uint8_t *, tpPESession);
454void lim_process_deauth_frame(tpAniSirGlobal, uint8_t *, tpPESession);
455void lim_process_action_frame(tpAniSirGlobal, uint8_t *, tpPESession);
456void lim_process_action_frame_no_session(tpAniSirGlobal pMac, uint8_t *pRxMetaInfo);
457
458void lim_populate_p2p_mac_header(tpAniSirGlobal, uint8_t *);
459void lim_populate_mac_header(tpAniSirGlobal, uint8_t *, uint8_t, uint8_t,
460 tSirMacAddr, tSirMacAddr);
461tSirRetStatus lim_send_probe_req_mgmt_frame(tpAniSirGlobal, tSirMacSSid *,
462 tSirMacAddr, uint8_t, tSirMacAddr,
463 uint32_t, uint32_t, uint8_t *);
464void lim_send_probe_rsp_mgmt_frame(tpAniSirGlobal, tSirMacAddr, tpAniSSID, short,
465 uint8_t, tpPESession, uint8_t);
466void lim_send_auth_mgmt_frame(tpAniSirGlobal, tSirMacAuthFrameBody *, tSirMacAddr,
Abhishek Singh7d3bc3e2016-02-03 17:45:01 +0530467 uint8_t, tpPESession, bool wait_for_ack);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800468void lim_send_assoc_req_mgmt_frame(tpAniSirGlobal, tLimMlmAssocReq *, tpPESession);
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -0800469#ifdef WLAN_FEATURE_HOST_ROAM
470void lim_send_reassoc_req_with_ft_ies_mgmt_frame(tpAniSirGlobal pMac,
471 tLimMlmReassocReq *pMlmReassocReq, tpPESession psessionEntry);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800472void lim_send_reassoc_req_mgmt_frame(tpAniSirGlobal, tLimMlmReassocReq *,
473 tpPESession);
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -0800474#else
475static inline void lim_send_reassoc_req_with_ft_ies_mgmt_frame(
476 tpAniSirGlobal pMac, tLimMlmReassocReq *pMlmReassocReq,
477 tpPESession psessionEntry)
478{}
479static inline void lim_send_reassoc_req_mgmt_frame(tpAniSirGlobal mac_ctx,
480 tLimMlmReassocReq *reassoc_req, tpPESession pe_session)
481{}
482#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800483void lim_send_delts_req_action_frame(tpAniSirGlobal pMac, tSirMacAddr peer,
484 uint8_t wmmTspecPresent,
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530485 tSirMacTSInfo * pTsinfo,
486 tSirMacTspecIE * pTspecIe,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800487 tpPESession psessionEntry);
488void lim_send_addts_req_action_frame(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr,
489 tSirAddtsReqInfo *addts, tpPESession);
490void lim_send_addts_rsp_action_frame(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr,
491 uint16_t statusCode, tSirAddtsReqInfo *addts,
492 tSirMacScheduleIE *pSchedule, tpPESession);
493
494void lim_send_assoc_rsp_mgmt_frame(tpAniSirGlobal, uint16_t, uint16_t, tSirMacAddr,
495 uint8_t, tpDphHashNode pSta, tpPESession);
496
497void lim_send_disassoc_mgmt_frame(tpAniSirGlobal, uint16_t, tSirMacAddr,
498 tpPESession, bool waitForAck);
499void lim_send_deauth_mgmt_frame(tpAniSirGlobal, uint16_t, tSirMacAddr, tpPESession,
500 bool waitForAck);
501
502tSirResultCodes lim_mlm_add_bss(tpAniSirGlobal, tLimMlmStartReq *,
503 tpPESession psessionEntry);
504
505tSirRetStatus lim_send_channel_switch_mgmt_frame(tpAniSirGlobal, tSirMacAddr,
506 uint8_t, uint8_t, uint8_t,
507 tpPESession);
508
Abhishek Singh518323d2015-10-19 17:42:01 +0530509tSirRetStatus lim_send_extended_chan_switch_action_frame(tpAniSirGlobal mac_ctx,
510 tSirMacAddr peer, uint8_t mode, uint8_t new_op_class,
511 uint8_t new_channel, uint8_t count, tpPESession session_entry);
Abhishek Singh5695e2a2016-10-28 10:39:12 +0530512tSirRetStatus lim_p2p_oper_chan_change_confirm_action_frame(
513 tpAniSirGlobal mac_ctx, tSirMacAddr peer,
514 tpPESession session_entry);
Abhishek Singh518323d2015-10-19 17:42:01 +0530515
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800516tSirRetStatus lim_send_vht_opmode_notification_frame(tpAniSirGlobal pMac,
517 tSirMacAddr peer, uint8_t nMode,
518 tpPESession psessionEntry);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800519
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800520tSirRetStatus lim_send_neighbor_report_request_frame(tpAniSirGlobal,
521 tpSirMacNeighborReportReq,
522 tSirMacAddr, tpPESession);
523tSirRetStatus lim_send_link_report_action_frame(tpAniSirGlobal, tpSirMacLinkReport,
524 tSirMacAddr, tpPESession);
525tSirRetStatus lim_send_radio_measure_report_action_frame(tpAniSirGlobal, uint8_t,
526 uint8_t,
527 tpSirMacRadioMeasureReport,
528 tSirMacAddr, tpPESession);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800529
530
531#ifdef FEATURE_WLAN_TDLS
532void lim_init_tdls_data(tpAniSirGlobal, tpPESession);
533tSirRetStatus lim_process_sme_tdls_mgmt_send_req(tpAniSirGlobal pMac,
534 uint32_t *pMsgBuf);
535tSirRetStatus lim_process_sme_tdls_add_sta_req(tpAniSirGlobal pMac,
536 uint32_t *pMsgBuf);
537tSirRetStatus lim_process_sme_tdls_link_establish_req(tpAniSirGlobal pMac,
538 uint32_t *pMsgBuf);
539tSirRetStatus lim_process_sme_tdls_del_sta_req(tpAniSirGlobal pMac,
540 uint32_t *pMsgBuf);
541void lim_send_sme_tdls_delete_all_peer_ind(tpAniSirGlobal pMac,
542 tpPESession psessionEntry);
543void lim_send_sme_mgmt_tx_completion(tpAniSirGlobal pMac, tpPESession psessionEntry,
544 uint32_t txCompleteStatus);
Masti, Narayanraddi1c630442015-11-02 12:03:50 +0530545tSirRetStatus lim_delete_tdls_peers(tpAniSirGlobal mac_ctx,
546 tpPESession session_entry);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530547QDF_STATUS lim_process_tdls_add_sta_rsp(tpAniSirGlobal pMac, void *msg, tpPESession);
Masti, Narayanraddi1c630442015-11-02 12:03:50 +0530548#else
549static inline tSirRetStatus lim_delete_tdls_peers(tpAniSirGlobal mac_ctx,
550 tpPESession session_entry)
551{
552 return eSIR_SUCCESS;
553}
Kabilan Kannan32eb5022016-10-04 12:24:50 -0700554static inline void lim_init_tdls_data(tpAniSirGlobal pMac,
555 tpPESession pSessionEntry)
556{
557
558}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800559#endif
560
561/* Algorithms & Link Monitoring related functions */
562/* / Function that handles heartbeat failure */
563void lim_handle_heart_beat_failure(tpAniSirGlobal, tpPESession);
564
565/* / Function that triggers link tear down with AP upon HB failure */
566void lim_tear_down_link_with_ap(tpAniSirGlobal, uint8_t, tSirMacReasonCodes);
567
568/* / Function that processes Max retries interrupt from TFP */
569void limHandleMaxRetriesInterrupt(uint32_t);
570
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800571/* / Function that defers the messages received */
572uint32_t lim_defer_msg(tpAniSirGlobal, tSirMsgQ *);
573
574/* / Function that Switches the Channel and sets the CB Mode */
575void lim_set_channel(tpAniSirGlobal pMac, uint8_t channel,
576 uint8_t ch_center_freq_seg0, uint8_t ch_center_freq_seg1,
Kiran Kumar Lokere13644672016-02-29 15:40:10 -0800577 enum phy_ch_width ch_width, int8_t maxTxPower,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800578 uint8_t peSessionId);
579
580
581/* / Function that completes channel scan */
582void lim_complete_mlm_scan(tpAniSirGlobal, tSirResultCodes);
583
584#ifdef ANI_SUPPORT_11H
585/* / Function that sends Measurement Report action frame */
586tSirRetStatus lim_send_meas_report_frame(tpAniSirGlobal, tpSirMacMeasReqActionFrame,
587 tSirMacAddr, tpPESession psessionEntry);
588
589/* / Function that sends TPC Report action frame */
590tSirRetStatus lim_send_tpc_report_frame(tpAniSirGlobal, tpSirMacTpcReqActionFrame,
591 tSirMacAddr, tpPESession psessionEntry);
592#endif
593
594/* / Function that sends TPC Request action frame */
595void lim_send_tpc_request_frame(tpAniSirGlobal, tSirMacAddr,
596 tpPESession psessionEntry);
597
598/* Function(s) to handle responses received from HAL */
599void lim_process_mlm_add_bss_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ);
600void lim_process_mlm_add_sta_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQt,
601 tpPESession psessionEntry);
602void lim_process_mlm_del_sta_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ);
603void lim_process_mlm_del_bss_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,
604 tpPESession);
605void lim_process_sta_mlm_add_sta_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,
606 tpPESession psessionEntry);
607void lim_process_sta_mlm_del_sta_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,
608 tpPESession psessionEntry);
609void lim_process_sta_mlm_del_bss_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,
610 tpPESession psessionEntry);
611void lim_process_mlm_set_sta_key_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ);
612void lim_process_mlm_set_bss_key_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ);
613
614/* Function to process WMA_SWITCH_CHANNEL_RSP message */
615void lim_process_switch_channel_rsp(tpAniSirGlobal pMac, void *);
616
617void lim_covert_channel_scan_type(tpAniSirGlobal pMac, uint8_t channelNum,
618 bool passiveToActive);
619void lim_set_dfs_channel_list(tpAniSirGlobal pMac, uint8_t channelNum,
620 tSirDFSChannelList *dfsChannelList);
621void limContinueChannelLearn(tpAniSirGlobal);
622/* WLAN_SUSPEND_LINK Related */
623uint8_t lim_is_link_suspended(tpAniSirGlobal pMac);
624/* end WLAN_SUSPEND_LINK Related */
625
626#ifdef WLAN_FEATURE_11W
627/* 11w send SA query request action frame */
628tSirRetStatus lim_send_sa_query_request_frame(tpAniSirGlobal pMac, uint8_t *transId,
629 tSirMacAddr peer,
630 tpPESession psessionEntry);
631/* 11w SA query request action frame handler */
632tSirRetStatus lim_send_sa_query_response_frame(tpAniSirGlobal pMac,
633 uint8_t *transId, tSirMacAddr peer,
634 tpPESession psessionEntry);
635#endif
636
637/* Inline functions */
638
639/**
640 * lim_post_sme_message()
641 *
642 ***FUNCTION:
643 * This function is called by limProcessMlmMessages(). In this
644 * function MLM sub-module invokes MLM ind/cnf primitives.
645 *
646 ***LOGIC:
647 * Initially MLM makes an SME function call to invoke MLM ind/cnf
648 * primitive. In future this can be enhanced to 'post' messages to SME.
649 *
650 ***ASSUMPTIONS:
651 * NA
652 *
653 ***NOTE:
654 * NA
655 *
656 * @param pMac Pointer to Global MAC structure
657 * @param msgType Indicates the MLM primitive message type
658 * @param *pMsgBuf A pointer to the MLM message buffer
659 *
660 * @return None
661 */
662static inline void
663lim_post_sme_message(tpAniSirGlobal pMac, uint32_t msgType, uint32_t *pMsgBuf)
664{
665 tSirMsgQ msg;
666
667 if (pMsgBuf == NULL) {
668 lim_log(pMac, LOGE, FL("Buffer is Pointing to NULL"));
669 return;
670 }
671
672 msg.type = (uint16_t) msgType;
673 msg.bodyptr = pMsgBuf;
674 msg.bodyval = 0;
Sreelakshmi Konamki544e33b2016-08-17 15:08:48 +0530675 if (msgType > eWNI_SME_MSG_TYPES_BEGIN) {
676 MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION,
677 msg.type));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800678 lim_process_sme_req_messages(pMac, &msg);
Sreelakshmi Konamki544e33b2016-08-17 15:08:48 +0530679 } else {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800680 lim_process_mlm_rsp_messages(pMac, msgType, pMsgBuf);
Sreelakshmi Konamki544e33b2016-08-17 15:08:48 +0530681 }
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800682} /*** end lim_post_sme_message() ***/
683
684/**
685 * lim_post_mlm_message()
686 *
687 ***FUNCTION:
688 * This function is called by limProcessSmeMessages(). In this
689 * function SME invokes MLME primitives.
690 *
691 ***PARAMS:
692 *
693 ***LOGIC:
694 * Initially SME makes an MLM function call to invoke MLM primitive.
695 * In future this can be enhanced to 'post' messages to MLM.
696 *
697 ***ASSUMPTIONS:
698 * NA
699 *
700 ***NOTE:
701 * NA
702 *
703 * @param pMac Pointer to Global MAC structure
704 * @param msgType Indicates the MLM primitive message type
705 * @param *pMsgBuf A pointer to the MLM message buffer
706 *
707 * @return None
708 */
709static inline void
710lim_post_mlm_message(tpAniSirGlobal pMac, uint32_t msgType, uint32_t *pMsgBuf)
711{
712
713 tSirMsgQ msg;
714 if (pMsgBuf == NULL) {
715 lim_log(pMac, LOGE, FL("Buffer is Pointing to NULL"));
716 return;
717 }
718 msg.type = (uint16_t) msgType;
719 msg.bodyptr = pMsgBuf;
720 msg.bodyval = 0;
Sreelakshmi Konamki544e33b2016-08-17 15:08:48 +0530721 MTRACE(mac_trace_msg_rx(pMac, NO_SESSION, msg.type));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800722 lim_process_mlm_req_messages(pMac, &msg);
723} /*** end lim_post_mlm_message() ***/
724
725/**
726 * lim_get_current_scan_channel()
727 *
728 ***FUNCTION:
729 * This function is called in various places to get current channel
730 * number being scanned.
731 *
732 ***PARAMS:
733 *
734 ***LOGIC:
735 *
736 ***ASSUMPTIONS:
737 * NA
738 *
739 ***NOTE:
740 * NA
741 *
742 * @param pMac Pointer to Global MAC structure
743 * @return Channel number
744 */
745static inline uint8_t lim_get_current_scan_channel(tpAniSirGlobal pMac)
746{
747 uint8_t *pChanNum =
748 pMac->lim.gpLimMlmScanReq->channelList.channelNumber;
749
750 return *(pChanNum + pMac->lim.gLimCurrentScanChannelId);
751} /*** end lim_get_current_scan_channel() ***/
752
753/**
754 * lim_get_ielen_from_bss_description()
755 *
756 ***FUNCTION:
757 * This function is called in various places to get IE length
758 * from tSirBssDescription structure
759 * number being scanned.
760 *
761 ***PARAMS:
762 *
763 ***LOGIC:
764 *
765 ***ASSUMPTIONS:
766 * NA
767 *
768 ***NOTE:
769 * NA
770 *
771 * @param pBssDescr
772 * @return Total IE length
773 */
774
775static inline uint16_t
776lim_get_ielen_from_bss_description(tpSirBssDescription pBssDescr)
777{
778 uint16_t ielen;
779
780 if (!pBssDescr)
781 return 0;
782
783 /*
784 * Length of BSS desription is without length of
785 * length itself and length of pointer
786 * that holds ieFields
787 *
788 * <------------sizeof(tSirBssDescription)-------------------->
789 * +--------+---------------------------------+---------------+
790 * | length | other fields | pointer to IEs|
791 * +--------+---------------------------------+---------------+
792 * ^
793 * ieFields
794 */
795
796 ielen = (uint16_t)(pBssDescr->length + sizeof(pBssDescr->length) -
797 GET_FIELD_OFFSET(tSirBssDescription, ieFields));
798
799 return ielen;
800} /*** end lim_get_ielen_from_bss_description() ***/
801
802/**
803 * lim_send_beacon_ind()
804 *
805 ***FUNCTION:
806 * This function is called to send the beacon indication
807 * number being scanned.
808 *
809 ***PARAMS:
810 *
811 ***LOGIC:
812 *
813 ***ASSUMPTIONS:
814 */
815
816void lim_send_beacon_ind(tpAniSirGlobal pMac, tpPESession psessionEntry);
817
818void
819lim_send_vdev_restart(tpAniSirGlobal pMac, tpPESession psessionEntry,
820 uint8_t sessionId);
821
Anurag Chouhan6d760662016-02-20 16:05:43 +0530822void lim_get_wpspbc_sessions(tpAniSirGlobal pMac, struct qdf_mac_addr addr,
Srinivas Girigowda419e36b2015-11-24 15:39:54 -0800823 uint8_t *uuid_e, eWPSPBCOverlap *overlap,
824 tpPESession psessionEntry);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800825void limWPSPBCTimeout(tpAniSirGlobal pMac, tpPESession psessionEntry);
826void lim_wpspbc_close(tpAniSirGlobal pMac, tpPESession psessionEntry);
Srinivas Girigowdaedcfab92015-11-24 15:21:41 -0800827void lim_remove_pbc_sessions(tpAniSirGlobal pMac,
Anurag Chouhan6d760662016-02-20 16:05:43 +0530828 struct qdf_mac_addr pRemoveMac,
Srinivas Girigowdaedcfab92015-11-24 15:21:41 -0800829 tpPESession psessionEntry);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800830
831#define LIM_WPS_OVERLAP_TIMER_MS 10000
832void
833lim_change_channel_with_callback(tpAniSirGlobal pMac, uint8_t newChannel,
834 CHANGE_CHANNEL_CALLBACK callback,
835 uint32_t *cbdata, tpPESession psessionEntry);
836
837void lim_send_sme_mgmt_frame_ind(tpAniSirGlobal pMac, uint8_t frameType,
838 uint8_t *frame, uint32_t frameLen,
839 uint16_t sessionId, uint32_t rxChan,
840 tpPESession psessionEntry, int8_t rxRssi);
841void lim_process_remain_on_chn_timeout(tpAniSirGlobal pMac);
842void lim_process_insert_single_shot_noa_timeout(tpAniSirGlobal pMac);
843void lim_convert_active_channel_to_passive_channel(tpAniSirGlobal pMac);
844void lim_send_p2p_action_frame(tpAniSirGlobal pMac, tpSirMsgQ pMsg);
845void lim_abort_remain_on_chan(tpAniSirGlobal pMac, uint8_t sessionId,
846 uint32_t scan_id);
847tSirRetStatus __lim_process_sme_no_a_update(tpAniSirGlobal pMac, uint32_t *pMsgBuf);
848void lim_process_regd_defd_sme_req_after_noa_start(tpAniSirGlobal pMac);
849
850void lim_process_disassoc_ack_timeout(tpAniSirGlobal pMac);
851void lim_process_deauth_ack_timeout(tpAniSirGlobal pMac);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530852QDF_STATUS lim_send_disassoc_cnf(tpAniSirGlobal pMac);
853QDF_STATUS lim_send_deauth_cnf(tpAniSirGlobal pMac);
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +0530854
855/**
856 * lim_disassoc_tx_complete_cnf() - callback to indicate Tx completion
857 * @context: pointer to mac structure
858 * @buf: buffer
859 * @txCompleteSuccess: indicates tx success/failure
860 * @params: tx completion params
861 *
862 * function will be invoked on receiving tx completion indication
863 *
864 * return: success: QDF_STATUS_SUCCESS failure: QDF_STATUS_E_FAILURE
865 */
866QDF_STATUS lim_disassoc_tx_complete_cnf(void *context,
867 qdf_nbuf_t buf,
868 uint32_t txCompleteSuccess,
869 void *params);
870
871/**
872 * lim_deauth_tx_complete_cnf() - callback to indicate Tx completion
873 * @context: pointer to mac structure
874 * @buf: buffer
875 * @txCompleteSuccess: indicates tx success/failure
876 * @params: tx completion params
877 *
878 * function will be invoked on receiving tx completion indication
879 *
880 * return: success: QDF_STATUS_SUCCESS failure: QDF_STATUS_E_FAILURE
881 */
882QDF_STATUS lim_deauth_tx_complete_cnf(void *context,
883 qdf_nbuf_t buf,
884 uint32_t txCompleteSuccess,
885 void *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800886
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800887typedef struct sSetLinkCbackParams {
888 void *cbackDataPtr;
889} tSetLinkCbackParams;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800890
891void lim_process_rx_scan_event(tpAniSirGlobal mac, void *buf);
892
893int lim_process_remain_on_chnl_req(tpAniSirGlobal pMac, uint32_t *pMsg);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530894void lim_remain_on_chn_rsp(tpAniSirGlobal pMac, QDF_STATUS status, uint32_t *data);
Masti, Narayanraddi21bde252015-10-09 19:39:47 +0530895void lim_send_sme_disassoc_deauth_ntf(tpAniSirGlobal mac_ctx,
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530896 QDF_STATUS status, uint32_t *ctx);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800897
898/* / Bit value data structure */
899typedef enum sHalBitVal /* For Bit operations */
900{
901 eHAL_CLEAR,
902 eHAL_SET
903} tHalBitVal;
904
905enum {
906 eHI_PRI,
907 ePROT,
908 eDBG
909};
910
911#endif /* __LIM_TYPES_H */