blob: 72034f8542092f49381ff53eebb6e5a29c49a2b8 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08002 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21/*
Jeff Johnson32d95a32012-09-10 13:15:23 -070022 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -070023 *
24 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
25 *
26 *
27 * Permission to use, copy, modify, and/or distribute this software for
28 * any purpose with or without fee is hereby granted, provided that the
29 * above copyright notice and this permission notice appear in all
30 * copies.
31 *
32 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
33 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
34 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
35 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
36 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
37 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
38 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39 * PERFORMANCE OF THIS SOFTWARE.
40 */
41
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -080042/** ------------------------------------------------------------------------- *
43 ------------------------------------------------------------------------- *
Jeff Johnson295189b2012-06-20 16:38:30 -070044
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -080045
Jeff Johnson295189b2012-06-20 16:38:30 -070046 \file csrInternal.h
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -080047
Jeff Johnson295189b2012-06-20 16:38:30 -070048 Define internal data structure for MAC.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -080049
50 Copyright (C) 2006 Airgo Networks, Incorporated
Jeff Johnson295189b2012-06-20 16:38:30 -070051 ========================================================================== */
52#ifndef CSRINTERNAL_H__
53#define CSRINTERNAL_H__
54
Jeff Johnson295189b2012-06-20 16:38:30 -070055#include "vos_status.h"
56#include "vos_lock.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070057
58#include "palTimer.h"
59#include "csrSupport.h"
60#include "vos_nvitem.h"
61#include "wlan_qct_tl.h"
62
63#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
64#include "csrNeighborRoam.h"
65#endif
66
67#define CSR_MAX_STA (HAL_NUM_STA)
68
69#define CSR_SME_SCAN_FLAGS_DELETE_CACHE 0x80
70
71#define CSR_TITAN_MAX_RATE_MIMO_CB 240
72#define CSR_TITAN_MAX_RATE_MIMO 126
73
74//define scan return criteria. LIM should use these define as well
75#define CSR_SCAN_RETURN_AFTER_ALL_CHANNELS ( 0 )
76#define CSR_SCAN_RETURN_AFTER_FIRST_MATCH ( 0x01 )
77#define CSR_SCAN_RETURN_AFTER_5_BAND_11d_FOUND ( 0x80 )
78#define CSR_SCAN_RETURN_AFTER_24_BAND_11d_FOUND ( 0x40 )
79#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 )
Madan Mohan Koyyalamudi4c8c6352012-10-15 16:40:16 -070080#define CSR_NUM_RSSI_CAT 15
Jeff Johnson295189b2012-06-20 16:38:30 -070081#define CSR_MAX_STATISTICS_REQ 10
82
83//Support for multiple session
84#define CSR_SESSION_ID_INVALID 0xFF // session ID invalid
85#define CSR_ROAM_SESSION_MAX 5 // No of sessions to be supported, and a
86 // session is for Infra, IBSS or BT-AMP
87
88#define CSR_IS_SESSION_VALID( pMac, sessionId ) ( ( (sessionId) < CSR_ROAM_SESSION_MAX ) \
89 && ( (pMac)->roam.roamSession[(sessionId)].sessionActive ) )
90#define CSR_GET_SESSION( pMac, sessionId ) \
91( \
92 (sessionId < CSR_ROAM_SESSION_MAX) ? \
93 (&(pMac)->roam.roamSession[(sessionId)]) :\
94 NULL \
95)
96
Madan Mohan Koyyalamudid5026072012-11-30 14:56:21 -080097#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
98#define CSR_IS_ROAM_PREFER_5GHZ( pMac ) \
99( \
100 (((pMac)->roam.configParam.nRoamPrefer5GHz)?eANI_BOOLEAN_TRUE:eANI_BOOLEAN_FALSE) \
101)
102#endif
103
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -0700104//Support for "Fast roaming" (i.e., CCX, LFR, or 802.11r.)
105#define CSR_BG_SCAN_OCCUPIED_CHANNEL_LIST_LEN 15
Jeff Johnson295189b2012-06-20 16:38:30 -0700106
107typedef enum
108{
109 //eCSR_CFG_DOT11_MODE_BEST = 0,
110 eCSR_CFG_DOT11_MODE_TAURUS = 0,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800111 eCSR_CFG_DOT11_MODE_ABG,
112 eCSR_CFG_DOT11_MODE_11A,
113 eCSR_CFG_DOT11_MODE_11B,
114 eCSR_CFG_DOT11_MODE_11G,
115 eCSR_CFG_DOT11_MODE_11N,
116 eCSR_CFG_DOT11_MODE_POLARIS,
117 eCSR_CFG_DOT11_MODE_TITAN,
Jeff Johnsone7245742012-09-05 17:12:55 -0700118#ifdef WLAN_FEATURE_11AC
119 eCSR_CFG_DOT11_MODE_11AC,
120#endif
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800121 eCSR_CFG_DOT11_MODE_11G_ONLY,
122 eCSR_CFG_DOT11_MODE_11N_ONLY,
Jeff Johnsone7245742012-09-05 17:12:55 -0700123#ifdef WLAN_FEATURE_11AC
124 eCSR_CFG_DOT11_MODE_11AC_ONLY,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800125#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700126 //This value can never set to CFG. It is for CSR's internal use
127 eCSR_CFG_DOT11_MODE_AUTO,
128}eCsrCfgDot11Mode; //Used to determine what to set to the WNI_CFG_DOT11_MODE
129
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800130typedef enum etCsrRoamCommands
Jeff Johnson295189b2012-06-20 16:38:30 -0700131{
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800132 eCsrRoamNoCommand,
Jeff Johnson295189b2012-06-20 16:38:30 -0700133 eCsrRoamCommandScan,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800134 eCsrRoamCommandRoam,
135 eCsrRoamCommandWmStatusChange,
Jeff Johnson295189b2012-06-20 16:38:30 -0700136 eCsrRoamCommandSetKey,
137 eCsrRoamCommandRemoveKey,
138
139} eCsrRoamCommands;
140
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800141typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700142{
143 eCsrScanOther = 1,
144 eCsrScanLostLink1,
145 eCsrScanLostLink2,
146 eCsrScanLostLink3,
147 eCsrScanLostLink4,
148 eCsrScan11d1, //First 11d scan
149 eCsrScan11d2, //First 11d scan has failed
150 eCsrScan11dDone, //11d scan succeeded, try the rest of the channel
151 eCsrScanUserRequest,
152 eCsrScanGetResult,
153 eCsrScanSetBGScanParam, //used for HO too - bg scan request in NT Handoff sub-state
154 eCsrScanForSsid,
155 eCsrScanForCapsChange,
156 eCsrScanBGScanAbort,
157 eCsrScanBGScanEnable,
158 eCsrScanIdleScan,
159 eCsrScanGetScanChnInfo, //To get the list of channels scanned
160
161 eCsrScanBgScan, // bg scan request in NRT & RT Handoff sub-states
162 eCsrScanProbeBss, // directed probe on an entry from the candidate list - HO
163 eCsrScanAbortBgScan, //aborting a BG scan (meaning the scan is triggered by LIM timer)
164 eCsrScanAbortNormalScan, //aborting a normal scan (the scan is trigger by eWNI_SME_SCAN_REQ)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800165 eCsrScanP2PFindPeer
Jeff Johnson295189b2012-06-20 16:38:30 -0700166}eCsrScanReason;
167
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800168typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700169{
170 eCsrNoConnection, // Roaming because we have not established the initial connection.
171 eCsrCapsChange, // roaming because LIM reported a Capability change in the associated AP.
172 eCsrForcedDisassoc, // roaming becuase someone asked us to Disassoc and stay disassociated.
173 eCsrHddIssued, // roaming because an 802.11 request was issued to the driver.
174 eCsrLostLink1, // roaming because we lost link to an associated AP
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800175 eCsrLostLink2,
Jeff Johnson295189b2012-06-20 16:38:30 -0700176 eCsrLostLink3,
177 eCsrForcedDisassocMICFailure, // roaming because we need to force a Disassoc due to MIC failure
178 eCsrHddIssuedReassocToSameAP,
179 eCsrSmeIssuedReassocToSameAP,
180 eCsrSmeIssuedReassocToDiffAP,
181 eCsrForcedDeauth, // roaming becuase someone asked us to deauth and stay disassociated.
182 eCsrSmeIssuedDisassocForHandoff, // will be issued by Handoff logic to disconect from current AP
183 eCsrSmeIssuedAssocToSimilarAP, // will be issued by Handoff logic to join a new AP with same profile
184 eCsrSmeIssuedIbssJoinFailure, // ibss join timer fired before any perr showed up, so shut down the network
185 eCsrForcedIbssLeave,
186 eCsrStopBss,
187 eCsrSmeIssuedFTReassoc,
188 eCsrForcedDisassocSta,
189 eCsrForcedDeauthSta,
Madan Mohan Koyyalamudi286b60e2012-10-11 12:59:07 -0700190 eCsrPerformPreauth,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800191
Jeff Johnson295189b2012-06-20 16:38:30 -0700192}eCsrRoamReason;
193
194typedef enum
195{
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800196 eCSR_ROAM_SUBSTATE_NONE = 0,
197 eCSR_ROAM_SUBSTATE_START_BSS_REQ,
198 eCSR_ROAM_SUBSTATE_JOIN_REQ,
199 eCSR_ROAM_SUBSTATE_REASSOC_REQ,
200 eCSR_ROAM_SUBSTATE_DISASSOC_REQ,
201 eCSR_ROAM_SUBSTATE_STOP_BSS_REQ,
202 eCSR_ROAM_SUBSTATE_DISCONNECT_CONTINUE_ROAMING, //Continue the current roam command after disconnect
203 eCSR_ROAM_SUBSTATE_AUTH_REQ,
204 eCSR_ROAM_SUBSTATE_CONFIG,
205 eCSR_ROAM_SUBSTATE_DEAUTH_REQ,
206 eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN,
207 eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE,
208 eCSR_ROAM_SUBSTATE_DISASSOC_FORCED,
Jeff Johnson295189b2012-06-20 16:38:30 -0700209 eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY,
210 eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF,
211 eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC,
212 eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC,
213 eCSR_ROAM_SUBSTATE_JOINED_REALTIME_TRAFFIC,
214// max is 15 unless the bitfield is expanded...
215} eCsrRoamSubState;
216
217
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800218typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700219{
220 eCSR_ROAMING_STATE_STOP = 0,
221 eCSR_ROAMING_STATE_IDLE,
222 eCSR_ROAMING_STATE_SCANNING,
223 eCSR_ROAMING_STATE_JOINING,
224 eCSR_ROAMING_STATE_JOINED,
225}eCsrRoamState;
226
227
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800228typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700229{
230 eCsrContinueRoaming,
231 eCsrStopRoaming,
232 eCsrStartIbss,
233 eCsrStartIbssSameIbss,
234 eCsrReassocToSelfNoCapChange,
Jeff Johnsone7245742012-09-05 17:12:55 -0700235 eCsrStopRoamingDueToConcurrency,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800236
Jeff Johnson295189b2012-06-20 16:38:30 -0700237}eCsrJoinState;
238
239typedef enum
240{
241 eCsrNotRoaming,
242 eCsrLostlinkRoamingDisassoc,
243 eCsrLostlinkRoamingDeauth,
244 eCsrDynamicRoaming,
245 eCsrReassocRoaming,
246}eCsrRoamingReason;
247
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800248typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700249{
250 eCsrDisassociated,
251 eCsrDeauthenticated
252
253}eCsrRoamWmStatusChangeTypes;
254
255typedef enum
256{
257 eCsrSummaryStats = 0,
258 eCsrGlobalClassAStats,
259 eCsrGlobalClassBStats,
260 eCsrGlobalClassCStats,
261 eCsrGlobalClassDStats,
262 eCsrPerStaStats,
263 eCsrMaxStats
264}eCsrRoamStatsClassTypes;
265
266#ifdef FEATURE_WLAN_DIAG_SUPPORT
267typedef enum
268{
269 eCSR_WLAN_STATUS_CONNECT =0,
270 eCSR_WLAN_STATUS_DISCONNECT
271
272}eCsrDiagWlanStatusEventSubtype;
273
274typedef enum
275{
276 eCSR_REASON_UNSPECIFIED = 0,
277 eCSR_REASON_USER_REQUESTED,
278 eCSR_REASON_MIC_ERROR,
279 eCSR_REASON_DISASSOC,
280 eCSR_REASON_DEAUTH,
281 eCSR_REASON_HANDOFF,
282
283}eCsrDiagWlanStatusEventReason;
284
285typedef enum
286{
287 eCSR_WLAN_HANDOFF_EVENT =0,
288
289}eCsrDiagWlanHandoffEventSubtype;
290
291typedef enum
292{
293 eCSR_WLAN_VCC_EVENT =0,
294
295}eCsrDiagWlanVccEventSubtype;
296
297#endif //FEATURE_WLAN_DIAG_SUPPORT
298
299typedef struct tagCsrChannel
300{
301 tANI_U8 numChannels;
302 tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
303}tCsrChannel;
304
305typedef struct tagScanProfile
306{
307 tANI_U32 minChnTime;
308 tANI_U32 maxChnTime;
309 tANI_U32 restTime; //This is ignored if not associated
310 tANI_U32 numOfChannels;
311 tANI_U8 *pChannelList;
312 tSirScanType scanType; //active or passive
313 eCsrRoamBssType bssType; //BSS or IBSS
314 tANI_U8 ssid[WNI_CFG_SSID_LEN];
315 tANI_U8 bReturnAfter1stMatch;
316 tANI_U8 fUniqueResult;
317 tANI_U8 freshScan;
318 tCsrBssid bssid;
319}tScanProfile;
320
321typedef struct tagBssConfigParam
322{
323 eCsrMediaAccessType qosType;
324 tSirMacSSid SSID;
325 tANI_U32 uRTSThresh;
326 tANI_U32 uDeferThresh; //
327 eCsrCfgDot11Mode uCfgDot11Mode;
328 eCsrBand eBand;
329 tANI_U8 standardRate[CSR_DOT11_SUPPORTED_RATES_MAX];
330 tANI_U8 extendedRate[CSR_DOT11_EXTENDED_SUPPORTED_RATES_MAX];
331 eCsrExposedTxRate txRate;
332 tAniAuthType authType;
333 eCsrEncryptionType encType;
334 tANI_U32 uShortSlotTime;
335 tANI_U32 uHTSupport; //High throughput
336 tANI_U32 uPowerLimit;
337 tANI_U32 uHeartBeatThresh;
338 tANI_U32 uJoinTimeOut;
339 tSirMacCapabilityInfo BssCap;
340 tANI_BOOLEAN f11hSupport;
Jeff Johnsone7245742012-09-05 17:12:55 -0700341 ePhyChanBondState cbMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700342}tBssConfigParam;
343
344
345typedef struct tagCsrRoamStartBssParams
346{
347 tSirMacSSid ssId;
348 tCsrBssid bssid; //this is the BSSID for the party we want to join (only use for IBSS or WDS)
349 tSirNwType sirNwType;
Jeff Johnsone7245742012-09-05 17:12:55 -0700350 ePhyChanBondState cbMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700351 tSirMacRateSet operationalRateSet;
352 tSirMacRateSet extendedRateSet;
353 tANI_U8 operationChn;
354 eCsrCfgDot11Mode uCfgDot11Mode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700355 tANI_U8 privacy;
356 tANI_BOOLEAN fwdWPSPBCProbeReq;
357 tANI_BOOLEAN protEnabled;
358 tANI_BOOLEAN obssProtEnabled;
359 tAniAuthType authType;
360 tANI_U16 beaconInterval; //If this is 0, SME will fill in for caller.
361 tANI_U16 ht_protection;
362 tANI_U32 dtimPeriod;
363 tANI_U8 ApUapsdEnable;
364 tANI_U8 ssidHidden;
365 tANI_U8 wps_state;
Jeff Johnson295189b2012-06-20 16:38:30 -0700366 tVOS_CON_MODE bssPersona;
367 tANI_U16 nRSNIELength; //The byte count in the pRSNIE, if 0, pRSNIE is ignored.
368 tANI_U8 *pRSNIE; //If not null, it has the IE byte stream for RSN
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800369 tANI_BOOLEAN updatebeaconInterval; //Flag used to indicate update
370 // beaconInterval
Jeff Johnson295189b2012-06-20 16:38:30 -0700371}tCsrRoamStartBssParams;
372
373
374typedef struct tagScanCmd
375{
376 tANI_U32 scanID;
377 csrScanCompleteCallback callback;
378 void *pContext;
379 eCsrScanReason reason;
380 eCsrRoamState lastRoamState[CSR_ROAM_SESSION_MAX];
381 tCsrRoamProfile *pToRoamProfile;
382 tANI_U32 roamId; //this is the ID related to the pToRoamProfile
383 union
384 {
385 tCsrScanRequest scanRequest;
386 tCsrBGScanRequest bgScanRequest;
387 }u;
388}tScanCmd;
389
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800390typedef struct tagRoamCmd
Jeff Johnson295189b2012-06-20 16:38:30 -0700391{
392 tANI_U32 roamId;
393 eCsrRoamReason roamReason;
394 tCsrRoamProfile roamProfile;
395 tScanResultHandle hBSSList; //BSS list fits the profile
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800396 tListElem *pRoamBssEntry; //point to the current BSS in the list that is roaming. It starts from head to tail
Jeff Johnson295189b2012-06-20 16:38:30 -0700397 tSirBssDescription *pLastRoamBss; //the last BSS we try and failed
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800398 tANI_BOOLEAN fReleaseBssList; //whether to free hBSSList
Jeff Johnson295189b2012-06-20 16:38:30 -0700399 tANI_BOOLEAN fReleaseProfile; //whether to free roamProfile
400 tANI_BOOLEAN fReassoc; //whether this command is for reassociation
401 tANI_BOOLEAN fUpdateCurRoamProfile; //whether pMac->roam.pCurRoamProfile needs to be updated
402 //this is for CSR internal used only. And it should not be assigned when creating the command
403 //This causes the roam command not to do anything.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800404 tANI_BOOLEAN fReassocToSelfNoCapChange;
Jeff Johnson295189b2012-06-20 16:38:30 -0700405
406 tANI_BOOLEAN fStopWds;
407 tSirMacAddr peerMac;
408 tSirMacReasonCodes reason;
409}tRoamCmd;
410
411typedef struct tagSetKeyCmd
412{
413 tANI_U32 roamId;
414 eCsrEncryptionType encType;
415 eCsrAuthType authType;
416 tAniKeyDirection keyDirection; //Tx, Rx or Tx-and-Rx
417 tSirMacAddr peerMac; //Peer's MAC address. ALL 1's for group key
418 tANI_U8 paeRole; //0 for supplicant
419 tANI_U8 keyId; // Kye index
420 tANI_U8 keyLength; //Number of bytes containing the key in pKey
421 tANI_U8 Key[CSR_MAX_KEY_LEN];
422 tANI_U8 keyRsc[CSR_MAX_RSC_LEN];
423} tSetKeyCmd;
424
425typedef struct tahRemoveKeyCmd
426{
427 tANI_U32 roamId;
428 eCsrEncryptionType encType;
429 eCsrAuthType authType;
430 tSirMacAddr peerMac; //Peer's MAC address. ALL 1's for group key
431 tANI_U8 keyId; //key index
432} tRemoveKeyCmd;
433
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800434typedef struct tagWmStatusChangeCmd
Jeff Johnson295189b2012-06-20 16:38:30 -0700435{
436 eCsrRoamWmStatusChangeTypes Type;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800437 union
438 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700439 tSirSmeDeauthInd DeauthIndMsg;
440 tSirSmeDisassocInd DisassocIndMsg;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800441 }u;
Jeff Johnson295189b2012-06-20 16:38:30 -0700442
443}tWmStatusChangeCmd;
444
445typedef struct tagAddStaForSessionCmd
446{
447 //Session self mac addr
448 tSirMacAddr selfMacAddr;
449}tAddStaForSessionCmd;
450
451typedef struct tagDelStaForSessionCmd
452{
453 //Session self mac addr
454 tSirMacAddr selfMacAddr;
455 csrRoamSessionCloseCallback callback;
456 void *pContext;
457}tDelStaForSessionCmd;
458
459//This structure represents one scan request
460typedef struct tagCsrCmd
461{
462 tListElem Link;
463 eCsrRoamCommands command;
464 tANI_U8 sessionId; // Session ID for this command
465 union
466 {
467 tScanCmd scanCmd;
468 tRoamCmd roamCmd;
469 tWmStatusChangeCmd wmStatusChangeCmd;
470 tSetKeyCmd setKeyCmd;
471 tRemoveKeyCmd removeKeyCmd;
472 tAddStaForSessionCmd addStaSessionCmd;
473 tDelStaForSessionCmd delStaSessionCmd;
474 }u;
475}tCsrCmd;
476
477#ifdef WLAN_FEATURE_VOWIFI_11R
478typedef struct tagCsr11rConfig
479{
480 tANI_BOOLEAN IsFTResourceReqSupported;
481} tCsr11rConfig;
482#endif
483
484#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
485typedef struct tagCsrNeighborRoamConfig
486{
487 tANI_U32 nNeighborScanTimerPeriod;
488 tANI_U8 nNeighborLookupRssiThreshold;
489 tANI_U8 nNeighborReassocRssiThreshold;
490 tANI_U16 nNeighborScanMinChanTime;
491 tANI_U16 nNeighborScanMaxChanTime;
492 sCsrChannel neighborScanChanList;
493 tANI_U8 nMaxNeighborRetries;
494 tANI_U16 nNeighborResultsRefreshPeriod;
Srinivas Girigowdade697412013-02-14 16:31:48 -0800495 tANI_U16 nEmptyScanRefreshPeriod;
Jeff Johnson295189b2012-06-20 16:38:30 -0700496}tCsrNeighborRoamConfig;
497#endif
498
499typedef struct tagCsrConfig
500{
501 tANI_U32 agingCount;
502 tANI_U32 FragmentationThreshold;
503 tANI_U32 channelBondingMode24GHz;
504 tANI_U32 channelBondingMode5GHz;
505 tANI_U32 RTSThreshold;
506 eCsrPhyMode phyMode;
507 eCsrCfgDot11Mode uCfgDot11Mode;
508 eCsrBand eBand;
509 tANI_U32 HeartbeatThresh50;
510 tANI_U32 HeartbeatThresh24;
511 tANI_U32 bgScanInterval;
512 eCsrCBChoice cbChoice;
513 eCsrBand bandCapability; //indicate hw capability
514 eCsrRoamWmmUserModeType WMMSupportMode;
515 tANI_BOOLEAN Is11eSupportEnabled;
516 tANI_BOOLEAN Is11dSupportEnabled;
517 tANI_BOOLEAN Is11dSupportEnabledOriginal;
518 tANI_BOOLEAN Is11hSupportEnabled;
519 tANI_BOOLEAN shortSlotTime;
520 tANI_BOOLEAN ProprietaryRatesEnabled;
521 tANI_BOOLEAN fenableMCCMode;
522 tANI_U16 TxRate;
Madan Mohan Koyyalamudi167b95e2012-11-27 15:53:38 -0800523 tANI_U8 fAllowMCCGODiffBI;
Jeff Johnson295189b2012-06-20 16:38:30 -0700524 tANI_U8 AdHocChannel24;
525 tANI_U8 AdHocChannel5G;
526 tANI_U32 impsSleepTime; //in units of microseconds
527 tANI_U32 scanAgeTimeNCNPS; //scan result aging time threshold when Not-Connect-No-Power-Save, in seconds
528 tANI_U32 scanAgeTimeNCPS; //scan result aging time threshold when Not-Connect-Power-Save, in seconds
529 tANI_U32 scanAgeTimeCNPS; //scan result aging time threshold when Connect-No-Power-Save, in seconds,
530 tANI_U32 scanAgeTimeCPS; //scan result aging time threshold when Connect-Power-Savein seconds
531 tANI_U32 BssPreferValue[CSR_NUM_RSSI_CAT]; //each RSSI category has one value
532 int RSSICat[CSR_NUM_RSSI_CAT];
533 tANI_U8 bCatRssiOffset; //to set the RSSI difference for each category
534 tANI_U32 nRoamingTime; //In seconds, CSR will try this long before gives up, 0 means no roaming
535 //Whether to limit the channels to the ones set in Csr11dInfo. If true, the opertaional
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800536 //channels are limited to the default channel list. It is an "AND" operation between the
Jeff Johnson295189b2012-06-20 16:38:30 -0700537 //default channels and the channels in the 802.11d IE.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800538 tANI_BOOLEAN fEnforce11dChannels;
Jeff Johnson295189b2012-06-20 16:38:30 -0700539 //Country Code Priority
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800540 //0 = 802.11D > Configured Country > NV
Jeff Johnson295189b2012-06-20 16:38:30 -0700541 //1 = Configured Country > 802.11D > NV
542 tANI_BOOLEAN fSupplicantCountryCodeHasPriority;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800543 //When true, AP with unknown country code won't be see.
544 //"Unknown country code" means either Ap doesn't have 11d IE or we cannot
Jeff Johnson295189b2012-06-20 16:38:30 -0700545 //find a domain for the country code in its 11d IE.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800546 tANI_BOOLEAN fEnforceCountryCodeMatch;
Jeff Johnson295189b2012-06-20 16:38:30 -0700547 //When true, only APs in the default domain can be seen. If the Ap has "unknown country
548 //code", or the doamin of the country code doesn't match the default domain, the Ap is
549 //not acceptable.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800550 tANI_BOOLEAN fEnforceDefaultDomain;
Jeff Johnson295189b2012-06-20 16:38:30 -0700551
552 tANI_U16 vccRssiThreshold;
553 tANI_U32 vccUlMacLossThreshold;
554
555 tANI_U32 nPassiveMinChnTime; //in units of milliseconds
556 tANI_U32 nPassiveMaxChnTime; //in units of milliseconds
557 tANI_U32 nActiveMinChnTime; //in units of milliseconds
558 tANI_U32 nActiveMaxChnTime; //in units of milliseconds
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800559
560 tANI_U32 nActiveMinChnTimeBtc; //in units of milliseconds
561 tANI_U32 nActiveMaxChnTimeBtc; //in units of milliseconds
Madan Mohan Koyyalamudi4ff9cd62012-10-30 17:48:57 -0700562#ifdef WLAN_AP_STA_CONCURRENCY
563 tANI_U32 nPassiveMinChnTimeConc; //in units of milliseconds
564 tANI_U32 nPassiveMaxChnTimeConc; //in units of milliseconds
565 tANI_U32 nActiveMinChnTimeConc; //in units of milliseconds
566 tANI_U32 nActiveMaxChnTimeConc; //in units of milliseconds
567 tANI_U32 nRestTimeConc; //in units of milliseconds
Vinay Malekal05fdc812012-12-17 13:04:30 -0800568 tANI_U8 nNumChanCombinedConc; //number of channels combined
569 //in each split scan operation
Madan Mohan Koyyalamudi4ff9cd62012-10-30 17:48:57 -0700570#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700571
572 tANI_BOOLEAN IsIdleScanEnabled;
573 //in dBm, the maximum TX power
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800574 //The actual TX power is the lesser of this value and 11d.
Jeff Johnson295189b2012-06-20 16:38:30 -0700575 //If 11d is disable, the lesser of this and default setting.
576 tANI_U8 nTxPowerCap;
577 tANI_U32 statsReqPeriodicity; //stats request frequency from PE while in full power
578 tANI_U32 statsReqPeriodicityInPS;//stats request frequency from PE while in power save
Jeff Johnson295189b2012-06-20 16:38:30 -0700579 tANI_U32 dtimPeriod;
580 tANI_BOOLEAN ssidHidden;
Jeff Johnson295189b2012-06-20 16:38:30 -0700581
582#ifdef WLAN_FEATURE_VOWIFI_11R
583 tCsr11rConfig csr11rConfig;
584#endif
585
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700586#ifdef FEATURE_WLAN_LFR
587 tANI_U8 isFastRoamIniFeatureEnabled;
588#endif
589
Jeff Johnson295189b2012-06-20 16:38:30 -0700590#ifdef FEATURE_WLAN_CCX
591 tANI_U8 isCcxIniFeatureEnabled;
592#endif
593
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700594#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
Jeff Johnson295189b2012-06-20 16:38:30 -0700595 tANI_U8 isFastTransitionEnabled;
Jeff Johnson43971f52012-07-17 12:26:56 -0700596 tANI_U8 RoamRssiDiff;
Madan Mohan Koyyalamudi62b55b02012-12-03 16:45:39 -0800597 tANI_U8 nImmediateRoamRssiDiff;
Madan Mohan Koyyalamudid5026072012-11-30 14:56:21 -0800598 tANI_BOOLEAN nRoamPrefer5GHz;
Jeff Johnson295189b2012-06-20 16:38:30 -0700599#endif
600
601#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
602 tCsrNeighborRoamConfig neighborRoamConfig;
603#endif
604
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800605 /* Instead of Reassoc, send ADDTS/DELTS even when ACM is off for that AC
Jeff Johnson295189b2012-06-20 16:38:30 -0700606 * This is mandated by WMM-AC certification */
607 tANI_BOOLEAN addTSWhenACMIsOff;
608
609 tANI_BOOLEAN fValidateList;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800610 //Remove this code once SLM_Sessionization is supported
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700611 //BMPS_WORKAROUND_NOT_NEEDED
Jeff Johnsone7245742012-09-05 17:12:55 -0700612 tANI_BOOLEAN doBMPSWorkaround;
Jeff Johnson295189b2012-06-20 16:38:30 -0700613
614 //To enable/disable scanning 2.4Ghz channels twice on a single scan request from HDD
615 tANI_BOOLEAN fScanTwice;
Jeff Johnsone7245742012-09-05 17:12:55 -0700616#ifdef WLAN_FEATURE_11AC
617 tANI_U32 nVhtChannelWidth;
Shailender Karmuchi08f87c22013-01-17 12:51:24 -0800618 tANI_U8 txBFEnable;
Shailender Karmuchicc3fe442013-02-16 18:18:33 -0800619 tANI_U8 txBFCsnValue;
Jeff Johnsone7245742012-09-05 17:12:55 -0700620#endif
Gopichand Nakkalab2d2c312013-01-04 11:41:02 -0800621 tANI_U8 txLdpcEnable;
Jeff Johnson295189b2012-06-20 16:38:30 -0700622
623}tCsrConfig;
624
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800625typedef struct tagCsrChannelPowerInfo
Jeff Johnson295189b2012-06-20 16:38:30 -0700626{
627 tListElem link;
628 tANI_U8 firstChannel;
629 tANI_U8 numChannels;
630 tANI_U8 txPower;
631 tANI_U8 interChannelOffset;
632}tCsrChannelPowerInfo;
633
634typedef struct tagRoamJoinStatus
635{
636 tSirResultCodes statusCode;
637 //this is set to unspecified if statusCode indicates timeout. Or it is the failed reason from the other BSS(per 802.11 spec)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800638 tANI_U32 reasonCode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700639}tCsrRoamJoinStatus;
640
641typedef struct tagCsrOsChannelMask
642{
643 tANI_U8 numChannels;
644 tANI_BOOLEAN scanEnabled[WNI_CFG_VALID_CHANNEL_LIST_LEN];
645 tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
646}tCsrOsChannelMask;
647
648
649typedef struct tagCsrScanStruct
650{
651 tScanProfile scanProfile;
652 tANI_U32 nextScanID;
Madan Mohan Koyyalamudica43cdf2012-09-24 13:15:49 -0700653 tDblLinkList scanResultList;
Jeff Johnson295189b2012-06-20 16:38:30 -0700654 tDblLinkList tempScanResults;
655 tANI_BOOLEAN fScanEnable;
656 tANI_BOOLEAN fFullScanIssued;
657 tPalTimerHandle hTimerGetResult;
658#ifdef WLAN_AP_STA_CONCURRENCY
659 tPalTimerHandle hTimerStaApConcTimer;
660#endif
661 tPalTimerHandle hTimerIdleScan;
662 tPalTimerHandle hTimerResultAging;
Sandeep Puligilla2b6dc632012-12-17 14:44:16 -0800663 tPalTimerHandle hTimerResultCfgAging;
Jeff Johnson295189b2012-06-20 16:38:30 -0700664 tPalTimerHandle hTimerBgScan;
665 //changes on every scan, it is used as a flag for whether 11d info is found on every scan
Sandeep Puligilla2b6dc632012-12-17 14:44:16 -0800666 tANI_U8 channelOf11dInfo;
667 tANI_U8 scanResultCfgAgingTime;
Jeff Johnson295189b2012-06-20 16:38:30 -0700668 //changes on every scan, a flag to tell whether conflict 11d info found on each BSS
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800669 tANI_BOOLEAN fAmbiguous11dInfoFound;
Jeff Johnson295189b2012-06-20 16:38:30 -0700670 //Tush: changes on every scan, a flag to tell whether the applied 11d info present in one of the scan results
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800671 tANI_BOOLEAN fCurrent11dInfoMatch;
Jeff Johnson295189b2012-06-20 16:38:30 -0700672 tANI_BOOLEAN f11dInfoReset; //to indicate whether the 11d info in CFG is reset to default
673 tSirScanType curScanType;
674 tCsrChannel baseChannels; //This are all the supported channels AND(&) to the current eBand
675 tCsrChannel channels11d;
676 tChannelListWithPower defaultPowerTable[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
677 tChannelListWithPower defaultPowerTable40MHz[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
678 tANI_U32 numChannelsDefault; //total channels of NV
679 tCsrChannel base20MHzChannels; //The channel base to work on
680 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
681 tDblLinkList channelPowerInfoList24;
682 tDblLinkList channelPowerInfoList5G;
683 tANI_U32 nLastAgeTimeOut;
684 tANI_U32 nAgingCountDown;
685 tANI_U8 countryCodeDefault[WNI_CFG_COUNTRY_CODE_LEN+1]; //The country code from NV
686 tANI_U8 countryCodeCurrent[WNI_CFG_COUNTRY_CODE_LEN+1];
687 tANI_U8 countryCode11d[WNI_CFG_COUNTRY_CODE_LEN+1];
688 v_REGDOMAIN_t domainIdDefault; //default regulatory domain
689 v_REGDOMAIN_t domainIdCurrent; //current regulatory domain
690 tANI_BOOLEAN f11dInfoApplied;
691 tANI_BOOLEAN fCancelIdleScan;
692#ifdef FEATURE_WLAN_WAPI
693// tANI_U16 NumBkidCandidate;
694// tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED]; /* Move this as part of SessionEntry */
695#endif /* FEATURE_WLAN_WAPI */
696 tANI_U8 numBGScanChannel; //number of valid channels in the bgScanChannelList
697 tANI_U8 bgScanChannelList[WNI_CFG_BG_SCAN_CHANNEL_LIST_LEN];
698 //the ChannelInfo member is not used in this structure.
699 //numBGScanChannel and bgScanChannelList are used for the BG scan channel info
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800700 tCsrBGScanRequest bgScanParams;
Jeff Johnson295189b2012-06-20 16:38:30 -0700701 tANI_BOOLEAN fRestartIdleScan;
702 tANI_U32 nIdleScanTimeGap; //the time since last trying to trigger idle scan
703 tCsrOsChannelMask osScanChannelMask;//keep a track of channels to be scnned while in traffic condition
704 tANI_U16 nBssLimit; //the maximum number of BSS in scan cache
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800705 /*channelPowerInfoList24 has been seen corrupted. Set this flag to true trying to
Jeff Johnson295189b2012-06-20 16:38:30 -0700706 * detect when it happens. Adding this into code because we can't reproduce it easily.
707 * We don't know when it happens. */
708 tANI_BOOLEAN fValidateList;
709 /*Customer wants to start with an active scan based on the default country code.
710 * This optimization will minimize the driver load to association time.
711 * Based on this flag we will bypass the initial passive scan needed for 11d
712 * to determine the country code & domain */
713 tANI_BOOLEAN fEnableBypass11d;
714
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800715 /*Customer wants to optimize the scan time. Avoiding scans(passive) on DFS
716 * channels while swipping through both bands can save some time
Jeff Johnson295189b2012-06-20 16:38:30 -0700717 * (apprx 1.3 sec) */
718 tANI_BOOLEAN fEnableDFSChnlScan;
719
Jeff Johnsone7245742012-09-05 17:12:55 -0700720 /*
721 * To enable/disable scanning only 2.4Ghz channels on first scan
722 */
723 tANI_BOOLEAN fFirstScanOnly2GChnl;
724
Jeff Johnson295189b2012-06-20 16:38:30 -0700725 tANI_BOOLEAN fDropScanCmd; //true means we don't accept scan commands
726
727#ifdef WLAN_AP_STA_CONCURRENCY
728 tDblLinkList scanCmdPendingList;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800729#endif
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -0700730 tCsrChannel occupiedChannels; //This includes all channels on which candidate APs are found
Madan Mohan Koyyalamudi3f65e312012-11-06 15:31:12 -0800731
732 tANI_BOOLEAN fIgnore_chan165;
Jeff Johnson295189b2012-06-20 16:38:30 -0700733}tCsrScanStruct;
734
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800735#ifdef FEATURE_WLAN_TDLS_INTERNAL
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800736/*
737 * struct to carry TDLS discovery info..
738 */
739typedef struct sCsrTdlsContext
740{
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800741 tDblLinkList tdlsPotentialPeerList ;
742 tANI_U16 tdlsCommonFlag ;
743 tANI_U16 tdlsCommonState ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800744 tANI_U16 tdlsPeerCount ;
745}tCsrTdlsCtxStruct;
746
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800747typedef struct sCsrTdlsPeerLinkInfo
748{
749 tListElem tdlsPeerStaLink ;
750 tSirTdlsPeerInfo tdlsDisPeerInfo ;
751}tCsrTdlsPeerLinkinfo ;
752#endif
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800753
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800754
755
Jeff Johnson295189b2012-06-20 16:38:30 -0700756
757//Save the connected information. This structure + connectedProfile
758//should contain all information about the connection
759typedef struct tagRoamCsrConnectedInfo
760{
761 tANI_U32 nBeaconLength; //the length, in bytes, of the beacon frame, can be 0
762 tANI_U32 nAssocReqLength; //the length, in bytes, of the assoc req frame, can be 0
763 tANI_U32 nAssocRspLength; //The length, in bytes, of the assoc rsp frame, can be 0
764#ifdef WLAN_FEATURE_VOWIFI_11R
765 tANI_U32 nRICRspLength; //Length of the parsed RIC response IEs received in reassoc response
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800766#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700767#ifdef FEATURE_WLAN_CCX
768 tANI_U32 nTspecIeLength;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800769#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700770 tANI_U8 *pbFrames; //Point to a buffer contain the beacon, assoc req, assoc rsp frame, in that order
771 //user needs to use nBeaconLength, nAssocReqLength, nAssocRspLength to desice where
772 //each frame starts and ends.
773 tANI_U8 staId;
774}tCsrRoamConnectedInfo;
775
776
777typedef struct tagCsrLinkQualityIndInfo
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800778{
Jeff Johnson295189b2012-06-20 16:38:30 -0700779 csrRoamLinkQualityIndCallback callback;
780 void *context;
781}tCsrLinkQualityIndInfo;
782
783typedef struct tagCsrPeStatsReqInfo
784{
785 tListElem link; /* list links */
786 tANI_U32 statsMask;
787 tANI_U32 periodicity;
788 tANI_BOOLEAN rspPending;
789 vos_timer_t hPeStatsTimer;
790 tANI_BOOLEAN timerRunning;
791 tANI_U8 staId;
792 tANI_U8 numClient;
793 tpAniSirGlobal pMac;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800794 /* To remember if the peStats timer is stopped successfully or not */
Jeff Johnson295189b2012-06-20 16:38:30 -0700795 tANI_BOOLEAN timerStopFailed;
796
797}tCsrPeStatsReqInfo;
798
799typedef struct tagCsrStatsClientReqInfo
800{
801 tListElem link; /* list links */
802 eCsrStatsRequesterType requesterId;
803 tCsrStatsCallback callback;
804 tANI_U32 periodicity;
805 void *pContext;
806 tANI_U32 statsMask;
807 tCsrPeStatsReqInfo *pPeStaEntry;
808 tANI_U8 staId;
809 vos_timer_t timer;
810 tANI_BOOLEAN timerExpired;
811 tpAniSirGlobal pMac; // TODO: Confirm this change BTAMP
812}tCsrStatsClientReqInfo;
813
814typedef struct tagCsrTlStatsReqInfo
815{
816 tANI_U32 periodicity;
817 tANI_BOOLEAN timerRunning;
818 tPalTimerHandle hTlStatsTimer;
819 tANI_U8 numClient;
820}tCsrTlStatsReqInfo;
821
822typedef struct tagCsrRoamSession
823{
824 tANI_U8 sessionId; // Session ID
825 tANI_BOOLEAN sessionActive; // TRUE if it is used
826 tCsrBssid selfMacAddr; // For BT-AMP station, this serve as BSSID for self-BSS.
827 csrRoamCompleteCallback callback;
828 void *pContext;
829 eCsrConnectState connectState;
830 tCsrRoamConnectedProfile connectedProfile;
831 tCsrRoamConnectedInfo connectedInfo;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800832 tCsrRoamProfile *pCurRoamProfile;
Jeff Johnson295189b2012-06-20 16:38:30 -0700833 tSirBssDescription *pConnectBssDesc;
834 tANI_U16 NumPmkidCache;
835 tPmkidCacheInfo PmkidCacheInfo[CSR_MAX_PMKID_ALLOWED];
836 tANI_U8 cJoinAttemps;
837 //This may or may not have the up-to-date valid channel list
838 //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
839 tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
840 tANI_S32 sPendingCommands; //0 means CSR is ok to low power
841#ifdef FEATURE_WLAN_WAPI
842 tANI_U16 NumBkidCache;
843 tBkidCacheInfo BkidCacheInfo[CSR_MAX_BKID_ALLOWED];
844#endif /* FEATURE_WLAN_WAPI */
845 tANI_BOOLEAN fRoaming; //indicate whether CSR is roaming (either via lostlink or dynamic roaming)
846 //to remember some parameters needed for START_BSS.
847 //All member must be set every time we try to join or start an IBSS or BT-AMP
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800848 tCsrRoamStartBssParams bssParams;
Jeff Johnson295189b2012-06-20 16:38:30 -0700849 tANI_U32 nWpaRsnReqIeLength; //the byte count of pWpaRsnIE;
850 tANI_U8 *pWpaRsnReqIE; //this contain the WPA/RSN IE in assoc request or the one sent in beacon (IBSS)
851 tANI_U32 nWpaRsnRspIeLength; //the byte count for pWpaRsnRspIE
852 tANI_U8 *pWpaRsnRspIE; //this contain the WPA/RSN IE in beacon/probe rsp
853#ifdef FEATURE_WLAN_WAPI
854 tANI_U32 nWapiReqIeLength; //the byte count of pWapiReqIE;
855 tANI_U8 *pWapiReqIE; //this contain the WAPI IE in assoc request or the one sent in beacon (IBSS)
856 tANI_U32 nWapiRspIeLength; //the byte count for pWapiRspIE
857 tANI_U8 *pWapiRspIE; //this contain the WAPI IE in beacon/probe rsp
858#endif /* FEATURE_WLAN_WAPI */
859 tANI_U32 nAddIEScanLength; //the byte count of pAddIeScanIE;
860 tANI_U8 *pAddIEScan; //this contains the additional IE in (unicast) probe request at the time of join
861 tANI_U32 nAddIEAssocLength; //the byte count for pAddIeAssocIE
862 tANI_U8 *pAddIEAssoc; //this contains the additional IE in (re) assoc request
863
864 tANI_TIMESTAMP roamingStartTime; //in units of 10ms
865 tCsrTimerInfo roamingTimerInfo;
866 eCsrRoamingReason roamingReason;
867 tANI_BOOLEAN fCancelRoaming;
868 tPalTimerHandle hTimerRoaming;
869 tPalTimerHandle hTimerIbssJoining;
870 tCsrTimerInfo ibssJoinTimerInfo;
871 tANI_BOOLEAN ibss_join_pending;
872 eCsrRoamResult roamResult; //the roamResult that is used when the roaming timer fires
873 tCsrRoamJoinStatus joinFailStatusCode; //This is the reason code for join(assoc) failure
874 //The status code returned from PE for deauth or disassoc (in case of lostlink), or our own dynamic roaming
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800875 tANI_U32 roamingStatusCode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700876 tANI_U16 NumPmkidCandidate;
877 tPmkidCandidateInfo PmkidCandidateInfo[CSR_MAX_PMKID_ALLOWED];
878 #ifdef FEATURE_WLAN_WAPI
879 tANI_U16 NumBkidCandidate;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800880 tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED];
Jeff Johnson295189b2012-06-20 16:38:30 -0700881#endif
882 tANI_BOOLEAN fWMMConnection;
883#ifdef FEATURE_WLAN_BTAMP_UT_RF
884 //To retry a join later when it fails if so desired
885 tPalTimerHandle hTimerJoinRetry;
886 tCsrTimerInfo joinRetryTimerInfo;
887 tANI_U32 maxRetryCount;
888#endif
889#ifdef FEATURE_WLAN_CCX
890 tCsrCcxCckmInfo ccxCckmInfo;
891 tANI_BOOLEAN isPrevApInfoValid;
892 tSirMacSSid prevApSSID;
893 tCsrBssid prevApBssid;
894 tANI_U8 prevOpChannel;
895 tANI_U16 clientDissSecs;
896 tANI_U32 roamTS1;
897#endif
898 tANI_U8 bRefAssocStartCnt; //Tracking assoc start indication
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800899 /* to force the AP initiate fresh 802.1x authentication after re-association need to clear
Madan Mohan Koyyalamudiea22cdc2012-10-18 21:02:23 -0700900 * the PMKID cache. To clear the cache in this particular case this is added
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800901 * it is needed by the HS 2.0 passpoint certification 5.2.a and b testcases */
Madan Mohan Koyyalamudiea22cdc2012-10-18 21:02:23 -0700902 tANI_BOOLEAN fIgnorePMKIDCache;
Jeff Johnson295189b2012-06-20 16:38:30 -0700903} tCsrRoamSession;
904
905typedef struct tagCsrRoamStruct
906{
907 tANI_U32 nextRoamId;
908 tDblLinkList roamCmdPendingList;
909 tDblLinkList channelList5G;
910 tDblLinkList channelList24;
911 tCsrConfig configParam;
912 tANI_U32 numChannelsEeprom; //total channels of eeprom
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800913 tCsrChannel base20MHzChannels; //The channel base to work on
914 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
915 eCsrRoamState curState[CSR_ROAM_SESSION_MAX];
Jeff Johnson295189b2012-06-20 16:38:30 -0700916 eCsrRoamSubState curSubState[CSR_ROAM_SESSION_MAX];
917 //This may or may not have the up-to-date valid channel list
918 //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
919 tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
920 tANI_U32 numValidChannels; //total number of channels in CFG
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800921
Jeff Johnson295189b2012-06-20 16:38:30 -0700922 tANI_S32 sPendingCommands;
Jeff Johnson295189b2012-06-20 16:38:30 -0700923 tPalTimerHandle hTimerWaitForKey; //To support timeout for WaitForKey state
924 tCsrSummaryStatsInfo summaryStatsInfo;
925 tCsrGlobalClassAStatsInfo classAStatsInfo;
926 tCsrGlobalClassBStatsInfo classBStatsInfo;
927 tCsrGlobalClassCStatsInfo classCStatsInfo;
928 tCsrGlobalClassDStatsInfo classDStatsInfo;
929 tCsrPerStaStatsInfo perStaStatsInfo[CSR_MAX_STA];
930 tDblLinkList statsClientReqList;
931 tDblLinkList peStatsReqList;
932 tCsrTlStatsReqInfo tlStatsReqInfo;
933 eCsrRoamLinkQualityInd vccLinkQuality;
934 tCsrLinkQualityIndInfo linkQualityIndInfo;
935 v_CONTEXT_t gVosContext; //used for interaction with TL
936 //To specify whether an association or a IBSS is WMM enabled
937 //This parameter is only valid during a join or start BSS command is being executed
938 //tANI_BOOLEAN fWMMConnection; /* Moving it to be part of roamsession */
939 v_U8_t ucACWeights[WLANTL_MAX_AC];
940 /* TODO : Upto here */
941 tCsrTimerInfo WaitForKeyTimerInfo;
942 tCsrRoamSession *roamSession;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800943 tANI_U32 transactionId; // Current transaction ID for internal use.
944#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
Jeff Johnson295189b2012-06-20 16:38:30 -0700945 tCsrNeighborRoamControlInfo neighborRoamInfo;
946#endif
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700947#ifdef FEATURE_WLAN_LFR
948 tANI_U8 isFastRoamIniFeatureEnabled;
949#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700950#ifdef FEATURE_WLAN_CCX
951 tANI_U8 isCcxIniFeatureEnabled;
952#endif
Jeff Johnson43971f52012-07-17 12:26:56 -0700953#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
954 tANI_U8 RoamRssiDiff;
955#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700956}tCsrRoamStruct;
957
958
959#define GET_NEXT_ROAM_ID(pRoamStruct) (((pRoamStruct)->nextRoamId + 1 == 0) ? 1 : (pRoamStruct)->nextRoamId)
960#define CSR_IS_ROAM_STATE(pMac, state, sessionId) ( (state) == (pMac)->roam.curState[sessionId] )
961
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800962#define CSR_IS_ROAM_STOP(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_STOP, sessionId )
963#define CSR_IS_ROAM_INIT(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_INIT, sessionId )
Jeff Johnson295189b2012-06-20 16:38:30 -0700964#define CSR_IS_ROAM_SCANNING(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_SCANNING, sessionId )
965#define CSR_IS_ROAM_JOINING(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_JOINING, sessionId )
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800966#define CSR_IS_ROAM_IDLE(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_IDLE, sessionId )
Jeff Johnson295189b2012-06-20 16:38:30 -0700967#define CSR_IS_ROAM_JOINED(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_JOINED, sessionId )
968
969#define CSR_IS_ROAM_SUBSTATE(pMac, subState, sessionId) ((subState) == (pMac)->roam.curSubState[sessionId])
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800970#define CSR_IS_ROAM_SUBSTATE_JOIN_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOIN_REQ, sessionId)
971#define CSR_IS_ROAM_SUBSTATE_AUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_AUTH_REQ, sessionId)
972#define CSR_IS_ROAM_SUBSTATE_REASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_REASSOC_REQ, sessionId)
973#define CSR_IS_ROAM_SUBSTATE_DISASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REQ, sessionId)
974#define CSR_IS_ROAM_SUBSTATE_DISASSOC_NO_JOIN(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN, sessionId)
975#define CSR_IS_ROAM_SUBSTATE_REASSOC_FAIL(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE, sessionId)
976#define CSR_IS_ROAM_SUBSTATE_DISASSOC_FORCED(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_FORCED, sessionId)
977#define CSR_IS_ROAM_SUBSTATE_DEAUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DEAUTH_REQ, sessionId)
978#define CSR_IS_ROAM_SUBSTATE_START_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_START_BSS_REQ, sessionId)
979#define CSR_IS_ROAM_SUBSTATE_STOP_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_STOP_BSS_REQ, sessionId)
980#define CSR_IS_ROAM_SUBSTATE_DISCONNECT_CONTINUE(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISCONNECT_CONTINUE_ROAMING, sessionId)
Jeff Johnson295189b2012-06-20 16:38:30 -0700981#define CSR_IS_ROAM_SUBSTATE_CONFIG(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_CONFIG, sessionId)
982#define CSR_IS_ROAM_SUBSTATE_WAITFORKEY(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY, sessionId)
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800983#define CSR_IS_ROAM_SUBSTATE_DISASSOC_HO(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF, sessionId)
984#define CSR_IS_ROAM_SUBSTATE_HO_NT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC, sessionId)
985#define CSR_IS_ROAM_SUBSTATE_HO_NRT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC, sessionId)
986#define CSR_IS_ROAM_SUBSTATE_HO_RT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_REALTIME_TRAFFIC, sessionId)
Jeff Johnson295189b2012-06-20 16:38:30 -0700987
988#define CSR_IS_PHY_MODE_B_ONLY(pMac) \
989 ((eCSR_DOT11_MODE_11b == (pMac)->roam.configParam.phyMode) ||\
990 (eCSR_DOT11_MODE_11b_ONLY == (pMac)->roam.configParam.phyMode))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800991
Jeff Johnson295189b2012-06-20 16:38:30 -0700992#define CSR_IS_PHY_MODE_G_ONLY(pMac) \
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800993 (eCSR_DOT11_MODE_11g == (pMac)->roam.configParam.phyMode || eCSR_DOT11_MODE_11g_ONLY == (pMac)->roam.configParam.phyMode)
994
Jeff Johnson295189b2012-06-20 16:38:30 -0700995#define CSR_IS_PHY_MODE_A_ONLY(pMac) \
996 ((eCSR_DOT11_MODE_11a == (pMac)->roam.configParam.phyMode) ||\
997 (eCSR_DOT11_MODE_11a_ONLY == (pMac)->roam.configParam.phyMode))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800998
Jeff Johnsone7245742012-09-05 17:12:55 -0700999#ifdef WLAN_FEATURE_11AC
1000#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
1001 ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
1002 (eCSR_DOT11_MODE_11ac & (phyMode)) || \
1003 (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
1004 (eCSR_DOT11_MODE_AUTO & (phyMode)))
1005#else
Jeff Johnson295189b2012-06-20 16:38:30 -07001006#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
1007 ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
1008 (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
1009 (eCSR_DOT11_MODE_AUTO & (phyMode)))
Jeff Johnsone7245742012-09-05 17:12:55 -07001010#endif
1011
Jeff Johnson295189b2012-06-20 16:38:30 -07001012
1013// this function returns TRUE if the NIC is operating exclusively in the 2.4 GHz band, meaning
1014// it is NOT operating in the 5.0 GHz band.
1015#define CSR_IS_24_BAND_ONLY(pMac) \
1016 (eCSR_BAND_24 == (pMac)->roam.configParam.eBand)
1017
1018#define CSR_IS_5G_BAND_ONLY(pMac) \
1019 (eCSR_BAND_5G == (pMac)->roam.configParam.eBand)
1020
1021#define CSR_IS_RADIO_DUAL_BAND(pMac) \
1022 (eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability)
1023
1024#define CSR_IS_RADIO_BG_ONLY(pMac) \
1025 (eCSR_BAND_24 == (pMac)->roam.configParam.bandCapability)
1026
1027// this function returns TRUE if the NIC is operating exclusively in the 5.0 GHz band, meaning
1028// it is NOT operating in the 2.4 GHz band
1029#define CSR_IS_RADIO_A_ONLY(pMac) \
1030 (eCSR_BAND_5G == (pMac)->roam.configParam.bandCapability)
1031
1032// this function returns TRUE if the NIC is operating in both bands.
1033#define CSR_IS_OPEARTING_DUAL_BAND(pMac) \
1034 ((eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability) && (eCSR_BAND_ALL == (pMac)->roam.configParam.eBand))
1035
1036// this function returns TRUE if the NIC can operate in the 5.0 GHz band (could operate in the
1037// 2.4 GHz band also).
1038#define CSR_IS_OPERATING_A_BAND(pMac) \
1039 (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_A_ONLY((pMac)) || CSR_IS_5G_BAND_ONLY((pMac)))
1040
1041// this function returns TRUE if the NIC can operate in the 2.4 GHz band (could operate in the
1042// 5.0 GHz band also).
1043#define CSR_IS_OPERATING_BG_BAND(pMac) \
1044 (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_BG_ONLY((pMac)) || CSR_IS_24_BAND_ONLY((pMac)))
1045
1046#define CSR_IS_CHANNEL_5GHZ(chnNum) \
Jeff Johnsone7245742012-09-05 17:12:55 -07001047 (((chnNum) >= CSR_MIN_5GHz_CHANNEL_NUMBER) && ((chnNum) <= CSR_MAX_5GHz_CHANNEL_NUMBER))
Jeff Johnson295189b2012-06-20 16:38:30 -07001048
Srinivas Girigowdade697412013-02-14 16:31:48 -08001049#define CSR_IS_CHANNEL_DFS(chnNum) \
1050 (NV_CHANNEL_ENABLE != vos_nv_getChannelEnabledState(chnNum))
1051
Jeff Johnson295189b2012-06-20 16:38:30 -07001052#define CSR_IS_CHANNEL_24GHZ(chnNum) \
1053 (((chnNum) > 0) && ((chnNum) <= CSR_MAX_24GHz_CHANNEL_NUMBER))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001054
Jeff Johnson295189b2012-06-20 16:38:30 -07001055#define CSR_IS_SAME_BAND_CHANNELS(ch1, ch2) (CSR_IS_CHANNEL_5GHZ(ch1) == CSR_IS_CHANNEL_5GHZ(ch2))
1056
1057
1058#define CSR_IS_11D_INFO_FOUND(pMac) \
1059 (0 != (pMac)->scan.channelOf11dInfo)
1060// DEAUTHIND
1061#define CSR_IS_ROAMING(pSession) ((CSR_IS_LOSTLINK_ROAMING((pSession)->roamingReason)) || \
1062 (eCsrDynamicRoaming == (pSession)->roamingReason) || \
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001063 (eCsrReassocRoaming == (pSession)->roamingReason))
Jeff Johnson295189b2012-06-20 16:38:30 -07001064
1065
1066#define CSR_IS_SET_KEY_COMMAND( pCommand ) ( eSmeCommandSetKey == (pCommand)->command )
1067
1068#define CSR_IS_ADDTS_WHEN_ACMOFF_SUPPORTED(pMac) (pMac->roam.configParam.addTSWhenACMIsOff)
1069// DEAUTHIND
1070#define CSR_IS_LOSTLINK_ROAMING(reason) ((eCsrLostlinkRoamingDisassoc == (reason)) || (eCsrLostlinkRoamingDeauth == (reason)))
1071
1072//Stop CSR from asking for IMPS, This function doesn't disable IMPS from CSR
1073void csrScanSuspendIMPS( tpAniSirGlobal pMac );
1074//Start CSR from asking for IMPS. This function doesn't trigger CSR to request entering IMPS
1075//because IMPS maybe disabled.
1076void csrScanResumeIMPS( tpAniSirGlobal pMac );
1077
1078eHalStatus csrInitGetChannels(tpAniSirGlobal pMac);
Venkata Prathyusha Kuntupalli9778fb32013-02-26 22:16:52 -08001079// Getting the 5GHz Channel list
1080eHalStatus csrGet5GChannels(tpAniSirGlobal pMac) ;
Jeff Johnson295189b2012-06-20 16:38:30 -07001081
1082eHalStatus csrSetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1083 tCsrRoamModifyProfileFields *pModifyProfileFields);
1084/* ---------------------------------------------------------------------------
1085 \fn csrGetModifyProfileFields
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001086 \brief HDD or SME - QOS calls this function to get the current values of
Jeff Johnson295189b2012-06-20 16:38:30 -07001087 connected profile fields changing which can cause reassoc.
1088 This function must be called after CFG is downloaded and STA is in connected
1089 state.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001090 \param pModifyProfileFields - pointer to the connected profile fields
Jeff Johnson295189b2012-06-20 16:38:30 -07001091 changing which can cause reassoc
1092
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001093 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001094 -------------------------------------------------------------------------------*/
1095eHalStatus csrGetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1096 tCsrRoamModifyProfileFields * pModifyProfileFields);
1097void csrSetGlobalCfgs( tpAniSirGlobal pMac );
1098void csrSetDefaultDot11Mode( tpAniSirGlobal pMac );
1099void csrScanSetChannelMask(tpAniSirGlobal pMac, tCsrChannelInfo *pChannelInfo);
1100tANI_BOOLEAN csrIsConnStateDisconnected(tpAniSirGlobal pMac, tANI_U32 sessionId);
1101tANI_BOOLEAN csrIsConnStateConnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1102tANI_BOOLEAN csrIsConnStateDisconnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1103tANI_BOOLEAN csrIsConnStateConnectedInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1104tANI_BOOLEAN csrIsConnStateConnected( tpAniSirGlobal pMac, tANI_U32 sessionId );
1105tANI_BOOLEAN csrIsConnStateInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1106tANI_BOOLEAN csrIsConnStateIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1107tANI_BOOLEAN csrIsConnStateWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1108tANI_BOOLEAN csrIsConnStateConnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1109tANI_BOOLEAN csrIsConnStateDisconnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1110tANI_BOOLEAN csrIsAnySessionInConnectState( tpAniSirGlobal pMac );
1111tANI_BOOLEAN csrIsAllSessionDisconnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudi48081ef2012-12-04 16:49:55 -08001112tANI_BOOLEAN csrIsStaSessionConnected( tpAniSirGlobal pMac );
1113tANI_BOOLEAN csrIsP2pSessionConnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudid3d22592012-09-24 14:01:29 -07001114tANI_BOOLEAN csrIsAnySessionConnected( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001115tANI_BOOLEAN csrIsInfraConnected( tpAniSirGlobal pMac );
1116tANI_BOOLEAN csrIsConcurrentInfraConnected( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001117tANI_BOOLEAN csrIsConcurrentSessionRunning( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001118tANI_BOOLEAN csrIsInfraApStarted( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001119tANI_BOOLEAN csrIsIBSSStarted( tpAniSirGlobal pMac );
1120tANI_BOOLEAN csrIsBTAMPStarted( tpAniSirGlobal pMac );
1121tANI_BOOLEAN csrIsBTAMP( tpAniSirGlobal pMac, tANI_U32 sessionId );
1122eHalStatus csrIsBTAMPAllowed( tpAniSirGlobal pMac, tANI_U32 chnId );
Jeff Johnsone7245742012-09-05 17:12:55 -07001123tANI_BOOLEAN csrIsValidMcConcurrentSession(tpAniSirGlobal pMac, tANI_U32 sessionId,
1124 tSirBssDescription *pBssDesc);
Jeff Johnson295189b2012-06-20 16:38:30 -07001125tANI_BOOLEAN csrIsConnStateConnectedInfraAp( tpAniSirGlobal pMac, tANI_U32 sessionId );
Jeff Johnson295189b2012-06-20 16:38:30 -07001126/*----------------------------------------------------------------------------
1127 \fn csrRoamRegisterLinkQualityIndCallback
1128
1129 \brief
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001130 a CSR function to allow HDD to register a callback handler with CSR for
1131 link quality indications.
Jeff Johnson295189b2012-06-20 16:38:30 -07001132
1133 Only one callback may be registered at any time.
1134 In order to deregister the callback, a NULL cback may be provided.
1135
1136 Registration happens in the task context of the caller.
1137
1138 \param callback - Call back being registered
1139 \param pContext - user data
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001140
Jeff Johnson295189b2012-06-20 16:38:30 -07001141 DEPENDENCIES: After CSR open
1142
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001143 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001144-----------------------------------------------------------------------------*/
1145eHalStatus csrRoamRegisterLinkQualityIndCallback(tpAniSirGlobal pMac,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001146 csrRoamLinkQualityIndCallback callback,
Jeff Johnson295189b2012-06-20 16:38:30 -07001147 void *pContext);
1148/* ---------------------------------------------------------------------------
1149 \fn csrGetStatistics
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001150 \brief csr function that client calls to register a callback to get
1151 different PHY level statistics from CSR.
1152
Jeff Johnson295189b2012-06-20 16:38:30 -07001153 \param requesterId - different client requesting for statistics, HDD, UMA/GAN etc
1154 \param statsMask - The different category/categories of stats requester is looking for
1155 \param callback - SME sends back the requested stats using the callback
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001156 \param periodicity - If requester needs periodic update, 0 means it's an one
Jeff Johnson295189b2012-06-20 16:38:30 -07001157 time request
1158 \param cache - If requester is happy with cached stats
1159 \param staId - The station ID for which the stats is requested for
1160 \param pContext - user context to be passed back along with the callback
1161
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001162 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001163 ---------------------------------------------------------------------------*/
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001164eHalStatus csrGetStatistics(tpAniSirGlobal pMac, eCsrStatsRequesterType requesterId,
1165 tANI_U32 statsMask,
1166 tCsrStatsCallback callback,
1167 tANI_U32 periodicity, tANI_BOOLEAN cache,
Jeff Johnson295189b2012-06-20 16:38:30 -07001168 tANI_U8 staId, void *pContext);
1169
1170
1171eHalStatus csrGetRssi(tpAniSirGlobal pMac,tCsrRssiCallback callback,tANI_U8 staId,tCsrBssid bssId,void * pContext,void * pVosContext);
Srinivas Girigowdad34cedb2013-01-25 13:33:11 -08001172#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
1173eHalStatus csrGetRoamRssi(tpAniSirGlobal pMac,
1174 tCsrRssiCallback callback,
1175 tANI_U8 staId,
1176 tCsrBssid bssId,
1177 void * pContext,
1178 void * pVosContext);
1179#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001180eHalStatus csrRoamRegisterCallback(tpAniSirGlobal pMac, csrRoamCompleteCallback callback, void *pContext);
1181/* ---------------------------------------------------------------------------
1182 \fn csrGetConfigParam
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001183 \brief HDD calls this function to get the global settings currently maintained by CSR.
Jeff Johnson295189b2012-06-20 16:38:30 -07001184 \param pParam - caller allocated memory
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001185 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001186 -------------------------------------------------------------------------------*/
1187eHalStatus csrGetConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1188
1189/* ---------------------------------------------------------------------------
1190 \fn csrMsgProcessor
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001191 \brief HDD calls this function to change some global settings.
Jeff Johnson295189b2012-06-20 16:38:30 -07001192 caller must set the all fields or call csrGetConfigParam to prefill the fields.
1193 \param pParam - caller allocated memory
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001194 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001195 -------------------------------------------------------------------------------*/
1196eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1197
1198
1199/* ---------------------------------------------------------------------------
1200 \fn csrMsgProcessor
1201 \brief HDD calls this function for the messages that are handled by CSR.
1202 \param pMsgBuf - a pointer to a buffer that maps to various structures base on the message type.
1203 The beginning of the buffer can always map to tSirSmeRsp.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001204 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001205 -------------------------------------------------------------------------------*/
1206eHalStatus csrMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf );
1207
1208/* ---------------------------------------------------------------------------
1209 \fn csrOpen
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001210 \brief This function must be called before any API call to CSR.
1211 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001212 -------------------------------------------------------------------------------*/
1213eHalStatus csrOpen(tpAniSirGlobal pMac);
1214/* ---------------------------------------------------------------------------
1215 \fn csrClose
1216 \brief To close down CSR module. There should not be any API call into CSR after calling this function.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001217 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001218 -------------------------------------------------------------------------------*/
1219eHalStatus csrClose(tpAniSirGlobal pMac);
1220/* ---------------------------------------------------------------------------
1221 \fn csrStart
1222 \brief To start CSR.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001223 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001224 -------------------------------------------------------------------------------*/
1225eHalStatus csrStart(tpAniSirGlobal pMac);
1226/* ---------------------------------------------------------------------------
1227 \fn csrStop
1228 \brief To stop CSR. CSR still keeps its current setting.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001229 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001230 -------------------------------------------------------------------------------*/
1231eHalStatus csrStop(tpAniSirGlobal pMac);
1232/* ---------------------------------------------------------------------------
1233 \fn csrReady
1234 \brief To let CSR is ready to operate
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001235 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001236 -------------------------------------------------------------------------------*/
1237eHalStatus csrReady(tpAniSirGlobal pMac);
1238
1239#ifdef FEATURE_WLAN_WAPI
1240eHalStatus csrRoamGetBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pNum,
1241 tBkidCacheInfo *pBkidCache);
1242
1243
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001244eHalStatus csrScanGetBKIDCandidateList(tpAniSirGlobal pMac, tANI_U32 sessionId,
Jeff Johnson295189b2012-06-20 16:38:30 -07001245 tBkidCandidateInfo *pBkidList, tANI_U32 *pNumItems );
1246tANI_U32 csrRoamGetNumBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId);
1247eHalStatus csrRoamSetBKIDCache( tpAniSirGlobal pMac, tANI_U32 sessionId, tBkidCacheInfo *pBKIDCache,
1248 tANI_U32 numItems );
1249/* ---------------------------------------------------------------------------
1250 \fn csrRoamGetWapiReqIE
1251 \brief return the WAPI IE CSR passes to PE to JOIN request or START_BSS request
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001252 \param pLen - caller allocated memory that has the length of pBuf as input. Upon returned, *pLen has the
Jeff Johnson295189b2012-06-20 16:38:30 -07001253 needed or IE length in pBuf.
1254 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1255 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1256 -------------------------------------------------------------------------------*/
1257eHalStatus csrRoamGetWapiReqIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
1258
1259/* ---------------------------------------------------------------------------
1260 \fn csrRoamGetWapiRspIE
1261 \brief return the WAPI IE from the beacon or probe rsp if connected
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001262 \param pLen - caller allocated memory that has the length of pBuf as input. Upon returned, *pLen has the
Jeff Johnson295189b2012-06-20 16:38:30 -07001263 needed or IE length in pBuf.
1264 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1265 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1266 -------------------------------------------------------------------------------*/
1267eHalStatus csrRoamGetWapiRspIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001268tANI_U8 csrConstructWapiIe( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
Jeff Johnson295189b2012-06-20 16:38:30 -07001269 tSirBssDescription *pSirBssDesc, tDot11fBeaconIEs *pIes, tCsrWapiIe *pWapiIe );
1270#endif /* FEATURE_WLAN_WAPI */
1271
Jeff Johnson295189b2012-06-20 16:38:30 -07001272eHalStatus csrRoamUpdateAPWPSIE( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirAPWPSIEs *pAPWPSIES );
1273eHalStatus csrRoamUpdateWPARSNIEs( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirRSNie * pAPSirRSNie);
Jeff Johnson295189b2012-06-20 16:38:30 -07001274void csrSetCfgPrivacy( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, tANI_BOOLEAN fPrivacy );
1275tANI_S8 csrGetInfraSessionId( tpAniSirGlobal pMac );
1276tANI_U8 csrGetInfraOperationChannel( tpAniSirGlobal pMac, tANI_U8 sessionId);
1277tANI_U8 csrGetConcurrentOperationChannel( tpAniSirGlobal pMac );
1278
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001279eHalStatus csrRoamCopyConnectProfile(tpAniSirGlobal pMac, tANI_U32 sessionId,
Jeff Johnson295189b2012-06-20 16:38:30 -07001280 tCsrRoamConnectedProfile *pProfile);
1281tANI_BOOLEAN csrIsSetKeyAllowed(tpAniSirGlobal pMac, tANI_U32 sessionId);
1282
1283void csrSetOppositeBandChannelInfo( tpAniSirGlobal pMac );
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001284void csrConstructCurrentValidChannelList( tpAniSirGlobal pMac, tDblLinkList *pChannelSetList,
Jeff Johnson295189b2012-06-20 16:38:30 -07001285 tANI_U8 *pChannelList, tANI_U8 bSize, tANI_U8 *pNumChannels );
1286
1287#endif
1288
1289#ifdef WLAN_FEATURE_VOWIFI_11R
1290//Returns whether the current association is a 11r assoc or not
1291tANI_BOOLEAN csrRoamIs11rAssoc(tpAniSirGlobal pMac);
1292#endif
1293
1294#ifdef FEATURE_WLAN_CCX
1295//Returns whether the current association is a CCX assoc or not
1296tANI_BOOLEAN csrRoamIsCCXAssoc(tpAniSirGlobal pMac);
1297#endif
1298
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001299//Remove this code once SLM_Sessionization is supported
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -07001300//BMPS_WORKAROUND_NOT_NEEDED
Jeff Johnson295189b2012-06-20 16:38:30 -07001301void csrDisconnectAllActiveSessions(tpAniSirGlobal pMac);
Mohit Khanna349bc392012-09-11 17:24:52 -07001302
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001303#ifdef FEATURE_WLAN_LFR
1304//Returns whether "Legacy Fast Roaming" is enabled...or not
Madan Mohan Koyyalamudi03aae5f2012-11-28 01:51:22 +05301305tANI_BOOLEAN csrRoamIsFastRoamEnabled(tpAniSirGlobal pMac, tANI_U32 sessionId);
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -07001306tANI_BOOLEAN csrIsChannelPresentInList( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel );
1307VOS_STATUS csrAddToChannelListFront( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel );
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001308#endif
1309