blob: 86377bb9b07edffea23df7fce2f784b1fd8da34c [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)
Srinivas Girigowdabbd16eb2013-03-21 12:34:46 -0700102#define CSR_IS_ROAM_INTRA_BAND_ENABLED( pMac ) \
103( \
104 (((pMac)->roam.configParam.nRoamIntraBand)?eANI_BOOLEAN_TRUE:eANI_BOOLEAN_FALSE) \
105)
Madan Mohan Koyyalamudid5026072012-11-30 14:56:21 -0800106#endif
107
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700108#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
109#define CSR_IS_ROAM_SCAN_OFFLOAD_ENABLED( pMac ) \
110( \
111 (((pMac)->roam.configParam.isRoamOffloadScanEnabled)?eANI_BOOLEAN_TRUE:eANI_BOOLEAN_FALSE) \
112)
113#endif
114
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -0700115//Support for "Fast roaming" (i.e., CCX, LFR, or 802.11r.)
116#define CSR_BG_SCAN_OCCUPIED_CHANNEL_LIST_LEN 15
Jeff Johnson295189b2012-06-20 16:38:30 -0700117
118typedef enum
119{
120 //eCSR_CFG_DOT11_MODE_BEST = 0,
121 eCSR_CFG_DOT11_MODE_TAURUS = 0,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800122 eCSR_CFG_DOT11_MODE_ABG,
123 eCSR_CFG_DOT11_MODE_11A,
124 eCSR_CFG_DOT11_MODE_11B,
125 eCSR_CFG_DOT11_MODE_11G,
126 eCSR_CFG_DOT11_MODE_11N,
127 eCSR_CFG_DOT11_MODE_POLARIS,
128 eCSR_CFG_DOT11_MODE_TITAN,
Jeff Johnsone7245742012-09-05 17:12:55 -0700129#ifdef WLAN_FEATURE_11AC
130 eCSR_CFG_DOT11_MODE_11AC,
131#endif
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800132 eCSR_CFG_DOT11_MODE_11G_ONLY,
133 eCSR_CFG_DOT11_MODE_11N_ONLY,
Jeff Johnsone7245742012-09-05 17:12:55 -0700134#ifdef WLAN_FEATURE_11AC
135 eCSR_CFG_DOT11_MODE_11AC_ONLY,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800136#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700137 //This value can never set to CFG. It is for CSR's internal use
138 eCSR_CFG_DOT11_MODE_AUTO,
139}eCsrCfgDot11Mode; //Used to determine what to set to the WNI_CFG_DOT11_MODE
140
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800141typedef enum etCsrRoamCommands
Jeff Johnson295189b2012-06-20 16:38:30 -0700142{
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800143 eCsrRoamNoCommand,
Jeff Johnson295189b2012-06-20 16:38:30 -0700144 eCsrRoamCommandScan,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800145 eCsrRoamCommandRoam,
146 eCsrRoamCommandWmStatusChange,
Jeff Johnson295189b2012-06-20 16:38:30 -0700147 eCsrRoamCommandSetKey,
148 eCsrRoamCommandRemoveKey,
149
150} eCsrRoamCommands;
151
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800152typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700153{
154 eCsrScanOther = 1,
155 eCsrScanLostLink1,
156 eCsrScanLostLink2,
157 eCsrScanLostLink3,
158 eCsrScanLostLink4,
159 eCsrScan11d1, //First 11d scan
160 eCsrScan11d2, //First 11d scan has failed
161 eCsrScan11dDone, //11d scan succeeded, try the rest of the channel
162 eCsrScanUserRequest,
163 eCsrScanGetResult,
164 eCsrScanSetBGScanParam, //used for HO too - bg scan request in NT Handoff sub-state
165 eCsrScanForSsid,
166 eCsrScanForCapsChange,
167 eCsrScanBGScanAbort,
168 eCsrScanBGScanEnable,
169 eCsrScanIdleScan,
170 eCsrScanGetScanChnInfo, //To get the list of channels scanned
171
172 eCsrScanBgScan, // bg scan request in NRT & RT Handoff sub-states
173 eCsrScanProbeBss, // directed probe on an entry from the candidate list - HO
174 eCsrScanAbortBgScan, //aborting a BG scan (meaning the scan is triggered by LIM timer)
175 eCsrScanAbortNormalScan, //aborting a normal scan (the scan is trigger by eWNI_SME_SCAN_REQ)
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700176 eCsrScanP2PFindPeer,
177 eCsrScanGetLfrResult, // get the LFR candidates from PE scan cache
Jeff Johnson295189b2012-06-20 16:38:30 -0700178}eCsrScanReason;
179
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800180typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700181{
182 eCsrNoConnection, // Roaming because we have not established the initial connection.
183 eCsrCapsChange, // roaming because LIM reported a Capability change in the associated AP.
184 eCsrForcedDisassoc, // roaming becuase someone asked us to Disassoc and stay disassociated.
185 eCsrHddIssued, // roaming because an 802.11 request was issued to the driver.
186 eCsrLostLink1, // roaming because we lost link to an associated AP
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800187 eCsrLostLink2,
Jeff Johnson295189b2012-06-20 16:38:30 -0700188 eCsrLostLink3,
189 eCsrForcedDisassocMICFailure, // roaming because we need to force a Disassoc due to MIC failure
190 eCsrHddIssuedReassocToSameAP,
191 eCsrSmeIssuedReassocToSameAP,
192 eCsrSmeIssuedReassocToDiffAP,
193 eCsrForcedDeauth, // roaming becuase someone asked us to deauth and stay disassociated.
194 eCsrSmeIssuedDisassocForHandoff, // will be issued by Handoff logic to disconect from current AP
195 eCsrSmeIssuedAssocToSimilarAP, // will be issued by Handoff logic to join a new AP with same profile
196 eCsrSmeIssuedIbssJoinFailure, // ibss join timer fired before any perr showed up, so shut down the network
197 eCsrForcedIbssLeave,
198 eCsrStopBss,
199 eCsrSmeIssuedFTReassoc,
200 eCsrForcedDisassocSta,
201 eCsrForcedDeauthSta,
Madan Mohan Koyyalamudi286b60e2012-10-11 12:59:07 -0700202 eCsrPerformPreauth,
Venkata Prathyusha Kuntupalli239278b2013-03-26 15:58:18 -0700203 eCsrLostLink1Abort,
204 eCsrLostLink2Abort,
205 eCsrLostLink3Abort,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800206
Jeff Johnson295189b2012-06-20 16:38:30 -0700207}eCsrRoamReason;
208
209typedef enum
210{
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800211 eCSR_ROAM_SUBSTATE_NONE = 0,
212 eCSR_ROAM_SUBSTATE_START_BSS_REQ,
213 eCSR_ROAM_SUBSTATE_JOIN_REQ,
214 eCSR_ROAM_SUBSTATE_REASSOC_REQ,
215 eCSR_ROAM_SUBSTATE_DISASSOC_REQ,
216 eCSR_ROAM_SUBSTATE_STOP_BSS_REQ,
217 eCSR_ROAM_SUBSTATE_DISCONNECT_CONTINUE_ROAMING, //Continue the current roam command after disconnect
218 eCSR_ROAM_SUBSTATE_AUTH_REQ,
219 eCSR_ROAM_SUBSTATE_CONFIG,
220 eCSR_ROAM_SUBSTATE_DEAUTH_REQ,
221 eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN,
222 eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE,
223 eCSR_ROAM_SUBSTATE_DISASSOC_FORCED,
Jeff Johnson295189b2012-06-20 16:38:30 -0700224 eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY,
225 eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF,
226 eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC,
227 eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC,
228 eCSR_ROAM_SUBSTATE_JOINED_REALTIME_TRAFFIC,
229// max is 15 unless the bitfield is expanded...
230} eCsrRoamSubState;
231
232
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800233typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700234{
235 eCSR_ROAMING_STATE_STOP = 0,
236 eCSR_ROAMING_STATE_IDLE,
237 eCSR_ROAMING_STATE_SCANNING,
238 eCSR_ROAMING_STATE_JOINING,
239 eCSR_ROAMING_STATE_JOINED,
240}eCsrRoamState;
241
242
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800243typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700244{
245 eCsrContinueRoaming,
246 eCsrStopRoaming,
247 eCsrStartIbss,
248 eCsrStartIbssSameIbss,
249 eCsrReassocToSelfNoCapChange,
Jeff Johnsone7245742012-09-05 17:12:55 -0700250 eCsrStopRoamingDueToConcurrency,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800251
Jeff Johnson295189b2012-06-20 16:38:30 -0700252}eCsrJoinState;
253
254typedef enum
255{
256 eCsrNotRoaming,
257 eCsrLostlinkRoamingDisassoc,
258 eCsrLostlinkRoamingDeauth,
259 eCsrDynamicRoaming,
260 eCsrReassocRoaming,
261}eCsrRoamingReason;
262
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800263typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700264{
265 eCsrDisassociated,
266 eCsrDeauthenticated
267
268}eCsrRoamWmStatusChangeTypes;
269
270typedef enum
271{
272 eCsrSummaryStats = 0,
273 eCsrGlobalClassAStats,
274 eCsrGlobalClassBStats,
275 eCsrGlobalClassCStats,
276 eCsrGlobalClassDStats,
277 eCsrPerStaStats,
278 eCsrMaxStats
279}eCsrRoamStatsClassTypes;
280
281#ifdef FEATURE_WLAN_DIAG_SUPPORT
282typedef enum
283{
284 eCSR_WLAN_STATUS_CONNECT =0,
285 eCSR_WLAN_STATUS_DISCONNECT
286
287}eCsrDiagWlanStatusEventSubtype;
288
289typedef enum
290{
291 eCSR_REASON_UNSPECIFIED = 0,
292 eCSR_REASON_USER_REQUESTED,
293 eCSR_REASON_MIC_ERROR,
294 eCSR_REASON_DISASSOC,
295 eCSR_REASON_DEAUTH,
296 eCSR_REASON_HANDOFF,
297
298}eCsrDiagWlanStatusEventReason;
299
300typedef enum
301{
302 eCSR_WLAN_HANDOFF_EVENT =0,
303
304}eCsrDiagWlanHandoffEventSubtype;
305
306typedef enum
307{
308 eCSR_WLAN_VCC_EVENT =0,
309
310}eCsrDiagWlanVccEventSubtype;
311
312#endif //FEATURE_WLAN_DIAG_SUPPORT
313
314typedef struct tagCsrChannel
315{
316 tANI_U8 numChannels;
317 tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
318}tCsrChannel;
319
320typedef struct tagScanProfile
321{
322 tANI_U32 minChnTime;
323 tANI_U32 maxChnTime;
324 tANI_U32 restTime; //This is ignored if not associated
325 tANI_U32 numOfChannels;
326 tANI_U8 *pChannelList;
327 tSirScanType scanType; //active or passive
328 eCsrRoamBssType bssType; //BSS or IBSS
329 tANI_U8 ssid[WNI_CFG_SSID_LEN];
330 tANI_U8 bReturnAfter1stMatch;
331 tANI_U8 fUniqueResult;
332 tANI_U8 freshScan;
333 tCsrBssid bssid;
334}tScanProfile;
335
336typedef struct tagBssConfigParam
337{
338 eCsrMediaAccessType qosType;
339 tSirMacSSid SSID;
340 tANI_U32 uRTSThresh;
341 tANI_U32 uDeferThresh; //
342 eCsrCfgDot11Mode uCfgDot11Mode;
343 eCsrBand eBand;
344 tANI_U8 standardRate[CSR_DOT11_SUPPORTED_RATES_MAX];
345 tANI_U8 extendedRate[CSR_DOT11_EXTENDED_SUPPORTED_RATES_MAX];
346 eCsrExposedTxRate txRate;
347 tAniAuthType authType;
348 eCsrEncryptionType encType;
349 tANI_U32 uShortSlotTime;
350 tANI_U32 uHTSupport; //High throughput
351 tANI_U32 uPowerLimit;
352 tANI_U32 uHeartBeatThresh;
353 tANI_U32 uJoinTimeOut;
354 tSirMacCapabilityInfo BssCap;
355 tANI_BOOLEAN f11hSupport;
Jeff Johnsone7245742012-09-05 17:12:55 -0700356 ePhyChanBondState cbMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700357}tBssConfigParam;
358
359
360typedef struct tagCsrRoamStartBssParams
361{
362 tSirMacSSid ssId;
363 tCsrBssid bssid; //this is the BSSID for the party we want to join (only use for IBSS or WDS)
364 tSirNwType sirNwType;
Jeff Johnsone7245742012-09-05 17:12:55 -0700365 ePhyChanBondState cbMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700366 tSirMacRateSet operationalRateSet;
367 tSirMacRateSet extendedRateSet;
368 tANI_U8 operationChn;
369 eCsrCfgDot11Mode uCfgDot11Mode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700370 tANI_U8 privacy;
371 tANI_BOOLEAN fwdWPSPBCProbeReq;
372 tANI_BOOLEAN protEnabled;
373 tANI_BOOLEAN obssProtEnabled;
374 tAniAuthType authType;
375 tANI_U16 beaconInterval; //If this is 0, SME will fill in for caller.
376 tANI_U16 ht_protection;
377 tANI_U32 dtimPeriod;
378 tANI_U8 ApUapsdEnable;
379 tANI_U8 ssidHidden;
380 tANI_U8 wps_state;
Jeff Johnson295189b2012-06-20 16:38:30 -0700381 tVOS_CON_MODE bssPersona;
382 tANI_U16 nRSNIELength; //The byte count in the pRSNIE, if 0, pRSNIE is ignored.
383 tANI_U8 *pRSNIE; //If not null, it has the IE byte stream for RSN
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800384 tANI_BOOLEAN updatebeaconInterval; //Flag used to indicate update
385 // beaconInterval
Jeff Johnson295189b2012-06-20 16:38:30 -0700386}tCsrRoamStartBssParams;
387
388
389typedef struct tagScanCmd
390{
391 tANI_U32 scanID;
392 csrScanCompleteCallback callback;
393 void *pContext;
394 eCsrScanReason reason;
395 eCsrRoamState lastRoamState[CSR_ROAM_SESSION_MAX];
396 tCsrRoamProfile *pToRoamProfile;
397 tANI_U32 roamId; //this is the ID related to the pToRoamProfile
398 union
399 {
400 tCsrScanRequest scanRequest;
401 tCsrBGScanRequest bgScanRequest;
402 }u;
403}tScanCmd;
404
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800405typedef struct tagRoamCmd
Jeff Johnson295189b2012-06-20 16:38:30 -0700406{
407 tANI_U32 roamId;
408 eCsrRoamReason roamReason;
409 tCsrRoamProfile roamProfile;
410 tScanResultHandle hBSSList; //BSS list fits the profile
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800411 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 -0700412 tSirBssDescription *pLastRoamBss; //the last BSS we try and failed
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800413 tANI_BOOLEAN fReleaseBssList; //whether to free hBSSList
Jeff Johnson295189b2012-06-20 16:38:30 -0700414 tANI_BOOLEAN fReleaseProfile; //whether to free roamProfile
415 tANI_BOOLEAN fReassoc; //whether this command is for reassociation
416 tANI_BOOLEAN fUpdateCurRoamProfile; //whether pMac->roam.pCurRoamProfile needs to be updated
417 //this is for CSR internal used only. And it should not be assigned when creating the command
418 //This causes the roam command not to do anything.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800419 tANI_BOOLEAN fReassocToSelfNoCapChange;
Jeff Johnson295189b2012-06-20 16:38:30 -0700420
421 tANI_BOOLEAN fStopWds;
422 tSirMacAddr peerMac;
423 tSirMacReasonCodes reason;
424}tRoamCmd;
425
426typedef struct tagSetKeyCmd
427{
428 tANI_U32 roamId;
429 eCsrEncryptionType encType;
430 eCsrAuthType authType;
431 tAniKeyDirection keyDirection; //Tx, Rx or Tx-and-Rx
432 tSirMacAddr peerMac; //Peer's MAC address. ALL 1's for group key
433 tANI_U8 paeRole; //0 for supplicant
434 tANI_U8 keyId; // Kye index
435 tANI_U8 keyLength; //Number of bytes containing the key in pKey
436 tANI_U8 Key[CSR_MAX_KEY_LEN];
437 tANI_U8 keyRsc[CSR_MAX_RSC_LEN];
438} tSetKeyCmd;
439
440typedef struct tahRemoveKeyCmd
441{
442 tANI_U32 roamId;
443 eCsrEncryptionType encType;
444 eCsrAuthType authType;
445 tSirMacAddr peerMac; //Peer's MAC address. ALL 1's for group key
446 tANI_U8 keyId; //key index
447} tRemoveKeyCmd;
448
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800449typedef struct tagWmStatusChangeCmd
Jeff Johnson295189b2012-06-20 16:38:30 -0700450{
451 eCsrRoamWmStatusChangeTypes Type;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800452 union
453 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700454 tSirSmeDeauthInd DeauthIndMsg;
455 tSirSmeDisassocInd DisassocIndMsg;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800456 }u;
Jeff Johnson295189b2012-06-20 16:38:30 -0700457
458}tWmStatusChangeCmd;
459
460typedef struct tagAddStaForSessionCmd
461{
462 //Session self mac addr
463 tSirMacAddr selfMacAddr;
464}tAddStaForSessionCmd;
465
466typedef struct tagDelStaForSessionCmd
467{
468 //Session self mac addr
469 tSirMacAddr selfMacAddr;
470 csrRoamSessionCloseCallback callback;
471 void *pContext;
472}tDelStaForSessionCmd;
473
474//This structure represents one scan request
475typedef struct tagCsrCmd
476{
477 tListElem Link;
478 eCsrRoamCommands command;
479 tANI_U8 sessionId; // Session ID for this command
480 union
481 {
482 tScanCmd scanCmd;
483 tRoamCmd roamCmd;
484 tWmStatusChangeCmd wmStatusChangeCmd;
485 tSetKeyCmd setKeyCmd;
486 tRemoveKeyCmd removeKeyCmd;
487 tAddStaForSessionCmd addStaSessionCmd;
488 tDelStaForSessionCmd delStaSessionCmd;
489 }u;
490}tCsrCmd;
491
492#ifdef WLAN_FEATURE_VOWIFI_11R
493typedef struct tagCsr11rConfig
494{
495 tANI_BOOLEAN IsFTResourceReqSupported;
496} tCsr11rConfig;
497#endif
498
499#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
500typedef struct tagCsrNeighborRoamConfig
501{
502 tANI_U32 nNeighborScanTimerPeriod;
503 tANI_U8 nNeighborLookupRssiThreshold;
504 tANI_U8 nNeighborReassocRssiThreshold;
505 tANI_U16 nNeighborScanMinChanTime;
506 tANI_U16 nNeighborScanMaxChanTime;
507 sCsrChannel neighborScanChanList;
508 tANI_U8 nMaxNeighborRetries;
509 tANI_U16 nNeighborResultsRefreshPeriod;
Srinivas Girigowdade697412013-02-14 16:31:48 -0800510 tANI_U16 nEmptyScanRefreshPeriod;
Jeff Johnson295189b2012-06-20 16:38:30 -0700511}tCsrNeighborRoamConfig;
512#endif
513
514typedef struct tagCsrConfig
515{
516 tANI_U32 agingCount;
517 tANI_U32 FragmentationThreshold;
518 tANI_U32 channelBondingMode24GHz;
519 tANI_U32 channelBondingMode5GHz;
520 tANI_U32 RTSThreshold;
521 eCsrPhyMode phyMode;
522 eCsrCfgDot11Mode uCfgDot11Mode;
523 eCsrBand eBand;
524 tANI_U32 HeartbeatThresh50;
525 tANI_U32 HeartbeatThresh24;
526 tANI_U32 bgScanInterval;
527 eCsrCBChoice cbChoice;
528 eCsrBand bandCapability; //indicate hw capability
529 eCsrRoamWmmUserModeType WMMSupportMode;
530 tANI_BOOLEAN Is11eSupportEnabled;
531 tANI_BOOLEAN Is11dSupportEnabled;
532 tANI_BOOLEAN Is11dSupportEnabledOriginal;
533 tANI_BOOLEAN Is11hSupportEnabled;
534 tANI_BOOLEAN shortSlotTime;
535 tANI_BOOLEAN ProprietaryRatesEnabled;
536 tANI_BOOLEAN fenableMCCMode;
537 tANI_U16 TxRate;
Madan Mohan Koyyalamudi167b95e2012-11-27 15:53:38 -0800538 tANI_U8 fAllowMCCGODiffBI;
Jeff Johnson295189b2012-06-20 16:38:30 -0700539 tANI_U8 AdHocChannel24;
540 tANI_U8 AdHocChannel5G;
541 tANI_U32 impsSleepTime; //in units of microseconds
542 tANI_U32 scanAgeTimeNCNPS; //scan result aging time threshold when Not-Connect-No-Power-Save, in seconds
543 tANI_U32 scanAgeTimeNCPS; //scan result aging time threshold when Not-Connect-Power-Save, in seconds
544 tANI_U32 scanAgeTimeCNPS; //scan result aging time threshold when Connect-No-Power-Save, in seconds,
545 tANI_U32 scanAgeTimeCPS; //scan result aging time threshold when Connect-Power-Savein seconds
546 tANI_U32 BssPreferValue[CSR_NUM_RSSI_CAT]; //each RSSI category has one value
547 int RSSICat[CSR_NUM_RSSI_CAT];
548 tANI_U8 bCatRssiOffset; //to set the RSSI difference for each category
549 tANI_U32 nRoamingTime; //In seconds, CSR will try this long before gives up, 0 means no roaming
550 //Whether to limit the channels to the ones set in Csr11dInfo. If true, the opertaional
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800551 //channels are limited to the default channel list. It is an "AND" operation between the
Jeff Johnson295189b2012-06-20 16:38:30 -0700552 //default channels and the channels in the 802.11d IE.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800553 tANI_BOOLEAN fEnforce11dChannels;
Jeff Johnson295189b2012-06-20 16:38:30 -0700554 //Country Code Priority
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800555 //0 = 802.11D > Configured Country > NV
Jeff Johnson295189b2012-06-20 16:38:30 -0700556 //1 = Configured Country > 802.11D > NV
557 tANI_BOOLEAN fSupplicantCountryCodeHasPriority;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800558 //When true, AP with unknown country code won't be see.
559 //"Unknown country code" means either Ap doesn't have 11d IE or we cannot
Jeff Johnson295189b2012-06-20 16:38:30 -0700560 //find a domain for the country code in its 11d IE.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800561 tANI_BOOLEAN fEnforceCountryCodeMatch;
Jeff Johnson295189b2012-06-20 16:38:30 -0700562 //When true, only APs in the default domain can be seen. If the Ap has "unknown country
563 //code", or the doamin of the country code doesn't match the default domain, the Ap is
564 //not acceptable.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800565 tANI_BOOLEAN fEnforceDefaultDomain;
Jeff Johnson295189b2012-06-20 16:38:30 -0700566
567 tANI_U16 vccRssiThreshold;
568 tANI_U32 vccUlMacLossThreshold;
569
570 tANI_U32 nPassiveMinChnTime; //in units of milliseconds
571 tANI_U32 nPassiveMaxChnTime; //in units of milliseconds
572 tANI_U32 nActiveMinChnTime; //in units of milliseconds
573 tANI_U32 nActiveMaxChnTime; //in units of milliseconds
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800574
575 tANI_U32 nActiveMinChnTimeBtc; //in units of milliseconds
576 tANI_U32 nActiveMaxChnTimeBtc; //in units of milliseconds
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -0700577 tANI_U8 disableAggWithBtc;
Madan Mohan Koyyalamudi4ff9cd62012-10-30 17:48:57 -0700578#ifdef WLAN_AP_STA_CONCURRENCY
579 tANI_U32 nPassiveMinChnTimeConc; //in units of milliseconds
580 tANI_U32 nPassiveMaxChnTimeConc; //in units of milliseconds
581 tANI_U32 nActiveMinChnTimeConc; //in units of milliseconds
582 tANI_U32 nActiveMaxChnTimeConc; //in units of milliseconds
583 tANI_U32 nRestTimeConc; //in units of milliseconds
Sudhir Sattayappa Kohallieb97d502013-05-22 23:16:42 -0700584 tANI_U8 nNumStaChanCombinedConc; //number of channels combined for
585 //Sta in each split scan operation
586 tANI_U8 nNumP2PChanCombinedConc; //number of channels combined for
587 //P2P in each split scan operation
Madan Mohan Koyyalamudi4ff9cd62012-10-30 17:48:57 -0700588#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700589
590 tANI_BOOLEAN IsIdleScanEnabled;
591 //in dBm, the maximum TX power
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800592 //The actual TX power is the lesser of this value and 11d.
Jeff Johnson295189b2012-06-20 16:38:30 -0700593 //If 11d is disable, the lesser of this and default setting.
594 tANI_U8 nTxPowerCap;
595 tANI_U32 statsReqPeriodicity; //stats request frequency from PE while in full power
596 tANI_U32 statsReqPeriodicityInPS;//stats request frequency from PE while in power save
Jeff Johnson295189b2012-06-20 16:38:30 -0700597 tANI_U32 dtimPeriod;
598 tANI_BOOLEAN ssidHidden;
Jeff Johnson295189b2012-06-20 16:38:30 -0700599
600#ifdef WLAN_FEATURE_VOWIFI_11R
601 tCsr11rConfig csr11rConfig;
602#endif
603
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700604#ifdef FEATURE_WLAN_LFR
605 tANI_U8 isFastRoamIniFeatureEnabled;
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700606#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
607 tANI_U8 isRoamOffloadScanEnabled;
608#endif
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700609#endif
610
Jeff Johnson295189b2012-06-20 16:38:30 -0700611#ifdef FEATURE_WLAN_CCX
612 tANI_U8 isCcxIniFeatureEnabled;
613#endif
614
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700615#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
Srinivas Girigowda100eb322013-03-15 16:48:20 -0700616 tANI_U8 isFastTransitionEnabled;
617 tANI_U8 RoamRssiDiff;
618 tANI_U8 nImmediateRoamRssiDiff;
619 tANI_BOOLEAN nRoamPrefer5GHz;
620 tANI_BOOLEAN nRoamIntraBand;
621 tANI_BOOLEAN isWESModeEnabled;
622 tANI_BOOLEAN nRoamScanControl;
Varun Reddy Yeturu920df212013-05-22 08:07:23 -0700623 tANI_U8 nProbes;
624 tANI_U16 nRoamScanHomeAwayTime;
Jeff Johnson295189b2012-06-20 16:38:30 -0700625#endif
626
627#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
628 tCsrNeighborRoamConfig neighborRoamConfig;
629#endif
630
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800631 /* Instead of Reassoc, send ADDTS/DELTS even when ACM is off for that AC
Jeff Johnson295189b2012-06-20 16:38:30 -0700632 * This is mandated by WMM-AC certification */
633 tANI_BOOLEAN addTSWhenACMIsOff;
634
635 tANI_BOOLEAN fValidateList;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800636 //Remove this code once SLM_Sessionization is supported
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700637 //BMPS_WORKAROUND_NOT_NEEDED
Jeff Johnsone7245742012-09-05 17:12:55 -0700638 tANI_BOOLEAN doBMPSWorkaround;
Jeff Johnson295189b2012-06-20 16:38:30 -0700639
640 //To enable/disable scanning 2.4Ghz channels twice on a single scan request from HDD
641 tANI_BOOLEAN fScanTwice;
Jeff Johnsone7245742012-09-05 17:12:55 -0700642#ifdef WLAN_FEATURE_11AC
643 tANI_U32 nVhtChannelWidth;
Shailender Karmuchi08f87c22013-01-17 12:51:24 -0800644 tANI_U8 txBFEnable;
Shailender Karmuchicc3fe442013-02-16 18:18:33 -0800645 tANI_U8 txBFCsnValue;
Ravi Joshi83bfaa12013-05-28 22:12:08 -0700646 tANI_BOOLEAN enableVhtFor24GHz;
Jeff Johnsone7245742012-09-05 17:12:55 -0700647#endif
Gopichand Nakkalab2d2c312013-01-04 11:41:02 -0800648 tANI_U8 txLdpcEnable;
Jeff Johnson295189b2012-06-20 16:38:30 -0700649
650}tCsrConfig;
651
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800652typedef struct tagCsrChannelPowerInfo
Jeff Johnson295189b2012-06-20 16:38:30 -0700653{
654 tListElem link;
655 tANI_U8 firstChannel;
656 tANI_U8 numChannels;
657 tANI_U8 txPower;
658 tANI_U8 interChannelOffset;
659}tCsrChannelPowerInfo;
660
661typedef struct tagRoamJoinStatus
662{
663 tSirResultCodes statusCode;
664 //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 -0800665 tANI_U32 reasonCode;
Kiran Kumar Lokerec8550fa2013-04-15 22:23:00 -0700666 tSirMacAddr bssId;
Jeff Johnson295189b2012-06-20 16:38:30 -0700667}tCsrRoamJoinStatus;
668
669typedef struct tagCsrOsChannelMask
670{
671 tANI_U8 numChannels;
672 tANI_BOOLEAN scanEnabled[WNI_CFG_VALID_CHANNEL_LIST_LEN];
673 tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
674}tCsrOsChannelMask;
675
676
677typedef struct tagCsrScanStruct
678{
679 tScanProfile scanProfile;
680 tANI_U32 nextScanID;
Madan Mohan Koyyalamudica43cdf2012-09-24 13:15:49 -0700681 tDblLinkList scanResultList;
Jeff Johnson295189b2012-06-20 16:38:30 -0700682 tDblLinkList tempScanResults;
683 tANI_BOOLEAN fScanEnable;
684 tANI_BOOLEAN fFullScanIssued;
685 tPalTimerHandle hTimerGetResult;
686#ifdef WLAN_AP_STA_CONCURRENCY
687 tPalTimerHandle hTimerStaApConcTimer;
688#endif
689 tPalTimerHandle hTimerIdleScan;
690 tPalTimerHandle hTimerResultAging;
Sandeep Puligilla2b6dc632012-12-17 14:44:16 -0800691 tPalTimerHandle hTimerResultCfgAging;
Jeff Johnson295189b2012-06-20 16:38:30 -0700692 tPalTimerHandle hTimerBgScan;
693 //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 -0800694 tANI_U8 channelOf11dInfo;
695 tANI_U8 scanResultCfgAgingTime;
Jeff Johnson295189b2012-06-20 16:38:30 -0700696 //changes on every scan, a flag to tell whether conflict 11d info found on each BSS
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800697 tANI_BOOLEAN fAmbiguous11dInfoFound;
Jeff Johnson295189b2012-06-20 16:38:30 -0700698 //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 -0800699 tANI_BOOLEAN fCurrent11dInfoMatch;
Jeff Johnson295189b2012-06-20 16:38:30 -0700700 tANI_BOOLEAN f11dInfoReset; //to indicate whether the 11d info in CFG is reset to default
701 tSirScanType curScanType;
702 tCsrChannel baseChannels; //This are all the supported channels AND(&) to the current eBand
703 tCsrChannel channels11d;
704 tChannelListWithPower defaultPowerTable[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
705 tChannelListWithPower defaultPowerTable40MHz[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
706 tANI_U32 numChannelsDefault; //total channels of NV
707 tCsrChannel base20MHzChannels; //The channel base to work on
708 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
709 tDblLinkList channelPowerInfoList24;
710 tDblLinkList channelPowerInfoList5G;
711 tANI_U32 nLastAgeTimeOut;
712 tANI_U32 nAgingCountDown;
Gopichand Nakkala114718f2013-03-25 19:19:46 -0700713 tANI_U8 countryCodeDefault[WNI_CFG_COUNTRY_CODE_LEN]; //The country code from NV
714 tANI_U8 countryCodeCurrent[WNI_CFG_COUNTRY_CODE_LEN];
715 tANI_U8 countryCode11d[WNI_CFG_COUNTRY_CODE_LEN];
Jeff Johnson295189b2012-06-20 16:38:30 -0700716 v_REGDOMAIN_t domainIdDefault; //default regulatory domain
717 v_REGDOMAIN_t domainIdCurrent; //current regulatory domain
718 tANI_BOOLEAN f11dInfoApplied;
719 tANI_BOOLEAN fCancelIdleScan;
720#ifdef FEATURE_WLAN_WAPI
721// tANI_U16 NumBkidCandidate;
722// tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED]; /* Move this as part of SessionEntry */
723#endif /* FEATURE_WLAN_WAPI */
724 tANI_U8 numBGScanChannel; //number of valid channels in the bgScanChannelList
725 tANI_U8 bgScanChannelList[WNI_CFG_BG_SCAN_CHANNEL_LIST_LEN];
726 //the ChannelInfo member is not used in this structure.
727 //numBGScanChannel and bgScanChannelList are used for the BG scan channel info
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800728 tCsrBGScanRequest bgScanParams;
Jeff Johnson295189b2012-06-20 16:38:30 -0700729 tANI_BOOLEAN fRestartIdleScan;
730 tANI_U32 nIdleScanTimeGap; //the time since last trying to trigger idle scan
731 tCsrOsChannelMask osScanChannelMask;//keep a track of channels to be scnned while in traffic condition
732 tANI_U16 nBssLimit; //the maximum number of BSS in scan cache
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800733 /*channelPowerInfoList24 has been seen corrupted. Set this flag to true trying to
Jeff Johnson295189b2012-06-20 16:38:30 -0700734 * detect when it happens. Adding this into code because we can't reproduce it easily.
735 * We don't know when it happens. */
736 tANI_BOOLEAN fValidateList;
737 /*Customer wants to start with an active scan based on the default country code.
738 * This optimization will minimize the driver load to association time.
739 * Based on this flag we will bypass the initial passive scan needed for 11d
740 * to determine the country code & domain */
741 tANI_BOOLEAN fEnableBypass11d;
742
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800743 /*Customer wants to optimize the scan time. Avoiding scans(passive) on DFS
744 * channels while swipping through both bands can save some time
Jeff Johnson295189b2012-06-20 16:38:30 -0700745 * (apprx 1.3 sec) */
746 tANI_BOOLEAN fEnableDFSChnlScan;
747
Jeff Johnsone7245742012-09-05 17:12:55 -0700748 /*
749 * To enable/disable scanning only 2.4Ghz channels on first scan
750 */
751 tANI_BOOLEAN fFirstScanOnly2GChnl;
752
Jeff Johnson295189b2012-06-20 16:38:30 -0700753 tANI_BOOLEAN fDropScanCmd; //true means we don't accept scan commands
754
755#ifdef WLAN_AP_STA_CONCURRENCY
756 tDblLinkList scanCmdPendingList;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800757#endif
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -0700758 tCsrChannel occupiedChannels; //This includes all channels on which candidate APs are found
Jeff Johnson295189b2012-06-20 16:38:30 -0700759}tCsrScanStruct;
760
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800761#ifdef FEATURE_WLAN_TDLS_INTERNAL
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800762/*
763 * struct to carry TDLS discovery info..
764 */
765typedef struct sCsrTdlsContext
766{
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800767 tDblLinkList tdlsPotentialPeerList ;
768 tANI_U16 tdlsCommonFlag ;
769 tANI_U16 tdlsCommonState ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800770 tANI_U16 tdlsPeerCount ;
771}tCsrTdlsCtxStruct;
772
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800773typedef struct sCsrTdlsPeerLinkInfo
774{
775 tListElem tdlsPeerStaLink ;
776 tSirTdlsPeerInfo tdlsDisPeerInfo ;
777}tCsrTdlsPeerLinkinfo ;
778#endif
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800779
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800780
781
Jeff Johnson295189b2012-06-20 16:38:30 -0700782
783//Save the connected information. This structure + connectedProfile
784//should contain all information about the connection
785typedef struct tagRoamCsrConnectedInfo
786{
787 tANI_U32 nBeaconLength; //the length, in bytes, of the beacon frame, can be 0
788 tANI_U32 nAssocReqLength; //the length, in bytes, of the assoc req frame, can be 0
789 tANI_U32 nAssocRspLength; //The length, in bytes, of the assoc rsp frame, can be 0
790#ifdef WLAN_FEATURE_VOWIFI_11R
791 tANI_U32 nRICRspLength; //Length of the parsed RIC response IEs received in reassoc response
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800792#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700793#ifdef FEATURE_WLAN_CCX
794 tANI_U32 nTspecIeLength;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800795#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700796 tANI_U8 *pbFrames; //Point to a buffer contain the beacon, assoc req, assoc rsp frame, in that order
797 //user needs to use nBeaconLength, nAssocReqLength, nAssocRspLength to desice where
798 //each frame starts and ends.
799 tANI_U8 staId;
800}tCsrRoamConnectedInfo;
801
802
803typedef struct tagCsrLinkQualityIndInfo
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800804{
Jeff Johnson295189b2012-06-20 16:38:30 -0700805 csrRoamLinkQualityIndCallback callback;
806 void *context;
807}tCsrLinkQualityIndInfo;
808
809typedef struct tagCsrPeStatsReqInfo
810{
811 tListElem link; /* list links */
812 tANI_U32 statsMask;
813 tANI_U32 periodicity;
814 tANI_BOOLEAN rspPending;
815 vos_timer_t hPeStatsTimer;
816 tANI_BOOLEAN timerRunning;
817 tANI_U8 staId;
818 tANI_U8 numClient;
819 tpAniSirGlobal pMac;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800820 /* To remember if the peStats timer is stopped successfully or not */
Jeff Johnson295189b2012-06-20 16:38:30 -0700821 tANI_BOOLEAN timerStopFailed;
822
823}tCsrPeStatsReqInfo;
824
825typedef struct tagCsrStatsClientReqInfo
826{
827 tListElem link; /* list links */
828 eCsrStatsRequesterType requesterId;
829 tCsrStatsCallback callback;
830 tANI_U32 periodicity;
831 void *pContext;
832 tANI_U32 statsMask;
833 tCsrPeStatsReqInfo *pPeStaEntry;
834 tANI_U8 staId;
835 vos_timer_t timer;
836 tANI_BOOLEAN timerExpired;
837 tpAniSirGlobal pMac; // TODO: Confirm this change BTAMP
838}tCsrStatsClientReqInfo;
839
840typedef struct tagCsrTlStatsReqInfo
841{
842 tANI_U32 periodicity;
843 tANI_BOOLEAN timerRunning;
844 tPalTimerHandle hTlStatsTimer;
845 tANI_U8 numClient;
846}tCsrTlStatsReqInfo;
847
848typedef struct tagCsrRoamSession
849{
850 tANI_U8 sessionId; // Session ID
851 tANI_BOOLEAN sessionActive; // TRUE if it is used
852 tCsrBssid selfMacAddr; // For BT-AMP station, this serve as BSSID for self-BSS.
853 csrRoamCompleteCallback callback;
854 void *pContext;
855 eCsrConnectState connectState;
856 tCsrRoamConnectedProfile connectedProfile;
857 tCsrRoamConnectedInfo connectedInfo;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800858 tCsrRoamProfile *pCurRoamProfile;
Jeff Johnson295189b2012-06-20 16:38:30 -0700859 tSirBssDescription *pConnectBssDesc;
860 tANI_U16 NumPmkidCache;
861 tPmkidCacheInfo PmkidCacheInfo[CSR_MAX_PMKID_ALLOWED];
862 tANI_U8 cJoinAttemps;
863 //This may or may not have the up-to-date valid channel list
864 //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
865 tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
866 tANI_S32 sPendingCommands; //0 means CSR is ok to low power
867#ifdef FEATURE_WLAN_WAPI
868 tANI_U16 NumBkidCache;
869 tBkidCacheInfo BkidCacheInfo[CSR_MAX_BKID_ALLOWED];
870#endif /* FEATURE_WLAN_WAPI */
871 tANI_BOOLEAN fRoaming; //indicate whether CSR is roaming (either via lostlink or dynamic roaming)
872 //to remember some parameters needed for START_BSS.
873 //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 -0800874 tCsrRoamStartBssParams bssParams;
Jeff Johnson295189b2012-06-20 16:38:30 -0700875 tANI_U32 nWpaRsnReqIeLength; //the byte count of pWpaRsnIE;
876 tANI_U8 *pWpaRsnReqIE; //this contain the WPA/RSN IE in assoc request or the one sent in beacon (IBSS)
877 tANI_U32 nWpaRsnRspIeLength; //the byte count for pWpaRsnRspIE
878 tANI_U8 *pWpaRsnRspIE; //this contain the WPA/RSN IE in beacon/probe rsp
879#ifdef FEATURE_WLAN_WAPI
880 tANI_U32 nWapiReqIeLength; //the byte count of pWapiReqIE;
881 tANI_U8 *pWapiReqIE; //this contain the WAPI IE in assoc request or the one sent in beacon (IBSS)
882 tANI_U32 nWapiRspIeLength; //the byte count for pWapiRspIE
883 tANI_U8 *pWapiRspIE; //this contain the WAPI IE in beacon/probe rsp
884#endif /* FEATURE_WLAN_WAPI */
885 tANI_U32 nAddIEScanLength; //the byte count of pAddIeScanIE;
886 tANI_U8 *pAddIEScan; //this contains the additional IE in (unicast) probe request at the time of join
887 tANI_U32 nAddIEAssocLength; //the byte count for pAddIeAssocIE
888 tANI_U8 *pAddIEAssoc; //this contains the additional IE in (re) assoc request
889
890 tANI_TIMESTAMP roamingStartTime; //in units of 10ms
891 tCsrTimerInfo roamingTimerInfo;
892 eCsrRoamingReason roamingReason;
893 tANI_BOOLEAN fCancelRoaming;
894 tPalTimerHandle hTimerRoaming;
895 tPalTimerHandle hTimerIbssJoining;
896 tCsrTimerInfo ibssJoinTimerInfo;
897 tANI_BOOLEAN ibss_join_pending;
898 eCsrRoamResult roamResult; //the roamResult that is used when the roaming timer fires
899 tCsrRoamJoinStatus joinFailStatusCode; //This is the reason code for join(assoc) failure
900 //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 -0800901 tANI_U32 roamingStatusCode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700902 tANI_U16 NumPmkidCandidate;
903 tPmkidCandidateInfo PmkidCandidateInfo[CSR_MAX_PMKID_ALLOWED];
904 #ifdef FEATURE_WLAN_WAPI
905 tANI_U16 NumBkidCandidate;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800906 tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED];
Jeff Johnson295189b2012-06-20 16:38:30 -0700907#endif
908 tANI_BOOLEAN fWMMConnection;
909#ifdef FEATURE_WLAN_BTAMP_UT_RF
910 //To retry a join later when it fails if so desired
911 tPalTimerHandle hTimerJoinRetry;
912 tCsrTimerInfo joinRetryTimerInfo;
913 tANI_U32 maxRetryCount;
914#endif
915#ifdef FEATURE_WLAN_CCX
916 tCsrCcxCckmInfo ccxCckmInfo;
917 tANI_BOOLEAN isPrevApInfoValid;
918 tSirMacSSid prevApSSID;
919 tCsrBssid prevApBssid;
920 tANI_U8 prevOpChannel;
921 tANI_U16 clientDissSecs;
922 tANI_U32 roamTS1;
923#endif
924 tANI_U8 bRefAssocStartCnt; //Tracking assoc start indication
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800925 /* to force the AP initiate fresh 802.1x authentication after re-association need to clear
Madan Mohan Koyyalamudiea22cdc2012-10-18 21:02:23 -0700926 * the PMKID cache. To clear the cache in this particular case this is added
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800927 * it is needed by the HS 2.0 passpoint certification 5.2.a and b testcases */
Madan Mohan Koyyalamudiea22cdc2012-10-18 21:02:23 -0700928 tANI_BOOLEAN fIgnorePMKIDCache;
Jeff Johnson295189b2012-06-20 16:38:30 -0700929} tCsrRoamSession;
930
931typedef struct tagCsrRoamStruct
932{
933 tANI_U32 nextRoamId;
934 tDblLinkList roamCmdPendingList;
935 tDblLinkList channelList5G;
936 tDblLinkList channelList24;
937 tCsrConfig configParam;
938 tANI_U32 numChannelsEeprom; //total channels of eeprom
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800939 tCsrChannel base20MHzChannels; //The channel base to work on
940 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
941 eCsrRoamState curState[CSR_ROAM_SESSION_MAX];
Jeff Johnson295189b2012-06-20 16:38:30 -0700942 eCsrRoamSubState curSubState[CSR_ROAM_SESSION_MAX];
943 //This may or may not have the up-to-date valid channel list
944 //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
945 tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
946 tANI_U32 numValidChannels; //total number of channels in CFG
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800947
Jeff Johnson295189b2012-06-20 16:38:30 -0700948 tANI_S32 sPendingCommands;
Jeff Johnson295189b2012-06-20 16:38:30 -0700949 tPalTimerHandle hTimerWaitForKey; //To support timeout for WaitForKey state
950 tCsrSummaryStatsInfo summaryStatsInfo;
951 tCsrGlobalClassAStatsInfo classAStatsInfo;
952 tCsrGlobalClassBStatsInfo classBStatsInfo;
953 tCsrGlobalClassCStatsInfo classCStatsInfo;
954 tCsrGlobalClassDStatsInfo classDStatsInfo;
955 tCsrPerStaStatsInfo perStaStatsInfo[CSR_MAX_STA];
956 tDblLinkList statsClientReqList;
957 tDblLinkList peStatsReqList;
958 tCsrTlStatsReqInfo tlStatsReqInfo;
959 eCsrRoamLinkQualityInd vccLinkQuality;
960 tCsrLinkQualityIndInfo linkQualityIndInfo;
961 v_CONTEXT_t gVosContext; //used for interaction with TL
962 //To specify whether an association or a IBSS is WMM enabled
963 //This parameter is only valid during a join or start BSS command is being executed
964 //tANI_BOOLEAN fWMMConnection; /* Moving it to be part of roamsession */
965 v_U8_t ucACWeights[WLANTL_MAX_AC];
966 /* TODO : Upto here */
967 tCsrTimerInfo WaitForKeyTimerInfo;
968 tCsrRoamSession *roamSession;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800969 tANI_U32 transactionId; // Current transaction ID for internal use.
970#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
Jeff Johnson295189b2012-06-20 16:38:30 -0700971 tCsrNeighborRoamControlInfo neighborRoamInfo;
972#endif
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700973#ifdef FEATURE_WLAN_LFR
974 tANI_U8 isFastRoamIniFeatureEnabled;
975#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700976#ifdef FEATURE_WLAN_CCX
977 tANI_U8 isCcxIniFeatureEnabled;
978#endif
Jeff Johnson43971f52012-07-17 12:26:56 -0700979#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
Srinivas Girigowda100eb322013-03-15 16:48:20 -0700980 tANI_U8 RoamRssiDiff;
981 tANI_BOOLEAN isWESModeEnabled;
Jeff Johnson43971f52012-07-17 12:26:56 -0700982#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700983}tCsrRoamStruct;
984
985
986#define GET_NEXT_ROAM_ID(pRoamStruct) (((pRoamStruct)->nextRoamId + 1 == 0) ? 1 : (pRoamStruct)->nextRoamId)
987#define CSR_IS_ROAM_STATE(pMac, state, sessionId) ( (state) == (pMac)->roam.curState[sessionId] )
988
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800989#define CSR_IS_ROAM_STOP(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_STOP, sessionId )
990#define CSR_IS_ROAM_INIT(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_INIT, sessionId )
Jeff Johnson295189b2012-06-20 16:38:30 -0700991#define CSR_IS_ROAM_SCANNING(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_SCANNING, sessionId )
992#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 -0800993#define CSR_IS_ROAM_IDLE(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_IDLE, sessionId )
Jeff Johnson295189b2012-06-20 16:38:30 -0700994#define CSR_IS_ROAM_JOINED(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_JOINED, sessionId )
995
996#define CSR_IS_ROAM_SUBSTATE(pMac, subState, sessionId) ((subState) == (pMac)->roam.curSubState[sessionId])
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800997#define CSR_IS_ROAM_SUBSTATE_JOIN_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOIN_REQ, sessionId)
998#define CSR_IS_ROAM_SUBSTATE_AUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_AUTH_REQ, sessionId)
999#define CSR_IS_ROAM_SUBSTATE_REASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_REASSOC_REQ, sessionId)
1000#define CSR_IS_ROAM_SUBSTATE_DISASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REQ, sessionId)
1001#define CSR_IS_ROAM_SUBSTATE_DISASSOC_NO_JOIN(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN, sessionId)
1002#define CSR_IS_ROAM_SUBSTATE_REASSOC_FAIL(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE, sessionId)
1003#define CSR_IS_ROAM_SUBSTATE_DISASSOC_FORCED(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_FORCED, sessionId)
1004#define CSR_IS_ROAM_SUBSTATE_DEAUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DEAUTH_REQ, sessionId)
1005#define CSR_IS_ROAM_SUBSTATE_START_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_START_BSS_REQ, sessionId)
1006#define CSR_IS_ROAM_SUBSTATE_STOP_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_STOP_BSS_REQ, sessionId)
1007#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 -07001008#define CSR_IS_ROAM_SUBSTATE_CONFIG(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_CONFIG, sessionId)
1009#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 -08001010#define CSR_IS_ROAM_SUBSTATE_DISASSOC_HO(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF, sessionId)
1011#define CSR_IS_ROAM_SUBSTATE_HO_NT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC, sessionId)
1012#define CSR_IS_ROAM_SUBSTATE_HO_NRT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC, sessionId)
1013#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 -07001014
1015#define CSR_IS_PHY_MODE_B_ONLY(pMac) \
1016 ((eCSR_DOT11_MODE_11b == (pMac)->roam.configParam.phyMode) ||\
1017 (eCSR_DOT11_MODE_11b_ONLY == (pMac)->roam.configParam.phyMode))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001018
Jeff Johnson295189b2012-06-20 16:38:30 -07001019#define CSR_IS_PHY_MODE_G_ONLY(pMac) \
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001020 (eCSR_DOT11_MODE_11g == (pMac)->roam.configParam.phyMode || eCSR_DOT11_MODE_11g_ONLY == (pMac)->roam.configParam.phyMode)
1021
Jeff Johnson295189b2012-06-20 16:38:30 -07001022#define CSR_IS_PHY_MODE_A_ONLY(pMac) \
1023 ((eCSR_DOT11_MODE_11a == (pMac)->roam.configParam.phyMode) ||\
1024 (eCSR_DOT11_MODE_11a_ONLY == (pMac)->roam.configParam.phyMode))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001025
Jeff Johnsone7245742012-09-05 17:12:55 -07001026#ifdef WLAN_FEATURE_11AC
1027#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
1028 ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
1029 (eCSR_DOT11_MODE_11ac & (phyMode)) || \
1030 (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
1031 (eCSR_DOT11_MODE_AUTO & (phyMode)))
1032#else
Jeff Johnson295189b2012-06-20 16:38:30 -07001033#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
1034 ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
1035 (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
1036 (eCSR_DOT11_MODE_AUTO & (phyMode)))
Jeff Johnsone7245742012-09-05 17:12:55 -07001037#endif
1038
Jeff Johnson295189b2012-06-20 16:38:30 -07001039
1040// this function returns TRUE if the NIC is operating exclusively in the 2.4 GHz band, meaning
1041// it is NOT operating in the 5.0 GHz band.
1042#define CSR_IS_24_BAND_ONLY(pMac) \
1043 (eCSR_BAND_24 == (pMac)->roam.configParam.eBand)
1044
1045#define CSR_IS_5G_BAND_ONLY(pMac) \
1046 (eCSR_BAND_5G == (pMac)->roam.configParam.eBand)
1047
1048#define CSR_IS_RADIO_DUAL_BAND(pMac) \
1049 (eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability)
1050
1051#define CSR_IS_RADIO_BG_ONLY(pMac) \
1052 (eCSR_BAND_24 == (pMac)->roam.configParam.bandCapability)
1053
1054// this function returns TRUE if the NIC is operating exclusively in the 5.0 GHz band, meaning
1055// it is NOT operating in the 2.4 GHz band
1056#define CSR_IS_RADIO_A_ONLY(pMac) \
1057 (eCSR_BAND_5G == (pMac)->roam.configParam.bandCapability)
1058
1059// this function returns TRUE if the NIC is operating in both bands.
1060#define CSR_IS_OPEARTING_DUAL_BAND(pMac) \
1061 ((eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability) && (eCSR_BAND_ALL == (pMac)->roam.configParam.eBand))
1062
1063// this function returns TRUE if the NIC can operate in the 5.0 GHz band (could operate in the
1064// 2.4 GHz band also).
1065#define CSR_IS_OPERATING_A_BAND(pMac) \
1066 (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_A_ONLY((pMac)) || CSR_IS_5G_BAND_ONLY((pMac)))
1067
1068// this function returns TRUE if the NIC can operate in the 2.4 GHz band (could operate in the
1069// 5.0 GHz band also).
1070#define CSR_IS_OPERATING_BG_BAND(pMac) \
1071 (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_BG_ONLY((pMac)) || CSR_IS_24_BAND_ONLY((pMac)))
1072
1073#define CSR_IS_CHANNEL_5GHZ(chnNum) \
Jeff Johnsone7245742012-09-05 17:12:55 -07001074 (((chnNum) >= CSR_MIN_5GHz_CHANNEL_NUMBER) && ((chnNum) <= CSR_MAX_5GHz_CHANNEL_NUMBER))
Jeff Johnson295189b2012-06-20 16:38:30 -07001075
Srinivas Girigowdade697412013-02-14 16:31:48 -08001076#define CSR_IS_CHANNEL_DFS(chnNum) \
1077 (NV_CHANNEL_ENABLE != vos_nv_getChannelEnabledState(chnNum))
1078
Jeff Johnson295189b2012-06-20 16:38:30 -07001079#define CSR_IS_CHANNEL_24GHZ(chnNum) \
1080 (((chnNum) > 0) && ((chnNum) <= CSR_MAX_24GHz_CHANNEL_NUMBER))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001081
Jeff Johnson295189b2012-06-20 16:38:30 -07001082#define CSR_IS_SAME_BAND_CHANNELS(ch1, ch2) (CSR_IS_CHANNEL_5GHZ(ch1) == CSR_IS_CHANNEL_5GHZ(ch2))
1083
1084
1085#define CSR_IS_11D_INFO_FOUND(pMac) \
1086 (0 != (pMac)->scan.channelOf11dInfo)
1087// DEAUTHIND
1088#define CSR_IS_ROAMING(pSession) ((CSR_IS_LOSTLINK_ROAMING((pSession)->roamingReason)) || \
1089 (eCsrDynamicRoaming == (pSession)->roamingReason) || \
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001090 (eCsrReassocRoaming == (pSession)->roamingReason))
Jeff Johnson295189b2012-06-20 16:38:30 -07001091
1092
1093#define CSR_IS_SET_KEY_COMMAND( pCommand ) ( eSmeCommandSetKey == (pCommand)->command )
1094
1095#define CSR_IS_ADDTS_WHEN_ACMOFF_SUPPORTED(pMac) (pMac->roam.configParam.addTSWhenACMIsOff)
1096// DEAUTHIND
1097#define CSR_IS_LOSTLINK_ROAMING(reason) ((eCsrLostlinkRoamingDisassoc == (reason)) || (eCsrLostlinkRoamingDeauth == (reason)))
1098
Venkata Prathyusha Kuntupalli239278b2013-03-26 15:58:18 -07001099#define CSR_IS_ROAMING_COMMAND(pCommand) ((eCsrLostLink1 == (pCommand)->u.roamCmd.roamReason) ||\
1100 (eCsrLostLink2 == (pCommand)->u.roamCmd.roamReason) ||\
1101 (eCsrLostLink3 == (pCommand)->u.roamCmd.roamReason) )
1102
1103
Jeff Johnson295189b2012-06-20 16:38:30 -07001104//Stop CSR from asking for IMPS, This function doesn't disable IMPS from CSR
1105void csrScanSuspendIMPS( tpAniSirGlobal pMac );
1106//Start CSR from asking for IMPS. This function doesn't trigger CSR to request entering IMPS
1107//because IMPS maybe disabled.
1108void csrScanResumeIMPS( tpAniSirGlobal pMac );
1109
1110eHalStatus csrInitGetChannels(tpAniSirGlobal pMac);
Venkata Prathyusha Kuntupalli316247e2013-03-15 17:45:25 -07001111// Getting the 5GHz Channel list
1112eHalStatus csrGet5GChannels(tpAniSirGlobal pMac);
1113// Getting the 2.4GHz Channel list
1114eHalStatus csrGet24GChannels(tpAniSirGlobal pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001115
1116eHalStatus csrSetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1117 tCsrRoamModifyProfileFields *pModifyProfileFields);
1118/* ---------------------------------------------------------------------------
1119 \fn csrGetModifyProfileFields
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001120 \brief HDD or SME - QOS calls this function to get the current values of
Jeff Johnson295189b2012-06-20 16:38:30 -07001121 connected profile fields changing which can cause reassoc.
1122 This function must be called after CFG is downloaded and STA is in connected
1123 state.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001124 \param pModifyProfileFields - pointer to the connected profile fields
Jeff Johnson295189b2012-06-20 16:38:30 -07001125 changing which can cause reassoc
1126
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001127 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001128 -------------------------------------------------------------------------------*/
1129eHalStatus csrGetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1130 tCsrRoamModifyProfileFields * pModifyProfileFields);
1131void csrSetGlobalCfgs( tpAniSirGlobal pMac );
1132void csrSetDefaultDot11Mode( tpAniSirGlobal pMac );
1133void csrScanSetChannelMask(tpAniSirGlobal pMac, tCsrChannelInfo *pChannelInfo);
1134tANI_BOOLEAN csrIsConnStateDisconnected(tpAniSirGlobal pMac, tANI_U32 sessionId);
1135tANI_BOOLEAN csrIsConnStateConnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1136tANI_BOOLEAN csrIsConnStateDisconnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1137tANI_BOOLEAN csrIsConnStateConnectedInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1138tANI_BOOLEAN csrIsConnStateConnected( tpAniSirGlobal pMac, tANI_U32 sessionId );
1139tANI_BOOLEAN csrIsConnStateInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1140tANI_BOOLEAN csrIsConnStateIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1141tANI_BOOLEAN csrIsConnStateWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1142tANI_BOOLEAN csrIsConnStateConnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1143tANI_BOOLEAN csrIsConnStateDisconnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1144tANI_BOOLEAN csrIsAnySessionInConnectState( tpAniSirGlobal pMac );
1145tANI_BOOLEAN csrIsAllSessionDisconnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudi48081ef2012-12-04 16:49:55 -08001146tANI_BOOLEAN csrIsStaSessionConnected( tpAniSirGlobal pMac );
1147tANI_BOOLEAN csrIsP2pSessionConnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudid3d22592012-09-24 14:01:29 -07001148tANI_BOOLEAN csrIsAnySessionConnected( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001149tANI_BOOLEAN csrIsInfraConnected( tpAniSirGlobal pMac );
1150tANI_BOOLEAN csrIsConcurrentInfraConnected( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001151tANI_BOOLEAN csrIsConcurrentSessionRunning( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001152tANI_BOOLEAN csrIsInfraApStarted( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001153tANI_BOOLEAN csrIsIBSSStarted( tpAniSirGlobal pMac );
1154tANI_BOOLEAN csrIsBTAMPStarted( tpAniSirGlobal pMac );
1155tANI_BOOLEAN csrIsBTAMP( tpAniSirGlobal pMac, tANI_U32 sessionId );
1156eHalStatus csrIsBTAMPAllowed( tpAniSirGlobal pMac, tANI_U32 chnId );
Jeff Johnsone7245742012-09-05 17:12:55 -07001157tANI_BOOLEAN csrIsValidMcConcurrentSession(tpAniSirGlobal pMac, tANI_U32 sessionId,
1158 tSirBssDescription *pBssDesc);
Jeff Johnson295189b2012-06-20 16:38:30 -07001159tANI_BOOLEAN csrIsConnStateConnectedInfraAp( tpAniSirGlobal pMac, tANI_U32 sessionId );
Jeff Johnson295189b2012-06-20 16:38:30 -07001160/*----------------------------------------------------------------------------
1161 \fn csrRoamRegisterLinkQualityIndCallback
1162
1163 \brief
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001164 a CSR function to allow HDD to register a callback handler with CSR for
1165 link quality indications.
Jeff Johnson295189b2012-06-20 16:38:30 -07001166
1167 Only one callback may be registered at any time.
1168 In order to deregister the callback, a NULL cback may be provided.
1169
1170 Registration happens in the task context of the caller.
1171
1172 \param callback - Call back being registered
1173 \param pContext - user data
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001174
Jeff Johnson295189b2012-06-20 16:38:30 -07001175 DEPENDENCIES: After CSR open
1176
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001177 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001178-----------------------------------------------------------------------------*/
1179eHalStatus csrRoamRegisterLinkQualityIndCallback(tpAniSirGlobal pMac,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001180 csrRoamLinkQualityIndCallback callback,
Jeff Johnson295189b2012-06-20 16:38:30 -07001181 void *pContext);
1182/* ---------------------------------------------------------------------------
1183 \fn csrGetStatistics
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001184 \brief csr function that client calls to register a callback to get
1185 different PHY level statistics from CSR.
1186
Jeff Johnson295189b2012-06-20 16:38:30 -07001187 \param requesterId - different client requesting for statistics, HDD, UMA/GAN etc
1188 \param statsMask - The different category/categories of stats requester is looking for
1189 \param callback - SME sends back the requested stats using the callback
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001190 \param periodicity - If requester needs periodic update, 0 means it's an one
Jeff Johnson295189b2012-06-20 16:38:30 -07001191 time request
1192 \param cache - If requester is happy with cached stats
1193 \param staId - The station ID for which the stats is requested for
1194 \param pContext - user context to be passed back along with the callback
1195
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001196 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001197 ---------------------------------------------------------------------------*/
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001198eHalStatus csrGetStatistics(tpAniSirGlobal pMac, eCsrStatsRequesterType requesterId,
1199 tANI_U32 statsMask,
1200 tCsrStatsCallback callback,
1201 tANI_U32 periodicity, tANI_BOOLEAN cache,
Jeff Johnson295189b2012-06-20 16:38:30 -07001202 tANI_U8 staId, void *pContext);
1203
1204
1205eHalStatus csrGetRssi(tpAniSirGlobal pMac,tCsrRssiCallback callback,tANI_U8 staId,tCsrBssid bssId,void * pContext,void * pVosContext);
Srinivas Girigowdad34cedb2013-01-25 13:33:11 -08001206#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
1207eHalStatus csrGetRoamRssi(tpAniSirGlobal pMac,
1208 tCsrRssiCallback callback,
1209 tANI_U8 staId,
1210 tCsrBssid bssId,
1211 void * pContext,
1212 void * pVosContext);
1213#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001214eHalStatus csrRoamRegisterCallback(tpAniSirGlobal pMac, csrRoamCompleteCallback callback, void *pContext);
1215/* ---------------------------------------------------------------------------
1216 \fn csrGetConfigParam
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001217 \brief HDD calls this function to get the global settings currently maintained by CSR.
Jeff Johnson295189b2012-06-20 16:38:30 -07001218 \param pParam - caller allocated memory
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001219 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001220 -------------------------------------------------------------------------------*/
1221eHalStatus csrGetConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1222
1223/* ---------------------------------------------------------------------------
1224 \fn csrMsgProcessor
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001225 \brief HDD calls this function to change some global settings.
Jeff Johnson295189b2012-06-20 16:38:30 -07001226 caller must set the all fields or call csrGetConfigParam to prefill the fields.
1227 \param pParam - caller allocated memory
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001228 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001229 -------------------------------------------------------------------------------*/
1230eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1231
1232
1233/* ---------------------------------------------------------------------------
1234 \fn csrMsgProcessor
1235 \brief HDD calls this function for the messages that are handled by CSR.
1236 \param pMsgBuf - a pointer to a buffer that maps to various structures base on the message type.
1237 The beginning of the buffer can always map to tSirSmeRsp.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001238 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001239 -------------------------------------------------------------------------------*/
1240eHalStatus csrMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf );
1241
1242/* ---------------------------------------------------------------------------
1243 \fn csrOpen
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001244 \brief This function must be called before any API call to CSR.
1245 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001246 -------------------------------------------------------------------------------*/
1247eHalStatus csrOpen(tpAniSirGlobal pMac);
1248/* ---------------------------------------------------------------------------
1249 \fn csrClose
1250 \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 -08001251 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001252 -------------------------------------------------------------------------------*/
1253eHalStatus csrClose(tpAniSirGlobal pMac);
1254/* ---------------------------------------------------------------------------
1255 \fn csrStart
1256 \brief To start CSR.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001257 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001258 -------------------------------------------------------------------------------*/
1259eHalStatus csrStart(tpAniSirGlobal pMac);
1260/* ---------------------------------------------------------------------------
1261 \fn csrStop
1262 \brief To stop CSR. CSR still keeps its current setting.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001263 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001264 -------------------------------------------------------------------------------*/
1265eHalStatus csrStop(tpAniSirGlobal pMac);
1266/* ---------------------------------------------------------------------------
1267 \fn csrReady
1268 \brief To let CSR is ready to operate
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001269 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001270 -------------------------------------------------------------------------------*/
1271eHalStatus csrReady(tpAniSirGlobal pMac);
1272
1273#ifdef FEATURE_WLAN_WAPI
1274eHalStatus csrRoamGetBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pNum,
1275 tBkidCacheInfo *pBkidCache);
1276
1277
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001278eHalStatus csrScanGetBKIDCandidateList(tpAniSirGlobal pMac, tANI_U32 sessionId,
Jeff Johnson295189b2012-06-20 16:38:30 -07001279 tBkidCandidateInfo *pBkidList, tANI_U32 *pNumItems );
1280tANI_U32 csrRoamGetNumBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId);
1281eHalStatus csrRoamSetBKIDCache( tpAniSirGlobal pMac, tANI_U32 sessionId, tBkidCacheInfo *pBKIDCache,
1282 tANI_U32 numItems );
1283/* ---------------------------------------------------------------------------
1284 \fn csrRoamGetWapiReqIE
1285 \brief return the WAPI IE CSR passes to PE to JOIN request or START_BSS request
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001286 \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 -07001287 needed or IE length in pBuf.
1288 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1289 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1290 -------------------------------------------------------------------------------*/
1291eHalStatus csrRoamGetWapiReqIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
1292
1293/* ---------------------------------------------------------------------------
1294 \fn csrRoamGetWapiRspIE
1295 \brief return the WAPI IE from the beacon or probe rsp if connected
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001296 \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 -07001297 needed or IE length in pBuf.
1298 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1299 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1300 -------------------------------------------------------------------------------*/
1301eHalStatus csrRoamGetWapiRspIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001302tANI_U8 csrConstructWapiIe( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
Jeff Johnson295189b2012-06-20 16:38:30 -07001303 tSirBssDescription *pSirBssDesc, tDot11fBeaconIEs *pIes, tCsrWapiIe *pWapiIe );
1304#endif /* FEATURE_WLAN_WAPI */
1305
Jeff Johnson295189b2012-06-20 16:38:30 -07001306eHalStatus csrRoamUpdateAPWPSIE( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirAPWPSIEs *pAPWPSIES );
1307eHalStatus csrRoamUpdateWPARSNIEs( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirRSNie * pAPSirRSNie);
Jeff Johnson295189b2012-06-20 16:38:30 -07001308void csrSetCfgPrivacy( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, tANI_BOOLEAN fPrivacy );
1309tANI_S8 csrGetInfraSessionId( tpAniSirGlobal pMac );
1310tANI_U8 csrGetInfraOperationChannel( tpAniSirGlobal pMac, tANI_U8 sessionId);
1311tANI_U8 csrGetConcurrentOperationChannel( tpAniSirGlobal pMac );
1312
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001313eHalStatus csrRoamCopyConnectProfile(tpAniSirGlobal pMac, tANI_U32 sessionId,
Jeff Johnson295189b2012-06-20 16:38:30 -07001314 tCsrRoamConnectedProfile *pProfile);
1315tANI_BOOLEAN csrIsSetKeyAllowed(tpAniSirGlobal pMac, tANI_U32 sessionId);
1316
1317void csrSetOppositeBandChannelInfo( tpAniSirGlobal pMac );
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001318void csrConstructCurrentValidChannelList( tpAniSirGlobal pMac, tDblLinkList *pChannelSetList,
Jeff Johnson295189b2012-06-20 16:38:30 -07001319 tANI_U8 *pChannelList, tANI_U8 bSize, tANI_U8 *pNumChannels );
Srikant Kuppa066904f2013-05-07 13:56:02 -07001320eHalStatus csrScanSavePreferredNetworkFound(tpAniSirGlobal pMac,
1321 tSirPrefNetworkFoundInd *pPrefNetworkFoundInd);
Jeff Johnson295189b2012-06-20 16:38:30 -07001322#endif
1323
1324#ifdef WLAN_FEATURE_VOWIFI_11R
1325//Returns whether the current association is a 11r assoc or not
1326tANI_BOOLEAN csrRoamIs11rAssoc(tpAniSirGlobal pMac);
1327#endif
1328
1329#ifdef FEATURE_WLAN_CCX
1330//Returns whether the current association is a CCX assoc or not
1331tANI_BOOLEAN csrRoamIsCCXAssoc(tpAniSirGlobal pMac);
1332#endif
1333
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001334//Remove this code once SLM_Sessionization is supported
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -07001335//BMPS_WORKAROUND_NOT_NEEDED
Jeff Johnson295189b2012-06-20 16:38:30 -07001336void csrDisconnectAllActiveSessions(tpAniSirGlobal pMac);
Mohit Khanna349bc392012-09-11 17:24:52 -07001337
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001338#ifdef FEATURE_WLAN_LFR
1339//Returns whether "Legacy Fast Roaming" is enabled...or not
Madan Mohan Koyyalamudi03aae5f2012-11-28 01:51:22 +05301340tANI_BOOLEAN csrRoamIsFastRoamEnabled(tpAniSirGlobal pMac, tANI_U32 sessionId);
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -07001341#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
1342tANI_BOOLEAN csrRoamIsRoamOffloadScanEnabled(tpAniSirGlobal pMac);
1343#endif
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -07001344tANI_BOOLEAN csrIsChannelPresentInList( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel );
1345VOS_STATUS csrAddToChannelListFront( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel );
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -07001346#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
1347eHalStatus csrScanRequestLfrResult(tpAniSirGlobal pMac, tANI_U32 sessionId,
1348 csrScanCompleteCallback callback, void *pContext);
Varun Reddy Yeturucc661d22013-05-20 11:47:10 -07001349eHalStatus csrRoamOffloadScanRspHdlr(tpAniSirGlobal pMac, tANI_U8 reason);
1350eHalStatus csrHandoffRequest(tpAniSirGlobal pMac, tCsrHandoffRequest *pHandoffInfo);
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -07001351#endif
1352tANI_BOOLEAN csrRoamIsStaMode(tpAniSirGlobal pMac, tANI_U32 sessionId);
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001353#endif
1354