blob: be136eeaeb41f7725abf8d155052dd161f7fa718 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +05302 * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -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/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28/**
29 * \file csr_api.h
30 *
31 * Exports and types for the Common Scan and Roaming Module interfaces.
32 */
33
34#ifndef CSRAPI_H__
35#define CSRAPI_H__
36
37#include "sir_api.h"
38#include "sir_mac_prot_def.h"
39#include "csr_link_list.h"
40
41#define CSR_INVALID_SCANRESULT_HANDLE (NULL)
Paul Zhang99fe8842017-12-08 14:43:46 +080042#define CSR_NUM_WLM_LATENCY_LEVEL 4
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080043
44typedef enum {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080045 /* never used */
46 eCSR_AUTH_TYPE_NONE,
47 /* MAC layer authentication types */
48 eCSR_AUTH_TYPE_OPEN_SYSTEM,
49 eCSR_AUTH_TYPE_SHARED_KEY,
Padma, Santhosh Kumar07eb80b2017-07-05 16:10:06 +053050 eCSR_AUTH_TYPE_SAE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080051 eCSR_AUTH_TYPE_AUTOSWITCH,
52
53 /* Upper layer authentication types */
54 eCSR_AUTH_TYPE_WPA,
55 eCSR_AUTH_TYPE_WPA_PSK,
56 eCSR_AUTH_TYPE_WPA_NONE,
57
58 eCSR_AUTH_TYPE_RSN,
59 eCSR_AUTH_TYPE_RSN_PSK,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080060 eCSR_AUTH_TYPE_FT_RSN,
61 eCSR_AUTH_TYPE_FT_RSN_PSK,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080062#ifdef FEATURE_WLAN_WAPI
63 eCSR_AUTH_TYPE_WAPI_WAI_CERTIFICATE,
64 eCSR_AUTH_TYPE_WAPI_WAI_PSK,
65#endif /* FEATURE_WLAN_WAPI */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080066 eCSR_AUTH_TYPE_CCKM_WPA,
67 eCSR_AUTH_TYPE_CCKM_RSN,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080068 eCSR_AUTH_TYPE_RSN_PSK_SHA256,
69 eCSR_AUTH_TYPE_RSN_8021X_SHA256,
Sridhar Selvaraj6cf642f2017-08-21 14:28:10 +053070 eCSR_AUTH_TYPE_FILS_SHA256,
71 eCSR_AUTH_TYPE_FILS_SHA384,
72 eCSR_AUTH_TYPE_FT_FILS_SHA256,
73 eCSR_AUTH_TYPE_FT_FILS_SHA384,
Abhishek Singh02cb9e02017-08-30 17:39:50 +053074 eCSR_AUTH_TYPE_DPP_RSN,
Padma, Santhosh Kumarc69ce072017-11-06 18:21:05 +053075 eCSR_AUTH_TYPE_OWE,
Padma, Santhosh Kumare587a5c2017-12-21 12:44:46 +053076 eCSR_AUTH_TYPE_SUITEB_EAP_SHA256,
77 eCSR_AUTH_TYPE_SUITEB_EAP_SHA384,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080078 eCSR_NUM_OF_SUPPORT_AUTH_TYPE,
79 eCSR_AUTH_TYPE_FAILED = 0xff,
80 eCSR_AUTH_TYPE_UNKNOWN = eCSR_AUTH_TYPE_FAILED,
81
82} eCsrAuthType;
83
84typedef enum {
85 eCSR_ENCRYPT_TYPE_NONE,
86 eCSR_ENCRYPT_TYPE_WEP40_STATICKEY,
87 eCSR_ENCRYPT_TYPE_WEP104_STATICKEY,
88 eCSR_ENCRYPT_TYPE_WEP40,
89 eCSR_ENCRYPT_TYPE_WEP104,
90 eCSR_ENCRYPT_TYPE_TKIP,
Mukul Sharma05504ac2017-06-08 12:35:53 +053091 eCSR_ENCRYPT_TYPE_AES,/* CCMP */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080092#ifdef FEATURE_WLAN_WAPI
93 /* WAPI */
94 eCSR_ENCRYPT_TYPE_WPI,
95#endif /* FEATURE_WLAN_WAPI */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080096 eCSR_ENCRYPT_TYPE_KRK,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080097 eCSR_ENCRYPT_TYPE_BTK,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080098 eCSR_ENCRYPT_TYPE_AES_CMAC,
Padma, Santhosh Kumar4117d7a2017-12-20 17:39:33 +053099 eCSR_ENCRYPT_TYPE_AES_GMAC_128,
100 eCSR_ENCRYPT_TYPE_AES_GMAC_256,
Mukul Sharma05504ac2017-06-08 12:35:53 +0530101 eCSR_ENCRYPT_TYPE_AES_GCMP,
102 eCSR_ENCRYPT_TYPE_AES_GCMP_256,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800103 eCSR_ENCRYPT_TYPE_ANY,
104 eCSR_NUM_OF_ENCRYPT_TYPE = eCSR_ENCRYPT_TYPE_ANY,
105
106 eCSR_ENCRYPT_TYPE_FAILED = 0xff,
107 eCSR_ENCRYPT_TYPE_UNKNOWN = eCSR_ENCRYPT_TYPE_FAILED,
108
109} eCsrEncryptionType;
110
111/*---------------------------------------------------------------------------
112 Enumeration of the various Security types
113 ---------------------------------------------------------------------------*/
114typedef enum {
115 eCSR_SECURITY_TYPE_WPA,
116 eCSR_SECURITY_TYPE_RSN,
117#ifdef FEATURE_WLAN_WAPI
118 eCSR_SECURITY_TYPE_WAPI,
119#endif /* FEATURE_WLAN_WAPI */
120 eCSR_SECURITY_TYPE_UNKNOWN,
121
122} eCsrSecurityType;
123
124typedef enum {
125 /* 11a/b/g only, no HT, no proprietary */
126 eCSR_DOT11_MODE_abg = 0x0001,
127 eCSR_DOT11_MODE_11a = 0x0002,
128 eCSR_DOT11_MODE_11b = 0x0004,
129 eCSR_DOT11_MODE_11g = 0x0008,
130 eCSR_DOT11_MODE_11n = 0x0010,
131 eCSR_DOT11_MODE_11g_ONLY = 0x0020,
132 eCSR_DOT11_MODE_11n_ONLY = 0x0040,
133 eCSR_DOT11_MODE_11b_ONLY = 0x0080,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800134 eCSR_DOT11_MODE_11ac = 0x0100,
135 eCSR_DOT11_MODE_11ac_ONLY = 0x0200,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800136 /*
137 * This is for WIFI test. It is same as eWNIAPI_MAC_PROTOCOL_ALL
138 * except when it starts IBSS in 11B of 2.4GHz
139 * It is for CSR internal use
140 */
141 eCSR_DOT11_MODE_AUTO = 0x0400,
Krishna Kumaar Natarajan4f1d7722017-03-03 21:12:51 -0800142 eCSR_DOT11_MODE_11ax = 0x0800,
143 eCSR_DOT11_MODE_11ax_ONLY = 0x1000,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800144
145 /* specify the number of maximum bits for phyMode */
146 eCSR_NUM_PHY_MODE = 16,
147} eCsrPhyMode;
148
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700149/**
150 * enum eCsrRoamBssType - BSS type in CSR operations
151 * @eCSR_BSS_TYPE_INFRASTRUCTURE: Infrastructure station
152 * @eCSR_BSS_TYPE_INFRA_AP: SoftAP
153 * @eCSR_BSS_TYPE_IBSS: IBSS network we'll not start
154 * @eCSR_BSS_TYPE_START_IBSS: IBSS network we'll start if no partners found
155 * @eCSR_BSS_TYPE_NDI: NAN datapath interface
156 * @eCSR_BSS_TYPE_ANY: any BSS type (IBSS or Infrastructure)
157 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800158typedef enum {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800159 eCSR_BSS_TYPE_INFRASTRUCTURE,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700160 eCSR_BSS_TYPE_INFRA_AP,
161 eCSR_BSS_TYPE_IBSS,
162 eCSR_BSS_TYPE_START_IBSS,
163 eCSR_BSS_TYPE_NDI,
164 eCSR_BSS_TYPE_ANY,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800165} eCsrRoamBssType;
166
167typedef enum {
168 eCSR_SCAN_REQUEST_11D_SCAN = 1,
169 eCSR_SCAN_REQUEST_FULL_SCAN,
170 eCSR_SCAN_IDLE_MODE_SCAN,
171 eCSR_SCAN_HO_PROBE_SCAN, /* direct probe on entry from candidate list */
172 eCSR_SCAN_P2P_DISCOVERY,
173
174 eCSR_SCAN_SOFTAP_CHANNEL_RANGE,
175 eCSR_SCAN_P2P_FIND_PEER,
176} eCsrRequestType;
177
178typedef enum {
179 eCSR_SCAN_RESULT_GET = 0,
180 eCSR_SCAN_RESULT_FLUSH = 1, /* to delete all cached scan results */
181} eCsrScanResultCmd;
182
183typedef enum {
184 eCSR_SCAN_SUCCESS,
185 eCSR_SCAN_FAILURE,
186 eCSR_SCAN_ABORT,
187 eCSR_SCAN_FOUND_PEER,
188} eCsrScanStatus;
189
190/*
191 * Reason to abort the scan
192 * The reason can used later to decide whether to update the scan results
193 * to upper layer or not
194 */
195typedef enum {
Ratnam Rachurib7595a32016-11-04 16:58:53 +0530196 eCSR_SCAN_ABORT_DEFAULT = 1,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800197 eCSR_SCAN_ABORT_DUE_TO_BAND_CHANGE, /* Scan abort due to band change */
198 eCSR_SCAN_ABORT_SSID_ONLY
199} eCsrAbortReason;
200
201typedef enum {
202 eCSR_BW_20MHz_VAL = 20,
203 eCSR_BW_40MHz_VAL = 40,
204 eCSR_BW_80MHz_VAL = 80,
205 eCSR_BW_160MHz_VAL = 160
206} eCSR_BW_Val;
207
208typedef enum {
209 eCSR_INI_SINGLE_CHANNEL_CENTERED = 0,
210 eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY,
211 eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800212 eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED,
213 eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED,
214 eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED,
215 eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW,
216 eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW,
217 eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH,
218 eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800219 eCSR_INI_CHANNEL_BONDING_STATE_MAX
220} eIniChanBondState;
221
222#define CSR_RSN_PMKID_SIZE 16
Sridhar Selvarajc3684c72017-08-21 14:32:47 +0530223#define CSR_RSN_MAX_PMK_LEN 48
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800224#define CSR_MAX_PMKID_ALLOWED 32
225#define CSR_WEP40_KEY_LEN 5
226#define CSR_WEP104_KEY_LEN 13
227#define CSR_TKIP_KEY_LEN 32
228#define CSR_AES_KEY_LEN 16
Mukul Sharma05504ac2017-06-08 12:35:53 +0530229#define CSR_AES_GCMP_KEY_LEN 16
230#define CSR_AES_GCMP_256_KEY_LEN 32
Padma, Santhosh Kumar4117d7a2017-12-20 17:39:33 +0530231#define CSR_AES_GMAC_128_KEY_LEN 16
232#define CSR_AES_GMAC_256_KEY_LEN 32
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800233#define CSR_MAX_TX_POWER (WNI_CFG_CURRENT_TX_POWER_LEVEL_STAMAX)
234#define CSR_MAX_RSC_LEN 16
235#ifdef FEATURE_WLAN_WAPI
236#define CSR_WAPI_BKID_SIZE 16
237#define CSR_MAX_BKID_ALLOWED 16
238#define CSR_WAPI_KEY_LEN 32
239#define CSR_MAX_KEY_LEN (CSR_WAPI_KEY_LEN) /* longest one is for WAPI */
240#else
241#define CSR_MAX_KEY_LEN (CSR_TKIP_KEY_LEN) /* longest one is for TKIP */
242#endif /* FEATURE_WLAN_WAPI */
243#ifdef FEATURE_WLAN_ESE
244#define CSR_KRK_KEY_LEN 16
245#endif
246
247typedef struct tagCsrChannelInfo {
248 uint8_t numOfChannels;
249 uint8_t *ChannelList; /* it will be an array of channels */
250} tCsrChannelInfo, *tpCsrChannelInfo;
251
lifeng21b7b8b2017-06-22 17:32:21 +0800252typedef enum {
253 eHIDDEN_SSID_NOT_IN_USE,
254 eHIDDEN_SSID_ZERO_LEN,
255 eHIDDEN_SSID_ZERO_CONTENTS
256} tHiddenssId;
257
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800258typedef struct tagCsrSSIDInfo {
259 tSirMacSSid SSID;
260 bool handoffPermitted;
lifeng21b7b8b2017-06-22 17:32:21 +0800261 tHiddenssId ssidHidden;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800262} tCsrSSIDInfo;
263
264typedef struct tagCsrSSIDs {
265 uint32_t numOfSSIDs;
266 tCsrSSIDInfo *SSIDList; /* To be allocated for array of SSIDs */
267} tCsrSSIDs;
268
269typedef struct tagCsrBSSIDs {
270 uint32_t numOfBSSIDs;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530271 struct qdf_mac_addr *bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800272} tCsrBSSIDs;
273
274typedef struct tagCsrStaParams {
275 uint16_t capability;
276 uint8_t extn_capability[SIR_MAC_MAX_EXTN_CAP];
277 uint8_t supported_rates_len;
278 uint8_t supported_rates[SIR_MAC_MAX_SUPP_RATES];
279 uint8_t htcap_present;
280 tSirHTCap HTCap;
281 uint8_t vhtcap_present;
282 tSirVHTCap VHTCap;
283 uint8_t uapsd_queues;
284 uint8_t max_sp;
285 uint8_t supported_channels_len;
286 uint8_t supported_channels[SIR_MAC_MAX_SUPP_CHANNELS];
287 uint8_t supported_oper_classes_len;
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -0700288 uint8_t supported_oper_classes[REG_MAX_SUPP_OPER_CLASSES];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800289} tCsrStaParams;
290
291typedef struct tagCsrScanRequest {
292 tSirScanType scanType;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530293 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800294 eCsrRoamBssType BSSType;
295 tCsrSSIDs SSIDs;
296 tCsrChannelInfo ChannelInfo;
297 uint32_t minChnTime; /* in units of milliseconds */
298 uint32_t maxChnTime; /* in units of milliseconds */
Agrawal Ashish17bb3902016-05-05 13:29:40 +0530299 /* In units of milliseconds, ignored when not connected */
300 uint32_t restTime;
301 /* In units of milliseconds, ignored when not connected */
302 uint32_t min_rest_time;
303 /* In units of milliseconds, ignored when not connected */
304 uint32_t idle_time;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800305 uint32_t uIEFieldLen;
306 uint8_t *pIEField;
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +0530307 enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800308 eCsrRequestType requestType; /* 11d scan or full scan */
309 bool p2pSearch;
310 bool skipDfsChnlInP2pSearch;
311 bool bcnRptReqScan; /* is Scan issued by Beacon Report Request */
312 uint32_t scan_id;
313 uint32_t timestamp;
314} tCsrScanRequest;
315
316typedef struct tagCsrScanResultInfo {
317 /*
318 * Carry the IEs for the current BSSDescription.
319 * A pointer to tDot11fBeaconIEs. Maybe NULL for start BSS.
320 */
321 void *pvIes;
322 tAniSSID ssId;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530323 unsigned long timer; /* timer is variable for hidden SSID timer */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800324 /*
325 * This member must be the last in the structure because the
326 * end of tSirBssDescription is an
327 * array with nonknown size at this time */
328 tSirBssDescription BssDescriptor;
329} tCsrScanResultInfo;
330
331typedef struct tagCsrEncryptionList {
332
333 uint32_t numEntries;
334 eCsrEncryptionType encryptionType[eCSR_NUM_OF_ENCRYPT_TYPE];
335
336} tCsrEncryptionList, *tpCsrEncryptionList;
337
338typedef struct tagCsrAuthList {
339 uint32_t numEntries;
340 eCsrAuthType authType[eCSR_NUM_OF_SUPPORT_AUTH_TYPE];
341} tCsrAuthList, *tpCsrAuthList;
342
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800343typedef struct tagCsrMobilityDomainInfo {
344 uint8_t mdiePresent;
345 uint16_t mobilityDomain;
346} tCsrMobilityDomainInfo;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800347
348#ifdef FEATURE_WLAN_ESE
349typedef struct tagCsrEseCckmInfo {
350 uint32_t reassoc_req_num;
351 bool krk_plumbed;
352 uint8_t krk[SIR_KRK_KEY_LEN];
353#ifdef WLAN_FEATURE_ROAM_OFFLOAD
354 uint8_t btk[SIR_BTK_KEY_LEN];
355#endif
356} tCsrEseCckmInfo;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800357
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800358#define CSR_DOT11F_IE_RSN_MAX_LEN (114)
359typedef struct tagCsrEseCckmIe {
360 uint8_t cckmIe[CSR_DOT11F_IE_RSN_MAX_LEN];
361 uint8_t cckmIeLen;
362} tCsrEseCckmIe;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800363#endif /* FEATURE_WLAN_ESE */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800364
365typedef struct sCsrChannel_ {
366 uint8_t numChannels;
367 uint8_t channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
368} sCsrChannel;
369
370typedef struct tagCsrScanResultFilter {
371 tCsrBSSIDs BSSIDs;
372 tCsrSSIDs SSIDs;
373 tCsrChannelInfo ChannelInfo;
374 tCsrAuthList authType;
375 tCsrEncryptionList EncryptionType;
376 /*
377 * eCSR_ENCRYPT_TYPE_ANY cannot be set in multicast encryption type.
378 * If caller doesn't case, put all supported encryption types in here
379 */
380 tCsrEncryptionList mcEncryptionType;
381 eCsrRoamBssType BSSType;
382 /* its a bit mask of all the needed phy mode defined in eCsrPhyMode */
383 eCsrPhyMode phyMode;
384 /*
385 * If countryCode[0] is not 0, countryCode is checked
386 * independent of fCheckUnknownCountryCode
387 */
388 uint8_t countryCode[WNI_CFG_COUNTRY_CODE_LEN];
389 uint8_t uapsd_mask;
390 /* For WPS filtering if true => auth and ecryption should be ignored */
391 bool bWPSAssociation;
392 bool bOSENAssociation;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800393 /*
394 * For measurement reports --> if set, only SSID,
395 * BSSID and channel is considered for filtering.
396 */
397 bool fMeasurement;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800398 tCsrMobilityDomainInfo MDID;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800399 bool p2pResult;
400#ifdef WLAN_FEATURE_11W
401 /* Management Frame Protection */
402 bool MFPEnabled;
403 uint8_t MFPRequired;
404 uint8_t MFPCapable;
405#endif
406 /* The following flag is used to distinguish the
407 * roaming case while building the scan filter and
408 * applying it on to the scan results. This is mainly
409 * used to support whitelist ssid feature.
410 */
411 uint8_t scan_filter_for_roam;
412 struct sCsrChannel_ pcl_channels;
Abhishek Singh3c9910e2017-01-06 17:56:47 +0530413 struct qdf_mac_addr bssid_hint;
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800414 enum QDF_OPMODE csrPersona;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +0530415 bool realm_check;
416 uint8_t fils_realm[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800417} tCsrScanResultFilter;
418
419typedef struct sCsrChnPower_ {
420 uint8_t firstChannel;
421 uint8_t numChannels;
422 uint8_t maxtxPower;
423} sCsrChnPower;
424
425typedef struct tagCsr11dinfo {
426 sCsrChannel Channels;
427 uint8_t countryCode[WNI_CFG_COUNTRY_CODE_LEN + 1];
428 /* max power channel list */
429 sCsrChnPower ChnPower[WNI_CFG_VALID_CHANNEL_LIST_LEN];
430} tCsr11dinfo;
431
432typedef enum {
433 eCSR_ROAM_CANCELLED = 1,
434 /* it means error happens before assoc_start/roaming_start is called. */
435 eCSR_ROAM_FAILED,
436 /*
437 * a CSR trigger roaming operation starts,
438 * callback may get a pointer to tCsrConnectedProfile
439 */
440 eCSR_ROAM_ROAMING_START,
441 /* a CSR trigger roaming operation is completed */
442 eCSR_ROAM_ROAMING_COMPLETION,
443 /* Connection completed status. */
444 eCSR_ROAM_CONNECT_COMPLETION,
445 /*
446 * an association or start_IBSS operation starts,
447 * callback may get a pointer to tCsrRoamProfile and
448 * a pointer to tSirBssDescription
449 */
450 eCSR_ROAM_ASSOCIATION_START,
451 /*
452 * a roaming operation is finish, see eCsrRoamResult for
453 * possible data passed back
454 */
455 eCSR_ROAM_ASSOCIATION_COMPLETION,
456 eCSR_ROAM_DISASSOCIATED,
457 eCSR_ROAM_ASSOCIATION_FAILURE,
458 /* when callback with this flag. it gets a pointer to the BSS desc. */
459 eCSR_ROAM_SHOULD_ROAM,
460 /* A new candidate for PMKID is found */
461 eCSR_ROAM_SCAN_FOUND_NEW_BSS,
462 /* CSR is done lostlink roaming and still cannot reconnect */
463 eCSR_ROAM_LOSTLINK,
464 /* a link lost is detected. CSR starts roaming. */
465 eCSR_ROAM_LOSTLINK_DETECTED,
466 /*
467 * TKIP MIC error detected, callback gets a pointer
468 * to tpSirSmeMicFailureInd
469 */
470 eCSR_ROAM_MIC_ERROR_IND,
471 /* IBSS indications. */
472 eCSR_ROAM_IBSS_IND,
473 /*
474 * Update the connection status, useful for IBSS: new peer added,
475 * network is active etc.
476 */
477 eCSR_ROAM_CONNECT_STATUS_UPDATE,
478 eCSR_ROAM_GEN_INFO,
479 eCSR_ROAM_SET_KEY_COMPLETE,
480 eCSR_ROAM_IBSS_LEAVE, /* IBSS indications. */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800481 /* BSS in SoftAP mode status indication */
482 eCSR_ROAM_INFRA_IND,
483 eCSR_ROAM_WPS_PBC_PROBE_REQ_IND,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800484 eCSR_ROAM_FT_RESPONSE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800485 eCSR_ROAM_FT_START,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800486 /* this mean error happens before assoc_start/roam_start is called. */
487 eCSR_ROAM_SESSION_OPENED,
488 eCSR_ROAM_FT_REASSOC_FAILED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800489 eCSR_ROAM_PMK_NOTIFY,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800490 /*
491 * Following 4 enums are used by FEATURE_WLAN_LFR_METRICS
492 * but they are needed for compilation even when
493 * FEATURE_WLAN_LFR_METRICS is not defined.
494 */
495 eCSR_ROAM_PREAUTH_INIT_NOTIFY,
496 eCSR_ROAM_PREAUTH_STATUS_SUCCESS,
497 eCSR_ROAM_PREAUTH_STATUS_FAILURE,
498 eCSR_ROAM_HANDOVER_SUCCESS,
Kabilan Kannan32eb5022016-10-04 12:24:50 -0700499 /*
500 * TDLS callback events
501 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800502 eCSR_ROAM_TDLS_STATUS_UPDATE,
503 eCSR_ROAM_RESULT_MGMT_TX_COMPLETE_IND,
Kabilan Kannan32eb5022016-10-04 12:24:50 -0700504
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800505 /* Disaconnect all the clients */
506 eCSR_ROAM_DISCONNECT_ALL_P2P_CLIENTS,
507 /* Stopbss triggered from SME due to different */
508 eCSR_ROAM_SEND_P2P_STOP_BSS,
509 /* beacon interval */
510#ifdef WLAN_FEATURE_11W
511 eCSR_ROAM_UNPROT_MGMT_FRAME_IND,
512#endif
513
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800514 eCSR_ROAM_IBSS_PEER_INFO_COMPLETE,
515
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800516#ifdef FEATURE_WLAN_ESE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800517 eCSR_ROAM_TSM_IE_IND,
518 eCSR_ROAM_CCKM_PREAUTH_NOTIFY,
519 eCSR_ROAM_ESE_ADJ_AP_REPORT_IND,
520 eCSR_ROAM_ESE_BCN_REPORT_IND,
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800521#endif /* FEATURE_WLAN_ESE */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800522
523 /* Radar indication from lower layers */
524 eCSR_ROAM_DFS_RADAR_IND,
525 eCSR_ROAM_SET_CHANNEL_RSP,
526
527 /* Channel sw update notification */
528 eCSR_ROAM_DFS_CHAN_SW_NOTIFY,
Abhishek Singh518323d2015-10-19 17:42:01 +0530529 eCSR_ROAM_EXT_CHG_CHNL_IND,
Manishekar Chandrasekarancb052172016-04-22 12:19:04 +0530530 eCSR_ROAM_STA_CHANNEL_SWITCH,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700531 eCSR_ROAM_NDP_STATUS_UPDATE,
Selvaraj, Sridharfe696d22016-08-03 21:34:51 +0530532 eCSR_ROAM_UPDATE_SCAN_RESULT,
Naveen Rawat8cc23b02016-07-14 12:22:56 -0700533 eCSR_ROAM_START,
534 eCSR_ROAM_ABORT,
Varun Reddy Yeturu04251862016-09-16 10:33:19 -0700535 eCSR_ROAM_NAPI_OFF,
Kapil Gupta8878ad92017-02-13 11:56:04 +0530536 eCSR_ROAM_CHANNEL_COMPLETE_IND,
Arif Hussaincd151632017-02-11 16:57:19 -0800537 eCSR_ROAM_CAC_COMPLETE_IND,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800538} eRoamCmdStatus;
539
540/* comment inside indicates what roaming callback gets */
541typedef enum {
542 eCSR_ROAM_RESULT_NONE,
Varun Reddy Yeturu7b2a6572017-06-15 11:07:28 -0700543 eCSR_ROAM_RESULT_SUCCESS = eCSR_ROAM_RESULT_NONE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800544 /*
545 * If roamStatus is eCSR_ROAM_ASSOCIATION_COMPLETION,
Jeff Johnson172237b2017-11-07 15:32:59 -0800546 * struct csr_roam_info's pBssDesc may pass back
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800547 */
548 eCSR_ROAM_RESULT_FAILURE,
Jeff Johnson172237b2017-11-07 15:32:59 -0800549 /* Pass back pointer to struct csr_roam_info */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800550 eCSR_ROAM_RESULT_ASSOCIATED,
551 eCSR_ROAM_RESULT_NOT_ASSOCIATED,
552 eCSR_ROAM_RESULT_MIC_FAILURE,
553 eCSR_ROAM_RESULT_FORCED,
554 eCSR_ROAM_RESULT_DISASSOC_IND,
555 eCSR_ROAM_RESULT_DEAUTH_IND,
556 eCSR_ROAM_RESULT_CAP_CHANGED,
557 /*
Jeff Johnson172237b2017-11-07 15:32:59 -0800558 * This means we starts an IBSS struct csr_roam_info's
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800559 * pBssDesc may pass back
560 */
561 eCSR_ROAM_RESULT_IBSS_STARTED,
562 eCSR_ROAM_RESULT_IBSS_START_FAILED,
563 eCSR_ROAM_RESULT_IBSS_JOIN_SUCCESS,
564 eCSR_ROAM_RESULT_IBSS_JOIN_FAILED,
565 eCSR_ROAM_RESULT_IBSS_CONNECT,
566 eCSR_ROAM_RESULT_IBSS_INACTIVE,
567 /*
Jeff Johnson172237b2017-11-07 15:32:59 -0800568 * If roamStatus is eCSR_ROAM_ASSOCIATION_COMPLETION struct
569 * csr_roam_info's pBssDesc may pass back and the peer's MAC
570 * address in peerMacOrBssid. If roamStatus is
571 * eCSR_ROAM_IBSS_IND, the peer's MAC address in
572 * peerMacOrBssid and a beacon frame of the IBSS in pbFrames
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800573 */
574 eCSR_ROAM_RESULT_IBSS_NEW_PEER,
575 /*
576 * Peer departed from IBSS, Callback may get a pointer tSmeIbssPeerInd
577 * in pIbssPeerInd
578 */
579 eCSR_ROAM_RESULT_IBSS_PEER_DEPARTED,
580 /*
581 * Coalescing in the IBSS network (joined an IBSS network)
582 * Callback pass a BSSID in peerMacOrBssid
583 */
584 eCSR_ROAM_RESULT_IBSS_COALESCED,
585 /*
586 * If roamStatus is eCSR_ROAM_ROAMING_START, callback may get a pointer
587 * to tCsrConnectedProfile used to connect.
588 */
589 eCSR_ROAM_RESULT_IBSS_STOP,
590 eCSR_ROAM_RESULT_LOSTLINK,
591 eCSR_ROAM_RESULT_MIC_ERROR_UNICAST,
592 eCSR_ROAM_RESULT_MIC_ERROR_GROUP,
593 eCSR_ROAM_RESULT_AUTHENTICATED,
594 eCSR_ROAM_RESULT_NEW_RSN_BSS,
595#ifdef FEATURE_WLAN_WAPI
596 eCSR_ROAM_RESULT_NEW_WAPI_BSS,
597#endif /* FEATURE_WLAN_WAPI */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800598 /* INFRA started successfully */
599 eCSR_ROAM_RESULT_INFRA_STARTED,
600 /* INFRA start failed */
601 eCSR_ROAM_RESULT_INFRA_START_FAILED,
602 /* INFRA stopped */
603 eCSR_ROAM_RESULT_INFRA_STOPPED,
604 /* A station joining INFRA AP */
605 eCSR_ROAM_RESULT_INFRA_ASSOCIATION_IND,
606 /* A station joined INFRA AP */
607 eCSR_ROAM_RESULT_INFRA_ASSOCIATION_CNF,
608 /* INFRA disassociated */
609 eCSR_ROAM_RESULT_INFRA_DISASSOCIATED,
610 eCSR_ROAM_RESULT_WPS_PBC_PROBE_REQ_IND,
611 eCSR_ROAM_RESULT_SEND_ACTION_FAIL,
612 /* peer rejected assoc because max assoc limit reached */
613 eCSR_ROAM_RESULT_MAX_ASSOC_EXCEEDED,
614 /* Assoc rejected due to concurrent session running on a diff channel */
615 eCSR_ROAM_RESULT_ASSOC_FAIL_CON_CHANNEL,
Kabilan Kannan32eb5022016-10-04 12:24:50 -0700616 /* TDLS events */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800617 eCSR_ROAM_RESULT_ADD_TDLS_PEER,
618 eCSR_ROAM_RESULT_UPDATE_TDLS_PEER,
619 eCSR_ROAM_RESULT_DELETE_TDLS_PEER,
620 eCSR_ROAM_RESULT_TEARDOWN_TDLS_PEER_IND,
621 eCSR_ROAM_RESULT_DELETE_ALL_TDLS_PEER_IND,
622 eCSR_ROAM_RESULT_LINK_ESTABLISH_REQ_RSP,
623 eCSR_ROAM_RESULT_TDLS_SHOULD_DISCOVER,
624 eCSR_ROAM_RESULT_TDLS_SHOULD_TEARDOWN,
625 eCSR_ROAM_RESULT_TDLS_SHOULD_PEER_DISCONNECTED,
Kabilan Kannan14ec97f2016-05-16 23:48:25 -0700626 eCSR_ROAM_RESULT_TDLS_CONNECTION_TRACKER_NOTIFICATION,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800627
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800628 eCSR_ROAM_RESULT_IBSS_PEER_INFO_SUCCESS,
629 eCSR_ROAM_RESULT_IBSS_PEER_INFO_FAILED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800630 eCSR_ROAM_RESULT_DFS_RADAR_FOUND_IND,
631 eCSR_ROAM_RESULT_CHANNEL_CHANGE_SUCCESS,
632 eCSR_ROAM_RESULT_CHANNEL_CHANGE_FAILURE,
633 eCSR_ROAM_RESULT_DFS_CHANSW_UPDATE_SUCCESS,
Abhishek Singh518323d2015-10-19 17:42:01 +0530634 eCSR_ROAM_EXT_CHG_CHNL_UPDATE_IND,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700635
Naveen Rawat8d63a592016-06-29 18:30:59 -0700636 eCSR_ROAM_RESULT_NDI_CREATE_RSP,
637 eCSR_ROAM_RESULT_NDI_DELETE_RSP,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700638 eCSR_ROAM_RESULT_NDP_INITIATOR_RSP,
639 eCSR_ROAM_RESULT_NDP_NEW_PEER_IND,
640 eCSR_ROAM_RESULT_NDP_CONFIRM_IND,
641 eCSR_ROAM_RESULT_NDP_INDICATION,
Deepak Dhamdhere5cdce842016-05-31 10:39:12 -0700642 eCSR_ROAM_RESULT_NDP_SCHED_UPDATE_RSP,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700643 eCSR_ROAM_RESULT_NDP_RESPONDER_RSP,
644 eCSR_ROAM_RESULT_NDP_END_RSP,
645 eCSR_ROAM_RESULT_NDP_PEER_DEPARTED_IND,
646 eCSR_ROAM_RESULT_NDP_END_IND,
Arif Hussaincd151632017-02-11 16:57:19 -0800647 eCSR_ROAM_RESULT_CAC_END_IND,
Abhishek Singhc9941602016-08-09 16:06:22 +0530648 /* If Scan for SSID failed to found proper BSS */
649 eCSR_ROAM_RESULT_SCAN_FOR_SSID_FAILURE,
Arif Hussain43354e62017-05-24 11:24:25 -0700650 eCSR_ROAM_RESULT_INVOKE_FAILED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800651} eCsrRoamResult;
652
653/*----------------------------------------------------------------------------
654 List of link quality indications HDD can receive from SME
655 --------------------------------------------------------------------------*/
656typedef enum {
657 eCSR_ROAM_LINK_QUAL_MIN_IND = -1,
658
659 eCSR_ROAM_LINK_QUAL_POOR_IND = 0, /* bad link */
660 eCSR_ROAM_LINK_QUAL_GOOD_IND = 1, /* acceptable for voice */
661 eCSR_ROAM_LINK_QUAL_VERY_GOOD_IND = 2, /* suitable for voice */
662 eCSR_ROAM_LINK_QUAL_EXCELLENT_IND = 3, /* suitable for voice */
663
664 eCSR_ROAM_LINK_QUAL_MAX_IND /* invalid value */
665} eCsrRoamLinkQualityInd;
666
667typedef enum {
668 eCSR_DISCONNECT_REASON_UNSPECIFIED = 0,
669 eCSR_DISCONNECT_REASON_MIC_ERROR,
670 eCSR_DISCONNECT_REASON_DISASSOC,
671 eCSR_DISCONNECT_REASON_DEAUTH,
672 eCSR_DISCONNECT_REASON_HANDOFF,
673 eCSR_DISCONNECT_REASON_IBSS_JOIN_FAILURE,
674 eCSR_DISCONNECT_REASON_IBSS_LEAVE,
675 eCSR_DISCONNECT_REASON_STA_HAS_LEFT,
Deepak Dhamdhere13983f22016-05-31 19:06:09 -0700676 eCSR_DISCONNECT_REASON_NDI_DELETE,
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -0700677 eCSR_DISCONNECT_REASON_ROAM_HO_FAIL,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800678} eCsrRoamDisconnectReason;
679
680typedef enum {
681 /* Not associated in Infra or participating in an IBSS/Ad-hoc */
682 eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED,
683 /* Associated in an Infrastructure network. */
684 eCSR_ASSOC_STATE_TYPE_INFRA_ASSOCIATED,
685 /* Participating in IBSS network though disconnection */
686 eCSR_ASSOC_STATE_TYPE_IBSS_DISCONNECTED,
687 /* Participating in IBSS network with partner stations also present */
688 eCSR_ASSOC_STATE_TYPE_IBSS_CONNECTED,
689 /* Participating in WDS network in AP/STA mode but not connected yet */
690 eCSR_ASSOC_STATE_TYPE_WDS_DISCONNECTED,
691 /* Participating in a WDS network and connected peer to peer */
692 eCSR_ASSOC_STATE_TYPE_WDS_CONNECTED,
693 /* Participating in a Infra network in AP not yet in connected state */
694 eCSR_ASSOC_STATE_TYPE_INFRA_DISCONNECTED,
695 /* Participating in a Infra network and connected to a peer */
696 eCSR_ASSOC_STATE_TYPE_INFRA_CONNECTED,
kaliu154d7892015-12-30 17:27:58 +0530697 /* Disconnecting with AP or stop connecting process */
698 eCSR_ASSOC_STATE_TYPE_INFRA_DISCONNECTING,
Deepak Dhamdheree2dd5442016-05-27 15:05:51 -0700699 /* NAN Data interface not started */
700 eCSR_CONNECT_STATE_TYPE_NDI_NOT_STARTED,
701 /* NAN Data inteface started */
702 eCSR_CONNECT_STATE_TYPE_NDI_STARTED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800703
704} eCsrConnectState;
705
706/*
707 * This parameter is no longer supported in the Profile.
708 * Need to set this in the global properties for the adapter.
709 */
710typedef enum eCSR_MEDIUM_ACCESS {
711 eCSR_MEDIUM_ACCESS_AUTO = 0,
712 eCSR_MEDIUM_ACCESS_DCF,
713 eCSR_MEDIUM_ACCESS_eDCF,
714 eCSR_MEDIUM_ACCESS_HCF,
715
716 eCSR_MEDIUM_ACCESS_WMM_eDCF_802dot1p,
717 eCSR_MEDIUM_ACCESS_WMM_eDCF_DSCP,
718 eCSR_MEDIUM_ACCESS_WMM_eDCF_NoClassify,
719 eCSR_MEDIUM_ACCESS_11e_eDCF = eCSR_MEDIUM_ACCESS_eDCF,
720 eCSR_MEDIUM_ACCESS_11e_HCF = eCSR_MEDIUM_ACCESS_HCF,
721} eCsrMediaAccessType;
722
723typedef enum {
724 eCSR_TX_RATE_AUTO = 0, /* use rate adaption to determine Tx rate. */
725 eCSR_TX_RATE_1Mbps = 0x00000001,
726 eCSR_TX_RATE_2Mbps = 0x00000002,
727 eCSR_TX_RATE_5_5Mbps = 0x00000004,
728 eCSR_TX_RATE_6Mbps = 0x00000008,
729 eCSR_TX_RATE_9Mbps = 0x00000010,
730 eCSR_TX_RATE_11Mbps = 0x00000020,
731 eCSR_TX_RATE_12Mbps = 0x00000040,
732 eCSR_TX_RATE_18Mbps = 0x00000080,
733 eCSR_TX_RATE_24Mbps = 0x00000100,
734 eCSR_TX_RATE_36Mbps = 0x00000200,
735 eCSR_TX_RATE_42Mbps = 0x00000400,
736 eCSR_TX_RATE_48Mbps = 0x00000800,
737 eCSR_TX_RATE_54Mbps = 0x00001000,
738 eCSR_TX_RATE_72Mbps = 0x00002000,
739 eCSR_TX_RATE_84Mbps = 0x00004000,
740 eCSR_TX_RATE_96Mbps = 0x00008000,
741 eCSR_TX_RATE_108Mbps = 0x00010000,
742 eCSR_TX_RATE_126Mbps = 0x00020000,
743 eCSR_TX_RATE_144Mbps = 0x00040000,
744 eCSR_TX_RATE_168Mbps = 0x00080000,
745 eCSR_TX_RATE_192Mbps = 0x00100000,
746 eCSR_TX_RATE_216Mbps = 0x00200000,
747 eCSR_TX_RATE_240Mbps = 0x00400000,
748
749} eCsrExposedTxRate;
750
751typedef enum {
752 eCSR_OPERATING_CHANNEL_ALL = 0,
753 eCSR_OPERATING_CHANNEL_AUTO = eCSR_OPERATING_CHANNEL_ALL,
754 eCSR_OPERATING_CHANNEL_ANY = eCSR_OPERATING_CHANNEL_ALL,
755} eOperationChannel;
756
757typedef enum {
758 eCSR_DOT11_FRAG_THRESH_AUTO = -1,
759 eCSR_DOT11_FRAG_THRESH_MIN = 256,
760 eCSR_DOT11_FRAG_THRESH_MAX = 2346,
761 eCSR_DOT11_FRAG_THRESH_DEFAULT = 2000
762} eCsrDot11FragThresh;
763
764/* for channel bonding for ibss */
765typedef enum {
766 eCSR_CB_OFF = 0,
767 eCSR_CB_AUTO = 1,
768 eCSR_CB_DOWN = 2,
769 eCSR_CB_UP = 3,
770} eCsrCBChoice;
771
772/*
773 * For channel bonding, the channel number gap is 4, either up or down.
774 * For both 11a and 11g mode.
775 */
776#define CSR_CB_CHANNEL_GAP 4
777#define CSR_CB_CENTER_CHANNEL_OFFSET 2
778
779/* WEP keysize (in bits) */
780typedef enum {
781 /* 40 bit key + 24bit IV = 64bit WEP */
782 eCSR_SECURITY_WEP_KEYSIZE_40 = 40,
783 /* 104bit key + 24bit IV = 128bit WEP */
784 eCSR_SECURITY_WEP_KEYSIZE_104 = 104,
785 eCSR_SECURITY_WEP_KEYSIZE_MIN = eCSR_SECURITY_WEP_KEYSIZE_40,
786 eCSR_SECURITY_WEP_KEYSIZE_MAX = eCSR_SECURITY_WEP_KEYSIZE_104,
787 eCSR_SECURITY_WEP_KEYSIZE_MAX_BYTES =
788 (eCSR_SECURITY_WEP_KEYSIZE_MAX / 8),
789} eCsrWEPKeySize;
790
791/* Possible values for the WEP static key ID */
792typedef enum {
793
794 eCSR_SECURITY_WEP_STATIC_KEY_ID_MIN = 0,
795 eCSR_SECURITY_WEP_STATIC_KEY_ID_MAX = 3,
796 eCSR_SECURITY_WEP_STATIC_KEY_ID_DEFAULT = 0,
797
798 eCSR_SECURITY_WEP_STATIC_KEY_ID_INVALID = -1,
799
800} eCsrWEPStaticKeyID;
801
802/* Two extra key indicies are used for the IGTK (which is used by BIP) */
803#define CSR_MAX_NUM_KEY (eCSR_SECURITY_WEP_STATIC_KEY_ID_MAX + 2 + 1)
804
805typedef enum {
806 eCSR_SECURITY_SET_KEY_ACTION_NO_CHANGE,
807 eCSR_SECURITY_SET_KEY_ACTION_SET_KEY,
808 eCSR_SECURITY_SET_KEY_ACTION_DELETE_KEY,
809} eCsrSetKeyAction;
810
811typedef enum {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800812 /*
813 * Roaming because HDD requested for reassoc by changing one of the
814 * fields in tCsrRoamModifyProfileFields. OR Roaming because SME
815 * requested for reassoc by changing one of the fields in
816 * tCsrRoamModifyProfileFields.
817 */
818 eCsrRoamReasonStaCapabilityChanged,
819 /*
820 * Roaming because SME requested for reassoc to a different AP,
821 * as part of inter AP handoff.
822 */
823 eCsrRoamReasonBetterAP,
824 /*
825 * Roaming because SME requested it as the link is lost - placeholder,
826 * will clean it up once handoff code gets in
827 */
828 eCsrRoamReasonSmeIssuedForLostLink,
829
830} eCsrRoamReasonCodes;
831
832typedef enum {
833 eCsrRoamWmmAuto = 0,
834 eCsrRoamWmmQbssOnly = 1,
835 eCsrRoamWmmNoQos = 2,
836
837} eCsrRoamWmmUserModeType;
838
839typedef enum {
840 eCSR_REQUESTER_MIN = 0,
841 eCSR_DIAG,
842 eCSR_UMA_GAN,
843 eCSR_HDD
844} eCsrStatsRequesterType;
845
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800846/**
847 * enum csr_hi_rssi_scan_id - Parameter ids for hi rssi scan feature
848 *
849 * @eCSR_HI_RSSI_SCAN_MAXCOUNT_ID: how many times scan can be performed
850 * @eCSR_HI_RSSI_SCAN_RSSI_DELTA_ID: rssi difference to trigger scan
851 * @eCSR_HI_RSSI_SCAN_DELAY_ID: delay in millseconds between scans
852 * @eCSR_HI_RSSI_SCAN_RSSI_UB_ID: rssi upper bound for scan trigger
853 */
854enum csr_hi_rssi_scan_id {
855 eCSR_HI_RSSI_SCAN_MAXCOUNT_ID,
856 eCSR_HI_RSSI_SCAN_RSSI_DELTA_ID,
857 eCSR_HI_RSSI_SCAN_DELAY_ID,
858 eCSR_HI_RSSI_SCAN_RSSI_UB_ID
859};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800860
861typedef struct tagPmkidCandidateInfo {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530862 struct qdf_mac_addr BSSID;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800863 bool preAuthSupported;
864} tPmkidCandidateInfo;
865
866typedef struct tagPmkidCacheInfo {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530867 struct qdf_mac_addr BSSID;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800868 uint8_t PMKID[CSR_RSN_PMKID_SIZE];
Sridhar Selvarajc3684c72017-08-21 14:32:47 +0530869 uint8_t pmk[CSR_RSN_MAX_PMK_LEN];
870 uint8_t pmk_len;
871 uint8_t ssid_len;
872 uint8_t ssid[SIR_MAC_MAX_SSID_LENGTH];
873 uint8_t cache_id[CACHE_ID_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800874} tPmkidCacheInfo;
875
876#ifdef FEATURE_WLAN_WAPI
877typedef struct tagBkidCandidateInfo {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530878 struct qdf_mac_addr BSSID;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800879 bool preAuthSupported;
880} tBkidCandidateInfo;
881
882typedef struct tagBkidCacheInfo {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530883 struct qdf_mac_addr BSSID;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800884 uint8_t BKID[CSR_WAPI_BKID_SIZE];
885} tBkidCacheInfo;
886#endif /* FEATURE_WLAN_WAPI */
887
888typedef struct tagCsrKeys {
889 /* Also use to indicate whether the key index is set */
890 uint8_t KeyLength[CSR_MAX_NUM_KEY];
891 uint8_t KeyMaterial[CSR_MAX_NUM_KEY][CSR_MAX_KEY_LEN];
892 uint8_t defaultIndex;
893} tCsrKeys;
894
895/*
896 * Following fields which're part of tCsrRoamConnectedProfile might need
897 * modification dynamically once STA is up & running & this'd trigger reassoc
898 */
899typedef struct tagCsrRoamModifyProfileFields {
900 /*
901 * during connect this specifies ACs U-APSD is to be setup
902 * for (Bit0:VO; Bit1:VI; Bit2:BK; Bit3:BE all other bits are ignored).
903 * During assoc response this COULD carry confirmation of what
904 * ACs U-APSD got setup for. Later if an APP looking for APSD,
905 * SME-QoS might need to modify this field
906 */
907 uint8_t uapsd_mask;
908 /* HDD might ask to modify this field */
909 uint16_t listen_interval;
910} tCsrRoamModifyProfileFields;
911
Jeff Johnson174b6a42017-11-07 15:16:20 -0800912typedef struct csr_roam_profile {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800913 tCsrSSIDs SSIDs;
914 tCsrBSSIDs BSSIDs;
915 /* this is bit mask of all the needed phy mode defined in eCsrPhyMode */
916 uint32_t phyMode;
917 eCsrRoamBssType BSSType;
918 tCsrAuthList AuthType;
919 eCsrAuthType negotiatedAuthType;
920 tCsrEncryptionList EncryptionType;
921 /* This field is for output only, not for input */
922 eCsrEncryptionType negotiatedUCEncryptionType;
923 /*
924 * eCSR_ENCRYPT_TYPE_ANY cannot be set in multicast encryption type.
925 * If caller doesn't case, put all supported encryption types in here
926 */
927 tCsrEncryptionList mcEncryptionType;
928 /* This field is for output only, not for input */
929 eCsrEncryptionType negotiatedMCEncryptionType;
930#ifdef WLAN_FEATURE_11W
931 /* Management Frame Protection */
932 bool MFPEnabled;
933 uint8_t MFPRequired;
934 uint8_t MFPCapable;
935#endif
Padma, Santhosh Kumar4117d7a2017-12-20 17:39:33 +0530936 tAniEdType mgmt_encryption_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800937 tCsrKeys Keys;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800938 tCsrChannelInfo ChannelInfo;
939 uint8_t operationChannel;
Amar Singhal5cccafe2017-02-15 12:42:58 -0800940 struct ch_params ch_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800941 /* If this is 0, SME will fill in for caller. */
942 uint16_t beaconInterval;
943 /*
944 * during connect this specifies ACs U-APSD is to be setup
945 * for (Bit0:VO; Bit1:VI; Bit2:BK; Bit3:BE all other bits are ignored).
946 * During assoc resp this'd carry cnf of what ACs U-APSD got setup for
947 */
948 uint8_t uapsd_mask;
949 uint32_t nWPAReqIELength; /* The byte count in the pWPAReqIE */
950 uint8_t *pWPAReqIE; /* If not null,it's IE byte stream for WPA */
951 uint32_t nRSNReqIELength; /* The byte count in the pRSNReqIE */
952 uint8_t *pRSNReqIE; /* If not null,it's IE byte stream for RSN */
953#ifdef FEATURE_WLAN_WAPI
954 uint32_t nWAPIReqIELength;/* The byte count in the pWAPIReqIE */
955 uint8_t *pWAPIReqIE; /* If not null,it's IE byte stream for WAPI */
956#endif /* FEATURE_WLAN_WAPI */
957
958 uint32_t nAddIEScanLength;/* pAddIE for scan (at the time of join) */
959 /*
960 * If not null,it's the IE byte stream for additional IE,
961 * which can be WSC IE and/or P2P IE
962 */
963 uint8_t *pAddIEScan;
964 uint32_t nAddIEAssocLength; /* The byte count in the pAddIE for assoc */
965 /*
966 * If not null, it has the IE byte stream for additional IE,
967 * which can be WSC IE and/or P2P IE
968 */
969 uint8_t *pAddIEAssoc;
970 /* it is ignored if [0] is 0. */
971 uint8_t countryCode[WNI_CFG_COUNTRY_CODE_LEN];
972 /* WPS Association if true => auth and ecryption should be ignored */
973 bool bWPSAssociation;
974 bool bOSENAssociation;
975 uint32_t nWSCReqIELength; /* The byte count in the pWSCReqIE */
976 uint8_t *pWSCReqIE; /* If not null,it's IE byte stream for WSC */
977 uint8_t ieee80211d;
978 uint8_t privacy;
979 bool fwdWPSPBCProbeReq;
980 tAniAuthType csr80211AuthType;
981 uint32_t dtimPeriod;
982 bool ApUapsdEnable;
983 bool protEnabled;
984 bool obssProtEnabled;
hqu0a6ce082017-09-27 22:00:35 +0800985 bool chan_switch_hostapd_rate_enabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800986 uint16_t cfg_protection;
987 uint8_t wps_state;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800988 tCsrMobilityDomainInfo MDID;
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800989 enum QDF_OPMODE csrPersona;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800990 uint8_t disableDFSChSwitch;
991 /* addIe params */
992 tSirAddIeParams addIeParams;
993 uint8_t sap_dot11mc;
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800994 uint16_t beacon_tx_rate;
Agrawal Ashish06e76d22016-08-18 16:44:48 +0530995 tSirMacRateSet supported_rates;
996 tSirMacRateSet extended_rates;
Abhishek Singh3c9910e2017-01-06 17:56:47 +0530997 struct qdf_mac_addr bssid_hint;
Abhishek Singhb59f8d42017-07-31 14:42:47 +0530998 bool force_24ghz_in_ht20;
Arif Hussain671a1902017-03-17 09:08:32 -0700999 uint32_t cac_duration_ms;
1000 uint32_t dfs_regdomain;
Varun Reddy Yeturue5a35d12017-10-20 11:26:57 -07001001 bool supplicant_disabled_roaming;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +05301002#ifdef WLAN_FEATURE_FILS_SK
1003 bool fils_connection;
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05301004 uint8_t *hlp_ie;
1005 uint32_t hlp_ie_len;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +05301006 struct cds_fils_connection_info *fils_con_info;
1007#endif
Abhishek Singh6454ad32017-12-20 10:42:21 +05301008 bool force_rsne_override;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001009} tCsrRoamProfile;
1010
1011#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
1012typedef struct tagCsrRoamHTProfile {
1013 uint8_t phymode;
1014 uint8_t htCapability;
1015 uint8_t htSupportedChannelWidthSet;
1016 uint8_t htRecommendedTxWidthSet;
1017 ePhyChanBondState htSecondaryChannelOffset;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001018 uint8_t vhtCapability;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001019 uint8_t apCenterChan;
1020 uint8_t apChanWidth;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001021} tCsrRoamHTProfile;
1022#endif
1023typedef struct tagCsrRoamConnectedProfile {
1024 tSirMacSSid SSID;
1025 bool handoffPermitted;
1026 bool ssidHidden;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301027 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001028 eCsrRoamBssType BSSType;
1029 eCsrAuthType AuthType;
1030 tCsrAuthList AuthInfo;
1031 eCsrEncryptionType EncryptionType;
1032 tCsrEncryptionList EncryptionInfo;
1033 eCsrEncryptionType mcEncryptionType;
1034 tCsrEncryptionList mcEncryptionInfo;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001035 uint8_t operationChannel;
1036 uint32_t vht_channel_width;
1037 uint16_t beaconInterval;
1038 tCsrKeys Keys;
1039 /*
1040 * meaningless on connect. It's an OUT param from CSR's point of view
1041 * During assoc response carries the ACM bit-mask i.e. what
1042 * ACs have ACM=1 (if any),(Bit0:VO; Bit1:VI; Bit2:BK; Bit3:BE
1043 * all other bits are ignored)
1044 */
1045 uint8_t acm_mask;
1046 tCsrRoamModifyProfileFields modifyProfileFields;
1047 uint32_t nAddIEAssocLength;
1048 /*
1049 * If not null,it's IE byte stream for additional IE,
1050 * which can be WSC IE and/or P2P IE
1051 */
1052 uint8_t *pAddIEAssoc;
1053 tSirBssDescription *pBssDesc;
1054 bool qap; /* AP supports QoS */
1055 bool qosConnection; /* A connection is QoS enabled */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001056 tCsrMobilityDomainInfo MDID;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001057#ifdef FEATURE_WLAN_ESE
1058 tCsrEseCckmInfo eseCckmInfo;
1059 bool isESEAssoc;
1060#endif
1061 uint32_t dot11Mode;
1062 uint8_t proxyARPService;
1063#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
1064 tCsrRoamHTProfile HTProfile;
1065#endif
1066#ifdef WLAN_FEATURE_11W
1067 /* Management Frame Protection */
1068 bool MFPEnabled;
1069 uint8_t MFPRequired;
1070 uint8_t MFPCapable;
1071#endif
1072} tCsrRoamConnectedProfile;
1073
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001074typedef struct tagCsr11rConfigParams {
1075 bool IsFTResourceReqSupported;
1076} tCsr11rConfigParams;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001077
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001078typedef struct tagCsrNeighborRoamConfigParams {
1079
1080 uint32_t nNeighborScanTimerPeriod;
Sridhar Selvaraj1b2330c2017-07-21 15:16:42 +05301081 uint32_t neighbor_scan_min_timer_period;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001082 uint8_t nNeighborLookupRssiThreshold;
Varun Reddy Yeturu168134f2017-06-26 13:46:05 -07001083 int8_t rssi_thresh_offset_5g;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001084 uint16_t nNeighborScanMinChanTime;
1085 uint16_t nNeighborScanMaxChanTime;
1086 sCsrChannel neighborScanChanList;
1087 uint8_t nMaxNeighborRetries;
1088 uint16_t nNeighborResultsRefreshPeriod;
1089 uint16_t nEmptyScanRefreshPeriod;
1090 uint8_t nOpportunisticThresholdDiff;
1091 uint8_t nRoamRescanRssiDiff;
1092 uint8_t nRoamBmissFirstBcnt;
1093 uint8_t nRoamBmissFinalBcnt;
1094 uint8_t nRoamBeaconRssiWeight;
1095 uint8_t delay_before_vdev_stop;
1096 uint32_t nhi_rssi_scan_max_count;
1097 uint32_t nhi_rssi_scan_rssi_delta;
1098 uint32_t nhi_rssi_scan_delay;
1099 int32_t nhi_rssi_scan_rssi_ub;
1100} tCsrNeighborRoamConfigParams;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001101
Agrawal Ashish21ba2572016-09-03 16:40:10 +05301102/**
1103 * enum sta_roam_policy_dfs_mode - state of DFS mode for STA ROME policy
1104 * @CSR_STA_ROAM_POLICY_NONE: DFS mode attribute is not valid
1105 * @CSR_STA_ROAM_POLICY_DFS_ENABLED: DFS mode is enabled
1106 * @CSR_STA_ROAM_POLICY_DFS_DISABLED: DFS mode is disabled
1107 * @CSR_STA_ROAM_POLICY_DFS_DEPRIORITIZE: Deprioritize DFS channels in scanning
1108 */
1109enum sta_roam_policy_dfs_mode {
1110 CSR_STA_ROAM_POLICY_NONE,
1111 CSR_STA_ROAM_POLICY_DFS_ENABLED,
1112 CSR_STA_ROAM_POLICY_DFS_DISABLED,
1113 CSR_STA_ROAM_POLICY_DFS_DEPRIORITIZE
1114};
1115
1116/**
1117 * struct csr_sta_roam_policy_params - sta roam policy params for station
1118 * @dfs_mode: tell is DFS channels needs to be skipped while scanning
1119 * @skip_unsafe_channels: tells if unsafe channels needs to be skip in scanning
Agrawal, Ashish9f84c402016-11-30 16:19:44 +05301120 * @sap_operating_band: Opearting band for SAP
Agrawal Ashish21ba2572016-09-03 16:40:10 +05301121 */
1122struct csr_sta_roam_policy_params {
1123 enum sta_roam_policy_dfs_mode dfs_mode;
1124 bool skip_unsafe_channels;
Agrawal, Ashish9f84c402016-11-30 16:19:44 +05301125 uint8_t sap_operating_band;
Agrawal Ashish21ba2572016-09-03 16:40:10 +05301126};
1127
Vignesh Viswanathan9dd88d32017-11-22 14:22:03 +05301128/**
1129 * struct csr_mbo_thresholds - mbo related thresholds
1130 * @mbo_candidate_rssi_thres - Candidate RSSI threshold
1131 * @mbo_current_rssi_thres - Current RSSI threshold
1132 * @mbo_current_rssi_mcc_thres - Current RSSI MCC threshold
1133 * mbo_candidate_rssi_btc_thres - Candidate RSSI BTC threshold
1134 */
1135struct csr_mbo_thresholds {
1136 int8_t mbo_candidate_rssi_thres;
1137 int8_t mbo_current_rssi_thres;
1138 int8_t mbo_current_rssi_mcc_thres;
1139 int8_t mbo_candidate_rssi_btc_thres;
1140};
1141
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001142typedef struct tagCsrConfigParam {
1143 uint32_t FragmentationThreshold;
1144 /* keep this uint32_t. This gets converted to ePhyChannelBondState */
1145 uint32_t channelBondingMode24GHz;
1146 uint32_t channelBondingMode5GHz;
1147 eCsrPhyMode phyMode;
Varun Reddy Yeturua48bc412017-11-17 15:33:35 -08001148 enum band_info eBand;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001149 uint32_t RTSThreshold;
1150 uint32_t HeartbeatThresh50;
1151 uint32_t HeartbeatThresh24;
1152 eCsrCBChoice cbChoice;
Varun Reddy Yeturua48bc412017-11-17 15:33:35 -08001153 enum band_info bandCapability; /* indicate hw capability */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001154 uint16_t TxRate;
1155 eCsrRoamWmmUserModeType WMMSupportMode;
1156 bool Is11eSupportEnabled;
1157 bool Is11dSupportEnabled;
1158 bool Is11dSupportEnabledOriginal;
1159 bool Is11hSupportEnabled;
1160 bool shortSlotTime;
1161 bool ProprietaryRatesEnabled;
1162 uint8_t AdHocChannel24;
1163 uint8_t AdHocChannel5G;
1164 /*
1165 * this number minus one is the number of times a scan doesn't find it
1166 * before it is removed
1167 */
1168 uint32_t nScanResultAgeCount;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001169 /* to set the RSSI difference for each category */
1170 uint8_t bCatRssiOffset;
1171 /* to set MCC Enable/Disable mode */
1172 uint8_t fEnableMCCMode;
1173 bool mcc_rts_cts_prot_enable;
1174 bool mcc_bcast_prob_resp_enable;
1175 /*
1176 * To allow MCC GO different B.I than STA's.
1177 * NOTE: make sure if RIVA firmware can handle this combination before
1178 * enabling this at the moment, this flag is provided only to pass
1179 * Wi-Fi Cert. 5.1.12
1180 */
1181 uint8_t fAllowMCCGODiffBI;
1182 tCsr11dinfo Csr11dinfo;
1183
1184 /* Country Code Priority */
1185 bool fSupplicantCountryCodeHasPriority;
1186 uint16_t vccRssiThreshold;
1187 uint32_t vccUlMacLossThreshold;
1188 uint32_t nPassiveMinChnTime; /* in units of milliseconds */
1189 uint32_t nPassiveMaxChnTime; /* in units of milliseconds */
1190 uint32_t nActiveMinChnTime; /* in units of milliseconds */
1191 uint32_t nActiveMaxChnTime; /* in units of milliseconds */
1192 uint32_t nInitialDwellTime; /* in units of milliseconds */
1193 bool initial_scan_no_dfs_chnl;
1194#ifdef WLAN_AP_STA_CONCURRENCY
1195 uint32_t nPassiveMinChnTimeConc; /* in units of milliseconds */
1196 uint32_t nPassiveMaxChnTimeConc; /* in units of milliseconds */
1197 uint32_t nActiveMinChnTimeConc; /* in units of milliseconds */
1198 uint32_t nActiveMaxChnTimeConc; /* in units of milliseconds */
1199 uint32_t nRestTimeConc; /* in units of milliseconds */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001200#endif
Agrawal Ashish17bb3902016-05-05 13:29:40 +05301201 /*In units of milliseconds*/
1202 uint32_t min_rest_time_conc;
1203 /*In units of milliseconds*/
1204 uint32_t idle_time_conc;
1205
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001206 /*
1207 * in dBm, the maximum TX power The actual TX power is the lesser of
1208 * this value and 11d. If 11d is disable, the lesser of this and
1209 * default setting.
1210 */
1211 uint8_t nTxPowerCap;
Padma, Santhosh Kumar29df3622016-08-16 19:15:16 +05301212 bool allow_tpc_from_ap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001213 /* stats request frequency from PE while in full power */
1214 uint32_t statsReqPeriodicity;
1215 /* stats request frequency from PE while in power save */
1216 uint32_t statsReqPeriodicityInPS;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001217 tCsr11rConfigParams csr11rConfig;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001218#ifdef FEATURE_WLAN_ESE
1219 uint8_t isEseIniFeatureEnabled;
1220#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001221 uint8_t isFastRoamIniFeatureEnabled;
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07001222 struct mawc_params csr_mawc_config;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001223 uint8_t isFastTransitionEnabled;
1224 uint8_t RoamRssiDiff;
Abhishek Singh34c0e632017-09-28 14:39:29 +05301225 int32_t rssi_abs_thresh;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001226 bool isWESModeEnabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001227 tCsrNeighborRoamConfigParams neighborRoamConfig;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001228 /*
1229 * Instead of Reassoc, send ADDTS/DELTS even when ACM is off for that AC
1230 * This is mandated by WMM-AC certification
1231 */
1232 bool addTSWhenACMIsOff;
1233 /*
1234 * channelPowerInfoList24 has been seen corrupted. Set this flag to true
1235 * trying to detect when it happens. Adding this into code because we
1236 * can't reproduce it easily. We don't know when it happens.
1237 */
1238 bool fValidateList;
1239 /*
1240 * Customer wants to start with an active scan based on the default
1241 * country code. This optimization will minimize the driver load to
1242 * association time. Based on this flag we will bypass the initial
1243 * passive scan needed for 11d to determine the country code & domain
1244 */
1245 bool fEnableBypass11d;
1246 /*
1247 * Customer wants to optimize the scan time. Avoiding scans(passive)
1248 * on DFS channels while swipping through both bands can save some time
1249 * (apprx 1.3 sec)
1250 */
1251 uint8_t fEnableDFSChnlScan;
1252 /*
1253 * To enable/disable scanning 2.4Ghz channels twice on a single scan
1254 * request from HDD
1255 */
1256 bool fScanTwice;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001257 uint32_t nVhtChannelWidth;
1258 uint8_t enableTxBF;
Kiran Kumar Lokere5302ab62015-12-16 16:03:16 -08001259 uint8_t enable_txbf_sap_mode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001260 uint8_t enable2x2;
1261 bool enableVhtFor24GHz;
Kapil Gupta4b2efbb2016-10-03 13:07:20 +05301262 bool vendor_vht_sap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001263 uint8_t enableMuBformee;
1264 uint8_t enableVhtpAid;
1265 uint8_t enableVhtGid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001266 uint8_t enableAmpduPs;
1267 uint8_t enableHtSmps;
1268 uint8_t htSmps;
Archana Ramachandranfec24812016-02-16 16:31:56 -08001269 bool send_smps_action;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001270 bool ignore_peer_erp_info;
1271 /*
1272 * To enable/disable scanning only 2.4Ghz channels on first scan
1273 */
1274 bool fFirstScanOnly2GChnl;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001275 bool nRoamPrefer5GHz;
1276 bool nRoamIntraBand;
1277 uint8_t nProbes;
1278 uint16_t nRoamScanHomeAwayTime;
1279
1280 bool isRoamOffloadScanEnabled;
1281 bool bFastRoamInConIniFeatureEnabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001282 uint8_t scanCfgAgingTime;
Krunal Sonia2c0e412017-05-04 14:12:41 +05301283 uint8_t enable_tx_ldpc;
1284 uint8_t enable_rx_ldpc;
Krunal Soni158bfe62017-08-02 12:33:08 -07001285 uint8_t disable_high_ht_mcs_2x2;
Deepak Dhamdhere612392c2016-08-28 02:56:51 -07001286 uint8_t max_amsdu_num;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001287 uint8_t nSelect5GHzMargin;
1288 uint8_t isCoalesingInIBSSAllowed;
1289#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
1290 uint8_t cc_switch_mode;
1291#endif
1292 uint8_t allowDFSChannelRoam;
1293#ifdef WLAN_FEATURE_ROAM_OFFLOAD
1294 bool isRoamOffloadEnabled;
1295#endif
1296 bool obssEnabled;
1297 uint8_t conc_custom_rule1;
1298 uint8_t conc_custom_rule2;
1299 uint8_t is_sta_connection_in_5gz_enabled;
Jeff Johnson1ad3fbd2017-11-03 08:00:02 -07001300 bool send_deauth_before_con;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001301
1302 /* 802.11p enable */
1303 bool enable_dot11p;
1304 uint8_t max_scan_count;
Varun Reddy Yeturu05186292015-09-28 17:12:33 -07001305 bool early_stop_scan_enable;
1306 int8_t early_stop_scan_min_threshold;
1307 int8_t early_stop_scan_max_threshold;
Varun Reddy Yeturu044bda22015-11-21 22:03:40 -08001308 int8_t first_scan_bucket_threshold;
Krunal Soni1878d3a2016-01-14 13:00:44 -08001309 uint8_t fEnableDebugLog;
1310 uint8_t max_intf_count;
1311 bool enable5gEBT;
1312 bool enableSelfRecovery;
1313 uint32_t f_sta_miracast_mcc_rest_time_val;
1314#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
1315 bool sap_channel_avoidance;
1316#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
gaoleze5108942017-03-31 16:56:42 +08001317 bool acs_with_more_param;
Krunal Soni1878d3a2016-01-14 13:00:44 -08001318 uint8_t f_prefer_non_dfs_on_radar;
1319 bool is_ps_enabled;
Kiran Kumar Lokere0ac679c2016-11-17 17:43:36 -08001320 uint32_t auto_bmps_timer_val;
Krunal Soni1878d3a2016-01-14 13:00:44 -08001321 uint32_t dual_mac_feature_disable;
Ganesh Kondabattini930304c2017-10-10 15:25:36 +05301322 uint32_t sta_sap_scc_on_dfs_chan;
Gupta, Kapilc68ad462016-02-01 19:17:23 +05301323 uint32_t roam_dense_traffic_thresh;
1324 uint32_t roam_dense_rssi_thresh_offset;
1325 uint32_t roam_dense_min_aps;
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07001326 int8_t roam_bg_scan_bad_rssi_thresh;
Vignesh Viswanathanc018e982017-09-07 18:49:19 +05301327 uint8_t roam_bad_rssi_thresh_offset_2g;
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07001328 uint32_t roam_bg_scan_client_bitmap;
Sandeep Puligillae0875662016-02-12 16:09:21 -08001329 uint32_t obss_width_interval;
1330 uint32_t obss_active_dwelltime;
1331 uint32_t obss_passive_dwelltime;
Abhishek Singh165bc602016-03-21 12:43:00 +05301332 bool ignore_peer_ht_opmode;
Abhishek Singh10ecf582016-05-04 17:48:59 +05301333 bool enable_edca_params;
1334 uint32_t edca_vo_cwmin;
1335 uint32_t edca_vi_cwmin;
1336 uint32_t edca_bk_cwmin;
1337 uint32_t edca_be_cwmin;
1338 uint32_t edca_vo_cwmax;
1339 uint32_t edca_vi_cwmax;
1340 uint32_t edca_bk_cwmax;
1341 uint32_t edca_be_cwmax;
1342 uint32_t edca_vo_aifs;
1343 uint32_t edca_vi_aifs;
1344 uint32_t edca_bk_aifs;
1345 uint32_t edca_be_aifs;
Abhishek Singh5ea86532016-04-27 14:10:53 +05301346 bool enable_fatal_event;
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +05301347 enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode;
Paul Zhang72697bd2017-12-20 09:24:25 +08001348 enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode_nc;
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +05301349 enum wmi_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode;
Agrawal Ashish21ba2572016-09-03 16:40:10 +05301350 struct csr_sta_roam_policy_params sta_roam_policy_params;
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05301351 uint32_t tx_aggregation_size;
1352 uint32_t rx_aggregation_size;
Kapil Gupta5cda2252016-12-29 18:44:26 +05301353 struct wmi_per_roam_config per_roam_config;
Selvaraj, Sridhar4f684bb2017-01-19 15:59:23 +05301354 bool enable_bcast_probe_rsp;
Vignesh Viswanathan32761e42017-09-25 17:10:54 +05301355 bool is_fils_enabled;
Krishna Kumaar Natarajan90bb6f12017-03-03 21:05:52 -08001356#ifdef WLAN_FEATURE_11AX
1357 bool enable_ul_ofdma;
1358 bool enable_ul_mimo;
1359#endif
Paul Zhang99fe8842017-12-08 14:43:46 +08001360 uint16_t wlm_latency_enable;
1361 uint16_t wlm_latency_level;
1362 uint32_t wlm_latency_flags[CSR_NUM_WLM_LATENCY_LEVEL];
Selvaraj, Sridhara521aab2017-03-25 16:42:34 +05301363 bool qcn_ie_support;
Selvaraj, Sridhar97ce6582017-01-20 17:06:34 +05301364 uint8_t fils_max_chan_guard_time;
Naveen Rawat2b6e3c92017-03-20 13:59:07 -07001365 uint16_t pkt_err_disconn_th;
Naveen Rawatb2fc4132017-05-10 20:42:05 -07001366 bool is_force_1x1;
Naveen Rawat247a8682017-06-05 15:00:31 -07001367 uint16_t num_11b_tx_chains;
1368 uint16_t num_11ag_tx_chains;
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05301369 uint32_t disallow_duration;
1370 uint32_t rssi_channel_penalization;
1371 uint32_t num_disallowed_aps;
Himanshu Agarwal8bcec572017-09-28 11:54:37 +05301372 struct sir_score_config bss_score_params;
Yeshwanth Sriram Guntuka2ba6fe92017-10-04 14:40:45 +05301373 uint8_t oce_feature_bitmap;
Vignesh Viswanathan9dd88d32017-11-22 14:22:03 +05301374 struct csr_mbo_thresholds mbo_thresholds;
yeshwanth sriram guntuka41f936c2017-09-01 17:53:49 +05301375 uint32_t btm_offload_config;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001376} tCsrConfigParam;
1377
1378/* Tush */
1379typedef struct tagCsrUpdateConfigParam {
1380 tCsr11dinfo Csr11dinfo;
1381} tCsrUpdateConfigParam;
1382#ifdef WLAN_FEATURE_ROAM_OFFLOAD
1383#define csr_roamIsRoamOffloadEnabled(pMac) \
1384 (pMac->roam.configParam.isRoamOffloadEnabled)
1385#define DEFAULT_REASSOC_FAILURE_TIMEOUT 1000
Sridhar Selvaraje5260442017-08-19 10:12:03 +05301386#else
1387#define csr_roamIsRoamOffloadEnabled(pMac) false
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001388#endif
1389
1390#ifdef WLAN_FEATURE_ROAM_OFFLOAD
1391/* connected but not authenticated */
1392#define CSR_ROAM_AUTH_STATUS_CONNECTED 0x1
1393/* connected and authenticated */
1394#define CSR_ROAM_AUTH_STATUS_AUTHENTICATED 0x2
1395#endif
1396
Jeff Johnson172237b2017-11-07 15:32:59 -08001397struct csr_roam_info {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001398 tCsrRoamProfile *pProfile;
1399 tSirBssDescription *pBssDesc;
1400 uint32_t nBeaconLength;
1401 uint32_t nAssocReqLength;
1402 uint32_t nAssocRspLength;
1403 uint32_t nFrameLength;
1404 uint8_t frameType;
1405 /*
1406 * Point to a buffer contain the beacon, assoc req, assoc rsp frame,
1407 * in that order user needs to use nBeaconLength, nAssocReqLength,
1408 * nAssocRspLength to desice where each frame starts and ends.
1409 */
1410 uint8_t *pbFrames;
1411 bool fReassocReq; /* set to true if for re-association */
1412 bool fReassocRsp; /* set to true if for re-association */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301413 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001414 /*
1415 * Only valid in IBSS. this is the peers MAC address for
1416 * eCSR_ROAM_RESULT_IBSS_NEW_PEER or PEER_DEPARTED
1417 */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301418 struct qdf_mac_addr peerMac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001419 tSirResultCodes statusCode;
1420 /* this'd be our own defined or sent from otherBSS(per 802.11spec) */
1421 uint32_t reasonCode;
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +05301422
1423 uint8_t disassoc_reason;
1424
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001425 uint8_t staId; /* Peer stationId when connected */
1426 /*
1427 * The DPU signatures will be sent eventually to TL to help it
1428 * determine the assoc to which a packet belongs to unicast DPU sign
1429 */
1430 uint8_t ucastSig;
1431 uint8_t bcastSig; /* Broadcast DPU signature */
1432 /* false means auth needed from supplicant. true means authenticated */
1433 bool fAuthRequired;
1434 uint8_t sessionId;
1435 uint8_t rsnIELen;
1436 uint8_t *prsnIE;
1437 uint8_t wapiIELen;
1438 uint8_t *pwapiIE;
1439 uint8_t addIELen;
1440 uint8_t *paddIE;
1441 union {
1442 tSirMicFailureInfo *pMICFailureInfo;
1443 tCsrRoamConnectedProfile *pConnectedProfile;
1444 tSirWPSPBCProbeReq *pWPSPBCProbeReq;
1445 } u;
1446 bool wmmEnabledSta; /* set to true if WMM enabled STA */
1447 uint32_t dtimPeriod;
1448#ifdef FEATURE_WLAN_ESE
1449 bool isESEAssoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001450 tSirTsmIE tsmIe;
1451 uint32_t timestamp[2];
1452 uint16_t tsmRoamDelay;
1453 tSirEseBcnReportRsp *pEseBcnReportRsp;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001454#endif
1455 void *pRemainCtx;
1456 uint32_t roc_scan_id;
1457 uint32_t rxChan;
1458#ifdef FEATURE_WLAN_TDLS
Kabilan Kannan32eb5022016-10-04 12:24:50 -07001459 /*
1460 * TDLS parameters to check whether TDLS
1461 * and TDLS channel switch is allowed in the
1462 * AP network
1463 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001464 uint8_t staType;
1465 bool tdls_prohibited; /* per ExtCap in Assoc/Reassoc resp */
1466 bool tdls_chan_swit_prohibited; /* per ExtCap in Assoc/Reassoc resp */
1467#endif
1468 /* Required for indicating the frames to upper layer */
1469 uint32_t beaconLength;
1470 uint8_t *beaconPtr;
1471 uint32_t assocReqLength;
1472 uint8_t *assocReqPtr;
1473 int8_t rxRssi;
1474 tSirSmeDfsEventInd dfs_event;
1475 tSirChanChangeResponse *channelChangeRespEvent;
1476 /* Timing and fine Timing measurement capability clubbed together */
1477 uint8_t timingMeasCap;
1478#ifdef WLAN_FEATURE_ROAM_OFFLOAD
1479 uint8_t roamSynchInProgress;
1480 uint8_t synchAuthStatus;
1481 uint8_t kck[SIR_KCK_KEY_LEN];
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05301482 uint8_t kek[SIR_KEK_KEY_LEN_FILS];
1483 uint8_t kek_len;
1484 uint32_t pmk_len;
1485 uint8_t pmk[SIR_PMK_LEN];
1486 uint8_t pmkid[SIR_PMKID_LEN];
1487 bool update_erp_next_seq_num;
1488 uint16_t next_erp_seq_num;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001489 uint8_t replay_ctr[SIR_REPLAY_CTR_LEN];
Ravi Joshi277ae9b2015-11-13 11:30:43 -08001490 uint8_t subnet_change_status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001491#endif
1492 tSirSmeChanInfo chan_info;
Abhishek Singh518323d2015-10-19 17:42:01 +05301493 uint8_t target_channel;
Ravi Joshi412f23d2016-05-26 15:09:23 -07001494
Naveen Rawatcb5c5402017-03-22 10:12:19 -07001495#ifdef WLAN_FEATURE_NAN_DATAPATH
Ravi Joshi412f23d2016-05-26 15:09:23 -07001496 union {
1497 struct sme_ndp_peer_ind ndp_peer_ind_params;
1498 struct ndp_schedule_update_rsp ndp_sched_upd_rsp_params;
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07001499 struct ndp_end_indication_event *ndp_end_ind_params;
Naveen Rawatf28315c2016-06-29 18:06:02 -07001500 struct ndp_end_rsp_event *ndp_end_rsp_params;
Ravi Joshi412f23d2016-05-26 15:09:23 -07001501 struct ndp_confirm_event ndp_confirm_params;
1502 struct ndp_responder_rsp_event ndp_responder_rsp_params;
1503 struct ndp_indication_event ndp_indication_params;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07001504 struct ndp_initiator_rsp ndp_init_rsp_params;
Ravi Joshi412f23d2016-05-26 15:09:23 -07001505 struct ndi_create_rsp ndi_create_params;
1506 struct ndi_delete_rsp ndi_delete_params;
1507 } ndp;
1508#endif
Anurag Chouhan5de8d172016-07-13 14:44:28 +05301509 tDot11fIEHTCaps ht_caps;
1510 tDot11fIEVHTCaps vht_caps;
1511 tDot11fIEhs20vendor_ie hs20vendor_ie;
1512 tDot11fIEVHTOperation vht_operation;
1513 tDot11fIEHTInfo ht_operation;
1514 bool reassoc;
Will Huang558f8082017-05-31 16:22:24 +08001515 bool ampdu;
1516 bool sgi_enable;
1517 bool tx_stbc;
1518 bool rx_stbc;
1519 tSirMacHTChannelWidth ch_width;
1520 enum sir_sme_phy_mode mode;
1521 uint8_t max_supp_idx;
1522 uint8_t max_ext_idx;
1523 uint8_t max_mcs_idx;
1524 uint8_t rx_mcs_map;
1525 uint8_t tx_mcs_map;
gaolez7bb1e742017-03-21 16:37:38 +08001526 /* Extended capabilities of STA */
1527 uint8_t ecsa_capable;
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301528 bool is_fils_connection;
1529#ifdef WLAN_FEATURE_FILS_SK
1530 uint16_t fils_seq_num;
1531 struct fils_join_rsp_params *fils_join_rsp;
1532#endif
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +05301533 int rssi;
1534 int tx_rate;
1535 int rx_rate;
Jeff Johnson172237b2017-11-07 15:32:59 -08001536};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001537
1538typedef struct tagCsrFreqScanInfo {
1539 uint32_t nStartFreq; /* in unit of MHz */
1540 uint32_t nEndFreq; /* in unit of MHz */
1541 tSirScanType scanType;
1542} tCsrFreqScanInfo;
1543
1544typedef struct sSirSmeAssocIndToUpperLayerCnf {
1545 uint16_t messageType; /* eWNI_SME_ASSOC_CNF */
1546 uint16_t length;
1547 uint8_t sessionId;
1548 tSirResultCodes statusCode;
1549 tSirMacAddr bssId; /* Self BSSID */
1550 tSirMacAddr peerMacAddr;
1551 uint16_t aid;
1552 tSirMacAddr alternateBssId;
1553 uint8_t alternateChannelId;
1554 uint8_t wmmEnabledSta; /* set to true if WMM enabled STA */
1555 tSirRSNie rsnIE; /* RSN IE received from peer */
1556 tSirWAPIie wapiIE; /* WAPI IE received from peer */
1557 tSirAddie addIE; /* this can be WSC and/or P2P IE */
1558 uint8_t reassocReq; /* set to true if reassoc */
1559 /* Timing and fine Timing measurement capability clubbed together */
1560 uint8_t timingMeasCap;
1561 tSirSmeChanInfo chan_info;
Abhishek Singh518323d2015-10-19 17:42:01 +05301562 uint8_t target_channel;
Will Huang558f8082017-05-31 16:22:24 +08001563 bool ampdu;
1564 bool sgi_enable;
1565 bool tx_stbc;
1566 tSirMacHTChannelWidth ch_width;
1567 enum sir_sme_phy_mode mode;
1568 bool rx_stbc;
1569 uint8_t max_supp_idx;
1570 uint8_t max_ext_idx;
1571 uint8_t max_mcs_idx;
1572 uint8_t rx_mcs_map;
1573 uint8_t tx_mcs_map;
gaolez7bb1e742017-03-21 16:37:38 +08001574 /* Extended capabilities of STA */
1575 uint8_t ecsa_capable;
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +05301576
1577 tDot11fIEHTCaps ht_caps;
1578 tDot11fIEVHTCaps vht_caps;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001579} tSirSmeAssocIndToUpperLayerCnf, *tpSirSmeAssocIndToUpperLayerCnf;
1580
1581typedef struct tagCsrSummaryStatsInfo {
Naveen Rawat2cb788d2016-10-11 17:44:44 -07001582 uint32_t snr;
1583 uint32_t rssi;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001584 uint32_t retry_cnt[4];
1585 uint32_t multiple_retry_cnt[4];
1586 uint32_t tx_frm_cnt[4];
1587 /* uint32_t num_rx_frm_crc_err; same as rx_error_cnt */
1588 /* uint32_t num_rx_frm_crc_ok; same as rx_frm_cnt */
1589 uint32_t rx_frm_cnt;
1590 uint32_t frm_dup_cnt;
1591 uint32_t fail_cnt[4];
1592 uint32_t rts_fail_cnt;
1593 uint32_t ack_fail_cnt;
1594 uint32_t rts_succ_cnt;
1595 uint32_t rx_discard_cnt;
1596 uint32_t rx_error_cnt;
1597 uint32_t tx_byte_cnt;
1598
1599} tCsrSummaryStatsInfo;
1600
1601typedef struct tagCsrGlobalClassAStatsInfo {
Jeff Johnsonad0b2c62017-03-16 14:37:38 -07001602 uint32_t nss;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001603 uint32_t max_pwr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001604 uint32_t tx_rate;
1605 /* mcs index for HT20 and HT40 rates */
1606 uint32_t mcs_index;
Jeff Johnsonad0b2c62017-03-16 14:37:38 -07001607 uint32_t mcs_rate_flags;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001608 /* to diff between HT20 & HT40 rates;short & long guard interval */
1609 uint32_t tx_rate_flags;
1610
1611} tCsrGlobalClassAStatsInfo;
1612
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001613typedef struct tagCsrGlobalClassDStatsInfo {
1614 uint32_t tx_uc_frm_cnt;
1615 uint32_t tx_mc_frm_cnt;
1616 uint32_t tx_bc_frm_cnt;
1617 uint32_t rx_uc_frm_cnt;
1618 uint32_t rx_mc_frm_cnt;
1619 uint32_t rx_bc_frm_cnt;
1620 uint32_t tx_uc_byte_cnt[4];
1621 uint32_t tx_mc_byte_cnt;
1622 uint32_t tx_bc_byte_cnt;
1623 uint32_t rx_uc_byte_cnt[4];
1624 uint32_t rx_mc_byte_cnt;
1625 uint32_t rx_bc_byte_cnt;
1626 uint32_t rx_byte_cnt;
1627 uint32_t num_rx_bytes_crc_ok;
1628 uint32_t rx_rate;
1629
1630} tCsrGlobalClassDStatsInfo;
1631
Himanshu Agarwal37e42412016-07-21 14:35:09 +05301632/**
1633 * struct csr_per_chain_rssi_stats_info - stores chain rssi
1634 * @rssi: array containing rssi for all chains
1635 * @peer_mac_addr: peer mac address
1636 */
1637struct csr_per_chain_rssi_stats_info {
1638 int8_t rssi[NUM_CHAINS_MAX];
1639 tSirMacAddr peer_mac_addr;
1640};
1641
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001642typedef struct tagCsrRoamSetKey {
1643 eCsrEncryptionType encType;
1644 tAniKeyDirection keyDirection; /* Tx, Rx or Tx-and-Rx */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301645 struct qdf_mac_addr peerMac; /* Peer MAC. ALL 1's for group key */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001646 uint8_t paeRole; /* 0 for supplicant */
1647 uint8_t keyId; /* Key index */
1648 uint16_t keyLength; /* Number of bytes containing the key in pKey */
1649 uint8_t Key[CSR_MAX_KEY_LEN];
1650 uint8_t keyRsc[CSR_MAX_RSC_LEN];
1651} tCsrRoamSetKey;
1652
1653typedef struct tagCsrRoamRemoveKey {
1654 eCsrEncryptionType encType;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301655 struct qdf_mac_addr peerMac; /* Peer MAC. ALL 1's for group key */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001656 uint8_t keyId; /* key index */
1657} tCsrRoamRemoveKey;
1658
1659#ifdef FEATURE_WLAN_TDLS
1660
1661typedef struct tagCsrLinkEstablishParams {
1662 tSirMacAddr peerMac;
1663 uint8_t uapsdQueues;
1664 uint8_t maxSp;
1665 uint8_t isBufSta;
1666 uint8_t isOffChannelSupported;
1667 uint8_t isResponder;
1668 uint8_t supportedChannelsLen;
1669 uint8_t supportedChannels[SIR_MAC_MAX_SUPP_CHANNELS];
1670 uint8_t supportedOperClassesLen;
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -07001671 uint8_t supportedOperClasses[REG_MAX_SUPP_OPER_CLASSES];
Agrawal Ashishd3f22f62016-09-04 13:46:15 +05301672 uint8_t qos;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001673} tCsrTdlsLinkEstablishParams;
1674
1675typedef struct tagCsrTdlsSendMgmt {
1676 tSirMacAddr peerMac;
1677 uint8_t frameType;
1678 uint8_t dialog;
1679 uint16_t statusCode;
1680 uint8_t responder;
1681 uint32_t peerCapability;
1682 uint8_t *buf;
1683 uint8_t len;
Ganesh Kondabattinidd726522017-05-10 18:09:37 +05301684 enum wifi_traffic_ac ac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001685} tCsrTdlsSendMgmt;
1686#endif
1687
1688typedef void *tScanResultHandle;
1689
1690typedef enum {
1691 REASSOC = 0,
Varun Reddy Yeturu3e91dad2016-07-18 15:58:47 -07001692 FASTREASSOC = 1,
1693 CONNECT_CMD_USERSPACE = 2,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001694} handoff_src;
1695
1696typedef struct tagCsrHandoffRequest {
Anurag Chouhan6d760662016-02-20 16:05:43 +05301697 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001698 uint8_t channel;
1699 uint8_t src; /* To check if its a REASSOC or a FASTREASSOC IOCTL */
1700} tCsrHandoffRequest;
1701
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001702#ifdef FEATURE_WLAN_ESE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001703typedef struct tagCsrEseBeaconReqParams {
1704 uint16_t measurementToken;
1705 uint8_t channel;
1706 uint8_t scanMode;
1707 uint16_t measurementDuration;
1708} tCsrEseBeaconReqParams, *tpCsrEseBeaconReqParams;
1709
1710typedef struct tagCsrEseBeaconReq {
1711 uint8_t numBcnReqIe;
1712 tCsrEseBeaconReqParams bcnReq[SIR_ESE_MAX_MEAS_IE_REQS];
1713} tCsrEseBeaconReq, *tpCsrEseBeaconReq;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001714#endif /* FEATURE_WLAN_ESE */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001715
Jeff Johnsone6bf7192017-11-07 15:16:09 -08001716struct csr_del_sta_params {
Anurag Chouhan6d760662016-02-20 16:05:43 +05301717 struct qdf_mac_addr peerMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001718 uint16_t reason_code;
1719 uint8_t subtype;
1720};
1721
Masti, Narayanraddiab712a72016-08-04 11:59:11 +05301722/**
1723 * struct wep_update_default_key_idx: wep default key index structure
1724 * @session_id: session ID for the connection session
1725 * @default_idx: default key index for wep
1726 *
1727 * structure includes sesssion id for connection and default key
1728 * index used for wep
1729 */
1730struct wep_update_default_key_idx {
1731 uint8_t session_id;
1732 uint8_t default_idx;
1733};
1734
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001735/*
1736 * NOTE: p2 is the second context pass in for the caller
1737 * NOTE: what if callback is called before requester gets the scanId??
1738 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301739typedef QDF_STATUS (*csr_scan_completeCallback)(tHalHandle, void *p2,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001740 uint8_t sessionId,
1741 uint32_t scanID,
1742 eCsrScanStatus status);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301743typedef QDF_STATUS (*csr_roam_completeCallback)(void *pContext,
Jeff Johnson172237b2017-11-07 15:32:59 -08001744 struct csr_roam_info *pParam,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001745 uint32_t roamId,
1746 eRoamCmdStatus roamStatus,
1747 eCsrRoamResult roamResult);
Krunal Soni8d184fa2017-11-20 21:52:05 -08001748typedef QDF_STATUS (*csr_session_open_cb)(uint8_t session_id);
1749typedef QDF_STATUS (*csr_session_close_cb)(uint8_t session_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001750
1751#define CSR_IS_START_IBSS(pProfile) (eCSR_BSS_TYPE_START_IBSS == \
1752 (pProfile)->BSSType)
1753#define CSR_IS_JOIN_TO_IBSS(pProfile) (eCSR_BSS_TYPE_IBSS == \
1754 (pProfile)->BSSType)
1755#define CSR_IS_IBSS(pProfile) (CSR_IS_START_IBSS(pProfile) || \
1756 CSR_IS_JOIN_TO_IBSS(pProfile))
1757#define CSR_IS_INFRASTRUCTURE(pProfile) (eCSR_BSS_TYPE_INFRASTRUCTURE == \
1758 (pProfile)->BSSType)
1759#define CSR_IS_ANY_BSS_TYPE(pProfile) (eCSR_BSS_TYPE_ANY == \
1760 (pProfile)->BSSType)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001761#define CSR_IS_INFRA_AP(pProfile) (eCSR_BSS_TYPE_INFRA_AP == \
1762 (pProfile)->BSSType)
Deepak Dhamdheree2dd5442016-05-27 15:05:51 -07001763#ifdef WLAN_FEATURE_NAN_DATAPATH
1764#define CSR_IS_NDI(profile) (eCSR_BSS_TYPE_NDI == (profile)->BSSType)
1765#else
1766#define CSR_IS_NDI(profile) (false)
1767#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001768#define CSR_IS_CONN_INFRA_AP(pProfile) (eCSR_BSS_TYPE_INFRA_AP == \
1769 (pProfile)->BSSType)
Deepak Dhamdheree2dd5442016-05-27 15:05:51 -07001770#ifdef WLAN_FEATURE_NAN_DATAPATH
1771#define CSR_IS_CONN_NDI(profile) (eCSR_BSS_TYPE_NDI == (profile)->BSSType)
1772#else
1773#define CSR_IS_CONN_NDI(profile) (false)
1774#endif
1775
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301776QDF_STATUS csr_set_channels(tHalHandle hHal, tCsrConfigParam *pParam);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001777
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001778/* enum to string conversion for debug output */
1779const char *get_e_roam_cmd_status_str(eRoamCmdStatus val);
1780const char *get_e_csr_roam_result_str(eCsrRoamResult val);
Varun Reddy Yeturua48bc412017-11-17 15:33:35 -08001781QDF_STATUS csr_set_phy_mode(tHalHandle hHal, uint32_t phyMode,
1782 enum band_info eBand, bool *pfRestartNeeded);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001783typedef void (*csr_roamLinkQualityIndCallback)
1784 (eCsrRoamLinkQualityInd ind, void *pContext);
1785typedef void (*tCsrStatsCallback)(void *stats, void *pContext);
1786typedef void (*tCsrRssiCallback)(int8_t rssi, uint32_t staId, void *pContext);
1787
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001788#ifdef FEATURE_WLAN_ESE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001789typedef void (*tCsrTsmStatsCallback)(tAniTrafStrmMetrics tsmMetrics,
1790 uint32_t staId, void *pContext);
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001791#endif /* FEATURE_WLAN_ESE */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001792typedef void (*tCsrSnrCallback)(int8_t snr, uint32_t staId, void *pContext);
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -08001793#ifdef WLAN_FEATURE_HOST_ROAM
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301794QDF_STATUS csr_roam_issue_ft_preauth_req(tHalHandle hHal, uint32_t sessionId,
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -08001795 tpSirBssDescription pBssDescription);
1796#else
1797static inline QDF_STATUS csr_roam_issue_ft_preauth_req(tHalHandle hHal,
1798 uint32_t sessionId, tpSirBssDescription pBssDescription)
1799{
1800 return QDF_STATUS_E_NOSUPPORT;
1801}
1802#endif
Varun Reddy Yeturua48bc412017-11-17 15:33:35 -08001803QDF_STATUS csr_set_band(tHalHandle hHal, uint8_t sessionId,
1804 enum band_info eBand);
1805enum band_info csr_get_current_band(tHalHandle hHal);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001806typedef void (*csr_readyToSuspendCallback)(void *pContext, bool suspended);
1807#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
1808typedef void (*csr_readyToExtWoWCallback)(void *pContext, bool status);
1809#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001810typedef void (*tCsrLinkStatusCallback)(uint8_t status, void *pContext);
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08001811#ifdef FEATURE_WLAN_TDLS
Jeff Johnson172237b2017-11-07 15:32:59 -08001812void csr_roam_fill_tdls_info(tpAniSirGlobal mac_ctx,
1813 struct csr_roam_info *roam_info,
1814 tpSirSmeJoinRsp join_rsp);
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08001815#else
Jeff Johnson172237b2017-11-07 15:32:59 -08001816static inline void csr_roam_fill_tdls_info(tpAniSirGlobal mac_ctx,
1817 struct csr_roam_info *roam_info,
1818 tpSirSmeJoinRsp join_rsp)
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08001819{}
1820#endif
Himanshu Agarwalf65bd4c2016-12-05 17:21:12 +05301821void csr_packetdump_timer_stop(void);
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08001822
gaoleze5108942017-03-31 16:56:42 +08001823/**
1824 * csr_get_channel_status() - get chan info via channel number
1825 * @p_mac: Pointer to Global MAC structure
1826 * @channel_id: channel id
1827 *
1828 * Return: chan status info
1829 */
1830struct lim_channel_status *csr_get_channel_status(void *p_mac,
1831 uint32_t channel_id);
1832
1833/**
1834 * csr_clear_channel_status() - clear chan info
1835 * @p_mac: Pointer to Global MAC structure
1836 *
1837 * Return: none
1838 */
1839void csr_clear_channel_status(void *p_mac);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001840#endif