blob: 222ed8ebda3957f007474c05a4af3da3adb35cd3 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lam0fb93dd2014-02-19 00:32:59 -08002 * Copyright (c) 2011-2014 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
22/*
Kiet Lama7f454d2014-07-24 12:04:06 -070023 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
Kiet Lam0fb93dd2014-02-19 00:32:59 -080026 */
27
Jeff Johnson295189b2012-06-20 16:38:30 -070028
Kiet Lama7f454d2014-07-24 12:04:06 -070029
30
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -080031/** ------------------------------------------------------------------------- *
32 ------------------------------------------------------------------------- *
Jeff Johnson295189b2012-06-20 16:38:30 -070033
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -080034
Jeff Johnson295189b2012-06-20 16:38:30 -070035 \file csrInternal.h
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -080036
Jeff Johnson295189b2012-06-20 16:38:30 -070037 Define internal data structure for MAC.
Jeff Johnson295189b2012-06-20 16:38:30 -070038 ========================================================================== */
39#ifndef CSRINTERNAL_H__
40#define CSRINTERNAL_H__
41
Jeff Johnson295189b2012-06-20 16:38:30 -070042#include "vos_status.h"
43#include "vos_lock.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070044
45#include "palTimer.h"
46#include "csrSupport.h"
47#include "vos_nvitem.h"
48#include "wlan_qct_tl.h"
49
50#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
51#include "csrNeighborRoam.h"
52#endif
53
54#define CSR_MAX_STA (HAL_NUM_STA)
55
56#define CSR_SME_SCAN_FLAGS_DELETE_CACHE 0x80
57
58#define CSR_TITAN_MAX_RATE_MIMO_CB 240
59#define CSR_TITAN_MAX_RATE_MIMO 126
60
61//define scan return criteria. LIM should use these define as well
62#define CSR_SCAN_RETURN_AFTER_ALL_CHANNELS ( 0 )
63#define CSR_SCAN_RETURN_AFTER_FIRST_MATCH ( 0x01 )
64#define CSR_SCAN_RETURN_AFTER_5_BAND_11d_FOUND ( 0x80 )
65#define CSR_SCAN_RETURN_AFTER_24_BAND_11d_FOUND ( 0x40 )
66#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 -070067#define CSR_NUM_RSSI_CAT 15
Jeff Johnson295189b2012-06-20 16:38:30 -070068#define CSR_MAX_STATISTICS_REQ 10
Varun Reddy Yeturu9d4102c2013-12-02 15:47:03 -080069#define CSR_ROAM_SCAN_CHANNEL_SWITCH_TIME 3
Jeff Johnson295189b2012-06-20 16:38:30 -070070
71//Support for multiple session
72#define CSR_SESSION_ID_INVALID 0xFF // session ID invalid
73#define CSR_ROAM_SESSION_MAX 5 // No of sessions to be supported, and a
74 // session is for Infra, IBSS or BT-AMP
75
76#define CSR_IS_SESSION_VALID( pMac, sessionId ) ( ( (sessionId) < CSR_ROAM_SESSION_MAX ) \
77 && ( (pMac)->roam.roamSession[(sessionId)].sessionActive ) )
78#define CSR_GET_SESSION( pMac, sessionId ) \
79( \
80 (sessionId < CSR_ROAM_SESSION_MAX) ? \
81 (&(pMac)->roam.roamSession[(sessionId)]) :\
82 NULL \
83)
84
Agrawal Ashish0b6984f2014-04-05 18:35:45 +053085#define CSR_MAX_NUM_COUNTRY_CODE 100
Srinivas Girigowda41c7c5f2013-10-21 19:01:38 -070086#define CSR_IS_SELECT_5GHZ_MARGIN( pMac ) \
87( \
88 (((pMac)->roam.configParam.nSelect5GHzMargin)?eANI_BOOLEAN_TRUE:eANI_BOOLEAN_FALSE) \
89)
90
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -080091#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR)
Madan Mohan Koyyalamudid5026072012-11-30 14:56:21 -080092#define CSR_IS_ROAM_PREFER_5GHZ( pMac ) \
93( \
94 (((pMac)->roam.configParam.nRoamPrefer5GHz)?eANI_BOOLEAN_TRUE:eANI_BOOLEAN_FALSE) \
95)
Srinivas Girigowdabbd16eb2013-03-21 12:34:46 -070096#define CSR_IS_ROAM_INTRA_BAND_ENABLED( pMac ) \
97( \
98 (((pMac)->roam.configParam.nRoamIntraBand)?eANI_BOOLEAN_TRUE:eANI_BOOLEAN_FALSE) \
99)
Madan Mohan Koyyalamudid5026072012-11-30 14:56:21 -0800100#endif
101
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700102#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
103#define CSR_IS_ROAM_SCAN_OFFLOAD_ENABLED( pMac ) \
104( \
105 (((pMac)->roam.configParam.isRoamOffloadScanEnabled)?eANI_BOOLEAN_TRUE:eANI_BOOLEAN_FALSE) \
106)
Srinivas Girigowda830bbd02013-06-13 19:44:16 -0700107
108#define CSR_IS_FASTROAM_IN_CONCURRENCY_INI_FEATURE_ENABLED( pMac ) \
109( \
110 (((pMac)->roam.configParam.bFastRoamInConIniFeatureEnabled)?eANI_BOOLEAN_TRUE:eANI_BOOLEAN_FALSE) \
111)
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700112#endif
113
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800114//Support for "Fast roaming" (i.e., ESE, LFR, or 802.11r.)
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -0700115#define CSR_BG_SCAN_OCCUPIED_CHANNEL_LIST_LEN 15
Jeff Johnson295189b2012-06-20 16:38:30 -0700116
117typedef enum
118{
119 //eCSR_CFG_DOT11_MODE_BEST = 0,
120 eCSR_CFG_DOT11_MODE_TAURUS = 0,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800121 eCSR_CFG_DOT11_MODE_ABG,
122 eCSR_CFG_DOT11_MODE_11A,
123 eCSR_CFG_DOT11_MODE_11B,
124 eCSR_CFG_DOT11_MODE_11G,
125 eCSR_CFG_DOT11_MODE_11N,
126 eCSR_CFG_DOT11_MODE_POLARIS,
127 eCSR_CFG_DOT11_MODE_TITAN,
Jeff Johnsone7245742012-09-05 17:12:55 -0700128#ifdef WLAN_FEATURE_11AC
129 eCSR_CFG_DOT11_MODE_11AC,
130#endif
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800131 eCSR_CFG_DOT11_MODE_11G_ONLY,
132 eCSR_CFG_DOT11_MODE_11N_ONLY,
Jeff Johnsone7245742012-09-05 17:12:55 -0700133#ifdef WLAN_FEATURE_11AC
134 eCSR_CFG_DOT11_MODE_11AC_ONLY,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800135#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700136 //This value can never set to CFG. It is for CSR's internal use
137 eCSR_CFG_DOT11_MODE_AUTO,
138}eCsrCfgDot11Mode; //Used to determine what to set to the WNI_CFG_DOT11_MODE
139
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800140typedef enum etCsrRoamCommands
Jeff Johnson295189b2012-06-20 16:38:30 -0700141{
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800142 eCsrRoamNoCommand,
Jeff Johnson295189b2012-06-20 16:38:30 -0700143 eCsrRoamCommandScan,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800144 eCsrRoamCommandRoam,
145 eCsrRoamCommandWmStatusChange,
Jeff Johnson295189b2012-06-20 16:38:30 -0700146 eCsrRoamCommandSetKey,
147 eCsrRoamCommandRemoveKey,
148
149} eCsrRoamCommands;
150
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800151typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700152{
153 eCsrScanOther = 1,
154 eCsrScanLostLink1,
155 eCsrScanLostLink2,
156 eCsrScanLostLink3,
157 eCsrScanLostLink4,
158 eCsrScan11d1, //First 11d scan
159 eCsrScan11d2, //First 11d scan has failed
160 eCsrScan11dDone, //11d scan succeeded, try the rest of the channel
161 eCsrScanUserRequest,
162 eCsrScanGetResult,
163 eCsrScanSetBGScanParam, //used for HO too - bg scan request in NT Handoff sub-state
164 eCsrScanForSsid,
165 eCsrScanForCapsChange,
166 eCsrScanBGScanAbort,
167 eCsrScanBGScanEnable,
168 eCsrScanIdleScan,
169 eCsrScanGetScanChnInfo, //To get the list of channels scanned
170
171 eCsrScanBgScan, // bg scan request in NRT & RT Handoff sub-states
172 eCsrScanProbeBss, // directed probe on an entry from the candidate list - HO
173 eCsrScanAbortBgScan, //aborting a BG scan (meaning the scan is triggered by LIM timer)
174 eCsrScanAbortNormalScan, //aborting a normal scan (the scan is trigger by eWNI_SME_SCAN_REQ)
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700175 eCsrScanP2PFindPeer,
176 eCsrScanGetLfrResult, // get the LFR candidates from PE scan cache
Jeff Johnson295189b2012-06-20 16:38:30 -0700177}eCsrScanReason;
178
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800179typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700180{
181 eCsrNoConnection, // Roaming because we have not established the initial connection.
182 eCsrCapsChange, // roaming because LIM reported a Capability change in the associated AP.
183 eCsrForcedDisassoc, // roaming becuase someone asked us to Disassoc and stay disassociated.
184 eCsrHddIssued, // roaming because an 802.11 request was issued to the driver.
185 eCsrLostLink1, // roaming because we lost link to an associated AP
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800186 eCsrLostLink2,
Jeff Johnson295189b2012-06-20 16:38:30 -0700187 eCsrLostLink3,
188 eCsrForcedDisassocMICFailure, // roaming because we need to force a Disassoc due to MIC failure
189 eCsrHddIssuedReassocToSameAP,
190 eCsrSmeIssuedReassocToSameAP,
191 eCsrSmeIssuedReassocToDiffAP,
192 eCsrForcedDeauth, // roaming becuase someone asked us to deauth and stay disassociated.
193 eCsrSmeIssuedDisassocForHandoff, // will be issued by Handoff logic to disconect from current AP
194 eCsrSmeIssuedAssocToSimilarAP, // will be issued by Handoff logic to join a new AP with same profile
195 eCsrSmeIssuedIbssJoinFailure, // ibss join timer fired before any perr showed up, so shut down the network
196 eCsrForcedIbssLeave,
197 eCsrStopBss,
198 eCsrSmeIssuedFTReassoc,
199 eCsrForcedDisassocSta,
200 eCsrForcedDeauthSta,
Madan Mohan Koyyalamudi286b60e2012-10-11 12:59:07 -0700201 eCsrPerformPreauth,
Venkata Prathyusha Kuntupalli239278b2013-03-26 15:58:18 -0700202 eCsrLostLink1Abort,
203 eCsrLostLink2Abort,
204 eCsrLostLink3Abort,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800205
Jeff Johnson295189b2012-06-20 16:38:30 -0700206}eCsrRoamReason;
207
208typedef enum
209{
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800210 eCSR_ROAM_SUBSTATE_NONE = 0,
211 eCSR_ROAM_SUBSTATE_START_BSS_REQ,
212 eCSR_ROAM_SUBSTATE_JOIN_REQ,
213 eCSR_ROAM_SUBSTATE_REASSOC_REQ,
214 eCSR_ROAM_SUBSTATE_DISASSOC_REQ,
215 eCSR_ROAM_SUBSTATE_STOP_BSS_REQ,
216 eCSR_ROAM_SUBSTATE_DISCONNECT_CONTINUE_ROAMING, //Continue the current roam command after disconnect
217 eCSR_ROAM_SUBSTATE_AUTH_REQ,
218 eCSR_ROAM_SUBSTATE_CONFIG,
219 eCSR_ROAM_SUBSTATE_DEAUTH_REQ,
220 eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN,
221 eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE,
222 eCSR_ROAM_SUBSTATE_DISASSOC_FORCED,
Jeff Johnson295189b2012-06-20 16:38:30 -0700223 eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY,
224 eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF,
225 eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC,
226 eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC,
227 eCSR_ROAM_SUBSTATE_JOINED_REALTIME_TRAFFIC,
228// max is 15 unless the bitfield is expanded...
229} eCsrRoamSubState;
230
231
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800232typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700233{
234 eCSR_ROAMING_STATE_STOP = 0,
235 eCSR_ROAMING_STATE_IDLE,
236 eCSR_ROAMING_STATE_SCANNING,
237 eCSR_ROAMING_STATE_JOINING,
238 eCSR_ROAMING_STATE_JOINED,
239}eCsrRoamState;
240
241
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800242typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700243{
244 eCsrContinueRoaming,
245 eCsrStopRoaming,
246 eCsrStartIbss,
247 eCsrStartIbssSameIbss,
248 eCsrReassocToSelfNoCapChange,
Jeff Johnsone7245742012-09-05 17:12:55 -0700249 eCsrStopRoamingDueToConcurrency,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800250
Jeff Johnson295189b2012-06-20 16:38:30 -0700251}eCsrJoinState;
252
253typedef enum
254{
255 eCsrNotRoaming,
256 eCsrLostlinkRoamingDisassoc,
257 eCsrLostlinkRoamingDeauth,
258 eCsrDynamicRoaming,
259 eCsrReassocRoaming,
260}eCsrRoamingReason;
261
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800262typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700263{
264 eCsrDisassociated,
265 eCsrDeauthenticated
266
267}eCsrRoamWmStatusChangeTypes;
268
269typedef enum
270{
271 eCsrSummaryStats = 0,
272 eCsrGlobalClassAStats,
273 eCsrGlobalClassBStats,
274 eCsrGlobalClassCStats,
275 eCsrGlobalClassDStats,
276 eCsrPerStaStats,
277 eCsrMaxStats
278}eCsrRoamStatsClassTypes;
279
280#ifdef FEATURE_WLAN_DIAG_SUPPORT
281typedef enum
282{
283 eCSR_WLAN_STATUS_CONNECT =0,
284 eCSR_WLAN_STATUS_DISCONNECT
285
286}eCsrDiagWlanStatusEventSubtype;
287
288typedef enum
289{
290 eCSR_REASON_UNSPECIFIED = 0,
291 eCSR_REASON_USER_REQUESTED,
292 eCSR_REASON_MIC_ERROR,
293 eCSR_REASON_DISASSOC,
294 eCSR_REASON_DEAUTH,
295 eCSR_REASON_HANDOFF,
296
297}eCsrDiagWlanStatusEventReason;
298
299typedef enum
300{
301 eCSR_WLAN_HANDOFF_EVENT =0,
302
303}eCsrDiagWlanHandoffEventSubtype;
304
305typedef enum
306{
307 eCSR_WLAN_VCC_EVENT =0,
308
309}eCsrDiagWlanVccEventSubtype;
310
311#endif //FEATURE_WLAN_DIAG_SUPPORT
312
313typedef struct tagCsrChannel
314{
315 tANI_U8 numChannels;
316 tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
317}tCsrChannel;
318
319typedef struct tagScanProfile
320{
321 tANI_U32 minChnTime;
322 tANI_U32 maxChnTime;
323 tANI_U32 restTime; //This is ignored if not associated
324 tANI_U32 numOfChannels;
325 tANI_U8 *pChannelList;
326 tSirScanType scanType; //active or passive
327 eCsrRoamBssType bssType; //BSS or IBSS
328 tANI_U8 ssid[WNI_CFG_SSID_LEN];
329 tANI_U8 bReturnAfter1stMatch;
330 tANI_U8 fUniqueResult;
331 tANI_U8 freshScan;
332 tCsrBssid bssid;
333}tScanProfile;
334
335typedef struct tagBssConfigParam
336{
337 eCsrMediaAccessType qosType;
338 tSirMacSSid SSID;
339 tANI_U32 uRTSThresh;
340 tANI_U32 uDeferThresh; //
341 eCsrCfgDot11Mode uCfgDot11Mode;
342 eCsrBand eBand;
343 tANI_U8 standardRate[CSR_DOT11_SUPPORTED_RATES_MAX];
344 tANI_U8 extendedRate[CSR_DOT11_EXTENDED_SUPPORTED_RATES_MAX];
345 eCsrExposedTxRate txRate;
346 tAniAuthType authType;
347 eCsrEncryptionType encType;
348 tANI_U32 uShortSlotTime;
349 tANI_U32 uHTSupport; //High throughput
350 tANI_U32 uPowerLimit;
351 tANI_U32 uHeartBeatThresh;
352 tANI_U32 uJoinTimeOut;
353 tSirMacCapabilityInfo BssCap;
354 tANI_BOOLEAN f11hSupport;
Jeff Johnsone7245742012-09-05 17:12:55 -0700355 ePhyChanBondState cbMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700356}tBssConfigParam;
357
358
359typedef struct tagCsrRoamStartBssParams
360{
361 tSirMacSSid ssId;
362 tCsrBssid bssid; //this is the BSSID for the party we want to join (only use for IBSS or WDS)
363 tSirNwType sirNwType;
Jeff Johnsone7245742012-09-05 17:12:55 -0700364 ePhyChanBondState cbMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700365 tSirMacRateSet operationalRateSet;
366 tSirMacRateSet extendedRateSet;
367 tANI_U8 operationChn;
368 eCsrCfgDot11Mode uCfgDot11Mode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700369 tANI_U8 privacy;
370 tANI_BOOLEAN fwdWPSPBCProbeReq;
371 tANI_BOOLEAN protEnabled;
372 tANI_BOOLEAN obssProtEnabled;
373 tAniAuthType authType;
374 tANI_U16 beaconInterval; //If this is 0, SME will fill in for caller.
375 tANI_U16 ht_protection;
376 tANI_U32 dtimPeriod;
377 tANI_U8 ApUapsdEnable;
378 tANI_U8 ssidHidden;
379 tANI_U8 wps_state;
Jeff Johnson295189b2012-06-20 16:38:30 -0700380 tVOS_CON_MODE bssPersona;
381 tANI_U16 nRSNIELength; //The byte count in the pRSNIE, if 0, pRSNIE is ignored.
382 tANI_U8 *pRSNIE; //If not null, it has the IE byte stream for RSN
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800383 tANI_BOOLEAN updatebeaconInterval; //Flag used to indicate update
384 // beaconInterval
Chet Lanctot8cecea22014-02-11 19:09:36 -0800385#ifdef WLAN_FEATURE_11W
386 tANI_BOOLEAN mfpCapable;
387 tANI_BOOLEAN mfpRequired;
388#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700389}tCsrRoamStartBssParams;
390
391
392typedef struct tagScanCmd
393{
394 tANI_U32 scanID;
395 csrScanCompleteCallback callback;
396 void *pContext;
397 eCsrScanReason reason;
398 eCsrRoamState lastRoamState[CSR_ROAM_SESSION_MAX];
399 tCsrRoamProfile *pToRoamProfile;
400 tANI_U32 roamId; //this is the ID related to the pToRoamProfile
401 union
402 {
403 tCsrScanRequest scanRequest;
404 tCsrBGScanRequest bgScanRequest;
405 }u;
Srinivas, Dasari187ca4e2014-02-07 12:40:09 +0530406 //This flag will be set while aborting the scan due to band change
407 tANI_BOOLEAN abortScanDueToBandChange;
Jeff Johnson295189b2012-06-20 16:38:30 -0700408}tScanCmd;
409
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800410typedef struct tagRoamCmd
Jeff Johnson295189b2012-06-20 16:38:30 -0700411{
412 tANI_U32 roamId;
413 eCsrRoamReason roamReason;
414 tCsrRoamProfile roamProfile;
415 tScanResultHandle hBSSList; //BSS list fits the profile
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800416 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 -0700417 tSirBssDescription *pLastRoamBss; //the last BSS we try and failed
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800418 tANI_BOOLEAN fReleaseBssList; //whether to free hBSSList
Jeff Johnson295189b2012-06-20 16:38:30 -0700419 tANI_BOOLEAN fReleaseProfile; //whether to free roamProfile
420 tANI_BOOLEAN fReassoc; //whether this command is for reassociation
421 tANI_BOOLEAN fUpdateCurRoamProfile; //whether pMac->roam.pCurRoamProfile needs to be updated
422 //this is for CSR internal used only. And it should not be assigned when creating the command
423 //This causes the roam command not to do anything.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800424 tANI_BOOLEAN fReassocToSelfNoCapChange;
Jeff Johnson295189b2012-06-20 16:38:30 -0700425
426 tANI_BOOLEAN fStopWds;
427 tSirMacAddr peerMac;
428 tSirMacReasonCodes reason;
429}tRoamCmd;
430
431typedef struct tagSetKeyCmd
432{
433 tANI_U32 roamId;
434 eCsrEncryptionType encType;
435 eCsrAuthType authType;
436 tAniKeyDirection keyDirection; //Tx, Rx or Tx-and-Rx
437 tSirMacAddr peerMac; //Peer's MAC address. ALL 1's for group key
438 tANI_U8 paeRole; //0 for supplicant
439 tANI_U8 keyId; // Kye index
440 tANI_U8 keyLength; //Number of bytes containing the key in pKey
441 tANI_U8 Key[CSR_MAX_KEY_LEN];
442 tANI_U8 keyRsc[CSR_MAX_RSC_LEN];
443} tSetKeyCmd;
444
445typedef struct tahRemoveKeyCmd
446{
447 tANI_U32 roamId;
448 eCsrEncryptionType encType;
449 eCsrAuthType authType;
450 tSirMacAddr peerMac; //Peer's MAC address. ALL 1's for group key
451 tANI_U8 keyId; //key index
452} tRemoveKeyCmd;
453
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800454typedef struct tagWmStatusChangeCmd
Jeff Johnson295189b2012-06-20 16:38:30 -0700455{
456 eCsrRoamWmStatusChangeTypes Type;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800457 union
458 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700459 tSirSmeDeauthInd DeauthIndMsg;
460 tSirSmeDisassocInd DisassocIndMsg;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800461 }u;
Jeff Johnson295189b2012-06-20 16:38:30 -0700462
463}tWmStatusChangeCmd;
464
Kiran Kumar Lokere0ad5cd32013-06-25 11:26:22 -0700465
Jeff Johnson295189b2012-06-20 16:38:30 -0700466typedef struct tagAddStaForSessionCmd
467{
468 //Session self mac addr
469 tSirMacAddr selfMacAddr;
Kiran Kumar Lokere0ad5cd32013-06-25 11:26:22 -0700470 tVOS_CON_MODE currDeviceMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700471}tAddStaForSessionCmd;
472
473typedef struct tagDelStaForSessionCmd
474{
475 //Session self mac addr
476 tSirMacAddr selfMacAddr;
477 csrRoamSessionCloseCallback callback;
478 void *pContext;
479}tDelStaForSessionCmd;
480
481//This structure represents one scan request
482typedef struct tagCsrCmd
483{
484 tListElem Link;
485 eCsrRoamCommands command;
486 tANI_U8 sessionId; // Session ID for this command
487 union
488 {
489 tScanCmd scanCmd;
490 tRoamCmd roamCmd;
491 tWmStatusChangeCmd wmStatusChangeCmd;
492 tSetKeyCmd setKeyCmd;
493 tRemoveKeyCmd removeKeyCmd;
494 tAddStaForSessionCmd addStaSessionCmd;
495 tDelStaForSessionCmd delStaSessionCmd;
496 }u;
497}tCsrCmd;
498
499#ifdef WLAN_FEATURE_VOWIFI_11R
500typedef struct tagCsr11rConfig
501{
502 tANI_BOOLEAN IsFTResourceReqSupported;
503} tCsr11rConfig;
504#endif
505
506#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
507typedef struct tagCsrNeighborRoamConfig
508{
509 tANI_U32 nNeighborScanTimerPeriod;
510 tANI_U8 nNeighborLookupRssiThreshold;
511 tANI_U8 nNeighborReassocRssiThreshold;
512 tANI_U16 nNeighborScanMinChanTime;
513 tANI_U16 nNeighborScanMaxChanTime;
514 sCsrChannel neighborScanChanList;
515 tANI_U8 nMaxNeighborRetries;
516 tANI_U16 nNeighborResultsRefreshPeriod;
Srinivas Girigowdade697412013-02-14 16:31:48 -0800517 tANI_U16 nEmptyScanRefreshPeriod;
Mukul Sharmad49b3d62014-09-02 01:45:32 +0530518 tANI_U8 nNeighborInitialForcedRoamTo5GhEnable;
Jeff Johnson295189b2012-06-20 16:38:30 -0700519}tCsrNeighborRoamConfig;
520#endif
521
522typedef struct tagCsrConfig
523{
524 tANI_U32 agingCount;
525 tANI_U32 FragmentationThreshold;
526 tANI_U32 channelBondingMode24GHz;
527 tANI_U32 channelBondingMode5GHz;
528 tANI_U32 RTSThreshold;
529 eCsrPhyMode phyMode;
530 eCsrCfgDot11Mode uCfgDot11Mode;
531 eCsrBand eBand;
532 tANI_U32 HeartbeatThresh50;
533 tANI_U32 HeartbeatThresh24;
534 tANI_U32 bgScanInterval;
535 eCsrCBChoice cbChoice;
536 eCsrBand bandCapability; //indicate hw capability
537 eCsrRoamWmmUserModeType WMMSupportMode;
538 tANI_BOOLEAN Is11eSupportEnabled;
539 tANI_BOOLEAN Is11dSupportEnabled;
540 tANI_BOOLEAN Is11dSupportEnabledOriginal;
541 tANI_BOOLEAN Is11hSupportEnabled;
542 tANI_BOOLEAN shortSlotTime;
543 tANI_BOOLEAN ProprietaryRatesEnabled;
544 tANI_BOOLEAN fenableMCCMode;
545 tANI_U16 TxRate;
Madan Mohan Koyyalamudi167b95e2012-11-27 15:53:38 -0800546 tANI_U8 fAllowMCCGODiffBI;
Jeff Johnson295189b2012-06-20 16:38:30 -0700547 tANI_U8 AdHocChannel24;
548 tANI_U8 AdHocChannel5G;
549 tANI_U32 impsSleepTime; //in units of microseconds
550 tANI_U32 scanAgeTimeNCNPS; //scan result aging time threshold when Not-Connect-No-Power-Save, in seconds
551 tANI_U32 scanAgeTimeNCPS; //scan result aging time threshold when Not-Connect-Power-Save, in seconds
552 tANI_U32 scanAgeTimeCNPS; //scan result aging time threshold when Connect-No-Power-Save, in seconds,
553 tANI_U32 scanAgeTimeCPS; //scan result aging time threshold when Connect-Power-Savein seconds
554 tANI_U32 BssPreferValue[CSR_NUM_RSSI_CAT]; //each RSSI category has one value
555 int RSSICat[CSR_NUM_RSSI_CAT];
556 tANI_U8 bCatRssiOffset; //to set the RSSI difference for each category
557 tANI_U32 nRoamingTime; //In seconds, CSR will try this long before gives up, 0 means no roaming
558 //Whether to limit the channels to the ones set in Csr11dInfo. If true, the opertaional
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800559 //channels are limited to the default channel list. It is an "AND" operation between the
Jeff Johnson295189b2012-06-20 16:38:30 -0700560 //default channels and the channels in the 802.11d IE.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800561 tANI_BOOLEAN fEnforce11dChannels;
Jeff Johnson295189b2012-06-20 16:38:30 -0700562 //Country Code Priority
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800563 //0 = 802.11D > Configured Country > NV
Jeff Johnson295189b2012-06-20 16:38:30 -0700564 //1 = Configured Country > 802.11D > NV
565 tANI_BOOLEAN fSupplicantCountryCodeHasPriority;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800566 //When true, AP with unknown country code won't be see.
567 //"Unknown country code" means either Ap doesn't have 11d IE or we cannot
Jeff Johnson295189b2012-06-20 16:38:30 -0700568 //find a domain for the country code in its 11d IE.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800569 tANI_BOOLEAN fEnforceCountryCodeMatch;
Jeff Johnson295189b2012-06-20 16:38:30 -0700570 //When true, only APs in the default domain can be seen. If the Ap has "unknown country
571 //code", or the doamin of the country code doesn't match the default domain, the Ap is
572 //not acceptable.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800573 tANI_BOOLEAN fEnforceDefaultDomain;
Abhishek Singh2ec36ab2014-08-07 16:14:25 +0530574 //When set, It enforece country code even if 11doriginal is true
575 tANI_BOOLEAN fEnforceCountryCode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700576 tANI_U16 vccRssiThreshold;
577 tANI_U32 vccUlMacLossThreshold;
578
579 tANI_U32 nPassiveMinChnTime; //in units of milliseconds
580 tANI_U32 nPassiveMaxChnTime; //in units of milliseconds
581 tANI_U32 nActiveMinChnTime; //in units of milliseconds
582 tANI_U32 nActiveMaxChnTime; //in units of milliseconds
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800583
c_hpothu059edb02014-03-12 21:44:28 +0530584 tANI_U32 nInitialDwellTime; //in units of milliseconds
585
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800586 tANI_U32 nActiveMinChnTimeBtc; //in units of milliseconds
587 tANI_U32 nActiveMaxChnTimeBtc; //in units of milliseconds
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -0700588 tANI_U8 disableAggWithBtc;
Madan Mohan Koyyalamudi4ff9cd62012-10-30 17:48:57 -0700589#ifdef WLAN_AP_STA_CONCURRENCY
590 tANI_U32 nPassiveMinChnTimeConc; //in units of milliseconds
591 tANI_U32 nPassiveMaxChnTimeConc; //in units of milliseconds
592 tANI_U32 nActiveMinChnTimeConc; //in units of milliseconds
593 tANI_U32 nActiveMaxChnTimeConc; //in units of milliseconds
594 tANI_U32 nRestTimeConc; //in units of milliseconds
Sudhir Sattayappa Kohallieb97d502013-05-22 23:16:42 -0700595 tANI_U8 nNumStaChanCombinedConc; //number of channels combined for
596 //Sta in each split scan operation
597 tANI_U8 nNumP2PChanCombinedConc; //number of channels combined for
598 //P2P in each split scan operation
Madan Mohan Koyyalamudi4ff9cd62012-10-30 17:48:57 -0700599#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700600
601 tANI_BOOLEAN IsIdleScanEnabled;
602 //in dBm, the maximum TX power
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800603 //The actual TX power is the lesser of this value and 11d.
Jeff Johnson295189b2012-06-20 16:38:30 -0700604 //If 11d is disable, the lesser of this and default setting.
605 tANI_U8 nTxPowerCap;
606 tANI_U32 statsReqPeriodicity; //stats request frequency from PE while in full power
607 tANI_U32 statsReqPeriodicityInPS;//stats request frequency from PE while in power save
Jeff Johnson295189b2012-06-20 16:38:30 -0700608 tANI_U32 dtimPeriod;
609 tANI_BOOLEAN ssidHidden;
Jeff Johnson295189b2012-06-20 16:38:30 -0700610
611#ifdef WLAN_FEATURE_VOWIFI_11R
612 tCsr11rConfig csr11rConfig;
613#endif
614
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700615#ifdef FEATURE_WLAN_LFR
Srinivas Girigowda830bbd02013-06-13 19:44:16 -0700616 tANI_U8 isFastRoamIniFeatureEnabled;
Sameer Thalappil4ae66ec2013-11-05 14:17:35 -0800617 tANI_U8 MAWCEnabled;
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700618#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
Srinivas Girigowda830bbd02013-06-13 19:44:16 -0700619 tANI_U8 isRoamOffloadScanEnabled;
620 tANI_BOOLEAN bFastRoamInConIniFeatureEnabled;
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700621#endif
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700622#endif
623
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800624#ifdef FEATURE_WLAN_ESE
625 tANI_U8 isEseIniFeatureEnabled;
Jeff Johnson295189b2012-06-20 16:38:30 -0700626#endif
627
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800628#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR)
Srinivas Girigowda100eb322013-03-15 16:48:20 -0700629 tANI_U8 isFastTransitionEnabled;
630 tANI_U8 RoamRssiDiff;
631 tANI_U8 nImmediateRoamRssiDiff;
632 tANI_BOOLEAN nRoamPrefer5GHz;
633 tANI_BOOLEAN nRoamIntraBand;
Srinivas Girigowdaad34ca92013-10-22 10:54:29 -0700634 tANI_BOOLEAN isWESModeEnabled;
Srinivas Girigowda100eb322013-03-15 16:48:20 -0700635 tANI_BOOLEAN nRoamScanControl;
Varun Reddy Yeturu920df212013-05-22 08:07:23 -0700636 tANI_U8 nProbes;
637 tANI_U16 nRoamScanHomeAwayTime;
Jeff Johnson295189b2012-06-20 16:38:30 -0700638#endif
639
640#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
641 tCsrNeighborRoamConfig neighborRoamConfig;
642#endif
643
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800644 /* Instead of Reassoc, send ADDTS/DELTS even when ACM is off for that AC
Jeff Johnson295189b2012-06-20 16:38:30 -0700645 * This is mandated by WMM-AC certification */
646 tANI_BOOLEAN addTSWhenACMIsOff;
647
648 tANI_BOOLEAN fValidateList;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800649 //Remove this code once SLM_Sessionization is supported
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700650 //BMPS_WORKAROUND_NOT_NEEDED
Jeff Johnsone7245742012-09-05 17:12:55 -0700651 tANI_BOOLEAN doBMPSWorkaround;
Jeff Johnson295189b2012-06-20 16:38:30 -0700652
653 //To enable/disable scanning 2.4Ghz channels twice on a single scan request from HDD
654 tANI_BOOLEAN fScanTwice;
Jeff Johnsone7245742012-09-05 17:12:55 -0700655#ifdef WLAN_FEATURE_11AC
656 tANI_U32 nVhtChannelWidth;
Shailender Karmuchi08f87c22013-01-17 12:51:24 -0800657 tANI_U8 txBFEnable;
Shailender Karmuchicc3fe442013-02-16 18:18:33 -0800658 tANI_U8 txBFCsnValue;
Ravi Joshi83bfaa12013-05-28 22:12:08 -0700659 tANI_BOOLEAN enableVhtFor24GHz;
Abhishek Singh6d5d29c2014-07-03 14:25:22 +0530660 tANI_U8 txMuBformee;
Jeff Johnsone7245742012-09-05 17:12:55 -0700661#endif
Gopichand Nakkalab2d2c312013-01-04 11:41:02 -0800662 tANI_U8 txLdpcEnable;
Jeff Johnson295189b2012-06-20 16:38:30 -0700663
Ravi Joshid2ca7c42013-07-23 08:37:49 -0700664 /*
665 * Enable/Disable heartbeat offload
666 */
667 tANI_BOOLEAN enableHeartBeatOffload;
krunal soni5afa96c2013-09-06 22:19:02 -0700668 tANI_U8 isAmsduSupportInAMPDU;
Srinivas Girigowda41c7c5f2013-10-21 19:01:38 -0700669 tANI_U8 nSelect5GHzMargin;
krunal sonie9002db2013-11-25 14:24:17 -0800670 tANI_U8 isCoalesingInIBSSAllowed;
Sandeep Puligillac80f26e2014-03-11 18:36:10 +0530671 tANI_U8 allowDFSChannelRoam;
c_hpothu0d5a7352014-03-22 12:30:25 +0530672 tANI_BOOLEAN initialScanSkipDFSCh;
Abhishek Singhde51a412014-05-20 19:17:26 +0530673 tANI_BOOLEAN sendDeauthBeforeCon;
Hardik Kantilal Pateldd107952014-11-20 15:24:52 +0530674#ifdef WLAN_FEATURE_AP_HT40_24G
675 tANI_BOOLEAN apHT40_24GEnabled;
676 tANI_U32 channelBondingAPMode24GHz; // Use for SAP/P2P GO 2.4GHz channel Bonding
677#endif
Sushant Kaushikc9682be2014-11-26 12:27:04 +0530678 tANI_U32 nOBSSScanWidthTriggerInterval;
Girish Gowli1c2fc802015-01-19 16:18:07 +0530679 tANI_U8 roamDelayStatsEnabled;
Jeff Johnson295189b2012-06-20 16:38:30 -0700680}tCsrConfig;
681
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800682typedef struct tagCsrChannelPowerInfo
Jeff Johnson295189b2012-06-20 16:38:30 -0700683{
684 tListElem link;
685 tANI_U8 firstChannel;
686 tANI_U8 numChannels;
687 tANI_U8 txPower;
688 tANI_U8 interChannelOffset;
689}tCsrChannelPowerInfo;
690
691typedef struct tagRoamJoinStatus
692{
693 tSirResultCodes statusCode;
694 //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 -0800695 tANI_U32 reasonCode;
Kiran Kumar Lokerec8550fa2013-04-15 22:23:00 -0700696 tSirMacAddr bssId;
Jeff Johnson295189b2012-06-20 16:38:30 -0700697}tCsrRoamJoinStatus;
698
699typedef struct tagCsrOsChannelMask
700{
701 tANI_U8 numChannels;
702 tANI_BOOLEAN scanEnabled[WNI_CFG_VALID_CHANNEL_LIST_LEN];
703 tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
704}tCsrOsChannelMask;
705
Agrawal Ashish0b6984f2014-04-05 18:35:45 +0530706typedef struct tagCsrVotes11d
707{
708 tANI_U8 votes;
709 tANI_U8 countryCode[WNI_CFG_COUNTRY_CODE_LEN];
710}tCsrVotes11d;
Jeff Johnson295189b2012-06-20 16:38:30 -0700711
712typedef struct tagCsrScanStruct
713{
714 tScanProfile scanProfile;
715 tANI_U32 nextScanID;
Madan Mohan Koyyalamudica43cdf2012-09-24 13:15:49 -0700716 tDblLinkList scanResultList;
Jeff Johnson295189b2012-06-20 16:38:30 -0700717 tDblLinkList tempScanResults;
718 tANI_BOOLEAN fScanEnable;
719 tANI_BOOLEAN fFullScanIssued;
Madan Mohan Koyyalamudia48c6812013-07-11 12:01:37 +0530720 vos_timer_t hTimerGetResult;
Jeff Johnson295189b2012-06-20 16:38:30 -0700721#ifdef WLAN_AP_STA_CONCURRENCY
Madan Mohan Koyyalamudia48c6812013-07-11 12:01:37 +0530722 vos_timer_t hTimerStaApConcTimer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700723#endif
Madan Mohan Koyyalamudia48c6812013-07-11 12:01:37 +0530724 vos_timer_t hTimerIdleScan;
Madan Mohan Koyyalamudia48c6812013-07-11 12:01:37 +0530725 vos_timer_t hTimerResultCfgAging;
Jeff Johnson295189b2012-06-20 16:38:30 -0700726 tPalTimerHandle hTimerBgScan;
727 //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 -0800728 tANI_U8 channelOf11dInfo;
729 tANI_U8 scanResultCfgAgingTime;
Jeff Johnson295189b2012-06-20 16:38:30 -0700730 //changes on every scan, a flag to tell whether conflict 11d info found on each BSS
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800731 tANI_BOOLEAN fAmbiguous11dInfoFound;
Jeff Johnson295189b2012-06-20 16:38:30 -0700732 //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 -0800733 tANI_BOOLEAN fCurrent11dInfoMatch;
Jeff Johnson295189b2012-06-20 16:38:30 -0700734 tANI_BOOLEAN f11dInfoReset; //to indicate whether the 11d info in CFG is reset to default
735 tSirScanType curScanType;
736 tCsrChannel baseChannels; //This are all the supported channels AND(&) to the current eBand
737 tCsrChannel channels11d;
738 tChannelListWithPower defaultPowerTable[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
739 tChannelListWithPower defaultPowerTable40MHz[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
740 tANI_U32 numChannelsDefault; //total channels of NV
741 tCsrChannel base20MHzChannels; //The channel base to work on
742 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
743 tDblLinkList channelPowerInfoList24;
744 tDblLinkList channelPowerInfoList5G;
745 tANI_U32 nLastAgeTimeOut;
746 tANI_U32 nAgingCountDown;
Gopichand Nakkala114718f2013-03-25 19:19:46 -0700747 tANI_U8 countryCodeDefault[WNI_CFG_COUNTRY_CODE_LEN]; //The country code from NV
748 tANI_U8 countryCodeCurrent[WNI_CFG_COUNTRY_CODE_LEN];
749 tANI_U8 countryCode11d[WNI_CFG_COUNTRY_CODE_LEN];
Jeff Johnson295189b2012-06-20 16:38:30 -0700750 v_REGDOMAIN_t domainIdDefault; //default regulatory domain
751 v_REGDOMAIN_t domainIdCurrent; //current regulatory domain
Agarwal Ashishd9d72602013-09-13 00:06:17 +0530752 tCsrBssid currentCountryBssid; // Bssid for current country code
Mihir Shetebc866f62014-02-13 16:08:53 +0530753 tANI_S8 currentCountryRSSI; // RSSI for current country code
Jeff Johnson295189b2012-06-20 16:38:30 -0700754 tANI_BOOLEAN f11dInfoApplied;
755 tANI_BOOLEAN fCancelIdleScan;
Agrawal Ashish0b6984f2014-04-05 18:35:45 +0530756 tANI_U8 countryCodeCount;
757 tCsrVotes11d votes11d[CSR_MAX_NUM_COUNTRY_CODE]; //counts for various advertized country codes
758 //in 11d IE from probe rsp or beacons of neighboring APs;
759 //will use the most popular one (max count)
760 tANI_U8 countryCodeElected[WNI_CFG_COUNTRY_CODE_LEN];
761
762
Jeff Johnson295189b2012-06-20 16:38:30 -0700763#ifdef FEATURE_WLAN_WAPI
764// tANI_U16 NumBkidCandidate;
765// tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED]; /* Move this as part of SessionEntry */
766#endif /* FEATURE_WLAN_WAPI */
767 tANI_U8 numBGScanChannel; //number of valid channels in the bgScanChannelList
768 tANI_U8 bgScanChannelList[WNI_CFG_BG_SCAN_CHANNEL_LIST_LEN];
769 //the ChannelInfo member is not used in this structure.
770 //numBGScanChannel and bgScanChannelList are used for the BG scan channel info
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800771 tCsrBGScanRequest bgScanParams;
Jeff Johnson295189b2012-06-20 16:38:30 -0700772 tANI_BOOLEAN fRestartIdleScan;
773 tANI_U32 nIdleScanTimeGap; //the time since last trying to trigger idle scan
774 tCsrOsChannelMask osScanChannelMask;//keep a track of channels to be scnned while in traffic condition
775 tANI_U16 nBssLimit; //the maximum number of BSS in scan cache
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800776 /*channelPowerInfoList24 has been seen corrupted. Set this flag to true trying to
Jeff Johnson295189b2012-06-20 16:38:30 -0700777 * detect when it happens. Adding this into code because we can't reproduce it easily.
778 * We don't know when it happens. */
779 tANI_BOOLEAN fValidateList;
780 /*Customer wants to start with an active scan based on the default country code.
781 * This optimization will minimize the driver load to association time.
782 * Based on this flag we will bypass the initial passive scan needed for 11d
783 * to determine the country code & domain */
784 tANI_BOOLEAN fEnableBypass11d;
785
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800786 /*Customer wants to optimize the scan time. Avoiding scans(passive) on DFS
787 * channels while swipping through both bands can save some time
Jeff Johnson295189b2012-06-20 16:38:30 -0700788 * (apprx 1.3 sec) */
Padma, Santhosh Kumar814d0992015-05-05 18:52:43 +0530789 tANI_U8 fEnableDFSChnlScan;
Jeff Johnson295189b2012-06-20 16:38:30 -0700790
Jeff Johnsone7245742012-09-05 17:12:55 -0700791 /*
792 * To enable/disable scanning only 2.4Ghz channels on first scan
793 */
794 tANI_BOOLEAN fFirstScanOnly2GChnl;
795
Jeff Johnson295189b2012-06-20 16:38:30 -0700796 tANI_BOOLEAN fDropScanCmd; //true means we don't accept scan commands
797
798#ifdef WLAN_AP_STA_CONCURRENCY
799 tDblLinkList scanCmdPendingList;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800800#endif
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -0700801 tCsrChannel occupiedChannels; //This includes all channels on which candidate APs are found
Srinivas Girigowda41c7c5f2013-10-21 19:01:38 -0700802 tANI_S8 inScanResultBestAPRssi;
Mihir Shetefc7ff5b2014-01-27 11:30:05 +0530803
804 csrScanCompleteCallback callback11dScanDone;
Peng Xu2446a892014-09-05 17:21:18 +0530805 eCsrBand scanBandPreference; //This defines the band perference for scan
Jeff Johnson295189b2012-06-20 16:38:30 -0700806}tCsrScanStruct;
807
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800808#ifdef FEATURE_WLAN_TDLS_INTERNAL
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800809/*
810 * struct to carry TDLS discovery info..
811 */
812typedef struct sCsrTdlsContext
813{
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800814 tDblLinkList tdlsPotentialPeerList ;
815 tANI_U16 tdlsCommonFlag ;
816 tANI_U16 tdlsCommonState ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800817 tANI_U16 tdlsPeerCount ;
818}tCsrTdlsCtxStruct;
819
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800820typedef struct sCsrTdlsPeerLinkInfo
821{
822 tListElem tdlsPeerStaLink ;
823 tSirTdlsPeerInfo tdlsDisPeerInfo ;
824}tCsrTdlsPeerLinkinfo ;
825#endif
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800826
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800827
828
Jeff Johnson295189b2012-06-20 16:38:30 -0700829
830//Save the connected information. This structure + connectedProfile
831//should contain all information about the connection
832typedef struct tagRoamCsrConnectedInfo
833{
834 tANI_U32 nBeaconLength; //the length, in bytes, of the beacon frame, can be 0
835 tANI_U32 nAssocReqLength; //the length, in bytes, of the assoc req frame, can be 0
836 tANI_U32 nAssocRspLength; //The length, in bytes, of the assoc rsp frame, can be 0
837#ifdef WLAN_FEATURE_VOWIFI_11R
838 tANI_U32 nRICRspLength; //Length of the parsed RIC response IEs received in reassoc response
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800839#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800840#ifdef FEATURE_WLAN_ESE
Jeff Johnson295189b2012-06-20 16:38:30 -0700841 tANI_U32 nTspecIeLength;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800842#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700843 tANI_U8 *pbFrames; //Point to a buffer contain the beacon, assoc req, assoc rsp frame, in that order
844 //user needs to use nBeaconLength, nAssocReqLength, nAssocRspLength to desice where
845 //each frame starts and ends.
846 tANI_U8 staId;
847}tCsrRoamConnectedInfo;
848
849
850typedef struct tagCsrLinkQualityIndInfo
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800851{
Jeff Johnson295189b2012-06-20 16:38:30 -0700852 csrRoamLinkQualityIndCallback callback;
853 void *context;
854}tCsrLinkQualityIndInfo;
855
856typedef struct tagCsrPeStatsReqInfo
857{
858 tListElem link; /* list links */
859 tANI_U32 statsMask;
860 tANI_U32 periodicity;
861 tANI_BOOLEAN rspPending;
862 vos_timer_t hPeStatsTimer;
863 tANI_BOOLEAN timerRunning;
864 tANI_U8 staId;
865 tANI_U8 numClient;
866 tpAniSirGlobal pMac;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800867 /* To remember if the peStats timer is stopped successfully or not */
Jeff Johnson295189b2012-06-20 16:38:30 -0700868 tANI_BOOLEAN timerStopFailed;
869
870}tCsrPeStatsReqInfo;
871
872typedef struct tagCsrStatsClientReqInfo
873{
874 tListElem link; /* list links */
875 eCsrStatsRequesterType requesterId;
876 tCsrStatsCallback callback;
877 tANI_U32 periodicity;
878 void *pContext;
879 tANI_U32 statsMask;
880 tCsrPeStatsReqInfo *pPeStaEntry;
881 tANI_U8 staId;
882 vos_timer_t timer;
883 tANI_BOOLEAN timerExpired;
884 tpAniSirGlobal pMac; // TODO: Confirm this change BTAMP
885}tCsrStatsClientReqInfo;
886
887typedef struct tagCsrTlStatsReqInfo
888{
889 tANI_U32 periodicity;
890 tANI_BOOLEAN timerRunning;
Madan Mohan Koyyalamudia48c6812013-07-11 12:01:37 +0530891 vos_timer_t hTlStatsTimer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700892 tANI_U8 numClient;
893}tCsrTlStatsReqInfo;
894
895typedef struct tagCsrRoamSession
896{
897 tANI_U8 sessionId; // Session ID
898 tANI_BOOLEAN sessionActive; // TRUE if it is used
899 tCsrBssid selfMacAddr; // For BT-AMP station, this serve as BSSID for self-BSS.
900 csrRoamCompleteCallback callback;
901 void *pContext;
902 eCsrConnectState connectState;
903 tCsrRoamConnectedProfile connectedProfile;
904 tCsrRoamConnectedInfo connectedInfo;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800905 tCsrRoamProfile *pCurRoamProfile;
Jeff Johnson295189b2012-06-20 16:38:30 -0700906 tSirBssDescription *pConnectBssDesc;
Kanchanapally, Vidyullatha0c611b02014-11-26 21:30:05 +0530907 tANI_U16 NumPmkidCache; /* valid no. of pmkid in the cache */
908 tANI_U16 CurCacheIndex; /* the index in pmkidcache to write next to */
Jeff Johnson295189b2012-06-20 16:38:30 -0700909 tPmkidCacheInfo PmkidCacheInfo[CSR_MAX_PMKID_ALLOWED];
910 tANI_U8 cJoinAttemps;
911 //This may or may not have the up-to-date valid channel list
912 //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
913 tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
914 tANI_S32 sPendingCommands; //0 means CSR is ok to low power
915#ifdef FEATURE_WLAN_WAPI
916 tANI_U16 NumBkidCache;
917 tBkidCacheInfo BkidCacheInfo[CSR_MAX_BKID_ALLOWED];
918#endif /* FEATURE_WLAN_WAPI */
919 tANI_BOOLEAN fRoaming; //indicate whether CSR is roaming (either via lostlink or dynamic roaming)
920 //to remember some parameters needed for START_BSS.
921 //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 -0800922 tCsrRoamStartBssParams bssParams;
Jeff Johnson295189b2012-06-20 16:38:30 -0700923 tANI_U32 nWpaRsnReqIeLength; //the byte count of pWpaRsnIE;
924 tANI_U8 *pWpaRsnReqIE; //this contain the WPA/RSN IE in assoc request or the one sent in beacon (IBSS)
925 tANI_U32 nWpaRsnRspIeLength; //the byte count for pWpaRsnRspIE
926 tANI_U8 *pWpaRsnRspIE; //this contain the WPA/RSN IE in beacon/probe rsp
927#ifdef FEATURE_WLAN_WAPI
928 tANI_U32 nWapiReqIeLength; //the byte count of pWapiReqIE;
929 tANI_U8 *pWapiReqIE; //this contain the WAPI IE in assoc request or the one sent in beacon (IBSS)
930 tANI_U32 nWapiRspIeLength; //the byte count for pWapiRspIE
931 tANI_U8 *pWapiRspIE; //this contain the WAPI IE in beacon/probe rsp
932#endif /* FEATURE_WLAN_WAPI */
Agarwal Ashish4f616132013-12-30 23:32:50 +0530933 tANI_U32 nAddIEScanLength; //length of addIeScan
934 /* This contains the additional IE in (unicast)
935 * probe request at the time of join
936 */
Ganesh Kondabattini7500fb32015-04-10 14:50:32 +0530937 tANI_U8 addIEScan[SIR_MAC_MAX_ADD_IE_LENGTH+2];
Jeff Johnson295189b2012-06-20 16:38:30 -0700938 tANI_U32 nAddIEAssocLength; //the byte count for pAddIeAssocIE
939 tANI_U8 *pAddIEAssoc; //this contains the additional IE in (re) assoc request
940
941 tANI_TIMESTAMP roamingStartTime; //in units of 10ms
942 tCsrTimerInfo roamingTimerInfo;
943 eCsrRoamingReason roamingReason;
944 tANI_BOOLEAN fCancelRoaming;
Madan Mohan Koyyalamudia48c6812013-07-11 12:01:37 +0530945 vos_timer_t hTimerRoaming;
Jeff Johnson295189b2012-06-20 16:38:30 -0700946 eCsrRoamResult roamResult; //the roamResult that is used when the roaming timer fires
947 tCsrRoamJoinStatus joinFailStatusCode; //This is the reason code for join(assoc) failure
948 //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 -0800949 tANI_U32 roamingStatusCode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700950 tANI_U16 NumPmkidCandidate;
951 tPmkidCandidateInfo PmkidCandidateInfo[CSR_MAX_PMKID_ALLOWED];
952 #ifdef FEATURE_WLAN_WAPI
953 tANI_U16 NumBkidCandidate;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800954 tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED];
Jeff Johnson295189b2012-06-20 16:38:30 -0700955#endif
956 tANI_BOOLEAN fWMMConnection;
Sandeep Puligillaaea98a22013-12-04 13:36:32 +0530957 tANI_BOOLEAN fQOSConnection;
958
Jeff Johnson295189b2012-06-20 16:38:30 -0700959#ifdef FEATURE_WLAN_BTAMP_UT_RF
960 //To retry a join later when it fails if so desired
Madan Mohan Koyyalamudia48c6812013-07-11 12:01:37 +0530961 vos_timer_t hTimerJoinRetry;
Jeff Johnson295189b2012-06-20 16:38:30 -0700962 tCsrTimerInfo joinRetryTimerInfo;
963 tANI_U32 maxRetryCount;
964#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800965#ifdef FEATURE_WLAN_ESE
966 tCsrEseCckmInfo eseCckmInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -0700967 tANI_BOOLEAN isPrevApInfoValid;
968 tSirMacSSid prevApSSID;
969 tCsrBssid prevApBssid;
970 tANI_U8 prevOpChannel;
971 tANI_U16 clientDissSecs;
972 tANI_U32 roamTS1;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800973#if defined(FEATURE_WLAN_ESE_UPLOAD)
974 tCsrEseCckmIe suppCckmIeInfo;
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700975#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700976#endif
977 tANI_U8 bRefAssocStartCnt; //Tracking assoc start indication
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800978 /* to force the AP initiate fresh 802.1x authentication after re-association need to clear
Madan Mohan Koyyalamudiea22cdc2012-10-18 21:02:23 -0700979 * the PMKID cache. To clear the cache in this particular case this is added
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800980 * it is needed by the HS 2.0 passpoint certification 5.2.a and b testcases */
Madan Mohan Koyyalamudiea22cdc2012-10-18 21:02:23 -0700981 tANI_BOOLEAN fIgnorePMKIDCache;
Jeff Johnson295189b2012-06-20 16:38:30 -0700982} tCsrRoamSession;
983
984typedef struct tagCsrRoamStruct
985{
986 tANI_U32 nextRoamId;
987 tDblLinkList roamCmdPendingList;
988 tDblLinkList channelList5G;
989 tDblLinkList channelList24;
990 tCsrConfig configParam;
991 tANI_U32 numChannelsEeprom; //total channels of eeprom
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800992 tCsrChannel base20MHzChannels; //The channel base to work on
993 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
994 eCsrRoamState curState[CSR_ROAM_SESSION_MAX];
Jeff Johnson295189b2012-06-20 16:38:30 -0700995 eCsrRoamSubState curSubState[CSR_ROAM_SESSION_MAX];
996 //This may or may not have the up-to-date valid channel list
997 //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
998 tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
999 tANI_U32 numValidChannels; //total number of channels in CFG
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001000
Jeff Johnson295189b2012-06-20 16:38:30 -07001001 tANI_S32 sPendingCommands;
Madan Mohan Koyyalamudia48c6812013-07-11 12:01:37 +05301002 vos_timer_t hTimerWaitForKey; //To support timeout for WaitForKey state
Jeff Johnson295189b2012-06-20 16:38:30 -07001003 tCsrSummaryStatsInfo summaryStatsInfo;
1004 tCsrGlobalClassAStatsInfo classAStatsInfo;
1005 tCsrGlobalClassBStatsInfo classBStatsInfo;
1006 tCsrGlobalClassCStatsInfo classCStatsInfo;
1007 tCsrGlobalClassDStatsInfo classDStatsInfo;
1008 tCsrPerStaStatsInfo perStaStatsInfo[CSR_MAX_STA];
1009 tDblLinkList statsClientReqList;
1010 tDblLinkList peStatsReqList;
1011 tCsrTlStatsReqInfo tlStatsReqInfo;
1012 eCsrRoamLinkQualityInd vccLinkQuality;
1013 tCsrLinkQualityIndInfo linkQualityIndInfo;
1014 v_CONTEXT_t gVosContext; //used for interaction with TL
1015 //To specify whether an association or a IBSS is WMM enabled
1016 //This parameter is only valid during a join or start BSS command is being executed
1017 //tANI_BOOLEAN fWMMConnection; /* Moving it to be part of roamsession */
1018 v_U8_t ucACWeights[WLANTL_MAX_AC];
1019 /* TODO : Upto here */
1020 tCsrTimerInfo WaitForKeyTimerInfo;
1021 tCsrRoamSession *roamSession;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001022 tANI_U32 transactionId; // Current transaction ID for internal use.
1023#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
Jeff Johnson295189b2012-06-20 16:38:30 -07001024 tCsrNeighborRoamControlInfo neighborRoamInfo;
1025#endif
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001026#ifdef FEATURE_WLAN_LFR
1027 tANI_U8 isFastRoamIniFeatureEnabled;
1028#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001029#ifdef FEATURE_WLAN_ESE
1030 tANI_U8 isEseIniFeatureEnabled;
Jeff Johnson295189b2012-06-20 16:38:30 -07001031#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001032#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR)
Srinivas Girigowda100eb322013-03-15 16:48:20 -07001033 tANI_U8 RoamRssiDiff;
Srinivas Girigowdaad34ca92013-10-22 10:54:29 -07001034 tANI_BOOLEAN isWESModeEnabled;
Jeff Johnson43971f52012-07-17 12:26:56 -07001035#endif
Leela Venkata Kiran Kumar Reddy Chirala56df73f2014-01-30 14:18:00 -08001036 tANI_U32 deauthRspStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -07001037}tCsrRoamStruct;
1038
1039
1040#define GET_NEXT_ROAM_ID(pRoamStruct) (((pRoamStruct)->nextRoamId + 1 == 0) ? 1 : (pRoamStruct)->nextRoamId)
1041#define CSR_IS_ROAM_STATE(pMac, state, sessionId) ( (state) == (pMac)->roam.curState[sessionId] )
1042
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001043#define CSR_IS_ROAM_STOP(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_STOP, sessionId )
1044#define CSR_IS_ROAM_INIT(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_INIT, sessionId )
Jeff Johnson295189b2012-06-20 16:38:30 -07001045#define CSR_IS_ROAM_SCANNING(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_SCANNING, sessionId )
1046#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 -08001047#define CSR_IS_ROAM_IDLE(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_IDLE, sessionId )
Jeff Johnson295189b2012-06-20 16:38:30 -07001048#define CSR_IS_ROAM_JOINED(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_JOINED, sessionId )
1049
1050#define CSR_IS_ROAM_SUBSTATE(pMac, subState, sessionId) ((subState) == (pMac)->roam.curSubState[sessionId])
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001051#define CSR_IS_ROAM_SUBSTATE_JOIN_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOIN_REQ, sessionId)
1052#define CSR_IS_ROAM_SUBSTATE_AUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_AUTH_REQ, sessionId)
1053#define CSR_IS_ROAM_SUBSTATE_REASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_REASSOC_REQ, sessionId)
1054#define CSR_IS_ROAM_SUBSTATE_DISASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REQ, sessionId)
1055#define CSR_IS_ROAM_SUBSTATE_DISASSOC_NO_JOIN(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN, sessionId)
1056#define CSR_IS_ROAM_SUBSTATE_REASSOC_FAIL(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE, sessionId)
1057#define CSR_IS_ROAM_SUBSTATE_DISASSOC_FORCED(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_FORCED, sessionId)
1058#define CSR_IS_ROAM_SUBSTATE_DEAUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DEAUTH_REQ, sessionId)
1059#define CSR_IS_ROAM_SUBSTATE_START_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_START_BSS_REQ, sessionId)
1060#define CSR_IS_ROAM_SUBSTATE_STOP_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_STOP_BSS_REQ, sessionId)
1061#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 -07001062#define CSR_IS_ROAM_SUBSTATE_CONFIG(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_CONFIG, sessionId)
1063#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 -08001064#define CSR_IS_ROAM_SUBSTATE_DISASSOC_HO(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF, sessionId)
1065#define CSR_IS_ROAM_SUBSTATE_HO_NT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC, sessionId)
1066#define CSR_IS_ROAM_SUBSTATE_HO_NRT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC, sessionId)
1067#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 -07001068
1069#define CSR_IS_PHY_MODE_B_ONLY(pMac) \
1070 ((eCSR_DOT11_MODE_11b == (pMac)->roam.configParam.phyMode) ||\
1071 (eCSR_DOT11_MODE_11b_ONLY == (pMac)->roam.configParam.phyMode))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001072
Jeff Johnson295189b2012-06-20 16:38:30 -07001073#define CSR_IS_PHY_MODE_G_ONLY(pMac) \
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001074 (eCSR_DOT11_MODE_11g == (pMac)->roam.configParam.phyMode || eCSR_DOT11_MODE_11g_ONLY == (pMac)->roam.configParam.phyMode)
1075
Jeff Johnson295189b2012-06-20 16:38:30 -07001076#define CSR_IS_PHY_MODE_A_ONLY(pMac) \
1077 ((eCSR_DOT11_MODE_11a == (pMac)->roam.configParam.phyMode) ||\
1078 (eCSR_DOT11_MODE_11a_ONLY == (pMac)->roam.configParam.phyMode))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001079
Jeff Johnsone7245742012-09-05 17:12:55 -07001080#ifdef WLAN_FEATURE_11AC
1081#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
1082 ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
1083 (eCSR_DOT11_MODE_11ac & (phyMode)) || \
1084 (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
1085 (eCSR_DOT11_MODE_AUTO & (phyMode)))
1086#else
Jeff Johnson295189b2012-06-20 16:38:30 -07001087#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
1088 ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
1089 (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
1090 (eCSR_DOT11_MODE_AUTO & (phyMode)))
Jeff Johnsone7245742012-09-05 17:12:55 -07001091#endif
1092
Jeff Johnson295189b2012-06-20 16:38:30 -07001093
1094// this function returns TRUE if the NIC is operating exclusively in the 2.4 GHz band, meaning
1095// it is NOT operating in the 5.0 GHz band.
1096#define CSR_IS_24_BAND_ONLY(pMac) \
1097 (eCSR_BAND_24 == (pMac)->roam.configParam.eBand)
1098
1099#define CSR_IS_5G_BAND_ONLY(pMac) \
1100 (eCSR_BAND_5G == (pMac)->roam.configParam.eBand)
1101
1102#define CSR_IS_RADIO_DUAL_BAND(pMac) \
1103 (eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability)
1104
1105#define CSR_IS_RADIO_BG_ONLY(pMac) \
1106 (eCSR_BAND_24 == (pMac)->roam.configParam.bandCapability)
1107
1108// this function returns TRUE if the NIC is operating exclusively in the 5.0 GHz band, meaning
1109// it is NOT operating in the 2.4 GHz band
1110#define CSR_IS_RADIO_A_ONLY(pMac) \
1111 (eCSR_BAND_5G == (pMac)->roam.configParam.bandCapability)
1112
1113// this function returns TRUE if the NIC is operating in both bands.
1114#define CSR_IS_OPEARTING_DUAL_BAND(pMac) \
1115 ((eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability) && (eCSR_BAND_ALL == (pMac)->roam.configParam.eBand))
1116
1117// this function returns TRUE if the NIC can operate in the 5.0 GHz band (could operate in the
1118// 2.4 GHz band also).
1119#define CSR_IS_OPERATING_A_BAND(pMac) \
1120 (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_A_ONLY((pMac)) || CSR_IS_5G_BAND_ONLY((pMac)))
1121
1122// this function returns TRUE if the NIC can operate in the 2.4 GHz band (could operate in the
1123// 5.0 GHz band also).
1124#define CSR_IS_OPERATING_BG_BAND(pMac) \
1125 (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_BG_ONLY((pMac)) || CSR_IS_24_BAND_ONLY((pMac)))
1126
1127#define CSR_IS_CHANNEL_5GHZ(chnNum) \
Jeff Johnsone7245742012-09-05 17:12:55 -07001128 (((chnNum) >= CSR_MIN_5GHz_CHANNEL_NUMBER) && ((chnNum) <= CSR_MAX_5GHz_CHANNEL_NUMBER))
Jeff Johnson295189b2012-06-20 16:38:30 -07001129
Srinivas Girigowdade697412013-02-14 16:31:48 -08001130#define CSR_IS_CHANNEL_DFS(chnNum) \
1131 (NV_CHANNEL_ENABLE != vos_nv_getChannelEnabledState(chnNum))
1132
Jeff Johnson295189b2012-06-20 16:38:30 -07001133#define CSR_IS_CHANNEL_24GHZ(chnNum) \
1134 (((chnNum) > 0) && ((chnNum) <= CSR_MAX_24GHz_CHANNEL_NUMBER))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001135
Jeff Johnson295189b2012-06-20 16:38:30 -07001136#define CSR_IS_SAME_BAND_CHANNELS(ch1, ch2) (CSR_IS_CHANNEL_5GHZ(ch1) == CSR_IS_CHANNEL_5GHZ(ch2))
1137
1138
1139#define CSR_IS_11D_INFO_FOUND(pMac) \
1140 (0 != (pMac)->scan.channelOf11dInfo)
1141// DEAUTHIND
1142#define CSR_IS_ROAMING(pSession) ((CSR_IS_LOSTLINK_ROAMING((pSession)->roamingReason)) || \
1143 (eCsrDynamicRoaming == (pSession)->roamingReason) || \
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001144 (eCsrReassocRoaming == (pSession)->roamingReason))
Jeff Johnson295189b2012-06-20 16:38:30 -07001145
1146
1147#define CSR_IS_SET_KEY_COMMAND( pCommand ) ( eSmeCommandSetKey == (pCommand)->command )
1148
1149#define CSR_IS_ADDTS_WHEN_ACMOFF_SUPPORTED(pMac) (pMac->roam.configParam.addTSWhenACMIsOff)
1150// DEAUTHIND
1151#define CSR_IS_LOSTLINK_ROAMING(reason) ((eCsrLostlinkRoamingDisassoc == (reason)) || (eCsrLostlinkRoamingDeauth == (reason)))
1152
Venkata Prathyusha Kuntupalli239278b2013-03-26 15:58:18 -07001153#define CSR_IS_ROAMING_COMMAND(pCommand) ((eCsrLostLink1 == (pCommand)->u.roamCmd.roamReason) ||\
1154 (eCsrLostLink2 == (pCommand)->u.roamCmd.roamReason) ||\
1155 (eCsrLostLink3 == (pCommand)->u.roamCmd.roamReason) )
1156
1157
Jeff Johnson295189b2012-06-20 16:38:30 -07001158//Stop CSR from asking for IMPS, This function doesn't disable IMPS from CSR
1159void csrScanSuspendIMPS( tpAniSirGlobal pMac );
1160//Start CSR from asking for IMPS. This function doesn't trigger CSR to request entering IMPS
1161//because IMPS maybe disabled.
1162void csrScanResumeIMPS( tpAniSirGlobal pMac );
1163
1164eHalStatus csrInitGetChannels(tpAniSirGlobal pMac);
Srinivas, Dasari42bf7702014-02-07 11:29:53 +05301165eHalStatus csrScanFilterResults(tpAniSirGlobal pMac);
Padma, Santhosh Kumar778d8382015-03-04 17:41:22 +05301166eHalStatus csrScanFilterDFSResults(tpAniSirGlobal pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001167
1168eHalStatus csrSetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1169 tCsrRoamModifyProfileFields *pModifyProfileFields);
1170/* ---------------------------------------------------------------------------
1171 \fn csrGetModifyProfileFields
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001172 \brief HDD or SME - QOS calls this function to get the current values of
Jeff Johnson295189b2012-06-20 16:38:30 -07001173 connected profile fields changing which can cause reassoc.
1174 This function must be called after CFG is downloaded and STA is in connected
1175 state.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001176 \param pModifyProfileFields - pointer to the connected profile fields
Jeff Johnson295189b2012-06-20 16:38:30 -07001177 changing which can cause reassoc
1178
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001179 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001180 -------------------------------------------------------------------------------*/
1181eHalStatus csrGetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1182 tCsrRoamModifyProfileFields * pModifyProfileFields);
1183void csrSetGlobalCfgs( tpAniSirGlobal pMac );
1184void csrSetDefaultDot11Mode( tpAniSirGlobal pMac );
1185void csrScanSetChannelMask(tpAniSirGlobal pMac, tCsrChannelInfo *pChannelInfo);
1186tANI_BOOLEAN csrIsConnStateDisconnected(tpAniSirGlobal pMac, tANI_U32 sessionId);
1187tANI_BOOLEAN csrIsConnStateConnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1188tANI_BOOLEAN csrIsConnStateDisconnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1189tANI_BOOLEAN csrIsConnStateConnectedInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1190tANI_BOOLEAN csrIsConnStateConnected( tpAniSirGlobal pMac, tANI_U32 sessionId );
1191tANI_BOOLEAN csrIsConnStateInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1192tANI_BOOLEAN csrIsConnStateIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1193tANI_BOOLEAN csrIsConnStateWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1194tANI_BOOLEAN csrIsConnStateConnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1195tANI_BOOLEAN csrIsConnStateDisconnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1196tANI_BOOLEAN csrIsAnySessionInConnectState( tpAniSirGlobal pMac );
1197tANI_BOOLEAN csrIsAllSessionDisconnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudi48081ef2012-12-04 16:49:55 -08001198tANI_BOOLEAN csrIsStaSessionConnected( tpAniSirGlobal pMac );
1199tANI_BOOLEAN csrIsP2pSessionConnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudid3d22592012-09-24 14:01:29 -07001200tANI_BOOLEAN csrIsAnySessionConnected( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001201tANI_BOOLEAN csrIsInfraConnected( tpAniSirGlobal pMac );
1202tANI_BOOLEAN csrIsConcurrentInfraConnected( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001203tANI_BOOLEAN csrIsConcurrentSessionRunning( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001204tANI_BOOLEAN csrIsInfraApStarted( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001205tANI_BOOLEAN csrIsIBSSStarted( tpAniSirGlobal pMac );
1206tANI_BOOLEAN csrIsBTAMPStarted( tpAniSirGlobal pMac );
1207tANI_BOOLEAN csrIsBTAMP( tpAniSirGlobal pMac, tANI_U32 sessionId );
1208eHalStatus csrIsBTAMPAllowed( tpAniSirGlobal pMac, tANI_U32 chnId );
Jeff Johnsone7245742012-09-05 17:12:55 -07001209tANI_BOOLEAN csrIsValidMcConcurrentSession(tpAniSirGlobal pMac, tANI_U32 sessionId,
1210 tSirBssDescription *pBssDesc);
Jeff Johnson295189b2012-06-20 16:38:30 -07001211tANI_BOOLEAN csrIsConnStateConnectedInfraAp( tpAniSirGlobal pMac, tANI_U32 sessionId );
Jeff Johnson295189b2012-06-20 16:38:30 -07001212/*----------------------------------------------------------------------------
1213 \fn csrRoamRegisterLinkQualityIndCallback
1214
1215 \brief
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001216 a CSR function to allow HDD to register a callback handler with CSR for
1217 link quality indications.
Jeff Johnson295189b2012-06-20 16:38:30 -07001218
1219 Only one callback may be registered at any time.
1220 In order to deregister the callback, a NULL cback may be provided.
1221
1222 Registration happens in the task context of the caller.
1223
1224 \param callback - Call back being registered
1225 \param pContext - user data
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001226
Jeff Johnson295189b2012-06-20 16:38:30 -07001227 DEPENDENCIES: After CSR open
1228
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001229 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001230-----------------------------------------------------------------------------*/
1231eHalStatus csrRoamRegisterLinkQualityIndCallback(tpAniSirGlobal pMac,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001232 csrRoamLinkQualityIndCallback callback,
Jeff Johnson295189b2012-06-20 16:38:30 -07001233 void *pContext);
1234/* ---------------------------------------------------------------------------
1235 \fn csrGetStatistics
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001236 \brief csr function that client calls to register a callback to get
1237 different PHY level statistics from CSR.
1238
Jeff Johnson295189b2012-06-20 16:38:30 -07001239 \param requesterId - different client requesting for statistics, HDD, UMA/GAN etc
1240 \param statsMask - The different category/categories of stats requester is looking for
1241 \param callback - SME sends back the requested stats using the callback
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001242 \param periodicity - If requester needs periodic update, 0 means it's an one
Jeff Johnson295189b2012-06-20 16:38:30 -07001243 time request
1244 \param cache - If requester is happy with cached stats
1245 \param staId - The station ID for which the stats is requested for
1246 \param pContext - user context to be passed back along with the callback
1247
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001248 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001249 ---------------------------------------------------------------------------*/
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001250eHalStatus csrGetStatistics(tpAniSirGlobal pMac, eCsrStatsRequesterType requesterId,
1251 tANI_U32 statsMask,
1252 tCsrStatsCallback callback,
1253 tANI_U32 periodicity, tANI_BOOLEAN cache,
Jeff Johnson295189b2012-06-20 16:38:30 -07001254 tANI_U8 staId, void *pContext);
1255
Madan Mohan Koyyalamudi8af9b402013-07-11 14:59:10 +05301256/* ---------------------------------------------------------------------------
1257 \fn csrGetTLSTAState
1258 \helper function to get the TL STA State whenever the function is called.
1259
1260 \param staId - The staID to be passed to the TL
1261 to get the relevant TL STA State
1262 \return the state as tANI_U16
1263 ---------------------------------------------------------------------------*/
1264tANI_U16 csrGetTLSTAState(tpAniSirGlobal pMac, tANI_U8 staId);
Jeff Johnson295189b2012-06-20 16:38:30 -07001265
1266eHalStatus csrGetRssi(tpAniSirGlobal pMac,tCsrRssiCallback callback,tANI_U8 staId,tCsrBssid bssId,void * pContext,void * pVosContext);
Madan Mohan Koyyalamudid9383fd2013-08-13 09:27:30 +05301267
1268/* ---------------------------------------------------------------------------
1269 \fn csrGetSnr
1270 \brief csr function that client calls to register a callback to get
1271 SNR stored in TL
1272
1273 \param callback - SME sends back the requested stats using the callback
1274 \param staId - The station ID for which the stats is requested for
1275 \param bssid - The bssid for the connected session
1276 \param pContext - user context to be passed back along with the callback
1277
1278 \return eHalStatus
1279 ---------------------------------------------------------------------------*/
1280eHalStatus csrGetSnr(tpAniSirGlobal pMac, tCsrSnrCallback callback,
1281 tANI_U8 staId, tCsrBssid bssId, void *pContext);
1282
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001283#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR)
Srinivas Girigowdad34cedb2013-01-25 13:33:11 -08001284eHalStatus csrGetRoamRssi(tpAniSirGlobal pMac,
1285 tCsrRssiCallback callback,
1286 tANI_U8 staId,
1287 tCsrBssid bssId,
1288 void * pContext,
1289 void * pVosContext);
1290#endif
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001291
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001292#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001293eHalStatus csrGetTsmStats(tpAniSirGlobal pMac, tCsrTsmStatsCallback callback, tANI_U8 staId,
1294 tCsrBssid bssId, void *pContext, void* pVosContext,
1295 tANI_U8 tid);
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001296#endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001297
Jeff Johnson295189b2012-06-20 16:38:30 -07001298eHalStatus csrRoamRegisterCallback(tpAniSirGlobal pMac, csrRoamCompleteCallback callback, void *pContext);
1299/* ---------------------------------------------------------------------------
1300 \fn csrGetConfigParam
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001301 \brief HDD calls this function to get the global settings currently maintained by CSR.
Jeff Johnson295189b2012-06-20 16:38:30 -07001302 \param pParam - caller allocated memory
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001303 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001304 -------------------------------------------------------------------------------*/
1305eHalStatus csrGetConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1306
1307/* ---------------------------------------------------------------------------
1308 \fn csrMsgProcessor
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001309 \brief HDD calls this function to change some global settings.
Jeff Johnson295189b2012-06-20 16:38:30 -07001310 caller must set the all fields or call csrGetConfigParam to prefill the fields.
1311 \param pParam - caller allocated memory
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001312 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001313 -------------------------------------------------------------------------------*/
1314eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1315
1316
1317/* ---------------------------------------------------------------------------
1318 \fn csrMsgProcessor
1319 \brief HDD calls this function for the messages that are handled by CSR.
1320 \param pMsgBuf - a pointer to a buffer that maps to various structures base on the message type.
1321 The beginning of the buffer can always map to tSirSmeRsp.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001322 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001323 -------------------------------------------------------------------------------*/
1324eHalStatus csrMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf );
1325
1326/* ---------------------------------------------------------------------------
1327 \fn csrOpen
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001328 \brief This function must be called before any API call to CSR.
1329 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001330 -------------------------------------------------------------------------------*/
1331eHalStatus csrOpen(tpAniSirGlobal pMac);
Mihir Shetee1093ba2014-01-21 20:13:32 +05301332
1333/* ---------------------------------------------------------------------------
1334 \fn csrInitChannels
1335 \brief This function must be called to initialize CSR channel lists
1336 \return eHalStatus
1337 -------------------------------------------------------------------------------*/
1338eHalStatus csrInitChannels(tpAniSirGlobal pMac);
1339
Mihir Shete04206452014-11-20 17:50:58 +05301340#ifdef CONFIG_ENABLE_LINUX_REG
Jeff Johnson295189b2012-06-20 16:38:30 -07001341/* ---------------------------------------------------------------------------
Mahesh A Saptasagar74289d22014-05-14 12:43:37 +05301342 \fn csrInitChannelsForCC
1343 \brief This function must be called to issue reg hint
1344 \return eHalStatus
1345 -------------------------------------------------------------------------------*/
Agarwal Ashish6db9d532014-09-30 18:19:10 +05301346eHalStatus csrInitChannelsForCC(tpAniSirGlobal pMac, driver_load_type init );
Mihir Shete04206452014-11-20 17:50:58 +05301347#endif
Mahesh A Saptasagar74289d22014-05-14 12:43:37 +05301348
1349/* ---------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -07001350 \fn csrClose
1351 \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 -08001352 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001353 -------------------------------------------------------------------------------*/
1354eHalStatus csrClose(tpAniSirGlobal pMac);
1355/* ---------------------------------------------------------------------------
1356 \fn csrStart
1357 \brief To start CSR.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001358 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001359 -------------------------------------------------------------------------------*/
1360eHalStatus csrStart(tpAniSirGlobal pMac);
1361/* ---------------------------------------------------------------------------
1362 \fn csrStop
1363 \brief To stop CSR. CSR still keeps its current setting.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001364 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001365 -------------------------------------------------------------------------------*/
Kiet Lama72a2322013-11-15 11:18:11 +05301366eHalStatus csrStop(tpAniSirGlobal pMac, tHalStopType stopType);
Jeff Johnson295189b2012-06-20 16:38:30 -07001367/* ---------------------------------------------------------------------------
1368 \fn csrReady
1369 \brief To let CSR is ready to operate
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001370 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001371 -------------------------------------------------------------------------------*/
1372eHalStatus csrReady(tpAniSirGlobal pMac);
1373
1374#ifdef FEATURE_WLAN_WAPI
1375eHalStatus csrRoamGetBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pNum,
1376 tBkidCacheInfo *pBkidCache);
1377
1378
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001379eHalStatus csrScanGetBKIDCandidateList(tpAniSirGlobal pMac, tANI_U32 sessionId,
Jeff Johnson295189b2012-06-20 16:38:30 -07001380 tBkidCandidateInfo *pBkidList, tANI_U32 *pNumItems );
1381tANI_U32 csrRoamGetNumBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId);
1382eHalStatus csrRoamSetBKIDCache( tpAniSirGlobal pMac, tANI_U32 sessionId, tBkidCacheInfo *pBKIDCache,
1383 tANI_U32 numItems );
1384/* ---------------------------------------------------------------------------
1385 \fn csrRoamGetWapiReqIE
1386 \brief return the WAPI IE CSR passes to PE to JOIN request or START_BSS request
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001387 \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 -07001388 needed or IE length in pBuf.
1389 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1390 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1391 -------------------------------------------------------------------------------*/
1392eHalStatus csrRoamGetWapiReqIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
1393
1394/* ---------------------------------------------------------------------------
1395 \fn csrRoamGetWapiRspIE
1396 \brief return the WAPI IE from the beacon or probe rsp if connected
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001397 \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 -07001398 needed or IE length in pBuf.
1399 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1400 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1401 -------------------------------------------------------------------------------*/
1402eHalStatus csrRoamGetWapiRspIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001403tANI_U8 csrConstructWapiIe( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
Jeff Johnson295189b2012-06-20 16:38:30 -07001404 tSirBssDescription *pSirBssDesc, tDot11fBeaconIEs *pIes, tCsrWapiIe *pWapiIe );
1405#endif /* FEATURE_WLAN_WAPI */
1406
Jeff Johnson295189b2012-06-20 16:38:30 -07001407eHalStatus csrRoamUpdateAPWPSIE( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirAPWPSIEs *pAPWPSIES );
1408eHalStatus csrRoamUpdateWPARSNIEs( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirRSNie * pAPSirRSNie);
Jeff Johnson295189b2012-06-20 16:38:30 -07001409void csrSetCfgPrivacy( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, tANI_BOOLEAN fPrivacy );
1410tANI_S8 csrGetInfraSessionId( tpAniSirGlobal pMac );
1411tANI_U8 csrGetInfraOperationChannel( tpAniSirGlobal pMac, tANI_U8 sessionId);
Sushant Kaushik1d732562014-05-21 14:15:37 +05301412tANI_BOOLEAN csrIsSessionClientAndConnected(tpAniSirGlobal pMac, tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -07001413tANI_U8 csrGetConcurrentOperationChannel( tpAniSirGlobal pMac );
1414
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001415eHalStatus csrRoamCopyConnectProfile(tpAniSirGlobal pMac, tANI_U32 sessionId,
Jeff Johnson295189b2012-06-20 16:38:30 -07001416 tCsrRoamConnectedProfile *pProfile);
1417tANI_BOOLEAN csrIsSetKeyAllowed(tpAniSirGlobal pMac, tANI_U32 sessionId);
1418
1419void csrSetOppositeBandChannelInfo( tpAniSirGlobal pMac );
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001420void csrConstructCurrentValidChannelList( tpAniSirGlobal pMac, tDblLinkList *pChannelSetList,
Jeff Johnson295189b2012-06-20 16:38:30 -07001421 tANI_U8 *pChannelList, tANI_U8 bSize, tANI_U8 *pNumChannels );
Manjunathappa Prakash4f1d5a52013-11-11 16:22:19 -08001422
1423#ifdef FEATURE_WLAN_SCAN_PNO
Srikant Kuppa066904f2013-05-07 13:56:02 -07001424eHalStatus csrScanSavePreferredNetworkFound(tpAniSirGlobal pMac,
1425 tSirPrefNetworkFoundInd *pPrefNetworkFoundInd);
Manjunathappa Prakash4f1d5a52013-11-11 16:22:19 -08001426#endif //FEATURE_WLAN_SCAN_PNO
Jeff Johnson295189b2012-06-20 16:38:30 -07001427#endif
1428
1429#ifdef WLAN_FEATURE_VOWIFI_11R
1430//Returns whether the current association is a 11r assoc or not
1431tANI_BOOLEAN csrRoamIs11rAssoc(tpAniSirGlobal pMac);
1432#endif
1433
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001434#ifdef FEATURE_WLAN_ESE
1435//Returns whether the current association is a ESE assoc or not
1436tANI_BOOLEAN csrRoamIsESEAssoc(tpAniSirGlobal pMac);
1437tANI_BOOLEAN csrRoamIsEseIniFeatureEnabled(tpAniSirGlobal pMac);
1438tANI_BOOLEAN csrNeighborRoamIsESEAssoc(tpAniSirGlobal pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001439#endif
1440
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001441//Remove this code once SLM_Sessionization is supported
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -07001442//BMPS_WORKAROUND_NOT_NEEDED
Jeff Johnson295189b2012-06-20 16:38:30 -07001443void csrDisconnectAllActiveSessions(tpAniSirGlobal pMac);
Mohit Khanna349bc392012-09-11 17:24:52 -07001444
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001445#ifdef FEATURE_WLAN_LFR
1446//Returns whether "Legacy Fast Roaming" is enabled...or not
Madan Mohan Koyyalamudi03aae5f2012-11-28 01:51:22 +05301447tANI_BOOLEAN csrRoamIsFastRoamEnabled(tpAniSirGlobal pMac, tANI_U32 sessionId);
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -07001448#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
1449tANI_BOOLEAN csrRoamIsRoamOffloadScanEnabled(tpAniSirGlobal pMac);
1450#endif
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -07001451tANI_BOOLEAN csrIsChannelPresentInList( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel );
1452VOS_STATUS csrAddToChannelListFront( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel );
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -07001453#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
1454eHalStatus csrScanRequestLfrResult(tpAniSirGlobal pMac, tANI_U32 sessionId,
1455 csrScanCompleteCallback callback, void *pContext);
Varun Reddy Yeturucc661d22013-05-20 11:47:10 -07001456eHalStatus csrRoamOffloadScanRspHdlr(tpAniSirGlobal pMac, tANI_U8 reason);
1457eHalStatus csrHandoffRequest(tpAniSirGlobal pMac, tCsrHandoffRequest *pHandoffInfo);
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -07001458#endif
1459tANI_BOOLEAN csrRoamIsStaMode(tpAniSirGlobal pMac, tANI_U32 sessionId);
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001460#endif
1461
Agarwal Ashish738843c2014-09-25 12:27:56 +05301462void csrDisableDfsChannel(tpAniSirGlobal pMac);