blob: 664c5233cde2ef50e674da66ae89572c8734f321 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Abhishek Singh7996eb72015-12-30 17:24:02 +05302 * Copyright (c) 2011-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 ProcessMessageQueue.cc contains the code
30 * for processing LIM message Queue.
31 * Author: Chandra Modumudi
32 * Date: 02/11/02
33 * History:-
34 * Date Modified by Modification Information
35 * --------------------------------------------------------------------
36 *
37 */
38#include "cds_api.h"
39#include "wni_api.h"
40#include "wma_types.h"
41
42#include "wni_cfg.h"
43#include "cfg_api.h"
44#include "sir_common.h"
45#include "utils_api.h"
46#include "lim_types.h"
47#include "lim_utils.h"
48#include "lim_assoc_utils.h"
49#include "lim_prop_exts_utils.h"
50
51#include "lim_admit_control.h"
52#include "lim_ibss_peer_mgmt.h"
53#include "sch_api.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080054#include "lim_ft_defs.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080055#include "lim_session.h"
56#include "lim_send_messages.h"
57
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080058#include "rrm_api.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080059
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080060#include "lim_ft.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080061
Anurag Chouhan6d760662016-02-20 16:05:43 +053062#include "qdf_types.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080063#include "cds_packet.h"
Anurag Chouhan600c3a02016-03-01 10:33:54 +053064#include "qdf_mem.h"
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +053065#include "cds_concurrency.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080066
67void lim_log_session_states(tpAniSirGlobal pMac);
68static void lim_process_normal_hdd_msg(tpAniSirGlobal mac_ctx,
69 struct sSirMsgQ *msg, uint8_t rsp_reqd);
70
71/**
72 * lim_process_dual_mac_cfg_resp() - Process set dual mac config response
73 * @mac: Global MAC pointer
74 * @body: Set dual mac config response in sir_dual_mac_config_resp format
75 *
76 * Process the set dual mac config response and post the message
77 * to SME to process this further and release the active
78 * command list
79 *
80 * Return: None
81 */
82static void lim_process_dual_mac_cfg_resp(tpAniSirGlobal mac, void *body)
83{
84 struct sir_dual_mac_config_resp *resp, *param;
85 uint32_t len, fail_resp = 0;
86 tSirMsgQ msg;
87
88 resp = (struct sir_dual_mac_config_resp *)body;
89 if (!resp) {
90 lim_log(mac, LOGE, FL("Set dual mac cfg param is NULL"));
91 fail_resp = 1;
92 /* Not returning here. If possible, let us proceed
93 * and send fail response to SME
94 */
95 }
96
97 len = sizeof(*param);
98
Anurag Chouhan600c3a02016-03-01 10:33:54 +053099 param = qdf_mem_malloc(len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800100 if (!param) {
101 lim_log(mac, LOGE, FL("Fail to allocate memory"));
102 /* Memory allocation for param failed.
103 * Cannot send fail status back to SME
104 */
105 return;
106 }
107
108 if (fail_resp) {
109 lim_log(mac, LOGE, FL("Send fail status to SME"));
110 param->status = SET_HW_MODE_STATUS_ECANCELED;
111 } else {
112 param->status = resp->status;
113 /*
114 * TODO: Update this HW mode info in any UMAC params, if needed
115 */
116 }
117
118 msg.type = eWNI_SME_SET_DUAL_MAC_CFG_RESP;
119 msg.bodyptr = param;
120 msg.bodyval = 0;
121 lim_log(mac, LOG1, FL("Send eWNI_SME_SET_DUAL_MAC_CFG_RESP to SME"));
122 lim_sys_process_mmh_msg_api(mac, &msg, ePROT);
123 return;
124}
125
126/**
127 * lim_process_set_hw_mode_resp() - Process set HW mode response
128 * @mac: Global MAC pointer
129 * @body: Set HW mode response in sir_set_hw_mode_resp format
130 *
131 * Process the set HW mode response and post the message
132 * to SME to process this further and release the active
133 * command list
134 *
135 * Return: None
136 */
137static void lim_process_set_hw_mode_resp(tpAniSirGlobal mac, void *body)
138{
139 struct sir_set_hw_mode_resp *resp, *param;
140 uint32_t len, i, fail_resp = 0;
141 tSirMsgQ msg;
142
143 resp = (struct sir_set_hw_mode_resp *)body;
144 if (!resp) {
145 lim_log(mac, LOGE, FL("Set HW mode param is NULL"));
146 fail_resp = 1;
147 /* Not returning here. If possible, let us proceed
148 * and send fail response to SME */
149 }
150
151 len = sizeof(*param);
152
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530153 param = qdf_mem_malloc(len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800154 if (!param) {
155 lim_log(mac, LOGE, FL("Fail to allocate memory"));
156 /* Memory allocation for param failed.
157 * Cannot send fail status back to SME
158 */
159 return;
160 }
161
162 if (fail_resp) {
163 lim_log(mac, LOGE, FL("Send fail status to SME"));
164 param->status = SET_HW_MODE_STATUS_ECANCELED;
165 param->cfgd_hw_mode_index = 0;
166 param->num_vdev_mac_entries = 0;
167 } else {
168 param->status = resp->status;
169 param->cfgd_hw_mode_index = resp->cfgd_hw_mode_index;
170 param->num_vdev_mac_entries = resp->num_vdev_mac_entries;
171
172 for (i = 0; i < resp->num_vdev_mac_entries; i++) {
173 param->vdev_mac_map[i].vdev_id =
174 resp->vdev_mac_map[i].vdev_id;
175 param->vdev_mac_map[i].mac_id =
176 resp->vdev_mac_map[i].mac_id;
177 }
178 /*
179 * TODO: Update this HW mode info in any UMAC params, if needed
180 */
181 }
182
183 msg.type = eWNI_SME_SET_HW_MODE_RESP;
184 msg.bodyptr = param;
185 msg.bodyval = 0;
186 lim_log(mac, LOGE, FL("Send eWNI_SME_SET_HW_MODE_RESP to SME"));
187 lim_sys_process_mmh_msg_api(mac, &msg, ePROT);
188 return;
189}
190
191/**
192 * lim_process_hw_mode_trans_ind() - Process set HW mode transition indication
193 * @mac: Global MAC pointer
194 * @body: Set HW mode response in sir_hw_mode_trans_ind format
195 *
196 * Process the set HW mode transition indication and post the message
197 * to SME to invoke the HDD callback
198 * command list
199 *
200 * Return: None
201 */
202static void lim_process_hw_mode_trans_ind(tpAniSirGlobal mac, void *body)
203{
204 struct sir_hw_mode_trans_ind *ind, *param;
205 uint32_t len, i;
206 tSirMsgQ msg;
207
208 ind = (struct sir_hw_mode_trans_ind *)body;
209 if (!ind) {
210 lim_log(mac, LOGE, FL("Set HW mode trans ind param is NULL"));
211 return;
212 }
213
214 len = sizeof(*param);
215
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530216 param = qdf_mem_malloc(len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800217 if (!param) {
218 lim_log(mac, LOGE, FL("Fail to allocate memory"));
219 return;
220 }
221
222 param->old_hw_mode_index = ind->old_hw_mode_index;
223 param->new_hw_mode_index = ind->new_hw_mode_index;
224 param->num_vdev_mac_entries = ind->num_vdev_mac_entries;
225
226 for (i = 0; i < ind->num_vdev_mac_entries; i++) {
227 param->vdev_mac_map[i].vdev_id =
228 ind->vdev_mac_map[i].vdev_id;
229 param->vdev_mac_map[i].mac_id =
230 ind->vdev_mac_map[i].mac_id;
231 }
232
233 /* TODO: Update this HW mode info in any UMAC params, if needed */
234
235 msg.type = eWNI_SME_HW_MODE_TRANS_IND;
236 msg.bodyptr = param;
237 msg.bodyval = 0;
238 lim_log(mac, LOGE, FL("Send eWNI_SME_HW_MODE_TRANS_IND to SME"));
239 lim_sys_process_mmh_msg_api(mac, &msg, ePROT);
240 return;
241}
242
243/** -------------------------------------------------------------
244 \fn def_msg_decision
245 \brief The function decides whether to defer a message or not in limProcessMessage function
246 \param tpAniSirGlobal pMac
247 \param tSirMsgQ limMsg
248 \param tSirMacTspecIE *ppInfo
249 \return none
250 -------------------------------------------------------------*/
251
252uint8_t static def_msg_decision(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
253{
254
255/* this function should not changed */
256 if (pMac->lim.gLimSmeState == eLIM_SME_OFFLINE_STATE) {
257 /* Defer processsing this message */
258 if (lim_defer_msg(pMac, limMsg) != TX_SUCCESS) {
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530259 QDF_TRACE(QDF_MODULE_ID_PE, LOGE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800260 FL("Unable to Defer Msg"));
261 lim_log_session_states(pMac);
262 lim_handle_defer_msg_error(pMac, limMsg);
263 }
264 return true;
265 }
266 /* When defer is requested then defer all the messages except HAL responses. */
267 if ((!lim_is_system_in_scan_state(pMac))
268 && (true != GET_LIM_PROCESS_DEFD_MESGS(pMac))
269 && !pMac->lim.gLimSystemInScanLearnMode) {
270 if ((limMsg->type != WMA_ADD_BSS_RSP)
271 && (limMsg->type != WMA_DELETE_BSS_RSP)
272 && (limMsg->type != WMA_ADD_STA_RSP)
273 && (limMsg->type != WMA_DELETE_STA_RSP)
274 && (limMsg->type != WMA_SET_BSSKEY_RSP)
275 && (limMsg->type != WMA_SET_STAKEY_RSP)
276 && (limMsg->type != WMA_SET_STA_BCASTKEY_RSP)
277 && (limMsg->type != WMA_AGGR_QOS_RSP)
278 && (limMsg->type != WMA_SET_MIMOPS_RSP)
279 && (limMsg->type != WMA_SWITCH_CHANNEL_RSP)
280 && (limMsg->type != WMA_P2P_NOA_ATTR_IND)
281 && (limMsg->type != WMA_P2P_NOA_START_IND) &&
282#ifdef FEATURE_OEM_DATA_SUPPORT
283 (limMsg->type != WMA_START_OEM_DATA_RSP) &&
284#endif
Hema Aparna Medicharla5e1f3022015-08-24 11:22:29 +0530285 (limMsg->type != WMA_ADD_TS_RSP) &&
Hanumantha Reddy Pothulab8340212016-01-12 11:16:06 +0530286 /*
287 * LIM won't process any defer queue commands if gLimAddtsSent is
288 * set to TRUE. gLimAddtsSent will be set TRUE to while sending
289 * ADDTS REQ. Say, when deferring is enabled, if
290 * SIR_LIM_ADDTS_RSP_TIMEOUT is posted (because of not receiving ADDTS
291 * RSP) then this command will be added to defer queue and as
292 * gLimAddtsSent is set TRUE LIM will never process any commands from
293 * defer queue, including SIR_LIM_ADDTS_RSP_TIMEOUT. Hence allowing
294 * SIR_LIM_ADDTS_RSP_TIMEOUT command to be processed with deferring
295 * enabled, so that this will be processed immediately and sets
296 * gLimAddtsSent to FALSE.
297 */
298 (limMsg->type != SIR_LIM_ADDTS_RSP_TIMEOUT) &&
Hema Aparna Medicharla5e1f3022015-08-24 11:22:29 +0530299 /* Allow processing of RX frames while awaiting reception
300 * of ADD TS response over the air. This logic particularly
301 * handles the case when host sends ADD BA request to FW
302 * after ADD TS request is sent over the air and
303 * ADD TS response received over the air */
304 !(limMsg->type == SIR_BB_XPORT_MGMT_MSG &&
305 pMac->lim.gLimAddtsSent)) {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800306 PELOG1(lim_log
307 (pMac, LOG1,
308 FL
309 ("Defer the current message %s , gLimProcessDefdMsgs is false and system is not in scan/learn mode"),
310 lim_msg_str(limMsg->type));
311 )
312 /* Defer processsing this message */
313 if (lim_defer_msg(pMac, limMsg) != TX_SUCCESS) {
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530314 QDF_TRACE(QDF_MODULE_ID_PE, LOGE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800315 FL("Unable to Defer Msg"));
316 lim_log_session_states(pMac);
317 lim_handle_defer_msg_error(pMac, limMsg);
318
319 }
320 return true;
321 }
322 }
323 return false;
324}
325
326#ifdef FEATURE_WLAN_EXTSCAN
327static void
328__lim_pno_match_fwd_bcn_probepsp(tpAniSirGlobal pmac, uint8_t *rx_pkt_info,
329 tSirProbeRespBeacon *frame, uint32_t ie_len,
330 uint32_t msg_type)
331{
332 struct pno_match_found *result;
333 uint8_t *body;
334 tSirMsgQ mmh_msg;
335 tpSirMacMgmtHdr hdr;
336 uint32_t num_results = 1, len, i;
337
338 /* Upon receiving every matched beacon, bss info is forwarded to the
339 * the upper layer, hence num_results is set to 1 */
340 len = sizeof(*result) + (num_results * sizeof(tSirWifiScanResult)) +
341 ie_len;
342
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530343 result = qdf_mem_malloc(len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800344 if (NULL == result) {
345 lim_log(pmac, LOGE, FL("Memory allocation failed"));
346 return;
347 }
348 hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info);
349 body = WMA_GET_RX_MPDU_DATA(rx_pkt_info);
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530350 qdf_mem_zero(result, sizeof(*result) + ie_len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800351
352 /* Received frame does not have request id, hence set 0 */
353 result->request_id = 0;
354 result->more_data = 0;
355 result->num_results = num_results;
356
357 for (i = 0; i < result->num_results; i++) {
Anurag Chouhan210db072016-02-22 18:42:15 +0530358 result->ap[i].ts = qdf_mc_timer_get_system_time();
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800359 result->ap[i].beaconPeriod = frame->beaconInterval;
360 result->ap[i].capability =
361 lim_get_u16((uint8_t *) &frame->capabilityInfo);
362 result->ap[i].channel = WMA_GET_RX_CH(rx_pkt_info);
Deepak Dhamdhere68929ec2015-08-05 15:16:35 -0700363 result->ap[i].rssi = WMA_GET_RX_RSSI_NORMALIZED(rx_pkt_info);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800364 result->ap[i].rtt = 0;
365 result->ap[i].rtt_sd = 0;
366 result->ap[i].ieLength = ie_len;
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530367 qdf_mem_copy((uint8_t *) &result->ap[i].ssid[0],
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800368 (uint8_t *) frame->ssId.ssId, frame->ssId.length);
369 result->ap[i].ssid[frame->ssId.length] = '\0';
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530370 qdf_mem_copy((uint8_t *) &result->ap[i].bssid,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800371 (uint8_t *) hdr->bssId,
372 sizeof(tSirMacAddr));
373 /* Copy IE fields */
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530374 qdf_mem_copy((uint8_t *) &result->ap[i].ieData,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800375 body + SIR_MAC_B_PR_SSID_OFFSET, ie_len);
376 }
377
378 mmh_msg.type = msg_type;
379 mmh_msg.bodyptr = result;
380 mmh_msg.bodyval = 0;
381 lim_sys_process_mmh_msg_api(pmac, &mmh_msg, ePROT);
382}
383
384
385static void
386__lim_ext_scan_forward_bcn_probe_rsp(tpAniSirGlobal pmac, uint8_t *rx_pkt_info,
387 tSirProbeRespBeacon *frame,
388 uint32_t ie_len,
389 uint32_t msg_type)
390{
391 tpSirWifiFullScanResultEvent result;
392 uint8_t *body;
393 tSirMsgQ mmh_msg;
394 tpSirMacMgmtHdr hdr;
395
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530396 result = qdf_mem_malloc(sizeof(*result) + ie_len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800397 if (NULL == result) {
398 lim_log(pmac, LOGE, FL("Memory allocation failed"));
399 return;
400 }
401 hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info);
402 body = WMA_GET_RX_MPDU_DATA(rx_pkt_info);
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530403 qdf_mem_zero(result, sizeof(*result) + ie_len);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800404
405 /* Received frame does not have request id, hence set 0 */
406 result->requestId = 0;
407
408 result->moreData = 0;
Anurag Chouhan210db072016-02-22 18:42:15 +0530409 result->ap.ts = qdf_mc_timer_get_system_time();
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800410 result->ap.beaconPeriod = frame->beaconInterval;
411 result->ap.capability =
412 lim_get_u16((uint8_t *) &frame->capabilityInfo);
413 result->ap.channel = WMA_GET_RX_CH(rx_pkt_info);
Deepak Dhamdhere68929ec2015-08-05 15:16:35 -0700414 result->ap.rssi = WMA_GET_RX_RSSI_NORMALIZED(rx_pkt_info);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800415 result->ap.rtt = 0;
416 result->ap.rtt_sd = 0;
417 result->ap.ieLength = ie_len;
418
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530419 qdf_mem_copy((uint8_t *) &result->ap.ssid[0],
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800420 (uint8_t *) frame->ssId.ssId, frame->ssId.length);
421 result->ap.ssid[frame->ssId.length] = '\0';
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530422 qdf_mem_copy((uint8_t *) &result->ap.bssid.bytes,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800423 (uint8_t *) hdr->bssId,
Anurag Chouhan6d760662016-02-20 16:05:43 +0530424 QDF_MAC_ADDR_SIZE);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800425 /* Copy IE fields */
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530426 qdf_mem_copy((uint8_t *) &result->ap.ieData,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800427 body + SIR_MAC_B_PR_SSID_OFFSET, ie_len);
428
429 mmh_msg.type = msg_type;
430 mmh_msg.bodyptr = result;
431 mmh_msg.bodyval = 0;
432 lim_sys_process_mmh_msg_api(pmac, &mmh_msg, ePROT);
433}
434
435static void
436__lim_process_ext_scan_beacon_probe_rsp(tpAniSirGlobal pmac,
437 uint8_t *rx_pkt_info,
438 uint8_t sub_type)
439{
440 tSirProbeRespBeacon *frame;
441 uint8_t *body;
442 uint32_t frm_len;
443 tSirRetStatus status;
444
445 frm_len = WMA_GET_RX_PAYLOAD_LEN(rx_pkt_info);
446 if (frm_len <= SIR_MAC_B_PR_SSID_OFFSET) {
447 lim_log(pmac, LOGP,
448 FL("RX packet has invalid length %d"), frm_len);
449 return;
450 }
451
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530452 frame = qdf_mem_malloc(sizeof(*frame));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800453 if (NULL == frame) {
454 lim_log(pmac, LOGE, FL("Memory allocation failed"));
455 return;
456 }
457
458 if (sub_type == SIR_MAC_MGMT_BEACON) {
459 lim_log(pmac, LOG2, FL("Beacon due to ExtScan/epno"));
460 status = sir_convert_beacon_frame2_struct(pmac,
461 (uint8_t *)rx_pkt_info,
462 frame);
463 } else if (sub_type == SIR_MAC_MGMT_PROBE_RSP) {
464 lim_log(pmac, LOG2, FL("Probe Rsp due to ExtScan/epno"));
465 body = WMA_GET_RX_MPDU_DATA(rx_pkt_info);
466 status = sir_convert_probe_frame2_struct(pmac, body,
467 frm_len, frame);
468 } else {
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530469 qdf_mem_free(frame);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800470 return;
471 }
472
473 if (status != eSIR_SUCCESS) {
474 lim_log(pmac, LOGE, FL("Frame parsing failed"));
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530475 qdf_mem_free(frame);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800476 return;
477 }
478
479 if (WMA_IS_EXTSCAN_SCAN_SRC(rx_pkt_info))
480 __lim_ext_scan_forward_bcn_probe_rsp(pmac, rx_pkt_info, frame,
481 (frm_len - SIR_MAC_B_PR_SSID_OFFSET),
482 eWNI_SME_EXTSCAN_FULL_SCAN_RESULT_IND);
483
484 if (WMA_IS_EPNO_SCAN_SRC(rx_pkt_info))
485 __lim_pno_match_fwd_bcn_probepsp(pmac, rx_pkt_info, frame,
486 (frm_len - SIR_MAC_B_PR_SSID_OFFSET),
487 eWNI_SME_EPNO_NETWORK_FOUND_IND);
488
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530489 qdf_mem_free(frame);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800490}
491#endif
492
493/*
494 * Beacon Handling Cases:
495 * during scanning, when no session is active:
496 * handled by lim_handle_frames_in_scan_state before __lim_handle_beacon call is invoked.
497 * during scanning, when any session is active, but beacon/Pr does not belong to that session, psessionEntry will be null.
498 * handled by lim_handle_frames_in_scan_state before __lim_handle_beacon call is invoked.
499 * during scanning, when any session is active, and beacon/Pr belongs to one of the session, psessionEntry will not be null.
500 * handled by lim_handle_frames_in_scan_state before __lim_handle_beacon call is invoked.
501 * Not scanning, no session:
502 * there should not be any beacon coming, if coming, should be dropped.
503 * Not Scanning,
504 */
505static void
506__lim_handle_beacon(tpAniSirGlobal pMac, tpSirMsgQ pMsg,
507 tpPESession psessionEntry)
508{
509 /* checking for global SME state... */
510 uint8_t *pRxPacketInfo;
511 lim_get_b_dfrom_rx_packet(pMac, pMsg->bodyptr,
Anurag Chouhanffb21542016-02-17 14:33:03 +0530512 (uint32_t **) &pRxPacketInfo);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800513
514 /* This function should not be called if beacon is received in scan state. */
515 /* So not doing any checks for the global state. */
516
517 if (psessionEntry == NULL) {
518 sch_beacon_process(pMac, pRxPacketInfo, NULL);
519 } else if ((psessionEntry->limSmeState == eLIM_SME_LINK_EST_STATE) ||
520 (psessionEntry->limSmeState == eLIM_SME_NORMAL_STATE)) {
521 sch_beacon_process(pMac, pRxPacketInfo, psessionEntry);
522 } else
523 lim_process_beacon_frame(pMac, pRxPacketInfo, psessionEntry);
524
525 return;
526}
527
528/**
529 * lim_defer_msg()
530 *
531 ***FUNCTION:
532 * This function is called to defer the messages received
533 * during Learn mode
534 *
535 ***LOGIC:
536 * NA
537 *
538 ***ASSUMPTIONS:
539 * NA
540 *
541 ***NOTE:
542 * NA
543 *
544 * @param pMac - Pointer to Global MAC structure
545 * @param pMsg of type tSirMsgQ - Pointer to the message structure
546 * @return None
547 */
548
549uint32_t lim_defer_msg(tpAniSirGlobal pMac, tSirMsgQ *pMsg)
550{
551 uint32_t retCode = TX_SUCCESS;
552
553 retCode = lim_write_deferred_msg_q(pMac, pMsg);
554
555 if (retCode == TX_SUCCESS) {
556 MTRACE(mac_trace_msg_rx
557 (pMac, NO_SESSION,
558 LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DEFERRED));
559 )
560 } else {
561 lim_log(pMac, LOGE, FL("Dropped lim message (0x%X)"),
562 pMsg->type);
563 MTRACE(mac_trace_msg_rx
564 (pMac, NO_SESSION,
565 LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DROPPED));
566 )
567 }
568
569 return retCode;
570} /*** end lim_defer_msg() ***/
571
572/**
573 * lim_handle_unknown_a2_index_frames() - This function handles Unknown Unicast
574 * (A2 Index) packets
575 * @mac_ctx: Pointer to the Global Mac Context.
576 * @rx_pkt_buffer: Pointer to the packet Buffer descriptor.
577 * @session_entry: Pointer to the PE Session Entry.
578 *
579 * This routine will handle public action frames.
580 *
581 * Return: None.
582 */
583static void lim_handle_unknown_a2_index_frames(tpAniSirGlobal mac_ctx,
584 void *rx_pkt_buffer, tpPESession session_entry)
585{
586#ifdef FEATURE_WLAN_TDLS
587 tpSirMacDataHdr3a mac_hdr;
588#endif
589 if (LIM_IS_P2P_DEVICE_ROLE(session_entry))
590 lim_process_action_frame_no_session(mac_ctx,
591 (uint8_t *) rx_pkt_buffer);
592#ifdef FEATURE_WLAN_TDLS
593 mac_hdr = WMA_GET_RX_MPDUHEADER3A(rx_pkt_buffer);
594
595 if (lim_is_group_addr(mac_hdr->addr2)) {
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530596 QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO_HIGH,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800597 FL("Ignoring A2 Invalid Packet received for MC/BC:"));
598 lim_print_mac_addr(mac_ctx, mac_hdr->addr2, LOG2);
599 return;
600 }
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530601 QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800602 FL("type=0x%x, subtype=0x%x"),
603 mac_hdr->fc.type, mac_hdr->fc.subType);
604 /* Currently only following type and subtype are handled.
605 * If there are more combinations, then add switch-case
606 * statements.
607 */
608 if (LIM_IS_STA_ROLE(session_entry) &&
609 (mac_hdr->fc.type == SIR_MAC_MGMT_FRAME) &&
610 (mac_hdr->fc.subType == SIR_MAC_MGMT_ACTION))
611 lim_process_action_frame(mac_ctx, rx_pkt_buffer, session_entry);
612#endif
613 return;
614}
615
616/**
617 * lim_check_mgmt_registered_frames() - This function handles registered
618 * management frames.
619 *
620 * @mac_ctx: Pointer to the Global Mac Context.
621 * @buff_desc: Pointer to the packet Buffer descriptor.
622 * @session_entry: Pointer to the PE Session Entry.
623 *
624 * This function is called to process to check if received frame match with
625 * any of the registered frame from HDD. If yes pass this frame to SME.
626 *
627 * Return: True or False for Match or Mismatch respectively.
628 */
629static bool
630lim_check_mgmt_registered_frames(tpAniSirGlobal mac_ctx, uint8_t *buff_desc,
631 tpPESession session_entry)
632{
633 tSirMacFrameCtl fc;
634 tpSirMacMgmtHdr hdr;
635 uint8_t *body;
636 struct mgmt_frm_reg_info *mgmt_frame = NULL;
637 struct mgmt_frm_reg_info *next_frm = NULL;
638 uint16_t frm_type;
639 uint16_t frm_len;
640 uint8_t type, sub_type;
641 bool match = false;
Anurag Chouhanffb21542016-02-17 14:33:03 +0530642 QDF_STATUS qdf_status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800643
644 hdr = WMA_GET_RX_MAC_HEADER(buff_desc);
645 fc = hdr->fc;
646 frm_type = (fc.type << 2) | (fc.subType << 4);
647 body = WMA_GET_RX_MPDU_DATA(buff_desc);
648 frm_len = WMA_GET_RX_PAYLOAD_LEN(buff_desc);
649
Anurag Chouhana37b5b72016-02-21 14:53:42 +0530650 qdf_mutex_acquire(&mac_ctx->lim.lim_frame_register_lock);
Anurag Chouhanffb21542016-02-17 14:33:03 +0530651 qdf_list_peek_front(&mac_ctx->lim.gLimMgmtFrameRegistratinQueue,
652 (qdf_list_node_t **) &mgmt_frame);
Anurag Chouhana37b5b72016-02-21 14:53:42 +0530653 qdf_mutex_release(&mac_ctx->lim.lim_frame_register_lock);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800654
655 while (mgmt_frame != NULL) {
656 type = (mgmt_frame->frameType >> 2) & 0x03;
657 sub_type = (mgmt_frame->frameType >> 4) & 0x0f;
658 if ((type == SIR_MAC_MGMT_FRAME)
659 && (fc.type == SIR_MAC_MGMT_FRAME)
660 && (sub_type == SIR_MAC_MGMT_RESERVED15)) {
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530661 QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO_HIGH,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800662 FL
663 ("rcvd frm match for SIR_MAC_MGMT_RESERVED15"));
664 match = true;
665 break;
666 }
667 if (mgmt_frame->frameType == frm_type) {
668 if (mgmt_frame->matchLen <= 0) {
669 match = true;
670 break;
671 }
672 if (mgmt_frame->matchLen <= frm_len &&
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530673 (!qdf_mem_cmp(mgmt_frame->matchData, body,
674 mgmt_frame->matchLen))) {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800675 /* found match! */
676 match = true;
677 break;
678 }
679 }
680
Anurag Chouhana37b5b72016-02-21 14:53:42 +0530681 qdf_mutex_acquire(&mac_ctx->lim.lim_frame_register_lock);
Anurag Chouhanffb21542016-02-17 14:33:03 +0530682 qdf_status =
683 qdf_list_peek_next(
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800684 &mac_ctx->lim.gLimMgmtFrameRegistratinQueue,
Anurag Chouhanffb21542016-02-17 14:33:03 +0530685 (qdf_list_node_t *) mgmt_frame,
686 (qdf_list_node_t **) &next_frm);
Anurag Chouhana37b5b72016-02-21 14:53:42 +0530687 qdf_mutex_release(&mac_ctx->lim.lim_frame_register_lock);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800688 mgmt_frame = next_frm;
689 next_frm = NULL;
690 }
691
692 if (match) {
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530693 QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800694 FL("rcvd frame match with registered frame params"));
695 /* Indicate this to SME */
696 lim_send_sme_mgmt_frame_ind(mac_ctx, hdr->fc.subType,
697 (uint8_t *) hdr,
698 WMA_GET_RX_PAYLOAD_LEN(buff_desc) +
699 sizeof(tSirMacMgmtHdr), mgmt_frame->sessionId,
700 WMA_GET_RX_CH(buff_desc), session_entry, 0);
701
702 if ((type == SIR_MAC_MGMT_FRAME)
703 && (fc.type == SIR_MAC_MGMT_FRAME)
704 && (sub_type == SIR_MAC_MGMT_RESERVED15))
705 /* These packets needs to be processed by PE/SME
706 * as well as HDD.If it returns true here,
707 * the packet is forwarded to HDD only.
708 */
709 match = false;
710 }
711
712 return match;
713}
714
715/**
716 * lim_handle80211_frames()
717 *
718 ***FUNCTION:
719 * This function is called to process 802.11 frames
720 * received by LIM.
721 *
722 ***LOGIC:
723 * NA
724 *
725 ***ASSUMPTIONS:
726 * NA
727 *
728 ***NOTE:
729 * NA
730 *
731 * @param pMac - Pointer to Global MAC structure
732 * @param pMsg of type tSirMsgQ - Pointer to the message structure
733 * @return None
734 */
735
736static void
737lim_handle80211_frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, uint8_t *pDeferMsg)
738{
739 uint8_t *pRxPacketInfo = NULL;
740 tSirMacFrameCtl fc;
741 tpSirMacMgmtHdr pHdr = NULL;
742 tpPESession psessionEntry = NULL;
743 uint8_t sessionId;
744 tAniBool isFrmFt = false;
745
746 *pDeferMsg = false;
747 lim_get_b_dfrom_rx_packet(pMac, limMsg->bodyptr,
Anurag Chouhanffb21542016-02-17 14:33:03 +0530748 (uint32_t **) &pRxPacketInfo);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800749
750 pHdr = WMA_GET_RX_MAC_HEADER(pRxPacketInfo);
751 isFrmFt = WMA_GET_RX_FT_DONE(pRxPacketInfo);
752 fc = pHdr->fc;
753
754#ifdef WLAN_DUMP_MGMTFRAMES
755 lim_log(pMac, LOGE,
756 FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"),
757 fc.protVer, fc.type, fc.subType,
758 WMA_GET_RX_MAC_RATE_IDX(pRxPacketInfo));
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530759 QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_ERROR, pHdr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800760 WMA_GET_RX_MPDU_HEADER_LEN(pRxPacketInfo));
761#endif
762 if (pMac->fEnableDebugLog & 0x1) {
763 if ((fc.type == SIR_MAC_MGMT_FRAME) &&
764 (fc.subType != SIR_MAC_MGMT_PROBE_REQ) &&
765 (fc.subType != SIR_MAC_MGMT_PROBE_RSP) &&
766 (fc.subType != SIR_MAC_MGMT_BEACON)) {
767 lim_log(pMac, LOGE,
768 FL("RX MGMT - Type %hu, SubType %hu, seq num[%d]"),
769 fc.type,
770 fc.subType,
771 ((pHdr->seqControl.seqNumHi <<
772 HIGH_SEQ_NUM_OFFSET) |
773 pHdr->seqControl.seqNumLo));
774 }
775 }
776#ifdef FEATURE_WLAN_EXTSCAN
777 if (WMA_IS_EXTSCAN_SCAN_SRC(pRxPacketInfo) ||
778 WMA_IS_EPNO_SCAN_SRC(pRxPacketInfo)) {
779 if (fc.subType == SIR_MAC_MGMT_BEACON ||
780 fc.subType == SIR_MAC_MGMT_PROBE_RSP) {
781 __lim_process_ext_scan_beacon_probe_rsp(pMac,
782 pRxPacketInfo,
783 fc.subType);
784 } else {
785 lim_log(pMac, LOGE,
786 FL("Wrong frameType %d, Subtype %d for %d"),
787 fc.type, fc.subType,
788 WMA_GET_SCAN_SRC(pRxPacketInfo));
789 }
790 goto end;
791 }
792#endif
793 if (WMA_GET_OFFLOADSCANLEARN(pRxPacketInfo)) {
794 if (fc.subType == SIR_MAC_MGMT_BEACON) {
795 lim_log(pMac, LOG2, FL("Learning scan beacon"));
796 __lim_handle_beacon(pMac, limMsg, NULL);
797 } else if (fc.subType == SIR_MAC_MGMT_PROBE_RSP) {
798 lim_log(pMac, LOG2, FL("Learning scan probe rsp"));
799 lim_process_probe_rsp_frame_no_session(pMac, pRxPacketInfo);
800 } else {
801 lim_log(pMac, LOGE,
802 FL("Wrong frame Type %d, Subtype %d for LFR"),
803 fc.type, fc.subType);
804 }
805 goto end;
806 }
807 /* Added For BT-AMP Support */
Anurag Chouhanffb21542016-02-17 14:33:03 +0530808 psessionEntry = pe_find_session_by_bssid(pMac, pHdr->bssId,
809 &sessionId);
810 if (psessionEntry == NULL) {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800811 if (fc.subType == SIR_MAC_MGMT_AUTH) {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800812 lim_log(pMac, LOG1,
Vidyullatha Kanchanapally3554e4e2015-08-12 12:43:18 -0700813 FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"),
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800814 fc.protVer, fc.type, fc.subType,
815 WMA_GET_RX_MAC_RATE_IDX(pRxPacketInfo));
816 lim_print_mac_addr(pMac, pHdr->bssId, LOG1);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800817 if (lim_process_auth_frame_no_session
818 (pMac, pRxPacketInfo,
819 limMsg->bodyptr) == eSIR_SUCCESS) {
Vidyullatha Kanchanapally3554e4e2015-08-12 12:43:18 -0700820 goto end;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800821 }
822 }
Vidyullatha Kanchanapally3554e4e2015-08-12 12:43:18 -0700823 /* Public action frame can be received from non-assoc stations*/
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800824 if ((fc.subType != SIR_MAC_MGMT_PROBE_RSP) &&
825 (fc.subType != SIR_MAC_MGMT_BEACON) &&
826 (fc.subType != SIR_MAC_MGMT_PROBE_REQ)
Vidyullatha Kanchanapally3554e4e2015-08-12 12:43:18 -0700827 && (fc.subType != SIR_MAC_MGMT_ACTION)) {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800828
Vidyullatha Kanchanapally3554e4e2015-08-12 12:43:18 -0700829 psessionEntry = pe_find_session_by_peer_sta(pMac,
830 pHdr->sa, &sessionId);
831 if (psessionEntry == NULL) {
832 lim_log(pMac, LOG3,
833 FL("session does not exist for bssId"));
834 lim_print_mac_addr(pMac, pHdr->sa, LOG3);
835 goto end;
836 } else {
837 lim_log(pMac, LOG3,
838 "SessionId:%d exists for given Bssid",
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800839 psessionEntry->peSessionId);
Vidyullatha Kanchanapally3554e4e2015-08-12 12:43:18 -0700840 }
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800841 }
842 /* For p2p resp frames search for valid session with DA as */
843 /* BSSID will be SA and session will be present with DA only */
844 if (fc.subType == SIR_MAC_MGMT_ACTION) {
845 psessionEntry =
846 pe_find_session_by_bssid(pMac, pHdr->da, &sessionId);
847 }
848 }
849
850 /* Check if frame is registered by HDD */
851 if (lim_check_mgmt_registered_frames(pMac, pRxPacketInfo, psessionEntry)) {
852 lim_log(pMac, LOG1, FL("Received frame is passed to SME"));
Vidyullatha Kanchanapally3554e4e2015-08-12 12:43:18 -0700853 goto end;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800854 }
855
856 if (fc.protVer != SIR_MAC_PROTOCOL_VERSION) { /* Received Frame with non-zero Protocol Version */
857 lim_log(pMac, LOGE,
858 FL("Unexpected frame with protVersion %d received"),
859 fc.protVer);
860 lim_pkt_free(pMac, TXRX_FRM_802_11_MGMT, pRxPacketInfo,
861 (void *)limMsg->bodyptr);
862#ifdef WLAN_DEBUG
863 pMac->lim.numProtErr++;
864#endif
Vidyullatha Kanchanapally3554e4e2015-08-12 12:43:18 -0700865 goto end;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800866 }
867
868/* Chance of crashing : to be done BT-AMP ........happens when broadcast probe req is received */
869
870#ifdef WLAN_DEBUG
871 pMac->lim.numMAC[fc.type][fc.subType]++;
872#endif
873
874 switch (fc.type) {
875 case SIR_MAC_MGMT_FRAME:
876 {
877 /* Received Management frame */
878 switch (fc.subType) {
879 case SIR_MAC_MGMT_ASSOC_REQ:
880 /* Make sure the role supports Association */
881 if (LIM_IS_BT_AMP_AP_ROLE(psessionEntry) ||
882 LIM_IS_AP_ROLE(psessionEntry))
883 lim_process_assoc_req_frame(pMac,
884 pRxPacketInfo,
885 LIM_ASSOC,
886 psessionEntry);
887 else {
888 /* Unwanted messages - Log error */
889 lim_log(pMac, LOGE,
890 FL
891 ("unexpected message received %X"),
892 limMsg->type);
893 lim_print_msg_name(pMac, LOGE,
894 limMsg->type);
895 }
896 break;
897
898 case SIR_MAC_MGMT_ASSOC_RSP:
899 lim_process_assoc_rsp_frame(pMac, pRxPacketInfo,
900 LIM_ASSOC,
901 psessionEntry);
902 break;
903
904 case SIR_MAC_MGMT_REASSOC_REQ:
905 /* Make sure the role supports Reassociation */
906 if (LIM_IS_BT_AMP_AP_ROLE(psessionEntry) ||
907 LIM_IS_AP_ROLE(psessionEntry)) {
908 lim_process_assoc_req_frame(pMac,
909 pRxPacketInfo,
910 LIM_REASSOC,
911 psessionEntry);
912 } else {
913 /* Unwanted messages - Log error */
914 lim_log(pMac, LOGE,
915 FL
916 ("unexpected message received %X"),
917 limMsg->type);
918 lim_print_msg_name(pMac, LOGE,
919 limMsg->type);
920 }
921 break;
922
923 case SIR_MAC_MGMT_REASSOC_RSP:
924 lim_process_assoc_rsp_frame(pMac, pRxPacketInfo,
925 LIM_REASSOC,
926 psessionEntry);
927 break;
928
929 case SIR_MAC_MGMT_PROBE_REQ:
930 lim_process_probe_req_frame_multiple_bss(pMac,
931 pRxPacketInfo,
932 psessionEntry);
933 break;
934
935 case SIR_MAC_MGMT_PROBE_RSP:
936 if (psessionEntry == NULL)
937 lim_process_probe_rsp_frame_no_session(pMac,
938 pRxPacketInfo);
939 else
940 lim_process_probe_rsp_frame(pMac,
941 pRxPacketInfo,
942 psessionEntry);
943 break;
944
945 case SIR_MAC_MGMT_BEACON:
946 __lim_handle_beacon(pMac, limMsg, psessionEntry);
947 break;
948
949 case SIR_MAC_MGMT_DISASSOC:
950 lim_process_disassoc_frame(pMac, pRxPacketInfo,
951 psessionEntry);
952 break;
953
954 case SIR_MAC_MGMT_AUTH:
955 lim_process_auth_frame(pMac, pRxPacketInfo,
956 psessionEntry);
957 break;
958
959 case SIR_MAC_MGMT_DEAUTH:
960 lim_process_deauth_frame(pMac, pRxPacketInfo,
961 psessionEntry);
962 break;
963
964 case SIR_MAC_MGMT_ACTION:
965 if (psessionEntry == NULL)
966 lim_process_action_frame_no_session(pMac,
967 pRxPacketInfo);
968 else {
969 if (WMA_GET_RX_UNKNOWN_UCAST
970 (pRxPacketInfo))
971 lim_handle_unknown_a2_index_frames
972 (pMac, pRxPacketInfo,
973 psessionEntry);
974 else
975 lim_process_action_frame(pMac,
976 pRxPacketInfo,
977 psessionEntry);
978 }
979 break;
980 default:
981 /* Received Management frame of 'reserved' subtype */
982 break;
983 } /* switch (fc.subType) */
984
985 }
986 break;
987 case SIR_MAC_DATA_FRAME:
988 {
989 }
990 break;
991 default:
992 /* Received frame of type 'reserved' */
993 break;
994
995 } /* switch (fc.type) */
996
997end:
998 lim_pkt_free(pMac, TXRX_FRM_802_11_MGMT, pRxPacketInfo,
999 (void *)limMsg->bodyptr);
1000 return;
1001} /*** end lim_handle80211_frames() ***/
1002
1003/**
1004 * lim_send_stop_scan_offload_req()
1005 *
1006 ***FUNCTION:
1007 * This function will be called to abort the ongoing offloaded scan
1008 * request.
1009 *
1010 *
1011 ***NOTE:
1012 *
1013 * @param pMac Pointer to Global MAC structure
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301014 * @return QDF_STATUS_SUCCESS or QDF_STATUS_E_FAILURE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001015 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301016QDF_STATUS lim_send_stop_scan_offload_req(tpAniSirGlobal pMac,
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001017 uint8_t SessionId, uint32_t scan_id, uint32_t scan_requestor_id)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001018{
1019 tSirMsgQ msg;
1020 tSirRetStatus rc = eSIR_SUCCESS;
1021 tAbortScanParams *pAbortScanParams;
1022
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301023 pAbortScanParams = qdf_mem_malloc(sizeof(tAbortScanParams));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001024 if (NULL == pAbortScanParams) {
1025 lim_log(pMac, LOGP,
1026 FL("Memory allocation failed for AbortScanParams"));
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301027 return QDF_STATUS_E_NOMEM;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001028 }
1029
1030 pAbortScanParams->SessionId = SessionId;
1031 pAbortScanParams->scan_id = scan_id;
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001032 pAbortScanParams->scan_requestor_id = scan_requestor_id;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001033 msg.type = WMA_STOP_SCAN_OFFLOAD_REQ;
1034 msg.bodyptr = pAbortScanParams;
1035 msg.bodyval = 0;
1036
1037 rc = wma_post_ctrl_msg(pMac, &msg);
1038 if (rc != eSIR_SUCCESS) {
1039 lim_log(pMac, LOGE, FL("wma_post_ctrl_msg() return failure"));
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301040 qdf_mem_free(pAbortScanParams);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301041 return QDF_STATUS_E_FAILURE;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001042 }
1043
1044 lim_log(pMac, LOG1, FL("Abort ongoing offload scan."));
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301045 return QDF_STATUS_SUCCESS;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001046
1047}
1048
1049/**
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001050 * lim_process_abort_scan_ind() - abort the scan which is presently being run
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001051 *
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001052 * @mac_ctx: Pointer to Global MAC structure
1053 * @session_id: PE session
1054 * @scan_id: Scan ID from the scan request
1055 * @scan_requesor_id: Entity requesting the scan
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001056 *
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001057 * @return: None
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001058 */
1059void lim_process_abort_scan_ind(tpAniSirGlobal mac_ctx,
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001060 uint8_t session_id, uint32_t scan_id, uint32_t scan_requestor_id)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001061{
1062#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001063 lim_diag_event_report(mac_ctx, WLAN_PE_DIAG_SCAN_ABORT_IND_EVENT,
1064 NULL, 0, 0);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001065#endif
1066
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001067 lim_log(mac_ctx, LOG2, FL("scan_id %d, scan_requestor_id 0x%x"),
1068 scan_id, scan_requestor_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001069
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001070 /* send stop scan cmd to firmware */
1071 lim_send_stop_scan_offload_req(mac_ctx, session_id, scan_id,
1072 scan_requestor_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001073 return;
1074}
1075
1076/**
1077 * lim_message_processor() - Process messages from LIM.
1078 *
1079 * @mac_ctx: Pointer to the Global Mac Context.
1080 * @msg: Received LIM message.
1081 *
1082 * Wrapper function for lim_process_messages when handling messages received by
1083 * LIM.Could either defer messages or process them.
1084 *
1085 * Return: None.
1086 */
1087void lim_message_processor(tpAniSirGlobal mac_ctx, tpSirMsgQ msg)
1088{
1089 if (eLIM_MLM_OFFLINE_STATE == mac_ctx->lim.gLimMlmState) {
1090 pe_free_msg(mac_ctx, msg);
1091 return;
1092 }
1093
1094 if (!def_msg_decision(mac_ctx, msg)) {
1095 lim_process_messages(mac_ctx, msg);
1096 /* process deferred message queue if allowed */
1097 if ((!(mac_ctx->lim.gLimAddtsSent)) &&
1098 (!(lim_is_system_in_scan_state(mac_ctx))) &&
1099 (true == GET_LIM_PROCESS_DEFD_MESGS(mac_ctx)))
1100 lim_process_deferred_message_queue(mac_ctx);
1101 }
1102}
1103
1104#ifdef FEATURE_OEM_DATA_SUPPORT
1105
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301106void lim_oem_data_rsp_handle_resume_link_rsp(tpAniSirGlobal pMac, QDF_STATUS status,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001107 uint32_t *mlmOemDataRsp)
1108{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301109 if (status != QDF_STATUS_SUCCESS) {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001110 lim_log(pMac, LOGE,
1111 FL
1112 ("OEM Data Rsp failed to get the response for resume link"));
1113 }
1114
1115 if (NULL != pMac->lim.gpLimMlmOemDataReq) {
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301116 qdf_mem_free(pMac->lim.gpLimMlmOemDataReq);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001117 pMac->lim.gpLimMlmOemDataReq = NULL;
1118 }
1119 /* "Failure" status doesn't mean that Oem Data Rsp did not happen */
1120 /* and hence we need to respond to upper layers. Only Resume link is failed, but */
1121 /* we got the oem data response already. */
1122 /* Post the meessage to MLM */
1123 lim_post_sme_message(pMac, LIM_MLM_OEM_DATA_CNF,
1124 (uint32_t *) (mlmOemDataRsp));
1125
1126 return;
1127}
1128
1129void lim_process_oem_data_rsp(tpAniSirGlobal pMac, uint32_t *body)
1130{
1131 tpLimMlmOemDataRsp mlmOemDataRsp = NULL;
1132
1133 /* Process all the messages for the lim queue */
1134 SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
1135
1136 mlmOemDataRsp = (tpLimMlmOemDataRsp) body;
1137
1138 PELOG1(lim_log
1139 (pMac, LOG1, FL("%s: sending oem data response msg to sme"),
1140 __func__);
1141 )
1142 lim_post_sme_message(pMac, LIM_MLM_OEM_DATA_CNF,
1143 (uint32_t *) (mlmOemDataRsp));
1144
1145 return;
1146}
1147
1148#endif
1149
1150/**
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05301151 * lim_handle_hw_mode_change_on_csa() - Do HW mode change on CSA for STA mode
1152 * @mac_ctx: Global MAC context
1153 * @msg: Received message
1154 *
1155 * Checks if hw mode change is required for the new channel.
1156 * If MCC upgrade is required, this function will start the opportunistic
1157 * timer and the caller will invoke the other APIs to perform vdev restart on
1158 * the new channel.
1159 *
1160 * If DBS downgrade is required, this function will initiate the hw mode
1161 * change and vdev restart will happen on the new channel after getting hw
1162 * mode response
1163 *
1164 * Return: QDF_STATUS_SUCCESS if processing of csa params (and hence vdev
1165 * restart) needs to happen or if no hw mode change is required,
1166 * QDF_STATUS_E_FAILURE otherwise.
1167 */
1168static QDF_STATUS lim_handle_hw_mode_change_on_csa(tpAniSirGlobal mac_ctx,
1169 tpSirMsgQ msg)
1170{
1171 tpPESession session_entry;
1172 struct csa_offload_params *csa_params =
1173 (struct csa_offload_params *) (msg->bodyptr);
1174 tpDphHashNode sta_ds = NULL;
1175 uint8_t session_id;
1176 uint16_t aid = 0;
1177 enum cds_conc_next_action action;
1178 QDF_STATUS status = QDF_STATUS_E_FAILURE;
1179
1180 lim_log(mac_ctx, LOG1, FL("handle hw mode change for csa"));
1181
1182 if (!csa_params) {
1183 lim_log(mac_ctx, LOGE, FL("limMsgQ body ptr is NULL"));
1184 /* qdf_mem_free() can handle NULL values */
1185 goto err;
1186 }
1187
1188 session_entry = pe_find_session_by_bssid(mac_ctx,
1189 csa_params->bssId, &session_id);
1190 if (!session_entry) {
1191 lim_log(mac_ctx, LOGE, FL("Session does not exist"));
1192 goto err;
1193 }
1194
1195 sta_ds = dph_lookup_hash_entry(mac_ctx, session_entry->bssId, &aid,
1196 &session_entry->dph.dphHashTable);
1197
1198 if (!sta_ds) {
1199 lim_log(mac_ctx, LOGE, FL("sta_ds does not exist"));
1200 goto err;
1201 }
1202
1203 /* Since all the write to the policy manager table happens in the
1204 * MC thread context and this channel change event is also processed
1205 * in the MC thread context, explicit lock/unlock of qdf_conc_list_lock
1206 * is not done here
1207 */
1208 action = cds_get_pref_hw_mode_for_chan(session_entry->smeSessionId,
1209 csa_params->channel);
1210
1211 if (action == CDS_NOP) {
1212 lim_log(mac_ctx, LOG1, FL("no need for hw mode change"));
1213 /* Proceed with processing csa params. So, not freeing it */
1214 return QDF_STATUS_SUCCESS;
1215 }
1216
1217 lim_log(mac_ctx, LOG1, FL("session:%d action:%d"),
1218 session_entry->smeSessionId, action);
1219
1220 /* 1. Start opportunistic timer
1221 * 2. Do vdev restart on the new channel (by the caller)
1222 * 3. PM will check if MCC upgrade can be done after timer expiry
1223 */
1224 if (action == CDS_MCC_UPGRADE) {
1225 status = cds_stop_start_opportunistic_timer();
1226 if (QDF_IS_STATUS_SUCCESS(status))
1227 lim_log(mac_ctx, LOG1,
1228 FL("opportunistic timer for MCC upgrade"));
1229
1230 /* After opportunistic timer is triggered, we can go ahead
1231 * with processing the csa params. So, not freeing the memory
1232 * through 'err' label.
1233 */
1234 return QDF_STATUS_SUCCESS;
1235 }
1236
1237 /* CDS_DBS_DOWNGRADE:
1238 * 1. PM will initiate HW mode change to DBS rightaway
1239 * 2. Do vdev restart on the new channel (on getting hw mode resp)
1240 */
1241 status = cds_next_actions(session_entry->smeSessionId, action,
1242 CDS_UPDATE_REASON_CHANNEL_SWITCH_STA);
1243 if (!QDF_IS_STATUS_SUCCESS(status)) {
1244 lim_log(mac_ctx, LOGE, FL("no set hw mode command was issued"));
1245 /* Proceed with processing csa params. So, not freeing it */
1246 return QDF_STATUS_SUCCESS;
1247 } else {
1248 /* Save the csa params to be used after DBS downgrade */
1249 qdf_mem_copy(&session_entry->saved_csa_params, csa_params,
1250 sizeof(session_entry->saved_csa_params));
1251
1252 lim_log(mac_ctx, LOG1,
1253 FL("saved csa params for dbs downgrade for %pM"),
1254 session_entry->saved_csa_params.bssId);
1255
1256 /* Returning error so that csa params are not processed here */
1257 status = QDF_STATUS_E_FAILURE;
1258 }
1259
1260err:
1261 qdf_mem_free(csa_params);
1262 return status;
1263}
1264
1265/**
1266 * lim_handle_hw_mode_change_on_csa_event() - Handle hw mode change on csa
1267 * @mac_ctx: Pointer to the Global Mac Context
1268 * @msg: Received message
1269 *
1270 * Checks if a hw mode change is required for the received csa event. Processes
1271 * csa params and do vdev restart immediately if the there is no need for a hw
1272 * mode change or if MCC upgrade is required
1273 *
1274 * Return: None
1275 */
1276static void lim_handle_hw_mode_change_on_csa_event(tpAniSirGlobal mac_ctx,
1277 tpSirMsgQ msg)
1278{
1279 QDF_STATUS qdf_status;
1280
1281 lim_log(mac_ctx, LOG1, FL("lim received csa offload event"));
1282 if (mac_ctx->policy_manager_enabled &&
1283 wma_is_hw_dbs_capable() == true) {
1284 /* Check if a hw mode change is required */
1285 qdf_status = lim_handle_hw_mode_change_on_csa(mac_ctx,
1286 msg);
1287 /* Process csa params and do vdev restart immediately if
1288 * there is no need for a hw mode change or if MCC upgrade is
1289 * required.
1290 */
1291 if (QDF_IS_STATUS_SUCCESS(qdf_status))
1292 lim_handle_csa_offload_msg(mac_ctx, msg);
1293 } else {
1294 lim_handle_csa_offload_msg(mac_ctx, msg);
1295 }
1296}
1297
1298/**
1299 * lim_handle_csa_event_post_dbs_downgrade() - Process csa event post dbs
1300 * downgrade
1301 * @mac_ctx: Pointer to the Global Mac Context
1302 * @msg: Received message
1303 *
1304 * Process the csa event to do vdev restart on the new channel after the dbs
1305 * downgrade. If there was a DBS downgrade as part of the event
1306 * WMA_CSA_OFFLOAD_EVENT, SIR_LIM_CSA_POST_HW_MODE_CHANGE will be received after
1307 * receiving the set hw mode response, where this processing will happen.
1308 *
1309 * Return: None
1310 */
1311static void lim_handle_csa_event_post_dbs_downgrade(tpAniSirGlobal mac_ctx,
1312 tpSirMsgQ msg)
1313{
1314 tSirMsgQ csa_msg;
1315 tpPESession session_entry;
1316
1317 struct sir_saved_csa_params *buf =
1318 (struct sir_saved_csa_params *)msg->bodyptr;
1319
1320 /* Null check for 'msg' already done before coming here in the caller */
1321
1322 session_entry = pe_find_session_by_sme_session_id(mac_ctx,
1323 buf->session_id);
1324 if (!session_entry) {
1325 lim_log(mac_ctx, LOGE, FL("Invalid session id:%d"),
1326 buf->session_id);
1327 return;
1328 }
1329
1330 lim_log(mac_ctx, LOG1,
1331 FL("received csa offload event post hw change for %pM"),
1332 session_entry->saved_csa_params.bssId);
1333
1334 csa_msg.bodyptr = qdf_mem_malloc(
1335 sizeof(struct csa_offload_params));
1336 if (!csa_msg.bodyptr) {
1337 lim_log(mac_ctx, LOGE, FL("malloc failed for csa msg"));
1338 goto clean_msg_body;
1339 }
1340
1341 qdf_mem_copy((void *)csa_msg.bodyptr,
1342 (void *)&session_entry->saved_csa_params,
1343 sizeof(struct csa_offload_params));
1344 /* If there was a DBS downgrade as part of the event
1345 * WMA_CSA_OFFLOAD_EVENT, SIR_LIM_CSA_POST_HW_MODE_CHANGE will
1346 * be received after receiving the set hw mode response.
1347 */
1348 lim_handle_csa_offload_msg(mac_ctx, &csa_msg);
1349clean_msg_body:
1350 if (msg->bodyptr)
1351 qdf_mem_free(msg->bodyptr);
1352}
1353
1354/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001355 * lim_process_messages() - Process messages from upper layers.
1356 *
1357 * @mac_ctx: Pointer to the Global Mac Context.
1358 * @msg: Received message.
1359 *
1360 * Return: None.
1361 */
1362void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg)
1363{
1364#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
1365 uint8_t vdev_id = 0;
1366 tUpdateBeaconParams beacon_params;
1367#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
1368 uint8_t i;
1369 uint8_t p2p_go_exists = 0;
1370 tpPESession session_entry = NULL;
1371 uint8_t defer_msg = false;
1372 tLinkStateParams *link_state_param;
1373 uint16_t pkt_len = 0;
1374 cds_pkt_t *body_ptr = NULL;
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301375 QDF_STATUS qdf_status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001376 tSirMsgQ new_msg;
1377 tSirSmeScanAbortReq *req_msg = NULL;
1378 uint8_t session_id;
1379 uint32_t scan_id;
1380
1381#ifdef FEATURE_WLAN_TDLS
1382 tSirTdlsInd *tdls_ind = NULL;
1383 tpDphHashNode sta_ds = NULL;
1384 tTdlsLinkEstablishParams *tdls_link_params = NULL;
1385#endif
1386 tSirMbMsgP2p *p2p_msg = NULL;
1387 if (ANI_DRIVER_TYPE(mac_ctx) == eDRIVER_TYPE_MFG) {
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301388 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001389 msg->bodyptr = NULL;
1390 return;
1391 }
1392 if (msg == NULL) {
1393 lim_log(mac_ctx, LOGE, FL("Message pointer is Null"));
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +05301394 QDF_ASSERT(0);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001395 return;
1396 }
1397#ifdef WLAN_DEBUG
1398 mac_ctx->lim.numTot++;
1399#endif
1400 MTRACE(mac_trace_msg_rx(mac_ctx, NO_SESSION,
1401 LIM_TRACE_MAKE_RXMSG(msg->type, LIM_MSG_PROCESSED));)
1402
1403 switch (msg->type) {
1404
1405 case SIR_LIM_UPDATE_BEACON:
1406 lim_update_beacon(mac_ctx);
1407 break;
1408 case SIR_CFG_PARAM_UPDATE_IND:
1409 if (!lim_is_system_in_scan_state(mac_ctx)) {
1410 lim_handle_cf_gparam_update(mac_ctx, msg->bodyval);
1411 break;
1412 }
1413 /* System is in DFS (Learn) mode.
1414 * Defer processsing this message
1415 */
1416 if (lim_defer_msg(mac_ctx, msg) != TX_SUCCESS) {
1417 if (!(mac_ctx->lim.deferredMsgCnt & 0xF))
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +05301418 QDF_TRACE(QDF_MODULE_ID_PE, LOGE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001419 FL("Unable to Defer Msg"));
1420 lim_log_session_states(mac_ctx);
1421 lim_print_msg_name(mac_ctx, LOGE, msg->type);
1422 }
1423 break;
1424#ifdef FEATURE_OEM_DATA_SUPPORT
1425 case WMA_START_OEM_DATA_RSP:
1426 lim_process_oem_data_rsp(mac_ctx, msg->bodyptr);
1427 msg->bodyptr = NULL;
1428 break;
1429#endif
1430 case WMA_SWITCH_CHANNEL_RSP:
1431 lim_process_switch_channel_rsp(mac_ctx, msg->bodyptr);
1432 msg->bodyptr = NULL;
1433 break;
1434#ifdef ANI_SIR_IBSS_PEER_CACHING
1435 case WMA_IBSS_STA_ADD:
1436 lim_ibss_sta_add(mac_ctx, msg->bodyptr);
1437 break;
1438#endif
1439 case SIR_BB_XPORT_MGMT_MSG:
1440 /* These messages are from Peer MAC entity. */
1441#ifdef WLAN_DEBUG
1442 mac_ctx->lim.numBbt++;
1443#endif
1444 /* The original msg which we were deferring have the
1445 * bodyPointer point to 'BD' instead of 'cds pkt'. If we
1446 * don't make a copy of msg, then overwrite the
1447 * msg->bodyPointer and next time when we try to
1448 * process the msg, we will try to use 'BD' as
1449 * 'cds Pkt' which will cause a crash
1450 */
1451 if (msg->bodyptr == NULL) {
1452 lim_log(mac_ctx, LOGE, FL("Message bodyptr is Null"));
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +05301453 QDF_ASSERT(0);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001454 break;
1455 }
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301456 qdf_mem_copy((uint8_t *) &new_msg,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001457 (uint8_t *) msg, sizeof(tSirMsgQ));
1458 body_ptr = (cds_pkt_t *) new_msg.bodyptr;
1459 cds_pkt_get_packet_length(body_ptr, &pkt_len);
1460
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301461 qdf_status = wma_ds_peek_rx_packet_info(body_ptr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001462 (void **) &new_msg.bodyptr, false);
1463
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301464 if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001465 cds_pkt_return_packet(body_ptr);
1466 break;
1467 }
1468
Anurag Chouhanffb21542016-02-17 14:33:03 +05301469 if (WMA_GET_ROAMCANDIDATEIND(new_msg.bodyptr))
1470 lim_log(mac_ctx, LOG1, FL("roamCandidateInd %d"),
1471 WMA_GET_ROAMCANDIDATEIND(new_msg.bodyptr));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001472
Anurag Chouhanffb21542016-02-17 14:33:03 +05301473 if (WMA_GET_OFFLOADSCANLEARN(new_msg.bodyptr))
1474 lim_log(mac_ctx, LOG1, FL("offloadScanLearn %d"),
1475 WMA_GET_OFFLOADSCANLEARN(new_msg.bodyptr));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001476
1477 lim_handle80211_frames(mac_ctx, &new_msg, &defer_msg);
1478
1479 if (defer_msg == true) {
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +05301480 QDF_TRACE(QDF_MODULE_ID_PE, LOG1,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001481 FL("Defer Msg type=%x"), msg->type);
1482 if (lim_defer_msg(mac_ctx, msg) != TX_SUCCESS) {
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +05301483 QDF_TRACE(QDF_MODULE_ID_PE, LOGE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001484 FL("Unable to Defer Msg"));
1485 lim_log_session_states(mac_ctx);
1486 cds_pkt_return_packet(body_ptr);
1487 }
1488 } else
1489 /* PE is not deferring this 802.11 frame so we need to
1490 * call cds_pkt_return. Asumption here is when Rx mgmt
1491 * frame processing is done, cds packet could be
1492 * freed here.
1493 */
1494 cds_pkt_return_packet(body_ptr);
1495 break;
1496 case eWNI_SME_SCAN_REQ:
1497 case eWNI_SME_REMAIN_ON_CHANNEL_REQ:
1498 case eWNI_SME_DISASSOC_REQ:
1499 case eWNI_SME_DEAUTH_REQ:
1500#ifdef FEATURE_OEM_DATA_SUPPORT
1501 case eWNI_SME_OEM_DATA_REQ:
1502#endif
1503#ifdef FEATURE_WLAN_TDLS
1504 case eWNI_SME_TDLS_SEND_MGMT_REQ:
1505 case eWNI_SME_TDLS_ADD_STA_REQ:
1506 case eWNI_SME_TDLS_DEL_STA_REQ:
1507 case eWNI_SME_TDLS_LINK_ESTABLISH_REQ:
1508#endif
1509 case eWNI_SME_RESET_AP_CAPS_CHANGED:
1510 case eWNI_SME_SET_HW_MODE_REQ:
1511 case eWNI_SME_SET_DUAL_MAC_CFG_REQ:
1512 /* These messages are from HDD. Need to respond to HDD */
1513 lim_process_normal_hdd_msg(mac_ctx, msg, true);
1514 break;
1515
1516 case eWNI_SME_SCAN_ABORT_IND:
1517 req_msg = msg->bodyptr;
1518 if (req_msg) {
1519 session_id = req_msg->sessionId;
1520 scan_id = req_msg->scan_id;
1521 lim_process_abort_scan_ind(mac_ctx, session_id,
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001522 scan_id, USER_SCAN_REQUESTOR_ID);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301523 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001524 msg->bodyptr = NULL;
1525 }
1526 break;
1527 case eWNI_SME_SYS_READY_IND:
1528 case eWNI_SME_JOIN_REQ:
1529 case eWNI_SME_REASSOC_REQ:
1530 case eWNI_SME_START_BSS_REQ:
1531 case eWNI_SME_STOP_BSS_REQ:
1532 case eWNI_SME_SWITCH_CHL_IND:
1533 case eWNI_SME_SETCONTEXT_REQ:
1534 case eWNI_SME_DISASSOC_CNF:
1535 case eWNI_SME_DEAUTH_CNF:
1536 case eWNI_SME_ASSOC_CNF:
1537 case eWNI_SME_ADDTS_REQ:
1538 case eWNI_SME_DELTS_REQ:
1539 case eWNI_SME_GET_ASSOC_STAS_REQ:
1540 case eWNI_SME_TKIP_CNTR_MEAS_REQ:
1541 case eWNI_SME_UPDATE_APWPSIE_REQ:
1542 case eWNI_SME_HIDE_SSID_REQ:
1543 case eWNI_SME_GET_WPSPBC_SESSION_REQ:
1544 case eWNI_SME_SET_APWPARSNIEs_REQ:
1545 case eWNI_SME_CHNG_MCC_BEACON_INTERVAL:
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001546 case eWNI_SME_NEIGHBOR_REPORT_REQ_IND:
1547 case eWNI_SME_BEACON_REPORT_RESP_XMIT_IND:
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001548#if defined FEATURE_WLAN_ESE
1549 case eWNI_SME_ESE_ADJACENT_AP_REPORT:
1550#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001551 case eWNI_SME_FT_UPDATE_KEY:
1552 case eWNI_SME_FT_PRE_AUTH_REQ:
1553 case eWNI_SME_FT_AGGR_QOS_REQ:
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001554 case eWNI_SME_REGISTER_MGMT_FRAME_REQ:
1555 case eWNI_SME_UPDATE_NOA:
1556 case eWNI_SME_CLEAR_DFS_CHANNEL_LIST:
1557 case eWNI_SME_GET_STATISTICS_REQ:
1558#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
1559 case eWNI_SME_GET_TSM_STATS_REQ:
1560#endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */
Abhishek Singh7996eb72015-12-30 17:24:02 +05301561 case eWNI_SME_REGISTER_MGMT_FRAME_CB:
Abhishek Singh518323d2015-10-19 17:42:01 +05301562 case eWNI_SME_EXT_CHANGE_CHANNEL:
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001563 /* These messages are from HDD.No need to respond to HDD */
1564 lim_process_normal_hdd_msg(mac_ctx, msg, false);
1565 break;
1566
1567 case eWNI_PMC_SMPS_STATE_IND:
1568 if (msg->bodyptr) {
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301569 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001570 msg->bodyptr = NULL;
1571 }
1572 break;
1573 case eWNI_SME_SEND_ACTION_FRAME_IND:
1574 lim_send_p2p_action_frame(mac_ctx, msg);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301575 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001576 msg->bodyptr = NULL;
1577 break;
1578 case eWNI_SME_ABORT_REMAIN_ON_CHAN_IND:
1579 p2p_msg = (tSirMbMsgP2p *) msg->bodyptr;
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001580 lim_process_abort_scan_ind(mac_ctx, p2p_msg->sessionId,
1581 p2p_msg->scan_id, ROC_SCAN_REQUESTOR_ID);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301582 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001583 msg->bodyptr = NULL;
1584 break;
1585 case SIR_HAL_P2P_NOA_START_IND:
1586 session_entry = &mac_ctx->lim.gpSession[0];
1587 lim_log(mac_ctx, LOG1, "LIM received NOA start %x", msg->type);
1588
1589 /* Since insert NOA is done and NOA start msg received,
1590 * we should deactivate the Insert NOA timer
1591 */
1592 lim_deactivate_and_change_timer(mac_ctx,
1593 eLIM_INSERT_SINGLESHOT_NOA_TIMER);
1594
1595 for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
1596 session_entry = &mac_ctx->lim.gpSession[i];
1597 if ((session_entry != NULL) && (session_entry->valid) &&
Anurag Chouhan6d760662016-02-20 16:05:43 +05301598 (session_entry->pePersona == QDF_P2P_GO_MODE)) {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001599 /* Save P2P NOA start attribute for Go persona*/
1600 p2p_go_exists = 1;
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301601 qdf_mem_copy(&session_entry->p2pGoPsNoaStartInd,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001602 msg->bodyptr, sizeof(tSirP2PNoaStart));
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301603 qdf_status =
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001604 session_entry->p2pGoPsNoaStartInd.status;
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301605 if (qdf_status != QDF_STATUS_SUCCESS)
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +05301606 QDF_TRACE(QDF_MODULE_ID_PE, LOGW,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001607 FL(
1608 "GO NOA start status %d by FW"),
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301609 qdf_status);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001610 break;
1611 }
1612 }
1613
1614 if (p2p_go_exists == 0)
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +05301615 QDF_TRACE(QDF_MODULE_ID_PE, LOGW,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001616 FL(
1617 "GO is removed by the time NOA start recvd"));
1618
1619 /* We received the NOA start indication. Now we can send down
1620 * the SME request which requires off-channel operation */
1621 lim_process_regd_defd_sme_req_after_noa_start(mac_ctx);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301622 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001623 msg->bodyptr = NULL;
1624 break;
1625#ifdef FEATURE_WLAN_TDLS
1626 case SIR_HAL_TDLS_IND:
1627 tdls_ind = (tpSirTdlsInd) msg->bodyptr;
1628 session_entry = pe_find_session_by_sta_id(mac_ctx,
1629 tdls_ind->staIdx, &session_id);
1630 if (session_entry == NULL) {
1631 lim_log(mac_ctx, LOG1,
1632 FL("No session exist for given bssId"));
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301633 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001634 msg->bodyptr = NULL;
1635 return;
1636 }
1637 sta_ds = dph_get_hash_entry(mac_ctx, tdls_ind->assocId,
1638 &session_entry->dph.dphHashTable);
1639 if (sta_ds == NULL) {
1640 lim_log(mac_ctx, LOG1,
1641 FL("No sta_ds exist for given staId"));
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301642 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001643 msg->bodyptr = NULL;
1644 return;
1645 }
1646
1647 if (STA_ENTRY_TDLS_PEER == sta_ds->staType) {
1648 lim_log(mac_ctx, LOGE,
1649 FL("rcvd TDLS IND from FW with RC %d "),
1650 tdls_ind->reasonCode);
1651 lim_send_sme_tdls_del_sta_ind(mac_ctx, sta_ds,
1652 session_entry, tdls_ind->reasonCode);
1653 }
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301654 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001655 msg->bodyptr = NULL;
1656 break;
1657#endif
1658 case SIR_HAL_P2P_NOA_ATTR_IND:
1659 session_entry = &mac_ctx->lim.gpSession[0];
1660 lim_log(mac_ctx, LOG1, FL("Received message Noa_ATTR %x"),
1661 msg->type);
1662 for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
1663 session_entry = &mac_ctx->lim.gpSession[i];
1664 if ((session_entry != NULL) && (session_entry->valid)
1665 && (session_entry->pePersona ==
Anurag Chouhan6d760662016-02-20 16:05:43 +05301666 QDF_P2P_GO_MODE)) { /* Save P2P attr for Go */
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301667 qdf_mem_copy(
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001668 &session_entry->p2pGoPsUpdate,
1669 msg->bodyptr,
1670 sizeof(tSirP2PNoaAttr));
1671 lim_log(mac_ctx, LOG2,
1672 FL("bssId"
1673 MAC_ADDRESS_STR
1674 " ctWin=%d oppPsFlag=%d"),
1675 MAC_ADDR_ARRAY(
1676 session_entry->bssId),
1677 session_entry->p2pGoPsUpdate.ctWin,
1678 session_entry->p2pGoPsUpdate.oppPsFlag);
1679 lim_log(mac_ctx, LOG2,
1680 FL
1681 (" uNoa1IntervalCnt=%d uNoa1Duration=%d uNoa1Interval=%d uNoa1StartTime=%d"),
1682 session_entry->p2pGoPsUpdate.uNoa1IntervalCnt,
1683 session_entry->p2pGoPsUpdate.uNoa1Duration,
1684 session_entry->p2pGoPsUpdate.uNoa1Interval,
1685 session_entry->p2pGoPsUpdate.uNoa1StartTime);
1686 break;
1687 }
1688 }
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301689 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001690 msg->bodyptr = NULL;
1691 break;
1692 case WMA_MISSED_BEACON_IND:
1693 lim_ps_offload_handle_missed_beacon_ind(mac_ctx, msg);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301694 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001695 msg->bodyptr = NULL;
1696 break;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001697 case SIR_LIM_ADDTS_RSP_TIMEOUT:
1698 lim_process_sme_req_messages(mac_ctx, msg);
1699 break;
1700#ifdef FEATURE_WLAN_ESE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001701 case WMA_TSM_STATS_RSP:
1702#ifdef FEATURE_WLAN_ESE_UPLOAD
1703 lim_send_sme_pe_ese_tsm_rsp(mac_ctx,
1704 (tAniGetTsmStatsRsp *) msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001705#endif /* FEATURE_WLAN_ESE_UPLOAD */
1706 break;
1707#endif
1708 case WMA_ADD_TS_RSP:
1709 lim_process_hal_add_ts_rsp(mac_ctx, msg);
1710 break;
1711 case SIR_LIM_DEL_TS_IND:
1712 lim_process_del_ts_ind(mac_ctx, msg);
1713 break;
1714 case SIR_LIM_BEACON_GEN_IND:
1715 if (mac_ctx->lim.gLimSystemRole != eLIM_AP_ROLE)
1716 sch_process_pre_beacon_ind(mac_ctx, msg);
1717 break;
1718 case SIR_LIM_DELETE_STA_CONTEXT_IND:
1719 lim_delete_sta_context(mac_ctx, msg);
1720 break;
1721 case SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT:
1722 case SIR_LIM_JOIN_FAIL_TIMEOUT:
1723 case SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT:
1724 case SIR_LIM_AUTH_FAIL_TIMEOUT:
1725 case SIR_LIM_AUTH_RSP_TIMEOUT:
1726 case SIR_LIM_ASSOC_FAIL_TIMEOUT:
1727 case SIR_LIM_REASSOC_FAIL_TIMEOUT:
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001728 case SIR_LIM_FT_PREAUTH_RSP_TIMEOUT:
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001729 case SIR_LIM_REMAIN_CHN_TIMEOUT:
1730 case SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT:
1731 case SIR_LIM_DISASSOC_ACK_TIMEOUT:
1732 case SIR_LIM_DEAUTH_ACK_TIMEOUT:
1733 case SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
1734 /* These timeout messages are handled by MLM sub module */
1735 lim_process_mlm_req_messages(mac_ctx, msg);
1736 break;
1737 case SIR_LIM_HEART_BEAT_TIMEOUT:
1738 /** check if heart beat failed, even if one Beacon
1739 * is rcvd within the Heart Beat interval continue
1740 * normal processing
1741 */
1742 if (NULL == msg->bodyptr)
1743 lim_log(mac_ctx, LOGE,
1744 FL("Can't Process HB TO - bodyptr is Null"));
1745 else {
1746 session_entry = (tpPESession) msg->bodyptr;
1747 lim_log(mac_ctx, LOGE,
1748 FL
1749 ("SIR_LIM_HEART_BEAT_TIMEOUT, Session %d"),
1750 ((tpPESession) msg->bodyptr)->peSessionId);
1751 limResetHBPktCount(session_entry);
1752 lim_handle_heart_beat_timeout_for_session(mac_ctx,
1753 session_entry);
1754 }
1755 break;
1756 case SIR_LIM_PROBE_HB_FAILURE_TIMEOUT:
1757 lim_handle_heart_beat_failure_timeout(mac_ctx);
1758 break;
1759 case SIR_LIM_HASH_MISS_THRES_TIMEOUT:
1760 mac_ctx->lim.gLimDisassocFrameCredit = 0;
1761 break;
1762 case SIR_LIM_CNF_WAIT_TIMEOUT:
1763 /* Does not receive CNF or dummy packet */
1764 lim_handle_cnf_wait_timeout(mac_ctx, (uint16_t) msg->bodyval);
1765 break;
1766 case SIR_LIM_RETRY_INTERRUPT_MSG:
1767 /* Message from ISR upon TFP's max retry limit interrupt */
1768 break;
1769 case SIR_LIM_INV_KEY_INTERRUPT_MSG:
1770 /* Message from ISR upon SP's Invalid session key interrupt */
1771 break;
1772 case SIR_LIM_KEY_ID_INTERRUPT_MSG:
1773 /* Message from ISR upon SP's Invalid key ID interrupt */
1774 break;
1775 case SIR_LIM_REPLAY_THRES_INTERRUPT_MSG:
1776 /* Message from ISR upon SP's Replay threshold interrupt */
1777 break;
1778 case SIR_LIM_CHANNEL_SWITCH_TIMEOUT:
1779 lim_process_channel_switch_timeout(mac_ctx);
1780 break;
1781 case SIR_LIM_QUIET_TIMEOUT:
1782 lim_process_quiet_timeout(mac_ctx);
1783 break;
1784 case SIR_LIM_QUIET_BSS_TIMEOUT:
1785 lim_process_quiet_bss_timeout(mac_ctx);
1786 break;
1787 case SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT:
1788 lim_handle_update_olbc_cache(mac_ctx);
1789 break;
1790#ifdef FEATURE_WLAN_TDLS
1791 case SIR_HAL_TDLS_SHOULD_DISCOVER:
1792 case SIR_HAL_TDLS_SHOULD_TEARDOWN:
1793 case SIR_HAL_TDLS_PEER_DISCONNECTED:
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +05301794 QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001795 ("%s received tdls event: 0x%x"), __func__, msg->type);
1796 lim_send_sme_tdls_event_notify(mac_ctx, msg->type,
1797 (void *)msg->bodyptr);
1798 break;
1799#endif
1800 case WMA_ADD_BSS_RSP:
1801 lim_process_mlm_add_bss_rsp(mac_ctx, msg);
1802 break;
1803 case WMA_ADD_STA_RSP:
1804 lim_process_add_sta_rsp(mac_ctx, msg);
1805 break;
1806 case WMA_DELETE_STA_RSP:
1807 lim_process_mlm_del_sta_rsp(mac_ctx, msg);
1808 break;
1809 case WMA_DELETE_BSS_RSP:
1810 lim_handle_delete_bss_rsp(mac_ctx, msg);
1811 break;
1812 case WMA_CSA_OFFLOAD_EVENT:
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05301813 lim_handle_hw_mode_change_on_csa_event(mac_ctx, msg);
1814 break;
1815 case SIR_LIM_CSA_POST_HW_MODE_CHANGE:
1816 lim_handle_csa_event_post_dbs_downgrade(mac_ctx, msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001817 break;
1818 case WMA_SET_BSSKEY_RSP:
1819 case WMA_SET_STA_BCASTKEY_RSP:
1820 lim_process_mlm_set_bss_key_rsp(mac_ctx, msg);
1821 break;
1822 case WMA_SET_STAKEY_RSP:
1823 lim_process_mlm_set_sta_key_rsp(mac_ctx, msg);
1824 break;
1825 case WMA_GET_STATISTICS_RSP:
1826 lim_send_sme_pe_statistics_rsp(mac_ctx, msg->type,
1827 (void *)msg->bodyptr);
1828 break;
1829 case WMA_SET_MIMOPS_RSP:
1830 case WMA_SET_TX_POWER_RSP:
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301831 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001832 msg->bodyptr = NULL;
1833 break;
1834 case WMA_SET_MAX_TX_POWER_RSP:
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001835 rrm_set_max_tx_power_rsp(mac_ctx, msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001836 if (msg->bodyptr != NULL) {
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301837 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001838 msg->bodyptr = NULL;
1839 }
1840 break;
1841 case SIR_LIM_ADDR2_MISS_IND:
1842 lim_log(mac_ctx, LOGE,
1843 FL("Addr2 mismatch interrupt received %X"), msg->type);
1844 /* message from HAL indicating addr2 mismatch interrupt occurred
1845 * msg->bodyptr contains only pointer to 48-bit addr2 field
1846 */
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301847 qdf_mem_free((void *)(msg->bodyptr));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001848 msg->bodyptr = NULL;
1849 break;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001850 case WMA_AGGR_QOS_RSP:
1851 lim_process_ft_aggr_qo_s_rsp(mac_ctx, msg);
1852 break;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001853 case WMA_SET_LINK_STATE_RSP:
1854 link_state_param = (tLinkStateParams *) msg->bodyptr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001855 session_entry = link_state_param->session;
1856 if (link_state_param->ft
1857#if defined WLAN_FEATURE_ROAM_OFFLOAD
1858 && !session_entry->bRoamSynchInProgress
1859#endif
1860 )
1861 lim_send_reassoc_req_with_ft_ies_mgmt_frame(mac_ctx,
1862 session_entry->pLimMlmReassocReq,
1863 session_entry);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001864 if (link_state_param->callback)
1865 link_state_param->callback(mac_ctx,
1866 link_state_param->callbackArg,
1867 link_state_param->status);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301868 qdf_mem_free((void *)(msg->bodyptr));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001869 msg->bodyptr = NULL;
1870 break;
1871 case eWNI_SME_SET_BCN_FILTER_REQ:
1872 session_id = (uint8_t) msg->bodyval;
1873 session_entry = &mac_ctx->lim.gpSession[session_id];
1874 if ((session_entry != NULL) &&
1875 (lim_send_beacon_filter_info(mac_ctx, session_entry) !=
1876 eSIR_SUCCESS))
1877 lim_log(mac_ctx, LOGE,
1878 FL("Failied to send Beacon Filter Info "));
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301879 qdf_mem_free((void *)(msg->bodyptr));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001880 msg->bodyptr = NULL;
1881 break;
1882#ifdef FEATURE_WLAN_TDLS
1883 case WMA_SET_TDLS_LINK_ESTABLISH_REQ_RSP:
1884 tdls_link_params = (tTdlsLinkEstablishParams *) msg->bodyptr;
1885 session_entry = pe_find_session_by_sta_id(mac_ctx,
1886 tdls_link_params->staIdx, &session_id);
1887 if (session_entry == NULL) {
1888 lim_log(mac_ctx, LOGE,
1889 FL("session %u does not exist"), session_id);
1890 /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP
1891 * message to SME with session id as zero and status
1892 * as FAILURE so, that message queued in SME queue
1893 * can be freed to prevent the SME cmd buffer leak
1894 */
1895 lim_send_sme_tdls_link_establish_req_rsp(mac_ctx, 0,
1896 NULL, NULL, eSIR_FAILURE);
1897 } else {
1898 lim_send_sme_tdls_link_establish_req_rsp(mac_ctx,
1899 session_entry->smeSessionId, NULL, NULL,
1900 tdls_link_params->status);
1901 }
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301902 qdf_mem_free((void *)(msg->bodyptr));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001903 msg->bodyptr = NULL;
1904 break;
1905#endif
1906 case WMA_RX_SCAN_EVENT:
1907 lim_process_rx_scan_event(mac_ctx, msg->bodyptr);
1908 break;
1909 case WMA_IBSS_PEER_INACTIVITY_IND:
1910 lim_process_ibss_peer_inactivity(mac_ctx, msg->bodyptr);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301911 qdf_mem_free((void *)(msg->bodyptr));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001912 msg->bodyptr = NULL;
1913 break;
1914 case WMA_DFS_RADAR_IND:
1915 lim_send_sme_dfs_event_notify(mac_ctx, msg->type,
1916 (void *)msg->bodyptr);
1917 /* msg->bodyptr will be freed up by SME/CSR */
1918 break;
1919 case WMA_DFS_BEACON_TX_SUCCESS_IND:
1920 lim_process_beacon_tx_success_ind(mac_ctx, msg->type,
1921 (void *)msg->bodyptr);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301922 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001923 msg->bodyptr = NULL;
1924 break;
1925 case WMA_DISASSOC_TX_COMP:
1926 lim_disassoc_tx_complete_cnf(mac_ctx, msg->bodyval);
1927 break;
1928 case WMA_DEAUTH_TX_COMP:
1929 lim_deauth_tx_complete_cnf(mac_ctx, msg->bodyval);
1930 break;
1931#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
1932 case WMA_UPDATE_Q2Q_IE_IND:
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301933 qdf_mem_zero(&beacon_params, sizeof(tUpdateBeaconParams));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001934 beacon_params.paramChangeBitmap = 0;
1935 for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
1936 vdev_id = ((uint8_t *)msg->bodyptr)[i];
1937 session_entry = pe_find_session_by_sme_session_id(
1938 mac_ctx, vdev_id);
1939 if (session_entry == NULL)
1940 continue;
1941 session_entry->sap_advertise_avoid_ch_ie =
1942 (uint8_t)msg->bodyval;
1943 /*
1944 * if message comes for DFS channel, no need to update:
1945 * 1) We wont have MCC with DFS channels. so no need to
1946 * add Q2Q IE
1947 * 2) We cannot end up in DFS channel SCC by channel
1948 * switch from non DFS MCC scenario, so no need to
1949 * remove Q2Q IE
1950 * 3) There is however a case where device start MCC and
1951 * then user modifies hostapd.conf and does SAP
1952 * restart, in such a case, beacon params will be
1953 * reset and thus will not contain Q2Q IE, by default
1954 */
1955 if (cds_get_channel_state(
1956 session_entry->currentOperChannel)
1957 != CHANNEL_STATE_DFS) {
1958 beacon_params.bssIdx = session_entry->bssIdx;
1959 beacon_params.beaconInterval =
1960 session_entry->beaconParams.beaconInterval;
1961 beacon_params.paramChangeBitmap |=
1962 PARAM_BCN_INTERVAL_CHANGED;
1963 sch_set_fixed_beacon_fields(mac_ctx,
1964 session_entry);
1965 lim_send_beacon_params(mac_ctx, &beacon_params,
1966 session_entry);
1967 }
1968 }
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301969 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001970 msg->bodyptr = NULL;
1971 break;
1972#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
1973 case eWNI_SME_NSS_UPDATE_REQ:
1974 case eWNI_SME_DFS_BEACON_CHAN_SW_IE_REQ:
1975 lim_process_sme_req_messages(mac_ctx, msg);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301976 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001977 msg->bodyptr = NULL;
1978 break;
1979 case eWNI_SME_CHANNEL_CHANGE_REQ:
1980 lim_process_sme_req_messages(mac_ctx, msg);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301981 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001982 msg->bodyptr = NULL;
1983 break;
1984 case eWNI_SME_START_BEACON_REQ:
1985 lim_process_sme_req_messages(mac_ctx, msg);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301986 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001987 msg->bodyptr = NULL;
1988 break;
1989 case eWNI_SME_UPDATE_ADDITIONAL_IES:
1990 lim_process_sme_req_messages(mac_ctx, msg);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301991 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001992 msg->bodyptr = NULL;
1993 break;
1994 case eWNI_SME_MODIFY_ADDITIONAL_IES:
1995 lim_process_sme_req_messages(mac_ctx, msg);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301996 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001997 msg->bodyptr = NULL;
1998 break;
1999#ifdef QCA_HT_2040_COEX
2000 case eWNI_SME_SET_HT_2040_MODE:
2001 lim_process_sme_req_messages(mac_ctx, msg);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05302002 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002003 msg->bodyptr = NULL;
2004 break;
2005#endif
2006 case SIR_HAL_SOC_SET_HW_MODE_RESP:
2007 lim_process_set_hw_mode_resp(mac_ctx, msg->bodyptr);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05302008 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002009 msg->bodyptr = NULL;
2010 break;
2011 case SIR_HAL_SOC_HW_MODE_TRANS_IND:
2012 lim_process_hw_mode_trans_ind(mac_ctx, msg->bodyptr);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05302013 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002014 msg->bodyptr = NULL;
2015 break;
2016 case SIR_HAL_SOC_DUAL_MAC_CFG_RESP:
2017 lim_process_dual_mac_cfg_resp(mac_ctx, msg->bodyptr);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05302018 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002019 msg->bodyptr = NULL;
2020 break;
2021 case eWNI_SME_SET_IE_REQ:
2022 lim_process_sme_req_messages(mac_ctx, msg);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05302023 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002024 msg->bodyptr = NULL;
2025 break;
2026 default:
Anurag Chouhan600c3a02016-03-01 10:33:54 +05302027 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002028 msg->bodyptr = NULL;
2029 /* Unwanted messages */
2030 /* Log error */
2031 lim_log(mac_ctx, LOGE,
2032 FL("Discarding unexpected message received %X"),
2033 msg->type);
2034 lim_print_msg_name(mac_ctx, LOGE, msg->type);
2035 break;
2036
2037 } /* switch (msg->type) */
2038} /*** end lim_process_messages() ***/
2039
2040/**
2041 * lim_process_deferred_message_queue
2042 *
2043 ***FUNCTION:
2044 * This function is called by LIM while exiting from Learn
2045 * mode. This function fetches messages posted to the LIM
2046 * deferred message queue limDeferredMsgQ.
2047 *
2048 ***LOGIC:
2049 *
2050 ***ASSUMPTIONS:
2051 * NA
2052 *
2053 ***NOTE:
2054 * NA
2055 *
2056 * @param pMac - Pointer to Global MAC structure
2057 * @return None
2058 */
2059
2060void lim_process_deferred_message_queue(tpAniSirGlobal pMac)
2061{
2062 tSirMsgQ limMsg = { 0, 0, 0 };
2063
2064 tSirMsgQ *readMsg;
2065 uint16_t size;
2066
2067 /*
2068 ** check any deferred messages need to be processed
2069 **/
2070 size = pMac->lim.gLimDeferredMsgQ.size;
2071 if (size > 0) {
2072 while ((readMsg = lim_read_deferred_msg_q(pMac)) != NULL) {
Anurag Chouhan600c3a02016-03-01 10:33:54 +05302073 qdf_mem_copy((uint8_t *) &limMsg,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002074 (uint8_t *) readMsg, sizeof(tSirMsgQ));
2075 size--;
2076 lim_process_messages(pMac, &limMsg);
2077
2078 if ((lim_is_system_in_scan_state(pMac))
2079 || (true != GET_LIM_PROCESS_DEFD_MESGS(pMac))
Hema Aparna Medicharla5e1f3022015-08-24 11:22:29 +05302080 || (pMac->lim.gLimSystemInScanLearnMode)
2081 || pMac->lim.gLimAddtsSent)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002082 break;
2083 }
2084 }
2085} /*** end lim_process_deferred_message_queue() ***/
2086
2087/**
2088 * lim_process_normal_hdd_msg() - Process the message and defer if needed
2089 * @mac_ctx : Pointer to Global MAC structure
2090 * @msg : The message need to be processed
2091 * @rsp_reqd: whether return result to hdd
2092 *
2093 * This function checks the current lim state and decide whether the message
2094 * passed will be deferred or not.
2095 *
2096 * Return: None
2097 */
2098static void lim_process_normal_hdd_msg(tpAniSirGlobal mac_ctx, tSirMsgQ *msg,
2099 uint8_t rsp_reqd)
2100{
2101 bool defer_msg = true;
2102
2103 /* Added For BT-AMP Support */
2104 if ((mac_ctx->lim.gLimSystemRole == eLIM_AP_ROLE)
2105 || (mac_ctx->lim.gLimSystemRole == eLIM_BT_AMP_AP_ROLE)
2106 || (mac_ctx->lim.gLimSystemRole == eLIM_BT_AMP_STA_ROLE)
2107 || (mac_ctx->lim.gLimSystemRole == eLIM_UNKNOWN_ROLE)) {
2108 /*
2109 * This check is required only for the AP and in 2 cases.
2110 * 1. If we are in learn mode and we receive any of these
2111 * messages, you have to come out of scan and process the
2112 * message, hence dont defer the message here. In handler,
2113 * these message could be defered till we actually come out of
2114 * scan mode.
2115 * 2. If radar is detected, you might have to defer all of
2116 * these messages except Stop BSS request/ Switch channel
2117 * request. This decision is also made inside its handler.
2118 *
2119 * Please be careful while using the flag defer_msg. Possibly
2120 * you might end up in an infinite loop.
2121 */
2122 if ((msg->type == eWNI_SME_START_BSS_REQ) ||
2123 (msg->type == eWNI_SME_STOP_BSS_REQ) ||
2124 (msg->type == eWNI_SME_SWITCH_CHL_IND))
2125 defer_msg = false;
2126 }
2127
2128 if (((mac_ctx->lim.gLimAddtsSent) ||
2129 (lim_is_system_in_scan_state(mac_ctx))) && defer_msg) {
2130 /*
2131 * System is in DFS (Learn) mode or awaiting addts response or
2132 * if radar is detected, Defer processsing this message
2133 */
2134 if (lim_defer_msg(mac_ctx, msg) != TX_SUCCESS) {
2135#ifdef WLAN_DEBUG
2136 mac_ctx->lim.numSme++;
2137#endif
2138 lim_log_session_states(mac_ctx);
2139 /* Release body */
Anurag Chouhan600c3a02016-03-01 10:33:54 +05302140 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002141 msg->bodyptr = NULL;
2142 }
2143 } else {
2144 /*
2145 * These messages are from HDD.Since these requests may also be
2146 * generated internally within LIM module, need to distinquish
2147 * and send response to host
2148 */
2149 if (rsp_reqd)
2150 mac_ctx->lim.gLimRspReqd = true;
2151#ifdef WLAN_DEBUG
2152 mac_ctx->lim.numSme++;
2153#endif
2154 if (lim_process_sme_req_messages(mac_ctx, msg)) {
2155 /*
2156 * Release body. limProcessSmeReqMessage consumed the
2157 * buffer. We can free it.
2158 */
Anurag Chouhan600c3a02016-03-01 10:33:54 +05302159 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002160 msg->bodyptr = NULL;
2161 }
2162 }
2163}
2164
2165void
2166handle_ht_capabilityand_ht_info(struct sAniSirGlobal *pMac,
2167 tpPESession psessionEntry)
2168{
2169 tSirMacHTCapabilityInfo macHTCapabilityInfo;
2170 tSirMacHTParametersInfo macHTParametersInfo;
2171 tSirMacHTInfoField1 macHTInfoField1;
2172 tSirMacHTInfoField2 macHTInfoField2;
2173 tSirMacHTInfoField3 macHTInfoField3;
2174 uint32_t cfgValue;
2175 uint8_t *ptr;
2176
2177 if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &cfgValue) !=
2178 eSIR_SUCCESS) {
2179 lim_log(pMac, LOGP,
2180 FL("Fail to retrieve WNI_CFG_HT_CAP_INFO value"));
2181 return;
2182 }
2183 ptr = (uint8_t *) &macHTCapabilityInfo;
2184 *((uint16_t *) ptr) = (uint16_t) (cfgValue & 0xffff);
2185 pMac->lim.gHTLsigTXOPProtection =
2186 (uint8_t) macHTCapabilityInfo.lsigTXOPProtection;
2187 pMac->lim.gHTMIMOPSState =
2188 (tSirMacHTMIMOPowerSaveState) macHTCapabilityInfo.mimoPowerSave;
2189 pMac->lim.gHTGreenfield = (uint8_t) macHTCapabilityInfo.greenField;
2190 pMac->lim.gHTMaxAmsduLength =
2191 (uint8_t) macHTCapabilityInfo.maximalAMSDUsize;
2192 pMac->lim.gHTShortGI20Mhz = (uint8_t) macHTCapabilityInfo.shortGI20MHz;
2193 pMac->lim.gHTShortGI40Mhz = (uint8_t) macHTCapabilityInfo.shortGI40MHz;
2194 pMac->lim.gHTPSMPSupport = (uint8_t) macHTCapabilityInfo.psmp;
2195 pMac->lim.gHTDsssCckRate40MHzSupport =
2196 (uint8_t) macHTCapabilityInfo.dsssCckMode40MHz;
2197
2198 if (wlan_cfg_get_int(pMac, WNI_CFG_HT_AMPDU_PARAMS, &cfgValue) !=
2199 eSIR_SUCCESS) {
2200 lim_log(pMac, LOGP,
2201 FL("Fail to retrieve WNI_CFG_HT_PARAM_INFO value"));
2202 return;
2203 }
2204 ptr = (uint8_t *) &macHTParametersInfo;
2205 *ptr = (uint8_t) (cfgValue & 0xff);
2206 pMac->lim.gHTAMpduDensity = (uint8_t) macHTParametersInfo.mpduDensity;
2207 pMac->lim.gHTMaxRxAMpduFactor =
2208 (uint8_t) macHTParametersInfo.maxRxAMPDUFactor;
2209
2210 /* Get HT IE Info */
2211 if (wlan_cfg_get_int(pMac, WNI_CFG_HT_INFO_FIELD1, &cfgValue) !=
2212 eSIR_SUCCESS) {
2213 lim_log(pMac, LOGP,
2214 FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD1 value"));
2215 return;
2216 }
2217 ptr = (uint8_t *) &macHTInfoField1;
2218 *((uint8_t *) ptr) = (uint8_t) (cfgValue & 0xff);
2219 pMac->lim.gHTServiceIntervalGranularity =
2220 (uint8_t) macHTInfoField1.serviceIntervalGranularity;
2221 pMac->lim.gHTControlledAccessOnly =
2222 (uint8_t) macHTInfoField1.controlledAccessOnly;
2223 pMac->lim.gHTRifsMode = (uint8_t) macHTInfoField1.rifsMode;
2224
2225 if (wlan_cfg_get_int(pMac, WNI_CFG_HT_INFO_FIELD2, &cfgValue) !=
2226 eSIR_SUCCESS) {
2227 lim_log(pMac, LOGP,
2228 FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD2 value"));
2229 return;
2230 }
2231 ptr = (uint8_t *) &macHTInfoField2;
2232 *((uint16_t *) ptr) = (uint16_t) (cfgValue & 0xffff);
2233 pMac->lim.gHTOperMode = (tSirMacHTOperatingMode) macHTInfoField2.opMode;
2234
2235 if (wlan_cfg_get_int(pMac, WNI_CFG_HT_INFO_FIELD3, &cfgValue) !=
2236 eSIR_SUCCESS) {
2237 lim_log(pMac, LOGP,
2238 FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD3 value"));
2239 return;
2240 }
2241 ptr = (uint8_t *) &macHTInfoField3;
2242 *((uint16_t *) ptr) = (uint16_t) (cfgValue & 0xffff);
2243 pMac->lim.gHTPCOActive = (uint8_t) macHTInfoField3.pcoActive;
2244 pMac->lim.gHTPCOPhase = (uint8_t) macHTInfoField3.pcoPhase;
2245 pMac->lim.gHTSecondaryBeacon =
2246 (uint8_t) macHTInfoField3.secondaryBeacon;
2247 pMac->lim.gHTDualCTSProtection =
2248 (uint8_t) macHTInfoField3.dualCTSProtection;
2249 pMac->lim.gHTSTBCBasicMCS = (uint8_t) macHTInfoField3.basicSTBCMCS;
2250
2251 /* The lim globals for channelwidth and secondary chnl have been removed and should not be used during no session;
2252 * instead direct cfg is read and used when no session for transmission of mgmt frames (same as old);
2253 * For now, we might come here during init and join with sessionEntry = NULL; in that case just fill the globals which exist
2254 * Sessionized entries values will be filled in join or add bss req. The ones which are missed in join are filled below
2255 */
2256 if (psessionEntry != NULL) {
2257 psessionEntry->htCapability =
2258 IS_DOT11_MODE_HT(psessionEntry->dot11mode);
2259 psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport =
2260 (uint8_t) macHTInfoField3.lsigTXOPProtectionFullSupport;
2261 }
2262}
2263
2264void lim_log_session_states(tpAniSirGlobal mac_ctx)
2265{
2266#ifdef WLAN_DEBUG
2267 int i;
2268
2269 for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
2270 if (mac_ctx->lim.gpSession[i].valid) {
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +05302271 QDF_TRACE(QDF_MODULE_ID_PE, LOG1,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002272 FL("sysRole(%d) Session (%d)"),
2273 mac_ctx->lim.gLimSystemRole, i);
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +05302274 QDF_TRACE(QDF_MODULE_ID_PE, LOG1,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002275 FL("SME: Curr %s,Prev %s,MLM: Curr %s,Prev %s"),
2276 lim_sme_state_str(
2277 mac_ctx->lim.gpSession[i].limSmeState),
2278 lim_sme_state_str(
2279 mac_ctx->lim.gpSession[i].limPrevSmeState),
2280 lim_mlm_state_str(
2281 mac_ctx->lim.gpSession[i].limMlmState),
2282 lim_mlm_state_str(
2283 mac_ctx->lim.gpSession[i].limPrevMlmState));
2284 }
2285 }
2286#endif
2287}