blob: a140f95f46180c43520a5af55afc857d6911dfe9 [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 {
810 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr);
811 return;
812 }
813 }
814#endif
815 if((fc.subType != SIR_MAC_MGMT_PROBE_RSP )&&
816 (fc.subType != SIR_MAC_MGMT_BEACON)&&
817 (fc.subType != SIR_MAC_MGMT_PROBE_REQ)
Jeff Johnson295189b2012-06-20 16:38:30 -0700818 && (fc.subType != SIR_MAC_MGMT_ACTION ) //Public action frame can be received from non-associated stations.
Jeff Johnson295189b2012-06-20 16:38:30 -0700819 )
820 {
821
822 if((psessionEntry = peFindSessionByPeerSta(pMac,pHdr->sa,&sessionId))== NULL)
823 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700824 limLog(pMac, LOG1, FL("session does not exist for given bssId"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700825 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr);
826 return;
827 }
Padma, Santhosh Kumar2b47ca82014-01-03 16:57:27 +0530828 else
829 limLog(pMac,LOG1,"SessionId:%d Session Exist for given Bssid",
830 psessionEntry->peSessionId);
Gopichand Nakkala6265d6f2013-03-20 23:32:50 +0530831 }
832 // For p2p resp frames search for valid session with DA as
833 // BSSID will be SA and session will be present with DA only
834 if(fc.subType == SIR_MAC_MGMT_ACTION )
835 {
836 psessionEntry = peFindSessionByBssid(pMac,pHdr->da,&sessionId);
837 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700838 }
839
840
Jeff Johnson295189b2012-06-20 16:38:30 -0700841 /* Check if frame is registered by HDD */
842 if(limCheckMgmtRegisteredFrames(pMac, pRxPacketInfo, psessionEntry))
843 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700844 limLog( pMac, LOG1, FL("Received frame is passed to SME"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700845 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr);
846 return;
847 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700848
849
Jeff Johnson295189b2012-06-20 16:38:30 -0700850
851 if (fc.protVer != SIR_MAC_PROTOCOL_VERSION)
852 { // Received Frame with non-zero Protocol Version
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700853 limLog(pMac, LOGE, FL("Unexpected frame with protVersion %d received"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700854 fc.protVer);
855 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr);
856#ifdef WLAN_DEBUG
857 pMac->lim.numProtErr++;
858#endif
859 return;
860 }
861
Gopichand Nakkala2c231c82013-06-11 17:49:16 +0530862 if (!pMac->fScanOffload)
Jeff Johnson295189b2012-06-20 16:38:30 -0700863 {
Gopichand Nakkala2c231c82013-06-11 17:49:16 +0530864 if (limIsSystemInScanState(pMac))
865 {
866 limHandleFramesInScanState(pMac, limMsg, pRxPacketInfo, pDeferMsg, psessionEntry);
867 return;
868 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700869 }
870
871/* Chance of crashing : to be done BT-AMP ........happens when broadcast probe req is received */
872
873#if 0
874 if (psessionEntry->limSystemRole == eLIM_UNKNOWN_ROLE) {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700875 limLog( pMac, LOGW, FL( "gLimSystemRole is %d. Exiting..." ),psessionEntry->limSystemRole );
Jeff Johnson295189b2012-06-20 16:38:30 -0700876 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr);
877
878#ifdef WLAN_DEBUG
879 pMac->lim.numProtErr++;
880#endif
881 return;
882 }
883 #endif //HACK to continue scanning
884
885
886#ifdef WLAN_DEBUG
887 pMac->lim.numMAC[fc.type][fc.subType]++;
888#endif
889
890 switch (fc.type)
891 {
892 case SIR_MAC_MGMT_FRAME:
893 {
894 #if 0 //TBD-RAJESH fix this
895 if (limIsReassocInProgress( pMac,psessionEntry) && (fc.subType != SIR_MAC_MGMT_DISASSOC) &&
896 (fc.subType != SIR_MAC_MGMT_DEAUTH) && (fc.subType != SIR_MAC_MGMT_REASSOC_RSP))
897 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700898 limLog(pMac, LOGE, FL("Frame with Type - %d, Subtype - %d received in ReAssoc Wait state, dropping..."),
Jeff Johnson295189b2012-06-20 16:38:30 -0700899 fc.type, fc.subType);
900 return;
901 }
902 #endif //HACK to continue scanning
903 // Received Management frame
904 switch (fc.subType)
905 {
906 case SIR_MAC_MGMT_ASSOC_REQ:
907 // Make sure the role supports Association
908 if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700909 || (psessionEntry->limSystemRole == eLIM_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700910 )
911 limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_ASSOC, psessionEntry);
912
913 else
914 {
915 // Unwanted messages - Log error
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700916 limLog(pMac, LOGE, FL("unexpected message received %X"),limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -0700917 limPrintMsgName(pMac, LOGE, limMsg->type);
918 }
919 break;
920
921 case SIR_MAC_MGMT_ASSOC_RSP:
922 limProcessAssocRspFrame(pMac, pRxPacketInfo, LIM_ASSOC,psessionEntry);
923 break;
924
925 case SIR_MAC_MGMT_REASSOC_REQ:
926 // Make sure the role supports Reassociation
927 if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700928 || (psessionEntry->limSystemRole == eLIM_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700929 ){
930 limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_REASSOC, psessionEntry);
931 }
932 else
933 {
934 // Unwanted messages - Log error
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700935 limLog(pMac, LOGE, FL("unexpected message received %X"),limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -0700936 limPrintMsgName(pMac, LOGE, limMsg->type);
937 }
938 break;
939
940 case SIR_MAC_MGMT_REASSOC_RSP:
941 limProcessAssocRspFrame(pMac, pRxPacketInfo, LIM_REASSOC,psessionEntry);
942 break;
943
944 case SIR_MAC_MGMT_PROBE_REQ:
945 limProcessProbeReqFrame_multiple_BSS(pMac, pRxPacketInfo,psessionEntry);
946 break;
947
948 case SIR_MAC_MGMT_PROBE_RSP:
949 if(psessionEntry == NULL)
950 limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo);
951 else
952 limProcessProbeRspFrame(pMac, pRxPacketInfo, psessionEntry);
953 break;
954
955 case SIR_MAC_MGMT_BEACON:
956 __limHandleBeacon(pMac, limMsg,psessionEntry);
957 break;
958
959 case SIR_MAC_MGMT_DISASSOC:
960 limProcessDisassocFrame(pMac, pRxPacketInfo,psessionEntry);
961 break;
962
963 case SIR_MAC_MGMT_AUTH:
964 limProcessAuthFrame(pMac, pRxPacketInfo,psessionEntry);
965 break;
966
967 case SIR_MAC_MGMT_DEAUTH:
968 limProcessDeauthFrame(pMac, pRxPacketInfo,psessionEntry);
969 break;
970
971 case SIR_MAC_MGMT_ACTION:
Jeff Johnson295189b2012-06-20 16:38:30 -0700972 if(psessionEntry == NULL)
973 limProcessActionFrameNoSession(pMac, pRxPacketInfo);
974 else
975 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700976 if (WDA_GET_RX_UNKNOWN_UCAST(pRxPacketInfo))
977 limHandleUnknownA2IndexFrames(pMac, pRxPacketInfo,psessionEntry);
978 else
979 limProcessActionFrame(pMac, pRxPacketInfo,psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -0700980 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700981 break;
982 default:
983 // Received Management frame of 'reserved' subtype
984 break;
985 } // switch (fc.subType)
986
987 }
988 break;
Jeff Johnson295189b2012-06-20 16:38:30 -0700989 case SIR_MAC_DATA_FRAME:
990 {
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800991#ifdef FEATURE_WLAN_TDLS_INTERNAL
992 /*
993 * if we reach here, following cases are possible.
994 * Possible cases: a) if frame translation is disabled.
995 * b) Some frame with ADRR2 filter enabled may come
996 * here.
997 */
998 tANI_U8 *dataOffset = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
999 tANI_U8 *rfc1042Hdr = (tANI_U8 *)(dataOffset + RFC1042_HDR_LENGTH) ;
1000 tANI_U16 ethType = GET_BE16(rfc1042Hdr) ;
1001 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001002 ("TDLS frame with 80211 Header")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001003 if(ETH_TYPE_89_0d == ethType)
1004 {
1005 tANI_U8 payloadType = (rfc1042Hdr + ETH_TYPE_LEN)[0] ;
1006 if(PAYLOAD_TYPE_TDLS == payloadType)
1007 {
1008 limProcessTdlsFrame(pMac, (tANI_U32*)pRxPacketInfo) ;
1009 }
1010 }
1011#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001012#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -07001013 /* We accept data frame (IAPP frame) only if Session is
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001014 * present and ese connection is established on that
Jeff Johnson295189b2012-06-20 16:38:30 -07001015 * session
1016 */
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001017 if (psessionEntry && psessionEntry->isESEconnection) {
Jeff Johnson295189b2012-06-20 16:38:30 -07001018 limProcessIappFrame(pMac, pRxPacketInfo, psessionEntry);
1019 }
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001020#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001021 }
1022 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001023 default:
1024 // Received frame of type 'reserved'
1025 break;
1026
1027 } // switch (fc.type)
1028
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -07001029#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
1030end:
1031#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001032 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr) ;
1033 return;
1034} /*** end limHandle80211Frames() ***/
1035
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301036/**
1037 * limSendStopScanOffloadReq()
1038 *
1039 *FUNCTION:
1040 * This function will be called to abort the ongoing offloaded scan
1041 * request.
1042 *
1043 *
1044 *NOTE:
1045 *
1046 * @param pMac Pointer to Global MAC structure
1047 * @return eHAL_STATUS_SUCCESS or eHAL_STATUS_FAILURE
1048 */
1049eHalStatus limSendStopScanOffloadReq(tpAniSirGlobal pMac, tANI_U8 SessionId)
1050{
1051 tSirMsgQ msg;
1052 tSirRetStatus rc = eSIR_SUCCESS;
1053 tAbortScanParams *pAbortScanParams;
1054
Kiet Lamb1233192013-11-28 13:38:20 +05301055 pAbortScanParams = vos_mem_malloc(sizeof(tAbortScanParams));
1056 if (NULL == pAbortScanParams)
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301057 {
1058 limLog(pMac, LOGP, FL("Memory allocation failed for AbortScanParams"));
1059 return eHAL_STATUS_FAILURE;
1060 }
1061
1062 pAbortScanParams->SessionId = SessionId;
1063 msg.type = WDA_STOP_SCAN_OFFLOAD_REQ;
1064 msg.bodyptr = pAbortScanParams;
1065 msg.bodyval = 0;
1066
1067 rc = wdaPostCtrlMsg(pMac, &msg);
1068 if (rc != eSIR_SUCCESS)
1069 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001070 limLog(pMac, LOGE, FL("wdaPostCtrlMsg() return failure"));
Kiet Lamb1233192013-11-28 13:38:20 +05301071 vos_mem_free(pAbortScanParams);
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301072 return eHAL_STATUS_FAILURE;
1073 }
1074
Rashmi Ramanna6c13a342014-01-07 11:44:07 +05301075 limLog(pMac, LOG1, FL("Abort ongoing offload scan."));
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301076 return eHAL_STATUS_SUCCESS;
1077
1078}
Jeff Johnson295189b2012-06-20 16:38:30 -07001079
1080/**
1081 * limProcessAbortScanInd()
1082 *
1083 *FUNCTION:
1084 * This function is called from HDD to abort the scan which is presently being run
1085 *
1086 *
1087 *NOTE:
1088 *
1089 * @param pMac Pointer to Global MAC structure
1090 * @param *pMsgBuf A pointer to the SME message buffer
1091 * @return None
1092 */
1093void
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301094limProcessAbortScanInd(tpAniSirGlobal pMac, tANI_U8 SessionId)
Jeff Johnson295189b2012-06-20 16:38:30 -07001095{
1096#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
1097 limDiagEventReport(pMac, WLAN_PE_DIAG_SCAN_ABORT_IND_EVENT, NULL, 0, 0);
1098#endif //FEATURE_WLAN_DIAG_SUPPORT
1099
1100 /* Deactivate the gLimBackgroundScanTimer as part of the abort scan.
1101 * SME should send WNI_CFG_BACKGROUND_SCAN_PERIOD indication
1102 * to start the background scan again
1103 */
Abhishek Singh525045c2014-12-15 17:18:45 +05301104 limLog(pMac, LOG1, FL("Processing AbortScan Ind"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001105
1106 limAbortBackgroundScan(pMac);
1107
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301108 if (pMac->fScanOffload)
Jeff Johnson295189b2012-06-20 16:38:30 -07001109 {
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301110 /* send stop scan cmd to fw if scan offload is enabled. */
1111 limSendStopScanOffloadReq(pMac, SessionId);
1112 }
1113 else
1114 {
1115 /* Abort the scan if its running, else just return */
1116 if(limIsSystemInScanState(pMac))
Jeff Johnson295189b2012-06-20 16:38:30 -07001117 {
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301118 if( (eLIM_HAL_INIT_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
1119 (eLIM_HAL_START_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
1120 (eLIM_HAL_END_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
1121 (eLIM_HAL_FINISH_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState) )
1122 {
1123 //Simply signal we need to abort
1124 limLog( pMac, LOGW, FL(" waiting for HAL, simply signal abort gLimHalScanState = %d"), pMac->lim.gLimHalScanState );
1125 pMac->lim.abortScan = 1;
1126 }
1127 else
1128 {
1129 //Force abort
1130 limLog( pMac, LOGW, FL(" Force aborting scan") );
1131 pMac->lim.abortScan = 0;
1132 limDeactivateAndChangeTimer(pMac, eLIM_MIN_CHANNEL_TIMER);
1133 limDeactivateAndChangeTimer(pMac, eLIM_MAX_CHANNEL_TIMER);
1134 //Set the resume channel to Any valid channel (invalid).
1135 //This will instruct HAL to set it to any previous valid channel.
1136 peSetResumeChannel(pMac, 0, 0);
1137 limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE);
1138 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001139 }
1140 }
1141 return;
1142}
1143
1144/**
1145 * limMessageProcessor
1146 *
1147 *FUNCTION:
1148 * Wrapper function for limProcessMessages when handling messages received by LIM.
1149 * Could either defer messages or process them.
1150 * @param pMac Pointer to Global MAC structure
1151 * @param limMsg Received LIM message
1152 * @return None
1153 */
1154
1155void limMessageProcessor(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
1156{
1157 if (eLIM_MLM_OFFLINE_STATE == pMac->lim.gLimMlmState)
1158 {
1159 peFreeMsg(pMac, limMsg);
1160 return;
1161 }
1162
1163 if (!defMsgDecision(pMac, limMsg))
1164 {
1165 limProcessMessages(pMac, limMsg);
Jeff Johnson295189b2012-06-20 16:38:30 -07001166 // process deferred message queue if allowed
1167 {
1168 if ( (! (pMac->lim.gLimAddtsSent))
1169 &&
1170 (! (limIsSystemInScanState(pMac)))
1171 )
1172 {
1173 if (true == GET_LIM_PROCESS_DEFD_MESGS(pMac))
1174 limProcessDeferredMessageQueue(pMac);
1175 }
1176 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001177 }
1178}
1179
Jeff Johnsone7245742012-09-05 17:12:55 -07001180#ifdef FEATURE_OEM_DATA_SUPPORT
1181
1182void limOemDataRspHandleResumeLinkRsp(tpAniSirGlobal pMac, eHalStatus status, tANI_U32* mlmOemDataRsp)
1183{
1184 if(status != eHAL_STATUS_SUCCESS)
1185 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001186 limLog(pMac, LOGE, FL("OEM Data Rsp failed to get the response for resume link"));
Jeff Johnsone7245742012-09-05 17:12:55 -07001187 }
1188
1189 if(NULL != pMac->lim.gpLimMlmOemDataReq)
1190 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301191 vos_mem_free(pMac->lim.gpLimMlmOemDataReq);
Jeff Johnsone7245742012-09-05 17:12:55 -07001192 pMac->lim.gpLimMlmOemDataReq = NULL;
1193 }
1194
1195 //"Failure" status doesn't mean that Oem Data Rsp did not happen
1196 //and hence we need to respond to upper layers. Only Resume link is failed, but
1197 //we got the oem data response already.
1198 //Post the meessage to MLM
1199 limPostSmeMessage(pMac, LIM_MLM_OEM_DATA_CNF, (tANI_U32*)(mlmOemDataRsp));
1200
1201 return;
1202}
1203
1204void limProcessOemDataRsp(tpAniSirGlobal pMac, tANI_U32* body)
1205{
Jeff Johnsone7245742012-09-05 17:12:55 -07001206 tpLimMlmOemDataRsp mlmOemDataRsp = NULL;
1207 tpStartOemDataRsp oemDataRsp = NULL;
1208
1209 //Process all the messages for the lim queue
1210 SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
1211
1212 oemDataRsp = (tpStartOemDataRsp)(body);
1213
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301214 mlmOemDataRsp = vos_mem_malloc(sizeof(tLimMlmOemDataRsp));
1215 if ( NULL == mlmOemDataRsp )
Jeff Johnsone7245742012-09-05 17:12:55 -07001216 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001217 limLog(pMac, LOGP, FL("could not allocate memory for mlmOemDataRsp"));
Jeff Johnsone7245742012-09-05 17:12:55 -07001218 return;
1219 }
1220
1221 //copy the memory into tLimMlmOemDataRsp and free the tStartOemDataRsp
1222 //the structures tStartOemDataRsp and tLimMlmOemDataRsp have the same structure
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301223 vos_mem_copy((void*)(mlmOemDataRsp), (void*)(oemDataRsp),
1224 sizeof(tLimMlmOemDataRsp));
Jeff Johnsone7245742012-09-05 17:12:55 -07001225
1226 //Now free the incoming memory
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301227 vos_mem_free(oemDataRsp);
Jeff Johnsone7245742012-09-05 17:12:55 -07001228
1229 limResumeLink(pMac, limOemDataRspHandleResumeLinkRsp, (tANI_U32*)mlmOemDataRsp);
1230
1231 return;
1232}
1233
1234#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001235
Katya Nigam3802f202013-12-16 19:27:14 +05301236static tANI_BOOLEAN limAgeOutProbeReq( tpAniSirGlobal pMac, tpSirMsgQ limMsg,
1237 vos_pkt_t *pVosPkt )
1238{
1239 tANI_U8 *pRxPacketInfo = NULL;
1240 tSirMacFrameCtl fc;
1241 tpSirMacMgmtHdr pHdr=NULL;
1242 tANI_BOOLEAN match = VOS_FALSE;
1243
1244 limGetBDfromRxPacket(pMac, limMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo);
1245 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1246 fc = pHdr->fc;
1247 if ( fc.subType == SIR_MAC_MGMT_PROBE_REQ )
1248 {
1249 if( vos_timer_get_system_ticks() - pVosPkt->timestamp >= MAX_PROBEREQ_TIME )
1250 {
1251 // drop packet
1252 limLog(pMac, LOGE,
1253 FL("Dropping Aged Out probe requests. Peer MAC is "MAC_ADDRESS_STR),
1254 MAC_ADDR_ARRAY(pHdr->sa));
1255
1256 vos_pkt_return_packet(pVosPkt);
1257 match = VOS_TRUE;
1258 }
1259 }
1260 return match;
1261}
1262
Jeff Johnson295189b2012-06-20 16:38:30 -07001263/**
1264 * limProcessMessages
1265 *
1266 *FUNCTION:
1267 * This function is called by limProcessMessageQueue function. This
1268 * function processes messages received by LIM.
1269 *
1270 *LOGIC:
1271 * Depending on the message type, corresponding function will be
1272 * called, for example limProcessSmeMessages() will be called to
1273 * process SME messages received from HDD/Upper layer software module.
1274 *
1275 *ASSUMPTIONS:
1276 * NA
1277 *
1278 *NOTE:
1279 * NA
1280 *
1281 * @param pMac Pointer to Global MAC structure
1282 * @param limMsg Received LIM message
1283 * @return None
1284 */
1285
1286void
1287limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
1288{
1289 tANI_U8 deferMsg = false;
1290 tLinkStateParams *linkStateParams;
1291#if defined WLAN_FEATURE_VOWIFI_11R
1292 tpPESession pSession;
1293#endif
1294#if defined(ANI_DVT_DEBUG)
1295 tSirMsgQ msgQ;
1296#endif
1297 if(pMac->gDriverType == eDRIVER_TYPE_MFG)
1298 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301299 vos_mem_free(limMsg->bodyptr);
Jeff Johnsone7245742012-09-05 17:12:55 -07001300 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001301 return;
1302 }
1303#ifdef WLAN_DEBUG
1304 pMac->lim.numTot++;
1305#endif
1306
1307
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001308 PELOG3(limLog(pMac, LOG3, FL("rcvd msgType = %s, sme state = %s, mlm state = %s"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001309 limMsgStr(limMsg->type), limSmeStateStr(pMac->lim.gLimSmeState),
1310 limMlmStateStr(pMac->lim.gLimMlmState));)
1311
Jeff Johnsone7245742012-09-05 17:12:55 -07001312 MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(limMsg->type, LIM_MSG_PROCESSED));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001313
1314 switch (limMsg->type)
1315 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001316
1317 case SIR_LIM_UPDATE_BEACON:
1318 limUpdateBeacon(pMac);
1319 break;
1320
Jeff Johnson295189b2012-06-20 16:38:30 -07001321 case SIR_CFG_PARAM_UPDATE_IND:
1322 /// CFG parameter updated
1323 if (limIsSystemInScanState(pMac))
1324 {
1325 // System is in DFS (Learn) mode
1326 // Defer processsing this message
1327 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1328 {
Leela Venkata Kiran Kumar Reddy Chirala2247e962013-03-22 19:21:10 -07001329 if(!(pMac->lim.deferredMsgCnt & 0xF))
1330 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001331 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 -07001332 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1333 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
Leela Venkata Kiran Kumar Reddy Chirala2247e962013-03-22 19:21:10 -07001334 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001335 limLogSessionStates(pMac);
1336 limPrintMsgName(pMac, LOGE, limMsg->type);
1337 }
1338 }
1339 else
1340 {
1341 limHandleCFGparamUpdate(pMac, limMsg->bodyval);
1342 }
1343
1344 break;
1345
1346 case WDA_INIT_SCAN_RSP:
1347 limProcessInitScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001348 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001349 break;
1350
1351 case WDA_START_SCAN_RSP:
1352 limProcessStartScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001353 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001354 break;
1355
1356 case WDA_END_SCAN_RSP:
1357 limProcessEndScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001358 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001359 break;
1360
1361 case WDA_FINISH_SCAN_RSP:
1362 limProcessFinishScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001363 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001364 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001365#ifdef FEATURE_OEM_DATA_SUPPORT
1366 case WDA_START_OEM_DATA_RSP:
1367 limProcessOemDataRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001368 limMsg->bodyptr = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07001369 break;
1370#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001371
1372 case WDA_SWITCH_CHANNEL_RSP:
1373 limProcessSwitchChannelRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001374 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001375 break;
1376
1377#ifdef ANI_SIR_IBSS_PEER_CACHING
1378 case WDA_IBSS_STA_ADD:
1379 limIbssStaAdd(pMac, limMsg->bodyptr);
1380 break;
1381#endif
1382 case SIR_BB_XPORT_MGMT_MSG:
1383 // These messages are from Peer MAC entity.
1384#ifdef WLAN_DEBUG
1385 pMac->lim.numBbt++;
1386#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001387 {
1388 v_U16_t pktLen = 0;
1389 vos_pkt_t *pVosPkt;
1390 VOS_STATUS vosStatus;
1391 tSirMsgQ limMsgNew;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001392#ifdef FEATURE_WLAN_TDLS_INTERNAL
1393 tANI_U32 *pBD = NULL ;
1394#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001395
1396 /* The original limMsg which we were deferring have the
1397 * bodyPointer point to 'BD' instead of 'Vos pkt'. If we don't make a copy
1398 * of limMsg, then vos_pkt_peek_data will overwrite the limMsg->bodyPointer.
1399 * and next time when we try to process the msg, we will try to use 'BD' as
1400 * 'Vos Pkt' which will cause a crash
1401 */
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301402 vos_mem_copy((tANI_U8*)&limMsgNew, (tANI_U8*)limMsg,
1403 sizeof(tSirMsgQ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001404 pVosPkt = (vos_pkt_t *)limMsgNew.bodyptr;
1405 vos_pkt_get_packet_length(pVosPkt, &pktLen);
1406
1407 vosStatus = WDA_DS_PeekRxPacketInfo( pVosPkt, (v_PVOID_t *)&limMsgNew.bodyptr, VOS_FALSE );
1408
1409 if( !VOS_IS_STATUS_SUCCESS(vosStatus) )
1410 {
Katya Nigamfdf5a522015-02-03 14:38:55 +05301411 limDecrementPendingMgmtCount(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001412 vos_pkt_return_packet(pVosPkt);
1413 break;
1414
1415 }
Katya Nigam3802f202013-12-16 19:27:14 +05301416
1417 /*
1418 * putting a check for age out probe request frames
1419 * such that any probe req more than 0.5 sec old can directly
1420 * be dropped. With this, there won't be blocking of MC thread.
1421 */
1422
1423 if( limAgeOutProbeReq ( pMac, &limMsgNew, pVosPkt ))
1424 {
Katya Nigamfdf5a522015-02-03 14:38:55 +05301425 limDecrementPendingMgmtCount(pMac);
Katya Nigam3802f202013-12-16 19:27:14 +05301426 break;
1427 }
1428
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001429#ifdef FEATURE_WLAN_TDLS_INTERNAL
1430 /*
1431 * TDLS frames comes as translated frames as well as
1432 * MAC 802.11 data frames..
1433 */
1434 limGetBDfromRxPacket(pMac, limMsgNew.bodyptr, &pBD);
1435 if(0 != WDA_GET_RX_FT_DONE(pBD))
1436 {
1437 /*
1438 * TODO: check for scanning state and set deferMesg flag
1439 * accordingly..
1440 */
1441 deferMsg = false ;
1442
1443 limProcessTdlsFrame(pMac, pBD) ;
1444 }
1445 else
1446#endif
Katya Nigam3802f202013-12-16 19:27:14 +05301447
Jeff Johnson295189b2012-06-20 16:38:30 -07001448 limHandle80211Frames(pMac, &limMsgNew, &deferMsg);
1449
1450 if ( deferMsg == true )
1451 {
Abhishek Singh3cbf6052014-12-15 16:46:42 +05301452 limLog(pMac, LOG2, FL("Defer message type=%X "),
1453 limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -07001454 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1455 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001456 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 -07001457 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1458 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
1459 limLogSessionStates(pMac);
1460 limPrintMsgName(pMac, LOGE, limMsg->type);
Katya Nigamfdf5a522015-02-03 14:38:55 +05301461 limDecrementPendingMgmtCount(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001462 vos_pkt_return_packet(pVosPkt);
1463 }
1464 }
1465 else
1466 {
1467 /* PE is not deferring this 802.11 frame so we need to call vos_pkt_return.
1468 * Asumption here is when Rx mgmt frame processing is done,
1469 * voss packet could be freed here.
1470 */
Katya Nigamfdf5a522015-02-03 14:38:55 +05301471 limDecrementPendingMgmtCount(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001472 vos_pkt_return_packet(pVosPkt);
1473 }
1474 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001475 break;
1476
1477 case eWNI_SME_SCAN_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001478 case eWNI_SME_REMAIN_ON_CHANNEL_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001479 case eWNI_SME_DISASSOC_REQ:
1480 case eWNI_SME_DEAUTH_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001481 case eWNI_SME_GET_SCANNED_CHANNEL_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -07001482#ifdef FEATURE_OEM_DATA_SUPPORT
1483 case eWNI_SME_OEM_DATA_REQ:
1484#endif
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001485#ifdef FEATURE_WLAN_TDLS
1486 case eWNI_SME_TDLS_SEND_MGMT_REQ:
1487 case eWNI_SME_TDLS_ADD_STA_REQ:
1488 case eWNI_SME_TDLS_DEL_STA_REQ:
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301489 case eWNI_SME_TDLS_LINK_ESTABLISH_REQ:
Atul Mittalc0f739f2014-07-31 13:47:47 +05301490// tdlsoffchan
1491 case eWNI_SME_TDLS_CHANNEL_SWITCH_REQ:
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001492#endif
1493#ifdef FEATURE_WLAN_TDLS_INTERNAL
1494 case eWNI_SME_TDLS_DISCOVERY_START_REQ:
1495 case eWNI_SME_TDLS_LINK_START_REQ:
1496 case eWNI_SME_TDLS_TEARDOWN_REQ:
1497#endif
Gopichand Nakkalacca24d12013-03-07 17:05:07 +05301498 case eWNI_SME_RESET_AP_CAPS_CHANGED:
Jeff Johnson295189b2012-06-20 16:38:30 -07001499 // These messages are from HDD
1500 limProcessNormalHddMsg(pMac, limMsg, true); //need to response to hdd
1501 break;
1502
1503 case eWNI_SME_SCAN_ABORT_IND:
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301504 {
1505 tANI_U8 *pSessionId = (tANI_U8 *)limMsg->bodyptr;
1506 limProcessAbortScanInd(pMac, *pSessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -07001507 vos_mem_free((v_VOID_t *)limMsg->bodyptr);
1508 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001509 break;
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301510 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001511 case eWNI_SME_START_REQ:
1512 case eWNI_SME_SYS_READY_IND:
1513#ifndef WNI_ASKEY_NON_SUPPORT_FEATURE
1514 case eWNI_SME_JOIN_REQ:
1515#endif
1516 case eWNI_SME_AUTH_REQ:
1517 case eWNI_SME_REASSOC_REQ:
1518 case eWNI_SME_START_BSS_REQ:
1519 case eWNI_SME_STOP_BSS_REQ:
1520 case eWNI_SME_SWITCH_CHL_REQ:
1521 case eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ:
1522 case eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ:
1523 case eWNI_SME_SETCONTEXT_REQ:
1524 case eWNI_SME_REMOVEKEY_REQ:
1525#ifndef WNI_ASKEY_NON_SUPPORT_FEATURE
1526 case eWNI_SME_PROMISCUOUS_MODE_REQ:
1527#endif
1528 case eWNI_SME_DISASSOC_CNF:
1529 case eWNI_SME_DEAUTH_CNF:
1530 case eWNI_SME_ASSOC_CNF:
1531 case eWNI_SME_REASSOC_CNF:
1532 case eWNI_SME_ADDTS_REQ:
1533 case eWNI_SME_DELTS_REQ:
1534 case eWNI_SME_DEL_BA_PEER_IND:
1535 case eWNI_SME_SET_TX_POWER_REQ:
1536 case eWNI_SME_GET_TX_POWER_REQ:
1537 case eWNI_SME_GET_NOISE_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001538 case eWNI_SME_GET_ASSOC_STAS_REQ:
1539 case eWNI_SME_TKIP_CNTR_MEAS_REQ:
1540 case eWNI_SME_UPDATE_APWPSIE_REQ:
1541 case eWNI_SME_HIDE_SSID_REQ:
1542 case eWNI_SME_GET_WPSPBC_SESSION_REQ:
1543 case eWNI_SME_SET_APWPARSNIEs_REQ:
Madan Mohan Koyyalamudi167b95e2012-11-27 15:53:38 -08001544 case eWNI_SME_CHNG_MCC_BEACON_INTERVAL:
Jeff Johnson295189b2012-06-20 16:38:30 -07001545#if defined WLAN_FEATURE_VOWIFI
1546 case eWNI_SME_NEIGHBOR_REPORT_REQ_IND:
1547 case eWNI_SME_BEACON_REPORT_RESP_XMIT_IND:
1548#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001549#if defined FEATURE_WLAN_ESE
1550 case eWNI_SME_ESE_ADJACENT_AP_REPORT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001551#endif
1552#ifdef WLAN_FEATURE_VOWIFI_11R
1553 case eWNI_SME_FT_UPDATE_KEY:
1554 case eWNI_SME_FT_PRE_AUTH_REQ:
1555 case eWNI_SME_FT_AGGR_QOS_REQ:
1556#endif
1557 case eWNI_SME_ADD_STA_SELF_REQ:
1558 case eWNI_SME_DEL_STA_SELF_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001559 case eWNI_SME_REGISTER_MGMT_FRAME_REQ:
1560 case eWNI_SME_UPDATE_NOA:
Gopichand Nakkalac178ac82013-05-30 19:53:39 +05301561 case eWNI_SME_CLEAR_DFS_CHANNEL_LIST:
Madan Mohan Koyyalamudi44bbc152013-07-05 21:13:10 +05301562 case eWNI_SME_STA_STAT_REQ:
1563 case eWNI_SME_AGGR_STAT_REQ:
1564 case eWNI_SME_GLOBAL_STAT_REQ:
1565 case eWNI_SME_STAT_SUMM_REQ:
1566 case eWNI_SME_GET_STATISTICS_REQ:
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001567#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR)
Madan Mohan Koyyalamudi44bbc152013-07-05 21:13:10 +05301568 case eWNI_SME_GET_ROAM_RSSI_REQ:
1569#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001570#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001571 case eWNI_SME_GET_TSM_STATS_REQ:
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001572#endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */
Siddharth Bhal6af5d4e2014-09-29 21:11:16 +05301573 case eWNI_SME_MAC_SPOOF_ADDR_IND:
Jeff Johnson295189b2012-06-20 16:38:30 -07001574 // These messages are from HDD
1575 limProcessNormalHddMsg(pMac, limMsg, false); //no need to response to hdd
1576 break;
1577
1578 //Power Save Messages From HDD
1579 case eWNI_PMC_PWR_SAVE_CFG:
1580 case eWNI_PMC_ENTER_BMPS_REQ:
1581 case eWNI_PMC_EXIT_BMPS_REQ:
1582 case eWNI_PMC_ENTER_IMPS_REQ:
1583 case eWNI_PMC_EXIT_IMPS_REQ:
1584 case eWNI_PMC_ENTER_UAPSD_REQ:
1585 case eWNI_PMC_EXIT_UAPSD_REQ:
1586 case eWNI_PMC_ENTER_WOWL_REQ:
1587 case eWNI_PMC_EXIT_WOWL_REQ:
1588 case eWNI_PMC_WOWL_ADD_BCAST_PTRN:
1589 case eWNI_PMC_WOWL_DEL_BCAST_PTRN:
1590 pmmProcessMessage(pMac, limMsg);
1591 break;
1592
1593 case eWNI_PMC_SMPS_STATE_IND :
1594 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001595 if(limMsg->bodyptr){
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301596 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001597 limMsg->bodyptr = NULL;
1598 }
1599 }
1600 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001601 case eWNI_SME_SEND_ACTION_FRAME_IND:
1602 limSendP2PActionFrame(pMac, limMsg);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301603 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001604 limMsg->bodyptr = NULL;
1605 break;
1606 case eWNI_SME_ABORT_REMAIN_ON_CHAN_IND:
1607 limAbortRemainOnChan(pMac);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301608 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001609 limMsg->bodyptr = NULL;
1610 break;
1611
Viral Modid86bde22012-12-10 13:09:21 -08001612 case SIR_HAL_P2P_NOA_START_IND:
1613 {
1614 tpPESession psessionEntry = &pMac->lim.gpSession[0];
1615 tANI_U8 i;
Viral Modid440e682013-03-06 02:25:31 -08001616 tANI_U8 p2pGOExists = 0;
Gopichand Nakkala78a6c812013-05-13 16:39:49 +05301617
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001618 limLog(pMac, LOG1, "LIM received NOA start %x", limMsg->type);
Viral Modid440e682013-03-06 02:25:31 -08001619
1620 /* Since insert NOA is done and NOA start msg received, we should deactivate the Insert NOA timer */
1621 limDeactivateAndChangeTimer(pMac, eLIM_INSERT_SINGLESHOT_NOA_TIMER);
1622
Viral Modid86bde22012-12-10 13:09:21 -08001623 for(i=0; i < pMac->lim.maxBssId; i++)
1624 {
1625 psessionEntry = &pMac->lim.gpSession[i];
1626 if ( (psessionEntry != NULL) && (psessionEntry->valid) &&
1627 (psessionEntry->pePersona == VOS_P2P_GO_MODE))
1628 { //Save P2P NOA start attributes for P2P Go persona
Viral Modid440e682013-03-06 02:25:31 -08001629 p2pGOExists = 1;
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301630 vos_mem_copy(&psessionEntry->p2pGoPsNoaStartInd, limMsg->bodyptr,
1631 sizeof(tSirP2PNoaStart));
Viral Modid440e682013-03-06 02:25:31 -08001632 if (psessionEntry->p2pGoPsNoaStartInd.status != eHAL_STATUS_SUCCESS)
Viral Modid86bde22012-12-10 13:09:21 -08001633 {
Viral Modid440e682013-03-06 02:25:31 -08001634 limLog(pMac, LOGW, FL("GO NOA start failure status %d reported by FW."
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001635 " - still go ahead with deferred sme req. This is just info"),
Viral Modid440e682013-03-06 02:25:31 -08001636 psessionEntry->p2pGoPsNoaStartInd.status);
Viral Modid86bde22012-12-10 13:09:21 -08001637 }
Viral Modid86bde22012-12-10 13:09:21 -08001638 break;
1639 }
1640 }
Viral Modid440e682013-03-06 02:25:31 -08001641
1642 if (p2pGOExists == 0)
1643 {
1644 limLog(pMac, LOGW, FL("By the time, we received NOA start, GO is already removed."
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001645 " - still go ahead with deferred sme req. This is just info"));
Viral Modid440e682013-03-06 02:25:31 -08001646 }
1647
1648 /* We received the NOA start indication. Now we can send down the SME request which requires off-channel operation */
1649 limProcessRegdDefdSmeReqAfterNOAStart(pMac);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301650 vos_mem_free(limMsg->bodyptr);
Viral Modid86bde22012-12-10 13:09:21 -08001651 limMsg->bodyptr = NULL;
Viral Modid440e682013-03-06 02:25:31 -08001652 }
Viral Modid86bde22012-12-10 13:09:21 -08001653 break;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301654#ifdef FEATURE_WLAN_TDLS
1655 case SIR_HAL_TDLS_IND:
1656 {
1657 tSirTdlsInd *pTdlsInd = (tpSirTdlsInd)limMsg->bodyptr ;
1658 tpDphHashNode pStaDs = NULL ;
1659 tpPESession psessionEntry = NULL;
1660 tANI_U8 sessionId;
1661 if((psessionEntry = peFindSessionByStaId(pMac,pTdlsInd->staIdx,&sessionId))== NULL)
1662 {
1663 limLog(pMac, LOG1, FL("session does not exist for given bssId\n"));
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301664 vos_mem_free(limMsg->bodyptr);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301665 limMsg->bodyptr = NULL;
1666 return;
1667 }
1668 if ((pStaDs = dphGetHashEntry(pMac, pTdlsInd->assocId, &psessionEntry->dph.dphHashTable)) == NULL)
1669 {
1670 limLog(pMac, LOG1, FL("pStaDs Does not exist for given staId\n"));
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301671 vos_mem_free(limMsg->bodyptr);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301672 limMsg->bodyptr = NULL;
1673 return;
1674 }
Viral Modid86bde22012-12-10 13:09:21 -08001675
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301676 if ((STA_ENTRY_TDLS_PEER == pStaDs->staType))
1677 {
1678 limLog(pMac, LOGE,
1679 FL("received TDLS Indication from the Firmware with Reason Code %d "),
1680 pTdlsInd->reasonCode);
1681 limSendSmeTDLSDelStaInd(pMac, pStaDs, psessionEntry,
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05301682 pTdlsInd->reasonCode);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301683 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301684 vos_mem_free(limMsg->bodyptr);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301685 limMsg->bodyptr = NULL;
1686 }
1687 break;
1688#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001689 case SIR_HAL_P2P_NOA_ATTR_IND:
1690 {
1691 tpPESession psessionEntry = &pMac->lim.gpSession[0];
1692 tANI_U8 i;
1693
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001694 limLog(pMac, LOGW, FL("Received message Noa_ATTR %x"), limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -07001695 for(i=0; i < pMac->lim.maxBssId; i++)
1696 {
Viral Modid86bde22012-12-10 13:09:21 -08001697 psessionEntry = &pMac->lim.gpSession[i];
1698 if ( (psessionEntry != NULL) && (psessionEntry->valid) &&
Jeff Johnson295189b2012-06-20 16:38:30 -07001699 (psessionEntry->pePersona == VOS_P2P_GO_MODE))
1700 { //Save P2P attributes for P2P Go persona
1701
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301702 vos_mem_copy(&psessionEntry->p2pGoPsUpdate, limMsg->bodyptr,
1703 sizeof(tSirP2PNoaAttr));
1704
Arif Hussain24bafea2013-11-15 15:10:03 -08001705 limLog(pMac, LOG2, FL(" &psessionEntry->bssId "
1706 MAC_ADDRESS_STR " ctWin=%d oppPsFlag=%d"),
1707 MAC_ADDR_ARRAY(psessionEntry->bssId),
Jeff Johnson295189b2012-06-20 16:38:30 -07001708 psessionEntry->p2pGoPsUpdate.ctWin,
1709 psessionEntry->p2pGoPsUpdate.oppPsFlag);
1710
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001711 limLog(pMac, LOG2, FL(" uNoa1IntervalCnt=%d uNoa1Duration=%d uNoa1Interval=%d uNoa1StartTime=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001712 psessionEntry->p2pGoPsUpdate.uNoa1IntervalCnt,
1713 psessionEntry->p2pGoPsUpdate.uNoa1Duration,
1714 psessionEntry->p2pGoPsUpdate.uNoa1Interval,
1715 psessionEntry->p2pGoPsUpdate.uNoa1StartTime);
1716
1717
1718 break;
1719 }
1720 }
1721
1722 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301723 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001724 limMsg->bodyptr = NULL;
1725
1726 break;
1727
1728
Jeff Johnson295189b2012-06-20 16:38:30 -07001729 /* eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER Message comes after the
1730 * device comes out of full power for the full power request sent
1731 * because of channel switch with switch count as 0, so call the same
1732 * function used in timeout case(i.e SIR_LIM_CHANNEL_SWITCH_TIMEOUT)
1733 * for switching the channel*/
1734 case eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER:
Jeff Johnsone7245742012-09-05 17:12:55 -07001735 if ( !tx_timer_running(&pMac->lim.limTimers.gLimChannelSwitchTimer) )
1736 {
1737 limProcessChannelSwitchTimeout(pMac);
1738 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301739 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001740 limMsg->bodyptr = NULL;
1741 break;
1742
1743 //Power Save Related Messages From HAL
1744 case WDA_ENTER_BMPS_RSP:
1745 case WDA_EXIT_BMPS_RSP:
1746 case WDA_EXIT_BMPS_IND:
1747 case WDA_ENTER_IMPS_RSP:
1748 case WDA_EXIT_IMPS_RSP:
1749 case WDA_ENTER_UAPSD_RSP:
1750 case WDA_EXIT_UAPSD_RSP:
1751 case WDA_WOWL_ENTER_RSP:
1752 case WDA_WOWL_EXIT_RSP:
1753 pmmProcessMessage(pMac, limMsg);
1754 break;
1755
1756 case WDA_LOW_RSSI_IND:
1757 //limHandleLowRssiInd(pMac);
1758 break;
1759
1760 case WDA_BMPS_STATUS_IND:
1761 limHandleBmpsStatusInd(pMac);
1762 break;
1763
1764 case WDA_MISSED_BEACON_IND:
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001765 limHandleMissedBeaconInd(pMac, limMsg);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301766 vos_mem_free(limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001767 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001768 break;
1769 case WDA_MIC_FAILURE_IND:
1770 limMicFailureInd(pMac, limMsg);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301771 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001772 limMsg->bodyptr = NULL;
1773 break;
1774
1775
Jeff Johnson295189b2012-06-20 16:38:30 -07001776
1777 case SIR_LIM_ADDTS_RSP_TIMEOUT:
1778 limProcessSmeReqMessages(pMac,limMsg);
1779 break;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001780#ifdef FEATURE_WLAN_ESE
1781 case SIR_LIM_ESE_TSM_TIMEOUT:
1782#ifndef FEATURE_WLAN_ESE_UPLOAD
Jeff Johnson295189b2012-06-20 16:38:30 -07001783 limProcessTsmTimeoutHandler(pMac,limMsg);
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001784#endif /* FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001785 break;
1786 case WDA_TSM_STATS_RSP:
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001787#ifdef FEATURE_WLAN_ESE_UPLOAD
1788 limSendSmePEEseTsmRsp(pMac, (tAniGetTsmStatsRsp *)limMsg->bodyptr);
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001789#else
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001790 limProcessHalEseTsmRsp(pMac, limMsg);
1791#endif /* FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001792 break;
1793#endif
1794 case WDA_ADD_TS_RSP:
1795 limProcessHalAddTsRsp(pMac, limMsg);
1796 break;
1797
1798 case SIR_LIM_DEL_TS_IND:
1799 limProcessDelTsInd(pMac, limMsg);
Madan Mohan Koyyalamudif244d8f2012-11-29 11:21:05 -08001800 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001801 case SIR_LIM_ADD_BA_IND:
1802 limProcessAddBaInd(pMac, limMsg);
1803 break;
1804 case SIR_LIM_DEL_BA_ALL_IND:
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001805 limDelAllBASessions(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001806 break;
1807 case SIR_LIM_DEL_BA_IND:
1808 limProcessMlmHalBADeleteInd( pMac, limMsg );
1809 break;
1810
1811 case SIR_LIM_BEACON_GEN_IND: {
Jeff Johnson295189b2012-06-20 16:38:30 -07001812
Jeff Johnson295189b2012-06-20 16:38:30 -07001813 if( pMac->lim.gLimSystemRole != eLIM_AP_ROLE )
Jeff Johnson295189b2012-06-20 16:38:30 -07001814 schProcessPreBeaconInd(pMac, limMsg);
1815
1816 }
1817 break;
1818
1819 case SIR_LIM_DELETE_STA_CONTEXT_IND:
1820 limDeleteStaContext(pMac, limMsg);
1821 break;
1822
1823 case SIR_LIM_MIN_CHANNEL_TIMEOUT:
1824 case SIR_LIM_MAX_CHANNEL_TIMEOUT:
1825 case SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT:
1826 case SIR_LIM_JOIN_FAIL_TIMEOUT:
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001827 case SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001828 case SIR_LIM_AUTH_FAIL_TIMEOUT:
1829 case SIR_LIM_AUTH_RSP_TIMEOUT:
1830 case SIR_LIM_ASSOC_FAIL_TIMEOUT:
1831 case SIR_LIM_REASSOC_FAIL_TIMEOUT:
1832#ifdef WLAN_FEATURE_VOWIFI_11R
1833 case SIR_LIM_FT_PREAUTH_RSP_TIMEOUT:
1834#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001835 case SIR_LIM_REMAIN_CHN_TIMEOUT:
Viral Modid86bde22012-12-10 13:09:21 -08001836 case SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT:
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001837 case SIR_LIM_DISASSOC_ACK_TIMEOUT:
1838 case SIR_LIM_DEAUTH_ACK_TIMEOUT:
Gopichand Nakkalad492d202013-05-10 02:50:47 +05301839 case SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
Jeff Johnson295189b2012-06-20 16:38:30 -07001840 // These timeout messages are handled by MLM sub module
1841
1842 limProcessMlmReqMessages(pMac,
1843 limMsg);
1844
1845 break;
1846
1847 case SIR_LIM_HEART_BEAT_TIMEOUT:
1848 /** check if heart beat failed, even if one Beacon
1849 * is rcvd within the Heart Beat interval continue
1850 * normal processing
1851 */
1852
1853 #if 0
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001854 PELOG1(limLog(pMac, LOG1, FL("Heartbeat timeout, SME %d, MLME %d, #bcn %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001855 pMac->lim.gLimSmeState, pMac->lim.gLimMlmState,
1856 pMac->lim.gLimRxedBeaconCntDuringHB);)
1857
1858 if(pMac->lim.gLimSystemRole == eLIM_STA_IN_IBSS_ROLE)
1859 limIbssHeartBeatHandle(pMac); //HeartBeat for peers.
1860 else
1861 /**
1862 * Heartbeat failure occurred on STA
1863 * This is handled by LMM sub module.
1864 */
1865 limHandleHeartBeatFailure(pMac);
1866
1867 break;
1868 #endif //TO SUPPORT BT-AMP
Yathish9f22e662012-12-10 14:21:35 -08001869 if (limIsSystemInScanState(pMac))
1870 {
1871 // System is in DFS (Learn) mode
1872 // Defer processsing this message
1873 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1874 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001875 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 -08001876 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1877 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
1878 limLogSessionStates(pMac);
1879 }
1880 }
1881 else
1882 {
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001883 if (NULL == limMsg->bodyptr)
1884 {
1885 limHandleHeartBeatTimeout(pMac);
1886 }
1887 else
1888 {
1889 limHandleHeartBeatTimeoutForSession(pMac, (tpPESession)limMsg->bodyptr);
1890 }
Gopichand Nakkala78a6c812013-05-13 16:39:49 +05301891 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001892 break;
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001893
Jeff Johnson295189b2012-06-20 16:38:30 -07001894 case SIR_LIM_PROBE_HB_FAILURE_TIMEOUT:
1895 limHandleHeartBeatFailureTimeout(pMac);
1896 break;
1897
1898 case SIR_LIM_CHANNEL_SCAN_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001899 /**
1900 * Background scan timeout occurred on STA.
1901 * This is handled by LMM sub module.
1902 */
1903 limDeactivateAndChangeTimer(pMac, eLIM_BACKGROUND_SCAN_TIMER);
1904
1905 //We will do background scan even in bcnps mode
1906 //if (pMac->sys.gSysEnableScanMode)
1907 pMac->lim.gLimReportBackgroundScanResults = FALSE;
1908 limTriggerBackgroundScan(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001909 break;
1910
Jeff Johnson295189b2012-06-20 16:38:30 -07001911 case SIR_LIM_CNF_WAIT_TIMEOUT:
1912
1913 /*
1914 ** Does not receive CNF or dummy packet
1915 **/
1916 limHandleCnfWaitTimeout(pMac, (tANI_U16) limMsg->bodyval);
1917
1918 break;
1919
1920 case SIR_LIM_KEEPALIVE_TIMEOUT:
1921 limSendKeepAliveToPeer(pMac);
1922
1923 break;
1924
1925 case SIR_LIM_RETRY_INTERRUPT_MSG:
1926 // Message from ISR upon TFP's max retry limit interrupt
1927
1928 break;
1929
1930 case SIR_LIM_INV_KEY_INTERRUPT_MSG:
1931 // Message from ISR upon SP's Invalid session key interrupt
1932
1933 break;
1934
1935 case SIR_LIM_KEY_ID_INTERRUPT_MSG:
1936 // Message from ISR upon SP's Invalid key ID interrupt
1937
1938 break;
1939
1940 case SIR_LIM_REPLAY_THRES_INTERRUPT_MSG:
1941 // Message from ISR upon SP's Replay threshold interrupt
1942
1943 break;
1944
1945 case SIR_LIM_CHANNEL_SWITCH_TIMEOUT:
1946 limProcessChannelSwitchTimeout(pMac);
1947 break;
1948
1949 case SIR_LIM_QUIET_TIMEOUT:
1950 limProcessQuietTimeout(pMac);
1951 break;
1952
1953 case SIR_LIM_QUIET_BSS_TIMEOUT:
1954 limProcessQuietBssTimeout(pMac);
1955 break;
1956
Jeff Johnson295189b2012-06-20 16:38:30 -07001957 case SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT:
1958 limHandleUpdateOlbcCache(pMac);
1959 break;
1960#if 0
1961 case SIR_LIM_WPS_OVERLAP_TIMEOUT:
1962 limProcessWPSOverlapTimeout(pMac);
1963 break;
1964#endif
1965
Jeff Johnson295189b2012-06-20 16:38:30 -07001966
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001967#ifdef FEATURE_WLAN_TDLS_INTERNAL
1968 /*
1969 * Here discovery timer expires, now we can go ahead and collect all
1970 * the dicovery responses PE has process till now and send this
1971 * responses to SME..
1972 */
1973 case SIR_LIM_TDLS_DISCOVERY_RSP_WAIT:
1974 {
1975 //fetch the sessionEntry based on the sessionId
1976 tpPESession psessionEntry = peFindSessionBySessionId(pMac,
1977 pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId) ;
1978 if(NULL == psessionEntry)
1979 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001980 limLog(pMac, LOGP,FL("Session Does not exist for given sessionID %d"), pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId);
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001981 return;
1982 }
1983
1984 VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001985 ("Discovery Rsp timer expires ")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001986#if 0 // TDLS_hklee: D13 no need to open Addr2 unknown data packet
1987 /* restore RXP filters */
1988 limSetLinkState(pMac, eSIR_LINK_FINISH_TDLS_DISCOVERY_STATE,
1989 psessionEntry->bssId) ;
1990#endif
1991 limSendSmeTdlsDisRsp(pMac, eSIR_SUCCESS,
1992 eWNI_SME_TDLS_DISCOVERY_START_RSP) ;
1993 break ;
1994 }
1995
1996 /*
1997 * we initiated link setup and did not receive TDLS setup rsp
1998 * from TDLS peer STA, send failure RSP to SME.
1999 */
2000 case SIR_LIM_TDLS_LINK_SETUP_RSP_TIMEOUT:
2001 {
2002 tANI_U8 *peerMac = (tANI_U8 *)limMsg->bodyval ;
2003 tLimTdlsLinkSetupPeer *setupPeer = NULL ;
2004
2005 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002006 ("TDLS setup rsp timer expires ")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002007 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Arif Hussaina7c8e412013-11-20 11:06:42 -08002008 ("TDLS setup rsp timer expires for peer:"
2009 MAC_ADDRESS_STR), MAC_ADDR_ARRAY(peerMac));
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002010
2011 limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ;
2012 if(NULL != setupPeer)
2013 {
2014 limTdlsDelLinkPeer( pMac, peerMac) ;
2015 }
2016
2017 limSendSmeTdlsLinkStartRsp(pMac, eSIR_FAILURE, peerMac,
2018 eWNI_SME_TDLS_LINK_START_RSP) ;
2019 break ;
2020 }
2021 case SIR_LIM_TDLS_LINK_SETUP_CNF_TIMEOUT:
2022 {
2023 tANI_U8 *peerMac = (tANI_U8 *)limMsg->bodyval ;
2024 tLimTdlsLinkSetupPeer *setupPeer = NULL ;
2025
2026 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002027 ("TDLS setup CNF timer expires ")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002028 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Arif Hussaina7c8e412013-11-20 11:06:42 -08002029 ("TDLS setup CNF timer expires for peer: "
2030 MAC_ADDRESS_STR), MAC_ADDR_ARRAY(peerMac));
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002031 limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ;
2032 if(NULL != setupPeer)
2033 {
2034 limTdlsDelLinkPeer( pMac, peerMac) ;
2035 }
2036 break ;
2037 }
2038#endif /* FEATURE_WLAN_TDLS TIMER */
Jeff Johnson295189b2012-06-20 16:38:30 -07002039 case WDA_ADD_BSS_RSP:
2040 limProcessMlmAddBssRsp( pMac, limMsg );
2041 break;
2042
2043 case WDA_ADD_STA_RSP:
2044
2045 //call a wrapper by paasing bodyptr, their get sessionID and and call proper function from there.
2046 limProcessAddStaRsp(pMac,limMsg);
2047 break;
2048
2049 case WDA_DELETE_STA_RSP:
2050 limProcessMlmDelStaRsp(pMac, limMsg);
2051 break;
2052
2053 case WDA_ADD_STA_SELF_RSP:
2054 limProcessAddStaSelfRsp(pMac, limMsg);
2055 break;
2056 case WDA_DEL_STA_SELF_RSP:
2057 limProcessDelStaSelfRsp(pMac, limMsg);
2058 break;
2059
2060 case WDA_DELETE_BSS_RSP:
2061 limHandleDeleteBssRsp(pMac,limMsg); //wrapper routine to handle delete bss response
2062 break;
2063
2064 case WDA_SET_BSSKEY_RSP:
2065 case WDA_SET_STA_BCASTKEY_RSP:
2066 limProcessMlmSetBssKeyRsp( pMac, limMsg );
2067 break;
2068 case WDA_SET_STAKEY_RSP:
2069 limProcessMlmSetStaKeyRsp( pMac, limMsg );
2070 break;
2071 case WDA_REMOVE_BSSKEY_RSP:
2072 case WDA_REMOVE_STAKEY_RSP:
2073 limProcessMlmRemoveKeyRsp( pMac, limMsg );
2074 break;
2075 case WDA_ADDBA_RSP:
2076 limProcessMlmHalAddBARsp( pMac, limMsg );
2077 break;
2078
2079 case WDA_STA_STAT_RSP:
2080 case WDA_AGGR_STAT_RSP:
2081 case WDA_GLOBAL_STAT_RSP:
2082 case WDA_STAT_SUMM_RSP:
2083 limSendSmeStatsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
2084 break;
2085
2086 case WDA_GET_STATISTICS_RSP:
2087 limSendSmePEStatisticsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
2088 break;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08002089#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR)
Srinivas Girigowdad34cedb2013-01-25 13:33:11 -08002090 case WDA_GET_ROAM_RSSI_RSP:
2091 limSendSmePEGetRoamRssiRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
2092 break;
2093#endif
2094
Jeff Johnson295189b2012-06-20 16:38:30 -07002095
2096 case WDA_SET_MIMOPS_RSP: //limProcessSetMimoRsp(pMac, limMsg);
2097 case WDA_SET_TX_POWER_RSP: //limProcessSetTxPowerRsp(pMac, limMsg);
2098 case WDA_GET_TX_POWER_RSP: //limProcessGetTxPowerRsp(pMac, limMsg);
2099 case WDA_GET_NOISE_RSP:
2100 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2101 limMsg->bodyptr = NULL;
2102 //limProcessGetNoiseRsp(pMac, limMsg);
2103 break;
2104
2105 case WDA_SET_MAX_TX_POWER_RSP:
2106#if defined WLAN_FEATURE_VOWIFI
2107 rrmSetMaxTxPowerRsp( pMac, limMsg );
2108#endif
2109 if(limMsg->bodyptr != NULL)
2110 {
2111 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2112 limMsg->bodyptr = NULL;
2113 }
2114 break;
2115
Jeff Johnson295189b2012-06-20 16:38:30 -07002116 case SIR_LIM_ADDR2_MISS_IND:
2117 {
2118 limLog(pMac, LOGE,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002119 FL("Addr2 mismatch interrupt received %X"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002120 limMsg->type);
2121 /*a message from HAL indicating addr2 mismatch interrupt occurred
2122 limMsg->bodyptr contains only pointer to 48-bit addr2 field*/
2123 //Dinesh fix this. the third parameter should be sessionentry.
2124 //limHandleUnknownA2IndexFrames(pMac, (void *)limMsg->bodyptr);
2125
2126 /*Free message body pointer*/
2127 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08002128 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07002129 break;
2130 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002131
2132#ifdef WLAN_FEATURE_VOWIFI_11R
2133 case WDA_AGGR_QOS_RSP:
2134 limProcessFTAggrQoSRsp( pMac, limMsg );
2135 break;
2136#endif
2137
2138 case WDA_SET_LINK_STATE_RSP:
2139 linkStateParams = (tLinkStateParams *)limMsg->bodyptr;
2140#if defined WLAN_FEATURE_VOWIFI_11R
2141 pSession = linkStateParams->session;
2142 if(linkStateParams->ft)
2143 {
2144 limSendReassocReqWithFTIEsMgmtFrame(pMac,
2145 pSession->pLimMlmReassocReq,
2146 pSession);
2147 }
2148#endif
2149 if( linkStateParams->callback )
2150 {
2151 linkStateParams->callback( pMac, linkStateParams->callbackArg );
2152 }
2153 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08002154 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07002155 break;
2156
2157#ifdef WLAN_FEATURE_PACKET_FILTERING
2158 case WDA_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP:
2159 pmmProcessMessage(pMac, limMsg);
2160 break;
2161#endif // WLAN_FEATURE_PACKET_FILTERING
2162
2163#ifdef WLAN_FEATURE_GTK_OFFLOAD
2164 case WDA_GTK_OFFLOAD_GETINFO_RSP:
2165 pmmProcessMessage(pMac, limMsg);
2166 break;
2167#endif // WLAN_FEATURE_GTK_OFFLOAD
Yathish9f22e662012-12-10 14:21:35 -08002168 case eWNI_SME_SET_BCN_FILTER_REQ:
2169 {
2170#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2171 tpPESession psessionEntry;
2172 tANI_U8 sessionId = (tANI_U8)limMsg->bodyval ;
2173 psessionEntry = &pMac->lim.gpSession[sessionId];
2174 if(psessionEntry != NULL && IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
2175 {
2176 // sending beacon filtering information down to HAL
2177 if (limSendBeaconFilterInfo(pMac, psessionEntry) != eSIR_SUCCESS)
2178 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002179 limLog(pMac, LOGE, FL("Fail to send Beacon Filter Info "));
Yathish9f22e662012-12-10 14:21:35 -08002180 }
2181 }
Dhanashri Atred7885c22013-03-29 11:19:05 -07002182 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
2183 limMsg->bodyptr = NULL;
Yathish9f22e662012-12-10 14:21:35 -08002184#endif
2185 }
2186 break;
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302187 case eWNI_SME_HT40_OBSS_SCAN_IND:
2188 {
Sandeep Puligilla9f384742014-04-11 02:27:04 +05302189 tpPESession psessionEntry = NULL;
2190 tANI_U8 sessionId;
2191 tSirSmeHT40OBSSScanInd *ht40ScanInd =
Siddharth Bhald31c1252014-05-05 19:34:14 +05302192 (tSirSmeHT40OBSSScanInd *)limMsg->bodyptr;
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302193
Sandeep Puligilla9f384742014-04-11 02:27:04 +05302194 psessionEntry = peFindSessionByBssid(pMac, ht40ScanInd->peerMacAddr,
Siddharth Bhald31c1252014-05-05 19:34:14 +05302195 &sessionId);
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302196
Siddharth Bhald31c1252014-05-05 19:34:14 +05302197 if (psessionEntry != NULL)
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302198 {
Siddharth Bhald31c1252014-05-05 19:34:14 +05302199 if( IS_HT40_OBSS_SCAN_FEATURE_ENABLE &&
2200 psessionEntry->htSupportedChannelWidthSet ==
2201 WNI_CFG_CHANNEL_BONDING_MODE_ENABLE )
2202 {
2203 VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO,
2204 "OBSS Scan Start Req: session id %d"
2205 "htSupportedChannelWidthSet %d", psessionEntry->peSessionId,
2206 psessionEntry->htSupportedChannelWidthSet);
2207 limSendHT40OBSSScanInd(pMac, psessionEntry);
2208 }
2209 else
2210 {
2211 VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO,
2212 "OBSS Scan not started: htSupportedChannelWidthSet- %d"
2213 " session id %d", psessionEntry->htSupportedChannelWidthSet,
2214 psessionEntry->peSessionId);
2215 }
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302216 }
2217 else
2218 {
2219 VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO,
Siddharth Bhald31c1252014-05-05 19:34:14 +05302220 "OBSS Scan not started: session id is NULL");
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302221 }
2222 vos_mem_free(limMsg->bodyptr);
2223 limMsg->bodyptr = NULL;
2224 }
2225 break;
2226 case eWNI_SME_HT40_STOP_OBSS_SCAN_IND:
2227 {
2228 tpPESession psessionEntry = NULL;
2229 tANI_U8 sessionId = (tANI_U8)limMsg->bodyval ;
2230
2231 psessionEntry = &pMac->lim.gpSession[sessionId];
2232 /* Sending LIM STOP OBSS SCAN Indication
2233 Stop command support is only for debugging purpose */
2234 if ( IS_HT40_OBSS_SCAN_FEATURE_ENABLE )
2235 limSendHT40OBSSStopScanInd(pMac, psessionEntry);
2236 else
2237 VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_ERROR,
2238 "OBSS Scan Stop not started ");
2239 }
2240 break;
Hardik Kantilal Patel62a3a762014-11-21 12:55:57 +05302241#ifdef WLAN_FEATURE_AP_HT40_24G
2242 case eWNI_SME_SET_HT_2040_MODE:
2243 limProcessSmeReqMessages(pMac, limMsg);
2244 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2245 limMsg->bodyptr = NULL;
2246 break;
2247#endif
2248
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05302249#ifdef FEATURE_WLAN_TDLS
2250 case WDA_SET_TDLS_LINK_ESTABLISH_REQ_RSP:
2251 {
Gopichand Nakkala24be5312013-07-02 16:47:12 +05302252 tpPESession psessionEntry;
2253 tANI_U8 sessionId;
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05302254 tTdlsLinkEstablishParams *pTdlsLinkEstablishParams;
2255 pTdlsLinkEstablishParams = (tTdlsLinkEstablishParams*) limMsg->bodyptr;
Gopichand Nakkala24be5312013-07-02 16:47:12 +05302256
2257 if((psessionEntry = peFindSessionByStaId(pMac,
2258 pTdlsLinkEstablishParams->staIdx,
2259 &sessionId))== NULL)
2260 {
2261 limLog(pMac, LOGE, FL("session %u does not exist.\n"), sessionId);
2262 /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP message to SME
2263 with session id as zero and status as FAILURE so, that message
2264 queued in SME queue can be freed to prevent the SME cmd buffer leak */
2265 limSendSmeTdlsLinkEstablishReqRsp(pMac,
2266 0,
2267 NULL,
2268 NULL,
2269 eSIR_FAILURE);
2270 }
2271 else
2272 {
2273 limSendSmeTdlsLinkEstablishReqRsp(pMac,
2274 psessionEntry->smeSessionId,
2275 NULL,
2276 NULL,
2277 pTdlsLinkEstablishParams->status) ;
2278 }
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05302279 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
2280 limMsg->bodyptr = NULL;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05302281 break;
2282 }
Atul Mittal60bd4292014-08-14 12:19:27 +05302283
2284 case WDA_SET_TDLS_CHAN_SWITCH_REQ_RSP:
2285 {
2286 tpPESession psessionEntry;
2287 tANI_U8 sessionId;
2288 tTdlsChanSwitchParams *pTdlsChanSwitchParams;
2289 pTdlsChanSwitchParams = (tTdlsChanSwitchParams*) limMsg->bodyptr;
2290
2291 if((psessionEntry = peFindSessionByStaId(pMac,
2292 pTdlsChanSwitchParams->staIdx,
2293 &sessionId))== NULL)
2294 {
2295 limLog(pMac, LOGE, FL("session %u does not exist.\n"), sessionId);
2296 /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP message to SME
2297 with session id as zero and status as FAILURE so, that message
2298 queued in SME queue can be freed to prevent the SME cmd buffer leak */
2299 limSendSmeTdlsChanSwitchReqRsp(pMac,
2300 0,
2301 NULL,
2302 NULL,
2303 eSIR_FAILURE);
2304 }
2305 else
2306 {
2307 limSendSmeTdlsChanSwitchReqRsp(pMac,
2308 psessionEntry->smeSessionId,
2309 NULL,
2310 NULL,
2311 pTdlsChanSwitchParams->status) ;
2312 }
2313 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
2314 limMsg->bodyptr = NULL;
2315 break;
2316 }
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05302317#endif
Gopichand Nakkala2c231c82013-06-11 17:49:16 +05302318
2319 case WDA_RX_SCAN_EVENT:
2320 limProcessRxScanEvent(pMac, limMsg->bodyptr);
2321 break;
2322
Ravi Joshid2ca7c42013-07-23 08:37:49 -07002323 case WDA_IBSS_PEER_INACTIVITY_IND:
2324 {
2325 limProcessIbssPeerInactivity(pMac, limMsg->bodyptr);
2326 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
2327 limMsg->bodyptr = NULL;
2328 break;
2329 }
2330
Siddharth Bhal4f3187c2014-10-09 21:38:08 +05302331 case WDA_SPOOF_MAC_ADDR_RSP:
2332 limProcessMlmSpoofMacAddrRsp(pMac, (tSirRetStatus)limMsg->bodyval);
2333 break;
2334
Jeff Johnson295189b2012-06-20 16:38:30 -07002335 default:
2336 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2337 limMsg->bodyptr = NULL;
2338 // Unwanted messages
2339 // Log error
2340 limLog(pMac, LOGE,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002341 FL("Discarding unexpected message received %X"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002342 limMsg->type);
2343 limPrintMsgName(pMac, LOGE, limMsg->type);
2344 break;
2345
2346 } // switch (limMsg->type)
2347
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002348 PELOG2(limLog(pMac, LOG2, FL("Done Processing msgType = %d, sme state = %s, mlm state = %s"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002349 limMsg->type, limSmeStateStr(pMac->lim.gLimSmeState),
2350 limMlmStateStr(pMac->lim.gLimMlmState));)
2351
2352} /*** end limProcessMessages() ***/
2353
2354
2355
2356/**
2357 * limProcessDeferredMessageQueue
2358 *
2359 *FUNCTION:
2360 * This function is called by LIM while exiting from Learn
2361 * mode. This function fetches messages posted to the LIM
2362 * deferred message queue limDeferredMsgQ.
2363 *
2364 *LOGIC:
2365 *
2366 *ASSUMPTIONS:
2367 * NA
2368 *
2369 *NOTE:
2370 * NA
2371 *
2372 * @param pMac - Pointer to Global MAC structure
2373 * @return None
2374 */
2375
2376void
2377limProcessDeferredMessageQueue(tpAniSirGlobal pMac)
2378{
2379 tSirMsgQ limMsg = { 0, 0, 0 };
2380
Jeff Johnson295189b2012-06-20 16:38:30 -07002381 tSirMsgQ *readMsg;
2382 tANI_U16 size;
2383
2384 /*
2385 ** check any deferred messages need to be processed
2386 **/
2387 size = pMac->lim.gLimDeferredMsgQ.size;
2388 if (size > 0)
2389 {
2390 while ((readMsg = limReadDeferredMsgQ(pMac)) != NULL)
2391 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302392 vos_mem_copy((tANI_U8*) &limMsg,
Jeff Johnson295189b2012-06-20 16:38:30 -07002393 (tANI_U8*) readMsg, sizeof(tSirMsgQ));
2394 size--;
2395 limProcessMessages(pMac, &limMsg);
2396
2397 if((limIsSystemInScanState(pMac)) || (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) ||
2398 (pMac->lim.gLimSystemInScanLearnMode))
2399 break;
2400 }
2401 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002402} /*** end limProcessDeferredMessageQueue() ***/
2403
2404
2405/*
2406 * limProcessNormalHddMsg
2407 * Function: this function checks the current lim state and decide whether the message passed shall be deffered.
2408 * @param pMac - Pointer to Global MAC structure
2409 * pLimMsg -- the message need to be processed
2410 * fRspReqd -- whether return result to hdd
2411 * @return None
2412 */
2413void limProcessNormalHddMsg(tpAniSirGlobal pMac, tSirMsgQ *pLimMsg, tANI_U8 fRspReqd)
2414{
2415 tANI_BOOLEAN fDeferMsg = eANI_BOOLEAN_TRUE;
2416
2417 /* Added For BT-AMP Support */
2418 if ((pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_AP_ROLE )
2419 ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_STA_ROLE)
2420 ||(pMac->lim.gLimSystemRole == eLIM_UNKNOWN_ROLE))
2421 {
2422 /** This check is required only for the AP and in 2 cases.
2423 * 1. If we are in learn mode and we receive any of these messages,
2424 * you have to come out of scan and process the message, hence dont
2425 * defer the message here. In handler, these message could be defered
2426 * till we actually come out of scan mode.
2427 * 2. If radar is detected, you might have to defer all of these
2428 * messages except Stop BSS request/ Switch channel request. This
2429 * decision is also made inside its handler.
2430 *
2431 * Please be careful while using the flag fDeferMsg. Possibly you
2432 * might end up in an infinite loop.
2433 **/
2434 if (((pLimMsg->type == eWNI_SME_START_BSS_REQ) ||
2435 (pLimMsg->type == eWNI_SME_STOP_BSS_REQ) ||
2436 (pLimMsg->type == eWNI_SME_SWITCH_CHL_REQ) ||
2437 (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ) ||
2438 (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ)))
2439 {
2440 fDeferMsg = eANI_BOOLEAN_FALSE;
2441 }
2442 }
2443
2444 /* limInsystemInscanState() refers the psessionEntry, how to get session Entry????*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002445 if (((pMac->lim.gLimAddtsSent) || (limIsSystemInScanState(pMac)) /*||
2446 (LIM_IS_RADAR_DETECTED(pMac))*/) && fDeferMsg)
Jeff Johnson295189b2012-06-20 16:38:30 -07002447 {
2448 // System is in DFS (Learn) mode or awaiting addts response
2449 // or if radar is detected, Defer processsing this message
2450 if (limDeferMsg(pMac, pLimMsg) != TX_SUCCESS)
2451 {
2452#ifdef WLAN_DEBUG
2453 pMac->lim.numSme++;
2454#endif
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002455 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 -07002456 pLimMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
2457 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
2458 limLogSessionStates(pMac);
2459 limPrintMsgName(pMac, LOGE, pLimMsg->type);
2460 // Release body
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302461 vos_mem_free(pLimMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08002462 pLimMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07002463 }
2464 }
2465 else
2466 {
2467 if(fRspReqd)
2468 {
2469 // These messages are from HDD
2470 // Since these requests may also be generated
2471 // internally within LIM module, need to
2472 // distinquish and send response to host
2473 pMac->lim.gLimRspReqd = eANI_BOOLEAN_TRUE;
2474 }
2475#ifdef WLAN_DEBUG
2476 pMac->lim.numSme++;
2477#endif
2478 if(limProcessSmeReqMessages(pMac, pLimMsg))
2479 {
2480 // Release body
2481 // limProcessSmeReqMessage consumed the buffer. We can free it.
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302482 vos_mem_free(pLimMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08002483 pLimMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07002484 }
2485 }
2486}
2487
2488void
Jeff Johnsone7245742012-09-05 17:12:55 -07002489handleHTCapabilityandHTInfo(struct sAniSirGlobal *pMac, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07002490{
2491 tSirMacHTCapabilityInfo macHTCapabilityInfo;
2492 tSirMacHTParametersInfo macHTParametersInfo;
2493 tSirMacHTInfoField1 macHTInfoField1;
2494 tSirMacHTInfoField2 macHTInfoField2;
2495 tSirMacHTInfoField3 macHTInfoField3;
2496 tANI_U32 cfgValue;
2497 tANI_U8 *ptr;
Jeff Johnson295189b2012-06-20 16:38:30 -07002498
Jeff Johnson295189b2012-06-20 16:38:30 -07002499 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_CAP_INFO, &cfgValue) != eSIR_SUCCESS)
2500 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002501 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_CAP_INFO value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002502 return ;
2503 }
2504 ptr = (tANI_U8 *) &macHTCapabilityInfo;
2505 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2506 pMac->lim.gHTLsigTXOPProtection = (tANI_U8)macHTCapabilityInfo.lsigTXOPProtection;
2507 pMac->lim.gHTMIMOPSState = (tSirMacHTMIMOPowerSaveState) macHTCapabilityInfo.mimoPowerSave;
2508 pMac->lim.gHTGreenfield = (tANI_U8)macHTCapabilityInfo.greenField;
2509 pMac->lim.gHTMaxAmsduLength = (tANI_U8)macHTCapabilityInfo.maximalAMSDUsize;
2510 pMac->lim.gHTShortGI20Mhz = (tANI_U8)macHTCapabilityInfo.shortGI20MHz;
2511 pMac->lim.gHTShortGI40Mhz = (tANI_U8)macHTCapabilityInfo.shortGI40MHz;
Jeff Johnson295189b2012-06-20 16:38:30 -07002512 pMac->lim.gHTPSMPSupport = (tANI_U8)macHTCapabilityInfo.psmp;
2513 pMac->lim.gHTDsssCckRate40MHzSupport = (tANI_U8)macHTCapabilityInfo.dsssCckMode40MHz;
2514
2515 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_AMPDU_PARAMS, &cfgValue) != eSIR_SUCCESS)
2516 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002517 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_PARAM_INFO value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002518 return ;
2519 }
2520 ptr = (tANI_U8 *) &macHTParametersInfo;
2521 *ptr = (tANI_U8) (cfgValue & 0xff);
2522 pMac->lim.gHTAMpduDensity = (tANI_U8)macHTParametersInfo.mpduDensity;
2523 pMac->lim.gHTMaxRxAMpduFactor = (tANI_U8)macHTParametersInfo.maxRxAMPDUFactor;
2524
2525 // Get HT IE Info
2526 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD1, &cfgValue) != eSIR_SUCCESS)
2527 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002528 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD1 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002529 return ;
2530 }
2531 ptr = (tANI_U8 *) &macHTInfoField1;
2532 *((tANI_U8 *)ptr) = (tANI_U8) (cfgValue & 0xff);
2533 pMac->lim.gHTServiceIntervalGranularity = (tANI_U8)macHTInfoField1.serviceIntervalGranularity;
2534 pMac->lim.gHTControlledAccessOnly = (tANI_U8)macHTInfoField1.controlledAccessOnly;
2535 pMac->lim.gHTRifsMode = (tANI_U8)macHTInfoField1.rifsMode;
Jeff Johnson295189b2012-06-20 16:38:30 -07002536
2537 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD2, &cfgValue) != eSIR_SUCCESS)
2538 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002539 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD2 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002540 return ;
2541 }
2542 ptr = (tANI_U8 *) &macHTInfoField2;
2543 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2544 pMac->lim.gHTOperMode = (tSirMacHTOperatingMode) macHTInfoField2.opMode;
2545
2546 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD3, &cfgValue) != eSIR_SUCCESS)
2547 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002548 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD3 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002549 return ;
2550 }
2551 ptr = (tANI_U8 *) &macHTInfoField3;
2552 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2553 pMac->lim.gHTPCOActive = (tANI_U8)macHTInfoField3.pcoActive;
2554 pMac->lim.gHTPCOPhase = (tANI_U8)macHTInfoField3.pcoPhase;
Jeff Johnson295189b2012-06-20 16:38:30 -07002555 pMac->lim.gHTSecondaryBeacon = (tANI_U8)macHTInfoField3.secondaryBeacon;
2556 pMac->lim.gHTDualCTSProtection = (tANI_U8)macHTInfoField3.dualCTSProtection;
2557 pMac->lim.gHTSTBCBasicMCS = (tANI_U8)macHTInfoField3.basicSTBCMCS;
Jeff Johnsone7245742012-09-05 17:12:55 -07002558
2559 /* The lim globals for channelwidth and secondary chnl have been removed and should not be used during no session;
2560 * instead direct cfg is read and used when no session for transmission of mgmt frames (same as old);
2561 * For now, we might come here during init and join with sessionEntry = NULL; in that case just fill the globals which exist
2562 * Sessionized entries values will be filled in join or add bss req. The ones which are missed in join are filled below
2563 */
2564 if (psessionEntry != NULL)
2565 {
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302566 psessionEntry->htCapability =
2567 IS_DOT11_MODE_HT(psessionEntry->dot11mode);
2568 psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport =
2569 (tANI_U8)macHTInfoField3.lsigTXOPProtectionFullSupport;
Sandeep Puligilla70b6b162014-04-19 02:06:04 +05302570 limInitOBSSScanParams(pMac, psessionEntry);
Jeff Johnsone7245742012-09-05 17:12:55 -07002571 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002572}
2573
2574void limLogSessionStates(tpAniSirGlobal pMac)
2575{
2576#ifdef WLAN_DEBUG
2577 int i;
2578
2579 for(i = 0; i < pMac->lim.maxBssId; i++)
2580 {
2581 if(pMac->lim.gpSession[i].valid)
2582 {
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302583 limLog(pMac, LOG1, FL("Session[%d] sysRole(%d) limSmeState %d "
2584 "(prev sme state %d) mlm state %d (prev mlm state %d)"),
2585 i, pMac->lim.gpSession[i].limSystemRole,
2586 pMac->lim.gpSession[i].limSmeState,
2587 pMac->lim.gpSession[i].limPrevSmeState,
2588 pMac->lim.gpSession[i].limMlmState,
2589 pMac->lim.gpSession[i].limPrevMlmState);
Jeff Johnson295189b2012-06-20 16:38:30 -07002590 }
2591 }
2592#endif //ifdef WLAN_DEBUG
2593}