blob: a029fd8beb1622d27d980083671dbab38e5af6d1 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Abhishek Singh5432c352019-01-02 17:11:44 +05302 * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18
19/*
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080020 * This file lim_types.h contains the definitions used by all
21 * all LIM modules.
22 * Author: Chandra Modumudi
23 * Date: 02/11/02
24 * History:-
25 * Date Modified by Modification Information
26 * --------------------------------------------------------------------
27 *
28 */
29#ifndef __LIM_TYPES_H
30#define __LIM_TYPES_H
31
32#include "wni_api.h"
33#include "sir_api.h"
34#include "sir_common.h"
35#include "sir_mac_prot_def.h"
36#include "utils_api.h"
37
38#include "lim_api.h"
Sreelakshmi Konamki544e33b2016-08-17 15:08:48 +053039#include "lim_trace.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080040#include "lim_send_sme_rsp_messages.h"
41#include "sys_global.h"
42#include "dph_global.h"
43#include "parser_api.h"
44#include "wma_if.h"
45
46#define LINK_TEST_DEFER 1
47
48#define TRACE_EVENT_CNF_TIMER_DEACT 0x6600
49#define TRACE_EVENT_CNF_TIMER_ACT 0x6601
50#define TRACE_EVENT_AUTH_RSP_TIMER_DEACT 0x6602
51#define TRACE_EVENT_AUTH_RSP_TIMER_ACT 0x6603
52
53/* MLM message types */
54#define LIM_MLM_MSG_START 1000
55#define LIM_MLM_SCAN_REQ LIM_MLM_MSG_START
56#define LIM_MLM_SCAN_CNF (LIM_MLM_MSG_START + 1)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080057#define LIM_MLM_START_CNF (LIM_MLM_MSG_START + 3)
58#define LIM_MLM_JOIN_REQ (LIM_MLM_MSG_START + 4)
59#define LIM_MLM_JOIN_CNF (LIM_MLM_MSG_START + 5)
60#define LIM_MLM_AUTH_REQ (LIM_MLM_MSG_START + 6)
61#define LIM_MLM_AUTH_CNF (LIM_MLM_MSG_START + 7)
62#define LIM_MLM_AUTH_IND (LIM_MLM_MSG_START + 8)
63#define LIM_MLM_ASSOC_REQ (LIM_MLM_MSG_START + 9)
64#define LIM_MLM_ASSOC_CNF (LIM_MLM_MSG_START + 10)
65#define LIM_MLM_ASSOC_IND (LIM_MLM_MSG_START + 11)
66#define LIM_MLM_DISASSOC_REQ (LIM_MLM_MSG_START + 12)
67#define LIM_MLM_DISASSOC_CNF (LIM_MLM_MSG_START + 13)
68#define LIM_MLM_DISASSOC_IND (LIM_MLM_MSG_START + 14)
69#define LIM_MLM_REASSOC_REQ (LIM_MLM_MSG_START + 15)
70#define LIM_MLM_REASSOC_CNF (LIM_MLM_MSG_START + 16)
71#define LIM_MLM_REASSOC_IND (LIM_MLM_MSG_START + 17)
72#define LIM_MLM_DEAUTH_REQ (LIM_MLM_MSG_START + 18)
73#define LIM_MLM_DEAUTH_CNF (LIM_MLM_MSG_START + 19)
74#define LIM_MLM_DEAUTH_IND (LIM_MLM_MSG_START + 20)
75#define LIM_MLM_TSPEC_REQ (LIM_MLM_MSG_START + 21)
76#define LIM_MLM_TSPEC_CNF (LIM_MLM_MSG_START + 22)
77#define LIM_MLM_TSPEC_IND (LIM_MLM_MSG_START + 23)
78#define LIM_MLM_SETKEYS_REQ (LIM_MLM_MSG_START + 24)
79#define LIM_MLM_SETKEYS_CNF (LIM_MLM_MSG_START + 25)
80#define LIM_MLM_LINK_TEST_STOP_REQ (LIM_MLM_MSG_START + 30)
81#define LIM_MLM_PURGE_STA_IND (LIM_MLM_MSG_START + 31)
82/*
83 * Values (LIM_MLM_MSG_START + 32) through
84 * (LIM_MLM_MSG_START + 40) are unused.
85 */
Krishna Kumaar Natarajanc5e06ac2016-06-30 16:49:19 -070086
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080087#define LIM_HASH_ADD 0
88#define LIM_HASH_UPDATE 1
89
90#define LIM_WEP_IN_FC 1
91#define LIM_NO_WEP_IN_FC 0
92
93#define LIM_DECRYPT_ICV_FAIL 1
94
95/* / Definitions to distinquish between Association/Reassociaton */
96#define LIM_ASSOC 0
97#define LIM_REASSOC 1
98
99/* / Minimum Memory blocks require for different scenario */
100#define LIM_MIN_MEM_ASSOC 4
101
102/* / Verifies whether given mac addr matches the CURRENT Bssid */
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800103#define IS_CURRENT_BSSID(mac, addr, pe_session) (!qdf_mem_cmp(addr, \
104 pe_session->bssId, \
105 sizeof(pe_session->bssId)))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800106/* / Verifies whether given addr matches the REASSOC Bssid */
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800107#define IS_REASSOC_BSSID(mac, addr, pe_session) (!qdf_mem_cmp(addr, \
108 pe_session->limReAssocbssId, \
109 sizeof(pe_session->limReAssocbssId)))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800110
111#define REQ_TYPE_REGISTRAR (0x2)
112#define REQ_TYPE_WLAN_MANAGER_REGISTRAR (0x3)
113
114#define RESP_TYPE_REGISTRAR (0x2)
115#define RESP_TYPE_ENROLLEE_INFO_ONLY (0x0)
116#define RESP_TYPE_ENROLLEE_OPEN_8021X (0x1)
117#define RESP_TYPE_AP (0x3)
118#define LIM_TX_FRAMES_THRESHOLD_ON_CHIP 300
119
120
121#define HAL_TXCOMP_REQUESTED_MASK 0x1 /* bit 0 for TxComp intr requested. */
122#define HAL_USE_SELF_STA_REQUESTED_MASK 0x2 /* bit 1 for STA overwrite with selfSta Requested. */
123#define HAL_TX_NO_ENCRYPTION_MASK 0x4 /* bit 2. If set, the frame is not to be encrypted */
124#if defined(LIBRA_WAPI_SUPPORT)
125#define HAL_WAPI_STA_MASK 0x8 /* bit 3. If set, this frame is for WAPI station */
126#endif
127
128#define HAL_TRIGGER_ENABLED_AC_MASK 0x10 /* bit 4 for data frames belonging to trigger enabled AC */
129#define HAL_USE_NO_ACK_REQUESTED_MASK 0x20
130
131#define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40 /* Bit 6 will be used to control BD rate for Management frames */
132#define HAL_USE_PEER_STA_REQUESTED_MASK 0x80 /* bit 7 will be used to control frames for p2p interface */
133
134#ifdef FEATURE_WLAN_TDLS
135#define HAL_TDLS_PEER_STA_MASK 0x80 /* bit 7 set for TDLS peer station */
136#endif
137
Krunal Sonifa6c7f52018-08-07 11:54:19 -0700138#define LIM_DOS_PROTECTION_TIME 1000 //1000ms
Pragaspathi Thilagaraj30251ec2018-12-18 17:22:57 +0530139#define LIM_MIN_RSSI 0 /* 0dbm */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800140/* enums used by LIM are as follows */
141
142enum eLimDisassocTrigger {
143 eLIM_HOST_DISASSOC,
144 eLIM_PEER_ENTITY_DISASSOC,
145 eLIM_LINK_MONITORING_DISASSOC,
146 eLIM_PROMISCUOUS_MODE_DISASSOC,
147 eLIM_HOST_DEAUTH,
148 eLIM_PEER_ENTITY_DEAUTH,
149 eLIM_LINK_MONITORING_DEAUTH,
150 eLIM_JOIN_FAILURE,
Sandeep Puligilla7e3e3c52016-09-02 17:54:21 -0700151 eLIM_REASSOC_REJECT,
152 eLIM_DUPLICATE_ENTRY
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800153};
154
155/* Reason code to determine the channel change context while sending
156 * WMA_CHNL_SWITCH_REQ message to HAL
157 */
158enum eChannelChangeReasonCodes {
159 LIM_SWITCH_CHANNEL_REASSOC,
160 LIM_SWITCH_CHANNEL_JOIN,
161 LIM_SWITCH_CHANNEL_OPERATION, /* Generic change channel */
162 LIM_SWITCH_CHANNEL_SAP_DFS, /* DFS channel change */
Jianmin Zhuf2de84f2018-12-20 13:03:19 +0800163 LIM_SWITCH_CHANNEL_HT_WIDTH /* HT channel width change */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800164};
165
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800166typedef struct sLimMlmStartReq {
167 tSirMacSSid ssId;
168 tSirBssType bssType;
169 tSirMacAddr bssId;
170 tSirMacBeaconInterval beaconPeriod;
171 uint8_t dtimPeriod;
172 tSirMacCfParamSet cfParamSet;
173 tSirMacChanNum channelNumber;
174 ePhyChanBondState cbMode;
175 uint16_t atimWindow;
176 tSirMacRateSet rateSet;
177 uint8_t sessionId; /* Added For BT-AMP Support */
178
179 /* Parameters reqd for new HAL (message) interface */
180 tSirNwType nwType;
181 uint8_t htCapable;
182 tSirMacHTOperatingMode htOperMode;
183 uint8_t dualCTSProtection;
184 uint8_t txChannelWidthSet;
185 uint8_t ssidHidden;
186 uint8_t wps_state;
187 uint8_t obssProtEnabled;
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800188 uint16_t beacon_tx_rate;
Arif Hussain671a1902017-03-17 09:08:32 -0700189 uint32_t cac_duration_ms;
190 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800191} tLimMlmStartReq, *tpLimMlmStartReq;
192
193typedef struct sLimMlmStartCnf {
194 tSirResultCodes resultCode;
195 uint8_t sessionId;
196} tLimMlmStartCnf, *tpLimMlmStartCnf;
197
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800198typedef struct sLimMlmJoinCnf {
199 tSirResultCodes resultCode;
200 uint16_t protStatusCode;
201 uint8_t sessionId;
202} tLimMlmJoinCnf, *tpLimMlmJoinCnf;
203
204typedef struct sLimMlmAssocReq {
205 tSirMacAddr peerMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800206 uint16_t capabilityInfo;
207 tSirMacListenInterval listenInterval;
208 uint8_t sessionId;
209} tLimMlmAssocReq, *tpLimMlmAssocReq;
210
211typedef struct sLimMlmAssocCnf {
212 tSirResultCodes resultCode; /* Internal status code. */
213 uint16_t protStatusCode; /* Protocol Status code. */
214 uint8_t sessionId;
215} tLimMlmAssocCnf, *tpLimMlmAssocCnf;
216
217typedef struct sLimMlmAssocInd {
218 tSirMacAddr peerMacAddr;
219 uint16_t aid;
220 tAniAuthType authType;
221 tAniSSID ssId;
222 tSirRSNie rsnIE;
223 tSirWAPIie wapiIE;
224 tSirAddie addIE; /* additional IE received from the peer, which possibly includes WSC IE and/or P2P IE. */
225 tSirMacCapabilityInfo capabilityInfo;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700226 bool spectrumMgtIndicator;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800227 tSirMacPowerCapInfo powerCap;
228 tSirSupChnl supportedChannels;
229 uint8_t sessionId;
230
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700231 bool WmmStaInfoPresent;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800232
233 /* Required for indicating the frames to upper layer */
234 uint32_t beaconLength;
235 uint8_t *beaconPtr;
236 uint32_t assocReqLength;
237 uint8_t *assocReqPtr;
238 tSirSmeChanInfo chan_info;
Will Huang558f8082017-05-31 16:22:24 +0800239 bool ampdu;
240 bool sgi_enable;
241 bool tx_stbc;
242 bool rx_stbc;
243 tSirMacHTChannelWidth ch_width;
244 enum sir_sme_phy_mode mode;
245 uint8_t max_supp_idx;
246 uint8_t max_ext_idx;
247 uint8_t max_mcs_idx;
248 uint8_t rx_mcs_map;
249 uint8_t tx_mcs_map;
gaolez7bb1e742017-03-21 16:37:38 +0800250 uint8_t ecsa_capable;
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +0530251
252 tDot11fIEHTCaps ht_caps;
253 tDot11fIEVHTCaps vht_caps;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800254} tLimMlmAssocInd, *tpLimMlmAssocInd;
255
256typedef struct sLimMlmReassocReq {
257 tSirMacAddr peerMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800258 uint16_t capabilityInfo;
259 tSirMacListenInterval listenInterval;
260 uint8_t sessionId;
261} tLimMlmReassocReq, *tpLimMlmReassocReq;
262
263typedef struct sLimMlmReassocCnf {
264 tSirResultCodes resultCode;
265 uint16_t protStatusCode; /* Protocol Status code. */
266 uint8_t sessionId;
267} tLimMlmReassocCnf, *tpLimMlmReassocCnf;
268
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800269typedef struct sLimMlmAuthCnf {
270 tSirMacAddr peerMacAddr;
271 tAniAuthType authType;
272 tSirResultCodes resultCode;
273 uint16_t protStatusCode;
274 uint8_t sessionId;
275} tLimMlmAuthCnf, *tpLimMlmAuthCnf;
276
277typedef struct sLimMlmDeauthReq {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530278 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800279 uint16_t reasonCode;
280 uint16_t deauthTrigger;
281 uint16_t aid;
282 uint8_t sessionId; /* Added for BT-AMP SUPPORT */
283
284} tLimMlmDeauthReq, *tpLimMlmDeauthReq;
285
286typedef struct sLimMlmDeauthCnf {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530287 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800288 tSirResultCodes resultCode;
289 uint16_t deauthTrigger;
290 uint16_t aid;
291 uint8_t sessionId;
292} tLimMlmDeauthCnf, *tpLimMLmDeauthCnf;
293
294typedef struct sLimMlmDeauthInd {
295 tSirMacAddr peerMacAddr;
296 uint16_t reasonCode;
297 uint16_t deauthTrigger;
298 uint16_t aid;
299} tLimMlmDeauthInd, *tpLimMlmDeauthInd;
300
301typedef struct sLimMlmDisassocReq {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530302 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800303 uint16_t reasonCode;
304 uint16_t disassocTrigger;
305 uint16_t aid;
306 uint8_t sessionId;
307} tLimMlmDisassocReq, *tpLimMlmDisassocReq;
308
309typedef struct sLimMlmDisassocCnf {
310 tSirMacAddr peerMacAddr;
311 tSirResultCodes resultCode;
312 uint16_t disassocTrigger;
313 uint16_t aid;
314 uint8_t sessionId;
315} tLimMlmDisassocCnf, *tpLimMlmDisassocCnf;
316
317typedef struct sLimMlmDisassocInd {
318 tSirMacAddr peerMacAddr;
319 uint16_t reasonCode;
320 uint16_t disassocTrigger;
321 uint16_t aid;
322 uint8_t sessionId;
323} tLimMlmDisassocInd, *tpLimMlmDisassocInd;
324
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800325typedef struct sLimMlmPurgeStaInd {
326 tSirMacAddr peerMacAddr;
327 uint16_t reasonCode;
328 uint16_t purgeTrigger;
329 uint16_t aid;
330 uint8_t sessionId;
331} tLimMlmPurgeStaInd, *tpLimMlmPurgeStaInd;
332
Deepak Dhamdhere07168162016-10-19 20:45:20 -0700333/**
334 * struct sLimMlmSetKeysCnf - set key confirmation parameters
335 * @peer_macaddr: peer mac address
336 * @resultCode: Result of set key operation
337 * @aid: association id
338 * @sessionId: PE session id
339 * @key_len_nonzero: Keys are non-zero length
340 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800341typedef struct sLimMlmSetKeysCnf {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530342 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800343 uint16_t resultCode;
344 uint16_t aid;
345 uint8_t sessionId;
Deepak Dhamdhere07168162016-10-19 20:45:20 -0700346 bool key_len_nonzero;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800347} tLimMlmSetKeysCnf, *tpLimMlmSetKeysCnf;
348
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800349/* Function templates */
350
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800351bool lim_process_sme_req_messages(struct mac_context *, struct scheduler_msg *);
352void lim_process_mlm_req_messages(struct mac_context *, struct scheduler_msg *);
353void lim_process_mlm_rsp_messages(struct mac_context *, uint32_t, uint32_t *);
354void lim_process_sme_del_bss_rsp(struct mac_context *, uint32_t, struct pe_session *);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800355
Abhishek Singhc5a54082018-09-12 16:08:03 +0530356/**
357 * lim_process_mlm_start_cnf(): called to processes MLM_START_CNF message from
358 * MLM State machine.
359 * @mac_ctx: Pointer to Global MAC structure
360 * @msg_buf: A pointer to the MLM message buffer
361 *
362 * Return: None
363 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800364void lim_process_mlm_start_cnf(struct mac_context *mac_ctx, uint32_t *msg_buf);
Abhishek Singhc5a54082018-09-12 16:08:03 +0530365
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800366void lim_get_random_bssid(struct mac_context *mac, uint8_t *data);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800367
368/* Function to handle HT and HT IE CFG parameter intializations */
Jeff Johnson348973e2018-11-22 16:51:12 -0800369void handle_ht_capabilityand_ht_info(struct mac_context *mac,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800370 struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800371
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800372void lim_handle_param_update(struct mac_context *mac, eUpdateIEsType cfgId);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800373
374/* Function to apply CFG parameters before join/reassoc/start BSS */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800375void lim_apply_configuration(struct mac_context *, struct pe_session *);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800376
Pragaspathi Thilagaraj1ee76002018-09-18 21:38:51 +0530377/**
378 * lim_set_cfg_protection() - sets lim global cfg cache from the config
Jeff Johnson348973e2018-11-22 16:51:12 -0800379 * @mac: global mac context
Pragaspathi Thilagaraj1ee76002018-09-18 21:38:51 +0530380 * @pesessionEntry: PE session
381 *
382 * Return none
383 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800384void lim_set_cfg_protection(struct mac_context *mac, struct pe_session *pesessionEntry);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800385
386/* Function to Initialize MLM state machine on STA */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800387QDF_STATUS lim_init_mlm(struct mac_context *);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800388
389/* Function to cleanup MLM state machine */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800390void lim_cleanup_mlm(struct mac_context *);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800391
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800392/* Management frame handling functions */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800393void lim_process_beacon_frame(struct mac_context *, uint8_t *, struct pe_session *);
394void lim_process_probe_req_frame(struct mac_context *, uint8_t *, struct pe_session *);
395void lim_process_probe_rsp_frame(struct mac_context *, uint8_t *, struct pe_session *);
396void lim_process_probe_req_frame_multiple_bss(struct mac_context *, uint8_t *,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800397 struct pe_session *);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800398
399/* Process Auth frame when we have a session in progress. */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800400void lim_process_auth_frame(struct mac_context *, uint8_t *, struct pe_session *);
401QDF_STATUS lim_process_auth_frame_no_session(struct mac_context *mac, uint8_t *,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800402 void *body);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800403
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800404void lim_process_assoc_req_frame(struct mac_context *, uint8_t *, uint8_t, struct pe_session *);
405void lim_send_mlm_assoc_ind(struct mac_context *mac, tpDphHashNode pStaDs,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800406 struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800407
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800408void lim_process_assoc_rsp_frame(struct mac_context *, uint8_t *, uint8_t, struct pe_session *);
409void lim_process_disassoc_frame(struct mac_context *, uint8_t *, struct pe_session *);
Varun Reddy Yeturub5d858e2017-12-15 16:08:13 -0800410/*
411 * lim_perform_disassoc() - Actual action taken after receiving disassoc
412 * @mac_ctx: Global MAC context
413 * @frame_rssi: RSSI of the frame
414 * @rc: Reason code of the deauth
415 * @pe_session: PE session entry pointer
416 * @addr: BSSID from which the disassoc is received
417 *
418 * Return: None
419 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800420void lim_perform_disassoc(struct mac_context *mac_ctx, int32_t frame_rssi,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800421 uint16_t rc, struct pe_session *pe_session,
Varun Reddy Yeturub5d858e2017-12-15 16:08:13 -0800422 tSirMacAddr addr);
423/*
424 * lim_disassoc_tdls_peers() - Disassoc action for tdls peers
425 * @mac_ctx: Global MAC context
426 * @pe_session: PE session entry pointer
427 * @addr: BSSID from which the disassoc is received
428 *
429 * Return: None
430 */
431#ifdef FEATURE_WLAN_TDLS
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800432void lim_disassoc_tdls_peers(struct mac_context *mac_ctx,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800433 struct pe_session *pe_session, tSirMacAddr addr);
Varun Reddy Yeturub5d858e2017-12-15 16:08:13 -0800434#else
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800435static inline void lim_disassoc_tdls_peers(struct mac_context *mac_ctx,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800436 struct pe_session *pe_session, tSirMacAddr addr)
Varun Reddy Yeturub5d858e2017-12-15 16:08:13 -0800437{
Varun Reddy Yeturub5d858e2017-12-15 16:08:13 -0800438}
439#endif
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800440void lim_process_deauth_frame(struct mac_context *, uint8_t *, struct pe_session *);
Varun Reddy Yeturub5d858e2017-12-15 16:08:13 -0800441/*
442 * lim_perform_deauth() - Actual action taken after receiving deauth
443 * @mac_ctx: Global MAC context
444 * @pe_session: PE session entry pointer
445 * @rc: Reason code of the deauth
446 * @addr: BSSID from which the deauth is received
447 * @frame_rssi: RSSI of the frame
448 *
449 * Return: None
450 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800451void lim_perform_deauth(struct mac_context *mac_ctx, struct pe_session *pe_session,
Varun Reddy Yeturub5d858e2017-12-15 16:08:13 -0800452 uint16_t rc, tSirMacAddr addr, int32_t frame_rssi);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800453void lim_process_action_frame(struct mac_context *, uint8_t *, struct pe_session *);
454void lim_process_action_frame_no_session(struct mac_context *mac, uint8_t *pRxMetaInfo);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800455
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800456void lim_populate_mac_header(struct mac_context *, uint8_t *, uint8_t, uint8_t,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800457 tSirMacAddr, tSirMacAddr);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800458QDF_STATUS lim_send_probe_req_mgmt_frame(struct mac_context *, tSirMacSSid *,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800459 tSirMacAddr, uint8_t, tSirMacAddr,
Sandeep Puligilla06ae8902018-04-16 19:02:47 -0700460 uint32_t, uint16_t *, uint8_t *);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800461void lim_send_probe_rsp_mgmt_frame(struct mac_context *, tSirMacAddr, tpAniSSID, short,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800462 uint8_t, struct pe_session *, uint8_t);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800463void lim_send_auth_mgmt_frame(struct mac_context *, tSirMacAuthFrameBody *, tSirMacAddr,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800464 uint8_t, struct pe_session *);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800465void lim_send_assoc_req_mgmt_frame(struct mac_context *, tLimMlmAssocReq *, struct pe_session *);
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -0800466#ifdef WLAN_FEATURE_HOST_ROAM
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800467void lim_send_reassoc_req_with_ft_ies_mgmt_frame(struct mac_context *mac,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800468 tLimMlmReassocReq *pMlmReassocReq, struct pe_session *pe_session);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800469void lim_send_reassoc_req_mgmt_frame(struct mac_context *, tLimMlmReassocReq *,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800470 struct pe_session *);
Paul Zhang2f1077c2017-11-30 12:06:09 +0800471/**
472 * lim_process_rx_scan_handler() -
473 * process the event for scan which is issued by LIM
474 * @vdev: wlan objmgr vdev pointer
475 * @event: scan event
476 * @arg: global mac context pointer
477 *
478 * Return: void
479 */
480void lim_process_rx_scan_handler(struct wlan_objmgr_vdev *vdev,
481 struct scan_event *event, void *arg);
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -0800482#else
483static inline void lim_send_reassoc_req_with_ft_ies_mgmt_frame(
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800484 struct mac_context *mac, tLimMlmReassocReq *pMlmReassocReq,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800485 struct pe_session *pe_session)
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -0800486{}
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800487static inline void lim_send_reassoc_req_mgmt_frame(struct mac_context *mac_ctx,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800488 tLimMlmReassocReq *reassoc_req, struct pe_session *pe_session)
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -0800489{}
Paul Zhang2f1077c2017-11-30 12:06:09 +0800490static inline void lim_process_rx_scan_handler(struct wlan_objmgr_vdev *vdev,
491 struct scan_event *event, void *arg)
492{}
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -0800493#endif
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -0700494#ifdef WLAN_FEATURE_11AX_BSS_COLOR
495/**
496 * lim_process_set_he_bss_color() - process the set he bss color request
497 *
498 * @mac_ctx: global mac context pointer
499 * @msg_buf: message buffer pointer
500 *
501 * Return: void
502 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800503void lim_process_set_he_bss_color(struct mac_context *mac_ctx, uint32_t *msg_buf);
Arif Hussain05fb4872018-01-03 16:02:55 -0800504
505/**
506 * lim_process_obss_color_collision_info() - Process the obss color collision
507 * request.
508 * @mac_ctx: global mac context pointer
509 * @msg_buf: message buffer pointer
510 *
511 * Return: void
512 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800513void lim_process_obss_color_collision_info(struct mac_context *mac_ctx,
Arif Hussain05fb4872018-01-03 16:02:55 -0800514 uint32_t *msg_buf);
515
516/**
517 * lim_send_obss_color_collision_cfg() - Send obss color collision cfg.
518 * @mac_ctx: global mac context pointer
519 * @session: Pointer to session
520 * @event_type: obss color collision detection type
521 *
522 * Return: void
523 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800524void lim_send_obss_color_collision_cfg(struct mac_context *mac_ctx,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800525 struct pe_session *session,
Arif Hussain05fb4872018-01-03 16:02:55 -0800526 enum wmi_obss_color_collision_evt_type
527 event_type);
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -0700528#else
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800529static inline void lim_process_set_he_bss_color(struct mac_context *mac_ctx,
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -0700530 uint32_t *msg_buf)
531{}
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800532static inline void lim_process_obss_color_collision_info(struct mac_context *mac_ctx,
Arif Hussain05fb4872018-01-03 16:02:55 -0800533 uint32_t *msg_buf)
534{}
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800535static inline void lim_send_obss_color_collision_cfg(struct mac_context *mac_ctx,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800536 struct pe_session *session,
Arif Hussain05fb4872018-01-03 16:02:55 -0800537 enum wmi_obss_color_collision_evt_type event_type)
538{}
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -0700539#endif
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800540void lim_send_delts_req_action_frame(struct mac_context *mac, tSirMacAddr peer,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800541 uint8_t wmmTspecPresent,
Jeff Johnson312348f2018-12-22 13:33:54 -0800542 struct mac_ts_info * pTsinfo,
Jeff Johnson56471b92018-12-22 14:36:06 -0800543 struct mac_tspec_ie * pTspecIe,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800544 struct pe_session *pe_session);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800545void lim_send_addts_req_action_frame(struct mac_context *mac, tSirMacAddr peerMacAddr,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800546 tSirAddtsReqInfo *addts, struct pe_session *);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800547
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800548void lim_send_assoc_rsp_mgmt_frame(struct mac_context *, uint16_t, uint16_t, tSirMacAddr,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800549 uint8_t, tpDphHashNode pSta, struct pe_session *);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800550
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800551void lim_send_disassoc_mgmt_frame(struct mac_context *, uint16_t, tSirMacAddr,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800552 struct pe_session *, bool waitForAck);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800553void lim_send_deauth_mgmt_frame(struct mac_context *, uint16_t, tSirMacAddr, struct pe_session *,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800554 bool waitForAck);
555
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800556void lim_process_mlm_update_hidden_ssid_rsp(struct mac_context *mac_ctx,
Kiran Kumar Lokere5798bfa2017-04-27 20:49:39 -0700557 struct scheduler_msg *msg);
558
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800559tSirResultCodes lim_mlm_add_bss(struct mac_context *, tLimMlmStartReq *,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800560 struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800561
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800562QDF_STATUS lim_send_channel_switch_mgmt_frame(struct mac_context *, tSirMacAddr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800563 uint8_t, uint8_t, uint8_t,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800564 struct pe_session *);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800565
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800566QDF_STATUS lim_send_extended_chan_switch_action_frame(struct mac_context *mac_ctx,
Abhishek Singh518323d2015-10-19 17:42:01 +0530567 tSirMacAddr peer, uint8_t mode, uint8_t new_op_class,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800568 uint8_t new_channel, uint8_t count, struct pe_session *session_entry);
Jeff Johnson0301ecb2018-06-29 09:36:23 -0700569QDF_STATUS lim_p2p_oper_chan_change_confirm_action_frame(
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800570 struct mac_context *mac_ctx, tSirMacAddr peer,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800571 struct pe_session *session_entry);
Abhishek Singh518323d2015-10-19 17:42:01 +0530572
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800573QDF_STATUS lim_send_neighbor_report_request_frame(struct mac_context *,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800574 tpSirMacNeighborReportReq,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800575 tSirMacAddr, struct pe_session *);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800576QDF_STATUS lim_send_link_report_action_frame(struct mac_context *, tpSirMacLinkReport,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800577 tSirMacAddr, struct pe_session *);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800578
Vignesh Viswanathan3b4bf982018-06-05 15:04:23 +0530579/**
580 * lim_send_radio_measure_report_action_frame - Send RRM report action frame
Jeff Johnson348973e2018-11-22 16:51:12 -0800581 * @mac: pointer to global MAC context
Vignesh Viswanathan3b4bf982018-06-05 15:04:23 +0530582 * @dialog_token: Dialog token to be used in the action frame
583 * @num_report: number of reports in pRRMReport
Vignesh Viswanathan09bd8f42018-08-14 22:04:36 +0530584 * @is_last_frame: is the current report last or more reports to follow
Vignesh Viswanathan3b4bf982018-06-05 15:04:23 +0530585 * @pRRMReport: Pointer to the RRM report structure
586 * @peer: MAC address of the peer
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800587 * @pe_session: Pointer to the PE session entry
Vignesh Viswanathan3b4bf982018-06-05 15:04:23 +0530588 *
589 * Return: Ret Status
590 */
Jeff Johnson0301ecb2018-06-29 09:36:23 -0700591QDF_STATUS
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800592lim_send_radio_measure_report_action_frame(struct mac_context *mac,
Vignesh Viswanathan3b4bf982018-06-05 15:04:23 +0530593 uint8_t dialog_token,
594 uint8_t num_report,
Vignesh Viswanathan09bd8f42018-08-14 22:04:36 +0530595 bool is_last_frame,
Vignesh Viswanathan3b4bf982018-06-05 15:04:23 +0530596 tpSirMacRadioMeasureReport pRRMReport,
597 tSirMacAddr peer,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800598 struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800599
600#ifdef FEATURE_WLAN_TDLS
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800601void lim_init_tdls_data(struct mac_context *, struct pe_session *);
602QDF_STATUS lim_process_sme_tdls_mgmt_send_req(struct mac_context *mac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800603 uint32_t *pMsgBuf);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800604QDF_STATUS lim_process_sme_tdls_add_sta_req(struct mac_context *mac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800605 uint32_t *pMsgBuf);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800606QDF_STATUS lim_process_sme_tdls_del_sta_req(struct mac_context *mac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800607 uint32_t *pMsgBuf);
Ganesh Kondabattiniac570072016-12-21 12:45:48 +0530608void lim_send_sme_mgmt_tx_completion(
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800609 struct mac_context *mac,
Ganesh Kondabattiniac570072016-12-21 12:45:48 +0530610 uint32_t sme_session_id,
611 uint32_t txCompleteStatus);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800612QDF_STATUS lim_delete_tdls_peers(struct mac_context *mac_ctx,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800613 struct pe_session *session_entry);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800614QDF_STATUS lim_process_tdls_add_sta_rsp(struct mac_context *mac, void *msg, struct pe_session *);
615void lim_process_tdls_del_sta_rsp(struct mac_context *mac_ctx,
Padma, Santhosh Kumar4eb79082017-02-24 16:00:20 +0530616 struct scheduler_msg *lim_msg,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800617 struct pe_session *session_entry);
Masti, Narayanraddi1c630442015-11-02 12:03:50 +0530618#else
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800619static inline QDF_STATUS lim_delete_tdls_peers(struct mac_context *mac_ctx,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800620 struct pe_session *session_entry)
Masti, Narayanraddi1c630442015-11-02 12:03:50 +0530621{
Jeff Johnson0301ecb2018-06-29 09:36:23 -0700622 return QDF_STATUS_SUCCESS;
Masti, Narayanraddi1c630442015-11-02 12:03:50 +0530623}
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800624static inline void lim_init_tdls_data(struct mac_context *mac,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800625 struct pe_session *pe_session)
Kabilan Kannan32eb5022016-10-04 12:24:50 -0700626{
627
628}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800629#endif
630
631/* Algorithms & Link Monitoring related functions */
632/* / Function that handles heartbeat failure */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800633void lim_handle_heart_beat_failure(struct mac_context *, struct pe_session *);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800634
635/* / Function that triggers link tear down with AP upon HB failure */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800636void lim_tear_down_link_with_ap(struct mac_context *, uint8_t, tSirMacReasonCodes);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800637
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800638/* / Function that defers the messages received */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800639uint32_t lim_defer_msg(struct mac_context *, struct scheduler_msg *);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800640
641/* / Function that Switches the Channel and sets the CB Mode */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800642void lim_set_channel(struct mac_context *mac, uint8_t channel,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800643 uint8_t ch_center_freq_seg0, uint8_t ch_center_freq_seg1,
Kiran Kumar Lokere13644672016-02-29 15:40:10 -0800644 enum phy_ch_width ch_width, int8_t maxTxPower,
Arif Hussain671a1902017-03-17 09:08:32 -0700645 uint8_t peSessionId, uint32_t cac_duration_ms,
646 uint32_t dfs_regdomain);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800647
648
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800649#ifdef ANI_SUPPORT_11H
650/* / Function that sends Measurement Report action frame */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800651QDF_STATUS lim_send_meas_report_frame(struct mac_context *, tpSirMacMeasReqActionFrame,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800652 tSirMacAddr, struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800653
654/* / Function that sends TPC Report action frame */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800655QDF_STATUS lim_send_tpc_report_frame(struct mac_context *, tpSirMacTpcReqActionFrame,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800656 tSirMacAddr, struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800657#endif
658
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800659/* Function(s) to handle responses received from HAL */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800660void lim_process_mlm_add_bss_rsp(struct mac_context *mac,
Rajeev Kumarfeb96382017-01-22 19:42:09 -0800661 struct scheduler_msg *limMsgQ);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800662void lim_process_mlm_add_sta_rsp(struct mac_context *mac,
Rajeev Kumarfeb96382017-01-22 19:42:09 -0800663 struct scheduler_msg *limMsgQt,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800664 struct pe_session *pe_session);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800665void lim_process_mlm_del_sta_rsp(struct mac_context *mac,
Rajeev Kumarfeb96382017-01-22 19:42:09 -0800666 struct scheduler_msg *limMsgQ);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800667void lim_process_mlm_del_bss_rsp(struct mac_context *mac,
Rajeev Kumarfeb96382017-01-22 19:42:09 -0800668 struct scheduler_msg *limMsgQ,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800669 struct pe_session *);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800670void lim_process_sta_mlm_add_sta_rsp(struct mac_context *mac,
Rajeev Kumarfeb96382017-01-22 19:42:09 -0800671 struct scheduler_msg *limMsgQ,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800672 struct pe_session *pe_session);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800673void lim_process_sta_mlm_del_sta_rsp(struct mac_context *mac,
Rajeev Kumarfeb96382017-01-22 19:42:09 -0800674 struct scheduler_msg *limMsgQ,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800675 struct pe_session *pe_session);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800676void lim_process_sta_mlm_del_bss_rsp(struct mac_context *mac,
Rajeev Kumarfeb96382017-01-22 19:42:09 -0800677 struct scheduler_msg *limMsgQ,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800678 struct pe_session *pe_session);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800679void lim_process_mlm_set_sta_key_rsp(struct mac_context *mac,
Rajeev Kumarfeb96382017-01-22 19:42:09 -0800680 struct scheduler_msg *limMsgQ);
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800681void lim_process_mlm_set_bss_key_rsp(struct mac_context *mac,
Rajeev Kumarfeb96382017-01-22 19:42:09 -0800682 struct scheduler_msg *limMsgQ);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800683
684/* Function to process WMA_SWITCH_CHANNEL_RSP message */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800685void lim_process_switch_channel_rsp(struct mac_context *mac, void *);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800686
Sandeep Puligilla2a7fa842018-10-02 01:00:56 -0700687QDF_STATUS lim_sta_send_down_link(join_params *param);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800688
689#ifdef WLAN_FEATURE_11W
690/* 11w send SA query request action frame */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800691QDF_STATUS lim_send_sa_query_request_frame(struct mac_context *mac, uint8_t *transId,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800692 tSirMacAddr peer,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800693 struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800694/* 11w SA query request action frame handler */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800695QDF_STATUS lim_send_sa_query_response_frame(struct mac_context *mac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800696 uint8_t *transId, tSirMacAddr peer,
Jeff Johnsonb5c13332018-12-03 09:54:51 -0800697 struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800698#endif
699
700/* Inline functions */
701
702/**
703 * lim_post_sme_message()
704 *
705 ***FUNCTION:
706 * This function is called by limProcessMlmMessages(). In this
707 * function MLM sub-module invokes MLM ind/cnf primitives.
708 *
709 ***LOGIC:
710 * Initially MLM makes an SME function call to invoke MLM ind/cnf
711 * primitive. In future this can be enhanced to 'post' messages to SME.
712 *
713 ***ASSUMPTIONS:
714 * NA
715 *
716 ***NOTE:
717 * NA
718 *
Jeff Johnson348973e2018-11-22 16:51:12 -0800719 * @param mac Pointer to Global MAC structure
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800720 * @param msgType Indicates the MLM primitive message type
721 * @param *pMsgBuf A pointer to the MLM message buffer
722 *
723 * @return None
724 */
725static inline void
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800726lim_post_sme_message(struct mac_context *mac, uint32_t msgType, uint32_t *pMsgBuf)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800727{
Rajeev Kumarcf7bd802017-04-18 11:11:42 -0700728 struct scheduler_msg msg = {0};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800729
730 if (pMsgBuf == NULL) {
Srinivas Girigowda9ffddb12017-03-26 22:15:09 -0700731 pe_err("Buffer is Pointing to NULL");
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800732 return;
733 }
734
735 msg.type = (uint16_t) msgType;
736 msg.bodyptr = pMsgBuf;
737 msg.bodyval = 0;
Sreelakshmi Konamki544e33b2016-08-17 15:08:48 +0530738 if (msgType > eWNI_SME_MSG_TYPES_BEGIN) {
Jeff Johnson348973e2018-11-22 16:51:12 -0800739 MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG, NO_SESSION,
Sreelakshmi Konamki544e33b2016-08-17 15:08:48 +0530740 msg.type));
Jeff Johnson348973e2018-11-22 16:51:12 -0800741 lim_process_sme_req_messages(mac, &msg);
Sreelakshmi Konamki544e33b2016-08-17 15:08:48 +0530742 } else {
Jeff Johnson348973e2018-11-22 16:51:12 -0800743 lim_process_mlm_rsp_messages(mac, msgType, pMsgBuf);
Sreelakshmi Konamki544e33b2016-08-17 15:08:48 +0530744 }
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800745} /*** end lim_post_sme_message() ***/
746
747/**
748 * lim_post_mlm_message()
749 *
750 ***FUNCTION:
751 * This function is called by limProcessSmeMessages(). In this
752 * function SME invokes MLME primitives.
753 *
754 ***PARAMS:
755 *
756 ***LOGIC:
757 * Initially SME makes an MLM function call to invoke MLM primitive.
758 * In future this can be enhanced to 'post' messages to MLM.
759 *
760 ***ASSUMPTIONS:
761 * NA
762 *
763 ***NOTE:
764 * NA
765 *
Jeff Johnson348973e2018-11-22 16:51:12 -0800766 * @param mac Pointer to Global MAC structure
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800767 * @param msgType Indicates the MLM primitive message type
768 * @param *pMsgBuf A pointer to the MLM message buffer
769 *
770 * @return None
771 */
772static inline void
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800773lim_post_mlm_message(struct mac_context *mac, uint32_t msgType, uint32_t *pMsgBuf)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800774{
Rajeev Kumarcf7bd802017-04-18 11:11:42 -0700775 struct scheduler_msg msg = {0};
Srinivas Girigowda9ffddb12017-03-26 22:15:09 -0700776
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800777 if (pMsgBuf == NULL) {
Srinivas Girigowda9ffddb12017-03-26 22:15:09 -0700778 pe_err("Buffer is Pointing to NULL");
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800779 return;
780 }
781 msg.type = (uint16_t) msgType;
782 msg.bodyptr = pMsgBuf;
783 msg.bodyval = 0;
Jeff Johnson348973e2018-11-22 16:51:12 -0800784 MTRACE(mac_trace_msg_rx(mac, NO_SESSION, msg.type));
785 lim_process_mlm_req_messages(mac, &msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800786} /*** end lim_post_mlm_message() ***/
787
788/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800789 * lim_get_ielen_from_bss_description()
790 *
791 ***FUNCTION:
792 * This function is called in various places to get IE length
793 * from tSirBssDescription structure
794 * number being scanned.
795 *
796 ***PARAMS:
797 *
798 ***LOGIC:
799 *
800 ***ASSUMPTIONS:
801 * NA
802 *
803 ***NOTE:
804 * NA
805 *
806 * @param pBssDescr
807 * @return Total IE length
808 */
809
810static inline uint16_t
811lim_get_ielen_from_bss_description(tpSirBssDescription pBssDescr)
812{
813 uint16_t ielen;
814
815 if (!pBssDescr)
816 return 0;
817
818 /*
819 * Length of BSS desription is without length of
820 * length itself and length of pointer
821 * that holds ieFields
822 *
823 * <------------sizeof(tSirBssDescription)-------------------->
824 * +--------+---------------------------------+---------------+
825 * | length | other fields | pointer to IEs|
826 * +--------+---------------------------------+---------------+
827 * ^
828 * ieFields
829 */
830
831 ielen = (uint16_t)(pBssDescr->length + sizeof(pBssDescr->length) -
832 GET_FIELD_OFFSET(tSirBssDescription, ieFields));
833
834 return ielen;
835} /*** end lim_get_ielen_from_bss_description() ***/
836
837/**
Abhishek Singhfc740be2018-10-12 11:34:26 +0530838 * lim_send_beacon_ind() - send the beacon indication
839 * @mac_ctx: pointer to mac structure
840 * @session: pe session
841 * @reason: beacon update reason
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800842 *
Abhishek Singhfc740be2018-10-12 11:34:26 +0530843 * return: success: QDF_STATUS_SUCCESS failure: QDF_STATUS_E_FAILURE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800844 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800845QDF_STATUS lim_send_beacon_ind(struct mac_context *mac_ctx, struct pe_session *session,
Abhishek Singhfc740be2018-10-12 11:34:26 +0530846 enum sir_bcn_update_reason reason);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800847
848void
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800849lim_send_vdev_restart(struct mac_context *mac, struct pe_session *pe_session,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800850 uint8_t sessionId);
851
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800852void lim_wpspbc_close(struct mac_context *mac, struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800853
854#define LIM_WPS_OVERLAP_TIMER_MS 10000
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800855
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800856void lim_process_disassoc_ack_timeout(struct mac_context *mac);
857void lim_process_deauth_ack_timeout(struct mac_context *mac);
858QDF_STATUS lim_send_disassoc_cnf(struct mac_context *mac);
859QDF_STATUS lim_send_deauth_cnf(struct mac_context *mac);
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +0530860
861/**
862 * lim_disassoc_tx_complete_cnf() - callback to indicate Tx completion
863 * @context: pointer to mac structure
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +0530864 * @txCompleteSuccess: indicates tx success/failure
865 * @params: tx completion params
866 *
867 * function will be invoked on receiving tx completion indication
868 *
869 * return: success: QDF_STATUS_SUCCESS failure: QDF_STATUS_E_FAILURE
870 */
871QDF_STATUS lim_disassoc_tx_complete_cnf(void *context,
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +0530872 uint32_t txCompleteSuccess,
873 void *params);
874
875/**
876 * lim_deauth_tx_complete_cnf() - callback to indicate Tx completion
877 * @context: pointer to mac structure
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +0530878 * @txCompleteSuccess: indicates tx success/failure
879 * @params: tx completion params
880 *
881 * function will be invoked on receiving tx completion indication
882 *
883 * return: success: QDF_STATUS_SUCCESS failure: QDF_STATUS_E_FAILURE
884 */
885QDF_STATUS lim_deauth_tx_complete_cnf(void *context,
Himanshu Agarwal2fdf77a2016-12-29 11:41:00 +0530886 uint32_t txCompleteSuccess,
887 void *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800888
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800889typedef struct sSetLinkCbackParams {
890 void *cbackDataPtr;
891} tSetLinkCbackParams;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800892
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800893void lim_send_sme_disassoc_deauth_ntf(struct mac_context *mac_ctx,
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530894 QDF_STATUS status, uint32_t *ctx);
Yingying Tangd491e182017-04-18 14:11:03 +0800895
896#ifdef FEATURE_WLAN_TDLS
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800897QDF_STATUS lim_process_sme_del_all_tdls_peers(struct mac_context *p_mac,
Nitesh Shah99dd9552017-03-20 19:27:47 +0530898 uint32_t *msg_buf);
Yingying Tangd491e182017-04-18 14:11:03 +0800899#else
900static inline
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800901QDF_STATUS lim_process_sme_del_all_tdls_peers(struct mac_context *p_mac,
Yingying Tangd491e182017-04-18 14:11:03 +0800902 uint32_t *msg_buf)
903{
Jeff Johnson0301ecb2018-06-29 09:36:23 -0700904 return QDF_STATUS_SUCCESS;
Yingying Tangd491e182017-04-18 14:11:03 +0800905}
906#endif
907
gaoleze5108942017-03-31 16:56:42 +0800908/**
Abhishek Singhfc740be2018-10-12 11:34:26 +0530909 * lim_send_bcn_rsp() - handle beacon send response
910 * @mac_ctx Pointer to Global MAC structure
911 * @rsp: beacon send response
912 *
913 * Return: None
914 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800915void lim_send_bcn_rsp(struct mac_context *mac_ctx, tpSendbeaconParams rsp);
Abhishek Singhfc740be2018-10-12 11:34:26 +0530916
917/**
Pragaspathi Thilagaraj30251ec2018-12-18 17:22:57 +0530918 * lim_remove_duplicate_bssid_node() - remove duplicate bssid from the
919 * @entry: entry to check for which the duplicate entry is present
920 * @list: mac_ctx->roam.rssi_disallow_bssid list
921 *
922 * Return: None
923 */
924void lim_remove_duplicate_bssid_node(struct sir_rssi_disallow_lst *entry,
925 qdf_list_t *list);
926
927/**
928 * lim_add_roam_blacklist_ap() - handle the blacklist bssid list received from
929 * firmware
930 * @mac_ctx: Pointer to Global MAC structure
931 * @list: roam blacklist ap list
932 *
933 * Return: None
934 */
935void lim_add_roam_blacklist_ap(struct mac_context *mac_ctx,
936 struct roam_blacklist_event *src_lst);
937
938/**
gaoleze5108942017-03-31 16:56:42 +0800939 * lim_process_rx_channel_status_event() - processes
940 * event WDA_RX_CHN_STATUS_EVENT
941 * @mac_ctx Pointer to Global MAC structure
942 * @buf: Received message info
943 *
944 * Return: None
945 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800946void lim_process_rx_channel_status_event(struct mac_context *mac_ctx, void *buf);
gaoleze5108942017-03-31 16:56:42 +0800947
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800948/* / Bit value data structure */
949typedef enum sHalBitVal /* For Bit operations */
950{
951 eHAL_CLEAR,
952 eHAL_SET
953} tHalBitVal;
954
955enum {
956 eHI_PRI,
957 ePROT,
958 eDBG
959};
960
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800961QDF_STATUS lim_send_addba_response_frame(struct mac_context *mac_ctx,
Kiran Kumar Lokereaee823a2018-03-22 15:27:05 -0700962 tSirMacAddr peer_mac, uint16_t tid,
Jeff Johnson2b0d20f2018-11-18 22:01:18 -0800963 struct pe_session *session,
Kiran Kumar Lokereaee823a2018-03-22 15:27:05 -0700964 uint8_t addba_extn_present,
965 uint8_t amsdu_support);
Abhishek Singh6a730172017-12-29 14:07:21 +0530966/**
967 * lim_process_join_failure_timeout() - This function is called to process
968 * JoinFailureTimeout
969 *
970 * @mac_ctx: Pointer to Global MAC structure
971 *
972 * This function is called to process JoinFailureTimeout
973 *
974 * @Return None
975 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800976void lim_process_join_failure_timeout(struct mac_context *mac_ctx);
Abhishek Singh6a730172017-12-29 14:07:21 +0530977
978/**
979 * lim_process_auth_failure_timeout() - This function is called to process Min
980 * Channel Timeout during channel scan.
981 *
982 * @mac_ctx: Pointer to Global MAC structure
983 *
984 * This function is called to process Min Channel Timeout during channel scan.
985 *
986 * @Return: None
987 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -0800988void lim_process_auth_failure_timeout(struct mac_context *mac_ctx);
Abhishek Singh6a730172017-12-29 14:07:21 +0530989
990/**
991 * lim_process_assoc_failure_timeout() - This function is called to process Min
992 * Channel Timeout during channel scan.
993 *
994 * @mac_ctx: Pointer to Global MAC structure
995 * @msg_type: Assoc or reassoc
996 *
997 * This function is called to process Min Channel Timeout during channel scan.
998 *
999 * @Return: None
1000 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001001void lim_process_assoc_failure_timeout(struct mac_context *mac_ctx,
Abhishek Singh6a730172017-12-29 14:07:21 +05301002 uint32_t msg_type);
Padma, Santhosh Kumar22c462c2018-01-16 17:56:44 +05301003
1004/**
1005 * lim_send_mgmt_frame_tx() - Sends mgmt frame
1006 * @mac_ctx Pointer to Global MAC structure
1007 * @msg: Received message info
1008 *
1009 * Return: None
1010 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001011void lim_send_mgmt_frame_tx(struct mac_context *mac_ctx,
Padma, Santhosh Kumar22c462c2018-01-16 17:56:44 +05301012 struct scheduler_msg *msg);
Abhishek Singh20a8e442018-09-12 15:50:44 +05301013
1014/**
1015 * lim_send_csa_restart_req() - send csa restart req
1016 * @mac_ctx Pointer to Global MAC structure
1017 * @vdev_id: vdev id
1018 *
1019 * Return: None
1020 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001021void lim_send_csa_restart_req(struct mac_context *mac_ctx, uint8_t vdev_id);
Abhishek Singh20a8e442018-09-12 15:50:44 +05301022
Abhishek Singhdfa69c32018-08-30 15:39:34 +05301023/**
1024 * lim_process_mlm_start_req() - process MLM_START_REQ message
1025 *
1026 * @mac_ctx: global MAC context
1027 * @mlm_start_req: Pointer to start req
1028 *
1029 * This function is called to process MLM_START_REQ message
1030 * from SME. MLME now waits for HAL to send WMA_ADD_BSS_RSP.
1031 *
1032 * Return: None
1033 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001034void lim_process_mlm_start_req(struct mac_context *mac_ctx,
Abhishek Singhdfa69c32018-08-30 15:39:34 +05301035 tLimMlmStartReq *mlm_start_req);
Padma, Santhosh Kumar22c462c2018-01-16 17:56:44 +05301036
Sandeep Puligilla45e0c5e2018-09-21 00:38:23 -07001037/**
1038 * lim_process_mlm_join_req() - process mlm join request.
1039 *
1040 * @mac_ctx: Pointer to Global MAC structure
1041 * @msg: Pointer to the MLM message buffer
1042 *
1043 * This function is called to process MLM_JOIN_REQ message
1044 * from SME. It does following:
1045 * 1) Initialize LIM, HAL, DPH
1046 * 2) Configure the BSS for which the JOIN REQ was received
1047 * a) Send WMA_ADD_BSS_REQ to HAL -
1048 * This will identify the BSS that we are interested in
1049 * --AND--
1050 * Add a STA entry for the AP (in a STA context)
1051 * b) Wait for WMA_ADD_BSS_RSP
1052 * c) Send WMA_ADD_STA_REQ to HAL
1053 * This will add the "local STA" entry to the STA table
1054 * 3) Continue as before, i.e,
1055 * a) Send a PROBE REQ
1056 * b) Wait for PROBE RSP/BEACON containing the SSID that
1057 * we are interested in
1058 * c) Then start an AUTH seq
1059 * d) Followed by the ASSOC seq
1060 *
1061 * @Return: None
1062 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001063void lim_process_mlm_join_req(struct mac_context *mac_ctx,
Sandeep Puligilla45e0c5e2018-09-21 00:38:23 -07001064 tLimMlmJoinReq *mlm_join_req);
Sandeep Puligilla30bb8402018-09-23 22:01:08 -07001065
1066/*
1067 * lim_process_mlm_deauth_req() - This function is called to process
1068 * MLM_DEAUTH_REQ message from SME
1069 *
1070 * @mac_ctx: Pointer to Global MAC structure
1071 * @msg_buf: A pointer to the MLM message buffer
1072 *
1073 * This function is called to process MLM_DEAUTH_REQ message from SME
1074 *
1075 * @Return: None
1076 */
Jeff Johnson8d8a9ab2018-12-02 12:52:36 -08001077void lim_process_mlm_deauth_req(struct mac_context *mac_ctx, uint32_t *msg_buf);
Sandeep Puligilla30bb8402018-09-23 22:01:08 -07001078
1079#ifdef CONFIG_VDEV_SM
1080/**
1081 * lim_sta_mlme_vdev_disconnect_bss() - Disconnect from BSS
1082 * @vdev_mlme_obj: VDEV MLME comp object
1083 * @data_len: data size
1084 * @data: event data
1085 *
1086 * API invokes BSS disconnection
1087 *
1088 * Return: SUCCESS on successful completion of disconnection
1089 * FAILURE, if it fails due to any
1090 */
1091QDF_STATUS lim_sta_mlme_vdev_disconnect_bss(struct vdev_mlme_obj *vdev_mlme,
1092 uint16_t data_len, void *data);
1093#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001094#endif /* __LIM_TYPES_H */