blob: 8d77500337a4bf4af2757ceec83aa864d938c0bd [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala9c070ad2013-01-08 21:16:34 -08002 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21/*
Jeff Johnson32d95a32012-09-10 13:15:23 -070022 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -070023 *
24 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
25 *
26 *
27 * Permission to use, copy, modify, and/or distribute this software for
28 * any purpose with or without fee is hereby granted, provided that the
29 * above copyright notice and this permission notice appear in all
30 * copies.
31 *
32 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
33 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
34 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
35 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
36 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
37 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
38 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39 * PERFORMANCE OF THIS SOFTWARE.
40 */
Jeff Johnson295189b2012-06-20 16:38:30 -070041/*
42 * Airgo Networks, Inc proprietary. All rights reserved.
43 * This file lim ProcessMessageQueue.cc contains the code
44 * for processing LIM message Queue.
45 * Author: Chandra Modumudi
46 * Date: 02/11/02
47 * History:-
48 * Date Modified by Modification Information
49 * --------------------------------------------------------------------
50 *
51 */
52#include "palTypes.h"
53#include "wniApi.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070054#include "wlan_qct_wdi_ds.h"
55#include "wlan_qct_pal_packet.h"
56#include "wlan_qct_wda.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070057
Jeff Johnson295189b2012-06-20 16:38:30 -070058#include "wniCfgSta.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070059#include "cfgApi.h"
60#include "sirCommon.h"
61#include "utilsApi.h"
62#include "limTypes.h"
63#include "limUtils.h"
64#include "limAssocUtils.h"
65#include "limPropExtsUtils.h"
66
67#include "limAdmitControl.h"
68#include "pmmApi.h"
69#include "limIbssPeerMgmt.h"
70#include "schApi.h"
71#include "limSession.h"
Yathishd8713192012-12-10 14:21:35 -080072#include "limSendMessages.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070073
74#if defined WLAN_FEATURE_VOWIFI
75#include "rrmApi.h"
76#endif
77#if defined FEATURE_WLAN_CCX
78#include "ccxApi.h"
79#endif
80
81#if defined WLAN_FEATURE_VOWIFI_11R
82#include "limFT.h"
83#endif
84
85#ifdef WMM_APSD
86#include "wmmApsd.h"
87#endif
88
Jeff Johnson295189b2012-06-20 16:38:30 -070089#include "vos_types.h"
90#include "vos_packet.h"
91#include "vos_memory.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070092
93void limLogSessionStates(tpAniSirGlobal pMac);
94
95/** -------------------------------------------------------------
96\fn defMsgDecision
97\brief The function decides whether to defer a message or not in limProcessMessage function
98\param tpAniSirGlobal pMac
99\param tSirMsgQ limMsg
100\param tSirMacTspecIE *ppInfo
101\return none
102 -------------------------------------------------------------*/
103
104tANI_U8 static
105defMsgDecision(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
106{
107
108
109/* this function should not changed */
Jeff Johnsone7245742012-09-05 17:12:55 -0700110 if(pMac->lim.gLimSmeState == eLIM_SME_OFFLINE_STATE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700111 {
112 // Defer processsing this message
113 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
114 {
Madan Mohan Koyyalamudi5695b502012-09-24 14:21:12 -0700115 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 -0700116 limMsg->type, limMsgStr(limMsg->type), pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
117 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
118 limLogSessionStates(pMac);
119 limHandleDeferMsgError(pMac, limMsg);
120 }
121 return true;
122 }
123
124 //When defer is requested then defer all the messages except HAL responses.
125 if((!limIsSystemInScanState(pMac)) && (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) &&
126 !pMac->lim.gLimSystemInScanLearnMode)
127 {
128 if((limMsg->type != WDA_ADD_BSS_RSP) &&
129 (limMsg->type != WDA_DELETE_BSS_RSP) &&
130 (limMsg->type != WDA_ADD_STA_RSP) &&
131 (limMsg->type != WDA_ADD_STA_SELF_RSP) &&
132 (limMsg->type != WDA_DEL_STA_SELF_RSP) &&
133 (limMsg->type != WDA_DELETE_STA_RSP)&&
134 (limMsg->type != WDA_SET_BSSKEY_RSP)&&
135 (limMsg->type != WDA_SET_STAKEY_RSP)&&
136 (limMsg->type != WDA_SET_STA_BCASTKEY_RSP) &&
Jeff Johnson295189b2012-06-20 16:38:30 -0700137 (limMsg->type != eWNI_SME_START_REQ) &&
138 (limMsg->type != WDA_AGGR_QOS_RSP) &&
139 (limMsg->type != WDA_REMOVE_BSSKEY_RSP) &&
140 (limMsg->type != WDA_REMOVE_STAKEY_RSP) &&
141 (limMsg->type != WDA_SET_MIMOPS_RSP)&&
142 (limMsg->type != WDA_ADDBA_RSP) &&
143 (limMsg->type != WDA_ENTER_BMPS_RSP) &&
144 (limMsg->type != WDA_EXIT_BMPS_RSP) &&
145 (limMsg->type != WDA_ENTER_IMPS_RSP) &&
146 (limMsg->type != WDA_EXIT_IMPS_RSP) &&
147 (limMsg->type != WDA_ENTER_UAPSD_RSP) &&
148 (limMsg->type != WDA_EXIT_UAPSD_RSP) &&
149 (limMsg->type != WDA_WOWL_ENTER_RSP) &&
150 (limMsg->type != WDA_WOWL_EXIT_RSP) &&
151 (limMsg->type != WDA_SWITCH_CHANNEL_RSP) &&
Jeff Johnson295189b2012-06-20 16:38:30 -0700152 (limMsg->type != WDA_P2P_NOA_ATTR_IND) &&
Viral Modid871f222013-03-06 02:25:31 -0800153 (limMsg->type != WDA_P2P_NOA_START_IND) &&
Jeff Johnsone7245742012-09-05 17:12:55 -0700154#ifdef FEATURE_OEM_DATA_SUPPORT
155 (limMsg->type != WDA_START_OEM_DATA_RSP) &&
156#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700157 (limMsg->type != WDA_ADD_TS_RSP))
158 {
159 PELOG1(limLog(pMac, LOG1, FL("Defer the current message %s , gLimProcessDefdMsgs is false and system is not in scan/learn mode\n"),
160 limMsgStr(limMsg->type));)
161
162 // Defer processsing this message
163 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
164 {
Madan Mohan Koyyalamudi5695b502012-09-24 14:21:12 -0700165 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 -0700166 limMsg->type, limMsgStr(limMsg->type), pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
167 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
168 limLogSessionStates(pMac);
169 limHandleDeferMsgError(pMac, limMsg);
170
171 }
172 return true;
173 }
174 }
175 return false;
176}
177
178/*
179* Beacon Handling Cases:
180* during scanning, when no session is active:
181* handled by limHandleFramesInScanState before __limHandleBeacon call is invoked.
182* during scanning, when any session is active, but beacon/Pr does not belong to that session, psessionEntry will be null.
183* handled by limHandleFramesInScanState before __limHandleBeacon call is invoked.
184* during scanning, when any session is active, and beacon/Pr belongs to one of the session, psessionEntry will not be null.
185* handled by limHandleFramesInScanState before __limHandleBeacon call is invoked.
186* Not scanning, no session:
187* there should not be any beacon coming, if coming, should be dropped.
188* Not Scanning,
189*/
190static void
191__limHandleBeacon(tpAniSirGlobal pMac, tpSirMsgQ pMsg, tpPESession psessionEntry)
192{
193 /* checking for global SME state...*/
194 tANI_U8 *pRxPacketInfo;
195 limGetBDfromRxPacket(pMac, pMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo);
196
197 //This function should not be called if beacon is received in scan state.
198 //So not doing any checks for the global state.
199
200 if(psessionEntry == NULL)
201 {
202 schBeaconProcess(pMac, pRxPacketInfo, NULL);
203 }
204 else if( (psessionEntry->limSmeState == eLIM_SME_LINK_EST_STATE) ||
205 (psessionEntry->limSmeState == eLIM_SME_NORMAL_STATE))
206 {
207 schBeaconProcess(pMac, pRxPacketInfo, psessionEntry);
208 }
209 else
210 limProcessBeaconFrame(pMac, pRxPacketInfo, psessionEntry);
211
212 return;
213}
214
215
216//Fucntion prototype
217void limProcessNormalHddMsg(tpAniSirGlobal pMac, tSirMsgQ *pLimMsg, tANI_U8 fRspReqd);
218
219/**
Jeff Johnson295189b2012-06-20 16:38:30 -0700220 * limDeferMsg()
221 *
222 *FUNCTION:
223 * This function is called to defer the messages received
224 * during Learn mode
225 *
226 *LOGIC:
227 * NA
228 *
229 *ASSUMPTIONS:
230 * NA
231 *
232 *NOTE:
233 * NA
234 *
235 * @param pMac - Pointer to Global MAC structure
236 * @param pMsg of type tSirMsgQ - Pointer to the message structure
237 * @return None
238 */
239
240tANI_U32
241limDeferMsg(tpAniSirGlobal pMac, tSirMsgQ *pMsg)
242{
243 tANI_U32 retCode = TX_SUCCESS;
Jeff Johnson8347b442013-03-07 08:15:44 -0800244
245 retCode = limWriteDeferredMsgQ(pMac, pMsg);
246
Jeff Johnson295189b2012-06-20 16:38:30 -0700247 if (retCode == TX_SUCCESS)
Jeff Johnson8347b442013-03-07 08:15:44 -0800248 {
249 MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DEFERRED));)
250 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700251 else
Jeff Johnson8347b442013-03-07 08:15:44 -0800252 {
253 MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DROPPED));)
254 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700255
256 return retCode;
257} /*** end limDeferMsg() ***/
258
259
260
261/**
262 * limHandleFramesInScanState()
263 *
264 *FUNCTION:
265 * This function is called to process 802.11 frames
266 * received by LIM in scan state.
267 *
268 *LOGIC:
269 * NA
270 *
271 *ASSUMPTIONS:
272 * NA
273 *
274 *NOTE:
275 * NA
276 *
277 * @param pMac - Pointer to Global MAC structure
278 * @param limMsg - Received message
279 * @param pRxPacketInfo - Pointer to Rx packet info structure
280 * @param deferMsg - Indicates whether the frame shall be deferred
281 * @return None
282 */
283
284static void
285limHandleFramesInScanState(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pRxPacketInfo, tANI_U8 *deferMsg, tpPESession psessionEntry)
286{
287 tSirMacFrameCtl fc;
288 tpSirMacMgmtHdr pHdr;
Jeff Johnson295189b2012-06-20 16:38:30 -0700289
290 *deferMsg = false;
291 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
292 fc = pHdr->fc;
293 limLog( pMac, LOG2, FL("ProtVersion %d, Type %d, Subtype %d\n"),
294 fc.protVer, fc.type, fc.subType );
295
Jeff Johnson295189b2012-06-20 16:38:30 -0700296 // defer all message in scan state except for Beacons and Probe Response
297 if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_BEACON))
298 {
299 if (psessionEntry == NULL)
300 limProcessBeaconFrameNoSession(pMac, pRxPacketInfo);
301 else
302 limProcessBeaconFrame(pMac, pRxPacketInfo,psessionEntry);
303 }
304 else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_PROBE_RSP))
305 {
306 if (psessionEntry == NULL)
307 limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo);
308 else
309 limProcessProbeRspFrame(pMac, pRxPacketInfo,psessionEntry);
310 }
311 else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_PROBE_REQ))
312 {
313 limProcessProbeReqFrame_multiple_BSS(pMac, pRxPacketInfo, psessionEntry);
314 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700315 else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_ACTION))
316 {
317 limProcessActionFrameNoSession( pMac, pRxPacketInfo);
318 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700319 else
320 {
321 *deferMsg = true;
322 return;
323 }
324
Jeff Johnson295189b2012-06-20 16:38:30 -0700325 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr);
326 return;
327
328} /*** end limHandleFramesInScanState() ***/
329
330/** ------------------------------------------------------------
331\brief This function handles Unknown Unicast (A2 Index)
332\ packets.
333\param tpAniSirGlobal pMac Global Mac data structure
334\param void *pRxPacketInfo Pointer to Buffer Descriptor
335\return none
336\
337\ -------------------------------------------------------------- */
338static void limHandleUnknownA2IndexFrames(tpAniSirGlobal pMac, void *pRxPacketInfo,tpPESession psessionEntry)
339{
Jeff Johnson295189b2012-06-20 16:38:30 -0700340 /* addr2 mismatch interrupt occurred this means previous
341 disassociation was not successful
342 In Volans pRxPacketInfo only contains pointer 48-bit address2 field */
343 /*Send disassociation message again*/
344 //Dinesh need one more arguement.
345 //limSendDisassocMgmtFrame(pMac, eSIR_MAC_CLASS3_FRAME_FROM_NON_ASSOC_STA_REASON,(tANI_U8 *) pRxPacketInfo);
Mohit Khannac0b992f2012-12-04 15:08:18 -0800346 //TODO: verify this
Jeff Johnson295189b2012-06-20 16:38:30 -0700347 //This could be a public action frame.
348 if( psessionEntry->limSystemRole == eLIM_P2P_DEVICE_ROLE )
349 limProcessActionFrameNoSession(pMac, (tANI_U8 *) pRxPacketInfo);
Mohit Khannac0b992f2012-12-04 15:08:18 -0800350
351#ifdef FEATURE_WLAN_TDLS
352 {
353 tpSirMacDataHdr3a pMacHdr;
354 pMacHdr = WDA_GET_RX_MPDUHEADER3A(pRxPacketInfo);
355
356 if (limIsGroupAddr(pMacHdr->addr2))
357 {
358 PELOG2(limLog(pMac, LOG2, FL("Ignoring A2 Invalid Packet received for MC/BC:\n"));
359 limPrintMacAddr(pMac, pMacHdr->addr2, LOG2);)
360
361 return;
362 }
363 /* TDLS_hklee: move down here to reject Addr2 == Group (first checking above)
364 and also checking if SystemRole == STA */
365 if (psessionEntry->limSystemRole == eLIM_STA_ROLE)
366 {
367 /* ADD handling of Public Action Frame */
368 LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, \
369 ("limHandleUnknownA2IndexFrames: type=0x%x, subtype=0x%x\n"),pMacHdr->fc.type, pMacHdr->fc.subType));
370 switch (pMacHdr->fc.type)
371 {
372 case SIR_MAC_MGMT_FRAME:
373 {
374 switch (pMacHdr->fc.subType)
375 {
376 case SIR_MAC_MGMT_ACTION:
377 {
378 limProcessActionFrame(pMac, pRxPacketInfo, psessionEntry) ;
379 break ;
380 }
381 default:
382 {
383 break ;
384 }
385 }
386 }
387 default:
388 {
389 break ;
390 }
391 }
392 }
393 }
394#endif
395
Jeff Johnson295189b2012-06-20 16:38:30 -0700396
397 return;
398}
399
Jeff Johnson295189b2012-06-20 16:38:30 -0700400/**
401 * limCheckMgmtRegisteredFrames()
402 *
403 *FUNCTION:
404 * This function is called to process to check if received frame match with
405 * any of the registered frame from HDD. If yes pass this frame to SME.
406 *
407 *LOGIC:
408 *
409 *ASSUMPTIONS:
410 *
411 *NOTE:
412 *
413 * @param pMac Pointer to Global MAC structure
414 * @param *pBd Pointer to the received Buffer Descriptor+payload
415 * @param *psessionEntry Pointer to session on which packet is received
416 * @return None
417 */
418static tANI_BOOLEAN
419limCheckMgmtRegisteredFrames(tpAniSirGlobal pMac, tANI_U8 *pBd,
420 tpPESession psessionEntry)
421{
422 tSirMacFrameCtl fc;
423 tpSirMacMgmtHdr pHdr;
424 tANI_U8 *pBody;
425 tpLimMgmtFrameRegistration pLimMgmtRegistration = NULL, pNext = NULL;
426 tANI_U16 frameType;
427 tANI_U16 framelen;
428 tANI_U8 type,subType;
429 tANI_BOOLEAN match = VOS_FALSE;
430 VOS_STATUS vosStatus;
431
432 pHdr = WDA_GET_RX_MAC_HEADER(pBd);
433 fc = pHdr->fc;
434 frameType = (fc.type << 2 ) | (fc.subType << 4);
435 pBody = WDA_GET_RX_MPDU_DATA(pBd);
436 framelen = WDA_GET_RX_PAYLOAD_LEN(pBd);
437
438 vos_list_peek_front(&pMac->lim.gLimMgmtFrameRegistratinQueue,
439 (vos_list_node_t**)&pLimMgmtRegistration);
440
441 while(pLimMgmtRegistration != NULL)
442 {
443 type = (pLimMgmtRegistration->frameType >> 2) & 0x03;
444 subType = (pLimMgmtRegistration->frameType >> 4) & 0x0f;
445 if ( (type == SIR_MAC_MGMT_FRAME) && (fc.type == SIR_MAC_MGMT_FRAME)
446 && (subType == SIR_MAC_MGMT_RESERVED15) )
447 {
448 limLog( pMac, LOG3,
449 FL("rcvd frame match with SIR_MAC_MGMT_RESERVED15\n"));
450 match = VOS_TRUE;
451 break;
452 }
453
454 if (pLimMgmtRegistration->frameType == frameType)
455 {
456 if (pLimMgmtRegistration->matchLen > 0)
457 {
458 if (pLimMgmtRegistration->matchLen <= framelen)
459 {
460 if (palEqualMemory(pMac, pLimMgmtRegistration->matchData,
461 pBody, pLimMgmtRegistration->matchLen))
462 {
Madan Mohan Koyyalamudic537df22012-10-22 15:07:08 -0700463 /* found match! */
464 match = VOS_TRUE;
465 break;
Jeff Johnson295189b2012-06-20 16:38:30 -0700466 }
Madan Mohan Koyyalamudic537df22012-10-22 15:07:08 -0700467 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700468 }
469 else
470 {
471 /* found match! */
472 match = VOS_TRUE;
473 break;
474 }
475 }
476
477 vosStatus =
478 vos_list_peek_next ( &pMac->lim.gLimMgmtFrameRegistratinQueue,
479 (vos_list_node_t*) pLimMgmtRegistration,
480 (vos_list_node_t**) &pNext );
481 pLimMgmtRegistration = pNext;
482 pNext = NULL;
483 }
484
485 if (match)
486 {
487 limLog( pMac, LOG1,
488 FL("rcvd frame match with registered frame params\n"));
489
490 /* Indicate this to SME */
491 limSendSmeMgmtFrameInd( pMac, pHdr->fc.subType, (tANI_U8*)pHdr,
492 WDA_GET_RX_PAYLOAD_LEN(pBd) + sizeof(tSirMacMgmtHdr),
493 pLimMgmtRegistration->sessionId,
Chilam NGde0b4112013-01-19 12:27:36 +0530494 WDA_GET_RX_CH(pBd), psessionEntry, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -0700495
496 if ( (type == SIR_MAC_MGMT_FRAME) && (fc.type == SIR_MAC_MGMT_FRAME)
497 && (subType == SIR_MAC_MGMT_RESERVED15) )
498 {
499 // These packets needs to be processed by PE/SME as well as HDD.
500 // If it returns TRUE here, the packet is forwarded to HDD only.
501 match = VOS_FALSE;
502 }
503 }
504
505 return match;
506} /*** end limCheckMgmtRegisteredFrames() ***/
Jeff Johnson295189b2012-06-20 16:38:30 -0700507
508
509/**
510 * limHandle80211Frames()
511 *
512 *FUNCTION:
513 * This function is called to process 802.11 frames
514 * received by LIM.
515 *
516 *LOGIC:
517 * NA
518 *
519 *ASSUMPTIONS:
520 * NA
521 *
522 *NOTE:
523 * NA
524 *
525 * @param pMac - Pointer to Global MAC structure
526 * @param pMsg of type tSirMsgQ - Pointer to the message structure
527 * @return None
528 */
529
530static void
531limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg)
532{
533 tANI_U8 *pRxPacketInfo = NULL;
534 tSirMacFrameCtl fc;
535 tpSirMacMgmtHdr pHdr=NULL;
536 tpPESession psessionEntry=NULL;
537 tANI_U8 sessionId;
538 tAniBool isFrmFt = FALSE;
539 tANI_U16 fcOffset = WLANHAL_RX_BD_HEADER_SIZE;
540
541 *pDeferMsg= false;
542 limGetBDfromRxPacket(pMac, limMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo);
543
544 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
545 isFrmFt = WDA_GET_RX_FT_DONE(pRxPacketInfo);
546 fcOffset = (v_U8_t)WDA_GET_RX_MPDU_HEADER_OFFSET(pRxPacketInfo);
547 fc = pHdr->fc;
548
Mohit Khanna23863762012-09-11 17:40:09 -0700549 limLog( pMac, LOG4, FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d\n"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700550 fc.protVer, fc.type, fc.subType, WDA_GET_RX_MAC_RATE_IDX(pRxPacketInfo));
551
552
553#ifdef FEATURE_WLAN_CCX
554 if (fc.type == SIR_MAC_DATA_FRAME && isFrmFt)
555 {
556#if 0 // CCX TBD Need to PORT
557 tpSirMacDot3Hdr pDataFrmHdr;
558
559 pDataFrmHdr = (tpSirMacDot3Hdr)((tANI_U8 *)pBD+ WLANHAL_RX_BD_GET_MPDU_H_OFFSET(pBD));
560 if((psessionEntry = peFindSessionByBssid(pMac,pDataFrmHdr->sa,&sessionId))== NULL)
561 {
562 limLog( pMac, LOGE, FL("Session not found for Frm type %d, subtype %d, SA: "), fc.type, fc.subType);
563 limPrintMacAddr(pMac, pDataFrmHdr->sa, LOGE);
564 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pBD, limMsg->bodyptr);
565 return;
566 }
567
568 if (!psessionEntry->isCCXconnection)
569 {
570 limLog( pMac, LOGE, FL("LIM received Type %d, Subtype %d in Non CCX connection\n"),
571 fc.type, fc.subType);
572 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pBD, limMsg->bodyptr);
573 return;
574 }
575 limLog( pMac, LOGE, FL("Processing IAPP Frm from SA:"));
576 limPrintMacAddr(pMac, pDataFrmHdr->sa, LOGE);
577#else
578 printk("%s: Need to port handling of IAPP frames to PRIMA for CCX\n", __func__);
579#endif
580
581
582 } else
583#endif
584 /* Added For BT-AMP Support */
585 if((psessionEntry = peFindSessionByBssid(pMac,pHdr->bssId,&sessionId))== NULL)
586 {
587#ifdef WLAN_FEATURE_VOWIFI_11R
588 if (fc.subType == SIR_MAC_MGMT_AUTH)
589 {
590#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
Varun Reddy Yeturu9163b672013-02-11 14:05:06 -0800591 limLog( pMac, LOG1, FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700592 fc.protVer, fc.type, fc.subType, WDA_GET_RX_MAC_RATE_IDX(pRxPacketInfo));
Varun Reddy Yeturu9163b672013-02-11 14:05:06 -0800593 limPrintMacAddr(pMac, pHdr->bssId, LOG1);
Jeff Johnson295189b2012-06-20 16:38:30 -0700594#endif
595 if (limProcessAuthFrameNoSession(pMac, pRxPacketInfo, limMsg->bodyptr) == eSIR_SUCCESS)
596 {
597 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr);
598 return;
599 }
600 }
601#endif
602 if((fc.subType != SIR_MAC_MGMT_PROBE_RSP )&&
603 (fc.subType != SIR_MAC_MGMT_BEACON)&&
604 (fc.subType != SIR_MAC_MGMT_PROBE_REQ)
Jeff Johnson295189b2012-06-20 16:38:30 -0700605 && (fc.subType != SIR_MAC_MGMT_ACTION ) //Public action frame can be received from non-associated stations.
Jeff Johnson295189b2012-06-20 16:38:30 -0700606 )
607 {
608
609 if((psessionEntry = peFindSessionByPeerSta(pMac,pHdr->sa,&sessionId))== NULL)
610 {
611 limLog(pMac, LOG1, FL("session does not exist for given bssId\n"));
612 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr);
613 return;
614 }
Gopichand Nakkala035315f2013-03-20 23:32:50 +0530615 }
616 // For p2p resp frames search for valid session with DA as
617 // BSSID will be SA and session will be present with DA only
618 if(fc.subType == SIR_MAC_MGMT_ACTION )
619 {
620 psessionEntry = peFindSessionByBssid(pMac,pHdr->da,&sessionId);
621 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700622 }
623
624
Jeff Johnson295189b2012-06-20 16:38:30 -0700625 /* Check if frame is registered by HDD */
626 if(limCheckMgmtRegisteredFrames(pMac, pRxPacketInfo, psessionEntry))
627 {
628 limLog( pMac, LOG1, FL("Received frame is passed to SME\n"));
629 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr);
630 return;
631 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700632
633
Jeff Johnson295189b2012-06-20 16:38:30 -0700634
635 if (fc.protVer != SIR_MAC_PROTOCOL_VERSION)
636 { // Received Frame with non-zero Protocol Version
637 limLog(pMac, LOGE, FL("Unexpected frame with protVersion %d received\n"),
638 fc.protVer);
639 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr);
640#ifdef WLAN_DEBUG
641 pMac->lim.numProtErr++;
642#endif
643 return;
644 }
645
646
647 if (limIsSystemInScanState(pMac))
648 {
649 limHandleFramesInScanState(pMac, limMsg, pRxPacketInfo, pDeferMsg, psessionEntry);
650 return;
651 }
652
653/* Chance of crashing : to be done BT-AMP ........happens when broadcast probe req is received */
654
655#if 0
656 if (psessionEntry->limSystemRole == eLIM_UNKNOWN_ROLE) {
657 limLog( pMac, LOGW, FL( "gLimSystemRole is %d. Exiting...\n" ),psessionEntry->limSystemRole );
658 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr);
659
660#ifdef WLAN_DEBUG
661 pMac->lim.numProtErr++;
662#endif
663 return;
664 }
665 #endif //HACK to continue scanning
666
667
668#ifdef WLAN_DEBUG
669 pMac->lim.numMAC[fc.type][fc.subType]++;
670#endif
671
672 switch (fc.type)
673 {
674 case SIR_MAC_MGMT_FRAME:
675 {
676 #if 0 //TBD-RAJESH fix this
677 if (limIsReassocInProgress( pMac,psessionEntry) && (fc.subType != SIR_MAC_MGMT_DISASSOC) &&
678 (fc.subType != SIR_MAC_MGMT_DEAUTH) && (fc.subType != SIR_MAC_MGMT_REASSOC_RSP))
679 {
680 limLog(pMac, LOGE, FL("Frame with Type - %d, Subtype - %d received in ReAssoc Wait state, dropping...\n"),
681 fc.type, fc.subType);
682 return;
683 }
684 #endif //HACK to continue scanning
685 // Received Management frame
686 switch (fc.subType)
687 {
688 case SIR_MAC_MGMT_ASSOC_REQ:
689 // Make sure the role supports Association
690 if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700691 || (psessionEntry->limSystemRole == eLIM_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700692 )
693 limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_ASSOC, psessionEntry);
694
695 else
696 {
697 // Unwanted messages - Log error
698 limLog(pMac, LOGE, FL("unexpected message received %X\n"),limMsg->type);
699 limPrintMsgName(pMac, LOGE, limMsg->type);
700 }
701 break;
702
703 case SIR_MAC_MGMT_ASSOC_RSP:
704 limProcessAssocRspFrame(pMac, pRxPacketInfo, LIM_ASSOC,psessionEntry);
705 break;
706
707 case SIR_MAC_MGMT_REASSOC_REQ:
708 // Make sure the role supports Reassociation
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_REASSOC, psessionEntry);
713 }
714 else
715 {
716 // Unwanted messages - Log error
717 limLog(pMac, LOGE, FL("unexpected message received %X\n"),limMsg->type);
718 limPrintMsgName(pMac, LOGE, limMsg->type);
719 }
720 break;
721
722 case SIR_MAC_MGMT_REASSOC_RSP:
723 limProcessAssocRspFrame(pMac, pRxPacketInfo, LIM_REASSOC,psessionEntry);
724 break;
725
726 case SIR_MAC_MGMT_PROBE_REQ:
727 limProcessProbeReqFrame_multiple_BSS(pMac, pRxPacketInfo,psessionEntry);
728 break;
729
730 case SIR_MAC_MGMT_PROBE_RSP:
731 if(psessionEntry == NULL)
732 limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo);
733 else
734 limProcessProbeRspFrame(pMac, pRxPacketInfo, psessionEntry);
735 break;
736
737 case SIR_MAC_MGMT_BEACON:
738 __limHandleBeacon(pMac, limMsg,psessionEntry);
739 break;
740
741 case SIR_MAC_MGMT_DISASSOC:
742 limProcessDisassocFrame(pMac, pRxPacketInfo,psessionEntry);
743 break;
744
745 case SIR_MAC_MGMT_AUTH:
746 limProcessAuthFrame(pMac, pRxPacketInfo,psessionEntry);
747 break;
748
749 case SIR_MAC_MGMT_DEAUTH:
750 limProcessDeauthFrame(pMac, pRxPacketInfo,psessionEntry);
751 break;
752
753 case SIR_MAC_MGMT_ACTION:
Jeff Johnson295189b2012-06-20 16:38:30 -0700754 if(psessionEntry == NULL)
755 limProcessActionFrameNoSession(pMac, pRxPacketInfo);
756 else
757 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700758 if (WDA_GET_RX_UNKNOWN_UCAST(pRxPacketInfo))
759 limHandleUnknownA2IndexFrames(pMac, pRxPacketInfo,psessionEntry);
760 else
761 limProcessActionFrame(pMac, pRxPacketInfo,psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -0700762 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700763 break;
764 default:
765 // Received Management frame of 'reserved' subtype
766 break;
767 } // switch (fc.subType)
768
769 }
770 break;
Jeff Johnson295189b2012-06-20 16:38:30 -0700771 case SIR_MAC_DATA_FRAME:
772 {
Mohit Khannac0b992f2012-12-04 15:08:18 -0800773#ifdef FEATURE_WLAN_TDLS_INTERNAL
774 /*
775 * if we reach here, following cases are possible.
776 * Possible cases: a) if frame translation is disabled.
777 * b) Some frame with ADRR2 filter enabled may come
778 * here.
779 */
780 tANI_U8 *dataOffset = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
781 tANI_U8 *rfc1042Hdr = (tANI_U8 *)(dataOffset + RFC1042_HDR_LENGTH) ;
782 tANI_U16 ethType = GET_BE16(rfc1042Hdr) ;
783 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
784 ("TDLS frame with 80211 Header\n")) ;
785 if(ETH_TYPE_89_0d == ethType)
786 {
787 tANI_U8 payloadType = (rfc1042Hdr + ETH_TYPE_LEN)[0] ;
788 if(PAYLOAD_TYPE_TDLS == payloadType)
789 {
790 limProcessTdlsFrame(pMac, (tANI_U32*)pRxPacketInfo) ;
791 }
792 }
793#endif
794#ifdef FEATURE_WLAN_CCX
Jeff Johnson295189b2012-06-20 16:38:30 -0700795 /* We accept data frame (IAPP frame) only if Session is
796 * present and ccx connection is established on that
797 * session
798 */
799 if (psessionEntry && psessionEntry->isCCXconnection) {
800 limProcessIappFrame(pMac, pRxPacketInfo, psessionEntry);
801 }
Mohit Khannac0b992f2012-12-04 15:08:18 -0800802#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700803 }
804 break;
Jeff Johnson295189b2012-06-20 16:38:30 -0700805 default:
806 // Received frame of type 'reserved'
807 break;
808
809 } // switch (fc.type)
810
811 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr) ;
812 return;
813} /*** end limHandle80211Frames() ***/
814
815
816/**
817 * limProcessAbortScanInd()
818 *
819 *FUNCTION:
820 * This function is called from HDD to abort the scan which is presently being run
821 *
822 *
823 *NOTE:
824 *
825 * @param pMac Pointer to Global MAC structure
826 * @param *pMsgBuf A pointer to the SME message buffer
827 * @return None
828 */
829void
830limProcessAbortScanInd(tpAniSirGlobal pMac)
831{
832#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
833 limDiagEventReport(pMac, WLAN_PE_DIAG_SCAN_ABORT_IND_EVENT, NULL, 0, 0);
834#endif //FEATURE_WLAN_DIAG_SUPPORT
835
836 /* Deactivate the gLimBackgroundScanTimer as part of the abort scan.
837 * SME should send WNI_CFG_BACKGROUND_SCAN_PERIOD indication
838 * to start the background scan again
839 */
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -0700840 PELOG2(limLog(pMac, LOG2, FL("Processing AbortScan Ind"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700841
842 limAbortBackgroundScan(pMac);
843
844 /* Abort the scan if its running, else just return */
845 if(limIsSystemInScanState(pMac))
846 {
847 if( (eLIM_HAL_INIT_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
848 (eLIM_HAL_START_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
849 (eLIM_HAL_END_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
850 (eLIM_HAL_FINISH_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState) )
851 {
852 //Simply signal we need to abort
853 limLog( pMac, LOGW, FL(" waiting for HAL, simply signal abort gLimHalScanState = %d\n"), pMac->lim.gLimHalScanState );
854 pMac->lim.abortScan = 1;
855 }
856 else
857 {
858 //Force abort
859 limLog( pMac, LOGW, FL(" Force aborting scan\n") );
860 pMac->lim.abortScan = 0;
861 limDeactivateAndChangeTimer(pMac, eLIM_MIN_CHANNEL_TIMER);
862 limDeactivateAndChangeTimer(pMac, eLIM_MAX_CHANNEL_TIMER);
863 //Set the resume channel to Any valid channel (invalid).
864 //This will instruct HAL to set it to any previous valid channel.
865 peSetResumeChannel(pMac, 0, 0);
866 limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE);
867 }
868 }
869 return;
870}
871
872/**
873 * limMessageProcessor
874 *
875 *FUNCTION:
876 * Wrapper function for limProcessMessages when handling messages received by LIM.
877 * Could either defer messages or process them.
878 * @param pMac Pointer to Global MAC structure
879 * @param limMsg Received LIM message
880 * @return None
881 */
882
883void limMessageProcessor(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
884{
885 if (eLIM_MLM_OFFLINE_STATE == pMac->lim.gLimMlmState)
886 {
887 peFreeMsg(pMac, limMsg);
888 return;
889 }
890
891 if (!defMsgDecision(pMac, limMsg))
892 {
893 limProcessMessages(pMac, limMsg);
Jeff Johnson295189b2012-06-20 16:38:30 -0700894 // process deferred message queue if allowed
895 {
896 if ( (! (pMac->lim.gLimAddtsSent))
897 &&
898 (! (limIsSystemInScanState(pMac)))
899 )
900 {
901 if (true == GET_LIM_PROCESS_DEFD_MESGS(pMac))
902 limProcessDeferredMessageQueue(pMac);
903 }
904 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700905 }
906}
907
Jeff Johnsone7245742012-09-05 17:12:55 -0700908#ifdef FEATURE_OEM_DATA_SUPPORT
909
910void limOemDataRspHandleResumeLinkRsp(tpAniSirGlobal pMac, eHalStatus status, tANI_U32* mlmOemDataRsp)
911{
912 if(status != eHAL_STATUS_SUCCESS)
913 {
914 limLog(pMac, LOGE, FL("OEM Data Rsp failed to get the response for resume link\n"));
915 }
916
917 if(NULL != pMac->lim.gpLimMlmOemDataReq)
918 {
919 palFreeMemory(pMac->hHdd, pMac->lim.gpLimMlmOemDataReq);
920 pMac->lim.gpLimMlmOemDataReq = NULL;
921 }
922
923 //"Failure" status doesn't mean that Oem Data Rsp did not happen
924 //and hence we need to respond to upper layers. Only Resume link is failed, but
925 //we got the oem data response already.
926 //Post the meessage to MLM
927 limPostSmeMessage(pMac, LIM_MLM_OEM_DATA_CNF, (tANI_U32*)(mlmOemDataRsp));
928
929 return;
930}
931
932void limProcessOemDataRsp(tpAniSirGlobal pMac, tANI_U32* body)
933{
934 eHalStatus status = eHAL_STATUS_SUCCESS;
935 tpLimMlmOemDataRsp mlmOemDataRsp = NULL;
936 tpStartOemDataRsp oemDataRsp = NULL;
937
938 //Process all the messages for the lim queue
939 SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
940
941 oemDataRsp = (tpStartOemDataRsp)(body);
942
943 status = palAllocateMemory(pMac->hHdd, (void**)(&mlmOemDataRsp), sizeof(tLimMlmOemDataRsp));
944 if(status != eHAL_STATUS_SUCCESS)
945 {
946 limLog(pMac, LOGP, FL("could not allocate memory for mlmOemDataRsp\n"));
947 return;
948 }
949
950 //copy the memory into tLimMlmOemDataRsp and free the tStartOemDataRsp
951 //the structures tStartOemDataRsp and tLimMlmOemDataRsp have the same structure
952 palCopyMemory(pMac->hHdd, (void*)(mlmOemDataRsp), (void*)(oemDataRsp), sizeof(tLimMlmOemDataRsp));
953
954 //Now free the incoming memory
955 palFreeMemory(pMac->hHdd, (void*)(oemDataRsp));
956
957 limResumeLink(pMac, limOemDataRspHandleResumeLinkRsp, (tANI_U32*)mlmOemDataRsp);
958
959 return;
960}
961
962#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700963
964
965/**
966 * limProcessMessages
967 *
968 *FUNCTION:
969 * This function is called by limProcessMessageQueue function. This
970 * function processes messages received by LIM.
971 *
972 *LOGIC:
973 * Depending on the message type, corresponding function will be
974 * called, for example limProcessSmeMessages() will be called to
975 * process SME messages received from HDD/Upper layer software module.
976 *
977 *ASSUMPTIONS:
978 * NA
979 *
980 *NOTE:
981 * NA
982 *
983 * @param pMac Pointer to Global MAC structure
984 * @param limMsg Received LIM message
985 * @return None
986 */
987
988void
989limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
990{
991 tANI_U8 deferMsg = false;
992 tLinkStateParams *linkStateParams;
993#if defined WLAN_FEATURE_VOWIFI_11R
994 tpPESession pSession;
995#endif
996#if defined(ANI_DVT_DEBUG)
997 tSirMsgQ msgQ;
998#endif
999 if(pMac->gDriverType == eDRIVER_TYPE_MFG)
1000 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001001 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1002 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001003 return;
1004 }
1005#ifdef WLAN_DEBUG
1006 pMac->lim.numTot++;
1007#endif
1008
1009
1010 PELOG3(limLog(pMac, LOG3, FL("rcvd msgType = %s, sme state = %s, mlm state = %s\n"),
1011 limMsgStr(limMsg->type), limSmeStateStr(pMac->lim.gLimSmeState),
1012 limMlmStateStr(pMac->lim.gLimMlmState));)
1013
Jeff Johnsone7245742012-09-05 17:12:55 -07001014 MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(limMsg->type, LIM_MSG_PROCESSED));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001015
1016 switch (limMsg->type)
1017 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001018
1019 case SIR_LIM_UPDATE_BEACON:
1020 limUpdateBeacon(pMac);
1021 break;
1022
Jeff Johnson295189b2012-06-20 16:38:30 -07001023 case SIR_CFG_PARAM_UPDATE_IND:
1024 /// CFG parameter updated
1025 if (limIsSystemInScanState(pMac))
1026 {
1027 // System is in DFS (Learn) mode
1028 // Defer processsing this message
1029 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1030 {
1031 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)\n"),
1032 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1033 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
1034 limLogSessionStates(pMac);
1035 limPrintMsgName(pMac, LOGE, limMsg->type);
1036 }
1037 }
1038 else
1039 {
1040 limHandleCFGparamUpdate(pMac, limMsg->bodyval);
1041 }
1042
1043 break;
1044
1045 case WDA_INIT_SCAN_RSP:
1046 limProcessInitScanRsp(pMac, limMsg->bodyptr);
1047 break;
1048
1049 case WDA_START_SCAN_RSP:
1050 limProcessStartScanRsp(pMac, limMsg->bodyptr);
1051 break;
1052
1053 case WDA_END_SCAN_RSP:
1054 limProcessEndScanRsp(pMac, limMsg->bodyptr);
1055 break;
1056
1057 case WDA_FINISH_SCAN_RSP:
1058 limProcessFinishScanRsp(pMac, limMsg->bodyptr);
1059 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001060#ifdef FEATURE_OEM_DATA_SUPPORT
1061 case WDA_START_OEM_DATA_RSP:
1062 limProcessOemDataRsp(pMac, limMsg->bodyptr);
1063 break;
1064#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001065
1066 case WDA_SWITCH_CHANNEL_RSP:
1067 limProcessSwitchChannelRsp(pMac, limMsg->bodyptr);
1068 break;
1069
1070#ifdef ANI_SIR_IBSS_PEER_CACHING
1071 case WDA_IBSS_STA_ADD:
1072 limIbssStaAdd(pMac, limMsg->bodyptr);
1073 break;
1074#endif
1075 case SIR_BB_XPORT_MGMT_MSG:
1076 // These messages are from Peer MAC entity.
1077#ifdef WLAN_DEBUG
1078 pMac->lim.numBbt++;
1079#endif
1080
Jeff Johnson295189b2012-06-20 16:38:30 -07001081 {
1082 v_U16_t pktLen = 0;
1083 vos_pkt_t *pVosPkt;
1084 VOS_STATUS vosStatus;
1085 tSirMsgQ limMsgNew;
Mohit Khannac0b992f2012-12-04 15:08:18 -08001086#ifdef FEATURE_WLAN_TDLS_INTERNAL
1087 tANI_U32 *pBD = NULL ;
1088#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001089
1090 /* The original limMsg which we were deferring have the
1091 * bodyPointer point to 'BD' instead of 'Vos pkt'. If we don't make a copy
1092 * of limMsg, then vos_pkt_peek_data will overwrite the limMsg->bodyPointer.
1093 * and next time when we try to process the msg, we will try to use 'BD' as
1094 * 'Vos Pkt' which will cause a crash
1095 */
1096 palCopyMemory(pMac, (tANI_U8*)&limMsgNew, (tANI_U8*)limMsg, sizeof(tSirMsgQ));
1097 pVosPkt = (vos_pkt_t *)limMsgNew.bodyptr;
1098 vos_pkt_get_packet_length(pVosPkt, &pktLen);
1099
1100 vosStatus = WDA_DS_PeekRxPacketInfo( pVosPkt, (v_PVOID_t *)&limMsgNew.bodyptr, VOS_FALSE );
1101
1102 if( !VOS_IS_STATUS_SUCCESS(vosStatus) )
1103 {
1104 vos_pkt_return_packet(pVosPkt);
1105 break;
1106
1107 }
Mohit Khannac0b992f2012-12-04 15:08:18 -08001108#ifdef FEATURE_WLAN_TDLS_INTERNAL
1109 /*
1110 * TDLS frames comes as translated frames as well as
1111 * MAC 802.11 data frames..
1112 */
1113 limGetBDfromRxPacket(pMac, limMsgNew.bodyptr, &pBD);
1114 if(0 != WDA_GET_RX_FT_DONE(pBD))
1115 {
1116 /*
1117 * TODO: check for scanning state and set deferMesg flag
1118 * accordingly..
1119 */
1120 deferMsg = false ;
1121
1122 limProcessTdlsFrame(pMac, pBD) ;
1123 }
1124 else
1125#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001126 limHandle80211Frames(pMac, &limMsgNew, &deferMsg);
1127
1128 if ( deferMsg == true )
1129 {
1130 PELOG1(limLog(pMac, LOG1, FL("Defer message type=%X \n"), limMsg->type);)
1131 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1132 {
1133 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)\n"),
1134 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1135 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
1136 limLogSessionStates(pMac);
1137 limPrintMsgName(pMac, LOGE, limMsg->type);
1138 vos_pkt_return_packet(pVosPkt);
1139 }
1140 }
1141 else
1142 {
1143 /* PE is not deferring this 802.11 frame so we need to call vos_pkt_return.
1144 * Asumption here is when Rx mgmt frame processing is done,
1145 * voss packet could be freed here.
1146 */
1147 vos_pkt_return_packet(pVosPkt);
1148 }
1149 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001150 break;
1151
1152 case eWNI_SME_SCAN_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001153 case eWNI_SME_REMAIN_ON_CHANNEL_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001154 case eWNI_SME_DISASSOC_REQ:
1155 case eWNI_SME_DEAUTH_REQ:
1156 case eWNI_SME_STA_STAT_REQ:
1157 case eWNI_SME_AGGR_STAT_REQ:
1158 case eWNI_SME_GLOBAL_STAT_REQ:
1159 case eWNI_SME_STAT_SUMM_REQ:
1160 case eWNI_SME_GET_SCANNED_CHANNEL_REQ:
1161 case eWNI_SME_GET_STATISTICS_REQ:
Srinivas Girigowda2471d832013-01-25 13:33:11 -08001162#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
1163 case eWNI_SME_GET_ROAM_RSSI_REQ:
1164#endif
Jeff Johnsone7245742012-09-05 17:12:55 -07001165#ifdef FEATURE_OEM_DATA_SUPPORT
1166 case eWNI_SME_OEM_DATA_REQ:
1167#endif
Mohit Khannac0b992f2012-12-04 15:08:18 -08001168#ifdef FEATURE_WLAN_TDLS
1169 case eWNI_SME_TDLS_SEND_MGMT_REQ:
1170 case eWNI_SME_TDLS_ADD_STA_REQ:
1171 case eWNI_SME_TDLS_DEL_STA_REQ:
1172#endif
1173#ifdef FEATURE_WLAN_TDLS_INTERNAL
1174 case eWNI_SME_TDLS_DISCOVERY_START_REQ:
1175 case eWNI_SME_TDLS_LINK_START_REQ:
1176 case eWNI_SME_TDLS_TEARDOWN_REQ:
1177#endif
Gopichand Nakkala2b248b02013-03-07 17:05:07 +05301178 case eWNI_SME_RESET_AP_CAPS_CHANGED:
Jeff Johnson295189b2012-06-20 16:38:30 -07001179 // These messages are from HDD
1180 limProcessNormalHddMsg(pMac, limMsg, true); //need to response to hdd
1181 break;
1182
1183 case eWNI_SME_SCAN_ABORT_IND:
1184 vos_mem_free((v_VOID_t *)limMsg->bodyptr);
1185 limMsg->bodyptr = NULL;
1186 limProcessAbortScanInd(pMac);
1187 break;
1188
1189 case eWNI_SME_START_REQ:
1190 case eWNI_SME_SYS_READY_IND:
1191#ifndef WNI_ASKEY_NON_SUPPORT_FEATURE
1192 case eWNI_SME_JOIN_REQ:
1193#endif
1194 case eWNI_SME_AUTH_REQ:
1195 case eWNI_SME_REASSOC_REQ:
1196 case eWNI_SME_START_BSS_REQ:
1197 case eWNI_SME_STOP_BSS_REQ:
1198 case eWNI_SME_SWITCH_CHL_REQ:
1199 case eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ:
1200 case eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ:
1201 case eWNI_SME_SETCONTEXT_REQ:
1202 case eWNI_SME_REMOVEKEY_REQ:
1203#ifndef WNI_ASKEY_NON_SUPPORT_FEATURE
1204 case eWNI_SME_PROMISCUOUS_MODE_REQ:
1205#endif
1206 case eWNI_SME_DISASSOC_CNF:
1207 case eWNI_SME_DEAUTH_CNF:
1208 case eWNI_SME_ASSOC_CNF:
1209 case eWNI_SME_REASSOC_CNF:
1210 case eWNI_SME_ADDTS_REQ:
1211 case eWNI_SME_DELTS_REQ:
1212 case eWNI_SME_DEL_BA_PEER_IND:
1213 case eWNI_SME_SET_TX_POWER_REQ:
1214 case eWNI_SME_GET_TX_POWER_REQ:
1215 case eWNI_SME_GET_NOISE_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001216 case eWNI_SME_GET_ASSOC_STAS_REQ:
1217 case eWNI_SME_TKIP_CNTR_MEAS_REQ:
1218 case eWNI_SME_UPDATE_APWPSIE_REQ:
1219 case eWNI_SME_HIDE_SSID_REQ:
1220 case eWNI_SME_GET_WPSPBC_SESSION_REQ:
1221 case eWNI_SME_SET_APWPARSNIEs_REQ:
Madan Mohan Koyyalamudi167b95e2012-11-27 15:53:38 -08001222 case eWNI_SME_CHNG_MCC_BEACON_INTERVAL:
Jeff Johnson295189b2012-06-20 16:38:30 -07001223#if defined WLAN_FEATURE_VOWIFI
1224 case eWNI_SME_NEIGHBOR_REPORT_REQ_IND:
1225 case eWNI_SME_BEACON_REPORT_RESP_XMIT_IND:
1226#endif
1227#if defined FEATURE_WLAN_CCX
1228 case eWNI_SME_CCX_ADJACENT_AP_REPORT:
1229#endif
1230#ifdef WLAN_FEATURE_VOWIFI_11R
1231 case eWNI_SME_FT_UPDATE_KEY:
1232 case eWNI_SME_FT_PRE_AUTH_REQ:
1233 case eWNI_SME_FT_AGGR_QOS_REQ:
1234#endif
1235 case eWNI_SME_ADD_STA_SELF_REQ:
1236 case eWNI_SME_DEL_STA_SELF_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001237 case eWNI_SME_REGISTER_MGMT_FRAME_REQ:
1238 case eWNI_SME_UPDATE_NOA:
Jeff Johnson295189b2012-06-20 16:38:30 -07001239 // These messages are from HDD
1240 limProcessNormalHddMsg(pMac, limMsg, false); //no need to response to hdd
1241 break;
1242
1243 //Power Save Messages From HDD
1244 case eWNI_PMC_PWR_SAVE_CFG:
1245 case eWNI_PMC_ENTER_BMPS_REQ:
1246 case eWNI_PMC_EXIT_BMPS_REQ:
1247 case eWNI_PMC_ENTER_IMPS_REQ:
1248 case eWNI_PMC_EXIT_IMPS_REQ:
1249 case eWNI_PMC_ENTER_UAPSD_REQ:
1250 case eWNI_PMC_EXIT_UAPSD_REQ:
1251 case eWNI_PMC_ENTER_WOWL_REQ:
1252 case eWNI_PMC_EXIT_WOWL_REQ:
1253 case eWNI_PMC_WOWL_ADD_BCAST_PTRN:
1254 case eWNI_PMC_WOWL_DEL_BCAST_PTRN:
1255 pmmProcessMessage(pMac, limMsg);
1256 break;
1257
1258 case eWNI_PMC_SMPS_STATE_IND :
1259 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001260 if(limMsg->bodyptr){
1261 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1262 limMsg->bodyptr = NULL;
1263 }
1264 }
1265 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001266 case eWNI_SME_SEND_ACTION_FRAME_IND:
1267 limSendP2PActionFrame(pMac, limMsg);
1268 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1269 limMsg->bodyptr = NULL;
1270 break;
1271 case eWNI_SME_ABORT_REMAIN_ON_CHAN_IND:
1272 limAbortRemainOnChan(pMac);
1273 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1274 limMsg->bodyptr = NULL;
1275 break;
1276
Viral Modi9dc288a2012-12-10 13:09:21 -08001277 case SIR_HAL_P2P_NOA_START_IND:
1278 {
1279 tpPESession psessionEntry = &pMac->lim.gpSession[0];
1280 tANI_U8 i;
Viral Modid871f222013-03-06 02:25:31 -08001281 tANI_U8 p2pGOExists = 0;
Viral Modi9dc288a2012-12-10 13:09:21 -08001282
1283 limLog(pMac, LOG1, "LIM received NOA start %x\n", limMsg->type);
Viral Modid871f222013-03-06 02:25:31 -08001284
1285 /* Since insert NOA is done and NOA start msg received, we should deactivate the Insert NOA timer */
1286 limDeactivateAndChangeTimer(pMac, eLIM_INSERT_SINGLESHOT_NOA_TIMER);
1287
Viral Modi9dc288a2012-12-10 13:09:21 -08001288 for(i=0; i < pMac->lim.maxBssId; i++)
1289 {
1290 psessionEntry = &pMac->lim.gpSession[i];
1291 if ( (psessionEntry != NULL) && (psessionEntry->valid) &&
1292 (psessionEntry->pePersona == VOS_P2P_GO_MODE))
1293 { //Save P2P NOA start attributes for P2P Go persona
Viral Modid871f222013-03-06 02:25:31 -08001294 p2pGOExists = 1;
Viral Modi9dc288a2012-12-10 13:09:21 -08001295 palCopyMemory(pMac->hHdd, &psessionEntry->p2pGoPsNoaStartInd, limMsg->bodyptr, sizeof(tSirP2PNoaStart));
Viral Modid871f222013-03-06 02:25:31 -08001296 if (psessionEntry->p2pGoPsNoaStartInd.status != eHAL_STATUS_SUCCESS)
Viral Modi9dc288a2012-12-10 13:09:21 -08001297 {
Viral Modid871f222013-03-06 02:25:31 -08001298 limLog(pMac, LOGW, FL("GO NOA start failure status %d reported by FW."
1299 " - still go ahead with deferred sme req. This is just info\n"),
1300 psessionEntry->p2pGoPsNoaStartInd.status);
Viral Modi9dc288a2012-12-10 13:09:21 -08001301 }
Viral Modi9dc288a2012-12-10 13:09:21 -08001302 break;
1303 }
1304 }
Viral Modid871f222013-03-06 02:25:31 -08001305
1306 if (p2pGOExists == 0)
1307 {
1308 limLog(pMac, LOGW, FL("By the time, we received NOA start, GO is already removed."
1309 " - still go ahead with deferred sme req. This is just info\n"));
1310 }
1311
1312 /* We received the NOA start indication. Now we can send down the SME request which requires off-channel operation */
1313 limProcessRegdDefdSmeReqAfterNOAStart(pMac);
Viral Modi9dc288a2012-12-10 13:09:21 -08001314 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1315 limMsg->bodyptr = NULL;
Viral Modid871f222013-03-06 02:25:31 -08001316 }
Viral Modi9dc288a2012-12-10 13:09:21 -08001317 break;
Viral Modi9dc288a2012-12-10 13:09:21 -08001318
Jeff Johnson295189b2012-06-20 16:38:30 -07001319 case SIR_HAL_P2P_NOA_ATTR_IND:
1320 {
1321 tpPESession psessionEntry = &pMac->lim.gpSession[0];
1322 tANI_U8 i;
1323
Jeff Johnson295189b2012-06-20 16:38:30 -07001324 limLog(pMac, LOGW, FL("Received message Noa_ATTR %x\n"), limMsg->type);
1325 for(i=0; i < pMac->lim.maxBssId; i++)
1326 {
Viral Modi9dc288a2012-12-10 13:09:21 -08001327 psessionEntry = &pMac->lim.gpSession[i];
1328 if ( (psessionEntry != NULL) && (psessionEntry->valid) &&
Jeff Johnson295189b2012-06-20 16:38:30 -07001329 (psessionEntry->pePersona == VOS_P2P_GO_MODE))
1330 { //Save P2P attributes for P2P Go persona
1331
1332 palCopyMemory(pMac->hHdd,&psessionEntry->p2pGoPsUpdate, limMsg->bodyptr,sizeof(tSirP2PNoaAttr));
1333
1334
Madan Mohan Koyyalamudief91c9e2012-10-05 14:37:13 -07001335 limLog(pMac, LOG2, FL(" &psessionEntry->bssId%02x:%02x:%02x:%02x:%02x:%02x ctWin=%d oppPsFlag=%d\n"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001336 psessionEntry->bssId[0],
1337 psessionEntry->bssId[1],
1338 psessionEntry->bssId[2],
1339 psessionEntry->bssId[3],
1340 psessionEntry->bssId[4],
1341 psessionEntry->bssId[5],
1342 psessionEntry->p2pGoPsUpdate.ctWin,
1343 psessionEntry->p2pGoPsUpdate.oppPsFlag);
1344
Madan Mohan Koyyalamudief91c9e2012-10-05 14:37:13 -07001345 limLog(pMac, LOG2, FL(" uNoa1IntervalCnt=%d uNoa1Duration=%d uNoa1Interval=%d uNoa1StartTime=%d\n"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001346 psessionEntry->p2pGoPsUpdate.uNoa1IntervalCnt,
1347 psessionEntry->p2pGoPsUpdate.uNoa1Duration,
1348 psessionEntry->p2pGoPsUpdate.uNoa1Interval,
1349 psessionEntry->p2pGoPsUpdate.uNoa1StartTime);
1350
1351
1352 break;
1353 }
1354 }
1355
1356 }
1357 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1358 limMsg->bodyptr = NULL;
1359
1360 break;
1361
1362
Jeff Johnson295189b2012-06-20 16:38:30 -07001363 /* eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER Message comes after the
1364 * device comes out of full power for the full power request sent
1365 * because of channel switch with switch count as 0, so call the same
1366 * function used in timeout case(i.e SIR_LIM_CHANNEL_SWITCH_TIMEOUT)
1367 * for switching the channel*/
1368 case eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER:
Jeff Johnsone7245742012-09-05 17:12:55 -07001369 if ( !tx_timer_running(&pMac->lim.limTimers.gLimChannelSwitchTimer) )
1370 {
1371 limProcessChannelSwitchTimeout(pMac);
1372 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001373 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1374 limMsg->bodyptr = NULL;
1375 break;
1376
1377 //Power Save Related Messages From HAL
1378 case WDA_ENTER_BMPS_RSP:
1379 case WDA_EXIT_BMPS_RSP:
1380 case WDA_EXIT_BMPS_IND:
1381 case WDA_ENTER_IMPS_RSP:
1382 case WDA_EXIT_IMPS_RSP:
1383 case WDA_ENTER_UAPSD_RSP:
1384 case WDA_EXIT_UAPSD_RSP:
1385 case WDA_WOWL_ENTER_RSP:
1386 case WDA_WOWL_EXIT_RSP:
1387 pmmProcessMessage(pMac, limMsg);
1388 break;
1389
1390 case WDA_LOW_RSSI_IND:
1391 //limHandleLowRssiInd(pMac);
1392 break;
1393
1394 case WDA_BMPS_STATUS_IND:
1395 limHandleBmpsStatusInd(pMac);
1396 break;
1397
1398 case WDA_MISSED_BEACON_IND:
Leela Venkata Kiran Kumar Reddy Chirala949300d2013-02-27 19:50:05 -08001399 limHandleMissedBeaconInd(pMac, limMsg);
1400 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1401 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001402 break;
1403 case WDA_MIC_FAILURE_IND:
1404 limMicFailureInd(pMac, limMsg);
1405 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1406 limMsg->bodyptr = NULL;
1407 break;
1408
1409
Jeff Johnson295189b2012-06-20 16:38:30 -07001410
1411 case SIR_LIM_ADDTS_RSP_TIMEOUT:
1412 limProcessSmeReqMessages(pMac,limMsg);
1413 break;
1414#ifdef FEATURE_WLAN_CCX
1415 case SIR_LIM_CCX_TSM_TIMEOUT:
1416 limProcessTsmTimeoutHandler(pMac,limMsg);
1417 break;
1418 case WDA_TSM_STATS_RSP:
1419 limProcessHalCcxTsmRsp(pMac, limMsg);
1420 break;
1421#endif
1422 case WDA_ADD_TS_RSP:
1423 limProcessHalAddTsRsp(pMac, limMsg);
1424 break;
1425
1426 case SIR_LIM_DEL_TS_IND:
1427 limProcessDelTsInd(pMac, limMsg);
Madan Mohan Koyyalamudif244d8f2012-11-29 11:21:05 -08001428 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001429 case SIR_LIM_ADD_BA_IND:
1430 limProcessAddBaInd(pMac, limMsg);
1431 break;
1432 case SIR_LIM_DEL_BA_ALL_IND:
1433 limDelAllBASessions(pMac); // refer notes and change
1434 break;
1435 case SIR_LIM_DEL_BA_IND:
1436 limProcessMlmHalBADeleteInd( pMac, limMsg );
1437 break;
1438
1439 case SIR_LIM_BEACON_GEN_IND: {
Jeff Johnson295189b2012-06-20 16:38:30 -07001440
Jeff Johnson295189b2012-06-20 16:38:30 -07001441 if( pMac->lim.gLimSystemRole != eLIM_AP_ROLE )
Jeff Johnson295189b2012-06-20 16:38:30 -07001442 schProcessPreBeaconInd(pMac, limMsg);
1443
1444 }
1445 break;
1446
1447 case SIR_LIM_DELETE_STA_CONTEXT_IND:
1448 limDeleteStaContext(pMac, limMsg);
1449 break;
1450
1451 case SIR_LIM_MIN_CHANNEL_TIMEOUT:
1452 case SIR_LIM_MAX_CHANNEL_TIMEOUT:
1453 case SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT:
1454 case SIR_LIM_JOIN_FAIL_TIMEOUT:
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001455 case SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001456 case SIR_LIM_AUTH_FAIL_TIMEOUT:
1457 case SIR_LIM_AUTH_RSP_TIMEOUT:
1458 case SIR_LIM_ASSOC_FAIL_TIMEOUT:
1459 case SIR_LIM_REASSOC_FAIL_TIMEOUT:
1460#ifdef WLAN_FEATURE_VOWIFI_11R
1461 case SIR_LIM_FT_PREAUTH_RSP_TIMEOUT:
1462#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001463 case SIR_LIM_REMAIN_CHN_TIMEOUT:
Viral Modi9dc288a2012-12-10 13:09:21 -08001464 case SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT:
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001465 case SIR_LIM_DISASSOC_ACK_TIMEOUT:
1466 case SIR_LIM_DEAUTH_ACK_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001467 // These timeout messages are handled by MLM sub module
1468
1469 limProcessMlmReqMessages(pMac,
1470 limMsg);
1471
1472 break;
1473
1474 case SIR_LIM_HEART_BEAT_TIMEOUT:
1475 /** check if heart beat failed, even if one Beacon
1476 * is rcvd within the Heart Beat interval continue
1477 * normal processing
1478 */
1479
1480 #if 0
1481 PELOG1(limLog(pMac, LOG1, FL("Heartbeat timeout, SME %d, MLME %d, #bcn %d\n"),
1482 pMac->lim.gLimSmeState, pMac->lim.gLimMlmState,
1483 pMac->lim.gLimRxedBeaconCntDuringHB);)
1484
1485 if(pMac->lim.gLimSystemRole == eLIM_STA_IN_IBSS_ROLE)
1486 limIbssHeartBeatHandle(pMac); //HeartBeat for peers.
1487 else
1488 /**
1489 * Heartbeat failure occurred on STA
1490 * This is handled by LMM sub module.
1491 */
1492 limHandleHeartBeatFailure(pMac);
1493
1494 break;
1495 #endif //TO SUPPORT BT-AMP
Yathishd8713192012-12-10 14:21:35 -08001496 if (limIsSystemInScanState(pMac))
1497 {
1498 // System is in DFS (Learn) mode
1499 // Defer processsing this message
1500 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1501 {
1502 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)\n"),
1503 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1504 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
1505 limLogSessionStates(pMac);
1506 }
1507 }
1508 else
1509 {
Leela Venkata Kiran Kumar Reddy Chirala949300d2013-02-27 19:50:05 -08001510 if (NULL == limMsg->bodyptr)
1511 {
1512 limHandleHeartBeatTimeout(pMac);
1513 }
1514 else
1515 {
1516 limHandleHeartBeatTimeoutForSession(pMac, (tpPESession)limMsg->bodyptr);
1517 }
Yathishd8713192012-12-10 14:21:35 -08001518 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001519 break;
Leela Venkata Kiran Kumar Reddy Chirala949300d2013-02-27 19:50:05 -08001520
Jeff Johnson295189b2012-06-20 16:38:30 -07001521 case SIR_LIM_PROBE_HB_FAILURE_TIMEOUT:
1522 limHandleHeartBeatFailureTimeout(pMac);
1523 break;
1524
1525 case SIR_LIM_CHANNEL_SCAN_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001526 /**
1527 * Background scan timeout occurred on STA.
1528 * This is handled by LMM sub module.
1529 */
1530 limDeactivateAndChangeTimer(pMac, eLIM_BACKGROUND_SCAN_TIMER);
1531
1532 //We will do background scan even in bcnps mode
1533 //if (pMac->sys.gSysEnableScanMode)
1534 pMac->lim.gLimReportBackgroundScanResults = FALSE;
1535 limTriggerBackgroundScan(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001536 break;
1537
Jeff Johnson295189b2012-06-20 16:38:30 -07001538
1539 case SIR_LIM_HASH_MISS_THRES_TIMEOUT:
1540
1541 /*
1542 ** clear the credit to the send disassociate frame bucket
1543 **/
1544
1545 pMac->lim.gLimDisassocFrameCredit = 0;
1546 break;
1547
1548 case SIR_LIM_CNF_WAIT_TIMEOUT:
1549
1550 /*
1551 ** Does not receive CNF or dummy packet
1552 **/
1553 limHandleCnfWaitTimeout(pMac, (tANI_U16) limMsg->bodyval);
1554
1555 break;
1556
1557 case SIR_LIM_KEEPALIVE_TIMEOUT:
1558 limSendKeepAliveToPeer(pMac);
1559
1560 break;
1561
1562 case SIR_LIM_RETRY_INTERRUPT_MSG:
1563 // Message from ISR upon TFP's max retry limit interrupt
1564
1565 break;
1566
1567 case SIR_LIM_INV_KEY_INTERRUPT_MSG:
1568 // Message from ISR upon SP's Invalid session key interrupt
1569
1570 break;
1571
1572 case SIR_LIM_KEY_ID_INTERRUPT_MSG:
1573 // Message from ISR upon SP's Invalid key ID interrupt
1574
1575 break;
1576
1577 case SIR_LIM_REPLAY_THRES_INTERRUPT_MSG:
1578 // Message from ISR upon SP's Replay threshold interrupt
1579
1580 break;
1581
1582 case SIR_LIM_CHANNEL_SWITCH_TIMEOUT:
1583 limProcessChannelSwitchTimeout(pMac);
1584 break;
1585
1586 case SIR_LIM_QUIET_TIMEOUT:
1587 limProcessQuietTimeout(pMac);
1588 break;
1589
1590 case SIR_LIM_QUIET_BSS_TIMEOUT:
1591 limProcessQuietBssTimeout(pMac);
1592 break;
1593
Jeff Johnson295189b2012-06-20 16:38:30 -07001594 case SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT:
1595 limHandleUpdateOlbcCache(pMac);
1596 break;
1597#if 0
1598 case SIR_LIM_WPS_OVERLAP_TIMEOUT:
1599 limProcessWPSOverlapTimeout(pMac);
1600 break;
1601#endif
1602
Jeff Johnson295189b2012-06-20 16:38:30 -07001603
Mohit Khannac0b992f2012-12-04 15:08:18 -08001604#ifdef FEATURE_WLAN_TDLS_INTERNAL
1605 /*
1606 * Here discovery timer expires, now we can go ahead and collect all
1607 * the dicovery responses PE has process till now and send this
1608 * responses to SME..
1609 */
1610 case SIR_LIM_TDLS_DISCOVERY_RSP_WAIT:
1611 {
1612 //fetch the sessionEntry based on the sessionId
1613 tpPESession psessionEntry = peFindSessionBySessionId(pMac,
1614 pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId) ;
1615 if(NULL == psessionEntry)
1616 {
1617 limLog(pMac, LOGP,FL("Session Does not exist for given sessionID %d\n"), pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId);
1618 return;
1619 }
1620
1621 VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
1622 ("Discovery Rsp timer expires \n")) ;
1623#if 0 // TDLS_hklee: D13 no need to open Addr2 unknown data packet
1624 /* restore RXP filters */
1625 limSetLinkState(pMac, eSIR_LINK_FINISH_TDLS_DISCOVERY_STATE,
1626 psessionEntry->bssId) ;
1627#endif
1628 limSendSmeTdlsDisRsp(pMac, eSIR_SUCCESS,
1629 eWNI_SME_TDLS_DISCOVERY_START_RSP) ;
1630 break ;
1631 }
1632
1633 /*
1634 * we initiated link setup and did not receive TDLS setup rsp
1635 * from TDLS peer STA, send failure RSP to SME.
1636 */
1637 case SIR_LIM_TDLS_LINK_SETUP_RSP_TIMEOUT:
1638 {
1639 tANI_U8 *peerMac = (tANI_U8 *)limMsg->bodyval ;
1640 tLimTdlsLinkSetupPeer *setupPeer = NULL ;
1641
1642 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
1643 ("TDLS setup rsp timer expires \n")) ;
1644 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
1645 ("TDLS setup rsp timer expires for peer:\n")) ;
1646 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
1647 ("%02X, %02X, %02X,%02X, %02X, %02X\n"),
1648 peerMac[0],
1649 peerMac[1],
1650 peerMac[2],
1651 peerMac[3],
1652 peerMac[4],
1653 peerMac[5]);
1654
1655 limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ;
1656 if(NULL != setupPeer)
1657 {
1658 limTdlsDelLinkPeer( pMac, peerMac) ;
1659 }
1660
1661 limSendSmeTdlsLinkStartRsp(pMac, eSIR_FAILURE, peerMac,
1662 eWNI_SME_TDLS_LINK_START_RSP) ;
1663 break ;
1664 }
1665 case SIR_LIM_TDLS_LINK_SETUP_CNF_TIMEOUT:
1666 {
1667 tANI_U8 *peerMac = (tANI_U8 *)limMsg->bodyval ;
1668 tLimTdlsLinkSetupPeer *setupPeer = NULL ;
1669
1670 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
1671 ("TDLS setup CNF timer expires \n")) ;
1672 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
1673 ("TDLS setup CNF timer expires for peer:\n")) ;
1674 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
1675 ("%02X, %02X, %02X,%02X, %02X, %02X\n"),
1676 peerMac[0],
1677 peerMac[1],
1678 peerMac[2],
1679 peerMac[3],
1680 peerMac[4],
1681 peerMac[5]);
1682 limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ;
1683 if(NULL != setupPeer)
1684 {
1685 limTdlsDelLinkPeer( pMac, peerMac) ;
1686 }
1687 break ;
1688 }
1689#endif /* FEATURE_WLAN_TDLS TIMER */
Jeff Johnson295189b2012-06-20 16:38:30 -07001690 case WDA_ADD_BSS_RSP:
1691 limProcessMlmAddBssRsp( pMac, limMsg );
1692 break;
1693
1694 case WDA_ADD_STA_RSP:
1695
1696 //call a wrapper by paasing bodyptr, their get sessionID and and call proper function from there.
1697 limProcessAddStaRsp(pMac,limMsg);
1698 break;
1699
1700 case WDA_DELETE_STA_RSP:
1701 limProcessMlmDelStaRsp(pMac, limMsg);
1702 break;
1703
1704 case WDA_ADD_STA_SELF_RSP:
1705 limProcessAddStaSelfRsp(pMac, limMsg);
1706 break;
1707 case WDA_DEL_STA_SELF_RSP:
1708 limProcessDelStaSelfRsp(pMac, limMsg);
1709 break;
1710
1711 case WDA_DELETE_BSS_RSP:
1712 limHandleDeleteBssRsp(pMac,limMsg); //wrapper routine to handle delete bss response
1713 break;
1714
1715 case WDA_SET_BSSKEY_RSP:
1716 case WDA_SET_STA_BCASTKEY_RSP:
1717 limProcessMlmSetBssKeyRsp( pMac, limMsg );
1718 break;
1719 case WDA_SET_STAKEY_RSP:
1720 limProcessMlmSetStaKeyRsp( pMac, limMsg );
1721 break;
1722 case WDA_REMOVE_BSSKEY_RSP:
1723 case WDA_REMOVE_STAKEY_RSP:
1724 limProcessMlmRemoveKeyRsp( pMac, limMsg );
1725 break;
1726 case WDA_ADDBA_RSP:
1727 limProcessMlmHalAddBARsp( pMac, limMsg );
1728 break;
1729
1730 case WDA_STA_STAT_RSP:
1731 case WDA_AGGR_STAT_RSP:
1732 case WDA_GLOBAL_STAT_RSP:
1733 case WDA_STAT_SUMM_RSP:
1734 limSendSmeStatsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
1735 break;
1736
1737 case WDA_GET_STATISTICS_RSP:
1738 limSendSmePEStatisticsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
1739 break;
Srinivas Girigowda2471d832013-01-25 13:33:11 -08001740#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
1741 case WDA_GET_ROAM_RSSI_RSP:
1742 limSendSmePEGetRoamRssiRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
1743 break;
1744#endif
1745
Jeff Johnson295189b2012-06-20 16:38:30 -07001746
1747 case WDA_SET_MIMOPS_RSP: //limProcessSetMimoRsp(pMac, limMsg);
1748 case WDA_SET_TX_POWER_RSP: //limProcessSetTxPowerRsp(pMac, limMsg);
1749 case WDA_GET_TX_POWER_RSP: //limProcessGetTxPowerRsp(pMac, limMsg);
1750 case WDA_GET_NOISE_RSP:
1751 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
1752 limMsg->bodyptr = NULL;
1753 //limProcessGetNoiseRsp(pMac, limMsg);
1754 break;
1755
1756 case WDA_SET_MAX_TX_POWER_RSP:
1757#if defined WLAN_FEATURE_VOWIFI
1758 rrmSetMaxTxPowerRsp( pMac, limMsg );
1759#endif
1760 if(limMsg->bodyptr != NULL)
1761 {
1762 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
1763 limMsg->bodyptr = NULL;
1764 }
1765 break;
1766
Jeff Johnson295189b2012-06-20 16:38:30 -07001767 case SIR_LIM_ADDR2_MISS_IND:
1768 {
1769 limLog(pMac, LOGE,
1770 FL("Addr2 mismatch interrupt received %X\n"),
1771 limMsg->type);
1772 /*a message from HAL indicating addr2 mismatch interrupt occurred
1773 limMsg->bodyptr contains only pointer to 48-bit addr2 field*/
1774 //Dinesh fix this. the third parameter should be sessionentry.
1775 //limHandleUnknownA2IndexFrames(pMac, (void *)limMsg->bodyptr);
1776
1777 /*Free message body pointer*/
1778 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
1779 break;
1780 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001781
1782#ifdef WLAN_FEATURE_VOWIFI_11R
1783 case WDA_AGGR_QOS_RSP:
1784 limProcessFTAggrQoSRsp( pMac, limMsg );
1785 break;
1786#endif
1787
1788 case WDA_SET_LINK_STATE_RSP:
1789 linkStateParams = (tLinkStateParams *)limMsg->bodyptr;
1790#if defined WLAN_FEATURE_VOWIFI_11R
1791 pSession = linkStateParams->session;
1792 if(linkStateParams->ft)
1793 {
1794 limSendReassocReqWithFTIEsMgmtFrame(pMac,
1795 pSession->pLimMlmReassocReq,
1796 pSession);
1797 }
1798#endif
1799 if( linkStateParams->callback )
1800 {
1801 linkStateParams->callback( pMac, linkStateParams->callbackArg );
1802 }
1803 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
1804 break;
1805
1806#ifdef WLAN_FEATURE_PACKET_FILTERING
1807 case WDA_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP:
1808 pmmProcessMessage(pMac, limMsg);
1809 break;
1810#endif // WLAN_FEATURE_PACKET_FILTERING
1811
1812#ifdef WLAN_FEATURE_GTK_OFFLOAD
1813 case WDA_GTK_OFFLOAD_GETINFO_RSP:
1814 pmmProcessMessage(pMac, limMsg);
1815 break;
1816#endif // WLAN_FEATURE_GTK_OFFLOAD
Yathishd8713192012-12-10 14:21:35 -08001817 case eWNI_SME_SET_BCN_FILTER_REQ:
1818 {
1819#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1820 tpPESession psessionEntry;
1821 tANI_U8 sessionId = (tANI_U8)limMsg->bodyval ;
1822 psessionEntry = &pMac->lim.gpSession[sessionId];
1823 if(psessionEntry != NULL && IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
1824 {
1825 // sending beacon filtering information down to HAL
1826 if (limSendBeaconFilterInfo(pMac, psessionEntry) != eSIR_SUCCESS)
1827 {
1828 limLog(pMac, LOGE, FL("Fail to send Beacon Filter Info \n"));
1829 }
1830 }
Dhanashri Atre612af852013-03-29 11:19:05 -07001831 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
1832 limMsg->bodyptr = NULL;
Yathishd8713192012-12-10 14:21:35 -08001833#endif
1834 }
1835 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001836 default:
1837 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
1838 limMsg->bodyptr = NULL;
1839 // Unwanted messages
1840 // Log error
1841 limLog(pMac, LOGE,
1842 FL("Discarding unexpected message received %X\n"),
1843 limMsg->type);
1844 limPrintMsgName(pMac, LOGE, limMsg->type);
1845 break;
1846
1847 } // switch (limMsg->type)
1848
1849 PELOG2(limLog(pMac, LOG2, FL("Done Processing msgType = %d, sme state = %s, mlm state = %s\n"),
1850 limMsg->type, limSmeStateStr(pMac->lim.gLimSmeState),
1851 limMlmStateStr(pMac->lim.gLimMlmState));)
1852
1853} /*** end limProcessMessages() ***/
1854
1855
1856
1857/**
1858 * limProcessDeferredMessageQueue
1859 *
1860 *FUNCTION:
1861 * This function is called by LIM while exiting from Learn
1862 * mode. This function fetches messages posted to the LIM
1863 * deferred message queue limDeferredMsgQ.
1864 *
1865 *LOGIC:
1866 *
1867 *ASSUMPTIONS:
1868 * NA
1869 *
1870 *NOTE:
1871 * NA
1872 *
1873 * @param pMac - Pointer to Global MAC structure
1874 * @return None
1875 */
1876
1877void
1878limProcessDeferredMessageQueue(tpAniSirGlobal pMac)
1879{
1880 tSirMsgQ limMsg = { 0, 0, 0 };
1881
Jeff Johnson295189b2012-06-20 16:38:30 -07001882 tSirMsgQ *readMsg;
1883 tANI_U16 size;
1884
1885 /*
1886 ** check any deferred messages need to be processed
1887 **/
1888 size = pMac->lim.gLimDeferredMsgQ.size;
1889 if (size > 0)
1890 {
1891 while ((readMsg = limReadDeferredMsgQ(pMac)) != NULL)
1892 {
1893 palCopyMemory( pMac->hHdd, (tANI_U8*) &limMsg,
1894 (tANI_U8*) readMsg, sizeof(tSirMsgQ));
1895 size--;
1896 limProcessMessages(pMac, &limMsg);
1897
1898 if((limIsSystemInScanState(pMac)) || (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) ||
1899 (pMac->lim.gLimSystemInScanLearnMode))
1900 break;
1901 }
1902 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001903} /*** end limProcessDeferredMessageQueue() ***/
1904
1905
1906/*
1907 * limProcessNormalHddMsg
1908 * Function: this function checks the current lim state and decide whether the message passed shall be deffered.
1909 * @param pMac - Pointer to Global MAC structure
1910 * pLimMsg -- the message need to be processed
1911 * fRspReqd -- whether return result to hdd
1912 * @return None
1913 */
1914void limProcessNormalHddMsg(tpAniSirGlobal pMac, tSirMsgQ *pLimMsg, tANI_U8 fRspReqd)
1915{
1916 tANI_BOOLEAN fDeferMsg = eANI_BOOLEAN_TRUE;
1917
1918 /* Added For BT-AMP Support */
1919 if ((pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_AP_ROLE )
1920 ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_STA_ROLE)
1921 ||(pMac->lim.gLimSystemRole == eLIM_UNKNOWN_ROLE))
1922 {
1923 /** This check is required only for the AP and in 2 cases.
1924 * 1. If we are in learn mode and we receive any of these messages,
1925 * you have to come out of scan and process the message, hence dont
1926 * defer the message here. In handler, these message could be defered
1927 * till we actually come out of scan mode.
1928 * 2. If radar is detected, you might have to defer all of these
1929 * messages except Stop BSS request/ Switch channel request. This
1930 * decision is also made inside its handler.
1931 *
1932 * Please be careful while using the flag fDeferMsg. Possibly you
1933 * might end up in an infinite loop.
1934 **/
1935 if (((pLimMsg->type == eWNI_SME_START_BSS_REQ) ||
1936 (pLimMsg->type == eWNI_SME_STOP_BSS_REQ) ||
1937 (pLimMsg->type == eWNI_SME_SWITCH_CHL_REQ) ||
1938 (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ) ||
1939 (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ)))
1940 {
1941 fDeferMsg = eANI_BOOLEAN_FALSE;
1942 }
1943 }
1944
1945 /* limInsystemInscanState() refers the psessionEntry, how to get session Entry????*/
Jeff Johnsone7245742012-09-05 17:12:55 -07001946 if (((pMac->lim.gLimAddtsSent) || (limIsSystemInScanState(pMac)) /*||
1947 (LIM_IS_RADAR_DETECTED(pMac))*/) && fDeferMsg)
Jeff Johnson295189b2012-06-20 16:38:30 -07001948 {
1949 // System is in DFS (Learn) mode or awaiting addts response
1950 // or if radar is detected, Defer processsing this message
1951 if (limDeferMsg(pMac, pLimMsg) != TX_SUCCESS)
1952 {
1953#ifdef WLAN_DEBUG
1954 pMac->lim.numSme++;
1955#endif
1956 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)\n"),
1957 pLimMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1958 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
1959 limLogSessionStates(pMac);
1960 limPrintMsgName(pMac, LOGE, pLimMsg->type);
1961 // Release body
1962 palFreeMemory( pMac->hHdd, (tANI_U8 *) pLimMsg->bodyptr);
1963 }
1964 }
1965 else
1966 {
1967 if(fRspReqd)
1968 {
1969 // These messages are from HDD
1970 // Since these requests may also be generated
1971 // internally within LIM module, need to
1972 // distinquish and send response to host
1973 pMac->lim.gLimRspReqd = eANI_BOOLEAN_TRUE;
1974 }
1975#ifdef WLAN_DEBUG
1976 pMac->lim.numSme++;
1977#endif
1978 if(limProcessSmeReqMessages(pMac, pLimMsg))
1979 {
1980 // Release body
1981 // limProcessSmeReqMessage consumed the buffer. We can free it.
1982 palFreeMemory( pMac->hHdd, (tANI_U8 *) pLimMsg->bodyptr);
1983 }
1984 }
1985}
1986
1987void
Jeff Johnsone7245742012-09-05 17:12:55 -07001988handleHTCapabilityandHTInfo(struct sAniSirGlobal *pMac, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07001989{
1990 tSirMacHTCapabilityInfo macHTCapabilityInfo;
1991 tSirMacHTParametersInfo macHTParametersInfo;
1992 tSirMacHTInfoField1 macHTInfoField1;
1993 tSirMacHTInfoField2 macHTInfoField2;
1994 tSirMacHTInfoField3 macHTInfoField3;
1995 tANI_U32 cfgValue;
1996 tANI_U8 *ptr;
Jeff Johnson295189b2012-06-20 16:38:30 -07001997
Jeff Johnson295189b2012-06-20 16:38:30 -07001998 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_CAP_INFO, &cfgValue) != eSIR_SUCCESS)
1999 {
2000 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_CAP_INFO value\n"));
2001 return ;
2002 }
2003 ptr = (tANI_U8 *) &macHTCapabilityInfo;
2004 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2005 pMac->lim.gHTLsigTXOPProtection = (tANI_U8)macHTCapabilityInfo.lsigTXOPProtection;
2006 pMac->lim.gHTMIMOPSState = (tSirMacHTMIMOPowerSaveState) macHTCapabilityInfo.mimoPowerSave;
2007 pMac->lim.gHTGreenfield = (tANI_U8)macHTCapabilityInfo.greenField;
2008 pMac->lim.gHTMaxAmsduLength = (tANI_U8)macHTCapabilityInfo.maximalAMSDUsize;
2009 pMac->lim.gHTShortGI20Mhz = (tANI_U8)macHTCapabilityInfo.shortGI20MHz;
2010 pMac->lim.gHTShortGI40Mhz = (tANI_U8)macHTCapabilityInfo.shortGI40MHz;
Jeff Johnson295189b2012-06-20 16:38:30 -07002011 pMac->lim.gHTPSMPSupport = (tANI_U8)macHTCapabilityInfo.psmp;
2012 pMac->lim.gHTDsssCckRate40MHzSupport = (tANI_U8)macHTCapabilityInfo.dsssCckMode40MHz;
2013
2014 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_AMPDU_PARAMS, &cfgValue) != eSIR_SUCCESS)
2015 {
2016 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_PARAM_INFO value\n"));
2017 return ;
2018 }
2019 ptr = (tANI_U8 *) &macHTParametersInfo;
2020 *ptr = (tANI_U8) (cfgValue & 0xff);
2021 pMac->lim.gHTAMpduDensity = (tANI_U8)macHTParametersInfo.mpduDensity;
2022 pMac->lim.gHTMaxRxAMpduFactor = (tANI_U8)macHTParametersInfo.maxRxAMPDUFactor;
2023
2024 // Get HT IE Info
2025 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD1, &cfgValue) != eSIR_SUCCESS)
2026 {
2027 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD1 value\n"));
2028 return ;
2029 }
2030 ptr = (tANI_U8 *) &macHTInfoField1;
2031 *((tANI_U8 *)ptr) = (tANI_U8) (cfgValue & 0xff);
2032 pMac->lim.gHTServiceIntervalGranularity = (tANI_U8)macHTInfoField1.serviceIntervalGranularity;
2033 pMac->lim.gHTControlledAccessOnly = (tANI_U8)macHTInfoField1.controlledAccessOnly;
2034 pMac->lim.gHTRifsMode = (tANI_U8)macHTInfoField1.rifsMode;
Jeff Johnson295189b2012-06-20 16:38:30 -07002035
2036 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD2, &cfgValue) != eSIR_SUCCESS)
2037 {
2038 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD2 value\n"));
2039 return ;
2040 }
2041 ptr = (tANI_U8 *) &macHTInfoField2;
2042 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2043 pMac->lim.gHTOperMode = (tSirMacHTOperatingMode) macHTInfoField2.opMode;
2044
2045 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD3, &cfgValue) != eSIR_SUCCESS)
2046 {
2047 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD3 value\n"));
2048 return ;
2049 }
2050 ptr = (tANI_U8 *) &macHTInfoField3;
2051 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2052 pMac->lim.gHTPCOActive = (tANI_U8)macHTInfoField3.pcoActive;
2053 pMac->lim.gHTPCOPhase = (tANI_U8)macHTInfoField3.pcoPhase;
Jeff Johnson295189b2012-06-20 16:38:30 -07002054 pMac->lim.gHTSecondaryBeacon = (tANI_U8)macHTInfoField3.secondaryBeacon;
2055 pMac->lim.gHTDualCTSProtection = (tANI_U8)macHTInfoField3.dualCTSProtection;
2056 pMac->lim.gHTSTBCBasicMCS = (tANI_U8)macHTInfoField3.basicSTBCMCS;
Jeff Johnsone7245742012-09-05 17:12:55 -07002057
2058 /* The lim globals for channelwidth and secondary chnl have been removed and should not be used during no session;
2059 * instead direct cfg is read and used when no session for transmission of mgmt frames (same as old);
2060 * For now, we might come here during init and join with sessionEntry = NULL; in that case just fill the globals which exist
2061 * Sessionized entries values will be filled in join or add bss req. The ones which are missed in join are filled below
2062 */
2063 if (psessionEntry != NULL)
2064 {
2065 psessionEntry->htCapability = IS_DOT11_MODE_HT(psessionEntry->dot11mode);
2066 psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = (tANI_U8)macHTInfoField3.lsigTXOPProtectionFullSupport;
2067 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002068}
2069
2070void limLogSessionStates(tpAniSirGlobal pMac)
2071{
2072#ifdef WLAN_DEBUG
2073 int i;
2074
2075 for(i = 0; i < pMac->lim.maxBssId; i++)
2076 {
2077 if(pMac->lim.gpSession[i].valid)
2078 {
Madan Mohan Koyyalamudi5695b502012-09-24 14:21:12 -07002079 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 -07002080 i, pMac->lim.gpSession[i].limSystemRole, pMac->lim.gpSession[i].limSmeState,
2081 pMac->lim.gpSession[i].limPrevSmeState, pMac->lim.gpSession[i].limMlmState,
2082 pMac->lim.gpSession[i].limPrevMlmState);)
2083 }
2084 }
2085#endif //ifdef WLAN_DEBUG
2086}