blob: 1158ee3e211c315b12af563579245f18a5e5d0fd [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"
54#ifdef WLAN_FEATURE_VOWIFI_11R
55#include "lim_ft_defs.h"
56#endif
57#include "lim_session.h"
58#include "lim_send_messages.h"
59
60#if defined WLAN_FEATURE_VOWIFI
61#include "rrm_api.h"
62#endif
63
64#if defined WLAN_FEATURE_VOWIFI_11R
65#include "lim_ft.h"
66#endif
67
68#include "cdf_types.h"
69#include "cds_packet.h"
70#include "cdf_memory.h"
71
72void lim_log_session_states(tpAniSirGlobal pMac);
73static void lim_process_normal_hdd_msg(tpAniSirGlobal mac_ctx,
74 struct sSirMsgQ *msg, uint8_t rsp_reqd);
75
76/**
77 * lim_process_dual_mac_cfg_resp() - Process set dual mac config response
78 * @mac: Global MAC pointer
79 * @body: Set dual mac config response in sir_dual_mac_config_resp format
80 *
81 * Process the set dual mac config response and post the message
82 * to SME to process this further and release the active
83 * command list
84 *
85 * Return: None
86 */
87static void lim_process_dual_mac_cfg_resp(tpAniSirGlobal mac, void *body)
88{
89 struct sir_dual_mac_config_resp *resp, *param;
90 uint32_t len, fail_resp = 0;
91 tSirMsgQ msg;
92
93 resp = (struct sir_dual_mac_config_resp *)body;
94 if (!resp) {
95 lim_log(mac, LOGE, FL("Set dual mac cfg param is NULL"));
96 fail_resp = 1;
97 /* Not returning here. If possible, let us proceed
98 * and send fail response to SME
99 */
100 }
101
102 len = sizeof(*param);
103
104 param = cdf_mem_malloc(len);
105 if (!param) {
106 lim_log(mac, LOGE, FL("Fail to allocate memory"));
107 /* Memory allocation for param failed.
108 * Cannot send fail status back to SME
109 */
110 return;
111 }
112
113 if (fail_resp) {
114 lim_log(mac, LOGE, FL("Send fail status to SME"));
115 param->status = SET_HW_MODE_STATUS_ECANCELED;
116 } else {
117 param->status = resp->status;
118 /*
119 * TODO: Update this HW mode info in any UMAC params, if needed
120 */
121 }
122
123 msg.type = eWNI_SME_SET_DUAL_MAC_CFG_RESP;
124 msg.bodyptr = param;
125 msg.bodyval = 0;
126 lim_log(mac, LOG1, FL("Send eWNI_SME_SET_DUAL_MAC_CFG_RESP to SME"));
127 lim_sys_process_mmh_msg_api(mac, &msg, ePROT);
128 return;
129}
130
131/**
132 * lim_process_set_hw_mode_resp() - Process set HW mode response
133 * @mac: Global MAC pointer
134 * @body: Set HW mode response in sir_set_hw_mode_resp format
135 *
136 * Process the set HW mode response and post the message
137 * to SME to process this further and release the active
138 * command list
139 *
140 * Return: None
141 */
142static void lim_process_set_hw_mode_resp(tpAniSirGlobal mac, void *body)
143{
144 struct sir_set_hw_mode_resp *resp, *param;
145 uint32_t len, i, fail_resp = 0;
146 tSirMsgQ msg;
147
148 resp = (struct sir_set_hw_mode_resp *)body;
149 if (!resp) {
150 lim_log(mac, LOGE, FL("Set HW mode param is NULL"));
151 fail_resp = 1;
152 /* Not returning here. If possible, let us proceed
153 * and send fail response to SME */
154 }
155
156 len = sizeof(*param);
157
158 param = cdf_mem_malloc(len);
159 if (!param) {
160 lim_log(mac, LOGE, FL("Fail to allocate memory"));
161 /* Memory allocation for param failed.
162 * Cannot send fail status back to SME
163 */
164 return;
165 }
166
167 if (fail_resp) {
168 lim_log(mac, LOGE, FL("Send fail status to SME"));
169 param->status = SET_HW_MODE_STATUS_ECANCELED;
170 param->cfgd_hw_mode_index = 0;
171 param->num_vdev_mac_entries = 0;
172 } else {
173 param->status = resp->status;
174 param->cfgd_hw_mode_index = resp->cfgd_hw_mode_index;
175 param->num_vdev_mac_entries = resp->num_vdev_mac_entries;
176
177 for (i = 0; i < resp->num_vdev_mac_entries; i++) {
178 param->vdev_mac_map[i].vdev_id =
179 resp->vdev_mac_map[i].vdev_id;
180 param->vdev_mac_map[i].mac_id =
181 resp->vdev_mac_map[i].mac_id;
182 }
183 /*
184 * TODO: Update this HW mode info in any UMAC params, if needed
185 */
186 }
187
188 msg.type = eWNI_SME_SET_HW_MODE_RESP;
189 msg.bodyptr = param;
190 msg.bodyval = 0;
191 lim_log(mac, LOGE, FL("Send eWNI_SME_SET_HW_MODE_RESP to SME"));
192 lim_sys_process_mmh_msg_api(mac, &msg, ePROT);
193 return;
194}
195
196/**
197 * lim_process_hw_mode_trans_ind() - Process set HW mode transition indication
198 * @mac: Global MAC pointer
199 * @body: Set HW mode response in sir_hw_mode_trans_ind format
200 *
201 * Process the set HW mode transition indication and post the message
202 * to SME to invoke the HDD callback
203 * command list
204 *
205 * Return: None
206 */
207static void lim_process_hw_mode_trans_ind(tpAniSirGlobal mac, void *body)
208{
209 struct sir_hw_mode_trans_ind *ind, *param;
210 uint32_t len, i;
211 tSirMsgQ msg;
212
213 ind = (struct sir_hw_mode_trans_ind *)body;
214 if (!ind) {
215 lim_log(mac, LOGE, FL("Set HW mode trans ind param is NULL"));
216 return;
217 }
218
219 len = sizeof(*param);
220
221 param = cdf_mem_malloc(len);
222 if (!param) {
223 lim_log(mac, LOGE, FL("Fail to allocate memory"));
224 return;
225 }
226
227 param->old_hw_mode_index = ind->old_hw_mode_index;
228 param->new_hw_mode_index = ind->new_hw_mode_index;
229 param->num_vdev_mac_entries = ind->num_vdev_mac_entries;
230
231 for (i = 0; i < ind->num_vdev_mac_entries; i++) {
232 param->vdev_mac_map[i].vdev_id =
233 ind->vdev_mac_map[i].vdev_id;
234 param->vdev_mac_map[i].mac_id =
235 ind->vdev_mac_map[i].mac_id;
236 }
237
238 /* TODO: Update this HW mode info in any UMAC params, if needed */
239
240 msg.type = eWNI_SME_HW_MODE_TRANS_IND;
241 msg.bodyptr = param;
242 msg.bodyval = 0;
243 lim_log(mac, LOGE, FL("Send eWNI_SME_HW_MODE_TRANS_IND to SME"));
244 lim_sys_process_mmh_msg_api(mac, &msg, ePROT);
245 return;
246}
247
248/** -------------------------------------------------------------
249 \fn def_msg_decision
250 \brief The function decides whether to defer a message or not in limProcessMessage function
251 \param tpAniSirGlobal pMac
252 \param tSirMsgQ limMsg
253 \param tSirMacTspecIE *ppInfo
254 \return none
255 -------------------------------------------------------------*/
256
257uint8_t static def_msg_decision(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
258{
259
260/* this function should not changed */
261 if (pMac->lim.gLimSmeState == eLIM_SME_OFFLINE_STATE) {
262 /* Defer processsing this message */
263 if (lim_defer_msg(pMac, limMsg) != TX_SUCCESS) {
264 CDF_TRACE(CDF_MODULE_ID_PE, LOGE,
265 FL("Unable to Defer Msg"));
266 lim_log_session_states(pMac);
267 lim_handle_defer_msg_error(pMac, limMsg);
268 }
269 return true;
270 }
271 /* When defer is requested then defer all the messages except HAL responses. */
272 if ((!lim_is_system_in_scan_state(pMac))
273 && (true != GET_LIM_PROCESS_DEFD_MESGS(pMac))
274 && !pMac->lim.gLimSystemInScanLearnMode) {
275 if ((limMsg->type != WMA_ADD_BSS_RSP)
276 && (limMsg->type != WMA_DELETE_BSS_RSP)
277 && (limMsg->type != WMA_ADD_STA_RSP)
278 && (limMsg->type != WMA_DELETE_STA_RSP)
279 && (limMsg->type != WMA_SET_BSSKEY_RSP)
280 && (limMsg->type != WMA_SET_STAKEY_RSP)
281 && (limMsg->type != WMA_SET_STA_BCASTKEY_RSP)
282 && (limMsg->type != WMA_AGGR_QOS_RSP)
283 && (limMsg->type != WMA_SET_MIMOPS_RSP)
284 && (limMsg->type != WMA_SWITCH_CHANNEL_RSP)
285 && (limMsg->type != WMA_P2P_NOA_ATTR_IND)
286 && (limMsg->type != WMA_P2P_NOA_START_IND) &&
287#ifdef FEATURE_OEM_DATA_SUPPORT
288 (limMsg->type != WMA_START_OEM_DATA_RSP) &&
289#endif
Hema Aparna Medicharla5e1f3022015-08-24 11:22:29 +0530290 (limMsg->type != WMA_ADD_TS_RSP) &&
Hanumantha Reddy Pothulab8340212016-01-12 11:16:06 +0530291 /*
292 * LIM won't process any defer queue commands if gLimAddtsSent is
293 * set to TRUE. gLimAddtsSent will be set TRUE to while sending
294 * ADDTS REQ. Say, when deferring is enabled, if
295 * SIR_LIM_ADDTS_RSP_TIMEOUT is posted (because of not receiving ADDTS
296 * RSP) then this command will be added to defer queue and as
297 * gLimAddtsSent is set TRUE LIM will never process any commands from
298 * defer queue, including SIR_LIM_ADDTS_RSP_TIMEOUT. Hence allowing
299 * SIR_LIM_ADDTS_RSP_TIMEOUT command to be processed with deferring
300 * enabled, so that this will be processed immediately and sets
301 * gLimAddtsSent to FALSE.
302 */
303 (limMsg->type != SIR_LIM_ADDTS_RSP_TIMEOUT) &&
Hema Aparna Medicharla5e1f3022015-08-24 11:22:29 +0530304 /* Allow processing of RX frames while awaiting reception
305 * of ADD TS response over the air. This logic particularly
306 * handles the case when host sends ADD BA request to FW
307 * after ADD TS request is sent over the air and
308 * ADD TS response received over the air */
309 !(limMsg->type == SIR_BB_XPORT_MGMT_MSG &&
310 pMac->lim.gLimAddtsSent)) {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800311 PELOG1(lim_log
312 (pMac, LOG1,
313 FL
314 ("Defer the current message %s , gLimProcessDefdMsgs is false and system is not in scan/learn mode"),
315 lim_msg_str(limMsg->type));
316 )
317 /* Defer processsing this message */
318 if (lim_defer_msg(pMac, limMsg) != TX_SUCCESS) {
319 CDF_TRACE(CDF_MODULE_ID_PE, LOGE,
320 FL("Unable to Defer Msg"));
321 lim_log_session_states(pMac);
322 lim_handle_defer_msg_error(pMac, limMsg);
323
324 }
325 return true;
326 }
327 }
328 return false;
329}
330
331#ifdef FEATURE_WLAN_EXTSCAN
332static void
333__lim_pno_match_fwd_bcn_probepsp(tpAniSirGlobal pmac, uint8_t *rx_pkt_info,
334 tSirProbeRespBeacon *frame, uint32_t ie_len,
335 uint32_t msg_type)
336{
337 struct pno_match_found *result;
338 uint8_t *body;
339 tSirMsgQ mmh_msg;
340 tpSirMacMgmtHdr hdr;
341 uint32_t num_results = 1, len, i;
342
343 /* Upon receiving every matched beacon, bss info is forwarded to the
344 * the upper layer, hence num_results is set to 1 */
345 len = sizeof(*result) + (num_results * sizeof(tSirWifiScanResult)) +
346 ie_len;
347
348 result = cdf_mem_malloc(len);
349 if (NULL == result) {
350 lim_log(pmac, LOGE, FL("Memory allocation failed"));
351 return;
352 }
353 hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info);
354 body = WMA_GET_RX_MPDU_DATA(rx_pkt_info);
355 cdf_mem_zero(result, sizeof(*result) + ie_len);
356
357 /* Received frame does not have request id, hence set 0 */
358 result->request_id = 0;
359 result->more_data = 0;
360 result->num_results = num_results;
361
362 for (i = 0; i < result->num_results; i++) {
363 result->ap[i].ts = cdf_mc_timer_get_system_time();
364 result->ap[i].beaconPeriod = frame->beaconInterval;
365 result->ap[i].capability =
366 lim_get_u16((uint8_t *) &frame->capabilityInfo);
367 result->ap[i].channel = WMA_GET_RX_CH(rx_pkt_info);
Deepak Dhamdhere68929ec2015-08-05 15:16:35 -0700368 result->ap[i].rssi = WMA_GET_RX_RSSI_NORMALIZED(rx_pkt_info);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800369 result->ap[i].rtt = 0;
370 result->ap[i].rtt_sd = 0;
371 result->ap[i].ieLength = ie_len;
372 cdf_mem_copy((uint8_t *) &result->ap[i].ssid[0],
373 (uint8_t *) frame->ssId.ssId, frame->ssId.length);
374 result->ap[i].ssid[frame->ssId.length] = '\0';
375 cdf_mem_copy((uint8_t *) &result->ap[i].bssid,
376 (uint8_t *) hdr->bssId,
377 sizeof(tSirMacAddr));
378 /* Copy IE fields */
379 cdf_mem_copy((uint8_t *) &result->ap[i].ieData,
380 body + SIR_MAC_B_PR_SSID_OFFSET, ie_len);
381 }
382
383 mmh_msg.type = msg_type;
384 mmh_msg.bodyptr = result;
385 mmh_msg.bodyval = 0;
386 lim_sys_process_mmh_msg_api(pmac, &mmh_msg, ePROT);
387}
388
389
390static void
391__lim_ext_scan_forward_bcn_probe_rsp(tpAniSirGlobal pmac, uint8_t *rx_pkt_info,
392 tSirProbeRespBeacon *frame,
393 uint32_t ie_len,
394 uint32_t msg_type)
395{
396 tpSirWifiFullScanResultEvent result;
397 uint8_t *body;
398 tSirMsgQ mmh_msg;
399 tpSirMacMgmtHdr hdr;
400
401 result = cdf_mem_malloc(sizeof(*result) + ie_len);
402 if (NULL == result) {
403 lim_log(pmac, LOGE, FL("Memory allocation failed"));
404 return;
405 }
406 hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info);
407 body = WMA_GET_RX_MPDU_DATA(rx_pkt_info);
408 cdf_mem_zero(result, sizeof(*result) + ie_len);
409
410 /* Received frame does not have request id, hence set 0 */
411 result->requestId = 0;
412
413 result->moreData = 0;
414 result->ap.ts = cdf_mc_timer_get_system_time();
415 result->ap.beaconPeriod = frame->beaconInterval;
416 result->ap.capability =
417 lim_get_u16((uint8_t *) &frame->capabilityInfo);
418 result->ap.channel = WMA_GET_RX_CH(rx_pkt_info);
Deepak Dhamdhere68929ec2015-08-05 15:16:35 -0700419 result->ap.rssi = WMA_GET_RX_RSSI_NORMALIZED(rx_pkt_info);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800420 result->ap.rtt = 0;
421 result->ap.rtt_sd = 0;
422 result->ap.ieLength = ie_len;
423
424 cdf_mem_copy((uint8_t *) &result->ap.ssid[0],
425 (uint8_t *) frame->ssId.ssId, frame->ssId.length);
426 result->ap.ssid[frame->ssId.length] = '\0';
427 cdf_mem_copy((uint8_t *) &result->ap.bssid.bytes,
428 (uint8_t *) hdr->bssId,
429 CDF_MAC_ADDR_SIZE);
430 /* Copy IE fields */
431 cdf_mem_copy((uint8_t *) &result->ap.ieData,
432 body + SIR_MAC_B_PR_SSID_OFFSET, ie_len);
433
434 mmh_msg.type = msg_type;
435 mmh_msg.bodyptr = result;
436 mmh_msg.bodyval = 0;
437 lim_sys_process_mmh_msg_api(pmac, &mmh_msg, ePROT);
438}
439
440static void
441__lim_process_ext_scan_beacon_probe_rsp(tpAniSirGlobal pmac,
442 uint8_t *rx_pkt_info,
443 uint8_t sub_type)
444{
445 tSirProbeRespBeacon *frame;
446 uint8_t *body;
447 uint32_t frm_len;
448 tSirRetStatus status;
449
450 frm_len = WMA_GET_RX_PAYLOAD_LEN(rx_pkt_info);
451 if (frm_len <= SIR_MAC_B_PR_SSID_OFFSET) {
452 lim_log(pmac, LOGP,
453 FL("RX packet has invalid length %d"), frm_len);
454 return;
455 }
456
457 frame = cdf_mem_malloc(sizeof(*frame));
458 if (NULL == frame) {
459 lim_log(pmac, LOGE, FL("Memory allocation failed"));
460 return;
461 }
462
463 if (sub_type == SIR_MAC_MGMT_BEACON) {
464 lim_log(pmac, LOG2, FL("Beacon due to ExtScan/epno"));
465 status = sir_convert_beacon_frame2_struct(pmac,
466 (uint8_t *)rx_pkt_info,
467 frame);
468 } else if (sub_type == SIR_MAC_MGMT_PROBE_RSP) {
469 lim_log(pmac, LOG2, FL("Probe Rsp due to ExtScan/epno"));
470 body = WMA_GET_RX_MPDU_DATA(rx_pkt_info);
471 status = sir_convert_probe_frame2_struct(pmac, body,
472 frm_len, frame);
473 } else {
474 cdf_mem_free(frame);
475 return;
476 }
477
478 if (status != eSIR_SUCCESS) {
479 lim_log(pmac, LOGE, FL("Frame parsing failed"));
480 cdf_mem_free(frame);
481 return;
482 }
483
484 if (WMA_IS_EXTSCAN_SCAN_SRC(rx_pkt_info))
485 __lim_ext_scan_forward_bcn_probe_rsp(pmac, rx_pkt_info, frame,
486 (frm_len - SIR_MAC_B_PR_SSID_OFFSET),
487 eWNI_SME_EXTSCAN_FULL_SCAN_RESULT_IND);
488
489 if (WMA_IS_EPNO_SCAN_SRC(rx_pkt_info))
490 __lim_pno_match_fwd_bcn_probepsp(pmac, rx_pkt_info, frame,
491 (frm_len - SIR_MAC_B_PR_SSID_OFFSET),
492 eWNI_SME_EPNO_NETWORK_FOUND_IND);
493
494 cdf_mem_free(frame);
495}
496#endif
497
498/*
499 * Beacon Handling Cases:
500 * during scanning, when no session is active:
501 * handled by lim_handle_frames_in_scan_state before __lim_handle_beacon call is invoked.
502 * during scanning, when any session is active, but beacon/Pr does not belong to that session, psessionEntry will be null.
503 * handled by lim_handle_frames_in_scan_state before __lim_handle_beacon call is invoked.
504 * during scanning, when any session is active, and beacon/Pr belongs to one of the session, psessionEntry will not be null.
505 * handled by lim_handle_frames_in_scan_state before __lim_handle_beacon call is invoked.
506 * Not scanning, no session:
507 * there should not be any beacon coming, if coming, should be dropped.
508 * Not Scanning,
509 */
510static void
511__lim_handle_beacon(tpAniSirGlobal pMac, tpSirMsgQ pMsg,
512 tpPESession psessionEntry)
513{
514 /* checking for global SME state... */
515 uint8_t *pRxPacketInfo;
516 lim_get_b_dfrom_rx_packet(pMac, pMsg->bodyptr,
517 (uint32_t * *) &pRxPacketInfo);
518
519 /* This function should not be called if beacon is received in scan state. */
520 /* So not doing any checks for the global state. */
521
522 if (psessionEntry == NULL) {
523 sch_beacon_process(pMac, pRxPacketInfo, NULL);
524 } else if ((psessionEntry->limSmeState == eLIM_SME_LINK_EST_STATE) ||
525 (psessionEntry->limSmeState == eLIM_SME_NORMAL_STATE)) {
526 sch_beacon_process(pMac, pRxPacketInfo, psessionEntry);
527 } else
528 lim_process_beacon_frame(pMac, pRxPacketInfo, psessionEntry);
529
530 return;
531}
532
533/**
534 * lim_defer_msg()
535 *
536 ***FUNCTION:
537 * This function is called to defer the messages received
538 * during Learn mode
539 *
540 ***LOGIC:
541 * NA
542 *
543 ***ASSUMPTIONS:
544 * NA
545 *
546 ***NOTE:
547 * NA
548 *
549 * @param pMac - Pointer to Global MAC structure
550 * @param pMsg of type tSirMsgQ - Pointer to the message structure
551 * @return None
552 */
553
554uint32_t lim_defer_msg(tpAniSirGlobal pMac, tSirMsgQ *pMsg)
555{
556 uint32_t retCode = TX_SUCCESS;
557
558 retCode = lim_write_deferred_msg_q(pMac, pMsg);
559
560 if (retCode == TX_SUCCESS) {
561 MTRACE(mac_trace_msg_rx
562 (pMac, NO_SESSION,
563 LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DEFERRED));
564 )
565 } else {
566 lim_log(pMac, LOGE, FL("Dropped lim message (0x%X)"),
567 pMsg->type);
568 MTRACE(mac_trace_msg_rx
569 (pMac, NO_SESSION,
570 LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DROPPED));
571 )
572 }
573
574 return retCode;
575} /*** end lim_defer_msg() ***/
576
577/**
578 * lim_handle_unknown_a2_index_frames() - This function handles Unknown Unicast
579 * (A2 Index) packets
580 * @mac_ctx: Pointer to the Global Mac Context.
581 * @rx_pkt_buffer: Pointer to the packet Buffer descriptor.
582 * @session_entry: Pointer to the PE Session Entry.
583 *
584 * This routine will handle public action frames.
585 *
586 * Return: None.
587 */
588static void lim_handle_unknown_a2_index_frames(tpAniSirGlobal mac_ctx,
589 void *rx_pkt_buffer, tpPESession session_entry)
590{
591#ifdef FEATURE_WLAN_TDLS
592 tpSirMacDataHdr3a mac_hdr;
593#endif
594 if (LIM_IS_P2P_DEVICE_ROLE(session_entry))
595 lim_process_action_frame_no_session(mac_ctx,
596 (uint8_t *) rx_pkt_buffer);
597#ifdef FEATURE_WLAN_TDLS
598 mac_hdr = WMA_GET_RX_MPDUHEADER3A(rx_pkt_buffer);
599
600 if (lim_is_group_addr(mac_hdr->addr2)) {
601 CDF_TRACE(CDF_MODULE_ID_PE, CDF_TRACE_LEVEL_INFO_HIGH,
602 FL("Ignoring A2 Invalid Packet received for MC/BC:"));
603 lim_print_mac_addr(mac_ctx, mac_hdr->addr2, LOG2);
604 return;
605 }
606 CDF_TRACE(CDF_MODULE_ID_PE, CDF_TRACE_LEVEL_INFO,
607 FL("type=0x%x, subtype=0x%x"),
608 mac_hdr->fc.type, mac_hdr->fc.subType);
609 /* Currently only following type and subtype are handled.
610 * If there are more combinations, then add switch-case
611 * statements.
612 */
613 if (LIM_IS_STA_ROLE(session_entry) &&
614 (mac_hdr->fc.type == SIR_MAC_MGMT_FRAME) &&
615 (mac_hdr->fc.subType == SIR_MAC_MGMT_ACTION))
616 lim_process_action_frame(mac_ctx, rx_pkt_buffer, session_entry);
617#endif
618 return;
619}
620
621/**
622 * lim_check_mgmt_registered_frames() - This function handles registered
623 * management frames.
624 *
625 * @mac_ctx: Pointer to the Global Mac Context.
626 * @buff_desc: Pointer to the packet Buffer descriptor.
627 * @session_entry: Pointer to the PE Session Entry.
628 *
629 * This function is called to process to check if received frame match with
630 * any of the registered frame from HDD. If yes pass this frame to SME.
631 *
632 * Return: True or False for Match or Mismatch respectively.
633 */
634static bool
635lim_check_mgmt_registered_frames(tpAniSirGlobal mac_ctx, uint8_t *buff_desc,
636 tpPESession session_entry)
637{
638 tSirMacFrameCtl fc;
639 tpSirMacMgmtHdr hdr;
640 uint8_t *body;
641 struct mgmt_frm_reg_info *mgmt_frame = NULL;
642 struct mgmt_frm_reg_info *next_frm = NULL;
643 uint16_t frm_type;
644 uint16_t frm_len;
645 uint8_t type, sub_type;
646 bool match = false;
647 CDF_STATUS cdf_status;
648
649 hdr = WMA_GET_RX_MAC_HEADER(buff_desc);
650 fc = hdr->fc;
651 frm_type = (fc.type << 2) | (fc.subType << 4);
652 body = WMA_GET_RX_MPDU_DATA(buff_desc);
653 frm_len = WMA_GET_RX_PAYLOAD_LEN(buff_desc);
654
655 cdf_mutex_acquire(&mac_ctx->lim.lim_frame_register_lock);
656 cdf_list_peek_front(&mac_ctx->lim.gLimMgmtFrameRegistratinQueue,
657 (cdf_list_node_t **) &mgmt_frame);
658 cdf_mutex_release(&mac_ctx->lim.lim_frame_register_lock);
659
660 while (mgmt_frame != NULL) {
661 type = (mgmt_frame->frameType >> 2) & 0x03;
662 sub_type = (mgmt_frame->frameType >> 4) & 0x0f;
663 if ((type == SIR_MAC_MGMT_FRAME)
664 && (fc.type == SIR_MAC_MGMT_FRAME)
665 && (sub_type == SIR_MAC_MGMT_RESERVED15)) {
666 CDF_TRACE(CDF_MODULE_ID_PE, CDF_TRACE_LEVEL_INFO_HIGH,
667 FL
668 ("rcvd frm match for SIR_MAC_MGMT_RESERVED15"));
669 match = true;
670 break;
671 }
672 if (mgmt_frame->frameType == frm_type) {
673 if (mgmt_frame->matchLen <= 0) {
674 match = true;
675 break;
676 }
677 if (mgmt_frame->matchLen <= frm_len &&
678 cdf_mem_compare(mgmt_frame->matchData, body,
679 mgmt_frame->matchLen)) {
680 /* found match! */
681 match = true;
682 break;
683 }
684 }
685
686 cdf_mutex_acquire(&mac_ctx->lim.lim_frame_register_lock);
687 cdf_status =
688 cdf_list_peek_next(
689 &mac_ctx->lim.gLimMgmtFrameRegistratinQueue,
690 (cdf_list_node_t *) mgmt_frame,
691 (cdf_list_node_t **) &next_frm);
692 cdf_mutex_release(&mac_ctx->lim.lim_frame_register_lock);
693 mgmt_frame = next_frm;
694 next_frm = NULL;
695 }
696
697 if (match) {
698 CDF_TRACE(CDF_MODULE_ID_PE, CDF_TRACE_LEVEL_INFO,
699 FL("rcvd frame match with registered frame params"));
700 /* Indicate this to SME */
701 lim_send_sme_mgmt_frame_ind(mac_ctx, hdr->fc.subType,
702 (uint8_t *) hdr,
703 WMA_GET_RX_PAYLOAD_LEN(buff_desc) +
704 sizeof(tSirMacMgmtHdr), mgmt_frame->sessionId,
705 WMA_GET_RX_CH(buff_desc), session_entry, 0);
706
707 if ((type == SIR_MAC_MGMT_FRAME)
708 && (fc.type == SIR_MAC_MGMT_FRAME)
709 && (sub_type == SIR_MAC_MGMT_RESERVED15))
710 /* These packets needs to be processed by PE/SME
711 * as well as HDD.If it returns true here,
712 * the packet is forwarded to HDD only.
713 */
714 match = false;
715 }
716
717 return match;
718}
719
720/**
721 * lim_handle80211_frames()
722 *
723 ***FUNCTION:
724 * This function is called to process 802.11 frames
725 * received by LIM.
726 *
727 ***LOGIC:
728 * NA
729 *
730 ***ASSUMPTIONS:
731 * NA
732 *
733 ***NOTE:
734 * NA
735 *
736 * @param pMac - Pointer to Global MAC structure
737 * @param pMsg of type tSirMsgQ - Pointer to the message structure
738 * @return None
739 */
740
741static void
742lim_handle80211_frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, uint8_t *pDeferMsg)
743{
744 uint8_t *pRxPacketInfo = NULL;
745 tSirMacFrameCtl fc;
746 tpSirMacMgmtHdr pHdr = NULL;
747 tpPESession psessionEntry = NULL;
748 uint8_t sessionId;
749 tAniBool isFrmFt = false;
750
751 *pDeferMsg = false;
752 lim_get_b_dfrom_rx_packet(pMac, limMsg->bodyptr,
753 (uint32_t * *) &pRxPacketInfo);
754
755 pHdr = WMA_GET_RX_MAC_HEADER(pRxPacketInfo);
756 isFrmFt = WMA_GET_RX_FT_DONE(pRxPacketInfo);
757 fc = pHdr->fc;
758
759#ifdef WLAN_DUMP_MGMTFRAMES
760 lim_log(pMac, LOGE,
761 FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"),
762 fc.protVer, fc.type, fc.subType,
763 WMA_GET_RX_MAC_RATE_IDX(pRxPacketInfo));
764 CDF_TRACE_HEX_DUMP(CDF_MODULE_ID_PE, CDF_TRACE_LEVEL_ERROR, pHdr,
765 WMA_GET_RX_MPDU_HEADER_LEN(pRxPacketInfo));
766#endif
767 if (pMac->fEnableDebugLog & 0x1) {
768 if ((fc.type == SIR_MAC_MGMT_FRAME) &&
769 (fc.subType != SIR_MAC_MGMT_PROBE_REQ) &&
770 (fc.subType != SIR_MAC_MGMT_PROBE_RSP) &&
771 (fc.subType != SIR_MAC_MGMT_BEACON)) {
772 lim_log(pMac, LOGE,
773 FL("RX MGMT - Type %hu, SubType %hu, seq num[%d]"),
774 fc.type,
775 fc.subType,
776 ((pHdr->seqControl.seqNumHi <<
777 HIGH_SEQ_NUM_OFFSET) |
778 pHdr->seqControl.seqNumLo));
779 }
780 }
781#ifdef FEATURE_WLAN_EXTSCAN
782 if (WMA_IS_EXTSCAN_SCAN_SRC(pRxPacketInfo) ||
783 WMA_IS_EPNO_SCAN_SRC(pRxPacketInfo)) {
784 if (fc.subType == SIR_MAC_MGMT_BEACON ||
785 fc.subType == SIR_MAC_MGMT_PROBE_RSP) {
786 __lim_process_ext_scan_beacon_probe_rsp(pMac,
787 pRxPacketInfo,
788 fc.subType);
789 } else {
790 lim_log(pMac, LOGE,
791 FL("Wrong frameType %d, Subtype %d for %d"),
792 fc.type, fc.subType,
793 WMA_GET_SCAN_SRC(pRxPacketInfo));
794 }
795 goto end;
796 }
797#endif
798 if (WMA_GET_OFFLOADSCANLEARN(pRxPacketInfo)) {
799 if (fc.subType == SIR_MAC_MGMT_BEACON) {
800 lim_log(pMac, LOG2, FL("Learning scan beacon"));
801 __lim_handle_beacon(pMac, limMsg, NULL);
802 } else if (fc.subType == SIR_MAC_MGMT_PROBE_RSP) {
803 lim_log(pMac, LOG2, FL("Learning scan probe rsp"));
804 lim_process_probe_rsp_frame_no_session(pMac, pRxPacketInfo);
805 } else {
806 lim_log(pMac, LOGE,
807 FL("Wrong frame Type %d, Subtype %d for LFR"),
808 fc.type, fc.subType);
809 }
810 goto end;
811 }
812 /* Added For BT-AMP Support */
813 if ((psessionEntry =
814 pe_find_session_by_bssid(pMac, pHdr->bssId,
815 &sessionId)) == NULL) {
816#ifdef WLAN_FEATURE_VOWIFI_11R
817 if (fc.subType == SIR_MAC_MGMT_AUTH) {
818#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
819 lim_log(pMac, LOG1,
Vidyullatha Kanchanapally3554e4e2015-08-12 12:43:18 -0700820 FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"),
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800821 fc.protVer, fc.type, fc.subType,
822 WMA_GET_RX_MAC_RATE_IDX(pRxPacketInfo));
823 lim_print_mac_addr(pMac, pHdr->bssId, LOG1);
824#endif
825 if (lim_process_auth_frame_no_session
826 (pMac, pRxPacketInfo,
827 limMsg->bodyptr) == eSIR_SUCCESS) {
Vidyullatha Kanchanapally3554e4e2015-08-12 12:43:18 -0700828 goto end;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800829 }
830 }
831#endif
Vidyullatha Kanchanapally3554e4e2015-08-12 12:43:18 -0700832 /* Public action frame can be received from non-assoc stations*/
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800833 if ((fc.subType != SIR_MAC_MGMT_PROBE_RSP) &&
834 (fc.subType != SIR_MAC_MGMT_BEACON) &&
835 (fc.subType != SIR_MAC_MGMT_PROBE_REQ)
Vidyullatha Kanchanapally3554e4e2015-08-12 12:43:18 -0700836 && (fc.subType != SIR_MAC_MGMT_ACTION)) {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800837
Vidyullatha Kanchanapally3554e4e2015-08-12 12:43:18 -0700838 psessionEntry = pe_find_session_by_peer_sta(pMac,
839 pHdr->sa, &sessionId);
840 if (psessionEntry == NULL) {
841 lim_log(pMac, LOG3,
842 FL("session does not exist for bssId"));
843 lim_print_mac_addr(pMac, pHdr->sa, LOG3);
844 goto end;
845 } else {
846 lim_log(pMac, LOG3,
847 "SessionId:%d exists for given Bssid",
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800848 psessionEntry->peSessionId);
Vidyullatha Kanchanapally3554e4e2015-08-12 12:43:18 -0700849 }
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800850 }
851 /* For p2p resp frames search for valid session with DA as */
852 /* BSSID will be SA and session will be present with DA only */
853 if (fc.subType == SIR_MAC_MGMT_ACTION) {
854 psessionEntry =
855 pe_find_session_by_bssid(pMac, pHdr->da, &sessionId);
856 }
857 }
858
859 /* Check if frame is registered by HDD */
860 if (lim_check_mgmt_registered_frames(pMac, pRxPacketInfo, psessionEntry)) {
861 lim_log(pMac, LOG1, FL("Received frame is passed to SME"));
Vidyullatha Kanchanapally3554e4e2015-08-12 12:43:18 -0700862 goto end;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800863 }
864
865 if (fc.protVer != SIR_MAC_PROTOCOL_VERSION) { /* Received Frame with non-zero Protocol Version */
866 lim_log(pMac, LOGE,
867 FL("Unexpected frame with protVersion %d received"),
868 fc.protVer);
869 lim_pkt_free(pMac, TXRX_FRM_802_11_MGMT, pRxPacketInfo,
870 (void *)limMsg->bodyptr);
871#ifdef WLAN_DEBUG
872 pMac->lim.numProtErr++;
873#endif
Vidyullatha Kanchanapally3554e4e2015-08-12 12:43:18 -0700874 goto end;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800875 }
876
877/* Chance of crashing : to be done BT-AMP ........happens when broadcast probe req is received */
878
879#ifdef WLAN_DEBUG
880 pMac->lim.numMAC[fc.type][fc.subType]++;
881#endif
882
883 switch (fc.type) {
884 case SIR_MAC_MGMT_FRAME:
885 {
886 /* Received Management frame */
887 switch (fc.subType) {
888 case SIR_MAC_MGMT_ASSOC_REQ:
889 /* Make sure the role supports Association */
890 if (LIM_IS_BT_AMP_AP_ROLE(psessionEntry) ||
891 LIM_IS_AP_ROLE(psessionEntry))
892 lim_process_assoc_req_frame(pMac,
893 pRxPacketInfo,
894 LIM_ASSOC,
895 psessionEntry);
896 else {
897 /* Unwanted messages - Log error */
898 lim_log(pMac, LOGE,
899 FL
900 ("unexpected message received %X"),
901 limMsg->type);
902 lim_print_msg_name(pMac, LOGE,
903 limMsg->type);
904 }
905 break;
906
907 case SIR_MAC_MGMT_ASSOC_RSP:
908 lim_process_assoc_rsp_frame(pMac, pRxPacketInfo,
909 LIM_ASSOC,
910 psessionEntry);
911 break;
912
913 case SIR_MAC_MGMT_REASSOC_REQ:
914 /* Make sure the role supports Reassociation */
915 if (LIM_IS_BT_AMP_AP_ROLE(psessionEntry) ||
916 LIM_IS_AP_ROLE(psessionEntry)) {
917 lim_process_assoc_req_frame(pMac,
918 pRxPacketInfo,
919 LIM_REASSOC,
920 psessionEntry);
921 } else {
922 /* Unwanted messages - Log error */
923 lim_log(pMac, LOGE,
924 FL
925 ("unexpected message received %X"),
926 limMsg->type);
927 lim_print_msg_name(pMac, LOGE,
928 limMsg->type);
929 }
930 break;
931
932 case SIR_MAC_MGMT_REASSOC_RSP:
933 lim_process_assoc_rsp_frame(pMac, pRxPacketInfo,
934 LIM_REASSOC,
935 psessionEntry);
936 break;
937
938 case SIR_MAC_MGMT_PROBE_REQ:
939 lim_process_probe_req_frame_multiple_bss(pMac,
940 pRxPacketInfo,
941 psessionEntry);
942 break;
943
944 case SIR_MAC_MGMT_PROBE_RSP:
945 if (psessionEntry == NULL)
946 lim_process_probe_rsp_frame_no_session(pMac,
947 pRxPacketInfo);
948 else
949 lim_process_probe_rsp_frame(pMac,
950 pRxPacketInfo,
951 psessionEntry);
952 break;
953
954 case SIR_MAC_MGMT_BEACON:
955 __lim_handle_beacon(pMac, limMsg, psessionEntry);
956 break;
957
958 case SIR_MAC_MGMT_DISASSOC:
959 lim_process_disassoc_frame(pMac, pRxPacketInfo,
960 psessionEntry);
961 break;
962
963 case SIR_MAC_MGMT_AUTH:
964 lim_process_auth_frame(pMac, pRxPacketInfo,
965 psessionEntry);
966 break;
967
968 case SIR_MAC_MGMT_DEAUTH:
969 lim_process_deauth_frame(pMac, pRxPacketInfo,
970 psessionEntry);
971 break;
972
973 case SIR_MAC_MGMT_ACTION:
974 if (psessionEntry == NULL)
975 lim_process_action_frame_no_session(pMac,
976 pRxPacketInfo);
977 else {
978 if (WMA_GET_RX_UNKNOWN_UCAST
979 (pRxPacketInfo))
980 lim_handle_unknown_a2_index_frames
981 (pMac, pRxPacketInfo,
982 psessionEntry);
983 else
984 lim_process_action_frame(pMac,
985 pRxPacketInfo,
986 psessionEntry);
987 }
988 break;
989 default:
990 /* Received Management frame of 'reserved' subtype */
991 break;
992 } /* switch (fc.subType) */
993
994 }
995 break;
996 case SIR_MAC_DATA_FRAME:
997 {
998 }
999 break;
1000 default:
1001 /* Received frame of type 'reserved' */
1002 break;
1003
1004 } /* switch (fc.type) */
1005
1006end:
1007 lim_pkt_free(pMac, TXRX_FRM_802_11_MGMT, pRxPacketInfo,
1008 (void *)limMsg->bodyptr);
1009 return;
1010} /*** end lim_handle80211_frames() ***/
1011
1012/**
1013 * lim_send_stop_scan_offload_req()
1014 *
1015 ***FUNCTION:
1016 * This function will be called to abort the ongoing offloaded scan
1017 * request.
1018 *
1019 *
1020 ***NOTE:
1021 *
1022 * @param pMac Pointer to Global MAC structure
1023 * @return CDF_STATUS_SUCCESS or CDF_STATUS_E_FAILURE
1024 */
1025CDF_STATUS lim_send_stop_scan_offload_req(tpAniSirGlobal pMac,
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001026 uint8_t SessionId, uint32_t scan_id, uint32_t scan_requestor_id)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001027{
1028 tSirMsgQ msg;
1029 tSirRetStatus rc = eSIR_SUCCESS;
1030 tAbortScanParams *pAbortScanParams;
1031
1032 pAbortScanParams = cdf_mem_malloc(sizeof(tAbortScanParams));
1033 if (NULL == pAbortScanParams) {
1034 lim_log(pMac, LOGP,
1035 FL("Memory allocation failed for AbortScanParams"));
1036 return CDF_STATUS_E_NOMEM;
1037 }
1038
1039 pAbortScanParams->SessionId = SessionId;
1040 pAbortScanParams->scan_id = scan_id;
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001041 pAbortScanParams->scan_requestor_id = scan_requestor_id;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001042 msg.type = WMA_STOP_SCAN_OFFLOAD_REQ;
1043 msg.bodyptr = pAbortScanParams;
1044 msg.bodyval = 0;
1045
1046 rc = wma_post_ctrl_msg(pMac, &msg);
1047 if (rc != eSIR_SUCCESS) {
1048 lim_log(pMac, LOGE, FL("wma_post_ctrl_msg() return failure"));
1049 cdf_mem_free(pAbortScanParams);
1050 return CDF_STATUS_E_FAILURE;
1051 }
1052
1053 lim_log(pMac, LOG1, FL("Abort ongoing offload scan."));
1054 return CDF_STATUS_SUCCESS;
1055
1056}
1057
1058/**
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001059 * lim_process_abort_scan_ind() - abort the scan which is presently being run
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001060 *
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001061 * @mac_ctx: Pointer to Global MAC structure
1062 * @session_id: PE session
1063 * @scan_id: Scan ID from the scan request
1064 * @scan_requesor_id: Entity requesting the scan
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001065 *
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001066 * @return: None
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001067 */
1068void lim_process_abort_scan_ind(tpAniSirGlobal mac_ctx,
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001069 uint8_t session_id, uint32_t scan_id, uint32_t scan_requestor_id)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001070{
1071#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001072 lim_diag_event_report(mac_ctx, WLAN_PE_DIAG_SCAN_ABORT_IND_EVENT,
1073 NULL, 0, 0);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001074#endif
1075
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001076 lim_log(mac_ctx, LOG2, FL("scan_id %d, scan_requestor_id 0x%x"),
1077 scan_id, scan_requestor_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001078
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001079 /* send stop scan cmd to firmware */
1080 lim_send_stop_scan_offload_req(mac_ctx, session_id, scan_id,
1081 scan_requestor_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001082 return;
1083}
1084
1085/**
1086 * lim_message_processor() - Process messages from LIM.
1087 *
1088 * @mac_ctx: Pointer to the Global Mac Context.
1089 * @msg: Received LIM message.
1090 *
1091 * Wrapper function for lim_process_messages when handling messages received by
1092 * LIM.Could either defer messages or process them.
1093 *
1094 * Return: None.
1095 */
1096void lim_message_processor(tpAniSirGlobal mac_ctx, tpSirMsgQ msg)
1097{
1098 if (eLIM_MLM_OFFLINE_STATE == mac_ctx->lim.gLimMlmState) {
1099 pe_free_msg(mac_ctx, msg);
1100 return;
1101 }
1102
1103 if (!def_msg_decision(mac_ctx, msg)) {
1104 lim_process_messages(mac_ctx, msg);
1105 /* process deferred message queue if allowed */
1106 if ((!(mac_ctx->lim.gLimAddtsSent)) &&
1107 (!(lim_is_system_in_scan_state(mac_ctx))) &&
1108 (true == GET_LIM_PROCESS_DEFD_MESGS(mac_ctx)))
1109 lim_process_deferred_message_queue(mac_ctx);
1110 }
1111}
1112
1113#ifdef FEATURE_OEM_DATA_SUPPORT
1114
1115void lim_oem_data_rsp_handle_resume_link_rsp(tpAniSirGlobal pMac, CDF_STATUS status,
1116 uint32_t *mlmOemDataRsp)
1117{
1118 if (status != CDF_STATUS_SUCCESS) {
1119 lim_log(pMac, LOGE,
1120 FL
1121 ("OEM Data Rsp failed to get the response for resume link"));
1122 }
1123
1124 if (NULL != pMac->lim.gpLimMlmOemDataReq) {
1125 cdf_mem_free(pMac->lim.gpLimMlmOemDataReq);
1126 pMac->lim.gpLimMlmOemDataReq = NULL;
1127 }
1128 /* "Failure" status doesn't mean that Oem Data Rsp did not happen */
1129 /* and hence we need to respond to upper layers. Only Resume link is failed, but */
1130 /* we got the oem data response already. */
1131 /* Post the meessage to MLM */
1132 lim_post_sme_message(pMac, LIM_MLM_OEM_DATA_CNF,
1133 (uint32_t *) (mlmOemDataRsp));
1134
1135 return;
1136}
1137
1138void lim_process_oem_data_rsp(tpAniSirGlobal pMac, uint32_t *body)
1139{
1140 tpLimMlmOemDataRsp mlmOemDataRsp = NULL;
1141
1142 /* Process all the messages for the lim queue */
1143 SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
1144
1145 mlmOemDataRsp = (tpLimMlmOemDataRsp) body;
1146
1147 PELOG1(lim_log
1148 (pMac, LOG1, FL("%s: sending oem data response msg to sme"),
1149 __func__);
1150 )
1151 lim_post_sme_message(pMac, LIM_MLM_OEM_DATA_CNF,
1152 (uint32_t *) (mlmOemDataRsp));
1153
1154 return;
1155}
1156
1157#endif
1158
1159/**
1160 * lim_process_messages() - Process messages from upper layers.
1161 *
1162 * @mac_ctx: Pointer to the Global Mac Context.
1163 * @msg: Received message.
1164 *
1165 * Return: None.
1166 */
1167void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg)
1168{
1169#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
1170 uint8_t vdev_id = 0;
1171 tUpdateBeaconParams beacon_params;
1172#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
1173 uint8_t i;
1174 uint8_t p2p_go_exists = 0;
1175 tpPESession session_entry = NULL;
1176 uint8_t defer_msg = false;
1177 tLinkStateParams *link_state_param;
1178 uint16_t pkt_len = 0;
1179 cds_pkt_t *body_ptr = NULL;
1180 CDF_STATUS cdf_status;
1181 tSirMsgQ new_msg;
1182 tSirSmeScanAbortReq *req_msg = NULL;
1183 uint8_t session_id;
1184 uint32_t scan_id;
1185
1186#ifdef FEATURE_WLAN_TDLS
1187 tSirTdlsInd *tdls_ind = NULL;
1188 tpDphHashNode sta_ds = NULL;
1189 tTdlsLinkEstablishParams *tdls_link_params = NULL;
1190#endif
1191 tSirMbMsgP2p *p2p_msg = NULL;
1192 if (ANI_DRIVER_TYPE(mac_ctx) == eDRIVER_TYPE_MFG) {
1193 cdf_mem_free(msg->bodyptr);
1194 msg->bodyptr = NULL;
1195 return;
1196 }
1197 if (msg == NULL) {
1198 lim_log(mac_ctx, LOGE, FL("Message pointer is Null"));
1199 CDF_ASSERT(0);
1200 return;
1201 }
1202#ifdef WLAN_DEBUG
1203 mac_ctx->lim.numTot++;
1204#endif
1205 MTRACE(mac_trace_msg_rx(mac_ctx, NO_SESSION,
1206 LIM_TRACE_MAKE_RXMSG(msg->type, LIM_MSG_PROCESSED));)
1207
1208 switch (msg->type) {
1209
1210 case SIR_LIM_UPDATE_BEACON:
1211 lim_update_beacon(mac_ctx);
1212 break;
1213 case SIR_CFG_PARAM_UPDATE_IND:
1214 if (!lim_is_system_in_scan_state(mac_ctx)) {
1215 lim_handle_cf_gparam_update(mac_ctx, msg->bodyval);
1216 break;
1217 }
1218 /* System is in DFS (Learn) mode.
1219 * Defer processsing this message
1220 */
1221 if (lim_defer_msg(mac_ctx, msg) != TX_SUCCESS) {
1222 if (!(mac_ctx->lim.deferredMsgCnt & 0xF))
1223 CDF_TRACE(CDF_MODULE_ID_PE, LOGE,
1224 FL("Unable to Defer Msg"));
1225 lim_log_session_states(mac_ctx);
1226 lim_print_msg_name(mac_ctx, LOGE, msg->type);
1227 }
1228 break;
1229#ifdef FEATURE_OEM_DATA_SUPPORT
1230 case WMA_START_OEM_DATA_RSP:
1231 lim_process_oem_data_rsp(mac_ctx, msg->bodyptr);
1232 msg->bodyptr = NULL;
1233 break;
1234#endif
1235 case WMA_SWITCH_CHANNEL_RSP:
1236 lim_process_switch_channel_rsp(mac_ctx, msg->bodyptr);
1237 msg->bodyptr = NULL;
1238 break;
1239#ifdef ANI_SIR_IBSS_PEER_CACHING
1240 case WMA_IBSS_STA_ADD:
1241 lim_ibss_sta_add(mac_ctx, msg->bodyptr);
1242 break;
1243#endif
1244 case SIR_BB_XPORT_MGMT_MSG:
1245 /* These messages are from Peer MAC entity. */
1246#ifdef WLAN_DEBUG
1247 mac_ctx->lim.numBbt++;
1248#endif
1249 /* The original msg which we were deferring have the
1250 * bodyPointer point to 'BD' instead of 'cds pkt'. If we
1251 * don't make a copy of msg, then overwrite the
1252 * msg->bodyPointer and next time when we try to
1253 * process the msg, we will try to use 'BD' as
1254 * 'cds Pkt' which will cause a crash
1255 */
1256 if (msg->bodyptr == NULL) {
1257 lim_log(mac_ctx, LOGE, FL("Message bodyptr is Null"));
1258 CDF_ASSERT(0);
1259 break;
1260 }
1261 cdf_mem_copy((uint8_t *) &new_msg,
1262 (uint8_t *) msg, sizeof(tSirMsgQ));
1263 body_ptr = (cds_pkt_t *) new_msg.bodyptr;
1264 cds_pkt_get_packet_length(body_ptr, &pkt_len);
1265
1266 cdf_status = wma_ds_peek_rx_packet_info(body_ptr,
1267 (void **) &new_msg.bodyptr, false);
1268
1269 if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
1270 cds_pkt_return_packet(body_ptr);
1271 break;
1272 }
1273
1274 if (WMA_GET_ROAMCANDIDATEIND(new_msg.bodyptr))
1275 lim_log(mac_ctx, LOG1, FL("roamCandidateInd %d"),
1276 WMA_GET_ROAMCANDIDATEIND(new_msg.bodyptr));
1277
1278 if (WMA_GET_OFFLOADSCANLEARN(new_msg.bodyptr))
1279 lim_log(mac_ctx, LOG1, FL("offloadScanLearn %d"),
1280 WMA_GET_OFFLOADSCANLEARN(new_msg.bodyptr));
1281
1282 lim_handle80211_frames(mac_ctx, &new_msg, &defer_msg);
1283
1284 if (defer_msg == true) {
1285 CDF_TRACE(CDF_MODULE_ID_PE, LOG1,
1286 FL("Defer Msg type=%x"), msg->type);
1287 if (lim_defer_msg(mac_ctx, msg) != TX_SUCCESS) {
1288 CDF_TRACE(CDF_MODULE_ID_PE, LOGE,
1289 FL("Unable to Defer Msg"));
1290 lim_log_session_states(mac_ctx);
1291 cds_pkt_return_packet(body_ptr);
1292 }
1293 } else
1294 /* PE is not deferring this 802.11 frame so we need to
1295 * call cds_pkt_return. Asumption here is when Rx mgmt
1296 * frame processing is done, cds packet could be
1297 * freed here.
1298 */
1299 cds_pkt_return_packet(body_ptr);
1300 break;
1301 case eWNI_SME_SCAN_REQ:
1302 case eWNI_SME_REMAIN_ON_CHANNEL_REQ:
1303 case eWNI_SME_DISASSOC_REQ:
1304 case eWNI_SME_DEAUTH_REQ:
1305#ifdef FEATURE_OEM_DATA_SUPPORT
1306 case eWNI_SME_OEM_DATA_REQ:
1307#endif
1308#ifdef FEATURE_WLAN_TDLS
1309 case eWNI_SME_TDLS_SEND_MGMT_REQ:
1310 case eWNI_SME_TDLS_ADD_STA_REQ:
1311 case eWNI_SME_TDLS_DEL_STA_REQ:
1312 case eWNI_SME_TDLS_LINK_ESTABLISH_REQ:
1313#endif
1314 case eWNI_SME_RESET_AP_CAPS_CHANGED:
1315 case eWNI_SME_SET_HW_MODE_REQ:
1316 case eWNI_SME_SET_DUAL_MAC_CFG_REQ:
1317 /* These messages are from HDD. Need to respond to HDD */
1318 lim_process_normal_hdd_msg(mac_ctx, msg, true);
1319 break;
1320
1321 case eWNI_SME_SCAN_ABORT_IND:
1322 req_msg = msg->bodyptr;
1323 if (req_msg) {
1324 session_id = req_msg->sessionId;
1325 scan_id = req_msg->scan_id;
1326 lim_process_abort_scan_ind(mac_ctx, session_id,
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001327 scan_id, USER_SCAN_REQUESTOR_ID);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001328 cdf_mem_free((void *)msg->bodyptr);
1329 msg->bodyptr = NULL;
1330 }
1331 break;
1332 case eWNI_SME_SYS_READY_IND:
1333 case eWNI_SME_JOIN_REQ:
1334 case eWNI_SME_REASSOC_REQ:
1335 case eWNI_SME_START_BSS_REQ:
1336 case eWNI_SME_STOP_BSS_REQ:
1337 case eWNI_SME_SWITCH_CHL_IND:
1338 case eWNI_SME_SETCONTEXT_REQ:
1339 case eWNI_SME_DISASSOC_CNF:
1340 case eWNI_SME_DEAUTH_CNF:
1341 case eWNI_SME_ASSOC_CNF:
1342 case eWNI_SME_ADDTS_REQ:
1343 case eWNI_SME_DELTS_REQ:
1344 case eWNI_SME_GET_ASSOC_STAS_REQ:
1345 case eWNI_SME_TKIP_CNTR_MEAS_REQ:
1346 case eWNI_SME_UPDATE_APWPSIE_REQ:
1347 case eWNI_SME_HIDE_SSID_REQ:
1348 case eWNI_SME_GET_WPSPBC_SESSION_REQ:
1349 case eWNI_SME_SET_APWPARSNIEs_REQ:
1350 case eWNI_SME_CHNG_MCC_BEACON_INTERVAL:
1351#if defined WLAN_FEATURE_VOWIFI
1352 case eWNI_SME_NEIGHBOR_REPORT_REQ_IND:
1353 case eWNI_SME_BEACON_REPORT_RESP_XMIT_IND:
1354#endif
1355#if defined FEATURE_WLAN_ESE
1356 case eWNI_SME_ESE_ADJACENT_AP_REPORT:
1357#endif
1358#ifdef WLAN_FEATURE_VOWIFI_11R
1359 case eWNI_SME_FT_UPDATE_KEY:
1360 case eWNI_SME_FT_PRE_AUTH_REQ:
1361 case eWNI_SME_FT_AGGR_QOS_REQ:
1362#endif
1363 case eWNI_SME_REGISTER_MGMT_FRAME_REQ:
1364 case eWNI_SME_UPDATE_NOA:
1365 case eWNI_SME_CLEAR_DFS_CHANNEL_LIST:
1366 case eWNI_SME_GET_STATISTICS_REQ:
1367#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
1368 case eWNI_SME_GET_TSM_STATS_REQ:
1369#endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */
Abhishek Singh7996eb72015-12-30 17:24:02 +05301370 case eWNI_SME_REGISTER_MGMT_FRAME_CB:
Abhishek Singh518323d2015-10-19 17:42:01 +05301371 case eWNI_SME_EXT_CHANGE_CHANNEL:
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001372 /* These messages are from HDD.No need to respond to HDD */
1373 lim_process_normal_hdd_msg(mac_ctx, msg, false);
1374 break;
1375
1376 case eWNI_PMC_SMPS_STATE_IND:
1377 if (msg->bodyptr) {
1378 cdf_mem_free(msg->bodyptr);
1379 msg->bodyptr = NULL;
1380 }
1381 break;
1382 case eWNI_SME_SEND_ACTION_FRAME_IND:
1383 lim_send_p2p_action_frame(mac_ctx, msg);
1384 cdf_mem_free(msg->bodyptr);
1385 msg->bodyptr = NULL;
1386 break;
1387 case eWNI_SME_ABORT_REMAIN_ON_CHAN_IND:
1388 p2p_msg = (tSirMbMsgP2p *) msg->bodyptr;
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07001389 lim_process_abort_scan_ind(mac_ctx, p2p_msg->sessionId,
1390 p2p_msg->scan_id, ROC_SCAN_REQUESTOR_ID);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001391 cdf_mem_free(msg->bodyptr);
1392 msg->bodyptr = NULL;
1393 break;
1394 case SIR_HAL_P2P_NOA_START_IND:
1395 session_entry = &mac_ctx->lim.gpSession[0];
1396 lim_log(mac_ctx, LOG1, "LIM received NOA start %x", msg->type);
1397
1398 /* Since insert NOA is done and NOA start msg received,
1399 * we should deactivate the Insert NOA timer
1400 */
1401 lim_deactivate_and_change_timer(mac_ctx,
1402 eLIM_INSERT_SINGLESHOT_NOA_TIMER);
1403
1404 for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
1405 session_entry = &mac_ctx->lim.gpSession[i];
1406 if ((session_entry != NULL) && (session_entry->valid) &&
1407 (session_entry->pePersona == CDF_P2P_GO_MODE)) {
1408 /* Save P2P NOA start attribute for Go persona*/
1409 p2p_go_exists = 1;
1410 cdf_mem_copy(&session_entry->p2pGoPsNoaStartInd,
1411 msg->bodyptr, sizeof(tSirP2PNoaStart));
1412 cdf_status =
1413 session_entry->p2pGoPsNoaStartInd.status;
1414 if (cdf_status != CDF_STATUS_SUCCESS)
1415 CDF_TRACE(CDF_MODULE_ID_PE, LOGW,
1416 FL(
1417 "GO NOA start status %d by FW"),
1418 cdf_status);
1419 break;
1420 }
1421 }
1422
1423 if (p2p_go_exists == 0)
1424 CDF_TRACE(CDF_MODULE_ID_PE, LOGW,
1425 FL(
1426 "GO is removed by the time NOA start recvd"));
1427
1428 /* We received the NOA start indication. Now we can send down
1429 * the SME request which requires off-channel operation */
1430 lim_process_regd_defd_sme_req_after_noa_start(mac_ctx);
1431 cdf_mem_free(msg->bodyptr);
1432 msg->bodyptr = NULL;
1433 break;
1434#ifdef FEATURE_WLAN_TDLS
1435 case SIR_HAL_TDLS_IND:
1436 tdls_ind = (tpSirTdlsInd) msg->bodyptr;
1437 session_entry = pe_find_session_by_sta_id(mac_ctx,
1438 tdls_ind->staIdx, &session_id);
1439 if (session_entry == NULL) {
1440 lim_log(mac_ctx, LOG1,
1441 FL("No session exist for given bssId"));
1442 cdf_mem_free(msg->bodyptr);
1443 msg->bodyptr = NULL;
1444 return;
1445 }
1446 sta_ds = dph_get_hash_entry(mac_ctx, tdls_ind->assocId,
1447 &session_entry->dph.dphHashTable);
1448 if (sta_ds == NULL) {
1449 lim_log(mac_ctx, LOG1,
1450 FL("No sta_ds exist for given staId"));
1451 cdf_mem_free(msg->bodyptr);
1452 msg->bodyptr = NULL;
1453 return;
1454 }
1455
1456 if (STA_ENTRY_TDLS_PEER == sta_ds->staType) {
1457 lim_log(mac_ctx, LOGE,
1458 FL("rcvd TDLS IND from FW with RC %d "),
1459 tdls_ind->reasonCode);
1460 lim_send_sme_tdls_del_sta_ind(mac_ctx, sta_ds,
1461 session_entry, tdls_ind->reasonCode);
1462 }
1463 cdf_mem_free(msg->bodyptr);
1464 msg->bodyptr = NULL;
1465 break;
1466#endif
1467 case SIR_HAL_P2P_NOA_ATTR_IND:
1468 session_entry = &mac_ctx->lim.gpSession[0];
1469 lim_log(mac_ctx, LOG1, FL("Received message Noa_ATTR %x"),
1470 msg->type);
1471 for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
1472 session_entry = &mac_ctx->lim.gpSession[i];
1473 if ((session_entry != NULL) && (session_entry->valid)
1474 && (session_entry->pePersona ==
1475 CDF_P2P_GO_MODE)) { /* Save P2P attr for Go */
1476 cdf_mem_copy(
1477 &session_entry->p2pGoPsUpdate,
1478 msg->bodyptr,
1479 sizeof(tSirP2PNoaAttr));
1480 lim_log(mac_ctx, LOG2,
1481 FL("bssId"
1482 MAC_ADDRESS_STR
1483 " ctWin=%d oppPsFlag=%d"),
1484 MAC_ADDR_ARRAY(
1485 session_entry->bssId),
1486 session_entry->p2pGoPsUpdate.ctWin,
1487 session_entry->p2pGoPsUpdate.oppPsFlag);
1488 lim_log(mac_ctx, LOG2,
1489 FL
1490 (" uNoa1IntervalCnt=%d uNoa1Duration=%d uNoa1Interval=%d uNoa1StartTime=%d"),
1491 session_entry->p2pGoPsUpdate.uNoa1IntervalCnt,
1492 session_entry->p2pGoPsUpdate.uNoa1Duration,
1493 session_entry->p2pGoPsUpdate.uNoa1Interval,
1494 session_entry->p2pGoPsUpdate.uNoa1StartTime);
1495 break;
1496 }
1497 }
1498 cdf_mem_free(msg->bodyptr);
1499 msg->bodyptr = NULL;
1500 break;
1501 case WMA_MISSED_BEACON_IND:
1502 lim_ps_offload_handle_missed_beacon_ind(mac_ctx, msg);
1503 cdf_mem_free(msg->bodyptr);
1504 msg->bodyptr = NULL;
1505 break;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001506 case SIR_LIM_ADDTS_RSP_TIMEOUT:
1507 lim_process_sme_req_messages(mac_ctx, msg);
1508 break;
1509#ifdef FEATURE_WLAN_ESE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001510 case WMA_TSM_STATS_RSP:
1511#ifdef FEATURE_WLAN_ESE_UPLOAD
1512 lim_send_sme_pe_ese_tsm_rsp(mac_ctx,
1513 (tAniGetTsmStatsRsp *) msg->bodyptr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001514#endif /* FEATURE_WLAN_ESE_UPLOAD */
1515 break;
1516#endif
1517 case WMA_ADD_TS_RSP:
1518 lim_process_hal_add_ts_rsp(mac_ctx, msg);
1519 break;
1520 case SIR_LIM_DEL_TS_IND:
1521 lim_process_del_ts_ind(mac_ctx, msg);
1522 break;
1523 case SIR_LIM_BEACON_GEN_IND:
1524 if (mac_ctx->lim.gLimSystemRole != eLIM_AP_ROLE)
1525 sch_process_pre_beacon_ind(mac_ctx, msg);
1526 break;
1527 case SIR_LIM_DELETE_STA_CONTEXT_IND:
1528 lim_delete_sta_context(mac_ctx, msg);
1529 break;
1530 case SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT:
1531 case SIR_LIM_JOIN_FAIL_TIMEOUT:
1532 case SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT:
1533 case SIR_LIM_AUTH_FAIL_TIMEOUT:
1534 case SIR_LIM_AUTH_RSP_TIMEOUT:
1535 case SIR_LIM_ASSOC_FAIL_TIMEOUT:
1536 case SIR_LIM_REASSOC_FAIL_TIMEOUT:
1537#ifdef WLAN_FEATURE_VOWIFI_11R
1538 case SIR_LIM_FT_PREAUTH_RSP_TIMEOUT:
1539#endif
1540 case SIR_LIM_REMAIN_CHN_TIMEOUT:
1541 case SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT:
1542 case SIR_LIM_DISASSOC_ACK_TIMEOUT:
1543 case SIR_LIM_DEAUTH_ACK_TIMEOUT:
1544 case SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
1545 /* These timeout messages are handled by MLM sub module */
1546 lim_process_mlm_req_messages(mac_ctx, msg);
1547 break;
1548 case SIR_LIM_HEART_BEAT_TIMEOUT:
1549 /** check if heart beat failed, even if one Beacon
1550 * is rcvd within the Heart Beat interval continue
1551 * normal processing
1552 */
1553 if (NULL == msg->bodyptr)
1554 lim_log(mac_ctx, LOGE,
1555 FL("Can't Process HB TO - bodyptr is Null"));
1556 else {
1557 session_entry = (tpPESession) msg->bodyptr;
1558 lim_log(mac_ctx, LOGE,
1559 FL
1560 ("SIR_LIM_HEART_BEAT_TIMEOUT, Session %d"),
1561 ((tpPESession) msg->bodyptr)->peSessionId);
1562 limResetHBPktCount(session_entry);
1563 lim_handle_heart_beat_timeout_for_session(mac_ctx,
1564 session_entry);
1565 }
1566 break;
1567 case SIR_LIM_PROBE_HB_FAILURE_TIMEOUT:
1568 lim_handle_heart_beat_failure_timeout(mac_ctx);
1569 break;
1570 case SIR_LIM_HASH_MISS_THRES_TIMEOUT:
1571 mac_ctx->lim.gLimDisassocFrameCredit = 0;
1572 break;
1573 case SIR_LIM_CNF_WAIT_TIMEOUT:
1574 /* Does not receive CNF or dummy packet */
1575 lim_handle_cnf_wait_timeout(mac_ctx, (uint16_t) msg->bodyval);
1576 break;
1577 case SIR_LIM_RETRY_INTERRUPT_MSG:
1578 /* Message from ISR upon TFP's max retry limit interrupt */
1579 break;
1580 case SIR_LIM_INV_KEY_INTERRUPT_MSG:
1581 /* Message from ISR upon SP's Invalid session key interrupt */
1582 break;
1583 case SIR_LIM_KEY_ID_INTERRUPT_MSG:
1584 /* Message from ISR upon SP's Invalid key ID interrupt */
1585 break;
1586 case SIR_LIM_REPLAY_THRES_INTERRUPT_MSG:
1587 /* Message from ISR upon SP's Replay threshold interrupt */
1588 break;
1589 case SIR_LIM_CHANNEL_SWITCH_TIMEOUT:
1590 lim_process_channel_switch_timeout(mac_ctx);
1591 break;
1592 case SIR_LIM_QUIET_TIMEOUT:
1593 lim_process_quiet_timeout(mac_ctx);
1594 break;
1595 case SIR_LIM_QUIET_BSS_TIMEOUT:
1596 lim_process_quiet_bss_timeout(mac_ctx);
1597 break;
1598 case SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT:
1599 lim_handle_update_olbc_cache(mac_ctx);
1600 break;
1601#ifdef FEATURE_WLAN_TDLS
1602 case SIR_HAL_TDLS_SHOULD_DISCOVER:
1603 case SIR_HAL_TDLS_SHOULD_TEARDOWN:
1604 case SIR_HAL_TDLS_PEER_DISCONNECTED:
1605 CDF_TRACE(CDF_MODULE_ID_PE, CDF_TRACE_LEVEL_INFO,
1606 ("%s received tdls event: 0x%x"), __func__, msg->type);
1607 lim_send_sme_tdls_event_notify(mac_ctx, msg->type,
1608 (void *)msg->bodyptr);
1609 break;
1610#endif
1611 case WMA_ADD_BSS_RSP:
1612 lim_process_mlm_add_bss_rsp(mac_ctx, msg);
1613 break;
1614 case WMA_ADD_STA_RSP:
1615 lim_process_add_sta_rsp(mac_ctx, msg);
1616 break;
1617 case WMA_DELETE_STA_RSP:
1618 lim_process_mlm_del_sta_rsp(mac_ctx, msg);
1619 break;
1620 case WMA_DELETE_BSS_RSP:
1621 lim_handle_delete_bss_rsp(mac_ctx, msg);
1622 break;
1623 case WMA_CSA_OFFLOAD_EVENT:
1624 lim_handle_csa_offload_msg(mac_ctx, msg);
1625 break;
1626 case WMA_SET_BSSKEY_RSP:
1627 case WMA_SET_STA_BCASTKEY_RSP:
1628 lim_process_mlm_set_bss_key_rsp(mac_ctx, msg);
1629 break;
1630 case WMA_SET_STAKEY_RSP:
1631 lim_process_mlm_set_sta_key_rsp(mac_ctx, msg);
1632 break;
1633 case WMA_GET_STATISTICS_RSP:
1634 lim_send_sme_pe_statistics_rsp(mac_ctx, msg->type,
1635 (void *)msg->bodyptr);
1636 break;
1637 case WMA_SET_MIMOPS_RSP:
1638 case WMA_SET_TX_POWER_RSP:
1639 cdf_mem_free((void *)msg->bodyptr);
1640 msg->bodyptr = NULL;
1641 break;
1642 case WMA_SET_MAX_TX_POWER_RSP:
1643#if defined WLAN_FEATURE_VOWIFI
1644 rrm_set_max_tx_power_rsp(mac_ctx, msg);
1645#endif
1646 if (msg->bodyptr != NULL) {
1647 cdf_mem_free((void *)msg->bodyptr);
1648 msg->bodyptr = NULL;
1649 }
1650 break;
1651 case SIR_LIM_ADDR2_MISS_IND:
1652 lim_log(mac_ctx, LOGE,
1653 FL("Addr2 mismatch interrupt received %X"), msg->type);
1654 /* message from HAL indicating addr2 mismatch interrupt occurred
1655 * msg->bodyptr contains only pointer to 48-bit addr2 field
1656 */
1657 cdf_mem_free((void *)(msg->bodyptr));
1658 msg->bodyptr = NULL;
1659 break;
1660#ifdef WLAN_FEATURE_VOWIFI_11R
1661 case WMA_AGGR_QOS_RSP:
1662 lim_process_ft_aggr_qo_s_rsp(mac_ctx, msg);
1663 break;
1664#endif
1665 case WMA_SET_LINK_STATE_RSP:
1666 link_state_param = (tLinkStateParams *) msg->bodyptr;
1667#if defined WLAN_FEATURE_VOWIFI_11R
1668 session_entry = link_state_param->session;
1669 if (link_state_param->ft
1670#if defined WLAN_FEATURE_ROAM_OFFLOAD
1671 && !session_entry->bRoamSynchInProgress
1672#endif
1673 )
1674 lim_send_reassoc_req_with_ft_ies_mgmt_frame(mac_ctx,
1675 session_entry->pLimMlmReassocReq,
1676 session_entry);
1677#endif
1678 if (link_state_param->callback)
1679 link_state_param->callback(mac_ctx,
1680 link_state_param->callbackArg,
1681 link_state_param->status);
1682 cdf_mem_free((void *)(msg->bodyptr));
1683 msg->bodyptr = NULL;
1684 break;
1685 case eWNI_SME_SET_BCN_FILTER_REQ:
1686 session_id = (uint8_t) msg->bodyval;
1687 session_entry = &mac_ctx->lim.gpSession[session_id];
1688 if ((session_entry != NULL) &&
1689 (lim_send_beacon_filter_info(mac_ctx, session_entry) !=
1690 eSIR_SUCCESS))
1691 lim_log(mac_ctx, LOGE,
1692 FL("Failied to send Beacon Filter Info "));
1693 cdf_mem_free((void *)(msg->bodyptr));
1694 msg->bodyptr = NULL;
1695 break;
1696#ifdef FEATURE_WLAN_TDLS
1697 case WMA_SET_TDLS_LINK_ESTABLISH_REQ_RSP:
1698 tdls_link_params = (tTdlsLinkEstablishParams *) msg->bodyptr;
1699 session_entry = pe_find_session_by_sta_id(mac_ctx,
1700 tdls_link_params->staIdx, &session_id);
1701 if (session_entry == NULL) {
1702 lim_log(mac_ctx, LOGE,
1703 FL("session %u does not exist"), session_id);
1704 /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP
1705 * message to SME with session id as zero and status
1706 * as FAILURE so, that message queued in SME queue
1707 * can be freed to prevent the SME cmd buffer leak
1708 */
1709 lim_send_sme_tdls_link_establish_req_rsp(mac_ctx, 0,
1710 NULL, NULL, eSIR_FAILURE);
1711 } else {
1712 lim_send_sme_tdls_link_establish_req_rsp(mac_ctx,
1713 session_entry->smeSessionId, NULL, NULL,
1714 tdls_link_params->status);
1715 }
1716 cdf_mem_free((void *)(msg->bodyptr));
1717 msg->bodyptr = NULL;
1718 break;
1719#endif
1720 case WMA_RX_SCAN_EVENT:
1721 lim_process_rx_scan_event(mac_ctx, msg->bodyptr);
1722 break;
1723 case WMA_IBSS_PEER_INACTIVITY_IND:
1724 lim_process_ibss_peer_inactivity(mac_ctx, msg->bodyptr);
1725 cdf_mem_free((void *)(msg->bodyptr));
1726 msg->bodyptr = NULL;
1727 break;
1728 case WMA_DFS_RADAR_IND:
1729 lim_send_sme_dfs_event_notify(mac_ctx, msg->type,
1730 (void *)msg->bodyptr);
1731 /* msg->bodyptr will be freed up by SME/CSR */
1732 break;
1733 case WMA_DFS_BEACON_TX_SUCCESS_IND:
1734 lim_process_beacon_tx_success_ind(mac_ctx, msg->type,
1735 (void *)msg->bodyptr);
1736 cdf_mem_free((void *)msg->bodyptr);
1737 msg->bodyptr = NULL;
1738 break;
1739 case WMA_DISASSOC_TX_COMP:
1740 lim_disassoc_tx_complete_cnf(mac_ctx, msg->bodyval);
1741 break;
1742 case WMA_DEAUTH_TX_COMP:
1743 lim_deauth_tx_complete_cnf(mac_ctx, msg->bodyval);
1744 break;
1745#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
1746 case WMA_UPDATE_Q2Q_IE_IND:
1747 cdf_mem_zero(&beacon_params, sizeof(tUpdateBeaconParams));
1748 beacon_params.paramChangeBitmap = 0;
1749 for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
1750 vdev_id = ((uint8_t *)msg->bodyptr)[i];
1751 session_entry = pe_find_session_by_sme_session_id(
1752 mac_ctx, vdev_id);
1753 if (session_entry == NULL)
1754 continue;
1755 session_entry->sap_advertise_avoid_ch_ie =
1756 (uint8_t)msg->bodyval;
1757 /*
1758 * if message comes for DFS channel, no need to update:
1759 * 1) We wont have MCC with DFS channels. so no need to
1760 * add Q2Q IE
1761 * 2) We cannot end up in DFS channel SCC by channel
1762 * switch from non DFS MCC scenario, so no need to
1763 * remove Q2Q IE
1764 * 3) There is however a case where device start MCC and
1765 * then user modifies hostapd.conf and does SAP
1766 * restart, in such a case, beacon params will be
1767 * reset and thus will not contain Q2Q IE, by default
1768 */
1769 if (cds_get_channel_state(
1770 session_entry->currentOperChannel)
1771 != CHANNEL_STATE_DFS) {
1772 beacon_params.bssIdx = session_entry->bssIdx;
1773 beacon_params.beaconInterval =
1774 session_entry->beaconParams.beaconInterval;
1775 beacon_params.paramChangeBitmap |=
1776 PARAM_BCN_INTERVAL_CHANGED;
1777 sch_set_fixed_beacon_fields(mac_ctx,
1778 session_entry);
1779 lim_send_beacon_params(mac_ctx, &beacon_params,
1780 session_entry);
1781 }
1782 }
1783 cdf_mem_free(msg->bodyptr);
1784 msg->bodyptr = NULL;
1785 break;
1786#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
1787 case eWNI_SME_NSS_UPDATE_REQ:
1788 case eWNI_SME_DFS_BEACON_CHAN_SW_IE_REQ:
1789 lim_process_sme_req_messages(mac_ctx, msg);
1790 cdf_mem_free((void *)msg->bodyptr);
1791 msg->bodyptr = NULL;
1792 break;
1793 case eWNI_SME_CHANNEL_CHANGE_REQ:
1794 lim_process_sme_req_messages(mac_ctx, msg);
1795 cdf_mem_free((void *)msg->bodyptr);
1796 msg->bodyptr = NULL;
1797 break;
1798 case eWNI_SME_START_BEACON_REQ:
1799 lim_process_sme_req_messages(mac_ctx, msg);
1800 cdf_mem_free((void *)msg->bodyptr);
1801 msg->bodyptr = NULL;
1802 break;
1803 case eWNI_SME_UPDATE_ADDITIONAL_IES:
1804 lim_process_sme_req_messages(mac_ctx, msg);
1805 cdf_mem_free((void *)msg->bodyptr);
1806 msg->bodyptr = NULL;
1807 break;
1808 case eWNI_SME_MODIFY_ADDITIONAL_IES:
1809 lim_process_sme_req_messages(mac_ctx, msg);
1810 cdf_mem_free((void *)msg->bodyptr);
1811 msg->bodyptr = NULL;
1812 break;
1813#ifdef QCA_HT_2040_COEX
1814 case eWNI_SME_SET_HT_2040_MODE:
1815 lim_process_sme_req_messages(mac_ctx, msg);
1816 cdf_mem_free((void *)msg->bodyptr);
1817 msg->bodyptr = NULL;
1818 break;
1819#endif
1820 case SIR_HAL_SOC_SET_HW_MODE_RESP:
1821 lim_process_set_hw_mode_resp(mac_ctx, msg->bodyptr);
1822 cdf_mem_free((void *)msg->bodyptr);
1823 msg->bodyptr = NULL;
1824 break;
1825 case SIR_HAL_SOC_HW_MODE_TRANS_IND:
1826 lim_process_hw_mode_trans_ind(mac_ctx, msg->bodyptr);
1827 cdf_mem_free((void *)msg->bodyptr);
1828 msg->bodyptr = NULL;
1829 break;
1830 case SIR_HAL_SOC_DUAL_MAC_CFG_RESP:
1831 lim_process_dual_mac_cfg_resp(mac_ctx, msg->bodyptr);
1832 cdf_mem_free((void *)msg->bodyptr);
1833 msg->bodyptr = NULL;
1834 break;
1835 case eWNI_SME_SET_IE_REQ:
1836 lim_process_sme_req_messages(mac_ctx, msg);
1837 cdf_mem_free((void *)msg->bodyptr);
1838 msg->bodyptr = NULL;
1839 break;
1840 default:
1841 cdf_mem_free((void *)msg->bodyptr);
1842 msg->bodyptr = NULL;
1843 /* Unwanted messages */
1844 /* Log error */
1845 lim_log(mac_ctx, LOGE,
1846 FL("Discarding unexpected message received %X"),
1847 msg->type);
1848 lim_print_msg_name(mac_ctx, LOGE, msg->type);
1849 break;
1850
1851 } /* switch (msg->type) */
1852} /*** end lim_process_messages() ***/
1853
1854/**
1855 * lim_process_deferred_message_queue
1856 *
1857 ***FUNCTION:
1858 * This function is called by LIM while exiting from Learn
1859 * mode. This function fetches messages posted to the LIM
1860 * deferred message queue limDeferredMsgQ.
1861 *
1862 ***LOGIC:
1863 *
1864 ***ASSUMPTIONS:
1865 * NA
1866 *
1867 ***NOTE:
1868 * NA
1869 *
1870 * @param pMac - Pointer to Global MAC structure
1871 * @return None
1872 */
1873
1874void lim_process_deferred_message_queue(tpAniSirGlobal pMac)
1875{
1876 tSirMsgQ limMsg = { 0, 0, 0 };
1877
1878 tSirMsgQ *readMsg;
1879 uint16_t size;
1880
1881 /*
1882 ** check any deferred messages need to be processed
1883 **/
1884 size = pMac->lim.gLimDeferredMsgQ.size;
1885 if (size > 0) {
1886 while ((readMsg = lim_read_deferred_msg_q(pMac)) != NULL) {
1887 cdf_mem_copy((uint8_t *) &limMsg,
1888 (uint8_t *) readMsg, sizeof(tSirMsgQ));
1889 size--;
1890 lim_process_messages(pMac, &limMsg);
1891
1892 if ((lim_is_system_in_scan_state(pMac))
1893 || (true != GET_LIM_PROCESS_DEFD_MESGS(pMac))
Hema Aparna Medicharla5e1f3022015-08-24 11:22:29 +05301894 || (pMac->lim.gLimSystemInScanLearnMode)
1895 || pMac->lim.gLimAddtsSent)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001896 break;
1897 }
1898 }
1899} /*** end lim_process_deferred_message_queue() ***/
1900
1901/**
1902 * lim_process_normal_hdd_msg() - Process the message and defer if needed
1903 * @mac_ctx : Pointer to Global MAC structure
1904 * @msg : The message need to be processed
1905 * @rsp_reqd: whether return result to hdd
1906 *
1907 * This function checks the current lim state and decide whether the message
1908 * passed will be deferred or not.
1909 *
1910 * Return: None
1911 */
1912static void lim_process_normal_hdd_msg(tpAniSirGlobal mac_ctx, tSirMsgQ *msg,
1913 uint8_t rsp_reqd)
1914{
1915 bool defer_msg = true;
1916
1917 /* Added For BT-AMP Support */
1918 if ((mac_ctx->lim.gLimSystemRole == eLIM_AP_ROLE)
1919 || (mac_ctx->lim.gLimSystemRole == eLIM_BT_AMP_AP_ROLE)
1920 || (mac_ctx->lim.gLimSystemRole == eLIM_BT_AMP_STA_ROLE)
1921 || (mac_ctx->lim.gLimSystemRole == eLIM_UNKNOWN_ROLE)) {
1922 /*
1923 * This check is required only for the AP and in 2 cases.
1924 * 1. If we are in learn mode and we receive any of these
1925 * messages, you have to come out of scan and process the
1926 * message, hence dont defer the message here. In handler,
1927 * these message could be defered till we actually come out of
1928 * scan mode.
1929 * 2. If radar is detected, you might have to defer all of
1930 * these messages except Stop BSS request/ Switch channel
1931 * request. This decision is also made inside its handler.
1932 *
1933 * Please be careful while using the flag defer_msg. Possibly
1934 * you might end up in an infinite loop.
1935 */
1936 if ((msg->type == eWNI_SME_START_BSS_REQ) ||
1937 (msg->type == eWNI_SME_STOP_BSS_REQ) ||
1938 (msg->type == eWNI_SME_SWITCH_CHL_IND))
1939 defer_msg = false;
1940 }
1941
1942 if (((mac_ctx->lim.gLimAddtsSent) ||
1943 (lim_is_system_in_scan_state(mac_ctx))) && defer_msg) {
1944 /*
1945 * System is in DFS (Learn) mode or awaiting addts response or
1946 * if radar is detected, Defer processsing this message
1947 */
1948 if (lim_defer_msg(mac_ctx, msg) != TX_SUCCESS) {
1949#ifdef WLAN_DEBUG
1950 mac_ctx->lim.numSme++;
1951#endif
1952 lim_log_session_states(mac_ctx);
1953 /* Release body */
1954 cdf_mem_free(msg->bodyptr);
1955 msg->bodyptr = NULL;
1956 }
1957 } else {
1958 /*
1959 * These messages are from HDD.Since these requests may also be
1960 * generated internally within LIM module, need to distinquish
1961 * and send response to host
1962 */
1963 if (rsp_reqd)
1964 mac_ctx->lim.gLimRspReqd = true;
1965#ifdef WLAN_DEBUG
1966 mac_ctx->lim.numSme++;
1967#endif
1968 if (lim_process_sme_req_messages(mac_ctx, msg)) {
1969 /*
1970 * Release body. limProcessSmeReqMessage consumed the
1971 * buffer. We can free it.
1972 */
1973 cdf_mem_free(msg->bodyptr);
1974 msg->bodyptr = NULL;
1975 }
1976 }
1977}
1978
1979void
1980handle_ht_capabilityand_ht_info(struct sAniSirGlobal *pMac,
1981 tpPESession psessionEntry)
1982{
1983 tSirMacHTCapabilityInfo macHTCapabilityInfo;
1984 tSirMacHTParametersInfo macHTParametersInfo;
1985 tSirMacHTInfoField1 macHTInfoField1;
1986 tSirMacHTInfoField2 macHTInfoField2;
1987 tSirMacHTInfoField3 macHTInfoField3;
1988 uint32_t cfgValue;
1989 uint8_t *ptr;
1990
1991 if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &cfgValue) !=
1992 eSIR_SUCCESS) {
1993 lim_log(pMac, LOGP,
1994 FL("Fail to retrieve WNI_CFG_HT_CAP_INFO value"));
1995 return;
1996 }
1997 ptr = (uint8_t *) &macHTCapabilityInfo;
1998 *((uint16_t *) ptr) = (uint16_t) (cfgValue & 0xffff);
1999 pMac->lim.gHTLsigTXOPProtection =
2000 (uint8_t) macHTCapabilityInfo.lsigTXOPProtection;
2001 pMac->lim.gHTMIMOPSState =
2002 (tSirMacHTMIMOPowerSaveState) macHTCapabilityInfo.mimoPowerSave;
2003 pMac->lim.gHTGreenfield = (uint8_t) macHTCapabilityInfo.greenField;
2004 pMac->lim.gHTMaxAmsduLength =
2005 (uint8_t) macHTCapabilityInfo.maximalAMSDUsize;
2006 pMac->lim.gHTShortGI20Mhz = (uint8_t) macHTCapabilityInfo.shortGI20MHz;
2007 pMac->lim.gHTShortGI40Mhz = (uint8_t) macHTCapabilityInfo.shortGI40MHz;
2008 pMac->lim.gHTPSMPSupport = (uint8_t) macHTCapabilityInfo.psmp;
2009 pMac->lim.gHTDsssCckRate40MHzSupport =
2010 (uint8_t) macHTCapabilityInfo.dsssCckMode40MHz;
2011
2012 if (wlan_cfg_get_int(pMac, WNI_CFG_HT_AMPDU_PARAMS, &cfgValue) !=
2013 eSIR_SUCCESS) {
2014 lim_log(pMac, LOGP,
2015 FL("Fail to retrieve WNI_CFG_HT_PARAM_INFO value"));
2016 return;
2017 }
2018 ptr = (uint8_t *) &macHTParametersInfo;
2019 *ptr = (uint8_t) (cfgValue & 0xff);
2020 pMac->lim.gHTAMpduDensity = (uint8_t) macHTParametersInfo.mpduDensity;
2021 pMac->lim.gHTMaxRxAMpduFactor =
2022 (uint8_t) macHTParametersInfo.maxRxAMPDUFactor;
2023
2024 /* Get HT IE Info */
2025 if (wlan_cfg_get_int(pMac, WNI_CFG_HT_INFO_FIELD1, &cfgValue) !=
2026 eSIR_SUCCESS) {
2027 lim_log(pMac, LOGP,
2028 FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD1 value"));
2029 return;
2030 }
2031 ptr = (uint8_t *) &macHTInfoField1;
2032 *((uint8_t *) ptr) = (uint8_t) (cfgValue & 0xff);
2033 pMac->lim.gHTServiceIntervalGranularity =
2034 (uint8_t) macHTInfoField1.serviceIntervalGranularity;
2035 pMac->lim.gHTControlledAccessOnly =
2036 (uint8_t) macHTInfoField1.controlledAccessOnly;
2037 pMac->lim.gHTRifsMode = (uint8_t) macHTInfoField1.rifsMode;
2038
2039 if (wlan_cfg_get_int(pMac, WNI_CFG_HT_INFO_FIELD2, &cfgValue) !=
2040 eSIR_SUCCESS) {
2041 lim_log(pMac, LOGP,
2042 FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD2 value"));
2043 return;
2044 }
2045 ptr = (uint8_t *) &macHTInfoField2;
2046 *((uint16_t *) ptr) = (uint16_t) (cfgValue & 0xffff);
2047 pMac->lim.gHTOperMode = (tSirMacHTOperatingMode) macHTInfoField2.opMode;
2048
2049 if (wlan_cfg_get_int(pMac, WNI_CFG_HT_INFO_FIELD3, &cfgValue) !=
2050 eSIR_SUCCESS) {
2051 lim_log(pMac, LOGP,
2052 FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD3 value"));
2053 return;
2054 }
2055 ptr = (uint8_t *) &macHTInfoField3;
2056 *((uint16_t *) ptr) = (uint16_t) (cfgValue & 0xffff);
2057 pMac->lim.gHTPCOActive = (uint8_t) macHTInfoField3.pcoActive;
2058 pMac->lim.gHTPCOPhase = (uint8_t) macHTInfoField3.pcoPhase;
2059 pMac->lim.gHTSecondaryBeacon =
2060 (uint8_t) macHTInfoField3.secondaryBeacon;
2061 pMac->lim.gHTDualCTSProtection =
2062 (uint8_t) macHTInfoField3.dualCTSProtection;
2063 pMac->lim.gHTSTBCBasicMCS = (uint8_t) macHTInfoField3.basicSTBCMCS;
2064
2065 /* The lim globals for channelwidth and secondary chnl have been removed and should not be used during no session;
2066 * instead direct cfg is read and used when no session for transmission of mgmt frames (same as old);
2067 * For now, we might come here during init and join with sessionEntry = NULL; in that case just fill the globals which exist
2068 * Sessionized entries values will be filled in join or add bss req. The ones which are missed in join are filled below
2069 */
2070 if (psessionEntry != NULL) {
2071 psessionEntry->htCapability =
2072 IS_DOT11_MODE_HT(psessionEntry->dot11mode);
2073 psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport =
2074 (uint8_t) macHTInfoField3.lsigTXOPProtectionFullSupport;
2075 }
2076}
2077
2078void lim_log_session_states(tpAniSirGlobal mac_ctx)
2079{
2080#ifdef WLAN_DEBUG
2081 int i;
2082
2083 for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
2084 if (mac_ctx->lim.gpSession[i].valid) {
2085 CDF_TRACE(CDF_MODULE_ID_PE, LOG1,
2086 FL("sysRole(%d) Session (%d)"),
2087 mac_ctx->lim.gLimSystemRole, i);
2088 CDF_TRACE(CDF_MODULE_ID_PE, LOG1,
2089 FL("SME: Curr %s,Prev %s,MLM: Curr %s,Prev %s"),
2090 lim_sme_state_str(
2091 mac_ctx->lim.gpSession[i].limSmeState),
2092 lim_sme_state_str(
2093 mac_ctx->lim.gpSession[i].limPrevSmeState),
2094 lim_mlm_state_str(
2095 mac_ctx->lim.gpSession[i].limMlmState),
2096 lim_mlm_state_str(
2097 mac_ctx->lim.gpSession[i].limPrevMlmState));
2098 }
2099 }
2100#endif
2101}