blob: 6866468577df3cd5bce4490f7955b4f48bbaf6f5 [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
Sandeep Puligillae0875662016-02-12 16:09:21 -08001150static void lim_process_sme_obss_scan_ind(tpAniSirGlobal mac_ctx,
1151 struct sSirMsgQ *msg)
1152{
1153 struct sPESession *session;
1154 uint8_t session_id;
1155 struct sme_obss_ht40_scanind_msg *ht40_scanind;
1156
1157 ht40_scanind = (struct sme_obss_ht40_scanind_msg *)msg->bodyptr;
1158 session = pe_find_session_by_bssid(mac_ctx,
1159 ht40_scanind->mac_addr.bytes, &session_id);
1160 if (session == NULL) {
1161 QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO,
1162 "OBSS Scan not started: session id is NULL");
1163 return;
1164 }
1165 if (session->htSupportedChannelWidthSet ==
1166 WNI_CFG_CHANNEL_BONDING_MODE_ENABLE) {
1167 QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO,
1168 "OBSS Scan Start Req: session id %d"
1169 "htSupportedChannelWidthSet %d",
1170 session->peSessionId,
1171 session->htSupportedChannelWidthSet);
1172 lim_send_ht40_obss_scanind(mac_ctx, session);
1173 } else {
1174 QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO,
1175 "OBSS Scan not started: channel width - %d session %d",
1176 session->htSupportedChannelWidthSet,
1177 session->peSessionId);
1178 }
1179 return;
1180}
1181
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001182/**
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05301183 * lim_handle_hw_mode_change_on_csa() - Do HW mode change on CSA for STA mode
1184 * @mac_ctx: Global MAC context
1185 * @msg: Received message
1186 *
1187 * Checks if hw mode change is required for the new channel.
1188 * If MCC upgrade is required, this function will start the opportunistic
1189 * timer and the caller will invoke the other APIs to perform vdev restart on
1190 * the new channel.
1191 *
1192 * If DBS downgrade is required, this function will initiate the hw mode
1193 * change and vdev restart will happen on the new channel after getting hw
1194 * mode response
1195 *
1196 * Return: QDF_STATUS_SUCCESS if processing of csa params (and hence vdev
1197 * restart) needs to happen or if no hw mode change is required,
1198 * QDF_STATUS_E_FAILURE otherwise.
1199 */
1200static QDF_STATUS lim_handle_hw_mode_change_on_csa(tpAniSirGlobal mac_ctx,
1201 tpSirMsgQ msg)
1202{
1203 tpPESession session_entry;
1204 struct csa_offload_params *csa_params =
1205 (struct csa_offload_params *) (msg->bodyptr);
1206 tpDphHashNode sta_ds = NULL;
1207 uint8_t session_id;
1208 uint16_t aid = 0;
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05301209 QDF_STATUS status = QDF_STATUS_E_FAILURE;
1210
1211 lim_log(mac_ctx, LOG1, FL("handle hw mode change for csa"));
1212
1213 if (!csa_params) {
1214 lim_log(mac_ctx, LOGE, FL("limMsgQ body ptr is NULL"));
1215 /* qdf_mem_free() can handle NULL values */
1216 goto err;
1217 }
1218
1219 session_entry = pe_find_session_by_bssid(mac_ctx,
1220 csa_params->bssId, &session_id);
1221 if (!session_entry) {
1222 lim_log(mac_ctx, LOGE, FL("Session does not exist"));
1223 goto err;
1224 }
1225
1226 sta_ds = dph_lookup_hash_entry(mac_ctx, session_entry->bssId, &aid,
1227 &session_entry->dph.dphHashTable);
1228
1229 if (!sta_ds) {
1230 lim_log(mac_ctx, LOGE, FL("sta_ds does not exist"));
1231 goto err;
1232 }
1233
Krunal Soniee572472016-02-11 11:48:53 -08001234 status = cds_handle_hw_mode_change_on_csa(session_entry->smeSessionId,
1235 csa_params->channel, csa_params->bssId,
1236 &session_entry->saved_csa_params, csa_params,
1237 sizeof(session_entry->saved_csa_params));
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05301238
Krunal Soniee572472016-02-11 11:48:53 -08001239 if (QDF_IS_STATUS_SUCCESS(status))
1240 return status;
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05301241
1242err:
1243 qdf_mem_free(csa_params);
1244 return status;
1245}
1246
1247/**
1248 * lim_handle_hw_mode_change_on_csa_event() - Handle hw mode change on csa
1249 * @mac_ctx: Pointer to the Global Mac Context
1250 * @msg: Received message
1251 *
1252 * Checks if a hw mode change is required for the received csa event. Processes
1253 * csa params and do vdev restart immediately if the there is no need for a hw
1254 * mode change or if MCC upgrade is required
1255 *
1256 * Return: None
1257 */
1258static void lim_handle_hw_mode_change_on_csa_event(tpAniSirGlobal mac_ctx,
1259 tpSirMsgQ msg)
1260{
1261 QDF_STATUS qdf_status;
1262
1263 lim_log(mac_ctx, LOG1, FL("lim received csa offload event"));
1264 if (mac_ctx->policy_manager_enabled &&
1265 wma_is_hw_dbs_capable() == true) {
1266 /* Check if a hw mode change is required */
1267 qdf_status = lim_handle_hw_mode_change_on_csa(mac_ctx,
1268 msg);
1269 /* Process csa params and do vdev restart immediately if
1270 * there is no need for a hw mode change or if MCC upgrade is
1271 * required.
1272 */
1273 if (QDF_IS_STATUS_SUCCESS(qdf_status))
1274 lim_handle_csa_offload_msg(mac_ctx, msg);
1275 } else {
1276 lim_handle_csa_offload_msg(mac_ctx, msg);
1277 }
1278}
1279
1280/**
1281 * lim_handle_csa_event_post_dbs_downgrade() - Process csa event post dbs
1282 * downgrade
1283 * @mac_ctx: Pointer to the Global Mac Context
1284 * @msg: Received message
1285 *
1286 * Process the csa event to do vdev restart on the new channel after the dbs
1287 * downgrade. If there was a DBS downgrade as part of the event
1288 * WMA_CSA_OFFLOAD_EVENT, SIR_LIM_CSA_POST_HW_MODE_CHANGE will be received after
1289 * receiving the set hw mode response, where this processing will happen.
1290 *
1291 * Return: None
1292 */
1293static void lim_handle_csa_event_post_dbs_downgrade(tpAniSirGlobal mac_ctx,
1294 tpSirMsgQ msg)
1295{
1296 tSirMsgQ csa_msg;
1297 tpPESession session_entry;
1298
1299 struct sir_saved_csa_params *buf =
1300 (struct sir_saved_csa_params *)msg->bodyptr;
1301
1302 /* Null check for 'msg' already done before coming here in the caller */
1303
1304 session_entry = pe_find_session_by_sme_session_id(mac_ctx,
1305 buf->session_id);
1306 if (!session_entry) {
1307 lim_log(mac_ctx, LOGE, FL("Invalid session id:%d"),
1308 buf->session_id);
1309 return;
1310 }
1311
1312 lim_log(mac_ctx, LOG1,
1313 FL("received csa offload event post hw change for %pM"),
1314 session_entry->saved_csa_params.bssId);
1315
1316 csa_msg.bodyptr = qdf_mem_malloc(
1317 sizeof(struct csa_offload_params));
1318 if (!csa_msg.bodyptr) {
1319 lim_log(mac_ctx, LOGE, FL("malloc failed for csa msg"));
1320 goto clean_msg_body;
1321 }
1322
1323 qdf_mem_copy((void *)csa_msg.bodyptr,
1324 (void *)&session_entry->saved_csa_params,
1325 sizeof(struct csa_offload_params));
1326 /* If there was a DBS downgrade as part of the event
1327 * WMA_CSA_OFFLOAD_EVENT, SIR_LIM_CSA_POST_HW_MODE_CHANGE will
1328 * be received after receiving the set hw mode response.
1329 */
1330 lim_handle_csa_offload_msg(mac_ctx, &csa_msg);
1331clean_msg_body:
1332 if (msg->bodyptr)
1333 qdf_mem_free(msg->bodyptr);
1334}
1335
1336/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001337 * lim_process_messages() - Process messages from upper layers.
1338 *
1339 * @mac_ctx: Pointer to the Global Mac Context.
1340 * @msg: Received message.
1341 *
1342 * Return: None.
1343 */
1344void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg)
1345{
1346#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
1347 uint8_t vdev_id = 0;
1348 tUpdateBeaconParams beacon_params;
1349#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
1350 uint8_t i;
1351 uint8_t p2p_go_exists = 0;
1352 tpPESession session_entry = NULL;
1353 uint8_t defer_msg = false;
1354 tLinkStateParams *link_state_param;
1355 uint16_t pkt_len = 0;
1356 cds_pkt_t *body_ptr = NULL;
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301357 QDF_STATUS qdf_status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001358 tSirMsgQ new_msg;
1359 tSirSmeScanAbortReq *req_msg = NULL;
1360 uint8_t session_id;
1361 uint32_t scan_id;
1362
1363#ifdef FEATURE_WLAN_TDLS
1364 tSirTdlsInd *tdls_ind = NULL;
1365 tpDphHashNode sta_ds = NULL;
1366 tTdlsLinkEstablishParams *tdls_link_params = NULL;
1367#endif
1368 tSirMbMsgP2p *p2p_msg = NULL;
1369 if (ANI_DRIVER_TYPE(mac_ctx) == eDRIVER_TYPE_MFG) {
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301370 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001371 msg->bodyptr = NULL;
1372 return;
1373 }
1374 if (msg == NULL) {
1375 lim_log(mac_ctx, LOGE, FL("Message pointer is Null"));
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +05301376 QDF_ASSERT(0);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001377 return;
1378 }
1379#ifdef WLAN_DEBUG
1380 mac_ctx->lim.numTot++;
1381#endif
1382 MTRACE(mac_trace_msg_rx(mac_ctx, NO_SESSION,
1383 LIM_TRACE_MAKE_RXMSG(msg->type, LIM_MSG_PROCESSED));)
1384
1385 switch (msg->type) {
1386
1387 case SIR_LIM_UPDATE_BEACON:
1388 lim_update_beacon(mac_ctx);
1389 break;
1390 case SIR_CFG_PARAM_UPDATE_IND:
1391 if (!lim_is_system_in_scan_state(mac_ctx)) {
1392 lim_handle_cf_gparam_update(mac_ctx, msg->bodyval);
1393 break;
1394 }
1395 /* System is in DFS (Learn) mode.
1396 * Defer processsing this message
1397 */
1398 if (lim_defer_msg(mac_ctx, msg) != TX_SUCCESS) {
1399 if (!(mac_ctx->lim.deferredMsgCnt & 0xF))
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +05301400 QDF_TRACE(QDF_MODULE_ID_PE, LOGE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001401 FL("Unable to Defer Msg"));
1402 lim_log_session_states(mac_ctx);
1403 lim_print_msg_name(mac_ctx, LOGE, msg->type);
1404 }
1405 break;
1406#ifdef FEATURE_OEM_DATA_SUPPORT
1407 case WMA_START_OEM_DATA_RSP:
1408 lim_process_oem_data_rsp(mac_ctx, msg->bodyptr);
1409 msg->bodyptr = NULL;
1410 break;
1411#endif
1412 case WMA_SWITCH_CHANNEL_RSP:
1413 lim_process_switch_channel_rsp(mac_ctx, msg->bodyptr);
1414 msg->bodyptr = NULL;
1415 break;
1416#ifdef ANI_SIR_IBSS_PEER_CACHING
1417 case WMA_IBSS_STA_ADD:
1418 lim_ibss_sta_add(mac_ctx, msg->bodyptr);
1419 break;
1420#endif
1421 case SIR_BB_XPORT_MGMT_MSG:
1422 /* These messages are from Peer MAC entity. */
1423#ifdef WLAN_DEBUG
1424 mac_ctx->lim.numBbt++;
1425#endif
1426 /* The original msg which we were deferring have the
1427 * bodyPointer point to 'BD' instead of 'cds pkt'. If we
1428 * don't make a copy of msg, then overwrite the
1429 * msg->bodyPointer and next time when we try to
1430 * process the msg, we will try to use 'BD' as
1431 * 'cds Pkt' which will cause a crash
1432 */
1433 if (msg->bodyptr == NULL) {
1434 lim_log(mac_ctx, LOGE, FL("Message bodyptr is Null"));
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +05301435 QDF_ASSERT(0);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001436 break;
1437 }
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301438 qdf_mem_copy((uint8_t *) &new_msg,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001439 (uint8_t *) msg, sizeof(tSirMsgQ));
1440 body_ptr = (cds_pkt_t *) new_msg.bodyptr;
1441 cds_pkt_get_packet_length(body_ptr, &pkt_len);
1442
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301443 qdf_status = wma_ds_peek_rx_packet_info(body_ptr,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001444 (void **) &new_msg.bodyptr, false);
1445
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301446 if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001447 cds_pkt_return_packet(body_ptr);
1448 break;
1449 }
1450
Anurag Chouhanffb21542016-02-17 14:33:03 +05301451 if (WMA_GET_ROAMCANDIDATEIND(new_msg.bodyptr))
1452 lim_log(mac_ctx, LOG1, FL("roamCandidateInd %d"),
1453 WMA_GET_ROAMCANDIDATEIND(new_msg.bodyptr));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001454
Anurag Chouhanffb21542016-02-17 14:33:03 +05301455 if (WMA_GET_OFFLOADSCANLEARN(new_msg.bodyptr))
1456 lim_log(mac_ctx, LOG1, FL("offloadScanLearn %d"),
1457 WMA_GET_OFFLOADSCANLEARN(new_msg.bodyptr));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001458
1459 lim_handle80211_frames(mac_ctx, &new_msg, &defer_msg);
1460
1461 if (defer_msg == true) {
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +05301462 QDF_TRACE(QDF_MODULE_ID_PE, LOG1,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001463 FL("Defer Msg type=%x"), msg->type);
1464 if (lim_defer_msg(mac_ctx, msg) != TX_SUCCESS) {
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +05301465 QDF_TRACE(QDF_MODULE_ID_PE, LOGE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001466 FL("Unable to Defer Msg"));
1467 lim_log_session_states(mac_ctx);
1468 cds_pkt_return_packet(body_ptr);
1469 }
1470 } else
1471 /* PE is not deferring this 802.11 frame so we need to
1472 * call cds_pkt_return. Asumption here is when Rx mgmt
1473 * frame processing is done, cds packet could be
1474 * freed here.
1475 */
1476 cds_pkt_return_packet(body_ptr);
1477 break;
1478 case eWNI_SME_SCAN_REQ:
1479 case eWNI_SME_REMAIN_ON_CHANNEL_REQ:
1480 case eWNI_SME_DISASSOC_REQ:
1481 case eWNI_SME_DEAUTH_REQ:
1482#ifdef FEATURE_OEM_DATA_SUPPORT
1483 case eWNI_SME_OEM_DATA_REQ:
1484#endif
1485#ifdef FEATURE_WLAN_TDLS
1486 case eWNI_SME_TDLS_SEND_MGMT_REQ:
1487 case eWNI_SME_TDLS_ADD_STA_REQ:
1488 case eWNI_SME_TDLS_DEL_STA_REQ:
1489 case eWNI_SME_TDLS_LINK_ESTABLISH_REQ:
1490#endif
1491 case eWNI_SME_RESET_AP_CAPS_CHANGED:
1492 case eWNI_SME_SET_HW_MODE_REQ:
1493 case eWNI_SME_SET_DUAL_MAC_CFG_REQ:
1494 /* These messages are from HDD. Need to respond to HDD */
1495 lim_process_normal_hdd_msg(mac_ctx, msg, true);
1496 break;
1497
1498 case eWNI_SME_SCAN_ABORT_IND:
1499 req_msg = msg->bodyptr;
1500 if (req_msg) {
1501 session_id = req_msg->sessionId;
1502 scan_id = req_msg->scan_id;
1503 lim_process_abort_scan_ind(mac_ctx, session_id,
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001504 scan_id, USER_SCAN_REQUESTOR_ID);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301505 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001506 msg->bodyptr = NULL;
1507 }
1508 break;
1509 case eWNI_SME_SYS_READY_IND:
1510 case eWNI_SME_JOIN_REQ:
1511 case eWNI_SME_REASSOC_REQ:
1512 case eWNI_SME_START_BSS_REQ:
1513 case eWNI_SME_STOP_BSS_REQ:
1514 case eWNI_SME_SWITCH_CHL_IND:
1515 case eWNI_SME_SETCONTEXT_REQ:
1516 case eWNI_SME_DISASSOC_CNF:
1517 case eWNI_SME_DEAUTH_CNF:
1518 case eWNI_SME_ASSOC_CNF:
1519 case eWNI_SME_ADDTS_REQ:
1520 case eWNI_SME_DELTS_REQ:
1521 case eWNI_SME_GET_ASSOC_STAS_REQ:
1522 case eWNI_SME_TKIP_CNTR_MEAS_REQ:
1523 case eWNI_SME_UPDATE_APWPSIE_REQ:
1524 case eWNI_SME_HIDE_SSID_REQ:
1525 case eWNI_SME_GET_WPSPBC_SESSION_REQ:
1526 case eWNI_SME_SET_APWPARSNIEs_REQ:
1527 case eWNI_SME_CHNG_MCC_BEACON_INTERVAL:
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001528 case eWNI_SME_NEIGHBOR_REPORT_REQ_IND:
1529 case eWNI_SME_BEACON_REPORT_RESP_XMIT_IND:
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001530#if defined FEATURE_WLAN_ESE
1531 case eWNI_SME_ESE_ADJACENT_AP_REPORT:
1532#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001533 case eWNI_SME_FT_UPDATE_KEY:
1534 case eWNI_SME_FT_PRE_AUTH_REQ:
1535 case eWNI_SME_FT_AGGR_QOS_REQ:
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001536 case eWNI_SME_REGISTER_MGMT_FRAME_REQ:
1537 case eWNI_SME_UPDATE_NOA:
1538 case eWNI_SME_CLEAR_DFS_CHANNEL_LIST:
1539 case eWNI_SME_GET_STATISTICS_REQ:
1540#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
1541 case eWNI_SME_GET_TSM_STATS_REQ:
1542#endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */
Abhishek Singh7996eb72015-12-30 17:24:02 +05301543 case eWNI_SME_REGISTER_MGMT_FRAME_CB:
Abhishek Singh518323d2015-10-19 17:42:01 +05301544 case eWNI_SME_EXT_CHANGE_CHANNEL:
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001545 /* These messages are from HDD.No need to respond to HDD */
1546 lim_process_normal_hdd_msg(mac_ctx, msg, false);
1547 break;
1548
1549 case eWNI_PMC_SMPS_STATE_IND:
1550 if (msg->bodyptr) {
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301551 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001552 msg->bodyptr = NULL;
1553 }
1554 break;
1555 case eWNI_SME_SEND_ACTION_FRAME_IND:
1556 lim_send_p2p_action_frame(mac_ctx, msg);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301557 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001558 msg->bodyptr = NULL;
1559 break;
1560 case eWNI_SME_ABORT_REMAIN_ON_CHAN_IND:
1561 p2p_msg = (tSirMbMsgP2p *) msg->bodyptr;
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001562 lim_process_abort_scan_ind(mac_ctx, p2p_msg->sessionId,
1563 p2p_msg->scan_id, ROC_SCAN_REQUESTOR_ID);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301564 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001565 msg->bodyptr = NULL;
1566 break;
1567 case SIR_HAL_P2P_NOA_START_IND:
1568 session_entry = &mac_ctx->lim.gpSession[0];
1569 lim_log(mac_ctx, LOG1, "LIM received NOA start %x", msg->type);
1570
1571 /* Since insert NOA is done and NOA start msg received,
1572 * we should deactivate the Insert NOA timer
1573 */
1574 lim_deactivate_and_change_timer(mac_ctx,
1575 eLIM_INSERT_SINGLESHOT_NOA_TIMER);
1576
1577 for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
1578 session_entry = &mac_ctx->lim.gpSession[i];
1579 if ((session_entry != NULL) && (session_entry->valid) &&
Anurag Chouhan6d760662016-02-20 16:05:43 +05301580 (session_entry->pePersona == QDF_P2P_GO_MODE)) {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001581 /* Save P2P NOA start attribute for Go persona*/
1582 p2p_go_exists = 1;
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301583 qdf_mem_copy(&session_entry->p2pGoPsNoaStartInd,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001584 msg->bodyptr, sizeof(tSirP2PNoaStart));
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301585 qdf_status =
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001586 session_entry->p2pGoPsNoaStartInd.status;
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301587 if (qdf_status != QDF_STATUS_SUCCESS)
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +05301588 QDF_TRACE(QDF_MODULE_ID_PE, LOGW,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001589 FL(
1590 "GO NOA start status %d by FW"),
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301591 qdf_status);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001592 break;
1593 }
1594 }
1595
1596 if (p2p_go_exists == 0)
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +05301597 QDF_TRACE(QDF_MODULE_ID_PE, LOGW,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001598 FL(
1599 "GO is removed by the time NOA start recvd"));
1600
1601 /* We received the NOA start indication. Now we can send down
1602 * the SME request which requires off-channel operation */
1603 lim_process_regd_defd_sme_req_after_noa_start(mac_ctx);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301604 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001605 msg->bodyptr = NULL;
1606 break;
1607#ifdef FEATURE_WLAN_TDLS
1608 case SIR_HAL_TDLS_IND:
1609 tdls_ind = (tpSirTdlsInd) msg->bodyptr;
1610 session_entry = pe_find_session_by_sta_id(mac_ctx,
1611 tdls_ind->staIdx, &session_id);
1612 if (session_entry == NULL) {
1613 lim_log(mac_ctx, LOG1,
1614 FL("No session exist for given bssId"));
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301615 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001616 msg->bodyptr = NULL;
1617 return;
1618 }
1619 sta_ds = dph_get_hash_entry(mac_ctx, tdls_ind->assocId,
1620 &session_entry->dph.dphHashTable);
1621 if (sta_ds == NULL) {
1622 lim_log(mac_ctx, LOG1,
1623 FL("No sta_ds exist for given staId"));
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301624 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001625 msg->bodyptr = NULL;
1626 return;
1627 }
1628
1629 if (STA_ENTRY_TDLS_PEER == sta_ds->staType) {
1630 lim_log(mac_ctx, LOGE,
1631 FL("rcvd TDLS IND from FW with RC %d "),
1632 tdls_ind->reasonCode);
1633 lim_send_sme_tdls_del_sta_ind(mac_ctx, sta_ds,
1634 session_entry, tdls_ind->reasonCode);
1635 }
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301636 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001637 msg->bodyptr = NULL;
1638 break;
1639#endif
1640 case SIR_HAL_P2P_NOA_ATTR_IND:
1641 session_entry = &mac_ctx->lim.gpSession[0];
1642 lim_log(mac_ctx, LOG1, FL("Received message Noa_ATTR %x"),
1643 msg->type);
1644 for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
1645 session_entry = &mac_ctx->lim.gpSession[i];
1646 if ((session_entry != NULL) && (session_entry->valid)
1647 && (session_entry->pePersona ==
Anurag Chouhan6d760662016-02-20 16:05:43 +05301648 QDF_P2P_GO_MODE)) { /* Save P2P attr for Go */
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301649 qdf_mem_copy(
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001650 &session_entry->p2pGoPsUpdate,
1651 msg->bodyptr,
1652 sizeof(tSirP2PNoaAttr));
1653 lim_log(mac_ctx, LOG2,
1654 FL("bssId"
1655 MAC_ADDRESS_STR
1656 " ctWin=%d oppPsFlag=%d"),
1657 MAC_ADDR_ARRAY(
1658 session_entry->bssId),
1659 session_entry->p2pGoPsUpdate.ctWin,
1660 session_entry->p2pGoPsUpdate.oppPsFlag);
1661 lim_log(mac_ctx, LOG2,
1662 FL
1663 (" uNoa1IntervalCnt=%d uNoa1Duration=%d uNoa1Interval=%d uNoa1StartTime=%d"),
1664 session_entry->p2pGoPsUpdate.uNoa1IntervalCnt,
1665 session_entry->p2pGoPsUpdate.uNoa1Duration,
1666 session_entry->p2pGoPsUpdate.uNoa1Interval,
1667 session_entry->p2pGoPsUpdate.uNoa1StartTime);
1668 break;
1669 }
1670 }
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301671 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001672 msg->bodyptr = NULL;
1673 break;
1674 case WMA_MISSED_BEACON_IND:
1675 lim_ps_offload_handle_missed_beacon_ind(mac_ctx, msg);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301676 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001677 msg->bodyptr = NULL;
1678 break;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001679 case SIR_LIM_ADDTS_RSP_TIMEOUT:
1680 lim_process_sme_req_messages(mac_ctx, msg);
1681 break;
1682#ifdef FEATURE_WLAN_ESE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001683 case WMA_TSM_STATS_RSP:
1684#ifdef FEATURE_WLAN_ESE_UPLOAD
1685 lim_send_sme_pe_ese_tsm_rsp(mac_ctx,
1686 (tAniGetTsmStatsRsp *) msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001687#endif /* FEATURE_WLAN_ESE_UPLOAD */
1688 break;
1689#endif
1690 case WMA_ADD_TS_RSP:
1691 lim_process_hal_add_ts_rsp(mac_ctx, msg);
1692 break;
1693 case SIR_LIM_DEL_TS_IND:
1694 lim_process_del_ts_ind(mac_ctx, msg);
1695 break;
1696 case SIR_LIM_BEACON_GEN_IND:
1697 if (mac_ctx->lim.gLimSystemRole != eLIM_AP_ROLE)
1698 sch_process_pre_beacon_ind(mac_ctx, msg);
1699 break;
1700 case SIR_LIM_DELETE_STA_CONTEXT_IND:
1701 lim_delete_sta_context(mac_ctx, msg);
1702 break;
1703 case SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT:
1704 case SIR_LIM_JOIN_FAIL_TIMEOUT:
1705 case SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT:
1706 case SIR_LIM_AUTH_FAIL_TIMEOUT:
1707 case SIR_LIM_AUTH_RSP_TIMEOUT:
1708 case SIR_LIM_ASSOC_FAIL_TIMEOUT:
1709 case SIR_LIM_REASSOC_FAIL_TIMEOUT:
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001710 case SIR_LIM_FT_PREAUTH_RSP_TIMEOUT:
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001711 case SIR_LIM_REMAIN_CHN_TIMEOUT:
1712 case SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT:
1713 case SIR_LIM_DISASSOC_ACK_TIMEOUT:
1714 case SIR_LIM_DEAUTH_ACK_TIMEOUT:
1715 case SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
1716 /* These timeout messages are handled by MLM sub module */
1717 lim_process_mlm_req_messages(mac_ctx, msg);
1718 break;
1719 case SIR_LIM_HEART_BEAT_TIMEOUT:
1720 /** check if heart beat failed, even if one Beacon
1721 * is rcvd within the Heart Beat interval continue
1722 * normal processing
1723 */
1724 if (NULL == msg->bodyptr)
1725 lim_log(mac_ctx, LOGE,
1726 FL("Can't Process HB TO - bodyptr is Null"));
1727 else {
1728 session_entry = (tpPESession) msg->bodyptr;
1729 lim_log(mac_ctx, LOGE,
1730 FL
1731 ("SIR_LIM_HEART_BEAT_TIMEOUT, Session %d"),
1732 ((tpPESession) msg->bodyptr)->peSessionId);
1733 limResetHBPktCount(session_entry);
1734 lim_handle_heart_beat_timeout_for_session(mac_ctx,
1735 session_entry);
1736 }
1737 break;
1738 case SIR_LIM_PROBE_HB_FAILURE_TIMEOUT:
1739 lim_handle_heart_beat_failure_timeout(mac_ctx);
1740 break;
1741 case SIR_LIM_HASH_MISS_THRES_TIMEOUT:
1742 mac_ctx->lim.gLimDisassocFrameCredit = 0;
1743 break;
1744 case SIR_LIM_CNF_WAIT_TIMEOUT:
1745 /* Does not receive CNF or dummy packet */
1746 lim_handle_cnf_wait_timeout(mac_ctx, (uint16_t) msg->bodyval);
1747 break;
1748 case SIR_LIM_RETRY_INTERRUPT_MSG:
1749 /* Message from ISR upon TFP's max retry limit interrupt */
1750 break;
1751 case SIR_LIM_INV_KEY_INTERRUPT_MSG:
1752 /* Message from ISR upon SP's Invalid session key interrupt */
1753 break;
1754 case SIR_LIM_KEY_ID_INTERRUPT_MSG:
1755 /* Message from ISR upon SP's Invalid key ID interrupt */
1756 break;
1757 case SIR_LIM_REPLAY_THRES_INTERRUPT_MSG:
1758 /* Message from ISR upon SP's Replay threshold interrupt */
1759 break;
1760 case SIR_LIM_CHANNEL_SWITCH_TIMEOUT:
1761 lim_process_channel_switch_timeout(mac_ctx);
1762 break;
1763 case SIR_LIM_QUIET_TIMEOUT:
1764 lim_process_quiet_timeout(mac_ctx);
1765 break;
1766 case SIR_LIM_QUIET_BSS_TIMEOUT:
1767 lim_process_quiet_bss_timeout(mac_ctx);
1768 break;
1769 case SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT:
1770 lim_handle_update_olbc_cache(mac_ctx);
1771 break;
1772#ifdef FEATURE_WLAN_TDLS
1773 case SIR_HAL_TDLS_SHOULD_DISCOVER:
1774 case SIR_HAL_TDLS_SHOULD_TEARDOWN:
1775 case SIR_HAL_TDLS_PEER_DISCONNECTED:
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +05301776 QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001777 ("%s received tdls event: 0x%x"), __func__, msg->type);
1778 lim_send_sme_tdls_event_notify(mac_ctx, msg->type,
1779 (void *)msg->bodyptr);
1780 break;
1781#endif
1782 case WMA_ADD_BSS_RSP:
1783 lim_process_mlm_add_bss_rsp(mac_ctx, msg);
1784 break;
1785 case WMA_ADD_STA_RSP:
1786 lim_process_add_sta_rsp(mac_ctx, msg);
1787 break;
1788 case WMA_DELETE_STA_RSP:
1789 lim_process_mlm_del_sta_rsp(mac_ctx, msg);
1790 break;
1791 case WMA_DELETE_BSS_RSP:
1792 lim_handle_delete_bss_rsp(mac_ctx, msg);
1793 break;
1794 case WMA_CSA_OFFLOAD_EVENT:
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05301795 lim_handle_hw_mode_change_on_csa_event(mac_ctx, msg);
1796 break;
1797 case SIR_LIM_CSA_POST_HW_MODE_CHANGE:
1798 lim_handle_csa_event_post_dbs_downgrade(mac_ctx, msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001799 break;
1800 case WMA_SET_BSSKEY_RSP:
1801 case WMA_SET_STA_BCASTKEY_RSP:
1802 lim_process_mlm_set_bss_key_rsp(mac_ctx, msg);
1803 break;
1804 case WMA_SET_STAKEY_RSP:
1805 lim_process_mlm_set_sta_key_rsp(mac_ctx, msg);
1806 break;
1807 case WMA_GET_STATISTICS_RSP:
1808 lim_send_sme_pe_statistics_rsp(mac_ctx, msg->type,
1809 (void *)msg->bodyptr);
1810 break;
1811 case WMA_SET_MIMOPS_RSP:
1812 case WMA_SET_TX_POWER_RSP:
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301813 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001814 msg->bodyptr = NULL;
1815 break;
1816 case WMA_SET_MAX_TX_POWER_RSP:
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001817 rrm_set_max_tx_power_rsp(mac_ctx, msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001818 if (msg->bodyptr != NULL) {
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301819 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001820 msg->bodyptr = NULL;
1821 }
1822 break;
1823 case SIR_LIM_ADDR2_MISS_IND:
1824 lim_log(mac_ctx, LOGE,
1825 FL("Addr2 mismatch interrupt received %X"), msg->type);
1826 /* message from HAL indicating addr2 mismatch interrupt occurred
1827 * msg->bodyptr contains only pointer to 48-bit addr2 field
1828 */
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301829 qdf_mem_free((void *)(msg->bodyptr));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001830 msg->bodyptr = NULL;
1831 break;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001832 case WMA_AGGR_QOS_RSP:
1833 lim_process_ft_aggr_qo_s_rsp(mac_ctx, msg);
1834 break;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001835 case WMA_SET_LINK_STATE_RSP:
1836 link_state_param = (tLinkStateParams *) msg->bodyptr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001837 session_entry = link_state_param->session;
1838 if (link_state_param->ft
1839#if defined WLAN_FEATURE_ROAM_OFFLOAD
1840 && !session_entry->bRoamSynchInProgress
1841#endif
1842 )
1843 lim_send_reassoc_req_with_ft_ies_mgmt_frame(mac_ctx,
1844 session_entry->pLimMlmReassocReq,
1845 session_entry);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001846 if (link_state_param->callback)
1847 link_state_param->callback(mac_ctx,
1848 link_state_param->callbackArg,
1849 link_state_param->status);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301850 qdf_mem_free((void *)(msg->bodyptr));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001851 msg->bodyptr = NULL;
1852 break;
1853 case eWNI_SME_SET_BCN_FILTER_REQ:
1854 session_id = (uint8_t) msg->bodyval;
1855 session_entry = &mac_ctx->lim.gpSession[session_id];
1856 if ((session_entry != NULL) &&
1857 (lim_send_beacon_filter_info(mac_ctx, session_entry) !=
1858 eSIR_SUCCESS))
1859 lim_log(mac_ctx, LOGE,
1860 FL("Failied to send Beacon Filter Info "));
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301861 qdf_mem_free((void *)(msg->bodyptr));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001862 msg->bodyptr = NULL;
1863 break;
1864#ifdef FEATURE_WLAN_TDLS
1865 case WMA_SET_TDLS_LINK_ESTABLISH_REQ_RSP:
1866 tdls_link_params = (tTdlsLinkEstablishParams *) msg->bodyptr;
1867 session_entry = pe_find_session_by_sta_id(mac_ctx,
1868 tdls_link_params->staIdx, &session_id);
1869 if (session_entry == NULL) {
1870 lim_log(mac_ctx, LOGE,
1871 FL("session %u does not exist"), session_id);
1872 /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP
1873 * message to SME with session id as zero and status
1874 * as FAILURE so, that message queued in SME queue
1875 * can be freed to prevent the SME cmd buffer leak
1876 */
1877 lim_send_sme_tdls_link_establish_req_rsp(mac_ctx, 0,
1878 NULL, NULL, eSIR_FAILURE);
1879 } else {
1880 lim_send_sme_tdls_link_establish_req_rsp(mac_ctx,
1881 session_entry->smeSessionId, NULL, NULL,
1882 tdls_link_params->status);
1883 }
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301884 qdf_mem_free((void *)(msg->bodyptr));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001885 msg->bodyptr = NULL;
1886 break;
1887#endif
1888 case WMA_RX_SCAN_EVENT:
1889 lim_process_rx_scan_event(mac_ctx, msg->bodyptr);
1890 break;
1891 case WMA_IBSS_PEER_INACTIVITY_IND:
1892 lim_process_ibss_peer_inactivity(mac_ctx, msg->bodyptr);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301893 qdf_mem_free((void *)(msg->bodyptr));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001894 msg->bodyptr = NULL;
1895 break;
1896 case WMA_DFS_RADAR_IND:
1897 lim_send_sme_dfs_event_notify(mac_ctx, msg->type,
1898 (void *)msg->bodyptr);
1899 /* msg->bodyptr will be freed up by SME/CSR */
1900 break;
1901 case WMA_DFS_BEACON_TX_SUCCESS_IND:
1902 lim_process_beacon_tx_success_ind(mac_ctx, msg->type,
1903 (void *)msg->bodyptr);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301904 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001905 msg->bodyptr = NULL;
1906 break;
1907 case WMA_DISASSOC_TX_COMP:
1908 lim_disassoc_tx_complete_cnf(mac_ctx, msg->bodyval);
1909 break;
1910 case WMA_DEAUTH_TX_COMP:
1911 lim_deauth_tx_complete_cnf(mac_ctx, msg->bodyval);
1912 break;
1913#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
1914 case WMA_UPDATE_Q2Q_IE_IND:
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301915 qdf_mem_zero(&beacon_params, sizeof(tUpdateBeaconParams));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001916 beacon_params.paramChangeBitmap = 0;
1917 for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
1918 vdev_id = ((uint8_t *)msg->bodyptr)[i];
1919 session_entry = pe_find_session_by_sme_session_id(
1920 mac_ctx, vdev_id);
1921 if (session_entry == NULL)
1922 continue;
1923 session_entry->sap_advertise_avoid_ch_ie =
1924 (uint8_t)msg->bodyval;
1925 /*
1926 * if message comes for DFS channel, no need to update:
1927 * 1) We wont have MCC with DFS channels. so no need to
1928 * add Q2Q IE
1929 * 2) We cannot end up in DFS channel SCC by channel
1930 * switch from non DFS MCC scenario, so no need to
1931 * remove Q2Q IE
1932 * 3) There is however a case where device start MCC and
1933 * then user modifies hostapd.conf and does SAP
1934 * restart, in such a case, beacon params will be
1935 * reset and thus will not contain Q2Q IE, by default
1936 */
1937 if (cds_get_channel_state(
1938 session_entry->currentOperChannel)
1939 != CHANNEL_STATE_DFS) {
1940 beacon_params.bssIdx = session_entry->bssIdx;
1941 beacon_params.beaconInterval =
1942 session_entry->beaconParams.beaconInterval;
1943 beacon_params.paramChangeBitmap |=
1944 PARAM_BCN_INTERVAL_CHANGED;
1945 sch_set_fixed_beacon_fields(mac_ctx,
1946 session_entry);
1947 lim_send_beacon_params(mac_ctx, &beacon_params,
1948 session_entry);
1949 }
1950 }
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301951 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001952 msg->bodyptr = NULL;
1953 break;
1954#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
1955 case eWNI_SME_NSS_UPDATE_REQ:
1956 case eWNI_SME_DFS_BEACON_CHAN_SW_IE_REQ:
1957 lim_process_sme_req_messages(mac_ctx, msg);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301958 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001959 msg->bodyptr = NULL;
1960 break;
1961 case eWNI_SME_CHANNEL_CHANGE_REQ:
1962 lim_process_sme_req_messages(mac_ctx, msg);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301963 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001964 msg->bodyptr = NULL;
1965 break;
1966 case eWNI_SME_START_BEACON_REQ:
1967 lim_process_sme_req_messages(mac_ctx, msg);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301968 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001969 msg->bodyptr = NULL;
1970 break;
1971 case eWNI_SME_UPDATE_ADDITIONAL_IES:
1972 lim_process_sme_req_messages(mac_ctx, msg);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301973 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001974 msg->bodyptr = NULL;
1975 break;
1976 case eWNI_SME_MODIFY_ADDITIONAL_IES:
1977 lim_process_sme_req_messages(mac_ctx, msg);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301978 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001979 msg->bodyptr = NULL;
1980 break;
1981#ifdef QCA_HT_2040_COEX
1982 case eWNI_SME_SET_HT_2040_MODE:
1983 lim_process_sme_req_messages(mac_ctx, msg);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301984 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001985 msg->bodyptr = NULL;
1986 break;
1987#endif
1988 case SIR_HAL_SOC_SET_HW_MODE_RESP:
1989 lim_process_set_hw_mode_resp(mac_ctx, msg->bodyptr);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301990 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001991 msg->bodyptr = NULL;
1992 break;
1993 case SIR_HAL_SOC_HW_MODE_TRANS_IND:
1994 lim_process_hw_mode_trans_ind(mac_ctx, msg->bodyptr);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301995 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001996 msg->bodyptr = NULL;
1997 break;
1998 case SIR_HAL_SOC_DUAL_MAC_CFG_RESP:
1999 lim_process_dual_mac_cfg_resp(mac_ctx, msg->bodyptr);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05302000 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002001 msg->bodyptr = NULL;
2002 break;
2003 case eWNI_SME_SET_IE_REQ:
2004 lim_process_sme_req_messages(mac_ctx, msg);
Anurag Chouhan600c3a02016-03-01 10:33:54 +05302005 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002006 msg->bodyptr = NULL;
2007 break;
Sandeep Puligillae0875662016-02-12 16:09:21 -08002008 case eWNI_SME_HT40_OBSS_SCAN_IND:
2009 lim_process_sme_obss_scan_ind(mac_ctx, msg);
2010 qdf_mem_free(msg->bodyptr);
2011 msg->bodyptr = NULL;
2012 break;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002013 default:
Anurag Chouhan600c3a02016-03-01 10:33:54 +05302014 qdf_mem_free((void *)msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002015 msg->bodyptr = NULL;
2016 /* Unwanted messages */
2017 /* Log error */
2018 lim_log(mac_ctx, LOGE,
2019 FL("Discarding unexpected message received %X"),
2020 msg->type);
2021 lim_print_msg_name(mac_ctx, LOGE, msg->type);
2022 break;
2023
2024 } /* switch (msg->type) */
2025} /*** end lim_process_messages() ***/
2026
2027/**
2028 * lim_process_deferred_message_queue
2029 *
2030 ***FUNCTION:
2031 * This function is called by LIM while exiting from Learn
2032 * mode. This function fetches messages posted to the LIM
2033 * deferred message queue limDeferredMsgQ.
2034 *
2035 ***LOGIC:
2036 *
2037 ***ASSUMPTIONS:
2038 * NA
2039 *
2040 ***NOTE:
2041 * NA
2042 *
2043 * @param pMac - Pointer to Global MAC structure
2044 * @return None
2045 */
2046
2047void lim_process_deferred_message_queue(tpAniSirGlobal pMac)
2048{
2049 tSirMsgQ limMsg = { 0, 0, 0 };
2050
2051 tSirMsgQ *readMsg;
2052 uint16_t size;
2053
2054 /*
2055 ** check any deferred messages need to be processed
2056 **/
2057 size = pMac->lim.gLimDeferredMsgQ.size;
2058 if (size > 0) {
2059 while ((readMsg = lim_read_deferred_msg_q(pMac)) != NULL) {
Anurag Chouhan600c3a02016-03-01 10:33:54 +05302060 qdf_mem_copy((uint8_t *) &limMsg,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002061 (uint8_t *) readMsg, sizeof(tSirMsgQ));
2062 size--;
2063 lim_process_messages(pMac, &limMsg);
2064
2065 if ((lim_is_system_in_scan_state(pMac))
2066 || (true != GET_LIM_PROCESS_DEFD_MESGS(pMac))
Hema Aparna Medicharla5e1f3022015-08-24 11:22:29 +05302067 || (pMac->lim.gLimSystemInScanLearnMode)
2068 || pMac->lim.gLimAddtsSent)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002069 break;
2070 }
2071 }
2072} /*** end lim_process_deferred_message_queue() ***/
2073
2074/**
2075 * lim_process_normal_hdd_msg() - Process the message and defer if needed
2076 * @mac_ctx : Pointer to Global MAC structure
2077 * @msg : The message need to be processed
2078 * @rsp_reqd: whether return result to hdd
2079 *
2080 * This function checks the current lim state and decide whether the message
2081 * passed will be deferred or not.
2082 *
2083 * Return: None
2084 */
2085static void lim_process_normal_hdd_msg(tpAniSirGlobal mac_ctx, tSirMsgQ *msg,
2086 uint8_t rsp_reqd)
2087{
2088 bool defer_msg = true;
2089
2090 /* Added For BT-AMP Support */
2091 if ((mac_ctx->lim.gLimSystemRole == eLIM_AP_ROLE)
2092 || (mac_ctx->lim.gLimSystemRole == eLIM_BT_AMP_AP_ROLE)
2093 || (mac_ctx->lim.gLimSystemRole == eLIM_BT_AMP_STA_ROLE)
2094 || (mac_ctx->lim.gLimSystemRole == eLIM_UNKNOWN_ROLE)) {
2095 /*
2096 * This check is required only for the AP and in 2 cases.
2097 * 1. If we are in learn mode and we receive any of these
2098 * messages, you have to come out of scan and process the
2099 * message, hence dont defer the message here. In handler,
2100 * these message could be defered till we actually come out of
2101 * scan mode.
2102 * 2. If radar is detected, you might have to defer all of
2103 * these messages except Stop BSS request/ Switch channel
2104 * request. This decision is also made inside its handler.
2105 *
2106 * Please be careful while using the flag defer_msg. Possibly
2107 * you might end up in an infinite loop.
2108 */
2109 if ((msg->type == eWNI_SME_START_BSS_REQ) ||
2110 (msg->type == eWNI_SME_STOP_BSS_REQ) ||
2111 (msg->type == eWNI_SME_SWITCH_CHL_IND))
2112 defer_msg = false;
2113 }
2114
2115 if (((mac_ctx->lim.gLimAddtsSent) ||
2116 (lim_is_system_in_scan_state(mac_ctx))) && defer_msg) {
2117 /*
2118 * System is in DFS (Learn) mode or awaiting addts response or
2119 * if radar is detected, Defer processsing this message
2120 */
2121 if (lim_defer_msg(mac_ctx, msg) != TX_SUCCESS) {
2122#ifdef WLAN_DEBUG
2123 mac_ctx->lim.numSme++;
2124#endif
2125 lim_log_session_states(mac_ctx);
2126 /* Release body */
Anurag Chouhan600c3a02016-03-01 10:33:54 +05302127 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002128 msg->bodyptr = NULL;
2129 }
2130 } else {
2131 /*
2132 * These messages are from HDD.Since these requests may also be
2133 * generated internally within LIM module, need to distinquish
2134 * and send response to host
2135 */
2136 if (rsp_reqd)
2137 mac_ctx->lim.gLimRspReqd = true;
2138#ifdef WLAN_DEBUG
2139 mac_ctx->lim.numSme++;
2140#endif
2141 if (lim_process_sme_req_messages(mac_ctx, msg)) {
2142 /*
2143 * Release body. limProcessSmeReqMessage consumed the
2144 * buffer. We can free it.
2145 */
Anurag Chouhan600c3a02016-03-01 10:33:54 +05302146 qdf_mem_free(msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002147 msg->bodyptr = NULL;
2148 }
2149 }
2150}
2151
2152void
2153handle_ht_capabilityand_ht_info(struct sAniSirGlobal *pMac,
2154 tpPESession psessionEntry)
2155{
2156 tSirMacHTCapabilityInfo macHTCapabilityInfo;
2157 tSirMacHTParametersInfo macHTParametersInfo;
2158 tSirMacHTInfoField1 macHTInfoField1;
2159 tSirMacHTInfoField2 macHTInfoField2;
2160 tSirMacHTInfoField3 macHTInfoField3;
2161 uint32_t cfgValue;
2162 uint8_t *ptr;
2163
2164 if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &cfgValue) !=
2165 eSIR_SUCCESS) {
2166 lim_log(pMac, LOGP,
2167 FL("Fail to retrieve WNI_CFG_HT_CAP_INFO value"));
2168 return;
2169 }
2170 ptr = (uint8_t *) &macHTCapabilityInfo;
2171 *((uint16_t *) ptr) = (uint16_t) (cfgValue & 0xffff);
2172 pMac->lim.gHTLsigTXOPProtection =
2173 (uint8_t) macHTCapabilityInfo.lsigTXOPProtection;
2174 pMac->lim.gHTMIMOPSState =
2175 (tSirMacHTMIMOPowerSaveState) macHTCapabilityInfo.mimoPowerSave;
2176 pMac->lim.gHTGreenfield = (uint8_t) macHTCapabilityInfo.greenField;
2177 pMac->lim.gHTMaxAmsduLength =
2178 (uint8_t) macHTCapabilityInfo.maximalAMSDUsize;
2179 pMac->lim.gHTShortGI20Mhz = (uint8_t) macHTCapabilityInfo.shortGI20MHz;
2180 pMac->lim.gHTShortGI40Mhz = (uint8_t) macHTCapabilityInfo.shortGI40MHz;
2181 pMac->lim.gHTPSMPSupport = (uint8_t) macHTCapabilityInfo.psmp;
2182 pMac->lim.gHTDsssCckRate40MHzSupport =
2183 (uint8_t) macHTCapabilityInfo.dsssCckMode40MHz;
2184
2185 if (wlan_cfg_get_int(pMac, WNI_CFG_HT_AMPDU_PARAMS, &cfgValue) !=
2186 eSIR_SUCCESS) {
2187 lim_log(pMac, LOGP,
2188 FL("Fail to retrieve WNI_CFG_HT_PARAM_INFO value"));
2189 return;
2190 }
2191 ptr = (uint8_t *) &macHTParametersInfo;
2192 *ptr = (uint8_t) (cfgValue & 0xff);
2193 pMac->lim.gHTAMpduDensity = (uint8_t) macHTParametersInfo.mpduDensity;
2194 pMac->lim.gHTMaxRxAMpduFactor =
2195 (uint8_t) macHTParametersInfo.maxRxAMPDUFactor;
2196
2197 /* Get HT IE Info */
2198 if (wlan_cfg_get_int(pMac, WNI_CFG_HT_INFO_FIELD1, &cfgValue) !=
2199 eSIR_SUCCESS) {
2200 lim_log(pMac, LOGP,
2201 FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD1 value"));
2202 return;
2203 }
2204 ptr = (uint8_t *) &macHTInfoField1;
2205 *((uint8_t *) ptr) = (uint8_t) (cfgValue & 0xff);
2206 pMac->lim.gHTServiceIntervalGranularity =
2207 (uint8_t) macHTInfoField1.serviceIntervalGranularity;
2208 pMac->lim.gHTControlledAccessOnly =
2209 (uint8_t) macHTInfoField1.controlledAccessOnly;
2210 pMac->lim.gHTRifsMode = (uint8_t) macHTInfoField1.rifsMode;
2211
2212 if (wlan_cfg_get_int(pMac, WNI_CFG_HT_INFO_FIELD2, &cfgValue) !=
2213 eSIR_SUCCESS) {
2214 lim_log(pMac, LOGP,
2215 FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD2 value"));
2216 return;
2217 }
2218 ptr = (uint8_t *) &macHTInfoField2;
2219 *((uint16_t *) ptr) = (uint16_t) (cfgValue & 0xffff);
2220 pMac->lim.gHTOperMode = (tSirMacHTOperatingMode) macHTInfoField2.opMode;
2221
2222 if (wlan_cfg_get_int(pMac, WNI_CFG_HT_INFO_FIELD3, &cfgValue) !=
2223 eSIR_SUCCESS) {
2224 lim_log(pMac, LOGP,
2225 FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD3 value"));
2226 return;
2227 }
2228 ptr = (uint8_t *) &macHTInfoField3;
2229 *((uint16_t *) ptr) = (uint16_t) (cfgValue & 0xffff);
2230 pMac->lim.gHTPCOActive = (uint8_t) macHTInfoField3.pcoActive;
2231 pMac->lim.gHTPCOPhase = (uint8_t) macHTInfoField3.pcoPhase;
2232 pMac->lim.gHTSecondaryBeacon =
2233 (uint8_t) macHTInfoField3.secondaryBeacon;
2234 pMac->lim.gHTDualCTSProtection =
2235 (uint8_t) macHTInfoField3.dualCTSProtection;
2236 pMac->lim.gHTSTBCBasicMCS = (uint8_t) macHTInfoField3.basicSTBCMCS;
2237
2238 /* The lim globals for channelwidth and secondary chnl have been removed and should not be used during no session;
2239 * instead direct cfg is read and used when no session for transmission of mgmt frames (same as old);
2240 * For now, we might come here during init and join with sessionEntry = NULL; in that case just fill the globals which exist
2241 * Sessionized entries values will be filled in join or add bss req. The ones which are missed in join are filled below
2242 */
2243 if (psessionEntry != NULL) {
2244 psessionEntry->htCapability =
2245 IS_DOT11_MODE_HT(psessionEntry->dot11mode);
2246 psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport =
2247 (uint8_t) macHTInfoField3.lsigTXOPProtectionFullSupport;
Sandeep Puligillae0875662016-02-12 16:09:21 -08002248 lim_init_obss_params(pMac, psessionEntry);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002249 }
2250}
2251
2252void lim_log_session_states(tpAniSirGlobal mac_ctx)
2253{
2254#ifdef WLAN_DEBUG
2255 int i;
2256
2257 for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
2258 if (mac_ctx->lim.gpSession[i].valid) {
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +05302259 QDF_TRACE(QDF_MODULE_ID_PE, LOG1,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002260 FL("sysRole(%d) Session (%d)"),
2261 mac_ctx->lim.gLimSystemRole, i);
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +05302262 QDF_TRACE(QDF_MODULE_ID_PE, LOG1,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002263 FL("SME: Curr %s,Prev %s,MLM: Curr %s,Prev %s"),
2264 lim_sme_state_str(
2265 mac_ctx->lim.gpSession[i].limSmeState),
2266 lim_sme_state_str(
2267 mac_ctx->lim.gpSession[i].limPrevSmeState),
2268 lim_mlm_state_str(
2269 mac_ctx->lim.gpSession[i].limMlmState),
2270 lim_mlm_state_str(
2271 mac_ctx->lim.gpSession[i].limPrevMlmState));
2272 }
2273 }
2274#endif
2275}