blob: b9102030560ab2bbaa84a2629cebeaff5c88c853 [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
Dustin Browna19834b2019-02-04 14:40:26 -080051#define SIR_MAX_SUPPORTED_BSS WLAN_MAX_VDEVS
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -080052
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080053#define OFFSET_OF(structType, fldName) (&((structType *)0)->fldName)
54
55/* / Max supported channel list */
56#define SIR_MAX_SUPPORTED_CHANNEL_LIST 96
Wu Gao0821b0d2019-01-11 17:31:11 +080057#define CFG_VALID_CHANNEL_LIST_LEN 100
Wu Gaoaa155142019-01-14 15:09:26 +080058#define CFG_COUNTRY_CODE_LEN 3
59
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080060
61#define SIR_MDIE_ELEMENT_ID 54
Srinivas Girigowdad65dc5a2016-01-14 17:08:26 -080062#define SIR_MDIE_SIZE 3 /* MD ID(2 bytes), Capability(1 byte) */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080063
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +053064#define SIR_MAX_ELEMENT_ID 255
65
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080066#define SIR_BCN_REPORT_MAX_BSS_DESC 4
67
68#define SIR_NUM_11B_RATES 4 /* 1,2,5.5,11 */
69#define SIR_NUM_11A_RATES 8 /* 6,9,12,18,24,36,48,54 */
70
71#define SIR_PM_SLEEP_MODE 0
72#define SIR_PM_ACTIVE_MODE 1
73
74/* hidden SSID options */
75#define SIR_SCAN_NO_HIDDEN_SSID 0
76#define SIR_SCAN_HIDDEN_SSID_PE_DECISION 1
77
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080078#define SIR_IPV4_ADDR_LEN 4
79
80typedef uint8_t tSirIpv4Addr[SIR_IPV4_ADDR_LEN];
81
82#define SIR_VERSION_STRING_LEN 64
83typedef uint8_t tSirVersionString[SIR_VERSION_STRING_LEN];
84
85/* Periodic Tx pattern offload feature */
86#define PERIODIC_TX_PTRN_MAX_SIZE 1536
87#define MAXNUM_PERIODIC_TX_PTRNS 6
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080088
Abhishek Singhd1f21c72019-01-21 15:16:34 +053089
90/* FW response timeout values in milli seconds */
91#define SIR_PEER_ASSOC_TIMEOUT (2000) /* 1 seconds */
92#define SIR_DELETE_STA_TIMEOUT (2000) /* 2 seconds */
93#define SIR_VDEV_START_REQUEST_TIMEOUT (6000)
94#define SIR_VDEV_STOP_REQUEST_TIMEOUT (2000)
95#define SIR_VDEV_PLCY_MGR_TIMEOUT (2000)
96
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080097/* This should not be greater than MAX_NUMBER_OF_CONC_CONNECTIONS */
98#define MAX_VDEV_SUPPORTED 4
99
Manjeet Singhf82ed072016-07-08 11:40:00 +0530100#define MAX_POWER_DBG_ARGS_SUPPORTED 8
Agrawal Ashishad16bda2016-09-16 20:16:04 +0530101#define QOS_MAP_MAX_EX 21
102#define QOS_MAP_LEN_MIN 16
103#define QOS_MAP_LEN_MAX \
104 (QOS_MAP_LEN_MIN + 2 * QOS_MAP_MAX_EX)
Himanshu Agarwal37e42412016-07-21 14:35:09 +0530105#define NUM_CHAINS_MAX 2
106
Abhishek Singhf3756fc2017-06-28 16:04:06 +0530107#define MAX_RSSI_AVOID_BSSID_LIST 10
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530108
109/* Maximum number of realms present in fils indication element */
110#define SIR_MAX_REALM_COUNT 7
111/* Realm length */
112#define SIR_REALM_LEN 2
113/* Cache ID length */
114#define CACHE_ID_LEN 2
115
Will Huang496b36c2017-07-11 16:38:50 +0800116/* Maximum peer station number query one time */
117#define MAX_PEER_STA 12
118
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -0800119/* Maximum number of peers for SAP */
Rachit Kankane154559c2018-07-12 14:02:30 +0530120#ifndef SIR_SAP_MAX_NUM_PEERS
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -0800121#define SIR_SAP_MAX_NUM_PEERS 32
Rachit Kankane154559c2018-07-12 14:02:30 +0530122#endif
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -0800123
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800124#define SIR_KRK_KEY_LEN 16
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800125#define SIR_BTK_KEY_LEN 32
126#define SIR_KCK_KEY_LEN 16
127#define SIR_KEK_KEY_LEN 16
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +0530128#define SIR_KEK_KEY_LEN_FILS 64
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800129#define SIR_REPLAY_CTR_LEN 8
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +0530130#define SIR_PMK_LEN 48
131#define SIR_PMKID_LEN 16
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -0800132#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800133#define SIR_UAPSD_BITOFFSET_ACVO 0
134#define SIR_UAPSD_BITOFFSET_ACVI 1
135#define SIR_UAPSD_BITOFFSET_ACBK 2
136#define SIR_UAPSD_BITOFFSET_ACBE 3
137
138#define SIR_UAPSD_FLAG_ACVO (1 << SIR_UAPSD_BITOFFSET_ACVO)
139#define SIR_UAPSD_FLAG_ACVI (1 << SIR_UAPSD_BITOFFSET_ACVI)
140#define SIR_UAPSD_FLAG_ACBK (1 << SIR_UAPSD_BITOFFSET_ACBK)
141#define SIR_UAPSD_FLAG_ACBE (1 << SIR_UAPSD_BITOFFSET_ACBE)
142#define SIR_UAPSD_GET(ac, mask) (((mask) & (SIR_UAPSD_FLAG_ ## ac)) >> SIR_UAPSD_BITOFFSET_ ## ac)
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800143
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800144#endif
145
Nachiket Kukade63bb63d2018-11-21 14:42:14 +0530146struct scheduler_msg;
147
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800148/**
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700149 * enum sir_roam_op_code - Operation to be done by the callback.
150 * @SIR_ROAM_SYNCH_PROPAGATION: Propagate the new BSS info after roaming.
151 * @SIR_ROAMING_DEREGISTER_STA: Deregister the old STA after roaming.
Naveen Rawat8cc23b02016-07-14 12:22:56 -0700152 * @SIR_ROAMING_START: Firmware started roaming operation
153 * @SIR_ROAMING_ABORT: Firmware aborted roaming operation, still connected.
154 * @SIR_ROAM_SYNCH_COMPLETE: Roam sync propagation is complete.
Arif Hussain43354e62017-05-24 11:24:25 -0700155 * @SIR_ROAMING_INVOKE_FAIL: Firmware roaming failed.
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700156 */
157enum sir_roam_op_code {
158 SIR_ROAM_SYNCH_PROPAGATION = 1,
159 SIR_ROAMING_DEREGISTER_STA,
Naveen Rawat8cc23b02016-07-14 12:22:56 -0700160 SIR_ROAMING_START,
161 SIR_ROAMING_ABORT,
162 SIR_ROAM_SYNCH_COMPLETE,
Varun Reddy Yeturu04251862016-09-16 10:33:19 -0700163 SIR_ROAM_SYNCH_NAPI_OFF,
Arif Hussain43354e62017-05-24 11:24:25 -0700164 SIR_ROAMING_INVOKE_FAIL,
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700165};
166/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800167 * Module ID definitions.
168 */
169enum {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800170 SIR_HAL_MODULE_ID = 0x10,
Wu Gao55020ec2019-01-23 14:29:58 +0800171 SIR_LIM_MODULE_ID = 0x13,
Jeff Johnsona2f8e8f2018-12-30 18:06:58 -0800172 SIR_SME_MODULE_ID,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800173};
174
175#define SIR_WMA_MODULE_ID SIR_HAL_MODULE_ID
176
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800177/* Type declarations used by Firmware and Host software */
178
179/* Scan type enum used in scan request */
180typedef enum eSirScanType {
181 eSIR_PASSIVE_SCAN,
182 eSIR_ACTIVE_SCAN,
183 eSIR_BEACON_TABLE,
184} tSirScanType;
185
gaurank kathpaliac63859d2018-05-03 18:48:41 +0530186/* Rsn Capabilities structure */
187struct rsn_caps {
188 uint16_t PreAuthSupported:1;
189 uint16_t NoPairwise:1;
190 uint16_t PTKSAReplayCounter:2;
191 uint16_t GTKSAReplayCounter:2;
192 uint16_t MFPRequired:1;
193 uint16_t MFPCapable:1;
194 uint16_t Reserved:8;
195};
196
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800197/* / Result codes Firmware return to Host SW */
198typedef enum eSirResultCodes {
199 eSIR_SME_SUCCESS,
Abhishek Singh4294f802017-08-10 16:37:07 +0530200 eSIR_LOGE_EXCEPTION,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800201 eSIR_SME_INVALID_PARAMETERS = 500,
202 eSIR_SME_UNEXPECTED_REQ_RESULT_CODE,
203 eSIR_SME_RESOURCES_UNAVAILABLE,
204 /* Unable to find a BssDescription */
205 eSIR_SME_SCAN_FAILED,
206 /* matching requested scan criteria */
207 eSIR_SME_BSS_ALREADY_STARTED_OR_JOINED,
208 eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE,
209 eSIR_SME_REFUSED,
210 eSIR_SME_JOIN_DEAUTH_FROM_AP_DURING_ADD_STA,
211 eSIR_SME_JOIN_TIMEOUT_RESULT_CODE,
212 eSIR_SME_AUTH_TIMEOUT_RESULT_CODE,
213 eSIR_SME_ASSOC_TIMEOUT_RESULT_CODE,
214 eSIR_SME_REASSOC_TIMEOUT_RESULT_CODE,
215 eSIR_SME_MAX_NUM_OF_PRE_AUTH_REACHED,
216 eSIR_SME_AUTH_REFUSED,
217 eSIR_SME_INVALID_WEP_DEFAULT_KEY,
218 eSIR_SME_NO_KEY_MAPPING_KEY_FOR_PEER,
219 eSIR_SME_ASSOC_REFUSED,
220 eSIR_SME_REASSOC_REFUSED,
221 /* Recvd Deauth while join/pre-auth */
222 eSIR_SME_DEAUTH_WHILE_JOIN,
223 eSIR_SME_STA_NOT_AUTHENTICATED,
224 eSIR_SME_STA_NOT_ASSOCIATED,
225 eSIR_SME_ALREADY_JOINED_A_BSS,
226 /* Given in SME_SCAN_RSP msg */
227 eSIR_SME_MORE_SCAN_RESULTS_FOLLOW,
228 /* that more SME_SCAN_RSP */
229 /* messages are following. */
230 /* SME_SCAN_RSP message with */
231 /* eSIR_SME_SUCCESS status */
232 /* code is the last one. */
233 /* Sent in SME_JOIN/REASSOC_RSP */
234 eSIR_SME_INVALID_ASSOC_RSP_RXED,
235 /* messages upon receiving */
236 /* invalid Re/Assoc Rsp frame. */
237 /* STOP BSS triggered by MIC failures: MAC software to
238 * disassoc all stations
239 */
240 eSIR_SME_MIC_COUNTER_MEASURES,
241 /* with MIC_FAILURE reason code and perform the stop bss operation */
242 /* didn't get rsp from peer within timeout interval */
243 eSIR_SME_ADDTS_RSP_TIMEOUT,
244 /* didn't get success rsp from HAL */
245 eSIR_SME_ADDTS_RSP_FAILED,
246 /* failed to send ch switch act frm */
247 eSIR_SME_CHANNEL_SWITCH_FAIL,
248 eSIR_SME_INVALID_STATE,
249 /* SIR_HAL_SIR_HAL_INIT_SCAN_RSP returned failed status */
250 eSIR_SME_HAL_SCAN_INIT_FAILED,
251 /* SIR_HAL_END_SCAN_RSP returned failed status */
252 eSIR_SME_HAL_SCAN_END_FAILED,
253 /* SIR_HAL_FINISH_SCAN_RSP returned failed status */
254 eSIR_SME_HAL_SCAN_FINISH_FAILED,
255 /* Failed to send a message to HAL */
256 eSIR_SME_HAL_SEND_MESSAGE_FAIL,
257 /* Failed to stop the bss */
258 eSIR_SME_STOP_BSS_FAILURE,
259 eSIR_SME_WOWL_ENTER_REQ_FAILED,
260 eSIR_SME_WOWL_EXIT_REQ_FAILED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800261 eSIR_SME_FT_REASSOC_TIMEOUT_FAILURE,
262 eSIR_SME_FT_REASSOC_FAILURE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800263 eSIR_SME_SEND_ACTION_FAIL,
264 eSIR_SME_DEAUTH_STATUS,
265 eSIR_PNO_SCAN_SUCCESS,
Varun Reddy Yeturu371404b2017-11-30 15:31:35 -0800266 eSIR_SME_INVALID_SESSION,
Varun Reddy Yeturua47f08f2018-08-07 14:45:31 -0700267 eSIR_SME_PEER_CREATE_FAILED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800268 eSIR_DONOT_USE_RESULT_CODE = SIR_MAX_ENUM_SIZE
269} tSirResultCodes;
270
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +0530271#ifdef WLAN_FEATURE_FILS_SK
272struct fils_join_rsp_params {
273 uint8_t *fils_pmk;
274 uint8_t fils_pmk_len;
275 uint8_t fils_pmkid[PMKID_LEN];
276 uint8_t kek[MAX_KEK_LEN];
277 uint8_t kek_len;
278 uint8_t tk[MAX_TK_LEN];
279 uint8_t tk_len;
280 uint8_t gtk_len;
281 uint8_t gtk[MAX_GTK_LEN];
Vignesh Viswanathana1bb0922017-09-15 12:58:48 +0530282 struct qdf_mac_addr dst_mac;
283 struct qdf_mac_addr src_mac;
284 uint16_t hlp_data_len;
285 uint8_t hlp_data[FILS_MAX_HLP_DATA_LEN];
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +0530286};
287#endif
288
Krishna Kumaar Natarajanf599c6e2015-11-03 11:44:03 -0800289#define RMENABLEDCAP_MAX_LEN 5
290
291struct rrm_config_param {
292 uint8_t rrm_enabled;
293 uint8_t max_randn_interval;
294 uint8_t rm_capability[RMENABLEDCAP_MAX_LEN];
295};
296
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800297/*
298 * although in tSirSupportedRates each IE is 16bit but PE only passes IEs in 8
299 * bits with MSB=1 for basic rates. change the mask for bit0-7 only so HAL gets
300 * correct basic rates for setting response rates.
301 */
302#define IERATE_BASICRATE_MASK 0x80
303#define IERATE_RATE_MASK 0x7f
304#define IERATE_IS_BASICRATE(x) ((x) & IERATE_BASICRATE_MASK)
305
Sreelakshmi Konamki39acb132015-12-16 13:06:22 +0530306const char *lim_bss_type_to_string(const uint16_t bss_type);
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700307/**
308 * struct sSirSupportedRates - stores rates/MCS supported
309 * @llbRates: 11b rates in unit of 500kbps
310 * @llaRates: 11a rates in unit of 500kbps
311 * @supportedMCSSet: supported basic MCS, 0-76 bits used, remaining reserved
312 * bits 0-15 and 32 should be set.
313 * @rxHighestDataRate: RX Highest Supported Data Rate defines the highest data
314 * rate that the STA is able to receive, in unites of 1Mbps
315 * This value is derived from "Supported MCS Set field"
316 * inside the HT capability element.
317 * @vhtRxMCSMap: Indicates the Maximum MCS(VHT) that can be received for each
318 * number of spacial streams
319 * @vhtRxHighestDataRate: Indicate the highest VHT data rate that the STA is
320 * able to receive
321 * @vhtTxMCSMap: Indicates the Maximum MCS(VHT) that can be transmitted for
322 * each number of spacial streams
323 * @vhtTxHighestDataRate: Indicate the highest VHT data rate that the STA is
324 * able to transmit
325 * @he_rx_mcs: Indicates the Maximum MCS(HE) that can be received for each
326 * number of spacial streams
327 * @he_tx_mcs: Indicates the Maximum MCS(HE) that can be transmitted for each
328 * number of spacial streams
329 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800330typedef struct sSirSupportedRates {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800331 uint16_t llbRates[SIR_NUM_11B_RATES];
332 uint16_t llaRates[SIR_NUM_11A_RATES];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800333 uint8_t supportedMCSSet[SIR_MAC_MAX_SUPPORTED_MCS_SET];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800334 uint16_t rxHighestDataRate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800335 uint16_t vhtRxMCSMap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800336 uint16_t vhtRxHighestDataRate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800337 uint16_t vhtTxMCSMap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800338 uint16_t vhtTxHighestDataRate;
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700339#ifdef WLAN_FEATURE_11AX
Naveen Rawataeca1b92017-10-16 16:55:31 -0700340 uint16_t rx_he_mcs_map_lt_80;
341 uint16_t tx_he_mcs_map_lt_80;
342 uint16_t rx_he_mcs_map_160;
343 uint16_t tx_he_mcs_map_160;
344 uint16_t rx_he_mcs_map_80_80;
345 uint16_t tx_he_mcs_map_80_80;
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700346#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800347} tSirSupportedRates, *tpSirSupportedRates;
348
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800349typedef struct sSirRegisterMgmtFrame {
350 uint16_t messageType;
351 uint16_t length;
352 uint8_t sessionId;
353 bool registerFrame;
354 uint16_t frameType;
355 uint16_t matchLen;
356 uint8_t matchData[1];
357} tSirRegisterMgmtFrame, *tpSirRegisterMgmtFrame;
358
359/* / Generic type for sending a response message */
360/* / with result code to host software */
361typedef struct sSirSmeRsp {
362 uint16_t messageType; /* eWNI_SME_*_RSP */
363 uint16_t length;
364 uint8_t sessionId; /* To support BT-AMP */
365 uint16_t transactionId; /* To support BT-AMP */
366 tSirResultCodes statusCode;
Kabilan Kannanf56f9d52017-04-05 03:31:34 -0700367 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800368} tSirSmeRsp, *tpSirSmeRsp;
369
370/* / Definition for indicating all modules ready on STA */
371typedef struct sSirSmeReadyReq {
372 uint16_t messageType; /* eWNI_SME_SYS_READY_IND */
373 uint16_t length;
374 uint16_t transactionId;
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800375 void *csr_roam_synch_cb;
376 void *pe_roam_synch_cb;
Vignesh Viswanathan3d478032018-08-02 20:18:53 +0530377 void *stop_roaming_cb;
Jeff Johnsone044f202018-12-02 10:27:28 -0800378 QDF_STATUS (*sme_msg_cb)(struct mac_context *mac,
Jeff Johnson5f9ce2d2018-06-09 21:20:45 -0700379 struct scheduler_msg *msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800380} tSirSmeReadyReq, *tpSirSmeReadyReq;
381
382/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800383 * struct s_sir_set_hw_mode - Set HW mode request
384 * @messageType: Message type
385 * @length: Length of the message
386 * @set_hw: Params containing the HW mode index and callback
387 */
388struct s_sir_set_hw_mode {
389 uint16_t messageType;
390 uint16_t length;
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -0800391 struct policy_mgr_hw_mode set_hw;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800392};
393
394/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800395 * struct sir_set_dual_mac_cfg - Set Dual mac config request
396 * @message_type: Message type
397 * @length: Length of the message
398 * @set_dual_mac: Params containing the dual mac config and callback
399 */
400struct sir_set_dual_mac_cfg {
401 uint16_t message_type;
402 uint16_t length;
Srinivas Girigowdaeb6ecf32018-02-15 17:04:22 -0800403 struct policy_mgr_dual_mac_config set_dual_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800404};
405
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800406/**
407 * struct sir_antenna_mode_param - antenna mode param
408 * @num_tx_chains: Number of TX chains
409 * @num_rx_chains: Number of RX chains
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800410 * @set_antenna_mode_resp: callback to set antenna mode command
Dundi Raviteja6bb9e322018-05-16 17:04:41 +0530411 * @set_antenna_mode_ctx: callback context to set antenna mode command
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800412 */
413struct sir_antenna_mode_param {
414 uint32_t num_tx_chains;
415 uint32_t num_rx_chains;
416 void *set_antenna_mode_resp;
Dundi Raviteja6bb9e322018-05-16 17:04:41 +0530417 void *set_antenna_mode_ctx;
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800418};
419
420/**
421 * struct sir_set_antenna_mode - Set antenna mode request
422 * @message_type: Message type
423 * @length: Length of the message
424 * @set_antenna_mode: Params containing antenna mode params
425 */
426struct sir_set_antenna_mode {
427 uint16_t message_type;
428 uint16_t length;
429 struct sir_antenna_mode_param set_antenna_mode;
430};
431
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700432/**
433 * enum tSirBssType - Enum for BSS type used in scanning/joining etc.
434 *
435 * @eSIR_INFRASTRUCTURE_MODE: Infrastructure station
436 * @eSIR_INFRA_AP_MODE: softAP mode
437 * @eSIR_IBSS_MODE: IBSS mode
438 * @eSIR_AUTO_MODE: Auto role
439 * @eSIR_MONITOR_MODE: Monitor mode
440 * @eSIR_NDI_MODE: NAN datapath mode
441 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800442typedef enum eSirBssType {
443 eSIR_INFRASTRUCTURE_MODE,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700444 eSIR_INFRA_AP_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800445 eSIR_IBSS_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800446 eSIR_AUTO_MODE,
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -0700447 eSIR_MONITOR_MODE,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700448 eSIR_NDI_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800449 eSIR_DONOT_USE_BSS_TYPE = SIR_MAX_ENUM_SIZE
450} tSirBssType;
451
452/* / Power Capability info used in 11H */
453typedef struct sSirMacPowerCapInfo {
454 uint8_t minTxPower;
455 uint8_t maxTxPower;
456} tSirMacPowerCapInfo, *tpSirMacPowerCapInfo;
457
458/* / Supported Channel info used in 11H */
459typedef struct sSirSupChnl {
460 uint8_t numChnl;
461 uint8_t channelList[SIR_MAX_SUPPORTED_CHANNEL_LIST];
462} tSirSupChnl, *tpSirSupChnl;
463
464typedef enum eSirNwType {
465 eSIR_11A_NW_TYPE,
466 eSIR_11B_NW_TYPE,
467 eSIR_11G_NW_TYPE,
468 eSIR_11N_NW_TYPE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800469 eSIR_11AC_NW_TYPE,
Krishna Kumaar Natarajan4f1d7722017-03-03 21:12:51 -0800470 eSIR_11AX_NW_TYPE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800471 eSIR_DONOT_USE_NW_TYPE = SIR_MAX_ENUM_SIZE
472} tSirNwType;
473
474/* / Definition for new iBss peer info */
475typedef struct sSirNewIbssPeerInfo {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530476 struct qdf_mac_addr peerAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800477 uint16_t aid;
478} tSirNewIbssPeerInfo, *tpSirNewIbssPeerInfo;
479
480/* HT configuration values */
481typedef struct sSirHtConfig {
482 /* Enable/Disable receiving LDPC coded packets */
483 uint32_t ht_rx_ldpc:1;
484 /* Enable/Disable TX STBC */
485 uint32_t ht_tx_stbc:1;
486 /* Enable/Disable RX STBC */
487 uint32_t ht_rx_stbc:2;
488 /* Enable/Disable SGI */
Sandeep Puligilla607f34a2016-05-25 14:37:47 -0700489 uint32_t ht_sgi20:1;
490 uint32_t ht_sgi40:1;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800491 uint32_t unused:27;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530492} qdf_packed tSirHTConfig, *tpSirHTConfig;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800493
Sandeep Puligilla98917432016-06-10 13:50:28 -0700494/**
Jeff Johnson118a4a02018-05-06 00:14:15 -0700495 * struct sir_vht_config - VHT capabilities
Sandeep Puligilla98917432016-06-10 13:50:28 -0700496 * @max_mpdu_len: MPDU length
497 * @supported_channel_widthset: channel width set
498 * @ldpc_coding: LDPC coding capability
499 * @shortgi80: short GI 80 support
500 * @shortgi160and80plus80: short Gi 160 & 80+80 support
501 * @tx_stbc; Tx STBC cap
502 * @tx_stbc: Rx STBC cap
503 * @su_beam_former: SU beam former cap
504 * @su_beam_formee: SU beam formee cap
505 * @csnof_beamformer_antSup: Antenna support for beamforming
506 * @num_soundingdim: Sound dimensions
507 * @mu_beam_former: MU beam former cap
508 * @mu_beam_formee: MU beam formee cap
509 * @vht_txops: TXOP power save
510 * @htc_vhtcap: HTC VHT capability
511 * @max_ampdu_lenexp: AMPDU length
512 * @vht_link_adapt: VHT link adapatation capable
513 * @rx_antpattern: Rx Antenna pattern
514 * @tx_antpattern: Tx Antenna pattern
515 */
516struct sir_vht_config {
517 uint32_t max_mpdu_len:2;
518 uint32_t supported_channel_widthset:2;
519 uint32_t ldpc_coding:1;
520 uint32_t shortgi80:1;
521 uint32_t shortgi160and80plus80:1;
522 uint32_t tx_stbc:1;
523 uint32_t rx_stbc:3;
524 uint32_t su_beam_former:1;
525 uint32_t su_beam_formee:1;
526 uint32_t csnof_beamformer_antSup:3;
527 uint32_t num_soundingdim:3;
528 uint32_t mu_beam_former:1;
529 uint32_t mu_beam_formee:1;
530 uint32_t vht_txops:1;
531 uint32_t htc_vhtcap:1;
532 uint32_t max_ampdu_lenexp:3;
533 uint32_t vht_link_adapt:2;
534 uint32_t rx_antpattern:1;
535 uint32_t tx_antpattern:1;
536 uint32_t unused:2;
537};
538
539
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800540typedef struct sSirAddIeParams {
541 uint16_t probeRespDataLen;
542 uint8_t *probeRespData_buff;
543 uint16_t assocRespDataLen;
544 uint8_t *assocRespData_buff;
545 uint16_t probeRespBCNDataLen;
546 uint8_t *probeRespBCNData_buff;
547} tSirAddIeParams, *tpSirAddIeParams;
548
549/* / Definition for kick starting BSS */
550/* / ---> MAC */
551/**
552 * Usage of ssId, numSSID & ssIdList:
553 * ---------------------------------
554 * 1. ssId.length of zero indicates that Broadcast/Suppress SSID
555 * feature is enabled.
556 * 2. If ssId.length is zero, MAC SW will advertise NULL SSID
557 * and interpret the SSID list from numSSID & ssIdList.
558 * 3. If ssId.length is non-zero, MAC SW will advertise the SSID
559 * specified in the ssId field and it is expected that
560 * application will set numSSID to one (only one SSID present
561 * in the list) and SSID in the list is same as ssId field.
562 * 4. Application will always set numSSID >= 1.
563 */
564/* ***** NOTE: Please make sure all codes are updated if inserting field into
565 * this structure..********** */
566typedef struct sSirSmeStartBssReq {
567 uint16_t messageType; /* eWNI_SME_START_BSS_REQ */
568 uint16_t length;
569 uint8_t sessionId; /* Added for BT-AMP Support */
570 uint16_t transactionId; /* Added for BT-AMP Support */
Anurag Chouhan6d760662016-02-20 16:05:43 +0530571 struct qdf_mac_addr bssid; /* Added for BT-AMP Support */
572 struct qdf_mac_addr self_macaddr; /* Added for BT-AMP Support */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800573 uint16_t beaconInterval; /* Added for BT-AMP Support */
574 uint8_t dot11mode;
575#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
576 uint8_t cc_switch_mode;
577#endif
578 tSirBssType bssType;
579 tSirMacSSid ssId;
580 uint8_t channelId;
581 ePhyChanBondState cbMode;
582 uint8_t vht_channel_width;
583 uint8_t center_freq_seg0;
584 uint8_t center_freq_seg1;
585 uint8_t sec_ch_offset;
586
587 uint8_t privacy;
588 uint8_t apUapsdEnable;
589 uint8_t ssidHidden;
590 bool fwdWPSPBCProbeReq;
591 bool protEnabled;
592 bool obssProtEnabled;
593 uint16_t ht_capab;
594 tAniAuthType authType;
595 uint32_t dtimPeriod;
596 uint8_t wps_state;
597 uint8_t isCoalesingInIBSSAllowed; /* Coalesing on/off knob */
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800598 enum QDF_OPMODE bssPersona;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800599
600 uint8_t txLdpcIniFeatureEnabled;
601
602 tSirRSNie rsnIE; /* RSN IE to be sent in */
603 /* Beacon and Probe */
604 /* Response frames */
605 tSirNwType nwType; /* Indicates 11a/b/g */
606 tSirMacRateSet operationalRateSet; /* Has 11a or 11b rates */
607 tSirMacRateSet extendedRateSet; /* Has 11g rates */
608 tSirHTConfig htConfig;
Sandeep Puligilla98917432016-06-10 13:50:28 -0700609 struct sir_vht_config vht_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800610#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -0700611 tDot11fIEhe_cap he_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800612#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800613#ifdef WLAN_FEATURE_11W
614 bool pmfCapable;
615 bool pmfRequired;
616#endif
617
618 tSirAddIeParams addIeParams;
619
620 bool obssEnabled;
621 uint8_t sap_dot11mc;
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800622 uint16_t beacon_tx_rate;
Kapil Gupta4b2efbb2016-10-03 13:07:20 +0530623 bool vendor_vht_sap;
Arif Hussain671a1902017-03-17 09:08:32 -0700624 uint32_t cac_duration_ms;
625 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800626
627} tSirSmeStartBssReq, *tpSirSmeStartBssReq;
628
629#define GET_IE_LEN_IN_BSS(lenInBss) (lenInBss + sizeof(lenInBss) - \
630 ((uintptr_t)OFFSET_OF(tSirBssDescription,\
631 ieFields)))
632
633#define WSCIE_PROBE_RSP_LEN (317 + 2)
634
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530635#ifdef WLAN_FEATURE_FILS_SK
636/* struct fils_ind_elements: elements parsed from fils indication present
637 * in beacon/probe resp
638 * @realm_cnt: number of realm present
639 * @realm: realms
640 * @is_fils_sk_supported: if FILS SK supported
641 * @is_cache_id_present: if cache id present
642 * @cache_id: cache id
643 */
644struct fils_ind_elements {
645 uint16_t realm_cnt;
646 uint8_t realm[SIR_MAX_REALM_COUNT][SIR_REALM_LEN];
647 bool is_fils_sk_supported;
648 bool is_cache_id_present;
649 uint8_t cache_id[CACHE_ID_LEN];
650};
651#endif
652
Jeff Johnsone58271f2017-10-06 09:58:59 -0700653struct bss_description {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800654 /* offset of the ieFields from bssId. */
655 uint16_t length;
656 tSirMacAddr bssId;
Arun Khandavalli8a711cb2017-01-03 20:23:56 +0530657 unsigned long scansystimensec;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800658 uint32_t timeStamp[2];
659 uint16_t beaconInterval;
660 uint16_t capabilityInfo;
661 tSirNwType nwType; /* Indicates 11a/b/g */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800662 int8_t rssi;
Deepak Dhamdhere68929ec2015-08-05 15:16:35 -0700663 int8_t rssi_raw;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800664 int8_t sinr;
665 /* channelId what peer sent in beacon/probersp. */
666 uint8_t channelId;
667 /* channelId on which we are parked at. */
668 /* used only in scan case. */
669 uint8_t channelIdSelf;
670 uint8_t sSirBssDescriptionRsvd[3];
Deepthi Gowri6acee342016-10-28 15:00:38 +0530671 /* Based on system time, not a relative time. */
672 uint64_t received_time;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800673 uint32_t parentTSF;
674 uint32_t startTSF[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800675 uint8_t mdiePresent;
676 /* MDIE for 11r, picked from the beacons */
677 uint8_t mdie[SIR_MDIE_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800678#ifdef FEATURE_WLAN_ESE
679 uint16_t QBSSLoad_present;
680 uint16_t QBSSLoad_avail;
681 /* To achieve 8-byte alignment with ESE enabled */
682 uint32_t reservedPadding5;
683#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800684 /* whether it is from a probe rsp */
685 uint8_t fProbeRsp;
Deepak Dhamdhere652d7e82015-08-06 14:16:53 -0700686 /* Actual channel the beacon/probe response was received on */
687 uint8_t rx_channel;
Krishna Kumaar Natarajan89a99d42016-08-04 15:44:38 -0700688 tSirMacSeqCtl seq_ctrl;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800689 uint32_t WscIeLen;
690 uint8_t WscIeProbeRsp[WSCIE_PROBE_RSP_LEN];
691 uint8_t reservedPadding4;
692 uint32_t tsf_delta;
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530693#ifdef WLAN_FEATURE_FILS_SK
694 struct fils_ind_elements fils_info_element;
695#endif
696 /* Please keep the structure 4 bytes aligned above the ieFields */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800697 uint32_t ieFields[1];
Jeff Johnsone58271f2017-10-06 09:58:59 -0700698};
699typedef struct bss_description tSirBssDescription, *tpSirBssDescription;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800700
701#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
702typedef struct sSirSmeHTProfile {
703 uint8_t dot11mode;
704 uint8_t htCapability;
705 uint8_t htSupportedChannelWidthSet;
706 uint8_t htRecommendedTxWidthSet;
707 ePhyChanBondState htSecondaryChannelOffset;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800708 uint8_t vhtCapability;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800709 uint8_t apCenterChan;
710 uint8_t apChanWidth;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800711} tSirSmeHTProfile;
712#endif
713/* / Definition for response message to previously */
714/* / issued start BSS request */
715/* / MAC ---> */
716typedef struct sSirSmeStartBssRsp {
717 uint16_t messageType; /* eWNI_SME_START_BSS_RSP */
718 uint16_t length;
719 uint8_t sessionId;
720 uint16_t transactionId; /* transaction ID for cmd */
721 tSirResultCodes statusCode;
722 tSirBssType bssType; /* Add new type for WDS mode */
723 uint16_t beaconInterval; /* Beacon Interval for both type */
Jeff Johnson179fd8a2018-05-11 14:20:05 -0700724 uint32_t staId; /* Station ID for Self */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800725#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
726 tSirSmeHTProfile HTProfile;
727#endif
728 tSirBssDescription bssDescription; /* Peer BSS description */
729} tSirSmeStartBssRsp, *tpSirSmeStartBssRsp;
730
731typedef struct sSirChannelList {
732 uint8_t numChannels;
733 uint8_t channelNumber[SIR_ESE_MAX_MEAS_IE_REQS];
734} tSirChannelList, *tpSirChannelList;
735
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800736#ifdef FEATURE_OEM_DATA_SUPPORT
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700737struct oem_data_req {
Gupta, Kapil8a605e12016-06-08 14:14:35 +0530738 uint32_t data_len;
Krishna Kumaar Natarajan9ac8efd2015-11-20 13:40:24 -0800739 uint8_t *data;
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700740};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800741
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700742struct oem_data_rsp {
Krishna Kumaar Natarajan608291e2015-12-14 18:17:27 -0800743 uint32_t rsp_len;
Krishna Kumaar Natarajan73ea9f22016-06-30 18:38:47 -0700744 uint8_t *data;
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700745};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800746#endif /* FEATURE_OEM_DATA_SUPPORT */
747
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800748#ifdef FEATURE_WLAN_ESE
yeshwanth sriram guntuka27e4ffc2016-12-01 18:00:17 +0530749typedef struct ese_wmm_tspec_ie {
750 uint16_t traffic_type:1;
751 uint16_t tsid:4;
752 uint16_t direction:2;
753 uint16_t access_policy:2;
754 uint16_t aggregation:1;
755 uint16_t psb:1;
756 uint16_t user_priority:3;
757 uint16_t tsinfo_ack_pol:2;
758 uint8_t tsinfo_rsvd:7;
759 uint8_t burst_size_defn:1;
760 uint16_t size:15;
761 uint16_t fixed:1;
762 uint16_t max_msdu_size;
763 uint32_t min_service_int;
764 uint32_t max_service_int;
765 uint32_t inactivity_int;
766 uint32_t suspension_int;
767 uint32_t service_start_time;
768 uint32_t min_data_rate;
769 uint32_t mean_data_rate;
770 uint32_t peak_data_rate;
771 uint32_t burst_size;
772 uint32_t delay_bound;
773 uint32_t min_phy_rate;
774 uint16_t surplus_bw_allowance;
775 uint16_t medium_time;
776} qdf_packed ese_wmm_tspec_ie;
777
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800778typedef struct sTspecInfo {
779 uint8_t valid;
Jeff Johnson56471b92018-12-22 14:36:06 -0800780 struct mac_tspec_ie tspec;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800781} tTspecInfo;
782
783#define SIR_ESE_MAX_TSPEC_IES 4
784typedef struct sESETspecTspecInfo {
785 uint8_t numTspecs;
786 tTspecInfo tspec[SIR_ESE_MAX_TSPEC_IES];
787} tESETspecInfo;
788
789typedef struct sSirTsmIE {
790 uint8_t tsid;
791 uint8_t state;
792 uint16_t msmt_interval;
793} tSirTsmIE, *tpSirTsmIE;
794typedef struct sSirSmeTsmIEInd {
795 tSirTsmIE tsmIe;
796 uint8_t sessionId;
797} tSirSmeTsmIEInd, *tpSirSmeTsmIEInd;
798typedef struct sAniTrafStrmMetrics {
799 uint16_t UplinkPktQueueDly;
800 uint16_t UplinkPktQueueDlyHist[4];
801 uint32_t UplinkPktTxDly;
802 uint16_t UplinkPktLoss;
803 uint16_t UplinkPktCount;
804 uint8_t RoamingCount;
805 uint16_t RoamingDly;
806} tAniTrafStrmMetrics, *tpAniTrafStrmMetrics;
807
808typedef struct sAniGetTsmStatsReq {
809 /* Common for all types are requests */
810 uint16_t msgType; /* message type is same as the request type */
811 uint16_t msgLen; /* length of the entire request */
812 uint8_t staId;
813 uint8_t tid; /* traffic id */
814 struct qdf_mac_addr bssId;
815 void *tsmStatsCallback;
816 void *pDevContext; /* device context */
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800817} tAniGetTsmStatsReq, *tpAniGetTsmStatsReq;
818
819typedef struct sAniGetTsmStatsRsp {
820 /* Common for all types are responses */
821 uint16_t msgType; /*
822 * message type is same as
823 * the request type
824 */
825 uint16_t msgLen; /*
826 * length of the entire request,
827 * includes the pStatsBuf length too
828 */
829 uint8_t sessionId;
830 uint32_t rc; /* success/failure */
831 uint32_t staId; /*
832 * Per STA stats request must
833 * contain valid
834 */
Abhinav Kumaraa8f2df2019-01-11 20:02:26 +0530835 struct qdf_mac_addr bssid; /* bssid to get the tsm stats for */
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800836 tAniTrafStrmMetrics tsmMetrics;
837 void *tsmStatsReq; /* tsm stats request backup */
838} tAniGetTsmStatsRsp, *tpAniGetTsmStatsRsp;
839
840typedef struct sSirEseBcnReportBssInfo {
841 tBcnReportFields bcnReportFields;
842 uint8_t ieLen;
843 uint8_t *pBuf;
844} tSirEseBcnReportBssInfo, *tpSirEseBcnReportBssInfo;
845
846typedef struct sSirEseBcnReportRsp {
847 uint16_t measurementToken;
848 uint8_t flag; /* Flag to report measurement done and more data */
849 uint8_t numBss;
850 tSirEseBcnReportBssInfo bcnRepBssInfo[SIR_BCN_REPORT_MAX_BSS_DESC];
851} tSirEseBcnReportRsp, *tpSirEseBcnReportRsp;
852
853#define TSRS_11AG_RATE_6MBPS 0xC
854#define TSRS_11B_RATE_5_5MBPS 0xB
855typedef struct sSirMacESETSRSIE {
856 uint8_t tsid;
857 uint8_t rates[8];
858} tSirMacESETSRSIE;
859typedef struct sSirMacESETSMIE {
860 uint8_t tsid;
861 uint8_t state;
862 uint16_t msmt_interval;
863} tSirMacESETSMIE;
864typedef struct sTSMStats {
865 uint8_t tid;
866 struct qdf_mac_addr bssid;
867 tTrafStrmMetrics tsmMetrics;
868} tTSMStats, *tpTSMStats;
869typedef struct sEseTSMContext {
870 uint8_t tid;
871 tSirMacESETSMIE tsmInfo;
872 tTrafStrmMetrics tsmMetrics;
873} tEseTSMContext, *tpEseTSMContext;
874typedef struct sEsePEContext {
875 tEseTSMContext tsm;
876} tEsePEContext, *tpEsePEContext;
877
878typedef struct sSirPlmReq {
879 uint16_t diag_token; /* Dialog token */
880 uint16_t meas_token; /* measurement token */
881 uint16_t numBursts; /* total number of bursts */
882 uint16_t burstInt; /* burst interval in seconds */
883 uint16_t measDuration; /* in TU's,STA goes off-ch */
884 /* no of times the STA should cycle through PLM ch list */
885 uint8_t burstLen;
886 int8_t desiredTxPwr; /* desired tx power */
887 struct qdf_mac_addr mac_addr; /* MC dest addr */
888 /* no of channels */
889 uint8_t plmNumCh;
890 /* channel numbers */
Wu Gao0821b0d2019-01-11 17:31:11 +0800891 uint8_t plmChList[CFG_VALID_CHANNEL_LIST_LEN];
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800892 uint8_t sessionId;
893 bool enable;
894} tSirPlmReq, *tpSirPlmReq;
895
896#endif /* FEATURE_WLAN_ESE */
897
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800898/* / Definition for join request */
899/* / ---> MAC */
900/* / WARNING! If you add a field in JOIN REQ. */
901/* / Make sure to add it in REASSOC REQ */
902/* / The Serdes function is the same and its */
903/* / shared with REASSOC. So if we add a field */
904/* here and dont add it in REASSOC REQ. It will BREAK!!! REASSOC. */
905typedef struct sSirSmeJoinReq {
906 uint16_t messageType; /* eWNI_SME_JOIN_REQ */
907 uint16_t length;
908 uint8_t sessionId;
909 uint16_t transactionId;
910 tSirMacSSid ssId;
911 tSirMacAddr selfMacAddr; /* self Mac address */
912 tSirBssType bsstype; /* add new type for BT-AMP STA and AP Modules */
913 uint8_t dot11mode; /* to support BT-AMP */
914#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
915 uint8_t cc_switch_mode;
916#endif
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800917 enum QDF_OPMODE staPersona; /* Persona */
Abhishek Singhf78bd2d2016-04-27 16:47:56 +0530918 bool wps_registration;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800919 ePhyChanBondState cbMode; /* Pass CB mode value in Join. */
920
921 /*This contains the UAPSD Flag for all 4 AC
922 * B0: AC_VO UAPSD FLAG
923 * B1: AC_VI UAPSD FLAG
924 * B2: AC_BK UAPSD FLAG
925 * B3: AC_BE UASPD FLAG
926 */
927 uint8_t uapsdPerAcBitmask;
928
929 tSirMacRateSet operationalRateSet; /* Has 11a or 11b rates */
930 tSirMacRateSet extendedRateSet; /* Has 11g rates */
931 tSirRSNie rsnIE; /* RSN IE to be sent in */
932 /* (Re) Association Request */
933#ifdef FEATURE_WLAN_ESE
934 /* CCMK IE to be included as handler for join and reassoc is */
935 tSirCCKMie cckmIE;
936 /* the same. The join will never carry cckm, but will be set to */
937 /* 0. */
938#endif
939
940 tSirAddie addIEScan; /* Additional IE to be sent in */
941 /* (unicast) Probe Request at the time of join */
942
943 tSirAddie addIEAssoc; /* Additional IE to be sent in */
944 /* (Re) Association Request */
945
946 tAniEdType UCEncryptionType;
947
948 tAniEdType MCEncryptionType;
949
950#ifdef WLAN_FEATURE_11W
951 tAniEdType MgmtEncryptionType;
952#endif
953
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700954 bool is11Rconnection;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800955#ifdef FEATURE_WLAN_ESE
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700956 bool isESEFeatureIniEnabled;
957 bool isESEconnection;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800958 tESETspecInfo eseTspecInfo;
959#endif
960
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700961 bool isFastTransitionEnabled;
962 bool isFastRoamIniFeatureEnabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800963
964 uint8_t txLdpcIniFeatureEnabled;
965 tSirHTConfig htConfig;
Sandeep Puligilla98917432016-06-10 13:50:28 -0700966 struct sir_vht_config vht_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800967#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -0700968 tDot11fIEhe_cap he_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800969#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800970 uint8_t enableVhtpAid;
971 uint8_t enableVhtGid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800972 uint8_t enableAmpduPs;
973 uint8_t enableHtSmps;
974 uint8_t htSmps;
Archana Ramachandranfec24812016-02-16 16:31:56 -0800975 bool send_smps_action;
Kiran Kumar Lokere722dccd2018-02-23 13:23:52 -0800976 bool he_with_wep_tkip;
Deepak Dhamdhere612392c2016-08-28 02:56:51 -0700977 uint8_t max_amsdu_num;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700978 bool isWMEenabled;
979 bool isQosEnabled;
980 bool isOSENConnection;
Krishna Kumaar Natarajanf599c6e2015-11-03 11:44:03 -0800981 struct rrm_config_param rrm_config;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700982 bool spectrumMgtIndicator;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800983 tSirMacPowerCapInfo powerCap;
984 tSirSupChnl supportedChannels;
Selvaraj, Sridhar05ea0792017-05-17 12:17:03 +0530985 bool enable_bcast_probe_rsp;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +0530986#ifdef WLAN_FEATURE_FILS_SK
987 struct cds_fils_connection_info fils_con_info;
988#endif
Padma, Santhosh Kumarb8f65d92017-09-14 13:05:42 +0530989 bool sae_pmk_cached;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +0530990 /* Pls make this as last variable in struct */
Abhishek Singhb59f8d42017-07-31 14:42:47 +0530991 bool force_24ghz_in_ht20;
Abhishek Singh6454ad32017-12-20 10:42:21 +0530992 bool force_rsne_override;
Vignesh Viswanathand5a5f2e2018-06-01 15:35:51 +0530993 bool supported_nss_1x1;
994 uint8_t vdev_nss;
995 uint8_t nss;
996 bool nss_forced_1x1;
Arif Hussain6686c0b2018-08-21 18:21:05 -0700997 bool enable_session_twt_support;
Selvaraj, Sridhar81ab80d2017-06-08 12:21:39 +0530998 tSirBssDescription bssDescription;
999 /*
1000 * WARNING: Pls make bssDescription as last variable in struct
1001 * tSirSmeJoinReq as it has ieFields followed after this bss
1002 * description. Adding a variable after this corrupts the ieFields
1003 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001004} tSirSmeJoinReq, *tpSirSmeJoinReq;
1005
Jeff Johnson47d75242018-05-12 15:58:53 -07001006/* / Definition for response message to previously issued join request */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001007/* / MAC ---> */
1008typedef struct sSirSmeJoinRsp {
1009 uint16_t messageType; /* eWNI_SME_JOIN_RSP */
1010 uint16_t length;
1011 uint8_t sessionId; /* Session ID */
1012 uint16_t transactionId; /* Transaction ID for cmd */
1013 tSirResultCodes statusCode;
1014 tAniAuthType authType;
1015 uint32_t vht_channel_width;
1016 /* It holds reasonCode when join fails due to deauth/disassoc frame.
1017 * Otherwise it holds status code.
1018 */
1019 uint16_t protStatusCode;
1020 uint16_t aid;
1021 uint32_t beaconLength;
1022 uint32_t assocReqLength;
1023 uint32_t assocRspLength;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001024 uint32_t parsedRicRspLen;
Bala Venkateshe7f79162019-01-16 16:43:59 +05301025 uint8_t uapsd_mask;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001026#ifdef FEATURE_WLAN_ESE
1027 uint32_t tspecIeLen;
1028#endif
1029 uint32_t staId; /* Station ID for peer */
1030
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001031 /*Timing measurement capability */
1032 uint8_t timingMeasCap;
1033
1034#ifdef FEATURE_WLAN_TDLS
1035 /* TDLS prohibited and TDLS channel switch prohibited are set as
1036 * per ExtCap IE in received assoc/re-assoc response from AP
1037 */
1038 bool tdls_prohibited;
1039 bool tdls_chan_swit_prohibited;
1040#endif
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301041 uint8_t nss;
1042 uint32_t max_rate_flags;
1043
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001044#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
1045 tSirSmeHTProfile HTProfile;
1046#endif
Archana Ramachandran20d2e232016-02-11 16:58:40 -08001047 bool supported_nss_1x1;
Anurag Chouhan5de8d172016-07-13 14:44:28 +05301048 tDot11fIEHTCaps ht_caps;
1049 tDot11fIEVHTCaps vht_caps;
1050 tDot11fIEHTInfo ht_operation;
1051 tDot11fIEVHTOperation vht_operation;
1052 tDot11fIEhs20vendor_ie hs20vendor_ie;
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301053 bool is_fils_connection;
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301054 uint16_t fils_seq_num;
Vignesh Viswanathan0b0fa272017-09-18 17:12:04 +05301055#ifdef WLAN_FEATURE_FILS_SK
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301056 struct fils_join_rsp_params *fils_join_rsp;
1057#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001058 uint8_t frames[1];
1059} tSirSmeJoinRsp, *tpSirSmeJoinRsp;
1060
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001061typedef struct sSirSmeChanInfo {
1062 uint8_t chan_id;
1063 uint32_t mhz;
1064 uint32_t band_center_freq1;
1065 uint32_t band_center_freq2;
1066 uint32_t info;
1067 uint32_t reg_info_1;
1068 uint32_t reg_info_2;
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301069 uint8_t nss;
1070 uint32_t rate_flags;
Manishekar Chandrasekaranec267592016-05-26 19:10:04 +05301071 uint8_t sec_ch_offset;
1072 enum phy_ch_width ch_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001073} tSirSmeChanInfo, *tpSirSmeChanInfo;
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301074
Will Huang558f8082017-05-31 16:22:24 +08001075enum sir_sme_phy_mode {
1076 SIR_SME_PHY_MODE_LEGACY = 0,
1077 SIR_SME_PHY_MODE_HT = 1,
1078 SIR_SME_PHY_MODE_VHT = 2
1079};
1080
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001081/* / Definition for Association indication from peer */
1082/* / MAC ---> */
1083typedef struct sSirSmeAssocInd {
1084 uint16_t messageType; /* eWNI_SME_ASSOC_IND */
1085 uint16_t length;
1086 uint8_t sessionId;
1087 tSirMacAddr peerMacAddr;
1088 uint16_t aid;
1089 tSirMacAddr bssId; /* Self BSSID */
1090 uint16_t staId; /* Station ID for peer */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001091 tAniAuthType authType;
1092 tAniSSID ssId; /* SSID used by STA to associate */
1093 tSirWAPIie wapiIE; /* WAPI IE received from peer */
1094 tSirRSNie rsnIE; /* RSN IE received from peer */
1095 /* Additional IE received from peer, which possibly include
1096 * WSC IE and/or P2P IE
1097 */
1098 tSirAddie addIE;
1099
1100 /* powerCap & supportedChannels are present only when */
1101 /* spectrumMgtIndicator flag is set */
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001102 bool spectrumMgtIndicator;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001103 tSirMacPowerCapInfo powerCap;
1104 tSirSupChnl supportedChannels;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001105 bool wmmEnabledSta; /* if present - STA is WMM enabled */
1106 bool reassocReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001107 /* Required for indicating the frames to upper layer */
1108 uint32_t beaconLength;
1109 uint8_t *beaconPtr;
1110 uint32_t assocReqLength;
1111 uint8_t *assocReqPtr;
1112
1113 /* Timing measurement capability */
1114 uint8_t timingMeasCap;
1115 tSirSmeChanInfo chan_info;
Will Huang558f8082017-05-31 16:22:24 +08001116 bool ampdu;
1117 bool sgi_enable;
1118 bool tx_stbc;
1119 bool rx_stbc;
1120 tSirMacHTChannelWidth ch_width;
1121 enum sir_sme_phy_mode mode;
1122 uint8_t max_supp_idx;
1123 uint8_t max_ext_idx;
1124 uint8_t max_mcs_idx;
1125 uint8_t rx_mcs_map;
1126 uint8_t tx_mcs_map;
gaolez7bb1e742017-03-21 16:37:38 +08001127 /* Extended CSA capability of station */
1128 uint8_t ecsa_capable;
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +05301129 tDot11fIEHTCaps HTCaps;
1130 tDot11fIEVHTCaps VHTCaps;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001131} tSirSmeAssocInd, *tpSirSmeAssocInd;
1132
1133/* / Definition for Association confirm */
1134/* / ---> MAC */
1135typedef struct sSirSmeAssocCnf {
1136 uint16_t messageType; /* eWNI_SME_ASSOC_CNF */
1137 uint16_t length;
1138 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301139 struct qdf_mac_addr bssid; /* Self BSSID */
1140 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001141 uint16_t aid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001142} tSirSmeAssocCnf, *tpSirSmeAssocCnf;
1143
1144/* / Enum definition for Wireless medium status change codes */
1145typedef enum eSirSmeStatusChangeCode {
1146 eSIR_SME_DEAUTH_FROM_PEER,
1147 eSIR_SME_DISASSOC_FROM_PEER,
1148 eSIR_SME_LOST_LINK_WITH_PEER,
1149 eSIR_SME_CHANNEL_SWITCH,
1150 eSIR_SME_JOINED_NEW_BSS,
1151 eSIR_SME_LEAVING_BSS,
1152 eSIR_SME_IBSS_ACTIVE,
1153 eSIR_SME_IBSS_INACTIVE,
1154 eSIR_SME_IBSS_PEER_DEPARTED,
1155 eSIR_SME_RADAR_DETECTED,
1156 eSIR_SME_IBSS_NEW_PEER,
1157 eSIR_SME_AP_CAPS_CHANGED,
1158} tSirSmeStatusChangeCode;
1159
1160typedef struct sSirSmeNewBssInfo {
Anurag Chouhan6d760662016-02-20 16:05:43 +05301161 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001162 uint8_t channelNumber;
1163 uint8_t reserved;
1164 tSirMacSSid ssId;
1165} tSirSmeNewBssInfo, *tpSirSmeNewBssInfo;
1166
1167typedef struct sSirSmeApNewCaps {
1168 uint16_t capabilityInfo;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301169 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001170 uint8_t channelId;
1171 uint8_t reserved[3];
1172 tSirMacSSid ssId;
1173} tSirSmeApNewCaps, *tpSirSmeApNewCaps;
1174
1175/**
1176 * Table below indicates what information is passed for each of
1177 * the Wireless Media status change notifications:
1178 *
1179 * Status Change code Status change info
1180 * ----------------------------------------------------------------------
1181 * eSIR_SME_DEAUTH_FROM_PEER Reason code received in DEAUTH frame
1182 * eSIR_SME_DISASSOC_FROM_PEER Reason code received in DISASSOC frame
1183 * eSIR_SME_LOST_LINK_WITH_PEER None
1184 * eSIR_SME_CHANNEL_SWITCH New channel number
1185 * eSIR_SME_JOINED_NEW_BSS BSSID, SSID and channel number
1186 * eSIR_SME_LEAVING_BSS None
1187 * eSIR_SME_IBSS_ACTIVE Indicates that another STA joined
1188 * IBSS apart from this STA that
1189 * started IBSS
1190 * eSIR_SME_IBSS_INACTIVE Indicates that only this STA is left
1191 * in IBSS
1192 * eSIR_SME_RADAR_DETECTED Indicates that radar is detected
1193 * eSIR_SME_IBSS_NEW_PEER Indicates that a new peer is detected
1194 * eSIR_SME_AP_CAPS_CHANGED Indicates that capabilities of the AP
1195 * that STA is currently associated with
1196 * have changed.
1197 */
1198
1199/* / Definition for Wireless medium status change notification */
1200typedef struct sSirSmeWmStatusChangeNtf {
1201 uint16_t messageType; /* eWNI_SME_WM_STATUS_CHANGE_NTF */
1202 uint16_t length;
1203 uint8_t sessionId; /* Session ID */
1204 tSirSmeStatusChangeCode statusChangeCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301205 struct qdf_mac_addr bssid; /* Self BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001206 union {
1207 uint16_t deAuthReasonCode; /* eSIR_SME_DEAUTH_FROM_PEER */
1208 /* eSIR_SME_DISASSOC_FROM_PEER */
1209 uint16_t disassocReasonCode;
1210 /* none for eSIR_SME_LOST_LINK_WITH_PEER */
1211 uint8_t newChannelId; /* eSIR_SME_CHANNEL_SWITCH */
1212 tSirSmeNewBssInfo newBssInfo; /* eSIR_SME_JOINED_NEW_BSS */
1213 /* none for eSIR_SME_LEAVING_BSS */
1214 /* none for eSIR_SME_IBSS_ACTIVE */
1215 /* none for eSIR_SME_IBSS_INACTIVE */
1216 /* eSIR_SME_IBSS_NEW_PEER */
1217 tSirNewIbssPeerInfo newIbssPeerInfo;
1218 tSirSmeApNewCaps apNewCaps; /* eSIR_SME_AP_CAPS_CHANGED */
1219 } statusChangeInfo;
1220} tSirSmeWmStatusChangeNtf, *tpSirSmeWmStatusChangeNtf;
1221
1222/* Definition for Disassociation request */
1223typedef struct sSirSmeDisassocReq {
1224 uint16_t messageType; /* eWNI_SME_DISASSOC_REQ */
1225 uint16_t length;
1226 uint8_t sessionId; /* Session ID */
1227 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301228 struct qdf_mac_addr bssid; /* Peer BSSID */
1229 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001230 uint16_t reasonCode;
1231 /* This flag tells LIM whether to send the disassoc OTA or not */
1232 /* This will be set in while handing off from one AP to other */
1233 uint8_t doNotSendOverTheAir;
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -07001234 bool process_ho_fail;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301235} qdf_packed tSirSmeDisassocReq, *tpSirSmeDisassocReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001236
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001237/* / Definition for Disassociation response */
1238typedef struct sSirSmeDisassocRsp {
1239 uint16_t messageType; /* eWNI_SME_DISASSOC_RSP */
1240 uint16_t length;
1241 uint8_t sessionId; /* Session ID */
1242 uint16_t transactionId; /* Transaction ID for cmd */
1243 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301244 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001245 uint16_t staId;
Srinivas Girigowdaeaf136a2017-06-12 19:03:19 -07001246} tSirSmeDisassocRsp, *tpSirSmeDisassocRsp;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001247
1248/* / Definition for Disassociation indication from peer */
1249typedef struct sSirSmeDisassocInd {
1250 uint16_t messageType; /* eWNI_SME_DISASSOC_IND */
1251 uint16_t length;
1252 uint8_t sessionId; /* Session Identifier */
1253 uint16_t transactionId; /* Transaction Identifier with PE */
1254 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301255 struct qdf_mac_addr bssid;
1256 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001257 uint16_t staId;
1258 uint32_t reasonCode;
1259} tSirSmeDisassocInd, *tpSirSmeDisassocInd;
1260
1261/* / Definition for Disassociation confirm */
1262/* / MAC ---> */
1263typedef struct sSirSmeDisassocCnf {
1264 uint16_t messageType; /* eWNI_SME_DISASSOC_CNF */
1265 uint16_t length;
Vignesh Viswanathanb2dcdd02018-05-24 11:48:12 +05301266 uint8_t sme_session_id;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001267 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301268 struct qdf_mac_addr bssid;
1269 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001270} tSirSmeDisassocCnf, *tpSirSmeDisassocCnf,
1271 tSirSmeDeauthCnf, *tpSirSmeDeauthCnf;
1272
Hanumantha Reddy Pothula3e5d6aa2016-09-08 15:21:54 +05301273/**
1274 * struct sir_sme_discon_done_ind - disconnect done indiaction
1275 * @message_type: msg type
1276 * @length: length of msg
1277 * @session_id: session id of the indication
1278 * @reason_code: reason for disconnect indication
1279 * @peer_mac: peer mac
1280 */
1281struct sir_sme_discon_done_ind {
1282 uint16_t message_type;
1283 uint16_t length;
1284 uint8_t session_id;
1285 tSirResultCodes reason_code;
1286 tSirMacAddr peer_mac;
1287};
1288
1289
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001290/* / Definition for Deauthetication request */
1291typedef struct sSirSmeDeauthReq {
1292 uint16_t messageType; /* eWNI_SME_DEAUTH_REQ */
1293 uint16_t length;
1294 uint8_t sessionId; /* Session ID */
1295 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301296 struct qdf_mac_addr bssid; /* AP BSSID */
1297 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001298 uint16_t reasonCode;
1299} tSirSmeDeauthReq, *tpSirSmeDeauthReq;
1300
1301/* / Definition for Deauthetication response */
1302typedef struct sSirSmeDeauthRsp {
1303 uint16_t messageType; /* eWNI_SME_DEAUTH_RSP */
1304 uint16_t length;
1305 uint8_t sessionId; /* Session ID */
1306 uint16_t transactionId; /* Transaction ID for cmd */
1307 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301308 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001309} tSirSmeDeauthRsp, *tpSirSmeDeauthRsp;
1310
1311/* / Definition for Deauthetication indication from peer */
1312typedef struct sSirSmeDeauthInd {
1313 uint16_t messageType; /* eWNI_SME_DEAUTH_IND */
1314 uint16_t length;
1315 uint8_t sessionId; /* Added for BT-AMP */
1316 uint16_t transactionId; /* Added for BT-AMP */
1317 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301318 struct qdf_mac_addr bssid; /* AP BSSID */
1319 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001320
1321 uint16_t staId;
1322 uint32_t reasonCode;
Kiran Kumar Lokere37d3aa22015-11-03 14:58:26 -08001323 int8_t rssi;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001324} tSirSmeDeauthInd, *tpSirSmeDeauthInd;
1325
1326/* / Definition for stop BSS request message */
1327typedef struct sSirSmeStopBssReq {
1328 uint16_t messageType; /* eWNI_SME_STOP_BSS_REQ */
1329 uint16_t length;
1330 uint8_t sessionId; /* Session ID */
1331 uint16_t transactionId; /* tranSaction ID for cmd */
1332 tSirResultCodes reasonCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301333 struct qdf_mac_addr bssid; /* Self BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001334} tSirSmeStopBssReq, *tpSirSmeStopBssReq;
1335
1336/* / Definition for stop BSS response message */
1337typedef struct sSirSmeStopBssRsp {
1338 uint16_t messageType; /* eWNI_SME_STOP_BSS_RSP */
1339 uint16_t length;
1340 tSirResultCodes statusCode;
1341 uint8_t sessionId; /* Session ID */
1342 uint16_t transactionId; /* Transaction ID for cmd */
1343} tSirSmeStopBssRsp, *tpSirSmeStopBssRsp;
1344
1345/* / Definition for Channel Switch indication for station */
1346/* / MAC ---> */
1347typedef struct sSirSmeSwitchChannelInd {
1348 uint16_t messageType; /* eWNI_SME_SWITCH_CHL_IND */
1349 uint16_t length;
1350 uint8_t sessionId;
1351 uint16_t newChannelId;
Amar Singhal5cccafe2017-02-15 12:42:58 -08001352 struct ch_params chan_params;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301353 struct qdf_mac_addr bssid; /* BSSID */
Jianmin Zhu3c50e402018-12-04 18:52:54 +08001354 QDF_STATUS status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001355} tSirSmeSwitchChannelInd, *tpSirSmeSwitchChannelInd;
1356
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001357/* / Definition for MIC failure indication */
1358/* / MAC ---> */
1359/* / MAC reports this each time a MIC failure occures on Rx TKIP packet */
1360typedef struct sSirSmeMicFailureInd {
1361 uint16_t messageType; /* eWNI_SME_MIC_FAILURE_IND */
1362 uint16_t length;
1363 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301364 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001365 tSirMicFailureInfo info;
1366} tSirSmeMicFailureInd, *tpSirSmeMicFailureInd;
1367
1368typedef struct sSirSmeMissedBeaconInd {
1369 uint16_t messageType; /* eWNI_SME_MISSED_BEACON_IND */
1370 uint16_t length;
1371 uint8_t bssIdx;
1372} tSirSmeMissedBeaconInd, *tpSirSmeMissedBeaconInd;
1373
1374/* / Definition for Set Context request */
1375/* / ---> MAC */
1376typedef struct sSirSmeSetContextReq {
1377 uint16_t messageType; /* eWNI_SME_SET_CONTEXT_REQ */
1378 uint16_t length;
1379 uint8_t sessionId; /* Session ID */
1380 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301381 struct qdf_mac_addr peer_macaddr;
1382 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001383 tSirKeyMaterial keyMaterial;
1384} tSirSmeSetContextReq, *tpSirSmeSetContextReq;
1385
1386/* / Definition for Set Context response */
1387/* / MAC ---> */
1388typedef struct sSirSmeSetContextRsp {
1389 uint16_t messageType; /* eWNI_SME_SET_CONTEXT_RSP */
1390 uint16_t length;
1391 uint8_t sessionId; /* Session ID */
1392 uint16_t transactionId; /* Transaction ID for cmd */
1393 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301394 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001395} tSirSmeSetContextRsp, *tpSirSmeSetContextRsp;
1396
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001397/*******************PE Statistics*************************/
1398
1399/*
1400 * tpAniGetPEStatsReq is tied to
1401 * for SME ==> PE eWNI_SME_GET_STATISTICS_REQ msgId and
1402 * for PE ==> HAL SIR_HAL_GET_STATISTICS_REQ msgId
1403 */
1404typedef struct sAniGetPEStatsReq {
1405 /* Common for all types are requests */
1406 uint16_t msgType; /* message type is same as the request type */
1407 uint16_t msgLen; /* length of the entire request */
1408 uint32_t staId; /* Per STA stats request must contain valid */
1409 /* categories of stats requested. look at ePEStatsMask */
1410 uint32_t statsMask;
1411 uint8_t sessionId;
1412} tAniGetPEStatsReq, *tpAniGetPEStatsReq;
1413
1414/*
1415 * tpAniGetPEStatsRsp is tied to
1416 * for PE ==> SME eWNI_SME_GET_STATISTICS_RSP msgId and
1417 * for HAL ==> PE SIR_HAL_GET_STATISTICS_RSP msgId
1418 */
1419typedef struct sAniGetPEStatsRsp {
1420 /* Common for all types are responses */
1421 uint16_t msgType; /* message type is same as the request type */
1422 /* length of the entire request, includes the pStatsBuf length too */
1423 uint16_t msgLen;
1424 uint8_t sessionId;
1425 uint32_t rc; /* success/failure */
1426 uint32_t staId; /* Per STA stats request must contain valid */
1427 /* categories of stats requested. look at ePEStatsMask */
1428 uint32_t statsMask;
1429 /* void *pStatsBuf; */
1430 /*
1431 * The Stats buffer starts here and can be an aggregate of more than one
1432 * statistics structure depending on statsMask. The void pointer
1433 * "pStatsBuf" is commented out intentionally and the src code that uses
1434 * this structure should take that into account.
1435 */
1436} tAniGetPEStatsRsp, *tpAniGetPEStatsRsp;
1437
1438typedef struct sAniGetRssiReq {
1439 /* Common for all types are requests */
1440 uint16_t msgType; /* message type is same as the request type */
1441 uint16_t msgLen; /* length of the entire request */
1442 uint8_t sessionId;
1443 uint8_t staId;
1444 int8_t lastRSSI; /* in case of error, return last RSSI */
1445 void *rssiCallback;
1446 void *pDevContext; /* device context */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001447} tAniGetRssiReq, *tpAniGetRssiReq;
1448
1449typedef struct sAniGetSnrReq {
1450 /* Common for all types are requests */
1451 uint16_t msgType; /* message type is same as the request type */
1452 uint16_t msgLen; /* length of the entire request */
1453 uint8_t sessionId;
1454 uint8_t staId;
1455 void *snrCallback;
1456 void *pDevContext; /* device context */
1457 int8_t snr;
1458} tAniGetSnrReq, *tpAniGetSnrReq;
1459
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001460/* generic country code change request MSG structure */
1461typedef struct sAniGenericChangeCountryCodeReq {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001462 uint16_t msgType; /* message type is same as the request type */
1463 uint16_t msgLen; /* length of the entire request */
Wu Gaoaa155142019-01-14 15:09:26 +08001464 uint8_t countryCode[CFG_COUNTRY_CODE_LEN]; /* 3 char country code */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001465} tAniGenericChangeCountryCodeReq, *tpAniGenericChangeCountryCodeReq;
1466
Srinivas Girigowda296105a2015-09-24 16:31:16 -07001467/**
1468 * struct sAniDHCPStopInd - DHCP Stop indication message
1469 * @msgType: message type is same as the request type
1470 * @msgLen: length of the entire request
1471 * @device_mode: Mode of the device(ex:STA, AP)
1472 * @adapterMacAddr: MAC address of the adapter
1473 * @peerMacAddr: MAC address of the connected peer
1474 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001475typedef struct sAniDHCPStopInd {
Srinivas Girigowda296105a2015-09-24 16:31:16 -07001476 uint16_t msgType;
1477 uint16_t msgLen;
1478 uint8_t device_mode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301479 struct qdf_mac_addr adapterMacAddr;
1480 struct qdf_mac_addr peerMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001481} tAniDHCPInd, *tpAniDHCPInd;
1482
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001483typedef struct sAniTXFailMonitorInd {
1484 uint16_t msgType; /* message type is same as the request type */
1485 uint16_t msgLen; /* length of the entire request */
1486 uint8_t tx_fail_count;
1487 void *txFailIndCallback;
1488} tAniTXFailMonitorInd, *tpAniTXFailMonitorInd;
1489
Naveen Rawatea1564b2018-05-17 15:56:11 -07001490#ifndef QCA_SUPPORT_CP_STATS
1491/**
1492 * enum tx_rate_info - tx_rate flags
1493 * @TX_RATE_LEGACY: Legacy rates
1494 * @TX_RATE_HT20: HT20 rates
1495 * @TX_RATE_HT40: HT40 rates
1496 * @TX_RATE_SGI: Rate with Short guard interval
1497 * @TX_RATE_LGI: Rate with Long guard interval
1498 * @TX_RATE_VHT20: VHT 20 rates
1499 * @TX_RATE_VHT40: VHT 40 rates
1500 * @TX_RATE_VHT80: VHT 80 rates
1501 */
1502enum tx_rate_info {
1503 TX_RATE_LEGACY = 0x1,
1504 TX_RATE_HT20 = 0x2,
1505 TX_RATE_HT40 = 0x4,
1506 TX_RATE_SGI = 0x8,
1507 TX_RATE_LGI = 0x10,
1508 TX_RATE_VHT20 = 0x20,
1509 TX_RATE_VHT40 = 0x40,
1510 TX_RATE_VHT80 = 0x80
1511};
1512#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001513/**********************PE Statistics end*************************/
1514
1515typedef struct sSirP2PNoaStart {
1516 uint32_t status;
1517 uint32_t bssIdx;
1518} tSirP2PNoaStart, *tpSirP2PNoaStart;
1519
1520typedef struct sSirTdlsInd {
1521 uint16_t status;
1522 uint16_t assocId;
1523 uint16_t staIdx;
1524 uint16_t reasonCode;
1525} tSirTdlsInd, *tpSirTdlsInd;
1526
1527typedef struct sSirP2PNoaAttr {
1528#ifdef ANI_BIG_BYTE_ENDIAN
1529 uint32_t index:8;
1530 uint32_t oppPsFlag:1;
1531 uint32_t ctWin:7;
1532 uint32_t rsvd1:16;
1533#else
1534 uint32_t rsvd1:16;
1535 uint32_t ctWin:7;
1536 uint32_t oppPsFlag:1;
1537 uint32_t index:8;
1538#endif
1539
1540#ifdef ANI_BIG_BYTE_ENDIAN
1541 uint32_t uNoa1IntervalCnt:8;
1542 uint32_t rsvd2:24;
1543#else
1544 uint32_t rsvd2:24;
1545 uint32_t uNoa1IntervalCnt:8;
1546#endif
1547 uint32_t uNoa1Duration;
1548 uint32_t uNoa1Interval;
1549 uint32_t uNoa1StartTime;
1550
1551#ifdef ANI_BIG_BYTE_ENDIAN
1552 uint32_t uNoa2IntervalCnt:8;
1553 uint32_t rsvd3:24;
1554#else
1555 uint32_t rsvd3:24;
1556 uint32_t uNoa2IntervalCnt:8;
1557#endif
1558 uint32_t uNoa2Duration;
1559 uint32_t uNoa2Interval;
1560 uint32_t uNoa2StartTime;
1561} tSirP2PNoaAttr, *tpSirP2PNoaAttr;
1562
1563typedef struct sSirTclasInfo {
1564 tSirMacTclasIE tclas;
1565 uint8_t version; /* applies only for classifier type ip */
1566 union {
1567 tSirMacTclasParamEthernet eth;
1568 tSirMacTclasParamIPv4 ipv4;
1569 tSirMacTclasParamIPv6 ipv6;
1570 tSirMacTclasParam8021dq t8021dq;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301571 } qdf_packed tclasParams;
1572} qdf_packed tSirTclasInfo;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001573
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001574typedef struct sSirAddtsReqInfo {
1575 uint8_t dialogToken;
Jeff Johnson56471b92018-12-22 14:36:06 -08001576 struct mac_tspec_ie tspec;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001577
1578 uint8_t numTclas; /* number of Tclas elements */
1579 tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM];
1580 uint8_t tclasProc;
1581#if defined(FEATURE_WLAN_ESE)
1582 tSirMacESETSRSIE tsrsIE;
1583 uint8_t tsrsPresent:1;
1584#endif
1585 uint8_t wmeTspecPresent:1;
1586 uint8_t wsmTspecPresent:1;
1587 uint8_t lleTspecPresent:1;
1588 uint8_t tclasProcPresent:1;
1589} tSirAddtsReqInfo, *tpSirAddtsReqInfo;
1590
1591typedef struct sSirAddtsRspInfo {
1592 uint8_t dialogToken;
1593 tSirMacStatusCodes status;
1594 tSirMacTsDelayIE delay;
1595
Jeff Johnson56471b92018-12-22 14:36:06 -08001596 struct mac_tspec_ie tspec;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001597 uint8_t numTclas; /* number of Tclas elements */
1598 tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM];
1599 uint8_t tclasProc;
1600 tSirMacScheduleIE schedule;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001601#ifdef FEATURE_WLAN_ESE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001602 tSirMacESETSMIE tsmIE;
1603 uint8_t tsmPresent:1;
1604#endif
1605 uint8_t wmeTspecPresent:1;
1606 uint8_t wsmTspecPresent:1;
1607 uint8_t lleTspecPresent:1;
1608 uint8_t tclasProcPresent:1;
1609 uint8_t schedulePresent:1;
1610} tSirAddtsRspInfo, *tpSirAddtsRspInfo;
1611
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001612/* / Add a tspec as defined */
1613typedef struct sSirAddtsReq {
1614 uint16_t messageType; /* eWNI_SME_ADDTS_REQ */
1615 uint16_t length;
1616 uint8_t sessionId; /* Session ID */
1617 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301618 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001619 uint32_t timeout; /* in ms */
1620 uint8_t rspReqd;
1621 tSirAddtsReqInfo req;
1622} tSirAddtsReq, *tpSirAddtsReq;
1623
1624typedef struct sSirAddtsRsp {
1625 uint16_t messageType; /* eWNI_SME_ADDTS_RSP */
1626 uint16_t length;
1627 uint8_t sessionId; /* sme sessionId Added for BT-AMP support */
1628 uint16_t transactionId; /* sme transaction Id - for BT-AMP Support */
1629 uint32_t rc; /* return code */
1630 tSirAddtsRspInfo rsp;
1631} tSirAddtsRsp, *tpSirAddtsRsp;
1632
1633typedef struct sSirDeltsReq {
1634 uint16_t messageType; /* eWNI_SME_DELTS_REQ */
1635 uint16_t length;
1636 uint8_t sessionId; /* Session ID */
1637 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301638 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001639 uint16_t aid; /* use 0 if macAddr is being specified */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301640 struct qdf_mac_addr macaddr; /* only on AP to specify the STA */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001641 uint8_t rspReqd;
Jeff Johnsoncf2ec162018-12-22 16:46:43 -08001642 struct delts_req_info req;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001643} tSirDeltsReq, *tpSirDeltsReq;
1644
1645typedef struct sSirDeltsRsp {
1646 uint16_t messageType; /* eWNI_SME_DELTS_RSP */
1647 uint16_t length;
1648 uint8_t sessionId; /* sme sessionId Added for BT-AMP support */
1649 uint16_t transactionId; /* sme transaction Id - for BT-AMP Support */
1650 uint32_t rc;
1651 uint16_t aid; /* use 0 if macAddr is being specified */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301652 struct qdf_mac_addr macaddr; /* only on AP to specify the STA */
Jeff Johnsoncf2ec162018-12-22 16:46:43 -08001653 struct delts_req_info rsp;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001654} tSirDeltsRsp, *tpSirDeltsRsp;
1655
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001656#define SIR_QOS_NUM_AC_MAX 4
1657
1658typedef struct sSirAggrQosReqInfo {
1659 uint16_t tspecIdx;
1660 tSirAddtsReqInfo aggrAddTsInfo[SIR_QOS_NUM_AC_MAX];
1661} tSirAggrQosReqInfo, *tpSirAggrQosReqInfo;
1662
1663typedef struct sSirAggrQosReq {
1664 uint16_t messageType; /* eWNI_SME_ADDTS_REQ */
1665 uint16_t length;
1666 uint8_t sessionId; /* Session ID */
1667 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301668 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001669 uint32_t timeout; /* in ms */
1670 uint8_t rspReqd;
1671 tSirAggrQosReqInfo aggrInfo;
1672} tSirAggrQosReq, *tpSirAggrQosReq;
1673
1674typedef struct sSirAggrQosRspInfo {
1675 uint16_t tspecIdx;
1676 tSirAddtsRspInfo aggrRsp[SIR_QOS_NUM_AC_MAX];
1677} tSirAggrQosRspInfo, *tpSirAggrQosRspInfo;
1678
1679typedef struct sSirAggrQosRsp {
1680 uint16_t messageType;
1681 uint16_t length;
1682 uint8_t sessionId;
1683 tSirAggrQosRspInfo aggrInfo;
1684} tSirAggrQosRsp, *tpSirAggrQosRsp;
1685
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001686
1687typedef struct sSirQosMapSet {
1688 uint8_t present;
1689 uint8_t num_dscp_exceptions;
1690 uint8_t dscp_exceptions[21][2];
1691 uint8_t dscp_range[8][2];
1692} tSirQosMapSet, *tpSirQosMapSet;
1693
1694typedef struct sSmeIbssPeerInd {
1695 uint16_t mesgType;
1696 uint16_t mesgLen;
1697 uint8_t sessionId;
1698
Anurag Chouhan6d760662016-02-20 16:05:43 +05301699 struct qdf_mac_addr peer_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001700 uint16_t staId;
1701
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001702 /* Beacon will be appended for new Peer indication. */
1703} tSmeIbssPeerInd, *tpSmeIbssPeerInd;
1704
1705typedef struct sSirIbssPeerInactivityInd {
1706 uint8_t bssIdx;
1707 uint8_t staIdx;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301708 struct qdf_mac_addr peer_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001709} tSirIbssPeerInactivityInd, *tpSirIbssPeerInactivityInd;
1710
gaoleze5108942017-03-31 16:56:42 +08001711/**
1712 * struct lim_channel_status
1713 * @channelfreq: Channel freq
1714 * @noise_floor: Noise Floor value
1715 * @rx_clear_count: rx clear count
1716 * @cycle_count: cycle count
1717 * @chan_tx_pwr_range: channel tx power per range in 0.5dBm steps
1718 * @chan_tx_pwr_throughput: channel tx power per throughput
1719 * @rx_frame_count: rx frame count (cumulative)
1720 * @bss_rx_cycle_count: BSS rx cycle count
1721 * @rx_11b_mode_data_duration: b-mode data rx time (units are microseconds)
1722 * @tx_frame_count: BSS tx cycle count
1723 * @mac_clk_mhz: sample frequency
1724 * @channel_id: channel index
1725 * @cmd_flags: indicate which stat event is this status coming from
1726 */
1727struct lim_channel_status {
1728 uint32_t channelfreq;
1729 uint32_t noise_floor;
1730 uint32_t rx_clear_count;
1731 uint32_t cycle_count;
1732 uint32_t chan_tx_pwr_range;
1733 uint32_t chan_tx_pwr_throughput;
1734 uint32_t rx_frame_count;
1735 uint32_t bss_rx_cycle_count;
1736 uint32_t rx_11b_mode_data_duration;
1737 uint32_t tx_frame_count;
1738 uint32_t mac_clk_mhz;
1739 uint32_t channel_id;
1740 uint32_t cmd_flags;
1741};
1742
1743/**
1744 * struct lim_scan_channel_status
1745 * @total_channel: total number of be scanned channel
1746 * @channel_status_list: channel status info store in this array
1747 */
1748struct lim_scan_channel_status {
1749 uint8_t total_channel;
1750 struct lim_channel_status
1751 channel_status_list[SIR_MAX_SUPPORTED_CHANNEL_LIST];
1752};
1753
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001754typedef struct sSirSmeGetAssocSTAsReq {
1755 uint16_t messageType; /* eWNI_SME_GET_ASSOC_STAS_REQ */
1756 uint16_t length;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301757 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001758 uint16_t modId;
1759 void *pUsrContext;
1760 void *pSapEventCallback;
1761 /* Pointer to allocated mem passed in wlansap_get_assoc_stations API */
1762 void *pAssocStasArray;
1763} tSirSmeGetAssocSTAsReq, *tpSirSmeGetAssocSTAsReq;
1764
1765typedef struct sSmeMaxAssocInd {
1766 uint16_t mesgType; /* eWNI_SME_MAX_ASSOC_EXCEEDED */
1767 uint16_t mesgLen;
1768 uint8_t sessionId;
1769 /* the new peer that got rejected max assoc limit reached */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301770 struct qdf_mac_addr peer_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001771} tSmeMaxAssocInd, *tpSmeMaxAssocInd;
1772
1773typedef struct sSmeCsaOffloadInd {
1774 uint16_t mesgType; /* eWNI_SME_CSA_OFFLOAD_EVENT */
1775 uint16_t mesgLen;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301776 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001777} tSmeCsaOffloadInd, *tpSmeCsaOffloadInd;
1778
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001779#define SIR_MAX_NAME_SIZE 64
1780#define SIR_MAX_TEXT_SIZE 32
1781
1782typedef struct sSirName {
1783 uint8_t num_name;
1784 uint8_t name[SIR_MAX_NAME_SIZE];
1785} tSirName;
1786
1787typedef struct sSirText {
1788 uint8_t num_text;
1789 uint8_t text[SIR_MAX_TEXT_SIZE];
1790} tSirText;
1791
1792#define SIR_WPS_PROBRSP_VER_PRESENT 0x00000001
1793#define SIR_WPS_PROBRSP_STATE_PRESENT 0x00000002
1794#define SIR_WPS_PROBRSP_APSETUPLOCK_PRESENT 0x00000004
1795#define SIR_WPS_PROBRSP_SELECTEDREGISTRA_PRESENT 0x00000008
1796#define SIR_WPS_PROBRSP_DEVICEPASSWORDID_PRESENT 0x00000010
1797#define SIR_WPS_PROBRSP_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020
1798#define SIR_WPS_PROBRSP_RESPONSETYPE_PRESENT 0x00000040
1799#define SIR_WPS_PROBRSP_UUIDE_PRESENT 0x00000080
1800#define SIR_WPS_PROBRSP_MANUFACTURE_PRESENT 0x00000100
1801#define SIR_WPS_PROBRSP_MODELNAME_PRESENT 0x00000200
1802#define SIR_WPS_PROBRSP_MODELNUMBER_PRESENT 0x00000400
1803#define SIR_WPS_PROBRSP_SERIALNUMBER_PRESENT 0x00000800
1804#define SIR_WPS_PROBRSP_PRIMARYDEVICETYPE_PRESENT 0x00001000
1805#define SIR_WPS_PROBRSP_DEVICENAME_PRESENT 0x00002000
1806#define SIR_WPS_PROBRSP_CONFIGMETHODS_PRESENT 0x00004000
1807#define SIR_WPS_PROBRSP_RF_BANDS_PRESENT 0x00008000
1808
1809typedef struct sSirWPSProbeRspIE {
1810 uint32_t FieldPresent;
1811 uint32_t Version; /* Version. 0x10 = version 1.0, 0x11 = etc. */
1812 uint32_t wpsState; /* 1 = unconfigured, 2 = configured. */
1813 bool APSetupLocked; /* Must be included if value is true */
1814 /*
1815 * BOOL: indicates if the user has recently activated a Registrar to
1816 * add an Enrollee.
1817 */
1818 bool SelectedRegistra;
1819 uint16_t DevicePasswordID; /* Device Password ID */
1820 /* Selected Registrar config method */
1821 uint16_t SelectedRegistraCfgMethod;
1822 uint8_t ResponseType; /* Response type */
1823 uint8_t UUID_E[16]; /* Unique identifier of the AP. */
1824 tSirName Manufacture;
1825 tSirText ModelName;
1826 tSirText ModelNumber;
1827 tSirText SerialNumber;
1828 /* Device Category ID: 1Computer, 2Input Device, ... */
1829 uint32_t PrimaryDeviceCategory;
1830 /* Vendor specific OUI for Device Sub Category */
1831 uint8_t PrimaryDeviceOUI[4];
1832 /*
1833 Device Sub Category ID: 1-PC, 2-Server if Device Category ID
1834 * is computer
1835 */
1836 uint32_t DeviceSubCategory;
1837 tSirText DeviceName;
1838 uint16_t ConfigMethod; /* Configuaration method */
1839 uint8_t RFBand; /* RF bands available on the AP */
1840} tSirWPSProbeRspIE;
1841
1842#define SIR_WPS_BEACON_VER_PRESENT 0x00000001
1843#define SIR_WPS_BEACON_STATE_PRESENT 0x00000002
1844#define SIR_WPS_BEACON_APSETUPLOCK_PRESENT 0x00000004
1845#define SIR_WPS_BEACON_SELECTEDREGISTRA_PRESENT 0x00000008
1846#define SIR_WPS_BEACON_DEVICEPASSWORDID_PRESENT 0x00000010
1847#define SIR_WPS_BEACON_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020
1848#define SIR_WPS_BEACON_UUIDE_PRESENT 0x00000080
1849#define SIR_WPS_BEACON_RF_BANDS_PRESENT 0x00000100
1850#define SIR_WPS_UUID_LEN 16
1851
1852typedef struct sSirWPSBeaconIE {
1853 uint32_t FieldPresent;
1854 uint32_t Version; /* Version. 0x10 = version 1.0, 0x11 = etc. */
1855 uint32_t wpsState; /* 1 = unconfigured, 2 = configured. */
1856 bool APSetupLocked; /* Must be included if value is true */
1857 /*
1858 * BOOL: indicates if the user has recently activated a Registrar to
1859 * add an Enrollee.
1860 */
1861 bool SelectedRegistra;
1862 uint16_t DevicePasswordID; /* Device Password ID */
1863 /* Selected Registrar config method */
1864 uint16_t SelectedRegistraCfgMethod;
1865 uint8_t UUID_E[SIR_WPS_UUID_LEN]; /* Unique identifier of the AP. */
1866 uint8_t RFBand; /* RF bands available on the AP */
1867} tSirWPSBeaconIE;
1868
1869#define SIR_WPS_ASSOCRSP_VER_PRESENT 0x00000001
1870#define SIR_WPS_ASSOCRSP_RESPONSETYPE_PRESENT 0x00000002
1871
1872typedef struct sSirWPSAssocRspIE {
1873 uint32_t FieldPresent;
1874 uint32_t Version;
1875 uint8_t ResposeType;
1876} tSirWPSAssocRspIE;
1877
1878typedef struct sSirAPWPSIEs {
1879 tSirWPSProbeRspIE SirWPSProbeRspIE; /*WPS Set Probe Respose IE */
1880 tSirWPSBeaconIE SirWPSBeaconIE; /*WPS Set Beacon IE */
1881 tSirWPSAssocRspIE SirWPSAssocRspIE; /*WPS Set Assoc Response IE */
1882} tSirAPWPSIEs, *tpSiriAPWPSIEs;
1883
Naveen Rawat8029a402017-06-01 10:54:19 -07001884struct update_config {
1885 uint16_t messageType; /* eWNI_SME_UPDATE_CONFIG */
1886 uint16_t length;
1887 uint8_t sme_session_id;
1888 uint16_t capab;
1889 uint32_t value;
1890};
1891
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05301892/*
1893 * enum sir_update_session_param_type - session param type
1894 * @SIR_PARAM_SSID_HIDDEN: ssidHidden parameter
Selvaraj, Sridharac4fcf32016-09-28 12:57:32 +05301895 * @SIR_PARAM_IGNORE_ASSOC_DISALLOWED: ignore_assoc_disallowed parameter
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05301896 */
1897enum sir_update_session_param_type {
1898 SIR_PARAM_SSID_HIDDEN,
Selvaraj, Sridharac4fcf32016-09-28 12:57:32 +05301899 SIR_PARAM_IGNORE_ASSOC_DISALLOWED,
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05301900};
1901
1902/*
1903 * struct sir_update_session_param
1904 * @message_type: SME message type
1905 * @length: size of struct sir_update_session_param
1906 * @session_id: Session ID
1907 * @param_type: parameter to be updated
1908 * @param_val: Parameter value to update
1909 */
1910struct sir_update_session_param {
1911 uint16_t message_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001912 uint16_t length;
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05301913 uint8_t session_id;
1914 uint32_t param_type;
1915 uint32_t param_val;
1916};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001917
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07001918/**
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -07001919 * struct sir_set_he_bss_color
1920 * @message_type: SME message type
1921 * @length: size of struct sir_set_he_bss_color
1922 * @session_id: Session ID
1923 * @bss_color: bss color value
1924 */
1925struct sir_set_he_bss_color {
1926 uint16_t message_type;
1927 uint16_t length;
1928 uint8_t session_id;
1929 uint8_t bss_color;
1930};
1931
1932/**
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07001933 * struct sir_create_session - Used for creating session in monitor mode
1934 * @type: SME host message type.
1935 * @msg_len: Length of the message.
1936 * @bss_id: bss_id for creating the session.
1937 */
1938struct sir_create_session {
1939 uint16_t type;
1940 uint16_t msg_len;
Rajeev Kumar Sirasanagandlae3b59912018-08-24 15:53:31 +05301941 uint8_t vdev_id;
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07001942 struct qdf_mac_addr bss_id;
1943};
1944
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001945/* Beacon Interval */
1946typedef struct sSirChangeBIParams {
1947 uint16_t messageType;
1948 uint16_t length;
1949 uint16_t beaconInterval; /* Beacon Interval */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301950 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001951 uint8_t sessionId; /* Session ID */
1952} tSirChangeBIParams, *tpSirChangeBIParams;
1953
1954#ifdef QCA_HT_2040_COEX
1955typedef struct sSirSetHT2040Mode {
1956 uint16_t messageType;
1957 uint16_t length;
1958 uint8_t cbMode;
1959 bool obssEnabled;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301960 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001961 uint8_t sessionId; /* Session ID */
1962} tSirSetHT2040Mode, *tpSirSetHT2040Mode;
1963#endif
1964
1965#define SIR_WPS_PBC_WALK_TIME 120 /* 120 Second */
1966
1967typedef struct sSirWPSPBCSession {
1968 struct sSirWPSPBCSession *next;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301969 struct qdf_mac_addr addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001970 uint8_t uuid_e[SIR_WPS_UUID_LEN];
1971 uint32_t timestamp;
1972} tSirWPSPBCSession;
1973
1974typedef struct sSirSmeGetWPSPBCSessionsReq {
1975 uint16_t messageType; /* eWNI_SME_GET_WPSPBC_SESSION_REQ */
1976 uint16_t length;
1977 void *pUsrContext;
1978 void *pSapEventCallback;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301979 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001980 /* MAC Address of STA in WPS Session to be removed */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301981 struct qdf_mac_addr remove_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001982} tSirSmeGetWPSPBCSessionsReq, *tpSirSmeGetWPSPBCSessionsReq;
1983
1984typedef struct sSirWPSPBCProbeReq {
Anurag Chouhan6d760662016-02-20 16:05:43 +05301985 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001986 uint16_t probeReqIELen;
1987 uint8_t probeReqIE[512];
1988} tSirWPSPBCProbeReq, *tpSirWPSPBCProbeReq;
1989
1990/* probereq from peer, when wsc is enabled */
1991typedef struct sSirSmeProbeReqInd {
1992 uint16_t messageType; /* eWNI_SME_WPS_PBC_PROBE_REQ_IND */
1993 uint16_t length;
1994 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301995 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001996 tSirWPSPBCProbeReq WPSPBCProbeReq;
1997} tSirSmeProbeReqInd, *tpSirSmeProbeReqInd;
1998
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001999#define SIR_ROAM_MAX_CHANNELS 80
2000#define SIR_ROAM_SCAN_MAX_PB_REQ_SIZE 450
2001/* Occupied channel list remains static */
2002#define CHANNEL_LIST_STATIC 1
Himanshu Agarwalb23aa572018-06-14 17:04:44 +05302003/* Occupied channel list can be dynamic */
2004#define CHANNEL_LIST_DYNAMIC 2
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002005#define SIR_ROAM_SCAN_24G_DEFAULT_CH 1
2006#define SIR_ROAM_SCAN_5G_DEFAULT_CH 36
2007#define SIR_ROAM_SCAN_RESERVED_BYTES 61
2008
2009#ifdef WLAN_FEATURE_ROAM_OFFLOAD
hangtianb95e63b2018-11-28 12:10:00 +08002010#define SIR_ROAM_SCAN_PSK_SIZE 48
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002011#define SIR_ROAM_R0KH_ID_MAX_LEN 48
2012#endif
2013/* SME -> HAL - This is the host offload request. */
2014#define SIR_IPV4_ARP_REPLY_OFFLOAD 0
2015#define SIR_IPV6_NEIGHBOR_DISCOVERY_OFFLOAD 1
2016#define SIR_IPV6_NS_OFFLOAD 2
2017#define SIR_OFFLOAD_DISABLE 0
2018#define SIR_OFFLOAD_ENABLE 1
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002019
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002020typedef struct sSirHostOffloadReq {
2021 uint8_t offloadType;
2022 uint8_t enableOrDisable;
2023 uint32_t num_ns_offload_count;
2024 union {
Srinivas Girigowdac79a7102015-12-08 15:18:26 -08002025 uint8_t hostIpv4Addr[SIR_IPV4_ADDR_LEN];
2026 uint8_t hostIpv6Addr[SIR_MAC_IPV6_ADDR_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002027 } params;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302028 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002029} tSirHostOffloadReq, *tpSirHostOffloadReq;
2030
2031/* Packet Types. */
2032#define SIR_KEEP_ALIVE_NULL_PKT 1
2033#define SIR_KEEP_ALIVE_UNSOLICIT_ARP_RSP 2
2034
2035/* Keep Alive request. */
2036typedef struct sSirKeepAliveReq {
2037 uint8_t packetType;
2038 uint32_t timePeriod;
2039 tSirIpv4Addr hostIpv4Addr;
2040 tSirIpv4Addr destIpv4Addr;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302041 struct qdf_mac_addr dest_macaddr;
2042 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002043 uint8_t sessionId;
2044} tSirKeepAliveReq, *tpSirKeepAliveReq;
2045
2046typedef struct sSirSmeMgmtFrameInd {
Abhishek Singh7996eb72015-12-30 17:24:02 +05302047 uint16_t frame_len;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002048 uint32_t rxChan;
2049 uint8_t sessionId;
2050 uint8_t frameType;
2051 int8_t rxRssi;
2052 uint8_t frameBuf[1]; /* variable */
2053} tSirSmeMgmtFrameInd, *tpSirSmeMgmtFrameInd;
2054
Abhishek Singh7996eb72015-12-30 17:24:02 +05302055typedef void (*sir_mgmt_frame_ind_callback)(tSirSmeMgmtFrameInd *frame_ind);
2056/**
2057 * struct sir_sme_mgmt_frame_cb_req - Register a
2058 * management frame callback req
2059 *
2060 * @message_type: message id
2061 * @length: msg length
2062 * @callback: callback for management frame indication
2063 */
2064struct sir_sme_mgmt_frame_cb_req {
2065 uint16_t message_type;
2066 uint16_t length;
2067 sir_mgmt_frame_ind_callback callback;
2068};
2069
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002070#ifdef WLAN_FEATURE_11W
2071typedef struct sSirSmeUnprotMgmtFrameInd {
2072 uint8_t sessionId;
2073 uint8_t frameType;
2074 uint8_t frameLen;
2075 uint8_t frameBuf[1]; /* variable */
2076} tSirSmeUnprotMgmtFrameInd, *tpSirSmeUnprotMgmtFrameInd;
2077#endif
2078
2079#define SIR_IS_FULL_POWER_REASON_DISCONNECTED(eReason) \
2080 ((eSME_LINK_DISCONNECTED_BY_HDD == (eReason)) || \
2081 (eSME_LINK_DISCONNECTED_BY_OTHER == (eReason)))
2082#define SIR_IS_FULL_POWER_NEEDED_BY_HDD(eReason) \
2083 ((eSME_LINK_DISCONNECTED_BY_HDD == (eReason)) || \
2084 (eSME_FULL_PWR_NEEDED_BY_HDD == (eReason)))
2085
2086/* P2P Power Save Related */
2087typedef struct sSirNoAParam {
2088 uint8_t ctWindow:7;
2089 uint8_t OppPS:1;
2090 uint8_t count;
2091 uint32_t duration;
2092 uint32_t interval;
2093 uint32_t singleNoADuration;
2094 uint8_t psSelection;
2095} tSirNoAParam, *tpSirNoAParam;
2096
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002097#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
2098
2099typedef enum ext_wow_type {
2100 EXT_WOW_TYPE_APP_TYPE1, /* wow type: only enable wakeup for app type1 */
2101 EXT_WOW_TYPE_APP_TYPE2, /* wow type: only enable wakeup for app type2 */
2102 EXT_WOW_TYPE_APP_TYPE1_2, /* wow type: enable wakeup for app type1&2 */
2103} EXT_WOW_TYPE;
2104
2105typedef struct {
2106 uint8_t vdev_id;
2107 EXT_WOW_TYPE type;
2108 uint32_t wakeup_pin_num;
2109} tSirExtWoWParams, *tpSirExtWoWParams;
2110
2111typedef struct {
2112 uint8_t vdev_id;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302113 struct qdf_mac_addr wakee_mac_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002114 uint8_t identification_id[8];
2115 uint8_t password[16];
2116 uint32_t id_length;
2117 uint32_t pass_length;
2118} tSirAppType1Params, *tpSirAppType1Params;
2119
2120typedef struct {
2121 uint8_t vdev_id;
2122
2123 uint8_t rc4_key[16];
2124 uint32_t rc4_key_len;
2125
2126 /** ip header parameter */
2127 uint32_t ip_id; /* NC id */
2128 uint32_t ip_device_ip; /* NC IP address */
2129 uint32_t ip_server_ip; /* Push server IP address */
2130
2131 /** tcp header parameter */
2132 uint16_t tcp_src_port; /* NC TCP port */
2133 uint16_t tcp_dst_port; /* Push server TCP port */
2134 uint32_t tcp_seq;
2135 uint32_t tcp_ack_seq;
2136
2137 uint32_t keepalive_init; /* Initial ping interval */
2138 uint32_t keepalive_min; /* Minimum ping interval */
2139 uint32_t keepalive_max; /* Maximum ping interval */
2140 uint32_t keepalive_inc; /* Increment of ping interval */
2141
Anurag Chouhan6d760662016-02-20 16:05:43 +05302142 struct qdf_mac_addr gateway_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002143 uint32_t tcp_tx_timeout_val;
2144 uint32_t tcp_rx_timeout_val;
2145} tSirAppType2Params, *tpSirAppType2Params;
2146#endif
2147
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002148#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2149typedef struct {
2150 uint8_t acvo_uapsd:1;
2151 uint8_t acvi_uapsd:1;
2152 uint8_t acbk_uapsd:1;
2153 uint8_t acbe_uapsd:1;
2154 uint8_t reserved:4;
2155} tSirAcUapsd, *tpSirAcUapsd;
2156#endif
2157
2158typedef struct {
2159 tSirMacSSid ssId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302160 uint8_t currAPbssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002161 uint32_t authentication;
2162 uint8_t encryption;
2163 uint8_t mcencryption;
2164 uint8_t ChannelCount;
2165 uint8_t ChannelCache[SIR_ROAM_MAX_CHANNELS];
2166#ifdef WLAN_FEATURE_11W
2167 bool mfp_enabled;
2168#endif
2169
2170} tSirRoamNetworkType;
2171
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002172typedef enum {
2173 SIR_ROAMING_DFS_CHANNEL_DISABLED = 0,
2174 SIR_ROAMING_DFS_CHANNEL_ENABLED_NORMAL = 1,
2175 SIR_ROAMING_DFS_CHANNEL_ENABLED_ACTIVE = 2
2176} eSirDFSRoamScanMode;
2177#define MAX_SSID_ALLOWED_LIST 4
2178#define MAX_BSSID_AVOID_LIST 16
2179#define MAX_BSSID_FAVORED 16
2180/**
2181 * struct roam_ext_params - Structure holding roaming parameters
2182 * @num_bssid_avoid_list: The number of BSSID's that we should
2183 * avoid connecting to. It is like a
2184 * blacklist of BSSID's.
2185 * @num_ssid_allowed_list: The number of SSID profiles that are
2186 * in the Whitelist. When roaming, we
2187 * consider the BSSID's with this SSID
2188 * also for roaming apart from the connected one's
2189 * @num_bssid_favored: Number of BSSID's which have a preference over
2190 * others
2191 * @ssid_allowed_list: Whitelist SSID's
2192 * @bssid_avoid_list: Blacklist SSID's
2193 * @bssid_favored: Favorable BSSID's
2194 * @bssid_favored_factor: RSSI to be added to this BSSID to prefer it
2195 * @raise_rssi_thresh_5g: The RSSI threshold below which the
2196 * raise_factor_5g (boost factor) should be
2197 * applied.
2198 * @drop_rssi_thresh_5g: The RSSI threshold beyond which the
2199 * drop_factor_5g (penalty factor) should be
2200 * applied
2201 * @raise_rssi_type_5g: Algorithm to apply the boost factor
2202 * @raise_factor_5g: Boost factor
2203 * @drop_rssi_type_5g: Algorithm to apply the penalty factor
2204 * @drop_factor_5g: Penalty factor
2205 * @max_raise_rssi_5g: Maximum amount of Boost that can added
2206 * @max_drop_rssi_5g: Maximum amount of penalty that can be subtracted
2207 * @good_rssi_threshold: The Lookup UP threshold beyond which roaming
2208 * scan should be performed.
2209 * @rssi_diff: RSSI difference for the AP to be better over the
2210 * current AP to avoid ping pong effects
2211 * @good_rssi_roam: Lazy Roam
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002212 * @bg_scan_bad_rssi_thresh: Bad RSSI threshold to perform bg scan.
Vignesh Viswanathanc018e982017-09-07 18:49:19 +05302213 * @bad_rssi_thresh_offset_2g: Offset from Bad RSSI threshold for 2G to 5G Roam
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002214 * @bg_scan_client_bitmap: Bitmap to identify the client scans to snoop.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002215 *
2216 * This structure holds all the key parameters related to
2217 * initial connection and also roaming connections.
2218 * */
2219struct roam_ext_params {
2220 uint8_t num_bssid_avoid_list;
2221 uint8_t num_ssid_allowed_list;
2222 uint8_t num_bssid_favored;
2223 tSirMacSSid ssid_allowed_list[MAX_SSID_ALLOWED_LIST];
Anurag Chouhan6d760662016-02-20 16:05:43 +05302224 struct qdf_mac_addr bssid_avoid_list[MAX_BSSID_AVOID_LIST];
2225 struct qdf_mac_addr bssid_favored[MAX_BSSID_FAVORED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002226 uint8_t bssid_favored_factor[MAX_BSSID_FAVORED];
2227 int raise_rssi_thresh_5g;
2228 int drop_rssi_thresh_5g;
2229 uint8_t raise_rssi_type_5g;
2230 uint8_t raise_factor_5g;
2231 uint8_t drop_rssi_type_5g;
2232 uint8_t drop_factor_5g;
2233 int max_raise_rssi_5g;
2234 int max_drop_rssi_5g;
2235 int alert_rssi_threshold;
2236 int rssi_diff;
2237 int good_rssi_roam;
Gupta, Kapilc68ad462016-02-01 19:17:23 +05302238 int dense_rssi_thresh_offset;
2239 int dense_min_aps_cnt;
2240 int initial_dense_status;
2241 int traffic_threshold;
Abhishek Singh4db8c152017-07-18 10:40:08 +05302242 uint8_t num_rssi_rejection_ap;
2243 struct rssi_disallow_bssid rssi_rejection_ap[MAX_RSSI_AVOID_BSSID_LIST];
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002244 int8_t bg_scan_bad_rssi_thresh;
Vignesh Viswanathanc018e982017-09-07 18:49:19 +05302245 uint8_t roam_bad_rssi_thresh_offset_2g;
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002246 uint32_t bg_scan_client_bitmap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002247};
2248
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08002249/**
2250 * struct pmkid_mode_bits - Bit flags for PMKID usage in RSN IE
2251 * @fw_okc: Opportunistic key caching enable in firmware
2252 * @fw_pmksa_cache: PMKSA caching enable in firmware, remember previously
2253 * visited BSSID/PMK pairs
2254 */
2255struct pmkid_mode_bits {
2256 uint32_t fw_okc:1;
2257 uint32_t fw_pmksa_cache:1;
2258 uint32_t unused:30;
2259};
2260
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302261/**
2262 * struct lca_disallow_config_params - LCA[Last Connected AP]
2263 * disallow config params
2264 * @disallow_duration: LCA AP disallowed duration
2265 * @rssi_channel_penalization: RSSI channel Penalization
2266 * @num_disallowed_aps: Maximum number of AP's in LCA list
2267 *
2268 */
Srinivas Girigowdaea4d8062017-10-14 12:40:48 -07002269struct lca_disallow_config_params {
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302270 uint32_t disallow_duration;
2271 uint32_t rssi_channel_penalization;
2272 uint32_t num_disallowed_aps;
2273};
2274
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002275/**
2276 * struct mawc_params - Motion Aided Wireless Connectivity configuration
Wu Gaoca416ff2018-09-17 11:05:07 +08002277 * @mawc_enabled: Global configuration for MAWC (Roaming/PNO/ExtScan)
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002278 * @mawc_roam_enabled: MAWC roaming enable/disable
2279 * @mawc_roam_traffic_threshold: Traffic threshold in kBps for MAWC roaming
2280 * @mawc_roam_ap_rssi_threshold: AP RSSI threshold for MAWC roaming
2281 * @mawc_roam_rssi_high_adjust: High Adjustment value for suppressing scan
2282 * @mawc_roam_rssi_low_adjust: Low Adjustment value for suppressing scan
2283 */
2284struct mawc_params {
2285 bool mawc_enabled;
2286 bool mawc_roam_enabled;
2287 uint32_t mawc_roam_traffic_threshold;
2288 int8_t mawc_roam_ap_rssi_threshold;
2289 uint8_t mawc_roam_rssi_high_adjust;
2290 uint8_t mawc_roam_rssi_low_adjust;
2291};
2292
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002293typedef struct sSirRoamOffloadScanReq {
Selvaraj, Sridhar01741822016-08-30 18:26:19 +05302294 uint16_t message_type;
2295 uint16_t length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002296 bool RoamScanOffloadEnabled;
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002297 struct mawc_params mawc_roam_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002298 int8_t LookupThreshold;
Varun Reddy Yeturu168134f2017-06-26 13:46:05 -07002299 int8_t rssi_thresh_offset_5g;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002300 uint8_t delay_before_vdev_stop;
2301 uint8_t OpportunisticScanThresholdDiff;
2302 uint8_t RoamRescanRssiDiff;
2303 uint8_t RoamRssiDiff;
gaurank kathpaliac63859d2018-05-03 18:48:41 +05302304 struct rsn_caps rsn_caps;
Abhishek Singh34c0e632017-09-28 14:39:29 +05302305 int32_t rssi_abs_thresh;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002306 uint8_t ChannelCacheType;
2307 uint8_t Command;
2308 uint8_t reason;
2309 uint16_t NeighborScanTimerPeriod;
Sridhar Selvaraj1b2330c2017-07-21 15:16:42 +05302310 uint16_t neighbor_scan_min_timer_period;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002311 uint16_t NeighborScanChannelMinTime;
2312 uint16_t NeighborScanChannelMaxTime;
2313 uint16_t EmptyRefreshScanPeriod;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002314 bool IsESEAssoc;
Abhinav Kumar271f0632018-03-29 16:01:30 +05302315 bool is_11r_assoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002316 uint8_t nProbes;
2317 uint16_t HomeAwayTime;
2318 tSirRoamNetworkType ConnectedNetwork;
Jeff Johnson9e760832018-12-15 12:41:36 -08002319 struct mobility_domain_info mdid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002320 uint8_t sessionId;
2321 uint8_t RoamBmissFirstBcnt;
2322 uint8_t RoamBmissFinalBcnt;
2323 uint8_t RoamBeaconRssiWeight;
2324 eSirDFSRoamScanMode allowDFSChannelRoam;
2325#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Jianmin Zhubf845932018-12-17 11:52:50 +08002326 uint8_t roam_offload_enabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002327 uint8_t PSK_PMK[SIR_ROAM_SCAN_PSK_SIZE];
2328 uint32_t pmk_len;
2329 uint8_t Prefer5GHz;
2330 uint8_t RoamRssiCatGap;
2331 uint8_t Select5GHzMargin;
2332 uint8_t KRK[SIR_KRK_KEY_LEN];
2333 uint8_t BTK[SIR_BTK_KEY_LEN];
2334 uint32_t ReassocFailureTimeout;
2335 tSirAcUapsd AcUapsd;
2336 uint8_t R0KH_ID[SIR_ROAM_R0KH_ID_MAX_LEN];
2337 uint32_t R0KH_ID_Length;
2338 uint8_t RoamKeyMgmtOffloadEnabled;
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08002339 struct pmkid_mode_bits pmkid_modes;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002340#endif
2341 struct roam_ext_params roam_params;
2342 uint8_t middle_of_roaming;
2343 uint32_t hi_rssi_scan_max_count;
2344 uint32_t hi_rssi_scan_rssi_delta;
2345 uint32_t hi_rssi_scan_delay;
2346 int32_t hi_rssi_scan_rssi_ub;
Varun Reddy Yeturu05186292015-09-28 17:12:33 -07002347 uint8_t early_stop_scan_enable;
2348 int8_t early_stop_scan_min_threshold;
2349 int8_t early_stop_scan_max_threshold;
Sandeep Puligillaf5ccbf62018-03-26 16:37:05 -07002350 enum scan_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode;
Selvaraj, Sridhara7fc7632016-09-04 13:13:38 +05302351 tSirAddie assoc_ie;
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302352 struct lca_disallow_config_params lca_config_params;
Himanshu Agarwal8bcec572017-09-28 11:54:37 +05302353 struct scoring_param score_params;
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05302354#ifdef WLAN_FEATURE_FILS_SK
2355 bool is_fils_connection;
2356 struct roam_fils_params roam_fils_params;
2357#endif
yeshwanth sriram guntuka41f936c2017-09-01 17:53:49 +05302358 uint32_t btm_offload_config;
Jiachao Wu84bb2ea2018-01-08 16:17:33 +08002359 uint32_t btm_solicited_timeout;
2360 uint32_t btm_max_attempt_cnt;
2361 uint32_t btm_sticky_time;
Pragaspathi Thilagarajae7dc762018-12-12 18:10:50 +05302362 uint32_t rct_validity_timer;
2363 uint32_t disassoc_timer_threshold;
Vignesh Viswanathanfb9d0752018-02-06 16:19:00 +05302364 struct wmi_11k_offload_params offload_11k_params;
Abhinav Kumara083f212018-04-05 18:49:45 +05302365 uint32_t ho_delay_for_rx;
Sourav Mohapatra5ba8da32018-07-16 09:21:15 +05302366 uint32_t roam_preauth_retry_count;
2367 uint32_t roam_preauth_no_ack_timeout;
Abhinav Kumara95af7c2018-04-06 17:08:00 +05302368 uint32_t min_delay_btw_roam_scans;
2369 uint32_t roam_trigger_reason_bitmask;
Abhinav Kumaredd1d372018-05-11 15:33:35 +05302370 bool roam_force_rssi_trigger;
Pragaspathi Thilagaraj69f0b692018-12-16 22:23:04 +05302371 /* bss load triggered roam related params */
2372 bool bss_load_trig_enabled;
2373 struct wmi_bss_load_config bss_load_config;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002374} tSirRoamOffloadScanReq, *tpSirRoamOffloadScanReq;
2375
2376typedef struct sSirRoamOffloadScanRsp {
2377 uint8_t sessionId;
2378 uint32_t reason;
2379} tSirRoamOffloadScanRsp, *tpSirRoamOffloadScanRsp;
2380
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002381/*---------------------------------------------------------------------------
2382 Packet Filtering Parameters
2383 ---------------------------------------------------------------------------*/
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002384#define SIR_MAX_FILTER_TEST_DATA_LEN 8
Dustin Brown4d1e8462016-12-14 12:12:24 -08002385#define SIR_MAX_FILTER_TEST_DATA_OFFSET 200
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002386#define SIR_MAX_NUM_MULTICAST_ADDRESS 240
2387#define SIR_MAX_NUM_FILTERS 20
2388#define SIR_MAX_NUM_TESTS_PER_FILTER 10
2389
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002390/* */
2391/* Multicast Address List Parameters */
2392/* */
2393typedef struct sSirRcvFltMcAddrList {
2394 uint32_t ulMulticastAddrCnt;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302395 struct qdf_mac_addr multicastAddr[SIR_MAX_NUM_MULTICAST_ADDRESS];
2396 struct qdf_mac_addr self_macaddr;
2397 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002398 uint8_t action;
2399} tSirRcvFltMcAddrList, *tpSirRcvFltMcAddrList;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002400
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002401/**
2402 * struct sir_wifi_start_log - Structure to store the params sent to start/
2403 * stop logging
2404 * @name: Attribute which indicates the type of logging like per packet
2405 * statistics, connectivity etc.
2406 * @verbose_level: Verbose level which can be 0,1,2,3
Poddar, Siddartheefe3482016-09-21 18:12:59 +05302407 * @is_iwpriv_command: Set 1 for iwpriv command
Srinivas Girigowdac34f11d2016-02-25 16:02:42 -08002408 * @ini_triggered: triggered using ini
2409 * @user_triggered: triggered by user
Poddar, Siddarth176c4362016-10-03 12:25:00 +05302410 * @size: pktlog buffer size
Poddar, Siddarthab99a272017-04-10 12:53:26 +05302411 * @is_pktlog_buff_clear: clear the pktlog buffer
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002412 */
2413struct sir_wifi_start_log {
2414 uint32_t ring_id;
2415 uint32_t verbose_level;
Poddar, Siddartheefe3482016-09-21 18:12:59 +05302416 uint32_t is_iwpriv_command;
Srinivas Girigowdac34f11d2016-02-25 16:02:42 -08002417 bool ini_triggered;
2418 uint8_t user_triggered;
Poddar, Siddarth176c4362016-10-03 12:25:00 +05302419 int size;
Poddar, Siddarthab99a272017-04-10 12:53:26 +05302420 bool is_pktlog_buff_clear;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002421};
2422
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002423
2424/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002425 * struct sir_pcl_list - Format of PCL
2426 * @pcl_list: List of preferred channels
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302427 * @weight_list: Weights of the PCL
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002428 * @pcl_len: Number of channels in the PCL
2429 */
2430struct sir_pcl_list {
Rajeev Kumar Sirasanagandla4133d862018-08-23 12:21:36 +05302431 uint32_t pcl_len;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002432 uint8_t pcl_list[128];
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302433 uint8_t weight_list[128];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002434};
2435
2436/**
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302437 * struct sir_pcl_chan_weights - Params to get the valid weighed list
2438 * @pcl_list: Preferred channel list already sorted in the order of preference
2439 * @pcl_len: Length of the PCL
2440 * @saved_chan_list: Valid channel list updated as part of
2441 * WMA_UPDATE_CHAN_LIST_REQ
2442 * @saved_num_chan: Length of the valid channel list
2443 * @weighed_valid_list: Weights of the valid channel list. This will have one
2444 * to one mapping with valid_chan_list. FW expects channel order and size to be
2445 * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID.
2446 * @weight_list: Weights assigned by policy manager
2447 */
2448struct sir_pcl_chan_weights {
2449 uint8_t pcl_list[128];
2450 uint32_t pcl_len;
2451 uint8_t saved_chan_list[128];
2452 uint32_t saved_num_chan;
2453 uint8_t weighed_valid_list[128];
2454 uint8_t weight_list[128];
2455};
2456
2457/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002458 * struct sir_hw_mode_params - HW mode params
2459 * @mac0_tx_ss: MAC0 Tx spatial stream
2460 * @mac0_rx_ss: MAC0 Rx spatial stream
2461 * @mac1_tx_ss: MAC1 Tx spatial stream
2462 * @mac1_rx_ss: MAC1 Rx spatial stream
2463 * @mac0_bw: MAC0 bandwidth
2464 * @mac1_bw: MAC1 bandwidth
2465 * @dbs_cap: DBS capabality
2466 * @agile_dfs_cap: Agile DFS capabality
2467 */
2468struct sir_hw_mode_params {
2469 uint8_t mac0_tx_ss;
2470 uint8_t mac0_rx_ss;
2471 uint8_t mac1_tx_ss;
2472 uint8_t mac1_rx_ss;
2473 uint8_t mac0_bw;
2474 uint8_t mac1_bw;
2475 uint8_t dbs_cap;
2476 uint8_t agile_dfs_cap;
Nitesh Shah5b7bae02016-09-28 18:58:33 +05302477 uint8_t sbs_cap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002478};
2479
2480/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002481 * struct sir_set_hw_mode_resp - HW mode response
2482 * @status: Status
2483 * @cfgd_hw_mode_index: Configured HW mode index
2484 * @num_vdev_mac_entries: Number of vdev-mac id entries
2485 * @vdev_mac_map: vdev id-mac id map
2486 */
2487struct sir_set_hw_mode_resp {
2488 uint32_t status;
2489 uint32_t cfgd_hw_mode_index;
2490 uint32_t num_vdev_mac_entries;
Tushnim Bhattacharyyaeab33dd2017-11-15 15:20:02 -08002491 struct policy_mgr_vdev_mac_map vdev_mac_map[MAX_VDEV_SUPPORTED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002492};
2493
2494/**
2495 * struct sir_hw_mode_trans_ind - HW mode transition indication
2496 * @old_hw_mode_index: Index of old HW mode
2497 * @new_hw_mode_index: Index of new HW mode
2498 * @num_vdev_mac_entries: Number of vdev-mac id entries
2499 * @vdev_mac_map: vdev id-mac id map
2500 */
2501struct sir_hw_mode_trans_ind {
2502 uint32_t old_hw_mode_index;
2503 uint32_t new_hw_mode_index;
2504 uint32_t num_vdev_mac_entries;
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08002505 struct policy_mgr_vdev_mac_map vdev_mac_map[MAX_VDEV_SUPPORTED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002506};
2507
2508/**
2509 * struct sir_dual_mac_config_resp - Dual MAC config response
2510 * @status: Status of setting the dual mac configuration
2511 */
2512struct sir_dual_mac_config_resp {
2513 uint32_t status;
2514};
2515
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -08002516/**
2517 * enum set_antenna_mode_status - Status of set antenna mode
2518 * command
2519 * @SET_ANTENNA_MODE_STATUS_OK: command successful
2520 * @SET_ANTENNA_MODE_STATUS_EINVAL: invalid antenna mode
2521 * @SET_ANTENNA_MODE_STATUS_ECANCELED: mode change cancelled
2522 * @SET_ANTENNA_MODE_STATUS_ENOTSUP: mode not supported
2523 */
2524enum set_antenna_mode_status {
2525 SET_ANTENNA_MODE_STATUS_OK,
2526 SET_ANTENNA_MODE_STATUS_EINVAL,
2527 SET_ANTENNA_MODE_STATUS_ECANCELED,
2528 SET_ANTENNA_MODE_STATUS_ENOTSUP,
2529};
2530
2531/**
2532 * struct sir_antenna_mode_resp - set antenna mode response
2533 * @status: Status of setting the antenna mode
2534 */
2535struct sir_antenna_mode_resp {
2536 enum set_antenna_mode_status status;
2537};
2538
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002539#ifdef FEATURE_WLAN_TDLS
2540/* TDLS Request struct SME-->PE */
2541typedef struct sSirTdlsSendMgmtReq {
2542 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
2543 uint16_t length;
2544 uint8_t sessionId; /* Session ID */
2545 uint16_t transactionId; /* Transaction ID for cmd */
2546 uint8_t reqType;
2547 uint8_t dialog;
2548 uint16_t statusCode;
2549 uint8_t responder;
2550 uint32_t peerCapability;
2551 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302552 struct qdf_mac_addr bssid;
2553 struct qdf_mac_addr peer_mac;
Ganesh Kondabattinidd726522017-05-10 18:09:37 +05302554 enum wifi_traffic_ac ac;
Srinivas Girigowdaa9d12f12015-11-24 11:26:40 -08002555 /* Variable length. Dont add any field after this. */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002556 uint8_t addIe[1];
2557} tSirTdlsSendMgmtReq, *tpSirSmeTdlsSendMgmtReq;
2558
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002559/* TDLS Request struct SME-->PE */
2560typedef struct sSirTdlsAddStaReq {
2561 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
2562 uint16_t length;
2563 uint8_t sessionId; /* Session ID */
2564 uint16_t transactionId; /* Transaction ID for cmd */
2565 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302566 struct qdf_mac_addr bssid;
Bala Venkatesh4a72b062018-11-13 13:04:49 +05302567 enum tdls_add_oper tdlsAddOper;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302568 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002569 uint16_t capability;
2570 uint8_t extn_capability[SIR_MAC_MAX_EXTN_CAP];
2571 uint8_t supported_rates_length;
2572 uint8_t supported_rates[SIR_MAC_MAX_SUPP_RATES];
2573 uint8_t htcap_present;
Bala Venkatesh02d52352018-11-26 15:12:58 +05302574 struct htcap_cmn_ie htCap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002575 uint8_t vhtcap_present;
2576 tSirVHTCap vhtCap;
2577 uint8_t uapsd_queues;
2578 uint8_t max_sp;
2579} tSirTdlsAddStaReq, *tpSirSmeTdlsAddStaReq;
2580
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002581/* TDLS Request struct SME-->PE */
2582typedef struct sSirTdlsDelStaReq {
2583 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
2584 uint16_t length;
2585 uint8_t sessionId; /* Session ID */
2586 uint16_t transactionId; /* Transaction ID for cmd */
2587 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302588 struct qdf_mac_addr bssid;
2589 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002590} tSirTdlsDelStaReq, *tpSirSmeTdlsDelStaReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002591#endif /* FEATURE_WLAN_TDLS */
2592
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002593/* Reset AP Caps Changed */
2594typedef struct sSirResetAPCapsChange {
2595 uint16_t messageType;
2596 uint16_t length;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302597 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002598} tSirResetAPCapsChange, *tpSirResetAPCapsChange;
2599
2600/* / Definition for Candidate found indication from FW */
2601typedef struct sSirSmeCandidateFoundInd {
2602 uint16_t messageType; /* eWNI_SME_CANDIDATE_FOUND_IND */
2603 uint16_t length;
2604 uint8_t sessionId; /* Session Identifier */
2605} tSirSmeCandidateFoundInd, *tpSirSmeCandidateFoundInd;
2606
2607#ifdef WLAN_FEATURE_11W
2608typedef struct sSirWlanExcludeUnencryptParam {
2609 bool excludeUnencrypt;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302610 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002611} tSirWlanExcludeUnencryptParam, *tpSirWlanExcludeUnencryptParam;
2612#endif
2613
2614typedef enum {
2615 P2P_SCAN_TYPE_SEARCH = 1, /* P2P Search */
2616 P2P_SCAN_TYPE_LISTEN /* P2P Listen */
2617} tSirP2pScanType;
2618
2619typedef struct sAniHandoffReq {
2620 /* Common for all types are requests */
2621 uint16_t msgType; /* message type is same as the request type */
2622 uint16_t msgLen; /* length of the entire request */
2623 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302624 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002625 uint8_t channel;
2626 uint8_t handoff_src;
2627} tAniHandoffReq, *tpAniHandoffReq;
2628
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08002629/**
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07002630 * sir_scan_event_type - scan event types used in LIM
2631 * @SIR_SCAN_EVENT_STARTED - scan command accepted by FW
2632 * @SIR_SCAN_EVENT_COMPLETED - scan has been completed by FW
2633 * @SIR_SCAN_EVENT_BSS_CHANNEL - FW is going to move to HOME channel
2634 * @SIR_SCAN_EVENT_FOREIGN_CHANNEL - FW is going to move to FORIEGN channel
2635 * @SIR_SCAN_EVENT_DEQUEUED - scan request got dequeued
2636 * @SIR_SCAN_EVENT_PREEMPTED - preempted by other high priority scan
2637 * @SIR_SCAN_EVENT_START_FAILED - scan start failed
2638 * @SIR_SCAN_EVENT_RESTARTED - scan restarted
2639 * @SIR_SCAN_EVENT_MAX - max value for event type
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08002640*/
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07002641enum sir_scan_event_type {
2642 SIR_SCAN_EVENT_STARTED = 0x1,
2643 SIR_SCAN_EVENT_COMPLETED = 0x2,
2644 SIR_SCAN_EVENT_BSS_CHANNEL = 0x4,
2645 SIR_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
2646 SIR_SCAN_EVENT_DEQUEUED = 0x10,
2647 SIR_SCAN_EVENT_PREEMPTED = 0x20,
2648 SIR_SCAN_EVENT_START_FAILED = 0x40,
2649 SIR_SCAN_EVENT_RESTARTED = 0x80,
2650 SIR_SCAN_EVENT_MAX = 0x8000
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08002651};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002652
2653typedef struct sSirScanOffloadEvent {
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07002654 enum sir_scan_event_type event;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002655 tSirResultCodes reasonCode;
2656 uint32_t chanFreq;
2657 uint32_t requestor;
2658 uint32_t scanId;
2659 tSirP2pScanType p2pScanType;
2660 uint8_t sessionId;
2661} tSirScanOffloadEvent, *tpSirScanOffloadEvent;
2662
2663/**
2664 * struct sSirUpdateChanParam - channel parameters
2665 * @chanId: ID of the channel
2666 * @pwr: power level
2667 * @dfsSet: is dfs supported or not
2668 * @half_rate: is the channel operating at 10MHz
2669 * @quarter_rate: is the channel operating at 5MHz
2670 */
2671typedef struct sSirUpdateChanParam {
2672 uint8_t chanId;
2673 uint8_t pwr;
2674 bool dfsSet;
2675 bool half_rate;
2676 bool quarter_rate;
2677} tSirUpdateChanParam, *tpSirUpdateChanParam;
2678
2679typedef struct sSirUpdateChan {
2680 uint8_t numChan;
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07002681 uint8_t ht_en;
2682 uint8_t vht_en;
2683 uint8_t vht_24_en;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002684 tSirUpdateChanParam chanParam[1];
2685} tSirUpdateChanList, *tpSirUpdateChanList;
2686
2687typedef enum eSirAddonPsReq {
2688 eSIR_ADDON_NOTHING,
2689 eSIR_ADDON_ENABLE_UAPSD,
2690 eSIR_ADDON_DISABLE_UAPSD
2691} tSirAddonPsReq;
2692
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002693#ifdef FEATURE_WLAN_CH_AVOID
2694typedef struct sSirChAvoidUpdateReq {
2695 uint32_t reserved_param;
2696} tSirChAvoidUpdateReq;
2697#endif /* FEATURE_WLAN_CH_AVOID */
2698
2699typedef struct sSirLinkSpeedInfo {
2700 /* MAC Address for the peer */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302701 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002702 uint32_t estLinkSpeed; /* Linkspeed from firmware */
2703} tSirLinkSpeedInfo, *tpSirLinkSpeedInfo;
2704
Will Huanga9814592017-05-24 15:47:58 +08002705/**
2706 * struct sir_peer_info_req - peer info request struct
2707 * @peer_macaddr: MAC address
2708 * @sessionid: vdev id
2709 *
2710 * peer info request message's struct
2711 */
2712struct sir_peer_info_req {
2713 struct qdf_mac_addr peer_macaddr;
2714 uint8_t sessionid;
2715};
2716
2717/**
2718 * struct sir_peer_info - peer information struct
2719 * @peer_macaddr: MAC address
2720 * @rssi: rssi
2721 * @tx_rate: last tx rate
2722 * @rx_rate: last rx rate
2723 *
2724 * a station's information
2725 */
2726struct sir_peer_info {
2727 struct qdf_mac_addr peer_macaddr;
2728 int8_t rssi;
2729 uint32_t tx_rate;
2730 uint32_t rx_rate;
2731};
2732
2733/**
2734 * struct sir_peer_info_resp - all peers information struct
2735 * @count: peer's number
2736 * @info: peer information
2737 *
2738 * all station's information
2739 */
2740struct sir_peer_info_resp {
2741 uint8_t count;
2742 struct sir_peer_info info[0];
2743};
2744
2745/**
2746 * struct sir_peer_info_ext_req - peer info request struct
2747 * @peer_macaddr: MAC address
2748 * @sessionid: vdev id
2749 * @reset_after_request: fw reset statistics after query
2750 *
2751 * peer info request message's struct
2752 */
2753struct sir_peer_info_ext_req {
2754 struct qdf_mac_addr peer_macaddr;
2755 uint8_t sessionid;
2756 uint8_t reset_after_request;
2757};
2758
2759/**
2760 * struct sir_peer_info_ext - peer info information struct
2761 * (refer to station_info struct in Kernel)
2762 * @peer_macaddr: MAC address
2763 * @tx_packets: packets transmitted to this station
2764 * @tx_bytes: bytes transmitted to this station
2765 * @rx_packets: packets received from this station
2766 * @rx_bytes: bytes received from this station
2767 * @rx_retries: cumulative retry counts
2768 * @tx_failed: number of failed transmissions
2769 * @rssi: The signal strength
2770 * @tx_rate: last used tx bitrate (kbps)
2771 * @tx_rate_code: last tx rate code (last_tx_rate_code of wmi_peer_stats_info)
2772 * @rx_rate: last used rx bitrate (kbps)
2773 * @rx_rate_code: last rx rate code (last_rx_rate_code of wmi_peer_stats_info)
2774 *
2775 * a station's information
2776 */
2777struct sir_peer_info_ext {
2778 struct qdf_mac_addr peer_macaddr;
2779 uint32_t tx_packets;
2780 uint64_t tx_bytes;
2781 uint32_t rx_packets;
2782 uint64_t rx_bytes;
2783 uint32_t tx_retries;
2784 uint32_t tx_failed;
2785 int32_t rssi;
2786 uint32_t tx_rate;
2787 uint32_t tx_rate_code;
2788 uint32_t rx_rate;
2789 uint32_t rx_rate_code;
2790};
2791
2792/**
2793 * struct sir_peer_info_ext_resp - all peers' information struct
2794 * @count: peer's number
2795 * @info: peer information
2796 *
2797 * all station's information
2798 */
2799struct sir_peer_info_ext_resp {
2800 uint8_t count;
2801 struct sir_peer_info_ext info[0];
2802};
2803
Will Huang496b36c2017-07-11 16:38:50 +08002804/**
2805 * @sta_num: number of peer station which has valid info
2806 * @info: peer information
2807 *
2808 * all SAP peer station's information retrieved
2809 */
2810struct sir_peer_sta_info {
2811 uint8_t sta_num;
2812 struct sir_peer_info info[MAX_PEER_STA];
2813};
2814
2815/**
2816 * @sta_num: number of peer station which has valid info
2817 * @info: peer extended information
2818 *
2819 * all SAP peer station's extended information retrieved
2820 */
2821struct sir_peer_sta_ext_info {
2822 uint8_t sta_num;
2823 struct sir_peer_info_ext info[MAX_PEER_STA];
2824};
2825
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002826typedef struct sSirAddPeriodicTxPtrn {
2827 /* MAC Address for the adapter */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302828 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002829 uint8_t ucPtrnId; /* Pattern ID */
2830 uint16_t ucPtrnSize; /* Pattern size */
2831 uint32_t usPtrnIntervalMs; /* In msec */
2832 uint8_t ucPattern[PERIODIC_TX_PTRN_MAX_SIZE]; /* Pattern buffer */
2833} tSirAddPeriodicTxPtrn, *tpSirAddPeriodicTxPtrn;
2834
2835typedef struct sSirDelPeriodicTxPtrn {
2836 /* MAC Address for the adapter */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302837 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002838 uint8_t ucPtrnId; /* Pattern ID */
2839} tSirDelPeriodicTxPtrn, *tpSirDelPeriodicTxPtrn;
2840
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08002841/*---------------------------------------------------------------------------
2842* tSirIbssGetPeerInfoReqParams
2843*--------------------------------------------------------------------------*/
2844typedef struct {
2845 bool allPeerInfoReqd; /* If set, all IBSS peers stats are reported */
2846 uint8_t staIdx; /* If allPeerInfoReqd is not set, only stats */
2847 /* of peer with staIdx is reported */
2848} tSirIbssGetPeerInfoReqParams, *tpSirIbssGetPeerInfoReqParams;
2849
Rajeev Kumar94c9b452016-03-24 12:58:47 -07002850/**
2851 * typedef struct - tSirIbssGetPeerInfoParams
2852 * @mac_addr: mac address received from target
2853 * @txRate: TX rate
2854 * @mcsIndex: MCS index
Rajeev Kumar94c9b452016-03-24 12:58:47 -07002855 * @rssi: RSSI
2856 */
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08002857typedef struct {
Rajeev Kumar94c9b452016-03-24 12:58:47 -07002858 uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
2859 uint32_t txRate;
2860 uint32_t mcsIndex;
Rajeev Kumar94c9b452016-03-24 12:58:47 -07002861 int8_t rssi;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08002862} tSirIbssPeerInfoParams;
2863
2864typedef struct {
2865 uint32_t status;
2866 uint8_t numPeers;
2867 tSirIbssPeerInfoParams peerInfoParams[32];
2868} tSirPeerInfoRspParams, *tpSirIbssPeerInfoRspParams;
2869
2870/*---------------------------------------------------------------------------
2871* tSirIbssGetPeerInfoRspParams
2872*--------------------------------------------------------------------------*/
2873typedef struct {
2874 uint16_t mesgType;
2875 uint16_t mesgLen;
2876 tSirPeerInfoRspParams ibssPeerInfoRspParams;
2877} tSirIbssGetPeerInfoRspParams, *tpSirIbssGetPeerInfoRspParams;
2878
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002879#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
2880typedef struct {
2881 uint16_t mesgType;
2882 uint16_t mesgLen;
2883 bool status;
2884} tSirReadyToExtWoWInd, *tpSirReadyToExtWoWInd;
2885#endif
2886typedef struct sSirRateUpdateInd {
2887 uint8_t nss; /* 0: 1x1, 1: 2x2 */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302888 struct qdf_mac_addr bssid;
Jeff Johnsonc1e62782017-11-09 09:50:17 -08002889 enum QDF_OPMODE dev_mode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002890 int32_t bcastDataRate; /* bcast rate unit Mbpsx10, -1:not used */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002891
2892 /*
2893 * 0 implies MCAST RA, positive value implies fixed rate,
2894 * -1 implies ignore this param
2895 */
2896 int32_t reliableMcastDataRate; /* unit Mbpsx10 */
2897
2898 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07002899 enum tx_rate_info reliableMcastDataRateTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002900
2901 /*
2902 * MCAST(or BCAST) fixed data rate in 2.4 GHz, unit Mbpsx10,
2903 * 0 implies ignore
2904 */
2905 uint32_t mcastDataRate24GHz;
2906
2907 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07002908 enum tx_rate_info mcastDataRate24GHzTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002909
2910 /*
2911 * MCAST(or BCAST) fixed data rate in 5 GHz,
2912 * unit Mbpsx10, 0 implies ignore
2913 */
2914 uint32_t mcastDataRate5GHz;
2915
2916 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07002917 enum tx_rate_info mcastDataRate5GHzTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002918
2919} tSirRateUpdateInd, *tpSirRateUpdateInd;
2920
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002921#define SIR_DFS_MAX_20M_SUB_CH 8
Sandeep Puligilla949eaa72015-12-17 18:43:52 -08002922#define SIR_80MHZ_START_CENTER_CH_DIFF 6
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002923
2924typedef struct sSirSmeDfsChannelList {
2925 uint32_t nchannels;
2926 /* Ch num including bonded channels on which the RADAR is present */
2927 uint8_t channels[SIR_DFS_MAX_20M_SUB_CH];
2928} tSirSmeDfsChannelList, *tpSirSmeDfsChannelList;
2929
2930typedef struct sSirSmeDfsEventInd {
2931 uint32_t sessionId;
2932 tSirSmeDfsChannelList chan_list;
2933 uint32_t dfs_radar_status;
2934 int use_nol;
2935} tSirSmeDfsEventInd, *tpSirSmeDfsEventInd;
2936
2937typedef struct sSirChanChangeRequest {
2938 uint16_t messageType;
2939 uint16_t messageLen;
2940 uint8_t targetChannel;
Kiran Kumar Lokere999e58c2016-01-07 02:18:39 -08002941 uint8_t sec_ch_offset;
Kiran Kumar Lokere13644672016-02-29 15:40:10 -08002942 enum phy_ch_width ch_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002943 uint8_t center_freq_seg_0;
2944 uint8_t center_freq_seg_1;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302945 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002946 uint32_t dot11mode;
Bala Venkateshb39ed152017-12-26 19:35:27 +05302947 tSirNwType nw_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002948 tSirMacRateSet operational_rateset;
2949 tSirMacRateSet extended_rateset;
Arif Hussain671a1902017-03-17 09:08:32 -07002950 uint32_t cac_duration_ms;
2951 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002952} tSirChanChangeRequest, *tpSirChanChangeRequest;
2953
2954typedef struct sSirChanChangeResponse {
2955 uint8_t sessionId;
2956 uint8_t newChannelNumber;
2957 uint8_t channelChangeStatus;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002958} tSirChanChangeResponse, *tpSirChanChangeResponse;
2959
2960typedef struct sSirStartBeaconIndication {
2961 uint16_t messageType;
2962 uint16_t messageLen;
2963 uint8_t beaconStartStatus;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302964 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002965} tSirStartBeaconIndication, *tpSirStartBeaconIndication;
2966
2967/* additional IE type */
2968typedef enum tUpdateIEsType {
2969 eUPDATE_IE_NONE,
2970 eUPDATE_IE_PROBE_BCN,
2971 eUPDATE_IE_PROBE_RESP,
2972 eUPDATE_IE_ASSOC_RESP,
2973
2974 /* Add type above this line */
2975 /* this is used to reset all buffer */
2976 eUPDATE_IE_ALL,
2977 eUPDATE_IE_MAX
2978} eUpdateIEsType;
2979
2980/* Modify particular IE in addition IE for prob resp Bcn */
2981typedef struct sSirModifyIE {
Anurag Chouhan6d760662016-02-20 16:05:43 +05302982 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002983 uint16_t smeSessionId;
2984 bool notify;
2985 uint8_t ieID;
2986 uint8_t ieIDLen; /*ie length as per spec */
2987 uint16_t ieBufferlength;
2988 uint8_t *pIEBuffer;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08002989 int32_t oui_length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002990
2991} tSirModifyIE, *tpSirModifyIE;
2992
Kiran Kumar Lokerebc87bec2018-02-27 20:06:42 -08002993struct send_add_ba_req {
2994 uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
2995 struct addba_send_params param;
2996};
2997
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002998/* Message format for Update IE message sent to PE */
2999typedef struct sSirModifyIEsInd {
3000 uint16_t msgType;
3001 uint16_t msgLen;
3002 tSirModifyIE modifyIE;
3003 eUpdateIEsType updateType;
3004} tSirModifyIEsInd, *tpSirModifyIEsInd;
3005
3006/* Message format for Update IE message sent to PE */
3007typedef struct sSirUpdateIE {
Anurag Chouhan6d760662016-02-20 16:05:43 +05303008 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003009 uint16_t smeSessionId;
3010 bool append;
3011 bool notify;
3012 uint16_t ieBufferlength;
3013 uint8_t *pAdditionIEBuffer;
3014} tSirUpdateIE, *tpSirUpdateIE;
3015
3016/* Message format for Update IE message sent to PE */
3017typedef struct sSirUpdateIEsInd {
3018 uint16_t msgType;
3019 uint16_t msgLen;
3020 tSirUpdateIE updateIE;
3021 eUpdateIEsType updateType;
3022} tSirUpdateIEsInd, *tpSirUpdateIEsInd;
3023
3024/* Message format for requesting channel switch announcement to lower layers */
3025typedef struct sSirDfsCsaIeRequest {
3026 uint16_t msgType;
3027 uint16_t msgLen;
3028 uint8_t targetChannel;
3029 uint8_t csaIeRequired;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303030 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Amar Singhal5cccafe2017-02-15 12:42:58 -08003031 struct ch_params ch_params;
gaoleze2920bd2017-03-21 17:38:42 +08003032 uint8_t ch_switch_beacon_cnt;
gaolez76d2a162017-03-21 19:23:58 +08003033 uint8_t ch_switch_mode;
3034 uint8_t dfs_ch_switch_disable;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003035} tSirDfsCsaIeRequest, *tpSirDfsCsaIeRequest;
3036
3037/* Indication from lower layer indicating the completion of first beacon send
3038 * after the beacon template update
3039 */
3040typedef struct sSirFirstBeaconTxCompleteInd {
3041 uint16_t messageType; /* eWNI_SME_MISSED_BEACON_IND */
3042 uint16_t length;
3043 uint8_t bssIdx;
3044} tSirFirstBeaconTxCompleteInd, *tpSirFirstBeaconTxCompleteInd;
3045
3046typedef struct sSirSmeCSAIeTxCompleteRsp {
3047 uint8_t sessionId;
3048 uint8_t chanSwIeTxStatus;
3049} tSirSmeCSAIeTxCompleteRsp, *tpSirSmeCSAIeTxCompleteRsp;
3050
3051/* Thermal Mitigation*/
3052
3053typedef struct {
3054 uint16_t minTempThreshold;
3055 uint16_t maxTempThreshold;
3056} t_thermal_level_info, *tp_thermal_level_info;
3057
3058typedef enum {
3059 WLAN_WMA_THERMAL_LEVEL_0,
3060 WLAN_WMA_THERMAL_LEVEL_1,
3061 WLAN_WMA_THERMAL_LEVEL_2,
3062 WLAN_WMA_THERMAL_LEVEL_3,
3063 WLAN_WMA_MAX_THERMAL_LEVELS
3064} t_thermal_level;
3065
Poddar, Siddarth83905022016-04-16 17:56:08 -07003066#define WLAN_THROTTLE_DUTY_CYCLE_LEVEL_MAX (4)
3067
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003068typedef struct {
3069 /* Array of thermal levels */
3070 t_thermal_level_info thermalLevels[WLAN_WMA_MAX_THERMAL_LEVELS];
3071 uint8_t thermalCurrLevel;
3072 uint8_t thermalMgmtEnabled;
3073 uint32_t throttlePeriod;
Poddar, Siddarth83905022016-04-16 17:56:08 -07003074 uint8_t throttle_duty_cycle_tbl[WLAN_THROTTLE_DUTY_CYCLE_LEVEL_MAX];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003075} t_thermal_mgmt, *tp_thermal_mgmt;
3076
3077typedef struct sSirTxPowerLimit {
3078 /* Thermal limits for 2g and 5g */
3079 uint32_t txPower2g;
3080 uint32_t txPower5g;
3081} tSirTxPowerLimit;
3082
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +05303083enum bad_peer_thresh_levels {
3084 WLAN_WMA_IEEE80211_B_LEVEL = 0,
3085 WLAN_WMA_IEEE80211_AG_LEVEL,
3086 WLAN_WMA_IEEE80211_N_LEVEL,
3087 WLAN_WMA_IEEE80211_AC_LEVEL,
3088 WLAN_WMA_IEEE80211_AX_LEVEL,
3089 WLAN_WMA_IEEE80211_MAX_LEVEL,
3090};
3091
3092#define NUM_OF_RATE_THRESH_MAX (4)
3093struct t_bad_peer_info {
3094 uint32_t cond;
3095 uint32_t delta;
3096 uint32_t percentage;
3097 uint32_t thresh[NUM_OF_RATE_THRESH_MAX];
3098 uint32_t txlimit;
3099};
3100
3101struct t_bad_peer_txtcl_config {
3102 /* Array of thermal levels */
3103 struct t_bad_peer_info threshold[WLAN_WMA_IEEE80211_MAX_LEVEL];
3104 uint32_t enable;
3105 uint32_t period;
3106 uint32_t txq_limit;
3107 uint32_t tgt_backoff;
3108 uint32_t tgt_report_prd;
3109};
3110
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003111/* notify MODEM power state to FW */
3112typedef struct {
3113 uint32_t param;
3114} tSirModemPowerStateInd, *tpSirModemPowerStateInd;
3115
3116#ifdef WLAN_FEATURE_STATS_EXT
3117typedef struct {
3118 uint32_t vdev_id;
3119 uint32_t event_data_len;
3120 uint8_t event_data[];
3121} tSirStatsExtEvent, *tpSirStatsExtEvent;
3122#endif
3123
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003124typedef struct {
3125 uint32_t event_data_len;
3126 uint8_t event_data[];
3127} tSirNanEvent, *tpSirNanEvent;
Mahesh Kumar Kalikot Veetil919e01d2016-09-09 17:09:10 -07003128
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003129typedef struct sSirSmeRoamOffloadSynchInd {
3130 uint16_t messageType; /*eWNI_SME_ROAM_OFFLOAD_SYNCH_IND */
3131 uint16_t length;
3132 uint16_t beaconProbeRespOffset;
3133 uint16_t beaconProbeRespLength;
3134 uint16_t reassocRespOffset;
3135 uint16_t reassocRespLength;
Naveen Rawat14298b92015-11-25 16:27:41 -08003136 uint16_t reassoc_req_offset;
3137 uint16_t reassoc_req_length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003138 uint8_t isBeacon;
3139 uint8_t roamedVdevId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303140 struct qdf_mac_addr bssid;
Varun Reddy Yeturu28925b42016-02-08 07:18:50 -08003141 struct qdf_mac_addr self_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003142 int8_t txMgmtPower;
3143 uint32_t authStatus;
3144 uint8_t rssi;
3145 uint8_t roamReason;
3146 uint32_t chan_freq;
3147 uint8_t kck[SIR_KCK_KEY_LEN];
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05303148 uint32_t kek_len;
3149 uint8_t kek[SIR_KEK_KEY_LEN_FILS];
3150 uint32_t pmk_len;
3151 uint8_t pmk[SIR_PMK_LEN];
3152 uint8_t pmkid[SIR_PMKID_LEN];
3153 bool update_erp_next_seq_num;
3154 uint16_t next_erp_seq_num;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003155 uint8_t replay_ctr[SIR_REPLAY_CTR_LEN];
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08003156 void *add_bss_params;
3157 tpSirSmeJoinRsp join_rsp;
3158 uint16_t aid;
Naveen Rawat8cc23b02016-07-14 12:22:56 -07003159 struct sir_hw_mode_trans_ind hw_mode_trans_ind;
Naveen Rawat746a90b2017-06-07 15:16:35 -07003160 uint8_t nss;
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05303161 struct qdf_mac_addr dst_mac;
3162 struct qdf_mac_addr src_mac;
3163 uint16_t hlp_data_len;
3164 uint8_t hlp_data[FILS_MAX_HLP_DATA_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003165} roam_offload_synch_ind;
3166
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -08003167#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003168typedef struct sSirSmeRoamOffloadSynchCnf {
3169 uint8_t sessionId;
3170} tSirSmeRoamOffloadSynchCnf, *tpSirSmeRoamOffloadSynchCnf;
3171
3172typedef struct sSirSmeHOFailureInd {
3173 uint8_t sessionId;
3174} tSirSmeHOFailureInd, *tpSirSmeHOFailureInd;
3175
3176struct roam_offload_synch_fail {
3177 uint8_t session_id;
3178};
3179
3180#endif
3181
Wen Gong7952fbd2018-04-18 11:27:23 +08003182/**
3183 * struct sir_wisa_params - WISA Mode Parameters
3184 * @mode: WISA mode
3185 * @session_id: Session ID of vdev
3186 */
3187struct sir_wisa_params {
3188 bool mode;
3189 uint8_t vdev_id;
3190};
3191
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003192#ifdef FEATURE_WLAN_EXTSCAN
3193
Wen Gong7952fbd2018-04-18 11:27:23 +08003194#define WLAN_EXTSCAN_MAX_CHANNELS 36
3195#define WLAN_EXTSCAN_MAX_BUCKETS 16
Wen Gong7952fbd2018-04-18 11:27:23 +08003196#define WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS 64
3197
3198typedef enum {
3199 eSIR_EXTSCAN_INVALID,
3200 eSIR_EXTSCAN_START_RSP,
3201 eSIR_EXTSCAN_STOP_RSP,
3202 eSIR_EXTSCAN_CACHED_RESULTS_RSP,
3203 eSIR_EXTSCAN_SET_BSSID_HOTLIST_RSP,
3204 eSIR_EXTSCAN_RESET_BSSID_HOTLIST_RSP,
3205 eSIR_EXTSCAN_SET_SIGNIFICANT_WIFI_CHANGE_RSP,
3206 eSIR_EXTSCAN_RESET_SIGNIFICANT_WIFI_CHANGE_RSP,
3207
3208 eSIR_EXTSCAN_GET_CAPABILITIES_IND,
3209 eSIR_EXTSCAN_HOTLIST_MATCH_IND,
3210 eSIR_EXTSCAN_SIGNIFICANT_WIFI_CHANGE_RESULTS_IND,
3211 eSIR_EXTSCAN_CACHED_RESULTS_IND,
3212 eSIR_EXTSCAN_SCAN_RES_AVAILABLE_IND,
3213 eSIR_EXTSCAN_SCAN_PROGRESS_EVENT_IND,
3214 eSIR_EXTSCAN_FULL_SCAN_RESULT_IND,
3215 eSIR_EPNO_NETWORK_FOUND_IND,
3216 eSIR_PASSPOINT_NETWORK_FOUND_IND,
3217 eSIR_EXTSCAN_SET_SSID_HOTLIST_RSP,
3218 eSIR_EXTSCAN_RESET_SSID_HOTLIST_RSP,
3219
3220 /* Keep this last */
3221 eSIR_EXTSCAN_CALLBACK_TYPE_MAX,
3222} tSirExtScanCallbackType;
3223
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003224/**
3225 * typedef enum wifi_scan_flags - wifi scan flags
3226 * @WIFI_SCAN_FLAG_INTERRUPTED: Indicates that scan results are not complete
3227 * because probes were not sent on some channels
3228 */
3229typedef enum {
3230 WIFI_SCAN_FLAG_INTERRUPTED = 1,
3231} wifi_scan_flags;
3232
3233typedef enum {
3234 WIFI_BAND_UNSPECIFIED,
3235 WIFI_BAND_BG = 1, /* 2.4 GHz */
3236 WIFI_BAND_A = 2, /* 5 GHz without DFS */
3237 WIFI_BAND_ABG = 3, /* 2.4 GHz + 5 GHz; no DFS */
3238 WIFI_BAND_A_DFS_ONLY = 4, /* 5 GHz DFS only */
3239 /* 5 is reserved */
3240 WIFI_BAND_A_WITH_DFS = 6, /* 5 GHz with DFS */
3241 WIFI_BAND_ABG_WITH_DFS = 7, /* 2.4 GHz + 5 GHz with DFS */
3242
3243 /* Keep it last */
3244 WIFI_BAND_MAX
3245} tWifiBand;
3246
Mukul Sharma45114d92016-08-12 19:34:14 +05303247/**
3248 * enum wifi_extscan_event_type - extscan event type
3249 * @WIFI_EXTSCAN_RESULTS_AVAILABLE: reported when REPORT_EVENTS_EACH_SCAN is set
3250 * and a scan cycle completes. WIFI_SCAN_THRESHOLD_NUM_SCANS or
3251 * WIFI_SCAN_THRESHOLD_PERCENT can be reported instead if the
3252 * reason for the event is available; however, at most one of
3253 * these events should be reported per scan.
3254 * @WIFI_EXTSCAN_THRESHOLD_NUM_SCANS: can be reported when
3255 * REPORT_EVENTS_EACH_SCAN is not set and
3256 * report_threshold_num_scans is reached.
3257 * @WIFI_EXTSCAN_THRESHOLD_PERCENT: can be reported when REPORT_EVENTS_EACH_SCAN
3258 * is not set and report_threshold_percent is reached.
3259 * @WIFI_SCAN_DISABLED: reported when currently executing gscans are disabled
3260 * start_gscan will need to be called again in order to continue
3261 * scanning.
3262 * @WIFI_EXTSCAN_BUCKET_STARTED_EVENT: Bucket started event
3263 * This event is consumed in driver only.
3264 * @WIFI_EXTSCAN_CYCLE_STARTED_EVENT: Cycle started event.
3265 * This event is consumed in driver only.
3266 * @WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT: Cycle complete event. This event
3267 * triggers @WIFI_EXTSCAN_RESULTS_AVAILABLE to the user space.
3268 */
3269enum wifi_extscan_event_type {
Mukul Sharmafa937be2016-08-12 18:13:36 +05303270 WIFI_EXTSCAN_RESULTS_AVAILABLE,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303271 WIFI_EXTSCAN_THRESHOLD_NUM_SCANS,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303272 WIFI_EXTSCAN_THRESHOLD_PERCENT,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303273 WIFI_SCAN_DISABLED,
3274
Mukul Sharmafa937be2016-08-12 18:13:36 +05303275 WIFI_EXTSCAN_BUCKET_STARTED_EVENT = 0x10,
3276 WIFI_EXTSCAN_CYCLE_STARTED_EVENT,
3277 WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT,
Mukul Sharma45114d92016-08-12 19:34:14 +05303278};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003279
3280/**
3281 * enum extscan_configuration_flags - extscan config flags
3282 * @EXTSCAN_LP_EXTENDED_BATCHING: extended batching
3283 */
3284enum extscan_configuration_flags {
3285 EXTSCAN_LP_EXTENDED_BATCHING = 0x00000001,
3286};
3287
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003288/**
3289 * struct ext_scan_capabilities_response - extscan capabilities response data
3290 * @requestId: request identifier
3291 * @status: status
3292 * @max_scan_cache_size: total space allocated for scan (in bytes)
3293 * @max_scan_buckets: maximum number of channel buckets
3294 * @max_ap_cache_per_scan: maximum number of APs that can be stored per scan
3295 * @max_rssi_sample_size: number of RSSI samples used for averaging RSSI
3296 * @ax_scan_reporting_threshold: max possible report_threshold
3297 * @max_hotlist_bssids: maximum number of entries for hotlist APs
3298 * @max_significant_wifi_change_aps: maximum number of entries for
3299 * significant wifi change APs
3300 * @max_bssid_history_entries: number of BSSID/RSSI entries that device can hold
3301 * @max_hotlist_ssids: maximum number of entries for hotlist SSIDs
3302 * @max_number_epno_networks: max number of epno entries
3303 * @max_number_epno_networks_by_ssid: max number of epno entries
3304 * if ssid is specified, that is, epno entries for
3305 * which an exact match is required,
3306 * or entries corresponding to hidden ssids
3307 * @max_number_of_white_listed_ssid: max number of white listed SSIDs
Padma, Santhosh Kumar1ac02402016-11-02 18:04:14 +05303308 * @max_number_of_black_listed_bssid: max number of black listed BSSIDs
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003309 */
3310struct ext_scan_capabilities_response {
3311 uint32_t requestId;
3312 uint32_t status;
3313
3314 uint32_t max_scan_cache_size;
3315 uint32_t max_scan_buckets;
3316 uint32_t max_ap_cache_per_scan;
3317 uint32_t max_rssi_sample_size;
3318 uint32_t max_scan_reporting_threshold;
3319
3320 uint32_t max_hotlist_bssids;
3321 uint32_t max_significant_wifi_change_aps;
3322
3323 uint32_t max_bssid_history_entries;
3324 uint32_t max_hotlist_ssids;
3325 uint32_t max_number_epno_networks;
3326 uint32_t max_number_epno_networks_by_ssid;
3327 uint32_t max_number_of_white_listed_ssid;
Padma, Santhosh Kumar1ac02402016-11-02 18:04:14 +05303328 uint32_t max_number_of_black_listed_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003329};
3330
3331typedef struct {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003332 /* Time of discovery */
3333 uint64_t ts;
3334
3335 /* Null terminated SSID */
3336 uint8_t ssid[SIR_MAC_MAX_SSID_LENGTH + 1];
3337
Anurag Chouhan6d760662016-02-20 16:05:43 +05303338 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003339
3340 /* Frequency in MHz */
3341 uint32_t channel;
3342
3343 /* RSSI in dBm */
3344 int32_t rssi;
3345
3346 /* RTT in nanoseconds */
3347 uint32_t rtt;
3348
3349 /* Standard deviation in rtt */
3350 uint32_t rtt_sd;
3351
3352 /* Period advertised in the beacon */
3353 uint16_t beaconPeriod;
3354
3355 /* Capabilities advertised in the beacon */
3356 uint16_t capability;
3357
3358 uint16_t ieLength;
3359
3360 uint8_t ieData[];
3361} tSirWifiScanResult, *tpSirWifiScanResult;
3362
3363/**
3364 * struct extscan_hotlist_match - extscan hotlist match
3365 * @requestId: request identifier
3366 * @numOfAps: number of bssids retrieved by the scan
3367 * @moreData: 0 - for last fragment
3368 * 1 - still more fragment(s) coming
3369 * @ap: wifi scan result
3370 */
3371struct extscan_hotlist_match {
3372 uint32_t requestId;
3373 bool moreData;
3374 bool ap_found;
3375 uint32_t numOfAps;
3376 tSirWifiScanResult ap[];
3377};
3378
3379/**
3380 * struct extscan_cached_scan_result - extscan cached scan result
3381 * @scan_id: a unique identifier for the scan unit
3382 * @flags: a bitmask with additional information about scan
3383 * @num_results: number of bssids retrieved by the scan
Mukul Sharmaf7cb3ab2016-08-12 19:53:52 +05303384 * @buckets_scanned: bitmask of buckets scanned in current extscan cycle
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003385 * @ap: wifi scan bssid results info
3386 */
3387struct extscan_cached_scan_result {
3388 uint32_t scan_id;
3389 uint32_t flags;
3390 uint32_t num_results;
Mukul Sharmaf7cb3ab2016-08-12 19:53:52 +05303391 uint32_t buckets_scanned;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003392 tSirWifiScanResult *ap;
3393};
3394
3395/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003396 * struct extscan_cached_scan_results - extscan cached scan results
3397 * @request_id: request identifier
3398 * @more_data: 0 - for last fragment
3399 * 1 - still more fragment(s) coming
3400 * @num_scan_ids: number of scan ids
3401 * @result: wifi scan result
3402 */
3403struct extscan_cached_scan_results {
3404 uint32_t request_id;
3405 bool more_data;
3406 uint32_t num_scan_ids;
3407 struct extscan_cached_scan_result *result;
3408};
3409
3410
3411/**
3412 * struct tSirWifiFullScanResultEvent - extscan full scan event
3413 * @request_id: request identifier
3414 * @moreData: 0 - for last fragment
3415 * 1 - still more fragment(s) coming
3416 * @ap: bssid info
3417 *
Jeff Johnsondab58602018-07-14 15:30:24 -07003418 * Reported when each probe response is received, if report_events
3419 * enabled in struct wifi_scan_cmd_req_params
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003420 */
3421typedef struct {
3422 uint32_t requestId;
3423 bool moreData;
3424 tSirWifiScanResult ap;
3425} tSirWifiFullScanResultEvent, *tpSirWifiFullScanResultEvent;
3426
3427/**
3428 * struct pno_match_found - epno match found
3429 * @request_id: request identifier
3430 * @moreData: 0 - for last fragment
3431 * 1 - still more fragment(s) coming
3432 * @num_results: number of bssids, driver sends this event to upper layer
3433 * for every beacon, hence %num_results is always set to 1.
3434 * @ap: bssid info
3435 *
3436 * Reported when each beacon probe response is received with
3437 * epno match found tag.
3438 */
3439struct pno_match_found {
3440 uint32_t request_id;
3441 bool more_data;
3442 uint32_t num_results;
3443 tSirWifiScanResult ap[];
3444};
3445
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003446/**
3447 * struct sir_extscan_generic_response -
3448 * Generic ExtScan Response structure
3449 * @request_id: ID of the request
3450 * @status: operation status returned by firmware
3451 */
3452struct sir_extscan_generic_response {
3453 uint32_t request_id;
3454 uint32_t status;
3455};
3456
3457typedef struct {
Anurag Chouhan6d760662016-02-20 16:05:43 +05303458 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003459 uint32_t channel;
3460 uint32_t numOfRssi;
3461
3462 /* Rssi history in db */
3463 int32_t rssi[];
3464} tSirWifiSignificantChange, *tpSirWifiSignificantChange;
3465
3466typedef struct {
3467 uint32_t requestId;
3468
3469 bool moreData;
3470 uint32_t numResults;
3471 tSirWifiSignificantChange ap[];
3472} tSirWifiSignificantChangeEvent, *tpSirWifiSignificantChangeEvent;
3473
3474typedef struct {
3475 uint32_t requestId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003476 uint32_t numResultsAvailable;
3477} tSirExtScanResultsAvailableIndParams, *tpSirExtScanResultsAvailableIndParams;
3478
3479typedef struct {
3480 uint32_t requestId;
3481 uint32_t status;
3482 uint8_t scanEventType;
Mukul Sharmafa937be2016-08-12 18:13:36 +05303483 uint32_t buckets_scanned;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003484} tSirExtScanOnScanEventIndParams, *tpSirExtScanOnScanEventIndParams;
3485
Mukul Sharmae8c919f2016-10-02 20:35:15 +05303486#define MAX_EPNO_NETWORKS 64
3487
Jeff Johnson96f93a32016-11-18 11:02:24 -08003488#define SIR_PASSPOINT_LIST_MAX_NETWORKS 8
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003489
3490/**
3491 * struct wifi_passpoint_match - wifi passpoint network match
3492 * @id: network block identifier for the matched network
3493 * @anqp_len: length of ANQP blob
3494 * @ap: scan result, with channel and beacon information
3495 * @anqp: ANQP data, in the information_element format
3496 */
3497struct wifi_passpoint_match {
3498 uint32_t request_id;
3499 uint32_t id;
3500 uint32_t anqp_len;
3501 tSirWifiScanResult ap;
3502 uint8_t anqp[];
3503};
3504#endif /* FEATURE_WLAN_EXTSCAN */
3505
3506#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
3507typedef struct {
3508 uint32_t timer_val;
3509} tSirAutoShutdownCmdParams;
3510
3511typedef struct {
3512 uint32_t shutdown_reason;
3513} tSirAutoShutdownEvtParams;
3514#endif
3515
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05303516#ifdef WLAN_POWER_DEBUGFS
3517/**
3518 * struct power_stats_response - Power stats response
3519 * @cumulative_sleep_time_ms: cumulative sleep time in ms
3520 * @cumulative_total_on_time_ms: total awake time in ms
3521 * @deep_sleep_enter_counter: deep sleep enter counter
3522 * @last_deep_sleep_enter_tstamp_ms: last deep sleep enter timestamp
3523 * @debug_register_fmt: debug registers format
3524 * @num_debug_register: number of debug registers
3525 * @debug_registers: Pointer to the debug registers buffer
3526 */
3527struct power_stats_response {
3528 uint32_t cumulative_sleep_time_ms;
3529 uint32_t cumulative_total_on_time_ms;
3530 uint32_t deep_sleep_enter_counter;
3531 uint32_t last_deep_sleep_enter_tstamp_ms;
3532 uint32_t debug_register_fmt;
3533 uint32_t num_debug_register;
3534 uint32_t *debug_registers;
3535};
3536#endif
3537
Arunk Khandavallica56d4b2018-11-29 15:46:00 +05303538#ifdef WLAN_FEATURE_BEACON_RECEPTION_STATS
3539#define MAX_BCNMISS_BITMAP 8
3540/**
3541 * struct bcn_reception_stats_rsp - beacon stats response
3542 * @total_bcn_cnt: total beacon count (tbtt instances)
3543 * @total_bmiss_cnt: Total beacon miss count in last 255 beacons, max 255
3544 * @bmiss_bitmap: This bitmap indicates the status of the last 255 beacons.
3545 * If a bit is set, that means the corresponding beacon was missed.
3546 * Bit 0 of bmiss_bitmap[0] represents the most recent beacon.
3547 * The total_bcn_cnt field indicates how many bits within bmiss_bitmap
3548 * are valid.
3549 */
3550struct bcn_reception_stats_rsp {
3551 uint32_t vdev_id;
3552 uint32_t total_bcn_cnt;
3553 uint32_t total_bmiss_cnt;
3554 uint32_t bmiss_bitmap[MAX_BCNMISS_BITMAP];
3555};
3556#endif
3557
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +05303558/**
3559 * struct lfr_firmware_status - LFR status in firmware
3560 * @is_disabled: Is LFR disabled in FW
3561 * @disable_lfr_event: Disable attempt done in FW
3562 */
3563struct lfr_firmware_status {
3564 uint32_t is_disabled;
3565 struct completion disable_lfr_event;
3566};
3567
3568/**
3569 * struct rso_cmd_status - RSO Command status
3570 * @vdev_id: Vdev ID for which RSO command sent
3571 * @status: Status of RSO command sent to FW
3572 */
3573struct rso_cmd_status {
3574 uint32_t vdev_id;
3575 bool status;
3576};
3577
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003578enum {
3579 SIR_AP_RX_DATA_OFFLOAD = 0x00,
3580 SIR_STA_RX_DATA_OFFLOAD = 0x01,
3581};
3582
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07003583/**
Naveen Rawata410c5a2016-09-19 14:22:33 -07003584 * struct sir_set_vdev_ies_per_band
3585 * @msg_type: message type
3586 * @len: message length
3587 * @vdev_id: vdev id
3588 *
3589 * Message wrapper structure for eWNI_SME_SET_VDEV_IES_PER_BAND.
3590 */
3591struct sir_set_vdev_ies_per_band {
3592 uint16_t msg_type;
3593 uint16_t len;
3594 uint32_t vdev_id;
3595};
3596
3597/**
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07003598 * struct sir_set_ht_vht_cfg - ht, vht IE config
3599 * @msg_type: message type
3600 * @len: message length
3601 * @pdev_id: pdev id
3602 * @nss: Nss value
3603 * @dot11mode: Dot11 mode.
3604 *
3605 * Message wrapper structure for set HT/VHT IE req.
3606 */
3607struct sir_set_ht_vht_cfg {
3608 uint16_t msg_type;
3609 uint16_t len;
3610 uint32_t pdev_id;
3611 uint32_t nss;
3612 uint32_t dot11mode;
3613};
3614
Qiwei Cai3719efe2018-06-11 21:09:29 +08003615#define WIFI_INVALID_PEER_ID (-1)
3616#define WIFI_INVALID_VDEV_ID (-1)
3617#define WIFI_MAX_AC (4)
3618
3619typedef struct {
3620 uint32_t paramId;
3621 uint8_t ifaceId;
3622 uint32_t rspId;
3623 uint32_t moreResultToFollow;
3624 uint32_t nr_received;
3625 union {
3626 uint32_t num_peers;
3627 uint32_t num_radio;
3628 };
3629
3630 uint32_t peer_event_number;
3631 /* Variable length field - Do not add anything after this */
3632 uint8_t results[0];
3633} tSirLLStatsResults, *tpSirLLStatsResults;
3634
3635#ifdef WLAN_FEATURE_LINK_LAYER_STATS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003636/*---------------------------------------------------------------------------
3637 WLAN_HAL_LL_NOTIFY_STATS
3638 ---------------------------------------------------------------------------*/
3639
3640/******************************LINK LAYER Statistics**********************/
3641
3642typedef int tSirWifiRadio;
3643typedef int tSirWifiChannel;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003644
Qiwei Cai3719efe2018-06-11 21:09:29 +08003645typedef struct {
3646 uint32_t reqId;
3647 uint8_t staId;
3648 uint32_t mpduSizeThreshold;
3649 uint32_t aggressiveStatisticsGathering;
3650} tSirLLStatsSetReq, *tpSirLLStatsSetReq;
3651
3652typedef struct {
3653 uint32_t reqId;
3654 uint8_t staId;
3655 uint32_t paramIdMask;
3656} tSirLLStatsGetReq, *tpSirLLStatsGetReq;
3657
3658typedef struct {
3659 uint32_t reqId;
3660 uint8_t staId;
3661 uint32_t statsClearReqMask;
3662 uint8_t stopReq;
3663} tSirLLStatsClearReq, *tpSirLLStatsClearReq;
3664
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003665/* channel operating width */
3666typedef enum {
3667 WIFI_CHAN_WIDTH_20 = 0,
3668 WIFI_CHAN_WIDTH_40 = 1,
3669 WIFI_CHAN_WIDTH_80 = 2,
3670 WIFI_CHAN_WIDTH_160 = 3,
3671 WIFI_CHAN_WIDTH_80P80 = 4,
3672 WIFI_CHAN_WIDTH_5 = 5,
3673 WIFI_CHAN_WIDTH_10 = 6,
3674} tSirWifiChannelWidth;
3675
3676typedef enum {
3677 WIFI_DISCONNECTED = 0,
3678 WIFI_AUTHENTICATING = 1,
3679 WIFI_ASSOCIATING = 2,
3680 WIFI_ASSOCIATED = 3,
3681 WIFI_EAPOL_STARTED = 4, /* if done by firmware/driver */
3682 WIFI_EAPOL_COMPLETED = 5, /* if done by firmware/driver */
3683} tSirWifiConnectionState;
3684
3685typedef enum {
3686 WIFI_ROAMING_IDLE = 0,
3687 WIFI_ROAMING_ACTIVE = 1,
3688} tSirWifiRoamState;
3689
3690typedef enum {
3691 WIFI_INTERFACE_STA = 0,
3692 WIFI_INTERFACE_SOFTAP = 1,
3693 WIFI_INTERFACE_IBSS = 2,
3694 WIFI_INTERFACE_P2P_CLIENT = 3,
3695 WIFI_INTERFACE_P2P_GO = 4,
3696 WIFI_INTERFACE_NAN = 5,
3697 WIFI_INTERFACE_MESH = 6,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -07003698 WIFI_INTERFACE_NDI = 7,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003699} tSirWifiInterfaceMode;
3700
3701/* set for QOS association */
3702#define WIFI_CAPABILITY_QOS 0x00000001
3703/* set for protected assoc (802.11 beacon frame control protected bit set) */
3704#define WIFI_CAPABILITY_PROTECTED 0x00000002
3705/* set if 802.11 Extended Capabilities element interworking bit is set */
3706#define WIFI_CAPABILITY_INTERWORKING 0x00000004
3707/* set for HS20 association */
3708#define WIFI_CAPABILITY_HS20 0x00000008
3709/* set is 802.11 Extended Capabilities element UTF-8 SSID bit is set */
3710#define WIFI_CAPABILITY_SSID_UTF8 0x00000010
3711/* set is 802.11 Country Element is present */
3712#define WIFI_CAPABILITY_COUNTRY 0x00000020
3713
3714typedef struct {
3715 /* tSirWifiInterfaceMode */
3716 /* interface mode */
3717 uint8_t mode;
3718 /* interface mac address (self) */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303719 struct qdf_mac_addr macAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003720 /* tSirWifiConnectionState */
3721 /* connection state (valid for STA, CLI only) */
3722 uint8_t state;
3723 /* tSirWifiRoamState */
3724 /* roaming state */
3725 uint32_t roaming;
3726 /* WIFI_CAPABILITY_XXX (self) */
3727 uint32_t capabilities;
3728 /* null terminated SSID */
3729 uint8_t ssid[33];
3730 /* bssid */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303731 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003732 /* country string advertised by AP */
Wu Gaoaa155142019-01-14 15:09:26 +08003733 uint8_t apCountryStr[CFG_COUNTRY_CODE_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003734 /* country string for this association */
Wu Gaoaa155142019-01-14 15:09:26 +08003735 uint8_t countryStr[CFG_COUNTRY_CODE_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003736} tSirWifiInterfaceInfo, *tpSirWifiInterfaceInfo;
3737
3738/* channel information */
3739typedef struct {
3740 /* channel width (20, 40, 80, 80+80, 160) */
3741 tSirWifiChannelWidth width;
3742 /* primary 20 MHz channel */
3743 tSirWifiChannel centerFreq;
3744 /* center frequency (MHz) first segment */
3745 tSirWifiChannel centerFreq0;
3746 /* center frequency (MHz) second segment */
3747 tSirWifiChannel centerFreq1;
3748} tSirWifiChannelInfo, *tpSirWifiChannelInfo;
3749
3750/* wifi rate info */
3751typedef struct {
3752 /* 0: OFDM, 1:CCK, 2:HT 3:VHT 4..7 reserved */
3753 uint32_t preamble:3;
3754 /* 0:1x1, 1:2x2, 3:3x3, 4:4x4 */
3755 uint32_t nss:2;
3756 /* 0:20MHz, 1:40Mhz, 2:80Mhz, 3:160Mhz */
3757 uint32_t bw:3;
3758 /* OFDM/CCK rate code would be as per ieee std in units of 0.5mbps */
3759 /* HT/VHT it would be mcs index */
3760 uint32_t rateMcsIdx:8;
3761 /* reserved */
3762 uint32_t reserved:16;
3763 /* units of 100 Kbps */
3764 uint32_t bitrate;
3765} tSirWifiRate, *tpSirWifiRate;
3766
3767/* channel statistics */
3768typedef struct {
3769 /* channel */
3770 tSirWifiChannelInfo channel;
3771 /* msecs the radio is awake (32 bits number accruing over time) */
3772 uint32_t onTime;
3773 /* msecs the CCA register is busy (32 bits number accruing over time) */
3774 uint32_t ccaBusyTime;
3775} tSirWifiChannelStats, *tpSirWifiChannelStats;
3776
Srinivas Girigowda458f2282016-10-25 11:27:52 -07003777#define MAX_TPC_LEVELS 64
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003778/* radio statistics */
3779typedef struct {
3780 /* wifi radio (if multiple radio supported) */
3781 tSirWifiRadio radio;
3782 /* msecs the radio is awake (32 bits number accruing over time) */
3783 uint32_t onTime;
3784 /* msecs the radio is transmitting
3785 * (32 bits number accruing over time)
3786 */
3787 uint32_t txTime;
3788 /* msecs the radio is in active receive
3789 *(32 bits number accruing over time)
3790 */
3791 uint32_t rxTime;
3792 /* msecs the radio is awake due to all scan
3793 * (32 bits number accruing over time)
3794 */
3795 uint32_t onTimeScan;
3796 /* msecs the radio is awake due to NAN
3797 * (32 bits number accruing over time)
3798 */
3799 uint32_t onTimeNbd;
3800 /* msecs the radio is awake due to Gscan
3801 * (32 bits number accruing over time)
3802 */
3803 uint32_t onTimeGscan;
3804 /* msecs the radio is awake due to roam?scan
3805 * (32 bits number accruing over time)
3806 */
3807 uint32_t onTimeRoamScan;
3808 /* msecs the radio is awake due to PNO scan
3809 * (32 bits number accruing over time)
3810 */
3811 uint32_t onTimePnoScan;
3812 /* msecs the radio is awake due to HS2.0 scans and GAS exchange
3813 * (32 bits number accruing over time)
3814 */
3815 uint32_t onTimeHs20;
Srinivas Girigowdaad874a82016-10-25 14:08:00 -07003816
3817 /* tx time (in milliseconds) per TPC level (0.5 dBm) */
3818 uint32_t total_num_tx_power_levels;
3819 uint32_t *tx_time_per_power_level;
3820
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003821 /* number of channels */
3822 uint32_t numChannels;
Srinivas Girigowda458f2282016-10-25 11:27:52 -07003823
3824 /* tx time (in milliseconds) per TPC level (0.5 dBm) */
3825 uint32_t tx_time_per_tpc[MAX_TPC_LEVELS];
3826
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08003827 uint32_t on_time_host_scan;
3828 uint32_t on_time_lpi_scan;
3829
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003830 /* channel statistics tSirWifiChannelStats */
Srinivas Girigowda57b450e2016-10-27 21:00:46 -07003831 tSirWifiChannelStats *channels;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003832} tSirWifiRadioStat, *tpSirWifiRadioStat;
3833
3834/* per rate statistics */
3835typedef struct {
3836 /* rate information */
3837 tSirWifiRate rate;
3838 /* number of successfully transmitted data pkts (ACK rcvd) */
3839 uint32_t txMpdu;
3840 /* number of received data pkts */
3841 uint32_t rxMpdu;
3842 /* number of data packet losses (no ACK) */
3843 uint32_t mpduLost;
3844 /* total number of data pkt retries * */
3845 uint32_t retries;
3846 /* number of short data pkt retries */
3847 uint32_t retriesShort;
3848 /* number of long data pkt retries */
3849 uint32_t retriesLong;
3850} tSirWifiRateStat, *tpSirWifiRateStat;
3851
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003852/* wifi peer type */
3853typedef enum {
3854 WIFI_PEER_STA,
3855 WIFI_PEER_AP,
3856 WIFI_PEER_P2P_GO,
3857 WIFI_PEER_P2P_CLIENT,
3858 WIFI_PEER_NAN,
3859 WIFI_PEER_TDLS,
3860 WIFI_PEER_INVALID,
3861} tSirWifiPeerType;
3862
3863/* per peer statistics */
3864typedef struct {
3865 /* peer type (AP, TDLS, GO etc.) */
Dustin Brown877a5a92016-11-17 13:56:52 -08003866 enum wmi_peer_type type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003867 /* mac address */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303868 struct qdf_mac_addr peerMacAddress;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003869 /* peer WIFI_CAPABILITY_XXX */
3870 uint32_t capabilities;
Zhang Qiana6e9c102016-12-22 16:47:24 +08003871 union {
3872 /* peer power saving mode */
3873 uint32_t power_saving;
3874 /* number of rates */
3875 uint32_t numRate;
3876 };
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003877 /* per rate statistics, number of entries = num_rate */
3878 tSirWifiRateStat rateStats[0];
3879} tSirWifiPeerInfo, *tpSirWifiPeerInfo;
3880
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003881/* Interface statistics - corresponding to 2nd most
3882 * LSB in wifi statistics bitmap for getting statistics
3883 */
3884typedef struct {
3885 /* current state of the interface */
3886 tSirWifiInterfaceInfo info;
Min Liuffb250d2018-07-11 17:35:32 +08003887
gaolezb432ed92017-03-16 18:40:04 +08003888 uint32_t rts_succ_cnt;
3889 uint32_t rts_fail_cnt;
3890 uint32_t ppdu_succ_cnt;
3891 uint32_t ppdu_fail_cnt;
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08003892
Min Liuffb250d2018-07-11 17:35:32 +08003893 /* link statistics */
3894 wmi_iface_link_stats link_stats;
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08003895
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003896 /* per ac data packet statistics */
Min Liuffb250d2018-07-11 17:35:32 +08003897 wmi_wmm_ac_stats ac_stats[WIFI_AC_MAX];
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08003898
3899 uint32_t num_offload_stats;
Min Liuffb250d2018-07-11 17:35:32 +08003900 wmi_iface_offload_stats offload_stats[WMI_OFFLOAD_STATS_TYPE_MAX];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003901} tSirWifiIfaceStat, *tpSirWifiIfaceStat;
3902
3903/* Peer statistics - corresponding to 3rd most LSB in
3904 * wifi statistics bitmap for getting statistics
3905 */
3906typedef struct {
3907 /* number of peers */
3908 uint32_t numPeers;
3909 /* per peer statistics */
3910 tSirWifiPeerInfo peerInfo[0];
3911} tSirWifiPeerStat, *tpSirWifiPeerStat;
3912
3913/* wifi statistics bitmap for getting statistics */
3914#define WMI_LINK_STATS_RADIO 0x00000001
3915#define WMI_LINK_STATS_IFACE 0x00000002
3916#define WMI_LINK_STATS_ALL_PEER 0x00000004
3917#define WMI_LINK_STATS_PER_PEER 0x00000008
3918
3919/* wifi statistics bitmap for clearing statistics */
3920/* all radio statistics */
3921#define WIFI_STATS_RADIO 0x00000001
3922/* cca_busy_time (within radio statistics) */
3923#define WIFI_STATS_RADIO_CCA 0x00000002
3924/* all channel statistics (within radio statistics) */
3925#define WIFI_STATS_RADIO_CHANNELS 0x00000004
3926/* all scan statistics (within radio statistics) */
3927#define WIFI_STATS_RADIO_SCAN 0x00000008
3928/* all interface statistics */
3929#define WIFI_STATS_IFACE 0x00000010
3930/* all tx rate statistics (within interface statistics) */
3931#define WIFI_STATS_IFACE_TXRATE 0x00000020
3932/* all ac statistics (within interface statistics) */
3933#define WIFI_STATS_IFACE_AC 0x00000040
3934/* all contention (min, max, avg) statistics (within ac statistics) */
3935#define WIFI_STATS_IFACE_CONTENTION 0x00000080
Mukul Sharma491021c2016-09-29 21:39:19 +05303936/* All peer stats on this interface */
3937#define WIFI_STATS_IFACE_ALL_PEER 0x00000100
3938/* Clear particular peer stats depending on the peer_mac */
3939#define WIFI_STATS_IFACE_PER_PEER 0x00000200
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003940
Zhang Qiana6e9c102016-12-22 16:47:24 +08003941/**
3942 * struct sir_wifi_iface_tx_fail - TX failure event
3943 * @tid: TX TID
3944 * @msdu_num: TX MSDU failed counter
3945 * @status: TX status from HTT message.
3946 * Only failure status will be involved.
3947 */
3948struct sir_wifi_iface_tx_fail {
3949 uint8_t tid;
3950 uint16_t msdu_num;
3951 enum htt_tx_status status;
3952};
3953
Zhang Qian73c348a2017-03-13 16:15:55 +08003954/**
3955 * struct sir_wifi_chan_cca_stats - channal CCA stats
3956 * @vdev_id: vdev ID
3957 * @idle_time: percentage of idle time, no TX, no RX, no interference
3958 * @tx_time: percentage of time transmitting packets
3959 * @rx_in_bss_time: percentage of time receiving packets in current BSS
3960 * @rx_out_bss_time: percentage of time receiving packets not in current BSS
3961 * @rx_busy_time: percentage of time interference detected
3962 * @rx_in_bad_cond_time: percentage of time receiving packets with errors
3963 * or packets flagged as retransmission or seqnum discontinued.
3964 * @tx_in_bad_cond_time: percentage of time the device transmitted packets
3965 * that haven't been ACKed.
3966 * @wlan_not_avail_time: percentage of time the chip is unable to
3967 * work in normal conditions.
3968 */
3969struct sir_wifi_chan_cca_stats {
3970 uint32_t vdev_id;
3971 uint32_t idle_time;
3972 uint32_t tx_time;
3973 uint32_t rx_in_bss_time;
3974 uint32_t rx_out_bss_time;
3975 uint32_t rx_busy_time;
3976 uint32_t rx_in_bad_cond_time;
3977 uint32_t tx_in_bad_cond_time;
3978 uint32_t wlan_not_avail_time;
3979};
3980
3981#define WIFI_MAX_CHAINS 8
3982
3983/**
3984 * struct sir_wifi_peer_signal_stats - peer signal stats
3985 * @vdev_id: vdev ID
3986 * @peer_id: peer ID
3987 * @per_ant_snr: per antenna SNR
3988 * @nf: peer background noise
Zhang Qian303ebe92017-05-18 13:59:07 +08003989 * @per_ant_rx_mpdus: MPDUs received per antenna
3990 * @per_ant_tx_mpdus: MPDUs transferred per antenna
3991 * @num_chain: valid chain count
Zhang Qian73c348a2017-03-13 16:15:55 +08003992 */
3993struct sir_wifi_peer_signal_stats {
3994 uint32_t vdev_id;
3995 uint32_t peer_id;
3996
3997 /* per antenna SNR in current bss */
3998 int32_t per_ant_snr[WIFI_MAX_CHAINS];
3999
4000 /* Background noise */
4001 int32_t nf[WIFI_MAX_CHAINS];
Zhang Qian303ebe92017-05-18 13:59:07 +08004002
4003 int32_t per_ant_rx_mpdus[WIFI_MAX_CHAINS];
4004 int32_t per_ant_tx_mpdus[WIFI_MAX_CHAINS];
4005 int32_t num_chain;
Zhang Qian73c348a2017-03-13 16:15:55 +08004006};
4007
4008#define WIFI_VDEV_NUM 4
4009#define WFIF_MCS_NUM 10
4010#define WIFI_AGGR_NUM 8
4011#define WIFI_DELAY_SIZE 11
4012
4013/**
4014 * struct sir_wifi_tx - per AC tx stats
4015 * @msdus: number of totoal MSDUs on MAC layer in the period
4016 * @mpdus: number of totoal MPDUs on MAC layer in the period
4017 * @ppdus: number of totoal PPDUs on PHY layer in the period
4018 * @bytes: bytes of tx data on MAC layer in the period
4019 * @drops: number of TX packets cancelled due to any reason in the period,
4020 * such as WMM limitation/bandwidth limitation/radio congestion
4021 * @drop_bytes: bytes of dropped TX packets in the period
4022 * @retries: number of unacked transmissions of MPDUs
4023 * @failed: number of packets have not been ACKed despite retried
4024 * @aggr_len: length of the MPDU aggregation size buffer
4025 * @mpdu_aggr_size: histogram of MPDU aggregation size
4026 * @success_mcs_len: length of success mcs buffer
4027 * @success_mcs: histogram of successed received MPDUs encoding rate
4028 * @fail_mcs_len: length of failed mcs buffer
4029 * @fail_mcs: histogram of failed received MPDUs encoding rate
4030 * @delay_len: length of the delay histofram buffer
4031 * @delay: histogram of delays on MAC layer
4032 */
4033struct sir_wifi_tx {
4034 uint32_t msdus;
4035 uint32_t mpdus;
4036 uint32_t ppdus;
4037 uint32_t bytes;
4038 uint32_t drops;
4039 uint32_t drop_bytes;
4040 uint32_t retries;
4041 uint32_t failed;
4042 uint32_t aggr_len;
4043 uint32_t *mpdu_aggr_size;
4044 uint32_t success_mcs_len;
4045 uint32_t *success_mcs;
4046 uint32_t fail_mcs_len;
4047 uint32_t *fail_mcs;
4048 uint32_t delay_len;
4049 uint32_t *delay;
4050};
4051
4052/**
4053 * struct sir_wifi_rx - per AC rx stats
4054 * @mpdus: number of RX packets on MAC layer
4055 * @bytes: bytes of RX packets on MAC layer
4056 * @ppdus: number of RX packets on PHY layer
4057 * @ppdu_bytes: bytes of RX packets on PHY layer
4058 * @mpdu_lost: number of discontinuity in seqnum
4059 * @mpdu_retry: number of RX packets flagged as retransmissions
4060 * @mpdu_dup: number of RX packets identified as duplicates
4061 * @mpdu_discard: number of RX packets discarded
4062 * @aggr_len: length of MPDU aggregation histogram buffer
4063 * @mpdu_aggr: histogram of MPDU aggregation size
4064 * @mcs_len: length of mcs histogram buffer
4065 * @mcs: histogram of encoding rate.
4066 */
4067struct sir_wifi_rx {
4068 uint32_t mpdus;
4069 uint32_t bytes;
4070 uint32_t ppdus;
4071 uint32_t ppdu_bytes;
4072 uint32_t mpdu_lost;
4073 uint32_t mpdu_retry;
4074 uint32_t mpdu_dup;
4075 uint32_t mpdu_discard;
4076 uint32_t aggr_len;
4077 uint32_t *mpdu_aggr;
4078 uint32_t mcs_len;
4079 uint32_t *mcs;
4080};
4081
4082/**
4083 * struct sir_wifi_ll_ext_wmm_ac_stats - stats for WMM AC
4084 * @type: WMM AC type
4085 * @tx_stats: pointer to TX stats
4086 * @rx_stats: pointer to RX stats
4087 */
4088struct sir_wifi_ll_ext_wmm_ac_stats {
4089 uint32_t type;
4090 struct sir_wifi_tx *tx_stats;
4091 struct sir_wifi_rx *rx_stats;
4092};
4093
Zhang Qian73c348a2017-03-13 16:15:55 +08004094/**
4095 * struct sir_wifi_ll_ext_peer_stats - per peer stats
4096 * @peer_id: peer ID
4097 * @vdev_id: VDEV ID
4098 * mac_address: MAC address
4099 * @sta_ps_inds: how many times STAs go to sleep
4100 * @sta_ps_durs: total sleep time of STAs (units in ms)
4101 * @rx_probe_reqs: number of probe requests received
4102 * @rx_oth_mgmts: number of other management frames received,
4103 * not including probe requests
4104 * @peer_signal_stat: signal stats
4105 * @ac_stats: WMM BE/BK/VI/VO stats
4106 */
4107struct sir_wifi_ll_ext_peer_stats {
4108 uint32_t peer_id;
4109 uint32_t vdev_id;
4110 tSirMacAddr mac_address;
4111 uint32_t sta_ps_inds;
4112 uint32_t sta_ps_durs;
4113 uint32_t rx_probe_reqs;
4114 uint32_t rx_oth_mgmts;
4115 struct sir_wifi_peer_signal_stats peer_signal_stats;
4116 struct sir_wifi_ll_ext_wmm_ac_stats ac_stats[WIFI_MAX_AC];
4117};
4118
4119/**
4120 * struct sir_wifi_ll_ext_stats - link layer stats report
4121 * @trigger_cond_id: Indicate what triggered this event.
4122 * 1: timeout. 2: threshold
4123 * @cca_chgd_bitmap: Bitmap to indicate changed channel CCA stats
4124 * which exceeded the thresholds
4125 * @sig_chgd_bitmap: Bitmap to indicate changed peer signal stats
4126 * which exceeded the thresholds
4127 * @tx_chgd_bitmap: Bitmap to indicate changed TX counters
4128 * which exceeded the thresholds
4129 * @rx_chgd_bitmap: Bitmap to indicate changed RX counters
4130 * which exceeded the thresholds
4131 * @chan_cca_stats: channel CCA stats
4132 * @peer_signal_stats: peer signal stats
4133 * @tx_mpdu_aggr_array_len: length of TX MPDU aggregation buffer
4134 * @tx_succ_mcs_array_len: length of mcs buffer for ACKed MPDUs
4135 * @tx_fail_mcs_array_len: length of mcs buffer for no-ACKed MPDUs
4136 * @tx_delay_array_len: length of delay stats buffer
4137 * @rx_mpdu_aggr_array_len: length of RX MPDU aggregation buffer
4138 * @rx_mcs_array_len: length of RX mcs stats buffer
4139 * @peer_stats: peer stats
4140 * @cca: physical channel CCA stats
4141 * @stats: pointer to stats data buffer.
4142 *
4143 * Structure of the whole statictics is like this:
4144 * ---------------------------------
4145 * | trigger_cond_i |
4146 * +-------------------------------+
4147 * | cca_chgd_bitmap |
4148 * +-------------------------------+
4149 * | sig_chgd_bitmap |
4150 * +-------------------------------+
4151 * | tx_chgd_bitmap |
4152 * +-------------------------------+
4153 * | rx_chgd_bitmap |
4154 * +-------------------------------+
4155 * | peer_num |
4156 * +-------------------------------+
4157 * | channel_num |
4158 * +-------------------------------+
4159 * | tx_mpdu_aggr_array_len |
4160 * +-------------------------------+
4161 * | tx_succ_mcs_array_len |
4162 * +-------------------------------+
4163 * | tx_fail_mcs_array_len |
4164 * +-------------------------------+
4165 * | tx_delay_array_len |
4166 * +-------------------------------+
4167 * | rx_mpdu_aggr_array_len |
4168 * +-------------------------------+
4169 * | rx_mcs_array_len |
4170 * +-------------------------------+
4171 * | pointer to CCA stats |
4172 * +-------------------------------+
4173 * | pointer to peer stats |
4174 * +-------------------------------+
4175 * | CCA stats |
4176 * +-------------------------------+
4177 * | peer_stats |----+
4178 * +-------------------------------+ |
4179 * | per peer signals stats |<---+
4180 * | peer0 ~ peern | |
4181 * +-------------------------------+ |
4182 * | TX aggr/mcs parameters array | |
4183 * | Length of this buffer is | |
4184 * | configurable for user layer. |<-+ |
4185 * +-------------------------------+ | |
4186 * | per peer tx stats |--+ |
4187 * | BE | <--+
4188 * | BK | |
4189 * | VI | |
4190 * | VO | |
4191 * +-------------------------------+ |
4192 * | TX aggr/mcs parameters array | |
4193 * | Length of this buffer is | |
4194 * | configurable for user layer. |<-+ |
4195 * +-------------------------------+ | |
4196 * | peer peer rx stats |--+ |
4197 * | BE | <--+
4198 * | BE |
4199 * | BK |
4200 * | VI |
4201 * | VO |
4202 * ---------------------------------
4203 */
4204struct sir_wifi_ll_ext_stats {
4205 uint32_t trigger_cond_id;
4206 uint32_t cca_chgd_bitmap;
4207 uint32_t sig_chgd_bitmap;
4208 uint32_t tx_chgd_bitmap;
4209 uint32_t rx_chgd_bitmap;
4210 uint8_t peer_num;
4211 uint8_t channel_num;
4212 uint32_t tx_mpdu_aggr_array_len;
4213 uint32_t tx_succ_mcs_array_len;
4214 uint32_t tx_fail_mcs_array_len;
4215 uint32_t tx_delay_array_len;
4216 uint32_t rx_mpdu_aggr_array_len;
4217 uint32_t rx_mcs_array_len;
4218 struct sir_wifi_ll_ext_peer_stats *peer_stats;
4219 struct sir_wifi_chan_cca_stats *cca;
4220 uint8_t stats[];
4221};
4222
4223/**
4224 * struct sir_channel_cca_threshold - threshold for channel CCA
4225 * @idle_time: idle time, no TX, no RX, no interference
4226 * @tx_time: time transmitting packets
4227 * @rx_in_bss_time: time receiving packets in current BSSs
4228 * @rx_out_bss_time: time receiving packets not in current BSSs
4229 * @rx_busy_time: time interference detected
4230 * @rx_in_bad_cond_time: receiving packets with errors
4231 * @tx_in_bad_cond_time: time transmitted packets not been ACKed
4232 * @wlan_not_avail_time: wlan card cannot work
4233 */
4234struct sir_channel_cca_threshold {
4235 uint32_t idle_time;
4236 uint32_t tx_time;
4237 uint32_t rx_in_bss_time;
4238 uint32_t rx_out_bss_time;
4239 uint32_t rx_busy_time;
4240 uint32_t rx_in_bad_cond_time;
4241 uint32_t tx_in_bad_cond_time;
4242 uint32_t wlan_not_avail_time;
4243};
4244
4245/**
4246 * struct sir_signal_threshold - threshold for per peer sigbal
4247 * @snr: signal to noise rate
4248 * @nf: noise floor
4249 */
4250struct sir_signal_threshold {
4251 uint32_t snr;
4252 uint32_t nf;
4253};
4254
4255/**
4256 * struct sir_tx_threshold - threshold for TX
4257 * @msdu: TX MSDUs on MAC layer
4258 * @mpdu: TX MPDUs on MAC layer
4259 * @ppdu: TX PPDUs on MAC layer
4260 * @bytes: TX bytes on MAC layer
4261 * @msdu_drop: drooped MSDUs
4262 * @byte_drop: dropped Bytes
4263 * @mpdu_retry: MPDU not acked
4264 * @ppdu_fail: PPDUs which received no block ack
4265 * @aggregation: aggregation size
4266 * @succ_mcs: histogram of encoding rate for acked PPDUs
4267 * @fail_mcs: histogram of encoding rate for no-acked PPDUs
4268 */
4269struct sir_tx_threshold {
4270 uint32_t msdu;
4271 uint32_t mpdu;
4272 uint32_t ppdu;
4273 uint32_t bytes;
4274 uint32_t msdu_drop;
4275 uint32_t byte_drop;
4276 uint32_t mpdu_retry;
4277 uint32_t mpdu_fail;
4278 uint32_t ppdu_fail;
4279 uint32_t aggregation;
4280 uint32_t succ_mcs;
4281 uint32_t fail_mcs;
4282 uint32_t delay;
4283};
4284
4285/**
4286 * struct sir_rx_threshold - threshold for RX
4287 * @mpdu: RX MPDUs on MAC layer
4288 * @bytes: RX bytes on MAC layer
4289 * @ppdu: RX PPDU on PHY layer
4290 * @ppdu_bytes: RX bytes on PHY layer
4291 * @disorder: discontinuity in seqnum
4292 * @mpdu_retry: MPDUs flagged as retry
4293 * @mpdu_dup: MPDUs identified as duplicated
4294 * @aggregation: aggregation size
4295 * @mcs: histogram of encoding rate for PPDUs
4296 * @ps_inds: power save indication
4297 * @ps_durs: total time in power save
4298 * @probe_reqs: probe request received
4299 * @other_mgmt: other MGMT frames received
4300 */
4301struct sir_rx_threshold {
4302 uint32_t mpdu;
4303 uint32_t bytes;
4304 uint32_t ppdu;
4305 uint32_t ppdu_bytes;
4306 uint32_t disorder;
4307 uint32_t mpdu_lost;
4308 uint32_t mpdu_retry;
4309 uint32_t mpdu_dup;
4310 uint32_t mpdu_discard;
4311 uint32_t aggregation;
4312 uint32_t mcs;
4313 uint32_t ps_inds;
4314 uint32_t ps_durs;
4315 uint32_t probe_reqs;
4316 uint32_t other_mgmt;
4317};
4318
4319/**
4320 * struct sir_wifi_ll_ext_stats_threshold - Threshold for stats update
4321 * @period: MAC counter indication period (unit in ms)
4322 * @enable: if threshold mechnism is enabled or disabled
4323 * @enable_bitmap: whether dedicated threshold is enabed.
4324 * Every MAC counter has a dedicated threshold. If the dedicated
4325 * threshold is not set in the bitmap, global threshold will take
4326 * effect.
4327 * @global: whether clobal threshold is enabled.
Jeff Johnsonf2cf6592018-05-06 16:27:44 -07004328 * When both global and dedicated threshold are disabled, MAC counter
Zhang Qian73c348a2017-03-13 16:15:55 +08004329 * will indicate stats periodically.
4330 * @global_threshold: global threshold value
4331 * @cca_bitmap: bitmap for CCA.
4332 * Bit0: idle time
4333 * Bit1: tx time
4334 * Bit2: RX in BSS
4335 * Bit3: RX out of BSS
4336 * Bit4: medium busy
4337 * Bit5: RX bad
4338 * Bit6: TX bad
4339 * Bit7: WLAN card not available
4340 * @signal_bitmap:
4341 * Bit0: Per channel SNR counter
4342 * Bit1: Per channel noise floor counter
4343 * @tx_bitmap: bitmap for TX counters
4344 * Bit0: TX counter unit in MSDU
4345 * Bit1: TX counter unit in MPDU
4346 * Bit2: TX counter unit in PPDU
4347 * Bit3: TX counter unit in byte
4348 * Bit4: Dropped MSDUs
4349 * Bit5: Dropped Bytes
4350 * Bit6: MPDU retry counter
4351 * Bit7: MPDU failure counter
4352 * Bit8: PPDU failure counter
4353 * Bit9: MPDU aggregation counter
4354 * Bit10: MCS counter for ACKed MPDUs
4355 * Bit11: MCS counter for Failed MPDUs
4356 * Bit12: TX Delay counter
4357 * @rx_bitmap:bitmap for RX counters
4358 * Bit0: MAC RX counter unit in MPDU
4359 * Bit1: MAC RX counter unit in byte
4360 * Bit2: PHY RX counter unit in PPDU
4361 * Bit3: PHY RX counter unit in byte
4362 * Bit4: Disorder counter
4363 * Bit5: Retry counter
4364 * Bit6: Duplication counter
4365 * Bit7: Discard counter
4366 * Bit8: MPDU aggregation size counter
4367 * Bit9: MCS counter
4368 * Bit10: Peer STA power state change (wake to sleep) counter
4369 * Bit11: Peer STA power save counter, total time in PS mode
4370 * Bit12: Probe request counter
4371 * Bit13: Other management frames counter
4372 * @cca_thresh: CCA threshold
4373 * @signal_thresh: signal threshold
4374 * @tx_thresh: TX threshold
4375 * @rx_thresh: RX threshold
4376 *
4377 * Generally, Link layer statistics is reported periodically. But if the
4378 * variation of one stats of compared to the pervious notification exceeds
4379 * a threshold, FW will report the new stats immediately.
4380 * This structure contains threshold for different counters.
4381 */
4382struct sir_ll_ext_stats_threshold {
4383 uint32_t period;
4384 uint32_t enable;
4385 uint32_t enable_bitmap;
4386 uint32_t global;
4387 uint32_t global_threshold;
4388 uint32_t cca_bitmap;
4389 uint32_t signal_bitmap;
4390 uint32_t tx_bitmap;
4391 uint32_t rx_bitmap;
4392 struct sir_channel_cca_threshold cca;
4393 struct sir_signal_threshold signal;
4394 struct sir_tx_threshold tx;
4395 struct sir_rx_threshold rx;
4396};
4397
4398#define LL_STATS_MIN_PERIOD 10
4399#define LL_STATS_INVALID_PERIOD 0xFFFFFFFF
4400
Zhang Qiana6e9c102016-12-22 16:47:24 +08004401/* Result ID for LL stats extension */
4402#define WMI_LL_STATS_EXT_PS_CHG 0x00000100
4403#define WMI_LL_STATS_EXT_TX_FAIL 0x00000200
4404#define WMI_LL_STATS_EXT_MAC_COUNTER 0x00000400
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004405#endif /* WLAN_FEATURE_LINK_LAYER_STATS */
4406
4407typedef struct sAniGetLinkStatus {
4408 uint16_t msgType; /* message type is same as the request type */
4409 uint16_t msgLen; /* length of the entire request */
4410 uint8_t linkStatus;
4411 uint8_t sessionId;
4412} tAniGetLinkStatus, *tpAniGetLinkStatus;
4413
4414#ifdef DHCP_SERVER_OFFLOAD
4415typedef struct {
4416 uint32_t vdev_id;
4417 uint32_t dhcpSrvOffloadEnabled;
4418 uint32_t dhcpClientNum;
4419 uint32_t dhcpSrvIP;
4420} tSirDhcpSrvOffloadInfo, *tpSirDhcpSrvOffloadInfo;
4421#endif /* DHCP_SERVER_OFFLOAD */
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05304422
4423/**
4424 * struct sir_lost_link_info - lost link information structure.
4425 *
4426 * @vdev_id: vdev_id from WMA. some modules call sessionId.
4427 * @rssi: rssi at disconnection time.
4428 *
4429 * driver uses this structure to communicate information collected at
4430 * disconnection time.
4431 */
4432struct sir_lost_link_info {
4433 uint32_t vdev_id;
4434 int32_t rssi;
4435};
4436
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004437/* find the size of given member within a structure */
4438#ifndef member_size
4439#define member_size(type, member) (sizeof(((type *)0)->member))
4440#endif
4441
4442#define RTT_INVALID 0x00
4443#define RTT_TIMING_MEAS_CAPABILITY 0x01
4444#define RTT_FINE_TIME_MEAS_INITIATOR_CAPABILITY 0x02
4445#define RTT_FINE_TIME_MEAS_RESPONDER_CAPABILITY 0x03
4446
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004447/* number of neighbor reports that we can handle in Neighbor Report Response */
4448#define MAX_SUPPORTED_NEIGHBOR_RPT 15
4449
4450/**
4451 * struct sir_stats_avg_factor
4452 * @vdev_id: session id
4453 * @stats_avg_factor: average factor
4454 */
4455struct sir_stats_avg_factor {
4456 uint8_t vdev_id;
4457 uint16_t stats_avg_factor;
4458};
4459
4460/**
4461 * struct sir_guard_time_request
4462 * @vdev_id: session id
4463 * @guard_time: guard time
4464 */
4465struct sir_guard_time_request {
4466 uint8_t vdev_id;
4467 uint32_t guard_time;
4468};
4469
4470/* Max number of rates allowed in Supported Rates IE */
4471#define MAX_NUM_SUPPORTED_RATES (8)
4472
4473/*
4474 * struct rssi_monitor_req - rssi monitoring
4475 * @request_id: request id
4476 * @session_id: session id
4477 * @min_rssi: minimum rssi
4478 * @max_rssi: maximum rssi
4479 * @control: flag to indicate start or stop
4480 */
4481struct rssi_monitor_req {
4482 uint32_t request_id;
4483 uint32_t session_id;
4484 int8_t min_rssi;
4485 int8_t max_rssi;
4486 bool control;
4487};
4488
4489/**
4490 * struct rssi_breach_event - rssi breached event structure
4491 * @request_id: request id
4492 * @session_id: session id
4493 * @curr_rssi: current rssi
4494 * @curr_bssid: current bssid
4495 */
4496struct rssi_breach_event {
4497 uint32_t request_id;
4498 uint32_t session_id;
4499 int8_t curr_rssi;
Anurag Chouhan6d760662016-02-20 16:05:43 +05304500 struct qdf_mac_addr curr_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004501};
4502
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05304503/**
4504 * struct chip_pwr_save_fail_detected_params - chip power save failure detected
4505 * event params
4506 * @failure_reason_code:failure reason code
4507 * @wake_lock_bitmap:bitmap for modules voting against sleep for long duration.
4508 */
4509struct chip_pwr_save_fail_detected_params {
4510 uint32_t failure_reason_code;
4511 uint32_t wake_lock_bitmap[4];
4512};
4513
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004514#define MAX_NUM_FW_SEGMENTS 4
4515
4516/**
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05304517 * DEFAULT_SCAN_IE_ID - Identifier for the collection of IE's added
4518 * by default to the probe request
4519 */
4520#define DEFAULT_SCAN_IE_ID 256
4521
4522 /* MAX_DEFAULT_SCAN_IE_LEN - Maxmimum length of Default Scan IE's */
Selvaraj, Sridhar021ee0a2017-04-07 16:53:31 +05304523#define MAX_DEFAULT_SCAN_IE_LEN 2048
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05304524
4525 /* Extended Capabilities IE header(IE Id + IE Length) length */
4526#define EXT_CAP_IE_HDR_LEN 2
4527
4528/**
4529 * struct hdd_default_scan_ie - HDD default scan IE structure
4530 * @message_type: message type to be set with eWNI_SME_DEFAULT_SCAN_IE
4531 * @length: length of the struct hdd_default_scan_ie
4532 * @session_id: Session Id
4533 * @ie_len: Default scan IE length
4534 * @ie_data: Pointer to default scan IE data
4535 */
4536struct hdd_default_scan_ie {
4537 uint16_t message_type;
4538 uint16_t length;
4539 uint16_t session_id;
4540 uint16_t ie_len;
4541 uint8_t ie_data[MAX_DEFAULT_SCAN_IE_LEN];
4542};
4543
4544/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004545 * struct vdev_ie_info - IE info
4546 * @vdev_id - vdev for which the IE is being sent
4547 * @ie_id - ID of the IE
4548 * @length - length of the IE data
Naveen Rawat03e8d952016-08-01 15:22:20 -07004549 * @band - indicates IE is intended for which band
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004550 * @data - IE data
4551 *
4552 * This structure is used to store the IE information.
4553 */
4554struct vdev_ie_info {
4555 uint32_t vdev_id;
4556 uint32_t ie_id;
4557 uint32_t length;
Naveen Rawat03e8d952016-08-01 15:22:20 -07004558 uint32_t band;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004559 uint8_t *data;
4560};
4561
4562/**
4563 * struct send_extcap_ie - used to pass send_extcap_ie msg from SME to PE
4564 * @type - MSG type
4565 * @length - length of the message
4566 * @seesion_id - session_id for which the message is intended for
4567 *
4568 * This structure is used to pass send_extcap_ie msg from SME to PE
4569 */
4570struct send_extcap_ie {
4571 uint16_t msg_type; /* eWNI_SME_SET_IE_REQ */
4572 uint16_t length;
4573 uint8_t session_id;
4574};
4575
Dundi Raviteja6bb9e322018-05-16 17:04:41 +05304576typedef void (*antenna_mode_cb)(uint32_t status, void *context);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004577
4578/**
Kiran Kumar Lokereee205772018-09-27 00:27:27 -07004579 * struct cfg_action_frm_tb_ppdu - action frame TB PPDU cfg
4580 * @vdev_id - vdev id
4581 * @cfg - enable/disable
4582 * @frm_len - frame length
4583 * @data - frame data
4584 *
4585 * This structure is used to cfg action frame tb ppdu.
4586 */
4587struct cfg_action_frm_tb_ppdu {
4588 uint8_t vdev_id;
4589 uint8_t cfg;
4590 uint8_t frm_len;
4591 uint8_t *data;
4592};
4593
4594/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004595 * struct sir_nss_update_request
4596 * @msgType: nss update msg type
4597 * @msgLen: length of the msg
4598 * @new_nss: new spatial stream value
4599 * @vdev_id: session id
4600 */
4601struct sir_nss_update_request {
4602 uint16_t msgType;
4603 uint16_t msgLen;
4604 uint8_t new_nss;
4605 uint32_t vdev_id;
4606};
4607
4608/**
Abhishek Singhfc740be2018-10-12 11:34:26 +05304609 * enum sir_bcn_update_reason: bcn update reason
4610 * @REASON_DEFAULT: reason default
4611 * @REASON_NSS_UPDATE: If NSS is updated
4612 * @REASON_CONFIG_UPDATE: Config update
4613 * @REASON_SET_HT2040: HT2040 update
4614 * @REASON_COLOR_CHANGE: Color change
4615 * @REASON_CHANNEL_SWITCH: channel switch
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004616 */
Abhishek Singhfc740be2018-10-12 11:34:26 +05304617enum sir_bcn_update_reason {
4618 REASON_DEFAULT = 0,
4619 REASON_NSS_UPDATE = 1,
4620 REASON_CONFIG_UPDATE = 2,
4621 REASON_SET_HT2040 = 3,
4622 REASON_COLOR_CHANGE = 4,
4623 REASON_CHANNEL_SWITCH = 5,
4624};
4625
4626/**
4627 * struct sir_bcn_update_rsp
4628 *
4629 * @vdev_id: session for which bcn was updated
4630 * @reason: bcn update reason
4631 * @status: status of the beacon sent to FW
4632 */
4633struct sir_bcn_update_rsp {
4634 uint8_t vdev_id;
4635 enum sir_bcn_update_reason reason;
4636 QDF_STATUS status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004637};
4638
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004639struct sir_qos_params {
4640 uint8_t aifsn;
4641 uint8_t cwmin;
4642 uint8_t cwmax;
4643};
4644
4645/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004646 * enum powersave_qpower_mode: QPOWER modes
4647 * @QPOWER_DISABLED: Qpower is disabled
4648 * @QPOWER_ENABLED: Qpower is enabled
4649 * @QPOWER_DUTY_CYCLING: Qpower is enabled with duty cycling
4650 */
4651enum powersave_qpower_mode {
4652 QPOWER_DISABLED = 0,
4653 QPOWER_ENABLED = 1,
4654 QPOWER_DUTY_CYCLING = 2
4655};
4656
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08004657#ifdef FEATURE_LFR_SUBNET_DETECTION
4658/**
4659 * struct gateway_param_update_req - gateway parameter update request
4660 * @request_id: request id
4661 * @session_id: session id
4662 * @max_retries: Max ARP/NS retry attempts
4663 * @timeout: Retry interval
4664 * @ipv4_addr_type: on ipv4 network
4665 * @ipv6_addr_type: on ipv6 network
4666 * @gw_mac_addr: gateway mac addr
4667 * @ipv4_addr: ipv4 addr
4668 * @ipv6_addr: ipv6 addr
4669 */
4670struct gateway_param_update_req {
4671 uint32_t request_id;
4672 uint32_t session_id;
4673 uint32_t max_retries;
4674 uint32_t timeout;
4675 uint32_t ipv4_addr_type;
4676 uint32_t ipv6_addr_type;
Anurag Chouhan6d760662016-02-20 16:05:43 +05304677 struct qdf_mac_addr gw_mac_addr;
4678 uint8_t ipv4_addr[QDF_IPV4_ADDR_SIZE];
4679 uint8_t ipv6_addr[QDF_IPV6_ADDR_SIZE];
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08004680};
4681#else
4682struct gateway_param_update_req;
4683#endif /* FEATURE_LFR_SUBNET_DETECTION */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004684
Abhishek Singh518323d2015-10-19 17:42:01 +05304685/**
4686 * struct sir_sme_ext_change_chan_req - channel change request
4687 * @message_type: message id
4688 * @length: msg length
4689 * @new_channel: new channel
4690 * @session_id: session id
4691 */
4692struct sir_sme_ext_cng_chan_req {
4693 uint16_t message_type; /* eWNI_SME_EXT_CHANGE_CHANNEL */
4694 uint16_t length;
4695 uint32_t new_channel;
4696 uint8_t session_id;
4697};
4698
4699/**
4700 * struct sir_sme_ext_change_chan_ind.
4701 * @session_id: session id
4702 * @new_channel: new channel to change
4703 */
4704struct sir_sme_ext_cng_chan_ind {
4705 uint8_t session_id;
4706 uint8_t new_channel;
4707};
4708
Ryan Hsu3c8f79f2015-12-02 16:45:09 -08004709/**
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07004710 * struct stsf - the basic stsf structure
4711 *
4712 * @vdev_id: vdev id
4713 * @tsf_low: low 32bits of tsf
4714 * @tsf_high: high 32bits of tsf
Manikandan Mohan5356c2b2016-04-03 15:51:35 -07004715 * @soc_timer_low: low 32bits of synced SOC timer value
4716 * @soc_timer_high: high 32bits of synced SOC timer value
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07004717 *
4718 * driver use this struct to store the tsf info
4719 */
4720struct stsf {
4721 uint32_t vdev_id;
4722 uint32_t tsf_low;
4723 uint32_t tsf_high;
Manikandan Mohan5356c2b2016-04-03 15:51:35 -07004724 uint32_t soc_timer_low;
4725 uint32_t soc_timer_high;
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07004726};
4727
Gupta, Kapil4cb1d7d2016-04-16 18:16:25 -07004728#define SIR_BCN_FLT_MAX_ELEMS_IE_LIST 8
4729/**
4730 * struct beacon_filter_param - parameters for beacon filtering
4731 * @vdev_id: vdev id
4732 * @ie_map: bitwise map of IEs that needs to be filtered
4733 *
4734 */
4735struct beacon_filter_param {
4736 uint32_t vdev_id;
4737 uint32_t ie_map[SIR_BCN_FLT_MAX_ELEMS_IE_LIST];
4738};
4739
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05304740/**
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +05304741 * struct adaptive_dwelltime_params - the adaptive dwelltime params
4742 * @vdev_id: vdev id
4743 * @is_enabled: Adaptive dwell time is enabled/disabled
4744 * @dwelltime_mode: global default adaptive dwell mode
4745 * @lpf_weight: weight to calculate the average low pass
4746 * filter for channel congestion
4747 * @passive_mon_intval: intval to monitor wifi activity in passive scan in msec
4748 * @wifi_act_threshold: % of wifi activity used in passive scan 0-100
4749 *
4750 */
4751struct adaptive_dwelltime_params {
4752 uint32_t vdev_id;
4753 bool is_enabled;
4754 uint8_t dwelltime_mode;
4755 uint8_t lpf_weight;
4756 uint8_t passive_mon_intval;
4757 uint8_t wifi_act_threshold;
4758};
4759
4760/**
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05304761 * struct csa_offload_params - CSA offload request parameters
4762 * @channel: channel
4763 * @switch_mode: switch mode
4764 * @sec_chan_offset: second channel offset
4765 * @new_ch_width: new channel width
4766 * @new_ch_freq_seg1: channel center freq 1
4767 * @new_ch_freq_seg2: channel center freq 2
4768 * @ies_present_flag: IE present flag
4769 */
4770struct csa_offload_params {
4771 uint8_t channel;
4772 uint8_t switch_mode;
4773 uint8_t sec_chan_offset;
4774 uint8_t new_ch_width;
4775 uint8_t new_op_class;
4776 uint8_t new_ch_freq_seg1;
4777 uint8_t new_ch_freq_seg2;
4778 uint32_t ies_present_flag;
4779 tSirMacAddr bssId;
4780};
4781
4782/**
Sandeep Puligillae0875662016-02-12 16:09:21 -08004783 * enum obss_ht40_scancmd_type - obss scan command type
4784 * @HT40_OBSS_SCAN_PARAM_START: OBSS scan start
4785 * @HT40_OBSS_SCAN_PARAM_UPDATE: OBSS scan param update
4786 */
4787enum obss_ht40_scancmd_type {
4788 HT40_OBSS_SCAN_PARAM_START,
4789 HT40_OBSS_SCAN_PARAM_UPDATE
4790};
4791
4792/**
4793 * struct sme_obss_ht40_scanind_msg - sme obss scan params
4794 * @msg_type: message type
4795 * @length: message length
4796 * @mac_addr: mac address
4797 */
4798struct sme_obss_ht40_scanind_msg {
4799 uint16_t msg_type;
4800 uint16_t length;
4801 struct qdf_mac_addr mac_addr;
4802};
4803
4804/**
4805 * struct obss_ht40_scanind - ht40 obss scan request
4806 * @cmd: message type
4807 * @scan_type: message length
4808 * @obss_passive_dwelltime: obss passive dwelltime
4809 * @obss_active_dwelltime: obss active dwelltime
4810 * @obss_width_trigger_interval: scan interval
4811 * @obss_passive_total_per_channel: total passive scan time per channel
4812 * @obss_active_total_per_channel: total active scan time per channel
4813 * @bsswidth_ch_trans_delay: OBSS transition delay time
4814 * @obss_activity_threshold: OBSS activity threshold
4815 * @self_sta_id: self sta identification
4816 * @bss_id: BSS index
4817 * @fortymhz_intolerent: Ht40mhz intolerance
4818 * @channel_count: channel count
4819 * @channels: channel information
4820 * @current_operatingclass: operating class
4821 * @iefield_len: ie's length
4822 * @iefiled: ie's information
4823 */
4824struct obss_ht40_scanind {
4825 enum obss_ht40_scancmd_type cmd;
4826 enum eSirScanType scan_type;
4827 /* In TUs */
4828 uint16_t obss_passive_dwelltime;
4829 uint16_t obss_active_dwelltime;
4830 /* In seconds */
4831 uint16_t obss_width_trigger_interval;
4832 /* In TU's */
4833 uint16_t obss_passive_total_per_channel;
4834 uint16_t obss_active_total_per_channel;
4835 uint16_t bsswidth_ch_trans_delay;
4836 uint16_t obss_activity_threshold;
4837 uint8_t self_sta_idx;
4838 uint8_t bss_id;
4839 uint8_t fortymhz_intolerent;
4840 uint8_t channel_count;
4841 uint8_t channels[SIR_ROAM_MAX_CHANNELS];
4842 uint8_t current_operatingclass;
4843 uint16_t iefield_len;
4844 uint8_t iefield[SIR_ROAM_SCAN_MAX_PB_REQ_SIZE];
4845};
4846
4847/**
4848 * struct obss_scanparam - OBSS scan parameters
4849 * @obss_passive_dwelltime: message type
4850 * @obss_active_dwelltime: message length
4851 * @obss_width_trigger_interval: obss passive dwelltime
4852 * @obss_passive_total_per_channel: obss passive total scan time
4853 * @obss_active_total_per_channel: obss active total scan time
4854 * @bsswidth_ch_trans_delay: OBSS transition delay time
4855 * @obss_activity_threshold: OBSS activity threshold
4856 */
4857struct obss_scanparam {
4858 uint16_t obss_passive_dwelltime;
4859 uint16_t obss_active_dwelltime;
4860 uint16_t obss_width_trigger_interval;
4861 uint16_t obss_passive_total_per_channel;
4862 uint16_t obss_active_total_per_channel;
4863 uint16_t bsswidth_ch_trans_delay;
4864 uint16_t obss_activity_threshold;
4865};
4866
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304867/**
Nachiket Kukadee547a482018-05-22 16:43:30 +05304868 * struct sir_apf_set_offload - set apf filter instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304869 * @session_id: session identifier
Nachiket Kukadee547a482018-05-22 16:43:30 +05304870 * @version: host apf version
4871 * @filter_id: Filter ID for APF filter
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304872 * @total_length: The total length of the full instruction
4873 * total_length equal to 0 means reset
4874 * @current_offset: current offset, 0 means start a new setting
4875 * @current_length: Length of current @program
Nachiket Kukadee547a482018-05-22 16:43:30 +05304876 * @program: APF instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304877 */
Nachiket Kukadee547a482018-05-22 16:43:30 +05304878struct sir_apf_set_offload {
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304879 uint8_t session_id;
4880 uint32_t version;
4881 uint32_t filter_id;
4882 uint32_t total_length;
4883 uint32_t current_offset;
4884 uint32_t current_length;
4885 uint8_t *program;
4886};
4887
4888/**
Nachiket Kukadee547a482018-05-22 16:43:30 +05304889 * struct sir_apf_offload_capabilities - get apf Capabilities
4890 * @apf_version: fw's implement version
4891 * @max_apf_filters: max filters that fw supports
4892 * @max_bytes_for_apf_inst: the max bytes that can be used as apf instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304893 */
Nachiket Kukadee547a482018-05-22 16:43:30 +05304894struct sir_apf_get_offload {
4895 uint32_t apf_version;
4896 uint32_t max_apf_filters;
4897 uint32_t max_bytes_for_apf_inst;
Arun Khandavalli2476ef52016-04-26 20:19:43 +05304898};
4899
Naveen Rawat3ff5cff2018-01-29 14:31:16 -08004900#ifndef QCA_SUPPORT_CP_STATS
Sandeep Puligilla607f34a2016-05-25 14:37:47 -07004901/**
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05304902 * struct sir_wake_lock_stats - wake lock stats structure
Dustin Brown9d797d62017-01-11 16:39:12 -08004903 * @wow_unspecified_wake_up_count: number of non-wow related wake ups
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05304904 * @wow_ucast_wake_up_count: Unicast wakeup count
4905 * @wow_bcast_wake_up_count: Broadcast wakeup count
4906 * @wow_ipv4_mcast_wake_up_count: ipv4 multicast wakeup count
4907 * @wow_ipv6_mcast_wake_up_count: ipv6 multicast wakeup count
4908 * @wow_ipv6_mcast_ra_stats: ipv6 multicast ra stats
4909 * @wow_ipv6_mcast_ns_stats: ipv6 multicast ns stats
4910 * @wow_ipv6_mcast_na_stats: ipv6 multicast na stats
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +05304911 * @wow_icmpv4_count: ipv4 icmp packet count
Himanshu Agarwal4574e282016-08-10 15:22:45 +05304912 * @wow_icmpv6_count: ipv6 icmp packet count
Poddar, Siddarthc01681a2016-12-21 18:36:30 +05304913 * @wow_rssi_breach_wake_up_count: rssi breach wakeup count
4914 * @wow_low_rssi_wake_up_count: low rssi wakeup count
4915 * @wow_gscan_wake_up_count: gscan wakeup count
4916 * @wow_pno_complete_wake_up_count: pno complete wakeup count
4917 * @wow_pno_match_wake_up_count: pno match wakeup count
Dustin Brown9d797d62017-01-11 16:39:12 -08004918 * @wow_oem_response_wake_up_count: oem response wakeup count
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05304919 * @pwr_save_fail_detected: pwr save fail detected wakeup count
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05304920 */
4921struct sir_wake_lock_stats {
Dustin Brown9d797d62017-01-11 16:39:12 -08004922 uint32_t wow_unspecified_wake_up_count;
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05304923 uint32_t wow_ucast_wake_up_count;
4924 uint32_t wow_bcast_wake_up_count;
4925 uint32_t wow_ipv4_mcast_wake_up_count;
4926 uint32_t wow_ipv6_mcast_wake_up_count;
4927 uint32_t wow_ipv6_mcast_ra_stats;
4928 uint32_t wow_ipv6_mcast_ns_stats;
4929 uint32_t wow_ipv6_mcast_na_stats;
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +05304930 uint32_t wow_icmpv4_count;
Himanshu Agarwal4574e282016-08-10 15:22:45 +05304931 uint32_t wow_icmpv6_count;
Poddar, Siddarthc01681a2016-12-21 18:36:30 +05304932 uint32_t wow_rssi_breach_wake_up_count;
4933 uint32_t wow_low_rssi_wake_up_count;
4934 uint32_t wow_gscan_wake_up_count;
4935 uint32_t wow_pno_complete_wake_up_count;
4936 uint32_t wow_pno_match_wake_up_count;
Dustin Brown9d797d62017-01-11 16:39:12 -08004937 uint32_t wow_oem_response_wake_up_count;
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05304938 uint32_t pwr_save_fail_detected;
Dustin Brown9d797d62017-01-11 16:39:12 -08004939};
4940
4941/**
4942 * struct sir_vdev_wow_stats - container for per vdev wow related stat counters
4943 * @ucast: Unicast wakeup count
4944 * @bcast: Broadcast wakeup count
4945 * @ipv4_mcast: ipv4 multicast wakeup count
4946 * @ipv6_mcast: ipv6 multicast wakeup count
4947 * @ipv6_mcast_ra: ipv6 multicast ra stats
4948 * @ipv6_mcast_ns: ipv6 multicast ns stats
4949 * @ipv6_mcast_na: ipv6 multicast na stats
4950 * @icmpv4: ipv4 icmp packet count
4951 * @icmpv6: ipv6 icmp packet count
4952 * @rssi_breach: rssi breach wakeup count
4953 * @low_rssi: low rssi wakeup count
4954 * @gscan: gscan wakeup count
4955 * @pno_complete: pno complete wakeup count
4956 * @pno_match: pno match wakeup count
Visweswara Tanuku633976b2019-01-07 16:13:12 +05304957 * @oem_response: oem response wakeup count
Amar Singhal5eb9acb2017-05-26 15:25:27 -07004958 * @scan_11d: 11d scan wakeup count
Visweswara Tanuku633976b2019-01-07 16:13:12 +05304959 * @motion_detect: motion detection wakeup count
4960 * @motion_detect_bl: motion detection baselining wakeup count
Dustin Brown9d797d62017-01-11 16:39:12 -08004961 */
4962struct sir_vdev_wow_stats {
4963 uint32_t ucast;
4964 uint32_t bcast;
4965 uint32_t ipv4_mcast;
4966 uint32_t ipv6_mcast;
4967 uint32_t ipv6_mcast_ra;
4968 uint32_t ipv6_mcast_ns;
4969 uint32_t ipv6_mcast_na;
4970 uint32_t icmpv4;
4971 uint32_t icmpv6;
4972 uint32_t rssi_breach;
4973 uint32_t low_rssi;
4974 uint32_t gscan;
4975 uint32_t pno_complete;
4976 uint32_t pno_match;
4977 uint32_t oem_response;
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05304978 uint32_t pwr_save_fail_detected;
Amar Singhal5eb9acb2017-05-26 15:25:27 -07004979 uint32_t scan_11d;
Visweswara Tanuku633976b2019-01-07 16:13:12 +05304980#ifdef WLAN_FEATURE_MOTION_DETECTION
4981 uint32_t motion_detect;
4982 uint32_t motion_detect_bl;
4983#endif /* WLAN_FEATURE_MOTION_DETECTION */
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05304984};
Naveen Rawat3ff5cff2018-01-29 14:31:16 -08004985#endif
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05304986
Nachiket Kukade2fb1fdb2019-01-08 15:35:27 +05304987#ifdef WLAN_FEATURE_NAN
Ravi Joshi412f23d2016-05-26 15:09:23 -07004988#define IFACE_NAME_SIZE 64
4989
4990/**
4991 * enum ndp_accept_policy - nan data path accept policy
4992 * @NDP_ACCEPT_POLICY_NONE: the framework will decide the policy
4993 * @NDP_ACCEPT_POLICY_ALL: accept policy offloaded to fw
4994 *
4995 */
4996enum ndp_accept_policy {
4997 NDP_ACCEPT_POLICY_NONE = 0,
4998 NDP_ACCEPT_POLICY_ALL = 1,
4999};
5000
5001/**
5002 * enum ndp_self_role - nan data path role
5003 * @NDP_ROLE_INITIATOR: initiator of nan data path request
5004 * @NDP_ROLE_RESPONDER: responder to nan data path request
5005 *
5006 */
5007enum ndp_self_role {
5008 NDP_ROLE_INITIATOR = 0,
5009 NDP_ROLE_RESPONDER = 1,
5010};
5011
5012/**
5013 * enum ndp_response_code - responder's response code to nan data path request
5014 * @NDP_RESPONSE_ACCEPT: ndp request accepted
5015 * @NDP_RESPONSE_REJECT: ndp request rejected
5016 * @NDP_RESPONSE_DEFER: ndp request deferred until later (response to follow
5017 * any time later)
5018 *
5019 */
5020enum ndp_response_code {
5021 NDP_RESPONSE_ACCEPT = 0,
5022 NDP_RESPONSE_REJECT = 1,
5023 NDP_RESPONSE_DEFER = 2,
5024};
5025
5026/**
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07005027 * enum ndp_end_type - NDP end type
5028 * @NDP_END_TYPE_UNSPECIFIED: type is unspecified
5029 * @NDP_END_TYPE_PEER_UNAVAILABLE: type is peer unavailable
5030 * @NDP_END_TYPE_OTA_FRAME: NDP end frame received from peer
5031 *
5032 */
5033enum ndp_end_type {
5034 NDP_END_TYPE_UNSPECIFIED = 0x00,
5035 NDP_END_TYPE_PEER_UNAVAILABLE = 0x01,
5036 NDP_END_TYPE_OTA_FRAME = 0x02,
5037};
5038
5039/**
5040 * enum ndp_end_reason_code - NDP end reason code
5041 * @NDP_END_REASON_UNSPECIFIED: reason is unspecified
5042 * @NDP_END_REASON_INACTIVITY: reason is peer inactivity
5043 * @NDP_END_REASON_PEER_DATA_END: data end indication received from peer
5044 *
5045 */
5046enum ndp_end_reason_code {
5047 NDP_END_REASON_UNSPECIFIED = 0x00,
5048 NDP_END_REASON_INACTIVITY = 0x01,
5049 NDP_END_REASON_PEER_DATA_END = 0x02,
5050};
5051
5052/**
Naveen Rawat8d63a592016-06-29 18:30:59 -07005053 * enum nan_status_type - NDP status type
5054 * @NDP_RSP_STATUS_SUCCESS: request was successful
5055 * @NDP_RSP_STATUS_ERROR: request failed
5056 */
5057enum nan_status_type {
5058 NDP_RSP_STATUS_SUCCESS = 0x00,
5059 NDP_RSP_STATUS_ERROR = 0x01,
5060};
5061
5062/**
5063 * enum nan_reason_code - NDP command rsp reason code value
5064 * @NDP_UNSUPPORTED_CONCURRENCY: Will be used in unsupported concurrency cases
5065 * @NDP_NAN_DATA_IFACE_CREATE_FAILED: ndi create failed
5066 * @NDP_NAN_DATA_IFACE_DELETE_FAILED: ndi delete failed
5067 * @NDP_DATA_INITIATOR_REQ_FAILED: data initiator request failed
5068 * @NDP_DATA_RESPONDER_REQ_FAILED: data responder request failed
5069 * @NDP_INVALID_SERVICE_INSTANCE_ID: invalid service instance id
5070 * @NDP_INVALID_NDP_INSTANCE_ID: invalid ndp instance id
5071 * @NDP_INVALID_RSP_CODE: invalid response code in ndp responder request
5072 * @NDP_INVALID_APP_INFO_LEN: invalid app info length
5073 * @NDP_NMF_REQ_FAIL: OTA nan mgmt frame failure for data request
5074 * @NDP_NMF_RSP_FAIL: OTA nan mgmt frame failure for data response
5075 * @NDP_NMF_CNF_FAIL: OTA nan mgmt frame failure for confirm
5076 * @NDP_END_FAILED: ndp end failed
5077 * @NDP_NMF_END_REQ_FAIL: OTA nan mgmt frame failure for data end
5078 * @NDP_VENDOR_SPECIFIC_ERROR: other vendor specific failures
5079 */
5080enum nan_reason_code {
5081 NDP_UNSUPPORTED_CONCURRENCY = 9000,
5082 NDP_NAN_DATA_IFACE_CREATE_FAILED = 9001,
5083 NDP_NAN_DATA_IFACE_DELETE_FAILED = 9002,
5084 NDP_DATA_INITIATOR_REQ_FAILED = 9003,
5085 NDP_DATA_RESPONDER_REQ_FAILED = 9004,
5086 NDP_INVALID_SERVICE_INSTANCE_ID = 9005,
5087 NDP_INVALID_NDP_INSTANCE_ID = 9006,
5088 NDP_INVALID_RSP_CODE = 9007,
5089 NDP_INVALID_APP_INFO_LEN = 9008,
5090 NDP_NMF_REQ_FAIL = 9009,
5091 NDP_NMF_RSP_FAIL = 9010,
5092 NDP_NMF_CNF_FAIL = 9011,
5093 NDP_END_FAILED = 9012,
5094 NDP_NMF_END_REQ_FAIL = 9013,
5095 /* 9500 onwards vendor specific error codes */
5096 NDP_VENDOR_SPECIFIC_ERROR = 9500,
5097};
5098
5099/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07005100 * struct ndp_cfg - ndp configuration
5101 * @tag: unique identifier
5102 * @ndp_cfg_len: ndp configuration length
5103 * @ndp_cfg: variable length ndp configuration
5104 *
5105 */
5106struct ndp_cfg {
5107 uint32_t tag;
5108 uint32_t ndp_cfg_len;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07005109 uint8_t *ndp_cfg;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005110};
5111
5112/**
5113 * struct ndp_qos_cfg - ndp qos configuration
5114 * @tag: unique identifier
5115 * @ndp_qos_cfg_len: ndp qos configuration length
5116 * @ndp_qos_cfg: variable length ndp qos configuration
5117 *
5118 */
5119struct ndp_qos_cfg {
5120 uint32_t tag;
5121 uint32_t ndp_qos_cfg_len;
5122 uint8_t ndp_qos_cfg[];
5123};
5124
5125/**
5126 * struct ndp_app_info - application info shared during ndp setup
5127 * @tag: unique identifier
5128 * @ndp_app_info_len: ndp app info length
5129 * @ndp_app_info: variable length application information
5130 *
5131 */
5132struct ndp_app_info {
5133 uint32_t tag;
5134 uint32_t ndp_app_info_len;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07005135 uint8_t *ndp_app_info;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005136};
5137
5138/**
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005139 * struct ndp_scid - structure to hold sceurity context identifier
5140 * @scid_len: length of scid
5141 * @scid: scid
5142 *
5143 */
5144struct ndp_scid {
5145 uint32_t scid_len;
5146 uint8_t *scid;
5147};
5148
5149/**
5150 * struct ndp_pmk - structure to hold pairwise master key
5151 * @pmk_len: length of pairwise master key
5152 * @pmk: buffer containing pairwise master key
5153 *
5154 */
5155struct ndp_pmk {
5156 uint32_t pmk_len;
5157 uint8_t *pmk;
5158};
5159
5160/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07005161 * struct ndi_create_req - ndi create request params
5162 * @transaction_id: unique identifier
5163 * @iface_name: interface name
5164 *
5165 */
5166struct ndi_create_req {
5167 uint32_t transaction_id;
5168 char iface_name[IFACE_NAME_SIZE];
5169};
5170
5171/**
5172 * struct ndi_create_rsp - ndi create response params
Ravi Joshi412f23d2016-05-26 15:09:23 -07005173 * @status: request status
5174 * @reason: reason if any
5175 *
5176 */
5177struct ndi_create_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07005178 uint32_t status;
5179 uint32_t reason;
Rakesh Sunkicf1c9ab2016-08-25 14:11:25 -07005180 uint8_t sta_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005181};
5182
5183/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07005184 * struct ndi_delete_rsp - ndi delete response params
Ravi Joshi412f23d2016-05-26 15:09:23 -07005185 * @status: request status
5186 * @reason: reason if any
5187 *
5188 */
5189struct ndi_delete_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07005190 uint32_t status;
5191 uint32_t reason;
5192};
5193
5194/**
5195 * struct ndp_initiator_req - ndp initiator request params
5196 * @transaction_id: unique identifier
5197 * @vdev_id: session id of the interface over which ndp is being created
5198 * @channel: suggested channel for ndp creation
Naveen Rawat0a017052016-10-19 14:17:07 -07005199 * @channel_cfg: channel config, 0=no channel, 1=optional, 2=mandatory
Ravi Joshi412f23d2016-05-26 15:09:23 -07005200 * @service_instance_id: Service identifier
5201 * @peer_discovery_mac_addr: Peer's discovery mac address
5202 * @self_ndi_mac_addr: self NDI mac address
5203 * @ndp_config: ndp configuration params
5204 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005205 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
5206 * @pmk: pairwise master key
Ravi Joshi412f23d2016-05-26 15:09:23 -07005207 *
5208 */
5209struct ndp_initiator_req {
5210 uint32_t transaction_id;
5211 uint32_t vdev_id;
5212 uint32_t channel;
Naveen Rawat0a017052016-10-19 14:17:07 -07005213 uint32_t channel_cfg;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005214 uint32_t service_instance_id;
5215 struct qdf_mac_addr peer_discovery_mac_addr;
5216 struct qdf_mac_addr self_ndi_mac_addr;
5217 struct ndp_cfg ndp_config;
5218 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005219 uint32_t ncs_sk_type;
5220 struct ndp_pmk pmk;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005221};
5222
5223/**
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07005224 * struct ndp_initiator_rsp - response event from FW
Ravi Joshi412f23d2016-05-26 15:09:23 -07005225 * @transaction_id: unique identifier
5226 * @vdev_id: session id of the interface over which ndp is being created
5227 * @ndp_instance_id: locally created NDP instance ID
5228 * @status: status of the ndp request
5229 * @reason: reason for failure if any
5230 *
5231 */
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07005232struct ndp_initiator_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07005233 uint32_t transaction_id;
5234 uint32_t vdev_id;
5235 uint32_t ndp_instance_id;
5236 uint32_t status;
Naveen Rawat8d63a592016-06-29 18:30:59 -07005237 uint32_t reason;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005238};
5239
5240/**
5241 * struct ndp_indication_event - create ndp indication on the responder
5242 * @vdev_id: session id of the interface over which ndp is being created
5243 * @service_instance_id: Service identifier
5244 * @peer_discovery_mac_addr: Peer's discovery mac address
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07005245 * @peer_mac_addr: Peer's NDI mac address
Ravi Joshi412f23d2016-05-26 15:09:23 -07005246 * @ndp_initiator_mac_addr: NDI mac address of the peer initiating NDP
5247 * @ndp_instance_id: locally created NDP instance ID
5248 * @role: self role for NDP
5249 * @ndp_accept_policy: accept policy configured by the upper layer
5250 * @ndp_config: ndp configuration params
5251 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005252 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
5253 * @scid: security context identifier
Ravi Joshi412f23d2016-05-26 15:09:23 -07005254 *
5255 */
5256struct ndp_indication_event {
5257 uint32_t vdev_id;
5258 uint32_t service_instance_id;
5259 struct qdf_mac_addr peer_discovery_mac_addr;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07005260 struct qdf_mac_addr peer_mac_addr;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005261 uint32_t ndp_instance_id;
5262 enum ndp_self_role role;
5263 enum ndp_accept_policy policy;
5264 struct ndp_cfg ndp_config;
5265 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005266 uint32_t ncs_sk_type;
5267 struct ndp_scid scid;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005268};
5269
5270/**
5271 * struct ndp_responder_req - responder's response to ndp create request
5272 * @transaction_id: unique identifier
5273 * @vdev_id: session id of the interface over which ndp is being created
5274 * @ndp_instance_id: locally created NDP instance ID
5275 * @ndp_rsp: response to the ndp create request
5276 * @ndp_config: ndp configuration params
5277 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005278 * @pmk: pairwise master key
5279 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
Ravi Joshi412f23d2016-05-26 15:09:23 -07005280 *
5281 */
5282struct ndp_responder_req {
5283 uint32_t transaction_id;
5284 uint32_t vdev_id;
5285 uint32_t ndp_instance_id;
5286 enum ndp_response_code ndp_rsp;
5287 struct ndp_cfg ndp_config;
5288 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005289 struct ndp_pmk pmk;
5290 uint32_t ncs_sk_type;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005291};
5292
5293/**
5294 * struct ndp_responder_rsp_event - response to responder's request
5295 * @transaction_id: unique identifier
5296 * @vdev_id: session id of the interface over which ndp is being created
5297 * @status: command status
5298 * @reason: reason for failure if any
Abhishek Singh4fef7472016-06-06 11:36:03 -07005299 * @peer_mac_addr: Peer's mac address
Rakesh Sunkid92d1082017-01-04 15:14:28 -08005300 * @create_peer: Flag to indicate to create peer
Ravi Joshi412f23d2016-05-26 15:09:23 -07005301 */
5302struct ndp_responder_rsp_event {
5303 uint32_t transaction_id;
5304 uint32_t vdev_id;
5305 uint32_t status;
5306 uint32_t reason;
Abhishek Singh4fef7472016-06-06 11:36:03 -07005307 struct qdf_mac_addr peer_mac_addr;
Rakesh Sunkid92d1082017-01-04 15:14:28 -08005308 bool create_peer;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005309};
5310
5311/**
5312 * struct ndp_confirm_event - ndp confirmation event from FW
5313 * @vdev_id: session id of the interface over which ndp is being created
5314 * @ndp_instance_id: ndp instance id for which confirm is being generated
Naveen Rawat460be782016-06-29 18:26:22 -07005315 * @reason_code : reason code(opaque to driver)
5316 * @num_active_ndps_on_peer: number of ndp instances on peer
Ravi Joshi412f23d2016-05-26 15:09:23 -07005317 * @peer_ndi_mac_addr: peer NDI mac address
5318 * @rsp_code: ndp response code
Ravi Joshi412f23d2016-05-26 15:09:23 -07005319 * @ndp_info: ndp application info
5320 *
5321 */
5322struct ndp_confirm_event {
5323 uint32_t vdev_id;
5324 uint32_t ndp_instance_id;
Naveen Rawat460be782016-06-29 18:26:22 -07005325 uint32_t reason_code;
5326 uint32_t num_active_ndps_on_peer;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005327 struct qdf_mac_addr peer_ndi_mac_addr;
5328 enum ndp_response_code rsp_code;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005329 struct ndp_app_info ndp_info;
5330};
5331
5332/**
5333 * struct ndp_end_req - ndp end request
5334 * @transaction_id: unique transaction identifier
Ravi Joshi412f23d2016-05-26 15:09:23 -07005335 * @num_ndp_instances: number of ndp instances to be terminated
Naveen Rawatf28315c2016-06-29 18:06:02 -07005336 * @ndp_ids: pointer to array of ndp_instance_id to be terminated
Ravi Joshi412f23d2016-05-26 15:09:23 -07005337 *
5338 */
5339struct ndp_end_req {
5340 uint32_t transaction_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005341 uint32_t num_ndp_instances;
Naveen Rawatf28315c2016-06-29 18:06:02 -07005342 uint32_t *ndp_ids;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005343};
5344
5345/**
5346 * struct peer_ndp_map - mapping of NDP instances to peer to VDEV
5347 * @vdev_id: session id of the interface over which ndp is being created
5348 * @peer_ndi_mac_addr: peer NDI mac address
5349 * @num_active_ndp_sessions: number of active NDP sessions on the peer
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07005350 * @type: NDP end indication type
5351 * @reason_code: NDP end indication reason code
5352 * @ndp_instance_id: NDP instance ID
Ravi Joshi412f23d2016-05-26 15:09:23 -07005353 *
5354 */
5355struct peer_ndp_map {
5356 uint32_t vdev_id;
5357 struct qdf_mac_addr peer_ndi_mac_addr;
5358 uint32_t num_active_ndp_sessions;
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07005359 enum ndp_end_type type;
5360 enum ndp_end_reason_code reason_code;
5361 uint32_t ndp_instance_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005362};
5363
5364/**
5365 * struct ndp_end_rsp_event - firmware response to ndp end request
5366 * @transaction_id: unique identifier for the request
Naveen Rawatf28315c2016-06-29 18:06:02 -07005367 * @status: status of operation
5368 * @reason: reason(opaque to host driver)
Ravi Joshi412f23d2016-05-26 15:09:23 -07005369 *
5370 */
5371struct ndp_end_rsp_event {
5372 uint32_t transaction_id;
Naveen Rawatf28315c2016-06-29 18:06:02 -07005373 uint32_t status;
5374 uint32_t reason;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005375};
5376
5377/**
5378 * struct ndp_end_indication_event - ndp termination notification from FW
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07005379 * @num_ndp_ids: number of NDP ids
5380 * @ndp_map: mapping of NDP instances to peer and vdev
Ravi Joshi412f23d2016-05-26 15:09:23 -07005381 *
5382 */
5383struct ndp_end_indication_event {
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07005384 uint32_t num_ndp_ids;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005385 struct peer_ndp_map ndp_map[];
5386};
5387
5388/**
5389 * struct ndp_schedule_update_req - ndp schedule update request
5390 * @transaction_id: unique identifier
5391 * @vdev_id: session id of the interface over which ndp is being created
5392 * @ndp_instance_id: ndp instance id for which schedule update is requested
5393 * @ndp_qos: new set of qos parameters
5394 *
5395 */
5396struct ndp_schedule_update_req {
5397 uint32_t transaction_id;
5398 uint32_t vdev_id;
5399 uint32_t ndp_instance_id;
5400 struct ndp_qos_cfg ndp_qos;
5401};
5402
5403/**
5404 * struct ndp_schedule_update_rsp - ndp schedule update response
5405 * @transaction_id: unique identifier
5406 * @vdev_id: session id of the interface over which ndp is being created
5407 * @status: status of the request
5408 * @reason: reason code for failure if any
5409 *
5410 */
5411struct ndp_schedule_update_rsp {
5412 uint32_t transaction_id;
5413 uint32_t vdev_id;
5414 uint32_t status;
5415 uint32_t reason;
5416};
5417
5418/**
5419 * struct sme_ndp_peer_ind - ndp peer indication
5420 * @msg_type: message id
5421 * @msg_len: message length
5422 * @session_id: session id
5423 * @peer_mac_addr: peer mac address
5424 * @sta_id: station id
5425 *
5426 */
5427struct sme_ndp_peer_ind {
5428 uint16_t msg_type;
5429 uint16_t msg_len;
5430 uint8_t session_id;
5431 struct qdf_mac_addr peer_mac_addr;
5432 uint16_t sta_id;
5433};
Nachiket Kukade2fb1fdb2019-01-08 15:35:27 +05305434#endif /* WLAN_FEATURE_NAN */
Ravi Joshi412f23d2016-05-26 15:09:23 -07005435
Peng Xu8fdaa492016-06-22 10:20:47 -07005436/**
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05305437 * struct sir_set_tx_rx_aggregation_size - sets tx rx aggregation size
5438 * @vdev_id: vdev id of the session
Arif Hussain0e246802018-05-01 18:13:44 -07005439 * @aggr_type: TX Aggregation Type (0=A-MPDU, 1=A-MSDU)
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05305440 * @tx_aggregation_size: Tx aggregation size
Paul Zhangee09f8e2018-04-23 16:11:32 +08005441 * @tx_aggregation_size_be: Tx aggregation size for be queue
5442 * @tx_aggregation_size_bk: Tx aggregation size for bk queue
5443 * @tx_aggregation_size_vi: Tx aggregation size for vi queue
5444 * @tx_aggregation_size_vo: Tx aggregation size for vo queue
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05305445 * @rx_aggregation_size: Rx aggregation size
5446 */
5447struct sir_set_tx_rx_aggregation_size {
5448 uint8_t vdev_id;
Arif Hussain0e246802018-05-01 18:13:44 -07005449 wmi_vdev_custom_aggr_type_t aggr_type;
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05305450 uint32_t tx_aggregation_size;
Paul Zhangee09f8e2018-04-23 16:11:32 +08005451 uint32_t tx_aggregation_size_be;
5452 uint32_t tx_aggregation_size_bk;
5453 uint32_t tx_aggregation_size_vi;
5454 uint32_t tx_aggregation_size_vo;
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05305455 uint32_t rx_aggregation_size;
5456};
5457
5458/**
stonez26388d02018-10-17 13:37:48 +08005459 * struct sir_set_tx_sw_retry_threshold - set sw retry threshold
Paul Zhang33fae272018-04-23 16:19:00 +08005460 * @vdev_id: vdev id of the session
stonez26388d02018-10-17 13:37:48 +08005461 * @tx_aggr_sw_retry_threshold_be: aggr sw retry threshold for BE
5462 * @tx_aggr_sw_retry_threshold_bk: aggr sw retry threshold for BK
5463 * @tx_aggr_sw_retry_threshold_vi: aggr sw retry threshold for VI
5464 * @tx_aggr_sw_retry_threshold_vo: aggr sw retry threshold for VO
5465 * @tx_non_aggr_sw_retry_threshold_be: non aggr sw retry threshold for BE
5466 * @tx_non_aggr_sw_retry_threshold_bk: non aggr sw retry threshold for BK
5467 * @tx_non_aggr_sw_retry_threshold_vi: non aggr sw retry threshold for VI
5468 * @tx_non_aggr_sw_retry_threshold_vo: non aggr sw retry threshold for VO
Paul Zhang33fae272018-04-23 16:19:00 +08005469 */
stonez26388d02018-10-17 13:37:48 +08005470struct sir_set_tx_sw_retry_threshold {
Paul Zhang33fae272018-04-23 16:19:00 +08005471 uint8_t vdev_id;
5472 uint32_t tx_aggr_sw_retry_threshold_be;
5473 uint32_t tx_aggr_sw_retry_threshold_bk;
5474 uint32_t tx_aggr_sw_retry_threshold_vi;
5475 uint32_t tx_aggr_sw_retry_threshold_vo;
stonez26388d02018-10-17 13:37:48 +08005476 uint32_t tx_non_aggr_sw_retry_threshold_be;
5477 uint32_t tx_non_aggr_sw_retry_threshold_bk;
5478 uint32_t tx_non_aggr_sw_retry_threshold_vi;
5479 uint32_t tx_non_aggr_sw_retry_threshold_vo;
Paul Zhang33fae272018-04-23 16:19:00 +08005480};
5481
5482/**
Peng Xu8fdaa492016-06-22 10:20:47 -07005483 * struct sir_p2p_lo_start - p2p listen offload start
5484 * @vdev_id: vdev identifier
5485 * @ctl_flags: control flag
5486 * @freq: p2p listen frequency
5487 * @period: listen offload period
5488 * @interval: listen offload interval
5489 * @count: number listen offload intervals
5490 * @device_types: device types
5491 * @dev_types_len: device types length
5492 * @probe_resp_tmplt: probe response template
5493 * @probe_resp_len: probe response template length
5494 */
5495struct sir_p2p_lo_start {
5496 uint32_t vdev_id;
5497 uint32_t ctl_flags;
5498 uint32_t freq;
5499 uint32_t period;
5500 uint32_t interval;
5501 uint32_t count;
5502 uint8_t *device_types;
5503 uint32_t dev_types_len;
5504 uint8_t *probe_resp_tmplt;
5505 uint32_t probe_resp_len;
5506};
5507
5508/**
5509 * struct sir_p2p_lo_event - P2P listen offload stop event
5510 * @vdev_id: vdev identifier
5511 * @reason_code: P2P listen offload stop reason
5512 */
5513struct sir_p2p_lo_event {
5514 uint32_t vdev_id;
5515 uint32_t reason_code;
5516};
Manjeet Singhf82ed072016-07-08 11:40:00 +05305517
5518/**
5519 * struct sir_hal_pwr_dbg_cmd - unit test command parameters
5520 * @pdev_id: pdev id
5521 * @module_id: module id
5522 * @num_args: number of arguments
5523 * @args: arguments
5524 */
5525struct sir_mac_pwr_dbg_cmd {
5526 uint32_t pdev_id;
5527 uint32_t module_id;
5528 uint32_t num_args;
5529 uint32_t args[MAX_POWER_DBG_ARGS_SUPPORTED];
5530};
5531
Kondabattini, Ganesh3f2d02c2016-09-13 12:23:47 +05305532/**
5533 * struct sme_send_disassoc_frm_req - send disassoc request frame
5534 * @msg_type: message type
5535 * @length: length of message
5536 * @session_id: session id
5537 * @trans_id: transaction id
5538 * @peer_mac: peer mac address
5539 * @reason: reason for disassoc
5540 * @wait_for_ack: wait for acknowledgment
5541 **/
5542 struct sme_send_disassoc_frm_req {
5543 uint16_t msg_type;
5544 uint16_t length;
5545 uint8_t session_id;
5546 uint16_t trans_id;
5547 uint8_t peer_mac[6];
5548 uint16_t reason;
5549 uint8_t wait_for_ack;
5550 };
5551
Kondabattini, Ganeshe4f18e02016-09-13 13:01:22 +05305552/**
5553 * struct sme_update_access_policy_vendor_ie - update vendor ie and access
5554 * policy
5555 * @msg_type: message id
5556 * @msg_len: message length
5557 * @sme_session_id: sme session id
5558 * @ie: vendor ie
5559 * @access_policy: access policy for vendor ie
5560 */
5561struct sme_update_access_policy_vendor_ie {
5562 uint16_t msg_type;
5563 uint16_t length;
5564 uint32_t sme_session_id;
Jeff Johnsonaffc4da2018-11-16 14:10:07 -08005565 uint8_t ie[SIR_MAC_MAX_IE_LENGTH + 2];
Kondabattini, Ganeshe4f18e02016-09-13 13:01:22 +05305566 uint8_t access_policy;
5567};
5568
Padma, Santhosh Kumard7cc0792016-06-28 18:54:12 +05305569/**
Agrawal, Ashish35b251d2016-09-08 19:21:03 +05305570 * struct sme_tx_fail_cnt_threshold - tx failure count for disconnect to fw
5571 * @session_id: Session id
5572 * @tx_fail_cnt_threshold: Tx failure count to do disconnect
5573 */
5574struct sme_tx_fail_cnt_threshold {
5575 uint8_t session_id;
5576 uint32_t tx_fail_cnt_threshold;
5577};
Agrawal Ashishda3e9502016-09-21 17:43:51 +05305578
5579/**
5580 * struct sme_short_retry_limit - transmission retry limit for short frames.
5581 * @session_id: Session id
5582 * @short_retry_limit: tranmission retry limit for short frame.
5583 *
5584 */
5585struct sme_short_retry_limit {
5586 uint8_t session_id;
5587 uint32_t short_retry_limit;
5588};
5589
5590/**
5591 * struct sme_long_retry_limit - tranmission retry limit for long frames
5592 * @session_id: Session id
5593 * @short_retry_limit: tranmission retry limit for long frames.
5594 *
5595 */
5596struct sme_long_retry_limit {
5597 uint8_t session_id;
5598 uint32_t long_retry_limit;
5599};
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05305600
5601/**
Kiran Kumar Lokere08195ef2018-01-17 19:25:15 -08005602 * struct sme_addba_accept - Allow/reject the addba request frame
5603 * @session_id: Session id
5604 * @addba_accept: Allow/reject the addba request frame
5605 */
5606struct sme_addba_accept {
5607 uint8_t session_id;
5608 uint8_t addba_accept;
5609};
5610
5611/**
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05305612 * struct sme_sta_inactivity_timeout - set sta_inactivity_timeout
5613 * @session_id: session Id.
5614 * @sta_inactivity_timeout: Timeout to disconnect STA after there
5615 * is no activity.
5616 */
5617struct sme_sta_inactivity_timeout {
5618 uint8_t session_id;
5619 uint32_t sta_inactivity_timeout;
5620};
Yingying Tang95409972016-10-20 15:16:15 +08005621
5622/*
5623 * struct wow_pulse_mode - WoW Pulse set cmd struct
5624 * @wow_pulse_enable: enable or disable this feature
5625 * @wow_pulse_pin: GPIO PIN for Pulse
5626 * @wow_pulse_interval_low: Pulse interval low
5627 * @wow_pulse_interval_high: Pulse interval high
5628 *
5629 * SME uses this structure to configure wow pulse info
5630 * and send it to WMA
5631 */
5632struct wow_pulse_mode {
5633 bool wow_pulse_enable;
5634 uint8_t wow_pulse_pin;
5635 uint16_t wow_pulse_interval_high;
5636 uint16_t wow_pulse_interval_low;
5637};
5638
Rajeev Kumare406d652017-01-30 17:47:05 -08005639
5640/**
Rajeev Kumard138ac52017-01-30 18:38:37 -08005641 * umac_send_mb_message_to_mac(): post message to umac
Rajeev Kumare406d652017-01-30 17:47:05 -08005642 * @msg: opaque message pointer
5643 *
5644 * Return: QDF status
5645 */
Rajeev Kumard138ac52017-01-30 18:38:37 -08005646QDF_STATUS umac_send_mb_message_to_mac(void *msg);
Rajeev Kumare406d652017-01-30 17:47:05 -08005647
Kapil Gupta4f0c0c12017-02-07 15:21:15 +05305648/**
5649 * struct scan_chan_info - channel info
5650 * @freq: radio frequence
5651 * @cmd flag: cmd flag
5652 * @noise_floor: noise floor
5653 * @cycle_count: cycle count
5654 * @rx_clear_count: rx clear count
5655 * @tx_frame_count: TX frame count
5656 * @clock_freq: clock frequence MHZ
5657 */
5658struct scan_chan_info {
5659 uint32_t freq;
5660 uint32_t cmd_flag;
5661 uint32_t noise_floor;
5662 uint32_t cycle_count;
5663 uint32_t rx_clear_count;
5664 uint32_t tx_frame_count;
5665 uint32_t clock_freq;
5666};
Dustin Brown54096432017-02-23 13:00:44 -08005667
5668/**
5669 * enum wow_resume_trigger - resume trigger override setting values
5670 * @WOW_RESUME_TRIGGER_DEFAULT: fw to use platform default resume trigger
5671 * @WOW_RESUME_TRIGGER_HTC_WAKEUP: force fw to use HTC Wakeup to resume
5672 * @WOW_RESUME_TRIGGER_GPIO: force fw to use GPIO to resume
5673 * @WOW_RESUME_TRIGGER_COUNT: number of resume trigger options
5674 */
5675enum wow_resume_trigger {
5676 /* always first */
5677 WOW_RESUME_TRIGGER_DEFAULT = 0,
5678 WOW_RESUME_TRIGGER_HTC_WAKEUP,
5679 WOW_RESUME_TRIGGER_GPIO,
5680 /* always last */
5681 WOW_RESUME_TRIGGER_COUNT
5682};
5683
5684/**
5685 * enum wow_interface_pause - interface pause override setting values
5686 * @WOW_INTERFACE_PAUSE_DEFAULT: use platform default interface pause setting
5687 * @WOW_INTERFACE_PAUSE_ENABLE: force interface pause setting to enabled
5688 * @WOW_INTERFACE_PAUSE_DISABLE: force interface pause setting to disabled
5689 * @WOW_INTERFACE_PAUSE_COUNT: number of interface pause options
5690 */
5691enum wow_interface_pause {
5692 /* always first */
5693 WOW_INTERFACE_PAUSE_DEFAULT = 0,
5694 WOW_INTERFACE_PAUSE_ENABLE,
5695 WOW_INTERFACE_PAUSE_DISABLE,
5696 /* always last */
5697 WOW_INTERFACE_PAUSE_COUNT
5698};
5699
5700/**
5701 * struct wow_enable_params - A collection of wow enable override parameters
5702 * @is_unit_test: true to notify fw this is a unit-test suspend
5703 * @interface_pause: used to override the interface pause indication sent to fw
5704 * @resume_trigger: used to force fw to use a particular resume method
5705 */
5706struct wow_enable_params {
5707 bool is_unit_test;
5708 enum wow_interface_pause interface_pause;
5709 enum wow_resume_trigger resume_trigger;
5710};
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07005711
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08005712#define HE_LTF_1X 0
5713#define HE_LTF_2X 1
5714#define HE_LTF_4X 2
5715
5716#define HE_LTF_ALL 0x7
5717#define HE_SGI_MASK 0xFF00
5718
5719#define AUTO_RATE_GI_400NS 8
5720#define AUTO_RATE_GI_800NS 9
5721#define AUTO_RATE_GI_1600NS 10
5722#define AUTO_RATE_GI_3200NS 11
5723
5724#define SET_AUTO_RATE_SGI_VAL(set_val, bit_mask) \
5725 (set_val = (set_val & HE_LTF_ALL) | bit_mask)
5726
5727#define SET_AUTO_RATE_HE_LTF_VAL(set_val, bit_mask) \
5728 (set_val = (set_val & HE_SGI_MASK) | bit_mask)
5729
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07005730#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -07005731#define HE_CAP_OUI_TYPE "\x23"
5732#define HE_CAP_OUI_SIZE 1
5733#define HE_OP_OUI_TYPE "\x24"
5734#define HE_OP_OUI_SIZE 1
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08005735
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07005736#define HE_RU_ALLOC_INDX0_MASK (0x01 << 0)
5737#define HE_RU_ALLOC_INDX1_MASK (0x01 << 1)
5738#define HE_RU_ALLOC_INDX2_MASK (0x01 << 2)
5739#define HE_RU_ALLOC_INDX3_MASK (0x01 << 3)
5740
5741/* 3 bits for NSS and 4 bits for RU Index */
5742#define HE_PPET_NSS_LEN 3
5743#define HE_PEPT_RU_IDX_LEN 4
5744#define HE_PPET_NSS_RU_LEN (HE_PPET_NSS_LEN + HE_PEPT_RU_IDX_LEN)
5745#define HE_PPET_SIZE 3
5746#define HE_BYTE_SIZE 8
5747
Naveen Rawat819158d2018-01-16 10:56:45 -08005748struct ppet_hdr {
5749 uint8_t nss:3;
5750 uint8_t ru_idx_mask:4;
5751 uint8_t remaining:1;
5752};
5753
5754/* MAX PPET size = 7 bits + (max_nss X max_ru_number X 6) = 25 bytes */
5755#define HE_MAX_PPET_SIZE WNI_CFG_HE_PPET_LEN
5756
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -08005757#define HE_MAX_PHY_CAP_SIZE 3
5758
Naveen Rawataeca1b92017-10-16 16:55:31 -07005759#define HE_CH_WIDTH_GET_BIT(ch_wd, bit) (((ch_wd) >> (bit)) & 1)
5760#define HE_CH_WIDTH_COMBINE(b0, b1, b2, b3, b4, b5, b6) \
5761 ((uint8_t)(b0) | ((b1) << 1) | ((b2) << 2) | ((b3) << 3) | \
5762 ((b4) << 4) | ((b5) << 5) | ((b6) << 6))
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -07005763
Naveen Rawataeca1b92017-10-16 16:55:31 -07005764/*
5765 * MCS values are interpreted as in IEEE 11ax-D1.4 spec onwards
5766 * +-----------------------------------------------------+
5767 * | SS8 | SS7 | SS6 | SS5 | SS4 | SS3 | SS2 | SS1 |
5768 * +-----------------------------------------------------+
5769 * | 15-14 | 13-12 | 11-10 | 9-8 | 7-6 | 5-4 | 3-2 | 1-0 |
5770 * +-----------------------------------------------------+
5771 */
5772#define HE_MCS_NSS_SHIFT(nss) (((nss) - 1) << 1)
5773#define HE_MCS_MSK_4_NSS(nss) (3 << HE_MCS_NSS_SHIFT(nss))
5774#define HE_MCS_INV_MSK_4_NSS(nss) (~HE_MCS_MSK_4_NSS(nss))
5775#define HE_GET_MCS_4_NSS(mcs_set, nss) \
5776 (((mcs_set) >> HE_MCS_NSS_SHIFT(nss)) & 3)
5777#define HE_SET_MCS_4_NSS(mcs_set, mcs, nss) \
5778 (((mcs_set) & HE_MCS_INV_MSK_4_NSS(nss)) | \
5779 ((mcs) << HE_MCS_NSS_SHIFT(nss)))
5780#define HE_MCS_IS_NSS_ENABLED(mcs_set, nss) \
5781 ((HE_MCS_MSK_4_NSS(nss) & (mcs_set)) != HE_MCS_MSK_4_NSS(nss))
5782
5783#define HE_MCS_ALL_DISABLED 0xFFFF
Kiran Kumar Lokere59a569e2018-01-24 15:00:50 -08005784
5785#define HE_MCS_0_7 0x0
5786#define HE_MCS_0_9 0x1
5787#define HE_MCS_0_11 0x2
5788#define HE_MCS_DISABLE 0x3
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08005789
Naveen Rawataeca1b92017-10-16 16:55:31 -07005790/*
5791 * Following formuala has been arrived at using karnaugh map and unit tested
5792 * with sample code. Take MCS for each NSS as 2 bit value first and solve for
5793 * 2 bit intersection of NSS. Use following table/Matrix as guide for solving
5794 * K-Maps
5795 * MCS 1\MCS 2 00 01 10 11
5796 * 00 00 00 00 11
5797 * 01 00 01 01 11
5798 * 10 00 01 10 11
5799 * 11 11 11 11 11
5800 * if output MCS is o1o0, then as per K-map reduction:
5801 * o0 = m1.m0 | n1.n0 | (~m1).m0.(n1^n0) | (~n1).n0.(m1^m0)
5802 * o1 = m1.m0 | n1.n0 | m1.(~m0).n1.(~n0)
5803 *
5804 * Please note: Calculating MCS intersection is 80211 protocol specific and
5805 * should be implemented in PE. WMA can use this macro rather than calling any
5806 * lim API to do the intersection.
5807 */
5808#define HE_INTERSECT_MCS_BITS_PER_NSS(m1, m0, n1, n0) \
5809 (((m1 & m0) | (n1 & n0) | (((~m1) & m0) & (n1 ^ n0)) | \
5810 (((~n1) & n0) & (m1 ^ m0))) | (((m1 & m0) | (n1 & n0) | \
5811 (m1 & ~m0 & n1 & ~n0)) << 1))
5812
5813/* following takes MCS as 2 bits */
5814#define HE_INTERSECT_MCS_PER_NSS(mcs_1, mcs_2) \
5815 HE_INTERSECT_MCS_BITS_PER_NSS((mcs_1 >> 1), (mcs_1 & 1), \
5816 (mcs_2 >> 1), (mcs_2 & 1))
5817
5818/* following takes MCS as 16 bits */
5819#define HE_INTERSECT_MCS(mcs_1, mcs_2) ( \
5820 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 1), \
5821 HE_GET_MCS_4_NSS(mcs_2, 1)) << HE_MCS_NSS_SHIFT(1) | \
5822 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 2), \
5823 HE_GET_MCS_4_NSS(mcs_2, 2)) << HE_MCS_NSS_SHIFT(2) | \
5824 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 3), \
5825 HE_GET_MCS_4_NSS(mcs_2, 3)) << HE_MCS_NSS_SHIFT(3) | \
5826 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 4), \
5827 HE_GET_MCS_4_NSS(mcs_2, 4)) << HE_MCS_NSS_SHIFT(4) | \
5828 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 5), \
5829 HE_GET_MCS_4_NSS(mcs_2, 5)) << HE_MCS_NSS_SHIFT(5) | \
5830 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 6), \
5831 HE_GET_MCS_4_NSS(mcs_2, 6)) << HE_MCS_NSS_SHIFT(6) | \
5832 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 7), \
5833 HE_GET_MCS_4_NSS(mcs_2, 7)) << HE_MCS_NSS_SHIFT(7) | \
5834 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 8), \
5835 HE_GET_MCS_4_NSS(mcs_2, 8)) << HE_MCS_NSS_SHIFT(8))
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -07005836
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -08005837/**
5838 * struct he_capability - to store 11ax HE capabilities
5839 * @phy_cap: HE PHY capabilities
5840 * @mac_cap: HE MAC capabilities
5841 * @mcs: HE MCS
5842 * @ppet: HE PPE threshold
5843 */
5844struct he_capability {
5845 uint32_t phy_cap[HE_MAX_PHY_CAP_SIZE];
5846 uint32_t mac_cap;
5847 uint32_t mcs;
5848 struct wlan_psoc_host_ppe_threshold ppet;
5849};
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07005850#endif
5851
Naveen Rawataeca1b92017-10-16 16:55:31 -07005852#define HE_GET_NSS(mcs, nss) \
5853 do { \
5854 (nss) = 0; \
Naveen Rawatcbcc6542017-10-30 17:55:03 -07005855 while ((((mcs) >> ((nss)*2)) & 3) != 3 && nss < 8) \
Naveen Rawataeca1b92017-10-16 16:55:31 -07005856 (nss)++; \
5857 } while (0)
5858
Nitesh Shah99dd9552017-03-20 19:27:47 +05305859/**
5860 * struct sir_del_all_tdls_peers - delete all tdls peers
5861 * @msg_type: type of message
5862 * @msg_len: length of message
5863 * @bssid: bssid of peer device
5864 */
5865struct sir_del_all_tdls_peers {
5866 uint16_t msg_type;
5867 uint16_t msg_len;
5868 struct qdf_mac_addr bssid;
5869};
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08005870
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05305871/**
5872 * struct rsp_stats - arp packet stats
5873 * @arp_req_enqueue: fw tx count
5874 * @arp_req_tx_success: tx ack count
5875 * @arp_req_tx_failure: tx ack fail count
5876 * @arp_rsp_recvd: rx fw count
5877 * @out_of_order_arp_rsp_drop_cnt: out of order count
5878 * @dad_detected: dad detected
5879 * @connect_status: connection status
5880 * @ba_session_establishment_status: BA session status
Poddar, Siddarth465330e2018-01-08 18:23:54 +05305881 * @connect_stats_present: connectivity stats present or not
5882 * @tcp_ack_recvd: tcp syn ack's count
5883 * @icmpv4_rsp_recvd: icmpv4 responses count
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05305884 */
5885struct rsp_stats {
5886 uint32_t vdev_id;
5887 uint32_t arp_req_enqueue;
5888 uint32_t arp_req_tx_success;
5889 uint32_t arp_req_tx_failure;
5890 uint32_t arp_rsp_recvd;
5891 uint32_t out_of_order_arp_rsp_drop_cnt;
5892 uint32_t dad_detected;
5893 uint32_t connect_status;
5894 uint32_t ba_session_establishment_status;
Poddar, Siddarth465330e2018-01-08 18:23:54 +05305895 bool connect_stats_present;
5896 uint32_t tcp_ack_recvd;
5897 uint32_t icmpv4_rsp_recvd;
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05305898};
5899
5900/**
5901 * struct set_arp_stats_params - set/reset arp stats
5902 * @vdev_id: session id
5903 * @flag: enable/disable stats
5904 * @pkt_type: type of packet(1 - arp)
5905 * @ip_addr: subnet ipv4 address in case of encrypted packets
Poddar, Siddarth465330e2018-01-08 18:23:54 +05305906 * @pkt_type_bitmap: pkt bitmap
5907 * @tcp_src_port: tcp src port for pkt tracking
5908 * @tcp_dst_port: tcp dst port for pkt tracking
5909 * @icmp_ipv4: target ipv4 address to track ping packets
5910 * @reserved: reserved
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05305911 */
5912struct set_arp_stats_params {
5913 uint32_t vdev_id;
5914 uint8_t flag;
5915 uint8_t pkt_type;
5916 uint32_t ip_addr;
Poddar, Siddarth465330e2018-01-08 18:23:54 +05305917 uint32_t pkt_type_bitmap;
5918 uint32_t tcp_src_port;
5919 uint32_t tcp_dst_port;
5920 uint32_t icmp_ipv4;
5921 uint32_t reserved;
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05305922};
5923
5924/**
5925 * struct get_arp_stats_params - get arp stats from firmware
5926 * @pkt_type: packet type(1 - ARP)
5927 * @vdev_id: session id
5928 */
5929struct get_arp_stats_params {
5930 uint8_t pkt_type;
5931 uint32_t vdev_id;
5932};
5933
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05305934typedef void (*sme_rcpi_callback)(void *context, struct qdf_mac_addr mac_addr,
5935 int32_t rcpi, QDF_STATUS status);
5936/**
5937 * struct sme_rcpi_req - structure for querying rcpi info
5938 * @session_id: session for which rcpi is required
5939 * @measurement_type: type of measurement from enum rcpi_measurement_type
5940 * @rcpi_callback: callback function to be invoked for rcpi response
5941 * @rcpi_context: context info for rcpi callback
5942 * @mac_addr: peer addr for which rcpi is required
5943 */
5944struct sme_rcpi_req {
5945 uint32_t session_id;
5946 enum rcpi_measurement_type measurement_type;
5947 sme_rcpi_callback rcpi_callback;
5948 void *rcpi_context;
5949 struct qdf_mac_addr mac_addr;
5950};
5951
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08005952/*
5953 * @SCAN_REJECT_DEFAULT: default value
5954 * @CONNECTION_IN_PROGRESS: connection is in progress
5955 * @REASSOC_IN_PROGRESS: reassociation is in progress
5956 * @EAPOL_IN_PROGRESS: STA/P2P-CLI is in middle of EAPOL/WPS exchange
5957 * @SAP_EAPOL_IN_PROGRESS: SAP/P2P-GO is in middle of EAPOL/WPS exchange
5958 */
5959enum scan_reject_states {
5960 SCAN_REJECT_DEFAULT = 0,
5961 CONNECTION_IN_PROGRESS,
5962 REASSOC_IN_PROGRESS,
5963 EAPOL_IN_PROGRESS,
5964 SAP_EAPOL_IN_PROGRESS,
5965};
Sandeep Puligillaf587adf2017-04-27 19:53:21 -07005966
5967/**
lifeng66831662017-05-19 16:01:35 +08005968 * sir_sme_rx_aggr_hole_ind - sme rx aggr hole indication
5969 * @hole_cnt: num of holes detected
5970 * @hole_info_array: hole info
5971 */
5972struct sir_sme_rx_aggr_hole_ind {
5973 uint32_t hole_cnt;
5974 uint32_t hole_info_array[];
5975};
5976
5977/**
5978 * struct sir_set_rx_reorder_timeout_val - rx reorder timeout
5979 * @rx_timeout_pri: reorder timeout for AC
5980 * rx_timeout_pri[0] : AC_VO
5981 * rx_timeout_pri[1] : AC_VI
5982 * rx_timeout_pri[2] : AC_BE
5983 * rx_timeout_pri[3] : AC_BK
5984 */
5985struct sir_set_rx_reorder_timeout_val {
5986 uint32_t rx_timeout_pri[4];
5987};
5988
5989/**
5990 * struct sir_peer_set_rx_blocksize - set rx blocksize
5991 * @vdev_id: vdev id
5992 * @peer_macaddr: peer mac address
5993 * @rx_block_ack_win_limit: windows size limitation
5994 */
5995struct sir_peer_set_rx_blocksize {
5996 uint32_t vdev_id;
5997 struct qdf_mac_addr peer_macaddr;
5998 uint32_t rx_block_ack_win_limit;
5999};
Abhishek Singhf3756fc2017-06-28 16:04:06 +05306000
6001/**
6002 * struct sir_rssi_disallow_lst - Structure holding Rssi based avoid candidate
6003 * list
6004 * @node: Node pointer
6005 * @bssid: BSSID of the AP
6006 * @retry_delay: Retry delay received during last rejection in ms
6007 * @ expected_rssi: RSSI at which STA can initate
6008 * @time_during_rejection: Timestamp during last rejection in millisec
6009 */
6010struct sir_rssi_disallow_lst {
6011 qdf_list_node_t node;
6012 struct qdf_mac_addr bssid;
6013 uint32_t retry_delay;
6014 int8_t expected_rssi;
6015 qdf_time_t time_during_rejection;
6016};
lifengd217d192017-05-09 19:44:16 +08006017
6018/**
6019 * struct chain_rssi_result - chain rssi result
Jeff Johnson00634ab2018-05-10 14:27:50 -07006020 * num_chains_valid: valid chain num
lifengd217d192017-05-09 19:44:16 +08006021 * @chain_rssi: chain rssi result as dBm unit
lifengfe6c3e22018-04-03 12:10:04 +08006022 * @ant_id: antenna id
lifengd217d192017-05-09 19:44:16 +08006023 */
lifengfe6c3e22018-04-03 12:10:04 +08006024#define CHAIN_MAX_NUM 8
lifengd217d192017-05-09 19:44:16 +08006025struct chain_rssi_result {
lifengfe6c3e22018-04-03 12:10:04 +08006026 uint32_t num_chains_valid;
6027 uint32_t chain_rssi[CHAIN_MAX_NUM];
6028 uint32_t ant_id[CHAIN_MAX_NUM];
lifengd217d192017-05-09 19:44:16 +08006029};
6030
6031/**
6032 * struct get_chain_rssi_req_params - get chain rssi req params
6033 * @peer_macaddr: specific peer mac address
6034 * @session_id: session id
6035 */
6036struct get_chain_rssi_req_params {
6037 struct qdf_mac_addr peer_macaddr;
6038 uint8_t session_id;
6039};
6040
Ganesh Kondabattini35739572017-06-21 16:26:39 +05306041/*
6042 * struct sir_limit_off_chan - limit off-channel command parameters
6043 * @vdev_id: vdev id
6044 * @is_tos_active: status of the traffic (active/inactive)
6045 * @max_off_chan_time: max allowed off channel time
6046 * @rest_time: home channel time
6047 * @skip_dfs_chans: skip dfs channels during scan
6048 */
6049struct sir_limit_off_chan {
6050 uint8_t vdev_id;
6051 bool is_tos_active;
6052 uint32_t max_off_chan_time;
6053 uint32_t rest_time;
6054 bool skip_dfs_chans;
6055};
Padma, Santhosh Kumarb38ab512018-01-16 16:16:46 +05306056
Rajeev Kumar Sirasanagandla4f20b672018-03-12 13:52:50 +05306057typedef void (*roam_scan_stats_cb)(void *context,
6058 struct wmi_roam_scan_stats_res *res);
6059
6060/**
6061 * struct sir_roam_scan_stats - Stores roam scan context
6062 * @vdev_id: vdev id
6063 * @cb: callback to be invoked for roam scan stats response
6064 * @context: context of callback
6065 */
6066struct sir_roam_scan_stats {
6067 uint32_t vdev_id;
6068 roam_scan_stats_cb cb;
6069 void *context;
6070};
6071
Padma, Santhosh Kumarb38ab512018-01-16 16:16:46 +05306072/**
6073 * struct sae_info - SAE info used for commit/confirm messages
6074 * @msg_type: Message type
6075 * @msg_len: length of message
6076 * @vdev_id: vdev id
6077 * @peer_mac_addr: peer MAC address
6078 * @ssid: SSID
6079 */
6080struct sir_sae_info {
6081 uint16_t msg_type;
6082 uint16_t msg_len;
6083 uint32_t vdev_id;
6084 struct qdf_mac_addr peer_mac_addr;
6085 tSirMacSSid ssid;
6086};
Padma, Santhosh Kumardd3f4852018-01-16 18:51:51 +05306087
6088/**
6089 * struct sir_sae_msg - SAE msg used for message posting
6090 * @message_type: message type
6091 * @length: message length
6092 * @session_id: SME session id
6093 * @sae_status: SAE status, 0: Success, Non-zero: Failure.
6094 */
6095struct sir_sae_msg {
6096 uint16_t message_type;
6097 uint16_t length;
6098 uint16_t session_id;
6099 uint8_t sae_status;
6100};
6101
Varun Reddy Yeturu951de5d2018-09-10 21:36:22 -07006102/**
6103 * struct set_pcl_req - Request message to set the PCL
6104 * @chan_weights: PCL channel weights
6105 * @band: Supported band
6106 */
6107struct set_pcl_req {
6108 struct wmi_pcl_chan_weights chan_weights;
6109 enum band_info band;
6110};
6111
Visweswara Tanuku633976b2019-01-07 16:13:12 +05306112/**
6113 * struct sir_md_evt - motion detection event status
6114 * @vdev_id: vdev id
6115 * @status: md event status
6116 */
6117#ifdef WLAN_FEATURE_MOTION_DETECTION
6118struct sir_md_evt {
6119 uint8_t vdev_id;
6120 uint32_t status;
6121};
6122#endif /* WLAN_FEATURE_MOTION_DETECTION */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08006123#endif /* __SIR_API_H */