blob: b9712b8d934d14935f11633af6aa1097bf025a06 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala68d0c882013-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"
Yathishd8713192012-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
57#if defined FEATURE_WLAN_CCX
58#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 Modid871f222013-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 Lokere6cd2d782013-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.
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530168* Not Scanning,
Jeff Johnson295189b2012-06-20 16:38:30 -0700169*/
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 Johnson8347b442013-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 Johnson8347b442013-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 Johnson8347b442013-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 Lokere6cd2d782013-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);
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530281 else
Jeff Johnson295189b2012-06-20 16:38:30 -0700282 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;
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530302 return;
Jeff Johnson295189b2012-06-20 16:38:30 -0700303 }
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530304
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{
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530320 /* addr2 mismatch interrupt occurred this means previous
Jeff Johnson295189b2012-06-20 16:38:30 -0700321 disassociation was not successful
322 In Volans pRxPacketInfo only contains pointer 48-bit address2 field */
323 /*Send disassociation message again*/
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530324 //Dinesh need one more arguement.
Jeff Johnson295189b2012-06-20 16:38:30 -0700325 //limSendDisassocMgmtFrame(pMac, eSIR_MAC_CLASS3_FRAME_FROM_NON_ASSOC_STA_REASON,(tANI_U8 *) pRxPacketInfo);
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530326 //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 Khannac0b992f2012-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 Lokere6cd2d782013-04-01 13:24:23 -0700338 PELOG2(limLog(pMac, LOG2, FL("Ignoring A2 Invalid Packet received for MC/BC:"));
Mohit Khannac0b992f2012-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 Lokere6cd2d782013-04-01 13:24:23 -0700349 ("limHandleUnknownA2IndexFrames: type=0x%x, subtype=0x%x"),pMacHdr->fc.type, pMacHdr->fc.subType));
Mohit Khannac0b992f2012-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:
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530384 * This function is called to process to check if received frame match with
Jeff Johnson295189b2012-06-20 16:38:30 -0700385 * 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 {
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530428 limLog( pMac, LOG3,
Kiran Kumar Lokere6cd2d782013-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)
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530435 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700436 if (pLimMgmtRegistration->matchLen > 0)
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530437 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700438 if (pLimMgmtRegistration->matchLen <= framelen)
439 {
440 if (palEqualMemory(pMac, pLimMgmtRegistration->matchData,
441 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 {
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530451 /* found match! */
Jeff Johnson295189b2012-06-20 16:38:30 -0700452 match = VOS_TRUE;
453 break;
454 }
455 }
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530456
457 vosStatus =
458 vos_list_peek_next ( &pMac->lim.gLimMgmtFrameRegistratinQueue,
459 (vos_list_node_t*) pLimMgmtRegistration,
Jeff Johnson295189b2012-06-20 16:38:30 -0700460 (vos_list_node_t**) &pNext );
461 pLimMgmtRegistration = pNext;
462 pNext = NULL;
463 }
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530464
Jeff Johnson295189b2012-06-20 16:38:30 -0700465 if (match)
466 {
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530467 limLog( pMac, LOG1,
Kiran Kumar Lokere6cd2d782013-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 */
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530471 limSendSmeMgmtFrameInd( pMac, pHdr->fc.subType, (tANI_U8*)pHdr,
472 WDA_GET_RX_PAYLOAD_LEN(pBd) + sizeof(tSirMacMgmtHdr),
Jeff Johnson295189b2012-06-20 16:38:30 -0700473 pLimMgmtRegistration->sessionId,
Chilam NGde0b4112013-01-19 12:27:36 +0530474 WDA_GET_RX_CH(pBd), psessionEntry, 0);
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530475
Jeff Johnson295189b2012-06-20 16:38:30 -0700476 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
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530510static void
Jeff Johnson295189b2012-06-20 16:38:30 -0700511limHandle80211Frames(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
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -0700529 limLog( pMac, LOG4, FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700530 fc.protVer, fc.type, fc.subType, WDA_GET_RX_MAC_RATE_IDX(pRxPacketInfo));
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530531
Varun Reddy Yeturu08614702013-04-15 21:58:13 -0700532#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
533 if ( WDA_GET_ROAMCANDIDATEIND(pRxPacketInfo))
534 {
535 limLog( pMac, LOG2, FL("Notify SME with candidate ind"));
536 //send a session 0 for now - TBD
537 limSendSmeCandidateFoundInd(pMac, 0);
538 goto end;
539 }
540 if (WDA_GET_OFFLOADSCANLEARN(pRxPacketInfo))
541 {
542 if (fc.subType == SIR_MAC_MGMT_BEACON)
543 {
544 limLog( pMac, LOG2, FL("Save this beacon in LFR cache"));
545 __limHandleBeacon(pMac, limMsg, NULL);
546 }
547 else if (fc.subType == SIR_MAC_MGMT_PROBE_RSP)
548 {
549 limLog( pMac, LOG2, FL("Save this probe rsp in LFR cache"));
550 limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo);
551 }
552 else
553 {
554 limLog( pMac, LOGE, FL("Wrong frame Type %d, Subtype %d for LFR"),
555 fc.type, fc.subType);
556 }
557 goto end;
558 }
559#endif //WLAN_FEATURE_ROAM_SCAN_OFFLOAD
Jeff Johnson295189b2012-06-20 16:38:30 -0700560#ifdef FEATURE_WLAN_CCX
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530561 if (fc.type == SIR_MAC_DATA_FRAME && isFrmFt)
Jeff Johnson295189b2012-06-20 16:38:30 -0700562 {
563#if 0 // CCX TBD Need to PORT
564 tpSirMacDot3Hdr pDataFrmHdr;
565
566 pDataFrmHdr = (tpSirMacDot3Hdr)((tANI_U8 *)pBD+ WLANHAL_RX_BD_GET_MPDU_H_OFFSET(pBD));
567 if((psessionEntry = peFindSessionByBssid(pMac,pDataFrmHdr->sa,&sessionId))== NULL)
568 {
569 limLog( pMac, LOGE, FL("Session not found for Frm type %d, subtype %d, SA: "), fc.type, fc.subType);
570 limPrintMacAddr(pMac, pDataFrmHdr->sa, LOGE);
571 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pBD, limMsg->bodyptr);
572 return;
573 }
574
575 if (!psessionEntry->isCCXconnection)
576 {
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -0700577 limLog( pMac, LOGE, FL("LIM received Type %d, Subtype %d in Non CCX connection"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700578 fc.type, fc.subType);
579 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pBD, limMsg->bodyptr);
580 return;
581 }
582 limLog( pMac, LOGE, FL("Processing IAPP Frm from SA:"));
583 limPrintMacAddr(pMac, pDataFrmHdr->sa, LOGE);
584#else
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -0700585 printk("%s: Need to port handling of IAPP frames to PRIMA for CCX", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -0700586#endif
587
588
589 } else
590#endif
591 /* Added For BT-AMP Support */
592 if((psessionEntry = peFindSessionByBssid(pMac,pHdr->bssId,&sessionId))== NULL)
593 {
594#ifdef WLAN_FEATURE_VOWIFI_11R
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530595 if (fc.subType == SIR_MAC_MGMT_AUTH)
Jeff Johnson295189b2012-06-20 16:38:30 -0700596 {
597#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
Varun Reddy Yeturu9163b672013-02-11 14:05:06 -0800598 limLog( pMac, LOG1, FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700599 fc.protVer, fc.type, fc.subType, WDA_GET_RX_MAC_RATE_IDX(pRxPacketInfo));
Varun Reddy Yeturu9163b672013-02-11 14:05:06 -0800600 limPrintMacAddr(pMac, pHdr->bssId, LOG1);
Jeff Johnson295189b2012-06-20 16:38:30 -0700601#endif
602 if (limProcessAuthFrameNoSession(pMac, pRxPacketInfo, limMsg->bodyptr) == eSIR_SUCCESS)
603 {
604 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr);
605 return;
606 }
607 }
608#endif
609 if((fc.subType != SIR_MAC_MGMT_PROBE_RSP )&&
610 (fc.subType != SIR_MAC_MGMT_BEACON)&&
611 (fc.subType != SIR_MAC_MGMT_PROBE_REQ)
Jeff Johnson295189b2012-06-20 16:38:30 -0700612 && (fc.subType != SIR_MAC_MGMT_ACTION ) //Public action frame can be received from non-associated stations.
Jeff Johnson295189b2012-06-20 16:38:30 -0700613 )
614 {
615
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530616 if((psessionEntry = peFindSessionByPeerSta(pMac,pHdr->sa,&sessionId))== NULL)
Jeff Johnson295189b2012-06-20 16:38:30 -0700617 {
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -0700618 limLog(pMac, LOG1, FL("session does not exist for given bssId"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700619 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr);
620 return;
621 }
Gopichand Nakkala035315f2013-03-20 23:32:50 +0530622 }
623 // For p2p resp frames search for valid session with DA as
624 // BSSID will be SA and session will be present with DA only
625 if(fc.subType == SIR_MAC_MGMT_ACTION )
626 {
627 psessionEntry = peFindSessionByBssid(pMac,pHdr->da,&sessionId);
628 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700629 }
630
631
Jeff Johnson295189b2012-06-20 16:38:30 -0700632 /* Check if frame is registered by HDD */
633 if(limCheckMgmtRegisteredFrames(pMac, pRxPacketInfo, psessionEntry))
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530634 {
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -0700635 limLog( pMac, LOG1, FL("Received frame is passed to SME"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700636 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr);
637 return;
638 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700639
640
Jeff Johnson295189b2012-06-20 16:38:30 -0700641
642 if (fc.protVer != SIR_MAC_PROTOCOL_VERSION)
643 { // Received Frame with non-zero Protocol Version
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -0700644 limLog(pMac, LOGE, FL("Unexpected frame with protVersion %d received"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700645 fc.protVer);
646 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr);
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530647#ifdef WLAN_DEBUG
Jeff Johnson295189b2012-06-20 16:38:30 -0700648 pMac->lim.numProtErr++;
649#endif
650 return;
651 }
652
Gopichand Nakkalae0078ce2013-06-11 17:49:16 +0530653 if (!pMac->fScanOffload)
Jeff Johnson295189b2012-06-20 16:38:30 -0700654 {
Gopichand Nakkalae0078ce2013-06-11 17:49:16 +0530655 if (limIsSystemInScanState(pMac))
656 {
657 limHandleFramesInScanState(pMac, limMsg, pRxPacketInfo, pDeferMsg, psessionEntry);
658 return;
659 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700660 }
661
662/* Chance of crashing : to be done BT-AMP ........happens when broadcast probe req is received */
663
664#if 0
665 if (psessionEntry->limSystemRole == eLIM_UNKNOWN_ROLE) {
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -0700666 limLog( pMac, LOGW, FL( "gLimSystemRole is %d. Exiting..." ),psessionEntry->limSystemRole );
Jeff Johnson295189b2012-06-20 16:38:30 -0700667 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr);
668
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530669#ifdef WLAN_DEBUG
Jeff Johnson295189b2012-06-20 16:38:30 -0700670 pMac->lim.numProtErr++;
671#endif
672 return;
673 }
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530674 #endif //HACK to continue scanning
Jeff Johnson295189b2012-06-20 16:38:30 -0700675
676
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530677#ifdef WLAN_DEBUG
Jeff Johnson295189b2012-06-20 16:38:30 -0700678 pMac->lim.numMAC[fc.type][fc.subType]++;
679#endif
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530680
Jeff Johnson295189b2012-06-20 16:38:30 -0700681 switch (fc.type)
682 {
683 case SIR_MAC_MGMT_FRAME:
684 {
685 #if 0 //TBD-RAJESH fix this
686 if (limIsReassocInProgress( pMac,psessionEntry) && (fc.subType != SIR_MAC_MGMT_DISASSOC) &&
687 (fc.subType != SIR_MAC_MGMT_DEAUTH) && (fc.subType != SIR_MAC_MGMT_REASSOC_RSP))
688 {
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -0700689 limLog(pMac, LOGE, FL("Frame with Type - %d, Subtype - %d received in ReAssoc Wait state, dropping..."),
Jeff Johnson295189b2012-06-20 16:38:30 -0700690 fc.type, fc.subType);
691 return;
692 }
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530693 #endif //HACK to continue scanning
Jeff Johnson295189b2012-06-20 16:38:30 -0700694 // Received Management frame
695 switch (fc.subType)
696 {
697 case SIR_MAC_MGMT_ASSOC_REQ:
698 // Make sure the role supports Association
699 if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700700 || (psessionEntry->limSystemRole == eLIM_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700701 )
702 limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_ASSOC, psessionEntry);
703
704 else
705 {
706 // Unwanted messages - Log error
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -0700707 limLog(pMac, LOGE, FL("unexpected message received %X"),limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -0700708 limPrintMsgName(pMac, LOGE, limMsg->type);
709 }
710 break;
711
712 case SIR_MAC_MGMT_ASSOC_RSP:
713 limProcessAssocRspFrame(pMac, pRxPacketInfo, LIM_ASSOC,psessionEntry);
714 break;
715
716 case SIR_MAC_MGMT_REASSOC_REQ:
717 // Make sure the role supports Reassociation
718 if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700719 || (psessionEntry->limSystemRole == eLIM_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700720 ){
721 limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_REASSOC, psessionEntry);
722 }
723 else
724 {
725 // Unwanted messages - Log error
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -0700726 limLog(pMac, LOGE, FL("unexpected message received %X"),limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -0700727 limPrintMsgName(pMac, LOGE, limMsg->type);
728 }
729 break;
730
731 case SIR_MAC_MGMT_REASSOC_RSP:
732 limProcessAssocRspFrame(pMac, pRxPacketInfo, LIM_REASSOC,psessionEntry);
733 break;
734
735 case SIR_MAC_MGMT_PROBE_REQ:
736 limProcessProbeReqFrame_multiple_BSS(pMac, pRxPacketInfo,psessionEntry);
737 break;
738
739 case SIR_MAC_MGMT_PROBE_RSP:
740 if(psessionEntry == NULL)
741 limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo);
742 else
743 limProcessProbeRspFrame(pMac, pRxPacketInfo, psessionEntry);
744 break;
745
746 case SIR_MAC_MGMT_BEACON:
747 __limHandleBeacon(pMac, limMsg,psessionEntry);
748 break;
749
750 case SIR_MAC_MGMT_DISASSOC:
751 limProcessDisassocFrame(pMac, pRxPacketInfo,psessionEntry);
752 break;
753
754 case SIR_MAC_MGMT_AUTH:
755 limProcessAuthFrame(pMac, pRxPacketInfo,psessionEntry);
756 break;
757
758 case SIR_MAC_MGMT_DEAUTH:
759 limProcessDeauthFrame(pMac, pRxPacketInfo,psessionEntry);
760 break;
761
762 case SIR_MAC_MGMT_ACTION:
Jeff Johnson295189b2012-06-20 16:38:30 -0700763 if(psessionEntry == NULL)
764 limProcessActionFrameNoSession(pMac, pRxPacketInfo);
765 else
766 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700767 if (WDA_GET_RX_UNKNOWN_UCAST(pRxPacketInfo))
768 limHandleUnknownA2IndexFrames(pMac, pRxPacketInfo,psessionEntry);
769 else
770 limProcessActionFrame(pMac, pRxPacketInfo,psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -0700771 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700772 break;
773 default:
774 // Received Management frame of 'reserved' subtype
775 break;
776 } // switch (fc.subType)
777
778 }
779 break;
Jeff Johnson295189b2012-06-20 16:38:30 -0700780 case SIR_MAC_DATA_FRAME:
781 {
Mohit Khannac0b992f2012-12-04 15:08:18 -0800782#ifdef FEATURE_WLAN_TDLS_INTERNAL
783 /*
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530784 * if we reach here, following cases are possible.
Mohit Khannac0b992f2012-12-04 15:08:18 -0800785 * Possible cases: a) if frame translation is disabled.
786 * b) Some frame with ADRR2 filter enabled may come
787 * here.
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530788 */
Mohit Khannac0b992f2012-12-04 15:08:18 -0800789 tANI_U8 *dataOffset = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
790 tANI_U8 *rfc1042Hdr = (tANI_U8 *)(dataOffset + RFC1042_HDR_LENGTH) ;
791 tANI_U16 ethType = GET_BE16(rfc1042Hdr) ;
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530792 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -0700793 ("TDLS frame with 80211 Header")) ;
Mohit Khannac0b992f2012-12-04 15:08:18 -0800794 if(ETH_TYPE_89_0d == ethType)
795 {
796 tANI_U8 payloadType = (rfc1042Hdr + ETH_TYPE_LEN)[0] ;
797 if(PAYLOAD_TYPE_TDLS == payloadType)
798 {
799 limProcessTdlsFrame(pMac, (tANI_U32*)pRxPacketInfo) ;
800 }
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530801 }
Mohit Khannac0b992f2012-12-04 15:08:18 -0800802#endif
803#ifdef FEATURE_WLAN_CCX
Jeff Johnson295189b2012-06-20 16:38:30 -0700804 /* We accept data frame (IAPP frame) only if Session is
805 * present and ccx connection is established on that
806 * session
807 */
808 if (psessionEntry && psessionEntry->isCCXconnection) {
809 limProcessIappFrame(pMac, pRxPacketInfo, psessionEntry);
810 }
Mohit Khannac0b992f2012-12-04 15:08:18 -0800811#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700812 }
813 break;
Jeff Johnson295189b2012-06-20 16:38:30 -0700814 default:
815 // Received frame of type 'reserved'
816 break;
817
818 } // switch (fc.type)
819
Varun Reddy Yeturu08614702013-04-15 21:58:13 -0700820#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
821end:
822#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700823 limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr) ;
824 return;
825} /*** end limHandle80211Frames() ***/
826
827
828/**
829 * limProcessAbortScanInd()
830 *
831 *FUNCTION:
832 * This function is called from HDD to abort the scan which is presently being run
833 *
834 *
835 *NOTE:
836 *
837 * @param pMac Pointer to Global MAC structure
838 * @param *pMsgBuf A pointer to the SME message buffer
839 * @return None
840 */
841void
842limProcessAbortScanInd(tpAniSirGlobal pMac)
843{
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530844#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
Jeff Johnson295189b2012-06-20 16:38:30 -0700845 limDiagEventReport(pMac, WLAN_PE_DIAG_SCAN_ABORT_IND_EVENT, NULL, 0, 0);
846#endif //FEATURE_WLAN_DIAG_SUPPORT
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530847
Jeff Johnson295189b2012-06-20 16:38:30 -0700848 /* Deactivate the gLimBackgroundScanTimer as part of the abort scan.
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530849 * SME should send WNI_CFG_BACKGROUND_SCAN_PERIOD indication
Jeff Johnson295189b2012-06-20 16:38:30 -0700850 * to start the background scan again
851 */
Madan Mohan Koyyalamudi8b7f1e62012-10-05 14:56:51 -0700852 PELOG2(limLog(pMac, LOG2, FL("Processing AbortScan Ind"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700853
854 limAbortBackgroundScan(pMac);
855
856 /* Abort the scan if its running, else just return */
857 if(limIsSystemInScanState(pMac))
858 {
859 if( (eLIM_HAL_INIT_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
860 (eLIM_HAL_START_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
861 (eLIM_HAL_END_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) ||
862 (eLIM_HAL_FINISH_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState) )
863 {
864 //Simply signal we need to abort
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -0700865 limLog( pMac, LOGW, FL(" waiting for HAL, simply signal abort gLimHalScanState = %d"), pMac->lim.gLimHalScanState );
Jeff Johnson295189b2012-06-20 16:38:30 -0700866 pMac->lim.abortScan = 1;
867 }
868 else
869 {
870 //Force abort
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -0700871 limLog( pMac, LOGW, FL(" Force aborting scan") );
Jeff Johnson295189b2012-06-20 16:38:30 -0700872 pMac->lim.abortScan = 0;
873 limDeactivateAndChangeTimer(pMac, eLIM_MIN_CHANNEL_TIMER);
874 limDeactivateAndChangeTimer(pMac, eLIM_MAX_CHANNEL_TIMER);
Gopichand Nakkala68d0c882013-06-27 19:38:43 +0530875 //Set the resume channel to Any valid channel (invalid).
Jeff Johnson295189b2012-06-20 16:38:30 -0700876 //This will instruct HAL to set it to any previous valid channel.
877 peSetResumeChannel(pMac, 0, 0);
878 limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE);
879 }
880 }
881 return;
882}
883
884/**
885 * limMessageProcessor
886 *
887 *FUNCTION:
888 * Wrapper function for limProcessMessages when handling messages received by LIM.
889 * Could either defer messages or process them.
890 * @param pMac Pointer to Global MAC structure
891 * @param limMsg Received LIM message
892 * @return None
893 */
894
895void limMessageProcessor(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
896{
897 if (eLIM_MLM_OFFLINE_STATE == pMac->lim.gLimMlmState)
898 {
899 peFreeMsg(pMac, limMsg);
900 return;
901 }
902
903 if (!defMsgDecision(pMac, limMsg))
904 {
905 limProcessMessages(pMac, limMsg);
Jeff Johnson295189b2012-06-20 16:38:30 -0700906 // process deferred message queue if allowed
907 {
908 if ( (! (pMac->lim.gLimAddtsSent))
909 &&
910 (! (limIsSystemInScanState(pMac)))
911 )
912 {
913 if (true == GET_LIM_PROCESS_DEFD_MESGS(pMac))
914 limProcessDeferredMessageQueue(pMac);
915 }
916 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700917 }
918}
919
Jeff Johnsone7245742012-09-05 17:12:55 -0700920#ifdef FEATURE_OEM_DATA_SUPPORT
921
922void limOemDataRspHandleResumeLinkRsp(tpAniSirGlobal pMac, eHalStatus status, tANI_U32* mlmOemDataRsp)
923{
924 if(status != eHAL_STATUS_SUCCESS)
925 {
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -0700926 limLog(pMac, LOGE, FL("OEM Data Rsp failed to get the response for resume link"));
Jeff Johnsone7245742012-09-05 17:12:55 -0700927 }
928
929 if(NULL != pMac->lim.gpLimMlmOemDataReq)
930 {
931 palFreeMemory(pMac->hHdd, pMac->lim.gpLimMlmOemDataReq);
932 pMac->lim.gpLimMlmOemDataReq = NULL;
933 }
934
935 //"Failure" status doesn't mean that Oem Data Rsp did not happen
936 //and hence we need to respond to upper layers. Only Resume link is failed, but
937 //we got the oem data response already.
938 //Post the meessage to MLM
939 limPostSmeMessage(pMac, LIM_MLM_OEM_DATA_CNF, (tANI_U32*)(mlmOemDataRsp));
940
941 return;
942}
943
944void limProcessOemDataRsp(tpAniSirGlobal pMac, tANI_U32* body)
945{
946 eHalStatus status = eHAL_STATUS_SUCCESS;
947 tpLimMlmOemDataRsp mlmOemDataRsp = NULL;
948 tpStartOemDataRsp oemDataRsp = NULL;
949
950 //Process all the messages for the lim queue
951 SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
952
953 oemDataRsp = (tpStartOemDataRsp)(body);
954
955 status = palAllocateMemory(pMac->hHdd, (void**)(&mlmOemDataRsp), sizeof(tLimMlmOemDataRsp));
956 if(status != eHAL_STATUS_SUCCESS)
957 {
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -0700958 limLog(pMac, LOGP, FL("could not allocate memory for mlmOemDataRsp"));
Jeff Johnsone7245742012-09-05 17:12:55 -0700959 return;
960 }
961
962 //copy the memory into tLimMlmOemDataRsp and free the tStartOemDataRsp
963 //the structures tStartOemDataRsp and tLimMlmOemDataRsp have the same structure
964 palCopyMemory(pMac->hHdd, (void*)(mlmOemDataRsp), (void*)(oemDataRsp), sizeof(tLimMlmOemDataRsp));
965
966 //Now free the incoming memory
967 palFreeMemory(pMac->hHdd, (void*)(oemDataRsp));
968
969 limResumeLink(pMac, limOemDataRspHandleResumeLinkRsp, (tANI_U32*)mlmOemDataRsp);
970
971 return;
972}
973
974#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700975
976
977/**
978 * limProcessMessages
979 *
980 *FUNCTION:
981 * This function is called by limProcessMessageQueue function. This
982 * function processes messages received by LIM.
983 *
984 *LOGIC:
985 * Depending on the message type, corresponding function will be
986 * called, for example limProcessSmeMessages() will be called to
987 * process SME messages received from HDD/Upper layer software module.
988 *
989 *ASSUMPTIONS:
990 * NA
991 *
992 *NOTE:
993 * NA
994 *
995 * @param pMac Pointer to Global MAC structure
996 * @param limMsg Received LIM message
997 * @return None
998 */
999
1000void
1001limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
1002{
1003 tANI_U8 deferMsg = false;
1004 tLinkStateParams *linkStateParams;
1005#if defined WLAN_FEATURE_VOWIFI_11R
1006 tpPESession pSession;
1007#endif
1008#if defined(ANI_DVT_DEBUG)
1009 tSirMsgQ msgQ;
1010#endif
1011 if(pMac->gDriverType == eDRIVER_TYPE_MFG)
1012 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001013 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1014 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001015 return;
1016 }
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301017#ifdef WLAN_DEBUG
Jeff Johnson295189b2012-06-20 16:38:30 -07001018 pMac->lim.numTot++;
1019#endif
1020
1021
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001022 PELOG3(limLog(pMac, LOG3, FL("rcvd msgType = %s, sme state = %s, mlm state = %s"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001023 limMsgStr(limMsg->type), limSmeStateStr(pMac->lim.gLimSmeState),
1024 limMlmStateStr(pMac->lim.gLimMlmState));)
1025
Jeff Johnsone7245742012-09-05 17:12:55 -07001026 MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(limMsg->type, LIM_MSG_PROCESSED));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001027
1028 switch (limMsg->type)
1029 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001030
1031 case SIR_LIM_UPDATE_BEACON:
1032 limUpdateBeacon(pMac);
1033 break;
1034
Jeff Johnson295189b2012-06-20 16:38:30 -07001035 case SIR_CFG_PARAM_UPDATE_IND:
1036 /// CFG parameter updated
1037 if (limIsSystemInScanState(pMac))
1038 {
1039 // System is in DFS (Learn) mode
1040 // Defer processsing this message
1041 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1042 {
Leela Venkata Kiran Kumar Reddy Chirala240845a2013-03-22 19:21:10 -07001043 if(!(pMac->lim.deferredMsgCnt & 0xF))
1044 {
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001045 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 -07001046 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1047 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
Leela Venkata Kiran Kumar Reddy Chirala240845a2013-03-22 19:21:10 -07001048 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001049 limLogSessionStates(pMac);
1050 limPrintMsgName(pMac, LOGE, limMsg->type);
1051 }
1052 }
1053 else
1054 {
1055 limHandleCFGparamUpdate(pMac, limMsg->bodyval);
1056 }
1057
1058 break;
1059
1060 case WDA_INIT_SCAN_RSP:
1061 limProcessInitScanRsp(pMac, limMsg->bodyptr);
1062 break;
1063
1064 case WDA_START_SCAN_RSP:
1065 limProcessStartScanRsp(pMac, limMsg->bodyptr);
1066 break;
1067
1068 case WDA_END_SCAN_RSP:
1069 limProcessEndScanRsp(pMac, limMsg->bodyptr);
1070 break;
1071
1072 case WDA_FINISH_SCAN_RSP:
1073 limProcessFinishScanRsp(pMac, limMsg->bodyptr);
1074 break;
Jeff Johnsone7245742012-09-05 17:12:55 -07001075#ifdef FEATURE_OEM_DATA_SUPPORT
1076 case WDA_START_OEM_DATA_RSP:
1077 limProcessOemDataRsp(pMac, limMsg->bodyptr);
1078 break;
1079#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001080
1081 case WDA_SWITCH_CHANNEL_RSP:
1082 limProcessSwitchChannelRsp(pMac, limMsg->bodyptr);
1083 break;
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301084
Jeff Johnson295189b2012-06-20 16:38:30 -07001085#ifdef ANI_SIR_IBSS_PEER_CACHING
1086 case WDA_IBSS_STA_ADD:
1087 limIbssStaAdd(pMac, limMsg->bodyptr);
1088 break;
1089#endif
1090 case SIR_BB_XPORT_MGMT_MSG:
1091 // These messages are from Peer MAC entity.
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301092#ifdef WLAN_DEBUG
Jeff Johnson295189b2012-06-20 16:38:30 -07001093 pMac->lim.numBbt++;
1094#endif
1095
Jeff Johnson295189b2012-06-20 16:38:30 -07001096 {
1097 v_U16_t pktLen = 0;
1098 vos_pkt_t *pVosPkt;
1099 VOS_STATUS vosStatus;
1100 tSirMsgQ limMsgNew;
Mohit Khannac0b992f2012-12-04 15:08:18 -08001101#ifdef FEATURE_WLAN_TDLS_INTERNAL
1102 tANI_U32 *pBD = NULL ;
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301103#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001104
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301105 /* The original limMsg which we were deferring have the
Jeff Johnson295189b2012-06-20 16:38:30 -07001106 * bodyPointer point to 'BD' instead of 'Vos pkt'. If we don't make a copy
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301107 * of limMsg, then vos_pkt_peek_data will overwrite the limMsg->bodyPointer.
1108 * and next time when we try to process the msg, we will try to use 'BD' as
Jeff Johnson295189b2012-06-20 16:38:30 -07001109 * 'Vos Pkt' which will cause a crash
1110 */
1111 palCopyMemory(pMac, (tANI_U8*)&limMsgNew, (tANI_U8*)limMsg, sizeof(tSirMsgQ));
1112 pVosPkt = (vos_pkt_t *)limMsgNew.bodyptr;
1113 vos_pkt_get_packet_length(pVosPkt, &pktLen);
1114
1115 vosStatus = WDA_DS_PeekRxPacketInfo( pVosPkt, (v_PVOID_t *)&limMsgNew.bodyptr, VOS_FALSE );
1116
1117 if( !VOS_IS_STATUS_SUCCESS(vosStatus) )
1118 {
1119 vos_pkt_return_packet(pVosPkt);
1120 break;
1121
1122 }
Mohit Khannac0b992f2012-12-04 15:08:18 -08001123#ifdef FEATURE_WLAN_TDLS_INTERNAL
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301124 /*
Mohit Khannac0b992f2012-12-04 15:08:18 -08001125 * TDLS frames comes as translated frames as well as
1126 * MAC 802.11 data frames..
1127 */
1128 limGetBDfromRxPacket(pMac, limMsgNew.bodyptr, &pBD);
1129 if(0 != WDA_GET_RX_FT_DONE(pBD))
1130 {
1131 /*
1132 * TODO: check for scanning state and set deferMesg flag
1133 * accordingly..
1134 */
1135 deferMsg = false ;
1136
1137 limProcessTdlsFrame(pMac, pBD) ;
1138 }
1139 else
1140#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001141 limHandle80211Frames(pMac, &limMsgNew, &deferMsg);
1142
1143 if ( deferMsg == true )
1144 {
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001145 PELOG1(limLog(pMac, LOG1, FL("Defer message type=%X "), limMsg->type);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001146 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1147 {
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001148 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 -07001149 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1150 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
1151 limLogSessionStates(pMac);
1152 limPrintMsgName(pMac, LOGE, limMsg->type);
1153 vos_pkt_return_packet(pVosPkt);
1154 }
1155 }
1156 else
1157 {
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301158 /* PE is not deferring this 802.11 frame so we need to call vos_pkt_return.
Jeff Johnson295189b2012-06-20 16:38:30 -07001159 * Asumption here is when Rx mgmt frame processing is done,
1160 * voss packet could be freed here.
1161 */
1162 vos_pkt_return_packet(pVosPkt);
1163 }
1164 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001165 break;
1166
1167 case eWNI_SME_SCAN_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001168 case eWNI_SME_REMAIN_ON_CHANNEL_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001169 case eWNI_SME_DISASSOC_REQ:
1170 case eWNI_SME_DEAUTH_REQ:
1171 case eWNI_SME_STA_STAT_REQ:
1172 case eWNI_SME_AGGR_STAT_REQ:
1173 case eWNI_SME_GLOBAL_STAT_REQ:
1174 case eWNI_SME_STAT_SUMM_REQ:
1175 case eWNI_SME_GET_SCANNED_CHANNEL_REQ:
1176 case eWNI_SME_GET_STATISTICS_REQ:
Srinivas Girigowda2471d832013-01-25 13:33:11 -08001177#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
1178 case eWNI_SME_GET_ROAM_RSSI_REQ:
1179#endif
Jeff Johnsone7245742012-09-05 17:12:55 -07001180#ifdef FEATURE_OEM_DATA_SUPPORT
1181 case eWNI_SME_OEM_DATA_REQ:
1182#endif
Mohit Khannac0b992f2012-12-04 15:08:18 -08001183#ifdef FEATURE_WLAN_TDLS
1184 case eWNI_SME_TDLS_SEND_MGMT_REQ:
1185 case eWNI_SME_TDLS_ADD_STA_REQ:
1186 case eWNI_SME_TDLS_DEL_STA_REQ:
Gopichand Nakkalaefe3a232013-05-27 17:05:29 +05301187 case eWNI_SME_TDLS_LINK_ESTABLISH_REQ:
Mohit Khannac0b992f2012-12-04 15:08:18 -08001188#endif
1189#ifdef FEATURE_WLAN_TDLS_INTERNAL
1190 case eWNI_SME_TDLS_DISCOVERY_START_REQ:
1191 case eWNI_SME_TDLS_LINK_START_REQ:
1192 case eWNI_SME_TDLS_TEARDOWN_REQ:
1193#endif
Gopichand Nakkala2b248b02013-03-07 17:05:07 +05301194 case eWNI_SME_RESET_AP_CAPS_CHANGED:
Jeff Johnson295189b2012-06-20 16:38:30 -07001195 // These messages are from HDD
1196 limProcessNormalHddMsg(pMac, limMsg, true); //need to response to hdd
1197 break;
1198
1199 case eWNI_SME_SCAN_ABORT_IND:
1200 vos_mem_free((v_VOID_t *)limMsg->bodyptr);
1201 limMsg->bodyptr = NULL;
1202 limProcessAbortScanInd(pMac);
1203 break;
1204
1205 case eWNI_SME_START_REQ:
1206 case eWNI_SME_SYS_READY_IND:
1207#ifndef WNI_ASKEY_NON_SUPPORT_FEATURE
1208 case eWNI_SME_JOIN_REQ:
1209#endif
1210 case eWNI_SME_AUTH_REQ:
1211 case eWNI_SME_REASSOC_REQ:
1212 case eWNI_SME_START_BSS_REQ:
1213 case eWNI_SME_STOP_BSS_REQ:
1214 case eWNI_SME_SWITCH_CHL_REQ:
1215 case eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ:
1216 case eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ:
1217 case eWNI_SME_SETCONTEXT_REQ:
1218 case eWNI_SME_REMOVEKEY_REQ:
1219#ifndef WNI_ASKEY_NON_SUPPORT_FEATURE
1220 case eWNI_SME_PROMISCUOUS_MODE_REQ:
1221#endif
1222 case eWNI_SME_DISASSOC_CNF:
1223 case eWNI_SME_DEAUTH_CNF:
1224 case eWNI_SME_ASSOC_CNF:
1225 case eWNI_SME_REASSOC_CNF:
1226 case eWNI_SME_ADDTS_REQ:
1227 case eWNI_SME_DELTS_REQ:
1228 case eWNI_SME_DEL_BA_PEER_IND:
1229 case eWNI_SME_SET_TX_POWER_REQ:
1230 case eWNI_SME_GET_TX_POWER_REQ:
1231 case eWNI_SME_GET_NOISE_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001232 case eWNI_SME_GET_ASSOC_STAS_REQ:
1233 case eWNI_SME_TKIP_CNTR_MEAS_REQ:
1234 case eWNI_SME_UPDATE_APWPSIE_REQ:
1235 case eWNI_SME_HIDE_SSID_REQ:
1236 case eWNI_SME_GET_WPSPBC_SESSION_REQ:
1237 case eWNI_SME_SET_APWPARSNIEs_REQ:
Madan Mohan Koyyalamudi167b95e2012-11-27 15:53:38 -08001238 case eWNI_SME_CHNG_MCC_BEACON_INTERVAL:
Jeff Johnson295189b2012-06-20 16:38:30 -07001239#if defined WLAN_FEATURE_VOWIFI
1240 case eWNI_SME_NEIGHBOR_REPORT_REQ_IND:
1241 case eWNI_SME_BEACON_REPORT_RESP_XMIT_IND:
1242#endif
1243#if defined FEATURE_WLAN_CCX
1244 case eWNI_SME_CCX_ADJACENT_AP_REPORT:
1245#endif
1246#ifdef WLAN_FEATURE_VOWIFI_11R
1247 case eWNI_SME_FT_UPDATE_KEY:
1248 case eWNI_SME_FT_PRE_AUTH_REQ:
1249 case eWNI_SME_FT_AGGR_QOS_REQ:
1250#endif
1251 case eWNI_SME_ADD_STA_SELF_REQ:
1252 case eWNI_SME_DEL_STA_SELF_REQ:
Jeff Johnson295189b2012-06-20 16:38:30 -07001253 case eWNI_SME_REGISTER_MGMT_FRAME_REQ:
1254 case eWNI_SME_UPDATE_NOA:
Gopichand Nakkala431db382013-05-30 19:53:39 +05301255 case eWNI_SME_CLEAR_DFS_CHANNEL_LIST:
Jeff Johnson295189b2012-06-20 16:38:30 -07001256 // These messages are from HDD
1257 limProcessNormalHddMsg(pMac, limMsg, false); //no need to response to hdd
1258 break;
1259
1260 //Power Save Messages From HDD
1261 case eWNI_PMC_PWR_SAVE_CFG:
1262 case eWNI_PMC_ENTER_BMPS_REQ:
1263 case eWNI_PMC_EXIT_BMPS_REQ:
1264 case eWNI_PMC_ENTER_IMPS_REQ:
1265 case eWNI_PMC_EXIT_IMPS_REQ:
1266 case eWNI_PMC_ENTER_UAPSD_REQ:
1267 case eWNI_PMC_EXIT_UAPSD_REQ:
1268 case eWNI_PMC_ENTER_WOWL_REQ:
1269 case eWNI_PMC_EXIT_WOWL_REQ:
1270 case eWNI_PMC_WOWL_ADD_BCAST_PTRN:
1271 case eWNI_PMC_WOWL_DEL_BCAST_PTRN:
1272 pmmProcessMessage(pMac, limMsg);
1273 break;
1274
1275 case eWNI_PMC_SMPS_STATE_IND :
1276 {
Jeff Johnson295189b2012-06-20 16:38:30 -07001277 if(limMsg->bodyptr){
1278 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1279 limMsg->bodyptr = NULL;
1280 }
1281 }
1282 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001283 case eWNI_SME_SEND_ACTION_FRAME_IND:
1284 limSendP2PActionFrame(pMac, limMsg);
1285 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1286 limMsg->bodyptr = NULL;
1287 break;
1288 case eWNI_SME_ABORT_REMAIN_ON_CHAN_IND:
1289 limAbortRemainOnChan(pMac);
1290 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1291 limMsg->bodyptr = NULL;
1292 break;
1293
Viral Modi9dc288a2012-12-10 13:09:21 -08001294 case SIR_HAL_P2P_NOA_START_IND:
1295 {
1296 tpPESession psessionEntry = &pMac->lim.gpSession[0];
1297 tANI_U8 i;
Viral Modid871f222013-03-06 02:25:31 -08001298 tANI_U8 p2pGOExists = 0;
Gopichand Nakkala271463a2013-05-13 16:39:49 +05301299
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001300 limLog(pMac, LOG1, "LIM received NOA start %x", limMsg->type);
Viral Modid871f222013-03-06 02:25:31 -08001301
1302 /* Since insert NOA is done and NOA start msg received, we should deactivate the Insert NOA timer */
1303 limDeactivateAndChangeTimer(pMac, eLIM_INSERT_SINGLESHOT_NOA_TIMER);
1304
Viral Modi9dc288a2012-12-10 13:09:21 -08001305 for(i=0; i < pMac->lim.maxBssId; i++)
1306 {
1307 psessionEntry = &pMac->lim.gpSession[i];
1308 if ( (psessionEntry != NULL) && (psessionEntry->valid) &&
1309 (psessionEntry->pePersona == VOS_P2P_GO_MODE))
1310 { //Save P2P NOA start attributes for P2P Go persona
Viral Modid871f222013-03-06 02:25:31 -08001311 p2pGOExists = 1;
Viral Modi9dc288a2012-12-10 13:09:21 -08001312 palCopyMemory(pMac->hHdd, &psessionEntry->p2pGoPsNoaStartInd, limMsg->bodyptr, sizeof(tSirP2PNoaStart));
Viral Modid871f222013-03-06 02:25:31 -08001313 if (psessionEntry->p2pGoPsNoaStartInd.status != eHAL_STATUS_SUCCESS)
Viral Modi9dc288a2012-12-10 13:09:21 -08001314 {
Viral Modid871f222013-03-06 02:25:31 -08001315 limLog(pMac, LOGW, FL("GO NOA start failure status %d reported by FW."
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001316 " - still go ahead with deferred sme req. This is just info"),
Viral Modid871f222013-03-06 02:25:31 -08001317 psessionEntry->p2pGoPsNoaStartInd.status);
Viral Modi9dc288a2012-12-10 13:09:21 -08001318 }
Viral Modi9dc288a2012-12-10 13:09:21 -08001319 break;
1320 }
1321 }
Viral Modid871f222013-03-06 02:25:31 -08001322
1323 if (p2pGOExists == 0)
1324 {
1325 limLog(pMac, LOGW, FL("By the time, we received NOA start, GO is already removed."
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001326 " - still go ahead with deferred sme req. This is just info"));
Viral Modid871f222013-03-06 02:25:31 -08001327 }
1328
1329 /* We received the NOA start indication. Now we can send down the SME request which requires off-channel operation */
1330 limProcessRegdDefdSmeReqAfterNOAStart(pMac);
Viral Modi9dc288a2012-12-10 13:09:21 -08001331 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1332 limMsg->bodyptr = NULL;
Viral Modid871f222013-03-06 02:25:31 -08001333 }
Viral Modi9dc288a2012-12-10 13:09:21 -08001334 break;
Gopichand Nakkalaefe3a232013-05-27 17:05:29 +05301335#ifdef FEATURE_WLAN_TDLS
1336 case SIR_HAL_TDLS_IND:
1337 {
1338 tSirTdlsInd *pTdlsInd = (tpSirTdlsInd)limMsg->bodyptr ;
1339 tpDphHashNode pStaDs = NULL ;
1340 tpPESession psessionEntry = NULL;
1341 tANI_U8 sessionId;
1342 if((psessionEntry = peFindSessionByStaId(pMac,pTdlsInd->staIdx,&sessionId))== NULL)
1343 {
1344 limLog(pMac, LOG1, FL("session does not exist for given bssId\n"));
1345 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1346 limMsg->bodyptr = NULL;
1347 return;
1348 }
1349 if ((pStaDs = dphGetHashEntry(pMac, pTdlsInd->assocId, &psessionEntry->dph.dphHashTable)) == NULL)
1350 {
1351 limLog(pMac, LOG1, FL("pStaDs Does not exist for given staId\n"));
1352 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1353 limMsg->bodyptr = NULL;
1354 return;
1355 }
Viral Modi9dc288a2012-12-10 13:09:21 -08001356
Gopichand Nakkalaefe3a232013-05-27 17:05:29 +05301357 if ((STA_ENTRY_TDLS_PEER == pStaDs->staType))
1358 {
1359 limLog(pMac, LOGE,
1360 FL("received TDLS Indication from the Firmware with Reason Code %d "),
1361 pTdlsInd->reasonCode);
1362 limSendSmeTDLSDelStaInd(pMac, pStaDs, psessionEntry,
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301363 pTdlsInd->reasonCode);
Gopichand Nakkalaefe3a232013-05-27 17:05:29 +05301364 }
1365 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1366 limMsg->bodyptr = NULL;
1367 }
1368 break;
1369#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001370 case SIR_HAL_P2P_NOA_ATTR_IND:
1371 {
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301372 tpPESession psessionEntry = &pMac->lim.gpSession[0];
Jeff Johnson295189b2012-06-20 16:38:30 -07001373 tANI_U8 i;
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301374
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001375 limLog(pMac, LOGW, FL("Received message Noa_ATTR %x"), limMsg->type);
Jeff Johnson295189b2012-06-20 16:38:30 -07001376 for(i=0; i < pMac->lim.maxBssId; i++)
1377 {
Viral Modi9dc288a2012-12-10 13:09:21 -08001378 psessionEntry = &pMac->lim.gpSession[i];
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301379 if ( (psessionEntry != NULL) && (psessionEntry->valid) &&
Jeff Johnson295189b2012-06-20 16:38:30 -07001380 (psessionEntry->pePersona == VOS_P2P_GO_MODE))
1381 { //Save P2P attributes for P2P Go persona
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301382
Jeff Johnson295189b2012-06-20 16:38:30 -07001383 palCopyMemory(pMac->hHdd,&psessionEntry->p2pGoPsUpdate, limMsg->bodyptr,sizeof(tSirP2PNoaAttr));
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301384
1385
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001386 limLog(pMac, LOG2, FL(" &psessionEntry->bssId%02x:%02x:%02x:%02x:%02x:%02x ctWin=%d oppPsFlag=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001387 psessionEntry->bssId[0],
1388 psessionEntry->bssId[1],
1389 psessionEntry->bssId[2],
1390 psessionEntry->bssId[3],
1391 psessionEntry->bssId[4],
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301392 psessionEntry->bssId[5],
Jeff Johnson295189b2012-06-20 16:38:30 -07001393 psessionEntry->p2pGoPsUpdate.ctWin,
1394 psessionEntry->p2pGoPsUpdate.oppPsFlag);
1395
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001396 limLog(pMac, LOG2, FL(" uNoa1IntervalCnt=%d uNoa1Duration=%d uNoa1Interval=%d uNoa1StartTime=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001397 psessionEntry->p2pGoPsUpdate.uNoa1IntervalCnt,
1398 psessionEntry->p2pGoPsUpdate.uNoa1Duration,
1399 psessionEntry->p2pGoPsUpdate.uNoa1Interval,
1400 psessionEntry->p2pGoPsUpdate.uNoa1StartTime);
1401
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301402
Jeff Johnson295189b2012-06-20 16:38:30 -07001403 break;
1404 }
1405 }
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301406
Jeff Johnson295189b2012-06-20 16:38:30 -07001407 }
1408 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1409 limMsg->bodyptr = NULL;
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301410
Jeff Johnson295189b2012-06-20 16:38:30 -07001411 break;
1412
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301413
Jeff Johnson295189b2012-06-20 16:38:30 -07001414 /* eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER Message comes after the
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301415 * device comes out of full power for the full power request sent
1416 * because of channel switch with switch count as 0, so call the same
1417 * function used in timeout case(i.e SIR_LIM_CHANNEL_SWITCH_TIMEOUT)
Jeff Johnson295189b2012-06-20 16:38:30 -07001418 * for switching the channel*/
1419 case eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER:
Jeff Johnsone7245742012-09-05 17:12:55 -07001420 if ( !tx_timer_running(&pMac->lim.limTimers.gLimChannelSwitchTimer) )
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301421 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001422 limProcessChannelSwitchTimeout(pMac);
1423 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001424 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1425 limMsg->bodyptr = NULL;
1426 break;
1427
1428 //Power Save Related Messages From HAL
1429 case WDA_ENTER_BMPS_RSP:
1430 case WDA_EXIT_BMPS_RSP:
1431 case WDA_EXIT_BMPS_IND:
1432 case WDA_ENTER_IMPS_RSP:
1433 case WDA_EXIT_IMPS_RSP:
1434 case WDA_ENTER_UAPSD_RSP:
1435 case WDA_EXIT_UAPSD_RSP:
1436 case WDA_WOWL_ENTER_RSP:
1437 case WDA_WOWL_EXIT_RSP:
1438 pmmProcessMessage(pMac, limMsg);
1439 break;
1440
1441 case WDA_LOW_RSSI_IND:
1442 //limHandleLowRssiInd(pMac);
1443 break;
1444
1445 case WDA_BMPS_STATUS_IND:
1446 limHandleBmpsStatusInd(pMac);
1447 break;
1448
1449 case WDA_MISSED_BEACON_IND:
Leela Venkata Kiran Kumar Reddy Chirala949300d2013-02-27 19:50:05 -08001450 limHandleMissedBeaconInd(pMac, limMsg);
1451 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1452 limMsg->bodyptr = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -07001453 break;
1454 case WDA_MIC_FAILURE_IND:
1455 limMicFailureInd(pMac, limMsg);
1456 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1457 limMsg->bodyptr = NULL;
1458 break;
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301459
Jeff Johnson295189b2012-06-20 16:38:30 -07001460
Jeff Johnson295189b2012-06-20 16:38:30 -07001461
1462 case SIR_LIM_ADDTS_RSP_TIMEOUT:
1463 limProcessSmeReqMessages(pMac,limMsg);
1464 break;
1465#ifdef FEATURE_WLAN_CCX
1466 case SIR_LIM_CCX_TSM_TIMEOUT:
1467 limProcessTsmTimeoutHandler(pMac,limMsg);
1468 break;
1469 case WDA_TSM_STATS_RSP:
1470 limProcessHalCcxTsmRsp(pMac, limMsg);
1471 break;
1472#endif
1473 case WDA_ADD_TS_RSP:
1474 limProcessHalAddTsRsp(pMac, limMsg);
1475 break;
1476
1477 case SIR_LIM_DEL_TS_IND:
1478 limProcessDelTsInd(pMac, limMsg);
Madan Mohan Koyyalamudif244d8f2012-11-29 11:21:05 -08001479 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001480 case SIR_LIM_ADD_BA_IND:
1481 limProcessAddBaInd(pMac, limMsg);
1482 break;
1483 case SIR_LIM_DEL_BA_ALL_IND:
Kiran Kumar Lokereb3c42b62013-05-29 14:29:43 -07001484 limDelAllBASessions(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001485 break;
1486 case SIR_LIM_DEL_BA_IND:
1487 limProcessMlmHalBADeleteInd( pMac, limMsg );
1488 break;
1489
1490 case SIR_LIM_BEACON_GEN_IND: {
Jeff Johnson295189b2012-06-20 16:38:30 -07001491
Jeff Johnson295189b2012-06-20 16:38:30 -07001492 if( pMac->lim.gLimSystemRole != eLIM_AP_ROLE )
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301493 schProcessPreBeaconInd(pMac, limMsg);
Jeff Johnson295189b2012-06-20 16:38:30 -07001494
1495 }
1496 break;
1497
1498 case SIR_LIM_DELETE_STA_CONTEXT_IND:
1499 limDeleteStaContext(pMac, limMsg);
1500 break;
1501
1502 case SIR_LIM_MIN_CHANNEL_TIMEOUT:
1503 case SIR_LIM_MAX_CHANNEL_TIMEOUT:
1504 case SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT:
1505 case SIR_LIM_JOIN_FAIL_TIMEOUT:
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001506 case SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001507 case SIR_LIM_AUTH_FAIL_TIMEOUT:
1508 case SIR_LIM_AUTH_RSP_TIMEOUT:
1509 case SIR_LIM_ASSOC_FAIL_TIMEOUT:
1510 case SIR_LIM_REASSOC_FAIL_TIMEOUT:
1511#ifdef WLAN_FEATURE_VOWIFI_11R
1512 case SIR_LIM_FT_PREAUTH_RSP_TIMEOUT:
1513#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001514 case SIR_LIM_REMAIN_CHN_TIMEOUT:
Viral Modi9dc288a2012-12-10 13:09:21 -08001515 case SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT:
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -08001516 case SIR_LIM_DISASSOC_ACK_TIMEOUT:
1517 case SIR_LIM_DEAUTH_ACK_TIMEOUT:
Gopichand Nakkala59a7b432013-05-10 02:50:47 +05301518 case SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE:
Jeff Johnson295189b2012-06-20 16:38:30 -07001519 // These timeout messages are handled by MLM sub module
1520
1521 limProcessMlmReqMessages(pMac,
1522 limMsg);
1523
1524 break;
1525
1526 case SIR_LIM_HEART_BEAT_TIMEOUT:
1527 /** check if heart beat failed, even if one Beacon
1528 * is rcvd within the Heart Beat interval continue
1529 * normal processing
1530 */
1531
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301532 #if 0
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001533 PELOG1(limLog(pMac, LOG1, FL("Heartbeat timeout, SME %d, MLME %d, #bcn %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001534 pMac->lim.gLimSmeState, pMac->lim.gLimMlmState,
1535 pMac->lim.gLimRxedBeaconCntDuringHB);)
1536
1537 if(pMac->lim.gLimSystemRole == eLIM_STA_IN_IBSS_ROLE)
1538 limIbssHeartBeatHandle(pMac); //HeartBeat for peers.
1539 else
1540 /**
1541 * Heartbeat failure occurred on STA
1542 * This is handled by LMM sub module.
1543 */
1544 limHandleHeartBeatFailure(pMac);
1545
1546 break;
1547 #endif //TO SUPPORT BT-AMP
Yathishd8713192012-12-10 14:21:35 -08001548 if (limIsSystemInScanState(pMac))
1549 {
1550 // System is in DFS (Learn) mode
1551 // Defer processsing this message
1552 if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
1553 {
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001554 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)"),
Yathishd8713192012-12-10 14:21:35 -08001555 limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
1556 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
1557 limLogSessionStates(pMac);
1558 }
1559 }
1560 else
1561 {
Gopichand Nakkala271463a2013-05-13 16:39:49 +05301562#if defined(FEATURE_WLAN_TDLS) && defined(FEATURE_WLAN_TDLS_OXYGEN_DISAPPEAR_AP)
1563 tpPESession psessionEntry = &pMac->lim.gpSession[0];
1564 for (i=0; i < pMac->lim.maxBssId; i++)
1565 {
1566 psessionEntry = &pMac->lim.gpSession[i];
1567 if ((psessionEntry != NULL) && (psessionEntry->valid) &&
1568 ((psessionEntry->pePersona == VOS_P2P_CLIENT_MODE) ||
1569 (psessionEntry->pePersona == VOS_STA_MODE)))
1570 {
1571 if ((TRUE == pMac->lim.gLimTDLSOxygenSupport) &&
1572 (limGetTDLSPeerCount(pMac, psessionEntry) != 0)) {
1573 if (limMsg->bodyptr) {
1574 palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr);
1575 limMsg->bodyptr = NULL;
1576 }
1577 return;
1578 }
1579 }
1580 }
1581#endif
Leela Venkata Kiran Kumar Reddy Chirala949300d2013-02-27 19:50:05 -08001582 if (NULL == limMsg->bodyptr)
1583 {
1584 limHandleHeartBeatTimeout(pMac);
1585 }
1586 else
1587 {
1588 limHandleHeartBeatTimeoutForSession(pMac, (tpPESession)limMsg->bodyptr);
1589 }
Gopichand Nakkala271463a2013-05-13 16:39:49 +05301590 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001591 break;
Leela Venkata Kiran Kumar Reddy Chirala949300d2013-02-27 19:50:05 -08001592
Jeff Johnson295189b2012-06-20 16:38:30 -07001593 case SIR_LIM_PROBE_HB_FAILURE_TIMEOUT:
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301594 limHandleHeartBeatFailureTimeout(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001595 break;
1596
1597 case SIR_LIM_CHANNEL_SCAN_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001598 /**
1599 * Background scan timeout occurred on STA.
1600 * This is handled by LMM sub module.
1601 */
1602 limDeactivateAndChangeTimer(pMac, eLIM_BACKGROUND_SCAN_TIMER);
1603
1604 //We will do background scan even in bcnps mode
1605 //if (pMac->sys.gSysEnableScanMode)
1606 pMac->lim.gLimReportBackgroundScanResults = FALSE;
1607 limTriggerBackgroundScan(pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001608 break;
1609
Jeff Johnson295189b2012-06-20 16:38:30 -07001610
1611 case SIR_LIM_HASH_MISS_THRES_TIMEOUT:
1612
1613 /*
1614 ** clear the credit to the send disassociate frame bucket
1615 **/
1616
1617 pMac->lim.gLimDisassocFrameCredit = 0;
1618 break;
1619
1620 case SIR_LIM_CNF_WAIT_TIMEOUT:
1621
1622 /*
1623 ** Does not receive CNF or dummy packet
1624 **/
1625 limHandleCnfWaitTimeout(pMac, (tANI_U16) limMsg->bodyval);
1626
1627 break;
1628
1629 case SIR_LIM_KEEPALIVE_TIMEOUT:
1630 limSendKeepAliveToPeer(pMac);
1631
1632 break;
1633
1634 case SIR_LIM_RETRY_INTERRUPT_MSG:
1635 // Message from ISR upon TFP's max retry limit interrupt
1636
1637 break;
1638
1639 case SIR_LIM_INV_KEY_INTERRUPT_MSG:
1640 // Message from ISR upon SP's Invalid session key interrupt
1641
1642 break;
1643
1644 case SIR_LIM_KEY_ID_INTERRUPT_MSG:
1645 // Message from ISR upon SP's Invalid key ID interrupt
1646
1647 break;
1648
1649 case SIR_LIM_REPLAY_THRES_INTERRUPT_MSG:
1650 // Message from ISR upon SP's Replay threshold interrupt
1651
1652 break;
1653
1654 case SIR_LIM_CHANNEL_SWITCH_TIMEOUT:
1655 limProcessChannelSwitchTimeout(pMac);
1656 break;
1657
1658 case SIR_LIM_QUIET_TIMEOUT:
1659 limProcessQuietTimeout(pMac);
1660 break;
1661
1662 case SIR_LIM_QUIET_BSS_TIMEOUT:
1663 limProcessQuietBssTimeout(pMac);
1664 break;
1665
Jeff Johnson295189b2012-06-20 16:38:30 -07001666 case SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT:
1667 limHandleUpdateOlbcCache(pMac);
1668 break;
1669#if 0
1670 case SIR_LIM_WPS_OVERLAP_TIMEOUT:
1671 limProcessWPSOverlapTimeout(pMac);
1672 break;
1673#endif
1674
Jeff Johnson295189b2012-06-20 16:38:30 -07001675
Mohit Khannac0b992f2012-12-04 15:08:18 -08001676#ifdef FEATURE_WLAN_TDLS_INTERNAL
1677 /*
1678 * Here discovery timer expires, now we can go ahead and collect all
1679 * the dicovery responses PE has process till now and send this
1680 * responses to SME..
1681 */
1682 case SIR_LIM_TDLS_DISCOVERY_RSP_WAIT:
1683 {
1684 //fetch the sessionEntry based on the sessionId
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301685 tpPESession psessionEntry = peFindSessionBySessionId(pMac,
Mohit Khannac0b992f2012-12-04 15:08:18 -08001686 pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId) ;
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301687 if(NULL == psessionEntry)
Mohit Khannac0b992f2012-12-04 15:08:18 -08001688 {
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001689 limLog(pMac, LOGP,FL("Session Does not exist for given sessionID %d"), pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId);
Mohit Khannac0b992f2012-12-04 15:08:18 -08001690 return;
1691 }
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301692
1693 VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001694 ("Discovery Rsp timer expires ")) ;
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301695#if 0 // TDLS_hklee: D13 no need to open Addr2 unknown data packet
Mohit Khannac0b992f2012-12-04 15:08:18 -08001696 /* restore RXP filters */
1697 limSetLinkState(pMac, eSIR_LINK_FINISH_TDLS_DISCOVERY_STATE,
1698 psessionEntry->bssId) ;
1699#endif
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301700 limSendSmeTdlsDisRsp(pMac, eSIR_SUCCESS,
Mohit Khannac0b992f2012-12-04 15:08:18 -08001701 eWNI_SME_TDLS_DISCOVERY_START_RSP) ;
1702 break ;
1703 }
1704
1705 /*
1706 * we initiated link setup and did not receive TDLS setup rsp
1707 * from TDLS peer STA, send failure RSP to SME.
1708 */
1709 case SIR_LIM_TDLS_LINK_SETUP_RSP_TIMEOUT:
1710 {
1711 tANI_U8 *peerMac = (tANI_U8 *)limMsg->bodyval ;
1712 tLimTdlsLinkSetupPeer *setupPeer = NULL ;
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301713
Mohit Khannac0b992f2012-12-04 15:08:18 -08001714 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001715 ("TDLS setup rsp timer expires ")) ;
Mohit Khannac0b992f2012-12-04 15:08:18 -08001716 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001717 ("TDLS setup rsp timer expires for peer:")) ;
Mohit Khannac0b992f2012-12-04 15:08:18 -08001718 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001719 ("%02X, %02X, %02X,%02X, %02X, %02X"),
Mohit Khannac0b992f2012-12-04 15:08:18 -08001720 peerMac[0],
1721 peerMac[1],
1722 peerMac[2],
1723 peerMac[3],
1724 peerMac[4],
1725 peerMac[5]);
1726
1727 limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ;
1728 if(NULL != setupPeer)
1729 {
1730 limTdlsDelLinkPeer( pMac, peerMac) ;
1731 }
1732
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301733 limSendSmeTdlsLinkStartRsp(pMac, eSIR_FAILURE, peerMac,
Mohit Khannac0b992f2012-12-04 15:08:18 -08001734 eWNI_SME_TDLS_LINK_START_RSP) ;
1735 break ;
1736 }
1737 case SIR_LIM_TDLS_LINK_SETUP_CNF_TIMEOUT:
1738 {
1739 tANI_U8 *peerMac = (tANI_U8 *)limMsg->bodyval ;
1740 tLimTdlsLinkSetupPeer *setupPeer = NULL ;
1741
1742 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR,
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001743 ("TDLS setup CNF timer expires ")) ;
Mohit Khannac0b992f2012-12-04 15:08:18 -08001744 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001745 ("TDLS setup CNF timer expires for peer:")) ;
Mohit Khannac0b992f2012-12-04 15:08:18 -08001746 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001747 ("%02X, %02X, %02X,%02X, %02X, %02X"),
Mohit Khannac0b992f2012-12-04 15:08:18 -08001748 peerMac[0],
1749 peerMac[1],
1750 peerMac[2],
1751 peerMac[3],
1752 peerMac[4],
1753 peerMac[5]);
1754 limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ;
1755 if(NULL != setupPeer)
1756 {
1757 limTdlsDelLinkPeer( pMac, peerMac) ;
1758 }
1759 break ;
1760 }
1761#endif /* FEATURE_WLAN_TDLS TIMER */
Jeff Johnson295189b2012-06-20 16:38:30 -07001762 case WDA_ADD_BSS_RSP:
1763 limProcessMlmAddBssRsp( pMac, limMsg );
1764 break;
1765
1766 case WDA_ADD_STA_RSP:
1767
1768 //call a wrapper by paasing bodyptr, their get sessionID and and call proper function from there.
1769 limProcessAddStaRsp(pMac,limMsg);
1770 break;
1771
1772 case WDA_DELETE_STA_RSP:
1773 limProcessMlmDelStaRsp(pMac, limMsg);
1774 break;
1775
1776 case WDA_ADD_STA_SELF_RSP:
1777 limProcessAddStaSelfRsp(pMac, limMsg);
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301778 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07001779 case WDA_DEL_STA_SELF_RSP:
1780 limProcessDelStaSelfRsp(pMac, limMsg);
1781 break;
1782
1783 case WDA_DELETE_BSS_RSP:
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301784 limHandleDeleteBssRsp(pMac,limMsg); //wrapper routine to handle delete bss response
Jeff Johnson295189b2012-06-20 16:38:30 -07001785 break;
1786
1787 case WDA_SET_BSSKEY_RSP:
1788 case WDA_SET_STA_BCASTKEY_RSP:
1789 limProcessMlmSetBssKeyRsp( pMac, limMsg );
1790 break;
1791 case WDA_SET_STAKEY_RSP:
1792 limProcessMlmSetStaKeyRsp( pMac, limMsg );
1793 break;
1794 case WDA_REMOVE_BSSKEY_RSP:
1795 case WDA_REMOVE_STAKEY_RSP:
1796 limProcessMlmRemoveKeyRsp( pMac, limMsg );
1797 break;
1798 case WDA_ADDBA_RSP:
1799 limProcessMlmHalAddBARsp( pMac, limMsg );
1800 break;
1801
1802 case WDA_STA_STAT_RSP:
1803 case WDA_AGGR_STAT_RSP:
1804 case WDA_GLOBAL_STAT_RSP:
1805 case WDA_STAT_SUMM_RSP:
1806 limSendSmeStatsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
1807 break;
1808
1809 case WDA_GET_STATISTICS_RSP:
1810 limSendSmePEStatisticsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
1811 break;
Srinivas Girigowda2471d832013-01-25 13:33:11 -08001812#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
1813 case WDA_GET_ROAM_RSSI_RSP:
1814 limSendSmePEGetRoamRssiRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr);
1815 break;
1816#endif
1817
Jeff Johnson295189b2012-06-20 16:38:30 -07001818
1819 case WDA_SET_MIMOPS_RSP: //limProcessSetMimoRsp(pMac, limMsg);
1820 case WDA_SET_TX_POWER_RSP: //limProcessSetTxPowerRsp(pMac, limMsg);
1821 case WDA_GET_TX_POWER_RSP: //limProcessGetTxPowerRsp(pMac, limMsg);
1822 case WDA_GET_NOISE_RSP:
1823 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
1824 limMsg->bodyptr = NULL;
1825 //limProcessGetNoiseRsp(pMac, limMsg);
1826 break;
1827
1828 case WDA_SET_MAX_TX_POWER_RSP:
1829#if defined WLAN_FEATURE_VOWIFI
1830 rrmSetMaxTxPowerRsp( pMac, limMsg );
1831#endif
1832 if(limMsg->bodyptr != NULL)
1833 {
1834 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
1835 limMsg->bodyptr = NULL;
1836 }
1837 break;
1838
Jeff Johnson295189b2012-06-20 16:38:30 -07001839 case SIR_LIM_ADDR2_MISS_IND:
1840 {
1841 limLog(pMac, LOGE,
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001842 FL("Addr2 mismatch interrupt received %X"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001843 limMsg->type);
1844 /*a message from HAL indicating addr2 mismatch interrupt occurred
1845 limMsg->bodyptr contains only pointer to 48-bit addr2 field*/
1846 //Dinesh fix this. the third parameter should be sessionentry.
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301847 //limHandleUnknownA2IndexFrames(pMac, (void *)limMsg->bodyptr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001848
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301849 /*Free message body pointer*/
Jeff Johnson295189b2012-06-20 16:38:30 -07001850 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
1851 break;
1852 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001853
1854#ifdef WLAN_FEATURE_VOWIFI_11R
1855 case WDA_AGGR_QOS_RSP:
1856 limProcessFTAggrQoSRsp( pMac, limMsg );
1857 break;
1858#endif
1859
1860 case WDA_SET_LINK_STATE_RSP:
1861 linkStateParams = (tLinkStateParams *)limMsg->bodyptr;
1862#if defined WLAN_FEATURE_VOWIFI_11R
1863 pSession = linkStateParams->session;
1864 if(linkStateParams->ft)
1865 {
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301866 limSendReassocReqWithFTIEsMgmtFrame(pMac,
Jeff Johnson295189b2012-06-20 16:38:30 -07001867 pSession->pLimMlmReassocReq,
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301868 pSession);
Jeff Johnson295189b2012-06-20 16:38:30 -07001869 }
1870#endif
1871 if( linkStateParams->callback )
1872 {
1873 linkStateParams->callback( pMac, linkStateParams->callbackArg );
1874 }
1875 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
1876 break;
1877
1878#ifdef WLAN_FEATURE_PACKET_FILTERING
1879 case WDA_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP:
1880 pmmProcessMessage(pMac, limMsg);
1881 break;
1882#endif // WLAN_FEATURE_PACKET_FILTERING
1883
1884#ifdef WLAN_FEATURE_GTK_OFFLOAD
1885 case WDA_GTK_OFFLOAD_GETINFO_RSP:
1886 pmmProcessMessage(pMac, limMsg);
1887 break;
1888#endif // WLAN_FEATURE_GTK_OFFLOAD
Yathishd8713192012-12-10 14:21:35 -08001889 case eWNI_SME_SET_BCN_FILTER_REQ:
1890 {
1891#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
1892 tpPESession psessionEntry;
1893 tANI_U8 sessionId = (tANI_U8)limMsg->bodyval ;
1894 psessionEntry = &pMac->lim.gpSession[sessionId];
1895 if(psessionEntry != NULL && IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
1896 {
1897 // sending beacon filtering information down to HAL
1898 if (limSendBeaconFilterInfo(pMac, psessionEntry) != eSIR_SUCCESS)
1899 {
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001900 limLog(pMac, LOGE, FL("Fail to send Beacon Filter Info "));
Yathishd8713192012-12-10 14:21:35 -08001901 }
1902 }
Dhanashri Atre612af852013-03-29 11:19:05 -07001903 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
1904 limMsg->bodyptr = NULL;
Yathishd8713192012-12-10 14:21:35 -08001905#endif
1906 }
1907 break;
Gopichand Nakkalaefe3a232013-05-27 17:05:29 +05301908#ifdef FEATURE_WLAN_TDLS
1909 case WDA_SET_TDLS_LINK_ESTABLISH_REQ_RSP:
1910 {
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301911 tTdlsLinkEstablishParams *pTdlsLinkEstablishParams;
1912 pTdlsLinkEstablishParams = (tTdlsLinkEstablishParams*) limMsg->bodyptr;
1913 limSendSmeTdlsLinkEstablishReqRsp(pMac,
1914 0,
1915 NULL,
1916 NULL,
1917 pTdlsLinkEstablishParams->status) ;
1918 vos_mem_free((v_VOID_t *)(limMsg->bodyptr));
1919 limMsg->bodyptr = NULL;
Gopichand Nakkalaefe3a232013-05-27 17:05:29 +05301920 break;
1921 }
1922#endif
Gopichand Nakkalae0078ce2013-06-11 17:49:16 +05301923
1924 case WDA_RX_SCAN_EVENT:
1925 limProcessRxScanEvent(pMac, limMsg->bodyptr);
1926 break;
1927
Jeff Johnson295189b2012-06-20 16:38:30 -07001928 default:
1929 vos_mem_free((v_VOID_t*)limMsg->bodyptr);
1930 limMsg->bodyptr = NULL;
1931 // Unwanted messages
1932 // Log error
1933 limLog(pMac, LOGE,
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001934 FL("Discarding unexpected message received %X"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001935 limMsg->type);
1936 limPrintMsgName(pMac, LOGE, limMsg->type);
1937 break;
1938
1939 } // switch (limMsg->type)
1940
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07001941 PELOG2(limLog(pMac, LOG2, FL("Done Processing msgType = %d, sme state = %s, mlm state = %s"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001942 limMsg->type, limSmeStateStr(pMac->lim.gLimSmeState),
1943 limMlmStateStr(pMac->lim.gLimMlmState));)
1944
1945} /*** end limProcessMessages() ***/
1946
1947
1948
1949/**
1950 * limProcessDeferredMessageQueue
1951 *
1952 *FUNCTION:
1953 * This function is called by LIM while exiting from Learn
1954 * mode. This function fetches messages posted to the LIM
1955 * deferred message queue limDeferredMsgQ.
1956 *
1957 *LOGIC:
1958 *
1959 *ASSUMPTIONS:
1960 * NA
1961 *
1962 *NOTE:
1963 * NA
1964 *
1965 * @param pMac - Pointer to Global MAC structure
1966 * @return None
1967 */
1968
1969void
1970limProcessDeferredMessageQueue(tpAniSirGlobal pMac)
1971{
1972 tSirMsgQ limMsg = { 0, 0, 0 };
1973
Jeff Johnson295189b2012-06-20 16:38:30 -07001974 tSirMsgQ *readMsg;
1975 tANI_U16 size;
1976
1977 /*
1978 ** check any deferred messages need to be processed
1979 **/
1980 size = pMac->lim.gLimDeferredMsgQ.size;
1981 if (size > 0)
1982 {
1983 while ((readMsg = limReadDeferredMsgQ(pMac)) != NULL)
1984 {
1985 palCopyMemory( pMac->hHdd, (tANI_U8*) &limMsg,
1986 (tANI_U8*) readMsg, sizeof(tSirMsgQ));
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05301987 size--;
Jeff Johnson295189b2012-06-20 16:38:30 -07001988 limProcessMessages(pMac, &limMsg);
1989
1990 if((limIsSystemInScanState(pMac)) || (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) ||
1991 (pMac->lim.gLimSystemInScanLearnMode))
1992 break;
1993 }
1994 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001995} /*** end limProcessDeferredMessageQueue() ***/
1996
1997
1998/*
1999 * limProcessNormalHddMsg
2000 * Function: this function checks the current lim state and decide whether the message passed shall be deffered.
2001 * @param pMac - Pointer to Global MAC structure
2002 * pLimMsg -- the message need to be processed
2003 * fRspReqd -- whether return result to hdd
2004 * @return None
2005 */
2006void limProcessNormalHddMsg(tpAniSirGlobal pMac, tSirMsgQ *pLimMsg, tANI_U8 fRspReqd)
2007{
2008 tANI_BOOLEAN fDeferMsg = eANI_BOOLEAN_TRUE;
2009
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05302010 /* Added For BT-AMP Support */
Jeff Johnson295189b2012-06-20 16:38:30 -07002011 if ((pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_AP_ROLE )
2012 ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_STA_ROLE)
2013 ||(pMac->lim.gLimSystemRole == eLIM_UNKNOWN_ROLE))
2014 {
2015 /** This check is required only for the AP and in 2 cases.
2016 * 1. If we are in learn mode and we receive any of these messages,
2017 * you have to come out of scan and process the message, hence dont
2018 * defer the message here. In handler, these message could be defered
2019 * till we actually come out of scan mode.
2020 * 2. If radar is detected, you might have to defer all of these
2021 * messages except Stop BSS request/ Switch channel request. This
2022 * decision is also made inside its handler.
2023 *
2024 * Please be careful while using the flag fDeferMsg. Possibly you
2025 * might end up in an infinite loop.
2026 **/
2027 if (((pLimMsg->type == eWNI_SME_START_BSS_REQ) ||
2028 (pLimMsg->type == eWNI_SME_STOP_BSS_REQ) ||
2029 (pLimMsg->type == eWNI_SME_SWITCH_CHL_REQ) ||
2030 (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ) ||
2031 (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ)))
2032 {
2033 fDeferMsg = eANI_BOOLEAN_FALSE;
2034 }
2035 }
2036
2037 /* limInsystemInscanState() refers the psessionEntry, how to get session Entry????*/
Jeff Johnsone7245742012-09-05 17:12:55 -07002038 if (((pMac->lim.gLimAddtsSent) || (limIsSystemInScanState(pMac)) /*||
2039 (LIM_IS_RADAR_DETECTED(pMac))*/) && fDeferMsg)
Jeff Johnson295189b2012-06-20 16:38:30 -07002040 {
2041 // System is in DFS (Learn) mode or awaiting addts response
2042 // or if radar is detected, Defer processsing this message
2043 if (limDeferMsg(pMac, pLimMsg) != TX_SUCCESS)
2044 {
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05302045#ifdef WLAN_DEBUG
Jeff Johnson295189b2012-06-20 16:38:30 -07002046 pMac->lim.numSme++;
2047#endif
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07002048 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 -07002049 pLimMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState,
2050 pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);)
2051 limLogSessionStates(pMac);
2052 limPrintMsgName(pMac, LOGE, pLimMsg->type);
2053 // Release body
2054 palFreeMemory( pMac->hHdd, (tANI_U8 *) pLimMsg->bodyptr);
2055 }
2056 }
2057 else
2058 {
2059 if(fRspReqd)
2060 {
2061 // These messages are from HDD
2062 // Since these requests may also be generated
2063 // internally within LIM module, need to
2064 // distinquish and send response to host
2065 pMac->lim.gLimRspReqd = eANI_BOOLEAN_TRUE;
2066 }
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05302067#ifdef WLAN_DEBUG
Jeff Johnson295189b2012-06-20 16:38:30 -07002068 pMac->lim.numSme++;
2069#endif
2070 if(limProcessSmeReqMessages(pMac, pLimMsg))
2071 {
2072 // Release body
2073 // limProcessSmeReqMessage consumed the buffer. We can free it.
2074 palFreeMemory( pMac->hHdd, (tANI_U8 *) pLimMsg->bodyptr);
2075 }
2076 }
2077}
2078
2079void
Jeff Johnsone7245742012-09-05 17:12:55 -07002080handleHTCapabilityandHTInfo(struct sAniSirGlobal *pMac, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07002081{
2082 tSirMacHTCapabilityInfo macHTCapabilityInfo;
2083 tSirMacHTParametersInfo macHTParametersInfo;
2084 tSirMacHTInfoField1 macHTInfoField1;
2085 tSirMacHTInfoField2 macHTInfoField2;
2086 tSirMacHTInfoField3 macHTInfoField3;
2087 tANI_U32 cfgValue;
2088 tANI_U8 *ptr;
Jeff Johnson295189b2012-06-20 16:38:30 -07002089
Jeff Johnson295189b2012-06-20 16:38:30 -07002090 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_CAP_INFO, &cfgValue) != eSIR_SUCCESS)
2091 {
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07002092 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_CAP_INFO value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002093 return ;
2094 }
2095 ptr = (tANI_U8 *) &macHTCapabilityInfo;
2096 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2097 pMac->lim.gHTLsigTXOPProtection = (tANI_U8)macHTCapabilityInfo.lsigTXOPProtection;
2098 pMac->lim.gHTMIMOPSState = (tSirMacHTMIMOPowerSaveState) macHTCapabilityInfo.mimoPowerSave;
2099 pMac->lim.gHTGreenfield = (tANI_U8)macHTCapabilityInfo.greenField;
2100 pMac->lim.gHTMaxAmsduLength = (tANI_U8)macHTCapabilityInfo.maximalAMSDUsize;
2101 pMac->lim.gHTShortGI20Mhz = (tANI_U8)macHTCapabilityInfo.shortGI20MHz;
2102 pMac->lim.gHTShortGI40Mhz = (tANI_U8)macHTCapabilityInfo.shortGI40MHz;
Jeff Johnson295189b2012-06-20 16:38:30 -07002103 pMac->lim.gHTPSMPSupport = (tANI_U8)macHTCapabilityInfo.psmp;
2104 pMac->lim.gHTDsssCckRate40MHzSupport = (tANI_U8)macHTCapabilityInfo.dsssCckMode40MHz;
2105
2106 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_AMPDU_PARAMS, &cfgValue) != eSIR_SUCCESS)
2107 {
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07002108 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_PARAM_INFO value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002109 return ;
2110 }
2111 ptr = (tANI_U8 *) &macHTParametersInfo;
2112 *ptr = (tANI_U8) (cfgValue & 0xff);
2113 pMac->lim.gHTAMpduDensity = (tANI_U8)macHTParametersInfo.mpduDensity;
2114 pMac->lim.gHTMaxRxAMpduFactor = (tANI_U8)macHTParametersInfo.maxRxAMPDUFactor;
2115
2116 // Get HT IE Info
2117 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD1, &cfgValue) != eSIR_SUCCESS)
2118 {
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07002119 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD1 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002120 return ;
2121 }
2122 ptr = (tANI_U8 *) &macHTInfoField1;
2123 *((tANI_U8 *)ptr) = (tANI_U8) (cfgValue & 0xff);
2124 pMac->lim.gHTServiceIntervalGranularity = (tANI_U8)macHTInfoField1.serviceIntervalGranularity;
2125 pMac->lim.gHTControlledAccessOnly = (tANI_U8)macHTInfoField1.controlledAccessOnly;
2126 pMac->lim.gHTRifsMode = (tANI_U8)macHTInfoField1.rifsMode;
Jeff Johnson295189b2012-06-20 16:38:30 -07002127
2128 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD2, &cfgValue) != eSIR_SUCCESS)
2129 {
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07002130 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD2 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002131 return ;
2132 }
2133 ptr = (tANI_U8 *) &macHTInfoField2;
2134 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2135 pMac->lim.gHTOperMode = (tSirMacHTOperatingMode) macHTInfoField2.opMode;
2136
2137 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD3, &cfgValue) != eSIR_SUCCESS)
2138 {
Kiran Kumar Lokere6cd2d782013-04-01 13:24:23 -07002139 limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD3 value"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002140 return ;
2141 }
2142 ptr = (tANI_U8 *) &macHTInfoField3;
2143 *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff);
2144 pMac->lim.gHTPCOActive = (tANI_U8)macHTInfoField3.pcoActive;
2145 pMac->lim.gHTPCOPhase = (tANI_U8)macHTInfoField3.pcoPhase;
Jeff Johnson295189b2012-06-20 16:38:30 -07002146 pMac->lim.gHTSecondaryBeacon = (tANI_U8)macHTInfoField3.secondaryBeacon;
2147 pMac->lim.gHTDualCTSProtection = (tANI_U8)macHTInfoField3.dualCTSProtection;
2148 pMac->lim.gHTSTBCBasicMCS = (tANI_U8)macHTInfoField3.basicSTBCMCS;
Jeff Johnsone7245742012-09-05 17:12:55 -07002149
2150 /* The lim globals for channelwidth and secondary chnl have been removed and should not be used during no session;
2151 * instead direct cfg is read and used when no session for transmission of mgmt frames (same as old);
2152 * For now, we might come here during init and join with sessionEntry = NULL; in that case just fill the globals which exist
2153 * Sessionized entries values will be filled in join or add bss req. The ones which are missed in join are filled below
2154 */
2155 if (psessionEntry != NULL)
2156 {
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05302157 psessionEntry->htCapability = IS_DOT11_MODE_HT(psessionEntry->dot11mode);
Jeff Johnsone7245742012-09-05 17:12:55 -07002158 psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = (tANI_U8)macHTInfoField3.lsigTXOPProtectionFullSupport;
2159 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002160}
2161
2162void limLogSessionStates(tpAniSirGlobal pMac)
2163{
2164#ifdef WLAN_DEBUG
2165 int i;
2166
2167 for(i = 0; i < pMac->lim.maxBssId; i++)
2168 {
2169 if(pMac->lim.gpSession[i].valid)
2170 {
Madan Mohan Koyyalamudi5695b502012-09-24 14:21:12 -07002171 PELOG1(limLog(pMac, LOG1, FL("Session[%d] sysRole(%d) limSmeState %d (prev sme state %d) mlm state %d (prev mlm state %d)"),
Gopichand Nakkala68d0c882013-06-27 19:38:43 +05302172 i, pMac->lim.gpSession[i].limSystemRole, pMac->lim.gpSession[i].limSmeState,
2173 pMac->lim.gpSession[i].limPrevSmeState, pMac->lim.gpSession[i].limMlmState,
Jeff Johnson295189b2012-06-20 16:38:30 -07002174 pMac->lim.gpSession[i].limPrevMlmState);)
2175 }
2176 }
2177#endif //ifdef WLAN_DEBUG
2178}