blob: 9079f20bb897fcf2f48b092098f6ca4ed287ed71 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Jeff Johnson2f98db32018-12-27 18:26:03 -08002 * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080019/**
20 * \file csr_api.h
21 *
22 * Exports and types for the Common Scan and Roaming Module interfaces.
23 */
24
25#ifndef CSRAPI_H__
26#define CSRAPI_H__
27
28#include "sir_api.h"
29#include "sir_mac_prot_def.h"
30#include "csr_link_list.h"
Sandeep Puligillaf5ccbf62018-03-26 16:37:05 -070031#include "wlan_scan_public_structs.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080032
33#define CSR_INVALID_SCANRESULT_HANDLE (NULL)
34
35typedef enum {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080036 /* never used */
37 eCSR_AUTH_TYPE_NONE,
38 /* MAC layer authentication types */
39 eCSR_AUTH_TYPE_OPEN_SYSTEM,
40 eCSR_AUTH_TYPE_SHARED_KEY,
Padma, Santhosh Kumar07eb80b2017-07-05 16:10:06 +053041 eCSR_AUTH_TYPE_SAE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080042 eCSR_AUTH_TYPE_AUTOSWITCH,
43
44 /* Upper layer authentication types */
45 eCSR_AUTH_TYPE_WPA,
46 eCSR_AUTH_TYPE_WPA_PSK,
47 eCSR_AUTH_TYPE_WPA_NONE,
48
49 eCSR_AUTH_TYPE_RSN,
50 eCSR_AUTH_TYPE_RSN_PSK,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080051 eCSR_AUTH_TYPE_FT_RSN,
52 eCSR_AUTH_TYPE_FT_RSN_PSK,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080053#ifdef FEATURE_WLAN_WAPI
54 eCSR_AUTH_TYPE_WAPI_WAI_CERTIFICATE,
55 eCSR_AUTH_TYPE_WAPI_WAI_PSK,
56#endif /* FEATURE_WLAN_WAPI */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080057 eCSR_AUTH_TYPE_CCKM_WPA,
58 eCSR_AUTH_TYPE_CCKM_RSN,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080059 eCSR_AUTH_TYPE_RSN_PSK_SHA256,
60 eCSR_AUTH_TYPE_RSN_8021X_SHA256,
Sridhar Selvaraj6cf642f2017-08-21 14:28:10 +053061 eCSR_AUTH_TYPE_FILS_SHA256,
62 eCSR_AUTH_TYPE_FILS_SHA384,
63 eCSR_AUTH_TYPE_FT_FILS_SHA256,
64 eCSR_AUTH_TYPE_FT_FILS_SHA384,
Abhishek Singh02cb9e02017-08-30 17:39:50 +053065 eCSR_AUTH_TYPE_DPP_RSN,
Padma, Santhosh Kumarc69ce072017-11-06 18:21:05 +053066 eCSR_AUTH_TYPE_OWE,
Padma, Santhosh Kumare587a5c2017-12-21 12:44:46 +053067 eCSR_AUTH_TYPE_SUITEB_EAP_SHA256,
68 eCSR_AUTH_TYPE_SUITEB_EAP_SHA384,
Srinivas Dasarib328f1a2018-12-18 17:45:06 +053069 eCSR_AUTH_TYPE_OSEN,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080070 eCSR_NUM_OF_SUPPORT_AUTH_TYPE,
71 eCSR_AUTH_TYPE_FAILED = 0xff,
72 eCSR_AUTH_TYPE_UNKNOWN = eCSR_AUTH_TYPE_FAILED,
73
74} eCsrAuthType;
75
76typedef enum {
77 eCSR_ENCRYPT_TYPE_NONE,
78 eCSR_ENCRYPT_TYPE_WEP40_STATICKEY,
79 eCSR_ENCRYPT_TYPE_WEP104_STATICKEY,
80 eCSR_ENCRYPT_TYPE_WEP40,
81 eCSR_ENCRYPT_TYPE_WEP104,
82 eCSR_ENCRYPT_TYPE_TKIP,
Mukul Sharma05504ac2017-06-08 12:35:53 +053083 eCSR_ENCRYPT_TYPE_AES,/* CCMP */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080084#ifdef FEATURE_WLAN_WAPI
85 /* WAPI */
86 eCSR_ENCRYPT_TYPE_WPI,
87#endif /* FEATURE_WLAN_WAPI */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080088 eCSR_ENCRYPT_TYPE_KRK,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080089 eCSR_ENCRYPT_TYPE_BTK,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080090 eCSR_ENCRYPT_TYPE_AES_CMAC,
Padma, Santhosh Kumar4117d7a2017-12-20 17:39:33 +053091 eCSR_ENCRYPT_TYPE_AES_GMAC_128,
92 eCSR_ENCRYPT_TYPE_AES_GMAC_256,
Mukul Sharma05504ac2017-06-08 12:35:53 +053093 eCSR_ENCRYPT_TYPE_AES_GCMP,
94 eCSR_ENCRYPT_TYPE_AES_GCMP_256,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080095 eCSR_ENCRYPT_TYPE_ANY,
96 eCSR_NUM_OF_ENCRYPT_TYPE = eCSR_ENCRYPT_TYPE_ANY,
97
98 eCSR_ENCRYPT_TYPE_FAILED = 0xff,
99 eCSR_ENCRYPT_TYPE_UNKNOWN = eCSR_ENCRYPT_TYPE_FAILED,
100
101} eCsrEncryptionType;
102
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800103typedef enum {
104 /* 11a/b/g only, no HT, no proprietary */
105 eCSR_DOT11_MODE_abg = 0x0001,
106 eCSR_DOT11_MODE_11a = 0x0002,
107 eCSR_DOT11_MODE_11b = 0x0004,
108 eCSR_DOT11_MODE_11g = 0x0008,
109 eCSR_DOT11_MODE_11n = 0x0010,
110 eCSR_DOT11_MODE_11g_ONLY = 0x0020,
111 eCSR_DOT11_MODE_11n_ONLY = 0x0040,
112 eCSR_DOT11_MODE_11b_ONLY = 0x0080,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800113 eCSR_DOT11_MODE_11ac = 0x0100,
114 eCSR_DOT11_MODE_11ac_ONLY = 0x0200,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800115 /*
116 * This is for WIFI test. It is same as eWNIAPI_MAC_PROTOCOL_ALL
117 * except when it starts IBSS in 11B of 2.4GHz
118 * It is for CSR internal use
119 */
120 eCSR_DOT11_MODE_AUTO = 0x0400,
Krishna Kumaar Natarajan4f1d7722017-03-03 21:12:51 -0800121 eCSR_DOT11_MODE_11ax = 0x0800,
122 eCSR_DOT11_MODE_11ax_ONLY = 0x1000,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800123
124 /* specify the number of maximum bits for phyMode */
125 eCSR_NUM_PHY_MODE = 16,
126} eCsrPhyMode;
127
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700128/**
129 * enum eCsrRoamBssType - BSS type in CSR operations
130 * @eCSR_BSS_TYPE_INFRASTRUCTURE: Infrastructure station
131 * @eCSR_BSS_TYPE_INFRA_AP: SoftAP
132 * @eCSR_BSS_TYPE_IBSS: IBSS network we'll not start
133 * @eCSR_BSS_TYPE_START_IBSS: IBSS network we'll start if no partners found
134 * @eCSR_BSS_TYPE_NDI: NAN datapath interface
135 * @eCSR_BSS_TYPE_ANY: any BSS type (IBSS or Infrastructure)
136 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800137typedef enum {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800138 eCSR_BSS_TYPE_INFRASTRUCTURE,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700139 eCSR_BSS_TYPE_INFRA_AP,
140 eCSR_BSS_TYPE_IBSS,
141 eCSR_BSS_TYPE_START_IBSS,
142 eCSR_BSS_TYPE_NDI,
143 eCSR_BSS_TYPE_ANY,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800144} eCsrRoamBssType;
145
146typedef enum {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800147 eCSR_SCAN_SUCCESS,
148 eCSR_SCAN_FAILURE,
149 eCSR_SCAN_ABORT,
150 eCSR_SCAN_FOUND_PEER,
151} eCsrScanStatus;
152
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800153typedef enum {
154 eCSR_BW_20MHz_VAL = 20,
155 eCSR_BW_40MHz_VAL = 40,
156 eCSR_BW_80MHz_VAL = 80,
157 eCSR_BW_160MHz_VAL = 160
158} eCSR_BW_Val;
159
160typedef enum {
161 eCSR_INI_SINGLE_CHANNEL_CENTERED = 0,
162 eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY,
163 eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800164 eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED,
165 eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED,
166 eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED,
167 eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW,
168 eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW,
169 eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH,
170 eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800171 eCSR_INI_CHANNEL_BONDING_STATE_MAX
172} eIniChanBondState;
173
174#define CSR_RSN_PMKID_SIZE 16
Sridhar Selvarajc3684c72017-08-21 14:32:47 +0530175#define CSR_RSN_MAX_PMK_LEN 48
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800176#define CSR_MAX_PMKID_ALLOWED 32
177#define CSR_WEP40_KEY_LEN 5
178#define CSR_WEP104_KEY_LEN 13
179#define CSR_TKIP_KEY_LEN 32
180#define CSR_AES_KEY_LEN 16
Mukul Sharma05504ac2017-06-08 12:35:53 +0530181#define CSR_AES_GCMP_KEY_LEN 16
182#define CSR_AES_GCMP_256_KEY_LEN 32
Padma, Santhosh Kumar4117d7a2017-12-20 17:39:33 +0530183#define CSR_AES_GMAC_128_KEY_LEN 16
184#define CSR_AES_GMAC_256_KEY_LEN 32
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800185#define CSR_MAX_TX_POWER (WNI_CFG_CURRENT_TX_POWER_LEVEL_STAMAX)
186#define CSR_MAX_RSC_LEN 16
187#ifdef FEATURE_WLAN_WAPI
188#define CSR_WAPI_BKID_SIZE 16
189#define CSR_MAX_BKID_ALLOWED 16
190#define CSR_WAPI_KEY_LEN 32
191#define CSR_MAX_KEY_LEN (CSR_WAPI_KEY_LEN) /* longest one is for WAPI */
192#else
193#define CSR_MAX_KEY_LEN (CSR_TKIP_KEY_LEN) /* longest one is for TKIP */
194#endif /* FEATURE_WLAN_WAPI */
195#ifdef FEATURE_WLAN_ESE
196#define CSR_KRK_KEY_LEN 16
197#endif
198
199typedef struct tagCsrChannelInfo {
200 uint8_t numOfChannels;
201 uint8_t *ChannelList; /* it will be an array of channels */
202} tCsrChannelInfo, *tpCsrChannelInfo;
203
lifeng21b7b8b2017-06-22 17:32:21 +0800204typedef enum {
205 eHIDDEN_SSID_NOT_IN_USE,
206 eHIDDEN_SSID_ZERO_LEN,
207 eHIDDEN_SSID_ZERO_CONTENTS
208} tHiddenssId;
209
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800210typedef struct tagCsrSSIDInfo {
211 tSirMacSSid SSID;
212 bool handoffPermitted;
lifeng21b7b8b2017-06-22 17:32:21 +0800213 tHiddenssId ssidHidden;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800214} tCsrSSIDInfo;
215
216typedef struct tagCsrSSIDs {
217 uint32_t numOfSSIDs;
218 tCsrSSIDInfo *SSIDList; /* To be allocated for array of SSIDs */
219} tCsrSSIDs;
220
221typedef struct tagCsrBSSIDs {
222 uint32_t numOfBSSIDs;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530223 struct qdf_mac_addr *bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800224} tCsrBSSIDs;
225
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800226typedef struct tagCsrScanResultInfo {
227 /*
228 * Carry the IEs for the current BSSDescription.
229 * A pointer to tDot11fBeaconIEs. Maybe NULL for start BSS.
230 */
231 void *pvIes;
232 tAniSSID ssId;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530233 unsigned long timer; /* timer is variable for hidden SSID timer */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800234 /*
235 * This member must be the last in the structure because the
236 * end of tSirBssDescription is an
237 * array with nonknown size at this time */
238 tSirBssDescription BssDescriptor;
239} tCsrScanResultInfo;
240
241typedef struct tagCsrEncryptionList {
242
243 uint32_t numEntries;
244 eCsrEncryptionType encryptionType[eCSR_NUM_OF_ENCRYPT_TYPE];
245
246} tCsrEncryptionList, *tpCsrEncryptionList;
247
248typedef struct tagCsrAuthList {
249 uint32_t numEntries;
250 eCsrAuthType authType[eCSR_NUM_OF_SUPPORT_AUTH_TYPE];
251} tCsrAuthList, *tpCsrAuthList;
252
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800253#ifdef FEATURE_WLAN_ESE
254typedef struct tagCsrEseCckmInfo {
255 uint32_t reassoc_req_num;
256 bool krk_plumbed;
257 uint8_t krk[SIR_KRK_KEY_LEN];
258#ifdef WLAN_FEATURE_ROAM_OFFLOAD
259 uint8_t btk[SIR_BTK_KEY_LEN];
260#endif
261} tCsrEseCckmInfo;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800262
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800263typedef struct tagCsrEseCckmIe {
Ashish Kumar Dhanotiya69e72bd2018-03-26 20:30:32 +0530264 uint8_t cckmIe[DOT11F_IE_RSN_MAX_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800265 uint8_t cckmIeLen;
266} tCsrEseCckmIe;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800267#endif /* FEATURE_WLAN_ESE */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800268
269typedef struct sCsrChannel_ {
270 uint8_t numChannels;
Wu Gao0821b0d2019-01-11 17:31:11 +0800271 uint8_t channelList[CFG_VALID_CHANNEL_LIST_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800272} sCsrChannel;
273
274typedef struct tagCsrScanResultFilter {
275 tCsrBSSIDs BSSIDs;
276 tCsrSSIDs SSIDs;
277 tCsrChannelInfo ChannelInfo;
278 tCsrAuthList authType;
279 tCsrEncryptionList EncryptionType;
280 /*
281 * eCSR_ENCRYPT_TYPE_ANY cannot be set in multicast encryption type.
282 * If caller doesn't case, put all supported encryption types in here
283 */
284 tCsrEncryptionList mcEncryptionType;
285 eCsrRoamBssType BSSType;
286 /* its a bit mask of all the needed phy mode defined in eCsrPhyMode */
287 eCsrPhyMode phyMode;
288 /*
289 * If countryCode[0] is not 0, countryCode is checked
290 * independent of fCheckUnknownCountryCode
291 */
Wu Gaoaa155142019-01-14 15:09:26 +0800292 uint8_t countryCode[CFG_COUNTRY_CODE_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800293 uint8_t uapsd_mask;
294 /* For WPS filtering if true => auth and ecryption should be ignored */
295 bool bWPSAssociation;
296 bool bOSENAssociation;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800297 /*
298 * For measurement reports --> if set, only SSID,
299 * BSSID and channel is considered for filtering.
300 */
301 bool fMeasurement;
Jeff Johnson9e760832018-12-15 12:41:36 -0800302 struct mobility_domain_info mdid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800303 bool p2pResult;
304#ifdef WLAN_FEATURE_11W
305 /* Management Frame Protection */
306 bool MFPEnabled;
307 uint8_t MFPRequired;
308 uint8_t MFPCapable;
309#endif
310 /* The following flag is used to distinguish the
311 * roaming case while building the scan filter and
312 * applying it on to the scan results. This is mainly
313 * used to support whitelist ssid feature.
314 */
315 uint8_t scan_filter_for_roam;
316 struct sCsrChannel_ pcl_channels;
Abhishek Singh3c9910e2017-01-06 17:56:47 +0530317 struct qdf_mac_addr bssid_hint;
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800318 enum QDF_OPMODE csrPersona;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +0530319 bool realm_check;
320 uint8_t fils_realm[2];
Abhishek Singhedb73602018-02-20 15:20:26 +0530321 bool force_rsne_override;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800322} tCsrScanResultFilter;
323
324typedef struct sCsrChnPower_ {
325 uint8_t firstChannel;
326 uint8_t numChannels;
327 uint8_t maxtxPower;
328} sCsrChnPower;
329
330typedef struct tagCsr11dinfo {
331 sCsrChannel Channels;
Wu Gaoaa155142019-01-14 15:09:26 +0800332 uint8_t countryCode[CFG_COUNTRY_CODE_LEN + 1];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800333 /* max power channel list */
Wu Gao0821b0d2019-01-11 17:31:11 +0800334 sCsrChnPower ChnPower[CFG_VALID_CHANNEL_LIST_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800335} tCsr11dinfo;
336
337typedef enum {
338 eCSR_ROAM_CANCELLED = 1,
339 /* it means error happens before assoc_start/roaming_start is called. */
340 eCSR_ROAM_FAILED,
341 /*
342 * a CSR trigger roaming operation starts,
343 * callback may get a pointer to tCsrConnectedProfile
344 */
345 eCSR_ROAM_ROAMING_START,
346 /* a CSR trigger roaming operation is completed */
347 eCSR_ROAM_ROAMING_COMPLETION,
348 /* Connection completed status. */
349 eCSR_ROAM_CONNECT_COMPLETION,
350 /*
351 * an association or start_IBSS operation starts,
Jeff Johnson66ee8a92018-03-17 15:24:26 -0700352 * callback may get a pointer to struct csr_roam_profile and
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800353 * a pointer to tSirBssDescription
354 */
355 eCSR_ROAM_ASSOCIATION_START,
356 /*
357 * a roaming operation is finish, see eCsrRoamResult for
358 * possible data passed back
359 */
360 eCSR_ROAM_ASSOCIATION_COMPLETION,
361 eCSR_ROAM_DISASSOCIATED,
362 eCSR_ROAM_ASSOCIATION_FAILURE,
363 /* when callback with this flag. it gets a pointer to the BSS desc. */
364 eCSR_ROAM_SHOULD_ROAM,
365 /* A new candidate for PMKID is found */
366 eCSR_ROAM_SCAN_FOUND_NEW_BSS,
367 /* CSR is done lostlink roaming and still cannot reconnect */
368 eCSR_ROAM_LOSTLINK,
369 /* a link lost is detected. CSR starts roaming. */
370 eCSR_ROAM_LOSTLINK_DETECTED,
371 /*
372 * TKIP MIC error detected, callback gets a pointer
373 * to tpSirSmeMicFailureInd
374 */
375 eCSR_ROAM_MIC_ERROR_IND,
376 /* IBSS indications. */
377 eCSR_ROAM_IBSS_IND,
378 /*
379 * Update the connection status, useful for IBSS: new peer added,
380 * network is active etc.
381 */
382 eCSR_ROAM_CONNECT_STATUS_UPDATE,
383 eCSR_ROAM_GEN_INFO,
384 eCSR_ROAM_SET_KEY_COMPLETE,
385 eCSR_ROAM_IBSS_LEAVE, /* IBSS indications. */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800386 /* BSS in SoftAP mode status indication */
387 eCSR_ROAM_INFRA_IND,
388 eCSR_ROAM_WPS_PBC_PROBE_REQ_IND,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800389 eCSR_ROAM_FT_RESPONSE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800390 eCSR_ROAM_FT_START,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800391 /* this mean error happens before assoc_start/roam_start is called. */
392 eCSR_ROAM_SESSION_OPENED,
393 eCSR_ROAM_FT_REASSOC_FAILED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800394 eCSR_ROAM_PMK_NOTIFY,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800395 /*
396 * Following 4 enums are used by FEATURE_WLAN_LFR_METRICS
397 * but they are needed for compilation even when
398 * FEATURE_WLAN_LFR_METRICS is not defined.
399 */
400 eCSR_ROAM_PREAUTH_INIT_NOTIFY,
401 eCSR_ROAM_PREAUTH_STATUS_SUCCESS,
402 eCSR_ROAM_PREAUTH_STATUS_FAILURE,
403 eCSR_ROAM_HANDOVER_SUCCESS,
Kabilan Kannan32eb5022016-10-04 12:24:50 -0700404 /*
405 * TDLS callback events
406 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800407 eCSR_ROAM_TDLS_STATUS_UPDATE,
408 eCSR_ROAM_RESULT_MGMT_TX_COMPLETE_IND,
Kabilan Kannan32eb5022016-10-04 12:24:50 -0700409
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800410 /* Disaconnect all the clients */
411 eCSR_ROAM_DISCONNECT_ALL_P2P_CLIENTS,
412 /* Stopbss triggered from SME due to different */
413 eCSR_ROAM_SEND_P2P_STOP_BSS,
414 /* beacon interval */
415#ifdef WLAN_FEATURE_11W
416 eCSR_ROAM_UNPROT_MGMT_FRAME_IND,
417#endif
418
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800419 eCSR_ROAM_IBSS_PEER_INFO_COMPLETE,
420
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800421#ifdef FEATURE_WLAN_ESE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800422 eCSR_ROAM_TSM_IE_IND,
423 eCSR_ROAM_CCKM_PREAUTH_NOTIFY,
424 eCSR_ROAM_ESE_ADJ_AP_REPORT_IND,
425 eCSR_ROAM_ESE_BCN_REPORT_IND,
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800426#endif /* FEATURE_WLAN_ESE */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800427
428 /* Radar indication from lower layers */
429 eCSR_ROAM_DFS_RADAR_IND,
430 eCSR_ROAM_SET_CHANNEL_RSP,
431
432 /* Channel sw update notification */
433 eCSR_ROAM_DFS_CHAN_SW_NOTIFY,
Abhishek Singh518323d2015-10-19 17:42:01 +0530434 eCSR_ROAM_EXT_CHG_CHNL_IND,
Manishekar Chandrasekarancb052172016-04-22 12:19:04 +0530435 eCSR_ROAM_STA_CHANNEL_SWITCH,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700436 eCSR_ROAM_NDP_STATUS_UPDATE,
Selvaraj, Sridharfe696d22016-08-03 21:34:51 +0530437 eCSR_ROAM_UPDATE_SCAN_RESULT,
Naveen Rawat8cc23b02016-07-14 12:22:56 -0700438 eCSR_ROAM_START,
439 eCSR_ROAM_ABORT,
Varun Reddy Yeturu04251862016-09-16 10:33:19 -0700440 eCSR_ROAM_NAPI_OFF,
Kapil Gupta8878ad92017-02-13 11:56:04 +0530441 eCSR_ROAM_CHANNEL_COMPLETE_IND,
Arif Hussaincd151632017-02-11 16:57:19 -0800442 eCSR_ROAM_CAC_COMPLETE_IND,
Padma, Santhosh Kumarb38ab512018-01-16 16:16:46 +0530443 eCSR_ROAM_SAE_COMPUTE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800444} eRoamCmdStatus;
445
446/* comment inside indicates what roaming callback gets */
447typedef enum {
448 eCSR_ROAM_RESULT_NONE,
Varun Reddy Yeturu7b2a6572017-06-15 11:07:28 -0700449 eCSR_ROAM_RESULT_SUCCESS = eCSR_ROAM_RESULT_NONE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800450 /*
451 * If roamStatus is eCSR_ROAM_ASSOCIATION_COMPLETION,
Jeff Johnson172237b2017-11-07 15:32:59 -0800452 * struct csr_roam_info's pBssDesc may pass back
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800453 */
454 eCSR_ROAM_RESULT_FAILURE,
Jeff Johnson172237b2017-11-07 15:32:59 -0800455 /* Pass back pointer to struct csr_roam_info */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800456 eCSR_ROAM_RESULT_ASSOCIATED,
457 eCSR_ROAM_RESULT_NOT_ASSOCIATED,
458 eCSR_ROAM_RESULT_MIC_FAILURE,
459 eCSR_ROAM_RESULT_FORCED,
460 eCSR_ROAM_RESULT_DISASSOC_IND,
461 eCSR_ROAM_RESULT_DEAUTH_IND,
462 eCSR_ROAM_RESULT_CAP_CHANGED,
463 /*
Jeff Johnson172237b2017-11-07 15:32:59 -0800464 * This means we starts an IBSS struct csr_roam_info's
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800465 * pBssDesc may pass back
466 */
467 eCSR_ROAM_RESULT_IBSS_STARTED,
468 eCSR_ROAM_RESULT_IBSS_START_FAILED,
469 eCSR_ROAM_RESULT_IBSS_JOIN_SUCCESS,
470 eCSR_ROAM_RESULT_IBSS_JOIN_FAILED,
471 eCSR_ROAM_RESULT_IBSS_CONNECT,
472 eCSR_ROAM_RESULT_IBSS_INACTIVE,
473 /*
Jeff Johnson172237b2017-11-07 15:32:59 -0800474 * If roamStatus is eCSR_ROAM_ASSOCIATION_COMPLETION struct
475 * csr_roam_info's pBssDesc may pass back and the peer's MAC
476 * address in peerMacOrBssid. If roamStatus is
477 * eCSR_ROAM_IBSS_IND, the peer's MAC address in
478 * peerMacOrBssid and a beacon frame of the IBSS in pbFrames
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800479 */
480 eCSR_ROAM_RESULT_IBSS_NEW_PEER,
481 /*
482 * Peer departed from IBSS, Callback may get a pointer tSmeIbssPeerInd
483 * in pIbssPeerInd
484 */
485 eCSR_ROAM_RESULT_IBSS_PEER_DEPARTED,
486 /*
487 * Coalescing in the IBSS network (joined an IBSS network)
488 * Callback pass a BSSID in peerMacOrBssid
489 */
490 eCSR_ROAM_RESULT_IBSS_COALESCED,
491 /*
492 * If roamStatus is eCSR_ROAM_ROAMING_START, callback may get a pointer
493 * to tCsrConnectedProfile used to connect.
494 */
495 eCSR_ROAM_RESULT_IBSS_STOP,
496 eCSR_ROAM_RESULT_LOSTLINK,
497 eCSR_ROAM_RESULT_MIC_ERROR_UNICAST,
498 eCSR_ROAM_RESULT_MIC_ERROR_GROUP,
499 eCSR_ROAM_RESULT_AUTHENTICATED,
500 eCSR_ROAM_RESULT_NEW_RSN_BSS,
501#ifdef FEATURE_WLAN_WAPI
502 eCSR_ROAM_RESULT_NEW_WAPI_BSS,
503#endif /* FEATURE_WLAN_WAPI */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800504 /* INFRA started successfully */
505 eCSR_ROAM_RESULT_INFRA_STARTED,
506 /* INFRA start failed */
507 eCSR_ROAM_RESULT_INFRA_START_FAILED,
508 /* INFRA stopped */
509 eCSR_ROAM_RESULT_INFRA_STOPPED,
510 /* A station joining INFRA AP */
511 eCSR_ROAM_RESULT_INFRA_ASSOCIATION_IND,
512 /* A station joined INFRA AP */
513 eCSR_ROAM_RESULT_INFRA_ASSOCIATION_CNF,
514 /* INFRA disassociated */
515 eCSR_ROAM_RESULT_INFRA_DISASSOCIATED,
516 eCSR_ROAM_RESULT_WPS_PBC_PROBE_REQ_IND,
517 eCSR_ROAM_RESULT_SEND_ACTION_FAIL,
518 /* peer rejected assoc because max assoc limit reached */
519 eCSR_ROAM_RESULT_MAX_ASSOC_EXCEEDED,
520 /* Assoc rejected due to concurrent session running on a diff channel */
521 eCSR_ROAM_RESULT_ASSOC_FAIL_CON_CHANNEL,
Kabilan Kannan32eb5022016-10-04 12:24:50 -0700522 /* TDLS events */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800523 eCSR_ROAM_RESULT_ADD_TDLS_PEER,
524 eCSR_ROAM_RESULT_UPDATE_TDLS_PEER,
525 eCSR_ROAM_RESULT_DELETE_TDLS_PEER,
526 eCSR_ROAM_RESULT_TEARDOWN_TDLS_PEER_IND,
527 eCSR_ROAM_RESULT_DELETE_ALL_TDLS_PEER_IND,
528 eCSR_ROAM_RESULT_LINK_ESTABLISH_REQ_RSP,
529 eCSR_ROAM_RESULT_TDLS_SHOULD_DISCOVER,
530 eCSR_ROAM_RESULT_TDLS_SHOULD_TEARDOWN,
531 eCSR_ROAM_RESULT_TDLS_SHOULD_PEER_DISCONNECTED,
Kabilan Kannan14ec97f2016-05-16 23:48:25 -0700532 eCSR_ROAM_RESULT_TDLS_CONNECTION_TRACKER_NOTIFICATION,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800533
Rajeev Kumar8e3e2832015-11-06 16:02:54 -0800534 eCSR_ROAM_RESULT_IBSS_PEER_INFO_SUCCESS,
535 eCSR_ROAM_RESULT_IBSS_PEER_INFO_FAILED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800536 eCSR_ROAM_RESULT_DFS_RADAR_FOUND_IND,
537 eCSR_ROAM_RESULT_CHANNEL_CHANGE_SUCCESS,
538 eCSR_ROAM_RESULT_CHANNEL_CHANGE_FAILURE,
Abhishek Singh20a8e442018-09-12 15:50:44 +0530539 eCSR_ROAM_RESULT_CSA_RESTART_RSP,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800540 eCSR_ROAM_RESULT_DFS_CHANSW_UPDATE_SUCCESS,
Abhishek Singh518323d2015-10-19 17:42:01 +0530541 eCSR_ROAM_EXT_CHG_CHNL_UPDATE_IND,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700542
Naveen Rawat8d63a592016-06-29 18:30:59 -0700543 eCSR_ROAM_RESULT_NDI_CREATE_RSP,
544 eCSR_ROAM_RESULT_NDI_DELETE_RSP,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700545 eCSR_ROAM_RESULT_NDP_INITIATOR_RSP,
546 eCSR_ROAM_RESULT_NDP_NEW_PEER_IND,
547 eCSR_ROAM_RESULT_NDP_CONFIRM_IND,
548 eCSR_ROAM_RESULT_NDP_INDICATION,
Deepak Dhamdhere5cdce842016-05-31 10:39:12 -0700549 eCSR_ROAM_RESULT_NDP_SCHED_UPDATE_RSP,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700550 eCSR_ROAM_RESULT_NDP_RESPONDER_RSP,
551 eCSR_ROAM_RESULT_NDP_END_RSP,
552 eCSR_ROAM_RESULT_NDP_PEER_DEPARTED_IND,
553 eCSR_ROAM_RESULT_NDP_END_IND,
Arif Hussaincd151632017-02-11 16:57:19 -0800554 eCSR_ROAM_RESULT_CAC_END_IND,
Abhishek Singhc9941602016-08-09 16:06:22 +0530555 /* If Scan for SSID failed to found proper BSS */
556 eCSR_ROAM_RESULT_SCAN_FOR_SSID_FAILURE,
Arif Hussain43354e62017-05-24 11:24:25 -0700557 eCSR_ROAM_RESULT_INVOKE_FAILED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800558} eCsrRoamResult;
559
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800560typedef enum {
561 eCSR_DISCONNECT_REASON_UNSPECIFIED = 0,
562 eCSR_DISCONNECT_REASON_MIC_ERROR,
563 eCSR_DISCONNECT_REASON_DISASSOC,
564 eCSR_DISCONNECT_REASON_DEAUTH,
565 eCSR_DISCONNECT_REASON_HANDOFF,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800566 eCSR_DISCONNECT_REASON_IBSS_LEAVE,
567 eCSR_DISCONNECT_REASON_STA_HAS_LEFT,
Deepak Dhamdhere13983f22016-05-31 19:06:09 -0700568 eCSR_DISCONNECT_REASON_NDI_DELETE,
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -0700569 eCSR_DISCONNECT_REASON_ROAM_HO_FAIL,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800570} eCsrRoamDisconnectReason;
571
572typedef enum {
573 /* Not associated in Infra or participating in an IBSS/Ad-hoc */
574 eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED,
575 /* Associated in an Infrastructure network. */
576 eCSR_ASSOC_STATE_TYPE_INFRA_ASSOCIATED,
577 /* Participating in IBSS network though disconnection */
578 eCSR_ASSOC_STATE_TYPE_IBSS_DISCONNECTED,
579 /* Participating in IBSS network with partner stations also present */
580 eCSR_ASSOC_STATE_TYPE_IBSS_CONNECTED,
581 /* Participating in WDS network in AP/STA mode but not connected yet */
582 eCSR_ASSOC_STATE_TYPE_WDS_DISCONNECTED,
583 /* Participating in a WDS network and connected peer to peer */
584 eCSR_ASSOC_STATE_TYPE_WDS_CONNECTED,
585 /* Participating in a Infra network in AP not yet in connected state */
586 eCSR_ASSOC_STATE_TYPE_INFRA_DISCONNECTED,
587 /* Participating in a Infra network and connected to a peer */
588 eCSR_ASSOC_STATE_TYPE_INFRA_CONNECTED,
kaliu154d7892015-12-30 17:27:58 +0530589 /* Disconnecting with AP or stop connecting process */
590 eCSR_ASSOC_STATE_TYPE_INFRA_DISCONNECTING,
Deepak Dhamdheree2dd5442016-05-27 15:05:51 -0700591 /* NAN Data interface not started */
592 eCSR_CONNECT_STATE_TYPE_NDI_NOT_STARTED,
Jeff Johnson698eacd2018-05-12 17:00:03 -0700593 /* NAN Data interface started */
Deepak Dhamdheree2dd5442016-05-27 15:05:51 -0700594 eCSR_CONNECT_STATE_TYPE_NDI_STARTED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800595
596} eCsrConnectState;
597
598/*
599 * This parameter is no longer supported in the Profile.
600 * Need to set this in the global properties for the adapter.
601 */
602typedef enum eCSR_MEDIUM_ACCESS {
603 eCSR_MEDIUM_ACCESS_AUTO = 0,
604 eCSR_MEDIUM_ACCESS_DCF,
605 eCSR_MEDIUM_ACCESS_eDCF,
606 eCSR_MEDIUM_ACCESS_HCF,
607
608 eCSR_MEDIUM_ACCESS_WMM_eDCF_802dot1p,
609 eCSR_MEDIUM_ACCESS_WMM_eDCF_DSCP,
610 eCSR_MEDIUM_ACCESS_WMM_eDCF_NoClassify,
611 eCSR_MEDIUM_ACCESS_11e_eDCF = eCSR_MEDIUM_ACCESS_eDCF,
612 eCSR_MEDIUM_ACCESS_11e_HCF = eCSR_MEDIUM_ACCESS_HCF,
613} eCsrMediaAccessType;
614
615typedef enum {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800616 eCSR_OPERATING_CHANNEL_ALL = 0,
617 eCSR_OPERATING_CHANNEL_AUTO = eCSR_OPERATING_CHANNEL_ALL,
618 eCSR_OPERATING_CHANNEL_ANY = eCSR_OPERATING_CHANNEL_ALL,
619} eOperationChannel;
620
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800621/*
622 * For channel bonding, the channel number gap is 4, either up or down.
623 * For both 11a and 11g mode.
624 */
625#define CSR_CB_CHANNEL_GAP 4
626#define CSR_CB_CENTER_CHANNEL_OFFSET 2
Abhishek Singh78f654b2018-08-29 12:23:00 +0530627#define CSR_SEC_CHANNEL_OFFSET 4
628
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800629
630/* WEP keysize (in bits) */
631typedef enum {
632 /* 40 bit key + 24bit IV = 64bit WEP */
633 eCSR_SECURITY_WEP_KEYSIZE_40 = 40,
634 /* 104bit key + 24bit IV = 128bit WEP */
635 eCSR_SECURITY_WEP_KEYSIZE_104 = 104,
636 eCSR_SECURITY_WEP_KEYSIZE_MIN = eCSR_SECURITY_WEP_KEYSIZE_40,
637 eCSR_SECURITY_WEP_KEYSIZE_MAX = eCSR_SECURITY_WEP_KEYSIZE_104,
638 eCSR_SECURITY_WEP_KEYSIZE_MAX_BYTES =
639 (eCSR_SECURITY_WEP_KEYSIZE_MAX / 8),
640} eCsrWEPKeySize;
641
642/* Possible values for the WEP static key ID */
643typedef enum {
644
645 eCSR_SECURITY_WEP_STATIC_KEY_ID_MIN = 0,
646 eCSR_SECURITY_WEP_STATIC_KEY_ID_MAX = 3,
647 eCSR_SECURITY_WEP_STATIC_KEY_ID_DEFAULT = 0,
648
649 eCSR_SECURITY_WEP_STATIC_KEY_ID_INVALID = -1,
650
651} eCsrWEPStaticKeyID;
652
653/* Two extra key indicies are used for the IGTK (which is used by BIP) */
654#define CSR_MAX_NUM_KEY (eCSR_SECURITY_WEP_STATIC_KEY_ID_MAX + 2 + 1)
655
656typedef enum {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800657 /*
658 * Roaming because HDD requested for reassoc by changing one of the
659 * fields in tCsrRoamModifyProfileFields. OR Roaming because SME
660 * requested for reassoc by changing one of the fields in
661 * tCsrRoamModifyProfileFields.
662 */
663 eCsrRoamReasonStaCapabilityChanged,
664 /*
665 * Roaming because SME requested for reassoc to a different AP,
666 * as part of inter AP handoff.
667 */
668 eCsrRoamReasonBetterAP,
669 /*
670 * Roaming because SME requested it as the link is lost - placeholder,
671 * will clean it up once handoff code gets in
672 */
673 eCsrRoamReasonSmeIssuedForLostLink,
674
675} eCsrRoamReasonCodes;
676
677typedef enum {
678 eCsrRoamWmmAuto = 0,
679 eCsrRoamWmmQbssOnly = 1,
680 eCsrRoamWmmNoQos = 2,
681
682} eCsrRoamWmmUserModeType;
683
684typedef enum {
685 eCSR_REQUESTER_MIN = 0,
686 eCSR_DIAG,
687 eCSR_UMA_GAN,
688 eCSR_HDD
689} eCsrStatsRequesterType;
690
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800691typedef struct tagPmkidCandidateInfo {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530692 struct qdf_mac_addr BSSID;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800693 bool preAuthSupported;
694} tPmkidCandidateInfo;
695
696typedef struct tagPmkidCacheInfo {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530697 struct qdf_mac_addr BSSID;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800698 uint8_t PMKID[CSR_RSN_PMKID_SIZE];
Sridhar Selvarajc3684c72017-08-21 14:32:47 +0530699 uint8_t pmk[CSR_RSN_MAX_PMK_LEN];
700 uint8_t pmk_len;
701 uint8_t ssid_len;
702 uint8_t ssid[SIR_MAC_MAX_SSID_LENGTH];
703 uint8_t cache_id[CACHE_ID_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800704} tPmkidCacheInfo;
705
706#ifdef FEATURE_WLAN_WAPI
707typedef struct tagBkidCandidateInfo {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530708 struct qdf_mac_addr BSSID;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800709 bool preAuthSupported;
710} tBkidCandidateInfo;
711
712typedef struct tagBkidCacheInfo {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530713 struct qdf_mac_addr BSSID;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800714 uint8_t BKID[CSR_WAPI_BKID_SIZE];
715} tBkidCacheInfo;
716#endif /* FEATURE_WLAN_WAPI */
717
718typedef struct tagCsrKeys {
719 /* Also use to indicate whether the key index is set */
720 uint8_t KeyLength[CSR_MAX_NUM_KEY];
721 uint8_t KeyMaterial[CSR_MAX_NUM_KEY][CSR_MAX_KEY_LEN];
722 uint8_t defaultIndex;
723} tCsrKeys;
724
725/*
726 * Following fields which're part of tCsrRoamConnectedProfile might need
727 * modification dynamically once STA is up & running & this'd trigger reassoc
728 */
729typedef struct tagCsrRoamModifyProfileFields {
730 /*
731 * during connect this specifies ACs U-APSD is to be setup
732 * for (Bit0:VO; Bit1:VI; Bit2:BK; Bit3:BE all other bits are ignored).
733 * During assoc response this COULD carry confirmation of what
734 * ACs U-APSD got setup for. Later if an APP looking for APSD,
735 * SME-QoS might need to modify this field
736 */
737 uint8_t uapsd_mask;
738 /* HDD might ask to modify this field */
739 uint16_t listen_interval;
740} tCsrRoamModifyProfileFields;
741
Jeff Johnson66ee8a92018-03-17 15:24:26 -0700742struct csr_roam_profile {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800743 tCsrSSIDs SSIDs;
744 tCsrBSSIDs BSSIDs;
745 /* this is bit mask of all the needed phy mode defined in eCsrPhyMode */
746 uint32_t phyMode;
747 eCsrRoamBssType BSSType;
748 tCsrAuthList AuthType;
749 eCsrAuthType negotiatedAuthType;
750 tCsrEncryptionList EncryptionType;
751 /* This field is for output only, not for input */
752 eCsrEncryptionType negotiatedUCEncryptionType;
753 /*
754 * eCSR_ENCRYPT_TYPE_ANY cannot be set in multicast encryption type.
755 * If caller doesn't case, put all supported encryption types in here
756 */
757 tCsrEncryptionList mcEncryptionType;
758 /* This field is for output only, not for input */
759 eCsrEncryptionType negotiatedMCEncryptionType;
760#ifdef WLAN_FEATURE_11W
761 /* Management Frame Protection */
762 bool MFPEnabled;
763 uint8_t MFPRequired;
764 uint8_t MFPCapable;
765#endif
Padma, Santhosh Kumar4117d7a2017-12-20 17:39:33 +0530766 tAniEdType mgmt_encryption_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800767 tCsrKeys Keys;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800768 tCsrChannelInfo ChannelInfo;
769 uint8_t operationChannel;
Amar Singhal5cccafe2017-02-15 12:42:58 -0800770 struct ch_params ch_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800771 /* If this is 0, SME will fill in for caller. */
772 uint16_t beaconInterval;
773 /*
774 * during connect this specifies ACs U-APSD is to be setup
775 * for (Bit0:VO; Bit1:VI; Bit2:BK; Bit3:BE all other bits are ignored).
776 * During assoc resp this'd carry cnf of what ACs U-APSD got setup for
777 */
778 uint8_t uapsd_mask;
779 uint32_t nWPAReqIELength; /* The byte count in the pWPAReqIE */
780 uint8_t *pWPAReqIE; /* If not null,it's IE byte stream for WPA */
781 uint32_t nRSNReqIELength; /* The byte count in the pRSNReqIE */
782 uint8_t *pRSNReqIE; /* If not null,it's IE byte stream for RSN */
783#ifdef FEATURE_WLAN_WAPI
784 uint32_t nWAPIReqIELength;/* The byte count in the pWAPIReqIE */
785 uint8_t *pWAPIReqIE; /* If not null,it's IE byte stream for WAPI */
786#endif /* FEATURE_WLAN_WAPI */
787
788 uint32_t nAddIEScanLength;/* pAddIE for scan (at the time of join) */
789 /*
790 * If not null,it's the IE byte stream for additional IE,
791 * which can be WSC IE and/or P2P IE
792 */
793 uint8_t *pAddIEScan;
794 uint32_t nAddIEAssocLength; /* The byte count in the pAddIE for assoc */
795 /*
796 * If not null, it has the IE byte stream for additional IE,
797 * which can be WSC IE and/or P2P IE
798 */
799 uint8_t *pAddIEAssoc;
800 /* it is ignored if [0] is 0. */
Wu Gaoaa155142019-01-14 15:09:26 +0800801 uint8_t countryCode[CFG_COUNTRY_CODE_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800802 /* WPS Association if true => auth and ecryption should be ignored */
803 bool bWPSAssociation;
804 bool bOSENAssociation;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800805 uint8_t ieee80211d;
806 uint8_t privacy;
807 bool fwdWPSPBCProbeReq;
808 tAniAuthType csr80211AuthType;
809 uint32_t dtimPeriod;
810 bool ApUapsdEnable;
811 bool protEnabled;
812 bool obssProtEnabled;
hqu0a6ce082017-09-27 22:00:35 +0800813 bool chan_switch_hostapd_rate_enabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800814 uint16_t cfg_protection;
815 uint8_t wps_state;
Jeff Johnson9e760832018-12-15 12:41:36 -0800816 struct mobility_domain_info mdid;
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800817 enum QDF_OPMODE csrPersona;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800818 /* addIe params */
819 tSirAddIeParams addIeParams;
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800820 uint16_t beacon_tx_rate;
Agrawal Ashish06e76d22016-08-18 16:44:48 +0530821 tSirMacRateSet supported_rates;
822 tSirMacRateSet extended_rates;
Abhishek Singh3c9910e2017-01-06 17:56:47 +0530823 struct qdf_mac_addr bssid_hint;
Abhishek Singhb59f8d42017-07-31 14:42:47 +0530824 bool force_24ghz_in_ht20;
Arif Hussain671a1902017-03-17 09:08:32 -0700825 uint32_t cac_duration_ms;
826 uint32_t dfs_regdomain;
Varun Reddy Yeturue5a35d12017-10-20 11:26:57 -0700827 bool supplicant_disabled_roaming;
Padma, Santhosh Kumar86747ec2018-05-29 18:28:29 +0530828 bool driver_disabled_roaming;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +0530829#ifdef WLAN_FEATURE_FILS_SK
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +0530830 uint8_t *hlp_ie;
831 uint32_t hlp_ie_len;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +0530832 struct cds_fils_connection_info *fils_con_info;
833#endif
Abhishek Singh6454ad32017-12-20 10:42:21 +0530834 bool force_rsne_override;
Jeff Johnson66ee8a92018-03-17 15:24:26 -0700835};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800836
837#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
838typedef struct tagCsrRoamHTProfile {
839 uint8_t phymode;
840 uint8_t htCapability;
841 uint8_t htSupportedChannelWidthSet;
842 uint8_t htRecommendedTxWidthSet;
843 ePhyChanBondState htSecondaryChannelOffset;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800844 uint8_t vhtCapability;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800845 uint8_t apCenterChan;
846 uint8_t apChanWidth;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800847} tCsrRoamHTProfile;
848#endif
849typedef struct tagCsrRoamConnectedProfile {
850 tSirMacSSid SSID;
851 bool handoffPermitted;
852 bool ssidHidden;
Rachit Kankane02471912017-12-27 17:13:57 +0530853 uint8_t operationChannel;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530854 struct qdf_mac_addr bssid;
Rachit Kankane02471912017-12-27 17:13:57 +0530855 uint16_t beaconInterval;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800856 eCsrRoamBssType BSSType;
857 eCsrAuthType AuthType;
858 tCsrAuthList AuthInfo;
859 eCsrEncryptionType EncryptionType;
860 tCsrEncryptionList EncryptionInfo;
861 eCsrEncryptionType mcEncryptionType;
862 tCsrEncryptionList mcEncryptionInfo;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800863 uint32_t vht_channel_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800864 tCsrKeys Keys;
865 /*
866 * meaningless on connect. It's an OUT param from CSR's point of view
867 * During assoc response carries the ACM bit-mask i.e. what
868 * ACs have ACM=1 (if any),(Bit0:VO; Bit1:VI; Bit2:BK; Bit3:BE
869 * all other bits are ignored)
870 */
871 uint8_t acm_mask;
872 tCsrRoamModifyProfileFields modifyProfileFields;
Rachit Kankane02471912017-12-27 17:13:57 +0530873 bool qosConnection; /* A connection is QoS enabled */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800874 uint32_t nAddIEAssocLength;
875 /*
876 * If not null,it's IE byte stream for additional IE,
877 * which can be WSC IE and/or P2P IE
878 */
879 uint8_t *pAddIEAssoc;
880 tSirBssDescription *pBssDesc;
881 bool qap; /* AP supports QoS */
Jeff Johnson9e760832018-12-15 12:41:36 -0800882 struct mobility_domain_info mdid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800883#ifdef FEATURE_WLAN_ESE
884 tCsrEseCckmInfo eseCckmInfo;
885 bool isESEAssoc;
886#endif
887 uint32_t dot11Mode;
888 uint8_t proxyARPService;
889#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
890 tCsrRoamHTProfile HTProfile;
891#endif
892#ifdef WLAN_FEATURE_11W
893 /* Management Frame Protection */
894 bool MFPEnabled;
895 uint8_t MFPRequired;
896 uint8_t MFPCapable;
897#endif
898} tCsrRoamConnectedProfile;
899
Agrawal Ashish21ba2572016-09-03 16:40:10 +0530900/**
901 * enum sta_roam_policy_dfs_mode - state of DFS mode for STA ROME policy
902 * @CSR_STA_ROAM_POLICY_NONE: DFS mode attribute is not valid
903 * @CSR_STA_ROAM_POLICY_DFS_ENABLED: DFS mode is enabled
904 * @CSR_STA_ROAM_POLICY_DFS_DISABLED: DFS mode is disabled
905 * @CSR_STA_ROAM_POLICY_DFS_DEPRIORITIZE: Deprioritize DFS channels in scanning
906 */
907enum sta_roam_policy_dfs_mode {
908 CSR_STA_ROAM_POLICY_NONE,
909 CSR_STA_ROAM_POLICY_DFS_ENABLED,
910 CSR_STA_ROAM_POLICY_DFS_DISABLED,
911 CSR_STA_ROAM_POLICY_DFS_DEPRIORITIZE
912};
913
914/**
915 * struct csr_sta_roam_policy_params - sta roam policy params for station
916 * @dfs_mode: tell is DFS channels needs to be skipped while scanning
917 * @skip_unsafe_channels: tells if unsafe channels needs to be skip in scanning
Agrawal, Ashish9f84c402016-11-30 16:19:44 +0530918 * @sap_operating_band: Opearting band for SAP
Agrawal Ashish21ba2572016-09-03 16:40:10 +0530919 */
920struct csr_sta_roam_policy_params {
921 enum sta_roam_policy_dfs_mode dfs_mode;
922 bool skip_unsafe_channels;
Agrawal, Ashish9f84c402016-11-30 16:19:44 +0530923 uint8_t sap_operating_band;
Agrawal Ashish21ba2572016-09-03 16:40:10 +0530924};
925
Vignesh Viswanathan9dd88d32017-11-22 14:22:03 +0530926/**
Vignesh Viswanathan694e28e2018-01-18 20:53:57 +0530927 * struct csr_neighbor_report_offload_params - neighbor report offload params
928 * @params_bitmask: bitmask to specify which of the below are enabled
929 * @time_offset: time offset after 11k offload command to trigger a neighbor
930 * report request (in seconds)
931 * @low_rssi_offset: Offset from rssi threshold to trigger neighbor
932 * report request (in dBm)
933 * @bmiss_count_trigger: Number of beacon miss events to trigger neighbor
934 * report request
935 * @per_threshold_offset: offset from PER threshold to trigger neighbor
936 * report request (in %)
937 * @neighbor_report_cache_timeout: timeout after which new trigger can enable
938 * sending of a neighbor report request (in seconds)
939 * @max_neighbor_report_req_cap: max number of neighbor report requests that
940 * can be sent to the peer in the current session
941 */
942struct csr_neighbor_report_offload_params {
943 uint8_t params_bitmask;
944 uint32_t time_offset;
945 uint32_t low_rssi_offset;
946 uint32_t bmiss_count_trigger;
947 uint32_t per_threshold_offset;
948 uint32_t neighbor_report_cache_timeout;
949 uint32_t max_neighbor_report_req_cap;
950};
951
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800952typedef struct tagCsrConfigParam {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800953 /* keep this uint32_t. This gets converted to ePhyChannelBondState */
954 uint32_t channelBondingMode24GHz;
955 uint32_t channelBondingMode5GHz;
956 eCsrPhyMode phyMode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800957 uint32_t HeartbeatThresh50;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800958 eCsrRoamWmmUserModeType WMMSupportMode;
959 bool Is11eSupportEnabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800960 bool ProprietaryRatesEnabled;
961 uint8_t AdHocChannel24;
962 uint8_t AdHocChannel5G;
963 /*
964 * this number minus one is the number of times a scan doesn't find it
965 * before it is removed
966 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800967 /* to set the RSSI difference for each category */
968 uint8_t bCatRssiOffset;
969 /* to set MCC Enable/Disable mode */
970 uint8_t fEnableMCCMode;
971 bool mcc_rts_cts_prot_enable;
972 bool mcc_bcast_prob_resp_enable;
973 /*
974 * To allow MCC GO different B.I than STA's.
975 * NOTE: make sure if RIVA firmware can handle this combination before
976 * enabling this at the moment, this flag is provided only to pass
977 * Wi-Fi Cert. 5.1.12
978 */
979 uint8_t fAllowMCCGODiffBI;
980 tCsr11dinfo Csr11dinfo;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800981 /* stats request frequency from PE while in full power */
982 uint32_t statsReqPeriodicity;
983 /* stats request frequency from PE while in power save */
984 uint32_t statsReqPeriodicityInPS;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800985#ifdef FEATURE_WLAN_ESE
986 uint8_t isEseIniFeatureEnabled;
987#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800988 uint8_t isFastRoamIniFeatureEnabled;
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -0700989 struct mawc_params csr_mawc_config;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800990 /*
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800991 * Customer wants to optimize the scan time. Avoiding scans(passive)
992 * on DFS channels while swipping through both bands can save some time
993 * (apprx 1.3 sec)
994 */
995 uint8_t fEnableDFSChnlScan;
996 /*
997 * To enable/disable scanning 2.4Ghz channels twice on a single scan
998 * request from HDD
999 */
1000 bool fScanTwice;
Kapil Gupta4b2efbb2016-10-03 13:07:20 +05301001 bool vendor_vht_sap;
Archana Ramachandranfec24812016-02-16 16:31:56 -08001002 bool send_smps_action;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001003
Krunal Soni158bfe62017-08-02 12:33:08 -07001004 uint8_t disable_high_ht_mcs_2x2;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001005 uint8_t isCoalesingInIBSSAllowed;
1006#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
1007 uint8_t cc_switch_mode;
1008#endif
1009 uint8_t allowDFSChannelRoam;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001010 bool obssEnabled;
1011 uint8_t conc_custom_rule1;
1012 uint8_t conc_custom_rule2;
1013 uint8_t is_sta_connection_in_5gz_enabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001014
Krunal Soni1878d3a2016-01-14 13:00:44 -08001015 uint8_t max_intf_count;
Krunal Soni1878d3a2016-01-14 13:00:44 -08001016 uint32_t f_sta_miracast_mcc_rest_time_val;
1017#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
1018 bool sap_channel_avoidance;
1019#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
Krunal Soni1878d3a2016-01-14 13:00:44 -08001020 uint32_t dual_mac_feature_disable;
Ganesh Kondabattini930304c2017-10-10 15:25:36 +05301021 uint32_t sta_sap_scc_on_dfs_chan;
Gupta, Kapilc68ad462016-02-01 19:17:23 +05301022 uint32_t roam_dense_rssi_thresh_offset;
1023 uint32_t roam_dense_min_aps;
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07001024 int8_t roam_bg_scan_bad_rssi_thresh;
Vignesh Viswanathanc018e982017-09-07 18:49:19 +05301025 uint8_t roam_bad_rssi_thresh_offset_2g;
Agrawal Ashish21ba2572016-09-03 16:40:10 +05301026 struct csr_sta_roam_policy_params sta_roam_policy_params;
Selvaraj, Sridhar4f684bb2017-01-19 15:59:23 +05301027 bool enable_bcast_probe_rsp;
Vignesh Viswanathan32761e42017-09-25 17:10:54 +05301028 bool is_fils_enabled;
Naveen Rawatb2fc4132017-05-10 20:42:05 -07001029 bool is_force_1x1;
Yeshwanth Sriram Guntuka2ba6fe92017-10-04 14:40:45 +05301030 uint8_t oce_feature_bitmap;
Vignesh Viswanathan694e28e2018-01-18 20:53:57 +05301031 uint32_t offload_11k_enable_bitmask;
Kiran Kumar Lokere722dccd2018-02-23 13:23:52 -08001032 bool wep_tkip_in_he;
Vignesh Viswanathan694e28e2018-01-18 20:53:57 +05301033 struct csr_neighbor_report_offload_params neighbor_report_offload;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001034} tCsrConfigParam;
1035
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001036#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Jianmin Zhubf845932018-12-17 11:52:50 +08001037#define csr_is_roam_offload_enabled(mac) \
Jeff Johnson9aedc722018-11-22 13:44:01 -08001038 (mac->mlme_cfg->lfr.lfr3_roaming_offload)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001039#define DEFAULT_REASSOC_FAILURE_TIMEOUT 1000
Sridhar Selvaraje5260442017-08-19 10:12:03 +05301040#else
Jianmin Zhubf845932018-12-17 11:52:50 +08001041#define csr_is_roam_offload_enabled(mac) false
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001042#endif
1043
1044#ifdef WLAN_FEATURE_ROAM_OFFLOAD
1045/* connected but not authenticated */
1046#define CSR_ROAM_AUTH_STATUS_CONNECTED 0x1
1047/* connected and authenticated */
1048#define CSR_ROAM_AUTH_STATUS_AUTHENTICATED 0x2
1049#endif
1050
Jeff Johnson172237b2017-11-07 15:32:59 -08001051struct csr_roam_info {
Jeff Johnson66ee8a92018-03-17 15:24:26 -07001052 struct csr_roam_profile *pProfile;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001053 tSirBssDescription *pBssDesc;
1054 uint32_t nBeaconLength;
1055 uint32_t nAssocReqLength;
1056 uint32_t nAssocRspLength;
1057 uint32_t nFrameLength;
1058 uint8_t frameType;
1059 /*
1060 * Point to a buffer contain the beacon, assoc req, assoc rsp frame,
1061 * in that order user needs to use nBeaconLength, nAssocReqLength,
1062 * nAssocRspLength to desice where each frame starts and ends.
1063 */
1064 uint8_t *pbFrames;
1065 bool fReassocReq; /* set to true if for re-association */
1066 bool fReassocRsp; /* set to true if for re-association */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301067 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001068 /*
1069 * Only valid in IBSS. this is the peers MAC address for
1070 * eCSR_ROAM_RESULT_IBSS_NEW_PEER or PEER_DEPARTED
1071 */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301072 struct qdf_mac_addr peerMac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001073 tSirResultCodes statusCode;
1074 /* this'd be our own defined or sent from otherBSS(per 802.11spec) */
1075 uint32_t reasonCode;
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +05301076
1077 uint8_t disassoc_reason;
1078
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001079 uint8_t staId; /* Peer stationId when connected */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001080 /* false means auth needed from supplicant. true means authenticated */
1081 bool fAuthRequired;
1082 uint8_t sessionId;
1083 uint8_t rsnIELen;
1084 uint8_t *prsnIE;
1085 uint8_t wapiIELen;
1086 uint8_t *pwapiIE;
1087 uint8_t addIELen;
1088 uint8_t *paddIE;
1089 union {
1090 tSirMicFailureInfo *pMICFailureInfo;
1091 tCsrRoamConnectedProfile *pConnectedProfile;
1092 tSirWPSPBCProbeReq *pWPSPBCProbeReq;
1093 } u;
1094 bool wmmEnabledSta; /* set to true if WMM enabled STA */
1095 uint32_t dtimPeriod;
1096#ifdef FEATURE_WLAN_ESE
1097 bool isESEAssoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001098 tSirTsmIE tsmIe;
1099 uint32_t timestamp[2];
1100 uint16_t tsmRoamDelay;
1101 tSirEseBcnReportRsp *pEseBcnReportRsp;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001102#endif
1103 void *pRemainCtx;
1104 uint32_t roc_scan_id;
1105 uint32_t rxChan;
1106#ifdef FEATURE_WLAN_TDLS
Kabilan Kannan32eb5022016-10-04 12:24:50 -07001107 /*
1108 * TDLS parameters to check whether TDLS
1109 * and TDLS channel switch is allowed in the
1110 * AP network
1111 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001112 uint8_t staType;
1113 bool tdls_prohibited; /* per ExtCap in Assoc/Reassoc resp */
1114 bool tdls_chan_swit_prohibited; /* per ExtCap in Assoc/Reassoc resp */
1115#endif
1116 /* Required for indicating the frames to upper layer */
1117 uint32_t beaconLength;
1118 uint8_t *beaconPtr;
1119 uint32_t assocReqLength;
1120 uint8_t *assocReqPtr;
1121 int8_t rxRssi;
1122 tSirSmeDfsEventInd dfs_event;
1123 tSirChanChangeResponse *channelChangeRespEvent;
1124 /* Timing and fine Timing measurement capability clubbed together */
1125 uint8_t timingMeasCap;
1126#ifdef WLAN_FEATURE_ROAM_OFFLOAD
1127 uint8_t roamSynchInProgress;
1128 uint8_t synchAuthStatus;
1129 uint8_t kck[SIR_KCK_KEY_LEN];
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05301130 uint8_t kek[SIR_KEK_KEY_LEN_FILS];
1131 uint8_t kek_len;
1132 uint32_t pmk_len;
1133 uint8_t pmk[SIR_PMK_LEN];
1134 uint8_t pmkid[SIR_PMKID_LEN];
1135 bool update_erp_next_seq_num;
1136 uint16_t next_erp_seq_num;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001137 uint8_t replay_ctr[SIR_REPLAY_CTR_LEN];
Ravi Joshi277ae9b2015-11-13 11:30:43 -08001138 uint8_t subnet_change_status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001139#endif
1140 tSirSmeChanInfo chan_info;
Abhishek Singh518323d2015-10-19 17:42:01 +05301141 uint8_t target_channel;
Ravi Joshi412f23d2016-05-26 15:09:23 -07001142
Nachiket Kukade2fb1fdb2019-01-08 15:35:27 +05301143#ifdef WLAN_FEATURE_NAN
Ravi Joshi412f23d2016-05-26 15:09:23 -07001144 union {
Ravi Joshi412f23d2016-05-26 15:09:23 -07001145 struct ndi_create_rsp ndi_create_params;
1146 struct ndi_delete_rsp ndi_delete_params;
1147 } ndp;
1148#endif
Anurag Chouhan5de8d172016-07-13 14:44:28 +05301149 tDot11fIEHTCaps ht_caps;
1150 tDot11fIEVHTCaps vht_caps;
1151 tDot11fIEhs20vendor_ie hs20vendor_ie;
1152 tDot11fIEVHTOperation vht_operation;
1153 tDot11fIEHTInfo ht_operation;
1154 bool reassoc;
Will Huang558f8082017-05-31 16:22:24 +08001155 bool ampdu;
1156 bool sgi_enable;
1157 bool tx_stbc;
1158 bool rx_stbc;
1159 tSirMacHTChannelWidth ch_width;
1160 enum sir_sme_phy_mode mode;
1161 uint8_t max_supp_idx;
1162 uint8_t max_ext_idx;
1163 uint8_t max_mcs_idx;
1164 uint8_t rx_mcs_map;
1165 uint8_t tx_mcs_map;
gaolez7bb1e742017-03-21 16:37:38 +08001166 /* Extended capabilities of STA */
1167 uint8_t ecsa_capable;
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301168 bool is_fils_connection;
1169#ifdef WLAN_FEATURE_FILS_SK
1170 uint16_t fils_seq_num;
1171 struct fils_join_rsp_params *fils_join_rsp;
1172#endif
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +05301173 int rssi;
1174 int tx_rate;
1175 int rx_rate;
Padma, Santhosh Kumarb38ab512018-01-16 16:16:46 +05301176#ifdef WLAN_FEATURE_SAE
1177 struct sir_sae_info *sae_info;
1178#endif
Jeff Johnson172237b2017-11-07 15:32:59 -08001179};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001180
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001181typedef struct sSirSmeAssocIndToUpperLayerCnf {
1182 uint16_t messageType; /* eWNI_SME_ASSOC_CNF */
1183 uint16_t length;
1184 uint8_t sessionId;
1185 tSirResultCodes statusCode;
1186 tSirMacAddr bssId; /* Self BSSID */
1187 tSirMacAddr peerMacAddr;
1188 uint16_t aid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001189 uint8_t wmmEnabledSta; /* set to true if WMM enabled STA */
1190 tSirRSNie rsnIE; /* RSN IE received from peer */
1191 tSirWAPIie wapiIE; /* WAPI IE received from peer */
1192 tSirAddie addIE; /* this can be WSC and/or P2P IE */
1193 uint8_t reassocReq; /* set to true if reassoc */
1194 /* Timing and fine Timing measurement capability clubbed together */
1195 uint8_t timingMeasCap;
1196 tSirSmeChanInfo chan_info;
Abhishek Singh518323d2015-10-19 17:42:01 +05301197 uint8_t target_channel;
Will Huang558f8082017-05-31 16:22:24 +08001198 bool ampdu;
1199 bool sgi_enable;
1200 bool tx_stbc;
1201 tSirMacHTChannelWidth ch_width;
1202 enum sir_sme_phy_mode mode;
1203 bool rx_stbc;
1204 uint8_t max_supp_idx;
1205 uint8_t max_ext_idx;
1206 uint8_t max_mcs_idx;
1207 uint8_t rx_mcs_map;
1208 uint8_t tx_mcs_map;
gaolez7bb1e742017-03-21 16:37:38 +08001209 /* Extended capabilities of STA */
1210 uint8_t ecsa_capable;
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +05301211
1212 tDot11fIEHTCaps ht_caps;
1213 tDot11fIEVHTCaps vht_caps;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001214} tSirSmeAssocIndToUpperLayerCnf, *tpSirSmeAssocIndToUpperLayerCnf;
1215
1216typedef struct tagCsrSummaryStatsInfo {
Naveen Rawat2cb788d2016-10-11 17:44:44 -07001217 uint32_t snr;
Yeshwanth Sriram Guntuka14ab04c2018-09-21 15:06:49 +05301218 int8_t rssi;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001219 uint32_t retry_cnt[4];
1220 uint32_t multiple_retry_cnt[4];
1221 uint32_t tx_frm_cnt[4];
1222 /* uint32_t num_rx_frm_crc_err; same as rx_error_cnt */
1223 /* uint32_t num_rx_frm_crc_ok; same as rx_frm_cnt */
1224 uint32_t rx_frm_cnt;
1225 uint32_t frm_dup_cnt;
1226 uint32_t fail_cnt[4];
1227 uint32_t rts_fail_cnt;
1228 uint32_t ack_fail_cnt;
1229 uint32_t rts_succ_cnt;
1230 uint32_t rx_discard_cnt;
1231 uint32_t rx_error_cnt;
1232 uint32_t tx_byte_cnt;
1233
1234} tCsrSummaryStatsInfo;
1235
1236typedef struct tagCsrGlobalClassAStatsInfo {
Sourav Mohapatra49ce4ce2018-08-07 18:08:51 +05301237 uint8_t tx_nss;
1238 uint8_t rx_nss;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001239 uint32_t max_pwr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001240 uint32_t tx_rate;
Sourav Mohapatra49ce4ce2018-08-07 18:08:51 +05301241 uint32_t rx_rate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001242 /* mcs index for HT20 and HT40 rates */
Sourav Mohapatra49ce4ce2018-08-07 18:08:51 +05301243 uint32_t tx_mcs_index;
1244 uint32_t rx_mcs_index;
1245 uint32_t tx_mcs_rate_flags;
1246 uint32_t rx_mcs_rate_flags;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001247 /* to diff between HT20 & HT40 rates;short & long guard interval */
Sourav Mohapatra49ce4ce2018-08-07 18:08:51 +05301248 uint32_t tx_rx_rate_flags;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001249
1250} tCsrGlobalClassAStatsInfo;
1251
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001252typedef struct tagCsrGlobalClassDStatsInfo {
1253 uint32_t tx_uc_frm_cnt;
1254 uint32_t tx_mc_frm_cnt;
1255 uint32_t tx_bc_frm_cnt;
1256 uint32_t rx_uc_frm_cnt;
1257 uint32_t rx_mc_frm_cnt;
1258 uint32_t rx_bc_frm_cnt;
1259 uint32_t tx_uc_byte_cnt[4];
1260 uint32_t tx_mc_byte_cnt;
1261 uint32_t tx_bc_byte_cnt;
1262 uint32_t rx_uc_byte_cnt[4];
1263 uint32_t rx_mc_byte_cnt;
1264 uint32_t rx_bc_byte_cnt;
1265 uint32_t rx_byte_cnt;
1266 uint32_t num_rx_bytes_crc_ok;
1267 uint32_t rx_rate;
1268
1269} tCsrGlobalClassDStatsInfo;
1270
Himanshu Agarwal37e42412016-07-21 14:35:09 +05301271/**
1272 * struct csr_per_chain_rssi_stats_info - stores chain rssi
1273 * @rssi: array containing rssi for all chains
1274 * @peer_mac_addr: peer mac address
1275 */
1276struct csr_per_chain_rssi_stats_info {
1277 int8_t rssi[NUM_CHAINS_MAX];
1278 tSirMacAddr peer_mac_addr;
1279};
1280
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001281typedef struct tagCsrRoamSetKey {
1282 eCsrEncryptionType encType;
1283 tAniKeyDirection keyDirection; /* Tx, Rx or Tx-and-Rx */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301284 struct qdf_mac_addr peerMac; /* Peer MAC. ALL 1's for group key */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001285 uint8_t paeRole; /* 0 for supplicant */
1286 uint8_t keyId; /* Key index */
1287 uint16_t keyLength; /* Number of bytes containing the key in pKey */
1288 uint8_t Key[CSR_MAX_KEY_LEN];
1289 uint8_t keyRsc[CSR_MAX_RSC_LEN];
1290} tCsrRoamSetKey;
1291
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001292typedef void *tScanResultHandle;
1293
1294typedef enum {
1295 REASSOC = 0,
Varun Reddy Yeturu3e91dad2016-07-18 15:58:47 -07001296 FASTREASSOC = 1,
1297 CONNECT_CMD_USERSPACE = 2,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001298} handoff_src;
1299
1300typedef struct tagCsrHandoffRequest {
Anurag Chouhan6d760662016-02-20 16:05:43 +05301301 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001302 uint8_t channel;
1303 uint8_t src; /* To check if its a REASSOC or a FASTREASSOC IOCTL */
1304} tCsrHandoffRequest;
1305
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001306#ifdef FEATURE_WLAN_ESE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001307typedef struct tagCsrEseBeaconReqParams {
1308 uint16_t measurementToken;
1309 uint8_t channel;
1310 uint8_t scanMode;
1311 uint16_t measurementDuration;
1312} tCsrEseBeaconReqParams, *tpCsrEseBeaconReqParams;
1313
1314typedef struct tagCsrEseBeaconReq {
1315 uint8_t numBcnReqIe;
1316 tCsrEseBeaconReqParams bcnReq[SIR_ESE_MAX_MEAS_IE_REQS];
1317} tCsrEseBeaconReq, *tpCsrEseBeaconReq;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001318#endif /* FEATURE_WLAN_ESE */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001319
Jeff Johnsone6bf7192017-11-07 15:16:09 -08001320struct csr_del_sta_params {
Anurag Chouhan6d760662016-02-20 16:05:43 +05301321 struct qdf_mac_addr peerMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001322 uint16_t reason_code;
1323 uint8_t subtype;
1324};
1325
Masti, Narayanraddiab712a72016-08-04 11:59:11 +05301326/**
1327 * struct wep_update_default_key_idx: wep default key index structure
1328 * @session_id: session ID for the connection session
1329 * @default_idx: default key index for wep
1330 *
1331 * structure includes sesssion id for connection and default key
1332 * index used for wep
1333 */
1334struct wep_update_default_key_idx {
1335 uint8_t session_id;
1336 uint8_t default_idx;
1337};
1338
Jeff Johnson6a18c962018-07-01 09:09:37 -07001339typedef QDF_STATUS (*csr_roam_complete_cb)(void *context,
1340 struct csr_roam_info *param,
1341 uint32_t roam_id,
1342 eRoamCmdStatus roam_status,
1343 eCsrRoamResult roam_result);
Pragaspathi Thilagaraj3551caa2018-09-26 15:52:56 +05301344typedef QDF_STATUS (*csr_session_open_cb)(uint8_t session_id,
1345 QDF_STATUS qdf_status);
Krunal Soni8d184fa2017-11-20 21:52:05 -08001346typedef QDF_STATUS (*csr_session_close_cb)(uint8_t session_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001347
1348#define CSR_IS_START_IBSS(pProfile) (eCSR_BSS_TYPE_START_IBSS == \
1349 (pProfile)->BSSType)
1350#define CSR_IS_JOIN_TO_IBSS(pProfile) (eCSR_BSS_TYPE_IBSS == \
1351 (pProfile)->BSSType)
1352#define CSR_IS_IBSS(pProfile) (CSR_IS_START_IBSS(pProfile) || \
1353 CSR_IS_JOIN_TO_IBSS(pProfile))
1354#define CSR_IS_INFRASTRUCTURE(pProfile) (eCSR_BSS_TYPE_INFRASTRUCTURE == \
1355 (pProfile)->BSSType)
1356#define CSR_IS_ANY_BSS_TYPE(pProfile) (eCSR_BSS_TYPE_ANY == \
1357 (pProfile)->BSSType)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001358#define CSR_IS_INFRA_AP(pProfile) (eCSR_BSS_TYPE_INFRA_AP == \
1359 (pProfile)->BSSType)
Nachiket Kukade2fb1fdb2019-01-08 15:35:27 +05301360#ifdef WLAN_FEATURE_NAN
Deepak Dhamdheree2dd5442016-05-27 15:05:51 -07001361#define CSR_IS_NDI(profile) (eCSR_BSS_TYPE_NDI == (profile)->BSSType)
1362#else
1363#define CSR_IS_NDI(profile) (false)
1364#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001365#define CSR_IS_CONN_INFRA_AP(pProfile) (eCSR_BSS_TYPE_INFRA_AP == \
1366 (pProfile)->BSSType)
Nachiket Kukade2fb1fdb2019-01-08 15:35:27 +05301367#ifdef WLAN_FEATURE_NAN
Deepak Dhamdheree2dd5442016-05-27 15:05:51 -07001368#define CSR_IS_CONN_NDI(profile) (eCSR_BSS_TYPE_NDI == (profile)->BSSType)
1369#else
1370#define CSR_IS_CONN_NDI(profile) (false)
1371#endif
1372
Padma, Santhosh Kumar2b1e57e2017-09-14 14:42:43 +05301373#ifdef WLAN_FEATURE_SAE
1374#define CSR_IS_AUTH_TYPE_SAE(auth_type) \
1375 (eCSR_AUTH_TYPE_SAE == auth_type)
1376#else
1377#define CSR_IS_AUTH_TYPE_SAE(auth_type) (false)
1378#endif
1379
Jeff Johnsonedece842018-12-02 11:13:52 -08001380QDF_STATUS csr_set_channels(struct mac_context *mac, tCsrConfigParam *pParam);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001381
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001382/* enum to string conversion for debug output */
1383const char *get_e_roam_cmd_status_str(eRoamCmdStatus val);
1384const char *get_e_csr_roam_result_str(eCsrRoamResult val);
wadesongcb0ded22018-02-02 17:57:20 +08001385const char *csr_phy_mode_str(eCsrPhyMode phy_mode);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001386typedef void (*tCsrStatsCallback)(void *stats, void *pContext);
1387typedef void (*tCsrRssiCallback)(int8_t rssi, uint32_t staId, void *pContext);
1388
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001389#ifdef FEATURE_WLAN_ESE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001390typedef void (*tCsrTsmStatsCallback)(tAniTrafStrmMetrics tsmMetrics,
1391 uint32_t staId, void *pContext);
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001392#endif /* FEATURE_WLAN_ESE */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001393typedef void (*tCsrSnrCallback)(int8_t snr, uint32_t staId, void *pContext);
Jeff Johnson6e46f6d2018-06-03 15:32:14 -07001394
1395/**
1396 * csr_roam_issue_ft_preauth_req() - Initiate Preauthentication request
1397 * @max_ctx: Global MAC context
1398 * @session_id: SME Session ID
1399 * @bss_desc: BSS descriptor
1400 *
1401 * Return: Success or Failure
1402 */
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -08001403#ifdef WLAN_FEATURE_HOST_ROAM
Jeff Johnsonedece842018-12-02 11:13:52 -08001404QDF_STATUS csr_roam_issue_ft_preauth_req(struct mac_context *mac_ctx,
Jeff Johnson6e46f6d2018-06-03 15:32:14 -07001405 uint32_t session_id,
1406 tpSirBssDescription bss_desc);
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -08001407#else
Jeff Johnson6e46f6d2018-06-03 15:32:14 -07001408static inline
Jeff Johnsonedece842018-12-02 11:13:52 -08001409QDF_STATUS csr_roam_issue_ft_preauth_req(struct mac_context *mac_ctx,
Jeff Johnson6e46f6d2018-06-03 15:32:14 -07001410 uint32_t session_id,
1411 tpSirBssDescription bss_desc)
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -08001412{
1413 return QDF_STATUS_E_NOSUPPORT;
1414}
1415#endif
Jeff Johnsonbfd24632018-10-30 09:28:50 -07001416enum band_info csr_get_current_band(struct mac_context *mac);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001417typedef void (*csr_readyToSuspendCallback)(void *pContext, bool suspended);
1418#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
1419typedef void (*csr_readyToExtWoWCallback)(void *pContext, bool status);
1420#endif
Jeff Johnsonca7a7162018-07-07 12:56:54 -07001421typedef void (*csr_link_status_callback)(uint8_t status, void *context);
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08001422#ifdef FEATURE_WLAN_TDLS
Jeff Johnsonedece842018-12-02 11:13:52 -08001423void csr_roam_fill_tdls_info(struct mac_context *mac_ctx,
Jeff Johnson172237b2017-11-07 15:32:59 -08001424 struct csr_roam_info *roam_info,
1425 tpSirSmeJoinRsp join_rsp);
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08001426#else
Jeff Johnsonedece842018-12-02 11:13:52 -08001427static inline void csr_roam_fill_tdls_info(struct mac_context *mac_ctx,
Jeff Johnson172237b2017-11-07 15:32:59 -08001428 struct csr_roam_info *roam_info,
1429 tpSirSmeJoinRsp join_rsp)
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08001430{}
1431#endif
Jeff Johnson74df5852018-10-30 12:07:12 -07001432
1433/**
1434 * csr_packetdump_timer_stop() - stops packet dump timer
1435 *
1436 * This function is used to stop packet dump timer
1437 *
1438 * Return: None
1439 *
1440 */
Himanshu Agarwalf65bd4c2016-12-05 17:21:12 +05301441void csr_packetdump_timer_stop(void);
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08001442
gaoleze5108942017-03-31 16:56:42 +08001443/**
1444 * csr_get_channel_status() - get chan info via channel number
Jeff Johnson1be200a2018-07-07 10:57:32 -07001445 * @mac: Pointer to Global MAC structure
gaoleze5108942017-03-31 16:56:42 +08001446 * @channel_id: channel id
1447 *
1448 * Return: chan status info
1449 */
Jeff Johnson1be200a2018-07-07 10:57:32 -07001450struct lim_channel_status *
Jeff Johnsonedece842018-12-02 11:13:52 -08001451csr_get_channel_status(struct mac_context *mac, uint32_t channel_id);
gaoleze5108942017-03-31 16:56:42 +08001452
1453/**
1454 * csr_clear_channel_status() - clear chan info
Jeff Johnson1be200a2018-07-07 10:57:32 -07001455 * @mac: Pointer to Global MAC structure
gaoleze5108942017-03-31 16:56:42 +08001456 *
1457 * Return: none
1458 */
Jeff Johnsonedece842018-12-02 11:13:52 -08001459void csr_clear_channel_status(struct mac_context *mac);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001460#endif