blob: 44ff896c46ba64fa37e56b16da8a74955f780005 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08002 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21/*
Jeff Johnson32d95a32012-09-10 13:15:23 -070022 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -070023 *
24 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
25 *
26 *
27 * Permission to use, copy, modify, and/or distribute this software for
28 * any purpose with or without fee is hereby granted, provided that the
29 * above copyright notice and this permission notice appear in all
30 * copies.
31 *
32 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
33 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
34 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
35 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
36 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
37 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
38 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39 * PERFORMANCE OF THIS SOFTWARE.
40 */
41
42/*
43 * Airgo Networks, Inc proprietary. All rights reserved.
44 * This file limApi.cc contains the functions that are
45 * exported by LIM to other modules.
46 *
47 * Author: Chandra Modumudi
48 * Date: 02/11/02
49 * History:-
50 * Date Modified by Modification Information
51 * --------------------------------------------------------------------
52 *
53 */
54#include "palTypes.h"
55#ifdef ANI_PRODUCT_TYPE_AP
56#include "wniCfgAp.h"
57#else
58#include "wniCfgSta.h"
59#include "wniApi.h"
60#endif
61#include "sirCommon.h"
62#include "sirDebug.h"
63#include "aniParam.h"
64#include "cfgApi.h"
65
66#include "schApi.h"
67#include "utilsApi.h"
68#include "limApi.h"
69#include "limGlobal.h"
70#include "limTypes.h"
71#include "limUtils.h"
72#include "limAssocUtils.h"
73#include "limPropExtsUtils.h"
74#include "limSerDesUtils.h"
75#include "limIbssPeerMgmt.h"
76#include "limAdmitControl.h"
77#include "pmmApi.h"
78#include "logDump.h"
79#include "limSendSmeRspMessages.h"
80#include "wmmApsd.h"
81#include "limTrace.h"
82#include "limSession.h"
83#include "wlan_qct_wda.h"
84
85#if defined WLAN_FEATURE_VOWIFI
86#include "rrmApi.h"
87#endif
88
89#include <limFT.h>
90
91#ifdef VOSS_ENABLED
92#include "vos_types.h"
93#include "vos_packet.h"
94#include "wlan_qct_tl.h"
95#include "sysStartup.h"
96#endif
97
98
99static void __limInitScanVars(tpAniSirGlobal pMac)
100{
101 pMac->lim.gLimUseScanModeForLearnMode = 1;
102
103 pMac->lim.gLimSystemInScanLearnMode = 0;
104
105 // Scan related globals on STA
106 pMac->lim.gLimReturnAfterFirstMatch = 0;
107 pMac->lim.gLim24Band11dScanDone = 0;
108 pMac->lim.gLim50Band11dScanDone = 0;
109 pMac->lim.gLimReturnUniqueResults = 0;
110
111 // Background Scan related globals on STA
112 pMac->lim.gLimNumOfBackgroundScanSuccess = 0;
113 pMac->lim.gLimNumOfConsecutiveBkgndScanFailure = 0;
114 pMac->lim.gLimNumOfForcedBkgndScan = 0;
115 pMac->lim.gLimBackgroundScanDisable = false; //based on BG timer
116 pMac->lim.gLimForceBackgroundScanDisable = false; //debug control flag
117 pMac->lim.gLimBackgroundScanTerminate = TRUE; //controlled by SME
118 pMac->lim.gLimReportBackgroundScanResults = FALSE; //controlled by SME
119
120 pMac->lim.gLimCurrentScanChannelId = 0;
121 pMac->lim.gpLimMlmScanReq = NULL;
Viral Modid86bde22012-12-10 13:09:21 -0800122#ifdef WLAN_FEATURE_P2P
123 pMac->lim.gpLimSmeScanReq = NULL;
124#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700125 pMac->lim.gLimMlmScanResultLength = 0;
126 pMac->lim.gLimSmeScanResultLength = 0;
127
128 palZeroMemory(pMac->hHdd, pMac->lim.gLimCachedScanHashTable,
129 sizeof(pMac->lim.gLimCachedScanHashTable));
130
131#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
132 pMac->lim.gLimBackgroundScanChannelId = 0;
133 pMac->lim.gLimBackgroundScanStarted = 0;
134 pMac->lim.gLimRestoreCBNumScanInterval = LIM_RESTORE_CB_NUM_SCAN_INTERVAL_DEFAULT;
135 pMac->lim.gLimRestoreCBCount = 0;
136 palZeroMemory(pMac->hHdd, pMac->lim.gLimLegacyBssidList, sizeof(pMac->lim.gLimLegacyBssidList));
137#endif
138
139 /* Fill in default values */
140 pMac->lim.gLimTriggerBackgroundScanDuringQuietBss = 0;
141
142#ifdef ANI_AP_SDK
143 palZeroMemory(pMac->hHdd, &pMac->lim.gLimScanDurationConvert, sizeof(tLimScanDurationConvert)); /* Used to store converted scan duration values in TU and TICKS */
144#endif /* ANI_AP_SDK */
145
146 // abort scan is used to abort an on-going scan
147 pMac->lim.abortScan = 0;
148 palZeroMemory(pMac->hHdd, &pMac->lim.scanChnInfo, sizeof(tLimScanChnInfo));
149
150//WLAN_SUSPEND_LINK Related
151 pMac->lim.gpLimSuspendCallback = NULL;
152 pMac->lim.gpLimResumeCallback = NULL;
153//end WLAN_SUSPEND_LINK Related
154}
155
156
157static void __limInitBssVars(tpAniSirGlobal pMac)
158{
159
160 palZeroMemory(pMac->hHdd, (void*)pMac->lim.gpSession, sizeof(*pMac->lim.gpSession)*pMac->lim.maxBssId);
161
162
163 //pMac->lim.gpLimStartBssReq = NULL;
164
165#if defined(ANI_PRODUCT_TYPE_AP)
166 palZeroMemory(pMac->hHdd, &pMac->lim.gLimNeighborBssList, sizeof(tSirMultipleNeighborBssInfo));
167#endif
168
169
170
171/* These global variables are moved to session table and intialization is done during session creation Oct 9th Review */
172#if 0
173
174 // Place holder for BSS description that we're
175 // currently joined with
176 palZeroMemory(pMac->hHdd, &pMac->lim.gLimCurrentBssId, sizeof(tSirMacAddr));
177 pMac->lim.gLimCurrentChannelId = HAL_INVALID_CHANNEL_ID;
178 palZeroMemory(pMac->hHdd, &pMac->lim.gLimCurrentSSID, sizeof(tSirMacSSid));
179 pMac->lim.gLimCurrentBssCaps = 0;
180 QosCaps is a bit map of various qos capabilities - see defn above
181 pMac->lim.gLimCurrentBssQosCaps = 0;
182 pMac->lim.gLimCurrentBssPropCap = 0;
183 pMac->lim.gLimSentCapsChangeNtf = 0;
184
185 // Place holder for BSS description that
186 // we're currently Reassociating
187 palZeroMemory(pMac->hHdd, &pMac->lim.gLimReassocBssId, sizeof(tSirMacAddr));
188 pMac->lim.gLimReassocChannelId = 0;
189 palZeroMemory(pMac->hHdd, &pMac->lim.gLimReassocSSID, sizeof(tSirMacSSid));
190 pMac->lim.gLimReassocBssCaps = 0;
191 pMac->lim.gLimReassocBssQosCaps = 0;
192 pMac->lim.gLimReassocBssPropCap = 0;
193 #endif
194
195 /* This is for testing purposes only, be default should always be off */
196 pMac->lim.gLimForceNoPropIE = 0;
197
198 // pMac->lim.gLimBssIdx = 0;
199
200 pMac->lim.gpLimMlmSetKeysReq = NULL;
201 pMac->lim.gpLimMlmRemoveKeyReq = NULL;
202 // pMac->lim.gLimStaid = 0; //TO SUPPORT BT-AMP
203
204}
205
206
207static void __limInitStatsVars(tpAniSirGlobal pMac)
208{
209 pMac->lim.gLimNumBeaconsRcvd = 0;
210 pMac->lim.gLimNumBeaconsIgnored = 0;
211
212 pMac->lim.gLimNumDeferredMsgs = 0;
213
214 /// Variable to keep track of number of currently associated STAs
215 pMac->lim.gLimNumOfCurrentSTAs = 0;
216 pMac->lim.gLimNumOfAniSTAs = 0; // count of ANI peers
217
218 /// This indicates number of RXed Beacons during HB period
219 //pMac->lim.gLimRxedBeaconCntDuringHB = 0;
220
221 // Heart-Beat interval value
222 pMac->lim.gLimHeartBeatCount = 0;
223
224 // Statistics to keep track of no. beacons rcvd in heart beat interval
225 palZeroMemory(pMac->hHdd, pMac->lim.gLimHeartBeatBeaconStats, sizeof(pMac->lim.gLimHeartBeatBeaconStats));
226
227#ifdef WLAN_DEBUG
228 // Debug counters
229 pMac->lim.numTot = 0;
230 pMac->lim.numBbt = 0;
231 pMac->lim.numProtErr = 0;
232 pMac->lim.numLearn = 0;
233 pMac->lim.numLearnIgnore = 0;
234 pMac->lim.numSme = 0;
235 palZeroMemory(pMac->hHdd, pMac->lim.numMAC, sizeof(pMac->lim.numMAC));
236 pMac->lim.gLimNumAssocReqDropInvldState = 0;
237 pMac->lim.gLimNumAssocReqDropACRejectTS = 0;
238 pMac->lim.gLimNumAssocReqDropACRejectSta = 0;
239 pMac->lim.gLimNumReassocReqDropInvldState = 0;
240 pMac->lim.gLimNumHashMissIgnored = 0;
241 pMac->lim.gLimUnexpBcnCnt = 0;
242 pMac->lim.gLimBcnSSIDMismatchCnt = 0;
243 pMac->lim.gLimNumLinkEsts = 0;
244 pMac->lim.gLimNumRxCleanup = 0;
245 pMac->lim.gLim11bStaAssocRejectCount = 0;
246#endif
247}
248
249
250
251static void __limInitStates(tpAniSirGlobal pMac)
252{
253 // Counts Heartbeat failures
254 pMac->lim.gLimHBfailureCntInLinkEstState = 0;
255 pMac->lim.gLimProbeFailureAfterHBfailedCnt = 0;
256 pMac->lim.gLimHBfailureCntInOtherStates = 0;
257 pMac->lim.gLimRspReqd = 0;
258 pMac->lim.gLimPrevSmeState = eLIM_SME_OFFLINE_STATE;
259
260 /// MLM State visible across all Sirius modules
Jeff Johnsone7245742012-09-05 17:12:55 -0700261 MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, NO_SESSION, eLIM_MLM_IDLE_STATE));
Jeff Johnson295189b2012-06-20 16:38:30 -0700262 pMac->lim.gLimMlmState = eLIM_MLM_IDLE_STATE;
263
264 /// Previous MLM State
265 pMac->lim.gLimPrevMlmState = eLIM_MLM_OFFLINE_STATE;
266
267#ifdef GEN4_SCAN
268 // LIM to HAL SCAN Management Message Interface states
269 pMac->lim.gLimHalScanState = eLIM_HAL_IDLE_SCAN_STATE;
270#endif // GEN4_SCAN
271
272#ifdef FEATURE_WLAN_INTEGRATED_SOC
273 /**
Jeff Johnsone7245742012-09-05 17:12:55 -0700274 * Initialize state to eLIM_SME_OFFLINE_STATE
Jeff Johnson295189b2012-06-20 16:38:30 -0700275 */
Jeff Johnsone7245742012-09-05 17:12:55 -0700276 pMac->lim.gLimSmeState = eLIM_SME_OFFLINE_STATE;
Jeff Johnson295189b2012-06-20 16:38:30 -0700277#else
278 /**
279 * Initialize state to suspended state and wait for
280 * HAL to send LIM_RESUME_ACTIVITY_NTF message.
281 */
Jeff Johnsone7245742012-09-05 17:12:55 -0700282 MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, NO_SESSION, pMac->lim.gLimSmeState));
Jeff Johnson295189b2012-06-20 16:38:30 -0700283 pMac->lim.gLimSmeState = eLIM_SME_SUSPEND_STATE;
284#endif /* FEATURE_WLAN_INTEGRATED_SOC */
285
286 /**
287 * By default assume 'unknown' role. This will be updated
288 * when SME_START_BSS_REQ is received.
289 */
290
291 palZeroMemory(pMac->hHdd, &pMac->lim.gLimOverlap11gParams, sizeof(tLimProtStaParams));
292 palZeroMemory(pMac->hHdd, &pMac->lim.gLimOverlap11aParams, sizeof(tLimProtStaParams));
293 palZeroMemory(pMac->hHdd, &pMac->lim.gLimOverlapHt20Params, sizeof(tLimProtStaParams));
294 palZeroMemory(pMac->hHdd, &pMac->lim.gLimOverlapNonGfParams, sizeof(tLimProtStaParams));
295 palZeroMemory(pMac->hHdd, &pMac->lim.gLimNoShortParams, sizeof(tLimNoShortParams));
296 palZeroMemory(pMac->hHdd, &pMac->lim.gLimNoShortSlotParams, sizeof(tLimNoShortSlotParams));
297
298 pMac->lim.gLimPhyMode = 0;
299 pMac->lim.scanStartTime = 0; // used to measure scan time
300
Jeff Johnson295189b2012-06-20 16:38:30 -0700301 palZeroMemory(pMac->hHdd, pMac->lim.gLimMyMacAddr, sizeof(pMac->lim.gLimMyMacAddr));
302 pMac->lim.ackPolicy = 0;
303
304#if 0 /* Moving all these to session specific elements */
305 pMac->lim.gLimQosEnabled = 0; //11E
306 pMac->lim.gLimWmeEnabled = 0; //WME
307 pMac->lim.gLimWsmEnabled = 0; //WSM
308 pMac->lim.gLimHcfEnabled = 0;
309 pMac->lim.gLim11dEnabled = 0;
310#endif
311
312 pMac->lim.gLimProbeRespDisableFlag = 0; // control over probe response
313}
314
315static void __limInitVars(tpAniSirGlobal pMac)
316{
317
318#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
319 palZeroMemory(pMac->hHdd, &pMac->lim.gLimAlternateRadioList, sizeof(tSirMultipleAlternateRadioInfo));
320#endif
321
322 // Place holder for Measurement Req/Rsp/Ind related info
323#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
324 pMac->lim.gpLimMeasReq = NULL;
325 palZeroMemory(pMac->hHdd, &pMac->lim.gLimMeasParams, sizeof(tLimMeasParams));
326 pMac->lim.gpLimMeasData = NULL;
327#endif
328
329 // WDS info
330 pMac->lim.gLimNumWdsInfoInd = 0;
331 pMac->lim.gLimNumWdsInfoSet = 0;
332 palZeroMemory(pMac->hHdd, &pMac->lim.gLimWdsInfo, sizeof(tSirWdsInfo));
333 /* initialize some parameters */
334 limInitWdsInfoParams(pMac);
335
336 // Deferred Queue Paramters
337 palZeroMemory(pMac->hHdd, &pMac->lim.gLimDeferredMsgQ, sizeof(tSirAddtsReq));
338
339 // addts request if any - only one can be outstanding at any time
340 palZeroMemory(pMac->hHdd, &pMac->lim.gLimAddtsReq, sizeof(tSirAddtsReq));
341 pMac->lim.gLimAddtsSent = 0;
342 pMac->lim.gLimAddtsRspTimerCount = 0;
343
344 //protection related config cache
345 palZeroMemory(pMac->hHdd, &pMac->lim.cfgProtection, sizeof(tCfgProtection));
346 pMac->lim.gLimProtectionControl = 0;
347 palZeroMemory(pMac->hHdd, &pMac->lim.gLimAlternateRadio, sizeof(tSirAlternateRadioInfo));
348 SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
349
Jeff Johnsone7245742012-09-05 17:12:55 -0700350#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -0700351 // 11h Spectrum Management Related Flag
Jeff Johnson295189b2012-06-20 16:38:30 -0700352 LIM_SET_RADAR_DETECTED(pMac, eANI_BOOLEAN_FALSE);
353 pMac->sys.gSysEnableLearnMode = eANI_BOOLEAN_TRUE;
Jeff Johnsone7245742012-09-05 17:12:55 -0700354#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700355 // WMM Related Flag
356 pMac->lim.gUapsdEnable = 0;
357 pMac->lim.gUapsdPerAcBitmask = 0;
358 pMac->lim.gUapsdPerAcTriggerEnableMask = 0;
359 pMac->lim.gUapsdPerAcDeliveryEnableMask = 0;
360
361 // QoS-AC Downgrade: Initially, no AC is admitted
362 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] = 0;
363 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] = 0;
364
365 //dialogue token List head/tail for Action frames request sent.
366 pMac->lim.pDialogueTokenHead = NULL;
367 pMac->lim.pDialogueTokenTail = NULL;
368
369 palZeroMemory(pMac->hHdd, &pMac->lim.tspecInfo, sizeof(tLimTspecInfo) * LIM_NUM_TSPEC_MAX);
370
371 // admission control policy information
372 palZeroMemory(pMac->hHdd, &pMac->lim.admitPolicyInfo, sizeof(tLimAdmitPolicyInfo));
373
374 pMac->lim.gLastBeaconDtimCount = 0;
375 pMac->lim.gLastBeaconDtimPeriod = 0;
376
377 //Scan in Power Save Flag
378 pMac->lim.gScanInPowersave = 0;
379}
380
381static void __limInitAssocVars(tpAniSirGlobal pMac)
382{
383 palZeroMemory(pMac->hHdd, pMac->lim.gpLimAIDpool,
384 sizeof(*pMac->lim.gpLimAIDpool) * (WNI_CFG_ASSOC_STA_LIMIT_STAMAX+1));
385 pMac->lim.freeAidHead = 0;
386 pMac->lim.freeAidTail = 0;
387 pMac->lim.gLimAssocStaLimit = WNI_CFG_ASSOC_STA_LIMIT_STADEF;
388
389 // Place holder for current authentication request
390 // being handled
391 pMac->lim.gpLimMlmAuthReq = NULL;
Jeff Johnsone7245742012-09-05 17:12:55 -0700392 //pMac->lim.gpLimMlmJoinReq = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -0700393
394 /// MAC level Pre-authentication related globals
395 pMac->lim.gLimPreAuthChannelNumber = 0;
396 pMac->lim.gLimPreAuthType = eSIR_OPEN_SYSTEM;
397 palZeroMemory(pMac->hHdd, &pMac->lim.gLimPreAuthPeerAddr, sizeof(tSirMacAddr));
398 pMac->lim.gLimNumPreAuthContexts = 0;
399 palZeroMemory(pMac->hHdd, &pMac->lim.gLimPreAuthTimerTable, sizeof(tLimPreAuthTable));
400
401 // Placed holder to deauth reason
402 pMac->lim.gLimDeauthReasonCode = 0;
403
404 // Place holder for Pre-authentication node list
405 pMac->lim.pLimPreAuthList = NULL;
406
407 // Send Disassociate frame threshold parameters
408 pMac->lim.gLimDisassocFrameThreshold = LIM_SEND_DISASSOC_FRAME_THRESHOLD;
409 pMac->lim.gLimDisassocFrameCredit = 0;
410
411 //One cache for each overlap and associated case.
412 palZeroMemory(pMac->hHdd, pMac->lim.protStaOverlapCache, sizeof(tCacheParams) * LIM_PROT_STA_OVERLAP_CACHE_SIZE);
413 palZeroMemory(pMac->hHdd, pMac->lim.protStaCache, sizeof(tCacheParams) * LIM_PROT_STA_CACHE_SIZE);
414
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700415#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
416 pMac->lim.pSessionEntry = NULL;
417 pMac->lim.reAssocRetryAttempt = 0;
418#endif
419
Jeff Johnson295189b2012-06-20 16:38:30 -0700420}
421
422
423static void __limInitTitanVars(tpAniSirGlobal pMac)
424{
Jeff Johnsone7245742012-09-05 17:12:55 -0700425#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -0700426 palZeroMemory(pMac->hHdd, &pMac->lim.gLimChannelSwitch, sizeof(tLimChannelSwitchInfo));
Jeff Johnson295189b2012-06-20 16:38:30 -0700427 pMac->lim.gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_IDLE;
Jeff Johnsone7245742012-09-05 17:12:55 -0700428 pMac->lim.gLimChannelSwitch.secondarySubBand = PHY_SINGLE_CHANNEL_CENTERED;
429#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700430 // Debug workaround for BEACON's
431 // State change triggered by "dump 222"
432 pMac->lim.gLimScanOverride = 1;
433 pMac->lim.gLimScanOverrideSaved = eSIR_ACTIVE_SCAN;
Jeff Johnson295189b2012-06-20 16:38:30 -0700434 pMac->lim.gLimTitanStaCount = 0;
435 pMac->lim.gLimBlockNonTitanSta = 0;
436}
437
438static void __limInitHTVars(tpAniSirGlobal pMac)
439{
440 pMac->lim.htCapabilityPresentInBeacon = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -0700441 pMac->lim.gHTGreenfield = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -0700442 pMac->lim.gHTShortGI40Mhz = 0;
443 pMac->lim.gHTShortGI20Mhz = 0;
444 pMac->lim.gHTMaxAmsduLength = 0;
445 pMac->lim.gHTDsssCckRate40MHzSupport = 0;
446 pMac->lim.gHTPSMPSupport = 0;
447 pMac->lim.gHTLsigTXOPProtection = 0;
448 pMac->lim.gHTMIMOPSState = eSIR_HT_MIMO_PS_STATIC;
449 pMac->lim.gHTAMpduDensity = 0;
450
451 pMac->lim.gMaxAmsduSizeEnabled = false;
452 pMac->lim.gHTMaxRxAMpduFactor = 0;
453 pMac->lim.gHTServiceIntervalGranularity = 0;
454 pMac->lim.gHTControlledAccessOnly = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -0700455 pMac->lim.gHTOperMode = eSIR_HT_OP_MODE_PURE;
456 pMac->lim.gHTPCOActive = 0;
457
458 pMac->lim.gHTPCOPhase = 0;
459 pMac->lim.gHTSecondaryBeacon = 0;
460 pMac->lim.gHTDualCTSProtection = 0;
461 pMac->lim.gHTSTBCBasicMCS = 0;
462 pMac->lim.gAddBA_Declined = 0; // Flag to Decline the BAR if the particular bit (0-7) is being set
463}
464
465#if defined( FEATURE_WLAN_INTEGRATED_SOC )
466static tSirRetStatus __limInitConfig( tpAniSirGlobal pMac )
467{
Jeff Johnsone7245742012-09-05 17:12:55 -0700468 tANI_U32 val1, val2, val3;
Jeff Johnson295189b2012-06-20 16:38:30 -0700469 tANI_U16 val16;
470 tANI_U8 val8;
471 tSirMacHTCapabilityInfo *pHTCapabilityInfo;
472 tSirMacHTInfoField1 *pHTInfoField1;
473 tpSirPowerSaveCfg pPowerSaveConfig;
474 tSirMacHTParametersInfo *pAmpduParamInfo;
475
476 /* Read all the CFGs here that were updated before peStart is called */
Jeff Johnsone7245742012-09-05 17:12:55 -0700477 /* All these CFG READS/WRITES are only allowed in init, at start when there is no session
478 * and they will be used throughout when there is no session
479 */
Jeff Johnson295189b2012-06-20 16:38:30 -0700480
Jeff Johnson295189b2012-06-20 16:38:30 -0700481 if(wlan_cfgGetInt(pMac, WNI_CFG_HT_CAP_INFO, &val1) != eSIR_SUCCESS)
482 {
483 PELOGE(limLog(pMac, LOGE, FL("could not retrieve HT Cap CFG\n"));)
484 return eSIR_FAILURE;
485 }
486
487 if(wlan_cfgGetInt(pMac, WNI_CFG_CHANNEL_BONDING_MODE, &val2) != eSIR_SUCCESS)
488 {
489 PELOGE(limLog(pMac, LOGE, FL("could not retrieve Channel Bonding CFG\n"));)
490 return eSIR_FAILURE;
491 }
492 val16 = ( tANI_U16 ) val1;
493 pHTCapabilityInfo = ( tSirMacHTCapabilityInfo* ) &val16;
494
495 //channel bonding mode could be set to anything from 0 to 4(Titan had these
496 // modes But for Taurus we have only two modes: enable(>0) or disable(=0)
497 pHTCapabilityInfo->supportedChannelWidthSet = val2 ?
498 WNI_CFG_CHANNEL_BONDING_MODE_ENABLE : WNI_CFG_CHANNEL_BONDING_MODE_DISABLE;
499 if(cfgSetInt(pMac, WNI_CFG_HT_CAP_INFO, *(tANI_U16*)pHTCapabilityInfo)
500 != eSIR_SUCCESS)
501 {
502 PELOGE(limLog(pMac, LOGE, FL("could not update HT Cap Info CFG\n"));)
503 return eSIR_FAILURE;
504 }
505
506 if(wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD1, &val1) != eSIR_SUCCESS)
507 {
508 PELOGE(limLog(pMac, LOGE, FL("could not retrieve HT INFO Field1 CFG\n"));)
509 return eSIR_FAILURE;
510 }
511
512 val8 = ( tANI_U8 ) val1;
513 pHTInfoField1 = ( tSirMacHTInfoField1* ) &val8;
514 pHTInfoField1->recommendedTxWidthSet =
515 (tANI_U8)pHTCapabilityInfo->supportedChannelWidthSet;
Jeff Johnson295189b2012-06-20 16:38:30 -0700516 if(cfgSetInt(pMac, WNI_CFG_HT_INFO_FIELD1, *(tANI_U8*)pHTInfoField1)
517 != eSIR_SUCCESS)
518 {
519 PELOGE(limLog(pMac, LOGE, FL("could not update HT Info Field\n"));)
520 return eSIR_FAILURE;
521 }
522
523 /* WNI_CFG_HEART_BEAT_THRESHOLD */
524
525 if( wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val1) !=
526 eSIR_SUCCESS )
527 {
528 PELOGE(limLog(pMac, LOGE, FL("could not retrieve WNI_CFG_HEART_BEAT_THRESHOLD CFG\n"));)
529 return eSIR_FAILURE;
530 }
531 if(!val1)
532 {
533 limDeactivateAndChangeTimer(pMac, eLIM_HEART_BEAT_TIMER);
534 pMac->sys.gSysEnableLinkMonitorMode = 0;
535 }
536 else
537 {
538 //No need to activate the timer during init time.
539 pMac->sys.gSysEnableLinkMonitorMode = 1;
540 }
541
542 /* WNI_CFG_SHORT_GI_20MHZ */
543
544 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_CAP_INFO, &val1) != eSIR_SUCCESS)
545 {
546 PELOGE(limLog(pMac, LOGE, FL("could not retrieve HT Cap CFG\n"));)
547 return eSIR_FAILURE;
548 }
549 if (wlan_cfgGetInt(pMac, WNI_CFG_SHORT_GI_20MHZ, &val2) != eSIR_SUCCESS)
550 {
551 PELOGE(limLog(pMac, LOGE, FL("could not retrieve shortGI 20Mhz CFG\n"));)
552 return eSIR_FAILURE;
553 }
554 if (wlan_cfgGetInt(pMac, WNI_CFG_SHORT_GI_40MHZ, &val3) != eSIR_SUCCESS)
555 {
556 PELOGE(limLog(pMac, LOGE, FL("could not retrieve shortGI 40Mhz CFG\n"));)
557 return eSIR_FAILURE;
558 }
559
560 val16 = ( tANI_U16 ) val1;
561 pHTCapabilityInfo = ( tSirMacHTCapabilityInfo* ) &val16;
562 pHTCapabilityInfo->shortGI20MHz = (tANI_U16)val2;
563 pHTCapabilityInfo->shortGI40MHz = (tANI_U16)val3;
564
565 if(cfgSetInt(pMac, WNI_CFG_HT_CAP_INFO, *(tANI_U16*)pHTCapabilityInfo) !=
566 eSIR_SUCCESS)
567 {
568 PELOGE(limLog(pMac, LOGE, FL("could not update HT Cap Info CFG\n"));)
569 return eSIR_FAILURE;
570 }
571
572 /* WNI_CFG_MAX_RX_AMPDU_FACTOR */
573
574 if (wlan_cfgGetInt(pMac, WNI_CFG_HT_AMPDU_PARAMS, &val1) != eSIR_SUCCESS)
575 {
576 PELOGE(limLog(pMac, LOGE, FL("could not retrieve HT AMPDU Param CFG\n"));)
577 return eSIR_FAILURE;
578 }
579 if (wlan_cfgGetInt(pMac, WNI_CFG_MAX_RX_AMPDU_FACTOR, &val2) != eSIR_SUCCESS)
580 {
581 PELOGE(limLog(pMac, LOGE, FL("could not retrieve AMPDU Factor CFG\n"));)
582 return eSIR_FAILURE;
583 }
584 val16 = ( tANI_U16 ) val1;
585 pAmpduParamInfo = ( tSirMacHTParametersInfo* ) &val16;
586 pAmpduParamInfo->maxRxAMPDUFactor = (tANI_U8)val2;
587 if(cfgSetInt(pMac, WNI_CFG_HT_AMPDU_PARAMS, *(tANI_U8*)pAmpduParamInfo) !=
588 eSIR_SUCCESS)
589 {
590 PELOGE(limLog(pMac, LOGE, FL("could not update HT AMPDU Param CFG\n"));)
591 return eSIR_FAILURE;
592 }
593
594 /* WNI_CFG_SHORT_PREAMBLE - this one is not updated in
595 limHandleCFGparamUpdate do we want to update this? */
596 if(wlan_cfgGetInt(pMac, WNI_CFG_SHORT_PREAMBLE, &val1) != eSIR_SUCCESS)
597 {
598 limLog(pMac, LOGP, FL("cfg get short preamble failed\n"));
599 return eSIR_FAILURE;
600 }
601
Jeff Johnson295189b2012-06-20 16:38:30 -0700602 /* WNI_CFG_MAX_PS_POLL */
603
604 /* Allocate and fill in power save configuration. */
605 if (palAllocateMemory(pMac->hHdd, (void **)&pPowerSaveConfig,
606 sizeof(tSirPowerSaveCfg)) != eHAL_STATUS_SUCCESS)
607 {
608 PELOGE(limLog(pMac, LOGE, FL("LIM: Cannot allocate memory for power save "
609 "configuration\n"));)
610 return eSIR_FAILURE;
611 }
612
613 /* This context should be valid if power-save configuration message has been
614 * already dispatched during initialization process. Re-using the present
615 * configuration mask
616 */
617 palCopyMemory(pMac->hHdd, pPowerSaveConfig, (tANI_U8 *)&pMac->pmm.gPmmCfg,
618 sizeof(tSirPowerSaveCfg));
619
620 /* Note: it is okay to do this since DAL/HAL is alrady started */
621 if ( (pmmSendPowerSaveCfg(pMac, pPowerSaveConfig)) != eSIR_SUCCESS)
622 {
623 PELOGE(limLog(pMac, LOGE, FL("LIM: pmmSendPowerSaveCfg() failed \n"));)
624 return eSIR_FAILURE;
625 }
626
627 /* WNI_CFG_BG_SCAN_CHANNEL_LIST_CHANNEL_LIST */
628
629#if (WNI_POLARIS_FW_PRODUCT == WLAN_STA) || defined(ANI_AP_CLIENT_SDK)
630 PELOG1(limLog(pMac, LOG1,
631 FL("VALID_CHANNEL_LIST has changed, reset next bg scan channel\n"));)
632 pMac->lim.gLimBackgroundScanChannelId = 0;
633#endif
634
635 /* WNI_CFG_PROBE_RSP_BCN_ADDNIE_DATA - not needed */
636
637 /* This was initially done after resume notification from HAL. Now, DAL is
638 started before PE so this can be done here */
Jeff Johnsone7245742012-09-05 17:12:55 -0700639 handleHTCapabilityandHTInfo(pMac, NULL);
Jeff Johnson295189b2012-06-20 16:38:30 -0700640
641 return eSIR_SUCCESS;
642}
643#endif /* FEATURE_WLAN_INTEGRATED_SOC */
644
645/*
646 limStart
647 This function is to replace the __limProcessSmeStartReq since there is no
648 eWNI_SME_START_REQ post to PE.
649*/
650tSirRetStatus limStart(tpAniSirGlobal pMac)
651{
652 tSirResultCodes retCode = eSIR_SUCCESS;
653
654 PELOG1(limLog(pMac, LOG1, FL(" enter\n"));)
655
656 if (pMac->lim.gLimSmeState == eLIM_SME_OFFLINE_STATE)
657 {
658 pMac->lim.gLimSmeState = eLIM_SME_IDLE_STATE;
659
Jeff Johnsone7245742012-09-05 17:12:55 -0700660 MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, NO_SESSION, pMac->lim.gLimSmeState));
Jeff Johnson295189b2012-06-20 16:38:30 -0700661
662 // By default do not return after first scan match
663 pMac->lim.gLimReturnAfterFirstMatch = 0;
664
665 // Initialize MLM state machine
666 limInitMlm(pMac);
667
668 // By default return unique scan results
669 pMac->lim.gLimReturnUniqueResults = true;
670 pMac->lim.gLimSmeScanResultLength = 0;
671 }
672 else
673 {
674 /**
675 * Should not have received eWNI_SME_START_REQ in states
676 * other than OFFLINE. Return response to host and
677 * log error
678 */
679 limLog(pMac, LOGE, FL("Invalid SME state %X\n"),pMac->lim.gLimSmeState );
680 retCode = eSIR_FAILURE;
681 }
682
683 return retCode;
684}
685
686/**
687 * limInitialize()
688 *
689 *FUNCTION:
690 * This function is called from LIM thread entry function.
691 * LIM related global data structures are initialized in this function.
692 *
693 *LOGIC:
694 * NA
695 *
696 *ASSUMPTIONS:
697 * NA
698 *
699 *NOTE:
700 * NA
701 *
702 * @param pMac - Pointer to global MAC structure
703 * @return None
704 */
705
706tSirRetStatus
707limInitialize(tpAniSirGlobal pMac)
708{
709 tSirRetStatus status = eSIR_SUCCESS;
710
711 __limInitAssocVars(pMac);
712 __limInitVars(pMac);
713 __limInitStates(pMac);
714 __limInitStatsVars(pMac);
715 __limInitBssVars(pMac);
716 __limInitScanVars(pMac);
717 __limInitHTVars(pMac);
718 __limInitTitanVars(pMac);
719
720#if defined( FEATURE_WLAN_INTEGRATED_SOC )
721 status = limStart(pMac);
722 if(eSIR_SUCCESS != status)
723 {
724 return status;
725 }
726#endif /* FEATURE_WLAN_INTEGRATED_SOC */
727
728 /*
729 * MLM will be intitalized when 'START' request comes from SME.
730 * limInitMlm calls limCreateTimers, which actually relies on
731 * CFG to be downloaded. So it should not be called as part of
732 * peStart, as CFG download is happening after peStart.
733 */
734 //limInitMlm(pMac);
735 // Initializations for maintaining peers in IBSS
736 limIbssInit(pMac);
737
738 pmmInitialize(pMac);
739
740
741#if defined WLAN_FEATURE_VOWIFI
742 rrmInitialize(pMac);
743#endif
744#if defined WLAN_FEATURE_VOWIFI_11R
745 limFTOpen(pMac);
746#endif
747
748#ifdef WLAN_FEATURE_P2P
749 vos_list_init(&pMac->lim.gLimMgmtFrameRegistratinQueue);
750#endif
751
752#if 0
753
754 vos_trace_setLevel(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR);
755 vos_trace_setLevel(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_WARN);
756 vos_trace_setLevel(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_FATAL);
757
758 vos_trace_setLevel(VOS_MODULE_ID_HAL, VOS_TRACE_LEVEL_WARN);
759 vos_trace_setLevel(VOS_MODULE_ID_HAL, VOS_TRACE_LEVEL_ERROR);
760
761 vos_trace_setLevel(VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_WARN);
762 vos_trace_setLevel(VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_ERROR);
763 vos_trace_setLevel(VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR);
764
765 vos_trace_setLevel(VOS_MODULE_ID_SAL, VOS_TRACE_LEVEL_ERROR);
766
767 vos_trace_setLevel(VOS_MODULE_ID_SSC, VOS_TRACE_LEVEL_ERROR);
768
769 vos_trace_setLevel(VOS_MODULE_ID_SAL, VOS_TRACE_LEVEL_ERROR);
770 vos_trace_setLevel(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR);
771
772 vos_trace_setLevel(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR);
773
774
775 vos_trace_setLevel(VOS_MODULE_ID_BAL, VOS_TRACE_LEVEL_ERROR);
776
777 vos_trace_setLevel(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR);
778#endif
779 MTRACE(limTraceInit(pMac));
780
781#if defined( FEATURE_WLAN_INTEGRATED_SOC )
782 //Initialize the configurations needed by PE
783 if( eSIR_FAILURE == __limInitConfig(pMac))
784 {
785 //We need to undo everything in limStart
786 limCleanupMlm(pMac);
787 return eSIR_FAILURE;
788 }
789
790 //initialize the TSPEC admission control table.
791 //Note that this was initially done after resume notification from HAL.
792 //Now, DAL is started before PE so this can be done here
793 limAdmitControlInit(pMac);
794 limRegisterHalIndCallBack(pMac);
795#endif /*FEATURE_WLAN_INTEGRATED_SOC*/
796
797 return status;
798
799} /*** end limInitialize() ***/
800
801
802
803/**
804 * limCleanup()
805 *
806 *FUNCTION:
807 * This function is called upon reset or persona change
808 * to cleanup LIM state
809 *
810 *LOGIC:
811 * NA
812 *
813 *ASSUMPTIONS:
814 * NA
815 *
816 *NOTE:
817 * NA
818 *
819 * @param pMac - Pointer to Global MAC structure
820 * @return None
821 */
822
823void
824limCleanup(tpAniSirGlobal pMac)
825{
826#ifdef VOSS_ENABLED
827 v_PVOID_t pvosGCTx;
828 VOS_STATUS retStatus;
829#endif
830
831#ifdef WLAN_FEATURE_P2P
832//Before destroying the list making sure all the nodes have been deleted.
833//Which should be the normal case, but a memory leak has been reported.
834
835 tpLimMgmtFrameRegistration pLimMgmtRegistration = NULL;
836
837 while(vos_list_remove_front(&pMac->lim.gLimMgmtFrameRegistratinQueue,
838 (vos_list_node_t**)&pLimMgmtRegistration) == VOS_STATUS_SUCCESS)
839 {
840 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
841 FL("Fixing leak! Deallocating pLimMgmtRegistration node"));
842
843 palFreeMemory(pMac, pLimMgmtRegistration);
844 }
845
846 vos_list_destroy(&pMac->lim.gLimMgmtFrameRegistratinQueue);
847#endif
848
849 limCleanupMlm(pMac);
850 limCleanupLmm(pMac);
851
852 // free up preAuth table
853 if (pMac->lim.gLimPreAuthTimerTable.pTable != NULL)
854 {
855 palFreeMemory(pMac->hHdd, pMac->lim.gLimPreAuthTimerTable.pTable);
856 pMac->lim.gLimPreAuthTimerTable.pTable = NULL;
857 pMac->lim.gLimPreAuthTimerTable.numEntry = 0;
858 }
859
860 if(NULL != pMac->lim.pDialogueTokenHead)
861 {
862 limDeleteDialogueTokenList(pMac);
863 }
864
865 if(NULL != pMac->lim.pDialogueTokenTail)
866 {
867 palFreeMemory(pMac->hHdd, (void *) pMac->lim.pDialogueTokenTail);
868 pMac->lim.pDialogueTokenTail = NULL;
869 }
870
871 # if 0
872 if (pMac->lim.gpLimStartBssReq != NULL)
873 {
874 palFreeMemory(pMac->hHdd, pMac->lim.gpLimStartBssReq);
875 pMac->lim.gpLimStartBssReq = NULL;
876 }
877 #endif
878
879 if (pMac->lim.gpLimMlmSetKeysReq != NULL)
880 {
881 palFreeMemory(pMac->hHdd, pMac->lim.gpLimMlmSetKeysReq);
882 pMac->lim.gpLimMlmSetKeysReq = NULL;
883 }
884
885 #if 0
886 if (pMac->lim.gpLimJoinReq != NULL)
887 {
888 palFreeMemory(pMac->hHdd, pMac->lim.gpLimJoinReq);
889 pMac->lim.gpLimJoinReq = NULL;
890 }
891 #endif
892
893 if (pMac->lim.gpLimMlmAuthReq != NULL)
894 {
895 palFreeMemory(pMac->hHdd, pMac->lim.gpLimMlmAuthReq);
896 pMac->lim.gpLimMlmAuthReq = NULL;
897 }
898
Jeff Johnsone7245742012-09-05 17:12:55 -0700899#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -0700900 if (pMac->lim.gpLimMlmJoinReq != NULL)
901 {
902 palFreeMemory(pMac->hHdd, pMac->lim.gpLimMlmJoinReq);
903 pMac->lim.gpLimMlmJoinReq = NULL;
904 }
Jeff Johnsone7245742012-09-05 17:12:55 -0700905#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700906
907 #if 0
908 if (pMac->lim.gpLimReassocReq != NULL)
909 {
910 palFreeMemory(pMac->hHdd, pMac->lim.gpLimReassocReq);
911 pMac->lim.gpLimReassocReq = NULL;
912 }
913 #endif
914
915 if (pMac->lim.gpLimMlmRemoveKeyReq != NULL)
916 {
917 palFreeMemory(pMac->hHdd, pMac->lim.gpLimMlmRemoveKeyReq);
918 pMac->lim.gpLimMlmRemoveKeyReq = NULL;
919 }
920
Viral Modid86bde22012-12-10 13:09:21 -0800921#ifdef WLAN_FEATURE_P2P
922 if (pMac->lim.gpLimSmeScanReq != NULL)
923 {
924 palFreeMemory(pMac->hHdd, pMac->lim.gpLimSmeScanReq);
925 pMac->lim.gpLimSmeScanReq = NULL;
926 }
927#endif
928
Jeff Johnson295189b2012-06-20 16:38:30 -0700929 if (pMac->lim.gpLimMlmScanReq != NULL)
930 {
931 palFreeMemory(pMac->hHdd, pMac->lim.gpLimMlmScanReq);
932 pMac->lim.gpLimMlmScanReq = NULL;
933 }
934
935#if 0
936 if(NULL != pMac->lim.beacon)
937 {
938 palFreeMemory(pMac->hHdd, (void*) pMac->lim.beacon);
939 pMac->lim.beacon = NULL;
940 }
941#endif
942 #if 0
943 if(NULL != pMac->lim.assocReq)
944 {
945 palFreeMemory(pMac->hHdd, (void*) pMac->lim.assocReq);
946 pMac->lim.assocReq= NULL;
947 }
948 #endif
949
950#if 0
951 if(NULL != pMac->lim.assocRsp)
952 {
953 palFreeMemory(pMac->hHdd, (void*) pMac->lim.assocRsp);
954 pMac->lim.assocRsp= NULL;
955 }
956#endif
957 // Now, finally reset the deferred message queue pointers
958 limResetDeferredMsgQ(pMac);
959
960#ifdef VOSS_ENABLED
961
962 pvosGCTx = vos_get_global_context(VOS_MODULE_ID_PE, (v_VOID_t *) pMac);
963 retStatus = WLANTL_DeRegisterMgmtFrmClient(pvosGCTx);
964
965 if ( retStatus != VOS_STATUS_SUCCESS )
966 PELOGE(limLog(pMac, LOGE, FL("DeRegistering the PE Handle with TL has failed bailing out...\n"));)
967#endif
968
969#if defined WLAN_FEATURE_VOWIFI
970 rrmCleanup(pMac);
971#endif
972#if defined WLAN_FEATURE_VOWIFI_11R
973 limFTCleanup(pMac);
974#endif
975
976} /*** end limCleanup() ***/
977
978
979/** -------------------------------------------------------------
980\fn peOpen
981\brief will be called in Open sequence from macOpen
982\param tpAniSirGlobal pMac
983\param tHalOpenParameters *pHalOpenParam
984\return tSirRetStatus
985 -------------------------------------------------------------*/
986
987tSirRetStatus peOpen(tpAniSirGlobal pMac, tMacOpenParameters *pMacOpenParam)
988{
989 pMac->lim.maxBssId = pMacOpenParam->maxBssId;
990 pMac->lim.maxStation = pMacOpenParam->maxStation;
991
992 if ((pMac->lim.maxBssId == 0) || (pMac->lim.maxStation == 0))
993 {
994 PELOGE(limLog(pMac, LOGE, FL("max number of Bssid or Stations cannot be zero!\n"));)
995 return eSIR_FAILURE;
996 }
997
998 if (eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd,
999 (void **) &pMac->lim.limTimers.gpLimCnfWaitTimer, sizeof(TX_TIMER)*pMac->lim.maxStation))
1000 {
1001 PELOGE(limLog(pMac, LOGE, FL("memory allocate failed!\n"));)
1002 return eSIR_FAILURE;
1003 }
1004
1005 if (eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd,
1006 (void **) &pMac->lim.gpLimAIDpool,
1007 sizeof(*pMac->lim.gpLimAIDpool) * (WNI_CFG_ASSOC_STA_LIMIT_STAMAX+1)))
1008 {
1009 PELOGE(limLog(pMac, LOGE, FL("memory allocate failed!\n"));)
1010 return eSIR_FAILURE;
1011 }
1012
1013 if (eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd,
1014 (void **) &pMac->lim.gpSession, sizeof(tPESession)* pMac->lim.maxBssId))
1015 {
1016 limLog(pMac, LOGE, FL("memory allocate failed!\n"));
1017 return eSIR_FAILURE;
1018 }
1019
1020 palZeroMemory(pMac->hHdd, pMac->lim.gpSession, sizeof(tPESession)*pMac->lim.maxBssId);
1021
1022
1023 /*
1024 if (eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd,
1025 (void **) &pMac->dph.dphHashTable.pHashTable, sizeof(tpDphHashNode)*pMac->lim.maxStation))
1026 {
1027 PELOGE(limLog(pMac, LOGE, FL("memory allocate failed!\n"));)
1028 return eSIR_FAILURE;
1029 }
1030
1031 if (eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd,
1032 (void **) &pMac->dph.dphHashTable.pDphNodeArray, sizeof(tDphHashNode)*pMac->lim.maxStation))
1033 {
1034 PELOGE(limLog(pMac, LOGE, FL("memory allocate failed!\n"));)
1035 return eSIR_FAILURE;
1036 }
1037 */
1038
1039#ifdef WLAN_SOFTAP_FEATURE
1040 if (eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd,
1041 (void **) &pMac->pmm.gPmmTim.pTim, sizeof(tANI_U8)*pMac->lim.maxStation))
1042 {
1043 PELOGE(limLog(pMac, LOGE, FL("memory allocate failed for pTim!\n"));)
1044 return eSIR_FAILURE;
1045 }
1046 palZeroMemory(pMac->hHdd, pMac->pmm.gPmmTim.pTim, sizeof(tANI_U8)*pMac->lim.maxStation);
1047#endif
1048
1049#ifdef ANI_PRODUCT_TYPE_AP
1050
1051 if (eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd,
1052 (void **) &pMac->pmm.gPmmTim.pStaInfo, sizeof(*pMac->pmm.gPmmTim.pStaInfo) * pMac->lim.maxStation))
1053 {
1054 PELOGE(limLog(pMac, LOGE, FL("memory allocate failed for pStaInfo!\n"));)
1055 return eSIR_FAILURE;
1056 }
1057
1058 if (eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd,
1059 (void **) &pMac->pmm.gpPmmStaState, sizeof(tPmmStaState)*pMac->lim.maxStation))
1060 {
1061 PELOGE(limLog(pMac, LOGE, FL("memory allocate failed!\n"));)
1062 return eSIR_FAILURE;
1063 }
1064
1065 if (eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd,
1066 (void **) &pMac->pmm.gpPmmPSState, sizeof(tANI_U8)*pMac->lim.maxStation))
1067 {
1068 PELOGE(limLog(pMac, LOGE, FL("memory allocate failed!\n"));)
1069 return eSIR_FAILURE;
1070 }
1071#endif
1072
Jeff Johnsone7245742012-09-05 17:12:55 -07001073#ifdef WLAN_FEATURE_P2P
1074 pMac->lim.actionFrameSessionId = 0xff;
1075#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001076
1077 return eSIR_SUCCESS;
1078}
1079
1080/** -------------------------------------------------------------
1081\fn peClose
1082\brief will be called in close sequence from macClose
1083\param tpAniSirGlobal pMac
1084\return tSirRetStatus
1085 -------------------------------------------------------------*/
1086
1087tSirRetStatus peClose(tpAniSirGlobal pMac)
1088{
1089 tANI_U8 i;
1090
1091 if (ANI_DRIVER_TYPE(pMac) == eDRIVER_TYPE_MFG)
1092 return eSIR_SUCCESS;
Jeff Johnsone7245742012-09-05 17:12:55 -07001093
Jeff Johnson295189b2012-06-20 16:38:30 -07001094 for(i =0; i < pMac->lim.maxBssId; i++)
1095 {
1096 if(pMac->lim.gpSession[i].valid == TRUE)
1097 {
1098 peDeleteSession(pMac,&pMac->lim.gpSession[i]);
1099 }
1100 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001101 palFreeMemory(pMac->hHdd, pMac->lim.limTimers.gpLimCnfWaitTimer);
1102 pMac->lim.limTimers.gpLimCnfWaitTimer = NULL;
1103 palFreeMemory(pMac->hHdd, pMac->lim.gpLimAIDpool);
1104 pMac->lim.gpLimAIDpool = NULL;
1105
Jeff Johnson295189b2012-06-20 16:38:30 -07001106 palFreeMemory(pMac->hHdd, pMac->lim.gpSession);
1107 pMac->lim.gpSession = NULL;
1108 /*
1109 palFreeMemory(pMac->hHdd, pMac->dph.dphHashTable.pHashTable);
1110 pMac->dph.dphHashTable.pHashTable = NULL;
1111 palFreeMemory(pMac->hHdd, pMac->dph.dphHashTable.pDphNodeArray);
1112 pMac->dph.dphHashTable.pDphNodeArray = NULL;
1113 */
1114#ifdef WLAN_SOFTAP_FEATURE
1115 palFreeMemory(pMac->hHdd, pMac->pmm.gPmmTim.pTim);
1116 pMac->pmm.gPmmTim.pTim = NULL;
1117#endif
1118#ifdef ANI_PRODUCT_TYPE_AP
1119 palFreeMemory(pMac->hHdd, pMac->pmm.gPmmTim.pStaInfo);
1120 pMac->pmm.gPmmTim.pStaInfo = NULL;
1121 palFreeMemory(pMac->hHdd, pMac->pmm.gpPmmStaState);
1122 pMac->pmm.gpPmmStaState = NULL;
1123 palFreeMemory(pMac->hHdd, pMac->pmm.gpPmmPSState);
1124 pMac->pmm.gpPmmPSState = NULL;
1125#endif
1126
1127 return eSIR_SUCCESS;
1128}
1129
1130/** -------------------------------------------------------------
1131\fn peStart
1132\brief will be called in start sequence from macStart
1133\param tpAniSirGlobal pMac
1134\return none
1135 -------------------------------------------------------------*/
1136
1137tSirRetStatus peStart(tpAniSirGlobal pMac)
1138{
1139 tSirRetStatus status = eSIR_SUCCESS;
1140
1141 status = limInitialize(pMac);
1142#if defined(ANI_LOGDUMP)
1143 limDumpInit(pMac);
1144#endif //#if defined(ANI_LOGDUMP)
1145
1146 return status;
1147}
1148
1149/** -------------------------------------------------------------
1150\fn peStop
1151\brief will be called in stop sequence from macStop
1152\param tpAniSirGlobal pMac
1153\return none
1154 -------------------------------------------------------------*/
1155
1156void peStop(tpAniSirGlobal pMac)
1157{
1158 limCleanup(pMac);
1159 SET_LIM_MLM_STATE(pMac, eLIM_MLM_OFFLINE_STATE);
1160 return;
1161}
1162
1163/** -------------------------------------------------------------
1164\fn peFreeMsg
1165\brief Called by VOS scheduler (function vos_sched_flush_mc_mqs)
1166\ to free a given PE message on the TX and MC thread.
1167\ This happens when there are messages pending in the PE
1168\ queue when system is being stopped and reset.
1169\param tpAniSirGlobal pMac
1170\param tSirMsgQ pMsg
1171\return none
1172-----------------------------------------------------------------*/
1173v_VOID_t peFreeMsg( tpAniSirGlobal pMac, tSirMsgQ* pMsg)
1174{
1175 if (pMsg != NULL)
1176 {
1177 if (NULL != pMsg->bodyptr)
1178 {
1179 if (SIR_BB_XPORT_MGMT_MSG == pMsg->type)
1180 {
1181 vos_pkt_return_packet((vos_pkt_t *)pMsg->bodyptr);
1182 }
1183 else
1184 {
1185 vos_mem_free((v_VOID_t*)pMsg->bodyptr);
1186 }
1187 }
1188 pMsg->bodyptr = 0;
1189 pMsg->bodyval = 0;
1190 pMsg->type = 0;
1191 }
1192 return;
1193}
1194
1195
1196/**
1197 * The function checks if a particular timer should be allowed
1198 * into LIM while device is sleeping
1199 */
1200tANI_U8 limIsTimerAllowedInPowerSaveState(tpAniSirGlobal pMac, tSirMsgQ *pMsg)
1201{
1202 tANI_U8 retStatus = TRUE;
1203
1204 if(!limIsSystemInActiveState(pMac))
1205 {
1206 switch(pMsg->type)
1207 {
1208 /* Don't allow following timer messages if in sleep */
1209 case SIR_LIM_MIN_CHANNEL_TIMEOUT:
1210 case SIR_LIM_MAX_CHANNEL_TIMEOUT:
1211 case SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT:
1212 retStatus = FALSE;
1213 break;
1214 /* May allow following timer messages in sleep mode */
1215 case SIR_LIM_HASH_MISS_THRES_TIMEOUT:
1216
1217 /* Safe to allow as of today, this triggers background scan
1218 * which will not be started if the device is in power-save mode
1219 * might need to block in the future if we decide to implement
1220 * spectrum management
1221 */
1222 case SIR_LIM_QUIET_TIMEOUT:
1223
1224 /* Safe to allow as of today, this triggers background scan
1225 * which will not be started if the device is in power-save mode
1226 * might need to block in the future if we decide to implement
1227 * spectrum management
1228 */
1229 case SIR_LIM_QUIET_BSS_TIMEOUT:
1230
1231 /* Safe to allow this timermessage, triggers background scan
1232 * which is blocked in sleep mode
1233 */
1234 case SIR_LIM_CHANNEL_SCAN_TIMEOUT:
1235
1236 /* Safe to allow this timer, since, while in IMPS this timer will not
1237 * be started. In case of BMPS sleep, SoftMAC handles the heart-beat
1238 * when heart-beat control is handled back to PE, device would have
1239 * already woken-up due to EXIT_BMPS_IND mesage from SoftMAC
1240 */
1241 case SIR_LIM_HEART_BEAT_TIMEOUT:
1242 case SIR_LIM_PROBE_HB_FAILURE_TIMEOUT:
1243
1244 /* Safe to allow, PE is not handling this message as of now. May need
1245 * to block it, basically, free the buffer and restart the timer
1246 */
1247 case SIR_LIM_REASSOC_FAIL_TIMEOUT:
1248 case SIR_LIM_JOIN_FAIL_TIMEOUT:
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -08001249 case SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT:
Jeff Johnson295189b2012-06-20 16:38:30 -07001250 case SIR_LIM_ASSOC_FAIL_TIMEOUT:
1251 case SIR_LIM_AUTH_FAIL_TIMEOUT:
1252 case SIR_LIM_ADDTS_RSP_TIMEOUT:
1253 retStatus = TRUE;
1254 break;
1255
1256 /* by default allow rest of messages */
1257 default:
1258 retStatus = TRUE;
1259 break;
1260
1261
1262 }
1263 }
1264
1265 return retStatus;
1266
1267}
1268
1269
1270
1271/**
1272 * limPostMsgApi()
1273 *
1274 *FUNCTION:
1275 * This function is called from other thread while posting a
1276 * message to LIM message Queue gSirLimMsgQ.
1277 *
1278 *LOGIC:
1279 * NA
1280 *
1281 *ASSUMPTIONS:
1282 * NA
1283 *
1284 *NOTE:
1285 * NA
1286 *
1287 * @param pMac - Pointer to Global MAC structure
1288 * @param pMsg - Pointer to the message structure
1289 * @return None
1290 */
1291
1292tANI_U32
1293limPostMsgApi(tpAniSirGlobal pMac, tSirMsgQ *pMsg)
1294{
1295#ifdef VOSS_ENABLED
1296 return vos_mq_post_message(VOS_MQ_ID_PE, (vos_msg_t *) pMsg);
1297
1298
1299#elif defined(ANI_OS_TYPE_LINUX) || defined(ANI_OS_TYPE_OSX)
1300 return tx_queue_send(&pMac->sys.gSirLimMsgQ, pMsg, TX_WAIT_FOREVER);
1301
1302#else
1303 /* Check if this is a timeout message from a timer
1304 * and if the timeout message is allowed if the device is in power-save state
1305 */
1306 if(!limIsTimerAllowedInPowerSaveState(pMac, pMsg))
1307 {
1308 limLog(pMac, LOGW,
1309 FL("Timeout message %d is not allowed while device is in Power-Save mode\n"),
1310 pMsg->type);
1311
1312 return TX_SUCCESS;
1313 }
1314 if(pMac->gDriverType != eDRIVER_TYPE_MFG)
1315 {
1316 limMessageProcessor(pMac, pMsg);
1317 }
1318
1319 return TX_SUCCESS;
1320
1321#endif
1322} /*** end limPostMsgApi() ***/
1323
1324
1325/*--------------------------------------------------------------------------
1326
1327 \brief pePostMsgApi() - A wrapper function to post message to Voss msg queues
1328
1329 This function can be called by legacy code to post message to voss queues OR
1330 legacy code may keep on invoking 'limPostMsgApi' to post the message to voss queue
1331 for dispatching it later.
1332
1333 \param pMac - Pointer to Global MAC structure
1334 \param pMsg - Pointer to the message structure
1335
1336 \return tANI_U32 - TX_SUCCESS for success.
1337
1338 --------------------------------------------------------------------------*/
1339
1340tSirRetStatus pePostMsgApi(tpAniSirGlobal pMac, tSirMsgQ *pMsg)
1341{
1342 return (tSirRetStatus)limPostMsgApi(pMac, pMsg);
1343}
1344
1345/*--------------------------------------------------------------------------
1346
1347 \brief peProcessMessages() - Message Processor for PE
1348
1349 Voss calls this function to dispatch the message to PE
1350
1351 \param pMac - Pointer to Global MAC structure
1352 \param pMsg - Pointer to the message structure
1353
1354 \return tANI_U32 - TX_SUCCESS for success.
1355
1356 --------------------------------------------------------------------------*/
1357
1358tSirRetStatus peProcessMessages(tpAniSirGlobal pMac, tSirMsgQ* pMsg)
1359{
1360 if(pMac->gDriverType == eDRIVER_TYPE_MFG)
1361 {
1362 return eSIR_SUCCESS;
1363 }
1364 /**
1365 * If the Message to be handled is for CFG Module call the CFG Msg Handler and
1366 * for all the other cases post it to LIM
1367 */
1368 if ( SIR_CFG_PARAM_UPDATE_IND != pMsg->type && IS_CFG_MSG(pMsg->type))
1369 cfgProcessMbMsg(pMac, (tSirMbMsg*)pMsg->bodyptr);
1370 else
1371 limMessageProcessor(pMac, pMsg);
1372 return eSIR_SUCCESS;
1373}
1374
1375
1376#ifdef VOSS_ENABLED
1377
1378// ---------------------------------------------------------------------------
1379/**
1380 * peHandleMgmtFrame
1381 *
1382 * FUNCTION:
1383 * Process the Management frames from TL
1384 *
1385 * LOGIC:
1386 *
1387 * ASSUMPTIONS: TL sends the packet along with the VOS GlobalContext
1388 *
1389 * NOTE:
1390 *
1391 * @param pvosGCtx Global Vos Context
1392 * @param vossBuff Packet
1393 * @return None
1394 */
1395
1396VOS_STATUS peHandleMgmtFrame( v_PVOID_t pvosGCtx, v_PVOID_t vosBuff)
1397{
1398 tpAniSirGlobal pMac;
1399 tpSirMacMgmtHdr mHdr;
1400 tSirMsgQ msg;
1401 vos_pkt_t *pVosPkt;
1402 VOS_STATUS vosStatus;
1403 v_U8_t *pRxPacketInfo;
1404
1405 pVosPkt = (vos_pkt_t *)vosBuff;
1406 if (NULL == pVosPkt)
1407 {
1408 return VOS_STATUS_E_FAILURE;
1409 }
1410
1411 pMac = (tpAniSirGlobal)vos_get_context(VOS_MODULE_ID_PE, pvosGCtx);
1412 if (NULL == pMac)
1413 {
1414 // cannot log a failure without a valid pMac
1415 vos_pkt_return_packet(pVosPkt);
1416 return VOS_STATUS_E_FAILURE;
1417 }
1418
1419 vosStatus = WDA_DS_PeekRxPacketInfo( pVosPkt, (void *)&pRxPacketInfo, VOS_FALSE );
1420
1421 if(!VOS_IS_STATUS_SUCCESS(vosStatus))
1422 {
1423 vos_pkt_return_packet(pVosPkt);
1424 return VOS_STATUS_E_FAILURE;
1425 }
1426
1427
1428 //
1429 // The MPDU header is now present at a certain "offset" in
1430 // the BD and is specified in the BD itself
1431 //
1432 mHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1433 if(mHdr->fc.type == SIR_MAC_MGMT_FRAME)
1434 {
1435 PELOG1(limLog( pMac, LOG1,
1436 FL ( "RxBd=%p mHdr=%p Type: %d Subtype: %d Sizes:FC%d Mgmt%d\n"),
Jeff Johnsone7245742012-09-05 17:12:55 -07001437 pRxPacketInfo, mHdr, mHdr->fc.type, mHdr->fc.subType, sizeof(tSirMacFrameCtl), sizeof(tSirMacMgmtHdr) );)
Jeff Johnson295189b2012-06-20 16:38:30 -07001438
Jeff Johnsone7245742012-09-05 17:12:55 -07001439 MTRACE(macTrace(pMac, TRACE_CODE_RX_MGMT, NO_SESSION,
Jeff Johnson295189b2012-06-20 16:38:30 -07001440 LIM_TRACE_MAKE_RXMGMT(mHdr->fc.subType,
1441 (tANI_U16) (((tANI_U16) (mHdr->seqControl.seqNumHi << 4)) | mHdr->seqControl.seqNumLo)));)
1442 }
1443
1444
1445 // Forward to MAC via mesg = SIR_BB_XPORT_MGMT_MSG
1446 msg.type = SIR_BB_XPORT_MGMT_MSG;
1447 msg.bodyptr = vosBuff;
1448 msg.bodyval = 0;
1449
1450 if( eSIR_SUCCESS != sysBbtProcessMessageCore( pMac,
1451 &msg,
1452 mHdr->fc.type,
1453 mHdr->fc.subType ))
1454 {
1455 vos_pkt_return_packet(pVosPkt);
1456 limLog( pMac, LOGW,
1457 FL ( "sysBbtProcessMessageCore failed to process SIR_BB_XPORT_MGMT_MSG\n" ));
1458 return VOS_STATUS_E_FAILURE;
1459 }
1460
1461 return VOS_STATUS_SUCCESS;
1462}
1463
1464// ---------------------------------------------------------------------------
1465/**
1466 * peRegisterTLHandle
1467 *
1468 * FUNCTION:
1469 * Registers the Handler which, process the Management frames from TL
1470 *
1471 * LOGIC:
1472 *
1473 * ASSUMPTIONS:
1474 *
1475 * NOTE:
1476 *
1477 * @return None
1478 */
1479
1480void peRegisterTLHandle(tpAniSirGlobal pMac)
1481{
1482 v_PVOID_t pvosGCTx;
1483 VOS_STATUS retStatus;
1484
1485 pvosGCTx = vos_get_global_context(VOS_MODULE_ID_PE, (v_VOID_t *) pMac);
1486
1487 retStatus = WLANTL_RegisterMgmtFrmClient(pvosGCTx, peHandleMgmtFrame);
1488
1489 if (retStatus != VOS_STATUS_SUCCESS)
1490 limLog( pMac, LOGP, FL("Registering the PE Handle with TL has failed bailing out...\n"));
1491
1492}
1493#endif
1494
1495
1496/**
Jeff Johnson295189b2012-06-20 16:38:30 -07001497 * limIsSystemInScanState()
1498 *
1499 *FUNCTION:
1500 * This function is called by various MAC software modules to
1501 * determine if System is in Scan/Learn state
1502 *
1503 *LOGIC:
1504 * NA
1505 *
1506 *ASSUMPTIONS:
1507 * NA
1508 *
1509 *NOTE:
1510 *
1511 * @param pMac - Pointer to Global MAC structure
1512 * @return true - System is in Scan/Learn state
1513 * false - System is NOT in Scan/Learn state
1514 */
1515
1516tANI_U8
1517limIsSystemInScanState(tpAniSirGlobal pMac)
1518{
1519 switch (pMac->lim.gLimSmeState)
1520 {
1521 case eLIM_SME_CHANNEL_SCAN_STATE:
1522 case eLIM_SME_NORMAL_CHANNEL_SCAN_STATE:
1523 case eLIM_SME_LINK_EST_WT_SCAN_STATE:
1524 case eLIM_SME_WT_SCAN_STATE:
1525 // System is in Learn mode
1526 return true;
1527
1528 default:
1529 // System is NOT in Learn mode
1530 return false;
1531 }
1532} /*** end limIsSystemInScanState() ***/
1533
1534
1535
1536/**
1537 * limIsSystemInActiveState()
1538 *
1539 *FUNCTION:
1540 * This function is called by various MAC software modules to
1541 * determine if System is in Active/Wakeup state
1542 *
1543 *LOGIC:
1544 * NA
1545 *
1546 *ASSUMPTIONS:
1547 * NA
1548 *
1549 *NOTE:
1550 *
1551 * @param pMac - Pointer to Global MAC structure
1552 * @return true - System is in Active state
1553 * false - System is not in Active state
1554 */
1555
1556tANI_U8 limIsSystemInActiveState(tpAniSirGlobal pMac)
1557{
1558 switch (pMac->pmm.gPmmState)
1559 {
1560 case ePMM_STATE_BMPS_WAKEUP:
1561 case ePMM_STATE_IMPS_WAKEUP:
1562 case ePMM_STATE_READY:
1563 // System is in Active mode
1564 return true;
1565 default:
1566 return false;
1567 // System is NOT in Active mode
1568 }
1569}
1570
1571
1572#if defined(ANI_PRODUCT_TYPE_AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
1573/**
1574 * limCheckAndQuietBSS()
1575 *
1576 *FUNCTION:
1577 * This function is called by limSetLearnMode() to check
1578 * if BSS needs to be quieted and call limQuietBSS() to
1579 * send data frame to self for that purpose.
1580 *
1581 *LOGIC:
1582 * NA
1583 *
1584 *ASSUMPTIONS:
1585 * NA
1586 *
1587 *NOTE:
1588 *
1589 * @param pMac - Pointer to Global MAC structure
1590 * @return None
1591 */
1592
1593void
1594limCheckAndQuietBSS(tpAniSirGlobal pMac)
1595{
1596 tANI_U32 dur;
1597
1598 if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE)
1599 {
1600 // LIM is in AP role. Quiet the BSS before
1601 // switching to channel to be learned
1602 if (pMac->lim.gpLimMeasReq->measDuration.shortChannelScanDuration >
1603 LIM_MAX_QUIET_DURATION)
1604 {
1605 // May need to quiet BSS multiple times.
1606 // Quiet for a limit of 32 msecs on Learn
1607 // duration for now.
1608 dur = LIM_MAX_QUIET_DURATION;
1609 }
1610 else
1611 {
1612 dur =
1613 pMac->lim.gpLimMeasReq->measDuration.shortChannelScanDuration;
1614 }
1615 PELOG3(limLog(pMac, LOG3,
1616 FL("*** Going to quiet BSS for duration=%d msec\n"),
1617 dur);)
1618
1619 limQuietBss(pMac, dur);
1620 }
1621} /*** end limCheckAndQuietBSS() ***/
1622#endif
1623
1624#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
1625/**
1626 * limSetLearnMode()
1627 *
1628 *FUNCTION:
1629 * This function is called to setup system into Learn mode
1630 * to collect DFS measurements.
1631 *
1632 *LOGIC:
1633 * NA
1634 *
1635 *ASSUMPTIONS:
1636 * NA
1637 *
1638 *NOTE:
1639 *
1640 * @param pMac - Pointer to Global MAC structure
1641 * @return None
1642 */
1643
1644void
1645limSetLearnMode(tpAniSirGlobal pMac)
1646{
1647 limSendHalInitScanReq(pMac, eLIM_HAL_INIT_LEARN_WAIT_STATE, eSIR_DONT_CHECK_LINK_TRAFFIC_BEFORE_SCAN);
1648 return;
1649} /*** end limSetLearnMode() ***/
1650
1651/**
1652 * limContinueChannelLearn()
1653 *
1654 *FUNCTION:
1655 * This function is called to do measurement (learn) on current channel.
1656 *
1657 *LOGIC:
1658 *
1659 *ASSUMPTIONS:
1660 * NA
1661 *
1662 *NOTE:
1663 * NA
1664 *
1665 * @param pMac - Pointer to Global MAC structure
1666 *
1667 * @return None
1668 */
1669
1670void
1671limContinueChannelLearn(tpAniSirGlobal pMac)
1672{
1673 tANI_U8 chanNum;
1674 tSirMacSSid ssId;
1675 tSirMacAddr bssId = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
1676
1677 // Time to collect measurements
1678 chanNum = limGetCurrentLearnChannel(pMac);
1679
1680 // Switch channel
1681 pMac->lim.gLimSystemInScanLearnMode = 1;
1682
1683 if (pMac->lim.gpLimMeasReq->measControl.scanType == eSIR_ACTIVE_SCAN)
1684 {
1685 /// Prepare and send Probe Request frame
1686 ssId.length = 0;
1687 /* for learning channel, we don't include any additional IE */
1688 limSendProbeReqMgmtFrame(pMac, &ssId, bssId, chanNum,pMac->lim.gSelfMacAddr, 0 , NULL);
1689 }
1690
1691 // Activate Learn duration timer during which
1692 // DFS measurements are made.
1693 pMac->lim.gLimMeasParams.shortDurationCount++;
1694 limDeactivateAndChangeTimer(pMac, eLIM_LEARN_DURATION_TIMER);
1695
Jeff Johnsone7245742012-09-05 17:12:55 -07001696 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_LEARN_DURATION_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07001697 if (tx_timer_activate(&pMac->lim.gLimMeasParams.learnDurationTimer)
1698 != TX_SUCCESS)
1699 {
1700 /// Could not activate learn duration timer.
1701 // Log error
1702 limLog(pMac, LOGP, FL("could not activate learn duration timer\n"));
1703
1704 return;
1705 }
1706} /*** end limContinueChannelLearn() ***/
1707
1708
1709/**
1710 * limReEnableLearnMode()
1711 *
1712 *FUNCTION:
1713 * This function is called by various MAC software modules to
1714 * re-enable Learn mode measurements.
1715 *
1716 *LOGIC:
1717 * NA
1718 *
1719 *ASSUMPTIONS:
1720 * NA
1721 *
1722 *NOTE:
1723 *
1724 * @param pMac - Pointer to Global MAC structure
1725 * @return None
1726 */
1727
1728void
1729limReEnableLearnMode(tpAniSirGlobal pMac)
1730{
1731 PELOG4(limLog(pMac, LOG4, FL("quietEnabled = %d\n"),
1732 pMac->lim.gLimSpecMgmt.fQuietEnabled);)
1733
1734 /** Stop measurement temperorily when radar is detected or channel
1735 * switch is running as part of periodic DFS */
1736 if (!pMac->lim.gpLimMeasReq || LIM_IS_RADAR_DETECTED(pMac) ||
1737 (pMac->lim.gLimSpecMgmt.dot11hChanSwState == eLIM_11H_CHANSW_RUNNING))
1738 {
1739 return;
1740 }
1741
1742 if (pMac->lim.gLimSpecMgmt.fQuietEnabled)
1743 {
Jeff Johnsone7245742012-09-05 17:12:55 -07001744 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_QUIET_BSS_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07001745#ifdef GEN6_TODO
1746 /* revisit this piece of code to assign the appropriate sessionId below
1747 * priority - HIGH
1748 */
1749 pMac->lim.limTimers.gLimQuietBssTimer.sessionId = sessionId;
1750#endif
1751 if (tx_timer_activate(
1752 &pMac->lim.limTimers.gLimQuietBssTimer)
1753 != TX_SUCCESS)
1754 {
1755 limLog(pMac, LOGP, FL("could not start Quiet Bss timer\n"));
1756 return;
1757 }
1758 pMac->lim.gLimSpecMgmt.quietState = eLIM_QUIET_INIT;
1759 }
1760 else
1761 {
1762 limDeactivateAndChangeTimer(pMac, eLIM_LEARN_INTERVAL_TIMER);
Jeff Johnsone7245742012-09-05 17:12:55 -07001763 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_LEARN_INTERVAL_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -07001764#ifdef GEN6_TODO
1765 /* revisit this piece of code to assign the appropriate sessionId below
1766 */
1767 pMac->lim.gLimMeasParams.learnIntervalTimer.sessionId = sessionId;
1768#endif
1769 if (tx_timer_activate(
1770 &pMac->lim.gLimMeasParams.learnIntervalTimer)
1771 != TX_SUCCESS)
1772 {
1773 /// Could not activate Learn Interval timer.
1774 // Log error
1775 limLog(pMac, LOGP, FL("could not start Learn Interval timer\n"));
1776 return;
1777 }
1778 }
1779
1780 PELOG3(limLog(pMac, LOG3, FL("Re-enabled Learn mode Measurements\n"));)
1781 pMac->lim.gLimMeasParams.disableMeasurements = 0;
1782
1783 return;
1784} /*** end limReEnableLearnMode() ***/
1785
1786#endif //#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
1787
1788
1789/**
1790*\brief limReceivedHBHandler()
1791*
1792* This function is called by schBeaconProcess() upon
1793* receiving a Beacon on STA. This also gets called upon
1794* receiving Probe Response after heat beat failure is
1795* detected.
1796*
1797* param pMac - global mac structure
1798* param channel - channel number indicated in Beacon, Probe Response
1799* return - none
1800*/
1801
1802
1803void
1804limReceivedHBHandler(tpAniSirGlobal pMac, tANI_U8 channelId, tpPESession psessionEntry)
1805{
1806 if((channelId == 0 ) || (channelId == psessionEntry->currentOperChannel) )
1807 psessionEntry->LimRxedBeaconCntDuringHB++;
1808
1809 pMac->pmm.inMissedBeaconScenario = FALSE;
1810} /*** end limReceivedHBHandler() ***/
1811
1812
1813
1814#if 0
1815void limResetHBPktCount(tpPESession psessionEntry)
1816{
1817 psessionEntry->LimRxedBeaconCntDuringHB = 0;
1818}
1819#endif
1820
1821
1822/*
1823 * limProcessWdsInfo()
1824 *
1825 *FUNCTION:
1826 * This function is called from schBeaconProcess in BP
1827 *
1828 *PARAMS:
1829 * @param pMac - Pointer to Global MAC structure
1830 * @param propIEInfo - proprietary IE info
1831 *
1832 *LOGIC:
1833 *
1834 *ASSUMPTIONS:
1835 * NA
1836 *
1837 *NOTE:
1838 *
1839 *
1840 *RETURNS:
1841 *
1842 */
1843
1844void limProcessWdsInfo(tpAniSirGlobal pMac,
1845 tSirPropIEStruct propIEInfo)
1846{
1847#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
1848 tpSirSmeWdsInfoInd pSirSmeWdsInfoInd;
1849 tANI_U8 *pTemp;
1850 tSirMsgQ mmhMsg;
1851
1852 if (propIEInfo.wdsLength &&
1853 propIEInfo.wdsLength <= ANI_WDS_INFO_MAX_LENGTH)
1854 {
1855 if (pMac->lim.gLimWdsInfo.wdsLength)
1856 {
1857 if ((propIEInfo.wdsLength ==
1858 pMac->lim.gLimWdsInfo.wdsLength) &&
1859 (palEqualMemory( pMac->hHdd,propIEInfo.wdsData,
1860 pMac->lim.gLimWdsInfo.wdsBytes,
1861 pMac->lim.gLimWdsInfo.wdsLength) ))
1862
1863 return; // no difference in WDS info
1864 else
1865 {
1866 PELOG2(limLog(pMac, LOG2,
1867 FL("Cached WDS Info: length %d bytes is: "),
1868 pMac->lim.gLimWdsInfo.wdsLength);
1869 sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG2,
1870 pMac->lim.gLimWdsInfo.wdsBytes,
1871 pMac->lim.gLimWdsInfo.wdsLength);)
1872
1873 PELOG2(limLog(pMac, LOG2, FL("New WDS Info: length %d bytes is: "),
1874 propIEInfo.wdsLength);
1875 sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG2,
1876 propIEInfo.wdsData,
1877 propIEInfo.wdsLength);)
1878
1879 pMac->lim.gLimWdsInfo.wdsLength = propIEInfo.wdsLength;
1880 palCopyMemory( pMac->hHdd, pMac->lim.gLimWdsInfo.wdsBytes,
1881 propIEInfo.wdsData,
1882 propIEInfo.wdsLength);
1883
1884 // send IND to WSM
1885 if (eHAL_STATUS_SUCCESS !=
1886 palAllocateMemory(pMac->hHdd,
1887 (void **) &pSirSmeWdsInfoInd,
1888 sizeof(tSirSmeWdsInfoInd)))
1889 {
1890 // Log error
1891 limLog(pMac, LOGP,
1892 FL("memory allocate failed for WDS_INFO_IND\n"));
1893
1894 return;
1895 }
1896
1897 pSirSmeWdsInfoInd->messageType = eWNI_SME_WDS_INFO_IND;
1898 pSirSmeWdsInfoInd->length = sizeof(tSirSmeWdsInfoInd);
1899
1900 pSirSmeWdsInfoInd->wdsInfo.wdsLength =
1901 pMac->lim.gLimWdsInfo.wdsLength;
1902
1903 palCopyMemory( pMac->hHdd, pSirSmeWdsInfoInd->wdsInfo.wdsBytes,
1904 pMac->lim.gLimWdsInfo.wdsBytes,
1905 pMac->lim.gLimWdsInfo.wdsLength);
1906
1907 pTemp = (tANI_U8 *) pSirSmeWdsInfoInd;
1908
1909 PELOG2(limLog(pMac, LOG2,
1910 FL("eWNI_SME_WDS_INFO_IND length %d bytes is: "),
1911 pSirSmeWdsInfoInd->length);
1912 sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG2, pTemp,
1913 pSirSmeWdsInfoInd->length);)
1914
1915 mmhMsg.type = eWNI_SME_WDS_INFO_IND;
1916 mmhMsg.bodyptr = pSirSmeWdsInfoInd;
1917 mmhMsg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07001918 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07001919 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
1920 pMac->lim.gLimNumWdsInfoInd++;
1921 }
1922 }
1923 else
1924 {
1925 // first WDS info
1926 pMac->lim.gLimWdsInfo.wdsLength = propIEInfo.wdsLength;
1927 palCopyMemory( pMac->hHdd, pMac->lim.gLimWdsInfo.wdsBytes,
1928 propIEInfo.wdsData,
1929 propIEInfo.wdsLength);
1930
1931 PELOG1(limLog(pMac, LOG1, FL("First WDS Info: length %d bytes is:\n"),
1932 pMac->lim.gLimWdsInfo.wdsLength);
1933 sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG1,
1934 pMac->lim.gLimWdsInfo.wdsBytes,
1935 pMac->lim.gLimWdsInfo.wdsLength);)
1936
1937 }
1938 }
1939 else
1940 {
1941 PELOG2(limLog(pMac, LOG2,
1942 FL("Illegal WDS length = %d\n"),
1943 propIEInfo.wdsLength);)
1944 }
1945#endif
1946}
1947
1948
1949
1950/**
1951 * limInitWdsInfoParams()
1952 *
1953 *FUNCTION:
1954 * This function is called while processing
1955 * START_BSS/JOIN/REASSOC_REQ to initialize WDS info
1956 * ind/set related parameters.
1957 *
1958 *LOGIC:
1959 *
1960 *ASSUMPTIONS:
1961 *
1962 *NOTE:
1963 *
1964 * @param pMac Pointer to Global MAC structure
1965 * @return None
1966 */
1967
1968void
1969limInitWdsInfoParams(tpAniSirGlobal pMac)
1970{
1971 pMac->lim.gLimWdsInfo.wdsLength = 0;
1972 pMac->lim.gLimNumWdsInfoInd = 0;
1973 pMac->lim.gLimNumWdsInfoSet = 0;
1974} /*** limInitWdsInfoParams() ***/
1975
1976
1977/** -------------------------------------------------------------
1978\fn limUpdateOverlapStaParam
1979\brief Updates overlap cache and param data structure
1980\param tpAniSirGlobal pMac
1981\param tSirMacAddr bssId
1982\param tpLimProtStaParams pStaParams
1983\return None
1984 -------------------------------------------------------------*/
1985void
1986limUpdateOverlapStaParam(tpAniSirGlobal pMac, tSirMacAddr bssId, tpLimProtStaParams pStaParams)
1987{
1988 int i;
1989 if (!pStaParams->numSta)
1990 {
1991 palCopyMemory( pMac->hHdd, pMac->lim.protStaOverlapCache[0].addr,
1992 bssId,
1993 sizeof(tSirMacAddr));
1994 pMac->lim.protStaOverlapCache[0].active = true;
1995
1996 pStaParams->numSta = 1;
1997
1998 return;
1999 }
2000
2001 for (i=0; i<LIM_PROT_STA_OVERLAP_CACHE_SIZE; i++)
2002 {
2003 if (pMac->lim.protStaOverlapCache[i].active)
2004 {
2005 if (palEqualMemory( pMac->hHdd,pMac->lim.protStaOverlapCache[i].addr,
2006 bssId,
2007 sizeof(tSirMacAddr))) {
2008 return; }
2009 }
2010 else
2011 break;
2012 }
2013
2014 if (i == LIM_PROT_STA_OVERLAP_CACHE_SIZE)
2015 {
2016 PELOG1(limLog(pMac, LOG1, FL("Overlap cache is full\n"));)
2017 }
2018 else
2019 {
2020 palCopyMemory( pMac->hHdd, pMac->lim.protStaOverlapCache[i].addr,
2021 bssId,
2022 sizeof(tSirMacAddr));
2023 pMac->lim.protStaOverlapCache[i].active = true;
2024
2025 pStaParams->numSta++;
2026 }
2027}
2028
2029
2030/**
2031 * limHandleIBSScoalescing()
2032 *
2033 *FUNCTION:
2034 * This function is called upon receiving Beacon/Probe Response
2035 * while operating in IBSS mode.
2036 *
2037 *LOGIC:
2038 *
2039 *ASSUMPTIONS:
2040 *
2041 *NOTE:
2042 *
2043 * @param pMac - Pointer to Global MAC structure
2044 * @param pBeacon - Parsed Beacon Frame structure
2045 * @param pRxPacketInfo - Pointer to RX packet info structure
2046 *
2047 * @return Status whether to process or ignore received Beacon Frame
2048 */
2049
2050tSirRetStatus
2051limHandleIBSScoalescing(
2052 tpAniSirGlobal pMac,
2053 tpSchBeaconStruct pBeacon,
2054 tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
2055{
2056 tpSirMacMgmtHdr pHdr;
2057 tSirRetStatus retCode;
2058
2059 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
2060 if ( (!pBeacon->capabilityInfo.ibss) || (limCmpSSid(pMac, &pBeacon->ssId,psessionEntry) != true) )
2061 /* Received SSID does not match => Ignore received Beacon frame. */
2062 retCode = eSIR_LIM_IGNORE_BEACON;
2063 else
2064 {
2065 tANI_U32 ieLen;
2066 tANI_U16 tsfLater;
2067 tANI_U8 *pIEs;
2068 ieLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
2069 tsfLater = WDA_GET_RX_TSF_LATER(pRxPacketInfo);
2070 pIEs = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
2071 PELOG3(limLog(pMac, LOG3, FL("BEFORE Coalescing tsfLater val :%d"), tsfLater);)
2072 retCode = limIbssCoalesce(pMac, pHdr, pBeacon, pIEs, ieLen, tsfLater,psessionEntry);
2073 }
2074 return retCode;
2075} /*** end limHandleIBSScoalescing() ***/
2076
2077
2078
2079/**
2080 * limDetectChangeInApCapabilities()
2081 *
2082 *FUNCTION:
2083 * This function is called while SCH is processing
2084 * received Beacon from AP on STA to detect any
2085 * change in AP's capabilities. If there any change
2086 * is detected, Roaming is informed of such change
2087 * so that it can trigger reassociation.
2088 *
2089 *LOGIC:
2090 *
2091 *ASSUMPTIONS:
2092 *
2093 *NOTE:
2094 * Notification is enabled for STA product only since
2095 * it is not a requirement on BP side.
2096 *
2097 * @param pMac Pointer to Global MAC structure
2098 * @param pBeacon Pointer to parsed Beacon structure
2099 * @return None
2100 */
2101
2102void
2103limDetectChangeInApCapabilities(tpAniSirGlobal pMac,
2104 tpSirProbeRespBeacon pBeacon,
2105 tpPESession psessionEntry)
2106{
2107#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
2108 tANI_U8 len;
2109 tSirSmeApNewCaps apNewCaps;
2110 tANI_U8 newChannel;
2111 apNewCaps.capabilityInfo = limGetU16((tANI_U8 *) &pBeacon->capabilityInfo);
2112 newChannel = (tANI_U8) pBeacon->channelNumber;
2113
2114 if ((psessionEntry->limSentCapsChangeNtf == false) &&
2115 (((!limIsNullSsid(&pBeacon->ssId)) && (limCmpSSid(pMac, &pBeacon->ssId, psessionEntry) == false)) ||
2116 ((SIR_MAC_GET_ESS(apNewCaps.capabilityInfo) != SIR_MAC_GET_ESS(psessionEntry->limCurrentBssCaps)) ||
2117 (SIR_MAC_GET_PRIVACY(apNewCaps.capabilityInfo) != SIR_MAC_GET_PRIVACY(psessionEntry->limCurrentBssCaps)) ||
2118 (SIR_MAC_GET_SHORT_PREAMBLE(apNewCaps.capabilityInfo) != SIR_MAC_GET_SHORT_PREAMBLE(psessionEntry->limCurrentBssCaps)) ||
2119 (SIR_MAC_GET_QOS(apNewCaps.capabilityInfo) != SIR_MAC_GET_QOS(psessionEntry->limCurrentBssCaps)) ||
2120 (newChannel != psessionEntry->currentOperChannel)
2121#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
2122 || (LIM_BSS_CAPS_GET(HCF, psessionEntry->limCurrentBssQosCaps) !=
2123 pBeacon->propIEinfo.hcfEnabled)
2124#endif
2125 )))
2126 {
2127
2128 /**
2129 * BSS capabilities have changed.
2130 * Inform Roaming.
2131 */
2132 len = sizeof(tSirMacCapabilityInfo) +
2133 sizeof(tSirMacAddr) + sizeof(tANI_U8) +
2134 3 * sizeof(tANI_U8) + // reserved fields
2135 pBeacon->ssId.length + 1;
2136
2137 palCopyMemory( pMac->hHdd, apNewCaps.bssId,
2138 psessionEntry->bssId,
2139 sizeof(tSirMacAddr));
2140 if (newChannel != psessionEntry->currentOperChannel)
2141 {
2142 PELOGE(limLog(pMac, LOGE, FL("Channel Change from %d --> %d - "
2143 "Ignoring beacon!\n"),
2144 psessionEntry->currentOperChannel, newChannel);)
2145 return;
2146 }
2147 else
2148 apNewCaps.channelId = psessionEntry->currentOperChannel;
2149 palCopyMemory( pMac->hHdd, (tANI_U8 *) &apNewCaps.ssId,
2150 (tANI_U8 *) &pBeacon->ssId,
2151 pBeacon->ssId.length + 1);
2152
2153 psessionEntry->limSentCapsChangeNtf = true;
2154 limSendSmeWmStatusChangeNtf(pMac, eSIR_SME_AP_CAPS_CHANGED,
2155 (tANI_U32 *) &apNewCaps,
2156 len, psessionEntry->smeSessionId);
2157 }
2158#endif
2159} /*** limDetectChangeInApCapabilities() ***/
2160
2161
2162
2163
2164// ---------------------------------------------------------------------
2165/**
2166 * limUpdateShortSlot
2167 *
2168 * FUNCTION:
2169 * Enable/Disable short slot
2170 *
2171 * LOGIC:
2172 *
2173 * ASSUMPTIONS:
2174 *
2175 * NOTE:
2176 *
2177 * @param enable Flag to enable/disable short slot
2178 * @return None
2179 */
2180
2181tSirRetStatus limUpdateShortSlot(tpAniSirGlobal pMac, tpSirProbeRespBeacon pBeacon, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry)
2182{
2183
2184 tSirSmeApNewCaps apNewCaps;
Jeff Johnsone7245742012-09-05 17:12:55 -07002185 tANI_U32 nShortSlot;
2186 tANI_U32 val = 0;
2187 tANI_U32 phyMode;
Jeff Johnson295189b2012-06-20 16:38:30 -07002188
Jeff Johnsone7245742012-09-05 17:12:55 -07002189 // Check Admin mode first. If it is disabled just return
2190 if (wlan_cfgGetInt(pMac, WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED, &val)
2191 != eSIR_SUCCESS)
2192 {
2193 limLog(pMac, LOGP,
2194 FL("cfg get WNI_CFG_11G_SHORT_SLOT_TIME failed\n"));
2195 return eSIR_FAILURE;
2196 }
2197 if (val == false)
2198 return eSIR_SUCCESS;
2199
2200 // Check for 11a mode or 11b mode. In both cases return since slot time is constant and cannot/should not change in beacon
2201 limGetPhyMode(pMac, &phyMode, psessionEntry);
2202 if ((phyMode == WNI_CFG_PHY_MODE_11A) || (phyMode == WNI_CFG_PHY_MODE_11B))
2203 return eSIR_SUCCESS;
2204
2205 apNewCaps.capabilityInfo = limGetU16((tANI_U8 *) &pBeacon->capabilityInfo);
Jeff Johnson295189b2012-06-20 16:38:30 -07002206
2207 // Earlier implementation: determine the appropriate short slot mode based on AP advertised modes
2208 // when erp is present, apply short slot always unless, prot=on && shortSlot=off
2209 // if no erp present, use short slot based on current ap caps
2210
2211 // Issue with earlier implementation : Cisco 1231 BG has shortSlot = 0, erpIEPresent and useProtection = 0 (Case4);
2212
2213 //Resolution : always use the shortSlot setting the capability info to decide slot time.
2214 // The difference between the earlier implementation and the new one is only Case4.
2215 /*
2216 ERP IE Present | useProtection | shortSlot = QC STA Short Slot
2217 Case1 1 1 1 1 //AP should not advertise this combination.
2218 Case2 1 1 0 0
2219 Case3 1 0 1 1
2220 Case4 1 0 0 0
2221 Case5 0 1 1 1
2222 Case6 0 1 0 0
2223 Case7 0 0 1 1
2224 Case8 0 0 0 0
2225 */
2226 nShortSlot = SIR_MAC_GET_SHORT_SLOT_TIME(apNewCaps.capabilityInfo);
2227
Jeff Johnsone7245742012-09-05 17:12:55 -07002228 if (nShortSlot != psessionEntry->shortSlotTimeSupported)
Jeff Johnson295189b2012-06-20 16:38:30 -07002229 {
2230 // Short slot time capability of AP has changed. Adopt to it.
2231 PELOG1(limLog(pMac, LOG1, FL("Shortslot capability of AP changed: %d\n"), nShortSlot);)
2232 ((tpSirMacCapabilityInfo)&psessionEntry->limCurrentBssCaps)->shortSlotTime = (tANI_U16)nShortSlot;
Jeff Johnsone7245742012-09-05 17:12:55 -07002233 psessionEntry->shortSlotTimeSupported = nShortSlot;
Jeff Johnson295189b2012-06-20 16:38:30 -07002234 pBeaconParams->fShortSlotTime = (tANI_U8) nShortSlot;
2235 pBeaconParams->paramChangeBitmap |= PARAM_SHORT_SLOT_TIME_CHANGED;
Jeff Johnson295189b2012-06-20 16:38:30 -07002236 }
2237 return eSIR_SUCCESS;
2238}
2239
2240
2241#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
2242
2243/**
2244 * limUpdateQuietIEInBeacons()
2245 *
2246 *FUNCTION:
2247 * This function is called by specialBeaconProcessing(),
2248 * when it is time to generate the next beacon.
2249 * If gLimQuietState is not in the INIT state, then it
2250 * means that the next beacon may need to include some
2251 * information about the Quiet BSS IE.
2252 * This function makes that decision based on the current
2253 * state of gLimQuietState
2254 *
2255 *LOGIC:
2256 * This routine invokes schSetFixedBeaconFields() only
2257 * if necessary, as it is expensive to update the fixed
2258 * beacon fields during each beacon interval.
2259 *
2260 *ASSUMPTIONS:
2261 * This Quiet BSS IE will be sent out as part of
2262 * Proprietary IE's. If 802.11H is enabled, this IE
2263 * will be sent out as defined in the 11H spec
2264 *
2265 *NOTE:
2266 *
2267 * @param pMac Pointer to Global MAC structure
2268 * @return true, if the beacon fields need updating
2269 * false, if not
2270 */
2271tANI_BOOLEAN limUpdateQuietIEInBeacons( tpAniSirGlobal pMac )
2272{
2273 tANI_BOOLEAN fUpdateBeaconFields = eANI_BOOLEAN_TRUE;
2274
2275 limLog( pMac, LOG2, FL("Quiet BSS State = %d\n"),
2276 pMac->lim.gLimSpecMgmt.quietState );
2277 switch( pMac->lim.gLimSpecMgmt.quietState )
2278 {
2279 case eLIM_QUIET_BEGIN:
2280 // We need to start broadcasting the Quiet BSS IE
2281 // Transition to eLIM_QUIET_RUNNING
2282 pMac->lim.gLimSpecMgmt.quietState = eLIM_QUIET_RUNNING;
2283 break;
2284
2285 case eLIM_QUIET_RUNNING:
2286 // Start down-counting...
2287 pMac->lim.gLimSpecMgmt.quietCount--;
2288 if( pMac->lim.gLimSpecMgmt.quietCount == 0 )
2289 {
2290 //
2291 // We no longer need to broadcast the Quiet BSS IE
2292 //
2293 // NOTE - We still need to call schSetFixedBeaconFields()
2294 // one last time, just to remove the Quiet BSS IE from
2295 // the list of fixed beacon fields
2296 //
2297 // Transition to eLIM_QUIET_END
2298 pMac->lim.gLimSpecMgmt.quietState = eLIM_QUIET_END;
2299 limProcessLearnIntervalTimeout(pMac);
2300 }
2301 break;
2302
2303 case eLIM_QUIET_CHANGED:
2304 //
2305 // State possibly changed via setupQuietBss().
2306 // This means, gLimQuietCount has been changed!!
2307 //
2308 // NOTE - We still need to call schSetFixedBeaconFields()
2309 // one last time, just to remove the Quiet BSS IE from
2310 // the list of fixed beacon fields
2311 //
2312
2313 // Transition to eLIM_QUIET_END
2314 pMac->lim.gLimSpecMgmt.quietState = eLIM_QUIET_END;
2315 break;
2316
2317 case eLIM_QUIET_INIT:
2318 case eLIM_QUIET_END:
2319 // Transition to eLIM_QUIET_INIT
2320 pMac->lim.gLimSpecMgmt.quietState = eLIM_QUIET_INIT;
2321 // Fall thru'...
2322 default:
2323 fUpdateBeaconFields = eANI_BOOLEAN_FALSE;
2324 break;
2325 }
2326
2327 return fUpdateBeaconFields;
2328}
2329
2330#endif
2331
2332#if ((defined ANI_PRODUCT_TYPE_AP) && (defined ANI_AP_SDK))
2333void limConvertScanDuration(tpAniSirGlobal pMac)
2334{
2335 tpSirSmeMeasurementReq pMeasReq = pMac->lim.gpLimMeasReq;
2336 tpLimScanDurationConvert scanDurConv = &pMac->lim.gLimScanDurationConvert;
2337
2338 /* This is not a good idea to convert {long}shortChannelScanDuration from mS to TICKS *
2339 * The reason is that {long}shortChannelScanDuration is used all over and a lot of code *
2340 * that assumes the old mS definition was never changed to accommodate this new change to TICKS. *
2341 * If optimization is needed, create another set of shadow variables to store the converted *
2342 * values in Ticks, and TU. */
2343 scanDurConv->shortChannelScanDuration_tick =
2344 SYS_MS_TO_TICKS(pMeasReq->measDuration.shortChannelScanDuration +SYS_TICK_DUR_MS-1);
2345
2346 /* convert shortChannelScanDuration to TU also for CB scan, used to set gLimQuietDuration */
2347 /* (shortChanneScanDuration * 1000) / 2^10 */
2348 scanDurConv->shortChannelScanDuration_TU = (pMeasReq->measDuration.shortChannelScanDuration * 1000) >> 10;
2349
2350 scanDurConv->longChannelScanDuration_tick =
2351 SYS_MS_TO_TICKS(pMeasReq->measDuration.longChannelScanDuration +SYS_TICK_DUR_MS-1);
2352
2353 /* convert shortChannelScanDuration to TU also for CB scan, used to set gLimQuietDuration */
2354 /* (longChanneScanDuration * 1000) / 2^10 */
2355 scanDurConv->longChannelScanDuration_TU = (pMeasReq->measDuration.longChannelScanDuration * 1000) >> 10;
2356}
2357#endif /* ((defined ANI_PRODUCT_TYPE_AP) && (defined ANI_AP_SDK)) */
2358
2359
2360#ifdef ANI_PRODUCT_TYPE_AP
2361/**-------------------------------------------------
2362\fn limIsRadarEnabled
2363
2364\brief Checks if radar is enabled
2365\param pMac
2366\return true - if Both 11h and radar enabled
2367 false - if either is not enabled.
2368 --------------------------------------------------*/
2369tANI_BOOLEAN limIsRadarEnabled(tpAniSirGlobal pMac)
2370{
2371 tANI_U32 fEnabled;
2372
2373 if(wlan_cfgGetInt(pMac, WNI_CFG_11H_ENABLED, &fEnabled) != eSIR_SUCCESS)
2374 {
2375 limLog(pMac, LOGP, FL("HAL: could not retrieve radar config from CFG"));
2376 return eANI_BOOLEAN_FALSE;
2377 }
2378
2379 if (!fEnabled)
2380 return eANI_BOOLEAN_FALSE;
2381
2382 if(wlan_cfgGetInt(pMac, WNI_CFG_RDET_FLAG, &fEnabled) != eSIR_SUCCESS)
2383 {
2384 limLog(pMac, LOGP, FL("HAL: could not retrieve radar config from CFG"));
2385 return eANI_BOOLEAN_FALSE;
2386 }
2387
2388 if (fEnabled)
2389 return eANI_BOOLEAN_TRUE;
2390
2391 return eANI_BOOLEAN_FALSE;
2392}
2393
2394/**---------------------------------------
2395\fn limRadarInit
2396\brief Initialize Radar Interrupt.
2397
2398\param pMac
2399\return None
2400 ----------------------------------------*/
2401void limRadarInit(tpAniSirGlobal pMac)
2402{
2403 tANI_U32 status;
2404 tSirMsgQ msg;
2405
2406 PELOG3(limLog(pMac, LOG3, FL("Radar Interrupt Already configured? %s\n"),
2407 pMac->lim.gLimSpecMgmt.fRadarIntrConfigured?"Yes":"No");)
2408 /** To avoid configuring the radar multiple times */
2409 if (pMac->lim.gLimSpecMgmt.fRadarIntrConfigured)
2410 return;
2411
2412 if (!limIsRadarEnabled(pMac))
2413 return;
2414 // Prepare and post message to HAL Message Queue
2415 msg.type = WDA_INIT_RADAR_IND;
2416 msg.bodyptr = NULL;
2417 msg.bodyval = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -07002418 MTRACE(macTraceMsgTx(pMac, NO_SESSION, msg.type));
Jeff Johnson295189b2012-06-20 16:38:30 -07002419 status = wdaPostCtrlMsg(pMac, &msg);
2420 if (status != eHAL_STATUS_SUCCESS)
2421 {
2422 limLog(pMac, LOGP,
2423 FL("posting to HAL failed, reason=%d\n"), status);
2424 return;
2425 }
2426 pMac->lim.gLimSpecMgmt.fRadarIntrConfigured = eANI_BOOLEAN_TRUE;
2427} /****** end limRadarInit() ******/
2428
2429#endif
2430
2431
2432/** -----------------------------------------------------------------
2433 \brief limHandleLowRssiInd() - handles low rssi indication
2434
2435 This function process the SIR_HAL_LOW_RSSI_IND message from
2436 HAL, and sends a eWNI_SME_LOW_RSSI_IND to CSR.
2437
2438 \param pMac - global mac structure
2439
2440 \return
2441
2442 \sa
2443 ----------------------------------------------------------------- */
2444void limHandleLowRssiInd(tpAniSirGlobal pMac)
2445{
2446#if 0 //RSSI related indications will now go to TL and not PE
2447 if ( (pMac->pmm.gPmmState == ePMM_STATE_BMPS_SLEEP) ||
2448 (pMac->pmm.gPmmState == ePMM_STATE_UAPSD_SLEEP)||
2449 (pMac->pmm.gPmmState == ePMM_STATE_WOWLAN) )
2450 {
2451 PELOG1(limLog(pMac, LOG1, FL("Sending LOW_RSSI_IND to SME \n"));)
2452 limSendSmeRsp(pMac, eWNI_SME_LOW_RSSI_IND, eSIR_SME_SUCCESS, 0, 0);
2453 }
2454 else
2455 {
2456 limLog(pMac, LOGE,
2457 FL("Received SIR_HAL_LOW_RSSI_IND while in incorrect state: %d\n"),
2458 pMac->pmm.gPmmState);
2459 }
2460 return;
2461#endif
2462}
2463
2464
2465/** -----------------------------------------------------------------
2466 \brief limHandleBmpsStatusInd() - handles BMPS status indication
2467
2468 This function process the SIR_HAL_BMPS_STATUS_IND message from HAL,
2469 and invokes limSendExitBmpsInd( ) to send an eWNI_PMC_EXIT_BMPS_IND
2470 to SME with reason code 'eSME_EXIT_BMPS_IND_RCVD'.
2471
2472 HAL sends this message when Firmware fails to enter BMPS mode 'AFTER'
2473 HAL had already send PE a SIR_HAL_ENTER_BMPS_RSP with status
2474 code "success". Hence, HAL needs to notify PE to get out of BMPS mode.
2475 This message can also come from FW anytime after we have entered BMPS.
2476 This means we should handle it in WoWL and UAPSD states as well
2477
2478 \param pMac - global mac structure
2479 \return - none
2480 \sa
2481 ----------------------------------------------------------------- */
2482void limHandleBmpsStatusInd(tpAniSirGlobal pMac)
2483{
2484 switch(pMac->pmm.gPmmState)
2485 {
2486 case ePMM_STATE_BMPS_SLEEP:
2487 case ePMM_STATE_UAPSD_WT_SLEEP_RSP:
2488 case ePMM_STATE_UAPSD_SLEEP:
2489 case ePMM_STATE_UAPSD_WT_WAKEUP_RSP:
2490 case ePMM_STATE_WOWLAN:
2491 PELOG1(limLog(pMac, LOG1, FL("Sending EXIT_BMPS_IND to SME \n"));)
2492 limSendExitBmpsInd(pMac, eSME_BMPS_STATUS_IND_RCVD);
2493 break;
2494
2495 default:
2496 limLog(pMac, LOGE,
2497 FL("Received SIR_HAL_BMPS_STATUS_IND while in incorrect state: %d\n"),
2498 pMac->pmm.gPmmState);
2499 break;
2500 }
2501 return;
2502}
2503
2504
2505/** -----------------------------------------------------------------
2506 \brief limHandleMissedBeaconInd() - handles missed beacon indication
2507
2508 This function process the SIR_HAL_MISSED_BEACON_IND message from HAL,
2509 and invokes limSendExitBmpsInd( ) to send an eWNI_PMC_EXIT_BMPS_IND
2510 to SME with reason code 'eSME_MISSED_BEACON_IND_RCVD'.
2511
2512 \param pMac - global mac structure
2513 \return - none
2514 \sa
2515 ----------------------------------------------------------------- */
2516void limHandleMissedBeaconInd(tpAniSirGlobal pMac)
2517{
2518 if ( (pMac->pmm.gPmmState == ePMM_STATE_BMPS_SLEEP) ||
2519 (pMac->pmm.gPmmState == ePMM_STATE_UAPSD_SLEEP)||
2520 (pMac->pmm.gPmmState == ePMM_STATE_WOWLAN) )
2521 {
2522 pMac->pmm.inMissedBeaconScenario = TRUE;
2523 PELOG1(limLog(pMac, LOG1, FL("Sending EXIT_BMPS_IND to SME \n"));)
2524 limSendExitBmpsInd(pMac, eSME_MISSED_BEACON_IND_RCVD);
2525 }
Yathish9f22e662012-12-10 14:21:35 -08002526/* ACTIVE_MODE_HB_OFFLOAD */
2527#ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE
2528 else if(((pMac->pmm.gPmmState == ePMM_STATE_READY) ||
2529 (pMac->pmm.gPmmState == ePMM_STATE_BMPS_WAKEUP)) &&
2530 (IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE))
2531 {
2532 pMac->pmm.inMissedBeaconScenario = TRUE;
2533 PELOGE(limLog(pMac, LOGE, FL("Received Heart Beat Failure\n"));)
2534 limMissedBeaconInActiveMode(pMac);
2535 }
2536#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002537 else
2538 {
2539 limLog(pMac, LOGE,
2540 FL("Received SIR_HAL_MISSED_BEACON_IND while in incorrect state: %d\n"),
2541 pMac->pmm.gPmmState);
2542 }
2543 return;
2544}
2545
2546/** -----------------------------------------------------------------
2547 \brief limMicFailureInd() - handles mic failure indication
2548
2549 This function process the SIR_HAL_MIC_FAILURE_IND message from HAL,
2550
2551 \param pMac - global mac structure
2552 \return - none
2553 \sa
2554 ----------------------------------------------------------------- */
2555void limMicFailureInd(tpAniSirGlobal pMac, tpSirMsgQ pMsg)
2556{
2557 tpSirSmeMicFailureInd pSirSmeMicFailureInd;
2558 tpSirSmeMicFailureInd pSirMicFailureInd = (tpSirSmeMicFailureInd)pMsg->bodyptr;
2559 tSirMsgQ mmhMsg;
2560 tpPESession psessionEntry ;
2561 tANI_U8 sessionId;
2562
2563 if((psessionEntry = peFindSessionByBssid(pMac,pSirMicFailureInd->bssId,&sessionId))== NULL)
2564 {
2565 limLog(pMac, LOGE,
2566 FL("session does not exist for given BSSId\n"));
2567 return;
2568 }
2569
2570 if (eHAL_STATUS_SUCCESS !=
2571 palAllocateMemory(pMac->hHdd,
2572 (void **) &pSirSmeMicFailureInd,
2573 sizeof(tSirSmeMicFailureInd)))
2574 {
2575 // Log error
2576 limLog(pMac, LOGP,
2577 FL("memory allocate failed for eWNI_SME_MIC_FAILURE_IND\n"));
2578 return;
2579 }
2580
2581 pSirSmeMicFailureInd->messageType = eWNI_SME_MIC_FAILURE_IND;
2582 pSirSmeMicFailureInd->length = sizeof(pSirSmeMicFailureInd);
2583 pSirSmeMicFailureInd->sessionId = psessionEntry->smeSessionId;
2584
2585 vos_mem_copy(pSirSmeMicFailureInd->bssId,
2586 pSirMicFailureInd->bssId,
2587 sizeof(tSirMacAddr));
2588
2589 vos_mem_copy(pSirSmeMicFailureInd->info.srcMacAddr,
2590 pSirMicFailureInd->info.srcMacAddr,
2591 sizeof(tSirMacAddr));
2592
2593 vos_mem_copy(pSirSmeMicFailureInd->info.taMacAddr,
2594 pSirMicFailureInd->info.taMacAddr,
2595 sizeof(tSirMacAddr));
2596
2597 vos_mem_copy(pSirSmeMicFailureInd->info.dstMacAddr,
2598 pSirMicFailureInd->info.dstMacAddr,
2599 sizeof(tSirMacAddr));
2600
2601 vos_mem_copy(pSirSmeMicFailureInd->info.rxMacAddr,
2602 pSirMicFailureInd->info.rxMacAddr,
2603 sizeof(tSirMacAddr));
2604
2605 pSirSmeMicFailureInd->info.multicast =
2606 pSirMicFailureInd->info.multicast;
2607
2608 pSirSmeMicFailureInd->info.keyId=
2609 pSirMicFailureInd->info.keyId;
2610
2611 pSirSmeMicFailureInd->info.IV1=
2612 pSirMicFailureInd->info.IV1;
2613
2614 vos_mem_copy(pSirSmeMicFailureInd->info.TSC,
2615 pSirMicFailureInd->info.TSC,SIR_CIPHER_SEQ_CTR_SIZE);
2616
2617 mmhMsg.type = eWNI_SME_MIC_FAILURE_IND;
2618 mmhMsg.bodyptr = pSirSmeMicFailureInd;
2619 mmhMsg.bodyval = 0;
2620 MTRACE(macTraceMsgTx(pMac, 0, mmhMsg.type));
2621 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2622 return;
2623}
2624
2625
2626/** -----------------------------------------------------------------
2627 \brief limIsPktCandidateForDrop() - decides whether to drop the frame or not
2628
2629 This function is called before enqueuing the frame to PE queue for further processing.
2630 This prevents unnecessary frames getting into PE Queue and drops them right away.
2631 Frames will be droped in the following scenarios:
2632
2633 - In Scan State, drop the frames which are not marked as scan frames
2634 - In non-Scan state, drop the frames which are marked as scan frames.
2635 - Drop INFRA Beacons and Probe Responses in IBSS Mode
2636 - Drop the Probe Request in IBSS mode, if STA did not send out the last beacon
2637
2638 \param pMac - global mac structure
2639 \return - none
2640 \sa
2641 ----------------------------------------------------------------- */
2642
2643tMgmtFrmDropReason limIsPktCandidateForDrop(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tANI_U32 subType)
2644{
2645 tANI_U32 framelen;
2646 tANI_U8 *pBody;
2647 tSirMacCapabilityInfo capabilityInfo;
2648
2649 /*
2650 *
2651 * In scan mode, drop only Beacon/Probe Response which are NOT marked as scan-frames.
2652 * In non-scan mode, drop only Beacon/Probe Response which are marked as scan frames.
2653 * Allow other mgmt frames, they must be from our own AP, as we don't allow
2654 * other than beacons or probe responses in scan state.
2655 */
2656 if( (subType == SIR_MAC_MGMT_BEACON) ||
2657 (subType == SIR_MAC_MGMT_PROBE_RSP))
2658 {
2659 if(pMac->pmm.inMissedBeaconScenario)
2660 {
Jeff Johnsonab79c8d2012-12-10 14:30:13 -08002661 PELOGE(limLog(pMac, LOGE, FL("Do not drop beacon and probe response - Missed beacon scenario"));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002662 return eMGMT_DROP_NO_DROP;
2663 }
2664 if (limIsSystemInScanState(pMac))
2665 {
Jeff Johnson04dd8a82012-06-29 20:41:40 -07002666 return eMGMT_DROP_NO_DROP;
Jeff Johnson295189b2012-06-20 16:38:30 -07002667 }
2668 else if (WDA_IS_RX_IN_SCAN(pRxPacketInfo))
2669 {
2670 return eMGMT_DROP_SCAN_MODE_FRAME;
2671 }
2672 }
2673
2674 framelen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
2675 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
2676
2677 /* Note sure if this is sufficient, basically this condition allows all probe responses and
2678 * beacons from an infrastructure network
2679 */
2680 *((tANI_U16*) &capabilityInfo) = sirReadU16(pBody+ LIM_BCN_PR_CAPABILITY_OFFSET);
2681 if(!capabilityInfo.ibss)
2682 return eMGMT_DROP_NO_DROP;
2683#if 0
2684 //Allow the mgmt frames to be queued if STA not in IBSS mode.
2685 if (pMac->lim.gLimSystemRole != eLIM_STA_IN_IBSS_ROLE)
2686 return eMGMT_DROP_NO_DROP;
2687#endif
2688
2689 //Drop INFRA Beacons and Probe Responses in IBSS Mode
2690 if( (subType == SIR_MAC_MGMT_BEACON) ||
2691 (subType == SIR_MAC_MGMT_PROBE_RSP))
2692 {
2693 //drop the frame if length is less than 12
2694 if(framelen < LIM_MIN_BCN_PR_LENGTH)
2695 return eMGMT_DROP_INVALID_SIZE;
2696
2697 *((tANI_U16*) &capabilityInfo) = sirReadU16(pBody+ LIM_BCN_PR_CAPABILITY_OFFSET);
2698
2699 //This can be enhanced to even check the SSID before deciding to enque the frame.
2700 if(capabilityInfo.ess)
2701 return eMGMT_DROP_INFRA_BCN_IN_IBSS;
2702 }
2703 else if( (subType == SIR_MAC_MGMT_PROBE_REQ) &&
2704 (!WDA_GET_RX_BEACON_SENT(pRxPacketInfo)))
2705 {
2706 //Drop the Probe Request in IBSS mode, if STA did not send out the last beacon
2707 //In IBSS, the node which sends out the beacon, is supposed to respond to ProbeReq
2708 return eMGMT_DROP_NOT_LAST_IBSS_BCN;
2709 }
2710
2711 return eMGMT_DROP_NO_DROP;
2712}
2713
2714