blob: cdbdff48533368a17c913a7b53dfece360b13dfb [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lamaa8e15a2014-02-11 23:30:06 -08002 * Copyright (c) 2012-2013 Qualcomm Atheros, Inc.
3 * All Rights Reserved.
4 * Qualcomm Atheros Confidential and Proprietary.
5 */
Jeff Johnson295189b2012-06-20 16:38:30 -07006/*
7 * Airgo Networks, Inc proprietary. All rights reserved.
8 * This file lim ProcessMessageQueue.cc contains the code
9 * for processing LIM message Queue.
10 * Author: Chandra Modumudi
11 * Date: 02/11/02
12 * History:-
13 * Date Modified by Modification Information
14 * --------------------------------------------------------------------
15 *
16 */
17#include "palTypes.h"
18#include "wniApi.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070019#include "wlan_qct_wdi_ds.h"
20#include "wlan_qct_pal_packet.h"
21#include "wlan_qct_wda.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070022
Jeff Johnson295189b2012-06-20 16:38:30 -070023#include "wniCfgSta.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070024#include "cfgApi.h"
25#include "sirCommon.h"
26#include "utilsApi.h"
27#include "limTypes.h"
28#include "limUtils.h"
29#include "limAssocUtils.h"
30#include "limPropExtsUtils.h"
31
32#include "limAdmitControl.h"
33#include "pmmApi.h"
34#include "limIbssPeerMgmt.h"
35#include "schApi.h"
36#include "limSession.h"
Yathish9f22e662012-12-10 14:21:35 -080037#include "limSendMessages.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070038
39#if defined WLAN_FEATURE_VOWIFI
40#include "rrmApi.h"
41#endif
Srinivas Girigowda5cecb202013-10-08 09:13:25 -070042#if defined(FEATURE_WLAN_CCX) && !defined(FEATURE_WLAN_CCX_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -070043#include "ccxApi.h"
44#endif
45
46#if defined WLAN_FEATURE_VOWIFI_11R
47#include "limFT.h"
48#endif
49
50#ifdef WMM_APSD
51#include "wmmApsd.h"
52#endif
53
Jeff Johnson295189b2012-06-20 16:38:30 -070054#include "vos_types.h"
55#include "vos_packet.h"
56#include "vos_memory.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070057
Katya Nigam3802f202013-12-16 19:27:14 +053058/* This value corresponds to 500 ms */
59#define MAX_PROBEREQ_TIME 5000
60
Jeff Johnson295189b2012-06-20 16:38:30 -070061void limLogSessionStates(tpAniSirGlobal pMac);
62
63/** -------------------------------------------------------------
64\fn defMsgDecision
65\brief The function decides whether to defer a message or not in limProcessMessage function
66\param tpAniSirGlobal pMac
67\param tSirMsgQ limMsg
68\param tSirMacTspecIE *ppInfo
69\return none
70 -------------------------------------------------------------*/
71
72tANI_U8 static
73defMsgDecision(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
74{
75
76
77/* this function should not changed */
Jeff Johnsone7245742012-09-05 17:12:55 -070078 if(pMac->lim.gLimSmeState == eLIM_SME_OFFLINE_STATE)
Jeff Johnson295189b2012-06-20 16:38:30 -070079 {
80 // Defer processsing this message
81 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
82 {
Madan Mohan Koyyalamudi5695b502012-09-24 14:21:12 -070083 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 -070084 limMsg->type, limMsgStr(limMsg->type), pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
85 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
86 limLogSessionStates(pMac);
87 limHandleDeferMsgError(pMac, limMsg);
88 }
89 return true;
90 }
91
92 //When defer is requested then defer all the messages except HAL responses.
93 if((!limIsSystemInScanState(pMac)) && (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) &&
94 !pMac->lim.gLimSystemInScanLearnMode)
95 {
96 if((limMsg->type != WDA_ADD_BSS_RSP) &&
97 (limMsg->type != WDA_DELETE_BSS_RSP) &&
98 (limMsg->type != WDA_ADD_STA_RSP) &&
99 (limMsg->type != WDA_ADD_STA_SELF_RSP) &&
100 (limMsg->type != WDA_DEL_STA_SELF_RSP) &&
101 (limMsg->type != WDA_DELETE_STA_RSP)&&
102 (limMsg->type != WDA_SET_BSSKEY_RSP)&&
103 (limMsg->type != WDA_SET_STAKEY_RSP)&&
104 (limMsg->type != WDA_SET_STA_BCASTKEY_RSP) &&
Jeff Johnson295189b2012-06-20 16:38:30 -0700105 (limMsg->type != eWNI_SME_START_REQ) &&
106 (limMsg->type != WDA_AGGR_QOS_RSP) &&
107 (limMsg->type != WDA_REMOVE_BSSKEY_RSP) &&
108 (limMsg->type != WDA_REMOVE_STAKEY_RSP) &&
109 (limMsg->type != WDA_SET_MIMOPS_RSP)&&
110 (limMsg->type != WDA_ADDBA_RSP) &&
111 (limMsg->type != WDA_ENTER_BMPS_RSP) &&
112 (limMsg->type != WDA_EXIT_BMPS_RSP) &&
113 (limMsg->type != WDA_ENTER_IMPS_RSP) &&
114 (limMsg->type != WDA_EXIT_IMPS_RSP) &&
115 (limMsg->type != WDA_ENTER_UAPSD_RSP) &&
116 (limMsg->type != WDA_EXIT_UAPSD_RSP) &&
117 (limMsg->type != WDA_WOWL_ENTER_RSP) &&
118 (limMsg->type != WDA_WOWL_EXIT_RSP) &&
119 (limMsg->type != WDA_SWITCH_CHANNEL_RSP) &&
Jeff Johnson295189b2012-06-20 16:38:30 -0700120 (limMsg->type != WDA_P2P_NOA_ATTR_IND) &&
Viral Modid440e682013-03-06 02:25:31 -0800121 (limMsg->type != WDA_P2P_NOA_START_IND) &&
Jeff Johnsone7245742012-09-05 17:12:55 -0700122#ifdef FEATURE_OEM_DATA_SUPPORT
123 (limMsg->type != WDA_START_OEM_DATA_RSP) &&
124#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700125 (limMsg->type != WDA_ADD_TS_RSP))
126 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700127 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 -0700128 limMsgStr(limMsg->type));)
129
130 // Defer processsing this message
131 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
132 {
Madan Mohan Koyyalamudi5695b502012-09-24 14:21:12 -0700133 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 -0700134 limMsg->type, limMsgStr(limMsg->type), pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
135 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
136 limLogSessionStates(pMac);
137 limHandleDeferMsgError(pMac, limMsg);
138
139 }
140 return true;
141 }
142 }
143 return false;
144}
145
146/*
147* Beacon Handling Cases:
148* during scanning, when no session is active:
149* handled by limHandleFramesInScanState before __limHandleBeacon call is invoked.
150* during scanning, when any session is active, but beacon/Pr does not belong to that session, psessionEntry will be null.
151* handled by limHandleFramesInScanState before __limHandleBeacon call is invoked.
152* during scanning, when any session is active, and beacon/Pr belongs to one of the session, psessionEntry will not be null.
153* handled by limHandleFramesInScanState before __limHandleBeacon call is invoked.
154* Not scanning, no session:
155* there should not be any beacon coming, if coming, should be dropped.
156* Not Scanning,
157*/
158static void
159__limHandleBeacon(tpAniSirGlobal pMac, tpSirMsgQ pMsg, tpPESession psessionEntry)
160{
161 /* checking for global SME state...*/
162 tANI_U8 *pRxPacketInfo;
163 limGetBDfromRxPacket(pMac, pMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo);
164
165 //This function should not be called if beacon is received in scan state.
166 //So not doing any checks for the global state.
167
168 if(psessionEntry == NULL)
169 {
170 schBeaconProcess(pMac, pRxPacketInfo, NULL);
171 }
172 else if( (psessionEntry->limSmeState == eLIM_SME_LINK_EST_STATE) ||
173 (psessionEntry->limSmeState == eLIM_SME_NORMAL_STATE))
174 {
175 schBeaconProcess(pMac, pRxPacketInfo, psessionEntry);
176 }
177 else
178 limProcessBeaconFrame(pMac, pRxPacketInfo, psessionEntry);
179
180 return;
181}
182
183
184//Fucntion prototype
185void limProcessNormalHddMsg(tpAniSirGlobal pMac, tSirMsgQ *pLimMsg, tANI_U8 fRspReqd);
186
187/**
Jeff Johnson295189b2012-06-20 16:38:30 -0700188 * limDeferMsg()
189 *
190 *FUNCTION:
191 * This function is called to defer the messages received
192 * during Learn mode
193 *
194 *LOGIC:
195 * NA
196 *
197 *ASSUMPTIONS:
198 * NA
199 *
200 *NOTE:
201 * NA
202 *
203 * @param pMac - Pointer to Global MAC structure
204 * @param pMsg of type tSirMsgQ - Pointer to the message structure
205 * @return None
206 */
207
208tANI_U32
209limDeferMsg(tpAniSirGlobal pMac, tSirMsgQ *pMsg)
210{
211 tANI_U32 retCode = TX_SUCCESS;
Jeff Johnson77165482013-03-07 08:15:44 -0800212
213 retCode = limWriteDeferredMsgQ(pMac, pMsg);
214
Jeff Johnson295189b2012-06-20 16:38:30 -0700215 if (retCode == TX_SUCCESS)
Jeff Johnson77165482013-03-07 08:15:44 -0800216 {
Rashmi Ramanna6c13a342014-01-07 11:44:07 +0530217 limLog(pMac, LOG1,
218 FL("Deferred message(0x%X) limSmeState %d (prev sme state %d)"
219 " sysRole %d mlm state %d (prev mlm state %d)"),
220 pMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
221 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState,
222 pMac->lim.gLimPrevMlmState);
Jeff Johnson77165482013-03-07 08:15:44 -0800223 MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DEFERRED));)
224 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700225 else
Jeff Johnson77165482013-03-07 08:15:44 -0800226 {
Rashmi Ramanna6c13a342014-01-07 11:44:07 +0530227 limLog(pMac, LOGE, FL("Dropped lim message (0x%X)"), pMsg->type);
Jeff Johnson77165482013-03-07 08:15:44 -0800228 MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DROPPED));)
229 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700230
231 return retCode;
232} /*** end limDeferMsg() ***/
233
234
235
236/**
237 * limHandleFramesInScanState()
238 *
239 *FUNCTION:
240 * This function is called to process 802.11 frames
241 * received by LIM in scan state.
242 *
243 *LOGIC:
244 * NA
245 *
246 *ASSUMPTIONS:
247 * NA
248 *
249 *NOTE:
250 * NA
251 *
252 * @param pMac - Pointer to Global MAC structure
253 * @param limMsg - Received message
254 * @param pRxPacketInfo - Pointer to Rx packet info structure
255 * @param deferMsg - Indicates whether the frame shall be deferred
256 * @return None
257 */
258
259static void
260limHandleFramesInScanState(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pRxPacketInfo, tANI_U8 *deferMsg, tpPESession psessionEntry)
261{
262 tSirMacFrameCtl fc;
263 tpSirMacMgmtHdr pHdr;
Jeff Johnson295189b2012-06-20 16:38:30 -0700264
265 *deferMsg = false;
266 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
267 fc = pHdr->fc;
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700268 limLog( pMac, LOG2, FL("ProtVersion %d, Type %d, Subtype %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700269 fc.protVer, fc.type, fc.subType );
270
Jeff Johnson295189b2012-06-20 16:38:30 -0700271 // defer all message in scan state except for Beacons and Probe Response
272 if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_BEACON))
273 {
274 if (psessionEntry == NULL)
275 limProcessBeaconFrameNoSession(pMac, pRxPacketInfo);
276 else
277 limProcessBeaconFrame(pMac, pRxPacketInfo,psessionEntry);
278 }
279 else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_PROBE_RSP))
280 {
281 if (psessionEntry == NULL)
282 limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo);
283 else
284 limProcessProbeRspFrame(pMac, pRxPacketInfo,psessionEntry);
285 }
286 else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_PROBE_REQ))
287 {
288 limProcessProbeReqFrame_multiple_BSS(pMac, pRxPacketInfo, psessionEntry);
289 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700290 else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_ACTION))
291 {
292 limProcessActionFrameNoSession( pMac, pRxPacketInfo);
293 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700294 else
295 {
296 *deferMsg = true;
297 return;
298 }
299
Jeff Johnson295189b2012-06-20 16:38:30 -0700300 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr);
301 return;
302
303} /*** end limHandleFramesInScanState() ***/
304
305/** ------------------------------------------------------------
306\brief This function handles Unknown Unicast (A2 Index)
307\ packets.
308\param tpAniSirGlobal pMac Global Mac data structure
309\param void *pRxPacketInfo Pointer to Buffer Descriptor
310\return none
311\
312\ -------------------------------------------------------------- */
313static void limHandleUnknownA2IndexFrames(tpAniSirGlobal pMac, void *pRxPacketInfo,tpPESession psessionEntry)
314{
Jeff Johnson295189b2012-06-20 16:38:30 -0700315 /* addr2 mismatch interrupt occurred this means previous
316 disassociation was not successful
317 In Volans pRxPacketInfo only contains pointer 48-bit address2 field */
318 /*Send disassociation message again*/
319 //Dinesh need one more arguement.
320 //limSendDisassocMgmtFrame(pMac, eSIR_MAC_CLASS3_FRAME_FROM_NON_ASSOC_STA_REASON,(tANI_U8 *) pRxPacketInfo);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800321 //TODO: verify this
Jeff Johnson295189b2012-06-20 16:38:30 -0700322 //This could be a public action frame.
323 if( psessionEntry->limSystemRole == eLIM_P2P_DEVICE_ROLE )
324 limProcessActionFrameNoSession(pMac, (tANI_U8 *) pRxPacketInfo);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800325
326#ifdef FEATURE_WLAN_TDLS
327 {
328 tpSirMacDataHdr3a pMacHdr;
329 pMacHdr = WDA_GET_RX_MPDUHEADER3A(pRxPacketInfo);
330
331 if (limIsGroupAddr(pMacHdr->addr2))
332 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700333 PELOG2(limLog(pMac, LOG2, FL("Ignoring A2 Invalid Packet received for MC/BC:"));
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800334 limPrintMacAddr(pMac, pMacHdr->addr2, LOG2);)
335
336 return;
337 }
338 /* TDLS_hklee: move down here to reject Addr2 == Group (first checking above)
339 and also checking if SystemRole == STA */
340 if (psessionEntry->limSystemRole == eLIM_STA_ROLE)
341 {
342 /* ADD handling of Public Action Frame */
343 LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, \
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700344 ("limHandleUnknownA2IndexFrames: type=0x%x, subtype=0x%x"),pMacHdr->fc.type, pMacHdr->fc.subType));
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800345 switch (pMacHdr->fc.type)
346 {
347 case SIR_MAC_MGMT_FRAME:
348 {
349 switch (pMacHdr->fc.subType)
350 {
351 case SIR_MAC_MGMT_ACTION:
352 {
353 limProcessActionFrame(pMac, pRxPacketInfo, psessionEntry) ;
354 break ;
355 }
356 default:
357 {
358 break ;
359 }
360 }
361 }
362 default:
363 {
364 break ;
365 }
366 }
367 }
368 }
369#endif
370
Jeff Johnson295189b2012-06-20 16:38:30 -0700371
372 return;
373}
374
Jeff Johnson295189b2012-06-20 16:38:30 -0700375/**
376 * limCheckMgmtRegisteredFrames()
377 *
378 *FUNCTION:
379 * This function is called to process to check if received frame match with
380 * any of the registered frame from HDD. If yes pass this frame to SME.
381 *
382 *LOGIC:
383 *
384 *ASSUMPTIONS:
385 *
386 *NOTE:
387 *
388 * @param pMac Pointer to Global MAC structure
389 * @param *pBd Pointer to the received Buffer Descriptor+payload
390 * @param *psessionEntry Pointer to session on which packet is received
391 * @return None
392 */
393static tANI_BOOLEAN
394limCheckMgmtRegisteredFrames(tpAniSirGlobal pMac, tANI_U8 *pBd,
395 tpPESession psessionEntry)
396{
397 tSirMacFrameCtl fc;
398 tpSirMacMgmtHdr pHdr;
399 tANI_U8 *pBody;
400 tpLimMgmtFrameRegistration pLimMgmtRegistration = NULL, pNext = NULL;
401 tANI_U16 frameType;
402 tANI_U16 framelen;
403 tANI_U8 type,subType;
404 tANI_BOOLEAN match = VOS_FALSE;
405 VOS_STATUS vosStatus;
406
407 pHdr = WDA_GET_RX_MAC_HEADER(pBd);
408 fc = pHdr->fc;
409 frameType = (fc.type << 2 ) | (fc.subType << 4);
410 pBody = WDA_GET_RX_MPDU_DATA(pBd);
411 framelen = WDA_GET_RX_PAYLOAD_LEN(pBd);
412
413 vos_list_peek_front(&pMac->lim.gLimMgmtFrameRegistratinQueue,
414 (vos_list_node_t**)&pLimMgmtRegistration);
415
416 while(pLimMgmtRegistration != NULL)
417 {
418 type = (pLimMgmtRegistration->frameType >> 2) & 0x03;
419 subType = (pLimMgmtRegistration->frameType >> 4) & 0x0f;
420 if ( (type == SIR_MAC_MGMT_FRAME) && (fc.type == SIR_MAC_MGMT_FRAME)
421 && (subType == SIR_MAC_MGMT_RESERVED15) )
422 {
423 limLog( pMac, LOG3,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700424 FL("rcvd frame match with SIR_MAC_MGMT_RESERVED15"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700425 match = VOS_TRUE;
426 break;
427 }
428
429 if (pLimMgmtRegistration->frameType == frameType)
430 {
431 if (pLimMgmtRegistration->matchLen > 0)
432 {
433 if (pLimMgmtRegistration->matchLen <= framelen)
434 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +0530435 if (vos_mem_compare(pLimMgmtRegistration->matchData,
Jeff Johnson295189b2012-06-20 16:38:30 -0700436 pBody, pLimMgmtRegistration->matchLen))
437 {
Madan Mohan Koyyalamudic537df22012-10-22 15:07:08 -0700438 /* found match! */
439 match = VOS_TRUE;
440 break;
Jeff Johnson295189b2012-06-20 16:38:30 -0700441 }
Madan Mohan Koyyalamudic537df22012-10-22 15:07:08 -0700442 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700443 }
444 else
445 {
446 /* found match! */
447 match = VOS_TRUE;
448 break;
449 }
450 }
451
452 vosStatus =
453 vos_list_peek_next ( &pMac->lim.gLimMgmtFrameRegistratinQueue,
454 (vos_list_node_t*) pLimMgmtRegistration,
455 (vos_list_node_t**) &pNext );
456 pLimMgmtRegistration = pNext;
457 pNext = NULL;
458 }
459
460 if (match)
461 {
462 limLog( pMac, LOG1,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700463 FL("rcvd frame match with registered frame params"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700464
465 /* Indicate this to SME */
466 limSendSmeMgmtFrameInd( pMac, pHdr->fc.subType, (tANI_U8*)pHdr,
467 WDA_GET_RX_PAYLOAD_LEN(pBd) + sizeof(tSirMacMgmtHdr),
468 pLimMgmtRegistration->sessionId,
Chilam NG571c65a2013-01-19 12:27:36 +0530469 WDA_GET_RX_CH(pBd), psessionEntry, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -0700470
471 if ( (type == SIR_MAC_MGMT_FRAME) && (fc.type == SIR_MAC_MGMT_FRAME)
472 && (subType == SIR_MAC_MGMT_RESERVED15) )
473 {
474 // These packets needs to be processed by PE/SME as well as HDD.
475 // If it returns TRUE here, the packet is forwarded to HDD only.
476 match = VOS_FALSE;
477 }
478 }
479
480 return match;
481} /*** end limCheckMgmtRegisteredFrames() ***/
Jeff Johnson295189b2012-06-20 16:38:30 -0700482
483
484/**
485 * limHandle80211Frames()
486 *
487 *FUNCTION:
488 * This function is called to process 802.11 frames
489 * received by LIM.
490 *
491 *LOGIC:
492 * NA
493 *
494 *ASSUMPTIONS:
495 * NA
496 *
497 *NOTE:
498 * NA
499 *
500 * @param pMac - Pointer to Global MAC structure
501 * @param pMsg of type tSirMsgQ - Pointer to the message structure
502 * @return None
503 */
504
505static void
506limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg)
507{
508 tANI_U8 *pRxPacketInfo = NULL;
509 tSirMacFrameCtl fc;
510 tpSirMacMgmtHdr pHdr=NULL;
511 tpPESession psessionEntry=NULL;
512 tANI_U8 sessionId;
513 tAniBool isFrmFt = FALSE;
514 tANI_U16 fcOffset = WLANHAL_RX_BD_HEADER_SIZE;
515
516 *pDeferMsg= false;
517 limGetBDfromRxPacket(pMac, limMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo);
518
519 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
520 isFrmFt = WDA_GET_RX_FT_DONE(pRxPacketInfo);
521 fcOffset = (v_U8_t)WDA_GET_RX_MPDU_HEADER_OFFSET(pRxPacketInfo);
522 fc = pHdr->fc;
523
Madan Mohan Koyyalamudi99af06e2013-08-08 02:17:17 +0530524#ifdef WLAN_DUMP_MGMTFRAMES
525 limLog( pMac, LOGE, FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"),
526 fc.protVer, fc.type, fc.subType,
527 WDA_GET_RX_MAC_RATE_IDX(pRxPacketInfo));
528 VOS_TRACE_HEX_DUMP(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, pHdr,
529 WDA_GET_RX_MPDU_HEADER_LEN(pRxPacketInfo));
530#endif
531
Tushnim Bhattacharyyaed4d0c22014-01-30 11:56:44 -0800532 if (pMac->fEnableDebugLog & 0x1) {
533 if ((fc.type == SIR_MAC_MGMT_FRAME) &&
534 (fc.subType != SIR_MAC_MGMT_PROBE_REQ) &&
535 (fc.subType != SIR_MAC_MGMT_PROBE_RSP) &&
536 (fc.subType != SIR_MAC_MGMT_BEACON))
537 {
538 limLog(pMac, LOGE, FL("RX MGMT - Type %hu, SubType %hu"),
539 fc.type, fc.subType);
540 }
541 }
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700542#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
543 if ( WDA_GET_ROAMCANDIDATEIND(pRxPacketInfo))
544 {
545 limLog( pMac, LOG2, FL("Notify SME with candidate ind"));
546 //send a session 0 for now - TBD
547 limSendSmeCandidateFoundInd(pMac, 0);
548 goto end;
549 }
550 if (WDA_GET_OFFLOADSCANLEARN(pRxPacketInfo))
551 {
552 if (fc.subType == SIR_MAC_MGMT_BEACON)
553 {
554 limLog( pMac, LOG2, FL("Save this beacon in LFR cache"));
555 __limHandleBeacon(pMac, limMsg, NULL);
556 }
557 else if (fc.subType == SIR_MAC_MGMT_PROBE_RSP)
558 {
559 limLog( pMac, LOG2, FL("Save this probe rsp in LFR cache"));
560 limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo);
561 }
562 else
563 {
564 limLog( pMac, LOGE, FL("Wrong frame Type %d, Subtype %d for LFR"),
565 fc.type, fc.subType);
566 }
567 goto end;
568 }
569#endif //WLAN_FEATURE_ROAM_SCAN_OFFLOAD
Jeff Johnson295189b2012-06-20 16:38:30 -0700570#ifdef FEATURE_WLAN_CCX
571 if (fc.type == SIR_MAC_DATA_FRAME && isFrmFt)
572 {
573#if 0 // CCX TBD Need to PORT
574 tpSirMacDot3Hdr pDataFrmHdr;
575
576 pDataFrmHdr = (tpSirMacDot3Hdr)((tANI_U8 *)pBD+ WLANHAL_RX_BD_GET_MPDU_H_OFFSET(pBD));
577 if((psessionEntry = peFindSessionByBssid(pMac,pDataFrmHdr->sa,&sessionId))== NULL)
578 {
579 limLog( pMac, LOGE, FL("Session not found for Frm type %d, subtype %d, SA: "), fc.type, fc.subType);
580 limPrintMacAddr(pMac, pDataFrmHdr->sa, LOGE);
581 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pBD, limMsg->bodyptr);
582 return;
583 }
584
585 if (!psessionEntry->isCCXconnection)
586 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700587 limLog( pMac, LOGE, FL("LIM received Type %d, Subtype %d in Non CCX connection"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700588 fc.type, fc.subType);
589 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pBD, limMsg->bodyptr);
590 return;
591 }
592 limLog( pMac, LOGE, FL("Processing IAPP Frm from SA:"));
593 limPrintMacAddr(pMac, pDataFrmHdr->sa, LOGE);
594#else
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700595 printk("%s: Need to port handling of IAPP frames to PRIMA for CCX", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700596#endif
597
598
599 } else
600#endif
601 /* Added For BT-AMP Support */
602 if((psessionEntry = peFindSessionByBssid(pMac,pHdr->bssId,&sessionId))== NULL)
603 {
604#ifdef WLAN_FEATURE_VOWIFI_11R
605 if (fc.subType == SIR_MAC_MGMT_AUTH)
606 {
607#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
Varun Reddy Yeturuf68abd62013-02-11 14:05:06 -0800608 limLog( pMac, LOG1, FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700609 fc.protVer, fc.type, fc.subType, WDA_GET_RX_MAC_RATE_IDX(pRxPacketInfo));
Varun Reddy Yeturuf68abd62013-02-11 14:05:06 -0800610 limPrintMacAddr(pMac, pHdr->bssId, LOG1);
Jeff Johnson295189b2012-06-20 16:38:30 -0700611#endif
612 if (limProcessAuthFrameNoSession(pMac, pRxPacketInfo, limMsg->bodyptr) == eSIR_SUCCESS)
613 {
614 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr);
615 return;
616 }
617 }
618#endif
619 if((fc.subType != SIR_MAC_MGMT_PROBE_RSP )&&
620 (fc.subType != SIR_MAC_MGMT_BEACON)&&
621 (fc.subType != SIR_MAC_MGMT_PROBE_REQ)
Jeff Johnson295189b2012-06-20 16:38:30 -0700622 && (fc.subType != SIR_MAC_MGMT_ACTION ) //Public action frame can be received from non-associated stations.
Jeff Johnson295189b2012-06-20 16:38:30 -0700623 )
624 {
625
626 if((psessionEntry = peFindSessionByPeerSta(pMac,pHdr->sa,&sessionId))== NULL)
627 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700628 limLog(pMac, LOG1, FL("session does not exist for given bssId"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700629 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr);
630 return;
631 }
Gopichand Nakkala6265d6f2013-03-20 23:32:50 +0530632 }
633 // For p2p resp frames search for valid session with DA as
634 // BSSID will be SA and session will be present with DA only
635 if(fc.subType == SIR_MAC_MGMT_ACTION )
636 {
637 psessionEntry = peFindSessionByBssid(pMac,pHdr->da,&sessionId);
638 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700639 }
640
641
Jeff Johnson295189b2012-06-20 16:38:30 -0700642 /* Check if frame is registered by HDD */
643 if(limCheckMgmtRegisteredFrames(pMac, pRxPacketInfo, psessionEntry))
644 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700645 limLog( pMac, LOG1, FL("Received frame is passed to SME"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700646 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr);
647 return;
648 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700649
650
Jeff Johnson295189b2012-06-20 16:38:30 -0700651
652 if (fc.protVer != SIR_MAC_PROTOCOL_VERSION)
653 { // Received Frame with non-zero Protocol Version
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700654 limLog(pMac, LOGE, FL("Unexpected frame with protVersion %d received"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700655 fc.protVer);
656 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr);
657#ifdef WLAN_DEBUG
658 pMac->lim.numProtErr++;
659#endif
660 return;
661 }
662
Gopichand Nakkala2c231c82013-06-11 17:49:16 +0530663 if (!pMac->fScanOffload)
Jeff Johnson295189b2012-06-20 16:38:30 -0700664 {
Gopichand Nakkala2c231c82013-06-11 17:49:16 +0530665 if (limIsSystemInScanState(pMac))
666 {
667 limHandleFramesInScanState(pMac, limMsg, pRxPacketInfo, pDeferMsg, psessionEntry);
668 return;
669 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700670 }
671
672/* Chance of crashing : to be done BT-AMP ........happens when broadcast probe req is received */
673
674#if 0
675 if (psessionEntry->limSystemRole == eLIM_UNKNOWN_ROLE) {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700676 limLog( pMac, LOGW, FL( "gLimSystemRole is %d. Exiting..." ),psessionEntry->limSystemRole );
Jeff Johnson295189b2012-06-20 16:38:30 -0700677 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr);
678
679#ifdef WLAN_DEBUG
680 pMac->lim.numProtErr++;
681#endif
682 return;
683 }
684 #endif //HACK to continue scanning
685
686
687#ifdef WLAN_DEBUG
688 pMac->lim.numMAC[fc.type][fc.subType]++;
689#endif
690
691 switch (fc.type)
692 {
693 case SIR_MAC_MGMT_FRAME:
694 {
695 #if 0 //TBD-RAJESH fix this
696 if (limIsReassocInProgress( pMac,psessionEntry) && (fc.subType != SIR_MAC_MGMT_DISASSOC) &&
697 (fc.subType != SIR_MAC_MGMT_DEAUTH) && (fc.subType != SIR_MAC_MGMT_REASSOC_RSP))
698 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700699 limLog(pMac, LOGE, FL("Frame with Type - %d, Subtype - %d received in ReAssoc Wait state, dropping..."),
Jeff Johnson295189b2012-06-20 16:38:30 -0700700 fc.type, fc.subType);
701 return;
702 }
703 #endif //HACK to continue scanning
704 // Received Management frame
705 switch (fc.subType)
706 {
707 case SIR_MAC_MGMT_ASSOC_REQ:
708 // Make sure the role supports Association
709 if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700710 || (psessionEntry->limSystemRole == eLIM_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700711 )
712 limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_ASSOC, psessionEntry);
713
714 else
715 {
716 // Unwanted messages - Log error
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700717 limLog(pMac, LOGE, FL("unexpected message received %X"),limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -0700718 limPrintMsgName(pMac, LOGE, limMsg->type);
719 }
720 break;
721
722 case SIR_MAC_MGMT_ASSOC_RSP:
723 limProcessAssocRspFrame(pMac, pRxPacketInfo, LIM_ASSOC,psessionEntry);
724 break;
725
726 case SIR_MAC_MGMT_REASSOC_REQ:
727 // Make sure the role supports Reassociation
728 if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700729 || (psessionEntry->limSystemRole == eLIM_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700730 ){
731 limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_REASSOC, psessionEntry);
732 }
733 else
734 {
735 // Unwanted messages - Log error
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700736 limLog(pMac, LOGE, FL("unexpected message received %X"),limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -0700737 limPrintMsgName(pMac, LOGE, limMsg->type);
738 }
739 break;
740
741 case SIR_MAC_MGMT_REASSOC_RSP:
742 limProcessAssocRspFrame(pMac, pRxPacketInfo, LIM_REASSOC,psessionEntry);
743 break;
744
745 case SIR_MAC_MGMT_PROBE_REQ:
746 limProcessProbeReqFrame_multiple_BSS(pMac, pRxPacketInfo,psessionEntry);
747 break;
748
749 case SIR_MAC_MGMT_PROBE_RSP:
750 if(psessionEntry == NULL)
751 limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo);
752 else
753 limProcessProbeRspFrame(pMac, pRxPacketInfo, psessionEntry);
754 break;
755
756 case SIR_MAC_MGMT_BEACON:
757 __limHandleBeacon(pMac, limMsg,psessionEntry);
758 break;
759
760 case SIR_MAC_MGMT_DISASSOC:
761 limProcessDisassocFrame(pMac, pRxPacketInfo,psessionEntry);
762 break;
763
764 case SIR_MAC_MGMT_AUTH:
765 limProcessAuthFrame(pMac, pRxPacketInfo,psessionEntry);
766 break;
767
768 case SIR_MAC_MGMT_DEAUTH:
769 limProcessDeauthFrame(pMac, pRxPacketInfo,psessionEntry);
770 break;
771
772 case SIR_MAC_MGMT_ACTION:
Jeff Johnson295189b2012-06-20 16:38:30 -0700773 if(psessionEntry == NULL)
774 limProcessActionFrameNoSession(pMac, pRxPacketInfo);
775 else
776 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700777 if (WDA_GET_RX_UNKNOWN_UCAST(pRxPacketInfo))
778 limHandleUnknownA2IndexFrames(pMac, pRxPacketInfo,psessionEntry);
779 else
780 limProcessActionFrame(pMac, pRxPacketInfo,psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -0700781 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700782 break;
783 default:
784 // Received Management frame of 'reserved' subtype
785 break;
786 } // switch (fc.subType)
787
788 }
789 break;
Jeff Johnson295189b2012-06-20 16:38:30 -0700790 case SIR_MAC_DATA_FRAME:
791 {
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800792#ifdef FEATURE_WLAN_TDLS_INTERNAL
793 /*
794 * if we reach here, following cases are possible.
795 * Possible cases: a) if frame translation is disabled.
796 * b) Some frame with ADRR2 filter enabled may come
797 * here.
798 */
799 tANI_U8 *dataOffset = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
800 tANI_U8 *rfc1042Hdr = (tANI_U8 *)(dataOffset + RFC1042_HDR_LENGTH) ;
801 tANI_U16 ethType = GET_BE16(rfc1042Hdr) ;
802 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700803 ("TDLS frame with 80211 Header")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800804 if(ETH_TYPE_89_0d == ethType)
805 {
806 tANI_U8 payloadType = (rfc1042Hdr + ETH_TYPE_LEN)[0] ;
807 if(PAYLOAD_TYPE_TDLS == payloadType)
808 {
809 limProcessTdlsFrame(pMac, (tANI_U32*)pRxPacketInfo) ;
810 }
811 }
812#endif
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700813#if defined(FEATURE_WLAN_CCX) && !defined(FEATURE_WLAN_CCX_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -0700814 /* We accept data frame (IAPP frame) only if Session is
815 * present and ccx connection is established on that
816 * session
817 */
818 if (psessionEntry && psessionEntry->isCCXconnection) {
819 limProcessIappFrame(pMac, pRxPacketInfo, psessionEntry);
820 }
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800821#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700822 }
823 break;
Jeff Johnson295189b2012-06-20 16:38:30 -0700824 default:
825 // Received frame of type 'reserved'
826 break;
827
828 } // switch (fc.type)
829
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700830#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
831end:
832#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700833 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr) ;
834 return;
835} /*** end limHandle80211Frames() ***/
836
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530837/**
838 * limSendStopScanOffloadReq()
839 *
840 *FUNCTION:
841 * This function will be called to abort the ongoing offloaded scan
842 * request.
843 *
844 *
845 *NOTE:
846 *
847 * @param pMac Pointer to Global MAC structure
848 * @return eHAL_STATUS_SUCCESS or eHAL_STATUS_FAILURE
849 */
850eHalStatus limSendStopScanOffloadReq(tpAniSirGlobal pMac, tANI_U8 SessionId)
851{
852 tSirMsgQ msg;
853 tSirRetStatus rc = eSIR_SUCCESS;
854 tAbortScanParams *pAbortScanParams;
855
Kiet Lamb1233192013-11-28 13:38:20 +0530856 pAbortScanParams = vos_mem_malloc(sizeof(tAbortScanParams));
857 if (NULL == pAbortScanParams)
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530858 {
859 limLog(pMac, LOGP, FL("Memory allocation failed for AbortScanParams"));
860 return eHAL_STATUS_FAILURE;
861 }
862
863 pAbortScanParams->SessionId = SessionId;
864 msg.type = WDA_STOP_SCAN_OFFLOAD_REQ;
865 msg.bodyptr = pAbortScanParams;
866 msg.bodyval = 0;
867
868 rc = wdaPostCtrlMsg(pMac, &msg);
869 if (rc != eSIR_SUCCESS)
870 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -0800871 limLog(pMac, LOGE, FL("wdaPostCtrlMsg() return failure"));
Kiet Lamb1233192013-11-28 13:38:20 +0530872 vos_mem_free(pAbortScanParams);
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530873 return eHAL_STATUS_FAILURE;
874 }
875
Rashmi Ramanna6c13a342014-01-07 11:44:07 +0530876 limLog(pMac, LOG1, FL("Abort ongoing offload scan."));
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530877 return eHAL_STATUS_SUCCESS;
878
879}
Jeff Johnson295189b2012-06-20 16:38:30 -0700880
881/**
882 * limProcessAbortScanInd()
883 *
884 *FUNCTION:
885 * This function is called from HDD to abort the scan which is presently being run
886 *
887 *
888 *NOTE:
889 *
890 * @param pMac Pointer to Global MAC structure
891 * @param *pMsgBuf A pointer to the SME message buffer
892 * @return None
893 */
894void
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530895limProcessAbortScanInd(tpAniSirGlobal pMac, tANI_U8 SessionId)
Jeff Johnson295189b2012-06-20 16:38:30 -0700896{
897#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
898 limDiagEventReport(pMac, WLAN_PE_DIAG_SCAN_ABORT_IND_EVENT, NULL, 0, 0);
899#endif //FEATURE_WLAN_DIAG_SUPPORT
900
901 /* Deactivate the gLimBackgroundScanTimer as part of the abort scan.
902 * SME should send WNI_CFG_BACKGROUND_SCAN_PERIOD indication
903 * to start the background scan again
904 */
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -0700905 PELOG2(limLog(pMac, LOG2, FL("Processing AbortScan Ind"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700906
907 limAbortBackgroundScan(pMac);
908
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530909 if (pMac->fScanOffload)
Jeff Johnson295189b2012-06-20 16:38:30 -0700910 {
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530911 /* send stop scan cmd to fw if scan offload is enabled. */
912 limSendStopScanOffloadReq(pMac, SessionId);
913 }
914 else
915 {
916 /* Abort the scan if its running, else just return */
917 if(limIsSystemInScanState(pMac))
Jeff Johnson295189b2012-06-20 16:38:30 -0700918 {
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530919 if( (eLIM_HAL_INIT_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
920 (eLIM_HAL_START_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
921 (eLIM_HAL_END_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
922 (eLIM_HAL_FINISH_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState) )
923 {
924 //Simply signal we need to abort
925 limLog( pMac, LOGW, FL(" waiting for HAL, simply signal abort gLimHalScanState = %d"), pMac->lim.gLimHalScanState );
926 pMac->lim.abortScan = 1;
927 }
928 else
929 {
930 //Force abort
931 limLog( pMac, LOGW, FL(" Force aborting scan") );
932 pMac->lim.abortScan = 0;
933 limDeactivateAndChangeTimer(pMac, eLIM_MIN_CHANNEL_TIMER);
934 limDeactivateAndChangeTimer(pMac, eLIM_MAX_CHANNEL_TIMER);
935 //Set the resume channel to Any valid channel (invalid).
936 //This will instruct HAL to set it to any previous valid channel.
937 peSetResumeChannel(pMac, 0, 0);
938 limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE);
939 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700940 }
941 }
942 return;
943}
944
945/**
946 * limMessageProcessor
947 *
948 *FUNCTION:
949 * Wrapper function for limProcessMessages when handling messages received by LIM.
950 * Could either defer messages or process them.
951 * @param pMac Pointer to Global MAC structure
952 * @param limMsg Received LIM message
953 * @return None
954 */
955
956void limMessageProcessor(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
957{
958 if (eLIM_MLM_OFFLINE_STATE == pMac->lim.gLimMlmState)
959 {
960 peFreeMsg(pMac, limMsg);
961 return;
962 }
963
964 if (!defMsgDecision(pMac, limMsg))
965 {
966 limProcessMessages(pMac, limMsg);
Jeff Johnson295189b2012-06-20 16:38:30 -0700967 // process deferred message queue if allowed
968 {
969 if ( (! (pMac->lim.gLimAddtsSent))
970 &&
971 (! (limIsSystemInScanState(pMac)))
972 )
973 {
974 if (true == GET_LIM_PROCESS_DEFD_MESGS(pMac))
975 limProcessDeferredMessageQueue(pMac);
976 }
977 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700978 }
979}
980
Jeff Johnsone7245742012-09-05 17:12:55 -0700981#ifdef FEATURE_OEM_DATA_SUPPORT
982
983void limOemDataRspHandleResumeLinkRsp(tpAniSirGlobal pMac, eHalStatus status, tANI_U32* mlmOemDataRsp)
984{
985 if(status != eHAL_STATUS_SUCCESS)
986 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700987 limLog(pMac, LOGE, FL("OEM Data Rsp failed to get the response for resume link"));
Jeff Johnsone7245742012-09-05 17:12:55 -0700988 }
989
990 if(NULL != pMac->lim.gpLimMlmOemDataReq)
991 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +0530992 vos_mem_free(pMac->lim.gpLimMlmOemDataReq);
Jeff Johnsone7245742012-09-05 17:12:55 -0700993 pMac->lim.gpLimMlmOemDataReq = NULL;
994 }
995
996 //"Failure" status doesn't mean that Oem Data Rsp did not happen
997 //and hence we need to respond to upper layers. Only Resume link is failed, but
998 //we got the oem data response already.
999 //Post the meessage to MLM
1000 limPostSmeMessage(pMac, LIM_MLM_OEM_DATA_CNF, (tANI_U32*)(mlmOemDataRsp));
1001
1002 return;
1003}
1004
1005void limProcessOemDataRsp(tpAniSirGlobal pMac, tANI_U32* body)
1006{
Jeff Johnsone7245742012-09-05 17:12:55 -07001007 tpLimMlmOemDataRsp mlmOemDataRsp = NULL;
1008 tpStartOemDataRsp oemDataRsp = NULL;
1009
1010 //Process all the messages for the lim queue
1011 SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
1012
1013 oemDataRsp = (tpStartOemDataRsp)(body);
1014
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301015 mlmOemDataRsp = vos_mem_malloc(sizeof(tLimMlmOemDataRsp));
1016 if ( NULL == mlmOemDataRsp )
Jeff Johnsone7245742012-09-05 17:12:55 -07001017 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001018 limLog(pMac, LOGP, FL("could not allocate memory for mlmOemDataRsp"));
Jeff Johnsone7245742012-09-05 17:12:55 -07001019 return;
1020 }
1021
1022 //copy the memory into tLimMlmOemDataRsp and free the tStartOemDataRsp
1023 //the structures tStartOemDataRsp and tLimMlmOemDataRsp have the same structure
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301024 vos_mem_copy((void*)(mlmOemDataRsp), (void*)(oemDataRsp),
1025 sizeof(tLimMlmOemDataRsp));
Jeff Johnsone7245742012-09-05 17:12:55 -07001026
1027 //Now free the incoming memory
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301028 vos_mem_free(oemDataRsp);
Jeff Johnsone7245742012-09-05 17:12:55 -07001029
1030 limResumeLink(pMac, limOemDataRspHandleResumeLinkRsp, (tANI_U32*)mlmOemDataRsp);
1031
1032 return;
1033}
1034
1035#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001036
Katya Nigam3802f202013-12-16 19:27:14 +05301037static tANI_BOOLEAN limAgeOutProbeReq( tpAniSirGlobal pMac, tpSirMsgQ limMsg,
1038 vos_pkt_t *pVosPkt )
1039{
1040 tANI_U8 *pRxPacketInfo = NULL;
1041 tSirMacFrameCtl fc;
1042 tpSirMacMgmtHdr pHdr=NULL;
1043 tANI_BOOLEAN match = VOS_FALSE;
1044
1045 limGetBDfromRxPacket(pMac, limMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo);
1046 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1047 fc = pHdr->fc;
1048 if ( fc.subType == SIR_MAC_MGMT_PROBE_REQ )
1049 {
1050 if( vos_timer_get_system_ticks() - pVosPkt->timestamp >= MAX_PROBEREQ_TIME )
1051 {
1052 // drop packet
1053 limLog(pMac, LOGE,
1054 FL("Dropping Aged Out probe requests. Peer MAC is "MAC_ADDRESS_STR),
1055 MAC_ADDR_ARRAY(pHdr->sa));
1056
1057 vos_pkt_return_packet(pVosPkt);
1058 match = VOS_TRUE;
1059 }
1060 }
1061 return match;
1062}
1063
Jeff Johnson295189b2012-06-20 16:38:30 -07001064
1065/**
1066 * limProcessMessages
1067 *
1068 *FUNCTION:
1069 * This function is called by limProcessMessageQueue function. This
1070 * function processes messages received by LIM.
1071 *
1072 *LOGIC:
1073 * Depending on the message type, corresponding function will be
1074 * called, for example limProcessSmeMessages() will be called to
1075 * process SME messages received from HDD/Upper layer software module.
1076 *
1077 *ASSUMPTIONS:
1078 * NA
1079 *
1080 *NOTE:
1081 * NA
1082 *
1083 * @param pMac Pointer to Global MAC structure
1084 * @param limMsg Received LIM message
1085 * @return None
1086 */
1087
1088void
1089limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
1090{
1091 tANI_U8 deferMsg = false;
1092 tLinkStateParams *linkStateParams;
1093#if defined WLAN_FEATURE_VOWIFI_11R
1094 tpPESession pSession;
1095#endif
1096#if defined(ANI_DVT_DEBUG)
1097 tSirMsgQ msgQ;
1098#endif
1099 if(pMac->gDriverType == eDRIVER_TYPE_MFG)
1100 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301101 vos_mem_free(limMsg->bodyptr);
Jeff Johnsone7245742012-09-05 17:12:55 -07001102 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001103 return;
1104 }
1105#ifdef WLAN_DEBUG
1106 pMac->lim.numTot++;
1107#endif
1108
1109
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001110 PELOG3(limLog(pMac, LOG3, FL("rcvd msgType = %s, sme state = %s, mlm state = %s"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001111 limMsgStr(limMsg->type), limSmeStateStr(pMac->lim.gLimSmeState),
1112 limMlmStateStr(pMac->lim.gLimMlmState));)
1113
Jeff Johnsone7245742012-09-05 17:12:55 -07001114 MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(limMsg->type, LIM_MSG_PROCESSED));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001115
1116 switch (limMsg->type)
1117 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001118
1119 case SIR_LIM_UPDATE_BEACON:
1120 limUpdateBeacon(pMac);
1121 break;
1122
Jeff Johnson295189b2012-06-20 16:38:30 -07001123 case SIR_CFG_PARAM_UPDATE_IND:
1124 /// CFG parameter updated
1125 if (limIsSystemInScanState(pMac))
1126 {
1127 // System is in DFS (Learn) mode
1128 // Defer processsing this message
1129 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1130 {
Leela Venkata Kiran Kumar Reddy Chirala2247e962013-03-22 19:21:10 -07001131 if(!(pMac->lim.deferredMsgCnt & 0xF))
1132 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001133 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 -07001134 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1135 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
Leela Venkata Kiran Kumar Reddy Chirala2247e962013-03-22 19:21:10 -07001136 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001137 limLogSessionStates(pMac);
1138 limPrintMsgName(pMac, LOGE, limMsg->type);
1139 }
1140 }
1141 else
1142 {
1143 limHandleCFGparamUpdate(pMac, limMsg->bodyval);
1144 }
1145
1146 break;
1147
1148 case WDA_INIT_SCAN_RSP:
1149 limProcessInitScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001150 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001151 break;
1152
1153 case WDA_START_SCAN_RSP:
1154 limProcessStartScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001155 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001156 break;
1157
1158 case WDA_END_SCAN_RSP:
1159 limProcessEndScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001160 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001161 break;
1162
1163 case WDA_FINISH_SCAN_RSP:
1164 limProcessFinishScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001165 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001166 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001167#ifdef FEATURE_OEM_DATA_SUPPORT
1168 case WDA_START_OEM_DATA_RSP:
1169 limProcessOemDataRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001170 limMsg->bodyptr = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07001171 break;
1172#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001173
1174 case WDA_SWITCH_CHANNEL_RSP:
1175 limProcessSwitchChannelRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001176 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001177 break;
1178
1179#ifdef ANI_SIR_IBSS_PEER_CACHING
1180 case WDA_IBSS_STA_ADD:
1181 limIbssStaAdd(pMac, limMsg->bodyptr);
1182 break;
1183#endif
1184 case SIR_BB_XPORT_MGMT_MSG:
1185 // These messages are from Peer MAC entity.
1186#ifdef WLAN_DEBUG
1187 pMac->lim.numBbt++;
1188#endif
1189
Jeff Johnson295189b2012-06-20 16:38:30 -07001190 {
1191 v_U16_t pktLen = 0;
1192 vos_pkt_t *pVosPkt;
1193 VOS_STATUS vosStatus;
1194 tSirMsgQ limMsgNew;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001195#ifdef FEATURE_WLAN_TDLS_INTERNAL
1196 tANI_U32 *pBD = NULL ;
1197#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001198
1199 /* The original limMsg which we were deferring have the
1200 * bodyPointer point to 'BD' instead of 'Vos pkt'. If we don't make a copy
1201 * of limMsg, then vos_pkt_peek_data will overwrite the limMsg->bodyPointer.
1202 * and next time when we try to process the msg, we will try to use 'BD' as
1203 * 'Vos Pkt' which will cause a crash
1204 */
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301205 vos_mem_copy((tANI_U8*)&limMsgNew, (tANI_U8*)limMsg,
1206 sizeof(tSirMsgQ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001207 pVosPkt = (vos_pkt_t *)limMsgNew.bodyptr;
1208 vos_pkt_get_packet_length(pVosPkt, &pktLen);
1209
1210 vosStatus = WDA_DS_PeekRxPacketInfo( pVosPkt, (v_PVOID_t *)&limMsgNew.bodyptr, VOS_FALSE );
1211
1212 if( !VOS_IS_STATUS_SUCCESS(vosStatus) )
1213 {
1214 vos_pkt_return_packet(pVosPkt);
1215 break;
1216
1217 }
Katya Nigam3802f202013-12-16 19:27:14 +05301218
1219 /*
1220 * putting a check for age out probe request frames
1221 * such that any probe req more than 0.5 sec old can directly
1222 * be dropped. With this, there won't be blocking of MC thread.
1223 */
1224
1225 if( limAgeOutProbeReq ( pMac, &limMsgNew, pVosPkt ))
1226 {
1227 break;
1228 }
1229
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001230#ifdef FEATURE_WLAN_TDLS_INTERNAL
1231 /*
1232 * TDLS frames comes as translated frames as well as
1233 * MAC 802.11 data frames..
1234 */
1235 limGetBDfromRxPacket(pMac, limMsgNew.bodyptr, &pBD);
1236 if(0 != WDA_GET_RX_FT_DONE(pBD))
1237 {
1238 /*
1239 * TODO: check for scanning state and set deferMesg flag
1240 * accordingly..
1241 */
1242 deferMsg = false ;
1243
1244 limProcessTdlsFrame(pMac, pBD) ;
1245 }
1246 else
1247#endif
Katya Nigam3802f202013-12-16 19:27:14 +05301248
Jeff Johnson295189b2012-06-20 16:38:30 -07001249 limHandle80211Frames(pMac, &limMsgNew, &deferMsg);
1250
1251 if ( deferMsg == true )
1252 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001253 PELOG1(limLog(pMac, LOG1, FL("Defer message type=%X "), limMsg->type);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001254 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1255 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001256 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 -07001257 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1258 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
1259 limLogSessionStates(pMac);
1260 limPrintMsgName(pMac, LOGE, limMsg->type);
1261 vos_pkt_return_packet(pVosPkt);
1262 }
1263 }
1264 else
1265 {
1266 /* PE is not deferring this 802.11 frame so we need to call vos_pkt_return.
1267 * Asumption here is when Rx mgmt frame processing is done,
1268 * voss packet could be freed here.
1269 */
1270 vos_pkt_return_packet(pVosPkt);
1271 }
1272 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001273 break;
1274
1275 case eWNI_SME_SCAN_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001276 case eWNI_SME_REMAIN_ON_CHANNEL_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001277 case eWNI_SME_DISASSOC_REQ:
1278 case eWNI_SME_DEAUTH_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001279 case eWNI_SME_GET_SCANNED_CHANNEL_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -07001280#ifdef FEATURE_OEM_DATA_SUPPORT
1281 case eWNI_SME_OEM_DATA_REQ:
1282#endif
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001283#ifdef FEATURE_WLAN_TDLS
1284 case eWNI_SME_TDLS_SEND_MGMT_REQ:
1285 case eWNI_SME_TDLS_ADD_STA_REQ:
1286 case eWNI_SME_TDLS_DEL_STA_REQ:
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301287 case eWNI_SME_TDLS_LINK_ESTABLISH_REQ:
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001288#endif
1289#ifdef FEATURE_WLAN_TDLS_INTERNAL
1290 case eWNI_SME_TDLS_DISCOVERY_START_REQ:
1291 case eWNI_SME_TDLS_LINK_START_REQ:
1292 case eWNI_SME_TDLS_TEARDOWN_REQ:
1293#endif
Gopichand Nakkalacca24d12013-03-07 17:05:07 +05301294 case eWNI_SME_RESET_AP_CAPS_CHANGED:
Jeff Johnson295189b2012-06-20 16:38:30 -07001295 // These messages are from HDD
1296 limProcessNormalHddMsg(pMac, limMsg, true); //need to response to hdd
1297 break;
1298
1299 case eWNI_SME_SCAN_ABORT_IND:
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301300 {
1301 tANI_U8 *pSessionId = (tANI_U8 *)limMsg->bodyptr;
1302 limProcessAbortScanInd(pMac, *pSessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -07001303 vos_mem_free((v_VOID_t *)limMsg->bodyptr);
1304 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001305 break;
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301306 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001307 case eWNI_SME_START_REQ:
1308 case eWNI_SME_SYS_READY_IND:
1309#ifndef WNI_ASKEY_NON_SUPPORT_FEATURE
1310 case eWNI_SME_JOIN_REQ:
1311#endif
1312 case eWNI_SME_AUTH_REQ:
1313 case eWNI_SME_REASSOC_REQ:
1314 case eWNI_SME_START_BSS_REQ:
1315 case eWNI_SME_STOP_BSS_REQ:
1316 case eWNI_SME_SWITCH_CHL_REQ:
1317 case eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ:
1318 case eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ:
1319 case eWNI_SME_SETCONTEXT_REQ:
1320 case eWNI_SME_REMOVEKEY_REQ:
1321#ifndef WNI_ASKEY_NON_SUPPORT_FEATURE
1322 case eWNI_SME_PROMISCUOUS_MODE_REQ:
1323#endif
1324 case eWNI_SME_DISASSOC_CNF:
1325 case eWNI_SME_DEAUTH_CNF:
1326 case eWNI_SME_ASSOC_CNF:
1327 case eWNI_SME_REASSOC_CNF:
1328 case eWNI_SME_ADDTS_REQ:
1329 case eWNI_SME_DELTS_REQ:
1330 case eWNI_SME_DEL_BA_PEER_IND:
1331 case eWNI_SME_SET_TX_POWER_REQ:
1332 case eWNI_SME_GET_TX_POWER_REQ:
1333 case eWNI_SME_GET_NOISE_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001334 case eWNI_SME_GET_ASSOC_STAS_REQ:
1335 case eWNI_SME_TKIP_CNTR_MEAS_REQ:
1336 case eWNI_SME_UPDATE_APWPSIE_REQ:
1337 case eWNI_SME_HIDE_SSID_REQ:
1338 case eWNI_SME_GET_WPSPBC_SESSION_REQ:
1339 case eWNI_SME_SET_APWPARSNIEs_REQ:
Madan Mohan Koyyalamudi167b95e2012-11-27 15:53:38 -08001340 case eWNI_SME_CHNG_MCC_BEACON_INTERVAL:
Jeff Johnson295189b2012-06-20 16:38:30 -07001341#if defined WLAN_FEATURE_VOWIFI
1342 case eWNI_SME_NEIGHBOR_REPORT_REQ_IND:
1343 case eWNI_SME_BEACON_REPORT_RESP_XMIT_IND:
1344#endif
1345#if defined FEATURE_WLAN_CCX
1346 case eWNI_SME_CCX_ADJACENT_AP_REPORT:
1347#endif
1348#ifdef WLAN_FEATURE_VOWIFI_11R
1349 case eWNI_SME_FT_UPDATE_KEY:
1350 case eWNI_SME_FT_PRE_AUTH_REQ:
1351 case eWNI_SME_FT_AGGR_QOS_REQ:
1352#endif
1353 case eWNI_SME_ADD_STA_SELF_REQ:
1354 case eWNI_SME_DEL_STA_SELF_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001355 case eWNI_SME_REGISTER_MGMT_FRAME_REQ:
1356 case eWNI_SME_UPDATE_NOA:
Gopichand Nakkalac178ac82013-05-30 19:53:39 +05301357 case eWNI_SME_CLEAR_DFS_CHANNEL_LIST:
Madan Mohan Koyyalamudi44bbc152013-07-05 21:13:10 +05301358 case eWNI_SME_STA_STAT_REQ:
1359 case eWNI_SME_AGGR_STAT_REQ:
1360 case eWNI_SME_GLOBAL_STAT_REQ:
1361 case eWNI_SME_STAT_SUMM_REQ:
1362 case eWNI_SME_GET_STATISTICS_REQ:
1363#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
1364 case eWNI_SME_GET_ROAM_RSSI_REQ:
1365#endif
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001366#if defined(FEATURE_WLAN_CCX) && defined(FEATURE_WLAN_CCX_UPLOAD)
1367 case eWNI_SME_GET_TSM_STATS_REQ:
1368#endif /* FEATURE_WLAN_CCX && FEATURE_WLAN_CCX_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001369 // These messages are from HDD
1370 limProcessNormalHddMsg(pMac, limMsg, false); //no need to response to hdd
1371 break;
1372
1373 //Power Save Messages From HDD
1374 case eWNI_PMC_PWR_SAVE_CFG:
1375 case eWNI_PMC_ENTER_BMPS_REQ:
1376 case eWNI_PMC_EXIT_BMPS_REQ:
1377 case eWNI_PMC_ENTER_IMPS_REQ:
1378 case eWNI_PMC_EXIT_IMPS_REQ:
1379 case eWNI_PMC_ENTER_UAPSD_REQ:
1380 case eWNI_PMC_EXIT_UAPSD_REQ:
1381 case eWNI_PMC_ENTER_WOWL_REQ:
1382 case eWNI_PMC_EXIT_WOWL_REQ:
1383 case eWNI_PMC_WOWL_ADD_BCAST_PTRN:
1384 case eWNI_PMC_WOWL_DEL_BCAST_PTRN:
1385 pmmProcessMessage(pMac, limMsg);
1386 break;
1387
1388 case eWNI_PMC_SMPS_STATE_IND :
1389 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001390 if(limMsg->bodyptr){
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301391 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001392 limMsg->bodyptr = NULL;
1393 }
1394 }
1395 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001396 case eWNI_SME_SEND_ACTION_FRAME_IND:
1397 limSendP2PActionFrame(pMac, limMsg);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301398 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001399 limMsg->bodyptr = NULL;
1400 break;
1401 case eWNI_SME_ABORT_REMAIN_ON_CHAN_IND:
1402 limAbortRemainOnChan(pMac);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301403 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001404 limMsg->bodyptr = NULL;
1405 break;
1406
Viral Modid86bde22012-12-10 13:09:21 -08001407 case SIR_HAL_P2P_NOA_START_IND:
1408 {
1409 tpPESession psessionEntry = &pMac->lim.gpSession[0];
1410 tANI_U8 i;
Viral Modid440e682013-03-06 02:25:31 -08001411 tANI_U8 p2pGOExists = 0;
Gopichand Nakkala78a6c812013-05-13 16:39:49 +05301412
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001413 limLog(pMac, LOG1, "LIM received NOA start %x", limMsg->type);
Viral Modid440e682013-03-06 02:25:31 -08001414
1415 /* Since insert NOA is done and NOA start msg received, we should deactivate the Insert NOA timer */
1416 limDeactivateAndChangeTimer(pMac, eLIM_INSERT_SINGLESHOT_NOA_TIMER);
1417
Viral Modid86bde22012-12-10 13:09:21 -08001418 for(i=0; i < pMac->lim.maxBssId; i++)
1419 {
1420 psessionEntry = &pMac->lim.gpSession[i];
1421 if ( (psessionEntry != NULL) && (psessionEntry->valid) &&
1422 (psessionEntry->pePersona == VOS_P2P_GO_MODE))
1423 { //Save P2P NOA start attributes for P2P Go persona
Viral Modid440e682013-03-06 02:25:31 -08001424 p2pGOExists = 1;
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301425 vos_mem_copy(&psessionEntry->p2pGoPsNoaStartInd, limMsg->bodyptr,
1426 sizeof(tSirP2PNoaStart));
Viral Modid440e682013-03-06 02:25:31 -08001427 if (psessionEntry->p2pGoPsNoaStartInd.status != eHAL_STATUS_SUCCESS)
Viral Modid86bde22012-12-10 13:09:21 -08001428 {
Viral Modid440e682013-03-06 02:25:31 -08001429 limLog(pMac, LOGW, FL("GO NOA start failure status %d reported by FW."
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001430 " - still go ahead with deferred sme req. This is just info"),
Viral Modid440e682013-03-06 02:25:31 -08001431 psessionEntry->p2pGoPsNoaStartInd.status);
Viral Modid86bde22012-12-10 13:09:21 -08001432 }
Viral Modid86bde22012-12-10 13:09:21 -08001433 break;
1434 }
1435 }
Viral Modid440e682013-03-06 02:25:31 -08001436
1437 if (p2pGOExists == 0)
1438 {
1439 limLog(pMac, LOGW, FL("By the time, we received NOA start, GO is already removed."
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001440 " - still go ahead with deferred sme req. This is just info"));
Viral Modid440e682013-03-06 02:25:31 -08001441 }
1442
1443 /* We received the NOA start indication. Now we can send down the SME request which requires off-channel operation */
1444 limProcessRegdDefdSmeReqAfterNOAStart(pMac);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301445 vos_mem_free(limMsg->bodyptr);
Viral Modid86bde22012-12-10 13:09:21 -08001446 limMsg->bodyptr = NULL;
Viral Modid440e682013-03-06 02:25:31 -08001447 }
Viral Modid86bde22012-12-10 13:09:21 -08001448 break;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301449#ifdef FEATURE_WLAN_TDLS
1450 case SIR_HAL_TDLS_IND:
1451 {
1452 tSirTdlsInd *pTdlsInd = (tpSirTdlsInd)limMsg->bodyptr ;
1453 tpDphHashNode pStaDs = NULL ;
1454 tpPESession psessionEntry = NULL;
1455 tANI_U8 sessionId;
1456 if((psessionEntry = peFindSessionByStaId(pMac,pTdlsInd->staIdx,&sessionId))== NULL)
1457 {
1458 limLog(pMac, LOG1, FL("session does not exist for given bssId\n"));
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301459 vos_mem_free(limMsg->bodyptr);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301460 limMsg->bodyptr = NULL;
1461 return;
1462 }
1463 if ((pStaDs = dphGetHashEntry(pMac, pTdlsInd->assocId, &psessionEntry->dph.dphHashTable)) == NULL)
1464 {
1465 limLog(pMac, LOG1, FL("pStaDs Does not exist for given staId\n"));
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301466 vos_mem_free(limMsg->bodyptr);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301467 limMsg->bodyptr = NULL;
1468 return;
1469 }
Viral Modid86bde22012-12-10 13:09:21 -08001470
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301471 if ((STA_ENTRY_TDLS_PEER == pStaDs->staType))
1472 {
1473 limLog(pMac, LOGE,
1474 FL("received TDLS Indication from the Firmware with Reason Code %d "),
1475 pTdlsInd->reasonCode);
1476 limSendSmeTDLSDelStaInd(pMac, pStaDs, psessionEntry,
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05301477 pTdlsInd->reasonCode);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301478 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301479 vos_mem_free(limMsg->bodyptr);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301480 limMsg->bodyptr = NULL;
1481 }
1482 break;
1483#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001484 case SIR_HAL_P2P_NOA_ATTR_IND:
1485 {
1486 tpPESession psessionEntry = &pMac->lim.gpSession[0];
1487 tANI_U8 i;
1488
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001489 limLog(pMac, LOGW, FL("Received message Noa_ATTR %x"), limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -07001490 for(i=0; i < pMac->lim.maxBssId; i++)
1491 {
Viral Modid86bde22012-12-10 13:09:21 -08001492 psessionEntry = &pMac->lim.gpSession[i];
1493 if ( (psessionEntry != NULL) && (psessionEntry->valid) &&
Jeff Johnson295189b2012-06-20 16:38:30 -07001494 (psessionEntry->pePersona == VOS_P2P_GO_MODE))
1495 { //Save P2P attributes for P2P Go persona
1496
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301497 vos_mem_copy(&psessionEntry->p2pGoPsUpdate, limMsg->bodyptr,
1498 sizeof(tSirP2PNoaAttr));
1499
Arif Hussain24bafea2013-11-15 15:10:03 -08001500 limLog(pMac, LOG2, FL(" &psessionEntry->bssId "
1501 MAC_ADDRESS_STR " ctWin=%d oppPsFlag=%d"),
1502 MAC_ADDR_ARRAY(psessionEntry->bssId),
Jeff Johnson295189b2012-06-20 16:38:30 -07001503 psessionEntry->p2pGoPsUpdate.ctWin,
1504 psessionEntry->p2pGoPsUpdate.oppPsFlag);
1505
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001506 limLog(pMac, LOG2, FL(" uNoa1IntervalCnt=%d uNoa1Duration=%d uNoa1Interval=%d uNoa1StartTime=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001507 psessionEntry->p2pGoPsUpdate.uNoa1IntervalCnt,
1508 psessionEntry->p2pGoPsUpdate.uNoa1Duration,
1509 psessionEntry->p2pGoPsUpdate.uNoa1Interval,
1510 psessionEntry->p2pGoPsUpdate.uNoa1StartTime);
1511
1512
1513 break;
1514 }
1515 }
1516
1517 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301518 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001519 limMsg->bodyptr = NULL;
1520
1521 break;
1522
1523
Jeff Johnson295189b2012-06-20 16:38:30 -07001524 /* eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER Message comes after the
1525 * device comes out of full power for the full power request sent
1526 * because of channel switch with switch count as 0, so call the same
1527 * function used in timeout case(i.e SIR_LIM_CHANNEL_SWITCH_TIMEOUT)
1528 * for switching the channel*/
1529 case eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER:
Jeff Johnsone7245742012-09-05 17:12:55 -07001530 if ( !tx_timer_running(&pMac->lim.limTimers.gLimChannelSwitchTimer) )
1531 {
1532 limProcessChannelSwitchTimeout(pMac);
1533 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301534 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001535 limMsg->bodyptr = NULL;
1536 break;
1537
1538 //Power Save Related Messages From HAL
1539 case WDA_ENTER_BMPS_RSP:
1540 case WDA_EXIT_BMPS_RSP:
1541 case WDA_EXIT_BMPS_IND:
1542 case WDA_ENTER_IMPS_RSP:
1543 case WDA_EXIT_IMPS_RSP:
1544 case WDA_ENTER_UAPSD_RSP:
1545 case WDA_EXIT_UAPSD_RSP:
1546 case WDA_WOWL_ENTER_RSP:
1547 case WDA_WOWL_EXIT_RSP:
1548 pmmProcessMessage(pMac, limMsg);
1549 break;
1550
1551 case WDA_LOW_RSSI_IND:
1552 //limHandleLowRssiInd(pMac);
1553 break;
1554
1555 case WDA_BMPS_STATUS_IND:
1556 limHandleBmpsStatusInd(pMac);
1557 break;
1558
1559 case WDA_MISSED_BEACON_IND:
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001560 limHandleMissedBeaconInd(pMac, limMsg);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301561 vos_mem_free(limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001562 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001563 break;
1564 case WDA_MIC_FAILURE_IND:
1565 limMicFailureInd(pMac, limMsg);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301566 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001567 limMsg->bodyptr = NULL;
1568 break;
1569
1570
Jeff Johnson295189b2012-06-20 16:38:30 -07001571
1572 case SIR_LIM_ADDTS_RSP_TIMEOUT:
1573 limProcessSmeReqMessages(pMac,limMsg);
1574 break;
1575#ifdef FEATURE_WLAN_CCX
1576 case SIR_LIM_CCX_TSM_TIMEOUT:
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001577#ifndef FEATURE_WLAN_CCX_UPLOAD
Jeff Johnson295189b2012-06-20 16:38:30 -07001578 limProcessTsmTimeoutHandler(pMac,limMsg);
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001579#endif /* FEATURE_WLAN_CCX_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001580 break;
1581 case WDA_TSM_STATS_RSP:
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001582#ifdef FEATURE_WLAN_CCX_UPLOAD
1583 limSendSmePECcxTsmRsp(pMac, (tAniGetTsmStatsRsp *)limMsg->bodyptr);
1584#else
Jeff Johnson295189b2012-06-20 16:38:30 -07001585 limProcessHalCcxTsmRsp(pMac, limMsg);
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001586#endif /* FEATURE_WLAN_CCX_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001587 break;
1588#endif
1589 case WDA_ADD_TS_RSP:
1590 limProcessHalAddTsRsp(pMac, limMsg);
1591 break;
1592
1593 case SIR_LIM_DEL_TS_IND:
1594 limProcessDelTsInd(pMac, limMsg);
Madan Mohan Koyyalamudif244d8f2012-11-29 11:21:05 -08001595 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001596 case SIR_LIM_ADD_BA_IND:
1597 limProcessAddBaInd(pMac, limMsg);
1598 break;
1599 case SIR_LIM_DEL_BA_ALL_IND:
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001600 limDelAllBASessions(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001601 break;
1602 case SIR_LIM_DEL_BA_IND:
1603 limProcessMlmHalBADeleteInd( pMac, limMsg );
1604 break;
1605
1606 case SIR_LIM_BEACON_GEN_IND: {
Jeff Johnson295189b2012-06-20 16:38:30 -07001607
Jeff Johnson295189b2012-06-20 16:38:30 -07001608 if( pMac->lim.gLimSystemRole != eLIM_AP_ROLE )
Jeff Johnson295189b2012-06-20 16:38:30 -07001609 schProcessPreBeaconInd(pMac, limMsg);
1610
1611 }
1612 break;
1613
1614 case SIR_LIM_DELETE_STA_CONTEXT_IND:
1615 limDeleteStaContext(pMac, limMsg);
1616 break;
1617
1618 case SIR_LIM_MIN_CHANNEL_TIMEOUT:
1619 case SIR_LIM_MAX_CHANNEL_TIMEOUT:
1620 case SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT:
1621 case SIR_LIM_JOIN_FAIL_TIMEOUT:
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001622 case SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001623 case SIR_LIM_AUTH_FAIL_TIMEOUT:
1624 case SIR_LIM_AUTH_RSP_TIMEOUT:
1625 case SIR_LIM_ASSOC_FAIL_TIMEOUT:
1626 case SIR_LIM_REASSOC_FAIL_TIMEOUT:
1627#ifdef WLAN_FEATURE_VOWIFI_11R
1628 case SIR_LIM_FT_PREAUTH_RSP_TIMEOUT:
1629#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001630 case SIR_LIM_REMAIN_CHN_TIMEOUT:
Viral Modid86bde22012-12-10 13:09:21 -08001631 case SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT:
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001632 case SIR_LIM_DISASSOC_ACK_TIMEOUT:
1633 case SIR_LIM_DEAUTH_ACK_TIMEOUT:
Gopichand Nakkalad492d202013-05-10 02:50:47 +05301634 case SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
Jeff Johnson295189b2012-06-20 16:38:30 -07001635 // These timeout messages are handled by MLM sub module
1636
1637 limProcessMlmReqMessages(pMac,
1638 limMsg);
1639
1640 break;
1641
1642 case SIR_LIM_HEART_BEAT_TIMEOUT:
1643 /** check if heart beat failed, even if one Beacon
1644 * is rcvd within the Heart Beat interval continue
1645 * normal processing
1646 */
1647
1648 #if 0
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001649 PELOG1(limLog(pMac, LOG1, FL("Heartbeat timeout, SME %d, MLME %d, #bcn %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001650 pMac->lim.gLimSmeState, pMac->lim.gLimMlmState,
1651 pMac->lim.gLimRxedBeaconCntDuringHB);)
1652
1653 if(pMac->lim.gLimSystemRole == eLIM_STA_IN_IBSS_ROLE)
1654 limIbssHeartBeatHandle(pMac); //HeartBeat for peers.
1655 else
1656 /**
1657 * Heartbeat failure occurred on STA
1658 * This is handled by LMM sub module.
1659 */
1660 limHandleHeartBeatFailure(pMac);
1661
1662 break;
1663 #endif //TO SUPPORT BT-AMP
Yathish9f22e662012-12-10 14:21:35 -08001664 if (limIsSystemInScanState(pMac))
1665 {
1666 // System is in DFS (Learn) mode
1667 // Defer processsing this message
1668 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1669 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001670 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 -08001671 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1672 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
1673 limLogSessionStates(pMac);
1674 }
1675 }
1676 else
1677 {
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001678 if (NULL == limMsg->bodyptr)
1679 {
1680 limHandleHeartBeatTimeout(pMac);
1681 }
1682 else
1683 {
1684 limHandleHeartBeatTimeoutForSession(pMac, (tpPESession)limMsg->bodyptr);
1685 }
Gopichand Nakkala78a6c812013-05-13 16:39:49 +05301686 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001687 break;
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001688
Jeff Johnson295189b2012-06-20 16:38:30 -07001689 case SIR_LIM_PROBE_HB_FAILURE_TIMEOUT:
1690 limHandleHeartBeatFailureTimeout(pMac);
1691 break;
1692
1693 case SIR_LIM_CHANNEL_SCAN_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001694 /**
1695 * Background scan timeout occurred on STA.
1696 * This is handled by LMM sub module.
1697 */
1698 limDeactivateAndChangeTimer(pMac, eLIM_BACKGROUND_SCAN_TIMER);
1699
1700 //We will do background scan even in bcnps mode
1701 //if (pMac->sys.gSysEnableScanMode)
1702 pMac->lim.gLimReportBackgroundScanResults = FALSE;
1703 limTriggerBackgroundScan(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001704 break;
1705
Jeff Johnson295189b2012-06-20 16:38:30 -07001706
1707 case SIR_LIM_HASH_MISS_THRES_TIMEOUT:
1708
1709 /*
1710 ** clear the credit to the send disassociate frame bucket
1711 **/
1712
1713 pMac->lim.gLimDisassocFrameCredit = 0;
1714 break;
1715
1716 case SIR_LIM_CNF_WAIT_TIMEOUT:
1717
1718 /*
1719 ** Does not receive CNF or dummy packet
1720 **/
1721 limHandleCnfWaitTimeout(pMac, (tANI_U16) limMsg->bodyval);
1722
1723 break;
1724
1725 case SIR_LIM_KEEPALIVE_TIMEOUT:
1726 limSendKeepAliveToPeer(pMac);
1727
1728 break;
1729
1730 case SIR_LIM_RETRY_INTERRUPT_MSG:
1731 // Message from ISR upon TFP's max retry limit interrupt
1732
1733 break;
1734
1735 case SIR_LIM_INV_KEY_INTERRUPT_MSG:
1736 // Message from ISR upon SP's Invalid session key interrupt
1737
1738 break;
1739
1740 case SIR_LIM_KEY_ID_INTERRUPT_MSG:
1741 // Message from ISR upon SP's Invalid key ID interrupt
1742
1743 break;
1744
1745 case SIR_LIM_REPLAY_THRES_INTERRUPT_MSG:
1746 // Message from ISR upon SP's Replay threshold interrupt
1747
1748 break;
1749
1750 case SIR_LIM_CHANNEL_SWITCH_TIMEOUT:
1751 limProcessChannelSwitchTimeout(pMac);
1752 break;
1753
1754 case SIR_LIM_QUIET_TIMEOUT:
1755 limProcessQuietTimeout(pMac);
1756 break;
1757
1758 case SIR_LIM_QUIET_BSS_TIMEOUT:
1759 limProcessQuietBssTimeout(pMac);
1760 break;
1761
Jeff Johnson295189b2012-06-20 16:38:30 -07001762 case SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT:
1763 limHandleUpdateOlbcCache(pMac);
1764 break;
1765#if 0
1766 case SIR_LIM_WPS_OVERLAP_TIMEOUT:
1767 limProcessWPSOverlapTimeout(pMac);
1768 break;
1769#endif
1770
Jeff Johnson295189b2012-06-20 16:38:30 -07001771
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001772#ifdef FEATURE_WLAN_TDLS_INTERNAL
1773 /*
1774 * Here discovery timer expires, now we can go ahead and collect all
1775 * the dicovery responses PE has process till now and send this
1776 * responses to SME..
1777 */
1778 case SIR_LIM_TDLS_DISCOVERY_RSP_WAIT:
1779 {
1780 //fetch the sessionEntry based on the sessionId
1781 tpPESession psessionEntry = peFindSessionBySessionId(pMac,
1782 pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId) ;
1783 if(NULL == psessionEntry)
1784 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001785 limLog(pMac, LOGP,FL("Session Does not exist for given sessionID %d"), pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId);
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001786 return;
1787 }
1788
1789 VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001790 ("Discovery Rsp timer expires ")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001791#if 0 // TDLS_hklee: D13 no need to open Addr2 unknown data packet
1792 /* restore RXP filters */
1793 limSetLinkState(pMac, eSIR_LINK_FINISH_TDLS_DISCOVERY_STATE,
1794 psessionEntry->bssId) ;
1795#endif
1796 limSendSmeTdlsDisRsp(pMac, eSIR_SUCCESS,
1797 eWNI_SME_TDLS_DISCOVERY_START_RSP) ;
1798 break ;
1799 }
1800
1801 /*
1802 * we initiated link setup and did not receive TDLS setup rsp
1803 * from TDLS peer STA, send failure RSP to SME.
1804 */
1805 case SIR_LIM_TDLS_LINK_SETUP_RSP_TIMEOUT:
1806 {
1807 tANI_U8 *peerMac = (tANI_U8 *)limMsg->bodyval ;
1808 tLimTdlsLinkSetupPeer *setupPeer = NULL ;
1809
1810 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001811 ("TDLS setup rsp timer expires ")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001812 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Arif Hussaina7c8e412013-11-20 11:06:42 -08001813 ("TDLS setup rsp timer expires for peer:"
1814 MAC_ADDRESS_STR), MAC_ADDR_ARRAY(peerMac));
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001815
1816 limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ;
1817 if(NULL != setupPeer)
1818 {
1819 limTdlsDelLinkPeer( pMac, peerMac) ;
1820 }
1821
1822 limSendSmeTdlsLinkStartRsp(pMac, eSIR_FAILURE, peerMac,
1823 eWNI_SME_TDLS_LINK_START_RSP) ;
1824 break ;
1825 }
1826 case SIR_LIM_TDLS_LINK_SETUP_CNF_TIMEOUT:
1827 {
1828 tANI_U8 *peerMac = (tANI_U8 *)limMsg->bodyval ;
1829 tLimTdlsLinkSetupPeer *setupPeer = NULL ;
1830
1831 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001832 ("TDLS setup CNF timer expires ")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001833 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Arif Hussaina7c8e412013-11-20 11:06:42 -08001834 ("TDLS setup CNF timer expires for peer: "
1835 MAC_ADDRESS_STR), MAC_ADDR_ARRAY(peerMac));
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001836 limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ;
1837 if(NULL != setupPeer)
1838 {
1839 limTdlsDelLinkPeer( pMac, peerMac) ;
1840 }
1841 break ;
1842 }
1843#endif /* FEATURE_WLAN_TDLS TIMER */
Jeff Johnson295189b2012-06-20 16:38:30 -07001844 case WDA_ADD_BSS_RSP:
1845 limProcessMlmAddBssRsp( pMac, limMsg );
1846 break;
1847
1848 case WDA_ADD_STA_RSP:
1849
1850 //call a wrapper by paasing bodyptr, their get sessionID and and call proper function from there.
1851 limProcessAddStaRsp(pMac,limMsg);
1852 break;
1853
1854 case WDA_DELETE_STA_RSP:
1855 limProcessMlmDelStaRsp(pMac, limMsg);
1856 break;
1857
1858 case WDA_ADD_STA_SELF_RSP:
1859 limProcessAddStaSelfRsp(pMac, limMsg);
1860 break;
1861 case WDA_DEL_STA_SELF_RSP:
1862 limProcessDelStaSelfRsp(pMac, limMsg);
1863 break;
1864
1865 case WDA_DELETE_BSS_RSP:
1866 limHandleDeleteBssRsp(pMac,limMsg); //wrapper routine to handle delete bss response
1867 break;
1868
1869 case WDA_SET_BSSKEY_RSP:
1870 case WDA_SET_STA_BCASTKEY_RSP:
1871 limProcessMlmSetBssKeyRsp( pMac, limMsg );
1872 break;
1873 case WDA_SET_STAKEY_RSP:
1874 limProcessMlmSetStaKeyRsp( pMac, limMsg );
1875 break;
1876 case WDA_REMOVE_BSSKEY_RSP:
1877 case WDA_REMOVE_STAKEY_RSP:
1878 limProcessMlmRemoveKeyRsp( pMac, limMsg );
1879 break;
1880 case WDA_ADDBA_RSP:
1881 limProcessMlmHalAddBARsp( pMac, limMsg );
1882 break;
1883
1884 case WDA_STA_STAT_RSP:
1885 case WDA_AGGR_STAT_RSP:
1886 case WDA_GLOBAL_STAT_RSP:
1887 case WDA_STAT_SUMM_RSP:
1888 limSendSmeStatsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
1889 break;
1890
1891 case WDA_GET_STATISTICS_RSP:
1892 limSendSmePEStatisticsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
1893 break;
Srinivas Girigowdad34cedb2013-01-25 13:33:11 -08001894#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
1895 case WDA_GET_ROAM_RSSI_RSP:
1896 limSendSmePEGetRoamRssiRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
1897 break;
1898#endif
1899
Jeff Johnson295189b2012-06-20 16:38:30 -07001900
1901 case WDA_SET_MIMOPS_RSP: //limProcessSetMimoRsp(pMac, limMsg);
1902 case WDA_SET_TX_POWER_RSP: //limProcessSetTxPowerRsp(pMac, limMsg);
1903 case WDA_GET_TX_POWER_RSP: //limProcessGetTxPowerRsp(pMac, limMsg);
1904 case WDA_GET_NOISE_RSP:
1905 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
1906 limMsg->bodyptr = NULL;
1907 //limProcessGetNoiseRsp(pMac, limMsg);
1908 break;
1909
1910 case WDA_SET_MAX_TX_POWER_RSP:
1911#if defined WLAN_FEATURE_VOWIFI
1912 rrmSetMaxTxPowerRsp( pMac, limMsg );
1913#endif
1914 if(limMsg->bodyptr != NULL)
1915 {
1916 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
1917 limMsg->bodyptr = NULL;
1918 }
1919 break;
1920
Jeff Johnson295189b2012-06-20 16:38:30 -07001921 case SIR_LIM_ADDR2_MISS_IND:
1922 {
1923 limLog(pMac, LOGE,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001924 FL("Addr2 mismatch interrupt received %X"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001925 limMsg->type);
1926 /*a message from HAL indicating addr2 mismatch interrupt occurred
1927 limMsg->bodyptr contains only pointer to 48-bit addr2 field*/
1928 //Dinesh fix this. the third parameter should be sessionentry.
1929 //limHandleUnknownA2IndexFrames(pMac, (void *)limMsg->bodyptr);
1930
1931 /*Free message body pointer*/
1932 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001933 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001934 break;
1935 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001936
1937#ifdef WLAN_FEATURE_VOWIFI_11R
1938 case WDA_AGGR_QOS_RSP:
1939 limProcessFTAggrQoSRsp( pMac, limMsg );
1940 break;
1941#endif
1942
1943 case WDA_SET_LINK_STATE_RSP:
1944 linkStateParams = (tLinkStateParams *)limMsg->bodyptr;
1945#if defined WLAN_FEATURE_VOWIFI_11R
1946 pSession = linkStateParams->session;
1947 if(linkStateParams->ft)
1948 {
1949 limSendReassocReqWithFTIEsMgmtFrame(pMac,
1950 pSession->pLimMlmReassocReq,
1951 pSession);
1952 }
1953#endif
1954 if( linkStateParams->callback )
1955 {
1956 linkStateParams->callback( pMac, linkStateParams->callbackArg );
1957 }
1958 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001959 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001960 break;
1961
1962#ifdef WLAN_FEATURE_PACKET_FILTERING
1963 case WDA_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP:
1964 pmmProcessMessage(pMac, limMsg);
1965 break;
1966#endif // WLAN_FEATURE_PACKET_FILTERING
1967
1968#ifdef WLAN_FEATURE_GTK_OFFLOAD
1969 case WDA_GTK_OFFLOAD_GETINFO_RSP:
1970 pmmProcessMessage(pMac, limMsg);
1971 break;
1972#endif // WLAN_FEATURE_GTK_OFFLOAD
Yathish9f22e662012-12-10 14:21:35 -08001973 case eWNI_SME_SET_BCN_FILTER_REQ:
1974 {
1975#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1976 tpPESession psessionEntry;
1977 tANI_U8 sessionId = (tANI_U8)limMsg->bodyval ;
1978 psessionEntry = &pMac->lim.gpSession[sessionId];
1979 if(psessionEntry != NULL && IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
1980 {
1981 // sending beacon filtering information down to HAL
1982 if (limSendBeaconFilterInfo(pMac, psessionEntry) != eSIR_SUCCESS)
1983 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001984 limLog(pMac, LOGE, FL("Fail to send Beacon Filter Info "));
Yathish9f22e662012-12-10 14:21:35 -08001985 }
1986 }
Dhanashri Atred7885c22013-03-29 11:19:05 -07001987 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
1988 limMsg->bodyptr = NULL;
Yathish9f22e662012-12-10 14:21:35 -08001989#endif
1990 }
1991 break;
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05301992 case eWNI_SME_HT40_OBSS_SCAN_IND:
1993 {
1994 tpPESession psessionEntry;
1995 tANI_U8 sessionId = (tANI_U8)limMsg->bodyval ;
1996
1997 psessionEntry = &pMac->lim.gpSession[sessionId];
1998
1999 VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO,
2000 "%s eWNI_SME_HT40_OBSS_SCAN_IND htSupportedChannelWidthSet %d \n",
2001 __func__, psessionEntry->htSupportedChannelWidthSet);
2002
2003 if (psessionEntry != NULL &&
2004 IS_HT40_OBSS_SCAN_FEATURE_ENABLE &&
2005 psessionEntry->htSupportedChannelWidthSet ==
2006 WNI_CFG_CHANNEL_BONDING_MODE_ENABLE )
2007 {
2008 limSendHT40OBSSScanInd(pMac, psessionEntry);
2009 }
2010 else
2011 {
2012 VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO,
2013 "OBSS Scan not started: htSupportedChannelWidthSet- %d ",
2014 psessionEntry->htSupportedChannelWidthSet );
2015 }
2016 vos_mem_free(limMsg->bodyptr);
2017 limMsg->bodyptr = NULL;
2018 }
2019 break;
2020 case eWNI_SME_HT40_STOP_OBSS_SCAN_IND:
2021 {
2022 tpPESession psessionEntry = NULL;
2023 tANI_U8 sessionId = (tANI_U8)limMsg->bodyval ;
2024
2025 psessionEntry = &pMac->lim.gpSession[sessionId];
2026 /* Sending LIM STOP OBSS SCAN Indication
2027 Stop command support is only for debugging purpose */
2028 if ( IS_HT40_OBSS_SCAN_FEATURE_ENABLE )
2029 limSendHT40OBSSStopScanInd(pMac, psessionEntry);
2030 else
2031 VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_ERROR,
2032 "OBSS Scan Stop not started ");
2033 }
2034 break;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05302035#ifdef FEATURE_WLAN_TDLS
2036 case WDA_SET_TDLS_LINK_ESTABLISH_REQ_RSP:
2037 {
Gopichand Nakkala24be5312013-07-02 16:47:12 +05302038 tpPESession psessionEntry;
2039 tANI_U8 sessionId;
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05302040 tTdlsLinkEstablishParams *pTdlsLinkEstablishParams;
2041 pTdlsLinkEstablishParams = (tTdlsLinkEstablishParams*) limMsg->bodyptr;
Gopichand Nakkala24be5312013-07-02 16:47:12 +05302042
2043 if((psessionEntry = peFindSessionByStaId(pMac,
2044 pTdlsLinkEstablishParams->staIdx,
2045 &sessionId))== NULL)
2046 {
2047 limLog(pMac, LOGE, FL("session %u does not exist.\n"), sessionId);
2048 /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP message to SME
2049 with session id as zero and status as FAILURE so, that message
2050 queued in SME queue can be freed to prevent the SME cmd buffer leak */
2051 limSendSmeTdlsLinkEstablishReqRsp(pMac,
2052 0,
2053 NULL,
2054 NULL,
2055 eSIR_FAILURE);
2056 }
2057 else
2058 {
2059 limSendSmeTdlsLinkEstablishReqRsp(pMac,
2060 psessionEntry->smeSessionId,
2061 NULL,
2062 NULL,
2063 pTdlsLinkEstablishParams->status) ;
2064 }
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05302065 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
2066 limMsg->bodyptr = NULL;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05302067 break;
2068 }
2069#endif
Gopichand Nakkala2c231c82013-06-11 17:49:16 +05302070
2071 case WDA_RX_SCAN_EVENT:
2072 limProcessRxScanEvent(pMac, limMsg->bodyptr);
2073 break;
2074
Ravi Joshid2ca7c42013-07-23 08:37:49 -07002075 case WDA_IBSS_PEER_INACTIVITY_IND:
2076 {
2077 limProcessIbssPeerInactivity(pMac, limMsg->bodyptr);
2078 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
2079 limMsg->bodyptr = NULL;
2080 break;
2081 }
2082
Jeff Johnson295189b2012-06-20 16:38:30 -07002083 default:
2084 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2085 limMsg->bodyptr = NULL;
2086 // Unwanted messages
2087 // Log error
2088 limLog(pMac, LOGE,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002089 FL("Discarding unexpected message received %X"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002090 limMsg->type);
2091 limPrintMsgName(pMac, LOGE, limMsg->type);
2092 break;
2093
2094 } // switch (limMsg->type)
2095
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002096 PELOG2(limLog(pMac, LOG2, FL("Done Processing msgType = %d, sme state = %s, mlm state = %s"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002097 limMsg->type, limSmeStateStr(pMac->lim.gLimSmeState),
2098 limMlmStateStr(pMac->lim.gLimMlmState));)
2099
2100} /*** end limProcessMessages() ***/
2101
2102
2103
2104/**
2105 * limProcessDeferredMessageQueue
2106 *
2107 *FUNCTION:
2108 * This function is called by LIM while exiting from Learn
2109 * mode. This function fetches messages posted to the LIM
2110 * deferred message queue limDeferredMsgQ.
2111 *
2112 *LOGIC:
2113 *
2114 *ASSUMPTIONS:
2115 * NA
2116 *
2117 *NOTE:
2118 * NA
2119 *
2120 * @param pMac - Pointer to Global MAC structure
2121 * @return None
2122 */
2123
2124void
2125limProcessDeferredMessageQueue(tpAniSirGlobal pMac)
2126{
2127 tSirMsgQ limMsg = { 0, 0, 0 };
2128
Jeff Johnson295189b2012-06-20 16:38:30 -07002129 tSirMsgQ *readMsg;
2130 tANI_U16 size;
2131
2132 /*
2133 ** check any deferred messages need to be processed
2134 **/
2135 size = pMac->lim.gLimDeferredMsgQ.size;
2136 if (size > 0)
2137 {
2138 while ((readMsg = limReadDeferredMsgQ(pMac)) != NULL)
2139 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302140 vos_mem_copy((tANI_U8*) &limMsg,
Jeff Johnson295189b2012-06-20 16:38:30 -07002141 (tANI_U8*) readMsg, sizeof(tSirMsgQ));
2142 size--;
2143 limProcessMessages(pMac, &limMsg);
2144
2145 if((limIsSystemInScanState(pMac)) || (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) ||
2146 (pMac->lim.gLimSystemInScanLearnMode))
2147 break;
2148 }
2149 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002150} /*** end limProcessDeferredMessageQueue() ***/
2151
2152
2153/*
2154 * limProcessNormalHddMsg
2155 * Function: this function checks the current lim state and decide whether the message passed shall be deffered.
2156 * @param pMac - Pointer to Global MAC structure
2157 * pLimMsg -- the message need to be processed
2158 * fRspReqd -- whether return result to hdd
2159 * @return None
2160 */
2161void limProcessNormalHddMsg(tpAniSirGlobal pMac, tSirMsgQ *pLimMsg, tANI_U8 fRspReqd)
2162{
2163 tANI_BOOLEAN fDeferMsg = eANI_BOOLEAN_TRUE;
2164
2165 /* Added For BT-AMP Support */
2166 if ((pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_AP_ROLE )
2167 ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_STA_ROLE)
2168 ||(pMac->lim.gLimSystemRole == eLIM_UNKNOWN_ROLE))
2169 {
2170 /** This check is required only for the AP and in 2 cases.
2171 * 1. If we are in learn mode and we receive any of these messages,
2172 * you have to come out of scan and process the message, hence dont
2173 * defer the message here. In handler, these message could be defered
2174 * till we actually come out of scan mode.
2175 * 2. If radar is detected, you might have to defer all of these
2176 * messages except Stop BSS request/ Switch channel request. This
2177 * decision is also made inside its handler.
2178 *
2179 * Please be careful while using the flag fDeferMsg. Possibly you
2180 * might end up in an infinite loop.
2181 **/
2182 if (((pLimMsg->type == eWNI_SME_START_BSS_REQ) ||
2183 (pLimMsg->type == eWNI_SME_STOP_BSS_REQ) ||
2184 (pLimMsg->type == eWNI_SME_SWITCH_CHL_REQ) ||
2185 (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ) ||
2186 (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ)))
2187 {
2188 fDeferMsg = eANI_BOOLEAN_FALSE;
2189 }
2190 }
2191
2192 /* limInsystemInscanState() refers the psessionEntry, how to get session Entry????*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002193 if (((pMac->lim.gLimAddtsSent) || (limIsSystemInScanState(pMac)) /*||
2194 (LIM_IS_RADAR_DETECTED(pMac))*/) && fDeferMsg)
Jeff Johnson295189b2012-06-20 16:38:30 -07002195 {
2196 // System is in DFS (Learn) mode or awaiting addts response
2197 // or if radar is detected, Defer processsing this message
2198 if (limDeferMsg(pMac, pLimMsg) != TX_SUCCESS)
2199 {
2200#ifdef WLAN_DEBUG
2201 pMac->lim.numSme++;
2202#endif
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002203 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 -07002204 pLimMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
2205 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
2206 limLogSessionStates(pMac);
2207 limPrintMsgName(pMac, LOGE, pLimMsg->type);
2208 // Release body
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302209 vos_mem_free(pLimMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08002210 pLimMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07002211 }
2212 }
2213 else
2214 {
2215 if(fRspReqd)
2216 {
2217 // These messages are from HDD
2218 // Since these requests may also be generated
2219 // internally within LIM module, need to
2220 // distinquish and send response to host
2221 pMac->lim.gLimRspReqd = eANI_BOOLEAN_TRUE;
2222 }
2223#ifdef WLAN_DEBUG
2224 pMac->lim.numSme++;
2225#endif
2226 if(limProcessSmeReqMessages(pMac, pLimMsg))
2227 {
2228 // Release body
2229 // limProcessSmeReqMessage consumed the buffer. We can free it.
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302230 vos_mem_free(pLimMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08002231 pLimMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07002232 }
2233 }
2234}
2235
2236void
Jeff Johnsone7245742012-09-05 17:12:55 -07002237handleHTCapabilityandHTInfo(struct sAniSirGlobal *pMac, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07002238{
2239 tSirMacHTCapabilityInfo macHTCapabilityInfo;
2240 tSirMacHTParametersInfo macHTParametersInfo;
2241 tSirMacHTInfoField1 macHTInfoField1;
2242 tSirMacHTInfoField2 macHTInfoField2;
2243 tSirMacHTInfoField3 macHTInfoField3;
2244 tANI_U32 cfgValue;
2245 tANI_U8 *ptr;
Jeff Johnson295189b2012-06-20 16:38:30 -07002246
Jeff Johnson295189b2012-06-20 16:38:30 -07002247 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_CAP_INFO, &cfgValue) != eSIR_SUCCESS)
2248 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002249 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_CAP_INFO value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002250 return ;
2251 }
2252 ptr = (tANI_U8 *) &macHTCapabilityInfo;
2253 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2254 pMac->lim.gHTLsigTXOPProtection = (tANI_U8)macHTCapabilityInfo.lsigTXOPProtection;
2255 pMac->lim.gHTMIMOPSState = (tSirMacHTMIMOPowerSaveState) macHTCapabilityInfo.mimoPowerSave;
2256 pMac->lim.gHTGreenfield = (tANI_U8)macHTCapabilityInfo.greenField;
2257 pMac->lim.gHTMaxAmsduLength = (tANI_U8)macHTCapabilityInfo.maximalAMSDUsize;
2258 pMac->lim.gHTShortGI20Mhz = (tANI_U8)macHTCapabilityInfo.shortGI20MHz;
2259 pMac->lim.gHTShortGI40Mhz = (tANI_U8)macHTCapabilityInfo.shortGI40MHz;
Jeff Johnson295189b2012-06-20 16:38:30 -07002260 pMac->lim.gHTPSMPSupport = (tANI_U8)macHTCapabilityInfo.psmp;
2261 pMac->lim.gHTDsssCckRate40MHzSupport = (tANI_U8)macHTCapabilityInfo.dsssCckMode40MHz;
2262
2263 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_AMPDU_PARAMS, &cfgValue) != eSIR_SUCCESS)
2264 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002265 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_PARAM_INFO value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002266 return ;
2267 }
2268 ptr = (tANI_U8 *) &macHTParametersInfo;
2269 *ptr = (tANI_U8) (cfgValue & 0xff);
2270 pMac->lim.gHTAMpduDensity = (tANI_U8)macHTParametersInfo.mpduDensity;
2271 pMac->lim.gHTMaxRxAMpduFactor = (tANI_U8)macHTParametersInfo.maxRxAMPDUFactor;
2272
2273 // Get HT IE Info
2274 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD1, &cfgValue) != eSIR_SUCCESS)
2275 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002276 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD1 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002277 return ;
2278 }
2279 ptr = (tANI_U8 *) &macHTInfoField1;
2280 *((tANI_U8 *)ptr) = (tANI_U8) (cfgValue & 0xff);
2281 pMac->lim.gHTServiceIntervalGranularity = (tANI_U8)macHTInfoField1.serviceIntervalGranularity;
2282 pMac->lim.gHTControlledAccessOnly = (tANI_U8)macHTInfoField1.controlledAccessOnly;
2283 pMac->lim.gHTRifsMode = (tANI_U8)macHTInfoField1.rifsMode;
Jeff Johnson295189b2012-06-20 16:38:30 -07002284
2285 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD2, &cfgValue) != eSIR_SUCCESS)
2286 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002287 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD2 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002288 return ;
2289 }
2290 ptr = (tANI_U8 *) &macHTInfoField2;
2291 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2292 pMac->lim.gHTOperMode = (tSirMacHTOperatingMode) macHTInfoField2.opMode;
2293
2294 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD3, &cfgValue) != eSIR_SUCCESS)
2295 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002296 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD3 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002297 return ;
2298 }
2299 ptr = (tANI_U8 *) &macHTInfoField3;
2300 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2301 pMac->lim.gHTPCOActive = (tANI_U8)macHTInfoField3.pcoActive;
2302 pMac->lim.gHTPCOPhase = (tANI_U8)macHTInfoField3.pcoPhase;
Jeff Johnson295189b2012-06-20 16:38:30 -07002303 pMac->lim.gHTSecondaryBeacon = (tANI_U8)macHTInfoField3.secondaryBeacon;
2304 pMac->lim.gHTDualCTSProtection = (tANI_U8)macHTInfoField3.dualCTSProtection;
2305 pMac->lim.gHTSTBCBasicMCS = (tANI_U8)macHTInfoField3.basicSTBCMCS;
Jeff Johnsone7245742012-09-05 17:12:55 -07002306
2307 /* The lim globals for channelwidth and secondary chnl have been removed and should not be used during no session;
2308 * instead direct cfg is read and used when no session for transmission of mgmt frames (same as old);
2309 * For now, we might come here during init and join with sessionEntry = NULL; in that case just fill the globals which exist
2310 * Sessionized entries values will be filled in join or add bss req. The ones which are missed in join are filled below
2311 */
2312 if (psessionEntry != NULL)
2313 {
Sandeep Puligilla11d49a62014-01-30 12:05:16 +05302314 psessionEntry->htCapability =
2315 IS_DOT11_MODE_HT(psessionEntry->dot11mode);
2316 psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport =
2317 (tANI_U8)macHTInfoField3.lsigTXOPProtectionFullSupport;
2318 if (wlan_cfgGetInt(pMac, WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME,
2319 &cfgValue) != eSIR_SUCCESS)
2320 {
2321 limLog(pMac, LOGE, FL("Fail to retrieve "
2322 "WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME value"));
2323 return ;
2324 }
2325 psessionEntry->obssHT40ScanParam.OBSSScanActiveDwellTime = cfgValue;
2326 if (wlan_cfgGetInt(pMac, WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME,
2327 &cfgValue) != eSIR_SUCCESS)
2328 {
2329 limLog(pMac, LOGE, FL("Fail to retrieve "
2330 "WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME value"));
2331 return ;
2332 }
2333 psessionEntry->obssHT40ScanParam.OBSSScanPassiveDwellTime = cfgValue;
2334 if (wlan_cfgGetInt(pMac, WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL,
2335 &cfgValue) != eSIR_SUCCESS)
2336 {
2337 limLog(pMac, LOGE, FL("Fail to retrieve "
2338 "WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL value"));
2339 return ;
2340 }
2341 psessionEntry->obssHT40ScanParam.BSSChannelWidthTriggerScanInterval
2342 = cfgValue;
2343 if (wlan_cfgGetInt(pMac,
2344 WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL,
2345 &cfgValue) != eSIR_SUCCESS)
2346 {
2347 limLog(pMac, LOGE, FL("Fail to retrieve"
2348 "WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL value"));
2349 return ;
2350 }
2351 psessionEntry->obssHT40ScanParam.OBSSScanActiveTotalPerChannel =
2352 cfgValue;
2353 if (wlan_cfgGetInt(pMac,
2354 WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL, &cfgValue)
2355 != eSIR_SUCCESS)
2356 {
2357 limLog(pMac, LOGE, FL("Fail to retrieve"
2358 "WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL value"));
2359 return ;
2360 }
2361 psessionEntry->obssHT40ScanParam.OBSSScanPassiveTotalPerChannel =
2362 cfgValue;
2363 if (wlan_cfgGetInt(pMac, WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD ,
2364 &cfgValue) != eSIR_SUCCESS)
2365 {
2366 limLog(pMac, LOGE, FL("Fail to retrieve "
2367 "WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD value"));
2368 return ;
2369 }
2370 psessionEntry->obssHT40ScanParam.OBSSScanActivityThreshold = cfgValue;
Jeff Johnsone7245742012-09-05 17:12:55 -07002371 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002372}
2373
2374void limLogSessionStates(tpAniSirGlobal pMac)
2375{
2376#ifdef WLAN_DEBUG
2377 int i;
2378
2379 for(i = 0; i < pMac->lim.maxBssId; i++)
2380 {
2381 if(pMac->lim.gpSession[i].valid)
2382 {
Madan Mohan Koyyalamudi5695b502012-09-24 14:21:12 -07002383 PELOG1(limLog(pMac, LOG1, FL("Session[%d] sysRole(%d) limSmeState %d (prev sme state %d) mlm state %d (prev mlm state %d)"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002384 i, pMac->lim.gpSession[i].limSystemRole, pMac->lim.gpSession[i].limSmeState,
2385 pMac->lim.gpSession[i].limPrevSmeState, pMac->lim.gpSession[i].limMlmState,
2386 pMac->lim.gpSession[i].limPrevMlmState);)
2387 }
2388 }
2389#endif //ifdef WLAN_DEBUG
2390}