blob: 9402d8187b59facb7e3b75fa784105dea440fb3b [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Abhishek Singh5432c352019-01-02 17:11:44 +05302 * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18
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"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080051
52#define OFFSET_OF(structType, fldName) (&((structType *)0)->fldName)
53
54/* / Max supported channel list */
55#define SIR_MAX_SUPPORTED_CHANNEL_LIST 96
Wu Gao0821b0d2019-01-11 17:31:11 +080056#define CFG_VALID_CHANNEL_LIST_LEN 100
Wu Gaoaa155142019-01-14 15:09:26 +080057#define CFG_COUNTRY_CODE_LEN 3
58
Srinivas Girigowdad65dc5a2016-01-14 17:08:26 -080059#define SIR_MDIE_SIZE 3 /* MD ID(2 bytes), Capability(1 byte) */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080060
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +053061#define SIR_MAX_ELEMENT_ID 255
62
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080063#define SIR_BCN_REPORT_MAX_BSS_DESC 4
64
65#define SIR_NUM_11B_RATES 4 /* 1,2,5.5,11 */
66#define SIR_NUM_11A_RATES 8 /* 6,9,12,18,24,36,48,54 */
67
Srinivas Girigowdad1e45b82019-04-15 15:08:28 -070068typedef uint8_t tSirIpv4Addr[QDF_IPV4_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080069
70#define SIR_VERSION_STRING_LEN 64
71typedef uint8_t tSirVersionString[SIR_VERSION_STRING_LEN];
72
73/* Periodic Tx pattern offload feature */
74#define PERIODIC_TX_PTRN_MAX_SIZE 1536
75#define MAXNUM_PERIODIC_TX_PTRNS 6
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080076
Abhishek Singhd1f21c72019-01-21 15:16:34 +053077
78/* FW response timeout values in milli seconds */
79#define SIR_PEER_ASSOC_TIMEOUT (2000) /* 1 seconds */
80#define SIR_DELETE_STA_TIMEOUT (2000) /* 2 seconds */
81#define SIR_VDEV_START_REQUEST_TIMEOUT (6000)
82#define SIR_VDEV_STOP_REQUEST_TIMEOUT (2000)
83#define SIR_VDEV_PLCY_MGR_TIMEOUT (2000)
84
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080085/* This should not be greater than MAX_NUMBER_OF_CONC_CONNECTIONS */
86#define MAX_VDEV_SUPPORTED 4
87
Manjeet Singhf82ed072016-07-08 11:40:00 +053088#define MAX_POWER_DBG_ARGS_SUPPORTED 8
Agrawal Ashishad16bda2016-09-16 20:16:04 +053089#define QOS_MAP_MAX_EX 21
90#define QOS_MAP_LEN_MIN 16
91#define QOS_MAP_LEN_MAX \
92 (QOS_MAP_LEN_MIN + 2 * QOS_MAP_MAX_EX)
Himanshu Agarwal37e42412016-07-21 14:35:09 +053093#define NUM_CHAINS_MAX 2
94
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +053095/* Maximum number of realms present in fils indication element */
96#define SIR_MAX_REALM_COUNT 7
97/* Realm length */
98#define SIR_REALM_LEN 2
99/* Cache ID length */
100#define CACHE_ID_LEN 2
101
Will Huang496b36c2017-07-11 16:38:50 +0800102/* Maximum peer station number query one time */
103#define MAX_PEER_STA 12
104
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -0800105/* Maximum number of peers for SAP */
Rachit Kankane154559c2018-07-12 14:02:30 +0530106#ifndef SIR_SAP_MAX_NUM_PEERS
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -0800107#define SIR_SAP_MAX_NUM_PEERS 32
Rachit Kankane154559c2018-07-12 14:02:30 +0530108#endif
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -0800109
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800110#define SIR_KRK_KEY_LEN 16
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800111#define SIR_BTK_KEY_LEN 32
112#define SIR_KCK_KEY_LEN 16
Pragaspathi Thilagarajeb367282019-02-19 00:42:28 +0530113#define KCK_192BIT_KEY_LEN 24
114#define KCK_256BIT_KEY_LEN 32
115
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800116#define SIR_KEK_KEY_LEN 16
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +0530117#define SIR_KEK_KEY_LEN_FILS 64
Pragaspathi Thilagarajeb367282019-02-19 00:42:28 +0530118#define KEK_256BIT_KEY_LEN 32
119
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800120#define SIR_REPLAY_CTR_LEN 8
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +0530121#define SIR_PMK_LEN 48
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -0800122#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800123#define SIR_UAPSD_BITOFFSET_ACVO 0
124#define SIR_UAPSD_BITOFFSET_ACVI 1
125#define SIR_UAPSD_BITOFFSET_ACBK 2
126#define SIR_UAPSD_BITOFFSET_ACBE 3
127
128#define SIR_UAPSD_FLAG_ACVO (1 << SIR_UAPSD_BITOFFSET_ACVO)
129#define SIR_UAPSD_FLAG_ACVI (1 << SIR_UAPSD_BITOFFSET_ACVI)
130#define SIR_UAPSD_FLAG_ACBK (1 << SIR_UAPSD_BITOFFSET_ACBK)
131#define SIR_UAPSD_FLAG_ACBE (1 << SIR_UAPSD_BITOFFSET_ACBE)
132#define SIR_UAPSD_GET(ac, mask) (((mask) & (SIR_UAPSD_FLAG_ ## ac)) >> SIR_UAPSD_BITOFFSET_ ## ac)
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800133
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800134#endif
135
Nachiket Kukade63bb63d2018-11-21 14:42:14 +0530136struct scheduler_msg;
137
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800138/**
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700139 * enum sir_roam_op_code - Operation to be done by the callback.
140 * @SIR_ROAM_SYNCH_PROPAGATION: Propagate the new BSS info after roaming.
141 * @SIR_ROAMING_DEREGISTER_STA: Deregister the old STA after roaming.
Naveen Rawat8cc23b02016-07-14 12:22:56 -0700142 * @SIR_ROAMING_START: Firmware started roaming operation
143 * @SIR_ROAMING_ABORT: Firmware aborted roaming operation, still connected.
144 * @SIR_ROAM_SYNCH_COMPLETE: Roam sync propagation is complete.
Arif Hussain43354e62017-05-24 11:24:25 -0700145 * @SIR_ROAMING_INVOKE_FAIL: Firmware roaming failed.
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700146 */
147enum sir_roam_op_code {
148 SIR_ROAM_SYNCH_PROPAGATION = 1,
149 SIR_ROAMING_DEREGISTER_STA,
Naveen Rawat8cc23b02016-07-14 12:22:56 -0700150 SIR_ROAMING_START,
151 SIR_ROAMING_ABORT,
152 SIR_ROAM_SYNCH_COMPLETE,
Varun Reddy Yeturu04251862016-09-16 10:33:19 -0700153 SIR_ROAM_SYNCH_NAPI_OFF,
Arif Hussain43354e62017-05-24 11:24:25 -0700154 SIR_ROAMING_INVOKE_FAIL,
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700155};
156/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800157 * Module ID definitions.
158 */
159enum {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800160 SIR_HAL_MODULE_ID = 0x10,
Wu Gao55020ec2019-01-23 14:29:58 +0800161 SIR_LIM_MODULE_ID = 0x13,
Jeff Johnsona2f8e8f2018-12-30 18:06:58 -0800162 SIR_SME_MODULE_ID,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800163};
164
165#define SIR_WMA_MODULE_ID SIR_HAL_MODULE_ID
166
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800167/* Type declarations used by Firmware and Host software */
168
169/* Scan type enum used in scan request */
170typedef enum eSirScanType {
171 eSIR_PASSIVE_SCAN,
172 eSIR_ACTIVE_SCAN,
173 eSIR_BEACON_TABLE,
174} tSirScanType;
175
gaurank kathpaliac63859d2018-05-03 18:48:41 +0530176/* Rsn Capabilities structure */
177struct rsn_caps {
178 uint16_t PreAuthSupported:1;
179 uint16_t NoPairwise:1;
180 uint16_t PTKSAReplayCounter:2;
181 uint16_t GTKSAReplayCounter:2;
182 uint16_t MFPRequired:1;
183 uint16_t MFPCapable:1;
184 uint16_t Reserved:8;
185};
186
Abhinav Kumar4d1f9f42019-05-07 13:14:49 +0530187/**
188 * struct wlan_beacon_report - Beacon info to be send to userspace
189 * @ssid: ssid present in beacon
190 * @bssid: bssid present in beacon
191 * @frequency: channel frequency in MHz
192 * @beacon_interval: Interval between two consecutive beacons
193 * @time_stamp: time stamp at which beacon received from AP
194 * @boot_time: Boot time when beacon received
195 */
196struct wlan_beacon_report {
197 struct wlan_ssid ssid;
198 struct qdf_mac_addr bssid;
199 uint32_t frequency;
200 uint16_t beacon_interval;
201 qdf_time_t time_stamp;
202 qdf_time_t boot_time;
203};
204
205
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800206/* / Result codes Firmware return to Host SW */
207typedef enum eSirResultCodes {
208 eSIR_SME_SUCCESS,
Abhishek Singh4294f802017-08-10 16:37:07 +0530209 eSIR_LOGE_EXCEPTION,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800210 eSIR_SME_INVALID_PARAMETERS = 500,
211 eSIR_SME_UNEXPECTED_REQ_RESULT_CODE,
212 eSIR_SME_RESOURCES_UNAVAILABLE,
213 /* Unable to find a BssDescription */
214 eSIR_SME_SCAN_FAILED,
215 /* matching requested scan criteria */
216 eSIR_SME_BSS_ALREADY_STARTED_OR_JOINED,
217 eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE,
218 eSIR_SME_REFUSED,
219 eSIR_SME_JOIN_DEAUTH_FROM_AP_DURING_ADD_STA,
220 eSIR_SME_JOIN_TIMEOUT_RESULT_CODE,
221 eSIR_SME_AUTH_TIMEOUT_RESULT_CODE,
222 eSIR_SME_ASSOC_TIMEOUT_RESULT_CODE,
223 eSIR_SME_REASSOC_TIMEOUT_RESULT_CODE,
224 eSIR_SME_MAX_NUM_OF_PRE_AUTH_REACHED,
225 eSIR_SME_AUTH_REFUSED,
226 eSIR_SME_INVALID_WEP_DEFAULT_KEY,
227 eSIR_SME_NO_KEY_MAPPING_KEY_FOR_PEER,
228 eSIR_SME_ASSOC_REFUSED,
229 eSIR_SME_REASSOC_REFUSED,
230 /* Recvd Deauth while join/pre-auth */
231 eSIR_SME_DEAUTH_WHILE_JOIN,
232 eSIR_SME_STA_NOT_AUTHENTICATED,
233 eSIR_SME_STA_NOT_ASSOCIATED,
234 eSIR_SME_ALREADY_JOINED_A_BSS,
235 /* Given in SME_SCAN_RSP msg */
236 eSIR_SME_MORE_SCAN_RESULTS_FOLLOW,
237 /* that more SME_SCAN_RSP */
238 /* messages are following. */
239 /* SME_SCAN_RSP message with */
240 /* eSIR_SME_SUCCESS status */
241 /* code is the last one. */
242 /* Sent in SME_JOIN/REASSOC_RSP */
243 eSIR_SME_INVALID_ASSOC_RSP_RXED,
244 /* messages upon receiving */
245 /* invalid Re/Assoc Rsp frame. */
246 /* STOP BSS triggered by MIC failures: MAC software to
247 * disassoc all stations
248 */
249 eSIR_SME_MIC_COUNTER_MEASURES,
250 /* with MIC_FAILURE reason code and perform the stop bss operation */
251 /* didn't get rsp from peer within timeout interval */
252 eSIR_SME_ADDTS_RSP_TIMEOUT,
253 /* didn't get success rsp from HAL */
254 eSIR_SME_ADDTS_RSP_FAILED,
255 /* failed to send ch switch act frm */
256 eSIR_SME_CHANNEL_SWITCH_FAIL,
257 eSIR_SME_INVALID_STATE,
258 /* SIR_HAL_SIR_HAL_INIT_SCAN_RSP returned failed status */
259 eSIR_SME_HAL_SCAN_INIT_FAILED,
260 /* SIR_HAL_END_SCAN_RSP returned failed status */
261 eSIR_SME_HAL_SCAN_END_FAILED,
262 /* SIR_HAL_FINISH_SCAN_RSP returned failed status */
263 eSIR_SME_HAL_SCAN_FINISH_FAILED,
264 /* Failed to send a message to HAL */
265 eSIR_SME_HAL_SEND_MESSAGE_FAIL,
266 /* Failed to stop the bss */
267 eSIR_SME_STOP_BSS_FAILURE,
268 eSIR_SME_WOWL_ENTER_REQ_FAILED,
269 eSIR_SME_WOWL_EXIT_REQ_FAILED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800270 eSIR_SME_FT_REASSOC_TIMEOUT_FAILURE,
271 eSIR_SME_FT_REASSOC_FAILURE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800272 eSIR_SME_SEND_ACTION_FAIL,
273 eSIR_SME_DEAUTH_STATUS,
274 eSIR_PNO_SCAN_SUCCESS,
Varun Reddy Yeturu371404b2017-11-30 15:31:35 -0800275 eSIR_SME_INVALID_SESSION,
Varun Reddy Yeturua47f08f2018-08-07 14:45:31 -0700276 eSIR_SME_PEER_CREATE_FAILED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800277 eSIR_DONOT_USE_RESULT_CODE = SIR_MAX_ENUM_SIZE
278} tSirResultCodes;
279
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +0530280#ifdef WLAN_FEATURE_FILS_SK
281struct fils_join_rsp_params {
282 uint8_t *fils_pmk;
283 uint8_t fils_pmk_len;
284 uint8_t fils_pmkid[PMKID_LEN];
285 uint8_t kek[MAX_KEK_LEN];
286 uint8_t kek_len;
287 uint8_t tk[MAX_TK_LEN];
288 uint8_t tk_len;
289 uint8_t gtk_len;
290 uint8_t gtk[MAX_GTK_LEN];
Vignesh Viswanathana1bb0922017-09-15 12:58:48 +0530291 struct qdf_mac_addr dst_mac;
292 struct qdf_mac_addr src_mac;
293 uint16_t hlp_data_len;
294 uint8_t hlp_data[FILS_MAX_HLP_DATA_LEN];
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +0530295};
296#endif
297
Krishna Kumaar Natarajanf599c6e2015-11-03 11:44:03 -0800298#define RMENABLEDCAP_MAX_LEN 5
299
300struct rrm_config_param {
301 uint8_t rrm_enabled;
302 uint8_t max_randn_interval;
303 uint8_t rm_capability[RMENABLEDCAP_MAX_LEN];
304};
305
Sreelakshmi Konamki39acb132015-12-16 13:06:22 +0530306const char *lim_bss_type_to_string(const uint16_t bss_type);
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700307/**
Jeff Johnsonecd4f212019-02-01 19:36:34 -0800308 * struct supported_rates - stores rates/MCS supported
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700309 * @llbRates: 11b rates in unit of 500kbps
310 * @llaRates: 11a rates in unit of 500kbps
311 * @supportedMCSSet: supported basic MCS, 0-76 bits used, remaining reserved
312 * bits 0-15 and 32 should be set.
313 * @rxHighestDataRate: RX Highest Supported Data Rate defines the highest data
314 * rate that the STA is able to receive, in unites of 1Mbps
315 * This value is derived from "Supported MCS Set field"
316 * inside the HT capability element.
317 * @vhtRxMCSMap: Indicates the Maximum MCS(VHT) that can be received for each
318 * number of spacial streams
319 * @vhtRxHighestDataRate: Indicate the highest VHT data rate that the STA is
320 * able to receive
321 * @vhtTxMCSMap: Indicates the Maximum MCS(VHT) that can be transmitted for
322 * each number of spacial streams
323 * @vhtTxHighestDataRate: Indicate the highest VHT data rate that the STA is
324 * able to transmit
325 * @he_rx_mcs: Indicates the Maximum MCS(HE) that can be received for each
326 * number of spacial streams
327 * @he_tx_mcs: Indicates the Maximum MCS(HE) that can be transmitted for each
328 * number of spacial streams
329 */
Jeff Johnsonecd4f212019-02-01 19:36:34 -0800330struct supported_rates {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800331 uint16_t llbRates[SIR_NUM_11B_RATES];
332 uint16_t llaRates[SIR_NUM_11A_RATES];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800333 uint8_t supportedMCSSet[SIR_MAC_MAX_SUPPORTED_MCS_SET];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800334 uint16_t rxHighestDataRate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800335 uint16_t vhtRxMCSMap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800336 uint16_t vhtRxHighestDataRate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800337 uint16_t vhtTxMCSMap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800338 uint16_t vhtTxHighestDataRate;
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700339#ifdef WLAN_FEATURE_11AX
Naveen Rawataeca1b92017-10-16 16:55:31 -0700340 uint16_t rx_he_mcs_map_lt_80;
341 uint16_t tx_he_mcs_map_lt_80;
342 uint16_t rx_he_mcs_map_160;
343 uint16_t tx_he_mcs_map_160;
344 uint16_t rx_he_mcs_map_80_80;
345 uint16_t tx_he_mcs_map_80_80;
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700346#endif
Jeff Johnsonecd4f212019-02-01 19:36:34 -0800347};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800348
Jeff Johnson78f7a182019-02-01 22:45:41 -0800349struct register_mgmt_frame {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800350 uint16_t messageType;
351 uint16_t length;
352 uint8_t sessionId;
353 bool registerFrame;
354 uint16_t frameType;
355 uint16_t matchLen;
356 uint8_t matchData[1];
Jeff Johnson78f7a182019-02-01 22:45:41 -0800357};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800358
359/* / Generic type for sending a response message */
360/* / with result code to host software */
361typedef struct sSirSmeRsp {
362 uint16_t messageType; /* eWNI_SME_*_RSP */
363 uint16_t length;
Jeff Johnson41485c22019-02-21 11:00:30 -0800364 uint8_t sessionId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800365 tSirResultCodes statusCode;
Kabilan Kannanf56f9d52017-04-05 03:31:34 -0700366 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800367} tSirSmeRsp, *tpSirSmeRsp;
368
369/* / Definition for indicating all modules ready on STA */
Jeff Johnson47e4b552019-02-01 23:12:25 -0800370struct sme_ready_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800371 uint16_t messageType; /* eWNI_SME_SYS_READY_IND */
372 uint16_t length;
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800373 void *csr_roam_synch_cb;
374 void *pe_roam_synch_cb;
Vignesh Viswanathan3d478032018-08-02 20:18:53 +0530375 void *stop_roaming_cb;
Jeff Johnsone044f202018-12-02 10:27:28 -0800376 QDF_STATUS (*sme_msg_cb)(struct mac_context *mac,
Jeff Johnson5f9ce2d2018-06-09 21:20:45 -0700377 struct scheduler_msg *msg);
Pragaspathi Thilagarajb0176502019-04-26 02:33:13 +0530378 QDF_STATUS (*pe_disconnect_cb) (struct mac_context *mac,
379 uint8_t vdev_id);
Jeff Johnson47e4b552019-02-01 23:12:25 -0800380};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800381
382/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800383 * struct s_sir_set_hw_mode - Set HW mode request
384 * @messageType: Message type
385 * @length: Length of the message
386 * @set_hw: Params containing the HW mode index and callback
387 */
388struct s_sir_set_hw_mode {
389 uint16_t messageType;
390 uint16_t length;
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -0800391 struct policy_mgr_hw_mode set_hw;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800392};
393
394/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800395 * struct sir_set_dual_mac_cfg - Set Dual mac config request
396 * @message_type: Message type
397 * @length: Length of the message
398 * @set_dual_mac: Params containing the dual mac config and callback
399 */
400struct sir_set_dual_mac_cfg {
401 uint16_t message_type;
402 uint16_t length;
Srinivas Girigowdaeb6ecf32018-02-15 17:04:22 -0800403 struct policy_mgr_dual_mac_config set_dual_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800404};
405
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800406/**
407 * struct sir_antenna_mode_param - antenna mode param
408 * @num_tx_chains: Number of TX chains
409 * @num_rx_chains: Number of RX chains
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800410 * @set_antenna_mode_resp: callback to set antenna mode command
Dundi Raviteja6bb9e322018-05-16 17:04:41 +0530411 * @set_antenna_mode_ctx: callback context to set antenna mode command
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800412 */
413struct sir_antenna_mode_param {
414 uint32_t num_tx_chains;
415 uint32_t num_rx_chains;
416 void *set_antenna_mode_resp;
Dundi Raviteja6bb9e322018-05-16 17:04:41 +0530417 void *set_antenna_mode_ctx;
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800418};
419
420/**
421 * struct sir_set_antenna_mode - Set antenna mode request
422 * @message_type: Message type
423 * @length: Length of the message
424 * @set_antenna_mode: Params containing antenna mode params
425 */
426struct sir_set_antenna_mode {
427 uint16_t message_type;
428 uint16_t length;
429 struct sir_antenna_mode_param set_antenna_mode;
430};
431
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700432/**
Pragaspathi Thilagarajafd0a482019-05-23 13:02:36 +0530433 * enum bss_type - Enum for BSS type used in scanning/joining etc.
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700434 *
435 * @eSIR_INFRASTRUCTURE_MODE: Infrastructure station
436 * @eSIR_INFRA_AP_MODE: softAP mode
437 * @eSIR_IBSS_MODE: IBSS mode
438 * @eSIR_AUTO_MODE: Auto role
439 * @eSIR_MONITOR_MODE: Monitor mode
440 * @eSIR_NDI_MODE: NAN datapath mode
441 */
Pragaspathi Thilagarajafd0a482019-05-23 13:02:36 +0530442enum bss_type {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800443 eSIR_INFRASTRUCTURE_MODE,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700444 eSIR_INFRA_AP_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800445 eSIR_IBSS_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800446 eSIR_AUTO_MODE,
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -0700447 eSIR_MONITOR_MODE,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700448 eSIR_NDI_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800449 eSIR_DONOT_USE_BSS_TYPE = SIR_MAX_ENUM_SIZE
Pragaspathi Thilagarajafd0a482019-05-23 13:02:36 +0530450};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800451
452/* / Power Capability info used in 11H */
Jeff Johnson39f02ae2019-02-01 23:42:38 -0800453struct power_cap_info {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800454 uint8_t minTxPower;
455 uint8_t maxTxPower;
Jeff Johnson39f02ae2019-02-01 23:42:38 -0800456};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800457
458/* / Supported Channel info used in 11H */
Jeff Johnsoned4f4d52019-02-02 00:09:45 -0800459struct supported_channels {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800460 uint8_t numChnl;
461 uint8_t channelList[SIR_MAX_SUPPORTED_CHANNEL_LIST];
Jeff Johnsoned4f4d52019-02-02 00:09:45 -0800462};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800463
464typedef enum eSirNwType {
465 eSIR_11A_NW_TYPE,
466 eSIR_11B_NW_TYPE,
467 eSIR_11G_NW_TYPE,
468 eSIR_11N_NW_TYPE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800469 eSIR_11AC_NW_TYPE,
Krishna Kumaar Natarajan4f1d7722017-03-03 21:12:51 -0800470 eSIR_11AX_NW_TYPE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800471 eSIR_DONOT_USE_NW_TYPE = SIR_MAX_ENUM_SIZE
472} tSirNwType;
473
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800474/* HT configuration values */
Jeff Johnson72ac2c82019-02-02 12:26:35 -0800475struct ht_config {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800476 /* Enable/Disable receiving LDPC coded packets */
477 uint32_t ht_rx_ldpc:1;
478 /* Enable/Disable TX STBC */
479 uint32_t ht_tx_stbc:1;
480 /* Enable/Disable RX STBC */
481 uint32_t ht_rx_stbc:2;
482 /* Enable/Disable SGI */
Sandeep Puligilla607f34a2016-05-25 14:37:47 -0700483 uint32_t ht_sgi20:1;
484 uint32_t ht_sgi40:1;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800485 uint32_t unused:27;
Jeff Johnson72ac2c82019-02-02 12:26:35 -0800486};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800487
Sandeep Puligilla98917432016-06-10 13:50:28 -0700488/**
Jeff Johnson118a4a02018-05-06 00:14:15 -0700489 * struct sir_vht_config - VHT capabilities
Sandeep Puligilla98917432016-06-10 13:50:28 -0700490 * @max_mpdu_len: MPDU length
491 * @supported_channel_widthset: channel width set
492 * @ldpc_coding: LDPC coding capability
493 * @shortgi80: short GI 80 support
494 * @shortgi160and80plus80: short Gi 160 & 80+80 support
495 * @tx_stbc; Tx STBC cap
496 * @tx_stbc: Rx STBC cap
497 * @su_beam_former: SU beam former cap
498 * @su_beam_formee: SU beam formee cap
499 * @csnof_beamformer_antSup: Antenna support for beamforming
500 * @num_soundingdim: Sound dimensions
501 * @mu_beam_former: MU beam former cap
502 * @mu_beam_formee: MU beam formee cap
503 * @vht_txops: TXOP power save
504 * @htc_vhtcap: HTC VHT capability
505 * @max_ampdu_lenexp: AMPDU length
506 * @vht_link_adapt: VHT link adapatation capable
507 * @rx_antpattern: Rx Antenna pattern
508 * @tx_antpattern: Tx Antenna pattern
509 */
510struct sir_vht_config {
511 uint32_t max_mpdu_len:2;
512 uint32_t supported_channel_widthset:2;
513 uint32_t ldpc_coding:1;
514 uint32_t shortgi80:1;
515 uint32_t shortgi160and80plus80:1;
516 uint32_t tx_stbc:1;
517 uint32_t rx_stbc:3;
518 uint32_t su_beam_former:1;
519 uint32_t su_beam_formee:1;
520 uint32_t csnof_beamformer_antSup:3;
521 uint32_t num_soundingdim:3;
522 uint32_t mu_beam_former:1;
523 uint32_t mu_beam_formee:1;
524 uint32_t vht_txops:1;
525 uint32_t htc_vhtcap:1;
526 uint32_t max_ampdu_lenexp:3;
527 uint32_t vht_link_adapt:2;
528 uint32_t rx_antpattern:1;
529 uint32_t tx_antpattern:1;
530 uint32_t unused:2;
531};
532
533
Jeff Johnson90542e52019-02-02 13:59:56 -0800534struct add_ie_params {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800535 uint16_t probeRespDataLen;
536 uint8_t *probeRespData_buff;
537 uint16_t assocRespDataLen;
538 uint8_t *assocRespData_buff;
539 uint16_t probeRespBCNDataLen;
540 uint8_t *probeRespBCNData_buff;
Jeff Johnson90542e52019-02-02 13:59:56 -0800541};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800542
543/* / Definition for kick starting BSS */
544/* / ---> MAC */
545/**
546 * Usage of ssId, numSSID & ssIdList:
547 * ---------------------------------
548 * 1. ssId.length of zero indicates that Broadcast/Suppress SSID
549 * feature is enabled.
550 * 2. If ssId.length is zero, MAC SW will advertise NULL SSID
551 * and interpret the SSID list from numSSID & ssIdList.
552 * 3. If ssId.length is non-zero, MAC SW will advertise the SSID
553 * specified in the ssId field and it is expected that
554 * application will set numSSID to one (only one SSID present
555 * in the list) and SSID in the list is same as ssId field.
556 * 4. Application will always set numSSID >= 1.
557 */
558/* ***** NOTE: Please make sure all codes are updated if inserting field into
559 * this structure..********** */
Jeff Johnson704b8912019-02-02 14:38:14 -0800560struct start_bss_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800561 uint16_t messageType; /* eWNI_SME_START_BSS_REQ */
562 uint16_t length;
Jeff Johnson50d3ae62019-02-21 11:18:11 -0800563 uint8_t sessionId;
564 struct qdf_mac_addr bssid;
565 struct qdf_mac_addr self_macaddr;
566 uint16_t beaconInterval;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800567 uint8_t dot11mode;
568#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
569 uint8_t cc_switch_mode;
570#endif
Pragaspathi Thilagarajafd0a482019-05-23 13:02:36 +0530571 enum bss_type bssType;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800572 tSirMacSSid ssId;
573 uint8_t channelId;
574 ePhyChanBondState cbMode;
575 uint8_t vht_channel_width;
576 uint8_t center_freq_seg0;
577 uint8_t center_freq_seg1;
578 uint8_t sec_ch_offset;
579
580 uint8_t privacy;
581 uint8_t apUapsdEnable;
582 uint8_t ssidHidden;
583 bool fwdWPSPBCProbeReq;
584 bool protEnabled;
585 bool obssProtEnabled;
586 uint16_t ht_capab;
587 tAniAuthType authType;
588 uint32_t dtimPeriod;
589 uint8_t wps_state;
590 uint8_t isCoalesingInIBSSAllowed; /* Coalesing on/off knob */
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800591 enum QDF_OPMODE bssPersona;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800592
593 uint8_t txLdpcIniFeatureEnabled;
594
595 tSirRSNie rsnIE; /* RSN IE to be sent in */
596 /* Beacon and Probe */
597 /* Response frames */
598 tSirNwType nwType; /* Indicates 11a/b/g */
599 tSirMacRateSet operationalRateSet; /* Has 11a or 11b rates */
600 tSirMacRateSet extendedRateSet; /* Has 11g rates */
Jeff Johnsonbe119e62019-02-02 12:30:26 -0800601 struct ht_config ht_config;
Sandeep Puligilla98917432016-06-10 13:50:28 -0700602 struct sir_vht_config vht_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800603#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -0700604 tDot11fIEhe_cap he_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800605#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800606#ifdef WLAN_FEATURE_11W
607 bool pmfCapable;
608 bool pmfRequired;
609#endif
610
Jeff Johnson21aac3a2019-02-02 14:26:13 -0800611 struct add_ie_params add_ie_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800612
613 bool obssEnabled;
614 uint8_t sap_dot11mc;
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800615 uint16_t beacon_tx_rate;
Kapil Gupta4b2efbb2016-10-03 13:07:20 +0530616 bool vendor_vht_sap;
Arif Hussain671a1902017-03-17 09:08:32 -0700617 uint32_t cac_duration_ms;
618 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800619
Jeff Johnson704b8912019-02-02 14:38:14 -0800620};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800621
622#define GET_IE_LEN_IN_BSS(lenInBss) (lenInBss + sizeof(lenInBss) - \
Pragaspathi Thilagaraj1112c962019-05-23 23:45:38 +0530623 ((uintptr_t)OFFSET_OF(struct bss_description,\
624 ieFields)))
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800625
626#define WSCIE_PROBE_RSP_LEN (317 + 2)
627
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530628#ifdef WLAN_FEATURE_FILS_SK
629/* struct fils_ind_elements: elements parsed from fils indication present
630 * in beacon/probe resp
631 * @realm_cnt: number of realm present
632 * @realm: realms
633 * @is_fils_sk_supported: if FILS SK supported
634 * @is_cache_id_present: if cache id present
635 * @cache_id: cache id
636 */
637struct fils_ind_elements {
638 uint16_t realm_cnt;
639 uint8_t realm[SIR_MAX_REALM_COUNT][SIR_REALM_LEN];
640 bool is_fils_sk_supported;
641 bool is_cache_id_present;
642 uint8_t cache_id[CACHE_ID_LEN];
643};
644#endif
645
Jeff Johnsone58271f2017-10-06 09:58:59 -0700646struct bss_description {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800647 /* offset of the ieFields from bssId. */
648 uint16_t length;
649 tSirMacAddr bssId;
Arun Khandavalli8a711cb2017-01-03 20:23:56 +0530650 unsigned long scansystimensec;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800651 uint32_t timeStamp[2];
652 uint16_t beaconInterval;
653 uint16_t capabilityInfo;
654 tSirNwType nwType; /* Indicates 11a/b/g */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800655 int8_t rssi;
Deepak Dhamdhere68929ec2015-08-05 15:16:35 -0700656 int8_t rssi_raw;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800657 int8_t sinr;
658 /* channelId what peer sent in beacon/probersp. */
659 uint8_t channelId;
660 /* channelId on which we are parked at. */
661 /* used only in scan case. */
662 uint8_t channelIdSelf;
663 uint8_t sSirBssDescriptionRsvd[3];
Deepthi Gowri6acee342016-10-28 15:00:38 +0530664 /* Based on system time, not a relative time. */
665 uint64_t received_time;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800666 uint32_t parentTSF;
667 uint32_t startTSF[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800668 uint8_t mdiePresent;
669 /* MDIE for 11r, picked from the beacons */
670 uint8_t mdie[SIR_MDIE_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800671#ifdef FEATURE_WLAN_ESE
672 uint16_t QBSSLoad_present;
673 uint16_t QBSSLoad_avail;
674 /* To achieve 8-byte alignment with ESE enabled */
675 uint32_t reservedPadding5;
676#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800677 /* whether it is from a probe rsp */
678 uint8_t fProbeRsp;
Deepak Dhamdhere652d7e82015-08-06 14:16:53 -0700679 /* Actual channel the beacon/probe response was received on */
680 uint8_t rx_channel;
Krishna Kumaar Natarajan89a99d42016-08-04 15:44:38 -0700681 tSirMacSeqCtl seq_ctrl;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800682 uint32_t WscIeLen;
683 uint8_t WscIeProbeRsp[WSCIE_PROBE_RSP_LEN];
684 uint8_t reservedPadding4;
685 uint32_t tsf_delta;
Sandeep Puligillad8546bb2019-02-15 10:49:38 -0800686 struct scan_mbssid_info mbssid_info;
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530687#ifdef WLAN_FEATURE_FILS_SK
688 struct fils_ind_elements fils_info_element;
689#endif
Yeshwanth Sriram Guntukaa6c3d272019-04-13 12:25:53 +0530690 uint32_t assoc_disallowed;
Pragaspathi Thilagaraj1f3f99f2019-04-24 23:48:47 +0530691 uint32_t adaptive_11r_ap;
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530692 /* Please keep the structure 4 bytes aligned above the ieFields */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800693 uint32_t ieFields[1];
Jeff Johnsone58271f2017-10-06 09:58:59 -0700694};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800695
696#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
Jeff Johnson704af112019-02-02 16:11:55 -0800697struct ht_profile {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800698 uint8_t dot11mode;
699 uint8_t htCapability;
700 uint8_t htSupportedChannelWidthSet;
701 uint8_t htRecommendedTxWidthSet;
702 ePhyChanBondState htSecondaryChannelOffset;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800703 uint8_t vhtCapability;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800704 uint8_t apCenterChan;
705 uint8_t apChanWidth;
Jeff Johnson704af112019-02-02 16:11:55 -0800706};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800707#endif
708/* / Definition for response message to previously */
709/* / issued start BSS request */
710/* / MAC ---> */
Jeff Johnsona0d34622019-02-02 17:26:19 -0800711struct start_bss_rsp {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800712 uint16_t messageType; /* eWNI_SME_START_BSS_RSP */
713 uint16_t length;
714 uint8_t sessionId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800715 tSirResultCodes statusCode;
Pragaspathi Thilagarajafd0a482019-05-23 13:02:36 +0530716 enum bss_type bssType; /* Add new type for WDS mode */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800717 uint16_t beaconInterval; /* Beacon Interval for both type */
Jeff Johnson179fd8a2018-05-11 14:20:05 -0700718 uint32_t staId; /* Station ID for Self */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800719#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
Jeff Johnsonf6541882019-02-02 16:16:00 -0800720 struct ht_profile ht_profile;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800721#endif
Pragaspathi Thilagaraj1112c962019-05-23 23:45:38 +0530722 struct bss_description bssDescription; /* Peer BSS description */
Jeff Johnsona0d34622019-02-02 17:26:19 -0800723};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800724
Jeff Johnson39f94e32019-02-02 18:11:47 -0800725struct report_channel_list {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800726 uint8_t numChannels;
727 uint8_t channelNumber[SIR_ESE_MAX_MEAS_IE_REQS];
Jeff Johnson39f94e32019-02-02 18:11:47 -0800728};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800729
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800730#ifdef FEATURE_OEM_DATA_SUPPORT
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700731struct oem_data_req {
Gupta, Kapil8a605e12016-06-08 14:14:35 +0530732 uint32_t data_len;
Krishna Kumaar Natarajan9ac8efd2015-11-20 13:40:24 -0800733 uint8_t *data;
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700734};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800735
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700736struct oem_data_rsp {
Krishna Kumaar Natarajan608291e2015-12-14 18:17:27 -0800737 uint32_t rsp_len;
Krishna Kumaar Natarajan73ea9f22016-06-30 18:38:47 -0700738 uint8_t *data;
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700739};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800740#endif /* FEATURE_OEM_DATA_SUPPORT */
741
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800742#ifdef FEATURE_WLAN_ESE
yeshwanth sriram guntuka27e4ffc2016-12-01 18:00:17 +0530743typedef struct ese_wmm_tspec_ie {
744 uint16_t traffic_type:1;
745 uint16_t tsid:4;
746 uint16_t direction:2;
747 uint16_t access_policy:2;
748 uint16_t aggregation:1;
749 uint16_t psb:1;
750 uint16_t user_priority:3;
751 uint16_t tsinfo_ack_pol:2;
752 uint8_t tsinfo_rsvd:7;
753 uint8_t burst_size_defn:1;
754 uint16_t size:15;
755 uint16_t fixed:1;
756 uint16_t max_msdu_size;
757 uint32_t min_service_int;
758 uint32_t max_service_int;
759 uint32_t inactivity_int;
760 uint32_t suspension_int;
761 uint32_t service_start_time;
762 uint32_t min_data_rate;
763 uint32_t mean_data_rate;
764 uint32_t peak_data_rate;
765 uint32_t burst_size;
766 uint32_t delay_bound;
767 uint32_t min_phy_rate;
768 uint16_t surplus_bw_allowance;
769 uint16_t medium_time;
770} qdf_packed ese_wmm_tspec_ie;
771
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800772typedef struct sTspecInfo {
773 uint8_t valid;
Jeff Johnson56471b92018-12-22 14:36:06 -0800774 struct mac_tspec_ie tspec;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800775} tTspecInfo;
776
777#define SIR_ESE_MAX_TSPEC_IES 4
778typedef struct sESETspecTspecInfo {
779 uint8_t numTspecs;
780 tTspecInfo tspec[SIR_ESE_MAX_TSPEC_IES];
781} tESETspecInfo;
782
Jeff Johnson1482ae42019-02-02 18:29:24 -0800783struct tsm_ie {
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800784 uint8_t tsid;
785 uint8_t state;
786 uint16_t msmt_interval;
Jeff Johnson1482ae42019-02-02 18:29:24 -0800787};
788
Jeff Johnsone21b0eb2019-02-02 19:31:54 -0800789struct tsm_ie_ind {
Jeff Johnson85ddb772019-02-02 19:01:52 -0800790 struct tsm_ie tsm_ie;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800791 uint8_t sessionId;
Jeff Johnsone21b0eb2019-02-02 19:31:54 -0800792};
793
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800794typedef struct sAniTrafStrmMetrics {
795 uint16_t UplinkPktQueueDly;
796 uint16_t UplinkPktQueueDlyHist[4];
797 uint32_t UplinkPktTxDly;
798 uint16_t UplinkPktLoss;
799 uint16_t UplinkPktCount;
800 uint8_t RoamingCount;
801 uint16_t RoamingDly;
802} tAniTrafStrmMetrics, *tpAniTrafStrmMetrics;
803
804typedef struct sAniGetTsmStatsReq {
805 /* Common for all types are requests */
806 uint16_t msgType; /* message type is same as the request type */
807 uint16_t msgLen; /* length of the entire request */
808 uint8_t staId;
809 uint8_t tid; /* traffic id */
810 struct qdf_mac_addr bssId;
811 void *tsmStatsCallback;
812 void *pDevContext; /* device context */
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800813} tAniGetTsmStatsReq, *tpAniGetTsmStatsReq;
814
815typedef struct sAniGetTsmStatsRsp {
816 /* Common for all types are responses */
817 uint16_t msgType; /*
818 * message type is same as
819 * the request type
820 */
821 uint16_t msgLen; /*
822 * length of the entire request,
823 * includes the pStatsBuf length too
824 */
825 uint8_t sessionId;
826 uint32_t rc; /* success/failure */
827 uint32_t staId; /*
828 * Per STA stats request must
829 * contain valid
830 */
Abhinav Kumaraa8f2df2019-01-11 20:02:26 +0530831 struct qdf_mac_addr bssid; /* bssid to get the tsm stats for */
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800832 tAniTrafStrmMetrics tsmMetrics;
833 void *tsmStatsReq; /* tsm stats request backup */
834} tAniGetTsmStatsRsp, *tpAniGetTsmStatsRsp;
835
Jeff Johnson30d3a5d2019-02-02 21:08:43 -0800836struct ese_bcn_report_bss_info {
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800837 tBcnReportFields bcnReportFields;
838 uint8_t ieLen;
839 uint8_t *pBuf;
Jeff Johnson30d3a5d2019-02-02 21:08:43 -0800840};
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800841
Jeff Johnsondda40752019-02-02 21:43:34 -0800842struct ese_bcn_report_rsp {
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800843 uint16_t measurementToken;
844 uint8_t flag; /* Flag to report measurement done and more data */
845 uint8_t numBss;
Jeff Johnson30d3a5d2019-02-02 21:08:43 -0800846 struct ese_bcn_report_bss_info
847 bcnRepBssInfo[SIR_BCN_REPORT_MAX_BSS_DESC];
Jeff Johnsondda40752019-02-02 21:43:34 -0800848};
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800849
850#define TSRS_11AG_RATE_6MBPS 0xC
851#define TSRS_11B_RATE_5_5MBPS 0xB
Jeff Johnson8a5d0ab2019-02-02 21:54:17 -0800852
853struct ese_tsrs_ie {
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800854 uint8_t tsid;
855 uint8_t rates[8];
Jeff Johnson8a5d0ab2019-02-02 21:54:17 -0800856};
857
Jeff Johnson4f340522019-02-02 22:02:52 -0800858struct ese_tsm_ie {
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800859 uint8_t tsid;
860 uint8_t state;
861 uint16_t msmt_interval;
Jeff Johnson4f340522019-02-02 22:02:52 -0800862};
863
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800864typedef struct sTSMStats {
865 uint8_t tid;
866 struct qdf_mac_addr bssid;
867 tTrafStrmMetrics tsmMetrics;
868} tTSMStats, *tpTSMStats;
869typedef struct sEseTSMContext {
870 uint8_t tid;
Jeff Johnson4f340522019-02-02 22:02:52 -0800871 struct ese_tsm_ie tsmInfo;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800872 tTrafStrmMetrics tsmMetrics;
873} tEseTSMContext, *tpEseTSMContext;
874typedef struct sEsePEContext {
875 tEseTSMContext tsm;
876} tEsePEContext, *tpEsePEContext;
877
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800878#endif /* FEATURE_WLAN_ESE */
879
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800880/* / Definition for join request */
881/* / ---> MAC */
Jeff Johnson701444f2019-02-02 22:35:13 -0800882struct join_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800883 uint16_t messageType; /* eWNI_SME_JOIN_REQ */
884 uint16_t length;
885 uint8_t sessionId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800886 tSirMacSSid ssId;
887 tSirMacAddr selfMacAddr; /* self Mac address */
Pragaspathi Thilagarajafd0a482019-05-23 13:02:36 +0530888 enum bss_type bsstype; /* add new type for BT-AMP STA and AP Modules */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800889 uint8_t dot11mode; /* to support BT-AMP */
890#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
891 uint8_t cc_switch_mode;
892#endif
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800893 enum QDF_OPMODE staPersona; /* Persona */
Abhishek Singhf78bd2d2016-04-27 16:47:56 +0530894 bool wps_registration;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800895 ePhyChanBondState cbMode; /* Pass CB mode value in Join. */
896
897 /*This contains the UAPSD Flag for all 4 AC
898 * B0: AC_VO UAPSD FLAG
899 * B1: AC_VI UAPSD FLAG
900 * B2: AC_BK UAPSD FLAG
901 * B3: AC_BE UASPD FLAG
902 */
903 uint8_t uapsdPerAcBitmask;
904
905 tSirMacRateSet operationalRateSet; /* Has 11a or 11b rates */
906 tSirMacRateSet extendedRateSet; /* Has 11g rates */
907 tSirRSNie rsnIE; /* RSN IE to be sent in */
908 /* (Re) Association Request */
909#ifdef FEATURE_WLAN_ESE
910 /* CCMK IE to be included as handler for join and reassoc is */
911 tSirCCKMie cckmIE;
912 /* the same. The join will never carry cckm, but will be set to */
913 /* 0. */
914#endif
915
916 tSirAddie addIEScan; /* Additional IE to be sent in */
917 /* (unicast) Probe Request at the time of join */
918
919 tSirAddie addIEAssoc; /* Additional IE to be sent in */
920 /* (Re) Association Request */
921
922 tAniEdType UCEncryptionType;
923
924 tAniEdType MCEncryptionType;
Pragaspathi Thilagaraj0bd369d2019-04-08 00:07:53 +0530925 enum ani_akm_type akm;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800926
927#ifdef WLAN_FEATURE_11W
928 tAniEdType MgmtEncryptionType;
929#endif
930
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700931 bool is11Rconnection;
Pragaspathi Thilagaraj1f3f99f2019-04-24 23:48:47 +0530932 bool is_adaptive_11r_connection;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800933#ifdef FEATURE_WLAN_ESE
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700934 bool isESEFeatureIniEnabled;
935 bool isESEconnection;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800936 tESETspecInfo eseTspecInfo;
937#endif
938
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700939 bool isFastTransitionEnabled;
940 bool isFastRoamIniFeatureEnabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800941
942 uint8_t txLdpcIniFeatureEnabled;
Jeff Johnsonbe119e62019-02-02 12:30:26 -0800943 struct ht_config ht_config;
Sandeep Puligilla98917432016-06-10 13:50:28 -0700944 struct sir_vht_config vht_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800945#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -0700946 tDot11fIEhe_cap he_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800947#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800948 uint8_t enableVhtpAid;
949 uint8_t enableVhtGid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800950 uint8_t enableAmpduPs;
951 uint8_t enableHtSmps;
952 uint8_t htSmps;
Archana Ramachandranfec24812016-02-16 16:31:56 -0800953 bool send_smps_action;
Kiran Kumar Lokere722dccd2018-02-23 13:23:52 -0800954 bool he_with_wep_tkip;
Deepak Dhamdhere612392c2016-08-28 02:56:51 -0700955 uint8_t max_amsdu_num;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700956 bool isWMEenabled;
957 bool isQosEnabled;
958 bool isOSENConnection;
Krishna Kumaar Natarajanf599c6e2015-11-03 11:44:03 -0800959 struct rrm_config_param rrm_config;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700960 bool spectrumMgtIndicator;
Jeff Johnson39f02ae2019-02-01 23:42:38 -0800961 struct power_cap_info powerCap;
Jeff Johnsoned4f4d52019-02-02 00:09:45 -0800962 struct supported_channels supportedChannels;
Selvaraj, Sridhar05ea0792017-05-17 12:17:03 +0530963 bool enable_bcast_probe_rsp;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +0530964#ifdef WLAN_FEATURE_FILS_SK
965 struct cds_fils_connection_info fils_con_info;
966#endif
Padma, Santhosh Kumarb8f65d92017-09-14 13:05:42 +0530967 bool sae_pmk_cached;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +0530968 /* Pls make this as last variable in struct */
Abhishek Singhb59f8d42017-07-31 14:42:47 +0530969 bool force_24ghz_in_ht20;
Abhishek Singh6454ad32017-12-20 10:42:21 +0530970 bool force_rsne_override;
Vignesh Viswanathand5a5f2e2018-06-01 15:35:51 +0530971 bool supported_nss_1x1;
972 uint8_t vdev_nss;
973 uint8_t nss;
974 bool nss_forced_1x1;
Arif Hussain6686c0b2018-08-21 18:21:05 -0700975 bool enable_session_twt_support;
Pragaspathi Thilagaraj1112c962019-05-23 23:45:38 +0530976 struct bss_description bssDescription;
Selvaraj, Sridhar81ab80d2017-06-08 12:21:39 +0530977 /*
978 * WARNING: Pls make bssDescription as last variable in struct
Jeff Johnson701444f2019-02-02 22:35:13 -0800979 * join_req as it has ieFields followed after this bss
Selvaraj, Sridhar81ab80d2017-06-08 12:21:39 +0530980 * description. Adding a variable after this corrupts the ieFields
981 */
Jeff Johnson701444f2019-02-02 22:35:13 -0800982};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800983
Jeff Johnson47d75242018-05-12 15:58:53 -0700984/* / Definition for response message to previously issued join request */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800985/* / MAC ---> */
Jeff Johnson2df04b82019-02-02 23:30:25 -0800986struct join_rsp {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800987 uint16_t messageType; /* eWNI_SME_JOIN_RSP */
988 uint16_t length;
989 uint8_t sessionId; /* Session ID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800990 tSirResultCodes statusCode;
991 tAniAuthType authType;
992 uint32_t vht_channel_width;
993 /* It holds reasonCode when join fails due to deauth/disassoc frame.
994 * Otherwise it holds status code.
995 */
996 uint16_t protStatusCode;
997 uint16_t aid;
998 uint32_t beaconLength;
999 uint32_t assocReqLength;
1000 uint32_t assocRspLength;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001001 uint32_t parsedRicRspLen;
Bala Venkateshe7f79162019-01-16 16:43:59 +05301002 uint8_t uapsd_mask;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001003#ifdef FEATURE_WLAN_ESE
1004 uint32_t tspecIeLen;
1005#endif
1006 uint32_t staId; /* Station ID for peer */
1007
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001008 /*Timing measurement capability */
1009 uint8_t timingMeasCap;
1010
1011#ifdef FEATURE_WLAN_TDLS
1012 /* TDLS prohibited and TDLS channel switch prohibited are set as
1013 * per ExtCap IE in received assoc/re-assoc response from AP
1014 */
1015 bool tdls_prohibited;
1016 bool tdls_chan_swit_prohibited;
1017#endif
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301018 uint8_t nss;
1019 uint32_t max_rate_flags;
1020
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001021#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
Jeff Johnsonf6541882019-02-02 16:16:00 -08001022 struct ht_profile ht_profile;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001023#endif
Archana Ramachandran20d2e232016-02-11 16:58:40 -08001024 bool supported_nss_1x1;
Anurag Chouhan5de8d172016-07-13 14:44:28 +05301025 tDot11fIEHTCaps ht_caps;
1026 tDot11fIEVHTCaps vht_caps;
1027 tDot11fIEHTInfo ht_operation;
1028 tDot11fIEVHTOperation vht_operation;
1029 tDot11fIEhs20vendor_ie hs20vendor_ie;
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301030 bool is_fils_connection;
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301031 uint16_t fils_seq_num;
Vignesh Viswanathan0b0fa272017-09-18 17:12:04 +05301032#ifdef WLAN_FEATURE_FILS_SK
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301033 struct fils_join_rsp_params *fils_join_rsp;
1034#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001035 uint8_t frames[1];
Jeff Johnson2df04b82019-02-02 23:30:25 -08001036};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001037
Jeff Johnsona7d5b542019-02-03 10:15:46 -08001038struct oem_channel_info {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001039 uint8_t chan_id;
1040 uint32_t mhz;
1041 uint32_t band_center_freq1;
1042 uint32_t band_center_freq2;
1043 uint32_t info;
1044 uint32_t reg_info_1;
1045 uint32_t reg_info_2;
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301046 uint8_t nss;
1047 uint32_t rate_flags;
Manishekar Chandrasekaranec267592016-05-26 19:10:04 +05301048 uint8_t sec_ch_offset;
1049 enum phy_ch_width ch_width;
Jeff Johnsona7d5b542019-02-03 10:15:46 -08001050};
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301051
Will Huang558f8082017-05-31 16:22:24 +08001052enum sir_sme_phy_mode {
1053 SIR_SME_PHY_MODE_LEGACY = 0,
1054 SIR_SME_PHY_MODE_HT = 1,
1055 SIR_SME_PHY_MODE_VHT = 2
1056};
1057
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001058/* / Definition for Association indication from peer */
1059/* / MAC ---> */
Jeff Johnson01e8adb2019-02-03 10:55:55 -08001060struct assoc_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001061 uint16_t messageType; /* eWNI_SME_ASSOC_IND */
1062 uint16_t length;
1063 uint8_t sessionId;
1064 tSirMacAddr peerMacAddr;
1065 uint16_t aid;
1066 tSirMacAddr bssId; /* Self BSSID */
1067 uint16_t staId; /* Station ID for peer */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001068 tAniAuthType authType;
Min Liuddd23302018-12-05 16:17:48 +08001069 enum ani_akm_type akm_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001070 tAniSSID ssId; /* SSID used by STA to associate */
1071 tSirWAPIie wapiIE; /* WAPI IE received from peer */
1072 tSirRSNie rsnIE; /* RSN IE received from peer */
1073 /* Additional IE received from peer, which possibly include
1074 * WSC IE and/or P2P IE
1075 */
1076 tSirAddie addIE;
1077
1078 /* powerCap & supportedChannels are present only when */
1079 /* spectrumMgtIndicator flag is set */
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001080 bool spectrumMgtIndicator;
Jeff Johnson39f02ae2019-02-01 23:42:38 -08001081 struct power_cap_info powerCap;
Jeff Johnsoned4f4d52019-02-02 00:09:45 -08001082 struct supported_channels supportedChannels;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001083 bool wmmEnabledSta; /* if present - STA is WMM enabled */
1084 bool reassocReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001085 /* Required for indicating the frames to upper layer */
1086 uint32_t beaconLength;
1087 uint8_t *beaconPtr;
1088 uint32_t assocReqLength;
1089 uint8_t *assocReqPtr;
1090
1091 /* Timing measurement capability */
1092 uint8_t timingMeasCap;
Jeff Johnsona7d5b542019-02-03 10:15:46 -08001093 struct oem_channel_info chan_info;
Will Huang558f8082017-05-31 16:22:24 +08001094 bool ampdu;
1095 bool sgi_enable;
1096 bool tx_stbc;
1097 bool rx_stbc;
1098 tSirMacHTChannelWidth ch_width;
1099 enum sir_sme_phy_mode mode;
1100 uint8_t max_supp_idx;
1101 uint8_t max_ext_idx;
1102 uint8_t max_mcs_idx;
1103 uint8_t rx_mcs_map;
1104 uint8_t tx_mcs_map;
gaolez7bb1e742017-03-21 16:37:38 +08001105 /* Extended CSA capability of station */
1106 uint8_t ecsa_capable;
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +05301107 tDot11fIEHTCaps HTCaps;
1108 tDot11fIEVHTCaps VHTCaps;
Ashish Kumar Dhanotiya6025c702019-03-20 18:48:49 +05301109 bool he_caps_present;
Ashish Kumar Dhanotiyac6171062019-01-22 21:55:01 +05301110 tSirMacCapabilityInfo capability_info;
Srinivas Dasari5f528202019-02-11 17:29:43 +05301111 bool is_sae_authenticated;
Min Liu0daa0982019-02-01 17:50:44 +08001112 const uint8_t *owe_ie;
1113 uint32_t owe_ie_len;
1114 uint16_t owe_status;
Jeff Johnson01e8adb2019-02-03 10:55:55 -08001115};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001116
Min Liue34708a2019-02-01 15:00:34 +08001117/**
1118 * struct owe_assoc_ind - owe association indication
1119 * @node : List entry element
1120 * @assoc_ind: pointer to assoc ind
1121 */
1122struct owe_assoc_ind {
1123 qdf_list_node_t node;
1124 struct assoc_ind *assoc_ind;
1125};
1126
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001127/* / Definition for Association confirm */
1128/* / ---> MAC */
Jeff Johnsonf86e45b2019-02-03 11:17:14 -08001129struct assoc_cnf {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001130 uint16_t messageType; /* eWNI_SME_ASSOC_CNF */
1131 uint16_t length;
1132 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301133 struct qdf_mac_addr bssid; /* Self BSSID */
1134 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001135 uint16_t aid;
Pragaspathi Thilagarajcb58bbc2019-05-23 15:34:51 +05301136 enum mac_status_code mac_status_code;
Min Liu0daa0982019-02-01 17:50:44 +08001137 uint8_t *owe_ie;
1138 uint32_t owe_ie_len;
Jeff Johnsonf86e45b2019-02-03 11:17:14 -08001139};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001140
1141/* / Enum definition for Wireless medium status change codes */
1142typedef enum eSirSmeStatusChangeCode {
1143 eSIR_SME_DEAUTH_FROM_PEER,
1144 eSIR_SME_DISASSOC_FROM_PEER,
1145 eSIR_SME_LOST_LINK_WITH_PEER,
1146 eSIR_SME_CHANNEL_SWITCH,
1147 eSIR_SME_JOINED_NEW_BSS,
1148 eSIR_SME_LEAVING_BSS,
1149 eSIR_SME_IBSS_ACTIVE,
1150 eSIR_SME_IBSS_INACTIVE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001151 eSIR_SME_RADAR_DETECTED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001152 eSIR_SME_AP_CAPS_CHANGED,
1153} tSirSmeStatusChangeCode;
1154
Jeff Johnson2e6d1732019-02-03 17:00:30 -08001155struct new_bss_info {
Anurag Chouhan6d760662016-02-20 16:05:43 +05301156 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001157 uint8_t channelNumber;
1158 uint8_t reserved;
1159 tSirMacSSid ssId;
Jeff Johnson2e6d1732019-02-03 17:00:30 -08001160};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001161
Jeff Johnson9c9961c2019-02-03 17:10:53 -08001162struct ap_new_caps {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001163 uint16_t capabilityInfo;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301164 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001165 uint8_t channelId;
1166 uint8_t reserved[3];
1167 tSirMacSSid ssId;
Jeff Johnson9c9961c2019-02-03 17:10:53 -08001168};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001169
1170/**
1171 * Table below indicates what information is passed for each of
1172 * the Wireless Media status change notifications:
1173 *
Jeff Johnson65a20762019-02-02 11:01:50 -08001174 * Status Change code Status change info
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001175 * ----------------------------------------------------------------------
1176 * eSIR_SME_DEAUTH_FROM_PEER Reason code received in DEAUTH frame
1177 * eSIR_SME_DISASSOC_FROM_PEER Reason code received in DISASSOC frame
1178 * eSIR_SME_LOST_LINK_WITH_PEER None
1179 * eSIR_SME_CHANNEL_SWITCH New channel number
1180 * eSIR_SME_JOINED_NEW_BSS BSSID, SSID and channel number
1181 * eSIR_SME_LEAVING_BSS None
1182 * eSIR_SME_IBSS_ACTIVE Indicates that another STA joined
1183 * IBSS apart from this STA that
1184 * started IBSS
1185 * eSIR_SME_IBSS_INACTIVE Indicates that only this STA is left
1186 * in IBSS
1187 * eSIR_SME_RADAR_DETECTED Indicates that radar is detected
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001188 * eSIR_SME_AP_CAPS_CHANGED Indicates that capabilities of the AP
1189 * that STA is currently associated with
1190 * have changed.
1191 */
1192
1193/* / Definition for Wireless medium status change notification */
Jeff Johnson53889322019-02-03 17:37:09 -08001194struct wm_status_change_ntf {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001195 uint16_t messageType; /* eWNI_SME_WM_STATUS_CHANGE_NTF */
1196 uint16_t length;
1197 uint8_t sessionId; /* Session ID */
1198 tSirSmeStatusChangeCode statusChangeCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301199 struct qdf_mac_addr bssid; /* Self BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001200 union {
Jeff Johnson65a20762019-02-02 11:01:50 -08001201 /* eSIR_SME_DEAUTH_FROM_PEER */
1202 uint16_t deAuthReasonCode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001203 /* eSIR_SME_DISASSOC_FROM_PEER */
1204 uint16_t disassocReasonCode;
1205 /* none for eSIR_SME_LOST_LINK_WITH_PEER */
Jeff Johnson65a20762019-02-02 11:01:50 -08001206 /* eSIR_SME_CHANNEL_SWITCH */
1207 uint8_t newChannelId;
1208 /* eSIR_SME_JOINED_NEW_BSS */
Jeff Johnson2e6d1732019-02-03 17:00:30 -08001209 struct new_bss_info newBssInfo;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001210 /* none for eSIR_SME_LEAVING_BSS */
1211 /* none for eSIR_SME_IBSS_ACTIVE */
1212 /* none for eSIR_SME_IBSS_INACTIVE */
Jeff Johnson65a20762019-02-02 11:01:50 -08001213 /* none for eSIR_SME_RADAR_DETECTED */
1214 /* eSIR_SME_AP_CAPS_CHANGED */
Jeff Johnson9c9961c2019-02-03 17:10:53 -08001215 struct ap_new_caps apNewCaps;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001216 } statusChangeInfo;
Jeff Johnson53889322019-02-03 17:37:09 -08001217};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001218
1219/* Definition for Disassociation request */
Jeff Johnsonca523f32019-02-03 18:05:59 -08001220struct disassoc_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001221 uint16_t messageType; /* eWNI_SME_DISASSOC_REQ */
1222 uint16_t length;
1223 uint8_t sessionId; /* Session ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301224 struct qdf_mac_addr bssid; /* Peer BSSID */
1225 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001226 uint16_t reasonCode;
1227 /* This flag tells LIM whether to send the disassoc OTA or not */
1228 /* This will be set in while handing off from one AP to other */
1229 uint8_t doNotSendOverTheAir;
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -07001230 bool process_ho_fail;
Jeff Johnsonca523f32019-02-03 18:05:59 -08001231};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001232
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001233/* / Definition for Disassociation response */
Jeff Johnson380a1cd2019-02-03 21:43:51 -08001234struct disassoc_rsp {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001235 uint16_t messageType; /* eWNI_SME_DISASSOC_RSP */
1236 uint16_t length;
1237 uint8_t sessionId; /* Session ID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001238 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301239 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001240 uint16_t staId;
Jeff Johnson380a1cd2019-02-03 21:43:51 -08001241};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001242
1243/* / Definition for Disassociation indication from peer */
Jeff Johnson318a9882019-02-04 08:30:50 -08001244struct disassoc_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001245 uint16_t messageType; /* eWNI_SME_DISASSOC_IND */
1246 uint16_t length;
1247 uint8_t sessionId; /* Session Identifier */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001248 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301249 struct qdf_mac_addr bssid;
1250 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001251 uint16_t staId;
1252 uint32_t reasonCode;
Jeff Johnson318a9882019-02-04 08:30:50 -08001253};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001254
1255/* / Definition for Disassociation confirm */
1256/* / MAC ---> */
Jeff Johnson0837c442019-02-04 11:37:09 -08001257struct disassoc_cnf {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001258 uint16_t messageType; /* eWNI_SME_DISASSOC_CNF */
1259 uint16_t length;
Vignesh Viswanathanb2dcdd02018-05-24 11:48:12 +05301260 uint8_t sme_session_id;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001261 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301262 struct qdf_mac_addr bssid;
1263 struct qdf_mac_addr peer_macaddr;
Jeff Johnson0837c442019-02-04 11:37:09 -08001264};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001265
Hanumantha Reddy Pothula3e5d6aa2016-09-08 15:21:54 +05301266/**
1267 * struct sir_sme_discon_done_ind - disconnect done indiaction
1268 * @message_type: msg type
1269 * @length: length of msg
1270 * @session_id: session id of the indication
1271 * @reason_code: reason for disconnect indication
1272 * @peer_mac: peer mac
1273 */
1274struct sir_sme_discon_done_ind {
1275 uint16_t message_type;
1276 uint16_t length;
1277 uint8_t session_id;
1278 tSirResultCodes reason_code;
1279 tSirMacAddr peer_mac;
1280};
1281
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001282/* / Definition for Deauthetication request */
Jeff Johnson34c74b02019-02-04 12:34:51 -08001283struct deauth_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001284 uint16_t messageType; /* eWNI_SME_DEAUTH_REQ */
1285 uint16_t length;
1286 uint8_t sessionId; /* Session ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301287 struct qdf_mac_addr bssid; /* AP BSSID */
1288 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001289 uint16_t reasonCode;
Jeff Johnson34c74b02019-02-04 12:34:51 -08001290};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001291
1292/* / Definition for Deauthetication response */
Jeff Johnson15ae0c12019-02-04 12:55:07 -08001293struct deauth_rsp {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001294 uint16_t messageType; /* eWNI_SME_DEAUTH_RSP */
1295 uint16_t length;
1296 uint8_t sessionId; /* Session ID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001297 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301298 struct qdf_mac_addr peer_macaddr;
Jeff Johnson15ae0c12019-02-04 12:55:07 -08001299};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001300
1301/* / Definition for Deauthetication indication from peer */
Jeff Johnsonfec08712019-02-04 13:12:08 -08001302struct deauth_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001303 uint16_t messageType; /* eWNI_SME_DEAUTH_IND */
1304 uint16_t length;
1305 uint8_t sessionId; /* Added for BT-AMP */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001306 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301307 struct qdf_mac_addr bssid; /* AP BSSID */
1308 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001309
1310 uint16_t staId;
1311 uint32_t reasonCode;
Kiran Kumar Lokere37d3aa22015-11-03 14:58:26 -08001312 int8_t rssi;
Jeff Johnsonfec08712019-02-04 13:12:08 -08001313};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001314
Jeff Johnson0837c442019-02-04 11:37:09 -08001315/* / Definition for Deauthetication confirm */
1316struct deauth_cnf {
1317 uint16_t messageType; /* eWNI_SME_DEAUTH_CNF */
1318 uint16_t length;
1319 uint8_t sme_session_id;
1320 tSirResultCodes statusCode;
1321 struct qdf_mac_addr bssid;
1322 struct qdf_mac_addr peer_macaddr;
1323};
1324
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001325/* / Definition for stop BSS request message */
Jeff Johnson206721c2019-02-04 17:25:02 -08001326struct stop_bss_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001327 uint16_t messageType; /* eWNI_SME_STOP_BSS_REQ */
1328 uint16_t length;
1329 uint8_t sessionId; /* Session ID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001330 tSirResultCodes reasonCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301331 struct qdf_mac_addr bssid; /* Self BSSID */
Jeff Johnson206721c2019-02-04 17:25:02 -08001332};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001333
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001334/* / Definition for Channel Switch indication for station */
1335/* / MAC ---> */
Jeff Johnson3eb71112019-02-04 17:40:51 -08001336struct switch_channel_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001337 uint16_t messageType; /* eWNI_SME_SWITCH_CHL_IND */
1338 uint16_t length;
1339 uint8_t sessionId;
1340 uint16_t newChannelId;
Amar Singhal5cccafe2017-02-15 12:42:58 -08001341 struct ch_params chan_params;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301342 struct qdf_mac_addr bssid; /* BSSID */
Jianmin Zhu3c50e402018-12-04 18:52:54 +08001343 QDF_STATUS status;
Jeff Johnson3eb71112019-02-04 17:40:51 -08001344};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001345
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001346/* / Definition for MIC failure indication */
1347/* / MAC ---> */
1348/* / MAC reports this each time a MIC failure occures on Rx TKIP packet */
Jeff Johnsonffb93e12019-02-04 19:25:12 -08001349struct mic_failure_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001350 uint16_t messageType; /* eWNI_SME_MIC_FAILURE_IND */
1351 uint16_t length;
1352 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301353 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001354 tSirMicFailureInfo info;
Jeff Johnsonffb93e12019-02-04 19:25:12 -08001355};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001356
Jeff Johnsoncbc85322019-02-04 19:47:17 -08001357struct missed_beacon_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001358 uint16_t messageType; /* eWNI_SME_MISSED_BEACON_IND */
1359 uint16_t length;
Pragaspathi Thilagaraje05162d2019-05-23 13:10:46 +05301360 uint8_t bss_idx;
Jeff Johnsoncbc85322019-02-04 19:47:17 -08001361};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001362
1363/* / Definition for Set Context request */
1364/* / ---> MAC */
Jeff Johnsonb9a9a7d2019-02-05 11:47:05 -08001365struct set_context_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001366 uint16_t messageType; /* eWNI_SME_SET_CONTEXT_REQ */
1367 uint16_t length;
1368 uint8_t sessionId; /* Session ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301369 struct qdf_mac_addr peer_macaddr;
1370 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001371 tSirKeyMaterial keyMaterial;
Jeff Johnsonb9a9a7d2019-02-05 11:47:05 -08001372};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001373
1374/* / Definition for Set Context response */
1375/* / MAC ---> */
Jeff Johnson924ae612019-02-05 12:01:50 -08001376struct set_context_rsp {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001377 uint16_t messageType; /* eWNI_SME_SET_CONTEXT_RSP */
1378 uint16_t length;
1379 uint8_t sessionId; /* Session ID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001380 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301381 struct qdf_mac_addr peer_macaddr;
Jeff Johnson924ae612019-02-05 12:01:50 -08001382};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001383
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001384/*******************PE Statistics*************************/
1385
1386/*
1387 * tpAniGetPEStatsReq is tied to
1388 * for SME ==> PE eWNI_SME_GET_STATISTICS_REQ msgId and
1389 * for PE ==> HAL SIR_HAL_GET_STATISTICS_REQ msgId
1390 */
1391typedef struct sAniGetPEStatsReq {
1392 /* Common for all types are requests */
1393 uint16_t msgType; /* message type is same as the request type */
1394 uint16_t msgLen; /* length of the entire request */
1395 uint32_t staId; /* Per STA stats request must contain valid */
1396 /* categories of stats requested. look at ePEStatsMask */
1397 uint32_t statsMask;
1398 uint8_t sessionId;
1399} tAniGetPEStatsReq, *tpAniGetPEStatsReq;
1400
1401/*
1402 * tpAniGetPEStatsRsp is tied to
1403 * for PE ==> SME eWNI_SME_GET_STATISTICS_RSP msgId and
1404 * for HAL ==> PE SIR_HAL_GET_STATISTICS_RSP msgId
1405 */
1406typedef struct sAniGetPEStatsRsp {
1407 /* Common for all types are responses */
1408 uint16_t msgType; /* message type is same as the request type */
1409 /* length of the entire request, includes the pStatsBuf length too */
1410 uint16_t msgLen;
1411 uint8_t sessionId;
1412 uint32_t rc; /* success/failure */
1413 uint32_t staId; /* Per STA stats request must contain valid */
1414 /* categories of stats requested. look at ePEStatsMask */
1415 uint32_t statsMask;
1416 /* void *pStatsBuf; */
1417 /*
1418 * The Stats buffer starts here and can be an aggregate of more than one
1419 * statistics structure depending on statsMask. The void pointer
1420 * "pStatsBuf" is commented out intentionally and the src code that uses
1421 * this structure should take that into account.
1422 */
1423} tAniGetPEStatsRsp, *tpAniGetPEStatsRsp;
1424
1425typedef struct sAniGetRssiReq {
1426 /* Common for all types are requests */
1427 uint16_t msgType; /* message type is same as the request type */
1428 uint16_t msgLen; /* length of the entire request */
1429 uint8_t sessionId;
1430 uint8_t staId;
1431 int8_t lastRSSI; /* in case of error, return last RSSI */
1432 void *rssiCallback;
1433 void *pDevContext; /* device context */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001434} tAniGetRssiReq, *tpAniGetRssiReq;
1435
1436typedef struct sAniGetSnrReq {
1437 /* Common for all types are requests */
1438 uint16_t msgType; /* message type is same as the request type */
1439 uint16_t msgLen; /* length of the entire request */
1440 uint8_t sessionId;
1441 uint8_t staId;
1442 void *snrCallback;
1443 void *pDevContext; /* device context */
1444 int8_t snr;
1445} tAniGetSnrReq, *tpAniGetSnrReq;
1446
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001447/* generic country code change request MSG structure */
1448typedef struct sAniGenericChangeCountryCodeReq {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001449 uint16_t msgType; /* message type is same as the request type */
1450 uint16_t msgLen; /* length of the entire request */
Wu Gaoaa155142019-01-14 15:09:26 +08001451 uint8_t countryCode[CFG_COUNTRY_CODE_LEN]; /* 3 char country code */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001452} tAniGenericChangeCountryCodeReq, *tpAniGenericChangeCountryCodeReq;
1453
Srinivas Girigowda296105a2015-09-24 16:31:16 -07001454/**
1455 * struct sAniDHCPStopInd - DHCP Stop indication message
1456 * @msgType: message type is same as the request type
1457 * @msgLen: length of the entire request
1458 * @device_mode: Mode of the device(ex:STA, AP)
1459 * @adapterMacAddr: MAC address of the adapter
1460 * @peerMacAddr: MAC address of the connected peer
1461 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001462typedef struct sAniDHCPStopInd {
Srinivas Girigowda296105a2015-09-24 16:31:16 -07001463 uint16_t msgType;
1464 uint16_t msgLen;
1465 uint8_t device_mode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301466 struct qdf_mac_addr adapterMacAddr;
1467 struct qdf_mac_addr peerMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001468} tAniDHCPInd, *tpAniDHCPInd;
1469
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001470typedef struct sAniTXFailMonitorInd {
1471 uint16_t msgType; /* message type is same as the request type */
1472 uint16_t msgLen; /* length of the entire request */
1473 uint8_t tx_fail_count;
1474 void *txFailIndCallback;
1475} tAniTXFailMonitorInd, *tpAniTXFailMonitorInd;
1476
Naveen Rawatea1564b2018-05-17 15:56:11 -07001477#ifndef QCA_SUPPORT_CP_STATS
1478/**
1479 * enum tx_rate_info - tx_rate flags
1480 * @TX_RATE_LEGACY: Legacy rates
1481 * @TX_RATE_HT20: HT20 rates
1482 * @TX_RATE_HT40: HT40 rates
1483 * @TX_RATE_SGI: Rate with Short guard interval
1484 * @TX_RATE_LGI: Rate with Long guard interval
1485 * @TX_RATE_VHT20: VHT 20 rates
1486 * @TX_RATE_VHT40: VHT 40 rates
1487 * @TX_RATE_VHT80: VHT 80 rates
1488 */
1489enum tx_rate_info {
1490 TX_RATE_LEGACY = 0x1,
1491 TX_RATE_HT20 = 0x2,
1492 TX_RATE_HT40 = 0x4,
1493 TX_RATE_SGI = 0x8,
1494 TX_RATE_LGI = 0x10,
1495 TX_RATE_VHT20 = 0x20,
1496 TX_RATE_VHT40 = 0x40,
1497 TX_RATE_VHT80 = 0x80
1498};
1499#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001500/**********************PE Statistics end*************************/
1501
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001502typedef struct sSirP2PNoaAttr {
1503#ifdef ANI_BIG_BYTE_ENDIAN
1504 uint32_t index:8;
1505 uint32_t oppPsFlag:1;
1506 uint32_t ctWin:7;
1507 uint32_t rsvd1:16;
1508#else
1509 uint32_t rsvd1:16;
1510 uint32_t ctWin:7;
1511 uint32_t oppPsFlag:1;
1512 uint32_t index:8;
1513#endif
1514
1515#ifdef ANI_BIG_BYTE_ENDIAN
1516 uint32_t uNoa1IntervalCnt:8;
1517 uint32_t rsvd2:24;
1518#else
1519 uint32_t rsvd2:24;
1520 uint32_t uNoa1IntervalCnt:8;
1521#endif
1522 uint32_t uNoa1Duration;
1523 uint32_t uNoa1Interval;
1524 uint32_t uNoa1StartTime;
1525
1526#ifdef ANI_BIG_BYTE_ENDIAN
1527 uint32_t uNoa2IntervalCnt:8;
1528 uint32_t rsvd3:24;
1529#else
1530 uint32_t rsvd3:24;
1531 uint32_t uNoa2IntervalCnt:8;
1532#endif
1533 uint32_t uNoa2Duration;
1534 uint32_t uNoa2Interval;
1535 uint32_t uNoa2StartTime;
1536} tSirP2PNoaAttr, *tpSirP2PNoaAttr;
1537
1538typedef struct sSirTclasInfo {
1539 tSirMacTclasIE tclas;
1540 uint8_t version; /* applies only for classifier type ip */
1541 union {
1542 tSirMacTclasParamEthernet eth;
1543 tSirMacTclasParamIPv4 ipv4;
1544 tSirMacTclasParamIPv6 ipv6;
1545 tSirMacTclasParam8021dq t8021dq;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301546 } qdf_packed tclasParams;
1547} qdf_packed tSirTclasInfo;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001548
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001549typedef struct sSirAddtsReqInfo {
1550 uint8_t dialogToken;
Jeff Johnson56471b92018-12-22 14:36:06 -08001551 struct mac_tspec_ie tspec;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001552
1553 uint8_t numTclas; /* number of Tclas elements */
1554 tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM];
1555 uint8_t tclasProc;
1556#if defined(FEATURE_WLAN_ESE)
Jeff Johnson8a5d0ab2019-02-02 21:54:17 -08001557 struct ese_tsrs_ie tsrsIE;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001558 uint8_t tsrsPresent:1;
1559#endif
1560 uint8_t wmeTspecPresent:1;
1561 uint8_t wsmTspecPresent:1;
1562 uint8_t lleTspecPresent:1;
1563 uint8_t tclasProcPresent:1;
1564} tSirAddtsReqInfo, *tpSirAddtsReqInfo;
1565
1566typedef struct sSirAddtsRspInfo {
1567 uint8_t dialogToken;
Pragaspathi Thilagarajcb58bbc2019-05-23 15:34:51 +05301568 enum mac_status_code status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001569 tSirMacTsDelayIE delay;
1570
Jeff Johnson56471b92018-12-22 14:36:06 -08001571 struct mac_tspec_ie tspec;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001572 uint8_t numTclas; /* number of Tclas elements */
1573 tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM];
1574 uint8_t tclasProc;
1575 tSirMacScheduleIE schedule;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001576#ifdef FEATURE_WLAN_ESE
Jeff Johnson4f340522019-02-02 22:02:52 -08001577 struct ese_tsm_ie tsmIE;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001578 uint8_t tsmPresent:1;
1579#endif
1580 uint8_t wmeTspecPresent:1;
1581 uint8_t wsmTspecPresent:1;
1582 uint8_t lleTspecPresent:1;
1583 uint8_t tclasProcPresent:1;
1584 uint8_t schedulePresent:1;
1585} tSirAddtsRspInfo, *tpSirAddtsRspInfo;
1586
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001587/* / Add a tspec as defined */
1588typedef struct sSirAddtsReq {
1589 uint16_t messageType; /* eWNI_SME_ADDTS_REQ */
1590 uint16_t length;
1591 uint8_t sessionId; /* Session ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301592 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001593 uint32_t timeout; /* in ms */
1594 uint8_t rspReqd;
1595 tSirAddtsReqInfo req;
1596} tSirAddtsReq, *tpSirAddtsReq;
1597
1598typedef struct sSirAddtsRsp {
1599 uint16_t messageType; /* eWNI_SME_ADDTS_RSP */
1600 uint16_t length;
1601 uint8_t sessionId; /* sme sessionId Added for BT-AMP support */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001602 uint32_t rc; /* return code */
1603 tSirAddtsRspInfo rsp;
1604} tSirAddtsRsp, *tpSirAddtsRsp;
1605
1606typedef struct sSirDeltsReq {
1607 uint16_t messageType; /* eWNI_SME_DELTS_REQ */
1608 uint16_t length;
1609 uint8_t sessionId; /* Session ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301610 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001611 uint16_t aid; /* use 0 if macAddr is being specified */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301612 struct qdf_mac_addr macaddr; /* only on AP to specify the STA */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001613 uint8_t rspReqd;
Jeff Johnsoncf2ec162018-12-22 16:46:43 -08001614 struct delts_req_info req;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001615} tSirDeltsReq, *tpSirDeltsReq;
1616
1617typedef struct sSirDeltsRsp {
1618 uint16_t messageType; /* eWNI_SME_DELTS_RSP */
1619 uint16_t length;
Jeff Johnsonb2b63e02019-02-21 09:46:03 -08001620 uint8_t sessionId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001621 uint32_t rc;
1622 uint16_t aid; /* use 0 if macAddr is being specified */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301623 struct qdf_mac_addr macaddr; /* only on AP to specify the STA */
Jeff Johnsoncf2ec162018-12-22 16:46:43 -08001624 struct delts_req_info rsp;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001625} tSirDeltsRsp, *tpSirDeltsRsp;
1626
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001627typedef struct sSirAggrQosReqInfo {
1628 uint16_t tspecIdx;
Srinivas Girigowdad462f3b2019-03-25 14:05:33 -07001629 tSirAddtsReqInfo aggrAddTsInfo[QCA_WLAN_AC_ALL];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001630} tSirAggrQosReqInfo, *tpSirAggrQosReqInfo;
1631
1632typedef struct sSirAggrQosReq {
1633 uint16_t messageType; /* eWNI_SME_ADDTS_REQ */
1634 uint16_t length;
1635 uint8_t sessionId; /* Session ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301636 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001637 uint32_t timeout; /* in ms */
1638 uint8_t rspReqd;
1639 tSirAggrQosReqInfo aggrInfo;
Jeff Johnson7e5e3982019-02-21 13:48:37 -08001640} tSirAggrQosReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001641
1642typedef struct sSirAggrQosRspInfo {
1643 uint16_t tspecIdx;
Srinivas Girigowdad462f3b2019-03-25 14:05:33 -07001644 tSirAddtsRspInfo aggrRsp[QCA_WLAN_AC_ALL];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001645} tSirAggrQosRspInfo, *tpSirAggrQosRspInfo;
1646
1647typedef struct sSirAggrQosRsp {
1648 uint16_t messageType;
1649 uint16_t length;
1650 uint8_t sessionId;
1651 tSirAggrQosRspInfo aggrInfo;
1652} tSirAggrQosRsp, *tpSirAggrQosRsp;
1653
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001654
Jeff Johnson7fb55e52019-02-06 11:28:12 -08001655struct qos_map_set {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001656 uint8_t present;
1657 uint8_t num_dscp_exceptions;
1658 uint8_t dscp_exceptions[21][2];
1659 uint8_t dscp_range[8][2];
Jeff Johnson7fb55e52019-02-06 11:28:12 -08001660};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001661
1662typedef struct sSmeIbssPeerInd {
1663 uint16_t mesgType;
1664 uint16_t mesgLen;
1665 uint8_t sessionId;
1666
Anurag Chouhan6d760662016-02-20 16:05:43 +05301667 struct qdf_mac_addr peer_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001668 uint16_t staId;
1669
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001670 /* Beacon will be appended for new Peer indication. */
1671} tSmeIbssPeerInd, *tpSmeIbssPeerInd;
1672
Jeff Johnson834dcdd2019-02-06 12:04:41 -08001673struct ibss_peer_inactivity_ind {
Pragaspathi Thilagaraje05162d2019-05-23 13:10:46 +05301674 uint8_t bss_idx;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001675 uint8_t staIdx;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301676 struct qdf_mac_addr peer_addr;
Jeff Johnson834dcdd2019-02-06 12:04:41 -08001677};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001678
gaoleze5108942017-03-31 16:56:42 +08001679/**
1680 * struct lim_channel_status
1681 * @channelfreq: Channel freq
1682 * @noise_floor: Noise Floor value
1683 * @rx_clear_count: rx clear count
1684 * @cycle_count: cycle count
1685 * @chan_tx_pwr_range: channel tx power per range in 0.5dBm steps
1686 * @chan_tx_pwr_throughput: channel tx power per throughput
1687 * @rx_frame_count: rx frame count (cumulative)
1688 * @bss_rx_cycle_count: BSS rx cycle count
1689 * @rx_11b_mode_data_duration: b-mode data rx time (units are microseconds)
1690 * @tx_frame_count: BSS tx cycle count
1691 * @mac_clk_mhz: sample frequency
1692 * @channel_id: channel index
1693 * @cmd_flags: indicate which stat event is this status coming from
1694 */
1695struct lim_channel_status {
1696 uint32_t channelfreq;
1697 uint32_t noise_floor;
1698 uint32_t rx_clear_count;
1699 uint32_t cycle_count;
1700 uint32_t chan_tx_pwr_range;
1701 uint32_t chan_tx_pwr_throughput;
1702 uint32_t rx_frame_count;
1703 uint32_t bss_rx_cycle_count;
1704 uint32_t rx_11b_mode_data_duration;
1705 uint32_t tx_frame_count;
1706 uint32_t mac_clk_mhz;
1707 uint32_t channel_id;
1708 uint32_t cmd_flags;
1709};
1710
1711/**
1712 * struct lim_scan_channel_status
1713 * @total_channel: total number of be scanned channel
1714 * @channel_status_list: channel status info store in this array
1715 */
1716struct lim_scan_channel_status {
1717 uint8_t total_channel;
1718 struct lim_channel_status
1719 channel_status_list[SIR_MAX_SUPPORTED_CHANNEL_LIST];
1720};
1721
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001722typedef struct sSmeMaxAssocInd {
1723 uint16_t mesgType; /* eWNI_SME_MAX_ASSOC_EXCEEDED */
1724 uint16_t mesgLen;
1725 uint8_t sessionId;
1726 /* the new peer that got rejected max assoc limit reached */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301727 struct qdf_mac_addr peer_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001728} tSmeMaxAssocInd, *tpSmeMaxAssocInd;
1729
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001730#define SIR_MAX_NAME_SIZE 64
1731#define SIR_MAX_TEXT_SIZE 32
1732
1733typedef struct sSirName {
1734 uint8_t num_name;
1735 uint8_t name[SIR_MAX_NAME_SIZE];
1736} tSirName;
1737
1738typedef struct sSirText {
1739 uint8_t num_text;
1740 uint8_t text[SIR_MAX_TEXT_SIZE];
1741} tSirText;
1742
1743#define SIR_WPS_PROBRSP_VER_PRESENT 0x00000001
1744#define SIR_WPS_PROBRSP_STATE_PRESENT 0x00000002
1745#define SIR_WPS_PROBRSP_APSETUPLOCK_PRESENT 0x00000004
1746#define SIR_WPS_PROBRSP_SELECTEDREGISTRA_PRESENT 0x00000008
1747#define SIR_WPS_PROBRSP_DEVICEPASSWORDID_PRESENT 0x00000010
1748#define SIR_WPS_PROBRSP_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020
1749#define SIR_WPS_PROBRSP_RESPONSETYPE_PRESENT 0x00000040
1750#define SIR_WPS_PROBRSP_UUIDE_PRESENT 0x00000080
1751#define SIR_WPS_PROBRSP_MANUFACTURE_PRESENT 0x00000100
1752#define SIR_WPS_PROBRSP_MODELNAME_PRESENT 0x00000200
1753#define SIR_WPS_PROBRSP_MODELNUMBER_PRESENT 0x00000400
1754#define SIR_WPS_PROBRSP_SERIALNUMBER_PRESENT 0x00000800
1755#define SIR_WPS_PROBRSP_PRIMARYDEVICETYPE_PRESENT 0x00001000
1756#define SIR_WPS_PROBRSP_DEVICENAME_PRESENT 0x00002000
1757#define SIR_WPS_PROBRSP_CONFIGMETHODS_PRESENT 0x00004000
1758#define SIR_WPS_PROBRSP_RF_BANDS_PRESENT 0x00008000
1759
1760typedef struct sSirWPSProbeRspIE {
1761 uint32_t FieldPresent;
1762 uint32_t Version; /* Version. 0x10 = version 1.0, 0x11 = etc. */
1763 uint32_t wpsState; /* 1 = unconfigured, 2 = configured. */
1764 bool APSetupLocked; /* Must be included if value is true */
1765 /*
1766 * BOOL: indicates if the user has recently activated a Registrar to
1767 * add an Enrollee.
1768 */
1769 bool SelectedRegistra;
1770 uint16_t DevicePasswordID; /* Device Password ID */
1771 /* Selected Registrar config method */
1772 uint16_t SelectedRegistraCfgMethod;
1773 uint8_t ResponseType; /* Response type */
1774 uint8_t UUID_E[16]; /* Unique identifier of the AP. */
1775 tSirName Manufacture;
1776 tSirText ModelName;
1777 tSirText ModelNumber;
1778 tSirText SerialNumber;
1779 /* Device Category ID: 1Computer, 2Input Device, ... */
1780 uint32_t PrimaryDeviceCategory;
1781 /* Vendor specific OUI for Device Sub Category */
1782 uint8_t PrimaryDeviceOUI[4];
1783 /*
1784 Device Sub Category ID: 1-PC, 2-Server if Device Category ID
1785 * is computer
1786 */
1787 uint32_t DeviceSubCategory;
1788 tSirText DeviceName;
1789 uint16_t ConfigMethod; /* Configuaration method */
1790 uint8_t RFBand; /* RF bands available on the AP */
1791} tSirWPSProbeRspIE;
1792
1793#define SIR_WPS_BEACON_VER_PRESENT 0x00000001
1794#define SIR_WPS_BEACON_STATE_PRESENT 0x00000002
1795#define SIR_WPS_BEACON_APSETUPLOCK_PRESENT 0x00000004
1796#define SIR_WPS_BEACON_SELECTEDREGISTRA_PRESENT 0x00000008
1797#define SIR_WPS_BEACON_DEVICEPASSWORDID_PRESENT 0x00000010
1798#define SIR_WPS_BEACON_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020
1799#define SIR_WPS_BEACON_UUIDE_PRESENT 0x00000080
1800#define SIR_WPS_BEACON_RF_BANDS_PRESENT 0x00000100
1801#define SIR_WPS_UUID_LEN 16
1802
1803typedef struct sSirWPSBeaconIE {
1804 uint32_t FieldPresent;
1805 uint32_t Version; /* Version. 0x10 = version 1.0, 0x11 = etc. */
1806 uint32_t wpsState; /* 1 = unconfigured, 2 = configured. */
1807 bool APSetupLocked; /* Must be included if value is true */
1808 /*
1809 * BOOL: indicates if the user has recently activated a Registrar to
1810 * add an Enrollee.
1811 */
1812 bool SelectedRegistra;
1813 uint16_t DevicePasswordID; /* Device Password ID */
1814 /* Selected Registrar config method */
1815 uint16_t SelectedRegistraCfgMethod;
1816 uint8_t UUID_E[SIR_WPS_UUID_LEN]; /* Unique identifier of the AP. */
1817 uint8_t RFBand; /* RF bands available on the AP */
1818} tSirWPSBeaconIE;
1819
1820#define SIR_WPS_ASSOCRSP_VER_PRESENT 0x00000001
1821#define SIR_WPS_ASSOCRSP_RESPONSETYPE_PRESENT 0x00000002
1822
1823typedef struct sSirWPSAssocRspIE {
1824 uint32_t FieldPresent;
1825 uint32_t Version;
1826 uint8_t ResposeType;
1827} tSirWPSAssocRspIE;
1828
1829typedef struct sSirAPWPSIEs {
1830 tSirWPSProbeRspIE SirWPSProbeRspIE; /*WPS Set Probe Respose IE */
1831 tSirWPSBeaconIE SirWPSBeaconIE; /*WPS Set Beacon IE */
1832 tSirWPSAssocRspIE SirWPSAssocRspIE; /*WPS Set Assoc Response IE */
1833} tSirAPWPSIEs, *tpSiriAPWPSIEs;
1834
Naveen Rawat8029a402017-06-01 10:54:19 -07001835struct update_config {
1836 uint16_t messageType; /* eWNI_SME_UPDATE_CONFIG */
1837 uint16_t length;
1838 uint8_t sme_session_id;
1839 uint16_t capab;
1840 uint32_t value;
1841};
1842
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05301843/*
1844 * enum sir_update_session_param_type - session param type
1845 * @SIR_PARAM_SSID_HIDDEN: ssidHidden parameter
Selvaraj, Sridharac4fcf32016-09-28 12:57:32 +05301846 * @SIR_PARAM_IGNORE_ASSOC_DISALLOWED: ignore_assoc_disallowed parameter
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05301847 */
1848enum sir_update_session_param_type {
1849 SIR_PARAM_SSID_HIDDEN,
Selvaraj, Sridharac4fcf32016-09-28 12:57:32 +05301850 SIR_PARAM_IGNORE_ASSOC_DISALLOWED,
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05301851};
1852
1853/*
1854 * struct sir_update_session_param
1855 * @message_type: SME message type
1856 * @length: size of struct sir_update_session_param
1857 * @session_id: Session ID
1858 * @param_type: parameter to be updated
1859 * @param_val: Parameter value to update
1860 */
1861struct sir_update_session_param {
1862 uint16_t message_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001863 uint16_t length;
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05301864 uint8_t session_id;
1865 uint32_t param_type;
1866 uint32_t param_val;
1867};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001868
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07001869/**
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -07001870 * struct sir_set_he_bss_color
1871 * @message_type: SME message type
1872 * @length: size of struct sir_set_he_bss_color
1873 * @session_id: Session ID
1874 * @bss_color: bss color value
1875 */
1876struct sir_set_he_bss_color {
1877 uint16_t message_type;
1878 uint16_t length;
1879 uint8_t session_id;
1880 uint8_t bss_color;
1881};
1882
1883/**
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07001884 * struct sir_create_session - Used for creating session in monitor mode
1885 * @type: SME host message type.
1886 * @msg_len: Length of the message.
1887 * @bss_id: bss_id for creating the session.
1888 */
1889struct sir_create_session {
1890 uint16_t type;
1891 uint16_t msg_len;
Rajeev Kumar Sirasanagandlae3b59912018-08-24 15:53:31 +05301892 uint8_t vdev_id;
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07001893 struct qdf_mac_addr bss_id;
1894};
1895
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001896/* Beacon Interval */
Jeff Johnson2482c792019-02-06 14:24:07 -08001897struct change_bi_params {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001898 uint16_t messageType;
1899 uint16_t length;
1900 uint16_t beaconInterval; /* Beacon Interval */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301901 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001902 uint8_t sessionId; /* Session ID */
Jeff Johnson2482c792019-02-06 14:24:07 -08001903};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001904
1905#ifdef QCA_HT_2040_COEX
Jeff Johnsonb2c72c02019-02-06 21:32:23 -08001906struct set_ht2040_mode {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001907 uint16_t messageType;
1908 uint16_t length;
1909 uint8_t cbMode;
1910 bool obssEnabled;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301911 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001912 uint8_t sessionId; /* Session ID */
Jeff Johnsonb2c72c02019-02-06 21:32:23 -08001913};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001914#endif
1915
1916#define SIR_WPS_PBC_WALK_TIME 120 /* 120 Second */
1917
1918typedef struct sSirWPSPBCSession {
1919 struct sSirWPSPBCSession *next;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301920 struct qdf_mac_addr addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001921 uint8_t uuid_e[SIR_WPS_UUID_LEN];
1922 uint32_t timestamp;
1923} tSirWPSPBCSession;
1924
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001925typedef struct sSirWPSPBCProbeReq {
Anurag Chouhan6d760662016-02-20 16:05:43 +05301926 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001927 uint16_t probeReqIELen;
1928 uint8_t probeReqIE[512];
1929} tSirWPSPBCProbeReq, *tpSirWPSPBCProbeReq;
1930
1931/* probereq from peer, when wsc is enabled */
1932typedef struct sSirSmeProbeReqInd {
1933 uint16_t messageType; /* eWNI_SME_WPS_PBC_PROBE_REQ_IND */
1934 uint16_t length;
1935 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301936 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001937 tSirWPSPBCProbeReq WPSPBCProbeReq;
1938} tSirSmeProbeReqInd, *tpSirSmeProbeReqInd;
1939
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001940#define SIR_ROAM_MAX_CHANNELS 80
1941#define SIR_ROAM_SCAN_MAX_PB_REQ_SIZE 450
1942/* Occupied channel list remains static */
1943#define CHANNEL_LIST_STATIC 1
Himanshu Agarwalb23aa572018-06-14 17:04:44 +05301944/* Occupied channel list can be dynamic */
1945#define CHANNEL_LIST_DYNAMIC 2
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001946
1947#ifdef WLAN_FEATURE_ROAM_OFFLOAD
hangtianb95e63b2018-11-28 12:10:00 +08001948#define SIR_ROAM_SCAN_PSK_SIZE 48
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001949#define SIR_ROAM_R0KH_ID_MAX_LEN 48
1950#endif
1951/* SME -> HAL - This is the host offload request. */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001952#define SIR_IPV6_NS_OFFLOAD 2
1953#define SIR_OFFLOAD_DISABLE 0
1954#define SIR_OFFLOAD_ENABLE 1
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001955
Jeff Johnsond6fda812019-02-06 21:54:23 -08001956struct sir_host_offload_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001957 uint8_t offloadType;
1958 uint8_t enableOrDisable;
1959 uint32_t num_ns_offload_count;
1960 union {
Srinivas Girigowdad1e45b82019-04-15 15:08:28 -07001961 uint8_t hostIpv4Addr[QDF_IPV4_ADDR_SIZE];
1962 uint8_t hostIpv6Addr[QDF_IPV6_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001963 } params;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301964 struct qdf_mac_addr bssid;
Jeff Johnsond6fda812019-02-06 21:54:23 -08001965};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001966
1967/* Packet Types. */
1968#define SIR_KEEP_ALIVE_NULL_PKT 1
1969#define SIR_KEEP_ALIVE_UNSOLICIT_ARP_RSP 2
1970
1971/* Keep Alive request. */
Jeff Johnson562ccad2019-02-06 22:10:24 -08001972struct keep_alive_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001973 uint8_t packetType;
1974 uint32_t timePeriod;
1975 tSirIpv4Addr hostIpv4Addr;
1976 tSirIpv4Addr destIpv4Addr;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301977 struct qdf_mac_addr dest_macaddr;
1978 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001979 uint8_t sessionId;
Jeff Johnson562ccad2019-02-06 22:10:24 -08001980};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001981
Srinivas Dasariea1c1332019-02-18 12:43:23 +05301982/**
1983 * enum rxmgmt_flags - flags for received management frame.
1984 * @RXMGMT_FLAG_NONE: Default value to indicate no flags are set.
1985 * @RXMGMT_FLAG_EXTERNAL_AUTH: frame can be used for external authentication
1986 * by upper layers.
1987 */
1988enum rxmgmt_flags {
1989 RXMGMT_FLAG_NONE,
1990 RXMGMT_FLAG_EXTERNAL_AUTH = 1 << 1,
1991};
1992
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001993typedef struct sSirSmeMgmtFrameInd {
Abhishek Singh7996eb72015-12-30 17:24:02 +05301994 uint16_t frame_len;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001995 uint32_t rxChan;
1996 uint8_t sessionId;
1997 uint8_t frameType;
1998 int8_t rxRssi;
Srinivas Dasariea1c1332019-02-18 12:43:23 +05301999 enum rxmgmt_flags rx_flags;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002000 uint8_t frameBuf[1]; /* variable */
2001} tSirSmeMgmtFrameInd, *tpSirSmeMgmtFrameInd;
2002
Abhishek Singh7996eb72015-12-30 17:24:02 +05302003typedef void (*sir_mgmt_frame_ind_callback)(tSirSmeMgmtFrameInd *frame_ind);
2004/**
2005 * struct sir_sme_mgmt_frame_cb_req - Register a
2006 * management frame callback req
2007 *
2008 * @message_type: message id
2009 * @length: msg length
2010 * @callback: callback for management frame indication
2011 */
2012struct sir_sme_mgmt_frame_cb_req {
2013 uint16_t message_type;
2014 uint16_t length;
2015 sir_mgmt_frame_ind_callback callback;
2016};
2017
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002018#ifdef WLAN_FEATURE_11W
2019typedef struct sSirSmeUnprotMgmtFrameInd {
2020 uint8_t sessionId;
2021 uint8_t frameType;
2022 uint8_t frameLen;
2023 uint8_t frameBuf[1]; /* variable */
2024} tSirSmeUnprotMgmtFrameInd, *tpSirSmeUnprotMgmtFrameInd;
2025#endif
2026
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002027#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
2028
2029typedef enum ext_wow_type {
2030 EXT_WOW_TYPE_APP_TYPE1, /* wow type: only enable wakeup for app type1 */
2031 EXT_WOW_TYPE_APP_TYPE2, /* wow type: only enable wakeup for app type2 */
2032 EXT_WOW_TYPE_APP_TYPE1_2, /* wow type: enable wakeup for app type1&2 */
2033} EXT_WOW_TYPE;
2034
2035typedef struct {
2036 uint8_t vdev_id;
2037 EXT_WOW_TYPE type;
2038 uint32_t wakeup_pin_num;
2039} tSirExtWoWParams, *tpSirExtWoWParams;
2040
2041typedef struct {
2042 uint8_t vdev_id;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302043 struct qdf_mac_addr wakee_mac_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002044 uint8_t identification_id[8];
2045 uint8_t password[16];
2046 uint32_t id_length;
2047 uint32_t pass_length;
2048} tSirAppType1Params, *tpSirAppType1Params;
2049
2050typedef struct {
2051 uint8_t vdev_id;
2052
2053 uint8_t rc4_key[16];
2054 uint32_t rc4_key_len;
2055
2056 /** ip header parameter */
2057 uint32_t ip_id; /* NC id */
2058 uint32_t ip_device_ip; /* NC IP address */
2059 uint32_t ip_server_ip; /* Push server IP address */
2060
2061 /** tcp header parameter */
2062 uint16_t tcp_src_port; /* NC TCP port */
2063 uint16_t tcp_dst_port; /* Push server TCP port */
2064 uint32_t tcp_seq;
2065 uint32_t tcp_ack_seq;
2066
2067 uint32_t keepalive_init; /* Initial ping interval */
2068 uint32_t keepalive_min; /* Minimum ping interval */
2069 uint32_t keepalive_max; /* Maximum ping interval */
2070 uint32_t keepalive_inc; /* Increment of ping interval */
2071
Anurag Chouhan6d760662016-02-20 16:05:43 +05302072 struct qdf_mac_addr gateway_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002073 uint32_t tcp_tx_timeout_val;
2074 uint32_t tcp_rx_timeout_val;
2075} tSirAppType2Params, *tpSirAppType2Params;
2076#endif
2077
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002078#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2079typedef struct {
2080 uint8_t acvo_uapsd:1;
2081 uint8_t acvi_uapsd:1;
2082 uint8_t acbk_uapsd:1;
2083 uint8_t acbe_uapsd:1;
2084 uint8_t reserved:4;
2085} tSirAcUapsd, *tpSirAcUapsd;
2086#endif
2087
2088typedef struct {
2089 tSirMacSSid ssId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302090 uint8_t currAPbssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002091 uint32_t authentication;
2092 uint8_t encryption;
2093 uint8_t mcencryption;
2094 uint8_t ChannelCount;
2095 uint8_t ChannelCache[SIR_ROAM_MAX_CHANNELS];
2096#ifdef WLAN_FEATURE_11W
2097 bool mfp_enabled;
2098#endif
2099
2100} tSirRoamNetworkType;
2101
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002102typedef enum {
2103 SIR_ROAMING_DFS_CHANNEL_DISABLED = 0,
2104 SIR_ROAMING_DFS_CHANNEL_ENABLED_NORMAL = 1,
2105 SIR_ROAMING_DFS_CHANNEL_ENABLED_ACTIVE = 2
2106} eSirDFSRoamScanMode;
2107#define MAX_SSID_ALLOWED_LIST 4
2108#define MAX_BSSID_AVOID_LIST 16
2109#define MAX_BSSID_FAVORED 16
2110/**
2111 * struct roam_ext_params - Structure holding roaming parameters
2112 * @num_bssid_avoid_list: The number of BSSID's that we should
2113 * avoid connecting to. It is like a
2114 * blacklist of BSSID's.
2115 * @num_ssid_allowed_list: The number of SSID profiles that are
2116 * in the Whitelist. When roaming, we
2117 * consider the BSSID's with this SSID
2118 * also for roaming apart from the connected one's
2119 * @num_bssid_favored: Number of BSSID's which have a preference over
2120 * others
2121 * @ssid_allowed_list: Whitelist SSID's
2122 * @bssid_avoid_list: Blacklist SSID's
2123 * @bssid_favored: Favorable BSSID's
2124 * @bssid_favored_factor: RSSI to be added to this BSSID to prefer it
2125 * @raise_rssi_thresh_5g: The RSSI threshold below which the
2126 * raise_factor_5g (boost factor) should be
2127 * applied.
2128 * @drop_rssi_thresh_5g: The RSSI threshold beyond which the
2129 * drop_factor_5g (penalty factor) should be
2130 * applied
2131 * @raise_rssi_type_5g: Algorithm to apply the boost factor
2132 * @raise_factor_5g: Boost factor
2133 * @drop_rssi_type_5g: Algorithm to apply the penalty factor
2134 * @drop_factor_5g: Penalty factor
2135 * @max_raise_rssi_5g: Maximum amount of Boost that can added
2136 * @max_drop_rssi_5g: Maximum amount of penalty that can be subtracted
2137 * @good_rssi_threshold: The Lookup UP threshold beyond which roaming
2138 * scan should be performed.
2139 * @rssi_diff: RSSI difference for the AP to be better over the
2140 * current AP to avoid ping pong effects
2141 * @good_rssi_roam: Lazy Roam
gaurank kathpalia3ebc17b2019-05-29 10:25:09 +05302142 * @rssi_reject_list: RSSI reject list (APs rejected by OCE, BTM)
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002143 * @bg_scan_bad_rssi_thresh: Bad RSSI threshold to perform bg scan.
Vignesh Viswanathanc018e982017-09-07 18:49:19 +05302144 * @bad_rssi_thresh_offset_2g: Offset from Bad RSSI threshold for 2G to 5G Roam
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002145 * @bg_scan_client_bitmap: Bitmap to identify the client scans to snoop.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002146 *
2147 * This structure holds all the key parameters related to
2148 * initial connection and also roaming connections.
2149 * */
2150struct roam_ext_params {
2151 uint8_t num_bssid_avoid_list;
2152 uint8_t num_ssid_allowed_list;
2153 uint8_t num_bssid_favored;
2154 tSirMacSSid ssid_allowed_list[MAX_SSID_ALLOWED_LIST];
Anurag Chouhan6d760662016-02-20 16:05:43 +05302155 struct qdf_mac_addr bssid_avoid_list[MAX_BSSID_AVOID_LIST];
2156 struct qdf_mac_addr bssid_favored[MAX_BSSID_FAVORED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002157 uint8_t bssid_favored_factor[MAX_BSSID_FAVORED];
2158 int raise_rssi_thresh_5g;
2159 int drop_rssi_thresh_5g;
2160 uint8_t raise_rssi_type_5g;
2161 uint8_t raise_factor_5g;
2162 uint8_t drop_rssi_type_5g;
2163 uint8_t drop_factor_5g;
2164 int max_raise_rssi_5g;
2165 int max_drop_rssi_5g;
2166 int alert_rssi_threshold;
2167 int rssi_diff;
2168 int good_rssi_roam;
Gupta, Kapilc68ad462016-02-01 19:17:23 +05302169 int dense_rssi_thresh_offset;
2170 int dense_min_aps_cnt;
2171 int initial_dense_status;
2172 int traffic_threshold;
Abhishek Singh4db8c152017-07-18 10:40:08 +05302173 uint8_t num_rssi_rejection_ap;
gaurank kathpalia3ebc17b2019-05-29 10:25:09 +05302174 struct reject_ap_config_params
2175 rssi_reject_bssid_list[MAX_RSSI_AVOID_BSSID_LIST];
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002176 int8_t bg_scan_bad_rssi_thresh;
Vignesh Viswanathanc018e982017-09-07 18:49:19 +05302177 uint8_t roam_bad_rssi_thresh_offset_2g;
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002178 uint32_t bg_scan_client_bitmap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002179};
2180
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08002181/**
2182 * struct pmkid_mode_bits - Bit flags for PMKID usage in RSN IE
2183 * @fw_okc: Opportunistic key caching enable in firmware
2184 * @fw_pmksa_cache: PMKSA caching enable in firmware, remember previously
2185 * visited BSSID/PMK pairs
2186 */
2187struct pmkid_mode_bits {
2188 uint32_t fw_okc:1;
2189 uint32_t fw_pmksa_cache:1;
2190 uint32_t unused:30;
2191};
2192
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302193/**
2194 * struct lca_disallow_config_params - LCA[Last Connected AP]
2195 * disallow config params
2196 * @disallow_duration: LCA AP disallowed duration
2197 * @rssi_channel_penalization: RSSI channel Penalization
2198 * @num_disallowed_aps: Maximum number of AP's in LCA list
2199 *
2200 */
Srinivas Girigowdaea4d8062017-10-14 12:40:48 -07002201struct lca_disallow_config_params {
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302202 uint32_t disallow_duration;
2203 uint32_t rssi_channel_penalization;
2204 uint32_t num_disallowed_aps;
2205};
2206
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002207/**
2208 * struct mawc_params - Motion Aided Wireless Connectivity configuration
Wu Gaoca416ff2018-09-17 11:05:07 +08002209 * @mawc_enabled: Global configuration for MAWC (Roaming/PNO/ExtScan)
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002210 * @mawc_roam_enabled: MAWC roaming enable/disable
2211 * @mawc_roam_traffic_threshold: Traffic threshold in kBps for MAWC roaming
2212 * @mawc_roam_ap_rssi_threshold: AP RSSI threshold for MAWC roaming
2213 * @mawc_roam_rssi_high_adjust: High Adjustment value for suppressing scan
2214 * @mawc_roam_rssi_low_adjust: Low Adjustment value for suppressing scan
2215 */
2216struct mawc_params {
2217 bool mawc_enabled;
2218 bool mawc_roam_enabled;
2219 uint32_t mawc_roam_traffic_threshold;
2220 int8_t mawc_roam_ap_rssi_threshold;
2221 uint8_t mawc_roam_rssi_high_adjust;
2222 uint8_t mawc_roam_rssi_low_adjust;
2223};
2224
Jeff Johnsone6da4b02019-02-06 22:22:04 -08002225struct roam_offload_scan_req {
Selvaraj, Sridhar01741822016-08-30 18:26:19 +05302226 uint16_t message_type;
2227 uint16_t length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002228 bool RoamScanOffloadEnabled;
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002229 struct mawc_params mawc_roam_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002230 int8_t LookupThreshold;
Varun Reddy Yeturu168134f2017-06-26 13:46:05 -07002231 int8_t rssi_thresh_offset_5g;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002232 uint8_t delay_before_vdev_stop;
2233 uint8_t OpportunisticScanThresholdDiff;
2234 uint8_t RoamRescanRssiDiff;
2235 uint8_t RoamRssiDiff;
gaurank kathpaliac63859d2018-05-03 18:48:41 +05302236 struct rsn_caps rsn_caps;
Abhishek Singh34c0e632017-09-28 14:39:29 +05302237 int32_t rssi_abs_thresh;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002238 uint8_t ChannelCacheType;
2239 uint8_t Command;
2240 uint8_t reason;
2241 uint16_t NeighborScanTimerPeriod;
Sridhar Selvaraj1b2330c2017-07-21 15:16:42 +05302242 uint16_t neighbor_scan_min_timer_period;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002243 uint16_t NeighborScanChannelMinTime;
2244 uint16_t NeighborScanChannelMaxTime;
2245 uint16_t EmptyRefreshScanPeriod;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002246 bool IsESEAssoc;
Abhinav Kumar271f0632018-03-29 16:01:30 +05302247 bool is_11r_assoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002248 uint8_t nProbes;
2249 uint16_t HomeAwayTime;
2250 tSirRoamNetworkType ConnectedNetwork;
Jeff Johnson9e760832018-12-15 12:41:36 -08002251 struct mobility_domain_info mdid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002252 uint8_t sessionId;
2253 uint8_t RoamBmissFirstBcnt;
2254 uint8_t RoamBmissFinalBcnt;
2255 uint8_t RoamBeaconRssiWeight;
2256 eSirDFSRoamScanMode allowDFSChannelRoam;
2257#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Jianmin Zhubf845932018-12-17 11:52:50 +08002258 uint8_t roam_offload_enabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002259 uint8_t PSK_PMK[SIR_ROAM_SCAN_PSK_SIZE];
2260 uint32_t pmk_len;
2261 uint8_t Prefer5GHz;
2262 uint8_t RoamRssiCatGap;
2263 uint8_t Select5GHzMargin;
2264 uint8_t KRK[SIR_KRK_KEY_LEN];
2265 uint8_t BTK[SIR_BTK_KEY_LEN];
2266 uint32_t ReassocFailureTimeout;
2267 tSirAcUapsd AcUapsd;
2268 uint8_t R0KH_ID[SIR_ROAM_R0KH_ID_MAX_LEN];
2269 uint32_t R0KH_ID_Length;
2270 uint8_t RoamKeyMgmtOffloadEnabled;
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08002271 struct pmkid_mode_bits pmkid_modes;
Pragaspathi Thilagaraj1f3f99f2019-04-24 23:48:47 +05302272 bool is_adaptive_11r_connection;
Pragaspathi Thilagaraj4f529f22019-03-31 16:53:17 +05302273
2274 /* Idle/Disconnect roam parameters */
2275 struct wmi_idle_roam_params idle_roam_params;
2276 struct wmi_disconnect_roam_params disconnect_roam_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002277#endif
2278 struct roam_ext_params roam_params;
2279 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;
Pragaspathi Thilagaraj2b8ea352019-04-12 02:23:50 +05302317 struct roam_trigger_min_rssi min_rssi_params[NUM_OF_ROAM_TRIGGERS];
2318 struct roam_trigger_score_delta score_delta_param[NUM_OF_ROAM_TRIGGERS];
Jeff Johnsone6da4b02019-02-06 22:22:04 -08002319};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002320
Jeff Johnsond686ba72019-02-06 22:36:42 -08002321struct roam_offload_scan_rsp {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002322 uint8_t sessionId;
2323 uint32_t reason;
Jeff Johnsond686ba72019-02-06 22:36:42 -08002324};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002325
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002326/*---------------------------------------------------------------------------
2327 Packet Filtering Parameters
2328 ---------------------------------------------------------------------------*/
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002329#define SIR_MAX_FILTER_TEST_DATA_LEN 8
Dustin Brown4d1e8462016-12-14 12:12:24 -08002330#define SIR_MAX_FILTER_TEST_DATA_OFFSET 200
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002331#define SIR_MAX_NUM_MULTICAST_ADDRESS 240
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002332
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002333/* */
2334/* Multicast Address List Parameters */
2335/* */
2336typedef struct sSirRcvFltMcAddrList {
2337 uint32_t ulMulticastAddrCnt;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302338 struct qdf_mac_addr multicastAddr[SIR_MAX_NUM_MULTICAST_ADDRESS];
2339 struct qdf_mac_addr self_macaddr;
2340 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002341 uint8_t action;
2342} tSirRcvFltMcAddrList, *tpSirRcvFltMcAddrList;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002343
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002344/**
2345 * struct sir_wifi_start_log - Structure to store the params sent to start/
2346 * stop logging
2347 * @name: Attribute which indicates the type of logging like per packet
2348 * statistics, connectivity etc.
2349 * @verbose_level: Verbose level which can be 0,1,2,3
Poddar, Siddartheefe3482016-09-21 18:12:59 +05302350 * @is_iwpriv_command: Set 1 for iwpriv command
Srinivas Girigowdac34f11d2016-02-25 16:02:42 -08002351 * @ini_triggered: triggered using ini
2352 * @user_triggered: triggered by user
Poddar, Siddarth176c4362016-10-03 12:25:00 +05302353 * @size: pktlog buffer size
Poddar, Siddarthab99a272017-04-10 12:53:26 +05302354 * @is_pktlog_buff_clear: clear the pktlog buffer
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002355 */
2356struct sir_wifi_start_log {
2357 uint32_t ring_id;
2358 uint32_t verbose_level;
Poddar, Siddartheefe3482016-09-21 18:12:59 +05302359 uint32_t is_iwpriv_command;
Srinivas Girigowdac34f11d2016-02-25 16:02:42 -08002360 bool ini_triggered;
2361 uint8_t user_triggered;
Poddar, Siddarth176c4362016-10-03 12:25:00 +05302362 int size;
Poddar, Siddarthab99a272017-04-10 12:53:26 +05302363 bool is_pktlog_buff_clear;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002364};
2365
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002366
2367/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002368 * struct sir_pcl_list - Format of PCL
2369 * @pcl_list: List of preferred channels
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302370 * @weight_list: Weights of the PCL
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002371 * @pcl_len: Number of channels in the PCL
2372 */
2373struct sir_pcl_list {
Rajeev Kumar Sirasanagandla4133d862018-08-23 12:21:36 +05302374 uint32_t pcl_len;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002375 uint8_t pcl_list[128];
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302376 uint8_t weight_list[128];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002377};
2378
2379/**
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302380 * struct sir_pcl_chan_weights - Params to get the valid weighed list
2381 * @pcl_list: Preferred channel list already sorted in the order of preference
2382 * @pcl_len: Length of the PCL
2383 * @saved_chan_list: Valid channel list updated as part of
2384 * WMA_UPDATE_CHAN_LIST_REQ
2385 * @saved_num_chan: Length of the valid channel list
2386 * @weighed_valid_list: Weights of the valid channel list. This will have one
2387 * to one mapping with valid_chan_list. FW expects channel order and size to be
2388 * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID.
2389 * @weight_list: Weights assigned by policy manager
2390 */
2391struct sir_pcl_chan_weights {
2392 uint8_t pcl_list[128];
2393 uint32_t pcl_len;
2394 uint8_t saved_chan_list[128];
2395 uint32_t saved_num_chan;
2396 uint8_t weighed_valid_list[128];
2397 uint8_t weight_list[128];
2398};
2399
2400/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002401 * struct sir_hw_mode_params - HW mode params
2402 * @mac0_tx_ss: MAC0 Tx spatial stream
2403 * @mac0_rx_ss: MAC0 Rx spatial stream
2404 * @mac1_tx_ss: MAC1 Tx spatial stream
2405 * @mac1_rx_ss: MAC1 Rx spatial stream
2406 * @mac0_bw: MAC0 bandwidth
2407 * @mac1_bw: MAC1 bandwidth
2408 * @dbs_cap: DBS capabality
2409 * @agile_dfs_cap: Agile DFS capabality
2410 */
2411struct sir_hw_mode_params {
2412 uint8_t mac0_tx_ss;
2413 uint8_t mac0_rx_ss;
2414 uint8_t mac1_tx_ss;
2415 uint8_t mac1_rx_ss;
2416 uint8_t mac0_bw;
2417 uint8_t mac1_bw;
2418 uint8_t dbs_cap;
2419 uint8_t agile_dfs_cap;
Nitesh Shah5b7bae02016-09-28 18:58:33 +05302420 uint8_t sbs_cap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002421};
2422
2423/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002424 * struct sir_set_hw_mode_resp - HW mode response
2425 * @status: Status
2426 * @cfgd_hw_mode_index: Configured HW mode index
2427 * @num_vdev_mac_entries: Number of vdev-mac id entries
2428 * @vdev_mac_map: vdev id-mac id map
2429 */
2430struct sir_set_hw_mode_resp {
2431 uint32_t status;
2432 uint32_t cfgd_hw_mode_index;
2433 uint32_t num_vdev_mac_entries;
Tushnim Bhattacharyyaeab33dd2017-11-15 15:20:02 -08002434 struct policy_mgr_vdev_mac_map vdev_mac_map[MAX_VDEV_SUPPORTED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002435};
2436
2437/**
2438 * struct sir_hw_mode_trans_ind - HW mode transition indication
2439 * @old_hw_mode_index: Index of old HW mode
2440 * @new_hw_mode_index: Index of new HW mode
2441 * @num_vdev_mac_entries: Number of vdev-mac id entries
2442 * @vdev_mac_map: vdev id-mac id map
2443 */
2444struct sir_hw_mode_trans_ind {
2445 uint32_t old_hw_mode_index;
2446 uint32_t new_hw_mode_index;
2447 uint32_t num_vdev_mac_entries;
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08002448 struct policy_mgr_vdev_mac_map vdev_mac_map[MAX_VDEV_SUPPORTED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002449};
2450
2451/**
2452 * struct sir_dual_mac_config_resp - Dual MAC config response
2453 * @status: Status of setting the dual mac configuration
2454 */
2455struct sir_dual_mac_config_resp {
2456 uint32_t status;
2457};
2458
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -08002459/**
2460 * enum set_antenna_mode_status - Status of set antenna mode
2461 * command
2462 * @SET_ANTENNA_MODE_STATUS_OK: command successful
2463 * @SET_ANTENNA_MODE_STATUS_EINVAL: invalid antenna mode
2464 * @SET_ANTENNA_MODE_STATUS_ECANCELED: mode change cancelled
2465 * @SET_ANTENNA_MODE_STATUS_ENOTSUP: mode not supported
2466 */
2467enum set_antenna_mode_status {
2468 SET_ANTENNA_MODE_STATUS_OK,
2469 SET_ANTENNA_MODE_STATUS_EINVAL,
2470 SET_ANTENNA_MODE_STATUS_ECANCELED,
2471 SET_ANTENNA_MODE_STATUS_ENOTSUP,
2472};
2473
2474/**
2475 * struct sir_antenna_mode_resp - set antenna mode response
2476 * @status: Status of setting the antenna mode
2477 */
2478struct sir_antenna_mode_resp {
2479 enum set_antenna_mode_status status;
2480};
2481
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002482/* Reset AP Caps Changed */
2483typedef struct sSirResetAPCapsChange {
2484 uint16_t messageType;
2485 uint16_t length;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302486 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002487} tSirResetAPCapsChange, *tpSirResetAPCapsChange;
2488
2489/* / Definition for Candidate found indication from FW */
2490typedef struct sSirSmeCandidateFoundInd {
2491 uint16_t messageType; /* eWNI_SME_CANDIDATE_FOUND_IND */
2492 uint16_t length;
2493 uint8_t sessionId; /* Session Identifier */
2494} tSirSmeCandidateFoundInd, *tpSirSmeCandidateFoundInd;
2495
2496#ifdef WLAN_FEATURE_11W
2497typedef struct sSirWlanExcludeUnencryptParam {
2498 bool excludeUnencrypt;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302499 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002500} tSirWlanExcludeUnencryptParam, *tpSirWlanExcludeUnencryptParam;
2501#endif
2502
2503typedef enum {
2504 P2P_SCAN_TYPE_SEARCH = 1, /* P2P Search */
2505 P2P_SCAN_TYPE_LISTEN /* P2P Listen */
2506} tSirP2pScanType;
2507
2508typedef struct sAniHandoffReq {
2509 /* Common for all types are requests */
2510 uint16_t msgType; /* message type is same as the request type */
2511 uint16_t msgLen; /* length of the entire request */
2512 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302513 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002514 uint8_t channel;
2515 uint8_t handoff_src;
2516} tAniHandoffReq, *tpAniHandoffReq;
2517
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08002518/**
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07002519 * sir_scan_event_type - scan event types used in LIM
2520 * @SIR_SCAN_EVENT_STARTED - scan command accepted by FW
2521 * @SIR_SCAN_EVENT_COMPLETED - scan has been completed by FW
2522 * @SIR_SCAN_EVENT_BSS_CHANNEL - FW is going to move to HOME channel
2523 * @SIR_SCAN_EVENT_FOREIGN_CHANNEL - FW is going to move to FORIEGN channel
2524 * @SIR_SCAN_EVENT_DEQUEUED - scan request got dequeued
2525 * @SIR_SCAN_EVENT_PREEMPTED - preempted by other high priority scan
2526 * @SIR_SCAN_EVENT_START_FAILED - scan start failed
2527 * @SIR_SCAN_EVENT_RESTARTED - scan restarted
2528 * @SIR_SCAN_EVENT_MAX - max value for event type
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08002529*/
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07002530enum sir_scan_event_type {
2531 SIR_SCAN_EVENT_STARTED = 0x1,
2532 SIR_SCAN_EVENT_COMPLETED = 0x2,
2533 SIR_SCAN_EVENT_BSS_CHANNEL = 0x4,
2534 SIR_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
2535 SIR_SCAN_EVENT_DEQUEUED = 0x10,
2536 SIR_SCAN_EVENT_PREEMPTED = 0x20,
2537 SIR_SCAN_EVENT_START_FAILED = 0x40,
2538 SIR_SCAN_EVENT_RESTARTED = 0x80,
2539 SIR_SCAN_EVENT_MAX = 0x8000
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08002540};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002541
2542typedef struct sSirScanOffloadEvent {
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07002543 enum sir_scan_event_type event;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002544 tSirResultCodes reasonCode;
2545 uint32_t chanFreq;
2546 uint32_t requestor;
2547 uint32_t scanId;
2548 tSirP2pScanType p2pScanType;
2549 uint8_t sessionId;
2550} tSirScanOffloadEvent, *tpSirScanOffloadEvent;
2551
2552/**
2553 * struct sSirUpdateChanParam - channel parameters
2554 * @chanId: ID of the channel
2555 * @pwr: power level
2556 * @dfsSet: is dfs supported or not
2557 * @half_rate: is the channel operating at 10MHz
2558 * @quarter_rate: is the channel operating at 5MHz
2559 */
2560typedef struct sSirUpdateChanParam {
2561 uint8_t chanId;
2562 uint8_t pwr;
2563 bool dfsSet;
2564 bool half_rate;
2565 bool quarter_rate;
2566} tSirUpdateChanParam, *tpSirUpdateChanParam;
2567
2568typedef struct sSirUpdateChan {
2569 uint8_t numChan;
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07002570 uint8_t ht_en;
2571 uint8_t vht_en;
2572 uint8_t vht_24_en;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002573 tSirUpdateChanParam chanParam[1];
2574} tSirUpdateChanList, *tpSirUpdateChanList;
2575
2576typedef enum eSirAddonPsReq {
2577 eSIR_ADDON_NOTHING,
2578 eSIR_ADDON_ENABLE_UAPSD,
2579 eSIR_ADDON_DISABLE_UAPSD
2580} tSirAddonPsReq;
2581
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002582#ifdef FEATURE_WLAN_CH_AVOID
2583typedef struct sSirChAvoidUpdateReq {
2584 uint32_t reserved_param;
2585} tSirChAvoidUpdateReq;
2586#endif /* FEATURE_WLAN_CH_AVOID */
2587
Jeff Johnsone943bca2019-02-08 22:45:17 -08002588struct link_speed_info {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002589 /* MAC Address for the peer */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302590 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002591 uint32_t estLinkSpeed; /* Linkspeed from firmware */
Jeff Johnsone943bca2019-02-08 22:45:17 -08002592};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002593
Will Huanga9814592017-05-24 15:47:58 +08002594/**
2595 * struct sir_peer_info_req - peer info request struct
2596 * @peer_macaddr: MAC address
2597 * @sessionid: vdev id
2598 *
2599 * peer info request message's struct
2600 */
2601struct sir_peer_info_req {
2602 struct qdf_mac_addr peer_macaddr;
2603 uint8_t sessionid;
2604};
2605
2606/**
2607 * struct sir_peer_info - peer information struct
2608 * @peer_macaddr: MAC address
2609 * @rssi: rssi
2610 * @tx_rate: last tx rate
2611 * @rx_rate: last rx rate
2612 *
2613 * a station's information
2614 */
2615struct sir_peer_info {
2616 struct qdf_mac_addr peer_macaddr;
2617 int8_t rssi;
2618 uint32_t tx_rate;
2619 uint32_t rx_rate;
2620};
2621
2622/**
2623 * struct sir_peer_info_resp - all peers information struct
2624 * @count: peer's number
2625 * @info: peer information
2626 *
2627 * all station's information
2628 */
2629struct sir_peer_info_resp {
2630 uint8_t count;
2631 struct sir_peer_info info[0];
2632};
2633
2634/**
2635 * struct sir_peer_info_ext_req - peer info request struct
2636 * @peer_macaddr: MAC address
2637 * @sessionid: vdev id
2638 * @reset_after_request: fw reset statistics after query
2639 *
2640 * peer info request message's struct
2641 */
2642struct sir_peer_info_ext_req {
2643 struct qdf_mac_addr peer_macaddr;
2644 uint8_t sessionid;
2645 uint8_t reset_after_request;
2646};
2647
2648/**
2649 * struct sir_peer_info_ext - peer info information struct
2650 * (refer to station_info struct in Kernel)
2651 * @peer_macaddr: MAC address
2652 * @tx_packets: packets transmitted to this station
2653 * @tx_bytes: bytes transmitted to this station
2654 * @rx_packets: packets received from this station
2655 * @rx_bytes: bytes received from this station
2656 * @rx_retries: cumulative retry counts
2657 * @tx_failed: number of failed transmissions
2658 * @rssi: The signal strength
2659 * @tx_rate: last used tx bitrate (kbps)
2660 * @tx_rate_code: last tx rate code (last_tx_rate_code of wmi_peer_stats_info)
2661 * @rx_rate: last used rx bitrate (kbps)
2662 * @rx_rate_code: last rx rate code (last_rx_rate_code of wmi_peer_stats_info)
2663 *
2664 * a station's information
2665 */
2666struct sir_peer_info_ext {
2667 struct qdf_mac_addr peer_macaddr;
2668 uint32_t tx_packets;
2669 uint64_t tx_bytes;
2670 uint32_t rx_packets;
2671 uint64_t rx_bytes;
2672 uint32_t tx_retries;
2673 uint32_t tx_failed;
2674 int32_t rssi;
2675 uint32_t tx_rate;
2676 uint32_t tx_rate_code;
2677 uint32_t rx_rate;
2678 uint32_t rx_rate_code;
2679};
2680
2681/**
2682 * struct sir_peer_info_ext_resp - all peers' information struct
2683 * @count: peer's number
2684 * @info: peer information
2685 *
2686 * all station's information
2687 */
2688struct sir_peer_info_ext_resp {
2689 uint8_t count;
2690 struct sir_peer_info_ext info[0];
2691};
2692
Will Huang496b36c2017-07-11 16:38:50 +08002693/**
2694 * @sta_num: number of peer station which has valid info
2695 * @info: peer information
2696 *
2697 * all SAP peer station's information retrieved
2698 */
2699struct sir_peer_sta_info {
2700 uint8_t sta_num;
2701 struct sir_peer_info info[MAX_PEER_STA];
2702};
2703
2704/**
2705 * @sta_num: number of peer station which has valid info
2706 * @info: peer extended information
2707 *
2708 * all SAP peer station's extended information retrieved
2709 */
2710struct sir_peer_sta_ext_info {
2711 uint8_t sta_num;
2712 struct sir_peer_info_ext info[MAX_PEER_STA];
2713};
2714
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002715typedef struct sSirAddPeriodicTxPtrn {
2716 /* MAC Address for the adapter */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302717 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002718 uint8_t ucPtrnId; /* Pattern ID */
2719 uint16_t ucPtrnSize; /* Pattern size */
2720 uint32_t usPtrnIntervalMs; /* In msec */
2721 uint8_t ucPattern[PERIODIC_TX_PTRN_MAX_SIZE]; /* Pattern buffer */
2722} tSirAddPeriodicTxPtrn, *tpSirAddPeriodicTxPtrn;
2723
2724typedef struct sSirDelPeriodicTxPtrn {
2725 /* MAC Address for the adapter */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302726 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002727 uint8_t ucPtrnId; /* Pattern ID */
2728} tSirDelPeriodicTxPtrn, *tpSirDelPeriodicTxPtrn;
2729
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08002730/*---------------------------------------------------------------------------
2731* tSirIbssGetPeerInfoReqParams
2732*--------------------------------------------------------------------------*/
2733typedef struct {
2734 bool allPeerInfoReqd; /* If set, all IBSS peers stats are reported */
2735 uint8_t staIdx; /* If allPeerInfoReqd is not set, only stats */
2736 /* of peer with staIdx is reported */
2737} tSirIbssGetPeerInfoReqParams, *tpSirIbssGetPeerInfoReqParams;
2738
Rajeev Kumar94c9b452016-03-24 12:58:47 -07002739/**
2740 * typedef struct - tSirIbssGetPeerInfoParams
2741 * @mac_addr: mac address received from target
2742 * @txRate: TX rate
2743 * @mcsIndex: MCS index
Rajeev Kumar94c9b452016-03-24 12:58:47 -07002744 * @rssi: RSSI
2745 */
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08002746typedef struct {
Rajeev Kumar94c9b452016-03-24 12:58:47 -07002747 uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
2748 uint32_t txRate;
2749 uint32_t mcsIndex;
Rajeev Kumar94c9b452016-03-24 12:58:47 -07002750 int8_t rssi;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08002751} tSirIbssPeerInfoParams;
2752
2753typedef struct {
2754 uint32_t status;
2755 uint8_t numPeers;
2756 tSirIbssPeerInfoParams peerInfoParams[32];
2757} tSirPeerInfoRspParams, *tpSirIbssPeerInfoRspParams;
2758
2759/*---------------------------------------------------------------------------
2760* tSirIbssGetPeerInfoRspParams
2761*--------------------------------------------------------------------------*/
2762typedef struct {
2763 uint16_t mesgType;
2764 uint16_t mesgLen;
2765 tSirPeerInfoRspParams ibssPeerInfoRspParams;
2766} tSirIbssGetPeerInfoRspParams, *tpSirIbssGetPeerInfoRspParams;
2767
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002768#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
2769typedef struct {
2770 uint16_t mesgType;
2771 uint16_t mesgLen;
2772 bool status;
2773} tSirReadyToExtWoWInd, *tpSirReadyToExtWoWInd;
2774#endif
2775typedef struct sSirRateUpdateInd {
2776 uint8_t nss; /* 0: 1x1, 1: 2x2 */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302777 struct qdf_mac_addr bssid;
Jeff Johnsonc1e62782017-11-09 09:50:17 -08002778 enum QDF_OPMODE dev_mode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002779 int32_t bcastDataRate; /* bcast rate unit Mbpsx10, -1:not used */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002780
2781 /*
2782 * 0 implies MCAST RA, positive value implies fixed rate,
2783 * -1 implies ignore this param
2784 */
2785 int32_t reliableMcastDataRate; /* unit Mbpsx10 */
2786
2787 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07002788 enum tx_rate_info reliableMcastDataRateTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002789
2790 /*
2791 * MCAST(or BCAST) fixed data rate in 2.4 GHz, unit Mbpsx10,
2792 * 0 implies ignore
2793 */
2794 uint32_t mcastDataRate24GHz;
2795
2796 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07002797 enum tx_rate_info mcastDataRate24GHzTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002798
2799 /*
2800 * MCAST(or BCAST) fixed data rate in 5 GHz,
2801 * unit Mbpsx10, 0 implies ignore
2802 */
2803 uint32_t mcastDataRate5GHz;
2804
2805 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07002806 enum tx_rate_info mcastDataRate5GHzTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002807
2808} tSirRateUpdateInd, *tpSirRateUpdateInd;
2809
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002810#define SIR_DFS_MAX_20M_SUB_CH 8
Sandeep Puligilla949eaa72015-12-17 18:43:52 -08002811#define SIR_80MHZ_START_CENTER_CH_DIFF 6
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002812
2813typedef struct sSirSmeDfsChannelList {
2814 uint32_t nchannels;
2815 /* Ch num including bonded channels on which the RADAR is present */
2816 uint8_t channels[SIR_DFS_MAX_20M_SUB_CH];
2817} tSirSmeDfsChannelList, *tpSirSmeDfsChannelList;
2818
2819typedef struct sSirSmeDfsEventInd {
2820 uint32_t sessionId;
2821 tSirSmeDfsChannelList chan_list;
2822 uint32_t dfs_radar_status;
2823 int use_nol;
2824} tSirSmeDfsEventInd, *tpSirSmeDfsEventInd;
2825
2826typedef struct sSirChanChangeRequest {
2827 uint16_t messageType;
2828 uint16_t messageLen;
2829 uint8_t targetChannel;
Kiran Kumar Lokere999e58c2016-01-07 02:18:39 -08002830 uint8_t sec_ch_offset;
Kiran Kumar Lokere13644672016-02-29 15:40:10 -08002831 enum phy_ch_width ch_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002832 uint8_t center_freq_seg_0;
2833 uint8_t center_freq_seg_1;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302834 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002835 uint32_t dot11mode;
Bala Venkateshb39ed152017-12-26 19:35:27 +05302836 tSirNwType nw_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002837 tSirMacRateSet operational_rateset;
2838 tSirMacRateSet extended_rateset;
Arif Hussain671a1902017-03-17 09:08:32 -07002839 uint32_t cac_duration_ms;
2840 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002841} tSirChanChangeRequest, *tpSirChanChangeRequest;
2842
2843typedef struct sSirChanChangeResponse {
2844 uint8_t sessionId;
2845 uint8_t newChannelNumber;
2846 uint8_t channelChangeStatus;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002847} tSirChanChangeResponse, *tpSirChanChangeResponse;
2848
2849typedef struct sSirStartBeaconIndication {
2850 uint16_t messageType;
2851 uint16_t messageLen;
2852 uint8_t beaconStartStatus;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302853 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002854} tSirStartBeaconIndication, *tpSirStartBeaconIndication;
2855
2856/* additional IE type */
2857typedef enum tUpdateIEsType {
2858 eUPDATE_IE_NONE,
2859 eUPDATE_IE_PROBE_BCN,
2860 eUPDATE_IE_PROBE_RESP,
2861 eUPDATE_IE_ASSOC_RESP,
2862
2863 /* Add type above this line */
2864 /* this is used to reset all buffer */
2865 eUPDATE_IE_ALL,
2866 eUPDATE_IE_MAX
2867} eUpdateIEsType;
2868
2869/* Modify particular IE in addition IE for prob resp Bcn */
2870typedef struct sSirModifyIE {
Anurag Chouhan6d760662016-02-20 16:05:43 +05302871 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002872 uint16_t smeSessionId;
2873 bool notify;
2874 uint8_t ieID;
2875 uint8_t ieIDLen; /*ie length as per spec */
2876 uint16_t ieBufferlength;
2877 uint8_t *pIEBuffer;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08002878 int32_t oui_length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002879
2880} tSirModifyIE, *tpSirModifyIE;
2881
Kiran Kumar Lokerebc87bec2018-02-27 20:06:42 -08002882struct send_add_ba_req {
2883 uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
2884 struct addba_send_params param;
2885};
2886
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002887/* Message format for Update IE message sent to PE */
2888typedef struct sSirModifyIEsInd {
2889 uint16_t msgType;
2890 uint16_t msgLen;
2891 tSirModifyIE modifyIE;
2892 eUpdateIEsType updateType;
2893} tSirModifyIEsInd, *tpSirModifyIEsInd;
2894
2895/* Message format for Update IE message sent to PE */
2896typedef struct sSirUpdateIE {
Anurag Chouhan6d760662016-02-20 16:05:43 +05302897 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002898 uint16_t smeSessionId;
2899 bool append;
2900 bool notify;
2901 uint16_t ieBufferlength;
2902 uint8_t *pAdditionIEBuffer;
2903} tSirUpdateIE, *tpSirUpdateIE;
2904
2905/* Message format for Update IE message sent to PE */
2906typedef struct sSirUpdateIEsInd {
2907 uint16_t msgType;
2908 uint16_t msgLen;
2909 tSirUpdateIE updateIE;
2910 eUpdateIEsType updateType;
2911} tSirUpdateIEsInd, *tpSirUpdateIEsInd;
2912
2913/* Message format for requesting channel switch announcement to lower layers */
2914typedef struct sSirDfsCsaIeRequest {
2915 uint16_t msgType;
2916 uint16_t msgLen;
2917 uint8_t targetChannel;
2918 uint8_t csaIeRequired;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302919 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Amar Singhal5cccafe2017-02-15 12:42:58 -08002920 struct ch_params ch_params;
gaoleze2920bd2017-03-21 17:38:42 +08002921 uint8_t ch_switch_beacon_cnt;
gaolez76d2a162017-03-21 19:23:58 +08002922 uint8_t ch_switch_mode;
2923 uint8_t dfs_ch_switch_disable;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002924} tSirDfsCsaIeRequest, *tpSirDfsCsaIeRequest;
2925
2926/* Indication from lower layer indicating the completion of first beacon send
2927 * after the beacon template update
2928 */
2929typedef struct sSirFirstBeaconTxCompleteInd {
2930 uint16_t messageType; /* eWNI_SME_MISSED_BEACON_IND */
2931 uint16_t length;
Pragaspathi Thilagaraje05162d2019-05-23 13:10:46 +05302932 uint8_t bss_idx;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002933} tSirFirstBeaconTxCompleteInd, *tpSirFirstBeaconTxCompleteInd;
2934
2935typedef struct sSirSmeCSAIeTxCompleteRsp {
2936 uint8_t sessionId;
2937 uint8_t chanSwIeTxStatus;
2938} tSirSmeCSAIeTxCompleteRsp, *tpSirSmeCSAIeTxCompleteRsp;
2939
2940/* Thermal Mitigation*/
2941
2942typedef struct {
2943 uint16_t minTempThreshold;
2944 uint16_t maxTempThreshold;
2945} t_thermal_level_info, *tp_thermal_level_info;
2946
2947typedef enum {
2948 WLAN_WMA_THERMAL_LEVEL_0,
2949 WLAN_WMA_THERMAL_LEVEL_1,
2950 WLAN_WMA_THERMAL_LEVEL_2,
2951 WLAN_WMA_THERMAL_LEVEL_3,
2952 WLAN_WMA_MAX_THERMAL_LEVELS
2953} t_thermal_level;
2954
Poddar, Siddarth83905022016-04-16 17:56:08 -07002955#define WLAN_THROTTLE_DUTY_CYCLE_LEVEL_MAX (4)
2956
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002957typedef struct {
2958 /* Array of thermal levels */
2959 t_thermal_level_info thermalLevels[WLAN_WMA_MAX_THERMAL_LEVELS];
2960 uint8_t thermalCurrLevel;
2961 uint8_t thermalMgmtEnabled;
2962 uint32_t throttlePeriod;
Poddar, Siddarth83905022016-04-16 17:56:08 -07002963 uint8_t throttle_duty_cycle_tbl[WLAN_THROTTLE_DUTY_CYCLE_LEVEL_MAX];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002964} t_thermal_mgmt, *tp_thermal_mgmt;
2965
Jeff Johnson19ce8d02019-02-08 22:56:23 -08002966struct tx_power_limit {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002967 /* Thermal limits for 2g and 5g */
2968 uint32_t txPower2g;
2969 uint32_t txPower5g;
Jeff Johnson19ce8d02019-02-08 22:56:23 -08002970};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002971
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +05302972enum bad_peer_thresh_levels {
2973 WLAN_WMA_IEEE80211_B_LEVEL = 0,
2974 WLAN_WMA_IEEE80211_AG_LEVEL,
2975 WLAN_WMA_IEEE80211_N_LEVEL,
2976 WLAN_WMA_IEEE80211_AC_LEVEL,
2977 WLAN_WMA_IEEE80211_AX_LEVEL,
2978 WLAN_WMA_IEEE80211_MAX_LEVEL,
2979};
2980
2981#define NUM_OF_RATE_THRESH_MAX (4)
2982struct t_bad_peer_info {
2983 uint32_t cond;
2984 uint32_t delta;
2985 uint32_t percentage;
2986 uint32_t thresh[NUM_OF_RATE_THRESH_MAX];
2987 uint32_t txlimit;
2988};
2989
2990struct t_bad_peer_txtcl_config {
2991 /* Array of thermal levels */
2992 struct t_bad_peer_info threshold[WLAN_WMA_IEEE80211_MAX_LEVEL];
2993 uint32_t enable;
2994 uint32_t period;
2995 uint32_t txq_limit;
2996 uint32_t tgt_backoff;
2997 uint32_t tgt_report_prd;
2998};
2999
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003000/* notify MODEM power state to FW */
3001typedef struct {
3002 uint32_t param;
3003} tSirModemPowerStateInd, *tpSirModemPowerStateInd;
3004
3005#ifdef WLAN_FEATURE_STATS_EXT
3006typedef struct {
3007 uint32_t vdev_id;
3008 uint32_t event_data_len;
3009 uint8_t event_data[];
3010} tSirStatsExtEvent, *tpSirStatsExtEvent;
3011#endif
3012
Jeff Johnsona7f41dd2019-02-06 22:54:55 -08003013struct roam_offload_synch_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003014 uint16_t messageType; /*eWNI_SME_ROAM_OFFLOAD_SYNCH_IND */
3015 uint16_t length;
3016 uint16_t beaconProbeRespOffset;
3017 uint16_t beaconProbeRespLength;
3018 uint16_t reassocRespOffset;
3019 uint16_t reassocRespLength;
Naveen Rawat14298b92015-11-25 16:27:41 -08003020 uint16_t reassoc_req_offset;
3021 uint16_t reassoc_req_length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003022 uint8_t isBeacon;
Pragaspathi Thilagaraja9ecc632019-02-23 00:50:24 +05303023 uint8_t roamed_vdev_id;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303024 struct qdf_mac_addr bssid;
Varun Reddy Yeturu28925b42016-02-08 07:18:50 -08003025 struct qdf_mac_addr self_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003026 int8_t txMgmtPower;
3027 uint32_t authStatus;
3028 uint8_t rssi;
3029 uint8_t roamReason;
3030 uint32_t chan_freq;
Pragaspathi Thilagarajeb367282019-02-19 00:42:28 +05303031 uint8_t kck[KCK_256BIT_KEY_LEN];
3032 uint8_t kck_len;
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05303033 uint32_t kek_len;
3034 uint8_t kek[SIR_KEK_KEY_LEN_FILS];
3035 uint32_t pmk_len;
3036 uint8_t pmk[SIR_PMK_LEN];
Srinivas Girigowdaff8f5ef2019-03-26 17:20:55 -07003037 uint8_t pmkid[PMKID_LEN];
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05303038 bool update_erp_next_seq_num;
3039 uint16_t next_erp_seq_num;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003040 uint8_t replay_ctr[SIR_REPLAY_CTR_LEN];
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08003041 void *add_bss_params;
Jeff Johnson2df04b82019-02-02 23:30:25 -08003042 struct join_rsp *join_rsp;
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08003043 uint16_t aid;
Naveen Rawat8cc23b02016-07-14 12:22:56 -07003044 struct sir_hw_mode_trans_ind hw_mode_trans_ind;
Naveen Rawat746a90b2017-06-07 15:16:35 -07003045 uint8_t nss;
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05303046 struct qdf_mac_addr dst_mac;
3047 struct qdf_mac_addr src_mac;
3048 uint16_t hlp_data_len;
3049 uint8_t hlp_data[FILS_MAX_HLP_DATA_LEN];
Jeff Johnsona7f41dd2019-02-06 22:54:55 -08003050};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003051
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -08003052#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Jeff Johnson10cde692019-02-08 19:59:17 -08003053struct handoff_failure_ind {
3054 uint8_t vdev_id;
3055};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003056
3057struct roam_offload_synch_fail {
3058 uint8_t session_id;
3059};
3060
3061#endif
3062
Wen Gong7952fbd2018-04-18 11:27:23 +08003063/**
3064 * struct sir_wisa_params - WISA Mode Parameters
3065 * @mode: WISA mode
3066 * @session_id: Session ID of vdev
3067 */
3068struct sir_wisa_params {
3069 bool mode;
3070 uint8_t vdev_id;
3071};
3072
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003073#ifdef FEATURE_WLAN_EXTSCAN
3074
Wen Gong7952fbd2018-04-18 11:27:23 +08003075#define WLAN_EXTSCAN_MAX_CHANNELS 36
3076#define WLAN_EXTSCAN_MAX_BUCKETS 16
Wen Gong7952fbd2018-04-18 11:27:23 +08003077#define WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS 64
3078
3079typedef enum {
3080 eSIR_EXTSCAN_INVALID,
3081 eSIR_EXTSCAN_START_RSP,
3082 eSIR_EXTSCAN_STOP_RSP,
3083 eSIR_EXTSCAN_CACHED_RESULTS_RSP,
3084 eSIR_EXTSCAN_SET_BSSID_HOTLIST_RSP,
3085 eSIR_EXTSCAN_RESET_BSSID_HOTLIST_RSP,
3086 eSIR_EXTSCAN_SET_SIGNIFICANT_WIFI_CHANGE_RSP,
3087 eSIR_EXTSCAN_RESET_SIGNIFICANT_WIFI_CHANGE_RSP,
3088
3089 eSIR_EXTSCAN_GET_CAPABILITIES_IND,
3090 eSIR_EXTSCAN_HOTLIST_MATCH_IND,
3091 eSIR_EXTSCAN_SIGNIFICANT_WIFI_CHANGE_RESULTS_IND,
3092 eSIR_EXTSCAN_CACHED_RESULTS_IND,
3093 eSIR_EXTSCAN_SCAN_RES_AVAILABLE_IND,
3094 eSIR_EXTSCAN_SCAN_PROGRESS_EVENT_IND,
3095 eSIR_EXTSCAN_FULL_SCAN_RESULT_IND,
3096 eSIR_EPNO_NETWORK_FOUND_IND,
3097 eSIR_PASSPOINT_NETWORK_FOUND_IND,
3098 eSIR_EXTSCAN_SET_SSID_HOTLIST_RSP,
3099 eSIR_EXTSCAN_RESET_SSID_HOTLIST_RSP,
3100
3101 /* Keep this last */
3102 eSIR_EXTSCAN_CALLBACK_TYPE_MAX,
3103} tSirExtScanCallbackType;
3104
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003105/**
3106 * typedef enum wifi_scan_flags - wifi scan flags
3107 * @WIFI_SCAN_FLAG_INTERRUPTED: Indicates that scan results are not complete
3108 * because probes were not sent on some channels
3109 */
3110typedef enum {
3111 WIFI_SCAN_FLAG_INTERRUPTED = 1,
3112} wifi_scan_flags;
3113
3114typedef enum {
3115 WIFI_BAND_UNSPECIFIED,
3116 WIFI_BAND_BG = 1, /* 2.4 GHz */
3117 WIFI_BAND_A = 2, /* 5 GHz without DFS */
3118 WIFI_BAND_ABG = 3, /* 2.4 GHz + 5 GHz; no DFS */
3119 WIFI_BAND_A_DFS_ONLY = 4, /* 5 GHz DFS only */
3120 /* 5 is reserved */
3121 WIFI_BAND_A_WITH_DFS = 6, /* 5 GHz with DFS */
3122 WIFI_BAND_ABG_WITH_DFS = 7, /* 2.4 GHz + 5 GHz with DFS */
3123
3124 /* Keep it last */
3125 WIFI_BAND_MAX
3126} tWifiBand;
3127
Mukul Sharma45114d92016-08-12 19:34:14 +05303128/**
3129 * enum wifi_extscan_event_type - extscan event type
3130 * @WIFI_EXTSCAN_RESULTS_AVAILABLE: reported when REPORT_EVENTS_EACH_SCAN is set
3131 * and a scan cycle completes. WIFI_SCAN_THRESHOLD_NUM_SCANS or
3132 * WIFI_SCAN_THRESHOLD_PERCENT can be reported instead if the
3133 * reason for the event is available; however, at most one of
3134 * these events should be reported per scan.
3135 * @WIFI_EXTSCAN_THRESHOLD_NUM_SCANS: can be reported when
3136 * REPORT_EVENTS_EACH_SCAN is not set and
3137 * report_threshold_num_scans is reached.
3138 * @WIFI_EXTSCAN_THRESHOLD_PERCENT: can be reported when REPORT_EVENTS_EACH_SCAN
3139 * is not set and report_threshold_percent is reached.
3140 * @WIFI_SCAN_DISABLED: reported when currently executing gscans are disabled
3141 * start_gscan will need to be called again in order to continue
3142 * scanning.
3143 * @WIFI_EXTSCAN_BUCKET_STARTED_EVENT: Bucket started event
3144 * This event is consumed in driver only.
3145 * @WIFI_EXTSCAN_CYCLE_STARTED_EVENT: Cycle started event.
3146 * This event is consumed in driver only.
3147 * @WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT: Cycle complete event. This event
3148 * triggers @WIFI_EXTSCAN_RESULTS_AVAILABLE to the user space.
3149 */
3150enum wifi_extscan_event_type {
Mukul Sharmafa937be2016-08-12 18:13:36 +05303151 WIFI_EXTSCAN_RESULTS_AVAILABLE,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303152 WIFI_EXTSCAN_THRESHOLD_NUM_SCANS,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303153 WIFI_EXTSCAN_THRESHOLD_PERCENT,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303154 WIFI_SCAN_DISABLED,
3155
Mukul Sharmafa937be2016-08-12 18:13:36 +05303156 WIFI_EXTSCAN_BUCKET_STARTED_EVENT = 0x10,
3157 WIFI_EXTSCAN_CYCLE_STARTED_EVENT,
3158 WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT,
Mukul Sharma45114d92016-08-12 19:34:14 +05303159};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003160
3161/**
3162 * enum extscan_configuration_flags - extscan config flags
3163 * @EXTSCAN_LP_EXTENDED_BATCHING: extended batching
3164 */
3165enum extscan_configuration_flags {
3166 EXTSCAN_LP_EXTENDED_BATCHING = 0x00000001,
3167};
3168
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003169/**
3170 * struct ext_scan_capabilities_response - extscan capabilities response data
3171 * @requestId: request identifier
3172 * @status: status
3173 * @max_scan_cache_size: total space allocated for scan (in bytes)
3174 * @max_scan_buckets: maximum number of channel buckets
3175 * @max_ap_cache_per_scan: maximum number of APs that can be stored per scan
3176 * @max_rssi_sample_size: number of RSSI samples used for averaging RSSI
3177 * @ax_scan_reporting_threshold: max possible report_threshold
3178 * @max_hotlist_bssids: maximum number of entries for hotlist APs
3179 * @max_significant_wifi_change_aps: maximum number of entries for
3180 * significant wifi change APs
3181 * @max_bssid_history_entries: number of BSSID/RSSI entries that device can hold
3182 * @max_hotlist_ssids: maximum number of entries for hotlist SSIDs
3183 * @max_number_epno_networks: max number of epno entries
3184 * @max_number_epno_networks_by_ssid: max number of epno entries
3185 * if ssid is specified, that is, epno entries for
3186 * which an exact match is required,
3187 * or entries corresponding to hidden ssids
3188 * @max_number_of_white_listed_ssid: max number of white listed SSIDs
Padma, Santhosh Kumar1ac02402016-11-02 18:04:14 +05303189 * @max_number_of_black_listed_bssid: max number of black listed BSSIDs
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003190 */
3191struct ext_scan_capabilities_response {
3192 uint32_t requestId;
3193 uint32_t status;
3194
3195 uint32_t max_scan_cache_size;
3196 uint32_t max_scan_buckets;
3197 uint32_t max_ap_cache_per_scan;
3198 uint32_t max_rssi_sample_size;
3199 uint32_t max_scan_reporting_threshold;
3200
3201 uint32_t max_hotlist_bssids;
3202 uint32_t max_significant_wifi_change_aps;
3203
3204 uint32_t max_bssid_history_entries;
3205 uint32_t max_hotlist_ssids;
3206 uint32_t max_number_epno_networks;
3207 uint32_t max_number_epno_networks_by_ssid;
3208 uint32_t max_number_of_white_listed_ssid;
Padma, Santhosh Kumar1ac02402016-11-02 18:04:14 +05303209 uint32_t max_number_of_black_listed_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003210};
3211
3212typedef struct {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003213 /* Time of discovery */
3214 uint64_t ts;
3215
3216 /* Null terminated SSID */
Srinivas Girigowdab8fdc642019-03-19 15:33:03 -07003217 uint8_t ssid[WLAN_SSID_MAX_LEN + 1];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003218
Anurag Chouhan6d760662016-02-20 16:05:43 +05303219 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003220
3221 /* Frequency in MHz */
3222 uint32_t channel;
3223
3224 /* RSSI in dBm */
3225 int32_t rssi;
3226
3227 /* RTT in nanoseconds */
3228 uint32_t rtt;
3229
3230 /* Standard deviation in rtt */
3231 uint32_t rtt_sd;
3232
3233 /* Period advertised in the beacon */
3234 uint16_t beaconPeriod;
3235
3236 /* Capabilities advertised in the beacon */
3237 uint16_t capability;
3238
3239 uint16_t ieLength;
3240
3241 uint8_t ieData[];
3242} tSirWifiScanResult, *tpSirWifiScanResult;
3243
3244/**
3245 * struct extscan_hotlist_match - extscan hotlist match
3246 * @requestId: request identifier
3247 * @numOfAps: number of bssids retrieved by the scan
3248 * @moreData: 0 - for last fragment
3249 * 1 - still more fragment(s) coming
3250 * @ap: wifi scan result
3251 */
3252struct extscan_hotlist_match {
3253 uint32_t requestId;
3254 bool moreData;
3255 bool ap_found;
3256 uint32_t numOfAps;
3257 tSirWifiScanResult ap[];
3258};
3259
3260/**
3261 * struct extscan_cached_scan_result - extscan cached scan result
3262 * @scan_id: a unique identifier for the scan unit
3263 * @flags: a bitmask with additional information about scan
3264 * @num_results: number of bssids retrieved by the scan
Mukul Sharmaf7cb3ab2016-08-12 19:53:52 +05303265 * @buckets_scanned: bitmask of buckets scanned in current extscan cycle
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003266 * @ap: wifi scan bssid results info
3267 */
3268struct extscan_cached_scan_result {
3269 uint32_t scan_id;
3270 uint32_t flags;
3271 uint32_t num_results;
Mukul Sharmaf7cb3ab2016-08-12 19:53:52 +05303272 uint32_t buckets_scanned;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003273 tSirWifiScanResult *ap;
3274};
3275
3276/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003277 * struct extscan_cached_scan_results - extscan cached scan results
3278 * @request_id: request identifier
3279 * @more_data: 0 - for last fragment
3280 * 1 - still more fragment(s) coming
3281 * @num_scan_ids: number of scan ids
3282 * @result: wifi scan result
3283 */
3284struct extscan_cached_scan_results {
3285 uint32_t request_id;
3286 bool more_data;
3287 uint32_t num_scan_ids;
3288 struct extscan_cached_scan_result *result;
3289};
3290
3291
3292/**
3293 * struct tSirWifiFullScanResultEvent - extscan full scan event
3294 * @request_id: request identifier
3295 * @moreData: 0 - for last fragment
3296 * 1 - still more fragment(s) coming
3297 * @ap: bssid info
3298 *
Jeff Johnsondab58602018-07-14 15:30:24 -07003299 * Reported when each probe response is received, if report_events
3300 * enabled in struct wifi_scan_cmd_req_params
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003301 */
3302typedef struct {
3303 uint32_t requestId;
3304 bool moreData;
3305 tSirWifiScanResult ap;
3306} tSirWifiFullScanResultEvent, *tpSirWifiFullScanResultEvent;
3307
3308/**
3309 * struct pno_match_found - epno match found
3310 * @request_id: request identifier
3311 * @moreData: 0 - for last fragment
3312 * 1 - still more fragment(s) coming
3313 * @num_results: number of bssids, driver sends this event to upper layer
3314 * for every beacon, hence %num_results is always set to 1.
3315 * @ap: bssid info
3316 *
3317 * Reported when each beacon probe response is received with
3318 * epno match found tag.
3319 */
3320struct pno_match_found {
3321 uint32_t request_id;
3322 bool more_data;
3323 uint32_t num_results;
3324 tSirWifiScanResult ap[];
3325};
3326
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003327/**
3328 * struct sir_extscan_generic_response -
3329 * Generic ExtScan Response structure
3330 * @request_id: ID of the request
3331 * @status: operation status returned by firmware
3332 */
3333struct sir_extscan_generic_response {
3334 uint32_t request_id;
3335 uint32_t status;
3336};
3337
3338typedef struct {
Anurag Chouhan6d760662016-02-20 16:05:43 +05303339 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003340 uint32_t channel;
3341 uint32_t numOfRssi;
3342
3343 /* Rssi history in db */
3344 int32_t rssi[];
3345} tSirWifiSignificantChange, *tpSirWifiSignificantChange;
3346
3347typedef struct {
3348 uint32_t requestId;
3349
3350 bool moreData;
3351 uint32_t numResults;
3352 tSirWifiSignificantChange ap[];
3353} tSirWifiSignificantChangeEvent, *tpSirWifiSignificantChangeEvent;
3354
3355typedef struct {
3356 uint32_t requestId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003357 uint32_t numResultsAvailable;
3358} tSirExtScanResultsAvailableIndParams, *tpSirExtScanResultsAvailableIndParams;
3359
3360typedef struct {
3361 uint32_t requestId;
3362 uint32_t status;
3363 uint8_t scanEventType;
Mukul Sharmafa937be2016-08-12 18:13:36 +05303364 uint32_t buckets_scanned;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003365} tSirExtScanOnScanEventIndParams, *tpSirExtScanOnScanEventIndParams;
3366
Mukul Sharmae8c919f2016-10-02 20:35:15 +05303367#define MAX_EPNO_NETWORKS 64
3368
Jeff Johnson96f93a32016-11-18 11:02:24 -08003369#define SIR_PASSPOINT_LIST_MAX_NETWORKS 8
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003370
3371/**
3372 * struct wifi_passpoint_match - wifi passpoint network match
3373 * @id: network block identifier for the matched network
3374 * @anqp_len: length of ANQP blob
3375 * @ap: scan result, with channel and beacon information
3376 * @anqp: ANQP data, in the information_element format
3377 */
3378struct wifi_passpoint_match {
3379 uint32_t request_id;
3380 uint32_t id;
3381 uint32_t anqp_len;
3382 tSirWifiScanResult ap;
3383 uint8_t anqp[];
3384};
3385#endif /* FEATURE_WLAN_EXTSCAN */
3386
3387#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
Jeff Johnsona9ade7d2019-02-17 10:08:17 -08003388struct auto_shutdown_cmd {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003389 uint32_t timer_val;
Jeff Johnsona9ade7d2019-02-17 10:08:17 -08003390};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003391#endif
3392
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05303393#ifdef WLAN_POWER_DEBUGFS
3394/**
3395 * struct power_stats_response - Power stats response
3396 * @cumulative_sleep_time_ms: cumulative sleep time in ms
3397 * @cumulative_total_on_time_ms: total awake time in ms
3398 * @deep_sleep_enter_counter: deep sleep enter counter
3399 * @last_deep_sleep_enter_tstamp_ms: last deep sleep enter timestamp
3400 * @debug_register_fmt: debug registers format
3401 * @num_debug_register: number of debug registers
3402 * @debug_registers: Pointer to the debug registers buffer
3403 */
3404struct power_stats_response {
3405 uint32_t cumulative_sleep_time_ms;
3406 uint32_t cumulative_total_on_time_ms;
3407 uint32_t deep_sleep_enter_counter;
3408 uint32_t last_deep_sleep_enter_tstamp_ms;
3409 uint32_t debug_register_fmt;
3410 uint32_t num_debug_register;
3411 uint32_t *debug_registers;
3412};
3413#endif
3414
Arunk Khandavallica56d4b2018-11-29 15:46:00 +05303415#ifdef WLAN_FEATURE_BEACON_RECEPTION_STATS
3416#define MAX_BCNMISS_BITMAP 8
3417/**
3418 * struct bcn_reception_stats_rsp - beacon stats response
3419 * @total_bcn_cnt: total beacon count (tbtt instances)
3420 * @total_bmiss_cnt: Total beacon miss count in last 255 beacons, max 255
3421 * @bmiss_bitmap: This bitmap indicates the status of the last 255 beacons.
3422 * If a bit is set, that means the corresponding beacon was missed.
3423 * Bit 0 of bmiss_bitmap[0] represents the most recent beacon.
3424 * The total_bcn_cnt field indicates how many bits within bmiss_bitmap
3425 * are valid.
3426 */
3427struct bcn_reception_stats_rsp {
3428 uint32_t vdev_id;
3429 uint32_t total_bcn_cnt;
3430 uint32_t total_bmiss_cnt;
3431 uint32_t bmiss_bitmap[MAX_BCNMISS_BITMAP];
3432};
3433#endif
3434
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +05303435/**
3436 * struct lfr_firmware_status - LFR status in firmware
3437 * @is_disabled: Is LFR disabled in FW
3438 * @disable_lfr_event: Disable attempt done in FW
3439 */
3440struct lfr_firmware_status {
3441 uint32_t is_disabled;
3442 struct completion disable_lfr_event;
3443};
3444
3445/**
3446 * struct rso_cmd_status - RSO Command status
3447 * @vdev_id: Vdev ID for which RSO command sent
3448 * @status: Status of RSO command sent to FW
3449 */
3450struct rso_cmd_status {
3451 uint32_t vdev_id;
3452 bool status;
3453};
3454
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003455enum {
3456 SIR_AP_RX_DATA_OFFLOAD = 0x00,
3457 SIR_STA_RX_DATA_OFFLOAD = 0x01,
3458};
3459
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07003460/**
Naveen Rawata410c5a2016-09-19 14:22:33 -07003461 * struct sir_set_vdev_ies_per_band
3462 * @msg_type: message type
3463 * @len: message length
3464 * @vdev_id: vdev id
3465 *
3466 * Message wrapper structure for eWNI_SME_SET_VDEV_IES_PER_BAND.
3467 */
3468struct sir_set_vdev_ies_per_band {
3469 uint16_t msg_type;
3470 uint16_t len;
3471 uint32_t vdev_id;
3472};
3473
3474/**
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07003475 * struct sir_set_ht_vht_cfg - ht, vht IE config
3476 * @msg_type: message type
3477 * @len: message length
3478 * @pdev_id: pdev id
3479 * @nss: Nss value
3480 * @dot11mode: Dot11 mode.
3481 *
3482 * Message wrapper structure for set HT/VHT IE req.
3483 */
3484struct sir_set_ht_vht_cfg {
3485 uint16_t msg_type;
3486 uint16_t len;
3487 uint32_t pdev_id;
3488 uint32_t nss;
3489 uint32_t dot11mode;
3490};
3491
Qiwei Cai3719efe2018-06-11 21:09:29 +08003492#define WIFI_INVALID_PEER_ID (-1)
3493#define WIFI_INVALID_VDEV_ID (-1)
3494#define WIFI_MAX_AC (4)
3495
3496typedef struct {
3497 uint32_t paramId;
3498 uint8_t ifaceId;
3499 uint32_t rspId;
3500 uint32_t moreResultToFollow;
3501 uint32_t nr_received;
3502 union {
3503 uint32_t num_peers;
3504 uint32_t num_radio;
3505 };
3506
3507 uint32_t peer_event_number;
3508 /* Variable length field - Do not add anything after this */
3509 uint8_t results[0];
3510} tSirLLStatsResults, *tpSirLLStatsResults;
3511
3512#ifdef WLAN_FEATURE_LINK_LAYER_STATS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003513/*---------------------------------------------------------------------------
3514 WLAN_HAL_LL_NOTIFY_STATS
3515 ---------------------------------------------------------------------------*/
3516
3517/******************************LINK LAYER Statistics**********************/
3518
Qiwei Cai3719efe2018-06-11 21:09:29 +08003519typedef struct {
3520 uint32_t reqId;
3521 uint8_t staId;
3522 uint32_t mpduSizeThreshold;
3523 uint32_t aggressiveStatisticsGathering;
3524} tSirLLStatsSetReq, *tpSirLLStatsSetReq;
3525
3526typedef struct {
3527 uint32_t reqId;
3528 uint8_t staId;
3529 uint32_t paramIdMask;
3530} tSirLLStatsGetReq, *tpSirLLStatsGetReq;
3531
3532typedef struct {
3533 uint32_t reqId;
3534 uint8_t staId;
3535 uint32_t statsClearReqMask;
3536 uint8_t stopReq;
3537} tSirLLStatsClearReq, *tpSirLLStatsClearReq;
3538
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003539typedef enum {
3540 WIFI_DISCONNECTED = 0,
3541 WIFI_AUTHENTICATING = 1,
3542 WIFI_ASSOCIATING = 2,
3543 WIFI_ASSOCIATED = 3,
3544 WIFI_EAPOL_STARTED = 4, /* if done by firmware/driver */
3545 WIFI_EAPOL_COMPLETED = 5, /* if done by firmware/driver */
3546} tSirWifiConnectionState;
3547
3548typedef enum {
3549 WIFI_ROAMING_IDLE = 0,
3550 WIFI_ROAMING_ACTIVE = 1,
3551} tSirWifiRoamState;
3552
3553typedef enum {
3554 WIFI_INTERFACE_STA = 0,
3555 WIFI_INTERFACE_SOFTAP = 1,
3556 WIFI_INTERFACE_IBSS = 2,
3557 WIFI_INTERFACE_P2P_CLIENT = 3,
3558 WIFI_INTERFACE_P2P_GO = 4,
3559 WIFI_INTERFACE_NAN = 5,
3560 WIFI_INTERFACE_MESH = 6,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -07003561 WIFI_INTERFACE_NDI = 7,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003562} tSirWifiInterfaceMode;
3563
3564/* set for QOS association */
3565#define WIFI_CAPABILITY_QOS 0x00000001
3566/* set for protected assoc (802.11 beacon frame control protected bit set) */
3567#define WIFI_CAPABILITY_PROTECTED 0x00000002
3568/* set if 802.11 Extended Capabilities element interworking bit is set */
3569#define WIFI_CAPABILITY_INTERWORKING 0x00000004
3570/* set for HS20 association */
3571#define WIFI_CAPABILITY_HS20 0x00000008
3572/* set is 802.11 Extended Capabilities element UTF-8 SSID bit is set */
3573#define WIFI_CAPABILITY_SSID_UTF8 0x00000010
3574/* set is 802.11 Country Element is present */
3575#define WIFI_CAPABILITY_COUNTRY 0x00000020
3576
Jeff Johnsonc9770ee2019-03-08 15:56:52 -08003577struct wifi_interface_info {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003578 /* tSirWifiInterfaceMode */
3579 /* interface mode */
3580 uint8_t mode;
3581 /* interface mac address (self) */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303582 struct qdf_mac_addr macAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003583 /* tSirWifiConnectionState */
3584 /* connection state (valid for STA, CLI only) */
3585 uint8_t state;
3586 /* tSirWifiRoamState */
3587 /* roaming state */
3588 uint32_t roaming;
3589 /* WIFI_CAPABILITY_XXX (self) */
3590 uint32_t capabilities;
3591 /* null terminated SSID */
3592 uint8_t ssid[33];
3593 /* bssid */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303594 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003595 /* country string advertised by AP */
Wu Gaoaa155142019-01-14 15:09:26 +08003596 uint8_t apCountryStr[CFG_COUNTRY_CODE_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003597 /* country string for this association */
Wu Gaoaa155142019-01-14 15:09:26 +08003598 uint8_t countryStr[CFG_COUNTRY_CODE_LEN];
Jeff Johnsonc9770ee2019-03-08 15:56:52 -08003599};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003600
Jeff Johnson17ba70a2019-03-30 08:34:14 -07003601/**
3602 * struct wifi_channel_info - channel information
3603 * @width: channel width (20, 40, 80, 80+80, 160)
3604 * @center_freq: primary 20 MHz channel
3605 * @center_freq0: center frequency (MHz) first segment
3606 * @center_freq1: center frequency (MHz) second segment
3607 */
3608struct wifi_channel_info {
Jeff Johnson1043f522019-03-29 11:32:51 -07003609 enum phy_ch_width width;
Jeff Johnson17ba70a2019-03-30 08:34:14 -07003610 uint32_t center_freq;
3611 uint32_t center_freq0;
3612 uint32_t center_freq1;
3613};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003614
Jeff Johnsonb67be242019-03-30 10:25:53 -07003615/**
3616 * struct wifi_rate_info - wifi rate information
3617 * @preamble: 0:OFDM, 1:CCK, 2:HT 3:VHT 4..7 reserved
3618 * @nss: 0:1x1, 1:2x2, 3:3x3, 4:4x4
3619 * @bw: 0:20MHz, 1:40Mhz, 2:80Mhz, 3:160Mhz
3620 * @rate_or_mcs_index:
3621 * * OFDM/CCK: rate code per ieee std in units of 0.5mbps
3622 * * HT/VHT: mcs index
3623 * @reserved: reserved
3624 * @bitrate: bitrate units of 100 Kbps
3625 */
3626struct wifi_rate_info {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003627 uint32_t preamble:3;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003628 uint32_t nss:2;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003629 uint32_t bw:3;
Jeff Johnsonb67be242019-03-30 10:25:53 -07003630 uint32_t rate_or_mcs_index:8;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003631 uint32_t reserved:16;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003632 uint32_t bitrate;
Jeff Johnsonb67be242019-03-30 10:25:53 -07003633};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003634
Jeff Johnson4ee14f42019-03-30 10:43:37 -07003635/**
3636 * struct wifi_channel_stats - channel statistics
3637 * @channel: channel for which the stats are applicable
3638 * @on_time: msecs the radio is awake
3639 * @cca_busy_time: secs the CCA register is busy
3640 */
3641struct wifi_channel_stats {
Jeff Johnson17ba70a2019-03-30 08:34:14 -07003642 struct wifi_channel_info channel;
Jeff Johnson4ee14f42019-03-30 10:43:37 -07003643 uint32_t on_time;
3644 uint32_t cca_busy_time;
3645};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003646
Jeff Johnsone4bba7c2019-03-30 11:58:51 -07003647/**
3648 * struct wifi_radio_stats - per-radio statistics
3649 * @radio: wifi radio for which the stats are applicable
3650 * @on_time: msecs the radio is awake
3651 * @tx_time: msecs the radio is transmitting
3652 * @rx_time: msecs the radio is in active receive
3653 * @on_time_scan: msecs the radio is awake due to all scan
3654 * @on_time_nbd: msecs the radio is awake due to NAN
3655 * @on_time_gscan: msecs the radio is awake due to Gscan
3656 * @on_time_roam_scan: msecs the radio is awake due to roam scan
3657 * @on_time_pno_scan: msecs the radio is awake due to PNO scan
3658 * @on_time_hs20: msecs the radio is awake due to HS2.0 scans and GAS exchange
3659 * @on_time_host_scan: msecs the radio is awake due to Host initiated scan
3660 * @on_time_lpi_scan: msecs the radio is awake due to LPI scan
3661 * @total_num_tx_power_levels: @tx_time_per_power_level record count
3662 * @tx_time_per_power_level: tx time (in milliseconds) per TPC level (0.5 dBm)
3663 * @num_channels: @channels record count
3664 * @channels: per-channel statistics
3665 */
3666struct wifi_radio_stats {
Jeff Johnson48b1eb02019-03-30 15:07:52 -07003667 uint32_t radio;
Jeff Johnsone4bba7c2019-03-30 11:58:51 -07003668 uint32_t on_time;
3669 uint32_t tx_time;
3670 uint32_t rx_time;
3671 uint32_t on_time_scan;
3672 uint32_t on_time_nbd;
3673 uint32_t on_time_gscan;
3674 uint32_t on_time_roam_scan;
3675 uint32_t on_time_pno_scan;
3676 uint32_t on_time_hs20;
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08003677 uint32_t on_time_host_scan;
3678 uint32_t on_time_lpi_scan;
Jeff Johnsone4bba7c2019-03-30 11:58:51 -07003679 uint32_t total_num_tx_power_levels;
3680 uint32_t *tx_time_per_power_level;
3681 uint32_t num_channels;
Jeff Johnson4ee14f42019-03-30 10:43:37 -07003682 struct wifi_channel_stats *channels;
Jeff Johnsone4bba7c2019-03-30 11:58:51 -07003683};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003684
Jeff Johnsond3b3b112019-03-28 12:56:04 -07003685/**
3686 * struct wifi_rate_stat - per rate statistics
3687 * @rate: rate information
3688 * @tx_mpdu: number of successfully transmitted data pkts (ACK rcvd)
3689 * @rx_mpdu: number of received data pkts
3690 * @mpdu_lost: number of data packet losses (no ACK)
3691 * @retries: total number of data pkt retries *
3692 * @retries_short: number of short data pkt retries
3693 * @retries_long: number of long data pkt retries
3694 */
3695struct wifi_rate_stat {
Jeff Johnsonb67be242019-03-30 10:25:53 -07003696 struct wifi_rate_info rate;
Jeff Johnsond3b3b112019-03-28 12:56:04 -07003697 uint32_t tx_mpdu;
3698 uint32_t rx_mpdu;
3699 uint32_t mpdu_lost;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003700 uint32_t retries;
Jeff Johnsond3b3b112019-03-28 12:56:04 -07003701 uint32_t retries_short;
3702 uint32_t retries_long;
3703};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003704
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003705/* wifi peer type */
3706typedef enum {
3707 WIFI_PEER_STA,
3708 WIFI_PEER_AP,
3709 WIFI_PEER_P2P_GO,
3710 WIFI_PEER_P2P_CLIENT,
3711 WIFI_PEER_NAN,
3712 WIFI_PEER_TDLS,
3713 WIFI_PEER_INVALID,
3714} tSirWifiPeerType;
3715
Jeff Johnson10495032019-03-28 13:51:59 -07003716/**
3717 * struct wifi_peer_info - per peer information
3718 * @type: peer type (AP, TDLS, GO etc.)
3719 * @peer_macaddr: mac address
3720 * @capabilities: peer WIFI_CAPABILITY_XXX
3721 * @power_saving: peer power saving mode
3722 * @num_rate: number of rates
3723 * @rate_stats: per rate statistics, number of entries = @num_rate
3724 */
3725struct wifi_peer_info {
Dustin Brown877a5a92016-11-17 13:56:52 -08003726 enum wmi_peer_type type;
Jeff Johnson10495032019-03-28 13:51:59 -07003727 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003728 uint32_t capabilities;
Zhang Qiana6e9c102016-12-22 16:47:24 +08003729 union {
Zhang Qiana6e9c102016-12-22 16:47:24 +08003730 uint32_t power_saving;
Jeff Johnson10495032019-03-28 13:51:59 -07003731 uint32_t num_rate;
Zhang Qiana6e9c102016-12-22 16:47:24 +08003732 };
Jeff Johnson10495032019-03-28 13:51:59 -07003733 struct wifi_rate_stat rate_stats[0];
3734};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003735
Jeff Johnsonaf545282019-04-01 12:18:59 -07003736/**
3737 * struct wifi_interface_stats - Interface statistics
3738 * @info: struct containing the current state of the interface
3739 * @rts_succ_cnt: number of RTS/CTS sequence success
3740 * @rts_fail_cnt: number of RTS/CTS sequence failures
3741 * @ppdu_succ_cnt: number of PPDUs transmitted
3742 * @ppdu_fail_cnt: number of PPDUs that failed to transmit
3743 * @link_stats: link-level statistics
3744 * @ac_stats: per-Access Category statistics
3745 * @num_offload_stats: @offload_stats record count
3746 * @offload_stats: per-offload statistics
3747 *
3748 * Statistics corresponding to 2nd most LSB in wifi statistics bitmap
3749 * for getting statistics
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003750 */
Jeff Johnsonaf545282019-04-01 12:18:59 -07003751struct wifi_interface_stats {
Jeff Johnsonc9770ee2019-03-08 15:56:52 -08003752 struct wifi_interface_info info;
gaolezb432ed92017-03-16 18:40:04 +08003753 uint32_t rts_succ_cnt;
3754 uint32_t rts_fail_cnt;
3755 uint32_t ppdu_succ_cnt;
3756 uint32_t ppdu_fail_cnt;
Min Liuffb250d2018-07-11 17:35:32 +08003757 wmi_iface_link_stats link_stats;
Min Liuffb250d2018-07-11 17:35:32 +08003758 wmi_wmm_ac_stats ac_stats[WIFI_AC_MAX];
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08003759 uint32_t num_offload_stats;
Min Liuffb250d2018-07-11 17:35:32 +08003760 wmi_iface_offload_stats offload_stats[WMI_OFFLOAD_STATS_TYPE_MAX];
Jeff Johnsonaf545282019-04-01 12:18:59 -07003761};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003762
Jeff Johnsonfcb078d2019-03-28 14:34:01 -07003763/**
3764 * struct wifi_peer_stat - peer statistics
3765 * @num_peers: number of peers
3766 * @peer_info: per peer statistics
3767 *
3768 * Peer statistics - corresponding to 3rd most LSB in
3769 * wifi statistics bitmap for getting statistics
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003770 */
Jeff Johnsonfcb078d2019-03-28 14:34:01 -07003771struct wifi_peer_stat {
3772 uint32_t num_peers;
3773 struct wifi_peer_info peer_info[0];
3774};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003775
3776/* wifi statistics bitmap for getting statistics */
3777#define WMI_LINK_STATS_RADIO 0x00000001
3778#define WMI_LINK_STATS_IFACE 0x00000002
3779#define WMI_LINK_STATS_ALL_PEER 0x00000004
3780#define WMI_LINK_STATS_PER_PEER 0x00000008
3781
3782/* wifi statistics bitmap for clearing statistics */
3783/* all radio statistics */
3784#define WIFI_STATS_RADIO 0x00000001
3785/* cca_busy_time (within radio statistics) */
3786#define WIFI_STATS_RADIO_CCA 0x00000002
3787/* all channel statistics (within radio statistics) */
3788#define WIFI_STATS_RADIO_CHANNELS 0x00000004
3789/* all scan statistics (within radio statistics) */
3790#define WIFI_STATS_RADIO_SCAN 0x00000008
3791/* all interface statistics */
3792#define WIFI_STATS_IFACE 0x00000010
3793/* all tx rate statistics (within interface statistics) */
3794#define WIFI_STATS_IFACE_TXRATE 0x00000020
3795/* all ac statistics (within interface statistics) */
3796#define WIFI_STATS_IFACE_AC 0x00000040
3797/* all contention (min, max, avg) statistics (within ac statistics) */
3798#define WIFI_STATS_IFACE_CONTENTION 0x00000080
Mukul Sharma491021c2016-09-29 21:39:19 +05303799/* All peer stats on this interface */
3800#define WIFI_STATS_IFACE_ALL_PEER 0x00000100
3801/* Clear particular peer stats depending on the peer_mac */
3802#define WIFI_STATS_IFACE_PER_PEER 0x00000200
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003803
Zhang Qiana6e9c102016-12-22 16:47:24 +08003804/**
3805 * struct sir_wifi_iface_tx_fail - TX failure event
3806 * @tid: TX TID
3807 * @msdu_num: TX MSDU failed counter
3808 * @status: TX status from HTT message.
3809 * Only failure status will be involved.
3810 */
3811struct sir_wifi_iface_tx_fail {
3812 uint8_t tid;
3813 uint16_t msdu_num;
3814 enum htt_tx_status status;
3815};
3816
Zhang Qian73c348a2017-03-13 16:15:55 +08003817/**
3818 * struct sir_wifi_chan_cca_stats - channal CCA stats
3819 * @vdev_id: vdev ID
3820 * @idle_time: percentage of idle time, no TX, no RX, no interference
3821 * @tx_time: percentage of time transmitting packets
3822 * @rx_in_bss_time: percentage of time receiving packets in current BSS
3823 * @rx_out_bss_time: percentage of time receiving packets not in current BSS
3824 * @rx_busy_time: percentage of time interference detected
3825 * @rx_in_bad_cond_time: percentage of time receiving packets with errors
3826 * or packets flagged as retransmission or seqnum discontinued.
3827 * @tx_in_bad_cond_time: percentage of time the device transmitted packets
3828 * that haven't been ACKed.
3829 * @wlan_not_avail_time: percentage of time the chip is unable to
3830 * work in normal conditions.
3831 */
3832struct sir_wifi_chan_cca_stats {
3833 uint32_t vdev_id;
3834 uint32_t idle_time;
3835 uint32_t tx_time;
3836 uint32_t rx_in_bss_time;
3837 uint32_t rx_out_bss_time;
3838 uint32_t rx_busy_time;
3839 uint32_t rx_in_bad_cond_time;
3840 uint32_t tx_in_bad_cond_time;
3841 uint32_t wlan_not_avail_time;
3842};
3843
3844#define WIFI_MAX_CHAINS 8
3845
3846/**
3847 * struct sir_wifi_peer_signal_stats - peer signal stats
3848 * @vdev_id: vdev ID
3849 * @peer_id: peer ID
3850 * @per_ant_snr: per antenna SNR
3851 * @nf: peer background noise
Zhang Qian303ebe92017-05-18 13:59:07 +08003852 * @per_ant_rx_mpdus: MPDUs received per antenna
3853 * @per_ant_tx_mpdus: MPDUs transferred per antenna
3854 * @num_chain: valid chain count
Zhang Qian73c348a2017-03-13 16:15:55 +08003855 */
3856struct sir_wifi_peer_signal_stats {
3857 uint32_t vdev_id;
3858 uint32_t peer_id;
3859
3860 /* per antenna SNR in current bss */
3861 int32_t per_ant_snr[WIFI_MAX_CHAINS];
3862
3863 /* Background noise */
3864 int32_t nf[WIFI_MAX_CHAINS];
Zhang Qian303ebe92017-05-18 13:59:07 +08003865
Ashish Kumar Dhanotiya5d2f25a2019-02-25 21:06:00 +05303866 uint32_t per_ant_rx_mpdus[WIFI_MAX_CHAINS];
3867 uint32_t per_ant_tx_mpdus[WIFI_MAX_CHAINS];
3868 uint32_t num_chain;
Zhang Qian73c348a2017-03-13 16:15:55 +08003869};
3870
3871#define WIFI_VDEV_NUM 4
3872#define WFIF_MCS_NUM 10
3873#define WIFI_AGGR_NUM 8
3874#define WIFI_DELAY_SIZE 11
3875
3876/**
3877 * struct sir_wifi_tx - per AC tx stats
3878 * @msdus: number of totoal MSDUs on MAC layer in the period
3879 * @mpdus: number of totoal MPDUs on MAC layer in the period
3880 * @ppdus: number of totoal PPDUs on PHY layer in the period
3881 * @bytes: bytes of tx data on MAC layer in the period
3882 * @drops: number of TX packets cancelled due to any reason in the period,
3883 * such as WMM limitation/bandwidth limitation/radio congestion
3884 * @drop_bytes: bytes of dropped TX packets in the period
3885 * @retries: number of unacked transmissions of MPDUs
3886 * @failed: number of packets have not been ACKed despite retried
3887 * @aggr_len: length of the MPDU aggregation size buffer
3888 * @mpdu_aggr_size: histogram of MPDU aggregation size
3889 * @success_mcs_len: length of success mcs buffer
3890 * @success_mcs: histogram of successed received MPDUs encoding rate
3891 * @fail_mcs_len: length of failed mcs buffer
3892 * @fail_mcs: histogram of failed received MPDUs encoding rate
3893 * @delay_len: length of the delay histofram buffer
3894 * @delay: histogram of delays on MAC layer
3895 */
3896struct sir_wifi_tx {
3897 uint32_t msdus;
3898 uint32_t mpdus;
3899 uint32_t ppdus;
3900 uint32_t bytes;
3901 uint32_t drops;
3902 uint32_t drop_bytes;
3903 uint32_t retries;
3904 uint32_t failed;
3905 uint32_t aggr_len;
3906 uint32_t *mpdu_aggr_size;
3907 uint32_t success_mcs_len;
3908 uint32_t *success_mcs;
3909 uint32_t fail_mcs_len;
3910 uint32_t *fail_mcs;
3911 uint32_t delay_len;
3912 uint32_t *delay;
3913};
3914
3915/**
3916 * struct sir_wifi_rx - per AC rx stats
3917 * @mpdus: number of RX packets on MAC layer
3918 * @bytes: bytes of RX packets on MAC layer
3919 * @ppdus: number of RX packets on PHY layer
3920 * @ppdu_bytes: bytes of RX packets on PHY layer
3921 * @mpdu_lost: number of discontinuity in seqnum
3922 * @mpdu_retry: number of RX packets flagged as retransmissions
3923 * @mpdu_dup: number of RX packets identified as duplicates
3924 * @mpdu_discard: number of RX packets discarded
3925 * @aggr_len: length of MPDU aggregation histogram buffer
3926 * @mpdu_aggr: histogram of MPDU aggregation size
3927 * @mcs_len: length of mcs histogram buffer
3928 * @mcs: histogram of encoding rate.
3929 */
3930struct sir_wifi_rx {
3931 uint32_t mpdus;
3932 uint32_t bytes;
3933 uint32_t ppdus;
3934 uint32_t ppdu_bytes;
3935 uint32_t mpdu_lost;
3936 uint32_t mpdu_retry;
3937 uint32_t mpdu_dup;
3938 uint32_t mpdu_discard;
3939 uint32_t aggr_len;
3940 uint32_t *mpdu_aggr;
3941 uint32_t mcs_len;
3942 uint32_t *mcs;
3943};
3944
3945/**
3946 * struct sir_wifi_ll_ext_wmm_ac_stats - stats for WMM AC
3947 * @type: WMM AC type
3948 * @tx_stats: pointer to TX stats
3949 * @rx_stats: pointer to RX stats
3950 */
3951struct sir_wifi_ll_ext_wmm_ac_stats {
3952 uint32_t type;
3953 struct sir_wifi_tx *tx_stats;
3954 struct sir_wifi_rx *rx_stats;
3955};
3956
Zhang Qian73c348a2017-03-13 16:15:55 +08003957/**
3958 * struct sir_wifi_ll_ext_peer_stats - per peer stats
3959 * @peer_id: peer ID
3960 * @vdev_id: VDEV ID
Jeff Johnsonaf545282019-04-01 12:18:59 -07003961 * @mac_address: MAC address
Zhang Qian73c348a2017-03-13 16:15:55 +08003962 * @sta_ps_inds: how many times STAs go to sleep
3963 * @sta_ps_durs: total sleep time of STAs (units in ms)
3964 * @rx_probe_reqs: number of probe requests received
3965 * @rx_oth_mgmts: number of other management frames received,
3966 * not including probe requests
3967 * @peer_signal_stat: signal stats
3968 * @ac_stats: WMM BE/BK/VI/VO stats
3969 */
3970struct sir_wifi_ll_ext_peer_stats {
3971 uint32_t peer_id;
3972 uint32_t vdev_id;
3973 tSirMacAddr mac_address;
3974 uint32_t sta_ps_inds;
3975 uint32_t sta_ps_durs;
3976 uint32_t rx_probe_reqs;
3977 uint32_t rx_oth_mgmts;
3978 struct sir_wifi_peer_signal_stats peer_signal_stats;
3979 struct sir_wifi_ll_ext_wmm_ac_stats ac_stats[WIFI_MAX_AC];
3980};
3981
3982/**
3983 * struct sir_wifi_ll_ext_stats - link layer stats report
3984 * @trigger_cond_id: Indicate what triggered this event.
3985 * 1: timeout. 2: threshold
3986 * @cca_chgd_bitmap: Bitmap to indicate changed channel CCA stats
3987 * which exceeded the thresholds
3988 * @sig_chgd_bitmap: Bitmap to indicate changed peer signal stats
3989 * which exceeded the thresholds
3990 * @tx_chgd_bitmap: Bitmap to indicate changed TX counters
3991 * which exceeded the thresholds
3992 * @rx_chgd_bitmap: Bitmap to indicate changed RX counters
3993 * which exceeded the thresholds
3994 * @chan_cca_stats: channel CCA stats
3995 * @peer_signal_stats: peer signal stats
3996 * @tx_mpdu_aggr_array_len: length of TX MPDU aggregation buffer
3997 * @tx_succ_mcs_array_len: length of mcs buffer for ACKed MPDUs
3998 * @tx_fail_mcs_array_len: length of mcs buffer for no-ACKed MPDUs
3999 * @tx_delay_array_len: length of delay stats buffer
4000 * @rx_mpdu_aggr_array_len: length of RX MPDU aggregation buffer
4001 * @rx_mcs_array_len: length of RX mcs stats buffer
4002 * @peer_stats: peer stats
4003 * @cca: physical channel CCA stats
4004 * @stats: pointer to stats data buffer.
4005 *
4006 * Structure of the whole statictics is like this:
4007 * ---------------------------------
4008 * | trigger_cond_i |
4009 * +-------------------------------+
4010 * | cca_chgd_bitmap |
4011 * +-------------------------------+
4012 * | sig_chgd_bitmap |
4013 * +-------------------------------+
4014 * | tx_chgd_bitmap |
4015 * +-------------------------------+
4016 * | rx_chgd_bitmap |
4017 * +-------------------------------+
4018 * | peer_num |
4019 * +-------------------------------+
4020 * | channel_num |
4021 * +-------------------------------+
4022 * | tx_mpdu_aggr_array_len |
4023 * +-------------------------------+
4024 * | tx_succ_mcs_array_len |
4025 * +-------------------------------+
4026 * | tx_fail_mcs_array_len |
4027 * +-------------------------------+
4028 * | tx_delay_array_len |
4029 * +-------------------------------+
4030 * | rx_mpdu_aggr_array_len |
4031 * +-------------------------------+
4032 * | rx_mcs_array_len |
4033 * +-------------------------------+
4034 * | pointer to CCA stats |
4035 * +-------------------------------+
4036 * | pointer to peer stats |
4037 * +-------------------------------+
4038 * | CCA stats |
4039 * +-------------------------------+
4040 * | peer_stats |----+
4041 * +-------------------------------+ |
4042 * | per peer signals stats |<---+
4043 * | peer0 ~ peern | |
4044 * +-------------------------------+ |
4045 * | TX aggr/mcs parameters array | |
4046 * | Length of this buffer is | |
4047 * | configurable for user layer. |<-+ |
4048 * +-------------------------------+ | |
4049 * | per peer tx stats |--+ |
4050 * | BE | <--+
4051 * | BK | |
4052 * | VI | |
4053 * | VO | |
4054 * +-------------------------------+ |
4055 * | TX aggr/mcs parameters array | |
4056 * | Length of this buffer is | |
4057 * | configurable for user layer. |<-+ |
4058 * +-------------------------------+ | |
4059 * | peer peer rx stats |--+ |
4060 * | BE | <--+
4061 * | BE |
4062 * | BK |
4063 * | VI |
4064 * | VO |
4065 * ---------------------------------
4066 */
4067struct sir_wifi_ll_ext_stats {
4068 uint32_t trigger_cond_id;
4069 uint32_t cca_chgd_bitmap;
4070 uint32_t sig_chgd_bitmap;
4071 uint32_t tx_chgd_bitmap;
4072 uint32_t rx_chgd_bitmap;
4073 uint8_t peer_num;
4074 uint8_t channel_num;
4075 uint32_t tx_mpdu_aggr_array_len;
4076 uint32_t tx_succ_mcs_array_len;
4077 uint32_t tx_fail_mcs_array_len;
4078 uint32_t tx_delay_array_len;
4079 uint32_t rx_mpdu_aggr_array_len;
4080 uint32_t rx_mcs_array_len;
4081 struct sir_wifi_ll_ext_peer_stats *peer_stats;
4082 struct sir_wifi_chan_cca_stats *cca;
4083 uint8_t stats[];
4084};
4085
4086/**
4087 * struct sir_channel_cca_threshold - threshold for channel CCA
4088 * @idle_time: idle time, no TX, no RX, no interference
4089 * @tx_time: time transmitting packets
4090 * @rx_in_bss_time: time receiving packets in current BSSs
4091 * @rx_out_bss_time: time receiving packets not in current BSSs
4092 * @rx_busy_time: time interference detected
4093 * @rx_in_bad_cond_time: receiving packets with errors
4094 * @tx_in_bad_cond_time: time transmitted packets not been ACKed
4095 * @wlan_not_avail_time: wlan card cannot work
4096 */
4097struct sir_channel_cca_threshold {
4098 uint32_t idle_time;
4099 uint32_t tx_time;
4100 uint32_t rx_in_bss_time;
4101 uint32_t rx_out_bss_time;
4102 uint32_t rx_busy_time;
4103 uint32_t rx_in_bad_cond_time;
4104 uint32_t tx_in_bad_cond_time;
4105 uint32_t wlan_not_avail_time;
4106};
4107
4108/**
4109 * struct sir_signal_threshold - threshold for per peer sigbal
4110 * @snr: signal to noise rate
4111 * @nf: noise floor
4112 */
4113struct sir_signal_threshold {
4114 uint32_t snr;
4115 uint32_t nf;
4116};
4117
4118/**
4119 * struct sir_tx_threshold - threshold for TX
4120 * @msdu: TX MSDUs on MAC layer
4121 * @mpdu: TX MPDUs on MAC layer
4122 * @ppdu: TX PPDUs on MAC layer
4123 * @bytes: TX bytes on MAC layer
4124 * @msdu_drop: drooped MSDUs
4125 * @byte_drop: dropped Bytes
4126 * @mpdu_retry: MPDU not acked
4127 * @ppdu_fail: PPDUs which received no block ack
4128 * @aggregation: aggregation size
4129 * @succ_mcs: histogram of encoding rate for acked PPDUs
4130 * @fail_mcs: histogram of encoding rate for no-acked PPDUs
4131 */
4132struct sir_tx_threshold {
4133 uint32_t msdu;
4134 uint32_t mpdu;
4135 uint32_t ppdu;
4136 uint32_t bytes;
4137 uint32_t msdu_drop;
4138 uint32_t byte_drop;
4139 uint32_t mpdu_retry;
4140 uint32_t mpdu_fail;
4141 uint32_t ppdu_fail;
4142 uint32_t aggregation;
4143 uint32_t succ_mcs;
4144 uint32_t fail_mcs;
4145 uint32_t delay;
4146};
4147
4148/**
4149 * struct sir_rx_threshold - threshold for RX
4150 * @mpdu: RX MPDUs on MAC layer
4151 * @bytes: RX bytes on MAC layer
4152 * @ppdu: RX PPDU on PHY layer
4153 * @ppdu_bytes: RX bytes on PHY layer
4154 * @disorder: discontinuity in seqnum
4155 * @mpdu_retry: MPDUs flagged as retry
4156 * @mpdu_dup: MPDUs identified as duplicated
4157 * @aggregation: aggregation size
4158 * @mcs: histogram of encoding rate for PPDUs
4159 * @ps_inds: power save indication
4160 * @ps_durs: total time in power save
4161 * @probe_reqs: probe request received
4162 * @other_mgmt: other MGMT frames received
4163 */
4164struct sir_rx_threshold {
4165 uint32_t mpdu;
4166 uint32_t bytes;
4167 uint32_t ppdu;
4168 uint32_t ppdu_bytes;
4169 uint32_t disorder;
4170 uint32_t mpdu_lost;
4171 uint32_t mpdu_retry;
4172 uint32_t mpdu_dup;
4173 uint32_t mpdu_discard;
4174 uint32_t aggregation;
4175 uint32_t mcs;
4176 uint32_t ps_inds;
4177 uint32_t ps_durs;
4178 uint32_t probe_reqs;
4179 uint32_t other_mgmt;
4180};
4181
4182/**
4183 * struct sir_wifi_ll_ext_stats_threshold - Threshold for stats update
4184 * @period: MAC counter indication period (unit in ms)
4185 * @enable: if threshold mechnism is enabled or disabled
4186 * @enable_bitmap: whether dedicated threshold is enabed.
4187 * Every MAC counter has a dedicated threshold. If the dedicated
4188 * threshold is not set in the bitmap, global threshold will take
4189 * effect.
4190 * @global: whether clobal threshold is enabled.
Jeff Johnsonf2cf6592018-05-06 16:27:44 -07004191 * When both global and dedicated threshold are disabled, MAC counter
Zhang Qian73c348a2017-03-13 16:15:55 +08004192 * will indicate stats periodically.
4193 * @global_threshold: global threshold value
4194 * @cca_bitmap: bitmap for CCA.
4195 * Bit0: idle time
4196 * Bit1: tx time
4197 * Bit2: RX in BSS
4198 * Bit3: RX out of BSS
4199 * Bit4: medium busy
4200 * Bit5: RX bad
4201 * Bit6: TX bad
4202 * Bit7: WLAN card not available
4203 * @signal_bitmap:
4204 * Bit0: Per channel SNR counter
4205 * Bit1: Per channel noise floor counter
4206 * @tx_bitmap: bitmap for TX counters
4207 * Bit0: TX counter unit in MSDU
4208 * Bit1: TX counter unit in MPDU
4209 * Bit2: TX counter unit in PPDU
4210 * Bit3: TX counter unit in byte
4211 * Bit4: Dropped MSDUs
4212 * Bit5: Dropped Bytes
4213 * Bit6: MPDU retry counter
4214 * Bit7: MPDU failure counter
4215 * Bit8: PPDU failure counter
4216 * Bit9: MPDU aggregation counter
4217 * Bit10: MCS counter for ACKed MPDUs
4218 * Bit11: MCS counter for Failed MPDUs
4219 * Bit12: TX Delay counter
4220 * @rx_bitmap:bitmap for RX counters
4221 * Bit0: MAC RX counter unit in MPDU
4222 * Bit1: MAC RX counter unit in byte
4223 * Bit2: PHY RX counter unit in PPDU
4224 * Bit3: PHY RX counter unit in byte
4225 * Bit4: Disorder counter
4226 * Bit5: Retry counter
4227 * Bit6: Duplication counter
4228 * Bit7: Discard counter
4229 * Bit8: MPDU aggregation size counter
4230 * Bit9: MCS counter
4231 * Bit10: Peer STA power state change (wake to sleep) counter
4232 * Bit11: Peer STA power save counter, total time in PS mode
4233 * Bit12: Probe request counter
4234 * Bit13: Other management frames counter
4235 * @cca_thresh: CCA threshold
4236 * @signal_thresh: signal threshold
4237 * @tx_thresh: TX threshold
4238 * @rx_thresh: RX threshold
4239 *
4240 * Generally, Link layer statistics is reported periodically. But if the
4241 * variation of one stats of compared to the pervious notification exceeds
4242 * a threshold, FW will report the new stats immediately.
4243 * This structure contains threshold for different counters.
4244 */
4245struct sir_ll_ext_stats_threshold {
4246 uint32_t period;
4247 uint32_t enable;
4248 uint32_t enable_bitmap;
4249 uint32_t global;
4250 uint32_t global_threshold;
4251 uint32_t cca_bitmap;
4252 uint32_t signal_bitmap;
4253 uint32_t tx_bitmap;
4254 uint32_t rx_bitmap;
4255 struct sir_channel_cca_threshold cca;
4256 struct sir_signal_threshold signal;
4257 struct sir_tx_threshold tx;
4258 struct sir_rx_threshold rx;
4259};
4260
4261#define LL_STATS_MIN_PERIOD 10
4262#define LL_STATS_INVALID_PERIOD 0xFFFFFFFF
4263
Zhang Qiana6e9c102016-12-22 16:47:24 +08004264/* Result ID for LL stats extension */
4265#define WMI_LL_STATS_EXT_PS_CHG 0x00000100
4266#define WMI_LL_STATS_EXT_TX_FAIL 0x00000200
4267#define WMI_LL_STATS_EXT_MAC_COUNTER 0x00000400
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004268#endif /* WLAN_FEATURE_LINK_LAYER_STATS */
4269
4270typedef struct sAniGetLinkStatus {
4271 uint16_t msgType; /* message type is same as the request type */
4272 uint16_t msgLen; /* length of the entire request */
4273 uint8_t linkStatus;
4274 uint8_t sessionId;
4275} tAniGetLinkStatus, *tpAniGetLinkStatus;
4276
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05304277/**
4278 * struct sir_lost_link_info - lost link information structure.
4279 *
4280 * @vdev_id: vdev_id from WMA. some modules call sessionId.
4281 * @rssi: rssi at disconnection time.
4282 *
4283 * driver uses this structure to communicate information collected at
4284 * disconnection time.
4285 */
4286struct sir_lost_link_info {
4287 uint32_t vdev_id;
4288 int32_t rssi;
4289};
4290
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004291/* find the size of given member within a structure */
4292#ifndef member_size
4293#define member_size(type, member) (sizeof(((type *)0)->member))
4294#endif
4295
4296#define RTT_INVALID 0x00
4297#define RTT_TIMING_MEAS_CAPABILITY 0x01
4298#define RTT_FINE_TIME_MEAS_INITIATOR_CAPABILITY 0x02
4299#define RTT_FINE_TIME_MEAS_RESPONDER_CAPABILITY 0x03
4300
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004301/* number of neighbor reports that we can handle in Neighbor Report Response */
4302#define MAX_SUPPORTED_NEIGHBOR_RPT 15
4303
4304/**
4305 * struct sir_stats_avg_factor
4306 * @vdev_id: session id
4307 * @stats_avg_factor: average factor
4308 */
4309struct sir_stats_avg_factor {
4310 uint8_t vdev_id;
4311 uint16_t stats_avg_factor;
4312};
4313
4314/**
4315 * struct sir_guard_time_request
4316 * @vdev_id: session id
4317 * @guard_time: guard time
4318 */
4319struct sir_guard_time_request {
4320 uint8_t vdev_id;
4321 uint32_t guard_time;
4322};
4323
4324/* Max number of rates allowed in Supported Rates IE */
4325#define MAX_NUM_SUPPORTED_RATES (8)
4326
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004327/**
4328 * struct rssi_breach_event - rssi breached event structure
4329 * @request_id: request id
4330 * @session_id: session id
4331 * @curr_rssi: current rssi
4332 * @curr_bssid: current bssid
4333 */
4334struct rssi_breach_event {
4335 uint32_t request_id;
4336 uint32_t session_id;
4337 int8_t curr_rssi;
Anurag Chouhan6d760662016-02-20 16:05:43 +05304338 struct qdf_mac_addr curr_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004339};
4340
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05304341/**
4342 * struct chip_pwr_save_fail_detected_params - chip power save failure detected
4343 * event params
4344 * @failure_reason_code:failure reason code
4345 * @wake_lock_bitmap:bitmap for modules voting against sleep for long duration.
4346 */
4347struct chip_pwr_save_fail_detected_params {
4348 uint32_t failure_reason_code;
4349 uint32_t wake_lock_bitmap[4];
4350};
4351
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004352#define MAX_NUM_FW_SEGMENTS 4
4353
4354/**
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05304355 * DEFAULT_SCAN_IE_ID - Identifier for the collection of IE's added
4356 * by default to the probe request
4357 */
4358#define DEFAULT_SCAN_IE_ID 256
4359
4360 /* MAX_DEFAULT_SCAN_IE_LEN - Maxmimum length of Default Scan IE's */
Selvaraj, Sridhar021ee0a2017-04-07 16:53:31 +05304361#define MAX_DEFAULT_SCAN_IE_LEN 2048
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05304362
4363 /* Extended Capabilities IE header(IE Id + IE Length) length */
4364#define EXT_CAP_IE_HDR_LEN 2
4365
4366/**
4367 * struct hdd_default_scan_ie - HDD default scan IE structure
4368 * @message_type: message type to be set with eWNI_SME_DEFAULT_SCAN_IE
4369 * @length: length of the struct hdd_default_scan_ie
4370 * @session_id: Session Id
4371 * @ie_len: Default scan IE length
4372 * @ie_data: Pointer to default scan IE data
4373 */
4374struct hdd_default_scan_ie {
4375 uint16_t message_type;
4376 uint16_t length;
4377 uint16_t session_id;
4378 uint16_t ie_len;
4379 uint8_t ie_data[MAX_DEFAULT_SCAN_IE_LEN];
4380};
4381
4382/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004383 * struct vdev_ie_info - IE info
4384 * @vdev_id - vdev for which the IE is being sent
4385 * @ie_id - ID of the IE
4386 * @length - length of the IE data
Naveen Rawat03e8d952016-08-01 15:22:20 -07004387 * @band - indicates IE is intended for which band
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004388 * @data - IE data
4389 *
4390 * This structure is used to store the IE information.
4391 */
4392struct vdev_ie_info {
4393 uint32_t vdev_id;
4394 uint32_t ie_id;
4395 uint32_t length;
Naveen Rawat03e8d952016-08-01 15:22:20 -07004396 uint32_t band;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004397 uint8_t *data;
4398};
4399
4400/**
4401 * struct send_extcap_ie - used to pass send_extcap_ie msg from SME to PE
4402 * @type - MSG type
4403 * @length - length of the message
4404 * @seesion_id - session_id for which the message is intended for
4405 *
4406 * This structure is used to pass send_extcap_ie msg from SME to PE
4407 */
4408struct send_extcap_ie {
4409 uint16_t msg_type; /* eWNI_SME_SET_IE_REQ */
4410 uint16_t length;
4411 uint8_t session_id;
4412};
4413
Dundi Raviteja6bb9e322018-05-16 17:04:41 +05304414typedef void (*antenna_mode_cb)(uint32_t status, void *context);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004415
4416/**
Kiran Kumar Lokereee205772018-09-27 00:27:27 -07004417 * struct cfg_action_frm_tb_ppdu - action frame TB PPDU cfg
4418 * @vdev_id - vdev id
4419 * @cfg - enable/disable
4420 * @frm_len - frame length
4421 * @data - frame data
4422 *
4423 * This structure is used to cfg action frame tb ppdu.
4424 */
4425struct cfg_action_frm_tb_ppdu {
4426 uint8_t vdev_id;
4427 uint8_t cfg;
4428 uint8_t frm_len;
4429 uint8_t *data;
4430};
4431
4432/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004433 * struct sir_nss_update_request
4434 * @msgType: nss update msg type
4435 * @msgLen: length of the msg
4436 * @new_nss: new spatial stream value
4437 * @vdev_id: session id
4438 */
4439struct sir_nss_update_request {
4440 uint16_t msgType;
4441 uint16_t msgLen;
4442 uint8_t new_nss;
4443 uint32_t vdev_id;
4444};
4445
4446/**
Abhishek Singhfc740be2018-10-12 11:34:26 +05304447 * enum sir_bcn_update_reason: bcn update reason
4448 * @REASON_DEFAULT: reason default
4449 * @REASON_NSS_UPDATE: If NSS is updated
4450 * @REASON_CONFIG_UPDATE: Config update
4451 * @REASON_SET_HT2040: HT2040 update
4452 * @REASON_COLOR_CHANGE: Color change
4453 * @REASON_CHANNEL_SWITCH: channel switch
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004454 */
Abhishek Singhfc740be2018-10-12 11:34:26 +05304455enum sir_bcn_update_reason {
4456 REASON_DEFAULT = 0,
4457 REASON_NSS_UPDATE = 1,
4458 REASON_CONFIG_UPDATE = 2,
4459 REASON_SET_HT2040 = 3,
4460 REASON_COLOR_CHANGE = 4,
4461 REASON_CHANNEL_SWITCH = 5,
4462};
4463
4464/**
4465 * struct sir_bcn_update_rsp
4466 *
4467 * @vdev_id: session for which bcn was updated
4468 * @reason: bcn update reason
4469 * @status: status of the beacon sent to FW
4470 */
4471struct sir_bcn_update_rsp {
4472 uint8_t vdev_id;
4473 enum sir_bcn_update_reason reason;
4474 QDF_STATUS status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004475};
4476
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004477struct sir_qos_params {
4478 uint8_t aifsn;
4479 uint8_t cwmin;
4480 uint8_t cwmax;
4481};
4482
4483/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004484 * enum powersave_qpower_mode: QPOWER modes
4485 * @QPOWER_DISABLED: Qpower is disabled
4486 * @QPOWER_ENABLED: Qpower is enabled
4487 * @QPOWER_DUTY_CYCLING: Qpower is enabled with duty cycling
4488 */
4489enum powersave_qpower_mode {
4490 QPOWER_DISABLED = 0,
4491 QPOWER_ENABLED = 1,
4492 QPOWER_DUTY_CYCLING = 2
4493};
4494
Abhishek Singh518323d2015-10-19 17:42:01 +05304495/**
4496 * struct sir_sme_ext_change_chan_req - channel change request
4497 * @message_type: message id
4498 * @length: msg length
4499 * @new_channel: new channel
4500 * @session_id: session id
4501 */
4502struct sir_sme_ext_cng_chan_req {
4503 uint16_t message_type; /* eWNI_SME_EXT_CHANGE_CHANNEL */
4504 uint16_t length;
4505 uint32_t new_channel;
4506 uint8_t session_id;
4507};
4508
4509/**
4510 * struct sir_sme_ext_change_chan_ind.
4511 * @session_id: session id
4512 * @new_channel: new channel to change
4513 */
4514struct sir_sme_ext_cng_chan_ind {
4515 uint8_t session_id;
4516 uint8_t new_channel;
4517};
4518
Ryan Hsu3c8f79f2015-12-02 16:45:09 -08004519/**
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07004520 * struct stsf - the basic stsf structure
4521 *
4522 * @vdev_id: vdev id
4523 * @tsf_low: low 32bits of tsf
4524 * @tsf_high: high 32bits of tsf
Manikandan Mohan5356c2b2016-04-03 15:51:35 -07004525 * @soc_timer_low: low 32bits of synced SOC timer value
4526 * @soc_timer_high: high 32bits of synced SOC timer value
Jiani Liua8fd1702019-05-01 10:07:10 +08004527 * @global_tsf_low: low 32bits of tsf64
4528 * @global_tsf_high: high 32bits of tsf64
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07004529 *
4530 * driver use this struct to store the tsf info
4531 */
4532struct stsf {
4533 uint32_t vdev_id;
4534 uint32_t tsf_low;
4535 uint32_t tsf_high;
Manikandan Mohan5356c2b2016-04-03 15:51:35 -07004536 uint32_t soc_timer_low;
4537 uint32_t soc_timer_high;
Jiani Liua8fd1702019-05-01 10:07:10 +08004538 uint32_t global_tsf_low;
4539 uint32_t global_tsf_high;
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07004540};
4541
Gupta, Kapil4cb1d7d2016-04-16 18:16:25 -07004542#define SIR_BCN_FLT_MAX_ELEMS_IE_LIST 8
4543/**
4544 * struct beacon_filter_param - parameters for beacon filtering
4545 * @vdev_id: vdev id
4546 * @ie_map: bitwise map of IEs that needs to be filtered
4547 *
4548 */
4549struct beacon_filter_param {
4550 uint32_t vdev_id;
4551 uint32_t ie_map[SIR_BCN_FLT_MAX_ELEMS_IE_LIST];
4552};
4553
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05304554/**
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +05304555 * struct adaptive_dwelltime_params - the adaptive dwelltime params
4556 * @vdev_id: vdev id
4557 * @is_enabled: Adaptive dwell time is enabled/disabled
4558 * @dwelltime_mode: global default adaptive dwell mode
4559 * @lpf_weight: weight to calculate the average low pass
4560 * filter for channel congestion
4561 * @passive_mon_intval: intval to monitor wifi activity in passive scan in msec
4562 * @wifi_act_threshold: % of wifi activity used in passive scan 0-100
4563 *
4564 */
4565struct adaptive_dwelltime_params {
4566 uint32_t vdev_id;
4567 bool is_enabled;
4568 uint8_t dwelltime_mode;
4569 uint8_t lpf_weight;
4570 uint8_t passive_mon_intval;
4571 uint8_t wifi_act_threshold;
4572};
4573
4574/**
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05304575 * struct csa_offload_params - CSA offload request parameters
4576 * @channel: channel
4577 * @switch_mode: switch mode
4578 * @sec_chan_offset: second channel offset
4579 * @new_ch_width: new channel width
4580 * @new_ch_freq_seg1: channel center freq 1
4581 * @new_ch_freq_seg2: channel center freq 2
4582 * @ies_present_flag: IE present flag
4583 */
4584struct csa_offload_params {
4585 uint8_t channel;
4586 uint8_t switch_mode;
4587 uint8_t sec_chan_offset;
4588 uint8_t new_ch_width;
4589 uint8_t new_op_class;
4590 uint8_t new_ch_freq_seg1;
4591 uint8_t new_ch_freq_seg2;
4592 uint32_t ies_present_flag;
4593 tSirMacAddr bssId;
4594};
4595
4596/**
Sandeep Puligillae0875662016-02-12 16:09:21 -08004597 * enum obss_ht40_scancmd_type - obss scan command type
4598 * @HT40_OBSS_SCAN_PARAM_START: OBSS scan start
4599 * @HT40_OBSS_SCAN_PARAM_UPDATE: OBSS scan param update
4600 */
4601enum obss_ht40_scancmd_type {
4602 HT40_OBSS_SCAN_PARAM_START,
4603 HT40_OBSS_SCAN_PARAM_UPDATE
4604};
4605
4606/**
4607 * struct sme_obss_ht40_scanind_msg - sme obss scan params
4608 * @msg_type: message type
4609 * @length: message length
4610 * @mac_addr: mac address
4611 */
4612struct sme_obss_ht40_scanind_msg {
4613 uint16_t msg_type;
4614 uint16_t length;
4615 struct qdf_mac_addr mac_addr;
4616};
4617
4618/**
4619 * struct obss_ht40_scanind - ht40 obss scan request
4620 * @cmd: message type
4621 * @scan_type: message length
4622 * @obss_passive_dwelltime: obss passive dwelltime
4623 * @obss_active_dwelltime: obss active dwelltime
4624 * @obss_width_trigger_interval: scan interval
4625 * @obss_passive_total_per_channel: total passive scan time per channel
4626 * @obss_active_total_per_channel: total active scan time per channel
4627 * @bsswidth_ch_trans_delay: OBSS transition delay time
4628 * @obss_activity_threshold: OBSS activity threshold
4629 * @self_sta_id: self sta identification
4630 * @bss_id: BSS index
4631 * @fortymhz_intolerent: Ht40mhz intolerance
4632 * @channel_count: channel count
4633 * @channels: channel information
4634 * @current_operatingclass: operating class
4635 * @iefield_len: ie's length
4636 * @iefiled: ie's information
4637 */
4638struct obss_ht40_scanind {
4639 enum obss_ht40_scancmd_type cmd;
4640 enum eSirScanType scan_type;
4641 /* In TUs */
4642 uint16_t obss_passive_dwelltime;
4643 uint16_t obss_active_dwelltime;
4644 /* In seconds */
4645 uint16_t obss_width_trigger_interval;
4646 /* In TU's */
4647 uint16_t obss_passive_total_per_channel;
4648 uint16_t obss_active_total_per_channel;
4649 uint16_t bsswidth_ch_trans_delay;
4650 uint16_t obss_activity_threshold;
4651 uint8_t self_sta_idx;
4652 uint8_t bss_id;
4653 uint8_t fortymhz_intolerent;
4654 uint8_t channel_count;
4655 uint8_t channels[SIR_ROAM_MAX_CHANNELS];
4656 uint8_t current_operatingclass;
4657 uint16_t iefield_len;
4658 uint8_t iefield[SIR_ROAM_SCAN_MAX_PB_REQ_SIZE];
4659};
4660
4661/**
4662 * struct obss_scanparam - OBSS scan parameters
4663 * @obss_passive_dwelltime: message type
4664 * @obss_active_dwelltime: message length
4665 * @obss_width_trigger_interval: obss passive dwelltime
4666 * @obss_passive_total_per_channel: obss passive total scan time
4667 * @obss_active_total_per_channel: obss active total scan time
4668 * @bsswidth_ch_trans_delay: OBSS transition delay time
4669 * @obss_activity_threshold: OBSS activity threshold
4670 */
4671struct obss_scanparam {
4672 uint16_t obss_passive_dwelltime;
4673 uint16_t obss_active_dwelltime;
4674 uint16_t obss_width_trigger_interval;
4675 uint16_t obss_passive_total_per_channel;
4676 uint16_t obss_active_total_per_channel;
4677 uint16_t bsswidth_ch_trans_delay;
4678 uint16_t obss_activity_threshold;
4679};
4680
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304681/**
Nachiket Kukadee547a482018-05-22 16:43:30 +05304682 * struct sir_apf_set_offload - set apf filter instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304683 * @session_id: session identifier
Nachiket Kukadee547a482018-05-22 16:43:30 +05304684 * @version: host apf version
4685 * @filter_id: Filter ID for APF filter
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304686 * @total_length: The total length of the full instruction
4687 * total_length equal to 0 means reset
4688 * @current_offset: current offset, 0 means start a new setting
4689 * @current_length: Length of current @program
Nachiket Kukadee547a482018-05-22 16:43:30 +05304690 * @program: APF instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304691 */
Nachiket Kukadee547a482018-05-22 16:43:30 +05304692struct sir_apf_set_offload {
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304693 uint8_t session_id;
4694 uint32_t version;
4695 uint32_t filter_id;
4696 uint32_t total_length;
4697 uint32_t current_offset;
4698 uint32_t current_length;
4699 uint8_t *program;
4700};
4701
4702/**
Nachiket Kukadee547a482018-05-22 16:43:30 +05304703 * struct sir_apf_offload_capabilities - get apf Capabilities
4704 * @apf_version: fw's implement version
4705 * @max_apf_filters: max filters that fw supports
4706 * @max_bytes_for_apf_inst: the max bytes that can be used as apf instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304707 */
Nachiket Kukadee547a482018-05-22 16:43:30 +05304708struct sir_apf_get_offload {
4709 uint32_t apf_version;
4710 uint32_t max_apf_filters;
4711 uint32_t max_bytes_for_apf_inst;
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304712};
4713
Naveen Rawat3ff5cff2018-01-29 14:31:16 -08004714#ifndef QCA_SUPPORT_CP_STATS
Sandeep Puligilla607f34a2016-05-25 14:37:47 -07004715/**
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05304716 * struct sir_wake_lock_stats - wake lock stats structure
Dustin Brown9d797d62017-01-11 16:39:12 -08004717 * @wow_unspecified_wake_up_count: number of non-wow related wake ups
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05304718 * @wow_ucast_wake_up_count: Unicast wakeup count
4719 * @wow_bcast_wake_up_count: Broadcast wakeup count
4720 * @wow_ipv4_mcast_wake_up_count: ipv4 multicast wakeup count
4721 * @wow_ipv6_mcast_wake_up_count: ipv6 multicast wakeup count
4722 * @wow_ipv6_mcast_ra_stats: ipv6 multicast ra stats
4723 * @wow_ipv6_mcast_ns_stats: ipv6 multicast ns stats
4724 * @wow_ipv6_mcast_na_stats: ipv6 multicast na stats
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +05304725 * @wow_icmpv4_count: ipv4 icmp packet count
Himanshu Agarwal4574e282016-08-10 15:22:45 +05304726 * @wow_icmpv6_count: ipv6 icmp packet count
Poddar, Siddarthc01681a2016-12-21 18:36:30 +05304727 * @wow_rssi_breach_wake_up_count: rssi breach wakeup count
4728 * @wow_low_rssi_wake_up_count: low rssi wakeup count
4729 * @wow_gscan_wake_up_count: gscan wakeup count
4730 * @wow_pno_complete_wake_up_count: pno complete wakeup count
4731 * @wow_pno_match_wake_up_count: pno match wakeup count
Dustin Brown9d797d62017-01-11 16:39:12 -08004732 * @wow_oem_response_wake_up_count: oem response wakeup count
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05304733 * @pwr_save_fail_detected: pwr save fail detected wakeup count
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05304734 */
4735struct sir_wake_lock_stats {
Dustin Brown9d797d62017-01-11 16:39:12 -08004736 uint32_t wow_unspecified_wake_up_count;
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05304737 uint32_t wow_ucast_wake_up_count;
4738 uint32_t wow_bcast_wake_up_count;
4739 uint32_t wow_ipv4_mcast_wake_up_count;
4740 uint32_t wow_ipv6_mcast_wake_up_count;
4741 uint32_t wow_ipv6_mcast_ra_stats;
4742 uint32_t wow_ipv6_mcast_ns_stats;
4743 uint32_t wow_ipv6_mcast_na_stats;
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +05304744 uint32_t wow_icmpv4_count;
Himanshu Agarwal4574e282016-08-10 15:22:45 +05304745 uint32_t wow_icmpv6_count;
Poddar, Siddarthc01681a2016-12-21 18:36:30 +05304746 uint32_t wow_rssi_breach_wake_up_count;
4747 uint32_t wow_low_rssi_wake_up_count;
4748 uint32_t wow_gscan_wake_up_count;
4749 uint32_t wow_pno_complete_wake_up_count;
4750 uint32_t wow_pno_match_wake_up_count;
Dustin Brown9d797d62017-01-11 16:39:12 -08004751 uint32_t wow_oem_response_wake_up_count;
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05304752 uint32_t pwr_save_fail_detected;
Dustin Brown9d797d62017-01-11 16:39:12 -08004753};
4754
4755/**
4756 * struct sir_vdev_wow_stats - container for per vdev wow related stat counters
4757 * @ucast: Unicast wakeup count
4758 * @bcast: Broadcast wakeup count
4759 * @ipv4_mcast: ipv4 multicast wakeup count
4760 * @ipv6_mcast: ipv6 multicast wakeup count
4761 * @ipv6_mcast_ra: ipv6 multicast ra stats
4762 * @ipv6_mcast_ns: ipv6 multicast ns stats
4763 * @ipv6_mcast_na: ipv6 multicast na stats
4764 * @icmpv4: ipv4 icmp packet count
4765 * @icmpv6: ipv6 icmp packet count
4766 * @rssi_breach: rssi breach wakeup count
4767 * @low_rssi: low rssi wakeup count
4768 * @gscan: gscan wakeup count
4769 * @pno_complete: pno complete wakeup count
4770 * @pno_match: pno match wakeup count
Visweswara Tanuku633976b2019-01-07 16:13:12 +05304771 * @oem_response: oem response wakeup count
Amar Singhal5eb9acb2017-05-26 15:25:27 -07004772 * @scan_11d: 11d scan wakeup count
Visweswara Tanuku633976b2019-01-07 16:13:12 +05304773 * @motion_detect: motion detection wakeup count
4774 * @motion_detect_bl: motion detection baselining wakeup count
Dustin Brown9d797d62017-01-11 16:39:12 -08004775 */
4776struct sir_vdev_wow_stats {
4777 uint32_t ucast;
4778 uint32_t bcast;
4779 uint32_t ipv4_mcast;
4780 uint32_t ipv6_mcast;
4781 uint32_t ipv6_mcast_ra;
4782 uint32_t ipv6_mcast_ns;
4783 uint32_t ipv6_mcast_na;
4784 uint32_t icmpv4;
4785 uint32_t icmpv6;
4786 uint32_t rssi_breach;
4787 uint32_t low_rssi;
4788 uint32_t gscan;
4789 uint32_t pno_complete;
4790 uint32_t pno_match;
4791 uint32_t oem_response;
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05304792 uint32_t pwr_save_fail_detected;
Amar Singhal5eb9acb2017-05-26 15:25:27 -07004793 uint32_t scan_11d;
Visweswara Tanuku633976b2019-01-07 16:13:12 +05304794#ifdef WLAN_FEATURE_MOTION_DETECTION
4795 uint32_t motion_detect;
4796 uint32_t motion_detect_bl;
4797#endif /* WLAN_FEATURE_MOTION_DETECTION */
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05304798};
Naveen Rawat3ff5cff2018-01-29 14:31:16 -08004799#endif
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05304800
Nachiket Kukade2fb1fdb2019-01-08 15:35:27 +05304801#ifdef WLAN_FEATURE_NAN
Ravi Joshi412f23d2016-05-26 15:09:23 -07004802#define IFACE_NAME_SIZE 64
4803
4804/**
4805 * enum ndp_accept_policy - nan data path accept policy
4806 * @NDP_ACCEPT_POLICY_NONE: the framework will decide the policy
4807 * @NDP_ACCEPT_POLICY_ALL: accept policy offloaded to fw
4808 *
4809 */
4810enum ndp_accept_policy {
4811 NDP_ACCEPT_POLICY_NONE = 0,
4812 NDP_ACCEPT_POLICY_ALL = 1,
4813};
4814
4815/**
4816 * enum ndp_self_role - nan data path role
4817 * @NDP_ROLE_INITIATOR: initiator of nan data path request
4818 * @NDP_ROLE_RESPONDER: responder to nan data path request
4819 *
4820 */
4821enum ndp_self_role {
4822 NDP_ROLE_INITIATOR = 0,
4823 NDP_ROLE_RESPONDER = 1,
4824};
4825
4826/**
4827 * enum ndp_response_code - responder's response code to nan data path request
4828 * @NDP_RESPONSE_ACCEPT: ndp request accepted
4829 * @NDP_RESPONSE_REJECT: ndp request rejected
4830 * @NDP_RESPONSE_DEFER: ndp request deferred until later (response to follow
4831 * any time later)
4832 *
4833 */
4834enum ndp_response_code {
4835 NDP_RESPONSE_ACCEPT = 0,
4836 NDP_RESPONSE_REJECT = 1,
4837 NDP_RESPONSE_DEFER = 2,
4838};
4839
4840/**
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07004841 * enum ndp_end_type - NDP end type
4842 * @NDP_END_TYPE_UNSPECIFIED: type is unspecified
4843 * @NDP_END_TYPE_PEER_UNAVAILABLE: type is peer unavailable
4844 * @NDP_END_TYPE_OTA_FRAME: NDP end frame received from peer
4845 *
4846 */
4847enum ndp_end_type {
4848 NDP_END_TYPE_UNSPECIFIED = 0x00,
4849 NDP_END_TYPE_PEER_UNAVAILABLE = 0x01,
4850 NDP_END_TYPE_OTA_FRAME = 0x02,
4851};
4852
4853/**
4854 * enum ndp_end_reason_code - NDP end reason code
4855 * @NDP_END_REASON_UNSPECIFIED: reason is unspecified
4856 * @NDP_END_REASON_INACTIVITY: reason is peer inactivity
4857 * @NDP_END_REASON_PEER_DATA_END: data end indication received from peer
4858 *
4859 */
4860enum ndp_end_reason_code {
4861 NDP_END_REASON_UNSPECIFIED = 0x00,
4862 NDP_END_REASON_INACTIVITY = 0x01,
4863 NDP_END_REASON_PEER_DATA_END = 0x02,
4864};
4865
4866/**
Naveen Rawat8d63a592016-06-29 18:30:59 -07004867 * enum nan_status_type - NDP status type
4868 * @NDP_RSP_STATUS_SUCCESS: request was successful
4869 * @NDP_RSP_STATUS_ERROR: request failed
4870 */
4871enum nan_status_type {
4872 NDP_RSP_STATUS_SUCCESS = 0x00,
4873 NDP_RSP_STATUS_ERROR = 0x01,
4874};
4875
4876/**
4877 * enum nan_reason_code - NDP command rsp reason code value
4878 * @NDP_UNSUPPORTED_CONCURRENCY: Will be used in unsupported concurrency cases
4879 * @NDP_NAN_DATA_IFACE_CREATE_FAILED: ndi create failed
4880 * @NDP_NAN_DATA_IFACE_DELETE_FAILED: ndi delete failed
4881 * @NDP_DATA_INITIATOR_REQ_FAILED: data initiator request failed
4882 * @NDP_DATA_RESPONDER_REQ_FAILED: data responder request failed
4883 * @NDP_INVALID_SERVICE_INSTANCE_ID: invalid service instance id
4884 * @NDP_INVALID_NDP_INSTANCE_ID: invalid ndp instance id
4885 * @NDP_INVALID_RSP_CODE: invalid response code in ndp responder request
4886 * @NDP_INVALID_APP_INFO_LEN: invalid app info length
4887 * @NDP_NMF_REQ_FAIL: OTA nan mgmt frame failure for data request
4888 * @NDP_NMF_RSP_FAIL: OTA nan mgmt frame failure for data response
4889 * @NDP_NMF_CNF_FAIL: OTA nan mgmt frame failure for confirm
4890 * @NDP_END_FAILED: ndp end failed
4891 * @NDP_NMF_END_REQ_FAIL: OTA nan mgmt frame failure for data end
4892 * @NDP_VENDOR_SPECIFIC_ERROR: other vendor specific failures
4893 */
4894enum nan_reason_code {
4895 NDP_UNSUPPORTED_CONCURRENCY = 9000,
4896 NDP_NAN_DATA_IFACE_CREATE_FAILED = 9001,
4897 NDP_NAN_DATA_IFACE_DELETE_FAILED = 9002,
4898 NDP_DATA_INITIATOR_REQ_FAILED = 9003,
4899 NDP_DATA_RESPONDER_REQ_FAILED = 9004,
4900 NDP_INVALID_SERVICE_INSTANCE_ID = 9005,
4901 NDP_INVALID_NDP_INSTANCE_ID = 9006,
4902 NDP_INVALID_RSP_CODE = 9007,
4903 NDP_INVALID_APP_INFO_LEN = 9008,
4904 NDP_NMF_REQ_FAIL = 9009,
4905 NDP_NMF_RSP_FAIL = 9010,
4906 NDP_NMF_CNF_FAIL = 9011,
4907 NDP_END_FAILED = 9012,
4908 NDP_NMF_END_REQ_FAIL = 9013,
4909 /* 9500 onwards vendor specific error codes */
4910 NDP_VENDOR_SPECIFIC_ERROR = 9500,
4911};
4912
4913/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07004914 * struct ndp_cfg - ndp configuration
4915 * @tag: unique identifier
4916 * @ndp_cfg_len: ndp configuration length
4917 * @ndp_cfg: variable length ndp configuration
4918 *
4919 */
4920struct ndp_cfg {
4921 uint32_t tag;
4922 uint32_t ndp_cfg_len;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07004923 uint8_t *ndp_cfg;
Ravi Joshi412f23d2016-05-26 15:09:23 -07004924};
4925
4926/**
4927 * struct ndp_qos_cfg - ndp qos configuration
4928 * @tag: unique identifier
4929 * @ndp_qos_cfg_len: ndp qos configuration length
4930 * @ndp_qos_cfg: variable length ndp qos configuration
4931 *
4932 */
4933struct ndp_qos_cfg {
4934 uint32_t tag;
4935 uint32_t ndp_qos_cfg_len;
4936 uint8_t ndp_qos_cfg[];
4937};
4938
4939/**
4940 * struct ndp_app_info - application info shared during ndp setup
4941 * @tag: unique identifier
4942 * @ndp_app_info_len: ndp app info length
4943 * @ndp_app_info: variable length application information
4944 *
4945 */
4946struct ndp_app_info {
4947 uint32_t tag;
4948 uint32_t ndp_app_info_len;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07004949 uint8_t *ndp_app_info;
Ravi Joshi412f23d2016-05-26 15:09:23 -07004950};
4951
4952/**
Naveen Rawat4f3983e2016-11-29 16:12:09 -08004953 * struct ndp_scid - structure to hold sceurity context identifier
4954 * @scid_len: length of scid
4955 * @scid: scid
4956 *
4957 */
4958struct ndp_scid {
4959 uint32_t scid_len;
4960 uint8_t *scid;
4961};
4962
4963/**
4964 * struct ndp_pmk - structure to hold pairwise master key
4965 * @pmk_len: length of pairwise master key
4966 * @pmk: buffer containing pairwise master key
4967 *
4968 */
4969struct ndp_pmk {
4970 uint32_t pmk_len;
4971 uint8_t *pmk;
4972};
4973
4974/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07004975 * struct ndi_create_rsp - ndi create response params
Ravi Joshi412f23d2016-05-26 15:09:23 -07004976 * @status: request status
4977 * @reason: reason if any
4978 *
4979 */
4980struct ndi_create_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07004981 uint32_t status;
4982 uint32_t reason;
Rakesh Sunkicf1c9ab2016-08-25 14:11:25 -07004983 uint8_t sta_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07004984};
4985
4986/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07004987 * struct ndi_delete_rsp - ndi delete response params
Ravi Joshi412f23d2016-05-26 15:09:23 -07004988 * @status: request status
4989 * @reason: reason if any
4990 *
4991 */
4992struct ndi_delete_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07004993 uint32_t status;
4994 uint32_t reason;
4995};
4996
4997/**
4998 * struct ndp_initiator_req - ndp initiator request params
4999 * @transaction_id: unique identifier
5000 * @vdev_id: session id of the interface over which ndp is being created
5001 * @channel: suggested channel for ndp creation
Naveen Rawat0a017052016-10-19 14:17:07 -07005002 * @channel_cfg: channel config, 0=no channel, 1=optional, 2=mandatory
Ravi Joshi412f23d2016-05-26 15:09:23 -07005003 * @service_instance_id: Service identifier
5004 * @peer_discovery_mac_addr: Peer's discovery mac address
5005 * @self_ndi_mac_addr: self NDI mac address
5006 * @ndp_config: ndp configuration params
5007 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005008 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
5009 * @pmk: pairwise master key
Ravi Joshi412f23d2016-05-26 15:09:23 -07005010 *
5011 */
5012struct ndp_initiator_req {
5013 uint32_t transaction_id;
5014 uint32_t vdev_id;
5015 uint32_t channel;
Naveen Rawat0a017052016-10-19 14:17:07 -07005016 uint32_t channel_cfg;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005017 uint32_t service_instance_id;
5018 struct qdf_mac_addr peer_discovery_mac_addr;
5019 struct qdf_mac_addr self_ndi_mac_addr;
5020 struct ndp_cfg ndp_config;
5021 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005022 uint32_t ncs_sk_type;
5023 struct ndp_pmk pmk;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005024};
5025
5026/**
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07005027 * struct ndp_initiator_rsp - response event from FW
Ravi Joshi412f23d2016-05-26 15:09:23 -07005028 * @transaction_id: unique identifier
5029 * @vdev_id: session id of the interface over which ndp is being created
5030 * @ndp_instance_id: locally created NDP instance ID
5031 * @status: status of the ndp request
5032 * @reason: reason for failure if any
5033 *
5034 */
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07005035struct ndp_initiator_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07005036 uint32_t transaction_id;
5037 uint32_t vdev_id;
5038 uint32_t ndp_instance_id;
5039 uint32_t status;
Naveen Rawat8d63a592016-06-29 18:30:59 -07005040 uint32_t reason;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005041};
5042
5043/**
5044 * struct ndp_indication_event - create ndp indication on the responder
5045 * @vdev_id: session id of the interface over which ndp is being created
5046 * @service_instance_id: Service identifier
5047 * @peer_discovery_mac_addr: Peer's discovery mac address
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07005048 * @peer_mac_addr: Peer's NDI mac address
Ravi Joshi412f23d2016-05-26 15:09:23 -07005049 * @ndp_initiator_mac_addr: NDI mac address of the peer initiating NDP
5050 * @ndp_instance_id: locally created NDP instance ID
5051 * @role: self role for NDP
5052 * @ndp_accept_policy: accept policy configured by the upper layer
5053 * @ndp_config: ndp configuration params
5054 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005055 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
5056 * @scid: security context identifier
Ravi Joshi412f23d2016-05-26 15:09:23 -07005057 *
5058 */
5059struct ndp_indication_event {
5060 uint32_t vdev_id;
5061 uint32_t service_instance_id;
5062 struct qdf_mac_addr peer_discovery_mac_addr;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07005063 struct qdf_mac_addr peer_mac_addr;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005064 uint32_t ndp_instance_id;
5065 enum ndp_self_role role;
5066 enum ndp_accept_policy policy;
5067 struct ndp_cfg ndp_config;
5068 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005069 uint32_t ncs_sk_type;
5070 struct ndp_scid scid;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005071};
5072
5073/**
5074 * struct ndp_responder_req - responder's response to ndp create request
5075 * @transaction_id: unique identifier
5076 * @vdev_id: session id of the interface over which ndp is being created
5077 * @ndp_instance_id: locally created NDP instance ID
5078 * @ndp_rsp: response to the ndp create request
5079 * @ndp_config: ndp configuration params
5080 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005081 * @pmk: pairwise master key
5082 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
Ravi Joshi412f23d2016-05-26 15:09:23 -07005083 *
5084 */
5085struct ndp_responder_req {
5086 uint32_t transaction_id;
5087 uint32_t vdev_id;
5088 uint32_t ndp_instance_id;
5089 enum ndp_response_code ndp_rsp;
5090 struct ndp_cfg ndp_config;
5091 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005092 struct ndp_pmk pmk;
5093 uint32_t ncs_sk_type;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005094};
5095
5096/**
5097 * struct ndp_responder_rsp_event - response to responder's request
5098 * @transaction_id: unique identifier
5099 * @vdev_id: session id of the interface over which ndp is being created
5100 * @status: command status
5101 * @reason: reason for failure if any
Abhishek Singh4fef7472016-06-06 11:36:03 -07005102 * @peer_mac_addr: Peer's mac address
Rakesh Sunkid92d1082017-01-04 15:14:28 -08005103 * @create_peer: Flag to indicate to create peer
Ravi Joshi412f23d2016-05-26 15:09:23 -07005104 */
5105struct ndp_responder_rsp_event {
5106 uint32_t transaction_id;
5107 uint32_t vdev_id;
5108 uint32_t status;
5109 uint32_t reason;
Abhishek Singh4fef7472016-06-06 11:36:03 -07005110 struct qdf_mac_addr peer_mac_addr;
Rakesh Sunkid92d1082017-01-04 15:14:28 -08005111 bool create_peer;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005112};
5113
5114/**
5115 * struct ndp_confirm_event - ndp confirmation event from FW
5116 * @vdev_id: session id of the interface over which ndp is being created
5117 * @ndp_instance_id: ndp instance id for which confirm is being generated
Naveen Rawat460be782016-06-29 18:26:22 -07005118 * @reason_code : reason code(opaque to driver)
5119 * @num_active_ndps_on_peer: number of ndp instances on peer
Ravi Joshi412f23d2016-05-26 15:09:23 -07005120 * @peer_ndi_mac_addr: peer NDI mac address
5121 * @rsp_code: ndp response code
Ravi Joshi412f23d2016-05-26 15:09:23 -07005122 * @ndp_info: ndp application info
5123 *
5124 */
5125struct ndp_confirm_event {
5126 uint32_t vdev_id;
5127 uint32_t ndp_instance_id;
Naveen Rawat460be782016-06-29 18:26:22 -07005128 uint32_t reason_code;
5129 uint32_t num_active_ndps_on_peer;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005130 struct qdf_mac_addr peer_ndi_mac_addr;
5131 enum ndp_response_code rsp_code;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005132 struct ndp_app_info ndp_info;
5133};
5134
5135/**
5136 * struct ndp_end_req - ndp end request
5137 * @transaction_id: unique transaction identifier
Ravi Joshi412f23d2016-05-26 15:09:23 -07005138 * @num_ndp_instances: number of ndp instances to be terminated
Naveen Rawatf28315c2016-06-29 18:06:02 -07005139 * @ndp_ids: pointer to array of ndp_instance_id to be terminated
Ravi Joshi412f23d2016-05-26 15:09:23 -07005140 *
5141 */
5142struct ndp_end_req {
5143 uint32_t transaction_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005144 uint32_t num_ndp_instances;
Naveen Rawatf28315c2016-06-29 18:06:02 -07005145 uint32_t *ndp_ids;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005146};
5147
5148/**
5149 * struct peer_ndp_map - mapping of NDP instances to peer to VDEV
5150 * @vdev_id: session id of the interface over which ndp is being created
5151 * @peer_ndi_mac_addr: peer NDI mac address
5152 * @num_active_ndp_sessions: number of active NDP sessions on the peer
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07005153 * @type: NDP end indication type
5154 * @reason_code: NDP end indication reason code
5155 * @ndp_instance_id: NDP instance ID
Ravi Joshi412f23d2016-05-26 15:09:23 -07005156 *
5157 */
5158struct peer_ndp_map {
5159 uint32_t vdev_id;
5160 struct qdf_mac_addr peer_ndi_mac_addr;
5161 uint32_t num_active_ndp_sessions;
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07005162 enum ndp_end_type type;
5163 enum ndp_end_reason_code reason_code;
5164 uint32_t ndp_instance_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005165};
5166
5167/**
5168 * struct ndp_end_rsp_event - firmware response to ndp end request
5169 * @transaction_id: unique identifier for the request
Naveen Rawatf28315c2016-06-29 18:06:02 -07005170 * @status: status of operation
5171 * @reason: reason(opaque to host driver)
Ravi Joshi412f23d2016-05-26 15:09:23 -07005172 *
5173 */
5174struct ndp_end_rsp_event {
5175 uint32_t transaction_id;
Naveen Rawatf28315c2016-06-29 18:06:02 -07005176 uint32_t status;
5177 uint32_t reason;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005178};
5179
5180/**
5181 * struct ndp_end_indication_event - ndp termination notification from FW
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07005182 * @num_ndp_ids: number of NDP ids
5183 * @ndp_map: mapping of NDP instances to peer and vdev
Ravi Joshi412f23d2016-05-26 15:09:23 -07005184 *
5185 */
5186struct ndp_end_indication_event {
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07005187 uint32_t num_ndp_ids;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005188 struct peer_ndp_map ndp_map[];
5189};
5190
5191/**
5192 * struct ndp_schedule_update_req - ndp schedule update request
5193 * @transaction_id: unique identifier
5194 * @vdev_id: session id of the interface over which ndp is being created
5195 * @ndp_instance_id: ndp instance id for which schedule update is requested
5196 * @ndp_qos: new set of qos parameters
5197 *
5198 */
5199struct ndp_schedule_update_req {
5200 uint32_t transaction_id;
5201 uint32_t vdev_id;
5202 uint32_t ndp_instance_id;
5203 struct ndp_qos_cfg ndp_qos;
5204};
5205
5206/**
5207 * struct ndp_schedule_update_rsp - ndp schedule update response
5208 * @transaction_id: unique identifier
5209 * @vdev_id: session id of the interface over which ndp is being created
5210 * @status: status of the request
5211 * @reason: reason code for failure if any
5212 *
5213 */
5214struct ndp_schedule_update_rsp {
5215 uint32_t transaction_id;
5216 uint32_t vdev_id;
5217 uint32_t status;
5218 uint32_t reason;
5219};
5220
5221/**
5222 * struct sme_ndp_peer_ind - ndp peer indication
5223 * @msg_type: message id
5224 * @msg_len: message length
5225 * @session_id: session id
5226 * @peer_mac_addr: peer mac address
5227 * @sta_id: station id
5228 *
5229 */
5230struct sme_ndp_peer_ind {
5231 uint16_t msg_type;
5232 uint16_t msg_len;
5233 uint8_t session_id;
5234 struct qdf_mac_addr peer_mac_addr;
5235 uint16_t sta_id;
5236};
Nachiket Kukade2fb1fdb2019-01-08 15:35:27 +05305237#endif /* WLAN_FEATURE_NAN */
Ravi Joshi412f23d2016-05-26 15:09:23 -07005238
Peng Xu8fdaa492016-06-22 10:20:47 -07005239/**
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05305240 * struct sir_set_tx_rx_aggregation_size - sets tx rx aggregation size
5241 * @vdev_id: vdev id of the session
Arif Hussain0e246802018-05-01 18:13:44 -07005242 * @aggr_type: TX Aggregation Type (0=A-MPDU, 1=A-MSDU)
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05305243 * @tx_aggregation_size: Tx aggregation size
Paul Zhangee09f8e2018-04-23 16:11:32 +08005244 * @tx_aggregation_size_be: Tx aggregation size for be queue
5245 * @tx_aggregation_size_bk: Tx aggregation size for bk queue
5246 * @tx_aggregation_size_vi: Tx aggregation size for vi queue
5247 * @tx_aggregation_size_vo: Tx aggregation size for vo queue
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05305248 * @rx_aggregation_size: Rx aggregation size
5249 */
5250struct sir_set_tx_rx_aggregation_size {
5251 uint8_t vdev_id;
Arif Hussain0e246802018-05-01 18:13:44 -07005252 wmi_vdev_custom_aggr_type_t aggr_type;
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05305253 uint32_t tx_aggregation_size;
Paul Zhangee09f8e2018-04-23 16:11:32 +08005254 uint32_t tx_aggregation_size_be;
5255 uint32_t tx_aggregation_size_bk;
5256 uint32_t tx_aggregation_size_vi;
5257 uint32_t tx_aggregation_size_vo;
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05305258 uint32_t rx_aggregation_size;
5259};
5260
5261/**
stonez26388d02018-10-17 13:37:48 +08005262 * struct sir_set_tx_sw_retry_threshold - set sw retry threshold
Paul Zhang33fae272018-04-23 16:19:00 +08005263 * @vdev_id: vdev id of the session
stonez26388d02018-10-17 13:37:48 +08005264 * @tx_aggr_sw_retry_threshold_be: aggr sw retry threshold for BE
5265 * @tx_aggr_sw_retry_threshold_bk: aggr sw retry threshold for BK
5266 * @tx_aggr_sw_retry_threshold_vi: aggr sw retry threshold for VI
5267 * @tx_aggr_sw_retry_threshold_vo: aggr sw retry threshold for VO
Paul Zhanga25f75a2019-04-12 17:11:14 +08005268 * @tx_aggr_sw_retry_threshold: aggr sw retry threshold
stonez26388d02018-10-17 13:37:48 +08005269 * @tx_non_aggr_sw_retry_threshold_be: non aggr sw retry threshold for BE
5270 * @tx_non_aggr_sw_retry_threshold_bk: non aggr sw retry threshold for BK
5271 * @tx_non_aggr_sw_retry_threshold_vi: non aggr sw retry threshold for VI
5272 * @tx_non_aggr_sw_retry_threshold_vo: non aggr sw retry threshold for VO
Paul Zhanga25f75a2019-04-12 17:11:14 +08005273 * @tx_non_aggr_sw_retry_threshold: non aggr sw retry threshold
Paul Zhang33fae272018-04-23 16:19:00 +08005274 */
stonez26388d02018-10-17 13:37:48 +08005275struct sir_set_tx_sw_retry_threshold {
Paul Zhang33fae272018-04-23 16:19:00 +08005276 uint8_t vdev_id;
5277 uint32_t tx_aggr_sw_retry_threshold_be;
5278 uint32_t tx_aggr_sw_retry_threshold_bk;
5279 uint32_t tx_aggr_sw_retry_threshold_vi;
5280 uint32_t tx_aggr_sw_retry_threshold_vo;
Paul Zhanga25f75a2019-04-12 17:11:14 +08005281 uint32_t tx_aggr_sw_retry_threshold;
stonez26388d02018-10-17 13:37:48 +08005282 uint32_t tx_non_aggr_sw_retry_threshold_be;
5283 uint32_t tx_non_aggr_sw_retry_threshold_bk;
5284 uint32_t tx_non_aggr_sw_retry_threshold_vi;
5285 uint32_t tx_non_aggr_sw_retry_threshold_vo;
Paul Zhanga25f75a2019-04-12 17:11:14 +08005286 uint32_t tx_non_aggr_sw_retry_threshold;
Paul Zhang33fae272018-04-23 16:19:00 +08005287};
5288
5289/**
Peng Xu8fdaa492016-06-22 10:20:47 -07005290 * struct sir_p2p_lo_start - p2p listen offload start
5291 * @vdev_id: vdev identifier
5292 * @ctl_flags: control flag
5293 * @freq: p2p listen frequency
5294 * @period: listen offload period
5295 * @interval: listen offload interval
5296 * @count: number listen offload intervals
5297 * @device_types: device types
5298 * @dev_types_len: device types length
5299 * @probe_resp_tmplt: probe response template
5300 * @probe_resp_len: probe response template length
5301 */
5302struct sir_p2p_lo_start {
5303 uint32_t vdev_id;
5304 uint32_t ctl_flags;
5305 uint32_t freq;
5306 uint32_t period;
5307 uint32_t interval;
5308 uint32_t count;
5309 uint8_t *device_types;
5310 uint32_t dev_types_len;
5311 uint8_t *probe_resp_tmplt;
5312 uint32_t probe_resp_len;
5313};
5314
5315/**
5316 * struct sir_p2p_lo_event - P2P listen offload stop event
5317 * @vdev_id: vdev identifier
5318 * @reason_code: P2P listen offload stop reason
5319 */
5320struct sir_p2p_lo_event {
5321 uint32_t vdev_id;
5322 uint32_t reason_code;
5323};
Manjeet Singhf82ed072016-07-08 11:40:00 +05305324
5325/**
5326 * struct sir_hal_pwr_dbg_cmd - unit test command parameters
5327 * @pdev_id: pdev id
5328 * @module_id: module id
5329 * @num_args: number of arguments
5330 * @args: arguments
5331 */
5332struct sir_mac_pwr_dbg_cmd {
5333 uint32_t pdev_id;
5334 uint32_t module_id;
5335 uint32_t num_args;
5336 uint32_t args[MAX_POWER_DBG_ARGS_SUPPORTED];
5337};
5338
Kondabattini, Ganesh3f2d02c2016-09-13 12:23:47 +05305339/**
5340 * struct sme_send_disassoc_frm_req - send disassoc request frame
5341 * @msg_type: message type
5342 * @length: length of message
5343 * @session_id: session id
Kondabattini, Ganesh3f2d02c2016-09-13 12:23:47 +05305344 * @peer_mac: peer mac address
5345 * @reason: reason for disassoc
5346 * @wait_for_ack: wait for acknowledgment
5347 **/
5348 struct sme_send_disassoc_frm_req {
5349 uint16_t msg_type;
5350 uint16_t length;
5351 uint8_t session_id;
Kondabattini, Ganesh3f2d02c2016-09-13 12:23:47 +05305352 uint8_t peer_mac[6];
5353 uint16_t reason;
5354 uint8_t wait_for_ack;
5355 };
5356
Kondabattini, Ganeshe4f18e02016-09-13 13:01:22 +05305357/**
5358 * struct sme_update_access_policy_vendor_ie - update vendor ie and access
5359 * policy
5360 * @msg_type: message id
5361 * @msg_len: message length
5362 * @sme_session_id: sme session id
5363 * @ie: vendor ie
5364 * @access_policy: access policy for vendor ie
5365 */
5366struct sme_update_access_policy_vendor_ie {
5367 uint16_t msg_type;
5368 uint16_t length;
5369 uint32_t sme_session_id;
Srinivas Girigowdacf161402019-03-14 11:37:33 -07005370 uint8_t ie[WLAN_MAX_IE_LEN + 2];
Kondabattini, Ganeshe4f18e02016-09-13 13:01:22 +05305371 uint8_t access_policy;
5372};
5373
Padma, Santhosh Kumard7cc0792016-06-28 18:54:12 +05305374/**
Agrawal, Ashish35b251d2016-09-08 19:21:03 +05305375 * struct sme_tx_fail_cnt_threshold - tx failure count for disconnect to fw
5376 * @session_id: Session id
5377 * @tx_fail_cnt_threshold: Tx failure count to do disconnect
5378 */
5379struct sme_tx_fail_cnt_threshold {
5380 uint8_t session_id;
5381 uint32_t tx_fail_cnt_threshold;
5382};
Agrawal Ashishda3e9502016-09-21 17:43:51 +05305383
5384/**
5385 * struct sme_short_retry_limit - transmission retry limit for short frames.
5386 * @session_id: Session id
5387 * @short_retry_limit: tranmission retry limit for short frame.
5388 *
5389 */
5390struct sme_short_retry_limit {
5391 uint8_t session_id;
5392 uint32_t short_retry_limit;
5393};
5394
5395/**
5396 * struct sme_long_retry_limit - tranmission retry limit for long frames
5397 * @session_id: Session id
5398 * @short_retry_limit: tranmission retry limit for long frames.
5399 *
5400 */
5401struct sme_long_retry_limit {
5402 uint8_t session_id;
5403 uint32_t long_retry_limit;
5404};
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05305405
5406/**
Kiran Kumar Lokere08195ef2018-01-17 19:25:15 -08005407 * struct sme_addba_accept - Allow/reject the addba request frame
5408 * @session_id: Session id
5409 * @addba_accept: Allow/reject the addba request frame
5410 */
5411struct sme_addba_accept {
5412 uint8_t session_id;
5413 uint8_t addba_accept;
5414};
5415
5416/**
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05305417 * struct sme_sta_inactivity_timeout - set sta_inactivity_timeout
5418 * @session_id: session Id.
5419 * @sta_inactivity_timeout: Timeout to disconnect STA after there
5420 * is no activity.
5421 */
5422struct sme_sta_inactivity_timeout {
5423 uint8_t session_id;
5424 uint32_t sta_inactivity_timeout;
5425};
Yingying Tang95409972016-10-20 15:16:15 +08005426
5427/*
5428 * struct wow_pulse_mode - WoW Pulse set cmd struct
5429 * @wow_pulse_enable: enable or disable this feature
5430 * @wow_pulse_pin: GPIO PIN for Pulse
5431 * @wow_pulse_interval_low: Pulse interval low
5432 * @wow_pulse_interval_high: Pulse interval high
5433 *
5434 * SME uses this structure to configure wow pulse info
5435 * and send it to WMA
5436 */
5437struct wow_pulse_mode {
5438 bool wow_pulse_enable;
5439 uint8_t wow_pulse_pin;
5440 uint16_t wow_pulse_interval_high;
5441 uint16_t wow_pulse_interval_low;
5442};
5443
Rajeev Kumare406d652017-01-30 17:47:05 -08005444
5445/**
Rajeev Kumard138ac52017-01-30 18:38:37 -08005446 * umac_send_mb_message_to_mac(): post message to umac
Rajeev Kumare406d652017-01-30 17:47:05 -08005447 * @msg: opaque message pointer
5448 *
5449 * Return: QDF status
5450 */
Rajeev Kumard138ac52017-01-30 18:38:37 -08005451QDF_STATUS umac_send_mb_message_to_mac(void *msg);
Rajeev Kumare406d652017-01-30 17:47:05 -08005452
Kapil Gupta4f0c0c12017-02-07 15:21:15 +05305453/**
5454 * struct scan_chan_info - channel info
5455 * @freq: radio frequence
5456 * @cmd flag: cmd flag
5457 * @noise_floor: noise floor
5458 * @cycle_count: cycle count
5459 * @rx_clear_count: rx clear count
5460 * @tx_frame_count: TX frame count
5461 * @clock_freq: clock frequence MHZ
5462 */
5463struct scan_chan_info {
5464 uint32_t freq;
5465 uint32_t cmd_flag;
5466 uint32_t noise_floor;
5467 uint32_t cycle_count;
5468 uint32_t rx_clear_count;
5469 uint32_t tx_frame_count;
5470 uint32_t clock_freq;
5471};
Dustin Brown54096432017-02-23 13:00:44 -08005472
5473/**
5474 * enum wow_resume_trigger - resume trigger override setting values
5475 * @WOW_RESUME_TRIGGER_DEFAULT: fw to use platform default resume trigger
5476 * @WOW_RESUME_TRIGGER_HTC_WAKEUP: force fw to use HTC Wakeup to resume
5477 * @WOW_RESUME_TRIGGER_GPIO: force fw to use GPIO to resume
5478 * @WOW_RESUME_TRIGGER_COUNT: number of resume trigger options
5479 */
5480enum wow_resume_trigger {
5481 /* always first */
5482 WOW_RESUME_TRIGGER_DEFAULT = 0,
5483 WOW_RESUME_TRIGGER_HTC_WAKEUP,
5484 WOW_RESUME_TRIGGER_GPIO,
5485 /* always last */
5486 WOW_RESUME_TRIGGER_COUNT
5487};
5488
5489/**
5490 * enum wow_interface_pause - interface pause override setting values
5491 * @WOW_INTERFACE_PAUSE_DEFAULT: use platform default interface pause setting
5492 * @WOW_INTERFACE_PAUSE_ENABLE: force interface pause setting to enabled
5493 * @WOW_INTERFACE_PAUSE_DISABLE: force interface pause setting to disabled
5494 * @WOW_INTERFACE_PAUSE_COUNT: number of interface pause options
5495 */
5496enum wow_interface_pause {
5497 /* always first */
5498 WOW_INTERFACE_PAUSE_DEFAULT = 0,
5499 WOW_INTERFACE_PAUSE_ENABLE,
5500 WOW_INTERFACE_PAUSE_DISABLE,
5501 /* always last */
5502 WOW_INTERFACE_PAUSE_COUNT
5503};
5504
5505/**
5506 * struct wow_enable_params - A collection of wow enable override parameters
5507 * @is_unit_test: true to notify fw this is a unit-test suspend
5508 * @interface_pause: used to override the interface pause indication sent to fw
5509 * @resume_trigger: used to force fw to use a particular resume method
5510 */
5511struct wow_enable_params {
5512 bool is_unit_test;
5513 enum wow_interface_pause interface_pause;
5514 enum wow_resume_trigger resume_trigger;
5515};
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07005516
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08005517#define HE_LTF_1X 0
5518#define HE_LTF_2X 1
5519#define HE_LTF_4X 2
5520
5521#define HE_LTF_ALL 0x7
5522#define HE_SGI_MASK 0xFF00
5523
5524#define AUTO_RATE_GI_400NS 8
5525#define AUTO_RATE_GI_800NS 9
5526#define AUTO_RATE_GI_1600NS 10
5527#define AUTO_RATE_GI_3200NS 11
5528
5529#define SET_AUTO_RATE_SGI_VAL(set_val, bit_mask) \
5530 (set_val = (set_val & HE_LTF_ALL) | bit_mask)
5531
5532#define SET_AUTO_RATE_HE_LTF_VAL(set_val, bit_mask) \
5533 (set_val = (set_val & HE_SGI_MASK) | bit_mask)
5534
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07005535#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -07005536#define HE_CAP_OUI_TYPE "\x23"
5537#define HE_CAP_OUI_SIZE 1
5538#define HE_OP_OUI_TYPE "\x24"
5539#define HE_OP_OUI_SIZE 1
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08005540
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07005541#define HE_RU_ALLOC_INDX0_MASK (0x01 << 0)
5542#define HE_RU_ALLOC_INDX1_MASK (0x01 << 1)
5543#define HE_RU_ALLOC_INDX2_MASK (0x01 << 2)
5544#define HE_RU_ALLOC_INDX3_MASK (0x01 << 3)
5545
5546/* 3 bits for NSS and 4 bits for RU Index */
5547#define HE_PPET_NSS_LEN 3
5548#define HE_PEPT_RU_IDX_LEN 4
5549#define HE_PPET_NSS_RU_LEN (HE_PPET_NSS_LEN + HE_PEPT_RU_IDX_LEN)
5550#define HE_PPET_SIZE 3
5551#define HE_BYTE_SIZE 8
5552
Naveen Rawat819158d2018-01-16 10:56:45 -08005553struct ppet_hdr {
5554 uint8_t nss:3;
5555 uint8_t ru_idx_mask:4;
5556 uint8_t remaining:1;
5557};
5558
5559/* MAX PPET size = 7 bits + (max_nss X max_ru_number X 6) = 25 bytes */
5560#define HE_MAX_PPET_SIZE WNI_CFG_HE_PPET_LEN
5561
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -08005562#define HE_MAX_PHY_CAP_SIZE 3
5563
Naveen Rawataeca1b92017-10-16 16:55:31 -07005564#define HE_CH_WIDTH_GET_BIT(ch_wd, bit) (((ch_wd) >> (bit)) & 1)
5565#define HE_CH_WIDTH_COMBINE(b0, b1, b2, b3, b4, b5, b6) \
5566 ((uint8_t)(b0) | ((b1) << 1) | ((b2) << 2) | ((b3) << 3) | \
5567 ((b4) << 4) | ((b5) << 5) | ((b6) << 6))
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -07005568
Naveen Rawataeca1b92017-10-16 16:55:31 -07005569/*
5570 * MCS values are interpreted as in IEEE 11ax-D1.4 spec onwards
5571 * +-----------------------------------------------------+
5572 * | SS8 | SS7 | SS6 | SS5 | SS4 | SS3 | SS2 | SS1 |
5573 * +-----------------------------------------------------+
5574 * | 15-14 | 13-12 | 11-10 | 9-8 | 7-6 | 5-4 | 3-2 | 1-0 |
5575 * +-----------------------------------------------------+
5576 */
5577#define HE_MCS_NSS_SHIFT(nss) (((nss) - 1) << 1)
5578#define HE_MCS_MSK_4_NSS(nss) (3 << HE_MCS_NSS_SHIFT(nss))
5579#define HE_MCS_INV_MSK_4_NSS(nss) (~HE_MCS_MSK_4_NSS(nss))
5580#define HE_GET_MCS_4_NSS(mcs_set, nss) \
5581 (((mcs_set) >> HE_MCS_NSS_SHIFT(nss)) & 3)
5582#define HE_SET_MCS_4_NSS(mcs_set, mcs, nss) \
5583 (((mcs_set) & HE_MCS_INV_MSK_4_NSS(nss)) | \
5584 ((mcs) << HE_MCS_NSS_SHIFT(nss)))
5585#define HE_MCS_IS_NSS_ENABLED(mcs_set, nss) \
5586 ((HE_MCS_MSK_4_NSS(nss) & (mcs_set)) != HE_MCS_MSK_4_NSS(nss))
5587
5588#define HE_MCS_ALL_DISABLED 0xFFFF
Kiran Kumar Lokere59a569e2018-01-24 15:00:50 -08005589
5590#define HE_MCS_0_7 0x0
5591#define HE_MCS_0_9 0x1
5592#define HE_MCS_0_11 0x2
5593#define HE_MCS_DISABLE 0x3
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08005594
Naveen Rawataeca1b92017-10-16 16:55:31 -07005595/*
5596 * Following formuala has been arrived at using karnaugh map and unit tested
5597 * with sample code. Take MCS for each NSS as 2 bit value first and solve for
5598 * 2 bit intersection of NSS. Use following table/Matrix as guide for solving
5599 * K-Maps
5600 * MCS 1\MCS 2 00 01 10 11
5601 * 00 00 00 00 11
5602 * 01 00 01 01 11
5603 * 10 00 01 10 11
5604 * 11 11 11 11 11
5605 * if output MCS is o1o0, then as per K-map reduction:
5606 * o0 = m1.m0 | n1.n0 | (~m1).m0.(n1^n0) | (~n1).n0.(m1^m0)
5607 * o1 = m1.m0 | n1.n0 | m1.(~m0).n1.(~n0)
5608 *
5609 * Please note: Calculating MCS intersection is 80211 protocol specific and
5610 * should be implemented in PE. WMA can use this macro rather than calling any
5611 * lim API to do the intersection.
5612 */
5613#define HE_INTERSECT_MCS_BITS_PER_NSS(m1, m0, n1, n0) \
5614 (((m1 & m0) | (n1 & n0) | (((~m1) & m0) & (n1 ^ n0)) | \
5615 (((~n1) & n0) & (m1 ^ m0))) | (((m1 & m0) | (n1 & n0) | \
5616 (m1 & ~m0 & n1 & ~n0)) << 1))
5617
5618/* following takes MCS as 2 bits */
5619#define HE_INTERSECT_MCS_PER_NSS(mcs_1, mcs_2) \
5620 HE_INTERSECT_MCS_BITS_PER_NSS((mcs_1 >> 1), (mcs_1 & 1), \
5621 (mcs_2 >> 1), (mcs_2 & 1))
5622
5623/* following takes MCS as 16 bits */
5624#define HE_INTERSECT_MCS(mcs_1, mcs_2) ( \
5625 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 1), \
5626 HE_GET_MCS_4_NSS(mcs_2, 1)) << HE_MCS_NSS_SHIFT(1) | \
5627 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 2), \
5628 HE_GET_MCS_4_NSS(mcs_2, 2)) << HE_MCS_NSS_SHIFT(2) | \
5629 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 3), \
5630 HE_GET_MCS_4_NSS(mcs_2, 3)) << HE_MCS_NSS_SHIFT(3) | \
5631 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 4), \
5632 HE_GET_MCS_4_NSS(mcs_2, 4)) << HE_MCS_NSS_SHIFT(4) | \
5633 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 5), \
5634 HE_GET_MCS_4_NSS(mcs_2, 5)) << HE_MCS_NSS_SHIFT(5) | \
5635 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 6), \
5636 HE_GET_MCS_4_NSS(mcs_2, 6)) << HE_MCS_NSS_SHIFT(6) | \
5637 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 7), \
5638 HE_GET_MCS_4_NSS(mcs_2, 7)) << HE_MCS_NSS_SHIFT(7) | \
5639 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 8), \
5640 HE_GET_MCS_4_NSS(mcs_2, 8)) << HE_MCS_NSS_SHIFT(8))
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -07005641
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -08005642/**
5643 * struct he_capability - to store 11ax HE capabilities
5644 * @phy_cap: HE PHY capabilities
5645 * @mac_cap: HE MAC capabilities
5646 * @mcs: HE MCS
5647 * @ppet: HE PPE threshold
5648 */
5649struct he_capability {
5650 uint32_t phy_cap[HE_MAX_PHY_CAP_SIZE];
5651 uint32_t mac_cap;
5652 uint32_t mcs;
5653 struct wlan_psoc_host_ppe_threshold ppet;
5654};
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07005655#endif
5656
Naveen Rawataeca1b92017-10-16 16:55:31 -07005657#define HE_GET_NSS(mcs, nss) \
5658 do { \
5659 (nss) = 0; \
Naveen Rawatcbcc6542017-10-30 17:55:03 -07005660 while ((((mcs) >> ((nss)*2)) & 3) != 3 && nss < 8) \
Naveen Rawataeca1b92017-10-16 16:55:31 -07005661 (nss)++; \
5662 } while (0)
5663
Nitesh Shah99dd9552017-03-20 19:27:47 +05305664/**
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05305665 * struct rsp_stats - arp packet stats
5666 * @arp_req_enqueue: fw tx count
5667 * @arp_req_tx_success: tx ack count
5668 * @arp_req_tx_failure: tx ack fail count
5669 * @arp_rsp_recvd: rx fw count
5670 * @out_of_order_arp_rsp_drop_cnt: out of order count
5671 * @dad_detected: dad detected
5672 * @connect_status: connection status
5673 * @ba_session_establishment_status: BA session status
Poddar, Siddarth465330e2018-01-08 18:23:54 +05305674 * @connect_stats_present: connectivity stats present or not
5675 * @tcp_ack_recvd: tcp syn ack's count
5676 * @icmpv4_rsp_recvd: icmpv4 responses count
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05305677 */
5678struct rsp_stats {
5679 uint32_t vdev_id;
5680 uint32_t arp_req_enqueue;
5681 uint32_t arp_req_tx_success;
5682 uint32_t arp_req_tx_failure;
5683 uint32_t arp_rsp_recvd;
5684 uint32_t out_of_order_arp_rsp_drop_cnt;
5685 uint32_t dad_detected;
5686 uint32_t connect_status;
5687 uint32_t ba_session_establishment_status;
Poddar, Siddarth465330e2018-01-08 18:23:54 +05305688 bool connect_stats_present;
5689 uint32_t tcp_ack_recvd;
5690 uint32_t icmpv4_rsp_recvd;
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05305691};
5692
5693/**
5694 * struct set_arp_stats_params - set/reset arp stats
5695 * @vdev_id: session id
5696 * @flag: enable/disable stats
5697 * @pkt_type: type of packet(1 - arp)
5698 * @ip_addr: subnet ipv4 address in case of encrypted packets
Poddar, Siddarth465330e2018-01-08 18:23:54 +05305699 * @pkt_type_bitmap: pkt bitmap
5700 * @tcp_src_port: tcp src port for pkt tracking
5701 * @tcp_dst_port: tcp dst port for pkt tracking
5702 * @icmp_ipv4: target ipv4 address to track ping packets
5703 * @reserved: reserved
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05305704 */
5705struct set_arp_stats_params {
5706 uint32_t vdev_id;
5707 uint8_t flag;
5708 uint8_t pkt_type;
5709 uint32_t ip_addr;
Poddar, Siddarth465330e2018-01-08 18:23:54 +05305710 uint32_t pkt_type_bitmap;
5711 uint32_t tcp_src_port;
5712 uint32_t tcp_dst_port;
5713 uint32_t icmp_ipv4;
5714 uint32_t reserved;
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05305715};
5716
5717/**
5718 * struct get_arp_stats_params - get arp stats from firmware
5719 * @pkt_type: packet type(1 - ARP)
5720 * @vdev_id: session id
5721 */
5722struct get_arp_stats_params {
5723 uint8_t pkt_type;
5724 uint32_t vdev_id;
5725};
5726
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05305727typedef void (*sme_rcpi_callback)(void *context, struct qdf_mac_addr mac_addr,
5728 int32_t rcpi, QDF_STATUS status);
5729/**
5730 * struct sme_rcpi_req - structure for querying rcpi info
5731 * @session_id: session for which rcpi is required
5732 * @measurement_type: type of measurement from enum rcpi_measurement_type
5733 * @rcpi_callback: callback function to be invoked for rcpi response
5734 * @rcpi_context: context info for rcpi callback
5735 * @mac_addr: peer addr for which rcpi is required
5736 */
5737struct sme_rcpi_req {
5738 uint32_t session_id;
5739 enum rcpi_measurement_type measurement_type;
5740 sme_rcpi_callback rcpi_callback;
5741 void *rcpi_context;
5742 struct qdf_mac_addr mac_addr;
5743};
5744
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08005745/*
5746 * @SCAN_REJECT_DEFAULT: default value
5747 * @CONNECTION_IN_PROGRESS: connection is in progress
5748 * @REASSOC_IN_PROGRESS: reassociation is in progress
5749 * @EAPOL_IN_PROGRESS: STA/P2P-CLI is in middle of EAPOL/WPS exchange
5750 * @SAP_EAPOL_IN_PROGRESS: SAP/P2P-GO is in middle of EAPOL/WPS exchange
5751 */
5752enum scan_reject_states {
5753 SCAN_REJECT_DEFAULT = 0,
5754 CONNECTION_IN_PROGRESS,
5755 REASSOC_IN_PROGRESS,
5756 EAPOL_IN_PROGRESS,
5757 SAP_EAPOL_IN_PROGRESS,
5758};
Sandeep Puligillaf587adf2017-04-27 19:53:21 -07005759
5760/**
lifeng66831662017-05-19 16:01:35 +08005761 * sir_sme_rx_aggr_hole_ind - sme rx aggr hole indication
5762 * @hole_cnt: num of holes detected
5763 * @hole_info_array: hole info
5764 */
5765struct sir_sme_rx_aggr_hole_ind {
5766 uint32_t hole_cnt;
5767 uint32_t hole_info_array[];
5768};
5769
5770/**
5771 * struct sir_set_rx_reorder_timeout_val - rx reorder timeout
5772 * @rx_timeout_pri: reorder timeout for AC
5773 * rx_timeout_pri[0] : AC_VO
5774 * rx_timeout_pri[1] : AC_VI
5775 * rx_timeout_pri[2] : AC_BE
5776 * rx_timeout_pri[3] : AC_BK
5777 */
5778struct sir_set_rx_reorder_timeout_val {
5779 uint32_t rx_timeout_pri[4];
5780};
5781
5782/**
5783 * struct sir_peer_set_rx_blocksize - set rx blocksize
5784 * @vdev_id: vdev id
5785 * @peer_macaddr: peer mac address
5786 * @rx_block_ack_win_limit: windows size limitation
5787 */
5788struct sir_peer_set_rx_blocksize {
5789 uint32_t vdev_id;
5790 struct qdf_mac_addr peer_macaddr;
5791 uint32_t rx_block_ack_win_limit;
5792};
Abhishek Singhf3756fc2017-06-28 16:04:06 +05305793
5794/**
5795 * struct sir_rssi_disallow_lst - Structure holding Rssi based avoid candidate
5796 * list
5797 * @node: Node pointer
5798 * @bssid: BSSID of the AP
5799 * @retry_delay: Retry delay received during last rejection in ms
5800 * @ expected_rssi: RSSI at which STA can initate
5801 * @time_during_rejection: Timestamp during last rejection in millisec
5802 */
5803struct sir_rssi_disallow_lst {
5804 qdf_list_node_t node;
5805 struct qdf_mac_addr bssid;
5806 uint32_t retry_delay;
5807 int8_t expected_rssi;
5808 qdf_time_t time_during_rejection;
5809};
lifengd217d192017-05-09 19:44:16 +08005810
5811/**
5812 * struct chain_rssi_result - chain rssi result
Jeff Johnson00634ab2018-05-10 14:27:50 -07005813 * num_chains_valid: valid chain num
lifengd217d192017-05-09 19:44:16 +08005814 * @chain_rssi: chain rssi result as dBm unit
stonez396a9732019-01-16 12:29:16 +08005815 * @chain_evm: error vector magnitude
lifengfe6c3e22018-04-03 12:10:04 +08005816 * @ant_id: antenna id
lifengd217d192017-05-09 19:44:16 +08005817 */
lifengfe6c3e22018-04-03 12:10:04 +08005818#define CHAIN_MAX_NUM 8
lifengd217d192017-05-09 19:44:16 +08005819struct chain_rssi_result {
lifengfe6c3e22018-04-03 12:10:04 +08005820 uint32_t num_chains_valid;
5821 uint32_t chain_rssi[CHAIN_MAX_NUM];
stonez396a9732019-01-16 12:29:16 +08005822 int32_t chain_evm[CHAIN_MAX_NUM];
lifengfe6c3e22018-04-03 12:10:04 +08005823 uint32_t ant_id[CHAIN_MAX_NUM];
lifengd217d192017-05-09 19:44:16 +08005824};
5825
5826/**
5827 * struct get_chain_rssi_req_params - get chain rssi req params
5828 * @peer_macaddr: specific peer mac address
5829 * @session_id: session id
5830 */
5831struct get_chain_rssi_req_params {
5832 struct qdf_mac_addr peer_macaddr;
5833 uint8_t session_id;
5834};
5835
Ganesh Kondabattini35739572017-06-21 16:26:39 +05305836/*
5837 * struct sir_limit_off_chan - limit off-channel command parameters
5838 * @vdev_id: vdev id
5839 * @is_tos_active: status of the traffic (active/inactive)
5840 * @max_off_chan_time: max allowed off channel time
5841 * @rest_time: home channel time
5842 * @skip_dfs_chans: skip dfs channels during scan
5843 */
5844struct sir_limit_off_chan {
5845 uint8_t vdev_id;
5846 bool is_tos_active;
5847 uint32_t max_off_chan_time;
5848 uint32_t rest_time;
5849 bool skip_dfs_chans;
5850};
Padma, Santhosh Kumarb38ab512018-01-16 16:16:46 +05305851
Rajeev Kumar Sirasanagandla4f20b672018-03-12 13:52:50 +05305852typedef void (*roam_scan_stats_cb)(void *context,
5853 struct wmi_roam_scan_stats_res *res);
5854
5855/**
5856 * struct sir_roam_scan_stats - Stores roam scan context
5857 * @vdev_id: vdev id
5858 * @cb: callback to be invoked for roam scan stats response
5859 * @context: context of callback
5860 */
5861struct sir_roam_scan_stats {
5862 uint32_t vdev_id;
5863 roam_scan_stats_cb cb;
5864 void *context;
5865};
5866
Padma, Santhosh Kumarb38ab512018-01-16 16:16:46 +05305867/**
5868 * struct sae_info - SAE info used for commit/confirm messages
5869 * @msg_type: Message type
5870 * @msg_len: length of message
5871 * @vdev_id: vdev id
5872 * @peer_mac_addr: peer MAC address
5873 * @ssid: SSID
5874 */
5875struct sir_sae_info {
5876 uint16_t msg_type;
5877 uint16_t msg_len;
5878 uint32_t vdev_id;
5879 struct qdf_mac_addr peer_mac_addr;
5880 tSirMacSSid ssid;
5881};
Padma, Santhosh Kumardd3f4852018-01-16 18:51:51 +05305882
5883/**
5884 * struct sir_sae_msg - SAE msg used for message posting
5885 * @message_type: message type
5886 * @length: message length
5887 * @session_id: SME session id
5888 * @sae_status: SAE status, 0: Success, Non-zero: Failure.
Srinivas Dasarie854ff02019-02-11 17:24:48 +05305889 * @peer_mac_addr: peer MAC address
Padma, Santhosh Kumardd3f4852018-01-16 18:51:51 +05305890 */
5891struct sir_sae_msg {
5892 uint16_t message_type;
5893 uint16_t length;
5894 uint16_t session_id;
5895 uint8_t sae_status;
Srinivas Dasarie854ff02019-02-11 17:24:48 +05305896 tSirMacAddr peer_mac_addr;
Padma, Santhosh Kumardd3f4852018-01-16 18:51:51 +05305897};
5898
Varun Reddy Yeturu951de5d2018-09-10 21:36:22 -07005899/**
5900 * struct set_pcl_req - Request message to set the PCL
5901 * @chan_weights: PCL channel weights
5902 * @band: Supported band
5903 */
5904struct set_pcl_req {
5905 struct wmi_pcl_chan_weights chan_weights;
5906 enum band_info band;
5907};
5908
Visweswara Tanuku633976b2019-01-07 16:13:12 +05305909/**
5910 * struct sir_md_evt - motion detection event status
5911 * @vdev_id: vdev id
5912 * @status: md event status
5913 */
5914#ifdef WLAN_FEATURE_MOTION_DETECTION
5915struct sir_md_evt {
5916 uint8_t vdev_id;
5917 uint32_t status;
5918};
5919#endif /* WLAN_FEATURE_MOTION_DETECTION */
Arun Kumar Khandavallideda5a82019-03-11 15:32:19 +05305920
5921#ifdef WLAN_MWS_INFO_DEBUGFS
5922/**
5923 * struct sir_get_mws_coex_info - Get MWS coex info
5924 * @vdev_id: vdev id
5925 * @cmd_id: wmi mws-coex command IDs
5926 */
5927struct sir_get_mws_coex_info {
5928 uint32_t vdev_id;
5929 uint32_t cmd_id;
5930};
5931#endif /* WLAN_MWS_INFO_DEBUGFS */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005932#endif /* __SIR_API_H */