blob: 93cd6510cc2be09de1caac455f57d8ab3bcf261d [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Masti, Narayanraddif10fd792015-12-15 15:01:01 +05302 * Copyright (c) 2011-2016 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
Abhishek Singh00b71972016-01-07 10:51:04 +053078#ifdef WLAN_FEATURE_RMC
79#include "limRMC.h"
80#endif
81
Jeff Johnson295189b2012-06-20 16:38:30 -070082#include "vos_types.h"
83#include "vos_packet.h"
84#include "vos_memory.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070085
Katya Nigam3802f202013-12-16 19:27:14 +053086/* This value corresponds to 500 ms */
Abhishek Singh849366d2015-11-26 16:53:47 +053087#define MAX_PROBEREQ_TIME 50
Katya Nigam3802f202013-12-16 19:27:14 +053088
Dino Mycle7a76e662014-06-10 11:36:34 +053089#ifdef WLAN_FEATURE_EXTSCAN
90#define SIZE_OF_FIXED_PARAM 12
91#endif
92
Masti, Narayanraddif10fd792015-12-15 15:01:01 +053093#define CHECK_BIT(value, mask) ((value) & (1 << (mask)))
94
Jeff Johnson295189b2012-06-20 16:38:30 -070095void limLogSessionStates(tpAniSirGlobal pMac);
96
97/** -------------------------------------------------------------
98\fn defMsgDecision
99\brief The function decides whether to defer a message or not in limProcessMessage function
100\param tpAniSirGlobal pMac
101\param tSirMsgQ limMsg
102\param tSirMacTspecIE *ppInfo
103\return none
104 -------------------------------------------------------------*/
105
106tANI_U8 static
107defMsgDecision(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
108{
109
110
111/* this function should not changed */
Jeff Johnsone7245742012-09-05 17:12:55 -0700112 if(pMac->lim.gLimSmeState == eLIM_SME_OFFLINE_STATE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700113 {
114 // Defer processsing this message
115 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
116 {
Madan Mohan Koyyalamudi5695b502012-09-24 14:21:12 -0700117 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 -0700118 limMsg->type, limMsgStr(limMsg->type), pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
119 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
120 limLogSessionStates(pMac);
121 limHandleDeferMsgError(pMac, limMsg);
122 }
123 return true;
124 }
125
126 //When defer is requested then defer all the messages except HAL responses.
127 if((!limIsSystemInScanState(pMac)) && (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) &&
128 !pMac->lim.gLimSystemInScanLearnMode)
129 {
130 if((limMsg->type != WDA_ADD_BSS_RSP) &&
131 (limMsg->type != WDA_DELETE_BSS_RSP) &&
132 (limMsg->type != WDA_ADD_STA_RSP) &&
133 (limMsg->type != WDA_ADD_STA_SELF_RSP) &&
134 (limMsg->type != WDA_DEL_STA_SELF_RSP) &&
135 (limMsg->type != WDA_DELETE_STA_RSP)&&
136 (limMsg->type != WDA_SET_BSSKEY_RSP)&&
137 (limMsg->type != WDA_SET_STAKEY_RSP)&&
138 (limMsg->type != WDA_SET_STA_BCASTKEY_RSP) &&
Jeff Johnson295189b2012-06-20 16:38:30 -0700139 (limMsg->type != eWNI_SME_START_REQ) &&
140 (limMsg->type != WDA_AGGR_QOS_RSP) &&
141 (limMsg->type != WDA_REMOVE_BSSKEY_RSP) &&
142 (limMsg->type != WDA_REMOVE_STAKEY_RSP) &&
143 (limMsg->type != WDA_SET_MIMOPS_RSP)&&
144 (limMsg->type != WDA_ADDBA_RSP) &&
145 (limMsg->type != WDA_ENTER_BMPS_RSP) &&
146 (limMsg->type != WDA_EXIT_BMPS_RSP) &&
147 (limMsg->type != WDA_ENTER_IMPS_RSP) &&
148 (limMsg->type != WDA_EXIT_IMPS_RSP) &&
149 (limMsg->type != WDA_ENTER_UAPSD_RSP) &&
150 (limMsg->type != WDA_EXIT_UAPSD_RSP) &&
151 (limMsg->type != WDA_WOWL_ENTER_RSP) &&
152 (limMsg->type != WDA_WOWL_EXIT_RSP) &&
153 (limMsg->type != WDA_SWITCH_CHANNEL_RSP) &&
Jeff Johnson295189b2012-06-20 16:38:30 -0700154 (limMsg->type != WDA_P2P_NOA_ATTR_IND) &&
Viral Modid440e682013-03-06 02:25:31 -0800155 (limMsg->type != WDA_P2P_NOA_START_IND) &&
Jeff Johnsone7245742012-09-05 17:12:55 -0700156#ifdef FEATURE_OEM_DATA_SUPPORT
157 (limMsg->type != WDA_START_OEM_DATA_RSP) &&
158#endif
Hema Aparna Medicharlab56b6612015-05-18 11:42:52 +0530159 (limMsg->type != WDA_ADD_TS_RSP) &&
Hanumantha Reddy Pothula3de8d4c2015-10-07 12:06:37 +0530160
161 /* LIM won't process any defer queue commands if gLimAddtsSent is set to
162 TRUE. gLimAddtsSent will be set TRUE to while sending ADDTS REQ. Say,
163 when deferring is enabled, if SIR_LIM_ADDTS_RSP_TIMEOUT is posted
164 (because of not receiving ADDTS RSP) then this command will be added
165 to defer queue and as gLimAddtsSent is set TRUE LIM will never
166 process any commands from defer queue, including
167 SIR_LIM_ADDTS_RSP_TIMEOUT. Hence allowing SIR_LIM_ADDTS_RSP_TIMEOUT
168 command to be processed with deferring enabled, so that this will be
169 processed immediately and sets gLimAddtsSent to FALSE.
170 */
171 (limMsg->type != SIR_LIM_ADDTS_RSP_TIMEOUT) &&
Sachin Ahuja3d47fcd2015-08-28 16:02:06 +0530172 (limMsg->type != WDA_LOST_LINK_PARAMS_IND) &&
Hema Aparna Medicharlab56b6612015-05-18 11:42:52 +0530173 /* Allow processing of RX frames while awaiting reception of
174 ADD TS response over the air. This logic particularly handles the
175 case when host sends ADD BA request to FW after ADD TS request
176 is sent over the air and ADD TS response received over the air */
177 !(limMsg->type == SIR_BB_XPORT_MGMT_MSG && pMac->lim.gLimAddtsSent))
Jeff Johnson295189b2012-06-20 16:38:30 -0700178 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700179 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 -0700180 limMsgStr(limMsg->type));)
181
182 // Defer processsing this message
183 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
184 {
Madan Mohan Koyyalamudi5695b502012-09-24 14:21:12 -0700185 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 -0700186 limMsg->type, limMsgStr(limMsg->type), pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
187 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
188 limLogSessionStates(pMac);
189 limHandleDeferMsgError(pMac, limMsg);
190
191 }
192 return true;
193 }
194 }
195 return false;
196}
197
198/*
199* Beacon Handling Cases:
200* during scanning, when no session is active:
201* handled by limHandleFramesInScanState before __limHandleBeacon call is invoked.
202* during scanning, when any session is active, but beacon/Pr does not belong to that session, psessionEntry will be null.
203* handled by limHandleFramesInScanState before __limHandleBeacon call is invoked.
204* during scanning, when any session is active, and beacon/Pr belongs to one of the session, psessionEntry will not be null.
205* handled by limHandleFramesInScanState before __limHandleBeacon call is invoked.
206* Not scanning, no session:
207* there should not be any beacon coming, if coming, should be dropped.
208* Not Scanning,
209*/
210static void
211__limHandleBeacon(tpAniSirGlobal pMac, tpSirMsgQ pMsg, tpPESession psessionEntry)
212{
213 /* checking for global SME state...*/
214 tANI_U8 *pRxPacketInfo;
215 limGetBDfromRxPacket(pMac, pMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo);
216
217 //This function should not be called if beacon is received in scan state.
218 //So not doing any checks for the global state.
219
220 if(psessionEntry == NULL)
221 {
222 schBeaconProcess(pMac, pRxPacketInfo, NULL);
223 }
224 else if( (psessionEntry->limSmeState == eLIM_SME_LINK_EST_STATE) ||
225 (psessionEntry->limSmeState == eLIM_SME_NORMAL_STATE))
226 {
227 schBeaconProcess(pMac, pRxPacketInfo, psessionEntry);
228 }
229 else
230 limProcessBeaconFrame(pMac, pRxPacketInfo, psessionEntry);
231
232 return;
233}
234
235
236//Fucntion prototype
237void limProcessNormalHddMsg(tpAniSirGlobal pMac, tSirMsgQ *pLimMsg, tANI_U8 fRspReqd);
238
239/**
Jeff Johnson295189b2012-06-20 16:38:30 -0700240 * limDeferMsg()
241 *
242 *FUNCTION:
243 * This function is called to defer the messages received
244 * during Learn mode
245 *
246 *LOGIC:
247 * NA
248 *
249 *ASSUMPTIONS:
250 * NA
251 *
252 *NOTE:
253 * NA
254 *
255 * @param pMac - Pointer to Global MAC structure
256 * @param pMsg of type tSirMsgQ - Pointer to the message structure
257 * @return None
258 */
259
260tANI_U32
261limDeferMsg(tpAniSirGlobal pMac, tSirMsgQ *pMsg)
262{
263 tANI_U32 retCode = TX_SUCCESS;
Jeff Johnson77165482013-03-07 08:15:44 -0800264
265 retCode = limWriteDeferredMsgQ(pMac, pMsg);
266
Jeff Johnson295189b2012-06-20 16:38:30 -0700267 if (retCode == TX_SUCCESS)
Jeff Johnson77165482013-03-07 08:15:44 -0800268 {
Rashmi Ramanna6c13a342014-01-07 11:44:07 +0530269 limLog(pMac, LOG1,
270 FL("Deferred message(0x%X) limSmeState %d (prev sme state %d)"
271 " sysRole %d mlm state %d (prev mlm state %d)"),
272 pMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
273 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState,
274 pMac->lim.gLimPrevMlmState);
Jeff Johnson77165482013-03-07 08:15:44 -0800275 MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DEFERRED));)
276 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700277 else
Jeff Johnson77165482013-03-07 08:15:44 -0800278 {
Agarwal Ashishe865f332014-04-08 13:20:06 +0530279 limLog(pMac, LOG1, FL("Dropped lim message (0x%X)"), pMsg->type);
Jeff Johnson77165482013-03-07 08:15:44 -0800280 MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DROPPED));)
281 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700282
283 return retCode;
284} /*** end limDeferMsg() ***/
285
286
287
288/**
289 * limHandleFramesInScanState()
290 *
291 *FUNCTION:
292 * This function is called to process 802.11 frames
293 * received by LIM in scan state.
294 *
295 *LOGIC:
296 * NA
297 *
298 *ASSUMPTIONS:
299 * NA
300 *
301 *NOTE:
302 * NA
303 *
304 * @param pMac - Pointer to Global MAC structure
305 * @param limMsg - Received message
306 * @param pRxPacketInfo - Pointer to Rx packet info structure
307 * @param deferMsg - Indicates whether the frame shall be deferred
308 * @return None
309 */
310
311static void
312limHandleFramesInScanState(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pRxPacketInfo, tANI_U8 *deferMsg, tpPESession psessionEntry)
313{
314 tSirMacFrameCtl fc;
315 tpSirMacMgmtHdr pHdr;
Jeff Johnson295189b2012-06-20 16:38:30 -0700316
317 *deferMsg = false;
318 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
319 fc = pHdr->fc;
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700320 limLog( pMac, LOG2, FL("ProtVersion %d, Type %d, Subtype %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700321 fc.protVer, fc.type, fc.subType );
322
Jeff Johnson295189b2012-06-20 16:38:30 -0700323 // defer all message in scan state except for Beacons and Probe Response
324 if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_BEACON))
325 {
326 if (psessionEntry == NULL)
327 limProcessBeaconFrameNoSession(pMac, pRxPacketInfo);
328 else
329 limProcessBeaconFrame(pMac, pRxPacketInfo,psessionEntry);
330 }
331 else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_PROBE_RSP))
332 {
333 if (psessionEntry == NULL)
334 limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo);
335 else
336 limProcessProbeRspFrame(pMac, pRxPacketInfo,psessionEntry);
337 }
338 else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_PROBE_REQ))
339 {
340 limProcessProbeReqFrame_multiple_BSS(pMac, pRxPacketInfo, psessionEntry);
341 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700342 else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_ACTION))
343 {
344 limProcessActionFrameNoSession( pMac, pRxPacketInfo);
345 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700346 else
347 {
348 *deferMsg = true;
349 return;
350 }
351
Jeff Johnson295189b2012-06-20 16:38:30 -0700352 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr);
353 return;
354
355} /*** end limHandleFramesInScanState() ***/
356
357/** ------------------------------------------------------------
358\brief This function handles Unknown Unicast (A2 Index)
359\ packets.
360\param tpAniSirGlobal pMac Global Mac data structure
361\param void *pRxPacketInfo Pointer to Buffer Descriptor
362\return none
363\
364\ -------------------------------------------------------------- */
365static void limHandleUnknownA2IndexFrames(tpAniSirGlobal pMac, void *pRxPacketInfo,tpPESession psessionEntry)
366{
Jeff Johnson295189b2012-06-20 16:38:30 -0700367 /* addr2 mismatch interrupt occurred this means previous
368 disassociation was not successful
369 In Volans pRxPacketInfo only contains pointer 48-bit address2 field */
370 /*Send disassociation message again*/
371 //Dinesh need one more arguement.
372 //limSendDisassocMgmtFrame(pMac, eSIR_MAC_CLASS3_FRAME_FROM_NON_ASSOC_STA_REASON,(tANI_U8 *) pRxPacketInfo);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800373 //TODO: verify this
Jeff Johnson295189b2012-06-20 16:38:30 -0700374 //This could be a public action frame.
375 if( psessionEntry->limSystemRole == eLIM_P2P_DEVICE_ROLE )
376 limProcessActionFrameNoSession(pMac, (tANI_U8 *) pRxPacketInfo);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800377
378#ifdef FEATURE_WLAN_TDLS
379 {
380 tpSirMacDataHdr3a pMacHdr;
381 pMacHdr = WDA_GET_RX_MPDUHEADER3A(pRxPacketInfo);
382
383 if (limIsGroupAddr(pMacHdr->addr2))
384 {
Abhishek Singh525045c2014-12-15 17:18:45 +0530385 limLog(pMac, LOG1, FL("Ignoring A2 Invalid Packet received for MC/BC:"));
386 limPrintMacAddr(pMac, pMacHdr->addr2, LOG1);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800387
388 return;
389 }
390 /* TDLS_hklee: move down here to reject Addr2 == Group (first checking above)
391 and also checking if SystemRole == STA */
392 if (psessionEntry->limSystemRole == eLIM_STA_ROLE)
393 {
394 /* ADD handling of Public Action Frame */
395 LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, \
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700396 ("limHandleUnknownA2IndexFrames: type=0x%x, subtype=0x%x"),pMacHdr->fc.type, pMacHdr->fc.subType));
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800397 switch (pMacHdr->fc.type)
398 {
399 case SIR_MAC_MGMT_FRAME:
400 {
401 switch (pMacHdr->fc.subType)
402 {
403 case SIR_MAC_MGMT_ACTION:
404 {
405 limProcessActionFrame(pMac, pRxPacketInfo, psessionEntry) ;
406 break ;
407 }
408 default:
409 {
410 break ;
411 }
412 }
413 }
414 default:
415 {
416 break ;
417 }
418 }
419 }
420 }
421#endif
422
Jeff Johnson295189b2012-06-20 16:38:30 -0700423
424 return;
425}
426
Jeff Johnson295189b2012-06-20 16:38:30 -0700427/**
428 * limCheckMgmtRegisteredFrames()
429 *
430 *FUNCTION:
431 * This function is called to process to check if received frame match with
432 * any of the registered frame from HDD. If yes pass this frame to SME.
433 *
434 *LOGIC:
435 *
436 *ASSUMPTIONS:
437 *
438 *NOTE:
439 *
440 * @param pMac Pointer to Global MAC structure
441 * @param *pBd Pointer to the received Buffer Descriptor+payload
442 * @param *psessionEntry Pointer to session on which packet is received
443 * @return None
444 */
445static tANI_BOOLEAN
446limCheckMgmtRegisteredFrames(tpAniSirGlobal pMac, tANI_U8 *pBd,
447 tpPESession psessionEntry)
448{
449 tSirMacFrameCtl fc;
450 tpSirMacMgmtHdr pHdr;
451 tANI_U8 *pBody;
452 tpLimMgmtFrameRegistration pLimMgmtRegistration = NULL, pNext = NULL;
453 tANI_U16 frameType;
454 tANI_U16 framelen;
455 tANI_U8 type,subType;
456 tANI_BOOLEAN match = VOS_FALSE;
457 VOS_STATUS vosStatus;
458
459 pHdr = WDA_GET_RX_MAC_HEADER(pBd);
460 fc = pHdr->fc;
461 frameType = (fc.type << 2 ) | (fc.subType << 4);
462 pBody = WDA_GET_RX_MPDU_DATA(pBd);
463 framelen = WDA_GET_RX_PAYLOAD_LEN(pBd);
464
465 vos_list_peek_front(&pMac->lim.gLimMgmtFrameRegistratinQueue,
466 (vos_list_node_t**)&pLimMgmtRegistration);
467
468 while(pLimMgmtRegistration != NULL)
469 {
470 type = (pLimMgmtRegistration->frameType >> 2) & 0x03;
471 subType = (pLimMgmtRegistration->frameType >> 4) & 0x0f;
472 if ( (type == SIR_MAC_MGMT_FRAME) && (fc.type == SIR_MAC_MGMT_FRAME)
473 && (subType == SIR_MAC_MGMT_RESERVED15) )
474 {
475 limLog( pMac, LOG3,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700476 FL("rcvd frame match with SIR_MAC_MGMT_RESERVED15"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700477 match = VOS_TRUE;
478 break;
479 }
480
481 if (pLimMgmtRegistration->frameType == frameType)
482 {
483 if (pLimMgmtRegistration->matchLen > 0)
484 {
485 if (pLimMgmtRegistration->matchLen <= framelen)
486 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +0530487 if (vos_mem_compare(pLimMgmtRegistration->matchData,
Jeff Johnson295189b2012-06-20 16:38:30 -0700488 pBody, pLimMgmtRegistration->matchLen))
489 {
Madan Mohan Koyyalamudic537df22012-10-22 15:07:08 -0700490 /* found match! */
491 match = VOS_TRUE;
492 break;
Jeff Johnson295189b2012-06-20 16:38:30 -0700493 }
Madan Mohan Koyyalamudic537df22012-10-22 15:07:08 -0700494 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700495 }
496 else
497 {
498 /* found match! */
499 match = VOS_TRUE;
500 break;
501 }
502 }
503
504 vosStatus =
505 vos_list_peek_next ( &pMac->lim.gLimMgmtFrameRegistratinQueue,
506 (vos_list_node_t*) pLimMgmtRegistration,
507 (vos_list_node_t**) &pNext );
508 pLimMgmtRegistration = pNext;
509 pNext = NULL;
510 }
511
512 if (match)
513 {
514 limLog( pMac, LOG1,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700515 FL("rcvd frame match with registered frame params"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700516
517 /* Indicate this to SME */
Rashmi Ramanna0d0adec2014-02-05 20:35:37 +0530518 limSendSmeMgmtFrameInd( pMac, pLimMgmtRegistration->sessionId,
519 pBd, psessionEntry, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -0700520
521 if ( (type == SIR_MAC_MGMT_FRAME) && (fc.type == SIR_MAC_MGMT_FRAME)
522 && (subType == SIR_MAC_MGMT_RESERVED15) )
523 {
524 // These packets needs to be processed by PE/SME as well as HDD.
525 // If it returns TRUE here, the packet is forwarded to HDD only.
526 match = VOS_FALSE;
527 }
528 }
529
530 return match;
531} /*** end limCheckMgmtRegisteredFrames() ***/
Jeff Johnson295189b2012-06-20 16:38:30 -0700532
Dino Mycle7a76e662014-06-10 11:36:34 +0530533#ifdef WLAN_FEATURE_EXTSCAN
534
535void
536limProcessEXTScanRealTimeData(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo)
537{
538 tpSirMacMgmtHdr pHdr = NULL;
539 eHalStatus status;
540 void *pCallbackContext;
541 tANI_U8 rfBand = 0;
542 tANI_U8 rxChannelInBD = 0;
543 tSirMacFrameCtl fc;
544 tDot11fBeacon *pBeacon = NULL;
545 tDot11fProbeResponse *pProbeResponse = NULL;
546 tSirWifiFullScanResultEvent tEXTScanFullScanResult;
547
548 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
549 fc = pHdr->fc;
550
551 limLog(pMac, LOG2,
552 FL("Received EXTScan Real Time data with length=%d from "),
553 WDA_GET_RX_MPDU_LEN(pRxPacketInfo));
554
555 limPrintMacAddr(pMac, pHdr->sa, LOG2);
556
557 vos_mem_set((tANI_U8 *) &tEXTScanFullScanResult,
558 sizeof(tSirWifiFullScanResultEvent), 0);
559
Dino Mycle3f783bc2014-08-08 17:40:22 +0530560 tEXTScanFullScanResult.ap.ts = vos_get_monotonic_boottime();
Dino Mycle7a76e662014-06-10 11:36:34 +0530561
562 vos_mem_copy(&tEXTScanFullScanResult.ap.bssid,
563 pHdr->bssId, sizeof(tSirMacAddr));
564
Dino Myclee8843b32014-07-04 14:21:45 +0530565 limPrintMacAddr(pMac, pHdr->bssId, LOG2);
Dino Mycle7a76e662014-06-10 11:36:34 +0530566
567
568 rfBand = WDA_GET_RX_RFBAND(pRxPacketInfo);
569 rxChannelInBD = WDA_GET_RX_CH(pRxPacketInfo);
570
571 if ((!rfBand) || IS_5G_BAND(rfBand))
572 {
573 rxChannelInBD = limUnmapChannel(rxChannelInBD);
574 }
575
c_hpothu24b354c2014-09-24 18:59:33 +0530576 tEXTScanFullScanResult.ap.channel =
577 (tANI_U32)vos_chan_to_freq(rxChannelInBD);
Dino Mycle7a76e662014-06-10 11:36:34 +0530578 tEXTScanFullScanResult.ap.rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo);
579
580 if (fc.subType == SIR_MAC_MGMT_BEACON)
581 {
582 limLog( pMac, LOG2, FL("Beacon "));
583
584 pBeacon = vos_mem_malloc(sizeof(tDot11fBeacon));
585 if ( NULL == pBeacon ){
586 limLog(pMac, LOGE, FL("Failed to allocate memory\n") );
587 return;
588 }
589
590 vos_mem_set( ( tANI_U8* )pBeacon, sizeof(tDot11fBeacon), 0 );
591 // delegate to the framesc-generated code,
592 status = dot11fUnpackBeacon( pMac,
593 (tANI_U8 *)WDA_GET_RX_MPDU_DATA(pRxPacketInfo),
594 WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo), pBeacon );
595
596 if ( DOT11F_FAILED( status ) )
597 {
598 limLog(pMac, LOGE, FL("Failed to parse a Beacons"
Sushant Kaushik87787972015-09-11 16:05:00 +0530599 "(%d)"), status);
Dino Mycle7a76e662014-06-10 11:36:34 +0530600 vos_mem_free(pBeacon);
601 return;
602 }
603 if ( pBeacon->SSID.present )
604 {
605 vos_mem_copy(tEXTScanFullScanResult.ap.ssid,
606 pBeacon->SSID.ssid,
607 pBeacon->SSID.num_ssid);
608 }
609 //NULL Terminate the string.
610 tEXTScanFullScanResult.ap.ssid[pBeacon->SSID.num_ssid] = 0;
611 tEXTScanFullScanResult.ap.beaconPeriod =
612 pBeacon->BeaconInterval.interval;
613 tEXTScanFullScanResult.ap.capability =
614 *((tANI_U16 *)&pBeacon->Capabilities);
615 vos_mem_free(pBeacon);
616 }
617 else if (fc.subType == SIR_MAC_MGMT_PROBE_RSP)
618 {
619 limLog( pMac, LOG2, FL("Probe rsp "));
620
621 pProbeResponse = vos_mem_malloc(sizeof(tDot11fProbeResponse));
622 if ( NULL == pProbeResponse ){
623 limLog(pMac, LOGE, FL("Failed to allocate memory\n") );
624 return;
625 }
626
627 vos_mem_set( ( tANI_U8* )pProbeResponse,
628 sizeof(tDot11fProbeResponse), 0);
629 //delegate to the framesc-generated code,
630 status = dot11fUnpackProbeResponse( pMac,
631 (tANI_U8 *)WDA_GET_RX_MPDU_DATA(pRxPacketInfo),
632 WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo), pProbeResponse );
633
634 if ( DOT11F_FAILED( status ) )
635 {
636 limLog(pMac, LOGE, FL("Failed to parse a Probe"
Sushant Kaushik87787972015-09-11 16:05:00 +0530637 "Response (%d"), status);
Dino Mycle7a76e662014-06-10 11:36:34 +0530638 vos_mem_free(pProbeResponse);
639 return;
640 }
641 if ( pProbeResponse->SSID.present )
642 {
643 vos_mem_copy(tEXTScanFullScanResult.ap.ssid,
644 pProbeResponse->SSID.ssid,
645 pProbeResponse->SSID.num_ssid);
646 }
647 //NULL Terminate the string.
648 tEXTScanFullScanResult.ap.ssid[pProbeResponse->SSID.num_ssid] = 0;
649 tEXTScanFullScanResult.ap.beaconPeriod =
650 pProbeResponse->BeaconInterval.interval;
651 tEXTScanFullScanResult.ap.capability =
652 *(((tANI_U16 *)&pProbeResponse->Capabilities));
653
Gupta, Kapil4a5e1902016-02-01 19:54:14 +0530654 vos_mem_free(pProbeResponse);
Dino Mycle7a76e662014-06-10 11:36:34 +0530655 }
656 else
657 {
658 limLog( pMac, LOGE, FL("Wrong frame Type %d, Subtype %d for LFR"),
659 fc.type, fc.subType);
660 VOS_ASSERT(0);
661 return;
662 }
663
664 tEXTScanFullScanResult.requestId = pMac->sme.extScanStartReqId;
665 tEXTScanFullScanResult.ieLength =
666 WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo) - SIZE_OF_FIXED_PARAM;
667 tEXTScanFullScanResult.ie =(tSirInformationElement *)
668 ((tANI_U8 *)WDA_GET_RX_MPDU_DATA(pRxPacketInfo) + SIZE_OF_FIXED_PARAM);
669
670 pCallbackContext = pMac->sme.pEXTScanCallbackContext;
671 if(pMac->sme.pEXTScanIndCb)
672 {
673 pMac->sme.pEXTScanIndCb(pCallbackContext,
674 SIR_HAL_EXTSCAN_FULL_SCAN_RESULT_IND,
675 (tANI_U8 *)&tEXTScanFullScanResult);
676 }
677
678 return;
679} /*** end limProcessEXTScanRealTimeData() ***/
680#endif /* WLAN_FEATURE_EXTSCAN */
Jeff Johnson295189b2012-06-20 16:38:30 -0700681
682/**
683 * limHandle80211Frames()
684 *
685 *FUNCTION:
686 * This function is called to process 802.11 frames
687 * received by LIM.
688 *
689 *LOGIC:
690 * NA
691 *
692 *ASSUMPTIONS:
693 * NA
694 *
695 *NOTE:
696 * NA
697 *
698 * @param pMac - Pointer to Global MAC structure
699 * @param pMsg of type tSirMsgQ - Pointer to the message structure
700 * @return None
701 */
702
703static void
Sushant Kaushik33200572015-08-05 16:46:20 +0530704
Jeff Johnson295189b2012-06-20 16:38:30 -0700705limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg)
706{
707 tANI_U8 *pRxPacketInfo = NULL;
708 tSirMacFrameCtl fc;
709 tpSirMacMgmtHdr pHdr=NULL;
710 tpPESession psessionEntry=NULL;
711 tANI_U8 sessionId;
712 tAniBool isFrmFt = FALSE;
713 tANI_U16 fcOffset = WLANHAL_RX_BD_HEADER_SIZE;
714
715 *pDeferMsg= false;
716 limGetBDfromRxPacket(pMac, limMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo);
717
Dino Mycle7a76e662014-06-10 11:36:34 +0530718#ifdef WLAN_FEATURE_EXTSCAN
719
720 if ( WDA_GET_EXTSCANFULLSCANRESIND(pRxPacketInfo))
721 {
722 limLog( pMac, LOG2, FL("Notify EXTSCAN scan results to the HDD"));
723 limProcessEXTScanRealTimeData(pMac, pRxPacketInfo);
724 goto end;
725 }
726#endif //WLAN_FEATURE_EXTSCAN
727
Jeff Johnson295189b2012-06-20 16:38:30 -0700728 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
729 isFrmFt = WDA_GET_RX_FT_DONE(pRxPacketInfo);
730 fcOffset = (v_U8_t)WDA_GET_RX_MPDU_HEADER_OFFSET(pRxPacketInfo);
731 fc = pHdr->fc;
732
Madan Mohan Koyyalamudi99af06e2013-08-08 02:17:17 +0530733#ifdef WLAN_DUMP_MGMTFRAMES
734 limLog( pMac, LOGE, FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"),
735 fc.protVer, fc.type, fc.subType,
736 WDA_GET_RX_MAC_RATE_IDX(pRxPacketInfo));
737 VOS_TRACE_HEX_DUMP(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, pHdr,
738 WDA_GET_RX_MPDU_HEADER_LEN(pRxPacketInfo));
739#endif
740
Tushnim Bhattacharyyaed4d0c22014-01-30 11:56:44 -0800741 if ((fc.type == SIR_MAC_MGMT_FRAME) &&
Tushnim Bhattacharyyaed4d0c22014-01-30 11:56:44 -0800742 (fc.subType != SIR_MAC_MGMT_BEACON))
743 {
Sushant Kaushik60273d02014-06-13 15:31:37 +0530744 limLog(pMac, LOG1, FL("RX MGMT - Type %hu, SubType %hu, Seq.no %d"),
745 fc.type, fc.subType,
746 ((pHdr->seqControl.seqNumHi << 4) | (pHdr->seqControl.seqNumLo)));
Tushnim Bhattacharyyaed4d0c22014-01-30 11:56:44 -0800747 }
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700748#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
749 if ( WDA_GET_ROAMCANDIDATEIND(pRxPacketInfo))
750 {
751 limLog( pMac, LOG2, FL("Notify SME with candidate ind"));
752 //send a session 0 for now - TBD
753 limSendSmeCandidateFoundInd(pMac, 0);
754 goto end;
755 }
756 if (WDA_GET_OFFLOADSCANLEARN(pRxPacketInfo))
757 {
758 if (fc.subType == SIR_MAC_MGMT_BEACON)
759 {
760 limLog( pMac, LOG2, FL("Save this beacon in LFR cache"));
761 __limHandleBeacon(pMac, limMsg, NULL);
762 }
763 else if (fc.subType == SIR_MAC_MGMT_PROBE_RSP)
764 {
765 limLog( pMac, LOG2, FL("Save this probe rsp in LFR cache"));
766 limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo);
767 }
768 else
769 {
770 limLog( pMac, LOGE, FL("Wrong frame Type %d, Subtype %d for LFR"),
771 fc.type, fc.subType);
772 }
773 goto end;
774 }
775#endif //WLAN_FEATURE_ROAM_SCAN_OFFLOAD
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800776#ifdef FEATURE_WLAN_ESE
Jeff Johnson295189b2012-06-20 16:38:30 -0700777 if (fc.type == SIR_MAC_DATA_FRAME && isFrmFt)
778 {
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800779#if 0 // Ese TBD Need to PORT
Jeff Johnson295189b2012-06-20 16:38:30 -0700780 tpSirMacDot3Hdr pDataFrmHdr;
781
782 pDataFrmHdr = (tpSirMacDot3Hdr)((tANI_U8 *)pBD+ WLANHAL_RX_BD_GET_MPDU_H_OFFSET(pBD));
783 if((psessionEntry = peFindSessionByBssid(pMac,pDataFrmHdr->sa,&sessionId))== NULL)
784 {
785 limLog( pMac, LOGE, FL("Session not found for Frm type %d, subtype %d, SA: "), fc.type, fc.subType);
786 limPrintMacAddr(pMac, pDataFrmHdr->sa, LOGE);
787 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pBD, limMsg->bodyptr);
788 return;
789 }
790
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800791 if (!psessionEntry->isESEconnection)
Jeff Johnson295189b2012-06-20 16:38:30 -0700792 {
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800793 limLog( pMac, LOGE, FL("LIM received Type %d, Subtype %d in Non ESE connection"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700794 fc.type, fc.subType);
795 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pBD, limMsg->bodyptr);
796 return;
797 }
798 limLog( pMac, LOGE, FL("Processing IAPP Frm from SA:"));
799 limPrintMacAddr(pMac, pDataFrmHdr->sa, LOGE);
800#else
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800801 printk("%s: Need to port handling of IAPP frames to PRIMA for ESE", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700802#endif
803
804
805 } else
806#endif
Siddharth Bhal4f3187c2014-10-09 21:38:08 +0530807
808 if ((fc.type == SIR_MAC_MGMT_FRAME) &&
809 (fc.subType == SIR_MAC_MGMT_PROBE_RSP) &&
810 pMac->lim.isSpoofingEnabled)
811 {
812 limLog( pMac, LOG2, FL("Probe Rsp recieved with DA: "MAC_ADDRESS_STR
813 " and selfMac Addr:"MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pHdr->da),
814 MAC_ADDR_ARRAY(pMac->lim.gSelfMacAddr));
815 if (VOS_TRUE == vos_mem_compare((v_VOID_t*) pHdr->da,
816 (v_VOID_t*) pMac->lim.spoofMacAddr, VOS_MAC_ADDRESS_LEN))
817 {
818 vos_mem_copy(pHdr->da, pMac->lim.gSelfMacAddr, VOS_MAC_ADDRESS_LEN);
819 }
820 }
821
Jeff Johnson295189b2012-06-20 16:38:30 -0700822 /* Added For BT-AMP Support */
823 if((psessionEntry = peFindSessionByBssid(pMac,pHdr->bssId,&sessionId))== NULL)
824 {
825#ifdef WLAN_FEATURE_VOWIFI_11R
826 if (fc.subType == SIR_MAC_MGMT_AUTH)
827 {
828#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
Varun Reddy Yeturuf68abd62013-02-11 14:05:06 -0800829 limLog( pMac, LOG1, FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700830 fc.protVer, fc.type, fc.subType, WDA_GET_RX_MAC_RATE_IDX(pRxPacketInfo));
Varun Reddy Yeturuf68abd62013-02-11 14:05:06 -0800831 limPrintMacAddr(pMac, pHdr->bssId, LOG1);
Jeff Johnson295189b2012-06-20 16:38:30 -0700832#endif
833 if (limProcessAuthFrameNoSession(pMac, pRxPacketInfo, limMsg->bodyptr) == eSIR_SUCCESS)
834 {
Kanchanapally, Vidyullathac796fc62015-03-17 10:45:28 +0530835 goto end;
Jeff Johnson295189b2012-06-20 16:38:30 -0700836 }
837 }
838#endif
839 if((fc.subType != SIR_MAC_MGMT_PROBE_RSP )&&
840 (fc.subType != SIR_MAC_MGMT_BEACON)&&
841 (fc.subType != SIR_MAC_MGMT_PROBE_REQ)
Jeff Johnson295189b2012-06-20 16:38:30 -0700842 && (fc.subType != SIR_MAC_MGMT_ACTION ) //Public action frame can be received from non-associated stations.
Jeff Johnson295189b2012-06-20 16:38:30 -0700843 )
844 {
845
846 if((psessionEntry = peFindSessionByPeerSta(pMac,pHdr->sa,&sessionId))== NULL)
847 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700848 limLog(pMac, LOG1, FL("session does not exist for given bssId"));
Kanchanapally, Vidyullathac796fc62015-03-17 10:45:28 +0530849 goto end;
Jeff Johnson295189b2012-06-20 16:38:30 -0700850 }
Padma, Santhosh Kumar2b47ca82014-01-03 16:57:27 +0530851 else
852 limLog(pMac,LOG1,"SessionId:%d Session Exist for given Bssid",
853 psessionEntry->peSessionId);
Gopichand Nakkala6265d6f2013-03-20 23:32:50 +0530854 }
855 // For p2p resp frames search for valid session with DA as
856 // BSSID will be SA and session will be present with DA only
857 if(fc.subType == SIR_MAC_MGMT_ACTION )
858 {
859 psessionEntry = peFindSessionByBssid(pMac,pHdr->da,&sessionId);
860 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700861 }
862
863
Jeff Johnson295189b2012-06-20 16:38:30 -0700864 /* Check if frame is registered by HDD */
865 if(limCheckMgmtRegisteredFrames(pMac, pRxPacketInfo, psessionEntry))
866 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700867 limLog( pMac, LOG1, FL("Received frame is passed to SME"));
Kanchanapally, Vidyullathac796fc62015-03-17 10:45:28 +0530868 goto end;
Jeff Johnson295189b2012-06-20 16:38:30 -0700869 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700870
871
Jeff Johnson295189b2012-06-20 16:38:30 -0700872
873 if (fc.protVer != SIR_MAC_PROTOCOL_VERSION)
874 { // Received Frame with non-zero Protocol Version
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700875 limLog(pMac, LOGE, FL("Unexpected frame with protVersion %d received"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700876 fc.protVer);
Jeff Johnson295189b2012-06-20 16:38:30 -0700877#ifdef WLAN_DEBUG
878 pMac->lim.numProtErr++;
879#endif
Kanchanapally, Vidyullathac796fc62015-03-17 10:45:28 +0530880 goto end;
Jeff Johnson295189b2012-06-20 16:38:30 -0700881 }
882
Gopichand Nakkala2c231c82013-06-11 17:49:16 +0530883 if (!pMac->fScanOffload)
Jeff Johnson295189b2012-06-20 16:38:30 -0700884 {
Gopichand Nakkala2c231c82013-06-11 17:49:16 +0530885 if (limIsSystemInScanState(pMac))
886 {
887 limHandleFramesInScanState(pMac, limMsg, pRxPacketInfo, pDeferMsg, psessionEntry);
888 return;
889 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700890 }
891
892/* Chance of crashing : to be done BT-AMP ........happens when broadcast probe req is received */
893
894#if 0
895 if (psessionEntry->limSystemRole == eLIM_UNKNOWN_ROLE) {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700896 limLog( pMac, LOGW, FL( "gLimSystemRole is %d. Exiting..." ),psessionEntry->limSystemRole );
Jeff Johnson295189b2012-06-20 16:38:30 -0700897 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr);
898
899#ifdef WLAN_DEBUG
900 pMac->lim.numProtErr++;
901#endif
902 return;
903 }
904 #endif //HACK to continue scanning
905
906
907#ifdef WLAN_DEBUG
908 pMac->lim.numMAC[fc.type][fc.subType]++;
909#endif
910
911 switch (fc.type)
912 {
913 case SIR_MAC_MGMT_FRAME:
914 {
915 #if 0 //TBD-RAJESH fix this
916 if (limIsReassocInProgress( pMac,psessionEntry) && (fc.subType != SIR_MAC_MGMT_DISASSOC) &&
917 (fc.subType != SIR_MAC_MGMT_DEAUTH) && (fc.subType != SIR_MAC_MGMT_REASSOC_RSP))
918 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700919 limLog(pMac, LOGE, FL("Frame with Type - %d, Subtype - %d received in ReAssoc Wait state, dropping..."),
Jeff Johnson295189b2012-06-20 16:38:30 -0700920 fc.type, fc.subType);
921 return;
922 }
923 #endif //HACK to continue scanning
924 // Received Management frame
925 switch (fc.subType)
926 {
927 case SIR_MAC_MGMT_ASSOC_REQ:
928 // Make sure the role supports Association
929 if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700930 || (psessionEntry->limSystemRole == eLIM_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700931 )
932 limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_ASSOC, psessionEntry);
933
934 else
935 {
936 // Unwanted messages - Log error
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700937 limLog(pMac, LOGE, FL("unexpected message received %X"),limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -0700938 limPrintMsgName(pMac, LOGE, limMsg->type);
939 }
940 break;
941
942 case SIR_MAC_MGMT_ASSOC_RSP:
943 limProcessAssocRspFrame(pMac, pRxPacketInfo, LIM_ASSOC,psessionEntry);
944 break;
945
946 case SIR_MAC_MGMT_REASSOC_REQ:
947 // Make sure the role supports Reassociation
948 if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700949 || (psessionEntry->limSystemRole == eLIM_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700950 ){
951 limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_REASSOC, psessionEntry);
952 }
953 else
954 {
955 // Unwanted messages - Log error
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700956 limLog(pMac, LOGE, FL("unexpected message received %X"),limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -0700957 limPrintMsgName(pMac, LOGE, limMsg->type);
958 }
959 break;
960
961 case SIR_MAC_MGMT_REASSOC_RSP:
962 limProcessAssocRspFrame(pMac, pRxPacketInfo, LIM_REASSOC,psessionEntry);
963 break;
964
965 case SIR_MAC_MGMT_PROBE_REQ:
966 limProcessProbeReqFrame_multiple_BSS(pMac, pRxPacketInfo,psessionEntry);
967 break;
968
969 case SIR_MAC_MGMT_PROBE_RSP:
970 if(psessionEntry == NULL)
971 limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo);
972 else
973 limProcessProbeRspFrame(pMac, pRxPacketInfo, psessionEntry);
974 break;
975
976 case SIR_MAC_MGMT_BEACON:
977 __limHandleBeacon(pMac, limMsg,psessionEntry);
978 break;
979
980 case SIR_MAC_MGMT_DISASSOC:
981 limProcessDisassocFrame(pMac, pRxPacketInfo,psessionEntry);
982 break;
983
984 case SIR_MAC_MGMT_AUTH:
985 limProcessAuthFrame(pMac, pRxPacketInfo,psessionEntry);
986 break;
987
988 case SIR_MAC_MGMT_DEAUTH:
989 limProcessDeauthFrame(pMac, pRxPacketInfo,psessionEntry);
990 break;
991
992 case SIR_MAC_MGMT_ACTION:
Jeff Johnson295189b2012-06-20 16:38:30 -0700993 if(psessionEntry == NULL)
994 limProcessActionFrameNoSession(pMac, pRxPacketInfo);
995 else
996 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700997 if (WDA_GET_RX_UNKNOWN_UCAST(pRxPacketInfo))
998 limHandleUnknownA2IndexFrames(pMac, pRxPacketInfo,psessionEntry);
999 else
1000 limProcessActionFrame(pMac, pRxPacketInfo,psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -07001001 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001002 break;
1003 default:
1004 // Received Management frame of 'reserved' subtype
1005 break;
1006 } // switch (fc.subType)
1007
1008 }
1009 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001010 case SIR_MAC_DATA_FRAME:
1011 {
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001012#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -07001013 /* We accept data frame (IAPP frame) only if Session is
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001014 * present and ese connection is established on that
Jeff Johnson295189b2012-06-20 16:38:30 -07001015 * session
1016 */
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001017 if (psessionEntry && psessionEntry->isESEconnection) {
Jeff Johnson295189b2012-06-20 16:38:30 -07001018 limProcessIappFrame(pMac, pRxPacketInfo, psessionEntry);
1019 }
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001020#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001021 }
1022 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001023 default:
1024 // Received frame of type 'reserved'
1025 break;
1026
1027 } // switch (fc.type)
1028
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -07001029end:
Jeff Johnson295189b2012-06-20 16:38:30 -07001030 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr) ;
1031 return;
1032} /*** end limHandle80211Frames() ***/
1033
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301034/**
1035 * limSendStopScanOffloadReq()
1036 *
1037 *FUNCTION:
1038 * This function will be called to abort the ongoing offloaded scan
1039 * request.
1040 *
1041 *
1042 *NOTE:
1043 *
1044 * @param pMac Pointer to Global MAC structure
1045 * @return eHAL_STATUS_SUCCESS or eHAL_STATUS_FAILURE
1046 */
1047eHalStatus limSendStopScanOffloadReq(tpAniSirGlobal pMac, tANI_U8 SessionId)
1048{
1049 tSirMsgQ msg;
1050 tSirRetStatus rc = eSIR_SUCCESS;
1051 tAbortScanParams *pAbortScanParams;
1052
Kiet Lamb1233192013-11-28 13:38:20 +05301053 pAbortScanParams = vos_mem_malloc(sizeof(tAbortScanParams));
1054 if (NULL == pAbortScanParams)
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301055 {
1056 limLog(pMac, LOGP, FL("Memory allocation failed for AbortScanParams"));
1057 return eHAL_STATUS_FAILURE;
1058 }
1059
1060 pAbortScanParams->SessionId = SessionId;
1061 msg.type = WDA_STOP_SCAN_OFFLOAD_REQ;
1062 msg.bodyptr = pAbortScanParams;
1063 msg.bodyval = 0;
1064
1065 rc = wdaPostCtrlMsg(pMac, &msg);
1066 if (rc != eSIR_SUCCESS)
1067 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -08001068 limLog(pMac, LOGE, FL("wdaPostCtrlMsg() return failure"));
Kiet Lamb1233192013-11-28 13:38:20 +05301069 vos_mem_free(pAbortScanParams);
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301070 return eHAL_STATUS_FAILURE;
1071 }
1072
Rashmi Ramanna6c13a342014-01-07 11:44:07 +05301073 limLog(pMac, LOG1, FL("Abort ongoing offload scan."));
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301074 return eHAL_STATUS_SUCCESS;
1075
1076}
Jeff Johnson295189b2012-06-20 16:38:30 -07001077
1078/**
1079 * limProcessAbortScanInd()
1080 *
1081 *FUNCTION:
1082 * This function is called from HDD to abort the scan which is presently being run
1083 *
1084 *
1085 *NOTE:
1086 *
1087 * @param pMac Pointer to Global MAC structure
1088 * @param *pMsgBuf A pointer to the SME message buffer
1089 * @return None
1090 */
1091void
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301092limProcessAbortScanInd(tpAniSirGlobal pMac, tANI_U8 SessionId)
Jeff Johnson295189b2012-06-20 16:38:30 -07001093{
1094#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
1095 limDiagEventReport(pMac, WLAN_PE_DIAG_SCAN_ABORT_IND_EVENT, NULL, 0, 0);
1096#endif //FEATURE_WLAN_DIAG_SUPPORT
1097
1098 /* Deactivate the gLimBackgroundScanTimer as part of the abort scan.
1099 * SME should send WNI_CFG_BACKGROUND_SCAN_PERIOD indication
1100 * to start the background scan again
1101 */
Abhishek Singh525045c2014-12-15 17:18:45 +05301102 limLog(pMac, LOG1, FL("Processing AbortScan Ind"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001103
1104 limAbortBackgroundScan(pMac);
1105
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301106 if (pMac->fScanOffload)
Jeff Johnson295189b2012-06-20 16:38:30 -07001107 {
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301108 /* send stop scan cmd to fw if scan offload is enabled. */
1109 limSendStopScanOffloadReq(pMac, SessionId);
1110 }
1111 else
1112 {
1113 /* Abort the scan if its running, else just return */
1114 if(limIsSystemInScanState(pMac))
Jeff Johnson295189b2012-06-20 16:38:30 -07001115 {
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301116 if( (eLIM_HAL_INIT_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
1117 (eLIM_HAL_START_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
1118 (eLIM_HAL_END_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
1119 (eLIM_HAL_FINISH_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState) )
1120 {
1121 //Simply signal we need to abort
1122 limLog( pMac, LOGW, FL(" waiting for HAL, simply signal abort gLimHalScanState = %d"), pMac->lim.gLimHalScanState );
1123 pMac->lim.abortScan = 1;
1124 }
1125 else
1126 {
1127 //Force abort
1128 limLog( pMac, LOGW, FL(" Force aborting scan") );
1129 pMac->lim.abortScan = 0;
1130 limDeactivateAndChangeTimer(pMac, eLIM_MIN_CHANNEL_TIMER);
1131 limDeactivateAndChangeTimer(pMac, eLIM_MAX_CHANNEL_TIMER);
1132 //Set the resume channel to Any valid channel (invalid).
1133 //This will instruct HAL to set it to any previous valid channel.
1134 peSetResumeChannel(pMac, 0, 0);
1135 limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE);
1136 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001137 }
1138 }
1139 return;
1140}
1141
1142/**
1143 * limMessageProcessor
1144 *
1145 *FUNCTION:
1146 * Wrapper function for limProcessMessages when handling messages received by LIM.
1147 * Could either defer messages or process them.
1148 * @param pMac Pointer to Global MAC structure
1149 * @param limMsg Received LIM message
1150 * @return None
1151 */
1152
1153void limMessageProcessor(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
1154{
1155 if (eLIM_MLM_OFFLINE_STATE == pMac->lim.gLimMlmState)
1156 {
1157 peFreeMsg(pMac, limMsg);
1158 return;
1159 }
1160
1161 if (!defMsgDecision(pMac, limMsg))
1162 {
1163 limProcessMessages(pMac, limMsg);
Jeff Johnson295189b2012-06-20 16:38:30 -07001164 // process deferred message queue if allowed
1165 {
1166 if ( (! (pMac->lim.gLimAddtsSent))
1167 &&
1168 (! (limIsSystemInScanState(pMac)))
1169 )
1170 {
1171 if (true == GET_LIM_PROCESS_DEFD_MESGS(pMac))
1172 limProcessDeferredMessageQueue(pMac);
1173 }
1174 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001175 }
1176}
1177
Jeff Johnsone7245742012-09-05 17:12:55 -07001178#ifdef FEATURE_OEM_DATA_SUPPORT
1179
1180void limOemDataRspHandleResumeLinkRsp(tpAniSirGlobal pMac, eHalStatus status, tANI_U32* mlmOemDataRsp)
1181{
1182 if(status != eHAL_STATUS_SUCCESS)
1183 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001184 limLog(pMac, LOGE, FL("OEM Data Rsp failed to get the response for resume link"));
Jeff Johnsone7245742012-09-05 17:12:55 -07001185 }
1186
1187 if(NULL != pMac->lim.gpLimMlmOemDataReq)
1188 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301189 vos_mem_free(pMac->lim.gpLimMlmOemDataReq);
Jeff Johnsone7245742012-09-05 17:12:55 -07001190 pMac->lim.gpLimMlmOemDataReq = NULL;
1191 }
1192
1193 //"Failure" status doesn't mean that Oem Data Rsp did not happen
1194 //and hence we need to respond to upper layers. Only Resume link is failed, but
1195 //we got the oem data response already.
1196 //Post the meessage to MLM
1197 limPostSmeMessage(pMac, LIM_MLM_OEM_DATA_CNF, (tANI_U32*)(mlmOemDataRsp));
1198
1199 return;
1200}
1201
1202void limProcessOemDataRsp(tpAniSirGlobal pMac, tANI_U32* body)
1203{
Jeff Johnsone7245742012-09-05 17:12:55 -07001204 tpLimMlmOemDataRsp mlmOemDataRsp = NULL;
1205 tpStartOemDataRsp oemDataRsp = NULL;
1206
1207 //Process all the messages for the lim queue
1208 SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
1209
1210 oemDataRsp = (tpStartOemDataRsp)(body);
1211
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301212 mlmOemDataRsp = vos_mem_malloc(sizeof(tLimMlmOemDataRsp));
1213 if ( NULL == mlmOemDataRsp )
Jeff Johnsone7245742012-09-05 17:12:55 -07001214 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001215 limLog(pMac, LOGP, FL("could not allocate memory for mlmOemDataRsp"));
Jeff Johnsone7245742012-09-05 17:12:55 -07001216 return;
1217 }
1218
1219 //copy the memory into tLimMlmOemDataRsp and free the tStartOemDataRsp
1220 //the structures tStartOemDataRsp and tLimMlmOemDataRsp have the same structure
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301221 vos_mem_copy((void*)(mlmOemDataRsp), (void*)(oemDataRsp),
1222 sizeof(tLimMlmOemDataRsp));
Jeff Johnsone7245742012-09-05 17:12:55 -07001223
1224 //Now free the incoming memory
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301225 vos_mem_free(oemDataRsp);
Jeff Johnsone7245742012-09-05 17:12:55 -07001226
1227 limResumeLink(pMac, limOemDataRspHandleResumeLinkRsp, (tANI_U32*)mlmOemDataRsp);
1228
1229 return;
1230}
1231
1232#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001233
Katya Nigam3802f202013-12-16 19:27:14 +05301234static tANI_BOOLEAN limAgeOutProbeReq( tpAniSirGlobal pMac, tpSirMsgQ limMsg,
1235 vos_pkt_t *pVosPkt )
1236{
1237 tANI_U8 *pRxPacketInfo = NULL;
1238 tSirMacFrameCtl fc;
1239 tpSirMacMgmtHdr pHdr=NULL;
1240 tANI_BOOLEAN match = VOS_FALSE;
1241
1242 limGetBDfromRxPacket(pMac, limMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo);
1243 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1244 fc = pHdr->fc;
1245 if ( fc.subType == SIR_MAC_MGMT_PROBE_REQ )
1246 {
1247 if( vos_timer_get_system_ticks() - pVosPkt->timestamp >= MAX_PROBEREQ_TIME )
1248 {
1249 // drop packet
1250 limLog(pMac, LOGE,
1251 FL("Dropping Aged Out probe requests. Peer MAC is "MAC_ADDRESS_STR),
1252 MAC_ADDR_ARRAY(pHdr->sa));
1253
1254 vos_pkt_return_packet(pVosPkt);
1255 match = VOS_TRUE;
1256 }
1257 }
1258 return match;
1259}
1260
Jeff Johnson295189b2012-06-20 16:38:30 -07001261/**
1262 * limProcessMessages
1263 *
1264 *FUNCTION:
1265 * This function is called by limProcessMessageQueue function. This
1266 * function processes messages received by LIM.
1267 *
1268 *LOGIC:
1269 * Depending on the message type, corresponding function will be
1270 * called, for example limProcessSmeMessages() will be called to
1271 * process SME messages received from HDD/Upper layer software module.
1272 *
1273 *ASSUMPTIONS:
1274 * NA
1275 *
1276 *NOTE:
1277 * NA
1278 *
1279 * @param pMac Pointer to Global MAC structure
1280 * @param limMsg Received LIM message
1281 * @return None
1282 */
1283
1284void
1285limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
1286{
1287 tANI_U8 deferMsg = false;
1288 tLinkStateParams *linkStateParams;
1289#if defined WLAN_FEATURE_VOWIFI_11R
1290 tpPESession pSession;
1291#endif
1292#if defined(ANI_DVT_DEBUG)
1293 tSirMsgQ msgQ;
1294#endif
1295 if(pMac->gDriverType == eDRIVER_TYPE_MFG)
1296 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301297 vos_mem_free(limMsg->bodyptr);
Jeff Johnsone7245742012-09-05 17:12:55 -07001298 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001299 return;
1300 }
1301#ifdef WLAN_DEBUG
1302 pMac->lim.numTot++;
1303#endif
1304
1305
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001306 PELOG3(limLog(pMac, LOG3, FL("rcvd msgType = %s, sme state = %s, mlm state = %s"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001307 limMsgStr(limMsg->type), limSmeStateStr(pMac->lim.gLimSmeState),
1308 limMlmStateStr(pMac->lim.gLimMlmState));)
1309
Konamki, Sreelakshmi824f93e2015-07-31 12:55:48 +05301310 /*
1311 * MTRACE logs not captured for events received from SME
1312 * SME enums (eWNI_SME_START_REQ) starts with 0x16xx.
1313 * Compare received SME events with SIR_SME_MODULE_ID
Konamki, Sreelakshmi2bfb8b02015-07-29 11:41:24 +05301314 */
Jeff Johnson295189b2012-06-20 16:38:30 -07001315
Konamki, Sreelakshmi824f93e2015-07-31 12:55:48 +05301316 if (SIR_SME_MODULE_ID == (tANI_U8)MAC_TRACE_GET_MODULE_ID(limMsg->type))
1317 {
1318 MTRACE(macTrace(pMac, TRACE_CODE_RX_SME_MSG, NO_SESSION, limMsg->type));
1319 }
1320 else
1321 {
1322 /* Omitting below message types as these are too frequent and when crash
1323 * happens we loose critical trace logs if these are also logged
1324 */
1325 if (limMsg->type != SIR_LIM_MAX_CHANNEL_TIMEOUT &&
1326 limMsg->type != SIR_LIM_MIN_CHANNEL_TIMEOUT &&
1327 limMsg->type != SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT &&
1328 limMsg->type != SIR_CFG_PARAM_UPDATE_IND &&
1329 limMsg->type != SIR_BB_XPORT_MGMT_MSG)
1330 MTRACE(macTraceMsgRx(pMac, NO_SESSION,
1331 LIM_TRACE_MAKE_RXMSG(limMsg->type, LIM_MSG_PROCESSED));)
1332 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001333 switch (limMsg->type)
1334 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001335
1336 case SIR_LIM_UPDATE_BEACON:
1337 limUpdateBeacon(pMac);
1338 break;
1339
Jeff Johnson295189b2012-06-20 16:38:30 -07001340 case SIR_CFG_PARAM_UPDATE_IND:
1341 /// CFG parameter updated
1342 if (limIsSystemInScanState(pMac))
1343 {
1344 // System is in DFS (Learn) mode
1345 // Defer processsing this message
1346 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1347 {
Leela Venkata Kiran Kumar Reddy Chirala2247e962013-03-22 19:21:10 -07001348 if(!(pMac->lim.deferredMsgCnt & 0xF))
1349 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001350 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 -07001351 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1352 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
Leela Venkata Kiran Kumar Reddy Chirala2247e962013-03-22 19:21:10 -07001353 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001354 limLogSessionStates(pMac);
1355 limPrintMsgName(pMac, LOGE, limMsg->type);
1356 }
1357 }
1358 else
1359 {
1360 limHandleCFGparamUpdate(pMac, limMsg->bodyval);
1361 }
1362
1363 break;
1364
1365 case WDA_INIT_SCAN_RSP:
1366 limProcessInitScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001367 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001368 break;
1369
1370 case WDA_START_SCAN_RSP:
1371 limProcessStartScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001372 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001373 break;
1374
1375 case WDA_END_SCAN_RSP:
1376 limProcessEndScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001377 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001378 break;
1379
1380 case WDA_FINISH_SCAN_RSP:
1381 limProcessFinishScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001382 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001383 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001384#ifdef FEATURE_OEM_DATA_SUPPORT
1385 case WDA_START_OEM_DATA_RSP:
1386 limProcessOemDataRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001387 limMsg->bodyptr = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07001388 break;
1389#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001390
1391 case WDA_SWITCH_CHANNEL_RSP:
1392 limProcessSwitchChannelRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001393 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001394 break;
1395
1396#ifdef ANI_SIR_IBSS_PEER_CACHING
1397 case WDA_IBSS_STA_ADD:
1398 limIbssStaAdd(pMac, limMsg->bodyptr);
1399 break;
1400#endif
1401 case SIR_BB_XPORT_MGMT_MSG:
1402 // These messages are from Peer MAC entity.
1403#ifdef WLAN_DEBUG
1404 pMac->lim.numBbt++;
1405#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001406 {
1407 v_U16_t pktLen = 0;
1408 vos_pkt_t *pVosPkt;
1409 VOS_STATUS vosStatus;
1410 tSirMsgQ limMsgNew;
Jeff Johnson295189b2012-06-20 16:38:30 -07001411 /* The original limMsg which we were deferring have the
1412 * bodyPointer point to 'BD' instead of 'Vos pkt'. If we don't make a copy
1413 * of limMsg, then vos_pkt_peek_data will overwrite the limMsg->bodyPointer.
1414 * and next time when we try to process the msg, we will try to use 'BD' as
1415 * 'Vos Pkt' which will cause a crash
1416 */
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301417 vos_mem_copy((tANI_U8*)&limMsgNew, (tANI_U8*)limMsg,
1418 sizeof(tSirMsgQ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001419 pVosPkt = (vos_pkt_t *)limMsgNew.bodyptr;
1420 vos_pkt_get_packet_length(pVosPkt, &pktLen);
1421
1422 vosStatus = WDA_DS_PeekRxPacketInfo( pVosPkt, (v_PVOID_t *)&limMsgNew.bodyptr, VOS_FALSE );
1423
1424 if( !VOS_IS_STATUS_SUCCESS(vosStatus) )
1425 {
Katya Nigamfdf5a522015-02-03 14:38:55 +05301426 limDecrementPendingMgmtCount(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001427 vos_pkt_return_packet(pVosPkt);
1428 break;
1429
1430 }
Katya Nigam3802f202013-12-16 19:27:14 +05301431
Padma, Santhosh Kumar30971cf2015-04-06 19:59:37 +05301432#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
1433 if (WDA_GET_ROAMCANDIDATEIND(limMsgNew.bodyptr))
1434 limLog(pMac, LOG1, FL("roamCandidateInd %d"),
1435 WDA_GET_ROAMCANDIDATEIND(limMsgNew.bodyptr));
1436
1437 if (WDA_GET_OFFLOADSCANLEARN(limMsgNew.bodyptr))
1438 limLog(pMac, LOG1, FL("offloadScanLearn %d"),
1439 WDA_GET_OFFLOADSCANLEARN(limMsgNew.bodyptr));
1440#endif
1441
Katya Nigam3802f202013-12-16 19:27:14 +05301442 /*
1443 * putting a check for age out probe request frames
1444 * such that any probe req more than 0.5 sec old can directly
1445 * be dropped. With this, there won't be blocking of MC thread.
1446 */
1447
1448 if( limAgeOutProbeReq ( pMac, &limMsgNew, pVosPkt ))
1449 {
Katya Nigamfdf5a522015-02-03 14:38:55 +05301450 limDecrementPendingMgmtCount(pMac);
Katya Nigam3802f202013-12-16 19:27:14 +05301451 break;
1452 }
1453
Katya Nigam3802f202013-12-16 19:27:14 +05301454
Jeff Johnson295189b2012-06-20 16:38:30 -07001455 limHandle80211Frames(pMac, &limMsgNew, &deferMsg);
1456
1457 if ( deferMsg == true )
1458 {
Abhishek Singh3cbf6052014-12-15 16:46:42 +05301459 limLog(pMac, LOG2, FL("Defer message type=%X "),
1460 limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -07001461 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1462 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001463 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 -07001464 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1465 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
1466 limLogSessionStates(pMac);
1467 limPrintMsgName(pMac, LOGE, limMsg->type);
Katya Nigamfdf5a522015-02-03 14:38:55 +05301468 limDecrementPendingMgmtCount(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001469 vos_pkt_return_packet(pVosPkt);
1470 }
1471 }
1472 else
1473 {
1474 /* PE is not deferring this 802.11 frame so we need to call vos_pkt_return.
1475 * Asumption here is when Rx mgmt frame processing is done,
1476 * voss packet could be freed here.
1477 */
Katya Nigamfdf5a522015-02-03 14:38:55 +05301478 limDecrementPendingMgmtCount(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001479 vos_pkt_return_packet(pVosPkt);
1480 }
1481 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001482 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001483 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
Gopichand Nakkalacca24d12013-03-07 17:05:07 +05301499 case eWNI_SME_RESET_AP_CAPS_CHANGED:
Jeff Johnson295189b2012-06-20 16:38:30 -07001500 // These messages are from HDD
1501 limProcessNormalHddMsg(pMac, limMsg, true); //need to response to hdd
1502 break;
1503
1504 case eWNI_SME_SCAN_ABORT_IND:
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301505 {
1506 tANI_U8 *pSessionId = (tANI_U8 *)limMsg->bodyptr;
1507 limProcessAbortScanInd(pMac, *pSessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -07001508 vos_mem_free((v_VOID_t *)limMsg->bodyptr);
1509 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001510 break;
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301511 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001512 case eWNI_SME_START_REQ:
1513 case eWNI_SME_SYS_READY_IND:
1514#ifndef WNI_ASKEY_NON_SUPPORT_FEATURE
1515 case eWNI_SME_JOIN_REQ:
1516#endif
1517 case eWNI_SME_AUTH_REQ:
1518 case eWNI_SME_REASSOC_REQ:
1519 case eWNI_SME_START_BSS_REQ:
1520 case eWNI_SME_STOP_BSS_REQ:
1521 case eWNI_SME_SWITCH_CHL_REQ:
1522 case eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ:
1523 case eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ:
1524 case eWNI_SME_SETCONTEXT_REQ:
1525 case eWNI_SME_REMOVEKEY_REQ:
1526#ifndef WNI_ASKEY_NON_SUPPORT_FEATURE
1527 case eWNI_SME_PROMISCUOUS_MODE_REQ:
1528#endif
1529 case eWNI_SME_DISASSOC_CNF:
1530 case eWNI_SME_DEAUTH_CNF:
1531 case eWNI_SME_ASSOC_CNF:
1532 case eWNI_SME_REASSOC_CNF:
1533 case eWNI_SME_ADDTS_REQ:
1534 case eWNI_SME_DELTS_REQ:
1535 case eWNI_SME_DEL_BA_PEER_IND:
1536 case eWNI_SME_SET_TX_POWER_REQ:
1537 case eWNI_SME_GET_TX_POWER_REQ:
1538 case eWNI_SME_GET_NOISE_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001539 case eWNI_SME_GET_ASSOC_STAS_REQ:
1540 case eWNI_SME_TKIP_CNTR_MEAS_REQ:
1541 case eWNI_SME_UPDATE_APWPSIE_REQ:
1542 case eWNI_SME_HIDE_SSID_REQ:
1543 case eWNI_SME_GET_WPSPBC_SESSION_REQ:
1544 case eWNI_SME_SET_APWPARSNIEs_REQ:
Madan Mohan Koyyalamudi167b95e2012-11-27 15:53:38 -08001545 case eWNI_SME_CHNG_MCC_BEACON_INTERVAL:
Jeff Johnson295189b2012-06-20 16:38:30 -07001546#if defined WLAN_FEATURE_VOWIFI
1547 case eWNI_SME_NEIGHBOR_REPORT_REQ_IND:
1548 case eWNI_SME_BEACON_REPORT_RESP_XMIT_IND:
1549#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001550#if defined FEATURE_WLAN_ESE
1551 case eWNI_SME_ESE_ADJACENT_AP_REPORT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001552#endif
1553#ifdef WLAN_FEATURE_VOWIFI_11R
1554 case eWNI_SME_FT_UPDATE_KEY:
1555 case eWNI_SME_FT_PRE_AUTH_REQ:
1556 case eWNI_SME_FT_AGGR_QOS_REQ:
1557#endif
1558 case eWNI_SME_ADD_STA_SELF_REQ:
1559 case eWNI_SME_DEL_STA_SELF_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001560 case eWNI_SME_REGISTER_MGMT_FRAME_REQ:
1561 case eWNI_SME_UPDATE_NOA:
Gopichand Nakkalac178ac82013-05-30 19:53:39 +05301562 case eWNI_SME_CLEAR_DFS_CHANNEL_LIST:
Madan Mohan Koyyalamudi44bbc152013-07-05 21:13:10 +05301563 case eWNI_SME_STA_STAT_REQ:
1564 case eWNI_SME_AGGR_STAT_REQ:
1565 case eWNI_SME_GLOBAL_STAT_REQ:
1566 case eWNI_SME_STAT_SUMM_REQ:
1567 case eWNI_SME_GET_STATISTICS_REQ:
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001568#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR)
Madan Mohan Koyyalamudi44bbc152013-07-05 21:13:10 +05301569 case eWNI_SME_GET_ROAM_RSSI_REQ:
1570#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001571#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001572 case eWNI_SME_GET_TSM_STATS_REQ:
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001573#endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */
Siddharth Bhal6af5d4e2014-09-29 21:11:16 +05301574 case eWNI_SME_MAC_SPOOF_ADDR_IND:
Abhishek Singh7d624e12015-11-30 14:29:27 +05301575 case eWNI_SME_REGISTER_MGMT_FRAME_CB:
Jeff Johnson295189b2012-06-20 16:38:30 -07001576 // These messages are from HDD
1577 limProcessNormalHddMsg(pMac, limMsg, false); //no need to response to hdd
1578 break;
1579
1580 //Power Save Messages From HDD
1581 case eWNI_PMC_PWR_SAVE_CFG:
1582 case eWNI_PMC_ENTER_BMPS_REQ:
1583 case eWNI_PMC_EXIT_BMPS_REQ:
1584 case eWNI_PMC_ENTER_IMPS_REQ:
1585 case eWNI_PMC_EXIT_IMPS_REQ:
1586 case eWNI_PMC_ENTER_UAPSD_REQ:
1587 case eWNI_PMC_EXIT_UAPSD_REQ:
1588 case eWNI_PMC_ENTER_WOWL_REQ:
1589 case eWNI_PMC_EXIT_WOWL_REQ:
1590 case eWNI_PMC_WOWL_ADD_BCAST_PTRN:
1591 case eWNI_PMC_WOWL_DEL_BCAST_PTRN:
1592 pmmProcessMessage(pMac, limMsg);
1593 break;
1594
1595 case eWNI_PMC_SMPS_STATE_IND :
1596 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001597 if(limMsg->bodyptr){
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301598 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001599 limMsg->bodyptr = NULL;
1600 }
1601 }
1602 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001603 case eWNI_SME_SEND_ACTION_FRAME_IND:
1604 limSendP2PActionFrame(pMac, limMsg);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301605 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001606 limMsg->bodyptr = NULL;
1607 break;
1608 case eWNI_SME_ABORT_REMAIN_ON_CHAN_IND:
1609 limAbortRemainOnChan(pMac);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301610 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001611 limMsg->bodyptr = NULL;
1612 break;
1613
Abhishek Singh00b71972016-01-07 10:51:04 +05301614#ifdef WLAN_FEATURE_RMC
1615 case eWNI_SME_ENABLE_RMC_REQ:
1616 case eWNI_SME_DISABLE_RMC_REQ:
1617 /*
1618 * These messages are from HDD
1619 * No need to response to hdd
1620 */
1621 limProcessSmeReqMessages(pMac,limMsg);
1622 break;
1623#endif /* WLAN_FEATURE_RMC */
1624
Viral Modid86bde22012-12-10 13:09:21 -08001625 case SIR_HAL_P2P_NOA_START_IND:
1626 {
1627 tpPESession psessionEntry = &pMac->lim.gpSession[0];
1628 tANI_U8 i;
Viral Modid440e682013-03-06 02:25:31 -08001629 tANI_U8 p2pGOExists = 0;
Gopichand Nakkala78a6c812013-05-13 16:39:49 +05301630
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001631 limLog(pMac, LOG1, "LIM received NOA start %x", limMsg->type);
Viral Modid440e682013-03-06 02:25:31 -08001632
1633 /* Since insert NOA is done and NOA start msg received, we should deactivate the Insert NOA timer */
1634 limDeactivateAndChangeTimer(pMac, eLIM_INSERT_SINGLESHOT_NOA_TIMER);
1635
Viral Modid86bde22012-12-10 13:09:21 -08001636 for(i=0; i < pMac->lim.maxBssId; i++)
1637 {
1638 psessionEntry = &pMac->lim.gpSession[i];
1639 if ( (psessionEntry != NULL) && (psessionEntry->valid) &&
1640 (psessionEntry->pePersona == VOS_P2P_GO_MODE))
1641 { //Save P2P NOA start attributes for P2P Go persona
Viral Modid440e682013-03-06 02:25:31 -08001642 p2pGOExists = 1;
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301643 vos_mem_copy(&psessionEntry->p2pGoPsNoaStartInd, limMsg->bodyptr,
1644 sizeof(tSirP2PNoaStart));
Viral Modid440e682013-03-06 02:25:31 -08001645 if (psessionEntry->p2pGoPsNoaStartInd.status != eHAL_STATUS_SUCCESS)
Viral Modid86bde22012-12-10 13:09:21 -08001646 {
Viral Modid440e682013-03-06 02:25:31 -08001647 limLog(pMac, LOGW, FL("GO NOA start failure status %d reported by FW."
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001648 " - still go ahead with deferred sme req. This is just info"),
Viral Modid440e682013-03-06 02:25:31 -08001649 psessionEntry->p2pGoPsNoaStartInd.status);
Viral Modid86bde22012-12-10 13:09:21 -08001650 }
Viral Modid86bde22012-12-10 13:09:21 -08001651 break;
1652 }
1653 }
Viral Modid440e682013-03-06 02:25:31 -08001654
1655 if (p2pGOExists == 0)
1656 {
1657 limLog(pMac, LOGW, FL("By the time, we received NOA start, GO is already removed."
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001658 " - still go ahead with deferred sme req. This is just info"));
Viral Modid440e682013-03-06 02:25:31 -08001659 }
1660
1661 /* We received the NOA start indication. Now we can send down the SME request which requires off-channel operation */
1662 limProcessRegdDefdSmeReqAfterNOAStart(pMac);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301663 vos_mem_free(limMsg->bodyptr);
Viral Modid86bde22012-12-10 13:09:21 -08001664 limMsg->bodyptr = NULL;
Viral Modid440e682013-03-06 02:25:31 -08001665 }
Viral Modid86bde22012-12-10 13:09:21 -08001666 break;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301667#ifdef FEATURE_WLAN_TDLS
1668 case SIR_HAL_TDLS_IND:
1669 {
1670 tSirTdlsInd *pTdlsInd = (tpSirTdlsInd)limMsg->bodyptr ;
1671 tpDphHashNode pStaDs = NULL ;
1672 tpPESession psessionEntry = NULL;
1673 tANI_U8 sessionId;
1674 if((psessionEntry = peFindSessionByStaId(pMac,pTdlsInd->staIdx,&sessionId))== NULL)
1675 {
1676 limLog(pMac, LOG1, FL("session does not exist for given bssId\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 }
1681 if ((pStaDs = dphGetHashEntry(pMac, pTdlsInd->assocId, &psessionEntry->dph.dphHashTable)) == NULL)
1682 {
1683 limLog(pMac, LOG1, FL("pStaDs Does not exist for given staId\n"));
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301684 vos_mem_free(limMsg->bodyptr);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301685 limMsg->bodyptr = NULL;
1686 return;
1687 }
Viral Modid86bde22012-12-10 13:09:21 -08001688
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301689 if ((STA_ENTRY_TDLS_PEER == pStaDs->staType))
1690 {
1691 limLog(pMac, LOGE,
1692 FL("received TDLS Indication from the Firmware with Reason Code %d "),
1693 pTdlsInd->reasonCode);
1694 limSendSmeTDLSDelStaInd(pMac, pStaDs, psessionEntry,
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05301695 pTdlsInd->reasonCode);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301696 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301697 vos_mem_free(limMsg->bodyptr);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301698 limMsg->bodyptr = NULL;
1699 }
1700 break;
1701#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001702 case SIR_HAL_P2P_NOA_ATTR_IND:
1703 {
1704 tpPESession psessionEntry = &pMac->lim.gpSession[0];
1705 tANI_U8 i;
1706
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001707 limLog(pMac, LOGW, FL("Received message Noa_ATTR %x"), limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -07001708 for(i=0; i < pMac->lim.maxBssId; i++)
1709 {
Viral Modid86bde22012-12-10 13:09:21 -08001710 psessionEntry = &pMac->lim.gpSession[i];
1711 if ( (psessionEntry != NULL) && (psessionEntry->valid) &&
Jeff Johnson295189b2012-06-20 16:38:30 -07001712 (psessionEntry->pePersona == VOS_P2P_GO_MODE))
1713 { //Save P2P attributes for P2P Go persona
1714
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301715 vos_mem_copy(&psessionEntry->p2pGoPsUpdate, limMsg->bodyptr,
1716 sizeof(tSirP2PNoaAttr));
1717
Arif Hussain24bafea2013-11-15 15:10:03 -08001718 limLog(pMac, LOG2, FL(" &psessionEntry->bssId "
1719 MAC_ADDRESS_STR " ctWin=%d oppPsFlag=%d"),
1720 MAC_ADDR_ARRAY(psessionEntry->bssId),
Jeff Johnson295189b2012-06-20 16:38:30 -07001721 psessionEntry->p2pGoPsUpdate.ctWin,
1722 psessionEntry->p2pGoPsUpdate.oppPsFlag);
1723
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001724 limLog(pMac, LOG2, FL(" uNoa1IntervalCnt=%d uNoa1Duration=%d uNoa1Interval=%d uNoa1StartTime=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001725 psessionEntry->p2pGoPsUpdate.uNoa1IntervalCnt,
1726 psessionEntry->p2pGoPsUpdate.uNoa1Duration,
1727 psessionEntry->p2pGoPsUpdate.uNoa1Interval,
1728 psessionEntry->p2pGoPsUpdate.uNoa1StartTime);
1729
1730
1731 break;
1732 }
1733 }
1734
1735 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301736 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001737 limMsg->bodyptr = NULL;
1738
1739 break;
1740
1741
Jeff Johnson295189b2012-06-20 16:38:30 -07001742 /* eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER Message comes after the
1743 * device comes out of full power for the full power request sent
1744 * because of channel switch with switch count as 0, so call the same
1745 * function used in timeout case(i.e SIR_LIM_CHANNEL_SWITCH_TIMEOUT)
1746 * for switching the channel*/
1747 case eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER:
Jeff Johnsone7245742012-09-05 17:12:55 -07001748 if ( !tx_timer_running(&pMac->lim.limTimers.gLimChannelSwitchTimer) )
1749 {
1750 limProcessChannelSwitchTimeout(pMac);
1751 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301752 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001753 limMsg->bodyptr = NULL;
1754 break;
1755
1756 //Power Save Related Messages From HAL
1757 case WDA_ENTER_BMPS_RSP:
1758 case WDA_EXIT_BMPS_RSP:
1759 case WDA_EXIT_BMPS_IND:
1760 case WDA_ENTER_IMPS_RSP:
1761 case WDA_EXIT_IMPS_RSP:
1762 case WDA_ENTER_UAPSD_RSP:
1763 case WDA_EXIT_UAPSD_RSP:
1764 case WDA_WOWL_ENTER_RSP:
1765 case WDA_WOWL_EXIT_RSP:
1766 pmmProcessMessage(pMac, limMsg);
1767 break;
1768
1769 case WDA_LOW_RSSI_IND:
1770 //limHandleLowRssiInd(pMac);
1771 break;
1772
1773 case WDA_BMPS_STATUS_IND:
1774 limHandleBmpsStatusInd(pMac);
1775 break;
1776
1777 case WDA_MISSED_BEACON_IND:
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001778 limHandleMissedBeaconInd(pMac, limMsg);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301779 vos_mem_free(limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001780 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001781 break;
1782 case WDA_MIC_FAILURE_IND:
1783 limMicFailureInd(pMac, limMsg);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301784 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001785 limMsg->bodyptr = NULL;
1786 break;
1787
Sachin Ahuja3d47fcd2015-08-28 16:02:06 +05301788 case WDA_LOST_LINK_PARAMS_IND:
1789 limProcessLostLinkParamsInd(pMac,limMsg);
1790 vos_mem_free(limMsg->bodyptr);
1791 limMsg->bodyptr = NULL;
1792 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001793
1794 case SIR_LIM_ADDTS_RSP_TIMEOUT:
1795 limProcessSmeReqMessages(pMac,limMsg);
1796 break;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001797#ifdef FEATURE_WLAN_ESE
1798 case SIR_LIM_ESE_TSM_TIMEOUT:
1799#ifndef FEATURE_WLAN_ESE_UPLOAD
Jeff Johnson295189b2012-06-20 16:38:30 -07001800 limProcessTsmTimeoutHandler(pMac,limMsg);
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001801#endif /* FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001802 break;
1803 case WDA_TSM_STATS_RSP:
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001804#ifdef FEATURE_WLAN_ESE_UPLOAD
1805 limSendSmePEEseTsmRsp(pMac, (tAniGetTsmStatsRsp *)limMsg->bodyptr);
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001806#else
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001807 limProcessHalEseTsmRsp(pMac, limMsg);
1808#endif /* FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001809 break;
1810#endif
1811 case WDA_ADD_TS_RSP:
1812 limProcessHalAddTsRsp(pMac, limMsg);
1813 break;
1814
1815 case SIR_LIM_DEL_TS_IND:
1816 limProcessDelTsInd(pMac, limMsg);
Madan Mohan Koyyalamudif244d8f2012-11-29 11:21:05 -08001817 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001818 case SIR_LIM_ADD_BA_IND:
1819 limProcessAddBaInd(pMac, limMsg);
1820 break;
1821 case SIR_LIM_DEL_BA_ALL_IND:
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001822 limDelAllBASessions(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001823 break;
1824 case SIR_LIM_DEL_BA_IND:
1825 limProcessMlmHalBADeleteInd( pMac, limMsg );
1826 break;
1827
1828 case SIR_LIM_BEACON_GEN_IND: {
Jeff Johnson295189b2012-06-20 16:38:30 -07001829
Jeff Johnson295189b2012-06-20 16:38:30 -07001830 if( pMac->lim.gLimSystemRole != eLIM_AP_ROLE )
Jeff Johnson295189b2012-06-20 16:38:30 -07001831 schProcessPreBeaconInd(pMac, limMsg);
1832
1833 }
1834 break;
1835
1836 case SIR_LIM_DELETE_STA_CONTEXT_IND:
1837 limDeleteStaContext(pMac, limMsg);
1838 break;
1839
1840 case SIR_LIM_MIN_CHANNEL_TIMEOUT:
1841 case SIR_LIM_MAX_CHANNEL_TIMEOUT:
1842 case SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT:
1843 case SIR_LIM_JOIN_FAIL_TIMEOUT:
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001844 case SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001845 case SIR_LIM_AUTH_FAIL_TIMEOUT:
1846 case SIR_LIM_AUTH_RSP_TIMEOUT:
1847 case SIR_LIM_ASSOC_FAIL_TIMEOUT:
1848 case SIR_LIM_REASSOC_FAIL_TIMEOUT:
1849#ifdef WLAN_FEATURE_VOWIFI_11R
1850 case SIR_LIM_FT_PREAUTH_RSP_TIMEOUT:
1851#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001852 case SIR_LIM_REMAIN_CHN_TIMEOUT:
Viral Modid86bde22012-12-10 13:09:21 -08001853 case SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT:
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001854 case SIR_LIM_DISASSOC_ACK_TIMEOUT:
1855 case SIR_LIM_DEAUTH_ACK_TIMEOUT:
Gopichand Nakkalad492d202013-05-10 02:50:47 +05301856 case SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
Sushant Kaushik9e923872015-04-02 17:09:31 +05301857 case SIR_LIM_AUTH_RETRY_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001858 // These timeout messages are handled by MLM sub module
1859
1860 limProcessMlmReqMessages(pMac,
1861 limMsg);
1862
1863 break;
1864
1865 case SIR_LIM_HEART_BEAT_TIMEOUT:
1866 /** check if heart beat failed, even if one Beacon
1867 * is rcvd within the Heart Beat interval continue
1868 * normal processing
1869 */
1870
1871 #if 0
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001872 PELOG1(limLog(pMac, LOG1, FL("Heartbeat timeout, SME %d, MLME %d, #bcn %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001873 pMac->lim.gLimSmeState, pMac->lim.gLimMlmState,
1874 pMac->lim.gLimRxedBeaconCntDuringHB);)
1875
1876 if(pMac->lim.gLimSystemRole == eLIM_STA_IN_IBSS_ROLE)
1877 limIbssHeartBeatHandle(pMac); //HeartBeat for peers.
1878 else
1879 /**
1880 * Heartbeat failure occurred on STA
1881 * This is handled by LMM sub module.
1882 */
1883 limHandleHeartBeatFailure(pMac);
1884
1885 break;
1886 #endif //TO SUPPORT BT-AMP
Yathish9f22e662012-12-10 14:21:35 -08001887 if (limIsSystemInScanState(pMac))
1888 {
1889 // System is in DFS (Learn) mode
1890 // Defer processsing this message
1891 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1892 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001893 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 -08001894 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1895 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
1896 limLogSessionStates(pMac);
1897 }
1898 }
1899 else
1900 {
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001901 if (NULL == limMsg->bodyptr)
1902 {
1903 limHandleHeartBeatTimeout(pMac);
1904 }
1905 else
1906 {
1907 limHandleHeartBeatTimeoutForSession(pMac, (tpPESession)limMsg->bodyptr);
1908 }
Gopichand Nakkala78a6c812013-05-13 16:39:49 +05301909 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001910 break;
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001911
Jeff Johnson295189b2012-06-20 16:38:30 -07001912 case SIR_LIM_PROBE_HB_FAILURE_TIMEOUT:
1913 limHandleHeartBeatFailureTimeout(pMac);
1914 break;
1915
1916 case SIR_LIM_CHANNEL_SCAN_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001917 /**
1918 * Background scan timeout occurred on STA.
1919 * This is handled by LMM sub module.
1920 */
1921 limDeactivateAndChangeTimer(pMac, eLIM_BACKGROUND_SCAN_TIMER);
1922
1923 //We will do background scan even in bcnps mode
1924 //if (pMac->sys.gSysEnableScanMode)
1925 pMac->lim.gLimReportBackgroundScanResults = FALSE;
1926 limTriggerBackgroundScan(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001927 break;
1928
Jeff Johnson295189b2012-06-20 16:38:30 -07001929 case SIR_LIM_CNF_WAIT_TIMEOUT:
1930
1931 /*
1932 ** Does not receive CNF or dummy packet
1933 **/
1934 limHandleCnfWaitTimeout(pMac, (tANI_U16) limMsg->bodyval);
1935
1936 break;
1937
1938 case SIR_LIM_KEEPALIVE_TIMEOUT:
1939 limSendKeepAliveToPeer(pMac);
1940
1941 break;
1942
1943 case SIR_LIM_RETRY_INTERRUPT_MSG:
1944 // Message from ISR upon TFP's max retry limit interrupt
1945
1946 break;
1947
1948 case SIR_LIM_INV_KEY_INTERRUPT_MSG:
1949 // Message from ISR upon SP's Invalid session key interrupt
1950
1951 break;
1952
1953 case SIR_LIM_KEY_ID_INTERRUPT_MSG:
1954 // Message from ISR upon SP's Invalid key ID interrupt
1955
1956 break;
1957
1958 case SIR_LIM_REPLAY_THRES_INTERRUPT_MSG:
1959 // Message from ISR upon SP's Replay threshold interrupt
1960
1961 break;
1962
1963 case SIR_LIM_CHANNEL_SWITCH_TIMEOUT:
1964 limProcessChannelSwitchTimeout(pMac);
1965 break;
1966
1967 case SIR_LIM_QUIET_TIMEOUT:
1968 limProcessQuietTimeout(pMac);
1969 break;
1970
1971 case SIR_LIM_QUIET_BSS_TIMEOUT:
1972 limProcessQuietBssTimeout(pMac);
1973 break;
1974
Jeff Johnson295189b2012-06-20 16:38:30 -07001975 case SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT:
1976 limHandleUpdateOlbcCache(pMac);
1977 break;
1978#if 0
1979 case SIR_LIM_WPS_OVERLAP_TIMEOUT:
1980 limProcessWPSOverlapTimeout(pMac);
1981 break;
1982#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001983 case WDA_ADD_BSS_RSP:
1984 limProcessMlmAddBssRsp( pMac, limMsg );
1985 break;
1986
1987 case WDA_ADD_STA_RSP:
1988
1989 //call a wrapper by paasing bodyptr, their get sessionID and and call proper function from there.
1990 limProcessAddStaRsp(pMac,limMsg);
1991 break;
1992
1993 case WDA_DELETE_STA_RSP:
1994 limProcessMlmDelStaRsp(pMac, limMsg);
1995 break;
1996
1997 case WDA_ADD_STA_SELF_RSP:
1998 limProcessAddStaSelfRsp(pMac, limMsg);
1999 break;
2000 case WDA_DEL_STA_SELF_RSP:
2001 limProcessDelStaSelfRsp(pMac, limMsg);
2002 break;
2003
2004 case WDA_DELETE_BSS_RSP:
2005 limHandleDeleteBssRsp(pMac,limMsg); //wrapper routine to handle delete bss response
2006 break;
2007
2008 case WDA_SET_BSSKEY_RSP:
2009 case WDA_SET_STA_BCASTKEY_RSP:
2010 limProcessMlmSetBssKeyRsp( pMac, limMsg );
2011 break;
2012 case WDA_SET_STAKEY_RSP:
2013 limProcessMlmSetStaKeyRsp( pMac, limMsg );
2014 break;
2015 case WDA_REMOVE_BSSKEY_RSP:
2016 case WDA_REMOVE_STAKEY_RSP:
2017 limProcessMlmRemoveKeyRsp( pMac, limMsg );
2018 break;
2019 case WDA_ADDBA_RSP:
2020 limProcessMlmHalAddBARsp( pMac, limMsg );
2021 break;
2022
2023 case WDA_STA_STAT_RSP:
2024 case WDA_AGGR_STAT_RSP:
2025 case WDA_GLOBAL_STAT_RSP:
2026 case WDA_STAT_SUMM_RSP:
2027 limSendSmeStatsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
2028 break;
2029
2030 case WDA_GET_STATISTICS_RSP:
2031 limSendSmePEStatisticsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
2032 break;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08002033#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR)
Srinivas Girigowdad34cedb2013-01-25 13:33:11 -08002034 case WDA_GET_ROAM_RSSI_RSP:
2035 limSendSmePEGetRoamRssiRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
2036 break;
2037#endif
2038
Jeff Johnson295189b2012-06-20 16:38:30 -07002039
2040 case WDA_SET_MIMOPS_RSP: //limProcessSetMimoRsp(pMac, limMsg);
2041 case WDA_SET_TX_POWER_RSP: //limProcessSetTxPowerRsp(pMac, limMsg);
2042 case WDA_GET_TX_POWER_RSP: //limProcessGetTxPowerRsp(pMac, limMsg);
2043 case WDA_GET_NOISE_RSP:
2044 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2045 limMsg->bodyptr = NULL;
2046 //limProcessGetNoiseRsp(pMac, limMsg);
2047 break;
2048
2049 case WDA_SET_MAX_TX_POWER_RSP:
2050#if defined WLAN_FEATURE_VOWIFI
2051 rrmSetMaxTxPowerRsp( pMac, limMsg );
2052#endif
2053 if(limMsg->bodyptr != NULL)
2054 {
2055 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2056 limMsg->bodyptr = NULL;
2057 }
2058 break;
2059
Jeff Johnson295189b2012-06-20 16:38:30 -07002060 case SIR_LIM_ADDR2_MISS_IND:
2061 {
2062 limLog(pMac, LOGE,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002063 FL("Addr2 mismatch interrupt received %X"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002064 limMsg->type);
2065 /*a message from HAL indicating addr2 mismatch interrupt occurred
2066 limMsg->bodyptr contains only pointer to 48-bit addr2 field*/
2067 //Dinesh fix this. the third parameter should be sessionentry.
2068 //limHandleUnknownA2IndexFrames(pMac, (void *)limMsg->bodyptr);
2069
2070 /*Free message body pointer*/
2071 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08002072 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07002073 break;
2074 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002075
2076#ifdef WLAN_FEATURE_VOWIFI_11R
2077 case WDA_AGGR_QOS_RSP:
2078 limProcessFTAggrQoSRsp( pMac, limMsg );
2079 break;
2080#endif
2081
2082 case WDA_SET_LINK_STATE_RSP:
2083 linkStateParams = (tLinkStateParams *)limMsg->bodyptr;
2084#if defined WLAN_FEATURE_VOWIFI_11R
2085 pSession = linkStateParams->session;
2086 if(linkStateParams->ft)
2087 {
2088 limSendReassocReqWithFTIEsMgmtFrame(pMac,
2089 pSession->pLimMlmReassocReq,
2090 pSession);
2091 }
2092#endif
2093 if( linkStateParams->callback )
2094 {
2095 linkStateParams->callback( pMac, linkStateParams->callbackArg );
2096 }
2097 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08002098 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07002099 break;
2100
2101#ifdef WLAN_FEATURE_PACKET_FILTERING
2102 case WDA_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP:
2103 pmmProcessMessage(pMac, limMsg);
2104 break;
2105#endif // WLAN_FEATURE_PACKET_FILTERING
2106
2107#ifdef WLAN_FEATURE_GTK_OFFLOAD
2108 case WDA_GTK_OFFLOAD_GETINFO_RSP:
2109 pmmProcessMessage(pMac, limMsg);
2110 break;
2111#endif // WLAN_FEATURE_GTK_OFFLOAD
Yathish9f22e662012-12-10 14:21:35 -08002112 case eWNI_SME_SET_BCN_FILTER_REQ:
2113 {
2114#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2115 tpPESession psessionEntry;
2116 tANI_U8 sessionId = (tANI_U8)limMsg->bodyval ;
2117 psessionEntry = &pMac->lim.gpSession[sessionId];
2118 if(psessionEntry != NULL && IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
2119 {
2120 // sending beacon filtering information down to HAL
2121 if (limSendBeaconFilterInfo(pMac, psessionEntry) != eSIR_SUCCESS)
2122 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002123 limLog(pMac, LOGE, FL("Fail to send Beacon Filter Info "));
Yathish9f22e662012-12-10 14:21:35 -08002124 }
2125 }
Dhanashri Atred7885c22013-03-29 11:19:05 -07002126 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
2127 limMsg->bodyptr = NULL;
Yathish9f22e662012-12-10 14:21:35 -08002128#endif
2129 }
2130 break;
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302131 case eWNI_SME_HT40_OBSS_SCAN_IND:
2132 {
Sandeep Puligilla9f384742014-04-11 02:27:04 +05302133 tpPESession psessionEntry = NULL;
2134 tANI_U8 sessionId;
2135 tSirSmeHT40OBSSScanInd *ht40ScanInd =
Siddharth Bhald31c1252014-05-05 19:34:14 +05302136 (tSirSmeHT40OBSSScanInd *)limMsg->bodyptr;
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302137
Sandeep Puligilla9f384742014-04-11 02:27:04 +05302138 psessionEntry = peFindSessionByBssid(pMac, ht40ScanInd->peerMacAddr,
Siddharth Bhald31c1252014-05-05 19:34:14 +05302139 &sessionId);
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302140
Siddharth Bhald31c1252014-05-05 19:34:14 +05302141 if (psessionEntry != NULL)
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302142 {
Siddharth Bhald31c1252014-05-05 19:34:14 +05302143 if( IS_HT40_OBSS_SCAN_FEATURE_ENABLE &&
2144 psessionEntry->htSupportedChannelWidthSet ==
2145 WNI_CFG_CHANNEL_BONDING_MODE_ENABLE )
2146 {
2147 VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO,
2148 "OBSS Scan Start Req: session id %d"
2149 "htSupportedChannelWidthSet %d", psessionEntry->peSessionId,
2150 psessionEntry->htSupportedChannelWidthSet);
2151 limSendHT40OBSSScanInd(pMac, psessionEntry);
2152 }
2153 else
2154 {
2155 VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO,
2156 "OBSS Scan not started: htSupportedChannelWidthSet- %d"
2157 " session id %d", psessionEntry->htSupportedChannelWidthSet,
2158 psessionEntry->peSessionId);
2159 }
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302160 }
2161 else
2162 {
2163 VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO,
Siddharth Bhald31c1252014-05-05 19:34:14 +05302164 "OBSS Scan not started: session id is NULL");
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302165 }
2166 vos_mem_free(limMsg->bodyptr);
2167 limMsg->bodyptr = NULL;
2168 }
2169 break;
2170 case eWNI_SME_HT40_STOP_OBSS_SCAN_IND:
2171 {
2172 tpPESession psessionEntry = NULL;
2173 tANI_U8 sessionId = (tANI_U8)limMsg->bodyval ;
2174
2175 psessionEntry = &pMac->lim.gpSession[sessionId];
2176 /* Sending LIM STOP OBSS SCAN Indication
2177 Stop command support is only for debugging purpose */
2178 if ( IS_HT40_OBSS_SCAN_FEATURE_ENABLE )
2179 limSendHT40OBSSStopScanInd(pMac, psessionEntry);
2180 else
2181 VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_ERROR,
2182 "OBSS Scan Stop not started ");
2183 }
2184 break;
Hardik Kantilal Patel62a3a762014-11-21 12:55:57 +05302185#ifdef WLAN_FEATURE_AP_HT40_24G
2186 case eWNI_SME_SET_HT_2040_MODE:
2187 limProcessSmeReqMessages(pMac, limMsg);
2188 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2189 limMsg->bodyptr = NULL;
2190 break;
2191#endif
2192
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05302193#ifdef FEATURE_WLAN_TDLS
2194 case WDA_SET_TDLS_LINK_ESTABLISH_REQ_RSP:
2195 {
Gopichand Nakkala24be5312013-07-02 16:47:12 +05302196 tpPESession psessionEntry;
2197 tANI_U8 sessionId;
Masti, Narayanraddif10fd792015-12-15 15:01:01 +05302198 tDphHashNode *pStaDs;
2199 int i, aid;
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05302200 tTdlsLinkEstablishParams *pTdlsLinkEstablishParams;
2201 pTdlsLinkEstablishParams = (tTdlsLinkEstablishParams*) limMsg->bodyptr;
Gopichand Nakkala24be5312013-07-02 16:47:12 +05302202
2203 if((psessionEntry = peFindSessionByStaId(pMac,
2204 pTdlsLinkEstablishParams->staIdx,
2205 &sessionId))== NULL)
2206 {
Sushant Kaushik87787972015-09-11 16:05:00 +05302207 limLog(pMac, LOGE, FL("session %u does not exist"), sessionId);
Gopichand Nakkala24be5312013-07-02 16:47:12 +05302208 /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP message to SME
2209 with session id as zero and status as FAILURE so, that message
2210 queued in SME queue can be freed to prevent the SME cmd buffer leak */
2211 limSendSmeTdlsLinkEstablishReqRsp(pMac,
2212 0,
2213 NULL,
2214 NULL,
2215 eSIR_FAILURE);
2216 }
2217 else
2218 {
Masti, Narayanraddif10fd792015-12-15 15:01:01 +05302219 for (i = 0;
2220 i < sizeof(psessionEntry->peerAIDBitmap)/sizeof(tANI_U32);
2221 i++) {
2222 for (aid = 0; aid < (sizeof(tANI_U32) << 3); aid++) {
2223 if (CHECK_BIT(psessionEntry->peerAIDBitmap[i], aid)) {
2224 pStaDs = dphGetHashEntry(pMac,
2225 (aid + i*(sizeof(tANI_U32) << 3)),
2226 &psessionEntry->dph.dphHashTable);
2227 if ((NULL != pStaDs) &&
2228 (pTdlsLinkEstablishParams->staIdx ==
2229 pStaDs->staIndex))
2230 goto send_link_resp;
2231 }
2232 }
2233 }
2234send_link_resp:
Gopichand Nakkala24be5312013-07-02 16:47:12 +05302235 limSendSmeTdlsLinkEstablishReqRsp(pMac,
2236 psessionEntry->smeSessionId,
Masti, Narayanraddif10fd792015-12-15 15:01:01 +05302237 pStaDs->staAddr,
2238 pStaDs,
Gopichand Nakkala24be5312013-07-02 16:47:12 +05302239 pTdlsLinkEstablishParams->status) ;
2240 }
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05302241 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
2242 limMsg->bodyptr = NULL;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05302243 break;
2244 }
Atul Mittal60bd4292014-08-14 12:19:27 +05302245
2246 case WDA_SET_TDLS_CHAN_SWITCH_REQ_RSP:
2247 {
2248 tpPESession psessionEntry;
2249 tANI_U8 sessionId;
Masti, Narayanraddi36c67622016-01-06 16:07:34 +05302250 tDphHashNode *pStaDs;
2251 int i, aid;
Atul Mittal60bd4292014-08-14 12:19:27 +05302252 tTdlsChanSwitchParams *pTdlsChanSwitchParams;
2253 pTdlsChanSwitchParams = (tTdlsChanSwitchParams*) limMsg->bodyptr;
2254
2255 if((psessionEntry = peFindSessionByStaId(pMac,
2256 pTdlsChanSwitchParams->staIdx,
2257 &sessionId))== NULL)
2258 {
Sushant Kaushik87787972015-09-11 16:05:00 +05302259 limLog(pMac, LOGE, FL("session %u does not exist"), sessionId);
Atul Mittal60bd4292014-08-14 12:19:27 +05302260 /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP message to SME
2261 with session id as zero and status as FAILURE so, that message
2262 queued in SME queue can be freed to prevent the SME cmd buffer leak */
2263 limSendSmeTdlsChanSwitchReqRsp(pMac,
2264 0,
2265 NULL,
2266 NULL,
2267 eSIR_FAILURE);
2268 }
2269 else
2270 {
Masti, Narayanraddi36c67622016-01-06 16:07:34 +05302271 for (i = 0;
2272 i < sizeof(psessionEntry->peerAIDBitmap)/sizeof(tANI_U32);
2273 i++) {
2274 for (aid = 0; aid < (sizeof(tANI_U32) << 3); aid++) {
2275 if (CHECK_BIT(psessionEntry->peerAIDBitmap[i], aid)) {
2276 pStaDs = dphGetHashEntry(pMac,
2277 (aid + i*(sizeof(tANI_U32) << 3)),
2278 &psessionEntry->dph.dphHashTable);
2279 if ((NULL != pStaDs) &&
2280 (pTdlsChanSwitchParams->staIdx ==
2281 pStaDs->staIndex))
2282 goto send_chan_switch_resp;
2283 }
2284 }
2285 }
2286send_chan_switch_resp:
Atul Mittal60bd4292014-08-14 12:19:27 +05302287 limSendSmeTdlsChanSwitchReqRsp(pMac,
2288 psessionEntry->smeSessionId,
Masti, Narayanraddi36c67622016-01-06 16:07:34 +05302289 pStaDs->staAddr,
2290 pStaDs,
Atul Mittal60bd4292014-08-14 12:19:27 +05302291 pTdlsChanSwitchParams->status) ;
2292 }
2293 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
2294 limMsg->bodyptr = NULL;
2295 break;
2296 }
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05302297#endif
Gopichand Nakkala2c231c82013-06-11 17:49:16 +05302298
2299 case WDA_RX_SCAN_EVENT:
2300 limProcessRxScanEvent(pMac, limMsg->bodyptr);
2301 break;
2302
Ravi Joshid2ca7c42013-07-23 08:37:49 -07002303 case WDA_IBSS_PEER_INACTIVITY_IND:
2304 {
2305 limProcessIbssPeerInactivity(pMac, limMsg->bodyptr);
2306 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
2307 limMsg->bodyptr = NULL;
2308 break;
2309 }
Abhishek Singh00b71972016-01-07 10:51:04 +05302310#ifdef WLAN_FEATURE_RMC
2311 case WDA_RMC_BECOME_RULER:
2312 limProcessRMCMessages(pMac, eLIM_RMC_BECOME_RULER_RESP,
2313 (void *)limMsg->bodyptr);
2314 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2315 limMsg->bodyptr = NULL;
2316 break ;
2317
2318 case WDA_RMC_RULER_SELECT_RESP:
2319 limProcessRMCMessages(pMac, eLIM_RMC_RULER_SELECT_RESP,
2320 (void *)limMsg->bodyptr);
2321 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2322 limMsg->bodyptr = NULL;
2323 break ;
2324
2325 case WDA_RMC_UPDATE_IND:
2326 limProcessRMCMessages(pMac, eLIM_RMC_RULER_PICK_NEW,
2327 (void *)limMsg->bodyptr);
2328 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2329 limMsg->bodyptr = NULL;
2330 break ;
2331#endif /* WLAN_FEATURE_RMC */
Ravi Joshid2ca7c42013-07-23 08:37:49 -07002332
Siddharth Bhal4f3187c2014-10-09 21:38:08 +05302333 case WDA_SPOOF_MAC_ADDR_RSP:
2334 limProcessMlmSpoofMacAddrRsp(pMac, (tSirRetStatus)limMsg->bodyval);
2335 break;
2336
Pradeep Reddy POTTETI31505892015-04-16 16:47:54 +05302337 case eWNI_SME_SET_TDLS_2040_BSSCOEX_REQ:
2338 limProcessSmeSetTdls2040BSSCoexReq(pMac, limMsg->bodyptr);
2339 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2340 limMsg->bodyptr = NULL;
2341 break;
2342
Masti, Narayanraddi1fb32a92015-06-29 13:14:06 +05302343 case eWNI_SME_DEL_ALL_TDLS_PEERS:
2344 limProcessSmeDelAllTdlsPeers(pMac, limMsg->bodyptr);
2345 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2346 limMsg->bodyptr = NULL;
2347 break;
2348
Jeff Johnson295189b2012-06-20 16:38:30 -07002349 default:
2350 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2351 limMsg->bodyptr = NULL;
2352 // Unwanted messages
2353 // Log error
2354 limLog(pMac, LOGE,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002355 FL("Discarding unexpected message received %X"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002356 limMsg->type);
2357 limPrintMsgName(pMac, LOGE, limMsg->type);
2358 break;
2359
2360 } // switch (limMsg->type)
2361
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002362 PELOG2(limLog(pMac, LOG2, FL("Done Processing msgType = %d, sme state = %s, mlm state = %s"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002363 limMsg->type, limSmeStateStr(pMac->lim.gLimSmeState),
2364 limMlmStateStr(pMac->lim.gLimMlmState));)
2365
2366} /*** end limProcessMessages() ***/
2367
2368
2369
2370/**
2371 * limProcessDeferredMessageQueue
2372 *
2373 *FUNCTION:
2374 * This function is called by LIM while exiting from Learn
2375 * mode. This function fetches messages posted to the LIM
2376 * deferred message queue limDeferredMsgQ.
2377 *
2378 *LOGIC:
2379 *
2380 *ASSUMPTIONS:
2381 * NA
2382 *
2383 *NOTE:
2384 * NA
2385 *
2386 * @param pMac - Pointer to Global MAC structure
2387 * @return None
2388 */
2389
2390void
2391limProcessDeferredMessageQueue(tpAniSirGlobal pMac)
2392{
2393 tSirMsgQ limMsg = { 0, 0, 0 };
2394
Jeff Johnson295189b2012-06-20 16:38:30 -07002395 tSirMsgQ *readMsg;
2396 tANI_U16 size;
2397
2398 /*
2399 ** check any deferred messages need to be processed
2400 **/
2401 size = pMac->lim.gLimDeferredMsgQ.size;
2402 if (size > 0)
2403 {
2404 while ((readMsg = limReadDeferredMsgQ(pMac)) != NULL)
2405 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302406 vos_mem_copy((tANI_U8*) &limMsg,
Jeff Johnson295189b2012-06-20 16:38:30 -07002407 (tANI_U8*) readMsg, sizeof(tSirMsgQ));
2408 size--;
2409 limProcessMessages(pMac, &limMsg);
2410
2411 if((limIsSystemInScanState(pMac)) || (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) ||
Hema Aparna Medicharlab56b6612015-05-18 11:42:52 +05302412 (pMac->lim.gLimSystemInScanLearnMode) || pMac->lim.gLimAddtsSent)
Jeff Johnson295189b2012-06-20 16:38:30 -07002413 break;
2414 }
2415 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002416} /*** end limProcessDeferredMessageQueue() ***/
2417
2418
2419/*
2420 * limProcessNormalHddMsg
2421 * Function: this function checks the current lim state and decide whether the message passed shall be deffered.
2422 * @param pMac - Pointer to Global MAC structure
2423 * pLimMsg -- the message need to be processed
2424 * fRspReqd -- whether return result to hdd
2425 * @return None
2426 */
2427void limProcessNormalHddMsg(tpAniSirGlobal pMac, tSirMsgQ *pLimMsg, tANI_U8 fRspReqd)
2428{
2429 tANI_BOOLEAN fDeferMsg = eANI_BOOLEAN_TRUE;
2430
2431 /* Added For BT-AMP Support */
2432 if ((pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_AP_ROLE )
2433 ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_STA_ROLE)
2434 ||(pMac->lim.gLimSystemRole == eLIM_UNKNOWN_ROLE))
2435 {
2436 /** This check is required only for the AP and in 2 cases.
2437 * 1. If we are in learn mode and we receive any of these messages,
2438 * you have to come out of scan and process the message, hence dont
2439 * defer the message here. In handler, these message could be defered
2440 * till we actually come out of scan mode.
2441 * 2. If radar is detected, you might have to defer all of these
2442 * messages except Stop BSS request/ Switch channel request. This
2443 * decision is also made inside its handler.
2444 *
2445 * Please be careful while using the flag fDeferMsg. Possibly you
2446 * might end up in an infinite loop.
2447 **/
2448 if (((pLimMsg->type == eWNI_SME_START_BSS_REQ) ||
2449 (pLimMsg->type == eWNI_SME_STOP_BSS_REQ) ||
2450 (pLimMsg->type == eWNI_SME_SWITCH_CHL_REQ) ||
2451 (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ) ||
2452 (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ)))
2453 {
2454 fDeferMsg = eANI_BOOLEAN_FALSE;
2455 }
2456 }
2457
2458 /* limInsystemInscanState() refers the psessionEntry, how to get session Entry????*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002459 if (((pMac->lim.gLimAddtsSent) || (limIsSystemInScanState(pMac)) /*||
2460 (LIM_IS_RADAR_DETECTED(pMac))*/) && fDeferMsg)
Jeff Johnson295189b2012-06-20 16:38:30 -07002461 {
2462 // System is in DFS (Learn) mode or awaiting addts response
2463 // or if radar is detected, Defer processsing this message
2464 if (limDeferMsg(pMac, pLimMsg) != TX_SUCCESS)
2465 {
2466#ifdef WLAN_DEBUG
2467 pMac->lim.numSme++;
2468#endif
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002469 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 -07002470 pLimMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
2471 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
2472 limLogSessionStates(pMac);
2473 limPrintMsgName(pMac, LOGE, pLimMsg->type);
2474 // Release body
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302475 vos_mem_free(pLimMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08002476 pLimMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07002477 }
2478 }
2479 else
2480 {
2481 if(fRspReqd)
2482 {
2483 // These messages are from HDD
2484 // Since these requests may also be generated
2485 // internally within LIM module, need to
2486 // distinquish and send response to host
2487 pMac->lim.gLimRspReqd = eANI_BOOLEAN_TRUE;
2488 }
2489#ifdef WLAN_DEBUG
2490 pMac->lim.numSme++;
2491#endif
2492 if(limProcessSmeReqMessages(pMac, pLimMsg))
2493 {
2494 // Release body
2495 // limProcessSmeReqMessage consumed the buffer. We can free it.
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302496 vos_mem_free(pLimMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08002497 pLimMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07002498 }
2499 }
2500}
2501
2502void
Jeff Johnsone7245742012-09-05 17:12:55 -07002503handleHTCapabilityandHTInfo(struct sAniSirGlobal *pMac, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07002504{
2505 tSirMacHTCapabilityInfo macHTCapabilityInfo;
2506 tSirMacHTParametersInfo macHTParametersInfo;
2507 tSirMacHTInfoField1 macHTInfoField1;
2508 tSirMacHTInfoField2 macHTInfoField2;
2509 tSirMacHTInfoField3 macHTInfoField3;
2510 tANI_U32 cfgValue;
2511 tANI_U8 *ptr;
Jeff Johnson295189b2012-06-20 16:38:30 -07002512
Jeff Johnson295189b2012-06-20 16:38:30 -07002513 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_CAP_INFO, &cfgValue) != eSIR_SUCCESS)
2514 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002515 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_CAP_INFO value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002516 return ;
2517 }
2518 ptr = (tANI_U8 *) &macHTCapabilityInfo;
2519 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2520 pMac->lim.gHTLsigTXOPProtection = (tANI_U8)macHTCapabilityInfo.lsigTXOPProtection;
2521 pMac->lim.gHTMIMOPSState = (tSirMacHTMIMOPowerSaveState) macHTCapabilityInfo.mimoPowerSave;
2522 pMac->lim.gHTGreenfield = (tANI_U8)macHTCapabilityInfo.greenField;
2523 pMac->lim.gHTMaxAmsduLength = (tANI_U8)macHTCapabilityInfo.maximalAMSDUsize;
2524 pMac->lim.gHTShortGI20Mhz = (tANI_U8)macHTCapabilityInfo.shortGI20MHz;
2525 pMac->lim.gHTShortGI40Mhz = (tANI_U8)macHTCapabilityInfo.shortGI40MHz;
Jeff Johnson295189b2012-06-20 16:38:30 -07002526 pMac->lim.gHTPSMPSupport = (tANI_U8)macHTCapabilityInfo.psmp;
2527 pMac->lim.gHTDsssCckRate40MHzSupport = (tANI_U8)macHTCapabilityInfo.dsssCckMode40MHz;
2528
2529 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_AMPDU_PARAMS, &cfgValue) != eSIR_SUCCESS)
2530 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002531 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_PARAM_INFO value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002532 return ;
2533 }
2534 ptr = (tANI_U8 *) &macHTParametersInfo;
2535 *ptr = (tANI_U8) (cfgValue & 0xff);
2536 pMac->lim.gHTAMpduDensity = (tANI_U8)macHTParametersInfo.mpduDensity;
2537 pMac->lim.gHTMaxRxAMpduFactor = (tANI_U8)macHTParametersInfo.maxRxAMPDUFactor;
2538
2539 // Get HT IE Info
2540 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD1, &cfgValue) != eSIR_SUCCESS)
2541 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002542 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD1 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002543 return ;
2544 }
2545 ptr = (tANI_U8 *) &macHTInfoField1;
2546 *((tANI_U8 *)ptr) = (tANI_U8) (cfgValue & 0xff);
2547 pMac->lim.gHTServiceIntervalGranularity = (tANI_U8)macHTInfoField1.serviceIntervalGranularity;
2548 pMac->lim.gHTControlledAccessOnly = (tANI_U8)macHTInfoField1.controlledAccessOnly;
2549 pMac->lim.gHTRifsMode = (tANI_U8)macHTInfoField1.rifsMode;
Jeff Johnson295189b2012-06-20 16:38:30 -07002550
2551 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD2, &cfgValue) != eSIR_SUCCESS)
2552 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002553 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD2 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002554 return ;
2555 }
2556 ptr = (tANI_U8 *) &macHTInfoField2;
2557 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2558 pMac->lim.gHTOperMode = (tSirMacHTOperatingMode) macHTInfoField2.opMode;
2559
2560 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD3, &cfgValue) != eSIR_SUCCESS)
2561 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002562 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD3 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002563 return ;
2564 }
2565 ptr = (tANI_U8 *) &macHTInfoField3;
2566 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2567 pMac->lim.gHTPCOActive = (tANI_U8)macHTInfoField3.pcoActive;
2568 pMac->lim.gHTPCOPhase = (tANI_U8)macHTInfoField3.pcoPhase;
Jeff Johnson295189b2012-06-20 16:38:30 -07002569 pMac->lim.gHTSecondaryBeacon = (tANI_U8)macHTInfoField3.secondaryBeacon;
2570 pMac->lim.gHTDualCTSProtection = (tANI_U8)macHTInfoField3.dualCTSProtection;
2571 pMac->lim.gHTSTBCBasicMCS = (tANI_U8)macHTInfoField3.basicSTBCMCS;
Jeff Johnsone7245742012-09-05 17:12:55 -07002572
2573 /* The lim globals for channelwidth and secondary chnl have been removed and should not be used during no session;
2574 * instead direct cfg is read and used when no session for transmission of mgmt frames (same as old);
2575 * For now, we might come here during init and join with sessionEntry = NULL; in that case just fill the globals which exist
2576 * Sessionized entries values will be filled in join or add bss req. The ones which are missed in join are filled below
2577 */
2578 if (psessionEntry != NULL)
2579 {
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302580 psessionEntry->htCapability =
2581 IS_DOT11_MODE_HT(psessionEntry->dot11mode);
2582 psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport =
2583 (tANI_U8)macHTInfoField3.lsigTXOPProtectionFullSupport;
Sandeep Puligilla70b6b162014-04-19 02:06:04 +05302584 limInitOBSSScanParams(pMac, psessionEntry);
Jeff Johnsone7245742012-09-05 17:12:55 -07002585 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002586}
2587
2588void limLogSessionStates(tpAniSirGlobal pMac)
2589{
2590#ifdef WLAN_DEBUG
2591 int i;
2592
2593 for(i = 0; i < pMac->lim.maxBssId; i++)
2594 {
2595 if(pMac->lim.gpSession[i].valid)
2596 {
Abhishek Singh3cbf6052014-12-15 16:46:42 +05302597 limLog(pMac, LOG1, FL("Session[%d] sysRole(%d) limSmeState %d "
2598 "(prev sme state %d) mlm state %d (prev mlm state %d)"),
2599 i, pMac->lim.gpSession[i].limSystemRole,
2600 pMac->lim.gpSession[i].limSmeState,
2601 pMac->lim.gpSession[i].limPrevSmeState,
2602 pMac->lim.gpSession[i].limMlmState,
2603 pMac->lim.gpSession[i].limPrevMlmState);
Jeff Johnson295189b2012-06-20 16:38:30 -07002604 }
2605 }
2606#endif //ifdef WLAN_DEBUG
2607}