blob: 77a4dd2cd8315f83070952c621d396f339d1d02a [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Padma, Santhosh Kumar67f479b2016-12-28 15:43:42 +05302 * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved.
Kiet Lam0fb93dd2014-02-19 00:32:59 -08003 *
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"
Sushant Kaushik33200572015-08-05 16:46:20 +053043#include "vos_utils.h"
44
Jeff Johnson295189b2012-06-20 16:38:30 -070045#include "vos_lock.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070046
47#include "palTimer.h"
48#include "csrSupport.h"
49#include "vos_nvitem.h"
50#include "wlan_qct_tl.h"
51
Ratheesh S Pece1f832015-07-25 15:50:25 +053052#include "csrApi.h"
53
Jeff Johnson295189b2012-06-20 16:38:30 -070054#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
55#include "csrNeighborRoam.h"
56#endif
57
58#define CSR_MAX_STA (HAL_NUM_STA)
59
60#define CSR_SME_SCAN_FLAGS_DELETE_CACHE 0x80
61
62#define CSR_TITAN_MAX_RATE_MIMO_CB 240
63#define CSR_TITAN_MAX_RATE_MIMO 126
64
65//define scan return criteria. LIM should use these define as well
66#define CSR_SCAN_RETURN_AFTER_ALL_CHANNELS ( 0 )
67#define CSR_SCAN_RETURN_AFTER_FIRST_MATCH ( 0x01 )
68#define CSR_SCAN_RETURN_AFTER_5_BAND_11d_FOUND ( 0x80 )
69#define CSR_SCAN_RETURN_AFTER_24_BAND_11d_FOUND ( 0x40 )
70#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 -070071#define CSR_NUM_RSSI_CAT 15
Jeff Johnson295189b2012-06-20 16:38:30 -070072#define CSR_MAX_STATISTICS_REQ 10
Varun Reddy Yeturu9d4102c2013-12-02 15:47:03 -080073#define CSR_ROAM_SCAN_CHANNEL_SWITCH_TIME 3
Jeff Johnson295189b2012-06-20 16:38:30 -070074
75//Support for multiple session
76#define CSR_SESSION_ID_INVALID 0xFF // session ID invalid
77#define CSR_ROAM_SESSION_MAX 5 // No of sessions to be supported, and a
78 // session is for Infra, IBSS or BT-AMP
79
80#define CSR_IS_SESSION_VALID( pMac, sessionId ) ( ( (sessionId) < CSR_ROAM_SESSION_MAX ) \
81 && ( (pMac)->roam.roamSession[(sessionId)].sessionActive ) )
82#define CSR_GET_SESSION( pMac, sessionId ) \
83( \
84 (sessionId < CSR_ROAM_SESSION_MAX) ? \
85 (&(pMac)->roam.roamSession[(sessionId)]) :\
86 NULL \
87)
88
Agrawal Ashish0b6984f2014-04-05 18:35:45 +053089#define CSR_MAX_NUM_COUNTRY_CODE 100
Srinivas Girigowda41c7c5f2013-10-21 19:01:38 -070090#define CSR_IS_SELECT_5GHZ_MARGIN( pMac ) \
91( \
92 (((pMac)->roam.configParam.nSelect5GHzMargin)?eANI_BOOLEAN_TRUE:eANI_BOOLEAN_FALSE) \
93)
94
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -080095#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR)
Madan Mohan Koyyalamudid5026072012-11-30 14:56:21 -080096#define CSR_IS_ROAM_PREFER_5GHZ( pMac ) \
97( \
98 (((pMac)->roam.configParam.nRoamPrefer5GHz)?eANI_BOOLEAN_TRUE:eANI_BOOLEAN_FALSE) \
99)
Srinivas Girigowdabbd16eb2013-03-21 12:34:46 -0700100#define CSR_IS_ROAM_INTRA_BAND_ENABLED( pMac ) \
101( \
102 (((pMac)->roam.configParam.nRoamIntraBand)?eANI_BOOLEAN_TRUE:eANI_BOOLEAN_FALSE) \
103)
Madan Mohan Koyyalamudid5026072012-11-30 14:56:21 -0800104#endif
105
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700106#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
107#define CSR_IS_ROAM_SCAN_OFFLOAD_ENABLED( pMac ) \
108( \
109 (((pMac)->roam.configParam.isRoamOffloadScanEnabled)?eANI_BOOLEAN_TRUE:eANI_BOOLEAN_FALSE) \
110)
Srinivas Girigowda830bbd02013-06-13 19:44:16 -0700111
112#define CSR_IS_FASTROAM_IN_CONCURRENCY_INI_FEATURE_ENABLED( pMac ) \
113( \
114 (((pMac)->roam.configParam.bFastRoamInConIniFeatureEnabled)?eANI_BOOLEAN_TRUE:eANI_BOOLEAN_FALSE) \
115)
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700116#endif
117
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800118//Support for "Fast roaming" (i.e., ESE, LFR, or 802.11r.)
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -0700119#define CSR_BG_SCAN_OCCUPIED_CHANNEL_LIST_LEN 15
Jeff Johnson295189b2012-06-20 16:38:30 -0700120
121typedef enum
122{
123 //eCSR_CFG_DOT11_MODE_BEST = 0,
124 eCSR_CFG_DOT11_MODE_TAURUS = 0,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800125 eCSR_CFG_DOT11_MODE_ABG,
126 eCSR_CFG_DOT11_MODE_11A,
127 eCSR_CFG_DOT11_MODE_11B,
128 eCSR_CFG_DOT11_MODE_11G,
129 eCSR_CFG_DOT11_MODE_11N,
130 eCSR_CFG_DOT11_MODE_POLARIS,
131 eCSR_CFG_DOT11_MODE_TITAN,
Jeff Johnsone7245742012-09-05 17:12:55 -0700132#ifdef WLAN_FEATURE_11AC
133 eCSR_CFG_DOT11_MODE_11AC,
134#endif
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800135 eCSR_CFG_DOT11_MODE_11G_ONLY,
136 eCSR_CFG_DOT11_MODE_11N_ONLY,
Jeff Johnsone7245742012-09-05 17:12:55 -0700137#ifdef WLAN_FEATURE_11AC
138 eCSR_CFG_DOT11_MODE_11AC_ONLY,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800139#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700140 //This value can never set to CFG. It is for CSR's internal use
141 eCSR_CFG_DOT11_MODE_AUTO,
142}eCsrCfgDot11Mode; //Used to determine what to set to the WNI_CFG_DOT11_MODE
143
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800144typedef enum etCsrRoamCommands
Jeff Johnson295189b2012-06-20 16:38:30 -0700145{
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800146 eCsrRoamNoCommand,
Jeff Johnson295189b2012-06-20 16:38:30 -0700147 eCsrRoamCommandScan,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800148 eCsrRoamCommandRoam,
149 eCsrRoamCommandWmStatusChange,
Jeff Johnson295189b2012-06-20 16:38:30 -0700150 eCsrRoamCommandSetKey,
151 eCsrRoamCommandRemoveKey,
152
153} eCsrRoamCommands;
154
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800155typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700156{
157 eCsrScanOther = 1,
158 eCsrScanLostLink1,
159 eCsrScanLostLink2,
160 eCsrScanLostLink3,
161 eCsrScanLostLink4,
162 eCsrScan11d1, //First 11d scan
163 eCsrScan11d2, //First 11d scan has failed
164 eCsrScan11dDone, //11d scan succeeded, try the rest of the channel
165 eCsrScanUserRequest,
166 eCsrScanGetResult,
167 eCsrScanSetBGScanParam, //used for HO too - bg scan request in NT Handoff sub-state
168 eCsrScanForSsid,
169 eCsrScanForCapsChange,
170 eCsrScanBGScanAbort,
171 eCsrScanBGScanEnable,
172 eCsrScanIdleScan,
173 eCsrScanGetScanChnInfo, //To get the list of channels scanned
174
175 eCsrScanBgScan, // bg scan request in NRT & RT Handoff sub-states
176 eCsrScanProbeBss, // directed probe on an entry from the candidate list - HO
177 eCsrScanAbortBgScan, //aborting a BG scan (meaning the scan is triggered by LIM timer)
178 eCsrScanAbortNormalScan, //aborting a normal scan (the scan is trigger by eWNI_SME_SCAN_REQ)
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700179 eCsrScanP2PFindPeer,
180 eCsrScanGetLfrResult, // get the LFR candidates from PE scan cache
Jeff Johnson295189b2012-06-20 16:38:30 -0700181}eCsrScanReason;
182
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800183typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700184{
185 eCsrNoConnection, // Roaming because we have not established the initial connection.
186 eCsrCapsChange, // roaming because LIM reported a Capability change in the associated AP.
187 eCsrForcedDisassoc, // roaming becuase someone asked us to Disassoc and stay disassociated.
188 eCsrHddIssued, // roaming because an 802.11 request was issued to the driver.
189 eCsrLostLink1, // roaming because we lost link to an associated AP
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800190 eCsrLostLink2,
Jeff Johnson295189b2012-06-20 16:38:30 -0700191 eCsrLostLink3,
192 eCsrForcedDisassocMICFailure, // roaming because we need to force a Disassoc due to MIC failure
193 eCsrHddIssuedReassocToSameAP,
194 eCsrSmeIssuedReassocToSameAP,
195 eCsrSmeIssuedReassocToDiffAP,
196 eCsrForcedDeauth, // roaming becuase someone asked us to deauth and stay disassociated.
197 eCsrSmeIssuedDisassocForHandoff, // will be issued by Handoff logic to disconect from current AP
198 eCsrSmeIssuedAssocToSimilarAP, // will be issued by Handoff logic to join a new AP with same profile
199 eCsrSmeIssuedIbssJoinFailure, // ibss join timer fired before any perr showed up, so shut down the network
200 eCsrForcedIbssLeave,
201 eCsrStopBss,
202 eCsrSmeIssuedFTReassoc,
203 eCsrForcedDisassocSta,
204 eCsrForcedDeauthSta,
Madan Mohan Koyyalamudi286b60e2012-10-11 12:59:07 -0700205 eCsrPerformPreauth,
Venkata Prathyusha Kuntupalli239278b2013-03-26 15:58:18 -0700206 eCsrLostLink1Abort,
207 eCsrLostLink2Abort,
208 eCsrLostLink3Abort,
Padma, Santhosh Kumar67f479b2016-12-28 15:43:42 +0530209 ecsr_mbb_perform_preauth_reassoc,
Jeff Johnson295189b2012-06-20 16:38:30 -0700210}eCsrRoamReason;
211
212typedef enum
213{
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800214 eCSR_ROAM_SUBSTATE_NONE = 0,
215 eCSR_ROAM_SUBSTATE_START_BSS_REQ,
216 eCSR_ROAM_SUBSTATE_JOIN_REQ,
217 eCSR_ROAM_SUBSTATE_REASSOC_REQ,
218 eCSR_ROAM_SUBSTATE_DISASSOC_REQ,
219 eCSR_ROAM_SUBSTATE_STOP_BSS_REQ,
220 eCSR_ROAM_SUBSTATE_DISCONNECT_CONTINUE_ROAMING, //Continue the current roam command after disconnect
221 eCSR_ROAM_SUBSTATE_AUTH_REQ,
222 eCSR_ROAM_SUBSTATE_CONFIG,
223 eCSR_ROAM_SUBSTATE_DEAUTH_REQ,
224 eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN,
225 eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE,
226 eCSR_ROAM_SUBSTATE_DISASSOC_FORCED,
Jeff Johnson295189b2012-06-20 16:38:30 -0700227 eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY,
228 eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF,
229 eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC,
230 eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC,
231 eCSR_ROAM_SUBSTATE_JOINED_REALTIME_TRAFFIC,
232// max is 15 unless the bitfield is expanded...
233} eCsrRoamSubState;
234
235
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800236typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700237{
238 eCSR_ROAMING_STATE_STOP = 0,
239 eCSR_ROAMING_STATE_IDLE,
240 eCSR_ROAMING_STATE_SCANNING,
241 eCSR_ROAMING_STATE_JOINING,
242 eCSR_ROAMING_STATE_JOINED,
243}eCsrRoamState;
244
245
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800246typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700247{
248 eCsrContinueRoaming,
249 eCsrStopRoaming,
250 eCsrStartIbss,
251 eCsrStartIbssSameIbss,
252 eCsrReassocToSelfNoCapChange,
Jeff Johnsone7245742012-09-05 17:12:55 -0700253 eCsrStopRoamingDueToConcurrency,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800254
Jeff Johnson295189b2012-06-20 16:38:30 -0700255}eCsrJoinState;
256
257typedef enum
258{
259 eCsrNotRoaming,
260 eCsrLostlinkRoamingDisassoc,
261 eCsrLostlinkRoamingDeauth,
262 eCsrDynamicRoaming,
263 eCsrReassocRoaming,
264}eCsrRoamingReason;
265
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800266typedef enum
Jeff Johnson295189b2012-06-20 16:38:30 -0700267{
268 eCsrDisassociated,
269 eCsrDeauthenticated
270
271}eCsrRoamWmStatusChangeTypes;
272
273typedef enum
274{
275 eCsrSummaryStats = 0,
276 eCsrGlobalClassAStats,
277 eCsrGlobalClassBStats,
278 eCsrGlobalClassCStats,
279 eCsrGlobalClassDStats,
280 eCsrPerStaStats,
Sushant Kaushik33200572015-08-05 16:46:20 +0530281 eCsrPerPktStats,
Jeff Johnson295189b2012-06-20 16:38:30 -0700282 eCsrMaxStats
283}eCsrRoamStatsClassTypes;
284
285#ifdef FEATURE_WLAN_DIAG_SUPPORT
286typedef enum
287{
288 eCSR_WLAN_STATUS_CONNECT =0,
289 eCSR_WLAN_STATUS_DISCONNECT
290
291}eCsrDiagWlanStatusEventSubtype;
292
293typedef enum
294{
295 eCSR_REASON_UNSPECIFIED = 0,
296 eCSR_REASON_USER_REQUESTED,
297 eCSR_REASON_MIC_ERROR,
298 eCSR_REASON_DISASSOC,
299 eCSR_REASON_DEAUTH,
300 eCSR_REASON_HANDOFF,
301
302}eCsrDiagWlanStatusEventReason;
303
304typedef enum
305{
306 eCSR_WLAN_HANDOFF_EVENT =0,
307
308}eCsrDiagWlanHandoffEventSubtype;
309
310typedef enum
311{
312 eCSR_WLAN_VCC_EVENT =0,
313
314}eCsrDiagWlanVccEventSubtype;
315
316#endif //FEATURE_WLAN_DIAG_SUPPORT
317
318typedef struct tagCsrChannel
319{
320 tANI_U8 numChannels;
321 tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
322}tCsrChannel;
323
324typedef struct tagScanProfile
325{
326 tANI_U32 minChnTime;
327 tANI_U32 maxChnTime;
328 tANI_U32 restTime; //This is ignored if not associated
329 tANI_U32 numOfChannels;
330 tANI_U8 *pChannelList;
331 tSirScanType scanType; //active or passive
332 eCsrRoamBssType bssType; //BSS or IBSS
333 tANI_U8 ssid[WNI_CFG_SSID_LEN];
334 tANI_U8 bReturnAfter1stMatch;
335 tANI_U8 fUniqueResult;
336 tANI_U8 freshScan;
337 tCsrBssid bssid;
338}tScanProfile;
339
340typedef struct tagBssConfigParam
341{
342 eCsrMediaAccessType qosType;
343 tSirMacSSid SSID;
344 tANI_U32 uRTSThresh;
345 tANI_U32 uDeferThresh; //
346 eCsrCfgDot11Mode uCfgDot11Mode;
347 eCsrBand eBand;
348 tANI_U8 standardRate[CSR_DOT11_SUPPORTED_RATES_MAX];
349 tANI_U8 extendedRate[CSR_DOT11_EXTENDED_SUPPORTED_RATES_MAX];
350 eCsrExposedTxRate txRate;
351 tAniAuthType authType;
352 eCsrEncryptionType encType;
353 tANI_U32 uShortSlotTime;
354 tANI_U32 uHTSupport; //High throughput
355 tANI_U32 uPowerLimit;
356 tANI_U32 uHeartBeatThresh;
357 tANI_U32 uJoinTimeOut;
358 tSirMacCapabilityInfo BssCap;
359 tANI_BOOLEAN f11hSupport;
Jeff Johnsone7245742012-09-05 17:12:55 -0700360 ePhyChanBondState cbMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700361}tBssConfigParam;
362
363
364typedef struct tagCsrRoamStartBssParams
365{
366 tSirMacSSid ssId;
367 tCsrBssid bssid; //this is the BSSID for the party we want to join (only use for IBSS or WDS)
368 tSirNwType sirNwType;
Jeff Johnsone7245742012-09-05 17:12:55 -0700369 ePhyChanBondState cbMode;
Abhishek Singh02b823e2017-10-30 17:53:20 +0530370 enum eSirMacHTChannelWidth orig_ch_width;
Jeff Johnson295189b2012-06-20 16:38:30 -0700371 tSirMacRateSet operationalRateSet;
372 tSirMacRateSet extendedRateSet;
373 tANI_U8 operationChn;
374 eCsrCfgDot11Mode uCfgDot11Mode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700375 tANI_U8 privacy;
376 tANI_BOOLEAN fwdWPSPBCProbeReq;
377 tANI_BOOLEAN protEnabled;
378 tANI_BOOLEAN obssProtEnabled;
379 tAniAuthType authType;
380 tANI_U16 beaconInterval; //If this is 0, SME will fill in for caller.
381 tANI_U16 ht_protection;
382 tANI_U32 dtimPeriod;
383 tANI_U8 ApUapsdEnable;
384 tANI_U8 ssidHidden;
385 tANI_U8 wps_state;
Jeff Johnson295189b2012-06-20 16:38:30 -0700386 tVOS_CON_MODE bssPersona;
387 tANI_U16 nRSNIELength; //The byte count in the pRSNIE, if 0, pRSNIE is ignored.
388 tANI_U8 *pRSNIE; //If not null, it has the IE byte stream for RSN
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800389 tANI_BOOLEAN updatebeaconInterval; //Flag used to indicate update
390 // beaconInterval
Chet Lanctot8cecea22014-02-11 19:09:36 -0800391#ifdef WLAN_FEATURE_11W
392 tANI_BOOLEAN mfpCapable;
393 tANI_BOOLEAN mfpRequired;
394#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700395}tCsrRoamStartBssParams;
396
397
398typedef struct tagScanCmd
399{
400 tANI_U32 scanID;
401 csrScanCompleteCallback callback;
402 void *pContext;
403 eCsrScanReason reason;
Jeff Johnson295189b2012-06-20 16:38:30 -0700404 tCsrRoamProfile *pToRoamProfile;
405 tANI_U32 roamId; //this is the ID related to the pToRoamProfile
406 union
407 {
408 tCsrScanRequest scanRequest;
409 tCsrBGScanRequest bgScanRequest;
410 }u;
Srinivas, Dasari187ca4e2014-02-07 12:40:09 +0530411 //This flag will be set while aborting the scan due to band change
Ratheesh S Pece1f832015-07-25 15:50:25 +0530412 eCsrAbortReason abortScanIndication;
Jeff Johnson295189b2012-06-20 16:38:30 -0700413}tScanCmd;
414
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800415typedef struct tagRoamCmd
Jeff Johnson295189b2012-06-20 16:38:30 -0700416{
417 tANI_U32 roamId;
418 eCsrRoamReason roamReason;
419 tCsrRoamProfile roamProfile;
420 tScanResultHandle hBSSList; //BSS list fits the profile
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800421 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 -0700422 tSirBssDescription *pLastRoamBss; //the last BSS we try and failed
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800423 tANI_BOOLEAN fReleaseBssList; //whether to free hBSSList
Jeff Johnson295189b2012-06-20 16:38:30 -0700424 tANI_BOOLEAN fReleaseProfile; //whether to free roamProfile
425 tANI_BOOLEAN fReassoc; //whether this command is for reassociation
426 tANI_BOOLEAN fUpdateCurRoamProfile; //whether pMac->roam.pCurRoamProfile needs to be updated
427 //this is for CSR internal used only. And it should not be assigned when creating the command
428 //This causes the roam command not to do anything.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800429 tANI_BOOLEAN fReassocToSelfNoCapChange;
Jeff Johnson295189b2012-06-20 16:38:30 -0700430
431 tANI_BOOLEAN fStopWds;
432 tSirMacAddr peerMac;
433 tSirMacReasonCodes reason;
434}tRoamCmd;
435
436typedef struct tagSetKeyCmd
437{
438 tANI_U32 roamId;
439 eCsrEncryptionType encType;
440 eCsrAuthType authType;
441 tAniKeyDirection keyDirection; //Tx, Rx or Tx-and-Rx
442 tSirMacAddr peerMac; //Peer's MAC address. ALL 1's for group key
443 tANI_U8 paeRole; //0 for supplicant
444 tANI_U8 keyId; // Kye index
445 tANI_U8 keyLength; //Number of bytes containing the key in pKey
446 tANI_U8 Key[CSR_MAX_KEY_LEN];
447 tANI_U8 keyRsc[CSR_MAX_RSC_LEN];
448} tSetKeyCmd;
449
450typedef struct tahRemoveKeyCmd
451{
452 tANI_U32 roamId;
453 eCsrEncryptionType encType;
454 eCsrAuthType authType;
455 tSirMacAddr peerMac; //Peer's MAC address. ALL 1's for group key
456 tANI_U8 keyId; //key index
457} tRemoveKeyCmd;
458
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800459typedef struct tagWmStatusChangeCmd
Jeff Johnson295189b2012-06-20 16:38:30 -0700460{
461 eCsrRoamWmStatusChangeTypes Type;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800462 union
463 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700464 tSirSmeDeauthInd DeauthIndMsg;
465 tSirSmeDisassocInd DisassocIndMsg;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800466 }u;
Jeff Johnson295189b2012-06-20 16:38:30 -0700467
468}tWmStatusChangeCmd;
469
Kiran Kumar Lokere0ad5cd32013-06-25 11:26:22 -0700470
Jeff Johnson295189b2012-06-20 16:38:30 -0700471typedef struct tagAddStaForSessionCmd
472{
473 //Session self mac addr
474 tSirMacAddr selfMacAddr;
Kiran Kumar Lokere0ad5cd32013-06-25 11:26:22 -0700475 tVOS_CON_MODE currDeviceMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700476}tAddStaForSessionCmd;
477
478typedef struct tagDelStaForSessionCmd
479{
480 //Session self mac addr
481 tSirMacAddr selfMacAddr;
482 csrRoamSessionCloseCallback callback;
483 void *pContext;
484}tDelStaForSessionCmd;
485
486//This structure represents one scan request
487typedef struct tagCsrCmd
488{
489 tListElem Link;
490 eCsrRoamCommands command;
491 tANI_U8 sessionId; // Session ID for this command
492 union
493 {
494 tScanCmd scanCmd;
495 tRoamCmd roamCmd;
496 tWmStatusChangeCmd wmStatusChangeCmd;
497 tSetKeyCmd setKeyCmd;
498 tRemoveKeyCmd removeKeyCmd;
499 tAddStaForSessionCmd addStaSessionCmd;
500 tDelStaForSessionCmd delStaSessionCmd;
501 }u;
502}tCsrCmd;
503
504#ifdef WLAN_FEATURE_VOWIFI_11R
505typedef struct tagCsr11rConfig
506{
507 tANI_BOOLEAN IsFTResourceReqSupported;
508} tCsr11rConfig;
509#endif
510
511#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
512typedef struct tagCsrNeighborRoamConfig
513{
514 tANI_U32 nNeighborScanTimerPeriod;
515 tANI_U8 nNeighborLookupRssiThreshold;
516 tANI_U8 nNeighborReassocRssiThreshold;
517 tANI_U16 nNeighborScanMinChanTime;
518 tANI_U16 nNeighborScanMaxChanTime;
519 sCsrChannel neighborScanChanList;
520 tANI_U8 nMaxNeighborRetries;
521 tANI_U16 nNeighborResultsRefreshPeriod;
Srinivas Girigowdade697412013-02-14 16:31:48 -0800522 tANI_U16 nEmptyScanRefreshPeriod;
Mukul Sharmad49b3d62014-09-02 01:45:32 +0530523 tANI_U8 nNeighborInitialForcedRoamTo5GhEnable;
Sreelakshmi Konamki70bfdaf2017-05-29 18:47:29 +0530524 tANI_U8 nWeakZoneRssiThresholdForRoam;
Jeff Johnson295189b2012-06-20 16:38:30 -0700525}tCsrNeighborRoamConfig;
526#endif
527
528typedef struct tagCsrConfig
529{
530 tANI_U32 agingCount;
531 tANI_U32 FragmentationThreshold;
532 tANI_U32 channelBondingMode24GHz;
533 tANI_U32 channelBondingMode5GHz;
534 tANI_U32 RTSThreshold;
535 eCsrPhyMode phyMode;
536 eCsrCfgDot11Mode uCfgDot11Mode;
537 eCsrBand eBand;
538 tANI_U32 HeartbeatThresh50;
539 tANI_U32 HeartbeatThresh24;
540 tANI_U32 bgScanInterval;
541 eCsrCBChoice cbChoice;
542 eCsrBand bandCapability; //indicate hw capability
543 eCsrRoamWmmUserModeType WMMSupportMode;
544 tANI_BOOLEAN Is11eSupportEnabled;
545 tANI_BOOLEAN Is11dSupportEnabled;
546 tANI_BOOLEAN Is11dSupportEnabledOriginal;
547 tANI_BOOLEAN Is11hSupportEnabled;
548 tANI_BOOLEAN shortSlotTime;
549 tANI_BOOLEAN ProprietaryRatesEnabled;
550 tANI_BOOLEAN fenableMCCMode;
551 tANI_U16 TxRate;
Madan Mohan Koyyalamudi167b95e2012-11-27 15:53:38 -0800552 tANI_U8 fAllowMCCGODiffBI;
Jeff Johnson295189b2012-06-20 16:38:30 -0700553 tANI_U8 AdHocChannel24;
554 tANI_U8 AdHocChannel5G;
555 tANI_U32 impsSleepTime; //in units of microseconds
556 tANI_U32 scanAgeTimeNCNPS; //scan result aging time threshold when Not-Connect-No-Power-Save, in seconds
557 tANI_U32 scanAgeTimeNCPS; //scan result aging time threshold when Not-Connect-Power-Save, in seconds
558 tANI_U32 scanAgeTimeCNPS; //scan result aging time threshold when Connect-No-Power-Save, in seconds,
559 tANI_U32 scanAgeTimeCPS; //scan result aging time threshold when Connect-Power-Savein seconds
560 tANI_U32 BssPreferValue[CSR_NUM_RSSI_CAT]; //each RSSI category has one value
561 int RSSICat[CSR_NUM_RSSI_CAT];
562 tANI_U8 bCatRssiOffset; //to set the RSSI difference for each category
563 tANI_U32 nRoamingTime; //In seconds, CSR will try this long before gives up, 0 means no roaming
564 //Whether to limit the channels to the ones set in Csr11dInfo. If true, the opertaional
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800565 //channels are limited to the default channel list. It is an "AND" operation between the
Jeff Johnson295189b2012-06-20 16:38:30 -0700566 //default channels and the channels in the 802.11d IE.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800567 tANI_BOOLEAN fEnforce11dChannels;
Jeff Johnson295189b2012-06-20 16:38:30 -0700568 //Country Code Priority
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800569 //0 = 802.11D > Configured Country > NV
Jeff Johnson295189b2012-06-20 16:38:30 -0700570 //1 = Configured Country > 802.11D > NV
571 tANI_BOOLEAN fSupplicantCountryCodeHasPriority;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800572 //When true, AP with unknown country code won't be see.
573 //"Unknown country code" means either Ap doesn't have 11d IE or we cannot
Jeff Johnson295189b2012-06-20 16:38:30 -0700574 //find a domain for the country code in its 11d IE.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800575 tANI_BOOLEAN fEnforceCountryCodeMatch;
Jeff Johnson295189b2012-06-20 16:38:30 -0700576 //When true, only APs in the default domain can be seen. If the Ap has "unknown country
577 //code", or the doamin of the country code doesn't match the default domain, the Ap is
578 //not acceptable.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800579 tANI_BOOLEAN fEnforceDefaultDomain;
Abhishek Singh2ec36ab2014-08-07 16:14:25 +0530580 //When set, It enforece country code even if 11doriginal is true
581 tANI_BOOLEAN fEnforceCountryCode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700582 tANI_U16 vccRssiThreshold;
583 tANI_U32 vccUlMacLossThreshold;
584
585 tANI_U32 nPassiveMinChnTime; //in units of milliseconds
586 tANI_U32 nPassiveMaxChnTime; //in units of milliseconds
587 tANI_U32 nActiveMinChnTime; //in units of milliseconds
588 tANI_U32 nActiveMaxChnTime; //in units of milliseconds
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800589
c_hpothu059edb02014-03-12 21:44:28 +0530590 tANI_U32 nInitialDwellTime; //in units of milliseconds
591
Abhishek Singh3a93ee42016-09-29 17:00:03 +0530592 uint32_t min_chntime_btc_esco; //in units of milliseconds
593 uint32_t max_chntime_btc_esco; //in units of milliseconds
594 uint32_t min_chntime_btc_sco;
595 uint32_t max_chntime_btc_sco;
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -0700596 tANI_U8 disableAggWithBtc;
Madan Mohan Koyyalamudi4ff9cd62012-10-30 17:48:57 -0700597#ifdef WLAN_AP_STA_CONCURRENCY
598 tANI_U32 nPassiveMinChnTimeConc; //in units of milliseconds
599 tANI_U32 nPassiveMaxChnTimeConc; //in units of milliseconds
600 tANI_U32 nActiveMinChnTimeConc; //in units of milliseconds
601 tANI_U32 nActiveMaxChnTimeConc; //in units of milliseconds
602 tANI_U32 nRestTimeConc; //in units of milliseconds
Sudhir Sattayappa Kohallieb97d502013-05-22 23:16:42 -0700603 tANI_U8 nNumStaChanCombinedConc; //number of channels combined for
604 //Sta in each split scan operation
605 tANI_U8 nNumP2PChanCombinedConc; //number of channels combined for
606 //P2P in each split scan operation
Madan Mohan Koyyalamudi4ff9cd62012-10-30 17:48:57 -0700607#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700608
609 tANI_BOOLEAN IsIdleScanEnabled;
610 //in dBm, the maximum TX power
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800611 //The actual TX power is the lesser of this value and 11d.
Jeff Johnson295189b2012-06-20 16:38:30 -0700612 //If 11d is disable, the lesser of this and default setting.
613 tANI_U8 nTxPowerCap;
614 tANI_U32 statsReqPeriodicity; //stats request frequency from PE while in full power
615 tANI_U32 statsReqPeriodicityInPS;//stats request frequency from PE while in power save
Jeff Johnson295189b2012-06-20 16:38:30 -0700616 tANI_U32 dtimPeriod;
617 tANI_BOOLEAN ssidHidden;
Jeff Johnson295189b2012-06-20 16:38:30 -0700618
619#ifdef WLAN_FEATURE_VOWIFI_11R
620 tCsr11rConfig csr11rConfig;
621#endif
622
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700623#ifdef FEATURE_WLAN_LFR
Srinivas Girigowda830bbd02013-06-13 19:44:16 -0700624 tANI_U8 isFastRoamIniFeatureEnabled;
Sameer Thalappil4ae66ec2013-11-05 14:17:35 -0800625 tANI_U8 MAWCEnabled;
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700626#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
Srinivas Girigowda830bbd02013-06-13 19:44:16 -0700627 tANI_U8 isRoamOffloadScanEnabled;
628 tANI_BOOLEAN bFastRoamInConIniFeatureEnabled;
Kapil Gupta04ab1992016-06-26 13:36:51 +0530629 v_BOOL_t isPERRoamEnabled;
630 v_BOOL_t isPERRoamCCAEnabled;
Kapil Guptac69c28a2016-08-25 14:11:17 +0530631 v_S15_t PERRoamFullScanThreshold;
Kapil Gupta192d9d42016-11-25 16:24:13 +0530632 v_S15_t PERMinRssiThresholdForRoam;
Kapil Gupta04ab1992016-06-26 13:36:51 +0530633 tANI_U32 rateUpThreshold;
634 tANI_U32 rateDownThreshold;
635 tANI_U32 waitPeriodForNextPERScan;
636 tANI_U32 PERtimerThreshold;
637 tANI_U32 PERroamTriggerPercent;
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -0700638#endif
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700639#endif
640
Padma, Santhosh Kumar67f479b2016-12-28 15:43:42 +0530641#ifdef WLAN_FEATURE_LFR_MBB
642 tANI_BOOLEAN enable_lfr_mbb;
643#endif
644
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800645#ifdef FEATURE_WLAN_ESE
646 tANI_U8 isEseIniFeatureEnabled;
Jeff Johnson295189b2012-06-20 16:38:30 -0700647#endif
648
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800649#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR)
Srinivas Girigowda100eb322013-03-15 16:48:20 -0700650 tANI_U8 isFastTransitionEnabled;
651 tANI_U8 RoamRssiDiff;
652 tANI_U8 nImmediateRoamRssiDiff;
653 tANI_BOOLEAN nRoamPrefer5GHz;
654 tANI_BOOLEAN nRoamIntraBand;
Srinivas Girigowdaad34ca92013-10-22 10:54:29 -0700655 tANI_BOOLEAN isWESModeEnabled;
Srinivas Girigowda100eb322013-03-15 16:48:20 -0700656 tANI_BOOLEAN nRoamScanControl;
Varun Reddy Yeturu920df212013-05-22 08:07:23 -0700657 tANI_U8 nProbes;
658 tANI_U16 nRoamScanHomeAwayTime;
Jeff Johnson295189b2012-06-20 16:38:30 -0700659#endif
660
661#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
662 tCsrNeighborRoamConfig neighborRoamConfig;
663#endif
664
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800665 /* Instead of Reassoc, send ADDTS/DELTS even when ACM is off for that AC
Jeff Johnson295189b2012-06-20 16:38:30 -0700666 * This is mandated by WMM-AC certification */
667 tANI_BOOLEAN addTSWhenACMIsOff;
668
669 tANI_BOOLEAN fValidateList;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800670 //Remove this code once SLM_Sessionization is supported
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -0700671 //BMPS_WORKAROUND_NOT_NEEDED
Jeff Johnsone7245742012-09-05 17:12:55 -0700672 tANI_BOOLEAN doBMPSWorkaround;
Jeff Johnson295189b2012-06-20 16:38:30 -0700673
674 //To enable/disable scanning 2.4Ghz channels twice on a single scan request from HDD
675 tANI_BOOLEAN fScanTwice;
Jeff Johnsone7245742012-09-05 17:12:55 -0700676#ifdef WLAN_FEATURE_11AC
677 tANI_U32 nVhtChannelWidth;
Shailender Karmuchi08f87c22013-01-17 12:51:24 -0800678 tANI_U8 txBFEnable;
Shailender Karmuchicc3fe442013-02-16 18:18:33 -0800679 tANI_U8 txBFCsnValue;
Ravi Joshi83bfaa12013-05-28 22:12:08 -0700680 tANI_BOOLEAN enableVhtFor24GHz;
Abhishek Singh6d5d29c2014-07-03 14:25:22 +0530681 tANI_U8 txMuBformee;
Jeff Johnsone7245742012-09-05 17:12:55 -0700682#endif
Gopichand Nakkalab2d2c312013-01-04 11:41:02 -0800683 tANI_U8 txLdpcEnable;
Jeff Johnson295189b2012-06-20 16:38:30 -0700684
Ravi Joshid2ca7c42013-07-23 08:37:49 -0700685 /*
686 * Enable/Disable heartbeat offload
687 */
688 tANI_BOOLEAN enableHeartBeatOffload;
krunal soni5afa96c2013-09-06 22:19:02 -0700689 tANI_U8 isAmsduSupportInAMPDU;
Srinivas Girigowda41c7c5f2013-10-21 19:01:38 -0700690 tANI_U8 nSelect5GHzMargin;
krunal sonie9002db2013-11-25 14:24:17 -0800691 tANI_U8 isCoalesingInIBSSAllowed;
Sandeep Puligillac80f26e2014-03-11 18:36:10 +0530692 tANI_U8 allowDFSChannelRoam;
c_hpothu0d5a7352014-03-22 12:30:25 +0530693 tANI_BOOLEAN initialScanSkipDFSCh;
Abhishek Singhc98534e2015-06-12 10:44:34 +0530694 tANI_BOOLEAN ignorePeerErpInfo;
Abhishek Singhde51a412014-05-20 19:17:26 +0530695 tANI_BOOLEAN sendDeauthBeforeCon;
Hardik Kantilal Pateldd107952014-11-20 15:24:52 +0530696#ifdef WLAN_FEATURE_AP_HT40_24G
697 tANI_BOOLEAN apHT40_24GEnabled;
698 tANI_U32 channelBondingAPMode24GHz; // Use for SAP/P2P GO 2.4GHz channel Bonding
699#endif
Sushant Kaushikc9682be2014-11-26 12:27:04 +0530700 tANI_U32 nOBSSScanWidthTriggerInterval;
Girish Gowli1c2fc802015-01-19 16:18:07 +0530701 tANI_U8 roamDelayStatsEnabled;
Sushant Kaushikae17dd62015-08-27 17:07:04 +0530702 tANI_BOOLEAN ignorePeerHTopMode;
Abhishek Singh795e1b82015-09-25 15:35:03 +0530703 tANI_BOOLEAN disableP2PMacSpoofing;
Abhishek Singh837adf22015-10-01 17:37:37 +0530704 tANI_BOOLEAN enableFatalEvent;
Gupta, Kapil01be56b2015-12-30 20:36:33 +0530705 tANI_U8 max_chan_for_dwell_time_cfg;
Abhishek Singh48cd3402016-03-30 15:20:19 +0530706 uint32_t enable_edca_params;
707 uint32_t edca_vo_cwmin;
708 uint32_t edca_vi_cwmin;
709 uint32_t edca_bk_cwmin;
710 uint32_t edca_be_cwmin;
711 uint32_t edca_vo_cwmax;
712 uint32_t edca_vi_cwmax;
713 uint32_t edca_bk_cwmax;
714 uint32_t edca_be_cwmax;
715 uint32_t edca_vo_aifs;
716 uint32_t edca_vi_aifs;
717 uint32_t edca_bk_aifs;
718 uint32_t edca_be_aifs;
Yeshwanth Sriram Guntuka8d9b29c2017-12-12 15:44:57 +0530719 tANI_U8 agg_btc_sco_oui[3];
720 tANI_BOOLEAN agg_btc_sco_enabled;
721 tANI_U8 num_ba_buff_btc_sco;
722 tANI_U8 num_ba_buff;
Jeff Johnson295189b2012-06-20 16:38:30 -0700723}tCsrConfig;
724
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800725typedef struct tagCsrChannelPowerInfo
Jeff Johnson295189b2012-06-20 16:38:30 -0700726{
727 tListElem link;
728 tANI_U8 firstChannel;
729 tANI_U8 numChannels;
730 tANI_U8 txPower;
731 tANI_U8 interChannelOffset;
732}tCsrChannelPowerInfo;
733
734typedef struct tagRoamJoinStatus
735{
736 tSirResultCodes statusCode;
737 //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 -0800738 tANI_U32 reasonCode;
Kiran Kumar Lokerec8550fa2013-04-15 22:23:00 -0700739 tSirMacAddr bssId;
Jeff Johnson295189b2012-06-20 16:38:30 -0700740}tCsrRoamJoinStatus;
741
742typedef struct tagCsrOsChannelMask
743{
744 tANI_U8 numChannels;
745 tANI_BOOLEAN scanEnabled[WNI_CFG_VALID_CHANNEL_LIST_LEN];
746 tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
747}tCsrOsChannelMask;
748
Agrawal Ashish0b6984f2014-04-05 18:35:45 +0530749typedef struct tagCsrVotes11d
750{
751 tANI_U8 votes;
752 tANI_U8 countryCode[WNI_CFG_COUNTRY_CODE_LEN];
753}tCsrVotes11d;
Jeff Johnson295189b2012-06-20 16:38:30 -0700754
Padma, Santhosh Kumar36183352016-11-08 17:48:34 +0530755struct csr_disable_scan_during_sco_timer_info
756{
757 struct net_device *dev;
758 tANI_U32 scan_id;
759 csrScanCompleteCallback callback;
760};
761
Jeff Johnson295189b2012-06-20 16:38:30 -0700762typedef struct tagCsrScanStruct
763{
764 tScanProfile scanProfile;
765 tANI_U32 nextScanID;
Madan Mohan Koyyalamudica43cdf2012-09-24 13:15:49 -0700766 tDblLinkList scanResultList;
Jeff Johnson295189b2012-06-20 16:38:30 -0700767 tDblLinkList tempScanResults;
768 tANI_BOOLEAN fScanEnable;
769 tANI_BOOLEAN fFullScanIssued;
Madan Mohan Koyyalamudia48c6812013-07-11 12:01:37 +0530770 vos_timer_t hTimerGetResult;
Padma, Santhosh Kumar36183352016-11-08 17:48:34 +0530771 vos_timer_t disable_scan_during_sco_timer;
772 struct csr_disable_scan_during_sco_timer_info
773 disable_scan_during_sco_timer_info;
774 tANI_BOOLEAN disable_scan_during_sco;
Jeff Johnson295189b2012-06-20 16:38:30 -0700775#ifdef WLAN_AP_STA_CONCURRENCY
Madan Mohan Koyyalamudia48c6812013-07-11 12:01:37 +0530776 vos_timer_t hTimerStaApConcTimer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700777#endif
Madan Mohan Koyyalamudia48c6812013-07-11 12:01:37 +0530778 vos_timer_t hTimerIdleScan;
Jeff Johnson295189b2012-06-20 16:38:30 -0700779 tPalTimerHandle hTimerBgScan;
780 //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 -0800781 tANI_U8 channelOf11dInfo;
782 tANI_U8 scanResultCfgAgingTime;
Jeff Johnson295189b2012-06-20 16:38:30 -0700783 //changes on every scan, a flag to tell whether conflict 11d info found on each BSS
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800784 tANI_BOOLEAN fAmbiguous11dInfoFound;
Jeff Johnson295189b2012-06-20 16:38:30 -0700785 //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 -0800786 tANI_BOOLEAN fCurrent11dInfoMatch;
Jeff Johnson295189b2012-06-20 16:38:30 -0700787 tANI_BOOLEAN f11dInfoReset; //to indicate whether the 11d info in CFG is reset to default
788 tSirScanType curScanType;
789 tCsrChannel baseChannels; //This are all the supported channels AND(&) to the current eBand
790 tCsrChannel channels11d;
791 tChannelListWithPower defaultPowerTable[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
792 tChannelListWithPower defaultPowerTable40MHz[WNI_CFG_VALID_CHANNEL_LIST_LEN]; //From NV
793 tANI_U32 numChannelsDefault; //total channels of NV
794 tCsrChannel base20MHzChannels; //The channel base to work on
795 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
796 tDblLinkList channelPowerInfoList24;
797 tDblLinkList channelPowerInfoList5G;
798 tANI_U32 nLastAgeTimeOut;
799 tANI_U32 nAgingCountDown;
Gopichand Nakkala114718f2013-03-25 19:19:46 -0700800 tANI_U8 countryCodeDefault[WNI_CFG_COUNTRY_CODE_LEN]; //The country code from NV
801 tANI_U8 countryCodeCurrent[WNI_CFG_COUNTRY_CODE_LEN];
802 tANI_U8 countryCode11d[WNI_CFG_COUNTRY_CODE_LEN];
Jeff Johnson295189b2012-06-20 16:38:30 -0700803 v_REGDOMAIN_t domainIdDefault; //default regulatory domain
804 v_REGDOMAIN_t domainIdCurrent; //current regulatory domain
Agarwal Ashishd9d72602013-09-13 00:06:17 +0530805 tCsrBssid currentCountryBssid; // Bssid for current country code
Mihir Shetebc866f62014-02-13 16:08:53 +0530806 tANI_S8 currentCountryRSSI; // RSSI for current country code
Jeff Johnson295189b2012-06-20 16:38:30 -0700807 tANI_BOOLEAN f11dInfoApplied;
808 tANI_BOOLEAN fCancelIdleScan;
Agrawal Ashish0b6984f2014-04-05 18:35:45 +0530809 tANI_U8 countryCodeCount;
810 tCsrVotes11d votes11d[CSR_MAX_NUM_COUNTRY_CODE]; //counts for various advertized country codes
811 //in 11d IE from probe rsp or beacons of neighboring APs;
812 //will use the most popular one (max count)
813 tANI_U8 countryCodeElected[WNI_CFG_COUNTRY_CODE_LEN];
814
815
Jeff Johnson295189b2012-06-20 16:38:30 -0700816#ifdef FEATURE_WLAN_WAPI
817// tANI_U16 NumBkidCandidate;
818// tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED]; /* Move this as part of SessionEntry */
819#endif /* FEATURE_WLAN_WAPI */
820 tANI_U8 numBGScanChannel; //number of valid channels in the bgScanChannelList
821 tANI_U8 bgScanChannelList[WNI_CFG_BG_SCAN_CHANNEL_LIST_LEN];
822 //the ChannelInfo member is not used in this structure.
823 //numBGScanChannel and bgScanChannelList are used for the BG scan channel info
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800824 tCsrBGScanRequest bgScanParams;
Jeff Johnson295189b2012-06-20 16:38:30 -0700825 tANI_BOOLEAN fRestartIdleScan;
826 tANI_U32 nIdleScanTimeGap; //the time since last trying to trigger idle scan
827 tCsrOsChannelMask osScanChannelMask;//keep a track of channels to be scnned while in traffic condition
828 tANI_U16 nBssLimit; //the maximum number of BSS in scan cache
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800829 /*channelPowerInfoList24 has been seen corrupted. Set this flag to true trying to
Jeff Johnson295189b2012-06-20 16:38:30 -0700830 * detect when it happens. Adding this into code because we can't reproduce it easily.
831 * We don't know when it happens. */
832 tANI_BOOLEAN fValidateList;
833 /*Customer wants to start with an active scan based on the default country code.
834 * This optimization will minimize the driver load to association time.
835 * Based on this flag we will bypass the initial passive scan needed for 11d
836 * to determine the country code & domain */
837 tANI_BOOLEAN fEnableBypass11d;
838
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800839 /*Customer wants to optimize the scan time. Avoiding scans(passive) on DFS
840 * channels while swipping through both bands can save some time
Jeff Johnson295189b2012-06-20 16:38:30 -0700841 * (apprx 1.3 sec) */
Padma, Santhosh Kumar814d0992015-05-05 18:52:43 +0530842 tANI_U8 fEnableDFSChnlScan;
Jeff Johnson295189b2012-06-20 16:38:30 -0700843
Jeff Johnsone7245742012-09-05 17:12:55 -0700844 /*
845 * To enable/disable scanning only 2.4Ghz channels on first scan
846 */
847 tANI_BOOLEAN fFirstScanOnly2GChnl;
848
Jeff Johnson295189b2012-06-20 16:38:30 -0700849 tANI_BOOLEAN fDropScanCmd; //true means we don't accept scan commands
850
851#ifdef WLAN_AP_STA_CONCURRENCY
852 tDblLinkList scanCmdPendingList;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800853#endif
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -0700854 tCsrChannel occupiedChannels; //This includes all channels on which candidate APs are found
Srinivas Girigowda41c7c5f2013-10-21 19:01:38 -0700855 tANI_S8 inScanResultBestAPRssi;
Mihir Shetefc7ff5b2014-01-27 11:30:05 +0530856
857 csrScanCompleteCallback callback11dScanDone;
Peng Xu2446a892014-09-05 17:21:18 +0530858 eCsrBand scanBandPreference; //This defines the band perference for scan
Agarwal Ashish8bd53ae2015-06-12 18:03:45 +0530859 bool fcc_constraint;
Agrawal Ashish842eea82016-02-04 17:56:16 +0530860 /* flag to defer updated chanel list */
861 bool defer_update_channel_list;
Jeff Johnson295189b2012-06-20 16:38:30 -0700862}tCsrScanStruct;
863
864
865//Save the connected information. This structure + connectedProfile
866//should contain all information about the connection
867typedef struct tagRoamCsrConnectedInfo
868{
869 tANI_U32 nBeaconLength; //the length, in bytes, of the beacon frame, can be 0
870 tANI_U32 nAssocReqLength; //the length, in bytes, of the assoc req frame, can be 0
871 tANI_U32 nAssocRspLength; //The length, in bytes, of the assoc rsp frame, can be 0
872#ifdef WLAN_FEATURE_VOWIFI_11R
873 tANI_U32 nRICRspLength; //Length of the parsed RIC response IEs received in reassoc response
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800874#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800875#ifdef FEATURE_WLAN_ESE
Jeff Johnson295189b2012-06-20 16:38:30 -0700876 tANI_U32 nTspecIeLength;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800877#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700878 tANI_U8 *pbFrames; //Point to a buffer contain the beacon, assoc req, assoc rsp frame, in that order
879 //user needs to use nBeaconLength, nAssocReqLength, nAssocRspLength to desice where
880 //each frame starts and ends.
881 tANI_U8 staId;
882}tCsrRoamConnectedInfo;
883
884
885typedef struct tagCsrLinkQualityIndInfo
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800886{
Jeff Johnson295189b2012-06-20 16:38:30 -0700887 csrRoamLinkQualityIndCallback callback;
888 void *context;
889}tCsrLinkQualityIndInfo;
890
891typedef struct tagCsrPeStatsReqInfo
892{
893 tListElem link; /* list links */
894 tANI_U32 statsMask;
895 tANI_U32 periodicity;
896 tANI_BOOLEAN rspPending;
897 vos_timer_t hPeStatsTimer;
898 tANI_BOOLEAN timerRunning;
899 tANI_U8 staId;
900 tANI_U8 numClient;
901 tpAniSirGlobal pMac;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800902 /* To remember if the peStats timer is stopped successfully or not */
Jeff Johnson295189b2012-06-20 16:38:30 -0700903 tANI_BOOLEAN timerStopFailed;
904
905}tCsrPeStatsReqInfo;
906
907typedef struct tagCsrStatsClientReqInfo
908{
909 tListElem link; /* list links */
910 eCsrStatsRequesterType requesterId;
911 tCsrStatsCallback callback;
912 tANI_U32 periodicity;
913 void *pContext;
914 tANI_U32 statsMask;
915 tCsrPeStatsReqInfo *pPeStaEntry;
916 tANI_U8 staId;
917 vos_timer_t timer;
918 tANI_BOOLEAN timerExpired;
919 tpAniSirGlobal pMac; // TODO: Confirm this change BTAMP
920}tCsrStatsClientReqInfo;
921
922typedef struct tagCsrTlStatsReqInfo
923{
924 tANI_U32 periodicity;
925 tANI_BOOLEAN timerRunning;
Madan Mohan Koyyalamudia48c6812013-07-11 12:01:37 +0530926 vos_timer_t hTlStatsTimer;
Jeff Johnson295189b2012-06-20 16:38:30 -0700927 tANI_U8 numClient;
928}tCsrTlStatsReqInfo;
929
930typedef struct tagCsrRoamSession
931{
932 tANI_U8 sessionId; // Session ID
933 tANI_BOOLEAN sessionActive; // TRUE if it is used
934 tCsrBssid selfMacAddr; // For BT-AMP station, this serve as BSSID for self-BSS.
935 csrRoamCompleteCallback callback;
936 void *pContext;
937 eCsrConnectState connectState;
938 tCsrRoamConnectedProfile connectedProfile;
939 tCsrRoamConnectedInfo connectedInfo;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800940 tCsrRoamProfile *pCurRoamProfile;
Jeff Johnson295189b2012-06-20 16:38:30 -0700941 tSirBssDescription *pConnectBssDesc;
Kanchanapally, Vidyullatha0c611b02014-11-26 21:30:05 +0530942 tANI_U16 NumPmkidCache; /* valid no. of pmkid in the cache */
943 tANI_U16 CurCacheIndex; /* the index in pmkidcache to write next to */
Jeff Johnson295189b2012-06-20 16:38:30 -0700944 tPmkidCacheInfo PmkidCacheInfo[CSR_MAX_PMKID_ALLOWED];
945 tANI_U8 cJoinAttemps;
946 //This may or may not have the up-to-date valid channel list
947 //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
948 tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
949 tANI_S32 sPendingCommands; //0 means CSR is ok to low power
950#ifdef FEATURE_WLAN_WAPI
951 tANI_U16 NumBkidCache;
952 tBkidCacheInfo BkidCacheInfo[CSR_MAX_BKID_ALLOWED];
953#endif /* FEATURE_WLAN_WAPI */
954 tANI_BOOLEAN fRoaming; //indicate whether CSR is roaming (either via lostlink or dynamic roaming)
955 //to remember some parameters needed for START_BSS.
956 //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 -0800957 tCsrRoamStartBssParams bssParams;
Jeff Johnson295189b2012-06-20 16:38:30 -0700958 tANI_U32 nWpaRsnReqIeLength; //the byte count of pWpaRsnIE;
959 tANI_U8 *pWpaRsnReqIE; //this contain the WPA/RSN IE in assoc request or the one sent in beacon (IBSS)
960 tANI_U32 nWpaRsnRspIeLength; //the byte count for pWpaRsnRspIE
961 tANI_U8 *pWpaRsnRspIE; //this contain the WPA/RSN IE in beacon/probe rsp
962#ifdef FEATURE_WLAN_WAPI
963 tANI_U32 nWapiReqIeLength; //the byte count of pWapiReqIE;
964 tANI_U8 *pWapiReqIE; //this contain the WAPI IE in assoc request or the one sent in beacon (IBSS)
965 tANI_U32 nWapiRspIeLength; //the byte count for pWapiRspIE
966 tANI_U8 *pWapiRspIE; //this contain the WAPI IE in beacon/probe rsp
967#endif /* FEATURE_WLAN_WAPI */
Agarwal Ashish4f616132013-12-30 23:32:50 +0530968 tANI_U32 nAddIEScanLength; //length of addIeScan
969 /* This contains the additional IE in (unicast)
970 * probe request at the time of join
971 */
Ganesh Kondabattini7500fb32015-04-10 14:50:32 +0530972 tANI_U8 addIEScan[SIR_MAC_MAX_ADD_IE_LENGTH+2];
Jeff Johnson295189b2012-06-20 16:38:30 -0700973 tANI_U32 nAddIEAssocLength; //the byte count for pAddIeAssocIE
974 tANI_U8 *pAddIEAssoc; //this contains the additional IE in (re) assoc request
975
976 tANI_TIMESTAMP roamingStartTime; //in units of 10ms
977 tCsrTimerInfo roamingTimerInfo;
978 eCsrRoamingReason roamingReason;
979 tANI_BOOLEAN fCancelRoaming;
Madan Mohan Koyyalamudia48c6812013-07-11 12:01:37 +0530980 vos_timer_t hTimerRoaming;
Jeff Johnson295189b2012-06-20 16:38:30 -0700981 eCsrRoamResult roamResult; //the roamResult that is used when the roaming timer fires
982 tCsrRoamJoinStatus joinFailStatusCode; //This is the reason code for join(assoc) failure
983 //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 -0800984 tANI_U32 roamingStatusCode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700985 tANI_U16 NumPmkidCandidate;
986 tPmkidCandidateInfo PmkidCandidateInfo[CSR_MAX_PMKID_ALLOWED];
987 #ifdef FEATURE_WLAN_WAPI
988 tANI_U16 NumBkidCandidate;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -0800989 tBkidCandidateInfo BkidCandidateInfo[CSR_MAX_BKID_ALLOWED];
Jeff Johnson295189b2012-06-20 16:38:30 -0700990#endif
991 tANI_BOOLEAN fWMMConnection;
Sandeep Puligillaaea98a22013-12-04 13:36:32 +0530992 tANI_BOOLEAN fQOSConnection;
993
Jeff Johnson295189b2012-06-20 16:38:30 -0700994#ifdef FEATURE_WLAN_BTAMP_UT_RF
995 //To retry a join later when it fails if so desired
Madan Mohan Koyyalamudia48c6812013-07-11 12:01:37 +0530996 vos_timer_t hTimerJoinRetry;
Jeff Johnson295189b2012-06-20 16:38:30 -0700997 tCsrTimerInfo joinRetryTimerInfo;
998 tANI_U32 maxRetryCount;
999#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001000#ifdef FEATURE_WLAN_ESE
1001 tCsrEseCckmInfo eseCckmInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -07001002 tANI_BOOLEAN isPrevApInfoValid;
1003 tSirMacSSid prevApSSID;
1004 tCsrBssid prevApBssid;
1005 tANI_U8 prevOpChannel;
1006 tANI_U16 clientDissSecs;
1007 tANI_U32 roamTS1;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001008#if defined(FEATURE_WLAN_ESE_UPLOAD)
1009 tCsrEseCckmIe suppCckmIeInfo;
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001010#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001011#endif
1012 tANI_U8 bRefAssocStartCnt; //Tracking assoc start indication
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001013 /* to force the AP initiate fresh 802.1x authentication after re-association need to clear
Madan Mohan Koyyalamudiea22cdc2012-10-18 21:02:23 -07001014 * the PMKID cache. To clear the cache in this particular case this is added
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001015 * it is needed by the HS 2.0 passpoint certification 5.2.a and b testcases */
Madan Mohan Koyyalamudiea22cdc2012-10-18 21:02:23 -07001016 tANI_BOOLEAN fIgnorePMKIDCache;
Sushant Kaushikb4834d22015-07-15 15:29:05 +05301017 tANI_BOOLEAN abortConnection;
Abhishek Singhe0bc0992016-05-20 17:58:18 +05301018 bool dhcp_done;
Abhishek Singh78c691f2017-11-30 13:48:44 +05301019 v_TIME_t connect_req_start_time;
Jeff Johnson295189b2012-06-20 16:38:30 -07001020} tCsrRoamSession;
1021
1022typedef struct tagCsrRoamStruct
1023{
1024 tANI_U32 nextRoamId;
1025 tDblLinkList roamCmdPendingList;
1026 tDblLinkList channelList5G;
1027 tDblLinkList channelList24;
1028 tCsrConfig configParam;
1029 tANI_U32 numChannelsEeprom; //total channels of eeprom
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001030 tCsrChannel base20MHzChannels; //The channel base to work on
1031 tCsrChannel base40MHzChannels; //center channels for 40MHz channels
1032 eCsrRoamState curState[CSR_ROAM_SESSION_MAX];
Jeff Johnson295189b2012-06-20 16:38:30 -07001033 eCsrRoamSubState curSubState[CSR_ROAM_SESSION_MAX];
Abhishek Singh7f345c42016-08-24 11:15:23 +05301034 eCsrRoamState prev_state[CSR_ROAM_SESSION_MAX];
Jeff Johnson295189b2012-06-20 16:38:30 -07001035 //This may or may not have the up-to-date valid channel list
1036 //It is used to get WNI_CFG_VALID_CHANNEL_LIST and not allocate memory all the time
1037 tSirMacChanNum validChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
1038 tANI_U32 numValidChannels; //total number of channels in CFG
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001039
Jeff Johnson295189b2012-06-20 16:38:30 -07001040 tANI_S32 sPendingCommands;
Madan Mohan Koyyalamudia48c6812013-07-11 12:01:37 +05301041 vos_timer_t hTimerWaitForKey; //To support timeout for WaitForKey state
Jeff Johnson295189b2012-06-20 16:38:30 -07001042 tCsrSummaryStatsInfo summaryStatsInfo;
1043 tCsrGlobalClassAStatsInfo classAStatsInfo;
1044 tCsrGlobalClassBStatsInfo classBStatsInfo;
1045 tCsrGlobalClassCStatsInfo classCStatsInfo;
1046 tCsrGlobalClassDStatsInfo classDStatsInfo;
1047 tCsrPerStaStatsInfo perStaStatsInfo[CSR_MAX_STA];
Sushant Kaushik33200572015-08-05 16:46:20 +05301048 tPerTxPacketFrmFw perPktStatsInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -07001049 tDblLinkList statsClientReqList;
1050 tDblLinkList peStatsReqList;
1051 tCsrTlStatsReqInfo tlStatsReqInfo;
1052 eCsrRoamLinkQualityInd vccLinkQuality;
1053 tCsrLinkQualityIndInfo linkQualityIndInfo;
1054 v_CONTEXT_t gVosContext; //used for interaction with TL
1055 //To specify whether an association or a IBSS is WMM enabled
1056 //This parameter is only valid during a join or start BSS command is being executed
1057 //tANI_BOOLEAN fWMMConnection; /* Moving it to be part of roamsession */
1058 v_U8_t ucACWeights[WLANTL_MAX_AC];
1059 /* TODO : Upto here */
1060 tCsrTimerInfo WaitForKeyTimerInfo;
1061 tCsrRoamSession *roamSession;
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001062 tANI_U32 transactionId; // Current transaction ID for internal use.
1063#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
Jeff Johnson295189b2012-06-20 16:38:30 -07001064 tCsrNeighborRoamControlInfo neighborRoamInfo;
1065#endif
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001066#ifdef FEATURE_WLAN_LFR
1067 tANI_U8 isFastRoamIniFeatureEnabled;
1068#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001069#ifdef FEATURE_WLAN_ESE
1070 tANI_U8 isEseIniFeatureEnabled;
Jeff Johnson295189b2012-06-20 16:38:30 -07001071#endif
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001072#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR)
Srinivas Girigowda100eb322013-03-15 16:48:20 -07001073 tANI_U8 RoamRssiDiff;
Srinivas Girigowdaad34ca92013-10-22 10:54:29 -07001074 tANI_BOOLEAN isWESModeEnabled;
Jeff Johnson43971f52012-07-17 12:26:56 -07001075#endif
Leela Venkata Kiran Kumar Reddy Chirala56df73f2014-01-30 14:18:00 -08001076 tANI_U32 deauthRspStatus;
Padma, Santhosh Kumardccd6232017-05-10 16:18:00 +05301077 tANI_BOOLEAN pending_roam_disable;
Padma, Santhosh Kumar9d35c462017-11-23 18:21:14 +05301078 vos_spin_lock_t roam_state_lock;
Yeshwanth Sriram Guntukaa1184ff2019-09-19 15:04:10 +05301079 tSirMacAddr spoof_mac_addr;
Jeff Johnson295189b2012-06-20 16:38:30 -07001080}tCsrRoamStruct;
1081
1082
1083#define GET_NEXT_ROAM_ID(pRoamStruct) (((pRoamStruct)->nextRoamId + 1 == 0) ? 1 : (pRoamStruct)->nextRoamId)
1084#define CSR_IS_ROAM_STATE(pMac, state, sessionId) ( (state) == (pMac)->roam.curState[sessionId] )
1085
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001086#define CSR_IS_ROAM_STOP(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_STOP, sessionId )
1087#define CSR_IS_ROAM_INIT(pMac, sessionId) CSR_IS_ROAM_STATE( (pMac), eCSR_ROAMING_STATE_INIT, sessionId )
Jeff Johnson295189b2012-06-20 16:38:30 -07001088#define CSR_IS_ROAM_SCANNING(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_SCANNING, sessionId )
1089#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 -08001090#define CSR_IS_ROAM_IDLE(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_IDLE, sessionId )
Jeff Johnson295189b2012-06-20 16:38:30 -07001091#define CSR_IS_ROAM_JOINED(pMac, sessionId) CSR_IS_ROAM_STATE( pMac, eCSR_ROAMING_STATE_JOINED, sessionId )
1092
1093#define CSR_IS_ROAM_SUBSTATE(pMac, subState, sessionId) ((subState) == (pMac)->roam.curSubState[sessionId])
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001094#define CSR_IS_ROAM_SUBSTATE_JOIN_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOIN_REQ, sessionId)
1095#define CSR_IS_ROAM_SUBSTATE_AUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_AUTH_REQ, sessionId)
1096#define CSR_IS_ROAM_SUBSTATE_REASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_REASSOC_REQ, sessionId)
1097#define CSR_IS_ROAM_SUBSTATE_DISASSOC_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REQ, sessionId)
1098#define CSR_IS_ROAM_SUBSTATE_DISASSOC_NO_JOIN(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_NOTHING_TO_JOIN, sessionId)
1099#define CSR_IS_ROAM_SUBSTATE_REASSOC_FAIL(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_REASSOC_FAILURE, sessionId)
1100#define CSR_IS_ROAM_SUBSTATE_DISASSOC_FORCED(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_FORCED, sessionId)
1101#define CSR_IS_ROAM_SUBSTATE_DEAUTH_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DEAUTH_REQ, sessionId)
1102#define CSR_IS_ROAM_SUBSTATE_START_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_START_BSS_REQ, sessionId)
1103#define CSR_IS_ROAM_SUBSTATE_STOP_BSS_REQ(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_STOP_BSS_REQ, sessionId)
1104#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 -07001105#define CSR_IS_ROAM_SUBSTATE_CONFIG(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_CONFIG, sessionId)
1106#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 -08001107#define CSR_IS_ROAM_SUBSTATE_DISASSOC_HO(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF, sessionId)
1108#define CSR_IS_ROAM_SUBSTATE_HO_NT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NO_TRAFFIC, sessionId)
1109#define CSR_IS_ROAM_SUBSTATE_HO_NRT(pMac, sessionId) CSR_IS_ROAM_SUBSTATE((pMac), eCSR_ROAM_SUBSTATE_JOINED_NON_REALTIME_TRAFFIC, sessionId)
1110#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 -07001111
1112#define CSR_IS_PHY_MODE_B_ONLY(pMac) \
1113 ((eCSR_DOT11_MODE_11b == (pMac)->roam.configParam.phyMode) ||\
1114 (eCSR_DOT11_MODE_11b_ONLY == (pMac)->roam.configParam.phyMode))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001115
Jeff Johnson295189b2012-06-20 16:38:30 -07001116#define CSR_IS_PHY_MODE_G_ONLY(pMac) \
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001117 (eCSR_DOT11_MODE_11g == (pMac)->roam.configParam.phyMode || eCSR_DOT11_MODE_11g_ONLY == (pMac)->roam.configParam.phyMode)
1118
Jeff Johnson295189b2012-06-20 16:38:30 -07001119#define CSR_IS_PHY_MODE_A_ONLY(pMac) \
1120 ((eCSR_DOT11_MODE_11a == (pMac)->roam.configParam.phyMode) ||\
1121 (eCSR_DOT11_MODE_11a_ONLY == (pMac)->roam.configParam.phyMode))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001122
Jeff Johnsone7245742012-09-05 17:12:55 -07001123#ifdef WLAN_FEATURE_11AC
1124#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
1125 ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
1126 (eCSR_DOT11_MODE_11ac & (phyMode)) || \
1127 (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
1128 (eCSR_DOT11_MODE_AUTO & (phyMode)))
1129#else
Jeff Johnson295189b2012-06-20 16:38:30 -07001130#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
1131 ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
1132 (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
1133 (eCSR_DOT11_MODE_AUTO & (phyMode)))
Jeff Johnsone7245742012-09-05 17:12:55 -07001134#endif
1135
Jeff Johnson295189b2012-06-20 16:38:30 -07001136
1137// this function returns TRUE if the NIC is operating exclusively in the 2.4 GHz band, meaning
1138// it is NOT operating in the 5.0 GHz band.
1139#define CSR_IS_24_BAND_ONLY(pMac) \
1140 (eCSR_BAND_24 == (pMac)->roam.configParam.eBand)
1141
1142#define CSR_IS_5G_BAND_ONLY(pMac) \
1143 (eCSR_BAND_5G == (pMac)->roam.configParam.eBand)
1144
1145#define CSR_IS_RADIO_DUAL_BAND(pMac) \
1146 (eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability)
1147
1148#define CSR_IS_RADIO_BG_ONLY(pMac) \
1149 (eCSR_BAND_24 == (pMac)->roam.configParam.bandCapability)
1150
1151// this function returns TRUE if the NIC is operating exclusively in the 5.0 GHz band, meaning
1152// it is NOT operating in the 2.4 GHz band
1153#define CSR_IS_RADIO_A_ONLY(pMac) \
1154 (eCSR_BAND_5G == (pMac)->roam.configParam.bandCapability)
1155
1156// this function returns TRUE if the NIC is operating in both bands.
1157#define CSR_IS_OPEARTING_DUAL_BAND(pMac) \
1158 ((eCSR_BAND_ALL == (pMac)->roam.configParam.bandCapability) && (eCSR_BAND_ALL == (pMac)->roam.configParam.eBand))
1159
1160// this function returns TRUE if the NIC can operate in the 5.0 GHz band (could operate in the
1161// 2.4 GHz band also).
1162#define CSR_IS_OPERATING_A_BAND(pMac) \
1163 (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_A_ONLY((pMac)) || CSR_IS_5G_BAND_ONLY((pMac)))
1164
1165// this function returns TRUE if the NIC can operate in the 2.4 GHz band (could operate in the
1166// 5.0 GHz band also).
1167#define CSR_IS_OPERATING_BG_BAND(pMac) \
1168 (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_BG_ONLY((pMac)) || CSR_IS_24_BAND_ONLY((pMac)))
1169
1170#define CSR_IS_CHANNEL_5GHZ(chnNum) \
Jeff Johnsone7245742012-09-05 17:12:55 -07001171 (((chnNum) >= CSR_MIN_5GHz_CHANNEL_NUMBER) && ((chnNum) <= CSR_MAX_5GHz_CHANNEL_NUMBER))
Jeff Johnson295189b2012-06-20 16:38:30 -07001172
Srinivas Girigowdade697412013-02-14 16:31:48 -08001173#define CSR_IS_CHANNEL_DFS(chnNum) \
1174 (NV_CHANNEL_ENABLE != vos_nv_getChannelEnabledState(chnNum))
1175
Jeff Johnson295189b2012-06-20 16:38:30 -07001176#define CSR_IS_CHANNEL_24GHZ(chnNum) \
1177 (((chnNum) > 0) && ((chnNum) <= CSR_MAX_24GHz_CHANNEL_NUMBER))
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001178
Jeff Johnson295189b2012-06-20 16:38:30 -07001179#define CSR_IS_SAME_BAND_CHANNELS(ch1, ch2) (CSR_IS_CHANNEL_5GHZ(ch1) == CSR_IS_CHANNEL_5GHZ(ch2))
1180
1181
1182#define CSR_IS_11D_INFO_FOUND(pMac) \
1183 (0 != (pMac)->scan.channelOf11dInfo)
1184// DEAUTHIND
1185#define CSR_IS_ROAMING(pSession) ((CSR_IS_LOSTLINK_ROAMING((pSession)->roamingReason)) || \
1186 (eCsrDynamicRoaming == (pSession)->roamingReason) || \
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001187 (eCsrReassocRoaming == (pSession)->roamingReason))
Jeff Johnson295189b2012-06-20 16:38:30 -07001188
1189
1190#define CSR_IS_SET_KEY_COMMAND( pCommand ) ( eSmeCommandSetKey == (pCommand)->command )
1191
1192#define CSR_IS_ADDTS_WHEN_ACMOFF_SUPPORTED(pMac) (pMac->roam.configParam.addTSWhenACMIsOff)
1193// DEAUTHIND
1194#define CSR_IS_LOSTLINK_ROAMING(reason) ((eCsrLostlinkRoamingDisassoc == (reason)) || (eCsrLostlinkRoamingDeauth == (reason)))
1195
Venkata Prathyusha Kuntupalli239278b2013-03-26 15:58:18 -07001196#define CSR_IS_ROAMING_COMMAND(pCommand) ((eCsrLostLink1 == (pCommand)->u.roamCmd.roamReason) ||\
1197 (eCsrLostLink2 == (pCommand)->u.roamCmd.roamReason) ||\
1198 (eCsrLostLink3 == (pCommand)->u.roamCmd.roamReason) )
1199
1200
Jeff Johnson295189b2012-06-20 16:38:30 -07001201//Stop CSR from asking for IMPS, This function doesn't disable IMPS from CSR
1202void csrScanSuspendIMPS( tpAniSirGlobal pMac );
1203//Start CSR from asking for IMPS. This function doesn't trigger CSR to request entering IMPS
1204//because IMPS maybe disabled.
1205void csrScanResumeIMPS( tpAniSirGlobal pMac );
1206
1207eHalStatus csrInitGetChannels(tpAniSirGlobal pMac);
Srinivas, Dasari42bf7702014-02-07 11:29:53 +05301208eHalStatus csrScanFilterResults(tpAniSirGlobal pMac);
Padma, Santhosh Kumar778d8382015-03-04 17:41:22 +05301209eHalStatus csrScanFilterDFSResults(tpAniSirGlobal pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001210
1211eHalStatus csrSetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1212 tCsrRoamModifyProfileFields *pModifyProfileFields);
1213/* ---------------------------------------------------------------------------
1214 \fn csrGetModifyProfileFields
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001215 \brief HDD or SME - QOS calls this function to get the current values of
Jeff Johnson295189b2012-06-20 16:38:30 -07001216 connected profile fields changing which can cause reassoc.
1217 This function must be called after CFG is downloaded and STA is in connected
1218 state.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001219 \param pModifyProfileFields - pointer to the connected profile fields
Jeff Johnson295189b2012-06-20 16:38:30 -07001220 changing which can cause reassoc
1221
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001222 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001223 -------------------------------------------------------------------------------*/
1224eHalStatus csrGetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
1225 tCsrRoamModifyProfileFields * pModifyProfileFields);
1226void csrSetGlobalCfgs( tpAniSirGlobal pMac );
1227void csrSetDefaultDot11Mode( tpAniSirGlobal pMac );
1228void csrScanSetChannelMask(tpAniSirGlobal pMac, tCsrChannelInfo *pChannelInfo);
1229tANI_BOOLEAN csrIsConnStateDisconnected(tpAniSirGlobal pMac, tANI_U32 sessionId);
1230tANI_BOOLEAN csrIsConnStateConnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1231tANI_BOOLEAN csrIsConnStateDisconnectedIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1232tANI_BOOLEAN csrIsConnStateConnectedInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1233tANI_BOOLEAN csrIsConnStateConnected( tpAniSirGlobal pMac, tANI_U32 sessionId );
1234tANI_BOOLEAN csrIsConnStateInfra( tpAniSirGlobal pMac, tANI_U32 sessionId );
1235tANI_BOOLEAN csrIsConnStateIbss( tpAniSirGlobal pMac, tANI_U32 sessionId );
1236tANI_BOOLEAN csrIsConnStateWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1237tANI_BOOLEAN csrIsConnStateConnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1238tANI_BOOLEAN csrIsConnStateDisconnectedWds( tpAniSirGlobal pMac, tANI_U32 sessionId );
1239tANI_BOOLEAN csrIsAnySessionInConnectState( tpAniSirGlobal pMac );
1240tANI_BOOLEAN csrIsAllSessionDisconnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudi48081ef2012-12-04 16:49:55 -08001241tANI_BOOLEAN csrIsStaSessionConnected( tpAniSirGlobal pMac );
Bala Venkatesh5bfddc22019-02-13 14:42:05 +05301242tANI_BOOLEAN csrIsP2pGoSessionConnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudi48081ef2012-12-04 16:49:55 -08001243tANI_BOOLEAN csrIsP2pSessionConnected( tpAniSirGlobal pMac );
Madan Mohan Koyyalamudid3d22592012-09-24 14:01:29 -07001244tANI_BOOLEAN csrIsAnySessionConnected( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001245tANI_BOOLEAN csrIsInfraConnected( tpAniSirGlobal pMac );
1246tANI_BOOLEAN csrIsConcurrentInfraConnected( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001247tANI_BOOLEAN csrIsConcurrentSessionRunning( tpAniSirGlobal pMac );
Jeff Johnsone7245742012-09-05 17:12:55 -07001248tANI_BOOLEAN csrIsInfraApStarted( tpAniSirGlobal pMac );
Jeff Johnson295189b2012-06-20 16:38:30 -07001249tANI_BOOLEAN csrIsIBSSStarted( tpAniSirGlobal pMac );
1250tANI_BOOLEAN csrIsBTAMPStarted( tpAniSirGlobal pMac );
1251tANI_BOOLEAN csrIsBTAMP( tpAniSirGlobal pMac, tANI_U32 sessionId );
1252eHalStatus csrIsBTAMPAllowed( tpAniSirGlobal pMac, tANI_U32 chnId );
Jeff Johnsone7245742012-09-05 17:12:55 -07001253tANI_BOOLEAN csrIsValidMcConcurrentSession(tpAniSirGlobal pMac, tANI_U32 sessionId,
1254 tSirBssDescription *pBssDesc);
Jeff Johnson295189b2012-06-20 16:38:30 -07001255tANI_BOOLEAN csrIsConnStateConnectedInfraAp( tpAniSirGlobal pMac, tANI_U32 sessionId );
Jeff Johnson295189b2012-06-20 16:38:30 -07001256/*----------------------------------------------------------------------------
1257 \fn csrRoamRegisterLinkQualityIndCallback
1258
1259 \brief
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001260 a CSR function to allow HDD to register a callback handler with CSR for
1261 link quality indications.
Jeff Johnson295189b2012-06-20 16:38:30 -07001262
1263 Only one callback may be registered at any time.
1264 In order to deregister the callback, a NULL cback may be provided.
1265
1266 Registration happens in the task context of the caller.
1267
1268 \param callback - Call back being registered
1269 \param pContext - user data
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001270
Jeff Johnson295189b2012-06-20 16:38:30 -07001271 DEPENDENCIES: After CSR open
1272
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001273 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001274-----------------------------------------------------------------------------*/
1275eHalStatus csrRoamRegisterLinkQualityIndCallback(tpAniSirGlobal pMac,
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001276 csrRoamLinkQualityIndCallback callback,
Jeff Johnson295189b2012-06-20 16:38:30 -07001277 void *pContext);
1278/* ---------------------------------------------------------------------------
1279 \fn csrGetStatistics
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001280 \brief csr function that client calls to register a callback to get
1281 different PHY level statistics from CSR.
1282
Jeff Johnson295189b2012-06-20 16:38:30 -07001283 \param requesterId - different client requesting for statistics, HDD, UMA/GAN etc
1284 \param statsMask - The different category/categories of stats requester is looking for
1285 \param callback - SME sends back the requested stats using the callback
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001286 \param periodicity - If requester needs periodic update, 0 means it's an one
Jeff Johnson295189b2012-06-20 16:38:30 -07001287 time request
1288 \param cache - If requester is happy with cached stats
1289 \param staId - The station ID for which the stats is requested for
1290 \param pContext - user context to be passed back along with the callback
1291
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001292 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001293 ---------------------------------------------------------------------------*/
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001294eHalStatus csrGetStatistics(tpAniSirGlobal pMac, eCsrStatsRequesterType requesterId,
1295 tANI_U32 statsMask,
1296 tCsrStatsCallback callback,
1297 tANI_U32 periodicity, tANI_BOOLEAN cache,
Jeff Johnson295189b2012-06-20 16:38:30 -07001298 tANI_U8 staId, void *pContext);
1299
Madan Mohan Koyyalamudi8af9b402013-07-11 14:59:10 +05301300/* ---------------------------------------------------------------------------
1301 \fn csrGetTLSTAState
1302 \helper function to get the TL STA State whenever the function is called.
1303
1304 \param staId - The staID to be passed to the TL
1305 to get the relevant TL STA State
1306 \return the state as tANI_U16
1307 ---------------------------------------------------------------------------*/
1308tANI_U16 csrGetTLSTAState(tpAniSirGlobal pMac, tANI_U8 staId);
Jeff Johnson295189b2012-06-20 16:38:30 -07001309
1310eHalStatus csrGetRssi(tpAniSirGlobal pMac,tCsrRssiCallback callback,tANI_U8 staId,tCsrBssid bssId,void * pContext,void * pVosContext);
Madan Mohan Koyyalamudid9383fd2013-08-13 09:27:30 +05301311
1312/* ---------------------------------------------------------------------------
1313 \fn csrGetSnr
1314 \brief csr function that client calls to register a callback to get
1315 SNR stored in TL
1316
1317 \param callback - SME sends back the requested stats using the callback
1318 \param staId - The station ID for which the stats is requested for
1319 \param bssid - The bssid for the connected session
1320 \param pContext - user context to be passed back along with the callback
1321
1322 \return eHalStatus
1323 ---------------------------------------------------------------------------*/
1324eHalStatus csrGetSnr(tpAniSirGlobal pMac, tCsrSnrCallback callback,
1325 tANI_U8 staId, tCsrBssid bssId, void *pContext);
1326
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001327#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR)
Srinivas Girigowdad34cedb2013-01-25 13:33:11 -08001328eHalStatus csrGetRoamRssi(tpAniSirGlobal pMac,
1329 tCsrRssiCallback callback,
1330 tANI_U8 staId,
1331 tCsrBssid bssId,
1332 void * pContext,
1333 void * pVosContext);
1334#endif
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001335
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001336#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001337eHalStatus csrGetTsmStats(tpAniSirGlobal pMac, tCsrTsmStatsCallback callback, tANI_U8 staId,
1338 tCsrBssid bssId, void *pContext, void* pVosContext,
1339 tANI_U8 tid);
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001340#endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001341
Jeff Johnson295189b2012-06-20 16:38:30 -07001342eHalStatus csrRoamRegisterCallback(tpAniSirGlobal pMac, csrRoamCompleteCallback callback, void *pContext);
1343/* ---------------------------------------------------------------------------
1344 \fn csrGetConfigParam
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001345 \brief HDD calls this function to get the global settings currently maintained by CSR.
Jeff Johnson295189b2012-06-20 16:38:30 -07001346 \param pParam - caller allocated memory
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001347 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001348 -------------------------------------------------------------------------------*/
1349eHalStatus csrGetConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1350
1351/* ---------------------------------------------------------------------------
1352 \fn csrMsgProcessor
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001353 \brief HDD calls this function to change some global settings.
Jeff Johnson295189b2012-06-20 16:38:30 -07001354 caller must set the all fields or call csrGetConfigParam to prefill the fields.
1355 \param pParam - caller allocated memory
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001356 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001357 -------------------------------------------------------------------------------*/
1358eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam);
1359
1360
1361/* ---------------------------------------------------------------------------
1362 \fn csrMsgProcessor
1363 \brief HDD calls this function for the messages that are handled by CSR.
1364 \param pMsgBuf - a pointer to a buffer that maps to various structures base on the message type.
1365 The beginning of the buffer can always map to tSirSmeRsp.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001366 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001367 -------------------------------------------------------------------------------*/
1368eHalStatus csrMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf );
1369
1370/* ---------------------------------------------------------------------------
1371 \fn csrOpen
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001372 \brief This function must be called before any API call to CSR.
1373 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001374 -------------------------------------------------------------------------------*/
1375eHalStatus csrOpen(tpAniSirGlobal pMac);
Mihir Shetee1093ba2014-01-21 20:13:32 +05301376
1377/* ---------------------------------------------------------------------------
1378 \fn csrInitChannels
1379 \brief This function must be called to initialize CSR channel lists
1380 \return eHalStatus
1381 -------------------------------------------------------------------------------*/
1382eHalStatus csrInitChannels(tpAniSirGlobal pMac);
1383
Mihir Shete04206452014-11-20 17:50:58 +05301384#ifdef CONFIG_ENABLE_LINUX_REG
Jeff Johnson295189b2012-06-20 16:38:30 -07001385/* ---------------------------------------------------------------------------
Mahesh A Saptasagar74289d22014-05-14 12:43:37 +05301386 \fn csrInitChannelsForCC
1387 \brief This function must be called to issue reg hint
1388 \return eHalStatus
1389 -------------------------------------------------------------------------------*/
Agarwal Ashish6db9d532014-09-30 18:19:10 +05301390eHalStatus csrInitChannelsForCC(tpAniSirGlobal pMac, driver_load_type init );
Mihir Shete04206452014-11-20 17:50:58 +05301391#endif
Mahesh A Saptasagar74289d22014-05-14 12:43:37 +05301392
1393/* ---------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -07001394 \fn csrClose
1395 \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 -08001396 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001397 -------------------------------------------------------------------------------*/
1398eHalStatus csrClose(tpAniSirGlobal pMac);
1399/* ---------------------------------------------------------------------------
1400 \fn csrStart
1401 \brief To start CSR.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001402 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001403 -------------------------------------------------------------------------------*/
1404eHalStatus csrStart(tpAniSirGlobal pMac);
1405/* ---------------------------------------------------------------------------
1406 \fn csrStop
1407 \brief To stop CSR. CSR still keeps its current setting.
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001408 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001409 -------------------------------------------------------------------------------*/
Kiet Lama72a2322013-11-15 11:18:11 +05301410eHalStatus csrStop(tpAniSirGlobal pMac, tHalStopType stopType);
Jeff Johnson295189b2012-06-20 16:38:30 -07001411/* ---------------------------------------------------------------------------
1412 \fn csrReady
1413 \brief To let CSR is ready to operate
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001414 \return eHalStatus
Jeff Johnson295189b2012-06-20 16:38:30 -07001415 -------------------------------------------------------------------------------*/
1416eHalStatus csrReady(tpAniSirGlobal pMac);
1417
1418#ifdef FEATURE_WLAN_WAPI
1419eHalStatus csrRoamGetBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pNum,
1420 tBkidCacheInfo *pBkidCache);
1421
1422
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001423eHalStatus csrScanGetBKIDCandidateList(tpAniSirGlobal pMac, tANI_U32 sessionId,
Jeff Johnson295189b2012-06-20 16:38:30 -07001424 tBkidCandidateInfo *pBkidList, tANI_U32 *pNumItems );
1425tANI_U32 csrRoamGetNumBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId);
1426eHalStatus csrRoamSetBKIDCache( tpAniSirGlobal pMac, tANI_U32 sessionId, tBkidCacheInfo *pBKIDCache,
1427 tANI_U32 numItems );
1428/* ---------------------------------------------------------------------------
1429 \fn csrRoamGetWapiReqIE
1430 \brief return the WAPI IE CSR passes to PE to JOIN request or START_BSS request
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001431 \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 -07001432 needed or IE length in pBuf.
1433 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1434 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1435 -------------------------------------------------------------------------------*/
1436eHalStatus csrRoamGetWapiReqIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
1437
1438/* ---------------------------------------------------------------------------
1439 \fn csrRoamGetWapiRspIE
1440 \brief return the WAPI IE from the beacon or probe rsp if connected
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001441 \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 -07001442 needed or IE length in pBuf.
1443 \param pBuf - Caller allocated memory that contain the IE field, if any, upon return
1444 \return eHalStatus - when fail, it usually means the buffer allocated is not big enough
1445 -------------------------------------------------------------------------------*/
1446eHalStatus csrRoamGetWapiRspIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf);
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001447tANI_U8 csrConstructWapiIe( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
Jeff Johnson295189b2012-06-20 16:38:30 -07001448 tSirBssDescription *pSirBssDesc, tDot11fBeaconIEs *pIes, tCsrWapiIe *pWapiIe );
1449#endif /* FEATURE_WLAN_WAPI */
1450
Jeff Johnson295189b2012-06-20 16:38:30 -07001451eHalStatus csrRoamUpdateAPWPSIE( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirAPWPSIEs *pAPWPSIES );
1452eHalStatus csrRoamUpdateWPARSNIEs( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirRSNie * pAPSirRSNie);
Jeff Johnson295189b2012-06-20 16:38:30 -07001453void csrSetCfgPrivacy( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, tANI_BOOLEAN fPrivacy );
1454tANI_S8 csrGetInfraSessionId( tpAniSirGlobal pMac );
1455tANI_U8 csrGetInfraOperationChannel( tpAniSirGlobal pMac, tANI_U8 sessionId);
Sushant Kaushik1d732562014-05-21 14:15:37 +05301456tANI_BOOLEAN csrIsSessionClientAndConnected(tpAniSirGlobal pMac, tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -07001457tANI_U8 csrGetConcurrentOperationChannel( tpAniSirGlobal pMac );
1458
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001459eHalStatus csrRoamCopyConnectProfile(tpAniSirGlobal pMac, tANI_U32 sessionId,
Jeff Johnson295189b2012-06-20 16:38:30 -07001460 tCsrRoamConnectedProfile *pProfile);
1461tANI_BOOLEAN csrIsSetKeyAllowed(tpAniSirGlobal pMac, tANI_U32 sessionId);
1462
1463void csrSetOppositeBandChannelInfo( tpAniSirGlobal pMac );
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001464void csrConstructCurrentValidChannelList( tpAniSirGlobal pMac, tDblLinkList *pChannelSetList,
Jeff Johnson295189b2012-06-20 16:38:30 -07001465 tANI_U8 *pChannelList, tANI_U8 bSize, tANI_U8 *pNumChannels );
Manjunathappa Prakash4f1d5a52013-11-11 16:22:19 -08001466
1467#ifdef FEATURE_WLAN_SCAN_PNO
Srikant Kuppa066904f2013-05-07 13:56:02 -07001468eHalStatus csrScanSavePreferredNetworkFound(tpAniSirGlobal pMac,
1469 tSirPrefNetworkFoundInd *pPrefNetworkFoundInd);
Manjunathappa Prakash4f1d5a52013-11-11 16:22:19 -08001470#endif //FEATURE_WLAN_SCAN_PNO
Jeff Johnson295189b2012-06-20 16:38:30 -07001471#endif
1472
1473#ifdef WLAN_FEATURE_VOWIFI_11R
1474//Returns whether the current association is a 11r assoc or not
1475tANI_BOOLEAN csrRoamIs11rAssoc(tpAniSirGlobal pMac);
1476#endif
1477
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -08001478#ifdef FEATURE_WLAN_ESE
1479//Returns whether the current association is a ESE assoc or not
1480tANI_BOOLEAN csrRoamIsESEAssoc(tpAniSirGlobal pMac);
1481tANI_BOOLEAN csrRoamIsEseIniFeatureEnabled(tpAniSirGlobal pMac);
1482tANI_BOOLEAN csrNeighborRoamIsESEAssoc(tpAniSirGlobal pMac);
Jeff Johnson295189b2012-06-20 16:38:30 -07001483#endif
1484
Kiran Kumar Lokere3527f0c2013-02-24 22:21:28 -08001485//Remove this code once SLM_Sessionization is supported
Madan Mohan Koyyalamudi96dd30d2012-10-05 17:24:51 -07001486//BMPS_WORKAROUND_NOT_NEEDED
Jeff Johnson295189b2012-06-20 16:38:30 -07001487void csrDisconnectAllActiveSessions(tpAniSirGlobal pMac);
Mohit Khanna349bc392012-09-11 17:24:52 -07001488
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001489#ifdef FEATURE_WLAN_LFR
1490//Returns whether "Legacy Fast Roaming" is enabled...or not
Madan Mohan Koyyalamudi03aae5f2012-11-28 01:51:22 +05301491tANI_BOOLEAN csrRoamIsFastRoamEnabled(tpAniSirGlobal pMac, tANI_U32 sessionId);
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -07001492#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
1493tANI_BOOLEAN csrRoamIsRoamOffloadScanEnabled(tpAniSirGlobal pMac);
1494#endif
Madan Mohan Koyyalamudi470d2cf2012-09-28 14:43:44 -07001495tANI_BOOLEAN csrIsChannelPresentInList( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel );
1496VOS_STATUS csrAddToChannelListFront( tANI_U8 *pChannelList, int numChannels, tANI_U8 channel );
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -07001497#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
1498eHalStatus csrScanRequestLfrResult(tpAniSirGlobal pMac, tANI_U32 sessionId,
1499 csrScanCompleteCallback callback, void *pContext);
Varun Reddy Yeturucc661d22013-05-20 11:47:10 -07001500eHalStatus csrRoamOffloadScanRspHdlr(tpAniSirGlobal pMac, tANI_U8 reason);
1501eHalStatus csrHandoffRequest(tpAniSirGlobal pMac, tCsrHandoffRequest *pHandoffInfo);
Varun Reddy Yeturud0a3f252013-04-15 21:58:13 -07001502#endif
1503tANI_BOOLEAN csrRoamIsStaMode(tpAniSirGlobal pMac, tANI_U32 sessionId);
Jeff Johnson04dd8a82012-06-29 20:41:40 -07001504#endif
1505
Agarwal Ashish738843c2014-09-25 12:27:56 +05301506void csrDisableDfsChannel(tpAniSirGlobal pMac);
Abhishek Singh00b71972016-01-07 10:51:04 +05301507
1508#ifdef WLAN_FEATURE_RMC
1509eHalStatus csrEnableRMC(tpAniSirGlobal pMac, tANI_U32 sessionId);
1510eHalStatus csrDisableRMC(tpAniSirGlobal pMac, tANI_U32 sessionId);
1511#endif /* WLAN_FEATURE_RMC */
Padma, Santhosh Kumar7cdb5242017-01-11 19:19:08 +05301512
1513eHalStatus csrRoamStopNetwork(tpAniSirGlobal pMac, tANI_U32 sessionId,
1514 tCsrRoamProfile *pProfile, tSirBssDescription *pBssDesc,
1515 tDot11fBeaconIEs *pIes);
1516
1517eHalStatus csrRoamSaveSecurityRspIE(tpAniSirGlobal pMac,
1518 tANI_U32 sessionId, eCsrAuthType authType,
1519 tSirBssDescription *pSirBssDesc,
1520 tDot11fBeaconIEs *pIes);
1521
1522void csrRoamSubstateChange(tpAniSirGlobal pMac,
1523 eCsrRoamSubState NewSubstate, tANI_U32 sessionId);
1524
1525eHalStatus csrRoamFreeConnectedInfo(tpAniSirGlobal pMac,
1526 tCsrRoamConnectedInfo *pConnectedInfo);