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