blob: 504f9dce4d0c44a3f7adac4551ec4ba07437785e [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 ------------------------------------------------------------------------- *
24
25
26 \file csrInternal.h
27
28 Define internal data structure for MAC.
29
30 Copyright (C) 2006 Airgo Networks, Incorporated
31 ========================================================================== */
32#ifndef CSRINTERNAL_H__
33#define CSRINTERNAL_H__
34
35#if defined(VOSS_ENABLED)
36#include "vos_status.h"
37#include "vos_lock.h"
38#endif //#if defined(VOSS_ENABLED)
39
40#include "palTimer.h"
41#include "csrSupport.h"
42#include "vos_nvitem.h"
43#include "wlan_qct_tl.h"
44
45#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
46#include "csrNeighborRoam.h"
47#endif
48
49#define CSR_MAX_STA (HAL_NUM_STA)
50
51#define CSR_SME_SCAN_FLAGS_DELETE_CACHE 0x80
52
53#define CSR_TITAN_MAX_RATE_MIMO_CB 240
54#define CSR_TITAN_MAX_RATE_MIMO 126
55
56//define scan return criteria. LIM should use these define as well
57#define CSR_SCAN_RETURN_AFTER_ALL_CHANNELS ( 0 )
58#define CSR_SCAN_RETURN_AFTER_FIRST_MATCH ( 0x01 )
59#define CSR_SCAN_RETURN_AFTER_5_BAND_11d_FOUND ( 0x80 )
60#define CSR_SCAN_RETURN_AFTER_24_BAND_11d_FOUND ( 0x40 )
61#define CSR_SCAN_RETURN_AFTER_EITHER_BAND_11d_FOUND ( CSR_SCAN_RETURN_AFTER_5_BAND_11d_FOUND | CSR_SCAN_RETURN_AFTER_24_BAND_11d_FOUND )
62#define CSR_NUM_RSSI_CAT 5
63#define CSR_MAX_STATISTICS_REQ 10
64
65//Support for multiple session
66#define CSR_SESSION_ID_INVALID 0xFF // session ID invalid
67#define CSR_ROAM_SESSION_MAX 5 // No of sessions to be supported, and a
68 // session is for Infra, IBSS or BT-AMP
69
70#define CSR_IS_SESSION_VALID( pMac, sessionId ) ( ( (sessionId) < CSR_ROAM_SESSION_MAX ) \
71 && ( (pMac)->roam.roamSession[(sessionId)].sessionActive ) )
72#define CSR_GET_SESSION( pMac, sessionId ) \
73( \
74 (sessionId < CSR_ROAM_SESSION_MAX) ? \
75 (&(pMac)->roam.roamSession[(sessionId)]) :\
76 NULL \
77)
78
79
80
81typedef enum
82{
83 //eCSR_CFG_DOT11_MODE_BEST = 0,
84 eCSR_CFG_DOT11_MODE_TAURUS = 0,
85 eCSR_CFG_DOT11_MODE_ABG,
86 eCSR_CFG_DOT11_MODE_11A,
87 eCSR_CFG_DOT11_MODE_11B,
88 eCSR_CFG_DOT11_MODE_11G,
89 eCSR_CFG_DOT11_MODE_11N,
90 eCSR_CFG_DOT11_MODE_POLARIS,
91 eCSR_CFG_DOT11_MODE_TITAN,
Jeff Johnsone7245742012-09-05 17:12:55 -070092#ifdef WLAN_FEATURE_11AC
93 eCSR_CFG_DOT11_MODE_11AC,
94#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070095#ifdef WLAN_SOFTAP_FEATURE
96 eCSR_CFG_DOT11_MODE_11G_ONLY,
97 eCSR_CFG_DOT11_MODE_11N_ONLY,
98#endif
Jeff Johnsone7245742012-09-05 17:12:55 -070099#ifdef WLAN_FEATURE_11AC
100 eCSR_CFG_DOT11_MODE_11AC_ONLY,
101#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700102 //This value can never set to CFG. It is for CSR's internal use
103 eCSR_CFG_DOT11_MODE_AUTO,
104}eCsrCfgDot11Mode; //Used to determine what to set to the WNI_CFG_DOT11_MODE
105
106typedef enum etCsrRoamCommands
107{
108 eCsrRoamNoCommand,
109 eCsrRoamCommandScan,
110 eCsrRoamCommandRoam,
111 eCsrRoamCommandWmStatusChange,
112 eCsrRoamCommandSetKey,
113 eCsrRoamCommandRemoveKey,
114
115} eCsrRoamCommands;
116
117typedef enum
118{
119 eCsrScanOther = 1,
120 eCsrScanLostLink1,
121 eCsrScanLostLink2,
122 eCsrScanLostLink3,
123 eCsrScanLostLink4,
124 eCsrScan11d1, //First 11d scan
125 eCsrScan11d2, //First 11d scan has failed
126 eCsrScan11dDone, //11d scan succeeded, try the rest of the channel
127 eCsrScanUserRequest,
128 eCsrScanGetResult,
129 eCsrScanSetBGScanParam, //used for HO too - bg scan request in NT Handoff sub-state
130 eCsrScanForSsid,
131 eCsrScanForCapsChange,
132 eCsrScanBGScanAbort,
133 eCsrScanBGScanEnable,
134 eCsrScanIdleScan,
135 eCsrScanGetScanChnInfo, //To get the list of channels scanned
136
137 eCsrScanBgScan, // bg scan request in NRT & RT Handoff sub-states
138 eCsrScanProbeBss, // directed probe on an entry from the candidate list - HO
139 eCsrScanAbortBgScan, //aborting a BG scan (meaning the scan is triggered by LIM timer)
140 eCsrScanAbortNormalScan, //aborting a normal scan (the scan is trigger by eWNI_SME_SCAN_REQ)
141 eCsrScanP2PFindPeer
142}eCsrScanReason;
143
144typedef enum
145{
146 eCsrNoConnection, // Roaming because we have not established the initial connection.
147 eCsrCapsChange, // roaming because LIM reported a Capability change in the associated AP.
148 eCsrForcedDisassoc, // roaming becuase someone asked us to Disassoc and stay disassociated.
149 eCsrHddIssued, // roaming because an 802.11 request was issued to the driver.
150 eCsrLostLink1, // roaming because we lost link to an associated AP
151 eCsrLostLink2,
152 eCsrLostLink3,
153 eCsrForcedDisassocMICFailure, // roaming because we need to force a Disassoc due to MIC failure
154 eCsrHddIssuedReassocToSameAP,
155 eCsrSmeIssuedReassocToSameAP,
156 eCsrSmeIssuedReassocToDiffAP,
157 eCsrForcedDeauth, // roaming becuase someone asked us to deauth and stay disassociated.
158 eCsrSmeIssuedDisassocForHandoff, // will be issued by Handoff logic to disconect from current AP
159 eCsrSmeIssuedAssocToSimilarAP, // will be issued by Handoff logic to join a new AP with same profile
160 eCsrSmeIssuedIbssJoinFailure, // ibss join timer fired before any perr showed up, so shut down the network
161 eCsrForcedIbssLeave,
162 eCsrStopBss,
163 eCsrSmeIssuedFTReassoc,
164 eCsrForcedDisassocSta,
165 eCsrForcedDeauthSta,
166
167}eCsrRoamReason;
168
169typedef enum
170{
171 eCSR_ROAM_SUBSTATE_NONE = 0,
172 eCSR_ROAM_SUBSTATE_START_BSS_REQ,
173 eCSR_ROAM_SUBSTATE_JOIN_REQ,
174 eCSR_ROAM_SUBSTATE_REASSOC_REQ,
175 eCSR_ROAM_SUBSTATE_DISASSOC_REQ,
176 eCSR_ROAM_SUBSTATE_STOP_BSS_REQ,
177 eCSR_ROAM_SUBSTATE_DISCONNECT_CONTINUE_ROAMING, //Continue the current roam command after disconnect
178 eCSR_ROAM_SUBSTATE_AUTH_REQ,
179 eCSR_ROAM_SUBSTATE_CONFIG,
180 eCSR_ROAM_SUBSTATE_DEAUTH_REQ,
181 eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN,
182 eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE,
183 eCSR_ROAM_SUBSTATE_DISASSOC_FORCED,
184 eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY,
185 eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF,
186 eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC,
187 eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC,
188 eCSR_ROAM_SUBSTATE_JOINED_REALTIME_TRAFFIC,
189// max is 15 unless the bitfield is expanded...
190} eCsrRoamSubState;
191
192
193typedef enum
194{
195 eCSR_ROAMING_STATE_STOP = 0,
196 eCSR_ROAMING_STATE_IDLE,
197 eCSR_ROAMING_STATE_SCANNING,
198 eCSR_ROAMING_STATE_JOINING,
199 eCSR_ROAMING_STATE_JOINED,
200}eCsrRoamState;
201
202
203typedef enum
204{
205 eCsrContinueRoaming,
206 eCsrStopRoaming,
207 eCsrStartIbss,
208 eCsrStartIbssSameIbss,
209 eCsrReassocToSelfNoCapChange,
Jeff Johnsone7245742012-09-05 17:12:55 -0700210 eCsrStopRoamingDueToConcurrency,
Jeff Johnson295189b2012-06-20 16:38:30 -0700211
212}eCsrJoinState;
213
214typedef enum
215{
216 eCsrNotRoaming,
217 eCsrLostlinkRoamingDisassoc,
218 eCsrLostlinkRoamingDeauth,
219 eCsrDynamicRoaming,
220 eCsrReassocRoaming,
221}eCsrRoamingReason;
222
223typedef enum
224{
225 eCsrDisassociated,
226 eCsrDeauthenticated
227
228}eCsrRoamWmStatusChangeTypes;
229
230typedef enum
231{
232 eCsrSummaryStats = 0,
233 eCsrGlobalClassAStats,
234 eCsrGlobalClassBStats,
235 eCsrGlobalClassCStats,
236 eCsrGlobalClassDStats,
237 eCsrPerStaStats,
238 eCsrMaxStats
239}eCsrRoamStatsClassTypes;
240
241#ifdef FEATURE_WLAN_DIAG_SUPPORT
242typedef enum
243{
244 eCSR_WLAN_STATUS_CONNECT =0,
245 eCSR_WLAN_STATUS_DISCONNECT
246
247}eCsrDiagWlanStatusEventSubtype;
248
249typedef enum
250{
251 eCSR_REASON_UNSPECIFIED = 0,
252 eCSR_REASON_USER_REQUESTED,
253 eCSR_REASON_MIC_ERROR,
254 eCSR_REASON_DISASSOC,
255 eCSR_REASON_DEAUTH,
256 eCSR_REASON_HANDOFF,
257
258}eCsrDiagWlanStatusEventReason;
259
260typedef enum
261{
262 eCSR_WLAN_HANDOFF_EVENT =0,
263
264}eCsrDiagWlanHandoffEventSubtype;
265
266typedef enum
267{
268 eCSR_WLAN_VCC_EVENT =0,
269
270}eCsrDiagWlanVccEventSubtype;
271
272#endif //FEATURE_WLAN_DIAG_SUPPORT
273
274typedef struct tagCsrChannel
275{
276 tANI_U8 numChannels;
277 tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
278}tCsrChannel;
279
280typedef struct tagScanProfile
281{
282 tANI_U32 minChnTime;
283 tANI_U32 maxChnTime;
284 tANI_U32 restTime; //This is ignored if not associated
285 tANI_U32 numOfChannels;
286 tANI_U8 *pChannelList;
287 tSirScanType scanType; //active or passive
288 eCsrRoamBssType bssType; //BSS or IBSS
289 tANI_U8 ssid[WNI_CFG_SSID_LEN];
290 tANI_U8 bReturnAfter1stMatch;
291 tANI_U8 fUniqueResult;
292 tANI_U8 freshScan;
293 tCsrBssid bssid;
294}tScanProfile;
295
296typedef struct tagBssConfigParam
297{
298 eCsrMediaAccessType qosType;
299 tSirMacSSid SSID;
300 tANI_U32 uRTSThresh;
301 tANI_U32 uDeferThresh; //
302 eCsrCfgDot11Mode uCfgDot11Mode;
303 eCsrBand eBand;
304 tANI_U8 standardRate[CSR_DOT11_SUPPORTED_RATES_MAX];
305 tANI_U8 extendedRate[CSR_DOT11_EXTENDED_SUPPORTED_RATES_MAX];
306 eCsrExposedTxRate txRate;
307 tAniAuthType authType;
308 eCsrEncryptionType encType;
309 tANI_U32 uShortSlotTime;
310 tANI_U32 uHTSupport; //High throughput
311 tANI_U32 uPowerLimit;
312 tANI_U32 uHeartBeatThresh;
313 tANI_U32 uJoinTimeOut;
314 tSirMacCapabilityInfo BssCap;
315 tANI_BOOLEAN f11hSupport;
Jeff Johnsone7245742012-09-05 17:12:55 -0700316 ePhyChanBondState cbMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700317}tBssConfigParam;
318
319
320typedef struct tagCsrRoamStartBssParams
321{
322 tSirMacSSid ssId;
323 tCsrBssid bssid; //this is the BSSID for the party we want to join (only use for IBSS or WDS)
324 tSirNwType sirNwType;
Jeff Johnsone7245742012-09-05 17:12:55 -0700325 ePhyChanBondState cbMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700326 tSirMacRateSet operationalRateSet;
327 tSirMacRateSet extendedRateSet;
328 tANI_U8 operationChn;
329 eCsrCfgDot11Mode uCfgDot11Mode;
330#ifdef WLAN_SOFTAP_FEATURE
331 tANI_U8 privacy;
332 tANI_BOOLEAN fwdWPSPBCProbeReq;
333 tANI_BOOLEAN protEnabled;
334 tANI_BOOLEAN obssProtEnabled;
335 tAniAuthType authType;
336 tANI_U16 beaconInterval; //If this is 0, SME will fill in for caller.
337 tANI_U16 ht_protection;
338 tANI_U32 dtimPeriod;
339 tANI_U8 ApUapsdEnable;
340 tANI_U8 ssidHidden;
341 tANI_U8 wps_state;
342#endif
343 tVOS_CON_MODE bssPersona;
344 tANI_U16 nRSNIELength; //The byte count in the pRSNIE, if 0, pRSNIE is ignored.
345 tANI_U8 *pRSNIE; //If not null, it has the IE byte stream for RSN
346}tCsrRoamStartBssParams;
347
348
349typedef struct tagScanCmd
350{
351 tANI_U32 scanID;
352 csrScanCompleteCallback callback;
353 void *pContext;
354 eCsrScanReason reason;
355 eCsrRoamState lastRoamState[CSR_ROAM_SESSION_MAX];
356 tCsrRoamProfile *pToRoamProfile;
357 tANI_U32 roamId; //this is the ID related to the pToRoamProfile
358 union
359 {
360 tCsrScanRequest scanRequest;
361 tCsrBGScanRequest bgScanRequest;
362 }u;
363}tScanCmd;
364
365typedef struct tagRoamCmd
366{
367 tANI_U32 roamId;
368 eCsrRoamReason roamReason;
369 tCsrRoamProfile roamProfile;
370 tScanResultHandle hBSSList; //BSS list fits the profile
371 tListElem *pRoamBssEntry; //point to the current BSS in the list that is roaming. It starts from head to tail
372 tSirBssDescription *pLastRoamBss; //the last BSS we try and failed
373 tANI_BOOLEAN fReleaseBssList; //whether to free hBSSList
374 tANI_BOOLEAN fReleaseProfile; //whether to free roamProfile
375 tANI_BOOLEAN fReassoc; //whether this command is for reassociation
376 tANI_BOOLEAN fUpdateCurRoamProfile; //whether pMac->roam.pCurRoamProfile needs to be updated
377 //this is for CSR internal used only. And it should not be assigned when creating the command
378 //This causes the roam command not to do anything.
379 tANI_BOOLEAN fReassocToSelfNoCapChange;
380
381 tANI_BOOLEAN fStopWds;
382 tSirMacAddr peerMac;
383 tSirMacReasonCodes reason;
384}tRoamCmd;
385
386typedef struct tagSetKeyCmd
387{
388 tANI_U32 roamId;
389 eCsrEncryptionType encType;
390 eCsrAuthType authType;
391 tAniKeyDirection keyDirection; //Tx, Rx or Tx-and-Rx
392 tSirMacAddr peerMac; //Peer's MAC address. ALL 1's for group key
393 tANI_U8 paeRole; //0 for supplicant
394 tANI_U8 keyId; // Kye index
395 tANI_U8 keyLength; //Number of bytes containing the key in pKey
396 tANI_U8 Key[CSR_MAX_KEY_LEN];
397 tANI_U8 keyRsc[CSR_MAX_RSC_LEN];
398} tSetKeyCmd;
399
400typedef struct tahRemoveKeyCmd
401{
402 tANI_U32 roamId;
403 eCsrEncryptionType encType;
404 eCsrAuthType authType;
405 tSirMacAddr peerMac; //Peer's MAC address. ALL 1's for group key
406 tANI_U8 keyId; //key index
407} tRemoveKeyCmd;
408
409typedef struct tagWmStatusChangeCmd
410{
411 eCsrRoamWmStatusChangeTypes Type;
412 union
413 {
414 tSirSmeDeauthInd DeauthIndMsg;
415 tSirSmeDisassocInd DisassocIndMsg;
416 }u;
417
418}tWmStatusChangeCmd;
419
420typedef struct tagAddStaForSessionCmd
421{
422 //Session self mac addr
423 tSirMacAddr selfMacAddr;
424}tAddStaForSessionCmd;
425
426typedef struct tagDelStaForSessionCmd
427{
428 //Session self mac addr
429 tSirMacAddr selfMacAddr;
430 csrRoamSessionCloseCallback callback;
431 void *pContext;
432}tDelStaForSessionCmd;
433
434//This structure represents one scan request
435typedef struct tagCsrCmd
436{
437 tListElem Link;
438 eCsrRoamCommands command;
439 tANI_U8 sessionId; // Session ID for this command
440 union
441 {
442 tScanCmd scanCmd;
443 tRoamCmd roamCmd;
444 tWmStatusChangeCmd wmStatusChangeCmd;
445 tSetKeyCmd setKeyCmd;
446 tRemoveKeyCmd removeKeyCmd;
447 tAddStaForSessionCmd addStaSessionCmd;
448 tDelStaForSessionCmd delStaSessionCmd;
449 }u;
450}tCsrCmd;
451
452#ifdef WLAN_FEATURE_VOWIFI_11R
453typedef struct tagCsr11rConfig
454{
455 tANI_BOOLEAN IsFTResourceReqSupported;
456} tCsr11rConfig;
457#endif
458
459#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
460typedef struct tagCsrNeighborRoamConfig
461{
462 tANI_U32 nNeighborScanTimerPeriod;
463 tANI_U8 nNeighborLookupRssiThreshold;
464 tANI_U8 nNeighborReassocRssiThreshold;
465 tANI_U16 nNeighborScanMinChanTime;
466 tANI_U16 nNeighborScanMaxChanTime;
467 sCsrChannel neighborScanChanList;
468 tANI_U8 nMaxNeighborRetries;
469 tANI_U16 nNeighborResultsRefreshPeriod;
470}tCsrNeighborRoamConfig;
471#endif
472
473typedef struct tagCsrConfig
474{
475 tANI_U32 agingCount;
476 tANI_U32 FragmentationThreshold;
477 tANI_U32 channelBondingMode24GHz;
478 tANI_U32 channelBondingMode5GHz;
479 tANI_U32 RTSThreshold;
480 eCsrPhyMode phyMode;
481 eCsrCfgDot11Mode uCfgDot11Mode;
482 eCsrBand eBand;
483 tANI_U32 HeartbeatThresh50;
484 tANI_U32 HeartbeatThresh24;
485 tANI_U32 bgScanInterval;
486 eCsrCBChoice cbChoice;
487 eCsrBand bandCapability; //indicate hw capability
488 eCsrRoamWmmUserModeType WMMSupportMode;
489 tANI_BOOLEAN Is11eSupportEnabled;
490 tANI_BOOLEAN Is11dSupportEnabled;
491 tANI_BOOLEAN Is11dSupportEnabledOriginal;
492 tANI_BOOLEAN Is11hSupportEnabled;
493 tANI_BOOLEAN shortSlotTime;
494 tANI_BOOLEAN ProprietaryRatesEnabled;
495 tANI_BOOLEAN fenableMCCMode;
Mohit Khanna7ed53f02012-09-11 17:52:10 -0700496 tANI_BOOLEAN fAllowMCCGODiffBI;
Jeff Johnson295189b2012-06-20 16:38:30 -0700497 tANI_U16 TxRate;
498 tANI_U8 AdHocChannel24;
499 tANI_U8 AdHocChannel5G;
500 tANI_U32 impsSleepTime; //in units of microseconds
501 tANI_U32 scanAgeTimeNCNPS; //scan result aging time threshold when Not-Connect-No-Power-Save, in seconds
502 tANI_U32 scanAgeTimeNCPS; //scan result aging time threshold when Not-Connect-Power-Save, in seconds
503 tANI_U32 scanAgeTimeCNPS; //scan result aging time threshold when Connect-No-Power-Save, in seconds,
504 tANI_U32 scanAgeTimeCPS; //scan result aging time threshold when Connect-Power-Savein seconds
505 tANI_U32 BssPreferValue[CSR_NUM_RSSI_CAT]; //each RSSI category has one value
506 int RSSICat[CSR_NUM_RSSI_CAT];
507 tANI_U8 bCatRssiOffset; //to set the RSSI difference for each category
508 tANI_U32 nRoamingTime; //In seconds, CSR will try this long before gives up, 0 means no roaming
509 //Whether to limit the channels to the ones set in Csr11dInfo. If true, the opertaional
510 //channels are limited to the default channel list. It is an "AND" operation between the
511 //default channels and the channels in the 802.11d IE.
512 tANI_BOOLEAN fEnforce11dChannels;
513 //Country Code Priority
514 //0 = 802.11D > Configured Country > NV
515 //1 = Configured Country > 802.11D > NV
516 tANI_BOOLEAN fSupplicantCountryCodeHasPriority;
517 //When true, AP with unknown country code won't be see.
518 //"Unknown country code" means either Ap doesn't have 11d IE or we cannot
519 //find a domain for the country code in its 11d IE.
520 tANI_BOOLEAN fEnforceCountryCodeMatch;
521 //When true, only APs in the default domain can be seen. If the Ap has "unknown country
522 //code", or the doamin of the country code doesn't match the default domain, the Ap is
523 //not acceptable.
524 tANI_BOOLEAN fEnforceDefaultDomain;
525
526 tANI_U16 vccRssiThreshold;
527 tANI_U32 vccUlMacLossThreshold;
528
529 tANI_U32 nPassiveMinChnTime; //in units of milliseconds
530 tANI_U32 nPassiveMaxChnTime; //in units of milliseconds
531 tANI_U32 nActiveMinChnTime; //in units of milliseconds
532 tANI_U32 nActiveMaxChnTime; //in units of milliseconds
533
534 tANI_BOOLEAN IsIdleScanEnabled;
535 //in dBm, the maximum TX power
536 //The actual TX power is the lesser of this value and 11d.
537 //If 11d is disable, the lesser of this and default setting.
538 tANI_U8 nTxPowerCap;
539 tANI_U32 statsReqPeriodicity; //stats request frequency from PE while in full power
540 tANI_U32 statsReqPeriodicityInPS;//stats request frequency from PE while in power save
541#ifdef WLAN_SOFTAP_FEATURE
542 tANI_U32 dtimPeriod;
543 tANI_BOOLEAN ssidHidden;
544#endif
545
546#ifdef WLAN_FEATURE_VOWIFI_11R
547 tCsr11rConfig csr11rConfig;
548#endif
549
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700550#ifdef FEATURE_WLAN_LFR
551 tANI_U8 isFastRoamIniFeatureEnabled;
552#endif
553
Jeff Johnson295189b2012-06-20 16:38:30 -0700554#ifdef FEATURE_WLAN_CCX
555 tANI_U8 isCcxIniFeatureEnabled;
556#endif
557
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700558#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
Jeff Johnson295189b2012-06-20 16:38:30 -0700559 tANI_U8 isFastTransitionEnabled;
Jeff Johnson43971f52012-07-17 12:26:56 -0700560 tANI_U8 RoamRssiDiff;
Jeff Johnson295189b2012-06-20 16:38:30 -0700561#endif
562
563#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
564 tCsrNeighborRoamConfig neighborRoamConfig;
565#endif
566
567 /* Instead of Reassoc, send ADDTS/DELTS even when ACM is off for that AC
568 * This is mandated by WMM-AC certification */
569 tANI_BOOLEAN addTSWhenACMIsOff;
570
571 tANI_BOOLEAN fValidateList;
Jeff Johnsone7245742012-09-05 17:12:55 -0700572 tANI_BOOLEAN doBMPSWorkaround;
Jeff Johnson295189b2012-06-20 16:38:30 -0700573
574 //To enable/disable scanning 2.4Ghz channels twice on a single scan request from HDD
575 tANI_BOOLEAN fScanTwice;
Jeff Johnsone7245742012-09-05 17:12:55 -0700576#ifdef WLAN_FEATURE_11AC
577 tANI_U32 nVhtChannelWidth;
578#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700579
580}tCsrConfig;
581
582typedef struct tagCsrChannelPowerInfo
583{
584 tListElem link;
585 tANI_U8 firstChannel;
586 tANI_U8 numChannels;
587 tANI_U8 txPower;
588 tANI_U8 interChannelOffset;
589}tCsrChannelPowerInfo;
590
591typedef struct tagRoamJoinStatus
592{
593 tSirResultCodes statusCode;
594 //this is set to unspecified if statusCode indicates timeout. Or it is the failed reason from the other BSS(per 802.11 spec)
595 tANI_U32 reasonCode;
596}tCsrRoamJoinStatus;
597
598typedef struct tagCsrOsChannelMask
599{
600 tANI_U8 numChannels;
601 tANI_BOOLEAN scanEnabled[WNI_CFG_VALID_CHANNEL_LIST_LEN];
602 tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
603}tCsrOsChannelMask;
604
605
606typedef struct tagCsrScanStruct
607{
608 tScanProfile scanProfile;
609 tANI_U32 nextScanID;
Madan Mohan Koyyalamudica43cdf2012-09-24 13:15:49 -0700610 tDblLinkList scanResultList;
Jeff Johnson295189b2012-06-20 16:38:30 -0700611 tDblLinkList tempScanResults;
612 tANI_BOOLEAN fScanEnable;
613 tANI_BOOLEAN fFullScanIssued;
614 tPalTimerHandle hTimerGetResult;
615#ifdef WLAN_AP_STA_CONCURRENCY
616 tPalTimerHandle hTimerStaApConcTimer;
617#endif
618 tPalTimerHandle hTimerIdleScan;
619 tPalTimerHandle hTimerResultAging;
620 tPalTimerHandle hTimerBgScan;
621 //changes on every scan, it is used as a flag for whether 11d info is found on every scan
622 tANI_U8 channelOf11dInfo;
623 //changes on every scan, a flag to tell whether conflict 11d info found on each BSS
624 tANI_BOOLEAN fAmbiguous11dInfoFound;
625 //Tush: changes on every scan, a flag to tell whether the applied 11d info present in one of the scan results
626 tANI_BOOLEAN fCurrent11dInfoMatch;
627 tANI_BOOLEAN f11dInfoReset; //to indicate whether the 11d info in CFG is reset to default
628 tSirScanType curScanType;
629 tCsrChannel baseChannels; //This are all the supported channels AND(&) to the current eBand
630 tCsrChannel channels11d;
631 tChannelListWithPower defaultPowerTable[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
632 tChannelListWithPower defaultPowerTable40MHz[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
633 tANI_U32 numChannelsDefault; //total channels of NV
634 tCsrChannel base20MHzChannels; //The channel base to work on
635 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
636 tDblLinkList channelPowerInfoList24;
637 tDblLinkList channelPowerInfoList5G;
638 tANI_U32 nLastAgeTimeOut;
639 tANI_U32 nAgingCountDown;
640 tANI_U8 countryCodeDefault[WNI_CFG_COUNTRY_CODE_LEN+1]; //The country code from NV
641 tANI_U8 countryCodeCurrent[WNI_CFG_COUNTRY_CODE_LEN+1];
642 tANI_U8 countryCode11d[WNI_CFG_COUNTRY_CODE_LEN+1];
643 v_REGDOMAIN_t domainIdDefault; //default regulatory domain
644 v_REGDOMAIN_t domainIdCurrent; //current regulatory domain
645 tANI_BOOLEAN f11dInfoApplied;
646 tANI_BOOLEAN fCancelIdleScan;
647#ifdef FEATURE_WLAN_WAPI
648// tANI_U16 NumBkidCandidate;
649// tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED]; /* Move this as part of SessionEntry */
650#endif /* FEATURE_WLAN_WAPI */
651 tANI_U8 numBGScanChannel; //number of valid channels in the bgScanChannelList
652 tANI_U8 bgScanChannelList[WNI_CFG_BG_SCAN_CHANNEL_LIST_LEN];
653 //the ChannelInfo member is not used in this structure.
654 //numBGScanChannel and bgScanChannelList are used for the BG scan channel info
655 tCsrBGScanRequest bgScanParams;
656 tANI_BOOLEAN fRestartIdleScan;
657 tANI_U32 nIdleScanTimeGap; //the time since last trying to trigger idle scan
658 tCsrOsChannelMask osScanChannelMask;//keep a track of channels to be scnned while in traffic condition
659 tANI_U16 nBssLimit; //the maximum number of BSS in scan cache
660 /*channelPowerInfoList24 has been seen corrupted. Set this flag to true trying to
661 * detect when it happens. Adding this into code because we can't reproduce it easily.
662 * We don't know when it happens. */
663 tANI_BOOLEAN fValidateList;
664 /*Customer wants to start with an active scan based on the default country code.
665 * This optimization will minimize the driver load to association time.
666 * Based on this flag we will bypass the initial passive scan needed for 11d
667 * to determine the country code & domain */
668 tANI_BOOLEAN fEnableBypass11d;
669
670 /*Customer wants to optimize the scan time. Avoiding scans(passive) on DFS
671 * channels while swipping through both bands can save some time
672 * (apprx 1.3 sec) */
673 tANI_BOOLEAN fEnableDFSChnlScan;
674
Jeff Johnsone7245742012-09-05 17:12:55 -0700675 /*
676 * To enable/disable scanning only 2.4Ghz channels on first scan
677 */
678 tANI_BOOLEAN fFirstScanOnly2GChnl;
679
Jeff Johnson295189b2012-06-20 16:38:30 -0700680 tANI_BOOLEAN fDropScanCmd; //true means we don't accept scan commands
681
682#ifdef WLAN_AP_STA_CONCURRENCY
683 tDblLinkList scanCmdPendingList;
684#endif
685}tCsrScanStruct;
686
687
688//Save the connected information. This structure + connectedProfile
689//should contain all information about the connection
690typedef struct tagRoamCsrConnectedInfo
691{
692 tANI_U32 nBeaconLength; //the length, in bytes, of the beacon frame, can be 0
693 tANI_U32 nAssocReqLength; //the length, in bytes, of the assoc req frame, can be 0
694 tANI_U32 nAssocRspLength; //The length, in bytes, of the assoc rsp frame, can be 0
695#ifdef WLAN_FEATURE_VOWIFI_11R
696 tANI_U32 nRICRspLength; //Length of the parsed RIC response IEs received in reassoc response
697#endif
698#ifdef FEATURE_WLAN_CCX
699 tANI_U32 nTspecIeLength;
700#endif
701 tANI_U8 *pbFrames; //Point to a buffer contain the beacon, assoc req, assoc rsp frame, in that order
702 //user needs to use nBeaconLength, nAssocReqLength, nAssocRspLength to desice where
703 //each frame starts and ends.
704 tANI_U8 staId;
705}tCsrRoamConnectedInfo;
706
707
708typedef struct tagCsrLinkQualityIndInfo
709{
710 csrRoamLinkQualityIndCallback callback;
711 void *context;
712}tCsrLinkQualityIndInfo;
713
714typedef struct tagCsrPeStatsReqInfo
715{
716 tListElem link; /* list links */
717 tANI_U32 statsMask;
718 tANI_U32 periodicity;
719 tANI_BOOLEAN rspPending;
720 vos_timer_t hPeStatsTimer;
721 tANI_BOOLEAN timerRunning;
722 tANI_U8 staId;
723 tANI_U8 numClient;
724 tpAniSirGlobal pMac;
725 /* To remember if the peStats timer is stopped successfully or not */
726 tANI_BOOLEAN timerStopFailed;
727
728}tCsrPeStatsReqInfo;
729
730typedef struct tagCsrStatsClientReqInfo
731{
732 tListElem link; /* list links */
733 eCsrStatsRequesterType requesterId;
734 tCsrStatsCallback callback;
735 tANI_U32 periodicity;
736 void *pContext;
737 tANI_U32 statsMask;
738 tCsrPeStatsReqInfo *pPeStaEntry;
739 tANI_U8 staId;
740 vos_timer_t timer;
741 tANI_BOOLEAN timerExpired;
742 tpAniSirGlobal pMac; // TODO: Confirm this change BTAMP
743}tCsrStatsClientReqInfo;
744
745typedef struct tagCsrTlStatsReqInfo
746{
747 tANI_U32 periodicity;
748 tANI_BOOLEAN timerRunning;
749 tPalTimerHandle hTlStatsTimer;
750 tANI_U8 numClient;
751}tCsrTlStatsReqInfo;
752
753typedef struct tagCsrRoamSession
754{
755 tANI_U8 sessionId; // Session ID
756 tANI_BOOLEAN sessionActive; // TRUE if it is used
757 tCsrBssid selfMacAddr; // For BT-AMP station, this serve as BSSID for self-BSS.
758 csrRoamCompleteCallback callback;
759 void *pContext;
760 eCsrConnectState connectState;
761 tCsrRoamConnectedProfile connectedProfile;
762 tCsrRoamConnectedInfo connectedInfo;
763 tCsrRoamProfile *pCurRoamProfile;
764 tSirBssDescription *pConnectBssDesc;
765 tANI_U16 NumPmkidCache;
766 tPmkidCacheInfo PmkidCacheInfo[CSR_MAX_PMKID_ALLOWED];
767 tANI_U8 cJoinAttemps;
768 //This may or may not have the up-to-date valid channel list
769 //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
770 tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
771 tANI_S32 sPendingCommands; //0 means CSR is ok to low power
772#ifdef FEATURE_WLAN_WAPI
773 tANI_U16 NumBkidCache;
774 tBkidCacheInfo BkidCacheInfo[CSR_MAX_BKID_ALLOWED];
775#endif /* FEATURE_WLAN_WAPI */
776 tANI_BOOLEAN fRoaming; //indicate whether CSR is roaming (either via lostlink or dynamic roaming)
777 //to remember some parameters needed for START_BSS.
778 //All member must be set every time we try to join or start an IBSS or BT-AMP
779 tCsrRoamStartBssParams bssParams;
780 tANI_U32 nWpaRsnReqIeLength; //the byte count of pWpaRsnIE;
781 tANI_U8 *pWpaRsnReqIE; //this contain the WPA/RSN IE in assoc request or the one sent in beacon (IBSS)
782 tANI_U32 nWpaRsnRspIeLength; //the byte count for pWpaRsnRspIE
783 tANI_U8 *pWpaRsnRspIE; //this contain the WPA/RSN IE in beacon/probe rsp
784#ifdef FEATURE_WLAN_WAPI
785 tANI_U32 nWapiReqIeLength; //the byte count of pWapiReqIE;
786 tANI_U8 *pWapiReqIE; //this contain the WAPI IE in assoc request or the one sent in beacon (IBSS)
787 tANI_U32 nWapiRspIeLength; //the byte count for pWapiRspIE
788 tANI_U8 *pWapiRspIE; //this contain the WAPI IE in beacon/probe rsp
789#endif /* FEATURE_WLAN_WAPI */
790 tANI_U32 nAddIEScanLength; //the byte count of pAddIeScanIE;
791 tANI_U8 *pAddIEScan; //this contains the additional IE in (unicast) probe request at the time of join
792 tANI_U32 nAddIEAssocLength; //the byte count for pAddIeAssocIE
793 tANI_U8 *pAddIEAssoc; //this contains the additional IE in (re) assoc request
794
795 tANI_TIMESTAMP roamingStartTime; //in units of 10ms
796 tCsrTimerInfo roamingTimerInfo;
797 eCsrRoamingReason roamingReason;
798 tANI_BOOLEAN fCancelRoaming;
799 tPalTimerHandle hTimerRoaming;
800 tPalTimerHandle hTimerIbssJoining;
801 tCsrTimerInfo ibssJoinTimerInfo;
802 tANI_BOOLEAN ibss_join_pending;
803 eCsrRoamResult roamResult; //the roamResult that is used when the roaming timer fires
804 tCsrRoamJoinStatus joinFailStatusCode; //This is the reason code for join(assoc) failure
805 //The status code returned from PE for deauth or disassoc (in case of lostlink), or our own dynamic roaming
806 tANI_U32 roamingStatusCode;
807 tANI_U16 NumPmkidCandidate;
808 tPmkidCandidateInfo PmkidCandidateInfo[CSR_MAX_PMKID_ALLOWED];
809 #ifdef FEATURE_WLAN_WAPI
810 tANI_U16 NumBkidCandidate;
811 tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED];
812#endif
813 tANI_BOOLEAN fWMMConnection;
814#ifdef FEATURE_WLAN_BTAMP_UT_RF
815 //To retry a join later when it fails if so desired
816 tPalTimerHandle hTimerJoinRetry;
817 tCsrTimerInfo joinRetryTimerInfo;
818 tANI_U32 maxRetryCount;
819#endif
820#ifdef FEATURE_WLAN_CCX
821 tCsrCcxCckmInfo ccxCckmInfo;
822 tANI_BOOLEAN isPrevApInfoValid;
823 tSirMacSSid prevApSSID;
824 tCsrBssid prevApBssid;
825 tANI_U8 prevOpChannel;
826 tANI_U16 clientDissSecs;
827 tANI_U32 roamTS1;
828#endif
829 tANI_U8 bRefAssocStartCnt; //Tracking assoc start indication
830} tCsrRoamSession;
831
832typedef struct tagCsrRoamStruct
833{
834 tANI_U32 nextRoamId;
835 tDblLinkList roamCmdPendingList;
836 tDblLinkList channelList5G;
837 tDblLinkList channelList24;
838 tCsrConfig configParam;
839 tANI_U32 numChannelsEeprom; //total channels of eeprom
840 tCsrChannel base20MHzChannels; //The channel base to work on
841 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
842 eCsrRoamState curState[CSR_ROAM_SESSION_MAX];
843 eCsrRoamSubState curSubState[CSR_ROAM_SESSION_MAX];
844 //This may or may not have the up-to-date valid channel list
845 //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
846 tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
847 tANI_U32 numValidChannels; //total number of channels in CFG
848
849 tANI_S32 sPendingCommands;
850 tChannelListWithPower *powerTableFromEeprom;
851 tChannelListWithPower *powerTableFromEeprom40MHz;
852 tPalTimerHandle hTimerWaitForKey; //To support timeout for WaitForKey state
853 tCsrSummaryStatsInfo summaryStatsInfo;
854 tCsrGlobalClassAStatsInfo classAStatsInfo;
855 tCsrGlobalClassBStatsInfo classBStatsInfo;
856 tCsrGlobalClassCStatsInfo classCStatsInfo;
857 tCsrGlobalClassDStatsInfo classDStatsInfo;
858 tCsrPerStaStatsInfo perStaStatsInfo[CSR_MAX_STA];
859 tDblLinkList statsClientReqList;
860 tDblLinkList peStatsReqList;
861 tCsrTlStatsReqInfo tlStatsReqInfo;
862 eCsrRoamLinkQualityInd vccLinkQuality;
863 tCsrLinkQualityIndInfo linkQualityIndInfo;
864 v_CONTEXT_t gVosContext; //used for interaction with TL
865 //To specify whether an association or a IBSS is WMM enabled
866 //This parameter is only valid during a join or start BSS command is being executed
867 //tANI_BOOLEAN fWMMConnection; /* Moving it to be part of roamsession */
868 v_U8_t ucACWeights[WLANTL_MAX_AC];
869 /* TODO : Upto here */
870 tCsrTimerInfo WaitForKeyTimerInfo;
871 tCsrRoamSession *roamSession;
872 tANI_U32 transactionId; // Current transaction ID for internal use.
873#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
874 tCsrNeighborRoamControlInfo neighborRoamInfo;
875#endif
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700876#ifdef FEATURE_WLAN_LFR
877 tANI_U8 isFastRoamIniFeatureEnabled;
878#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700879#ifdef FEATURE_WLAN_CCX
880 tANI_U8 isCcxIniFeatureEnabled;
881#endif
Jeff Johnson43971f52012-07-17 12:26:56 -0700882#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
883 tANI_U8 RoamRssiDiff;
884#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700885}tCsrRoamStruct;
886
887
888#define GET_NEXT_ROAM_ID(pRoamStruct) (((pRoamStruct)->nextRoamId + 1 == 0) ? 1 : (pRoamStruct)->nextRoamId)
889#define CSR_IS_ROAM_STATE(pMac, state, sessionId) ( (state) == (pMac)->roam.curState[sessionId] )
890
891#define CSR_IS_ROAM_STOP(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_STOP, sessionId )
892#define CSR_IS_ROAM_INIT(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_INIT, sessionId )
893#define CSR_IS_ROAM_SCANNING(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_SCANNING, sessionId )
894#define CSR_IS_ROAM_JOINING(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_JOINING, sessionId )
895#define CSR_IS_ROAM_IDLE(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_IDLE, sessionId )
896#define CSR_IS_ROAM_JOINED(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_JOINED, sessionId )
897
898#define CSR_IS_ROAM_SUBSTATE(pMac, subState, sessionId) ((subState) == (pMac)->roam.curSubState[sessionId])
899#define CSR_IS_ROAM_SUBSTATE_JOIN_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOIN_REQ, sessionId)
900#define CSR_IS_ROAM_SUBSTATE_AUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_AUTH_REQ, sessionId)
901#define CSR_IS_ROAM_SUBSTATE_REASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_REASSOC_REQ, sessionId)
902#define CSR_IS_ROAM_SUBSTATE_DISASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REQ, sessionId)
903#define CSR_IS_ROAM_SUBSTATE_DISASSOC_NO_JOIN(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN, sessionId)
904#define CSR_IS_ROAM_SUBSTATE_REASSOC_FAIL(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE, sessionId)
905#define CSR_IS_ROAM_SUBSTATE_DISASSOC_FORCED(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_FORCED, sessionId)
906#define CSR_IS_ROAM_SUBSTATE_DEAUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DEAUTH_REQ, sessionId)
907#define CSR_IS_ROAM_SUBSTATE_START_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_START_BSS_REQ, sessionId)
908#define CSR_IS_ROAM_SUBSTATE_STOP_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_STOP_BSS_REQ, sessionId)
909#define CSR_IS_ROAM_SUBSTATE_DISCONNECT_CONTINUE(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISCONNECT_CONTINUE_ROAMING, sessionId)
910#define CSR_IS_ROAM_SUBSTATE_CONFIG(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_CONFIG, sessionId)
911#define CSR_IS_ROAM_SUBSTATE_WAITFORKEY(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY, sessionId)
912#define CSR_IS_ROAM_SUBSTATE_DISASSOC_HO(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF, sessionId)
913#define CSR_IS_ROAM_SUBSTATE_HO_NT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC, sessionId)
914#define CSR_IS_ROAM_SUBSTATE_HO_NRT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC, sessionId)
915#define CSR_IS_ROAM_SUBSTATE_HO_RT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_REALTIME_TRAFFIC, sessionId)
916
917#define CSR_IS_PHY_MODE_B_ONLY(pMac) \
918 ((eCSR_DOT11_MODE_11b == (pMac)->roam.configParam.phyMode) ||\
919 (eCSR_DOT11_MODE_11b_ONLY == (pMac)->roam.configParam.phyMode))
920
921#define CSR_IS_PHY_MODE_G_ONLY(pMac) \
922 (eCSR_DOT11_MODE_11g == (pMac)->roam.configParam.phyMode || eCSR_DOT11_MODE_11g_ONLY == (pMac)->roam.configParam.phyMode)
923
924#define CSR_IS_PHY_MODE_A_ONLY(pMac) \
925 ((eCSR_DOT11_MODE_11a == (pMac)->roam.configParam.phyMode) ||\
926 (eCSR_DOT11_MODE_11a_ONLY == (pMac)->roam.configParam.phyMode))
927
Jeff Johnsone7245742012-09-05 17:12:55 -0700928#ifdef WLAN_FEATURE_11AC
929#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
930 ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
931 (eCSR_DOT11_MODE_11ac & (phyMode)) || \
932 (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
933 (eCSR_DOT11_MODE_AUTO & (phyMode)))
934#else
Jeff Johnson295189b2012-06-20 16:38:30 -0700935#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
936 ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
937 (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
938 (eCSR_DOT11_MODE_AUTO & (phyMode)))
Jeff Johnsone7245742012-09-05 17:12:55 -0700939#endif
940
Jeff Johnson295189b2012-06-20 16:38:30 -0700941
942// this function returns TRUE if the NIC is operating exclusively in the 2.4 GHz band, meaning
943// it is NOT operating in the 5.0 GHz band.
944#define CSR_IS_24_BAND_ONLY(pMac) \
945 (eCSR_BAND_24 == (pMac)->roam.configParam.eBand)
946
947#define CSR_IS_5G_BAND_ONLY(pMac) \
948 (eCSR_BAND_5G == (pMac)->roam.configParam.eBand)
949
950#define CSR_IS_RADIO_DUAL_BAND(pMac) \
951 (eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability)
952
953#define CSR_IS_RADIO_BG_ONLY(pMac) \
954 (eCSR_BAND_24 == (pMac)->roam.configParam.bandCapability)
955
956// this function returns TRUE if the NIC is operating exclusively in the 5.0 GHz band, meaning
957// it is NOT operating in the 2.4 GHz band
958#define CSR_IS_RADIO_A_ONLY(pMac) \
959 (eCSR_BAND_5G == (pMac)->roam.configParam.bandCapability)
960
961// this function returns TRUE if the NIC is operating in both bands.
962#define CSR_IS_OPEARTING_DUAL_BAND(pMac) \
963 ((eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability) && (eCSR_BAND_ALL == (pMac)->roam.configParam.eBand))
964
965// this function returns TRUE if the NIC can operate in the 5.0 GHz band (could operate in the
966// 2.4 GHz band also).
967#define CSR_IS_OPERATING_A_BAND(pMac) \
968 (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_A_ONLY((pMac)) || CSR_IS_5G_BAND_ONLY((pMac)))
969
970// this function returns TRUE if the NIC can operate in the 2.4 GHz band (could operate in the
971// 5.0 GHz band also).
972#define CSR_IS_OPERATING_BG_BAND(pMac) \
973 (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_BG_ONLY((pMac)) || CSR_IS_24_BAND_ONLY((pMac)))
974
975#define CSR_IS_CHANNEL_5GHZ(chnNum) \
Jeff Johnsone7245742012-09-05 17:12:55 -0700976 (((chnNum) >= CSR_MIN_5GHz_CHANNEL_NUMBER) && ((chnNum) <= CSR_MAX_5GHz_CHANNEL_NUMBER))
Jeff Johnson295189b2012-06-20 16:38:30 -0700977
978#define CSR_IS_CHANNEL_24GHZ(chnNum) \
979 (((chnNum) > 0) && ((chnNum) <= CSR_MAX_24GHz_CHANNEL_NUMBER))
980
981#define CSR_IS_SAME_BAND_CHANNELS(ch1, ch2) (CSR_IS_CHANNEL_5GHZ(ch1) == CSR_IS_CHANNEL_5GHZ(ch2))
982
983
984#define CSR_IS_11D_INFO_FOUND(pMac) \
985 (0 != (pMac)->scan.channelOf11dInfo)
986// DEAUTHIND
987#define CSR_IS_ROAMING(pSession) ((CSR_IS_LOSTLINK_ROAMING((pSession)->roamingReason)) || \
988 (eCsrDynamicRoaming == (pSession)->roamingReason) || \
989 (eCsrReassocRoaming == (pSession)->roamingReason))
990
991
992#define CSR_IS_SET_KEY_COMMAND( pCommand ) ( eSmeCommandSetKey == (pCommand)->command )
993
994#define CSR_IS_ADDTS_WHEN_ACMOFF_SUPPORTED(pMac) (pMac->roam.configParam.addTSWhenACMIsOff)
995// DEAUTHIND
996#define CSR_IS_LOSTLINK_ROAMING(reason) ((eCsrLostlinkRoamingDisassoc == (reason)) || (eCsrLostlinkRoamingDeauth == (reason)))
997
998//Stop CSR from asking for IMPS, This function doesn't disable IMPS from CSR
999void csrScanSuspendIMPS( tpAniSirGlobal pMac );
1000//Start CSR from asking for IMPS. This function doesn't trigger CSR to request entering IMPS
1001//because IMPS maybe disabled.
1002void csrScanResumeIMPS( tpAniSirGlobal pMac );
1003
1004eHalStatus csrInitGetChannels(tpAniSirGlobal pMac);
1005
1006eHalStatus csrSetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1007 tCsrRoamModifyProfileFields *pModifyProfileFields);
1008/* ---------------------------------------------------------------------------
1009 \fn csrGetModifyProfileFields
1010 \brief HDD or SME - QOS calls this function to get the current values of
1011 connected profile fields changing which can cause reassoc.
1012 This function must be called after CFG is downloaded and STA is in connected
1013 state.
1014 \param pModifyProfileFields - pointer to the connected profile fields
1015 changing which can cause reassoc
1016
1017 \return eHalStatus
1018 -------------------------------------------------------------------------------*/
1019eHalStatus csrGetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1020 tCsrRoamModifyProfileFields * pModifyProfileFields);
1021void csrSetGlobalCfgs( tpAniSirGlobal pMac );
1022void csrSetDefaultDot11Mode( tpAniSirGlobal pMac );
1023void csrScanSetChannelMask(tpAniSirGlobal pMac, tCsrChannelInfo *pChannelInfo);
1024tANI_BOOLEAN csrIsConnStateDisconnected(tpAniSirGlobal pMac, tANI_U32 sessionId);
1025tANI_BOOLEAN csrIsConnStateConnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1026tANI_BOOLEAN csrIsConnStateDisconnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1027tANI_BOOLEAN csrIsConnStateConnectedInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1028tANI_BOOLEAN csrIsConnStateConnected( tpAniSirGlobal pMac, tANI_U32 sessionId );
1029tANI_BOOLEAN csrIsConnStateInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1030tANI_BOOLEAN csrIsConnStateIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1031tANI_BOOLEAN csrIsConnStateWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1032tANI_BOOLEAN csrIsConnStateConnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1033tANI_BOOLEAN csrIsConnStateDisconnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1034tANI_BOOLEAN csrIsAnySessionInConnectState( tpAniSirGlobal pMac );
1035tANI_BOOLEAN csrIsAllSessionDisconnected( tpAniSirGlobal pMac );
1036tANI_BOOLEAN csrIsInfraConnected( tpAniSirGlobal pMac );
1037tANI_BOOLEAN csrIsConcurrentInfraConnected( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001038tANI_BOOLEAN csrIsConcurrentSessionRunning( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001039tANI_BOOLEAN csrIsInfraApStarted( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001040tANI_BOOLEAN csrIsIBSSStarted( tpAniSirGlobal pMac );
1041tANI_BOOLEAN csrIsBTAMPStarted( tpAniSirGlobal pMac );
1042tANI_BOOLEAN csrIsBTAMP( tpAniSirGlobal pMac, tANI_U32 sessionId );
1043eHalStatus csrIsBTAMPAllowed( tpAniSirGlobal pMac, tANI_U32 chnId );
Jeff Johnsone7245742012-09-05 17:12:55 -07001044tANI_BOOLEAN csrIsValidMcConcurrentSession(tpAniSirGlobal pMac, tANI_U32 sessionId,
1045 tSirBssDescription *pBssDesc);
Jeff Johnson295189b2012-06-20 16:38:30 -07001046#ifdef WLAN_SOFTAP_FEATURE
1047tANI_BOOLEAN csrIsConnStateConnectedInfraAp( tpAniSirGlobal pMac, tANI_U32 sessionId );
1048#endif
1049/*----------------------------------------------------------------------------
1050 \fn csrRoamRegisterLinkQualityIndCallback
1051
1052 \brief
1053 a CSR function to allow HDD to register a callback handler with CSR for
1054 link quality indications.
1055
1056 Only one callback may be registered at any time.
1057 In order to deregister the callback, a NULL cback may be provided.
1058
1059 Registration happens in the task context of the caller.
1060
1061 \param callback - Call back being registered
1062 \param pContext - user data
1063
1064 DEPENDENCIES: After CSR open
1065
1066 \return eHalStatus
1067-----------------------------------------------------------------------------*/
1068eHalStatus csrRoamRegisterLinkQualityIndCallback(tpAniSirGlobal pMac,
1069 csrRoamLinkQualityIndCallback callback,
1070 void *pContext);
1071/* ---------------------------------------------------------------------------
1072 \fn csrGetStatistics
1073 \brief csr function that client calls to register a callback to get
1074 different PHY level statistics from CSR.
1075
1076 \param requesterId - different client requesting for statistics, HDD, UMA/GAN etc
1077 \param statsMask - The different category/categories of stats requester is looking for
1078 \param callback - SME sends back the requested stats using the callback
1079 \param periodicity - If requester needs periodic update, 0 means it's an one
1080 time request
1081 \param cache - If requester is happy with cached stats
1082 \param staId - The station ID for which the stats is requested for
1083 \param pContext - user context to be passed back along with the callback
1084
1085 \return eHalStatus
1086 ---------------------------------------------------------------------------*/
1087eHalStatus csrGetStatistics(tpAniSirGlobal pMac, eCsrStatsRequesterType requesterId,
1088 tANI_U32 statsMask,
1089 tCsrStatsCallback callback,
1090 tANI_U32 periodicity, tANI_BOOLEAN cache,
1091 tANI_U8 staId, void *pContext);
1092
1093
1094eHalStatus csrGetRssi(tpAniSirGlobal pMac,tCsrRssiCallback callback,tANI_U8 staId,tCsrBssid bssId,void * pContext,void * pVosContext);
1095eHalStatus csrRoamRegisterCallback(tpAniSirGlobal pMac, csrRoamCompleteCallback callback, void *pContext);
1096/* ---------------------------------------------------------------------------
1097 \fn csrGetConfigParam
1098 \brief HDD calls this function to get the global settings currently maintained by CSR.
1099 \param pParam - caller allocated memory
1100 \return eHalStatus
1101 -------------------------------------------------------------------------------*/
1102eHalStatus csrGetConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1103
1104/* ---------------------------------------------------------------------------
1105 \fn csrMsgProcessor
1106 \brief HDD calls this function to change some global settings.
1107 caller must set the all fields or call csrGetConfigParam to prefill the fields.
1108 \param pParam - caller allocated memory
1109 \return eHalStatus
1110 -------------------------------------------------------------------------------*/
1111eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1112
1113
1114/* ---------------------------------------------------------------------------
1115 \fn csrMsgProcessor
1116 \brief HDD calls this function for the messages that are handled by CSR.
1117 \param pMsgBuf - a pointer to a buffer that maps to various structures base on the message type.
1118 The beginning of the buffer can always map to tSirSmeRsp.
1119 \return eHalStatus
1120 -------------------------------------------------------------------------------*/
1121eHalStatus csrMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf );
1122
1123/* ---------------------------------------------------------------------------
1124 \fn csrOpen
1125 \brief This function must be called before any API call to CSR.
1126 \return eHalStatus
1127 -------------------------------------------------------------------------------*/
1128eHalStatus csrOpen(tpAniSirGlobal pMac);
1129/* ---------------------------------------------------------------------------
1130 \fn csrClose
1131 \brief To close down CSR module. There should not be any API call into CSR after calling this function.
1132 \return eHalStatus
1133 -------------------------------------------------------------------------------*/
1134eHalStatus csrClose(tpAniSirGlobal pMac);
1135/* ---------------------------------------------------------------------------
1136 \fn csrStart
1137 \brief To start CSR.
1138 \return eHalStatus
1139 -------------------------------------------------------------------------------*/
1140eHalStatus csrStart(tpAniSirGlobal pMac);
1141/* ---------------------------------------------------------------------------
1142 \fn csrStop
1143 \brief To stop CSR. CSR still keeps its current setting.
1144 \return eHalStatus
1145 -------------------------------------------------------------------------------*/
1146eHalStatus csrStop(tpAniSirGlobal pMac);
1147/* ---------------------------------------------------------------------------
1148 \fn csrReady
1149 \brief To let CSR is ready to operate
1150 \return eHalStatus
1151 -------------------------------------------------------------------------------*/
1152eHalStatus csrReady(tpAniSirGlobal pMac);
1153
1154#ifdef FEATURE_WLAN_WAPI
1155eHalStatus csrRoamGetBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pNum,
1156 tBkidCacheInfo *pBkidCache);
1157
1158
1159eHalStatus csrScanGetBKIDCandidateList(tpAniSirGlobal pMac, tANI_U32 sessionId,
1160 tBkidCandidateInfo *pBkidList, tANI_U32 *pNumItems );
1161tANI_U32 csrRoamGetNumBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId);
1162eHalStatus csrRoamSetBKIDCache( tpAniSirGlobal pMac, tANI_U32 sessionId, tBkidCacheInfo *pBKIDCache,
1163 tANI_U32 numItems );
1164/* ---------------------------------------------------------------------------
1165 \fn csrRoamGetWapiReqIE
1166 \brief return the WAPI IE CSR passes to PE to JOIN request or START_BSS request
1167 \param pLen - caller allocated memory that has the length of pBuf as input. Upon returned, *pLen has the
1168 needed or IE length in pBuf.
1169 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1170 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1171 -------------------------------------------------------------------------------*/
1172eHalStatus csrRoamGetWapiReqIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
1173
1174/* ---------------------------------------------------------------------------
1175 \fn csrRoamGetWapiRspIE
1176 \brief return the WAPI IE from the beacon or probe rsp if connected
1177 \param pLen - caller allocated memory that has the length of pBuf as input. Upon returned, *pLen has the
1178 needed or IE length in pBuf.
1179 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1180 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1181 -------------------------------------------------------------------------------*/
1182eHalStatus csrRoamGetWapiRspIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
1183tANI_U8 csrConstructWapiIe( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
1184 tSirBssDescription *pSirBssDesc, tDot11fBeaconIEs *pIes, tCsrWapiIe *pWapiIe );
1185#endif /* FEATURE_WLAN_WAPI */
1186
1187#ifdef WLAN_SOFTAP_FEATURE
1188eHalStatus csrRoamUpdateAPWPSIE( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirAPWPSIEs *pAPWPSIES );
1189eHalStatus csrRoamUpdateWPARSNIEs( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirRSNie * pAPSirRSNie);
1190#endif
1191void csrSetCfgPrivacy( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, tANI_BOOLEAN fPrivacy );
1192tANI_S8 csrGetInfraSessionId( tpAniSirGlobal pMac );
1193tANI_U8 csrGetInfraOperationChannel( tpAniSirGlobal pMac, tANI_U8 sessionId);
1194tANI_U8 csrGetConcurrentOperationChannel( tpAniSirGlobal pMac );
1195
1196eHalStatus csrRoamCopyConnectProfile(tpAniSirGlobal pMac, tANI_U32 sessionId,
1197 tCsrRoamConnectedProfile *pProfile);
1198tANI_BOOLEAN csrIsSetKeyAllowed(tpAniSirGlobal pMac, tANI_U32 sessionId);
1199
1200void csrSetOppositeBandChannelInfo( tpAniSirGlobal pMac );
1201void csrConstructCurrentValidChannelList( tpAniSirGlobal pMac, tDblLinkList *pChannelSetList,
1202 tANI_U8 *pChannelList, tANI_U8 bSize, tANI_U8 *pNumChannels );
1203
1204#endif
1205
1206#ifdef WLAN_FEATURE_VOWIFI_11R
1207//Returns whether the current association is a 11r assoc or not
1208tANI_BOOLEAN csrRoamIs11rAssoc(tpAniSirGlobal pMac);
1209#endif
1210
1211#ifdef FEATURE_WLAN_CCX
1212//Returns whether the current association is a CCX assoc or not
1213tANI_BOOLEAN csrRoamIsCCXAssoc(tpAniSirGlobal pMac);
1214#endif
1215
1216void csrDisconnectAllActiveSessions(tpAniSirGlobal pMac);
Mohit Khanna349bc392012-09-11 17:24:52 -07001217
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001218#ifdef FEATURE_WLAN_LFR
1219//Returns whether "Legacy Fast Roaming" is enabled...or not
1220tANI_BOOLEAN csrRoamIsFastRoamEnabled(tpAniSirGlobal pMac);
1221#endif
1222