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