blob: 305264147aeebfe2447ecb669e9d38327ffde7ee [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05302 * 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*/
Jeff Johnson295189b2012-06-20 16:38:30 -070021/*
22 * Airgo Networks, Inc proprietary. All rights reserved.
23 * This file lim ProcessMessageQueue.cc contains the code
24 * for processing LIM message Queue.
25 * Author: Chandra Modumudi
26 * Date: 02/11/02
27 * History:-
28 * Date Modified by Modification Information
29 * --------------------------------------------------------------------
30 *
31 */
32#include "palTypes.h"
33#include "wniApi.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070034#include "wlan_qct_wdi_ds.h"
35#include "wlan_qct_pal_packet.h"
36#include "wlan_qct_wda.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070037
Jeff Johnson295189b2012-06-20 16:38:30 -070038#include "wniCfgSta.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070039#include "cfgApi.h"
40#include "sirCommon.h"
41#include "utilsApi.h"
42#include "limTypes.h"
43#include "limUtils.h"
44#include "limAssocUtils.h"
45#include "limPropExtsUtils.h"
46
47#include "limAdmitControl.h"
48#include "pmmApi.h"
49#include "limIbssPeerMgmt.h"
50#include "schApi.h"
51#include "limSession.h"
Yathish9f22e662012-12-10 14:21:35 -080052#include "limSendMessages.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070053
54#if defined WLAN_FEATURE_VOWIFI
55#include "rrmApi.h"
56#endif
Srinivas Girigowda5cecb202013-10-08 09:13:25 -070057#if defined(FEATURE_WLAN_CCX) && !defined(FEATURE_WLAN_CCX_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -070058#include "ccxApi.h"
59#endif
60
61#if defined WLAN_FEATURE_VOWIFI_11R
62#include "limFT.h"
63#endif
64
65#ifdef WMM_APSD
66#include "wmmApsd.h"
67#endif
68
Jeff Johnson295189b2012-06-20 16:38:30 -070069#include "vos_types.h"
70#include "vos_packet.h"
71#include "vos_memory.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070072
73void limLogSessionStates(tpAniSirGlobal pMac);
74
75/** -------------------------------------------------------------
76\fn defMsgDecision
77\brief The function decides whether to defer a message or not in limProcessMessage function
78\param tpAniSirGlobal pMac
79\param tSirMsgQ limMsg
80\param tSirMacTspecIE *ppInfo
81\return none
82 -------------------------------------------------------------*/
83
84tANI_U8 static
85defMsgDecision(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
86{
87
88
89/* this function should not changed */
Jeff Johnsone7245742012-09-05 17:12:55 -070090 if(pMac->lim.gLimSmeState == eLIM_SME_OFFLINE_STATE)
Jeff Johnson295189b2012-06-20 16:38:30 -070091 {
92 // Defer processsing this message
93 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
94 {
Madan Mohan Koyyalamudi5695b502012-09-24 14:21:12 -070095 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 -070096 limMsg->type, limMsgStr(limMsg->type), pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
97 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
98 limLogSessionStates(pMac);
99 limHandleDeferMsgError(pMac, limMsg);
100 }
101 return true;
102 }
103
104 //When defer is requested then defer all the messages except HAL responses.
105 if((!limIsSystemInScanState(pMac)) && (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) &&
106 !pMac->lim.gLimSystemInScanLearnMode)
107 {
108 if((limMsg->type != WDA_ADD_BSS_RSP) &&
109 (limMsg->type != WDA_DELETE_BSS_RSP) &&
110 (limMsg->type != WDA_ADD_STA_RSP) &&
111 (limMsg->type != WDA_ADD_STA_SELF_RSP) &&
112 (limMsg->type != WDA_DEL_STA_SELF_RSP) &&
113 (limMsg->type != WDA_DELETE_STA_RSP)&&
114 (limMsg->type != WDA_SET_BSSKEY_RSP)&&
115 (limMsg->type != WDA_SET_STAKEY_RSP)&&
116 (limMsg->type != WDA_SET_STA_BCASTKEY_RSP) &&
Jeff Johnson295189b2012-06-20 16:38:30 -0700117 (limMsg->type != eWNI_SME_START_REQ) &&
118 (limMsg->type != WDA_AGGR_QOS_RSP) &&
119 (limMsg->type != WDA_REMOVE_BSSKEY_RSP) &&
120 (limMsg->type != WDA_REMOVE_STAKEY_RSP) &&
121 (limMsg->type != WDA_SET_MIMOPS_RSP)&&
122 (limMsg->type != WDA_ADDBA_RSP) &&
123 (limMsg->type != WDA_ENTER_BMPS_RSP) &&
124 (limMsg->type != WDA_EXIT_BMPS_RSP) &&
125 (limMsg->type != WDA_ENTER_IMPS_RSP) &&
126 (limMsg->type != WDA_EXIT_IMPS_RSP) &&
127 (limMsg->type != WDA_ENTER_UAPSD_RSP) &&
128 (limMsg->type != WDA_EXIT_UAPSD_RSP) &&
129 (limMsg->type != WDA_WOWL_ENTER_RSP) &&
130 (limMsg->type != WDA_WOWL_EXIT_RSP) &&
131 (limMsg->type != WDA_SWITCH_CHANNEL_RSP) &&
Jeff Johnson295189b2012-06-20 16:38:30 -0700132 (limMsg->type != WDA_P2P_NOA_ATTR_IND) &&
Viral Modid440e682013-03-06 02:25:31 -0800133 (limMsg->type != WDA_P2P_NOA_START_IND) &&
Jeff Johnsone7245742012-09-05 17:12:55 -0700134#ifdef FEATURE_OEM_DATA_SUPPORT
135 (limMsg->type != WDA_START_OEM_DATA_RSP) &&
136#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700137 (limMsg->type != WDA_ADD_TS_RSP))
138 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700139 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 -0700140 limMsgStr(limMsg->type));)
141
142 // Defer processsing this message
143 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
144 {
Madan Mohan Koyyalamudi5695b502012-09-24 14:21:12 -0700145 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 -0700146 limMsg->type, limMsgStr(limMsg->type), pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
147 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
148 limLogSessionStates(pMac);
149 limHandleDeferMsgError(pMac, limMsg);
150
151 }
152 return true;
153 }
154 }
155 return false;
156}
157
158/*
159* Beacon Handling Cases:
160* during scanning, when no session is active:
161* handled by limHandleFramesInScanState before __limHandleBeacon call is invoked.
162* during scanning, when any session is active, but beacon/Pr does not belong to that session, psessionEntry will be null.
163* handled by limHandleFramesInScanState before __limHandleBeacon call is invoked.
164* during scanning, when any session is active, and beacon/Pr belongs to one of the session, psessionEntry will not be null.
165* handled by limHandleFramesInScanState before __limHandleBeacon call is invoked.
166* Not scanning, no session:
167* there should not be any beacon coming, if coming, should be dropped.
168* Not Scanning,
169*/
170static void
171__limHandleBeacon(tpAniSirGlobal pMac, tpSirMsgQ pMsg, tpPESession psessionEntry)
172{
173 /* checking for global SME state...*/
174 tANI_U8 *pRxPacketInfo;
175 limGetBDfromRxPacket(pMac, pMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo);
176
177 //This function should not be called if beacon is received in scan state.
178 //So not doing any checks for the global state.
179
180 if(psessionEntry == NULL)
181 {
182 schBeaconProcess(pMac, pRxPacketInfo, NULL);
183 }
184 else if( (psessionEntry->limSmeState == eLIM_SME_LINK_EST_STATE) ||
185 (psessionEntry->limSmeState == eLIM_SME_NORMAL_STATE))
186 {
187 schBeaconProcess(pMac, pRxPacketInfo, psessionEntry);
188 }
189 else
190 limProcessBeaconFrame(pMac, pRxPacketInfo, psessionEntry);
191
192 return;
193}
194
195
196//Fucntion prototype
197void limProcessNormalHddMsg(tpAniSirGlobal pMac, tSirMsgQ *pLimMsg, tANI_U8 fRspReqd);
198
199/**
Jeff Johnson295189b2012-06-20 16:38:30 -0700200 * limDeferMsg()
201 *
202 *FUNCTION:
203 * This function is called to defer the messages received
204 * during Learn mode
205 *
206 *LOGIC:
207 * NA
208 *
209 *ASSUMPTIONS:
210 * NA
211 *
212 *NOTE:
213 * NA
214 *
215 * @param pMac - Pointer to Global MAC structure
216 * @param pMsg of type tSirMsgQ - Pointer to the message structure
217 * @return None
218 */
219
220tANI_U32
221limDeferMsg(tpAniSirGlobal pMac, tSirMsgQ *pMsg)
222{
223 tANI_U32 retCode = TX_SUCCESS;
Jeff Johnson77165482013-03-07 08:15:44 -0800224
225 retCode = limWriteDeferredMsgQ(pMac, pMsg);
226
Jeff Johnson295189b2012-06-20 16:38:30 -0700227 if (retCode == TX_SUCCESS)
Jeff Johnson77165482013-03-07 08:15:44 -0800228 {
229 MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DEFERRED));)
230 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700231 else
Jeff Johnson77165482013-03-07 08:15:44 -0800232 {
233 MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DROPPED));)
234 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700235
236 return retCode;
237} /*** end limDeferMsg() ***/
238
239
240
241/**
242 * limHandleFramesInScanState()
243 *
244 *FUNCTION:
245 * This function is called to process 802.11 frames
246 * received by LIM in scan state.
247 *
248 *LOGIC:
249 * NA
250 *
251 *ASSUMPTIONS:
252 * NA
253 *
254 *NOTE:
255 * NA
256 *
257 * @param pMac - Pointer to Global MAC structure
258 * @param limMsg - Received message
259 * @param pRxPacketInfo - Pointer to Rx packet info structure
260 * @param deferMsg - Indicates whether the frame shall be deferred
261 * @return None
262 */
263
264static void
265limHandleFramesInScanState(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pRxPacketInfo, tANI_U8 *deferMsg, tpPESession psessionEntry)
266{
267 tSirMacFrameCtl fc;
268 tpSirMacMgmtHdr pHdr;
Jeff Johnson295189b2012-06-20 16:38:30 -0700269
270 *deferMsg = false;
271 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
272 fc = pHdr->fc;
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700273 limLog( pMac, LOG2, FL("ProtVersion %d, Type %d, Subtype %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700274 fc.protVer, fc.type, fc.subType );
275
Jeff Johnson295189b2012-06-20 16:38:30 -0700276 // defer all message in scan state except for Beacons and Probe Response
277 if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_BEACON))
278 {
279 if (psessionEntry == NULL)
280 limProcessBeaconFrameNoSession(pMac, pRxPacketInfo);
281 else
282 limProcessBeaconFrame(pMac, pRxPacketInfo,psessionEntry);
283 }
284 else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_PROBE_RSP))
285 {
286 if (psessionEntry == NULL)
287 limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo);
288 else
289 limProcessProbeRspFrame(pMac, pRxPacketInfo,psessionEntry);
290 }
291 else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_PROBE_REQ))
292 {
293 limProcessProbeReqFrame_multiple_BSS(pMac, pRxPacketInfo, psessionEntry);
294 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700295 else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_ACTION))
296 {
297 limProcessActionFrameNoSession( pMac, pRxPacketInfo);
298 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700299 else
300 {
301 *deferMsg = true;
302 return;
303 }
304
Jeff Johnson295189b2012-06-20 16:38:30 -0700305 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr);
306 return;
307
308} /*** end limHandleFramesInScanState() ***/
309
310/** ------------------------------------------------------------
311\brief This function handles Unknown Unicast (A2 Index)
312\ packets.
313\param tpAniSirGlobal pMac Global Mac data structure
314\param void *pRxPacketInfo Pointer to Buffer Descriptor
315\return none
316\
317\ -------------------------------------------------------------- */
318static void limHandleUnknownA2IndexFrames(tpAniSirGlobal pMac, void *pRxPacketInfo,tpPESession psessionEntry)
319{
Jeff Johnson295189b2012-06-20 16:38:30 -0700320 /* addr2 mismatch interrupt occurred this means previous
321 disassociation was not successful
322 In Volans pRxPacketInfo only contains pointer 48-bit address2 field */
323 /*Send disassociation message again*/
324 //Dinesh need one more arguement.
325 //limSendDisassocMgmtFrame(pMac, eSIR_MAC_CLASS3_FRAME_FROM_NON_ASSOC_STA_REASON,(tANI_U8 *) pRxPacketInfo);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800326 //TODO: verify this
Jeff Johnson295189b2012-06-20 16:38:30 -0700327 //This could be a public action frame.
328 if( psessionEntry->limSystemRole == eLIM_P2P_DEVICE_ROLE )
329 limProcessActionFrameNoSession(pMac, (tANI_U8 *) pRxPacketInfo);
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800330
331#ifdef FEATURE_WLAN_TDLS
332 {
333 tpSirMacDataHdr3a pMacHdr;
334 pMacHdr = WDA_GET_RX_MPDUHEADER3A(pRxPacketInfo);
335
336 if (limIsGroupAddr(pMacHdr->addr2))
337 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700338 PELOG2(limLog(pMac, LOG2, FL("Ignoring A2 Invalid Packet received for MC/BC:"));
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800339 limPrintMacAddr(pMac, pMacHdr->addr2, LOG2);)
340
341 return;
342 }
343 /* TDLS_hklee: move down here to reject Addr2 == Group (first checking above)
344 and also checking if SystemRole == STA */
345 if (psessionEntry->limSystemRole == eLIM_STA_ROLE)
346 {
347 /* ADD handling of Public Action Frame */
348 LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, \
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700349 ("limHandleUnknownA2IndexFrames: type=0x%x, subtype=0x%x"),pMacHdr->fc.type, pMacHdr->fc.subType));
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800350 switch (pMacHdr->fc.type)
351 {
352 case SIR_MAC_MGMT_FRAME:
353 {
354 switch (pMacHdr->fc.subType)
355 {
356 case SIR_MAC_MGMT_ACTION:
357 {
358 limProcessActionFrame(pMac, pRxPacketInfo, psessionEntry) ;
359 break ;
360 }
361 default:
362 {
363 break ;
364 }
365 }
366 }
367 default:
368 {
369 break ;
370 }
371 }
372 }
373 }
374#endif
375
Jeff Johnson295189b2012-06-20 16:38:30 -0700376
377 return;
378}
379
Jeff Johnson295189b2012-06-20 16:38:30 -0700380/**
381 * limCheckMgmtRegisteredFrames()
382 *
383 *FUNCTION:
384 * This function is called to process to check if received frame match with
385 * any of the registered frame from HDD. If yes pass this frame to SME.
386 *
387 *LOGIC:
388 *
389 *ASSUMPTIONS:
390 *
391 *NOTE:
392 *
393 * @param pMac Pointer to Global MAC structure
394 * @param *pBd Pointer to the received Buffer Descriptor+payload
395 * @param *psessionEntry Pointer to session on which packet is received
396 * @return None
397 */
398static tANI_BOOLEAN
399limCheckMgmtRegisteredFrames(tpAniSirGlobal pMac, tANI_U8 *pBd,
400 tpPESession psessionEntry)
401{
402 tSirMacFrameCtl fc;
403 tpSirMacMgmtHdr pHdr;
404 tANI_U8 *pBody;
405 tpLimMgmtFrameRegistration pLimMgmtRegistration = NULL, pNext = NULL;
406 tANI_U16 frameType;
407 tANI_U16 framelen;
408 tANI_U8 type,subType;
409 tANI_BOOLEAN match = VOS_FALSE;
410 VOS_STATUS vosStatus;
411
412 pHdr = WDA_GET_RX_MAC_HEADER(pBd);
413 fc = pHdr->fc;
414 frameType = (fc.type << 2 ) | (fc.subType << 4);
415 pBody = WDA_GET_RX_MPDU_DATA(pBd);
416 framelen = WDA_GET_RX_PAYLOAD_LEN(pBd);
417
418 vos_list_peek_front(&pMac->lim.gLimMgmtFrameRegistratinQueue,
419 (vos_list_node_t**)&pLimMgmtRegistration);
420
421 while(pLimMgmtRegistration != NULL)
422 {
423 type = (pLimMgmtRegistration->frameType >> 2) & 0x03;
424 subType = (pLimMgmtRegistration->frameType >> 4) & 0x0f;
425 if ( (type == SIR_MAC_MGMT_FRAME) && (fc.type == SIR_MAC_MGMT_FRAME)
426 && (subType == SIR_MAC_MGMT_RESERVED15) )
427 {
428 limLog( pMac, LOG3,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700429 FL("rcvd frame match with SIR_MAC_MGMT_RESERVED15"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700430 match = VOS_TRUE;
431 break;
432 }
433
434 if (pLimMgmtRegistration->frameType == frameType)
435 {
436 if (pLimMgmtRegistration->matchLen > 0)
437 {
438 if (pLimMgmtRegistration->matchLen <= framelen)
439 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +0530440 if (vos_mem_compare(pLimMgmtRegistration->matchData,
Jeff Johnson295189b2012-06-20 16:38:30 -0700441 pBody, pLimMgmtRegistration->matchLen))
442 {
Madan Mohan Koyyalamudic537df22012-10-22 15:07:08 -0700443 /* found match! */
444 match = VOS_TRUE;
445 break;
Jeff Johnson295189b2012-06-20 16:38:30 -0700446 }
Madan Mohan Koyyalamudic537df22012-10-22 15:07:08 -0700447 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700448 }
449 else
450 {
451 /* found match! */
452 match = VOS_TRUE;
453 break;
454 }
455 }
456
457 vosStatus =
458 vos_list_peek_next ( &pMac->lim.gLimMgmtFrameRegistratinQueue,
459 (vos_list_node_t*) pLimMgmtRegistration,
460 (vos_list_node_t**) &pNext );
461 pLimMgmtRegistration = pNext;
462 pNext = NULL;
463 }
464
465 if (match)
466 {
467 limLog( pMac, LOG1,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700468 FL("rcvd frame match with registered frame params"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700469
470 /* Indicate this to SME */
471 limSendSmeMgmtFrameInd( pMac, pHdr->fc.subType, (tANI_U8*)pHdr,
472 WDA_GET_RX_PAYLOAD_LEN(pBd) + sizeof(tSirMacMgmtHdr),
473 pLimMgmtRegistration->sessionId,
Chilam NG571c65a2013-01-19 12:27:36 +0530474 WDA_GET_RX_CH(pBd), psessionEntry, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -0700475
476 if ( (type == SIR_MAC_MGMT_FRAME) && (fc.type == SIR_MAC_MGMT_FRAME)
477 && (subType == SIR_MAC_MGMT_RESERVED15) )
478 {
479 // These packets needs to be processed by PE/SME as well as HDD.
480 // If it returns TRUE here, the packet is forwarded to HDD only.
481 match = VOS_FALSE;
482 }
483 }
484
485 return match;
486} /*** end limCheckMgmtRegisteredFrames() ***/
Jeff Johnson295189b2012-06-20 16:38:30 -0700487
488
489/**
490 * limHandle80211Frames()
491 *
492 *FUNCTION:
493 * This function is called to process 802.11 frames
494 * received by LIM.
495 *
496 *LOGIC:
497 * NA
498 *
499 *ASSUMPTIONS:
500 * NA
501 *
502 *NOTE:
503 * NA
504 *
505 * @param pMac - Pointer to Global MAC structure
506 * @param pMsg of type tSirMsgQ - Pointer to the message structure
507 * @return None
508 */
509
510static void
511limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg)
512{
513 tANI_U8 *pRxPacketInfo = NULL;
514 tSirMacFrameCtl fc;
515 tpSirMacMgmtHdr pHdr=NULL;
516 tpPESession psessionEntry=NULL;
517 tANI_U8 sessionId;
518 tAniBool isFrmFt = FALSE;
519 tANI_U16 fcOffset = WLANHAL_RX_BD_HEADER_SIZE;
520
521 *pDeferMsg= false;
522 limGetBDfromRxPacket(pMac, limMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo);
523
524 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
525 isFrmFt = WDA_GET_RX_FT_DONE(pRxPacketInfo);
526 fcOffset = (v_U8_t)WDA_GET_RX_MPDU_HEADER_OFFSET(pRxPacketInfo);
527 fc = pHdr->fc;
528
Madan Mohan Koyyalamudi99af06e2013-08-08 02:17:17 +0530529#ifdef WLAN_DUMP_MGMTFRAMES
530 limLog( pMac, LOGE, FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"),
531 fc.protVer, fc.type, fc.subType,
532 WDA_GET_RX_MAC_RATE_IDX(pRxPacketInfo));
533 VOS_TRACE_HEX_DUMP(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, pHdr,
534 WDA_GET_RX_MPDU_HEADER_LEN(pRxPacketInfo));
535#endif
536
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700537#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
538 if ( WDA_GET_ROAMCANDIDATEIND(pRxPacketInfo))
539 {
540 limLog( pMac, LOG2, FL("Notify SME with candidate ind"));
541 //send a session 0 for now - TBD
542 limSendSmeCandidateFoundInd(pMac, 0);
543 goto end;
544 }
545 if (WDA_GET_OFFLOADSCANLEARN(pRxPacketInfo))
546 {
547 if (fc.subType == SIR_MAC_MGMT_BEACON)
548 {
549 limLog( pMac, LOG2, FL("Save this beacon in LFR cache"));
550 __limHandleBeacon(pMac, limMsg, NULL);
551 }
552 else if (fc.subType == SIR_MAC_MGMT_PROBE_RSP)
553 {
554 limLog( pMac, LOG2, FL("Save this probe rsp in LFR cache"));
555 limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo);
556 }
557 else
558 {
559 limLog( pMac, LOGE, FL("Wrong frame Type %d, Subtype %d for LFR"),
560 fc.type, fc.subType);
561 }
562 goto end;
563 }
564#endif //WLAN_FEATURE_ROAM_SCAN_OFFLOAD
Jeff Johnson295189b2012-06-20 16:38:30 -0700565#ifdef FEATURE_WLAN_CCX
566 if (fc.type == SIR_MAC_DATA_FRAME && isFrmFt)
567 {
568#if 0 // CCX TBD Need to PORT
569 tpSirMacDot3Hdr pDataFrmHdr;
570
571 pDataFrmHdr = (tpSirMacDot3Hdr)((tANI_U8 *)pBD+ WLANHAL_RX_BD_GET_MPDU_H_OFFSET(pBD));
572 if((psessionEntry = peFindSessionByBssid(pMac,pDataFrmHdr->sa,&sessionId))== NULL)
573 {
574 limLog( pMac, LOGE, FL("Session not found for Frm type %d, subtype %d, SA: "), fc.type, fc.subType);
575 limPrintMacAddr(pMac, pDataFrmHdr->sa, LOGE);
576 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pBD, limMsg->bodyptr);
577 return;
578 }
579
580 if (!psessionEntry->isCCXconnection)
581 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700582 limLog( pMac, LOGE, FL("LIM received Type %d, Subtype %d in Non CCX connection"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700583 fc.type, fc.subType);
584 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pBD, limMsg->bodyptr);
585 return;
586 }
587 limLog( pMac, LOGE, FL("Processing IAPP Frm from SA:"));
588 limPrintMacAddr(pMac, pDataFrmHdr->sa, LOGE);
589#else
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700590 printk("%s: Need to port handling of IAPP frames to PRIMA for CCX", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700591#endif
592
593
594 } else
595#endif
596 /* Added For BT-AMP Support */
597 if((psessionEntry = peFindSessionByBssid(pMac,pHdr->bssId,&sessionId))== NULL)
598 {
599#ifdef WLAN_FEATURE_VOWIFI_11R
600 if (fc.subType == SIR_MAC_MGMT_AUTH)
601 {
602#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
Varun Reddy Yeturuf68abd62013-02-11 14:05:06 -0800603 limLog( pMac, LOG1, FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700604 fc.protVer, fc.type, fc.subType, WDA_GET_RX_MAC_RATE_IDX(pRxPacketInfo));
Varun Reddy Yeturuf68abd62013-02-11 14:05:06 -0800605 limPrintMacAddr(pMac, pHdr->bssId, LOG1);
Jeff Johnson295189b2012-06-20 16:38:30 -0700606#endif
607 if (limProcessAuthFrameNoSession(pMac, pRxPacketInfo, limMsg->bodyptr) == eSIR_SUCCESS)
608 {
609 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr);
610 return;
611 }
612 }
613#endif
614 if((fc.subType != SIR_MAC_MGMT_PROBE_RSP )&&
615 (fc.subType != SIR_MAC_MGMT_BEACON)&&
616 (fc.subType != SIR_MAC_MGMT_PROBE_REQ)
Jeff Johnson295189b2012-06-20 16:38:30 -0700617 && (fc.subType != SIR_MAC_MGMT_ACTION ) //Public action frame can be received from non-associated stations.
Jeff Johnson295189b2012-06-20 16:38:30 -0700618 )
619 {
620
621 if((psessionEntry = peFindSessionByPeerSta(pMac,pHdr->sa,&sessionId))== NULL)
622 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700623 limLog(pMac, LOG1, FL("session does not exist for given bssId"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700624 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr);
625 return;
626 }
Gopichand Nakkala6265d6f2013-03-20 23:32:50 +0530627 }
628 // For p2p resp frames search for valid session with DA as
629 // BSSID will be SA and session will be present with DA only
630 if(fc.subType == SIR_MAC_MGMT_ACTION )
631 {
632 psessionEntry = peFindSessionByBssid(pMac,pHdr->da,&sessionId);
633 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700634 }
635
636
Jeff Johnson295189b2012-06-20 16:38:30 -0700637 /* Check if frame is registered by HDD */
638 if(limCheckMgmtRegisteredFrames(pMac, pRxPacketInfo, psessionEntry))
639 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700640 limLog( pMac, LOG1, FL("Received frame is passed to SME"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700641 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr);
642 return;
643 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700644
645
Jeff Johnson295189b2012-06-20 16:38:30 -0700646
647 if (fc.protVer != SIR_MAC_PROTOCOL_VERSION)
648 { // Received Frame with non-zero Protocol Version
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700649 limLog(pMac, LOGE, FL("Unexpected frame with protVersion %d received"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700650 fc.protVer);
651 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr);
652#ifdef WLAN_DEBUG
653 pMac->lim.numProtErr++;
654#endif
655 return;
656 }
657
Gopichand Nakkala2c231c82013-06-11 17:49:16 +0530658 if (!pMac->fScanOffload)
Jeff Johnson295189b2012-06-20 16:38:30 -0700659 {
Gopichand Nakkala2c231c82013-06-11 17:49:16 +0530660 if (limIsSystemInScanState(pMac))
661 {
662 limHandleFramesInScanState(pMac, limMsg, pRxPacketInfo, pDeferMsg, psessionEntry);
663 return;
664 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700665 }
666
667/* Chance of crashing : to be done BT-AMP ........happens when broadcast probe req is received */
668
669#if 0
670 if (psessionEntry->limSystemRole == eLIM_UNKNOWN_ROLE) {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700671 limLog( pMac, LOGW, FL( "gLimSystemRole is %d. Exiting..." ),psessionEntry->limSystemRole );
Jeff Johnson295189b2012-06-20 16:38:30 -0700672 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr);
673
674#ifdef WLAN_DEBUG
675 pMac->lim.numProtErr++;
676#endif
677 return;
678 }
679 #endif //HACK to continue scanning
680
681
682#ifdef WLAN_DEBUG
683 pMac->lim.numMAC[fc.type][fc.subType]++;
684#endif
685
686 switch (fc.type)
687 {
688 case SIR_MAC_MGMT_FRAME:
689 {
690 #if 0 //TBD-RAJESH fix this
691 if (limIsReassocInProgress( pMac,psessionEntry) && (fc.subType != SIR_MAC_MGMT_DISASSOC) &&
692 (fc.subType != SIR_MAC_MGMT_DEAUTH) && (fc.subType != SIR_MAC_MGMT_REASSOC_RSP))
693 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700694 limLog(pMac, LOGE, FL("Frame with Type - %d, Subtype - %d received in ReAssoc Wait state, dropping..."),
Jeff Johnson295189b2012-06-20 16:38:30 -0700695 fc.type, fc.subType);
696 return;
697 }
698 #endif //HACK to continue scanning
699 // Received Management frame
700 switch (fc.subType)
701 {
702 case SIR_MAC_MGMT_ASSOC_REQ:
703 // Make sure the role supports Association
704 if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700705 || (psessionEntry->limSystemRole == eLIM_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700706 )
707 limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_ASSOC, psessionEntry);
708
709 else
710 {
711 // Unwanted messages - Log error
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700712 limLog(pMac, LOGE, FL("unexpected message received %X"),limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -0700713 limPrintMsgName(pMac, LOGE, limMsg->type);
714 }
715 break;
716
717 case SIR_MAC_MGMT_ASSOC_RSP:
718 limProcessAssocRspFrame(pMac, pRxPacketInfo, LIM_ASSOC,psessionEntry);
719 break;
720
721 case SIR_MAC_MGMT_REASSOC_REQ:
722 // Make sure the role supports Reassociation
723 if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700724 || (psessionEntry->limSystemRole == eLIM_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700725 ){
726 limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_REASSOC, psessionEntry);
727 }
728 else
729 {
730 // Unwanted messages - Log error
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700731 limLog(pMac, LOGE, FL("unexpected message received %X"),limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -0700732 limPrintMsgName(pMac, LOGE, limMsg->type);
733 }
734 break;
735
736 case SIR_MAC_MGMT_REASSOC_RSP:
737 limProcessAssocRspFrame(pMac, pRxPacketInfo, LIM_REASSOC,psessionEntry);
738 break;
739
740 case SIR_MAC_MGMT_PROBE_REQ:
741 limProcessProbeReqFrame_multiple_BSS(pMac, pRxPacketInfo,psessionEntry);
742 break;
743
744 case SIR_MAC_MGMT_PROBE_RSP:
745 if(psessionEntry == NULL)
746 limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo);
747 else
748 limProcessProbeRspFrame(pMac, pRxPacketInfo, psessionEntry);
749 break;
750
751 case SIR_MAC_MGMT_BEACON:
752 __limHandleBeacon(pMac, limMsg,psessionEntry);
753 break;
754
755 case SIR_MAC_MGMT_DISASSOC:
756 limProcessDisassocFrame(pMac, pRxPacketInfo,psessionEntry);
757 break;
758
759 case SIR_MAC_MGMT_AUTH:
760 limProcessAuthFrame(pMac, pRxPacketInfo,psessionEntry);
761 break;
762
763 case SIR_MAC_MGMT_DEAUTH:
764 limProcessDeauthFrame(pMac, pRxPacketInfo,psessionEntry);
765 break;
766
767 case SIR_MAC_MGMT_ACTION:
Jeff Johnson295189b2012-06-20 16:38:30 -0700768 if(psessionEntry == NULL)
769 limProcessActionFrameNoSession(pMac, pRxPacketInfo);
770 else
771 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700772 if (WDA_GET_RX_UNKNOWN_UCAST(pRxPacketInfo))
773 limHandleUnknownA2IndexFrames(pMac, pRxPacketInfo,psessionEntry);
774 else
775 limProcessActionFrame(pMac, pRxPacketInfo,psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -0700776 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700777 break;
778 default:
779 // Received Management frame of 'reserved' subtype
780 break;
781 } // switch (fc.subType)
782
783 }
784 break;
Jeff Johnson295189b2012-06-20 16:38:30 -0700785 case SIR_MAC_DATA_FRAME:
786 {
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800787#ifdef FEATURE_WLAN_TDLS_INTERNAL
788 /*
789 * if we reach here, following cases are possible.
790 * Possible cases: a) if frame translation is disabled.
791 * b) Some frame with ADRR2 filter enabled may come
792 * here.
793 */
794 tANI_U8 *dataOffset = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
795 tANI_U8 *rfc1042Hdr = (tANI_U8 *)(dataOffset + RFC1042_HDR_LENGTH) ;
796 tANI_U16 ethType = GET_BE16(rfc1042Hdr) ;
797 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700798 ("TDLS frame with 80211 Header")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800799 if(ETH_TYPE_89_0d == ethType)
800 {
801 tANI_U8 payloadType = (rfc1042Hdr + ETH_TYPE_LEN)[0] ;
802 if(PAYLOAD_TYPE_TDLS == payloadType)
803 {
804 limProcessTdlsFrame(pMac, (tANI_U32*)pRxPacketInfo) ;
805 }
806 }
807#endif
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700808#if defined(FEATURE_WLAN_CCX) && !defined(FEATURE_WLAN_CCX_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -0700809 /* We accept data frame (IAPP frame) only if Session is
810 * present and ccx connection is established on that
811 * session
812 */
813 if (psessionEntry && psessionEntry->isCCXconnection) {
814 limProcessIappFrame(pMac, pRxPacketInfo, psessionEntry);
815 }
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800816#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700817 }
818 break;
Jeff Johnson295189b2012-06-20 16:38:30 -0700819 default:
820 // Received frame of type 'reserved'
821 break;
822
823 } // switch (fc.type)
824
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700825#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
826end:
827#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700828 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr) ;
829 return;
830} /*** end limHandle80211Frames() ***/
831
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530832/**
833 * limSendStopScanOffloadReq()
834 *
835 *FUNCTION:
836 * This function will be called to abort the ongoing offloaded scan
837 * request.
838 *
839 *
840 *NOTE:
841 *
842 * @param pMac Pointer to Global MAC structure
843 * @return eHAL_STATUS_SUCCESS or eHAL_STATUS_FAILURE
844 */
845eHalStatus limSendStopScanOffloadReq(tpAniSirGlobal pMac, tANI_U8 SessionId)
846{
847 tSirMsgQ msg;
848 tSirRetStatus rc = eSIR_SUCCESS;
849 tAbortScanParams *pAbortScanParams;
850
851 if (eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd,
852 (void**) &pAbortScanParams,
853 sizeof(tAbortScanParams)))
854 {
855 limLog(pMac, LOGP, FL("Memory allocation failed for AbortScanParams"));
856 return eHAL_STATUS_FAILURE;
857 }
858
859 pAbortScanParams->SessionId = SessionId;
860 msg.type = WDA_STOP_SCAN_OFFLOAD_REQ;
861 msg.bodyptr = pAbortScanParams;
862 msg.bodyval = 0;
863
864 rc = wdaPostCtrlMsg(pMac, &msg);
865 if (rc != eSIR_SUCCESS)
866 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -0800867 limLog(pMac, LOGE, FL("wdaPostCtrlMsg() return failure"));
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530868 palFreeMemory(pMac->hHdd, (tANI_U8 *)pAbortScanParams);
869 return eHAL_STATUS_FAILURE;
870 }
871
872 return eHAL_STATUS_SUCCESS;
873
874}
Jeff Johnson295189b2012-06-20 16:38:30 -0700875
876/**
877 * limProcessAbortScanInd()
878 *
879 *FUNCTION:
880 * This function is called from HDD to abort the scan which is presently being run
881 *
882 *
883 *NOTE:
884 *
885 * @param pMac Pointer to Global MAC structure
886 * @param *pMsgBuf A pointer to the SME message buffer
887 * @return None
888 */
889void
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530890limProcessAbortScanInd(tpAniSirGlobal pMac, tANI_U8 SessionId)
Jeff Johnson295189b2012-06-20 16:38:30 -0700891{
892#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
893 limDiagEventReport(pMac, WLAN_PE_DIAG_SCAN_ABORT_IND_EVENT, NULL, 0, 0);
894#endif //FEATURE_WLAN_DIAG_SUPPORT
895
896 /* Deactivate the gLimBackgroundScanTimer as part of the abort scan.
897 * SME should send WNI_CFG_BACKGROUND_SCAN_PERIOD indication
898 * to start the background scan again
899 */
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -0700900 PELOG2(limLog(pMac, LOG2, FL("Processing AbortScan Ind"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700901
902 limAbortBackgroundScan(pMac);
903
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530904 if (pMac->fScanOffload)
Jeff Johnson295189b2012-06-20 16:38:30 -0700905 {
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530906 /* send stop scan cmd to fw if scan offload is enabled. */
907 limSendStopScanOffloadReq(pMac, SessionId);
908 }
909 else
910 {
911 /* Abort the scan if its running, else just return */
912 if(limIsSystemInScanState(pMac))
Jeff Johnson295189b2012-06-20 16:38:30 -0700913 {
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530914 if( (eLIM_HAL_INIT_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
915 (eLIM_HAL_START_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
916 (eLIM_HAL_END_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
917 (eLIM_HAL_FINISH_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState) )
918 {
919 //Simply signal we need to abort
920 limLog( pMac, LOGW, FL(" waiting for HAL, simply signal abort gLimHalScanState = %d"), pMac->lim.gLimHalScanState );
921 pMac->lim.abortScan = 1;
922 }
923 else
924 {
925 //Force abort
926 limLog( pMac, LOGW, FL(" Force aborting scan") );
927 pMac->lim.abortScan = 0;
928 limDeactivateAndChangeTimer(pMac, eLIM_MIN_CHANNEL_TIMER);
929 limDeactivateAndChangeTimer(pMac, eLIM_MAX_CHANNEL_TIMER);
930 //Set the resume channel to Any valid channel (invalid).
931 //This will instruct HAL to set it to any previous valid channel.
932 peSetResumeChannel(pMac, 0, 0);
933 limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE);
934 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700935 }
936 }
937 return;
938}
939
940/**
941 * limMessageProcessor
942 *
943 *FUNCTION:
944 * Wrapper function for limProcessMessages when handling messages received by LIM.
945 * Could either defer messages or process them.
946 * @param pMac Pointer to Global MAC structure
947 * @param limMsg Received LIM message
948 * @return None
949 */
950
951void limMessageProcessor(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
952{
953 if (eLIM_MLM_OFFLINE_STATE == pMac->lim.gLimMlmState)
954 {
955 peFreeMsg(pMac, limMsg);
956 return;
957 }
958
959 if (!defMsgDecision(pMac, limMsg))
960 {
961 limProcessMessages(pMac, limMsg);
Jeff Johnson295189b2012-06-20 16:38:30 -0700962 // process deferred message queue if allowed
963 {
964 if ( (! (pMac->lim.gLimAddtsSent))
965 &&
966 (! (limIsSystemInScanState(pMac)))
967 )
968 {
969 if (true == GET_LIM_PROCESS_DEFD_MESGS(pMac))
970 limProcessDeferredMessageQueue(pMac);
971 }
972 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700973 }
974}
975
Jeff Johnsone7245742012-09-05 17:12:55 -0700976#ifdef FEATURE_OEM_DATA_SUPPORT
977
978void limOemDataRspHandleResumeLinkRsp(tpAniSirGlobal pMac, eHalStatus status, tANI_U32* mlmOemDataRsp)
979{
980 if(status != eHAL_STATUS_SUCCESS)
981 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700982 limLog(pMac, LOGE, FL("OEM Data Rsp failed to get the response for resume link"));
Jeff Johnsone7245742012-09-05 17:12:55 -0700983 }
984
985 if(NULL != pMac->lim.gpLimMlmOemDataReq)
986 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +0530987 vos_mem_free(pMac->lim.gpLimMlmOemDataReq);
Jeff Johnsone7245742012-09-05 17:12:55 -0700988 pMac->lim.gpLimMlmOemDataReq = NULL;
989 }
990
991 //"Failure" status doesn't mean that Oem Data Rsp did not happen
992 //and hence we need to respond to upper layers. Only Resume link is failed, but
993 //we got the oem data response already.
994 //Post the meessage to MLM
995 limPostSmeMessage(pMac, LIM_MLM_OEM_DATA_CNF, (tANI_U32*)(mlmOemDataRsp));
996
997 return;
998}
999
1000void limProcessOemDataRsp(tpAniSirGlobal pMac, tANI_U32* body)
1001{
Jeff Johnsone7245742012-09-05 17:12:55 -07001002 tpLimMlmOemDataRsp mlmOemDataRsp = NULL;
1003 tpStartOemDataRsp oemDataRsp = NULL;
1004
1005 //Process all the messages for the lim queue
1006 SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
1007
1008 oemDataRsp = (tpStartOemDataRsp)(body);
1009
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301010 mlmOemDataRsp = vos_mem_malloc(sizeof(tLimMlmOemDataRsp));
1011 if ( NULL == mlmOemDataRsp )
Jeff Johnsone7245742012-09-05 17:12:55 -07001012 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001013 limLog(pMac, LOGP, FL("could not allocate memory for mlmOemDataRsp"));
Jeff Johnsone7245742012-09-05 17:12:55 -07001014 return;
1015 }
1016
1017 //copy the memory into tLimMlmOemDataRsp and free the tStartOemDataRsp
1018 //the structures tStartOemDataRsp and tLimMlmOemDataRsp have the same structure
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301019 vos_mem_copy((void*)(mlmOemDataRsp), (void*)(oemDataRsp),
1020 sizeof(tLimMlmOemDataRsp));
Jeff Johnsone7245742012-09-05 17:12:55 -07001021
1022 //Now free the incoming memory
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301023 vos_mem_free(oemDataRsp);
Jeff Johnsone7245742012-09-05 17:12:55 -07001024
1025 limResumeLink(pMac, limOemDataRspHandleResumeLinkRsp, (tANI_U32*)mlmOemDataRsp);
1026
1027 return;
1028}
1029
1030#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001031
1032
1033/**
1034 * limProcessMessages
1035 *
1036 *FUNCTION:
1037 * This function is called by limProcessMessageQueue function. This
1038 * function processes messages received by LIM.
1039 *
1040 *LOGIC:
1041 * Depending on the message type, corresponding function will be
1042 * called, for example limProcessSmeMessages() will be called to
1043 * process SME messages received from HDD/Upper layer software module.
1044 *
1045 *ASSUMPTIONS:
1046 * NA
1047 *
1048 *NOTE:
1049 * NA
1050 *
1051 * @param pMac Pointer to Global MAC structure
1052 * @param limMsg Received LIM message
1053 * @return None
1054 */
1055
1056void
1057limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
1058{
1059 tANI_U8 deferMsg = false;
1060 tLinkStateParams *linkStateParams;
1061#if defined WLAN_FEATURE_VOWIFI_11R
1062 tpPESession pSession;
1063#endif
1064#if defined(ANI_DVT_DEBUG)
1065 tSirMsgQ msgQ;
1066#endif
1067 if(pMac->gDriverType == eDRIVER_TYPE_MFG)
1068 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301069 vos_mem_free(limMsg->bodyptr);
Jeff Johnsone7245742012-09-05 17:12:55 -07001070 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001071 return;
1072 }
1073#ifdef WLAN_DEBUG
1074 pMac->lim.numTot++;
1075#endif
1076
1077
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001078 PELOG3(limLog(pMac, LOG3, FL("rcvd msgType = %s, sme state = %s, mlm state = %s"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001079 limMsgStr(limMsg->type), limSmeStateStr(pMac->lim.gLimSmeState),
1080 limMlmStateStr(pMac->lim.gLimMlmState));)
1081
Jeff Johnsone7245742012-09-05 17:12:55 -07001082 MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(limMsg->type, LIM_MSG_PROCESSED));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001083
1084 switch (limMsg->type)
1085 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001086
1087 case SIR_LIM_UPDATE_BEACON:
1088 limUpdateBeacon(pMac);
1089 break;
1090
Jeff Johnson295189b2012-06-20 16:38:30 -07001091 case SIR_CFG_PARAM_UPDATE_IND:
1092 /// CFG parameter updated
1093 if (limIsSystemInScanState(pMac))
1094 {
1095 // System is in DFS (Learn) mode
1096 // Defer processsing this message
1097 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1098 {
Leela Venkata Kiran Kumar Reddy Chirala2247e962013-03-22 19:21:10 -07001099 if(!(pMac->lim.deferredMsgCnt & 0xF))
1100 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001101 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 -07001102 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1103 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
Leela Venkata Kiran Kumar Reddy Chirala2247e962013-03-22 19:21:10 -07001104 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001105 limLogSessionStates(pMac);
1106 limPrintMsgName(pMac, LOGE, limMsg->type);
1107 }
1108 }
1109 else
1110 {
1111 limHandleCFGparamUpdate(pMac, limMsg->bodyval);
1112 }
1113
1114 break;
1115
1116 case WDA_INIT_SCAN_RSP:
1117 limProcessInitScanRsp(pMac, limMsg->bodyptr);
1118 break;
1119
1120 case WDA_START_SCAN_RSP:
1121 limProcessStartScanRsp(pMac, limMsg->bodyptr);
1122 break;
1123
1124 case WDA_END_SCAN_RSP:
1125 limProcessEndScanRsp(pMac, limMsg->bodyptr);
1126 break;
1127
1128 case WDA_FINISH_SCAN_RSP:
1129 limProcessFinishScanRsp(pMac, limMsg->bodyptr);
1130 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001131#ifdef FEATURE_OEM_DATA_SUPPORT
1132 case WDA_START_OEM_DATA_RSP:
1133 limProcessOemDataRsp(pMac, limMsg->bodyptr);
1134 break;
1135#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001136
1137 case WDA_SWITCH_CHANNEL_RSP:
1138 limProcessSwitchChannelRsp(pMac, limMsg->bodyptr);
1139 break;
1140
1141#ifdef ANI_SIR_IBSS_PEER_CACHING
1142 case WDA_IBSS_STA_ADD:
1143 limIbssStaAdd(pMac, limMsg->bodyptr);
1144 break;
1145#endif
1146 case SIR_BB_XPORT_MGMT_MSG:
1147 // These messages are from Peer MAC entity.
1148#ifdef WLAN_DEBUG
1149 pMac->lim.numBbt++;
1150#endif
1151
Jeff Johnson295189b2012-06-20 16:38:30 -07001152 {
1153 v_U16_t pktLen = 0;
1154 vos_pkt_t *pVosPkt;
1155 VOS_STATUS vosStatus;
1156 tSirMsgQ limMsgNew;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001157#ifdef FEATURE_WLAN_TDLS_INTERNAL
1158 tANI_U32 *pBD = NULL ;
1159#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001160
1161 /* The original limMsg which we were deferring have the
1162 * bodyPointer point to 'BD' instead of 'Vos pkt'. If we don't make a copy
1163 * of limMsg, then vos_pkt_peek_data will overwrite the limMsg->bodyPointer.
1164 * and next time when we try to process the msg, we will try to use 'BD' as
1165 * 'Vos Pkt' which will cause a crash
1166 */
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301167 vos_mem_copy((tANI_U8*)&limMsgNew, (tANI_U8*)limMsg,
1168 sizeof(tSirMsgQ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001169 pVosPkt = (vos_pkt_t *)limMsgNew.bodyptr;
1170 vos_pkt_get_packet_length(pVosPkt, &pktLen);
1171
1172 vosStatus = WDA_DS_PeekRxPacketInfo( pVosPkt, (v_PVOID_t *)&limMsgNew.bodyptr, VOS_FALSE );
1173
1174 if( !VOS_IS_STATUS_SUCCESS(vosStatus) )
1175 {
1176 vos_pkt_return_packet(pVosPkt);
1177 break;
1178
1179 }
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001180#ifdef FEATURE_WLAN_TDLS_INTERNAL
1181 /*
1182 * TDLS frames comes as translated frames as well as
1183 * MAC 802.11 data frames..
1184 */
1185 limGetBDfromRxPacket(pMac, limMsgNew.bodyptr, &pBD);
1186 if(0 != WDA_GET_RX_FT_DONE(pBD))
1187 {
1188 /*
1189 * TODO: check for scanning state and set deferMesg flag
1190 * accordingly..
1191 */
1192 deferMsg = false ;
1193
1194 limProcessTdlsFrame(pMac, pBD) ;
1195 }
1196 else
1197#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001198 limHandle80211Frames(pMac, &limMsgNew, &deferMsg);
1199
1200 if ( deferMsg == true )
1201 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001202 PELOG1(limLog(pMac, LOG1, FL("Defer message type=%X "), limMsg->type);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001203 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1204 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001205 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 -07001206 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1207 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
1208 limLogSessionStates(pMac);
1209 limPrintMsgName(pMac, LOGE, limMsg->type);
1210 vos_pkt_return_packet(pVosPkt);
1211 }
1212 }
1213 else
1214 {
1215 /* PE is not deferring this 802.11 frame so we need to call vos_pkt_return.
1216 * Asumption here is when Rx mgmt frame processing is done,
1217 * voss packet could be freed here.
1218 */
1219 vos_pkt_return_packet(pVosPkt);
1220 }
1221 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001222 break;
1223
1224 case eWNI_SME_SCAN_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001225 case eWNI_SME_REMAIN_ON_CHANNEL_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001226 case eWNI_SME_DISASSOC_REQ:
1227 case eWNI_SME_DEAUTH_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001228 case eWNI_SME_GET_SCANNED_CHANNEL_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -07001229#ifdef FEATURE_OEM_DATA_SUPPORT
1230 case eWNI_SME_OEM_DATA_REQ:
1231#endif
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001232#ifdef FEATURE_WLAN_TDLS
1233 case eWNI_SME_TDLS_SEND_MGMT_REQ:
1234 case eWNI_SME_TDLS_ADD_STA_REQ:
1235 case eWNI_SME_TDLS_DEL_STA_REQ:
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301236 case eWNI_SME_TDLS_LINK_ESTABLISH_REQ:
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001237#endif
1238#ifdef FEATURE_WLAN_TDLS_INTERNAL
1239 case eWNI_SME_TDLS_DISCOVERY_START_REQ:
1240 case eWNI_SME_TDLS_LINK_START_REQ:
1241 case eWNI_SME_TDLS_TEARDOWN_REQ:
1242#endif
Gopichand Nakkalacca24d12013-03-07 17:05:07 +05301243 case eWNI_SME_RESET_AP_CAPS_CHANGED:
Jeff Johnson295189b2012-06-20 16:38:30 -07001244 // These messages are from HDD
1245 limProcessNormalHddMsg(pMac, limMsg, true); //need to response to hdd
1246 break;
1247
1248 case eWNI_SME_SCAN_ABORT_IND:
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301249 {
1250 tANI_U8 *pSessionId = (tANI_U8 *)limMsg->bodyptr;
1251 limProcessAbortScanInd(pMac, *pSessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -07001252 vos_mem_free((v_VOID_t *)limMsg->bodyptr);
1253 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001254 break;
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301255 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001256 case eWNI_SME_START_REQ:
1257 case eWNI_SME_SYS_READY_IND:
1258#ifndef WNI_ASKEY_NON_SUPPORT_FEATURE
1259 case eWNI_SME_JOIN_REQ:
1260#endif
1261 case eWNI_SME_AUTH_REQ:
1262 case eWNI_SME_REASSOC_REQ:
1263 case eWNI_SME_START_BSS_REQ:
1264 case eWNI_SME_STOP_BSS_REQ:
1265 case eWNI_SME_SWITCH_CHL_REQ:
1266 case eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ:
1267 case eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ:
1268 case eWNI_SME_SETCONTEXT_REQ:
1269 case eWNI_SME_REMOVEKEY_REQ:
1270#ifndef WNI_ASKEY_NON_SUPPORT_FEATURE
1271 case eWNI_SME_PROMISCUOUS_MODE_REQ:
1272#endif
1273 case eWNI_SME_DISASSOC_CNF:
1274 case eWNI_SME_DEAUTH_CNF:
1275 case eWNI_SME_ASSOC_CNF:
1276 case eWNI_SME_REASSOC_CNF:
1277 case eWNI_SME_ADDTS_REQ:
1278 case eWNI_SME_DELTS_REQ:
1279 case eWNI_SME_DEL_BA_PEER_IND:
1280 case eWNI_SME_SET_TX_POWER_REQ:
1281 case eWNI_SME_GET_TX_POWER_REQ:
1282 case eWNI_SME_GET_NOISE_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001283 case eWNI_SME_GET_ASSOC_STAS_REQ:
1284 case eWNI_SME_TKIP_CNTR_MEAS_REQ:
1285 case eWNI_SME_UPDATE_APWPSIE_REQ:
1286 case eWNI_SME_HIDE_SSID_REQ:
1287 case eWNI_SME_GET_WPSPBC_SESSION_REQ:
1288 case eWNI_SME_SET_APWPARSNIEs_REQ:
Madan Mohan Koyyalamudi167b95e2012-11-27 15:53:38 -08001289 case eWNI_SME_CHNG_MCC_BEACON_INTERVAL:
Jeff Johnson295189b2012-06-20 16:38:30 -07001290#if defined WLAN_FEATURE_VOWIFI
1291 case eWNI_SME_NEIGHBOR_REPORT_REQ_IND:
1292 case eWNI_SME_BEACON_REPORT_RESP_XMIT_IND:
1293#endif
1294#if defined FEATURE_WLAN_CCX
1295 case eWNI_SME_CCX_ADJACENT_AP_REPORT:
1296#endif
1297#ifdef WLAN_FEATURE_VOWIFI_11R
1298 case eWNI_SME_FT_UPDATE_KEY:
1299 case eWNI_SME_FT_PRE_AUTH_REQ:
1300 case eWNI_SME_FT_AGGR_QOS_REQ:
1301#endif
1302 case eWNI_SME_ADD_STA_SELF_REQ:
1303 case eWNI_SME_DEL_STA_SELF_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001304 case eWNI_SME_REGISTER_MGMT_FRAME_REQ:
1305 case eWNI_SME_UPDATE_NOA:
Gopichand Nakkalac178ac82013-05-30 19:53:39 +05301306 case eWNI_SME_CLEAR_DFS_CHANNEL_LIST:
Madan Mohan Koyyalamudi44bbc152013-07-05 21:13:10 +05301307 case eWNI_SME_STA_STAT_REQ:
1308 case eWNI_SME_AGGR_STAT_REQ:
1309 case eWNI_SME_GLOBAL_STAT_REQ:
1310 case eWNI_SME_STAT_SUMM_REQ:
1311 case eWNI_SME_GET_STATISTICS_REQ:
1312#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
1313 case eWNI_SME_GET_ROAM_RSSI_REQ:
1314#endif
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001315#if defined(FEATURE_WLAN_CCX) && defined(FEATURE_WLAN_CCX_UPLOAD)
1316 case eWNI_SME_GET_TSM_STATS_REQ:
1317#endif /* FEATURE_WLAN_CCX && FEATURE_WLAN_CCX_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001318 // These messages are from HDD
1319 limProcessNormalHddMsg(pMac, limMsg, false); //no need to response to hdd
1320 break;
1321
1322 //Power Save Messages From HDD
1323 case eWNI_PMC_PWR_SAVE_CFG:
1324 case eWNI_PMC_ENTER_BMPS_REQ:
1325 case eWNI_PMC_EXIT_BMPS_REQ:
1326 case eWNI_PMC_ENTER_IMPS_REQ:
1327 case eWNI_PMC_EXIT_IMPS_REQ:
1328 case eWNI_PMC_ENTER_UAPSD_REQ:
1329 case eWNI_PMC_EXIT_UAPSD_REQ:
1330 case eWNI_PMC_ENTER_WOWL_REQ:
1331 case eWNI_PMC_EXIT_WOWL_REQ:
1332 case eWNI_PMC_WOWL_ADD_BCAST_PTRN:
1333 case eWNI_PMC_WOWL_DEL_BCAST_PTRN:
1334 pmmProcessMessage(pMac, limMsg);
1335 break;
1336
1337 case eWNI_PMC_SMPS_STATE_IND :
1338 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001339 if(limMsg->bodyptr){
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301340 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001341 limMsg->bodyptr = NULL;
1342 }
1343 }
1344 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001345 case eWNI_SME_SEND_ACTION_FRAME_IND:
1346 limSendP2PActionFrame(pMac, limMsg);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301347 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001348 limMsg->bodyptr = NULL;
1349 break;
1350 case eWNI_SME_ABORT_REMAIN_ON_CHAN_IND:
1351 limAbortRemainOnChan(pMac);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301352 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001353 limMsg->bodyptr = NULL;
1354 break;
1355
Viral Modid86bde22012-12-10 13:09:21 -08001356 case SIR_HAL_P2P_NOA_START_IND:
1357 {
1358 tpPESession psessionEntry = &pMac->lim.gpSession[0];
1359 tANI_U8 i;
Viral Modid440e682013-03-06 02:25:31 -08001360 tANI_U8 p2pGOExists = 0;
Gopichand Nakkala78a6c812013-05-13 16:39:49 +05301361
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001362 limLog(pMac, LOG1, "LIM received NOA start %x", limMsg->type);
Viral Modid440e682013-03-06 02:25:31 -08001363
1364 /* Since insert NOA is done and NOA start msg received, we should deactivate the Insert NOA timer */
1365 limDeactivateAndChangeTimer(pMac, eLIM_INSERT_SINGLESHOT_NOA_TIMER);
1366
Viral Modid86bde22012-12-10 13:09:21 -08001367 for(i=0; i < pMac->lim.maxBssId; i++)
1368 {
1369 psessionEntry = &pMac->lim.gpSession[i];
1370 if ( (psessionEntry != NULL) && (psessionEntry->valid) &&
1371 (psessionEntry->pePersona == VOS_P2P_GO_MODE))
1372 { //Save P2P NOA start attributes for P2P Go persona
Viral Modid440e682013-03-06 02:25:31 -08001373 p2pGOExists = 1;
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301374 vos_mem_copy(&psessionEntry->p2pGoPsNoaStartInd, limMsg->bodyptr,
1375 sizeof(tSirP2PNoaStart));
Viral Modid440e682013-03-06 02:25:31 -08001376 if (psessionEntry->p2pGoPsNoaStartInd.status != eHAL_STATUS_SUCCESS)
Viral Modid86bde22012-12-10 13:09:21 -08001377 {
Viral Modid440e682013-03-06 02:25:31 -08001378 limLog(pMac, LOGW, FL("GO NOA start failure status %d reported by FW."
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001379 " - still go ahead with deferred sme req. This is just info"),
Viral Modid440e682013-03-06 02:25:31 -08001380 psessionEntry->p2pGoPsNoaStartInd.status);
Viral Modid86bde22012-12-10 13:09:21 -08001381 }
Viral Modid86bde22012-12-10 13:09:21 -08001382 break;
1383 }
1384 }
Viral Modid440e682013-03-06 02:25:31 -08001385
1386 if (p2pGOExists == 0)
1387 {
1388 limLog(pMac, LOGW, FL("By the time, we received NOA start, GO is already removed."
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001389 " - still go ahead with deferred sme req. This is just info"));
Viral Modid440e682013-03-06 02:25:31 -08001390 }
1391
1392 /* We received the NOA start indication. Now we can send down the SME request which requires off-channel operation */
1393 limProcessRegdDefdSmeReqAfterNOAStart(pMac);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301394 vos_mem_free(limMsg->bodyptr);
Viral Modid86bde22012-12-10 13:09:21 -08001395 limMsg->bodyptr = NULL;
Viral Modid440e682013-03-06 02:25:31 -08001396 }
Viral Modid86bde22012-12-10 13:09:21 -08001397 break;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301398#ifdef FEATURE_WLAN_TDLS
1399 case SIR_HAL_TDLS_IND:
1400 {
1401 tSirTdlsInd *pTdlsInd = (tpSirTdlsInd)limMsg->bodyptr ;
1402 tpDphHashNode pStaDs = NULL ;
1403 tpPESession psessionEntry = NULL;
1404 tANI_U8 sessionId;
1405 if((psessionEntry = peFindSessionByStaId(pMac,pTdlsInd->staIdx,&sessionId))== NULL)
1406 {
1407 limLog(pMac, LOG1, FL("session does not exist for given bssId\n"));
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301408 vos_mem_free(limMsg->bodyptr);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301409 limMsg->bodyptr = NULL;
1410 return;
1411 }
1412 if ((pStaDs = dphGetHashEntry(pMac, pTdlsInd->assocId, &psessionEntry->dph.dphHashTable)) == NULL)
1413 {
1414 limLog(pMac, LOG1, FL("pStaDs Does not exist for given staId\n"));
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301415 vos_mem_free(limMsg->bodyptr);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301416 limMsg->bodyptr = NULL;
1417 return;
1418 }
Viral Modid86bde22012-12-10 13:09:21 -08001419
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301420 if ((STA_ENTRY_TDLS_PEER == pStaDs->staType))
1421 {
1422 limLog(pMac, LOGE,
1423 FL("received TDLS Indication from the Firmware with Reason Code %d "),
1424 pTdlsInd->reasonCode);
1425 limSendSmeTDLSDelStaInd(pMac, pStaDs, psessionEntry,
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05301426 pTdlsInd->reasonCode);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301427 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301428 vos_mem_free(limMsg->bodyptr);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301429 limMsg->bodyptr = NULL;
1430 }
1431 break;
1432#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001433 case SIR_HAL_P2P_NOA_ATTR_IND:
1434 {
1435 tpPESession psessionEntry = &pMac->lim.gpSession[0];
1436 tANI_U8 i;
1437
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001438 limLog(pMac, LOGW, FL("Received message Noa_ATTR %x"), limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -07001439 for(i=0; i < pMac->lim.maxBssId; i++)
1440 {
Viral Modid86bde22012-12-10 13:09:21 -08001441 psessionEntry = &pMac->lim.gpSession[i];
1442 if ( (psessionEntry != NULL) && (psessionEntry->valid) &&
Jeff Johnson295189b2012-06-20 16:38:30 -07001443 (psessionEntry->pePersona == VOS_P2P_GO_MODE))
1444 { //Save P2P attributes for P2P Go persona
1445
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301446 vos_mem_copy(&psessionEntry->p2pGoPsUpdate, limMsg->bodyptr,
1447 sizeof(tSirP2PNoaAttr));
1448
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001449 limLog(pMac, LOG2, FL(" &psessionEntry->bssId%02x:%02x:%02x:%02x:%02x:%02x ctWin=%d oppPsFlag=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001450 psessionEntry->bssId[0],
1451 psessionEntry->bssId[1],
1452 psessionEntry->bssId[2],
1453 psessionEntry->bssId[3],
1454 psessionEntry->bssId[4],
1455 psessionEntry->bssId[5],
1456 psessionEntry->p2pGoPsUpdate.ctWin,
1457 psessionEntry->p2pGoPsUpdate.oppPsFlag);
1458
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001459 limLog(pMac, LOG2, FL(" uNoa1IntervalCnt=%d uNoa1Duration=%d uNoa1Interval=%d uNoa1StartTime=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001460 psessionEntry->p2pGoPsUpdate.uNoa1IntervalCnt,
1461 psessionEntry->p2pGoPsUpdate.uNoa1Duration,
1462 psessionEntry->p2pGoPsUpdate.uNoa1Interval,
1463 psessionEntry->p2pGoPsUpdate.uNoa1StartTime);
1464
1465
1466 break;
1467 }
1468 }
1469
1470 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301471 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001472 limMsg->bodyptr = NULL;
1473
1474 break;
1475
1476
Jeff Johnson295189b2012-06-20 16:38:30 -07001477 /* eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER Message comes after the
1478 * device comes out of full power for the full power request sent
1479 * because of channel switch with switch count as 0, so call the same
1480 * function used in timeout case(i.e SIR_LIM_CHANNEL_SWITCH_TIMEOUT)
1481 * for switching the channel*/
1482 case eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER:
Jeff Johnsone7245742012-09-05 17:12:55 -07001483 if ( !tx_timer_running(&pMac->lim.limTimers.gLimChannelSwitchTimer) )
1484 {
1485 limProcessChannelSwitchTimeout(pMac);
1486 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301487 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001488 limMsg->bodyptr = NULL;
1489 break;
1490
1491 //Power Save Related Messages From HAL
1492 case WDA_ENTER_BMPS_RSP:
1493 case WDA_EXIT_BMPS_RSP:
1494 case WDA_EXIT_BMPS_IND:
1495 case WDA_ENTER_IMPS_RSP:
1496 case WDA_EXIT_IMPS_RSP:
1497 case WDA_ENTER_UAPSD_RSP:
1498 case WDA_EXIT_UAPSD_RSP:
1499 case WDA_WOWL_ENTER_RSP:
1500 case WDA_WOWL_EXIT_RSP:
1501 pmmProcessMessage(pMac, limMsg);
1502 break;
1503
1504 case WDA_LOW_RSSI_IND:
1505 //limHandleLowRssiInd(pMac);
1506 break;
1507
1508 case WDA_BMPS_STATUS_IND:
1509 limHandleBmpsStatusInd(pMac);
1510 break;
1511
1512 case WDA_MISSED_BEACON_IND:
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001513 limHandleMissedBeaconInd(pMac, limMsg);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301514 vos_mem_free(limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001515 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001516 break;
1517 case WDA_MIC_FAILURE_IND:
1518 limMicFailureInd(pMac, limMsg);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301519 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001520 limMsg->bodyptr = NULL;
1521 break;
1522
1523
Jeff Johnson295189b2012-06-20 16:38:30 -07001524
1525 case SIR_LIM_ADDTS_RSP_TIMEOUT:
1526 limProcessSmeReqMessages(pMac,limMsg);
1527 break;
1528#ifdef FEATURE_WLAN_CCX
1529 case SIR_LIM_CCX_TSM_TIMEOUT:
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001530#ifndef FEATURE_WLAN_CCX_UPLOAD
Jeff Johnson295189b2012-06-20 16:38:30 -07001531 limProcessTsmTimeoutHandler(pMac,limMsg);
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001532#endif /* FEATURE_WLAN_CCX_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001533 break;
1534 case WDA_TSM_STATS_RSP:
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001535#ifdef FEATURE_WLAN_CCX_UPLOAD
1536 limSendSmePECcxTsmRsp(pMac, (tAniGetTsmStatsRsp *)limMsg->bodyptr);
1537#else
Jeff Johnson295189b2012-06-20 16:38:30 -07001538 limProcessHalCcxTsmRsp(pMac, limMsg);
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001539#endif /* FEATURE_WLAN_CCX_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001540 break;
1541#endif
1542 case WDA_ADD_TS_RSP:
1543 limProcessHalAddTsRsp(pMac, limMsg);
1544 break;
1545
1546 case SIR_LIM_DEL_TS_IND:
1547 limProcessDelTsInd(pMac, limMsg);
Madan Mohan Koyyalamudif244d8f2012-11-29 11:21:05 -08001548 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001549 case SIR_LIM_ADD_BA_IND:
1550 limProcessAddBaInd(pMac, limMsg);
1551 break;
1552 case SIR_LIM_DEL_BA_ALL_IND:
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001553 limDelAllBASessions(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001554 break;
1555 case SIR_LIM_DEL_BA_IND:
1556 limProcessMlmHalBADeleteInd( pMac, limMsg );
1557 break;
1558
1559 case SIR_LIM_BEACON_GEN_IND: {
Jeff Johnson295189b2012-06-20 16:38:30 -07001560
Jeff Johnson295189b2012-06-20 16:38:30 -07001561 if( pMac->lim.gLimSystemRole != eLIM_AP_ROLE )
Jeff Johnson295189b2012-06-20 16:38:30 -07001562 schProcessPreBeaconInd(pMac, limMsg);
1563
1564 }
1565 break;
1566
1567 case SIR_LIM_DELETE_STA_CONTEXT_IND:
1568 limDeleteStaContext(pMac, limMsg);
1569 break;
1570
1571 case SIR_LIM_MIN_CHANNEL_TIMEOUT:
1572 case SIR_LIM_MAX_CHANNEL_TIMEOUT:
1573 case SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT:
1574 case SIR_LIM_JOIN_FAIL_TIMEOUT:
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001575 case SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001576 case SIR_LIM_AUTH_FAIL_TIMEOUT:
1577 case SIR_LIM_AUTH_RSP_TIMEOUT:
1578 case SIR_LIM_ASSOC_FAIL_TIMEOUT:
1579 case SIR_LIM_REASSOC_FAIL_TIMEOUT:
1580#ifdef WLAN_FEATURE_VOWIFI_11R
1581 case SIR_LIM_FT_PREAUTH_RSP_TIMEOUT:
1582#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001583 case SIR_LIM_REMAIN_CHN_TIMEOUT:
Viral Modid86bde22012-12-10 13:09:21 -08001584 case SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT:
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001585 case SIR_LIM_DISASSOC_ACK_TIMEOUT:
1586 case SIR_LIM_DEAUTH_ACK_TIMEOUT:
Gopichand Nakkalad492d202013-05-10 02:50:47 +05301587 case SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
Jeff Johnson295189b2012-06-20 16:38:30 -07001588 // These timeout messages are handled by MLM sub module
1589
1590 limProcessMlmReqMessages(pMac,
1591 limMsg);
1592
1593 break;
1594
1595 case SIR_LIM_HEART_BEAT_TIMEOUT:
1596 /** check if heart beat failed, even if one Beacon
1597 * is rcvd within the Heart Beat interval continue
1598 * normal processing
1599 */
1600
1601 #if 0
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001602 PELOG1(limLog(pMac, LOG1, FL("Heartbeat timeout, SME %d, MLME %d, #bcn %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001603 pMac->lim.gLimSmeState, pMac->lim.gLimMlmState,
1604 pMac->lim.gLimRxedBeaconCntDuringHB);)
1605
1606 if(pMac->lim.gLimSystemRole == eLIM_STA_IN_IBSS_ROLE)
1607 limIbssHeartBeatHandle(pMac); //HeartBeat for peers.
1608 else
1609 /**
1610 * Heartbeat failure occurred on STA
1611 * This is handled by LMM sub module.
1612 */
1613 limHandleHeartBeatFailure(pMac);
1614
1615 break;
1616 #endif //TO SUPPORT BT-AMP
Yathish9f22e662012-12-10 14:21:35 -08001617 if (limIsSystemInScanState(pMac))
1618 {
1619 // System is in DFS (Learn) mode
1620 // Defer processsing this message
1621 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1622 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001623 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 -08001624 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1625 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
1626 limLogSessionStates(pMac);
1627 }
1628 }
1629 else
1630 {
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001631 if (NULL == limMsg->bodyptr)
1632 {
1633 limHandleHeartBeatTimeout(pMac);
1634 }
1635 else
1636 {
1637 limHandleHeartBeatTimeoutForSession(pMac, (tpPESession)limMsg->bodyptr);
1638 }
Gopichand Nakkala78a6c812013-05-13 16:39:49 +05301639 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001640 break;
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001641
Jeff Johnson295189b2012-06-20 16:38:30 -07001642 case SIR_LIM_PROBE_HB_FAILURE_TIMEOUT:
1643 limHandleHeartBeatFailureTimeout(pMac);
1644 break;
1645
1646 case SIR_LIM_CHANNEL_SCAN_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001647 /**
1648 * Background scan timeout occurred on STA.
1649 * This is handled by LMM sub module.
1650 */
1651 limDeactivateAndChangeTimer(pMac, eLIM_BACKGROUND_SCAN_TIMER);
1652
1653 //We will do background scan even in bcnps mode
1654 //if (pMac->sys.gSysEnableScanMode)
1655 pMac->lim.gLimReportBackgroundScanResults = FALSE;
1656 limTriggerBackgroundScan(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001657 break;
1658
Jeff Johnson295189b2012-06-20 16:38:30 -07001659
1660 case SIR_LIM_HASH_MISS_THRES_TIMEOUT:
1661
1662 /*
1663 ** clear the credit to the send disassociate frame bucket
1664 **/
1665
1666 pMac->lim.gLimDisassocFrameCredit = 0;
1667 break;
1668
1669 case SIR_LIM_CNF_WAIT_TIMEOUT:
1670
1671 /*
1672 ** Does not receive CNF or dummy packet
1673 **/
1674 limHandleCnfWaitTimeout(pMac, (tANI_U16) limMsg->bodyval);
1675
1676 break;
1677
1678 case SIR_LIM_KEEPALIVE_TIMEOUT:
1679 limSendKeepAliveToPeer(pMac);
1680
1681 break;
1682
1683 case SIR_LIM_RETRY_INTERRUPT_MSG:
1684 // Message from ISR upon TFP's max retry limit interrupt
1685
1686 break;
1687
1688 case SIR_LIM_INV_KEY_INTERRUPT_MSG:
1689 // Message from ISR upon SP's Invalid session key interrupt
1690
1691 break;
1692
1693 case SIR_LIM_KEY_ID_INTERRUPT_MSG:
1694 // Message from ISR upon SP's Invalid key ID interrupt
1695
1696 break;
1697
1698 case SIR_LIM_REPLAY_THRES_INTERRUPT_MSG:
1699 // Message from ISR upon SP's Replay threshold interrupt
1700
1701 break;
1702
1703 case SIR_LIM_CHANNEL_SWITCH_TIMEOUT:
1704 limProcessChannelSwitchTimeout(pMac);
1705 break;
1706
1707 case SIR_LIM_QUIET_TIMEOUT:
1708 limProcessQuietTimeout(pMac);
1709 break;
1710
1711 case SIR_LIM_QUIET_BSS_TIMEOUT:
1712 limProcessQuietBssTimeout(pMac);
1713 break;
1714
Jeff Johnson295189b2012-06-20 16:38:30 -07001715 case SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT:
1716 limHandleUpdateOlbcCache(pMac);
1717 break;
1718#if 0
1719 case SIR_LIM_WPS_OVERLAP_TIMEOUT:
1720 limProcessWPSOverlapTimeout(pMac);
1721 break;
1722#endif
1723
Jeff Johnson295189b2012-06-20 16:38:30 -07001724
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001725#ifdef FEATURE_WLAN_TDLS_INTERNAL
1726 /*
1727 * Here discovery timer expires, now we can go ahead and collect all
1728 * the dicovery responses PE has process till now and send this
1729 * responses to SME..
1730 */
1731 case SIR_LIM_TDLS_DISCOVERY_RSP_WAIT:
1732 {
1733 //fetch the sessionEntry based on the sessionId
1734 tpPESession psessionEntry = peFindSessionBySessionId(pMac,
1735 pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId) ;
1736 if(NULL == psessionEntry)
1737 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001738 limLog(pMac, LOGP,FL("Session Does not exist for given sessionID %d"), pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId);
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001739 return;
1740 }
1741
1742 VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001743 ("Discovery Rsp timer expires ")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001744#if 0 // TDLS_hklee: D13 no need to open Addr2 unknown data packet
1745 /* restore RXP filters */
1746 limSetLinkState(pMac, eSIR_LINK_FINISH_TDLS_DISCOVERY_STATE,
1747 psessionEntry->bssId) ;
1748#endif
1749 limSendSmeTdlsDisRsp(pMac, eSIR_SUCCESS,
1750 eWNI_SME_TDLS_DISCOVERY_START_RSP) ;
1751 break ;
1752 }
1753
1754 /*
1755 * we initiated link setup and did not receive TDLS setup rsp
1756 * from TDLS peer STA, send failure RSP to SME.
1757 */
1758 case SIR_LIM_TDLS_LINK_SETUP_RSP_TIMEOUT:
1759 {
1760 tANI_U8 *peerMac = (tANI_U8 *)limMsg->bodyval ;
1761 tLimTdlsLinkSetupPeer *setupPeer = NULL ;
1762
1763 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001764 ("TDLS setup rsp timer expires ")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001765 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001766 ("TDLS setup rsp timer expires for peer:")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001767 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001768 ("%02X, %02X, %02X,%02X, %02X, %02X"),
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001769 peerMac[0],
1770 peerMac[1],
1771 peerMac[2],
1772 peerMac[3],
1773 peerMac[4],
1774 peerMac[5]);
1775
1776 limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ;
1777 if(NULL != setupPeer)
1778 {
1779 limTdlsDelLinkPeer( pMac, peerMac) ;
1780 }
1781
1782 limSendSmeTdlsLinkStartRsp(pMac, eSIR_FAILURE, peerMac,
1783 eWNI_SME_TDLS_LINK_START_RSP) ;
1784 break ;
1785 }
1786 case SIR_LIM_TDLS_LINK_SETUP_CNF_TIMEOUT:
1787 {
1788 tANI_U8 *peerMac = (tANI_U8 *)limMsg->bodyval ;
1789 tLimTdlsLinkSetupPeer *setupPeer = NULL ;
1790
1791 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001792 ("TDLS setup CNF timer expires ")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001793 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001794 ("TDLS setup CNF timer expires for peer:")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001795 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001796 ("%02X, %02X, %02X,%02X, %02X, %02X"),
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001797 peerMac[0],
1798 peerMac[1],
1799 peerMac[2],
1800 peerMac[3],
1801 peerMac[4],
1802 peerMac[5]);
1803 limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ;
1804 if(NULL != setupPeer)
1805 {
1806 limTdlsDelLinkPeer( pMac, peerMac) ;
1807 }
1808 break ;
1809 }
1810#endif /* FEATURE_WLAN_TDLS TIMER */
Jeff Johnson295189b2012-06-20 16:38:30 -07001811 case WDA_ADD_BSS_RSP:
1812 limProcessMlmAddBssRsp( pMac, limMsg );
1813 break;
1814
1815 case WDA_ADD_STA_RSP:
1816
1817 //call a wrapper by paasing bodyptr, their get sessionID and and call proper function from there.
1818 limProcessAddStaRsp(pMac,limMsg);
1819 break;
1820
1821 case WDA_DELETE_STA_RSP:
1822 limProcessMlmDelStaRsp(pMac, limMsg);
1823 break;
1824
1825 case WDA_ADD_STA_SELF_RSP:
1826 limProcessAddStaSelfRsp(pMac, limMsg);
1827 break;
1828 case WDA_DEL_STA_SELF_RSP:
1829 limProcessDelStaSelfRsp(pMac, limMsg);
1830 break;
1831
1832 case WDA_DELETE_BSS_RSP:
1833 limHandleDeleteBssRsp(pMac,limMsg); //wrapper routine to handle delete bss response
1834 break;
1835
1836 case WDA_SET_BSSKEY_RSP:
1837 case WDA_SET_STA_BCASTKEY_RSP:
1838 limProcessMlmSetBssKeyRsp( pMac, limMsg );
1839 break;
1840 case WDA_SET_STAKEY_RSP:
1841 limProcessMlmSetStaKeyRsp( pMac, limMsg );
1842 break;
1843 case WDA_REMOVE_BSSKEY_RSP:
1844 case WDA_REMOVE_STAKEY_RSP:
1845 limProcessMlmRemoveKeyRsp( pMac, limMsg );
1846 break;
1847 case WDA_ADDBA_RSP:
1848 limProcessMlmHalAddBARsp( pMac, limMsg );
1849 break;
1850
1851 case WDA_STA_STAT_RSP:
1852 case WDA_AGGR_STAT_RSP:
1853 case WDA_GLOBAL_STAT_RSP:
1854 case WDA_STAT_SUMM_RSP:
1855 limSendSmeStatsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
1856 break;
1857
1858 case WDA_GET_STATISTICS_RSP:
1859 limSendSmePEStatisticsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
1860 break;
Srinivas Girigowdad34cedb2013-01-25 13:33:11 -08001861#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
1862 case WDA_GET_ROAM_RSSI_RSP:
1863 limSendSmePEGetRoamRssiRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
1864 break;
1865#endif
1866
Jeff Johnson295189b2012-06-20 16:38:30 -07001867
1868 case WDA_SET_MIMOPS_RSP: //limProcessSetMimoRsp(pMac, limMsg);
1869 case WDA_SET_TX_POWER_RSP: //limProcessSetTxPowerRsp(pMac, limMsg);
1870 case WDA_GET_TX_POWER_RSP: //limProcessGetTxPowerRsp(pMac, limMsg);
1871 case WDA_GET_NOISE_RSP:
1872 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
1873 limMsg->bodyptr = NULL;
1874 //limProcessGetNoiseRsp(pMac, limMsg);
1875 break;
1876
1877 case WDA_SET_MAX_TX_POWER_RSP:
1878#if defined WLAN_FEATURE_VOWIFI
1879 rrmSetMaxTxPowerRsp( pMac, limMsg );
1880#endif
1881 if(limMsg->bodyptr != NULL)
1882 {
1883 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
1884 limMsg->bodyptr = NULL;
1885 }
1886 break;
1887
Jeff Johnson295189b2012-06-20 16:38:30 -07001888 case SIR_LIM_ADDR2_MISS_IND:
1889 {
1890 limLog(pMac, LOGE,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001891 FL("Addr2 mismatch interrupt received %X"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001892 limMsg->type);
1893 /*a message from HAL indicating addr2 mismatch interrupt occurred
1894 limMsg->bodyptr contains only pointer to 48-bit addr2 field*/
1895 //Dinesh fix this. the third parameter should be sessionentry.
1896 //limHandleUnknownA2IndexFrames(pMac, (void *)limMsg->bodyptr);
1897
1898 /*Free message body pointer*/
1899 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
1900 break;
1901 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001902
1903#ifdef WLAN_FEATURE_VOWIFI_11R
1904 case WDA_AGGR_QOS_RSP:
1905 limProcessFTAggrQoSRsp( pMac, limMsg );
1906 break;
1907#endif
1908
1909 case WDA_SET_LINK_STATE_RSP:
1910 linkStateParams = (tLinkStateParams *)limMsg->bodyptr;
1911#if defined WLAN_FEATURE_VOWIFI_11R
1912 pSession = linkStateParams->session;
1913 if(linkStateParams->ft)
1914 {
1915 limSendReassocReqWithFTIEsMgmtFrame(pMac,
1916 pSession->pLimMlmReassocReq,
1917 pSession);
1918 }
1919#endif
1920 if( linkStateParams->callback )
1921 {
1922 linkStateParams->callback( pMac, linkStateParams->callbackArg );
1923 }
1924 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
1925 break;
1926
1927#ifdef WLAN_FEATURE_PACKET_FILTERING
1928 case WDA_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP:
1929 pmmProcessMessage(pMac, limMsg);
1930 break;
1931#endif // WLAN_FEATURE_PACKET_FILTERING
1932
1933#ifdef WLAN_FEATURE_GTK_OFFLOAD
1934 case WDA_GTK_OFFLOAD_GETINFO_RSP:
1935 pmmProcessMessage(pMac, limMsg);
1936 break;
1937#endif // WLAN_FEATURE_GTK_OFFLOAD
Yathish9f22e662012-12-10 14:21:35 -08001938 case eWNI_SME_SET_BCN_FILTER_REQ:
1939 {
1940#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1941 tpPESession psessionEntry;
1942 tANI_U8 sessionId = (tANI_U8)limMsg->bodyval ;
1943 psessionEntry = &pMac->lim.gpSession[sessionId];
1944 if(psessionEntry != NULL && IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
1945 {
1946 // sending beacon filtering information down to HAL
1947 if (limSendBeaconFilterInfo(pMac, psessionEntry) != eSIR_SUCCESS)
1948 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001949 limLog(pMac, LOGE, FL("Fail to send Beacon Filter Info "));
Yathish9f22e662012-12-10 14:21:35 -08001950 }
1951 }
Dhanashri Atred7885c22013-03-29 11:19:05 -07001952 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
1953 limMsg->bodyptr = NULL;
Yathish9f22e662012-12-10 14:21:35 -08001954#endif
1955 }
1956 break;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301957#ifdef FEATURE_WLAN_TDLS
1958 case WDA_SET_TDLS_LINK_ESTABLISH_REQ_RSP:
1959 {
Gopichand Nakkala24be5312013-07-02 16:47:12 +05301960 tpPESession psessionEntry;
1961 tANI_U8 sessionId;
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05301962 tTdlsLinkEstablishParams *pTdlsLinkEstablishParams;
1963 pTdlsLinkEstablishParams = (tTdlsLinkEstablishParams*) limMsg->bodyptr;
Gopichand Nakkala24be5312013-07-02 16:47:12 +05301964
1965 if((psessionEntry = peFindSessionByStaId(pMac,
1966 pTdlsLinkEstablishParams->staIdx,
1967 &sessionId))== NULL)
1968 {
1969 limLog(pMac, LOGE, FL("session %u does not exist.\n"), sessionId);
1970 /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP message to SME
1971 with session id as zero and status as FAILURE so, that message
1972 queued in SME queue can be freed to prevent the SME cmd buffer leak */
1973 limSendSmeTdlsLinkEstablishReqRsp(pMac,
1974 0,
1975 NULL,
1976 NULL,
1977 eSIR_FAILURE);
1978 }
1979 else
1980 {
1981 limSendSmeTdlsLinkEstablishReqRsp(pMac,
1982 psessionEntry->smeSessionId,
1983 NULL,
1984 NULL,
1985 pTdlsLinkEstablishParams->status) ;
1986 }
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05301987 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
1988 limMsg->bodyptr = NULL;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301989 break;
1990 }
1991#endif
Gopichand Nakkala2c231c82013-06-11 17:49:16 +05301992
1993 case WDA_RX_SCAN_EVENT:
1994 limProcessRxScanEvent(pMac, limMsg->bodyptr);
1995 break;
1996
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001997 case WDA_IBSS_PEER_INACTIVITY_IND:
1998 {
1999 limProcessIbssPeerInactivity(pMac, limMsg->bodyptr);
2000 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
2001 limMsg->bodyptr = NULL;
2002 break;
2003 }
2004
Jeff Johnson295189b2012-06-20 16:38:30 -07002005 default:
2006 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
2007 limMsg->bodyptr = NULL;
2008 // Unwanted messages
2009 // Log error
2010 limLog(pMac, LOGE,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002011 FL("Discarding unexpected message received %X"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002012 limMsg->type);
2013 limPrintMsgName(pMac, LOGE, limMsg->type);
2014 break;
2015
2016 } // switch (limMsg->type)
2017
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002018 PELOG2(limLog(pMac, LOG2, FL("Done Processing msgType = %d, sme state = %s, mlm state = %s"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002019 limMsg->type, limSmeStateStr(pMac->lim.gLimSmeState),
2020 limMlmStateStr(pMac->lim.gLimMlmState));)
2021
2022} /*** end limProcessMessages() ***/
2023
2024
2025
2026/**
2027 * limProcessDeferredMessageQueue
2028 *
2029 *FUNCTION:
2030 * This function is called by LIM while exiting from Learn
2031 * mode. This function fetches messages posted to the LIM
2032 * deferred message queue limDeferredMsgQ.
2033 *
2034 *LOGIC:
2035 *
2036 *ASSUMPTIONS:
2037 * NA
2038 *
2039 *NOTE:
2040 * NA
2041 *
2042 * @param pMac - Pointer to Global MAC structure
2043 * @return None
2044 */
2045
2046void
2047limProcessDeferredMessageQueue(tpAniSirGlobal pMac)
2048{
2049 tSirMsgQ limMsg = { 0, 0, 0 };
2050
Jeff Johnson295189b2012-06-20 16:38:30 -07002051 tSirMsgQ *readMsg;
2052 tANI_U16 size;
2053
2054 /*
2055 ** check any deferred messages need to be processed
2056 **/
2057 size = pMac->lim.gLimDeferredMsgQ.size;
2058 if (size > 0)
2059 {
2060 while ((readMsg = limReadDeferredMsgQ(pMac)) != NULL)
2061 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302062 vos_mem_copy((tANI_U8*) &limMsg,
Jeff Johnson295189b2012-06-20 16:38:30 -07002063 (tANI_U8*) readMsg, sizeof(tSirMsgQ));
2064 size--;
2065 limProcessMessages(pMac, &limMsg);
2066
2067 if((limIsSystemInScanState(pMac)) || (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) ||
2068 (pMac->lim.gLimSystemInScanLearnMode))
2069 break;
2070 }
2071 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002072} /*** end limProcessDeferredMessageQueue() ***/
2073
2074
2075/*
2076 * limProcessNormalHddMsg
2077 * Function: this function checks the current lim state and decide whether the message passed shall be deffered.
2078 * @param pMac - Pointer to Global MAC structure
2079 * pLimMsg -- the message need to be processed
2080 * fRspReqd -- whether return result to hdd
2081 * @return None
2082 */
2083void limProcessNormalHddMsg(tpAniSirGlobal pMac, tSirMsgQ *pLimMsg, tANI_U8 fRspReqd)
2084{
2085 tANI_BOOLEAN fDeferMsg = eANI_BOOLEAN_TRUE;
2086
2087 /* Added For BT-AMP Support */
2088 if ((pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_AP_ROLE )
2089 ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_STA_ROLE)
2090 ||(pMac->lim.gLimSystemRole == eLIM_UNKNOWN_ROLE))
2091 {
2092 /** This check is required only for the AP and in 2 cases.
2093 * 1. If we are in learn mode and we receive any of these messages,
2094 * you have to come out of scan and process the message, hence dont
2095 * defer the message here. In handler, these message could be defered
2096 * till we actually come out of scan mode.
2097 * 2. If radar is detected, you might have to defer all of these
2098 * messages except Stop BSS request/ Switch channel request. This
2099 * decision is also made inside its handler.
2100 *
2101 * Please be careful while using the flag fDeferMsg. Possibly you
2102 * might end up in an infinite loop.
2103 **/
2104 if (((pLimMsg->type == eWNI_SME_START_BSS_REQ) ||
2105 (pLimMsg->type == eWNI_SME_STOP_BSS_REQ) ||
2106 (pLimMsg->type == eWNI_SME_SWITCH_CHL_REQ) ||
2107 (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ) ||
2108 (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ)))
2109 {
2110 fDeferMsg = eANI_BOOLEAN_FALSE;
2111 }
2112 }
2113
2114 /* limInsystemInscanState() refers the psessionEntry, how to get session Entry????*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002115 if (((pMac->lim.gLimAddtsSent) || (limIsSystemInScanState(pMac)) /*||
2116 (LIM_IS_RADAR_DETECTED(pMac))*/) && fDeferMsg)
Jeff Johnson295189b2012-06-20 16:38:30 -07002117 {
2118 // System is in DFS (Learn) mode or awaiting addts response
2119 // or if radar is detected, Defer processsing this message
2120 if (limDeferMsg(pMac, pLimMsg) != TX_SUCCESS)
2121 {
2122#ifdef WLAN_DEBUG
2123 pMac->lim.numSme++;
2124#endif
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002125 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 -07002126 pLimMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
2127 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
2128 limLogSessionStates(pMac);
2129 limPrintMsgName(pMac, LOGE, pLimMsg->type);
2130 // Release body
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302131 vos_mem_free(pLimMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07002132 }
2133 }
2134 else
2135 {
2136 if(fRspReqd)
2137 {
2138 // These messages are from HDD
2139 // Since these requests may also be generated
2140 // internally within LIM module, need to
2141 // distinquish and send response to host
2142 pMac->lim.gLimRspReqd = eANI_BOOLEAN_TRUE;
2143 }
2144#ifdef WLAN_DEBUG
2145 pMac->lim.numSme++;
2146#endif
2147 if(limProcessSmeReqMessages(pMac, pLimMsg))
2148 {
2149 // Release body
2150 // limProcessSmeReqMessage consumed the buffer. We can free it.
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302151 vos_mem_free(pLimMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07002152 }
2153 }
2154}
2155
2156void
Jeff Johnsone7245742012-09-05 17:12:55 -07002157handleHTCapabilityandHTInfo(struct sAniSirGlobal *pMac, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07002158{
2159 tSirMacHTCapabilityInfo macHTCapabilityInfo;
2160 tSirMacHTParametersInfo macHTParametersInfo;
2161 tSirMacHTInfoField1 macHTInfoField1;
2162 tSirMacHTInfoField2 macHTInfoField2;
2163 tSirMacHTInfoField3 macHTInfoField3;
2164 tANI_U32 cfgValue;
2165 tANI_U8 *ptr;
Jeff Johnson295189b2012-06-20 16:38:30 -07002166
Jeff Johnson295189b2012-06-20 16:38:30 -07002167 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_CAP_INFO, &cfgValue) != eSIR_SUCCESS)
2168 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002169 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_CAP_INFO value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002170 return ;
2171 }
2172 ptr = (tANI_U8 *) &macHTCapabilityInfo;
2173 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2174 pMac->lim.gHTLsigTXOPProtection = (tANI_U8)macHTCapabilityInfo.lsigTXOPProtection;
2175 pMac->lim.gHTMIMOPSState = (tSirMacHTMIMOPowerSaveState) macHTCapabilityInfo.mimoPowerSave;
2176 pMac->lim.gHTGreenfield = (tANI_U8)macHTCapabilityInfo.greenField;
2177 pMac->lim.gHTMaxAmsduLength = (tANI_U8)macHTCapabilityInfo.maximalAMSDUsize;
2178 pMac->lim.gHTShortGI20Mhz = (tANI_U8)macHTCapabilityInfo.shortGI20MHz;
2179 pMac->lim.gHTShortGI40Mhz = (tANI_U8)macHTCapabilityInfo.shortGI40MHz;
Jeff Johnson295189b2012-06-20 16:38:30 -07002180 pMac->lim.gHTPSMPSupport = (tANI_U8)macHTCapabilityInfo.psmp;
2181 pMac->lim.gHTDsssCckRate40MHzSupport = (tANI_U8)macHTCapabilityInfo.dsssCckMode40MHz;
2182
2183 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_AMPDU_PARAMS, &cfgValue) != eSIR_SUCCESS)
2184 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002185 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_PARAM_INFO value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002186 return ;
2187 }
2188 ptr = (tANI_U8 *) &macHTParametersInfo;
2189 *ptr = (tANI_U8) (cfgValue & 0xff);
2190 pMac->lim.gHTAMpduDensity = (tANI_U8)macHTParametersInfo.mpduDensity;
2191 pMac->lim.gHTMaxRxAMpduFactor = (tANI_U8)macHTParametersInfo.maxRxAMPDUFactor;
2192
2193 // Get HT IE Info
2194 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD1, &cfgValue) != eSIR_SUCCESS)
2195 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002196 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD1 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002197 return ;
2198 }
2199 ptr = (tANI_U8 *) &macHTInfoField1;
2200 *((tANI_U8 *)ptr) = (tANI_U8) (cfgValue & 0xff);
2201 pMac->lim.gHTServiceIntervalGranularity = (tANI_U8)macHTInfoField1.serviceIntervalGranularity;
2202 pMac->lim.gHTControlledAccessOnly = (tANI_U8)macHTInfoField1.controlledAccessOnly;
2203 pMac->lim.gHTRifsMode = (tANI_U8)macHTInfoField1.rifsMode;
Jeff Johnson295189b2012-06-20 16:38:30 -07002204
2205 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD2, &cfgValue) != eSIR_SUCCESS)
2206 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002207 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD2 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002208 return ;
2209 }
2210 ptr = (tANI_U8 *) &macHTInfoField2;
2211 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2212 pMac->lim.gHTOperMode = (tSirMacHTOperatingMode) macHTInfoField2.opMode;
2213
2214 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD3, &cfgValue) != eSIR_SUCCESS)
2215 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002216 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD3 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002217 return ;
2218 }
2219 ptr = (tANI_U8 *) &macHTInfoField3;
2220 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2221 pMac->lim.gHTPCOActive = (tANI_U8)macHTInfoField3.pcoActive;
2222 pMac->lim.gHTPCOPhase = (tANI_U8)macHTInfoField3.pcoPhase;
Jeff Johnson295189b2012-06-20 16:38:30 -07002223 pMac->lim.gHTSecondaryBeacon = (tANI_U8)macHTInfoField3.secondaryBeacon;
2224 pMac->lim.gHTDualCTSProtection = (tANI_U8)macHTInfoField3.dualCTSProtection;
2225 pMac->lim.gHTSTBCBasicMCS = (tANI_U8)macHTInfoField3.basicSTBCMCS;
Jeff Johnsone7245742012-09-05 17:12:55 -07002226
2227 /* The lim globals for channelwidth and secondary chnl have been removed and should not be used during no session;
2228 * instead direct cfg is read and used when no session for transmission of mgmt frames (same as old);
2229 * For now, we might come here during init and join with sessionEntry = NULL; in that case just fill the globals which exist
2230 * Sessionized entries values will be filled in join or add bss req. The ones which are missed in join are filled below
2231 */
2232 if (psessionEntry != NULL)
2233 {
2234 psessionEntry->htCapability = IS_DOT11_MODE_HT(psessionEntry->dot11mode);
2235 psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = (tANI_U8)macHTInfoField3.lsigTXOPProtectionFullSupport;
2236 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002237}
2238
2239void limLogSessionStates(tpAniSirGlobal pMac)
2240{
2241#ifdef WLAN_DEBUG
2242 int i;
2243
2244 for(i = 0; i < pMac->lim.maxBssId; i++)
2245 {
2246 if(pMac->lim.gpSession[i].valid)
2247 {
Madan Mohan Koyyalamudi5695b502012-09-24 14:21:12 -07002248 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 -07002249 i, pMac->lim.gpSession[i].limSystemRole, pMac->lim.gpSession[i].limSmeState,
2250 pMac->lim.gpSession[i].limPrevSmeState, pMac->lim.gpSession[i].limMlmState,
2251 pMac->lim.gpSession[i].limPrevMlmState);)
2252 }
2253 }
2254#endif //ifdef WLAN_DEBUG
2255}