blob: b87265e24a81f8d1d7ef0b2f4974fe0d3d9d1520 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lam842dad02014-02-18 18:44:02 -08002 * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved.
3 *
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
Jeff Johnson295189b2012-06-20 16:38:30 -070047#include "wniCfgSta.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 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700361 PELOG2(limLog(pMac, LOG2, FL("Ignoring A2 Invalid Packet received for MC/BC:"));
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800362 limPrintMacAddr(pMac, pMacHdr->addr2, LOG2);)
363
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 */
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -07001104 PELOG2(limLog(pMac, LOG2, 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/**
1265 * limProcessMessages
1266 *
1267 *FUNCTION:
1268 * This function is called by limProcessMessageQueue function. This
1269 * function processes messages received by LIM.
1270 *
1271 *LOGIC:
1272 * Depending on the message type, corresponding function will be
1273 * called, for example limProcessSmeMessages() will be called to
1274 * process SME messages received from HDD/Upper layer software module.
1275 *
1276 *ASSUMPTIONS:
1277 * NA
1278 *
1279 *NOTE:
1280 * NA
1281 *
1282 * @param pMac Pointer to Global MAC structure
1283 * @param limMsg Received LIM message
1284 * @return None
1285 */
1286
1287void
1288limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
1289{
1290 tANI_U8 deferMsg = false;
1291 tLinkStateParams *linkStateParams;
1292#if defined WLAN_FEATURE_VOWIFI_11R
1293 tpPESession pSession;
1294#endif
1295#if defined(ANI_DVT_DEBUG)
1296 tSirMsgQ msgQ;
1297#endif
1298 if(pMac->gDriverType == eDRIVER_TYPE_MFG)
1299 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301300 vos_mem_free(limMsg->bodyptr);
Jeff Johnsone7245742012-09-05 17:12:55 -07001301 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001302 return;
1303 }
1304#ifdef WLAN_DEBUG
1305 pMac->lim.numTot++;
1306#endif
1307
1308
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001309 PELOG3(limLog(pMac, LOG3, FL("rcvd msgType = %s, sme state = %s, mlm state = %s"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001310 limMsgStr(limMsg->type), limSmeStateStr(pMac->lim.gLimSmeState),
1311 limMlmStateStr(pMac->lim.gLimMlmState));)
1312
Jeff Johnsone7245742012-09-05 17:12:55 -07001313 MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(limMsg->type, LIM_MSG_PROCESSED));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001314
1315 switch (limMsg->type)
1316 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001317
1318 case SIR_LIM_UPDATE_BEACON:
1319 limUpdateBeacon(pMac);
1320 break;
1321
Jeff Johnson295189b2012-06-20 16:38:30 -07001322 case SIR_CFG_PARAM_UPDATE_IND:
1323 /// CFG parameter updated
1324 if (limIsSystemInScanState(pMac))
1325 {
1326 // System is in DFS (Learn) mode
1327 // Defer processsing this message
1328 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1329 {
Leela Venkata Kiran Kumar Reddy Chirala2247e962013-03-22 19:21:10 -07001330 if(!(pMac->lim.deferredMsgCnt & 0xF))
1331 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001332 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 -07001333 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1334 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
Leela Venkata Kiran Kumar Reddy Chirala2247e962013-03-22 19:21:10 -07001335 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001336 limLogSessionStates(pMac);
1337 limPrintMsgName(pMac, LOGE, limMsg->type);
1338 }
1339 }
1340 else
1341 {
1342 limHandleCFGparamUpdate(pMac, limMsg->bodyval);
1343 }
1344
1345 break;
1346
1347 case WDA_INIT_SCAN_RSP:
1348 limProcessInitScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001349 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001350 break;
1351
1352 case WDA_START_SCAN_RSP:
1353 limProcessStartScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001354 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001355 break;
1356
1357 case WDA_END_SCAN_RSP:
1358 limProcessEndScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001359 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001360 break;
1361
1362 case WDA_FINISH_SCAN_RSP:
1363 limProcessFinishScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001364 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001365 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001366#ifdef FEATURE_OEM_DATA_SUPPORT
1367 case WDA_START_OEM_DATA_RSP:
1368 limProcessOemDataRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001369 limMsg->bodyptr = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07001370 break;
1371#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001372
1373 case WDA_SWITCH_CHANNEL_RSP:
1374 limProcessSwitchChannelRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001375 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001376 break;
1377
1378#ifdef ANI_SIR_IBSS_PEER_CACHING
1379 case WDA_IBSS_STA_ADD:
1380 limIbssStaAdd(pMac, limMsg->bodyptr);
1381 break;
1382#endif
1383 case SIR_BB_XPORT_MGMT_MSG:
1384 // These messages are from Peer MAC entity.
1385#ifdef WLAN_DEBUG
1386 pMac->lim.numBbt++;
1387#endif
1388
Jeff Johnson295189b2012-06-20 16:38:30 -07001389 {
1390 v_U16_t pktLen = 0;
1391 vos_pkt_t *pVosPkt;
1392 VOS_STATUS vosStatus;
1393 tSirMsgQ limMsgNew;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001394#ifdef FEATURE_WLAN_TDLS_INTERNAL
1395 tANI_U32 *pBD = NULL ;
1396#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001397
1398 /* The original limMsg which we were deferring have the
1399 * bodyPointer point to 'BD' instead of 'Vos pkt'. If we don't make a copy
1400 * of limMsg, then vos_pkt_peek_data will overwrite the limMsg->bodyPointer.
1401 * and next time when we try to process the msg, we will try to use 'BD' as
1402 * 'Vos Pkt' which will cause a crash
1403 */
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301404 vos_mem_copy((tANI_U8*)&limMsgNew, (tANI_U8*)limMsg,
1405 sizeof(tSirMsgQ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001406 pVosPkt = (vos_pkt_t *)limMsgNew.bodyptr;
1407 vos_pkt_get_packet_length(pVosPkt, &pktLen);
1408
1409 vosStatus = WDA_DS_PeekRxPacketInfo( pVosPkt, (v_PVOID_t *)&limMsgNew.bodyptr, VOS_FALSE );
1410
1411 if( !VOS_IS_STATUS_SUCCESS(vosStatus) )
1412 {
1413 vos_pkt_return_packet(pVosPkt);
1414 break;
1415
1416 }
Katya Nigam3802f202013-12-16 19:27:14 +05301417
1418 /*
1419 * putting a check for age out probe request frames
1420 * such that any probe req more than 0.5 sec old can directly
1421 * be dropped. With this, there won't be blocking of MC thread.
1422 */
1423
1424 if( limAgeOutProbeReq ( pMac, &limMsgNew, pVosPkt ))
1425 {
1426 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);
1461 vos_pkt_return_packet(pVosPkt);
1462 }
1463 }
1464 else
1465 {
1466 /* PE is not deferring this 802.11 frame so we need to call vos_pkt_return.
1467 * Asumption here is when Rx mgmt frame processing is done,
1468 * voss packet could be freed here.
1469 */
1470 vos_pkt_return_packet(pVosPkt);
1471 }
1472 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001473 break;
1474
1475 case eWNI_SME_SCAN_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001476 case eWNI_SME_REMAIN_ON_CHANNEL_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001477 case eWNI_SME_DISASSOC_REQ:
1478 case eWNI_SME_DEAUTH_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001479 case eWNI_SME_GET_SCANNED_CHANNEL_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -07001480#ifdef FEATURE_OEM_DATA_SUPPORT
1481 case eWNI_SME_OEM_DATA_REQ:
1482#endif
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001483#ifdef FEATURE_WLAN_TDLS
1484 case eWNI_SME_TDLS_SEND_MGMT_REQ:
1485 case eWNI_SME_TDLS_ADD_STA_REQ:
1486 case eWNI_SME_TDLS_DEL_STA_REQ:
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301487 case eWNI_SME_TDLS_LINK_ESTABLISH_REQ:
Atul Mittalc0f739f2014-07-31 13:47:47 +05301488// tdlsoffchan
1489 case eWNI_SME_TDLS_CHANNEL_SWITCH_REQ:
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001490#endif
1491#ifdef FEATURE_WLAN_TDLS_INTERNAL
1492 case eWNI_SME_TDLS_DISCOVERY_START_REQ:
1493 case eWNI_SME_TDLS_LINK_START_REQ:
1494 case eWNI_SME_TDLS_TEARDOWN_REQ:
1495#endif
Gopichand Nakkalacca24d12013-03-07 17:05:07 +05301496 case eWNI_SME_RESET_AP_CAPS_CHANGED:
Jeff Johnson295189b2012-06-20 16:38:30 -07001497 // These messages are from HDD
1498 limProcessNormalHddMsg(pMac, limMsg, true); //need to response to hdd
1499 break;
1500
1501 case eWNI_SME_SCAN_ABORT_IND:
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301502 {
1503 tANI_U8 *pSessionId = (tANI_U8 *)limMsg->bodyptr;
1504 limProcessAbortScanInd(pMac, *pSessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -07001505 vos_mem_free((v_VOID_t *)limMsg->bodyptr);
1506 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001507 break;
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301508 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001509 case eWNI_SME_START_REQ:
1510 case eWNI_SME_SYS_READY_IND:
1511#ifndef WNI_ASKEY_NON_SUPPORT_FEATURE
1512 case eWNI_SME_JOIN_REQ:
1513#endif
1514 case eWNI_SME_AUTH_REQ:
1515 case eWNI_SME_REASSOC_REQ:
1516 case eWNI_SME_START_BSS_REQ:
1517 case eWNI_SME_STOP_BSS_REQ:
1518 case eWNI_SME_SWITCH_CHL_REQ:
1519 case eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ:
1520 case eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ:
1521 case eWNI_SME_SETCONTEXT_REQ:
1522 case eWNI_SME_REMOVEKEY_REQ:
1523#ifndef WNI_ASKEY_NON_SUPPORT_FEATURE
1524 case eWNI_SME_PROMISCUOUS_MODE_REQ:
1525#endif
1526 case eWNI_SME_DISASSOC_CNF:
1527 case eWNI_SME_DEAUTH_CNF:
1528 case eWNI_SME_ASSOC_CNF:
1529 case eWNI_SME_REASSOC_CNF:
1530 case eWNI_SME_ADDTS_REQ:
1531 case eWNI_SME_DELTS_REQ:
1532 case eWNI_SME_DEL_BA_PEER_IND:
1533 case eWNI_SME_SET_TX_POWER_REQ:
1534 case eWNI_SME_GET_TX_POWER_REQ:
1535 case eWNI_SME_GET_NOISE_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001536 case eWNI_SME_GET_ASSOC_STAS_REQ:
1537 case eWNI_SME_TKIP_CNTR_MEAS_REQ:
1538 case eWNI_SME_UPDATE_APWPSIE_REQ:
1539 case eWNI_SME_HIDE_SSID_REQ:
1540 case eWNI_SME_GET_WPSPBC_SESSION_REQ:
1541 case eWNI_SME_SET_APWPARSNIEs_REQ:
Madan Mohan Koyyalamudi167b95e2012-11-27 15:53:38 -08001542 case eWNI_SME_CHNG_MCC_BEACON_INTERVAL:
Jeff Johnson295189b2012-06-20 16:38:30 -07001543#if defined WLAN_FEATURE_VOWIFI
1544 case eWNI_SME_NEIGHBOR_REPORT_REQ_IND:
1545 case eWNI_SME_BEACON_REPORT_RESP_XMIT_IND:
1546#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001547#if defined FEATURE_WLAN_ESE
1548 case eWNI_SME_ESE_ADJACENT_AP_REPORT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001549#endif
1550#ifdef WLAN_FEATURE_VOWIFI_11R
1551 case eWNI_SME_FT_UPDATE_KEY:
1552 case eWNI_SME_FT_PRE_AUTH_REQ:
1553 case eWNI_SME_FT_AGGR_QOS_REQ:
1554#endif
1555 case eWNI_SME_ADD_STA_SELF_REQ:
1556 case eWNI_SME_DEL_STA_SELF_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001557 case eWNI_SME_REGISTER_MGMT_FRAME_REQ:
1558 case eWNI_SME_UPDATE_NOA:
Gopichand Nakkalac178ac82013-05-30 19:53:39 +05301559 case eWNI_SME_CLEAR_DFS_CHANNEL_LIST:
Madan Mohan Koyyalamudi44bbc152013-07-05 21:13:10 +05301560 case eWNI_SME_STA_STAT_REQ:
1561 case eWNI_SME_AGGR_STAT_REQ:
1562 case eWNI_SME_GLOBAL_STAT_REQ:
1563 case eWNI_SME_STAT_SUMM_REQ:
1564 case eWNI_SME_GET_STATISTICS_REQ:
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001565#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR)
Madan Mohan Koyyalamudi44bbc152013-07-05 21:13:10 +05301566 case eWNI_SME_GET_ROAM_RSSI_REQ:
1567#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001568#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001569 case eWNI_SME_GET_TSM_STATS_REQ:
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001570#endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */
Siddharth Bhal6af5d4e2014-09-29 21:11:16 +05301571 case eWNI_SME_MAC_SPOOF_ADDR_IND:
Jeff Johnson295189b2012-06-20 16:38:30 -07001572 // These messages are from HDD
1573 limProcessNormalHddMsg(pMac, limMsg, false); //no need to response to hdd
1574 break;
1575
1576 //Power Save Messages From HDD
1577 case eWNI_PMC_PWR_SAVE_CFG:
1578 case eWNI_PMC_ENTER_BMPS_REQ:
1579 case eWNI_PMC_EXIT_BMPS_REQ:
1580 case eWNI_PMC_ENTER_IMPS_REQ:
1581 case eWNI_PMC_EXIT_IMPS_REQ:
1582 case eWNI_PMC_ENTER_UAPSD_REQ:
1583 case eWNI_PMC_EXIT_UAPSD_REQ:
1584 case eWNI_PMC_ENTER_WOWL_REQ:
1585 case eWNI_PMC_EXIT_WOWL_REQ:
1586 case eWNI_PMC_WOWL_ADD_BCAST_PTRN:
1587 case eWNI_PMC_WOWL_DEL_BCAST_PTRN:
1588 pmmProcessMessage(pMac, limMsg);
1589 break;
1590
1591 case eWNI_PMC_SMPS_STATE_IND :
1592 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001593 if(limMsg->bodyptr){
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301594 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001595 limMsg->bodyptr = NULL;
1596 }
1597 }
1598 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001599 case eWNI_SME_SEND_ACTION_FRAME_IND:
1600 limSendP2PActionFrame(pMac, limMsg);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301601 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001602 limMsg->bodyptr = NULL;
1603 break;
1604 case eWNI_SME_ABORT_REMAIN_ON_CHAN_IND:
1605 limAbortRemainOnChan(pMac);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301606 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001607 limMsg->bodyptr = NULL;
1608 break;
1609
Viral Modid86bde22012-12-10 13:09:21 -08001610 case SIR_HAL_P2P_NOA_START_IND:
1611 {
1612 tpPESession psessionEntry = &pMac->lim.gpSession[0];
1613 tANI_U8 i;
Viral Modid440e682013-03-06 02:25:31 -08001614 tANI_U8 p2pGOExists = 0;
Gopichand Nakkala78a6c812013-05-13 16:39:49 +05301615
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001616 limLog(pMac, LOG1, "LIM received NOA start %x", limMsg->type);
Viral Modid440e682013-03-06 02:25:31 -08001617
1618 /* Since insert NOA is done and NOA start msg received, we should deactivate the Insert NOA timer */
1619 limDeactivateAndChangeTimer(pMac, eLIM_INSERT_SINGLESHOT_NOA_TIMER);
1620
Viral Modid86bde22012-12-10 13:09:21 -08001621 for(i=0; i < pMac->lim.maxBssId; i++)
1622 {
1623 psessionEntry = &pMac->lim.gpSession[i];
1624 if ( (psessionEntry != NULL) && (psessionEntry->valid) &&
1625 (psessionEntry->pePersona == VOS_P2P_GO_MODE))
1626 { //Save P2P NOA start attributes for P2P Go persona
Viral Modid440e682013-03-06 02:25:31 -08001627 p2pGOExists = 1;
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301628 vos_mem_copy(&psessionEntry->p2pGoPsNoaStartInd, limMsg->bodyptr,
1629 sizeof(tSirP2PNoaStart));
Viral Modid440e682013-03-06 02:25:31 -08001630 if (psessionEntry->p2pGoPsNoaStartInd.status != eHAL_STATUS_SUCCESS)
Viral Modid86bde22012-12-10 13:09:21 -08001631 {
Viral Modid440e682013-03-06 02:25:31 -08001632 limLog(pMac, LOGW, FL("GO NOA start failure status %d reported by FW."
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001633 " - still go ahead with deferred sme req. This is just info"),
Viral Modid440e682013-03-06 02:25:31 -08001634 psessionEntry->p2pGoPsNoaStartInd.status);
Viral Modid86bde22012-12-10 13:09:21 -08001635 }
Viral Modid86bde22012-12-10 13:09:21 -08001636 break;
1637 }
1638 }
Viral Modid440e682013-03-06 02:25:31 -08001639
1640 if (p2pGOExists == 0)
1641 {
1642 limLog(pMac, LOGW, FL("By the time, we received NOA start, GO is already removed."
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001643 " - still go ahead with deferred sme req. This is just info"));
Viral Modid440e682013-03-06 02:25:31 -08001644 }
1645
1646 /* We received the NOA start indication. Now we can send down the SME request which requires off-channel operation */
1647 limProcessRegdDefdSmeReqAfterNOAStart(pMac);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301648 vos_mem_free(limMsg->bodyptr);
Viral Modid86bde22012-12-10 13:09:21 -08001649 limMsg->bodyptr = NULL;
Viral Modid440e682013-03-06 02:25:31 -08001650 }
Viral Modid86bde22012-12-10 13:09:21 -08001651 break;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301652#ifdef FEATURE_WLAN_TDLS
1653 case SIR_HAL_TDLS_IND:
1654 {
1655 tSirTdlsInd *pTdlsInd = (tpSirTdlsInd)limMsg->bodyptr ;
1656 tpDphHashNode pStaDs = NULL ;
1657 tpPESession psessionEntry = NULL;
1658 tANI_U8 sessionId;
1659 if((psessionEntry = peFindSessionByStaId(pMac,pTdlsInd->staIdx,&sessionId))== NULL)
1660 {
1661 limLog(pMac, LOG1, FL("session does not exist for given bssId\n"));
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301662 vos_mem_free(limMsg->bodyptr);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301663 limMsg->bodyptr = NULL;
1664 return;
1665 }
1666 if ((pStaDs = dphGetHashEntry(pMac, pTdlsInd->assocId, &psessionEntry->dph.dphHashTable)) == NULL)
1667 {
1668 limLog(pMac, LOG1, FL("pStaDs Does not exist for given staId\n"));
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301669 vos_mem_free(limMsg->bodyptr);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301670 limMsg->bodyptr = NULL;
1671 return;
1672 }
Viral Modid86bde22012-12-10 13:09:21 -08001673
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301674 if ((STA_ENTRY_TDLS_PEER == pStaDs->staType))
1675 {
1676 limLog(pMac, LOGE,
1677 FL("received TDLS Indication from the Firmware with Reason Code %d "),
1678 pTdlsInd->reasonCode);
1679 limSendSmeTDLSDelStaInd(pMac, pStaDs, psessionEntry,
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05301680 pTdlsInd->reasonCode);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301681 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301682 vos_mem_free(limMsg->bodyptr);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301683 limMsg->bodyptr = NULL;
1684 }
1685 break;
1686#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001687 case SIR_HAL_P2P_NOA_ATTR_IND:
1688 {
1689 tpPESession psessionEntry = &pMac->lim.gpSession[0];
1690 tANI_U8 i;
1691
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001692 limLog(pMac, LOGW, FL("Received message Noa_ATTR %x"), limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -07001693 for(i=0; i < pMac->lim.maxBssId; i++)
1694 {
Viral Modid86bde22012-12-10 13:09:21 -08001695 psessionEntry = &pMac->lim.gpSession[i];
1696 if ( (psessionEntry != NULL) && (psessionEntry->valid) &&
Jeff Johnson295189b2012-06-20 16:38:30 -07001697 (psessionEntry->pePersona == VOS_P2P_GO_MODE))
1698 { //Save P2P attributes for P2P Go persona
1699
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301700 vos_mem_copy(&psessionEntry->p2pGoPsUpdate, limMsg->bodyptr,
1701 sizeof(tSirP2PNoaAttr));
1702
Arif Hussain24bafea2013-11-15 15:10:03 -08001703 limLog(pMac, LOG2, FL(" &psessionEntry->bssId "
1704 MAC_ADDRESS_STR " ctWin=%d oppPsFlag=%d"),
1705 MAC_ADDR_ARRAY(psessionEntry->bssId),
Jeff Johnson295189b2012-06-20 16:38:30 -07001706 psessionEntry->p2pGoPsUpdate.ctWin,
1707 psessionEntry->p2pGoPsUpdate.oppPsFlag);
1708
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001709 limLog(pMac, LOG2, FL(" uNoa1IntervalCnt=%d uNoa1Duration=%d uNoa1Interval=%d uNoa1StartTime=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001710 psessionEntry->p2pGoPsUpdate.uNoa1IntervalCnt,
1711 psessionEntry->p2pGoPsUpdate.uNoa1Duration,
1712 psessionEntry->p2pGoPsUpdate.uNoa1Interval,
1713 psessionEntry->p2pGoPsUpdate.uNoa1StartTime);
1714
1715
1716 break;
1717 }
1718 }
1719
1720 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301721 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001722 limMsg->bodyptr = NULL;
1723
1724 break;
1725
1726
Jeff Johnson295189b2012-06-20 16:38:30 -07001727 /* eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER Message comes after the
1728 * device comes out of full power for the full power request sent
1729 * because of channel switch with switch count as 0, so call the same
1730 * function used in timeout case(i.e SIR_LIM_CHANNEL_SWITCH_TIMEOUT)
1731 * for switching the channel*/
1732 case eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER:
Jeff Johnsone7245742012-09-05 17:12:55 -07001733 if ( !tx_timer_running(&pMac->lim.limTimers.gLimChannelSwitchTimer) )
1734 {
1735 limProcessChannelSwitchTimeout(pMac);
1736 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301737 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001738 limMsg->bodyptr = NULL;
1739 break;
1740
1741 //Power Save Related Messages From HAL
1742 case WDA_ENTER_BMPS_RSP:
1743 case WDA_EXIT_BMPS_RSP:
1744 case WDA_EXIT_BMPS_IND:
1745 case WDA_ENTER_IMPS_RSP:
1746 case WDA_EXIT_IMPS_RSP:
1747 case WDA_ENTER_UAPSD_RSP:
1748 case WDA_EXIT_UAPSD_RSP:
1749 case WDA_WOWL_ENTER_RSP:
1750 case WDA_WOWL_EXIT_RSP:
1751 pmmProcessMessage(pMac, limMsg);
1752 break;
1753
1754 case WDA_LOW_RSSI_IND:
1755 //limHandleLowRssiInd(pMac);
1756 break;
1757
1758 case WDA_BMPS_STATUS_IND:
1759 limHandleBmpsStatusInd(pMac);
1760 break;
1761
1762 case WDA_MISSED_BEACON_IND:
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001763 limHandleMissedBeaconInd(pMac, limMsg);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301764 vos_mem_free(limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001765 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001766 break;
1767 case WDA_MIC_FAILURE_IND:
1768 limMicFailureInd(pMac, limMsg);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301769 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001770 limMsg->bodyptr = NULL;
1771 break;
1772
1773
Jeff Johnson295189b2012-06-20 16:38:30 -07001774
1775 case SIR_LIM_ADDTS_RSP_TIMEOUT:
1776 limProcessSmeReqMessages(pMac,limMsg);
1777 break;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001778#ifdef FEATURE_WLAN_ESE
1779 case SIR_LIM_ESE_TSM_TIMEOUT:
1780#ifndef FEATURE_WLAN_ESE_UPLOAD
Jeff Johnson295189b2012-06-20 16:38:30 -07001781 limProcessTsmTimeoutHandler(pMac,limMsg);
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001782#endif /* FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001783 break;
1784 case WDA_TSM_STATS_RSP:
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001785#ifdef FEATURE_WLAN_ESE_UPLOAD
1786 limSendSmePEEseTsmRsp(pMac, (tAniGetTsmStatsRsp *)limMsg->bodyptr);
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001787#else
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001788 limProcessHalEseTsmRsp(pMac, limMsg);
1789#endif /* FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001790 break;
1791#endif
1792 case WDA_ADD_TS_RSP:
1793 limProcessHalAddTsRsp(pMac, limMsg);
1794 break;
1795
1796 case SIR_LIM_DEL_TS_IND:
1797 limProcessDelTsInd(pMac, limMsg);
Madan Mohan Koyyalamudif244d8f2012-11-29 11:21:05 -08001798 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001799 case SIR_LIM_ADD_BA_IND:
1800 limProcessAddBaInd(pMac, limMsg);
1801 break;
1802 case SIR_LIM_DEL_BA_ALL_IND:
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001803 limDelAllBASessions(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001804 break;
1805 case SIR_LIM_DEL_BA_IND:
1806 limProcessMlmHalBADeleteInd( pMac, limMsg );
1807 break;
1808
1809 case SIR_LIM_BEACON_GEN_IND: {
Jeff Johnson295189b2012-06-20 16:38:30 -07001810
Jeff Johnson295189b2012-06-20 16:38:30 -07001811 if( pMac->lim.gLimSystemRole != eLIM_AP_ROLE )
Jeff Johnson295189b2012-06-20 16:38:30 -07001812 schProcessPreBeaconInd(pMac, limMsg);
1813
1814 }
1815 break;
1816
1817 case SIR_LIM_DELETE_STA_CONTEXT_IND:
1818 limDeleteStaContext(pMac, limMsg);
1819 break;
1820
1821 case SIR_LIM_MIN_CHANNEL_TIMEOUT:
1822 case SIR_LIM_MAX_CHANNEL_TIMEOUT:
1823 case SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT:
1824 case SIR_LIM_JOIN_FAIL_TIMEOUT:
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001825 case SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001826 case SIR_LIM_AUTH_FAIL_TIMEOUT:
1827 case SIR_LIM_AUTH_RSP_TIMEOUT:
1828 case SIR_LIM_ASSOC_FAIL_TIMEOUT:
1829 case SIR_LIM_REASSOC_FAIL_TIMEOUT:
1830#ifdef WLAN_FEATURE_VOWIFI_11R
1831 case SIR_LIM_FT_PREAUTH_RSP_TIMEOUT:
1832#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001833 case SIR_LIM_REMAIN_CHN_TIMEOUT:
Viral Modid86bde22012-12-10 13:09:21 -08001834 case SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT:
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001835 case SIR_LIM_DISASSOC_ACK_TIMEOUT:
1836 case SIR_LIM_DEAUTH_ACK_TIMEOUT:
Gopichand Nakkalad492d202013-05-10 02:50:47 +05301837 case SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
Jeff Johnson295189b2012-06-20 16:38:30 -07001838 // These timeout messages are handled by MLM sub module
1839
1840 limProcessMlmReqMessages(pMac,
1841 limMsg);
1842
1843 break;
1844
1845 case SIR_LIM_HEART_BEAT_TIMEOUT:
1846 /** check if heart beat failed, even if one Beacon
1847 * is rcvd within the Heart Beat interval continue
1848 * normal processing
1849 */
1850
1851 #if 0
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001852 PELOG1(limLog(pMac, LOG1, FL("Heartbeat timeout, SME %d, MLME %d, #bcn %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001853 pMac->lim.gLimSmeState, pMac->lim.gLimMlmState,
1854 pMac->lim.gLimRxedBeaconCntDuringHB);)
1855
1856 if(pMac->lim.gLimSystemRole == eLIM_STA_IN_IBSS_ROLE)
1857 limIbssHeartBeatHandle(pMac); //HeartBeat for peers.
1858 else
1859 /**
1860 * Heartbeat failure occurred on STA
1861 * This is handled by LMM sub module.
1862 */
1863 limHandleHeartBeatFailure(pMac);
1864
1865 break;
1866 #endif //TO SUPPORT BT-AMP
Yathish9f22e662012-12-10 14:21:35 -08001867 if (limIsSystemInScanState(pMac))
1868 {
1869 // System is in DFS (Learn) mode
1870 // Defer processsing this message
1871 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1872 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001873 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 -08001874 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1875 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
1876 limLogSessionStates(pMac);
1877 }
1878 }
1879 else
1880 {
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001881 if (NULL == limMsg->bodyptr)
1882 {
1883 limHandleHeartBeatTimeout(pMac);
1884 }
1885 else
1886 {
1887 limHandleHeartBeatTimeoutForSession(pMac, (tpPESession)limMsg->bodyptr);
1888 }
Gopichand Nakkala78a6c812013-05-13 16:39:49 +05301889 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001890 break;
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001891
Jeff Johnson295189b2012-06-20 16:38:30 -07001892 case SIR_LIM_PROBE_HB_FAILURE_TIMEOUT:
1893 limHandleHeartBeatFailureTimeout(pMac);
1894 break;
1895
1896 case SIR_LIM_CHANNEL_SCAN_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001897 /**
1898 * Background scan timeout occurred on STA.
1899 * This is handled by LMM sub module.
1900 */
1901 limDeactivateAndChangeTimer(pMac, eLIM_BACKGROUND_SCAN_TIMER);
1902
1903 //We will do background scan even in bcnps mode
1904 //if (pMac->sys.gSysEnableScanMode)
1905 pMac->lim.gLimReportBackgroundScanResults = FALSE;
1906 limTriggerBackgroundScan(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001907 break;
1908
Jeff Johnson295189b2012-06-20 16:38:30 -07001909 case SIR_LIM_CNF_WAIT_TIMEOUT:
1910
1911 /*
1912 ** Does not receive CNF or dummy packet
1913 **/
1914 limHandleCnfWaitTimeout(pMac, (tANI_U16) limMsg->bodyval);
1915
1916 break;
1917
1918 case SIR_LIM_KEEPALIVE_TIMEOUT:
1919 limSendKeepAliveToPeer(pMac);
1920
1921 break;
1922
1923 case SIR_LIM_RETRY_INTERRUPT_MSG:
1924 // Message from ISR upon TFP's max retry limit interrupt
1925
1926 break;
1927
1928 case SIR_LIM_INV_KEY_INTERRUPT_MSG:
1929 // Message from ISR upon SP's Invalid session key interrupt
1930
1931 break;
1932
1933 case SIR_LIM_KEY_ID_INTERRUPT_MSG:
1934 // Message from ISR upon SP's Invalid key ID interrupt
1935
1936 break;
1937
1938 case SIR_LIM_REPLAY_THRES_INTERRUPT_MSG:
1939 // Message from ISR upon SP's Replay threshold interrupt
1940
1941 break;
1942
1943 case SIR_LIM_CHANNEL_SWITCH_TIMEOUT:
1944 limProcessChannelSwitchTimeout(pMac);
1945 break;
1946
1947 case SIR_LIM_QUIET_TIMEOUT:
1948 limProcessQuietTimeout(pMac);
1949 break;
1950
1951 case SIR_LIM_QUIET_BSS_TIMEOUT:
1952 limProcessQuietBssTimeout(pMac);
1953 break;
1954
Jeff Johnson295189b2012-06-20 16:38:30 -07001955 case SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT:
1956 limHandleUpdateOlbcCache(pMac);
1957 break;
1958#if 0
1959 case SIR_LIM_WPS_OVERLAP_TIMEOUT:
1960 limProcessWPSOverlapTimeout(pMac);
1961 break;
1962#endif
1963
Jeff Johnson295189b2012-06-20 16:38:30 -07001964
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001965#ifdef FEATURE_WLAN_TDLS_INTERNAL
1966 /*
1967 * Here discovery timer expires, now we can go ahead and collect all
1968 * the dicovery responses PE has process till now and send this
1969 * responses to SME..
1970 */
1971 case SIR_LIM_TDLS_DISCOVERY_RSP_WAIT:
1972 {
1973 //fetch the sessionEntry based on the sessionId
1974 tpPESession psessionEntry = peFindSessionBySessionId(pMac,
1975 pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId) ;
1976 if(NULL == psessionEntry)
1977 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001978 limLog(pMac, LOGP,FL("Session Does not exist for given sessionID %d"), pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId);
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001979 return;
1980 }
1981
1982 VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001983 ("Discovery Rsp timer expires ")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001984#if 0 // TDLS_hklee: D13 no need to open Addr2 unknown data packet
1985 /* restore RXP filters */
1986 limSetLinkState(pMac, eSIR_LINK_FINISH_TDLS_DISCOVERY_STATE,
1987 psessionEntry->bssId) ;
1988#endif
1989 limSendSmeTdlsDisRsp(pMac, eSIR_SUCCESS,
1990 eWNI_SME_TDLS_DISCOVERY_START_RSP) ;
1991 break ;
1992 }
1993
1994 /*
1995 * we initiated link setup and did not receive TDLS setup rsp
1996 * from TDLS peer STA, send failure RSP to SME.
1997 */
1998 case SIR_LIM_TDLS_LINK_SETUP_RSP_TIMEOUT:
1999 {
2000 tANI_U8 *peerMac = (tANI_U8 *)limMsg->bodyval ;
2001 tLimTdlsLinkSetupPeer *setupPeer = NULL ;
2002
2003 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002004 ("TDLS setup rsp timer expires ")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002005 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Arif Hussaina7c8e412013-11-20 11:06:42 -08002006 ("TDLS setup rsp timer expires for peer:"
2007 MAC_ADDRESS_STR), MAC_ADDR_ARRAY(peerMac));
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002008
2009 limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ;
2010 if(NULL != setupPeer)
2011 {
2012 limTdlsDelLinkPeer( pMac, peerMac) ;
2013 }
2014
2015 limSendSmeTdlsLinkStartRsp(pMac, eSIR_FAILURE, peerMac,
2016 eWNI_SME_TDLS_LINK_START_RSP) ;
2017 break ;
2018 }
2019 case SIR_LIM_TDLS_LINK_SETUP_CNF_TIMEOUT:
2020 {
2021 tANI_U8 *peerMac = (tANI_U8 *)limMsg->bodyval ;
2022 tLimTdlsLinkSetupPeer *setupPeer = NULL ;
2023
2024 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002025 ("TDLS setup CNF timer expires ")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002026 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Arif Hussaina7c8e412013-11-20 11:06:42 -08002027 ("TDLS setup CNF timer expires for peer: "
2028 MAC_ADDRESS_STR), MAC_ADDR_ARRAY(peerMac));
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002029 limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ;
2030 if(NULL != setupPeer)
2031 {
2032 limTdlsDelLinkPeer( pMac, peerMac) ;
2033 }
2034 break ;
2035 }
2036#endif /* FEATURE_WLAN_TDLS TIMER */
Jeff Johnson295189b2012-06-20 16:38:30 -07002037 case WDA_ADD_BSS_RSP:
2038 limProcessMlmAddBssRsp( pMac, limMsg );
2039 break;
2040
2041 case WDA_ADD_STA_RSP:
2042
2043 //call a wrapper by paasing bodyptr, their get sessionID and and call proper function from there.
2044 limProcessAddStaRsp(pMac,limMsg);
2045 break;
2046
2047 case WDA_DELETE_STA_RSP:
2048 limProcessMlmDelStaRsp(pMac, limMsg);
2049 break;
2050
2051 case WDA_ADD_STA_SELF_RSP:
2052 limProcessAddStaSelfRsp(pMac, limMsg);
2053 break;
2054 case WDA_DEL_STA_SELF_RSP:
2055 limProcessDelStaSelfRsp(pMac, limMsg);
2056 break;
2057
2058 case WDA_DELETE_BSS_RSP:
2059 limHandleDeleteBssRsp(pMac,limMsg); //wrapper routine to handle delete bss response
2060 break;
2061
2062 case WDA_SET_BSSKEY_RSP:
2063 case WDA_SET_STA_BCASTKEY_RSP:
2064 limProcessMlmSetBssKeyRsp( pMac, limMsg );
2065 break;
2066 case WDA_SET_STAKEY_RSP:
2067 limProcessMlmSetStaKeyRsp( pMac, limMsg );
2068 break;
2069 case WDA_REMOVE_BSSKEY_RSP:
2070 case WDA_REMOVE_STAKEY_RSP:
2071 limProcessMlmRemoveKeyRsp( pMac, limMsg );
2072 break;
2073 case WDA_ADDBA_RSP:
2074 limProcessMlmHalAddBARsp( pMac, limMsg );
2075 break;
2076
2077 case WDA_STA_STAT_RSP:
2078 case WDA_AGGR_STAT_RSP:
2079 case WDA_GLOBAL_STAT_RSP:
2080 case WDA_STAT_SUMM_RSP:
2081 limSendSmeStatsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
2082 break;
2083
2084 case WDA_GET_STATISTICS_RSP:
2085 limSendSmePEStatisticsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
2086 break;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08002087#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR)
Srinivas Girigowdad34cedb2013-01-25 13:33:11 -08002088 case WDA_GET_ROAM_RSSI_RSP:
2089 limSendSmePEGetRoamRssiRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
2090 break;
2091#endif
2092
Jeff Johnson295189b2012-06-20 16:38:30 -07002093
2094 case WDA_SET_MIMOPS_RSP: //limProcessSetMimoRsp(pMac, limMsg);
2095 case WDA_SET_TX_POWER_RSP: //limProcessSetTxPowerRsp(pMac, limMsg);
2096 case WDA_GET_TX_POWER_RSP: //limProcessGetTxPowerRsp(pMac, limMsg);
2097 case WDA_GET_NOISE_RSP:
2098 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2099 limMsg->bodyptr = NULL;
2100 //limProcessGetNoiseRsp(pMac, limMsg);
2101 break;
2102
2103 case WDA_SET_MAX_TX_POWER_RSP:
2104#if defined WLAN_FEATURE_VOWIFI
2105 rrmSetMaxTxPowerRsp( pMac, limMsg );
2106#endif
2107 if(limMsg->bodyptr != NULL)
2108 {
2109 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2110 limMsg->bodyptr = NULL;
2111 }
2112 break;
2113
Jeff Johnson295189b2012-06-20 16:38:30 -07002114 case SIR_LIM_ADDR2_MISS_IND:
2115 {
2116 limLog(pMac, LOGE,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002117 FL("Addr2 mismatch interrupt received %X"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002118 limMsg->type);
2119 /*a message from HAL indicating addr2 mismatch interrupt occurred
2120 limMsg->bodyptr contains only pointer to 48-bit addr2 field*/
2121 //Dinesh fix this. the third parameter should be sessionentry.
2122 //limHandleUnknownA2IndexFrames(pMac, (void *)limMsg->bodyptr);
2123
2124 /*Free message body pointer*/
2125 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08002126 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07002127 break;
2128 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002129
2130#ifdef WLAN_FEATURE_VOWIFI_11R
2131 case WDA_AGGR_QOS_RSP:
2132 limProcessFTAggrQoSRsp( pMac, limMsg );
2133 break;
2134#endif
2135
2136 case WDA_SET_LINK_STATE_RSP:
2137 linkStateParams = (tLinkStateParams *)limMsg->bodyptr;
2138#if defined WLAN_FEATURE_VOWIFI_11R
2139 pSession = linkStateParams->session;
2140 if(linkStateParams->ft)
2141 {
2142 limSendReassocReqWithFTIEsMgmtFrame(pMac,
2143 pSession->pLimMlmReassocReq,
2144 pSession);
2145 }
2146#endif
2147 if( linkStateParams->callback )
2148 {
2149 linkStateParams->callback( pMac, linkStateParams->callbackArg );
2150 }
2151 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08002152 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07002153 break;
2154
2155#ifdef WLAN_FEATURE_PACKET_FILTERING
2156 case WDA_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP:
2157 pmmProcessMessage(pMac, limMsg);
2158 break;
2159#endif // WLAN_FEATURE_PACKET_FILTERING
2160
2161#ifdef WLAN_FEATURE_GTK_OFFLOAD
2162 case WDA_GTK_OFFLOAD_GETINFO_RSP:
2163 pmmProcessMessage(pMac, limMsg);
2164 break;
2165#endif // WLAN_FEATURE_GTK_OFFLOAD
Yathish9f22e662012-12-10 14:21:35 -08002166 case eWNI_SME_SET_BCN_FILTER_REQ:
2167 {
2168#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2169 tpPESession psessionEntry;
2170 tANI_U8 sessionId = (tANI_U8)limMsg->bodyval ;
2171 psessionEntry = &pMac->lim.gpSession[sessionId];
2172 if(psessionEntry != NULL && IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
2173 {
2174 // sending beacon filtering information down to HAL
2175 if (limSendBeaconFilterInfo(pMac, psessionEntry) != eSIR_SUCCESS)
2176 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002177 limLog(pMac, LOGE, FL("Fail to send Beacon Filter Info "));
Yathish9f22e662012-12-10 14:21:35 -08002178 }
2179 }
Dhanashri Atred7885c22013-03-29 11:19:05 -07002180 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
2181 limMsg->bodyptr = NULL;
Yathish9f22e662012-12-10 14:21:35 -08002182#endif
2183 }
2184 break;
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302185 case eWNI_SME_HT40_OBSS_SCAN_IND:
2186 {
Sandeep Puligilla9f384742014-04-11 02:27:04 +05302187 tpPESession psessionEntry = NULL;
2188 tANI_U8 sessionId;
2189 tSirSmeHT40OBSSScanInd *ht40ScanInd =
Siddharth Bhald31c1252014-05-05 19:34:14 +05302190 (tSirSmeHT40OBSSScanInd *)limMsg->bodyptr;
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302191
Sandeep Puligilla9f384742014-04-11 02:27:04 +05302192 psessionEntry = peFindSessionByBssid(pMac, ht40ScanInd->peerMacAddr,
Siddharth Bhald31c1252014-05-05 19:34:14 +05302193 &sessionId);
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302194
Siddharth Bhald31c1252014-05-05 19:34:14 +05302195 if (psessionEntry != NULL)
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302196 {
Siddharth Bhald31c1252014-05-05 19:34:14 +05302197 if( IS_HT40_OBSS_SCAN_FEATURE_ENABLE &&
2198 psessionEntry->htSupportedChannelWidthSet ==
2199 WNI_CFG_CHANNEL_BONDING_MODE_ENABLE )
2200 {
2201 VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO,
2202 "OBSS Scan Start Req: session id %d"
2203 "htSupportedChannelWidthSet %d", psessionEntry->peSessionId,
2204 psessionEntry->htSupportedChannelWidthSet);
2205 limSendHT40OBSSScanInd(pMac, psessionEntry);
2206 }
2207 else
2208 {
2209 VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO,
2210 "OBSS Scan not started: htSupportedChannelWidthSet- %d"
2211 " session id %d", psessionEntry->htSupportedChannelWidthSet,
2212 psessionEntry->peSessionId);
2213 }
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302214 }
2215 else
2216 {
2217 VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO,
Siddharth Bhald31c1252014-05-05 19:34:14 +05302218 "OBSS Scan not started: session id is NULL");
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302219 }
2220 vos_mem_free(limMsg->bodyptr);
2221 limMsg->bodyptr = NULL;
2222 }
2223 break;
2224 case eWNI_SME_HT40_STOP_OBSS_SCAN_IND:
2225 {
2226 tpPESession psessionEntry = NULL;
2227 tANI_U8 sessionId = (tANI_U8)limMsg->bodyval ;
2228
2229 psessionEntry = &pMac->lim.gpSession[sessionId];
2230 /* Sending LIM STOP OBSS SCAN Indication
2231 Stop command support is only for debugging purpose */
2232 if ( IS_HT40_OBSS_SCAN_FEATURE_ENABLE )
2233 limSendHT40OBSSStopScanInd(pMac, psessionEntry);
2234 else
2235 VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_ERROR,
2236 "OBSS Scan Stop not started ");
2237 }
2238 break;
Hardik Kantilal Patel62a3a762014-11-21 12:55:57 +05302239#ifdef WLAN_FEATURE_AP_HT40_24G
2240 case eWNI_SME_SET_HT_2040_MODE:
2241 limProcessSmeReqMessages(pMac, limMsg);
2242 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2243 limMsg->bodyptr = NULL;
2244 break;
2245#endif
2246
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05302247#ifdef FEATURE_WLAN_TDLS
2248 case WDA_SET_TDLS_LINK_ESTABLISH_REQ_RSP:
2249 {
Gopichand Nakkala24be5312013-07-02 16:47:12 +05302250 tpPESession psessionEntry;
2251 tANI_U8 sessionId;
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05302252 tTdlsLinkEstablishParams *pTdlsLinkEstablishParams;
2253 pTdlsLinkEstablishParams = (tTdlsLinkEstablishParams*) limMsg->bodyptr;
Gopichand Nakkala24be5312013-07-02 16:47:12 +05302254
2255 if((psessionEntry = peFindSessionByStaId(pMac,
2256 pTdlsLinkEstablishParams->staIdx,
2257 &sessionId))== NULL)
2258 {
2259 limLog(pMac, LOGE, FL("session %u does not exist.\n"), sessionId);
2260 /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP message to SME
2261 with session id as zero and status as FAILURE so, that message
2262 queued in SME queue can be freed to prevent the SME cmd buffer leak */
2263 limSendSmeTdlsLinkEstablishReqRsp(pMac,
2264 0,
2265 NULL,
2266 NULL,
2267 eSIR_FAILURE);
2268 }
2269 else
2270 {
2271 limSendSmeTdlsLinkEstablishReqRsp(pMac,
2272 psessionEntry->smeSessionId,
2273 NULL,
2274 NULL,
2275 pTdlsLinkEstablishParams->status) ;
2276 }
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05302277 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
2278 limMsg->bodyptr = NULL;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05302279 break;
2280 }
Atul Mittal60bd4292014-08-14 12:19:27 +05302281
2282 case WDA_SET_TDLS_CHAN_SWITCH_REQ_RSP:
2283 {
2284 tpPESession psessionEntry;
2285 tANI_U8 sessionId;
2286 tTdlsChanSwitchParams *pTdlsChanSwitchParams;
2287 pTdlsChanSwitchParams = (tTdlsChanSwitchParams*) limMsg->bodyptr;
2288
2289 if((psessionEntry = peFindSessionByStaId(pMac,
2290 pTdlsChanSwitchParams->staIdx,
2291 &sessionId))== NULL)
2292 {
2293 limLog(pMac, LOGE, FL("session %u does not exist.\n"), sessionId);
2294 /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP message to SME
2295 with session id as zero and status as FAILURE so, that message
2296 queued in SME queue can be freed to prevent the SME cmd buffer leak */
2297 limSendSmeTdlsChanSwitchReqRsp(pMac,
2298 0,
2299 NULL,
2300 NULL,
2301 eSIR_FAILURE);
2302 }
2303 else
2304 {
2305 limSendSmeTdlsChanSwitchReqRsp(pMac,
2306 psessionEntry->smeSessionId,
2307 NULL,
2308 NULL,
2309 pTdlsChanSwitchParams->status) ;
2310 }
2311 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
2312 limMsg->bodyptr = NULL;
2313 break;
2314 }
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05302315#endif
Gopichand Nakkala2c231c82013-06-11 17:49:16 +05302316
2317 case WDA_RX_SCAN_EVENT:
2318 limProcessRxScanEvent(pMac, limMsg->bodyptr);
2319 break;
2320
Ravi Joshid2ca7c42013-07-23 08:37:49 -07002321 case WDA_IBSS_PEER_INACTIVITY_IND:
2322 {
2323 limProcessIbssPeerInactivity(pMac, limMsg->bodyptr);
2324 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
2325 limMsg->bodyptr = NULL;
2326 break;
2327 }
2328
Siddharth Bhal4f3187c2014-10-09 21:38:08 +05302329 case WDA_SPOOF_MAC_ADDR_RSP:
2330 limProcessMlmSpoofMacAddrRsp(pMac, (tSirRetStatus)limMsg->bodyval);
2331 break;
2332
Jeff Johnson295189b2012-06-20 16:38:30 -07002333 default:
2334 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2335 limMsg->bodyptr = NULL;
2336 // Unwanted messages
2337 // Log error
2338 limLog(pMac, LOGE,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002339 FL("Discarding unexpected message received %X"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002340 limMsg->type);
2341 limPrintMsgName(pMac, LOGE, limMsg->type);
2342 break;
2343
2344 } // switch (limMsg->type)
2345
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002346 PELOG2(limLog(pMac, LOG2, FL("Done Processing msgType = %d, sme state = %s, mlm state = %s"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002347 limMsg->type, limSmeStateStr(pMac->lim.gLimSmeState),
2348 limMlmStateStr(pMac->lim.gLimMlmState));)
2349
2350} /*** end limProcessMessages() ***/
2351
2352
2353
2354/**
2355 * limProcessDeferredMessageQueue
2356 *
2357 *FUNCTION:
2358 * This function is called by LIM while exiting from Learn
2359 * mode. This function fetches messages posted to the LIM
2360 * deferred message queue limDeferredMsgQ.
2361 *
2362 *LOGIC:
2363 *
2364 *ASSUMPTIONS:
2365 * NA
2366 *
2367 *NOTE:
2368 * NA
2369 *
2370 * @param pMac - Pointer to Global MAC structure
2371 * @return None
2372 */
2373
2374void
2375limProcessDeferredMessageQueue(tpAniSirGlobal pMac)
2376{
2377 tSirMsgQ limMsg = { 0, 0, 0 };
2378
Jeff Johnson295189b2012-06-20 16:38:30 -07002379 tSirMsgQ *readMsg;
2380 tANI_U16 size;
2381
2382 /*
2383 ** check any deferred messages need to be processed
2384 **/
2385 size = pMac->lim.gLimDeferredMsgQ.size;
2386 if (size > 0)
2387 {
2388 while ((readMsg = limReadDeferredMsgQ(pMac)) != NULL)
2389 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302390 vos_mem_copy((tANI_U8*) &limMsg,
Jeff Johnson295189b2012-06-20 16:38:30 -07002391 (tANI_U8*) readMsg, sizeof(tSirMsgQ));
2392 size--;
2393 limProcessMessages(pMac, &limMsg);
2394
2395 if((limIsSystemInScanState(pMac)) || (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) ||
2396 (pMac->lim.gLimSystemInScanLearnMode))
2397 break;
2398 }
2399 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002400} /*** end limProcessDeferredMessageQueue() ***/
2401
2402
2403/*
2404 * limProcessNormalHddMsg
2405 * Function: this function checks the current lim state and decide whether the message passed shall be deffered.
2406 * @param pMac - Pointer to Global MAC structure
2407 * pLimMsg -- the message need to be processed
2408 * fRspReqd -- whether return result to hdd
2409 * @return None
2410 */
2411void limProcessNormalHddMsg(tpAniSirGlobal pMac, tSirMsgQ *pLimMsg, tANI_U8 fRspReqd)
2412{
2413 tANI_BOOLEAN fDeferMsg = eANI_BOOLEAN_TRUE;
2414
2415 /* Added For BT-AMP Support */
2416 if ((pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_AP_ROLE )
2417 ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_STA_ROLE)
2418 ||(pMac->lim.gLimSystemRole == eLIM_UNKNOWN_ROLE))
2419 {
2420 /** This check is required only for the AP and in 2 cases.
2421 * 1. If we are in learn mode and we receive any of these messages,
2422 * you have to come out of scan and process the message, hence dont
2423 * defer the message here. In handler, these message could be defered
2424 * till we actually come out of scan mode.
2425 * 2. If radar is detected, you might have to defer all of these
2426 * messages except Stop BSS request/ Switch channel request. This
2427 * decision is also made inside its handler.
2428 *
2429 * Please be careful while using the flag fDeferMsg. Possibly you
2430 * might end up in an infinite loop.
2431 **/
2432 if (((pLimMsg->type == eWNI_SME_START_BSS_REQ) ||
2433 (pLimMsg->type == eWNI_SME_STOP_BSS_REQ) ||
2434 (pLimMsg->type == eWNI_SME_SWITCH_CHL_REQ) ||
2435 (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ) ||
2436 (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ)))
2437 {
2438 fDeferMsg = eANI_BOOLEAN_FALSE;
2439 }
2440 }
2441
2442 /* limInsystemInscanState() refers the psessionEntry, how to get session Entry????*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002443 if (((pMac->lim.gLimAddtsSent) || (limIsSystemInScanState(pMac)) /*||
2444 (LIM_IS_RADAR_DETECTED(pMac))*/) && fDeferMsg)
Jeff Johnson295189b2012-06-20 16:38:30 -07002445 {
2446 // System is in DFS (Learn) mode or awaiting addts response
2447 // or if radar is detected, Defer processsing this message
2448 if (limDeferMsg(pMac, pLimMsg) != TX_SUCCESS)
2449 {
2450#ifdef WLAN_DEBUG
2451 pMac->lim.numSme++;
2452#endif
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002453 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 -07002454 pLimMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
2455 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
2456 limLogSessionStates(pMac);
2457 limPrintMsgName(pMac, LOGE, pLimMsg->type);
2458 // Release body
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302459 vos_mem_free(pLimMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08002460 pLimMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07002461 }
2462 }
2463 else
2464 {
2465 if(fRspReqd)
2466 {
2467 // These messages are from HDD
2468 // Since these requests may also be generated
2469 // internally within LIM module, need to
2470 // distinquish and send response to host
2471 pMac->lim.gLimRspReqd = eANI_BOOLEAN_TRUE;
2472 }
2473#ifdef WLAN_DEBUG
2474 pMac->lim.numSme++;
2475#endif
2476 if(limProcessSmeReqMessages(pMac, pLimMsg))
2477 {
2478 // Release body
2479 // limProcessSmeReqMessage consumed the buffer. We can free it.
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302480 vos_mem_free(pLimMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08002481 pLimMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07002482 }
2483 }
2484}
2485
2486void
Jeff Johnsone7245742012-09-05 17:12:55 -07002487handleHTCapabilityandHTInfo(struct sAniSirGlobal *pMac, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07002488{
2489 tSirMacHTCapabilityInfo macHTCapabilityInfo;
2490 tSirMacHTParametersInfo macHTParametersInfo;
2491 tSirMacHTInfoField1 macHTInfoField1;
2492 tSirMacHTInfoField2 macHTInfoField2;
2493 tSirMacHTInfoField3 macHTInfoField3;
2494 tANI_U32 cfgValue;
2495 tANI_U8 *ptr;
Jeff Johnson295189b2012-06-20 16:38:30 -07002496
Jeff Johnson295189b2012-06-20 16:38:30 -07002497 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_CAP_INFO, &cfgValue) != eSIR_SUCCESS)
2498 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002499 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_CAP_INFO value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002500 return ;
2501 }
2502 ptr = (tANI_U8 *) &macHTCapabilityInfo;
2503 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2504 pMac->lim.gHTLsigTXOPProtection = (tANI_U8)macHTCapabilityInfo.lsigTXOPProtection;
2505 pMac->lim.gHTMIMOPSState = (tSirMacHTMIMOPowerSaveState) macHTCapabilityInfo.mimoPowerSave;
2506 pMac->lim.gHTGreenfield = (tANI_U8)macHTCapabilityInfo.greenField;
2507 pMac->lim.gHTMaxAmsduLength = (tANI_U8)macHTCapabilityInfo.maximalAMSDUsize;
2508 pMac->lim.gHTShortGI20Mhz = (tANI_U8)macHTCapabilityInfo.shortGI20MHz;
2509 pMac->lim.gHTShortGI40Mhz = (tANI_U8)macHTCapabilityInfo.shortGI40MHz;
Jeff Johnson295189b2012-06-20 16:38:30 -07002510 pMac->lim.gHTPSMPSupport = (tANI_U8)macHTCapabilityInfo.psmp;
2511 pMac->lim.gHTDsssCckRate40MHzSupport = (tANI_U8)macHTCapabilityInfo.dsssCckMode40MHz;
2512
2513 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_AMPDU_PARAMS, &cfgValue) != eSIR_SUCCESS)
2514 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002515 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_PARAM_INFO value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002516 return ;
2517 }
2518 ptr = (tANI_U8 *) &macHTParametersInfo;
2519 *ptr = (tANI_U8) (cfgValue & 0xff);
2520 pMac->lim.gHTAMpduDensity = (tANI_U8)macHTParametersInfo.mpduDensity;
2521 pMac->lim.gHTMaxRxAMpduFactor = (tANI_U8)macHTParametersInfo.maxRxAMPDUFactor;
2522
2523 // Get HT IE Info
2524 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD1, &cfgValue) != eSIR_SUCCESS)
2525 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002526 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD1 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002527 return ;
2528 }
2529 ptr = (tANI_U8 *) &macHTInfoField1;
2530 *((tANI_U8 *)ptr) = (tANI_U8) (cfgValue & 0xff);
2531 pMac->lim.gHTServiceIntervalGranularity = (tANI_U8)macHTInfoField1.serviceIntervalGranularity;
2532 pMac->lim.gHTControlledAccessOnly = (tANI_U8)macHTInfoField1.controlledAccessOnly;
2533 pMac->lim.gHTRifsMode = (tANI_U8)macHTInfoField1.rifsMode;
Jeff Johnson295189b2012-06-20 16:38:30 -07002534
2535 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD2, &cfgValue) != eSIR_SUCCESS)
2536 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002537 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD2 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002538 return ;
2539 }
2540 ptr = (tANI_U8 *) &macHTInfoField2;
2541 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2542 pMac->lim.gHTOperMode = (tSirMacHTOperatingMode) macHTInfoField2.opMode;
2543
2544 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD3, &cfgValue) != eSIR_SUCCESS)
2545 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002546 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD3 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002547 return ;
2548 }
2549 ptr = (tANI_U8 *) &macHTInfoField3;
2550 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2551 pMac->lim.gHTPCOActive = (tANI_U8)macHTInfoField3.pcoActive;
2552 pMac->lim.gHTPCOPhase = (tANI_U8)macHTInfoField3.pcoPhase;
Jeff Johnson295189b2012-06-20 16:38:30 -07002553 pMac->lim.gHTSecondaryBeacon = (tANI_U8)macHTInfoField3.secondaryBeacon;
2554 pMac->lim.gHTDualCTSProtection = (tANI_U8)macHTInfoField3.dualCTSProtection;
2555 pMac->lim.gHTSTBCBasicMCS = (tANI_U8)macHTInfoField3.basicSTBCMCS;
Jeff Johnsone7245742012-09-05 17:12:55 -07002556
2557 /* The lim globals for channelwidth and secondary chnl have been removed and should not be used during no session;
2558 * instead direct cfg is read and used when no session for transmission of mgmt frames (same as old);
2559 * For now, we might come here during init and join with sessionEntry = NULL; in that case just fill the globals which exist
2560 * Sessionized entries values will be filled in join or add bss req. The ones which are missed in join are filled below
2561 */
2562 if (psessionEntry != NULL)
2563 {
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302564 psessionEntry->htCapability =
2565 IS_DOT11_MODE_HT(psessionEntry->dot11mode);
2566 psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport =
2567 (tANI_U8)macHTInfoField3.lsigTXOPProtectionFullSupport;
Sandeep Puligilla70b6b162014-04-19 02:06:04 +05302568 limInitOBSSScanParams(pMac, psessionEntry);
Jeff Johnsone7245742012-09-05 17:12:55 -07002569 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002570}
2571
2572void limLogSessionStates(tpAniSirGlobal pMac)
2573{
2574#ifdef WLAN_DEBUG
2575 int i;
2576
2577 for(i = 0; i < pMac->lim.maxBssId; i++)
2578 {
2579 if(pMac->lim.gpSession[i].valid)
2580 {
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302581 limLog(pMac, LOG1, FL("Session[%d] sysRole(%d) limSmeState %d "
2582 "(prev sme state %d) mlm state %d (prev mlm state %d)"),
2583 i, pMac->lim.gpSession[i].limSystemRole,
2584 pMac->lim.gpSession[i].limSmeState,
2585 pMac->lim.gpSession[i].limPrevSmeState,
2586 pMac->lim.gpSession[i].limMlmState,
2587 pMac->lim.gpSession[i].limPrevMlmState);
Jeff Johnson295189b2012-06-20 16:38:30 -07002588 }
2589 }
2590#endif //ifdef WLAN_DEBUG
2591}