blob: 9887ac4bc5cd535bf43c5414faf4300df18cf694 [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 */
Jeff Johnson295189b2012-06-20 16:38:30 -070041/*
42 * Airgo Networks, Inc proprietary. All rights reserved
43 * aniGlobal.h: MAC Modules Adapter Definitions.
44 * Author: V. K. Kandarpa
45 * Date: 10/25/2002
46 *
47 * History:-
48 * Date: 04/08/2008 Modified by: Santosh Mandiganal
49 * Modification Information: Added the logDump.h header file and defined the
50 * dumpTablecurrentId, dumpTableEntry.
51 * --------------------------------------------------------------------------
52 *
53 */
54
55#ifndef _ANIGLOBAL_H
56#define _ANIGLOBAL_H
57
58// Take care to avoid redefinition of this type, if it is
59// already defined in "halWmmApi.h"
60#if !defined(_HALMAC_WMM_API_H)
61typedef struct sAniSirGlobal *tpAniSirGlobal;
62#endif
63
64#include "halTypes.h"
65#include "sirCommon.h"
66#include "aniSystemDefs.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070067#include "sysDef.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070068#include "dphGlobal.h"
69#include "limGlobal.h"
70#include "pmmGlobal.h"
71#include "schGlobal.h"
72#include "sysGlobal.h"
73#include "cfgGlobal.h"
74#include "utilsGlobal.h"
75#include "sirApi.h"
76
Jeff Johnson295189b2012-06-20 16:38:30 -070077
Jeff Johnson295189b2012-06-20 16:38:30 -070078#include "wlan_qct_hal.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070079
Jeff Johnson295189b2012-06-20 16:38:30 -070080#include "pmc.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070081
82#include "csrApi.h"
83#ifdef WLAN_FEATURE_VOWIFI_11R
84#include "sme_FTApi.h"
85#endif
86#include "csrSupport.h"
87#include "smeInternal.h"
88#include "ccmApi.h"
89#include "btcApi.h"
90#include "csrInternal.h"
91
Jeff Johnsone7245742012-09-05 17:12:55 -070092#ifdef FEATURE_OEM_DATA_SUPPORT
93#include "oemDataInternal.h"
94#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070095
96#if defined WLAN_FEATURE_VOWIFI
97#include "smeRrmInternal.h"
98#include "rrmGlobal.h"
99#endif
100#if defined FEATURE_WLAN_CCX
101#include "ccxApi.h"
102#include "ccxGlobal.h"
103#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700104#include "p2p_Api.h"
Jeff Johnson295189b2012-06-20 16:38:30 -0700105
106#if defined WLAN_FEATURE_VOWIFI_11R
107#include <limFTDefs.h>
108#endif
109
110
111#ifdef ANI_DVT_DEBUG
112#include "dvtModule.h"
113#endif
114
115// New HAL API interface defs.
116#include "logDump.h"
117
Jeff Johnson295189b2012-06-20 16:38:30 -0700118//Check if this definition can actually move here from halInternal.h even for Volans. In that case
119//this featurization can be removed.
120#define PMAC_STRUCT( _hHal ) ( (tpAniSirGlobal)_hHal )
Jeff Johnson295189b2012-06-20 16:38:30 -0700121
122#define ANI_DRIVER_TYPE(pMac) (((tpAniSirGlobal)(pMac))->gDriverType)
123// -------------------------------------------------------------------
124// Bss Qos Caps bit map definition
125#define LIM_BSS_CAPS_OFFSET_HCF 0
126#define LIM_BSS_CAPS_OFFSET_WME 1
127#define LIM_BSS_CAPS_OFFSET_WSM 2
128
129#define LIM_BSS_CAPS_HCF (1 << LIM_BSS_CAPS_OFFSET_HCF)
130#define LIM_BSS_CAPS_WME (1 << LIM_BSS_CAPS_OFFSET_WME)
131#define LIM_BSS_CAPS_WSM (1 << LIM_BSS_CAPS_OFFSET_WSM)
132
133// cap should be one of HCF/WME/WSM
134#define LIM_BSS_CAPS_GET(cap, val) (((val) & (LIM_BSS_CAPS_ ## cap)) >> LIM_BSS_CAPS_OFFSET_ ## cap)
Madan Mohan Koyyalamudia53c4dc2012-11-13 10:35:42 -0800135#define LIM_BSS_CAPS_SET(cap, val) ((val) |= (LIM_BSS_CAPS_ ## cap ))
136#define LIM_BSS_CAPS_CLR(cap, val) ((val) &= (~ (LIM_BSS_CAPS_ ## cap)))
Jeff Johnson295189b2012-06-20 16:38:30 -0700137
138// 40 beacons per heart beat interval is the default + 1 to count the rest
139#define MAX_NO_BEACONS_PER_HEART_BEAT_INTERVAL 41
140
141/* max number of legacy bssid we can store during scan on one channel */
142#define MAX_NUM_LEGACY_BSSID_PER_CHANNEL 10
143
Jeff Johnson295189b2012-06-20 16:38:30 -0700144#define P2P_WILDCARD_SSID "DIRECT-" //TODO Put it in proper place;
145#define P2P_WILDCARD_SSID_LEN 7
146
147#ifdef WLAN_FEATURE_CONCURRENT_P2P
148#define MAX_NO_OF_P2P_SESSIONS 5
149#endif //WLAN_FEATURE_CONCURRENT_P2P
Jeff Johnson295189b2012-06-20 16:38:30 -0700150
Srinivas Girigowdade697412013-02-14 16:31:48 -0800151#define SPACE_ASCII_VALUE 32
152
Jeff Johnson295189b2012-06-20 16:38:30 -0700153// -------------------------------------------------------------------
154// Change channel generic scheme
155typedef void (*CHANGE_CHANNEL_CALLBACK)(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data,
156 tpPESession psessionEntry);
157
158/// LIM global definitions
159typedef struct sAniSirLimIbss
160{
161 void *pHdr;
162 void *pBeacon;
163} tAniSirLimIbss;
164
165typedef struct sDialogueToken
166{
167 //bytes 0-3
168 tANI_U16 assocId;
169 tANI_U8 token;
170 tANI_U8 rsvd1;
171 //Bytes 4-7
172 tANI_U16 tid;
173 tANI_U8 rsvd2[2];
174
175 struct sDialogueToken* next;
176}tDialogueToken, *tpDialogueToken;
177
178typedef struct sLimTimers
179{
180 //TIMERS IN LIM ARE NOT SUPPOSED TO BE ZEROED OUT DURING RESET.
181 //DURING limInitialize DONOT ZERO THEM OUT.
182
183//STA SPECIFIC TIMERS
Jeff Johnson295189b2012-06-20 16:38:30 -0700184 // Periodic background scan timer
185 TX_TIMER gLimBackgroundScanTimer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700186
187 TX_TIMER gLimPreAuthClnupTimer;
188 //TX_TIMER gLimAuthResponseTimer[HAL_NUM_STA];
189
190 // Association related timers
191 TX_TIMER gLimAssocFailureTimer;
192 TX_TIMER gLimReassocFailureTimer;
193
194
195 /// Heartbeat timer on STA
196 TX_TIMER gLimHeartBeatTimer;
197
198 /// Wait for Probe after Heartbeat failure timer on STA
199 TX_TIMER gLimProbeAfterHBTimer;
200
201
202 // Authentication related timers
203 TX_TIMER gLimAuthFailureTimer;
204
205 // Join Failure timeout on STA
206 TX_TIMER gLimJoinFailureTimer;
207
208 // Keepalive timer
209 TX_TIMER gLimKeepaliveTimer;
210
211 // Scan related timers
212 TX_TIMER gLimMinChannelTimer;
213 TX_TIMER gLimMaxChannelTimer;
214 TX_TIMER gLimPeriodicProbeReqTimer;
215
216 // CNF_WAIT timer
217 TX_TIMER *gpLimCnfWaitTimer;
218
219 // Send Disassociate frame threshold parameters
220 TX_TIMER gLimSendDisassocFrameThresholdTimer;
221
222 TX_TIMER gLimAddtsRspTimer; // max wait for a response
223
224 // Update OLBC Cache Timer
225 TX_TIMER gLimUpdateOlbcCacheTimer;
226
227 TX_TIMER gLimChannelSwitchTimer;
228 // This TIMER is started on the STA, as indicated by the
229 // AP in its Quiet BSS IE, for the specified interval
230 TX_TIMER gLimQuietTimer;
231 // This TIMER is started on the AP, prior to the AP going
232 // into LEARN mode
233 // This TIMER is started on the STA, for the specified
234 // quiet duration
235 TX_TIMER gLimQuietBssTimer;
236
237#ifdef WLAN_FEATURE_VOWIFI_11R
238 TX_TIMER gLimFTPreAuthRspTimer;
239#endif
240
241#ifdef FEATURE_WLAN_CCX
242 TX_TIMER gLimCcxTsmTimer;
243#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700244 TX_TIMER gLimRemainOnChannelTimer;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800245#ifdef FEATURE_WLAN_TDLS_INTERNAL
246 TX_TIMER gLimTdlsDisRspWaitTimer;
247 TX_TIMER gLimTdlsLinkSetupRspTimeouTimer;
248 TX_TIMER gLimTdlsLinkSetupCnfTimeoutTimer;
249#endif
250
Madan Mohan Koyyalamudi9aff9ff2012-11-29 11:27:25 -0800251 TX_TIMER gLimPeriodicJoinProbeReqTimer;
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800252 TX_TIMER gLimDisassocAckTimer;
253 TX_TIMER gLimDeauthAckTimer;
Viral Modid86bde22012-12-10 13:09:21 -0800254 // This timer is started when single shot NOA insert msg is sent to FW for scan in P2P GO mode
255 TX_TIMER gLimP2pSingleShotNoaInsertTimer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700256//********************TIMER SECTION ENDS**************************************************
257// ALL THE FIELDS BELOW THIS CAN BE ZEROED OUT in limInitialize
258//****************************************************************************************
259
260}tLimTimers;
261
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800262typedef struct {
263 void *pMlmDisassocReq;
264 void *pMlmDeauthReq;
265}tLimDisassocDeauthCnfReq;
Jeff Johnson295189b2012-06-20 16:38:30 -0700266
267typedef struct sAniSirLim
268{
269 ////////////////////////////////////// TIMER RELATED START ///////////////////////////////////////////
270
271 tLimTimers limTimers;
272 /// Flag to track if LIM timers are created or not
273 tANI_U32 gLimTimersCreated;
274
275
276 ////////////////////////////////////// TIMER RELATED END ///////////////////////////////////////////
277
278 ////////////////////////////////////// SCAN/LEARN RELATED START ///////////////////////////////////////////
279 /**
280 * This flag when set, will use scan mode instead of
281 * Learn mode on BP/AP. By default this flag is set
282 * to true until HIF getting stuck in 0x800 state is
283 * debugged.
284 */
285 tANI_U32 gLimUseScanModeForLearnMode;
286
287 /**
288 * This is useful for modules other than LIM
289 * to see if system is in scan/learn mode or not
290 */
291 tANI_U32 gLimSystemInScanLearnMode;
292
293 // Scan related globals on STA
294 tANI_U8 gLimReturnAfterFirstMatch;
295 tANI_U8 gLim24Band11dScanDone;
296 tANI_U8 gLim50Band11dScanDone;
297 tANI_U8 gLimReturnUniqueResults;
298
299 // Background Scan related globals on STA
300 tANI_U32 gLimNumOfBackgroundScanSuccess;
301 tANI_U32 gLimNumOfConsecutiveBkgndScanFailure;
302 tANI_U32 gLimNumOfForcedBkgndScan;
303 tANI_U8 gLimBackgroundScanDisable; //based on BG timer
304 tANI_U8 gLimForceBackgroundScanDisable; //debug control flag
305 tANI_U8 gLimBackgroundScanTerminate; //controlled by SME
306 tANI_U8 gLimReportBackgroundScanResults;//controlled by SME
307
308 /// Place holder for current channel ID
309 /// being scanned
310 tANI_U32 gLimCurrentScanChannelId;
311
312 // Hold onto SCAN criteria
Viral Modid440e682013-03-06 02:25:31 -0800313 /* The below is used in P2P GO case when we need to defer processing SME Req
314 * to LIM and insert NOA first and process SME req once SNOA is started
315 */
316 tANI_U16 gDeferMsgTypeForNOA;
317 tANI_U32 *gpDefdSmeMsgForNOA;
318
Jeff Johnson295189b2012-06-20 16:38:30 -0700319 tLimMlmScanReq *gpLimMlmScanReq;
320
321 /// This indicates total length of 'matched' scan results
322 tANI_U16 gLimMlmScanResultLength;
323
324 /// This indicates total length of 'cached' scan results
325 tANI_U16 gLimSmeScanResultLength;
326
327 /**
328 * Hash table definition for storing SCAN results
329 * This is the placed holder for 'cached' scan results
330 */
331 tLimScanResultNode
332 *gLimCachedScanHashTable[LIM_MAX_NUM_OF_SCAN_RESULTS];
333
Jeff Johnson295189b2012-06-20 16:38:30 -0700334 /// Place holder for current channel ID
335 /// being scanned during background scanning
336 tANI_U32 gLimBackgroundScanChannelId;
337 /// flag to indicate that bacground scan timer has been started
338 tANI_U8 gLimBackgroundScanStarted;
339
340 /* Used to store the list of legacy bss sta detected during scan on one channel */
341 tANI_U16 gLimRestoreCBNumScanInterval;
342 tANI_U16 gLimRestoreCBCount;
343 tSirMacAddr gLimLegacyBssidList[MAX_NUM_LEGACY_BSSID_PER_CHANNEL];
Jeff Johnson295189b2012-06-20 16:38:30 -0700344
345 //
346 // If this flag is 1,
347 // then, LIM will "try and trigger" a background
348 // scan whenever it receives a Quiet BSS IE
349 //
350 // If this flag is 0,
351 // then, LIM will simply shut-off Tx/Rx whenever it
352 // receives a Quiet BSS IE.
353 // This is the default behavior when a Quiet BSS IE
354 // is received and 11H is enabled
355 //
356 tANI_U32 gLimTriggerBackgroundScanDuringQuietBss;
357
Jeff Johnson295189b2012-06-20 16:38:30 -0700358
Jeff Johnson295189b2012-06-20 16:38:30 -0700359 // This variable store the total duration to do scan
360 tANI_U32 gTotalScanDuration;
Jeff Johnsone7245742012-09-05 17:12:55 -0700361 tANI_U32 p2pRemOnChanTimeStamp;
Jeff Johnson295189b2012-06-20 16:38:30 -0700362
363 // abort scan is used to abort an on-going scan
364 tANI_U8 abortScan;
365 tLimScanChnInfo scanChnInfo;
366
367 ////////////////////////////////////// SCAN/LEARN RELATED START ///////////////////////////////////////////
368 tSirMacAddr gSelfMacAddr; //added for BT-AMP Support
369
370 ////////////////////////////////////////// BSS RELATED END ///////////////////////////////////////////
371 // Place holder for StartBssReq message
372 // received by SME state machine
373
Jeff Johnson62c27982013-02-27 17:53:55 -0800374 tANI_U8 gLimCurrentBssUapsd;
Jeff Johnson295189b2012-06-20 16:38:30 -0700375
Jeff Johnson62c27982013-02-27 17:53:55 -0800376 /* This is used for testing sta legacy bss detect feature */
377 tANI_U8 gLimForceNoPropIE;
Jeff Johnson295189b2012-06-20 16:38:30 -0700378
379 //
380 // Store the BSS Index returned by HAL during
381 // WDA_ADD_BSS_RSP here.
382 //
383 // For now:
384 // This will be used during WDA_SET_BSSKEY_REQ in
385 // order to set the GTK
386 // Later:
387 // There could be other interfaces needing this info
388 //
389
390 //
391 // Due to the asynchronous nature of the interface
392 // between PE <-> HAL, some transient information
393 // like this needs to be cached.
394 // This is cached upon receipt of eWNI_SME_SETCONTEXT_REQ.
395 // This is released while posting LIM_MLM_SETKEYS_CNF
396 //
397 void* gpLimMlmSetKeysReq;
398 void* gpLimMlmRemoveKeyReq;
399
400 //On STA: staid for self generated by HAL and sent as response to 'ADD STA' msg.
401 //On AP: staid corresponding to BSS generated by HAL and sent as response to 'ADD BSS' msg.
402 // tANI_U16 gLimStaid; // TO SUPPORT BT-AMP
403
404 ////////////////////////////////////////// BSS RELATED END ///////////////////////////////////////////
405
406 ////////////////////////////////////////// IBSS RELATED START ///////////////////////////////////////////
407 // This indicates whether we've a partner
408 // that is also transmitting Beacon frame
409 // in IBSS
410 //tANI_U8 gLimIbssActive; oct1 review
411
412 //This indicates whether this STA coalesced and adapter to peer's capabilities or not.
413 tANI_U8 gLimIbssCoalescingHappened;
414
415 /// Definition for storing IBSS peers BSS description
416 tLimIbssPeerNode *gLimIbssPeerList;
417 tANI_U32 gLimNumIbssPeers;
418
419 // ibss info - params for which ibss to join while coalescing
420 tAniSirLimIbss ibssInfo;
421
422 ////////////////////////////////////////// IBSS RELATED END ///////////////////////////////////////////
423
424 ////////////////////////////////////////// STATS/COUNTER RELATED START ///////////////////////////////////////////
425
426 tANI_U16 maxStation;
427 tANI_U16 maxBssId;
428
429 tANI_U32 gLimNumBeaconsRcvd;
430 tANI_U32 gLimNumBeaconsIgnored;
431
432 tANI_U32 gLimNumDeferredMsgs;
433
434 /// Variable to keep track of number of currently associated STAs
Jeff Johnson295189b2012-06-20 16:38:30 -0700435 tANI_U16 gLimNumOfAniSTAs; // count of ANI peers
436 tANI_U16 gLimAssocStaLimit;
437
438 /// This indicates number of RXed Beacons during HB period
439 // tANI_U8 gLimRxedBeaconCntDuringHB;
440
441 // Heart-Beat interval value
442 tANI_U32 gLimHeartBeatCount;
443
444 // Statistics to keep track of no. beacons rcvd in heart beat interval
445 tANI_U16 gLimHeartBeatBeaconStats[MAX_NO_BEACONS_PER_HEART_BEAT_INTERVAL];
446
447#ifdef WLAN_DEBUG
448 // Debug counters
449 tANI_U32 numTot, numBbt, numProtErr, numLearn, numLearnIgnore;
450 tANI_U32 numSme, numMAC[4][16];
451
452 // Debug counter to track number of Assoc Req frame drops
453 // when received in pStaDs->mlmState other than LINK_ESTABLISED
454 tANI_U32 gLimNumAssocReqDropInvldState;
455 // counters to track rejection of Assoc Req due to Admission Control
456 tANI_U32 gLimNumAssocReqDropACRejectTS;
457 tANI_U32 gLimNumAssocReqDropACRejectSta;
458 // Debug counter to track number of Reassoc Req frame drops
459 // when received in pStaDs->mlmState other than LINK_ESTABLISED
460 tANI_U32 gLimNumReassocReqDropInvldState;
461 // Debug counter to track number of Hash Miss event that
462 // will not cause a sending of de-auth/de-associate frame
463 tANI_U32 gLimNumHashMissIgnored;
464
465 // Debug counter to track number of Beacon frames
466 // received in unexpected state
467 tANI_U32 gLimUnexpBcnCnt;
468
469 // Debug counter to track number of Beacon frames
470 // received in wt-join-state that do have SSID mismatch
471 tANI_U32 gLimBcnSSIDMismatchCnt;
472
473 // Debug counter to track number of Link establishments on STA/BP
474 tANI_U32 gLimNumLinkEsts;
475
476 // Debug counter to track number of Rx cleanup
477 tANI_U32 gLimNumRxCleanup;
478
479 // Debug counter to track different parse problem
480 tANI_U32 gLim11bStaAssocRejectCount;
481
482#endif
483
484 //Time stamp of the last beacon received from the BSS to which STA is connected.
485 tANI_U64 gLastBeaconTimeStamp;
486 //RX Beacon count for the current BSS to which STA is connected.
487 tANI_U32 gCurrentBssBeaconCnt;
488 tANI_U8 gLastBeaconDtimCount;
489 tANI_U8 gLastBeaconDtimPeriod;
490
491
492 ////////////////////////////////////////// STATS/COUNTER RELATED END ///////////////////////////////////////////
493
494
495 ////////////////////////////////////////// STATES RELATED START ///////////////////////////////////////////
496 // Counts Heartbeat failures
497 tANI_U8 gLimHBfailureCntInLinkEstState;
498 tANI_U8 gLimProbeFailureAfterHBfailedCnt;
499 tANI_U8 gLimHBfailureCntInOtherStates;
500
501 /**
502 * This variable indicates whether LIM module need to
503 * send response to host. Used to identify whether a request
504 * is generated internally within LIM module or by host
505 */
506 tANI_U8 gLimRspReqd;
507
508 /// Previous SME State
509 tLimSmeStates gLimPrevSmeState;
510
511 /// MLM State visible across all Sirius modules
512 tLimMlmStates gLimMlmState;
513
514 /// Previous MLM State
515 tLimMlmStates gLimPrevMlmState;
516
517#ifdef GEN4_SCAN
518 // LIM to HAL SCAN Management Message Interface states
519 tLimLimHalScanState gLimHalScanState;
520//WLAN_SUSPEND_LINK Related
521 SUSPEND_RESUME_LINK_CALLBACK gpLimSuspendCallback;
522 tANI_U32 *gpLimSuspendData;
523 SUSPEND_RESUME_LINK_CALLBACK gpLimResumeCallback;
524 tANI_U32 *gpLimResumeData;
525//end WLAN_SUSPEND_LINK Related
526 tANI_U8 fScanDisabled;
527 //Can be set to invalid channel. If it is invalid, HAL
528 //should move to previous valid channel or stay in the
Jeff Johnsone7245742012-09-05 17:12:55 -0700529 //current channel. CB state goes along with channel to resume to
530 tANI_U16 gResumeChannel;
531 ePhyChanBondState gResumePhyCbState;
Jeff Johnson295189b2012-06-20 16:38:30 -0700532#endif // GEN4_SCAN
533
534 // Change channel generic scheme
535 CHANGE_CHANNEL_CALLBACK gpchangeChannelCallback;
536 tANI_U32 *gpchangeChannelData;
537
538 /// SME State visible across all Sirius modules
539 tLimSmeStates gLimSmeState;
540 /// This indicates whether we're an AP, STA in BSS/IBSS
541 tLimSystemRole gLimSystemRole;
542
543 // Number of STAs that do not support short preamble
544 tLimNoShortParams gLimNoShortParams;
545
546 // Number of STAs that do not support short slot time
547 tLimNoShortSlotParams gLimNoShortSlotParams;
548
549
550 // OLBC parameters
551 tLimProtStaParams gLimOverlap11gParams;
552
553 tLimProtStaParams gLimOverlap11aParams;
554 tLimProtStaParams gLimOverlapHt20Params;
555 tLimProtStaParams gLimOverlapNonGfParams;
556
557 //
558 // ---------------- DPH -----------------------
559 // these used to live in DPH but are now moved here (where they belong)
560 tANI_U32 gLimPhyMode;
561 tANI_U32 propRateAdjustPeriod;
562 tANI_U32 scanStartTime; // used to measure scan time
563
Jeff Johnsone7245742012-09-05 17:12:55 -0700564 //tANI_U8 gLimBssid[6];
Jeff Johnson295189b2012-06-20 16:38:30 -0700565 tANI_U8 gLimMyMacAddr[6];
566 tANI_U8 ackPolicy;
567
568 tANI_U8 gLimQosEnabled:1; //11E
569 tANI_U8 gLimWmeEnabled:1; //WME
570 tANI_U8 gLimWsmEnabled:1; //WSM
571 tANI_U8 gLimHcfEnabled:1;
572 tANI_U8 gLim11dEnabled:1;
573 tANI_U8 gLimProbeRespDisableFlag:1; // control over probe response
574 // ---------------- DPH -----------------------
575
576 ////////////////////////////////////////// STATES RELATED END ///////////////////////////////////////////
577
578 ////////////////////////////////////////// MISC RELATED START ///////////////////////////////////////////
Jeff Johnson295189b2012-06-20 16:38:30 -0700579
580 // WDS info
581 tANI_U32 gLimNumWdsInfoInd;
582 tANI_U32 gLimNumWdsInfoSet;
583 tSirWdsInfo gLimWdsInfo;
584
585 // Deferred Queue Paramters
586 tLimDeferredMsgQParams gLimDeferredMsgQ;
587
588 // addts request if any - only one can be outstanding at any time
589 tSirAddtsReq gLimAddtsReq;
590 tANI_U8 gLimAddtsSent;
591 tANI_U8 gLimAddtsRspTimerCount;
592
593 //protection related config cache
594 tCfgProtection cfgProtection;
595
596 tANI_U8 gLimProtectionControl;
597 //RF band to determibe 2.4/5 GHZ
598
599 // alternate radio info used by STA
600 tSirAlternateRadioInfo gLimAlternateRadio;
601
602 //This flag will remain to be set except while LIM is waiting for specific response messages
603 //from HAL. e.g when LIM issues ADD_STA req it will clear this flag and when it will receive
604 //the response the flag will be set.
605 tANI_U8 gLimProcessDefdMsgs;
606
607 // UAPSD flag used on AP
608 tANI_U8 gUapsdEnable;
609
610 /* Used on STA, this is a static UAPSD mask setting
611 * derived from SME_JOIN_REQ and SME_REASSOC_REQ. If a
612 * particular AC bit is set, it means the AC is both
613 * trigger enabled and delivery enabled.
614 */
615 tANI_U8 gUapsdPerAcBitmask;
616
617 /* Used on STA, this is a dynamic UPASD mask setting
618 * derived from AddTS Rsp and DelTS frame. If a
619 * particular AC bit is set, it means AC is trigger
620 * enabled.
621 */
622 tANI_U8 gUapsdPerAcTriggerEnableMask;
623
624 /* Used on STA, dynamic UPASD mask setting
625 * derived from AddTS Rsp and DelTs frame. If
626 * a particular AC bit is set, it means AC is
627 * delivery enabled.
628 */
629 tANI_U8 gUapsdPerAcDeliveryEnableMask;
630
631 /* Used on STA for AC downgrade. This is a dynamic mask
632 * setting which keep tracks of ACs being admitted.
633 * If bit is set to 0: That partiular AC is not admitted
634 * If bit is set to 1: That particular AC is admitted
635 */
636 tANI_U8 gAcAdmitMask[SIR_MAC_DIRECTION_DIRECT];
637
638 //dialogue token List head/tail for Action frames request sent.
639 tpDialogueToken pDialogueTokenHead;
640 tpDialogueToken pDialogueTokenTail;
641
642 tLimTspecInfo tspecInfo[LIM_NUM_TSPEC_MAX];
643
644 // admission control policy information
645 tLimAdmitPolicyInfo admitPolicyInfo;
Leela V Kiran Kumar Reddy Chiralac3b9d382013-01-31 20:49:53 -0800646 vos_lock_t lkPeGlobalLock;
Leela V Kiran Kumar Reddy Chiralab1f7d342013-02-11 00:27:02 -0800647 tANI_U8 disableLDPCWithTxbfAP;
Jeff Johnson295189b2012-06-20 16:38:30 -0700648
649
650
651 ////////////////////////////////////////// MISC RELATED END ///////////////////////////////////////////
652
653 ////////////////////////////////////////// ASSOC RELATED START ///////////////////////////////////////////
654 // Place holder for JoinReq message
655 // received by SME state machine
656 // tpSirSmeJoinReq gpLimJoinReq;
657
658 // Place holder for ReassocReq message
659 // received by SME state machine
660 //tpSirSmeReassocReq gpLimReassocReq; sep23 review
661
Jeff Johnson295189b2012-06-20 16:38:30 -0700662 // Current Authentication type used at STA
663 //tAniAuthType gLimCurrentAuthType;
664
665 // Place holder for current authentication request
666 // being handled
667 tLimMlmAuthReq *gpLimMlmAuthReq;
668
669 // Place holder for Join request that we're
670 // currently attempting
Jeff Johnsone7245742012-09-05 17:12:55 -0700671 //tLimMlmJoinReq *gpLimMlmJoinReq;
Jeff Johnson295189b2012-06-20 16:38:30 -0700672
673 // Reason code to determine the channel change context while sending
674 // WDA_CHNL_SWITCH_REQ message to HAL
675 tANI_U32 channelChangeReasonCode;
676
677 /// MAC level Pre-authentication related globals
678 tSirMacChanNum gLimPreAuthChannelNumber;
679 tAniAuthType gLimPreAuthType;
680 tSirMacAddr gLimPreAuthPeerAddr;
681 tANI_U32 gLimNumPreAuthContexts;
682 tLimPreAuthTable gLimPreAuthTimerTable;
683
684 // Placed holder to deauth reason
685 tANI_U16 gLimDeauthReasonCode;
686
687 // Place holder for Pre-authentication node list
688 struct tLimPreAuthNode * pLimPreAuthList;
689
690 // Send Disassociate frame threshold parameters
691 tANI_U16 gLimDisassocFrameThreshold;
692 tANI_U16 gLimDisassocFrameCredit;
693
694 // Assoc or ReAssoc Response Data/Frame
695 void *gLimAssocResponseData;
696
697 //One cache for each overlap and associated case.
698 tCacheParams protStaOverlapCache[LIM_PROT_STA_OVERLAP_CACHE_SIZE];
699 tCacheParams protStaCache[LIM_PROT_STA_CACHE_SIZE];
700
701 ////////////////////////////////////////// ASSOC RELATED END ///////////////////////////////////////////
702
703
Jeff Johnson295189b2012-06-20 16:38:30 -0700704
705 //
706 // For DEBUG purposes
707 // Primarily for - TITAN BEACON workaround
708 // Symptom - TFP/PHY gets stuck
709 //
710 tANI_U32 gLimScanOverride;
711 // Holds the desired tSirScanType, as requested by SME
712 tSirScanType gLimScanOverrideSaved;
713
Jeff Johnson295189b2012-06-20 16:38:30 -0700714 //
715 // CB State protection, operated upon as follows:
716 // 1 - CB is enabled in the hardware ONLY WHEN a Titan
717 // STA associates with the AP
718 // 0 - CB is enabled/disabled based on the configuration
719 // received as per eWNI_SME_START_BSS_REQ
720 //
721 tANI_U32 gLimCBStateProtection;
722
723 // Count of TITAN STA's currently associated
724 tANI_U16 gLimTitanStaCount;
725
726 //
727 // For DEBUG purposes
728 // Primarily for - TITAN workaround
729 // Symptom - Avoid NULL data frames
730 // Applies to AP only
731 //
732 tANI_U32 gLimBlockNonTitanSta;
733 /////////////////////////// TITAN related globals //////////////////////////////////////////
734
735
736 //////////////////////////////// HT RELATED //////////////////////////////////////////
737 //
738 // The following global LIM variables maintain/manage
739 // the runtime configurations related to 802.11n
740
741 // 802.11n Station detected HT capability in Beacon Frame
742 tANI_U8 htCapabilityPresentInBeacon;
743
744 // 802.11 HT capability: Enabled or Disabled
745 tANI_U8 htCapability;
746
747
748 tANI_U8 gHTGreenfield;
749
Jeff Johnson295189b2012-06-20 16:38:30 -0700750 tANI_U8 gHTShortGI40Mhz;
751 tANI_U8 gHTShortGI20Mhz;
752
753 //Set to 0 for 3839 octets
754 //Set to 1 for 7935 octets
755 tANI_U8 gHTMaxAmsduLength;
756
757
758 // DSSS/CCK at 40 MHz: Enabled 1 or Disabled
759 tANI_U8 gHTDsssCckRate40MHzSupport;
760
761 // PSMP Support: Enabled 1 or Disabled 0
762 tANI_U8 gHTPSMPSupport;
763
764 // L-SIG TXOP Protection used only if peer support available
765 tANI_U8 gHTLsigTXOPProtection;
766
767 // MIMO Power Save
768 tSirMacHTMIMOPowerSaveState gHTMIMOPSState;
769
770 // Scan In Power Save
771 tANI_U8 gScanInPowersave;
772
773 //
774 // A-MPDU Density
775 // 000 - No restriction
776 // 001 - 1/8 usec
777 // 010 - 1/4 usec
778 // 011 - 1/2 usec
779 // 100 - 1 usec
780 // 101 - 2 usec
781 // 110 - 4 usec
782 // 111 - 8 usec
783 //
784 tANI_U8 gHTAMpduDensity;
785
786 tANI_BOOLEAN gMaxAmsduSizeEnabled;
787 // Maximum Tx/Rx A-MPDU factor
788 tANI_U8 gHTMaxRxAMpduFactor;
789
790 //
791 // Scheduled PSMP related - Service Interval Granularity
792 // 000 - 5 ms
793 // 001 - 10 ms
794 // 010 - 15 ms
795 // 011 - 20 ms
796 // 100 - 25 ms
797 // 101 - 30 ms
798 // 110 - 35 ms
799 // 111 - 40 ms
800 //
801 tANI_U8 gHTServiceIntervalGranularity;
802
803 // Indicates whether an AP wants to associate PSMP enabled Stations
804 tANI_U8 gHTControlledAccessOnly;
805
806 // RIFS Mode. Set if no APSD legacy devices associated
807 tANI_U8 gHTRifsMode;
808 // OBss Mode . set when we have Non HT STA is associated or with in overlap bss
809 tANI_U8 gHTObssMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700810
811 // Identifies the current Operating Mode
812 tSirMacHTOperatingMode gHTOperMode;
813
814 // Indicates if PCO is activated in the BSS
815 tANI_U8 gHTPCOActive;
816
817 //
818 // If PCO is active, indicates which PCO phase to use
819 // 0 - switch to 20 MHz phase
820 // 1 - switch to 40 MHz phase
821 //
822 tANI_U8 gHTPCOPhase;
823
824 //
825 // Used only in beacons. For PR, this is set to 0
826 // 0 - Primary beacon
827 // 1 - Secondary beacon
828 //
829 tANI_U8 gHTSecondaryBeacon;
830
831 //
832 // Dual CTS Protection
833 // 0 - Use RTS/CTS
834 // 1 - Dual CTS Protection is used
835 //
836 tANI_U8 gHTDualCTSProtection;
837
838 //
839 // Identifies a single STBC MCS that shall ne used for
840 // STBC control frames and STBC beacons
841 //
842 tANI_U8 gHTSTBCBasicMCS;
843
844 tANI_U8 gHTNonGFDevicesPresent;
845
846 tANI_U8 gAddBA_Declined; // Flag to Decline the BAR if the particular bit (0-7) is being set
847
848 //////////////////////////////// HT RELATED //////////////////////////////////////////
849
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800850#ifdef FEATURE_WLAN_TDLS_INTERNAL
851 //////////////////////////////// TDLS RELATED //////////////////////////////////////////
852
853 tSirTdlsDisReq gLimTdlsDisReq ;
854 //tLimDisResultList *gTdlsDisResultList ;
855 tLimDisResultList *gLimTdlsDisResultList ;
856 tANI_U8 gLimTdlsDisStaCount ;
857 tANI_U8 gAddStaDisRspWait ;
858
859 tLimTdlsLinkSetupInfo gLimTdlsLinkSetupInfo;
860
861 /* to track if direct link is b/g/n, this can be independent of AP link */
862#ifdef FEATURE_WLAN_TDLS_NEGATIVE
863 tANI_U32 gLimTdlsNegativeBehavior;
864#endif
865#endif
866#ifdef FEATURE_WLAN_TDLS
867 tANI_U8 gLimAddStaTdls ;
868 tANI_U8 gLimTdlsLinkMode ;
869 //////////////////////////////// TDLS RELATED //////////////////////////////////////////
870#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700871
872 // wsc info required to form the wsc IE
873 tLimWscIeInfo wscIeInfo;
874 tpPESession gpSession ; //Pointer to session table
875 /*
876 * sessionID and transactionID from SME is stored here for those messages, for which
877 * there is no session context in PE, e.g. Scan related messages.
878 **/
879 tANI_U8 gSmeSessionId;
880 tANI_U16 gTransactionId;
881
Jeff Johnsone7245742012-09-05 17:12:55 -0700882#ifdef FEATURE_OEM_DATA_SUPPORT
883tLimMlmOemDataReq *gpLimMlmOemDataReq;
884tLimMlmOemDataRsp *gpLimMlmOemDataRsp;
885#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700886
Jeff Johnson295189b2012-06-20 16:38:30 -0700887 tSirRemainOnChnReq *gpLimRemainOnChanReq; //hold remain on chan request in this buf
888 vos_list_t gLimMgmtFrameRegistratinQueue;
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800889 tANI_U32 mgmtFrameSessionId;
Madan Mohan Koyyalamudi70bb4cb2012-10-18 19:31:25 -0700890 tSirBackgroundScanMode gLimBackgroundScanMode;
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700891
892#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
893 tpPESession pSessionEntry;
894 tANI_U8 reAssocRetryAttempt;
895#endif
Madan Mohan Koyyalamudi521ff192012-11-15 17:13:08 -0800896 tLimDisassocDeauthCnfReq limDisassocDeauthCnfReq;
Leela Venkata Kiran Kumar Reddy Chirala2247e962013-03-22 19:21:10 -0700897 tANI_U8 deferredMsgCnt;
Jeff Johnson295189b2012-06-20 16:38:30 -0700898} tAniSirLim, *tpAniSirLim;
899
Jeff Johnson295189b2012-06-20 16:38:30 -0700900typedef struct sLimMgmtFrameRegistration
901{
902 vos_list_node_t node; // MUST be first element
903 tANI_U16 frameType;
904 tANI_U16 matchLen;
905 tANI_U16 sessionId;
906 tANI_U8 matchData[1];
907} tLimMgmtFrameRegistration, *tpLimMgmtFrameRegistration;
Jeff Johnson295189b2012-06-20 16:38:30 -0700908
909#if defined WLAN_FEATURE_VOWIFI
910typedef struct sRrmContext
911{
912 tRrmSMEContext rrmSmeContext;
913 tRrmPEContext rrmPEContext;
914}tRrmContext, *tpRrmContext;
915#endif
916
917#if defined WLAN_FEATURE_VOWIFI_11R
918typedef struct sFTContext
919{
920 tftSMEContext ftSmeContext;
921 tftPEContext ftPEContext;
922} tftContext, *tpFTContext;
923#endif
924
Jeff Johnson295189b2012-06-20 16:38:30 -0700925//Check if this definition can actually move here even for Volans. In that case
926//this featurization can be removed.
927/** ------------------------------------------------------------------------- *
928
929 \typedef tDriverType
930
931 \brief Indicate the driver type to the mac, and based on this do
932 appropriate initialization.
933
934 -------------------------------------------------------------------------- */
935
936typedef enum
937{
938 eDRIVER_TYPE_PRODUCTION = 0,
939 eDRIVER_TYPE_MFG = 1,
940 eDRIVER_TYPE_DVT = 2
941} tDriverType;
942
943/** ------------------------------------------------------------------------- *
944
945 \typedef tMacOpenParameters
946
947 \brief Parameters needed for Enumeration of all status codes returned by the higher level
948 interface functions.
949
950 -------------------------------------------------------------------------- */
951
952typedef struct sMacOpenParameters
953{
954 tANI_U16 maxStation;
955 tANI_U16 maxBssId;
956 tANI_U32 frameTransRequired;
957 tDriverType driverType;
958} tMacOpenParameters;
959
960typedef enum
961{
962 HAL_STOP_TYPE_SYS_RESET,
963 HAL_STOP_TYPE_SYS_DEEP_SLEEP,
964 HAL_STOP_TYPE_RF_KILL
965}tHalStopType;
966
967typedef struct sHalMacStartParameters
968{
969 // parametes for the Firmware
970 //tHalFirmwareParameters FW;
971 tDriverType driverType;
972
973} tHalMacStartParameters;
Jeff Johnson295189b2012-06-20 16:38:30 -0700974
975// -------------------------------------------------------------------
976/// MAC Sirius parameter structure
977typedef struct sAniSirGlobal
978
979{
980 tDriverType gDriverType;
Jeff Johnson295189b2012-06-20 16:38:30 -0700981
982 // we should be able to save this hddHandle in here and deprecate
983 // the pAdapter. For now, compiles are a problem because there
984 // are dependencides on the header files that are not handling the
985 // compiler very gracefully.
986// tHddHandle hHdd; // Handle to the HDD.
987 //void *hHdd;
988 void *pAdapter; // deprecate this pAdapter pointer eventually...
989 // all interfaces to the HDD should pass hHdd, which
990 // is stored in this struct above.....
991 tSirMbMsg* pResetMsg;
992 tAniSirCfg cfg;
993 tAniSirLim lim;
Jeff Johnson295189b2012-06-20 16:38:30 -0700994 tAniSirPmm pmm;
995 tAniSirSch sch;
996 tAniSirSys sys;
997 tAniSirUtils utils;
Jeff Johnson295189b2012-06-20 16:38:30 -0700998 // PAL/HDD handle
999 tHddHandle hHdd;
1000
1001#ifdef ANI_DVT_DEBUG
1002 tAniSirDvt dvt;
1003#endif
1004
1005 tSmeStruct sme;
1006 tCsrScanStruct scan;
1007 tCsrRoamStruct roam;
1008
Jeff Johnsone7245742012-09-05 17:12:55 -07001009#ifdef FEATURE_OEM_DATA_SUPPORT
1010 tOemDataStruct oemData;
1011#endif
Gopichand Nakkalab977a972013-02-18 19:15:09 -08001012#ifdef FEATURE_WLAN_TDLS_INTERNAL
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001013 tCsrTdlsCtxStruct tdlsCtx ;
1014#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001015 tPmcInfo pmc;
1016 tSmeBtcInfo btc;
Jeff Johnson295189b2012-06-20 16:38:30 -07001017
1018 tCcm ccm;
1019
1020#if defined WLAN_FEATURE_VOWIFI
1021 tRrmContext rrm;
1022#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001023#ifdef WLAN_FEATURE_CONCURRENT_P2P
1024 tp2pContext p2pContext[MAX_NO_OF_P2P_SESSIONS];
1025#else
1026 tp2pContext p2pContext;
1027#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001028
1029#if defined WLAN_FEATURE_VOWIFI_11R
1030 tftContext ft;
1031#endif
1032
1033 tANI_U32 gCurrentLogSize;
1034 tANI_U32 menuCurrent;
1035 /* logDump specific */
1036 tANI_U32 dumpTablecurrentId;
1037 /* Instead of static allocation I will dyanamically allocate memory for dumpTableEntry
1038 Thinking of using linkedlist */
1039 tDumpModuleEntry *dumpTableEntry[MAX_DUMP_TABLE_ENTRY];
Gopichand Nakkalaccd3a382013-03-19 13:56:10 -07001040#ifdef FEATURE_WLAN_TDLS
1041 v_BOOL_t isTdlsPowerSaveProhibited;
1042#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001043
1044} tAniSirGlobal;
1045
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001046#ifdef FEATURE_WLAN_TDLS
Jeff Johnson295189b2012-06-20 16:38:30 -07001047
Mohit Khanna698ba2a2012-12-04 15:08:18 -08001048#define RFC1042_HDR_LENGTH (6)
1049#define GET_BE16(x) ((tANI_U16) (((x)[0] << 8) | (x)[1]))
1050#define ETH_TYPE_89_0d (0x890d)
1051#define ETH_TYPE_LEN (2)
1052#define PAYLOAD_TYPE_TDLS_SIZE (1)
1053#define PAYLOAD_TYPE_TDLS (2)
1054
1055#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001056
1057#endif /* _ANIGLOBAL_H */
1058