blob: 70c9d6a2f86caf4984941d387e378799fa94f166 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Liangwei Dongc1956bd2020-01-07 19:50:57 +08002 * Copyright (c) 2012-2020 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
19/*
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080020 * This file sir_api.h contains definitions exported by
21 * Sirius software.
22 * Author: Chandra Modumudi
23 * Date: 04/16/2002
24 * History:-
25 * Date Modified by Modification Information
26 * --------------------------------------------------------------------
27 */
28
29#ifndef __SIR_API_H
30#define __SIR_API_H
31
Jeff Johnson009c40f2018-11-05 09:54:37 -080032/* legacy definition */
Jeff Johnson17c631b2018-12-10 09:10:58 -080033typedef void *tpAniSirGlobal;
Anurag Chouhan5de8d172016-07-13 14:44:28 +053034
Jeff Johnson17c631b2018-12-10 09:10:58 -080035struct mac_context;
Amar Singhale4f28ee2015-10-21 14:36:56 -070036#include "qdf_types.h"
Amar Singhale4f28ee2015-10-21 14:36:56 -070037#include "cds_regdomain.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080038#include "sir_types.h"
39#include "sir_mac_prot_def.h"
40#include "ani_system_defs.h"
41#include "sir_params.h"
Naveen Rawat3b6068c2016-04-14 19:01:06 -070042#include "cds_regdomain.h"
Dustin Brown877a5a92016-11-17 13:56:52 -080043#include "wmi_unified.h"
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +053044#include "wmi_unified_param.h"
Zhang Qiana6e9c102016-12-22 16:47:24 +080045#include "ol_txrx_htt_api.h"
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -070046#include "wlan_reg_services_api.h"
Anurag Chouhan5de8d172016-07-13 14:44:28 +053047#include <dot11f.h>
Tushnim Bhattacharyya9e81b4c2017-02-15 17:11:14 -080048#include "wlan_policy_mgr_api.h"
Bala Venkatesh4a72b062018-11-13 13:04:49 +053049#include "wlan_tdls_public_structs.h"
Srinivas Girigowdad462f3b2019-03-25 14:05:33 -070050#include "qca_vendor.h"
Ashish Kumar Dhanotiya1ac41882019-06-27 20:35:31 +053051#include "wlan_cp_stats_mc_defs.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080052
53#define OFFSET_OF(structType, fldName) (&((structType *)0)->fldName)
54
55/* / Max supported channel list */
56#define SIR_MAX_SUPPORTED_CHANNEL_LIST 96
Wu Gao0821b0d2019-01-11 17:31:11 +080057#define CFG_VALID_CHANNEL_LIST_LEN 100
Wu Gaoaa155142019-01-14 15:09:26 +080058#define CFG_COUNTRY_CODE_LEN 3
59
Srinivas Girigowdad65dc5a2016-01-14 17:08:26 -080060#define SIR_MDIE_SIZE 3 /* MD ID(2 bytes), Capability(1 byte) */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080061
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +053062#define SIR_MAX_ELEMENT_ID 255
63
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080064#define SIR_BCN_REPORT_MAX_BSS_DESC 4
65
66#define SIR_NUM_11B_RATES 4 /* 1,2,5.5,11 */
67#define SIR_NUM_11A_RATES 8 /* 6,9,12,18,24,36,48,54 */
68
Srinivas Girigowdad1e45b82019-04-15 15:08:28 -070069typedef uint8_t tSirIpv4Addr[QDF_IPV4_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080070
71#define SIR_VERSION_STRING_LEN 64
72typedef uint8_t tSirVersionString[SIR_VERSION_STRING_LEN];
73
74/* Periodic Tx pattern offload feature */
75#define PERIODIC_TX_PTRN_MAX_SIZE 1536
76#define MAXNUM_PERIODIC_TX_PTRNS 6
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080077
Abhishek Singhd1f21c72019-01-21 15:16:34 +053078/* FW response timeout values in milli seconds */
Abhishek Singh5606ee02019-08-19 13:18:01 +053079#define SIR_PEER_ASSOC_TIMEOUT (4000) /* 4 seconds */
80
Abhishek Singh682cf6f2019-08-19 11:45:00 +053081#ifdef FEATURE_RUNTIME_PM
82/* Add extra PMO_RESUME_TIMEOUT for runtime PM resume timeout */
Abhishek Singh5606ee02019-08-19 13:18:01 +053083#define SIR_DELETE_STA_TIMEOUT (4000 + PMO_RESUME_TIMEOUT)
Abhishek Singh682cf6f2019-08-19 11:45:00 +053084#define SIR_VDEV_PLCY_MGR_TIMEOUT (2000 + PMO_RESUME_TIMEOUT)
85#else
Abhishek Singh5606ee02019-08-19 13:18:01 +053086#define SIR_DELETE_STA_TIMEOUT (4000) /* 4 seconds */
Abhishek Singhd1f21c72019-01-21 15:16:34 +053087#define SIR_VDEV_PLCY_MGR_TIMEOUT (2000)
Abhishek Singh682cf6f2019-08-19 11:45:00 +053088#endif
89
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080090/* This should not be greater than MAX_NUMBER_OF_CONC_CONNECTIONS */
91#define MAX_VDEV_SUPPORTED 4
92
Manjeet Singhf82ed072016-07-08 11:40:00 +053093#define MAX_POWER_DBG_ARGS_SUPPORTED 8
Agrawal Ashishad16bda2016-09-16 20:16:04 +053094#define QOS_MAP_MAX_EX 21
Min Liue523f552020-08-10 18:32:00 +080095#define QOS_MAP_RANGE_NUM 8
96#define QOS_MAP_LEN_MIN (QOS_MAP_RANGE_NUM * 2)
Agrawal Ashishad16bda2016-09-16 20:16:04 +053097#define QOS_MAP_LEN_MAX \
98 (QOS_MAP_LEN_MIN + 2 * QOS_MAP_MAX_EX)
Himanshu Agarwal37e42412016-07-21 14:35:09 +053099#define NUM_CHAINS_MAX 2
100
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530101/* Maximum number of realms present in fils indication element */
102#define SIR_MAX_REALM_COUNT 7
103/* Realm length */
104#define SIR_REALM_LEN 2
105/* Cache ID length */
106#define CACHE_ID_LEN 2
107
Will Huang496b36c2017-07-11 16:38:50 +0800108/* Maximum peer station number query one time */
109#define MAX_PEER_STA 12
110
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -0800111/* Maximum number of peers for SAP */
Rachit Kankane154559c2018-07-12 14:02:30 +0530112#ifndef SIR_SAP_MAX_NUM_PEERS
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -0800113#define SIR_SAP_MAX_NUM_PEERS 32
Rachit Kankane154559c2018-07-12 14:02:30 +0530114#endif
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -0800115
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800116#define SIR_KRK_KEY_LEN 16
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800117#define SIR_BTK_KEY_LEN 32
118#define SIR_KCK_KEY_LEN 16
Pragaspathi Thilagarajeb367282019-02-19 00:42:28 +0530119#define KCK_192BIT_KEY_LEN 24
120#define KCK_256BIT_KEY_LEN 32
121
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800122#define SIR_KEK_KEY_LEN 16
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +0530123#define SIR_KEK_KEY_LEN_FILS 64
Pragaspathi Thilagarajeb367282019-02-19 00:42:28 +0530124#define KEK_256BIT_KEY_LEN 32
125
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800126#define SIR_REPLAY_CTR_LEN 8
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +0530127#define SIR_PMK_LEN 48
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -0800128#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800129#define SIR_UAPSD_BITOFFSET_ACVO 0
130#define SIR_UAPSD_BITOFFSET_ACVI 1
131#define SIR_UAPSD_BITOFFSET_ACBK 2
132#define SIR_UAPSD_BITOFFSET_ACBE 3
133
134#define SIR_UAPSD_FLAG_ACVO (1 << SIR_UAPSD_BITOFFSET_ACVO)
135#define SIR_UAPSD_FLAG_ACVI (1 << SIR_UAPSD_BITOFFSET_ACVI)
136#define SIR_UAPSD_FLAG_ACBK (1 << SIR_UAPSD_BITOFFSET_ACBK)
137#define SIR_UAPSD_FLAG_ACBE (1 << SIR_UAPSD_BITOFFSET_ACBE)
138#define SIR_UAPSD_GET(ac, mask) (((mask) & (SIR_UAPSD_FLAG_ ## ac)) >> SIR_UAPSD_BITOFFSET_ ## ac)
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800139
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800140#endif
141
Nachiket Kukade63bb63d2018-11-21 14:42:14 +0530142struct scheduler_msg;
143
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800144/**
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700145 * enum sir_roam_op_code - Operation to be done by the callback.
146 * @SIR_ROAM_SYNCH_PROPAGATION: Propagate the new BSS info after roaming.
147 * @SIR_ROAMING_DEREGISTER_STA: Deregister the old STA after roaming.
Naveen Rawat8cc23b02016-07-14 12:22:56 -0700148 * @SIR_ROAMING_START: Firmware started roaming operation
149 * @SIR_ROAMING_ABORT: Firmware aborted roaming operation, still connected.
150 * @SIR_ROAM_SYNCH_COMPLETE: Roam sync propagation is complete.
Arif Hussain43354e62017-05-24 11:24:25 -0700151 * @SIR_ROAMING_INVOKE_FAIL: Firmware roaming failed.
bingsfe33a7c2019-09-09 16:06:33 +0800152 * @SIR_ROAMING_DEAUTH: Firmware indicates deauth.
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700153 */
154enum sir_roam_op_code {
155 SIR_ROAM_SYNCH_PROPAGATION = 1,
156 SIR_ROAMING_DEREGISTER_STA,
Naveen Rawat8cc23b02016-07-14 12:22:56 -0700157 SIR_ROAMING_START,
158 SIR_ROAMING_ABORT,
159 SIR_ROAM_SYNCH_COMPLETE,
Varun Reddy Yeturu04251862016-09-16 10:33:19 -0700160 SIR_ROAM_SYNCH_NAPI_OFF,
Arif Hussain43354e62017-05-24 11:24:25 -0700161 SIR_ROAMING_INVOKE_FAIL,
bingsfe33a7c2019-09-09 16:06:33 +0800162 SIR_ROAMING_DEAUTH,
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700163};
164/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800165 * Module ID definitions.
166 */
167enum {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800168 SIR_HAL_MODULE_ID = 0x10,
Wu Gao55020ec2019-01-23 14:29:58 +0800169 SIR_LIM_MODULE_ID = 0x13,
Jeff Johnsona2f8e8f2018-12-30 18:06:58 -0800170 SIR_SME_MODULE_ID,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800171};
172
173#define SIR_WMA_MODULE_ID SIR_HAL_MODULE_ID
174
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800175/* Type declarations used by Firmware and Host software */
176
177/* Scan type enum used in scan request */
178typedef enum eSirScanType {
179 eSIR_PASSIVE_SCAN,
180 eSIR_ACTIVE_SCAN,
181 eSIR_BEACON_TABLE,
182} tSirScanType;
183
gaurank kathpaliac63859d2018-05-03 18:48:41 +0530184/* Rsn Capabilities structure */
185struct rsn_caps {
186 uint16_t PreAuthSupported:1;
187 uint16_t NoPairwise:1;
188 uint16_t PTKSAReplayCounter:2;
189 uint16_t GTKSAReplayCounter:2;
190 uint16_t MFPRequired:1;
191 uint16_t MFPCapable:1;
192 uint16_t Reserved:8;
193};
194
Abhinav Kumar4d1f9f42019-05-07 13:14:49 +0530195/**
Abhishek Ambure5e9b6a42020-02-12 21:32:35 +0530196 * struct roam_scan_ch_resp - roam scan chan list response to userspace
197 * @vdev_id: vdev id
198 * @num_channels: number of roam scan channels
199 * @command_resp: command response or async event
200 * @chan_list: list of roam scan channels
201 */
202struct roam_scan_ch_resp {
203 uint16_t vdev_id;
204 uint16_t num_channels;
205 uint32_t command_resp;
206 uint32_t *chan_list;
207};
208
209/**
Abhinav Kumar4d1f9f42019-05-07 13:14:49 +0530210 * struct wlan_beacon_report - Beacon info to be send to userspace
Abhinav Kumar335074e2019-11-21 17:29:44 +0530211 * @vdev_id: vdev id
Abhinav Kumar4d1f9f42019-05-07 13:14:49 +0530212 * @ssid: ssid present in beacon
213 * @bssid: bssid present in beacon
214 * @frequency: channel frequency in MHz
215 * @beacon_interval: Interval between two consecutive beacons
216 * @time_stamp: time stamp at which beacon received from AP
217 * @boot_time: Boot time when beacon received
218 */
219struct wlan_beacon_report {
Abhinav Kumar335074e2019-11-21 17:29:44 +0530220 uint8_t vdev_id;
Abhinav Kumar4d1f9f42019-05-07 13:14:49 +0530221 struct wlan_ssid ssid;
222 struct qdf_mac_addr bssid;
223 uint32_t frequency;
224 uint16_t beacon_interval;
225 qdf_time_t time_stamp;
226 qdf_time_t boot_time;
227};
228
229
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800230/* / Result codes Firmware return to Host SW */
231typedef enum eSirResultCodes {
232 eSIR_SME_SUCCESS,
Abhishek Singh4294f802017-08-10 16:37:07 +0530233 eSIR_LOGE_EXCEPTION,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800234 eSIR_SME_INVALID_PARAMETERS = 500,
235 eSIR_SME_UNEXPECTED_REQ_RESULT_CODE,
236 eSIR_SME_RESOURCES_UNAVAILABLE,
237 /* Unable to find a BssDescription */
238 eSIR_SME_SCAN_FAILED,
239 /* matching requested scan criteria */
240 eSIR_SME_BSS_ALREADY_STARTED_OR_JOINED,
241 eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE,
242 eSIR_SME_REFUSED,
243 eSIR_SME_JOIN_DEAUTH_FROM_AP_DURING_ADD_STA,
244 eSIR_SME_JOIN_TIMEOUT_RESULT_CODE,
245 eSIR_SME_AUTH_TIMEOUT_RESULT_CODE,
246 eSIR_SME_ASSOC_TIMEOUT_RESULT_CODE,
247 eSIR_SME_REASSOC_TIMEOUT_RESULT_CODE,
248 eSIR_SME_MAX_NUM_OF_PRE_AUTH_REACHED,
249 eSIR_SME_AUTH_REFUSED,
250 eSIR_SME_INVALID_WEP_DEFAULT_KEY,
251 eSIR_SME_NO_KEY_MAPPING_KEY_FOR_PEER,
252 eSIR_SME_ASSOC_REFUSED,
253 eSIR_SME_REASSOC_REFUSED,
254 /* Recvd Deauth while join/pre-auth */
255 eSIR_SME_DEAUTH_WHILE_JOIN,
256 eSIR_SME_STA_NOT_AUTHENTICATED,
257 eSIR_SME_STA_NOT_ASSOCIATED,
258 eSIR_SME_ALREADY_JOINED_A_BSS,
259 /* Given in SME_SCAN_RSP msg */
260 eSIR_SME_MORE_SCAN_RESULTS_FOLLOW,
261 /* that more SME_SCAN_RSP */
262 /* messages are following. */
263 /* SME_SCAN_RSP message with */
264 /* eSIR_SME_SUCCESS status */
265 /* code is the last one. */
266 /* Sent in SME_JOIN/REASSOC_RSP */
267 eSIR_SME_INVALID_ASSOC_RSP_RXED,
268 /* messages upon receiving */
269 /* invalid Re/Assoc Rsp frame. */
270 /* STOP BSS triggered by MIC failures: MAC software to
271 * disassoc all stations
272 */
273 eSIR_SME_MIC_COUNTER_MEASURES,
274 /* with MIC_FAILURE reason code and perform the stop bss operation */
275 /* didn't get rsp from peer within timeout interval */
276 eSIR_SME_ADDTS_RSP_TIMEOUT,
277 /* didn't get success rsp from HAL */
278 eSIR_SME_ADDTS_RSP_FAILED,
279 /* failed to send ch switch act frm */
280 eSIR_SME_CHANNEL_SWITCH_FAIL,
281 eSIR_SME_INVALID_STATE,
282 /* SIR_HAL_SIR_HAL_INIT_SCAN_RSP returned failed status */
283 eSIR_SME_HAL_SCAN_INIT_FAILED,
284 /* SIR_HAL_END_SCAN_RSP returned failed status */
285 eSIR_SME_HAL_SCAN_END_FAILED,
286 /* SIR_HAL_FINISH_SCAN_RSP returned failed status */
287 eSIR_SME_HAL_SCAN_FINISH_FAILED,
288 /* Failed to send a message to HAL */
289 eSIR_SME_HAL_SEND_MESSAGE_FAIL,
290 /* Failed to stop the bss */
291 eSIR_SME_STOP_BSS_FAILURE,
292 eSIR_SME_WOWL_ENTER_REQ_FAILED,
293 eSIR_SME_WOWL_EXIT_REQ_FAILED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800294 eSIR_SME_FT_REASSOC_TIMEOUT_FAILURE,
295 eSIR_SME_FT_REASSOC_FAILURE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800296 eSIR_SME_SEND_ACTION_FAIL,
297 eSIR_SME_DEAUTH_STATUS,
298 eSIR_PNO_SCAN_SUCCESS,
Varun Reddy Yeturu371404b2017-11-30 15:31:35 -0800299 eSIR_SME_INVALID_SESSION,
Varun Reddy Yeturua47f08f2018-08-07 14:45:31 -0700300 eSIR_SME_PEER_CREATE_FAILED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800301 eSIR_DONOT_USE_RESULT_CODE = SIR_MAX_ENUM_SIZE
302} tSirResultCodes;
303
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +0530304#ifdef WLAN_FEATURE_FILS_SK
305struct fils_join_rsp_params {
306 uint8_t *fils_pmk;
307 uint8_t fils_pmk_len;
308 uint8_t fils_pmkid[PMKID_LEN];
309 uint8_t kek[MAX_KEK_LEN];
310 uint8_t kek_len;
311 uint8_t tk[MAX_TK_LEN];
312 uint8_t tk_len;
313 uint8_t gtk_len;
314 uint8_t gtk[MAX_GTK_LEN];
Vignesh Viswanathana1bb0922017-09-15 12:58:48 +0530315 struct qdf_mac_addr dst_mac;
316 struct qdf_mac_addr src_mac;
317 uint16_t hlp_data_len;
318 uint8_t hlp_data[FILS_MAX_HLP_DATA_LEN];
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +0530319};
320#endif
321
Krishna Kumaar Natarajanf599c6e2015-11-03 11:44:03 -0800322#define RMENABLEDCAP_MAX_LEN 5
323
324struct rrm_config_param {
325 uint8_t rrm_enabled;
Ashish Kumar Dhanotiya70addb32020-04-23 15:47:48 +0530326 bool sap_rrm_enabled;
Krishna Kumaar Natarajanf599c6e2015-11-03 11:44:03 -0800327 uint8_t max_randn_interval;
328 uint8_t rm_capability[RMENABLEDCAP_MAX_LEN];
329};
330
Sreelakshmi Konamki39acb132015-12-16 13:06:22 +0530331const char *lim_bss_type_to_string(const uint16_t bss_type);
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700332/**
Jeff Johnsonecd4f212019-02-01 19:36:34 -0800333 * struct supported_rates - stores rates/MCS supported
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700334 * @llbRates: 11b rates in unit of 500kbps
335 * @llaRates: 11a rates in unit of 500kbps
336 * @supportedMCSSet: supported basic MCS, 0-76 bits used, remaining reserved
337 * bits 0-15 and 32 should be set.
338 * @rxHighestDataRate: RX Highest Supported Data Rate defines the highest data
339 * rate that the STA is able to receive, in unites of 1Mbps
340 * This value is derived from "Supported MCS Set field"
341 * inside the HT capability element.
342 * @vhtRxMCSMap: Indicates the Maximum MCS(VHT) that can be received for each
343 * number of spacial streams
344 * @vhtRxHighestDataRate: Indicate the highest VHT data rate that the STA is
345 * able to receive
346 * @vhtTxMCSMap: Indicates the Maximum MCS(VHT) that can be transmitted for
347 * each number of spacial streams
348 * @vhtTxHighestDataRate: Indicate the highest VHT data rate that the STA is
349 * able to transmit
350 * @he_rx_mcs: Indicates the Maximum MCS(HE) that can be received for each
351 * number of spacial streams
352 * @he_tx_mcs: Indicates the Maximum MCS(HE) that can be transmitted for each
353 * number of spacial streams
354 */
Jeff Johnsonecd4f212019-02-01 19:36:34 -0800355struct supported_rates {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800356 uint16_t llbRates[SIR_NUM_11B_RATES];
357 uint16_t llaRates[SIR_NUM_11A_RATES];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800358 uint8_t supportedMCSSet[SIR_MAC_MAX_SUPPORTED_MCS_SET];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800359 uint16_t rxHighestDataRate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800360 uint16_t vhtRxMCSMap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800361 uint16_t vhtRxHighestDataRate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800362 uint16_t vhtTxMCSMap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800363 uint16_t vhtTxHighestDataRate;
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700364#ifdef WLAN_FEATURE_11AX
Naveen Rawataeca1b92017-10-16 16:55:31 -0700365 uint16_t rx_he_mcs_map_lt_80;
366 uint16_t tx_he_mcs_map_lt_80;
367 uint16_t rx_he_mcs_map_160;
368 uint16_t tx_he_mcs_map_160;
369 uint16_t rx_he_mcs_map_80_80;
370 uint16_t tx_he_mcs_map_80_80;
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700371#endif
Jeff Johnsonecd4f212019-02-01 19:36:34 -0800372};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800373
Jeff Johnson78f7a182019-02-01 22:45:41 -0800374struct register_mgmt_frame {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800375 uint16_t messageType;
376 uint16_t length;
377 uint8_t sessionId;
378 bool registerFrame;
379 uint16_t frameType;
380 uint16_t matchLen;
381 uint8_t matchData[1];
Jeff Johnson78f7a182019-02-01 22:45:41 -0800382};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800383
384/* / Generic type for sending a response message */
385/* / with result code to host software */
386typedef struct sSirSmeRsp {
387 uint16_t messageType; /* eWNI_SME_*_RSP */
388 uint16_t length;
Abhishek Singh345be412019-11-19 10:59:29 +0530389 uint8_t vdev_id;
Pragaspathi Thilagarajd48e6cd2019-05-30 00:52:43 +0530390 tSirResultCodes status_code;
Kabilan Kannanf56f9d52017-04-05 03:31:34 -0700391 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800392} tSirSmeRsp, *tpSirSmeRsp;
393
394/* / Definition for indicating all modules ready on STA */
Jeff Johnson47e4b552019-02-01 23:12:25 -0800395struct sme_ready_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800396 uint16_t messageType; /* eWNI_SME_SYS_READY_IND */
397 uint16_t length;
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800398 void *csr_roam_synch_cb;
Pragaspathi Thilagaraj7a7163b2019-07-14 22:47:09 +0530399 QDF_STATUS (*csr_roam_auth_event_handle_cb)(struct mac_context *mac,
400 uint8_t vdev_id,
401 struct qdf_mac_addr bssid);
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800402 void *pe_roam_synch_cb;
Vignesh Viswanathan3d478032018-08-02 20:18:53 +0530403 void *stop_roaming_cb;
Jeff Johnsone044f202018-12-02 10:27:28 -0800404 QDF_STATUS (*sme_msg_cb)(struct mac_context *mac,
Jeff Johnson5f9ce2d2018-06-09 21:20:45 -0700405 struct scheduler_msg *msg);
Pragaspathi Thilagarajb0176502019-04-26 02:33:13 +0530406 QDF_STATUS (*pe_disconnect_cb) (struct mac_context *mac,
Srinivas Dasariea472272019-06-30 11:35:07 +0530407 uint8_t vdev_id,
408 uint8_t *deauth_disassoc_frame,
Pragaspathi Thilagarajf9126b62020-02-06 16:46:46 +0530409 uint16_t deauth_disassoc_frame_len,
410 uint16_t reason_code);
Srikanth Marepalli6a872782020-01-24 18:12:05 +0530411 void *csr_roam_pmkid_req_cb;
Jeff Johnson47e4b552019-02-01 23:12:25 -0800412};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800413
414/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800415 * struct s_sir_set_hw_mode - Set HW mode request
416 * @messageType: Message type
417 * @length: Length of the message
418 * @set_hw: Params containing the HW mode index and callback
419 */
420struct s_sir_set_hw_mode {
421 uint16_t messageType;
422 uint16_t length;
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -0800423 struct policy_mgr_hw_mode set_hw;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800424};
425
426/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800427 * struct sir_set_dual_mac_cfg - Set Dual mac config request
428 * @message_type: Message type
429 * @length: Length of the message
430 * @set_dual_mac: Params containing the dual mac config and callback
431 */
432struct sir_set_dual_mac_cfg {
433 uint16_t message_type;
434 uint16_t length;
Srinivas Girigowdaeb6ecf32018-02-15 17:04:22 -0800435 struct policy_mgr_dual_mac_config set_dual_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800436};
437
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800438/**
439 * struct sir_antenna_mode_param - antenna mode param
440 * @num_tx_chains: Number of TX chains
441 * @num_rx_chains: Number of RX chains
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800442 * @set_antenna_mode_resp: callback to set antenna mode command
Dundi Raviteja6bb9e322018-05-16 17:04:41 +0530443 * @set_antenna_mode_ctx: callback context to set antenna mode command
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800444 */
445struct sir_antenna_mode_param {
446 uint32_t num_tx_chains;
447 uint32_t num_rx_chains;
448 void *set_antenna_mode_resp;
Dundi Raviteja6bb9e322018-05-16 17:04:41 +0530449 void *set_antenna_mode_ctx;
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800450};
451
452/**
453 * struct sir_set_antenna_mode - Set antenna mode request
454 * @message_type: Message type
455 * @length: Length of the message
456 * @set_antenna_mode: Params containing antenna mode params
457 */
458struct sir_set_antenna_mode {
459 uint16_t message_type;
460 uint16_t length;
461 struct sir_antenna_mode_param set_antenna_mode;
462};
463
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700464/**
Pragaspathi Thilagarajafd0a482019-05-23 13:02:36 +0530465 * enum bss_type - Enum for BSS type used in scanning/joining etc.
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700466 *
467 * @eSIR_INFRASTRUCTURE_MODE: Infrastructure station
468 * @eSIR_INFRA_AP_MODE: softAP mode
469 * @eSIR_IBSS_MODE: IBSS mode
470 * @eSIR_AUTO_MODE: Auto role
471 * @eSIR_MONITOR_MODE: Monitor mode
472 * @eSIR_NDI_MODE: NAN datapath mode
473 */
Pragaspathi Thilagarajafd0a482019-05-23 13:02:36 +0530474enum bss_type {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800475 eSIR_INFRASTRUCTURE_MODE,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700476 eSIR_INFRA_AP_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800477 eSIR_IBSS_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800478 eSIR_AUTO_MODE,
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -0700479 eSIR_MONITOR_MODE,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700480 eSIR_NDI_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800481 eSIR_DONOT_USE_BSS_TYPE = SIR_MAX_ENUM_SIZE
Pragaspathi Thilagarajafd0a482019-05-23 13:02:36 +0530482};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800483
484/* / Power Capability info used in 11H */
Jeff Johnson39f02ae2019-02-01 23:42:38 -0800485struct power_cap_info {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800486 uint8_t minTxPower;
487 uint8_t maxTxPower;
Jeff Johnson39f02ae2019-02-01 23:42:38 -0800488};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800489
490/* / Supported Channel info used in 11H */
Jeff Johnsoned4f4d52019-02-02 00:09:45 -0800491struct supported_channels {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800492 uint8_t numChnl;
493 uint8_t channelList[SIR_MAX_SUPPORTED_CHANNEL_LIST];
Jeff Johnsoned4f4d52019-02-02 00:09:45 -0800494};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800495
496typedef enum eSirNwType {
497 eSIR_11A_NW_TYPE,
498 eSIR_11B_NW_TYPE,
499 eSIR_11G_NW_TYPE,
500 eSIR_11N_NW_TYPE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800501 eSIR_11AC_NW_TYPE,
Krishna Kumaar Natarajan4f1d7722017-03-03 21:12:51 -0800502 eSIR_11AX_NW_TYPE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800503 eSIR_DONOT_USE_NW_TYPE = SIR_MAX_ENUM_SIZE
504} tSirNwType;
505
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800506/* HT configuration values */
Jeff Johnson72ac2c82019-02-02 12:26:35 -0800507struct ht_config {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800508 /* Enable/Disable receiving LDPC coded packets */
509 uint32_t ht_rx_ldpc:1;
510 /* Enable/Disable TX STBC */
511 uint32_t ht_tx_stbc:1;
512 /* Enable/Disable RX STBC */
513 uint32_t ht_rx_stbc:2;
514 /* Enable/Disable SGI */
Sandeep Puligilla607f34a2016-05-25 14:37:47 -0700515 uint32_t ht_sgi20:1;
516 uint32_t ht_sgi40:1;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800517 uint32_t unused:27;
Jeff Johnson72ac2c82019-02-02 12:26:35 -0800518};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800519
Sandeep Puligilla98917432016-06-10 13:50:28 -0700520/**
Jeff Johnson118a4a02018-05-06 00:14:15 -0700521 * struct sir_vht_config - VHT capabilities
Sandeep Puligilla98917432016-06-10 13:50:28 -0700522 * @max_mpdu_len: MPDU length
523 * @supported_channel_widthset: channel width set
524 * @ldpc_coding: LDPC coding capability
525 * @shortgi80: short GI 80 support
526 * @shortgi160and80plus80: short Gi 160 & 80+80 support
527 * @tx_stbc; Tx STBC cap
528 * @tx_stbc: Rx STBC cap
529 * @su_beam_former: SU beam former cap
530 * @su_beam_formee: SU beam formee cap
531 * @csnof_beamformer_antSup: Antenna support for beamforming
532 * @num_soundingdim: Sound dimensions
533 * @mu_beam_former: MU beam former cap
534 * @mu_beam_formee: MU beam formee cap
535 * @vht_txops: TXOP power save
536 * @htc_vhtcap: HTC VHT capability
537 * @max_ampdu_lenexp: AMPDU length
538 * @vht_link_adapt: VHT link adapatation capable
539 * @rx_antpattern: Rx Antenna pattern
540 * @tx_antpattern: Tx Antenna pattern
541 */
542struct sir_vht_config {
543 uint32_t max_mpdu_len:2;
544 uint32_t supported_channel_widthset:2;
545 uint32_t ldpc_coding:1;
546 uint32_t shortgi80:1;
547 uint32_t shortgi160and80plus80:1;
548 uint32_t tx_stbc:1;
549 uint32_t rx_stbc:3;
550 uint32_t su_beam_former:1;
551 uint32_t su_beam_formee:1;
552 uint32_t csnof_beamformer_antSup:3;
553 uint32_t num_soundingdim:3;
554 uint32_t mu_beam_former:1;
555 uint32_t mu_beam_formee:1;
556 uint32_t vht_txops:1;
557 uint32_t htc_vhtcap:1;
558 uint32_t max_ampdu_lenexp:3;
559 uint32_t vht_link_adapt:2;
560 uint32_t rx_antpattern:1;
561 uint32_t tx_antpattern:1;
Kiran Kumar Lokerec220a512019-07-24 18:30:47 -0700562 uint32_t extended_nss_bw_supp:2;
563 uint8_t max_nsts_total:2;
564 uint8_t vht_extended_nss_bw_cap:1;
Sandeep Puligilla98917432016-06-10 13:50:28 -0700565};
566
567
Jeff Johnson90542e52019-02-02 13:59:56 -0800568struct add_ie_params {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800569 uint16_t probeRespDataLen;
570 uint8_t *probeRespData_buff;
571 uint16_t assocRespDataLen;
572 uint8_t *assocRespData_buff;
573 uint16_t probeRespBCNDataLen;
574 uint8_t *probeRespBCNData_buff;
Jeff Johnson90542e52019-02-02 13:59:56 -0800575};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800576
577/* / Definition for kick starting BSS */
578/* / ---> MAC */
579/**
580 * Usage of ssId, numSSID & ssIdList:
581 * ---------------------------------
582 * 1. ssId.length of zero indicates that Broadcast/Suppress SSID
583 * feature is enabled.
584 * 2. If ssId.length is zero, MAC SW will advertise NULL SSID
585 * and interpret the SSID list from numSSID & ssIdList.
586 * 3. If ssId.length is non-zero, MAC SW will advertise the SSID
587 * specified in the ssId field and it is expected that
588 * application will set numSSID to one (only one SSID present
589 * in the list) and SSID in the list is same as ssId field.
590 * 4. Application will always set numSSID >= 1.
591 */
592/* ***** NOTE: Please make sure all codes are updated if inserting field into
593 * this structure..********** */
Jeff Johnson704b8912019-02-02 14:38:14 -0800594struct start_bss_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800595 uint16_t messageType; /* eWNI_SME_START_BSS_REQ */
596 uint16_t length;
Abhishek Singh345be412019-11-19 10:59:29 +0530597 uint8_t vdev_id;
Jeff Johnson50d3ae62019-02-21 11:18:11 -0800598 struct qdf_mac_addr bssid;
599 struct qdf_mac_addr self_macaddr;
600 uint16_t beaconInterval;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800601 uint8_t dot11mode;
602#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
603 uint8_t cc_switch_mode;
604#endif
Pragaspathi Thilagarajafd0a482019-05-23 13:02:36 +0530605 enum bss_type bssType;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800606 tSirMacSSid ssId;
Kiran Kumar Lokere987377e2019-08-29 12:27:14 -0700607 uint32_t oper_ch_freq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800608 ePhyChanBondState cbMode;
609 uint8_t vht_channel_width;
610 uint8_t center_freq_seg0;
611 uint8_t center_freq_seg1;
612 uint8_t sec_ch_offset;
613
614 uint8_t privacy;
615 uint8_t apUapsdEnable;
616 uint8_t ssidHidden;
617 bool fwdWPSPBCProbeReq;
618 bool protEnabled;
619 bool obssProtEnabled;
620 uint16_t ht_capab;
621 tAniAuthType authType;
622 uint32_t dtimPeriod;
623 uint8_t wps_state;
624 uint8_t isCoalesingInIBSSAllowed; /* Coalesing on/off knob */
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800625 enum QDF_OPMODE bssPersona;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800626
627 uint8_t txLdpcIniFeatureEnabled;
628
629 tSirRSNie rsnIE; /* RSN IE to be sent in */
630 /* Beacon and Probe */
631 /* Response frames */
632 tSirNwType nwType; /* Indicates 11a/b/g */
633 tSirMacRateSet operationalRateSet; /* Has 11a or 11b rates */
634 tSirMacRateSet extendedRateSet; /* Has 11g rates */
Jeff Johnsonbe119e62019-02-02 12:30:26 -0800635 struct ht_config ht_config;
Sandeep Puligilla98917432016-06-10 13:50:28 -0700636 struct sir_vht_config vht_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800637#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -0700638 tDot11fIEhe_cap he_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800639#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800640#ifdef WLAN_FEATURE_11W
641 bool pmfCapable;
642 bool pmfRequired;
643#endif
644
Jeff Johnson21aac3a2019-02-02 14:26:13 -0800645 struct add_ie_params add_ie_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800646
647 bool obssEnabled;
648 uint8_t sap_dot11mc;
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800649 uint16_t beacon_tx_rate;
Kapil Gupta4b2efbb2016-10-03 13:07:20 +0530650 bool vendor_vht_sap;
Arif Hussain671a1902017-03-17 09:08:32 -0700651 uint32_t cac_duration_ms;
652 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800653
Jeff Johnson704b8912019-02-02 14:38:14 -0800654};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800655
656#define GET_IE_LEN_IN_BSS(lenInBss) (lenInBss + sizeof(lenInBss) - \
Pragaspathi Thilagaraj1112c962019-05-23 23:45:38 +0530657 ((uintptr_t)OFFSET_OF(struct bss_description,\
658 ieFields)))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800659
660#define WSCIE_PROBE_RSP_LEN (317 + 2)
661
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530662#ifdef WLAN_FEATURE_FILS_SK
663/* struct fils_ind_elements: elements parsed from fils indication present
664 * in beacon/probe resp
665 * @realm_cnt: number of realm present
666 * @realm: realms
667 * @is_fils_sk_supported: if FILS SK supported
668 * @is_cache_id_present: if cache id present
669 * @cache_id: cache id
670 */
671struct fils_ind_elements {
672 uint16_t realm_cnt;
673 uint8_t realm[SIR_MAX_REALM_COUNT][SIR_REALM_LEN];
674 bool is_fils_sk_supported;
675 bool is_cache_id_present;
676 uint8_t cache_id[CACHE_ID_LEN];
677};
678#endif
679
Jeff Johnsone58271f2017-10-06 09:58:59 -0700680struct bss_description {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800681 /* offset of the ieFields from bssId. */
682 uint16_t length;
683 tSirMacAddr bssId;
Arun Khandavalli8a711cb2017-01-03 20:23:56 +0530684 unsigned long scansystimensec;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800685 uint32_t timeStamp[2];
686 uint16_t beaconInterval;
687 uint16_t capabilityInfo;
688 tSirNwType nwType; /* Indicates 11a/b/g */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800689 int8_t rssi;
Deepak Dhamdhere68929ec2015-08-05 15:16:35 -0700690 int8_t rssi_raw;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800691 int8_t sinr;
Will Huangcac7e092019-07-25 13:35:22 +0800692 /* channel frequency what peer sent in beacon/probersp. */
wadesong91a2c1b2019-07-12 12:18:06 +0800693 uint32_t chan_freq;
Deepthi Gowri6acee342016-10-28 15:00:38 +0530694 /* Based on system time, not a relative time. */
695 uint64_t received_time;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800696 uint32_t parentTSF;
697 uint32_t startTSF[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800698 uint8_t mdiePresent;
699 /* MDIE for 11r, picked from the beacons */
700 uint8_t mdie[SIR_MDIE_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800701#ifdef FEATURE_WLAN_ESE
702 uint16_t QBSSLoad_present;
703 uint16_t QBSSLoad_avail;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800704#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800705 /* whether it is from a probe rsp */
706 uint8_t fProbeRsp;
Krishna Kumaar Natarajan89a99d42016-08-04 15:44:38 -0700707 tSirMacSeqCtl seq_ctrl;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800708 uint32_t tsf_delta;
Sandeep Puligillad8546bb2019-02-15 10:49:38 -0800709 struct scan_mbssid_info mbssid_info;
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530710#ifdef WLAN_FEATURE_FILS_SK
711 struct fils_ind_elements fils_info_element;
712#endif
Yeshwanth Sriram Guntukaa6c3d272019-04-13 12:25:53 +0530713 uint32_t assoc_disallowed;
Pragaspathi Thilagaraj1f3f99f2019-04-24 23:48:47 +0530714 uint32_t adaptive_11r_ap;
Abhinav Kumarade854f2020-05-06 16:13:05 +0530715 uint32_t mbo_oce_enabled_ap;
Abhinav Kumar243b43b2020-02-21 14:23:07 +0530716#if defined(WLAN_SAE_SINGLE_PMK) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
717 uint32_t is_single_pmk;
718#endif
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530719 /* Please keep the structure 4 bytes aligned above the ieFields */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800720 uint32_t ieFields[1];
Jeff Johnsone58271f2017-10-06 09:58:59 -0700721};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800722
723#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
Jeff Johnson704af112019-02-02 16:11:55 -0800724struct ht_profile {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800725 uint8_t dot11mode;
726 uint8_t htCapability;
727 uint8_t htSupportedChannelWidthSet;
728 uint8_t htRecommendedTxWidthSet;
729 ePhyChanBondState htSecondaryChannelOffset;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800730 uint8_t vhtCapability;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800731 uint8_t apCenterChan;
732 uint8_t apChanWidth;
Jeff Johnson704af112019-02-02 16:11:55 -0800733};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800734#endif
735/* / Definition for response message to previously */
736/* / issued start BSS request */
737/* / MAC ---> */
Jeff Johnsona0d34622019-02-02 17:26:19 -0800738struct start_bss_rsp {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800739 uint16_t messageType; /* eWNI_SME_START_BSS_RSP */
740 uint16_t length;
741 uint8_t sessionId;
Pragaspathi Thilagarajd48e6cd2019-05-30 00:52:43 +0530742 tSirResultCodes status_code;
Pragaspathi Thilagarajafd0a482019-05-23 13:02:36 +0530743 enum bss_type bssType; /* Add new type for WDS mode */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800744 uint16_t beaconInterval; /* Beacon Interval for both type */
Jeff Johnson179fd8a2018-05-11 14:20:05 -0700745 uint32_t staId; /* Station ID for Self */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800746#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
Jeff Johnsonf6541882019-02-02 16:16:00 -0800747 struct ht_profile ht_profile;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800748#endif
Pragaspathi Thilagaraj1112c962019-05-23 23:45:38 +0530749 struct bss_description bssDescription; /* Peer BSS description */
Jeff Johnsona0d34622019-02-02 17:26:19 -0800750};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800751
Jeff Johnson39f94e32019-02-02 18:11:47 -0800752struct report_channel_list {
Will Huang2f114542019-10-31 17:35:29 +0800753 uint8_t num_channels;
754 uint32_t chan_freq_lst[SIR_ESE_MAX_MEAS_IE_REQS];
Jeff Johnson39f94e32019-02-02 18:11:47 -0800755};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800756
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800757#ifdef FEATURE_OEM_DATA_SUPPORT
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700758struct oem_data_req {
Gupta, Kapil8a605e12016-06-08 14:14:35 +0530759 uint32_t data_len;
Krishna Kumaar Natarajan9ac8efd2015-11-20 13:40:24 -0800760 uint8_t *data;
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700761};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800762
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700763struct oem_data_rsp {
Krishna Kumaar Natarajan608291e2015-12-14 18:17:27 -0800764 uint32_t rsp_len;
Krishna Kumaar Natarajan73ea9f22016-06-30 18:38:47 -0700765 uint8_t *data;
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700766};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800767#endif /* FEATURE_OEM_DATA_SUPPORT */
768
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800769#ifdef FEATURE_WLAN_ESE
yeshwanth sriram guntuka27e4ffc2016-12-01 18:00:17 +0530770typedef struct ese_wmm_tspec_ie {
771 uint16_t traffic_type:1;
772 uint16_t tsid:4;
773 uint16_t direction:2;
774 uint16_t access_policy:2;
775 uint16_t aggregation:1;
776 uint16_t psb:1;
777 uint16_t user_priority:3;
778 uint16_t tsinfo_ack_pol:2;
779 uint8_t tsinfo_rsvd:7;
780 uint8_t burst_size_defn:1;
781 uint16_t size:15;
782 uint16_t fixed:1;
783 uint16_t max_msdu_size;
784 uint32_t min_service_int;
785 uint32_t max_service_int;
786 uint32_t inactivity_int;
787 uint32_t suspension_int;
788 uint32_t service_start_time;
789 uint32_t min_data_rate;
790 uint32_t mean_data_rate;
791 uint32_t peak_data_rate;
792 uint32_t burst_size;
793 uint32_t delay_bound;
794 uint32_t min_phy_rate;
795 uint16_t surplus_bw_allowance;
796 uint16_t medium_time;
797} qdf_packed ese_wmm_tspec_ie;
798
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800799typedef struct sTspecInfo {
800 uint8_t valid;
Jeff Johnson56471b92018-12-22 14:36:06 -0800801 struct mac_tspec_ie tspec;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800802} tTspecInfo;
803
804#define SIR_ESE_MAX_TSPEC_IES 4
805typedef struct sESETspecTspecInfo {
806 uint8_t numTspecs;
807 tTspecInfo tspec[SIR_ESE_MAX_TSPEC_IES];
808} tESETspecInfo;
809
Jeff Johnson1482ae42019-02-02 18:29:24 -0800810struct tsm_ie {
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800811 uint8_t tsid;
812 uint8_t state;
813 uint16_t msmt_interval;
Jeff Johnson1482ae42019-02-02 18:29:24 -0800814};
815
Jeff Johnsone21b0eb2019-02-02 19:31:54 -0800816struct tsm_ie_ind {
Jeff Johnson85ddb772019-02-02 19:01:52 -0800817 struct tsm_ie tsm_ie;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800818 uint8_t sessionId;
Jeff Johnsone21b0eb2019-02-02 19:31:54 -0800819};
820
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800821typedef struct sAniTrafStrmMetrics {
822 uint16_t UplinkPktQueueDly;
823 uint16_t UplinkPktQueueDlyHist[4];
824 uint32_t UplinkPktTxDly;
825 uint16_t UplinkPktLoss;
826 uint16_t UplinkPktCount;
827 uint8_t RoamingCount;
828 uint16_t RoamingDly;
829} tAniTrafStrmMetrics, *tpAniTrafStrmMetrics;
830
831typedef struct sAniGetTsmStatsReq {
832 /* Common for all types are requests */
833 uint16_t msgType; /* message type is same as the request type */
834 uint16_t msgLen; /* length of the entire request */
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800835 uint8_t tid; /* traffic id */
836 struct qdf_mac_addr bssId;
837 void *tsmStatsCallback;
838 void *pDevContext; /* device context */
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800839} tAniGetTsmStatsReq, *tpAniGetTsmStatsReq;
840
841typedef struct sAniGetTsmStatsRsp {
842 /* Common for all types are responses */
843 uint16_t msgType; /*
844 * message type is same as
845 * the request type
846 */
847 uint16_t msgLen; /*
848 * length of the entire request,
849 * includes the pStatsBuf length too
850 */
851 uint8_t sessionId;
852 uint32_t rc; /* success/failure */
Abhinav Kumaraa8f2df2019-01-11 20:02:26 +0530853 struct qdf_mac_addr bssid; /* bssid to get the tsm stats for */
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800854 tAniTrafStrmMetrics tsmMetrics;
855 void *tsmStatsReq; /* tsm stats request backup */
856} tAniGetTsmStatsRsp, *tpAniGetTsmStatsRsp;
857
Jeff Johnson30d3a5d2019-02-02 21:08:43 -0800858struct ese_bcn_report_bss_info {
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800859 tBcnReportFields bcnReportFields;
860 uint8_t ieLen;
861 uint8_t *pBuf;
Jeff Johnson30d3a5d2019-02-02 21:08:43 -0800862};
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800863
Jeff Johnsondda40752019-02-02 21:43:34 -0800864struct ese_bcn_report_rsp {
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800865 uint16_t measurementToken;
866 uint8_t flag; /* Flag to report measurement done and more data */
867 uint8_t numBss;
Jeff Johnson30d3a5d2019-02-02 21:08:43 -0800868 struct ese_bcn_report_bss_info
869 bcnRepBssInfo[SIR_BCN_REPORT_MAX_BSS_DESC];
Jeff Johnsondda40752019-02-02 21:43:34 -0800870};
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800871
872#define TSRS_11AG_RATE_6MBPS 0xC
873#define TSRS_11B_RATE_5_5MBPS 0xB
Jeff Johnson8a5d0ab2019-02-02 21:54:17 -0800874
875struct ese_tsrs_ie {
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800876 uint8_t tsid;
877 uint8_t rates[8];
Jeff Johnson8a5d0ab2019-02-02 21:54:17 -0800878};
879
Jeff Johnson4f340522019-02-02 22:02:52 -0800880struct ese_tsm_ie {
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800881 uint8_t tsid;
882 uint8_t state;
883 uint16_t msmt_interval;
Jeff Johnson4f340522019-02-02 22:02:52 -0800884};
885
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800886typedef struct sTSMStats {
887 uint8_t tid;
888 struct qdf_mac_addr bssid;
889 tTrafStrmMetrics tsmMetrics;
890} tTSMStats, *tpTSMStats;
891typedef struct sEseTSMContext {
892 uint8_t tid;
Jeff Johnson4f340522019-02-02 22:02:52 -0800893 struct ese_tsm_ie tsmInfo;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800894 tTrafStrmMetrics tsmMetrics;
895} tEseTSMContext, *tpEseTSMContext;
896typedef struct sEsePEContext {
897 tEseTSMContext tsm;
898} tEsePEContext, *tpEsePEContext;
899
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800900#endif /* FEATURE_WLAN_ESE */
901
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800902/* / Definition for join request */
903/* / ---> MAC */
Jeff Johnson701444f2019-02-02 22:35:13 -0800904struct join_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800905 uint16_t messageType; /* eWNI_SME_JOIN_REQ */
906 uint16_t length;
Abhishek Singhefe21e62019-09-20 10:03:24 +0530907 uint8_t vdev_id;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800908 tSirMacSSid ssId;
Pragaspathi Thilagaraj7fb14222019-06-17 23:26:58 +0530909 tSirMacAddr self_mac_addr; /* self Mac address */
Pragaspathi Thilagarajafd0a482019-05-23 13:02:36 +0530910 enum bss_type bsstype; /* add new type for BT-AMP STA and AP Modules */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800911 uint8_t dot11mode; /* to support BT-AMP */
912#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
913 uint8_t cc_switch_mode;
914#endif
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800915 enum QDF_OPMODE staPersona; /* Persona */
Abhishek Singhf78bd2d2016-04-27 16:47:56 +0530916 bool wps_registration;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800917 ePhyChanBondState cbMode; /* Pass CB mode value in Join. */
918
919 /*This contains the UAPSD Flag for all 4 AC
920 * B0: AC_VO UAPSD FLAG
921 * B1: AC_VI UAPSD FLAG
922 * B2: AC_BK UAPSD FLAG
923 * B3: AC_BE UASPD FLAG
924 */
925 uint8_t uapsdPerAcBitmask;
926
927 tSirMacRateSet operationalRateSet; /* Has 11a or 11b rates */
928 tSirMacRateSet extendedRateSet; /* Has 11g rates */
929 tSirRSNie rsnIE; /* RSN IE to be sent in */
930 /* (Re) Association Request */
931#ifdef FEATURE_WLAN_ESE
932 /* CCMK IE to be included as handler for join and reassoc is */
933 tSirCCKMie cckmIE;
934 /* the same. The join will never carry cckm, but will be set to */
935 /* 0. */
936#endif
937
938 tSirAddie addIEScan; /* Additional IE to be sent in */
939 /* (unicast) Probe Request at the time of join */
940
941 tSirAddie addIEAssoc; /* Additional IE to be sent in */
942 /* (Re) Association Request */
943
944 tAniEdType UCEncryptionType;
945
946 tAniEdType MCEncryptionType;
Pragaspathi Thilagaraj0bd369d2019-04-08 00:07:53 +0530947 enum ani_akm_type akm;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800948
949#ifdef WLAN_FEATURE_11W
950 tAniEdType MgmtEncryptionType;
951#endif
952
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700953 bool is11Rconnection;
Pragaspathi Thilagaraj1f3f99f2019-04-24 23:48:47 +0530954 bool is_adaptive_11r_connection;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800955#ifdef FEATURE_WLAN_ESE
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700956 bool isESEFeatureIniEnabled;
957 bool isESEconnection;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800958 tESETspecInfo eseTspecInfo;
959#endif
960
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700961 bool isFastTransitionEnabled;
962 bool isFastRoamIniFeatureEnabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800963
964 uint8_t txLdpcIniFeatureEnabled;
Jeff Johnsonbe119e62019-02-02 12:30:26 -0800965 struct ht_config ht_config;
Sandeep Puligilla98917432016-06-10 13:50:28 -0700966 struct sir_vht_config vht_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800967#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -0700968 tDot11fIEhe_cap he_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800969#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800970 uint8_t enableVhtpAid;
971 uint8_t enableVhtGid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800972 uint8_t enableAmpduPs;
973 uint8_t enableHtSmps;
974 uint8_t htSmps;
Archana Ramachandranfec24812016-02-16 16:31:56 -0800975 bool send_smps_action;
Kiran Kumar Lokere722dccd2018-02-23 13:23:52 -0800976 bool he_with_wep_tkip;
Deepak Dhamdhere612392c2016-08-28 02:56:51 -0700977 uint8_t max_amsdu_num;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700978 bool isWMEenabled;
979 bool isQosEnabled;
980 bool isOSENConnection;
Krishna Kumaar Natarajanf599c6e2015-11-03 11:44:03 -0800981 struct rrm_config_param rrm_config;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700982 bool spectrumMgtIndicator;
Jeff Johnson39f02ae2019-02-01 23:42:38 -0800983 struct power_cap_info powerCap;
Jeff Johnsoned4f4d52019-02-02 00:09:45 -0800984 struct supported_channels supportedChannels;
Selvaraj, Sridhar05ea0792017-05-17 12:17:03 +0530985 bool enable_bcast_probe_rsp;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +0530986#ifdef WLAN_FEATURE_FILS_SK
987 struct cds_fils_connection_info fils_con_info;
988#endif
Padma, Santhosh Kumarb8f65d92017-09-14 13:05:42 +0530989 bool sae_pmk_cached;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +0530990 /* Pls make this as last variable in struct */
Abhishek Singhb59f8d42017-07-31 14:42:47 +0530991 bool force_24ghz_in_ht20;
Abhishek Singh6454ad32017-12-20 10:42:21 +0530992 bool force_rsne_override;
Vignesh Viswanathand5a5f2e2018-06-01 15:35:51 +0530993 bool supported_nss_1x1;
994 uint8_t vdev_nss;
995 uint8_t nss;
996 bool nss_forced_1x1;
Arif Hussain6686c0b2018-08-21 18:21:05 -0700997 bool enable_session_twt_support;
Pragaspathi Thilagaraj1112c962019-05-23 23:45:38 +0530998 struct bss_description bssDescription;
Selvaraj, Sridhar81ab80d2017-06-08 12:21:39 +0530999 /*
1000 * WARNING: Pls make bssDescription as last variable in struct
Jeff Johnson701444f2019-02-02 22:35:13 -08001001 * join_req as it has ieFields followed after this bss
Selvaraj, Sridhar81ab80d2017-06-08 12:21:39 +05301002 * description. Adding a variable after this corrupts the ieFields
1003 */
Jeff Johnson701444f2019-02-02 22:35:13 -08001004};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001005
Jeff Johnson47d75242018-05-12 15:58:53 -07001006/* / Definition for response message to previously issued join request */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001007/* / MAC ---> */
Jeff Johnson2df04b82019-02-02 23:30:25 -08001008struct join_rsp {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001009 uint16_t messageType; /* eWNI_SME_JOIN_RSP */
1010 uint16_t length;
Abhishek Singh345be412019-11-19 10:59:29 +05301011 uint8_t vdev_id; /* Session ID */
Pragaspathi Thilagarajd48e6cd2019-05-30 00:52:43 +05301012 tSirResultCodes status_code;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001013 tAniAuthType authType;
1014 uint32_t vht_channel_width;
1015 /* It holds reasonCode when join fails due to deauth/disassoc frame.
1016 * Otherwise it holds status code.
1017 */
1018 uint16_t protStatusCode;
1019 uint16_t aid;
1020 uint32_t beaconLength;
1021 uint32_t assocReqLength;
1022 uint32_t assocRspLength;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001023 uint32_t parsedRicRspLen;
Bala Venkateshe7f79162019-01-16 16:43:59 +05301024 uint8_t uapsd_mask;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001025#ifdef FEATURE_WLAN_ESE
1026 uint32_t tspecIeLen;
1027#endif
1028 uint32_t staId; /* Station ID for peer */
1029
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001030 /*Timing measurement capability */
1031 uint8_t timingMeasCap;
1032
1033#ifdef FEATURE_WLAN_TDLS
1034 /* TDLS prohibited and TDLS channel switch prohibited are set as
1035 * per ExtCap IE in received assoc/re-assoc response from AP
1036 */
1037 bool tdls_prohibited;
1038 bool tdls_chan_swit_prohibited;
1039#endif
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301040 uint8_t nss;
1041 uint32_t max_rate_flags;
1042
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001043#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
Jeff Johnsonf6541882019-02-02 16:16:00 -08001044 struct ht_profile ht_profile;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001045#endif
Archana Ramachandran20d2e232016-02-11 16:58:40 -08001046 bool supported_nss_1x1;
Anurag Chouhan5de8d172016-07-13 14:44:28 +05301047 tDot11fIEHTCaps ht_caps;
1048 tDot11fIEVHTCaps vht_caps;
1049 tDot11fIEHTInfo ht_operation;
1050 tDot11fIEVHTOperation vht_operation;
Ashish Kumar Dhanotiyae80f47a2020-04-09 17:52:49 +05301051#ifdef WLAN_FEATURE_11AX
1052 tDot11fIEhe_op he_operation;
1053#endif
Anurag Chouhan5de8d172016-07-13 14:44:28 +05301054 tDot11fIEhs20vendor_ie hs20vendor_ie;
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301055 bool is_fils_connection;
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301056 uint16_t fils_seq_num;
Vignesh Viswanathan0b0fa272017-09-18 17:12:04 +05301057#ifdef WLAN_FEATURE_FILS_SK
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301058 struct fils_join_rsp_params *fils_join_rsp;
1059#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001060 uint8_t frames[1];
Jeff Johnson2df04b82019-02-02 23:30:25 -08001061};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001062
Jeff Johnsona7d5b542019-02-03 10:15:46 -08001063struct oem_channel_info {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001064 uint32_t mhz;
1065 uint32_t band_center_freq1;
1066 uint32_t band_center_freq2;
1067 uint32_t info;
1068 uint32_t reg_info_1;
1069 uint32_t reg_info_2;
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301070 uint8_t nss;
1071 uint32_t rate_flags;
Manishekar Chandrasekaranec267592016-05-26 19:10:04 +05301072 uint8_t sec_ch_offset;
1073 enum phy_ch_width ch_width;
Jeff Johnsona7d5b542019-02-03 10:15:46 -08001074};
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301075
Will Huang558f8082017-05-31 16:22:24 +08001076enum sir_sme_phy_mode {
1077 SIR_SME_PHY_MODE_LEGACY = 0,
1078 SIR_SME_PHY_MODE_HT = 1,
1079 SIR_SME_PHY_MODE_VHT = 2
1080};
1081
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001082/* / Definition for Association indication from peer */
1083/* / MAC ---> */
Jeff Johnson01e8adb2019-02-03 10:55:55 -08001084struct assoc_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001085 uint16_t messageType; /* eWNI_SME_ASSOC_IND */
1086 uint16_t length;
1087 uint8_t sessionId;
1088 tSirMacAddr peerMacAddr;
1089 uint16_t aid;
1090 tSirMacAddr bssId; /* Self BSSID */
1091 uint16_t staId; /* Station ID for peer */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001092 tAniAuthType authType;
Min Liuddd23302018-12-05 16:17:48 +08001093 enum ani_akm_type akm_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001094 tAniSSID ssId; /* SSID used by STA to associate */
1095 tSirWAPIie wapiIE; /* WAPI IE received from peer */
1096 tSirRSNie rsnIE; /* RSN IE received from peer */
1097 /* Additional IE received from peer, which possibly include
1098 * WSC IE and/or P2P IE
1099 */
1100 tSirAddie addIE;
1101
1102 /* powerCap & supportedChannels are present only when */
1103 /* spectrumMgtIndicator flag is set */
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001104 bool spectrumMgtIndicator;
Jeff Johnson39f02ae2019-02-01 23:42:38 -08001105 struct power_cap_info powerCap;
Jeff Johnsoned4f4d52019-02-02 00:09:45 -08001106 struct supported_channels supportedChannels;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001107 bool wmmEnabledSta; /* if present - STA is WMM enabled */
1108 bool reassocReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001109 /* Required for indicating the frames to upper layer */
1110 uint32_t beaconLength;
1111 uint8_t *beaconPtr;
1112 uint32_t assocReqLength;
1113 uint8_t *assocReqPtr;
1114
1115 /* Timing measurement capability */
1116 uint8_t timingMeasCap;
Jeff Johnsona7d5b542019-02-03 10:15:46 -08001117 struct oem_channel_info chan_info;
Will Huang558f8082017-05-31 16:22:24 +08001118 bool ampdu;
1119 bool sgi_enable;
1120 bool tx_stbc;
1121 bool rx_stbc;
1122 tSirMacHTChannelWidth ch_width;
1123 enum sir_sme_phy_mode mode;
1124 uint8_t max_supp_idx;
1125 uint8_t max_ext_idx;
1126 uint8_t max_mcs_idx;
1127 uint8_t rx_mcs_map;
1128 uint8_t tx_mcs_map;
gaolez7bb1e742017-03-21 16:37:38 +08001129 /* Extended CSA capability of station */
1130 uint8_t ecsa_capable;
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +05301131 tDot11fIEHTCaps HTCaps;
1132 tDot11fIEVHTCaps VHTCaps;
Ashish Kumar Dhanotiya6025c702019-03-20 18:48:49 +05301133 bool he_caps_present;
Ashish Kumar Dhanotiyac6171062019-01-22 21:55:01 +05301134 tSirMacCapabilityInfo capability_info;
Srinivas Dasari5f528202019-02-11 17:29:43 +05301135 bool is_sae_authenticated;
Min Liu0daa0982019-02-01 17:50:44 +08001136 const uint8_t *owe_ie;
1137 uint32_t owe_ie_len;
1138 uint16_t owe_status;
bings85512332019-09-04 17:46:37 +08001139 bool need_assoc_rsp_tx_cb;
Jeff Johnson01e8adb2019-02-03 10:55:55 -08001140};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001141
Min Liue34708a2019-02-01 15:00:34 +08001142/**
1143 * struct owe_assoc_ind - owe association indication
1144 * @node : List entry element
1145 * @assoc_ind: pointer to assoc ind
1146 */
1147struct owe_assoc_ind {
1148 qdf_list_node_t node;
1149 struct assoc_ind *assoc_ind;
1150};
1151
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001152/* / Definition for Association confirm */
1153/* / ---> MAC */
Jeff Johnsonf86e45b2019-02-03 11:17:14 -08001154struct assoc_cnf {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001155 uint16_t messageType; /* eWNI_SME_ASSOC_CNF */
1156 uint16_t length;
Pragaspathi Thilagarajd48e6cd2019-05-30 00:52:43 +05301157 tSirResultCodes status_code;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301158 struct qdf_mac_addr bssid; /* Self BSSID */
1159 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001160 uint16_t aid;
Pragaspathi Thilagarajcb58bbc2019-05-23 15:34:51 +05301161 enum mac_status_code mac_status_code;
Min Liu0daa0982019-02-01 17:50:44 +08001162 uint8_t *owe_ie;
1163 uint32_t owe_ie_len;
bings85512332019-09-04 17:46:37 +08001164 bool need_assoc_rsp_tx_cb;
Jeff Johnsonf86e45b2019-02-03 11:17:14 -08001165};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001166
1167/* / Enum definition for Wireless medium status change codes */
1168typedef enum eSirSmeStatusChangeCode {
1169 eSIR_SME_DEAUTH_FROM_PEER,
1170 eSIR_SME_DISASSOC_FROM_PEER,
1171 eSIR_SME_LOST_LINK_WITH_PEER,
1172 eSIR_SME_CHANNEL_SWITCH,
1173 eSIR_SME_JOINED_NEW_BSS,
1174 eSIR_SME_LEAVING_BSS,
1175 eSIR_SME_IBSS_ACTIVE,
1176 eSIR_SME_IBSS_INACTIVE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001177 eSIR_SME_RADAR_DETECTED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001178 eSIR_SME_AP_CAPS_CHANGED,
1179} tSirSmeStatusChangeCode;
1180
Jeff Johnson2e6d1732019-02-03 17:00:30 -08001181struct new_bss_info {
Anurag Chouhan6d760662016-02-20 16:05:43 +05301182 struct qdf_mac_addr bssId;
Tushnim Bhattacharyya529006b2019-07-17 14:28:32 -07001183 uint32_t freq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001184 uint8_t reserved;
1185 tSirMacSSid ssId;
Jeff Johnson2e6d1732019-02-03 17:00:30 -08001186};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001187
Jeff Johnson9c9961c2019-02-03 17:10:53 -08001188struct ap_new_caps {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001189 uint16_t capabilityInfo;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301190 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001191 tSirMacSSid ssId;
Jeff Johnson9c9961c2019-02-03 17:10:53 -08001192};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001193
1194/**
1195 * Table below indicates what information is passed for each of
1196 * the Wireless Media status change notifications:
1197 *
Jeff Johnson65a20762019-02-02 11:01:50 -08001198 * Status Change code Status change info
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001199 * ----------------------------------------------------------------------
1200 * eSIR_SME_DEAUTH_FROM_PEER Reason code received in DEAUTH frame
1201 * eSIR_SME_DISASSOC_FROM_PEER Reason code received in DISASSOC frame
1202 * eSIR_SME_LOST_LINK_WITH_PEER None
1203 * eSIR_SME_CHANNEL_SWITCH New channel number
1204 * eSIR_SME_JOINED_NEW_BSS BSSID, SSID and channel number
1205 * eSIR_SME_LEAVING_BSS None
1206 * eSIR_SME_IBSS_ACTIVE Indicates that another STA joined
1207 * IBSS apart from this STA that
1208 * started IBSS
1209 * eSIR_SME_IBSS_INACTIVE Indicates that only this STA is left
1210 * in IBSS
1211 * eSIR_SME_RADAR_DETECTED Indicates that radar is detected
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001212 * eSIR_SME_AP_CAPS_CHANGED Indicates that capabilities of the AP
1213 * that STA is currently associated with
1214 * have changed.
1215 */
1216
1217/* / Definition for Wireless medium status change notification */
Jeff Johnson53889322019-02-03 17:37:09 -08001218struct wm_status_change_ntf {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001219 uint16_t messageType; /* eWNI_SME_WM_STATUS_CHANGE_NTF */
1220 uint16_t length;
1221 uint8_t sessionId; /* Session ID */
1222 tSirSmeStatusChangeCode statusChangeCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301223 struct qdf_mac_addr bssid; /* Self BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001224 union {
Jeff Johnson65a20762019-02-02 11:01:50 -08001225 /* eSIR_SME_DEAUTH_FROM_PEER */
1226 uint16_t deAuthReasonCode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001227 /* eSIR_SME_DISASSOC_FROM_PEER */
1228 uint16_t disassocReasonCode;
1229 /* none for eSIR_SME_LOST_LINK_WITH_PEER */
Jeff Johnson65a20762019-02-02 11:01:50 -08001230 /* eSIR_SME_CHANNEL_SWITCH */
Tushnim Bhattacharyya293c9942019-07-12 17:10:58 -07001231 uint32_t new_freq;
Jeff Johnson65a20762019-02-02 11:01:50 -08001232 /* eSIR_SME_JOINED_NEW_BSS */
Jeff Johnson2e6d1732019-02-03 17:00:30 -08001233 struct new_bss_info newBssInfo;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001234 /* none for eSIR_SME_LEAVING_BSS */
1235 /* none for eSIR_SME_IBSS_ACTIVE */
1236 /* none for eSIR_SME_IBSS_INACTIVE */
Jeff Johnson65a20762019-02-02 11:01:50 -08001237 /* none for eSIR_SME_RADAR_DETECTED */
1238 /* eSIR_SME_AP_CAPS_CHANGED */
Jeff Johnson9c9961c2019-02-03 17:10:53 -08001239 struct ap_new_caps apNewCaps;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001240 } statusChangeInfo;
Jeff Johnson53889322019-02-03 17:37:09 -08001241};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001242
1243/* Definition for Disassociation request */
Jeff Johnsonca523f32019-02-03 18:05:59 -08001244struct disassoc_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001245 uint16_t messageType; /* eWNI_SME_DISASSOC_REQ */
1246 uint16_t length;
1247 uint8_t sessionId; /* Session ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301248 struct qdf_mac_addr bssid; /* Peer BSSID */
1249 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001250 uint16_t reasonCode;
1251 /* This flag tells LIM whether to send the disassoc OTA or not */
1252 /* This will be set in while handing off from one AP to other */
1253 uint8_t doNotSendOverTheAir;
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -07001254 bool process_ho_fail;
Jeff Johnsonca523f32019-02-03 18:05:59 -08001255};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001256
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001257/* / Definition for Disassociation response */
Jeff Johnson380a1cd2019-02-03 21:43:51 -08001258struct disassoc_rsp {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001259 uint16_t messageType; /* eWNI_SME_DISASSOC_RSP */
1260 uint16_t length;
1261 uint8_t sessionId; /* Session ID */
Pragaspathi Thilagarajd48e6cd2019-05-30 00:52:43 +05301262 tSirResultCodes status_code;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301263 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001264 uint16_t staId;
Jeff Johnson380a1cd2019-02-03 21:43:51 -08001265};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001266
1267/* / Definition for Disassociation indication from peer */
Jeff Johnson318a9882019-02-04 08:30:50 -08001268struct disassoc_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001269 uint16_t messageType; /* eWNI_SME_DISASSOC_IND */
1270 uint16_t length;
Abhishek Singh345be412019-11-19 10:59:29 +05301271 uint8_t vdev_id;
Pragaspathi Thilagarajd48e6cd2019-05-30 00:52:43 +05301272 tSirResultCodes status_code;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301273 struct qdf_mac_addr bssid;
1274 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001275 uint16_t staId;
1276 uint32_t reasonCode;
Srinivas Dasarie2495dc2020-02-13 09:49:24 +05301277 bool from_ap;
Jeff Johnson318a9882019-02-04 08:30:50 -08001278};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001279
1280/* / Definition for Disassociation confirm */
1281/* / MAC ---> */
Jeff Johnson0837c442019-02-04 11:37:09 -08001282struct disassoc_cnf {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001283 uint16_t messageType; /* eWNI_SME_DISASSOC_CNF */
1284 uint16_t length;
Abhishek Singh345be412019-11-19 10:59:29 +05301285 uint8_t vdev_id;
Pragaspathi Thilagarajd48e6cd2019-05-30 00:52:43 +05301286 tSirResultCodes status_code;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301287 struct qdf_mac_addr bssid;
1288 struct qdf_mac_addr peer_macaddr;
Jeff Johnson0837c442019-02-04 11:37:09 -08001289};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001290
Hanumantha Reddy Pothula3e5d6aa2016-09-08 15:21:54 +05301291/**
1292 * struct sir_sme_discon_done_ind - disconnect done indiaction
1293 * @message_type: msg type
1294 * @length: length of msg
1295 * @session_id: session id of the indication
1296 * @reason_code: reason for disconnect indication
1297 * @peer_mac: peer mac
1298 */
1299struct sir_sme_discon_done_ind {
1300 uint16_t message_type;
1301 uint16_t length;
1302 uint8_t session_id;
1303 tSirResultCodes reason_code;
1304 tSirMacAddr peer_mac;
1305};
1306
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001307/* / Definition for Deauthetication request */
Jeff Johnson34c74b02019-02-04 12:34:51 -08001308struct deauth_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001309 uint16_t messageType; /* eWNI_SME_DEAUTH_REQ */
1310 uint16_t length;
Abhishek Singh345be412019-11-19 10:59:29 +05301311 uint8_t vdev_id; /* Session ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301312 struct qdf_mac_addr bssid; /* AP BSSID */
1313 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001314 uint16_t reasonCode;
Jeff Johnson34c74b02019-02-04 12:34:51 -08001315};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001316
Kiran Kumar Lokere77a624f2020-08-12 17:33:31 -07001317/**
1318 * struct deauth_retry_params - deauth retry params
1319 * @peer_mac: peer mac
1320 * @reason_code: reason for disconnect indication
1321 * @retry_cnt: retry count
1322 */
1323struct deauth_retry_params {
1324 struct qdf_mac_addr peer_macaddr;
1325 uint16_t reason_code;
1326 uint8_t retry_cnt;
1327};
1328
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001329/* / Definition for Deauthetication response */
Jeff Johnson15ae0c12019-02-04 12:55:07 -08001330struct deauth_rsp {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001331 uint16_t messageType; /* eWNI_SME_DEAUTH_RSP */
1332 uint16_t length;
1333 uint8_t sessionId; /* Session ID */
Pragaspathi Thilagarajd48e6cd2019-05-30 00:52:43 +05301334 tSirResultCodes status_code;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301335 struct qdf_mac_addr peer_macaddr;
Jeff Johnson15ae0c12019-02-04 12:55:07 -08001336};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001337
1338/* / Definition for Deauthetication indication from peer */
Jeff Johnsonfec08712019-02-04 13:12:08 -08001339struct deauth_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001340 uint16_t messageType; /* eWNI_SME_DEAUTH_IND */
1341 uint16_t length;
Abhishek Singh345be412019-11-19 10:59:29 +05301342 uint8_t vdev_id;
Pragaspathi Thilagarajd48e6cd2019-05-30 00:52:43 +05301343 tSirResultCodes status_code;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301344 struct qdf_mac_addr bssid; /* AP BSSID */
1345 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001346
1347 uint16_t staId;
1348 uint32_t reasonCode;
Kiran Kumar Lokere37d3aa22015-11-03 14:58:26 -08001349 int8_t rssi;
Srinivas Dasarie2495dc2020-02-13 09:49:24 +05301350 bool from_ap;
Jeff Johnsonfec08712019-02-04 13:12:08 -08001351};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001352
Jeff Johnson0837c442019-02-04 11:37:09 -08001353/* / Definition for Deauthetication confirm */
1354struct deauth_cnf {
1355 uint16_t messageType; /* eWNI_SME_DEAUTH_CNF */
1356 uint16_t length;
Abhishek Singh345be412019-11-19 10:59:29 +05301357 uint8_t vdev_id;
Pragaspathi Thilagarajd48e6cd2019-05-30 00:52:43 +05301358 tSirResultCodes status_code;
Jeff Johnson0837c442019-02-04 11:37:09 -08001359 struct qdf_mac_addr bssid;
1360 struct qdf_mac_addr peer_macaddr;
1361};
1362
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001363/* / Definition for stop BSS request message */
Jeff Johnson206721c2019-02-04 17:25:02 -08001364struct stop_bss_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001365 uint16_t messageType; /* eWNI_SME_STOP_BSS_REQ */
1366 uint16_t length;
1367 uint8_t sessionId; /* Session ID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001368 tSirResultCodes reasonCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301369 struct qdf_mac_addr bssid; /* Self BSSID */
Jeff Johnson206721c2019-02-04 17:25:02 -08001370};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001371
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001372/* / Definition for Channel Switch indication for station */
1373/* / MAC ---> */
Jeff Johnson3eb71112019-02-04 17:40:51 -08001374struct switch_channel_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001375 uint16_t messageType; /* eWNI_SME_SWITCH_CHL_IND */
1376 uint16_t length;
1377 uint8_t sessionId;
Tushnim Bhattacharyya2a1e7f22019-07-11 14:26:17 -07001378 uint32_t freq;
Amar Singhal5cccafe2017-02-15 12:42:58 -08001379 struct ch_params chan_params;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301380 struct qdf_mac_addr bssid; /* BSSID */
Jianmin Zhu3c50e402018-12-04 18:52:54 +08001381 QDF_STATUS status;
Jeff Johnson3eb71112019-02-04 17:40:51 -08001382};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001383
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001384/* / Definition for MIC failure indication */
1385/* / MAC ---> */
1386/* / MAC reports this each time a MIC failure occures on Rx TKIP packet */
Jeff Johnsonffb93e12019-02-04 19:25:12 -08001387struct mic_failure_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001388 uint16_t messageType; /* eWNI_SME_MIC_FAILURE_IND */
1389 uint16_t length;
1390 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301391 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001392 tSirMicFailureInfo info;
Jeff Johnsonffb93e12019-02-04 19:25:12 -08001393};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001394
Jeff Johnsoncbc85322019-02-04 19:47:17 -08001395struct missed_beacon_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001396 uint16_t messageType; /* eWNI_SME_MISSED_BEACON_IND */
1397 uint16_t length;
Pragaspathi Thilagaraje05162d2019-05-23 13:10:46 +05301398 uint8_t bss_idx;
Jeff Johnsoncbc85322019-02-04 19:47:17 -08001399};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001400
1401/* / Definition for Set Context request */
1402/* / ---> MAC */
Jeff Johnsonb9a9a7d2019-02-05 11:47:05 -08001403struct set_context_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001404 uint16_t messageType; /* eWNI_SME_SET_CONTEXT_REQ */
1405 uint16_t length;
Abhishek Singhefe21e62019-09-20 10:03:24 +05301406 uint8_t vdev_id; /* vdev ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301407 struct qdf_mac_addr peer_macaddr;
1408 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001409 tSirKeyMaterial keyMaterial;
Jeff Johnsonb9a9a7d2019-02-05 11:47:05 -08001410};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001411
1412/* / Definition for Set Context response */
1413/* / MAC ---> */
Jeff Johnson924ae612019-02-05 12:01:50 -08001414struct set_context_rsp {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001415 uint16_t messageType; /* eWNI_SME_SET_CONTEXT_RSP */
1416 uint16_t length;
1417 uint8_t sessionId; /* Session ID */
Pragaspathi Thilagarajd48e6cd2019-05-30 00:52:43 +05301418 tSirResultCodes status_code;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301419 struct qdf_mac_addr peer_macaddr;
Jeff Johnson924ae612019-02-05 12:01:50 -08001420};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001421
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001422typedef struct sAniGetSnrReq {
1423 /* Common for all types are requests */
1424 uint16_t msgType; /* message type is same as the request type */
1425 uint16_t msgLen; /* length of the entire request */
1426 uint8_t sessionId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001427 void *snrCallback;
1428 void *pDevContext; /* device context */
1429 int8_t snr;
1430} tAniGetSnrReq, *tpAniGetSnrReq;
1431
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001432/* generic country code change request MSG structure */
1433typedef struct sAniGenericChangeCountryCodeReq {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001434 uint16_t msgType; /* message type is same as the request type */
1435 uint16_t msgLen; /* length of the entire request */
Wu Gaoaa155142019-01-14 15:09:26 +08001436 uint8_t countryCode[CFG_COUNTRY_CODE_LEN]; /* 3 char country code */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001437} tAniGenericChangeCountryCodeReq, *tpAniGenericChangeCountryCodeReq;
1438
Srinivas Girigowda296105a2015-09-24 16:31:16 -07001439/**
1440 * struct sAniDHCPStopInd - DHCP Stop indication message
1441 * @msgType: message type is same as the request type
1442 * @msgLen: length of the entire request
1443 * @device_mode: Mode of the device(ex:STA, AP)
1444 * @adapterMacAddr: MAC address of the adapter
1445 * @peerMacAddr: MAC address of the connected peer
1446 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001447typedef struct sAniDHCPStopInd {
Srinivas Girigowda296105a2015-09-24 16:31:16 -07001448 uint16_t msgType;
1449 uint16_t msgLen;
1450 uint8_t device_mode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301451 struct qdf_mac_addr adapterMacAddr;
1452 struct qdf_mac_addr peerMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001453} tAniDHCPInd, *tpAniDHCPInd;
1454
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001455typedef struct sAniTXFailMonitorInd {
1456 uint16_t msgType; /* message type is same as the request type */
1457 uint16_t msgLen; /* length of the entire request */
1458 uint8_t tx_fail_count;
1459 void *txFailIndCallback;
1460} tAniTXFailMonitorInd, *tpAniTXFailMonitorInd;
1461
Ashish Kumar Dhanotiya1ac41882019-06-27 20:35:31 +05301462
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001463/**********************PE Statistics end*************************/
1464
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001465typedef struct sSirP2PNoaAttr {
1466#ifdef ANI_BIG_BYTE_ENDIAN
1467 uint32_t index:8;
1468 uint32_t oppPsFlag:1;
1469 uint32_t ctWin:7;
1470 uint32_t rsvd1:16;
1471#else
1472 uint32_t rsvd1:16;
1473 uint32_t ctWin:7;
1474 uint32_t oppPsFlag:1;
1475 uint32_t index:8;
1476#endif
1477
1478#ifdef ANI_BIG_BYTE_ENDIAN
1479 uint32_t uNoa1IntervalCnt:8;
1480 uint32_t rsvd2:24;
1481#else
1482 uint32_t rsvd2:24;
1483 uint32_t uNoa1IntervalCnt:8;
1484#endif
1485 uint32_t uNoa1Duration;
1486 uint32_t uNoa1Interval;
1487 uint32_t uNoa1StartTime;
1488
1489#ifdef ANI_BIG_BYTE_ENDIAN
1490 uint32_t uNoa2IntervalCnt:8;
1491 uint32_t rsvd3:24;
1492#else
1493 uint32_t rsvd3:24;
1494 uint32_t uNoa2IntervalCnt:8;
1495#endif
1496 uint32_t uNoa2Duration;
1497 uint32_t uNoa2Interval;
1498 uint32_t uNoa2StartTime;
1499} tSirP2PNoaAttr, *tpSirP2PNoaAttr;
1500
1501typedef struct sSirTclasInfo {
1502 tSirMacTclasIE tclas;
1503 uint8_t version; /* applies only for classifier type ip */
1504 union {
1505 tSirMacTclasParamEthernet eth;
1506 tSirMacTclasParamIPv4 ipv4;
1507 tSirMacTclasParamIPv6 ipv6;
1508 tSirMacTclasParam8021dq t8021dq;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301509 } qdf_packed tclasParams;
1510} qdf_packed tSirTclasInfo;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001511
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001512typedef struct sSirAddtsReqInfo {
1513 uint8_t dialogToken;
Jeff Johnson56471b92018-12-22 14:36:06 -08001514 struct mac_tspec_ie tspec;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001515
1516 uint8_t numTclas; /* number of Tclas elements */
1517 tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM];
1518 uint8_t tclasProc;
1519#if defined(FEATURE_WLAN_ESE)
Jeff Johnson8a5d0ab2019-02-02 21:54:17 -08001520 struct ese_tsrs_ie tsrsIE;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001521 uint8_t tsrsPresent:1;
1522#endif
1523 uint8_t wmeTspecPresent:1;
1524 uint8_t wsmTspecPresent:1;
1525 uint8_t lleTspecPresent:1;
1526 uint8_t tclasProcPresent:1;
1527} tSirAddtsReqInfo, *tpSirAddtsReqInfo;
1528
1529typedef struct sSirAddtsRspInfo {
1530 uint8_t dialogToken;
Pragaspathi Thilagarajcb58bbc2019-05-23 15:34:51 +05301531 enum mac_status_code status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001532 tSirMacTsDelayIE delay;
1533
Jeff Johnson56471b92018-12-22 14:36:06 -08001534 struct mac_tspec_ie tspec;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001535 uint8_t numTclas; /* number of Tclas elements */
1536 tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM];
1537 uint8_t tclasProc;
1538 tSirMacScheduleIE schedule;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001539#ifdef FEATURE_WLAN_ESE
Jeff Johnson4f340522019-02-02 22:02:52 -08001540 struct ese_tsm_ie tsmIE;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001541 uint8_t tsmPresent:1;
1542#endif
1543 uint8_t wmeTspecPresent:1;
1544 uint8_t wsmTspecPresent:1;
1545 uint8_t lleTspecPresent:1;
1546 uint8_t tclasProcPresent:1;
1547 uint8_t schedulePresent:1;
1548} tSirAddtsRspInfo, *tpSirAddtsRspInfo;
1549
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001550/* / Add a tspec as defined */
1551typedef struct sSirAddtsReq {
1552 uint16_t messageType; /* eWNI_SME_ADDTS_REQ */
1553 uint16_t length;
1554 uint8_t sessionId; /* Session ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301555 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001556 uint32_t timeout; /* in ms */
1557 uint8_t rspReqd;
1558 tSirAddtsReqInfo req;
1559} tSirAddtsReq, *tpSirAddtsReq;
1560
1561typedef struct sSirAddtsRsp {
1562 uint16_t messageType; /* eWNI_SME_ADDTS_RSP */
1563 uint16_t length;
1564 uint8_t sessionId; /* sme sessionId Added for BT-AMP support */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001565 uint32_t rc; /* return code */
1566 tSirAddtsRspInfo rsp;
1567} tSirAddtsRsp, *tpSirAddtsRsp;
1568
1569typedef struct sSirDeltsReq {
1570 uint16_t messageType; /* eWNI_SME_DELTS_REQ */
1571 uint16_t length;
1572 uint8_t sessionId; /* Session ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301573 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001574 uint16_t aid; /* use 0 if macAddr is being specified */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301575 struct qdf_mac_addr macaddr; /* only on AP to specify the STA */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001576 uint8_t rspReqd;
Jeff Johnsoncf2ec162018-12-22 16:46:43 -08001577 struct delts_req_info req;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001578} tSirDeltsReq, *tpSirDeltsReq;
1579
1580typedef struct sSirDeltsRsp {
1581 uint16_t messageType; /* eWNI_SME_DELTS_RSP */
1582 uint16_t length;
Jeff Johnsonb2b63e02019-02-21 09:46:03 -08001583 uint8_t sessionId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001584 uint32_t rc;
1585 uint16_t aid; /* use 0 if macAddr is being specified */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301586 struct qdf_mac_addr macaddr; /* only on AP to specify the STA */
Jeff Johnsoncf2ec162018-12-22 16:46:43 -08001587 struct delts_req_info rsp;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001588} tSirDeltsRsp, *tpSirDeltsRsp;
1589
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001590typedef struct sSirAggrQosReqInfo {
1591 uint16_t tspecIdx;
Srinivas Girigowdad462f3b2019-03-25 14:05:33 -07001592 tSirAddtsReqInfo aggrAddTsInfo[QCA_WLAN_AC_ALL];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001593} tSirAggrQosReqInfo, *tpSirAggrQosReqInfo;
1594
1595typedef struct sSirAggrQosReq {
1596 uint16_t messageType; /* eWNI_SME_ADDTS_REQ */
1597 uint16_t length;
1598 uint8_t sessionId; /* Session ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301599 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001600 uint32_t timeout; /* in ms */
1601 uint8_t rspReqd;
1602 tSirAggrQosReqInfo aggrInfo;
Jeff Johnson7e5e3982019-02-21 13:48:37 -08001603} tSirAggrQosReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001604
1605typedef struct sSirAggrQosRspInfo {
1606 uint16_t tspecIdx;
Srinivas Girigowdad462f3b2019-03-25 14:05:33 -07001607 tSirAddtsRspInfo aggrRsp[QCA_WLAN_AC_ALL];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001608} tSirAggrQosRspInfo, *tpSirAggrQosRspInfo;
1609
1610typedef struct sSirAggrQosRsp {
1611 uint16_t messageType;
1612 uint16_t length;
1613 uint8_t sessionId;
1614 tSirAggrQosRspInfo aggrInfo;
1615} tSirAggrQosRsp, *tpSirAggrQosRsp;
1616
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001617
Jeff Johnson7fb55e52019-02-06 11:28:12 -08001618struct qos_map_set {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001619 uint8_t present;
1620 uint8_t num_dscp_exceptions;
Min Liue523f552020-08-10 18:32:00 +08001621 uint8_t dscp_exceptions[QOS_MAP_MAX_EX][2];
1622 uint8_t dscp_range[QOS_MAP_RANGE_NUM][2];
Jeff Johnson7fb55e52019-02-06 11:28:12 -08001623};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001624
1625typedef struct sSmeIbssPeerInd {
1626 uint16_t mesgType;
1627 uint16_t mesgLen;
1628 uint8_t sessionId;
1629
Anurag Chouhan6d760662016-02-20 16:05:43 +05301630 struct qdf_mac_addr peer_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001631
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001632 /* Beacon will be appended for new Peer indication. */
1633} tSmeIbssPeerInd, *tpSmeIbssPeerInd;
1634
Jeff Johnson834dcdd2019-02-06 12:04:41 -08001635struct ibss_peer_inactivity_ind {
Pragaspathi Thilagaraje05162d2019-05-23 13:10:46 +05301636 uint8_t bss_idx;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301637 struct qdf_mac_addr peer_addr;
Jeff Johnson834dcdd2019-02-06 12:04:41 -08001638};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001639
gaoleze5108942017-03-31 16:56:42 +08001640/**
1641 * struct lim_channel_status
1642 * @channelfreq: Channel freq
1643 * @noise_floor: Noise Floor value
1644 * @rx_clear_count: rx clear count
1645 * @cycle_count: cycle count
1646 * @chan_tx_pwr_range: channel tx power per range in 0.5dBm steps
1647 * @chan_tx_pwr_throughput: channel tx power per throughput
1648 * @rx_frame_count: rx frame count (cumulative)
1649 * @bss_rx_cycle_count: BSS rx cycle count
1650 * @rx_11b_mode_data_duration: b-mode data rx time (units are microseconds)
1651 * @tx_frame_count: BSS tx cycle count
1652 * @mac_clk_mhz: sample frequency
1653 * @channel_id: channel index
1654 * @cmd_flags: indicate which stat event is this status coming from
1655 */
1656struct lim_channel_status {
1657 uint32_t channelfreq;
1658 uint32_t noise_floor;
1659 uint32_t rx_clear_count;
1660 uint32_t cycle_count;
1661 uint32_t chan_tx_pwr_range;
1662 uint32_t chan_tx_pwr_throughput;
1663 uint32_t rx_frame_count;
1664 uint32_t bss_rx_cycle_count;
1665 uint32_t rx_11b_mode_data_duration;
1666 uint32_t tx_frame_count;
1667 uint32_t mac_clk_mhz;
1668 uint32_t channel_id;
1669 uint32_t cmd_flags;
1670};
1671
1672/**
1673 * struct lim_scan_channel_status
1674 * @total_channel: total number of be scanned channel
1675 * @channel_status_list: channel status info store in this array
1676 */
1677struct lim_scan_channel_status {
1678 uint8_t total_channel;
1679 struct lim_channel_status
1680 channel_status_list[SIR_MAX_SUPPORTED_CHANNEL_LIST];
1681};
1682
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001683typedef struct sSmeMaxAssocInd {
1684 uint16_t mesgType; /* eWNI_SME_MAX_ASSOC_EXCEEDED */
1685 uint16_t mesgLen;
1686 uint8_t sessionId;
1687 /* the new peer that got rejected max assoc limit reached */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301688 struct qdf_mac_addr peer_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001689} tSmeMaxAssocInd, *tpSmeMaxAssocInd;
1690
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001691#define SIR_MAX_NAME_SIZE 64
1692#define SIR_MAX_TEXT_SIZE 32
1693
1694typedef struct sSirName {
1695 uint8_t num_name;
1696 uint8_t name[SIR_MAX_NAME_SIZE];
1697} tSirName;
1698
1699typedef struct sSirText {
1700 uint8_t num_text;
1701 uint8_t text[SIR_MAX_TEXT_SIZE];
1702} tSirText;
1703
1704#define SIR_WPS_PROBRSP_VER_PRESENT 0x00000001
1705#define SIR_WPS_PROBRSP_STATE_PRESENT 0x00000002
1706#define SIR_WPS_PROBRSP_APSETUPLOCK_PRESENT 0x00000004
1707#define SIR_WPS_PROBRSP_SELECTEDREGISTRA_PRESENT 0x00000008
1708#define SIR_WPS_PROBRSP_DEVICEPASSWORDID_PRESENT 0x00000010
1709#define SIR_WPS_PROBRSP_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020
1710#define SIR_WPS_PROBRSP_RESPONSETYPE_PRESENT 0x00000040
1711#define SIR_WPS_PROBRSP_UUIDE_PRESENT 0x00000080
1712#define SIR_WPS_PROBRSP_MANUFACTURE_PRESENT 0x00000100
1713#define SIR_WPS_PROBRSP_MODELNAME_PRESENT 0x00000200
1714#define SIR_WPS_PROBRSP_MODELNUMBER_PRESENT 0x00000400
1715#define SIR_WPS_PROBRSP_SERIALNUMBER_PRESENT 0x00000800
1716#define SIR_WPS_PROBRSP_PRIMARYDEVICETYPE_PRESENT 0x00001000
1717#define SIR_WPS_PROBRSP_DEVICENAME_PRESENT 0x00002000
1718#define SIR_WPS_PROBRSP_CONFIGMETHODS_PRESENT 0x00004000
1719#define SIR_WPS_PROBRSP_RF_BANDS_PRESENT 0x00008000
1720
1721typedef struct sSirWPSProbeRspIE {
1722 uint32_t FieldPresent;
1723 uint32_t Version; /* Version. 0x10 = version 1.0, 0x11 = etc. */
1724 uint32_t wpsState; /* 1 = unconfigured, 2 = configured. */
1725 bool APSetupLocked; /* Must be included if value is true */
1726 /*
1727 * BOOL: indicates if the user has recently activated a Registrar to
1728 * add an Enrollee.
1729 */
1730 bool SelectedRegistra;
1731 uint16_t DevicePasswordID; /* Device Password ID */
1732 /* Selected Registrar config method */
1733 uint16_t SelectedRegistraCfgMethod;
1734 uint8_t ResponseType; /* Response type */
1735 uint8_t UUID_E[16]; /* Unique identifier of the AP. */
1736 tSirName Manufacture;
1737 tSirText ModelName;
1738 tSirText ModelNumber;
1739 tSirText SerialNumber;
1740 /* Device Category ID: 1Computer, 2Input Device, ... */
1741 uint32_t PrimaryDeviceCategory;
1742 /* Vendor specific OUI for Device Sub Category */
1743 uint8_t PrimaryDeviceOUI[4];
1744 /*
1745 Device Sub Category ID: 1-PC, 2-Server if Device Category ID
1746 * is computer
1747 */
1748 uint32_t DeviceSubCategory;
1749 tSirText DeviceName;
1750 uint16_t ConfigMethod; /* Configuaration method */
1751 uint8_t RFBand; /* RF bands available on the AP */
1752} tSirWPSProbeRspIE;
1753
1754#define SIR_WPS_BEACON_VER_PRESENT 0x00000001
1755#define SIR_WPS_BEACON_STATE_PRESENT 0x00000002
1756#define SIR_WPS_BEACON_APSETUPLOCK_PRESENT 0x00000004
1757#define SIR_WPS_BEACON_SELECTEDREGISTRA_PRESENT 0x00000008
1758#define SIR_WPS_BEACON_DEVICEPASSWORDID_PRESENT 0x00000010
1759#define SIR_WPS_BEACON_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020
1760#define SIR_WPS_BEACON_UUIDE_PRESENT 0x00000080
1761#define SIR_WPS_BEACON_RF_BANDS_PRESENT 0x00000100
1762#define SIR_WPS_UUID_LEN 16
1763
1764typedef struct sSirWPSBeaconIE {
1765 uint32_t FieldPresent;
1766 uint32_t Version; /* Version. 0x10 = version 1.0, 0x11 = etc. */
1767 uint32_t wpsState; /* 1 = unconfigured, 2 = configured. */
1768 bool APSetupLocked; /* Must be included if value is true */
1769 /*
1770 * BOOL: indicates if the user has recently activated a Registrar to
1771 * add an Enrollee.
1772 */
1773 bool SelectedRegistra;
1774 uint16_t DevicePasswordID; /* Device Password ID */
1775 /* Selected Registrar config method */
1776 uint16_t SelectedRegistraCfgMethod;
1777 uint8_t UUID_E[SIR_WPS_UUID_LEN]; /* Unique identifier of the AP. */
1778 uint8_t RFBand; /* RF bands available on the AP */
1779} tSirWPSBeaconIE;
1780
1781#define SIR_WPS_ASSOCRSP_VER_PRESENT 0x00000001
1782#define SIR_WPS_ASSOCRSP_RESPONSETYPE_PRESENT 0x00000002
1783
1784typedef struct sSirWPSAssocRspIE {
1785 uint32_t FieldPresent;
1786 uint32_t Version;
1787 uint8_t ResposeType;
1788} tSirWPSAssocRspIE;
1789
1790typedef struct sSirAPWPSIEs {
1791 tSirWPSProbeRspIE SirWPSProbeRspIE; /*WPS Set Probe Respose IE */
1792 tSirWPSBeaconIE SirWPSBeaconIE; /*WPS Set Beacon IE */
1793 tSirWPSAssocRspIE SirWPSAssocRspIE; /*WPS Set Assoc Response IE */
1794} tSirAPWPSIEs, *tpSiriAPWPSIEs;
1795
Naveen Rawat8029a402017-06-01 10:54:19 -07001796struct update_config {
1797 uint16_t messageType; /* eWNI_SME_UPDATE_CONFIG */
1798 uint16_t length;
Abhishek Singhefe21e62019-09-20 10:03:24 +05301799 uint8_t vdev_id;
Naveen Rawat8029a402017-06-01 10:54:19 -07001800 uint16_t capab;
1801 uint32_t value;
1802};
1803
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05301804/*
1805 * enum sir_update_session_param_type - session param type
1806 * @SIR_PARAM_SSID_HIDDEN: ssidHidden parameter
Selvaraj, Sridharac4fcf32016-09-28 12:57:32 +05301807 * @SIR_PARAM_IGNORE_ASSOC_DISALLOWED: ignore_assoc_disallowed parameter
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05301808 */
1809enum sir_update_session_param_type {
1810 SIR_PARAM_SSID_HIDDEN,
Selvaraj, Sridharac4fcf32016-09-28 12:57:32 +05301811 SIR_PARAM_IGNORE_ASSOC_DISALLOWED,
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05301812};
1813
1814/*
1815 * struct sir_update_session_param
1816 * @message_type: SME message type
1817 * @length: size of struct sir_update_session_param
Abhishek Singhefe21e62019-09-20 10:03:24 +05301818 * @vdev_id: vdev ID
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05301819 * @param_type: parameter to be updated
1820 * @param_val: Parameter value to update
1821 */
1822struct sir_update_session_param {
1823 uint16_t message_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001824 uint16_t length;
Abhishek Singhefe21e62019-09-20 10:03:24 +05301825 uint8_t vdev_id;
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05301826 uint32_t param_type;
1827 uint32_t param_val;
1828};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001829
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07001830/**
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -07001831 * struct sir_set_he_bss_color
1832 * @message_type: SME message type
1833 * @length: size of struct sir_set_he_bss_color
Abhishek Singhefe21e62019-09-20 10:03:24 +05301834 * @vdev_id: vdev ID
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -07001835 * @bss_color: bss color value
1836 */
1837struct sir_set_he_bss_color {
1838 uint16_t message_type;
1839 uint16_t length;
Abhishek Singhefe21e62019-09-20 10:03:24 +05301840 uint8_t vdev_id;
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -07001841 uint8_t bss_color;
1842};
1843
1844/**
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07001845 * struct sir_create_session - Used for creating session in monitor mode
1846 * @type: SME host message type.
1847 * @msg_len: Length of the message.
1848 * @bss_id: bss_id for creating the session.
1849 */
1850struct sir_create_session {
1851 uint16_t type;
1852 uint16_t msg_len;
Rajeev Kumar Sirasanagandlae3b59912018-08-24 15:53:31 +05301853 uint8_t vdev_id;
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07001854 struct qdf_mac_addr bss_id;
1855};
1856
Jinwei Chenbdd977f2019-06-14 15:09:30 +08001857/**
1858 * struct sir_delete_session - Used for deleting session in monitor mode
1859 * @type: SME host message type.
1860 * @msg_len: Length of the message.
1861 * @vdev_id: vdev id.
1862 */
1863struct sir_delete_session {
1864 uint16_t type;
1865 uint16_t msg_len;
1866 uint8_t vdev_id;
1867};
1868
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001869/* Beacon Interval */
Jeff Johnson2482c792019-02-06 14:24:07 -08001870struct change_bi_params {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001871 uint16_t messageType;
1872 uint16_t length;
1873 uint16_t beaconInterval; /* Beacon Interval */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301874 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001875 uint8_t sessionId; /* Session ID */
Jeff Johnson2482c792019-02-06 14:24:07 -08001876};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001877
1878#ifdef QCA_HT_2040_COEX
Jeff Johnsonb2c72c02019-02-06 21:32:23 -08001879struct set_ht2040_mode {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001880 uint16_t messageType;
1881 uint16_t length;
1882 uint8_t cbMode;
1883 bool obssEnabled;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301884 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001885 uint8_t sessionId; /* Session ID */
Jeff Johnsonb2c72c02019-02-06 21:32:23 -08001886};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001887#endif
1888
1889#define SIR_WPS_PBC_WALK_TIME 120 /* 120 Second */
1890
1891typedef struct sSirWPSPBCSession {
1892 struct sSirWPSPBCSession *next;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301893 struct qdf_mac_addr addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001894 uint8_t uuid_e[SIR_WPS_UUID_LEN];
1895 uint32_t timestamp;
1896} tSirWPSPBCSession;
1897
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001898typedef struct sSirWPSPBCProbeReq {
Anurag Chouhan6d760662016-02-20 16:05:43 +05301899 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001900 uint16_t probeReqIELen;
1901 uint8_t probeReqIE[512];
1902} tSirWPSPBCProbeReq, *tpSirWPSPBCProbeReq;
1903
1904/* probereq from peer, when wsc is enabled */
1905typedef struct sSirSmeProbeReqInd {
1906 uint16_t messageType; /* eWNI_SME_WPS_PBC_PROBE_REQ_IND */
1907 uint16_t length;
1908 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301909 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001910 tSirWPSPBCProbeReq WPSPBCProbeReq;
1911} tSirSmeProbeReqInd, *tpSirSmeProbeReqInd;
1912
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001913#define SIR_ROAM_MAX_CHANNELS 80
1914#define SIR_ROAM_SCAN_MAX_PB_REQ_SIZE 450
1915/* Occupied channel list remains static */
1916#define CHANNEL_LIST_STATIC 1
Himanshu Agarwalb23aa572018-06-14 17:04:44 +05301917/* Occupied channel list can be dynamic */
1918#define CHANNEL_LIST_DYNAMIC 2
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001919
1920#ifdef WLAN_FEATURE_ROAM_OFFLOAD
hangtianb95e63b2018-11-28 12:10:00 +08001921#define SIR_ROAM_SCAN_PSK_SIZE 48
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001922#define SIR_ROAM_R0KH_ID_MAX_LEN 48
1923#endif
1924/* SME -> HAL - This is the host offload request. */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001925#define SIR_IPV6_NS_OFFLOAD 2
1926#define SIR_OFFLOAD_DISABLE 0
1927#define SIR_OFFLOAD_ENABLE 1
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001928
Jeff Johnsond6fda812019-02-06 21:54:23 -08001929struct sir_host_offload_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001930 uint8_t offloadType;
1931 uint8_t enableOrDisable;
1932 uint32_t num_ns_offload_count;
1933 union {
Srinivas Girigowdad1e45b82019-04-15 15:08:28 -07001934 uint8_t hostIpv4Addr[QDF_IPV4_ADDR_SIZE];
1935 uint8_t hostIpv6Addr[QDF_IPV6_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001936 } params;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301937 struct qdf_mac_addr bssid;
Jeff Johnsond6fda812019-02-06 21:54:23 -08001938};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001939
1940/* Packet Types. */
1941#define SIR_KEEP_ALIVE_NULL_PKT 1
1942#define SIR_KEEP_ALIVE_UNSOLICIT_ARP_RSP 2
1943
1944/* Keep Alive request. */
Jeff Johnson562ccad2019-02-06 22:10:24 -08001945struct keep_alive_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001946 uint8_t packetType;
1947 uint32_t timePeriod;
1948 tSirIpv4Addr hostIpv4Addr;
1949 tSirIpv4Addr destIpv4Addr;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301950 struct qdf_mac_addr dest_macaddr;
1951 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001952 uint8_t sessionId;
Jeff Johnson562ccad2019-02-06 22:10:24 -08001953};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001954
Srinivas Dasariea1c1332019-02-18 12:43:23 +05301955/**
1956 * enum rxmgmt_flags - flags for received management frame.
1957 * @RXMGMT_FLAG_NONE: Default value to indicate no flags are set.
1958 * @RXMGMT_FLAG_EXTERNAL_AUTH: frame can be used for external authentication
1959 * by upper layers.
1960 */
1961enum rxmgmt_flags {
1962 RXMGMT_FLAG_NONE,
1963 RXMGMT_FLAG_EXTERNAL_AUTH = 1 << 1,
1964};
1965
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001966typedef struct sSirSmeMgmtFrameInd {
Abhishek Singh7996eb72015-12-30 17:24:02 +05301967 uint16_t frame_len;
Ashish Kumar Dhanotiyaca5d9222019-08-29 18:56:32 +05301968 uint32_t rx_freq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001969 uint8_t sessionId;
1970 uint8_t frameType;
1971 int8_t rxRssi;
Srinivas Dasariea1c1332019-02-18 12:43:23 +05301972 enum rxmgmt_flags rx_flags;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001973 uint8_t frameBuf[1]; /* variable */
1974} tSirSmeMgmtFrameInd, *tpSirSmeMgmtFrameInd;
1975
Abhishek Singh7996eb72015-12-30 17:24:02 +05301976typedef void (*sir_mgmt_frame_ind_callback)(tSirSmeMgmtFrameInd *frame_ind);
1977/**
1978 * struct sir_sme_mgmt_frame_cb_req - Register a
1979 * management frame callback req
1980 *
1981 * @message_type: message id
1982 * @length: msg length
1983 * @callback: callback for management frame indication
1984 */
1985struct sir_sme_mgmt_frame_cb_req {
1986 uint16_t message_type;
1987 uint16_t length;
1988 sir_mgmt_frame_ind_callback callback;
1989};
1990
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001991#ifdef WLAN_FEATURE_11W
1992typedef struct sSirSmeUnprotMgmtFrameInd {
1993 uint8_t sessionId;
1994 uint8_t frameType;
1995 uint8_t frameLen;
1996 uint8_t frameBuf[1]; /* variable */
1997} tSirSmeUnprotMgmtFrameInd, *tpSirSmeUnprotMgmtFrameInd;
1998#endif
1999
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002000#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
2001
2002typedef enum ext_wow_type {
2003 EXT_WOW_TYPE_APP_TYPE1, /* wow type: only enable wakeup for app type1 */
2004 EXT_WOW_TYPE_APP_TYPE2, /* wow type: only enable wakeup for app type2 */
2005 EXT_WOW_TYPE_APP_TYPE1_2, /* wow type: enable wakeup for app type1&2 */
2006} EXT_WOW_TYPE;
2007
2008typedef struct {
2009 uint8_t vdev_id;
2010 EXT_WOW_TYPE type;
2011 uint32_t wakeup_pin_num;
2012} tSirExtWoWParams, *tpSirExtWoWParams;
2013
2014typedef struct {
2015 uint8_t vdev_id;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302016 struct qdf_mac_addr wakee_mac_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002017 uint8_t identification_id[8];
2018 uint8_t password[16];
2019 uint32_t id_length;
2020 uint32_t pass_length;
2021} tSirAppType1Params, *tpSirAppType1Params;
2022
2023typedef struct {
2024 uint8_t vdev_id;
2025
2026 uint8_t rc4_key[16];
2027 uint32_t rc4_key_len;
2028
2029 /** ip header parameter */
2030 uint32_t ip_id; /* NC id */
2031 uint32_t ip_device_ip; /* NC IP address */
2032 uint32_t ip_server_ip; /* Push server IP address */
2033
2034 /** tcp header parameter */
2035 uint16_t tcp_src_port; /* NC TCP port */
2036 uint16_t tcp_dst_port; /* Push server TCP port */
2037 uint32_t tcp_seq;
2038 uint32_t tcp_ack_seq;
2039
2040 uint32_t keepalive_init; /* Initial ping interval */
2041 uint32_t keepalive_min; /* Minimum ping interval */
2042 uint32_t keepalive_max; /* Maximum ping interval */
2043 uint32_t keepalive_inc; /* Increment of ping interval */
2044
Anurag Chouhan6d760662016-02-20 16:05:43 +05302045 struct qdf_mac_addr gateway_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002046 uint32_t tcp_tx_timeout_val;
2047 uint32_t tcp_rx_timeout_val;
2048} tSirAppType2Params, *tpSirAppType2Params;
2049#endif
2050
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002051#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2052typedef struct {
2053 uint8_t acvo_uapsd:1;
2054 uint8_t acvi_uapsd:1;
2055 uint8_t acbk_uapsd:1;
2056 uint8_t acbe_uapsd:1;
2057 uint8_t reserved:4;
2058} tSirAcUapsd, *tpSirAcUapsd;
2059#endif
2060
2061typedef struct {
2062 tSirMacSSid ssId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302063 uint8_t currAPbssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002064 uint32_t authentication;
2065 uint8_t encryption;
2066 uint8_t mcencryption;
Pragaspathi Thilagarajea180472019-10-10 20:19:36 +05302067 tAniEdType gp_mgmt_cipher_suite;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002068 uint8_t ChannelCount;
Tushnim Bhattacharyya42299b82019-09-01 18:03:54 -07002069 uint32_t chan_freq_cache[SIR_ROAM_MAX_CHANNELS];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002070#ifdef WLAN_FEATURE_11W
2071 bool mfp_enabled;
2072#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002073} tSirRoamNetworkType;
2074
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002075typedef enum {
2076 SIR_ROAMING_DFS_CHANNEL_DISABLED = 0,
2077 SIR_ROAMING_DFS_CHANNEL_ENABLED_NORMAL = 1,
2078 SIR_ROAMING_DFS_CHANNEL_ENABLED_ACTIVE = 2
2079} eSirDFSRoamScanMode;
2080#define MAX_SSID_ALLOWED_LIST 4
2081#define MAX_BSSID_AVOID_LIST 16
2082#define MAX_BSSID_FAVORED 16
2083/**
2084 * struct roam_ext_params - Structure holding roaming parameters
2085 * @num_bssid_avoid_list: The number of BSSID's that we should
2086 * avoid connecting to. It is like a
2087 * blacklist of BSSID's.
2088 * @num_ssid_allowed_list: The number of SSID profiles that are
2089 * in the Whitelist. When roaming, we
2090 * consider the BSSID's with this SSID
2091 * also for roaming apart from the connected one's
2092 * @num_bssid_favored: Number of BSSID's which have a preference over
2093 * others
2094 * @ssid_allowed_list: Whitelist SSID's
2095 * @bssid_avoid_list: Blacklist SSID's
2096 * @bssid_favored: Favorable BSSID's
2097 * @bssid_favored_factor: RSSI to be added to this BSSID to prefer it
2098 * @raise_rssi_thresh_5g: The RSSI threshold below which the
2099 * raise_factor_5g (boost factor) should be
2100 * applied.
2101 * @drop_rssi_thresh_5g: The RSSI threshold beyond which the
2102 * drop_factor_5g (penalty factor) should be
2103 * applied
2104 * @raise_rssi_type_5g: Algorithm to apply the boost factor
2105 * @raise_factor_5g: Boost factor
2106 * @drop_rssi_type_5g: Algorithm to apply the penalty factor
2107 * @drop_factor_5g: Penalty factor
2108 * @max_raise_rssi_5g: Maximum amount of Boost that can added
2109 * @max_drop_rssi_5g: Maximum amount of penalty that can be subtracted
2110 * @good_rssi_threshold: The Lookup UP threshold beyond which roaming
2111 * scan should be performed.
2112 * @rssi_diff: RSSI difference for the AP to be better over the
2113 * current AP to avoid ping pong effects
2114 * @good_rssi_roam: Lazy Roam
gaurank kathpalia3ebc17b2019-05-29 10:25:09 +05302115 * @rssi_reject_list: RSSI reject list (APs rejected by OCE, BTM)
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002116 * @bg_scan_bad_rssi_thresh: Bad RSSI threshold to perform bg scan.
Vignesh Viswanathanc018e982017-09-07 18:49:19 +05302117 * @bad_rssi_thresh_offset_2g: Offset from Bad RSSI threshold for 2G to 5G Roam
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002118 * @bg_scan_client_bitmap: Bitmap to identify the client scans to snoop.
Jianmin Zhu4bff83c2020-09-09 10:07:12 +08002119 * @roam_data_rssi_threshold_triggers: Bad data RSSI threshold to roam
2120 * @roam_data_rssi_threshold: Bad data RSSI threshold to roam
2121 * @rx_data_inactivity_time: rx duration to check data RSSI
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002122 *
2123 * This structure holds all the key parameters related to
2124 * initial connection and also roaming connections.
2125 * */
2126struct roam_ext_params {
2127 uint8_t num_bssid_avoid_list;
2128 uint8_t num_ssid_allowed_list;
2129 uint8_t num_bssid_favored;
2130 tSirMacSSid ssid_allowed_list[MAX_SSID_ALLOWED_LIST];
Anurag Chouhan6d760662016-02-20 16:05:43 +05302131 struct qdf_mac_addr bssid_avoid_list[MAX_BSSID_AVOID_LIST];
2132 struct qdf_mac_addr bssid_favored[MAX_BSSID_FAVORED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002133 uint8_t bssid_favored_factor[MAX_BSSID_FAVORED];
2134 int raise_rssi_thresh_5g;
2135 int drop_rssi_thresh_5g;
2136 uint8_t raise_rssi_type_5g;
2137 uint8_t raise_factor_5g;
2138 uint8_t drop_rssi_type_5g;
2139 uint8_t drop_factor_5g;
2140 int max_raise_rssi_5g;
2141 int max_drop_rssi_5g;
2142 int alert_rssi_threshold;
2143 int rssi_diff;
2144 int good_rssi_roam;
Gupta, Kapilc68ad462016-02-01 19:17:23 +05302145 int dense_rssi_thresh_offset;
2146 int dense_min_aps_cnt;
2147 int initial_dense_status;
2148 int traffic_threshold;
Abhishek Singh4db8c152017-07-18 10:40:08 +05302149 uint8_t num_rssi_rejection_ap;
gaurank kathpalia3ebc17b2019-05-29 10:25:09 +05302150 struct reject_ap_config_params
2151 rssi_reject_bssid_list[MAX_RSSI_AVOID_BSSID_LIST];
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002152 int8_t bg_scan_bad_rssi_thresh;
Vignesh Viswanathanc018e982017-09-07 18:49:19 +05302153 uint8_t roam_bad_rssi_thresh_offset_2g;
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002154 uint32_t bg_scan_client_bitmap;
Jianmin Zhu4bff83c2020-09-09 10:07:12 +08002155 uint32_t roam_data_rssi_threshold_triggers;
2156 int32_t roam_data_rssi_threshold;
2157 uint32_t rx_data_inactivity_time;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002158};
2159
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08002160/**
2161 * struct pmkid_mode_bits - Bit flags for PMKID usage in RSN IE
2162 * @fw_okc: Opportunistic key caching enable in firmware
2163 * @fw_pmksa_cache: PMKSA caching enable in firmware, remember previously
2164 * visited BSSID/PMK pairs
2165 */
2166struct pmkid_mode_bits {
2167 uint32_t fw_okc:1;
2168 uint32_t fw_pmksa_cache:1;
2169 uint32_t unused:30;
2170};
2171
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302172/**
2173 * struct lca_disallow_config_params - LCA[Last Connected AP]
2174 * disallow config params
2175 * @disallow_duration: LCA AP disallowed duration
2176 * @rssi_channel_penalization: RSSI channel Penalization
2177 * @num_disallowed_aps: Maximum number of AP's in LCA list
2178 *
2179 */
Srinivas Girigowdaea4d8062017-10-14 12:40:48 -07002180struct lca_disallow_config_params {
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302181 uint32_t disallow_duration;
2182 uint32_t rssi_channel_penalization;
2183 uint32_t num_disallowed_aps;
2184};
2185
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002186/**
2187 * struct mawc_params - Motion Aided Wireless Connectivity configuration
Wu Gaoca416ff2018-09-17 11:05:07 +08002188 * @mawc_enabled: Global configuration for MAWC (Roaming/PNO/ExtScan)
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002189 * @mawc_roam_enabled: MAWC roaming enable/disable
2190 * @mawc_roam_traffic_threshold: Traffic threshold in kBps for MAWC roaming
2191 * @mawc_roam_ap_rssi_threshold: AP RSSI threshold for MAWC roaming
2192 * @mawc_roam_rssi_high_adjust: High Adjustment value for suppressing scan
2193 * @mawc_roam_rssi_low_adjust: Low Adjustment value for suppressing scan
2194 */
2195struct mawc_params {
2196 bool mawc_enabled;
2197 bool mawc_roam_enabled;
2198 uint32_t mawc_roam_traffic_threshold;
2199 int8_t mawc_roam_ap_rssi_threshold;
2200 uint8_t mawc_roam_rssi_high_adjust;
2201 uint8_t mawc_roam_rssi_low_adjust;
2202};
2203
Abhinav Kumar18285932019-08-08 16:50:06 +05302204/**
Yeshwanth Sriram Guntuka1669fc02019-09-04 16:03:44 +05302205 * struct roam_init_params - Firmware roam module initialization parameters
2206 * @vdev_id: vdev for which the roaming has to be enabled/disabled
2207 * @enable: flag to init/deinit roam module
2208 */
2209struct roam_init_params {
2210 uint8_t vdev_id;
2211 uint8_t enable;
2212};
2213
2214/**
Abhinav Kumar18285932019-08-08 16:50:06 +05302215 * struct roam_sync_timeout_timer_info - Info related to roam sync timer
2216 * @vdev_id: Vdev id for which host waiting roam sync ind from fw
2217 */
2218struct roam_sync_timeout_timer_info {
2219 uint8_t vdev_id;
2220};
2221
Jeff Johnsone6da4b02019-02-06 22:22:04 -08002222struct roam_offload_scan_req {
Selvaraj, Sridhar01741822016-08-30 18:26:19 +05302223 uint16_t message_type;
2224 uint16_t length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002225 bool RoamScanOffloadEnabled;
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002226 struct mawc_params mawc_roam_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002227 int8_t LookupThreshold;
Varun Reddy Yeturu168134f2017-06-26 13:46:05 -07002228 int8_t rssi_thresh_offset_5g;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002229 uint8_t delay_before_vdev_stop;
2230 uint8_t OpportunisticScanThresholdDiff;
2231 uint8_t RoamRescanRssiDiff;
2232 uint8_t RoamRssiDiff;
gaurank kathpaliac63859d2018-05-03 18:48:41 +05302233 struct rsn_caps rsn_caps;
Abhishek Singh34c0e632017-09-28 14:39:29 +05302234 int32_t rssi_abs_thresh;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002235 uint8_t ChannelCacheType;
2236 uint8_t Command;
2237 uint8_t reason;
2238 uint16_t NeighborScanTimerPeriod;
Sridhar Selvaraj1b2330c2017-07-21 15:16:42 +05302239 uint16_t neighbor_scan_min_timer_period;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002240 uint16_t NeighborScanChannelMinTime;
2241 uint16_t NeighborScanChannelMaxTime;
2242 uint16_t EmptyRefreshScanPeriod;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002243 bool IsESEAssoc;
Abhinav Kumar271f0632018-03-29 16:01:30 +05302244 bool is_11r_assoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002245 uint8_t nProbes;
2246 uint16_t HomeAwayTime;
2247 tSirRoamNetworkType ConnectedNetwork;
Jeff Johnson9e760832018-12-15 12:41:36 -08002248 struct mobility_domain_info mdid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002249 uint8_t sessionId;
2250 uint8_t RoamBmissFirstBcnt;
2251 uint8_t RoamBmissFinalBcnt;
2252 uint8_t RoamBeaconRssiWeight;
2253 eSirDFSRoamScanMode allowDFSChannelRoam;
2254#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Jianmin Zhubf845932018-12-17 11:52:50 +08002255 uint8_t roam_offload_enabled;
gaurank kathpaliab68cc872020-03-26 22:14:15 +05302256 bool enable_self_bss_roam;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002257 uint8_t PSK_PMK[SIR_ROAM_SCAN_PSK_SIZE];
2258 uint32_t pmk_len;
2259 uint8_t Prefer5GHz;
2260 uint8_t RoamRssiCatGap;
2261 uint8_t Select5GHzMargin;
2262 uint8_t KRK[SIR_KRK_KEY_LEN];
2263 uint8_t BTK[SIR_BTK_KEY_LEN];
2264 uint32_t ReassocFailureTimeout;
2265 tSirAcUapsd AcUapsd;
2266 uint8_t R0KH_ID[SIR_ROAM_R0KH_ID_MAX_LEN];
2267 uint32_t R0KH_ID_Length;
2268 uint8_t RoamKeyMgmtOffloadEnabled;
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08002269 struct pmkid_mode_bits pmkid_modes;
Pragaspathi Thilagaraj1f3f99f2019-04-24 23:48:47 +05302270 bool is_adaptive_11r_connection;
Abhinav Kumarc2acfc52020-02-10 18:45:23 +05302271 bool is_sae_single_pmk;
Abhinav Kumarb6825052020-05-18 14:15:34 +05302272 bool enable_ft_im_roaming;
Pragaspathi Thilagaraj4f529f22019-03-31 16:53:17 +05302273 /* Idle/Disconnect roam parameters */
2274 struct wmi_idle_roam_params idle_roam_params;
2275 struct wmi_disconnect_roam_params disconnect_roam_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002276#endif
2277 struct roam_ext_params roam_params;
Pragaspathi Thilagaraj47385952020-02-28 14:41:42 +05302278 struct roam_triggers roam_triggers;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002279 uint8_t middle_of_roaming;
2280 uint32_t hi_rssi_scan_max_count;
2281 uint32_t hi_rssi_scan_rssi_delta;
2282 uint32_t hi_rssi_scan_delay;
2283 int32_t hi_rssi_scan_rssi_ub;
Varun Reddy Yeturu05186292015-09-28 17:12:33 -07002284 uint8_t early_stop_scan_enable;
2285 int8_t early_stop_scan_min_threshold;
2286 int8_t early_stop_scan_max_threshold;
Sandeep Puligillaf5ccbf62018-03-26 16:37:05 -07002287 enum scan_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode;
Selvaraj, Sridhara7fc7632016-09-04 13:13:38 +05302288 tSirAddie assoc_ie;
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302289 struct lca_disallow_config_params lca_config_params;
Himanshu Agarwal8bcec572017-09-28 11:54:37 +05302290 struct scoring_param score_params;
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05302291#ifdef WLAN_FEATURE_FILS_SK
2292 bool is_fils_connection;
2293 struct roam_fils_params roam_fils_params;
2294#endif
yeshwanth sriram guntuka41f936c2017-09-01 17:53:49 +05302295 uint32_t btm_offload_config;
Jiachao Wu84bb2ea2018-01-08 16:17:33 +08002296 uint32_t btm_solicited_timeout;
2297 uint32_t btm_max_attempt_cnt;
2298 uint32_t btm_sticky_time;
Pragaspathi Thilagarajae7dc762018-12-12 18:10:50 +05302299 uint32_t rct_validity_timer;
2300 uint32_t disassoc_timer_threshold;
Pragaspathi Thilagaraj2b8ea352019-04-12 02:23:50 +05302301 uint32_t btm_trig_min_candidate_score;
Vignesh Viswanathanfb9d0752018-02-06 16:19:00 +05302302 struct wmi_11k_offload_params offload_11k_params;
Abhinav Kumara083f212018-04-05 18:49:45 +05302303 uint32_t ho_delay_for_rx;
Sourav Mohapatra5ba8da32018-07-16 09:21:15 +05302304 uint32_t roam_preauth_retry_count;
2305 uint32_t roam_preauth_no_ack_timeout;
Abhinav Kumara95af7c2018-04-06 17:08:00 +05302306 uint32_t min_delay_btw_roam_scans;
2307 uint32_t roam_trigger_reason_bitmask;
Abhinav Kumaredd1d372018-05-11 15:33:35 +05302308 bool roam_force_rssi_trigger;
Pragaspathi Thilagaraj69f0b692018-12-16 22:23:04 +05302309 /* bss load triggered roam related params */
2310 bool bss_load_trig_enabled;
2311 struct wmi_bss_load_config bss_load_config;
Abhinav Kumar990fea62019-02-14 12:38:38 +05302312 bool roaming_scan_policy;
Pragaspathi Thilagaraj2b8ea352019-04-12 02:23:50 +05302313 uint32_t roam_scan_inactivity_time;
2314 uint32_t roam_inactive_data_packet_count;
2315 uint32_t roam_scan_period_after_inactivity;
Abhinav Kumar43565942019-03-02 01:34:12 +05302316 uint32_t btm_query_bitmask;
Abhinav Kumard0ed4782020-10-07 19:18:59 +05302317 struct roam_trigger_min_rssi min_rssi_params[NUM_OF_ROAM_MIN_RSSI];
Pragaspathi Thilagaraj2b8ea352019-04-12 02:23:50 +05302318 struct roam_trigger_score_delta score_delta_param[NUM_OF_ROAM_TRIGGERS];
Srinivas Dasari0628e842019-08-22 01:17:38 +05302319 uint32_t full_roam_scan_period;
Jeff Johnsone6da4b02019-02-06 22:22:04 -08002320};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002321
Jeff Johnsond686ba72019-02-06 22:36:42 -08002322struct roam_offload_scan_rsp {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002323 uint8_t sessionId;
2324 uint32_t reason;
Jeff Johnsond686ba72019-02-06 22:36:42 -08002325};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002326
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002327/*---------------------------------------------------------------------------
2328 Packet Filtering Parameters
2329 ---------------------------------------------------------------------------*/
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002330#define SIR_MAX_FILTER_TEST_DATA_LEN 8
Dustin Brown4d1e8462016-12-14 12:12:24 -08002331#define SIR_MAX_FILTER_TEST_DATA_OFFSET 200
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002332#define SIR_MAX_NUM_MULTICAST_ADDRESS 240
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002333
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002334/* */
2335/* Multicast Address List Parameters */
2336/* */
2337typedef struct sSirRcvFltMcAddrList {
2338 uint32_t ulMulticastAddrCnt;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302339 struct qdf_mac_addr multicastAddr[SIR_MAX_NUM_MULTICAST_ADDRESS];
2340 struct qdf_mac_addr self_macaddr;
2341 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002342 uint8_t action;
2343} tSirRcvFltMcAddrList, *tpSirRcvFltMcAddrList;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002344
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002345/**
2346 * struct sir_wifi_start_log - Structure to store the params sent to start/
2347 * stop logging
2348 * @name: Attribute which indicates the type of logging like per packet
2349 * statistics, connectivity etc.
2350 * @verbose_level: Verbose level which can be 0,1,2,3
Poddar, Siddartheefe3482016-09-21 18:12:59 +05302351 * @is_iwpriv_command: Set 1 for iwpriv command
Srinivas Girigowdac34f11d2016-02-25 16:02:42 -08002352 * @ini_triggered: triggered using ini
2353 * @user_triggered: triggered by user
Poddar, Siddarth176c4362016-10-03 12:25:00 +05302354 * @size: pktlog buffer size
Poddar, Siddarthab99a272017-04-10 12:53:26 +05302355 * @is_pktlog_buff_clear: clear the pktlog buffer
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002356 */
2357struct sir_wifi_start_log {
2358 uint32_t ring_id;
2359 uint32_t verbose_level;
Poddar, Siddartheefe3482016-09-21 18:12:59 +05302360 uint32_t is_iwpriv_command;
Srinivas Girigowdac34f11d2016-02-25 16:02:42 -08002361 bool ini_triggered;
2362 uint8_t user_triggered;
Poddar, Siddarth176c4362016-10-03 12:25:00 +05302363 int size;
Poddar, Siddarthab99a272017-04-10 12:53:26 +05302364 bool is_pktlog_buff_clear;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002365};
2366
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002367
2368/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002369 * struct sir_pcl_list - Format of PCL
2370 * @pcl_list: List of preferred channels
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302371 * @weight_list: Weights of the PCL
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002372 * @pcl_len: Number of channels in the PCL
2373 */
2374struct sir_pcl_list {
Rajeev Kumar Sirasanagandla4133d862018-08-23 12:21:36 +05302375 uint32_t pcl_len;
Qun Zhang3a5bd1a2020-03-20 12:05:25 +08002376 uint8_t pcl_list[NUM_CHANNELS];
2377 uint8_t weight_list[NUM_CHANNELS];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002378};
2379
2380/**
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302381 * struct sir_pcl_chan_weights - Params to get the valid weighed list
2382 * @pcl_list: Preferred channel list already sorted in the order of preference
2383 * @pcl_len: Length of the PCL
2384 * @saved_chan_list: Valid channel list updated as part of
2385 * WMA_UPDATE_CHAN_LIST_REQ
2386 * @saved_num_chan: Length of the valid channel list
2387 * @weighed_valid_list: Weights of the valid channel list. This will have one
2388 * to one mapping with valid_chan_list. FW expects channel order and size to be
2389 * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID.
2390 * @weight_list: Weights assigned by policy manager
2391 */
2392struct sir_pcl_chan_weights {
Qun Zhang3a5bd1a2020-03-20 12:05:25 +08002393 uint8_t pcl_list[NUM_CHANNELS];
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302394 uint32_t pcl_len;
Qun Zhang3a5bd1a2020-03-20 12:05:25 +08002395 uint8_t saved_chan_list[NUM_CHANNELS];
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302396 uint32_t saved_num_chan;
Qun Zhang3a5bd1a2020-03-20 12:05:25 +08002397 uint8_t weighed_valid_list[NUM_CHANNELS];
2398 uint8_t weight_list[NUM_CHANNELS];
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302399};
2400
2401/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002402 * struct sir_hw_mode_params - HW mode params
2403 * @mac0_tx_ss: MAC0 Tx spatial stream
2404 * @mac0_rx_ss: MAC0 Rx spatial stream
2405 * @mac1_tx_ss: MAC1 Tx spatial stream
2406 * @mac1_rx_ss: MAC1 Rx spatial stream
2407 * @mac0_bw: MAC0 bandwidth
2408 * @mac1_bw: MAC1 bandwidth
2409 * @dbs_cap: DBS capabality
2410 * @agile_dfs_cap: Agile DFS capabality
2411 */
2412struct sir_hw_mode_params {
2413 uint8_t mac0_tx_ss;
2414 uint8_t mac0_rx_ss;
2415 uint8_t mac1_tx_ss;
2416 uint8_t mac1_rx_ss;
2417 uint8_t mac0_bw;
2418 uint8_t mac1_bw;
2419 uint8_t dbs_cap;
2420 uint8_t agile_dfs_cap;
Nitesh Shah5b7bae02016-09-28 18:58:33 +05302421 uint8_t sbs_cap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002422};
2423
2424/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002425 * struct sir_set_hw_mode_resp - HW mode response
2426 * @status: Status
2427 * @cfgd_hw_mode_index: Configured HW mode index
2428 * @num_vdev_mac_entries: Number of vdev-mac id entries
2429 * @vdev_mac_map: vdev id-mac id map
2430 */
2431struct sir_set_hw_mode_resp {
2432 uint32_t status;
2433 uint32_t cfgd_hw_mode_index;
2434 uint32_t num_vdev_mac_entries;
Tushnim Bhattacharyyaeab33dd2017-11-15 15:20:02 -08002435 struct policy_mgr_vdev_mac_map vdev_mac_map[MAX_VDEV_SUPPORTED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002436};
2437
2438/**
2439 * struct sir_hw_mode_trans_ind - HW mode transition indication
2440 * @old_hw_mode_index: Index of old HW mode
2441 * @new_hw_mode_index: Index of new HW mode
2442 * @num_vdev_mac_entries: Number of vdev-mac id entries
2443 * @vdev_mac_map: vdev id-mac id map
2444 */
2445struct sir_hw_mode_trans_ind {
2446 uint32_t old_hw_mode_index;
2447 uint32_t new_hw_mode_index;
2448 uint32_t num_vdev_mac_entries;
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08002449 struct policy_mgr_vdev_mac_map vdev_mac_map[MAX_VDEV_SUPPORTED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002450};
2451
2452/**
2453 * struct sir_dual_mac_config_resp - Dual MAC config response
2454 * @status: Status of setting the dual mac configuration
2455 */
2456struct sir_dual_mac_config_resp {
2457 uint32_t status;
2458};
2459
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -08002460/**
2461 * enum set_antenna_mode_status - Status of set antenna mode
2462 * command
2463 * @SET_ANTENNA_MODE_STATUS_OK: command successful
2464 * @SET_ANTENNA_MODE_STATUS_EINVAL: invalid antenna mode
2465 * @SET_ANTENNA_MODE_STATUS_ECANCELED: mode change cancelled
2466 * @SET_ANTENNA_MODE_STATUS_ENOTSUP: mode not supported
2467 */
2468enum set_antenna_mode_status {
2469 SET_ANTENNA_MODE_STATUS_OK,
2470 SET_ANTENNA_MODE_STATUS_EINVAL,
2471 SET_ANTENNA_MODE_STATUS_ECANCELED,
2472 SET_ANTENNA_MODE_STATUS_ENOTSUP,
2473};
2474
2475/**
2476 * struct sir_antenna_mode_resp - set antenna mode response
2477 * @status: Status of setting the antenna mode
2478 */
2479struct sir_antenna_mode_resp {
2480 enum set_antenna_mode_status status;
2481};
2482
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002483/* Reset AP Caps Changed */
2484typedef struct sSirResetAPCapsChange {
2485 uint16_t messageType;
2486 uint16_t length;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302487 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002488} tSirResetAPCapsChange, *tpSirResetAPCapsChange;
2489
2490/* / Definition for Candidate found indication from FW */
2491typedef struct sSirSmeCandidateFoundInd {
2492 uint16_t messageType; /* eWNI_SME_CANDIDATE_FOUND_IND */
2493 uint16_t length;
2494 uint8_t sessionId; /* Session Identifier */
2495} tSirSmeCandidateFoundInd, *tpSirSmeCandidateFoundInd;
2496
2497#ifdef WLAN_FEATURE_11W
2498typedef struct sSirWlanExcludeUnencryptParam {
2499 bool excludeUnencrypt;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302500 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002501} tSirWlanExcludeUnencryptParam, *tpSirWlanExcludeUnencryptParam;
2502#endif
2503
2504typedef enum {
2505 P2P_SCAN_TYPE_SEARCH = 1, /* P2P Search */
2506 P2P_SCAN_TYPE_LISTEN /* P2P Listen */
2507} tSirP2pScanType;
2508
2509typedef struct sAniHandoffReq {
2510 /* Common for all types are requests */
2511 uint16_t msgType; /* message type is same as the request type */
2512 uint16_t msgLen; /* length of the entire request */
2513 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302514 uint8_t bssid[QDF_MAC_ADDR_SIZE];
tinlin8d8fbce2019-10-29 17:09:20 +08002515 uint32_t ch_freq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002516 uint8_t handoff_src;
2517} tAniHandoffReq, *tpAniHandoffReq;
2518
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08002519/**
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07002520 * sir_scan_event_type - scan event types used in LIM
2521 * @SIR_SCAN_EVENT_STARTED - scan command accepted by FW
2522 * @SIR_SCAN_EVENT_COMPLETED - scan has been completed by FW
2523 * @SIR_SCAN_EVENT_BSS_CHANNEL - FW is going to move to HOME channel
2524 * @SIR_SCAN_EVENT_FOREIGN_CHANNEL - FW is going to move to FORIEGN channel
2525 * @SIR_SCAN_EVENT_DEQUEUED - scan request got dequeued
2526 * @SIR_SCAN_EVENT_PREEMPTED - preempted by other high priority scan
2527 * @SIR_SCAN_EVENT_START_FAILED - scan start failed
2528 * @SIR_SCAN_EVENT_RESTARTED - scan restarted
2529 * @SIR_SCAN_EVENT_MAX - max value for event type
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08002530*/
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07002531enum sir_scan_event_type {
2532 SIR_SCAN_EVENT_STARTED = 0x1,
2533 SIR_SCAN_EVENT_COMPLETED = 0x2,
2534 SIR_SCAN_EVENT_BSS_CHANNEL = 0x4,
2535 SIR_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
2536 SIR_SCAN_EVENT_DEQUEUED = 0x10,
2537 SIR_SCAN_EVENT_PREEMPTED = 0x20,
2538 SIR_SCAN_EVENT_START_FAILED = 0x40,
2539 SIR_SCAN_EVENT_RESTARTED = 0x80,
2540 SIR_SCAN_EVENT_MAX = 0x8000
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08002541};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002542
2543typedef struct sSirScanOffloadEvent {
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07002544 enum sir_scan_event_type event;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002545 tSirResultCodes reasonCode;
2546 uint32_t chanFreq;
2547 uint32_t requestor;
2548 uint32_t scanId;
2549 tSirP2pScanType p2pScanType;
2550 uint8_t sessionId;
2551} tSirScanOffloadEvent, *tpSirScanOffloadEvent;
2552
2553/**
2554 * struct sSirUpdateChanParam - channel parameters
Tushnim Bhattacharyya41668c62019-07-17 11:44:03 -07002555 * @freq: Frequency of the channel
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002556 * @pwr: power level
2557 * @dfsSet: is dfs supported or not
2558 * @half_rate: is the channel operating at 10MHz
2559 * @quarter_rate: is the channel operating at 5MHz
2560 */
2561typedef struct sSirUpdateChanParam {
Tushnim Bhattacharyya41668c62019-07-17 11:44:03 -07002562 uint32_t freq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002563 uint8_t pwr;
2564 bool dfsSet;
2565 bool half_rate;
2566 bool quarter_rate;
2567} tSirUpdateChanParam, *tpSirUpdateChanParam;
2568
2569typedef struct sSirUpdateChan {
2570 uint8_t numChan;
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07002571 uint8_t ht_en;
2572 uint8_t vht_en;
2573 uint8_t vht_24_en;
Kiran Kumar Lokereacf277a2019-06-24 15:23:38 -07002574 bool he_en;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002575 tSirUpdateChanParam chanParam[1];
2576} tSirUpdateChanList, *tpSirUpdateChanList;
2577
2578typedef enum eSirAddonPsReq {
2579 eSIR_ADDON_NOTHING,
2580 eSIR_ADDON_ENABLE_UAPSD,
2581 eSIR_ADDON_DISABLE_UAPSD
2582} tSirAddonPsReq;
2583
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002584#ifdef FEATURE_WLAN_CH_AVOID
2585typedef struct sSirChAvoidUpdateReq {
2586 uint32_t reserved_param;
2587} tSirChAvoidUpdateReq;
2588#endif /* FEATURE_WLAN_CH_AVOID */
2589
Jeff Johnsone943bca2019-02-08 22:45:17 -08002590struct link_speed_info {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002591 /* MAC Address for the peer */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302592 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002593 uint32_t estLinkSpeed; /* Linkspeed from firmware */
Jeff Johnsone943bca2019-02-08 22:45:17 -08002594};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002595
Will Huanga9814592017-05-24 15:47:58 +08002596/**
Will Huanga9814592017-05-24 15:47:58 +08002597 * struct sir_peer_info_ext_req - peer info request struct
2598 * @peer_macaddr: MAC address
2599 * @sessionid: vdev id
2600 * @reset_after_request: fw reset statistics after query
2601 *
2602 * peer info request message's struct
2603 */
2604struct sir_peer_info_ext_req {
2605 struct qdf_mac_addr peer_macaddr;
2606 uint8_t sessionid;
2607 uint8_t reset_after_request;
2608};
2609
2610/**
2611 * struct sir_peer_info_ext - peer info information struct
2612 * (refer to station_info struct in Kernel)
2613 * @peer_macaddr: MAC address
2614 * @tx_packets: packets transmitted to this station
2615 * @tx_bytes: bytes transmitted to this station
2616 * @rx_packets: packets received from this station
2617 * @rx_bytes: bytes received from this station
Paul Zhang519b5962020-03-09 15:46:28 +08002618 * @tx_retries: cumulative retry counts
2619 * @tx_failed: the number of failed frames
2620 * @tx_succeed: the number of succeed frames
2621 * @rssi: the signal strength
Will Huanga9814592017-05-24 15:47:58 +08002622 * @tx_rate: last used tx bitrate (kbps)
2623 * @tx_rate_code: last tx rate code (last_tx_rate_code of wmi_peer_stats_info)
2624 * @rx_rate: last used rx bitrate (kbps)
2625 * @rx_rate_code: last rx rate code (last_rx_rate_code of wmi_peer_stats_info)
Paul Zhang519b5962020-03-09 15:46:28 +08002626 * @peer_rssi_per_chain: the average value of RSSI (dbm) per chain
Will Huanga9814592017-05-24 15:47:58 +08002627 *
2628 * a station's information
2629 */
2630struct sir_peer_info_ext {
2631 struct qdf_mac_addr peer_macaddr;
2632 uint32_t tx_packets;
2633 uint64_t tx_bytes;
2634 uint32_t rx_packets;
2635 uint64_t rx_bytes;
2636 uint32_t tx_retries;
2637 uint32_t tx_failed;
Paul Zhang519b5962020-03-09 15:46:28 +08002638 uint32_t tx_succeed;
Will Huanga9814592017-05-24 15:47:58 +08002639 int32_t rssi;
2640 uint32_t tx_rate;
2641 uint32_t tx_rate_code;
2642 uint32_t rx_rate;
2643 uint32_t rx_rate_code;
Paul Zhang519b5962020-03-09 15:46:28 +08002644 int32_t peer_rssi_per_chain[WMI_MAX_CHAINS];
Will Huanga9814592017-05-24 15:47:58 +08002645};
2646
2647/**
2648 * struct sir_peer_info_ext_resp - all peers' information struct
2649 * @count: peer's number
2650 * @info: peer information
2651 *
2652 * all station's information
2653 */
2654struct sir_peer_info_ext_resp {
2655 uint8_t count;
2656 struct sir_peer_info_ext info[0];
2657};
2658
Will Huang496b36c2017-07-11 16:38:50 +08002659/**
2660 * @sta_num: number of peer station which has valid info
Will Huang496b36c2017-07-11 16:38:50 +08002661 * @info: peer extended information
2662 *
2663 * all SAP peer station's extended information retrieved
2664 */
2665struct sir_peer_sta_ext_info {
2666 uint8_t sta_num;
2667 struct sir_peer_info_ext info[MAX_PEER_STA];
2668};
2669
guangde4853c402019-05-06 15:54:04 +08002670/**
2671 * struct sir_isolation_resp - isolation info related structure
2672 * @isolation_chain0: isolation value for chain 0
2673 * @isolation_chain1: isolation value for chain 1
2674 * @isolation_chain2: isolation value for chain 2
2675 * @isolation_chain3: isolation value for chain 3
2676 */
2677struct sir_isolation_resp {
2678 uint32_t isolation_chain0:8,
2679 isolation_chain1:8,
2680 isolation_chain2:8,
2681 isolation_chain3:8;
2682};
2683
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002684typedef struct sSirAddPeriodicTxPtrn {
2685 /* MAC Address for the adapter */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302686 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002687 uint8_t ucPtrnId; /* Pattern ID */
2688 uint16_t ucPtrnSize; /* Pattern size */
2689 uint32_t usPtrnIntervalMs; /* In msec */
2690 uint8_t ucPattern[PERIODIC_TX_PTRN_MAX_SIZE]; /* Pattern buffer */
2691} tSirAddPeriodicTxPtrn, *tpSirAddPeriodicTxPtrn;
2692
2693typedef struct sSirDelPeriodicTxPtrn {
2694 /* MAC Address for the adapter */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302695 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002696 uint8_t ucPtrnId; /* Pattern ID */
2697} tSirDelPeriodicTxPtrn, *tpSirDelPeriodicTxPtrn;
2698
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08002699/*---------------------------------------------------------------------------
2700* tSirIbssGetPeerInfoReqParams
2701*--------------------------------------------------------------------------*/
2702typedef struct {
2703 bool allPeerInfoReqd; /* If set, all IBSS peers stats are reported */
Yeshwanth Sriram Guntuka3f262102019-07-16 15:41:08 +05302704 struct qdf_mac_addr peer_mac;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08002705 /* of peer with staIdx is reported */
2706} tSirIbssGetPeerInfoReqParams, *tpSirIbssGetPeerInfoReqParams;
2707
Rajeev Kumar94c9b452016-03-24 12:58:47 -07002708/**
2709 * typedef struct - tSirIbssGetPeerInfoParams
2710 * @mac_addr: mac address received from target
2711 * @txRate: TX rate
2712 * @mcsIndex: MCS index
Rajeev Kumar94c9b452016-03-24 12:58:47 -07002713 * @rssi: RSSI
2714 */
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08002715typedef struct {
Rajeev Kumar94c9b452016-03-24 12:58:47 -07002716 uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
2717 uint32_t txRate;
2718 uint32_t mcsIndex;
Rajeev Kumar94c9b452016-03-24 12:58:47 -07002719 int8_t rssi;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08002720} tSirIbssPeerInfoParams;
2721
2722typedef struct {
2723 uint32_t status;
2724 uint8_t numPeers;
2725 tSirIbssPeerInfoParams peerInfoParams[32];
2726} tSirPeerInfoRspParams, *tpSirIbssPeerInfoRspParams;
2727
2728/*---------------------------------------------------------------------------
2729* tSirIbssGetPeerInfoRspParams
2730*--------------------------------------------------------------------------*/
2731typedef struct {
2732 uint16_t mesgType;
2733 uint16_t mesgLen;
2734 tSirPeerInfoRspParams ibssPeerInfoRspParams;
2735} tSirIbssGetPeerInfoRspParams, *tpSirIbssGetPeerInfoRspParams;
2736
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002737#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
2738typedef struct {
2739 uint16_t mesgType;
2740 uint16_t mesgLen;
2741 bool status;
2742} tSirReadyToExtWoWInd, *tpSirReadyToExtWoWInd;
2743#endif
2744typedef struct sSirRateUpdateInd {
2745 uint8_t nss; /* 0: 1x1, 1: 2x2 */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302746 struct qdf_mac_addr bssid;
Jeff Johnsonc1e62782017-11-09 09:50:17 -08002747 enum QDF_OPMODE dev_mode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002748 int32_t bcastDataRate; /* bcast rate unit Mbpsx10, -1:not used */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002749
2750 /*
2751 * 0 implies MCAST RA, positive value implies fixed rate,
2752 * -1 implies ignore this param
2753 */
2754 int32_t reliableMcastDataRate; /* unit Mbpsx10 */
2755
2756 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07002757 enum tx_rate_info reliableMcastDataRateTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002758
2759 /*
2760 * MCAST(or BCAST) fixed data rate in 2.4 GHz, unit Mbpsx10,
2761 * 0 implies ignore
2762 */
2763 uint32_t mcastDataRate24GHz;
2764
2765 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07002766 enum tx_rate_info mcastDataRate24GHzTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002767
2768 /*
2769 * MCAST(or BCAST) fixed data rate in 5 GHz,
2770 * unit Mbpsx10, 0 implies ignore
2771 */
2772 uint32_t mcastDataRate5GHz;
2773
2774 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07002775 enum tx_rate_info mcastDataRate5GHzTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002776
2777} tSirRateUpdateInd, *tpSirRateUpdateInd;
2778
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002779#define SIR_DFS_MAX_20M_SUB_CH 8
Sandeep Puligilla949eaa72015-12-17 18:43:52 -08002780#define SIR_80MHZ_START_CENTER_CH_DIFF 6
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002781
2782typedef struct sSirSmeDfsChannelList {
2783 uint32_t nchannels;
2784 /* Ch num including bonded channels on which the RADAR is present */
2785 uint8_t channels[SIR_DFS_MAX_20M_SUB_CH];
2786} tSirSmeDfsChannelList, *tpSirSmeDfsChannelList;
2787
2788typedef struct sSirSmeDfsEventInd {
2789 uint32_t sessionId;
2790 tSirSmeDfsChannelList chan_list;
2791 uint32_t dfs_radar_status;
2792 int use_nol;
2793} tSirSmeDfsEventInd, *tpSirSmeDfsEventInd;
2794
2795typedef struct sSirChanChangeRequest {
2796 uint16_t messageType;
2797 uint16_t messageLen;
Amruta Kulkarnif5602532019-10-29 13:40:34 -07002798 uint32_t target_chan_freq;
Kiran Kumar Lokere999e58c2016-01-07 02:18:39 -08002799 uint8_t sec_ch_offset;
Kiran Kumar Lokere13644672016-02-29 15:40:10 -08002800 enum phy_ch_width ch_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002801 uint8_t center_freq_seg_0;
2802 uint8_t center_freq_seg_1;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302803 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002804 uint32_t dot11mode;
Bala Venkateshb39ed152017-12-26 19:35:27 +05302805 tSirNwType nw_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002806 tSirMacRateSet operational_rateset;
2807 tSirMacRateSet extended_rateset;
Arif Hussain671a1902017-03-17 09:08:32 -07002808 uint32_t cac_duration_ms;
2809 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002810} tSirChanChangeRequest, *tpSirChanChangeRequest;
2811
2812typedef struct sSirChanChangeResponse {
2813 uint8_t sessionId;
Liangwei Dong10054b92019-11-29 18:44:14 +08002814 uint32_t new_op_freq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002815 uint8_t channelChangeStatus;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002816} tSirChanChangeResponse, *tpSirChanChangeResponse;
2817
2818typedef struct sSirStartBeaconIndication {
2819 uint16_t messageType;
2820 uint16_t messageLen;
2821 uint8_t beaconStartStatus;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302822 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002823} tSirStartBeaconIndication, *tpSirStartBeaconIndication;
2824
2825/* additional IE type */
2826typedef enum tUpdateIEsType {
2827 eUPDATE_IE_NONE,
2828 eUPDATE_IE_PROBE_BCN,
2829 eUPDATE_IE_PROBE_RESP,
2830 eUPDATE_IE_ASSOC_RESP,
2831
2832 /* Add type above this line */
2833 /* this is used to reset all buffer */
2834 eUPDATE_IE_ALL,
2835 eUPDATE_IE_MAX
2836} eUpdateIEsType;
2837
2838/* Modify particular IE in addition IE for prob resp Bcn */
2839typedef struct sSirModifyIE {
Anurag Chouhan6d760662016-02-20 16:05:43 +05302840 struct qdf_mac_addr bssid;
Abhishek Singh5a2c42f2019-11-19 11:39:23 +05302841 uint16_t vdev_id;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002842 bool notify;
2843 uint8_t ieID;
2844 uint8_t ieIDLen; /*ie length as per spec */
2845 uint16_t ieBufferlength;
2846 uint8_t *pIEBuffer;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08002847 int32_t oui_length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002848
2849} tSirModifyIE, *tpSirModifyIE;
2850
Kiran Kumar Lokerebc87bec2018-02-27 20:06:42 -08002851struct send_add_ba_req {
2852 uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
2853 struct addba_send_params param;
2854};
2855
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002856/* Message format for Update IE message sent to PE */
2857typedef struct sSirModifyIEsInd {
2858 uint16_t msgType;
2859 uint16_t msgLen;
2860 tSirModifyIE modifyIE;
2861 eUpdateIEsType updateType;
2862} tSirModifyIEsInd, *tpSirModifyIEsInd;
2863
2864/* Message format for Update IE message sent to PE */
2865typedef struct sSirUpdateIE {
Anurag Chouhan6d760662016-02-20 16:05:43 +05302866 struct qdf_mac_addr bssid;
Abhishek Singh5a2c42f2019-11-19 11:39:23 +05302867 uint16_t vdev_id;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002868 bool append;
2869 bool notify;
2870 uint16_t ieBufferlength;
2871 uint8_t *pAdditionIEBuffer;
2872} tSirUpdateIE, *tpSirUpdateIE;
2873
2874/* Message format for Update IE message sent to PE */
2875typedef struct sSirUpdateIEsInd {
2876 uint16_t msgType;
2877 uint16_t msgLen;
2878 tSirUpdateIE updateIE;
2879 eUpdateIEsType updateType;
2880} tSirUpdateIEsInd, *tpSirUpdateIEsInd;
2881
2882/* Message format for requesting channel switch announcement to lower layers */
2883typedef struct sSirDfsCsaIeRequest {
2884 uint16_t msgType;
2885 uint16_t msgLen;
Tushnim Bhattacharyyafaa9c012019-10-28 15:18:36 -07002886 uint32_t target_chan_freq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002887 uint8_t csaIeRequired;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302888 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Amar Singhal5cccafe2017-02-15 12:42:58 -08002889 struct ch_params ch_params;
gaoleze2920bd2017-03-21 17:38:42 +08002890 uint8_t ch_switch_beacon_cnt;
gaolez76d2a162017-03-21 19:23:58 +08002891 uint8_t ch_switch_mode;
2892 uint8_t dfs_ch_switch_disable;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002893} tSirDfsCsaIeRequest, *tpSirDfsCsaIeRequest;
2894
2895/* Indication from lower layer indicating the completion of first beacon send
2896 * after the beacon template update
2897 */
2898typedef struct sSirFirstBeaconTxCompleteInd {
2899 uint16_t messageType; /* eWNI_SME_MISSED_BEACON_IND */
2900 uint16_t length;
Pragaspathi Thilagaraje05162d2019-05-23 13:10:46 +05302901 uint8_t bss_idx;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002902} tSirFirstBeaconTxCompleteInd, *tpSirFirstBeaconTxCompleteInd;
2903
2904typedef struct sSirSmeCSAIeTxCompleteRsp {
2905 uint8_t sessionId;
2906 uint8_t chanSwIeTxStatus;
2907} tSirSmeCSAIeTxCompleteRsp, *tpSirSmeCSAIeTxCompleteRsp;
2908
2909/* Thermal Mitigation*/
2910
2911typedef struct {
2912 uint16_t minTempThreshold;
2913 uint16_t maxTempThreshold;
2914} t_thermal_level_info, *tp_thermal_level_info;
2915
2916typedef enum {
2917 WLAN_WMA_THERMAL_LEVEL_0,
2918 WLAN_WMA_THERMAL_LEVEL_1,
2919 WLAN_WMA_THERMAL_LEVEL_2,
2920 WLAN_WMA_THERMAL_LEVEL_3,
2921 WLAN_WMA_MAX_THERMAL_LEVELS
2922} t_thermal_level;
2923
Poddar, Siddarth83905022016-04-16 17:56:08 -07002924#define WLAN_THROTTLE_DUTY_CYCLE_LEVEL_MAX (4)
2925
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002926typedef struct {
2927 /* Array of thermal levels */
2928 t_thermal_level_info thermalLevels[WLAN_WMA_MAX_THERMAL_LEVELS];
2929 uint8_t thermalCurrLevel;
2930 uint8_t thermalMgmtEnabled;
2931 uint32_t throttlePeriod;
Poddar, Siddarth83905022016-04-16 17:56:08 -07002932 uint8_t throttle_duty_cycle_tbl[WLAN_THROTTLE_DUTY_CYCLE_LEVEL_MAX];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002933} t_thermal_mgmt, *tp_thermal_mgmt;
2934
Jeff Johnson19ce8d02019-02-08 22:56:23 -08002935struct tx_power_limit {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002936 /* Thermal limits for 2g and 5g */
2937 uint32_t txPower2g;
2938 uint32_t txPower5g;
Jeff Johnson19ce8d02019-02-08 22:56:23 -08002939};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002940
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +05302941enum bad_peer_thresh_levels {
2942 WLAN_WMA_IEEE80211_B_LEVEL = 0,
2943 WLAN_WMA_IEEE80211_AG_LEVEL,
2944 WLAN_WMA_IEEE80211_N_LEVEL,
2945 WLAN_WMA_IEEE80211_AC_LEVEL,
2946 WLAN_WMA_IEEE80211_AX_LEVEL,
2947 WLAN_WMA_IEEE80211_MAX_LEVEL,
2948};
2949
2950#define NUM_OF_RATE_THRESH_MAX (4)
2951struct t_bad_peer_info {
2952 uint32_t cond;
2953 uint32_t delta;
2954 uint32_t percentage;
2955 uint32_t thresh[NUM_OF_RATE_THRESH_MAX];
2956 uint32_t txlimit;
2957};
2958
2959struct t_bad_peer_txtcl_config {
2960 /* Array of thermal levels */
2961 struct t_bad_peer_info threshold[WLAN_WMA_IEEE80211_MAX_LEVEL];
2962 uint32_t enable;
2963 uint32_t period;
2964 uint32_t txq_limit;
2965 uint32_t tgt_backoff;
2966 uint32_t tgt_report_prd;
2967};
2968
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002969/* notify MODEM power state to FW */
2970typedef struct {
2971 uint32_t param;
2972} tSirModemPowerStateInd, *tpSirModemPowerStateInd;
2973
2974#ifdef WLAN_FEATURE_STATS_EXT
2975typedef struct {
2976 uint32_t vdev_id;
2977 uint32_t event_data_len;
2978 uint8_t event_data[];
2979} tSirStatsExtEvent, *tpSirStatsExtEvent;
2980#endif
2981
Jeff Johnsona7f41dd2019-02-06 22:54:55 -08002982struct roam_offload_synch_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002983 uint16_t messageType; /*eWNI_SME_ROAM_OFFLOAD_SYNCH_IND */
2984 uint16_t length;
2985 uint16_t beaconProbeRespOffset;
2986 uint16_t beaconProbeRespLength;
2987 uint16_t reassocRespOffset;
2988 uint16_t reassocRespLength;
Naveen Rawat14298b92015-11-25 16:27:41 -08002989 uint16_t reassoc_req_offset;
2990 uint16_t reassoc_req_length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002991 uint8_t isBeacon;
Pragaspathi Thilagaraja9ecc632019-02-23 00:50:24 +05302992 uint8_t roamed_vdev_id;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302993 struct qdf_mac_addr bssid;
Varun Reddy Yeturu28925b42016-02-08 07:18:50 -08002994 struct qdf_mac_addr self_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002995 int8_t txMgmtPower;
2996 uint32_t authStatus;
2997 uint8_t rssi;
2998 uint8_t roamReason;
2999 uint32_t chan_freq;
Pragaspathi Thilagarajeb367282019-02-19 00:42:28 +05303000 uint8_t kck[KCK_256BIT_KEY_LEN];
3001 uint8_t kck_len;
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05303002 uint32_t kek_len;
3003 uint8_t kek[SIR_KEK_KEY_LEN_FILS];
3004 uint32_t pmk_len;
3005 uint8_t pmk[SIR_PMK_LEN];
Srinivas Girigowdaff8f5ef2019-03-26 17:20:55 -07003006 uint8_t pmkid[PMKID_LEN];
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05303007 bool update_erp_next_seq_num;
3008 uint16_t next_erp_seq_num;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003009 uint8_t replay_ctr[SIR_REPLAY_CTR_LEN];
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08003010 void *add_bss_params;
Jeff Johnson2df04b82019-02-02 23:30:25 -08003011 struct join_rsp *join_rsp;
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08003012 uint16_t aid;
Naveen Rawat8cc23b02016-07-14 12:22:56 -07003013 struct sir_hw_mode_trans_ind hw_mode_trans_ind;
Naveen Rawat746a90b2017-06-07 15:16:35 -07003014 uint8_t nss;
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05303015 struct qdf_mac_addr dst_mac;
3016 struct qdf_mac_addr src_mac;
3017 uint16_t hlp_data_len;
3018 uint8_t hlp_data[FILS_MAX_HLP_DATA_LEN];
Abhinav Kumar8d52c6c2020-05-06 20:02:16 +05303019 bool is_ft_im_roam;
sheenam monga6ab58a02020-06-29 15:43:45 +05303020 enum wlan_phymode phy_mode; /*phy mode sent by fw */
Jeff Johnsona7f41dd2019-02-06 22:54:55 -08003021};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003022
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -08003023#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Jeff Johnson10cde692019-02-08 19:59:17 -08003024struct handoff_failure_ind {
3025 uint8_t vdev_id;
3026};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003027
3028struct roam_offload_synch_fail {
3029 uint8_t session_id;
3030};
3031
3032#endif
3033
Wen Gong7952fbd2018-04-18 11:27:23 +08003034/**
3035 * struct sir_wisa_params - WISA Mode Parameters
3036 * @mode: WISA mode
3037 * @session_id: Session ID of vdev
3038 */
3039struct sir_wisa_params {
3040 bool mode;
3041 uint8_t vdev_id;
3042};
3043
Ashish Kumar Dhanotiya1a720e72019-09-06 15:42:05 +05303044/**
3045 * typedef enum wifi_scan_flags - wifi scan flags
3046 * @WIFI_SCAN_FLAG_INTERRUPTED: Indicates that scan results are not complete
3047 * because probes were not sent on some channels
3048 */
3049typedef enum {
3050 WIFI_SCAN_FLAG_INTERRUPTED = 1,
3051} wifi_scan_flags;
3052
3053typedef enum {
3054 WIFI_BAND_UNSPECIFIED,
3055 WIFI_BAND_BG = 1, /* 2.4 GHz */
3056 WIFI_BAND_A = 2, /* 5 GHz without DFS */
3057 WIFI_BAND_ABG = 3, /* 2.4 GHz + 5 GHz; no DFS */
3058 WIFI_BAND_A_DFS_ONLY = 4, /* 5 GHz DFS only */
3059 /* 5 is reserved */
3060 WIFI_BAND_A_WITH_DFS = 6, /* 5 GHz with DFS */
3061 WIFI_BAND_ABG_WITH_DFS = 7, /* 2.4 GHz + 5 GHz with DFS */
3062
3063 /* Keep it last */
3064 WIFI_BAND_MAX
3065} tWifiBand;
3066
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003067#ifdef FEATURE_WLAN_EXTSCAN
3068
Wen Gong7952fbd2018-04-18 11:27:23 +08003069#define WLAN_EXTSCAN_MAX_CHANNELS 36
3070#define WLAN_EXTSCAN_MAX_BUCKETS 16
Wen Gong7952fbd2018-04-18 11:27:23 +08003071#define WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS 64
3072
3073typedef enum {
3074 eSIR_EXTSCAN_INVALID,
3075 eSIR_EXTSCAN_START_RSP,
3076 eSIR_EXTSCAN_STOP_RSP,
3077 eSIR_EXTSCAN_CACHED_RESULTS_RSP,
3078 eSIR_EXTSCAN_SET_BSSID_HOTLIST_RSP,
3079 eSIR_EXTSCAN_RESET_BSSID_HOTLIST_RSP,
3080 eSIR_EXTSCAN_SET_SIGNIFICANT_WIFI_CHANGE_RSP,
3081 eSIR_EXTSCAN_RESET_SIGNIFICANT_WIFI_CHANGE_RSP,
3082
3083 eSIR_EXTSCAN_GET_CAPABILITIES_IND,
3084 eSIR_EXTSCAN_HOTLIST_MATCH_IND,
3085 eSIR_EXTSCAN_SIGNIFICANT_WIFI_CHANGE_RESULTS_IND,
3086 eSIR_EXTSCAN_CACHED_RESULTS_IND,
3087 eSIR_EXTSCAN_SCAN_RES_AVAILABLE_IND,
3088 eSIR_EXTSCAN_SCAN_PROGRESS_EVENT_IND,
3089 eSIR_EXTSCAN_FULL_SCAN_RESULT_IND,
3090 eSIR_EPNO_NETWORK_FOUND_IND,
3091 eSIR_PASSPOINT_NETWORK_FOUND_IND,
3092 eSIR_EXTSCAN_SET_SSID_HOTLIST_RSP,
3093 eSIR_EXTSCAN_RESET_SSID_HOTLIST_RSP,
3094
3095 /* Keep this last */
3096 eSIR_EXTSCAN_CALLBACK_TYPE_MAX,
3097} tSirExtScanCallbackType;
3098
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003099/**
Mukul Sharma45114d92016-08-12 19:34:14 +05303100 * enum wifi_extscan_event_type - extscan event type
3101 * @WIFI_EXTSCAN_RESULTS_AVAILABLE: reported when REPORT_EVENTS_EACH_SCAN is set
3102 * and a scan cycle completes. WIFI_SCAN_THRESHOLD_NUM_SCANS or
3103 * WIFI_SCAN_THRESHOLD_PERCENT can be reported instead if the
3104 * reason for the event is available; however, at most one of
3105 * these events should be reported per scan.
3106 * @WIFI_EXTSCAN_THRESHOLD_NUM_SCANS: can be reported when
3107 * REPORT_EVENTS_EACH_SCAN is not set and
3108 * report_threshold_num_scans is reached.
3109 * @WIFI_EXTSCAN_THRESHOLD_PERCENT: can be reported when REPORT_EVENTS_EACH_SCAN
3110 * is not set and report_threshold_percent is reached.
3111 * @WIFI_SCAN_DISABLED: reported when currently executing gscans are disabled
3112 * start_gscan will need to be called again in order to continue
3113 * scanning.
3114 * @WIFI_EXTSCAN_BUCKET_STARTED_EVENT: Bucket started event
3115 * This event is consumed in driver only.
3116 * @WIFI_EXTSCAN_CYCLE_STARTED_EVENT: Cycle started event.
3117 * This event is consumed in driver only.
3118 * @WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT: Cycle complete event. This event
3119 * triggers @WIFI_EXTSCAN_RESULTS_AVAILABLE to the user space.
3120 */
3121enum wifi_extscan_event_type {
Mukul Sharmafa937be2016-08-12 18:13:36 +05303122 WIFI_EXTSCAN_RESULTS_AVAILABLE,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303123 WIFI_EXTSCAN_THRESHOLD_NUM_SCANS,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303124 WIFI_EXTSCAN_THRESHOLD_PERCENT,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303125 WIFI_SCAN_DISABLED,
3126
Mukul Sharmafa937be2016-08-12 18:13:36 +05303127 WIFI_EXTSCAN_BUCKET_STARTED_EVENT = 0x10,
3128 WIFI_EXTSCAN_CYCLE_STARTED_EVENT,
3129 WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT,
Mukul Sharma45114d92016-08-12 19:34:14 +05303130};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003131
3132/**
3133 * enum extscan_configuration_flags - extscan config flags
3134 * @EXTSCAN_LP_EXTENDED_BATCHING: extended batching
3135 */
3136enum extscan_configuration_flags {
3137 EXTSCAN_LP_EXTENDED_BATCHING = 0x00000001,
3138};
3139
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003140/**
3141 * struct ext_scan_capabilities_response - extscan capabilities response data
3142 * @requestId: request identifier
3143 * @status: status
3144 * @max_scan_cache_size: total space allocated for scan (in bytes)
3145 * @max_scan_buckets: maximum number of channel buckets
3146 * @max_ap_cache_per_scan: maximum number of APs that can be stored per scan
3147 * @max_rssi_sample_size: number of RSSI samples used for averaging RSSI
3148 * @ax_scan_reporting_threshold: max possible report_threshold
3149 * @max_hotlist_bssids: maximum number of entries for hotlist APs
3150 * @max_significant_wifi_change_aps: maximum number of entries for
3151 * significant wifi change APs
3152 * @max_bssid_history_entries: number of BSSID/RSSI entries that device can hold
3153 * @max_hotlist_ssids: maximum number of entries for hotlist SSIDs
3154 * @max_number_epno_networks: max number of epno entries
3155 * @max_number_epno_networks_by_ssid: max number of epno entries
3156 * if ssid is specified, that is, epno entries for
3157 * which an exact match is required,
3158 * or entries corresponding to hidden ssids
3159 * @max_number_of_white_listed_ssid: max number of white listed SSIDs
Padma, Santhosh Kumar1ac02402016-11-02 18:04:14 +05303160 * @max_number_of_black_listed_bssid: max number of black listed BSSIDs
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003161 */
3162struct ext_scan_capabilities_response {
3163 uint32_t requestId;
3164 uint32_t status;
3165
3166 uint32_t max_scan_cache_size;
3167 uint32_t max_scan_buckets;
3168 uint32_t max_ap_cache_per_scan;
3169 uint32_t max_rssi_sample_size;
3170 uint32_t max_scan_reporting_threshold;
3171
3172 uint32_t max_hotlist_bssids;
3173 uint32_t max_significant_wifi_change_aps;
3174
3175 uint32_t max_bssid_history_entries;
3176 uint32_t max_hotlist_ssids;
3177 uint32_t max_number_epno_networks;
3178 uint32_t max_number_epno_networks_by_ssid;
3179 uint32_t max_number_of_white_listed_ssid;
Padma, Santhosh Kumar1ac02402016-11-02 18:04:14 +05303180 uint32_t max_number_of_black_listed_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003181};
3182
3183typedef struct {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003184 /* Time of discovery */
3185 uint64_t ts;
3186
3187 /* Null terminated SSID */
Srinivas Girigowdab8fdc642019-03-19 15:33:03 -07003188 uint8_t ssid[WLAN_SSID_MAX_LEN + 1];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003189
Anurag Chouhan6d760662016-02-20 16:05:43 +05303190 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003191
3192 /* Frequency in MHz */
3193 uint32_t channel;
3194
3195 /* RSSI in dBm */
3196 int32_t rssi;
3197
3198 /* RTT in nanoseconds */
3199 uint32_t rtt;
3200
3201 /* Standard deviation in rtt */
3202 uint32_t rtt_sd;
3203
3204 /* Period advertised in the beacon */
3205 uint16_t beaconPeriod;
3206
3207 /* Capabilities advertised in the beacon */
3208 uint16_t capability;
3209
3210 uint16_t ieLength;
3211
3212 uint8_t ieData[];
3213} tSirWifiScanResult, *tpSirWifiScanResult;
3214
3215/**
3216 * struct extscan_hotlist_match - extscan hotlist match
3217 * @requestId: request identifier
3218 * @numOfAps: number of bssids retrieved by the scan
3219 * @moreData: 0 - for last fragment
3220 * 1 - still more fragment(s) coming
3221 * @ap: wifi scan result
3222 */
3223struct extscan_hotlist_match {
3224 uint32_t requestId;
3225 bool moreData;
3226 bool ap_found;
3227 uint32_t numOfAps;
3228 tSirWifiScanResult ap[];
3229};
3230
3231/**
3232 * struct extscan_cached_scan_result - extscan cached scan result
3233 * @scan_id: a unique identifier for the scan unit
3234 * @flags: a bitmask with additional information about scan
3235 * @num_results: number of bssids retrieved by the scan
Mukul Sharmaf7cb3ab2016-08-12 19:53:52 +05303236 * @buckets_scanned: bitmask of buckets scanned in current extscan cycle
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003237 * @ap: wifi scan bssid results info
3238 */
3239struct extscan_cached_scan_result {
3240 uint32_t scan_id;
3241 uint32_t flags;
3242 uint32_t num_results;
Mukul Sharmaf7cb3ab2016-08-12 19:53:52 +05303243 uint32_t buckets_scanned;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003244 tSirWifiScanResult *ap;
3245};
3246
3247/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003248 * struct extscan_cached_scan_results - extscan cached scan results
3249 * @request_id: request identifier
3250 * @more_data: 0 - for last fragment
3251 * 1 - still more fragment(s) coming
3252 * @num_scan_ids: number of scan ids
3253 * @result: wifi scan result
3254 */
3255struct extscan_cached_scan_results {
3256 uint32_t request_id;
3257 bool more_data;
3258 uint32_t num_scan_ids;
3259 struct extscan_cached_scan_result *result;
3260};
3261
3262
3263/**
3264 * struct tSirWifiFullScanResultEvent - extscan full scan event
3265 * @request_id: request identifier
3266 * @moreData: 0 - for last fragment
3267 * 1 - still more fragment(s) coming
3268 * @ap: bssid info
3269 *
Jeff Johnsondab58602018-07-14 15:30:24 -07003270 * Reported when each probe response is received, if report_events
3271 * enabled in struct wifi_scan_cmd_req_params
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003272 */
3273typedef struct {
3274 uint32_t requestId;
3275 bool moreData;
3276 tSirWifiScanResult ap;
3277} tSirWifiFullScanResultEvent, *tpSirWifiFullScanResultEvent;
3278
3279/**
3280 * struct pno_match_found - epno match found
3281 * @request_id: request identifier
3282 * @moreData: 0 - for last fragment
3283 * 1 - still more fragment(s) coming
3284 * @num_results: number of bssids, driver sends this event to upper layer
3285 * for every beacon, hence %num_results is always set to 1.
3286 * @ap: bssid info
3287 *
3288 * Reported when each beacon probe response is received with
3289 * epno match found tag.
3290 */
3291struct pno_match_found {
3292 uint32_t request_id;
3293 bool more_data;
3294 uint32_t num_results;
3295 tSirWifiScanResult ap[];
3296};
3297
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003298/**
3299 * struct sir_extscan_generic_response -
3300 * Generic ExtScan Response structure
3301 * @request_id: ID of the request
3302 * @status: operation status returned by firmware
3303 */
3304struct sir_extscan_generic_response {
3305 uint32_t request_id;
3306 uint32_t status;
3307};
3308
3309typedef struct {
Anurag Chouhan6d760662016-02-20 16:05:43 +05303310 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003311 uint32_t channel;
3312 uint32_t numOfRssi;
3313
3314 /* Rssi history in db */
3315 int32_t rssi[];
3316} tSirWifiSignificantChange, *tpSirWifiSignificantChange;
3317
3318typedef struct {
3319 uint32_t requestId;
3320
3321 bool moreData;
3322 uint32_t numResults;
3323 tSirWifiSignificantChange ap[];
3324} tSirWifiSignificantChangeEvent, *tpSirWifiSignificantChangeEvent;
3325
3326typedef struct {
3327 uint32_t requestId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003328 uint32_t numResultsAvailable;
3329} tSirExtScanResultsAvailableIndParams, *tpSirExtScanResultsAvailableIndParams;
3330
3331typedef struct {
3332 uint32_t requestId;
3333 uint32_t status;
3334 uint8_t scanEventType;
Mukul Sharmafa937be2016-08-12 18:13:36 +05303335 uint32_t buckets_scanned;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003336} tSirExtScanOnScanEventIndParams, *tpSirExtScanOnScanEventIndParams;
3337
Mukul Sharmae8c919f2016-10-02 20:35:15 +05303338#define MAX_EPNO_NETWORKS 64
3339
Jeff Johnson96f93a32016-11-18 11:02:24 -08003340#define SIR_PASSPOINT_LIST_MAX_NETWORKS 8
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003341
3342/**
3343 * struct wifi_passpoint_match - wifi passpoint network match
3344 * @id: network block identifier for the matched network
3345 * @anqp_len: length of ANQP blob
3346 * @ap: scan result, with channel and beacon information
3347 * @anqp: ANQP data, in the information_element format
3348 */
3349struct wifi_passpoint_match {
3350 uint32_t request_id;
3351 uint32_t id;
3352 uint32_t anqp_len;
3353 tSirWifiScanResult ap;
3354 uint8_t anqp[];
3355};
3356#endif /* FEATURE_WLAN_EXTSCAN */
3357
3358#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
Jeff Johnsona9ade7d2019-02-17 10:08:17 -08003359struct auto_shutdown_cmd {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003360 uint32_t timer_val;
Jeff Johnsona9ade7d2019-02-17 10:08:17 -08003361};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003362#endif
3363
Aditya Kodukula0a590372020-04-15 13:30:14 -07003364#ifdef WLAN_POWER_DEBUG
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05303365/**
3366 * struct power_stats_response - Power stats response
3367 * @cumulative_sleep_time_ms: cumulative sleep time in ms
3368 * @cumulative_total_on_time_ms: total awake time in ms
3369 * @deep_sleep_enter_counter: deep sleep enter counter
3370 * @last_deep_sleep_enter_tstamp_ms: last deep sleep enter timestamp
3371 * @debug_register_fmt: debug registers format
3372 * @num_debug_register: number of debug registers
3373 * @debug_registers: Pointer to the debug registers buffer
3374 */
3375struct power_stats_response {
3376 uint32_t cumulative_sleep_time_ms;
3377 uint32_t cumulative_total_on_time_ms;
3378 uint32_t deep_sleep_enter_counter;
3379 uint32_t last_deep_sleep_enter_tstamp_ms;
3380 uint32_t debug_register_fmt;
3381 uint32_t num_debug_register;
3382 uint32_t *debug_registers;
3383};
Aditya Kodukula0a590372020-04-15 13:30:14 -07003384#endif
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05303385
Arunk Khandavallica56d4b2018-11-29 15:46:00 +05303386#ifdef WLAN_FEATURE_BEACON_RECEPTION_STATS
3387#define MAX_BCNMISS_BITMAP 8
3388/**
3389 * struct bcn_reception_stats_rsp - beacon stats response
3390 * @total_bcn_cnt: total beacon count (tbtt instances)
3391 * @total_bmiss_cnt: Total beacon miss count in last 255 beacons, max 255
3392 * @bmiss_bitmap: This bitmap indicates the status of the last 255 beacons.
3393 * If a bit is set, that means the corresponding beacon was missed.
3394 * Bit 0 of bmiss_bitmap[0] represents the most recent beacon.
3395 * The total_bcn_cnt field indicates how many bits within bmiss_bitmap
3396 * are valid.
3397 */
3398struct bcn_reception_stats_rsp {
3399 uint32_t vdev_id;
3400 uint32_t total_bcn_cnt;
3401 uint32_t total_bmiss_cnt;
3402 uint32_t bmiss_bitmap[MAX_BCNMISS_BITMAP];
3403};
3404#endif
3405
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +05303406/**
3407 * struct lfr_firmware_status - LFR status in firmware
3408 * @is_disabled: Is LFR disabled in FW
3409 * @disable_lfr_event: Disable attempt done in FW
3410 */
3411struct lfr_firmware_status {
3412 uint32_t is_disabled;
3413 struct completion disable_lfr_event;
3414};
3415
3416/**
3417 * struct rso_cmd_status - RSO Command status
3418 * @vdev_id: Vdev ID for which RSO command sent
3419 * @status: Status of RSO command sent to FW
3420 */
3421struct rso_cmd_status {
3422 uint32_t vdev_id;
3423 bool status;
3424};
3425
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003426enum {
3427 SIR_AP_RX_DATA_OFFLOAD = 0x00,
3428 SIR_STA_RX_DATA_OFFLOAD = 0x01,
3429};
3430
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07003431/**
Naveen Rawata410c5a2016-09-19 14:22:33 -07003432 * struct sir_set_vdev_ies_per_band
3433 * @msg_type: message type
3434 * @len: message length
3435 * @vdev_id: vdev id
3436 *
3437 * Message wrapper structure for eWNI_SME_SET_VDEV_IES_PER_BAND.
3438 */
3439struct sir_set_vdev_ies_per_band {
3440 uint16_t msg_type;
3441 uint16_t len;
3442 uint32_t vdev_id;
Kiran Kumar Lokere46ca7d72020-08-20 19:36:39 -07003443 uint16_t dot11_mode;
3444 enum QDF_OPMODE device_mode;
Naveen Rawata410c5a2016-09-19 14:22:33 -07003445};
3446
3447/**
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07003448 * struct sir_set_ht_vht_cfg - ht, vht IE config
3449 * @msg_type: message type
3450 * @len: message length
3451 * @pdev_id: pdev id
3452 * @nss: Nss value
3453 * @dot11mode: Dot11 mode.
3454 *
3455 * Message wrapper structure for set HT/VHT IE req.
3456 */
3457struct sir_set_ht_vht_cfg {
3458 uint16_t msg_type;
3459 uint16_t len;
3460 uint32_t pdev_id;
3461 uint32_t nss;
3462 uint32_t dot11mode;
3463};
3464
Qiwei Cai3719efe2018-06-11 21:09:29 +08003465#define WIFI_INVALID_PEER_ID (-1)
3466#define WIFI_INVALID_VDEV_ID (-1)
3467#define WIFI_MAX_AC (4)
Yeshwanth Sriram Guntuka158b4cc2020-05-20 17:39:44 +05303468#define RATE_STAT_MCS_MASK (0xFF00)
3469#define RATE_STAT_GET_MCS_INDEX(x) (((x) & RATE_STAT_MCS_MASK) >> 8)
Qiwei Cai3719efe2018-06-11 21:09:29 +08003470
3471typedef struct {
3472 uint32_t paramId;
3473 uint8_t ifaceId;
3474 uint32_t rspId;
3475 uint32_t moreResultToFollow;
3476 uint32_t nr_received;
3477 union {
3478 uint32_t num_peers;
3479 uint32_t num_radio;
3480 };
3481
3482 uint32_t peer_event_number;
3483 /* Variable length field - Do not add anything after this */
3484 uint8_t results[0];
3485} tSirLLStatsResults, *tpSirLLStatsResults;
3486
3487#ifdef WLAN_FEATURE_LINK_LAYER_STATS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003488/*---------------------------------------------------------------------------
3489 WLAN_HAL_LL_NOTIFY_STATS
3490 ---------------------------------------------------------------------------*/
3491
3492/******************************LINK LAYER Statistics**********************/
3493
Qiwei Cai3719efe2018-06-11 21:09:29 +08003494typedef struct {
3495 uint32_t reqId;
3496 uint8_t staId;
3497 uint32_t mpduSizeThreshold;
3498 uint32_t aggressiveStatisticsGathering;
3499} tSirLLStatsSetReq, *tpSirLLStatsSetReq;
3500
3501typedef struct {
3502 uint32_t reqId;
3503 uint8_t staId;
3504 uint32_t paramIdMask;
3505} tSirLLStatsGetReq, *tpSirLLStatsGetReq;
3506
3507typedef struct {
3508 uint32_t reqId;
3509 uint8_t staId;
3510 uint32_t statsClearReqMask;
3511 uint8_t stopReq;
3512} tSirLLStatsClearReq, *tpSirLLStatsClearReq;
3513
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003514typedef enum {
3515 WIFI_DISCONNECTED = 0,
3516 WIFI_AUTHENTICATING = 1,
3517 WIFI_ASSOCIATING = 2,
3518 WIFI_ASSOCIATED = 3,
3519 WIFI_EAPOL_STARTED = 4, /* if done by firmware/driver */
3520 WIFI_EAPOL_COMPLETED = 5, /* if done by firmware/driver */
3521} tSirWifiConnectionState;
3522
3523typedef enum {
3524 WIFI_ROAMING_IDLE = 0,
3525 WIFI_ROAMING_ACTIVE = 1,
3526} tSirWifiRoamState;
3527
3528typedef enum {
3529 WIFI_INTERFACE_STA = 0,
3530 WIFI_INTERFACE_SOFTAP = 1,
3531 WIFI_INTERFACE_IBSS = 2,
3532 WIFI_INTERFACE_P2P_CLIENT = 3,
3533 WIFI_INTERFACE_P2P_GO = 4,
3534 WIFI_INTERFACE_NAN = 5,
3535 WIFI_INTERFACE_MESH = 6,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -07003536 WIFI_INTERFACE_NDI = 7,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003537} tSirWifiInterfaceMode;
3538
3539/* set for QOS association */
3540#define WIFI_CAPABILITY_QOS 0x00000001
3541/* set for protected assoc (802.11 beacon frame control protected bit set) */
3542#define WIFI_CAPABILITY_PROTECTED 0x00000002
3543/* set if 802.11 Extended Capabilities element interworking bit is set */
3544#define WIFI_CAPABILITY_INTERWORKING 0x00000004
3545/* set for HS20 association */
3546#define WIFI_CAPABILITY_HS20 0x00000008
3547/* set is 802.11 Extended Capabilities element UTF-8 SSID bit is set */
3548#define WIFI_CAPABILITY_SSID_UTF8 0x00000010
3549/* set is 802.11 Country Element is present */
3550#define WIFI_CAPABILITY_COUNTRY 0x00000020
3551
Jeff Johnsonc9770ee2019-03-08 15:56:52 -08003552struct wifi_interface_info {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003553 /* tSirWifiInterfaceMode */
3554 /* interface mode */
3555 uint8_t mode;
3556 /* interface mac address (self) */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303557 struct qdf_mac_addr macAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003558 /* tSirWifiConnectionState */
3559 /* connection state (valid for STA, CLI only) */
3560 uint8_t state;
3561 /* tSirWifiRoamState */
3562 /* roaming state */
3563 uint32_t roaming;
3564 /* WIFI_CAPABILITY_XXX (self) */
3565 uint32_t capabilities;
3566 /* null terminated SSID */
3567 uint8_t ssid[33];
3568 /* bssid */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303569 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003570 /* country string advertised by AP */
Wu Gaoaa155142019-01-14 15:09:26 +08003571 uint8_t apCountryStr[CFG_COUNTRY_CODE_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003572 /* country string for this association */
Wu Gaoaa155142019-01-14 15:09:26 +08003573 uint8_t countryStr[CFG_COUNTRY_CODE_LEN];
Jeff Johnsonc9770ee2019-03-08 15:56:52 -08003574};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003575
Jeff Johnson17ba70a2019-03-30 08:34:14 -07003576/**
3577 * struct wifi_channel_info - channel information
3578 * @width: channel width (20, 40, 80, 80+80, 160)
3579 * @center_freq: primary 20 MHz channel
3580 * @center_freq0: center frequency (MHz) first segment
3581 * @center_freq1: center frequency (MHz) second segment
3582 */
3583struct wifi_channel_info {
Jeff Johnson1043f522019-03-29 11:32:51 -07003584 enum phy_ch_width width;
Jeff Johnson17ba70a2019-03-30 08:34:14 -07003585 uint32_t center_freq;
3586 uint32_t center_freq0;
3587 uint32_t center_freq1;
3588};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003589
Jeff Johnsonb67be242019-03-30 10:25:53 -07003590/**
3591 * struct wifi_rate_info - wifi rate information
3592 * @preamble: 0:OFDM, 1:CCK, 2:HT 3:VHT 4..7 reserved
3593 * @nss: 0:1x1, 1:2x2, 3:3x3, 4:4x4
3594 * @bw: 0:20MHz, 1:40Mhz, 2:80Mhz, 3:160Mhz
3595 * @rate_or_mcs_index:
3596 * * OFDM/CCK: rate code per ieee std in units of 0.5mbps
3597 * * HT/VHT: mcs index
3598 * @reserved: reserved
3599 * @bitrate: bitrate units of 100 Kbps
3600 */
3601struct wifi_rate_info {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003602 uint32_t preamble:3;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003603 uint32_t nss:2;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003604 uint32_t bw:3;
Jeff Johnsonb67be242019-03-30 10:25:53 -07003605 uint32_t rate_or_mcs_index:8;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003606 uint32_t reserved:16;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003607 uint32_t bitrate;
Jeff Johnsonb67be242019-03-30 10:25:53 -07003608};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003609
Jeff Johnson4ee14f42019-03-30 10:43:37 -07003610/**
3611 * struct wifi_channel_stats - channel statistics
3612 * @channel: channel for which the stats are applicable
3613 * @on_time: msecs the radio is awake
3614 * @cca_busy_time: secs the CCA register is busy
3615 */
3616struct wifi_channel_stats {
Jeff Johnson17ba70a2019-03-30 08:34:14 -07003617 struct wifi_channel_info channel;
Jeff Johnson4ee14f42019-03-30 10:43:37 -07003618 uint32_t on_time;
3619 uint32_t cca_busy_time;
3620};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003621
Jeff Johnsone4bba7c2019-03-30 11:58:51 -07003622/**
3623 * struct wifi_radio_stats - per-radio statistics
3624 * @radio: wifi radio for which the stats are applicable
3625 * @on_time: msecs the radio is awake
3626 * @tx_time: msecs the radio is transmitting
3627 * @rx_time: msecs the radio is in active receive
3628 * @on_time_scan: msecs the radio is awake due to all scan
3629 * @on_time_nbd: msecs the radio is awake due to NAN
3630 * @on_time_gscan: msecs the radio is awake due to Gscan
3631 * @on_time_roam_scan: msecs the radio is awake due to roam scan
3632 * @on_time_pno_scan: msecs the radio is awake due to PNO scan
3633 * @on_time_hs20: msecs the radio is awake due to HS2.0 scans and GAS exchange
3634 * @on_time_host_scan: msecs the radio is awake due to Host initiated scan
3635 * @on_time_lpi_scan: msecs the radio is awake due to LPI scan
3636 * @total_num_tx_power_levels: @tx_time_per_power_level record count
3637 * @tx_time_per_power_level: tx time (in milliseconds) per TPC level (0.5 dBm)
3638 * @num_channels: @channels record count
3639 * @channels: per-channel statistics
3640 */
3641struct wifi_radio_stats {
Jeff Johnson48b1eb02019-03-30 15:07:52 -07003642 uint32_t radio;
Jeff Johnsone4bba7c2019-03-30 11:58:51 -07003643 uint32_t on_time;
3644 uint32_t tx_time;
3645 uint32_t rx_time;
3646 uint32_t on_time_scan;
3647 uint32_t on_time_nbd;
3648 uint32_t on_time_gscan;
3649 uint32_t on_time_roam_scan;
3650 uint32_t on_time_pno_scan;
3651 uint32_t on_time_hs20;
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08003652 uint32_t on_time_host_scan;
3653 uint32_t on_time_lpi_scan;
Jeff Johnsone4bba7c2019-03-30 11:58:51 -07003654 uint32_t total_num_tx_power_levels;
3655 uint32_t *tx_time_per_power_level;
3656 uint32_t num_channels;
Jeff Johnson4ee14f42019-03-30 10:43:37 -07003657 struct wifi_channel_stats *channels;
Jeff Johnsone4bba7c2019-03-30 11:58:51 -07003658};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003659
Jeff Johnsond3b3b112019-03-28 12:56:04 -07003660/**
3661 * struct wifi_rate_stat - per rate statistics
3662 * @rate: rate information
3663 * @tx_mpdu: number of successfully transmitted data pkts (ACK rcvd)
3664 * @rx_mpdu: number of received data pkts
3665 * @mpdu_lost: number of data packet losses (no ACK)
3666 * @retries: total number of data pkt retries *
3667 * @retries_short: number of short data pkt retries
3668 * @retries_long: number of long data pkt retries
3669 */
3670struct wifi_rate_stat {
Jeff Johnsonb67be242019-03-30 10:25:53 -07003671 struct wifi_rate_info rate;
Jeff Johnsond3b3b112019-03-28 12:56:04 -07003672 uint32_t tx_mpdu;
3673 uint32_t rx_mpdu;
3674 uint32_t mpdu_lost;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003675 uint32_t retries;
Jeff Johnsond3b3b112019-03-28 12:56:04 -07003676 uint32_t retries_short;
3677 uint32_t retries_long;
3678};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003679
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003680/* wifi peer type */
3681typedef enum {
3682 WIFI_PEER_STA,
3683 WIFI_PEER_AP,
3684 WIFI_PEER_P2P_GO,
3685 WIFI_PEER_P2P_CLIENT,
3686 WIFI_PEER_NAN,
3687 WIFI_PEER_TDLS,
3688 WIFI_PEER_INVALID,
3689} tSirWifiPeerType;
3690
Jeff Johnson10495032019-03-28 13:51:59 -07003691/**
3692 * struct wifi_peer_info - per peer information
3693 * @type: peer type (AP, TDLS, GO etc.)
3694 * @peer_macaddr: mac address
3695 * @capabilities: peer WIFI_CAPABILITY_XXX
3696 * @power_saving: peer power saving mode
3697 * @num_rate: number of rates
3698 * @rate_stats: per rate statistics, number of entries = @num_rate
3699 */
3700struct wifi_peer_info {
Dustin Brown877a5a92016-11-17 13:56:52 -08003701 enum wmi_peer_type type;
Jeff Johnson10495032019-03-28 13:51:59 -07003702 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003703 uint32_t capabilities;
Zhang Qiana6e9c102016-12-22 16:47:24 +08003704 union {
Zhang Qiana6e9c102016-12-22 16:47:24 +08003705 uint32_t power_saving;
Jeff Johnson10495032019-03-28 13:51:59 -07003706 uint32_t num_rate;
Zhang Qiana6e9c102016-12-22 16:47:24 +08003707 };
Jeff Johnson10495032019-03-28 13:51:59 -07003708 struct wifi_rate_stat rate_stats[0];
3709};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003710
Jeff Johnsonaf545282019-04-01 12:18:59 -07003711/**
3712 * struct wifi_interface_stats - Interface statistics
3713 * @info: struct containing the current state of the interface
3714 * @rts_succ_cnt: number of RTS/CTS sequence success
3715 * @rts_fail_cnt: number of RTS/CTS sequence failures
3716 * @ppdu_succ_cnt: number of PPDUs transmitted
3717 * @ppdu_fail_cnt: number of PPDUs that failed to transmit
3718 * @link_stats: link-level statistics
3719 * @ac_stats: per-Access Category statistics
3720 * @num_offload_stats: @offload_stats record count
3721 * @offload_stats: per-offload statistics
3722 *
3723 * Statistics corresponding to 2nd most LSB in wifi statistics bitmap
3724 * for getting statistics
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003725 */
Jeff Johnsonaf545282019-04-01 12:18:59 -07003726struct wifi_interface_stats {
Jeff Johnsonc9770ee2019-03-08 15:56:52 -08003727 struct wifi_interface_info info;
gaolezb432ed92017-03-16 18:40:04 +08003728 uint32_t rts_succ_cnt;
3729 uint32_t rts_fail_cnt;
3730 uint32_t ppdu_succ_cnt;
3731 uint32_t ppdu_fail_cnt;
Min Liuffb250d2018-07-11 17:35:32 +08003732 wmi_iface_link_stats link_stats;
Min Liuffb250d2018-07-11 17:35:32 +08003733 wmi_wmm_ac_stats ac_stats[WIFI_AC_MAX];
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08003734 uint32_t num_offload_stats;
Min Liuffb250d2018-07-11 17:35:32 +08003735 wmi_iface_offload_stats offload_stats[WMI_OFFLOAD_STATS_TYPE_MAX];
Jeff Johnsonaf545282019-04-01 12:18:59 -07003736};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003737
Jeff Johnsonfcb078d2019-03-28 14:34:01 -07003738/**
3739 * struct wifi_peer_stat - peer statistics
3740 * @num_peers: number of peers
3741 * @peer_info: per peer statistics
3742 *
3743 * Peer statistics - corresponding to 3rd most LSB in
3744 * wifi statistics bitmap for getting statistics
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003745 */
Jeff Johnsonfcb078d2019-03-28 14:34:01 -07003746struct wifi_peer_stat {
3747 uint32_t num_peers;
3748 struct wifi_peer_info peer_info[0];
3749};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003750
3751/* wifi statistics bitmap for getting statistics */
3752#define WMI_LINK_STATS_RADIO 0x00000001
3753#define WMI_LINK_STATS_IFACE 0x00000002
3754#define WMI_LINK_STATS_ALL_PEER 0x00000004
3755#define WMI_LINK_STATS_PER_PEER 0x00000008
3756
3757/* wifi statistics bitmap for clearing statistics */
3758/* all radio statistics */
3759#define WIFI_STATS_RADIO 0x00000001
3760/* cca_busy_time (within radio statistics) */
3761#define WIFI_STATS_RADIO_CCA 0x00000002
3762/* all channel statistics (within radio statistics) */
3763#define WIFI_STATS_RADIO_CHANNELS 0x00000004
3764/* all scan statistics (within radio statistics) */
3765#define WIFI_STATS_RADIO_SCAN 0x00000008
3766/* all interface statistics */
3767#define WIFI_STATS_IFACE 0x00000010
3768/* all tx rate statistics (within interface statistics) */
3769#define WIFI_STATS_IFACE_TXRATE 0x00000020
3770/* all ac statistics (within interface statistics) */
3771#define WIFI_STATS_IFACE_AC 0x00000040
3772/* all contention (min, max, avg) statistics (within ac statistics) */
3773#define WIFI_STATS_IFACE_CONTENTION 0x00000080
Mukul Sharma491021c2016-09-29 21:39:19 +05303774/* All peer stats on this interface */
3775#define WIFI_STATS_IFACE_ALL_PEER 0x00000100
3776/* Clear particular peer stats depending on the peer_mac */
3777#define WIFI_STATS_IFACE_PER_PEER 0x00000200
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003778
Zhang Qiana6e9c102016-12-22 16:47:24 +08003779/**
3780 * struct sir_wifi_iface_tx_fail - TX failure event
3781 * @tid: TX TID
3782 * @msdu_num: TX MSDU failed counter
3783 * @status: TX status from HTT message.
3784 * Only failure status will be involved.
3785 */
3786struct sir_wifi_iface_tx_fail {
3787 uint8_t tid;
3788 uint16_t msdu_num;
3789 enum htt_tx_status status;
3790};
3791
Zhang Qian73c348a2017-03-13 16:15:55 +08003792/**
3793 * struct sir_wifi_chan_cca_stats - channal CCA stats
3794 * @vdev_id: vdev ID
3795 * @idle_time: percentage of idle time, no TX, no RX, no interference
3796 * @tx_time: percentage of time transmitting packets
3797 * @rx_in_bss_time: percentage of time receiving packets in current BSS
3798 * @rx_out_bss_time: percentage of time receiving packets not in current BSS
3799 * @rx_busy_time: percentage of time interference detected
3800 * @rx_in_bad_cond_time: percentage of time receiving packets with errors
3801 * or packets flagged as retransmission or seqnum discontinued.
3802 * @tx_in_bad_cond_time: percentage of time the device transmitted packets
3803 * that haven't been ACKed.
3804 * @wlan_not_avail_time: percentage of time the chip is unable to
3805 * work in normal conditions.
3806 */
3807struct sir_wifi_chan_cca_stats {
3808 uint32_t vdev_id;
3809 uint32_t idle_time;
3810 uint32_t tx_time;
3811 uint32_t rx_in_bss_time;
3812 uint32_t rx_out_bss_time;
3813 uint32_t rx_busy_time;
3814 uint32_t rx_in_bad_cond_time;
3815 uint32_t tx_in_bad_cond_time;
3816 uint32_t wlan_not_avail_time;
3817};
3818
3819#define WIFI_MAX_CHAINS 8
3820
3821/**
3822 * struct sir_wifi_peer_signal_stats - peer signal stats
3823 * @vdev_id: vdev ID
3824 * @peer_id: peer ID
3825 * @per_ant_snr: per antenna SNR
3826 * @nf: peer background noise
Zhang Qian303ebe92017-05-18 13:59:07 +08003827 * @per_ant_rx_mpdus: MPDUs received per antenna
3828 * @per_ant_tx_mpdus: MPDUs transferred per antenna
3829 * @num_chain: valid chain count
Zhang Qian73c348a2017-03-13 16:15:55 +08003830 */
3831struct sir_wifi_peer_signal_stats {
3832 uint32_t vdev_id;
3833 uint32_t peer_id;
3834
3835 /* per antenna SNR in current bss */
3836 int32_t per_ant_snr[WIFI_MAX_CHAINS];
3837
3838 /* Background noise */
3839 int32_t nf[WIFI_MAX_CHAINS];
Zhang Qian303ebe92017-05-18 13:59:07 +08003840
Ashish Kumar Dhanotiya5d2f25a2019-02-25 21:06:00 +05303841 uint32_t per_ant_rx_mpdus[WIFI_MAX_CHAINS];
3842 uint32_t per_ant_tx_mpdus[WIFI_MAX_CHAINS];
3843 uint32_t num_chain;
Zhang Qian73c348a2017-03-13 16:15:55 +08003844};
3845
3846#define WIFI_VDEV_NUM 4
3847#define WFIF_MCS_NUM 10
3848#define WIFI_AGGR_NUM 8
3849#define WIFI_DELAY_SIZE 11
3850
3851/**
3852 * struct sir_wifi_tx - per AC tx stats
3853 * @msdus: number of totoal MSDUs on MAC layer in the period
3854 * @mpdus: number of totoal MPDUs on MAC layer in the period
3855 * @ppdus: number of totoal PPDUs on PHY layer in the period
3856 * @bytes: bytes of tx data on MAC layer in the period
3857 * @drops: number of TX packets cancelled due to any reason in the period,
3858 * such as WMM limitation/bandwidth limitation/radio congestion
3859 * @drop_bytes: bytes of dropped TX packets in the period
3860 * @retries: number of unacked transmissions of MPDUs
3861 * @failed: number of packets have not been ACKed despite retried
3862 * @aggr_len: length of the MPDU aggregation size buffer
3863 * @mpdu_aggr_size: histogram of MPDU aggregation size
3864 * @success_mcs_len: length of success mcs buffer
3865 * @success_mcs: histogram of successed received MPDUs encoding rate
3866 * @fail_mcs_len: length of failed mcs buffer
3867 * @fail_mcs: histogram of failed received MPDUs encoding rate
3868 * @delay_len: length of the delay histofram buffer
3869 * @delay: histogram of delays on MAC layer
3870 */
3871struct sir_wifi_tx {
3872 uint32_t msdus;
3873 uint32_t mpdus;
3874 uint32_t ppdus;
3875 uint32_t bytes;
3876 uint32_t drops;
3877 uint32_t drop_bytes;
3878 uint32_t retries;
3879 uint32_t failed;
3880 uint32_t aggr_len;
3881 uint32_t *mpdu_aggr_size;
3882 uint32_t success_mcs_len;
3883 uint32_t *success_mcs;
3884 uint32_t fail_mcs_len;
3885 uint32_t *fail_mcs;
3886 uint32_t delay_len;
3887 uint32_t *delay;
3888};
3889
3890/**
3891 * struct sir_wifi_rx - per AC rx stats
3892 * @mpdus: number of RX packets on MAC layer
3893 * @bytes: bytes of RX packets on MAC layer
3894 * @ppdus: number of RX packets on PHY layer
3895 * @ppdu_bytes: bytes of RX packets on PHY layer
3896 * @mpdu_lost: number of discontinuity in seqnum
3897 * @mpdu_retry: number of RX packets flagged as retransmissions
3898 * @mpdu_dup: number of RX packets identified as duplicates
3899 * @mpdu_discard: number of RX packets discarded
3900 * @aggr_len: length of MPDU aggregation histogram buffer
3901 * @mpdu_aggr: histogram of MPDU aggregation size
3902 * @mcs_len: length of mcs histogram buffer
3903 * @mcs: histogram of encoding rate.
3904 */
3905struct sir_wifi_rx {
3906 uint32_t mpdus;
3907 uint32_t bytes;
3908 uint32_t ppdus;
3909 uint32_t ppdu_bytes;
3910 uint32_t mpdu_lost;
3911 uint32_t mpdu_retry;
3912 uint32_t mpdu_dup;
3913 uint32_t mpdu_discard;
3914 uint32_t aggr_len;
3915 uint32_t *mpdu_aggr;
3916 uint32_t mcs_len;
3917 uint32_t *mcs;
3918};
3919
3920/**
3921 * struct sir_wifi_ll_ext_wmm_ac_stats - stats for WMM AC
3922 * @type: WMM AC type
3923 * @tx_stats: pointer to TX stats
3924 * @rx_stats: pointer to RX stats
3925 */
3926struct sir_wifi_ll_ext_wmm_ac_stats {
3927 uint32_t type;
3928 struct sir_wifi_tx *tx_stats;
3929 struct sir_wifi_rx *rx_stats;
3930};
3931
Zhang Qian73c348a2017-03-13 16:15:55 +08003932/**
3933 * struct sir_wifi_ll_ext_peer_stats - per peer stats
3934 * @peer_id: peer ID
3935 * @vdev_id: VDEV ID
Jeff Johnsonaf545282019-04-01 12:18:59 -07003936 * @mac_address: MAC address
Zhang Qian73c348a2017-03-13 16:15:55 +08003937 * @sta_ps_inds: how many times STAs go to sleep
3938 * @sta_ps_durs: total sleep time of STAs (units in ms)
3939 * @rx_probe_reqs: number of probe requests received
3940 * @rx_oth_mgmts: number of other management frames received,
3941 * not including probe requests
3942 * @peer_signal_stat: signal stats
3943 * @ac_stats: WMM BE/BK/VI/VO stats
3944 */
3945struct sir_wifi_ll_ext_peer_stats {
3946 uint32_t peer_id;
3947 uint32_t vdev_id;
3948 tSirMacAddr mac_address;
3949 uint32_t sta_ps_inds;
3950 uint32_t sta_ps_durs;
3951 uint32_t rx_probe_reqs;
3952 uint32_t rx_oth_mgmts;
3953 struct sir_wifi_peer_signal_stats peer_signal_stats;
3954 struct sir_wifi_ll_ext_wmm_ac_stats ac_stats[WIFI_MAX_AC];
3955};
3956
3957/**
3958 * struct sir_wifi_ll_ext_stats - link layer stats report
3959 * @trigger_cond_id: Indicate what triggered this event.
3960 * 1: timeout. 2: threshold
3961 * @cca_chgd_bitmap: Bitmap to indicate changed channel CCA stats
3962 * which exceeded the thresholds
3963 * @sig_chgd_bitmap: Bitmap to indicate changed peer signal stats
3964 * which exceeded the thresholds
3965 * @tx_chgd_bitmap: Bitmap to indicate changed TX counters
3966 * which exceeded the thresholds
3967 * @rx_chgd_bitmap: Bitmap to indicate changed RX counters
3968 * which exceeded the thresholds
3969 * @chan_cca_stats: channel CCA stats
3970 * @peer_signal_stats: peer signal stats
3971 * @tx_mpdu_aggr_array_len: length of TX MPDU aggregation buffer
3972 * @tx_succ_mcs_array_len: length of mcs buffer for ACKed MPDUs
3973 * @tx_fail_mcs_array_len: length of mcs buffer for no-ACKed MPDUs
3974 * @tx_delay_array_len: length of delay stats buffer
3975 * @rx_mpdu_aggr_array_len: length of RX MPDU aggregation buffer
3976 * @rx_mcs_array_len: length of RX mcs stats buffer
3977 * @peer_stats: peer stats
3978 * @cca: physical channel CCA stats
3979 * @stats: pointer to stats data buffer.
3980 *
3981 * Structure of the whole statictics is like this:
3982 * ---------------------------------
3983 * | trigger_cond_i |
3984 * +-------------------------------+
3985 * | cca_chgd_bitmap |
3986 * +-------------------------------+
3987 * | sig_chgd_bitmap |
3988 * +-------------------------------+
3989 * | tx_chgd_bitmap |
3990 * +-------------------------------+
3991 * | rx_chgd_bitmap |
3992 * +-------------------------------+
3993 * | peer_num |
3994 * +-------------------------------+
3995 * | channel_num |
3996 * +-------------------------------+
3997 * | tx_mpdu_aggr_array_len |
3998 * +-------------------------------+
3999 * | tx_succ_mcs_array_len |
4000 * +-------------------------------+
4001 * | tx_fail_mcs_array_len |
4002 * +-------------------------------+
4003 * | tx_delay_array_len |
4004 * +-------------------------------+
4005 * | rx_mpdu_aggr_array_len |
4006 * +-------------------------------+
4007 * | rx_mcs_array_len |
4008 * +-------------------------------+
4009 * | pointer to CCA stats |
4010 * +-------------------------------+
4011 * | pointer to peer stats |
4012 * +-------------------------------+
4013 * | CCA stats |
4014 * +-------------------------------+
4015 * | peer_stats |----+
4016 * +-------------------------------+ |
4017 * | per peer signals stats |<---+
4018 * | peer0 ~ peern | |
4019 * +-------------------------------+ |
4020 * | TX aggr/mcs parameters array | |
4021 * | Length of this buffer is | |
4022 * | configurable for user layer. |<-+ |
4023 * +-------------------------------+ | |
4024 * | per peer tx stats |--+ |
4025 * | BE | <--+
4026 * | BK | |
4027 * | VI | |
4028 * | VO | |
4029 * +-------------------------------+ |
4030 * | TX aggr/mcs parameters array | |
4031 * | Length of this buffer is | |
4032 * | configurable for user layer. |<-+ |
4033 * +-------------------------------+ | |
4034 * | peer peer rx stats |--+ |
4035 * | BE | <--+
4036 * | BE |
4037 * | BK |
4038 * | VI |
4039 * | VO |
4040 * ---------------------------------
4041 */
4042struct sir_wifi_ll_ext_stats {
4043 uint32_t trigger_cond_id;
4044 uint32_t cca_chgd_bitmap;
4045 uint32_t sig_chgd_bitmap;
4046 uint32_t tx_chgd_bitmap;
4047 uint32_t rx_chgd_bitmap;
4048 uint8_t peer_num;
4049 uint8_t channel_num;
4050 uint32_t tx_mpdu_aggr_array_len;
4051 uint32_t tx_succ_mcs_array_len;
4052 uint32_t tx_fail_mcs_array_len;
4053 uint32_t tx_delay_array_len;
4054 uint32_t rx_mpdu_aggr_array_len;
4055 uint32_t rx_mcs_array_len;
4056 struct sir_wifi_ll_ext_peer_stats *peer_stats;
4057 struct sir_wifi_chan_cca_stats *cca;
4058 uint8_t stats[];
4059};
4060
4061/**
4062 * struct sir_channel_cca_threshold - threshold for channel CCA
4063 * @idle_time: idle time, no TX, no RX, no interference
4064 * @tx_time: time transmitting packets
4065 * @rx_in_bss_time: time receiving packets in current BSSs
4066 * @rx_out_bss_time: time receiving packets not in current BSSs
4067 * @rx_busy_time: time interference detected
4068 * @rx_in_bad_cond_time: receiving packets with errors
4069 * @tx_in_bad_cond_time: time transmitted packets not been ACKed
4070 * @wlan_not_avail_time: wlan card cannot work
4071 */
4072struct sir_channel_cca_threshold {
4073 uint32_t idle_time;
4074 uint32_t tx_time;
4075 uint32_t rx_in_bss_time;
4076 uint32_t rx_out_bss_time;
4077 uint32_t rx_busy_time;
4078 uint32_t rx_in_bad_cond_time;
4079 uint32_t tx_in_bad_cond_time;
4080 uint32_t wlan_not_avail_time;
4081};
4082
4083/**
4084 * struct sir_signal_threshold - threshold for per peer sigbal
4085 * @snr: signal to noise rate
4086 * @nf: noise floor
4087 */
4088struct sir_signal_threshold {
4089 uint32_t snr;
4090 uint32_t nf;
4091};
4092
4093/**
4094 * struct sir_tx_threshold - threshold for TX
4095 * @msdu: TX MSDUs on MAC layer
4096 * @mpdu: TX MPDUs on MAC layer
4097 * @ppdu: TX PPDUs on MAC layer
4098 * @bytes: TX bytes on MAC layer
4099 * @msdu_drop: drooped MSDUs
4100 * @byte_drop: dropped Bytes
4101 * @mpdu_retry: MPDU not acked
4102 * @ppdu_fail: PPDUs which received no block ack
4103 * @aggregation: aggregation size
4104 * @succ_mcs: histogram of encoding rate for acked PPDUs
4105 * @fail_mcs: histogram of encoding rate for no-acked PPDUs
4106 */
4107struct sir_tx_threshold {
4108 uint32_t msdu;
4109 uint32_t mpdu;
4110 uint32_t ppdu;
4111 uint32_t bytes;
4112 uint32_t msdu_drop;
4113 uint32_t byte_drop;
4114 uint32_t mpdu_retry;
4115 uint32_t mpdu_fail;
4116 uint32_t ppdu_fail;
4117 uint32_t aggregation;
4118 uint32_t succ_mcs;
4119 uint32_t fail_mcs;
4120 uint32_t delay;
4121};
4122
4123/**
4124 * struct sir_rx_threshold - threshold for RX
4125 * @mpdu: RX MPDUs on MAC layer
4126 * @bytes: RX bytes on MAC layer
4127 * @ppdu: RX PPDU on PHY layer
4128 * @ppdu_bytes: RX bytes on PHY layer
4129 * @disorder: discontinuity in seqnum
4130 * @mpdu_retry: MPDUs flagged as retry
4131 * @mpdu_dup: MPDUs identified as duplicated
4132 * @aggregation: aggregation size
4133 * @mcs: histogram of encoding rate for PPDUs
4134 * @ps_inds: power save indication
4135 * @ps_durs: total time in power save
4136 * @probe_reqs: probe request received
4137 * @other_mgmt: other MGMT frames received
4138 */
4139struct sir_rx_threshold {
4140 uint32_t mpdu;
4141 uint32_t bytes;
4142 uint32_t ppdu;
4143 uint32_t ppdu_bytes;
4144 uint32_t disorder;
4145 uint32_t mpdu_lost;
4146 uint32_t mpdu_retry;
4147 uint32_t mpdu_dup;
4148 uint32_t mpdu_discard;
4149 uint32_t aggregation;
4150 uint32_t mcs;
4151 uint32_t ps_inds;
4152 uint32_t ps_durs;
4153 uint32_t probe_reqs;
4154 uint32_t other_mgmt;
4155};
4156
4157/**
4158 * struct sir_wifi_ll_ext_stats_threshold - Threshold for stats update
4159 * @period: MAC counter indication period (unit in ms)
4160 * @enable: if threshold mechnism is enabled or disabled
4161 * @enable_bitmap: whether dedicated threshold is enabed.
4162 * Every MAC counter has a dedicated threshold. If the dedicated
4163 * threshold is not set in the bitmap, global threshold will take
4164 * effect.
4165 * @global: whether clobal threshold is enabled.
Jeff Johnsonf2cf6592018-05-06 16:27:44 -07004166 * When both global and dedicated threshold are disabled, MAC counter
Zhang Qian73c348a2017-03-13 16:15:55 +08004167 * will indicate stats periodically.
4168 * @global_threshold: global threshold value
4169 * @cca_bitmap: bitmap for CCA.
4170 * Bit0: idle time
4171 * Bit1: tx time
4172 * Bit2: RX in BSS
4173 * Bit3: RX out of BSS
4174 * Bit4: medium busy
4175 * Bit5: RX bad
4176 * Bit6: TX bad
4177 * Bit7: WLAN card not available
4178 * @signal_bitmap:
4179 * Bit0: Per channel SNR counter
4180 * Bit1: Per channel noise floor counter
4181 * @tx_bitmap: bitmap for TX counters
4182 * Bit0: TX counter unit in MSDU
4183 * Bit1: TX counter unit in MPDU
4184 * Bit2: TX counter unit in PPDU
4185 * Bit3: TX counter unit in byte
4186 * Bit4: Dropped MSDUs
4187 * Bit5: Dropped Bytes
4188 * Bit6: MPDU retry counter
4189 * Bit7: MPDU failure counter
4190 * Bit8: PPDU failure counter
4191 * Bit9: MPDU aggregation counter
4192 * Bit10: MCS counter for ACKed MPDUs
4193 * Bit11: MCS counter for Failed MPDUs
4194 * Bit12: TX Delay counter
4195 * @rx_bitmap:bitmap for RX counters
4196 * Bit0: MAC RX counter unit in MPDU
4197 * Bit1: MAC RX counter unit in byte
4198 * Bit2: PHY RX counter unit in PPDU
4199 * Bit3: PHY RX counter unit in byte
4200 * Bit4: Disorder counter
4201 * Bit5: Retry counter
4202 * Bit6: Duplication counter
4203 * Bit7: Discard counter
4204 * Bit8: MPDU aggregation size counter
4205 * Bit9: MCS counter
4206 * Bit10: Peer STA power state change (wake to sleep) counter
4207 * Bit11: Peer STA power save counter, total time in PS mode
4208 * Bit12: Probe request counter
4209 * Bit13: Other management frames counter
4210 * @cca_thresh: CCA threshold
4211 * @signal_thresh: signal threshold
4212 * @tx_thresh: TX threshold
4213 * @rx_thresh: RX threshold
4214 *
4215 * Generally, Link layer statistics is reported periodically. But if the
4216 * variation of one stats of compared to the pervious notification exceeds
4217 * a threshold, FW will report the new stats immediately.
4218 * This structure contains threshold for different counters.
4219 */
4220struct sir_ll_ext_stats_threshold {
4221 uint32_t period;
4222 uint32_t enable;
4223 uint32_t enable_bitmap;
4224 uint32_t global;
4225 uint32_t global_threshold;
4226 uint32_t cca_bitmap;
4227 uint32_t signal_bitmap;
4228 uint32_t tx_bitmap;
4229 uint32_t rx_bitmap;
4230 struct sir_channel_cca_threshold cca;
4231 struct sir_signal_threshold signal;
4232 struct sir_tx_threshold tx;
4233 struct sir_rx_threshold rx;
4234};
4235
4236#define LL_STATS_MIN_PERIOD 10
4237#define LL_STATS_INVALID_PERIOD 0xFFFFFFFF
4238
Zhang Qiana6e9c102016-12-22 16:47:24 +08004239/* Result ID for LL stats extension */
4240#define WMI_LL_STATS_EXT_PS_CHG 0x00000100
4241#define WMI_LL_STATS_EXT_TX_FAIL 0x00000200
4242#define WMI_LL_STATS_EXT_MAC_COUNTER 0x00000400
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004243#endif /* WLAN_FEATURE_LINK_LAYER_STATS */
4244
4245typedef struct sAniGetLinkStatus {
4246 uint16_t msgType; /* message type is same as the request type */
4247 uint16_t msgLen; /* length of the entire request */
4248 uint8_t linkStatus;
4249 uint8_t sessionId;
4250} tAniGetLinkStatus, *tpAniGetLinkStatus;
4251
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05304252/**
4253 * struct sir_lost_link_info - lost link information structure.
4254 *
4255 * @vdev_id: vdev_id from WMA. some modules call sessionId.
4256 * @rssi: rssi at disconnection time.
4257 *
4258 * driver uses this structure to communicate information collected at
4259 * disconnection time.
4260 */
4261struct sir_lost_link_info {
4262 uint32_t vdev_id;
4263 int32_t rssi;
4264};
4265
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004266/* find the size of given member within a structure */
4267#ifndef member_size
4268#define member_size(type, member) (sizeof(((type *)0)->member))
4269#endif
4270
4271#define RTT_INVALID 0x00
4272#define RTT_TIMING_MEAS_CAPABILITY 0x01
4273#define RTT_FINE_TIME_MEAS_INITIATOR_CAPABILITY 0x02
4274#define RTT_FINE_TIME_MEAS_RESPONDER_CAPABILITY 0x03
4275
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004276/* number of neighbor reports that we can handle in Neighbor Report Response */
4277#define MAX_SUPPORTED_NEIGHBOR_RPT 15
4278
4279/**
4280 * struct sir_stats_avg_factor
4281 * @vdev_id: session id
4282 * @stats_avg_factor: average factor
4283 */
4284struct sir_stats_avg_factor {
4285 uint8_t vdev_id;
4286 uint16_t stats_avg_factor;
4287};
4288
4289/**
4290 * struct sir_guard_time_request
4291 * @vdev_id: session id
4292 * @guard_time: guard time
4293 */
4294struct sir_guard_time_request {
4295 uint8_t vdev_id;
4296 uint32_t guard_time;
4297};
4298
4299/* Max number of rates allowed in Supported Rates IE */
4300#define MAX_NUM_SUPPORTED_RATES (8)
4301
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004302/**
4303 * struct rssi_breach_event - rssi breached event structure
4304 * @request_id: request id
4305 * @session_id: session id
4306 * @curr_rssi: current rssi
4307 * @curr_bssid: current bssid
4308 */
4309struct rssi_breach_event {
4310 uint32_t request_id;
4311 uint32_t session_id;
4312 int8_t curr_rssi;
Anurag Chouhan6d760662016-02-20 16:05:43 +05304313 struct qdf_mac_addr curr_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004314};
4315
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05304316/**
4317 * struct chip_pwr_save_fail_detected_params - chip power save failure detected
4318 * event params
4319 * @failure_reason_code:failure reason code
4320 * @wake_lock_bitmap:bitmap for modules voting against sleep for long duration.
4321 */
4322struct chip_pwr_save_fail_detected_params {
4323 uint32_t failure_reason_code;
4324 uint32_t wake_lock_bitmap[4];
4325};
4326
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004327#define MAX_NUM_FW_SEGMENTS 4
4328
4329/**
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05304330 * DEFAULT_SCAN_IE_ID - Identifier for the collection of IE's added
4331 * by default to the probe request
4332 */
4333#define DEFAULT_SCAN_IE_ID 256
4334
4335 /* MAX_DEFAULT_SCAN_IE_LEN - Maxmimum length of Default Scan IE's */
Selvaraj, Sridhar021ee0a2017-04-07 16:53:31 +05304336#define MAX_DEFAULT_SCAN_IE_LEN 2048
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05304337
4338 /* Extended Capabilities IE header(IE Id + IE Length) length */
4339#define EXT_CAP_IE_HDR_LEN 2
4340
4341/**
4342 * struct hdd_default_scan_ie - HDD default scan IE structure
4343 * @message_type: message type to be set with eWNI_SME_DEFAULT_SCAN_IE
4344 * @length: length of the struct hdd_default_scan_ie
Abhishek Singhefe21e62019-09-20 10:03:24 +05304345 * @vdev_id: vdev_id
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05304346 * @ie_len: Default scan IE length
4347 * @ie_data: Pointer to default scan IE data
4348 */
4349struct hdd_default_scan_ie {
4350 uint16_t message_type;
4351 uint16_t length;
Abhishek Singhefe21e62019-09-20 10:03:24 +05304352 uint16_t vdev_id;
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05304353 uint16_t ie_len;
4354 uint8_t ie_data[MAX_DEFAULT_SCAN_IE_LEN];
4355};
4356
4357/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004358 * struct vdev_ie_info - IE info
4359 * @vdev_id - vdev for which the IE is being sent
4360 * @ie_id - ID of the IE
4361 * @length - length of the IE data
Naveen Rawat03e8d952016-08-01 15:22:20 -07004362 * @band - indicates IE is intended for which band
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004363 * @data - IE data
4364 *
4365 * This structure is used to store the IE information.
4366 */
4367struct vdev_ie_info {
4368 uint32_t vdev_id;
4369 uint32_t ie_id;
4370 uint32_t length;
Naveen Rawat03e8d952016-08-01 15:22:20 -07004371 uint32_t band;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004372 uint8_t *data;
4373};
4374
4375/**
4376 * struct send_extcap_ie - used to pass send_extcap_ie msg from SME to PE
4377 * @type - MSG type
4378 * @length - length of the message
4379 * @seesion_id - session_id for which the message is intended for
4380 *
4381 * This structure is used to pass send_extcap_ie msg from SME to PE
4382 */
4383struct send_extcap_ie {
4384 uint16_t msg_type; /* eWNI_SME_SET_IE_REQ */
4385 uint16_t length;
4386 uint8_t session_id;
4387};
4388
Dundi Raviteja6bb9e322018-05-16 17:04:41 +05304389typedef void (*antenna_mode_cb)(uint32_t status, void *context);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004390
4391/**
Kiran Kumar Lokereee205772018-09-27 00:27:27 -07004392 * struct cfg_action_frm_tb_ppdu - action frame TB PPDU cfg
4393 * @vdev_id - vdev id
4394 * @cfg - enable/disable
4395 * @frm_len - frame length
4396 * @data - frame data
4397 *
4398 * This structure is used to cfg action frame tb ppdu.
4399 */
4400struct cfg_action_frm_tb_ppdu {
4401 uint8_t vdev_id;
4402 uint8_t cfg;
4403 uint8_t frm_len;
4404 uint8_t *data;
4405};
4406
4407/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004408 * struct sir_nss_update_request
4409 * @msgType: nss update msg type
4410 * @msgLen: length of the msg
4411 * @new_nss: new spatial stream value
Liangwei Dong8c65f232019-10-23 15:42:59 +08004412 * @ch_width: channel width - optional
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004413 * @vdev_id: session id
4414 */
4415struct sir_nss_update_request {
4416 uint16_t msgType;
4417 uint16_t msgLen;
4418 uint8_t new_nss;
Liangwei Dong8c65f232019-10-23 15:42:59 +08004419 uint8_t ch_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004420 uint32_t vdev_id;
4421};
4422
4423/**
Abhishek Singhfc740be2018-10-12 11:34:26 +05304424 * enum sir_bcn_update_reason: bcn update reason
4425 * @REASON_DEFAULT: reason default
4426 * @REASON_NSS_UPDATE: If NSS is updated
4427 * @REASON_CONFIG_UPDATE: Config update
4428 * @REASON_SET_HT2040: HT2040 update
4429 * @REASON_COLOR_CHANGE: Color change
4430 * @REASON_CHANNEL_SWITCH: channel switch
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004431 */
Abhishek Singhfc740be2018-10-12 11:34:26 +05304432enum sir_bcn_update_reason {
4433 REASON_DEFAULT = 0,
4434 REASON_NSS_UPDATE = 1,
4435 REASON_CONFIG_UPDATE = 2,
4436 REASON_SET_HT2040 = 3,
4437 REASON_COLOR_CHANGE = 4,
4438 REASON_CHANNEL_SWITCH = 5,
4439};
4440
4441/**
4442 * struct sir_bcn_update_rsp
4443 *
4444 * @vdev_id: session for which bcn was updated
4445 * @reason: bcn update reason
4446 * @status: status of the beacon sent to FW
4447 */
4448struct sir_bcn_update_rsp {
4449 uint8_t vdev_id;
4450 enum sir_bcn_update_reason reason;
4451 QDF_STATUS status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004452};
4453
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004454struct sir_qos_params {
4455 uint8_t aifsn;
4456 uint8_t cwmin;
4457 uint8_t cwmax;
4458};
4459
4460/**
Abhishek Singh518323d2015-10-19 17:42:01 +05304461 * struct sir_sme_ext_change_chan_req - channel change request
4462 * @message_type: message id
4463 * @length: msg length
4464 * @new_channel: new channel
Abhishek Singhefe21e62019-09-20 10:03:24 +05304465 * @vdev_id: vdev id
Abhishek Singh518323d2015-10-19 17:42:01 +05304466 */
4467struct sir_sme_ext_cng_chan_req {
4468 uint16_t message_type; /* eWNI_SME_EXT_CHANGE_CHANNEL */
4469 uint16_t length;
4470 uint32_t new_channel;
Abhishek Singhefe21e62019-09-20 10:03:24 +05304471 uint8_t vdev_id;
Abhishek Singh518323d2015-10-19 17:42:01 +05304472};
4473
gaurank kathpaliad45dd432020-02-17 17:18:10 +05304474#define IGNORE_NUD_FAIL 0
4475#define DISCONNECT_AFTER_NUD_FAIL 1
4476#define ROAM_AFTER_NUD_FAIL 2
4477#define DISCONNECT_AFTER_ROAM_FAIL 3
4478
Abhishek Singh518323d2015-10-19 17:42:01 +05304479/**
4480 * struct sir_sme_ext_change_chan_ind.
4481 * @session_id: session id
Tushnim Bhattacharyya6c40b112019-10-30 11:39:25 -07004482 * @new_chan_freq: new channel frequency to change to
Abhishek Singh518323d2015-10-19 17:42:01 +05304483 */
4484struct sir_sme_ext_cng_chan_ind {
4485 uint8_t session_id;
Tushnim Bhattacharyya6c40b112019-10-30 11:39:25 -07004486 uint32_t new_chan_freq;
Abhishek Singh518323d2015-10-19 17:42:01 +05304487};
4488
Ryan Hsu3c8f79f2015-12-02 16:45:09 -08004489/**
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07004490 * struct stsf - the basic stsf structure
4491 *
4492 * @vdev_id: vdev id
4493 * @tsf_low: low 32bits of tsf
4494 * @tsf_high: high 32bits of tsf
Manikandan Mohan5356c2b2016-04-03 15:51:35 -07004495 * @soc_timer_low: low 32bits of synced SOC timer value
4496 * @soc_timer_high: high 32bits of synced SOC timer value
Jiani Liua8fd1702019-05-01 10:07:10 +08004497 * @global_tsf_low: low 32bits of tsf64
4498 * @global_tsf_high: high 32bits of tsf64
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07004499 *
4500 * driver use this struct to store the tsf info
4501 */
4502struct stsf {
4503 uint32_t vdev_id;
4504 uint32_t tsf_low;
4505 uint32_t tsf_high;
Manikandan Mohan5356c2b2016-04-03 15:51:35 -07004506 uint32_t soc_timer_low;
4507 uint32_t soc_timer_high;
Jiani Liua8fd1702019-05-01 10:07:10 +08004508 uint32_t global_tsf_low;
4509 uint32_t global_tsf_high;
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07004510};
4511
Gupta, Kapil4cb1d7d2016-04-16 18:16:25 -07004512#define SIR_BCN_FLT_MAX_ELEMS_IE_LIST 8
4513/**
4514 * struct beacon_filter_param - parameters for beacon filtering
4515 * @vdev_id: vdev id
4516 * @ie_map: bitwise map of IEs that needs to be filtered
4517 *
4518 */
4519struct beacon_filter_param {
4520 uint32_t vdev_id;
4521 uint32_t ie_map[SIR_BCN_FLT_MAX_ELEMS_IE_LIST];
4522};
4523
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05304524/**
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +05304525 * struct adaptive_dwelltime_params - the adaptive dwelltime params
4526 * @vdev_id: vdev id
4527 * @is_enabled: Adaptive dwell time is enabled/disabled
4528 * @dwelltime_mode: global default adaptive dwell mode
4529 * @lpf_weight: weight to calculate the average low pass
4530 * filter for channel congestion
4531 * @passive_mon_intval: intval to monitor wifi activity in passive scan in msec
4532 * @wifi_act_threshold: % of wifi activity used in passive scan 0-100
4533 *
4534 */
4535struct adaptive_dwelltime_params {
4536 uint32_t vdev_id;
4537 bool is_enabled;
4538 uint8_t dwelltime_mode;
4539 uint8_t lpf_weight;
4540 uint8_t passive_mon_intval;
4541 uint8_t wifi_act_threshold;
4542};
4543
4544/**
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05304545 * struct csa_offload_params - CSA offload request parameters
4546 * @channel: channel
4547 * @switch_mode: switch mode
4548 * @sec_chan_offset: second channel offset
4549 * @new_ch_width: new channel width
4550 * @new_ch_freq_seg1: channel center freq 1
4551 * @new_ch_freq_seg2: channel center freq 2
4552 * @ies_present_flag: IE present flag
4553 */
4554struct csa_offload_params {
4555 uint8_t channel;
Liangwei Dongc1956bd2020-01-07 19:50:57 +08004556 uint32_t csa_chan_freq;
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05304557 uint8_t switch_mode;
4558 uint8_t sec_chan_offset;
4559 uint8_t new_ch_width;
4560 uint8_t new_op_class;
4561 uint8_t new_ch_freq_seg1;
4562 uint8_t new_ch_freq_seg2;
4563 uint32_t ies_present_flag;
4564 tSirMacAddr bssId;
4565};
4566
4567/**
Sandeep Puligillae0875662016-02-12 16:09:21 -08004568 * enum obss_ht40_scancmd_type - obss scan command type
4569 * @HT40_OBSS_SCAN_PARAM_START: OBSS scan start
4570 * @HT40_OBSS_SCAN_PARAM_UPDATE: OBSS scan param update
4571 */
4572enum obss_ht40_scancmd_type {
4573 HT40_OBSS_SCAN_PARAM_START,
4574 HT40_OBSS_SCAN_PARAM_UPDATE
4575};
4576
4577/**
4578 * struct sme_obss_ht40_scanind_msg - sme obss scan params
4579 * @msg_type: message type
4580 * @length: message length
4581 * @mac_addr: mac address
4582 */
4583struct sme_obss_ht40_scanind_msg {
4584 uint16_t msg_type;
4585 uint16_t length;
4586 struct qdf_mac_addr mac_addr;
4587};
4588
4589/**
4590 * struct obss_ht40_scanind - ht40 obss scan request
4591 * @cmd: message type
4592 * @scan_type: message length
4593 * @obss_passive_dwelltime: obss passive dwelltime
4594 * @obss_active_dwelltime: obss active dwelltime
4595 * @obss_width_trigger_interval: scan interval
4596 * @obss_passive_total_per_channel: total passive scan time per channel
4597 * @obss_active_total_per_channel: total active scan time per channel
4598 * @bsswidth_ch_trans_delay: OBSS transition delay time
4599 * @obss_activity_threshold: OBSS activity threshold
Rajeev Kumar Sirasanagandlae796a602019-08-13 14:38:25 +05304600 * @self_sta_idx: self sta identification
Sandeep Puligillae0875662016-02-12 16:09:21 -08004601 * @bss_id: BSS index
4602 * @fortymhz_intolerent: Ht40mhz intolerance
4603 * @channel_count: channel count
Rajeev Kumar Sirasanagandlae796a602019-08-13 14:38:25 +05304604 * @chan_freq_list: List of channel frequencies in MHz
Sandeep Puligillae0875662016-02-12 16:09:21 -08004605 * @current_operatingclass: operating class
4606 * @iefield_len: ie's length
4607 * @iefiled: ie's information
4608 */
4609struct obss_ht40_scanind {
4610 enum obss_ht40_scancmd_type cmd;
4611 enum eSirScanType scan_type;
4612 /* In TUs */
4613 uint16_t obss_passive_dwelltime;
4614 uint16_t obss_active_dwelltime;
4615 /* In seconds */
4616 uint16_t obss_width_trigger_interval;
4617 /* In TU's */
4618 uint16_t obss_passive_total_per_channel;
4619 uint16_t obss_active_total_per_channel;
4620 uint16_t bsswidth_ch_trans_delay;
4621 uint16_t obss_activity_threshold;
4622 uint8_t self_sta_idx;
4623 uint8_t bss_id;
4624 uint8_t fortymhz_intolerent;
4625 uint8_t channel_count;
Rajeev Kumar Sirasanagandlae796a602019-08-13 14:38:25 +05304626 uint32_t chan_freq_list[SIR_ROAM_MAX_CHANNELS];
Sandeep Puligillae0875662016-02-12 16:09:21 -08004627 uint8_t current_operatingclass;
4628 uint16_t iefield_len;
4629 uint8_t iefield[SIR_ROAM_SCAN_MAX_PB_REQ_SIZE];
4630};
4631
4632/**
4633 * struct obss_scanparam - OBSS scan parameters
4634 * @obss_passive_dwelltime: message type
4635 * @obss_active_dwelltime: message length
4636 * @obss_width_trigger_interval: obss passive dwelltime
4637 * @obss_passive_total_per_channel: obss passive total scan time
4638 * @obss_active_total_per_channel: obss active total scan time
4639 * @bsswidth_ch_trans_delay: OBSS transition delay time
4640 * @obss_activity_threshold: OBSS activity threshold
4641 */
4642struct obss_scanparam {
4643 uint16_t obss_passive_dwelltime;
4644 uint16_t obss_active_dwelltime;
4645 uint16_t obss_width_trigger_interval;
4646 uint16_t obss_passive_total_per_channel;
4647 uint16_t obss_active_total_per_channel;
4648 uint16_t bsswidth_ch_trans_delay;
4649 uint16_t obss_activity_threshold;
4650};
4651
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304652/**
Nachiket Kukadee547a482018-05-22 16:43:30 +05304653 * struct sir_apf_set_offload - set apf filter instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304654 * @session_id: session identifier
Nachiket Kukadee547a482018-05-22 16:43:30 +05304655 * @version: host apf version
4656 * @filter_id: Filter ID for APF filter
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304657 * @total_length: The total length of the full instruction
4658 * total_length equal to 0 means reset
4659 * @current_offset: current offset, 0 means start a new setting
4660 * @current_length: Length of current @program
Nachiket Kukadee547a482018-05-22 16:43:30 +05304661 * @program: APF instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304662 */
Nachiket Kukadee547a482018-05-22 16:43:30 +05304663struct sir_apf_set_offload {
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304664 uint8_t session_id;
4665 uint32_t version;
4666 uint32_t filter_id;
4667 uint32_t total_length;
4668 uint32_t current_offset;
4669 uint32_t current_length;
4670 uint8_t *program;
4671};
4672
4673/**
Nachiket Kukadee547a482018-05-22 16:43:30 +05304674 * struct sir_apf_offload_capabilities - get apf Capabilities
4675 * @apf_version: fw's implement version
4676 * @max_apf_filters: max filters that fw supports
4677 * @max_bytes_for_apf_inst: the max bytes that can be used as apf instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304678 */
Nachiket Kukadee547a482018-05-22 16:43:30 +05304679struct sir_apf_get_offload {
4680 uint32_t apf_version;
4681 uint32_t max_apf_filters;
4682 uint32_t max_bytes_for_apf_inst;
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304683};
4684
Nachiket Kukade2fb1fdb2019-01-08 15:35:27 +05304685#ifdef WLAN_FEATURE_NAN
Ravi Joshi412f23d2016-05-26 15:09:23 -07004686#define IFACE_NAME_SIZE 64
4687
4688/**
4689 * enum ndp_accept_policy - nan data path accept policy
4690 * @NDP_ACCEPT_POLICY_NONE: the framework will decide the policy
4691 * @NDP_ACCEPT_POLICY_ALL: accept policy offloaded to fw
4692 *
4693 */
4694enum ndp_accept_policy {
4695 NDP_ACCEPT_POLICY_NONE = 0,
4696 NDP_ACCEPT_POLICY_ALL = 1,
4697};
4698
4699/**
4700 * enum ndp_self_role - nan data path role
4701 * @NDP_ROLE_INITIATOR: initiator of nan data path request
4702 * @NDP_ROLE_RESPONDER: responder to nan data path request
4703 *
4704 */
4705enum ndp_self_role {
4706 NDP_ROLE_INITIATOR = 0,
4707 NDP_ROLE_RESPONDER = 1,
4708};
4709
4710/**
4711 * enum ndp_response_code - responder's response code to nan data path request
4712 * @NDP_RESPONSE_ACCEPT: ndp request accepted
4713 * @NDP_RESPONSE_REJECT: ndp request rejected
4714 * @NDP_RESPONSE_DEFER: ndp request deferred until later (response to follow
4715 * any time later)
4716 *
4717 */
4718enum ndp_response_code {
4719 NDP_RESPONSE_ACCEPT = 0,
4720 NDP_RESPONSE_REJECT = 1,
4721 NDP_RESPONSE_DEFER = 2,
4722};
4723
4724/**
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07004725 * enum ndp_end_type - NDP end type
4726 * @NDP_END_TYPE_UNSPECIFIED: type is unspecified
4727 * @NDP_END_TYPE_PEER_UNAVAILABLE: type is peer unavailable
4728 * @NDP_END_TYPE_OTA_FRAME: NDP end frame received from peer
4729 *
4730 */
4731enum ndp_end_type {
4732 NDP_END_TYPE_UNSPECIFIED = 0x00,
4733 NDP_END_TYPE_PEER_UNAVAILABLE = 0x01,
4734 NDP_END_TYPE_OTA_FRAME = 0x02,
4735};
4736
4737/**
4738 * enum ndp_end_reason_code - NDP end reason code
4739 * @NDP_END_REASON_UNSPECIFIED: reason is unspecified
4740 * @NDP_END_REASON_INACTIVITY: reason is peer inactivity
4741 * @NDP_END_REASON_PEER_DATA_END: data end indication received from peer
4742 *
4743 */
4744enum ndp_end_reason_code {
4745 NDP_END_REASON_UNSPECIFIED = 0x00,
4746 NDP_END_REASON_INACTIVITY = 0x01,
4747 NDP_END_REASON_PEER_DATA_END = 0x02,
4748};
4749
4750/**
Naveen Rawat8d63a592016-06-29 18:30:59 -07004751 * enum nan_status_type - NDP status type
4752 * @NDP_RSP_STATUS_SUCCESS: request was successful
4753 * @NDP_RSP_STATUS_ERROR: request failed
4754 */
4755enum nan_status_type {
4756 NDP_RSP_STATUS_SUCCESS = 0x00,
4757 NDP_RSP_STATUS_ERROR = 0x01,
4758};
4759
4760/**
4761 * enum nan_reason_code - NDP command rsp reason code value
4762 * @NDP_UNSUPPORTED_CONCURRENCY: Will be used in unsupported concurrency cases
4763 * @NDP_NAN_DATA_IFACE_CREATE_FAILED: ndi create failed
4764 * @NDP_NAN_DATA_IFACE_DELETE_FAILED: ndi delete failed
4765 * @NDP_DATA_INITIATOR_REQ_FAILED: data initiator request failed
4766 * @NDP_DATA_RESPONDER_REQ_FAILED: data responder request failed
4767 * @NDP_INVALID_SERVICE_INSTANCE_ID: invalid service instance id
4768 * @NDP_INVALID_NDP_INSTANCE_ID: invalid ndp instance id
4769 * @NDP_INVALID_RSP_CODE: invalid response code in ndp responder request
4770 * @NDP_INVALID_APP_INFO_LEN: invalid app info length
4771 * @NDP_NMF_REQ_FAIL: OTA nan mgmt frame failure for data request
4772 * @NDP_NMF_RSP_FAIL: OTA nan mgmt frame failure for data response
4773 * @NDP_NMF_CNF_FAIL: OTA nan mgmt frame failure for confirm
4774 * @NDP_END_FAILED: ndp end failed
4775 * @NDP_NMF_END_REQ_FAIL: OTA nan mgmt frame failure for data end
4776 * @NDP_VENDOR_SPECIFIC_ERROR: other vendor specific failures
4777 */
4778enum nan_reason_code {
4779 NDP_UNSUPPORTED_CONCURRENCY = 9000,
4780 NDP_NAN_DATA_IFACE_CREATE_FAILED = 9001,
4781 NDP_NAN_DATA_IFACE_DELETE_FAILED = 9002,
4782 NDP_DATA_INITIATOR_REQ_FAILED = 9003,
4783 NDP_DATA_RESPONDER_REQ_FAILED = 9004,
4784 NDP_INVALID_SERVICE_INSTANCE_ID = 9005,
4785 NDP_INVALID_NDP_INSTANCE_ID = 9006,
4786 NDP_INVALID_RSP_CODE = 9007,
4787 NDP_INVALID_APP_INFO_LEN = 9008,
4788 NDP_NMF_REQ_FAIL = 9009,
4789 NDP_NMF_RSP_FAIL = 9010,
4790 NDP_NMF_CNF_FAIL = 9011,
4791 NDP_END_FAILED = 9012,
4792 NDP_NMF_END_REQ_FAIL = 9013,
4793 /* 9500 onwards vendor specific error codes */
4794 NDP_VENDOR_SPECIFIC_ERROR = 9500,
4795};
4796
4797/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07004798 * struct ndp_cfg - ndp configuration
4799 * @tag: unique identifier
4800 * @ndp_cfg_len: ndp configuration length
4801 * @ndp_cfg: variable length ndp configuration
4802 *
4803 */
4804struct ndp_cfg {
4805 uint32_t tag;
4806 uint32_t ndp_cfg_len;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07004807 uint8_t *ndp_cfg;
Ravi Joshi412f23d2016-05-26 15:09:23 -07004808};
4809
4810/**
4811 * struct ndp_qos_cfg - ndp qos configuration
4812 * @tag: unique identifier
4813 * @ndp_qos_cfg_len: ndp qos configuration length
4814 * @ndp_qos_cfg: variable length ndp qos configuration
4815 *
4816 */
4817struct ndp_qos_cfg {
4818 uint32_t tag;
4819 uint32_t ndp_qos_cfg_len;
4820 uint8_t ndp_qos_cfg[];
4821};
4822
4823/**
4824 * struct ndp_app_info - application info shared during ndp setup
4825 * @tag: unique identifier
4826 * @ndp_app_info_len: ndp app info length
4827 * @ndp_app_info: variable length application information
4828 *
4829 */
4830struct ndp_app_info {
4831 uint32_t tag;
4832 uint32_t ndp_app_info_len;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07004833 uint8_t *ndp_app_info;
Ravi Joshi412f23d2016-05-26 15:09:23 -07004834};
4835
4836/**
Naveen Rawat4f3983e2016-11-29 16:12:09 -08004837 * struct ndp_scid - structure to hold sceurity context identifier
4838 * @scid_len: length of scid
4839 * @scid: scid
4840 *
4841 */
4842struct ndp_scid {
4843 uint32_t scid_len;
4844 uint8_t *scid;
4845};
4846
4847/**
4848 * struct ndp_pmk - structure to hold pairwise master key
4849 * @pmk_len: length of pairwise master key
4850 * @pmk: buffer containing pairwise master key
4851 *
4852 */
4853struct ndp_pmk {
4854 uint32_t pmk_len;
4855 uint8_t *pmk;
4856};
4857
4858/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07004859 * struct ndi_create_rsp - ndi create response params
Ravi Joshi412f23d2016-05-26 15:09:23 -07004860 * @status: request status
4861 * @reason: reason if any
4862 *
4863 */
4864struct ndi_create_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07004865 uint32_t status;
4866 uint32_t reason;
Rakesh Sunkicf1c9ab2016-08-25 14:11:25 -07004867 uint8_t sta_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07004868};
4869
4870/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07004871 * struct ndi_delete_rsp - ndi delete response params
Ravi Joshi412f23d2016-05-26 15:09:23 -07004872 * @status: request status
4873 * @reason: reason if any
4874 *
4875 */
4876struct ndi_delete_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07004877 uint32_t status;
4878 uint32_t reason;
4879};
4880
4881/**
4882 * struct ndp_initiator_req - ndp initiator request params
4883 * @transaction_id: unique identifier
4884 * @vdev_id: session id of the interface over which ndp is being created
4885 * @channel: suggested channel for ndp creation
Naveen Rawat0a017052016-10-19 14:17:07 -07004886 * @channel_cfg: channel config, 0=no channel, 1=optional, 2=mandatory
Ravi Joshi412f23d2016-05-26 15:09:23 -07004887 * @service_instance_id: Service identifier
4888 * @peer_discovery_mac_addr: Peer's discovery mac address
4889 * @self_ndi_mac_addr: self NDI mac address
4890 * @ndp_config: ndp configuration params
4891 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08004892 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
4893 * @pmk: pairwise master key
Ravi Joshi412f23d2016-05-26 15:09:23 -07004894 *
4895 */
4896struct ndp_initiator_req {
4897 uint32_t transaction_id;
4898 uint32_t vdev_id;
4899 uint32_t channel;
Naveen Rawat0a017052016-10-19 14:17:07 -07004900 uint32_t channel_cfg;
Ravi Joshi412f23d2016-05-26 15:09:23 -07004901 uint32_t service_instance_id;
4902 struct qdf_mac_addr peer_discovery_mac_addr;
4903 struct qdf_mac_addr self_ndi_mac_addr;
4904 struct ndp_cfg ndp_config;
4905 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08004906 uint32_t ncs_sk_type;
4907 struct ndp_pmk pmk;
Ravi Joshi412f23d2016-05-26 15:09:23 -07004908};
4909
4910/**
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07004911 * struct ndp_initiator_rsp - response event from FW
Ravi Joshi412f23d2016-05-26 15:09:23 -07004912 * @transaction_id: unique identifier
4913 * @vdev_id: session id of the interface over which ndp is being created
4914 * @ndp_instance_id: locally created NDP instance ID
4915 * @status: status of the ndp request
4916 * @reason: reason for failure if any
4917 *
4918 */
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07004919struct ndp_initiator_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07004920 uint32_t transaction_id;
4921 uint32_t vdev_id;
4922 uint32_t ndp_instance_id;
4923 uint32_t status;
Naveen Rawat8d63a592016-06-29 18:30:59 -07004924 uint32_t reason;
Ravi Joshi412f23d2016-05-26 15:09:23 -07004925};
4926
4927/**
4928 * struct ndp_indication_event - create ndp indication on the responder
4929 * @vdev_id: session id of the interface over which ndp is being created
4930 * @service_instance_id: Service identifier
4931 * @peer_discovery_mac_addr: Peer's discovery mac address
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07004932 * @peer_mac_addr: Peer's NDI mac address
Ravi Joshi412f23d2016-05-26 15:09:23 -07004933 * @ndp_initiator_mac_addr: NDI mac address of the peer initiating NDP
4934 * @ndp_instance_id: locally created NDP instance ID
4935 * @role: self role for NDP
4936 * @ndp_accept_policy: accept policy configured by the upper layer
4937 * @ndp_config: ndp configuration params
4938 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08004939 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
4940 * @scid: security context identifier
Ravi Joshi412f23d2016-05-26 15:09:23 -07004941 *
4942 */
4943struct ndp_indication_event {
4944 uint32_t vdev_id;
4945 uint32_t service_instance_id;
4946 struct qdf_mac_addr peer_discovery_mac_addr;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07004947 struct qdf_mac_addr peer_mac_addr;
Ravi Joshi412f23d2016-05-26 15:09:23 -07004948 uint32_t ndp_instance_id;
4949 enum ndp_self_role role;
4950 enum ndp_accept_policy policy;
4951 struct ndp_cfg ndp_config;
4952 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08004953 uint32_t ncs_sk_type;
4954 struct ndp_scid scid;
Ravi Joshi412f23d2016-05-26 15:09:23 -07004955};
4956
4957/**
4958 * struct ndp_responder_req - responder's response to ndp create request
4959 * @transaction_id: unique identifier
4960 * @vdev_id: session id of the interface over which ndp is being created
4961 * @ndp_instance_id: locally created NDP instance ID
4962 * @ndp_rsp: response to the ndp create request
4963 * @ndp_config: ndp configuration params
4964 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08004965 * @pmk: pairwise master key
4966 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
Ravi Joshi412f23d2016-05-26 15:09:23 -07004967 *
4968 */
4969struct ndp_responder_req {
4970 uint32_t transaction_id;
4971 uint32_t vdev_id;
4972 uint32_t ndp_instance_id;
4973 enum ndp_response_code ndp_rsp;
4974 struct ndp_cfg ndp_config;
4975 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08004976 struct ndp_pmk pmk;
4977 uint32_t ncs_sk_type;
Ravi Joshi412f23d2016-05-26 15:09:23 -07004978};
4979
4980/**
4981 * struct ndp_responder_rsp_event - response to responder's request
4982 * @transaction_id: unique identifier
4983 * @vdev_id: session id of the interface over which ndp is being created
4984 * @status: command status
4985 * @reason: reason for failure if any
Abhishek Singh4fef7472016-06-06 11:36:03 -07004986 * @peer_mac_addr: Peer's mac address
Rakesh Sunkid92d1082017-01-04 15:14:28 -08004987 * @create_peer: Flag to indicate to create peer
Ravi Joshi412f23d2016-05-26 15:09:23 -07004988 */
4989struct ndp_responder_rsp_event {
4990 uint32_t transaction_id;
4991 uint32_t vdev_id;
4992 uint32_t status;
4993 uint32_t reason;
Abhishek Singh4fef7472016-06-06 11:36:03 -07004994 struct qdf_mac_addr peer_mac_addr;
Rakesh Sunkid92d1082017-01-04 15:14:28 -08004995 bool create_peer;
Ravi Joshi412f23d2016-05-26 15:09:23 -07004996};
4997
4998/**
4999 * struct ndp_confirm_event - ndp confirmation event from FW
5000 * @vdev_id: session id of the interface over which ndp is being created
5001 * @ndp_instance_id: ndp instance id for which confirm is being generated
Naveen Rawat460be782016-06-29 18:26:22 -07005002 * @reason_code : reason code(opaque to driver)
5003 * @num_active_ndps_on_peer: number of ndp instances on peer
Ravi Joshi412f23d2016-05-26 15:09:23 -07005004 * @peer_ndi_mac_addr: peer NDI mac address
5005 * @rsp_code: ndp response code
Ravi Joshi412f23d2016-05-26 15:09:23 -07005006 * @ndp_info: ndp application info
5007 *
5008 */
5009struct ndp_confirm_event {
5010 uint32_t vdev_id;
5011 uint32_t ndp_instance_id;
Naveen Rawat460be782016-06-29 18:26:22 -07005012 uint32_t reason_code;
5013 uint32_t num_active_ndps_on_peer;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005014 struct qdf_mac_addr peer_ndi_mac_addr;
5015 enum ndp_response_code rsp_code;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005016 struct ndp_app_info ndp_info;
5017};
5018
5019/**
5020 * struct ndp_end_req - ndp end request
5021 * @transaction_id: unique transaction identifier
Ravi Joshi412f23d2016-05-26 15:09:23 -07005022 * @num_ndp_instances: number of ndp instances to be terminated
Naveen Rawatf28315c2016-06-29 18:06:02 -07005023 * @ndp_ids: pointer to array of ndp_instance_id to be terminated
Ravi Joshi412f23d2016-05-26 15:09:23 -07005024 *
5025 */
5026struct ndp_end_req {
5027 uint32_t transaction_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005028 uint32_t num_ndp_instances;
Naveen Rawatf28315c2016-06-29 18:06:02 -07005029 uint32_t *ndp_ids;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005030};
5031
5032/**
5033 * struct peer_ndp_map - mapping of NDP instances to peer to VDEV
5034 * @vdev_id: session id of the interface over which ndp is being created
5035 * @peer_ndi_mac_addr: peer NDI mac address
5036 * @num_active_ndp_sessions: number of active NDP sessions on the peer
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07005037 * @type: NDP end indication type
5038 * @reason_code: NDP end indication reason code
5039 * @ndp_instance_id: NDP instance ID
Ravi Joshi412f23d2016-05-26 15:09:23 -07005040 *
5041 */
5042struct peer_ndp_map {
5043 uint32_t vdev_id;
5044 struct qdf_mac_addr peer_ndi_mac_addr;
5045 uint32_t num_active_ndp_sessions;
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07005046 enum ndp_end_type type;
5047 enum ndp_end_reason_code reason_code;
5048 uint32_t ndp_instance_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005049};
5050
5051/**
5052 * struct ndp_end_rsp_event - firmware response to ndp end request
5053 * @transaction_id: unique identifier for the request
Naveen Rawatf28315c2016-06-29 18:06:02 -07005054 * @status: status of operation
5055 * @reason: reason(opaque to host driver)
Ravi Joshi412f23d2016-05-26 15:09:23 -07005056 *
5057 */
5058struct ndp_end_rsp_event {
5059 uint32_t transaction_id;
Naveen Rawatf28315c2016-06-29 18:06:02 -07005060 uint32_t status;
5061 uint32_t reason;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005062};
5063
5064/**
5065 * struct ndp_end_indication_event - ndp termination notification from FW
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07005066 * @num_ndp_ids: number of NDP ids
5067 * @ndp_map: mapping of NDP instances to peer and vdev
Ravi Joshi412f23d2016-05-26 15:09:23 -07005068 *
5069 */
5070struct ndp_end_indication_event {
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07005071 uint32_t num_ndp_ids;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005072 struct peer_ndp_map ndp_map[];
5073};
5074
5075/**
5076 * struct ndp_schedule_update_req - ndp schedule update request
5077 * @transaction_id: unique identifier
5078 * @vdev_id: session id of the interface over which ndp is being created
5079 * @ndp_instance_id: ndp instance id for which schedule update is requested
5080 * @ndp_qos: new set of qos parameters
5081 *
5082 */
5083struct ndp_schedule_update_req {
5084 uint32_t transaction_id;
5085 uint32_t vdev_id;
5086 uint32_t ndp_instance_id;
5087 struct ndp_qos_cfg ndp_qos;
5088};
5089
5090/**
5091 * struct ndp_schedule_update_rsp - ndp schedule update response
5092 * @transaction_id: unique identifier
5093 * @vdev_id: session id of the interface over which ndp is being created
5094 * @status: status of the request
5095 * @reason: reason code for failure if any
5096 *
5097 */
5098struct ndp_schedule_update_rsp {
5099 uint32_t transaction_id;
5100 uint32_t vdev_id;
5101 uint32_t status;
5102 uint32_t reason;
5103};
5104
5105/**
5106 * struct sme_ndp_peer_ind - ndp peer indication
5107 * @msg_type: message id
5108 * @msg_len: message length
5109 * @session_id: session id
5110 * @peer_mac_addr: peer mac address
5111 * @sta_id: station id
5112 *
5113 */
5114struct sme_ndp_peer_ind {
5115 uint16_t msg_type;
5116 uint16_t msg_len;
5117 uint8_t session_id;
5118 struct qdf_mac_addr peer_mac_addr;
5119 uint16_t sta_id;
5120};
Nachiket Kukade2fb1fdb2019-01-08 15:35:27 +05305121#endif /* WLAN_FEATURE_NAN */
Ravi Joshi412f23d2016-05-26 15:09:23 -07005122
Peng Xu8fdaa492016-06-22 10:20:47 -07005123/**
5124 * struct sir_p2p_lo_start - p2p listen offload start
5125 * @vdev_id: vdev identifier
5126 * @ctl_flags: control flag
5127 * @freq: p2p listen frequency
5128 * @period: listen offload period
5129 * @interval: listen offload interval
5130 * @count: number listen offload intervals
5131 * @device_types: device types
5132 * @dev_types_len: device types length
5133 * @probe_resp_tmplt: probe response template
5134 * @probe_resp_len: probe response template length
5135 */
5136struct sir_p2p_lo_start {
5137 uint32_t vdev_id;
5138 uint32_t ctl_flags;
5139 uint32_t freq;
5140 uint32_t period;
5141 uint32_t interval;
5142 uint32_t count;
5143 uint8_t *device_types;
5144 uint32_t dev_types_len;
5145 uint8_t *probe_resp_tmplt;
5146 uint32_t probe_resp_len;
5147};
5148
5149/**
5150 * struct sir_p2p_lo_event - P2P listen offload stop event
5151 * @vdev_id: vdev identifier
5152 * @reason_code: P2P listen offload stop reason
5153 */
5154struct sir_p2p_lo_event {
5155 uint32_t vdev_id;
5156 uint32_t reason_code;
5157};
Manjeet Singhf82ed072016-07-08 11:40:00 +05305158
5159/**
5160 * struct sir_hal_pwr_dbg_cmd - unit test command parameters
5161 * @pdev_id: pdev id
5162 * @module_id: module id
5163 * @num_args: number of arguments
5164 * @args: arguments
5165 */
5166struct sir_mac_pwr_dbg_cmd {
5167 uint32_t pdev_id;
5168 uint32_t module_id;
5169 uint32_t num_args;
5170 uint32_t args[MAX_POWER_DBG_ARGS_SUPPORTED];
5171};
5172
Kondabattini, Ganesh3f2d02c2016-09-13 12:23:47 +05305173/**
5174 * struct sme_send_disassoc_frm_req - send disassoc request frame
5175 * @msg_type: message type
5176 * @length: length of message
Abhishek Singhefe21e62019-09-20 10:03:24 +05305177 * @vdev_id: vdev id
Kondabattini, Ganesh3f2d02c2016-09-13 12:23:47 +05305178 * @peer_mac: peer mac address
5179 * @reason: reason for disassoc
5180 * @wait_for_ack: wait for acknowledgment
5181 **/
5182 struct sme_send_disassoc_frm_req {
5183 uint16_t msg_type;
5184 uint16_t length;
Abhishek Singhefe21e62019-09-20 10:03:24 +05305185 uint8_t vdev_id;
Kondabattini, Ganesh3f2d02c2016-09-13 12:23:47 +05305186 uint8_t peer_mac[6];
5187 uint16_t reason;
5188 uint8_t wait_for_ack;
5189 };
5190
Kondabattini, Ganeshe4f18e02016-09-13 13:01:22 +05305191/**
5192 * struct sme_update_access_policy_vendor_ie - update vendor ie and access
5193 * policy
5194 * @msg_type: message id
5195 * @msg_len: message length
Abhishek Singhefe21e62019-09-20 10:03:24 +05305196 * @vdev_id: vdev id
Kondabattini, Ganeshe4f18e02016-09-13 13:01:22 +05305197 * @ie: vendor ie
5198 * @access_policy: access policy for vendor ie
5199 */
5200struct sme_update_access_policy_vendor_ie {
5201 uint16_t msg_type;
5202 uint16_t length;
Abhishek Singhefe21e62019-09-20 10:03:24 +05305203 uint32_t vdev_id;
Srinivas Girigowdacf161402019-03-14 11:37:33 -07005204 uint8_t ie[WLAN_MAX_IE_LEN + 2];
Kondabattini, Ganeshe4f18e02016-09-13 13:01:22 +05305205 uint8_t access_policy;
5206};
5207
Padma, Santhosh Kumard7cc0792016-06-28 18:54:12 +05305208/**
Agrawal, Ashish35b251d2016-09-08 19:21:03 +05305209 * struct sme_tx_fail_cnt_threshold - tx failure count for disconnect to fw
5210 * @session_id: Session id
5211 * @tx_fail_cnt_threshold: Tx failure count to do disconnect
5212 */
5213struct sme_tx_fail_cnt_threshold {
5214 uint8_t session_id;
5215 uint32_t tx_fail_cnt_threshold;
5216};
Agrawal Ashishda3e9502016-09-21 17:43:51 +05305217
5218/**
5219 * struct sme_short_retry_limit - transmission retry limit for short frames.
5220 * @session_id: Session id
5221 * @short_retry_limit: tranmission retry limit for short frame.
5222 *
5223 */
5224struct sme_short_retry_limit {
5225 uint8_t session_id;
5226 uint32_t short_retry_limit;
5227};
5228
5229/**
5230 * struct sme_long_retry_limit - tranmission retry limit for long frames
5231 * @session_id: Session id
5232 * @short_retry_limit: tranmission retry limit for long frames.
5233 *
5234 */
5235struct sme_long_retry_limit {
5236 uint8_t session_id;
5237 uint32_t long_retry_limit;
5238};
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05305239
5240/**
Kiran Kumar Lokere08195ef2018-01-17 19:25:15 -08005241 * struct sme_addba_accept - Allow/reject the addba request frame
5242 * @session_id: Session id
5243 * @addba_accept: Allow/reject the addba request frame
5244 */
5245struct sme_addba_accept {
5246 uint8_t session_id;
5247 uint8_t addba_accept;
5248};
5249
5250/**
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05305251 * struct sme_sta_inactivity_timeout - set sta_inactivity_timeout
5252 * @session_id: session Id.
5253 * @sta_inactivity_timeout: Timeout to disconnect STA after there
5254 * is no activity.
5255 */
5256struct sme_sta_inactivity_timeout {
5257 uint8_t session_id;
5258 uint32_t sta_inactivity_timeout;
5259};
Yingying Tang95409972016-10-20 15:16:15 +08005260
5261/*
5262 * struct wow_pulse_mode - WoW Pulse set cmd struct
5263 * @wow_pulse_enable: enable or disable this feature
5264 * @wow_pulse_pin: GPIO PIN for Pulse
5265 * @wow_pulse_interval_low: Pulse interval low
5266 * @wow_pulse_interval_high: Pulse interval high
5267 *
5268 * SME uses this structure to configure wow pulse info
5269 * and send it to WMA
5270 */
5271struct wow_pulse_mode {
5272 bool wow_pulse_enable;
5273 uint8_t wow_pulse_pin;
5274 uint16_t wow_pulse_interval_high;
5275 uint16_t wow_pulse_interval_low;
5276};
5277
Rajeev Kumare406d652017-01-30 17:47:05 -08005278
5279/**
Rajeev Kumard138ac52017-01-30 18:38:37 -08005280 * umac_send_mb_message_to_mac(): post message to umac
Rajeev Kumare406d652017-01-30 17:47:05 -08005281 * @msg: opaque message pointer
5282 *
5283 * Return: QDF status
5284 */
Rajeev Kumard138ac52017-01-30 18:38:37 -08005285QDF_STATUS umac_send_mb_message_to_mac(void *msg);
Rajeev Kumare406d652017-01-30 17:47:05 -08005286
Kapil Gupta4f0c0c12017-02-07 15:21:15 +05305287/**
5288 * struct scan_chan_info - channel info
5289 * @freq: radio frequence
5290 * @cmd flag: cmd flag
5291 * @noise_floor: noise floor
5292 * @cycle_count: cycle count
5293 * @rx_clear_count: rx clear count
5294 * @tx_frame_count: TX frame count
5295 * @clock_freq: clock frequence MHZ
5296 */
5297struct scan_chan_info {
5298 uint32_t freq;
5299 uint32_t cmd_flag;
5300 uint32_t noise_floor;
5301 uint32_t cycle_count;
5302 uint32_t rx_clear_count;
5303 uint32_t tx_frame_count;
5304 uint32_t clock_freq;
5305};
Dustin Brown54096432017-02-23 13:00:44 -08005306
5307/**
5308 * enum wow_resume_trigger - resume trigger override setting values
5309 * @WOW_RESUME_TRIGGER_DEFAULT: fw to use platform default resume trigger
5310 * @WOW_RESUME_TRIGGER_HTC_WAKEUP: force fw to use HTC Wakeup to resume
5311 * @WOW_RESUME_TRIGGER_GPIO: force fw to use GPIO to resume
5312 * @WOW_RESUME_TRIGGER_COUNT: number of resume trigger options
5313 */
5314enum wow_resume_trigger {
5315 /* always first */
5316 WOW_RESUME_TRIGGER_DEFAULT = 0,
5317 WOW_RESUME_TRIGGER_HTC_WAKEUP,
5318 WOW_RESUME_TRIGGER_GPIO,
5319 /* always last */
5320 WOW_RESUME_TRIGGER_COUNT
5321};
5322
5323/**
5324 * enum wow_interface_pause - interface pause override setting values
5325 * @WOW_INTERFACE_PAUSE_DEFAULT: use platform default interface pause setting
5326 * @WOW_INTERFACE_PAUSE_ENABLE: force interface pause setting to enabled
5327 * @WOW_INTERFACE_PAUSE_DISABLE: force interface pause setting to disabled
5328 * @WOW_INTERFACE_PAUSE_COUNT: number of interface pause options
5329 */
5330enum wow_interface_pause {
5331 /* always first */
5332 WOW_INTERFACE_PAUSE_DEFAULT = 0,
5333 WOW_INTERFACE_PAUSE_ENABLE,
5334 WOW_INTERFACE_PAUSE_DISABLE,
5335 /* always last */
5336 WOW_INTERFACE_PAUSE_COUNT
5337};
5338
5339/**
5340 * struct wow_enable_params - A collection of wow enable override parameters
5341 * @is_unit_test: true to notify fw this is a unit-test suspend
5342 * @interface_pause: used to override the interface pause indication sent to fw
5343 * @resume_trigger: used to force fw to use a particular resume method
5344 */
5345struct wow_enable_params {
5346 bool is_unit_test;
5347 enum wow_interface_pause interface_pause;
5348 enum wow_resume_trigger resume_trigger;
5349};
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07005350
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08005351#define HE_LTF_1X 0
5352#define HE_LTF_2X 1
5353#define HE_LTF_4X 2
5354
5355#define HE_LTF_ALL 0x7
5356#define HE_SGI_MASK 0xFF00
5357
5358#define AUTO_RATE_GI_400NS 8
5359#define AUTO_RATE_GI_800NS 9
5360#define AUTO_RATE_GI_1600NS 10
5361#define AUTO_RATE_GI_3200NS 11
5362
Kiran Kumar Lokere681403c2020-01-30 17:12:57 -08005363#define AUTO_RATE_LDPC_DIS_BIT 16
5364
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08005365#define SET_AUTO_RATE_SGI_VAL(set_val, bit_mask) \
5366 (set_val = (set_val & HE_LTF_ALL) | bit_mask)
5367
5368#define SET_AUTO_RATE_HE_LTF_VAL(set_val, bit_mask) \
5369 (set_val = (set_val & HE_SGI_MASK) | bit_mask)
5370
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07005371#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -07005372#define HE_CAP_OUI_TYPE "\x23"
5373#define HE_CAP_OUI_SIZE 1
5374#define HE_OP_OUI_TYPE "\x24"
5375#define HE_OP_OUI_SIZE 1
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08005376
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07005377#define HE_RU_ALLOC_INDX0_MASK (0x01 << 0)
5378#define HE_RU_ALLOC_INDX1_MASK (0x01 << 1)
5379#define HE_RU_ALLOC_INDX2_MASK (0x01 << 2)
5380#define HE_RU_ALLOC_INDX3_MASK (0x01 << 3)
5381
5382/* 3 bits for NSS and 4 bits for RU Index */
5383#define HE_PPET_NSS_LEN 3
5384#define HE_PEPT_RU_IDX_LEN 4
5385#define HE_PPET_NSS_RU_LEN (HE_PPET_NSS_LEN + HE_PEPT_RU_IDX_LEN)
5386#define HE_PPET_SIZE 3
5387#define HE_BYTE_SIZE 8
5388
Naveen Rawat819158d2018-01-16 10:56:45 -08005389struct ppet_hdr {
5390 uint8_t nss:3;
5391 uint8_t ru_idx_mask:4;
5392 uint8_t remaining:1;
5393};
5394
5395/* MAX PPET size = 7 bits + (max_nss X max_ru_number X 6) = 25 bytes */
5396#define HE_MAX_PPET_SIZE WNI_CFG_HE_PPET_LEN
5397
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -08005398#define HE_MAX_PHY_CAP_SIZE 3
5399
Naveen Rawataeca1b92017-10-16 16:55:31 -07005400#define HE_CH_WIDTH_GET_BIT(ch_wd, bit) (((ch_wd) >> (bit)) & 1)
5401#define HE_CH_WIDTH_COMBINE(b0, b1, b2, b3, b4, b5, b6) \
5402 ((uint8_t)(b0) | ((b1) << 1) | ((b2) << 2) | ((b3) << 3) | \
5403 ((b4) << 4) | ((b5) << 5) | ((b6) << 6))
Jia Ding4d2f99f2020-09-10 18:22:37 +08005404#define HE_CH_WIDTH_CLR_BIT(ch_wd, bit) (((ch_wd) >> (bit)) & ~1)
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -07005405
Naveen Rawataeca1b92017-10-16 16:55:31 -07005406/*
5407 * MCS values are interpreted as in IEEE 11ax-D1.4 spec onwards
5408 * +-----------------------------------------------------+
5409 * | SS8 | SS7 | SS6 | SS5 | SS4 | SS3 | SS2 | SS1 |
5410 * +-----------------------------------------------------+
5411 * | 15-14 | 13-12 | 11-10 | 9-8 | 7-6 | 5-4 | 3-2 | 1-0 |
5412 * +-----------------------------------------------------+
5413 */
5414#define HE_MCS_NSS_SHIFT(nss) (((nss) - 1) << 1)
5415#define HE_MCS_MSK_4_NSS(nss) (3 << HE_MCS_NSS_SHIFT(nss))
5416#define HE_MCS_INV_MSK_4_NSS(nss) (~HE_MCS_MSK_4_NSS(nss))
5417#define HE_GET_MCS_4_NSS(mcs_set, nss) \
5418 (((mcs_set) >> HE_MCS_NSS_SHIFT(nss)) & 3)
5419#define HE_SET_MCS_4_NSS(mcs_set, mcs, nss) \
5420 (((mcs_set) & HE_MCS_INV_MSK_4_NSS(nss)) | \
5421 ((mcs) << HE_MCS_NSS_SHIFT(nss)))
5422#define HE_MCS_IS_NSS_ENABLED(mcs_set, nss) \
5423 ((HE_MCS_MSK_4_NSS(nss) & (mcs_set)) != HE_MCS_MSK_4_NSS(nss))
5424
5425#define HE_MCS_ALL_DISABLED 0xFFFF
Kiran Kumar Lokere59a569e2018-01-24 15:00:50 -08005426
5427#define HE_MCS_0_7 0x0
5428#define HE_MCS_0_9 0x1
5429#define HE_MCS_0_11 0x2
5430#define HE_MCS_DISABLE 0x3
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08005431
Kiran Kumar Lokere4ef48832020-06-08 21:57:14 -07005432#define HE_6G_MIN_MPDU_START_SAPCE_BIT_POS 0
5433#define HE_6G_MAX_AMPDU_LEN_EXP_BIT_POS 3
5434#define HE_6G_MAX_MPDU_LEN_BIT_POS 6
5435#define HE_6G_SMPS_BIT_POS 9
5436#define HE_6G_RD_RESP_BIT_POS 11
5437#define HE_6G_RX_ANT_PATTERN_BIT_POS 12
5438#define HE_6G_TX_ANT_PATTERN_BIT_POS 13
5439
Naveen Rawataeca1b92017-10-16 16:55:31 -07005440/*
5441 * Following formuala has been arrived at using karnaugh map and unit tested
5442 * with sample code. Take MCS for each NSS as 2 bit value first and solve for
5443 * 2 bit intersection of NSS. Use following table/Matrix as guide for solving
5444 * K-Maps
5445 * MCS 1\MCS 2 00 01 10 11
5446 * 00 00 00 00 11
5447 * 01 00 01 01 11
5448 * 10 00 01 10 11
5449 * 11 11 11 11 11
5450 * if output MCS is o1o0, then as per K-map reduction:
5451 * o0 = m1.m0 | n1.n0 | (~m1).m0.(n1^n0) | (~n1).n0.(m1^m0)
5452 * o1 = m1.m0 | n1.n0 | m1.(~m0).n1.(~n0)
5453 *
5454 * Please note: Calculating MCS intersection is 80211 protocol specific and
5455 * should be implemented in PE. WMA can use this macro rather than calling any
5456 * lim API to do the intersection.
5457 */
5458#define HE_INTERSECT_MCS_BITS_PER_NSS(m1, m0, n1, n0) \
5459 (((m1 & m0) | (n1 & n0) | (((~m1) & m0) & (n1 ^ n0)) | \
5460 (((~n1) & n0) & (m1 ^ m0))) | (((m1 & m0) | (n1 & n0) | \
5461 (m1 & ~m0 & n1 & ~n0)) << 1))
5462
5463/* following takes MCS as 2 bits */
5464#define HE_INTERSECT_MCS_PER_NSS(mcs_1, mcs_2) \
5465 HE_INTERSECT_MCS_BITS_PER_NSS((mcs_1 >> 1), (mcs_1 & 1), \
5466 (mcs_2 >> 1), (mcs_2 & 1))
5467
5468/* following takes MCS as 16 bits */
5469#define HE_INTERSECT_MCS(mcs_1, mcs_2) ( \
5470 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 1), \
5471 HE_GET_MCS_4_NSS(mcs_2, 1)) << HE_MCS_NSS_SHIFT(1) | \
5472 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 2), \
5473 HE_GET_MCS_4_NSS(mcs_2, 2)) << HE_MCS_NSS_SHIFT(2) | \
5474 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 3), \
5475 HE_GET_MCS_4_NSS(mcs_2, 3)) << HE_MCS_NSS_SHIFT(3) | \
5476 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 4), \
5477 HE_GET_MCS_4_NSS(mcs_2, 4)) << HE_MCS_NSS_SHIFT(4) | \
5478 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 5), \
5479 HE_GET_MCS_4_NSS(mcs_2, 5)) << HE_MCS_NSS_SHIFT(5) | \
5480 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 6), \
5481 HE_GET_MCS_4_NSS(mcs_2, 6)) << HE_MCS_NSS_SHIFT(6) | \
5482 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 7), \
5483 HE_GET_MCS_4_NSS(mcs_2, 7)) << HE_MCS_NSS_SHIFT(7) | \
5484 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 8), \
5485 HE_GET_MCS_4_NSS(mcs_2, 8)) << HE_MCS_NSS_SHIFT(8))
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -07005486
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -08005487/**
5488 * struct he_capability - to store 11ax HE capabilities
5489 * @phy_cap: HE PHY capabilities
5490 * @mac_cap: HE MAC capabilities
5491 * @mcs: HE MCS
5492 * @ppet: HE PPE threshold
5493 */
5494struct he_capability {
5495 uint32_t phy_cap[HE_MAX_PHY_CAP_SIZE];
5496 uint32_t mac_cap;
5497 uint32_t mcs;
5498 struct wlan_psoc_host_ppe_threshold ppet;
5499};
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07005500#endif
5501
Naveen Rawataeca1b92017-10-16 16:55:31 -07005502#define HE_GET_NSS(mcs, nss) \
5503 do { \
5504 (nss) = 0; \
Naveen Rawatcbcc6542017-10-30 17:55:03 -07005505 while ((((mcs) >> ((nss)*2)) & 3) != 3 && nss < 8) \
Naveen Rawataeca1b92017-10-16 16:55:31 -07005506 (nss)++; \
5507 } while (0)
5508
Nitesh Shah99dd9552017-03-20 19:27:47 +05305509/**
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05305510 * struct rsp_stats - arp packet stats
5511 * @arp_req_enqueue: fw tx count
5512 * @arp_req_tx_success: tx ack count
5513 * @arp_req_tx_failure: tx ack fail count
5514 * @arp_rsp_recvd: rx fw count
5515 * @out_of_order_arp_rsp_drop_cnt: out of order count
5516 * @dad_detected: dad detected
5517 * @connect_status: connection status
5518 * @ba_session_establishment_status: BA session status
Poddar, Siddarth465330e2018-01-08 18:23:54 +05305519 * @connect_stats_present: connectivity stats present or not
5520 * @tcp_ack_recvd: tcp syn ack's count
5521 * @icmpv4_rsp_recvd: icmpv4 responses count
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05305522 */
5523struct rsp_stats {
5524 uint32_t vdev_id;
5525 uint32_t arp_req_enqueue;
5526 uint32_t arp_req_tx_success;
5527 uint32_t arp_req_tx_failure;
5528 uint32_t arp_rsp_recvd;
5529 uint32_t out_of_order_arp_rsp_drop_cnt;
5530 uint32_t dad_detected;
5531 uint32_t connect_status;
5532 uint32_t ba_session_establishment_status;
Poddar, Siddarth465330e2018-01-08 18:23:54 +05305533 bool connect_stats_present;
5534 uint32_t tcp_ack_recvd;
5535 uint32_t icmpv4_rsp_recvd;
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05305536};
5537
5538/**
5539 * struct set_arp_stats_params - set/reset arp stats
5540 * @vdev_id: session id
5541 * @flag: enable/disable stats
5542 * @pkt_type: type of packet(1 - arp)
5543 * @ip_addr: subnet ipv4 address in case of encrypted packets
Poddar, Siddarth465330e2018-01-08 18:23:54 +05305544 * @pkt_type_bitmap: pkt bitmap
5545 * @tcp_src_port: tcp src port for pkt tracking
5546 * @tcp_dst_port: tcp dst port for pkt tracking
5547 * @icmp_ipv4: target ipv4 address to track ping packets
5548 * @reserved: reserved
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05305549 */
5550struct set_arp_stats_params {
5551 uint32_t vdev_id;
5552 uint8_t flag;
5553 uint8_t pkt_type;
5554 uint32_t ip_addr;
Poddar, Siddarth465330e2018-01-08 18:23:54 +05305555 uint32_t pkt_type_bitmap;
5556 uint32_t tcp_src_port;
5557 uint32_t tcp_dst_port;
5558 uint32_t icmp_ipv4;
5559 uint32_t reserved;
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05305560};
5561
5562/**
5563 * struct get_arp_stats_params - get arp stats from firmware
5564 * @pkt_type: packet type(1 - ARP)
5565 * @vdev_id: session id
5566 */
5567struct get_arp_stats_params {
5568 uint8_t pkt_type;
5569 uint32_t vdev_id;
5570};
5571
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05305572typedef void (*sme_rcpi_callback)(void *context, struct qdf_mac_addr mac_addr,
5573 int32_t rcpi, QDF_STATUS status);
5574/**
5575 * struct sme_rcpi_req - structure for querying rcpi info
5576 * @session_id: session for which rcpi is required
5577 * @measurement_type: type of measurement from enum rcpi_measurement_type
5578 * @rcpi_callback: callback function to be invoked for rcpi response
5579 * @rcpi_context: context info for rcpi callback
5580 * @mac_addr: peer addr for which rcpi is required
5581 */
5582struct sme_rcpi_req {
5583 uint32_t session_id;
5584 enum rcpi_measurement_type measurement_type;
5585 sme_rcpi_callback rcpi_callback;
5586 void *rcpi_context;
5587 struct qdf_mac_addr mac_addr;
5588};
5589
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08005590/*
5591 * @SCAN_REJECT_DEFAULT: default value
5592 * @CONNECTION_IN_PROGRESS: connection is in progress
5593 * @REASSOC_IN_PROGRESS: reassociation is in progress
5594 * @EAPOL_IN_PROGRESS: STA/P2P-CLI is in middle of EAPOL/WPS exchange
5595 * @SAP_EAPOL_IN_PROGRESS: SAP/P2P-GO is in middle of EAPOL/WPS exchange
Bala Venkatesh23561582019-09-03 17:45:45 +05305596 * @SAP_CONNECTION_IN_PROGRESS: SAP/P2P-GO is in middle of connection.
Srinivas Dasarib24bdd32019-11-22 18:41:15 +05305597 * @NAN_ENABLE_DISABLE_IN_PROGRESS: NAN is in middle of enable/disable discovery
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08005598 */
5599enum scan_reject_states {
5600 SCAN_REJECT_DEFAULT = 0,
5601 CONNECTION_IN_PROGRESS,
5602 REASSOC_IN_PROGRESS,
5603 EAPOL_IN_PROGRESS,
5604 SAP_EAPOL_IN_PROGRESS,
Bala Venkatesh23561582019-09-03 17:45:45 +05305605 SAP_CONNECTION_IN_PROGRESS,
Srinivas Dasarib24bdd32019-11-22 18:41:15 +05305606 NAN_ENABLE_DISABLE_IN_PROGRESS,
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08005607};
Sandeep Puligillaf587adf2017-04-27 19:53:21 -07005608
5609/**
lifeng66831662017-05-19 16:01:35 +08005610 * sir_sme_rx_aggr_hole_ind - sme rx aggr hole indication
5611 * @hole_cnt: num of holes detected
5612 * @hole_info_array: hole info
5613 */
5614struct sir_sme_rx_aggr_hole_ind {
5615 uint32_t hole_cnt;
5616 uint32_t hole_info_array[];
5617};
5618
5619/**
5620 * struct sir_set_rx_reorder_timeout_val - rx reorder timeout
5621 * @rx_timeout_pri: reorder timeout for AC
5622 * rx_timeout_pri[0] : AC_VO
5623 * rx_timeout_pri[1] : AC_VI
5624 * rx_timeout_pri[2] : AC_BE
5625 * rx_timeout_pri[3] : AC_BK
5626 */
5627struct sir_set_rx_reorder_timeout_val {
5628 uint32_t rx_timeout_pri[4];
5629};
5630
5631/**
5632 * struct sir_peer_set_rx_blocksize - set rx blocksize
5633 * @vdev_id: vdev id
5634 * @peer_macaddr: peer mac address
5635 * @rx_block_ack_win_limit: windows size limitation
5636 */
5637struct sir_peer_set_rx_blocksize {
5638 uint32_t vdev_id;
5639 struct qdf_mac_addr peer_macaddr;
5640 uint32_t rx_block_ack_win_limit;
5641};
Abhishek Singhf3756fc2017-06-28 16:04:06 +05305642
5643/**
5644 * struct sir_rssi_disallow_lst - Structure holding Rssi based avoid candidate
5645 * list
5646 * @node: Node pointer
5647 * @bssid: BSSID of the AP
5648 * @retry_delay: Retry delay received during last rejection in ms
5649 * @ expected_rssi: RSSI at which STA can initate
5650 * @time_during_rejection: Timestamp during last rejection in millisec
Utkarsh Bhatnagar00f4a782020-07-28 18:28:02 +05305651 * @reject_reason: reason to add the BSSID to BLM
5652 * @source: Source of adding the BSSID to BLM
5653 * @original_timeout: original timeout sent by the AP
5654 * @received_time: Timestamp when the AP was added to the Blacklist
Abhishek Singhf3756fc2017-06-28 16:04:06 +05305655 */
5656struct sir_rssi_disallow_lst {
5657 qdf_list_node_t node;
5658 struct qdf_mac_addr bssid;
5659 uint32_t retry_delay;
5660 int8_t expected_rssi;
5661 qdf_time_t time_during_rejection;
Utkarsh Bhatnagar00f4a782020-07-28 18:28:02 +05305662 enum blm_reject_ap_reason reject_reason;
5663 enum blm_reject_ap_source source;
5664 uint32_t original_timeout;
5665 qdf_time_t received_time;
Abhishek Singhf3756fc2017-06-28 16:04:06 +05305666};
lifengd217d192017-05-09 19:44:16 +08005667
5668/**
5669 * struct chain_rssi_result - chain rssi result
Jeff Johnson00634ab2018-05-10 14:27:50 -07005670 * num_chains_valid: valid chain num
lifengd217d192017-05-09 19:44:16 +08005671 * @chain_rssi: chain rssi result as dBm unit
stonez396a9732019-01-16 12:29:16 +08005672 * @chain_evm: error vector magnitude
lifengfe6c3e22018-04-03 12:10:04 +08005673 * @ant_id: antenna id
lifengd217d192017-05-09 19:44:16 +08005674 */
lifengfe6c3e22018-04-03 12:10:04 +08005675#define CHAIN_MAX_NUM 8
lifengd217d192017-05-09 19:44:16 +08005676struct chain_rssi_result {
lifengfe6c3e22018-04-03 12:10:04 +08005677 uint32_t num_chains_valid;
5678 uint32_t chain_rssi[CHAIN_MAX_NUM];
stonez396a9732019-01-16 12:29:16 +08005679 int32_t chain_evm[CHAIN_MAX_NUM];
lifengfe6c3e22018-04-03 12:10:04 +08005680 uint32_t ant_id[CHAIN_MAX_NUM];
lifengd217d192017-05-09 19:44:16 +08005681};
5682
5683/**
5684 * struct get_chain_rssi_req_params - get chain rssi req params
5685 * @peer_macaddr: specific peer mac address
5686 * @session_id: session id
5687 */
5688struct get_chain_rssi_req_params {
5689 struct qdf_mac_addr peer_macaddr;
5690 uint8_t session_id;
5691};
5692
Ganesh Kondabattini35739572017-06-21 16:26:39 +05305693/*
5694 * struct sir_limit_off_chan - limit off-channel command parameters
5695 * @vdev_id: vdev id
5696 * @is_tos_active: status of the traffic (active/inactive)
5697 * @max_off_chan_time: max allowed off channel time
5698 * @rest_time: home channel time
5699 * @skip_dfs_chans: skip dfs channels during scan
5700 */
5701struct sir_limit_off_chan {
5702 uint8_t vdev_id;
5703 bool is_tos_active;
5704 uint32_t max_off_chan_time;
5705 uint32_t rest_time;
5706 bool skip_dfs_chans;
5707};
Padma, Santhosh Kumarb38ab512018-01-16 16:16:46 +05305708
Rajeev Kumar Sirasanagandla4f20b672018-03-12 13:52:50 +05305709typedef void (*roam_scan_stats_cb)(void *context,
5710 struct wmi_roam_scan_stats_res *res);
5711
5712/**
5713 * struct sir_roam_scan_stats - Stores roam scan context
5714 * @vdev_id: vdev id
5715 * @cb: callback to be invoked for roam scan stats response
5716 * @context: context of callback
5717 */
5718struct sir_roam_scan_stats {
5719 uint32_t vdev_id;
5720 roam_scan_stats_cb cb;
5721 void *context;
5722};
5723
Padma, Santhosh Kumarb38ab512018-01-16 16:16:46 +05305724/**
5725 * struct sae_info - SAE info used for commit/confirm messages
5726 * @msg_type: Message type
5727 * @msg_len: length of message
5728 * @vdev_id: vdev id
5729 * @peer_mac_addr: peer MAC address
5730 * @ssid: SSID
5731 */
5732struct sir_sae_info {
5733 uint16_t msg_type;
5734 uint16_t msg_len;
5735 uint32_t vdev_id;
5736 struct qdf_mac_addr peer_mac_addr;
5737 tSirMacSSid ssid;
5738};
Padma, Santhosh Kumardd3f4852018-01-16 18:51:51 +05305739
5740/**
5741 * struct sir_sae_msg - SAE msg used for message posting
5742 * @message_type: message type
5743 * @length: message length
Abhishek Singhefe21e62019-09-20 10:03:24 +05305744 * @vdev_id: vdev id
Padma, Santhosh Kumardd3f4852018-01-16 18:51:51 +05305745 * @sae_status: SAE status, 0: Success, Non-zero: Failure.
Srinivas Dasarie854ff02019-02-11 17:24:48 +05305746 * @peer_mac_addr: peer MAC address
Padma, Santhosh Kumardd3f4852018-01-16 18:51:51 +05305747 */
5748struct sir_sae_msg {
5749 uint16_t message_type;
5750 uint16_t length;
Abhishek Singhefe21e62019-09-20 10:03:24 +05305751 uint16_t vdev_id;
Padma, Santhosh Kumardd3f4852018-01-16 18:51:51 +05305752 uint8_t sae_status;
Srinivas Dasarie854ff02019-02-11 17:24:48 +05305753 tSirMacAddr peer_mac_addr;
Padma, Santhosh Kumardd3f4852018-01-16 18:51:51 +05305754};
5755
Varun Reddy Yeturu951de5d2018-09-10 21:36:22 -07005756/**
5757 * struct set_pcl_req - Request message to set the PCL
5758 * @chan_weights: PCL channel weights
bings2e8c62b2019-10-29 18:57:33 +08005759 * @band_mask: Supported band mask
Varun Reddy Yeturu951de5d2018-09-10 21:36:22 -07005760 */
5761struct set_pcl_req {
5762 struct wmi_pcl_chan_weights chan_weights;
bings2e8c62b2019-10-29 18:57:33 +08005763 uint32_t band_mask;
Varun Reddy Yeturu951de5d2018-09-10 21:36:22 -07005764};
5765
Visweswara Tanuku41d21c02019-10-25 14:51:59 +05305766#ifdef WLAN_FEATURE_MOTION_DETECTION
Visweswara Tanuku633976b2019-01-07 16:13:12 +05305767/**
5768 * struct sir_md_evt - motion detection event status
5769 * @vdev_id: vdev id
5770 * @status: md event status
5771 */
Visweswara Tanuku633976b2019-01-07 16:13:12 +05305772struct sir_md_evt {
5773 uint8_t vdev_id;
5774 uint32_t status;
5775};
Visweswara Tanuku41d21c02019-10-25 14:51:59 +05305776
5777/**
5778 * struct sir_md_bl_evt - motion detection baseline event values
5779 * @vdev_id: vdev id
5780 * @bl_baseline_value: baseline correlation value calculated during baselining
5781 * @bl_max_corr_reserved: max corr value obtained during baselining phase in %
5782 * @bl_min_corr_reserved: min corr value obtained during baselining phase in %
5783 */
5784struct sir_md_bl_evt {
5785 uint8_t vdev_id;
5786 uint32_t bl_baseline_value;
5787 uint32_t bl_max_corr_reserved;
5788 uint32_t bl_min_corr_reserved;
5789};
Visweswara Tanuku633976b2019-01-07 16:13:12 +05305790#endif /* WLAN_FEATURE_MOTION_DETECTION */
Arun Kumar Khandavallideda5a82019-03-11 15:32:19 +05305791
5792#ifdef WLAN_MWS_INFO_DEBUGFS
5793/**
5794 * struct sir_get_mws_coex_info - Get MWS coex info
5795 * @vdev_id: vdev id
5796 * @cmd_id: wmi mws-coex command IDs
5797 */
5798struct sir_get_mws_coex_info {
5799 uint32_t vdev_id;
5800 uint32_t cmd_id;
5801};
5802#endif /* WLAN_MWS_INFO_DEBUGFS */
Subrat Dashe1f1da82019-10-21 15:54:15 +05305803
5804/*
5805 * struct sir_update_session_txq_edca_param
5806 * @message_type: SME message type
5807 * @length: size of struct sir_update_session_txq_edca_param
5808 * @vdev_id: vdev ID
5809 * @txq_edca_params: txq edca parameter to update
5810 */
5811struct sir_update_session_txq_edca_param {
5812 uint16_t message_type;
5813 uint16_t length;
5814 uint8_t vdev_id;
5815 tSirMacEdcaParamRecord txq_edca_params;
5816};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005817#endif /* __SIR_API_H */