blob: 68b877395d564d2c4a1487fa03c1bebe068b2f0d [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
Kiet Lamb1233192013-11-28 13:38:20 +0530851 pAbortScanParams = vos_mem_malloc(sizeof(tAbortScanParams));
852 if (NULL == pAbortScanParams)
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530853 {
854 limLog(pMac, LOGP, FL("Memory allocation failed for AbortScanParams"));
855 return eHAL_STATUS_FAILURE;
856 }
857
858 pAbortScanParams->SessionId = SessionId;
859 msg.type = WDA_STOP_SCAN_OFFLOAD_REQ;
860 msg.bodyptr = pAbortScanParams;
861 msg.bodyval = 0;
862
863 rc = wdaPostCtrlMsg(pMac, &msg);
864 if (rc != eSIR_SUCCESS)
865 {
Jeff Johnson0f4d0bc2013-11-03 17:48:50 -0800866 limLog(pMac, LOGE, FL("wdaPostCtrlMsg() return failure"));
Kiet Lamb1233192013-11-28 13:38:20 +0530867 vos_mem_free(pAbortScanParams);
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530868 return eHAL_STATUS_FAILURE;
869 }
870
871 return eHAL_STATUS_SUCCESS;
872
873}
Jeff Johnson295189b2012-06-20 16:38:30 -0700874
875/**
876 * limProcessAbortScanInd()
877 *
878 *FUNCTION:
879 * This function is called from HDD to abort the scan which is presently being run
880 *
881 *
882 *NOTE:
883 *
884 * @param pMac Pointer to Global MAC structure
885 * @param *pMsgBuf A pointer to the SME message buffer
886 * @return None
887 */
888void
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530889limProcessAbortScanInd(tpAniSirGlobal pMac, tANI_U8 SessionId)
Jeff Johnson295189b2012-06-20 16:38:30 -0700890{
891#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
892 limDiagEventReport(pMac, WLAN_PE_DIAG_SCAN_ABORT_IND_EVENT, NULL, 0, 0);
893#endif //FEATURE_WLAN_DIAG_SUPPORT
894
895 /* Deactivate the gLimBackgroundScanTimer as part of the abort scan.
896 * SME should send WNI_CFG_BACKGROUND_SCAN_PERIOD indication
897 * to start the background scan again
898 */
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -0700899 PELOG2(limLog(pMac, LOG2, FL("Processing AbortScan Ind"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700900
901 limAbortBackgroundScan(pMac);
902
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530903 if (pMac->fScanOffload)
Jeff Johnson295189b2012-06-20 16:38:30 -0700904 {
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530905 /* send stop scan cmd to fw if scan offload is enabled. */
906 limSendStopScanOffloadReq(pMac, SessionId);
907 }
908 else
909 {
910 /* Abort the scan if its running, else just return */
911 if(limIsSystemInScanState(pMac))
Jeff Johnson295189b2012-06-20 16:38:30 -0700912 {
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +0530913 if( (eLIM_HAL_INIT_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
914 (eLIM_HAL_START_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
915 (eLIM_HAL_END_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
916 (eLIM_HAL_FINISH_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState) )
917 {
918 //Simply signal we need to abort
919 limLog( pMac, LOGW, FL(" waiting for HAL, simply signal abort gLimHalScanState = %d"), pMac->lim.gLimHalScanState );
920 pMac->lim.abortScan = 1;
921 }
922 else
923 {
924 //Force abort
925 limLog( pMac, LOGW, FL(" Force aborting scan") );
926 pMac->lim.abortScan = 0;
927 limDeactivateAndChangeTimer(pMac, eLIM_MIN_CHANNEL_TIMER);
928 limDeactivateAndChangeTimer(pMac, eLIM_MAX_CHANNEL_TIMER);
929 //Set the resume channel to Any valid channel (invalid).
930 //This will instruct HAL to set it to any previous valid channel.
931 peSetResumeChannel(pMac, 0, 0);
932 limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE);
933 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700934 }
935 }
936 return;
937}
938
939/**
940 * limMessageProcessor
941 *
942 *FUNCTION:
943 * Wrapper function for limProcessMessages when handling messages received by LIM.
944 * Could either defer messages or process them.
945 * @param pMac Pointer to Global MAC structure
946 * @param limMsg Received LIM message
947 * @return None
948 */
949
950void limMessageProcessor(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
951{
952 if (eLIM_MLM_OFFLINE_STATE == pMac->lim.gLimMlmState)
953 {
954 peFreeMsg(pMac, limMsg);
955 return;
956 }
957
958 if (!defMsgDecision(pMac, limMsg))
959 {
960 limProcessMessages(pMac, limMsg);
Jeff Johnson295189b2012-06-20 16:38:30 -0700961 // process deferred message queue if allowed
962 {
963 if ( (! (pMac->lim.gLimAddtsSent))
964 &&
965 (! (limIsSystemInScanState(pMac)))
966 )
967 {
968 if (true == GET_LIM_PROCESS_DEFD_MESGS(pMac))
969 limProcessDeferredMessageQueue(pMac);
970 }
971 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700972 }
973}
974
Jeff Johnsone7245742012-09-05 17:12:55 -0700975#ifdef FEATURE_OEM_DATA_SUPPORT
976
977void limOemDataRspHandleResumeLinkRsp(tpAniSirGlobal pMac, eHalStatus status, tANI_U32* mlmOemDataRsp)
978{
979 if(status != eHAL_STATUS_SUCCESS)
980 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -0700981 limLog(pMac, LOGE, FL("OEM Data Rsp failed to get the response for resume link"));
Jeff Johnsone7245742012-09-05 17:12:55 -0700982 }
983
984 if(NULL != pMac->lim.gpLimMlmOemDataReq)
985 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +0530986 vos_mem_free(pMac->lim.gpLimMlmOemDataReq);
Jeff Johnsone7245742012-09-05 17:12:55 -0700987 pMac->lim.gpLimMlmOemDataReq = NULL;
988 }
989
990 //"Failure" status doesn't mean that Oem Data Rsp did not happen
991 //and hence we need to respond to upper layers. Only Resume link is failed, but
992 //we got the oem data response already.
993 //Post the meessage to MLM
994 limPostSmeMessage(pMac, LIM_MLM_OEM_DATA_CNF, (tANI_U32*)(mlmOemDataRsp));
995
996 return;
997}
998
999void limProcessOemDataRsp(tpAniSirGlobal pMac, tANI_U32* body)
1000{
Jeff Johnsone7245742012-09-05 17:12:55 -07001001 tpLimMlmOemDataRsp mlmOemDataRsp = NULL;
1002 tpStartOemDataRsp oemDataRsp = NULL;
1003
1004 //Process all the messages for the lim queue
1005 SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
1006
1007 oemDataRsp = (tpStartOemDataRsp)(body);
1008
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301009 mlmOemDataRsp = vos_mem_malloc(sizeof(tLimMlmOemDataRsp));
1010 if ( NULL == mlmOemDataRsp )
Jeff Johnsone7245742012-09-05 17:12:55 -07001011 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001012 limLog(pMac, LOGP, FL("could not allocate memory for mlmOemDataRsp"));
Jeff Johnsone7245742012-09-05 17:12:55 -07001013 return;
1014 }
1015
1016 //copy the memory into tLimMlmOemDataRsp and free the tStartOemDataRsp
1017 //the structures tStartOemDataRsp and tLimMlmOemDataRsp have the same structure
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301018 vos_mem_copy((void*)(mlmOemDataRsp), (void*)(oemDataRsp),
1019 sizeof(tLimMlmOemDataRsp));
Jeff Johnsone7245742012-09-05 17:12:55 -07001020
1021 //Now free the incoming memory
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301022 vos_mem_free(oemDataRsp);
Jeff Johnsone7245742012-09-05 17:12:55 -07001023
1024 limResumeLink(pMac, limOemDataRspHandleResumeLinkRsp, (tANI_U32*)mlmOemDataRsp);
1025
1026 return;
1027}
1028
1029#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001030
1031
1032/**
1033 * limProcessMessages
1034 *
1035 *FUNCTION:
1036 * This function is called by limProcessMessageQueue function. This
1037 * function processes messages received by LIM.
1038 *
1039 *LOGIC:
1040 * Depending on the message type, corresponding function will be
1041 * called, for example limProcessSmeMessages() will be called to
1042 * process SME messages received from HDD/Upper layer software module.
1043 *
1044 *ASSUMPTIONS:
1045 * NA
1046 *
1047 *NOTE:
1048 * NA
1049 *
1050 * @param pMac Pointer to Global MAC structure
1051 * @param limMsg Received LIM message
1052 * @return None
1053 */
1054
1055void
1056limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
1057{
1058 tANI_U8 deferMsg = false;
1059 tLinkStateParams *linkStateParams;
1060#if defined WLAN_FEATURE_VOWIFI_11R
1061 tpPESession pSession;
1062#endif
1063#if defined(ANI_DVT_DEBUG)
1064 tSirMsgQ msgQ;
1065#endif
1066 if(pMac->gDriverType == eDRIVER_TYPE_MFG)
1067 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301068 vos_mem_free(limMsg->bodyptr);
Jeff Johnsone7245742012-09-05 17:12:55 -07001069 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001070 return;
1071 }
1072#ifdef WLAN_DEBUG
1073 pMac->lim.numTot++;
1074#endif
1075
1076
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001077 PELOG3(limLog(pMac, LOG3, FL("rcvd msgType = %s, sme state = %s, mlm state = %s"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001078 limMsgStr(limMsg->type), limSmeStateStr(pMac->lim.gLimSmeState),
1079 limMlmStateStr(pMac->lim.gLimMlmState));)
1080
Jeff Johnsone7245742012-09-05 17:12:55 -07001081 MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(limMsg->type, LIM_MSG_PROCESSED));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001082
1083 switch (limMsg->type)
1084 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001085
1086 case SIR_LIM_UPDATE_BEACON:
1087 limUpdateBeacon(pMac);
1088 break;
1089
Jeff Johnson295189b2012-06-20 16:38:30 -07001090 case SIR_CFG_PARAM_UPDATE_IND:
1091 /// CFG parameter updated
1092 if (limIsSystemInScanState(pMac))
1093 {
1094 // System is in DFS (Learn) mode
1095 // Defer processsing this message
1096 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1097 {
Leela Venkata Kiran Kumar Reddy Chirala2247e962013-03-22 19:21:10 -07001098 if(!(pMac->lim.deferredMsgCnt & 0xF))
1099 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001100 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 -07001101 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1102 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
Leela Venkata Kiran Kumar Reddy Chirala2247e962013-03-22 19:21:10 -07001103 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001104 limLogSessionStates(pMac);
1105 limPrintMsgName(pMac, LOGE, limMsg->type);
1106 }
1107 }
1108 else
1109 {
1110 limHandleCFGparamUpdate(pMac, limMsg->bodyval);
1111 }
1112
1113 break;
1114
1115 case WDA_INIT_SCAN_RSP:
1116 limProcessInitScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001117 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001118 break;
1119
1120 case WDA_START_SCAN_RSP:
1121 limProcessStartScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001122 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001123 break;
1124
1125 case WDA_END_SCAN_RSP:
1126 limProcessEndScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001127 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001128 break;
1129
1130 case WDA_FINISH_SCAN_RSP:
1131 limProcessFinishScanRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001132 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001133 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001134#ifdef FEATURE_OEM_DATA_SUPPORT
1135 case WDA_START_OEM_DATA_RSP:
1136 limProcessOemDataRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001137 limMsg->bodyptr = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -07001138 break;
1139#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001140
1141 case WDA_SWITCH_CHANNEL_RSP:
1142 limProcessSwitchChannelRsp(pMac, limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001143 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001144 break;
1145
1146#ifdef ANI_SIR_IBSS_PEER_CACHING
1147 case WDA_IBSS_STA_ADD:
1148 limIbssStaAdd(pMac, limMsg->bodyptr);
1149 break;
1150#endif
1151 case SIR_BB_XPORT_MGMT_MSG:
1152 // These messages are from Peer MAC entity.
1153#ifdef WLAN_DEBUG
1154 pMac->lim.numBbt++;
1155#endif
1156
Jeff Johnson295189b2012-06-20 16:38:30 -07001157 {
1158 v_U16_t pktLen = 0;
1159 vos_pkt_t *pVosPkt;
1160 VOS_STATUS vosStatus;
1161 tSirMsgQ limMsgNew;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001162#ifdef FEATURE_WLAN_TDLS_INTERNAL
1163 tANI_U32 *pBD = NULL ;
1164#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001165
1166 /* The original limMsg which we were deferring have the
1167 * bodyPointer point to 'BD' instead of 'Vos pkt'. If we don't make a copy
1168 * of limMsg, then vos_pkt_peek_data will overwrite the limMsg->bodyPointer.
1169 * and next time when we try to process the msg, we will try to use 'BD' as
1170 * 'Vos Pkt' which will cause a crash
1171 */
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301172 vos_mem_copy((tANI_U8*)&limMsgNew, (tANI_U8*)limMsg,
1173 sizeof(tSirMsgQ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001174 pVosPkt = (vos_pkt_t *)limMsgNew.bodyptr;
1175 vos_pkt_get_packet_length(pVosPkt, &pktLen);
1176
1177 vosStatus = WDA_DS_PeekRxPacketInfo( pVosPkt, (v_PVOID_t *)&limMsgNew.bodyptr, VOS_FALSE );
1178
1179 if( !VOS_IS_STATUS_SUCCESS(vosStatus) )
1180 {
1181 vos_pkt_return_packet(pVosPkt);
1182 break;
1183
1184 }
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001185#ifdef FEATURE_WLAN_TDLS_INTERNAL
1186 /*
1187 * TDLS frames comes as translated frames as well as
1188 * MAC 802.11 data frames..
1189 */
1190 limGetBDfromRxPacket(pMac, limMsgNew.bodyptr, &pBD);
1191 if(0 != WDA_GET_RX_FT_DONE(pBD))
1192 {
1193 /*
1194 * TODO: check for scanning state and set deferMesg flag
1195 * accordingly..
1196 */
1197 deferMsg = false ;
1198
1199 limProcessTdlsFrame(pMac, pBD) ;
1200 }
1201 else
1202#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001203 limHandle80211Frames(pMac, &limMsgNew, &deferMsg);
1204
1205 if ( deferMsg == true )
1206 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001207 PELOG1(limLog(pMac, LOG1, FL("Defer message type=%X "), limMsg->type);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001208 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1209 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001210 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 -07001211 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1212 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
1213 limLogSessionStates(pMac);
1214 limPrintMsgName(pMac, LOGE, limMsg->type);
1215 vos_pkt_return_packet(pVosPkt);
1216 }
1217 }
1218 else
1219 {
1220 /* PE is not deferring this 802.11 frame so we need to call vos_pkt_return.
1221 * Asumption here is when Rx mgmt frame processing is done,
1222 * voss packet could be freed here.
1223 */
1224 vos_pkt_return_packet(pVosPkt);
1225 }
1226 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001227 break;
1228
1229 case eWNI_SME_SCAN_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001230 case eWNI_SME_REMAIN_ON_CHANNEL_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001231 case eWNI_SME_DISASSOC_REQ:
1232 case eWNI_SME_DEAUTH_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001233 case eWNI_SME_GET_SCANNED_CHANNEL_REQ:
Jeff Johnsone7245742012-09-05 17:12:55 -07001234#ifdef FEATURE_OEM_DATA_SUPPORT
1235 case eWNI_SME_OEM_DATA_REQ:
1236#endif
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001237#ifdef FEATURE_WLAN_TDLS
1238 case eWNI_SME_TDLS_SEND_MGMT_REQ:
1239 case eWNI_SME_TDLS_ADD_STA_REQ:
1240 case eWNI_SME_TDLS_DEL_STA_REQ:
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301241 case eWNI_SME_TDLS_LINK_ESTABLISH_REQ:
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001242#endif
1243#ifdef FEATURE_WLAN_TDLS_INTERNAL
1244 case eWNI_SME_TDLS_DISCOVERY_START_REQ:
1245 case eWNI_SME_TDLS_LINK_START_REQ:
1246 case eWNI_SME_TDLS_TEARDOWN_REQ:
1247#endif
Gopichand Nakkalacca24d12013-03-07 17:05:07 +05301248 case eWNI_SME_RESET_AP_CAPS_CHANGED:
Jeff Johnson295189b2012-06-20 16:38:30 -07001249 // These messages are from HDD
1250 limProcessNormalHddMsg(pMac, limMsg, true); //need to response to hdd
1251 break;
1252
1253 case eWNI_SME_SCAN_ABORT_IND:
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301254 {
1255 tANI_U8 *pSessionId = (tANI_U8 *)limMsg->bodyptr;
1256 limProcessAbortScanInd(pMac, *pSessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -07001257 vos_mem_free((v_VOID_t *)limMsg->bodyptr);
1258 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001259 break;
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301260 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001261 case eWNI_SME_START_REQ:
1262 case eWNI_SME_SYS_READY_IND:
1263#ifndef WNI_ASKEY_NON_SUPPORT_FEATURE
1264 case eWNI_SME_JOIN_REQ:
1265#endif
1266 case eWNI_SME_AUTH_REQ:
1267 case eWNI_SME_REASSOC_REQ:
1268 case eWNI_SME_START_BSS_REQ:
1269 case eWNI_SME_STOP_BSS_REQ:
1270 case eWNI_SME_SWITCH_CHL_REQ:
1271 case eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ:
1272 case eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ:
1273 case eWNI_SME_SETCONTEXT_REQ:
1274 case eWNI_SME_REMOVEKEY_REQ:
1275#ifndef WNI_ASKEY_NON_SUPPORT_FEATURE
1276 case eWNI_SME_PROMISCUOUS_MODE_REQ:
1277#endif
1278 case eWNI_SME_DISASSOC_CNF:
1279 case eWNI_SME_DEAUTH_CNF:
1280 case eWNI_SME_ASSOC_CNF:
1281 case eWNI_SME_REASSOC_CNF:
1282 case eWNI_SME_ADDTS_REQ:
1283 case eWNI_SME_DELTS_REQ:
1284 case eWNI_SME_DEL_BA_PEER_IND:
1285 case eWNI_SME_SET_TX_POWER_REQ:
1286 case eWNI_SME_GET_TX_POWER_REQ:
1287 case eWNI_SME_GET_NOISE_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001288 case eWNI_SME_GET_ASSOC_STAS_REQ:
1289 case eWNI_SME_TKIP_CNTR_MEAS_REQ:
1290 case eWNI_SME_UPDATE_APWPSIE_REQ:
1291 case eWNI_SME_HIDE_SSID_REQ:
1292 case eWNI_SME_GET_WPSPBC_SESSION_REQ:
1293 case eWNI_SME_SET_APWPARSNIEs_REQ:
Madan Mohan Koyyalamudi167b95e2012-11-27 15:53:38 -08001294 case eWNI_SME_CHNG_MCC_BEACON_INTERVAL:
Jeff Johnson295189b2012-06-20 16:38:30 -07001295#if defined WLAN_FEATURE_VOWIFI
1296 case eWNI_SME_NEIGHBOR_REPORT_REQ_IND:
1297 case eWNI_SME_BEACON_REPORT_RESP_XMIT_IND:
1298#endif
1299#if defined FEATURE_WLAN_CCX
1300 case eWNI_SME_CCX_ADJACENT_AP_REPORT:
1301#endif
1302#ifdef WLAN_FEATURE_VOWIFI_11R
1303 case eWNI_SME_FT_UPDATE_KEY:
1304 case eWNI_SME_FT_PRE_AUTH_REQ:
1305 case eWNI_SME_FT_AGGR_QOS_REQ:
1306#endif
1307 case eWNI_SME_ADD_STA_SELF_REQ:
1308 case eWNI_SME_DEL_STA_SELF_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001309 case eWNI_SME_REGISTER_MGMT_FRAME_REQ:
1310 case eWNI_SME_UPDATE_NOA:
Gopichand Nakkalac178ac82013-05-30 19:53:39 +05301311 case eWNI_SME_CLEAR_DFS_CHANNEL_LIST:
Madan Mohan Koyyalamudi44bbc152013-07-05 21:13:10 +05301312 case eWNI_SME_STA_STAT_REQ:
1313 case eWNI_SME_AGGR_STAT_REQ:
1314 case eWNI_SME_GLOBAL_STAT_REQ:
1315 case eWNI_SME_STAT_SUMM_REQ:
1316 case eWNI_SME_GET_STATISTICS_REQ:
1317#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
1318 case eWNI_SME_GET_ROAM_RSSI_REQ:
1319#endif
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001320#if defined(FEATURE_WLAN_CCX) && defined(FEATURE_WLAN_CCX_UPLOAD)
1321 case eWNI_SME_GET_TSM_STATS_REQ:
1322#endif /* FEATURE_WLAN_CCX && FEATURE_WLAN_CCX_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001323 // These messages are from HDD
1324 limProcessNormalHddMsg(pMac, limMsg, false); //no need to response to hdd
1325 break;
1326
1327 //Power Save Messages From HDD
1328 case eWNI_PMC_PWR_SAVE_CFG:
1329 case eWNI_PMC_ENTER_BMPS_REQ:
1330 case eWNI_PMC_EXIT_BMPS_REQ:
1331 case eWNI_PMC_ENTER_IMPS_REQ:
1332 case eWNI_PMC_EXIT_IMPS_REQ:
1333 case eWNI_PMC_ENTER_UAPSD_REQ:
1334 case eWNI_PMC_EXIT_UAPSD_REQ:
1335 case eWNI_PMC_ENTER_WOWL_REQ:
1336 case eWNI_PMC_EXIT_WOWL_REQ:
1337 case eWNI_PMC_WOWL_ADD_BCAST_PTRN:
1338 case eWNI_PMC_WOWL_DEL_BCAST_PTRN:
1339 pmmProcessMessage(pMac, limMsg);
1340 break;
1341
1342 case eWNI_PMC_SMPS_STATE_IND :
1343 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001344 if(limMsg->bodyptr){
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301345 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001346 limMsg->bodyptr = NULL;
1347 }
1348 }
1349 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001350 case eWNI_SME_SEND_ACTION_FRAME_IND:
1351 limSendP2PActionFrame(pMac, limMsg);
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 case eWNI_SME_ABORT_REMAIN_ON_CHAN_IND:
1356 limAbortRemainOnChan(pMac);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301357 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001358 limMsg->bodyptr = NULL;
1359 break;
1360
Viral Modid86bde22012-12-10 13:09:21 -08001361 case SIR_HAL_P2P_NOA_START_IND:
1362 {
1363 tpPESession psessionEntry = &pMac->lim.gpSession[0];
1364 tANI_U8 i;
Viral Modid440e682013-03-06 02:25:31 -08001365 tANI_U8 p2pGOExists = 0;
Gopichand Nakkala78a6c812013-05-13 16:39:49 +05301366
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001367 limLog(pMac, LOG1, "LIM received NOA start %x", limMsg->type);
Viral Modid440e682013-03-06 02:25:31 -08001368
1369 /* Since insert NOA is done and NOA start msg received, we should deactivate the Insert NOA timer */
1370 limDeactivateAndChangeTimer(pMac, eLIM_INSERT_SINGLESHOT_NOA_TIMER);
1371
Viral Modid86bde22012-12-10 13:09:21 -08001372 for(i=0; i < pMac->lim.maxBssId; i++)
1373 {
1374 psessionEntry = &pMac->lim.gpSession[i];
1375 if ( (psessionEntry != NULL) && (psessionEntry->valid) &&
1376 (psessionEntry->pePersona == VOS_P2P_GO_MODE))
1377 { //Save P2P NOA start attributes for P2P Go persona
Viral Modid440e682013-03-06 02:25:31 -08001378 p2pGOExists = 1;
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301379 vos_mem_copy(&psessionEntry->p2pGoPsNoaStartInd, limMsg->bodyptr,
1380 sizeof(tSirP2PNoaStart));
Viral Modid440e682013-03-06 02:25:31 -08001381 if (psessionEntry->p2pGoPsNoaStartInd.status != eHAL_STATUS_SUCCESS)
Viral Modid86bde22012-12-10 13:09:21 -08001382 {
Viral Modid440e682013-03-06 02:25:31 -08001383 limLog(pMac, LOGW, FL("GO NOA start failure status %d reported by FW."
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001384 " - still go ahead with deferred sme req. This is just info"),
Viral Modid440e682013-03-06 02:25:31 -08001385 psessionEntry->p2pGoPsNoaStartInd.status);
Viral Modid86bde22012-12-10 13:09:21 -08001386 }
Viral Modid86bde22012-12-10 13:09:21 -08001387 break;
1388 }
1389 }
Viral Modid440e682013-03-06 02:25:31 -08001390
1391 if (p2pGOExists == 0)
1392 {
1393 limLog(pMac, LOGW, FL("By the time, we received NOA start, GO is already removed."
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001394 " - still go ahead with deferred sme req. This is just info"));
Viral Modid440e682013-03-06 02:25:31 -08001395 }
1396
1397 /* We received the NOA start indication. Now we can send down the SME request which requires off-channel operation */
1398 limProcessRegdDefdSmeReqAfterNOAStart(pMac);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301399 vos_mem_free(limMsg->bodyptr);
Viral Modid86bde22012-12-10 13:09:21 -08001400 limMsg->bodyptr = NULL;
Viral Modid440e682013-03-06 02:25:31 -08001401 }
Viral Modid86bde22012-12-10 13:09:21 -08001402 break;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301403#ifdef FEATURE_WLAN_TDLS
1404 case SIR_HAL_TDLS_IND:
1405 {
1406 tSirTdlsInd *pTdlsInd = (tpSirTdlsInd)limMsg->bodyptr ;
1407 tpDphHashNode pStaDs = NULL ;
1408 tpPESession psessionEntry = NULL;
1409 tANI_U8 sessionId;
1410 if((psessionEntry = peFindSessionByStaId(pMac,pTdlsInd->staIdx,&sessionId))== NULL)
1411 {
1412 limLog(pMac, LOG1, FL("session does not exist for given bssId\n"));
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301413 vos_mem_free(limMsg->bodyptr);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301414 limMsg->bodyptr = NULL;
1415 return;
1416 }
1417 if ((pStaDs = dphGetHashEntry(pMac, pTdlsInd->assocId, &psessionEntry->dph.dphHashTable)) == NULL)
1418 {
1419 limLog(pMac, LOG1, FL("pStaDs Does not exist for given staId\n"));
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301420 vos_mem_free(limMsg->bodyptr);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301421 limMsg->bodyptr = NULL;
1422 return;
1423 }
Viral Modid86bde22012-12-10 13:09:21 -08001424
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301425 if ((STA_ENTRY_TDLS_PEER == pStaDs->staType))
1426 {
1427 limLog(pMac, LOGE,
1428 FL("received TDLS Indication from the Firmware with Reason Code %d "),
1429 pTdlsInd->reasonCode);
1430 limSendSmeTDLSDelStaInd(pMac, pStaDs, psessionEntry,
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05301431 pTdlsInd->reasonCode);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301432 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301433 vos_mem_free(limMsg->bodyptr);
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301434 limMsg->bodyptr = NULL;
1435 }
1436 break;
1437#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001438 case SIR_HAL_P2P_NOA_ATTR_IND:
1439 {
1440 tpPESession psessionEntry = &pMac->lim.gpSession[0];
1441 tANI_U8 i;
1442
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001443 limLog(pMac, LOGW, FL("Received message Noa_ATTR %x"), limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -07001444 for(i=0; i < pMac->lim.maxBssId; i++)
1445 {
Viral Modid86bde22012-12-10 13:09:21 -08001446 psessionEntry = &pMac->lim.gpSession[i];
1447 if ( (psessionEntry != NULL) && (psessionEntry->valid) &&
Jeff Johnson295189b2012-06-20 16:38:30 -07001448 (psessionEntry->pePersona == VOS_P2P_GO_MODE))
1449 { //Save P2P attributes for P2P Go persona
1450
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301451 vos_mem_copy(&psessionEntry->p2pGoPsUpdate, limMsg->bodyptr,
1452 sizeof(tSirP2PNoaAttr));
1453
Arif Hussain24bafea2013-11-15 15:10:03 -08001454 limLog(pMac, LOG2, FL(" &psessionEntry->bssId "
1455 MAC_ADDRESS_STR " ctWin=%d oppPsFlag=%d"),
1456 MAC_ADDR_ARRAY(psessionEntry->bssId),
Jeff Johnson295189b2012-06-20 16:38:30 -07001457 psessionEntry->p2pGoPsUpdate.ctWin,
1458 psessionEntry->p2pGoPsUpdate.oppPsFlag);
1459
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001460 limLog(pMac, LOG2, FL(" uNoa1IntervalCnt=%d uNoa1Duration=%d uNoa1Interval=%d uNoa1StartTime=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001461 psessionEntry->p2pGoPsUpdate.uNoa1IntervalCnt,
1462 psessionEntry->p2pGoPsUpdate.uNoa1Duration,
1463 psessionEntry->p2pGoPsUpdate.uNoa1Interval,
1464 psessionEntry->p2pGoPsUpdate.uNoa1StartTime);
1465
1466
1467 break;
1468 }
1469 }
1470
1471 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301472 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001473 limMsg->bodyptr = NULL;
1474
1475 break;
1476
1477
Jeff Johnson295189b2012-06-20 16:38:30 -07001478 /* eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER Message comes after the
1479 * device comes out of full power for the full power request sent
1480 * because of channel switch with switch count as 0, so call the same
1481 * function used in timeout case(i.e SIR_LIM_CHANNEL_SWITCH_TIMEOUT)
1482 * for switching the channel*/
1483 case eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER:
Jeff Johnsone7245742012-09-05 17:12:55 -07001484 if ( !tx_timer_running(&pMac->lim.limTimers.gLimChannelSwitchTimer) )
1485 {
1486 limProcessChannelSwitchTimeout(pMac);
1487 }
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301488 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001489 limMsg->bodyptr = NULL;
1490 break;
1491
1492 //Power Save Related Messages From HAL
1493 case WDA_ENTER_BMPS_RSP:
1494 case WDA_EXIT_BMPS_RSP:
1495 case WDA_EXIT_BMPS_IND:
1496 case WDA_ENTER_IMPS_RSP:
1497 case WDA_EXIT_IMPS_RSP:
1498 case WDA_ENTER_UAPSD_RSP:
1499 case WDA_EXIT_UAPSD_RSP:
1500 case WDA_WOWL_ENTER_RSP:
1501 case WDA_WOWL_EXIT_RSP:
1502 pmmProcessMessage(pMac, limMsg);
1503 break;
1504
1505 case WDA_LOW_RSSI_IND:
1506 //limHandleLowRssiInd(pMac);
1507 break;
1508
1509 case WDA_BMPS_STATUS_IND:
1510 limHandleBmpsStatusInd(pMac);
1511 break;
1512
1513 case WDA_MISSED_BEACON_IND:
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001514 limHandleMissedBeaconInd(pMac, limMsg);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301515 vos_mem_free(limMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001516 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001517 break;
1518 case WDA_MIC_FAILURE_IND:
1519 limMicFailureInd(pMac, limMsg);
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05301520 vos_mem_free(limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001521 limMsg->bodyptr = NULL;
1522 break;
1523
1524
Jeff Johnson295189b2012-06-20 16:38:30 -07001525
1526 case SIR_LIM_ADDTS_RSP_TIMEOUT:
1527 limProcessSmeReqMessages(pMac,limMsg);
1528 break;
1529#ifdef FEATURE_WLAN_CCX
1530 case SIR_LIM_CCX_TSM_TIMEOUT:
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001531#ifndef FEATURE_WLAN_CCX_UPLOAD
Jeff Johnson295189b2012-06-20 16:38:30 -07001532 limProcessTsmTimeoutHandler(pMac,limMsg);
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001533#endif /* FEATURE_WLAN_CCX_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001534 break;
1535 case WDA_TSM_STATS_RSP:
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001536#ifdef FEATURE_WLAN_CCX_UPLOAD
1537 limSendSmePECcxTsmRsp(pMac, (tAniGetTsmStatsRsp *)limMsg->bodyptr);
1538#else
Jeff Johnson295189b2012-06-20 16:38:30 -07001539 limProcessHalCcxTsmRsp(pMac, limMsg);
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001540#endif /* FEATURE_WLAN_CCX_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -07001541 break;
1542#endif
1543 case WDA_ADD_TS_RSP:
1544 limProcessHalAddTsRsp(pMac, limMsg);
1545 break;
1546
1547 case SIR_LIM_DEL_TS_IND:
1548 limProcessDelTsInd(pMac, limMsg);
Madan Mohan Koyyalamudif244d8f2012-11-29 11:21:05 -08001549 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001550 case SIR_LIM_ADD_BA_IND:
1551 limProcessAddBaInd(pMac, limMsg);
1552 break;
1553 case SIR_LIM_DEL_BA_ALL_IND:
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001554 limDelAllBASessions(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001555 break;
1556 case SIR_LIM_DEL_BA_IND:
1557 limProcessMlmHalBADeleteInd( pMac, limMsg );
1558 break;
1559
1560 case SIR_LIM_BEACON_GEN_IND: {
Jeff Johnson295189b2012-06-20 16:38:30 -07001561
Jeff Johnson295189b2012-06-20 16:38:30 -07001562 if( pMac->lim.gLimSystemRole != eLIM_AP_ROLE )
Jeff Johnson295189b2012-06-20 16:38:30 -07001563 schProcessPreBeaconInd(pMac, limMsg);
1564
1565 }
1566 break;
1567
1568 case SIR_LIM_DELETE_STA_CONTEXT_IND:
1569 limDeleteStaContext(pMac, limMsg);
1570 break;
1571
1572 case SIR_LIM_MIN_CHANNEL_TIMEOUT:
1573 case SIR_LIM_MAX_CHANNEL_TIMEOUT:
1574 case SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT:
1575 case SIR_LIM_JOIN_FAIL_TIMEOUT:
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001576 case SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001577 case SIR_LIM_AUTH_FAIL_TIMEOUT:
1578 case SIR_LIM_AUTH_RSP_TIMEOUT:
1579 case SIR_LIM_ASSOC_FAIL_TIMEOUT:
1580 case SIR_LIM_REASSOC_FAIL_TIMEOUT:
1581#ifdef WLAN_FEATURE_VOWIFI_11R
1582 case SIR_LIM_FT_PREAUTH_RSP_TIMEOUT:
1583#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001584 case SIR_LIM_REMAIN_CHN_TIMEOUT:
Viral Modid86bde22012-12-10 13:09:21 -08001585 case SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT:
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001586 case SIR_LIM_DISASSOC_ACK_TIMEOUT:
1587 case SIR_LIM_DEAUTH_ACK_TIMEOUT:
Gopichand Nakkalad492d202013-05-10 02:50:47 +05301588 case SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
Jeff Johnson295189b2012-06-20 16:38:30 -07001589 // These timeout messages are handled by MLM sub module
1590
1591 limProcessMlmReqMessages(pMac,
1592 limMsg);
1593
1594 break;
1595
1596 case SIR_LIM_HEART_BEAT_TIMEOUT:
1597 /** check if heart beat failed, even if one Beacon
1598 * is rcvd within the Heart Beat interval continue
1599 * normal processing
1600 */
1601
1602 #if 0
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001603 PELOG1(limLog(pMac, LOG1, FL("Heartbeat timeout, SME %d, MLME %d, #bcn %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001604 pMac->lim.gLimSmeState, pMac->lim.gLimMlmState,
1605 pMac->lim.gLimRxedBeaconCntDuringHB);)
1606
1607 if(pMac->lim.gLimSystemRole == eLIM_STA_IN_IBSS_ROLE)
1608 limIbssHeartBeatHandle(pMac); //HeartBeat for peers.
1609 else
1610 /**
1611 * Heartbeat failure occurred on STA
1612 * This is handled by LMM sub module.
1613 */
1614 limHandleHeartBeatFailure(pMac);
1615
1616 break;
1617 #endif //TO SUPPORT BT-AMP
Yathish9f22e662012-12-10 14:21:35 -08001618 if (limIsSystemInScanState(pMac))
1619 {
1620 // System is in DFS (Learn) mode
1621 // Defer processsing this message
1622 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1623 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001624 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 -08001625 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1626 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
1627 limLogSessionStates(pMac);
1628 }
1629 }
1630 else
1631 {
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001632 if (NULL == limMsg->bodyptr)
1633 {
1634 limHandleHeartBeatTimeout(pMac);
1635 }
1636 else
1637 {
1638 limHandleHeartBeatTimeoutForSession(pMac, (tpPESession)limMsg->bodyptr);
1639 }
Gopichand Nakkala78a6c812013-05-13 16:39:49 +05301640 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001641 break;
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -08001642
Jeff Johnson295189b2012-06-20 16:38:30 -07001643 case SIR_LIM_PROBE_HB_FAILURE_TIMEOUT:
1644 limHandleHeartBeatFailureTimeout(pMac);
1645 break;
1646
1647 case SIR_LIM_CHANNEL_SCAN_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001648 /**
1649 * Background scan timeout occurred on STA.
1650 * This is handled by LMM sub module.
1651 */
1652 limDeactivateAndChangeTimer(pMac, eLIM_BACKGROUND_SCAN_TIMER);
1653
1654 //We will do background scan even in bcnps mode
1655 //if (pMac->sys.gSysEnableScanMode)
1656 pMac->lim.gLimReportBackgroundScanResults = FALSE;
1657 limTriggerBackgroundScan(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001658 break;
1659
Jeff Johnson295189b2012-06-20 16:38:30 -07001660
1661 case SIR_LIM_HASH_MISS_THRES_TIMEOUT:
1662
1663 /*
1664 ** clear the credit to the send disassociate frame bucket
1665 **/
1666
1667 pMac->lim.gLimDisassocFrameCredit = 0;
1668 break;
1669
1670 case SIR_LIM_CNF_WAIT_TIMEOUT:
1671
1672 /*
1673 ** Does not receive CNF or dummy packet
1674 **/
1675 limHandleCnfWaitTimeout(pMac, (tANI_U16) limMsg->bodyval);
1676
1677 break;
1678
1679 case SIR_LIM_KEEPALIVE_TIMEOUT:
1680 limSendKeepAliveToPeer(pMac);
1681
1682 break;
1683
1684 case SIR_LIM_RETRY_INTERRUPT_MSG:
1685 // Message from ISR upon TFP's max retry limit interrupt
1686
1687 break;
1688
1689 case SIR_LIM_INV_KEY_INTERRUPT_MSG:
1690 // Message from ISR upon SP's Invalid session key interrupt
1691
1692 break;
1693
1694 case SIR_LIM_KEY_ID_INTERRUPT_MSG:
1695 // Message from ISR upon SP's Invalid key ID interrupt
1696
1697 break;
1698
1699 case SIR_LIM_REPLAY_THRES_INTERRUPT_MSG:
1700 // Message from ISR upon SP's Replay threshold interrupt
1701
1702 break;
1703
1704 case SIR_LIM_CHANNEL_SWITCH_TIMEOUT:
1705 limProcessChannelSwitchTimeout(pMac);
1706 break;
1707
1708 case SIR_LIM_QUIET_TIMEOUT:
1709 limProcessQuietTimeout(pMac);
1710 break;
1711
1712 case SIR_LIM_QUIET_BSS_TIMEOUT:
1713 limProcessQuietBssTimeout(pMac);
1714 break;
1715
Jeff Johnson295189b2012-06-20 16:38:30 -07001716 case SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT:
1717 limHandleUpdateOlbcCache(pMac);
1718 break;
1719#if 0
1720 case SIR_LIM_WPS_OVERLAP_TIMEOUT:
1721 limProcessWPSOverlapTimeout(pMac);
1722 break;
1723#endif
1724
Jeff Johnson295189b2012-06-20 16:38:30 -07001725
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001726#ifdef FEATURE_WLAN_TDLS_INTERNAL
1727 /*
1728 * Here discovery timer expires, now we can go ahead and collect all
1729 * the dicovery responses PE has process till now and send this
1730 * responses to SME..
1731 */
1732 case SIR_LIM_TDLS_DISCOVERY_RSP_WAIT:
1733 {
1734 //fetch the sessionEntry based on the sessionId
1735 tpPESession psessionEntry = peFindSessionBySessionId(pMac,
1736 pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId) ;
1737 if(NULL == psessionEntry)
1738 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001739 limLog(pMac, LOGP,FL("Session Does not exist for given sessionID %d"), pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId);
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001740 return;
1741 }
1742
1743 VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001744 ("Discovery Rsp timer expires ")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001745#if 0 // TDLS_hklee: D13 no need to open Addr2 unknown data packet
1746 /* restore RXP filters */
1747 limSetLinkState(pMac, eSIR_LINK_FINISH_TDLS_DISCOVERY_STATE,
1748 psessionEntry->bssId) ;
1749#endif
1750 limSendSmeTdlsDisRsp(pMac, eSIR_SUCCESS,
1751 eWNI_SME_TDLS_DISCOVERY_START_RSP) ;
1752 break ;
1753 }
1754
1755 /*
1756 * we initiated link setup and did not receive TDLS setup rsp
1757 * from TDLS peer STA, send failure RSP to SME.
1758 */
1759 case SIR_LIM_TDLS_LINK_SETUP_RSP_TIMEOUT:
1760 {
1761 tANI_U8 *peerMac = (tANI_U8 *)limMsg->bodyval ;
1762 tLimTdlsLinkSetupPeer *setupPeer = NULL ;
1763
1764 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001765 ("TDLS setup rsp timer expires ")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001766 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Arif Hussaina7c8e412013-11-20 11:06:42 -08001767 ("TDLS setup rsp timer expires for peer:"
1768 MAC_ADDRESS_STR), MAC_ADDR_ARRAY(peerMac));
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001769
1770 limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ;
1771 if(NULL != setupPeer)
1772 {
1773 limTdlsDelLinkPeer( pMac, peerMac) ;
1774 }
1775
1776 limSendSmeTdlsLinkStartRsp(pMac, eSIR_FAILURE, peerMac,
1777 eWNI_SME_TDLS_LINK_START_RSP) ;
1778 break ;
1779 }
1780 case SIR_LIM_TDLS_LINK_SETUP_CNF_TIMEOUT:
1781 {
1782 tANI_U8 *peerMac = (tANI_U8 *)limMsg->bodyval ;
1783 tLimTdlsLinkSetupPeer *setupPeer = NULL ;
1784
1785 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001786 ("TDLS setup CNF timer expires ")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001787 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Arif Hussaina7c8e412013-11-20 11:06:42 -08001788 ("TDLS setup CNF timer expires for peer: "
1789 MAC_ADDRESS_STR), MAC_ADDR_ARRAY(peerMac));
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001790 limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ;
1791 if(NULL != setupPeer)
1792 {
1793 limTdlsDelLinkPeer( pMac, peerMac) ;
1794 }
1795 break ;
1796 }
1797#endif /* FEATURE_WLAN_TDLS TIMER */
Jeff Johnson295189b2012-06-20 16:38:30 -07001798 case WDA_ADD_BSS_RSP:
1799 limProcessMlmAddBssRsp( pMac, limMsg );
1800 break;
1801
1802 case WDA_ADD_STA_RSP:
1803
1804 //call a wrapper by paasing bodyptr, their get sessionID and and call proper function from there.
1805 limProcessAddStaRsp(pMac,limMsg);
1806 break;
1807
1808 case WDA_DELETE_STA_RSP:
1809 limProcessMlmDelStaRsp(pMac, limMsg);
1810 break;
1811
1812 case WDA_ADD_STA_SELF_RSP:
1813 limProcessAddStaSelfRsp(pMac, limMsg);
1814 break;
1815 case WDA_DEL_STA_SELF_RSP:
1816 limProcessDelStaSelfRsp(pMac, limMsg);
1817 break;
1818
1819 case WDA_DELETE_BSS_RSP:
1820 limHandleDeleteBssRsp(pMac,limMsg); //wrapper routine to handle delete bss response
1821 break;
1822
1823 case WDA_SET_BSSKEY_RSP:
1824 case WDA_SET_STA_BCASTKEY_RSP:
1825 limProcessMlmSetBssKeyRsp( pMac, limMsg );
1826 break;
1827 case WDA_SET_STAKEY_RSP:
1828 limProcessMlmSetStaKeyRsp( pMac, limMsg );
1829 break;
1830 case WDA_REMOVE_BSSKEY_RSP:
1831 case WDA_REMOVE_STAKEY_RSP:
1832 limProcessMlmRemoveKeyRsp( pMac, limMsg );
1833 break;
1834 case WDA_ADDBA_RSP:
1835 limProcessMlmHalAddBARsp( pMac, limMsg );
1836 break;
1837
1838 case WDA_STA_STAT_RSP:
1839 case WDA_AGGR_STAT_RSP:
1840 case WDA_GLOBAL_STAT_RSP:
1841 case WDA_STAT_SUMM_RSP:
1842 limSendSmeStatsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
1843 break;
1844
1845 case WDA_GET_STATISTICS_RSP:
1846 limSendSmePEStatisticsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
1847 break;
Srinivas Girigowdad34cedb2013-01-25 13:33:11 -08001848#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
1849 case WDA_GET_ROAM_RSSI_RSP:
1850 limSendSmePEGetRoamRssiRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
1851 break;
1852#endif
1853
Jeff Johnson295189b2012-06-20 16:38:30 -07001854
1855 case WDA_SET_MIMOPS_RSP: //limProcessSetMimoRsp(pMac, limMsg);
1856 case WDA_SET_TX_POWER_RSP: //limProcessSetTxPowerRsp(pMac, limMsg);
1857 case WDA_GET_TX_POWER_RSP: //limProcessGetTxPowerRsp(pMac, limMsg);
1858 case WDA_GET_NOISE_RSP:
1859 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
1860 limMsg->bodyptr = NULL;
1861 //limProcessGetNoiseRsp(pMac, limMsg);
1862 break;
1863
1864 case WDA_SET_MAX_TX_POWER_RSP:
1865#if defined WLAN_FEATURE_VOWIFI
1866 rrmSetMaxTxPowerRsp( pMac, limMsg );
1867#endif
1868 if(limMsg->bodyptr != NULL)
1869 {
1870 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
1871 limMsg->bodyptr = NULL;
1872 }
1873 break;
1874
Jeff Johnson295189b2012-06-20 16:38:30 -07001875 case SIR_LIM_ADDR2_MISS_IND:
1876 {
1877 limLog(pMac, LOGE,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001878 FL("Addr2 mismatch interrupt received %X"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001879 limMsg->type);
1880 /*a message from HAL indicating addr2 mismatch interrupt occurred
1881 limMsg->bodyptr contains only pointer to 48-bit addr2 field*/
1882 //Dinesh fix this. the third parameter should be sessionentry.
1883 //limHandleUnknownA2IndexFrames(pMac, (void *)limMsg->bodyptr);
1884
1885 /*Free message body pointer*/
1886 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001887 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001888 break;
1889 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001890
1891#ifdef WLAN_FEATURE_VOWIFI_11R
1892 case WDA_AGGR_QOS_RSP:
1893 limProcessFTAggrQoSRsp( pMac, limMsg );
1894 break;
1895#endif
1896
1897 case WDA_SET_LINK_STATE_RSP:
1898 linkStateParams = (tLinkStateParams *)limMsg->bodyptr;
1899#if defined WLAN_FEATURE_VOWIFI_11R
1900 pSession = linkStateParams->session;
1901 if(linkStateParams->ft)
1902 {
1903 limSendReassocReqWithFTIEsMgmtFrame(pMac,
1904 pSession->pLimMlmReassocReq,
1905 pSession);
1906 }
1907#endif
1908 if( linkStateParams->callback )
1909 {
1910 linkStateParams->callback( pMac, linkStateParams->callbackArg );
1911 }
1912 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08001913 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001914 break;
1915
1916#ifdef WLAN_FEATURE_PACKET_FILTERING
1917 case WDA_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP:
1918 pmmProcessMessage(pMac, limMsg);
1919 break;
1920#endif // WLAN_FEATURE_PACKET_FILTERING
1921
1922#ifdef WLAN_FEATURE_GTK_OFFLOAD
1923 case WDA_GTK_OFFLOAD_GETINFO_RSP:
1924 pmmProcessMessage(pMac, limMsg);
1925 break;
1926#endif // WLAN_FEATURE_GTK_OFFLOAD
Yathish9f22e662012-12-10 14:21:35 -08001927 case eWNI_SME_SET_BCN_FILTER_REQ:
1928 {
1929#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1930 tpPESession psessionEntry;
1931 tANI_U8 sessionId = (tANI_U8)limMsg->bodyval ;
1932 psessionEntry = &pMac->lim.gpSession[sessionId];
1933 if(psessionEntry != NULL && IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
1934 {
1935 // sending beacon filtering information down to HAL
1936 if (limSendBeaconFilterInfo(pMac, psessionEntry) != eSIR_SUCCESS)
1937 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07001938 limLog(pMac, LOGE, FL("Fail to send Beacon Filter Info "));
Yathish9f22e662012-12-10 14:21:35 -08001939 }
1940 }
Dhanashri Atred7885c22013-03-29 11:19:05 -07001941 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
1942 limMsg->bodyptr = NULL;
Yathish9f22e662012-12-10 14:21:35 -08001943#endif
1944 }
1945 break;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301946#ifdef FEATURE_WLAN_TDLS
1947 case WDA_SET_TDLS_LINK_ESTABLISH_REQ_RSP:
1948 {
Gopichand Nakkala24be5312013-07-02 16:47:12 +05301949 tpPESession psessionEntry;
1950 tANI_U8 sessionId;
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05301951 tTdlsLinkEstablishParams *pTdlsLinkEstablishParams;
1952 pTdlsLinkEstablishParams = (tTdlsLinkEstablishParams*) limMsg->bodyptr;
Gopichand Nakkala24be5312013-07-02 16:47:12 +05301953
1954 if((psessionEntry = peFindSessionByStaId(pMac,
1955 pTdlsLinkEstablishParams->staIdx,
1956 &sessionId))== NULL)
1957 {
1958 limLog(pMac, LOGE, FL("session %u does not exist.\n"), sessionId);
1959 /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP message to SME
1960 with session id as zero and status as FAILURE so, that message
1961 queued in SME queue can be freed to prevent the SME cmd buffer leak */
1962 limSendSmeTdlsLinkEstablishReqRsp(pMac,
1963 0,
1964 NULL,
1965 NULL,
1966 eSIR_FAILURE);
1967 }
1968 else
1969 {
1970 limSendSmeTdlsLinkEstablishReqRsp(pMac,
1971 psessionEntry->smeSessionId,
1972 NULL,
1973 NULL,
1974 pTdlsLinkEstablishParams->status) ;
1975 }
Gopichand Nakkala574f6d12013-06-27 19:38:43 +05301976 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
1977 limMsg->bodyptr = NULL;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +05301978 break;
1979 }
1980#endif
Gopichand Nakkala2c231c82013-06-11 17:49:16 +05301981
1982 case WDA_RX_SCAN_EVENT:
1983 limProcessRxScanEvent(pMac, limMsg->bodyptr);
1984 break;
1985
Ravi Joshid2ca7c42013-07-23 08:37:49 -07001986 case WDA_IBSS_PEER_INACTIVITY_IND:
1987 {
1988 limProcessIbssPeerInactivity(pMac, limMsg->bodyptr);
1989 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
1990 limMsg->bodyptr = NULL;
1991 break;
1992 }
1993
Jeff Johnson295189b2012-06-20 16:38:30 -07001994 default:
1995 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
1996 limMsg->bodyptr = NULL;
1997 // Unwanted messages
1998 // Log error
1999 limLog(pMac, LOGE,
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002000 FL("Discarding unexpected message received %X"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002001 limMsg->type);
2002 limPrintMsgName(pMac, LOGE, limMsg->type);
2003 break;
2004
2005 } // switch (limMsg->type)
2006
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002007 PELOG2(limLog(pMac, LOG2, FL("Done Processing msgType = %d, sme state = %s, mlm state = %s"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002008 limMsg->type, limSmeStateStr(pMac->lim.gLimSmeState),
2009 limMlmStateStr(pMac->lim.gLimMlmState));)
2010
2011} /*** end limProcessMessages() ***/
2012
2013
2014
2015/**
2016 * limProcessDeferredMessageQueue
2017 *
2018 *FUNCTION:
2019 * This function is called by LIM while exiting from Learn
2020 * mode. This function fetches messages posted to the LIM
2021 * deferred message queue limDeferredMsgQ.
2022 *
2023 *LOGIC:
2024 *
2025 *ASSUMPTIONS:
2026 * NA
2027 *
2028 *NOTE:
2029 * NA
2030 *
2031 * @param pMac - Pointer to Global MAC structure
2032 * @return None
2033 */
2034
2035void
2036limProcessDeferredMessageQueue(tpAniSirGlobal pMac)
2037{
2038 tSirMsgQ limMsg = { 0, 0, 0 };
2039
Jeff Johnson295189b2012-06-20 16:38:30 -07002040 tSirMsgQ *readMsg;
2041 tANI_U16 size;
2042
2043 /*
2044 ** check any deferred messages need to be processed
2045 **/
2046 size = pMac->lim.gLimDeferredMsgQ.size;
2047 if (size > 0)
2048 {
2049 while ((readMsg = limReadDeferredMsgQ(pMac)) != NULL)
2050 {
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302051 vos_mem_copy((tANI_U8*) &limMsg,
Jeff Johnson295189b2012-06-20 16:38:30 -07002052 (tANI_U8*) readMsg, sizeof(tSirMsgQ));
2053 size--;
2054 limProcessMessages(pMac, &limMsg);
2055
2056 if((limIsSystemInScanState(pMac)) || (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) ||
2057 (pMac->lim.gLimSystemInScanLearnMode))
2058 break;
2059 }
2060 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002061} /*** end limProcessDeferredMessageQueue() ***/
2062
2063
2064/*
2065 * limProcessNormalHddMsg
2066 * Function: this function checks the current lim state and decide whether the message passed shall be deffered.
2067 * @param pMac - Pointer to Global MAC structure
2068 * pLimMsg -- the message need to be processed
2069 * fRspReqd -- whether return result to hdd
2070 * @return None
2071 */
2072void limProcessNormalHddMsg(tpAniSirGlobal pMac, tSirMsgQ *pLimMsg, tANI_U8 fRspReqd)
2073{
2074 tANI_BOOLEAN fDeferMsg = eANI_BOOLEAN_TRUE;
2075
2076 /* Added For BT-AMP Support */
2077 if ((pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_AP_ROLE )
2078 ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_STA_ROLE)
2079 ||(pMac->lim.gLimSystemRole == eLIM_UNKNOWN_ROLE))
2080 {
2081 /** This check is required only for the AP and in 2 cases.
2082 * 1. If we are in learn mode and we receive any of these messages,
2083 * you have to come out of scan and process the message, hence dont
2084 * defer the message here. In handler, these message could be defered
2085 * till we actually come out of scan mode.
2086 * 2. If radar is detected, you might have to defer all of these
2087 * messages except Stop BSS request/ Switch channel request. This
2088 * decision is also made inside its handler.
2089 *
2090 * Please be careful while using the flag fDeferMsg. Possibly you
2091 * might end up in an infinite loop.
2092 **/
2093 if (((pLimMsg->type == eWNI_SME_START_BSS_REQ) ||
2094 (pLimMsg->type == eWNI_SME_STOP_BSS_REQ) ||
2095 (pLimMsg->type == eWNI_SME_SWITCH_CHL_REQ) ||
2096 (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ) ||
2097 (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ)))
2098 {
2099 fDeferMsg = eANI_BOOLEAN_FALSE;
2100 }
2101 }
2102
2103 /* limInsystemInscanState() refers the psessionEntry, how to get session Entry????*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002104 if (((pMac->lim.gLimAddtsSent) || (limIsSystemInScanState(pMac)) /*||
2105 (LIM_IS_RADAR_DETECTED(pMac))*/) && fDeferMsg)
Jeff Johnson295189b2012-06-20 16:38:30 -07002106 {
2107 // System is in DFS (Learn) mode or awaiting addts response
2108 // or if radar is detected, Defer processsing this message
2109 if (limDeferMsg(pMac, pLimMsg) != TX_SUCCESS)
2110 {
2111#ifdef WLAN_DEBUG
2112 pMac->lim.numSme++;
2113#endif
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002114 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 -07002115 pLimMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
2116 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
2117 limLogSessionStates(pMac);
2118 limPrintMsgName(pMac, LOGE, pLimMsg->type);
2119 // Release body
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302120 vos_mem_free(pLimMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08002121 pLimMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07002122 }
2123 }
2124 else
2125 {
2126 if(fRspReqd)
2127 {
2128 // These messages are from HDD
2129 // Since these requests may also be generated
2130 // internally within LIM module, need to
2131 // distinquish and send response to host
2132 pMac->lim.gLimRspReqd = eANI_BOOLEAN_TRUE;
2133 }
2134#ifdef WLAN_DEBUG
2135 pMac->lim.numSme++;
2136#endif
2137 if(limProcessSmeReqMessages(pMac, pLimMsg))
2138 {
2139 // Release body
2140 // limProcessSmeReqMessage consumed the buffer. We can free it.
Bansidhar Gopalachari1d9c6162013-07-11 10:24:30 +05302141 vos_mem_free(pLimMsg->bodyptr);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -08002142 pLimMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07002143 }
2144 }
2145}
2146
2147void
Jeff Johnsone7245742012-09-05 17:12:55 -07002148handleHTCapabilityandHTInfo(struct sAniSirGlobal *pMac, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07002149{
2150 tSirMacHTCapabilityInfo macHTCapabilityInfo;
2151 tSirMacHTParametersInfo macHTParametersInfo;
2152 tSirMacHTInfoField1 macHTInfoField1;
2153 tSirMacHTInfoField2 macHTInfoField2;
2154 tSirMacHTInfoField3 macHTInfoField3;
2155 tANI_U32 cfgValue;
2156 tANI_U8 *ptr;
Jeff Johnson295189b2012-06-20 16:38:30 -07002157
Jeff Johnson295189b2012-06-20 16:38:30 -07002158 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_CAP_INFO, &cfgValue) != eSIR_SUCCESS)
2159 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002160 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_CAP_INFO value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002161 return ;
2162 }
2163 ptr = (tANI_U8 *) &macHTCapabilityInfo;
2164 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2165 pMac->lim.gHTLsigTXOPProtection = (tANI_U8)macHTCapabilityInfo.lsigTXOPProtection;
2166 pMac->lim.gHTMIMOPSState = (tSirMacHTMIMOPowerSaveState) macHTCapabilityInfo.mimoPowerSave;
2167 pMac->lim.gHTGreenfield = (tANI_U8)macHTCapabilityInfo.greenField;
2168 pMac->lim.gHTMaxAmsduLength = (tANI_U8)macHTCapabilityInfo.maximalAMSDUsize;
2169 pMac->lim.gHTShortGI20Mhz = (tANI_U8)macHTCapabilityInfo.shortGI20MHz;
2170 pMac->lim.gHTShortGI40Mhz = (tANI_U8)macHTCapabilityInfo.shortGI40MHz;
Jeff Johnson295189b2012-06-20 16:38:30 -07002171 pMac->lim.gHTPSMPSupport = (tANI_U8)macHTCapabilityInfo.psmp;
2172 pMac->lim.gHTDsssCckRate40MHzSupport = (tANI_U8)macHTCapabilityInfo.dsssCckMode40MHz;
2173
2174 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_AMPDU_PARAMS, &cfgValue) != eSIR_SUCCESS)
2175 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002176 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_PARAM_INFO value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002177 return ;
2178 }
2179 ptr = (tANI_U8 *) &macHTParametersInfo;
2180 *ptr = (tANI_U8) (cfgValue & 0xff);
2181 pMac->lim.gHTAMpduDensity = (tANI_U8)macHTParametersInfo.mpduDensity;
2182 pMac->lim.gHTMaxRxAMpduFactor = (tANI_U8)macHTParametersInfo.maxRxAMPDUFactor;
2183
2184 // Get HT IE Info
2185 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD1, &cfgValue) != eSIR_SUCCESS)
2186 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002187 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD1 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002188 return ;
2189 }
2190 ptr = (tANI_U8 *) &macHTInfoField1;
2191 *((tANI_U8 *)ptr) = (tANI_U8) (cfgValue & 0xff);
2192 pMac->lim.gHTServiceIntervalGranularity = (tANI_U8)macHTInfoField1.serviceIntervalGranularity;
2193 pMac->lim.gHTControlledAccessOnly = (tANI_U8)macHTInfoField1.controlledAccessOnly;
2194 pMac->lim.gHTRifsMode = (tANI_U8)macHTInfoField1.rifsMode;
Jeff Johnson295189b2012-06-20 16:38:30 -07002195
2196 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD2, &cfgValue) != eSIR_SUCCESS)
2197 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002198 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD2 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002199 return ;
2200 }
2201 ptr = (tANI_U8 *) &macHTInfoField2;
2202 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2203 pMac->lim.gHTOperMode = (tSirMacHTOperatingMode) macHTInfoField2.opMode;
2204
2205 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD3, &cfgValue) != eSIR_SUCCESS)
2206 {
Kiran Kumar Lokere531ca702013-04-01 13:24:23 -07002207 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD3 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002208 return ;
2209 }
2210 ptr = (tANI_U8 *) &macHTInfoField3;
2211 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2212 pMac->lim.gHTPCOActive = (tANI_U8)macHTInfoField3.pcoActive;
2213 pMac->lim.gHTPCOPhase = (tANI_U8)macHTInfoField3.pcoPhase;
Jeff Johnson295189b2012-06-20 16:38:30 -07002214 pMac->lim.gHTSecondaryBeacon = (tANI_U8)macHTInfoField3.secondaryBeacon;
2215 pMac->lim.gHTDualCTSProtection = (tANI_U8)macHTInfoField3.dualCTSProtection;
2216 pMac->lim.gHTSTBCBasicMCS = (tANI_U8)macHTInfoField3.basicSTBCMCS;
Jeff Johnsone7245742012-09-05 17:12:55 -07002217
2218 /* The lim globals for channelwidth and secondary chnl have been removed and should not be used during no session;
2219 * instead direct cfg is read and used when no session for transmission of mgmt frames (same as old);
2220 * For now, we might come here during init and join with sessionEntry = NULL; in that case just fill the globals which exist
2221 * Sessionized entries values will be filled in join or add bss req. The ones which are missed in join are filled below
2222 */
2223 if (psessionEntry != NULL)
2224 {
2225 psessionEntry->htCapability = IS_DOT11_MODE_HT(psessionEntry->dot11mode);
2226 psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = (tANI_U8)macHTInfoField3.lsigTXOPProtectionFullSupport;
2227 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002228}
2229
2230void limLogSessionStates(tpAniSirGlobal pMac)
2231{
2232#ifdef WLAN_DEBUG
2233 int i;
2234
2235 for(i = 0; i < pMac->lim.maxBssId; i++)
2236 {
2237 if(pMac->lim.gpSession[i].valid)
2238 {
Madan Mohan Koyyalamudi5695b502012-09-24 14:21:12 -07002239 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 -07002240 i, pMac->lim.gpSession[i].limSystemRole, pMac->lim.gpSession[i].limSmeState,
2241 pMac->lim.gpSession[i].limPrevSmeState, pMac->lim.gpSession[i].limMlmState,
2242 pMac->lim.gpSession[i].limPrevMlmState);)
2243 }
2244 }
2245#endif //ifdef WLAN_DEBUG
2246}