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