blob: 1b4a98d5842db031270da80b7e9874533b6f84f1 [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"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080050
51#define OFFSET_OF(structType, fldName) (&((structType *)0)->fldName)
52
53/* / Max supported channel list */
54#define SIR_MAX_SUPPORTED_CHANNEL_LIST 96
Wu Gao0821b0d2019-01-11 17:31:11 +080055#define CFG_VALID_CHANNEL_LIST_LEN 100
Wu Gaoaa155142019-01-14 15:09:26 +080056#define CFG_COUNTRY_CODE_LEN 3
57
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080058#define SIR_MDIE_ELEMENT_ID 54
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
68#define SIR_PM_SLEEP_MODE 0
69#define SIR_PM_ACTIVE_MODE 1
70
71/* hidden SSID options */
72#define SIR_SCAN_NO_HIDDEN_SSID 0
73#define SIR_SCAN_HIDDEN_SSID_PE_DECISION 1
74
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080075#define SIR_IPV4_ADDR_LEN 4
76
77typedef uint8_t tSirIpv4Addr[SIR_IPV4_ADDR_LEN];
78
79#define SIR_VERSION_STRING_LEN 64
80typedef uint8_t tSirVersionString[SIR_VERSION_STRING_LEN];
81
82/* Periodic Tx pattern offload feature */
83#define PERIODIC_TX_PTRN_MAX_SIZE 1536
84#define MAXNUM_PERIODIC_TX_PTRNS 6
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080085
Abhishek Singhd1f21c72019-01-21 15:16:34 +053086
87/* FW response timeout values in milli seconds */
88#define SIR_PEER_ASSOC_TIMEOUT (2000) /* 1 seconds */
89#define SIR_DELETE_STA_TIMEOUT (2000) /* 2 seconds */
90#define SIR_VDEV_START_REQUEST_TIMEOUT (6000)
91#define SIR_VDEV_STOP_REQUEST_TIMEOUT (2000)
92#define SIR_VDEV_PLCY_MGR_TIMEOUT (2000)
93
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080094/* This should not be greater than MAX_NUMBER_OF_CONC_CONNECTIONS */
95#define MAX_VDEV_SUPPORTED 4
96
Manjeet Singhf82ed072016-07-08 11:40:00 +053097#define MAX_POWER_DBG_ARGS_SUPPORTED 8
Agrawal Ashishad16bda2016-09-16 20:16:04 +053098#define QOS_MAP_MAX_EX 21
99#define QOS_MAP_LEN_MIN 16
100#define QOS_MAP_LEN_MAX \
101 (QOS_MAP_LEN_MIN + 2 * QOS_MAP_MAX_EX)
Himanshu Agarwal37e42412016-07-21 14:35:09 +0530102#define NUM_CHAINS_MAX 2
103
Abhishek Singhf3756fc2017-06-28 16:04:06 +0530104#define MAX_RSSI_AVOID_BSSID_LIST 10
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530105
106/* Maximum number of realms present in fils indication element */
107#define SIR_MAX_REALM_COUNT 7
108/* Realm length */
109#define SIR_REALM_LEN 2
110/* Cache ID length */
111#define CACHE_ID_LEN 2
112
Will Huang496b36c2017-07-11 16:38:50 +0800113/* Maximum peer station number query one time */
114#define MAX_PEER_STA 12
115
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -0800116/* Maximum number of peers for SAP */
Rachit Kankane154559c2018-07-12 14:02:30 +0530117#ifndef SIR_SAP_MAX_NUM_PEERS
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -0800118#define SIR_SAP_MAX_NUM_PEERS 32
Rachit Kankane154559c2018-07-12 14:02:30 +0530119#endif
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -0800120
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800121#define SIR_KRK_KEY_LEN 16
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800122#define SIR_BTK_KEY_LEN 32
123#define SIR_KCK_KEY_LEN 16
124#define SIR_KEK_KEY_LEN 16
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +0530125#define SIR_KEK_KEY_LEN_FILS 64
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800126#define SIR_REPLAY_CTR_LEN 8
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +0530127#define SIR_PMK_LEN 48
128#define SIR_PMKID_LEN 16
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -0800129#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800130#define SIR_UAPSD_BITOFFSET_ACVO 0
131#define SIR_UAPSD_BITOFFSET_ACVI 1
132#define SIR_UAPSD_BITOFFSET_ACBK 2
133#define SIR_UAPSD_BITOFFSET_ACBE 3
134
135#define SIR_UAPSD_FLAG_ACVO (1 << SIR_UAPSD_BITOFFSET_ACVO)
136#define SIR_UAPSD_FLAG_ACVI (1 << SIR_UAPSD_BITOFFSET_ACVI)
137#define SIR_UAPSD_FLAG_ACBK (1 << SIR_UAPSD_BITOFFSET_ACBK)
138#define SIR_UAPSD_FLAG_ACBE (1 << SIR_UAPSD_BITOFFSET_ACBE)
139#define SIR_UAPSD_GET(ac, mask) (((mask) & (SIR_UAPSD_FLAG_ ## ac)) >> SIR_UAPSD_BITOFFSET_ ## ac)
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800140
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800141#endif
142
Nachiket Kukade63bb63d2018-11-21 14:42:14 +0530143struct scheduler_msg;
144
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800145/**
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700146 * enum sir_roam_op_code - Operation to be done by the callback.
147 * @SIR_ROAM_SYNCH_PROPAGATION: Propagate the new BSS info after roaming.
148 * @SIR_ROAMING_DEREGISTER_STA: Deregister the old STA after roaming.
Naveen Rawat8cc23b02016-07-14 12:22:56 -0700149 * @SIR_ROAMING_START: Firmware started roaming operation
150 * @SIR_ROAMING_ABORT: Firmware aborted roaming operation, still connected.
151 * @SIR_ROAM_SYNCH_COMPLETE: Roam sync propagation is complete.
Arif Hussain43354e62017-05-24 11:24:25 -0700152 * @SIR_ROAMING_INVOKE_FAIL: Firmware roaming failed.
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700153 */
154enum sir_roam_op_code {
155 SIR_ROAM_SYNCH_PROPAGATION = 1,
156 SIR_ROAMING_DEREGISTER_STA,
Naveen Rawat8cc23b02016-07-14 12:22:56 -0700157 SIR_ROAMING_START,
158 SIR_ROAMING_ABORT,
159 SIR_ROAM_SYNCH_COMPLETE,
Varun Reddy Yeturu04251862016-09-16 10:33:19 -0700160 SIR_ROAM_SYNCH_NAPI_OFF,
Arif Hussain43354e62017-05-24 11:24:25 -0700161 SIR_ROAMING_INVOKE_FAIL,
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700162};
163/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800164 * Module ID definitions.
165 */
166enum {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800167 SIR_HAL_MODULE_ID = 0x10,
Wu Gao55020ec2019-01-23 14:29:58 +0800168 SIR_LIM_MODULE_ID = 0x13,
Jeff Johnsona2f8e8f2018-12-30 18:06:58 -0800169 SIR_SME_MODULE_ID,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800170};
171
172#define SIR_WMA_MODULE_ID SIR_HAL_MODULE_ID
173
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800174/* Type declarations used by Firmware and Host software */
175
176/* Scan type enum used in scan request */
177typedef enum eSirScanType {
178 eSIR_PASSIVE_SCAN,
179 eSIR_ACTIVE_SCAN,
180 eSIR_BEACON_TABLE,
181} tSirScanType;
182
gaurank kathpaliac63859d2018-05-03 18:48:41 +0530183/* Rsn Capabilities structure */
184struct rsn_caps {
185 uint16_t PreAuthSupported:1;
186 uint16_t NoPairwise:1;
187 uint16_t PTKSAReplayCounter:2;
188 uint16_t GTKSAReplayCounter:2;
189 uint16_t MFPRequired:1;
190 uint16_t MFPCapable:1;
191 uint16_t Reserved:8;
192};
193
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800194/* / Result codes Firmware return to Host SW */
195typedef enum eSirResultCodes {
196 eSIR_SME_SUCCESS,
Abhishek Singh4294f802017-08-10 16:37:07 +0530197 eSIR_LOGE_EXCEPTION,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800198 eSIR_SME_INVALID_PARAMETERS = 500,
199 eSIR_SME_UNEXPECTED_REQ_RESULT_CODE,
200 eSIR_SME_RESOURCES_UNAVAILABLE,
201 /* Unable to find a BssDescription */
202 eSIR_SME_SCAN_FAILED,
203 /* matching requested scan criteria */
204 eSIR_SME_BSS_ALREADY_STARTED_OR_JOINED,
205 eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE,
206 eSIR_SME_REFUSED,
207 eSIR_SME_JOIN_DEAUTH_FROM_AP_DURING_ADD_STA,
208 eSIR_SME_JOIN_TIMEOUT_RESULT_CODE,
209 eSIR_SME_AUTH_TIMEOUT_RESULT_CODE,
210 eSIR_SME_ASSOC_TIMEOUT_RESULT_CODE,
211 eSIR_SME_REASSOC_TIMEOUT_RESULT_CODE,
212 eSIR_SME_MAX_NUM_OF_PRE_AUTH_REACHED,
213 eSIR_SME_AUTH_REFUSED,
214 eSIR_SME_INVALID_WEP_DEFAULT_KEY,
215 eSIR_SME_NO_KEY_MAPPING_KEY_FOR_PEER,
216 eSIR_SME_ASSOC_REFUSED,
217 eSIR_SME_REASSOC_REFUSED,
218 /* Recvd Deauth while join/pre-auth */
219 eSIR_SME_DEAUTH_WHILE_JOIN,
220 eSIR_SME_STA_NOT_AUTHENTICATED,
221 eSIR_SME_STA_NOT_ASSOCIATED,
222 eSIR_SME_ALREADY_JOINED_A_BSS,
223 /* Given in SME_SCAN_RSP msg */
224 eSIR_SME_MORE_SCAN_RESULTS_FOLLOW,
225 /* that more SME_SCAN_RSP */
226 /* messages are following. */
227 /* SME_SCAN_RSP message with */
228 /* eSIR_SME_SUCCESS status */
229 /* code is the last one. */
230 /* Sent in SME_JOIN/REASSOC_RSP */
231 eSIR_SME_INVALID_ASSOC_RSP_RXED,
232 /* messages upon receiving */
233 /* invalid Re/Assoc Rsp frame. */
234 /* STOP BSS triggered by MIC failures: MAC software to
235 * disassoc all stations
236 */
237 eSIR_SME_MIC_COUNTER_MEASURES,
238 /* with MIC_FAILURE reason code and perform the stop bss operation */
239 /* didn't get rsp from peer within timeout interval */
240 eSIR_SME_ADDTS_RSP_TIMEOUT,
241 /* didn't get success rsp from HAL */
242 eSIR_SME_ADDTS_RSP_FAILED,
243 /* failed to send ch switch act frm */
244 eSIR_SME_CHANNEL_SWITCH_FAIL,
245 eSIR_SME_INVALID_STATE,
246 /* SIR_HAL_SIR_HAL_INIT_SCAN_RSP returned failed status */
247 eSIR_SME_HAL_SCAN_INIT_FAILED,
248 /* SIR_HAL_END_SCAN_RSP returned failed status */
249 eSIR_SME_HAL_SCAN_END_FAILED,
250 /* SIR_HAL_FINISH_SCAN_RSP returned failed status */
251 eSIR_SME_HAL_SCAN_FINISH_FAILED,
252 /* Failed to send a message to HAL */
253 eSIR_SME_HAL_SEND_MESSAGE_FAIL,
254 /* Failed to stop the bss */
255 eSIR_SME_STOP_BSS_FAILURE,
256 eSIR_SME_WOWL_ENTER_REQ_FAILED,
257 eSIR_SME_WOWL_EXIT_REQ_FAILED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800258 eSIR_SME_FT_REASSOC_TIMEOUT_FAILURE,
259 eSIR_SME_FT_REASSOC_FAILURE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800260 eSIR_SME_SEND_ACTION_FAIL,
261 eSIR_SME_DEAUTH_STATUS,
262 eSIR_PNO_SCAN_SUCCESS,
Varun Reddy Yeturu371404b2017-11-30 15:31:35 -0800263 eSIR_SME_INVALID_SESSION,
Varun Reddy Yeturua47f08f2018-08-07 14:45:31 -0700264 eSIR_SME_PEER_CREATE_FAILED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800265 eSIR_DONOT_USE_RESULT_CODE = SIR_MAX_ENUM_SIZE
266} tSirResultCodes;
267
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +0530268#ifdef WLAN_FEATURE_FILS_SK
269struct fils_join_rsp_params {
270 uint8_t *fils_pmk;
271 uint8_t fils_pmk_len;
272 uint8_t fils_pmkid[PMKID_LEN];
273 uint8_t kek[MAX_KEK_LEN];
274 uint8_t kek_len;
275 uint8_t tk[MAX_TK_LEN];
276 uint8_t tk_len;
277 uint8_t gtk_len;
278 uint8_t gtk[MAX_GTK_LEN];
Vignesh Viswanathana1bb0922017-09-15 12:58:48 +0530279 struct qdf_mac_addr dst_mac;
280 struct qdf_mac_addr src_mac;
281 uint16_t hlp_data_len;
282 uint8_t hlp_data[FILS_MAX_HLP_DATA_LEN];
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +0530283};
284#endif
285
Krishna Kumaar Natarajanf599c6e2015-11-03 11:44:03 -0800286#define RMENABLEDCAP_MAX_LEN 5
287
288struct rrm_config_param {
289 uint8_t rrm_enabled;
290 uint8_t max_randn_interval;
291 uint8_t rm_capability[RMENABLEDCAP_MAX_LEN];
292};
293
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800294/*
Jeff Johnsonecd4f212019-02-01 19:36:34 -0800295 * although in struct supported_rates each IE is 16bit but PE only
296 * passes IEs in 8 bits with MSB=1 for basic rates. change the mask
297 * for bit0-7 only so HAL gets correct basic rates for setting
298 * response rates.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800299 */
300#define IERATE_BASICRATE_MASK 0x80
301#define IERATE_RATE_MASK 0x7f
302#define IERATE_IS_BASICRATE(x) ((x) & IERATE_BASICRATE_MASK)
303
Sreelakshmi Konamki39acb132015-12-16 13:06:22 +0530304const char *lim_bss_type_to_string(const uint16_t bss_type);
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700305/**
Jeff Johnsonecd4f212019-02-01 19:36:34 -0800306 * struct supported_rates - stores rates/MCS supported
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700307 * @llbRates: 11b rates in unit of 500kbps
308 * @llaRates: 11a rates in unit of 500kbps
309 * @supportedMCSSet: supported basic MCS, 0-76 bits used, remaining reserved
310 * bits 0-15 and 32 should be set.
311 * @rxHighestDataRate: RX Highest Supported Data Rate defines the highest data
312 * rate that the STA is able to receive, in unites of 1Mbps
313 * This value is derived from "Supported MCS Set field"
314 * inside the HT capability element.
315 * @vhtRxMCSMap: Indicates the Maximum MCS(VHT) that can be received for each
316 * number of spacial streams
317 * @vhtRxHighestDataRate: Indicate the highest VHT data rate that the STA is
318 * able to receive
319 * @vhtTxMCSMap: Indicates the Maximum MCS(VHT) that can be transmitted for
320 * each number of spacial streams
321 * @vhtTxHighestDataRate: Indicate the highest VHT data rate that the STA is
322 * able to transmit
323 * @he_rx_mcs: Indicates the Maximum MCS(HE) that can be received for each
324 * number of spacial streams
325 * @he_tx_mcs: Indicates the Maximum MCS(HE) that can be transmitted for each
326 * number of spacial streams
327 */
Jeff Johnsonecd4f212019-02-01 19:36:34 -0800328struct supported_rates {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800329 uint16_t llbRates[SIR_NUM_11B_RATES];
330 uint16_t llaRates[SIR_NUM_11A_RATES];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800331 uint8_t supportedMCSSet[SIR_MAC_MAX_SUPPORTED_MCS_SET];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800332 uint16_t rxHighestDataRate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800333 uint16_t vhtRxMCSMap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800334 uint16_t vhtRxHighestDataRate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800335 uint16_t vhtTxMCSMap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800336 uint16_t vhtTxHighestDataRate;
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700337#ifdef WLAN_FEATURE_11AX
Naveen Rawataeca1b92017-10-16 16:55:31 -0700338 uint16_t rx_he_mcs_map_lt_80;
339 uint16_t tx_he_mcs_map_lt_80;
340 uint16_t rx_he_mcs_map_160;
341 uint16_t tx_he_mcs_map_160;
342 uint16_t rx_he_mcs_map_80_80;
343 uint16_t tx_he_mcs_map_80_80;
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700344#endif
Jeff Johnsonecd4f212019-02-01 19:36:34 -0800345};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800346
Jeff Johnson78f7a182019-02-01 22:45:41 -0800347struct register_mgmt_frame {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800348 uint16_t messageType;
349 uint16_t length;
350 uint8_t sessionId;
351 bool registerFrame;
352 uint16_t frameType;
353 uint16_t matchLen;
354 uint8_t matchData[1];
Jeff Johnson78f7a182019-02-01 22:45:41 -0800355};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800356
357/* / Generic type for sending a response message */
358/* / with result code to host software */
359typedef struct sSirSmeRsp {
360 uint16_t messageType; /* eWNI_SME_*_RSP */
361 uint16_t length;
362 uint8_t sessionId; /* To support BT-AMP */
363 uint16_t transactionId; /* To support BT-AMP */
364 tSirResultCodes statusCode;
Kabilan Kannanf56f9d52017-04-05 03:31:34 -0700365 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800366} tSirSmeRsp, *tpSirSmeRsp;
367
368/* / Definition for indicating all modules ready on STA */
Jeff Johnson47e4b552019-02-01 23:12:25 -0800369struct sme_ready_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800370 uint16_t messageType; /* eWNI_SME_SYS_READY_IND */
371 uint16_t length;
372 uint16_t transactionId;
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);
Jeff Johnson47e4b552019-02-01 23:12:25 -0800378};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800379
380/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800381 * struct s_sir_set_hw_mode - Set HW mode request
382 * @messageType: Message type
383 * @length: Length of the message
384 * @set_hw: Params containing the HW mode index and callback
385 */
386struct s_sir_set_hw_mode {
387 uint16_t messageType;
388 uint16_t length;
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -0800389 struct policy_mgr_hw_mode set_hw;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800390};
391
392/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800393 * struct sir_set_dual_mac_cfg - Set Dual mac config request
394 * @message_type: Message type
395 * @length: Length of the message
396 * @set_dual_mac: Params containing the dual mac config and callback
397 */
398struct sir_set_dual_mac_cfg {
399 uint16_t message_type;
400 uint16_t length;
Srinivas Girigowdaeb6ecf32018-02-15 17:04:22 -0800401 struct policy_mgr_dual_mac_config set_dual_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800402};
403
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800404/**
405 * struct sir_antenna_mode_param - antenna mode param
406 * @num_tx_chains: Number of TX chains
407 * @num_rx_chains: Number of RX chains
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800408 * @set_antenna_mode_resp: callback to set antenna mode command
Dundi Raviteja6bb9e322018-05-16 17:04:41 +0530409 * @set_antenna_mode_ctx: callback context to set antenna mode command
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800410 */
411struct sir_antenna_mode_param {
412 uint32_t num_tx_chains;
413 uint32_t num_rx_chains;
414 void *set_antenna_mode_resp;
Dundi Raviteja6bb9e322018-05-16 17:04:41 +0530415 void *set_antenna_mode_ctx;
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800416};
417
418/**
419 * struct sir_set_antenna_mode - Set antenna mode request
420 * @message_type: Message type
421 * @length: Length of the message
422 * @set_antenna_mode: Params containing antenna mode params
423 */
424struct sir_set_antenna_mode {
425 uint16_t message_type;
426 uint16_t length;
427 struct sir_antenna_mode_param set_antenna_mode;
428};
429
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700430/**
431 * enum tSirBssType - Enum for BSS type used in scanning/joining etc.
432 *
433 * @eSIR_INFRASTRUCTURE_MODE: Infrastructure station
434 * @eSIR_INFRA_AP_MODE: softAP mode
435 * @eSIR_IBSS_MODE: IBSS mode
436 * @eSIR_AUTO_MODE: Auto role
437 * @eSIR_MONITOR_MODE: Monitor mode
438 * @eSIR_NDI_MODE: NAN datapath mode
439 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800440typedef enum eSirBssType {
441 eSIR_INFRASTRUCTURE_MODE,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700442 eSIR_INFRA_AP_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800443 eSIR_IBSS_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800444 eSIR_AUTO_MODE,
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -0700445 eSIR_MONITOR_MODE,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700446 eSIR_NDI_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800447 eSIR_DONOT_USE_BSS_TYPE = SIR_MAX_ENUM_SIZE
448} tSirBssType;
449
450/* / Power Capability info used in 11H */
Jeff Johnson39f02ae2019-02-01 23:42:38 -0800451struct power_cap_info {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800452 uint8_t minTxPower;
453 uint8_t maxTxPower;
Jeff Johnson39f02ae2019-02-01 23:42:38 -0800454};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800455
456/* / Supported Channel info used in 11H */
Jeff Johnsoned4f4d52019-02-02 00:09:45 -0800457struct supported_channels {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800458 uint8_t numChnl;
459 uint8_t channelList[SIR_MAX_SUPPORTED_CHANNEL_LIST];
Jeff Johnsoned4f4d52019-02-02 00:09:45 -0800460};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800461
462typedef enum eSirNwType {
463 eSIR_11A_NW_TYPE,
464 eSIR_11B_NW_TYPE,
465 eSIR_11G_NW_TYPE,
466 eSIR_11N_NW_TYPE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800467 eSIR_11AC_NW_TYPE,
Krishna Kumaar Natarajan4f1d7722017-03-03 21:12:51 -0800468 eSIR_11AX_NW_TYPE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800469 eSIR_DONOT_USE_NW_TYPE = SIR_MAX_ENUM_SIZE
470} tSirNwType;
471
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800472/* HT configuration values */
Jeff Johnson72ac2c82019-02-02 12:26:35 -0800473struct ht_config {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800474 /* Enable/Disable receiving LDPC coded packets */
475 uint32_t ht_rx_ldpc:1;
476 /* Enable/Disable TX STBC */
477 uint32_t ht_tx_stbc:1;
478 /* Enable/Disable RX STBC */
479 uint32_t ht_rx_stbc:2;
480 /* Enable/Disable SGI */
Sandeep Puligilla607f34a2016-05-25 14:37:47 -0700481 uint32_t ht_sgi20:1;
482 uint32_t ht_sgi40:1;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800483 uint32_t unused:27;
Jeff Johnson72ac2c82019-02-02 12:26:35 -0800484};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800485
Sandeep Puligilla98917432016-06-10 13:50:28 -0700486/**
Jeff Johnson118a4a02018-05-06 00:14:15 -0700487 * struct sir_vht_config - VHT capabilities
Sandeep Puligilla98917432016-06-10 13:50:28 -0700488 * @max_mpdu_len: MPDU length
489 * @supported_channel_widthset: channel width set
490 * @ldpc_coding: LDPC coding capability
491 * @shortgi80: short GI 80 support
492 * @shortgi160and80plus80: short Gi 160 & 80+80 support
493 * @tx_stbc; Tx STBC cap
494 * @tx_stbc: Rx STBC cap
495 * @su_beam_former: SU beam former cap
496 * @su_beam_formee: SU beam formee cap
497 * @csnof_beamformer_antSup: Antenna support for beamforming
498 * @num_soundingdim: Sound dimensions
499 * @mu_beam_former: MU beam former cap
500 * @mu_beam_formee: MU beam formee cap
501 * @vht_txops: TXOP power save
502 * @htc_vhtcap: HTC VHT capability
503 * @max_ampdu_lenexp: AMPDU length
504 * @vht_link_adapt: VHT link adapatation capable
505 * @rx_antpattern: Rx Antenna pattern
506 * @tx_antpattern: Tx Antenna pattern
507 */
508struct sir_vht_config {
509 uint32_t max_mpdu_len:2;
510 uint32_t supported_channel_widthset:2;
511 uint32_t ldpc_coding:1;
512 uint32_t shortgi80:1;
513 uint32_t shortgi160and80plus80:1;
514 uint32_t tx_stbc:1;
515 uint32_t rx_stbc:3;
516 uint32_t su_beam_former:1;
517 uint32_t su_beam_formee:1;
518 uint32_t csnof_beamformer_antSup:3;
519 uint32_t num_soundingdim:3;
520 uint32_t mu_beam_former:1;
521 uint32_t mu_beam_formee:1;
522 uint32_t vht_txops:1;
523 uint32_t htc_vhtcap:1;
524 uint32_t max_ampdu_lenexp:3;
525 uint32_t vht_link_adapt:2;
526 uint32_t rx_antpattern:1;
527 uint32_t tx_antpattern:1;
528 uint32_t unused:2;
529};
530
531
Jeff Johnson90542e52019-02-02 13:59:56 -0800532struct add_ie_params {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800533 uint16_t probeRespDataLen;
534 uint8_t *probeRespData_buff;
535 uint16_t assocRespDataLen;
536 uint8_t *assocRespData_buff;
537 uint16_t probeRespBCNDataLen;
538 uint8_t *probeRespBCNData_buff;
Jeff Johnson90542e52019-02-02 13:59:56 -0800539};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800540
541/* / Definition for kick starting BSS */
542/* / ---> MAC */
543/**
544 * Usage of ssId, numSSID & ssIdList:
545 * ---------------------------------
546 * 1. ssId.length of zero indicates that Broadcast/Suppress SSID
547 * feature is enabled.
548 * 2. If ssId.length is zero, MAC SW will advertise NULL SSID
549 * and interpret the SSID list from numSSID & ssIdList.
550 * 3. If ssId.length is non-zero, MAC SW will advertise the SSID
551 * specified in the ssId field and it is expected that
552 * application will set numSSID to one (only one SSID present
553 * in the list) and SSID in the list is same as ssId field.
554 * 4. Application will always set numSSID >= 1.
555 */
556/* ***** NOTE: Please make sure all codes are updated if inserting field into
557 * this structure..********** */
Jeff Johnson704b8912019-02-02 14:38:14 -0800558struct start_bss_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800559 uint16_t messageType; /* eWNI_SME_START_BSS_REQ */
560 uint16_t length;
561 uint8_t sessionId; /* Added for BT-AMP Support */
562 uint16_t transactionId; /* Added for BT-AMP Support */
Anurag Chouhan6d760662016-02-20 16:05:43 +0530563 struct qdf_mac_addr bssid; /* Added for BT-AMP Support */
564 struct qdf_mac_addr self_macaddr; /* Added for BT-AMP Support */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800565 uint16_t beaconInterval; /* Added for BT-AMP Support */
566 uint8_t dot11mode;
567#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
568 uint8_t cc_switch_mode;
569#endif
570 tSirBssType bssType;
571 tSirMacSSid ssId;
572 uint8_t channelId;
573 ePhyChanBondState cbMode;
574 uint8_t vht_channel_width;
575 uint8_t center_freq_seg0;
576 uint8_t center_freq_seg1;
577 uint8_t sec_ch_offset;
578
579 uint8_t privacy;
580 uint8_t apUapsdEnable;
581 uint8_t ssidHidden;
582 bool fwdWPSPBCProbeReq;
583 bool protEnabled;
584 bool obssProtEnabled;
585 uint16_t ht_capab;
586 tAniAuthType authType;
587 uint32_t dtimPeriod;
588 uint8_t wps_state;
589 uint8_t isCoalesingInIBSSAllowed; /* Coalesing on/off knob */
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800590 enum QDF_OPMODE bssPersona;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800591
592 uint8_t txLdpcIniFeatureEnabled;
593
594 tSirRSNie rsnIE; /* RSN IE to be sent in */
595 /* Beacon and Probe */
596 /* Response frames */
597 tSirNwType nwType; /* Indicates 11a/b/g */
598 tSirMacRateSet operationalRateSet; /* Has 11a or 11b rates */
599 tSirMacRateSet extendedRateSet; /* Has 11g rates */
Jeff Johnsonbe119e62019-02-02 12:30:26 -0800600 struct ht_config ht_config;
Sandeep Puligilla98917432016-06-10 13:50:28 -0700601 struct sir_vht_config vht_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800602#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -0700603 tDot11fIEhe_cap he_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800604#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800605#ifdef WLAN_FEATURE_11W
606 bool pmfCapable;
607 bool pmfRequired;
608#endif
609
Jeff Johnson21aac3a2019-02-02 14:26:13 -0800610 struct add_ie_params add_ie_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800611
612 bool obssEnabled;
613 uint8_t sap_dot11mc;
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800614 uint16_t beacon_tx_rate;
Kapil Gupta4b2efbb2016-10-03 13:07:20 +0530615 bool vendor_vht_sap;
Arif Hussain671a1902017-03-17 09:08:32 -0700616 uint32_t cac_duration_ms;
617 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800618
Jeff Johnson704b8912019-02-02 14:38:14 -0800619};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800620
621#define GET_IE_LEN_IN_BSS(lenInBss) (lenInBss + sizeof(lenInBss) - \
622 ((uintptr_t)OFFSET_OF(tSirBssDescription,\
623 ieFields)))
624
625#define WSCIE_PROBE_RSP_LEN (317 + 2)
626
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530627#ifdef WLAN_FEATURE_FILS_SK
628/* struct fils_ind_elements: elements parsed from fils indication present
629 * in beacon/probe resp
630 * @realm_cnt: number of realm present
631 * @realm: realms
632 * @is_fils_sk_supported: if FILS SK supported
633 * @is_cache_id_present: if cache id present
634 * @cache_id: cache id
635 */
636struct fils_ind_elements {
637 uint16_t realm_cnt;
638 uint8_t realm[SIR_MAX_REALM_COUNT][SIR_REALM_LEN];
639 bool is_fils_sk_supported;
640 bool is_cache_id_present;
641 uint8_t cache_id[CACHE_ID_LEN];
642};
643#endif
644
Jeff Johnsone58271f2017-10-06 09:58:59 -0700645struct bss_description {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800646 /* offset of the ieFields from bssId. */
647 uint16_t length;
648 tSirMacAddr bssId;
Arun Khandavalli8a711cb2017-01-03 20:23:56 +0530649 unsigned long scansystimensec;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800650 uint32_t timeStamp[2];
651 uint16_t beaconInterval;
652 uint16_t capabilityInfo;
653 tSirNwType nwType; /* Indicates 11a/b/g */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800654 int8_t rssi;
Deepak Dhamdhere68929ec2015-08-05 15:16:35 -0700655 int8_t rssi_raw;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800656 int8_t sinr;
657 /* channelId what peer sent in beacon/probersp. */
658 uint8_t channelId;
659 /* channelId on which we are parked at. */
660 /* used only in scan case. */
661 uint8_t channelIdSelf;
662 uint8_t sSirBssDescriptionRsvd[3];
Deepthi Gowri6acee342016-10-28 15:00:38 +0530663 /* Based on system time, not a relative time. */
664 uint64_t received_time;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800665 uint32_t parentTSF;
666 uint32_t startTSF[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800667 uint8_t mdiePresent;
668 /* MDIE for 11r, picked from the beacons */
669 uint8_t mdie[SIR_MDIE_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800670#ifdef FEATURE_WLAN_ESE
671 uint16_t QBSSLoad_present;
672 uint16_t QBSSLoad_avail;
673 /* To achieve 8-byte alignment with ESE enabled */
674 uint32_t reservedPadding5;
675#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800676 /* whether it is from a probe rsp */
677 uint8_t fProbeRsp;
Deepak Dhamdhere652d7e82015-08-06 14:16:53 -0700678 /* Actual channel the beacon/probe response was received on */
679 uint8_t rx_channel;
Krishna Kumaar Natarajan89a99d42016-08-04 15:44:38 -0700680 tSirMacSeqCtl seq_ctrl;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800681 uint32_t WscIeLen;
682 uint8_t WscIeProbeRsp[WSCIE_PROBE_RSP_LEN];
683 uint8_t reservedPadding4;
684 uint32_t tsf_delta;
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530685#ifdef WLAN_FEATURE_FILS_SK
686 struct fils_ind_elements fils_info_element;
687#endif
688 /* Please keep the structure 4 bytes aligned above the ieFields */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800689 uint32_t ieFields[1];
Jeff Johnsone58271f2017-10-06 09:58:59 -0700690};
691typedef struct bss_description tSirBssDescription, *tpSirBssDescription;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800692
693#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
Jeff Johnson704af112019-02-02 16:11:55 -0800694struct ht_profile {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800695 uint8_t dot11mode;
696 uint8_t htCapability;
697 uint8_t htSupportedChannelWidthSet;
698 uint8_t htRecommendedTxWidthSet;
699 ePhyChanBondState htSecondaryChannelOffset;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800700 uint8_t vhtCapability;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800701 uint8_t apCenterChan;
702 uint8_t apChanWidth;
Jeff Johnson704af112019-02-02 16:11:55 -0800703};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800704#endif
705/* / Definition for response message to previously */
706/* / issued start BSS request */
707/* / MAC ---> */
Jeff Johnsona0d34622019-02-02 17:26:19 -0800708struct start_bss_rsp {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800709 uint16_t messageType; /* eWNI_SME_START_BSS_RSP */
710 uint16_t length;
711 uint8_t sessionId;
712 uint16_t transactionId; /* transaction ID for cmd */
713 tSirResultCodes statusCode;
714 tSirBssType bssType; /* Add new type for WDS mode */
715 uint16_t beaconInterval; /* Beacon Interval for both type */
Jeff Johnson179fd8a2018-05-11 14:20:05 -0700716 uint32_t staId; /* Station ID for Self */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800717#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
Jeff Johnsonf6541882019-02-02 16:16:00 -0800718 struct ht_profile ht_profile;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800719#endif
720 tSirBssDescription bssDescription; /* Peer BSS description */
Jeff Johnsona0d34622019-02-02 17:26:19 -0800721};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800722
Jeff Johnson39f94e32019-02-02 18:11:47 -0800723struct report_channel_list {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800724 uint8_t numChannels;
725 uint8_t channelNumber[SIR_ESE_MAX_MEAS_IE_REQS];
Jeff Johnson39f94e32019-02-02 18:11:47 -0800726};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800727
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800728#ifdef FEATURE_OEM_DATA_SUPPORT
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700729struct oem_data_req {
Gupta, Kapil8a605e12016-06-08 14:14:35 +0530730 uint32_t data_len;
Krishna Kumaar Natarajan9ac8efd2015-11-20 13:40:24 -0800731 uint8_t *data;
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700732};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800733
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700734struct oem_data_rsp {
Krishna Kumaar Natarajan608291e2015-12-14 18:17:27 -0800735 uint32_t rsp_len;
Krishna Kumaar Natarajan73ea9f22016-06-30 18:38:47 -0700736 uint8_t *data;
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700737};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800738#endif /* FEATURE_OEM_DATA_SUPPORT */
739
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800740#ifdef FEATURE_WLAN_ESE
yeshwanth sriram guntuka27e4ffc2016-12-01 18:00:17 +0530741typedef struct ese_wmm_tspec_ie {
742 uint16_t traffic_type:1;
743 uint16_t tsid:4;
744 uint16_t direction:2;
745 uint16_t access_policy:2;
746 uint16_t aggregation:1;
747 uint16_t psb:1;
748 uint16_t user_priority:3;
749 uint16_t tsinfo_ack_pol:2;
750 uint8_t tsinfo_rsvd:7;
751 uint8_t burst_size_defn:1;
752 uint16_t size:15;
753 uint16_t fixed:1;
754 uint16_t max_msdu_size;
755 uint32_t min_service_int;
756 uint32_t max_service_int;
757 uint32_t inactivity_int;
758 uint32_t suspension_int;
759 uint32_t service_start_time;
760 uint32_t min_data_rate;
761 uint32_t mean_data_rate;
762 uint32_t peak_data_rate;
763 uint32_t burst_size;
764 uint32_t delay_bound;
765 uint32_t min_phy_rate;
766 uint16_t surplus_bw_allowance;
767 uint16_t medium_time;
768} qdf_packed ese_wmm_tspec_ie;
769
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800770typedef struct sTspecInfo {
771 uint8_t valid;
Jeff Johnson56471b92018-12-22 14:36:06 -0800772 struct mac_tspec_ie tspec;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800773} tTspecInfo;
774
775#define SIR_ESE_MAX_TSPEC_IES 4
776typedef struct sESETspecTspecInfo {
777 uint8_t numTspecs;
778 tTspecInfo tspec[SIR_ESE_MAX_TSPEC_IES];
779} tESETspecInfo;
780
Jeff Johnson1482ae42019-02-02 18:29:24 -0800781struct tsm_ie {
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800782 uint8_t tsid;
783 uint8_t state;
784 uint16_t msmt_interval;
Jeff Johnson1482ae42019-02-02 18:29:24 -0800785};
786
Jeff Johnsone21b0eb2019-02-02 19:31:54 -0800787struct tsm_ie_ind {
Jeff Johnson85ddb772019-02-02 19:01:52 -0800788 struct tsm_ie tsm_ie;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800789 uint8_t sessionId;
Jeff Johnsone21b0eb2019-02-02 19:31:54 -0800790};
791
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800792typedef struct sAniTrafStrmMetrics {
793 uint16_t UplinkPktQueueDly;
794 uint16_t UplinkPktQueueDlyHist[4];
795 uint32_t UplinkPktTxDly;
796 uint16_t UplinkPktLoss;
797 uint16_t UplinkPktCount;
798 uint8_t RoamingCount;
799 uint16_t RoamingDly;
800} tAniTrafStrmMetrics, *tpAniTrafStrmMetrics;
801
802typedef struct sAniGetTsmStatsReq {
803 /* Common for all types are requests */
804 uint16_t msgType; /* message type is same as the request type */
805 uint16_t msgLen; /* length of the entire request */
806 uint8_t staId;
807 uint8_t tid; /* traffic id */
808 struct qdf_mac_addr bssId;
809 void *tsmStatsCallback;
810 void *pDevContext; /* device context */
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800811} tAniGetTsmStatsReq, *tpAniGetTsmStatsReq;
812
813typedef struct sAniGetTsmStatsRsp {
814 /* Common for all types are responses */
815 uint16_t msgType; /*
816 * message type is same as
817 * the request type
818 */
819 uint16_t msgLen; /*
820 * length of the entire request,
821 * includes the pStatsBuf length too
822 */
823 uint8_t sessionId;
824 uint32_t rc; /* success/failure */
825 uint32_t staId; /*
826 * Per STA stats request must
827 * contain valid
828 */
Abhinav Kumaraa8f2df2019-01-11 20:02:26 +0530829 struct qdf_mac_addr bssid; /* bssid to get the tsm stats for */
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800830 tAniTrafStrmMetrics tsmMetrics;
831 void *tsmStatsReq; /* tsm stats request backup */
832} tAniGetTsmStatsRsp, *tpAniGetTsmStatsRsp;
833
Jeff Johnson30d3a5d2019-02-02 21:08:43 -0800834struct ese_bcn_report_bss_info {
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800835 tBcnReportFields bcnReportFields;
836 uint8_t ieLen;
837 uint8_t *pBuf;
Jeff Johnson30d3a5d2019-02-02 21:08:43 -0800838};
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800839
Jeff Johnsondda40752019-02-02 21:43:34 -0800840struct ese_bcn_report_rsp {
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800841 uint16_t measurementToken;
842 uint8_t flag; /* Flag to report measurement done and more data */
843 uint8_t numBss;
Jeff Johnson30d3a5d2019-02-02 21:08:43 -0800844 struct ese_bcn_report_bss_info
845 bcnRepBssInfo[SIR_BCN_REPORT_MAX_BSS_DESC];
Jeff Johnsondda40752019-02-02 21:43:34 -0800846};
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800847
848#define TSRS_11AG_RATE_6MBPS 0xC
849#define TSRS_11B_RATE_5_5MBPS 0xB
Jeff Johnson8a5d0ab2019-02-02 21:54:17 -0800850
851struct ese_tsrs_ie {
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800852 uint8_t tsid;
853 uint8_t rates[8];
Jeff Johnson8a5d0ab2019-02-02 21:54:17 -0800854};
855
Jeff Johnson4f340522019-02-02 22:02:52 -0800856struct ese_tsm_ie {
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800857 uint8_t tsid;
858 uint8_t state;
859 uint16_t msmt_interval;
Jeff Johnson4f340522019-02-02 22:02:52 -0800860};
861
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800862typedef struct sTSMStats {
863 uint8_t tid;
864 struct qdf_mac_addr bssid;
865 tTrafStrmMetrics tsmMetrics;
866} tTSMStats, *tpTSMStats;
867typedef struct sEseTSMContext {
868 uint8_t tid;
Jeff Johnson4f340522019-02-02 22:02:52 -0800869 struct ese_tsm_ie tsmInfo;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800870 tTrafStrmMetrics tsmMetrics;
871} tEseTSMContext, *tpEseTSMContext;
872typedef struct sEsePEContext {
873 tEseTSMContext tsm;
874} tEsePEContext, *tpEsePEContext;
875
Jeff Johnsonb120a822019-02-02 22:15:55 -0800876struct plm_req {
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800877 uint16_t diag_token; /* Dialog token */
878 uint16_t meas_token; /* measurement token */
879 uint16_t numBursts; /* total number of bursts */
880 uint16_t burstInt; /* burst interval in seconds */
881 uint16_t measDuration; /* in TU's,STA goes off-ch */
882 /* no of times the STA should cycle through PLM ch list */
883 uint8_t burstLen;
884 int8_t desiredTxPwr; /* desired tx power */
885 struct qdf_mac_addr mac_addr; /* MC dest addr */
886 /* no of channels */
887 uint8_t plmNumCh;
888 /* channel numbers */
Wu Gao0821b0d2019-01-11 17:31:11 +0800889 uint8_t plmChList[CFG_VALID_CHANNEL_LIST_LEN];
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800890 uint8_t sessionId;
891 bool enable;
Jeff Johnsonb120a822019-02-02 22:15:55 -0800892};
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800893
894#endif /* FEATURE_WLAN_ESE */
895
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800896/* / Definition for join request */
897/* / ---> MAC */
898/* / WARNING! If you add a field in JOIN REQ. */
899/* / Make sure to add it in REASSOC REQ */
900/* / The Serdes function is the same and its */
901/* / shared with REASSOC. So if we add a field */
902/* here and dont add it in REASSOC REQ. It will BREAK!!! REASSOC. */
Jeff Johnson701444f2019-02-02 22:35:13 -0800903struct join_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800904 uint16_t messageType; /* eWNI_SME_JOIN_REQ */
905 uint16_t length;
906 uint8_t sessionId;
907 uint16_t transactionId;
908 tSirMacSSid ssId;
909 tSirMacAddr selfMacAddr; /* self Mac address */
910 tSirBssType bsstype; /* add new type for BT-AMP STA and AP Modules */
911 uint8_t dot11mode; /* to support BT-AMP */
912#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
913 uint8_t cc_switch_mode;
914#endif
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800915 enum QDF_OPMODE staPersona; /* Persona */
Abhishek Singhf78bd2d2016-04-27 16:47:56 +0530916 bool wps_registration;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800917 ePhyChanBondState cbMode; /* Pass CB mode value in Join. */
918
919 /*This contains the UAPSD Flag for all 4 AC
920 * B0: AC_VO UAPSD FLAG
921 * B1: AC_VI UAPSD FLAG
922 * B2: AC_BK UAPSD FLAG
923 * B3: AC_BE UASPD FLAG
924 */
925 uint8_t uapsdPerAcBitmask;
926
927 tSirMacRateSet operationalRateSet; /* Has 11a or 11b rates */
928 tSirMacRateSet extendedRateSet; /* Has 11g rates */
929 tSirRSNie rsnIE; /* RSN IE to be sent in */
930 /* (Re) Association Request */
931#ifdef FEATURE_WLAN_ESE
932 /* CCMK IE to be included as handler for join and reassoc is */
933 tSirCCKMie cckmIE;
934 /* the same. The join will never carry cckm, but will be set to */
935 /* 0. */
936#endif
937
938 tSirAddie addIEScan; /* Additional IE to be sent in */
939 /* (unicast) Probe Request at the time of join */
940
941 tSirAddie addIEAssoc; /* Additional IE to be sent in */
942 /* (Re) Association Request */
943
944 tAniEdType UCEncryptionType;
945
946 tAniEdType MCEncryptionType;
947
948#ifdef WLAN_FEATURE_11W
949 tAniEdType MgmtEncryptionType;
950#endif
951
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700952 bool is11Rconnection;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800953#ifdef FEATURE_WLAN_ESE
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700954 bool isESEFeatureIniEnabled;
955 bool isESEconnection;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800956 tESETspecInfo eseTspecInfo;
957#endif
958
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700959 bool isFastTransitionEnabled;
960 bool isFastRoamIniFeatureEnabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800961
962 uint8_t txLdpcIniFeatureEnabled;
Jeff Johnsonbe119e62019-02-02 12:30:26 -0800963 struct ht_config ht_config;
Sandeep Puligilla98917432016-06-10 13:50:28 -0700964 struct sir_vht_config vht_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800965#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -0700966 tDot11fIEhe_cap he_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800967#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800968 uint8_t enableVhtpAid;
969 uint8_t enableVhtGid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800970 uint8_t enableAmpduPs;
971 uint8_t enableHtSmps;
972 uint8_t htSmps;
Archana Ramachandranfec24812016-02-16 16:31:56 -0800973 bool send_smps_action;
Kiran Kumar Lokere722dccd2018-02-23 13:23:52 -0800974 bool he_with_wep_tkip;
Deepak Dhamdhere612392c2016-08-28 02:56:51 -0700975 uint8_t max_amsdu_num;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700976 bool isWMEenabled;
977 bool isQosEnabled;
978 bool isOSENConnection;
Krishna Kumaar Natarajanf599c6e2015-11-03 11:44:03 -0800979 struct rrm_config_param rrm_config;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700980 bool spectrumMgtIndicator;
Jeff Johnson39f02ae2019-02-01 23:42:38 -0800981 struct power_cap_info powerCap;
Jeff Johnsoned4f4d52019-02-02 00:09:45 -0800982 struct supported_channels supportedChannels;
Selvaraj, Sridhar05ea0792017-05-17 12:17:03 +0530983 bool enable_bcast_probe_rsp;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +0530984#ifdef WLAN_FEATURE_FILS_SK
985 struct cds_fils_connection_info fils_con_info;
986#endif
Padma, Santhosh Kumarb8f65d92017-09-14 13:05:42 +0530987 bool sae_pmk_cached;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +0530988 /* Pls make this as last variable in struct */
Abhishek Singhb59f8d42017-07-31 14:42:47 +0530989 bool force_24ghz_in_ht20;
Abhishek Singh6454ad32017-12-20 10:42:21 +0530990 bool force_rsne_override;
Vignesh Viswanathand5a5f2e2018-06-01 15:35:51 +0530991 bool supported_nss_1x1;
992 uint8_t vdev_nss;
993 uint8_t nss;
994 bool nss_forced_1x1;
Arif Hussain6686c0b2018-08-21 18:21:05 -0700995 bool enable_session_twt_support;
Selvaraj, Sridhar81ab80d2017-06-08 12:21:39 +0530996 tSirBssDescription bssDescription;
997 /*
998 * WARNING: Pls make bssDescription as last variable in struct
Jeff Johnson701444f2019-02-02 22:35:13 -0800999 * join_req as it has ieFields followed after this bss
Selvaraj, Sridhar81ab80d2017-06-08 12:21:39 +05301000 * description. Adding a variable after this corrupts the ieFields
1001 */
Jeff Johnson701444f2019-02-02 22:35:13 -08001002};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001003
Jeff Johnson47d75242018-05-12 15:58:53 -07001004/* / Definition for response message to previously issued join request */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001005/* / MAC ---> */
Jeff Johnson2df04b82019-02-02 23:30:25 -08001006struct join_rsp {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001007 uint16_t messageType; /* eWNI_SME_JOIN_RSP */
1008 uint16_t length;
1009 uint8_t sessionId; /* Session ID */
1010 uint16_t transactionId; /* Transaction ID for cmd */
1011 tSirResultCodes statusCode;
1012 tAniAuthType authType;
1013 uint32_t vht_channel_width;
1014 /* It holds reasonCode when join fails due to deauth/disassoc frame.
1015 * Otherwise it holds status code.
1016 */
1017 uint16_t protStatusCode;
1018 uint16_t aid;
1019 uint32_t beaconLength;
1020 uint32_t assocReqLength;
1021 uint32_t assocRspLength;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001022 uint32_t parsedRicRspLen;
Bala Venkateshe7f79162019-01-16 16:43:59 +05301023 uint8_t uapsd_mask;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001024#ifdef FEATURE_WLAN_ESE
1025 uint32_t tspecIeLen;
1026#endif
1027 uint32_t staId; /* Station ID for peer */
1028
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001029 /*Timing measurement capability */
1030 uint8_t timingMeasCap;
1031
1032#ifdef FEATURE_WLAN_TDLS
1033 /* TDLS prohibited and TDLS channel switch prohibited are set as
1034 * per ExtCap IE in received assoc/re-assoc response from AP
1035 */
1036 bool tdls_prohibited;
1037 bool tdls_chan_swit_prohibited;
1038#endif
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301039 uint8_t nss;
1040 uint32_t max_rate_flags;
1041
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001042#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
Jeff Johnsonf6541882019-02-02 16:16:00 -08001043 struct ht_profile ht_profile;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001044#endif
Archana Ramachandran20d2e232016-02-11 16:58:40 -08001045 bool supported_nss_1x1;
Anurag Chouhan5de8d172016-07-13 14:44:28 +05301046 tDot11fIEHTCaps ht_caps;
1047 tDot11fIEVHTCaps vht_caps;
1048 tDot11fIEHTInfo ht_operation;
1049 tDot11fIEVHTOperation vht_operation;
1050 tDot11fIEhs20vendor_ie hs20vendor_ie;
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301051 bool is_fils_connection;
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301052 uint16_t fils_seq_num;
Vignesh Viswanathan0b0fa272017-09-18 17:12:04 +05301053#ifdef WLAN_FEATURE_FILS_SK
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301054 struct fils_join_rsp_params *fils_join_rsp;
1055#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001056 uint8_t frames[1];
Jeff Johnson2df04b82019-02-02 23:30:25 -08001057};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001058
Jeff Johnsona7d5b542019-02-03 10:15:46 -08001059struct oem_channel_info {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001060 uint8_t chan_id;
1061 uint32_t mhz;
1062 uint32_t band_center_freq1;
1063 uint32_t band_center_freq2;
1064 uint32_t info;
1065 uint32_t reg_info_1;
1066 uint32_t reg_info_2;
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301067 uint8_t nss;
1068 uint32_t rate_flags;
Manishekar Chandrasekaranec267592016-05-26 19:10:04 +05301069 uint8_t sec_ch_offset;
1070 enum phy_ch_width ch_width;
Jeff Johnsona7d5b542019-02-03 10:15:46 -08001071};
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301072
Will Huang558f8082017-05-31 16:22:24 +08001073enum sir_sme_phy_mode {
1074 SIR_SME_PHY_MODE_LEGACY = 0,
1075 SIR_SME_PHY_MODE_HT = 1,
1076 SIR_SME_PHY_MODE_VHT = 2
1077};
1078
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001079/* / Definition for Association indication from peer */
1080/* / MAC ---> */
Jeff Johnson01e8adb2019-02-03 10:55:55 -08001081struct assoc_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001082 uint16_t messageType; /* eWNI_SME_ASSOC_IND */
1083 uint16_t length;
1084 uint8_t sessionId;
1085 tSirMacAddr peerMacAddr;
1086 uint16_t aid;
1087 tSirMacAddr bssId; /* Self BSSID */
1088 uint16_t staId; /* Station ID for peer */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001089 tAniAuthType authType;
1090 tAniSSID ssId; /* SSID used by STA to associate */
1091 tSirWAPIie wapiIE; /* WAPI IE received from peer */
1092 tSirRSNie rsnIE; /* RSN IE received from peer */
1093 /* Additional IE received from peer, which possibly include
1094 * WSC IE and/or P2P IE
1095 */
1096 tSirAddie addIE;
1097
1098 /* powerCap & supportedChannels are present only when */
1099 /* spectrumMgtIndicator flag is set */
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001100 bool spectrumMgtIndicator;
Jeff Johnson39f02ae2019-02-01 23:42:38 -08001101 struct power_cap_info powerCap;
Jeff Johnsoned4f4d52019-02-02 00:09:45 -08001102 struct supported_channels supportedChannels;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001103 bool wmmEnabledSta; /* if present - STA is WMM enabled */
1104 bool reassocReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001105 /* Required for indicating the frames to upper layer */
1106 uint32_t beaconLength;
1107 uint8_t *beaconPtr;
1108 uint32_t assocReqLength;
1109 uint8_t *assocReqPtr;
1110
1111 /* Timing measurement capability */
1112 uint8_t timingMeasCap;
Jeff Johnsona7d5b542019-02-03 10:15:46 -08001113 struct oem_channel_info chan_info;
Will Huang558f8082017-05-31 16:22:24 +08001114 bool ampdu;
1115 bool sgi_enable;
1116 bool tx_stbc;
1117 bool rx_stbc;
1118 tSirMacHTChannelWidth ch_width;
1119 enum sir_sme_phy_mode mode;
1120 uint8_t max_supp_idx;
1121 uint8_t max_ext_idx;
1122 uint8_t max_mcs_idx;
1123 uint8_t rx_mcs_map;
1124 uint8_t tx_mcs_map;
gaolez7bb1e742017-03-21 16:37:38 +08001125 /* Extended CSA capability of station */
1126 uint8_t ecsa_capable;
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +05301127 tDot11fIEHTCaps HTCaps;
1128 tDot11fIEVHTCaps VHTCaps;
Ashish Kumar Dhanotiyac6171062019-01-22 21:55:01 +05301129 tSirMacCapabilityInfo capability_info;
Jeff Johnson01e8adb2019-02-03 10:55:55 -08001130};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001131
1132/* / Definition for Association confirm */
1133/* / ---> MAC */
Jeff Johnsonf86e45b2019-02-03 11:17:14 -08001134struct assoc_cnf {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001135 uint16_t messageType; /* eWNI_SME_ASSOC_CNF */
1136 uint16_t length;
1137 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301138 struct qdf_mac_addr bssid; /* Self BSSID */
1139 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001140 uint16_t aid;
Jeff Johnsonf86e45b2019-02-03 11:17:14 -08001141};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001142
1143/* / Enum definition for Wireless medium status change codes */
1144typedef enum eSirSmeStatusChangeCode {
1145 eSIR_SME_DEAUTH_FROM_PEER,
1146 eSIR_SME_DISASSOC_FROM_PEER,
1147 eSIR_SME_LOST_LINK_WITH_PEER,
1148 eSIR_SME_CHANNEL_SWITCH,
1149 eSIR_SME_JOINED_NEW_BSS,
1150 eSIR_SME_LEAVING_BSS,
1151 eSIR_SME_IBSS_ACTIVE,
1152 eSIR_SME_IBSS_INACTIVE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001153 eSIR_SME_RADAR_DETECTED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001154 eSIR_SME_AP_CAPS_CHANGED,
1155} tSirSmeStatusChangeCode;
1156
Jeff Johnson2e6d1732019-02-03 17:00:30 -08001157struct new_bss_info {
Anurag Chouhan6d760662016-02-20 16:05:43 +05301158 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001159 uint8_t channelNumber;
1160 uint8_t reserved;
1161 tSirMacSSid ssId;
Jeff Johnson2e6d1732019-02-03 17:00:30 -08001162};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001163
Jeff Johnson9c9961c2019-02-03 17:10:53 -08001164struct ap_new_caps {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001165 uint16_t capabilityInfo;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301166 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001167 uint8_t channelId;
1168 uint8_t reserved[3];
1169 tSirMacSSid ssId;
Jeff Johnson9c9961c2019-02-03 17:10:53 -08001170};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001171
1172/**
1173 * Table below indicates what information is passed for each of
1174 * the Wireless Media status change notifications:
1175 *
Jeff Johnson65a20762019-02-02 11:01:50 -08001176 * Status Change code Status change info
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001177 * ----------------------------------------------------------------------
1178 * eSIR_SME_DEAUTH_FROM_PEER Reason code received in DEAUTH frame
1179 * eSIR_SME_DISASSOC_FROM_PEER Reason code received in DISASSOC frame
1180 * eSIR_SME_LOST_LINK_WITH_PEER None
1181 * eSIR_SME_CHANNEL_SWITCH New channel number
1182 * eSIR_SME_JOINED_NEW_BSS BSSID, SSID and channel number
1183 * eSIR_SME_LEAVING_BSS None
1184 * eSIR_SME_IBSS_ACTIVE Indicates that another STA joined
1185 * IBSS apart from this STA that
1186 * started IBSS
1187 * eSIR_SME_IBSS_INACTIVE Indicates that only this STA is left
1188 * in IBSS
1189 * eSIR_SME_RADAR_DETECTED Indicates that radar is detected
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001190 * eSIR_SME_AP_CAPS_CHANGED Indicates that capabilities of the AP
1191 * that STA is currently associated with
1192 * have changed.
1193 */
1194
1195/* / Definition for Wireless medium status change notification */
Jeff Johnson53889322019-02-03 17:37:09 -08001196struct wm_status_change_ntf {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001197 uint16_t messageType; /* eWNI_SME_WM_STATUS_CHANGE_NTF */
1198 uint16_t length;
1199 uint8_t sessionId; /* Session ID */
1200 tSirSmeStatusChangeCode statusChangeCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301201 struct qdf_mac_addr bssid; /* Self BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001202 union {
Jeff Johnson65a20762019-02-02 11:01:50 -08001203 /* eSIR_SME_DEAUTH_FROM_PEER */
1204 uint16_t deAuthReasonCode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001205 /* eSIR_SME_DISASSOC_FROM_PEER */
1206 uint16_t disassocReasonCode;
1207 /* none for eSIR_SME_LOST_LINK_WITH_PEER */
Jeff Johnson65a20762019-02-02 11:01:50 -08001208 /* eSIR_SME_CHANNEL_SWITCH */
1209 uint8_t newChannelId;
1210 /* eSIR_SME_JOINED_NEW_BSS */
Jeff Johnson2e6d1732019-02-03 17:00:30 -08001211 struct new_bss_info newBssInfo;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001212 /* none for eSIR_SME_LEAVING_BSS */
1213 /* none for eSIR_SME_IBSS_ACTIVE */
1214 /* none for eSIR_SME_IBSS_INACTIVE */
Jeff Johnson65a20762019-02-02 11:01:50 -08001215 /* none for eSIR_SME_RADAR_DETECTED */
1216 /* eSIR_SME_AP_CAPS_CHANGED */
Jeff Johnson9c9961c2019-02-03 17:10:53 -08001217 struct ap_new_caps apNewCaps;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001218 } statusChangeInfo;
Jeff Johnson53889322019-02-03 17:37:09 -08001219};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001220
1221/* Definition for Disassociation request */
Jeff Johnsonca523f32019-02-03 18:05:59 -08001222struct disassoc_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001223 uint16_t messageType; /* eWNI_SME_DISASSOC_REQ */
1224 uint16_t length;
1225 uint8_t sessionId; /* Session ID */
1226 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301227 struct qdf_mac_addr bssid; /* Peer BSSID */
1228 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001229 uint16_t reasonCode;
1230 /* This flag tells LIM whether to send the disassoc OTA or not */
1231 /* This will be set in while handing off from one AP to other */
1232 uint8_t doNotSendOverTheAir;
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -07001233 bool process_ho_fail;
Jeff Johnsonca523f32019-02-03 18:05:59 -08001234};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001235
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001236/* / Definition for Disassociation response */
Jeff Johnson380a1cd2019-02-03 21:43:51 -08001237struct disassoc_rsp {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001238 uint16_t messageType; /* eWNI_SME_DISASSOC_RSP */
1239 uint16_t length;
1240 uint8_t sessionId; /* Session ID */
1241 uint16_t transactionId; /* Transaction ID for cmd */
1242 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301243 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001244 uint16_t staId;
Jeff Johnson380a1cd2019-02-03 21:43:51 -08001245};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001246
1247/* / Definition for Disassociation indication from peer */
Jeff Johnson318a9882019-02-04 08:30:50 -08001248struct disassoc_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001249 uint16_t messageType; /* eWNI_SME_DISASSOC_IND */
1250 uint16_t length;
1251 uint8_t sessionId; /* Session Identifier */
1252 uint16_t transactionId; /* Transaction Identifier with PE */
1253 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301254 struct qdf_mac_addr bssid;
1255 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001256 uint16_t staId;
1257 uint32_t reasonCode;
Jeff Johnson318a9882019-02-04 08:30:50 -08001258};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001259
1260/* / Definition for Disassociation confirm */
1261/* / MAC ---> */
Jeff Johnson0837c442019-02-04 11:37:09 -08001262struct disassoc_cnf {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001263 uint16_t messageType; /* eWNI_SME_DISASSOC_CNF */
1264 uint16_t length;
Vignesh Viswanathanb2dcdd02018-05-24 11:48:12 +05301265 uint8_t sme_session_id;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001266 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301267 struct qdf_mac_addr bssid;
1268 struct qdf_mac_addr peer_macaddr;
Jeff Johnson0837c442019-02-04 11:37:09 -08001269};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001270
Hanumantha Reddy Pothula3e5d6aa2016-09-08 15:21:54 +05301271/**
1272 * struct sir_sme_discon_done_ind - disconnect done indiaction
1273 * @message_type: msg type
1274 * @length: length of msg
1275 * @session_id: session id of the indication
1276 * @reason_code: reason for disconnect indication
1277 * @peer_mac: peer mac
1278 */
1279struct sir_sme_discon_done_ind {
1280 uint16_t message_type;
1281 uint16_t length;
1282 uint8_t session_id;
1283 tSirResultCodes reason_code;
1284 tSirMacAddr peer_mac;
1285};
1286
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001287/* / Definition for Deauthetication request */
Jeff Johnson34c74b02019-02-04 12:34:51 -08001288struct deauth_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001289 uint16_t messageType; /* eWNI_SME_DEAUTH_REQ */
1290 uint16_t length;
1291 uint8_t sessionId; /* Session ID */
1292 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301293 struct qdf_mac_addr bssid; /* AP BSSID */
1294 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001295 uint16_t reasonCode;
Jeff Johnson34c74b02019-02-04 12:34:51 -08001296};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001297
1298/* / Definition for Deauthetication response */
Jeff Johnson15ae0c12019-02-04 12:55:07 -08001299struct deauth_rsp {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001300 uint16_t messageType; /* eWNI_SME_DEAUTH_RSP */
1301 uint16_t length;
1302 uint8_t sessionId; /* Session ID */
1303 uint16_t transactionId; /* Transaction ID for cmd */
1304 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301305 struct qdf_mac_addr peer_macaddr;
Jeff Johnson15ae0c12019-02-04 12:55:07 -08001306};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001307
1308/* / Definition for Deauthetication indication from peer */
Jeff Johnsonfec08712019-02-04 13:12:08 -08001309struct deauth_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001310 uint16_t messageType; /* eWNI_SME_DEAUTH_IND */
1311 uint16_t length;
1312 uint8_t sessionId; /* Added for BT-AMP */
1313 uint16_t transactionId; /* Added for BT-AMP */
1314 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301315 struct qdf_mac_addr bssid; /* AP BSSID */
1316 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001317
1318 uint16_t staId;
1319 uint32_t reasonCode;
Kiran Kumar Lokere37d3aa22015-11-03 14:58:26 -08001320 int8_t rssi;
Jeff Johnsonfec08712019-02-04 13:12:08 -08001321};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001322
Jeff Johnson0837c442019-02-04 11:37:09 -08001323/* / Definition for Deauthetication confirm */
1324struct deauth_cnf {
1325 uint16_t messageType; /* eWNI_SME_DEAUTH_CNF */
1326 uint16_t length;
1327 uint8_t sme_session_id;
1328 tSirResultCodes statusCode;
1329 struct qdf_mac_addr bssid;
1330 struct qdf_mac_addr peer_macaddr;
1331};
1332
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001333/* / Definition for stop BSS request message */
Jeff Johnson206721c2019-02-04 17:25:02 -08001334struct stop_bss_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001335 uint16_t messageType; /* eWNI_SME_STOP_BSS_REQ */
1336 uint16_t length;
1337 uint8_t sessionId; /* Session ID */
1338 uint16_t transactionId; /* tranSaction ID for cmd */
1339 tSirResultCodes reasonCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301340 struct qdf_mac_addr bssid; /* Self BSSID */
Jeff Johnson206721c2019-02-04 17:25:02 -08001341};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001342
1343/* / Definition for stop BSS response message */
1344typedef struct sSirSmeStopBssRsp {
1345 uint16_t messageType; /* eWNI_SME_STOP_BSS_RSP */
1346 uint16_t length;
1347 tSirResultCodes statusCode;
1348 uint8_t sessionId; /* Session ID */
1349 uint16_t transactionId; /* Transaction ID for cmd */
1350} tSirSmeStopBssRsp, *tpSirSmeStopBssRsp;
1351
1352/* / Definition for Channel Switch indication for station */
1353/* / MAC ---> */
Jeff Johnson3eb71112019-02-04 17:40:51 -08001354struct switch_channel_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001355 uint16_t messageType; /* eWNI_SME_SWITCH_CHL_IND */
1356 uint16_t length;
1357 uint8_t sessionId;
1358 uint16_t newChannelId;
Amar Singhal5cccafe2017-02-15 12:42:58 -08001359 struct ch_params chan_params;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301360 struct qdf_mac_addr bssid; /* BSSID */
Jianmin Zhu3c50e402018-12-04 18:52:54 +08001361 QDF_STATUS status;
Jeff Johnson3eb71112019-02-04 17:40:51 -08001362};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001363
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001364/* / Definition for MIC failure indication */
1365/* / MAC ---> */
1366/* / MAC reports this each time a MIC failure occures on Rx TKIP packet */
Jeff Johnsonffb93e12019-02-04 19:25:12 -08001367struct mic_failure_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001368 uint16_t messageType; /* eWNI_SME_MIC_FAILURE_IND */
1369 uint16_t length;
1370 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301371 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001372 tSirMicFailureInfo info;
Jeff Johnsonffb93e12019-02-04 19:25:12 -08001373};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001374
Jeff Johnsoncbc85322019-02-04 19:47:17 -08001375struct missed_beacon_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001376 uint16_t messageType; /* eWNI_SME_MISSED_BEACON_IND */
1377 uint16_t length;
1378 uint8_t bssIdx;
Jeff Johnsoncbc85322019-02-04 19:47:17 -08001379};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001380
1381/* / Definition for Set Context request */
1382/* / ---> MAC */
Jeff Johnsonb9a9a7d2019-02-05 11:47:05 -08001383struct set_context_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001384 uint16_t messageType; /* eWNI_SME_SET_CONTEXT_REQ */
1385 uint16_t length;
1386 uint8_t sessionId; /* Session ID */
1387 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301388 struct qdf_mac_addr peer_macaddr;
1389 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001390 tSirKeyMaterial keyMaterial;
Jeff Johnsonb9a9a7d2019-02-05 11:47:05 -08001391};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001392
1393/* / Definition for Set Context response */
1394/* / MAC ---> */
Jeff Johnson924ae612019-02-05 12:01:50 -08001395struct set_context_rsp {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001396 uint16_t messageType; /* eWNI_SME_SET_CONTEXT_RSP */
1397 uint16_t length;
1398 uint8_t sessionId; /* Session ID */
1399 uint16_t transactionId; /* Transaction ID for cmd */
1400 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301401 struct qdf_mac_addr peer_macaddr;
Jeff Johnson924ae612019-02-05 12:01:50 -08001402};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001403
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001404/*******************PE Statistics*************************/
1405
1406/*
1407 * tpAniGetPEStatsReq is tied to
1408 * for SME ==> PE eWNI_SME_GET_STATISTICS_REQ msgId and
1409 * for PE ==> HAL SIR_HAL_GET_STATISTICS_REQ msgId
1410 */
1411typedef struct sAniGetPEStatsReq {
1412 /* Common for all types are requests */
1413 uint16_t msgType; /* message type is same as the request type */
1414 uint16_t msgLen; /* length of the entire request */
1415 uint32_t staId; /* Per STA stats request must contain valid */
1416 /* categories of stats requested. look at ePEStatsMask */
1417 uint32_t statsMask;
1418 uint8_t sessionId;
1419} tAniGetPEStatsReq, *tpAniGetPEStatsReq;
1420
1421/*
1422 * tpAniGetPEStatsRsp is tied to
1423 * for PE ==> SME eWNI_SME_GET_STATISTICS_RSP msgId and
1424 * for HAL ==> PE SIR_HAL_GET_STATISTICS_RSP msgId
1425 */
1426typedef struct sAniGetPEStatsRsp {
1427 /* Common for all types are responses */
1428 uint16_t msgType; /* message type is same as the request type */
1429 /* length of the entire request, includes the pStatsBuf length too */
1430 uint16_t msgLen;
1431 uint8_t sessionId;
1432 uint32_t rc; /* success/failure */
1433 uint32_t staId; /* Per STA stats request must contain valid */
1434 /* categories of stats requested. look at ePEStatsMask */
1435 uint32_t statsMask;
1436 /* void *pStatsBuf; */
1437 /*
1438 * The Stats buffer starts here and can be an aggregate of more than one
1439 * statistics structure depending on statsMask. The void pointer
1440 * "pStatsBuf" is commented out intentionally and the src code that uses
1441 * this structure should take that into account.
1442 */
1443} tAniGetPEStatsRsp, *tpAniGetPEStatsRsp;
1444
1445typedef struct sAniGetRssiReq {
1446 /* Common for all types are requests */
1447 uint16_t msgType; /* message type is same as the request type */
1448 uint16_t msgLen; /* length of the entire request */
1449 uint8_t sessionId;
1450 uint8_t staId;
1451 int8_t lastRSSI; /* in case of error, return last RSSI */
1452 void *rssiCallback;
1453 void *pDevContext; /* device context */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001454} tAniGetRssiReq, *tpAniGetRssiReq;
1455
1456typedef struct sAniGetSnrReq {
1457 /* Common for all types are requests */
1458 uint16_t msgType; /* message type is same as the request type */
1459 uint16_t msgLen; /* length of the entire request */
1460 uint8_t sessionId;
1461 uint8_t staId;
1462 void *snrCallback;
1463 void *pDevContext; /* device context */
1464 int8_t snr;
1465} tAniGetSnrReq, *tpAniGetSnrReq;
1466
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001467/* generic country code change request MSG structure */
1468typedef struct sAniGenericChangeCountryCodeReq {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001469 uint16_t msgType; /* message type is same as the request type */
1470 uint16_t msgLen; /* length of the entire request */
Wu Gaoaa155142019-01-14 15:09:26 +08001471 uint8_t countryCode[CFG_COUNTRY_CODE_LEN]; /* 3 char country code */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001472} tAniGenericChangeCountryCodeReq, *tpAniGenericChangeCountryCodeReq;
1473
Srinivas Girigowda296105a2015-09-24 16:31:16 -07001474/**
1475 * struct sAniDHCPStopInd - DHCP Stop indication message
1476 * @msgType: message type is same as the request type
1477 * @msgLen: length of the entire request
1478 * @device_mode: Mode of the device(ex:STA, AP)
1479 * @adapterMacAddr: MAC address of the adapter
1480 * @peerMacAddr: MAC address of the connected peer
1481 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001482typedef struct sAniDHCPStopInd {
Srinivas Girigowda296105a2015-09-24 16:31:16 -07001483 uint16_t msgType;
1484 uint16_t msgLen;
1485 uint8_t device_mode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301486 struct qdf_mac_addr adapterMacAddr;
1487 struct qdf_mac_addr peerMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001488} tAniDHCPInd, *tpAniDHCPInd;
1489
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001490typedef struct sAniTXFailMonitorInd {
1491 uint16_t msgType; /* message type is same as the request type */
1492 uint16_t msgLen; /* length of the entire request */
1493 uint8_t tx_fail_count;
1494 void *txFailIndCallback;
1495} tAniTXFailMonitorInd, *tpAniTXFailMonitorInd;
1496
Naveen Rawatea1564b2018-05-17 15:56:11 -07001497#ifndef QCA_SUPPORT_CP_STATS
1498/**
1499 * enum tx_rate_info - tx_rate flags
1500 * @TX_RATE_LEGACY: Legacy rates
1501 * @TX_RATE_HT20: HT20 rates
1502 * @TX_RATE_HT40: HT40 rates
1503 * @TX_RATE_SGI: Rate with Short guard interval
1504 * @TX_RATE_LGI: Rate with Long guard interval
1505 * @TX_RATE_VHT20: VHT 20 rates
1506 * @TX_RATE_VHT40: VHT 40 rates
1507 * @TX_RATE_VHT80: VHT 80 rates
1508 */
1509enum tx_rate_info {
1510 TX_RATE_LEGACY = 0x1,
1511 TX_RATE_HT20 = 0x2,
1512 TX_RATE_HT40 = 0x4,
1513 TX_RATE_SGI = 0x8,
1514 TX_RATE_LGI = 0x10,
1515 TX_RATE_VHT20 = 0x20,
1516 TX_RATE_VHT40 = 0x40,
1517 TX_RATE_VHT80 = 0x80
1518};
1519#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001520/**********************PE Statistics end*************************/
1521
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001522typedef struct sSirP2PNoaAttr {
1523#ifdef ANI_BIG_BYTE_ENDIAN
1524 uint32_t index:8;
1525 uint32_t oppPsFlag:1;
1526 uint32_t ctWin:7;
1527 uint32_t rsvd1:16;
1528#else
1529 uint32_t rsvd1:16;
1530 uint32_t ctWin:7;
1531 uint32_t oppPsFlag:1;
1532 uint32_t index:8;
1533#endif
1534
1535#ifdef ANI_BIG_BYTE_ENDIAN
1536 uint32_t uNoa1IntervalCnt:8;
1537 uint32_t rsvd2:24;
1538#else
1539 uint32_t rsvd2:24;
1540 uint32_t uNoa1IntervalCnt:8;
1541#endif
1542 uint32_t uNoa1Duration;
1543 uint32_t uNoa1Interval;
1544 uint32_t uNoa1StartTime;
1545
1546#ifdef ANI_BIG_BYTE_ENDIAN
1547 uint32_t uNoa2IntervalCnt:8;
1548 uint32_t rsvd3:24;
1549#else
1550 uint32_t rsvd3:24;
1551 uint32_t uNoa2IntervalCnt:8;
1552#endif
1553 uint32_t uNoa2Duration;
1554 uint32_t uNoa2Interval;
1555 uint32_t uNoa2StartTime;
1556} tSirP2PNoaAttr, *tpSirP2PNoaAttr;
1557
1558typedef struct sSirTclasInfo {
1559 tSirMacTclasIE tclas;
1560 uint8_t version; /* applies only for classifier type ip */
1561 union {
1562 tSirMacTclasParamEthernet eth;
1563 tSirMacTclasParamIPv4 ipv4;
1564 tSirMacTclasParamIPv6 ipv6;
1565 tSirMacTclasParam8021dq t8021dq;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301566 } qdf_packed tclasParams;
1567} qdf_packed tSirTclasInfo;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001568
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001569typedef struct sSirAddtsReqInfo {
1570 uint8_t dialogToken;
Jeff Johnson56471b92018-12-22 14:36:06 -08001571 struct mac_tspec_ie tspec;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001572
1573 uint8_t numTclas; /* number of Tclas elements */
1574 tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM];
1575 uint8_t tclasProc;
1576#if defined(FEATURE_WLAN_ESE)
Jeff Johnson8a5d0ab2019-02-02 21:54:17 -08001577 struct ese_tsrs_ie tsrsIE;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001578 uint8_t tsrsPresent:1;
1579#endif
1580 uint8_t wmeTspecPresent:1;
1581 uint8_t wsmTspecPresent:1;
1582 uint8_t lleTspecPresent:1;
1583 uint8_t tclasProcPresent:1;
1584} tSirAddtsReqInfo, *tpSirAddtsReqInfo;
1585
1586typedef struct sSirAddtsRspInfo {
1587 uint8_t dialogToken;
1588 tSirMacStatusCodes status;
1589 tSirMacTsDelayIE delay;
1590
Jeff Johnson56471b92018-12-22 14:36:06 -08001591 struct mac_tspec_ie tspec;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001592 uint8_t numTclas; /* number of Tclas elements */
1593 tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM];
1594 uint8_t tclasProc;
1595 tSirMacScheduleIE schedule;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001596#ifdef FEATURE_WLAN_ESE
Jeff Johnson4f340522019-02-02 22:02:52 -08001597 struct ese_tsm_ie tsmIE;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001598 uint8_t tsmPresent:1;
1599#endif
1600 uint8_t wmeTspecPresent:1;
1601 uint8_t wsmTspecPresent:1;
1602 uint8_t lleTspecPresent:1;
1603 uint8_t tclasProcPresent:1;
1604 uint8_t schedulePresent:1;
1605} tSirAddtsRspInfo, *tpSirAddtsRspInfo;
1606
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001607/* / Add a tspec as defined */
1608typedef struct sSirAddtsReq {
1609 uint16_t messageType; /* eWNI_SME_ADDTS_REQ */
1610 uint16_t length;
1611 uint8_t sessionId; /* Session ID */
1612 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301613 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001614 uint32_t timeout; /* in ms */
1615 uint8_t rspReqd;
1616 tSirAddtsReqInfo req;
1617} tSirAddtsReq, *tpSirAddtsReq;
1618
1619typedef struct sSirAddtsRsp {
1620 uint16_t messageType; /* eWNI_SME_ADDTS_RSP */
1621 uint16_t length;
1622 uint8_t sessionId; /* sme sessionId Added for BT-AMP support */
1623 uint16_t transactionId; /* sme transaction Id - for BT-AMP Support */
1624 uint32_t rc; /* return code */
1625 tSirAddtsRspInfo rsp;
1626} tSirAddtsRsp, *tpSirAddtsRsp;
1627
1628typedef struct sSirDeltsReq {
1629 uint16_t messageType; /* eWNI_SME_DELTS_REQ */
1630 uint16_t length;
1631 uint8_t sessionId; /* Session ID */
1632 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301633 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001634 uint16_t aid; /* use 0 if macAddr is being specified */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301635 struct qdf_mac_addr macaddr; /* only on AP to specify the STA */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001636 uint8_t rspReqd;
Jeff Johnsoncf2ec162018-12-22 16:46:43 -08001637 struct delts_req_info req;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001638} tSirDeltsReq, *tpSirDeltsReq;
1639
1640typedef struct sSirDeltsRsp {
1641 uint16_t messageType; /* eWNI_SME_DELTS_RSP */
1642 uint16_t length;
1643 uint8_t sessionId; /* sme sessionId Added for BT-AMP support */
1644 uint16_t transactionId; /* sme transaction Id - for BT-AMP Support */
1645 uint32_t rc;
1646 uint16_t aid; /* use 0 if macAddr is being specified */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301647 struct qdf_mac_addr macaddr; /* only on AP to specify the STA */
Jeff Johnsoncf2ec162018-12-22 16:46:43 -08001648 struct delts_req_info rsp;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001649} tSirDeltsRsp, *tpSirDeltsRsp;
1650
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001651#define SIR_QOS_NUM_AC_MAX 4
1652
1653typedef struct sSirAggrQosReqInfo {
1654 uint16_t tspecIdx;
1655 tSirAddtsReqInfo aggrAddTsInfo[SIR_QOS_NUM_AC_MAX];
1656} tSirAggrQosReqInfo, *tpSirAggrQosReqInfo;
1657
1658typedef struct sSirAggrQosReq {
1659 uint16_t messageType; /* eWNI_SME_ADDTS_REQ */
1660 uint16_t length;
1661 uint8_t sessionId; /* Session ID */
1662 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301663 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001664 uint32_t timeout; /* in ms */
1665 uint8_t rspReqd;
1666 tSirAggrQosReqInfo aggrInfo;
1667} tSirAggrQosReq, *tpSirAggrQosReq;
1668
1669typedef struct sSirAggrQosRspInfo {
1670 uint16_t tspecIdx;
1671 tSirAddtsRspInfo aggrRsp[SIR_QOS_NUM_AC_MAX];
1672} tSirAggrQosRspInfo, *tpSirAggrQosRspInfo;
1673
1674typedef struct sSirAggrQosRsp {
1675 uint16_t messageType;
1676 uint16_t length;
1677 uint8_t sessionId;
1678 tSirAggrQosRspInfo aggrInfo;
1679} tSirAggrQosRsp, *tpSirAggrQosRsp;
1680
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001681
Jeff Johnson7fb55e52019-02-06 11:28:12 -08001682struct qos_map_set {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001683 uint8_t present;
1684 uint8_t num_dscp_exceptions;
1685 uint8_t dscp_exceptions[21][2];
1686 uint8_t dscp_range[8][2];
Jeff Johnson7fb55e52019-02-06 11:28:12 -08001687};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001688
1689typedef struct sSmeIbssPeerInd {
1690 uint16_t mesgType;
1691 uint16_t mesgLen;
1692 uint8_t sessionId;
1693
Anurag Chouhan6d760662016-02-20 16:05:43 +05301694 struct qdf_mac_addr peer_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001695 uint16_t staId;
1696
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001697 /* Beacon will be appended for new Peer indication. */
1698} tSmeIbssPeerInd, *tpSmeIbssPeerInd;
1699
Jeff Johnson834dcdd2019-02-06 12:04:41 -08001700struct ibss_peer_inactivity_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001701 uint8_t bssIdx;
1702 uint8_t staIdx;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301703 struct qdf_mac_addr peer_addr;
Jeff Johnson834dcdd2019-02-06 12:04:41 -08001704};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001705
gaoleze5108942017-03-31 16:56:42 +08001706/**
1707 * struct lim_channel_status
1708 * @channelfreq: Channel freq
1709 * @noise_floor: Noise Floor value
1710 * @rx_clear_count: rx clear count
1711 * @cycle_count: cycle count
1712 * @chan_tx_pwr_range: channel tx power per range in 0.5dBm steps
1713 * @chan_tx_pwr_throughput: channel tx power per throughput
1714 * @rx_frame_count: rx frame count (cumulative)
1715 * @bss_rx_cycle_count: BSS rx cycle count
1716 * @rx_11b_mode_data_duration: b-mode data rx time (units are microseconds)
1717 * @tx_frame_count: BSS tx cycle count
1718 * @mac_clk_mhz: sample frequency
1719 * @channel_id: channel index
1720 * @cmd_flags: indicate which stat event is this status coming from
1721 */
1722struct lim_channel_status {
1723 uint32_t channelfreq;
1724 uint32_t noise_floor;
1725 uint32_t rx_clear_count;
1726 uint32_t cycle_count;
1727 uint32_t chan_tx_pwr_range;
1728 uint32_t chan_tx_pwr_throughput;
1729 uint32_t rx_frame_count;
1730 uint32_t bss_rx_cycle_count;
1731 uint32_t rx_11b_mode_data_duration;
1732 uint32_t tx_frame_count;
1733 uint32_t mac_clk_mhz;
1734 uint32_t channel_id;
1735 uint32_t cmd_flags;
1736};
1737
1738/**
1739 * struct lim_scan_channel_status
1740 * @total_channel: total number of be scanned channel
1741 * @channel_status_list: channel status info store in this array
1742 */
1743struct lim_scan_channel_status {
1744 uint8_t total_channel;
1745 struct lim_channel_status
1746 channel_status_list[SIR_MAX_SUPPORTED_CHANNEL_LIST];
1747};
1748
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001749typedef struct sSmeMaxAssocInd {
1750 uint16_t mesgType; /* eWNI_SME_MAX_ASSOC_EXCEEDED */
1751 uint16_t mesgLen;
1752 uint8_t sessionId;
1753 /* the new peer that got rejected max assoc limit reached */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301754 struct qdf_mac_addr peer_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001755} tSmeMaxAssocInd, *tpSmeMaxAssocInd;
1756
1757typedef struct sSmeCsaOffloadInd {
1758 uint16_t mesgType; /* eWNI_SME_CSA_OFFLOAD_EVENT */
1759 uint16_t mesgLen;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301760 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001761} tSmeCsaOffloadInd, *tpSmeCsaOffloadInd;
1762
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001763#define SIR_MAX_NAME_SIZE 64
1764#define SIR_MAX_TEXT_SIZE 32
1765
1766typedef struct sSirName {
1767 uint8_t num_name;
1768 uint8_t name[SIR_MAX_NAME_SIZE];
1769} tSirName;
1770
1771typedef struct sSirText {
1772 uint8_t num_text;
1773 uint8_t text[SIR_MAX_TEXT_SIZE];
1774} tSirText;
1775
1776#define SIR_WPS_PROBRSP_VER_PRESENT 0x00000001
1777#define SIR_WPS_PROBRSP_STATE_PRESENT 0x00000002
1778#define SIR_WPS_PROBRSP_APSETUPLOCK_PRESENT 0x00000004
1779#define SIR_WPS_PROBRSP_SELECTEDREGISTRA_PRESENT 0x00000008
1780#define SIR_WPS_PROBRSP_DEVICEPASSWORDID_PRESENT 0x00000010
1781#define SIR_WPS_PROBRSP_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020
1782#define SIR_WPS_PROBRSP_RESPONSETYPE_PRESENT 0x00000040
1783#define SIR_WPS_PROBRSP_UUIDE_PRESENT 0x00000080
1784#define SIR_WPS_PROBRSP_MANUFACTURE_PRESENT 0x00000100
1785#define SIR_WPS_PROBRSP_MODELNAME_PRESENT 0x00000200
1786#define SIR_WPS_PROBRSP_MODELNUMBER_PRESENT 0x00000400
1787#define SIR_WPS_PROBRSP_SERIALNUMBER_PRESENT 0x00000800
1788#define SIR_WPS_PROBRSP_PRIMARYDEVICETYPE_PRESENT 0x00001000
1789#define SIR_WPS_PROBRSP_DEVICENAME_PRESENT 0x00002000
1790#define SIR_WPS_PROBRSP_CONFIGMETHODS_PRESENT 0x00004000
1791#define SIR_WPS_PROBRSP_RF_BANDS_PRESENT 0x00008000
1792
1793typedef struct sSirWPSProbeRspIE {
1794 uint32_t FieldPresent;
1795 uint32_t Version; /* Version. 0x10 = version 1.0, 0x11 = etc. */
1796 uint32_t wpsState; /* 1 = unconfigured, 2 = configured. */
1797 bool APSetupLocked; /* Must be included if value is true */
1798 /*
1799 * BOOL: indicates if the user has recently activated a Registrar to
1800 * add an Enrollee.
1801 */
1802 bool SelectedRegistra;
1803 uint16_t DevicePasswordID; /* Device Password ID */
1804 /* Selected Registrar config method */
1805 uint16_t SelectedRegistraCfgMethod;
1806 uint8_t ResponseType; /* Response type */
1807 uint8_t UUID_E[16]; /* Unique identifier of the AP. */
1808 tSirName Manufacture;
1809 tSirText ModelName;
1810 tSirText ModelNumber;
1811 tSirText SerialNumber;
1812 /* Device Category ID: 1Computer, 2Input Device, ... */
1813 uint32_t PrimaryDeviceCategory;
1814 /* Vendor specific OUI for Device Sub Category */
1815 uint8_t PrimaryDeviceOUI[4];
1816 /*
1817 Device Sub Category ID: 1-PC, 2-Server if Device Category ID
1818 * is computer
1819 */
1820 uint32_t DeviceSubCategory;
1821 tSirText DeviceName;
1822 uint16_t ConfigMethod; /* Configuaration method */
1823 uint8_t RFBand; /* RF bands available on the AP */
1824} tSirWPSProbeRspIE;
1825
1826#define SIR_WPS_BEACON_VER_PRESENT 0x00000001
1827#define SIR_WPS_BEACON_STATE_PRESENT 0x00000002
1828#define SIR_WPS_BEACON_APSETUPLOCK_PRESENT 0x00000004
1829#define SIR_WPS_BEACON_SELECTEDREGISTRA_PRESENT 0x00000008
1830#define SIR_WPS_BEACON_DEVICEPASSWORDID_PRESENT 0x00000010
1831#define SIR_WPS_BEACON_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020
1832#define SIR_WPS_BEACON_UUIDE_PRESENT 0x00000080
1833#define SIR_WPS_BEACON_RF_BANDS_PRESENT 0x00000100
1834#define SIR_WPS_UUID_LEN 16
1835
1836typedef struct sSirWPSBeaconIE {
1837 uint32_t FieldPresent;
1838 uint32_t Version; /* Version. 0x10 = version 1.0, 0x11 = etc. */
1839 uint32_t wpsState; /* 1 = unconfigured, 2 = configured. */
1840 bool APSetupLocked; /* Must be included if value is true */
1841 /*
1842 * BOOL: indicates if the user has recently activated a Registrar to
1843 * add an Enrollee.
1844 */
1845 bool SelectedRegistra;
1846 uint16_t DevicePasswordID; /* Device Password ID */
1847 /* Selected Registrar config method */
1848 uint16_t SelectedRegistraCfgMethod;
1849 uint8_t UUID_E[SIR_WPS_UUID_LEN]; /* Unique identifier of the AP. */
1850 uint8_t RFBand; /* RF bands available on the AP */
1851} tSirWPSBeaconIE;
1852
1853#define SIR_WPS_ASSOCRSP_VER_PRESENT 0x00000001
1854#define SIR_WPS_ASSOCRSP_RESPONSETYPE_PRESENT 0x00000002
1855
1856typedef struct sSirWPSAssocRspIE {
1857 uint32_t FieldPresent;
1858 uint32_t Version;
1859 uint8_t ResposeType;
1860} tSirWPSAssocRspIE;
1861
1862typedef struct sSirAPWPSIEs {
1863 tSirWPSProbeRspIE SirWPSProbeRspIE; /*WPS Set Probe Respose IE */
1864 tSirWPSBeaconIE SirWPSBeaconIE; /*WPS Set Beacon IE */
1865 tSirWPSAssocRspIE SirWPSAssocRspIE; /*WPS Set Assoc Response IE */
1866} tSirAPWPSIEs, *tpSiriAPWPSIEs;
1867
Naveen Rawat8029a402017-06-01 10:54:19 -07001868struct update_config {
1869 uint16_t messageType; /* eWNI_SME_UPDATE_CONFIG */
1870 uint16_t length;
1871 uint8_t sme_session_id;
1872 uint16_t capab;
1873 uint32_t value;
1874};
1875
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05301876/*
1877 * enum sir_update_session_param_type - session param type
1878 * @SIR_PARAM_SSID_HIDDEN: ssidHidden parameter
Selvaraj, Sridharac4fcf32016-09-28 12:57:32 +05301879 * @SIR_PARAM_IGNORE_ASSOC_DISALLOWED: ignore_assoc_disallowed parameter
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05301880 */
1881enum sir_update_session_param_type {
1882 SIR_PARAM_SSID_HIDDEN,
Selvaraj, Sridharac4fcf32016-09-28 12:57:32 +05301883 SIR_PARAM_IGNORE_ASSOC_DISALLOWED,
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05301884};
1885
1886/*
1887 * struct sir_update_session_param
1888 * @message_type: SME message type
1889 * @length: size of struct sir_update_session_param
1890 * @session_id: Session ID
1891 * @param_type: parameter to be updated
1892 * @param_val: Parameter value to update
1893 */
1894struct sir_update_session_param {
1895 uint16_t message_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001896 uint16_t length;
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05301897 uint8_t session_id;
1898 uint32_t param_type;
1899 uint32_t param_val;
1900};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001901
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07001902/**
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -07001903 * struct sir_set_he_bss_color
1904 * @message_type: SME message type
1905 * @length: size of struct sir_set_he_bss_color
1906 * @session_id: Session ID
1907 * @bss_color: bss color value
1908 */
1909struct sir_set_he_bss_color {
1910 uint16_t message_type;
1911 uint16_t length;
1912 uint8_t session_id;
1913 uint8_t bss_color;
1914};
1915
1916/**
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07001917 * struct sir_create_session - Used for creating session in monitor mode
1918 * @type: SME host message type.
1919 * @msg_len: Length of the message.
1920 * @bss_id: bss_id for creating the session.
1921 */
1922struct sir_create_session {
1923 uint16_t type;
1924 uint16_t msg_len;
Rajeev Kumar Sirasanagandlae3b59912018-08-24 15:53:31 +05301925 uint8_t vdev_id;
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07001926 struct qdf_mac_addr bss_id;
1927};
1928
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001929/* Beacon Interval */
Jeff Johnson2482c792019-02-06 14:24:07 -08001930struct change_bi_params {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001931 uint16_t messageType;
1932 uint16_t length;
1933 uint16_t beaconInterval; /* Beacon Interval */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301934 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001935 uint8_t sessionId; /* Session ID */
Jeff Johnson2482c792019-02-06 14:24:07 -08001936};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001937
1938#ifdef QCA_HT_2040_COEX
Jeff Johnsonb2c72c02019-02-06 21:32:23 -08001939struct set_ht2040_mode {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001940 uint16_t messageType;
1941 uint16_t length;
1942 uint8_t cbMode;
1943 bool obssEnabled;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301944 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001945 uint8_t sessionId; /* Session ID */
Jeff Johnsonb2c72c02019-02-06 21:32:23 -08001946};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001947#endif
1948
1949#define SIR_WPS_PBC_WALK_TIME 120 /* 120 Second */
1950
1951typedef struct sSirWPSPBCSession {
1952 struct sSirWPSPBCSession *next;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301953 struct qdf_mac_addr addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001954 uint8_t uuid_e[SIR_WPS_UUID_LEN];
1955 uint32_t timestamp;
1956} tSirWPSPBCSession;
1957
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001958typedef struct sSirWPSPBCProbeReq {
Anurag Chouhan6d760662016-02-20 16:05:43 +05301959 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001960 uint16_t probeReqIELen;
1961 uint8_t probeReqIE[512];
1962} tSirWPSPBCProbeReq, *tpSirWPSPBCProbeReq;
1963
1964/* probereq from peer, when wsc is enabled */
1965typedef struct sSirSmeProbeReqInd {
1966 uint16_t messageType; /* eWNI_SME_WPS_PBC_PROBE_REQ_IND */
1967 uint16_t length;
1968 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301969 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001970 tSirWPSPBCProbeReq WPSPBCProbeReq;
1971} tSirSmeProbeReqInd, *tpSirSmeProbeReqInd;
1972
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001973#define SIR_ROAM_MAX_CHANNELS 80
1974#define SIR_ROAM_SCAN_MAX_PB_REQ_SIZE 450
1975/* Occupied channel list remains static */
1976#define CHANNEL_LIST_STATIC 1
Himanshu Agarwalb23aa572018-06-14 17:04:44 +05301977/* Occupied channel list can be dynamic */
1978#define CHANNEL_LIST_DYNAMIC 2
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001979#define SIR_ROAM_SCAN_24G_DEFAULT_CH 1
1980#define SIR_ROAM_SCAN_5G_DEFAULT_CH 36
1981#define SIR_ROAM_SCAN_RESERVED_BYTES 61
1982
1983#ifdef WLAN_FEATURE_ROAM_OFFLOAD
hangtianb95e63b2018-11-28 12:10:00 +08001984#define SIR_ROAM_SCAN_PSK_SIZE 48
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001985#define SIR_ROAM_R0KH_ID_MAX_LEN 48
1986#endif
1987/* SME -> HAL - This is the host offload request. */
1988#define SIR_IPV4_ARP_REPLY_OFFLOAD 0
1989#define SIR_IPV6_NEIGHBOR_DISCOVERY_OFFLOAD 1
1990#define SIR_IPV6_NS_OFFLOAD 2
1991#define SIR_OFFLOAD_DISABLE 0
1992#define SIR_OFFLOAD_ENABLE 1
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001993
Jeff Johnsond6fda812019-02-06 21:54:23 -08001994struct sir_host_offload_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001995 uint8_t offloadType;
1996 uint8_t enableOrDisable;
1997 uint32_t num_ns_offload_count;
1998 union {
Srinivas Girigowdac79a7102015-12-08 15:18:26 -08001999 uint8_t hostIpv4Addr[SIR_IPV4_ADDR_LEN];
2000 uint8_t hostIpv6Addr[SIR_MAC_IPV6_ADDR_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002001 } params;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302002 struct qdf_mac_addr bssid;
Jeff Johnsond6fda812019-02-06 21:54:23 -08002003};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002004
2005/* Packet Types. */
2006#define SIR_KEEP_ALIVE_NULL_PKT 1
2007#define SIR_KEEP_ALIVE_UNSOLICIT_ARP_RSP 2
2008
2009/* Keep Alive request. */
Jeff Johnson562ccad2019-02-06 22:10:24 -08002010struct keep_alive_req {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002011 uint8_t packetType;
2012 uint32_t timePeriod;
2013 tSirIpv4Addr hostIpv4Addr;
2014 tSirIpv4Addr destIpv4Addr;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302015 struct qdf_mac_addr dest_macaddr;
2016 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002017 uint8_t sessionId;
Jeff Johnson562ccad2019-02-06 22:10:24 -08002018};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002019
2020typedef struct sSirSmeMgmtFrameInd {
Abhishek Singh7996eb72015-12-30 17:24:02 +05302021 uint16_t frame_len;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002022 uint32_t rxChan;
2023 uint8_t sessionId;
2024 uint8_t frameType;
2025 int8_t rxRssi;
2026 uint8_t frameBuf[1]; /* variable */
2027} tSirSmeMgmtFrameInd, *tpSirSmeMgmtFrameInd;
2028
Abhishek Singh7996eb72015-12-30 17:24:02 +05302029typedef void (*sir_mgmt_frame_ind_callback)(tSirSmeMgmtFrameInd *frame_ind);
2030/**
2031 * struct sir_sme_mgmt_frame_cb_req - Register a
2032 * management frame callback req
2033 *
2034 * @message_type: message id
2035 * @length: msg length
2036 * @callback: callback for management frame indication
2037 */
2038struct sir_sme_mgmt_frame_cb_req {
2039 uint16_t message_type;
2040 uint16_t length;
2041 sir_mgmt_frame_ind_callback callback;
2042};
2043
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002044#ifdef WLAN_FEATURE_11W
2045typedef struct sSirSmeUnprotMgmtFrameInd {
2046 uint8_t sessionId;
2047 uint8_t frameType;
2048 uint8_t frameLen;
2049 uint8_t frameBuf[1]; /* variable */
2050} tSirSmeUnprotMgmtFrameInd, *tpSirSmeUnprotMgmtFrameInd;
2051#endif
2052
2053#define SIR_IS_FULL_POWER_REASON_DISCONNECTED(eReason) \
2054 ((eSME_LINK_DISCONNECTED_BY_HDD == (eReason)) || \
2055 (eSME_LINK_DISCONNECTED_BY_OTHER == (eReason)))
2056#define SIR_IS_FULL_POWER_NEEDED_BY_HDD(eReason) \
2057 ((eSME_LINK_DISCONNECTED_BY_HDD == (eReason)) || \
2058 (eSME_FULL_PWR_NEEDED_BY_HDD == (eReason)))
2059
2060/* P2P Power Save Related */
2061typedef struct sSirNoAParam {
2062 uint8_t ctWindow:7;
2063 uint8_t OppPS:1;
2064 uint8_t count;
2065 uint32_t duration;
2066 uint32_t interval;
2067 uint32_t singleNoADuration;
2068 uint8_t psSelection;
2069} tSirNoAParam, *tpSirNoAParam;
2070
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002071#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
2072
2073typedef enum ext_wow_type {
2074 EXT_WOW_TYPE_APP_TYPE1, /* wow type: only enable wakeup for app type1 */
2075 EXT_WOW_TYPE_APP_TYPE2, /* wow type: only enable wakeup for app type2 */
2076 EXT_WOW_TYPE_APP_TYPE1_2, /* wow type: enable wakeup for app type1&2 */
2077} EXT_WOW_TYPE;
2078
2079typedef struct {
2080 uint8_t vdev_id;
2081 EXT_WOW_TYPE type;
2082 uint32_t wakeup_pin_num;
2083} tSirExtWoWParams, *tpSirExtWoWParams;
2084
2085typedef struct {
2086 uint8_t vdev_id;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302087 struct qdf_mac_addr wakee_mac_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002088 uint8_t identification_id[8];
2089 uint8_t password[16];
2090 uint32_t id_length;
2091 uint32_t pass_length;
2092} tSirAppType1Params, *tpSirAppType1Params;
2093
2094typedef struct {
2095 uint8_t vdev_id;
2096
2097 uint8_t rc4_key[16];
2098 uint32_t rc4_key_len;
2099
2100 /** ip header parameter */
2101 uint32_t ip_id; /* NC id */
2102 uint32_t ip_device_ip; /* NC IP address */
2103 uint32_t ip_server_ip; /* Push server IP address */
2104
2105 /** tcp header parameter */
2106 uint16_t tcp_src_port; /* NC TCP port */
2107 uint16_t tcp_dst_port; /* Push server TCP port */
2108 uint32_t tcp_seq;
2109 uint32_t tcp_ack_seq;
2110
2111 uint32_t keepalive_init; /* Initial ping interval */
2112 uint32_t keepalive_min; /* Minimum ping interval */
2113 uint32_t keepalive_max; /* Maximum ping interval */
2114 uint32_t keepalive_inc; /* Increment of ping interval */
2115
Anurag Chouhan6d760662016-02-20 16:05:43 +05302116 struct qdf_mac_addr gateway_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002117 uint32_t tcp_tx_timeout_val;
2118 uint32_t tcp_rx_timeout_val;
2119} tSirAppType2Params, *tpSirAppType2Params;
2120#endif
2121
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002122#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2123typedef struct {
2124 uint8_t acvo_uapsd:1;
2125 uint8_t acvi_uapsd:1;
2126 uint8_t acbk_uapsd:1;
2127 uint8_t acbe_uapsd:1;
2128 uint8_t reserved:4;
2129} tSirAcUapsd, *tpSirAcUapsd;
2130#endif
2131
2132typedef struct {
2133 tSirMacSSid ssId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302134 uint8_t currAPbssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002135 uint32_t authentication;
2136 uint8_t encryption;
2137 uint8_t mcencryption;
2138 uint8_t ChannelCount;
2139 uint8_t ChannelCache[SIR_ROAM_MAX_CHANNELS];
2140#ifdef WLAN_FEATURE_11W
2141 bool mfp_enabled;
2142#endif
2143
2144} tSirRoamNetworkType;
2145
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002146typedef enum {
2147 SIR_ROAMING_DFS_CHANNEL_DISABLED = 0,
2148 SIR_ROAMING_DFS_CHANNEL_ENABLED_NORMAL = 1,
2149 SIR_ROAMING_DFS_CHANNEL_ENABLED_ACTIVE = 2
2150} eSirDFSRoamScanMode;
2151#define MAX_SSID_ALLOWED_LIST 4
2152#define MAX_BSSID_AVOID_LIST 16
2153#define MAX_BSSID_FAVORED 16
2154/**
2155 * struct roam_ext_params - Structure holding roaming parameters
2156 * @num_bssid_avoid_list: The number of BSSID's that we should
2157 * avoid connecting to. It is like a
2158 * blacklist of BSSID's.
2159 * @num_ssid_allowed_list: The number of SSID profiles that are
2160 * in the Whitelist. When roaming, we
2161 * consider the BSSID's with this SSID
2162 * also for roaming apart from the connected one's
2163 * @num_bssid_favored: Number of BSSID's which have a preference over
2164 * others
2165 * @ssid_allowed_list: Whitelist SSID's
2166 * @bssid_avoid_list: Blacklist SSID's
2167 * @bssid_favored: Favorable BSSID's
2168 * @bssid_favored_factor: RSSI to be added to this BSSID to prefer it
2169 * @raise_rssi_thresh_5g: The RSSI threshold below which the
2170 * raise_factor_5g (boost factor) should be
2171 * applied.
2172 * @drop_rssi_thresh_5g: The RSSI threshold beyond which the
2173 * drop_factor_5g (penalty factor) should be
2174 * applied
2175 * @raise_rssi_type_5g: Algorithm to apply the boost factor
2176 * @raise_factor_5g: Boost factor
2177 * @drop_rssi_type_5g: Algorithm to apply the penalty factor
2178 * @drop_factor_5g: Penalty factor
2179 * @max_raise_rssi_5g: Maximum amount of Boost that can added
2180 * @max_drop_rssi_5g: Maximum amount of penalty that can be subtracted
2181 * @good_rssi_threshold: The Lookup UP threshold beyond which roaming
2182 * scan should be performed.
2183 * @rssi_diff: RSSI difference for the AP to be better over the
2184 * current AP to avoid ping pong effects
2185 * @good_rssi_roam: Lazy Roam
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002186 * @bg_scan_bad_rssi_thresh: Bad RSSI threshold to perform bg scan.
Vignesh Viswanathanc018e982017-09-07 18:49:19 +05302187 * @bad_rssi_thresh_offset_2g: Offset from Bad RSSI threshold for 2G to 5G Roam
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002188 * @bg_scan_client_bitmap: Bitmap to identify the client scans to snoop.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002189 *
2190 * This structure holds all the key parameters related to
2191 * initial connection and also roaming connections.
2192 * */
2193struct roam_ext_params {
2194 uint8_t num_bssid_avoid_list;
2195 uint8_t num_ssid_allowed_list;
2196 uint8_t num_bssid_favored;
2197 tSirMacSSid ssid_allowed_list[MAX_SSID_ALLOWED_LIST];
Anurag Chouhan6d760662016-02-20 16:05:43 +05302198 struct qdf_mac_addr bssid_avoid_list[MAX_BSSID_AVOID_LIST];
2199 struct qdf_mac_addr bssid_favored[MAX_BSSID_FAVORED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002200 uint8_t bssid_favored_factor[MAX_BSSID_FAVORED];
2201 int raise_rssi_thresh_5g;
2202 int drop_rssi_thresh_5g;
2203 uint8_t raise_rssi_type_5g;
2204 uint8_t raise_factor_5g;
2205 uint8_t drop_rssi_type_5g;
2206 uint8_t drop_factor_5g;
2207 int max_raise_rssi_5g;
2208 int max_drop_rssi_5g;
2209 int alert_rssi_threshold;
2210 int rssi_diff;
2211 int good_rssi_roam;
Gupta, Kapilc68ad462016-02-01 19:17:23 +05302212 int dense_rssi_thresh_offset;
2213 int dense_min_aps_cnt;
2214 int initial_dense_status;
2215 int traffic_threshold;
Abhishek Singh4db8c152017-07-18 10:40:08 +05302216 uint8_t num_rssi_rejection_ap;
2217 struct rssi_disallow_bssid rssi_rejection_ap[MAX_RSSI_AVOID_BSSID_LIST];
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002218 int8_t bg_scan_bad_rssi_thresh;
Vignesh Viswanathanc018e982017-09-07 18:49:19 +05302219 uint8_t roam_bad_rssi_thresh_offset_2g;
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002220 uint32_t bg_scan_client_bitmap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002221};
2222
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08002223/**
2224 * struct pmkid_mode_bits - Bit flags for PMKID usage in RSN IE
2225 * @fw_okc: Opportunistic key caching enable in firmware
2226 * @fw_pmksa_cache: PMKSA caching enable in firmware, remember previously
2227 * visited BSSID/PMK pairs
2228 */
2229struct pmkid_mode_bits {
2230 uint32_t fw_okc:1;
2231 uint32_t fw_pmksa_cache:1;
2232 uint32_t unused:30;
2233};
2234
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302235/**
2236 * struct lca_disallow_config_params - LCA[Last Connected AP]
2237 * disallow config params
2238 * @disallow_duration: LCA AP disallowed duration
2239 * @rssi_channel_penalization: RSSI channel Penalization
2240 * @num_disallowed_aps: Maximum number of AP's in LCA list
2241 *
2242 */
Srinivas Girigowdaea4d8062017-10-14 12:40:48 -07002243struct lca_disallow_config_params {
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302244 uint32_t disallow_duration;
2245 uint32_t rssi_channel_penalization;
2246 uint32_t num_disallowed_aps;
2247};
2248
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002249/**
2250 * struct mawc_params - Motion Aided Wireless Connectivity configuration
Wu Gaoca416ff2018-09-17 11:05:07 +08002251 * @mawc_enabled: Global configuration for MAWC (Roaming/PNO/ExtScan)
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002252 * @mawc_roam_enabled: MAWC roaming enable/disable
2253 * @mawc_roam_traffic_threshold: Traffic threshold in kBps for MAWC roaming
2254 * @mawc_roam_ap_rssi_threshold: AP RSSI threshold for MAWC roaming
2255 * @mawc_roam_rssi_high_adjust: High Adjustment value for suppressing scan
2256 * @mawc_roam_rssi_low_adjust: Low Adjustment value for suppressing scan
2257 */
2258struct mawc_params {
2259 bool mawc_enabled;
2260 bool mawc_roam_enabled;
2261 uint32_t mawc_roam_traffic_threshold;
2262 int8_t mawc_roam_ap_rssi_threshold;
2263 uint8_t mawc_roam_rssi_high_adjust;
2264 uint8_t mawc_roam_rssi_low_adjust;
2265};
2266
Jeff Johnsone6da4b02019-02-06 22:22:04 -08002267struct roam_offload_scan_req {
Selvaraj, Sridhar01741822016-08-30 18:26:19 +05302268 uint16_t message_type;
2269 uint16_t length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002270 bool RoamScanOffloadEnabled;
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002271 struct mawc_params mawc_roam_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002272 int8_t LookupThreshold;
Varun Reddy Yeturu168134f2017-06-26 13:46:05 -07002273 int8_t rssi_thresh_offset_5g;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002274 uint8_t delay_before_vdev_stop;
2275 uint8_t OpportunisticScanThresholdDiff;
2276 uint8_t RoamRescanRssiDiff;
2277 uint8_t RoamRssiDiff;
gaurank kathpaliac63859d2018-05-03 18:48:41 +05302278 struct rsn_caps rsn_caps;
Abhishek Singh34c0e632017-09-28 14:39:29 +05302279 int32_t rssi_abs_thresh;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002280 uint8_t ChannelCacheType;
2281 uint8_t Command;
2282 uint8_t reason;
2283 uint16_t NeighborScanTimerPeriod;
Sridhar Selvaraj1b2330c2017-07-21 15:16:42 +05302284 uint16_t neighbor_scan_min_timer_period;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002285 uint16_t NeighborScanChannelMinTime;
2286 uint16_t NeighborScanChannelMaxTime;
2287 uint16_t EmptyRefreshScanPeriod;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002288 bool IsESEAssoc;
Abhinav Kumar271f0632018-03-29 16:01:30 +05302289 bool is_11r_assoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002290 uint8_t nProbes;
2291 uint16_t HomeAwayTime;
2292 tSirRoamNetworkType ConnectedNetwork;
Jeff Johnson9e760832018-12-15 12:41:36 -08002293 struct mobility_domain_info mdid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002294 uint8_t sessionId;
2295 uint8_t RoamBmissFirstBcnt;
2296 uint8_t RoamBmissFinalBcnt;
2297 uint8_t RoamBeaconRssiWeight;
2298 eSirDFSRoamScanMode allowDFSChannelRoam;
2299#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Jianmin Zhubf845932018-12-17 11:52:50 +08002300 uint8_t roam_offload_enabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002301 uint8_t PSK_PMK[SIR_ROAM_SCAN_PSK_SIZE];
2302 uint32_t pmk_len;
2303 uint8_t Prefer5GHz;
2304 uint8_t RoamRssiCatGap;
2305 uint8_t Select5GHzMargin;
2306 uint8_t KRK[SIR_KRK_KEY_LEN];
2307 uint8_t BTK[SIR_BTK_KEY_LEN];
2308 uint32_t ReassocFailureTimeout;
2309 tSirAcUapsd AcUapsd;
2310 uint8_t R0KH_ID[SIR_ROAM_R0KH_ID_MAX_LEN];
2311 uint32_t R0KH_ID_Length;
2312 uint8_t RoamKeyMgmtOffloadEnabled;
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08002313 struct pmkid_mode_bits pmkid_modes;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002314#endif
2315 struct roam_ext_params roam_params;
2316 uint8_t middle_of_roaming;
2317 uint32_t hi_rssi_scan_max_count;
2318 uint32_t hi_rssi_scan_rssi_delta;
2319 uint32_t hi_rssi_scan_delay;
2320 int32_t hi_rssi_scan_rssi_ub;
Varun Reddy Yeturu05186292015-09-28 17:12:33 -07002321 uint8_t early_stop_scan_enable;
2322 int8_t early_stop_scan_min_threshold;
2323 int8_t early_stop_scan_max_threshold;
Sandeep Puligillaf5ccbf62018-03-26 16:37:05 -07002324 enum scan_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode;
Selvaraj, Sridhara7fc7632016-09-04 13:13:38 +05302325 tSirAddie assoc_ie;
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302326 struct lca_disallow_config_params lca_config_params;
Himanshu Agarwal8bcec572017-09-28 11:54:37 +05302327 struct scoring_param score_params;
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05302328#ifdef WLAN_FEATURE_FILS_SK
2329 bool is_fils_connection;
2330 struct roam_fils_params roam_fils_params;
2331#endif
yeshwanth sriram guntuka41f936c2017-09-01 17:53:49 +05302332 uint32_t btm_offload_config;
Jiachao Wu84bb2ea2018-01-08 16:17:33 +08002333 uint32_t btm_solicited_timeout;
2334 uint32_t btm_max_attempt_cnt;
2335 uint32_t btm_sticky_time;
Pragaspathi Thilagarajae7dc762018-12-12 18:10:50 +05302336 uint32_t rct_validity_timer;
2337 uint32_t disassoc_timer_threshold;
Vignesh Viswanathanfb9d0752018-02-06 16:19:00 +05302338 struct wmi_11k_offload_params offload_11k_params;
Abhinav Kumara083f212018-04-05 18:49:45 +05302339 uint32_t ho_delay_for_rx;
Sourav Mohapatra5ba8da32018-07-16 09:21:15 +05302340 uint32_t roam_preauth_retry_count;
2341 uint32_t roam_preauth_no_ack_timeout;
Abhinav Kumara95af7c2018-04-06 17:08:00 +05302342 uint32_t min_delay_btw_roam_scans;
2343 uint32_t roam_trigger_reason_bitmask;
Abhinav Kumaredd1d372018-05-11 15:33:35 +05302344 bool roam_force_rssi_trigger;
Pragaspathi Thilagaraj69f0b692018-12-16 22:23:04 +05302345 /* bss load triggered roam related params */
2346 bool bss_load_trig_enabled;
2347 struct wmi_bss_load_config bss_load_config;
Abhinav Kumar990fea62019-02-14 12:38:38 +05302348 bool roaming_scan_policy;
Jeff Johnsone6da4b02019-02-06 22:22:04 -08002349};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002350
Jeff Johnsond686ba72019-02-06 22:36:42 -08002351struct roam_offload_scan_rsp {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002352 uint8_t sessionId;
2353 uint32_t reason;
Jeff Johnsond686ba72019-02-06 22:36:42 -08002354};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002355
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002356/*---------------------------------------------------------------------------
2357 Packet Filtering Parameters
2358 ---------------------------------------------------------------------------*/
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002359#define SIR_MAX_FILTER_TEST_DATA_LEN 8
Dustin Brown4d1e8462016-12-14 12:12:24 -08002360#define SIR_MAX_FILTER_TEST_DATA_OFFSET 200
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002361#define SIR_MAX_NUM_MULTICAST_ADDRESS 240
2362#define SIR_MAX_NUM_FILTERS 20
2363#define SIR_MAX_NUM_TESTS_PER_FILTER 10
2364
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002365/* */
2366/* Multicast Address List Parameters */
2367/* */
2368typedef struct sSirRcvFltMcAddrList {
2369 uint32_t ulMulticastAddrCnt;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302370 struct qdf_mac_addr multicastAddr[SIR_MAX_NUM_MULTICAST_ADDRESS];
2371 struct qdf_mac_addr self_macaddr;
2372 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002373 uint8_t action;
2374} tSirRcvFltMcAddrList, *tpSirRcvFltMcAddrList;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002375
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002376/**
2377 * struct sir_wifi_start_log - Structure to store the params sent to start/
2378 * stop logging
2379 * @name: Attribute which indicates the type of logging like per packet
2380 * statistics, connectivity etc.
2381 * @verbose_level: Verbose level which can be 0,1,2,3
Poddar, Siddartheefe3482016-09-21 18:12:59 +05302382 * @is_iwpriv_command: Set 1 for iwpriv command
Srinivas Girigowdac34f11d2016-02-25 16:02:42 -08002383 * @ini_triggered: triggered using ini
2384 * @user_triggered: triggered by user
Poddar, Siddarth176c4362016-10-03 12:25:00 +05302385 * @size: pktlog buffer size
Poddar, Siddarthab99a272017-04-10 12:53:26 +05302386 * @is_pktlog_buff_clear: clear the pktlog buffer
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002387 */
2388struct sir_wifi_start_log {
2389 uint32_t ring_id;
2390 uint32_t verbose_level;
Poddar, Siddartheefe3482016-09-21 18:12:59 +05302391 uint32_t is_iwpriv_command;
Srinivas Girigowdac34f11d2016-02-25 16:02:42 -08002392 bool ini_triggered;
2393 uint8_t user_triggered;
Poddar, Siddarth176c4362016-10-03 12:25:00 +05302394 int size;
Poddar, Siddarthab99a272017-04-10 12:53:26 +05302395 bool is_pktlog_buff_clear;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002396};
2397
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002398
2399/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002400 * struct sir_pcl_list - Format of PCL
2401 * @pcl_list: List of preferred channels
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302402 * @weight_list: Weights of the PCL
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002403 * @pcl_len: Number of channels in the PCL
2404 */
2405struct sir_pcl_list {
Rajeev Kumar Sirasanagandla4133d862018-08-23 12:21:36 +05302406 uint32_t pcl_len;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002407 uint8_t pcl_list[128];
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302408 uint8_t weight_list[128];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002409};
2410
2411/**
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302412 * struct sir_pcl_chan_weights - Params to get the valid weighed list
2413 * @pcl_list: Preferred channel list already sorted in the order of preference
2414 * @pcl_len: Length of the PCL
2415 * @saved_chan_list: Valid channel list updated as part of
2416 * WMA_UPDATE_CHAN_LIST_REQ
2417 * @saved_num_chan: Length of the valid channel list
2418 * @weighed_valid_list: Weights of the valid channel list. This will have one
2419 * to one mapping with valid_chan_list. FW expects channel order and size to be
2420 * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID.
2421 * @weight_list: Weights assigned by policy manager
2422 */
2423struct sir_pcl_chan_weights {
2424 uint8_t pcl_list[128];
2425 uint32_t pcl_len;
2426 uint8_t saved_chan_list[128];
2427 uint32_t saved_num_chan;
2428 uint8_t weighed_valid_list[128];
2429 uint8_t weight_list[128];
2430};
2431
2432/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002433 * struct sir_hw_mode_params - HW mode params
2434 * @mac0_tx_ss: MAC0 Tx spatial stream
2435 * @mac0_rx_ss: MAC0 Rx spatial stream
2436 * @mac1_tx_ss: MAC1 Tx spatial stream
2437 * @mac1_rx_ss: MAC1 Rx spatial stream
2438 * @mac0_bw: MAC0 bandwidth
2439 * @mac1_bw: MAC1 bandwidth
2440 * @dbs_cap: DBS capabality
2441 * @agile_dfs_cap: Agile DFS capabality
2442 */
2443struct sir_hw_mode_params {
2444 uint8_t mac0_tx_ss;
2445 uint8_t mac0_rx_ss;
2446 uint8_t mac1_tx_ss;
2447 uint8_t mac1_rx_ss;
2448 uint8_t mac0_bw;
2449 uint8_t mac1_bw;
2450 uint8_t dbs_cap;
2451 uint8_t agile_dfs_cap;
Nitesh Shah5b7bae02016-09-28 18:58:33 +05302452 uint8_t sbs_cap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002453};
2454
2455/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002456 * struct sir_set_hw_mode_resp - HW mode response
2457 * @status: Status
2458 * @cfgd_hw_mode_index: Configured HW mode index
2459 * @num_vdev_mac_entries: Number of vdev-mac id entries
2460 * @vdev_mac_map: vdev id-mac id map
2461 */
2462struct sir_set_hw_mode_resp {
2463 uint32_t status;
2464 uint32_t cfgd_hw_mode_index;
2465 uint32_t num_vdev_mac_entries;
Tushnim Bhattacharyyaeab33dd2017-11-15 15:20:02 -08002466 struct policy_mgr_vdev_mac_map vdev_mac_map[MAX_VDEV_SUPPORTED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002467};
2468
2469/**
2470 * struct sir_hw_mode_trans_ind - HW mode transition indication
2471 * @old_hw_mode_index: Index of old HW mode
2472 * @new_hw_mode_index: Index of new HW mode
2473 * @num_vdev_mac_entries: Number of vdev-mac id entries
2474 * @vdev_mac_map: vdev id-mac id map
2475 */
2476struct sir_hw_mode_trans_ind {
2477 uint32_t old_hw_mode_index;
2478 uint32_t new_hw_mode_index;
2479 uint32_t num_vdev_mac_entries;
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08002480 struct policy_mgr_vdev_mac_map vdev_mac_map[MAX_VDEV_SUPPORTED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002481};
2482
2483/**
2484 * struct sir_dual_mac_config_resp - Dual MAC config response
2485 * @status: Status of setting the dual mac configuration
2486 */
2487struct sir_dual_mac_config_resp {
2488 uint32_t status;
2489};
2490
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -08002491/**
2492 * enum set_antenna_mode_status - Status of set antenna mode
2493 * command
2494 * @SET_ANTENNA_MODE_STATUS_OK: command successful
2495 * @SET_ANTENNA_MODE_STATUS_EINVAL: invalid antenna mode
2496 * @SET_ANTENNA_MODE_STATUS_ECANCELED: mode change cancelled
2497 * @SET_ANTENNA_MODE_STATUS_ENOTSUP: mode not supported
2498 */
2499enum set_antenna_mode_status {
2500 SET_ANTENNA_MODE_STATUS_OK,
2501 SET_ANTENNA_MODE_STATUS_EINVAL,
2502 SET_ANTENNA_MODE_STATUS_ECANCELED,
2503 SET_ANTENNA_MODE_STATUS_ENOTSUP,
2504};
2505
2506/**
2507 * struct sir_antenna_mode_resp - set antenna mode response
2508 * @status: Status of setting the antenna mode
2509 */
2510struct sir_antenna_mode_resp {
2511 enum set_antenna_mode_status status;
2512};
2513
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002514#ifdef FEATURE_WLAN_TDLS
2515/* TDLS Request struct SME-->PE */
2516typedef struct sSirTdlsSendMgmtReq {
2517 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
2518 uint16_t length;
2519 uint8_t sessionId; /* Session ID */
2520 uint16_t transactionId; /* Transaction ID for cmd */
2521 uint8_t reqType;
2522 uint8_t dialog;
2523 uint16_t statusCode;
2524 uint8_t responder;
2525 uint32_t peerCapability;
2526 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302527 struct qdf_mac_addr bssid;
2528 struct qdf_mac_addr peer_mac;
Ganesh Kondabattinidd726522017-05-10 18:09:37 +05302529 enum wifi_traffic_ac ac;
Srinivas Girigowdaa9d12f12015-11-24 11:26:40 -08002530 /* Variable length. Dont add any field after this. */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002531 uint8_t addIe[1];
2532} tSirTdlsSendMgmtReq, *tpSirSmeTdlsSendMgmtReq;
2533
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002534/* TDLS Request struct SME-->PE */
2535typedef struct sSirTdlsAddStaReq {
2536 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
2537 uint16_t length;
2538 uint8_t sessionId; /* Session ID */
2539 uint16_t transactionId; /* Transaction ID for cmd */
2540 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302541 struct qdf_mac_addr bssid;
Bala Venkatesh4a72b062018-11-13 13:04:49 +05302542 enum tdls_add_oper tdlsAddOper;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302543 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002544 uint16_t capability;
2545 uint8_t extn_capability[SIR_MAC_MAX_EXTN_CAP];
2546 uint8_t supported_rates_length;
2547 uint8_t supported_rates[SIR_MAC_MAX_SUPP_RATES];
2548 uint8_t htcap_present;
Bala Venkatesh02d52352018-11-26 15:12:58 +05302549 struct htcap_cmn_ie htCap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002550 uint8_t vhtcap_present;
2551 tSirVHTCap vhtCap;
2552 uint8_t uapsd_queues;
2553 uint8_t max_sp;
2554} tSirTdlsAddStaReq, *tpSirSmeTdlsAddStaReq;
2555
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002556/* TDLS Request struct SME-->PE */
2557typedef struct sSirTdlsDelStaReq {
2558 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
2559 uint16_t length;
2560 uint8_t sessionId; /* Session ID */
2561 uint16_t transactionId; /* Transaction ID for cmd */
2562 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302563 struct qdf_mac_addr bssid;
2564 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002565} tSirTdlsDelStaReq, *tpSirSmeTdlsDelStaReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002566#endif /* FEATURE_WLAN_TDLS */
2567
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002568/* Reset AP Caps Changed */
2569typedef struct sSirResetAPCapsChange {
2570 uint16_t messageType;
2571 uint16_t length;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302572 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002573} tSirResetAPCapsChange, *tpSirResetAPCapsChange;
2574
2575/* / Definition for Candidate found indication from FW */
2576typedef struct sSirSmeCandidateFoundInd {
2577 uint16_t messageType; /* eWNI_SME_CANDIDATE_FOUND_IND */
2578 uint16_t length;
2579 uint8_t sessionId; /* Session Identifier */
2580} tSirSmeCandidateFoundInd, *tpSirSmeCandidateFoundInd;
2581
2582#ifdef WLAN_FEATURE_11W
2583typedef struct sSirWlanExcludeUnencryptParam {
2584 bool excludeUnencrypt;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302585 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002586} tSirWlanExcludeUnencryptParam, *tpSirWlanExcludeUnencryptParam;
2587#endif
2588
2589typedef enum {
2590 P2P_SCAN_TYPE_SEARCH = 1, /* P2P Search */
2591 P2P_SCAN_TYPE_LISTEN /* P2P Listen */
2592} tSirP2pScanType;
2593
2594typedef struct sAniHandoffReq {
2595 /* Common for all types are requests */
2596 uint16_t msgType; /* message type is same as the request type */
2597 uint16_t msgLen; /* length of the entire request */
2598 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302599 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002600 uint8_t channel;
2601 uint8_t handoff_src;
2602} tAniHandoffReq, *tpAniHandoffReq;
2603
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08002604/**
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07002605 * sir_scan_event_type - scan event types used in LIM
2606 * @SIR_SCAN_EVENT_STARTED - scan command accepted by FW
2607 * @SIR_SCAN_EVENT_COMPLETED - scan has been completed by FW
2608 * @SIR_SCAN_EVENT_BSS_CHANNEL - FW is going to move to HOME channel
2609 * @SIR_SCAN_EVENT_FOREIGN_CHANNEL - FW is going to move to FORIEGN channel
2610 * @SIR_SCAN_EVENT_DEQUEUED - scan request got dequeued
2611 * @SIR_SCAN_EVENT_PREEMPTED - preempted by other high priority scan
2612 * @SIR_SCAN_EVENT_START_FAILED - scan start failed
2613 * @SIR_SCAN_EVENT_RESTARTED - scan restarted
2614 * @SIR_SCAN_EVENT_MAX - max value for event type
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08002615*/
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07002616enum sir_scan_event_type {
2617 SIR_SCAN_EVENT_STARTED = 0x1,
2618 SIR_SCAN_EVENT_COMPLETED = 0x2,
2619 SIR_SCAN_EVENT_BSS_CHANNEL = 0x4,
2620 SIR_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
2621 SIR_SCAN_EVENT_DEQUEUED = 0x10,
2622 SIR_SCAN_EVENT_PREEMPTED = 0x20,
2623 SIR_SCAN_EVENT_START_FAILED = 0x40,
2624 SIR_SCAN_EVENT_RESTARTED = 0x80,
2625 SIR_SCAN_EVENT_MAX = 0x8000
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08002626};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002627
2628typedef struct sSirScanOffloadEvent {
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07002629 enum sir_scan_event_type event;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002630 tSirResultCodes reasonCode;
2631 uint32_t chanFreq;
2632 uint32_t requestor;
2633 uint32_t scanId;
2634 tSirP2pScanType p2pScanType;
2635 uint8_t sessionId;
2636} tSirScanOffloadEvent, *tpSirScanOffloadEvent;
2637
2638/**
2639 * struct sSirUpdateChanParam - channel parameters
2640 * @chanId: ID of the channel
2641 * @pwr: power level
2642 * @dfsSet: is dfs supported or not
2643 * @half_rate: is the channel operating at 10MHz
2644 * @quarter_rate: is the channel operating at 5MHz
2645 */
2646typedef struct sSirUpdateChanParam {
2647 uint8_t chanId;
2648 uint8_t pwr;
2649 bool dfsSet;
2650 bool half_rate;
2651 bool quarter_rate;
2652} tSirUpdateChanParam, *tpSirUpdateChanParam;
2653
2654typedef struct sSirUpdateChan {
2655 uint8_t numChan;
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07002656 uint8_t ht_en;
2657 uint8_t vht_en;
2658 uint8_t vht_24_en;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002659 tSirUpdateChanParam chanParam[1];
2660} tSirUpdateChanList, *tpSirUpdateChanList;
2661
2662typedef enum eSirAddonPsReq {
2663 eSIR_ADDON_NOTHING,
2664 eSIR_ADDON_ENABLE_UAPSD,
2665 eSIR_ADDON_DISABLE_UAPSD
2666} tSirAddonPsReq;
2667
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002668#ifdef FEATURE_WLAN_CH_AVOID
2669typedef struct sSirChAvoidUpdateReq {
2670 uint32_t reserved_param;
2671} tSirChAvoidUpdateReq;
2672#endif /* FEATURE_WLAN_CH_AVOID */
2673
Jeff Johnsone943bca2019-02-08 22:45:17 -08002674struct link_speed_info {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002675 /* MAC Address for the peer */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302676 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002677 uint32_t estLinkSpeed; /* Linkspeed from firmware */
Jeff Johnsone943bca2019-02-08 22:45:17 -08002678};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002679
Will Huanga9814592017-05-24 15:47:58 +08002680/**
2681 * struct sir_peer_info_req - peer info request struct
2682 * @peer_macaddr: MAC address
2683 * @sessionid: vdev id
2684 *
2685 * peer info request message's struct
2686 */
2687struct sir_peer_info_req {
2688 struct qdf_mac_addr peer_macaddr;
2689 uint8_t sessionid;
2690};
2691
2692/**
2693 * struct sir_peer_info - peer information struct
2694 * @peer_macaddr: MAC address
2695 * @rssi: rssi
2696 * @tx_rate: last tx rate
2697 * @rx_rate: last rx rate
2698 *
2699 * a station's information
2700 */
2701struct sir_peer_info {
2702 struct qdf_mac_addr peer_macaddr;
2703 int8_t rssi;
2704 uint32_t tx_rate;
2705 uint32_t rx_rate;
2706};
2707
2708/**
2709 * struct sir_peer_info_resp - all peers information struct
2710 * @count: peer's number
2711 * @info: peer information
2712 *
2713 * all station's information
2714 */
2715struct sir_peer_info_resp {
2716 uint8_t count;
2717 struct sir_peer_info info[0];
2718};
2719
2720/**
2721 * struct sir_peer_info_ext_req - peer info request struct
2722 * @peer_macaddr: MAC address
2723 * @sessionid: vdev id
2724 * @reset_after_request: fw reset statistics after query
2725 *
2726 * peer info request message's struct
2727 */
2728struct sir_peer_info_ext_req {
2729 struct qdf_mac_addr peer_macaddr;
2730 uint8_t sessionid;
2731 uint8_t reset_after_request;
2732};
2733
2734/**
2735 * struct sir_peer_info_ext - peer info information struct
2736 * (refer to station_info struct in Kernel)
2737 * @peer_macaddr: MAC address
2738 * @tx_packets: packets transmitted to this station
2739 * @tx_bytes: bytes transmitted to this station
2740 * @rx_packets: packets received from this station
2741 * @rx_bytes: bytes received from this station
2742 * @rx_retries: cumulative retry counts
2743 * @tx_failed: number of failed transmissions
2744 * @rssi: The signal strength
2745 * @tx_rate: last used tx bitrate (kbps)
2746 * @tx_rate_code: last tx rate code (last_tx_rate_code of wmi_peer_stats_info)
2747 * @rx_rate: last used rx bitrate (kbps)
2748 * @rx_rate_code: last rx rate code (last_rx_rate_code of wmi_peer_stats_info)
2749 *
2750 * a station's information
2751 */
2752struct sir_peer_info_ext {
2753 struct qdf_mac_addr peer_macaddr;
2754 uint32_t tx_packets;
2755 uint64_t tx_bytes;
2756 uint32_t rx_packets;
2757 uint64_t rx_bytes;
2758 uint32_t tx_retries;
2759 uint32_t tx_failed;
2760 int32_t rssi;
2761 uint32_t tx_rate;
2762 uint32_t tx_rate_code;
2763 uint32_t rx_rate;
2764 uint32_t rx_rate_code;
2765};
2766
2767/**
2768 * struct sir_peer_info_ext_resp - all peers' information struct
2769 * @count: peer's number
2770 * @info: peer information
2771 *
2772 * all station's information
2773 */
2774struct sir_peer_info_ext_resp {
2775 uint8_t count;
2776 struct sir_peer_info_ext info[0];
2777};
2778
Will Huang496b36c2017-07-11 16:38:50 +08002779/**
2780 * @sta_num: number of peer station which has valid info
2781 * @info: peer information
2782 *
2783 * all SAP peer station's information retrieved
2784 */
2785struct sir_peer_sta_info {
2786 uint8_t sta_num;
2787 struct sir_peer_info info[MAX_PEER_STA];
2788};
2789
2790/**
2791 * @sta_num: number of peer station which has valid info
2792 * @info: peer extended information
2793 *
2794 * all SAP peer station's extended information retrieved
2795 */
2796struct sir_peer_sta_ext_info {
2797 uint8_t sta_num;
2798 struct sir_peer_info_ext info[MAX_PEER_STA];
2799};
2800
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002801typedef struct sSirAddPeriodicTxPtrn {
2802 /* MAC Address for the adapter */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302803 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002804 uint8_t ucPtrnId; /* Pattern ID */
2805 uint16_t ucPtrnSize; /* Pattern size */
2806 uint32_t usPtrnIntervalMs; /* In msec */
2807 uint8_t ucPattern[PERIODIC_TX_PTRN_MAX_SIZE]; /* Pattern buffer */
2808} tSirAddPeriodicTxPtrn, *tpSirAddPeriodicTxPtrn;
2809
2810typedef struct sSirDelPeriodicTxPtrn {
2811 /* MAC Address for the adapter */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302812 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002813 uint8_t ucPtrnId; /* Pattern ID */
2814} tSirDelPeriodicTxPtrn, *tpSirDelPeriodicTxPtrn;
2815
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08002816/*---------------------------------------------------------------------------
2817* tSirIbssGetPeerInfoReqParams
2818*--------------------------------------------------------------------------*/
2819typedef struct {
2820 bool allPeerInfoReqd; /* If set, all IBSS peers stats are reported */
2821 uint8_t staIdx; /* If allPeerInfoReqd is not set, only stats */
2822 /* of peer with staIdx is reported */
2823} tSirIbssGetPeerInfoReqParams, *tpSirIbssGetPeerInfoReqParams;
2824
Rajeev Kumar94c9b452016-03-24 12:58:47 -07002825/**
2826 * typedef struct - tSirIbssGetPeerInfoParams
2827 * @mac_addr: mac address received from target
2828 * @txRate: TX rate
2829 * @mcsIndex: MCS index
Rajeev Kumar94c9b452016-03-24 12:58:47 -07002830 * @rssi: RSSI
2831 */
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08002832typedef struct {
Rajeev Kumar94c9b452016-03-24 12:58:47 -07002833 uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
2834 uint32_t txRate;
2835 uint32_t mcsIndex;
Rajeev Kumar94c9b452016-03-24 12:58:47 -07002836 int8_t rssi;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08002837} tSirIbssPeerInfoParams;
2838
2839typedef struct {
2840 uint32_t status;
2841 uint8_t numPeers;
2842 tSirIbssPeerInfoParams peerInfoParams[32];
2843} tSirPeerInfoRspParams, *tpSirIbssPeerInfoRspParams;
2844
2845/*---------------------------------------------------------------------------
2846* tSirIbssGetPeerInfoRspParams
2847*--------------------------------------------------------------------------*/
2848typedef struct {
2849 uint16_t mesgType;
2850 uint16_t mesgLen;
2851 tSirPeerInfoRspParams ibssPeerInfoRspParams;
2852} tSirIbssGetPeerInfoRspParams, *tpSirIbssGetPeerInfoRspParams;
2853
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002854#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
2855typedef struct {
2856 uint16_t mesgType;
2857 uint16_t mesgLen;
2858 bool status;
2859} tSirReadyToExtWoWInd, *tpSirReadyToExtWoWInd;
2860#endif
2861typedef struct sSirRateUpdateInd {
2862 uint8_t nss; /* 0: 1x1, 1: 2x2 */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302863 struct qdf_mac_addr bssid;
Jeff Johnsonc1e62782017-11-09 09:50:17 -08002864 enum QDF_OPMODE dev_mode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002865 int32_t bcastDataRate; /* bcast rate unit Mbpsx10, -1:not used */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002866
2867 /*
2868 * 0 implies MCAST RA, positive value implies fixed rate,
2869 * -1 implies ignore this param
2870 */
2871 int32_t reliableMcastDataRate; /* unit Mbpsx10 */
2872
2873 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07002874 enum tx_rate_info reliableMcastDataRateTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002875
2876 /*
2877 * MCAST(or BCAST) fixed data rate in 2.4 GHz, unit Mbpsx10,
2878 * 0 implies ignore
2879 */
2880 uint32_t mcastDataRate24GHz;
2881
2882 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07002883 enum tx_rate_info mcastDataRate24GHzTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002884
2885 /*
2886 * MCAST(or BCAST) fixed data rate in 5 GHz,
2887 * unit Mbpsx10, 0 implies ignore
2888 */
2889 uint32_t mcastDataRate5GHz;
2890
2891 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07002892 enum tx_rate_info mcastDataRate5GHzTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002893
2894} tSirRateUpdateInd, *tpSirRateUpdateInd;
2895
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002896#define SIR_DFS_MAX_20M_SUB_CH 8
Sandeep Puligilla949eaa72015-12-17 18:43:52 -08002897#define SIR_80MHZ_START_CENTER_CH_DIFF 6
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002898
2899typedef struct sSirSmeDfsChannelList {
2900 uint32_t nchannels;
2901 /* Ch num including bonded channels on which the RADAR is present */
2902 uint8_t channels[SIR_DFS_MAX_20M_SUB_CH];
2903} tSirSmeDfsChannelList, *tpSirSmeDfsChannelList;
2904
2905typedef struct sSirSmeDfsEventInd {
2906 uint32_t sessionId;
2907 tSirSmeDfsChannelList chan_list;
2908 uint32_t dfs_radar_status;
2909 int use_nol;
2910} tSirSmeDfsEventInd, *tpSirSmeDfsEventInd;
2911
2912typedef struct sSirChanChangeRequest {
2913 uint16_t messageType;
2914 uint16_t messageLen;
2915 uint8_t targetChannel;
Kiran Kumar Lokere999e58c2016-01-07 02:18:39 -08002916 uint8_t sec_ch_offset;
Kiran Kumar Lokere13644672016-02-29 15:40:10 -08002917 enum phy_ch_width ch_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002918 uint8_t center_freq_seg_0;
2919 uint8_t center_freq_seg_1;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302920 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002921 uint32_t dot11mode;
Bala Venkateshb39ed152017-12-26 19:35:27 +05302922 tSirNwType nw_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002923 tSirMacRateSet operational_rateset;
2924 tSirMacRateSet extended_rateset;
Arif Hussain671a1902017-03-17 09:08:32 -07002925 uint32_t cac_duration_ms;
2926 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002927} tSirChanChangeRequest, *tpSirChanChangeRequest;
2928
2929typedef struct sSirChanChangeResponse {
2930 uint8_t sessionId;
2931 uint8_t newChannelNumber;
2932 uint8_t channelChangeStatus;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002933} tSirChanChangeResponse, *tpSirChanChangeResponse;
2934
2935typedef struct sSirStartBeaconIndication {
2936 uint16_t messageType;
2937 uint16_t messageLen;
2938 uint8_t beaconStartStatus;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302939 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002940} tSirStartBeaconIndication, *tpSirStartBeaconIndication;
2941
2942/* additional IE type */
2943typedef enum tUpdateIEsType {
2944 eUPDATE_IE_NONE,
2945 eUPDATE_IE_PROBE_BCN,
2946 eUPDATE_IE_PROBE_RESP,
2947 eUPDATE_IE_ASSOC_RESP,
2948
2949 /* Add type above this line */
2950 /* this is used to reset all buffer */
2951 eUPDATE_IE_ALL,
2952 eUPDATE_IE_MAX
2953} eUpdateIEsType;
2954
2955/* Modify particular IE in addition IE for prob resp Bcn */
2956typedef struct sSirModifyIE {
Anurag Chouhan6d760662016-02-20 16:05:43 +05302957 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002958 uint16_t smeSessionId;
2959 bool notify;
2960 uint8_t ieID;
2961 uint8_t ieIDLen; /*ie length as per spec */
2962 uint16_t ieBufferlength;
2963 uint8_t *pIEBuffer;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08002964 int32_t oui_length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002965
2966} tSirModifyIE, *tpSirModifyIE;
2967
Kiran Kumar Lokerebc87bec2018-02-27 20:06:42 -08002968struct send_add_ba_req {
2969 uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
2970 struct addba_send_params param;
2971};
2972
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002973/* Message format for Update IE message sent to PE */
2974typedef struct sSirModifyIEsInd {
2975 uint16_t msgType;
2976 uint16_t msgLen;
2977 tSirModifyIE modifyIE;
2978 eUpdateIEsType updateType;
2979} tSirModifyIEsInd, *tpSirModifyIEsInd;
2980
2981/* Message format for Update IE message sent to PE */
2982typedef struct sSirUpdateIE {
Anurag Chouhan6d760662016-02-20 16:05:43 +05302983 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002984 uint16_t smeSessionId;
2985 bool append;
2986 bool notify;
2987 uint16_t ieBufferlength;
2988 uint8_t *pAdditionIEBuffer;
2989} tSirUpdateIE, *tpSirUpdateIE;
2990
2991/* Message format for Update IE message sent to PE */
2992typedef struct sSirUpdateIEsInd {
2993 uint16_t msgType;
2994 uint16_t msgLen;
2995 tSirUpdateIE updateIE;
2996 eUpdateIEsType updateType;
2997} tSirUpdateIEsInd, *tpSirUpdateIEsInd;
2998
2999/* Message format for requesting channel switch announcement to lower layers */
3000typedef struct sSirDfsCsaIeRequest {
3001 uint16_t msgType;
3002 uint16_t msgLen;
3003 uint8_t targetChannel;
3004 uint8_t csaIeRequired;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303005 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Amar Singhal5cccafe2017-02-15 12:42:58 -08003006 struct ch_params ch_params;
gaoleze2920bd2017-03-21 17:38:42 +08003007 uint8_t ch_switch_beacon_cnt;
gaolez76d2a162017-03-21 19:23:58 +08003008 uint8_t ch_switch_mode;
3009 uint8_t dfs_ch_switch_disable;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003010} tSirDfsCsaIeRequest, *tpSirDfsCsaIeRequest;
3011
3012/* Indication from lower layer indicating the completion of first beacon send
3013 * after the beacon template update
3014 */
3015typedef struct sSirFirstBeaconTxCompleteInd {
3016 uint16_t messageType; /* eWNI_SME_MISSED_BEACON_IND */
3017 uint16_t length;
3018 uint8_t bssIdx;
3019} tSirFirstBeaconTxCompleteInd, *tpSirFirstBeaconTxCompleteInd;
3020
3021typedef struct sSirSmeCSAIeTxCompleteRsp {
3022 uint8_t sessionId;
3023 uint8_t chanSwIeTxStatus;
3024} tSirSmeCSAIeTxCompleteRsp, *tpSirSmeCSAIeTxCompleteRsp;
3025
3026/* Thermal Mitigation*/
3027
3028typedef struct {
3029 uint16_t minTempThreshold;
3030 uint16_t maxTempThreshold;
3031} t_thermal_level_info, *tp_thermal_level_info;
3032
3033typedef enum {
3034 WLAN_WMA_THERMAL_LEVEL_0,
3035 WLAN_WMA_THERMAL_LEVEL_1,
3036 WLAN_WMA_THERMAL_LEVEL_2,
3037 WLAN_WMA_THERMAL_LEVEL_3,
3038 WLAN_WMA_MAX_THERMAL_LEVELS
3039} t_thermal_level;
3040
Poddar, Siddarth83905022016-04-16 17:56:08 -07003041#define WLAN_THROTTLE_DUTY_CYCLE_LEVEL_MAX (4)
3042
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003043typedef struct {
3044 /* Array of thermal levels */
3045 t_thermal_level_info thermalLevels[WLAN_WMA_MAX_THERMAL_LEVELS];
3046 uint8_t thermalCurrLevel;
3047 uint8_t thermalMgmtEnabled;
3048 uint32_t throttlePeriod;
Poddar, Siddarth83905022016-04-16 17:56:08 -07003049 uint8_t throttle_duty_cycle_tbl[WLAN_THROTTLE_DUTY_CYCLE_LEVEL_MAX];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003050} t_thermal_mgmt, *tp_thermal_mgmt;
3051
Jeff Johnson19ce8d02019-02-08 22:56:23 -08003052struct tx_power_limit {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003053 /* Thermal limits for 2g and 5g */
3054 uint32_t txPower2g;
3055 uint32_t txPower5g;
Jeff Johnson19ce8d02019-02-08 22:56:23 -08003056};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003057
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +05303058enum bad_peer_thresh_levels {
3059 WLAN_WMA_IEEE80211_B_LEVEL = 0,
3060 WLAN_WMA_IEEE80211_AG_LEVEL,
3061 WLAN_WMA_IEEE80211_N_LEVEL,
3062 WLAN_WMA_IEEE80211_AC_LEVEL,
3063 WLAN_WMA_IEEE80211_AX_LEVEL,
3064 WLAN_WMA_IEEE80211_MAX_LEVEL,
3065};
3066
3067#define NUM_OF_RATE_THRESH_MAX (4)
3068struct t_bad_peer_info {
3069 uint32_t cond;
3070 uint32_t delta;
3071 uint32_t percentage;
3072 uint32_t thresh[NUM_OF_RATE_THRESH_MAX];
3073 uint32_t txlimit;
3074};
3075
3076struct t_bad_peer_txtcl_config {
3077 /* Array of thermal levels */
3078 struct t_bad_peer_info threshold[WLAN_WMA_IEEE80211_MAX_LEVEL];
3079 uint32_t enable;
3080 uint32_t period;
3081 uint32_t txq_limit;
3082 uint32_t tgt_backoff;
3083 uint32_t tgt_report_prd;
3084};
3085
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003086/* notify MODEM power state to FW */
3087typedef struct {
3088 uint32_t param;
3089} tSirModemPowerStateInd, *tpSirModemPowerStateInd;
3090
3091#ifdef WLAN_FEATURE_STATS_EXT
3092typedef struct {
3093 uint32_t vdev_id;
3094 uint32_t event_data_len;
3095 uint8_t event_data[];
3096} tSirStatsExtEvent, *tpSirStatsExtEvent;
3097#endif
3098
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003099typedef struct {
3100 uint32_t event_data_len;
3101 uint8_t event_data[];
3102} tSirNanEvent, *tpSirNanEvent;
Mahesh Kumar Kalikot Veetil919e01d2016-09-09 17:09:10 -07003103
Jeff Johnsona7f41dd2019-02-06 22:54:55 -08003104struct roam_offload_synch_ind {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003105 uint16_t messageType; /*eWNI_SME_ROAM_OFFLOAD_SYNCH_IND */
3106 uint16_t length;
3107 uint16_t beaconProbeRespOffset;
3108 uint16_t beaconProbeRespLength;
3109 uint16_t reassocRespOffset;
3110 uint16_t reassocRespLength;
Naveen Rawat14298b92015-11-25 16:27:41 -08003111 uint16_t reassoc_req_offset;
3112 uint16_t reassoc_req_length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003113 uint8_t isBeacon;
3114 uint8_t roamedVdevId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303115 struct qdf_mac_addr bssid;
Varun Reddy Yeturu28925b42016-02-08 07:18:50 -08003116 struct qdf_mac_addr self_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003117 int8_t txMgmtPower;
3118 uint32_t authStatus;
3119 uint8_t rssi;
3120 uint8_t roamReason;
3121 uint32_t chan_freq;
3122 uint8_t kck[SIR_KCK_KEY_LEN];
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05303123 uint32_t kek_len;
3124 uint8_t kek[SIR_KEK_KEY_LEN_FILS];
3125 uint32_t pmk_len;
3126 uint8_t pmk[SIR_PMK_LEN];
3127 uint8_t pmkid[SIR_PMKID_LEN];
3128 bool update_erp_next_seq_num;
3129 uint16_t next_erp_seq_num;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003130 uint8_t replay_ctr[SIR_REPLAY_CTR_LEN];
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08003131 void *add_bss_params;
Jeff Johnson2df04b82019-02-02 23:30:25 -08003132 struct join_rsp *join_rsp;
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08003133 uint16_t aid;
Naveen Rawat8cc23b02016-07-14 12:22:56 -07003134 struct sir_hw_mode_trans_ind hw_mode_trans_ind;
Naveen Rawat746a90b2017-06-07 15:16:35 -07003135 uint8_t nss;
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05303136 struct qdf_mac_addr dst_mac;
3137 struct qdf_mac_addr src_mac;
3138 uint16_t hlp_data_len;
3139 uint8_t hlp_data[FILS_MAX_HLP_DATA_LEN];
Jeff Johnsona7f41dd2019-02-06 22:54:55 -08003140};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003141
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -08003142#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Jeff Johnson10cde692019-02-08 19:59:17 -08003143struct handoff_failure_ind {
3144 uint8_t vdev_id;
3145};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003146
3147struct roam_offload_synch_fail {
3148 uint8_t session_id;
3149};
3150
3151#endif
3152
Wen Gong7952fbd2018-04-18 11:27:23 +08003153/**
3154 * struct sir_wisa_params - WISA Mode Parameters
3155 * @mode: WISA mode
3156 * @session_id: Session ID of vdev
3157 */
3158struct sir_wisa_params {
3159 bool mode;
3160 uint8_t vdev_id;
3161};
3162
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003163#ifdef FEATURE_WLAN_EXTSCAN
3164
Wen Gong7952fbd2018-04-18 11:27:23 +08003165#define WLAN_EXTSCAN_MAX_CHANNELS 36
3166#define WLAN_EXTSCAN_MAX_BUCKETS 16
Wen Gong7952fbd2018-04-18 11:27:23 +08003167#define WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS 64
3168
3169typedef enum {
3170 eSIR_EXTSCAN_INVALID,
3171 eSIR_EXTSCAN_START_RSP,
3172 eSIR_EXTSCAN_STOP_RSP,
3173 eSIR_EXTSCAN_CACHED_RESULTS_RSP,
3174 eSIR_EXTSCAN_SET_BSSID_HOTLIST_RSP,
3175 eSIR_EXTSCAN_RESET_BSSID_HOTLIST_RSP,
3176 eSIR_EXTSCAN_SET_SIGNIFICANT_WIFI_CHANGE_RSP,
3177 eSIR_EXTSCAN_RESET_SIGNIFICANT_WIFI_CHANGE_RSP,
3178
3179 eSIR_EXTSCAN_GET_CAPABILITIES_IND,
3180 eSIR_EXTSCAN_HOTLIST_MATCH_IND,
3181 eSIR_EXTSCAN_SIGNIFICANT_WIFI_CHANGE_RESULTS_IND,
3182 eSIR_EXTSCAN_CACHED_RESULTS_IND,
3183 eSIR_EXTSCAN_SCAN_RES_AVAILABLE_IND,
3184 eSIR_EXTSCAN_SCAN_PROGRESS_EVENT_IND,
3185 eSIR_EXTSCAN_FULL_SCAN_RESULT_IND,
3186 eSIR_EPNO_NETWORK_FOUND_IND,
3187 eSIR_PASSPOINT_NETWORK_FOUND_IND,
3188 eSIR_EXTSCAN_SET_SSID_HOTLIST_RSP,
3189 eSIR_EXTSCAN_RESET_SSID_HOTLIST_RSP,
3190
3191 /* Keep this last */
3192 eSIR_EXTSCAN_CALLBACK_TYPE_MAX,
3193} tSirExtScanCallbackType;
3194
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003195/**
3196 * typedef enum wifi_scan_flags - wifi scan flags
3197 * @WIFI_SCAN_FLAG_INTERRUPTED: Indicates that scan results are not complete
3198 * because probes were not sent on some channels
3199 */
3200typedef enum {
3201 WIFI_SCAN_FLAG_INTERRUPTED = 1,
3202} wifi_scan_flags;
3203
3204typedef enum {
3205 WIFI_BAND_UNSPECIFIED,
3206 WIFI_BAND_BG = 1, /* 2.4 GHz */
3207 WIFI_BAND_A = 2, /* 5 GHz without DFS */
3208 WIFI_BAND_ABG = 3, /* 2.4 GHz + 5 GHz; no DFS */
3209 WIFI_BAND_A_DFS_ONLY = 4, /* 5 GHz DFS only */
3210 /* 5 is reserved */
3211 WIFI_BAND_A_WITH_DFS = 6, /* 5 GHz with DFS */
3212 WIFI_BAND_ABG_WITH_DFS = 7, /* 2.4 GHz + 5 GHz with DFS */
3213
3214 /* Keep it last */
3215 WIFI_BAND_MAX
3216} tWifiBand;
3217
Mukul Sharma45114d92016-08-12 19:34:14 +05303218/**
3219 * enum wifi_extscan_event_type - extscan event type
3220 * @WIFI_EXTSCAN_RESULTS_AVAILABLE: reported when REPORT_EVENTS_EACH_SCAN is set
3221 * and a scan cycle completes. WIFI_SCAN_THRESHOLD_NUM_SCANS or
3222 * WIFI_SCAN_THRESHOLD_PERCENT can be reported instead if the
3223 * reason for the event is available; however, at most one of
3224 * these events should be reported per scan.
3225 * @WIFI_EXTSCAN_THRESHOLD_NUM_SCANS: can be reported when
3226 * REPORT_EVENTS_EACH_SCAN is not set and
3227 * report_threshold_num_scans is reached.
3228 * @WIFI_EXTSCAN_THRESHOLD_PERCENT: can be reported when REPORT_EVENTS_EACH_SCAN
3229 * is not set and report_threshold_percent is reached.
3230 * @WIFI_SCAN_DISABLED: reported when currently executing gscans are disabled
3231 * start_gscan will need to be called again in order to continue
3232 * scanning.
3233 * @WIFI_EXTSCAN_BUCKET_STARTED_EVENT: Bucket started event
3234 * This event is consumed in driver only.
3235 * @WIFI_EXTSCAN_CYCLE_STARTED_EVENT: Cycle started event.
3236 * This event is consumed in driver only.
3237 * @WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT: Cycle complete event. This event
3238 * triggers @WIFI_EXTSCAN_RESULTS_AVAILABLE to the user space.
3239 */
3240enum wifi_extscan_event_type {
Mukul Sharmafa937be2016-08-12 18:13:36 +05303241 WIFI_EXTSCAN_RESULTS_AVAILABLE,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303242 WIFI_EXTSCAN_THRESHOLD_NUM_SCANS,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303243 WIFI_EXTSCAN_THRESHOLD_PERCENT,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303244 WIFI_SCAN_DISABLED,
3245
Mukul Sharmafa937be2016-08-12 18:13:36 +05303246 WIFI_EXTSCAN_BUCKET_STARTED_EVENT = 0x10,
3247 WIFI_EXTSCAN_CYCLE_STARTED_EVENT,
3248 WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT,
Mukul Sharma45114d92016-08-12 19:34:14 +05303249};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003250
3251/**
3252 * enum extscan_configuration_flags - extscan config flags
3253 * @EXTSCAN_LP_EXTENDED_BATCHING: extended batching
3254 */
3255enum extscan_configuration_flags {
3256 EXTSCAN_LP_EXTENDED_BATCHING = 0x00000001,
3257};
3258
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003259/**
3260 * struct ext_scan_capabilities_response - extscan capabilities response data
3261 * @requestId: request identifier
3262 * @status: status
3263 * @max_scan_cache_size: total space allocated for scan (in bytes)
3264 * @max_scan_buckets: maximum number of channel buckets
3265 * @max_ap_cache_per_scan: maximum number of APs that can be stored per scan
3266 * @max_rssi_sample_size: number of RSSI samples used for averaging RSSI
3267 * @ax_scan_reporting_threshold: max possible report_threshold
3268 * @max_hotlist_bssids: maximum number of entries for hotlist APs
3269 * @max_significant_wifi_change_aps: maximum number of entries for
3270 * significant wifi change APs
3271 * @max_bssid_history_entries: number of BSSID/RSSI entries that device can hold
3272 * @max_hotlist_ssids: maximum number of entries for hotlist SSIDs
3273 * @max_number_epno_networks: max number of epno entries
3274 * @max_number_epno_networks_by_ssid: max number of epno entries
3275 * if ssid is specified, that is, epno entries for
3276 * which an exact match is required,
3277 * or entries corresponding to hidden ssids
3278 * @max_number_of_white_listed_ssid: max number of white listed SSIDs
Padma, Santhosh Kumar1ac02402016-11-02 18:04:14 +05303279 * @max_number_of_black_listed_bssid: max number of black listed BSSIDs
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003280 */
3281struct ext_scan_capabilities_response {
3282 uint32_t requestId;
3283 uint32_t status;
3284
3285 uint32_t max_scan_cache_size;
3286 uint32_t max_scan_buckets;
3287 uint32_t max_ap_cache_per_scan;
3288 uint32_t max_rssi_sample_size;
3289 uint32_t max_scan_reporting_threshold;
3290
3291 uint32_t max_hotlist_bssids;
3292 uint32_t max_significant_wifi_change_aps;
3293
3294 uint32_t max_bssid_history_entries;
3295 uint32_t max_hotlist_ssids;
3296 uint32_t max_number_epno_networks;
3297 uint32_t max_number_epno_networks_by_ssid;
3298 uint32_t max_number_of_white_listed_ssid;
Padma, Santhosh Kumar1ac02402016-11-02 18:04:14 +05303299 uint32_t max_number_of_black_listed_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003300};
3301
3302typedef struct {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003303 /* Time of discovery */
3304 uint64_t ts;
3305
3306 /* Null terminated SSID */
3307 uint8_t ssid[SIR_MAC_MAX_SSID_LENGTH + 1];
3308
Anurag Chouhan6d760662016-02-20 16:05:43 +05303309 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003310
3311 /* Frequency in MHz */
3312 uint32_t channel;
3313
3314 /* RSSI in dBm */
3315 int32_t rssi;
3316
3317 /* RTT in nanoseconds */
3318 uint32_t rtt;
3319
3320 /* Standard deviation in rtt */
3321 uint32_t rtt_sd;
3322
3323 /* Period advertised in the beacon */
3324 uint16_t beaconPeriod;
3325
3326 /* Capabilities advertised in the beacon */
3327 uint16_t capability;
3328
3329 uint16_t ieLength;
3330
3331 uint8_t ieData[];
3332} tSirWifiScanResult, *tpSirWifiScanResult;
3333
3334/**
3335 * struct extscan_hotlist_match - extscan hotlist match
3336 * @requestId: request identifier
3337 * @numOfAps: number of bssids retrieved by the scan
3338 * @moreData: 0 - for last fragment
3339 * 1 - still more fragment(s) coming
3340 * @ap: wifi scan result
3341 */
3342struct extscan_hotlist_match {
3343 uint32_t requestId;
3344 bool moreData;
3345 bool ap_found;
3346 uint32_t numOfAps;
3347 tSirWifiScanResult ap[];
3348};
3349
3350/**
3351 * struct extscan_cached_scan_result - extscan cached scan result
3352 * @scan_id: a unique identifier for the scan unit
3353 * @flags: a bitmask with additional information about scan
3354 * @num_results: number of bssids retrieved by the scan
Mukul Sharmaf7cb3ab2016-08-12 19:53:52 +05303355 * @buckets_scanned: bitmask of buckets scanned in current extscan cycle
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003356 * @ap: wifi scan bssid results info
3357 */
3358struct extscan_cached_scan_result {
3359 uint32_t scan_id;
3360 uint32_t flags;
3361 uint32_t num_results;
Mukul Sharmaf7cb3ab2016-08-12 19:53:52 +05303362 uint32_t buckets_scanned;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003363 tSirWifiScanResult *ap;
3364};
3365
3366/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003367 * struct extscan_cached_scan_results - extscan cached scan results
3368 * @request_id: request identifier
3369 * @more_data: 0 - for last fragment
3370 * 1 - still more fragment(s) coming
3371 * @num_scan_ids: number of scan ids
3372 * @result: wifi scan result
3373 */
3374struct extscan_cached_scan_results {
3375 uint32_t request_id;
3376 bool more_data;
3377 uint32_t num_scan_ids;
3378 struct extscan_cached_scan_result *result;
3379};
3380
3381
3382/**
3383 * struct tSirWifiFullScanResultEvent - extscan full scan event
3384 * @request_id: request identifier
3385 * @moreData: 0 - for last fragment
3386 * 1 - still more fragment(s) coming
3387 * @ap: bssid info
3388 *
Jeff Johnsondab58602018-07-14 15:30:24 -07003389 * Reported when each probe response is received, if report_events
3390 * enabled in struct wifi_scan_cmd_req_params
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003391 */
3392typedef struct {
3393 uint32_t requestId;
3394 bool moreData;
3395 tSirWifiScanResult ap;
3396} tSirWifiFullScanResultEvent, *tpSirWifiFullScanResultEvent;
3397
3398/**
3399 * struct pno_match_found - epno match found
3400 * @request_id: request identifier
3401 * @moreData: 0 - for last fragment
3402 * 1 - still more fragment(s) coming
3403 * @num_results: number of bssids, driver sends this event to upper layer
3404 * for every beacon, hence %num_results is always set to 1.
3405 * @ap: bssid info
3406 *
3407 * Reported when each beacon probe response is received with
3408 * epno match found tag.
3409 */
3410struct pno_match_found {
3411 uint32_t request_id;
3412 bool more_data;
3413 uint32_t num_results;
3414 tSirWifiScanResult ap[];
3415};
3416
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003417/**
3418 * struct sir_extscan_generic_response -
3419 * Generic ExtScan Response structure
3420 * @request_id: ID of the request
3421 * @status: operation status returned by firmware
3422 */
3423struct sir_extscan_generic_response {
3424 uint32_t request_id;
3425 uint32_t status;
3426};
3427
3428typedef struct {
Anurag Chouhan6d760662016-02-20 16:05:43 +05303429 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003430 uint32_t channel;
3431 uint32_t numOfRssi;
3432
3433 /* Rssi history in db */
3434 int32_t rssi[];
3435} tSirWifiSignificantChange, *tpSirWifiSignificantChange;
3436
3437typedef struct {
3438 uint32_t requestId;
3439
3440 bool moreData;
3441 uint32_t numResults;
3442 tSirWifiSignificantChange ap[];
3443} tSirWifiSignificantChangeEvent, *tpSirWifiSignificantChangeEvent;
3444
3445typedef struct {
3446 uint32_t requestId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003447 uint32_t numResultsAvailable;
3448} tSirExtScanResultsAvailableIndParams, *tpSirExtScanResultsAvailableIndParams;
3449
3450typedef struct {
3451 uint32_t requestId;
3452 uint32_t status;
3453 uint8_t scanEventType;
Mukul Sharmafa937be2016-08-12 18:13:36 +05303454 uint32_t buckets_scanned;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003455} tSirExtScanOnScanEventIndParams, *tpSirExtScanOnScanEventIndParams;
3456
Mukul Sharmae8c919f2016-10-02 20:35:15 +05303457#define MAX_EPNO_NETWORKS 64
3458
Jeff Johnson96f93a32016-11-18 11:02:24 -08003459#define SIR_PASSPOINT_LIST_MAX_NETWORKS 8
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003460
3461/**
3462 * struct wifi_passpoint_match - wifi passpoint network match
3463 * @id: network block identifier for the matched network
3464 * @anqp_len: length of ANQP blob
3465 * @ap: scan result, with channel and beacon information
3466 * @anqp: ANQP data, in the information_element format
3467 */
3468struct wifi_passpoint_match {
3469 uint32_t request_id;
3470 uint32_t id;
3471 uint32_t anqp_len;
3472 tSirWifiScanResult ap;
3473 uint8_t anqp[];
3474};
3475#endif /* FEATURE_WLAN_EXTSCAN */
3476
3477#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
Jeff Johnsona9ade7d2019-02-17 10:08:17 -08003478struct auto_shutdown_cmd {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003479 uint32_t timer_val;
Jeff Johnsona9ade7d2019-02-17 10:08:17 -08003480};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003481#endif
3482
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05303483#ifdef WLAN_POWER_DEBUGFS
3484/**
3485 * struct power_stats_response - Power stats response
3486 * @cumulative_sleep_time_ms: cumulative sleep time in ms
3487 * @cumulative_total_on_time_ms: total awake time in ms
3488 * @deep_sleep_enter_counter: deep sleep enter counter
3489 * @last_deep_sleep_enter_tstamp_ms: last deep sleep enter timestamp
3490 * @debug_register_fmt: debug registers format
3491 * @num_debug_register: number of debug registers
3492 * @debug_registers: Pointer to the debug registers buffer
3493 */
3494struct power_stats_response {
3495 uint32_t cumulative_sleep_time_ms;
3496 uint32_t cumulative_total_on_time_ms;
3497 uint32_t deep_sleep_enter_counter;
3498 uint32_t last_deep_sleep_enter_tstamp_ms;
3499 uint32_t debug_register_fmt;
3500 uint32_t num_debug_register;
3501 uint32_t *debug_registers;
3502};
3503#endif
3504
Arunk Khandavallica56d4b2018-11-29 15:46:00 +05303505#ifdef WLAN_FEATURE_BEACON_RECEPTION_STATS
3506#define MAX_BCNMISS_BITMAP 8
3507/**
3508 * struct bcn_reception_stats_rsp - beacon stats response
3509 * @total_bcn_cnt: total beacon count (tbtt instances)
3510 * @total_bmiss_cnt: Total beacon miss count in last 255 beacons, max 255
3511 * @bmiss_bitmap: This bitmap indicates the status of the last 255 beacons.
3512 * If a bit is set, that means the corresponding beacon was missed.
3513 * Bit 0 of bmiss_bitmap[0] represents the most recent beacon.
3514 * The total_bcn_cnt field indicates how many bits within bmiss_bitmap
3515 * are valid.
3516 */
3517struct bcn_reception_stats_rsp {
3518 uint32_t vdev_id;
3519 uint32_t total_bcn_cnt;
3520 uint32_t total_bmiss_cnt;
3521 uint32_t bmiss_bitmap[MAX_BCNMISS_BITMAP];
3522};
3523#endif
3524
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +05303525/**
3526 * struct lfr_firmware_status - LFR status in firmware
3527 * @is_disabled: Is LFR disabled in FW
3528 * @disable_lfr_event: Disable attempt done in FW
3529 */
3530struct lfr_firmware_status {
3531 uint32_t is_disabled;
3532 struct completion disable_lfr_event;
3533};
3534
3535/**
3536 * struct rso_cmd_status - RSO Command status
3537 * @vdev_id: Vdev ID for which RSO command sent
3538 * @status: Status of RSO command sent to FW
3539 */
3540struct rso_cmd_status {
3541 uint32_t vdev_id;
3542 bool status;
3543};
3544
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003545enum {
3546 SIR_AP_RX_DATA_OFFLOAD = 0x00,
3547 SIR_STA_RX_DATA_OFFLOAD = 0x01,
3548};
3549
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07003550/**
Naveen Rawata410c5a2016-09-19 14:22:33 -07003551 * struct sir_set_vdev_ies_per_band
3552 * @msg_type: message type
3553 * @len: message length
3554 * @vdev_id: vdev id
3555 *
3556 * Message wrapper structure for eWNI_SME_SET_VDEV_IES_PER_BAND.
3557 */
3558struct sir_set_vdev_ies_per_band {
3559 uint16_t msg_type;
3560 uint16_t len;
3561 uint32_t vdev_id;
3562};
3563
3564/**
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07003565 * struct sir_set_ht_vht_cfg - ht, vht IE config
3566 * @msg_type: message type
3567 * @len: message length
3568 * @pdev_id: pdev id
3569 * @nss: Nss value
3570 * @dot11mode: Dot11 mode.
3571 *
3572 * Message wrapper structure for set HT/VHT IE req.
3573 */
3574struct sir_set_ht_vht_cfg {
3575 uint16_t msg_type;
3576 uint16_t len;
3577 uint32_t pdev_id;
3578 uint32_t nss;
3579 uint32_t dot11mode;
3580};
3581
Qiwei Cai3719efe2018-06-11 21:09:29 +08003582#define WIFI_INVALID_PEER_ID (-1)
3583#define WIFI_INVALID_VDEV_ID (-1)
3584#define WIFI_MAX_AC (4)
3585
3586typedef struct {
3587 uint32_t paramId;
3588 uint8_t ifaceId;
3589 uint32_t rspId;
3590 uint32_t moreResultToFollow;
3591 uint32_t nr_received;
3592 union {
3593 uint32_t num_peers;
3594 uint32_t num_radio;
3595 };
3596
3597 uint32_t peer_event_number;
3598 /* Variable length field - Do not add anything after this */
3599 uint8_t results[0];
3600} tSirLLStatsResults, *tpSirLLStatsResults;
3601
3602#ifdef WLAN_FEATURE_LINK_LAYER_STATS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003603/*---------------------------------------------------------------------------
3604 WLAN_HAL_LL_NOTIFY_STATS
3605 ---------------------------------------------------------------------------*/
3606
3607/******************************LINK LAYER Statistics**********************/
3608
3609typedef int tSirWifiRadio;
3610typedef int tSirWifiChannel;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003611
Qiwei Cai3719efe2018-06-11 21:09:29 +08003612typedef struct {
3613 uint32_t reqId;
3614 uint8_t staId;
3615 uint32_t mpduSizeThreshold;
3616 uint32_t aggressiveStatisticsGathering;
3617} tSirLLStatsSetReq, *tpSirLLStatsSetReq;
3618
3619typedef struct {
3620 uint32_t reqId;
3621 uint8_t staId;
3622 uint32_t paramIdMask;
3623} tSirLLStatsGetReq, *tpSirLLStatsGetReq;
3624
3625typedef struct {
3626 uint32_t reqId;
3627 uint8_t staId;
3628 uint32_t statsClearReqMask;
3629 uint8_t stopReq;
3630} tSirLLStatsClearReq, *tpSirLLStatsClearReq;
3631
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003632/* channel operating width */
3633typedef enum {
3634 WIFI_CHAN_WIDTH_20 = 0,
3635 WIFI_CHAN_WIDTH_40 = 1,
3636 WIFI_CHAN_WIDTH_80 = 2,
3637 WIFI_CHAN_WIDTH_160 = 3,
3638 WIFI_CHAN_WIDTH_80P80 = 4,
3639 WIFI_CHAN_WIDTH_5 = 5,
3640 WIFI_CHAN_WIDTH_10 = 6,
3641} tSirWifiChannelWidth;
3642
3643typedef enum {
3644 WIFI_DISCONNECTED = 0,
3645 WIFI_AUTHENTICATING = 1,
3646 WIFI_ASSOCIATING = 2,
3647 WIFI_ASSOCIATED = 3,
3648 WIFI_EAPOL_STARTED = 4, /* if done by firmware/driver */
3649 WIFI_EAPOL_COMPLETED = 5, /* if done by firmware/driver */
3650} tSirWifiConnectionState;
3651
3652typedef enum {
3653 WIFI_ROAMING_IDLE = 0,
3654 WIFI_ROAMING_ACTIVE = 1,
3655} tSirWifiRoamState;
3656
3657typedef enum {
3658 WIFI_INTERFACE_STA = 0,
3659 WIFI_INTERFACE_SOFTAP = 1,
3660 WIFI_INTERFACE_IBSS = 2,
3661 WIFI_INTERFACE_P2P_CLIENT = 3,
3662 WIFI_INTERFACE_P2P_GO = 4,
3663 WIFI_INTERFACE_NAN = 5,
3664 WIFI_INTERFACE_MESH = 6,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -07003665 WIFI_INTERFACE_NDI = 7,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003666} tSirWifiInterfaceMode;
3667
3668/* set for QOS association */
3669#define WIFI_CAPABILITY_QOS 0x00000001
3670/* set for protected assoc (802.11 beacon frame control protected bit set) */
3671#define WIFI_CAPABILITY_PROTECTED 0x00000002
3672/* set if 802.11 Extended Capabilities element interworking bit is set */
3673#define WIFI_CAPABILITY_INTERWORKING 0x00000004
3674/* set for HS20 association */
3675#define WIFI_CAPABILITY_HS20 0x00000008
3676/* set is 802.11 Extended Capabilities element UTF-8 SSID bit is set */
3677#define WIFI_CAPABILITY_SSID_UTF8 0x00000010
3678/* set is 802.11 Country Element is present */
3679#define WIFI_CAPABILITY_COUNTRY 0x00000020
3680
3681typedef struct {
3682 /* tSirWifiInterfaceMode */
3683 /* interface mode */
3684 uint8_t mode;
3685 /* interface mac address (self) */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303686 struct qdf_mac_addr macAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003687 /* tSirWifiConnectionState */
3688 /* connection state (valid for STA, CLI only) */
3689 uint8_t state;
3690 /* tSirWifiRoamState */
3691 /* roaming state */
3692 uint32_t roaming;
3693 /* WIFI_CAPABILITY_XXX (self) */
3694 uint32_t capabilities;
3695 /* null terminated SSID */
3696 uint8_t ssid[33];
3697 /* bssid */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303698 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003699 /* country string advertised by AP */
Wu Gaoaa155142019-01-14 15:09:26 +08003700 uint8_t apCountryStr[CFG_COUNTRY_CODE_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003701 /* country string for this association */
Wu Gaoaa155142019-01-14 15:09:26 +08003702 uint8_t countryStr[CFG_COUNTRY_CODE_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003703} tSirWifiInterfaceInfo, *tpSirWifiInterfaceInfo;
3704
3705/* channel information */
3706typedef struct {
3707 /* channel width (20, 40, 80, 80+80, 160) */
3708 tSirWifiChannelWidth width;
3709 /* primary 20 MHz channel */
3710 tSirWifiChannel centerFreq;
3711 /* center frequency (MHz) first segment */
3712 tSirWifiChannel centerFreq0;
3713 /* center frequency (MHz) second segment */
3714 tSirWifiChannel centerFreq1;
3715} tSirWifiChannelInfo, *tpSirWifiChannelInfo;
3716
3717/* wifi rate info */
3718typedef struct {
3719 /* 0: OFDM, 1:CCK, 2:HT 3:VHT 4..7 reserved */
3720 uint32_t preamble:3;
3721 /* 0:1x1, 1:2x2, 3:3x3, 4:4x4 */
3722 uint32_t nss:2;
3723 /* 0:20MHz, 1:40Mhz, 2:80Mhz, 3:160Mhz */
3724 uint32_t bw:3;
3725 /* OFDM/CCK rate code would be as per ieee std in units of 0.5mbps */
3726 /* HT/VHT it would be mcs index */
3727 uint32_t rateMcsIdx:8;
3728 /* reserved */
3729 uint32_t reserved:16;
3730 /* units of 100 Kbps */
3731 uint32_t bitrate;
3732} tSirWifiRate, *tpSirWifiRate;
3733
3734/* channel statistics */
3735typedef struct {
3736 /* channel */
3737 tSirWifiChannelInfo channel;
3738 /* msecs the radio is awake (32 bits number accruing over time) */
3739 uint32_t onTime;
3740 /* msecs the CCA register is busy (32 bits number accruing over time) */
3741 uint32_t ccaBusyTime;
3742} tSirWifiChannelStats, *tpSirWifiChannelStats;
3743
Srinivas Girigowda458f2282016-10-25 11:27:52 -07003744#define MAX_TPC_LEVELS 64
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003745/* radio statistics */
3746typedef struct {
3747 /* wifi radio (if multiple radio supported) */
3748 tSirWifiRadio radio;
3749 /* msecs the radio is awake (32 bits number accruing over time) */
3750 uint32_t onTime;
3751 /* msecs the radio is transmitting
3752 * (32 bits number accruing over time)
3753 */
3754 uint32_t txTime;
3755 /* msecs the radio is in active receive
3756 *(32 bits number accruing over time)
3757 */
3758 uint32_t rxTime;
3759 /* msecs the radio is awake due to all scan
3760 * (32 bits number accruing over time)
3761 */
3762 uint32_t onTimeScan;
3763 /* msecs the radio is awake due to NAN
3764 * (32 bits number accruing over time)
3765 */
3766 uint32_t onTimeNbd;
3767 /* msecs the radio is awake due to Gscan
3768 * (32 bits number accruing over time)
3769 */
3770 uint32_t onTimeGscan;
3771 /* msecs the radio is awake due to roam?scan
3772 * (32 bits number accruing over time)
3773 */
3774 uint32_t onTimeRoamScan;
3775 /* msecs the radio is awake due to PNO scan
3776 * (32 bits number accruing over time)
3777 */
3778 uint32_t onTimePnoScan;
3779 /* msecs the radio is awake due to HS2.0 scans and GAS exchange
3780 * (32 bits number accruing over time)
3781 */
3782 uint32_t onTimeHs20;
Srinivas Girigowdaad874a82016-10-25 14:08:00 -07003783
3784 /* tx time (in milliseconds) per TPC level (0.5 dBm) */
3785 uint32_t total_num_tx_power_levels;
3786 uint32_t *tx_time_per_power_level;
3787
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003788 /* number of channels */
3789 uint32_t numChannels;
Srinivas Girigowda458f2282016-10-25 11:27:52 -07003790
3791 /* tx time (in milliseconds) per TPC level (0.5 dBm) */
3792 uint32_t tx_time_per_tpc[MAX_TPC_LEVELS];
3793
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08003794 uint32_t on_time_host_scan;
3795 uint32_t on_time_lpi_scan;
3796
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003797 /* channel statistics tSirWifiChannelStats */
Srinivas Girigowda57b450e2016-10-27 21:00:46 -07003798 tSirWifiChannelStats *channels;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003799} tSirWifiRadioStat, *tpSirWifiRadioStat;
3800
3801/* per rate statistics */
3802typedef struct {
3803 /* rate information */
3804 tSirWifiRate rate;
3805 /* number of successfully transmitted data pkts (ACK rcvd) */
3806 uint32_t txMpdu;
3807 /* number of received data pkts */
3808 uint32_t rxMpdu;
3809 /* number of data packet losses (no ACK) */
3810 uint32_t mpduLost;
3811 /* total number of data pkt retries * */
3812 uint32_t retries;
3813 /* number of short data pkt retries */
3814 uint32_t retriesShort;
3815 /* number of long data pkt retries */
3816 uint32_t retriesLong;
3817} tSirWifiRateStat, *tpSirWifiRateStat;
3818
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003819/* wifi peer type */
3820typedef enum {
3821 WIFI_PEER_STA,
3822 WIFI_PEER_AP,
3823 WIFI_PEER_P2P_GO,
3824 WIFI_PEER_P2P_CLIENT,
3825 WIFI_PEER_NAN,
3826 WIFI_PEER_TDLS,
3827 WIFI_PEER_INVALID,
3828} tSirWifiPeerType;
3829
3830/* per peer statistics */
3831typedef struct {
3832 /* peer type (AP, TDLS, GO etc.) */
Dustin Brown877a5a92016-11-17 13:56:52 -08003833 enum wmi_peer_type type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003834 /* mac address */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303835 struct qdf_mac_addr peerMacAddress;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003836 /* peer WIFI_CAPABILITY_XXX */
3837 uint32_t capabilities;
Zhang Qiana6e9c102016-12-22 16:47:24 +08003838 union {
3839 /* peer power saving mode */
3840 uint32_t power_saving;
3841 /* number of rates */
3842 uint32_t numRate;
3843 };
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003844 /* per rate statistics, number of entries = num_rate */
3845 tSirWifiRateStat rateStats[0];
3846} tSirWifiPeerInfo, *tpSirWifiPeerInfo;
3847
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003848/* Interface statistics - corresponding to 2nd most
3849 * LSB in wifi statistics bitmap for getting statistics
3850 */
3851typedef struct {
3852 /* current state of the interface */
3853 tSirWifiInterfaceInfo info;
Min Liuffb250d2018-07-11 17:35:32 +08003854
gaolezb432ed92017-03-16 18:40:04 +08003855 uint32_t rts_succ_cnt;
3856 uint32_t rts_fail_cnt;
3857 uint32_t ppdu_succ_cnt;
3858 uint32_t ppdu_fail_cnt;
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08003859
Min Liuffb250d2018-07-11 17:35:32 +08003860 /* link statistics */
3861 wmi_iface_link_stats link_stats;
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08003862
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003863 /* per ac data packet statistics */
Min Liuffb250d2018-07-11 17:35:32 +08003864 wmi_wmm_ac_stats ac_stats[WIFI_AC_MAX];
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08003865
3866 uint32_t num_offload_stats;
Min Liuffb250d2018-07-11 17:35:32 +08003867 wmi_iface_offload_stats offload_stats[WMI_OFFLOAD_STATS_TYPE_MAX];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003868} tSirWifiIfaceStat, *tpSirWifiIfaceStat;
3869
3870/* Peer statistics - corresponding to 3rd most LSB in
3871 * wifi statistics bitmap for getting statistics
3872 */
3873typedef struct {
3874 /* number of peers */
3875 uint32_t numPeers;
3876 /* per peer statistics */
3877 tSirWifiPeerInfo peerInfo[0];
3878} tSirWifiPeerStat, *tpSirWifiPeerStat;
3879
3880/* wifi statistics bitmap for getting statistics */
3881#define WMI_LINK_STATS_RADIO 0x00000001
3882#define WMI_LINK_STATS_IFACE 0x00000002
3883#define WMI_LINK_STATS_ALL_PEER 0x00000004
3884#define WMI_LINK_STATS_PER_PEER 0x00000008
3885
3886/* wifi statistics bitmap for clearing statistics */
3887/* all radio statistics */
3888#define WIFI_STATS_RADIO 0x00000001
3889/* cca_busy_time (within radio statistics) */
3890#define WIFI_STATS_RADIO_CCA 0x00000002
3891/* all channel statistics (within radio statistics) */
3892#define WIFI_STATS_RADIO_CHANNELS 0x00000004
3893/* all scan statistics (within radio statistics) */
3894#define WIFI_STATS_RADIO_SCAN 0x00000008
3895/* all interface statistics */
3896#define WIFI_STATS_IFACE 0x00000010
3897/* all tx rate statistics (within interface statistics) */
3898#define WIFI_STATS_IFACE_TXRATE 0x00000020
3899/* all ac statistics (within interface statistics) */
3900#define WIFI_STATS_IFACE_AC 0x00000040
3901/* all contention (min, max, avg) statistics (within ac statistics) */
3902#define WIFI_STATS_IFACE_CONTENTION 0x00000080
Mukul Sharma491021c2016-09-29 21:39:19 +05303903/* All peer stats on this interface */
3904#define WIFI_STATS_IFACE_ALL_PEER 0x00000100
3905/* Clear particular peer stats depending on the peer_mac */
3906#define WIFI_STATS_IFACE_PER_PEER 0x00000200
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003907
Zhang Qiana6e9c102016-12-22 16:47:24 +08003908/**
3909 * struct sir_wifi_iface_tx_fail - TX failure event
3910 * @tid: TX TID
3911 * @msdu_num: TX MSDU failed counter
3912 * @status: TX status from HTT message.
3913 * Only failure status will be involved.
3914 */
3915struct sir_wifi_iface_tx_fail {
3916 uint8_t tid;
3917 uint16_t msdu_num;
3918 enum htt_tx_status status;
3919};
3920
Zhang Qian73c348a2017-03-13 16:15:55 +08003921/**
3922 * struct sir_wifi_chan_cca_stats - channal CCA stats
3923 * @vdev_id: vdev ID
3924 * @idle_time: percentage of idle time, no TX, no RX, no interference
3925 * @tx_time: percentage of time transmitting packets
3926 * @rx_in_bss_time: percentage of time receiving packets in current BSS
3927 * @rx_out_bss_time: percentage of time receiving packets not in current BSS
3928 * @rx_busy_time: percentage of time interference detected
3929 * @rx_in_bad_cond_time: percentage of time receiving packets with errors
3930 * or packets flagged as retransmission or seqnum discontinued.
3931 * @tx_in_bad_cond_time: percentage of time the device transmitted packets
3932 * that haven't been ACKed.
3933 * @wlan_not_avail_time: percentage of time the chip is unable to
3934 * work in normal conditions.
3935 */
3936struct sir_wifi_chan_cca_stats {
3937 uint32_t vdev_id;
3938 uint32_t idle_time;
3939 uint32_t tx_time;
3940 uint32_t rx_in_bss_time;
3941 uint32_t rx_out_bss_time;
3942 uint32_t rx_busy_time;
3943 uint32_t rx_in_bad_cond_time;
3944 uint32_t tx_in_bad_cond_time;
3945 uint32_t wlan_not_avail_time;
3946};
3947
3948#define WIFI_MAX_CHAINS 8
3949
3950/**
3951 * struct sir_wifi_peer_signal_stats - peer signal stats
3952 * @vdev_id: vdev ID
3953 * @peer_id: peer ID
3954 * @per_ant_snr: per antenna SNR
3955 * @nf: peer background noise
Zhang Qian303ebe92017-05-18 13:59:07 +08003956 * @per_ant_rx_mpdus: MPDUs received per antenna
3957 * @per_ant_tx_mpdus: MPDUs transferred per antenna
3958 * @num_chain: valid chain count
Zhang Qian73c348a2017-03-13 16:15:55 +08003959 */
3960struct sir_wifi_peer_signal_stats {
3961 uint32_t vdev_id;
3962 uint32_t peer_id;
3963
3964 /* per antenna SNR in current bss */
3965 int32_t per_ant_snr[WIFI_MAX_CHAINS];
3966
3967 /* Background noise */
3968 int32_t nf[WIFI_MAX_CHAINS];
Zhang Qian303ebe92017-05-18 13:59:07 +08003969
3970 int32_t per_ant_rx_mpdus[WIFI_MAX_CHAINS];
3971 int32_t per_ant_tx_mpdus[WIFI_MAX_CHAINS];
3972 int32_t num_chain;
Zhang Qian73c348a2017-03-13 16:15:55 +08003973};
3974
3975#define WIFI_VDEV_NUM 4
3976#define WFIF_MCS_NUM 10
3977#define WIFI_AGGR_NUM 8
3978#define WIFI_DELAY_SIZE 11
3979
3980/**
3981 * struct sir_wifi_tx - per AC tx stats
3982 * @msdus: number of totoal MSDUs on MAC layer in the period
3983 * @mpdus: number of totoal MPDUs on MAC layer in the period
3984 * @ppdus: number of totoal PPDUs on PHY layer in the period
3985 * @bytes: bytes of tx data on MAC layer in the period
3986 * @drops: number of TX packets cancelled due to any reason in the period,
3987 * such as WMM limitation/bandwidth limitation/radio congestion
3988 * @drop_bytes: bytes of dropped TX packets in the period
3989 * @retries: number of unacked transmissions of MPDUs
3990 * @failed: number of packets have not been ACKed despite retried
3991 * @aggr_len: length of the MPDU aggregation size buffer
3992 * @mpdu_aggr_size: histogram of MPDU aggregation size
3993 * @success_mcs_len: length of success mcs buffer
3994 * @success_mcs: histogram of successed received MPDUs encoding rate
3995 * @fail_mcs_len: length of failed mcs buffer
3996 * @fail_mcs: histogram of failed received MPDUs encoding rate
3997 * @delay_len: length of the delay histofram buffer
3998 * @delay: histogram of delays on MAC layer
3999 */
4000struct sir_wifi_tx {
4001 uint32_t msdus;
4002 uint32_t mpdus;
4003 uint32_t ppdus;
4004 uint32_t bytes;
4005 uint32_t drops;
4006 uint32_t drop_bytes;
4007 uint32_t retries;
4008 uint32_t failed;
4009 uint32_t aggr_len;
4010 uint32_t *mpdu_aggr_size;
4011 uint32_t success_mcs_len;
4012 uint32_t *success_mcs;
4013 uint32_t fail_mcs_len;
4014 uint32_t *fail_mcs;
4015 uint32_t delay_len;
4016 uint32_t *delay;
4017};
4018
4019/**
4020 * struct sir_wifi_rx - per AC rx stats
4021 * @mpdus: number of RX packets on MAC layer
4022 * @bytes: bytes of RX packets on MAC layer
4023 * @ppdus: number of RX packets on PHY layer
4024 * @ppdu_bytes: bytes of RX packets on PHY layer
4025 * @mpdu_lost: number of discontinuity in seqnum
4026 * @mpdu_retry: number of RX packets flagged as retransmissions
4027 * @mpdu_dup: number of RX packets identified as duplicates
4028 * @mpdu_discard: number of RX packets discarded
4029 * @aggr_len: length of MPDU aggregation histogram buffer
4030 * @mpdu_aggr: histogram of MPDU aggregation size
4031 * @mcs_len: length of mcs histogram buffer
4032 * @mcs: histogram of encoding rate.
4033 */
4034struct sir_wifi_rx {
4035 uint32_t mpdus;
4036 uint32_t bytes;
4037 uint32_t ppdus;
4038 uint32_t ppdu_bytes;
4039 uint32_t mpdu_lost;
4040 uint32_t mpdu_retry;
4041 uint32_t mpdu_dup;
4042 uint32_t mpdu_discard;
4043 uint32_t aggr_len;
4044 uint32_t *mpdu_aggr;
4045 uint32_t mcs_len;
4046 uint32_t *mcs;
4047};
4048
4049/**
4050 * struct sir_wifi_ll_ext_wmm_ac_stats - stats for WMM AC
4051 * @type: WMM AC type
4052 * @tx_stats: pointer to TX stats
4053 * @rx_stats: pointer to RX stats
4054 */
4055struct sir_wifi_ll_ext_wmm_ac_stats {
4056 uint32_t type;
4057 struct sir_wifi_tx *tx_stats;
4058 struct sir_wifi_rx *rx_stats;
4059};
4060
Zhang Qian73c348a2017-03-13 16:15:55 +08004061/**
4062 * struct sir_wifi_ll_ext_peer_stats - per peer stats
4063 * @peer_id: peer ID
4064 * @vdev_id: VDEV ID
4065 * mac_address: MAC address
4066 * @sta_ps_inds: how many times STAs go to sleep
4067 * @sta_ps_durs: total sleep time of STAs (units in ms)
4068 * @rx_probe_reqs: number of probe requests received
4069 * @rx_oth_mgmts: number of other management frames received,
4070 * not including probe requests
4071 * @peer_signal_stat: signal stats
4072 * @ac_stats: WMM BE/BK/VI/VO stats
4073 */
4074struct sir_wifi_ll_ext_peer_stats {
4075 uint32_t peer_id;
4076 uint32_t vdev_id;
4077 tSirMacAddr mac_address;
4078 uint32_t sta_ps_inds;
4079 uint32_t sta_ps_durs;
4080 uint32_t rx_probe_reqs;
4081 uint32_t rx_oth_mgmts;
4082 struct sir_wifi_peer_signal_stats peer_signal_stats;
4083 struct sir_wifi_ll_ext_wmm_ac_stats ac_stats[WIFI_MAX_AC];
4084};
4085
4086/**
4087 * struct sir_wifi_ll_ext_stats - link layer stats report
4088 * @trigger_cond_id: Indicate what triggered this event.
4089 * 1: timeout. 2: threshold
4090 * @cca_chgd_bitmap: Bitmap to indicate changed channel CCA stats
4091 * which exceeded the thresholds
4092 * @sig_chgd_bitmap: Bitmap to indicate changed peer signal stats
4093 * which exceeded the thresholds
4094 * @tx_chgd_bitmap: Bitmap to indicate changed TX counters
4095 * which exceeded the thresholds
4096 * @rx_chgd_bitmap: Bitmap to indicate changed RX counters
4097 * which exceeded the thresholds
4098 * @chan_cca_stats: channel CCA stats
4099 * @peer_signal_stats: peer signal stats
4100 * @tx_mpdu_aggr_array_len: length of TX MPDU aggregation buffer
4101 * @tx_succ_mcs_array_len: length of mcs buffer for ACKed MPDUs
4102 * @tx_fail_mcs_array_len: length of mcs buffer for no-ACKed MPDUs
4103 * @tx_delay_array_len: length of delay stats buffer
4104 * @rx_mpdu_aggr_array_len: length of RX MPDU aggregation buffer
4105 * @rx_mcs_array_len: length of RX mcs stats buffer
4106 * @peer_stats: peer stats
4107 * @cca: physical channel CCA stats
4108 * @stats: pointer to stats data buffer.
4109 *
4110 * Structure of the whole statictics is like this:
4111 * ---------------------------------
4112 * | trigger_cond_i |
4113 * +-------------------------------+
4114 * | cca_chgd_bitmap |
4115 * +-------------------------------+
4116 * | sig_chgd_bitmap |
4117 * +-------------------------------+
4118 * | tx_chgd_bitmap |
4119 * +-------------------------------+
4120 * | rx_chgd_bitmap |
4121 * +-------------------------------+
4122 * | peer_num |
4123 * +-------------------------------+
4124 * | channel_num |
4125 * +-------------------------------+
4126 * | tx_mpdu_aggr_array_len |
4127 * +-------------------------------+
4128 * | tx_succ_mcs_array_len |
4129 * +-------------------------------+
4130 * | tx_fail_mcs_array_len |
4131 * +-------------------------------+
4132 * | tx_delay_array_len |
4133 * +-------------------------------+
4134 * | rx_mpdu_aggr_array_len |
4135 * +-------------------------------+
4136 * | rx_mcs_array_len |
4137 * +-------------------------------+
4138 * | pointer to CCA stats |
4139 * +-------------------------------+
4140 * | pointer to peer stats |
4141 * +-------------------------------+
4142 * | CCA stats |
4143 * +-------------------------------+
4144 * | peer_stats |----+
4145 * +-------------------------------+ |
4146 * | per peer signals stats |<---+
4147 * | peer0 ~ peern | |
4148 * +-------------------------------+ |
4149 * | TX aggr/mcs parameters array | |
4150 * | Length of this buffer is | |
4151 * | configurable for user layer. |<-+ |
4152 * +-------------------------------+ | |
4153 * | per peer tx stats |--+ |
4154 * | BE | <--+
4155 * | BK | |
4156 * | VI | |
4157 * | VO | |
4158 * +-------------------------------+ |
4159 * | TX aggr/mcs parameters array | |
4160 * | Length of this buffer is | |
4161 * | configurable for user layer. |<-+ |
4162 * +-------------------------------+ | |
4163 * | peer peer rx stats |--+ |
4164 * | BE | <--+
4165 * | BE |
4166 * | BK |
4167 * | VI |
4168 * | VO |
4169 * ---------------------------------
4170 */
4171struct sir_wifi_ll_ext_stats {
4172 uint32_t trigger_cond_id;
4173 uint32_t cca_chgd_bitmap;
4174 uint32_t sig_chgd_bitmap;
4175 uint32_t tx_chgd_bitmap;
4176 uint32_t rx_chgd_bitmap;
4177 uint8_t peer_num;
4178 uint8_t channel_num;
4179 uint32_t tx_mpdu_aggr_array_len;
4180 uint32_t tx_succ_mcs_array_len;
4181 uint32_t tx_fail_mcs_array_len;
4182 uint32_t tx_delay_array_len;
4183 uint32_t rx_mpdu_aggr_array_len;
4184 uint32_t rx_mcs_array_len;
4185 struct sir_wifi_ll_ext_peer_stats *peer_stats;
4186 struct sir_wifi_chan_cca_stats *cca;
4187 uint8_t stats[];
4188};
4189
4190/**
4191 * struct sir_channel_cca_threshold - threshold for channel CCA
4192 * @idle_time: idle time, no TX, no RX, no interference
4193 * @tx_time: time transmitting packets
4194 * @rx_in_bss_time: time receiving packets in current BSSs
4195 * @rx_out_bss_time: time receiving packets not in current BSSs
4196 * @rx_busy_time: time interference detected
4197 * @rx_in_bad_cond_time: receiving packets with errors
4198 * @tx_in_bad_cond_time: time transmitted packets not been ACKed
4199 * @wlan_not_avail_time: wlan card cannot work
4200 */
4201struct sir_channel_cca_threshold {
4202 uint32_t idle_time;
4203 uint32_t tx_time;
4204 uint32_t rx_in_bss_time;
4205 uint32_t rx_out_bss_time;
4206 uint32_t rx_busy_time;
4207 uint32_t rx_in_bad_cond_time;
4208 uint32_t tx_in_bad_cond_time;
4209 uint32_t wlan_not_avail_time;
4210};
4211
4212/**
4213 * struct sir_signal_threshold - threshold for per peer sigbal
4214 * @snr: signal to noise rate
4215 * @nf: noise floor
4216 */
4217struct sir_signal_threshold {
4218 uint32_t snr;
4219 uint32_t nf;
4220};
4221
4222/**
4223 * struct sir_tx_threshold - threshold for TX
4224 * @msdu: TX MSDUs on MAC layer
4225 * @mpdu: TX MPDUs on MAC layer
4226 * @ppdu: TX PPDUs on MAC layer
4227 * @bytes: TX bytes on MAC layer
4228 * @msdu_drop: drooped MSDUs
4229 * @byte_drop: dropped Bytes
4230 * @mpdu_retry: MPDU not acked
4231 * @ppdu_fail: PPDUs which received no block ack
4232 * @aggregation: aggregation size
4233 * @succ_mcs: histogram of encoding rate for acked PPDUs
4234 * @fail_mcs: histogram of encoding rate for no-acked PPDUs
4235 */
4236struct sir_tx_threshold {
4237 uint32_t msdu;
4238 uint32_t mpdu;
4239 uint32_t ppdu;
4240 uint32_t bytes;
4241 uint32_t msdu_drop;
4242 uint32_t byte_drop;
4243 uint32_t mpdu_retry;
4244 uint32_t mpdu_fail;
4245 uint32_t ppdu_fail;
4246 uint32_t aggregation;
4247 uint32_t succ_mcs;
4248 uint32_t fail_mcs;
4249 uint32_t delay;
4250};
4251
4252/**
4253 * struct sir_rx_threshold - threshold for RX
4254 * @mpdu: RX MPDUs on MAC layer
4255 * @bytes: RX bytes on MAC layer
4256 * @ppdu: RX PPDU on PHY layer
4257 * @ppdu_bytes: RX bytes on PHY layer
4258 * @disorder: discontinuity in seqnum
4259 * @mpdu_retry: MPDUs flagged as retry
4260 * @mpdu_dup: MPDUs identified as duplicated
4261 * @aggregation: aggregation size
4262 * @mcs: histogram of encoding rate for PPDUs
4263 * @ps_inds: power save indication
4264 * @ps_durs: total time in power save
4265 * @probe_reqs: probe request received
4266 * @other_mgmt: other MGMT frames received
4267 */
4268struct sir_rx_threshold {
4269 uint32_t mpdu;
4270 uint32_t bytes;
4271 uint32_t ppdu;
4272 uint32_t ppdu_bytes;
4273 uint32_t disorder;
4274 uint32_t mpdu_lost;
4275 uint32_t mpdu_retry;
4276 uint32_t mpdu_dup;
4277 uint32_t mpdu_discard;
4278 uint32_t aggregation;
4279 uint32_t mcs;
4280 uint32_t ps_inds;
4281 uint32_t ps_durs;
4282 uint32_t probe_reqs;
4283 uint32_t other_mgmt;
4284};
4285
4286/**
4287 * struct sir_wifi_ll_ext_stats_threshold - Threshold for stats update
4288 * @period: MAC counter indication period (unit in ms)
4289 * @enable: if threshold mechnism is enabled or disabled
4290 * @enable_bitmap: whether dedicated threshold is enabed.
4291 * Every MAC counter has a dedicated threshold. If the dedicated
4292 * threshold is not set in the bitmap, global threshold will take
4293 * effect.
4294 * @global: whether clobal threshold is enabled.
Jeff Johnsonf2cf6592018-05-06 16:27:44 -07004295 * When both global and dedicated threshold are disabled, MAC counter
Zhang Qian73c348a2017-03-13 16:15:55 +08004296 * will indicate stats periodically.
4297 * @global_threshold: global threshold value
4298 * @cca_bitmap: bitmap for CCA.
4299 * Bit0: idle time
4300 * Bit1: tx time
4301 * Bit2: RX in BSS
4302 * Bit3: RX out of BSS
4303 * Bit4: medium busy
4304 * Bit5: RX bad
4305 * Bit6: TX bad
4306 * Bit7: WLAN card not available
4307 * @signal_bitmap:
4308 * Bit0: Per channel SNR counter
4309 * Bit1: Per channel noise floor counter
4310 * @tx_bitmap: bitmap for TX counters
4311 * Bit0: TX counter unit in MSDU
4312 * Bit1: TX counter unit in MPDU
4313 * Bit2: TX counter unit in PPDU
4314 * Bit3: TX counter unit in byte
4315 * Bit4: Dropped MSDUs
4316 * Bit5: Dropped Bytes
4317 * Bit6: MPDU retry counter
4318 * Bit7: MPDU failure counter
4319 * Bit8: PPDU failure counter
4320 * Bit9: MPDU aggregation counter
4321 * Bit10: MCS counter for ACKed MPDUs
4322 * Bit11: MCS counter for Failed MPDUs
4323 * Bit12: TX Delay counter
4324 * @rx_bitmap:bitmap for RX counters
4325 * Bit0: MAC RX counter unit in MPDU
4326 * Bit1: MAC RX counter unit in byte
4327 * Bit2: PHY RX counter unit in PPDU
4328 * Bit3: PHY RX counter unit in byte
4329 * Bit4: Disorder counter
4330 * Bit5: Retry counter
4331 * Bit6: Duplication counter
4332 * Bit7: Discard counter
4333 * Bit8: MPDU aggregation size counter
4334 * Bit9: MCS counter
4335 * Bit10: Peer STA power state change (wake to sleep) counter
4336 * Bit11: Peer STA power save counter, total time in PS mode
4337 * Bit12: Probe request counter
4338 * Bit13: Other management frames counter
4339 * @cca_thresh: CCA threshold
4340 * @signal_thresh: signal threshold
4341 * @tx_thresh: TX threshold
4342 * @rx_thresh: RX threshold
4343 *
4344 * Generally, Link layer statistics is reported periodically. But if the
4345 * variation of one stats of compared to the pervious notification exceeds
4346 * a threshold, FW will report the new stats immediately.
4347 * This structure contains threshold for different counters.
4348 */
4349struct sir_ll_ext_stats_threshold {
4350 uint32_t period;
4351 uint32_t enable;
4352 uint32_t enable_bitmap;
4353 uint32_t global;
4354 uint32_t global_threshold;
4355 uint32_t cca_bitmap;
4356 uint32_t signal_bitmap;
4357 uint32_t tx_bitmap;
4358 uint32_t rx_bitmap;
4359 struct sir_channel_cca_threshold cca;
4360 struct sir_signal_threshold signal;
4361 struct sir_tx_threshold tx;
4362 struct sir_rx_threshold rx;
4363};
4364
4365#define LL_STATS_MIN_PERIOD 10
4366#define LL_STATS_INVALID_PERIOD 0xFFFFFFFF
4367
Zhang Qiana6e9c102016-12-22 16:47:24 +08004368/* Result ID for LL stats extension */
4369#define WMI_LL_STATS_EXT_PS_CHG 0x00000100
4370#define WMI_LL_STATS_EXT_TX_FAIL 0x00000200
4371#define WMI_LL_STATS_EXT_MAC_COUNTER 0x00000400
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004372#endif /* WLAN_FEATURE_LINK_LAYER_STATS */
4373
4374typedef struct sAniGetLinkStatus {
4375 uint16_t msgType; /* message type is same as the request type */
4376 uint16_t msgLen; /* length of the entire request */
4377 uint8_t linkStatus;
4378 uint8_t sessionId;
4379} tAniGetLinkStatus, *tpAniGetLinkStatus;
4380
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05304381/**
4382 * struct sir_lost_link_info - lost link information structure.
4383 *
4384 * @vdev_id: vdev_id from WMA. some modules call sessionId.
4385 * @rssi: rssi at disconnection time.
4386 *
4387 * driver uses this structure to communicate information collected at
4388 * disconnection time.
4389 */
4390struct sir_lost_link_info {
4391 uint32_t vdev_id;
4392 int32_t rssi;
4393};
4394
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004395/* find the size of given member within a structure */
4396#ifndef member_size
4397#define member_size(type, member) (sizeof(((type *)0)->member))
4398#endif
4399
4400#define RTT_INVALID 0x00
4401#define RTT_TIMING_MEAS_CAPABILITY 0x01
4402#define RTT_FINE_TIME_MEAS_INITIATOR_CAPABILITY 0x02
4403#define RTT_FINE_TIME_MEAS_RESPONDER_CAPABILITY 0x03
4404
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004405/* number of neighbor reports that we can handle in Neighbor Report Response */
4406#define MAX_SUPPORTED_NEIGHBOR_RPT 15
4407
4408/**
4409 * struct sir_stats_avg_factor
4410 * @vdev_id: session id
4411 * @stats_avg_factor: average factor
4412 */
4413struct sir_stats_avg_factor {
4414 uint8_t vdev_id;
4415 uint16_t stats_avg_factor;
4416};
4417
4418/**
4419 * struct sir_guard_time_request
4420 * @vdev_id: session id
4421 * @guard_time: guard time
4422 */
4423struct sir_guard_time_request {
4424 uint8_t vdev_id;
4425 uint32_t guard_time;
4426};
4427
4428/* Max number of rates allowed in Supported Rates IE */
4429#define MAX_NUM_SUPPORTED_RATES (8)
4430
4431/*
4432 * struct rssi_monitor_req - rssi monitoring
4433 * @request_id: request id
4434 * @session_id: session id
4435 * @min_rssi: minimum rssi
4436 * @max_rssi: maximum rssi
4437 * @control: flag to indicate start or stop
4438 */
4439struct rssi_monitor_req {
4440 uint32_t request_id;
4441 uint32_t session_id;
4442 int8_t min_rssi;
4443 int8_t max_rssi;
4444 bool control;
4445};
4446
4447/**
4448 * struct rssi_breach_event - rssi breached event structure
4449 * @request_id: request id
4450 * @session_id: session id
4451 * @curr_rssi: current rssi
4452 * @curr_bssid: current bssid
4453 */
4454struct rssi_breach_event {
4455 uint32_t request_id;
4456 uint32_t session_id;
4457 int8_t curr_rssi;
Anurag Chouhan6d760662016-02-20 16:05:43 +05304458 struct qdf_mac_addr curr_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004459};
4460
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05304461/**
4462 * struct chip_pwr_save_fail_detected_params - chip power save failure detected
4463 * event params
4464 * @failure_reason_code:failure reason code
4465 * @wake_lock_bitmap:bitmap for modules voting against sleep for long duration.
4466 */
4467struct chip_pwr_save_fail_detected_params {
4468 uint32_t failure_reason_code;
4469 uint32_t wake_lock_bitmap[4];
4470};
4471
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004472#define MAX_NUM_FW_SEGMENTS 4
4473
4474/**
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05304475 * DEFAULT_SCAN_IE_ID - Identifier for the collection of IE's added
4476 * by default to the probe request
4477 */
4478#define DEFAULT_SCAN_IE_ID 256
4479
4480 /* MAX_DEFAULT_SCAN_IE_LEN - Maxmimum length of Default Scan IE's */
Selvaraj, Sridhar021ee0a2017-04-07 16:53:31 +05304481#define MAX_DEFAULT_SCAN_IE_LEN 2048
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05304482
4483 /* Extended Capabilities IE header(IE Id + IE Length) length */
4484#define EXT_CAP_IE_HDR_LEN 2
4485
4486/**
4487 * struct hdd_default_scan_ie - HDD default scan IE structure
4488 * @message_type: message type to be set with eWNI_SME_DEFAULT_SCAN_IE
4489 * @length: length of the struct hdd_default_scan_ie
4490 * @session_id: Session Id
4491 * @ie_len: Default scan IE length
4492 * @ie_data: Pointer to default scan IE data
4493 */
4494struct hdd_default_scan_ie {
4495 uint16_t message_type;
4496 uint16_t length;
4497 uint16_t session_id;
4498 uint16_t ie_len;
4499 uint8_t ie_data[MAX_DEFAULT_SCAN_IE_LEN];
4500};
4501
4502/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004503 * struct vdev_ie_info - IE info
4504 * @vdev_id - vdev for which the IE is being sent
4505 * @ie_id - ID of the IE
4506 * @length - length of the IE data
Naveen Rawat03e8d952016-08-01 15:22:20 -07004507 * @band - indicates IE is intended for which band
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004508 * @data - IE data
4509 *
4510 * This structure is used to store the IE information.
4511 */
4512struct vdev_ie_info {
4513 uint32_t vdev_id;
4514 uint32_t ie_id;
4515 uint32_t length;
Naveen Rawat03e8d952016-08-01 15:22:20 -07004516 uint32_t band;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004517 uint8_t *data;
4518};
4519
4520/**
4521 * struct send_extcap_ie - used to pass send_extcap_ie msg from SME to PE
4522 * @type - MSG type
4523 * @length - length of the message
4524 * @seesion_id - session_id for which the message is intended for
4525 *
4526 * This structure is used to pass send_extcap_ie msg from SME to PE
4527 */
4528struct send_extcap_ie {
4529 uint16_t msg_type; /* eWNI_SME_SET_IE_REQ */
4530 uint16_t length;
4531 uint8_t session_id;
4532};
4533
Dundi Raviteja6bb9e322018-05-16 17:04:41 +05304534typedef void (*antenna_mode_cb)(uint32_t status, void *context);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004535
4536/**
Kiran Kumar Lokereee205772018-09-27 00:27:27 -07004537 * struct cfg_action_frm_tb_ppdu - action frame TB PPDU cfg
4538 * @vdev_id - vdev id
4539 * @cfg - enable/disable
4540 * @frm_len - frame length
4541 * @data - frame data
4542 *
4543 * This structure is used to cfg action frame tb ppdu.
4544 */
4545struct cfg_action_frm_tb_ppdu {
4546 uint8_t vdev_id;
4547 uint8_t cfg;
4548 uint8_t frm_len;
4549 uint8_t *data;
4550};
4551
4552/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004553 * struct sir_nss_update_request
4554 * @msgType: nss update msg type
4555 * @msgLen: length of the msg
4556 * @new_nss: new spatial stream value
4557 * @vdev_id: session id
4558 */
4559struct sir_nss_update_request {
4560 uint16_t msgType;
4561 uint16_t msgLen;
4562 uint8_t new_nss;
4563 uint32_t vdev_id;
4564};
4565
4566/**
Abhishek Singhfc740be2018-10-12 11:34:26 +05304567 * enum sir_bcn_update_reason: bcn update reason
4568 * @REASON_DEFAULT: reason default
4569 * @REASON_NSS_UPDATE: If NSS is updated
4570 * @REASON_CONFIG_UPDATE: Config update
4571 * @REASON_SET_HT2040: HT2040 update
4572 * @REASON_COLOR_CHANGE: Color change
4573 * @REASON_CHANNEL_SWITCH: channel switch
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004574 */
Abhishek Singhfc740be2018-10-12 11:34:26 +05304575enum sir_bcn_update_reason {
4576 REASON_DEFAULT = 0,
4577 REASON_NSS_UPDATE = 1,
4578 REASON_CONFIG_UPDATE = 2,
4579 REASON_SET_HT2040 = 3,
4580 REASON_COLOR_CHANGE = 4,
4581 REASON_CHANNEL_SWITCH = 5,
4582};
4583
4584/**
4585 * struct sir_bcn_update_rsp
4586 *
4587 * @vdev_id: session for which bcn was updated
4588 * @reason: bcn update reason
4589 * @status: status of the beacon sent to FW
4590 */
4591struct sir_bcn_update_rsp {
4592 uint8_t vdev_id;
4593 enum sir_bcn_update_reason reason;
4594 QDF_STATUS status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004595};
4596
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004597struct sir_qos_params {
4598 uint8_t aifsn;
4599 uint8_t cwmin;
4600 uint8_t cwmax;
4601};
4602
4603/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004604 * enum powersave_qpower_mode: QPOWER modes
4605 * @QPOWER_DISABLED: Qpower is disabled
4606 * @QPOWER_ENABLED: Qpower is enabled
4607 * @QPOWER_DUTY_CYCLING: Qpower is enabled with duty cycling
4608 */
4609enum powersave_qpower_mode {
4610 QPOWER_DISABLED = 0,
4611 QPOWER_ENABLED = 1,
4612 QPOWER_DUTY_CYCLING = 2
4613};
4614
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08004615#ifdef FEATURE_LFR_SUBNET_DETECTION
4616/**
4617 * struct gateway_param_update_req - gateway parameter update request
4618 * @request_id: request id
4619 * @session_id: session id
4620 * @max_retries: Max ARP/NS retry attempts
4621 * @timeout: Retry interval
4622 * @ipv4_addr_type: on ipv4 network
4623 * @ipv6_addr_type: on ipv6 network
4624 * @gw_mac_addr: gateway mac addr
4625 * @ipv4_addr: ipv4 addr
4626 * @ipv6_addr: ipv6 addr
4627 */
4628struct gateway_param_update_req {
4629 uint32_t request_id;
4630 uint32_t session_id;
4631 uint32_t max_retries;
4632 uint32_t timeout;
4633 uint32_t ipv4_addr_type;
4634 uint32_t ipv6_addr_type;
Anurag Chouhan6d760662016-02-20 16:05:43 +05304635 struct qdf_mac_addr gw_mac_addr;
4636 uint8_t ipv4_addr[QDF_IPV4_ADDR_SIZE];
4637 uint8_t ipv6_addr[QDF_IPV6_ADDR_SIZE];
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08004638};
4639#else
4640struct gateway_param_update_req;
4641#endif /* FEATURE_LFR_SUBNET_DETECTION */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004642
Abhishek Singh518323d2015-10-19 17:42:01 +05304643/**
4644 * struct sir_sme_ext_change_chan_req - channel change request
4645 * @message_type: message id
4646 * @length: msg length
4647 * @new_channel: new channel
4648 * @session_id: session id
4649 */
4650struct sir_sme_ext_cng_chan_req {
4651 uint16_t message_type; /* eWNI_SME_EXT_CHANGE_CHANNEL */
4652 uint16_t length;
4653 uint32_t new_channel;
4654 uint8_t session_id;
4655};
4656
4657/**
4658 * struct sir_sme_ext_change_chan_ind.
4659 * @session_id: session id
4660 * @new_channel: new channel to change
4661 */
4662struct sir_sme_ext_cng_chan_ind {
4663 uint8_t session_id;
4664 uint8_t new_channel;
4665};
4666
Ryan Hsu3c8f79f2015-12-02 16:45:09 -08004667/**
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07004668 * struct stsf - the basic stsf structure
4669 *
4670 * @vdev_id: vdev id
4671 * @tsf_low: low 32bits of tsf
4672 * @tsf_high: high 32bits of tsf
Manikandan Mohan5356c2b2016-04-03 15:51:35 -07004673 * @soc_timer_low: low 32bits of synced SOC timer value
4674 * @soc_timer_high: high 32bits of synced SOC timer value
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07004675 *
4676 * driver use this struct to store the tsf info
4677 */
4678struct stsf {
4679 uint32_t vdev_id;
4680 uint32_t tsf_low;
4681 uint32_t tsf_high;
Manikandan Mohan5356c2b2016-04-03 15:51:35 -07004682 uint32_t soc_timer_low;
4683 uint32_t soc_timer_high;
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07004684};
4685
Gupta, Kapil4cb1d7d2016-04-16 18:16:25 -07004686#define SIR_BCN_FLT_MAX_ELEMS_IE_LIST 8
4687/**
4688 * struct beacon_filter_param - parameters for beacon filtering
4689 * @vdev_id: vdev id
4690 * @ie_map: bitwise map of IEs that needs to be filtered
4691 *
4692 */
4693struct beacon_filter_param {
4694 uint32_t vdev_id;
4695 uint32_t ie_map[SIR_BCN_FLT_MAX_ELEMS_IE_LIST];
4696};
4697
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05304698/**
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +05304699 * struct adaptive_dwelltime_params - the adaptive dwelltime params
4700 * @vdev_id: vdev id
4701 * @is_enabled: Adaptive dwell time is enabled/disabled
4702 * @dwelltime_mode: global default adaptive dwell mode
4703 * @lpf_weight: weight to calculate the average low pass
4704 * filter for channel congestion
4705 * @passive_mon_intval: intval to monitor wifi activity in passive scan in msec
4706 * @wifi_act_threshold: % of wifi activity used in passive scan 0-100
4707 *
4708 */
4709struct adaptive_dwelltime_params {
4710 uint32_t vdev_id;
4711 bool is_enabled;
4712 uint8_t dwelltime_mode;
4713 uint8_t lpf_weight;
4714 uint8_t passive_mon_intval;
4715 uint8_t wifi_act_threshold;
4716};
4717
4718/**
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05304719 * struct csa_offload_params - CSA offload request parameters
4720 * @channel: channel
4721 * @switch_mode: switch mode
4722 * @sec_chan_offset: second channel offset
4723 * @new_ch_width: new channel width
4724 * @new_ch_freq_seg1: channel center freq 1
4725 * @new_ch_freq_seg2: channel center freq 2
4726 * @ies_present_flag: IE present flag
4727 */
4728struct csa_offload_params {
4729 uint8_t channel;
4730 uint8_t switch_mode;
4731 uint8_t sec_chan_offset;
4732 uint8_t new_ch_width;
4733 uint8_t new_op_class;
4734 uint8_t new_ch_freq_seg1;
4735 uint8_t new_ch_freq_seg2;
4736 uint32_t ies_present_flag;
4737 tSirMacAddr bssId;
4738};
4739
4740/**
Sandeep Puligillae0875662016-02-12 16:09:21 -08004741 * enum obss_ht40_scancmd_type - obss scan command type
4742 * @HT40_OBSS_SCAN_PARAM_START: OBSS scan start
4743 * @HT40_OBSS_SCAN_PARAM_UPDATE: OBSS scan param update
4744 */
4745enum obss_ht40_scancmd_type {
4746 HT40_OBSS_SCAN_PARAM_START,
4747 HT40_OBSS_SCAN_PARAM_UPDATE
4748};
4749
4750/**
4751 * struct sme_obss_ht40_scanind_msg - sme obss scan params
4752 * @msg_type: message type
4753 * @length: message length
4754 * @mac_addr: mac address
4755 */
4756struct sme_obss_ht40_scanind_msg {
4757 uint16_t msg_type;
4758 uint16_t length;
4759 struct qdf_mac_addr mac_addr;
4760};
4761
4762/**
4763 * struct obss_ht40_scanind - ht40 obss scan request
4764 * @cmd: message type
4765 * @scan_type: message length
4766 * @obss_passive_dwelltime: obss passive dwelltime
4767 * @obss_active_dwelltime: obss active dwelltime
4768 * @obss_width_trigger_interval: scan interval
4769 * @obss_passive_total_per_channel: total passive scan time per channel
4770 * @obss_active_total_per_channel: total active scan time per channel
4771 * @bsswidth_ch_trans_delay: OBSS transition delay time
4772 * @obss_activity_threshold: OBSS activity threshold
4773 * @self_sta_id: self sta identification
4774 * @bss_id: BSS index
4775 * @fortymhz_intolerent: Ht40mhz intolerance
4776 * @channel_count: channel count
4777 * @channels: channel information
4778 * @current_operatingclass: operating class
4779 * @iefield_len: ie's length
4780 * @iefiled: ie's information
4781 */
4782struct obss_ht40_scanind {
4783 enum obss_ht40_scancmd_type cmd;
4784 enum eSirScanType scan_type;
4785 /* In TUs */
4786 uint16_t obss_passive_dwelltime;
4787 uint16_t obss_active_dwelltime;
4788 /* In seconds */
4789 uint16_t obss_width_trigger_interval;
4790 /* In TU's */
4791 uint16_t obss_passive_total_per_channel;
4792 uint16_t obss_active_total_per_channel;
4793 uint16_t bsswidth_ch_trans_delay;
4794 uint16_t obss_activity_threshold;
4795 uint8_t self_sta_idx;
4796 uint8_t bss_id;
4797 uint8_t fortymhz_intolerent;
4798 uint8_t channel_count;
4799 uint8_t channels[SIR_ROAM_MAX_CHANNELS];
4800 uint8_t current_operatingclass;
4801 uint16_t iefield_len;
4802 uint8_t iefield[SIR_ROAM_SCAN_MAX_PB_REQ_SIZE];
4803};
4804
4805/**
4806 * struct obss_scanparam - OBSS scan parameters
4807 * @obss_passive_dwelltime: message type
4808 * @obss_active_dwelltime: message length
4809 * @obss_width_trigger_interval: obss passive dwelltime
4810 * @obss_passive_total_per_channel: obss passive total scan time
4811 * @obss_active_total_per_channel: obss active total scan time
4812 * @bsswidth_ch_trans_delay: OBSS transition delay time
4813 * @obss_activity_threshold: OBSS activity threshold
4814 */
4815struct obss_scanparam {
4816 uint16_t obss_passive_dwelltime;
4817 uint16_t obss_active_dwelltime;
4818 uint16_t obss_width_trigger_interval;
4819 uint16_t obss_passive_total_per_channel;
4820 uint16_t obss_active_total_per_channel;
4821 uint16_t bsswidth_ch_trans_delay;
4822 uint16_t obss_activity_threshold;
4823};
4824
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304825/**
Nachiket Kukadee547a482018-05-22 16:43:30 +05304826 * struct sir_apf_set_offload - set apf filter instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304827 * @session_id: session identifier
Nachiket Kukadee547a482018-05-22 16:43:30 +05304828 * @version: host apf version
4829 * @filter_id: Filter ID for APF filter
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304830 * @total_length: The total length of the full instruction
4831 * total_length equal to 0 means reset
4832 * @current_offset: current offset, 0 means start a new setting
4833 * @current_length: Length of current @program
Nachiket Kukadee547a482018-05-22 16:43:30 +05304834 * @program: APF instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304835 */
Nachiket Kukadee547a482018-05-22 16:43:30 +05304836struct sir_apf_set_offload {
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304837 uint8_t session_id;
4838 uint32_t version;
4839 uint32_t filter_id;
4840 uint32_t total_length;
4841 uint32_t current_offset;
4842 uint32_t current_length;
4843 uint8_t *program;
4844};
4845
4846/**
Nachiket Kukadee547a482018-05-22 16:43:30 +05304847 * struct sir_apf_offload_capabilities - get apf Capabilities
4848 * @apf_version: fw's implement version
4849 * @max_apf_filters: max filters that fw supports
4850 * @max_bytes_for_apf_inst: the max bytes that can be used as apf instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304851 */
Nachiket Kukadee547a482018-05-22 16:43:30 +05304852struct sir_apf_get_offload {
4853 uint32_t apf_version;
4854 uint32_t max_apf_filters;
4855 uint32_t max_bytes_for_apf_inst;
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304856};
4857
Naveen Rawat3ff5cff2018-01-29 14:31:16 -08004858#ifndef QCA_SUPPORT_CP_STATS
Sandeep Puligilla607f34a2016-05-25 14:37:47 -07004859/**
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05304860 * struct sir_wake_lock_stats - wake lock stats structure
Dustin Brown9d797d62017-01-11 16:39:12 -08004861 * @wow_unspecified_wake_up_count: number of non-wow related wake ups
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05304862 * @wow_ucast_wake_up_count: Unicast wakeup count
4863 * @wow_bcast_wake_up_count: Broadcast wakeup count
4864 * @wow_ipv4_mcast_wake_up_count: ipv4 multicast wakeup count
4865 * @wow_ipv6_mcast_wake_up_count: ipv6 multicast wakeup count
4866 * @wow_ipv6_mcast_ra_stats: ipv6 multicast ra stats
4867 * @wow_ipv6_mcast_ns_stats: ipv6 multicast ns stats
4868 * @wow_ipv6_mcast_na_stats: ipv6 multicast na stats
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +05304869 * @wow_icmpv4_count: ipv4 icmp packet count
Himanshu Agarwal4574e282016-08-10 15:22:45 +05304870 * @wow_icmpv6_count: ipv6 icmp packet count
Poddar, Siddarthc01681a2016-12-21 18:36:30 +05304871 * @wow_rssi_breach_wake_up_count: rssi breach wakeup count
4872 * @wow_low_rssi_wake_up_count: low rssi wakeup count
4873 * @wow_gscan_wake_up_count: gscan wakeup count
4874 * @wow_pno_complete_wake_up_count: pno complete wakeup count
4875 * @wow_pno_match_wake_up_count: pno match wakeup count
Dustin Brown9d797d62017-01-11 16:39:12 -08004876 * @wow_oem_response_wake_up_count: oem response wakeup count
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05304877 * @pwr_save_fail_detected: pwr save fail detected wakeup count
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05304878 */
4879struct sir_wake_lock_stats {
Dustin Brown9d797d62017-01-11 16:39:12 -08004880 uint32_t wow_unspecified_wake_up_count;
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05304881 uint32_t wow_ucast_wake_up_count;
4882 uint32_t wow_bcast_wake_up_count;
4883 uint32_t wow_ipv4_mcast_wake_up_count;
4884 uint32_t wow_ipv6_mcast_wake_up_count;
4885 uint32_t wow_ipv6_mcast_ra_stats;
4886 uint32_t wow_ipv6_mcast_ns_stats;
4887 uint32_t wow_ipv6_mcast_na_stats;
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +05304888 uint32_t wow_icmpv4_count;
Himanshu Agarwal4574e282016-08-10 15:22:45 +05304889 uint32_t wow_icmpv6_count;
Poddar, Siddarthc01681a2016-12-21 18:36:30 +05304890 uint32_t wow_rssi_breach_wake_up_count;
4891 uint32_t wow_low_rssi_wake_up_count;
4892 uint32_t wow_gscan_wake_up_count;
4893 uint32_t wow_pno_complete_wake_up_count;
4894 uint32_t wow_pno_match_wake_up_count;
Dustin Brown9d797d62017-01-11 16:39:12 -08004895 uint32_t wow_oem_response_wake_up_count;
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05304896 uint32_t pwr_save_fail_detected;
Dustin Brown9d797d62017-01-11 16:39:12 -08004897};
4898
4899/**
4900 * struct sir_vdev_wow_stats - container for per vdev wow related stat counters
4901 * @ucast: Unicast wakeup count
4902 * @bcast: Broadcast wakeup count
4903 * @ipv4_mcast: ipv4 multicast wakeup count
4904 * @ipv6_mcast: ipv6 multicast wakeup count
4905 * @ipv6_mcast_ra: ipv6 multicast ra stats
4906 * @ipv6_mcast_ns: ipv6 multicast ns stats
4907 * @ipv6_mcast_na: ipv6 multicast na stats
4908 * @icmpv4: ipv4 icmp packet count
4909 * @icmpv6: ipv6 icmp packet count
4910 * @rssi_breach: rssi breach wakeup count
4911 * @low_rssi: low rssi wakeup count
4912 * @gscan: gscan wakeup count
4913 * @pno_complete: pno complete wakeup count
4914 * @pno_match: pno match wakeup count
Visweswara Tanuku633976b2019-01-07 16:13:12 +05304915 * @oem_response: oem response wakeup count
Amar Singhal5eb9acb2017-05-26 15:25:27 -07004916 * @scan_11d: 11d scan wakeup count
Visweswara Tanuku633976b2019-01-07 16:13:12 +05304917 * @motion_detect: motion detection wakeup count
4918 * @motion_detect_bl: motion detection baselining wakeup count
Dustin Brown9d797d62017-01-11 16:39:12 -08004919 */
4920struct sir_vdev_wow_stats {
4921 uint32_t ucast;
4922 uint32_t bcast;
4923 uint32_t ipv4_mcast;
4924 uint32_t ipv6_mcast;
4925 uint32_t ipv6_mcast_ra;
4926 uint32_t ipv6_mcast_ns;
4927 uint32_t ipv6_mcast_na;
4928 uint32_t icmpv4;
4929 uint32_t icmpv6;
4930 uint32_t rssi_breach;
4931 uint32_t low_rssi;
4932 uint32_t gscan;
4933 uint32_t pno_complete;
4934 uint32_t pno_match;
4935 uint32_t oem_response;
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05304936 uint32_t pwr_save_fail_detected;
Amar Singhal5eb9acb2017-05-26 15:25:27 -07004937 uint32_t scan_11d;
Visweswara Tanuku633976b2019-01-07 16:13:12 +05304938#ifdef WLAN_FEATURE_MOTION_DETECTION
4939 uint32_t motion_detect;
4940 uint32_t motion_detect_bl;
4941#endif /* WLAN_FEATURE_MOTION_DETECTION */
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05304942};
Naveen Rawat3ff5cff2018-01-29 14:31:16 -08004943#endif
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05304944
Nachiket Kukade2fb1fdb2019-01-08 15:35:27 +05304945#ifdef WLAN_FEATURE_NAN
Ravi Joshi412f23d2016-05-26 15:09:23 -07004946#define IFACE_NAME_SIZE 64
4947
4948/**
4949 * enum ndp_accept_policy - nan data path accept policy
4950 * @NDP_ACCEPT_POLICY_NONE: the framework will decide the policy
4951 * @NDP_ACCEPT_POLICY_ALL: accept policy offloaded to fw
4952 *
4953 */
4954enum ndp_accept_policy {
4955 NDP_ACCEPT_POLICY_NONE = 0,
4956 NDP_ACCEPT_POLICY_ALL = 1,
4957};
4958
4959/**
4960 * enum ndp_self_role - nan data path role
4961 * @NDP_ROLE_INITIATOR: initiator of nan data path request
4962 * @NDP_ROLE_RESPONDER: responder to nan data path request
4963 *
4964 */
4965enum ndp_self_role {
4966 NDP_ROLE_INITIATOR = 0,
4967 NDP_ROLE_RESPONDER = 1,
4968};
4969
4970/**
4971 * enum ndp_response_code - responder's response code to nan data path request
4972 * @NDP_RESPONSE_ACCEPT: ndp request accepted
4973 * @NDP_RESPONSE_REJECT: ndp request rejected
4974 * @NDP_RESPONSE_DEFER: ndp request deferred until later (response to follow
4975 * any time later)
4976 *
4977 */
4978enum ndp_response_code {
4979 NDP_RESPONSE_ACCEPT = 0,
4980 NDP_RESPONSE_REJECT = 1,
4981 NDP_RESPONSE_DEFER = 2,
4982};
4983
4984/**
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07004985 * enum ndp_end_type - NDP end type
4986 * @NDP_END_TYPE_UNSPECIFIED: type is unspecified
4987 * @NDP_END_TYPE_PEER_UNAVAILABLE: type is peer unavailable
4988 * @NDP_END_TYPE_OTA_FRAME: NDP end frame received from peer
4989 *
4990 */
4991enum ndp_end_type {
4992 NDP_END_TYPE_UNSPECIFIED = 0x00,
4993 NDP_END_TYPE_PEER_UNAVAILABLE = 0x01,
4994 NDP_END_TYPE_OTA_FRAME = 0x02,
4995};
4996
4997/**
4998 * enum ndp_end_reason_code - NDP end reason code
4999 * @NDP_END_REASON_UNSPECIFIED: reason is unspecified
5000 * @NDP_END_REASON_INACTIVITY: reason is peer inactivity
5001 * @NDP_END_REASON_PEER_DATA_END: data end indication received from peer
5002 *
5003 */
5004enum ndp_end_reason_code {
5005 NDP_END_REASON_UNSPECIFIED = 0x00,
5006 NDP_END_REASON_INACTIVITY = 0x01,
5007 NDP_END_REASON_PEER_DATA_END = 0x02,
5008};
5009
5010/**
Naveen Rawat8d63a592016-06-29 18:30:59 -07005011 * enum nan_status_type - NDP status type
5012 * @NDP_RSP_STATUS_SUCCESS: request was successful
5013 * @NDP_RSP_STATUS_ERROR: request failed
5014 */
5015enum nan_status_type {
5016 NDP_RSP_STATUS_SUCCESS = 0x00,
5017 NDP_RSP_STATUS_ERROR = 0x01,
5018};
5019
5020/**
5021 * enum nan_reason_code - NDP command rsp reason code value
5022 * @NDP_UNSUPPORTED_CONCURRENCY: Will be used in unsupported concurrency cases
5023 * @NDP_NAN_DATA_IFACE_CREATE_FAILED: ndi create failed
5024 * @NDP_NAN_DATA_IFACE_DELETE_FAILED: ndi delete failed
5025 * @NDP_DATA_INITIATOR_REQ_FAILED: data initiator request failed
5026 * @NDP_DATA_RESPONDER_REQ_FAILED: data responder request failed
5027 * @NDP_INVALID_SERVICE_INSTANCE_ID: invalid service instance id
5028 * @NDP_INVALID_NDP_INSTANCE_ID: invalid ndp instance id
5029 * @NDP_INVALID_RSP_CODE: invalid response code in ndp responder request
5030 * @NDP_INVALID_APP_INFO_LEN: invalid app info length
5031 * @NDP_NMF_REQ_FAIL: OTA nan mgmt frame failure for data request
5032 * @NDP_NMF_RSP_FAIL: OTA nan mgmt frame failure for data response
5033 * @NDP_NMF_CNF_FAIL: OTA nan mgmt frame failure for confirm
5034 * @NDP_END_FAILED: ndp end failed
5035 * @NDP_NMF_END_REQ_FAIL: OTA nan mgmt frame failure for data end
5036 * @NDP_VENDOR_SPECIFIC_ERROR: other vendor specific failures
5037 */
5038enum nan_reason_code {
5039 NDP_UNSUPPORTED_CONCURRENCY = 9000,
5040 NDP_NAN_DATA_IFACE_CREATE_FAILED = 9001,
5041 NDP_NAN_DATA_IFACE_DELETE_FAILED = 9002,
5042 NDP_DATA_INITIATOR_REQ_FAILED = 9003,
5043 NDP_DATA_RESPONDER_REQ_FAILED = 9004,
5044 NDP_INVALID_SERVICE_INSTANCE_ID = 9005,
5045 NDP_INVALID_NDP_INSTANCE_ID = 9006,
5046 NDP_INVALID_RSP_CODE = 9007,
5047 NDP_INVALID_APP_INFO_LEN = 9008,
5048 NDP_NMF_REQ_FAIL = 9009,
5049 NDP_NMF_RSP_FAIL = 9010,
5050 NDP_NMF_CNF_FAIL = 9011,
5051 NDP_END_FAILED = 9012,
5052 NDP_NMF_END_REQ_FAIL = 9013,
5053 /* 9500 onwards vendor specific error codes */
5054 NDP_VENDOR_SPECIFIC_ERROR = 9500,
5055};
5056
5057/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07005058 * struct ndp_cfg - ndp configuration
5059 * @tag: unique identifier
5060 * @ndp_cfg_len: ndp configuration length
5061 * @ndp_cfg: variable length ndp configuration
5062 *
5063 */
5064struct ndp_cfg {
5065 uint32_t tag;
5066 uint32_t ndp_cfg_len;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07005067 uint8_t *ndp_cfg;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005068};
5069
5070/**
5071 * struct ndp_qos_cfg - ndp qos configuration
5072 * @tag: unique identifier
5073 * @ndp_qos_cfg_len: ndp qos configuration length
5074 * @ndp_qos_cfg: variable length ndp qos configuration
5075 *
5076 */
5077struct ndp_qos_cfg {
5078 uint32_t tag;
5079 uint32_t ndp_qos_cfg_len;
5080 uint8_t ndp_qos_cfg[];
5081};
5082
5083/**
5084 * struct ndp_app_info - application info shared during ndp setup
5085 * @tag: unique identifier
5086 * @ndp_app_info_len: ndp app info length
5087 * @ndp_app_info: variable length application information
5088 *
5089 */
5090struct ndp_app_info {
5091 uint32_t tag;
5092 uint32_t ndp_app_info_len;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07005093 uint8_t *ndp_app_info;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005094};
5095
5096/**
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005097 * struct ndp_scid - structure to hold sceurity context identifier
5098 * @scid_len: length of scid
5099 * @scid: scid
5100 *
5101 */
5102struct ndp_scid {
5103 uint32_t scid_len;
5104 uint8_t *scid;
5105};
5106
5107/**
5108 * struct ndp_pmk - structure to hold pairwise master key
5109 * @pmk_len: length of pairwise master key
5110 * @pmk: buffer containing pairwise master key
5111 *
5112 */
5113struct ndp_pmk {
5114 uint32_t pmk_len;
5115 uint8_t *pmk;
5116};
5117
5118/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07005119 * struct ndi_create_req - ndi create request params
5120 * @transaction_id: unique identifier
5121 * @iface_name: interface name
5122 *
5123 */
5124struct ndi_create_req {
5125 uint32_t transaction_id;
5126 char iface_name[IFACE_NAME_SIZE];
5127};
5128
5129/**
5130 * struct ndi_create_rsp - ndi create response params
Ravi Joshi412f23d2016-05-26 15:09:23 -07005131 * @status: request status
5132 * @reason: reason if any
5133 *
5134 */
5135struct ndi_create_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07005136 uint32_t status;
5137 uint32_t reason;
Rakesh Sunkicf1c9ab2016-08-25 14:11:25 -07005138 uint8_t sta_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005139};
5140
5141/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07005142 * struct ndi_delete_rsp - ndi delete response params
Ravi Joshi412f23d2016-05-26 15:09:23 -07005143 * @status: request status
5144 * @reason: reason if any
5145 *
5146 */
5147struct ndi_delete_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07005148 uint32_t status;
5149 uint32_t reason;
5150};
5151
5152/**
5153 * struct ndp_initiator_req - ndp initiator request params
5154 * @transaction_id: unique identifier
5155 * @vdev_id: session id of the interface over which ndp is being created
5156 * @channel: suggested channel for ndp creation
Naveen Rawat0a017052016-10-19 14:17:07 -07005157 * @channel_cfg: channel config, 0=no channel, 1=optional, 2=mandatory
Ravi Joshi412f23d2016-05-26 15:09:23 -07005158 * @service_instance_id: Service identifier
5159 * @peer_discovery_mac_addr: Peer's discovery mac address
5160 * @self_ndi_mac_addr: self NDI mac address
5161 * @ndp_config: ndp configuration params
5162 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005163 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
5164 * @pmk: pairwise master key
Ravi Joshi412f23d2016-05-26 15:09:23 -07005165 *
5166 */
5167struct ndp_initiator_req {
5168 uint32_t transaction_id;
5169 uint32_t vdev_id;
5170 uint32_t channel;
Naveen Rawat0a017052016-10-19 14:17:07 -07005171 uint32_t channel_cfg;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005172 uint32_t service_instance_id;
5173 struct qdf_mac_addr peer_discovery_mac_addr;
5174 struct qdf_mac_addr self_ndi_mac_addr;
5175 struct ndp_cfg ndp_config;
5176 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005177 uint32_t ncs_sk_type;
5178 struct ndp_pmk pmk;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005179};
5180
5181/**
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07005182 * struct ndp_initiator_rsp - response event from FW
Ravi Joshi412f23d2016-05-26 15:09:23 -07005183 * @transaction_id: unique identifier
5184 * @vdev_id: session id of the interface over which ndp is being created
5185 * @ndp_instance_id: locally created NDP instance ID
5186 * @status: status of the ndp request
5187 * @reason: reason for failure if any
5188 *
5189 */
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07005190struct ndp_initiator_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07005191 uint32_t transaction_id;
5192 uint32_t vdev_id;
5193 uint32_t ndp_instance_id;
5194 uint32_t status;
Naveen Rawat8d63a592016-06-29 18:30:59 -07005195 uint32_t reason;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005196};
5197
5198/**
5199 * struct ndp_indication_event - create ndp indication on the responder
5200 * @vdev_id: session id of the interface over which ndp is being created
5201 * @service_instance_id: Service identifier
5202 * @peer_discovery_mac_addr: Peer's discovery mac address
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07005203 * @peer_mac_addr: Peer's NDI mac address
Ravi Joshi412f23d2016-05-26 15:09:23 -07005204 * @ndp_initiator_mac_addr: NDI mac address of the peer initiating NDP
5205 * @ndp_instance_id: locally created NDP instance ID
5206 * @role: self role for NDP
5207 * @ndp_accept_policy: accept policy configured by the upper layer
5208 * @ndp_config: ndp configuration params
5209 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005210 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
5211 * @scid: security context identifier
Ravi Joshi412f23d2016-05-26 15:09:23 -07005212 *
5213 */
5214struct ndp_indication_event {
5215 uint32_t vdev_id;
5216 uint32_t service_instance_id;
5217 struct qdf_mac_addr peer_discovery_mac_addr;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07005218 struct qdf_mac_addr peer_mac_addr;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005219 uint32_t ndp_instance_id;
5220 enum ndp_self_role role;
5221 enum ndp_accept_policy policy;
5222 struct ndp_cfg ndp_config;
5223 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005224 uint32_t ncs_sk_type;
5225 struct ndp_scid scid;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005226};
5227
5228/**
5229 * struct ndp_responder_req - responder's response to ndp create request
5230 * @transaction_id: unique identifier
5231 * @vdev_id: session id of the interface over which ndp is being created
5232 * @ndp_instance_id: locally created NDP instance ID
5233 * @ndp_rsp: response to the ndp create request
5234 * @ndp_config: ndp configuration params
5235 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005236 * @pmk: pairwise master key
5237 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
Ravi Joshi412f23d2016-05-26 15:09:23 -07005238 *
5239 */
5240struct ndp_responder_req {
5241 uint32_t transaction_id;
5242 uint32_t vdev_id;
5243 uint32_t ndp_instance_id;
5244 enum ndp_response_code ndp_rsp;
5245 struct ndp_cfg ndp_config;
5246 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005247 struct ndp_pmk pmk;
5248 uint32_t ncs_sk_type;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005249};
5250
5251/**
5252 * struct ndp_responder_rsp_event - response to responder's request
5253 * @transaction_id: unique identifier
5254 * @vdev_id: session id of the interface over which ndp is being created
5255 * @status: command status
5256 * @reason: reason for failure if any
Abhishek Singh4fef7472016-06-06 11:36:03 -07005257 * @peer_mac_addr: Peer's mac address
Rakesh Sunkid92d1082017-01-04 15:14:28 -08005258 * @create_peer: Flag to indicate to create peer
Ravi Joshi412f23d2016-05-26 15:09:23 -07005259 */
5260struct ndp_responder_rsp_event {
5261 uint32_t transaction_id;
5262 uint32_t vdev_id;
5263 uint32_t status;
5264 uint32_t reason;
Abhishek Singh4fef7472016-06-06 11:36:03 -07005265 struct qdf_mac_addr peer_mac_addr;
Rakesh Sunkid92d1082017-01-04 15:14:28 -08005266 bool create_peer;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005267};
5268
5269/**
5270 * struct ndp_confirm_event - ndp confirmation event from FW
5271 * @vdev_id: session id of the interface over which ndp is being created
5272 * @ndp_instance_id: ndp instance id for which confirm is being generated
Naveen Rawat460be782016-06-29 18:26:22 -07005273 * @reason_code : reason code(opaque to driver)
5274 * @num_active_ndps_on_peer: number of ndp instances on peer
Ravi Joshi412f23d2016-05-26 15:09:23 -07005275 * @peer_ndi_mac_addr: peer NDI mac address
5276 * @rsp_code: ndp response code
Ravi Joshi412f23d2016-05-26 15:09:23 -07005277 * @ndp_info: ndp application info
5278 *
5279 */
5280struct ndp_confirm_event {
5281 uint32_t vdev_id;
5282 uint32_t ndp_instance_id;
Naveen Rawat460be782016-06-29 18:26:22 -07005283 uint32_t reason_code;
5284 uint32_t num_active_ndps_on_peer;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005285 struct qdf_mac_addr peer_ndi_mac_addr;
5286 enum ndp_response_code rsp_code;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005287 struct ndp_app_info ndp_info;
5288};
5289
5290/**
5291 * struct ndp_end_req - ndp end request
5292 * @transaction_id: unique transaction identifier
Ravi Joshi412f23d2016-05-26 15:09:23 -07005293 * @num_ndp_instances: number of ndp instances to be terminated
Naveen Rawatf28315c2016-06-29 18:06:02 -07005294 * @ndp_ids: pointer to array of ndp_instance_id to be terminated
Ravi Joshi412f23d2016-05-26 15:09:23 -07005295 *
5296 */
5297struct ndp_end_req {
5298 uint32_t transaction_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005299 uint32_t num_ndp_instances;
Naveen Rawatf28315c2016-06-29 18:06:02 -07005300 uint32_t *ndp_ids;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005301};
5302
5303/**
5304 * struct peer_ndp_map - mapping of NDP instances to peer to VDEV
5305 * @vdev_id: session id of the interface over which ndp is being created
5306 * @peer_ndi_mac_addr: peer NDI mac address
5307 * @num_active_ndp_sessions: number of active NDP sessions on the peer
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07005308 * @type: NDP end indication type
5309 * @reason_code: NDP end indication reason code
5310 * @ndp_instance_id: NDP instance ID
Ravi Joshi412f23d2016-05-26 15:09:23 -07005311 *
5312 */
5313struct peer_ndp_map {
5314 uint32_t vdev_id;
5315 struct qdf_mac_addr peer_ndi_mac_addr;
5316 uint32_t num_active_ndp_sessions;
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07005317 enum ndp_end_type type;
5318 enum ndp_end_reason_code reason_code;
5319 uint32_t ndp_instance_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005320};
5321
5322/**
5323 * struct ndp_end_rsp_event - firmware response to ndp end request
5324 * @transaction_id: unique identifier for the request
Naveen Rawatf28315c2016-06-29 18:06:02 -07005325 * @status: status of operation
5326 * @reason: reason(opaque to host driver)
Ravi Joshi412f23d2016-05-26 15:09:23 -07005327 *
5328 */
5329struct ndp_end_rsp_event {
5330 uint32_t transaction_id;
Naveen Rawatf28315c2016-06-29 18:06:02 -07005331 uint32_t status;
5332 uint32_t reason;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005333};
5334
5335/**
5336 * struct ndp_end_indication_event - ndp termination notification from FW
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07005337 * @num_ndp_ids: number of NDP ids
5338 * @ndp_map: mapping of NDP instances to peer and vdev
Ravi Joshi412f23d2016-05-26 15:09:23 -07005339 *
5340 */
5341struct ndp_end_indication_event {
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07005342 uint32_t num_ndp_ids;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005343 struct peer_ndp_map ndp_map[];
5344};
5345
5346/**
5347 * struct ndp_schedule_update_req - ndp schedule update request
5348 * @transaction_id: unique identifier
5349 * @vdev_id: session id of the interface over which ndp is being created
5350 * @ndp_instance_id: ndp instance id for which schedule update is requested
5351 * @ndp_qos: new set of qos parameters
5352 *
5353 */
5354struct ndp_schedule_update_req {
5355 uint32_t transaction_id;
5356 uint32_t vdev_id;
5357 uint32_t ndp_instance_id;
5358 struct ndp_qos_cfg ndp_qos;
5359};
5360
5361/**
5362 * struct ndp_schedule_update_rsp - ndp schedule update response
5363 * @transaction_id: unique identifier
5364 * @vdev_id: session id of the interface over which ndp is being created
5365 * @status: status of the request
5366 * @reason: reason code for failure if any
5367 *
5368 */
5369struct ndp_schedule_update_rsp {
5370 uint32_t transaction_id;
5371 uint32_t vdev_id;
5372 uint32_t status;
5373 uint32_t reason;
5374};
5375
5376/**
5377 * struct sme_ndp_peer_ind - ndp peer indication
5378 * @msg_type: message id
5379 * @msg_len: message length
5380 * @session_id: session id
5381 * @peer_mac_addr: peer mac address
5382 * @sta_id: station id
5383 *
5384 */
5385struct sme_ndp_peer_ind {
5386 uint16_t msg_type;
5387 uint16_t msg_len;
5388 uint8_t session_id;
5389 struct qdf_mac_addr peer_mac_addr;
5390 uint16_t sta_id;
5391};
Nachiket Kukade2fb1fdb2019-01-08 15:35:27 +05305392#endif /* WLAN_FEATURE_NAN */
Ravi Joshi412f23d2016-05-26 15:09:23 -07005393
Peng Xu8fdaa492016-06-22 10:20:47 -07005394/**
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05305395 * struct sir_set_tx_rx_aggregation_size - sets tx rx aggregation size
5396 * @vdev_id: vdev id of the session
Arif Hussain0e246802018-05-01 18:13:44 -07005397 * @aggr_type: TX Aggregation Type (0=A-MPDU, 1=A-MSDU)
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05305398 * @tx_aggregation_size: Tx aggregation size
Paul Zhangee09f8e2018-04-23 16:11:32 +08005399 * @tx_aggregation_size_be: Tx aggregation size for be queue
5400 * @tx_aggregation_size_bk: Tx aggregation size for bk queue
5401 * @tx_aggregation_size_vi: Tx aggregation size for vi queue
5402 * @tx_aggregation_size_vo: Tx aggregation size for vo queue
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05305403 * @rx_aggregation_size: Rx aggregation size
5404 */
5405struct sir_set_tx_rx_aggregation_size {
5406 uint8_t vdev_id;
Arif Hussain0e246802018-05-01 18:13:44 -07005407 wmi_vdev_custom_aggr_type_t aggr_type;
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05305408 uint32_t tx_aggregation_size;
Paul Zhangee09f8e2018-04-23 16:11:32 +08005409 uint32_t tx_aggregation_size_be;
5410 uint32_t tx_aggregation_size_bk;
5411 uint32_t tx_aggregation_size_vi;
5412 uint32_t tx_aggregation_size_vo;
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05305413 uint32_t rx_aggregation_size;
5414};
5415
5416/**
stonez26388d02018-10-17 13:37:48 +08005417 * struct sir_set_tx_sw_retry_threshold - set sw retry threshold
Paul Zhang33fae272018-04-23 16:19:00 +08005418 * @vdev_id: vdev id of the session
stonez26388d02018-10-17 13:37:48 +08005419 * @tx_aggr_sw_retry_threshold_be: aggr sw retry threshold for BE
5420 * @tx_aggr_sw_retry_threshold_bk: aggr sw retry threshold for BK
5421 * @tx_aggr_sw_retry_threshold_vi: aggr sw retry threshold for VI
5422 * @tx_aggr_sw_retry_threshold_vo: aggr sw retry threshold for VO
5423 * @tx_non_aggr_sw_retry_threshold_be: non aggr sw retry threshold for BE
5424 * @tx_non_aggr_sw_retry_threshold_bk: non aggr sw retry threshold for BK
5425 * @tx_non_aggr_sw_retry_threshold_vi: non aggr sw retry threshold for VI
5426 * @tx_non_aggr_sw_retry_threshold_vo: non aggr sw retry threshold for VO
Paul Zhang33fae272018-04-23 16:19:00 +08005427 */
stonez26388d02018-10-17 13:37:48 +08005428struct sir_set_tx_sw_retry_threshold {
Paul Zhang33fae272018-04-23 16:19:00 +08005429 uint8_t vdev_id;
5430 uint32_t tx_aggr_sw_retry_threshold_be;
5431 uint32_t tx_aggr_sw_retry_threshold_bk;
5432 uint32_t tx_aggr_sw_retry_threshold_vi;
5433 uint32_t tx_aggr_sw_retry_threshold_vo;
stonez26388d02018-10-17 13:37:48 +08005434 uint32_t tx_non_aggr_sw_retry_threshold_be;
5435 uint32_t tx_non_aggr_sw_retry_threshold_bk;
5436 uint32_t tx_non_aggr_sw_retry_threshold_vi;
5437 uint32_t tx_non_aggr_sw_retry_threshold_vo;
Paul Zhang33fae272018-04-23 16:19:00 +08005438};
5439
5440/**
Peng Xu8fdaa492016-06-22 10:20:47 -07005441 * struct sir_p2p_lo_start - p2p listen offload start
5442 * @vdev_id: vdev identifier
5443 * @ctl_flags: control flag
5444 * @freq: p2p listen frequency
5445 * @period: listen offload period
5446 * @interval: listen offload interval
5447 * @count: number listen offload intervals
5448 * @device_types: device types
5449 * @dev_types_len: device types length
5450 * @probe_resp_tmplt: probe response template
5451 * @probe_resp_len: probe response template length
5452 */
5453struct sir_p2p_lo_start {
5454 uint32_t vdev_id;
5455 uint32_t ctl_flags;
5456 uint32_t freq;
5457 uint32_t period;
5458 uint32_t interval;
5459 uint32_t count;
5460 uint8_t *device_types;
5461 uint32_t dev_types_len;
5462 uint8_t *probe_resp_tmplt;
5463 uint32_t probe_resp_len;
5464};
5465
5466/**
5467 * struct sir_p2p_lo_event - P2P listen offload stop event
5468 * @vdev_id: vdev identifier
5469 * @reason_code: P2P listen offload stop reason
5470 */
5471struct sir_p2p_lo_event {
5472 uint32_t vdev_id;
5473 uint32_t reason_code;
5474};
Manjeet Singhf82ed072016-07-08 11:40:00 +05305475
5476/**
5477 * struct sir_hal_pwr_dbg_cmd - unit test command parameters
5478 * @pdev_id: pdev id
5479 * @module_id: module id
5480 * @num_args: number of arguments
5481 * @args: arguments
5482 */
5483struct sir_mac_pwr_dbg_cmd {
5484 uint32_t pdev_id;
5485 uint32_t module_id;
5486 uint32_t num_args;
5487 uint32_t args[MAX_POWER_DBG_ARGS_SUPPORTED];
5488};
5489
Kondabattini, Ganesh3f2d02c2016-09-13 12:23:47 +05305490/**
5491 * struct sme_send_disassoc_frm_req - send disassoc request frame
5492 * @msg_type: message type
5493 * @length: length of message
5494 * @session_id: session id
5495 * @trans_id: transaction id
5496 * @peer_mac: peer mac address
5497 * @reason: reason for disassoc
5498 * @wait_for_ack: wait for acknowledgment
5499 **/
5500 struct sme_send_disassoc_frm_req {
5501 uint16_t msg_type;
5502 uint16_t length;
5503 uint8_t session_id;
5504 uint16_t trans_id;
5505 uint8_t peer_mac[6];
5506 uint16_t reason;
5507 uint8_t wait_for_ack;
5508 };
5509
Kondabattini, Ganeshe4f18e02016-09-13 13:01:22 +05305510/**
5511 * struct sme_update_access_policy_vendor_ie - update vendor ie and access
5512 * policy
5513 * @msg_type: message id
5514 * @msg_len: message length
5515 * @sme_session_id: sme session id
5516 * @ie: vendor ie
5517 * @access_policy: access policy for vendor ie
5518 */
5519struct sme_update_access_policy_vendor_ie {
5520 uint16_t msg_type;
5521 uint16_t length;
5522 uint32_t sme_session_id;
Jeff Johnsonaffc4da2018-11-16 14:10:07 -08005523 uint8_t ie[SIR_MAC_MAX_IE_LENGTH + 2];
Kondabattini, Ganeshe4f18e02016-09-13 13:01:22 +05305524 uint8_t access_policy;
5525};
5526
Padma, Santhosh Kumard7cc0792016-06-28 18:54:12 +05305527/**
Agrawal, Ashish35b251d2016-09-08 19:21:03 +05305528 * struct sme_tx_fail_cnt_threshold - tx failure count for disconnect to fw
5529 * @session_id: Session id
5530 * @tx_fail_cnt_threshold: Tx failure count to do disconnect
5531 */
5532struct sme_tx_fail_cnt_threshold {
5533 uint8_t session_id;
5534 uint32_t tx_fail_cnt_threshold;
5535};
Agrawal Ashishda3e9502016-09-21 17:43:51 +05305536
5537/**
5538 * struct sme_short_retry_limit - transmission retry limit for short frames.
5539 * @session_id: Session id
5540 * @short_retry_limit: tranmission retry limit for short frame.
5541 *
5542 */
5543struct sme_short_retry_limit {
5544 uint8_t session_id;
5545 uint32_t short_retry_limit;
5546};
5547
5548/**
5549 * struct sme_long_retry_limit - tranmission retry limit for long frames
5550 * @session_id: Session id
5551 * @short_retry_limit: tranmission retry limit for long frames.
5552 *
5553 */
5554struct sme_long_retry_limit {
5555 uint8_t session_id;
5556 uint32_t long_retry_limit;
5557};
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05305558
5559/**
Kiran Kumar Lokere08195ef2018-01-17 19:25:15 -08005560 * struct sme_addba_accept - Allow/reject the addba request frame
5561 * @session_id: Session id
5562 * @addba_accept: Allow/reject the addba request frame
5563 */
5564struct sme_addba_accept {
5565 uint8_t session_id;
5566 uint8_t addba_accept;
5567};
5568
5569/**
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05305570 * struct sme_sta_inactivity_timeout - set sta_inactivity_timeout
5571 * @session_id: session Id.
5572 * @sta_inactivity_timeout: Timeout to disconnect STA after there
5573 * is no activity.
5574 */
5575struct sme_sta_inactivity_timeout {
5576 uint8_t session_id;
5577 uint32_t sta_inactivity_timeout;
5578};
Yingying Tang95409972016-10-20 15:16:15 +08005579
5580/*
5581 * struct wow_pulse_mode - WoW Pulse set cmd struct
5582 * @wow_pulse_enable: enable or disable this feature
5583 * @wow_pulse_pin: GPIO PIN for Pulse
5584 * @wow_pulse_interval_low: Pulse interval low
5585 * @wow_pulse_interval_high: Pulse interval high
5586 *
5587 * SME uses this structure to configure wow pulse info
5588 * and send it to WMA
5589 */
5590struct wow_pulse_mode {
5591 bool wow_pulse_enable;
5592 uint8_t wow_pulse_pin;
5593 uint16_t wow_pulse_interval_high;
5594 uint16_t wow_pulse_interval_low;
5595};
5596
Rajeev Kumare406d652017-01-30 17:47:05 -08005597
5598/**
Rajeev Kumard138ac52017-01-30 18:38:37 -08005599 * umac_send_mb_message_to_mac(): post message to umac
Rajeev Kumare406d652017-01-30 17:47:05 -08005600 * @msg: opaque message pointer
5601 *
5602 * Return: QDF status
5603 */
Rajeev Kumard138ac52017-01-30 18:38:37 -08005604QDF_STATUS umac_send_mb_message_to_mac(void *msg);
Rajeev Kumare406d652017-01-30 17:47:05 -08005605
Kapil Gupta4f0c0c12017-02-07 15:21:15 +05305606/**
5607 * struct scan_chan_info - channel info
5608 * @freq: radio frequence
5609 * @cmd flag: cmd flag
5610 * @noise_floor: noise floor
5611 * @cycle_count: cycle count
5612 * @rx_clear_count: rx clear count
5613 * @tx_frame_count: TX frame count
5614 * @clock_freq: clock frequence MHZ
5615 */
5616struct scan_chan_info {
5617 uint32_t freq;
5618 uint32_t cmd_flag;
5619 uint32_t noise_floor;
5620 uint32_t cycle_count;
5621 uint32_t rx_clear_count;
5622 uint32_t tx_frame_count;
5623 uint32_t clock_freq;
5624};
Dustin Brown54096432017-02-23 13:00:44 -08005625
5626/**
5627 * enum wow_resume_trigger - resume trigger override setting values
5628 * @WOW_RESUME_TRIGGER_DEFAULT: fw to use platform default resume trigger
5629 * @WOW_RESUME_TRIGGER_HTC_WAKEUP: force fw to use HTC Wakeup to resume
5630 * @WOW_RESUME_TRIGGER_GPIO: force fw to use GPIO to resume
5631 * @WOW_RESUME_TRIGGER_COUNT: number of resume trigger options
5632 */
5633enum wow_resume_trigger {
5634 /* always first */
5635 WOW_RESUME_TRIGGER_DEFAULT = 0,
5636 WOW_RESUME_TRIGGER_HTC_WAKEUP,
5637 WOW_RESUME_TRIGGER_GPIO,
5638 /* always last */
5639 WOW_RESUME_TRIGGER_COUNT
5640};
5641
5642/**
5643 * enum wow_interface_pause - interface pause override setting values
5644 * @WOW_INTERFACE_PAUSE_DEFAULT: use platform default interface pause setting
5645 * @WOW_INTERFACE_PAUSE_ENABLE: force interface pause setting to enabled
5646 * @WOW_INTERFACE_PAUSE_DISABLE: force interface pause setting to disabled
5647 * @WOW_INTERFACE_PAUSE_COUNT: number of interface pause options
5648 */
5649enum wow_interface_pause {
5650 /* always first */
5651 WOW_INTERFACE_PAUSE_DEFAULT = 0,
5652 WOW_INTERFACE_PAUSE_ENABLE,
5653 WOW_INTERFACE_PAUSE_DISABLE,
5654 /* always last */
5655 WOW_INTERFACE_PAUSE_COUNT
5656};
5657
5658/**
5659 * struct wow_enable_params - A collection of wow enable override parameters
5660 * @is_unit_test: true to notify fw this is a unit-test suspend
5661 * @interface_pause: used to override the interface pause indication sent to fw
5662 * @resume_trigger: used to force fw to use a particular resume method
5663 */
5664struct wow_enable_params {
5665 bool is_unit_test;
5666 enum wow_interface_pause interface_pause;
5667 enum wow_resume_trigger resume_trigger;
5668};
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07005669
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08005670#define HE_LTF_1X 0
5671#define HE_LTF_2X 1
5672#define HE_LTF_4X 2
5673
5674#define HE_LTF_ALL 0x7
5675#define HE_SGI_MASK 0xFF00
5676
5677#define AUTO_RATE_GI_400NS 8
5678#define AUTO_RATE_GI_800NS 9
5679#define AUTO_RATE_GI_1600NS 10
5680#define AUTO_RATE_GI_3200NS 11
5681
5682#define SET_AUTO_RATE_SGI_VAL(set_val, bit_mask) \
5683 (set_val = (set_val & HE_LTF_ALL) | bit_mask)
5684
5685#define SET_AUTO_RATE_HE_LTF_VAL(set_val, bit_mask) \
5686 (set_val = (set_val & HE_SGI_MASK) | bit_mask)
5687
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07005688#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -07005689#define HE_CAP_OUI_TYPE "\x23"
5690#define HE_CAP_OUI_SIZE 1
5691#define HE_OP_OUI_TYPE "\x24"
5692#define HE_OP_OUI_SIZE 1
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08005693
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07005694#define HE_RU_ALLOC_INDX0_MASK (0x01 << 0)
5695#define HE_RU_ALLOC_INDX1_MASK (0x01 << 1)
5696#define HE_RU_ALLOC_INDX2_MASK (0x01 << 2)
5697#define HE_RU_ALLOC_INDX3_MASK (0x01 << 3)
5698
5699/* 3 bits for NSS and 4 bits for RU Index */
5700#define HE_PPET_NSS_LEN 3
5701#define HE_PEPT_RU_IDX_LEN 4
5702#define HE_PPET_NSS_RU_LEN (HE_PPET_NSS_LEN + HE_PEPT_RU_IDX_LEN)
5703#define HE_PPET_SIZE 3
5704#define HE_BYTE_SIZE 8
5705
Naveen Rawat819158d2018-01-16 10:56:45 -08005706struct ppet_hdr {
5707 uint8_t nss:3;
5708 uint8_t ru_idx_mask:4;
5709 uint8_t remaining:1;
5710};
5711
5712/* MAX PPET size = 7 bits + (max_nss X max_ru_number X 6) = 25 bytes */
5713#define HE_MAX_PPET_SIZE WNI_CFG_HE_PPET_LEN
5714
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -08005715#define HE_MAX_PHY_CAP_SIZE 3
5716
Naveen Rawataeca1b92017-10-16 16:55:31 -07005717#define HE_CH_WIDTH_GET_BIT(ch_wd, bit) (((ch_wd) >> (bit)) & 1)
5718#define HE_CH_WIDTH_COMBINE(b0, b1, b2, b3, b4, b5, b6) \
5719 ((uint8_t)(b0) | ((b1) << 1) | ((b2) << 2) | ((b3) << 3) | \
5720 ((b4) << 4) | ((b5) << 5) | ((b6) << 6))
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -07005721
Naveen Rawataeca1b92017-10-16 16:55:31 -07005722/*
5723 * MCS values are interpreted as in IEEE 11ax-D1.4 spec onwards
5724 * +-----------------------------------------------------+
5725 * | SS8 | SS7 | SS6 | SS5 | SS4 | SS3 | SS2 | SS1 |
5726 * +-----------------------------------------------------+
5727 * | 15-14 | 13-12 | 11-10 | 9-8 | 7-6 | 5-4 | 3-2 | 1-0 |
5728 * +-----------------------------------------------------+
5729 */
5730#define HE_MCS_NSS_SHIFT(nss) (((nss) - 1) << 1)
5731#define HE_MCS_MSK_4_NSS(nss) (3 << HE_MCS_NSS_SHIFT(nss))
5732#define HE_MCS_INV_MSK_4_NSS(nss) (~HE_MCS_MSK_4_NSS(nss))
5733#define HE_GET_MCS_4_NSS(mcs_set, nss) \
5734 (((mcs_set) >> HE_MCS_NSS_SHIFT(nss)) & 3)
5735#define HE_SET_MCS_4_NSS(mcs_set, mcs, nss) \
5736 (((mcs_set) & HE_MCS_INV_MSK_4_NSS(nss)) | \
5737 ((mcs) << HE_MCS_NSS_SHIFT(nss)))
5738#define HE_MCS_IS_NSS_ENABLED(mcs_set, nss) \
5739 ((HE_MCS_MSK_4_NSS(nss) & (mcs_set)) != HE_MCS_MSK_4_NSS(nss))
5740
5741#define HE_MCS_ALL_DISABLED 0xFFFF
Kiran Kumar Lokere59a569e2018-01-24 15:00:50 -08005742
5743#define HE_MCS_0_7 0x0
5744#define HE_MCS_0_9 0x1
5745#define HE_MCS_0_11 0x2
5746#define HE_MCS_DISABLE 0x3
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08005747
Naveen Rawataeca1b92017-10-16 16:55:31 -07005748/*
5749 * Following formuala has been arrived at using karnaugh map and unit tested
5750 * with sample code. Take MCS for each NSS as 2 bit value first and solve for
5751 * 2 bit intersection of NSS. Use following table/Matrix as guide for solving
5752 * K-Maps
5753 * MCS 1\MCS 2 00 01 10 11
5754 * 00 00 00 00 11
5755 * 01 00 01 01 11
5756 * 10 00 01 10 11
5757 * 11 11 11 11 11
5758 * if output MCS is o1o0, then as per K-map reduction:
5759 * o0 = m1.m0 | n1.n0 | (~m1).m0.(n1^n0) | (~n1).n0.(m1^m0)
5760 * o1 = m1.m0 | n1.n0 | m1.(~m0).n1.(~n0)
5761 *
5762 * Please note: Calculating MCS intersection is 80211 protocol specific and
5763 * should be implemented in PE. WMA can use this macro rather than calling any
5764 * lim API to do the intersection.
5765 */
5766#define HE_INTERSECT_MCS_BITS_PER_NSS(m1, m0, n1, n0) \
5767 (((m1 & m0) | (n1 & n0) | (((~m1) & m0) & (n1 ^ n0)) | \
5768 (((~n1) & n0) & (m1 ^ m0))) | (((m1 & m0) | (n1 & n0) | \
5769 (m1 & ~m0 & n1 & ~n0)) << 1))
5770
5771/* following takes MCS as 2 bits */
5772#define HE_INTERSECT_MCS_PER_NSS(mcs_1, mcs_2) \
5773 HE_INTERSECT_MCS_BITS_PER_NSS((mcs_1 >> 1), (mcs_1 & 1), \
5774 (mcs_2 >> 1), (mcs_2 & 1))
5775
5776/* following takes MCS as 16 bits */
5777#define HE_INTERSECT_MCS(mcs_1, mcs_2) ( \
5778 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 1), \
5779 HE_GET_MCS_4_NSS(mcs_2, 1)) << HE_MCS_NSS_SHIFT(1) | \
5780 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 2), \
5781 HE_GET_MCS_4_NSS(mcs_2, 2)) << HE_MCS_NSS_SHIFT(2) | \
5782 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 3), \
5783 HE_GET_MCS_4_NSS(mcs_2, 3)) << HE_MCS_NSS_SHIFT(3) | \
5784 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 4), \
5785 HE_GET_MCS_4_NSS(mcs_2, 4)) << HE_MCS_NSS_SHIFT(4) | \
5786 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 5), \
5787 HE_GET_MCS_4_NSS(mcs_2, 5)) << HE_MCS_NSS_SHIFT(5) | \
5788 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 6), \
5789 HE_GET_MCS_4_NSS(mcs_2, 6)) << HE_MCS_NSS_SHIFT(6) | \
5790 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 7), \
5791 HE_GET_MCS_4_NSS(mcs_2, 7)) << HE_MCS_NSS_SHIFT(7) | \
5792 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 8), \
5793 HE_GET_MCS_4_NSS(mcs_2, 8)) << HE_MCS_NSS_SHIFT(8))
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -07005794
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -08005795/**
5796 * struct he_capability - to store 11ax HE capabilities
5797 * @phy_cap: HE PHY capabilities
5798 * @mac_cap: HE MAC capabilities
5799 * @mcs: HE MCS
5800 * @ppet: HE PPE threshold
5801 */
5802struct he_capability {
5803 uint32_t phy_cap[HE_MAX_PHY_CAP_SIZE];
5804 uint32_t mac_cap;
5805 uint32_t mcs;
5806 struct wlan_psoc_host_ppe_threshold ppet;
5807};
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07005808#endif
5809
Naveen Rawataeca1b92017-10-16 16:55:31 -07005810#define HE_GET_NSS(mcs, nss) \
5811 do { \
5812 (nss) = 0; \
Naveen Rawatcbcc6542017-10-30 17:55:03 -07005813 while ((((mcs) >> ((nss)*2)) & 3) != 3 && nss < 8) \
Naveen Rawataeca1b92017-10-16 16:55:31 -07005814 (nss)++; \
5815 } while (0)
5816
Nitesh Shah99dd9552017-03-20 19:27:47 +05305817/**
5818 * struct sir_del_all_tdls_peers - delete all tdls peers
5819 * @msg_type: type of message
5820 * @msg_len: length of message
5821 * @bssid: bssid of peer device
5822 */
5823struct sir_del_all_tdls_peers {
5824 uint16_t msg_type;
5825 uint16_t msg_len;
5826 struct qdf_mac_addr bssid;
5827};
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08005828
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05305829/**
5830 * struct rsp_stats - arp packet stats
5831 * @arp_req_enqueue: fw tx count
5832 * @arp_req_tx_success: tx ack count
5833 * @arp_req_tx_failure: tx ack fail count
5834 * @arp_rsp_recvd: rx fw count
5835 * @out_of_order_arp_rsp_drop_cnt: out of order count
5836 * @dad_detected: dad detected
5837 * @connect_status: connection status
5838 * @ba_session_establishment_status: BA session status
Poddar, Siddarth465330e2018-01-08 18:23:54 +05305839 * @connect_stats_present: connectivity stats present or not
5840 * @tcp_ack_recvd: tcp syn ack's count
5841 * @icmpv4_rsp_recvd: icmpv4 responses count
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05305842 */
5843struct rsp_stats {
5844 uint32_t vdev_id;
5845 uint32_t arp_req_enqueue;
5846 uint32_t arp_req_tx_success;
5847 uint32_t arp_req_tx_failure;
5848 uint32_t arp_rsp_recvd;
5849 uint32_t out_of_order_arp_rsp_drop_cnt;
5850 uint32_t dad_detected;
5851 uint32_t connect_status;
5852 uint32_t ba_session_establishment_status;
Poddar, Siddarth465330e2018-01-08 18:23:54 +05305853 bool connect_stats_present;
5854 uint32_t tcp_ack_recvd;
5855 uint32_t icmpv4_rsp_recvd;
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05305856};
5857
5858/**
5859 * struct set_arp_stats_params - set/reset arp stats
5860 * @vdev_id: session id
5861 * @flag: enable/disable stats
5862 * @pkt_type: type of packet(1 - arp)
5863 * @ip_addr: subnet ipv4 address in case of encrypted packets
Poddar, Siddarth465330e2018-01-08 18:23:54 +05305864 * @pkt_type_bitmap: pkt bitmap
5865 * @tcp_src_port: tcp src port for pkt tracking
5866 * @tcp_dst_port: tcp dst port for pkt tracking
5867 * @icmp_ipv4: target ipv4 address to track ping packets
5868 * @reserved: reserved
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05305869 */
5870struct set_arp_stats_params {
5871 uint32_t vdev_id;
5872 uint8_t flag;
5873 uint8_t pkt_type;
5874 uint32_t ip_addr;
Poddar, Siddarth465330e2018-01-08 18:23:54 +05305875 uint32_t pkt_type_bitmap;
5876 uint32_t tcp_src_port;
5877 uint32_t tcp_dst_port;
5878 uint32_t icmp_ipv4;
5879 uint32_t reserved;
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05305880};
5881
5882/**
5883 * struct get_arp_stats_params - get arp stats from firmware
5884 * @pkt_type: packet type(1 - ARP)
5885 * @vdev_id: session id
5886 */
5887struct get_arp_stats_params {
5888 uint8_t pkt_type;
5889 uint32_t vdev_id;
5890};
5891
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05305892typedef void (*sme_rcpi_callback)(void *context, struct qdf_mac_addr mac_addr,
5893 int32_t rcpi, QDF_STATUS status);
5894/**
5895 * struct sme_rcpi_req - structure for querying rcpi info
5896 * @session_id: session for which rcpi is required
5897 * @measurement_type: type of measurement from enum rcpi_measurement_type
5898 * @rcpi_callback: callback function to be invoked for rcpi response
5899 * @rcpi_context: context info for rcpi callback
5900 * @mac_addr: peer addr for which rcpi is required
5901 */
5902struct sme_rcpi_req {
5903 uint32_t session_id;
5904 enum rcpi_measurement_type measurement_type;
5905 sme_rcpi_callback rcpi_callback;
5906 void *rcpi_context;
5907 struct qdf_mac_addr mac_addr;
5908};
5909
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08005910/*
5911 * @SCAN_REJECT_DEFAULT: default value
5912 * @CONNECTION_IN_PROGRESS: connection is in progress
5913 * @REASSOC_IN_PROGRESS: reassociation is in progress
5914 * @EAPOL_IN_PROGRESS: STA/P2P-CLI is in middle of EAPOL/WPS exchange
5915 * @SAP_EAPOL_IN_PROGRESS: SAP/P2P-GO is in middle of EAPOL/WPS exchange
5916 */
5917enum scan_reject_states {
5918 SCAN_REJECT_DEFAULT = 0,
5919 CONNECTION_IN_PROGRESS,
5920 REASSOC_IN_PROGRESS,
5921 EAPOL_IN_PROGRESS,
5922 SAP_EAPOL_IN_PROGRESS,
5923};
Sandeep Puligillaf587adf2017-04-27 19:53:21 -07005924
5925/**
lifeng66831662017-05-19 16:01:35 +08005926 * sir_sme_rx_aggr_hole_ind - sme rx aggr hole indication
5927 * @hole_cnt: num of holes detected
5928 * @hole_info_array: hole info
5929 */
5930struct sir_sme_rx_aggr_hole_ind {
5931 uint32_t hole_cnt;
5932 uint32_t hole_info_array[];
5933};
5934
5935/**
5936 * struct sir_set_rx_reorder_timeout_val - rx reorder timeout
5937 * @rx_timeout_pri: reorder timeout for AC
5938 * rx_timeout_pri[0] : AC_VO
5939 * rx_timeout_pri[1] : AC_VI
5940 * rx_timeout_pri[2] : AC_BE
5941 * rx_timeout_pri[3] : AC_BK
5942 */
5943struct sir_set_rx_reorder_timeout_val {
5944 uint32_t rx_timeout_pri[4];
5945};
5946
5947/**
5948 * struct sir_peer_set_rx_blocksize - set rx blocksize
5949 * @vdev_id: vdev id
5950 * @peer_macaddr: peer mac address
5951 * @rx_block_ack_win_limit: windows size limitation
5952 */
5953struct sir_peer_set_rx_blocksize {
5954 uint32_t vdev_id;
5955 struct qdf_mac_addr peer_macaddr;
5956 uint32_t rx_block_ack_win_limit;
5957};
Abhishek Singhf3756fc2017-06-28 16:04:06 +05305958
5959/**
5960 * struct sir_rssi_disallow_lst - Structure holding Rssi based avoid candidate
5961 * list
5962 * @node: Node pointer
5963 * @bssid: BSSID of the AP
5964 * @retry_delay: Retry delay received during last rejection in ms
5965 * @ expected_rssi: RSSI at which STA can initate
5966 * @time_during_rejection: Timestamp during last rejection in millisec
5967 */
5968struct sir_rssi_disallow_lst {
5969 qdf_list_node_t node;
5970 struct qdf_mac_addr bssid;
5971 uint32_t retry_delay;
5972 int8_t expected_rssi;
5973 qdf_time_t time_during_rejection;
5974};
lifengd217d192017-05-09 19:44:16 +08005975
5976/**
5977 * struct chain_rssi_result - chain rssi result
Jeff Johnson00634ab2018-05-10 14:27:50 -07005978 * num_chains_valid: valid chain num
lifengd217d192017-05-09 19:44:16 +08005979 * @chain_rssi: chain rssi result as dBm unit
stonez396a9732019-01-16 12:29:16 +08005980 * @chain_evm: error vector magnitude
lifengfe6c3e22018-04-03 12:10:04 +08005981 * @ant_id: antenna id
lifengd217d192017-05-09 19:44:16 +08005982 */
lifengfe6c3e22018-04-03 12:10:04 +08005983#define CHAIN_MAX_NUM 8
lifengd217d192017-05-09 19:44:16 +08005984struct chain_rssi_result {
lifengfe6c3e22018-04-03 12:10:04 +08005985 uint32_t num_chains_valid;
5986 uint32_t chain_rssi[CHAIN_MAX_NUM];
stonez396a9732019-01-16 12:29:16 +08005987 int32_t chain_evm[CHAIN_MAX_NUM];
lifengfe6c3e22018-04-03 12:10:04 +08005988 uint32_t ant_id[CHAIN_MAX_NUM];
lifengd217d192017-05-09 19:44:16 +08005989};
5990
5991/**
5992 * struct get_chain_rssi_req_params - get chain rssi req params
5993 * @peer_macaddr: specific peer mac address
5994 * @session_id: session id
5995 */
5996struct get_chain_rssi_req_params {
5997 struct qdf_mac_addr peer_macaddr;
5998 uint8_t session_id;
5999};
6000
Ganesh Kondabattini35739572017-06-21 16:26:39 +05306001/*
6002 * struct sir_limit_off_chan - limit off-channel command parameters
6003 * @vdev_id: vdev id
6004 * @is_tos_active: status of the traffic (active/inactive)
6005 * @max_off_chan_time: max allowed off channel time
6006 * @rest_time: home channel time
6007 * @skip_dfs_chans: skip dfs channels during scan
6008 */
6009struct sir_limit_off_chan {
6010 uint8_t vdev_id;
6011 bool is_tos_active;
6012 uint32_t max_off_chan_time;
6013 uint32_t rest_time;
6014 bool skip_dfs_chans;
6015};
Padma, Santhosh Kumarb38ab512018-01-16 16:16:46 +05306016
Rajeev Kumar Sirasanagandla4f20b672018-03-12 13:52:50 +05306017typedef void (*roam_scan_stats_cb)(void *context,
6018 struct wmi_roam_scan_stats_res *res);
6019
6020/**
6021 * struct sir_roam_scan_stats - Stores roam scan context
6022 * @vdev_id: vdev id
6023 * @cb: callback to be invoked for roam scan stats response
6024 * @context: context of callback
6025 */
6026struct sir_roam_scan_stats {
6027 uint32_t vdev_id;
6028 roam_scan_stats_cb cb;
6029 void *context;
6030};
6031
Padma, Santhosh Kumarb38ab512018-01-16 16:16:46 +05306032/**
6033 * struct sae_info - SAE info used for commit/confirm messages
6034 * @msg_type: Message type
6035 * @msg_len: length of message
6036 * @vdev_id: vdev id
6037 * @peer_mac_addr: peer MAC address
6038 * @ssid: SSID
6039 */
6040struct sir_sae_info {
6041 uint16_t msg_type;
6042 uint16_t msg_len;
6043 uint32_t vdev_id;
6044 struct qdf_mac_addr peer_mac_addr;
6045 tSirMacSSid ssid;
6046};
Padma, Santhosh Kumardd3f4852018-01-16 18:51:51 +05306047
6048/**
6049 * struct sir_sae_msg - SAE msg used for message posting
6050 * @message_type: message type
6051 * @length: message length
6052 * @session_id: SME session id
6053 * @sae_status: SAE status, 0: Success, Non-zero: Failure.
6054 */
6055struct sir_sae_msg {
6056 uint16_t message_type;
6057 uint16_t length;
6058 uint16_t session_id;
6059 uint8_t sae_status;
6060};
6061
Varun Reddy Yeturu951de5d2018-09-10 21:36:22 -07006062/**
6063 * struct set_pcl_req - Request message to set the PCL
6064 * @chan_weights: PCL channel weights
6065 * @band: Supported band
6066 */
6067struct set_pcl_req {
6068 struct wmi_pcl_chan_weights chan_weights;
6069 enum band_info band;
6070};
6071
Visweswara Tanuku633976b2019-01-07 16:13:12 +05306072/**
6073 * struct sir_md_evt - motion detection event status
6074 * @vdev_id: vdev id
6075 * @status: md event status
6076 */
6077#ifdef WLAN_FEATURE_MOTION_DETECTION
6078struct sir_md_evt {
6079 uint8_t vdev_id;
6080 uint32_t status;
6081};
6082#endif /* WLAN_FEATURE_MOTION_DETECTION */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08006083#endif /* __SIR_API_H */