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