blob: b8839db691a19109eb537dbe84414b8265850d48 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Satyanarayana Dash6f438272015-03-03 18:01:06 +05302 * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
Kiet Lam842dad02014-02-18 18:44:02 -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/*
Kiet Lama7f454d2014-07-24 12:04:06 -070023 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
Kiet Lamaa8e15a2014-02-11 23:30:06 -080026 */
Kiet Lam842dad02014-02-18 18:44:02 -080027
28
Kiet Lama7f454d2014-07-24 12:04:06 -070029
30
Jeff Johnson295189b2012-06-20 16:38:30 -070031/*
Jeff Johnson295189b2012-06-20 16:38:30 -070032 * This file lim ProcessMessageQueue.cc contains the code
33 * for processing LIM message Queue.
34 * Author: Chandra Modumudi
35 * Date: 02/11/02
36 * History:-
37 * Date Modified by Modification Information
38 * --------------------------------------------------------------------
39 *
40 */
41#include "palTypes.h"
42#include "wniApi.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070043#include "wlan_qct_wdi_ds.h"
44#include "wlan_qct_pal_packet.h"
45#include "wlan_qct_wda.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070046
Satyanarayana Dash6f438272015-03-03 18:01:06 +053047#include "wniCfg.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070048#include "cfgApi.h"
49#include "sirCommon.h"
50#include "utilsApi.h"
51#include "limTypes.h"
52#include "limUtils.h"
53#include "limAssocUtils.h"
54#include "limPropExtsUtils.h"
55
56#include "limAdmitControl.h"
57#include "pmmApi.h"
58#include "limIbssPeerMgmt.h"
59#include "schApi.h"
60#include "limSession.h"
Yathish9f22e662012-12-10 14:21:35 -080061#include "limSendMessages.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070062
63#if defined WLAN_FEATURE_VOWIFI
64#include "rrmApi.h"
65#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -080066#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
67#include "eseApi.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070068#endif
69
70#if defined WLAN_FEATURE_VOWIFI_11R
71#include "limFT.h"
72#endif
73
74#ifdef WMM_APSD
75#include "wmmApsd.h"
76#endif
77
Jeff Johnson295189b2012-06-20 16:38:30 -070078#include "vos_types.h"
79#include "vos_packet.h"
80#include "vos_memory.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070081
Katya Nigam3802f202013-12-16 19:27:14 +053082/* This value corresponds to 500 ms */
83#define MAX_PROBEREQ_TIME 5000
84
Dino Mycle7a76e662014-06-10 11:36:34 +053085#ifdef WLAN_FEATURE_EXTSCAN
86#define SIZE_OF_FIXED_PARAM 12
87#endif
88
Jeff Johnson295189b2012-06-20 16:38:30 -070089void limLogSessionStates(tpAniSirGlobal pMac);
90
91/** -------------------------------------------------------------
92\fn defMsgDecision
93\brief The function decides whether to defer a message or not in limProcessMessage function
94\param tpAniSirGlobal pMac
95\param tSirMsgQ limMsg
96\param tSirMacTspecIE *ppInfo
97\return none
98 -------------------------------------------------------------*/
99
100tANI_U8 static
101defMsgDecision(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
102{
103
104
105/* this function should not changed */
Jeff Johnsone7245742012-09-05 17:12:55 -0700106 if(pMac->lim.gLimSmeState == eLIM_SME_OFFLINE_STATE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700107 {
108 // Defer processsing this message
109 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
110 {
Madan Mohan Koyyalamudi5695b502012-09-24 14:21:12 -0700111 PELOGW(limLog(pMac, LOGW, FL("Unable to Defer message(0x%X) %s limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700112 limMsg->type, limMsgStr(limMsg->type), pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
113 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
114 limLogSessionStates(pMac);
115 limHandleDeferMsgError(pMac, limMsg);
116 }
117 return true;
118 }
119
120 //When defer is requested then defer all the messages except HAL responses.
121 if((!limIsSystemInScanState(pMac)) && (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) &&
122 !pMac->lim.gLimSystemInScanLearnMode)
123 {
124 if((limMsg->type != WDA_ADD_BSS_RSP) &&
125 (limMsg->type != WDA_DELETE_BSS_RSP) &&
126 (limMsg->type != WDA_ADD_STA_RSP) &&
127 (limMsg->type != WDA_ADD_STA_SELF_RSP) &&
128 (limMsg->type != WDA_DEL_STA_SELF_RSP) &&
129 (limMsg->type != WDA_DELETE_STA_RSP)&&
130 (limMsg->type != WDA_SET_BSSKEY_RSP)&&
131 (limMsg->type != WDA_SET_STAKEY_RSP)&&
132 (limMsg->type != WDA_SET_STA_BCASTKEY_RSP) &&
Jeff Johnson295189b2012-06-20 16:38:30 -0700133 (limMsg->type != eWNI_SME_START_REQ) &&
134 (limMsg->type != WDA_AGGR_QOS_RSP) &&
135 (limMsg->type != WDA_REMOVE_BSSKEY_RSP) &&
136 (limMsg->type != WDA_REMOVE_STAKEY_RSP) &&
137 (limMsg->type != WDA_SET_MIMOPS_RSP)&&
138 (limMsg->type != WDA_ADDBA_RSP) &&
139 (limMsg->type != WDA_ENTER_BMPS_RSP) &&
140 (limMsg->type != WDA_EXIT_BMPS_RSP) &&
141 (limMsg->type != WDA_ENTER_IMPS_RSP) &&
142 (limMsg->type != WDA_EXIT_IMPS_RSP) &&
143 (limMsg->type != WDA_ENTER_UAPSD_RSP) &&
144 (limMsg->type != WDA_EXIT_UAPSD_RSP) &&
145 (limMsg->type != WDA_WOWL_ENTER_RSP) &&
146 (limMsg->type != WDA_WOWL_EXIT_RSP) &&
147 (limMsg->type != WDA_SWITCH_CHANNEL_RSP) &&
Jeff Johnson295189b2012-06-20 16:38:30 -0700148 (limMsg->type != WDA_P2P_NOA_ATTR_IND) &&
Viral Modid440e682013-03-06 02:25:31 -0800149 (limMsg->type != WDA_P2P_NOA_START_IND) &&
Jeff Johnsone7245742012-09-05 17:12:55 -0700150#ifdef FEATURE_OEM_DATA_SUPPORT
151 (limMsg->type != WDA_START_OEM_DATA_RSP) &&
152#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700153 (limMsg->type != WDA_ADD_TS_RSP))
154 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700155 PELOG1(limLog(pMac, LOG1, FL("Defer the current message %s , gLimProcessDefdMsgs is false and system is not in scan/learn mode"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700156 limMsgStr(limMsg->type));)
157
158 // Defer processsing this message
159 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
160 {
Madan Mohan Koyyalamudi5695b502012-09-24 14:21:12 -0700161 PELOGW(limLog(pMac, LOGW, FL("Unable to Defer message(0x%X) %s limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700162 limMsg->type, limMsgStr(limMsg->type), pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
163 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
164 limLogSessionStates(pMac);
165 limHandleDeferMsgError(pMac, limMsg);
166
167 }
168 return true;
169 }
170 }
171 return false;
172}
173
174/*
175* Beacon Handling Cases:
176* during scanning, when no session is active:
177* handled by limHandleFramesInScanState before __limHandleBeacon call is invoked.
178* during scanning, when any session is active, but beacon/Pr does not belong to that session, psessionEntry will be null.
179* handled by limHandleFramesInScanState before __limHandleBeacon call is invoked.
180* during scanning, when any session is active, and beacon/Pr belongs to one of the session, psessionEntry will not be null.
181* handled by limHandleFramesInScanState before __limHandleBeacon call is invoked.
182* Not scanning, no session:
183* there should not be any beacon coming, if coming, should be dropped.
184* Not Scanning,
185*/
186static void
187__limHandleBeacon(tpAniSirGlobal pMac, tpSirMsgQ pMsg, tpPESession psessionEntry)
188{
189 /* checking for global SME state...*/
190 tANI_U8 *pRxPacketInfo;
191 limGetBDfromRxPacket(pMac, pMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo);
192
193 //This function should not be called if beacon is received in scan state.
194 //So not doing any checks for the global state.
195
196 if(psessionEntry == NULL)
197 {
198 schBeaconProcess(pMac, pRxPacketInfo, NULL);
199 }
200 else if( (psessionEntry->limSmeState == eLIM_SME_LINK_EST_STATE) ||
201 (psessionEntry->limSmeState == eLIM_SME_NORMAL_STATE))
202 {
203 schBeaconProcess(pMac, pRxPacketInfo, psessionEntry);
204 }
205 else
206 limProcessBeaconFrame(pMac, pRxPacketInfo, psessionEntry);
207
208 return;
209}
210
211
212//Fucntion prototype
213void limProcessNormalHddMsg(tpAniSirGlobal pMac, tSirMsgQ *pLimMsg, tANI_U8 fRspReqd);
214
215/**
Jeff Johnson295189b2012-06-20 16:38:30 -0700216 * limDeferMsg()
217 *
218 *FUNCTION:
219 * This function is called to defer the messages received
220 * during Learn mode
221 *
222 *LOGIC:
223 * NA
224 *
225 *ASSUMPTIONS:
226 * NA
227 *
228 *NOTE:
229 * NA
230 *
231 * @param pMac - Pointer to Global MAC structure
232 * @param pMsg of type tSirMsgQ - Pointer to the message structure
233 * @return None
234 */
235
236tANI_U32
237limDeferMsg(tpAniSirGlobal pMac, tSirMsgQ *pMsg)
238{
239 tANI_U32 retCode = TX_SUCCESS;
Jeff Johnson77165482013-03-07 08:15:44 -0800240
241 retCode = limWriteDeferredMsgQ(pMac, pMsg);
242
Jeff Johnson295189b2012-06-20 16:38:30 -0700243 if (retCode == TX_SUCCESS)
Jeff Johnson77165482013-03-07 08:15:44 -0800244 {
Rashmi Ramanna6c13a342014-01-07 11:44:07 +0530245 limLog(pMac, LOG1,
246 FL("Deferred message(0x%X) limSmeState %d (prev sme state %d)"
247 " sysRole %d mlm state %d (prev mlm state %d)"),
248 pMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
249 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState,
250 pMac->lim.gLimPrevMlmState);
Jeff Johnson77165482013-03-07 08:15:44 -0800251 MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DEFERRED));)
252 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700253 else
Jeff Johnson77165482013-03-07 08:15:44 -0800254 {
Agarwal Ashishe865f332014-04-08 13:20:06 +0530255 limLog(pMac, LOG1, FL("Dropped lim message (0x%X)"), pMsg->type);
Jeff Johnson77165482013-03-07 08:15:44 -0800256 MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DROPPED));)
257 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700258
259 return retCode;
260} /*** end limDeferMsg() ***/
261
262
263
264/**
265 * limHandleFramesInScanState()
266 *
267 *FUNCTION:
268 * This function is called to process 802.11 frames
269 * received by LIM in scan state.
270 *
271 *LOGIC:
272 * NA
273 *
274 *ASSUMPTIONS:
275 * NA
276 *
277 *NOTE:
278 * NA
279 *
280 * @param pMac - Pointer to Global MAC structure
281 * @param limMsg - Received message
282 * @param pRxPacketInfo - Pointer to Rx packet info structure
283 * @param deferMsg - Indicates whether the frame shall be deferred
284 * @return None
285 */
286
287static void
288limHandleFramesInScanState(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pRxPacketInfo, tANI_U8 *deferMsg, tpPESession psessionEntry)
289{
290 tSirMacFrameCtl fc;
291 tpSirMacMgmtHdr pHdr;
Jeff Johnson295189b2012-06-20 16:38:30 -0700292
293 *deferMsg = false;
294 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
295 fc = pHdr->fc;
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700296 limLog( pMac, LOG2, FL("ProtVersion %d, Type %d, Subtype %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700297 fc.protVer, fc.type, fc.subType );
298
Jeff Johnson295189b2012-06-20 16:38:30 -0700299 // defer all message in scan state except for Beacons and Probe Response
300 if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_BEACON))
301 {
302 if (psessionEntry == NULL)
303 limProcessBeaconFrameNoSession(pMac, pRxPacketInfo);
304 else
305 limProcessBeaconFrame(pMac, pRxPacketInfo,psessionEntry);
306 }
307 else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_PROBE_RSP))
308 {
309 if (psessionEntry == NULL)
310 limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo);
311 else
312 limProcessProbeRspFrame(pMac, pRxPacketInfo,psessionEntry);
313 }
314 else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_PROBE_REQ))
315 {
316 limProcessProbeReqFrame_multiple_BSS(pMac, pRxPacketInfo, psessionEntry);
317 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700318 else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_ACTION))
319 {
320 limProcessActionFrameNoSession( pMac, pRxPacketInfo);
321 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700322 else
323 {
324 *deferMsg = true;
325 return;
326 }
327
Jeff Johnson295189b2012-06-20 16:38:30 -0700328 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr);
329 return;
330
331} /*** end limHandleFramesInScanState() ***/
332
333/** ------------------------------------------------------------
334\brief This function handles Unknown Unicast (A2 Index)
335\ packets.
336\param tpAniSirGlobal pMac Global Mac data structure
337\param void *pRxPacketInfo Pointer to Buffer Descriptor
338\return none
339\
340\ -------------------------------------------------------------- */
341static void limHandleUnknownA2IndexFrames(tpAniSirGlobal pMac, void *pRxPacketInfo,tpPESession psessionEntry)
342{
Jeff Johnson295189b2012-06-20 16:38:30 -0700343 /* addr2 mismatch interrupt occurred this means previous
344 disassociation was not successful
345 In Volans pRxPacketInfo only contains pointer 48-bit address2 field */
346 /*Send disassociation message again*/
347 //Dinesh need one more arguement.
348 //limSendDisassocMgmtFrame(pMac, eSIR_MAC_CLASS3_FRAME_FROM_NON_ASSOC_STA_REASON,(tANI_U8 *) pRxPacketInfo);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800349 //TODO: verify this
Jeff Johnson295189b2012-06-20 16:38:30 -0700350 //This could be a public action frame.
351 if( psessionEntry->limSystemRole == eLIM_P2P_DEVICE_ROLE )
352 limProcessActionFrameNoSession(pMac, (tANI_U8 *) pRxPacketInfo);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800353
354#ifdef FEATURE_WLAN_TDLS
355 {
356 tpSirMacDataHdr3a pMacHdr;
357 pMacHdr = WDA_GET_RX_MPDUHEADER3A(pRxPacketInfo);
358
359 if (limIsGroupAddr(pMacHdr->addr2))
360 {
Abhishek Singh525045c2014-12-15 17:18:45 +0530361 limLog(pMac, LOG1, FL("Ignoring A2 Invalid Packet received for MC/BC:"));
362 limPrintMacAddr(pMac, pMacHdr->addr2, LOG1);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800363
364 return;
365 }
366 /* TDLS_hklee: move down here to reject Addr2 == Group (first checking above)
367 and also checking if SystemRole == STA */
368 if (psessionEntry->limSystemRole == eLIM_STA_ROLE)
369 {
370 /* ADD handling of Public Action Frame */
371 LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, \
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700372 ("limHandleUnknownA2IndexFrames: type=0x%x, subtype=0x%x"),pMacHdr->fc.type, pMacHdr->fc.subType));
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800373 switch (pMacHdr->fc.type)
374 {
375 case SIR_MAC_MGMT_FRAME:
376 {
377 switch (pMacHdr->fc.subType)
378 {
379 case SIR_MAC_MGMT_ACTION:
380 {
381 limProcessActionFrame(pMac, pRxPacketInfo, psessionEntry) ;
382 break ;
383 }
384 default:
385 {
386 break ;
387 }
388 }
389 }
390 default:
391 {
392 break ;
393 }
394 }
395 }
396 }
397#endif
398
Jeff Johnson295189b2012-06-20 16:38:30 -0700399
400 return;
401}
402
Jeff Johnson295189b2012-06-20 16:38:30 -0700403/**
404 * limCheckMgmtRegisteredFrames()
405 *
406 *FUNCTION:
407 * This function is called to process to check if received frame match with
408 * any of the registered frame from HDD. If yes pass this frame to SME.
409 *
410 *LOGIC:
411 *
412 *ASSUMPTIONS:
413 *
414 *NOTE:
415 *
416 * @param pMac Pointer to Global MAC structure
417 * @param *pBd Pointer to the received Buffer Descriptor+payload
418 * @param *psessionEntry Pointer to session on which packet is received
419 * @return None
420 */
421static tANI_BOOLEAN
422limCheckMgmtRegisteredFrames(tpAniSirGlobal pMac, tANI_U8 *pBd,
423 tpPESession psessionEntry)
424{
425 tSirMacFrameCtl fc;
426 tpSirMacMgmtHdr pHdr;
427 tANI_U8 *pBody;
428 tpLimMgmtFrameRegistration pLimMgmtRegistration = NULL, pNext = NULL;
429 tANI_U16 frameType;
430 tANI_U16 framelen;
431 tANI_U8 type,subType;
432 tANI_BOOLEAN match = VOS_FALSE;
433 VOS_STATUS vosStatus;
434
435 pHdr = WDA_GET_RX_MAC_HEADER(pBd);
436 fc = pHdr->fc;
437 frameType = (fc.type << 2 ) | (fc.subType << 4);
438 pBody = WDA_GET_RX_MPDU_DATA(pBd);
439 framelen = WDA_GET_RX_PAYLOAD_LEN(pBd);
440
441 vos_list_peek_front(&pMac->lim.gLimMgmtFrameRegistratinQueue,
442 (vos_list_node_t**)&pLimMgmtRegistration);
443
444 while(pLimMgmtRegistration != NULL)
445 {
446 type = (pLimMgmtRegistration->frameType >> 2) & 0x03;
447 subType = (pLimMgmtRegistration->frameType >> 4) & 0x0f;
448 if ( (type == SIR_MAC_MGMT_FRAME) && (fc.type == SIR_MAC_MGMT_FRAME)
449 && (subType == SIR_MAC_MGMT_RESERVED15) )
450 {
451 limLog( pMac, LOG3,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700452 FL("rcvd frame match with SIR_MAC_MGMT_RESERVED15"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700453 match = VOS_TRUE;
454 break;
455 }
456
457 if (pLimMgmtRegistration->frameType == frameType)
458 {
459 if (pLimMgmtRegistration->matchLen > 0)
460 {
461 if (pLimMgmtRegistration->matchLen <= framelen)
462 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +0530463 if (vos_mem_compare(pLimMgmtRegistration->matchData,
Jeff Johnson295189b2012-06-20 16:38:30 -0700464 pBody, pLimMgmtRegistration->matchLen))
465 {
Madan Mohan Koyyalamudic537df22012-10-22 15:07:08 -0700466 /* found match! */
467 match = VOS_TRUE;
468 break;
Jeff Johnson295189b2012-06-20 16:38:30 -0700469 }
Madan Mohan Koyyalamudic537df22012-10-22 15:07:08 -0700470 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700471 }
472 else
473 {
474 /* found match! */
475 match = VOS_TRUE;
476 break;
477 }
478 }
479
480 vosStatus =
481 vos_list_peek_next ( &pMac->lim.gLimMgmtFrameRegistratinQueue,
482 (vos_list_node_t*) pLimMgmtRegistration,
483 (vos_list_node_t**) &pNext );
484 pLimMgmtRegistration = pNext;
485 pNext = NULL;
486 }
487
488 if (match)
489 {
490 limLog( pMac, LOG1,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700491 FL("rcvd frame match with registered frame params"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700492
493 /* Indicate this to SME */
Rashmi Ramanna0d0adec2014-02-05 20:35:37 +0530494 limSendSmeMgmtFrameInd( pMac, pLimMgmtRegistration->sessionId,
495 pBd, psessionEntry, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -0700496
497 if ( (type == SIR_MAC_MGMT_FRAME) && (fc.type == SIR_MAC_MGMT_FRAME)
498 && (subType == SIR_MAC_MGMT_RESERVED15) )
499 {
500 // These packets needs to be processed by PE/SME as well as HDD.
501 // If it returns TRUE here, the packet is forwarded to HDD only.
502 match = VOS_FALSE;
503 }
504 }
505
506 return match;
507} /*** end limCheckMgmtRegisteredFrames() ***/
Jeff Johnson295189b2012-06-20 16:38:30 -0700508
Dino Mycle7a76e662014-06-10 11:36:34 +0530509#ifdef WLAN_FEATURE_EXTSCAN
510
511void
512limProcessEXTScanRealTimeData(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo)
513{
514 tpSirMacMgmtHdr pHdr = NULL;
515 eHalStatus status;
516 void *pCallbackContext;
517 tANI_U8 rfBand = 0;
518 tANI_U8 rxChannelInBD = 0;
519 tSirMacFrameCtl fc;
520 tDot11fBeacon *pBeacon = NULL;
521 tDot11fProbeResponse *pProbeResponse = NULL;
522 tSirWifiFullScanResultEvent tEXTScanFullScanResult;
523
524 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
525 fc = pHdr->fc;
526
527 limLog(pMac, LOG2,
528 FL("Received EXTScan Real Time data with length=%d from "),
529 WDA_GET_RX_MPDU_LEN(pRxPacketInfo));
530
531 limPrintMacAddr(pMac, pHdr->sa, LOG2);
532
533 vos_mem_set((tANI_U8 *) &tEXTScanFullScanResult,
534 sizeof(tSirWifiFullScanResultEvent), 0);
535
Dino Mycle3f783bc2014-08-08 17:40:22 +0530536 tEXTScanFullScanResult.ap.ts = vos_get_monotonic_boottime();
Dino Mycle7a76e662014-06-10 11:36:34 +0530537
538 vos_mem_copy(&tEXTScanFullScanResult.ap.bssid,
539 pHdr->bssId, sizeof(tSirMacAddr));
540
Dino Myclee8843b32014-07-04 14:21:45 +0530541 limPrintMacAddr(pMac, pHdr->bssId, LOG2);
Dino Mycle7a76e662014-06-10 11:36:34 +0530542
543
544 rfBand = WDA_GET_RX_RFBAND(pRxPacketInfo);
545 rxChannelInBD = WDA_GET_RX_CH(pRxPacketInfo);
546
547 if ((!rfBand) || IS_5G_BAND(rfBand))
548 {
549 rxChannelInBD = limUnmapChannel(rxChannelInBD);
550 }
551
c_hpothu24b354c2014-09-24 18:59:33 +0530552 tEXTScanFullScanResult.ap.channel =
553 (tANI_U32)vos_chan_to_freq(rxChannelInBD);
Dino Mycle7a76e662014-06-10 11:36:34 +0530554 tEXTScanFullScanResult.ap.rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo);
555
556 if (fc.subType == SIR_MAC_MGMT_BEACON)
557 {
558 limLog( pMac, LOG2, FL("Beacon "));
559
560 pBeacon = vos_mem_malloc(sizeof(tDot11fBeacon));
561 if ( NULL == pBeacon ){
562 limLog(pMac, LOGE, FL("Failed to allocate memory\n") );
563 return;
564 }
565
566 vos_mem_set( ( tANI_U8* )pBeacon, sizeof(tDot11fBeacon), 0 );
567 // delegate to the framesc-generated code,
568 status = dot11fUnpackBeacon( pMac,
569 (tANI_U8 *)WDA_GET_RX_MPDU_DATA(pRxPacketInfo),
570 WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo), pBeacon );
571
572 if ( DOT11F_FAILED( status ) )
573 {
574 limLog(pMac, LOGE, FL("Failed to parse a Beacons"
575 "(%d):\n"), status);
576 vos_mem_free(pBeacon);
577 return;
578 }
579 if ( pBeacon->SSID.present )
580 {
581 vos_mem_copy(tEXTScanFullScanResult.ap.ssid,
582 pBeacon->SSID.ssid,
583 pBeacon->SSID.num_ssid);
584 }
585 //NULL Terminate the string.
586 tEXTScanFullScanResult.ap.ssid[pBeacon->SSID.num_ssid] = 0;
587 tEXTScanFullScanResult.ap.beaconPeriod =
588 pBeacon->BeaconInterval.interval;
589 tEXTScanFullScanResult.ap.capability =
590 *((tANI_U16 *)&pBeacon->Capabilities);
591 vos_mem_free(pBeacon);
592 }
593 else if (fc.subType == SIR_MAC_MGMT_PROBE_RSP)
594 {
595 limLog( pMac, LOG2, FL("Probe rsp "));
596
597 pProbeResponse = vos_mem_malloc(sizeof(tDot11fProbeResponse));
598 if ( NULL == pProbeResponse ){
599 limLog(pMac, LOGE, FL("Failed to allocate memory\n") );
600 return;
601 }
602
603 vos_mem_set( ( tANI_U8* )pProbeResponse,
604 sizeof(tDot11fProbeResponse), 0);
605 //delegate to the framesc-generated code,
606 status = dot11fUnpackProbeResponse( pMac,
607 (tANI_U8 *)WDA_GET_RX_MPDU_DATA(pRxPacketInfo),
608 WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo), pProbeResponse );
609
610 if ( DOT11F_FAILED( status ) )
611 {
612 limLog(pMac, LOGE, FL("Failed to parse a Probe"
613 "Response (%d:\n"), status);
614 vos_mem_free(pProbeResponse);
615 return;
616 }
617 if ( pProbeResponse->SSID.present )
618 {
619 vos_mem_copy(tEXTScanFullScanResult.ap.ssid,
620 pProbeResponse->SSID.ssid,
621 pProbeResponse->SSID.num_ssid);
622 }
623 //NULL Terminate the string.
624 tEXTScanFullScanResult.ap.ssid[pProbeResponse->SSID.num_ssid] = 0;
625 tEXTScanFullScanResult.ap.beaconPeriod =
626 pProbeResponse->BeaconInterval.interval;
627 tEXTScanFullScanResult.ap.capability =
628 *(((tANI_U16 *)&pProbeResponse->Capabilities));
629
630 vos_mem_free(pBeacon);
631 }
632 else
633 {
634 limLog( pMac, LOGE, FL("Wrong frame Type %d, Subtype %d for LFR"),
635 fc.type, fc.subType);
636 VOS_ASSERT(0);
637 return;
638 }
639
640 tEXTScanFullScanResult.requestId = pMac->sme.extScanStartReqId;
641 tEXTScanFullScanResult.ieLength =
642 WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo) - SIZE_OF_FIXED_PARAM;
643 tEXTScanFullScanResult.ie =(tSirInformationElement *)
644 ((tANI_U8 *)WDA_GET_RX_MPDU_DATA(pRxPacketInfo) + SIZE_OF_FIXED_PARAM);
645
646 pCallbackContext = pMac->sme.pEXTScanCallbackContext;
647 if(pMac->sme.pEXTScanIndCb)
648 {
649 pMac->sme.pEXTScanIndCb(pCallbackContext,
650 SIR_HAL_EXTSCAN_FULL_SCAN_RESULT_IND,
651 (tANI_U8 *)&tEXTScanFullScanResult);
652 }
653
654 return;
655} /*** end limProcessEXTScanRealTimeData() ***/
656#endif /* WLAN_FEATURE_EXTSCAN */
Jeff Johnson295189b2012-06-20 16:38:30 -0700657
658/**
659 * limHandle80211Frames()
660 *
661 *FUNCTION:
662 * This function is called to process 802.11 frames
663 * received by LIM.
664 *
665 *LOGIC:
666 * NA
667 *
668 *ASSUMPTIONS:
669 * NA
670 *
671 *NOTE:
672 * NA
673 *
674 * @param pMac - Pointer to Global MAC structure
675 * @param pMsg of type tSirMsgQ - Pointer to the message structure
676 * @return None
677 */
678
679static void
680limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg)
681{
682 tANI_U8 *pRxPacketInfo = NULL;
683 tSirMacFrameCtl fc;
684 tpSirMacMgmtHdr pHdr=NULL;
685 tpPESession psessionEntry=NULL;
686 tANI_U8 sessionId;
687 tAniBool isFrmFt = FALSE;
688 tANI_U16 fcOffset = WLANHAL_RX_BD_HEADER_SIZE;
689
690 *pDeferMsg= false;
691 limGetBDfromRxPacket(pMac, limMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo);
692
Dino Mycle7a76e662014-06-10 11:36:34 +0530693#ifdef WLAN_FEATURE_EXTSCAN
694
695 if ( WDA_GET_EXTSCANFULLSCANRESIND(pRxPacketInfo))
696 {
697 limLog( pMac, LOG2, FL("Notify EXTSCAN scan results to the HDD"));
698 limProcessEXTScanRealTimeData(pMac, pRxPacketInfo);
699 goto end;
700 }
701#endif //WLAN_FEATURE_EXTSCAN
702
Jeff Johnson295189b2012-06-20 16:38:30 -0700703 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
704 isFrmFt = WDA_GET_RX_FT_DONE(pRxPacketInfo);
705 fcOffset = (v_U8_t)WDA_GET_RX_MPDU_HEADER_OFFSET(pRxPacketInfo);
706 fc = pHdr->fc;
707
Madan Mohan Koyyalamudi99af06e2013-08-08 02:17:17 +0530708#ifdef WLAN_DUMP_MGMTFRAMES
709 limLog( pMac, LOGE, FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"),
710 fc.protVer, fc.type, fc.subType,
711 WDA_GET_RX_MAC_RATE_IDX(pRxPacketInfo));
712 VOS_TRACE_HEX_DUMP(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, pHdr,
713 WDA_GET_RX_MPDU_HEADER_LEN(pRxPacketInfo));
714#endif
715
Tushnim Bhattacharyyaed4d0c22014-01-30 11:56:44 -0800716 if ((fc.type == SIR_MAC_MGMT_FRAME) &&
Tushnim Bhattacharyyaed4d0c22014-01-30 11:56:44 -0800717 (fc.subType != SIR_MAC_MGMT_BEACON))
718 {
Sushant Kaushik60273d02014-06-13 15:31:37 +0530719 limLog(pMac, LOG1, FL("RX MGMT - Type %hu, SubType %hu, Seq.no %d"),
720 fc.type, fc.subType,
721 ((pHdr->seqControl.seqNumHi << 4) | (pHdr->seqControl.seqNumLo)));
Tushnim Bhattacharyyaed4d0c22014-01-30 11:56:44 -0800722 }
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700723#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
724 if ( WDA_GET_ROAMCANDIDATEIND(pRxPacketInfo))
725 {
726 limLog( pMac, LOG2, FL("Notify SME with candidate ind"));
727 //send a session 0 for now - TBD
728 limSendSmeCandidateFoundInd(pMac, 0);
729 goto end;
730 }
731 if (WDA_GET_OFFLOADSCANLEARN(pRxPacketInfo))
732 {
733 if (fc.subType == SIR_MAC_MGMT_BEACON)
734 {
735 limLog( pMac, LOG2, FL("Save this beacon in LFR cache"));
736 __limHandleBeacon(pMac, limMsg, NULL);
737 }
738 else if (fc.subType == SIR_MAC_MGMT_PROBE_RSP)
739 {
740 limLog( pMac, LOG2, FL("Save this probe rsp in LFR cache"));
741 limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo);
742 }
743 else
744 {
745 limLog( pMac, LOGE, FL("Wrong frame Type %d, Subtype %d for LFR"),
746 fc.type, fc.subType);
747 }
748 goto end;
749 }
750#endif //WLAN_FEATURE_ROAM_SCAN_OFFLOAD
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800751#ifdef FEATURE_WLAN_ESE
Jeff Johnson295189b2012-06-20 16:38:30 -0700752 if (fc.type == SIR_MAC_DATA_FRAME && isFrmFt)
753 {
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800754#if 0 // Ese TBD Need to PORT
Jeff Johnson295189b2012-06-20 16:38:30 -0700755 tpSirMacDot3Hdr pDataFrmHdr;
756
757 pDataFrmHdr = (tpSirMacDot3Hdr)((tANI_U8 *)pBD+ WLANHAL_RX_BD_GET_MPDU_H_OFFSET(pBD));
758 if((psessionEntry = peFindSessionByBssid(pMac,pDataFrmHdr->sa,&sessionId))== NULL)
759 {
760 limLog( pMac, LOGE, FL("Session not found for Frm type %d, subtype %d, SA: "), fc.type, fc.subType);
761 limPrintMacAddr(pMac, pDataFrmHdr->sa, LOGE);
762 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pBD, limMsg->bodyptr);
763 return;
764 }
765
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800766 if (!psessionEntry->isESEconnection)
Jeff Johnson295189b2012-06-20 16:38:30 -0700767 {
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800768 limLog( pMac, LOGE, FL("LIM received Type %d, Subtype %d in Non ESE connection"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700769 fc.type, fc.subType);
770 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pBD, limMsg->bodyptr);
771 return;
772 }
773 limLog( pMac, LOGE, FL("Processing IAPP Frm from SA:"));
774 limPrintMacAddr(pMac, pDataFrmHdr->sa, LOGE);
775#else
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800776 printk("%s: Need to port handling of IAPP frames to PRIMA for ESE", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700777#endif
778
779
780 } else
781#endif
Siddharth Bhal4f3187c2014-10-09 21:38:08 +0530782
783 if ((fc.type == SIR_MAC_MGMT_FRAME) &&
784 (fc.subType == SIR_MAC_MGMT_PROBE_RSP) &&
785 pMac->lim.isSpoofingEnabled)
786 {
787 limLog( pMac, LOG2, FL("Probe Rsp recieved with DA: "MAC_ADDRESS_STR
788 " and selfMac Addr:"MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pHdr->da),
789 MAC_ADDR_ARRAY(pMac->lim.gSelfMacAddr));
790 if (VOS_TRUE == vos_mem_compare((v_VOID_t*) pHdr->da,
791 (v_VOID_t*) pMac->lim.spoofMacAddr, VOS_MAC_ADDRESS_LEN))
792 {
793 vos_mem_copy(pHdr->da, pMac->lim.gSelfMacAddr, VOS_MAC_ADDRESS_LEN);
794 }
795 }
796
Jeff Johnson295189b2012-06-20 16:38:30 -0700797 /* Added For BT-AMP Support */
798 if((psessionEntry = peFindSessionByBssid(pMac,pHdr->bssId,&sessionId))== NULL)
799 {
800#ifdef WLAN_FEATURE_VOWIFI_11R
801 if (fc.subType == SIR_MAC_MGMT_AUTH)
802 {
803#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
Varun Reddy Yeturuf68abd62013-02-11 14:05:06 -0800804 limLog( pMac, LOG1, FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700805 fc.protVer, fc.type, fc.subType, WDA_GET_RX_MAC_RATE_IDX(pRxPacketInfo));
Varun Reddy Yeturuf68abd62013-02-11 14:05:06 -0800806 limPrintMacAddr(pMac, pHdr->bssId, LOG1);
Jeff Johnson295189b2012-06-20 16:38:30 -0700807#endif
808 if (limProcessAuthFrameNoSession(pMac, pRxPacketInfo, limMsg->bodyptr) == eSIR_SUCCESS)
809 {
Kanchanapally, Vidyullathac796fc62015-03-17 10:45:28 +0530810 goto end;
Jeff Johnson295189b2012-06-20 16:38:30 -0700811 }
812 }
813#endif
814 if((fc.subType != SIR_MAC_MGMT_PROBE_RSP )&&
815 (fc.subType != SIR_MAC_MGMT_BEACON)&&
816 (fc.subType != SIR_MAC_MGMT_PROBE_REQ)
Jeff Johnson295189b2012-06-20 16:38:30 -0700817 && (fc.subType != SIR_MAC_MGMT_ACTION ) //Public action frame can be received from non-associated stations.
Jeff Johnson295189b2012-06-20 16:38:30 -0700818 )
819 {
820
821 if((psessionEntry = peFindSessionByPeerSta(pMac,pHdr->sa,&sessionId))== NULL)
822 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700823 limLog(pMac, LOG1, FL("session does not exist for given bssId"));
Kanchanapally, Vidyullathac796fc62015-03-17 10:45:28 +0530824 goto end;
Jeff Johnson295189b2012-06-20 16:38:30 -0700825 }
Padma, Santhosh Kumar2b47ca82014-01-03 16:57:27 +0530826 else
827 limLog(pMac,LOG1,"SessionId:%d Session Exist for given Bssid",
828 psessionEntry->peSessionId);
Gopichand Nakkala6265d6f2013-03-20 23:32:50 +0530829 }
830 // For p2p resp frames search for valid session with DA as
831 // BSSID will be SA and session will be present with DA only
832 if(fc.subType == SIR_MAC_MGMT_ACTION )
833 {
834 psessionEntry = peFindSessionByBssid(pMac,pHdr->da,&sessionId);
835 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700836 }
837
838
Jeff Johnson295189b2012-06-20 16:38:30 -0700839 /* Check if frame is registered by HDD */
840 if(limCheckMgmtRegisteredFrames(pMac, pRxPacketInfo, psessionEntry))
841 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700842 limLog( pMac, LOG1, FL("Received frame is passed to SME"));
Kanchanapally, Vidyullathac796fc62015-03-17 10:45:28 +0530843 goto end;
Jeff Johnson295189b2012-06-20 16:38:30 -0700844 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700845
846
Jeff Johnson295189b2012-06-20 16:38:30 -0700847
848 if (fc.protVer != SIR_MAC_PROTOCOL_VERSION)
849 { // Received Frame with non-zero Protocol Version
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700850 limLog(pMac, LOGE, FL("Unexpected frame with protVersion %d received"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700851 fc.protVer);
Jeff Johnson295189b2012-06-20 16:38:30 -0700852#ifdef WLAN_DEBUG
853 pMac->lim.numProtErr++;
854#endif
Kanchanapally, Vidyullathac796fc62015-03-17 10:45:28 +0530855 goto end;
Jeff Johnson295189b2012-06-20 16:38:30 -0700856 }
857
Gopichand Nakkala2c231c82013-06-11 17:49:16 +0530858 if (!pMac->fScanOffload)
Jeff Johnson295189b2012-06-20 16:38:30 -0700859 {
Gopichand Nakkala2c231c82013-06-11 17:49:16 +0530860 if (limIsSystemInScanState(pMac))
861 {
862 limHandleFramesInScanState(pMac, limMsg, pRxPacketInfo, pDeferMsg, psessionEntry);
863 return;
864 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700865 }
866
867/* Chance of crashing : to be done BT-AMP ........happens when broadcast probe req is received */
868
869#if 0
870 if (psessionEntry->limSystemRole == eLIM_UNKNOWN_ROLE) {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700871 limLog( pMac, LOGW, FL( "gLimSystemRole is %d. Exiting..." ),psessionEntry->limSystemRole );
Jeff Johnson295189b2012-06-20 16:38:30 -0700872 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr);
873
874#ifdef WLAN_DEBUG
875 pMac->lim.numProtErr++;
876#endif
877 return;
878 }
879 #endif //HACK to continue scanning
880
881
882#ifdef WLAN_DEBUG
883 pMac->lim.numMAC[fc.type][fc.subType]++;
884#endif
885
886 switch (fc.type)
887 {
888 case SIR_MAC_MGMT_FRAME:
889 {
890 #if 0 //TBD-RAJESH fix this
891 if (limIsReassocInProgress( pMac,psessionEntry) && (fc.subType != SIR_MAC_MGMT_DISASSOC) &&
892 (fc.subType != SIR_MAC_MGMT_DEAUTH) && (fc.subType != SIR_MAC_MGMT_REASSOC_RSP))
893 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700894 limLog(pMac, LOGE, FL("Frame with Type - %d, Subtype - %d received in ReAssoc Wait state, dropping..."),
Jeff Johnson295189b2012-06-20 16:38:30 -0700895 fc.type, fc.subType);
896 return;
897 }
898 #endif //HACK to continue scanning
899 // Received Management frame
900 switch (fc.subType)
901 {
902 case SIR_MAC_MGMT_ASSOC_REQ:
903 // Make sure the role supports Association
904 if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700905 || (psessionEntry->limSystemRole == eLIM_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700906 )
907 limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_ASSOC, psessionEntry);
908
909 else
910 {
911 // Unwanted messages - Log error
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700912 limLog(pMac, LOGE, FL("unexpected message received %X"),limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -0700913 limPrintMsgName(pMac, LOGE, limMsg->type);
914 }
915 break;
916
917 case SIR_MAC_MGMT_ASSOC_RSP:
918 limProcessAssocRspFrame(pMac, pRxPacketInfo, LIM_ASSOC,psessionEntry);
919 break;
920
921 case SIR_MAC_MGMT_REASSOC_REQ:
922 // Make sure the role supports Reassociation
923 if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700924 || (psessionEntry->limSystemRole == eLIM_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700925 ){
926 limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_REASSOC, psessionEntry);
927 }
928 else
929 {
930 // Unwanted messages - Log error
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700931 limLog(pMac, LOGE, FL("unexpected message received %X"),limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -0700932 limPrintMsgName(pMac, LOGE, limMsg->type);
933 }
934 break;
935
936 case SIR_MAC_MGMT_REASSOC_RSP:
937 limProcessAssocRspFrame(pMac, pRxPacketInfo, LIM_REASSOC,psessionEntry);
938 break;
939
940 case SIR_MAC_MGMT_PROBE_REQ:
941 limProcessProbeReqFrame_multiple_BSS(pMac, pRxPacketInfo,psessionEntry);
942 break;
943
944 case SIR_MAC_MGMT_PROBE_RSP:
945 if(psessionEntry == NULL)
946 limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo);
947 else
948 limProcessProbeRspFrame(pMac, pRxPacketInfo, psessionEntry);
949 break;
950
951 case SIR_MAC_MGMT_BEACON:
952 __limHandleBeacon(pMac, limMsg,psessionEntry);
953 break;
954
955 case SIR_MAC_MGMT_DISASSOC:
956 limProcessDisassocFrame(pMac, pRxPacketInfo,psessionEntry);
957 break;
958
959 case SIR_MAC_MGMT_AUTH:
960 limProcessAuthFrame(pMac, pRxPacketInfo,psessionEntry);
961 break;
962
963 case SIR_MAC_MGMT_DEAUTH:
964 limProcessDeauthFrame(pMac, pRxPacketInfo,psessionEntry);
965 break;
966
967 case SIR_MAC_MGMT_ACTION:
Jeff Johnson295189b2012-06-20 16:38:30 -0700968 if(psessionEntry == NULL)
969 limProcessActionFrameNoSession(pMac, pRxPacketInfo);
970 else
971 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700972 if (WDA_GET_RX_UNKNOWN_UCAST(pRxPacketInfo))
973 limHandleUnknownA2IndexFrames(pMac, pRxPacketInfo,psessionEntry);
974 else
975 limProcessActionFrame(pMac, pRxPacketInfo,psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -0700976 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700977 break;
978 default:
979 // Received Management frame of 'reserved' subtype
980 break;
981 } // switch (fc.subType)
982
983 }
984 break;
Jeff Johnson295189b2012-06-20 16:38:30 -0700985 case SIR_MAC_DATA_FRAME:
986 {
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800987#ifdef FEATURE_WLAN_TDLS_INTERNAL
988 /*
989 * if we reach here, following cases are possible.
990 * Possible cases: a) if frame translation is disabled.
991 * b) Some frame with ADRR2 filter enabled may come
992 * here.
993 */
994 tANI_U8 *dataOffset = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
995 tANI_U8 *rfc1042Hdr = (tANI_U8 *)(dataOffset + RFC1042_HDR_LENGTH) ;
996 tANI_U16 ethType = GET_BE16(rfc1042Hdr) ;
997 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700998 ("TDLS frame with 80211 Header")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800999 if(ETH_TYPE_89_0d == ethType)
1000 {
1001 tANI_U8 payloadType = (rfc1042Hdr + ETH_TYPE_LEN)[0] ;
1002 if(PAYLOAD_TYPE_TDLS == payloadType)
1003 {
1004 limProcessTdlsFrame(pMac, (tANI_U32*)pRxPacketInfo) ;
1005 }
1006 }
1007#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001008#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -07001009 /* We accept data frame (IAPP frame) only if Session is
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001010 * present and ese connection is established on that
Jeff Johnson295189b2012-06-20 16:38:30 -07001011 * session
1012 */
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001013 if (psessionEntry && psessionEntry->isESEconnection) {
Jeff Johnson295189b2012-06-20 16:38:30 -07001014 limProcessIappFrame(pMac, pRxPacketInfo, psessionEntry);
1015 }
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001016#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001017 }
1018 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001019 default:
1020 // Received frame of type 'reserved'
1021 break;
1022
1023 } // switch (fc.type)
1024
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -07001025end:
Jeff Johnson295189b2012-06-20 16:38:30 -07001026 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr) ;
1027 return;
1028} /*** end limHandle80211Frames() ***/
1029
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301030/**
1031 * limSendStopScanOffloadReq()
1032 *
1033 *FUNCTION:
1034 * This function will be called to abort the ongoing offloaded scan
1035 * request.
1036 *
1037 *
1038 *NOTE:
1039 *
1040 * @param pMac Pointer to Global MAC structure
1041 * @return eHAL_STATUS_SUCCESS or eHAL_STATUS_FAILURE
1042 */
1043eHalStatus limSendStopScanOffloadReq(tpAniSirGlobal pMac, tANI_U8 SessionId)
1044{
1045 tSirMsgQ msg;
1046 tSirRetStatus rc = eSIR_SUCCESS;
1047 tAbortScanParams *pAbortScanParams;
1048
Kiet Lamb1233192013-11-28 13:38:20 +05301049 pAbortScanParams = vos_mem_malloc(sizeof(tAbortScanParams));
1050 if (NULL == pAbortScanParams)
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301051 {
1052 limLog(pMac, LOGP, FL("Memory allocation failed for AbortScanParams"));
1053 return eHAL_STATUS_FAILURE;
1054 }
1055
1056 pAbortScanParams->SessionId = SessionId;
1057 msg.type = WDA_STOP_SCAN_OFFLOAD_REQ;
1058 msg.bodyptr = pAbortScanParams;
1059 msg.bodyval = 0;
1060
1061 rc = wdaPostCtrlMsg(pMac, &msg);
1062 if (rc != eSIR_SUCCESS)
1063 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001064 limLog(pMac, LOGE, FL("wdaPostCtrlMsg() return failure"));
Kiet Lamb1233192013-11-28 13:38:20 +05301065 vos_mem_free(pAbortScanParams);
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301066 return eHAL_STATUS_FAILURE;
1067 }
1068
Rashmi Ramanna6c13a342014-01-07 11:44:07 +05301069 limLog(pMac, LOG1, FL("Abort ongoing offload scan."));
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301070 return eHAL_STATUS_SUCCESS;
1071
1072}
Jeff Johnson295189b2012-06-20 16:38:30 -07001073
1074/**
1075 * limProcessAbortScanInd()
1076 *
1077 *FUNCTION:
1078 * This function is called from HDD to abort the scan which is presently being run
1079 *
1080 *
1081 *NOTE:
1082 *
1083 * @param pMac Pointer to Global MAC structure
1084 * @param *pMsgBuf A pointer to the SME message buffer
1085 * @return None
1086 */
1087void
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301088limProcessAbortScanInd(tpAniSirGlobal pMac, tANI_U8 SessionId)
Jeff Johnson295189b2012-06-20 16:38:30 -07001089{
1090#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
1091 limDiagEventReport(pMac, WLAN_PE_DIAG_SCAN_ABORT_IND_EVENT, NULL, 0, 0);
1092#endif //FEATURE_WLAN_DIAG_SUPPORT
1093
1094 /* Deactivate the gLimBackgroundScanTimer as part of the abort scan.
1095 * SME should send WNI_CFG_BACKGROUND_SCAN_PERIOD indication
1096 * to start the background scan again
1097 */
Abhishek Singh525045c2014-12-15 17:18:45 +05301098 limLog(pMac, LOG1, FL("Processing AbortScan Ind"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001099
1100 limAbortBackgroundScan(pMac);
1101
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301102 if (pMac->fScanOffload)
Jeff Johnson295189b2012-06-20 16:38:30 -07001103 {
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301104 /* send stop scan cmd to fw if scan offload is enabled. */
1105 limSendStopScanOffloadReq(pMac, SessionId);
1106 }
1107 else
1108 {
1109 /* Abort the scan if its running, else just return */
1110 if(limIsSystemInScanState(pMac))
Jeff Johnson295189b2012-06-20 16:38:30 -07001111 {
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301112 if( (eLIM_HAL_INIT_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
1113 (eLIM_HAL_START_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
1114 (eLIM_HAL_END_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
1115 (eLIM_HAL_FINISH_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState) )
1116 {
1117 //Simply signal we need to abort
1118 limLog( pMac, LOGW, FL(" waiting for HAL, simply signal abort gLimHalScanState = %d"), pMac->lim.gLimHalScanState );
1119 pMac->lim.abortScan = 1;
1120 }
1121 else
1122 {
1123 //Force abort
1124 limLog( pMac, LOGW, FL(" Force aborting scan") );
1125 pMac->lim.abortScan = 0;
1126 limDeactivateAndChangeTimer(pMac, eLIM_MIN_CHANNEL_TIMER);
1127 limDeactivateAndChangeTimer(pMac, eLIM_MAX_CHANNEL_TIMER);
1128 //Set the resume channel to Any valid channel (invalid).
1129 //This will instruct HAL to set it to any previous valid channel.
1130 peSetResumeChannel(pMac, 0, 0);
1131 limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE);
1132 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001133 }
1134 }
1135 return;
1136}
1137
1138/**
1139 * limMessageProcessor
1140 *
1141 *FUNCTION:
1142 * Wrapper function for limProcessMessages when handling messages received by LIM.
1143 * Could either defer messages or process them.
1144 * @param pMac Pointer to Global MAC structure
1145 * @param limMsg Received LIM message
1146 * @return None
1147 */
1148
1149void limMessageProcessor(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
1150{
1151 if (eLIM_MLM_OFFLINE_STATE == pMac->lim.gLimMlmState)
1152 {
1153 peFreeMsg(pMac, limMsg);
1154 return;
1155 }
1156
1157 if (!defMsgDecision(pMac, limMsg))
1158 {
1159 limProcessMessages(pMac, limMsg);
Jeff Johnson295189b2012-06-20 16:38:30 -07001160 // process deferred message queue if allowed
1161 {
1162 if ( (! (pMac->lim.gLimAddtsSent))
1163 &&
1164 (! (limIsSystemInScanState(pMac)))
1165 )
1166 {
1167 if (true == GET_LIM_PROCESS_DEFD_MESGS(pMac))
1168 limProcessDeferredMessageQueue(pMac);
1169 }
1170 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001171 }
1172}
1173
Jeff Johnsone7245742012-09-05 17:12:55 -07001174#ifdef FEATURE_OEM_DATA_SUPPORT
1175
1176void limOemDataRspHandleResumeLinkRsp(tpAniSirGlobal pMac, eHalStatus status, tANI_U32* mlmOemDataRsp)
1177{
1178 if(status != eHAL_STATUS_SUCCESS)
1179 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001180 limLog(pMac, LOGE, FL("OEM Data Rsp failed to get the response for resume link"));
Jeff Johnsone7245742012-09-05 17:12:55 -07001181 }
1182
1183 if(NULL != pMac->lim.gpLimMlmOemDataReq)
1184 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301185 vos_mem_free(pMac->lim.gpLimMlmOemDataReq);
Jeff Johnsone7245742012-09-05 17:12:55 -07001186 pMac->lim.gpLimMlmOemDataReq = NULL;
1187 }
1188
1189 //"Failure" status doesn't mean that Oem Data Rsp did not happen
1190 //and hence we need to respond to upper layers. Only Resume link is failed, but
1191 //we got the oem data response already.
1192 //Post the meessage to MLM
1193 limPostSmeMessage(pMac, LIM_MLM_OEM_DATA_CNF, (tANI_U32*)(mlmOemDataRsp));
1194
1195 return;
1196}
1197
1198void limProcessOemDataRsp(tpAniSirGlobal pMac, tANI_U32* body)
1199{
Jeff Johnsone7245742012-09-05 17:12:55 -07001200 tpLimMlmOemDataRsp mlmOemDataRsp = NULL;
1201 tpStartOemDataRsp oemDataRsp = NULL;
1202
1203 //Process all the messages for the lim queue
1204 SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
1205
1206 oemDataRsp = (tpStartOemDataRsp)(body);
1207
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301208 mlmOemDataRsp = vos_mem_malloc(sizeof(tLimMlmOemDataRsp));
1209 if ( NULL == mlmOemDataRsp )
Jeff Johnsone7245742012-09-05 17:12:55 -07001210 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001211 limLog(pMac, LOGP, FL("could not allocate memory for mlmOemDataRsp"));
Jeff Johnsone7245742012-09-05 17:12:55 -07001212 return;
1213 }
1214
1215 //copy the memory into tLimMlmOemDataRsp and free the tStartOemDataRsp
1216 //the structures tStartOemDataRsp and tLimMlmOemDataRsp have the same structure
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301217 vos_mem_copy((void*)(mlmOemDataRsp), (void*)(oemDataRsp),
1218 sizeof(tLimMlmOemDataRsp));
Jeff Johnsone7245742012-09-05 17:12:55 -07001219
1220 //Now free the incoming memory
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301221 vos_mem_free(oemDataRsp);
Jeff Johnsone7245742012-09-05 17:12:55 -07001222
1223 limResumeLink(pMac, limOemDataRspHandleResumeLinkRsp, (tANI_U32*)mlmOemDataRsp);
1224
1225 return;
1226}
1227
1228#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001229
Katya Nigam3802f202013-12-16 19:27:14 +05301230static tANI_BOOLEAN limAgeOutProbeReq( tpAniSirGlobal pMac, tpSirMsgQ limMsg,
1231 vos_pkt_t *pVosPkt )
1232{
1233 tANI_U8 *pRxPacketInfo = NULL;
1234 tSirMacFrameCtl fc;
1235 tpSirMacMgmtHdr pHdr=NULL;
1236 tANI_BOOLEAN match = VOS_FALSE;
1237
1238 limGetBDfromRxPacket(pMac, limMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo);
1239 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1240 fc = pHdr->fc;
1241 if ( fc.subType == SIR_MAC_MGMT_PROBE_REQ )
1242 {
1243 if( vos_timer_get_system_ticks() - pVosPkt->timestamp >= MAX_PROBEREQ_TIME )
1244 {
1245 // drop packet
1246 limLog(pMac, LOGE,
1247 FL("Dropping Aged Out probe requests. Peer MAC is "MAC_ADDRESS_STR),
1248 MAC_ADDR_ARRAY(pHdr->sa));
1249
1250 vos_pkt_return_packet(pVosPkt);
1251 match = VOS_TRUE;
1252 }
1253 }
1254 return match;
1255}
1256
Jeff Johnson295189b2012-06-20 16:38:30 -07001257/**
1258 * limProcessMessages
1259 *
1260 *FUNCTION:
1261 * This function is called by limProcessMessageQueue function. This
1262 * function processes messages received by LIM.
1263 *
1264 *LOGIC:
1265 * Depending on the message type, corresponding function will be
1266 * called, for example limProcessSmeMessages() will be called to
1267 * process SME messages received from HDD/Upper layer software module.
1268 *
1269 *ASSUMPTIONS:
1270 * NA
1271 *
1272 *NOTE:
1273 * NA
1274 *
1275 * @param pMac Pointer to Global MAC structure
1276 * @param limMsg Received LIM message
1277 * @return None
1278 */
1279
1280void
1281limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
1282{
1283 tANI_U8 deferMsg = false;
1284 tLinkStateParams *linkStateParams;
1285#if defined WLAN_FEATURE_VOWIFI_11R
1286 tpPESession pSession;
1287#endif
1288#if defined(ANI_DVT_DEBUG)
1289 tSirMsgQ msgQ;
1290#endif
1291 if(pMac->gDriverType == eDRIVER_TYPE_MFG)
1292 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301293 vos_mem_free(limMsg->bodyptr);
Jeff Johnsone7245742012-09-05 17:12:55 -07001294 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001295 return;
1296 }
1297#ifdef WLAN_DEBUG
1298 pMac->lim.numTot++;
1299#endif
1300
1301
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001302 PELOG3(limLog(pMac, LOG3, FL("rcvd msgType = %s, sme state = %s, mlm state = %s"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001303 limMsgStr(limMsg->type), limSmeStateStr(pMac->lim.gLimSmeState),
1304 limMlmStateStr(pMac->lim.gLimMlmState));)
1305
Jeff Johnsone7245742012-09-05 17:12:55 -07001306 MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(limMsg->type, LIM_MSG_PROCESSED));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001307
1308 switch (limMsg->type)
1309 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001310
1311 case SIR_LIM_UPDATE_BEACON:
1312 limUpdateBeacon(pMac);
1313 break;
1314
Jeff Johnson295189b2012-06-20 16:38:30 -07001315 case SIR_CFG_PARAM_UPDATE_IND:
1316 /// CFG parameter updated
1317 if (limIsSystemInScanState(pMac))
1318 {
1319 // System is in DFS (Learn) mode
1320 // Defer processsing this message
1321 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1322 {
Leela Venkata Kiran Kumar Reddy Chirala2247e962013-03-22 19:21:10 -07001323 if(!(pMac->lim.deferredMsgCnt & 0xF))
1324 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001325 PELOGE(limLog(pMac, LOGE, FL("Unable to Defer message(0x%X) limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001326 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1327 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
Leela Venkata Kiran Kumar Reddy Chirala2247e962013-03-22 19:21:10 -07001328 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001329 limLogSessionStates(pMac);
1330 limPrintMsgName(pMac, LOGE, limMsg->type);
1331 }
1332 }
1333 else
1334 {
1335 limHandleCFGparamUpdate(pMac, limMsg->bodyval);
1336 }
1337
1338 break;
1339
1340 case WDA_INIT_SCAN_RSP:
1341 limProcessInitScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001342 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001343 break;
1344
1345 case WDA_START_SCAN_RSP:
1346 limProcessStartScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001347 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001348 break;
1349
1350 case WDA_END_SCAN_RSP:
1351 limProcessEndScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001352 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001353 break;
1354
1355 case WDA_FINISH_SCAN_RSP:
1356 limProcessFinishScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001357 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001358 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001359#ifdef FEATURE_OEM_DATA_SUPPORT
1360 case WDA_START_OEM_DATA_RSP:
1361 limProcessOemDataRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001362 limMsg->bodyptr = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07001363 break;
1364#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001365
1366 case WDA_SWITCH_CHANNEL_RSP:
1367 limProcessSwitchChannelRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001368 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001369 break;
1370
1371#ifdef ANI_SIR_IBSS_PEER_CACHING
1372 case WDA_IBSS_STA_ADD:
1373 limIbssStaAdd(pMac, limMsg->bodyptr);
1374 break;
1375#endif
1376 case SIR_BB_XPORT_MGMT_MSG:
1377 // These messages are from Peer MAC entity.
1378#ifdef WLAN_DEBUG
1379 pMac->lim.numBbt++;
1380#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001381 {
1382 v_U16_t pktLen = 0;
1383 vos_pkt_t *pVosPkt;
1384 VOS_STATUS vosStatus;
1385 tSirMsgQ limMsgNew;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001386#ifdef FEATURE_WLAN_TDLS_INTERNAL
1387 tANI_U32 *pBD = NULL ;
1388#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001389
1390 /* The original limMsg which we were deferring have the
1391 * bodyPointer point to 'BD' instead of 'Vos pkt'. If we don't make a copy
1392 * of limMsg, then vos_pkt_peek_data will overwrite the limMsg->bodyPointer.
1393 * and next time when we try to process the msg, we will try to use 'BD' as
1394 * 'Vos Pkt' which will cause a crash
1395 */
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301396 vos_mem_copy((tANI_U8*)&limMsgNew, (tANI_U8*)limMsg,
1397 sizeof(tSirMsgQ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001398 pVosPkt = (vos_pkt_t *)limMsgNew.bodyptr;
1399 vos_pkt_get_packet_length(pVosPkt, &pktLen);
1400
1401 vosStatus = WDA_DS_PeekRxPacketInfo( pVosPkt, (v_PVOID_t *)&limMsgNew.bodyptr, VOS_FALSE );
1402
1403 if( !VOS_IS_STATUS_SUCCESS(vosStatus) )
1404 {
Katya Nigamfdf5a522015-02-03 14:38:55 +05301405 limDecrementPendingMgmtCount(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001406 vos_pkt_return_packet(pVosPkt);
1407 break;
1408
1409 }
Katya Nigam3802f202013-12-16 19:27:14 +05301410
1411 /*
1412 * putting a check for age out probe request frames
1413 * such that any probe req more than 0.5 sec old can directly
1414 * be dropped. With this, there won't be blocking of MC thread.
1415 */
1416
1417 if( limAgeOutProbeReq ( pMac, &limMsgNew, pVosPkt ))
1418 {
Katya Nigamfdf5a522015-02-03 14:38:55 +05301419 limDecrementPendingMgmtCount(pMac);
Katya Nigam3802f202013-12-16 19:27:14 +05301420 break;
1421 }
1422
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001423#ifdef FEATURE_WLAN_TDLS_INTERNAL
1424 /*
1425 * TDLS frames comes as translated frames as well as
1426 * MAC 802.11 data frames..
1427 */
1428 limGetBDfromRxPacket(pMac, limMsgNew.bodyptr, &pBD);
1429 if(0 != WDA_GET_RX_FT_DONE(pBD))
1430 {
1431 /*
1432 * TODO: check for scanning state and set deferMesg flag
1433 * accordingly..
1434 */
1435 deferMsg = false ;
1436
1437 limProcessTdlsFrame(pMac, pBD) ;
1438 }
1439 else
1440#endif
Katya Nigam3802f202013-12-16 19:27:14 +05301441
Jeff Johnson295189b2012-06-20 16:38:30 -07001442 limHandle80211Frames(pMac, &limMsgNew, &deferMsg);
1443
1444 if ( deferMsg == true )
1445 {
Abhishek Singh3cbf6052014-12-15 16:46:42 +05301446 limLog(pMac, LOG2, FL("Defer message type=%X "),
1447 limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -07001448 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1449 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001450 PELOGE(limLog(pMac, LOGE, FL("Unable to Defer message(0x%X) limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001451 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1452 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
1453 limLogSessionStates(pMac);
1454 limPrintMsgName(pMac, LOGE, limMsg->type);
Katya Nigamfdf5a522015-02-03 14:38:55 +05301455 limDecrementPendingMgmtCount(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001456 vos_pkt_return_packet(pVosPkt);
1457 }
1458 }
1459 else
1460 {
1461 /* PE is not deferring this 802.11 frame so we need to call vos_pkt_return.
1462 * Asumption here is when Rx mgmt frame processing is done,
1463 * voss packet could be freed here.
1464 */
Katya Nigamfdf5a522015-02-03 14:38:55 +05301465 limDecrementPendingMgmtCount(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001466 vos_pkt_return_packet(pVosPkt);
1467 }
1468 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001469 break;
1470
1471 case eWNI_SME_SCAN_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001472 case eWNI_SME_REMAIN_ON_CHANNEL_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001473 case eWNI_SME_DISASSOC_REQ:
1474 case eWNI_SME_DEAUTH_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001475 case eWNI_SME_GET_SCANNED_CHANNEL_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -07001476#ifdef FEATURE_OEM_DATA_SUPPORT
1477 case eWNI_SME_OEM_DATA_REQ:
1478#endif
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001479#ifdef FEATURE_WLAN_TDLS
1480 case eWNI_SME_TDLS_SEND_MGMT_REQ:
1481 case eWNI_SME_TDLS_ADD_STA_REQ:
1482 case eWNI_SME_TDLS_DEL_STA_REQ:
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301483 case eWNI_SME_TDLS_LINK_ESTABLISH_REQ:
Atul Mittalc0f739f2014-07-31 13:47:47 +05301484// tdlsoffchan
1485 case eWNI_SME_TDLS_CHANNEL_SWITCH_REQ:
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001486#endif
1487#ifdef FEATURE_WLAN_TDLS_INTERNAL
1488 case eWNI_SME_TDLS_DISCOVERY_START_REQ:
1489 case eWNI_SME_TDLS_LINK_START_REQ:
1490 case eWNI_SME_TDLS_TEARDOWN_REQ:
1491#endif
Gopichand Nakkalacca24d12013-03-07 17:05:07 +05301492 case eWNI_SME_RESET_AP_CAPS_CHANGED:
Jeff Johnson295189b2012-06-20 16:38:30 -07001493 // These messages are from HDD
1494 limProcessNormalHddMsg(pMac, limMsg, true); //need to response to hdd
1495 break;
1496
1497 case eWNI_SME_SCAN_ABORT_IND:
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301498 {
1499 tANI_U8 *pSessionId = (tANI_U8 *)limMsg->bodyptr;
1500 limProcessAbortScanInd(pMac, *pSessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -07001501 vos_mem_free((v_VOID_t *)limMsg->bodyptr);
1502 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001503 break;
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301504 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001505 case eWNI_SME_START_REQ:
1506 case eWNI_SME_SYS_READY_IND:
1507#ifndef WNI_ASKEY_NON_SUPPORT_FEATURE
1508 case eWNI_SME_JOIN_REQ:
1509#endif
1510 case eWNI_SME_AUTH_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_REQ:
1515 case eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ:
1516 case eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ:
1517 case eWNI_SME_SETCONTEXT_REQ:
1518 case eWNI_SME_REMOVEKEY_REQ:
1519#ifndef WNI_ASKEY_NON_SUPPORT_FEATURE
1520 case eWNI_SME_PROMISCUOUS_MODE_REQ:
1521#endif
1522 case eWNI_SME_DISASSOC_CNF:
1523 case eWNI_SME_DEAUTH_CNF:
1524 case eWNI_SME_ASSOC_CNF:
1525 case eWNI_SME_REASSOC_CNF:
1526 case eWNI_SME_ADDTS_REQ:
1527 case eWNI_SME_DELTS_REQ:
1528 case eWNI_SME_DEL_BA_PEER_IND:
1529 case eWNI_SME_SET_TX_POWER_REQ:
1530 case eWNI_SME_GET_TX_POWER_REQ:
1531 case eWNI_SME_GET_NOISE_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001532 case eWNI_SME_GET_ASSOC_STAS_REQ:
1533 case eWNI_SME_TKIP_CNTR_MEAS_REQ:
1534 case eWNI_SME_UPDATE_APWPSIE_REQ:
1535 case eWNI_SME_HIDE_SSID_REQ:
1536 case eWNI_SME_GET_WPSPBC_SESSION_REQ:
1537 case eWNI_SME_SET_APWPARSNIEs_REQ:
Madan Mohan Koyyalamudi167b95e2012-11-27 15:53:38 -08001538 case eWNI_SME_CHNG_MCC_BEACON_INTERVAL:
Jeff Johnson295189b2012-06-20 16:38:30 -07001539#if defined WLAN_FEATURE_VOWIFI
1540 case eWNI_SME_NEIGHBOR_REPORT_REQ_IND:
1541 case eWNI_SME_BEACON_REPORT_RESP_XMIT_IND:
1542#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001543#if defined FEATURE_WLAN_ESE
1544 case eWNI_SME_ESE_ADJACENT_AP_REPORT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001545#endif
1546#ifdef WLAN_FEATURE_VOWIFI_11R
1547 case eWNI_SME_FT_UPDATE_KEY:
1548 case eWNI_SME_FT_PRE_AUTH_REQ:
1549 case eWNI_SME_FT_AGGR_QOS_REQ:
1550#endif
1551 case eWNI_SME_ADD_STA_SELF_REQ:
1552 case eWNI_SME_DEL_STA_SELF_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001553 case eWNI_SME_REGISTER_MGMT_FRAME_REQ:
1554 case eWNI_SME_UPDATE_NOA:
Gopichand Nakkalac178ac82013-05-30 19:53:39 +05301555 case eWNI_SME_CLEAR_DFS_CHANNEL_LIST:
Madan Mohan Koyyalamudi44bbc152013-07-05 21:13:10 +05301556 case eWNI_SME_STA_STAT_REQ:
1557 case eWNI_SME_AGGR_STAT_REQ:
1558 case eWNI_SME_GLOBAL_STAT_REQ:
1559 case eWNI_SME_STAT_SUMM_REQ:
1560 case eWNI_SME_GET_STATISTICS_REQ:
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001561#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR)
Madan Mohan Koyyalamudi44bbc152013-07-05 21:13:10 +05301562 case eWNI_SME_GET_ROAM_RSSI_REQ:
1563#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001564#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001565 case eWNI_SME_GET_TSM_STATS_REQ:
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001566#endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */
Siddharth Bhal6af5d4e2014-09-29 21:11:16 +05301567 case eWNI_SME_MAC_SPOOF_ADDR_IND:
Jeff Johnson295189b2012-06-20 16:38:30 -07001568 // These messages are from HDD
1569 limProcessNormalHddMsg(pMac, limMsg, false); //no need to response to hdd
1570 break;
1571
1572 //Power Save Messages From HDD
1573 case eWNI_PMC_PWR_SAVE_CFG:
1574 case eWNI_PMC_ENTER_BMPS_REQ:
1575 case eWNI_PMC_EXIT_BMPS_REQ:
1576 case eWNI_PMC_ENTER_IMPS_REQ:
1577 case eWNI_PMC_EXIT_IMPS_REQ:
1578 case eWNI_PMC_ENTER_UAPSD_REQ:
1579 case eWNI_PMC_EXIT_UAPSD_REQ:
1580 case eWNI_PMC_ENTER_WOWL_REQ:
1581 case eWNI_PMC_EXIT_WOWL_REQ:
1582 case eWNI_PMC_WOWL_ADD_BCAST_PTRN:
1583 case eWNI_PMC_WOWL_DEL_BCAST_PTRN:
1584 pmmProcessMessage(pMac, limMsg);
1585 break;
1586
1587 case eWNI_PMC_SMPS_STATE_IND :
1588 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001589 if(limMsg->bodyptr){
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301590 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001591 limMsg->bodyptr = NULL;
1592 }
1593 }
1594 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001595 case eWNI_SME_SEND_ACTION_FRAME_IND:
1596 limSendP2PActionFrame(pMac, limMsg);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301597 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001598 limMsg->bodyptr = NULL;
1599 break;
1600 case eWNI_SME_ABORT_REMAIN_ON_CHAN_IND:
1601 limAbortRemainOnChan(pMac);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301602 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001603 limMsg->bodyptr = NULL;
1604 break;
1605
Viral Modid86bde22012-12-10 13:09:21 -08001606 case SIR_HAL_P2P_NOA_START_IND:
1607 {
1608 tpPESession psessionEntry = &pMac->lim.gpSession[0];
1609 tANI_U8 i;
Viral Modid440e682013-03-06 02:25:31 -08001610 tANI_U8 p2pGOExists = 0;
Gopichand Nakkala78a6c812013-05-13 16:39:49 +05301611
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001612 limLog(pMac, LOG1, "LIM received NOA start %x", limMsg->type);
Viral Modid440e682013-03-06 02:25:31 -08001613
1614 /* Since insert NOA is done and NOA start msg received, we should deactivate the Insert NOA timer */
1615 limDeactivateAndChangeTimer(pMac, eLIM_INSERT_SINGLESHOT_NOA_TIMER);
1616
Viral Modid86bde22012-12-10 13:09:21 -08001617 for(i=0; i < pMac->lim.maxBssId; i++)
1618 {
1619 psessionEntry = &pMac->lim.gpSession[i];
1620 if ( (psessionEntry != NULL) && (psessionEntry->valid) &&
1621 (psessionEntry->pePersona == VOS_P2P_GO_MODE))
1622 { //Save P2P NOA start attributes for P2P Go persona
Viral Modid440e682013-03-06 02:25:31 -08001623 p2pGOExists = 1;
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301624 vos_mem_copy(&psessionEntry->p2pGoPsNoaStartInd, limMsg->bodyptr,
1625 sizeof(tSirP2PNoaStart));
Viral Modid440e682013-03-06 02:25:31 -08001626 if (psessionEntry->p2pGoPsNoaStartInd.status != eHAL_STATUS_SUCCESS)
Viral Modid86bde22012-12-10 13:09:21 -08001627 {
Viral Modid440e682013-03-06 02:25:31 -08001628 limLog(pMac, LOGW, FL("GO NOA start failure status %d reported by FW."
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001629 " - still go ahead with deferred sme req. This is just info"),
Viral Modid440e682013-03-06 02:25:31 -08001630 psessionEntry->p2pGoPsNoaStartInd.status);
Viral Modid86bde22012-12-10 13:09:21 -08001631 }
Viral Modid86bde22012-12-10 13:09:21 -08001632 break;
1633 }
1634 }
Viral Modid440e682013-03-06 02:25:31 -08001635
1636 if (p2pGOExists == 0)
1637 {
1638 limLog(pMac, LOGW, FL("By the time, we received NOA start, GO is already removed."
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001639 " - still go ahead with deferred sme req. This is just info"));
Viral Modid440e682013-03-06 02:25:31 -08001640 }
1641
1642 /* We received the NOA start indication. Now we can send down the SME request which requires off-channel operation */
1643 limProcessRegdDefdSmeReqAfterNOAStart(pMac);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301644 vos_mem_free(limMsg->bodyptr);
Viral Modid86bde22012-12-10 13:09:21 -08001645 limMsg->bodyptr = NULL;
Viral Modid440e682013-03-06 02:25:31 -08001646 }
Viral Modid86bde22012-12-10 13:09:21 -08001647 break;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301648#ifdef FEATURE_WLAN_TDLS
1649 case SIR_HAL_TDLS_IND:
1650 {
1651 tSirTdlsInd *pTdlsInd = (tpSirTdlsInd)limMsg->bodyptr ;
1652 tpDphHashNode pStaDs = NULL ;
1653 tpPESession psessionEntry = NULL;
1654 tANI_U8 sessionId;
1655 if((psessionEntry = peFindSessionByStaId(pMac,pTdlsInd->staIdx,&sessionId))== NULL)
1656 {
1657 limLog(pMac, LOG1, FL("session does not exist for given bssId\n"));
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301658 vos_mem_free(limMsg->bodyptr);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301659 limMsg->bodyptr = NULL;
1660 return;
1661 }
1662 if ((pStaDs = dphGetHashEntry(pMac, pTdlsInd->assocId, &psessionEntry->dph.dphHashTable)) == NULL)
1663 {
1664 limLog(pMac, LOG1, FL("pStaDs Does not exist for given staId\n"));
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301665 vos_mem_free(limMsg->bodyptr);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301666 limMsg->bodyptr = NULL;
1667 return;
1668 }
Viral Modid86bde22012-12-10 13:09:21 -08001669
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301670 if ((STA_ENTRY_TDLS_PEER == pStaDs->staType))
1671 {
1672 limLog(pMac, LOGE,
1673 FL("received TDLS Indication from the Firmware with Reason Code %d "),
1674 pTdlsInd->reasonCode);
1675 limSendSmeTDLSDelStaInd(pMac, pStaDs, psessionEntry,
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05301676 pTdlsInd->reasonCode);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301677 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301678 vos_mem_free(limMsg->bodyptr);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301679 limMsg->bodyptr = NULL;
1680 }
1681 break;
1682#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001683 case SIR_HAL_P2P_NOA_ATTR_IND:
1684 {
1685 tpPESession psessionEntry = &pMac->lim.gpSession[0];
1686 tANI_U8 i;
1687
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001688 limLog(pMac, LOGW, FL("Received message Noa_ATTR %x"), limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -07001689 for(i=0; i < pMac->lim.maxBssId; i++)
1690 {
Viral Modid86bde22012-12-10 13:09:21 -08001691 psessionEntry = &pMac->lim.gpSession[i];
1692 if ( (psessionEntry != NULL) && (psessionEntry->valid) &&
Jeff Johnson295189b2012-06-20 16:38:30 -07001693 (psessionEntry->pePersona == VOS_P2P_GO_MODE))
1694 { //Save P2P attributes for P2P Go persona
1695
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301696 vos_mem_copy(&psessionEntry->p2pGoPsUpdate, limMsg->bodyptr,
1697 sizeof(tSirP2PNoaAttr));
1698
Arif Hussain24bafea2013-11-15 15:10:03 -08001699 limLog(pMac, LOG2, FL(" &psessionEntry->bssId "
1700 MAC_ADDRESS_STR " ctWin=%d oppPsFlag=%d"),
1701 MAC_ADDR_ARRAY(psessionEntry->bssId),
Jeff Johnson295189b2012-06-20 16:38:30 -07001702 psessionEntry->p2pGoPsUpdate.ctWin,
1703 psessionEntry->p2pGoPsUpdate.oppPsFlag);
1704
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001705 limLog(pMac, LOG2, FL(" uNoa1IntervalCnt=%d uNoa1Duration=%d uNoa1Interval=%d uNoa1StartTime=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001706 psessionEntry->p2pGoPsUpdate.uNoa1IntervalCnt,
1707 psessionEntry->p2pGoPsUpdate.uNoa1Duration,
1708 psessionEntry->p2pGoPsUpdate.uNoa1Interval,
1709 psessionEntry->p2pGoPsUpdate.uNoa1StartTime);
1710
1711
1712 break;
1713 }
1714 }
1715
1716 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301717 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001718 limMsg->bodyptr = NULL;
1719
1720 break;
1721
1722
Jeff Johnson295189b2012-06-20 16:38:30 -07001723 /* eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER Message comes after the
1724 * device comes out of full power for the full power request sent
1725 * because of channel switch with switch count as 0, so call the same
1726 * function used in timeout case(i.e SIR_LIM_CHANNEL_SWITCH_TIMEOUT)
1727 * for switching the channel*/
1728 case eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER:
Jeff Johnsone7245742012-09-05 17:12:55 -07001729 if ( !tx_timer_running(&pMac->lim.limTimers.gLimChannelSwitchTimer) )
1730 {
1731 limProcessChannelSwitchTimeout(pMac);
1732 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301733 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001734 limMsg->bodyptr = NULL;
1735 break;
1736
1737 //Power Save Related Messages From HAL
1738 case WDA_ENTER_BMPS_RSP:
1739 case WDA_EXIT_BMPS_RSP:
1740 case WDA_EXIT_BMPS_IND:
1741 case WDA_ENTER_IMPS_RSP:
1742 case WDA_EXIT_IMPS_RSP:
1743 case WDA_ENTER_UAPSD_RSP:
1744 case WDA_EXIT_UAPSD_RSP:
1745 case WDA_WOWL_ENTER_RSP:
1746 case WDA_WOWL_EXIT_RSP:
1747 pmmProcessMessage(pMac, limMsg);
1748 break;
1749
1750 case WDA_LOW_RSSI_IND:
1751 //limHandleLowRssiInd(pMac);
1752 break;
1753
1754 case WDA_BMPS_STATUS_IND:
1755 limHandleBmpsStatusInd(pMac);
1756 break;
1757
1758 case WDA_MISSED_BEACON_IND:
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001759 limHandleMissedBeaconInd(pMac, limMsg);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301760 vos_mem_free(limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001761 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001762 break;
1763 case WDA_MIC_FAILURE_IND:
1764 limMicFailureInd(pMac, limMsg);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301765 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001766 limMsg->bodyptr = NULL;
1767 break;
1768
1769
Jeff Johnson295189b2012-06-20 16:38:30 -07001770
1771 case SIR_LIM_ADDTS_RSP_TIMEOUT:
1772 limProcessSmeReqMessages(pMac,limMsg);
1773 break;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001774#ifdef FEATURE_WLAN_ESE
1775 case SIR_LIM_ESE_TSM_TIMEOUT:
1776#ifndef FEATURE_WLAN_ESE_UPLOAD
Jeff Johnson295189b2012-06-20 16:38:30 -07001777 limProcessTsmTimeoutHandler(pMac,limMsg);
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001778#endif /* FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001779 break;
1780 case WDA_TSM_STATS_RSP:
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001781#ifdef FEATURE_WLAN_ESE_UPLOAD
1782 limSendSmePEEseTsmRsp(pMac, (tAniGetTsmStatsRsp *)limMsg->bodyptr);
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001783#else
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001784 limProcessHalEseTsmRsp(pMac, limMsg);
1785#endif /* FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001786 break;
1787#endif
1788 case WDA_ADD_TS_RSP:
1789 limProcessHalAddTsRsp(pMac, limMsg);
1790 break;
1791
1792 case SIR_LIM_DEL_TS_IND:
1793 limProcessDelTsInd(pMac, limMsg);
Madan Mohan Koyyalamudif244d8f2012-11-29 11:21:05 -08001794 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001795 case SIR_LIM_ADD_BA_IND:
1796 limProcessAddBaInd(pMac, limMsg);
1797 break;
1798 case SIR_LIM_DEL_BA_ALL_IND:
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001799 limDelAllBASessions(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001800 break;
1801 case SIR_LIM_DEL_BA_IND:
1802 limProcessMlmHalBADeleteInd( pMac, limMsg );
1803 break;
1804
1805 case SIR_LIM_BEACON_GEN_IND: {
Jeff Johnson295189b2012-06-20 16:38:30 -07001806
Jeff Johnson295189b2012-06-20 16:38:30 -07001807 if( pMac->lim.gLimSystemRole != eLIM_AP_ROLE )
Jeff Johnson295189b2012-06-20 16:38:30 -07001808 schProcessPreBeaconInd(pMac, limMsg);
1809
1810 }
1811 break;
1812
1813 case SIR_LIM_DELETE_STA_CONTEXT_IND:
1814 limDeleteStaContext(pMac, limMsg);
1815 break;
1816
1817 case SIR_LIM_MIN_CHANNEL_TIMEOUT:
1818 case SIR_LIM_MAX_CHANNEL_TIMEOUT:
1819 case SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT:
1820 case SIR_LIM_JOIN_FAIL_TIMEOUT:
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001821 case SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001822 case SIR_LIM_AUTH_FAIL_TIMEOUT:
1823 case SIR_LIM_AUTH_RSP_TIMEOUT:
1824 case SIR_LIM_ASSOC_FAIL_TIMEOUT:
1825 case SIR_LIM_REASSOC_FAIL_TIMEOUT:
1826#ifdef WLAN_FEATURE_VOWIFI_11R
1827 case SIR_LIM_FT_PREAUTH_RSP_TIMEOUT:
1828#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001829 case SIR_LIM_REMAIN_CHN_TIMEOUT:
Viral Modid86bde22012-12-10 13:09:21 -08001830 case SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT:
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001831 case SIR_LIM_DISASSOC_ACK_TIMEOUT:
1832 case SIR_LIM_DEAUTH_ACK_TIMEOUT:
Gopichand Nakkalad492d202013-05-10 02:50:47 +05301833 case SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
Sushant Kaushik9e923872015-04-02 17:09:31 +05301834 case SIR_LIM_AUTH_RETRY_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001835 // These timeout messages are handled by MLM sub module
1836
1837 limProcessMlmReqMessages(pMac,
1838 limMsg);
1839
1840 break;
1841
1842 case SIR_LIM_HEART_BEAT_TIMEOUT:
1843 /** check if heart beat failed, even if one Beacon
1844 * is rcvd within the Heart Beat interval continue
1845 * normal processing
1846 */
1847
1848 #if 0
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001849 PELOG1(limLog(pMac, LOG1, FL("Heartbeat timeout, SME %d, MLME %d, #bcn %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001850 pMac->lim.gLimSmeState, pMac->lim.gLimMlmState,
1851 pMac->lim.gLimRxedBeaconCntDuringHB);)
1852
1853 if(pMac->lim.gLimSystemRole == eLIM_STA_IN_IBSS_ROLE)
1854 limIbssHeartBeatHandle(pMac); //HeartBeat for peers.
1855 else
1856 /**
1857 * Heartbeat failure occurred on STA
1858 * This is handled by LMM sub module.
1859 */
1860 limHandleHeartBeatFailure(pMac);
1861
1862 break;
1863 #endif //TO SUPPORT BT-AMP
Yathish9f22e662012-12-10 14:21:35 -08001864 if (limIsSystemInScanState(pMac))
1865 {
1866 // System is in DFS (Learn) mode
1867 // Defer processsing this message
1868 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1869 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001870 PELOGE(limLog(pMac, LOGE, FL("Unable to Defer message(0x%X) limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)"),
Yathish9f22e662012-12-10 14:21:35 -08001871 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1872 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
1873 limLogSessionStates(pMac);
1874 }
1875 }
1876 else
1877 {
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001878 if (NULL == limMsg->bodyptr)
1879 {
1880 limHandleHeartBeatTimeout(pMac);
1881 }
1882 else
1883 {
1884 limHandleHeartBeatTimeoutForSession(pMac, (tpPESession)limMsg->bodyptr);
1885 }
Gopichand Nakkala78a6c812013-05-13 16:39:49 +05301886 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001887 break;
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001888
Jeff Johnson295189b2012-06-20 16:38:30 -07001889 case SIR_LIM_PROBE_HB_FAILURE_TIMEOUT:
1890 limHandleHeartBeatFailureTimeout(pMac);
1891 break;
1892
1893 case SIR_LIM_CHANNEL_SCAN_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001894 /**
1895 * Background scan timeout occurred on STA.
1896 * This is handled by LMM sub module.
1897 */
1898 limDeactivateAndChangeTimer(pMac, eLIM_BACKGROUND_SCAN_TIMER);
1899
1900 //We will do background scan even in bcnps mode
1901 //if (pMac->sys.gSysEnableScanMode)
1902 pMac->lim.gLimReportBackgroundScanResults = FALSE;
1903 limTriggerBackgroundScan(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001904 break;
1905
Jeff Johnson295189b2012-06-20 16:38:30 -07001906 case SIR_LIM_CNF_WAIT_TIMEOUT:
1907
1908 /*
1909 ** Does not receive CNF or dummy packet
1910 **/
1911 limHandleCnfWaitTimeout(pMac, (tANI_U16) limMsg->bodyval);
1912
1913 break;
1914
1915 case SIR_LIM_KEEPALIVE_TIMEOUT:
1916 limSendKeepAliveToPeer(pMac);
1917
1918 break;
1919
1920 case SIR_LIM_RETRY_INTERRUPT_MSG:
1921 // Message from ISR upon TFP's max retry limit interrupt
1922
1923 break;
1924
1925 case SIR_LIM_INV_KEY_INTERRUPT_MSG:
1926 // Message from ISR upon SP's Invalid session key interrupt
1927
1928 break;
1929
1930 case SIR_LIM_KEY_ID_INTERRUPT_MSG:
1931 // Message from ISR upon SP's Invalid key ID interrupt
1932
1933 break;
1934
1935 case SIR_LIM_REPLAY_THRES_INTERRUPT_MSG:
1936 // Message from ISR upon SP's Replay threshold interrupt
1937
1938 break;
1939
1940 case SIR_LIM_CHANNEL_SWITCH_TIMEOUT:
1941 limProcessChannelSwitchTimeout(pMac);
1942 break;
1943
1944 case SIR_LIM_QUIET_TIMEOUT:
1945 limProcessQuietTimeout(pMac);
1946 break;
1947
1948 case SIR_LIM_QUIET_BSS_TIMEOUT:
1949 limProcessQuietBssTimeout(pMac);
1950 break;
1951
Jeff Johnson295189b2012-06-20 16:38:30 -07001952 case SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT:
1953 limHandleUpdateOlbcCache(pMac);
1954 break;
1955#if 0
1956 case SIR_LIM_WPS_OVERLAP_TIMEOUT:
1957 limProcessWPSOverlapTimeout(pMac);
1958 break;
1959#endif
1960
Jeff Johnson295189b2012-06-20 16:38:30 -07001961
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001962#ifdef FEATURE_WLAN_TDLS_INTERNAL
1963 /*
1964 * Here discovery timer expires, now we can go ahead and collect all
1965 * the dicovery responses PE has process till now and send this
1966 * responses to SME..
1967 */
1968 case SIR_LIM_TDLS_DISCOVERY_RSP_WAIT:
1969 {
1970 //fetch the sessionEntry based on the sessionId
1971 tpPESession psessionEntry = peFindSessionBySessionId(pMac,
1972 pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId) ;
1973 if(NULL == psessionEntry)
1974 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001975 limLog(pMac, LOGP,FL("Session Does not exist for given sessionID %d"), pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId);
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001976 return;
1977 }
1978
1979 VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001980 ("Discovery Rsp timer expires ")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001981#if 0 // TDLS_hklee: D13 no need to open Addr2 unknown data packet
1982 /* restore RXP filters */
1983 limSetLinkState(pMac, eSIR_LINK_FINISH_TDLS_DISCOVERY_STATE,
1984 psessionEntry->bssId) ;
1985#endif
1986 limSendSmeTdlsDisRsp(pMac, eSIR_SUCCESS,
1987 eWNI_SME_TDLS_DISCOVERY_START_RSP) ;
1988 break ;
1989 }
1990
1991 /*
1992 * we initiated link setup and did not receive TDLS setup rsp
1993 * from TDLS peer STA, send failure RSP to SME.
1994 */
1995 case SIR_LIM_TDLS_LINK_SETUP_RSP_TIMEOUT:
1996 {
1997 tANI_U8 *peerMac = (tANI_U8 *)limMsg->bodyval ;
1998 tLimTdlsLinkSetupPeer *setupPeer = NULL ;
1999
2000 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002001 ("TDLS setup rsp timer expires ")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002002 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Arif Hussaina7c8e412013-11-20 11:06:42 -08002003 ("TDLS setup rsp timer expires for peer:"
2004 MAC_ADDRESS_STR), MAC_ADDR_ARRAY(peerMac));
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002005
2006 limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ;
2007 if(NULL != setupPeer)
2008 {
2009 limTdlsDelLinkPeer( pMac, peerMac) ;
2010 }
2011
2012 limSendSmeTdlsLinkStartRsp(pMac, eSIR_FAILURE, peerMac,
2013 eWNI_SME_TDLS_LINK_START_RSP) ;
2014 break ;
2015 }
2016 case SIR_LIM_TDLS_LINK_SETUP_CNF_TIMEOUT:
2017 {
2018 tANI_U8 *peerMac = (tANI_U8 *)limMsg->bodyval ;
2019 tLimTdlsLinkSetupPeer *setupPeer = NULL ;
2020
2021 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002022 ("TDLS setup CNF timer expires ")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002023 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Arif Hussaina7c8e412013-11-20 11:06:42 -08002024 ("TDLS setup CNF timer expires for peer: "
2025 MAC_ADDRESS_STR), MAC_ADDR_ARRAY(peerMac));
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002026 limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ;
2027 if(NULL != setupPeer)
2028 {
2029 limTdlsDelLinkPeer( pMac, peerMac) ;
2030 }
2031 break ;
2032 }
2033#endif /* FEATURE_WLAN_TDLS TIMER */
Jeff Johnson295189b2012-06-20 16:38:30 -07002034 case WDA_ADD_BSS_RSP:
2035 limProcessMlmAddBssRsp( pMac, limMsg );
2036 break;
2037
2038 case WDA_ADD_STA_RSP:
2039
2040 //call a wrapper by paasing bodyptr, their get sessionID and and call proper function from there.
2041 limProcessAddStaRsp(pMac,limMsg);
2042 break;
2043
2044 case WDA_DELETE_STA_RSP:
2045 limProcessMlmDelStaRsp(pMac, limMsg);
2046 break;
2047
2048 case WDA_ADD_STA_SELF_RSP:
2049 limProcessAddStaSelfRsp(pMac, limMsg);
2050 break;
2051 case WDA_DEL_STA_SELF_RSP:
2052 limProcessDelStaSelfRsp(pMac, limMsg);
2053 break;
2054
2055 case WDA_DELETE_BSS_RSP:
2056 limHandleDeleteBssRsp(pMac,limMsg); //wrapper routine to handle delete bss response
2057 break;
2058
2059 case WDA_SET_BSSKEY_RSP:
2060 case WDA_SET_STA_BCASTKEY_RSP:
2061 limProcessMlmSetBssKeyRsp( pMac, limMsg );
2062 break;
2063 case WDA_SET_STAKEY_RSP:
2064 limProcessMlmSetStaKeyRsp( pMac, limMsg );
2065 break;
2066 case WDA_REMOVE_BSSKEY_RSP:
2067 case WDA_REMOVE_STAKEY_RSP:
2068 limProcessMlmRemoveKeyRsp( pMac, limMsg );
2069 break;
2070 case WDA_ADDBA_RSP:
2071 limProcessMlmHalAddBARsp( pMac, limMsg );
2072 break;
2073
2074 case WDA_STA_STAT_RSP:
2075 case WDA_AGGR_STAT_RSP:
2076 case WDA_GLOBAL_STAT_RSP:
2077 case WDA_STAT_SUMM_RSP:
2078 limSendSmeStatsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
2079 break;
2080
2081 case WDA_GET_STATISTICS_RSP:
2082 limSendSmePEStatisticsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
2083 break;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08002084#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR)
Srinivas Girigowdad34cedb2013-01-25 13:33:11 -08002085 case WDA_GET_ROAM_RSSI_RSP:
2086 limSendSmePEGetRoamRssiRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
2087 break;
2088#endif
2089
Jeff Johnson295189b2012-06-20 16:38:30 -07002090
2091 case WDA_SET_MIMOPS_RSP: //limProcessSetMimoRsp(pMac, limMsg);
2092 case WDA_SET_TX_POWER_RSP: //limProcessSetTxPowerRsp(pMac, limMsg);
2093 case WDA_GET_TX_POWER_RSP: //limProcessGetTxPowerRsp(pMac, limMsg);
2094 case WDA_GET_NOISE_RSP:
2095 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2096 limMsg->bodyptr = NULL;
2097 //limProcessGetNoiseRsp(pMac, limMsg);
2098 break;
2099
2100 case WDA_SET_MAX_TX_POWER_RSP:
2101#if defined WLAN_FEATURE_VOWIFI
2102 rrmSetMaxTxPowerRsp( pMac, limMsg );
2103#endif
2104 if(limMsg->bodyptr != NULL)
2105 {
2106 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2107 limMsg->bodyptr = NULL;
2108 }
2109 break;
2110
Jeff Johnson295189b2012-06-20 16:38:30 -07002111 case SIR_LIM_ADDR2_MISS_IND:
2112 {
2113 limLog(pMac, LOGE,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002114 FL("Addr2 mismatch interrupt received %X"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002115 limMsg->type);
2116 /*a message from HAL indicating addr2 mismatch interrupt occurred
2117 limMsg->bodyptr contains only pointer to 48-bit addr2 field*/
2118 //Dinesh fix this. the third parameter should be sessionentry.
2119 //limHandleUnknownA2IndexFrames(pMac, (void *)limMsg->bodyptr);
2120
2121 /*Free message body pointer*/
2122 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08002123 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07002124 break;
2125 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002126
2127#ifdef WLAN_FEATURE_VOWIFI_11R
2128 case WDA_AGGR_QOS_RSP:
2129 limProcessFTAggrQoSRsp( pMac, limMsg );
2130 break;
2131#endif
2132
2133 case WDA_SET_LINK_STATE_RSP:
2134 linkStateParams = (tLinkStateParams *)limMsg->bodyptr;
2135#if defined WLAN_FEATURE_VOWIFI_11R
2136 pSession = linkStateParams->session;
2137 if(linkStateParams->ft)
2138 {
2139 limSendReassocReqWithFTIEsMgmtFrame(pMac,
2140 pSession->pLimMlmReassocReq,
2141 pSession);
2142 }
2143#endif
2144 if( linkStateParams->callback )
2145 {
2146 linkStateParams->callback( pMac, linkStateParams->callbackArg );
2147 }
2148 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08002149 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07002150 break;
2151
2152#ifdef WLAN_FEATURE_PACKET_FILTERING
2153 case WDA_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP:
2154 pmmProcessMessage(pMac, limMsg);
2155 break;
2156#endif // WLAN_FEATURE_PACKET_FILTERING
2157
2158#ifdef WLAN_FEATURE_GTK_OFFLOAD
2159 case WDA_GTK_OFFLOAD_GETINFO_RSP:
2160 pmmProcessMessage(pMac, limMsg);
2161 break;
2162#endif // WLAN_FEATURE_GTK_OFFLOAD
Yathish9f22e662012-12-10 14:21:35 -08002163 case eWNI_SME_SET_BCN_FILTER_REQ:
2164 {
2165#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2166 tpPESession psessionEntry;
2167 tANI_U8 sessionId = (tANI_U8)limMsg->bodyval ;
2168 psessionEntry = &pMac->lim.gpSession[sessionId];
2169 if(psessionEntry != NULL && IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
2170 {
2171 // sending beacon filtering information down to HAL
2172 if (limSendBeaconFilterInfo(pMac, psessionEntry) != eSIR_SUCCESS)
2173 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002174 limLog(pMac, LOGE, FL("Fail to send Beacon Filter Info "));
Yathish9f22e662012-12-10 14:21:35 -08002175 }
2176 }
Dhanashri Atred7885c22013-03-29 11:19:05 -07002177 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
2178 limMsg->bodyptr = NULL;
Yathish9f22e662012-12-10 14:21:35 -08002179#endif
2180 }
2181 break;
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302182 case eWNI_SME_HT40_OBSS_SCAN_IND:
2183 {
Sandeep Puligilla9f384742014-04-11 02:27:04 +05302184 tpPESession psessionEntry = NULL;
2185 tANI_U8 sessionId;
2186 tSirSmeHT40OBSSScanInd *ht40ScanInd =
Siddharth Bhald31c1252014-05-05 19:34:14 +05302187 (tSirSmeHT40OBSSScanInd *)limMsg->bodyptr;
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302188
Sandeep Puligilla9f384742014-04-11 02:27:04 +05302189 psessionEntry = peFindSessionByBssid(pMac, ht40ScanInd->peerMacAddr,
Siddharth Bhald31c1252014-05-05 19:34:14 +05302190 &sessionId);
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302191
Siddharth Bhald31c1252014-05-05 19:34:14 +05302192 if (psessionEntry != NULL)
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302193 {
Siddharth Bhald31c1252014-05-05 19:34:14 +05302194 if( IS_HT40_OBSS_SCAN_FEATURE_ENABLE &&
2195 psessionEntry->htSupportedChannelWidthSet ==
2196 WNI_CFG_CHANNEL_BONDING_MODE_ENABLE )
2197 {
2198 VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO,
2199 "OBSS Scan Start Req: session id %d"
2200 "htSupportedChannelWidthSet %d", psessionEntry->peSessionId,
2201 psessionEntry->htSupportedChannelWidthSet);
2202 limSendHT40OBSSScanInd(pMac, psessionEntry);
2203 }
2204 else
2205 {
2206 VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO,
2207 "OBSS Scan not started: htSupportedChannelWidthSet- %d"
2208 " session id %d", psessionEntry->htSupportedChannelWidthSet,
2209 psessionEntry->peSessionId);
2210 }
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302211 }
2212 else
2213 {
2214 VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO,
Siddharth Bhald31c1252014-05-05 19:34:14 +05302215 "OBSS Scan not started: session id is NULL");
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302216 }
2217 vos_mem_free(limMsg->bodyptr);
2218 limMsg->bodyptr = NULL;
2219 }
2220 break;
2221 case eWNI_SME_HT40_STOP_OBSS_SCAN_IND:
2222 {
2223 tpPESession psessionEntry = NULL;
2224 tANI_U8 sessionId = (tANI_U8)limMsg->bodyval ;
2225
2226 psessionEntry = &pMac->lim.gpSession[sessionId];
2227 /* Sending LIM STOP OBSS SCAN Indication
2228 Stop command support is only for debugging purpose */
2229 if ( IS_HT40_OBSS_SCAN_FEATURE_ENABLE )
2230 limSendHT40OBSSStopScanInd(pMac, psessionEntry);
2231 else
2232 VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_ERROR,
2233 "OBSS Scan Stop not started ");
2234 }
2235 break;
Hardik Kantilal Patel62a3a762014-11-21 12:55:57 +05302236#ifdef WLAN_FEATURE_AP_HT40_24G
2237 case eWNI_SME_SET_HT_2040_MODE:
2238 limProcessSmeReqMessages(pMac, limMsg);
2239 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2240 limMsg->bodyptr = NULL;
2241 break;
2242#endif
2243
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05302244#ifdef FEATURE_WLAN_TDLS
2245 case WDA_SET_TDLS_LINK_ESTABLISH_REQ_RSP:
2246 {
Gopichand Nakkala24be5312013-07-02 16:47:12 +05302247 tpPESession psessionEntry;
2248 tANI_U8 sessionId;
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05302249 tTdlsLinkEstablishParams *pTdlsLinkEstablishParams;
2250 pTdlsLinkEstablishParams = (tTdlsLinkEstablishParams*) limMsg->bodyptr;
Gopichand Nakkala24be5312013-07-02 16:47:12 +05302251
2252 if((psessionEntry = peFindSessionByStaId(pMac,
2253 pTdlsLinkEstablishParams->staIdx,
2254 &sessionId))== NULL)
2255 {
2256 limLog(pMac, LOGE, FL("session %u does not exist.\n"), sessionId);
2257 /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP message to SME
2258 with session id as zero and status as FAILURE so, that message
2259 queued in SME queue can be freed to prevent the SME cmd buffer leak */
2260 limSendSmeTdlsLinkEstablishReqRsp(pMac,
2261 0,
2262 NULL,
2263 NULL,
2264 eSIR_FAILURE);
2265 }
2266 else
2267 {
2268 limSendSmeTdlsLinkEstablishReqRsp(pMac,
2269 psessionEntry->smeSessionId,
2270 NULL,
2271 NULL,
2272 pTdlsLinkEstablishParams->status) ;
2273 }
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05302274 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
2275 limMsg->bodyptr = NULL;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05302276 break;
2277 }
Atul Mittal60bd4292014-08-14 12:19:27 +05302278
2279 case WDA_SET_TDLS_CHAN_SWITCH_REQ_RSP:
2280 {
2281 tpPESession psessionEntry;
2282 tANI_U8 sessionId;
2283 tTdlsChanSwitchParams *pTdlsChanSwitchParams;
2284 pTdlsChanSwitchParams = (tTdlsChanSwitchParams*) limMsg->bodyptr;
2285
2286 if((psessionEntry = peFindSessionByStaId(pMac,
2287 pTdlsChanSwitchParams->staIdx,
2288 &sessionId))== NULL)
2289 {
2290 limLog(pMac, LOGE, FL("session %u does not exist.\n"), sessionId);
2291 /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP message to SME
2292 with session id as zero and status as FAILURE so, that message
2293 queued in SME queue can be freed to prevent the SME cmd buffer leak */
2294 limSendSmeTdlsChanSwitchReqRsp(pMac,
2295 0,
2296 NULL,
2297 NULL,
2298 eSIR_FAILURE);
2299 }
2300 else
2301 {
2302 limSendSmeTdlsChanSwitchReqRsp(pMac,
2303 psessionEntry->smeSessionId,
2304 NULL,
2305 NULL,
2306 pTdlsChanSwitchParams->status) ;
2307 }
2308 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
2309 limMsg->bodyptr = NULL;
2310 break;
2311 }
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05302312#endif
Gopichand Nakkala2c231c82013-06-11 17:49:16 +05302313
2314 case WDA_RX_SCAN_EVENT:
2315 limProcessRxScanEvent(pMac, limMsg->bodyptr);
2316 break;
2317
Ravi Joshid2ca7c42013-07-23 08:37:49 -07002318 case WDA_IBSS_PEER_INACTIVITY_IND:
2319 {
2320 limProcessIbssPeerInactivity(pMac, limMsg->bodyptr);
2321 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
2322 limMsg->bodyptr = NULL;
2323 break;
2324 }
2325
Siddharth Bhal4f3187c2014-10-09 21:38:08 +05302326 case WDA_SPOOF_MAC_ADDR_RSP:
2327 limProcessMlmSpoofMacAddrRsp(pMac, (tSirRetStatus)limMsg->bodyval);
2328 break;
2329
Jeff Johnson295189b2012-06-20 16:38:30 -07002330 default:
2331 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2332 limMsg->bodyptr = NULL;
2333 // Unwanted messages
2334 // Log error
2335 limLog(pMac, LOGE,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002336 FL("Discarding unexpected message received %X"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002337 limMsg->type);
2338 limPrintMsgName(pMac, LOGE, limMsg->type);
2339 break;
2340
2341 } // switch (limMsg->type)
2342
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002343 PELOG2(limLog(pMac, LOG2, FL("Done Processing msgType = %d, sme state = %s, mlm state = %s"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002344 limMsg->type, limSmeStateStr(pMac->lim.gLimSmeState),
2345 limMlmStateStr(pMac->lim.gLimMlmState));)
2346
2347} /*** end limProcessMessages() ***/
2348
2349
2350
2351/**
2352 * limProcessDeferredMessageQueue
2353 *
2354 *FUNCTION:
2355 * This function is called by LIM while exiting from Learn
2356 * mode. This function fetches messages posted to the LIM
2357 * deferred message queue limDeferredMsgQ.
2358 *
2359 *LOGIC:
2360 *
2361 *ASSUMPTIONS:
2362 * NA
2363 *
2364 *NOTE:
2365 * NA
2366 *
2367 * @param pMac - Pointer to Global MAC structure
2368 * @return None
2369 */
2370
2371void
2372limProcessDeferredMessageQueue(tpAniSirGlobal pMac)
2373{
2374 tSirMsgQ limMsg = { 0, 0, 0 };
2375
Jeff Johnson295189b2012-06-20 16:38:30 -07002376 tSirMsgQ *readMsg;
2377 tANI_U16 size;
2378
2379 /*
2380 ** check any deferred messages need to be processed
2381 **/
2382 size = pMac->lim.gLimDeferredMsgQ.size;
2383 if (size > 0)
2384 {
2385 while ((readMsg = limReadDeferredMsgQ(pMac)) != NULL)
2386 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302387 vos_mem_copy((tANI_U8*) &limMsg,
Jeff Johnson295189b2012-06-20 16:38:30 -07002388 (tANI_U8*) readMsg, sizeof(tSirMsgQ));
2389 size--;
2390 limProcessMessages(pMac, &limMsg);
2391
2392 if((limIsSystemInScanState(pMac)) || (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) ||
2393 (pMac->lim.gLimSystemInScanLearnMode))
2394 break;
2395 }
2396 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002397} /*** end limProcessDeferredMessageQueue() ***/
2398
2399
2400/*
2401 * limProcessNormalHddMsg
2402 * Function: this function checks the current lim state and decide whether the message passed shall be deffered.
2403 * @param pMac - Pointer to Global MAC structure
2404 * pLimMsg -- the message need to be processed
2405 * fRspReqd -- whether return result to hdd
2406 * @return None
2407 */
2408void limProcessNormalHddMsg(tpAniSirGlobal pMac, tSirMsgQ *pLimMsg, tANI_U8 fRspReqd)
2409{
2410 tANI_BOOLEAN fDeferMsg = eANI_BOOLEAN_TRUE;
2411
2412 /* Added For BT-AMP Support */
2413 if ((pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_AP_ROLE )
2414 ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_STA_ROLE)
2415 ||(pMac->lim.gLimSystemRole == eLIM_UNKNOWN_ROLE))
2416 {
2417 /** This check is required only for the AP and in 2 cases.
2418 * 1. If we are in learn mode and we receive any of these messages,
2419 * you have to come out of scan and process the message, hence dont
2420 * defer the message here. In handler, these message could be defered
2421 * till we actually come out of scan mode.
2422 * 2. If radar is detected, you might have to defer all of these
2423 * messages except Stop BSS request/ Switch channel request. This
2424 * decision is also made inside its handler.
2425 *
2426 * Please be careful while using the flag fDeferMsg. Possibly you
2427 * might end up in an infinite loop.
2428 **/
2429 if (((pLimMsg->type == eWNI_SME_START_BSS_REQ) ||
2430 (pLimMsg->type == eWNI_SME_STOP_BSS_REQ) ||
2431 (pLimMsg->type == eWNI_SME_SWITCH_CHL_REQ) ||
2432 (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ) ||
2433 (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ)))
2434 {
2435 fDeferMsg = eANI_BOOLEAN_FALSE;
2436 }
2437 }
2438
2439 /* limInsystemInscanState() refers the psessionEntry, how to get session Entry????*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002440 if (((pMac->lim.gLimAddtsSent) || (limIsSystemInScanState(pMac)) /*||
2441 (LIM_IS_RADAR_DETECTED(pMac))*/) && fDeferMsg)
Jeff Johnson295189b2012-06-20 16:38:30 -07002442 {
2443 // System is in DFS (Learn) mode or awaiting addts response
2444 // or if radar is detected, Defer processsing this message
2445 if (limDeferMsg(pMac, pLimMsg) != TX_SUCCESS)
2446 {
2447#ifdef WLAN_DEBUG
2448 pMac->lim.numSme++;
2449#endif
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002450 PELOGE(limLog(pMac, LOGE, FL("Unable to Defer message(0x%X) limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002451 pLimMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
2452 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
2453 limLogSessionStates(pMac);
2454 limPrintMsgName(pMac, LOGE, pLimMsg->type);
2455 // Release body
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302456 vos_mem_free(pLimMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08002457 pLimMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07002458 }
2459 }
2460 else
2461 {
2462 if(fRspReqd)
2463 {
2464 // These messages are from HDD
2465 // Since these requests may also be generated
2466 // internally within LIM module, need to
2467 // distinquish and send response to host
2468 pMac->lim.gLimRspReqd = eANI_BOOLEAN_TRUE;
2469 }
2470#ifdef WLAN_DEBUG
2471 pMac->lim.numSme++;
2472#endif
2473 if(limProcessSmeReqMessages(pMac, pLimMsg))
2474 {
2475 // Release body
2476 // limProcessSmeReqMessage consumed the buffer. We can free it.
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302477 vos_mem_free(pLimMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08002478 pLimMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07002479 }
2480 }
2481}
2482
2483void
Jeff Johnsone7245742012-09-05 17:12:55 -07002484handleHTCapabilityandHTInfo(struct sAniSirGlobal *pMac, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07002485{
2486 tSirMacHTCapabilityInfo macHTCapabilityInfo;
2487 tSirMacHTParametersInfo macHTParametersInfo;
2488 tSirMacHTInfoField1 macHTInfoField1;
2489 tSirMacHTInfoField2 macHTInfoField2;
2490 tSirMacHTInfoField3 macHTInfoField3;
2491 tANI_U32 cfgValue;
2492 tANI_U8 *ptr;
Jeff Johnson295189b2012-06-20 16:38:30 -07002493
Jeff Johnson295189b2012-06-20 16:38:30 -07002494 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_CAP_INFO, &cfgValue) != eSIR_SUCCESS)
2495 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002496 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_CAP_INFO value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002497 return ;
2498 }
2499 ptr = (tANI_U8 *) &macHTCapabilityInfo;
2500 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2501 pMac->lim.gHTLsigTXOPProtection = (tANI_U8)macHTCapabilityInfo.lsigTXOPProtection;
2502 pMac->lim.gHTMIMOPSState = (tSirMacHTMIMOPowerSaveState) macHTCapabilityInfo.mimoPowerSave;
2503 pMac->lim.gHTGreenfield = (tANI_U8)macHTCapabilityInfo.greenField;
2504 pMac->lim.gHTMaxAmsduLength = (tANI_U8)macHTCapabilityInfo.maximalAMSDUsize;
2505 pMac->lim.gHTShortGI20Mhz = (tANI_U8)macHTCapabilityInfo.shortGI20MHz;
2506 pMac->lim.gHTShortGI40Mhz = (tANI_U8)macHTCapabilityInfo.shortGI40MHz;
Jeff Johnson295189b2012-06-20 16:38:30 -07002507 pMac->lim.gHTPSMPSupport = (tANI_U8)macHTCapabilityInfo.psmp;
2508 pMac->lim.gHTDsssCckRate40MHzSupport = (tANI_U8)macHTCapabilityInfo.dsssCckMode40MHz;
2509
2510 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_AMPDU_PARAMS, &cfgValue) != eSIR_SUCCESS)
2511 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002512 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_PARAM_INFO value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002513 return ;
2514 }
2515 ptr = (tANI_U8 *) &macHTParametersInfo;
2516 *ptr = (tANI_U8) (cfgValue & 0xff);
2517 pMac->lim.gHTAMpduDensity = (tANI_U8)macHTParametersInfo.mpduDensity;
2518 pMac->lim.gHTMaxRxAMpduFactor = (tANI_U8)macHTParametersInfo.maxRxAMPDUFactor;
2519
2520 // Get HT IE Info
2521 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD1, &cfgValue) != eSIR_SUCCESS)
2522 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002523 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD1 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002524 return ;
2525 }
2526 ptr = (tANI_U8 *) &macHTInfoField1;
2527 *((tANI_U8 *)ptr) = (tANI_U8) (cfgValue & 0xff);
2528 pMac->lim.gHTServiceIntervalGranularity = (tANI_U8)macHTInfoField1.serviceIntervalGranularity;
2529 pMac->lim.gHTControlledAccessOnly = (tANI_U8)macHTInfoField1.controlledAccessOnly;
2530 pMac->lim.gHTRifsMode = (tANI_U8)macHTInfoField1.rifsMode;
Jeff Johnson295189b2012-06-20 16:38:30 -07002531
2532 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD2, &cfgValue) != eSIR_SUCCESS)
2533 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002534 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD2 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002535 return ;
2536 }
2537 ptr = (tANI_U8 *) &macHTInfoField2;
2538 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2539 pMac->lim.gHTOperMode = (tSirMacHTOperatingMode) macHTInfoField2.opMode;
2540
2541 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD3, &cfgValue) != eSIR_SUCCESS)
2542 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002543 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD3 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002544 return ;
2545 }
2546 ptr = (tANI_U8 *) &macHTInfoField3;
2547 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2548 pMac->lim.gHTPCOActive = (tANI_U8)macHTInfoField3.pcoActive;
2549 pMac->lim.gHTPCOPhase = (tANI_U8)macHTInfoField3.pcoPhase;
Jeff Johnson295189b2012-06-20 16:38:30 -07002550 pMac->lim.gHTSecondaryBeacon = (tANI_U8)macHTInfoField3.secondaryBeacon;
2551 pMac->lim.gHTDualCTSProtection = (tANI_U8)macHTInfoField3.dualCTSProtection;
2552 pMac->lim.gHTSTBCBasicMCS = (tANI_U8)macHTInfoField3.basicSTBCMCS;
Jeff Johnsone7245742012-09-05 17:12:55 -07002553
2554 /* The lim globals for channelwidth and secondary chnl have been removed and should not be used during no session;
2555 * instead direct cfg is read and used when no session for transmission of mgmt frames (same as old);
2556 * For now, we might come here during init and join with sessionEntry = NULL; in that case just fill the globals which exist
2557 * Sessionized entries values will be filled in join or add bss req. The ones which are missed in join are filled below
2558 */
2559 if (psessionEntry != NULL)
2560 {
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302561 psessionEntry->htCapability =
2562 IS_DOT11_MODE_HT(psessionEntry->dot11mode);
2563 psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport =
2564 (tANI_U8)macHTInfoField3.lsigTXOPProtectionFullSupport;
Sandeep Puligilla70b6b162014-04-19 02:06:04 +05302565 limInitOBSSScanParams(pMac, psessionEntry);
Jeff Johnsone7245742012-09-05 17:12:55 -07002566 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002567}
2568
2569void limLogSessionStates(tpAniSirGlobal pMac)
2570{
2571#ifdef WLAN_DEBUG
2572 int i;
2573
2574 for(i = 0; i < pMac->lim.maxBssId; i++)
2575 {
2576 if(pMac->lim.gpSession[i].valid)
2577 {
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302578 limLog(pMac, LOG1, FL("Session[%d] sysRole(%d) limSmeState %d "
2579 "(prev sme state %d) mlm state %d (prev mlm state %d)"),
2580 i, pMac->lim.gpSession[i].limSystemRole,
2581 pMac->lim.gpSession[i].limSmeState,
2582 pMac->lim.gpSession[i].limPrevSmeState,
2583 pMac->lim.gpSession[i].limMlmState,
2584 pMac->lim.gpSession[i].limPrevMlmState);
Jeff Johnson295189b2012-06-20 16:38:30 -07002585 }
2586 }
2587#endif //ifdef WLAN_DEBUG
2588}