blob: 1d0b7339d004a6c2b44595a94b407631b264e516 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +05302 * Copyright (c) 2012-2018 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 */
33typedef struct mac_context *tpAniSirGlobal;
Anurag Chouhan5de8d172016-07-13 14:44:28 +053034
Amar Singhale4f28ee2015-10-21 14:36:56 -070035#include "qdf_types.h"
Amar Singhale4f28ee2015-10-21 14:36:56 -070036#include "cds_regdomain.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080037#include "sir_types.h"
38#include "sir_mac_prot_def.h"
39#include "ani_system_defs.h"
40#include "sir_params.h"
Naveen Rawat3b6068c2016-04-14 19:01:06 -070041#include "cds_regdomain.h"
Dustin Brown877a5a92016-11-17 13:56:52 -080042#include "wmi_unified.h"
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +053043#include "wmi_unified_param.h"
Zhang Qiana6e9c102016-12-22 16:47:24 +080044#include "ol_txrx_htt_api.h"
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -070045#include "wlan_reg_services_api.h"
Anurag Chouhan5de8d172016-07-13 14:44:28 +053046#include <dot11f.h>
Tushnim Bhattacharyya9e81b4c2017-02-15 17:11:14 -080047#include "wlan_policy_mgr_api.h"
Bala Venkatesh4a72b062018-11-13 13:04:49 +053048#include "wlan_tdls_public_structs.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080049
Rachit Kankane154559c2018-07-12 14:02:30 +053050#ifndef SIR_MAX_SUPPORTED_BSS
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -080051#define SIR_MAX_SUPPORTED_BSS 5
Rachit Kankane154559c2018-07-12 14:02:30 +053052#endif
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -080053
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080054#define OFFSET_OF(structType, fldName) (&((structType *)0)->fldName)
55
56/* / Max supported channel list */
57#define SIR_MAX_SUPPORTED_CHANNEL_LIST 96
58
59#define SIR_MDIE_ELEMENT_ID 54
Srinivas Girigowdad65dc5a2016-01-14 17:08:26 -080060#define SIR_MDIE_SIZE 3 /* MD ID(2 bytes), Capability(1 byte) */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080061
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +053062#define SIR_MAX_ELEMENT_ID 255
63
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080064/* Max number of channels are 165, but to access 165th element of array,
65 *array of 166 is required.
66 */
67#define SIR_MAX_24G_5G_CHANNEL_RANGE 166
68#define SIR_BCN_REPORT_MAX_BSS_DESC 4
69
70#define SIR_NUM_11B_RATES 4 /* 1,2,5.5,11 */
71#define SIR_NUM_11A_RATES 8 /* 6,9,12,18,24,36,48,54 */
72
73#define SIR_PM_SLEEP_MODE 0
74#define SIR_PM_ACTIVE_MODE 1
75
76/* hidden SSID options */
77#define SIR_SCAN_NO_HIDDEN_SSID 0
78#define SIR_SCAN_HIDDEN_SSID_PE_DECISION 1
79
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080080#define SIR_IPV4_ADDR_LEN 4
81
82typedef uint8_t tSirIpv4Addr[SIR_IPV4_ADDR_LEN];
83
84#define SIR_VERSION_STRING_LEN 64
85typedef uint8_t tSirVersionString[SIR_VERSION_STRING_LEN];
86
87/* Periodic Tx pattern offload feature */
88#define PERIODIC_TX_PTRN_MAX_SIZE 1536
89#define MAXNUM_PERIODIC_TX_PTRNS 6
90#define WIFI_SCANNING_MAC_OUI_LENGTH 3
91
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080092/* This should not be greater than MAX_NUMBER_OF_CONC_CONNECTIONS */
93#define MAX_VDEV_SUPPORTED 4
94
Manjeet Singhf82ed072016-07-08 11:40:00 +053095#define MAX_POWER_DBG_ARGS_SUPPORTED 8
Agrawal Ashishad16bda2016-09-16 20:16:04 +053096#define QOS_MAP_MAX_EX 21
97#define QOS_MAP_LEN_MIN 16
98#define QOS_MAP_LEN_MAX \
99 (QOS_MAP_LEN_MIN + 2 * QOS_MAP_MAX_EX)
Himanshu Agarwal37e42412016-07-21 14:35:09 +0530100#define NUM_CHAINS_MAX 2
101
Abhishek Singhf3756fc2017-06-28 16:04:06 +0530102#define MAX_RSSI_AVOID_BSSID_LIST 10
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530103
104/* Maximum number of realms present in fils indication element */
105#define SIR_MAX_REALM_COUNT 7
106/* Realm length */
107#define SIR_REALM_LEN 2
108/* Cache ID length */
109#define CACHE_ID_LEN 2
110
Will Huang496b36c2017-07-11 16:38:50 +0800111/* Maximum peer station number query one time */
112#define MAX_PEER_STA 12
113
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -0800114/* Maximum number of peers for SAP */
Rachit Kankane154559c2018-07-12 14:02:30 +0530115#ifndef SIR_SAP_MAX_NUM_PEERS
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -0800116#define SIR_SAP_MAX_NUM_PEERS 32
Rachit Kankane154559c2018-07-12 14:02:30 +0530117#endif
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -0800118
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800119#define SIR_KRK_KEY_LEN 16
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800120#define SIR_BTK_KEY_LEN 32
121#define SIR_KCK_KEY_LEN 16
122#define SIR_KEK_KEY_LEN 16
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +0530123#define SIR_KEK_KEY_LEN_FILS 64
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800124#define SIR_REPLAY_CTR_LEN 8
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +0530125#define SIR_PMK_LEN 48
126#define SIR_PMKID_LEN 16
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -0800127#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800128#define SIR_UAPSD_BITOFFSET_ACVO 0
129#define SIR_UAPSD_BITOFFSET_ACVI 1
130#define SIR_UAPSD_BITOFFSET_ACBK 2
131#define SIR_UAPSD_BITOFFSET_ACBE 3
132
133#define SIR_UAPSD_FLAG_ACVO (1 << SIR_UAPSD_BITOFFSET_ACVO)
134#define SIR_UAPSD_FLAG_ACVI (1 << SIR_UAPSD_BITOFFSET_ACVI)
135#define SIR_UAPSD_FLAG_ACBK (1 << SIR_UAPSD_BITOFFSET_ACBK)
136#define SIR_UAPSD_FLAG_ACBE (1 << SIR_UAPSD_BITOFFSET_ACBE)
137#define SIR_UAPSD_GET(ac, mask) (((mask) & (SIR_UAPSD_FLAG_ ## ac)) >> SIR_UAPSD_BITOFFSET_ ## ac)
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800138
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800139#endif
140
Nachiket Kukade63bb63d2018-11-21 14:42:14 +0530141struct scheduler_msg;
142
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800143/**
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700144 * enum sir_roam_op_code - Operation to be done by the callback.
145 * @SIR_ROAM_SYNCH_PROPAGATION: Propagate the new BSS info after roaming.
146 * @SIR_ROAMING_DEREGISTER_STA: Deregister the old STA after roaming.
Naveen Rawat8cc23b02016-07-14 12:22:56 -0700147 * @SIR_ROAMING_START: Firmware started roaming operation
148 * @SIR_ROAMING_ABORT: Firmware aborted roaming operation, still connected.
149 * @SIR_ROAM_SYNCH_COMPLETE: Roam sync propagation is complete.
Arif Hussain43354e62017-05-24 11:24:25 -0700150 * @SIR_ROAMING_INVOKE_FAIL: Firmware roaming failed.
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700151 */
152enum sir_roam_op_code {
153 SIR_ROAM_SYNCH_PROPAGATION = 1,
154 SIR_ROAMING_DEREGISTER_STA,
Naveen Rawat8cc23b02016-07-14 12:22:56 -0700155 SIR_ROAMING_START,
156 SIR_ROAMING_ABORT,
157 SIR_ROAM_SYNCH_COMPLETE,
Varun Reddy Yeturu04251862016-09-16 10:33:19 -0700158 SIR_ROAM_SYNCH_NAPI_OFF,
Arif Hussain43354e62017-05-24 11:24:25 -0700159 SIR_ROAMING_INVOKE_FAIL,
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700160};
161/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800162 * Module ID definitions.
163 */
164enum {
165 SIR_BOOT_MODULE_ID = 1,
166 SIR_HAL_MODULE_ID = 0x10,
167 SIR_CFG_MODULE_ID = 0x12,
168 SIR_LIM_MODULE_ID,
169 SIR_ARQ_MODULE_ID,
170 SIR_SCH_MODULE_ID,
171 SIR_PMM_MODULE_ID,
172 SIR_MNT_MODULE_ID,
173 SIR_DBG_MODULE_ID,
174 SIR_DPH_MODULE_ID,
175 SIR_SYS_MODULE_ID,
176 SIR_SMS_MODULE_ID,
177};
178
179#define SIR_WMA_MODULE_ID SIR_HAL_MODULE_ID
180
181/**
182 * First and last module definition for logging utility
183 *
184 * NOTE: The following definitions need to be updated if
185 * the above list is changed.
186 */
187#define SIR_FIRST_MODULE_ID SIR_HAL_MODULE_ID
188#define SIR_LAST_MODULE_ID SIR_SMS_MODULE_ID
189
190/* Type declarations used by Firmware and Host software */
191
192/* Scan type enum used in scan request */
193typedef enum eSirScanType {
194 eSIR_PASSIVE_SCAN,
195 eSIR_ACTIVE_SCAN,
196 eSIR_BEACON_TABLE,
197} tSirScanType;
198
gaurank kathpaliac63859d2018-05-03 18:48:41 +0530199/* Rsn Capabilities structure */
200struct rsn_caps {
201 uint16_t PreAuthSupported:1;
202 uint16_t NoPairwise:1;
203 uint16_t PTKSAReplayCounter:2;
204 uint16_t GTKSAReplayCounter:2;
205 uint16_t MFPRequired:1;
206 uint16_t MFPCapable:1;
207 uint16_t Reserved:8;
208};
209
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800210/* / Result codes Firmware return to Host SW */
211typedef enum eSirResultCodes {
212 eSIR_SME_SUCCESS,
Abhishek Singh4294f802017-08-10 16:37:07 +0530213 eSIR_LOGE_EXCEPTION,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800214 eSIR_SME_INVALID_PARAMETERS = 500,
215 eSIR_SME_UNEXPECTED_REQ_RESULT_CODE,
216 eSIR_SME_RESOURCES_UNAVAILABLE,
217 /* Unable to find a BssDescription */
218 eSIR_SME_SCAN_FAILED,
219 /* matching requested scan criteria */
220 eSIR_SME_BSS_ALREADY_STARTED_OR_JOINED,
221 eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE,
222 eSIR_SME_REFUSED,
223 eSIR_SME_JOIN_DEAUTH_FROM_AP_DURING_ADD_STA,
224 eSIR_SME_JOIN_TIMEOUT_RESULT_CODE,
225 eSIR_SME_AUTH_TIMEOUT_RESULT_CODE,
226 eSIR_SME_ASSOC_TIMEOUT_RESULT_CODE,
227 eSIR_SME_REASSOC_TIMEOUT_RESULT_CODE,
228 eSIR_SME_MAX_NUM_OF_PRE_AUTH_REACHED,
229 eSIR_SME_AUTH_REFUSED,
230 eSIR_SME_INVALID_WEP_DEFAULT_KEY,
231 eSIR_SME_NO_KEY_MAPPING_KEY_FOR_PEER,
232 eSIR_SME_ASSOC_REFUSED,
233 eSIR_SME_REASSOC_REFUSED,
234 /* Recvd Deauth while join/pre-auth */
235 eSIR_SME_DEAUTH_WHILE_JOIN,
236 eSIR_SME_STA_NOT_AUTHENTICATED,
237 eSIR_SME_STA_NOT_ASSOCIATED,
238 eSIR_SME_ALREADY_JOINED_A_BSS,
239 /* Given in SME_SCAN_RSP msg */
240 eSIR_SME_MORE_SCAN_RESULTS_FOLLOW,
241 /* that more SME_SCAN_RSP */
242 /* messages are following. */
243 /* SME_SCAN_RSP message with */
244 /* eSIR_SME_SUCCESS status */
245 /* code is the last one. */
246 /* Sent in SME_JOIN/REASSOC_RSP */
247 eSIR_SME_INVALID_ASSOC_RSP_RXED,
248 /* messages upon receiving */
249 /* invalid Re/Assoc Rsp frame. */
250 /* STOP BSS triggered by MIC failures: MAC software to
251 * disassoc all stations
252 */
253 eSIR_SME_MIC_COUNTER_MEASURES,
254 /* with MIC_FAILURE reason code and perform the stop bss operation */
255 /* didn't get rsp from peer within timeout interval */
256 eSIR_SME_ADDTS_RSP_TIMEOUT,
257 /* didn't get success rsp from HAL */
258 eSIR_SME_ADDTS_RSP_FAILED,
259 /* failed to send ch switch act frm */
260 eSIR_SME_CHANNEL_SWITCH_FAIL,
261 eSIR_SME_INVALID_STATE,
262 /* SIR_HAL_SIR_HAL_INIT_SCAN_RSP returned failed status */
263 eSIR_SME_HAL_SCAN_INIT_FAILED,
264 /* SIR_HAL_END_SCAN_RSP returned failed status */
265 eSIR_SME_HAL_SCAN_END_FAILED,
266 /* SIR_HAL_FINISH_SCAN_RSP returned failed status */
267 eSIR_SME_HAL_SCAN_FINISH_FAILED,
268 /* Failed to send a message to HAL */
269 eSIR_SME_HAL_SEND_MESSAGE_FAIL,
270 /* Failed to stop the bss */
271 eSIR_SME_STOP_BSS_FAILURE,
272 eSIR_SME_WOWL_ENTER_REQ_FAILED,
273 eSIR_SME_WOWL_EXIT_REQ_FAILED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800274 eSIR_SME_FT_REASSOC_TIMEOUT_FAILURE,
275 eSIR_SME_FT_REASSOC_FAILURE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800276 eSIR_SME_SEND_ACTION_FAIL,
277 eSIR_SME_DEAUTH_STATUS,
278 eSIR_PNO_SCAN_SUCCESS,
Varun Reddy Yeturu371404b2017-11-30 15:31:35 -0800279 eSIR_SME_INVALID_SESSION,
Varun Reddy Yeturua47f08f2018-08-07 14:45:31 -0700280 eSIR_SME_PEER_CREATE_FAILED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800281 eSIR_DONOT_USE_RESULT_CODE = SIR_MAX_ENUM_SIZE
282} tSirResultCodes;
283
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +0530284#ifdef WLAN_FEATURE_FILS_SK
285struct fils_join_rsp_params {
286 uint8_t *fils_pmk;
287 uint8_t fils_pmk_len;
288 uint8_t fils_pmkid[PMKID_LEN];
289 uint8_t kek[MAX_KEK_LEN];
290 uint8_t kek_len;
291 uint8_t tk[MAX_TK_LEN];
292 uint8_t tk_len;
293 uint8_t gtk_len;
294 uint8_t gtk[MAX_GTK_LEN];
Vignesh Viswanathana1bb0922017-09-15 12:58:48 +0530295 struct qdf_mac_addr dst_mac;
296 struct qdf_mac_addr src_mac;
297 uint16_t hlp_data_len;
298 uint8_t hlp_data[FILS_MAX_HLP_DATA_LEN];
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +0530299};
300#endif
301
Krishna Kumaar Natarajanf599c6e2015-11-03 11:44:03 -0800302#define RMENABLEDCAP_MAX_LEN 5
303
304struct rrm_config_param {
305 uint8_t rrm_enabled;
306 uint8_t max_randn_interval;
307 uint8_t rm_capability[RMENABLEDCAP_MAX_LEN];
308};
309
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800310/*
311 * although in tSirSupportedRates each IE is 16bit but PE only passes IEs in 8
312 * bits with MSB=1 for basic rates. change the mask for bit0-7 only so HAL gets
313 * correct basic rates for setting response rates.
314 */
315#define IERATE_BASICRATE_MASK 0x80
316#define IERATE_RATE_MASK 0x7f
317#define IERATE_IS_BASICRATE(x) ((x) & IERATE_BASICRATE_MASK)
318
Sreelakshmi Konamki39acb132015-12-16 13:06:22 +0530319const char *lim_bss_type_to_string(const uint16_t bss_type);
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700320/**
321 * struct sSirSupportedRates - stores rates/MCS supported
322 * @llbRates: 11b rates in unit of 500kbps
323 * @llaRates: 11a rates in unit of 500kbps
324 * @supportedMCSSet: supported basic MCS, 0-76 bits used, remaining reserved
325 * bits 0-15 and 32 should be set.
326 * @rxHighestDataRate: RX Highest Supported Data Rate defines the highest data
327 * rate that the STA is able to receive, in unites of 1Mbps
328 * This value is derived from "Supported MCS Set field"
329 * inside the HT capability element.
330 * @vhtRxMCSMap: Indicates the Maximum MCS(VHT) that can be received for each
331 * number of spacial streams
332 * @vhtRxHighestDataRate: Indicate the highest VHT data rate that the STA is
333 * able to receive
334 * @vhtTxMCSMap: Indicates the Maximum MCS(VHT) that can be transmitted for
335 * each number of spacial streams
336 * @vhtTxHighestDataRate: Indicate the highest VHT data rate that the STA is
337 * able to transmit
338 * @he_rx_mcs: Indicates the Maximum MCS(HE) that can be received for each
339 * number of spacial streams
340 * @he_tx_mcs: Indicates the Maximum MCS(HE) that can be transmitted for each
341 * number of spacial streams
342 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800343typedef struct sSirSupportedRates {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800344 uint16_t llbRates[SIR_NUM_11B_RATES];
345 uint16_t llaRates[SIR_NUM_11A_RATES];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800346 uint8_t supportedMCSSet[SIR_MAC_MAX_SUPPORTED_MCS_SET];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800347 uint16_t rxHighestDataRate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800348 uint16_t vhtRxMCSMap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800349 uint16_t vhtRxHighestDataRate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800350 uint16_t vhtTxMCSMap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800351 uint16_t vhtTxHighestDataRate;
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700352#ifdef WLAN_FEATURE_11AX
Naveen Rawataeca1b92017-10-16 16:55:31 -0700353 uint16_t rx_he_mcs_map_lt_80;
354 uint16_t tx_he_mcs_map_lt_80;
355 uint16_t rx_he_mcs_map_160;
356 uint16_t tx_he_mcs_map_160;
357 uint16_t rx_he_mcs_map_80_80;
358 uint16_t tx_he_mcs_map_80_80;
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700359#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800360} tSirSupportedRates, *tpSirSupportedRates;
361
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800362typedef struct sSirRemainOnChnReq {
363 uint16_t messageType;
364 uint16_t length;
365 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530366 struct qdf_mac_addr selfMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800367 uint8_t chnNum;
368 uint8_t phyMode;
369 uint32_t duration;
370 uint8_t isProbeRequestAllowed;
371 uint32_t scan_id;
372 uint8_t probeRspIe[1];
373} tSirRemainOnChnReq, *tpSirRemainOnChnReq;
374
375/**
376 * struct sir_roc_rsp - Structure to store the remain on channel response
377 * @message_type: Message Type
378 * @length: Message Length
379 * @session_id: SME session Id
380 * @scan_id : scan identifier
381 * @status: result status
382 */
383struct sir_roc_rsp {
384 uint16_t message_type;
385 uint16_t length;
386 uint8_t session_id;
387 uint32_t scan_id;
388 tSirResultCodes status;
389};
390
391typedef struct sSirRegisterMgmtFrame {
392 uint16_t messageType;
393 uint16_t length;
394 uint8_t sessionId;
395 bool registerFrame;
396 uint16_t frameType;
397 uint16_t matchLen;
398 uint8_t matchData[1];
399} tSirRegisterMgmtFrame, *tpSirRegisterMgmtFrame;
400
401/* / Generic type for sending a response message */
402/* / with result code to host software */
403typedef struct sSirSmeRsp {
404 uint16_t messageType; /* eWNI_SME_*_RSP */
405 uint16_t length;
406 uint8_t sessionId; /* To support BT-AMP */
407 uint16_t transactionId; /* To support BT-AMP */
408 tSirResultCodes statusCode;
Kabilan Kannanf56f9d52017-04-05 03:31:34 -0700409 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800410} tSirSmeRsp, *tpSirSmeRsp;
411
412/* / Definition for indicating all modules ready on STA */
413typedef struct sSirSmeReadyReq {
414 uint16_t messageType; /* eWNI_SME_SYS_READY_IND */
415 uint16_t length;
416 uint16_t transactionId;
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800417 void *csr_roam_synch_cb;
418 void *pe_roam_synch_cb;
Vignesh Viswanathan3d478032018-08-02 20:18:53 +0530419 void *stop_roaming_cb;
Jeff Johnson5f9ce2d2018-06-09 21:20:45 -0700420 QDF_STATUS (*sme_msg_cb)(tpAniSirGlobal mac,
421 struct scheduler_msg *msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800422} tSirSmeReadyReq, *tpSirSmeReadyReq;
423
424/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800425 * struct s_sir_set_hw_mode - Set HW mode request
426 * @messageType: Message type
427 * @length: Length of the message
428 * @set_hw: Params containing the HW mode index and callback
429 */
430struct s_sir_set_hw_mode {
431 uint16_t messageType;
432 uint16_t length;
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -0800433 struct policy_mgr_hw_mode set_hw;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800434};
435
436/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800437 * struct sir_set_dual_mac_cfg - Set Dual mac config request
438 * @message_type: Message type
439 * @length: Length of the message
440 * @set_dual_mac: Params containing the dual mac config and callback
441 */
442struct sir_set_dual_mac_cfg {
443 uint16_t message_type;
444 uint16_t length;
Srinivas Girigowdaeb6ecf32018-02-15 17:04:22 -0800445 struct policy_mgr_dual_mac_config set_dual_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800446};
447
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800448/**
449 * struct sir_antenna_mode_param - antenna mode param
450 * @num_tx_chains: Number of TX chains
451 * @num_rx_chains: Number of RX chains
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800452 * @set_antenna_mode_resp: callback to set antenna mode command
Dundi Raviteja6bb9e322018-05-16 17:04:41 +0530453 * @set_antenna_mode_ctx: callback context to set antenna mode command
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800454 */
455struct sir_antenna_mode_param {
456 uint32_t num_tx_chains;
457 uint32_t num_rx_chains;
458 void *set_antenna_mode_resp;
Dundi Raviteja6bb9e322018-05-16 17:04:41 +0530459 void *set_antenna_mode_ctx;
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800460};
461
462/**
463 * struct sir_set_antenna_mode - Set antenna mode request
464 * @message_type: Message type
465 * @length: Length of the message
466 * @set_antenna_mode: Params containing antenna mode params
467 */
468struct sir_set_antenna_mode {
469 uint16_t message_type;
470 uint16_t length;
471 struct sir_antenna_mode_param set_antenna_mode;
472};
473
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700474/**
475 * enum tSirBssType - Enum for BSS type used in scanning/joining etc.
476 *
477 * @eSIR_INFRASTRUCTURE_MODE: Infrastructure station
478 * @eSIR_INFRA_AP_MODE: softAP mode
479 * @eSIR_IBSS_MODE: IBSS mode
480 * @eSIR_AUTO_MODE: Auto role
481 * @eSIR_MONITOR_MODE: Monitor mode
482 * @eSIR_NDI_MODE: NAN datapath mode
483 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800484typedef enum eSirBssType {
485 eSIR_INFRASTRUCTURE_MODE,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700486 eSIR_INFRA_AP_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800487 eSIR_IBSS_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800488 eSIR_AUTO_MODE,
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -0700489 eSIR_MONITOR_MODE,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700490 eSIR_NDI_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800491 eSIR_DONOT_USE_BSS_TYPE = SIR_MAX_ENUM_SIZE
492} tSirBssType;
493
494/* / Power Capability info used in 11H */
495typedef struct sSirMacPowerCapInfo {
496 uint8_t minTxPower;
497 uint8_t maxTxPower;
498} tSirMacPowerCapInfo, *tpSirMacPowerCapInfo;
499
500/* / Supported Channel info used in 11H */
501typedef struct sSirSupChnl {
502 uint8_t numChnl;
503 uint8_t channelList[SIR_MAX_SUPPORTED_CHANNEL_LIST];
504} tSirSupChnl, *tpSirSupChnl;
505
506typedef enum eSirNwType {
507 eSIR_11A_NW_TYPE,
508 eSIR_11B_NW_TYPE,
509 eSIR_11G_NW_TYPE,
510 eSIR_11N_NW_TYPE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800511 eSIR_11AC_NW_TYPE,
Krishna Kumaar Natarajan4f1d7722017-03-03 21:12:51 -0800512 eSIR_11AX_NW_TYPE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800513 eSIR_DONOT_USE_NW_TYPE = SIR_MAX_ENUM_SIZE
514} tSirNwType;
515
516/* / Definition for new iBss peer info */
517typedef struct sSirNewIbssPeerInfo {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530518 struct qdf_mac_addr peerAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800519 uint16_t aid;
520} tSirNewIbssPeerInfo, *tpSirNewIbssPeerInfo;
521
522/* HT configuration values */
523typedef struct sSirHtConfig {
524 /* Enable/Disable receiving LDPC coded packets */
525 uint32_t ht_rx_ldpc:1;
526 /* Enable/Disable TX STBC */
527 uint32_t ht_tx_stbc:1;
528 /* Enable/Disable RX STBC */
529 uint32_t ht_rx_stbc:2;
530 /* Enable/Disable SGI */
Sandeep Puligilla607f34a2016-05-25 14:37:47 -0700531 uint32_t ht_sgi20:1;
532 uint32_t ht_sgi40:1;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800533 uint32_t unused:27;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530534} qdf_packed tSirHTConfig, *tpSirHTConfig;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800535
Sandeep Puligilla98917432016-06-10 13:50:28 -0700536/**
Jeff Johnson118a4a02018-05-06 00:14:15 -0700537 * struct sir_vht_config - VHT capabilities
Sandeep Puligilla98917432016-06-10 13:50:28 -0700538 * @max_mpdu_len: MPDU length
539 * @supported_channel_widthset: channel width set
540 * @ldpc_coding: LDPC coding capability
541 * @shortgi80: short GI 80 support
542 * @shortgi160and80plus80: short Gi 160 & 80+80 support
543 * @tx_stbc; Tx STBC cap
544 * @tx_stbc: Rx STBC cap
545 * @su_beam_former: SU beam former cap
546 * @su_beam_formee: SU beam formee cap
547 * @csnof_beamformer_antSup: Antenna support for beamforming
548 * @num_soundingdim: Sound dimensions
549 * @mu_beam_former: MU beam former cap
550 * @mu_beam_formee: MU beam formee cap
551 * @vht_txops: TXOP power save
552 * @htc_vhtcap: HTC VHT capability
553 * @max_ampdu_lenexp: AMPDU length
554 * @vht_link_adapt: VHT link adapatation capable
555 * @rx_antpattern: Rx Antenna pattern
556 * @tx_antpattern: Tx Antenna pattern
557 */
558struct sir_vht_config {
559 uint32_t max_mpdu_len:2;
560 uint32_t supported_channel_widthset:2;
561 uint32_t ldpc_coding:1;
562 uint32_t shortgi80:1;
563 uint32_t shortgi160and80plus80:1;
564 uint32_t tx_stbc:1;
565 uint32_t rx_stbc:3;
566 uint32_t su_beam_former:1;
567 uint32_t su_beam_formee:1;
568 uint32_t csnof_beamformer_antSup:3;
569 uint32_t num_soundingdim:3;
570 uint32_t mu_beam_former:1;
571 uint32_t mu_beam_formee:1;
572 uint32_t vht_txops:1;
573 uint32_t htc_vhtcap:1;
574 uint32_t max_ampdu_lenexp:3;
575 uint32_t vht_link_adapt:2;
576 uint32_t rx_antpattern:1;
577 uint32_t tx_antpattern:1;
578 uint32_t unused:2;
579};
580
581
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800582typedef struct sSirAddIeParams {
583 uint16_t probeRespDataLen;
584 uint8_t *probeRespData_buff;
585 uint16_t assocRespDataLen;
586 uint8_t *assocRespData_buff;
587 uint16_t probeRespBCNDataLen;
588 uint8_t *probeRespBCNData_buff;
589} tSirAddIeParams, *tpSirAddIeParams;
590
591/* / Definition for kick starting BSS */
592/* / ---> MAC */
593/**
594 * Usage of ssId, numSSID & ssIdList:
595 * ---------------------------------
596 * 1. ssId.length of zero indicates that Broadcast/Suppress SSID
597 * feature is enabled.
598 * 2. If ssId.length is zero, MAC SW will advertise NULL SSID
599 * and interpret the SSID list from numSSID & ssIdList.
600 * 3. If ssId.length is non-zero, MAC SW will advertise the SSID
601 * specified in the ssId field and it is expected that
602 * application will set numSSID to one (only one SSID present
603 * in the list) and SSID in the list is same as ssId field.
604 * 4. Application will always set numSSID >= 1.
605 */
606/* ***** NOTE: Please make sure all codes are updated if inserting field into
607 * this structure..********** */
608typedef struct sSirSmeStartBssReq {
609 uint16_t messageType; /* eWNI_SME_START_BSS_REQ */
610 uint16_t length;
611 uint8_t sessionId; /* Added for BT-AMP Support */
612 uint16_t transactionId; /* Added for BT-AMP Support */
Anurag Chouhan6d760662016-02-20 16:05:43 +0530613 struct qdf_mac_addr bssid; /* Added for BT-AMP Support */
614 struct qdf_mac_addr self_macaddr; /* Added for BT-AMP Support */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800615 uint16_t beaconInterval; /* Added for BT-AMP Support */
616 uint8_t dot11mode;
617#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
618 uint8_t cc_switch_mode;
619#endif
620 tSirBssType bssType;
621 tSirMacSSid ssId;
622 uint8_t channelId;
623 ePhyChanBondState cbMode;
624 uint8_t vht_channel_width;
625 uint8_t center_freq_seg0;
626 uint8_t center_freq_seg1;
627 uint8_t sec_ch_offset;
628
629 uint8_t privacy;
630 uint8_t apUapsdEnable;
631 uint8_t ssidHidden;
632 bool fwdWPSPBCProbeReq;
633 bool protEnabled;
634 bool obssProtEnabled;
635 uint16_t ht_capab;
636 tAniAuthType authType;
637 uint32_t dtimPeriod;
638 uint8_t wps_state;
639 uint8_t isCoalesingInIBSSAllowed; /* Coalesing on/off knob */
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800640 enum QDF_OPMODE bssPersona;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800641
642 uint8_t txLdpcIniFeatureEnabled;
643
644 tSirRSNie rsnIE; /* RSN IE to be sent in */
645 /* Beacon and Probe */
646 /* Response frames */
647 tSirNwType nwType; /* Indicates 11a/b/g */
648 tSirMacRateSet operationalRateSet; /* Has 11a or 11b rates */
649 tSirMacRateSet extendedRateSet; /* Has 11g rates */
650 tSirHTConfig htConfig;
Sandeep Puligilla98917432016-06-10 13:50:28 -0700651 struct sir_vht_config vht_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800652#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -0700653 tDot11fIEhe_cap he_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800654#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800655#ifdef WLAN_FEATURE_11W
656 bool pmfCapable;
657 bool pmfRequired;
658#endif
659
660 tSirAddIeParams addIeParams;
661
662 bool obssEnabled;
663 uint8_t sap_dot11mc;
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800664 uint16_t beacon_tx_rate;
Kapil Gupta4b2efbb2016-10-03 13:07:20 +0530665 bool vendor_vht_sap;
Arif Hussain671a1902017-03-17 09:08:32 -0700666 uint32_t cac_duration_ms;
667 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800668
669} tSirSmeStartBssReq, *tpSirSmeStartBssReq;
670
671#define GET_IE_LEN_IN_BSS(lenInBss) (lenInBss + sizeof(lenInBss) - \
672 ((uintptr_t)OFFSET_OF(tSirBssDescription,\
673 ieFields)))
674
675#define WSCIE_PROBE_RSP_LEN (317 + 2)
676
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530677#ifdef WLAN_FEATURE_FILS_SK
678/* struct fils_ind_elements: elements parsed from fils indication present
679 * in beacon/probe resp
680 * @realm_cnt: number of realm present
681 * @realm: realms
682 * @is_fils_sk_supported: if FILS SK supported
683 * @is_cache_id_present: if cache id present
684 * @cache_id: cache id
685 */
686struct fils_ind_elements {
687 uint16_t realm_cnt;
688 uint8_t realm[SIR_MAX_REALM_COUNT][SIR_REALM_LEN];
689 bool is_fils_sk_supported;
690 bool is_cache_id_present;
691 uint8_t cache_id[CACHE_ID_LEN];
692};
693#endif
694
Jeff Johnsone58271f2017-10-06 09:58:59 -0700695struct bss_description {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800696 /* offset of the ieFields from bssId. */
697 uint16_t length;
698 tSirMacAddr bssId;
Arun Khandavalli8a711cb2017-01-03 20:23:56 +0530699 unsigned long scansystimensec;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800700 uint32_t timeStamp[2];
701 uint16_t beaconInterval;
702 uint16_t capabilityInfo;
703 tSirNwType nwType; /* Indicates 11a/b/g */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800704 int8_t rssi;
Deepak Dhamdhere68929ec2015-08-05 15:16:35 -0700705 int8_t rssi_raw;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800706 int8_t sinr;
707 /* channelId what peer sent in beacon/probersp. */
708 uint8_t channelId;
709 /* channelId on which we are parked at. */
710 /* used only in scan case. */
711 uint8_t channelIdSelf;
712 uint8_t sSirBssDescriptionRsvd[3];
Deepthi Gowri6acee342016-10-28 15:00:38 +0530713 /* Based on system time, not a relative time. */
714 uint64_t received_time;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800715 uint32_t parentTSF;
716 uint32_t startTSF[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800717 uint8_t mdiePresent;
718 /* MDIE for 11r, picked from the beacons */
719 uint8_t mdie[SIR_MDIE_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800720#ifdef FEATURE_WLAN_ESE
721 uint16_t QBSSLoad_present;
722 uint16_t QBSSLoad_avail;
723 /* To achieve 8-byte alignment with ESE enabled */
724 uint32_t reservedPadding5;
725#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800726 /* whether it is from a probe rsp */
727 uint8_t fProbeRsp;
Deepak Dhamdhere652d7e82015-08-06 14:16:53 -0700728 /* Actual channel the beacon/probe response was received on */
729 uint8_t rx_channel;
Krishna Kumaar Natarajan89a99d42016-08-04 15:44:38 -0700730 tSirMacSeqCtl seq_ctrl;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800731 uint32_t WscIeLen;
732 uint8_t WscIeProbeRsp[WSCIE_PROBE_RSP_LEN];
733 uint8_t reservedPadding4;
734 uint32_t tsf_delta;
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530735#ifdef WLAN_FEATURE_FILS_SK
736 struct fils_ind_elements fils_info_element;
737#endif
738 /* Please keep the structure 4 bytes aligned above the ieFields */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800739 uint32_t ieFields[1];
Jeff Johnsone58271f2017-10-06 09:58:59 -0700740};
741typedef struct bss_description tSirBssDescription, *tpSirBssDescription;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800742
743#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
744typedef struct sSirSmeHTProfile {
745 uint8_t dot11mode;
746 uint8_t htCapability;
747 uint8_t htSupportedChannelWidthSet;
748 uint8_t htRecommendedTxWidthSet;
749 ePhyChanBondState htSecondaryChannelOffset;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800750 uint8_t vhtCapability;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800751 uint8_t apCenterChan;
752 uint8_t apChanWidth;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800753} tSirSmeHTProfile;
754#endif
755/* / Definition for response message to previously */
756/* / issued start BSS request */
757/* / MAC ---> */
758typedef struct sSirSmeStartBssRsp {
759 uint16_t messageType; /* eWNI_SME_START_BSS_RSP */
760 uint16_t length;
761 uint8_t sessionId;
762 uint16_t transactionId; /* transaction ID for cmd */
763 tSirResultCodes statusCode;
764 tSirBssType bssType; /* Add new type for WDS mode */
765 uint16_t beaconInterval; /* Beacon Interval for both type */
Jeff Johnson179fd8a2018-05-11 14:20:05 -0700766 uint32_t staId; /* Station ID for Self */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800767#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
768 tSirSmeHTProfile HTProfile;
769#endif
770 tSirBssDescription bssDescription; /* Peer BSS description */
771} tSirSmeStartBssRsp, *tpSirSmeStartBssRsp;
772
773typedef struct sSirChannelList {
774 uint8_t numChannels;
775 uint8_t channelNumber[SIR_ESE_MAX_MEAS_IE_REQS];
776} tSirChannelList, *tpSirChannelList;
777
778typedef struct sSirDFSChannelList {
779 uint32_t timeStamp[SIR_MAX_24G_5G_CHANNEL_RANGE];
780
781} tSirDFSChannelList, *tpSirDFSChannelList;
782
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800783/* / Two Background Scan mode */
784typedef enum eSirBackgroundScanMode {
785 eSIR_ROAMING_SCAN = 2,
786} tSirBackgroundScanMode;
787
788/* / Two types of traffic check */
789typedef enum eSirLinkTrafficCheck {
790 eSIR_DONT_CHECK_LINK_TRAFFIC_BEFORE_SCAN = 0,
791 eSIR_CHECK_LINK_TRAFFIC_BEFORE_SCAN = 1,
792 eSIR_CHECK_ROAMING_SCAN = 2,
793} tSirLinkTrafficCheck;
794
795#define SIR_BG_SCAN_RETURN_CACHED_RESULTS 0x0
796#define SIR_BG_SCAN_PURGE_RESUTLS 0x80
797#define SIR_BG_SCAN_RETURN_FRESH_RESULTS 0x01
798#define SIR_SCAN_MAX_NUM_SSID 0x0A
799#define SIR_BG_SCAN_RETURN_LFR_CACHED_RESULTS 0x02
800#define SIR_BG_SCAN_PURGE_LFR_RESULTS 0x40
801
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800802typedef struct sSirSmeScanAbortReq {
803 uint16_t type;
804 uint16_t msgLen;
805 uint8_t sessionId;
806 uint32_t scan_id;
807} tSirSmeScanAbortReq, *tpSirSmeScanAbortReq;
808
809typedef struct sSirSmeScanChanReq {
810 uint16_t type;
811 uint16_t msgLen;
812 uint8_t sessionId;
813 uint16_t transcationId;
814} tSirSmeGetScanChanReq, *tpSirSmeGetScanChanReq;
815
816#ifdef FEATURE_OEM_DATA_SUPPORT
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700817struct oem_data_req {
Gupta, Kapil8a605e12016-06-08 14:14:35 +0530818 uint32_t data_len;
Krishna Kumaar Natarajan9ac8efd2015-11-20 13:40:24 -0800819 uint8_t *data;
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700820};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800821
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700822struct oem_data_rsp {
Krishna Kumaar Natarajan608291e2015-12-14 18:17:27 -0800823 uint32_t rsp_len;
Krishna Kumaar Natarajan73ea9f22016-06-30 18:38:47 -0700824 uint8_t *data;
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700825};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800826#endif /* FEATURE_OEM_DATA_SUPPORT */
827
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800828#ifdef FEATURE_WLAN_ESE
yeshwanth sriram guntuka27e4ffc2016-12-01 18:00:17 +0530829typedef struct ese_wmm_tspec_ie {
830 uint16_t traffic_type:1;
831 uint16_t tsid:4;
832 uint16_t direction:2;
833 uint16_t access_policy:2;
834 uint16_t aggregation:1;
835 uint16_t psb:1;
836 uint16_t user_priority:3;
837 uint16_t tsinfo_ack_pol:2;
838 uint8_t tsinfo_rsvd:7;
839 uint8_t burst_size_defn:1;
840 uint16_t size:15;
841 uint16_t fixed:1;
842 uint16_t max_msdu_size;
843 uint32_t min_service_int;
844 uint32_t max_service_int;
845 uint32_t inactivity_int;
846 uint32_t suspension_int;
847 uint32_t service_start_time;
848 uint32_t min_data_rate;
849 uint32_t mean_data_rate;
850 uint32_t peak_data_rate;
851 uint32_t burst_size;
852 uint32_t delay_bound;
853 uint32_t min_phy_rate;
854 uint16_t surplus_bw_allowance;
855 uint16_t medium_time;
856} qdf_packed ese_wmm_tspec_ie;
857
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800858typedef struct sTspecInfo {
859 uint8_t valid;
860 tSirMacTspecIE tspec;
861} tTspecInfo;
862
863#define SIR_ESE_MAX_TSPEC_IES 4
864typedef struct sESETspecTspecInfo {
865 uint8_t numTspecs;
866 tTspecInfo tspec[SIR_ESE_MAX_TSPEC_IES];
867} tESETspecInfo;
868
869typedef struct sSirTsmIE {
870 uint8_t tsid;
871 uint8_t state;
872 uint16_t msmt_interval;
873} tSirTsmIE, *tpSirTsmIE;
874typedef struct sSirSmeTsmIEInd {
875 tSirTsmIE tsmIe;
876 uint8_t sessionId;
877} tSirSmeTsmIEInd, *tpSirSmeTsmIEInd;
878typedef struct sAniTrafStrmMetrics {
879 uint16_t UplinkPktQueueDly;
880 uint16_t UplinkPktQueueDlyHist[4];
881 uint32_t UplinkPktTxDly;
882 uint16_t UplinkPktLoss;
883 uint16_t UplinkPktCount;
884 uint8_t RoamingCount;
885 uint16_t RoamingDly;
886} tAniTrafStrmMetrics, *tpAniTrafStrmMetrics;
887
888typedef struct sAniGetTsmStatsReq {
889 /* Common for all types are requests */
890 uint16_t msgType; /* message type is same as the request type */
891 uint16_t msgLen; /* length of the entire request */
892 uint8_t staId;
893 uint8_t tid; /* traffic id */
894 struct qdf_mac_addr bssId;
895 void *tsmStatsCallback;
896 void *pDevContext; /* device context */
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800897} tAniGetTsmStatsReq, *tpAniGetTsmStatsReq;
898
899typedef struct sAniGetTsmStatsRsp {
900 /* Common for all types are responses */
901 uint16_t msgType; /*
902 * message type is same as
903 * the request type
904 */
905 uint16_t msgLen; /*
906 * length of the entire request,
907 * includes the pStatsBuf length too
908 */
909 uint8_t sessionId;
910 uint32_t rc; /* success/failure */
911 uint32_t staId; /*
912 * Per STA stats request must
913 * contain valid
914 */
915 tAniTrafStrmMetrics tsmMetrics;
916 void *tsmStatsReq; /* tsm stats request backup */
917} tAniGetTsmStatsRsp, *tpAniGetTsmStatsRsp;
918
919typedef struct sSirEseBcnReportBssInfo {
920 tBcnReportFields bcnReportFields;
921 uint8_t ieLen;
922 uint8_t *pBuf;
923} tSirEseBcnReportBssInfo, *tpSirEseBcnReportBssInfo;
924
925typedef struct sSirEseBcnReportRsp {
926 uint16_t measurementToken;
927 uint8_t flag; /* Flag to report measurement done and more data */
928 uint8_t numBss;
929 tSirEseBcnReportBssInfo bcnRepBssInfo[SIR_BCN_REPORT_MAX_BSS_DESC];
930} tSirEseBcnReportRsp, *tpSirEseBcnReportRsp;
931
932#define TSRS_11AG_RATE_6MBPS 0xC
933#define TSRS_11B_RATE_5_5MBPS 0xB
934typedef struct sSirMacESETSRSIE {
935 uint8_t tsid;
936 uint8_t rates[8];
937} tSirMacESETSRSIE;
938typedef struct sSirMacESETSMIE {
939 uint8_t tsid;
940 uint8_t state;
941 uint16_t msmt_interval;
942} tSirMacESETSMIE;
943typedef struct sTSMStats {
944 uint8_t tid;
945 struct qdf_mac_addr bssid;
946 tTrafStrmMetrics tsmMetrics;
947} tTSMStats, *tpTSMStats;
948typedef struct sEseTSMContext {
949 uint8_t tid;
950 tSirMacESETSMIE tsmInfo;
951 tTrafStrmMetrics tsmMetrics;
952} tEseTSMContext, *tpEseTSMContext;
953typedef struct sEsePEContext {
954 tEseTSMContext tsm;
955} tEsePEContext, *tpEsePEContext;
956
957typedef struct sSirPlmReq {
958 uint16_t diag_token; /* Dialog token */
959 uint16_t meas_token; /* measurement token */
960 uint16_t numBursts; /* total number of bursts */
961 uint16_t burstInt; /* burst interval in seconds */
962 uint16_t measDuration; /* in TU's,STA goes off-ch */
963 /* no of times the STA should cycle through PLM ch list */
964 uint8_t burstLen;
965 int8_t desiredTxPwr; /* desired tx power */
966 struct qdf_mac_addr mac_addr; /* MC dest addr */
967 /* no of channels */
968 uint8_t plmNumCh;
969 /* channel numbers */
970 uint8_t plmChList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
971 uint8_t sessionId;
972 bool enable;
973} tSirPlmReq, *tpSirPlmReq;
974
975#endif /* FEATURE_WLAN_ESE */
976
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800977/* / Definition for response message to previously issued scan request */
978typedef struct sSirSmeScanRsp {
979 uint16_t messageType; /* eWNI_SME_SCAN_RSP */
980 uint16_t length;
981 uint8_t sessionId;
982 tSirResultCodes statusCode;
983 uint16_t transcationId;
984 uint32_t scan_id;
985} tSirSmeScanRsp, *tpSirSmeScanRsp;
986
987/* / Definition for join request */
988/* / ---> MAC */
989/* / WARNING! If you add a field in JOIN REQ. */
990/* / Make sure to add it in REASSOC REQ */
991/* / The Serdes function is the same and its */
992/* / shared with REASSOC. So if we add a field */
993/* here and dont add it in REASSOC REQ. It will BREAK!!! REASSOC. */
994typedef struct sSirSmeJoinReq {
995 uint16_t messageType; /* eWNI_SME_JOIN_REQ */
996 uint16_t length;
997 uint8_t sessionId;
998 uint16_t transactionId;
999 tSirMacSSid ssId;
1000 tSirMacAddr selfMacAddr; /* self Mac address */
1001 tSirBssType bsstype; /* add new type for BT-AMP STA and AP Modules */
1002 uint8_t dot11mode; /* to support BT-AMP */
1003#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
1004 uint8_t cc_switch_mode;
1005#endif
Jeff Johnsonc1e62782017-11-09 09:50:17 -08001006 enum QDF_OPMODE staPersona; /* Persona */
Abhishek Singhf78bd2d2016-04-27 16:47:56 +05301007 bool wps_registration;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001008 ePhyChanBondState cbMode; /* Pass CB mode value in Join. */
1009
1010 /*This contains the UAPSD Flag for all 4 AC
1011 * B0: AC_VO UAPSD FLAG
1012 * B1: AC_VI UAPSD FLAG
1013 * B2: AC_BK UAPSD FLAG
1014 * B3: AC_BE UASPD FLAG
1015 */
1016 uint8_t uapsdPerAcBitmask;
1017
1018 tSirMacRateSet operationalRateSet; /* Has 11a or 11b rates */
1019 tSirMacRateSet extendedRateSet; /* Has 11g rates */
1020 tSirRSNie rsnIE; /* RSN IE to be sent in */
1021 /* (Re) Association Request */
1022#ifdef FEATURE_WLAN_ESE
1023 /* CCMK IE to be included as handler for join and reassoc is */
1024 tSirCCKMie cckmIE;
1025 /* the same. The join will never carry cckm, but will be set to */
1026 /* 0. */
1027#endif
1028
1029 tSirAddie addIEScan; /* Additional IE to be sent in */
1030 /* (unicast) Probe Request at the time of join */
1031
1032 tSirAddie addIEAssoc; /* Additional IE to be sent in */
1033 /* (Re) Association Request */
1034
1035 tAniEdType UCEncryptionType;
1036
1037 tAniEdType MCEncryptionType;
1038
1039#ifdef WLAN_FEATURE_11W
1040 tAniEdType MgmtEncryptionType;
1041#endif
1042
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001043 bool is11Rconnection;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001044#ifdef FEATURE_WLAN_ESE
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001045 bool isESEFeatureIniEnabled;
1046 bool isESEconnection;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001047 tESETspecInfo eseTspecInfo;
1048#endif
1049
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001050 bool isFastTransitionEnabled;
1051 bool isFastRoamIniFeatureEnabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001052
1053 uint8_t txLdpcIniFeatureEnabled;
1054 tSirHTConfig htConfig;
Sandeep Puligilla98917432016-06-10 13:50:28 -07001055 struct sir_vht_config vht_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08001056#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -07001057 tDot11fIEhe_cap he_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08001058#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001059 uint8_t enableVhtpAid;
1060 uint8_t enableVhtGid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001061 uint8_t enableAmpduPs;
1062 uint8_t enableHtSmps;
1063 uint8_t htSmps;
Archana Ramachandranfec24812016-02-16 16:31:56 -08001064 bool send_smps_action;
Kiran Kumar Lokere722dccd2018-02-23 13:23:52 -08001065 bool he_with_wep_tkip;
Deepak Dhamdhere612392c2016-08-28 02:56:51 -07001066 uint8_t max_amsdu_num;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001067 bool isWMEenabled;
1068 bool isQosEnabled;
1069 bool isOSENConnection;
Krishna Kumaar Natarajanf599c6e2015-11-03 11:44:03 -08001070 struct rrm_config_param rrm_config;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001071 bool spectrumMgtIndicator;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001072 tSirMacPowerCapInfo powerCap;
1073 tSirSupChnl supportedChannels;
Selvaraj, Sridhar05ea0792017-05-17 12:17:03 +05301074 bool enable_bcast_probe_rsp;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +05301075#ifdef WLAN_FEATURE_FILS_SK
1076 struct cds_fils_connection_info fils_con_info;
1077#endif
Padma, Santhosh Kumarb8f65d92017-09-14 13:05:42 +05301078 bool sae_pmk_cached;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +05301079 /* Pls make this as last variable in struct */
Abhishek Singhb59f8d42017-07-31 14:42:47 +05301080 bool force_24ghz_in_ht20;
Abhishek Singh6454ad32017-12-20 10:42:21 +05301081 bool force_rsne_override;
Vignesh Viswanathand5a5f2e2018-06-01 15:35:51 +05301082 bool supported_nss_1x1;
1083 uint8_t vdev_nss;
1084 uint8_t nss;
1085 bool nss_forced_1x1;
Arif Hussain6686c0b2018-08-21 18:21:05 -07001086 bool enable_session_twt_support;
Selvaraj, Sridhar81ab80d2017-06-08 12:21:39 +05301087 tSirBssDescription bssDescription;
1088 /*
1089 * WARNING: Pls make bssDescription as last variable in struct
1090 * tSirSmeJoinReq as it has ieFields followed after this bss
1091 * description. Adding a variable after this corrupts the ieFields
1092 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001093} tSirSmeJoinReq, *tpSirSmeJoinReq;
1094
Jeff Johnson47d75242018-05-12 15:58:53 -07001095/* / Definition for response message to previously issued join request */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001096/* / MAC ---> */
1097typedef struct sSirSmeJoinRsp {
1098 uint16_t messageType; /* eWNI_SME_JOIN_RSP */
1099 uint16_t length;
1100 uint8_t sessionId; /* Session ID */
1101 uint16_t transactionId; /* Transaction ID for cmd */
1102 tSirResultCodes statusCode;
1103 tAniAuthType authType;
1104 uint32_t vht_channel_width;
1105 /* It holds reasonCode when join fails due to deauth/disassoc frame.
1106 * Otherwise it holds status code.
1107 */
1108 uint16_t protStatusCode;
1109 uint16_t aid;
1110 uint32_t beaconLength;
1111 uint32_t assocReqLength;
1112 uint32_t assocRspLength;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001113 uint32_t parsedRicRspLen;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001114#ifdef FEATURE_WLAN_ESE
1115 uint32_t tspecIeLen;
1116#endif
1117 uint32_t staId; /* Station ID for peer */
1118
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001119 /*Timing measurement capability */
1120 uint8_t timingMeasCap;
1121
1122#ifdef FEATURE_WLAN_TDLS
1123 /* TDLS prohibited and TDLS channel switch prohibited are set as
1124 * per ExtCap IE in received assoc/re-assoc response from AP
1125 */
1126 bool tdls_prohibited;
1127 bool tdls_chan_swit_prohibited;
1128#endif
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301129 uint8_t nss;
1130 uint32_t max_rate_flags;
1131
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001132#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
1133 tSirSmeHTProfile HTProfile;
1134#endif
Archana Ramachandran20d2e232016-02-11 16:58:40 -08001135 bool supported_nss_1x1;
Anurag Chouhan5de8d172016-07-13 14:44:28 +05301136 tDot11fIEHTCaps ht_caps;
1137 tDot11fIEVHTCaps vht_caps;
1138 tDot11fIEHTInfo ht_operation;
1139 tDot11fIEVHTOperation vht_operation;
1140 tDot11fIEhs20vendor_ie hs20vendor_ie;
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301141 bool is_fils_connection;
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301142 uint16_t fils_seq_num;
Vignesh Viswanathan0b0fa272017-09-18 17:12:04 +05301143#ifdef WLAN_FEATURE_FILS_SK
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301144 struct fils_join_rsp_params *fils_join_rsp;
1145#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001146 uint8_t frames[1];
1147} tSirSmeJoinRsp, *tpSirSmeJoinRsp;
1148
1149/* / probereq from peer, when wsc is enabled */
1150typedef struct sSirSmeProbereq {
1151 uint16_t messageType;
1152 uint16_t length;
1153 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301154 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001155 uint16_t devicePasswdId;
1156} tSirSmeProbeReq, *tpSirSmeProbeReq;
1157
1158typedef struct sSirSmeChanInfo {
1159 uint8_t chan_id;
1160 uint32_t mhz;
1161 uint32_t band_center_freq1;
1162 uint32_t band_center_freq2;
1163 uint32_t info;
1164 uint32_t reg_info_1;
1165 uint32_t reg_info_2;
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301166 uint8_t nss;
1167 uint32_t rate_flags;
Manishekar Chandrasekaranec267592016-05-26 19:10:04 +05301168 uint8_t sec_ch_offset;
1169 enum phy_ch_width ch_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001170} tSirSmeChanInfo, *tpSirSmeChanInfo;
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301171
Will Huang558f8082017-05-31 16:22:24 +08001172enum sir_sme_phy_mode {
1173 SIR_SME_PHY_MODE_LEGACY = 0,
1174 SIR_SME_PHY_MODE_HT = 1,
1175 SIR_SME_PHY_MODE_VHT = 2
1176};
1177
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001178/* / Definition for Association indication from peer */
1179/* / MAC ---> */
1180typedef struct sSirSmeAssocInd {
1181 uint16_t messageType; /* eWNI_SME_ASSOC_IND */
1182 uint16_t length;
1183 uint8_t sessionId;
1184 tSirMacAddr peerMacAddr;
1185 uint16_t aid;
1186 tSirMacAddr bssId; /* Self BSSID */
1187 uint16_t staId; /* Station ID for peer */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001188 tAniAuthType authType;
1189 tAniSSID ssId; /* SSID used by STA to associate */
1190 tSirWAPIie wapiIE; /* WAPI IE received from peer */
1191 tSirRSNie rsnIE; /* RSN IE received from peer */
1192 /* Additional IE received from peer, which possibly include
1193 * WSC IE and/or P2P IE
1194 */
1195 tSirAddie addIE;
1196
1197 /* powerCap & supportedChannels are present only when */
1198 /* spectrumMgtIndicator flag is set */
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001199 bool spectrumMgtIndicator;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001200 tSirMacPowerCapInfo powerCap;
1201 tSirSupChnl supportedChannels;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001202 bool wmmEnabledSta; /* if present - STA is WMM enabled */
1203 bool reassocReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001204 /* Required for indicating the frames to upper layer */
1205 uint32_t beaconLength;
1206 uint8_t *beaconPtr;
1207 uint32_t assocReqLength;
1208 uint8_t *assocReqPtr;
1209
1210 /* Timing measurement capability */
1211 uint8_t timingMeasCap;
1212 tSirSmeChanInfo chan_info;
Will Huang558f8082017-05-31 16:22:24 +08001213 bool ampdu;
1214 bool sgi_enable;
1215 bool tx_stbc;
1216 bool rx_stbc;
1217 tSirMacHTChannelWidth ch_width;
1218 enum sir_sme_phy_mode mode;
1219 uint8_t max_supp_idx;
1220 uint8_t max_ext_idx;
1221 uint8_t max_mcs_idx;
1222 uint8_t rx_mcs_map;
1223 uint8_t tx_mcs_map;
gaolez7bb1e742017-03-21 16:37:38 +08001224 /* Extended CSA capability of station */
1225 uint8_t ecsa_capable;
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +05301226 tDot11fIEHTCaps HTCaps;
1227 tDot11fIEVHTCaps VHTCaps;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001228} tSirSmeAssocInd, *tpSirSmeAssocInd;
1229
1230/* / Definition for Association confirm */
1231/* / ---> MAC */
1232typedef struct sSirSmeAssocCnf {
1233 uint16_t messageType; /* eWNI_SME_ASSOC_CNF */
1234 uint16_t length;
1235 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301236 struct qdf_mac_addr bssid; /* Self BSSID */
1237 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001238 uint16_t aid;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301239 struct qdf_mac_addr alternate_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001240 uint8_t alternateChannelId;
1241} tSirSmeAssocCnf, *tpSirSmeAssocCnf;
1242
1243/* / Enum definition for Wireless medium status change codes */
1244typedef enum eSirSmeStatusChangeCode {
1245 eSIR_SME_DEAUTH_FROM_PEER,
1246 eSIR_SME_DISASSOC_FROM_PEER,
1247 eSIR_SME_LOST_LINK_WITH_PEER,
1248 eSIR_SME_CHANNEL_SWITCH,
1249 eSIR_SME_JOINED_NEW_BSS,
1250 eSIR_SME_LEAVING_BSS,
1251 eSIR_SME_IBSS_ACTIVE,
1252 eSIR_SME_IBSS_INACTIVE,
1253 eSIR_SME_IBSS_PEER_DEPARTED,
1254 eSIR_SME_RADAR_DETECTED,
1255 eSIR_SME_IBSS_NEW_PEER,
1256 eSIR_SME_AP_CAPS_CHANGED,
1257} tSirSmeStatusChangeCode;
1258
1259typedef struct sSirSmeNewBssInfo {
Anurag Chouhan6d760662016-02-20 16:05:43 +05301260 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001261 uint8_t channelNumber;
1262 uint8_t reserved;
1263 tSirMacSSid ssId;
1264} tSirSmeNewBssInfo, *tpSirSmeNewBssInfo;
1265
1266typedef struct sSirSmeApNewCaps {
1267 uint16_t capabilityInfo;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301268 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001269 uint8_t channelId;
1270 uint8_t reserved[3];
1271 tSirMacSSid ssId;
1272} tSirSmeApNewCaps, *tpSirSmeApNewCaps;
1273
1274/**
1275 * Table below indicates what information is passed for each of
1276 * the Wireless Media status change notifications:
1277 *
1278 * Status Change code Status change info
1279 * ----------------------------------------------------------------------
1280 * eSIR_SME_DEAUTH_FROM_PEER Reason code received in DEAUTH frame
1281 * eSIR_SME_DISASSOC_FROM_PEER Reason code received in DISASSOC frame
1282 * eSIR_SME_LOST_LINK_WITH_PEER None
1283 * eSIR_SME_CHANNEL_SWITCH New channel number
1284 * eSIR_SME_JOINED_NEW_BSS BSSID, SSID and channel number
1285 * eSIR_SME_LEAVING_BSS None
1286 * eSIR_SME_IBSS_ACTIVE Indicates that another STA joined
1287 * IBSS apart from this STA that
1288 * started IBSS
1289 * eSIR_SME_IBSS_INACTIVE Indicates that only this STA is left
1290 * in IBSS
1291 * eSIR_SME_RADAR_DETECTED Indicates that radar is detected
1292 * eSIR_SME_IBSS_NEW_PEER Indicates that a new peer is detected
1293 * eSIR_SME_AP_CAPS_CHANGED Indicates that capabilities of the AP
1294 * that STA is currently associated with
1295 * have changed.
1296 */
1297
1298/* / Definition for Wireless medium status change notification */
1299typedef struct sSirSmeWmStatusChangeNtf {
1300 uint16_t messageType; /* eWNI_SME_WM_STATUS_CHANGE_NTF */
1301 uint16_t length;
1302 uint8_t sessionId; /* Session ID */
1303 tSirSmeStatusChangeCode statusChangeCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301304 struct qdf_mac_addr bssid; /* Self BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001305 union {
1306 uint16_t deAuthReasonCode; /* eSIR_SME_DEAUTH_FROM_PEER */
1307 /* eSIR_SME_DISASSOC_FROM_PEER */
1308 uint16_t disassocReasonCode;
1309 /* none for eSIR_SME_LOST_LINK_WITH_PEER */
1310 uint8_t newChannelId; /* eSIR_SME_CHANNEL_SWITCH */
1311 tSirSmeNewBssInfo newBssInfo; /* eSIR_SME_JOINED_NEW_BSS */
1312 /* none for eSIR_SME_LEAVING_BSS */
1313 /* none for eSIR_SME_IBSS_ACTIVE */
1314 /* none for eSIR_SME_IBSS_INACTIVE */
1315 /* eSIR_SME_IBSS_NEW_PEER */
1316 tSirNewIbssPeerInfo newIbssPeerInfo;
1317 tSirSmeApNewCaps apNewCaps; /* eSIR_SME_AP_CAPS_CHANGED */
1318 } statusChangeInfo;
1319} tSirSmeWmStatusChangeNtf, *tpSirSmeWmStatusChangeNtf;
1320
1321/* Definition for Disassociation request */
1322typedef struct sSirSmeDisassocReq {
1323 uint16_t messageType; /* eWNI_SME_DISASSOC_REQ */
1324 uint16_t length;
1325 uint8_t sessionId; /* Session ID */
1326 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301327 struct qdf_mac_addr bssid; /* Peer BSSID */
1328 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001329 uint16_t reasonCode;
1330 /* This flag tells LIM whether to send the disassoc OTA or not */
1331 /* This will be set in while handing off from one AP to other */
1332 uint8_t doNotSendOverTheAir;
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -07001333 bool process_ho_fail;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301334} qdf_packed tSirSmeDisassocReq, *tpSirSmeDisassocReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001335
1336/* / Definition for Tkip countermeasures request */
1337typedef struct sSirSmeTkipCntrMeasReq {
1338 uint16_t messageType; /* eWNI_SME_DISASSOC_REQ */
1339 uint16_t length;
1340 uint8_t sessionId; /* Session ID */
1341 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301342 struct qdf_mac_addr bssId; /* Peer BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001343 bool bEnable; /* Start/stop countermeasures */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301344} qdf_packed tSirSmeTkipCntrMeasReq, *tpSirSmeTkipCntrMeasReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001345
1346typedef struct sAni64BitCounters {
1347 uint32_t Hi;
1348 uint32_t Lo;
1349} tAni64BitCounters, *tpAni64BitCounters;
1350
1351typedef struct sAniSecurityStat {
1352 tAni64BitCounters txBlks;
1353 tAni64BitCounters rxBlks;
1354 tAni64BitCounters formatErrorCnt;
1355 tAni64BitCounters decryptErr;
1356 tAni64BitCounters protExclCnt;
1357 tAni64BitCounters unDecryptableCnt;
1358 tAni64BitCounters decryptOkCnt;
1359
1360} tAniSecurityStat, *tpAniSecurityStat;
1361
1362typedef struct sAniTxRxStats {
1363 tAni64BitCounters txFrames;
1364 tAni64BitCounters rxFrames;
1365 tAni64BitCounters nRcvBytes;
1366 tAni64BitCounters nXmitBytes;
1367
1368} tAniTxRxStats, *tpAniTxRxStats;
1369
1370typedef struct sAniSecStats {
1371 tAniSecurityStat aes;
1372 tAni64BitCounters aesReplays;
1373 tAniSecurityStat tkip;
1374 tAni64BitCounters tkipReplays;
1375 tAni64BitCounters tkipMicError;
1376
1377 tAniSecurityStat wep;
1378#if defined(FEATURE_WLAN_WAPI) && !defined(LIBRA_WAPI_SUPPORT)
1379 tAniSecurityStat wpi;
1380 tAni64BitCounters wpiReplays;
1381 tAni64BitCounters wpiMicError;
1382#endif
1383} tAniSecStats, *tpAniSecStats;
1384
1385#define SIR_MAX_RX_CHAINS 3
1386
1387typedef struct sAniStaStatStruct {
1388 /* following statistic elements till expandPktRxCntLo are not filled
1389 * with valid data. These are kept as it is, since WSM is using this
1390 * structure. These elements can be removed whenever WSM is updated.
1391 * Phystats is used to hold phystats from BD.
1392 */
1393 uint32_t sentAesBlksUcastHi;
1394 uint32_t sentAesBlksUcastLo;
1395 uint32_t recvAesBlksUcastHi;
1396 uint32_t recvAesBlksUcastLo;
1397 uint32_t aesFormatErrorUcastCnts;
1398 uint32_t aesReplaysUcast;
1399 uint32_t aesDecryptErrUcast;
1400 uint32_t singleRetryPkts;
1401 uint32_t failedTxPkts;
1402 uint32_t ackTimeouts;
1403 uint32_t multiRetryPkts;
1404 uint32_t fragTxCntsHi;
1405 uint32_t fragTxCntsLo;
1406 uint32_t transmittedPktsHi;
1407 uint32_t transmittedPktsLo;
1408 uint32_t phyStatHi; /* These are used to fill in the phystats. */
1409 uint32_t phyStatLo; /* This is only for private use. */
1410
1411 uint32_t uplinkRssi;
1412 uint32_t uplinkSinr;
1413 uint32_t uplinkRate;
1414 uint32_t downlinkRssi;
1415 uint32_t downlinkSinr;
1416 uint32_t downlinkRate;
1417 uint32_t nRcvBytes;
1418 uint32_t nXmitBytes;
1419
1420 /*
1421 * Following elements are valid and filled in correctly. They have
1422 * valid values.
1423 */
1424
1425 /* Unicast frames and bytes. */
1426 tAniTxRxStats ucStats;
1427
1428 /* Broadcast frames and bytes. */
1429 tAniTxRxStats bcStats;
1430
1431 /* Multicast frames and bytes. */
1432 tAniTxRxStats mcStats;
1433
1434 uint32_t currentTxRate;
1435 uint32_t currentRxRate; /* Rate in 100Kbps */
1436
1437 uint32_t maxTxRate;
1438 uint32_t maxRxRate;
1439
1440 int8_t rssi[SIR_MAX_RX_CHAINS];
1441
1442 tAniSecStats securityStats;
1443
1444 uint8_t currentRxRateIdx; /* This the softmac rate Index. */
1445 uint8_t currentTxRateIdx;
1446
1447} tAniStaStatStruct, *tpAniStaStatStruct;
1448
1449typedef enum sPacketType {
1450 ePACKET_TYPE_UNKNOWN,
1451 ePACKET_TYPE_11A,
1452 ePACKET_TYPE_11G,
1453 ePACKET_TYPE_11B,
1454 ePACKET_TYPE_11N
1455} tPacketType, *tpPacketType;
1456
1457/* / Definition for Disassociation response */
1458typedef struct sSirSmeDisassocRsp {
1459 uint16_t messageType; /* eWNI_SME_DISASSOC_RSP */
1460 uint16_t length;
1461 uint8_t sessionId; /* Session ID */
1462 uint16_t transactionId; /* Transaction ID for cmd */
1463 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301464 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001465 tAniStaStatStruct perStaStats; /* STA stats */
1466 uint16_t staId;
Srinivas Girigowdaeaf136a2017-06-12 19:03:19 -07001467} tSirSmeDisassocRsp, *tpSirSmeDisassocRsp;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001468
1469/* / Definition for Disassociation indication from peer */
1470typedef struct sSirSmeDisassocInd {
1471 uint16_t messageType; /* eWNI_SME_DISASSOC_IND */
1472 uint16_t length;
1473 uint8_t sessionId; /* Session Identifier */
1474 uint16_t transactionId; /* Transaction Identifier with PE */
1475 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301476 struct qdf_mac_addr bssid;
1477 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001478 tAniStaStatStruct perStaStats; /* STA stats */
1479 uint16_t staId;
1480 uint32_t reasonCode;
1481} tSirSmeDisassocInd, *tpSirSmeDisassocInd;
1482
1483/* / Definition for Disassociation confirm */
1484/* / MAC ---> */
1485typedef struct sSirSmeDisassocCnf {
1486 uint16_t messageType; /* eWNI_SME_DISASSOC_CNF */
1487 uint16_t length;
Vignesh Viswanathanb2dcdd02018-05-24 11:48:12 +05301488 uint8_t sme_session_id;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001489 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301490 struct qdf_mac_addr bssid;
1491 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001492} tSirSmeDisassocCnf, *tpSirSmeDisassocCnf,
1493 tSirSmeDeauthCnf, *tpSirSmeDeauthCnf;
1494
Hanumantha Reddy Pothula3e5d6aa2016-09-08 15:21:54 +05301495/**
1496 * struct sir_sme_discon_done_ind - disconnect done indiaction
1497 * @message_type: msg type
1498 * @length: length of msg
1499 * @session_id: session id of the indication
1500 * @reason_code: reason for disconnect indication
1501 * @peer_mac: peer mac
1502 */
1503struct sir_sme_discon_done_ind {
1504 uint16_t message_type;
1505 uint16_t length;
1506 uint8_t session_id;
1507 tSirResultCodes reason_code;
1508 tSirMacAddr peer_mac;
1509};
1510
1511
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001512/* / Definition for Deauthetication request */
1513typedef struct sSirSmeDeauthReq {
1514 uint16_t messageType; /* eWNI_SME_DEAUTH_REQ */
1515 uint16_t length;
1516 uint8_t sessionId; /* Session ID */
1517 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301518 struct qdf_mac_addr bssid; /* AP BSSID */
1519 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001520 uint16_t reasonCode;
1521} tSirSmeDeauthReq, *tpSirSmeDeauthReq;
1522
1523/* / Definition for Deauthetication response */
1524typedef struct sSirSmeDeauthRsp {
1525 uint16_t messageType; /* eWNI_SME_DEAUTH_RSP */
1526 uint16_t length;
1527 uint8_t sessionId; /* Session ID */
1528 uint16_t transactionId; /* Transaction ID for cmd */
1529 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301530 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001531} tSirSmeDeauthRsp, *tpSirSmeDeauthRsp;
1532
1533/* / Definition for Deauthetication indication from peer */
1534typedef struct sSirSmeDeauthInd {
1535 uint16_t messageType; /* eWNI_SME_DEAUTH_IND */
1536 uint16_t length;
1537 uint8_t sessionId; /* Added for BT-AMP */
1538 uint16_t transactionId; /* Added for BT-AMP */
1539 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301540 struct qdf_mac_addr bssid; /* AP BSSID */
1541 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001542
1543 uint16_t staId;
1544 uint32_t reasonCode;
Kiran Kumar Lokere37d3aa22015-11-03 14:58:26 -08001545 int8_t rssi;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001546} tSirSmeDeauthInd, *tpSirSmeDeauthInd;
1547
1548/* / Definition for stop BSS request message */
1549typedef struct sSirSmeStopBssReq {
1550 uint16_t messageType; /* eWNI_SME_STOP_BSS_REQ */
1551 uint16_t length;
1552 uint8_t sessionId; /* Session ID */
1553 uint16_t transactionId; /* tranSaction ID for cmd */
1554 tSirResultCodes reasonCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301555 struct qdf_mac_addr bssid; /* Self BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001556} tSirSmeStopBssReq, *tpSirSmeStopBssReq;
1557
1558/* / Definition for stop BSS response message */
1559typedef struct sSirSmeStopBssRsp {
1560 uint16_t messageType; /* eWNI_SME_STOP_BSS_RSP */
1561 uint16_t length;
1562 tSirResultCodes statusCode;
1563 uint8_t sessionId; /* Session ID */
1564 uint16_t transactionId; /* Transaction ID for cmd */
1565} tSirSmeStopBssRsp, *tpSirSmeStopBssRsp;
1566
1567/* / Definition for Channel Switch indication for station */
1568/* / MAC ---> */
1569typedef struct sSirSmeSwitchChannelInd {
1570 uint16_t messageType; /* eWNI_SME_SWITCH_CHL_IND */
1571 uint16_t length;
1572 uint8_t sessionId;
1573 uint16_t newChannelId;
Amar Singhal5cccafe2017-02-15 12:42:58 -08001574 struct ch_params chan_params;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301575 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001576} tSirSmeSwitchChannelInd, *tpSirSmeSwitchChannelInd;
1577
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001578/* / Definition for MIC failure indication */
1579/* / MAC ---> */
1580/* / MAC reports this each time a MIC failure occures on Rx TKIP packet */
1581typedef struct sSirSmeMicFailureInd {
1582 uint16_t messageType; /* eWNI_SME_MIC_FAILURE_IND */
1583 uint16_t length;
1584 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301585 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001586 tSirMicFailureInfo info;
1587} tSirSmeMicFailureInd, *tpSirSmeMicFailureInd;
1588
1589typedef struct sSirSmeMissedBeaconInd {
1590 uint16_t messageType; /* eWNI_SME_MISSED_BEACON_IND */
1591 uint16_t length;
1592 uint8_t bssIdx;
1593} tSirSmeMissedBeaconInd, *tpSirSmeMissedBeaconInd;
1594
1595/* / Definition for Set Context request */
1596/* / ---> MAC */
1597typedef struct sSirSmeSetContextReq {
1598 uint16_t messageType; /* eWNI_SME_SET_CONTEXT_REQ */
1599 uint16_t length;
1600 uint8_t sessionId; /* Session ID */
1601 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301602 struct qdf_mac_addr peer_macaddr;
1603 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001604 tSirKeyMaterial keyMaterial;
1605} tSirSmeSetContextReq, *tpSirSmeSetContextReq;
1606
1607/* / Definition for Set Context response */
1608/* / MAC ---> */
1609typedef struct sSirSmeSetContextRsp {
1610 uint16_t messageType; /* eWNI_SME_SET_CONTEXT_RSP */
1611 uint16_t length;
1612 uint8_t sessionId; /* Session ID */
1613 uint16_t transactionId; /* Transaction ID for cmd */
1614 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301615 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001616} tSirSmeSetContextRsp, *tpSirSmeSetContextRsp;
1617
1618/* / Statistic definitions */
1619/* ============================================================= */
1620/* Per STA statistic structure; This same struct will be used for Aggregate */
1621/* STA stats as well. */
1622
1623/* Clear radio stats and clear per sta stats */
1624typedef enum {
1625 eANI_CLEAR_ALL_STATS, /* Clears all stats */
1626 eANI_CLEAR_RX_STATS, /* Clears RX stats of the radio interface */
1627 eANI_CLEAR_TX_STATS, /* Clears TX stats of the radio interface */
1628 eANI_CLEAR_RADIO_STATS, /* Clears all the radio stats */
1629 eANI_CLEAR_PER_STA_STATS, /* Clears Per STA stats */
1630 eANI_CLEAR_AGGR_PER_STA_STATS, /* Clears aggregate stats */
1631
1632 /* Used to distinguish between per sta to security stats. */
1633 /* Used only by AP, FW just returns the same param as it received. */
1634 eANI_LINK_STATS, /* Get Per STA stats */
1635 eANI_SECURITY_STATS, /* Get Per STA security stats */
1636
1637 eANI_CLEAR_STAT_TYPES_END
1638} tAniStatSubTypes;
1639
1640typedef struct sAniTxCtrs {
1641 /* add the rate counters here */
1642 uint32_t tx1Mbps;
1643 uint32_t tx2Mbps;
1644 uint32_t tx5_5Mbps;
1645 uint32_t tx6Mbps;
1646 uint32_t tx9Mbps;
1647 uint32_t tx11Mbps;
1648 uint32_t tx12Mbps;
1649 uint32_t tx18Mbps;
1650 uint32_t tx24Mbps;
1651 uint32_t tx36Mbps;
1652 uint32_t tx48Mbps;
1653 uint32_t tx54Mbps;
1654 uint32_t tx72Mbps;
1655 uint32_t tx96Mbps;
1656 uint32_t tx108Mbps;
1657
1658 /* tx path radio counts */
1659 uint32_t txFragHi;
1660 uint32_t txFragLo;
1661 uint32_t txFrameHi;
1662 uint32_t txFrameLo;
1663 uint32_t txMulticastFrameHi;
1664 uint32_t txMulticastFrameLo;
1665 uint32_t txFailedHi;
1666 uint32_t txFailedLo;
1667 uint32_t multipleRetryHi;
1668 uint32_t multipleRetryLo;
1669 uint32_t singleRetryHi;
1670 uint32_t singleRetryLo;
1671 uint32_t ackFailureHi;
1672 uint32_t ackFailureLo;
1673 uint32_t xmitBeacons;
1674} tAniTxCtrs, *tpAniTxCtrs;
1675
1676typedef struct sAniRxCtrs {
1677 /* receive frame rate counters */
1678 uint32_t rx1Mbps;
1679 uint32_t rx2Mbps;
1680 uint32_t rx5_5Mbps;
1681 uint32_t rx6Mbps;
1682 uint32_t rx9Mbps;
1683 uint32_t rx11Mbps;
1684 uint32_t rx12Mbps;
1685 uint32_t rx18Mbps;
1686 uint32_t rx24Mbps;
1687 uint32_t rx36Mbps;
1688 uint32_t rx48Mbps;
1689 uint32_t rx54Mbps;
1690 uint32_t rx72Mbps;
1691 uint32_t rx96Mbps;
1692 uint32_t rx108Mbps;
1693
1694 /* receive size counters; 'Lte' = Less than or equal to */
1695 uint32_t rxLte64;
1696 uint32_t rxLte128Gt64;
1697 uint32_t rxLte256Gt128;
1698 uint32_t rxLte512Gt256;
1699 uint32_t rxLte1kGt512;
1700 uint32_t rxLte1518Gt1k;
1701 uint32_t rxLte2kGt1518;
1702 uint32_t rxLte4kGt2k;
1703
1704 /* rx radio stats */
1705 uint32_t rxFrag;
1706 uint32_t rxFrame;
1707 uint32_t fcsError;
1708 uint32_t rxMulticast;
1709 uint32_t duplicate;
1710 uint32_t rtsSuccess;
1711 uint32_t rtsFailed;
1712 uint32_t wepUndecryptables;
1713 uint32_t drops;
1714 uint32_t aesFormatErrorUcastCnts;
1715 uint32_t aesReplaysUcast;
1716 uint32_t aesDecryptErrUcast;
1717} tAniRxCtrs, *tpAniRxCtrs;
1718
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001719/* *************************************************************** */
1720
1721/*******************PE Statistics*************************/
1722
1723/*
1724 * tpAniGetPEStatsReq is tied to
1725 * for SME ==> PE eWNI_SME_GET_STATISTICS_REQ msgId and
1726 * for PE ==> HAL SIR_HAL_GET_STATISTICS_REQ msgId
1727 */
1728typedef struct sAniGetPEStatsReq {
1729 /* Common for all types are requests */
1730 uint16_t msgType; /* message type is same as the request type */
1731 uint16_t msgLen; /* length of the entire request */
1732 uint32_t staId; /* Per STA stats request must contain valid */
1733 /* categories of stats requested. look at ePEStatsMask */
1734 uint32_t statsMask;
1735 uint8_t sessionId;
1736} tAniGetPEStatsReq, *tpAniGetPEStatsReq;
1737
1738/*
1739 * tpAniGetPEStatsRsp is tied to
1740 * for PE ==> SME eWNI_SME_GET_STATISTICS_RSP msgId and
1741 * for HAL ==> PE SIR_HAL_GET_STATISTICS_RSP msgId
1742 */
1743typedef struct sAniGetPEStatsRsp {
1744 /* Common for all types are responses */
1745 uint16_t msgType; /* message type is same as the request type */
1746 /* length of the entire request, includes the pStatsBuf length too */
1747 uint16_t msgLen;
1748 uint8_t sessionId;
1749 uint32_t rc; /* success/failure */
1750 uint32_t staId; /* Per STA stats request must contain valid */
1751 /* categories of stats requested. look at ePEStatsMask */
1752 uint32_t statsMask;
1753 /* void *pStatsBuf; */
1754 /*
1755 * The Stats buffer starts here and can be an aggregate of more than one
1756 * statistics structure depending on statsMask. The void pointer
1757 * "pStatsBuf" is commented out intentionally and the src code that uses
1758 * this structure should take that into account.
1759 */
1760} tAniGetPEStatsRsp, *tpAniGetPEStatsRsp;
1761
1762typedef struct sAniGetRssiReq {
1763 /* Common for all types are requests */
1764 uint16_t msgType; /* message type is same as the request type */
1765 uint16_t msgLen; /* length of the entire request */
1766 uint8_t sessionId;
1767 uint8_t staId;
1768 int8_t lastRSSI; /* in case of error, return last RSSI */
1769 void *rssiCallback;
1770 void *pDevContext; /* device context */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001771} tAniGetRssiReq, *tpAniGetRssiReq;
1772
1773typedef struct sAniGetSnrReq {
1774 /* Common for all types are requests */
1775 uint16_t msgType; /* message type is same as the request type */
1776 uint16_t msgLen; /* length of the entire request */
1777 uint8_t sessionId;
1778 uint8_t staId;
1779 void *snrCallback;
1780 void *pDevContext; /* device context */
1781 int8_t snr;
1782} tAniGetSnrReq, *tpAniGetSnrReq;
1783
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001784/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001785 * struct ani_roc_req - Remain on channel request
1786 * @msg_type: Message type
1787 * @msg_len: Message Length
1788 * @session_id: SME session Id
1789 * @channel: channel number
1790 * @callback: call back function for scan result
1791 * @duration: Roc duration
1792 * @is_p2pprobe_allowed : flag for p2p probe request
1793 * @ctx: Global context
1794 * @scan_id: Scan Identifier
1795 *
1796 * Remain on channel request message structure
1797 */
1798struct ani_roc_req {
1799 /* message type is same as the request type */
1800 uint16_t msg_type;
1801 /* length of the entire request */
1802 uint16_t msg_len;
1803 uint16_t session_id;
1804 uint8_t channel;
1805 uint32_t duration;
1806 uint8_t is_p2pprobe_allowed;
1807 void *callback;
1808 void *ctx;
1809 uint32_t scan_id;
1810};
1811
1812/* generic country code change request MSG structure */
1813typedef struct sAniGenericChangeCountryCodeReq {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001814 uint16_t msgType; /* message type is same as the request type */
1815 uint16_t msgLen; /* length of the entire request */
1816 uint8_t countryCode[WNI_CFG_COUNTRY_CODE_LEN]; /* 3 char country code */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001817} tAniGenericChangeCountryCodeReq, *tpAniGenericChangeCountryCodeReq;
1818
Srinivas Girigowda296105a2015-09-24 16:31:16 -07001819/**
1820 * struct sAniDHCPStopInd - DHCP Stop indication message
1821 * @msgType: message type is same as the request type
1822 * @msgLen: length of the entire request
1823 * @device_mode: Mode of the device(ex:STA, AP)
1824 * @adapterMacAddr: MAC address of the adapter
1825 * @peerMacAddr: MAC address of the connected peer
1826 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001827typedef struct sAniDHCPStopInd {
Srinivas Girigowda296105a2015-09-24 16:31:16 -07001828 uint16_t msgType;
1829 uint16_t msgLen;
1830 uint8_t device_mode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301831 struct qdf_mac_addr adapterMacAddr;
1832 struct qdf_mac_addr peerMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001833} tAniDHCPInd, *tpAniDHCPInd;
1834
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001835typedef struct sAniTXFailMonitorInd {
1836 uint16_t msgType; /* message type is same as the request type */
1837 uint16_t msgLen; /* length of the entire request */
1838 uint8_t tx_fail_count;
1839 void *txFailIndCallback;
1840} tAniTXFailMonitorInd, *tpAniTXFailMonitorInd;
1841
Naveen Rawatea1564b2018-05-17 15:56:11 -07001842#ifndef QCA_SUPPORT_CP_STATS
1843/**
1844 * enum tx_rate_info - tx_rate flags
1845 * @TX_RATE_LEGACY: Legacy rates
1846 * @TX_RATE_HT20: HT20 rates
1847 * @TX_RATE_HT40: HT40 rates
1848 * @TX_RATE_SGI: Rate with Short guard interval
1849 * @TX_RATE_LGI: Rate with Long guard interval
1850 * @TX_RATE_VHT20: VHT 20 rates
1851 * @TX_RATE_VHT40: VHT 40 rates
1852 * @TX_RATE_VHT80: VHT 80 rates
1853 */
1854enum tx_rate_info {
1855 TX_RATE_LEGACY = 0x1,
1856 TX_RATE_HT20 = 0x2,
1857 TX_RATE_HT40 = 0x4,
1858 TX_RATE_SGI = 0x8,
1859 TX_RATE_LGI = 0x10,
1860 TX_RATE_VHT20 = 0x20,
1861 TX_RATE_VHT40 = 0x40,
1862 TX_RATE_VHT80 = 0x80
1863};
1864#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001865/**********************PE Statistics end*************************/
1866
1867typedef struct sSirP2PNoaStart {
1868 uint32_t status;
1869 uint32_t bssIdx;
1870} tSirP2PNoaStart, *tpSirP2PNoaStart;
1871
1872typedef struct sSirTdlsInd {
1873 uint16_t status;
1874 uint16_t assocId;
1875 uint16_t staIdx;
1876 uint16_t reasonCode;
1877} tSirTdlsInd, *tpSirTdlsInd;
1878
1879typedef struct sSirP2PNoaAttr {
1880#ifdef ANI_BIG_BYTE_ENDIAN
1881 uint32_t index:8;
1882 uint32_t oppPsFlag:1;
1883 uint32_t ctWin:7;
1884 uint32_t rsvd1:16;
1885#else
1886 uint32_t rsvd1:16;
1887 uint32_t ctWin:7;
1888 uint32_t oppPsFlag:1;
1889 uint32_t index:8;
1890#endif
1891
1892#ifdef ANI_BIG_BYTE_ENDIAN
1893 uint32_t uNoa1IntervalCnt:8;
1894 uint32_t rsvd2:24;
1895#else
1896 uint32_t rsvd2:24;
1897 uint32_t uNoa1IntervalCnt:8;
1898#endif
1899 uint32_t uNoa1Duration;
1900 uint32_t uNoa1Interval;
1901 uint32_t uNoa1StartTime;
1902
1903#ifdef ANI_BIG_BYTE_ENDIAN
1904 uint32_t uNoa2IntervalCnt:8;
1905 uint32_t rsvd3:24;
1906#else
1907 uint32_t rsvd3:24;
1908 uint32_t uNoa2IntervalCnt:8;
1909#endif
1910 uint32_t uNoa2Duration;
1911 uint32_t uNoa2Interval;
1912 uint32_t uNoa2StartTime;
1913} tSirP2PNoaAttr, *tpSirP2PNoaAttr;
1914
1915typedef struct sSirTclasInfo {
1916 tSirMacTclasIE tclas;
1917 uint8_t version; /* applies only for classifier type ip */
1918 union {
1919 tSirMacTclasParamEthernet eth;
1920 tSirMacTclasParamIPv4 ipv4;
1921 tSirMacTclasParamIPv6 ipv6;
1922 tSirMacTclasParam8021dq t8021dq;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301923 } qdf_packed tclasParams;
1924} qdf_packed tSirTclasInfo;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001925
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001926typedef struct sSirAddtsReqInfo {
1927 uint8_t dialogToken;
1928 tSirMacTspecIE tspec;
1929
1930 uint8_t numTclas; /* number of Tclas elements */
1931 tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM];
1932 uint8_t tclasProc;
1933#if defined(FEATURE_WLAN_ESE)
1934 tSirMacESETSRSIE tsrsIE;
1935 uint8_t tsrsPresent:1;
1936#endif
1937 uint8_t wmeTspecPresent:1;
1938 uint8_t wsmTspecPresent:1;
1939 uint8_t lleTspecPresent:1;
1940 uint8_t tclasProcPresent:1;
1941} tSirAddtsReqInfo, *tpSirAddtsReqInfo;
1942
1943typedef struct sSirAddtsRspInfo {
1944 uint8_t dialogToken;
1945 tSirMacStatusCodes status;
1946 tSirMacTsDelayIE delay;
1947
1948 tSirMacTspecIE tspec;
1949 uint8_t numTclas; /* number of Tclas elements */
1950 tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM];
1951 uint8_t tclasProc;
1952 tSirMacScheduleIE schedule;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001953#ifdef FEATURE_WLAN_ESE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001954 tSirMacESETSMIE tsmIE;
1955 uint8_t tsmPresent:1;
1956#endif
1957 uint8_t wmeTspecPresent:1;
1958 uint8_t wsmTspecPresent:1;
1959 uint8_t lleTspecPresent:1;
1960 uint8_t tclasProcPresent:1;
1961 uint8_t schedulePresent:1;
1962} tSirAddtsRspInfo, *tpSirAddtsRspInfo;
1963
1964typedef struct sSirDeltsReqInfo {
1965 tSirMacTSInfo tsinfo;
1966 tSirMacTspecIE tspec;
1967 uint8_t wmeTspecPresent:1;
1968 uint8_t wsmTspecPresent:1;
1969 uint8_t lleTspecPresent:1;
1970} tSirDeltsReqInfo, *tpSirDeltsReqInfo;
1971
1972/* / Add a tspec as defined */
1973typedef struct sSirAddtsReq {
1974 uint16_t messageType; /* eWNI_SME_ADDTS_REQ */
1975 uint16_t length;
1976 uint8_t sessionId; /* Session ID */
1977 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301978 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001979 uint32_t timeout; /* in ms */
1980 uint8_t rspReqd;
1981 tSirAddtsReqInfo req;
1982} tSirAddtsReq, *tpSirAddtsReq;
1983
1984typedef struct sSirAddtsRsp {
1985 uint16_t messageType; /* eWNI_SME_ADDTS_RSP */
1986 uint16_t length;
1987 uint8_t sessionId; /* sme sessionId Added for BT-AMP support */
1988 uint16_t transactionId; /* sme transaction Id - for BT-AMP Support */
1989 uint32_t rc; /* return code */
1990 tSirAddtsRspInfo rsp;
1991} tSirAddtsRsp, *tpSirAddtsRsp;
1992
1993typedef struct sSirDeltsReq {
1994 uint16_t messageType; /* eWNI_SME_DELTS_REQ */
1995 uint16_t length;
1996 uint8_t sessionId; /* Session ID */
1997 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301998 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001999 uint16_t aid; /* use 0 if macAddr is being specified */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302000 struct qdf_mac_addr macaddr; /* only on AP to specify the STA */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002001 uint8_t rspReqd;
2002 tSirDeltsReqInfo req;
2003} tSirDeltsReq, *tpSirDeltsReq;
2004
2005typedef struct sSirDeltsRsp {
2006 uint16_t messageType; /* eWNI_SME_DELTS_RSP */
2007 uint16_t length;
2008 uint8_t sessionId; /* sme sessionId Added for BT-AMP support */
2009 uint16_t transactionId; /* sme transaction Id - for BT-AMP Support */
2010 uint32_t rc;
2011 uint16_t aid; /* use 0 if macAddr is being specified */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302012 struct qdf_mac_addr macaddr; /* only on AP to specify the STA */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002013 tSirDeltsReqInfo rsp;
2014} tSirDeltsRsp, *tpSirDeltsRsp;
2015
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002016#define SIR_QOS_NUM_AC_MAX 4
2017
2018typedef struct sSirAggrQosReqInfo {
2019 uint16_t tspecIdx;
2020 tSirAddtsReqInfo aggrAddTsInfo[SIR_QOS_NUM_AC_MAX];
2021} tSirAggrQosReqInfo, *tpSirAggrQosReqInfo;
2022
2023typedef struct sSirAggrQosReq {
2024 uint16_t messageType; /* eWNI_SME_ADDTS_REQ */
2025 uint16_t length;
2026 uint8_t sessionId; /* Session ID */
2027 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302028 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002029 uint32_t timeout; /* in ms */
2030 uint8_t rspReqd;
2031 tSirAggrQosReqInfo aggrInfo;
2032} tSirAggrQosReq, *tpSirAggrQosReq;
2033
2034typedef struct sSirAggrQosRspInfo {
2035 uint16_t tspecIdx;
2036 tSirAddtsRspInfo aggrRsp[SIR_QOS_NUM_AC_MAX];
2037} tSirAggrQosRspInfo, *tpSirAggrQosRspInfo;
2038
2039typedef struct sSirAggrQosRsp {
2040 uint16_t messageType;
2041 uint16_t length;
2042 uint8_t sessionId;
2043 tSirAggrQosRspInfo aggrInfo;
2044} tSirAggrQosRsp, *tpSirAggrQosRsp;
2045
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002046
2047typedef struct sSirQosMapSet {
2048 uint8_t present;
2049 uint8_t num_dscp_exceptions;
2050 uint8_t dscp_exceptions[21][2];
2051 uint8_t dscp_range[8][2];
2052} tSirQosMapSet, *tpSirQosMapSet;
2053
2054typedef struct sSmeIbssPeerInd {
2055 uint16_t mesgType;
2056 uint16_t mesgLen;
2057 uint8_t sessionId;
2058
Anurag Chouhan6d760662016-02-20 16:05:43 +05302059 struct qdf_mac_addr peer_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002060 uint16_t staId;
2061
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002062 /* Beacon will be appended for new Peer indication. */
2063} tSmeIbssPeerInd, *tpSmeIbssPeerInd;
2064
2065typedef struct sSirIbssPeerInactivityInd {
2066 uint8_t bssIdx;
2067 uint8_t staIdx;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302068 struct qdf_mac_addr peer_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002069} tSirIbssPeerInactivityInd, *tpSirIbssPeerInactivityInd;
2070
2071typedef struct sLimScanChn {
2072 uint16_t numTimeScan; /* how many time this channel is scan */
2073 uint8_t channelId;
2074} tLimScanChn;
2075
gaoleze5108942017-03-31 16:56:42 +08002076/**
2077 * struct lim_channel_status
2078 * @channelfreq: Channel freq
2079 * @noise_floor: Noise Floor value
2080 * @rx_clear_count: rx clear count
2081 * @cycle_count: cycle count
2082 * @chan_tx_pwr_range: channel tx power per range in 0.5dBm steps
2083 * @chan_tx_pwr_throughput: channel tx power per throughput
2084 * @rx_frame_count: rx frame count (cumulative)
2085 * @bss_rx_cycle_count: BSS rx cycle count
2086 * @rx_11b_mode_data_duration: b-mode data rx time (units are microseconds)
2087 * @tx_frame_count: BSS tx cycle count
2088 * @mac_clk_mhz: sample frequency
2089 * @channel_id: channel index
2090 * @cmd_flags: indicate which stat event is this status coming from
2091 */
2092struct lim_channel_status {
2093 uint32_t channelfreq;
2094 uint32_t noise_floor;
2095 uint32_t rx_clear_count;
2096 uint32_t cycle_count;
2097 uint32_t chan_tx_pwr_range;
2098 uint32_t chan_tx_pwr_throughput;
2099 uint32_t rx_frame_count;
2100 uint32_t bss_rx_cycle_count;
2101 uint32_t rx_11b_mode_data_duration;
2102 uint32_t tx_frame_count;
2103 uint32_t mac_clk_mhz;
2104 uint32_t channel_id;
2105 uint32_t cmd_flags;
2106};
2107
2108/**
2109 * struct lim_scan_channel_status
2110 * @total_channel: total number of be scanned channel
2111 * @channel_status_list: channel status info store in this array
2112 */
2113struct lim_scan_channel_status {
2114 uint8_t total_channel;
2115 struct lim_channel_status
2116 channel_status_list[SIR_MAX_SUPPORTED_CHANNEL_LIST];
2117};
2118
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002119typedef struct sSmeGetScanChnRsp {
2120 /* Message Type */
2121 uint16_t mesgType;
2122 /* Message Length */
2123 uint16_t mesgLen;
2124 uint8_t sessionId;
2125 uint8_t numChn;
2126 tLimScanChn scanChn[1];
2127} tSmeGetScanChnRsp, *tpSmeGetScanChnRsp;
2128
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002129typedef struct sSirSmeGetAssocSTAsReq {
2130 uint16_t messageType; /* eWNI_SME_GET_ASSOC_STAS_REQ */
2131 uint16_t length;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302132 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002133 uint16_t modId;
2134 void *pUsrContext;
2135 void *pSapEventCallback;
2136 /* Pointer to allocated mem passed in wlansap_get_assoc_stations API */
2137 void *pAssocStasArray;
2138} tSirSmeGetAssocSTAsReq, *tpSirSmeGetAssocSTAsReq;
2139
2140typedef struct sSmeMaxAssocInd {
2141 uint16_t mesgType; /* eWNI_SME_MAX_ASSOC_EXCEEDED */
2142 uint16_t mesgLen;
2143 uint8_t sessionId;
2144 /* the new peer that got rejected max assoc limit reached */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302145 struct qdf_mac_addr peer_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002146} tSmeMaxAssocInd, *tpSmeMaxAssocInd;
2147
2148typedef struct sSmeCsaOffloadInd {
2149 uint16_t mesgType; /* eWNI_SME_CSA_OFFLOAD_EVENT */
2150 uint16_t mesgLen;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302151 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002152} tSmeCsaOffloadInd, *tpSmeCsaOffloadInd;
2153
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002154#define SIR_MAX_NAME_SIZE 64
2155#define SIR_MAX_TEXT_SIZE 32
2156
2157typedef struct sSirName {
2158 uint8_t num_name;
2159 uint8_t name[SIR_MAX_NAME_SIZE];
2160} tSirName;
2161
2162typedef struct sSirText {
2163 uint8_t num_text;
2164 uint8_t text[SIR_MAX_TEXT_SIZE];
2165} tSirText;
2166
2167#define SIR_WPS_PROBRSP_VER_PRESENT 0x00000001
2168#define SIR_WPS_PROBRSP_STATE_PRESENT 0x00000002
2169#define SIR_WPS_PROBRSP_APSETUPLOCK_PRESENT 0x00000004
2170#define SIR_WPS_PROBRSP_SELECTEDREGISTRA_PRESENT 0x00000008
2171#define SIR_WPS_PROBRSP_DEVICEPASSWORDID_PRESENT 0x00000010
2172#define SIR_WPS_PROBRSP_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020
2173#define SIR_WPS_PROBRSP_RESPONSETYPE_PRESENT 0x00000040
2174#define SIR_WPS_PROBRSP_UUIDE_PRESENT 0x00000080
2175#define SIR_WPS_PROBRSP_MANUFACTURE_PRESENT 0x00000100
2176#define SIR_WPS_PROBRSP_MODELNAME_PRESENT 0x00000200
2177#define SIR_WPS_PROBRSP_MODELNUMBER_PRESENT 0x00000400
2178#define SIR_WPS_PROBRSP_SERIALNUMBER_PRESENT 0x00000800
2179#define SIR_WPS_PROBRSP_PRIMARYDEVICETYPE_PRESENT 0x00001000
2180#define SIR_WPS_PROBRSP_DEVICENAME_PRESENT 0x00002000
2181#define SIR_WPS_PROBRSP_CONFIGMETHODS_PRESENT 0x00004000
2182#define SIR_WPS_PROBRSP_RF_BANDS_PRESENT 0x00008000
2183
2184typedef struct sSirWPSProbeRspIE {
2185 uint32_t FieldPresent;
2186 uint32_t Version; /* Version. 0x10 = version 1.0, 0x11 = etc. */
2187 uint32_t wpsState; /* 1 = unconfigured, 2 = configured. */
2188 bool APSetupLocked; /* Must be included if value is true */
2189 /*
2190 * BOOL: indicates if the user has recently activated a Registrar to
2191 * add an Enrollee.
2192 */
2193 bool SelectedRegistra;
2194 uint16_t DevicePasswordID; /* Device Password ID */
2195 /* Selected Registrar config method */
2196 uint16_t SelectedRegistraCfgMethod;
2197 uint8_t ResponseType; /* Response type */
2198 uint8_t UUID_E[16]; /* Unique identifier of the AP. */
2199 tSirName Manufacture;
2200 tSirText ModelName;
2201 tSirText ModelNumber;
2202 tSirText SerialNumber;
2203 /* Device Category ID: 1Computer, 2Input Device, ... */
2204 uint32_t PrimaryDeviceCategory;
2205 /* Vendor specific OUI for Device Sub Category */
2206 uint8_t PrimaryDeviceOUI[4];
2207 /*
2208 Device Sub Category ID: 1-PC, 2-Server if Device Category ID
2209 * is computer
2210 */
2211 uint32_t DeviceSubCategory;
2212 tSirText DeviceName;
2213 uint16_t ConfigMethod; /* Configuaration method */
2214 uint8_t RFBand; /* RF bands available on the AP */
2215} tSirWPSProbeRspIE;
2216
2217#define SIR_WPS_BEACON_VER_PRESENT 0x00000001
2218#define SIR_WPS_BEACON_STATE_PRESENT 0x00000002
2219#define SIR_WPS_BEACON_APSETUPLOCK_PRESENT 0x00000004
2220#define SIR_WPS_BEACON_SELECTEDREGISTRA_PRESENT 0x00000008
2221#define SIR_WPS_BEACON_DEVICEPASSWORDID_PRESENT 0x00000010
2222#define SIR_WPS_BEACON_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020
2223#define SIR_WPS_BEACON_UUIDE_PRESENT 0x00000080
2224#define SIR_WPS_BEACON_RF_BANDS_PRESENT 0x00000100
2225#define SIR_WPS_UUID_LEN 16
2226
2227typedef struct sSirWPSBeaconIE {
2228 uint32_t FieldPresent;
2229 uint32_t Version; /* Version. 0x10 = version 1.0, 0x11 = etc. */
2230 uint32_t wpsState; /* 1 = unconfigured, 2 = configured. */
2231 bool APSetupLocked; /* Must be included if value is true */
2232 /*
2233 * BOOL: indicates if the user has recently activated a Registrar to
2234 * add an Enrollee.
2235 */
2236 bool SelectedRegistra;
2237 uint16_t DevicePasswordID; /* Device Password ID */
2238 /* Selected Registrar config method */
2239 uint16_t SelectedRegistraCfgMethod;
2240 uint8_t UUID_E[SIR_WPS_UUID_LEN]; /* Unique identifier of the AP. */
2241 uint8_t RFBand; /* RF bands available on the AP */
2242} tSirWPSBeaconIE;
2243
2244#define SIR_WPS_ASSOCRSP_VER_PRESENT 0x00000001
2245#define SIR_WPS_ASSOCRSP_RESPONSETYPE_PRESENT 0x00000002
2246
2247typedef struct sSirWPSAssocRspIE {
2248 uint32_t FieldPresent;
2249 uint32_t Version;
2250 uint8_t ResposeType;
2251} tSirWPSAssocRspIE;
2252
2253typedef struct sSirAPWPSIEs {
2254 tSirWPSProbeRspIE SirWPSProbeRspIE; /*WPS Set Probe Respose IE */
2255 tSirWPSBeaconIE SirWPSBeaconIE; /*WPS Set Beacon IE */
2256 tSirWPSAssocRspIE SirWPSAssocRspIE; /*WPS Set Assoc Response IE */
2257} tSirAPWPSIEs, *tpSiriAPWPSIEs;
2258
2259typedef struct sSirUpdateAPWPSIEsReq {
2260 uint16_t messageType; /* eWNI_SME_UPDATE_APWPSIE_REQ */
2261 uint16_t length;
2262 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302263 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002264 uint8_t sessionId; /* Session ID */
2265 tSirAPWPSIEs APWPSIEs;
2266} tSirUpdateAPWPSIEsReq, *tpSirUpdateAPWPSIEsReq;
2267
Naveen Rawat8029a402017-06-01 10:54:19 -07002268struct update_config {
2269 uint16_t messageType; /* eWNI_SME_UPDATE_CONFIG */
2270 uint16_t length;
2271 uint8_t sme_session_id;
2272 uint16_t capab;
2273 uint32_t value;
2274};
2275
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302276/*
2277 * enum sir_update_session_param_type - session param type
2278 * @SIR_PARAM_SSID_HIDDEN: ssidHidden parameter
Selvaraj, Sridharac4fcf32016-09-28 12:57:32 +05302279 * @SIR_PARAM_IGNORE_ASSOC_DISALLOWED: ignore_assoc_disallowed parameter
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302280 */
2281enum sir_update_session_param_type {
2282 SIR_PARAM_SSID_HIDDEN,
Selvaraj, Sridharac4fcf32016-09-28 12:57:32 +05302283 SIR_PARAM_IGNORE_ASSOC_DISALLOWED,
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302284};
2285
2286/*
2287 * struct sir_update_session_param
2288 * @message_type: SME message type
2289 * @length: size of struct sir_update_session_param
2290 * @session_id: Session ID
2291 * @param_type: parameter to be updated
2292 * @param_val: Parameter value to update
2293 */
2294struct sir_update_session_param {
2295 uint16_t message_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002296 uint16_t length;
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302297 uint8_t session_id;
2298 uint32_t param_type;
2299 uint32_t param_val;
2300};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002301
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07002302/**
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -07002303 * struct sir_set_he_bss_color
2304 * @message_type: SME message type
2305 * @length: size of struct sir_set_he_bss_color
2306 * @session_id: Session ID
2307 * @bss_color: bss color value
2308 */
2309struct sir_set_he_bss_color {
2310 uint16_t message_type;
2311 uint16_t length;
2312 uint8_t session_id;
2313 uint8_t bss_color;
2314};
2315
2316/**
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07002317 * struct sir_create_session - Used for creating session in monitor mode
2318 * @type: SME host message type.
2319 * @msg_len: Length of the message.
2320 * @bss_id: bss_id for creating the session.
2321 */
2322struct sir_create_session {
2323 uint16_t type;
2324 uint16_t msg_len;
Rajeev Kumar Sirasanagandlae3b59912018-08-24 15:53:31 +05302325 uint8_t vdev_id;
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07002326 struct qdf_mac_addr bss_id;
2327};
2328
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002329/* Beacon Interval */
2330typedef struct sSirChangeBIParams {
2331 uint16_t messageType;
2332 uint16_t length;
2333 uint16_t beaconInterval; /* Beacon Interval */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302334 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002335 uint8_t sessionId; /* Session ID */
2336} tSirChangeBIParams, *tpSirChangeBIParams;
2337
2338#ifdef QCA_HT_2040_COEX
2339typedef struct sSirSetHT2040Mode {
2340 uint16_t messageType;
2341 uint16_t length;
2342 uint8_t cbMode;
2343 bool obssEnabled;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302344 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002345 uint8_t sessionId; /* Session ID */
2346} tSirSetHT2040Mode, *tpSirSetHT2040Mode;
2347#endif
2348
2349#define SIR_WPS_PBC_WALK_TIME 120 /* 120 Second */
2350
2351typedef struct sSirWPSPBCSession {
2352 struct sSirWPSPBCSession *next;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302353 struct qdf_mac_addr addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002354 uint8_t uuid_e[SIR_WPS_UUID_LEN];
2355 uint32_t timestamp;
2356} tSirWPSPBCSession;
2357
2358typedef struct sSirSmeGetWPSPBCSessionsReq {
2359 uint16_t messageType; /* eWNI_SME_GET_WPSPBC_SESSION_REQ */
2360 uint16_t length;
2361 void *pUsrContext;
2362 void *pSapEventCallback;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302363 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002364 /* MAC Address of STA in WPS Session to be removed */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302365 struct qdf_mac_addr remove_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002366} tSirSmeGetWPSPBCSessionsReq, *tpSirSmeGetWPSPBCSessionsReq;
2367
2368typedef struct sSirWPSPBCProbeReq {
Anurag Chouhan6d760662016-02-20 16:05:43 +05302369 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002370 uint16_t probeReqIELen;
2371 uint8_t probeReqIE[512];
2372} tSirWPSPBCProbeReq, *tpSirWPSPBCProbeReq;
2373
2374/* probereq from peer, when wsc is enabled */
2375typedef struct sSirSmeProbeReqInd {
2376 uint16_t messageType; /* eWNI_SME_WPS_PBC_PROBE_REQ_IND */
2377 uint16_t length;
2378 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302379 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002380 tSirWPSPBCProbeReq WPSPBCProbeReq;
2381} tSirSmeProbeReqInd, *tpSirSmeProbeReqInd;
2382
2383typedef struct sSirUpdateAPWPARSNIEsReq {
2384 uint16_t messageType; /* eWNI_SME_SET_APWPARSNIEs_REQ */
2385 uint16_t length;
2386 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302387 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002388 uint8_t sessionId; /* Session ID */
2389 tSirRSNie APWPARSNIEs;
2390} tSirUpdateAPWPARSNIEsReq, *tpSirUpdateAPWPARSNIEsReq;
2391
2392#define SIR_ROAM_MAX_CHANNELS 80
2393#define SIR_ROAM_SCAN_MAX_PB_REQ_SIZE 450
2394/* Occupied channel list remains static */
2395#define CHANNEL_LIST_STATIC 1
Himanshu Agarwalb23aa572018-06-14 17:04:44 +05302396/* Occupied channel list can be dynamic */
2397#define CHANNEL_LIST_DYNAMIC 2
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002398#define SIR_ROAM_SCAN_24G_DEFAULT_CH 1
2399#define SIR_ROAM_SCAN_5G_DEFAULT_CH 36
2400#define SIR_ROAM_SCAN_RESERVED_BYTES 61
2401
2402#ifdef WLAN_FEATURE_ROAM_OFFLOAD
hangtianb95e63b2018-11-28 12:10:00 +08002403#define SIR_ROAM_SCAN_PSK_SIZE 48
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002404#define SIR_ROAM_R0KH_ID_MAX_LEN 48
2405#endif
2406/* SME -> HAL - This is the host offload request. */
2407#define SIR_IPV4_ARP_REPLY_OFFLOAD 0
2408#define SIR_IPV6_NEIGHBOR_DISCOVERY_OFFLOAD 1
2409#define SIR_IPV6_NS_OFFLOAD 2
2410#define SIR_OFFLOAD_DISABLE 0
2411#define SIR_OFFLOAD_ENABLE 1
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002412
2413#ifdef WLAN_NS_OFFLOAD
2414typedef struct sSirNsOffloadReq {
Srinivas Girigowdac79a7102015-12-08 15:18:26 -08002415 uint8_t srcIPv6Addr[SIR_MAC_IPV6_ADDR_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002416 uint8_t selfIPv6Addr[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][SIR_MAC_IPV6_ADDR_LEN];
2417 uint8_t targetIPv6Addr[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][SIR_MAC_IPV6_ADDR_LEN];
Anurag Chouhan6d760662016-02-20 16:05:43 +05302418 struct qdf_mac_addr self_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002419 uint8_t srcIPv6AddrValid;
2420 uint8_t targetIPv6AddrValid[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA];
Sravan Kumar Kairamc0873582016-07-26 17:34:57 +05302421 uint8_t target_ipv6_addr_ac_type[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002422 uint8_t slotIdx;
2423} tSirNsOffloadReq, *tpSirNsOffloadReq;
2424#endif /* WLAN_NS_OFFLOAD */
2425
2426typedef struct sSirHostOffloadReq {
2427 uint8_t offloadType;
2428 uint8_t enableOrDisable;
2429 uint32_t num_ns_offload_count;
2430 union {
Srinivas Girigowdac79a7102015-12-08 15:18:26 -08002431 uint8_t hostIpv4Addr[SIR_IPV4_ADDR_LEN];
2432 uint8_t hostIpv6Addr[SIR_MAC_IPV6_ADDR_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002433 } params;
2434#ifdef WLAN_NS_OFFLOAD
2435 tSirNsOffloadReq nsOffloadInfo;
2436#endif /* WLAN_NS_OFFLOAD */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302437 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002438} tSirHostOffloadReq, *tpSirHostOffloadReq;
2439
2440/* Packet Types. */
2441#define SIR_KEEP_ALIVE_NULL_PKT 1
2442#define SIR_KEEP_ALIVE_UNSOLICIT_ARP_RSP 2
2443
2444/* Keep Alive request. */
2445typedef struct sSirKeepAliveReq {
2446 uint8_t packetType;
2447 uint32_t timePeriod;
2448 tSirIpv4Addr hostIpv4Addr;
2449 tSirIpv4Addr destIpv4Addr;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302450 struct qdf_mac_addr dest_macaddr;
2451 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002452 uint8_t sessionId;
2453} tSirKeepAliveReq, *tpSirKeepAliveReq;
2454
2455typedef struct sSirSmeMgmtFrameInd {
Abhishek Singh7996eb72015-12-30 17:24:02 +05302456 uint16_t frame_len;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002457 uint32_t rxChan;
2458 uint8_t sessionId;
2459 uint8_t frameType;
2460 int8_t rxRssi;
2461 uint8_t frameBuf[1]; /* variable */
2462} tSirSmeMgmtFrameInd, *tpSirSmeMgmtFrameInd;
2463
Abhishek Singh7996eb72015-12-30 17:24:02 +05302464typedef void (*sir_mgmt_frame_ind_callback)(tSirSmeMgmtFrameInd *frame_ind);
2465/**
2466 * struct sir_sme_mgmt_frame_cb_req - Register a
2467 * management frame callback req
2468 *
2469 * @message_type: message id
2470 * @length: msg length
2471 * @callback: callback for management frame indication
2472 */
2473struct sir_sme_mgmt_frame_cb_req {
2474 uint16_t message_type;
2475 uint16_t length;
2476 sir_mgmt_frame_ind_callback callback;
2477};
2478
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002479#ifdef WLAN_FEATURE_11W
2480typedef struct sSirSmeUnprotMgmtFrameInd {
2481 uint8_t sessionId;
2482 uint8_t frameType;
2483 uint8_t frameLen;
2484 uint8_t frameBuf[1]; /* variable */
2485} tSirSmeUnprotMgmtFrameInd, *tpSirSmeUnprotMgmtFrameInd;
2486#endif
2487
2488#define SIR_IS_FULL_POWER_REASON_DISCONNECTED(eReason) \
2489 ((eSME_LINK_DISCONNECTED_BY_HDD == (eReason)) || \
2490 (eSME_LINK_DISCONNECTED_BY_OTHER == (eReason)))
2491#define SIR_IS_FULL_POWER_NEEDED_BY_HDD(eReason) \
2492 ((eSME_LINK_DISCONNECTED_BY_HDD == (eReason)) || \
2493 (eSME_FULL_PWR_NEEDED_BY_HDD == (eReason)))
2494
2495/* P2P Power Save Related */
2496typedef struct sSirNoAParam {
2497 uint8_t ctWindow:7;
2498 uint8_t OppPS:1;
2499 uint8_t count;
2500 uint32_t duration;
2501 uint32_t interval;
2502 uint32_t singleNoADuration;
2503 uint8_t psSelection;
2504} tSirNoAParam, *tpSirNoAParam;
2505
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002506typedef struct sSirWlanResumeParam {
2507 uint8_t configuredMcstBcstFilterSetting;
2508} tSirWlanResumeParam, *tpSirWlanResumeParam;
2509
2510#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
2511
2512typedef enum ext_wow_type {
2513 EXT_WOW_TYPE_APP_TYPE1, /* wow type: only enable wakeup for app type1 */
2514 EXT_WOW_TYPE_APP_TYPE2, /* wow type: only enable wakeup for app type2 */
2515 EXT_WOW_TYPE_APP_TYPE1_2, /* wow type: enable wakeup for app type1&2 */
2516} EXT_WOW_TYPE;
2517
2518typedef struct {
2519 uint8_t vdev_id;
2520 EXT_WOW_TYPE type;
2521 uint32_t wakeup_pin_num;
2522} tSirExtWoWParams, *tpSirExtWoWParams;
2523
2524typedef struct {
2525 uint8_t vdev_id;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302526 struct qdf_mac_addr wakee_mac_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002527 uint8_t identification_id[8];
2528 uint8_t password[16];
2529 uint32_t id_length;
2530 uint32_t pass_length;
2531} tSirAppType1Params, *tpSirAppType1Params;
2532
2533typedef struct {
2534 uint8_t vdev_id;
2535
2536 uint8_t rc4_key[16];
2537 uint32_t rc4_key_len;
2538
2539 /** ip header parameter */
2540 uint32_t ip_id; /* NC id */
2541 uint32_t ip_device_ip; /* NC IP address */
2542 uint32_t ip_server_ip; /* Push server IP address */
2543
2544 /** tcp header parameter */
2545 uint16_t tcp_src_port; /* NC TCP port */
2546 uint16_t tcp_dst_port; /* Push server TCP port */
2547 uint32_t tcp_seq;
2548 uint32_t tcp_ack_seq;
2549
2550 uint32_t keepalive_init; /* Initial ping interval */
2551 uint32_t keepalive_min; /* Minimum ping interval */
2552 uint32_t keepalive_max; /* Maximum ping interval */
2553 uint32_t keepalive_inc; /* Increment of ping interval */
2554
Anurag Chouhan6d760662016-02-20 16:05:43 +05302555 struct qdf_mac_addr gateway_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002556 uint32_t tcp_tx_timeout_val;
2557 uint32_t tcp_rx_timeout_val;
2558} tSirAppType2Params, *tpSirAppType2Params;
2559#endif
2560
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002561#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2562typedef struct {
2563 uint8_t acvo_uapsd:1;
2564 uint8_t acvi_uapsd:1;
2565 uint8_t acbk_uapsd:1;
2566 uint8_t acbe_uapsd:1;
2567 uint8_t reserved:4;
2568} tSirAcUapsd, *tpSirAcUapsd;
2569#endif
2570
2571typedef struct {
2572 tSirMacSSid ssId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302573 uint8_t currAPbssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002574 uint32_t authentication;
2575 uint8_t encryption;
2576 uint8_t mcencryption;
2577 uint8_t ChannelCount;
2578 uint8_t ChannelCache[SIR_ROAM_MAX_CHANNELS];
2579#ifdef WLAN_FEATURE_11W
2580 bool mfp_enabled;
2581#endif
2582
2583} tSirRoamNetworkType;
2584
2585typedef struct SirMobilityDomainInfo {
2586 uint8_t mdiePresent;
2587 uint16_t mobilityDomain;
2588} tSirMobilityDomainInfo;
2589
2590typedef enum {
2591 SIR_ROAMING_DFS_CHANNEL_DISABLED = 0,
2592 SIR_ROAMING_DFS_CHANNEL_ENABLED_NORMAL = 1,
2593 SIR_ROAMING_DFS_CHANNEL_ENABLED_ACTIVE = 2
2594} eSirDFSRoamScanMode;
2595#define MAX_SSID_ALLOWED_LIST 4
2596#define MAX_BSSID_AVOID_LIST 16
2597#define MAX_BSSID_FAVORED 16
2598/**
2599 * struct roam_ext_params - Structure holding roaming parameters
2600 * @num_bssid_avoid_list: The number of BSSID's that we should
2601 * avoid connecting to. It is like a
2602 * blacklist of BSSID's.
2603 * @num_ssid_allowed_list: The number of SSID profiles that are
2604 * in the Whitelist. When roaming, we
2605 * consider the BSSID's with this SSID
2606 * also for roaming apart from the connected one's
2607 * @num_bssid_favored: Number of BSSID's which have a preference over
2608 * others
2609 * @ssid_allowed_list: Whitelist SSID's
2610 * @bssid_avoid_list: Blacklist SSID's
2611 * @bssid_favored: Favorable BSSID's
2612 * @bssid_favored_factor: RSSI to be added to this BSSID to prefer it
2613 * @raise_rssi_thresh_5g: The RSSI threshold below which the
2614 * raise_factor_5g (boost factor) should be
2615 * applied.
2616 * @drop_rssi_thresh_5g: The RSSI threshold beyond which the
2617 * drop_factor_5g (penalty factor) should be
2618 * applied
2619 * @raise_rssi_type_5g: Algorithm to apply the boost factor
2620 * @raise_factor_5g: Boost factor
2621 * @drop_rssi_type_5g: Algorithm to apply the penalty factor
2622 * @drop_factor_5g: Penalty factor
2623 * @max_raise_rssi_5g: Maximum amount of Boost that can added
2624 * @max_drop_rssi_5g: Maximum amount of penalty that can be subtracted
2625 * @good_rssi_threshold: The Lookup UP threshold beyond which roaming
2626 * scan should be performed.
2627 * @rssi_diff: RSSI difference for the AP to be better over the
2628 * current AP to avoid ping pong effects
2629 * @good_rssi_roam: Lazy Roam
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002630 * @bg_scan_bad_rssi_thresh: Bad RSSI threshold to perform bg scan.
Vignesh Viswanathanc018e982017-09-07 18:49:19 +05302631 * @bad_rssi_thresh_offset_2g: Offset from Bad RSSI threshold for 2G to 5G Roam
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002632 * @bg_scan_client_bitmap: Bitmap to identify the client scans to snoop.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002633 *
2634 * This structure holds all the key parameters related to
2635 * initial connection and also roaming connections.
2636 * */
2637struct roam_ext_params {
2638 uint8_t num_bssid_avoid_list;
2639 uint8_t num_ssid_allowed_list;
2640 uint8_t num_bssid_favored;
2641 tSirMacSSid ssid_allowed_list[MAX_SSID_ALLOWED_LIST];
Anurag Chouhan6d760662016-02-20 16:05:43 +05302642 struct qdf_mac_addr bssid_avoid_list[MAX_BSSID_AVOID_LIST];
2643 struct qdf_mac_addr bssid_favored[MAX_BSSID_FAVORED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002644 uint8_t bssid_favored_factor[MAX_BSSID_FAVORED];
2645 int raise_rssi_thresh_5g;
2646 int drop_rssi_thresh_5g;
2647 uint8_t raise_rssi_type_5g;
2648 uint8_t raise_factor_5g;
2649 uint8_t drop_rssi_type_5g;
2650 uint8_t drop_factor_5g;
2651 int max_raise_rssi_5g;
2652 int max_drop_rssi_5g;
2653 int alert_rssi_threshold;
2654 int rssi_diff;
2655 int good_rssi_roam;
Gupta, Kapilc68ad462016-02-01 19:17:23 +05302656 int dense_rssi_thresh_offset;
2657 int dense_min_aps_cnt;
2658 int initial_dense_status;
2659 int traffic_threshold;
Abhishek Singh4db8c152017-07-18 10:40:08 +05302660 uint8_t num_rssi_rejection_ap;
2661 struct rssi_disallow_bssid rssi_rejection_ap[MAX_RSSI_AVOID_BSSID_LIST];
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002662 int8_t bg_scan_bad_rssi_thresh;
Vignesh Viswanathanc018e982017-09-07 18:49:19 +05302663 uint8_t roam_bad_rssi_thresh_offset_2g;
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002664 uint32_t bg_scan_client_bitmap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002665};
2666
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08002667/**
2668 * struct pmkid_mode_bits - Bit flags for PMKID usage in RSN IE
2669 * @fw_okc: Opportunistic key caching enable in firmware
2670 * @fw_pmksa_cache: PMKSA caching enable in firmware, remember previously
2671 * visited BSSID/PMK pairs
2672 */
2673struct pmkid_mode_bits {
2674 uint32_t fw_okc:1;
2675 uint32_t fw_pmksa_cache:1;
2676 uint32_t unused:30;
2677};
2678
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302679/**
2680 * struct lca_disallow_config_params - LCA[Last Connected AP]
2681 * disallow config params
2682 * @disallow_duration: LCA AP disallowed duration
2683 * @rssi_channel_penalization: RSSI channel Penalization
2684 * @num_disallowed_aps: Maximum number of AP's in LCA list
2685 *
2686 */
Srinivas Girigowdaea4d8062017-10-14 12:40:48 -07002687struct lca_disallow_config_params {
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302688 uint32_t disallow_duration;
2689 uint32_t rssi_channel_penalization;
2690 uint32_t num_disallowed_aps;
2691};
2692
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002693/**
2694 * struct mawc_params - Motion Aided Wireless Connectivity configuration
Wu Gaoca416ff2018-09-17 11:05:07 +08002695 * @mawc_enabled: Global configuration for MAWC (Roaming/PNO/ExtScan)
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002696 * @mawc_roam_enabled: MAWC roaming enable/disable
2697 * @mawc_roam_traffic_threshold: Traffic threshold in kBps for MAWC roaming
2698 * @mawc_roam_ap_rssi_threshold: AP RSSI threshold for MAWC roaming
2699 * @mawc_roam_rssi_high_adjust: High Adjustment value for suppressing scan
2700 * @mawc_roam_rssi_low_adjust: Low Adjustment value for suppressing scan
2701 */
2702struct mawc_params {
2703 bool mawc_enabled;
2704 bool mawc_roam_enabled;
2705 uint32_t mawc_roam_traffic_threshold;
2706 int8_t mawc_roam_ap_rssi_threshold;
2707 uint8_t mawc_roam_rssi_high_adjust;
2708 uint8_t mawc_roam_rssi_low_adjust;
2709};
2710
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002711typedef struct sSirRoamOffloadScanReq {
Selvaraj, Sridhar01741822016-08-30 18:26:19 +05302712 uint16_t message_type;
2713 uint16_t length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002714 bool RoamScanOffloadEnabled;
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002715 struct mawc_params mawc_roam_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002716 int8_t LookupThreshold;
Varun Reddy Yeturu168134f2017-06-26 13:46:05 -07002717 int8_t rssi_thresh_offset_5g;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002718 uint8_t delay_before_vdev_stop;
2719 uint8_t OpportunisticScanThresholdDiff;
2720 uint8_t RoamRescanRssiDiff;
2721 uint8_t RoamRssiDiff;
gaurank kathpaliac63859d2018-05-03 18:48:41 +05302722 struct rsn_caps rsn_caps;
Abhishek Singh34c0e632017-09-28 14:39:29 +05302723 int32_t rssi_abs_thresh;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002724 uint8_t ChannelCacheType;
2725 uint8_t Command;
2726 uint8_t reason;
2727 uint16_t NeighborScanTimerPeriod;
Sridhar Selvaraj1b2330c2017-07-21 15:16:42 +05302728 uint16_t neighbor_scan_min_timer_period;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002729 uint16_t NeighborRoamScanRefreshPeriod;
2730 uint16_t NeighborScanChannelMinTime;
2731 uint16_t NeighborScanChannelMaxTime;
2732 uint16_t EmptyRefreshScanPeriod;
2733 uint8_t ValidChannelCount;
2734 uint8_t ValidChannelList[SIR_ROAM_MAX_CHANNELS];
2735 bool IsESEAssoc;
Abhinav Kumar271f0632018-03-29 16:01:30 +05302736 bool is_11r_assoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002737 uint8_t nProbes;
2738 uint16_t HomeAwayTime;
2739 tSirRoamNetworkType ConnectedNetwork;
2740 tSirMobilityDomainInfo MDID;
2741 uint8_t sessionId;
2742 uint8_t RoamBmissFirstBcnt;
2743 uint8_t RoamBmissFinalBcnt;
2744 uint8_t RoamBeaconRssiWeight;
2745 eSirDFSRoamScanMode allowDFSChannelRoam;
2746#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2747 uint8_t RoamOffloadEnabled;
2748 uint8_t PSK_PMK[SIR_ROAM_SCAN_PSK_SIZE];
2749 uint32_t pmk_len;
2750 uint8_t Prefer5GHz;
2751 uint8_t RoamRssiCatGap;
2752 uint8_t Select5GHzMargin;
2753 uint8_t KRK[SIR_KRK_KEY_LEN];
2754 uint8_t BTK[SIR_BTK_KEY_LEN];
2755 uint32_t ReassocFailureTimeout;
2756 tSirAcUapsd AcUapsd;
2757 uint8_t R0KH_ID[SIR_ROAM_R0KH_ID_MAX_LEN];
2758 uint32_t R0KH_ID_Length;
2759 uint8_t RoamKeyMgmtOffloadEnabled;
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08002760 struct pmkid_mode_bits pmkid_modes;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002761#endif
2762 struct roam_ext_params roam_params;
2763 uint8_t middle_of_roaming;
2764 uint32_t hi_rssi_scan_max_count;
2765 uint32_t hi_rssi_scan_rssi_delta;
2766 uint32_t hi_rssi_scan_delay;
2767 int32_t hi_rssi_scan_rssi_ub;
Varun Reddy Yeturu05186292015-09-28 17:12:33 -07002768 uint8_t early_stop_scan_enable;
2769 int8_t early_stop_scan_min_threshold;
2770 int8_t early_stop_scan_max_threshold;
Sandeep Puligillaf5ccbf62018-03-26 16:37:05 -07002771 enum scan_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode;
Selvaraj, Sridhara7fc7632016-09-04 13:13:38 +05302772 tSirAddie assoc_ie;
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302773 struct lca_disallow_config_params lca_config_params;
Himanshu Agarwal8bcec572017-09-28 11:54:37 +05302774 struct scoring_param score_params;
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05302775#ifdef WLAN_FEATURE_FILS_SK
2776 bool is_fils_connection;
2777 struct roam_fils_params roam_fils_params;
2778#endif
yeshwanth sriram guntuka41f936c2017-09-01 17:53:49 +05302779 uint32_t btm_offload_config;
Jiachao Wu84bb2ea2018-01-08 16:17:33 +08002780 uint32_t btm_solicited_timeout;
2781 uint32_t btm_max_attempt_cnt;
2782 uint32_t btm_sticky_time;
Vignesh Viswanathanfb9d0752018-02-06 16:19:00 +05302783 struct wmi_11k_offload_params offload_11k_params;
Abhinav Kumara083f212018-04-05 18:49:45 +05302784 uint32_t ho_delay_for_rx;
Sourav Mohapatra5ba8da32018-07-16 09:21:15 +05302785 uint32_t roam_preauth_retry_count;
2786 uint32_t roam_preauth_no_ack_timeout;
Abhinav Kumara95af7c2018-04-06 17:08:00 +05302787 uint32_t min_delay_btw_roam_scans;
2788 uint32_t roam_trigger_reason_bitmask;
Abhinav Kumaredd1d372018-05-11 15:33:35 +05302789 bool roam_force_rssi_trigger;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002790} tSirRoamOffloadScanReq, *tpSirRoamOffloadScanReq;
2791
2792typedef struct sSirRoamOffloadScanRsp {
2793 uint8_t sessionId;
2794 uint32_t reason;
2795} tSirRoamOffloadScanRsp, *tpSirRoamOffloadScanRsp;
2796
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002797/*---------------------------------------------------------------------------
2798 Packet Filtering Parameters
2799 ---------------------------------------------------------------------------*/
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002800#define SIR_MAX_FILTER_TEST_DATA_LEN 8
Dustin Brown4d1e8462016-12-14 12:12:24 -08002801#define SIR_MAX_FILTER_TEST_DATA_OFFSET 200
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002802#define SIR_MAX_NUM_MULTICAST_ADDRESS 240
2803#define SIR_MAX_NUM_FILTERS 20
2804#define SIR_MAX_NUM_TESTS_PER_FILTER 10
2805
Qiwei Cai4505fc62018-05-17 18:35:19 +08002806#ifdef WLAN_FEATURE_PACKET_FILTERING
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002807/* */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002808/* Filter Packet Match Count Parameters */
2809/* */
2810typedef struct sSirRcvFltPktMatchCnt {
2811 uint8_t filterId;
2812 uint32_t matchCnt;
2813} tSirRcvFltPktMatchCnt, tpSirRcvFltPktMatchCnt;
2814
2815typedef struct sSirRcvFltPktMatchRsp {
2816 uint16_t mesgType;
2817 uint16_t mesgLen;
2818
2819 /* Success or Failure */
2820 uint32_t status;
2821 tSirRcvFltPktMatchCnt filterMatchCnt[SIR_MAX_NUM_FILTERS];
Anurag Chouhan6d760662016-02-20 16:05:43 +05302822 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002823} tSirRcvFltPktMatchRsp, *tpSirRcvFltPktMatchRsp;
2824
2825/* */
2826/* Receive Filter Clear Parameters */
2827/* */
2828typedef struct sSirRcvFltPktClearParam {
2829 uint32_t status; /* only valid for response message */
2830 uint8_t filterId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302831 struct qdf_mac_addr self_macaddr;
2832 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002833} tSirRcvFltPktClearParam, *tpSirRcvFltPktClearParam;
Qiwei Cai4505fc62018-05-17 18:35:19 +08002834#endif /* WLAN_FEATURE_PACKET_FILTERING */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002835
2836/* */
2837/* Multicast Address List Parameters */
2838/* */
2839typedef struct sSirRcvFltMcAddrList {
2840 uint32_t ulMulticastAddrCnt;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302841 struct qdf_mac_addr multicastAddr[SIR_MAX_NUM_MULTICAST_ADDRESS];
2842 struct qdf_mac_addr self_macaddr;
2843 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002844 uint8_t action;
2845} tSirRcvFltMcAddrList, *tpSirRcvFltMcAddrList;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002846
2847/* */
2848/* Generic version information */
2849/* */
2850typedef struct {
2851 uint8_t revision;
2852 uint8_t version;
2853 uint8_t minor;
2854 uint8_t major;
2855} tSirVersionType;
2856
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002857/**
2858 * struct sir_wifi_start_log - Structure to store the params sent to start/
2859 * stop logging
2860 * @name: Attribute which indicates the type of logging like per packet
2861 * statistics, connectivity etc.
2862 * @verbose_level: Verbose level which can be 0,1,2,3
Poddar, Siddartheefe3482016-09-21 18:12:59 +05302863 * @is_iwpriv_command: Set 1 for iwpriv command
Srinivas Girigowdac34f11d2016-02-25 16:02:42 -08002864 * @ini_triggered: triggered using ini
2865 * @user_triggered: triggered by user
Poddar, Siddarth176c4362016-10-03 12:25:00 +05302866 * @size: pktlog buffer size
Poddar, Siddarthab99a272017-04-10 12:53:26 +05302867 * @is_pktlog_buff_clear: clear the pktlog buffer
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002868 */
2869struct sir_wifi_start_log {
2870 uint32_t ring_id;
2871 uint32_t verbose_level;
Poddar, Siddartheefe3482016-09-21 18:12:59 +05302872 uint32_t is_iwpriv_command;
Srinivas Girigowdac34f11d2016-02-25 16:02:42 -08002873 bool ini_triggered;
2874 uint8_t user_triggered;
Poddar, Siddarth176c4362016-10-03 12:25:00 +05302875 int size;
Poddar, Siddarthab99a272017-04-10 12:53:26 +05302876 bool is_pktlog_buff_clear;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002877};
2878
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002879
2880/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002881 * struct sir_pcl_list - Format of PCL
2882 * @pcl_list: List of preferred channels
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302883 * @weight_list: Weights of the PCL
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002884 * @pcl_len: Number of channels in the PCL
2885 */
2886struct sir_pcl_list {
Rajeev Kumar Sirasanagandla4133d862018-08-23 12:21:36 +05302887 uint32_t pcl_len;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002888 uint8_t pcl_list[128];
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302889 uint8_t weight_list[128];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002890};
2891
2892/**
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302893 * struct sir_pcl_chan_weights - Params to get the valid weighed list
2894 * @pcl_list: Preferred channel list already sorted in the order of preference
2895 * @pcl_len: Length of the PCL
2896 * @saved_chan_list: Valid channel list updated as part of
2897 * WMA_UPDATE_CHAN_LIST_REQ
2898 * @saved_num_chan: Length of the valid channel list
2899 * @weighed_valid_list: Weights of the valid channel list. This will have one
2900 * to one mapping with valid_chan_list. FW expects channel order and size to be
2901 * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID.
2902 * @weight_list: Weights assigned by policy manager
2903 */
2904struct sir_pcl_chan_weights {
2905 uint8_t pcl_list[128];
2906 uint32_t pcl_len;
2907 uint8_t saved_chan_list[128];
2908 uint32_t saved_num_chan;
2909 uint8_t weighed_valid_list[128];
2910 uint8_t weight_list[128];
2911};
2912
2913/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002914 * struct sir_hw_mode_params - HW mode params
2915 * @mac0_tx_ss: MAC0 Tx spatial stream
2916 * @mac0_rx_ss: MAC0 Rx spatial stream
2917 * @mac1_tx_ss: MAC1 Tx spatial stream
2918 * @mac1_rx_ss: MAC1 Rx spatial stream
2919 * @mac0_bw: MAC0 bandwidth
2920 * @mac1_bw: MAC1 bandwidth
2921 * @dbs_cap: DBS capabality
2922 * @agile_dfs_cap: Agile DFS capabality
2923 */
2924struct sir_hw_mode_params {
2925 uint8_t mac0_tx_ss;
2926 uint8_t mac0_rx_ss;
2927 uint8_t mac1_tx_ss;
2928 uint8_t mac1_rx_ss;
2929 uint8_t mac0_bw;
2930 uint8_t mac1_bw;
2931 uint8_t dbs_cap;
2932 uint8_t agile_dfs_cap;
Nitesh Shah5b7bae02016-09-28 18:58:33 +05302933 uint8_t sbs_cap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002934};
2935
2936/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002937 * struct sir_set_hw_mode_resp - HW mode response
2938 * @status: Status
2939 * @cfgd_hw_mode_index: Configured HW mode index
2940 * @num_vdev_mac_entries: Number of vdev-mac id entries
2941 * @vdev_mac_map: vdev id-mac id map
2942 */
2943struct sir_set_hw_mode_resp {
2944 uint32_t status;
2945 uint32_t cfgd_hw_mode_index;
2946 uint32_t num_vdev_mac_entries;
Tushnim Bhattacharyyaeab33dd2017-11-15 15:20:02 -08002947 struct policy_mgr_vdev_mac_map vdev_mac_map[MAX_VDEV_SUPPORTED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002948};
2949
2950/**
2951 * struct sir_hw_mode_trans_ind - HW mode transition indication
2952 * @old_hw_mode_index: Index of old HW mode
2953 * @new_hw_mode_index: Index of new HW mode
2954 * @num_vdev_mac_entries: Number of vdev-mac id entries
2955 * @vdev_mac_map: vdev id-mac id map
2956 */
2957struct sir_hw_mode_trans_ind {
2958 uint32_t old_hw_mode_index;
2959 uint32_t new_hw_mode_index;
2960 uint32_t num_vdev_mac_entries;
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08002961 struct policy_mgr_vdev_mac_map vdev_mac_map[MAX_VDEV_SUPPORTED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002962};
2963
2964/**
2965 * struct sir_dual_mac_config_resp - Dual MAC config response
2966 * @status: Status of setting the dual mac configuration
2967 */
2968struct sir_dual_mac_config_resp {
2969 uint32_t status;
2970};
2971
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -08002972/**
2973 * enum set_antenna_mode_status - Status of set antenna mode
2974 * command
2975 * @SET_ANTENNA_MODE_STATUS_OK: command successful
2976 * @SET_ANTENNA_MODE_STATUS_EINVAL: invalid antenna mode
2977 * @SET_ANTENNA_MODE_STATUS_ECANCELED: mode change cancelled
2978 * @SET_ANTENNA_MODE_STATUS_ENOTSUP: mode not supported
2979 */
2980enum set_antenna_mode_status {
2981 SET_ANTENNA_MODE_STATUS_OK,
2982 SET_ANTENNA_MODE_STATUS_EINVAL,
2983 SET_ANTENNA_MODE_STATUS_ECANCELED,
2984 SET_ANTENNA_MODE_STATUS_ENOTSUP,
2985};
2986
2987/**
2988 * struct sir_antenna_mode_resp - set antenna mode response
2989 * @status: Status of setting the antenna mode
2990 */
2991struct sir_antenna_mode_resp {
2992 enum set_antenna_mode_status status;
2993};
2994
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002995/*---------------------------------------------------------------------------
2996 sAniSetTmLevelReq
2997 ---------------------------------------------------------------------------*/
2998typedef struct sAniSetTmLevelReq {
2999 uint16_t tmMode;
3000 uint16_t newTmLevel;
3001} tAniSetTmLevelReq, *tpAniSetTmLevelReq;
3002
3003#ifdef FEATURE_WLAN_TDLS
3004/* TDLS Request struct SME-->PE */
3005typedef struct sSirTdlsSendMgmtReq {
3006 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
3007 uint16_t length;
3008 uint8_t sessionId; /* Session ID */
3009 uint16_t transactionId; /* Transaction ID for cmd */
3010 uint8_t reqType;
3011 uint8_t dialog;
3012 uint16_t statusCode;
3013 uint8_t responder;
3014 uint32_t peerCapability;
3015 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303016 struct qdf_mac_addr bssid;
3017 struct qdf_mac_addr peer_mac;
Ganesh Kondabattinidd726522017-05-10 18:09:37 +05303018 enum wifi_traffic_ac ac;
Srinivas Girigowdaa9d12f12015-11-24 11:26:40 -08003019 /* Variable length. Dont add any field after this. */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003020 uint8_t addIe[1];
3021} tSirTdlsSendMgmtReq, *tpSirSmeTdlsSendMgmtReq;
3022
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003023/* TDLS Request struct SME-->PE */
3024typedef struct sSirTdlsAddStaReq {
3025 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
3026 uint16_t length;
3027 uint8_t sessionId; /* Session ID */
3028 uint16_t transactionId; /* Transaction ID for cmd */
3029 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303030 struct qdf_mac_addr bssid;
Bala Venkatesh4a72b062018-11-13 13:04:49 +05303031 enum tdls_add_oper tdlsAddOper;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303032 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003033 uint16_t capability;
3034 uint8_t extn_capability[SIR_MAC_MAX_EXTN_CAP];
3035 uint8_t supported_rates_length;
3036 uint8_t supported_rates[SIR_MAC_MAX_SUPP_RATES];
3037 uint8_t htcap_present;
Bala Venkatesh02d52352018-11-26 15:12:58 +05303038 struct htcap_cmn_ie htCap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003039 uint8_t vhtcap_present;
3040 tSirVHTCap vhtCap;
3041 uint8_t uapsd_queues;
3042 uint8_t max_sp;
3043} tSirTdlsAddStaReq, *tpSirSmeTdlsAddStaReq;
3044
3045/* TDLS Response struct PE-->SME */
3046typedef struct sSirTdlsAddStaRsp {
3047 uint16_t messageType;
3048 uint16_t length;
3049 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303050 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003051 uint8_t sessionId; /* Session ID */
3052 uint16_t staId;
3053 uint16_t staType;
Bala Venkatesh4a72b062018-11-13 13:04:49 +05303054 enum tdls_add_oper tdlsAddOper;
Frank Liud4b2fa02017-03-29 11:46:48 +08003055 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003056} tSirTdlsAddStaRsp;
3057
3058/* TDLS Request struct SME-->PE */
3059typedef struct {
3060 uint16_t messageType; /* eWNI_SME_TDLS_LINK_ESTABLISH_REQ */
3061 uint16_t length;
3062 uint8_t sessionId; /* Session ID */
3063 uint16_t transactionId; /* Transaction ID for cmd */
3064 uint8_t uapsdQueues; /* Peer's uapsd Queues Information */
3065 uint8_t maxSp; /* Peer's Supported Maximum Service Period */
3066 uint8_t isBufSta; /* Does Peer Support as Buffer Station. */
3067 /* Does Peer Support as TDLS Off Channel. */
3068 uint8_t isOffChannelSupported;
3069 uint8_t isResponder; /* Is Peer a responder. */
3070 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303071 struct qdf_mac_addr bssid;
3072 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003073 uint8_t supportedChannelsLen;
3074 uint8_t supportedChannels[SIR_MAC_MAX_SUPP_CHANNELS];
3075 uint8_t supportedOperClassesLen;
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -07003076 uint8_t supportedOperClasses[REG_MAX_SUPP_OPER_CLASSES];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003077} tSirTdlsLinkEstablishReq, *tpSirTdlsLinkEstablishReq;
3078
3079/* TDLS Request struct SME-->PE */
3080typedef struct {
3081 uint16_t messageType; /* eWNI_SME_TDLS_LINK_ESTABLISH_RSP */
3082 uint16_t length;
3083 uint8_t sessionId; /* Session ID */
3084 uint16_t transactionId; /* Transaction ID for cmd */
3085 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303086 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003087} tSirTdlsLinkEstablishReqRsp, *tpSirTdlsLinkEstablishReqRsp;
3088
3089/* TDLS Request struct SME-->PE */
3090typedef struct sSirTdlsDelStaReq {
3091 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
3092 uint16_t length;
3093 uint8_t sessionId; /* Session ID */
3094 uint16_t transactionId; /* Transaction ID for cmd */
3095 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303096 struct qdf_mac_addr bssid;
3097 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003098} tSirTdlsDelStaReq, *tpSirSmeTdlsDelStaReq;
3099/* TDLS Response struct PE-->SME */
3100typedef struct sSirTdlsDelStaRsp {
3101 uint16_t messageType;
3102 uint16_t length;
3103 uint8_t sessionId; /* Session ID */
3104 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303105 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003106 uint16_t staId;
Frank Liud4b2fa02017-03-29 11:46:48 +08003107 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003108} tSirTdlsDelStaRsp, *tpSirTdlsDelStaRsp;
3109/* TDLS Delete Indication struct PE-->SME */
3110typedef struct sSirTdlsDelStaInd {
3111 uint16_t messageType;
3112 uint16_t length;
3113 uint8_t sessionId; /* Session ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303114 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003115 uint16_t staId;
3116 uint16_t reasonCode;
3117} tSirTdlsDelStaInd, *tpSirTdlsDelStaInd;
3118typedef struct sSirTdlsDelAllPeerInd {
3119 uint16_t messageType;
3120 uint16_t length;
3121 uint8_t sessionId; /* Session ID */
3122} tSirTdlsDelAllPeerInd, *tpSirTdlsDelAllPeerInd;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003123typedef struct sSirMgmtTxCompletionInd {
3124 uint16_t messageType;
3125 uint16_t length;
3126 uint8_t sessionId; /* Session ID */
3127 uint32_t txCompleteStatus;
Kabilan Kannanf56f9d52017-04-05 03:31:34 -07003128 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003129} tSirMgmtTxCompletionInd, *tpSirMgmtTxCompletionInd;
3130
3131typedef struct sSirTdlsEventnotify {
3132 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303133 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003134 uint16_t messageType;
3135 uint32_t peer_reason;
3136} tSirTdlsEventnotify;
3137#endif /* FEATURE_WLAN_TDLS */
3138
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003139/* Reset AP Caps Changed */
3140typedef struct sSirResetAPCapsChange {
3141 uint16_t messageType;
3142 uint16_t length;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303143 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003144} tSirResetAPCapsChange, *tpSirResetAPCapsChange;
3145
3146/* / Definition for Candidate found indication from FW */
3147typedef struct sSirSmeCandidateFoundInd {
3148 uint16_t messageType; /* eWNI_SME_CANDIDATE_FOUND_IND */
3149 uint16_t length;
3150 uint8_t sessionId; /* Session Identifier */
3151} tSirSmeCandidateFoundInd, *tpSirSmeCandidateFoundInd;
3152
3153#ifdef WLAN_FEATURE_11W
3154typedef struct sSirWlanExcludeUnencryptParam {
3155 bool excludeUnencrypt;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303156 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003157} tSirWlanExcludeUnencryptParam, *tpSirWlanExcludeUnencryptParam;
3158#endif
3159
3160typedef enum {
3161 P2P_SCAN_TYPE_SEARCH = 1, /* P2P Search */
3162 P2P_SCAN_TYPE_LISTEN /* P2P Listen */
3163} tSirP2pScanType;
3164
3165typedef struct sAniHandoffReq {
3166 /* Common for all types are requests */
3167 uint16_t msgType; /* message type is same as the request type */
3168 uint16_t msgLen; /* length of the entire request */
3169 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303170 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003171 uint8_t channel;
3172 uint8_t handoff_src;
3173} tAniHandoffReq, *tpAniHandoffReq;
3174
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08003175/**
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07003176 * sir_scan_event_type - scan event types used in LIM
3177 * @SIR_SCAN_EVENT_STARTED - scan command accepted by FW
3178 * @SIR_SCAN_EVENT_COMPLETED - scan has been completed by FW
3179 * @SIR_SCAN_EVENT_BSS_CHANNEL - FW is going to move to HOME channel
3180 * @SIR_SCAN_EVENT_FOREIGN_CHANNEL - FW is going to move to FORIEGN channel
3181 * @SIR_SCAN_EVENT_DEQUEUED - scan request got dequeued
3182 * @SIR_SCAN_EVENT_PREEMPTED - preempted by other high priority scan
3183 * @SIR_SCAN_EVENT_START_FAILED - scan start failed
3184 * @SIR_SCAN_EVENT_RESTARTED - scan restarted
3185 * @SIR_SCAN_EVENT_MAX - max value for event type
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08003186*/
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07003187enum sir_scan_event_type {
3188 SIR_SCAN_EVENT_STARTED = 0x1,
3189 SIR_SCAN_EVENT_COMPLETED = 0x2,
3190 SIR_SCAN_EVENT_BSS_CHANNEL = 0x4,
3191 SIR_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
3192 SIR_SCAN_EVENT_DEQUEUED = 0x10,
3193 SIR_SCAN_EVENT_PREEMPTED = 0x20,
3194 SIR_SCAN_EVENT_START_FAILED = 0x40,
3195 SIR_SCAN_EVENT_RESTARTED = 0x80,
3196 SIR_SCAN_EVENT_MAX = 0x8000
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08003197};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003198
3199typedef struct sSirScanOffloadEvent {
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07003200 enum sir_scan_event_type event;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003201 tSirResultCodes reasonCode;
3202 uint32_t chanFreq;
3203 uint32_t requestor;
3204 uint32_t scanId;
3205 tSirP2pScanType p2pScanType;
3206 uint8_t sessionId;
3207} tSirScanOffloadEvent, *tpSirScanOffloadEvent;
3208
3209/**
3210 * struct sSirUpdateChanParam - channel parameters
3211 * @chanId: ID of the channel
3212 * @pwr: power level
3213 * @dfsSet: is dfs supported or not
3214 * @half_rate: is the channel operating at 10MHz
3215 * @quarter_rate: is the channel operating at 5MHz
3216 */
3217typedef struct sSirUpdateChanParam {
3218 uint8_t chanId;
3219 uint8_t pwr;
3220 bool dfsSet;
3221 bool half_rate;
3222 bool quarter_rate;
3223} tSirUpdateChanParam, *tpSirUpdateChanParam;
3224
3225typedef struct sSirUpdateChan {
3226 uint8_t numChan;
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07003227 uint8_t ht_en;
3228 uint8_t vht_en;
3229 uint8_t vht_24_en;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003230 tSirUpdateChanParam chanParam[1];
3231} tSirUpdateChanList, *tpSirUpdateChanList;
3232
3233typedef enum eSirAddonPsReq {
3234 eSIR_ADDON_NOTHING,
3235 eSIR_ADDON_ENABLE_UAPSD,
3236 eSIR_ADDON_DISABLE_UAPSD
3237} tSirAddonPsReq;
3238
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003239#ifdef FEATURE_WLAN_CH_AVOID
3240typedef struct sSirChAvoidUpdateReq {
3241 uint32_t reserved_param;
3242} tSirChAvoidUpdateReq;
3243#endif /* FEATURE_WLAN_CH_AVOID */
3244
3245typedef struct sSirLinkSpeedInfo {
3246 /* MAC Address for the peer */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303247 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003248 uint32_t estLinkSpeed; /* Linkspeed from firmware */
3249} tSirLinkSpeedInfo, *tpSirLinkSpeedInfo;
3250
Will Huanga9814592017-05-24 15:47:58 +08003251/**
3252 * struct sir_peer_info_req - peer info request struct
3253 * @peer_macaddr: MAC address
3254 * @sessionid: vdev id
3255 *
3256 * peer info request message's struct
3257 */
3258struct sir_peer_info_req {
3259 struct qdf_mac_addr peer_macaddr;
3260 uint8_t sessionid;
3261};
3262
3263/**
3264 * struct sir_peer_info - peer information struct
3265 * @peer_macaddr: MAC address
3266 * @rssi: rssi
3267 * @tx_rate: last tx rate
3268 * @rx_rate: last rx rate
3269 *
3270 * a station's information
3271 */
3272struct sir_peer_info {
3273 struct qdf_mac_addr peer_macaddr;
3274 int8_t rssi;
3275 uint32_t tx_rate;
3276 uint32_t rx_rate;
3277};
3278
3279/**
3280 * struct sir_peer_info_resp - all peers information struct
3281 * @count: peer's number
3282 * @info: peer information
3283 *
3284 * all station's information
3285 */
3286struct sir_peer_info_resp {
3287 uint8_t count;
3288 struct sir_peer_info info[0];
3289};
3290
3291/**
3292 * struct sir_peer_info_ext_req - peer info request struct
3293 * @peer_macaddr: MAC address
3294 * @sessionid: vdev id
3295 * @reset_after_request: fw reset statistics after query
3296 *
3297 * peer info request message's struct
3298 */
3299struct sir_peer_info_ext_req {
3300 struct qdf_mac_addr peer_macaddr;
3301 uint8_t sessionid;
3302 uint8_t reset_after_request;
3303};
3304
3305/**
3306 * struct sir_peer_info_ext - peer info information struct
3307 * (refer to station_info struct in Kernel)
3308 * @peer_macaddr: MAC address
3309 * @tx_packets: packets transmitted to this station
3310 * @tx_bytes: bytes transmitted to this station
3311 * @rx_packets: packets received from this station
3312 * @rx_bytes: bytes received from this station
3313 * @rx_retries: cumulative retry counts
3314 * @tx_failed: number of failed transmissions
3315 * @rssi: The signal strength
3316 * @tx_rate: last used tx bitrate (kbps)
3317 * @tx_rate_code: last tx rate code (last_tx_rate_code of wmi_peer_stats_info)
3318 * @rx_rate: last used rx bitrate (kbps)
3319 * @rx_rate_code: last rx rate code (last_rx_rate_code of wmi_peer_stats_info)
3320 *
3321 * a station's information
3322 */
3323struct sir_peer_info_ext {
3324 struct qdf_mac_addr peer_macaddr;
3325 uint32_t tx_packets;
3326 uint64_t tx_bytes;
3327 uint32_t rx_packets;
3328 uint64_t rx_bytes;
3329 uint32_t tx_retries;
3330 uint32_t tx_failed;
3331 int32_t rssi;
3332 uint32_t tx_rate;
3333 uint32_t tx_rate_code;
3334 uint32_t rx_rate;
3335 uint32_t rx_rate_code;
3336};
3337
3338/**
3339 * struct sir_peer_info_ext_resp - all peers' information struct
3340 * @count: peer's number
3341 * @info: peer information
3342 *
3343 * all station's information
3344 */
3345struct sir_peer_info_ext_resp {
3346 uint8_t count;
3347 struct sir_peer_info_ext info[0];
3348};
3349
Will Huang496b36c2017-07-11 16:38:50 +08003350/**
3351 * @sta_num: number of peer station which has valid info
3352 * @info: peer information
3353 *
3354 * all SAP peer station's information retrieved
3355 */
3356struct sir_peer_sta_info {
3357 uint8_t sta_num;
3358 struct sir_peer_info info[MAX_PEER_STA];
3359};
3360
3361/**
3362 * @sta_num: number of peer station which has valid info
3363 * @info: peer extended information
3364 *
3365 * all SAP peer station's extended information retrieved
3366 */
3367struct sir_peer_sta_ext_info {
3368 uint8_t sta_num;
3369 struct sir_peer_info_ext info[MAX_PEER_STA];
3370};
3371
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003372typedef struct sSirAddPeriodicTxPtrn {
3373 /* MAC Address for the adapter */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303374 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003375 uint8_t ucPtrnId; /* Pattern ID */
3376 uint16_t ucPtrnSize; /* Pattern size */
3377 uint32_t usPtrnIntervalMs; /* In msec */
3378 uint8_t ucPattern[PERIODIC_TX_PTRN_MAX_SIZE]; /* Pattern buffer */
3379} tSirAddPeriodicTxPtrn, *tpSirAddPeriodicTxPtrn;
3380
3381typedef struct sSirDelPeriodicTxPtrn {
3382 /* MAC Address for the adapter */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303383 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003384 /* Bitmap of pattern IDs that need to be deleted */
3385 uint32_t ucPatternIdBitmap;
3386 uint8_t ucPtrnId; /* Pattern ID */
3387} tSirDelPeriodicTxPtrn, *tpSirDelPeriodicTxPtrn;
3388
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08003389/*---------------------------------------------------------------------------
3390* tSirIbssGetPeerInfoReqParams
3391*--------------------------------------------------------------------------*/
3392typedef struct {
3393 bool allPeerInfoReqd; /* If set, all IBSS peers stats are reported */
3394 uint8_t staIdx; /* If allPeerInfoReqd is not set, only stats */
3395 /* of peer with staIdx is reported */
3396} tSirIbssGetPeerInfoReqParams, *tpSirIbssGetPeerInfoReqParams;
3397
Rajeev Kumar94c9b452016-03-24 12:58:47 -07003398/**
3399 * typedef struct - tSirIbssGetPeerInfoParams
3400 * @mac_addr: mac address received from target
3401 * @txRate: TX rate
3402 * @mcsIndex: MCS index
3403 * @txRateFlags: TX rate flags
3404 * @rssi: RSSI
3405 */
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08003406typedef struct {
Rajeev Kumar94c9b452016-03-24 12:58:47 -07003407 uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
3408 uint32_t txRate;
3409 uint32_t mcsIndex;
3410 uint32_t txRateFlags;
3411 int8_t rssi;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08003412} tSirIbssPeerInfoParams;
3413
3414typedef struct {
3415 uint32_t status;
3416 uint8_t numPeers;
3417 tSirIbssPeerInfoParams peerInfoParams[32];
3418} tSirPeerInfoRspParams, *tpSirIbssPeerInfoRspParams;
3419
3420/*---------------------------------------------------------------------------
3421* tSirIbssGetPeerInfoRspParams
3422*--------------------------------------------------------------------------*/
3423typedef struct {
3424 uint16_t mesgType;
3425 uint16_t mesgLen;
3426 tSirPeerInfoRspParams ibssPeerInfoRspParams;
3427} tSirIbssGetPeerInfoRspParams, *tpSirIbssGetPeerInfoRspParams;
3428
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003429typedef struct {
3430 uint16_t mesgType;
3431 uint16_t mesgLen;
3432 bool suspended;
3433} tSirReadyToSuspendInd, *tpSirReadyToSuspendInd;
3434#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
3435typedef struct {
3436 uint16_t mesgType;
3437 uint16_t mesgLen;
3438 bool status;
3439} tSirReadyToExtWoWInd, *tpSirReadyToExtWoWInd;
3440#endif
3441typedef struct sSirRateUpdateInd {
3442 uint8_t nss; /* 0: 1x1, 1: 2x2 */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303443 struct qdf_mac_addr bssid;
Jeff Johnsonc1e62782017-11-09 09:50:17 -08003444 enum QDF_OPMODE dev_mode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003445 int32_t bcastDataRate; /* bcast rate unit Mbpsx10, -1:not used */
3446 /*
3447 * 0 implies RA, positive value implies fixed rate, -1 implies ignore
3448 * this param.
3449 */
3450 int32_t ucastDataRate;
3451
3452 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07003453 enum tx_rate_info ucastDataRateTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003454
3455 /*
3456 * 0 implies MCAST RA, positive value implies fixed rate,
3457 * -1 implies ignore this param
3458 */
3459 int32_t reliableMcastDataRate; /* unit Mbpsx10 */
3460
3461 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07003462 enum tx_rate_info reliableMcastDataRateTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003463
3464 /*
3465 * MCAST(or BCAST) fixed data rate in 2.4 GHz, unit Mbpsx10,
3466 * 0 implies ignore
3467 */
3468 uint32_t mcastDataRate24GHz;
3469
3470 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07003471 enum tx_rate_info mcastDataRate24GHzTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003472
3473 /*
3474 * MCAST(or BCAST) fixed data rate in 5 GHz,
3475 * unit Mbpsx10, 0 implies ignore
3476 */
3477 uint32_t mcastDataRate5GHz;
3478
3479 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07003480 enum tx_rate_info mcastDataRate5GHzTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003481
3482} tSirRateUpdateInd, *tpSirRateUpdateInd;
3483
3484#if defined(FEATURE_WLAN_CH_AVOID) || defined(FEATURE_WLAN_FORCE_SAP_SCC)
3485#define SIR_CH_AVOID_MAX_RANGE 4
3486
3487typedef struct sSirChAvoidFreqType {
3488 uint32_t start_freq;
3489 uint32_t end_freq;
3490} tSirChAvoidFreqType;
3491
3492typedef struct sSirChAvoidIndType {
3493 uint32_t avoid_range_count;
3494 tSirChAvoidFreqType avoid_freq_range[SIR_CH_AVOID_MAX_RANGE];
3495} tSirChAvoidIndType;
3496#endif /* FEATURE_WLAN_CH_AVOID || FEATURE_WLAN_FORCE_SAP_SCC */
3497
3498#define SIR_DFS_MAX_20M_SUB_CH 8
Sandeep Puligilla949eaa72015-12-17 18:43:52 -08003499#define SIR_80MHZ_START_CENTER_CH_DIFF 6
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003500
3501typedef struct sSirSmeDfsChannelList {
3502 uint32_t nchannels;
3503 /* Ch num including bonded channels on which the RADAR is present */
3504 uint8_t channels[SIR_DFS_MAX_20M_SUB_CH];
3505} tSirSmeDfsChannelList, *tpSirSmeDfsChannelList;
3506
3507typedef struct sSirSmeDfsEventInd {
3508 uint32_t sessionId;
3509 tSirSmeDfsChannelList chan_list;
3510 uint32_t dfs_radar_status;
3511 int use_nol;
3512} tSirSmeDfsEventInd, *tpSirSmeDfsEventInd;
3513
3514typedef struct sSirChanChangeRequest {
3515 uint16_t messageType;
3516 uint16_t messageLen;
3517 uint8_t targetChannel;
Kiran Kumar Lokere999e58c2016-01-07 02:18:39 -08003518 uint8_t sec_ch_offset;
Kiran Kumar Lokere13644672016-02-29 15:40:10 -08003519 enum phy_ch_width ch_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003520 uint8_t center_freq_seg_0;
3521 uint8_t center_freq_seg_1;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303522 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003523 uint32_t dot11mode;
Bala Venkateshb39ed152017-12-26 19:35:27 +05303524 tSirNwType nw_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003525 tSirMacRateSet operational_rateset;
3526 tSirMacRateSet extended_rateset;
Arif Hussain671a1902017-03-17 09:08:32 -07003527 uint32_t cac_duration_ms;
3528 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003529} tSirChanChangeRequest, *tpSirChanChangeRequest;
3530
3531typedef struct sSirChanChangeResponse {
3532 uint8_t sessionId;
3533 uint8_t newChannelNumber;
3534 uint8_t channelChangeStatus;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003535} tSirChanChangeResponse, *tpSirChanChangeResponse;
3536
3537typedef struct sSirStartBeaconIndication {
3538 uint16_t messageType;
3539 uint16_t messageLen;
3540 uint8_t beaconStartStatus;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303541 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003542} tSirStartBeaconIndication, *tpSirStartBeaconIndication;
3543
3544/* additional IE type */
3545typedef enum tUpdateIEsType {
3546 eUPDATE_IE_NONE,
3547 eUPDATE_IE_PROBE_BCN,
3548 eUPDATE_IE_PROBE_RESP,
3549 eUPDATE_IE_ASSOC_RESP,
3550
3551 /* Add type above this line */
3552 /* this is used to reset all buffer */
3553 eUPDATE_IE_ALL,
3554 eUPDATE_IE_MAX
3555} eUpdateIEsType;
3556
3557/* Modify particular IE in addition IE for prob resp Bcn */
3558typedef struct sSirModifyIE {
Anurag Chouhan6d760662016-02-20 16:05:43 +05303559 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003560 uint16_t smeSessionId;
3561 bool notify;
3562 uint8_t ieID;
3563 uint8_t ieIDLen; /*ie length as per spec */
3564 uint16_t ieBufferlength;
3565 uint8_t *pIEBuffer;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08003566 int32_t oui_length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003567
3568} tSirModifyIE, *tpSirModifyIE;
3569
Kiran Kumar Lokerebc87bec2018-02-27 20:06:42 -08003570struct send_add_ba_req {
3571 uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
3572 struct addba_send_params param;
3573};
3574
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003575/* Message format for Update IE message sent to PE */
3576typedef struct sSirModifyIEsInd {
3577 uint16_t msgType;
3578 uint16_t msgLen;
3579 tSirModifyIE modifyIE;
3580 eUpdateIEsType updateType;
3581} tSirModifyIEsInd, *tpSirModifyIEsInd;
3582
3583/* Message format for Update IE message sent to PE */
3584typedef struct sSirUpdateIE {
Anurag Chouhan6d760662016-02-20 16:05:43 +05303585 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003586 uint16_t smeSessionId;
3587 bool append;
3588 bool notify;
3589 uint16_t ieBufferlength;
3590 uint8_t *pAdditionIEBuffer;
3591} tSirUpdateIE, *tpSirUpdateIE;
3592
3593/* Message format for Update IE message sent to PE */
3594typedef struct sSirUpdateIEsInd {
3595 uint16_t msgType;
3596 uint16_t msgLen;
3597 tSirUpdateIE updateIE;
3598 eUpdateIEsType updateType;
3599} tSirUpdateIEsInd, *tpSirUpdateIEsInd;
3600
3601/* Message format for requesting channel switch announcement to lower layers */
3602typedef struct sSirDfsCsaIeRequest {
3603 uint16_t msgType;
3604 uint16_t msgLen;
3605 uint8_t targetChannel;
3606 uint8_t csaIeRequired;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303607 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Amar Singhal5cccafe2017-02-15 12:42:58 -08003608 struct ch_params ch_params;
gaoleze2920bd2017-03-21 17:38:42 +08003609 uint8_t ch_switch_beacon_cnt;
gaolez76d2a162017-03-21 19:23:58 +08003610 uint8_t ch_switch_mode;
3611 uint8_t dfs_ch_switch_disable;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003612} tSirDfsCsaIeRequest, *tpSirDfsCsaIeRequest;
3613
3614/* Indication from lower layer indicating the completion of first beacon send
3615 * after the beacon template update
3616 */
3617typedef struct sSirFirstBeaconTxCompleteInd {
3618 uint16_t messageType; /* eWNI_SME_MISSED_BEACON_IND */
3619 uint16_t length;
3620 uint8_t bssIdx;
3621} tSirFirstBeaconTxCompleteInd, *tpSirFirstBeaconTxCompleteInd;
3622
3623typedef struct sSirSmeCSAIeTxCompleteRsp {
3624 uint8_t sessionId;
3625 uint8_t chanSwIeTxStatus;
3626} tSirSmeCSAIeTxCompleteRsp, *tpSirSmeCSAIeTxCompleteRsp;
3627
3628/* Thermal Mitigation*/
3629
3630typedef struct {
3631 uint16_t minTempThreshold;
3632 uint16_t maxTempThreshold;
3633} t_thermal_level_info, *tp_thermal_level_info;
3634
3635typedef enum {
3636 WLAN_WMA_THERMAL_LEVEL_0,
3637 WLAN_WMA_THERMAL_LEVEL_1,
3638 WLAN_WMA_THERMAL_LEVEL_2,
3639 WLAN_WMA_THERMAL_LEVEL_3,
3640 WLAN_WMA_MAX_THERMAL_LEVELS
3641} t_thermal_level;
3642
Poddar, Siddarth83905022016-04-16 17:56:08 -07003643#define WLAN_THROTTLE_DUTY_CYCLE_LEVEL_MAX (4)
3644
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003645typedef struct {
3646 /* Array of thermal levels */
3647 t_thermal_level_info thermalLevels[WLAN_WMA_MAX_THERMAL_LEVELS];
3648 uint8_t thermalCurrLevel;
3649 uint8_t thermalMgmtEnabled;
3650 uint32_t throttlePeriod;
Poddar, Siddarth83905022016-04-16 17:56:08 -07003651 uint8_t throttle_duty_cycle_tbl[WLAN_THROTTLE_DUTY_CYCLE_LEVEL_MAX];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003652} t_thermal_mgmt, *tp_thermal_mgmt;
3653
3654typedef struct sSirTxPowerLimit {
3655 /* Thermal limits for 2g and 5g */
3656 uint32_t txPower2g;
3657 uint32_t txPower5g;
3658} tSirTxPowerLimit;
3659
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +05303660enum bad_peer_thresh_levels {
3661 WLAN_WMA_IEEE80211_B_LEVEL = 0,
3662 WLAN_WMA_IEEE80211_AG_LEVEL,
3663 WLAN_WMA_IEEE80211_N_LEVEL,
3664 WLAN_WMA_IEEE80211_AC_LEVEL,
3665 WLAN_WMA_IEEE80211_AX_LEVEL,
3666 WLAN_WMA_IEEE80211_MAX_LEVEL,
3667};
3668
3669#define NUM_OF_RATE_THRESH_MAX (4)
3670struct t_bad_peer_info {
3671 uint32_t cond;
3672 uint32_t delta;
3673 uint32_t percentage;
3674 uint32_t thresh[NUM_OF_RATE_THRESH_MAX];
3675 uint32_t txlimit;
3676};
3677
3678struct t_bad_peer_txtcl_config {
3679 /* Array of thermal levels */
3680 struct t_bad_peer_info threshold[WLAN_WMA_IEEE80211_MAX_LEVEL];
3681 uint32_t enable;
3682 uint32_t period;
3683 uint32_t txq_limit;
3684 uint32_t tgt_backoff;
3685 uint32_t tgt_report_prd;
3686};
3687
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003688/* notify MODEM power state to FW */
3689typedef struct {
3690 uint32_t param;
3691} tSirModemPowerStateInd, *tpSirModemPowerStateInd;
3692
3693#ifdef WLAN_FEATURE_STATS_EXT
3694typedef struct {
3695 uint32_t vdev_id;
3696 uint32_t event_data_len;
3697 uint8_t event_data[];
3698} tSirStatsExtEvent, *tpSirStatsExtEvent;
3699#endif
3700
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003701typedef struct {
3702 uint32_t event_data_len;
3703 uint8_t event_data[];
3704} tSirNanEvent, *tpSirNanEvent;
Mahesh Kumar Kalikot Veetil919e01d2016-09-09 17:09:10 -07003705
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003706typedef struct sSirSmeRoamOffloadSynchInd {
3707 uint16_t messageType; /*eWNI_SME_ROAM_OFFLOAD_SYNCH_IND */
3708 uint16_t length;
3709 uint16_t beaconProbeRespOffset;
3710 uint16_t beaconProbeRespLength;
3711 uint16_t reassocRespOffset;
3712 uint16_t reassocRespLength;
Naveen Rawat14298b92015-11-25 16:27:41 -08003713 uint16_t reassoc_req_offset;
3714 uint16_t reassoc_req_length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003715 uint8_t isBeacon;
3716 uint8_t roamedVdevId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303717 struct qdf_mac_addr bssid;
Varun Reddy Yeturu28925b42016-02-08 07:18:50 -08003718 struct qdf_mac_addr self_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003719 int8_t txMgmtPower;
3720 uint32_t authStatus;
3721 uint8_t rssi;
3722 uint8_t roamReason;
3723 uint32_t chan_freq;
3724 uint8_t kck[SIR_KCK_KEY_LEN];
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05303725 uint32_t kek_len;
3726 uint8_t kek[SIR_KEK_KEY_LEN_FILS];
3727 uint32_t pmk_len;
3728 uint8_t pmk[SIR_PMK_LEN];
3729 uint8_t pmkid[SIR_PMKID_LEN];
3730 bool update_erp_next_seq_num;
3731 uint16_t next_erp_seq_num;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003732 uint8_t replay_ctr[SIR_REPLAY_CTR_LEN];
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08003733 void *add_bss_params;
3734 tpSirSmeJoinRsp join_rsp;
3735 uint16_t aid;
Naveen Rawat8cc23b02016-07-14 12:22:56 -07003736 struct sir_hw_mode_trans_ind hw_mode_trans_ind;
Naveen Rawat746a90b2017-06-07 15:16:35 -07003737 uint8_t nss;
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05303738 struct qdf_mac_addr dst_mac;
3739 struct qdf_mac_addr src_mac;
3740 uint16_t hlp_data_len;
3741 uint8_t hlp_data[FILS_MAX_HLP_DATA_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003742} roam_offload_synch_ind;
3743
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -08003744#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003745typedef struct sSirSmeRoamOffloadSynchCnf {
3746 uint8_t sessionId;
3747} tSirSmeRoamOffloadSynchCnf, *tpSirSmeRoamOffloadSynchCnf;
3748
3749typedef struct sSirSmeHOFailureInd {
3750 uint8_t sessionId;
3751} tSirSmeHOFailureInd, *tpSirSmeHOFailureInd;
3752
3753struct roam_offload_synch_fail {
3754 uint8_t session_id;
3755};
3756
3757#endif
3758
Wen Gong7952fbd2018-04-18 11:27:23 +08003759/**
3760 * struct sir_wisa_params - WISA Mode Parameters
3761 * @mode: WISA mode
3762 * @session_id: Session ID of vdev
3763 */
3764struct sir_wisa_params {
3765 bool mode;
3766 uint8_t vdev_id;
3767};
3768
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003769#ifdef FEATURE_WLAN_EXTSCAN
3770
Wen Gong7952fbd2018-04-18 11:27:23 +08003771#define WLAN_EXTSCAN_MAX_CHANNELS 36
3772#define WLAN_EXTSCAN_MAX_BUCKETS 16
Wen Gong7952fbd2018-04-18 11:27:23 +08003773#define WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS 64
3774
3775typedef enum {
3776 eSIR_EXTSCAN_INVALID,
3777 eSIR_EXTSCAN_START_RSP,
3778 eSIR_EXTSCAN_STOP_RSP,
3779 eSIR_EXTSCAN_CACHED_RESULTS_RSP,
3780 eSIR_EXTSCAN_SET_BSSID_HOTLIST_RSP,
3781 eSIR_EXTSCAN_RESET_BSSID_HOTLIST_RSP,
3782 eSIR_EXTSCAN_SET_SIGNIFICANT_WIFI_CHANGE_RSP,
3783 eSIR_EXTSCAN_RESET_SIGNIFICANT_WIFI_CHANGE_RSP,
3784
3785 eSIR_EXTSCAN_GET_CAPABILITIES_IND,
3786 eSIR_EXTSCAN_HOTLIST_MATCH_IND,
3787 eSIR_EXTSCAN_SIGNIFICANT_WIFI_CHANGE_RESULTS_IND,
3788 eSIR_EXTSCAN_CACHED_RESULTS_IND,
3789 eSIR_EXTSCAN_SCAN_RES_AVAILABLE_IND,
3790 eSIR_EXTSCAN_SCAN_PROGRESS_EVENT_IND,
3791 eSIR_EXTSCAN_FULL_SCAN_RESULT_IND,
3792 eSIR_EPNO_NETWORK_FOUND_IND,
3793 eSIR_PASSPOINT_NETWORK_FOUND_IND,
3794 eSIR_EXTSCAN_SET_SSID_HOTLIST_RSP,
3795 eSIR_EXTSCAN_RESET_SSID_HOTLIST_RSP,
3796
3797 /* Keep this last */
3798 eSIR_EXTSCAN_CALLBACK_TYPE_MAX,
3799} tSirExtScanCallbackType;
3800
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003801/**
3802 * typedef enum wifi_scan_flags - wifi scan flags
3803 * @WIFI_SCAN_FLAG_INTERRUPTED: Indicates that scan results are not complete
3804 * because probes were not sent on some channels
3805 */
3806typedef enum {
3807 WIFI_SCAN_FLAG_INTERRUPTED = 1,
3808} wifi_scan_flags;
3809
3810typedef enum {
3811 WIFI_BAND_UNSPECIFIED,
3812 WIFI_BAND_BG = 1, /* 2.4 GHz */
3813 WIFI_BAND_A = 2, /* 5 GHz without DFS */
3814 WIFI_BAND_ABG = 3, /* 2.4 GHz + 5 GHz; no DFS */
3815 WIFI_BAND_A_DFS_ONLY = 4, /* 5 GHz DFS only */
3816 /* 5 is reserved */
3817 WIFI_BAND_A_WITH_DFS = 6, /* 5 GHz with DFS */
3818 WIFI_BAND_ABG_WITH_DFS = 7, /* 2.4 GHz + 5 GHz with DFS */
3819
3820 /* Keep it last */
3821 WIFI_BAND_MAX
3822} tWifiBand;
3823
Mukul Sharma45114d92016-08-12 19:34:14 +05303824/**
3825 * enum wifi_extscan_event_type - extscan event type
3826 * @WIFI_EXTSCAN_RESULTS_AVAILABLE: reported when REPORT_EVENTS_EACH_SCAN is set
3827 * and a scan cycle completes. WIFI_SCAN_THRESHOLD_NUM_SCANS or
3828 * WIFI_SCAN_THRESHOLD_PERCENT can be reported instead if the
3829 * reason for the event is available; however, at most one of
3830 * these events should be reported per scan.
3831 * @WIFI_EXTSCAN_THRESHOLD_NUM_SCANS: can be reported when
3832 * REPORT_EVENTS_EACH_SCAN is not set and
3833 * report_threshold_num_scans is reached.
3834 * @WIFI_EXTSCAN_THRESHOLD_PERCENT: can be reported when REPORT_EVENTS_EACH_SCAN
3835 * is not set and report_threshold_percent is reached.
3836 * @WIFI_SCAN_DISABLED: reported when currently executing gscans are disabled
3837 * start_gscan will need to be called again in order to continue
3838 * scanning.
3839 * @WIFI_EXTSCAN_BUCKET_STARTED_EVENT: Bucket started event
3840 * This event is consumed in driver only.
3841 * @WIFI_EXTSCAN_CYCLE_STARTED_EVENT: Cycle started event.
3842 * This event is consumed in driver only.
3843 * @WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT: Cycle complete event. This event
3844 * triggers @WIFI_EXTSCAN_RESULTS_AVAILABLE to the user space.
3845 */
3846enum wifi_extscan_event_type {
Mukul Sharmafa937be2016-08-12 18:13:36 +05303847 WIFI_EXTSCAN_RESULTS_AVAILABLE,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303848 WIFI_EXTSCAN_THRESHOLD_NUM_SCANS,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303849 WIFI_EXTSCAN_THRESHOLD_PERCENT,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303850 WIFI_SCAN_DISABLED,
3851
Mukul Sharmafa937be2016-08-12 18:13:36 +05303852 WIFI_EXTSCAN_BUCKET_STARTED_EVENT = 0x10,
3853 WIFI_EXTSCAN_CYCLE_STARTED_EVENT,
3854 WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT,
Mukul Sharma45114d92016-08-12 19:34:14 +05303855};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003856
3857/**
3858 * enum extscan_configuration_flags - extscan config flags
3859 * @EXTSCAN_LP_EXTENDED_BATCHING: extended batching
3860 */
3861enum extscan_configuration_flags {
3862 EXTSCAN_LP_EXTENDED_BATCHING = 0x00000001,
3863};
3864
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003865/**
3866 * struct ext_scan_capabilities_response - extscan capabilities response data
3867 * @requestId: request identifier
3868 * @status: status
3869 * @max_scan_cache_size: total space allocated for scan (in bytes)
3870 * @max_scan_buckets: maximum number of channel buckets
3871 * @max_ap_cache_per_scan: maximum number of APs that can be stored per scan
3872 * @max_rssi_sample_size: number of RSSI samples used for averaging RSSI
3873 * @ax_scan_reporting_threshold: max possible report_threshold
3874 * @max_hotlist_bssids: maximum number of entries for hotlist APs
3875 * @max_significant_wifi_change_aps: maximum number of entries for
3876 * significant wifi change APs
3877 * @max_bssid_history_entries: number of BSSID/RSSI entries that device can hold
3878 * @max_hotlist_ssids: maximum number of entries for hotlist SSIDs
3879 * @max_number_epno_networks: max number of epno entries
3880 * @max_number_epno_networks_by_ssid: max number of epno entries
3881 * if ssid is specified, that is, epno entries for
3882 * which an exact match is required,
3883 * or entries corresponding to hidden ssids
3884 * @max_number_of_white_listed_ssid: max number of white listed SSIDs
Padma, Santhosh Kumar1ac02402016-11-02 18:04:14 +05303885 * @max_number_of_black_listed_bssid: max number of black listed BSSIDs
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003886 */
3887struct ext_scan_capabilities_response {
3888 uint32_t requestId;
3889 uint32_t status;
3890
3891 uint32_t max_scan_cache_size;
3892 uint32_t max_scan_buckets;
3893 uint32_t max_ap_cache_per_scan;
3894 uint32_t max_rssi_sample_size;
3895 uint32_t max_scan_reporting_threshold;
3896
3897 uint32_t max_hotlist_bssids;
3898 uint32_t max_significant_wifi_change_aps;
3899
3900 uint32_t max_bssid_history_entries;
3901 uint32_t max_hotlist_ssids;
3902 uint32_t max_number_epno_networks;
3903 uint32_t max_number_epno_networks_by_ssid;
3904 uint32_t max_number_of_white_listed_ssid;
Padma, Santhosh Kumar1ac02402016-11-02 18:04:14 +05303905 uint32_t max_number_of_black_listed_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003906};
3907
3908typedef struct {
3909 uint32_t requestId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003910 uint32_t status;
3911} tSirExtScanGetCachedResultsRspParams, *tpSirExtScanGetCachedResultsRspParams;
3912
3913typedef struct {
3914 /* Time of discovery */
3915 uint64_t ts;
3916
3917 /* Null terminated SSID */
3918 uint8_t ssid[SIR_MAC_MAX_SSID_LENGTH + 1];
3919
Anurag Chouhan6d760662016-02-20 16:05:43 +05303920 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003921
3922 /* Frequency in MHz */
3923 uint32_t channel;
3924
3925 /* RSSI in dBm */
3926 int32_t rssi;
3927
3928 /* RTT in nanoseconds */
3929 uint32_t rtt;
3930
3931 /* Standard deviation in rtt */
3932 uint32_t rtt_sd;
3933
3934 /* Period advertised in the beacon */
3935 uint16_t beaconPeriod;
3936
3937 /* Capabilities advertised in the beacon */
3938 uint16_t capability;
3939
3940 uint16_t ieLength;
3941
3942 uint8_t ieData[];
3943} tSirWifiScanResult, *tpSirWifiScanResult;
3944
3945/**
3946 * struct extscan_hotlist_match - extscan hotlist match
3947 * @requestId: request identifier
3948 * @numOfAps: number of bssids retrieved by the scan
3949 * @moreData: 0 - for last fragment
3950 * 1 - still more fragment(s) coming
3951 * @ap: wifi scan result
3952 */
3953struct extscan_hotlist_match {
3954 uint32_t requestId;
3955 bool moreData;
3956 bool ap_found;
3957 uint32_t numOfAps;
3958 tSirWifiScanResult ap[];
3959};
3960
3961/**
3962 * struct extscan_cached_scan_result - extscan cached scan result
3963 * @scan_id: a unique identifier for the scan unit
3964 * @flags: a bitmask with additional information about scan
3965 * @num_results: number of bssids retrieved by the scan
Mukul Sharmaf7cb3ab2016-08-12 19:53:52 +05303966 * @buckets_scanned: bitmask of buckets scanned in current extscan cycle
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003967 * @ap: wifi scan bssid results info
3968 */
3969struct extscan_cached_scan_result {
3970 uint32_t scan_id;
3971 uint32_t flags;
3972 uint32_t num_results;
Mukul Sharmaf7cb3ab2016-08-12 19:53:52 +05303973 uint32_t buckets_scanned;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003974 tSirWifiScanResult *ap;
3975};
3976
3977/**
3978 * struct tSirWifiScanResultEvent - wifi scan result event
3979 * @requestId: request identifier
3980 * @ap_found: flag to indicate ap found or not
3981 * true: AP was found
3982 * false: AP was lost
3983 * @numOfAps: number of aps
3984 * @moreData: more data
3985 * @ap: bssid information
3986 *
3987 */
3988typedef struct {
3989 uint32_t requestId;
3990 bool ap_found;
3991 uint32_t numOfAps;
3992 bool moreData;
3993 tSirWifiScanResult ap[];
3994} tSirWifiScanResultEvent, *tpSirWifiScanResultEvent;
3995
3996/**
3997 * struct extscan_cached_scan_results - extscan cached scan results
3998 * @request_id: request identifier
3999 * @more_data: 0 - for last fragment
4000 * 1 - still more fragment(s) coming
4001 * @num_scan_ids: number of scan ids
4002 * @result: wifi scan result
4003 */
4004struct extscan_cached_scan_results {
4005 uint32_t request_id;
4006 bool more_data;
4007 uint32_t num_scan_ids;
4008 struct extscan_cached_scan_result *result;
4009};
4010
4011
4012/**
4013 * struct tSirWifiFullScanResultEvent - extscan full scan event
4014 * @request_id: request identifier
4015 * @moreData: 0 - for last fragment
4016 * 1 - still more fragment(s) coming
4017 * @ap: bssid info
4018 *
Jeff Johnsondab58602018-07-14 15:30:24 -07004019 * Reported when each probe response is received, if report_events
4020 * enabled in struct wifi_scan_cmd_req_params
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004021 */
4022typedef struct {
4023 uint32_t requestId;
4024 bool moreData;
4025 tSirWifiScanResult ap;
4026} tSirWifiFullScanResultEvent, *tpSirWifiFullScanResultEvent;
4027
4028/**
4029 * struct pno_match_found - epno match found
4030 * @request_id: request identifier
4031 * @moreData: 0 - for last fragment
4032 * 1 - still more fragment(s) coming
4033 * @num_results: number of bssids, driver sends this event to upper layer
4034 * for every beacon, hence %num_results is always set to 1.
4035 * @ap: bssid info
4036 *
4037 * Reported when each beacon probe response is received with
4038 * epno match found tag.
4039 */
4040struct pno_match_found {
4041 uint32_t request_id;
4042 bool more_data;
4043 uint32_t num_results;
4044 tSirWifiScanResult ap[];
4045};
4046
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004047/**
4048 * struct sir_extscan_generic_response -
4049 * Generic ExtScan Response structure
4050 * @request_id: ID of the request
4051 * @status: operation status returned by firmware
4052 */
4053struct sir_extscan_generic_response {
4054 uint32_t request_id;
4055 uint32_t status;
4056};
4057
4058typedef struct {
Anurag Chouhan6d760662016-02-20 16:05:43 +05304059 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004060 uint32_t channel;
4061 uint32_t numOfRssi;
4062
4063 /* Rssi history in db */
4064 int32_t rssi[];
4065} tSirWifiSignificantChange, *tpSirWifiSignificantChange;
4066
4067typedef struct {
4068 uint32_t requestId;
4069
4070 bool moreData;
4071 uint32_t numResults;
4072 tSirWifiSignificantChange ap[];
4073} tSirWifiSignificantChangeEvent, *tpSirWifiSignificantChangeEvent;
4074
4075typedef struct {
4076 uint32_t requestId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004077 uint32_t numResultsAvailable;
4078} tSirExtScanResultsAvailableIndParams, *tpSirExtScanResultsAvailableIndParams;
4079
4080typedef struct {
4081 uint32_t requestId;
4082 uint32_t status;
4083 uint8_t scanEventType;
Mukul Sharmafa937be2016-08-12 18:13:36 +05304084 uint32_t buckets_scanned;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004085} tSirExtScanOnScanEventIndParams, *tpSirExtScanOnScanEventIndParams;
4086
Mukul Sharmae8c919f2016-10-02 20:35:15 +05304087#define MAX_EPNO_NETWORKS 64
4088
Jeff Johnson96f93a32016-11-18 11:02:24 -08004089#define SIR_PASSPOINT_LIST_MAX_NETWORKS 8
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004090
4091/**
4092 * struct wifi_passpoint_match - wifi passpoint network match
4093 * @id: network block identifier for the matched network
4094 * @anqp_len: length of ANQP blob
4095 * @ap: scan result, with channel and beacon information
4096 * @anqp: ANQP data, in the information_element format
4097 */
4098struct wifi_passpoint_match {
4099 uint32_t request_id;
4100 uint32_t id;
4101 uint32_t anqp_len;
4102 tSirWifiScanResult ap;
4103 uint8_t anqp[];
4104};
4105#endif /* FEATURE_WLAN_EXTSCAN */
4106
4107#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
4108typedef struct {
4109 uint32_t timer_val;
4110} tSirAutoShutdownCmdParams;
4111
4112typedef struct {
4113 uint32_t shutdown_reason;
4114} tSirAutoShutdownEvtParams;
4115#endif
4116
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05304117#ifdef WLAN_POWER_DEBUGFS
4118/**
4119 * struct power_stats_response - Power stats response
4120 * @cumulative_sleep_time_ms: cumulative sleep time in ms
4121 * @cumulative_total_on_time_ms: total awake time in ms
4122 * @deep_sleep_enter_counter: deep sleep enter counter
4123 * @last_deep_sleep_enter_tstamp_ms: last deep sleep enter timestamp
4124 * @debug_register_fmt: debug registers format
4125 * @num_debug_register: number of debug registers
4126 * @debug_registers: Pointer to the debug registers buffer
4127 */
4128struct power_stats_response {
4129 uint32_t cumulative_sleep_time_ms;
4130 uint32_t cumulative_total_on_time_ms;
4131 uint32_t deep_sleep_enter_counter;
4132 uint32_t last_deep_sleep_enter_tstamp_ms;
4133 uint32_t debug_register_fmt;
4134 uint32_t num_debug_register;
4135 uint32_t *debug_registers;
4136};
4137#endif
4138
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +05304139/**
4140 * struct lfr_firmware_status - LFR status in firmware
4141 * @is_disabled: Is LFR disabled in FW
4142 * @disable_lfr_event: Disable attempt done in FW
4143 */
4144struct lfr_firmware_status {
4145 uint32_t is_disabled;
4146 struct completion disable_lfr_event;
4147};
4148
4149/**
4150 * struct rso_cmd_status - RSO Command status
4151 * @vdev_id: Vdev ID for which RSO command sent
4152 * @status: Status of RSO command sent to FW
4153 */
4154struct rso_cmd_status {
4155 uint32_t vdev_id;
4156 bool status;
4157};
4158
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004159typedef struct {
4160 uint8_t oui[WIFI_SCANNING_MAC_OUI_LENGTH];
Rajeev Kumar Sirasanagandla686abd92017-06-08 18:09:01 +05304161 uint32_t vdev_id;
4162 bool enb_probe_req_sno_randomization;
Rajeev Kumar Sirasanagandlaaec0b082017-06-21 11:59:41 +05304163 struct probe_req_whitelist_attr ie_whitelist;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004164} tSirScanMacOui, *tpSirScanMacOui;
4165
4166enum {
4167 SIR_AP_RX_DATA_OFFLOAD = 0x00,
4168 SIR_STA_RX_DATA_OFFLOAD = 0x01,
4169};
4170
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07004171/**
Naveen Rawata410c5a2016-09-19 14:22:33 -07004172 * struct sir_set_vdev_ies_per_band
4173 * @msg_type: message type
4174 * @len: message length
4175 * @vdev_id: vdev id
4176 *
4177 * Message wrapper structure for eWNI_SME_SET_VDEV_IES_PER_BAND.
4178 */
4179struct sir_set_vdev_ies_per_band {
4180 uint16_t msg_type;
4181 uint16_t len;
4182 uint32_t vdev_id;
4183};
4184
4185/**
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07004186 * struct sir_set_ht_vht_cfg - ht, vht IE config
4187 * @msg_type: message type
4188 * @len: message length
4189 * @pdev_id: pdev id
4190 * @nss: Nss value
4191 * @dot11mode: Dot11 mode.
4192 *
4193 * Message wrapper structure for set HT/VHT IE req.
4194 */
4195struct sir_set_ht_vht_cfg {
4196 uint16_t msg_type;
4197 uint16_t len;
4198 uint32_t pdev_id;
4199 uint32_t nss;
4200 uint32_t dot11mode;
4201};
4202
Qiwei Cai3719efe2018-06-11 21:09:29 +08004203#define WIFI_INVALID_PEER_ID (-1)
4204#define WIFI_INVALID_VDEV_ID (-1)
4205#define WIFI_MAX_AC (4)
4206
4207typedef struct {
4208 uint32_t paramId;
4209 uint8_t ifaceId;
4210 uint32_t rspId;
4211 uint32_t moreResultToFollow;
4212 uint32_t nr_received;
4213 union {
4214 uint32_t num_peers;
4215 uint32_t num_radio;
4216 };
4217
4218 uint32_t peer_event_number;
4219 /* Variable length field - Do not add anything after this */
4220 uint8_t results[0];
4221} tSirLLStatsResults, *tpSirLLStatsResults;
4222
4223#ifdef WLAN_FEATURE_LINK_LAYER_STATS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004224/*---------------------------------------------------------------------------
4225 WLAN_HAL_LL_NOTIFY_STATS
4226 ---------------------------------------------------------------------------*/
4227
4228/******************************LINK LAYER Statistics**********************/
4229
4230typedef int tSirWifiRadio;
4231typedef int tSirWifiChannel;
4232typedef int tSirwifiTxRate;
4233
Qiwei Cai3719efe2018-06-11 21:09:29 +08004234typedef struct {
4235 uint32_t reqId;
4236 uint8_t staId;
4237 uint32_t mpduSizeThreshold;
4238 uint32_t aggressiveStatisticsGathering;
4239} tSirLLStatsSetReq, *tpSirLLStatsSetReq;
4240
4241typedef struct {
4242 uint32_t reqId;
4243 uint8_t staId;
4244 uint32_t paramIdMask;
4245} tSirLLStatsGetReq, *tpSirLLStatsGetReq;
4246
4247typedef struct {
4248 uint32_t reqId;
4249 uint8_t staId;
4250 uint32_t statsClearReqMask;
4251 uint8_t stopReq;
4252} tSirLLStatsClearReq, *tpSirLLStatsClearReq;
4253
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004254/* channel operating width */
4255typedef enum {
4256 WIFI_CHAN_WIDTH_20 = 0,
4257 WIFI_CHAN_WIDTH_40 = 1,
4258 WIFI_CHAN_WIDTH_80 = 2,
4259 WIFI_CHAN_WIDTH_160 = 3,
4260 WIFI_CHAN_WIDTH_80P80 = 4,
4261 WIFI_CHAN_WIDTH_5 = 5,
4262 WIFI_CHAN_WIDTH_10 = 6,
4263} tSirWifiChannelWidth;
4264
4265typedef enum {
4266 WIFI_DISCONNECTED = 0,
4267 WIFI_AUTHENTICATING = 1,
4268 WIFI_ASSOCIATING = 2,
4269 WIFI_ASSOCIATED = 3,
4270 WIFI_EAPOL_STARTED = 4, /* if done by firmware/driver */
4271 WIFI_EAPOL_COMPLETED = 5, /* if done by firmware/driver */
4272} tSirWifiConnectionState;
4273
4274typedef enum {
4275 WIFI_ROAMING_IDLE = 0,
4276 WIFI_ROAMING_ACTIVE = 1,
4277} tSirWifiRoamState;
4278
4279typedef enum {
4280 WIFI_INTERFACE_STA = 0,
4281 WIFI_INTERFACE_SOFTAP = 1,
4282 WIFI_INTERFACE_IBSS = 2,
4283 WIFI_INTERFACE_P2P_CLIENT = 3,
4284 WIFI_INTERFACE_P2P_GO = 4,
4285 WIFI_INTERFACE_NAN = 5,
4286 WIFI_INTERFACE_MESH = 6,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -07004287 WIFI_INTERFACE_NDI = 7,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004288} tSirWifiInterfaceMode;
4289
4290/* set for QOS association */
4291#define WIFI_CAPABILITY_QOS 0x00000001
4292/* set for protected assoc (802.11 beacon frame control protected bit set) */
4293#define WIFI_CAPABILITY_PROTECTED 0x00000002
4294/* set if 802.11 Extended Capabilities element interworking bit is set */
4295#define WIFI_CAPABILITY_INTERWORKING 0x00000004
4296/* set for HS20 association */
4297#define WIFI_CAPABILITY_HS20 0x00000008
4298/* set is 802.11 Extended Capabilities element UTF-8 SSID bit is set */
4299#define WIFI_CAPABILITY_SSID_UTF8 0x00000010
4300/* set is 802.11 Country Element is present */
4301#define WIFI_CAPABILITY_COUNTRY 0x00000020
4302
4303typedef struct {
4304 /* tSirWifiInterfaceMode */
4305 /* interface mode */
4306 uint8_t mode;
4307 /* interface mac address (self) */
Anurag Chouhan6d760662016-02-20 16:05:43 +05304308 struct qdf_mac_addr macAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004309 /* tSirWifiConnectionState */
4310 /* connection state (valid for STA, CLI only) */
4311 uint8_t state;
4312 /* tSirWifiRoamState */
4313 /* roaming state */
4314 uint32_t roaming;
4315 /* WIFI_CAPABILITY_XXX (self) */
4316 uint32_t capabilities;
4317 /* null terminated SSID */
4318 uint8_t ssid[33];
4319 /* bssid */
Anurag Chouhan6d760662016-02-20 16:05:43 +05304320 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004321 /* country string advertised by AP */
4322 uint8_t apCountryStr[WNI_CFG_COUNTRY_CODE_LEN];
4323 /* country string for this association */
4324 uint8_t countryStr[WNI_CFG_COUNTRY_CODE_LEN];
4325} tSirWifiInterfaceInfo, *tpSirWifiInterfaceInfo;
4326
4327/* channel information */
4328typedef struct {
4329 /* channel width (20, 40, 80, 80+80, 160) */
4330 tSirWifiChannelWidth width;
4331 /* primary 20 MHz channel */
4332 tSirWifiChannel centerFreq;
4333 /* center frequency (MHz) first segment */
4334 tSirWifiChannel centerFreq0;
4335 /* center frequency (MHz) second segment */
4336 tSirWifiChannel centerFreq1;
4337} tSirWifiChannelInfo, *tpSirWifiChannelInfo;
4338
4339/* wifi rate info */
4340typedef struct {
4341 /* 0: OFDM, 1:CCK, 2:HT 3:VHT 4..7 reserved */
4342 uint32_t preamble:3;
4343 /* 0:1x1, 1:2x2, 3:3x3, 4:4x4 */
4344 uint32_t nss:2;
4345 /* 0:20MHz, 1:40Mhz, 2:80Mhz, 3:160Mhz */
4346 uint32_t bw:3;
4347 /* OFDM/CCK rate code would be as per ieee std in units of 0.5mbps */
4348 /* HT/VHT it would be mcs index */
4349 uint32_t rateMcsIdx:8;
4350 /* reserved */
4351 uint32_t reserved:16;
4352 /* units of 100 Kbps */
4353 uint32_t bitrate;
4354} tSirWifiRate, *tpSirWifiRate;
4355
4356/* channel statistics */
4357typedef struct {
4358 /* channel */
4359 tSirWifiChannelInfo channel;
4360 /* msecs the radio is awake (32 bits number accruing over time) */
4361 uint32_t onTime;
4362 /* msecs the CCA register is busy (32 bits number accruing over time) */
4363 uint32_t ccaBusyTime;
4364} tSirWifiChannelStats, *tpSirWifiChannelStats;
4365
Srinivas Girigowda458f2282016-10-25 11:27:52 -07004366#define MAX_TPC_LEVELS 64
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004367/* radio statistics */
4368typedef struct {
4369 /* wifi radio (if multiple radio supported) */
4370 tSirWifiRadio radio;
4371 /* msecs the radio is awake (32 bits number accruing over time) */
4372 uint32_t onTime;
4373 /* msecs the radio is transmitting
4374 * (32 bits number accruing over time)
4375 */
4376 uint32_t txTime;
4377 /* msecs the radio is in active receive
4378 *(32 bits number accruing over time)
4379 */
4380 uint32_t rxTime;
4381 /* msecs the radio is awake due to all scan
4382 * (32 bits number accruing over time)
4383 */
4384 uint32_t onTimeScan;
4385 /* msecs the radio is awake due to NAN
4386 * (32 bits number accruing over time)
4387 */
4388 uint32_t onTimeNbd;
4389 /* msecs the radio is awake due to Gscan
4390 * (32 bits number accruing over time)
4391 */
4392 uint32_t onTimeGscan;
4393 /* msecs the radio is awake due to roam?scan
4394 * (32 bits number accruing over time)
4395 */
4396 uint32_t onTimeRoamScan;
4397 /* msecs the radio is awake due to PNO scan
4398 * (32 bits number accruing over time)
4399 */
4400 uint32_t onTimePnoScan;
4401 /* msecs the radio is awake due to HS2.0 scans and GAS exchange
4402 * (32 bits number accruing over time)
4403 */
4404 uint32_t onTimeHs20;
Srinivas Girigowdaad874a82016-10-25 14:08:00 -07004405
4406 /* tx time (in milliseconds) per TPC level (0.5 dBm) */
4407 uint32_t total_num_tx_power_levels;
4408 uint32_t *tx_time_per_power_level;
4409
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004410 /* number of channels */
4411 uint32_t numChannels;
Srinivas Girigowda458f2282016-10-25 11:27:52 -07004412
4413 /* tx time (in milliseconds) per TPC level (0.5 dBm) */
4414 uint32_t tx_time_per_tpc[MAX_TPC_LEVELS];
4415
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08004416 uint32_t on_time_host_scan;
4417 uint32_t on_time_lpi_scan;
4418
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004419 /* channel statistics tSirWifiChannelStats */
Srinivas Girigowda57b450e2016-10-27 21:00:46 -07004420 tSirWifiChannelStats *channels;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004421} tSirWifiRadioStat, *tpSirWifiRadioStat;
4422
4423/* per rate statistics */
4424typedef struct {
4425 /* rate information */
4426 tSirWifiRate rate;
4427 /* number of successfully transmitted data pkts (ACK rcvd) */
4428 uint32_t txMpdu;
4429 /* number of received data pkts */
4430 uint32_t rxMpdu;
4431 /* number of data packet losses (no ACK) */
4432 uint32_t mpduLost;
4433 /* total number of data pkt retries * */
4434 uint32_t retries;
4435 /* number of short data pkt retries */
4436 uint32_t retriesShort;
4437 /* number of long data pkt retries */
4438 uint32_t retriesLong;
4439} tSirWifiRateStat, *tpSirWifiRateStat;
4440
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004441/* wifi peer type */
4442typedef enum {
4443 WIFI_PEER_STA,
4444 WIFI_PEER_AP,
4445 WIFI_PEER_P2P_GO,
4446 WIFI_PEER_P2P_CLIENT,
4447 WIFI_PEER_NAN,
4448 WIFI_PEER_TDLS,
4449 WIFI_PEER_INVALID,
4450} tSirWifiPeerType;
4451
4452/* per peer statistics */
4453typedef struct {
4454 /* peer type (AP, TDLS, GO etc.) */
Dustin Brown877a5a92016-11-17 13:56:52 -08004455 enum wmi_peer_type type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004456 /* mac address */
Anurag Chouhan6d760662016-02-20 16:05:43 +05304457 struct qdf_mac_addr peerMacAddress;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004458 /* peer WIFI_CAPABILITY_XXX */
4459 uint32_t capabilities;
Zhang Qiana6e9c102016-12-22 16:47:24 +08004460 union {
4461 /* peer power saving mode */
4462 uint32_t power_saving;
4463 /* number of rates */
4464 uint32_t numRate;
4465 };
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004466 /* per rate statistics, number of entries = num_rate */
4467 tSirWifiRateStat rateStats[0];
4468} tSirWifiPeerInfo, *tpSirWifiPeerInfo;
4469
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004470/* Interface statistics - corresponding to 2nd most
4471 * LSB in wifi statistics bitmap for getting statistics
4472 */
4473typedef struct {
4474 /* current state of the interface */
4475 tSirWifiInterfaceInfo info;
Min Liuffb250d2018-07-11 17:35:32 +08004476
gaolezb432ed92017-03-16 18:40:04 +08004477 uint32_t rts_succ_cnt;
4478 uint32_t rts_fail_cnt;
4479 uint32_t ppdu_succ_cnt;
4480 uint32_t ppdu_fail_cnt;
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08004481
Min Liuffb250d2018-07-11 17:35:32 +08004482 /* link statistics */
4483 wmi_iface_link_stats link_stats;
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08004484
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004485 /* per ac data packet statistics */
Min Liuffb250d2018-07-11 17:35:32 +08004486 wmi_wmm_ac_stats ac_stats[WIFI_AC_MAX];
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08004487
4488 uint32_t num_offload_stats;
Min Liuffb250d2018-07-11 17:35:32 +08004489 wmi_iface_offload_stats offload_stats[WMI_OFFLOAD_STATS_TYPE_MAX];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004490} tSirWifiIfaceStat, *tpSirWifiIfaceStat;
4491
4492/* Peer statistics - corresponding to 3rd most LSB in
4493 * wifi statistics bitmap for getting statistics
4494 */
4495typedef struct {
4496 /* number of peers */
4497 uint32_t numPeers;
4498 /* per peer statistics */
4499 tSirWifiPeerInfo peerInfo[0];
4500} tSirWifiPeerStat, *tpSirWifiPeerStat;
4501
4502/* wifi statistics bitmap for getting statistics */
4503#define WMI_LINK_STATS_RADIO 0x00000001
4504#define WMI_LINK_STATS_IFACE 0x00000002
4505#define WMI_LINK_STATS_ALL_PEER 0x00000004
4506#define WMI_LINK_STATS_PER_PEER 0x00000008
4507
4508/* wifi statistics bitmap for clearing statistics */
4509/* all radio statistics */
4510#define WIFI_STATS_RADIO 0x00000001
4511/* cca_busy_time (within radio statistics) */
4512#define WIFI_STATS_RADIO_CCA 0x00000002
4513/* all channel statistics (within radio statistics) */
4514#define WIFI_STATS_RADIO_CHANNELS 0x00000004
4515/* all scan statistics (within radio statistics) */
4516#define WIFI_STATS_RADIO_SCAN 0x00000008
4517/* all interface statistics */
4518#define WIFI_STATS_IFACE 0x00000010
4519/* all tx rate statistics (within interface statistics) */
4520#define WIFI_STATS_IFACE_TXRATE 0x00000020
4521/* all ac statistics (within interface statistics) */
4522#define WIFI_STATS_IFACE_AC 0x00000040
4523/* all contention (min, max, avg) statistics (within ac statistics) */
4524#define WIFI_STATS_IFACE_CONTENTION 0x00000080
Mukul Sharma491021c2016-09-29 21:39:19 +05304525/* All peer stats on this interface */
4526#define WIFI_STATS_IFACE_ALL_PEER 0x00000100
4527/* Clear particular peer stats depending on the peer_mac */
4528#define WIFI_STATS_IFACE_PER_PEER 0x00000200
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004529
Zhang Qiana6e9c102016-12-22 16:47:24 +08004530/**
4531 * struct sir_wifi_iface_tx_fail - TX failure event
4532 * @tid: TX TID
4533 * @msdu_num: TX MSDU failed counter
4534 * @status: TX status from HTT message.
4535 * Only failure status will be involved.
4536 */
4537struct sir_wifi_iface_tx_fail {
4538 uint8_t tid;
4539 uint16_t msdu_num;
4540 enum htt_tx_status status;
4541};
4542
Zhang Qian73c348a2017-03-13 16:15:55 +08004543/**
4544 * struct sir_wifi_chan_cca_stats - channal CCA stats
4545 * @vdev_id: vdev ID
4546 * @idle_time: percentage of idle time, no TX, no RX, no interference
4547 * @tx_time: percentage of time transmitting packets
4548 * @rx_in_bss_time: percentage of time receiving packets in current BSS
4549 * @rx_out_bss_time: percentage of time receiving packets not in current BSS
4550 * @rx_busy_time: percentage of time interference detected
4551 * @rx_in_bad_cond_time: percentage of time receiving packets with errors
4552 * or packets flagged as retransmission or seqnum discontinued.
4553 * @tx_in_bad_cond_time: percentage of time the device transmitted packets
4554 * that haven't been ACKed.
4555 * @wlan_not_avail_time: percentage of time the chip is unable to
4556 * work in normal conditions.
4557 */
4558struct sir_wifi_chan_cca_stats {
4559 uint32_t vdev_id;
4560 uint32_t idle_time;
4561 uint32_t tx_time;
4562 uint32_t rx_in_bss_time;
4563 uint32_t rx_out_bss_time;
4564 uint32_t rx_busy_time;
4565 uint32_t rx_in_bad_cond_time;
4566 uint32_t tx_in_bad_cond_time;
4567 uint32_t wlan_not_avail_time;
4568};
4569
4570#define WIFI_MAX_CHAINS 8
4571
4572/**
4573 * struct sir_wifi_peer_signal_stats - peer signal stats
4574 * @vdev_id: vdev ID
4575 * @peer_id: peer ID
4576 * @per_ant_snr: per antenna SNR
4577 * @nf: peer background noise
Zhang Qian303ebe92017-05-18 13:59:07 +08004578 * @per_ant_rx_mpdus: MPDUs received per antenna
4579 * @per_ant_tx_mpdus: MPDUs transferred per antenna
4580 * @num_chain: valid chain count
Zhang Qian73c348a2017-03-13 16:15:55 +08004581 */
4582struct sir_wifi_peer_signal_stats {
4583 uint32_t vdev_id;
4584 uint32_t peer_id;
4585
4586 /* per antenna SNR in current bss */
4587 int32_t per_ant_snr[WIFI_MAX_CHAINS];
4588
4589 /* Background noise */
4590 int32_t nf[WIFI_MAX_CHAINS];
Zhang Qian303ebe92017-05-18 13:59:07 +08004591
4592 int32_t per_ant_rx_mpdus[WIFI_MAX_CHAINS];
4593 int32_t per_ant_tx_mpdus[WIFI_MAX_CHAINS];
4594 int32_t num_chain;
Zhang Qian73c348a2017-03-13 16:15:55 +08004595};
4596
4597#define WIFI_VDEV_NUM 4
4598#define WFIF_MCS_NUM 10
4599#define WIFI_AGGR_NUM 8
4600#define WIFI_DELAY_SIZE 11
4601
4602/**
4603 * struct sir_wifi_tx - per AC tx stats
4604 * @msdus: number of totoal MSDUs on MAC layer in the period
4605 * @mpdus: number of totoal MPDUs on MAC layer in the period
4606 * @ppdus: number of totoal PPDUs on PHY layer in the period
4607 * @bytes: bytes of tx data on MAC layer in the period
4608 * @drops: number of TX packets cancelled due to any reason in the period,
4609 * such as WMM limitation/bandwidth limitation/radio congestion
4610 * @drop_bytes: bytes of dropped TX packets in the period
4611 * @retries: number of unacked transmissions of MPDUs
4612 * @failed: number of packets have not been ACKed despite retried
4613 * @aggr_len: length of the MPDU aggregation size buffer
4614 * @mpdu_aggr_size: histogram of MPDU aggregation size
4615 * @success_mcs_len: length of success mcs buffer
4616 * @success_mcs: histogram of successed received MPDUs encoding rate
4617 * @fail_mcs_len: length of failed mcs buffer
4618 * @fail_mcs: histogram of failed received MPDUs encoding rate
4619 * @delay_len: length of the delay histofram buffer
4620 * @delay: histogram of delays on MAC layer
4621 */
4622struct sir_wifi_tx {
4623 uint32_t msdus;
4624 uint32_t mpdus;
4625 uint32_t ppdus;
4626 uint32_t bytes;
4627 uint32_t drops;
4628 uint32_t drop_bytes;
4629 uint32_t retries;
4630 uint32_t failed;
4631 uint32_t aggr_len;
4632 uint32_t *mpdu_aggr_size;
4633 uint32_t success_mcs_len;
4634 uint32_t *success_mcs;
4635 uint32_t fail_mcs_len;
4636 uint32_t *fail_mcs;
4637 uint32_t delay_len;
4638 uint32_t *delay;
4639};
4640
4641/**
4642 * struct sir_wifi_rx - per AC rx stats
4643 * @mpdus: number of RX packets on MAC layer
4644 * @bytes: bytes of RX packets on MAC layer
4645 * @ppdus: number of RX packets on PHY layer
4646 * @ppdu_bytes: bytes of RX packets on PHY layer
4647 * @mpdu_lost: number of discontinuity in seqnum
4648 * @mpdu_retry: number of RX packets flagged as retransmissions
4649 * @mpdu_dup: number of RX packets identified as duplicates
4650 * @mpdu_discard: number of RX packets discarded
4651 * @aggr_len: length of MPDU aggregation histogram buffer
4652 * @mpdu_aggr: histogram of MPDU aggregation size
4653 * @mcs_len: length of mcs histogram buffer
4654 * @mcs: histogram of encoding rate.
4655 */
4656struct sir_wifi_rx {
4657 uint32_t mpdus;
4658 uint32_t bytes;
4659 uint32_t ppdus;
4660 uint32_t ppdu_bytes;
4661 uint32_t mpdu_lost;
4662 uint32_t mpdu_retry;
4663 uint32_t mpdu_dup;
4664 uint32_t mpdu_discard;
4665 uint32_t aggr_len;
4666 uint32_t *mpdu_aggr;
4667 uint32_t mcs_len;
4668 uint32_t *mcs;
4669};
4670
4671/**
4672 * struct sir_wifi_ll_ext_wmm_ac_stats - stats for WMM AC
4673 * @type: WMM AC type
4674 * @tx_stats: pointer to TX stats
4675 * @rx_stats: pointer to RX stats
4676 */
4677struct sir_wifi_ll_ext_wmm_ac_stats {
4678 uint32_t type;
4679 struct sir_wifi_tx *tx_stats;
4680 struct sir_wifi_rx *rx_stats;
4681};
4682
Zhang Qian73c348a2017-03-13 16:15:55 +08004683/**
4684 * struct sir_wifi_ll_ext_peer_stats - per peer stats
4685 * @peer_id: peer ID
4686 * @vdev_id: VDEV ID
4687 * mac_address: MAC address
4688 * @sta_ps_inds: how many times STAs go to sleep
4689 * @sta_ps_durs: total sleep time of STAs (units in ms)
4690 * @rx_probe_reqs: number of probe requests received
4691 * @rx_oth_mgmts: number of other management frames received,
4692 * not including probe requests
4693 * @peer_signal_stat: signal stats
4694 * @ac_stats: WMM BE/BK/VI/VO stats
4695 */
4696struct sir_wifi_ll_ext_peer_stats {
4697 uint32_t peer_id;
4698 uint32_t vdev_id;
4699 tSirMacAddr mac_address;
4700 uint32_t sta_ps_inds;
4701 uint32_t sta_ps_durs;
4702 uint32_t rx_probe_reqs;
4703 uint32_t rx_oth_mgmts;
4704 struct sir_wifi_peer_signal_stats peer_signal_stats;
4705 struct sir_wifi_ll_ext_wmm_ac_stats ac_stats[WIFI_MAX_AC];
4706};
4707
4708/**
4709 * struct sir_wifi_ll_ext_stats - link layer stats report
4710 * @trigger_cond_id: Indicate what triggered this event.
4711 * 1: timeout. 2: threshold
4712 * @cca_chgd_bitmap: Bitmap to indicate changed channel CCA stats
4713 * which exceeded the thresholds
4714 * @sig_chgd_bitmap: Bitmap to indicate changed peer signal stats
4715 * which exceeded the thresholds
4716 * @tx_chgd_bitmap: Bitmap to indicate changed TX counters
4717 * which exceeded the thresholds
4718 * @rx_chgd_bitmap: Bitmap to indicate changed RX counters
4719 * which exceeded the thresholds
4720 * @chan_cca_stats: channel CCA stats
4721 * @peer_signal_stats: peer signal stats
4722 * @tx_mpdu_aggr_array_len: length of TX MPDU aggregation buffer
4723 * @tx_succ_mcs_array_len: length of mcs buffer for ACKed MPDUs
4724 * @tx_fail_mcs_array_len: length of mcs buffer for no-ACKed MPDUs
4725 * @tx_delay_array_len: length of delay stats buffer
4726 * @rx_mpdu_aggr_array_len: length of RX MPDU aggregation buffer
4727 * @rx_mcs_array_len: length of RX mcs stats buffer
4728 * @peer_stats: peer stats
4729 * @cca: physical channel CCA stats
4730 * @stats: pointer to stats data buffer.
4731 *
4732 * Structure of the whole statictics is like this:
4733 * ---------------------------------
4734 * | trigger_cond_i |
4735 * +-------------------------------+
4736 * | cca_chgd_bitmap |
4737 * +-------------------------------+
4738 * | sig_chgd_bitmap |
4739 * +-------------------------------+
4740 * | tx_chgd_bitmap |
4741 * +-------------------------------+
4742 * | rx_chgd_bitmap |
4743 * +-------------------------------+
4744 * | peer_num |
4745 * +-------------------------------+
4746 * | channel_num |
4747 * +-------------------------------+
4748 * | tx_mpdu_aggr_array_len |
4749 * +-------------------------------+
4750 * | tx_succ_mcs_array_len |
4751 * +-------------------------------+
4752 * | tx_fail_mcs_array_len |
4753 * +-------------------------------+
4754 * | tx_delay_array_len |
4755 * +-------------------------------+
4756 * | rx_mpdu_aggr_array_len |
4757 * +-------------------------------+
4758 * | rx_mcs_array_len |
4759 * +-------------------------------+
4760 * | pointer to CCA stats |
4761 * +-------------------------------+
4762 * | pointer to peer stats |
4763 * +-------------------------------+
4764 * | CCA stats |
4765 * +-------------------------------+
4766 * | peer_stats |----+
4767 * +-------------------------------+ |
4768 * | per peer signals stats |<---+
4769 * | peer0 ~ peern | |
4770 * +-------------------------------+ |
4771 * | TX aggr/mcs parameters array | |
4772 * | Length of this buffer is | |
4773 * | configurable for user layer. |<-+ |
4774 * +-------------------------------+ | |
4775 * | per peer tx stats |--+ |
4776 * | BE | <--+
4777 * | BK | |
4778 * | VI | |
4779 * | VO | |
4780 * +-------------------------------+ |
4781 * | TX aggr/mcs parameters array | |
4782 * | Length of this buffer is | |
4783 * | configurable for user layer. |<-+ |
4784 * +-------------------------------+ | |
4785 * | peer peer rx stats |--+ |
4786 * | BE | <--+
4787 * | BE |
4788 * | BK |
4789 * | VI |
4790 * | VO |
4791 * ---------------------------------
4792 */
4793struct sir_wifi_ll_ext_stats {
4794 uint32_t trigger_cond_id;
4795 uint32_t cca_chgd_bitmap;
4796 uint32_t sig_chgd_bitmap;
4797 uint32_t tx_chgd_bitmap;
4798 uint32_t rx_chgd_bitmap;
4799 uint8_t peer_num;
4800 uint8_t channel_num;
4801 uint32_t tx_mpdu_aggr_array_len;
4802 uint32_t tx_succ_mcs_array_len;
4803 uint32_t tx_fail_mcs_array_len;
4804 uint32_t tx_delay_array_len;
4805 uint32_t rx_mpdu_aggr_array_len;
4806 uint32_t rx_mcs_array_len;
4807 struct sir_wifi_ll_ext_peer_stats *peer_stats;
4808 struct sir_wifi_chan_cca_stats *cca;
4809 uint8_t stats[];
4810};
4811
4812/**
4813 * struct sir_channel_cca_threshold - threshold for channel CCA
4814 * @idle_time: idle time, no TX, no RX, no interference
4815 * @tx_time: time transmitting packets
4816 * @rx_in_bss_time: time receiving packets in current BSSs
4817 * @rx_out_bss_time: time receiving packets not in current BSSs
4818 * @rx_busy_time: time interference detected
4819 * @rx_in_bad_cond_time: receiving packets with errors
4820 * @tx_in_bad_cond_time: time transmitted packets not been ACKed
4821 * @wlan_not_avail_time: wlan card cannot work
4822 */
4823struct sir_channel_cca_threshold {
4824 uint32_t idle_time;
4825 uint32_t tx_time;
4826 uint32_t rx_in_bss_time;
4827 uint32_t rx_out_bss_time;
4828 uint32_t rx_busy_time;
4829 uint32_t rx_in_bad_cond_time;
4830 uint32_t tx_in_bad_cond_time;
4831 uint32_t wlan_not_avail_time;
4832};
4833
4834/**
4835 * struct sir_signal_threshold - threshold for per peer sigbal
4836 * @snr: signal to noise rate
4837 * @nf: noise floor
4838 */
4839struct sir_signal_threshold {
4840 uint32_t snr;
4841 uint32_t nf;
4842};
4843
4844/**
4845 * struct sir_tx_threshold - threshold for TX
4846 * @msdu: TX MSDUs on MAC layer
4847 * @mpdu: TX MPDUs on MAC layer
4848 * @ppdu: TX PPDUs on MAC layer
4849 * @bytes: TX bytes on MAC layer
4850 * @msdu_drop: drooped MSDUs
4851 * @byte_drop: dropped Bytes
4852 * @mpdu_retry: MPDU not acked
4853 * @ppdu_fail: PPDUs which received no block ack
4854 * @aggregation: aggregation size
4855 * @succ_mcs: histogram of encoding rate for acked PPDUs
4856 * @fail_mcs: histogram of encoding rate for no-acked PPDUs
4857 */
4858struct sir_tx_threshold {
4859 uint32_t msdu;
4860 uint32_t mpdu;
4861 uint32_t ppdu;
4862 uint32_t bytes;
4863 uint32_t msdu_drop;
4864 uint32_t byte_drop;
4865 uint32_t mpdu_retry;
4866 uint32_t mpdu_fail;
4867 uint32_t ppdu_fail;
4868 uint32_t aggregation;
4869 uint32_t succ_mcs;
4870 uint32_t fail_mcs;
4871 uint32_t delay;
4872};
4873
4874/**
4875 * struct sir_rx_threshold - threshold for RX
4876 * @mpdu: RX MPDUs on MAC layer
4877 * @bytes: RX bytes on MAC layer
4878 * @ppdu: RX PPDU on PHY layer
4879 * @ppdu_bytes: RX bytes on PHY layer
4880 * @disorder: discontinuity in seqnum
4881 * @mpdu_retry: MPDUs flagged as retry
4882 * @mpdu_dup: MPDUs identified as duplicated
4883 * @aggregation: aggregation size
4884 * @mcs: histogram of encoding rate for PPDUs
4885 * @ps_inds: power save indication
4886 * @ps_durs: total time in power save
4887 * @probe_reqs: probe request received
4888 * @other_mgmt: other MGMT frames received
4889 */
4890struct sir_rx_threshold {
4891 uint32_t mpdu;
4892 uint32_t bytes;
4893 uint32_t ppdu;
4894 uint32_t ppdu_bytes;
4895 uint32_t disorder;
4896 uint32_t mpdu_lost;
4897 uint32_t mpdu_retry;
4898 uint32_t mpdu_dup;
4899 uint32_t mpdu_discard;
4900 uint32_t aggregation;
4901 uint32_t mcs;
4902 uint32_t ps_inds;
4903 uint32_t ps_durs;
4904 uint32_t probe_reqs;
4905 uint32_t other_mgmt;
4906};
4907
4908/**
4909 * struct sir_wifi_ll_ext_stats_threshold - Threshold for stats update
4910 * @period: MAC counter indication period (unit in ms)
4911 * @enable: if threshold mechnism is enabled or disabled
4912 * @enable_bitmap: whether dedicated threshold is enabed.
4913 * Every MAC counter has a dedicated threshold. If the dedicated
4914 * threshold is not set in the bitmap, global threshold will take
4915 * effect.
4916 * @global: whether clobal threshold is enabled.
Jeff Johnsonf2cf6592018-05-06 16:27:44 -07004917 * When both global and dedicated threshold are disabled, MAC counter
Zhang Qian73c348a2017-03-13 16:15:55 +08004918 * will indicate stats periodically.
4919 * @global_threshold: global threshold value
4920 * @cca_bitmap: bitmap for CCA.
4921 * Bit0: idle time
4922 * Bit1: tx time
4923 * Bit2: RX in BSS
4924 * Bit3: RX out of BSS
4925 * Bit4: medium busy
4926 * Bit5: RX bad
4927 * Bit6: TX bad
4928 * Bit7: WLAN card not available
4929 * @signal_bitmap:
4930 * Bit0: Per channel SNR counter
4931 * Bit1: Per channel noise floor counter
4932 * @tx_bitmap: bitmap for TX counters
4933 * Bit0: TX counter unit in MSDU
4934 * Bit1: TX counter unit in MPDU
4935 * Bit2: TX counter unit in PPDU
4936 * Bit3: TX counter unit in byte
4937 * Bit4: Dropped MSDUs
4938 * Bit5: Dropped Bytes
4939 * Bit6: MPDU retry counter
4940 * Bit7: MPDU failure counter
4941 * Bit8: PPDU failure counter
4942 * Bit9: MPDU aggregation counter
4943 * Bit10: MCS counter for ACKed MPDUs
4944 * Bit11: MCS counter for Failed MPDUs
4945 * Bit12: TX Delay counter
4946 * @rx_bitmap:bitmap for RX counters
4947 * Bit0: MAC RX counter unit in MPDU
4948 * Bit1: MAC RX counter unit in byte
4949 * Bit2: PHY RX counter unit in PPDU
4950 * Bit3: PHY RX counter unit in byte
4951 * Bit4: Disorder counter
4952 * Bit5: Retry counter
4953 * Bit6: Duplication counter
4954 * Bit7: Discard counter
4955 * Bit8: MPDU aggregation size counter
4956 * Bit9: MCS counter
4957 * Bit10: Peer STA power state change (wake to sleep) counter
4958 * Bit11: Peer STA power save counter, total time in PS mode
4959 * Bit12: Probe request counter
4960 * Bit13: Other management frames counter
4961 * @cca_thresh: CCA threshold
4962 * @signal_thresh: signal threshold
4963 * @tx_thresh: TX threshold
4964 * @rx_thresh: RX threshold
4965 *
4966 * Generally, Link layer statistics is reported periodically. But if the
4967 * variation of one stats of compared to the pervious notification exceeds
4968 * a threshold, FW will report the new stats immediately.
4969 * This structure contains threshold for different counters.
4970 */
4971struct sir_ll_ext_stats_threshold {
4972 uint32_t period;
4973 uint32_t enable;
4974 uint32_t enable_bitmap;
4975 uint32_t global;
4976 uint32_t global_threshold;
4977 uint32_t cca_bitmap;
4978 uint32_t signal_bitmap;
4979 uint32_t tx_bitmap;
4980 uint32_t rx_bitmap;
4981 struct sir_channel_cca_threshold cca;
4982 struct sir_signal_threshold signal;
4983 struct sir_tx_threshold tx;
4984 struct sir_rx_threshold rx;
4985};
4986
4987#define LL_STATS_MIN_PERIOD 10
4988#define LL_STATS_INVALID_PERIOD 0xFFFFFFFF
4989
Zhang Qiana6e9c102016-12-22 16:47:24 +08004990/* Result ID for LL stats extension */
4991#define WMI_LL_STATS_EXT_PS_CHG 0x00000100
4992#define WMI_LL_STATS_EXT_TX_FAIL 0x00000200
4993#define WMI_LL_STATS_EXT_MAC_COUNTER 0x00000400
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004994#endif /* WLAN_FEATURE_LINK_LAYER_STATS */
4995
4996typedef struct sAniGetLinkStatus {
4997 uint16_t msgType; /* message type is same as the request type */
4998 uint16_t msgLen; /* length of the entire request */
4999 uint8_t linkStatus;
5000 uint8_t sessionId;
5001} tAniGetLinkStatus, *tpAniGetLinkStatus;
5002
5003#ifdef DHCP_SERVER_OFFLOAD
5004typedef struct {
5005 uint32_t vdev_id;
5006 uint32_t dhcpSrvOffloadEnabled;
5007 uint32_t dhcpClientNum;
5008 uint32_t dhcpSrvIP;
5009} tSirDhcpSrvOffloadInfo, *tpSirDhcpSrvOffloadInfo;
5010#endif /* DHCP_SERVER_OFFLOAD */
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05305011
5012/**
5013 * struct sir_lost_link_info - lost link information structure.
5014 *
5015 * @vdev_id: vdev_id from WMA. some modules call sessionId.
5016 * @rssi: rssi at disconnection time.
5017 *
5018 * driver uses this structure to communicate information collected at
5019 * disconnection time.
5020 */
5021struct sir_lost_link_info {
5022 uint32_t vdev_id;
5023 int32_t rssi;
5024};
5025
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005026/* find the size of given member within a structure */
5027#ifndef member_size
5028#define member_size(type, member) (sizeof(((type *)0)->member))
5029#endif
5030
5031#define RTT_INVALID 0x00
5032#define RTT_TIMING_MEAS_CAPABILITY 0x01
5033#define RTT_FINE_TIME_MEAS_INITIATOR_CAPABILITY 0x02
5034#define RTT_FINE_TIME_MEAS_RESPONDER_CAPABILITY 0x03
5035
5036/**
5037 * enum fine_time_meas_mask - bit mask to identify device's
5038 * fine timing measurement capability
5039 * @FINE_TIME_MEAS_STA_INITIATOR - STA role, Initiator capability is supported
5040 * @FINE_TIME_MEAS_STA_RESPONDER - STA role, Responder capability is supported
5041 * @FINE_TIME_MEAS_P2PCLI_INITIATOR - P2P-CLI supports initiator capability
5042 * @FINE_TIME_MEAS_P2PCLI_RESPONDER - P2P-CLI supports responder capability
5043 * @FINE_TIME_MEAS_P2PGO_INITIATOR - P2P-GO supports initiator capability
5044 * @FINE_TIME_MEAS_P2PGO_RESPONDER - P2P-GO supports responder capability
5045 * @FINE_TIME_MEAS_SAP_INITIATOR - SAP role, Initiator capability is supported
5046 * @FINE_TIME_MEAS_SAP_RESPONDER - SAP role, Responder capability is supported
5047 */
5048enum fine_time_meas_mask {
5049 FINE_TIME_MEAS_STA_INITIATOR = (1 << (0)),
5050 FINE_TIME_MEAS_STA_RESPONDER = (1 << (1)),
5051 FINE_TIME_MEAS_P2PCLI_INITIATOR = (1 << (2)),
5052 FINE_TIME_MEAS_P2PCLI_RESPONDER = (1 << (3)),
5053 FINE_TIME_MEAS_P2PGO_INITIATOR = (1 << (4)),
5054 FINE_TIME_MEAS_P2PGO_RESPONDER = (1 << (5)),
5055 FINE_TIME_MEAS_SAP_INITIATOR = (1 << (6)),
5056 FINE_TIME_MEAS_SAP_RESPONDER = (1 << (7)),
5057};
5058
5059/* number of neighbor reports that we can handle in Neighbor Report Response */
5060#define MAX_SUPPORTED_NEIGHBOR_RPT 15
5061
5062/**
5063 * struct sir_stats_avg_factor
5064 * @vdev_id: session id
5065 * @stats_avg_factor: average factor
5066 */
5067struct sir_stats_avg_factor {
5068 uint8_t vdev_id;
5069 uint16_t stats_avg_factor;
5070};
5071
5072/**
5073 * struct sir_guard_time_request
5074 * @vdev_id: session id
5075 * @guard_time: guard time
5076 */
5077struct sir_guard_time_request {
5078 uint8_t vdev_id;
5079 uint32_t guard_time;
5080};
5081
5082/* Max number of rates allowed in Supported Rates IE */
5083#define MAX_NUM_SUPPORTED_RATES (8)
5084
5085/*
5086 * struct rssi_monitor_req - rssi monitoring
5087 * @request_id: request id
5088 * @session_id: session id
5089 * @min_rssi: minimum rssi
5090 * @max_rssi: maximum rssi
5091 * @control: flag to indicate start or stop
5092 */
5093struct rssi_monitor_req {
5094 uint32_t request_id;
5095 uint32_t session_id;
5096 int8_t min_rssi;
5097 int8_t max_rssi;
5098 bool control;
5099};
5100
5101/**
5102 * struct rssi_breach_event - rssi breached event structure
5103 * @request_id: request id
5104 * @session_id: session id
5105 * @curr_rssi: current rssi
5106 * @curr_bssid: current bssid
5107 */
5108struct rssi_breach_event {
5109 uint32_t request_id;
5110 uint32_t session_id;
5111 int8_t curr_rssi;
Anurag Chouhan6d760662016-02-20 16:05:43 +05305112 struct qdf_mac_addr curr_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005113};
5114
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05305115/**
5116 * struct chip_pwr_save_fail_detected_params - chip power save failure detected
5117 * event params
5118 * @failure_reason_code:failure reason code
5119 * @wake_lock_bitmap:bitmap for modules voting against sleep for long duration.
5120 */
5121struct chip_pwr_save_fail_detected_params {
5122 uint32_t failure_reason_code;
5123 uint32_t wake_lock_bitmap[4];
5124};
5125
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005126#define MAX_NUM_FW_SEGMENTS 4
5127
5128/**
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05305129 * DEFAULT_SCAN_IE_ID - Identifier for the collection of IE's added
5130 * by default to the probe request
5131 */
5132#define DEFAULT_SCAN_IE_ID 256
5133
5134 /* MAX_DEFAULT_SCAN_IE_LEN - Maxmimum length of Default Scan IE's */
Selvaraj, Sridhar021ee0a2017-04-07 16:53:31 +05305135#define MAX_DEFAULT_SCAN_IE_LEN 2048
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05305136
5137 /* Extended Capabilities IE header(IE Id + IE Length) length */
5138#define EXT_CAP_IE_HDR_LEN 2
5139
5140/**
5141 * struct hdd_default_scan_ie - HDD default scan IE structure
5142 * @message_type: message type to be set with eWNI_SME_DEFAULT_SCAN_IE
5143 * @length: length of the struct hdd_default_scan_ie
5144 * @session_id: Session Id
5145 * @ie_len: Default scan IE length
5146 * @ie_data: Pointer to default scan IE data
5147 */
5148struct hdd_default_scan_ie {
5149 uint16_t message_type;
5150 uint16_t length;
5151 uint16_t session_id;
5152 uint16_t ie_len;
5153 uint8_t ie_data[MAX_DEFAULT_SCAN_IE_LEN];
5154};
5155
5156/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005157 * struct vdev_ie_info - IE info
5158 * @vdev_id - vdev for which the IE is being sent
5159 * @ie_id - ID of the IE
5160 * @length - length of the IE data
Naveen Rawat03e8d952016-08-01 15:22:20 -07005161 * @band - indicates IE is intended for which band
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005162 * @data - IE data
5163 *
5164 * This structure is used to store the IE information.
5165 */
5166struct vdev_ie_info {
5167 uint32_t vdev_id;
5168 uint32_t ie_id;
5169 uint32_t length;
Naveen Rawat03e8d952016-08-01 15:22:20 -07005170 uint32_t band;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005171 uint8_t *data;
5172};
5173
5174/**
5175 * struct send_extcap_ie - used to pass send_extcap_ie msg from SME to PE
5176 * @type - MSG type
5177 * @length - length of the message
5178 * @seesion_id - session_id for which the message is intended for
5179 *
5180 * This structure is used to pass send_extcap_ie msg from SME to PE
5181 */
5182struct send_extcap_ie {
5183 uint16_t msg_type; /* eWNI_SME_SET_IE_REQ */
5184 uint16_t length;
5185 uint8_t session_id;
5186};
5187
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005188typedef void (*hw_mode_transition_cb)(uint32_t old_hw_mode_index,
5189 uint32_t new_hw_mode_index,
5190 uint32_t num_vdev_mac_entries,
Tushnim Bhattacharyyaeab33dd2017-11-15 15:20:02 -08005191 struct policy_mgr_vdev_mac_map *vdev_mac_map);
Dundi Raviteja6bb9e322018-05-16 17:04:41 +05305192typedef void (*antenna_mode_cb)(uint32_t status, void *context);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005193
5194/**
Kiran Kumar Lokereee205772018-09-27 00:27:27 -07005195 * struct cfg_action_frm_tb_ppdu - action frame TB PPDU cfg
5196 * @vdev_id - vdev id
5197 * @cfg - enable/disable
5198 * @frm_len - frame length
5199 * @data - frame data
5200 *
5201 * This structure is used to cfg action frame tb ppdu.
5202 */
5203struct cfg_action_frm_tb_ppdu {
5204 uint8_t vdev_id;
5205 uint8_t cfg;
5206 uint8_t frm_len;
5207 uint8_t *data;
5208};
5209
5210/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005211 * struct sir_nss_update_request
5212 * @msgType: nss update msg type
5213 * @msgLen: length of the msg
5214 * @new_nss: new spatial stream value
5215 * @vdev_id: session id
5216 */
5217struct sir_nss_update_request {
5218 uint16_t msgType;
5219 uint16_t msgLen;
5220 uint8_t new_nss;
5221 uint32_t vdev_id;
5222};
5223
5224/**
Abhishek Singhfc740be2018-10-12 11:34:26 +05305225 * enum sir_bcn_update_reason: bcn update reason
5226 * @REASON_DEFAULT: reason default
5227 * @REASON_NSS_UPDATE: If NSS is updated
5228 * @REASON_CONFIG_UPDATE: Config update
5229 * @REASON_SET_HT2040: HT2040 update
5230 * @REASON_COLOR_CHANGE: Color change
5231 * @REASON_CHANNEL_SWITCH: channel switch
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005232 */
Abhishek Singhfc740be2018-10-12 11:34:26 +05305233enum sir_bcn_update_reason {
5234 REASON_DEFAULT = 0,
5235 REASON_NSS_UPDATE = 1,
5236 REASON_CONFIG_UPDATE = 2,
5237 REASON_SET_HT2040 = 3,
5238 REASON_COLOR_CHANGE = 4,
5239 REASON_CHANNEL_SWITCH = 5,
5240};
5241
5242/**
5243 * struct sir_bcn_update_rsp
5244 *
5245 * @vdev_id: session for which bcn was updated
5246 * @reason: bcn update reason
5247 * @status: status of the beacon sent to FW
5248 */
5249struct sir_bcn_update_rsp {
5250 uint8_t vdev_id;
5251 enum sir_bcn_update_reason reason;
5252 QDF_STATUS status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005253};
5254
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005255/**
5256 * OCB structures
5257 */
5258
5259#define NUM_AC (4)
5260#define OCB_CHANNEL_MAX (5)
5261
5262struct sir_qos_params {
5263 uint8_t aifsn;
5264 uint8_t cwmin;
5265 uint8_t cwmax;
5266};
5267
5268/**
5269 * struct sir_ocb_set_config_response
5270 * @status: response status
5271 */
5272struct sir_ocb_set_config_response {
5273 uint8_t status;
5274};
5275
5276/** Callback for the dcc_stats_event */
5277typedef void (*dcc_stats_event_callback_t)(void *hdd_ctx, uint32_t vdev_id,
5278 uint32_t num_channels, uint32_t stats_per_channel_array_len,
5279 const void *stats_per_channel_array);
5280
5281/**
5282 * struct sir_ocb_config_channel
5283 * @chan_freq: frequency of the channel
5284 * @bandwidth: bandwidth of the channel, either 10 or 20 MHz
5285 * @mac_address: MAC address assigned to this channel
5286 * @qos_params: QoS parameters
5287 * @max_pwr: maximum transmit power of the channel (dBm)
5288 * @min_pwr: minimum transmit power of the channel (dBm)
5289 * @reg_pwr: maximum transmit power specified by the regulatory domain (dBm)
5290 * @antenna_max: maximum antenna gain specified by the regulatory domain (dB)
5291 */
5292struct sir_ocb_config_channel {
5293 uint32_t chan_freq;
5294 uint32_t bandwidth;
Anurag Chouhan6d760662016-02-20 16:05:43 +05305295 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005296 struct sir_qos_params qos_params[MAX_NUM_AC];
5297 uint32_t max_pwr;
5298 uint32_t min_pwr;
5299 uint8_t reg_pwr;
5300 uint8_t antenna_max;
5301 uint16_t flags;
5302};
5303
5304/**
5305 * OCB_CHANNEL_FLAG_NO_RX_HDR - Don't add the RX stats header to packets
5306 * received on this channel.
5307 */
5308#define OCB_CHANNEL_FLAG_DISABLE_RX_STATS_HDR (1 << 0)
5309
5310/**
5311 * struct sir_ocb_config_sched
5312 * @chan_freq: frequency of the channel
5313 * @total_duration: duration of the schedule
5314 * @guard_interval: guard interval on the start of the schedule
5315 */
5316struct sir_ocb_config_sched {
5317 uint32_t chan_freq;
5318 uint32_t total_duration;
5319 uint32_t guard_interval;
5320};
5321
5322/**
5323 * struct sir_ocb_config
5324 * @session_id: session id
5325 * @channel_count: number of channels
5326 * @schedule_size: size of the channel schedule
5327 * @flags: reserved
5328 * @channels: array of OCB channels
5329 * @schedule: array of OCB schedule elements
5330 * @dcc_ndl_chan_list_len: size of the ndl_chan array
5331 * @dcc_ndl_chan_list: array of dcc channel info
5332 * @dcc_ndl_active_state_list_len: size of the active state array
5333 * @dcc_ndl_active_state_list: array of active states
5334 * @adapter: the OCB adapter
5335 * @dcc_stats_callback: callback for the response event
5336 */
5337struct sir_ocb_config {
5338 uint8_t session_id;
5339 uint32_t channel_count;
5340 uint32_t schedule_size;
5341 uint32_t flags;
5342 struct sir_ocb_config_channel *channels;
5343 struct sir_ocb_config_sched *schedule;
5344 uint32_t dcc_ndl_chan_list_len;
5345 void *dcc_ndl_chan_list;
5346 uint32_t dcc_ndl_active_state_list_len;
5347 void *dcc_ndl_active_state_list;
5348};
5349
5350/* The size of the utc time in bytes. */
5351#define SIZE_UTC_TIME (10)
5352/* The size of the utc time error in bytes. */
5353#define SIZE_UTC_TIME_ERROR (5)
5354
5355/**
5356 * struct sir_ocb_utc
5357 * @vdev_id: session id
5358 * @utc_time: number of nanoseconds from Jan 1st 1958
5359 * @time_error: the error in the UTC time. All 1's for unknown
5360 */
5361struct sir_ocb_utc {
5362 uint32_t vdev_id;
5363 uint8_t utc_time[SIZE_UTC_TIME];
5364 uint8_t time_error[SIZE_UTC_TIME_ERROR];
5365};
5366
5367/**
5368 * struct sir_ocb_timing_advert
5369 * @vdev_id: session id
5370 * @chan_freq: frequency on which to advertise
5371 * @repeat_rate: the number of times it will send TA in 5 seconds
5372 * @timestamp_offset: offset of the timestamp field in the TA frame
5373 * @time_value_offset: offset of the time_value field in the TA frame
5374 * @template_length: size in bytes of the TA frame
5375 * @template_value: the TA frame
5376 */
5377struct sir_ocb_timing_advert {
5378 uint32_t vdev_id;
5379 uint32_t chan_freq;
5380 uint32_t repeat_rate;
5381 uint32_t timestamp_offset;
5382 uint32_t time_value_offset;
5383 uint32_t template_length;
5384 uint8_t *template_value;
5385};
5386
5387/**
5388 * struct sir_ocb_get_tsf_timer_response
5389 * @vdev_id: session id
5390 * @timer_high: higher 32-bits of the timer
5391 * @timer_low: lower 32-bits of the timer
5392 */
5393struct sir_ocb_get_tsf_timer_response {
5394 uint32_t vdev_id;
5395 uint32_t timer_high;
5396 uint32_t timer_low;
5397};
5398
5399/**
5400 * struct sir_ocb_get_tsf_timer
5401 * @vdev_id: session id
5402 */
5403struct sir_ocb_get_tsf_timer {
5404 uint32_t vdev_id;
5405};
5406
5407/**
5408 * struct sir_dcc_get_stats_response
5409 * @vdev_id: session id
5410 * @num_channels: number of dcc channels
5411 * @channel_stats_array_len: size in bytes of the stats array
5412 * @channel_stats_array: the stats array
5413 */
5414struct sir_dcc_get_stats_response {
5415 uint32_t vdev_id;
5416 uint32_t num_channels;
5417 uint32_t channel_stats_array_len;
5418 void *channel_stats_array;
5419};
5420
5421/**
5422 * struct sir_dcc_get_stats
5423 * @vdev_id: session id
5424 * @channel_count: number of dcc channels
5425 * @request_array_len: size in bytes of the request array
5426 * @request_array: the request array
5427 */
5428struct sir_dcc_get_stats {
5429 uint32_t vdev_id;
5430 uint32_t channel_count;
5431 uint32_t request_array_len;
5432 void *request_array;
5433};
5434
5435/**
5436 * struct sir_dcc_clear_stats
5437 * @vdev_id: session id
5438 * @dcc_stats_bitmap: bitmap of clear option
5439 */
5440struct sir_dcc_clear_stats {
5441 uint32_t vdev_id;
5442 uint32_t dcc_stats_bitmap;
5443};
5444
5445/**
5446 * struct sir_dcc_update_ndl_response
5447 * @vdev_id: session id
5448 * @status: response status
5449 */
5450struct sir_dcc_update_ndl_response {
5451 uint32_t vdev_id;
5452 uint32_t status;
5453};
5454
5455/**
5456 * struct sir_dcc_update_ndl
5457 * @vdev_id: session id
5458 * @channel_count: number of channels to be updated
5459 * @dcc_ndl_chan_list_len: size in bytes of the ndl_chan array
5460 * @dcc_ndl_chan_list: the ndl_chan array
5461 * @dcc_ndl_active_state_list_len: size in bytes of the active_state array
5462 * @dcc_ndl_active_state_list: the active state array
5463 */
5464struct sir_dcc_update_ndl {
5465 uint32_t vdev_id;
5466 uint32_t channel_count;
5467 uint32_t dcc_ndl_chan_list_len;
5468 void *dcc_ndl_chan_list;
5469 uint32_t dcc_ndl_active_state_list_len;
5470 void *dcc_ndl_active_state_list;
5471};
5472
5473/**
5474 * enum powersave_qpower_mode: QPOWER modes
5475 * @QPOWER_DISABLED: Qpower is disabled
5476 * @QPOWER_ENABLED: Qpower is enabled
5477 * @QPOWER_DUTY_CYCLING: Qpower is enabled with duty cycling
5478 */
5479enum powersave_qpower_mode {
5480 QPOWER_DISABLED = 0,
5481 QPOWER_ENABLED = 1,
5482 QPOWER_DUTY_CYCLING = 2
5483};
5484
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08005485#ifdef FEATURE_LFR_SUBNET_DETECTION
5486/**
5487 * struct gateway_param_update_req - gateway parameter update request
5488 * @request_id: request id
5489 * @session_id: session id
5490 * @max_retries: Max ARP/NS retry attempts
5491 * @timeout: Retry interval
5492 * @ipv4_addr_type: on ipv4 network
5493 * @ipv6_addr_type: on ipv6 network
5494 * @gw_mac_addr: gateway mac addr
5495 * @ipv4_addr: ipv4 addr
5496 * @ipv6_addr: ipv6 addr
5497 */
5498struct gateway_param_update_req {
5499 uint32_t request_id;
5500 uint32_t session_id;
5501 uint32_t max_retries;
5502 uint32_t timeout;
5503 uint32_t ipv4_addr_type;
5504 uint32_t ipv6_addr_type;
Anurag Chouhan6d760662016-02-20 16:05:43 +05305505 struct qdf_mac_addr gw_mac_addr;
5506 uint8_t ipv4_addr[QDF_IPV4_ADDR_SIZE];
5507 uint8_t ipv6_addr[QDF_IPV6_ADDR_SIZE];
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08005508};
5509#else
5510struct gateway_param_update_req;
5511#endif /* FEATURE_LFR_SUBNET_DETECTION */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005512
Abhishek Singh518323d2015-10-19 17:42:01 +05305513/**
5514 * struct sir_sme_ext_change_chan_req - channel change request
5515 * @message_type: message id
5516 * @length: msg length
5517 * @new_channel: new channel
5518 * @session_id: session id
5519 */
5520struct sir_sme_ext_cng_chan_req {
5521 uint16_t message_type; /* eWNI_SME_EXT_CHANGE_CHANNEL */
5522 uint16_t length;
5523 uint32_t new_channel;
5524 uint8_t session_id;
5525};
5526
5527/**
5528 * struct sir_sme_ext_change_chan_ind.
5529 * @session_id: session id
5530 * @new_channel: new channel to change
5531 */
5532struct sir_sme_ext_cng_chan_ind {
5533 uint8_t session_id;
5534 uint8_t new_channel;
5535};
5536
Ryan Hsu3c8f79f2015-12-02 16:45:09 -08005537/**
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07005538 * struct stsf - the basic stsf structure
5539 *
5540 * @vdev_id: vdev id
5541 * @tsf_low: low 32bits of tsf
5542 * @tsf_high: high 32bits of tsf
Manikandan Mohan5356c2b2016-04-03 15:51:35 -07005543 * @soc_timer_low: low 32bits of synced SOC timer value
5544 * @soc_timer_high: high 32bits of synced SOC timer value
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07005545 *
5546 * driver use this struct to store the tsf info
5547 */
5548struct stsf {
5549 uint32_t vdev_id;
5550 uint32_t tsf_low;
5551 uint32_t tsf_high;
Manikandan Mohan5356c2b2016-04-03 15:51:35 -07005552 uint32_t soc_timer_low;
5553 uint32_t soc_timer_high;
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07005554};
5555
Gupta, Kapil4cb1d7d2016-04-16 18:16:25 -07005556#define SIR_BCN_FLT_MAX_ELEMS_IE_LIST 8
5557/**
5558 * struct beacon_filter_param - parameters for beacon filtering
5559 * @vdev_id: vdev id
5560 * @ie_map: bitwise map of IEs that needs to be filtered
5561 *
5562 */
5563struct beacon_filter_param {
5564 uint32_t vdev_id;
5565 uint32_t ie_map[SIR_BCN_FLT_MAX_ELEMS_IE_LIST];
5566};
5567
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05305568/**
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +05305569 * struct adaptive_dwelltime_params - the adaptive dwelltime params
5570 * @vdev_id: vdev id
5571 * @is_enabled: Adaptive dwell time is enabled/disabled
5572 * @dwelltime_mode: global default adaptive dwell mode
5573 * @lpf_weight: weight to calculate the average low pass
5574 * filter for channel congestion
5575 * @passive_mon_intval: intval to monitor wifi activity in passive scan in msec
5576 * @wifi_act_threshold: % of wifi activity used in passive scan 0-100
5577 *
5578 */
5579struct adaptive_dwelltime_params {
5580 uint32_t vdev_id;
5581 bool is_enabled;
5582 uint8_t dwelltime_mode;
5583 uint8_t lpf_weight;
5584 uint8_t passive_mon_intval;
5585 uint8_t wifi_act_threshold;
5586};
5587
5588/**
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05305589 * struct csa_offload_params - CSA offload request parameters
5590 * @channel: channel
5591 * @switch_mode: switch mode
5592 * @sec_chan_offset: second channel offset
5593 * @new_ch_width: new channel width
5594 * @new_ch_freq_seg1: channel center freq 1
5595 * @new_ch_freq_seg2: channel center freq 2
5596 * @ies_present_flag: IE present flag
5597 */
5598struct csa_offload_params {
5599 uint8_t channel;
5600 uint8_t switch_mode;
5601 uint8_t sec_chan_offset;
5602 uint8_t new_ch_width;
5603 uint8_t new_op_class;
5604 uint8_t new_ch_freq_seg1;
5605 uint8_t new_ch_freq_seg2;
5606 uint32_t ies_present_flag;
5607 tSirMacAddr bssId;
5608};
5609
5610/**
Sandeep Puligillae0875662016-02-12 16:09:21 -08005611 * enum obss_ht40_scancmd_type - obss scan command type
5612 * @HT40_OBSS_SCAN_PARAM_START: OBSS scan start
5613 * @HT40_OBSS_SCAN_PARAM_UPDATE: OBSS scan param update
5614 */
5615enum obss_ht40_scancmd_type {
5616 HT40_OBSS_SCAN_PARAM_START,
5617 HT40_OBSS_SCAN_PARAM_UPDATE
5618};
5619
5620/**
5621 * struct sme_obss_ht40_scanind_msg - sme obss scan params
5622 * @msg_type: message type
5623 * @length: message length
5624 * @mac_addr: mac address
5625 */
5626struct sme_obss_ht40_scanind_msg {
5627 uint16_t msg_type;
5628 uint16_t length;
5629 struct qdf_mac_addr mac_addr;
5630};
5631
5632/**
5633 * struct obss_ht40_scanind - ht40 obss scan request
5634 * @cmd: message type
5635 * @scan_type: message length
5636 * @obss_passive_dwelltime: obss passive dwelltime
5637 * @obss_active_dwelltime: obss active dwelltime
5638 * @obss_width_trigger_interval: scan interval
5639 * @obss_passive_total_per_channel: total passive scan time per channel
5640 * @obss_active_total_per_channel: total active scan time per channel
5641 * @bsswidth_ch_trans_delay: OBSS transition delay time
5642 * @obss_activity_threshold: OBSS activity threshold
5643 * @self_sta_id: self sta identification
5644 * @bss_id: BSS index
5645 * @fortymhz_intolerent: Ht40mhz intolerance
5646 * @channel_count: channel count
5647 * @channels: channel information
5648 * @current_operatingclass: operating class
5649 * @iefield_len: ie's length
5650 * @iefiled: ie's information
5651 */
5652struct obss_ht40_scanind {
5653 enum obss_ht40_scancmd_type cmd;
5654 enum eSirScanType scan_type;
5655 /* In TUs */
5656 uint16_t obss_passive_dwelltime;
5657 uint16_t obss_active_dwelltime;
5658 /* In seconds */
5659 uint16_t obss_width_trigger_interval;
5660 /* In TU's */
5661 uint16_t obss_passive_total_per_channel;
5662 uint16_t obss_active_total_per_channel;
5663 uint16_t bsswidth_ch_trans_delay;
5664 uint16_t obss_activity_threshold;
5665 uint8_t self_sta_idx;
5666 uint8_t bss_id;
5667 uint8_t fortymhz_intolerent;
5668 uint8_t channel_count;
5669 uint8_t channels[SIR_ROAM_MAX_CHANNELS];
5670 uint8_t current_operatingclass;
5671 uint16_t iefield_len;
5672 uint8_t iefield[SIR_ROAM_SCAN_MAX_PB_REQ_SIZE];
5673};
5674
5675/**
5676 * struct obss_scanparam - OBSS scan parameters
5677 * @obss_passive_dwelltime: message type
5678 * @obss_active_dwelltime: message length
5679 * @obss_width_trigger_interval: obss passive dwelltime
5680 * @obss_passive_total_per_channel: obss passive total scan time
5681 * @obss_active_total_per_channel: obss active total scan time
5682 * @bsswidth_ch_trans_delay: OBSS transition delay time
5683 * @obss_activity_threshold: OBSS activity threshold
5684 */
5685struct obss_scanparam {
5686 uint16_t obss_passive_dwelltime;
5687 uint16_t obss_active_dwelltime;
5688 uint16_t obss_width_trigger_interval;
5689 uint16_t obss_passive_total_per_channel;
5690 uint16_t obss_active_total_per_channel;
5691 uint16_t bsswidth_ch_trans_delay;
5692 uint16_t obss_activity_threshold;
5693};
5694
Arun Khandavalli2476ef52016-04-26 20:19:43 +05305695/**
Nachiket Kukadee547a482018-05-22 16:43:30 +05305696 * struct sir_apf_set_offload - set apf filter instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05305697 * @session_id: session identifier
Nachiket Kukadee547a482018-05-22 16:43:30 +05305698 * @version: host apf version
5699 * @filter_id: Filter ID for APF filter
Arun Khandavalli2476ef52016-04-26 20:19:43 +05305700 * @total_length: The total length of the full instruction
5701 * total_length equal to 0 means reset
5702 * @current_offset: current offset, 0 means start a new setting
5703 * @current_length: Length of current @program
Nachiket Kukadee547a482018-05-22 16:43:30 +05305704 * @program: APF instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05305705 */
Nachiket Kukadee547a482018-05-22 16:43:30 +05305706struct sir_apf_set_offload {
Arun Khandavalli2476ef52016-04-26 20:19:43 +05305707 uint8_t session_id;
5708 uint32_t version;
5709 uint32_t filter_id;
5710 uint32_t total_length;
5711 uint32_t current_offset;
5712 uint32_t current_length;
5713 uint8_t *program;
5714};
5715
5716/**
Nachiket Kukadee547a482018-05-22 16:43:30 +05305717 * struct sir_apf_offload_capabilities - get apf Capabilities
5718 * @apf_version: fw's implement version
5719 * @max_apf_filters: max filters that fw supports
5720 * @max_bytes_for_apf_inst: the max bytes that can be used as apf instructions
5721 * @remaining_bytes_for_apf_inst: remaining bytes for apf instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05305722 *
5723 */
Nachiket Kukadee547a482018-05-22 16:43:30 +05305724struct sir_apf_get_offload {
5725 uint32_t apf_version;
5726 uint32_t max_apf_filters;
5727 uint32_t max_bytes_for_apf_inst;
5728 uint32_t remaining_bytes_for_apf_inst;
Arun Khandavalli2476ef52016-04-26 20:19:43 +05305729};
5730
Naveen Rawat3ff5cff2018-01-29 14:31:16 -08005731#ifndef QCA_SUPPORT_CP_STATS
Sandeep Puligilla607f34a2016-05-25 14:37:47 -07005732/**
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05305733 * struct sir_wake_lock_stats - wake lock stats structure
Dustin Brown9d797d62017-01-11 16:39:12 -08005734 * @wow_unspecified_wake_up_count: number of non-wow related wake ups
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05305735 * @wow_ucast_wake_up_count: Unicast wakeup count
5736 * @wow_bcast_wake_up_count: Broadcast wakeup count
5737 * @wow_ipv4_mcast_wake_up_count: ipv4 multicast wakeup count
5738 * @wow_ipv6_mcast_wake_up_count: ipv6 multicast wakeup count
5739 * @wow_ipv6_mcast_ra_stats: ipv6 multicast ra stats
5740 * @wow_ipv6_mcast_ns_stats: ipv6 multicast ns stats
5741 * @wow_ipv6_mcast_na_stats: ipv6 multicast na stats
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +05305742 * @wow_icmpv4_count: ipv4 icmp packet count
Himanshu Agarwal4574e282016-08-10 15:22:45 +05305743 * @wow_icmpv6_count: ipv6 icmp packet count
Poddar, Siddarthc01681a2016-12-21 18:36:30 +05305744 * @wow_rssi_breach_wake_up_count: rssi breach wakeup count
5745 * @wow_low_rssi_wake_up_count: low rssi wakeup count
5746 * @wow_gscan_wake_up_count: gscan wakeup count
5747 * @wow_pno_complete_wake_up_count: pno complete wakeup count
5748 * @wow_pno_match_wake_up_count: pno match wakeup count
Dustin Brown9d797d62017-01-11 16:39:12 -08005749 * @wow_oem_response_wake_up_count: oem response wakeup count
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05305750 * @pwr_save_fail_detected: pwr save fail detected wakeup count
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05305751 */
5752struct sir_wake_lock_stats {
Dustin Brown9d797d62017-01-11 16:39:12 -08005753 uint32_t wow_unspecified_wake_up_count;
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05305754 uint32_t wow_ucast_wake_up_count;
5755 uint32_t wow_bcast_wake_up_count;
5756 uint32_t wow_ipv4_mcast_wake_up_count;
5757 uint32_t wow_ipv6_mcast_wake_up_count;
5758 uint32_t wow_ipv6_mcast_ra_stats;
5759 uint32_t wow_ipv6_mcast_ns_stats;
5760 uint32_t wow_ipv6_mcast_na_stats;
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +05305761 uint32_t wow_icmpv4_count;
Himanshu Agarwal4574e282016-08-10 15:22:45 +05305762 uint32_t wow_icmpv6_count;
Poddar, Siddarthc01681a2016-12-21 18:36:30 +05305763 uint32_t wow_rssi_breach_wake_up_count;
5764 uint32_t wow_low_rssi_wake_up_count;
5765 uint32_t wow_gscan_wake_up_count;
5766 uint32_t wow_pno_complete_wake_up_count;
5767 uint32_t wow_pno_match_wake_up_count;
Dustin Brown9d797d62017-01-11 16:39:12 -08005768 uint32_t wow_oem_response_wake_up_count;
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05305769 uint32_t pwr_save_fail_detected;
Dustin Brown9d797d62017-01-11 16:39:12 -08005770};
5771
5772/**
5773 * struct sir_vdev_wow_stats - container for per vdev wow related stat counters
5774 * @ucast: Unicast wakeup count
5775 * @bcast: Broadcast wakeup count
5776 * @ipv4_mcast: ipv4 multicast wakeup count
5777 * @ipv6_mcast: ipv6 multicast wakeup count
5778 * @ipv6_mcast_ra: ipv6 multicast ra stats
5779 * @ipv6_mcast_ns: ipv6 multicast ns stats
5780 * @ipv6_mcast_na: ipv6 multicast na stats
5781 * @icmpv4: ipv4 icmp packet count
5782 * @icmpv6: ipv6 icmp packet count
5783 * @rssi_breach: rssi breach wakeup count
5784 * @low_rssi: low rssi wakeup count
5785 * @gscan: gscan wakeup count
5786 * @pno_complete: pno complete wakeup count
5787 * @pno_match: pno match wakeup count
Amar Singhal5eb9acb2017-05-26 15:25:27 -07005788 * @oem_response: oem response wakeup coun
5789 * @scan_11d: 11d scan wakeup count
Dustin Brown9d797d62017-01-11 16:39:12 -08005790 */
5791struct sir_vdev_wow_stats {
5792 uint32_t ucast;
5793 uint32_t bcast;
5794 uint32_t ipv4_mcast;
5795 uint32_t ipv6_mcast;
5796 uint32_t ipv6_mcast_ra;
5797 uint32_t ipv6_mcast_ns;
5798 uint32_t ipv6_mcast_na;
5799 uint32_t icmpv4;
5800 uint32_t icmpv6;
5801 uint32_t rssi_breach;
5802 uint32_t low_rssi;
5803 uint32_t gscan;
5804 uint32_t pno_complete;
5805 uint32_t pno_match;
5806 uint32_t oem_response;
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05305807 uint32_t pwr_save_fail_detected;
Amar Singhal5eb9acb2017-05-26 15:25:27 -07005808 uint32_t scan_11d;
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05305809};
Naveen Rawat3ff5cff2018-01-29 14:31:16 -08005810#endif
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05305811
5812/**
Sandeep Puligilla607f34a2016-05-25 14:37:47 -07005813 * enum ht_capability_fields - HT Capabilities bit fields
5814 * @HT_CAPS_LDPC: ldpc coding capability bit field
5815 * @HT_CAPS_SUPPORTED_CHANNEL_SET: channel width set bit field
5816 * @HT_CAPS_SM_PWR_SAVE: SM power save bit field
5817 * @HT_CAPS_GREENFIELD: greenfield capability bit field
5818 * @HT_CAPS_SHORT_GI20: short GI 20 bit field
5819 * @HT_CAPS_SHORT_GI40: short GI 40 bit field
5820 * @HT_CAPS_TX_STBC: Tx STBC bit field
5821 * @HT_CAPS_RX_STBC: Rx STBC bit fields
5822 */
5823enum ht_capability_fields {
5824 HT_CAPS_LDPC = 0x0001,
5825 HT_CAPS_SUPPORTED_CHANNEL_SET = 0x0002,
5826 HT_CAPS_SM_PWR_SAVE = 0x000c,
5827 HT_CAPS_GREENFIELD = 0x0010,
5828 HT_CAPS_SHORT_GI20 = 0x0020,
5829 HT_CAPS_SHORT_GI40 = 0x0040,
5830 HT_CAPS_TX_STBC = 0x0080,
5831 HT_CAPS_RX_STBC = 0x0300
5832};
5833
Ravi Joshi412f23d2016-05-26 15:09:23 -07005834#ifdef WLAN_FEATURE_NAN_DATAPATH
5835
5836#define IFACE_NAME_SIZE 64
5837
5838/**
5839 * enum ndp_accept_policy - nan data path accept policy
5840 * @NDP_ACCEPT_POLICY_NONE: the framework will decide the policy
5841 * @NDP_ACCEPT_POLICY_ALL: accept policy offloaded to fw
5842 *
5843 */
5844enum ndp_accept_policy {
5845 NDP_ACCEPT_POLICY_NONE = 0,
5846 NDP_ACCEPT_POLICY_ALL = 1,
5847};
5848
5849/**
5850 * enum ndp_self_role - nan data path role
5851 * @NDP_ROLE_INITIATOR: initiator of nan data path request
5852 * @NDP_ROLE_RESPONDER: responder to nan data path request
5853 *
5854 */
5855enum ndp_self_role {
5856 NDP_ROLE_INITIATOR = 0,
5857 NDP_ROLE_RESPONDER = 1,
5858};
5859
5860/**
5861 * enum ndp_response_code - responder's response code to nan data path request
5862 * @NDP_RESPONSE_ACCEPT: ndp request accepted
5863 * @NDP_RESPONSE_REJECT: ndp request rejected
5864 * @NDP_RESPONSE_DEFER: ndp request deferred until later (response to follow
5865 * any time later)
5866 *
5867 */
5868enum ndp_response_code {
5869 NDP_RESPONSE_ACCEPT = 0,
5870 NDP_RESPONSE_REJECT = 1,
5871 NDP_RESPONSE_DEFER = 2,
5872};
5873
5874/**
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07005875 * enum ndp_end_type - NDP end type
5876 * @NDP_END_TYPE_UNSPECIFIED: type is unspecified
5877 * @NDP_END_TYPE_PEER_UNAVAILABLE: type is peer unavailable
5878 * @NDP_END_TYPE_OTA_FRAME: NDP end frame received from peer
5879 *
5880 */
5881enum ndp_end_type {
5882 NDP_END_TYPE_UNSPECIFIED = 0x00,
5883 NDP_END_TYPE_PEER_UNAVAILABLE = 0x01,
5884 NDP_END_TYPE_OTA_FRAME = 0x02,
5885};
5886
5887/**
5888 * enum ndp_end_reason_code - NDP end reason code
5889 * @NDP_END_REASON_UNSPECIFIED: reason is unspecified
5890 * @NDP_END_REASON_INACTIVITY: reason is peer inactivity
5891 * @NDP_END_REASON_PEER_DATA_END: data end indication received from peer
5892 *
5893 */
5894enum ndp_end_reason_code {
5895 NDP_END_REASON_UNSPECIFIED = 0x00,
5896 NDP_END_REASON_INACTIVITY = 0x01,
5897 NDP_END_REASON_PEER_DATA_END = 0x02,
5898};
5899
5900/**
Naveen Rawat8d63a592016-06-29 18:30:59 -07005901 * enum nan_status_type - NDP status type
5902 * @NDP_RSP_STATUS_SUCCESS: request was successful
5903 * @NDP_RSP_STATUS_ERROR: request failed
5904 */
5905enum nan_status_type {
5906 NDP_RSP_STATUS_SUCCESS = 0x00,
5907 NDP_RSP_STATUS_ERROR = 0x01,
5908};
5909
5910/**
5911 * enum nan_reason_code - NDP command rsp reason code value
5912 * @NDP_UNSUPPORTED_CONCURRENCY: Will be used in unsupported concurrency cases
5913 * @NDP_NAN_DATA_IFACE_CREATE_FAILED: ndi create failed
5914 * @NDP_NAN_DATA_IFACE_DELETE_FAILED: ndi delete failed
5915 * @NDP_DATA_INITIATOR_REQ_FAILED: data initiator request failed
5916 * @NDP_DATA_RESPONDER_REQ_FAILED: data responder request failed
5917 * @NDP_INVALID_SERVICE_INSTANCE_ID: invalid service instance id
5918 * @NDP_INVALID_NDP_INSTANCE_ID: invalid ndp instance id
5919 * @NDP_INVALID_RSP_CODE: invalid response code in ndp responder request
5920 * @NDP_INVALID_APP_INFO_LEN: invalid app info length
5921 * @NDP_NMF_REQ_FAIL: OTA nan mgmt frame failure for data request
5922 * @NDP_NMF_RSP_FAIL: OTA nan mgmt frame failure for data response
5923 * @NDP_NMF_CNF_FAIL: OTA nan mgmt frame failure for confirm
5924 * @NDP_END_FAILED: ndp end failed
5925 * @NDP_NMF_END_REQ_FAIL: OTA nan mgmt frame failure for data end
5926 * @NDP_VENDOR_SPECIFIC_ERROR: other vendor specific failures
5927 */
5928enum nan_reason_code {
5929 NDP_UNSUPPORTED_CONCURRENCY = 9000,
5930 NDP_NAN_DATA_IFACE_CREATE_FAILED = 9001,
5931 NDP_NAN_DATA_IFACE_DELETE_FAILED = 9002,
5932 NDP_DATA_INITIATOR_REQ_FAILED = 9003,
5933 NDP_DATA_RESPONDER_REQ_FAILED = 9004,
5934 NDP_INVALID_SERVICE_INSTANCE_ID = 9005,
5935 NDP_INVALID_NDP_INSTANCE_ID = 9006,
5936 NDP_INVALID_RSP_CODE = 9007,
5937 NDP_INVALID_APP_INFO_LEN = 9008,
5938 NDP_NMF_REQ_FAIL = 9009,
5939 NDP_NMF_RSP_FAIL = 9010,
5940 NDP_NMF_CNF_FAIL = 9011,
5941 NDP_END_FAILED = 9012,
5942 NDP_NMF_END_REQ_FAIL = 9013,
5943 /* 9500 onwards vendor specific error codes */
5944 NDP_VENDOR_SPECIFIC_ERROR = 9500,
5945};
5946
5947/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07005948 * struct ndp_cfg - ndp configuration
5949 * @tag: unique identifier
5950 * @ndp_cfg_len: ndp configuration length
5951 * @ndp_cfg: variable length ndp configuration
5952 *
5953 */
5954struct ndp_cfg {
5955 uint32_t tag;
5956 uint32_t ndp_cfg_len;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07005957 uint8_t *ndp_cfg;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005958};
5959
5960/**
5961 * struct ndp_qos_cfg - ndp qos configuration
5962 * @tag: unique identifier
5963 * @ndp_qos_cfg_len: ndp qos configuration length
5964 * @ndp_qos_cfg: variable length ndp qos configuration
5965 *
5966 */
5967struct ndp_qos_cfg {
5968 uint32_t tag;
5969 uint32_t ndp_qos_cfg_len;
5970 uint8_t ndp_qos_cfg[];
5971};
5972
5973/**
5974 * struct ndp_app_info - application info shared during ndp setup
5975 * @tag: unique identifier
5976 * @ndp_app_info_len: ndp app info length
5977 * @ndp_app_info: variable length application information
5978 *
5979 */
5980struct ndp_app_info {
5981 uint32_t tag;
5982 uint32_t ndp_app_info_len;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07005983 uint8_t *ndp_app_info;
Ravi Joshi412f23d2016-05-26 15:09:23 -07005984};
5985
5986/**
Naveen Rawat4f3983e2016-11-29 16:12:09 -08005987 * struct ndp_scid - structure to hold sceurity context identifier
5988 * @scid_len: length of scid
5989 * @scid: scid
5990 *
5991 */
5992struct ndp_scid {
5993 uint32_t scid_len;
5994 uint8_t *scid;
5995};
5996
5997/**
5998 * struct ndp_pmk - structure to hold pairwise master key
5999 * @pmk_len: length of pairwise master key
6000 * @pmk: buffer containing pairwise master key
6001 *
6002 */
6003struct ndp_pmk {
6004 uint32_t pmk_len;
6005 uint8_t *pmk;
6006};
6007
6008/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07006009 * struct ndi_create_req - ndi create request params
6010 * @transaction_id: unique identifier
6011 * @iface_name: interface name
6012 *
6013 */
6014struct ndi_create_req {
6015 uint32_t transaction_id;
6016 char iface_name[IFACE_NAME_SIZE];
6017};
6018
6019/**
6020 * struct ndi_create_rsp - ndi create response params
Ravi Joshi412f23d2016-05-26 15:09:23 -07006021 * @status: request status
6022 * @reason: reason if any
6023 *
6024 */
6025struct ndi_create_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07006026 uint32_t status;
6027 uint32_t reason;
Rakesh Sunkicf1c9ab2016-08-25 14:11:25 -07006028 uint8_t sta_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006029};
6030
6031/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07006032 * struct ndi_delete_rsp - ndi delete response params
Ravi Joshi412f23d2016-05-26 15:09:23 -07006033 * @status: request status
6034 * @reason: reason if any
6035 *
6036 */
6037struct ndi_delete_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07006038 uint32_t status;
6039 uint32_t reason;
6040};
6041
6042/**
6043 * struct ndp_initiator_req - ndp initiator request params
6044 * @transaction_id: unique identifier
6045 * @vdev_id: session id of the interface over which ndp is being created
6046 * @channel: suggested channel for ndp creation
Naveen Rawat0a017052016-10-19 14:17:07 -07006047 * @channel_cfg: channel config, 0=no channel, 1=optional, 2=mandatory
Ravi Joshi412f23d2016-05-26 15:09:23 -07006048 * @service_instance_id: Service identifier
6049 * @peer_discovery_mac_addr: Peer's discovery mac address
6050 * @self_ndi_mac_addr: self NDI mac address
6051 * @ndp_config: ndp configuration params
6052 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006053 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
6054 * @pmk: pairwise master key
Ravi Joshi412f23d2016-05-26 15:09:23 -07006055 *
6056 */
6057struct ndp_initiator_req {
6058 uint32_t transaction_id;
6059 uint32_t vdev_id;
6060 uint32_t channel;
Naveen Rawat0a017052016-10-19 14:17:07 -07006061 uint32_t channel_cfg;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006062 uint32_t service_instance_id;
6063 struct qdf_mac_addr peer_discovery_mac_addr;
6064 struct qdf_mac_addr self_ndi_mac_addr;
6065 struct ndp_cfg ndp_config;
6066 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006067 uint32_t ncs_sk_type;
6068 struct ndp_pmk pmk;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006069};
6070
6071/**
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006072 * struct ndp_initiator_rsp - response event from FW
Ravi Joshi412f23d2016-05-26 15:09:23 -07006073 * @transaction_id: unique identifier
6074 * @vdev_id: session id of the interface over which ndp is being created
6075 * @ndp_instance_id: locally created NDP instance ID
6076 * @status: status of the ndp request
6077 * @reason: reason for failure if any
6078 *
6079 */
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006080struct ndp_initiator_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07006081 uint32_t transaction_id;
6082 uint32_t vdev_id;
6083 uint32_t ndp_instance_id;
6084 uint32_t status;
Naveen Rawat8d63a592016-06-29 18:30:59 -07006085 uint32_t reason;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006086};
6087
6088/**
6089 * struct ndp_indication_event - create ndp indication on the responder
6090 * @vdev_id: session id of the interface over which ndp is being created
6091 * @service_instance_id: Service identifier
6092 * @peer_discovery_mac_addr: Peer's discovery mac address
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006093 * @peer_mac_addr: Peer's NDI mac address
Ravi Joshi412f23d2016-05-26 15:09:23 -07006094 * @ndp_initiator_mac_addr: NDI mac address of the peer initiating NDP
6095 * @ndp_instance_id: locally created NDP instance ID
6096 * @role: self role for NDP
6097 * @ndp_accept_policy: accept policy configured by the upper layer
6098 * @ndp_config: ndp configuration params
6099 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006100 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
6101 * @scid: security context identifier
Ravi Joshi412f23d2016-05-26 15:09:23 -07006102 *
6103 */
6104struct ndp_indication_event {
6105 uint32_t vdev_id;
6106 uint32_t service_instance_id;
6107 struct qdf_mac_addr peer_discovery_mac_addr;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006108 struct qdf_mac_addr peer_mac_addr;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006109 uint32_t ndp_instance_id;
6110 enum ndp_self_role role;
6111 enum ndp_accept_policy policy;
6112 struct ndp_cfg ndp_config;
6113 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006114 uint32_t ncs_sk_type;
6115 struct ndp_scid scid;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006116};
6117
6118/**
6119 * struct ndp_responder_req - responder's response to ndp create request
6120 * @transaction_id: unique identifier
6121 * @vdev_id: session id of the interface over which ndp is being created
6122 * @ndp_instance_id: locally created NDP instance ID
6123 * @ndp_rsp: response to the ndp create request
6124 * @ndp_config: ndp configuration params
6125 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006126 * @pmk: pairwise master key
6127 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
Ravi Joshi412f23d2016-05-26 15:09:23 -07006128 *
6129 */
6130struct ndp_responder_req {
6131 uint32_t transaction_id;
6132 uint32_t vdev_id;
6133 uint32_t ndp_instance_id;
6134 enum ndp_response_code ndp_rsp;
6135 struct ndp_cfg ndp_config;
6136 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006137 struct ndp_pmk pmk;
6138 uint32_t ncs_sk_type;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006139};
6140
6141/**
6142 * struct ndp_responder_rsp_event - response to responder's request
6143 * @transaction_id: unique identifier
6144 * @vdev_id: session id of the interface over which ndp is being created
6145 * @status: command status
6146 * @reason: reason for failure if any
Abhishek Singh4fef7472016-06-06 11:36:03 -07006147 * @peer_mac_addr: Peer's mac address
Rakesh Sunkid92d1082017-01-04 15:14:28 -08006148 * @create_peer: Flag to indicate to create peer
Ravi Joshi412f23d2016-05-26 15:09:23 -07006149 */
6150struct ndp_responder_rsp_event {
6151 uint32_t transaction_id;
6152 uint32_t vdev_id;
6153 uint32_t status;
6154 uint32_t reason;
Abhishek Singh4fef7472016-06-06 11:36:03 -07006155 struct qdf_mac_addr peer_mac_addr;
Rakesh Sunkid92d1082017-01-04 15:14:28 -08006156 bool create_peer;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006157};
6158
6159/**
6160 * struct ndp_confirm_event - ndp confirmation event from FW
6161 * @vdev_id: session id of the interface over which ndp is being created
6162 * @ndp_instance_id: ndp instance id for which confirm is being generated
Naveen Rawat460be782016-06-29 18:26:22 -07006163 * @reason_code : reason code(opaque to driver)
6164 * @num_active_ndps_on_peer: number of ndp instances on peer
Ravi Joshi412f23d2016-05-26 15:09:23 -07006165 * @peer_ndi_mac_addr: peer NDI mac address
6166 * @rsp_code: ndp response code
Ravi Joshi412f23d2016-05-26 15:09:23 -07006167 * @ndp_info: ndp application info
6168 *
6169 */
6170struct ndp_confirm_event {
6171 uint32_t vdev_id;
6172 uint32_t ndp_instance_id;
Naveen Rawat460be782016-06-29 18:26:22 -07006173 uint32_t reason_code;
6174 uint32_t num_active_ndps_on_peer;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006175 struct qdf_mac_addr peer_ndi_mac_addr;
6176 enum ndp_response_code rsp_code;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006177 struct ndp_app_info ndp_info;
6178};
6179
6180/**
6181 * struct ndp_end_req - ndp end request
6182 * @transaction_id: unique transaction identifier
Ravi Joshi412f23d2016-05-26 15:09:23 -07006183 * @num_ndp_instances: number of ndp instances to be terminated
Naveen Rawatf28315c2016-06-29 18:06:02 -07006184 * @ndp_ids: pointer to array of ndp_instance_id to be terminated
Ravi Joshi412f23d2016-05-26 15:09:23 -07006185 *
6186 */
6187struct ndp_end_req {
6188 uint32_t transaction_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006189 uint32_t num_ndp_instances;
Naveen Rawatf28315c2016-06-29 18:06:02 -07006190 uint32_t *ndp_ids;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006191};
6192
6193/**
6194 * struct peer_ndp_map - mapping of NDP instances to peer to VDEV
6195 * @vdev_id: session id of the interface over which ndp is being created
6196 * @peer_ndi_mac_addr: peer NDI mac address
6197 * @num_active_ndp_sessions: number of active NDP sessions on the peer
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07006198 * @type: NDP end indication type
6199 * @reason_code: NDP end indication reason code
6200 * @ndp_instance_id: NDP instance ID
Ravi Joshi412f23d2016-05-26 15:09:23 -07006201 *
6202 */
6203struct peer_ndp_map {
6204 uint32_t vdev_id;
6205 struct qdf_mac_addr peer_ndi_mac_addr;
6206 uint32_t num_active_ndp_sessions;
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07006207 enum ndp_end_type type;
6208 enum ndp_end_reason_code reason_code;
6209 uint32_t ndp_instance_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006210};
6211
6212/**
6213 * struct ndp_end_rsp_event - firmware response to ndp end request
6214 * @transaction_id: unique identifier for the request
Naveen Rawatf28315c2016-06-29 18:06:02 -07006215 * @status: status of operation
6216 * @reason: reason(opaque to host driver)
Ravi Joshi412f23d2016-05-26 15:09:23 -07006217 *
6218 */
6219struct ndp_end_rsp_event {
6220 uint32_t transaction_id;
Naveen Rawatf28315c2016-06-29 18:06:02 -07006221 uint32_t status;
6222 uint32_t reason;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006223};
6224
6225/**
6226 * struct ndp_end_indication_event - ndp termination notification from FW
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07006227 * @num_ndp_ids: number of NDP ids
6228 * @ndp_map: mapping of NDP instances to peer and vdev
Ravi Joshi412f23d2016-05-26 15:09:23 -07006229 *
6230 */
6231struct ndp_end_indication_event {
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07006232 uint32_t num_ndp_ids;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006233 struct peer_ndp_map ndp_map[];
6234};
6235
6236/**
6237 * struct ndp_schedule_update_req - ndp schedule update request
6238 * @transaction_id: unique identifier
6239 * @vdev_id: session id of the interface over which ndp is being created
6240 * @ndp_instance_id: ndp instance id for which schedule update is requested
6241 * @ndp_qos: new set of qos parameters
6242 *
6243 */
6244struct ndp_schedule_update_req {
6245 uint32_t transaction_id;
6246 uint32_t vdev_id;
6247 uint32_t ndp_instance_id;
6248 struct ndp_qos_cfg ndp_qos;
6249};
6250
6251/**
6252 * struct ndp_schedule_update_rsp - ndp schedule update response
6253 * @transaction_id: unique identifier
6254 * @vdev_id: session id of the interface over which ndp is being created
6255 * @status: status of the request
6256 * @reason: reason code for failure if any
6257 *
6258 */
6259struct ndp_schedule_update_rsp {
6260 uint32_t transaction_id;
6261 uint32_t vdev_id;
6262 uint32_t status;
6263 uint32_t reason;
6264};
6265
6266/**
6267 * struct sme_ndp_peer_ind - ndp peer indication
6268 * @msg_type: message id
6269 * @msg_len: message length
6270 * @session_id: session id
6271 * @peer_mac_addr: peer mac address
6272 * @sta_id: station id
6273 *
6274 */
6275struct sme_ndp_peer_ind {
6276 uint16_t msg_type;
6277 uint16_t msg_len;
6278 uint8_t session_id;
6279 struct qdf_mac_addr peer_mac_addr;
6280 uint16_t sta_id;
6281};
6282
6283#endif /* WLAN_FEATURE_NAN_DATAPATH */
6284
Peng Xu8fdaa492016-06-22 10:20:47 -07006285/**
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05306286 * struct sir_set_tx_rx_aggregation_size - sets tx rx aggregation size
6287 * @vdev_id: vdev id of the session
Arif Hussain0e246802018-05-01 18:13:44 -07006288 * @aggr_type: TX Aggregation Type (0=A-MPDU, 1=A-MSDU)
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05306289 * @tx_aggregation_size: Tx aggregation size
Paul Zhangee09f8e2018-04-23 16:11:32 +08006290 * @tx_aggregation_size_be: Tx aggregation size for be queue
6291 * @tx_aggregation_size_bk: Tx aggregation size for bk queue
6292 * @tx_aggregation_size_vi: Tx aggregation size for vi queue
6293 * @tx_aggregation_size_vo: Tx aggregation size for vo queue
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05306294 * @rx_aggregation_size: Rx aggregation size
6295 */
6296struct sir_set_tx_rx_aggregation_size {
6297 uint8_t vdev_id;
Arif Hussain0e246802018-05-01 18:13:44 -07006298 wmi_vdev_custom_aggr_type_t aggr_type;
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05306299 uint32_t tx_aggregation_size;
Paul Zhangee09f8e2018-04-23 16:11:32 +08006300 uint32_t tx_aggregation_size_be;
6301 uint32_t tx_aggregation_size_bk;
6302 uint32_t tx_aggregation_size_vi;
6303 uint32_t tx_aggregation_size_vo;
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05306304 uint32_t rx_aggregation_size;
6305};
6306
6307/**
stonez26388d02018-10-17 13:37:48 +08006308 * struct sir_set_tx_sw_retry_threshold - set sw retry threshold
Paul Zhang33fae272018-04-23 16:19:00 +08006309 * @vdev_id: vdev id of the session
stonez26388d02018-10-17 13:37:48 +08006310 * @tx_aggr_sw_retry_threshold_be: aggr sw retry threshold for BE
6311 * @tx_aggr_sw_retry_threshold_bk: aggr sw retry threshold for BK
6312 * @tx_aggr_sw_retry_threshold_vi: aggr sw retry threshold for VI
6313 * @tx_aggr_sw_retry_threshold_vo: aggr sw retry threshold for VO
6314 * @tx_non_aggr_sw_retry_threshold_be: non aggr sw retry threshold for BE
6315 * @tx_non_aggr_sw_retry_threshold_bk: non aggr sw retry threshold for BK
6316 * @tx_non_aggr_sw_retry_threshold_vi: non aggr sw retry threshold for VI
6317 * @tx_non_aggr_sw_retry_threshold_vo: non aggr sw retry threshold for VO
Paul Zhang33fae272018-04-23 16:19:00 +08006318 */
stonez26388d02018-10-17 13:37:48 +08006319struct sir_set_tx_sw_retry_threshold {
Paul Zhang33fae272018-04-23 16:19:00 +08006320 uint8_t vdev_id;
6321 uint32_t tx_aggr_sw_retry_threshold_be;
6322 uint32_t tx_aggr_sw_retry_threshold_bk;
6323 uint32_t tx_aggr_sw_retry_threshold_vi;
6324 uint32_t tx_aggr_sw_retry_threshold_vo;
stonez26388d02018-10-17 13:37:48 +08006325 uint32_t tx_non_aggr_sw_retry_threshold_be;
6326 uint32_t tx_non_aggr_sw_retry_threshold_bk;
6327 uint32_t tx_non_aggr_sw_retry_threshold_vi;
6328 uint32_t tx_non_aggr_sw_retry_threshold_vo;
Paul Zhang33fae272018-04-23 16:19:00 +08006329};
6330
6331/**
Peng Xu8fdaa492016-06-22 10:20:47 -07006332 * struct sir_p2p_lo_start - p2p listen offload start
6333 * @vdev_id: vdev identifier
6334 * @ctl_flags: control flag
6335 * @freq: p2p listen frequency
6336 * @period: listen offload period
6337 * @interval: listen offload interval
6338 * @count: number listen offload intervals
6339 * @device_types: device types
6340 * @dev_types_len: device types length
6341 * @probe_resp_tmplt: probe response template
6342 * @probe_resp_len: probe response template length
6343 */
6344struct sir_p2p_lo_start {
6345 uint32_t vdev_id;
6346 uint32_t ctl_flags;
6347 uint32_t freq;
6348 uint32_t period;
6349 uint32_t interval;
6350 uint32_t count;
6351 uint8_t *device_types;
6352 uint32_t dev_types_len;
6353 uint8_t *probe_resp_tmplt;
6354 uint32_t probe_resp_len;
6355};
6356
6357/**
6358 * struct sir_p2p_lo_event - P2P listen offload stop event
6359 * @vdev_id: vdev identifier
6360 * @reason_code: P2P listen offload stop reason
6361 */
6362struct sir_p2p_lo_event {
6363 uint32_t vdev_id;
6364 uint32_t reason_code;
6365};
Manjeet Singhf82ed072016-07-08 11:40:00 +05306366
6367/**
6368 * struct sir_hal_pwr_dbg_cmd - unit test command parameters
6369 * @pdev_id: pdev id
6370 * @module_id: module id
6371 * @num_args: number of arguments
6372 * @args: arguments
6373 */
6374struct sir_mac_pwr_dbg_cmd {
6375 uint32_t pdev_id;
6376 uint32_t module_id;
6377 uint32_t num_args;
6378 uint32_t args[MAX_POWER_DBG_ARGS_SUPPORTED];
6379};
6380
Kondabattini, Ganesh3f2d02c2016-09-13 12:23:47 +05306381/**
6382 * struct sme_send_disassoc_frm_req - send disassoc request frame
6383 * @msg_type: message type
6384 * @length: length of message
6385 * @session_id: session id
6386 * @trans_id: transaction id
6387 * @peer_mac: peer mac address
6388 * @reason: reason for disassoc
6389 * @wait_for_ack: wait for acknowledgment
6390 **/
6391 struct sme_send_disassoc_frm_req {
6392 uint16_t msg_type;
6393 uint16_t length;
6394 uint8_t session_id;
6395 uint16_t trans_id;
6396 uint8_t peer_mac[6];
6397 uint16_t reason;
6398 uint8_t wait_for_ack;
6399 };
6400
Kondabattini, Ganeshe4f18e02016-09-13 13:01:22 +05306401/**
6402 * struct sme_update_access_policy_vendor_ie - update vendor ie and access
6403 * policy
6404 * @msg_type: message id
6405 * @msg_len: message length
6406 * @sme_session_id: sme session id
6407 * @ie: vendor ie
6408 * @access_policy: access policy for vendor ie
6409 */
6410struct sme_update_access_policy_vendor_ie {
6411 uint16_t msg_type;
6412 uint16_t length;
6413 uint32_t sme_session_id;
6414 uint8_t ie[SIR_MAC_MAX_IE_LENGTH];
6415 uint8_t access_policy;
6416};
6417
Padma, Santhosh Kumard7cc0792016-06-28 18:54:12 +05306418/**
6419 * struct sir_encrypt_decrypt_rsp_params - encrypt/decrypt rsp params
6420 * @vdev_id: vdev id
6421 * @status: status
6422 * @data_length: data length
6423 * @data: data pointer
6424 */
6425struct sir_encrypt_decrypt_rsp_params {
6426 uint32_t vdev_id;
6427 int32_t status;
6428 uint32_t data_length;
6429 uint8_t *data;
6430};
6431
Agrawal, Ashish35b251d2016-09-08 19:21:03 +05306432/**
6433 * struct sme_tx_fail_cnt_threshold - tx failure count for disconnect to fw
6434 * @session_id: Session id
6435 * @tx_fail_cnt_threshold: Tx failure count to do disconnect
6436 */
6437struct sme_tx_fail_cnt_threshold {
6438 uint8_t session_id;
6439 uint32_t tx_fail_cnt_threshold;
6440};
Agrawal Ashishda3e9502016-09-21 17:43:51 +05306441
6442/**
6443 * struct sme_short_retry_limit - transmission retry limit for short frames.
6444 * @session_id: Session id
6445 * @short_retry_limit: tranmission retry limit for short frame.
6446 *
6447 */
6448struct sme_short_retry_limit {
6449 uint8_t session_id;
6450 uint32_t short_retry_limit;
6451};
6452
6453/**
6454 * struct sme_long_retry_limit - tranmission retry limit for long frames
6455 * @session_id: Session id
6456 * @short_retry_limit: tranmission retry limit for long frames.
6457 *
6458 */
6459struct sme_long_retry_limit {
6460 uint8_t session_id;
6461 uint32_t long_retry_limit;
6462};
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05306463
6464/**
Kiran Kumar Lokere08195ef2018-01-17 19:25:15 -08006465 * struct sme_addba_accept - Allow/reject the addba request frame
6466 * @session_id: Session id
6467 * @addba_accept: Allow/reject the addba request frame
6468 */
6469struct sme_addba_accept {
6470 uint8_t session_id;
6471 uint8_t addba_accept;
6472};
6473
6474/**
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05306475 * struct sme_sta_inactivity_timeout - set sta_inactivity_timeout
6476 * @session_id: session Id.
6477 * @sta_inactivity_timeout: Timeout to disconnect STA after there
6478 * is no activity.
6479 */
6480struct sme_sta_inactivity_timeout {
6481 uint8_t session_id;
6482 uint32_t sta_inactivity_timeout;
6483};
Yingying Tang95409972016-10-20 15:16:15 +08006484
6485/*
6486 * struct wow_pulse_mode - WoW Pulse set cmd struct
6487 * @wow_pulse_enable: enable or disable this feature
6488 * @wow_pulse_pin: GPIO PIN for Pulse
6489 * @wow_pulse_interval_low: Pulse interval low
6490 * @wow_pulse_interval_high: Pulse interval high
6491 *
6492 * SME uses this structure to configure wow pulse info
6493 * and send it to WMA
6494 */
6495struct wow_pulse_mode {
6496 bool wow_pulse_enable;
6497 uint8_t wow_pulse_pin;
6498 uint16_t wow_pulse_interval_high;
6499 uint16_t wow_pulse_interval_low;
6500};
6501
Rajeev Kumare406d652017-01-30 17:47:05 -08006502
6503/**
Rajeev Kumard138ac52017-01-30 18:38:37 -08006504 * umac_send_mb_message_to_mac(): post message to umac
Rajeev Kumare406d652017-01-30 17:47:05 -08006505 * @msg: opaque message pointer
6506 *
6507 * Return: QDF status
6508 */
Rajeev Kumard138ac52017-01-30 18:38:37 -08006509QDF_STATUS umac_send_mb_message_to_mac(void *msg);
Rajeev Kumare406d652017-01-30 17:47:05 -08006510
Kapil Gupta4f0c0c12017-02-07 15:21:15 +05306511/**
6512 * struct scan_chan_info - channel info
6513 * @freq: radio frequence
6514 * @cmd flag: cmd flag
6515 * @noise_floor: noise floor
6516 * @cycle_count: cycle count
6517 * @rx_clear_count: rx clear count
6518 * @tx_frame_count: TX frame count
6519 * @clock_freq: clock frequence MHZ
6520 */
6521struct scan_chan_info {
6522 uint32_t freq;
6523 uint32_t cmd_flag;
6524 uint32_t noise_floor;
6525 uint32_t cycle_count;
6526 uint32_t rx_clear_count;
6527 uint32_t tx_frame_count;
6528 uint32_t clock_freq;
6529};
Dustin Brown54096432017-02-23 13:00:44 -08006530
6531/**
6532 * enum wow_resume_trigger - resume trigger override setting values
6533 * @WOW_RESUME_TRIGGER_DEFAULT: fw to use platform default resume trigger
6534 * @WOW_RESUME_TRIGGER_HTC_WAKEUP: force fw to use HTC Wakeup to resume
6535 * @WOW_RESUME_TRIGGER_GPIO: force fw to use GPIO to resume
6536 * @WOW_RESUME_TRIGGER_COUNT: number of resume trigger options
6537 */
6538enum wow_resume_trigger {
6539 /* always first */
6540 WOW_RESUME_TRIGGER_DEFAULT = 0,
6541 WOW_RESUME_TRIGGER_HTC_WAKEUP,
6542 WOW_RESUME_TRIGGER_GPIO,
6543 /* always last */
6544 WOW_RESUME_TRIGGER_COUNT
6545};
6546
6547/**
6548 * enum wow_interface_pause - interface pause override setting values
6549 * @WOW_INTERFACE_PAUSE_DEFAULT: use platform default interface pause setting
6550 * @WOW_INTERFACE_PAUSE_ENABLE: force interface pause setting to enabled
6551 * @WOW_INTERFACE_PAUSE_DISABLE: force interface pause setting to disabled
6552 * @WOW_INTERFACE_PAUSE_COUNT: number of interface pause options
6553 */
6554enum wow_interface_pause {
6555 /* always first */
6556 WOW_INTERFACE_PAUSE_DEFAULT = 0,
6557 WOW_INTERFACE_PAUSE_ENABLE,
6558 WOW_INTERFACE_PAUSE_DISABLE,
6559 /* always last */
6560 WOW_INTERFACE_PAUSE_COUNT
6561};
6562
6563/**
6564 * struct wow_enable_params - A collection of wow enable override parameters
6565 * @is_unit_test: true to notify fw this is a unit-test suspend
6566 * @interface_pause: used to override the interface pause indication sent to fw
6567 * @resume_trigger: used to force fw to use a particular resume method
6568 */
6569struct wow_enable_params {
6570 bool is_unit_test;
6571 enum wow_interface_pause interface_pause;
6572 enum wow_resume_trigger resume_trigger;
6573};
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07006574
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08006575#define HE_LTF_1X 0
6576#define HE_LTF_2X 1
6577#define HE_LTF_4X 2
6578
6579#define HE_LTF_ALL 0x7
6580#define HE_SGI_MASK 0xFF00
6581
6582#define AUTO_RATE_GI_400NS 8
6583#define AUTO_RATE_GI_800NS 9
6584#define AUTO_RATE_GI_1600NS 10
6585#define AUTO_RATE_GI_3200NS 11
6586
6587#define SET_AUTO_RATE_SGI_VAL(set_val, bit_mask) \
6588 (set_val = (set_val & HE_LTF_ALL) | bit_mask)
6589
6590#define SET_AUTO_RATE_HE_LTF_VAL(set_val, bit_mask) \
6591 (set_val = (set_val & HE_SGI_MASK) | bit_mask)
6592
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07006593#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -07006594#define HE_CAP_OUI_TYPE "\x23"
6595#define HE_CAP_OUI_SIZE 1
6596#define HE_OP_OUI_TYPE "\x24"
6597#define HE_OP_OUI_SIZE 1
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08006598
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07006599#define HE_RU_ALLOC_INDX0_MASK (0x01 << 0)
6600#define HE_RU_ALLOC_INDX1_MASK (0x01 << 1)
6601#define HE_RU_ALLOC_INDX2_MASK (0x01 << 2)
6602#define HE_RU_ALLOC_INDX3_MASK (0x01 << 3)
6603
6604/* 3 bits for NSS and 4 bits for RU Index */
6605#define HE_PPET_NSS_LEN 3
6606#define HE_PEPT_RU_IDX_LEN 4
6607#define HE_PPET_NSS_RU_LEN (HE_PPET_NSS_LEN + HE_PEPT_RU_IDX_LEN)
6608#define HE_PPET_SIZE 3
6609#define HE_BYTE_SIZE 8
6610
Naveen Rawat819158d2018-01-16 10:56:45 -08006611struct ppet_hdr {
6612 uint8_t nss:3;
6613 uint8_t ru_idx_mask:4;
6614 uint8_t remaining:1;
6615};
6616
6617/* MAX PPET size = 7 bits + (max_nss X max_ru_number X 6) = 25 bytes */
6618#define HE_MAX_PPET_SIZE WNI_CFG_HE_PPET_LEN
6619
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -08006620#define HE_MAX_PHY_CAP_SIZE 3
6621
Naveen Rawataeca1b92017-10-16 16:55:31 -07006622#define HE_CH_WIDTH_GET_BIT(ch_wd, bit) (((ch_wd) >> (bit)) & 1)
6623#define HE_CH_WIDTH_COMBINE(b0, b1, b2, b3, b4, b5, b6) \
6624 ((uint8_t)(b0) | ((b1) << 1) | ((b2) << 2) | ((b3) << 3) | \
6625 ((b4) << 4) | ((b5) << 5) | ((b6) << 6))
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -07006626
Naveen Rawataeca1b92017-10-16 16:55:31 -07006627/*
6628 * MCS values are interpreted as in IEEE 11ax-D1.4 spec onwards
6629 * +-----------------------------------------------------+
6630 * | SS8 | SS7 | SS6 | SS5 | SS4 | SS3 | SS2 | SS1 |
6631 * +-----------------------------------------------------+
6632 * | 15-14 | 13-12 | 11-10 | 9-8 | 7-6 | 5-4 | 3-2 | 1-0 |
6633 * +-----------------------------------------------------+
6634 */
6635#define HE_MCS_NSS_SHIFT(nss) (((nss) - 1) << 1)
6636#define HE_MCS_MSK_4_NSS(nss) (3 << HE_MCS_NSS_SHIFT(nss))
6637#define HE_MCS_INV_MSK_4_NSS(nss) (~HE_MCS_MSK_4_NSS(nss))
6638#define HE_GET_MCS_4_NSS(mcs_set, nss) \
6639 (((mcs_set) >> HE_MCS_NSS_SHIFT(nss)) & 3)
6640#define HE_SET_MCS_4_NSS(mcs_set, mcs, nss) \
6641 (((mcs_set) & HE_MCS_INV_MSK_4_NSS(nss)) | \
6642 ((mcs) << HE_MCS_NSS_SHIFT(nss)))
6643#define HE_MCS_IS_NSS_ENABLED(mcs_set, nss) \
6644 ((HE_MCS_MSK_4_NSS(nss) & (mcs_set)) != HE_MCS_MSK_4_NSS(nss))
6645
6646#define HE_MCS_ALL_DISABLED 0xFFFF
Kiran Kumar Lokere59a569e2018-01-24 15:00:50 -08006647
6648#define HE_MCS_0_7 0x0
6649#define HE_MCS_0_9 0x1
6650#define HE_MCS_0_11 0x2
6651#define HE_MCS_DISABLE 0x3
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08006652
Naveen Rawataeca1b92017-10-16 16:55:31 -07006653/*
6654 * Following formuala has been arrived at using karnaugh map and unit tested
6655 * with sample code. Take MCS for each NSS as 2 bit value first and solve for
6656 * 2 bit intersection of NSS. Use following table/Matrix as guide for solving
6657 * K-Maps
6658 * MCS 1\MCS 2 00 01 10 11
6659 * 00 00 00 00 11
6660 * 01 00 01 01 11
6661 * 10 00 01 10 11
6662 * 11 11 11 11 11
6663 * if output MCS is o1o0, then as per K-map reduction:
6664 * o0 = m1.m0 | n1.n0 | (~m1).m0.(n1^n0) | (~n1).n0.(m1^m0)
6665 * o1 = m1.m0 | n1.n0 | m1.(~m0).n1.(~n0)
6666 *
6667 * Please note: Calculating MCS intersection is 80211 protocol specific and
6668 * should be implemented in PE. WMA can use this macro rather than calling any
6669 * lim API to do the intersection.
6670 */
6671#define HE_INTERSECT_MCS_BITS_PER_NSS(m1, m0, n1, n0) \
6672 (((m1 & m0) | (n1 & n0) | (((~m1) & m0) & (n1 ^ n0)) | \
6673 (((~n1) & n0) & (m1 ^ m0))) | (((m1 & m0) | (n1 & n0) | \
6674 (m1 & ~m0 & n1 & ~n0)) << 1))
6675
6676/* following takes MCS as 2 bits */
6677#define HE_INTERSECT_MCS_PER_NSS(mcs_1, mcs_2) \
6678 HE_INTERSECT_MCS_BITS_PER_NSS((mcs_1 >> 1), (mcs_1 & 1), \
6679 (mcs_2 >> 1), (mcs_2 & 1))
6680
6681/* following takes MCS as 16 bits */
6682#define HE_INTERSECT_MCS(mcs_1, mcs_2) ( \
6683 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 1), \
6684 HE_GET_MCS_4_NSS(mcs_2, 1)) << HE_MCS_NSS_SHIFT(1) | \
6685 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 2), \
6686 HE_GET_MCS_4_NSS(mcs_2, 2)) << HE_MCS_NSS_SHIFT(2) | \
6687 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 3), \
6688 HE_GET_MCS_4_NSS(mcs_2, 3)) << HE_MCS_NSS_SHIFT(3) | \
6689 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 4), \
6690 HE_GET_MCS_4_NSS(mcs_2, 4)) << HE_MCS_NSS_SHIFT(4) | \
6691 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 5), \
6692 HE_GET_MCS_4_NSS(mcs_2, 5)) << HE_MCS_NSS_SHIFT(5) | \
6693 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 6), \
6694 HE_GET_MCS_4_NSS(mcs_2, 6)) << HE_MCS_NSS_SHIFT(6) | \
6695 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 7), \
6696 HE_GET_MCS_4_NSS(mcs_2, 7)) << HE_MCS_NSS_SHIFT(7) | \
6697 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 8), \
6698 HE_GET_MCS_4_NSS(mcs_2, 8)) << HE_MCS_NSS_SHIFT(8))
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -07006699
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -08006700/**
6701 * struct he_capability - to store 11ax HE capabilities
6702 * @phy_cap: HE PHY capabilities
6703 * @mac_cap: HE MAC capabilities
6704 * @mcs: HE MCS
6705 * @ppet: HE PPE threshold
6706 */
6707struct he_capability {
6708 uint32_t phy_cap[HE_MAX_PHY_CAP_SIZE];
6709 uint32_t mac_cap;
6710 uint32_t mcs;
6711 struct wlan_psoc_host_ppe_threshold ppet;
6712};
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07006713#endif
6714
Naveen Rawataeca1b92017-10-16 16:55:31 -07006715#define HE_GET_NSS(mcs, nss) \
6716 do { \
6717 (nss) = 0; \
Naveen Rawatcbcc6542017-10-30 17:55:03 -07006718 while ((((mcs) >> ((nss)*2)) & 3) != 3 && nss < 8) \
Naveen Rawataeca1b92017-10-16 16:55:31 -07006719 (nss)++; \
6720 } while (0)
6721
Nitesh Shah99dd9552017-03-20 19:27:47 +05306722/**
6723 * struct sir_del_all_tdls_peers - delete all tdls peers
6724 * @msg_type: type of message
6725 * @msg_len: length of message
6726 * @bssid: bssid of peer device
6727 */
6728struct sir_del_all_tdls_peers {
6729 uint16_t msg_type;
6730 uint16_t msg_len;
6731 struct qdf_mac_addr bssid;
6732};
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08006733
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05306734/**
6735 * struct rsp_stats - arp packet stats
6736 * @arp_req_enqueue: fw tx count
6737 * @arp_req_tx_success: tx ack count
6738 * @arp_req_tx_failure: tx ack fail count
6739 * @arp_rsp_recvd: rx fw count
6740 * @out_of_order_arp_rsp_drop_cnt: out of order count
6741 * @dad_detected: dad detected
6742 * @connect_status: connection status
6743 * @ba_session_establishment_status: BA session status
Poddar, Siddarth465330e2018-01-08 18:23:54 +05306744 * @connect_stats_present: connectivity stats present or not
6745 * @tcp_ack_recvd: tcp syn ack's count
6746 * @icmpv4_rsp_recvd: icmpv4 responses count
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05306747 */
6748struct rsp_stats {
6749 uint32_t vdev_id;
6750 uint32_t arp_req_enqueue;
6751 uint32_t arp_req_tx_success;
6752 uint32_t arp_req_tx_failure;
6753 uint32_t arp_rsp_recvd;
6754 uint32_t out_of_order_arp_rsp_drop_cnt;
6755 uint32_t dad_detected;
6756 uint32_t connect_status;
6757 uint32_t ba_session_establishment_status;
Poddar, Siddarth465330e2018-01-08 18:23:54 +05306758 bool connect_stats_present;
6759 uint32_t tcp_ack_recvd;
6760 uint32_t icmpv4_rsp_recvd;
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05306761};
6762
6763/**
6764 * struct set_arp_stats_params - set/reset arp stats
6765 * @vdev_id: session id
6766 * @flag: enable/disable stats
6767 * @pkt_type: type of packet(1 - arp)
6768 * @ip_addr: subnet ipv4 address in case of encrypted packets
Poddar, Siddarth465330e2018-01-08 18:23:54 +05306769 * @pkt_type_bitmap: pkt bitmap
6770 * @tcp_src_port: tcp src port for pkt tracking
6771 * @tcp_dst_port: tcp dst port for pkt tracking
6772 * @icmp_ipv4: target ipv4 address to track ping packets
6773 * @reserved: reserved
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05306774 */
6775struct set_arp_stats_params {
6776 uint32_t vdev_id;
6777 uint8_t flag;
6778 uint8_t pkt_type;
6779 uint32_t ip_addr;
Poddar, Siddarth465330e2018-01-08 18:23:54 +05306780 uint32_t pkt_type_bitmap;
6781 uint32_t tcp_src_port;
6782 uint32_t tcp_dst_port;
6783 uint32_t icmp_ipv4;
6784 uint32_t reserved;
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05306785};
6786
6787/**
6788 * struct get_arp_stats_params - get arp stats from firmware
6789 * @pkt_type: packet type(1 - ARP)
6790 * @vdev_id: session id
6791 */
6792struct get_arp_stats_params {
6793 uint8_t pkt_type;
6794 uint32_t vdev_id;
6795};
6796
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05306797typedef void (*sme_rcpi_callback)(void *context, struct qdf_mac_addr mac_addr,
6798 int32_t rcpi, QDF_STATUS status);
6799/**
6800 * struct sme_rcpi_req - structure for querying rcpi info
6801 * @session_id: session for which rcpi is required
6802 * @measurement_type: type of measurement from enum rcpi_measurement_type
6803 * @rcpi_callback: callback function to be invoked for rcpi response
6804 * @rcpi_context: context info for rcpi callback
6805 * @mac_addr: peer addr for which rcpi is required
6806 */
6807struct sme_rcpi_req {
6808 uint32_t session_id;
6809 enum rcpi_measurement_type measurement_type;
6810 sme_rcpi_callback rcpi_callback;
6811 void *rcpi_context;
6812 struct qdf_mac_addr mac_addr;
6813};
6814
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08006815/*
6816 * @SCAN_REJECT_DEFAULT: default value
6817 * @CONNECTION_IN_PROGRESS: connection is in progress
6818 * @REASSOC_IN_PROGRESS: reassociation is in progress
6819 * @EAPOL_IN_PROGRESS: STA/P2P-CLI is in middle of EAPOL/WPS exchange
6820 * @SAP_EAPOL_IN_PROGRESS: SAP/P2P-GO is in middle of EAPOL/WPS exchange
6821 */
6822enum scan_reject_states {
6823 SCAN_REJECT_DEFAULT = 0,
6824 CONNECTION_IN_PROGRESS,
6825 REASSOC_IN_PROGRESS,
6826 EAPOL_IN_PROGRESS,
6827 SAP_EAPOL_IN_PROGRESS,
6828};
Sandeep Puligillaf587adf2017-04-27 19:53:21 -07006829
6830/**
lifeng66831662017-05-19 16:01:35 +08006831 * sir_sme_rx_aggr_hole_ind - sme rx aggr hole indication
6832 * @hole_cnt: num of holes detected
6833 * @hole_info_array: hole info
6834 */
6835struct sir_sme_rx_aggr_hole_ind {
6836 uint32_t hole_cnt;
6837 uint32_t hole_info_array[];
6838};
6839
6840/**
6841 * struct sir_set_rx_reorder_timeout_val - rx reorder timeout
6842 * @rx_timeout_pri: reorder timeout for AC
6843 * rx_timeout_pri[0] : AC_VO
6844 * rx_timeout_pri[1] : AC_VI
6845 * rx_timeout_pri[2] : AC_BE
6846 * rx_timeout_pri[3] : AC_BK
6847 */
6848struct sir_set_rx_reorder_timeout_val {
6849 uint32_t rx_timeout_pri[4];
6850};
6851
6852/**
6853 * struct sir_peer_set_rx_blocksize - set rx blocksize
6854 * @vdev_id: vdev id
6855 * @peer_macaddr: peer mac address
6856 * @rx_block_ack_win_limit: windows size limitation
6857 */
6858struct sir_peer_set_rx_blocksize {
6859 uint32_t vdev_id;
6860 struct qdf_mac_addr peer_macaddr;
6861 uint32_t rx_block_ack_win_limit;
6862};
Abhishek Singhf3756fc2017-06-28 16:04:06 +05306863
6864/**
6865 * struct sir_rssi_disallow_lst - Structure holding Rssi based avoid candidate
6866 * list
6867 * @node: Node pointer
6868 * @bssid: BSSID of the AP
6869 * @retry_delay: Retry delay received during last rejection in ms
6870 * @ expected_rssi: RSSI at which STA can initate
6871 * @time_during_rejection: Timestamp during last rejection in millisec
6872 */
6873struct sir_rssi_disallow_lst {
6874 qdf_list_node_t node;
6875 struct qdf_mac_addr bssid;
6876 uint32_t retry_delay;
6877 int8_t expected_rssi;
6878 qdf_time_t time_during_rejection;
6879};
lifengd217d192017-05-09 19:44:16 +08006880
6881/**
6882 * struct chain_rssi_result - chain rssi result
Jeff Johnson00634ab2018-05-10 14:27:50 -07006883 * num_chains_valid: valid chain num
lifengd217d192017-05-09 19:44:16 +08006884 * @chain_rssi: chain rssi result as dBm unit
lifengfe6c3e22018-04-03 12:10:04 +08006885 * @ant_id: antenna id
lifengd217d192017-05-09 19:44:16 +08006886 */
lifengfe6c3e22018-04-03 12:10:04 +08006887#define CHAIN_MAX_NUM 8
lifengd217d192017-05-09 19:44:16 +08006888struct chain_rssi_result {
lifengfe6c3e22018-04-03 12:10:04 +08006889 uint32_t num_chains_valid;
6890 uint32_t chain_rssi[CHAIN_MAX_NUM];
6891 uint32_t ant_id[CHAIN_MAX_NUM];
lifengd217d192017-05-09 19:44:16 +08006892};
6893
6894/**
6895 * struct get_chain_rssi_req_params - get chain rssi req params
6896 * @peer_macaddr: specific peer mac address
6897 * @session_id: session id
6898 */
6899struct get_chain_rssi_req_params {
6900 struct qdf_mac_addr peer_macaddr;
6901 uint8_t session_id;
6902};
6903
Ganesh Kondabattini35739572017-06-21 16:26:39 +05306904/*
6905 * struct sir_limit_off_chan - limit off-channel command parameters
6906 * @vdev_id: vdev id
6907 * @is_tos_active: status of the traffic (active/inactive)
6908 * @max_off_chan_time: max allowed off channel time
6909 * @rest_time: home channel time
6910 * @skip_dfs_chans: skip dfs channels during scan
6911 */
6912struct sir_limit_off_chan {
6913 uint8_t vdev_id;
6914 bool is_tos_active;
6915 uint32_t max_off_chan_time;
6916 uint32_t rest_time;
6917 bool skip_dfs_chans;
6918};
Padma, Santhosh Kumarb38ab512018-01-16 16:16:46 +05306919
Rajeev Kumar Sirasanagandla4f20b672018-03-12 13:52:50 +05306920typedef void (*roam_scan_stats_cb)(void *context,
6921 struct wmi_roam_scan_stats_res *res);
6922
6923/**
6924 * struct sir_roam_scan_stats - Stores roam scan context
6925 * @vdev_id: vdev id
6926 * @cb: callback to be invoked for roam scan stats response
6927 * @context: context of callback
6928 */
6929struct sir_roam_scan_stats {
6930 uint32_t vdev_id;
6931 roam_scan_stats_cb cb;
6932 void *context;
6933};
6934
Padma, Santhosh Kumarb38ab512018-01-16 16:16:46 +05306935/**
6936 * struct sae_info - SAE info used for commit/confirm messages
6937 * @msg_type: Message type
6938 * @msg_len: length of message
6939 * @vdev_id: vdev id
6940 * @peer_mac_addr: peer MAC address
6941 * @ssid: SSID
6942 */
6943struct sir_sae_info {
6944 uint16_t msg_type;
6945 uint16_t msg_len;
6946 uint32_t vdev_id;
6947 struct qdf_mac_addr peer_mac_addr;
6948 tSirMacSSid ssid;
6949};
Padma, Santhosh Kumardd3f4852018-01-16 18:51:51 +05306950
6951/**
6952 * struct sir_sae_msg - SAE msg used for message posting
6953 * @message_type: message type
6954 * @length: message length
6955 * @session_id: SME session id
6956 * @sae_status: SAE status, 0: Success, Non-zero: Failure.
6957 */
6958struct sir_sae_msg {
6959 uint16_t message_type;
6960 uint16_t length;
6961 uint16_t session_id;
6962 uint8_t sae_status;
6963};
6964
Varun Reddy Yeturu951de5d2018-09-10 21:36:22 -07006965/**
6966 * struct set_pcl_req - Request message to set the PCL
6967 * @chan_weights: PCL channel weights
6968 * @band: Supported band
6969 */
6970struct set_pcl_req {
6971 struct wmi_pcl_chan_weights chan_weights;
6972 enum band_info band;
6973};
6974
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08006975#endif /* __SIR_API_H */