blob: f18836634d57a233be427a18a376f0e84a88d874 [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
Anurag Chouhan5de8d172016-07-13 14:44:28 +053032
33/* Take care to avoid redefinition of this type, if it is */
34/* already defined in "halWmmApi.h" */
35#if !defined(_HALMAC_WMM_API_H)
36typedef struct sAniSirGlobal *tpAniSirGlobal;
37#endif
38
Amar Singhale4f28ee2015-10-21 14:36:56 -070039#include "qdf_types.h"
Amar Singhale4f28ee2015-10-21 14:36:56 -070040#include "cds_regdomain.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080041#include "sir_types.h"
42#include "sir_mac_prot_def.h"
43#include "ani_system_defs.h"
44#include "sir_params.h"
Naveen Rawat3b6068c2016-04-14 19:01:06 -070045#include "cds_regdomain.h"
Dustin Brown877a5a92016-11-17 13:56:52 -080046#include "wmi_unified.h"
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +053047#include "wmi_unified_param.h"
Zhang Qiana6e9c102016-12-22 16:47:24 +080048#include "ol_txrx_htt_api.h"
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -070049#include "wlan_reg_services_api.h"
Anurag Chouhan5de8d172016-07-13 14:44:28 +053050#include <dot11f.h>
Tushnim Bhattacharyya9e81b4c2017-02-15 17:11:14 -080051#include "wlan_policy_mgr_api.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080052
Rachit Kankane154559c2018-07-12 14:02:30 +053053#ifndef SIR_MAX_SUPPORTED_BSS
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -080054#define SIR_MAX_SUPPORTED_BSS 5
Rachit Kankane154559c2018-07-12 14:02:30 +053055#endif
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -080056
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080057#define OFFSET_OF(structType, fldName) (&((structType *)0)->fldName)
58
59/* / Max supported channel list */
60#define SIR_MAX_SUPPORTED_CHANNEL_LIST 96
61
62#define SIR_MDIE_ELEMENT_ID 54
Srinivas Girigowdad65dc5a2016-01-14 17:08:26 -080063#define SIR_MDIE_SIZE 3 /* MD ID(2 bytes), Capability(1 byte) */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080064
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +053065#define SIR_MAX_ELEMENT_ID 255
66
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080067/* Max number of channels are 165, but to access 165th element of array,
68 *array of 166 is required.
69 */
70#define SIR_MAX_24G_5G_CHANNEL_RANGE 166
71#define SIR_BCN_REPORT_MAX_BSS_DESC 4
72
73#define SIR_NUM_11B_RATES 4 /* 1,2,5.5,11 */
74#define SIR_NUM_11A_RATES 8 /* 6,9,12,18,24,36,48,54 */
75
76#define SIR_PM_SLEEP_MODE 0
77#define SIR_PM_ACTIVE_MODE 1
78
79/* hidden SSID options */
80#define SIR_SCAN_NO_HIDDEN_SSID 0
81#define SIR_SCAN_HIDDEN_SSID_PE_DECISION 1
82
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080083#define SIR_IPV4_ADDR_LEN 4
84
85typedef uint8_t tSirIpv4Addr[SIR_IPV4_ADDR_LEN];
86
87#define SIR_VERSION_STRING_LEN 64
88typedef uint8_t tSirVersionString[SIR_VERSION_STRING_LEN];
89
90/* Periodic Tx pattern offload feature */
91#define PERIODIC_TX_PTRN_MAX_SIZE 1536
92#define MAXNUM_PERIODIC_TX_PTRNS 6
93#define WIFI_SCANNING_MAC_OUI_LENGTH 3
94
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080095/* This should not be greater than MAX_NUMBER_OF_CONC_CONNECTIONS */
96#define MAX_VDEV_SUPPORTED 4
97
Manjeet Singhf82ed072016-07-08 11:40:00 +053098#define MAX_POWER_DBG_ARGS_SUPPORTED 8
Agrawal Ashishad16bda2016-09-16 20:16:04 +053099#define QOS_MAP_MAX_EX 21
100#define QOS_MAP_LEN_MIN 16
101#define QOS_MAP_LEN_MAX \
102 (QOS_MAP_LEN_MIN + 2 * QOS_MAP_MAX_EX)
Himanshu Agarwal37e42412016-07-21 14:35:09 +0530103#define NUM_CHAINS_MAX 2
104
Abhishek Singhf3756fc2017-06-28 16:04:06 +0530105#define MAX_RSSI_AVOID_BSSID_LIST 10
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530106
107/* Maximum number of realms present in fils indication element */
108#define SIR_MAX_REALM_COUNT 7
109/* Realm length */
110#define SIR_REALM_LEN 2
111/* Cache ID length */
112#define CACHE_ID_LEN 2
113
Will Huang496b36c2017-07-11 16:38:50 +0800114/* Maximum peer station number query one time */
115#define MAX_PEER_STA 12
116
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -0800117/* Maximum number of peers for SAP */
Rachit Kankane154559c2018-07-12 14:02:30 +0530118#ifndef SIR_SAP_MAX_NUM_PEERS
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -0800119#define SIR_SAP_MAX_NUM_PEERS 32
Rachit Kankane154559c2018-07-12 14:02:30 +0530120#endif
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -0800121
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800122#define SIR_KRK_KEY_LEN 16
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800123#define SIR_BTK_KEY_LEN 32
124#define SIR_KCK_KEY_LEN 16
125#define SIR_KEK_KEY_LEN 16
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +0530126#define SIR_KEK_KEY_LEN_FILS 64
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800127#define SIR_REPLAY_CTR_LEN 8
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +0530128#define SIR_PMK_LEN 48
129#define SIR_PMKID_LEN 16
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -0800130#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800131#define SIR_UAPSD_BITOFFSET_ACVO 0
132#define SIR_UAPSD_BITOFFSET_ACVI 1
133#define SIR_UAPSD_BITOFFSET_ACBK 2
134#define SIR_UAPSD_BITOFFSET_ACBE 3
135
136#define SIR_UAPSD_FLAG_ACVO (1 << SIR_UAPSD_BITOFFSET_ACVO)
137#define SIR_UAPSD_FLAG_ACVI (1 << SIR_UAPSD_BITOFFSET_ACVI)
138#define SIR_UAPSD_FLAG_ACBK (1 << SIR_UAPSD_BITOFFSET_ACBK)
139#define SIR_UAPSD_FLAG_ACBE (1 << SIR_UAPSD_BITOFFSET_ACBE)
140#define SIR_UAPSD_GET(ac, mask) (((mask) & (SIR_UAPSD_FLAG_ ## ac)) >> SIR_UAPSD_BITOFFSET_ ## ac)
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800141
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800142#endif
143
144/**
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700145 * enum sir_roam_op_code - Operation to be done by the callback.
146 * @SIR_ROAM_SYNCH_PROPAGATION: Propagate the new BSS info after roaming.
147 * @SIR_ROAMING_DEREGISTER_STA: Deregister the old STA after roaming.
Naveen Rawat8cc23b02016-07-14 12:22:56 -0700148 * @SIR_ROAMING_START: Firmware started roaming operation
149 * @SIR_ROAMING_ABORT: Firmware aborted roaming operation, still connected.
150 * @SIR_ROAM_SYNCH_COMPLETE: Roam sync propagation is complete.
Arif Hussain43354e62017-05-24 11:24:25 -0700151 * @SIR_ROAMING_INVOKE_FAIL: Firmware roaming failed.
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700152 */
153enum sir_roam_op_code {
154 SIR_ROAM_SYNCH_PROPAGATION = 1,
155 SIR_ROAMING_DEREGISTER_STA,
Naveen Rawat8cc23b02016-07-14 12:22:56 -0700156 SIR_ROAMING_START,
157 SIR_ROAMING_ABORT,
158 SIR_ROAM_SYNCH_COMPLETE,
Varun Reddy Yeturu04251862016-09-16 10:33:19 -0700159 SIR_ROAM_SYNCH_NAPI_OFF,
Arif Hussain43354e62017-05-24 11:24:25 -0700160 SIR_ROAMING_INVOKE_FAIL,
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700161};
162/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800163 * Module ID definitions.
164 */
165enum {
166 SIR_BOOT_MODULE_ID = 1,
167 SIR_HAL_MODULE_ID = 0x10,
168 SIR_CFG_MODULE_ID = 0x12,
169 SIR_LIM_MODULE_ID,
170 SIR_ARQ_MODULE_ID,
171 SIR_SCH_MODULE_ID,
172 SIR_PMM_MODULE_ID,
173 SIR_MNT_MODULE_ID,
174 SIR_DBG_MODULE_ID,
175 SIR_DPH_MODULE_ID,
176 SIR_SYS_MODULE_ID,
177 SIR_SMS_MODULE_ID,
178};
179
180#define SIR_WMA_MODULE_ID SIR_HAL_MODULE_ID
181
182/**
183 * First and last module definition for logging utility
184 *
185 * NOTE: The following definitions need to be updated if
186 * the above list is changed.
187 */
188#define SIR_FIRST_MODULE_ID SIR_HAL_MODULE_ID
189#define SIR_LAST_MODULE_ID SIR_SMS_MODULE_ID
190
191/* Type declarations used by Firmware and Host software */
192
193/* Scan type enum used in scan request */
194typedef enum eSirScanType {
195 eSIR_PASSIVE_SCAN,
196 eSIR_ACTIVE_SCAN,
197 eSIR_BEACON_TABLE,
198} tSirScanType;
199
gaurank kathpaliac63859d2018-05-03 18:48:41 +0530200/* Rsn Capabilities structure */
201struct rsn_caps {
202 uint16_t PreAuthSupported:1;
203 uint16_t NoPairwise:1;
204 uint16_t PTKSAReplayCounter:2;
205 uint16_t GTKSAReplayCounter:2;
206 uint16_t MFPRequired:1;
207 uint16_t MFPCapable:1;
208 uint16_t Reserved:8;
209};
210
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800211/* / Result codes Firmware return to Host SW */
212typedef enum eSirResultCodes {
213 eSIR_SME_SUCCESS,
Abhishek Singh4294f802017-08-10 16:37:07 +0530214 eSIR_LOGE_EXCEPTION,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800215 eSIR_SME_INVALID_PARAMETERS = 500,
216 eSIR_SME_UNEXPECTED_REQ_RESULT_CODE,
217 eSIR_SME_RESOURCES_UNAVAILABLE,
218 /* Unable to find a BssDescription */
219 eSIR_SME_SCAN_FAILED,
220 /* matching requested scan criteria */
221 eSIR_SME_BSS_ALREADY_STARTED_OR_JOINED,
222 eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE,
223 eSIR_SME_REFUSED,
224 eSIR_SME_JOIN_DEAUTH_FROM_AP_DURING_ADD_STA,
225 eSIR_SME_JOIN_TIMEOUT_RESULT_CODE,
226 eSIR_SME_AUTH_TIMEOUT_RESULT_CODE,
227 eSIR_SME_ASSOC_TIMEOUT_RESULT_CODE,
228 eSIR_SME_REASSOC_TIMEOUT_RESULT_CODE,
229 eSIR_SME_MAX_NUM_OF_PRE_AUTH_REACHED,
230 eSIR_SME_AUTH_REFUSED,
231 eSIR_SME_INVALID_WEP_DEFAULT_KEY,
232 eSIR_SME_NO_KEY_MAPPING_KEY_FOR_PEER,
233 eSIR_SME_ASSOC_REFUSED,
234 eSIR_SME_REASSOC_REFUSED,
235 /* Recvd Deauth while join/pre-auth */
236 eSIR_SME_DEAUTH_WHILE_JOIN,
237 eSIR_SME_STA_NOT_AUTHENTICATED,
238 eSIR_SME_STA_NOT_ASSOCIATED,
239 eSIR_SME_ALREADY_JOINED_A_BSS,
240 /* Given in SME_SCAN_RSP msg */
241 eSIR_SME_MORE_SCAN_RESULTS_FOLLOW,
242 /* that more SME_SCAN_RSP */
243 /* messages are following. */
244 /* SME_SCAN_RSP message with */
245 /* eSIR_SME_SUCCESS status */
246 /* code is the last one. */
247 /* Sent in SME_JOIN/REASSOC_RSP */
248 eSIR_SME_INVALID_ASSOC_RSP_RXED,
249 /* messages upon receiving */
250 /* invalid Re/Assoc Rsp frame. */
251 /* STOP BSS triggered by MIC failures: MAC software to
252 * disassoc all stations
253 */
254 eSIR_SME_MIC_COUNTER_MEASURES,
255 /* with MIC_FAILURE reason code and perform the stop bss operation */
256 /* didn't get rsp from peer within timeout interval */
257 eSIR_SME_ADDTS_RSP_TIMEOUT,
258 /* didn't get success rsp from HAL */
259 eSIR_SME_ADDTS_RSP_FAILED,
260 /* failed to send ch switch act frm */
261 eSIR_SME_CHANNEL_SWITCH_FAIL,
262 eSIR_SME_INVALID_STATE,
263 /* SIR_HAL_SIR_HAL_INIT_SCAN_RSP returned failed status */
264 eSIR_SME_HAL_SCAN_INIT_FAILED,
265 /* SIR_HAL_END_SCAN_RSP returned failed status */
266 eSIR_SME_HAL_SCAN_END_FAILED,
267 /* SIR_HAL_FINISH_SCAN_RSP returned failed status */
268 eSIR_SME_HAL_SCAN_FINISH_FAILED,
269 /* Failed to send a message to HAL */
270 eSIR_SME_HAL_SEND_MESSAGE_FAIL,
271 /* Failed to stop the bss */
272 eSIR_SME_STOP_BSS_FAILURE,
273 eSIR_SME_WOWL_ENTER_REQ_FAILED,
274 eSIR_SME_WOWL_EXIT_REQ_FAILED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800275 eSIR_SME_FT_REASSOC_TIMEOUT_FAILURE,
276 eSIR_SME_FT_REASSOC_FAILURE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800277 eSIR_SME_SEND_ACTION_FAIL,
278 eSIR_SME_DEAUTH_STATUS,
279 eSIR_PNO_SCAN_SUCCESS,
Varun Reddy Yeturu371404b2017-11-30 15:31:35 -0800280 eSIR_SME_INVALID_SESSION,
Varun Reddy Yeturua47f08f2018-08-07 14:45:31 -0700281 eSIR_SME_PEER_CREATE_FAILED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800282 eSIR_DONOT_USE_RESULT_CODE = SIR_MAX_ENUM_SIZE
283} tSirResultCodes;
284
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +0530285#ifdef WLAN_FEATURE_FILS_SK
286struct fils_join_rsp_params {
287 uint8_t *fils_pmk;
288 uint8_t fils_pmk_len;
289 uint8_t fils_pmkid[PMKID_LEN];
290 uint8_t kek[MAX_KEK_LEN];
291 uint8_t kek_len;
292 uint8_t tk[MAX_TK_LEN];
293 uint8_t tk_len;
294 uint8_t gtk_len;
295 uint8_t gtk[MAX_GTK_LEN];
Vignesh Viswanathana1bb0922017-09-15 12:58:48 +0530296 struct qdf_mac_addr dst_mac;
297 struct qdf_mac_addr src_mac;
298 uint16_t hlp_data_len;
299 uint8_t hlp_data[FILS_MAX_HLP_DATA_LEN];
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +0530300};
301#endif
302
Krishna Kumaar Natarajanf599c6e2015-11-03 11:44:03 -0800303#define RMENABLEDCAP_MAX_LEN 5
304
305struct rrm_config_param {
306 uint8_t rrm_enabled;
307 uint8_t max_randn_interval;
308 uint8_t rm_capability[RMENABLEDCAP_MAX_LEN];
309};
310
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800311/*
312 * although in tSirSupportedRates each IE is 16bit but PE only passes IEs in 8
313 * bits with MSB=1 for basic rates. change the mask for bit0-7 only so HAL gets
314 * correct basic rates for setting response rates.
315 */
316#define IERATE_BASICRATE_MASK 0x80
317#define IERATE_RATE_MASK 0x7f
318#define IERATE_IS_BASICRATE(x) ((x) & IERATE_BASICRATE_MASK)
319
Sreelakshmi Konamki39acb132015-12-16 13:06:22 +0530320const char *lim_bss_type_to_string(const uint16_t bss_type);
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700321/**
322 * struct sSirSupportedRates - stores rates/MCS supported
323 * @llbRates: 11b rates in unit of 500kbps
324 * @llaRates: 11a rates in unit of 500kbps
325 * @supportedMCSSet: supported basic MCS, 0-76 bits used, remaining reserved
326 * bits 0-15 and 32 should be set.
327 * @rxHighestDataRate: RX Highest Supported Data Rate defines the highest data
328 * rate that the STA is able to receive, in unites of 1Mbps
329 * This value is derived from "Supported MCS Set field"
330 * inside the HT capability element.
331 * @vhtRxMCSMap: Indicates the Maximum MCS(VHT) that can be received for each
332 * number of spacial streams
333 * @vhtRxHighestDataRate: Indicate the highest VHT data rate that the STA is
334 * able to receive
335 * @vhtTxMCSMap: Indicates the Maximum MCS(VHT) that can be transmitted for
336 * each number of spacial streams
337 * @vhtTxHighestDataRate: Indicate the highest VHT data rate that the STA is
338 * able to transmit
339 * @he_rx_mcs: Indicates the Maximum MCS(HE) that can be received for each
340 * number of spacial streams
341 * @he_tx_mcs: Indicates the Maximum MCS(HE) that can be transmitted for each
342 * number of spacial streams
343 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800344typedef struct sSirSupportedRates {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800345 uint16_t llbRates[SIR_NUM_11B_RATES];
346 uint16_t llaRates[SIR_NUM_11A_RATES];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800347 uint8_t supportedMCSSet[SIR_MAC_MAX_SUPPORTED_MCS_SET];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800348 uint16_t rxHighestDataRate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800349 uint16_t vhtRxMCSMap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800350 uint16_t vhtRxHighestDataRate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800351 uint16_t vhtTxMCSMap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800352 uint16_t vhtTxHighestDataRate;
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700353#ifdef WLAN_FEATURE_11AX
Naveen Rawataeca1b92017-10-16 16:55:31 -0700354 uint16_t rx_he_mcs_map_lt_80;
355 uint16_t tx_he_mcs_map_lt_80;
356 uint16_t rx_he_mcs_map_160;
357 uint16_t tx_he_mcs_map_160;
358 uint16_t rx_he_mcs_map_80_80;
359 uint16_t tx_he_mcs_map_80_80;
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700360#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800361} tSirSupportedRates, *tpSirSupportedRates;
362
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800363typedef struct sSirRemainOnChnReq {
364 uint16_t messageType;
365 uint16_t length;
366 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530367 struct qdf_mac_addr selfMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800368 uint8_t chnNum;
369 uint8_t phyMode;
370 uint32_t duration;
371 uint8_t isProbeRequestAllowed;
372 uint32_t scan_id;
373 uint8_t probeRspIe[1];
374} tSirRemainOnChnReq, *tpSirRemainOnChnReq;
375
376/**
377 * struct sir_roc_rsp - Structure to store the remain on channel response
378 * @message_type: Message Type
379 * @length: Message Length
380 * @session_id: SME session Id
381 * @scan_id : scan identifier
382 * @status: result status
383 */
384struct sir_roc_rsp {
385 uint16_t message_type;
386 uint16_t length;
387 uint8_t session_id;
388 uint32_t scan_id;
389 tSirResultCodes status;
390};
391
392typedef struct sSirRegisterMgmtFrame {
393 uint16_t messageType;
394 uint16_t length;
395 uint8_t sessionId;
396 bool registerFrame;
397 uint16_t frameType;
398 uint16_t matchLen;
399 uint8_t matchData[1];
400} tSirRegisterMgmtFrame, *tpSirRegisterMgmtFrame;
401
402/* / Generic type for sending a response message */
403/* / with result code to host software */
404typedef struct sSirSmeRsp {
405 uint16_t messageType; /* eWNI_SME_*_RSP */
406 uint16_t length;
407 uint8_t sessionId; /* To support BT-AMP */
408 uint16_t transactionId; /* To support BT-AMP */
409 tSirResultCodes statusCode;
Kabilan Kannanf56f9d52017-04-05 03:31:34 -0700410 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800411} tSirSmeRsp, *tpSirSmeRsp;
412
413/* / Definition for indicating all modules ready on STA */
414typedef struct sSirSmeReadyReq {
415 uint16_t messageType; /* eWNI_SME_SYS_READY_IND */
416 uint16_t length;
417 uint16_t transactionId;
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800418 void *csr_roam_synch_cb;
419 void *pe_roam_synch_cb;
Vignesh Viswanathan3d478032018-08-02 20:18:53 +0530420 void *stop_roaming_cb;
Jeff Johnson5f9ce2d2018-06-09 21:20:45 -0700421 QDF_STATUS (*sme_msg_cb)(tpAniSirGlobal mac,
422 struct scheduler_msg *msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800423} tSirSmeReadyReq, *tpSirSmeReadyReq;
424
425/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800426 * struct s_sir_set_hw_mode - Set HW mode request
427 * @messageType: Message type
428 * @length: Length of the message
429 * @set_hw: Params containing the HW mode index and callback
430 */
431struct s_sir_set_hw_mode {
432 uint16_t messageType;
433 uint16_t length;
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -0800434 struct policy_mgr_hw_mode set_hw;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800435};
436
437/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800438 * struct sir_set_dual_mac_cfg - Set Dual mac config request
439 * @message_type: Message type
440 * @length: Length of the message
441 * @set_dual_mac: Params containing the dual mac config and callback
442 */
443struct sir_set_dual_mac_cfg {
444 uint16_t message_type;
445 uint16_t length;
Srinivas Girigowdaeb6ecf32018-02-15 17:04:22 -0800446 struct policy_mgr_dual_mac_config set_dual_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800447};
448
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800449/**
450 * struct sir_antenna_mode_param - antenna mode param
451 * @num_tx_chains: Number of TX chains
452 * @num_rx_chains: Number of RX chains
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800453 * @set_antenna_mode_resp: callback to set antenna mode command
Dundi Raviteja6bb9e322018-05-16 17:04:41 +0530454 * @set_antenna_mode_ctx: callback context to set antenna mode command
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800455 */
456struct sir_antenna_mode_param {
457 uint32_t num_tx_chains;
458 uint32_t num_rx_chains;
459 void *set_antenna_mode_resp;
Dundi Raviteja6bb9e322018-05-16 17:04:41 +0530460 void *set_antenna_mode_ctx;
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800461};
462
463/**
464 * struct sir_set_antenna_mode - Set antenna mode request
465 * @message_type: Message type
466 * @length: Length of the message
467 * @set_antenna_mode: Params containing antenna mode params
468 */
469struct sir_set_antenna_mode {
470 uint16_t message_type;
471 uint16_t length;
472 struct sir_antenna_mode_param set_antenna_mode;
473};
474
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700475/**
476 * enum tSirBssType - Enum for BSS type used in scanning/joining etc.
477 *
478 * @eSIR_INFRASTRUCTURE_MODE: Infrastructure station
479 * @eSIR_INFRA_AP_MODE: softAP mode
480 * @eSIR_IBSS_MODE: IBSS mode
481 * @eSIR_AUTO_MODE: Auto role
482 * @eSIR_MONITOR_MODE: Monitor mode
483 * @eSIR_NDI_MODE: NAN datapath mode
484 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800485typedef enum eSirBssType {
486 eSIR_INFRASTRUCTURE_MODE,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700487 eSIR_INFRA_AP_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800488 eSIR_IBSS_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800489 eSIR_AUTO_MODE,
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -0700490 eSIR_MONITOR_MODE,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700491 eSIR_NDI_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800492 eSIR_DONOT_USE_BSS_TYPE = SIR_MAX_ENUM_SIZE
493} tSirBssType;
494
495/* / Power Capability info used in 11H */
496typedef struct sSirMacPowerCapInfo {
497 uint8_t minTxPower;
498 uint8_t maxTxPower;
499} tSirMacPowerCapInfo, *tpSirMacPowerCapInfo;
500
501/* / Supported Channel info used in 11H */
502typedef struct sSirSupChnl {
503 uint8_t numChnl;
504 uint8_t channelList[SIR_MAX_SUPPORTED_CHANNEL_LIST];
505} tSirSupChnl, *tpSirSupChnl;
506
507typedef enum eSirNwType {
508 eSIR_11A_NW_TYPE,
509 eSIR_11B_NW_TYPE,
510 eSIR_11G_NW_TYPE,
511 eSIR_11N_NW_TYPE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800512 eSIR_11AC_NW_TYPE,
Krishna Kumaar Natarajan4f1d7722017-03-03 21:12:51 -0800513 eSIR_11AX_NW_TYPE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800514 eSIR_DONOT_USE_NW_TYPE = SIR_MAX_ENUM_SIZE
515} tSirNwType;
516
517/* / Definition for new iBss peer info */
518typedef struct sSirNewIbssPeerInfo {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530519 struct qdf_mac_addr peerAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800520 uint16_t aid;
521} tSirNewIbssPeerInfo, *tpSirNewIbssPeerInfo;
522
523/* HT configuration values */
524typedef struct sSirHtConfig {
525 /* Enable/Disable receiving LDPC coded packets */
526 uint32_t ht_rx_ldpc:1;
527 /* Enable/Disable TX STBC */
528 uint32_t ht_tx_stbc:1;
529 /* Enable/Disable RX STBC */
530 uint32_t ht_rx_stbc:2;
531 /* Enable/Disable SGI */
Sandeep Puligilla607f34a2016-05-25 14:37:47 -0700532 uint32_t ht_sgi20:1;
533 uint32_t ht_sgi40:1;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800534 uint32_t unused:27;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530535} qdf_packed tSirHTConfig, *tpSirHTConfig;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800536
Sandeep Puligilla98917432016-06-10 13:50:28 -0700537/**
Jeff Johnson118a4a02018-05-06 00:14:15 -0700538 * struct sir_vht_config - VHT capabilities
Sandeep Puligilla98917432016-06-10 13:50:28 -0700539 * @max_mpdu_len: MPDU length
540 * @supported_channel_widthset: channel width set
541 * @ldpc_coding: LDPC coding capability
542 * @shortgi80: short GI 80 support
543 * @shortgi160and80plus80: short Gi 160 & 80+80 support
544 * @tx_stbc; Tx STBC cap
545 * @tx_stbc: Rx STBC cap
546 * @su_beam_former: SU beam former cap
547 * @su_beam_formee: SU beam formee cap
548 * @csnof_beamformer_antSup: Antenna support for beamforming
549 * @num_soundingdim: Sound dimensions
550 * @mu_beam_former: MU beam former cap
551 * @mu_beam_formee: MU beam formee cap
552 * @vht_txops: TXOP power save
553 * @htc_vhtcap: HTC VHT capability
554 * @max_ampdu_lenexp: AMPDU length
555 * @vht_link_adapt: VHT link adapatation capable
556 * @rx_antpattern: Rx Antenna pattern
557 * @tx_antpattern: Tx Antenna pattern
558 */
559struct sir_vht_config {
560 uint32_t max_mpdu_len:2;
561 uint32_t supported_channel_widthset:2;
562 uint32_t ldpc_coding:1;
563 uint32_t shortgi80:1;
564 uint32_t shortgi160and80plus80:1;
565 uint32_t tx_stbc:1;
566 uint32_t rx_stbc:3;
567 uint32_t su_beam_former:1;
568 uint32_t su_beam_formee:1;
569 uint32_t csnof_beamformer_antSup:3;
570 uint32_t num_soundingdim:3;
571 uint32_t mu_beam_former:1;
572 uint32_t mu_beam_formee:1;
573 uint32_t vht_txops:1;
574 uint32_t htc_vhtcap:1;
575 uint32_t max_ampdu_lenexp:3;
576 uint32_t vht_link_adapt:2;
577 uint32_t rx_antpattern:1;
578 uint32_t tx_antpattern:1;
579 uint32_t unused:2;
580};
581
582
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800583typedef struct sSirAddIeParams {
584 uint16_t probeRespDataLen;
585 uint8_t *probeRespData_buff;
586 uint16_t assocRespDataLen;
587 uint8_t *assocRespData_buff;
588 uint16_t probeRespBCNDataLen;
589 uint8_t *probeRespBCNData_buff;
590} tSirAddIeParams, *tpSirAddIeParams;
591
592/* / Definition for kick starting BSS */
593/* / ---> MAC */
594/**
595 * Usage of ssId, numSSID & ssIdList:
596 * ---------------------------------
597 * 1. ssId.length of zero indicates that Broadcast/Suppress SSID
598 * feature is enabled.
599 * 2. If ssId.length is zero, MAC SW will advertise NULL SSID
600 * and interpret the SSID list from numSSID & ssIdList.
601 * 3. If ssId.length is non-zero, MAC SW will advertise the SSID
602 * specified in the ssId field and it is expected that
603 * application will set numSSID to one (only one SSID present
604 * in the list) and SSID in the list is same as ssId field.
605 * 4. Application will always set numSSID >= 1.
606 */
607/* ***** NOTE: Please make sure all codes are updated if inserting field into
608 * this structure..********** */
609typedef struct sSirSmeStartBssReq {
610 uint16_t messageType; /* eWNI_SME_START_BSS_REQ */
611 uint16_t length;
612 uint8_t sessionId; /* Added for BT-AMP Support */
613 uint16_t transactionId; /* Added for BT-AMP Support */
Anurag Chouhan6d760662016-02-20 16:05:43 +0530614 struct qdf_mac_addr bssid; /* Added for BT-AMP Support */
615 struct qdf_mac_addr self_macaddr; /* Added for BT-AMP Support */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800616 uint16_t beaconInterval; /* Added for BT-AMP Support */
617 uint8_t dot11mode;
618#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
619 uint8_t cc_switch_mode;
620#endif
621 tSirBssType bssType;
622 tSirMacSSid ssId;
623 uint8_t channelId;
624 ePhyChanBondState cbMode;
625 uint8_t vht_channel_width;
626 uint8_t center_freq_seg0;
627 uint8_t center_freq_seg1;
628 uint8_t sec_ch_offset;
629
630 uint8_t privacy;
631 uint8_t apUapsdEnable;
632 uint8_t ssidHidden;
633 bool fwdWPSPBCProbeReq;
634 bool protEnabled;
635 bool obssProtEnabled;
636 uint16_t ht_capab;
637 tAniAuthType authType;
638 uint32_t dtimPeriod;
639 uint8_t wps_state;
640 uint8_t isCoalesingInIBSSAllowed; /* Coalesing on/off knob */
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800641 enum QDF_OPMODE bssPersona;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800642
643 uint8_t txLdpcIniFeatureEnabled;
644
645 tSirRSNie rsnIE; /* RSN IE to be sent in */
646 /* Beacon and Probe */
647 /* Response frames */
648 tSirNwType nwType; /* Indicates 11a/b/g */
649 tSirMacRateSet operationalRateSet; /* Has 11a or 11b rates */
650 tSirMacRateSet extendedRateSet; /* Has 11g rates */
651 tSirHTConfig htConfig;
Sandeep Puligilla98917432016-06-10 13:50:28 -0700652 struct sir_vht_config vht_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800653#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -0700654 tDot11fIEhe_cap he_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800655#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800656#ifdef WLAN_FEATURE_11W
657 bool pmfCapable;
658 bool pmfRequired;
659#endif
660
661 tSirAddIeParams addIeParams;
662
663 bool obssEnabled;
664 uint8_t sap_dot11mc;
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800665 uint16_t beacon_tx_rate;
Kapil Gupta4b2efbb2016-10-03 13:07:20 +0530666 bool vendor_vht_sap;
Arif Hussain671a1902017-03-17 09:08:32 -0700667 uint32_t cac_duration_ms;
668 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800669
670} tSirSmeStartBssReq, *tpSirSmeStartBssReq;
671
672#define GET_IE_LEN_IN_BSS(lenInBss) (lenInBss + sizeof(lenInBss) - \
673 ((uintptr_t)OFFSET_OF(tSirBssDescription,\
674 ieFields)))
675
676#define WSCIE_PROBE_RSP_LEN (317 + 2)
677
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530678#ifdef WLAN_FEATURE_FILS_SK
679/* struct fils_ind_elements: elements parsed from fils indication present
680 * in beacon/probe resp
681 * @realm_cnt: number of realm present
682 * @realm: realms
683 * @is_fils_sk_supported: if FILS SK supported
684 * @is_cache_id_present: if cache id present
685 * @cache_id: cache id
686 */
687struct fils_ind_elements {
688 uint16_t realm_cnt;
689 uint8_t realm[SIR_MAX_REALM_COUNT][SIR_REALM_LEN];
690 bool is_fils_sk_supported;
691 bool is_cache_id_present;
692 uint8_t cache_id[CACHE_ID_LEN];
693};
694#endif
695
Jeff Johnsone58271f2017-10-06 09:58:59 -0700696struct bss_description {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800697 /* offset of the ieFields from bssId. */
698 uint16_t length;
699 tSirMacAddr bssId;
Arun Khandavalli8a711cb2017-01-03 20:23:56 +0530700 unsigned long scansystimensec;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800701 uint32_t timeStamp[2];
702 uint16_t beaconInterval;
703 uint16_t capabilityInfo;
704 tSirNwType nwType; /* Indicates 11a/b/g */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800705 int8_t rssi;
Deepak Dhamdhere68929ec2015-08-05 15:16:35 -0700706 int8_t rssi_raw;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800707 int8_t sinr;
708 /* channelId what peer sent in beacon/probersp. */
709 uint8_t channelId;
710 /* channelId on which we are parked at. */
711 /* used only in scan case. */
712 uint8_t channelIdSelf;
713 uint8_t sSirBssDescriptionRsvd[3];
Deepthi Gowri6acee342016-10-28 15:00:38 +0530714 /* Based on system time, not a relative time. */
715 uint64_t received_time;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800716 uint32_t parentTSF;
717 uint32_t startTSF[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800718 uint8_t mdiePresent;
719 /* MDIE for 11r, picked from the beacons */
720 uint8_t mdie[SIR_MDIE_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800721#ifdef FEATURE_WLAN_ESE
722 uint16_t QBSSLoad_present;
723 uint16_t QBSSLoad_avail;
724 /* To achieve 8-byte alignment with ESE enabled */
725 uint32_t reservedPadding5;
726#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800727 /* whether it is from a probe rsp */
728 uint8_t fProbeRsp;
Deepak Dhamdhere652d7e82015-08-06 14:16:53 -0700729 /* Actual channel the beacon/probe response was received on */
730 uint8_t rx_channel;
Krishna Kumaar Natarajan89a99d42016-08-04 15:44:38 -0700731 tSirMacSeqCtl seq_ctrl;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800732 uint32_t WscIeLen;
733 uint8_t WscIeProbeRsp[WSCIE_PROBE_RSP_LEN];
734 uint8_t reservedPadding4;
735 uint32_t tsf_delta;
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530736#ifdef WLAN_FEATURE_FILS_SK
737 struct fils_ind_elements fils_info_element;
738#endif
739 /* Please keep the structure 4 bytes aligned above the ieFields */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800740 uint32_t ieFields[1];
Jeff Johnsone58271f2017-10-06 09:58:59 -0700741};
742typedef struct bss_description tSirBssDescription, *tpSirBssDescription;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800743
744#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
745typedef struct sSirSmeHTProfile {
746 uint8_t dot11mode;
747 uint8_t htCapability;
748 uint8_t htSupportedChannelWidthSet;
749 uint8_t htRecommendedTxWidthSet;
750 ePhyChanBondState htSecondaryChannelOffset;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800751 uint8_t vhtCapability;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800752 uint8_t apCenterChan;
753 uint8_t apChanWidth;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800754} tSirSmeHTProfile;
755#endif
756/* / Definition for response message to previously */
757/* / issued start BSS request */
758/* / MAC ---> */
759typedef struct sSirSmeStartBssRsp {
760 uint16_t messageType; /* eWNI_SME_START_BSS_RSP */
761 uint16_t length;
762 uint8_t sessionId;
763 uint16_t transactionId; /* transaction ID for cmd */
764 tSirResultCodes statusCode;
765 tSirBssType bssType; /* Add new type for WDS mode */
766 uint16_t beaconInterval; /* Beacon Interval for both type */
Jeff Johnson179fd8a2018-05-11 14:20:05 -0700767 uint32_t staId; /* Station ID for Self */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800768#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
769 tSirSmeHTProfile HTProfile;
770#endif
771 tSirBssDescription bssDescription; /* Peer BSS description */
772} tSirSmeStartBssRsp, *tpSirSmeStartBssRsp;
773
774typedef struct sSirChannelList {
775 uint8_t numChannels;
776 uint8_t channelNumber[SIR_ESE_MAX_MEAS_IE_REQS];
777} tSirChannelList, *tpSirChannelList;
778
779typedef struct sSirDFSChannelList {
780 uint32_t timeStamp[SIR_MAX_24G_5G_CHANNEL_RANGE];
781
782} tSirDFSChannelList, *tpSirDFSChannelList;
783
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800784/* / Two Background Scan mode */
785typedef enum eSirBackgroundScanMode {
786 eSIR_ROAMING_SCAN = 2,
787} tSirBackgroundScanMode;
788
789/* / Two types of traffic check */
790typedef enum eSirLinkTrafficCheck {
791 eSIR_DONT_CHECK_LINK_TRAFFIC_BEFORE_SCAN = 0,
792 eSIR_CHECK_LINK_TRAFFIC_BEFORE_SCAN = 1,
793 eSIR_CHECK_ROAMING_SCAN = 2,
794} tSirLinkTrafficCheck;
795
796#define SIR_BG_SCAN_RETURN_CACHED_RESULTS 0x0
797#define SIR_BG_SCAN_PURGE_RESUTLS 0x80
798#define SIR_BG_SCAN_RETURN_FRESH_RESULTS 0x01
799#define SIR_SCAN_MAX_NUM_SSID 0x0A
800#define SIR_BG_SCAN_RETURN_LFR_CACHED_RESULTS 0x02
801#define SIR_BG_SCAN_PURGE_LFR_RESULTS 0x40
802
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800803typedef struct sSirSmeScanAbortReq {
804 uint16_t type;
805 uint16_t msgLen;
806 uint8_t sessionId;
807 uint32_t scan_id;
808} tSirSmeScanAbortReq, *tpSirSmeScanAbortReq;
809
810typedef struct sSirSmeScanChanReq {
811 uint16_t type;
812 uint16_t msgLen;
813 uint8_t sessionId;
814 uint16_t transcationId;
815} tSirSmeGetScanChanReq, *tpSirSmeGetScanChanReq;
816
817#ifdef FEATURE_OEM_DATA_SUPPORT
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700818struct oem_data_req {
Gupta, Kapil8a605e12016-06-08 14:14:35 +0530819 uint32_t data_len;
Krishna Kumaar Natarajan9ac8efd2015-11-20 13:40:24 -0800820 uint8_t *data;
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700821};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800822
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700823struct oem_data_rsp {
Krishna Kumaar Natarajan608291e2015-12-14 18:17:27 -0800824 uint32_t rsp_len;
Krishna Kumaar Natarajan73ea9f22016-06-30 18:38:47 -0700825 uint8_t *data;
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700826};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800827#endif /* FEATURE_OEM_DATA_SUPPORT */
828
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800829#ifdef FEATURE_WLAN_ESE
yeshwanth sriram guntuka27e4ffc2016-12-01 18:00:17 +0530830typedef struct ese_wmm_tspec_ie {
831 uint16_t traffic_type:1;
832 uint16_t tsid:4;
833 uint16_t direction:2;
834 uint16_t access_policy:2;
835 uint16_t aggregation:1;
836 uint16_t psb:1;
837 uint16_t user_priority:3;
838 uint16_t tsinfo_ack_pol:2;
839 uint8_t tsinfo_rsvd:7;
840 uint8_t burst_size_defn:1;
841 uint16_t size:15;
842 uint16_t fixed:1;
843 uint16_t max_msdu_size;
844 uint32_t min_service_int;
845 uint32_t max_service_int;
846 uint32_t inactivity_int;
847 uint32_t suspension_int;
848 uint32_t service_start_time;
849 uint32_t min_data_rate;
850 uint32_t mean_data_rate;
851 uint32_t peak_data_rate;
852 uint32_t burst_size;
853 uint32_t delay_bound;
854 uint32_t min_phy_rate;
855 uint16_t surplus_bw_allowance;
856 uint16_t medium_time;
857} qdf_packed ese_wmm_tspec_ie;
858
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800859typedef struct sTspecInfo {
860 uint8_t valid;
861 tSirMacTspecIE tspec;
862} tTspecInfo;
863
864#define SIR_ESE_MAX_TSPEC_IES 4
865typedef struct sESETspecTspecInfo {
866 uint8_t numTspecs;
867 tTspecInfo tspec[SIR_ESE_MAX_TSPEC_IES];
868} tESETspecInfo;
869
870typedef struct sSirTsmIE {
871 uint8_t tsid;
872 uint8_t state;
873 uint16_t msmt_interval;
874} tSirTsmIE, *tpSirTsmIE;
875typedef struct sSirSmeTsmIEInd {
876 tSirTsmIE tsmIe;
877 uint8_t sessionId;
878} tSirSmeTsmIEInd, *tpSirSmeTsmIEInd;
879typedef struct sAniTrafStrmMetrics {
880 uint16_t UplinkPktQueueDly;
881 uint16_t UplinkPktQueueDlyHist[4];
882 uint32_t UplinkPktTxDly;
883 uint16_t UplinkPktLoss;
884 uint16_t UplinkPktCount;
885 uint8_t RoamingCount;
886 uint16_t RoamingDly;
887} tAniTrafStrmMetrics, *tpAniTrafStrmMetrics;
888
889typedef struct sAniGetTsmStatsReq {
890 /* Common for all types are requests */
891 uint16_t msgType; /* message type is same as the request type */
892 uint16_t msgLen; /* length of the entire request */
893 uint8_t staId;
894 uint8_t tid; /* traffic id */
895 struct qdf_mac_addr bssId;
896 void *tsmStatsCallback;
897 void *pDevContext; /* device context */
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800898} tAniGetTsmStatsReq, *tpAniGetTsmStatsReq;
899
900typedef struct sAniGetTsmStatsRsp {
901 /* Common for all types are responses */
902 uint16_t msgType; /*
903 * message type is same as
904 * the request type
905 */
906 uint16_t msgLen; /*
907 * length of the entire request,
908 * includes the pStatsBuf length too
909 */
910 uint8_t sessionId;
911 uint32_t rc; /* success/failure */
912 uint32_t staId; /*
913 * Per STA stats request must
914 * contain valid
915 */
916 tAniTrafStrmMetrics tsmMetrics;
917 void *tsmStatsReq; /* tsm stats request backup */
918} tAniGetTsmStatsRsp, *tpAniGetTsmStatsRsp;
919
920typedef struct sSirEseBcnReportBssInfo {
921 tBcnReportFields bcnReportFields;
922 uint8_t ieLen;
923 uint8_t *pBuf;
924} tSirEseBcnReportBssInfo, *tpSirEseBcnReportBssInfo;
925
926typedef struct sSirEseBcnReportRsp {
927 uint16_t measurementToken;
928 uint8_t flag; /* Flag to report measurement done and more data */
929 uint8_t numBss;
930 tSirEseBcnReportBssInfo bcnRepBssInfo[SIR_BCN_REPORT_MAX_BSS_DESC];
931} tSirEseBcnReportRsp, *tpSirEseBcnReportRsp;
932
933#define TSRS_11AG_RATE_6MBPS 0xC
934#define TSRS_11B_RATE_5_5MBPS 0xB
935typedef struct sSirMacESETSRSIE {
936 uint8_t tsid;
937 uint8_t rates[8];
938} tSirMacESETSRSIE;
939typedef struct sSirMacESETSMIE {
940 uint8_t tsid;
941 uint8_t state;
942 uint16_t msmt_interval;
943} tSirMacESETSMIE;
944typedef struct sTSMStats {
945 uint8_t tid;
946 struct qdf_mac_addr bssid;
947 tTrafStrmMetrics tsmMetrics;
948} tTSMStats, *tpTSMStats;
949typedef struct sEseTSMContext {
950 uint8_t tid;
951 tSirMacESETSMIE tsmInfo;
952 tTrafStrmMetrics tsmMetrics;
953} tEseTSMContext, *tpEseTSMContext;
954typedef struct sEsePEContext {
955 tEseTSMContext tsm;
956} tEsePEContext, *tpEsePEContext;
957
958typedef struct sSirPlmReq {
959 uint16_t diag_token; /* Dialog token */
960 uint16_t meas_token; /* measurement token */
961 uint16_t numBursts; /* total number of bursts */
962 uint16_t burstInt; /* burst interval in seconds */
963 uint16_t measDuration; /* in TU's,STA goes off-ch */
964 /* no of times the STA should cycle through PLM ch list */
965 uint8_t burstLen;
966 int8_t desiredTxPwr; /* desired tx power */
967 struct qdf_mac_addr mac_addr; /* MC dest addr */
968 /* no of channels */
969 uint8_t plmNumCh;
970 /* channel numbers */
971 uint8_t plmChList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
972 uint8_t sessionId;
973 bool enable;
974} tSirPlmReq, *tpSirPlmReq;
975
976#endif /* FEATURE_WLAN_ESE */
977
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800978/* / Definition for response message to previously issued scan request */
979typedef struct sSirSmeScanRsp {
980 uint16_t messageType; /* eWNI_SME_SCAN_RSP */
981 uint16_t length;
982 uint8_t sessionId;
983 tSirResultCodes statusCode;
984 uint16_t transcationId;
985 uint32_t scan_id;
986} tSirSmeScanRsp, *tpSirSmeScanRsp;
987
988/* / Definition for join request */
989/* / ---> MAC */
990/* / WARNING! If you add a field in JOIN REQ. */
991/* / Make sure to add it in REASSOC REQ */
992/* / The Serdes function is the same and its */
993/* / shared with REASSOC. So if we add a field */
994/* here and dont add it in REASSOC REQ. It will BREAK!!! REASSOC. */
995typedef struct sSirSmeJoinReq {
996 uint16_t messageType; /* eWNI_SME_JOIN_REQ */
997 uint16_t length;
998 uint8_t sessionId;
999 uint16_t transactionId;
1000 tSirMacSSid ssId;
1001 tSirMacAddr selfMacAddr; /* self Mac address */
1002 tSirBssType bsstype; /* add new type for BT-AMP STA and AP Modules */
1003 uint8_t dot11mode; /* to support BT-AMP */
1004#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
1005 uint8_t cc_switch_mode;
1006#endif
Jeff Johnsonc1e62782017-11-09 09:50:17 -08001007 enum QDF_OPMODE staPersona; /* Persona */
Abhishek Singhf78bd2d2016-04-27 16:47:56 +05301008 bool wps_registration;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001009 ePhyChanBondState cbMode; /* Pass CB mode value in Join. */
1010
1011 /*This contains the UAPSD Flag for all 4 AC
1012 * B0: AC_VO UAPSD FLAG
1013 * B1: AC_VI UAPSD FLAG
1014 * B2: AC_BK UAPSD FLAG
1015 * B3: AC_BE UASPD FLAG
1016 */
1017 uint8_t uapsdPerAcBitmask;
1018
1019 tSirMacRateSet operationalRateSet; /* Has 11a or 11b rates */
1020 tSirMacRateSet extendedRateSet; /* Has 11g rates */
1021 tSirRSNie rsnIE; /* RSN IE to be sent in */
1022 /* (Re) Association Request */
1023#ifdef FEATURE_WLAN_ESE
1024 /* CCMK IE to be included as handler for join and reassoc is */
1025 tSirCCKMie cckmIE;
1026 /* the same. The join will never carry cckm, but will be set to */
1027 /* 0. */
1028#endif
1029
1030 tSirAddie addIEScan; /* Additional IE to be sent in */
1031 /* (unicast) Probe Request at the time of join */
1032
1033 tSirAddie addIEAssoc; /* Additional IE to be sent in */
1034 /* (Re) Association Request */
1035
1036 tAniEdType UCEncryptionType;
1037
1038 tAniEdType MCEncryptionType;
1039
1040#ifdef WLAN_FEATURE_11W
1041 tAniEdType MgmtEncryptionType;
1042#endif
1043
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001044 bool is11Rconnection;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001045#ifdef FEATURE_WLAN_ESE
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001046 bool isESEFeatureIniEnabled;
1047 bool isESEconnection;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001048 tESETspecInfo eseTspecInfo;
1049#endif
1050
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001051 bool isFastTransitionEnabled;
1052 bool isFastRoamIniFeatureEnabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001053
1054 uint8_t txLdpcIniFeatureEnabled;
1055 tSirHTConfig htConfig;
Sandeep Puligilla98917432016-06-10 13:50:28 -07001056 struct sir_vht_config vht_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08001057#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -07001058 tDot11fIEhe_cap he_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08001059#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001060 uint8_t enableVhtpAid;
1061 uint8_t enableVhtGid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001062 uint8_t enableAmpduPs;
1063 uint8_t enableHtSmps;
1064 uint8_t htSmps;
Archana Ramachandranfec24812016-02-16 16:31:56 -08001065 bool send_smps_action;
Kiran Kumar Lokere722dccd2018-02-23 13:23:52 -08001066 bool he_with_wep_tkip;
Deepak Dhamdhere612392c2016-08-28 02:56:51 -07001067 uint8_t max_amsdu_num;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001068 bool isWMEenabled;
1069 bool isQosEnabled;
1070 bool isOSENConnection;
Krishna Kumaar Natarajanf599c6e2015-11-03 11:44:03 -08001071 struct rrm_config_param rrm_config;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001072 bool spectrumMgtIndicator;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001073 tSirMacPowerCapInfo powerCap;
1074 tSirSupChnl supportedChannels;
Selvaraj, Sridhar05ea0792017-05-17 12:17:03 +05301075 bool enable_bcast_probe_rsp;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +05301076#ifdef WLAN_FEATURE_FILS_SK
1077 struct cds_fils_connection_info fils_con_info;
1078#endif
Padma, Santhosh Kumarb8f65d92017-09-14 13:05:42 +05301079 bool sae_pmk_cached;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +05301080 /* Pls make this as last variable in struct */
Abhishek Singhb59f8d42017-07-31 14:42:47 +05301081 bool force_24ghz_in_ht20;
Abhishek Singh6454ad32017-12-20 10:42:21 +05301082 bool force_rsne_override;
Vignesh Viswanathand5a5f2e2018-06-01 15:35:51 +05301083 bool supported_nss_1x1;
1084 uint8_t vdev_nss;
1085 uint8_t nss;
1086 bool nss_forced_1x1;
Arif Hussain6686c0b2018-08-21 18:21:05 -07001087 bool enable_session_twt_support;
Selvaraj, Sridhar81ab80d2017-06-08 12:21:39 +05301088 tSirBssDescription bssDescription;
1089 /*
1090 * WARNING: Pls make bssDescription as last variable in struct
1091 * tSirSmeJoinReq as it has ieFields followed after this bss
1092 * description. Adding a variable after this corrupts the ieFields
1093 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001094} tSirSmeJoinReq, *tpSirSmeJoinReq;
1095
Jeff Johnson47d75242018-05-12 15:58:53 -07001096/* / Definition for response message to previously issued join request */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001097/* / MAC ---> */
1098typedef struct sSirSmeJoinRsp {
1099 uint16_t messageType; /* eWNI_SME_JOIN_RSP */
1100 uint16_t length;
1101 uint8_t sessionId; /* Session ID */
1102 uint16_t transactionId; /* Transaction ID for cmd */
1103 tSirResultCodes statusCode;
1104 tAniAuthType authType;
1105 uint32_t vht_channel_width;
1106 /* It holds reasonCode when join fails due to deauth/disassoc frame.
1107 * Otherwise it holds status code.
1108 */
1109 uint16_t protStatusCode;
1110 uint16_t aid;
1111 uint32_t beaconLength;
1112 uint32_t assocReqLength;
1113 uint32_t assocRspLength;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001114 uint32_t parsedRicRspLen;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001115#ifdef FEATURE_WLAN_ESE
1116 uint32_t tspecIeLen;
1117#endif
1118 uint32_t staId; /* Station ID for peer */
1119
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001120 /*Timing measurement capability */
1121 uint8_t timingMeasCap;
1122
1123#ifdef FEATURE_WLAN_TDLS
1124 /* TDLS prohibited and TDLS channel switch prohibited are set as
1125 * per ExtCap IE in received assoc/re-assoc response from AP
1126 */
1127 bool tdls_prohibited;
1128 bool tdls_chan_swit_prohibited;
1129#endif
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301130 uint8_t nss;
1131 uint32_t max_rate_flags;
1132
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001133#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
1134 tSirSmeHTProfile HTProfile;
1135#endif
Archana Ramachandran20d2e232016-02-11 16:58:40 -08001136 bool supported_nss_1x1;
Anurag Chouhan5de8d172016-07-13 14:44:28 +05301137 tDot11fIEHTCaps ht_caps;
1138 tDot11fIEVHTCaps vht_caps;
1139 tDot11fIEHTInfo ht_operation;
1140 tDot11fIEVHTOperation vht_operation;
1141 tDot11fIEhs20vendor_ie hs20vendor_ie;
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301142 bool is_fils_connection;
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301143 uint16_t fils_seq_num;
Vignesh Viswanathan0b0fa272017-09-18 17:12:04 +05301144#ifdef WLAN_FEATURE_FILS_SK
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301145 struct fils_join_rsp_params *fils_join_rsp;
1146#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001147 uint8_t frames[1];
1148} tSirSmeJoinRsp, *tpSirSmeJoinRsp;
1149
1150/* / probereq from peer, when wsc is enabled */
1151typedef struct sSirSmeProbereq {
1152 uint16_t messageType;
1153 uint16_t length;
1154 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301155 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001156 uint16_t devicePasswdId;
1157} tSirSmeProbeReq, *tpSirSmeProbeReq;
1158
1159typedef struct sSirSmeChanInfo {
1160 uint8_t chan_id;
1161 uint32_t mhz;
1162 uint32_t band_center_freq1;
1163 uint32_t band_center_freq2;
1164 uint32_t info;
1165 uint32_t reg_info_1;
1166 uint32_t reg_info_2;
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301167 uint8_t nss;
1168 uint32_t rate_flags;
Manishekar Chandrasekaranec267592016-05-26 19:10:04 +05301169 uint8_t sec_ch_offset;
1170 enum phy_ch_width ch_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001171} tSirSmeChanInfo, *tpSirSmeChanInfo;
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301172
Will Huang558f8082017-05-31 16:22:24 +08001173enum sir_sme_phy_mode {
1174 SIR_SME_PHY_MODE_LEGACY = 0,
1175 SIR_SME_PHY_MODE_HT = 1,
1176 SIR_SME_PHY_MODE_VHT = 2
1177};
1178
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001179/* / Definition for Association indication from peer */
1180/* / MAC ---> */
1181typedef struct sSirSmeAssocInd {
1182 uint16_t messageType; /* eWNI_SME_ASSOC_IND */
1183 uint16_t length;
1184 uint8_t sessionId;
1185 tSirMacAddr peerMacAddr;
1186 uint16_t aid;
1187 tSirMacAddr bssId; /* Self BSSID */
1188 uint16_t staId; /* Station ID for peer */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001189 tAniAuthType authType;
1190 tAniSSID ssId; /* SSID used by STA to associate */
1191 tSirWAPIie wapiIE; /* WAPI IE received from peer */
1192 tSirRSNie rsnIE; /* RSN IE received from peer */
1193 /* Additional IE received from peer, which possibly include
1194 * WSC IE and/or P2P IE
1195 */
1196 tSirAddie addIE;
1197
1198 /* powerCap & supportedChannels are present only when */
1199 /* spectrumMgtIndicator flag is set */
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001200 bool spectrumMgtIndicator;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001201 tSirMacPowerCapInfo powerCap;
1202 tSirSupChnl supportedChannels;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001203 bool wmmEnabledSta; /* if present - STA is WMM enabled */
1204 bool reassocReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001205 /* Required for indicating the frames to upper layer */
1206 uint32_t beaconLength;
1207 uint8_t *beaconPtr;
1208 uint32_t assocReqLength;
1209 uint8_t *assocReqPtr;
1210
1211 /* Timing measurement capability */
1212 uint8_t timingMeasCap;
1213 tSirSmeChanInfo chan_info;
Will Huang558f8082017-05-31 16:22:24 +08001214 bool ampdu;
1215 bool sgi_enable;
1216 bool tx_stbc;
1217 bool rx_stbc;
1218 tSirMacHTChannelWidth ch_width;
1219 enum sir_sme_phy_mode mode;
1220 uint8_t max_supp_idx;
1221 uint8_t max_ext_idx;
1222 uint8_t max_mcs_idx;
1223 uint8_t rx_mcs_map;
1224 uint8_t tx_mcs_map;
gaolez7bb1e742017-03-21 16:37:38 +08001225 /* Extended CSA capability of station */
1226 uint8_t ecsa_capable;
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +05301227 tDot11fIEHTCaps HTCaps;
1228 tDot11fIEVHTCaps VHTCaps;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001229} tSirSmeAssocInd, *tpSirSmeAssocInd;
1230
1231/* / Definition for Association confirm */
1232/* / ---> MAC */
1233typedef struct sSirSmeAssocCnf {
1234 uint16_t messageType; /* eWNI_SME_ASSOC_CNF */
1235 uint16_t length;
1236 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301237 struct qdf_mac_addr bssid; /* Self BSSID */
1238 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001239 uint16_t aid;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301240 struct qdf_mac_addr alternate_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001241 uint8_t alternateChannelId;
1242} tSirSmeAssocCnf, *tpSirSmeAssocCnf;
1243
1244/* / Enum definition for Wireless medium status change codes */
1245typedef enum eSirSmeStatusChangeCode {
1246 eSIR_SME_DEAUTH_FROM_PEER,
1247 eSIR_SME_DISASSOC_FROM_PEER,
1248 eSIR_SME_LOST_LINK_WITH_PEER,
1249 eSIR_SME_CHANNEL_SWITCH,
1250 eSIR_SME_JOINED_NEW_BSS,
1251 eSIR_SME_LEAVING_BSS,
1252 eSIR_SME_IBSS_ACTIVE,
1253 eSIR_SME_IBSS_INACTIVE,
1254 eSIR_SME_IBSS_PEER_DEPARTED,
1255 eSIR_SME_RADAR_DETECTED,
1256 eSIR_SME_IBSS_NEW_PEER,
1257 eSIR_SME_AP_CAPS_CHANGED,
1258} tSirSmeStatusChangeCode;
1259
1260typedef struct sSirSmeNewBssInfo {
Anurag Chouhan6d760662016-02-20 16:05:43 +05301261 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001262 uint8_t channelNumber;
1263 uint8_t reserved;
1264 tSirMacSSid ssId;
1265} tSirSmeNewBssInfo, *tpSirSmeNewBssInfo;
1266
1267typedef struct sSirSmeApNewCaps {
1268 uint16_t capabilityInfo;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301269 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001270 uint8_t channelId;
1271 uint8_t reserved[3];
1272 tSirMacSSid ssId;
1273} tSirSmeApNewCaps, *tpSirSmeApNewCaps;
1274
1275/**
1276 * Table below indicates what information is passed for each of
1277 * the Wireless Media status change notifications:
1278 *
1279 * Status Change code Status change info
1280 * ----------------------------------------------------------------------
1281 * eSIR_SME_DEAUTH_FROM_PEER Reason code received in DEAUTH frame
1282 * eSIR_SME_DISASSOC_FROM_PEER Reason code received in DISASSOC frame
1283 * eSIR_SME_LOST_LINK_WITH_PEER None
1284 * eSIR_SME_CHANNEL_SWITCH New channel number
1285 * eSIR_SME_JOINED_NEW_BSS BSSID, SSID and channel number
1286 * eSIR_SME_LEAVING_BSS None
1287 * eSIR_SME_IBSS_ACTIVE Indicates that another STA joined
1288 * IBSS apart from this STA that
1289 * started IBSS
1290 * eSIR_SME_IBSS_INACTIVE Indicates that only this STA is left
1291 * in IBSS
1292 * eSIR_SME_RADAR_DETECTED Indicates that radar is detected
1293 * eSIR_SME_IBSS_NEW_PEER Indicates that a new peer is detected
1294 * eSIR_SME_AP_CAPS_CHANGED Indicates that capabilities of the AP
1295 * that STA is currently associated with
1296 * have changed.
1297 */
1298
1299/* / Definition for Wireless medium status change notification */
1300typedef struct sSirSmeWmStatusChangeNtf {
1301 uint16_t messageType; /* eWNI_SME_WM_STATUS_CHANGE_NTF */
1302 uint16_t length;
1303 uint8_t sessionId; /* Session ID */
1304 tSirSmeStatusChangeCode statusChangeCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301305 struct qdf_mac_addr bssid; /* Self BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001306 union {
1307 uint16_t deAuthReasonCode; /* eSIR_SME_DEAUTH_FROM_PEER */
1308 /* eSIR_SME_DISASSOC_FROM_PEER */
1309 uint16_t disassocReasonCode;
1310 /* none for eSIR_SME_LOST_LINK_WITH_PEER */
1311 uint8_t newChannelId; /* eSIR_SME_CHANNEL_SWITCH */
1312 tSirSmeNewBssInfo newBssInfo; /* eSIR_SME_JOINED_NEW_BSS */
1313 /* none for eSIR_SME_LEAVING_BSS */
1314 /* none for eSIR_SME_IBSS_ACTIVE */
1315 /* none for eSIR_SME_IBSS_INACTIVE */
1316 /* eSIR_SME_IBSS_NEW_PEER */
1317 tSirNewIbssPeerInfo newIbssPeerInfo;
1318 tSirSmeApNewCaps apNewCaps; /* eSIR_SME_AP_CAPS_CHANGED */
1319 } statusChangeInfo;
1320} tSirSmeWmStatusChangeNtf, *tpSirSmeWmStatusChangeNtf;
1321
1322/* Definition for Disassociation request */
1323typedef struct sSirSmeDisassocReq {
1324 uint16_t messageType; /* eWNI_SME_DISASSOC_REQ */
1325 uint16_t length;
1326 uint8_t sessionId; /* Session ID */
1327 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301328 struct qdf_mac_addr bssid; /* Peer BSSID */
1329 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001330 uint16_t reasonCode;
1331 /* This flag tells LIM whether to send the disassoc OTA or not */
1332 /* This will be set in while handing off from one AP to other */
1333 uint8_t doNotSendOverTheAir;
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -07001334 bool process_ho_fail;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301335} qdf_packed tSirSmeDisassocReq, *tpSirSmeDisassocReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001336
1337/* / Definition for Tkip countermeasures request */
1338typedef struct sSirSmeTkipCntrMeasReq {
1339 uint16_t messageType; /* eWNI_SME_DISASSOC_REQ */
1340 uint16_t length;
1341 uint8_t sessionId; /* Session ID */
1342 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301343 struct qdf_mac_addr bssId; /* Peer BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001344 bool bEnable; /* Start/stop countermeasures */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301345} qdf_packed tSirSmeTkipCntrMeasReq, *tpSirSmeTkipCntrMeasReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001346
1347typedef struct sAni64BitCounters {
1348 uint32_t Hi;
1349 uint32_t Lo;
1350} tAni64BitCounters, *tpAni64BitCounters;
1351
1352typedef struct sAniSecurityStat {
1353 tAni64BitCounters txBlks;
1354 tAni64BitCounters rxBlks;
1355 tAni64BitCounters formatErrorCnt;
1356 tAni64BitCounters decryptErr;
1357 tAni64BitCounters protExclCnt;
1358 tAni64BitCounters unDecryptableCnt;
1359 tAni64BitCounters decryptOkCnt;
1360
1361} tAniSecurityStat, *tpAniSecurityStat;
1362
1363typedef struct sAniTxRxStats {
1364 tAni64BitCounters txFrames;
1365 tAni64BitCounters rxFrames;
1366 tAni64BitCounters nRcvBytes;
1367 tAni64BitCounters nXmitBytes;
1368
1369} tAniTxRxStats, *tpAniTxRxStats;
1370
1371typedef struct sAniSecStats {
1372 tAniSecurityStat aes;
1373 tAni64BitCounters aesReplays;
1374 tAniSecurityStat tkip;
1375 tAni64BitCounters tkipReplays;
1376 tAni64BitCounters tkipMicError;
1377
1378 tAniSecurityStat wep;
1379#if defined(FEATURE_WLAN_WAPI) && !defined(LIBRA_WAPI_SUPPORT)
1380 tAniSecurityStat wpi;
1381 tAni64BitCounters wpiReplays;
1382 tAni64BitCounters wpiMicError;
1383#endif
1384} tAniSecStats, *tpAniSecStats;
1385
1386#define SIR_MAX_RX_CHAINS 3
1387
1388typedef struct sAniStaStatStruct {
1389 /* following statistic elements till expandPktRxCntLo are not filled
1390 * with valid data. These are kept as it is, since WSM is using this
1391 * structure. These elements can be removed whenever WSM is updated.
1392 * Phystats is used to hold phystats from BD.
1393 */
1394 uint32_t sentAesBlksUcastHi;
1395 uint32_t sentAesBlksUcastLo;
1396 uint32_t recvAesBlksUcastHi;
1397 uint32_t recvAesBlksUcastLo;
1398 uint32_t aesFormatErrorUcastCnts;
1399 uint32_t aesReplaysUcast;
1400 uint32_t aesDecryptErrUcast;
1401 uint32_t singleRetryPkts;
1402 uint32_t failedTxPkts;
1403 uint32_t ackTimeouts;
1404 uint32_t multiRetryPkts;
1405 uint32_t fragTxCntsHi;
1406 uint32_t fragTxCntsLo;
1407 uint32_t transmittedPktsHi;
1408 uint32_t transmittedPktsLo;
1409 uint32_t phyStatHi; /* These are used to fill in the phystats. */
1410 uint32_t phyStatLo; /* This is only for private use. */
1411
1412 uint32_t uplinkRssi;
1413 uint32_t uplinkSinr;
1414 uint32_t uplinkRate;
1415 uint32_t downlinkRssi;
1416 uint32_t downlinkSinr;
1417 uint32_t downlinkRate;
1418 uint32_t nRcvBytes;
1419 uint32_t nXmitBytes;
1420
1421 /*
1422 * Following elements are valid and filled in correctly. They have
1423 * valid values.
1424 */
1425
1426 /* Unicast frames and bytes. */
1427 tAniTxRxStats ucStats;
1428
1429 /* Broadcast frames and bytes. */
1430 tAniTxRxStats bcStats;
1431
1432 /* Multicast frames and bytes. */
1433 tAniTxRxStats mcStats;
1434
1435 uint32_t currentTxRate;
1436 uint32_t currentRxRate; /* Rate in 100Kbps */
1437
1438 uint32_t maxTxRate;
1439 uint32_t maxRxRate;
1440
1441 int8_t rssi[SIR_MAX_RX_CHAINS];
1442
1443 tAniSecStats securityStats;
1444
1445 uint8_t currentRxRateIdx; /* This the softmac rate Index. */
1446 uint8_t currentTxRateIdx;
1447
1448} tAniStaStatStruct, *tpAniStaStatStruct;
1449
1450typedef enum sPacketType {
1451 ePACKET_TYPE_UNKNOWN,
1452 ePACKET_TYPE_11A,
1453 ePACKET_TYPE_11G,
1454 ePACKET_TYPE_11B,
1455 ePACKET_TYPE_11N
1456} tPacketType, *tpPacketType;
1457
1458/* / Definition for Disassociation response */
1459typedef struct sSirSmeDisassocRsp {
1460 uint16_t messageType; /* eWNI_SME_DISASSOC_RSP */
1461 uint16_t length;
1462 uint8_t sessionId; /* Session ID */
1463 uint16_t transactionId; /* Transaction ID for cmd */
1464 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301465 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001466 tAniStaStatStruct perStaStats; /* STA stats */
1467 uint16_t staId;
Srinivas Girigowdaeaf136a2017-06-12 19:03:19 -07001468} tSirSmeDisassocRsp, *tpSirSmeDisassocRsp;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001469
1470/* / Definition for Disassociation indication from peer */
1471typedef struct sSirSmeDisassocInd {
1472 uint16_t messageType; /* eWNI_SME_DISASSOC_IND */
1473 uint16_t length;
1474 uint8_t sessionId; /* Session Identifier */
1475 uint16_t transactionId; /* Transaction Identifier with PE */
1476 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301477 struct qdf_mac_addr bssid;
1478 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001479 tAniStaStatStruct perStaStats; /* STA stats */
1480 uint16_t staId;
1481 uint32_t reasonCode;
1482} tSirSmeDisassocInd, *tpSirSmeDisassocInd;
1483
1484/* / Definition for Disassociation confirm */
1485/* / MAC ---> */
1486typedef struct sSirSmeDisassocCnf {
1487 uint16_t messageType; /* eWNI_SME_DISASSOC_CNF */
1488 uint16_t length;
Vignesh Viswanathanb2dcdd02018-05-24 11:48:12 +05301489 uint8_t sme_session_id;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001490 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301491 struct qdf_mac_addr bssid;
1492 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001493} tSirSmeDisassocCnf, *tpSirSmeDisassocCnf,
1494 tSirSmeDeauthCnf, *tpSirSmeDeauthCnf;
1495
Hanumantha Reddy Pothula3e5d6aa2016-09-08 15:21:54 +05301496/**
1497 * struct sir_sme_discon_done_ind - disconnect done indiaction
1498 * @message_type: msg type
1499 * @length: length of msg
1500 * @session_id: session id of the indication
1501 * @reason_code: reason for disconnect indication
1502 * @peer_mac: peer mac
1503 */
1504struct sir_sme_discon_done_ind {
1505 uint16_t message_type;
1506 uint16_t length;
1507 uint8_t session_id;
1508 tSirResultCodes reason_code;
1509 tSirMacAddr peer_mac;
1510};
1511
1512
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001513/* / Definition for Deauthetication request */
1514typedef struct sSirSmeDeauthReq {
1515 uint16_t messageType; /* eWNI_SME_DEAUTH_REQ */
1516 uint16_t length;
1517 uint8_t sessionId; /* Session ID */
1518 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301519 struct qdf_mac_addr bssid; /* AP BSSID */
1520 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001521 uint16_t reasonCode;
1522} tSirSmeDeauthReq, *tpSirSmeDeauthReq;
1523
1524/* / Definition for Deauthetication response */
1525typedef struct sSirSmeDeauthRsp {
1526 uint16_t messageType; /* eWNI_SME_DEAUTH_RSP */
1527 uint16_t length;
1528 uint8_t sessionId; /* Session ID */
1529 uint16_t transactionId; /* Transaction ID for cmd */
1530 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301531 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001532} tSirSmeDeauthRsp, *tpSirSmeDeauthRsp;
1533
1534/* / Definition for Deauthetication indication from peer */
1535typedef struct sSirSmeDeauthInd {
1536 uint16_t messageType; /* eWNI_SME_DEAUTH_IND */
1537 uint16_t length;
1538 uint8_t sessionId; /* Added for BT-AMP */
1539 uint16_t transactionId; /* Added for BT-AMP */
1540 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301541 struct qdf_mac_addr bssid; /* AP BSSID */
1542 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001543
1544 uint16_t staId;
1545 uint32_t reasonCode;
Kiran Kumar Lokere37d3aa22015-11-03 14:58:26 -08001546 int8_t rssi;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001547} tSirSmeDeauthInd, *tpSirSmeDeauthInd;
1548
1549/* / Definition for stop BSS request message */
1550typedef struct sSirSmeStopBssReq {
1551 uint16_t messageType; /* eWNI_SME_STOP_BSS_REQ */
1552 uint16_t length;
1553 uint8_t sessionId; /* Session ID */
1554 uint16_t transactionId; /* tranSaction ID for cmd */
1555 tSirResultCodes reasonCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301556 struct qdf_mac_addr bssid; /* Self BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001557} tSirSmeStopBssReq, *tpSirSmeStopBssReq;
1558
1559/* / Definition for stop BSS response message */
1560typedef struct sSirSmeStopBssRsp {
1561 uint16_t messageType; /* eWNI_SME_STOP_BSS_RSP */
1562 uint16_t length;
1563 tSirResultCodes statusCode;
1564 uint8_t sessionId; /* Session ID */
1565 uint16_t transactionId; /* Transaction ID for cmd */
1566} tSirSmeStopBssRsp, *tpSirSmeStopBssRsp;
1567
1568/* / Definition for Channel Switch indication for station */
1569/* / MAC ---> */
1570typedef struct sSirSmeSwitchChannelInd {
1571 uint16_t messageType; /* eWNI_SME_SWITCH_CHL_IND */
1572 uint16_t length;
1573 uint8_t sessionId;
1574 uint16_t newChannelId;
Amar Singhal5cccafe2017-02-15 12:42:58 -08001575 struct ch_params chan_params;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301576 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001577} tSirSmeSwitchChannelInd, *tpSirSmeSwitchChannelInd;
1578
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001579/* / Definition for MIC failure indication */
1580/* / MAC ---> */
1581/* / MAC reports this each time a MIC failure occures on Rx TKIP packet */
1582typedef struct sSirSmeMicFailureInd {
1583 uint16_t messageType; /* eWNI_SME_MIC_FAILURE_IND */
1584 uint16_t length;
1585 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301586 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001587 tSirMicFailureInfo info;
1588} tSirSmeMicFailureInd, *tpSirSmeMicFailureInd;
1589
1590typedef struct sSirSmeMissedBeaconInd {
1591 uint16_t messageType; /* eWNI_SME_MISSED_BEACON_IND */
1592 uint16_t length;
1593 uint8_t bssIdx;
1594} tSirSmeMissedBeaconInd, *tpSirSmeMissedBeaconInd;
1595
1596/* / Definition for Set Context request */
1597/* / ---> MAC */
1598typedef struct sSirSmeSetContextReq {
1599 uint16_t messageType; /* eWNI_SME_SET_CONTEXT_REQ */
1600 uint16_t length;
1601 uint8_t sessionId; /* Session ID */
1602 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301603 struct qdf_mac_addr peer_macaddr;
1604 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001605 tSirKeyMaterial keyMaterial;
1606} tSirSmeSetContextReq, *tpSirSmeSetContextReq;
1607
1608/* / Definition for Set Context response */
1609/* / MAC ---> */
1610typedef struct sSirSmeSetContextRsp {
1611 uint16_t messageType; /* eWNI_SME_SET_CONTEXT_RSP */
1612 uint16_t length;
1613 uint8_t sessionId; /* Session ID */
1614 uint16_t transactionId; /* Transaction ID for cmd */
1615 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301616 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001617} tSirSmeSetContextRsp, *tpSirSmeSetContextRsp;
1618
1619/* / Statistic definitions */
1620/* ============================================================= */
1621/* Per STA statistic structure; This same struct will be used for Aggregate */
1622/* STA stats as well. */
1623
1624/* Clear radio stats and clear per sta stats */
1625typedef enum {
1626 eANI_CLEAR_ALL_STATS, /* Clears all stats */
1627 eANI_CLEAR_RX_STATS, /* Clears RX stats of the radio interface */
1628 eANI_CLEAR_TX_STATS, /* Clears TX stats of the radio interface */
1629 eANI_CLEAR_RADIO_STATS, /* Clears all the radio stats */
1630 eANI_CLEAR_PER_STA_STATS, /* Clears Per STA stats */
1631 eANI_CLEAR_AGGR_PER_STA_STATS, /* Clears aggregate stats */
1632
1633 /* Used to distinguish between per sta to security stats. */
1634 /* Used only by AP, FW just returns the same param as it received. */
1635 eANI_LINK_STATS, /* Get Per STA stats */
1636 eANI_SECURITY_STATS, /* Get Per STA security stats */
1637
1638 eANI_CLEAR_STAT_TYPES_END
1639} tAniStatSubTypes;
1640
1641typedef struct sAniTxCtrs {
1642 /* add the rate counters here */
1643 uint32_t tx1Mbps;
1644 uint32_t tx2Mbps;
1645 uint32_t tx5_5Mbps;
1646 uint32_t tx6Mbps;
1647 uint32_t tx9Mbps;
1648 uint32_t tx11Mbps;
1649 uint32_t tx12Mbps;
1650 uint32_t tx18Mbps;
1651 uint32_t tx24Mbps;
1652 uint32_t tx36Mbps;
1653 uint32_t tx48Mbps;
1654 uint32_t tx54Mbps;
1655 uint32_t tx72Mbps;
1656 uint32_t tx96Mbps;
1657 uint32_t tx108Mbps;
1658
1659 /* tx path radio counts */
1660 uint32_t txFragHi;
1661 uint32_t txFragLo;
1662 uint32_t txFrameHi;
1663 uint32_t txFrameLo;
1664 uint32_t txMulticastFrameHi;
1665 uint32_t txMulticastFrameLo;
1666 uint32_t txFailedHi;
1667 uint32_t txFailedLo;
1668 uint32_t multipleRetryHi;
1669 uint32_t multipleRetryLo;
1670 uint32_t singleRetryHi;
1671 uint32_t singleRetryLo;
1672 uint32_t ackFailureHi;
1673 uint32_t ackFailureLo;
1674 uint32_t xmitBeacons;
1675} tAniTxCtrs, *tpAniTxCtrs;
1676
1677typedef struct sAniRxCtrs {
1678 /* receive frame rate counters */
1679 uint32_t rx1Mbps;
1680 uint32_t rx2Mbps;
1681 uint32_t rx5_5Mbps;
1682 uint32_t rx6Mbps;
1683 uint32_t rx9Mbps;
1684 uint32_t rx11Mbps;
1685 uint32_t rx12Mbps;
1686 uint32_t rx18Mbps;
1687 uint32_t rx24Mbps;
1688 uint32_t rx36Mbps;
1689 uint32_t rx48Mbps;
1690 uint32_t rx54Mbps;
1691 uint32_t rx72Mbps;
1692 uint32_t rx96Mbps;
1693 uint32_t rx108Mbps;
1694
1695 /* receive size counters; 'Lte' = Less than or equal to */
1696 uint32_t rxLte64;
1697 uint32_t rxLte128Gt64;
1698 uint32_t rxLte256Gt128;
1699 uint32_t rxLte512Gt256;
1700 uint32_t rxLte1kGt512;
1701 uint32_t rxLte1518Gt1k;
1702 uint32_t rxLte2kGt1518;
1703 uint32_t rxLte4kGt2k;
1704
1705 /* rx radio stats */
1706 uint32_t rxFrag;
1707 uint32_t rxFrame;
1708 uint32_t fcsError;
1709 uint32_t rxMulticast;
1710 uint32_t duplicate;
1711 uint32_t rtsSuccess;
1712 uint32_t rtsFailed;
1713 uint32_t wepUndecryptables;
1714 uint32_t drops;
1715 uint32_t aesFormatErrorUcastCnts;
1716 uint32_t aesReplaysUcast;
1717 uint32_t aesDecryptErrUcast;
1718} tAniRxCtrs, *tpAniRxCtrs;
1719
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001720/* *************************************************************** */
1721
1722/*******************PE Statistics*************************/
1723
1724/*
1725 * tpAniGetPEStatsReq is tied to
1726 * for SME ==> PE eWNI_SME_GET_STATISTICS_REQ msgId and
1727 * for PE ==> HAL SIR_HAL_GET_STATISTICS_REQ msgId
1728 */
1729typedef struct sAniGetPEStatsReq {
1730 /* Common for all types are requests */
1731 uint16_t msgType; /* message type is same as the request type */
1732 uint16_t msgLen; /* length of the entire request */
1733 uint32_t staId; /* Per STA stats request must contain valid */
1734 /* categories of stats requested. look at ePEStatsMask */
1735 uint32_t statsMask;
1736 uint8_t sessionId;
1737} tAniGetPEStatsReq, *tpAniGetPEStatsReq;
1738
1739/*
1740 * tpAniGetPEStatsRsp is tied to
1741 * for PE ==> SME eWNI_SME_GET_STATISTICS_RSP msgId and
1742 * for HAL ==> PE SIR_HAL_GET_STATISTICS_RSP msgId
1743 */
1744typedef struct sAniGetPEStatsRsp {
1745 /* Common for all types are responses */
1746 uint16_t msgType; /* message type is same as the request type */
1747 /* length of the entire request, includes the pStatsBuf length too */
1748 uint16_t msgLen;
1749 uint8_t sessionId;
1750 uint32_t rc; /* success/failure */
1751 uint32_t staId; /* Per STA stats request must contain valid */
1752 /* categories of stats requested. look at ePEStatsMask */
1753 uint32_t statsMask;
1754 /* void *pStatsBuf; */
1755 /*
1756 * The Stats buffer starts here and can be an aggregate of more than one
1757 * statistics structure depending on statsMask. The void pointer
1758 * "pStatsBuf" is commented out intentionally and the src code that uses
1759 * this structure should take that into account.
1760 */
1761} tAniGetPEStatsRsp, *tpAniGetPEStatsRsp;
1762
1763typedef struct sAniGetRssiReq {
1764 /* Common for all types are requests */
1765 uint16_t msgType; /* message type is same as the request type */
1766 uint16_t msgLen; /* length of the entire request */
1767 uint8_t sessionId;
1768 uint8_t staId;
1769 int8_t lastRSSI; /* in case of error, return last RSSI */
1770 void *rssiCallback;
1771 void *pDevContext; /* device context */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001772} tAniGetRssiReq, *tpAniGetRssiReq;
1773
1774typedef struct sAniGetSnrReq {
1775 /* Common for all types are requests */
1776 uint16_t msgType; /* message type is same as the request type */
1777 uint16_t msgLen; /* length of the entire request */
1778 uint8_t sessionId;
1779 uint8_t staId;
1780 void *snrCallback;
1781 void *pDevContext; /* device context */
1782 int8_t snr;
1783} tAniGetSnrReq, *tpAniGetSnrReq;
1784
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001785/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001786 * struct ani_roc_req - Remain on channel request
1787 * @msg_type: Message type
1788 * @msg_len: Message Length
1789 * @session_id: SME session Id
1790 * @channel: channel number
1791 * @callback: call back function for scan result
1792 * @duration: Roc duration
1793 * @is_p2pprobe_allowed : flag for p2p probe request
1794 * @ctx: Global context
1795 * @scan_id: Scan Identifier
1796 *
1797 * Remain on channel request message structure
1798 */
1799struct ani_roc_req {
1800 /* message type is same as the request type */
1801 uint16_t msg_type;
1802 /* length of the entire request */
1803 uint16_t msg_len;
1804 uint16_t session_id;
1805 uint8_t channel;
1806 uint32_t duration;
1807 uint8_t is_p2pprobe_allowed;
1808 void *callback;
1809 void *ctx;
1810 uint32_t scan_id;
1811};
1812
1813/* generic country code change request MSG structure */
1814typedef struct sAniGenericChangeCountryCodeReq {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001815 uint16_t msgType; /* message type is same as the request type */
1816 uint16_t msgLen; /* length of the entire request */
1817 uint8_t countryCode[WNI_CFG_COUNTRY_CODE_LEN]; /* 3 char country code */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001818} tAniGenericChangeCountryCodeReq, *tpAniGenericChangeCountryCodeReq;
1819
Srinivas Girigowda296105a2015-09-24 16:31:16 -07001820/**
1821 * struct sAniDHCPStopInd - DHCP Stop indication message
1822 * @msgType: message type is same as the request type
1823 * @msgLen: length of the entire request
1824 * @device_mode: Mode of the device(ex:STA, AP)
1825 * @adapterMacAddr: MAC address of the adapter
1826 * @peerMacAddr: MAC address of the connected peer
1827 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001828typedef struct sAniDHCPStopInd {
Srinivas Girigowda296105a2015-09-24 16:31:16 -07001829 uint16_t msgType;
1830 uint16_t msgLen;
1831 uint8_t device_mode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301832 struct qdf_mac_addr adapterMacAddr;
1833 struct qdf_mac_addr peerMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001834} tAniDHCPInd, *tpAniDHCPInd;
1835
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001836typedef struct sAniTXFailMonitorInd {
1837 uint16_t msgType; /* message type is same as the request type */
1838 uint16_t msgLen; /* length of the entire request */
1839 uint8_t tx_fail_count;
1840 void *txFailIndCallback;
1841} tAniTXFailMonitorInd, *tpAniTXFailMonitorInd;
1842
Naveen Rawatea1564b2018-05-17 15:56:11 -07001843#ifndef QCA_SUPPORT_CP_STATS
1844/**
1845 * enum tx_rate_info - tx_rate flags
1846 * @TX_RATE_LEGACY: Legacy rates
1847 * @TX_RATE_HT20: HT20 rates
1848 * @TX_RATE_HT40: HT40 rates
1849 * @TX_RATE_SGI: Rate with Short guard interval
1850 * @TX_RATE_LGI: Rate with Long guard interval
1851 * @TX_RATE_VHT20: VHT 20 rates
1852 * @TX_RATE_VHT40: VHT 40 rates
1853 * @TX_RATE_VHT80: VHT 80 rates
1854 */
1855enum tx_rate_info {
1856 TX_RATE_LEGACY = 0x1,
1857 TX_RATE_HT20 = 0x2,
1858 TX_RATE_HT40 = 0x4,
1859 TX_RATE_SGI = 0x8,
1860 TX_RATE_LGI = 0x10,
1861 TX_RATE_VHT20 = 0x20,
1862 TX_RATE_VHT40 = 0x40,
1863 TX_RATE_VHT80 = 0x80
1864};
1865#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001866/**********************PE Statistics end*************************/
1867
1868typedef struct sSirP2PNoaStart {
1869 uint32_t status;
1870 uint32_t bssIdx;
1871} tSirP2PNoaStart, *tpSirP2PNoaStart;
1872
1873typedef struct sSirTdlsInd {
1874 uint16_t status;
1875 uint16_t assocId;
1876 uint16_t staIdx;
1877 uint16_t reasonCode;
1878} tSirTdlsInd, *tpSirTdlsInd;
1879
1880typedef struct sSirP2PNoaAttr {
1881#ifdef ANI_BIG_BYTE_ENDIAN
1882 uint32_t index:8;
1883 uint32_t oppPsFlag:1;
1884 uint32_t ctWin:7;
1885 uint32_t rsvd1:16;
1886#else
1887 uint32_t rsvd1:16;
1888 uint32_t ctWin:7;
1889 uint32_t oppPsFlag:1;
1890 uint32_t index:8;
1891#endif
1892
1893#ifdef ANI_BIG_BYTE_ENDIAN
1894 uint32_t uNoa1IntervalCnt:8;
1895 uint32_t rsvd2:24;
1896#else
1897 uint32_t rsvd2:24;
1898 uint32_t uNoa1IntervalCnt:8;
1899#endif
1900 uint32_t uNoa1Duration;
1901 uint32_t uNoa1Interval;
1902 uint32_t uNoa1StartTime;
1903
1904#ifdef ANI_BIG_BYTE_ENDIAN
1905 uint32_t uNoa2IntervalCnt:8;
1906 uint32_t rsvd3:24;
1907#else
1908 uint32_t rsvd3:24;
1909 uint32_t uNoa2IntervalCnt:8;
1910#endif
1911 uint32_t uNoa2Duration;
1912 uint32_t uNoa2Interval;
1913 uint32_t uNoa2StartTime;
1914} tSirP2PNoaAttr, *tpSirP2PNoaAttr;
1915
1916typedef struct sSirTclasInfo {
1917 tSirMacTclasIE tclas;
1918 uint8_t version; /* applies only for classifier type ip */
1919 union {
1920 tSirMacTclasParamEthernet eth;
1921 tSirMacTclasParamIPv4 ipv4;
1922 tSirMacTclasParamIPv6 ipv6;
1923 tSirMacTclasParam8021dq t8021dq;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301924 } qdf_packed tclasParams;
1925} qdf_packed tSirTclasInfo;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001926
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001927typedef struct sSirAddtsReqInfo {
1928 uint8_t dialogToken;
1929 tSirMacTspecIE tspec;
1930
1931 uint8_t numTclas; /* number of Tclas elements */
1932 tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM];
1933 uint8_t tclasProc;
1934#if defined(FEATURE_WLAN_ESE)
1935 tSirMacESETSRSIE tsrsIE;
1936 uint8_t tsrsPresent:1;
1937#endif
1938 uint8_t wmeTspecPresent:1;
1939 uint8_t wsmTspecPresent:1;
1940 uint8_t lleTspecPresent:1;
1941 uint8_t tclasProcPresent:1;
1942} tSirAddtsReqInfo, *tpSirAddtsReqInfo;
1943
1944typedef struct sSirAddtsRspInfo {
1945 uint8_t dialogToken;
1946 tSirMacStatusCodes status;
1947 tSirMacTsDelayIE delay;
1948
1949 tSirMacTspecIE tspec;
1950 uint8_t numTclas; /* number of Tclas elements */
1951 tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM];
1952 uint8_t tclasProc;
1953 tSirMacScheduleIE schedule;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001954#ifdef FEATURE_WLAN_ESE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001955 tSirMacESETSMIE tsmIE;
1956 uint8_t tsmPresent:1;
1957#endif
1958 uint8_t wmeTspecPresent:1;
1959 uint8_t wsmTspecPresent:1;
1960 uint8_t lleTspecPresent:1;
1961 uint8_t tclasProcPresent:1;
1962 uint8_t schedulePresent:1;
1963} tSirAddtsRspInfo, *tpSirAddtsRspInfo;
1964
1965typedef struct sSirDeltsReqInfo {
1966 tSirMacTSInfo tsinfo;
1967 tSirMacTspecIE tspec;
1968 uint8_t wmeTspecPresent:1;
1969 uint8_t wsmTspecPresent:1;
1970 uint8_t lleTspecPresent:1;
1971} tSirDeltsReqInfo, *tpSirDeltsReqInfo;
1972
1973/* / Add a tspec as defined */
1974typedef struct sSirAddtsReq {
1975 uint16_t messageType; /* eWNI_SME_ADDTS_REQ */
1976 uint16_t length;
1977 uint8_t sessionId; /* Session ID */
1978 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301979 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001980 uint32_t timeout; /* in ms */
1981 uint8_t rspReqd;
1982 tSirAddtsReqInfo req;
1983} tSirAddtsReq, *tpSirAddtsReq;
1984
1985typedef struct sSirAddtsRsp {
1986 uint16_t messageType; /* eWNI_SME_ADDTS_RSP */
1987 uint16_t length;
1988 uint8_t sessionId; /* sme sessionId Added for BT-AMP support */
1989 uint16_t transactionId; /* sme transaction Id - for BT-AMP Support */
1990 uint32_t rc; /* return code */
1991 tSirAddtsRspInfo rsp;
1992} tSirAddtsRsp, *tpSirAddtsRsp;
1993
1994typedef struct sSirDeltsReq {
1995 uint16_t messageType; /* eWNI_SME_DELTS_REQ */
1996 uint16_t length;
1997 uint8_t sessionId; /* Session ID */
1998 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301999 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002000 uint16_t aid; /* use 0 if macAddr is being specified */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302001 struct qdf_mac_addr macaddr; /* only on AP to specify the STA */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002002 uint8_t rspReqd;
2003 tSirDeltsReqInfo req;
2004} tSirDeltsReq, *tpSirDeltsReq;
2005
2006typedef struct sSirDeltsRsp {
2007 uint16_t messageType; /* eWNI_SME_DELTS_RSP */
2008 uint16_t length;
2009 uint8_t sessionId; /* sme sessionId Added for BT-AMP support */
2010 uint16_t transactionId; /* sme transaction Id - for BT-AMP Support */
2011 uint32_t rc;
2012 uint16_t aid; /* use 0 if macAddr is being specified */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302013 struct qdf_mac_addr macaddr; /* only on AP to specify the STA */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002014 tSirDeltsReqInfo rsp;
2015} tSirDeltsRsp, *tpSirDeltsRsp;
2016
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002017#define SIR_QOS_NUM_AC_MAX 4
2018
2019typedef struct sSirAggrQosReqInfo {
2020 uint16_t tspecIdx;
2021 tSirAddtsReqInfo aggrAddTsInfo[SIR_QOS_NUM_AC_MAX];
2022} tSirAggrQosReqInfo, *tpSirAggrQosReqInfo;
2023
2024typedef struct sSirAggrQosReq {
2025 uint16_t messageType; /* eWNI_SME_ADDTS_REQ */
2026 uint16_t length;
2027 uint8_t sessionId; /* Session ID */
2028 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302029 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002030 uint32_t timeout; /* in ms */
2031 uint8_t rspReqd;
2032 tSirAggrQosReqInfo aggrInfo;
2033} tSirAggrQosReq, *tpSirAggrQosReq;
2034
2035typedef struct sSirAggrQosRspInfo {
2036 uint16_t tspecIdx;
2037 tSirAddtsRspInfo aggrRsp[SIR_QOS_NUM_AC_MAX];
2038} tSirAggrQosRspInfo, *tpSirAggrQosRspInfo;
2039
2040typedef struct sSirAggrQosRsp {
2041 uint16_t messageType;
2042 uint16_t length;
2043 uint8_t sessionId;
2044 tSirAggrQosRspInfo aggrInfo;
2045} tSirAggrQosRsp, *tpSirAggrQosRsp;
2046
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002047
2048typedef struct sSirQosMapSet {
2049 uint8_t present;
2050 uint8_t num_dscp_exceptions;
2051 uint8_t dscp_exceptions[21][2];
2052 uint8_t dscp_range[8][2];
2053} tSirQosMapSet, *tpSirQosMapSet;
2054
2055typedef struct sSmeIbssPeerInd {
2056 uint16_t mesgType;
2057 uint16_t mesgLen;
2058 uint8_t sessionId;
2059
Anurag Chouhan6d760662016-02-20 16:05:43 +05302060 struct qdf_mac_addr peer_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002061 uint16_t staId;
2062
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002063 /* Beacon will be appended for new Peer indication. */
2064} tSmeIbssPeerInd, *tpSmeIbssPeerInd;
2065
2066typedef struct sSirIbssPeerInactivityInd {
2067 uint8_t bssIdx;
2068 uint8_t staIdx;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302069 struct qdf_mac_addr peer_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002070} tSirIbssPeerInactivityInd, *tpSirIbssPeerInactivityInd;
2071
2072typedef struct sLimScanChn {
2073 uint16_t numTimeScan; /* how many time this channel is scan */
2074 uint8_t channelId;
2075} tLimScanChn;
2076
gaoleze5108942017-03-31 16:56:42 +08002077/**
2078 * struct lim_channel_status
2079 * @channelfreq: Channel freq
2080 * @noise_floor: Noise Floor value
2081 * @rx_clear_count: rx clear count
2082 * @cycle_count: cycle count
2083 * @chan_tx_pwr_range: channel tx power per range in 0.5dBm steps
2084 * @chan_tx_pwr_throughput: channel tx power per throughput
2085 * @rx_frame_count: rx frame count (cumulative)
2086 * @bss_rx_cycle_count: BSS rx cycle count
2087 * @rx_11b_mode_data_duration: b-mode data rx time (units are microseconds)
2088 * @tx_frame_count: BSS tx cycle count
2089 * @mac_clk_mhz: sample frequency
2090 * @channel_id: channel index
2091 * @cmd_flags: indicate which stat event is this status coming from
2092 */
2093struct lim_channel_status {
2094 uint32_t channelfreq;
2095 uint32_t noise_floor;
2096 uint32_t rx_clear_count;
2097 uint32_t cycle_count;
2098 uint32_t chan_tx_pwr_range;
2099 uint32_t chan_tx_pwr_throughput;
2100 uint32_t rx_frame_count;
2101 uint32_t bss_rx_cycle_count;
2102 uint32_t rx_11b_mode_data_duration;
2103 uint32_t tx_frame_count;
2104 uint32_t mac_clk_mhz;
2105 uint32_t channel_id;
2106 uint32_t cmd_flags;
2107};
2108
2109/**
2110 * struct lim_scan_channel_status
2111 * @total_channel: total number of be scanned channel
2112 * @channel_status_list: channel status info store in this array
2113 */
2114struct lim_scan_channel_status {
2115 uint8_t total_channel;
2116 struct lim_channel_status
2117 channel_status_list[SIR_MAX_SUPPORTED_CHANNEL_LIST];
2118};
2119
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002120typedef struct sSmeGetScanChnRsp {
2121 /* Message Type */
2122 uint16_t mesgType;
2123 /* Message Length */
2124 uint16_t mesgLen;
2125 uint8_t sessionId;
2126 uint8_t numChn;
2127 tLimScanChn scanChn[1];
2128} tSmeGetScanChnRsp, *tpSmeGetScanChnRsp;
2129
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002130typedef struct sSirSmeGetAssocSTAsReq {
2131 uint16_t messageType; /* eWNI_SME_GET_ASSOC_STAS_REQ */
2132 uint16_t length;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302133 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002134 uint16_t modId;
2135 void *pUsrContext;
2136 void *pSapEventCallback;
2137 /* Pointer to allocated mem passed in wlansap_get_assoc_stations API */
2138 void *pAssocStasArray;
2139} tSirSmeGetAssocSTAsReq, *tpSirSmeGetAssocSTAsReq;
2140
2141typedef struct sSmeMaxAssocInd {
2142 uint16_t mesgType; /* eWNI_SME_MAX_ASSOC_EXCEEDED */
2143 uint16_t mesgLen;
2144 uint8_t sessionId;
2145 /* the new peer that got rejected max assoc limit reached */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302146 struct qdf_mac_addr peer_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002147} tSmeMaxAssocInd, *tpSmeMaxAssocInd;
2148
2149typedef struct sSmeCsaOffloadInd {
2150 uint16_t mesgType; /* eWNI_SME_CSA_OFFLOAD_EVENT */
2151 uint16_t mesgLen;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302152 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002153} tSmeCsaOffloadInd, *tpSmeCsaOffloadInd;
2154
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002155#define SIR_MAX_NAME_SIZE 64
2156#define SIR_MAX_TEXT_SIZE 32
2157
2158typedef struct sSirName {
2159 uint8_t num_name;
2160 uint8_t name[SIR_MAX_NAME_SIZE];
2161} tSirName;
2162
2163typedef struct sSirText {
2164 uint8_t num_text;
2165 uint8_t text[SIR_MAX_TEXT_SIZE];
2166} tSirText;
2167
2168#define SIR_WPS_PROBRSP_VER_PRESENT 0x00000001
2169#define SIR_WPS_PROBRSP_STATE_PRESENT 0x00000002
2170#define SIR_WPS_PROBRSP_APSETUPLOCK_PRESENT 0x00000004
2171#define SIR_WPS_PROBRSP_SELECTEDREGISTRA_PRESENT 0x00000008
2172#define SIR_WPS_PROBRSP_DEVICEPASSWORDID_PRESENT 0x00000010
2173#define SIR_WPS_PROBRSP_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020
2174#define SIR_WPS_PROBRSP_RESPONSETYPE_PRESENT 0x00000040
2175#define SIR_WPS_PROBRSP_UUIDE_PRESENT 0x00000080
2176#define SIR_WPS_PROBRSP_MANUFACTURE_PRESENT 0x00000100
2177#define SIR_WPS_PROBRSP_MODELNAME_PRESENT 0x00000200
2178#define SIR_WPS_PROBRSP_MODELNUMBER_PRESENT 0x00000400
2179#define SIR_WPS_PROBRSP_SERIALNUMBER_PRESENT 0x00000800
2180#define SIR_WPS_PROBRSP_PRIMARYDEVICETYPE_PRESENT 0x00001000
2181#define SIR_WPS_PROBRSP_DEVICENAME_PRESENT 0x00002000
2182#define SIR_WPS_PROBRSP_CONFIGMETHODS_PRESENT 0x00004000
2183#define SIR_WPS_PROBRSP_RF_BANDS_PRESENT 0x00008000
2184
2185typedef struct sSirWPSProbeRspIE {
2186 uint32_t FieldPresent;
2187 uint32_t Version; /* Version. 0x10 = version 1.0, 0x11 = etc. */
2188 uint32_t wpsState; /* 1 = unconfigured, 2 = configured. */
2189 bool APSetupLocked; /* Must be included if value is true */
2190 /*
2191 * BOOL: indicates if the user has recently activated a Registrar to
2192 * add an Enrollee.
2193 */
2194 bool SelectedRegistra;
2195 uint16_t DevicePasswordID; /* Device Password ID */
2196 /* Selected Registrar config method */
2197 uint16_t SelectedRegistraCfgMethod;
2198 uint8_t ResponseType; /* Response type */
2199 uint8_t UUID_E[16]; /* Unique identifier of the AP. */
2200 tSirName Manufacture;
2201 tSirText ModelName;
2202 tSirText ModelNumber;
2203 tSirText SerialNumber;
2204 /* Device Category ID: 1Computer, 2Input Device, ... */
2205 uint32_t PrimaryDeviceCategory;
2206 /* Vendor specific OUI for Device Sub Category */
2207 uint8_t PrimaryDeviceOUI[4];
2208 /*
2209 Device Sub Category ID: 1-PC, 2-Server if Device Category ID
2210 * is computer
2211 */
2212 uint32_t DeviceSubCategory;
2213 tSirText DeviceName;
2214 uint16_t ConfigMethod; /* Configuaration method */
2215 uint8_t RFBand; /* RF bands available on the AP */
2216} tSirWPSProbeRspIE;
2217
2218#define SIR_WPS_BEACON_VER_PRESENT 0x00000001
2219#define SIR_WPS_BEACON_STATE_PRESENT 0x00000002
2220#define SIR_WPS_BEACON_APSETUPLOCK_PRESENT 0x00000004
2221#define SIR_WPS_BEACON_SELECTEDREGISTRA_PRESENT 0x00000008
2222#define SIR_WPS_BEACON_DEVICEPASSWORDID_PRESENT 0x00000010
2223#define SIR_WPS_BEACON_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020
2224#define SIR_WPS_BEACON_UUIDE_PRESENT 0x00000080
2225#define SIR_WPS_BEACON_RF_BANDS_PRESENT 0x00000100
2226#define SIR_WPS_UUID_LEN 16
2227
2228typedef struct sSirWPSBeaconIE {
2229 uint32_t FieldPresent;
2230 uint32_t Version; /* Version. 0x10 = version 1.0, 0x11 = etc. */
2231 uint32_t wpsState; /* 1 = unconfigured, 2 = configured. */
2232 bool APSetupLocked; /* Must be included if value is true */
2233 /*
2234 * BOOL: indicates if the user has recently activated a Registrar to
2235 * add an Enrollee.
2236 */
2237 bool SelectedRegistra;
2238 uint16_t DevicePasswordID; /* Device Password ID */
2239 /* Selected Registrar config method */
2240 uint16_t SelectedRegistraCfgMethod;
2241 uint8_t UUID_E[SIR_WPS_UUID_LEN]; /* Unique identifier of the AP. */
2242 uint8_t RFBand; /* RF bands available on the AP */
2243} tSirWPSBeaconIE;
2244
2245#define SIR_WPS_ASSOCRSP_VER_PRESENT 0x00000001
2246#define SIR_WPS_ASSOCRSP_RESPONSETYPE_PRESENT 0x00000002
2247
2248typedef struct sSirWPSAssocRspIE {
2249 uint32_t FieldPresent;
2250 uint32_t Version;
2251 uint8_t ResposeType;
2252} tSirWPSAssocRspIE;
2253
2254typedef struct sSirAPWPSIEs {
2255 tSirWPSProbeRspIE SirWPSProbeRspIE; /*WPS Set Probe Respose IE */
2256 tSirWPSBeaconIE SirWPSBeaconIE; /*WPS Set Beacon IE */
2257 tSirWPSAssocRspIE SirWPSAssocRspIE; /*WPS Set Assoc Response IE */
2258} tSirAPWPSIEs, *tpSiriAPWPSIEs;
2259
2260typedef struct sSirUpdateAPWPSIEsReq {
2261 uint16_t messageType; /* eWNI_SME_UPDATE_APWPSIE_REQ */
2262 uint16_t length;
2263 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302264 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002265 uint8_t sessionId; /* Session ID */
2266 tSirAPWPSIEs APWPSIEs;
2267} tSirUpdateAPWPSIEsReq, *tpSirUpdateAPWPSIEsReq;
2268
Naveen Rawat8029a402017-06-01 10:54:19 -07002269struct update_config {
2270 uint16_t messageType; /* eWNI_SME_UPDATE_CONFIG */
2271 uint16_t length;
2272 uint8_t sme_session_id;
2273 uint16_t capab;
2274 uint32_t value;
2275};
2276
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302277/*
2278 * enum sir_update_session_param_type - session param type
2279 * @SIR_PARAM_SSID_HIDDEN: ssidHidden parameter
Selvaraj, Sridharac4fcf32016-09-28 12:57:32 +05302280 * @SIR_PARAM_IGNORE_ASSOC_DISALLOWED: ignore_assoc_disallowed parameter
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302281 */
2282enum sir_update_session_param_type {
2283 SIR_PARAM_SSID_HIDDEN,
Selvaraj, Sridharac4fcf32016-09-28 12:57:32 +05302284 SIR_PARAM_IGNORE_ASSOC_DISALLOWED,
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302285};
2286
2287/*
2288 * struct sir_update_session_param
2289 * @message_type: SME message type
2290 * @length: size of struct sir_update_session_param
2291 * @session_id: Session ID
2292 * @param_type: parameter to be updated
2293 * @param_val: Parameter value to update
2294 */
2295struct sir_update_session_param {
2296 uint16_t message_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002297 uint16_t length;
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302298 uint8_t session_id;
2299 uint32_t param_type;
2300 uint32_t param_val;
2301};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002302
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07002303/**
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -07002304 * struct sir_set_he_bss_color
2305 * @message_type: SME message type
2306 * @length: size of struct sir_set_he_bss_color
2307 * @session_id: Session ID
2308 * @bss_color: bss color value
2309 */
2310struct sir_set_he_bss_color {
2311 uint16_t message_type;
2312 uint16_t length;
2313 uint8_t session_id;
2314 uint8_t bss_color;
2315};
2316
2317/**
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07002318 * struct sir_create_session - Used for creating session in monitor mode
2319 * @type: SME host message type.
2320 * @msg_len: Length of the message.
2321 * @bss_id: bss_id for creating the session.
2322 */
2323struct sir_create_session {
2324 uint16_t type;
2325 uint16_t msg_len;
Rajeev Kumar Sirasanagandlae3b59912018-08-24 15:53:31 +05302326 uint8_t vdev_id;
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07002327 struct qdf_mac_addr bss_id;
2328};
2329
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002330/* Beacon Interval */
2331typedef struct sSirChangeBIParams {
2332 uint16_t messageType;
2333 uint16_t length;
2334 uint16_t beaconInterval; /* Beacon Interval */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302335 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002336 uint8_t sessionId; /* Session ID */
2337} tSirChangeBIParams, *tpSirChangeBIParams;
2338
2339#ifdef QCA_HT_2040_COEX
2340typedef struct sSirSetHT2040Mode {
2341 uint16_t messageType;
2342 uint16_t length;
2343 uint8_t cbMode;
2344 bool obssEnabled;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302345 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002346 uint8_t sessionId; /* Session ID */
2347} tSirSetHT2040Mode, *tpSirSetHT2040Mode;
2348#endif
2349
2350#define SIR_WPS_PBC_WALK_TIME 120 /* 120 Second */
2351
2352typedef struct sSirWPSPBCSession {
2353 struct sSirWPSPBCSession *next;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302354 struct qdf_mac_addr addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002355 uint8_t uuid_e[SIR_WPS_UUID_LEN];
2356 uint32_t timestamp;
2357} tSirWPSPBCSession;
2358
2359typedef struct sSirSmeGetWPSPBCSessionsReq {
2360 uint16_t messageType; /* eWNI_SME_GET_WPSPBC_SESSION_REQ */
2361 uint16_t length;
2362 void *pUsrContext;
2363 void *pSapEventCallback;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302364 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002365 /* MAC Address of STA in WPS Session to be removed */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302366 struct qdf_mac_addr remove_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002367} tSirSmeGetWPSPBCSessionsReq, *tpSirSmeGetWPSPBCSessionsReq;
2368
2369typedef struct sSirWPSPBCProbeReq {
Anurag Chouhan6d760662016-02-20 16:05:43 +05302370 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002371 uint16_t probeReqIELen;
2372 uint8_t probeReqIE[512];
2373} tSirWPSPBCProbeReq, *tpSirWPSPBCProbeReq;
2374
2375/* probereq from peer, when wsc is enabled */
2376typedef struct sSirSmeProbeReqInd {
2377 uint16_t messageType; /* eWNI_SME_WPS_PBC_PROBE_REQ_IND */
2378 uint16_t length;
2379 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302380 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002381 tSirWPSPBCProbeReq WPSPBCProbeReq;
2382} tSirSmeProbeReqInd, *tpSirSmeProbeReqInd;
2383
2384typedef struct sSirUpdateAPWPARSNIEsReq {
2385 uint16_t messageType; /* eWNI_SME_SET_APWPARSNIEs_REQ */
2386 uint16_t length;
2387 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302388 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002389 uint8_t sessionId; /* Session ID */
2390 tSirRSNie APWPARSNIEs;
2391} tSirUpdateAPWPARSNIEsReq, *tpSirUpdateAPWPARSNIEsReq;
2392
2393#define SIR_ROAM_MAX_CHANNELS 80
2394#define SIR_ROAM_SCAN_MAX_PB_REQ_SIZE 450
2395/* Occupied channel list remains static */
2396#define CHANNEL_LIST_STATIC 1
Himanshu Agarwalb23aa572018-06-14 17:04:44 +05302397/* Occupied channel list can be dynamic */
2398#define CHANNEL_LIST_DYNAMIC 2
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002399#define SIR_ROAM_SCAN_24G_DEFAULT_CH 1
2400#define SIR_ROAM_SCAN_5G_DEFAULT_CH 36
2401#define SIR_ROAM_SCAN_RESERVED_BYTES 61
2402
2403#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2404#define SIR_ROAM_SCAN_PSK_SIZE 32
2405#define SIR_ROAM_R0KH_ID_MAX_LEN 48
2406#endif
2407/* SME -> HAL - This is the host offload request. */
2408#define SIR_IPV4_ARP_REPLY_OFFLOAD 0
2409#define SIR_IPV6_NEIGHBOR_DISCOVERY_OFFLOAD 1
2410#define SIR_IPV6_NS_OFFLOAD 2
2411#define SIR_OFFLOAD_DISABLE 0
2412#define SIR_OFFLOAD_ENABLE 1
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002413
2414#ifdef WLAN_NS_OFFLOAD
2415typedef struct sSirNsOffloadReq {
Srinivas Girigowdac79a7102015-12-08 15:18:26 -08002416 uint8_t srcIPv6Addr[SIR_MAC_IPV6_ADDR_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002417 uint8_t selfIPv6Addr[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][SIR_MAC_IPV6_ADDR_LEN];
2418 uint8_t targetIPv6Addr[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][SIR_MAC_IPV6_ADDR_LEN];
Anurag Chouhan6d760662016-02-20 16:05:43 +05302419 struct qdf_mac_addr self_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002420 uint8_t srcIPv6AddrValid;
2421 uint8_t targetIPv6AddrValid[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA];
Sravan Kumar Kairamc0873582016-07-26 17:34:57 +05302422 uint8_t target_ipv6_addr_ac_type[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002423 uint8_t slotIdx;
2424} tSirNsOffloadReq, *tpSirNsOffloadReq;
2425#endif /* WLAN_NS_OFFLOAD */
2426
2427typedef struct sSirHostOffloadReq {
2428 uint8_t offloadType;
2429 uint8_t enableOrDisable;
2430 uint32_t num_ns_offload_count;
2431 union {
Srinivas Girigowdac79a7102015-12-08 15:18:26 -08002432 uint8_t hostIpv4Addr[SIR_IPV4_ADDR_LEN];
2433 uint8_t hostIpv6Addr[SIR_MAC_IPV6_ADDR_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002434 } params;
2435#ifdef WLAN_NS_OFFLOAD
2436 tSirNsOffloadReq nsOffloadInfo;
2437#endif /* WLAN_NS_OFFLOAD */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302438 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002439} tSirHostOffloadReq, *tpSirHostOffloadReq;
2440
2441/* Packet Types. */
2442#define SIR_KEEP_ALIVE_NULL_PKT 1
2443#define SIR_KEEP_ALIVE_UNSOLICIT_ARP_RSP 2
2444
2445/* Keep Alive request. */
2446typedef struct sSirKeepAliveReq {
2447 uint8_t packetType;
2448 uint32_t timePeriod;
2449 tSirIpv4Addr hostIpv4Addr;
2450 tSirIpv4Addr destIpv4Addr;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302451 struct qdf_mac_addr dest_macaddr;
2452 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002453 uint8_t sessionId;
2454} tSirKeepAliveReq, *tpSirKeepAliveReq;
2455
2456typedef struct sSirSmeMgmtFrameInd {
Abhishek Singh7996eb72015-12-30 17:24:02 +05302457 uint16_t frame_len;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002458 uint32_t rxChan;
2459 uint8_t sessionId;
2460 uint8_t frameType;
2461 int8_t rxRssi;
2462 uint8_t frameBuf[1]; /* variable */
2463} tSirSmeMgmtFrameInd, *tpSirSmeMgmtFrameInd;
2464
Abhishek Singh7996eb72015-12-30 17:24:02 +05302465typedef void (*sir_mgmt_frame_ind_callback)(tSirSmeMgmtFrameInd *frame_ind);
2466/**
2467 * struct sir_sme_mgmt_frame_cb_req - Register a
2468 * management frame callback req
2469 *
2470 * @message_type: message id
2471 * @length: msg length
2472 * @callback: callback for management frame indication
2473 */
2474struct sir_sme_mgmt_frame_cb_req {
2475 uint16_t message_type;
2476 uint16_t length;
2477 sir_mgmt_frame_ind_callback callback;
2478};
2479
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002480#ifdef WLAN_FEATURE_11W
2481typedef struct sSirSmeUnprotMgmtFrameInd {
2482 uint8_t sessionId;
2483 uint8_t frameType;
2484 uint8_t frameLen;
2485 uint8_t frameBuf[1]; /* variable */
2486} tSirSmeUnprotMgmtFrameInd, *tpSirSmeUnprotMgmtFrameInd;
2487#endif
2488
2489#define SIR_IS_FULL_POWER_REASON_DISCONNECTED(eReason) \
2490 ((eSME_LINK_DISCONNECTED_BY_HDD == (eReason)) || \
2491 (eSME_LINK_DISCONNECTED_BY_OTHER == (eReason)))
2492#define SIR_IS_FULL_POWER_NEEDED_BY_HDD(eReason) \
2493 ((eSME_LINK_DISCONNECTED_BY_HDD == (eReason)) || \
2494 (eSME_FULL_PWR_NEEDED_BY_HDD == (eReason)))
2495
2496/* P2P Power Save Related */
2497typedef struct sSirNoAParam {
2498 uint8_t ctWindow:7;
2499 uint8_t OppPS:1;
2500 uint8_t count;
2501 uint32_t duration;
2502 uint32_t interval;
2503 uint32_t singleNoADuration;
2504 uint8_t psSelection;
2505} tSirNoAParam, *tpSirNoAParam;
2506
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002507typedef struct sSirWlanResumeParam {
2508 uint8_t configuredMcstBcstFilterSetting;
2509} tSirWlanResumeParam, *tpSirWlanResumeParam;
2510
2511#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
2512
2513typedef enum ext_wow_type {
2514 EXT_WOW_TYPE_APP_TYPE1, /* wow type: only enable wakeup for app type1 */
2515 EXT_WOW_TYPE_APP_TYPE2, /* wow type: only enable wakeup for app type2 */
2516 EXT_WOW_TYPE_APP_TYPE1_2, /* wow type: enable wakeup for app type1&2 */
2517} EXT_WOW_TYPE;
2518
2519typedef struct {
2520 uint8_t vdev_id;
2521 EXT_WOW_TYPE type;
2522 uint32_t wakeup_pin_num;
2523} tSirExtWoWParams, *tpSirExtWoWParams;
2524
2525typedef struct {
2526 uint8_t vdev_id;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302527 struct qdf_mac_addr wakee_mac_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002528 uint8_t identification_id[8];
2529 uint8_t password[16];
2530 uint32_t id_length;
2531 uint32_t pass_length;
2532} tSirAppType1Params, *tpSirAppType1Params;
2533
2534typedef struct {
2535 uint8_t vdev_id;
2536
2537 uint8_t rc4_key[16];
2538 uint32_t rc4_key_len;
2539
2540 /** ip header parameter */
2541 uint32_t ip_id; /* NC id */
2542 uint32_t ip_device_ip; /* NC IP address */
2543 uint32_t ip_server_ip; /* Push server IP address */
2544
2545 /** tcp header parameter */
2546 uint16_t tcp_src_port; /* NC TCP port */
2547 uint16_t tcp_dst_port; /* Push server TCP port */
2548 uint32_t tcp_seq;
2549 uint32_t tcp_ack_seq;
2550
2551 uint32_t keepalive_init; /* Initial ping interval */
2552 uint32_t keepalive_min; /* Minimum ping interval */
2553 uint32_t keepalive_max; /* Maximum ping interval */
2554 uint32_t keepalive_inc; /* Increment of ping interval */
2555
Anurag Chouhan6d760662016-02-20 16:05:43 +05302556 struct qdf_mac_addr gateway_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002557 uint32_t tcp_tx_timeout_val;
2558 uint32_t tcp_rx_timeout_val;
2559} tSirAppType2Params, *tpSirAppType2Params;
2560#endif
2561
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002562#define ANI_MAX_IBSS_ROUTE_TABLE_ENTRY 100
2563
2564typedef struct sAniDestIpNextHopMacPair {
Anurag Chouhan6d760662016-02-20 16:05:43 +05302565 uint8_t destIpv4Addr[QDF_IPV4_ADDR_SIZE];
2566 uint8_t nextHopMacAddr[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002567} tAniDestIpNextHopMacPair;
2568
2569typedef struct sAniIbssRouteTable {
2570 uint8_t sessionId;
2571 uint16_t numEntries;
2572 tAniDestIpNextHopMacPair destIpNextHopPair[1];
2573} tAniIbssRouteTable;
2574
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002575#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2576typedef struct {
2577 uint8_t acvo_uapsd:1;
2578 uint8_t acvi_uapsd:1;
2579 uint8_t acbk_uapsd:1;
2580 uint8_t acbe_uapsd:1;
2581 uint8_t reserved:4;
2582} tSirAcUapsd, *tpSirAcUapsd;
2583#endif
2584
2585typedef struct {
2586 tSirMacSSid ssId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302587 uint8_t currAPbssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002588 uint32_t authentication;
2589 uint8_t encryption;
2590 uint8_t mcencryption;
2591 uint8_t ChannelCount;
2592 uint8_t ChannelCache[SIR_ROAM_MAX_CHANNELS];
2593#ifdef WLAN_FEATURE_11W
2594 bool mfp_enabled;
2595#endif
2596
2597} tSirRoamNetworkType;
2598
2599typedef struct SirMobilityDomainInfo {
2600 uint8_t mdiePresent;
2601 uint16_t mobilityDomain;
2602} tSirMobilityDomainInfo;
2603
2604typedef enum {
2605 SIR_ROAMING_DFS_CHANNEL_DISABLED = 0,
2606 SIR_ROAMING_DFS_CHANNEL_ENABLED_NORMAL = 1,
2607 SIR_ROAMING_DFS_CHANNEL_ENABLED_ACTIVE = 2
2608} eSirDFSRoamScanMode;
2609#define MAX_SSID_ALLOWED_LIST 4
2610#define MAX_BSSID_AVOID_LIST 16
2611#define MAX_BSSID_FAVORED 16
2612/**
2613 * struct roam_ext_params - Structure holding roaming parameters
2614 * @num_bssid_avoid_list: The number of BSSID's that we should
2615 * avoid connecting to. It is like a
2616 * blacklist of BSSID's.
2617 * @num_ssid_allowed_list: The number of SSID profiles that are
2618 * in the Whitelist. When roaming, we
2619 * consider the BSSID's with this SSID
2620 * also for roaming apart from the connected one's
2621 * @num_bssid_favored: Number of BSSID's which have a preference over
2622 * others
2623 * @ssid_allowed_list: Whitelist SSID's
2624 * @bssid_avoid_list: Blacklist SSID's
2625 * @bssid_favored: Favorable BSSID's
2626 * @bssid_favored_factor: RSSI to be added to this BSSID to prefer it
2627 * @raise_rssi_thresh_5g: The RSSI threshold below which the
2628 * raise_factor_5g (boost factor) should be
2629 * applied.
2630 * @drop_rssi_thresh_5g: The RSSI threshold beyond which the
2631 * drop_factor_5g (penalty factor) should be
2632 * applied
2633 * @raise_rssi_type_5g: Algorithm to apply the boost factor
2634 * @raise_factor_5g: Boost factor
2635 * @drop_rssi_type_5g: Algorithm to apply the penalty factor
2636 * @drop_factor_5g: Penalty factor
2637 * @max_raise_rssi_5g: Maximum amount of Boost that can added
2638 * @max_drop_rssi_5g: Maximum amount of penalty that can be subtracted
2639 * @good_rssi_threshold: The Lookup UP threshold beyond which roaming
2640 * scan should be performed.
2641 * @rssi_diff: RSSI difference for the AP to be better over the
2642 * current AP to avoid ping pong effects
2643 * @good_rssi_roam: Lazy Roam
2644 * @is_5g_pref_enabled: 5GHz BSSID preference feature enable/disable.
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002645 * @bg_scan_bad_rssi_thresh: Bad RSSI threshold to perform bg scan.
Vignesh Viswanathanc018e982017-09-07 18:49:19 +05302646 * @bad_rssi_thresh_offset_2g: Offset from Bad RSSI threshold for 2G to 5G Roam
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002647 * @bg_scan_client_bitmap: Bitmap to identify the client scans to snoop.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002648 *
2649 * This structure holds all the key parameters related to
2650 * initial connection and also roaming connections.
2651 * */
2652struct roam_ext_params {
2653 uint8_t num_bssid_avoid_list;
2654 uint8_t num_ssid_allowed_list;
2655 uint8_t num_bssid_favored;
2656 tSirMacSSid ssid_allowed_list[MAX_SSID_ALLOWED_LIST];
Anurag Chouhan6d760662016-02-20 16:05:43 +05302657 struct qdf_mac_addr bssid_avoid_list[MAX_BSSID_AVOID_LIST];
2658 struct qdf_mac_addr bssid_favored[MAX_BSSID_FAVORED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002659 uint8_t bssid_favored_factor[MAX_BSSID_FAVORED];
2660 int raise_rssi_thresh_5g;
2661 int drop_rssi_thresh_5g;
2662 uint8_t raise_rssi_type_5g;
2663 uint8_t raise_factor_5g;
2664 uint8_t drop_rssi_type_5g;
2665 uint8_t drop_factor_5g;
2666 int max_raise_rssi_5g;
2667 int max_drop_rssi_5g;
2668 int alert_rssi_threshold;
2669 int rssi_diff;
2670 int good_rssi_roam;
2671 bool is_5g_pref_enabled;
Gupta, Kapilc68ad462016-02-01 19:17:23 +05302672 int dense_rssi_thresh_offset;
2673 int dense_min_aps_cnt;
2674 int initial_dense_status;
2675 int traffic_threshold;
Abhishek Singh4db8c152017-07-18 10:40:08 +05302676 uint8_t num_rssi_rejection_ap;
2677 struct rssi_disallow_bssid rssi_rejection_ap[MAX_RSSI_AVOID_BSSID_LIST];
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002678 int8_t bg_scan_bad_rssi_thresh;
Vignesh Viswanathanc018e982017-09-07 18:49:19 +05302679 uint8_t roam_bad_rssi_thresh_offset_2g;
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002680 uint32_t bg_scan_client_bitmap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002681};
2682
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08002683/**
Himanshu Agarwal8bcec572017-09-28 11:54:37 +05302684 * struct sir_weight_config - weight params to
2685 * calculate best candidate
2686 * @rssi_weightage: RSSI weightage
2687 * @ht_caps_weightage: HT caps weightage
2688 * @vht_caps_weightage: VHT caps weightage
2689 * @he_caps_weightage: HE caps weightage
2690 * @chan_width_weightage: Channel width weightage
2691 * @chan_band_weightage: Channel band weightage
2692 * @nss_weightage: NSS weightage
2693 * @beamforming_cap_weightage: Beamforming caps weightage
2694 * @pcl_weightage: PCL weightage
2695 * @channel_congestion_weightage: channel congestion weightage
2696 * @oce_wan_weightage: OCE WAN metrics weightage
2697 */
2698struct sir_weight_config {
2699 uint8_t rssi_weightage;
2700 uint8_t ht_caps_weightage;
2701 uint8_t vht_caps_weightage;
2702 uint8_t he_caps_weightage;
2703 uint8_t chan_width_weightage;
2704 uint8_t chan_band_weightage;
2705 uint8_t nss_weightage;
2706 uint8_t beamforming_cap_weightage;
2707 uint8_t pcl_weightage;
2708 uint8_t channel_congestion_weightage;
2709 uint8_t oce_wan_weightage;
2710};
2711
2712struct sir_rssi_cfg_score {
2713 uint32_t best_rssi_threshold;
2714 uint32_t good_rssi_threshold;
2715 uint32_t bad_rssi_threshold;
2716 uint32_t good_rssi_pcnt;
2717 uint32_t bad_rssi_pcnt;
2718 uint32_t good_rssi_bucket_size;
2719 uint32_t bad_rssi_bucket_size;
2720 uint32_t rssi_pref_5g_rssi_thresh;
2721};
2722
2723/**
2724 * struct sir_per_slot_scoring - define % score for differents slots for a
2725 * scoring param.
2726 * num_slot: number of slots in which the param will be divided.
2727 * Max 15. index 0 is used for 'not_present. Num_slot will
2728 * equally divide 100. e.g, if num_slot = 4 slot 0 = 0-25%, slot
2729 * 1 = 26-50% slot 2 = 51-75%, slot 3 = 76-100%
2730 * score_pcnt3_to_0: Conatins score percentage for slot 0-3
2731 * BITS 0-7 :- the scoring pcnt when not present
2732 * BITS 8-15 :- SLOT_1
2733 * BITS 16-23 :- SLOT_2
2734 * BITS 24-31 :- SLOT_3
2735 * score_pcnt7_to_4: Conatins score percentage for slot 4-7
2736 * BITS 0-7 :- SLOT_4
2737 * BITS 8-15 :- SLOT_5
2738 * BITS 16-23 :- SLOT_6
2739 * BITS 24-31 :- SLOT_7
2740 * score_pcnt11_to_8: Conatins score percentage for slot 8-11
2741 * BITS 0-7 :- SLOT_8
2742 * BITS 8-15 :- SLOT_9
2743 * BITS 16-23 :- SLOT_10
2744 * BITS 24-31 :- SLOT_11
2745 * score_pcnt15_to_12: Conatins score percentage for slot 12-15
2746 * BITS 0-7 :- SLOT_12
2747 * BITS 8-15 :- SLOT_13
2748 * BITS 16-23 :- SLOT_14
2749 * BITS 24-31 :- SLOT_15
2750 */
2751struct sir_per_slot_scoring {
2752 uint32_t num_slot;
2753 uint32_t score_pcnt3_to_0;
2754 uint32_t score_pcnt7_to_4;
2755 uint32_t score_pcnt11_to_8;
2756 uint32_t score_pcnt15_to_12;
2757};
2758
2759struct sir_score_config {
2760 bool enable_scoring_for_roam;
2761 struct sir_weight_config weight_cfg;
2762 struct sir_rssi_cfg_score rssi_score;
2763 struct sir_per_slot_scoring esp_qbss_scoring;
2764 struct sir_per_slot_scoring oce_wan_scoring;
2765 uint32_t bandwidth_weight_per_index;
2766 uint32_t nss_weight_per_index;
2767 uint32_t band_weight_per_index;
2768};
2769
2770/**
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08002771 * struct pmkid_mode_bits - Bit flags for PMKID usage in RSN IE
2772 * @fw_okc: Opportunistic key caching enable in firmware
2773 * @fw_pmksa_cache: PMKSA caching enable in firmware, remember previously
2774 * visited BSSID/PMK pairs
2775 */
2776struct pmkid_mode_bits {
2777 uint32_t fw_okc:1;
2778 uint32_t fw_pmksa_cache:1;
2779 uint32_t unused:30;
2780};
2781
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302782/**
2783 * struct lca_disallow_config_params - LCA[Last Connected AP]
2784 * disallow config params
2785 * @disallow_duration: LCA AP disallowed duration
2786 * @rssi_channel_penalization: RSSI channel Penalization
2787 * @num_disallowed_aps: Maximum number of AP's in LCA list
2788 *
2789 */
Srinivas Girigowdaea4d8062017-10-14 12:40:48 -07002790struct lca_disallow_config_params {
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302791 uint32_t disallow_duration;
2792 uint32_t rssi_channel_penalization;
2793 uint32_t num_disallowed_aps;
2794};
2795
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002796/**
2797 * struct mawc_params - Motion Aided Wireless Connectivity configuration
2798 * @MAWCEnabled: Global configuration for MAWC (Roaming/PNO/ExtScan)
2799 * @mawc_roam_enabled: MAWC roaming enable/disable
2800 * @mawc_roam_traffic_threshold: Traffic threshold in kBps for MAWC roaming
2801 * @mawc_roam_ap_rssi_threshold: AP RSSI threshold for MAWC roaming
2802 * @mawc_roam_rssi_high_adjust: High Adjustment value for suppressing scan
2803 * @mawc_roam_rssi_low_adjust: Low Adjustment value for suppressing scan
2804 */
2805struct mawc_params {
2806 bool mawc_enabled;
2807 bool mawc_roam_enabled;
2808 uint32_t mawc_roam_traffic_threshold;
2809 int8_t mawc_roam_ap_rssi_threshold;
2810 uint8_t mawc_roam_rssi_high_adjust;
2811 uint8_t mawc_roam_rssi_low_adjust;
2812};
2813
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002814typedef struct sSirRoamOffloadScanReq {
Selvaraj, Sridhar01741822016-08-30 18:26:19 +05302815 uint16_t message_type;
2816 uint16_t length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002817 bool RoamScanOffloadEnabled;
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002818 struct mawc_params mawc_roam_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002819 int8_t LookupThreshold;
Varun Reddy Yeturu168134f2017-06-26 13:46:05 -07002820 int8_t rssi_thresh_offset_5g;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002821 uint8_t delay_before_vdev_stop;
2822 uint8_t OpportunisticScanThresholdDiff;
2823 uint8_t RoamRescanRssiDiff;
2824 uint8_t RoamRssiDiff;
gaurank kathpaliac63859d2018-05-03 18:48:41 +05302825 struct rsn_caps rsn_caps;
Abhishek Singh34c0e632017-09-28 14:39:29 +05302826 int32_t rssi_abs_thresh;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002827 uint8_t ChannelCacheType;
2828 uint8_t Command;
2829 uint8_t reason;
2830 uint16_t NeighborScanTimerPeriod;
Sridhar Selvaraj1b2330c2017-07-21 15:16:42 +05302831 uint16_t neighbor_scan_min_timer_period;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002832 uint16_t NeighborRoamScanRefreshPeriod;
2833 uint16_t NeighborScanChannelMinTime;
2834 uint16_t NeighborScanChannelMaxTime;
2835 uint16_t EmptyRefreshScanPeriod;
2836 uint8_t ValidChannelCount;
2837 uint8_t ValidChannelList[SIR_ROAM_MAX_CHANNELS];
2838 bool IsESEAssoc;
Abhinav Kumar271f0632018-03-29 16:01:30 +05302839 bool is_11r_assoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002840 uint8_t nProbes;
2841 uint16_t HomeAwayTime;
2842 tSirRoamNetworkType ConnectedNetwork;
2843 tSirMobilityDomainInfo MDID;
2844 uint8_t sessionId;
2845 uint8_t RoamBmissFirstBcnt;
2846 uint8_t RoamBmissFinalBcnt;
2847 uint8_t RoamBeaconRssiWeight;
2848 eSirDFSRoamScanMode allowDFSChannelRoam;
2849#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2850 uint8_t RoamOffloadEnabled;
2851 uint8_t PSK_PMK[SIR_ROAM_SCAN_PSK_SIZE];
2852 uint32_t pmk_len;
2853 uint8_t Prefer5GHz;
2854 uint8_t RoamRssiCatGap;
2855 uint8_t Select5GHzMargin;
2856 uint8_t KRK[SIR_KRK_KEY_LEN];
2857 uint8_t BTK[SIR_BTK_KEY_LEN];
2858 uint32_t ReassocFailureTimeout;
2859 tSirAcUapsd AcUapsd;
2860 uint8_t R0KH_ID[SIR_ROAM_R0KH_ID_MAX_LEN];
2861 uint32_t R0KH_ID_Length;
2862 uint8_t RoamKeyMgmtOffloadEnabled;
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08002863 struct pmkid_mode_bits pmkid_modes;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002864#endif
2865 struct roam_ext_params roam_params;
2866 uint8_t middle_of_roaming;
2867 uint32_t hi_rssi_scan_max_count;
2868 uint32_t hi_rssi_scan_rssi_delta;
2869 uint32_t hi_rssi_scan_delay;
2870 int32_t hi_rssi_scan_rssi_ub;
Varun Reddy Yeturu05186292015-09-28 17:12:33 -07002871 uint8_t early_stop_scan_enable;
2872 int8_t early_stop_scan_min_threshold;
2873 int8_t early_stop_scan_max_threshold;
Sandeep Puligillaf5ccbf62018-03-26 16:37:05 -07002874 enum scan_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode;
Selvaraj, Sridhara7fc7632016-09-04 13:13:38 +05302875 tSirAddie assoc_ie;
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302876 struct lca_disallow_config_params lca_config_params;
Himanshu Agarwal8bcec572017-09-28 11:54:37 +05302877 struct scoring_param score_params;
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05302878#ifdef WLAN_FEATURE_FILS_SK
2879 bool is_fils_connection;
2880 struct roam_fils_params roam_fils_params;
2881#endif
yeshwanth sriram guntuka41f936c2017-09-01 17:53:49 +05302882 uint32_t btm_offload_config;
Jiachao Wu84bb2ea2018-01-08 16:17:33 +08002883 uint32_t btm_solicited_timeout;
2884 uint32_t btm_max_attempt_cnt;
2885 uint32_t btm_sticky_time;
Vignesh Viswanathanfb9d0752018-02-06 16:19:00 +05302886 struct wmi_11k_offload_params offload_11k_params;
Abhinav Kumara083f212018-04-05 18:49:45 +05302887 uint32_t ho_delay_for_rx;
Abhinav Kumara95af7c2018-04-06 17:08:00 +05302888 uint32_t min_delay_btw_roam_scans;
2889 uint32_t roam_trigger_reason_bitmask;
Abhinav Kumaredd1d372018-05-11 15:33:35 +05302890 bool roam_force_rssi_trigger;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002891} tSirRoamOffloadScanReq, *tpSirRoamOffloadScanReq;
2892
2893typedef struct sSirRoamOffloadScanRsp {
2894 uint8_t sessionId;
2895 uint32_t reason;
2896} tSirRoamOffloadScanRsp, *tpSirRoamOffloadScanRsp;
2897
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002898/*---------------------------------------------------------------------------
2899 Packet Filtering Parameters
2900 ---------------------------------------------------------------------------*/
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002901#define SIR_MAX_FILTER_TEST_DATA_LEN 8
Dustin Brown4d1e8462016-12-14 12:12:24 -08002902#define SIR_MAX_FILTER_TEST_DATA_OFFSET 200
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002903#define SIR_MAX_NUM_MULTICAST_ADDRESS 240
2904#define SIR_MAX_NUM_FILTERS 20
2905#define SIR_MAX_NUM_TESTS_PER_FILTER 10
2906
Qiwei Cai4505fc62018-05-17 18:35:19 +08002907#ifdef WLAN_FEATURE_PACKET_FILTERING
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002908/* */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002909/* Filter Packet Match Count Parameters */
2910/* */
2911typedef struct sSirRcvFltPktMatchCnt {
2912 uint8_t filterId;
2913 uint32_t matchCnt;
2914} tSirRcvFltPktMatchCnt, tpSirRcvFltPktMatchCnt;
2915
2916typedef struct sSirRcvFltPktMatchRsp {
2917 uint16_t mesgType;
2918 uint16_t mesgLen;
2919
2920 /* Success or Failure */
2921 uint32_t status;
2922 tSirRcvFltPktMatchCnt filterMatchCnt[SIR_MAX_NUM_FILTERS];
Anurag Chouhan6d760662016-02-20 16:05:43 +05302923 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002924} tSirRcvFltPktMatchRsp, *tpSirRcvFltPktMatchRsp;
2925
2926/* */
2927/* Receive Filter Clear Parameters */
2928/* */
2929typedef struct sSirRcvFltPktClearParam {
2930 uint32_t status; /* only valid for response message */
2931 uint8_t filterId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302932 struct qdf_mac_addr self_macaddr;
2933 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002934} tSirRcvFltPktClearParam, *tpSirRcvFltPktClearParam;
Qiwei Cai4505fc62018-05-17 18:35:19 +08002935#endif /* WLAN_FEATURE_PACKET_FILTERING */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002936
2937/* */
2938/* Multicast Address List Parameters */
2939/* */
2940typedef struct sSirRcvFltMcAddrList {
2941 uint32_t ulMulticastAddrCnt;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302942 struct qdf_mac_addr multicastAddr[SIR_MAX_NUM_MULTICAST_ADDRESS];
2943 struct qdf_mac_addr self_macaddr;
2944 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002945 uint8_t action;
2946} tSirRcvFltMcAddrList, *tpSirRcvFltMcAddrList;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002947
2948/* */
2949/* Generic version information */
2950/* */
2951typedef struct {
2952 uint8_t revision;
2953 uint8_t version;
2954 uint8_t minor;
2955 uint8_t major;
2956} tSirVersionType;
2957
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002958/**
2959 * struct sir_wifi_start_log - Structure to store the params sent to start/
2960 * stop logging
2961 * @name: Attribute which indicates the type of logging like per packet
2962 * statistics, connectivity etc.
2963 * @verbose_level: Verbose level which can be 0,1,2,3
Poddar, Siddartheefe3482016-09-21 18:12:59 +05302964 * @is_iwpriv_command: Set 1 for iwpriv command
Srinivas Girigowdac34f11d2016-02-25 16:02:42 -08002965 * @ini_triggered: triggered using ini
2966 * @user_triggered: triggered by user
Poddar, Siddarth176c4362016-10-03 12:25:00 +05302967 * @size: pktlog buffer size
Poddar, Siddarthab99a272017-04-10 12:53:26 +05302968 * @is_pktlog_buff_clear: clear the pktlog buffer
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002969 */
2970struct sir_wifi_start_log {
2971 uint32_t ring_id;
2972 uint32_t verbose_level;
Poddar, Siddartheefe3482016-09-21 18:12:59 +05302973 uint32_t is_iwpriv_command;
Srinivas Girigowdac34f11d2016-02-25 16:02:42 -08002974 bool ini_triggered;
2975 uint8_t user_triggered;
Poddar, Siddarth176c4362016-10-03 12:25:00 +05302976 int size;
Poddar, Siddarthab99a272017-04-10 12:53:26 +05302977 bool is_pktlog_buff_clear;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002978};
2979
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002980
2981/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002982 * struct sir_pcl_list - Format of PCL
2983 * @pcl_list: List of preferred channels
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302984 * @weight_list: Weights of the PCL
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002985 * @pcl_len: Number of channels in the PCL
2986 */
2987struct sir_pcl_list {
Rajeev Kumar Sirasanagandla4133d862018-08-23 12:21:36 +05302988 uint32_t pcl_len;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002989 uint8_t pcl_list[128];
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302990 uint8_t weight_list[128];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002991};
2992
2993/**
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05302994 * struct sir_pcl_chan_weights - Params to get the valid weighed list
2995 * @pcl_list: Preferred channel list already sorted in the order of preference
2996 * @pcl_len: Length of the PCL
2997 * @saved_chan_list: Valid channel list updated as part of
2998 * WMA_UPDATE_CHAN_LIST_REQ
2999 * @saved_num_chan: Length of the valid channel list
3000 * @weighed_valid_list: Weights of the valid channel list. This will have one
3001 * to one mapping with valid_chan_list. FW expects channel order and size to be
3002 * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID.
3003 * @weight_list: Weights assigned by policy manager
3004 */
3005struct sir_pcl_chan_weights {
3006 uint8_t pcl_list[128];
3007 uint32_t pcl_len;
3008 uint8_t saved_chan_list[128];
3009 uint32_t saved_num_chan;
3010 uint8_t weighed_valid_list[128];
3011 uint8_t weight_list[128];
3012};
3013
3014/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003015 * struct sir_hw_mode_params - HW mode params
3016 * @mac0_tx_ss: MAC0 Tx spatial stream
3017 * @mac0_rx_ss: MAC0 Rx spatial stream
3018 * @mac1_tx_ss: MAC1 Tx spatial stream
3019 * @mac1_rx_ss: MAC1 Rx spatial stream
3020 * @mac0_bw: MAC0 bandwidth
3021 * @mac1_bw: MAC1 bandwidth
3022 * @dbs_cap: DBS capabality
3023 * @agile_dfs_cap: Agile DFS capabality
3024 */
3025struct sir_hw_mode_params {
3026 uint8_t mac0_tx_ss;
3027 uint8_t mac0_rx_ss;
3028 uint8_t mac1_tx_ss;
3029 uint8_t mac1_rx_ss;
3030 uint8_t mac0_bw;
3031 uint8_t mac1_bw;
3032 uint8_t dbs_cap;
3033 uint8_t agile_dfs_cap;
Nitesh Shah5b7bae02016-09-28 18:58:33 +05303034 uint8_t sbs_cap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003035};
3036
3037/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003038 * struct sir_set_hw_mode_resp - HW mode response
3039 * @status: Status
3040 * @cfgd_hw_mode_index: Configured HW mode index
3041 * @num_vdev_mac_entries: Number of vdev-mac id entries
3042 * @vdev_mac_map: vdev id-mac id map
3043 */
3044struct sir_set_hw_mode_resp {
3045 uint32_t status;
3046 uint32_t cfgd_hw_mode_index;
3047 uint32_t num_vdev_mac_entries;
Tushnim Bhattacharyyaeab33dd2017-11-15 15:20:02 -08003048 struct policy_mgr_vdev_mac_map vdev_mac_map[MAX_VDEV_SUPPORTED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003049};
3050
3051/**
3052 * struct sir_hw_mode_trans_ind - HW mode transition indication
3053 * @old_hw_mode_index: Index of old HW mode
3054 * @new_hw_mode_index: Index of new HW mode
3055 * @num_vdev_mac_entries: Number of vdev-mac id entries
3056 * @vdev_mac_map: vdev id-mac id map
3057 */
3058struct sir_hw_mode_trans_ind {
3059 uint32_t old_hw_mode_index;
3060 uint32_t new_hw_mode_index;
3061 uint32_t num_vdev_mac_entries;
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08003062 struct policy_mgr_vdev_mac_map vdev_mac_map[MAX_VDEV_SUPPORTED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003063};
3064
3065/**
3066 * struct sir_dual_mac_config_resp - Dual MAC config response
3067 * @status: Status of setting the dual mac configuration
3068 */
3069struct sir_dual_mac_config_resp {
3070 uint32_t status;
3071};
3072
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -08003073/**
3074 * enum set_antenna_mode_status - Status of set antenna mode
3075 * command
3076 * @SET_ANTENNA_MODE_STATUS_OK: command successful
3077 * @SET_ANTENNA_MODE_STATUS_EINVAL: invalid antenna mode
3078 * @SET_ANTENNA_MODE_STATUS_ECANCELED: mode change cancelled
3079 * @SET_ANTENNA_MODE_STATUS_ENOTSUP: mode not supported
3080 */
3081enum set_antenna_mode_status {
3082 SET_ANTENNA_MODE_STATUS_OK,
3083 SET_ANTENNA_MODE_STATUS_EINVAL,
3084 SET_ANTENNA_MODE_STATUS_ECANCELED,
3085 SET_ANTENNA_MODE_STATUS_ENOTSUP,
3086};
3087
3088/**
3089 * struct sir_antenna_mode_resp - set antenna mode response
3090 * @status: Status of setting the antenna mode
3091 */
3092struct sir_antenna_mode_resp {
3093 enum set_antenna_mode_status status;
3094};
3095
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003096/*---------------------------------------------------------------------------
3097 sAniSetTmLevelReq
3098 ---------------------------------------------------------------------------*/
3099typedef struct sAniSetTmLevelReq {
3100 uint16_t tmMode;
3101 uint16_t newTmLevel;
3102} tAniSetTmLevelReq, *tpAniSetTmLevelReq;
3103
3104#ifdef FEATURE_WLAN_TDLS
3105/* TDLS Request struct SME-->PE */
3106typedef struct sSirTdlsSendMgmtReq {
3107 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
3108 uint16_t length;
3109 uint8_t sessionId; /* Session ID */
3110 uint16_t transactionId; /* Transaction ID for cmd */
3111 uint8_t reqType;
3112 uint8_t dialog;
3113 uint16_t statusCode;
3114 uint8_t responder;
3115 uint32_t peerCapability;
3116 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303117 struct qdf_mac_addr bssid;
3118 struct qdf_mac_addr peer_mac;
Ganesh Kondabattinidd726522017-05-10 18:09:37 +05303119 enum wifi_traffic_ac ac;
Srinivas Girigowdaa9d12f12015-11-24 11:26:40 -08003120 /* Variable length. Dont add any field after this. */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003121 uint8_t addIe[1];
3122} tSirTdlsSendMgmtReq, *tpSirSmeTdlsSendMgmtReq;
3123
3124typedef enum TdlsAddOper {
3125 TDLS_OPER_NONE,
3126 TDLS_OPER_ADD,
3127 TDLS_OPER_UPDATE
3128} eTdlsAddOper;
3129
3130/* TDLS Request struct SME-->PE */
3131typedef struct sSirTdlsAddStaReq {
3132 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
3133 uint16_t length;
3134 uint8_t sessionId; /* Session ID */
3135 uint16_t transactionId; /* Transaction ID for cmd */
3136 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303137 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003138 eTdlsAddOper tdlsAddOper;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303139 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003140 uint16_t capability;
3141 uint8_t extn_capability[SIR_MAC_MAX_EXTN_CAP];
3142 uint8_t supported_rates_length;
3143 uint8_t supported_rates[SIR_MAC_MAX_SUPP_RATES];
3144 uint8_t htcap_present;
3145 tSirHTCap htCap;
3146 uint8_t vhtcap_present;
3147 tSirVHTCap vhtCap;
3148 uint8_t uapsd_queues;
3149 uint8_t max_sp;
3150} tSirTdlsAddStaReq, *tpSirSmeTdlsAddStaReq;
3151
3152/* TDLS Response struct PE-->SME */
3153typedef struct sSirTdlsAddStaRsp {
3154 uint16_t messageType;
3155 uint16_t length;
3156 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303157 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003158 uint8_t sessionId; /* Session ID */
3159 uint16_t staId;
3160 uint16_t staType;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003161 eTdlsAddOper tdlsAddOper;
Frank Liud4b2fa02017-03-29 11:46:48 +08003162 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003163} tSirTdlsAddStaRsp;
3164
3165/* TDLS Request struct SME-->PE */
3166typedef struct {
3167 uint16_t messageType; /* eWNI_SME_TDLS_LINK_ESTABLISH_REQ */
3168 uint16_t length;
3169 uint8_t sessionId; /* Session ID */
3170 uint16_t transactionId; /* Transaction ID for cmd */
3171 uint8_t uapsdQueues; /* Peer's uapsd Queues Information */
3172 uint8_t maxSp; /* Peer's Supported Maximum Service Period */
3173 uint8_t isBufSta; /* Does Peer Support as Buffer Station. */
3174 /* Does Peer Support as TDLS Off Channel. */
3175 uint8_t isOffChannelSupported;
3176 uint8_t isResponder; /* Is Peer a responder. */
3177 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303178 struct qdf_mac_addr bssid;
3179 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003180 uint8_t supportedChannelsLen;
3181 uint8_t supportedChannels[SIR_MAC_MAX_SUPP_CHANNELS];
3182 uint8_t supportedOperClassesLen;
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -07003183 uint8_t supportedOperClasses[REG_MAX_SUPP_OPER_CLASSES];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003184} tSirTdlsLinkEstablishReq, *tpSirTdlsLinkEstablishReq;
3185
3186/* TDLS Request struct SME-->PE */
3187typedef struct {
3188 uint16_t messageType; /* eWNI_SME_TDLS_LINK_ESTABLISH_RSP */
3189 uint16_t length;
3190 uint8_t sessionId; /* Session ID */
3191 uint16_t transactionId; /* Transaction ID for cmd */
3192 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303193 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003194} tSirTdlsLinkEstablishReqRsp, *tpSirTdlsLinkEstablishReqRsp;
3195
3196/* TDLS Request struct SME-->PE */
3197typedef struct sSirTdlsDelStaReq {
3198 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
3199 uint16_t length;
3200 uint8_t sessionId; /* Session ID */
3201 uint16_t transactionId; /* Transaction ID for cmd */
3202 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303203 struct qdf_mac_addr bssid;
3204 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003205} tSirTdlsDelStaReq, *tpSirSmeTdlsDelStaReq;
3206/* TDLS Response struct PE-->SME */
3207typedef struct sSirTdlsDelStaRsp {
3208 uint16_t messageType;
3209 uint16_t length;
3210 uint8_t sessionId; /* Session ID */
3211 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303212 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003213 uint16_t staId;
Frank Liud4b2fa02017-03-29 11:46:48 +08003214 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003215} tSirTdlsDelStaRsp, *tpSirTdlsDelStaRsp;
3216/* TDLS Delete Indication struct PE-->SME */
3217typedef struct sSirTdlsDelStaInd {
3218 uint16_t messageType;
3219 uint16_t length;
3220 uint8_t sessionId; /* Session ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303221 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003222 uint16_t staId;
3223 uint16_t reasonCode;
3224} tSirTdlsDelStaInd, *tpSirTdlsDelStaInd;
3225typedef struct sSirTdlsDelAllPeerInd {
3226 uint16_t messageType;
3227 uint16_t length;
3228 uint8_t sessionId; /* Session ID */
3229} tSirTdlsDelAllPeerInd, *tpSirTdlsDelAllPeerInd;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003230typedef struct sSirMgmtTxCompletionInd {
3231 uint16_t messageType;
3232 uint16_t length;
3233 uint8_t sessionId; /* Session ID */
3234 uint32_t txCompleteStatus;
Kabilan Kannanf56f9d52017-04-05 03:31:34 -07003235 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003236} tSirMgmtTxCompletionInd, *tpSirMgmtTxCompletionInd;
3237
3238typedef struct sSirTdlsEventnotify {
3239 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303240 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003241 uint16_t messageType;
3242 uint32_t peer_reason;
3243} tSirTdlsEventnotify;
3244#endif /* FEATURE_WLAN_TDLS */
3245
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003246/* Reset AP Caps Changed */
3247typedef struct sSirResetAPCapsChange {
3248 uint16_t messageType;
3249 uint16_t length;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303250 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003251} tSirResetAPCapsChange, *tpSirResetAPCapsChange;
3252
3253/* / Definition for Candidate found indication from FW */
3254typedef struct sSirSmeCandidateFoundInd {
3255 uint16_t messageType; /* eWNI_SME_CANDIDATE_FOUND_IND */
3256 uint16_t length;
3257 uint8_t sessionId; /* Session Identifier */
3258} tSirSmeCandidateFoundInd, *tpSirSmeCandidateFoundInd;
3259
3260#ifdef WLAN_FEATURE_11W
3261typedef struct sSirWlanExcludeUnencryptParam {
3262 bool excludeUnencrypt;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303263 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003264} tSirWlanExcludeUnencryptParam, *tpSirWlanExcludeUnencryptParam;
3265#endif
3266
3267typedef enum {
3268 P2P_SCAN_TYPE_SEARCH = 1, /* P2P Search */
3269 P2P_SCAN_TYPE_LISTEN /* P2P Listen */
3270} tSirP2pScanType;
3271
3272typedef struct sAniHandoffReq {
3273 /* Common for all types are requests */
3274 uint16_t msgType; /* message type is same as the request type */
3275 uint16_t msgLen; /* length of the entire request */
3276 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303277 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003278 uint8_t channel;
3279 uint8_t handoff_src;
3280} tAniHandoffReq, *tpAniHandoffReq;
3281
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08003282/**
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07003283 * sir_scan_event_type - scan event types used in LIM
3284 * @SIR_SCAN_EVENT_STARTED - scan command accepted by FW
3285 * @SIR_SCAN_EVENT_COMPLETED - scan has been completed by FW
3286 * @SIR_SCAN_EVENT_BSS_CHANNEL - FW is going to move to HOME channel
3287 * @SIR_SCAN_EVENT_FOREIGN_CHANNEL - FW is going to move to FORIEGN channel
3288 * @SIR_SCAN_EVENT_DEQUEUED - scan request got dequeued
3289 * @SIR_SCAN_EVENT_PREEMPTED - preempted by other high priority scan
3290 * @SIR_SCAN_EVENT_START_FAILED - scan start failed
3291 * @SIR_SCAN_EVENT_RESTARTED - scan restarted
3292 * @SIR_SCAN_EVENT_MAX - max value for event type
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08003293*/
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07003294enum sir_scan_event_type {
3295 SIR_SCAN_EVENT_STARTED = 0x1,
3296 SIR_SCAN_EVENT_COMPLETED = 0x2,
3297 SIR_SCAN_EVENT_BSS_CHANNEL = 0x4,
3298 SIR_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
3299 SIR_SCAN_EVENT_DEQUEUED = 0x10,
3300 SIR_SCAN_EVENT_PREEMPTED = 0x20,
3301 SIR_SCAN_EVENT_START_FAILED = 0x40,
3302 SIR_SCAN_EVENT_RESTARTED = 0x80,
3303 SIR_SCAN_EVENT_MAX = 0x8000
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08003304};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003305
3306typedef struct sSirScanOffloadEvent {
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07003307 enum sir_scan_event_type event;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003308 tSirResultCodes reasonCode;
3309 uint32_t chanFreq;
3310 uint32_t requestor;
3311 uint32_t scanId;
3312 tSirP2pScanType p2pScanType;
3313 uint8_t sessionId;
3314} tSirScanOffloadEvent, *tpSirScanOffloadEvent;
3315
3316/**
3317 * struct sSirUpdateChanParam - channel parameters
3318 * @chanId: ID of the channel
3319 * @pwr: power level
3320 * @dfsSet: is dfs supported or not
3321 * @half_rate: is the channel operating at 10MHz
3322 * @quarter_rate: is the channel operating at 5MHz
3323 */
3324typedef struct sSirUpdateChanParam {
3325 uint8_t chanId;
3326 uint8_t pwr;
3327 bool dfsSet;
3328 bool half_rate;
3329 bool quarter_rate;
3330} tSirUpdateChanParam, *tpSirUpdateChanParam;
3331
3332typedef struct sSirUpdateChan {
3333 uint8_t numChan;
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07003334 uint8_t ht_en;
3335 uint8_t vht_en;
3336 uint8_t vht_24_en;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003337 tSirUpdateChanParam chanParam[1];
3338} tSirUpdateChanList, *tpSirUpdateChanList;
3339
3340typedef enum eSirAddonPsReq {
3341 eSIR_ADDON_NOTHING,
3342 eSIR_ADDON_ENABLE_UAPSD,
3343 eSIR_ADDON_DISABLE_UAPSD
3344} tSirAddonPsReq;
3345
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003346#ifdef FEATURE_WLAN_CH_AVOID
3347typedef struct sSirChAvoidUpdateReq {
3348 uint32_t reserved_param;
3349} tSirChAvoidUpdateReq;
3350#endif /* FEATURE_WLAN_CH_AVOID */
3351
3352typedef struct sSirLinkSpeedInfo {
3353 /* MAC Address for the peer */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303354 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003355 uint32_t estLinkSpeed; /* Linkspeed from firmware */
3356} tSirLinkSpeedInfo, *tpSirLinkSpeedInfo;
3357
Will Huanga9814592017-05-24 15:47:58 +08003358/**
3359 * struct sir_peer_info_req - peer info request struct
3360 * @peer_macaddr: MAC address
3361 * @sessionid: vdev id
3362 *
3363 * peer info request message's struct
3364 */
3365struct sir_peer_info_req {
3366 struct qdf_mac_addr peer_macaddr;
3367 uint8_t sessionid;
3368};
3369
3370/**
3371 * struct sir_peer_info - peer information struct
3372 * @peer_macaddr: MAC address
3373 * @rssi: rssi
3374 * @tx_rate: last tx rate
3375 * @rx_rate: last rx rate
3376 *
3377 * a station's information
3378 */
3379struct sir_peer_info {
3380 struct qdf_mac_addr peer_macaddr;
3381 int8_t rssi;
3382 uint32_t tx_rate;
3383 uint32_t rx_rate;
3384};
3385
3386/**
3387 * struct sir_peer_info_resp - all peers information struct
3388 * @count: peer's number
3389 * @info: peer information
3390 *
3391 * all station's information
3392 */
3393struct sir_peer_info_resp {
3394 uint8_t count;
3395 struct sir_peer_info info[0];
3396};
3397
3398/**
3399 * struct sir_peer_info_ext_req - peer info request struct
3400 * @peer_macaddr: MAC address
3401 * @sessionid: vdev id
3402 * @reset_after_request: fw reset statistics after query
3403 *
3404 * peer info request message's struct
3405 */
3406struct sir_peer_info_ext_req {
3407 struct qdf_mac_addr peer_macaddr;
3408 uint8_t sessionid;
3409 uint8_t reset_after_request;
3410};
3411
3412/**
3413 * struct sir_peer_info_ext - peer info information struct
3414 * (refer to station_info struct in Kernel)
3415 * @peer_macaddr: MAC address
3416 * @tx_packets: packets transmitted to this station
3417 * @tx_bytes: bytes transmitted to this station
3418 * @rx_packets: packets received from this station
3419 * @rx_bytes: bytes received from this station
3420 * @rx_retries: cumulative retry counts
3421 * @tx_failed: number of failed transmissions
3422 * @rssi: The signal strength
3423 * @tx_rate: last used tx bitrate (kbps)
3424 * @tx_rate_code: last tx rate code (last_tx_rate_code of wmi_peer_stats_info)
3425 * @rx_rate: last used rx bitrate (kbps)
3426 * @rx_rate_code: last rx rate code (last_rx_rate_code of wmi_peer_stats_info)
3427 *
3428 * a station's information
3429 */
3430struct sir_peer_info_ext {
3431 struct qdf_mac_addr peer_macaddr;
3432 uint32_t tx_packets;
3433 uint64_t tx_bytes;
3434 uint32_t rx_packets;
3435 uint64_t rx_bytes;
3436 uint32_t tx_retries;
3437 uint32_t tx_failed;
3438 int32_t rssi;
3439 uint32_t tx_rate;
3440 uint32_t tx_rate_code;
3441 uint32_t rx_rate;
3442 uint32_t rx_rate_code;
3443};
3444
3445/**
3446 * struct sir_peer_info_ext_resp - all peers' information struct
3447 * @count: peer's number
3448 * @info: peer information
3449 *
3450 * all station's information
3451 */
3452struct sir_peer_info_ext_resp {
3453 uint8_t count;
3454 struct sir_peer_info_ext info[0];
3455};
3456
Will Huang496b36c2017-07-11 16:38:50 +08003457/**
3458 * @sta_num: number of peer station which has valid info
3459 * @info: peer information
3460 *
3461 * all SAP peer station's information retrieved
3462 */
3463struct sir_peer_sta_info {
3464 uint8_t sta_num;
3465 struct sir_peer_info info[MAX_PEER_STA];
3466};
3467
3468/**
3469 * @sta_num: number of peer station which has valid info
3470 * @info: peer extended information
3471 *
3472 * all SAP peer station's extended information retrieved
3473 */
3474struct sir_peer_sta_ext_info {
3475 uint8_t sta_num;
3476 struct sir_peer_info_ext info[MAX_PEER_STA];
3477};
3478
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003479typedef struct sSirAddPeriodicTxPtrn {
3480 /* MAC Address for the adapter */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303481 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003482 uint8_t ucPtrnId; /* Pattern ID */
3483 uint16_t ucPtrnSize; /* Pattern size */
3484 uint32_t usPtrnIntervalMs; /* In msec */
3485 uint8_t ucPattern[PERIODIC_TX_PTRN_MAX_SIZE]; /* Pattern buffer */
3486} tSirAddPeriodicTxPtrn, *tpSirAddPeriodicTxPtrn;
3487
3488typedef struct sSirDelPeriodicTxPtrn {
3489 /* MAC Address for the adapter */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303490 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003491 /* Bitmap of pattern IDs that need to be deleted */
3492 uint32_t ucPatternIdBitmap;
3493 uint8_t ucPtrnId; /* Pattern ID */
3494} tSirDelPeriodicTxPtrn, *tpSirDelPeriodicTxPtrn;
3495
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08003496/*---------------------------------------------------------------------------
3497* tSirIbssGetPeerInfoReqParams
3498*--------------------------------------------------------------------------*/
3499typedef struct {
3500 bool allPeerInfoReqd; /* If set, all IBSS peers stats are reported */
3501 uint8_t staIdx; /* If allPeerInfoReqd is not set, only stats */
3502 /* of peer with staIdx is reported */
3503} tSirIbssGetPeerInfoReqParams, *tpSirIbssGetPeerInfoReqParams;
3504
Rajeev Kumar94c9b452016-03-24 12:58:47 -07003505/**
3506 * typedef struct - tSirIbssGetPeerInfoParams
3507 * @mac_addr: mac address received from target
3508 * @txRate: TX rate
3509 * @mcsIndex: MCS index
3510 * @txRateFlags: TX rate flags
3511 * @rssi: RSSI
3512 */
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08003513typedef struct {
Rajeev Kumar94c9b452016-03-24 12:58:47 -07003514 uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
3515 uint32_t txRate;
3516 uint32_t mcsIndex;
3517 uint32_t txRateFlags;
3518 int8_t rssi;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08003519} tSirIbssPeerInfoParams;
3520
3521typedef struct {
3522 uint32_t status;
3523 uint8_t numPeers;
3524 tSirIbssPeerInfoParams peerInfoParams[32];
3525} tSirPeerInfoRspParams, *tpSirIbssPeerInfoRspParams;
3526
3527/*---------------------------------------------------------------------------
3528* tSirIbssGetPeerInfoRspParams
3529*--------------------------------------------------------------------------*/
3530typedef struct {
3531 uint16_t mesgType;
3532 uint16_t mesgLen;
3533 tSirPeerInfoRspParams ibssPeerInfoRspParams;
3534} tSirIbssGetPeerInfoRspParams, *tpSirIbssGetPeerInfoRspParams;
3535
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003536typedef struct {
3537 uint16_t mesgType;
3538 uint16_t mesgLen;
3539 bool suspended;
3540} tSirReadyToSuspendInd, *tpSirReadyToSuspendInd;
3541#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
3542typedef struct {
3543 uint16_t mesgType;
3544 uint16_t mesgLen;
3545 bool status;
3546} tSirReadyToExtWoWInd, *tpSirReadyToExtWoWInd;
3547#endif
3548typedef struct sSirRateUpdateInd {
3549 uint8_t nss; /* 0: 1x1, 1: 2x2 */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303550 struct qdf_mac_addr bssid;
Jeff Johnsonc1e62782017-11-09 09:50:17 -08003551 enum QDF_OPMODE dev_mode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003552 int32_t bcastDataRate; /* bcast rate unit Mbpsx10, -1:not used */
3553 /*
3554 * 0 implies RA, positive value implies fixed rate, -1 implies ignore
3555 * this param.
3556 */
3557 int32_t ucastDataRate;
3558
3559 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07003560 enum tx_rate_info ucastDataRateTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003561
3562 /*
3563 * 0 implies MCAST RA, positive value implies fixed rate,
3564 * -1 implies ignore this param
3565 */
3566 int32_t reliableMcastDataRate; /* unit Mbpsx10 */
3567
3568 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07003569 enum tx_rate_info reliableMcastDataRateTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003570
3571 /*
3572 * MCAST(or BCAST) fixed data rate in 2.4 GHz, unit Mbpsx10,
3573 * 0 implies ignore
3574 */
3575 uint32_t mcastDataRate24GHz;
3576
3577 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07003578 enum tx_rate_info mcastDataRate24GHzTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003579
3580 /*
3581 * MCAST(or BCAST) fixed data rate in 5 GHz,
3582 * unit Mbpsx10, 0 implies ignore
3583 */
3584 uint32_t mcastDataRate5GHz;
3585
3586 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07003587 enum tx_rate_info mcastDataRate5GHzTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003588
3589} tSirRateUpdateInd, *tpSirRateUpdateInd;
3590
3591#if defined(FEATURE_WLAN_CH_AVOID) || defined(FEATURE_WLAN_FORCE_SAP_SCC)
3592#define SIR_CH_AVOID_MAX_RANGE 4
3593
3594typedef struct sSirChAvoidFreqType {
3595 uint32_t start_freq;
3596 uint32_t end_freq;
3597} tSirChAvoidFreqType;
3598
3599typedef struct sSirChAvoidIndType {
3600 uint32_t avoid_range_count;
3601 tSirChAvoidFreqType avoid_freq_range[SIR_CH_AVOID_MAX_RANGE];
3602} tSirChAvoidIndType;
3603#endif /* FEATURE_WLAN_CH_AVOID || FEATURE_WLAN_FORCE_SAP_SCC */
3604
3605#define SIR_DFS_MAX_20M_SUB_CH 8
Sandeep Puligilla949eaa72015-12-17 18:43:52 -08003606#define SIR_80MHZ_START_CENTER_CH_DIFF 6
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003607
3608typedef struct sSirSmeDfsChannelList {
3609 uint32_t nchannels;
3610 /* Ch num including bonded channels on which the RADAR is present */
3611 uint8_t channels[SIR_DFS_MAX_20M_SUB_CH];
3612} tSirSmeDfsChannelList, *tpSirSmeDfsChannelList;
3613
3614typedef struct sSirSmeDfsEventInd {
3615 uint32_t sessionId;
3616 tSirSmeDfsChannelList chan_list;
3617 uint32_t dfs_radar_status;
3618 int use_nol;
3619} tSirSmeDfsEventInd, *tpSirSmeDfsEventInd;
3620
3621typedef struct sSirChanChangeRequest {
3622 uint16_t messageType;
3623 uint16_t messageLen;
3624 uint8_t targetChannel;
Kiran Kumar Lokere999e58c2016-01-07 02:18:39 -08003625 uint8_t sec_ch_offset;
Kiran Kumar Lokere13644672016-02-29 15:40:10 -08003626 enum phy_ch_width ch_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003627 uint8_t center_freq_seg_0;
3628 uint8_t center_freq_seg_1;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303629 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003630 uint32_t dot11mode;
Bala Venkateshb39ed152017-12-26 19:35:27 +05303631 tSirNwType nw_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003632 tSirMacRateSet operational_rateset;
3633 tSirMacRateSet extended_rateset;
Arif Hussain671a1902017-03-17 09:08:32 -07003634 uint32_t cac_duration_ms;
3635 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003636} tSirChanChangeRequest, *tpSirChanChangeRequest;
3637
3638typedef struct sSirChanChangeResponse {
3639 uint8_t sessionId;
3640 uint8_t newChannelNumber;
3641 uint8_t channelChangeStatus;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003642} tSirChanChangeResponse, *tpSirChanChangeResponse;
3643
3644typedef struct sSirStartBeaconIndication {
3645 uint16_t messageType;
3646 uint16_t messageLen;
3647 uint8_t beaconStartStatus;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303648 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003649} tSirStartBeaconIndication, *tpSirStartBeaconIndication;
3650
3651/* additional IE type */
3652typedef enum tUpdateIEsType {
3653 eUPDATE_IE_NONE,
3654 eUPDATE_IE_PROBE_BCN,
3655 eUPDATE_IE_PROBE_RESP,
3656 eUPDATE_IE_ASSOC_RESP,
3657
3658 /* Add type above this line */
3659 /* this is used to reset all buffer */
3660 eUPDATE_IE_ALL,
3661 eUPDATE_IE_MAX
3662} eUpdateIEsType;
3663
3664/* Modify particular IE in addition IE for prob resp Bcn */
3665typedef struct sSirModifyIE {
Anurag Chouhan6d760662016-02-20 16:05:43 +05303666 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003667 uint16_t smeSessionId;
3668 bool notify;
3669 uint8_t ieID;
3670 uint8_t ieIDLen; /*ie length as per spec */
3671 uint16_t ieBufferlength;
3672 uint8_t *pIEBuffer;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08003673 int32_t oui_length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003674
3675} tSirModifyIE, *tpSirModifyIE;
3676
Kiran Kumar Lokerebc87bec2018-02-27 20:06:42 -08003677struct send_add_ba_req {
3678 uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
3679 struct addba_send_params param;
3680};
3681
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003682/* Message format for Update IE message sent to PE */
3683typedef struct sSirModifyIEsInd {
3684 uint16_t msgType;
3685 uint16_t msgLen;
3686 tSirModifyIE modifyIE;
3687 eUpdateIEsType updateType;
3688} tSirModifyIEsInd, *tpSirModifyIEsInd;
3689
3690/* Message format for Update IE message sent to PE */
3691typedef struct sSirUpdateIE {
Anurag Chouhan6d760662016-02-20 16:05:43 +05303692 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003693 uint16_t smeSessionId;
3694 bool append;
3695 bool notify;
3696 uint16_t ieBufferlength;
3697 uint8_t *pAdditionIEBuffer;
3698} tSirUpdateIE, *tpSirUpdateIE;
3699
3700/* Message format for Update IE message sent to PE */
3701typedef struct sSirUpdateIEsInd {
3702 uint16_t msgType;
3703 uint16_t msgLen;
3704 tSirUpdateIE updateIE;
3705 eUpdateIEsType updateType;
3706} tSirUpdateIEsInd, *tpSirUpdateIEsInd;
3707
3708/* Message format for requesting channel switch announcement to lower layers */
3709typedef struct sSirDfsCsaIeRequest {
3710 uint16_t msgType;
3711 uint16_t msgLen;
3712 uint8_t targetChannel;
3713 uint8_t csaIeRequired;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303714 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Amar Singhal5cccafe2017-02-15 12:42:58 -08003715 struct ch_params ch_params;
gaoleze2920bd2017-03-21 17:38:42 +08003716 uint8_t ch_switch_beacon_cnt;
gaolez76d2a162017-03-21 19:23:58 +08003717 uint8_t ch_switch_mode;
3718 uint8_t dfs_ch_switch_disable;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003719} tSirDfsCsaIeRequest, *tpSirDfsCsaIeRequest;
3720
3721/* Indication from lower layer indicating the completion of first beacon send
3722 * after the beacon template update
3723 */
3724typedef struct sSirFirstBeaconTxCompleteInd {
3725 uint16_t messageType; /* eWNI_SME_MISSED_BEACON_IND */
3726 uint16_t length;
3727 uint8_t bssIdx;
3728} tSirFirstBeaconTxCompleteInd, *tpSirFirstBeaconTxCompleteInd;
3729
3730typedef struct sSirSmeCSAIeTxCompleteRsp {
3731 uint8_t sessionId;
3732 uint8_t chanSwIeTxStatus;
3733} tSirSmeCSAIeTxCompleteRsp, *tpSirSmeCSAIeTxCompleteRsp;
3734
3735/* Thermal Mitigation*/
3736
3737typedef struct {
3738 uint16_t minTempThreshold;
3739 uint16_t maxTempThreshold;
3740} t_thermal_level_info, *tp_thermal_level_info;
3741
3742typedef enum {
3743 WLAN_WMA_THERMAL_LEVEL_0,
3744 WLAN_WMA_THERMAL_LEVEL_1,
3745 WLAN_WMA_THERMAL_LEVEL_2,
3746 WLAN_WMA_THERMAL_LEVEL_3,
3747 WLAN_WMA_MAX_THERMAL_LEVELS
3748} t_thermal_level;
3749
Poddar, Siddarth83905022016-04-16 17:56:08 -07003750#define WLAN_THROTTLE_DUTY_CYCLE_LEVEL_MAX (4)
3751
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003752typedef struct {
3753 /* Array of thermal levels */
3754 t_thermal_level_info thermalLevels[WLAN_WMA_MAX_THERMAL_LEVELS];
3755 uint8_t thermalCurrLevel;
3756 uint8_t thermalMgmtEnabled;
3757 uint32_t throttlePeriod;
Poddar, Siddarth83905022016-04-16 17:56:08 -07003758 uint8_t throttle_duty_cycle_tbl[WLAN_THROTTLE_DUTY_CYCLE_LEVEL_MAX];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003759} t_thermal_mgmt, *tp_thermal_mgmt;
3760
3761typedef struct sSirTxPowerLimit {
3762 /* Thermal limits for 2g and 5g */
3763 uint32_t txPower2g;
3764 uint32_t txPower5g;
3765} tSirTxPowerLimit;
3766
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +05303767enum bad_peer_thresh_levels {
3768 WLAN_WMA_IEEE80211_B_LEVEL = 0,
3769 WLAN_WMA_IEEE80211_AG_LEVEL,
3770 WLAN_WMA_IEEE80211_N_LEVEL,
3771 WLAN_WMA_IEEE80211_AC_LEVEL,
3772 WLAN_WMA_IEEE80211_AX_LEVEL,
3773 WLAN_WMA_IEEE80211_MAX_LEVEL,
3774};
3775
3776#define NUM_OF_RATE_THRESH_MAX (4)
3777struct t_bad_peer_info {
3778 uint32_t cond;
3779 uint32_t delta;
3780 uint32_t percentage;
3781 uint32_t thresh[NUM_OF_RATE_THRESH_MAX];
3782 uint32_t txlimit;
3783};
3784
3785struct t_bad_peer_txtcl_config {
3786 /* Array of thermal levels */
3787 struct t_bad_peer_info threshold[WLAN_WMA_IEEE80211_MAX_LEVEL];
3788 uint32_t enable;
3789 uint32_t period;
3790 uint32_t txq_limit;
3791 uint32_t tgt_backoff;
3792 uint32_t tgt_report_prd;
3793};
3794
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003795/* notify MODEM power state to FW */
3796typedef struct {
3797 uint32_t param;
3798} tSirModemPowerStateInd, *tpSirModemPowerStateInd;
3799
3800#ifdef WLAN_FEATURE_STATS_EXT
3801typedef struct {
3802 uint32_t vdev_id;
3803 uint32_t event_data_len;
3804 uint8_t event_data[];
3805} tSirStatsExtEvent, *tpSirStatsExtEvent;
3806#endif
3807
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003808typedef struct {
3809 uint32_t event_data_len;
3810 uint8_t event_data[];
3811} tSirNanEvent, *tpSirNanEvent;
Mahesh Kumar Kalikot Veetil919e01d2016-09-09 17:09:10 -07003812
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003813typedef struct sSirSmeRoamOffloadSynchInd {
3814 uint16_t messageType; /*eWNI_SME_ROAM_OFFLOAD_SYNCH_IND */
3815 uint16_t length;
3816 uint16_t beaconProbeRespOffset;
3817 uint16_t beaconProbeRespLength;
3818 uint16_t reassocRespOffset;
3819 uint16_t reassocRespLength;
Naveen Rawat14298b92015-11-25 16:27:41 -08003820 uint16_t reassoc_req_offset;
3821 uint16_t reassoc_req_length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003822 uint8_t isBeacon;
3823 uint8_t roamedVdevId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303824 struct qdf_mac_addr bssid;
Varun Reddy Yeturu28925b42016-02-08 07:18:50 -08003825 struct qdf_mac_addr self_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003826 int8_t txMgmtPower;
3827 uint32_t authStatus;
3828 uint8_t rssi;
3829 uint8_t roamReason;
3830 uint32_t chan_freq;
3831 uint8_t kck[SIR_KCK_KEY_LEN];
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05303832 uint32_t kek_len;
3833 uint8_t kek[SIR_KEK_KEY_LEN_FILS];
3834 uint32_t pmk_len;
3835 uint8_t pmk[SIR_PMK_LEN];
3836 uint8_t pmkid[SIR_PMKID_LEN];
3837 bool update_erp_next_seq_num;
3838 uint16_t next_erp_seq_num;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003839 uint8_t replay_ctr[SIR_REPLAY_CTR_LEN];
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08003840 void *add_bss_params;
3841 tpSirSmeJoinRsp join_rsp;
3842 uint16_t aid;
Naveen Rawat8cc23b02016-07-14 12:22:56 -07003843 struct sir_hw_mode_trans_ind hw_mode_trans_ind;
Naveen Rawat746a90b2017-06-07 15:16:35 -07003844 uint8_t nss;
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05303845 struct qdf_mac_addr dst_mac;
3846 struct qdf_mac_addr src_mac;
3847 uint16_t hlp_data_len;
3848 uint8_t hlp_data[FILS_MAX_HLP_DATA_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003849} roam_offload_synch_ind;
3850
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -08003851#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003852typedef struct sSirSmeRoamOffloadSynchCnf {
3853 uint8_t sessionId;
3854} tSirSmeRoamOffloadSynchCnf, *tpSirSmeRoamOffloadSynchCnf;
3855
3856typedef struct sSirSmeHOFailureInd {
3857 uint8_t sessionId;
3858} tSirSmeHOFailureInd, *tpSirSmeHOFailureInd;
3859
3860struct roam_offload_synch_fail {
3861 uint8_t session_id;
3862};
3863
3864#endif
3865
Wen Gong7952fbd2018-04-18 11:27:23 +08003866/**
3867 * struct sir_wisa_params - WISA Mode Parameters
3868 * @mode: WISA mode
3869 * @session_id: Session ID of vdev
3870 */
3871struct sir_wisa_params {
3872 bool mode;
3873 uint8_t vdev_id;
3874};
3875
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003876#ifdef FEATURE_WLAN_EXTSCAN
3877
Wen Gong7952fbd2018-04-18 11:27:23 +08003878#define WLAN_EXTSCAN_MAX_CHANNELS 36
3879#define WLAN_EXTSCAN_MAX_BUCKETS 16
Wen Gong7952fbd2018-04-18 11:27:23 +08003880#define WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS 64
3881
3882typedef enum {
3883 eSIR_EXTSCAN_INVALID,
3884 eSIR_EXTSCAN_START_RSP,
3885 eSIR_EXTSCAN_STOP_RSP,
3886 eSIR_EXTSCAN_CACHED_RESULTS_RSP,
3887 eSIR_EXTSCAN_SET_BSSID_HOTLIST_RSP,
3888 eSIR_EXTSCAN_RESET_BSSID_HOTLIST_RSP,
3889 eSIR_EXTSCAN_SET_SIGNIFICANT_WIFI_CHANGE_RSP,
3890 eSIR_EXTSCAN_RESET_SIGNIFICANT_WIFI_CHANGE_RSP,
3891
3892 eSIR_EXTSCAN_GET_CAPABILITIES_IND,
3893 eSIR_EXTSCAN_HOTLIST_MATCH_IND,
3894 eSIR_EXTSCAN_SIGNIFICANT_WIFI_CHANGE_RESULTS_IND,
3895 eSIR_EXTSCAN_CACHED_RESULTS_IND,
3896 eSIR_EXTSCAN_SCAN_RES_AVAILABLE_IND,
3897 eSIR_EXTSCAN_SCAN_PROGRESS_EVENT_IND,
3898 eSIR_EXTSCAN_FULL_SCAN_RESULT_IND,
3899 eSIR_EPNO_NETWORK_FOUND_IND,
3900 eSIR_PASSPOINT_NETWORK_FOUND_IND,
3901 eSIR_EXTSCAN_SET_SSID_HOTLIST_RSP,
3902 eSIR_EXTSCAN_RESET_SSID_HOTLIST_RSP,
3903
3904 /* Keep this last */
3905 eSIR_EXTSCAN_CALLBACK_TYPE_MAX,
3906} tSirExtScanCallbackType;
3907
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003908/**
3909 * typedef enum wifi_scan_flags - wifi scan flags
3910 * @WIFI_SCAN_FLAG_INTERRUPTED: Indicates that scan results are not complete
3911 * because probes were not sent on some channels
3912 */
3913typedef enum {
3914 WIFI_SCAN_FLAG_INTERRUPTED = 1,
3915} wifi_scan_flags;
3916
3917typedef enum {
3918 WIFI_BAND_UNSPECIFIED,
3919 WIFI_BAND_BG = 1, /* 2.4 GHz */
3920 WIFI_BAND_A = 2, /* 5 GHz without DFS */
3921 WIFI_BAND_ABG = 3, /* 2.4 GHz + 5 GHz; no DFS */
3922 WIFI_BAND_A_DFS_ONLY = 4, /* 5 GHz DFS only */
3923 /* 5 is reserved */
3924 WIFI_BAND_A_WITH_DFS = 6, /* 5 GHz with DFS */
3925 WIFI_BAND_ABG_WITH_DFS = 7, /* 2.4 GHz + 5 GHz with DFS */
3926
3927 /* Keep it last */
3928 WIFI_BAND_MAX
3929} tWifiBand;
3930
Mukul Sharma45114d92016-08-12 19:34:14 +05303931/**
3932 * enum wifi_extscan_event_type - extscan event type
3933 * @WIFI_EXTSCAN_RESULTS_AVAILABLE: reported when REPORT_EVENTS_EACH_SCAN is set
3934 * and a scan cycle completes. WIFI_SCAN_THRESHOLD_NUM_SCANS or
3935 * WIFI_SCAN_THRESHOLD_PERCENT can be reported instead if the
3936 * reason for the event is available; however, at most one of
3937 * these events should be reported per scan.
3938 * @WIFI_EXTSCAN_THRESHOLD_NUM_SCANS: can be reported when
3939 * REPORT_EVENTS_EACH_SCAN is not set and
3940 * report_threshold_num_scans is reached.
3941 * @WIFI_EXTSCAN_THRESHOLD_PERCENT: can be reported when REPORT_EVENTS_EACH_SCAN
3942 * is not set and report_threshold_percent is reached.
3943 * @WIFI_SCAN_DISABLED: reported when currently executing gscans are disabled
3944 * start_gscan will need to be called again in order to continue
3945 * scanning.
3946 * @WIFI_EXTSCAN_BUCKET_STARTED_EVENT: Bucket started event
3947 * This event is consumed in driver only.
3948 * @WIFI_EXTSCAN_CYCLE_STARTED_EVENT: Cycle started event.
3949 * This event is consumed in driver only.
3950 * @WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT: Cycle complete event. This event
3951 * triggers @WIFI_EXTSCAN_RESULTS_AVAILABLE to the user space.
3952 */
3953enum wifi_extscan_event_type {
Mukul Sharmafa937be2016-08-12 18:13:36 +05303954 WIFI_EXTSCAN_RESULTS_AVAILABLE,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303955 WIFI_EXTSCAN_THRESHOLD_NUM_SCANS,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303956 WIFI_EXTSCAN_THRESHOLD_PERCENT,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303957 WIFI_SCAN_DISABLED,
3958
Mukul Sharmafa937be2016-08-12 18:13:36 +05303959 WIFI_EXTSCAN_BUCKET_STARTED_EVENT = 0x10,
3960 WIFI_EXTSCAN_CYCLE_STARTED_EVENT,
3961 WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT,
Mukul Sharma45114d92016-08-12 19:34:14 +05303962};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003963
3964/**
3965 * enum extscan_configuration_flags - extscan config flags
3966 * @EXTSCAN_LP_EXTENDED_BATCHING: extended batching
3967 */
3968enum extscan_configuration_flags {
3969 EXTSCAN_LP_EXTENDED_BATCHING = 0x00000001,
3970};
3971
3972typedef struct {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003973 uint32_t requestId;
3974 uint8_t sessionId;
3975} tSirGetExtScanCapabilitiesReqParams, *tpSirGetExtScanCapabilitiesReqParams;
3976
3977/**
3978 * struct ext_scan_capabilities_response - extscan capabilities response data
3979 * @requestId: request identifier
3980 * @status: status
3981 * @max_scan_cache_size: total space allocated for scan (in bytes)
3982 * @max_scan_buckets: maximum number of channel buckets
3983 * @max_ap_cache_per_scan: maximum number of APs that can be stored per scan
3984 * @max_rssi_sample_size: number of RSSI samples used for averaging RSSI
3985 * @ax_scan_reporting_threshold: max possible report_threshold
3986 * @max_hotlist_bssids: maximum number of entries for hotlist APs
3987 * @max_significant_wifi_change_aps: maximum number of entries for
3988 * significant wifi change APs
3989 * @max_bssid_history_entries: number of BSSID/RSSI entries that device can hold
3990 * @max_hotlist_ssids: maximum number of entries for hotlist SSIDs
3991 * @max_number_epno_networks: max number of epno entries
3992 * @max_number_epno_networks_by_ssid: max number of epno entries
3993 * if ssid is specified, that is, epno entries for
3994 * which an exact match is required,
3995 * or entries corresponding to hidden ssids
3996 * @max_number_of_white_listed_ssid: max number of white listed SSIDs
Padma, Santhosh Kumar1ac02402016-11-02 18:04:14 +05303997 * @max_number_of_black_listed_bssid: max number of black listed BSSIDs
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003998 */
3999struct ext_scan_capabilities_response {
4000 uint32_t requestId;
4001 uint32_t status;
4002
4003 uint32_t max_scan_cache_size;
4004 uint32_t max_scan_buckets;
4005 uint32_t max_ap_cache_per_scan;
4006 uint32_t max_rssi_sample_size;
4007 uint32_t max_scan_reporting_threshold;
4008
4009 uint32_t max_hotlist_bssids;
4010 uint32_t max_significant_wifi_change_aps;
4011
4012 uint32_t max_bssid_history_entries;
4013 uint32_t max_hotlist_ssids;
4014 uint32_t max_number_epno_networks;
4015 uint32_t max_number_epno_networks_by_ssid;
4016 uint32_t max_number_of_white_listed_ssid;
Padma, Santhosh Kumar1ac02402016-11-02 18:04:14 +05304017 uint32_t max_number_of_black_listed_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004018};
4019
4020typedef struct {
4021 uint32_t requestId;
4022 uint8_t sessionId;
4023
4024 /*
4025 * 1 - return cached results and flush it
4026 * 0 - return cached results and do not flush
4027 */
4028 bool flush;
4029} tSirExtScanGetCachedResultsReqParams, *tpSirExtScanGetCachedResultsReqParams;
4030
4031typedef struct {
4032 uint32_t requestId;
4033 uint32_t status;
4034} tSirExtScanGetCachedResultsRspParams, *tpSirExtScanGetCachedResultsRspParams;
4035
4036typedef struct {
4037 /* Time of discovery */
4038 uint64_t ts;
4039
4040 /* Null terminated SSID */
4041 uint8_t ssid[SIR_MAC_MAX_SSID_LENGTH + 1];
4042
Anurag Chouhan6d760662016-02-20 16:05:43 +05304043 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004044
4045 /* Frequency in MHz */
4046 uint32_t channel;
4047
4048 /* RSSI in dBm */
4049 int32_t rssi;
4050
4051 /* RTT in nanoseconds */
4052 uint32_t rtt;
4053
4054 /* Standard deviation in rtt */
4055 uint32_t rtt_sd;
4056
4057 /* Period advertised in the beacon */
4058 uint16_t beaconPeriod;
4059
4060 /* Capabilities advertised in the beacon */
4061 uint16_t capability;
4062
4063 uint16_t ieLength;
4064
4065 uint8_t ieData[];
4066} tSirWifiScanResult, *tpSirWifiScanResult;
4067
4068/**
4069 * struct extscan_hotlist_match - extscan hotlist match
4070 * @requestId: request identifier
4071 * @numOfAps: number of bssids retrieved by the scan
4072 * @moreData: 0 - for last fragment
4073 * 1 - still more fragment(s) coming
4074 * @ap: wifi scan result
4075 */
4076struct extscan_hotlist_match {
4077 uint32_t requestId;
4078 bool moreData;
4079 bool ap_found;
4080 uint32_t numOfAps;
4081 tSirWifiScanResult ap[];
4082};
4083
4084/**
4085 * struct extscan_cached_scan_result - extscan cached scan result
4086 * @scan_id: a unique identifier for the scan unit
4087 * @flags: a bitmask with additional information about scan
4088 * @num_results: number of bssids retrieved by the scan
Mukul Sharmaf7cb3ab2016-08-12 19:53:52 +05304089 * @buckets_scanned: bitmask of buckets scanned in current extscan cycle
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004090 * @ap: wifi scan bssid results info
4091 */
4092struct extscan_cached_scan_result {
4093 uint32_t scan_id;
4094 uint32_t flags;
4095 uint32_t num_results;
Mukul Sharmaf7cb3ab2016-08-12 19:53:52 +05304096 uint32_t buckets_scanned;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004097 tSirWifiScanResult *ap;
4098};
4099
4100/**
4101 * struct tSirWifiScanResultEvent - wifi scan result event
4102 * @requestId: request identifier
4103 * @ap_found: flag to indicate ap found or not
4104 * true: AP was found
4105 * false: AP was lost
4106 * @numOfAps: number of aps
4107 * @moreData: more data
4108 * @ap: bssid information
4109 *
4110 */
4111typedef struct {
4112 uint32_t requestId;
4113 bool ap_found;
4114 uint32_t numOfAps;
4115 bool moreData;
4116 tSirWifiScanResult ap[];
4117} tSirWifiScanResultEvent, *tpSirWifiScanResultEvent;
4118
4119/**
4120 * struct extscan_cached_scan_results - extscan cached scan results
4121 * @request_id: request identifier
4122 * @more_data: 0 - for last fragment
4123 * 1 - still more fragment(s) coming
4124 * @num_scan_ids: number of scan ids
4125 * @result: wifi scan result
4126 */
4127struct extscan_cached_scan_results {
4128 uint32_t request_id;
4129 bool more_data;
4130 uint32_t num_scan_ids;
4131 struct extscan_cached_scan_result *result;
4132};
4133
4134
4135/**
4136 * struct tSirWifiFullScanResultEvent - extscan full scan event
4137 * @request_id: request identifier
4138 * @moreData: 0 - for last fragment
4139 * 1 - still more fragment(s) coming
4140 * @ap: bssid info
4141 *
4142 * Reported when each probe response is received, if reportEvents
4143 * enabled in tSirWifiScanCmdReqParams
4144 */
4145typedef struct {
4146 uint32_t requestId;
4147 bool moreData;
4148 tSirWifiScanResult ap;
4149} tSirWifiFullScanResultEvent, *tpSirWifiFullScanResultEvent;
4150
4151/**
4152 * struct pno_match_found - epno match found
4153 * @request_id: request identifier
4154 * @moreData: 0 - for last fragment
4155 * 1 - still more fragment(s) coming
4156 * @num_results: number of bssids, driver sends this event to upper layer
4157 * for every beacon, hence %num_results is always set to 1.
4158 * @ap: bssid info
4159 *
4160 * Reported when each beacon probe response is received with
4161 * epno match found tag.
4162 */
4163struct pno_match_found {
4164 uint32_t request_id;
4165 bool more_data;
4166 uint32_t num_results;
4167 tSirWifiScanResult ap[];
4168};
4169
4170typedef struct {
4171 /* Frequency in MHz */
4172 uint32_t channel;
4173
4174 uint32_t dwellTimeMs;
4175
4176 /* 0 => active
4177 1 => passive scan; ignored for DFS */
4178 bool passive;
4179
4180 uint8_t chnlClass;
4181} tSirWifiScanChannelSpec, *tpSirWifiScanChannelSpec;
4182
4183/**
4184 * struct tSirWifiScanBucketSpec - wifi scan bucket spec
4185 * @bucket: bucket identifier
4186 * @band: wifi band
4187 * @period: Desired period, in millisecond; if this is too
4188 * low, the firmware should choose to generate results as fast as
4189 * it can instead of failing the command byte
4190 * for exponential backoff bucket this is the min_period
4191 * @reportEvents: 0 => normal reporting (reporting rssi history
4192 * only, when rssi history buffer is % full)
4193 * 1 => same as 0 + report a scan completion event after scanning
4194 * this bucket
4195 * 2 => same as 1 + forward scan results
4196 * (beacons/probe responses + IEs) in real time to HAL
4197 * @max_period: if max_period is non zero or different than period,
4198 * then this bucket is an exponential backoff bucket and
4199 * the scan period will grow exponentially as per formula:
4200 * actual_period(N) = period ^ (N/(step_count+1)) to a
4201 * maximum period of max_period
4202 * @exponent: for exponential back off bucket: multiplier:
4203 * new_period = old_period * exponent
4204 * @step_count: for exponential back off bucket, number of scans performed
4205 * at a given period and until the exponent is applied
4206 * @numChannels: channels to scan; these may include DFS channels
4207 * Note that a given channel may appear in multiple buckets
4208 * @min_dwell_time_active: per bucket minimum active dwell time
4209 * @max_dwell_time_active: per bucket maximum active dwell time
4210 * @min_dwell_time_passive: per bucket minimum passive dwell time
4211 * @max_dwell_time_passive: per bucket maximum passive dwell time
4212 * @channels: Channel list
4213 */
4214typedef struct {
4215 uint8_t bucket;
4216 tWifiBand band;
4217 uint32_t period;
4218 uint32_t reportEvents;
4219 uint32_t max_period;
4220 uint32_t exponent;
4221 uint32_t step_count;
4222 uint32_t numChannels;
4223
4224 uint32_t min_dwell_time_active;
4225 uint32_t max_dwell_time_active;
4226 uint32_t min_dwell_time_passive;
4227 uint32_t max_dwell_time_passive;
4228 tSirWifiScanChannelSpec channels[WLAN_EXTSCAN_MAX_CHANNELS];
4229} tSirWifiScanBucketSpec, *tpSirWifiScanBucketSpec;
4230
4231/**
4232 * struct tSirWifiScanCmdReqParams - wifi scan command request params
4233 * @basePeriod: base timer period
4234 * @maxAPperScan: max ap per scan
4235 * @report_threshold_percent: report threshold
4236 * in %, when buffer is this much full, wake up host
4237 * @report_threshold_num_scans: report threshold number of scans
4238 * in number of scans, wake up host after these many scans
4239 * @requestId: request id
4240 * @sessionId: session id
4241 * @numBuckets: number of buckets
4242 * @min_dwell_time_active: per bucket minimum active dwell time
4243 * @max_dwell_time_active: per bucket maximum active dwell time
4244 * @min_dwell_time_passive: per bucket minimum passive dwell time
4245 * @max_dwell_time_passive: per bucket maximum passive dwell time
4246 * @configuration_flags: configuration flags
4247 * @buckets: buckets array
4248 */
4249typedef struct {
4250 uint32_t basePeriod;
4251 uint32_t maxAPperScan;
4252
4253 uint32_t report_threshold_percent;
4254 uint32_t report_threshold_num_scans;
4255
4256 uint32_t requestId;
4257 uint8_t sessionId;
4258 uint32_t numBuckets;
4259
4260 uint32_t min_dwell_time_active;
4261 uint32_t max_dwell_time_active;
4262 uint32_t min_dwell_time_passive;
4263 uint32_t max_dwell_time_passive;
4264 uint32_t configuration_flags;
Sandeep Puligillaf5ccbf62018-03-26 16:37:05 -07004265 enum scan_dwelltime_adaptive_mode extscan_adaptive_dwell_mode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004266 tSirWifiScanBucketSpec buckets[WLAN_EXTSCAN_MAX_BUCKETS];
4267} tSirWifiScanCmdReqParams, *tpSirWifiScanCmdReqParams;
4268
4269/**
4270 * struct sir_extscan_generic_response -
4271 * Generic ExtScan Response structure
4272 * @request_id: ID of the request
4273 * @status: operation status returned by firmware
4274 */
4275struct sir_extscan_generic_response {
4276 uint32_t request_id;
4277 uint32_t status;
4278};
4279
4280typedef struct {
4281 uint32_t requestId;
4282 uint8_t sessionId;
4283} tSirExtScanStopReqParams, *tpSirExtScanStopReqParams;
4284
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004285typedef struct {
Anurag Chouhan6d760662016-02-20 16:05:43 +05304286 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004287 uint32_t channel;
4288 uint32_t numOfRssi;
4289
4290 /* Rssi history in db */
4291 int32_t rssi[];
4292} tSirWifiSignificantChange, *tpSirWifiSignificantChange;
4293
4294typedef struct {
4295 uint32_t requestId;
4296
4297 bool moreData;
4298 uint32_t numResults;
4299 tSirWifiSignificantChange ap[];
4300} tSirWifiSignificantChangeEvent, *tpSirWifiSignificantChangeEvent;
4301
4302typedef struct {
4303 uint32_t requestId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004304 uint32_t numResultsAvailable;
4305} tSirExtScanResultsAvailableIndParams, *tpSirExtScanResultsAvailableIndParams;
4306
4307typedef struct {
4308 uint32_t requestId;
4309 uint32_t status;
4310 uint8_t scanEventType;
Mukul Sharmafa937be2016-08-12 18:13:36 +05304311 uint32_t buckets_scanned;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004312} tSirExtScanOnScanEventIndParams, *tpSirExtScanOnScanEventIndParams;
4313
Mukul Sharmae8c919f2016-10-02 20:35:15 +05304314#define MAX_EPNO_NETWORKS 64
4315
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004316/**
4317 * struct wifi_epno_network - enhanced pno network block
4318 * @ssid: ssid
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004319 * @flags: WIFI_PNO_FLAG_XXX
4320 * @auth_bit_field: auth bit field for matching WPA IE
4321 */
4322struct wifi_epno_network {
4323 tSirMacSSid ssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004324 uint8_t flags;
4325 uint8_t auth_bit_field;
4326};
4327
4328/**
4329 * struct wifi_epno_params - enhanced pno network params
Mukul Sharmae8c919f2016-10-02 20:35:15 +05304330 * @request_id: request id number
4331 * @session_id: session_id number
4332 * @min_5ghz_rssi: minimum 5GHz RSSI for a BSSID to be considered
4333 * @min_24ghz_rssi: minimum 2.4GHz RSSI for a BSSID to be considered
4334 * @initial_score_max: maximum score that a network can have before bonuses
4335 * @current_connection_bonus: only report when there is a network's score this
4336 * much higher than the current connection
4337 * @same_network_bonus: score bonus for all n/w with the same network flag
4338 * @secure_bonus: score bonus for networks that are not open
4339 * @band_5ghz_bonus: 5GHz RSSI score bonus (applied to all 5GHz networks)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004340 * @num_networks: number of ssids
Mukul Sharmae8c919f2016-10-02 20:35:15 +05304341 * @networks: EPNO networks
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004342 */
4343struct wifi_epno_params {
4344 uint32_t request_id;
4345 uint32_t session_id;
Mukul Sharmae8c919f2016-10-02 20:35:15 +05304346 uint32_t min_5ghz_rssi;
4347 uint32_t min_24ghz_rssi;
4348 uint32_t initial_score_max;
4349 uint32_t current_connection_bonus;
4350 uint32_t same_network_bonus;
4351 uint32_t secure_bonus;
4352 uint32_t band_5ghz_bonus;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004353 uint32_t num_networks;
4354 struct wifi_epno_network networks[];
4355};
4356
Jeff Johnson96f93a32016-11-18 11:02:24 -08004357#define SIR_PASSPOINT_LIST_MAX_NETWORKS 8
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004358#define SIR_PASSPOINT_REALM_LEN 256
4359#define SIR_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM 16
4360#define SIR_PASSPOINT_PLMN_LEN 3
4361/**
4362 * struct wifi_passpoint_network - passpoint network block
4363 * @id: identifier of this network block
4364 * @realm: null terminated UTF8 encoded realm, 0 if unspecified
4365 * @roaming_consortium_ids: roaming consortium ids to match, 0s if unspecified
4366 * @plmn: mcc/mnc combination as per rules, 0s if unspecified
4367 */
4368struct wifi_passpoint_network {
4369 uint32_t id;
4370 uint8_t realm[SIR_PASSPOINT_REALM_LEN];
4371 int64_t roaming_consortium_ids[SIR_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM];
4372 uint8_t plmn[SIR_PASSPOINT_PLMN_LEN];
4373};
4374
4375/**
4376 * struct wifi_passpoint_req - passpoint request
4377 * @request_id: request identifier
4378 * @num_networks: number of networks
4379 * @networks: passpoint networks
4380 */
4381struct wifi_passpoint_req {
4382 uint32_t request_id;
4383 uint32_t session_id;
4384 uint32_t num_networks;
4385 struct wifi_passpoint_network networks[];
4386};
4387
4388/**
4389 * struct wifi_passpoint_match - wifi passpoint network match
4390 * @id: network block identifier for the matched network
4391 * @anqp_len: length of ANQP blob
4392 * @ap: scan result, with channel and beacon information
4393 * @anqp: ANQP data, in the information_element format
4394 */
4395struct wifi_passpoint_match {
4396 uint32_t request_id;
4397 uint32_t id;
4398 uint32_t anqp_len;
4399 tSirWifiScanResult ap;
4400 uint8_t anqp[];
4401};
4402#endif /* FEATURE_WLAN_EXTSCAN */
4403
4404#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
4405typedef struct {
4406 uint32_t timer_val;
4407} tSirAutoShutdownCmdParams;
4408
4409typedef struct {
4410 uint32_t shutdown_reason;
4411} tSirAutoShutdownEvtParams;
4412#endif
4413
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05304414#ifdef WLAN_POWER_DEBUGFS
4415/**
4416 * struct power_stats_response - Power stats response
4417 * @cumulative_sleep_time_ms: cumulative sleep time in ms
4418 * @cumulative_total_on_time_ms: total awake time in ms
4419 * @deep_sleep_enter_counter: deep sleep enter counter
4420 * @last_deep_sleep_enter_tstamp_ms: last deep sleep enter timestamp
4421 * @debug_register_fmt: debug registers format
4422 * @num_debug_register: number of debug registers
4423 * @debug_registers: Pointer to the debug registers buffer
4424 */
4425struct power_stats_response {
4426 uint32_t cumulative_sleep_time_ms;
4427 uint32_t cumulative_total_on_time_ms;
4428 uint32_t deep_sleep_enter_counter;
4429 uint32_t last_deep_sleep_enter_tstamp_ms;
4430 uint32_t debug_register_fmt;
4431 uint32_t num_debug_register;
4432 uint32_t *debug_registers;
4433};
4434#endif
4435
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +05304436/**
4437 * struct lfr_firmware_status - LFR status in firmware
4438 * @is_disabled: Is LFR disabled in FW
4439 * @disable_lfr_event: Disable attempt done in FW
4440 */
4441struct lfr_firmware_status {
4442 uint32_t is_disabled;
4443 struct completion disable_lfr_event;
4444};
4445
4446/**
4447 * struct rso_cmd_status - RSO Command status
4448 * @vdev_id: Vdev ID for which RSO command sent
4449 * @status: Status of RSO command sent to FW
4450 */
4451struct rso_cmd_status {
4452 uint32_t vdev_id;
4453 bool status;
4454};
4455
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004456typedef struct {
4457 uint8_t oui[WIFI_SCANNING_MAC_OUI_LENGTH];
Rajeev Kumar Sirasanagandla686abd92017-06-08 18:09:01 +05304458 uint32_t vdev_id;
4459 bool enb_probe_req_sno_randomization;
Rajeev Kumar Sirasanagandlaaec0b082017-06-21 11:59:41 +05304460 struct probe_req_whitelist_attr ie_whitelist;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004461} tSirScanMacOui, *tpSirScanMacOui;
4462
4463enum {
4464 SIR_AP_RX_DATA_OFFLOAD = 0x00,
4465 SIR_STA_RX_DATA_OFFLOAD = 0x01,
4466};
4467
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07004468/**
Naveen Rawata410c5a2016-09-19 14:22:33 -07004469 * struct sir_set_vdev_ies_per_band
4470 * @msg_type: message type
4471 * @len: message length
4472 * @vdev_id: vdev id
4473 *
4474 * Message wrapper structure for eWNI_SME_SET_VDEV_IES_PER_BAND.
4475 */
4476struct sir_set_vdev_ies_per_band {
4477 uint16_t msg_type;
4478 uint16_t len;
4479 uint32_t vdev_id;
4480};
4481
4482/**
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07004483 * struct sir_set_ht_vht_cfg - ht, vht IE config
4484 * @msg_type: message type
4485 * @len: message length
4486 * @pdev_id: pdev id
4487 * @nss: Nss value
4488 * @dot11mode: Dot11 mode.
4489 *
4490 * Message wrapper structure for set HT/VHT IE req.
4491 */
4492struct sir_set_ht_vht_cfg {
4493 uint16_t msg_type;
4494 uint16_t len;
4495 uint32_t pdev_id;
4496 uint32_t nss;
4497 uint32_t dot11mode;
4498};
4499
Qiwei Cai3719efe2018-06-11 21:09:29 +08004500#define WIFI_INVALID_PEER_ID (-1)
4501#define WIFI_INVALID_VDEV_ID (-1)
4502#define WIFI_MAX_AC (4)
4503
4504typedef struct {
4505 uint32_t paramId;
4506 uint8_t ifaceId;
4507 uint32_t rspId;
4508 uint32_t moreResultToFollow;
4509 uint32_t nr_received;
4510 union {
4511 uint32_t num_peers;
4512 uint32_t num_radio;
4513 };
4514
4515 uint32_t peer_event_number;
4516 /* Variable length field - Do not add anything after this */
4517 uint8_t results[0];
4518} tSirLLStatsResults, *tpSirLLStatsResults;
4519
4520#ifdef WLAN_FEATURE_LINK_LAYER_STATS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004521/*---------------------------------------------------------------------------
4522 WLAN_HAL_LL_NOTIFY_STATS
4523 ---------------------------------------------------------------------------*/
4524
4525/******************************LINK LAYER Statistics**********************/
4526
4527typedef int tSirWifiRadio;
4528typedef int tSirWifiChannel;
4529typedef int tSirwifiTxRate;
4530
Qiwei Cai3719efe2018-06-11 21:09:29 +08004531typedef struct {
4532 uint32_t reqId;
4533 uint8_t staId;
4534 uint32_t mpduSizeThreshold;
4535 uint32_t aggressiveStatisticsGathering;
4536} tSirLLStatsSetReq, *tpSirLLStatsSetReq;
4537
4538typedef struct {
4539 uint32_t reqId;
4540 uint8_t staId;
4541 uint32_t paramIdMask;
4542} tSirLLStatsGetReq, *tpSirLLStatsGetReq;
4543
4544typedef struct {
4545 uint32_t reqId;
4546 uint8_t staId;
4547 uint32_t statsClearReqMask;
4548 uint8_t stopReq;
4549} tSirLLStatsClearReq, *tpSirLLStatsClearReq;
4550
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004551/* channel operating width */
4552typedef enum {
4553 WIFI_CHAN_WIDTH_20 = 0,
4554 WIFI_CHAN_WIDTH_40 = 1,
4555 WIFI_CHAN_WIDTH_80 = 2,
4556 WIFI_CHAN_WIDTH_160 = 3,
4557 WIFI_CHAN_WIDTH_80P80 = 4,
4558 WIFI_CHAN_WIDTH_5 = 5,
4559 WIFI_CHAN_WIDTH_10 = 6,
4560} tSirWifiChannelWidth;
4561
4562typedef enum {
4563 WIFI_DISCONNECTED = 0,
4564 WIFI_AUTHENTICATING = 1,
4565 WIFI_ASSOCIATING = 2,
4566 WIFI_ASSOCIATED = 3,
4567 WIFI_EAPOL_STARTED = 4, /* if done by firmware/driver */
4568 WIFI_EAPOL_COMPLETED = 5, /* if done by firmware/driver */
4569} tSirWifiConnectionState;
4570
4571typedef enum {
4572 WIFI_ROAMING_IDLE = 0,
4573 WIFI_ROAMING_ACTIVE = 1,
4574} tSirWifiRoamState;
4575
4576typedef enum {
4577 WIFI_INTERFACE_STA = 0,
4578 WIFI_INTERFACE_SOFTAP = 1,
4579 WIFI_INTERFACE_IBSS = 2,
4580 WIFI_INTERFACE_P2P_CLIENT = 3,
4581 WIFI_INTERFACE_P2P_GO = 4,
4582 WIFI_INTERFACE_NAN = 5,
4583 WIFI_INTERFACE_MESH = 6,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -07004584 WIFI_INTERFACE_NDI = 7,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004585} tSirWifiInterfaceMode;
4586
4587/* set for QOS association */
4588#define WIFI_CAPABILITY_QOS 0x00000001
4589/* set for protected assoc (802.11 beacon frame control protected bit set) */
4590#define WIFI_CAPABILITY_PROTECTED 0x00000002
4591/* set if 802.11 Extended Capabilities element interworking bit is set */
4592#define WIFI_CAPABILITY_INTERWORKING 0x00000004
4593/* set for HS20 association */
4594#define WIFI_CAPABILITY_HS20 0x00000008
4595/* set is 802.11 Extended Capabilities element UTF-8 SSID bit is set */
4596#define WIFI_CAPABILITY_SSID_UTF8 0x00000010
4597/* set is 802.11 Country Element is present */
4598#define WIFI_CAPABILITY_COUNTRY 0x00000020
4599
4600typedef struct {
4601 /* tSirWifiInterfaceMode */
4602 /* interface mode */
4603 uint8_t mode;
4604 /* interface mac address (self) */
Anurag Chouhan6d760662016-02-20 16:05:43 +05304605 struct qdf_mac_addr macAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004606 /* tSirWifiConnectionState */
4607 /* connection state (valid for STA, CLI only) */
4608 uint8_t state;
4609 /* tSirWifiRoamState */
4610 /* roaming state */
4611 uint32_t roaming;
4612 /* WIFI_CAPABILITY_XXX (self) */
4613 uint32_t capabilities;
4614 /* null terminated SSID */
4615 uint8_t ssid[33];
4616 /* bssid */
Anurag Chouhan6d760662016-02-20 16:05:43 +05304617 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004618 /* country string advertised by AP */
4619 uint8_t apCountryStr[WNI_CFG_COUNTRY_CODE_LEN];
4620 /* country string for this association */
4621 uint8_t countryStr[WNI_CFG_COUNTRY_CODE_LEN];
4622} tSirWifiInterfaceInfo, *tpSirWifiInterfaceInfo;
4623
4624/* channel information */
4625typedef struct {
4626 /* channel width (20, 40, 80, 80+80, 160) */
4627 tSirWifiChannelWidth width;
4628 /* primary 20 MHz channel */
4629 tSirWifiChannel centerFreq;
4630 /* center frequency (MHz) first segment */
4631 tSirWifiChannel centerFreq0;
4632 /* center frequency (MHz) second segment */
4633 tSirWifiChannel centerFreq1;
4634} tSirWifiChannelInfo, *tpSirWifiChannelInfo;
4635
4636/* wifi rate info */
4637typedef struct {
4638 /* 0: OFDM, 1:CCK, 2:HT 3:VHT 4..7 reserved */
4639 uint32_t preamble:3;
4640 /* 0:1x1, 1:2x2, 3:3x3, 4:4x4 */
4641 uint32_t nss:2;
4642 /* 0:20MHz, 1:40Mhz, 2:80Mhz, 3:160Mhz */
4643 uint32_t bw:3;
4644 /* OFDM/CCK rate code would be as per ieee std in units of 0.5mbps */
4645 /* HT/VHT it would be mcs index */
4646 uint32_t rateMcsIdx:8;
4647 /* reserved */
4648 uint32_t reserved:16;
4649 /* units of 100 Kbps */
4650 uint32_t bitrate;
4651} tSirWifiRate, *tpSirWifiRate;
4652
4653/* channel statistics */
4654typedef struct {
4655 /* channel */
4656 tSirWifiChannelInfo channel;
4657 /* msecs the radio is awake (32 bits number accruing over time) */
4658 uint32_t onTime;
4659 /* msecs the CCA register is busy (32 bits number accruing over time) */
4660 uint32_t ccaBusyTime;
4661} tSirWifiChannelStats, *tpSirWifiChannelStats;
4662
Srinivas Girigowda458f2282016-10-25 11:27:52 -07004663#define MAX_TPC_LEVELS 64
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004664/* radio statistics */
4665typedef struct {
4666 /* wifi radio (if multiple radio supported) */
4667 tSirWifiRadio radio;
4668 /* msecs the radio is awake (32 bits number accruing over time) */
4669 uint32_t onTime;
4670 /* msecs the radio is transmitting
4671 * (32 bits number accruing over time)
4672 */
4673 uint32_t txTime;
4674 /* msecs the radio is in active receive
4675 *(32 bits number accruing over time)
4676 */
4677 uint32_t rxTime;
4678 /* msecs the radio is awake due to all scan
4679 * (32 bits number accruing over time)
4680 */
4681 uint32_t onTimeScan;
4682 /* msecs the radio is awake due to NAN
4683 * (32 bits number accruing over time)
4684 */
4685 uint32_t onTimeNbd;
4686 /* msecs the radio is awake due to Gscan
4687 * (32 bits number accruing over time)
4688 */
4689 uint32_t onTimeGscan;
4690 /* msecs the radio is awake due to roam?scan
4691 * (32 bits number accruing over time)
4692 */
4693 uint32_t onTimeRoamScan;
4694 /* msecs the radio is awake due to PNO scan
4695 * (32 bits number accruing over time)
4696 */
4697 uint32_t onTimePnoScan;
4698 /* msecs the radio is awake due to HS2.0 scans and GAS exchange
4699 * (32 bits number accruing over time)
4700 */
4701 uint32_t onTimeHs20;
Srinivas Girigowdaad874a82016-10-25 14:08:00 -07004702
4703 /* tx time (in milliseconds) per TPC level (0.5 dBm) */
4704 uint32_t total_num_tx_power_levels;
4705 uint32_t *tx_time_per_power_level;
4706
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004707 /* number of channels */
4708 uint32_t numChannels;
Srinivas Girigowda458f2282016-10-25 11:27:52 -07004709
4710 /* tx time (in milliseconds) per TPC level (0.5 dBm) */
4711 uint32_t tx_time_per_tpc[MAX_TPC_LEVELS];
4712
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08004713 uint32_t on_time_host_scan;
4714 uint32_t on_time_lpi_scan;
4715
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004716 /* channel statistics tSirWifiChannelStats */
Srinivas Girigowda57b450e2016-10-27 21:00:46 -07004717 tSirWifiChannelStats *channels;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004718} tSirWifiRadioStat, *tpSirWifiRadioStat;
4719
4720/* per rate statistics */
4721typedef struct {
4722 /* rate information */
4723 tSirWifiRate rate;
4724 /* number of successfully transmitted data pkts (ACK rcvd) */
4725 uint32_t txMpdu;
4726 /* number of received data pkts */
4727 uint32_t rxMpdu;
4728 /* number of data packet losses (no ACK) */
4729 uint32_t mpduLost;
4730 /* total number of data pkt retries * */
4731 uint32_t retries;
4732 /* number of short data pkt retries */
4733 uint32_t retriesShort;
4734 /* number of long data pkt retries */
4735 uint32_t retriesLong;
4736} tSirWifiRateStat, *tpSirWifiRateStat;
4737
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004738/* wifi peer type */
4739typedef enum {
4740 WIFI_PEER_STA,
4741 WIFI_PEER_AP,
4742 WIFI_PEER_P2P_GO,
4743 WIFI_PEER_P2P_CLIENT,
4744 WIFI_PEER_NAN,
4745 WIFI_PEER_TDLS,
4746 WIFI_PEER_INVALID,
4747} tSirWifiPeerType;
4748
4749/* per peer statistics */
4750typedef struct {
4751 /* peer type (AP, TDLS, GO etc.) */
Dustin Brown877a5a92016-11-17 13:56:52 -08004752 enum wmi_peer_type type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004753 /* mac address */
Anurag Chouhan6d760662016-02-20 16:05:43 +05304754 struct qdf_mac_addr peerMacAddress;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004755 /* peer WIFI_CAPABILITY_XXX */
4756 uint32_t capabilities;
Zhang Qiana6e9c102016-12-22 16:47:24 +08004757 union {
4758 /* peer power saving mode */
4759 uint32_t power_saving;
4760 /* number of rates */
4761 uint32_t numRate;
4762 };
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004763 /* per rate statistics, number of entries = num_rate */
4764 tSirWifiRateStat rateStats[0];
4765} tSirWifiPeerInfo, *tpSirWifiPeerInfo;
4766
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004767/* Interface statistics - corresponding to 2nd most
4768 * LSB in wifi statistics bitmap for getting statistics
4769 */
4770typedef struct {
4771 /* current state of the interface */
4772 tSirWifiInterfaceInfo info;
Min Liuffb250d2018-07-11 17:35:32 +08004773
gaolezb432ed92017-03-16 18:40:04 +08004774 uint32_t rts_succ_cnt;
4775 uint32_t rts_fail_cnt;
4776 uint32_t ppdu_succ_cnt;
4777 uint32_t ppdu_fail_cnt;
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08004778
Min Liuffb250d2018-07-11 17:35:32 +08004779 /* link statistics */
4780 wmi_iface_link_stats link_stats;
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08004781
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004782 /* per ac data packet statistics */
Min Liuffb250d2018-07-11 17:35:32 +08004783 wmi_wmm_ac_stats ac_stats[WIFI_AC_MAX];
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08004784
4785 uint32_t num_offload_stats;
Min Liuffb250d2018-07-11 17:35:32 +08004786 wmi_iface_offload_stats offload_stats[WMI_OFFLOAD_STATS_TYPE_MAX];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004787} tSirWifiIfaceStat, *tpSirWifiIfaceStat;
4788
4789/* Peer statistics - corresponding to 3rd most LSB in
4790 * wifi statistics bitmap for getting statistics
4791 */
4792typedef struct {
4793 /* number of peers */
4794 uint32_t numPeers;
4795 /* per peer statistics */
4796 tSirWifiPeerInfo peerInfo[0];
4797} tSirWifiPeerStat, *tpSirWifiPeerStat;
4798
4799/* wifi statistics bitmap for getting statistics */
4800#define WMI_LINK_STATS_RADIO 0x00000001
4801#define WMI_LINK_STATS_IFACE 0x00000002
4802#define WMI_LINK_STATS_ALL_PEER 0x00000004
4803#define WMI_LINK_STATS_PER_PEER 0x00000008
4804
4805/* wifi statistics bitmap for clearing statistics */
4806/* all radio statistics */
4807#define WIFI_STATS_RADIO 0x00000001
4808/* cca_busy_time (within radio statistics) */
4809#define WIFI_STATS_RADIO_CCA 0x00000002
4810/* all channel statistics (within radio statistics) */
4811#define WIFI_STATS_RADIO_CHANNELS 0x00000004
4812/* all scan statistics (within radio statistics) */
4813#define WIFI_STATS_RADIO_SCAN 0x00000008
4814/* all interface statistics */
4815#define WIFI_STATS_IFACE 0x00000010
4816/* all tx rate statistics (within interface statistics) */
4817#define WIFI_STATS_IFACE_TXRATE 0x00000020
4818/* all ac statistics (within interface statistics) */
4819#define WIFI_STATS_IFACE_AC 0x00000040
4820/* all contention (min, max, avg) statistics (within ac statistics) */
4821#define WIFI_STATS_IFACE_CONTENTION 0x00000080
Mukul Sharma491021c2016-09-29 21:39:19 +05304822/* All peer stats on this interface */
4823#define WIFI_STATS_IFACE_ALL_PEER 0x00000100
4824/* Clear particular peer stats depending on the peer_mac */
4825#define WIFI_STATS_IFACE_PER_PEER 0x00000200
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004826
Zhang Qiana6e9c102016-12-22 16:47:24 +08004827/**
4828 * struct sir_wifi_iface_tx_fail - TX failure event
4829 * @tid: TX TID
4830 * @msdu_num: TX MSDU failed counter
4831 * @status: TX status from HTT message.
4832 * Only failure status will be involved.
4833 */
4834struct sir_wifi_iface_tx_fail {
4835 uint8_t tid;
4836 uint16_t msdu_num;
4837 enum htt_tx_status status;
4838};
4839
Zhang Qian73c348a2017-03-13 16:15:55 +08004840/**
4841 * struct sir_wifi_chan_cca_stats - channal CCA stats
4842 * @vdev_id: vdev ID
4843 * @idle_time: percentage of idle time, no TX, no RX, no interference
4844 * @tx_time: percentage of time transmitting packets
4845 * @rx_in_bss_time: percentage of time receiving packets in current BSS
4846 * @rx_out_bss_time: percentage of time receiving packets not in current BSS
4847 * @rx_busy_time: percentage of time interference detected
4848 * @rx_in_bad_cond_time: percentage of time receiving packets with errors
4849 * or packets flagged as retransmission or seqnum discontinued.
4850 * @tx_in_bad_cond_time: percentage of time the device transmitted packets
4851 * that haven't been ACKed.
4852 * @wlan_not_avail_time: percentage of time the chip is unable to
4853 * work in normal conditions.
4854 */
4855struct sir_wifi_chan_cca_stats {
4856 uint32_t vdev_id;
4857 uint32_t idle_time;
4858 uint32_t tx_time;
4859 uint32_t rx_in_bss_time;
4860 uint32_t rx_out_bss_time;
4861 uint32_t rx_busy_time;
4862 uint32_t rx_in_bad_cond_time;
4863 uint32_t tx_in_bad_cond_time;
4864 uint32_t wlan_not_avail_time;
4865};
4866
4867#define WIFI_MAX_CHAINS 8
4868
4869/**
4870 * struct sir_wifi_peer_signal_stats - peer signal stats
4871 * @vdev_id: vdev ID
4872 * @peer_id: peer ID
4873 * @per_ant_snr: per antenna SNR
4874 * @nf: peer background noise
Zhang Qian303ebe92017-05-18 13:59:07 +08004875 * @per_ant_rx_mpdus: MPDUs received per antenna
4876 * @per_ant_tx_mpdus: MPDUs transferred per antenna
4877 * @num_chain: valid chain count
Zhang Qian73c348a2017-03-13 16:15:55 +08004878 */
4879struct sir_wifi_peer_signal_stats {
4880 uint32_t vdev_id;
4881 uint32_t peer_id;
4882
4883 /* per antenna SNR in current bss */
4884 int32_t per_ant_snr[WIFI_MAX_CHAINS];
4885
4886 /* Background noise */
4887 int32_t nf[WIFI_MAX_CHAINS];
Zhang Qian303ebe92017-05-18 13:59:07 +08004888
4889 int32_t per_ant_rx_mpdus[WIFI_MAX_CHAINS];
4890 int32_t per_ant_tx_mpdus[WIFI_MAX_CHAINS];
4891 int32_t num_chain;
Zhang Qian73c348a2017-03-13 16:15:55 +08004892};
4893
4894#define WIFI_VDEV_NUM 4
4895#define WFIF_MCS_NUM 10
4896#define WIFI_AGGR_NUM 8
4897#define WIFI_DELAY_SIZE 11
4898
4899/**
4900 * struct sir_wifi_tx - per AC tx stats
4901 * @msdus: number of totoal MSDUs on MAC layer in the period
4902 * @mpdus: number of totoal MPDUs on MAC layer in the period
4903 * @ppdus: number of totoal PPDUs on PHY layer in the period
4904 * @bytes: bytes of tx data on MAC layer in the period
4905 * @drops: number of TX packets cancelled due to any reason in the period,
4906 * such as WMM limitation/bandwidth limitation/radio congestion
4907 * @drop_bytes: bytes of dropped TX packets in the period
4908 * @retries: number of unacked transmissions of MPDUs
4909 * @failed: number of packets have not been ACKed despite retried
4910 * @aggr_len: length of the MPDU aggregation size buffer
4911 * @mpdu_aggr_size: histogram of MPDU aggregation size
4912 * @success_mcs_len: length of success mcs buffer
4913 * @success_mcs: histogram of successed received MPDUs encoding rate
4914 * @fail_mcs_len: length of failed mcs buffer
4915 * @fail_mcs: histogram of failed received MPDUs encoding rate
4916 * @delay_len: length of the delay histofram buffer
4917 * @delay: histogram of delays on MAC layer
4918 */
4919struct sir_wifi_tx {
4920 uint32_t msdus;
4921 uint32_t mpdus;
4922 uint32_t ppdus;
4923 uint32_t bytes;
4924 uint32_t drops;
4925 uint32_t drop_bytes;
4926 uint32_t retries;
4927 uint32_t failed;
4928 uint32_t aggr_len;
4929 uint32_t *mpdu_aggr_size;
4930 uint32_t success_mcs_len;
4931 uint32_t *success_mcs;
4932 uint32_t fail_mcs_len;
4933 uint32_t *fail_mcs;
4934 uint32_t delay_len;
4935 uint32_t *delay;
4936};
4937
4938/**
4939 * struct sir_wifi_rx - per AC rx stats
4940 * @mpdus: number of RX packets on MAC layer
4941 * @bytes: bytes of RX packets on MAC layer
4942 * @ppdus: number of RX packets on PHY layer
4943 * @ppdu_bytes: bytes of RX packets on PHY layer
4944 * @mpdu_lost: number of discontinuity in seqnum
4945 * @mpdu_retry: number of RX packets flagged as retransmissions
4946 * @mpdu_dup: number of RX packets identified as duplicates
4947 * @mpdu_discard: number of RX packets discarded
4948 * @aggr_len: length of MPDU aggregation histogram buffer
4949 * @mpdu_aggr: histogram of MPDU aggregation size
4950 * @mcs_len: length of mcs histogram buffer
4951 * @mcs: histogram of encoding rate.
4952 */
4953struct sir_wifi_rx {
4954 uint32_t mpdus;
4955 uint32_t bytes;
4956 uint32_t ppdus;
4957 uint32_t ppdu_bytes;
4958 uint32_t mpdu_lost;
4959 uint32_t mpdu_retry;
4960 uint32_t mpdu_dup;
4961 uint32_t mpdu_discard;
4962 uint32_t aggr_len;
4963 uint32_t *mpdu_aggr;
4964 uint32_t mcs_len;
4965 uint32_t *mcs;
4966};
4967
4968/**
4969 * struct sir_wifi_ll_ext_wmm_ac_stats - stats for WMM AC
4970 * @type: WMM AC type
4971 * @tx_stats: pointer to TX stats
4972 * @rx_stats: pointer to RX stats
4973 */
4974struct sir_wifi_ll_ext_wmm_ac_stats {
4975 uint32_t type;
4976 struct sir_wifi_tx *tx_stats;
4977 struct sir_wifi_rx *rx_stats;
4978};
4979
Zhang Qian73c348a2017-03-13 16:15:55 +08004980/**
4981 * struct sir_wifi_ll_ext_peer_stats - per peer stats
4982 * @peer_id: peer ID
4983 * @vdev_id: VDEV ID
4984 * mac_address: MAC address
4985 * @sta_ps_inds: how many times STAs go to sleep
4986 * @sta_ps_durs: total sleep time of STAs (units in ms)
4987 * @rx_probe_reqs: number of probe requests received
4988 * @rx_oth_mgmts: number of other management frames received,
4989 * not including probe requests
4990 * @peer_signal_stat: signal stats
4991 * @ac_stats: WMM BE/BK/VI/VO stats
4992 */
4993struct sir_wifi_ll_ext_peer_stats {
4994 uint32_t peer_id;
4995 uint32_t vdev_id;
4996 tSirMacAddr mac_address;
4997 uint32_t sta_ps_inds;
4998 uint32_t sta_ps_durs;
4999 uint32_t rx_probe_reqs;
5000 uint32_t rx_oth_mgmts;
5001 struct sir_wifi_peer_signal_stats peer_signal_stats;
5002 struct sir_wifi_ll_ext_wmm_ac_stats ac_stats[WIFI_MAX_AC];
5003};
5004
5005/**
5006 * struct sir_wifi_ll_ext_stats - link layer stats report
5007 * @trigger_cond_id: Indicate what triggered this event.
5008 * 1: timeout. 2: threshold
5009 * @cca_chgd_bitmap: Bitmap to indicate changed channel CCA stats
5010 * which exceeded the thresholds
5011 * @sig_chgd_bitmap: Bitmap to indicate changed peer signal stats
5012 * which exceeded the thresholds
5013 * @tx_chgd_bitmap: Bitmap to indicate changed TX counters
5014 * which exceeded the thresholds
5015 * @rx_chgd_bitmap: Bitmap to indicate changed RX counters
5016 * which exceeded the thresholds
5017 * @chan_cca_stats: channel CCA stats
5018 * @peer_signal_stats: peer signal stats
5019 * @tx_mpdu_aggr_array_len: length of TX MPDU aggregation buffer
5020 * @tx_succ_mcs_array_len: length of mcs buffer for ACKed MPDUs
5021 * @tx_fail_mcs_array_len: length of mcs buffer for no-ACKed MPDUs
5022 * @tx_delay_array_len: length of delay stats buffer
5023 * @rx_mpdu_aggr_array_len: length of RX MPDU aggregation buffer
5024 * @rx_mcs_array_len: length of RX mcs stats buffer
5025 * @peer_stats: peer stats
5026 * @cca: physical channel CCA stats
5027 * @stats: pointer to stats data buffer.
5028 *
5029 * Structure of the whole statictics is like this:
5030 * ---------------------------------
5031 * | trigger_cond_i |
5032 * +-------------------------------+
5033 * | cca_chgd_bitmap |
5034 * +-------------------------------+
5035 * | sig_chgd_bitmap |
5036 * +-------------------------------+
5037 * | tx_chgd_bitmap |
5038 * +-------------------------------+
5039 * | rx_chgd_bitmap |
5040 * +-------------------------------+
5041 * | peer_num |
5042 * +-------------------------------+
5043 * | channel_num |
5044 * +-------------------------------+
5045 * | tx_mpdu_aggr_array_len |
5046 * +-------------------------------+
5047 * | tx_succ_mcs_array_len |
5048 * +-------------------------------+
5049 * | tx_fail_mcs_array_len |
5050 * +-------------------------------+
5051 * | tx_delay_array_len |
5052 * +-------------------------------+
5053 * | rx_mpdu_aggr_array_len |
5054 * +-------------------------------+
5055 * | rx_mcs_array_len |
5056 * +-------------------------------+
5057 * | pointer to CCA stats |
5058 * +-------------------------------+
5059 * | pointer to peer stats |
5060 * +-------------------------------+
5061 * | CCA stats |
5062 * +-------------------------------+
5063 * | peer_stats |----+
5064 * +-------------------------------+ |
5065 * | per peer signals stats |<---+
5066 * | peer0 ~ peern | |
5067 * +-------------------------------+ |
5068 * | TX aggr/mcs parameters array | |
5069 * | Length of this buffer is | |
5070 * | configurable for user layer. |<-+ |
5071 * +-------------------------------+ | |
5072 * | per peer tx stats |--+ |
5073 * | BE | <--+
5074 * | BK | |
5075 * | VI | |
5076 * | VO | |
5077 * +-------------------------------+ |
5078 * | TX aggr/mcs parameters array | |
5079 * | Length of this buffer is | |
5080 * | configurable for user layer. |<-+ |
5081 * +-------------------------------+ | |
5082 * | peer peer rx stats |--+ |
5083 * | BE | <--+
5084 * | BE |
5085 * | BK |
5086 * | VI |
5087 * | VO |
5088 * ---------------------------------
5089 */
5090struct sir_wifi_ll_ext_stats {
5091 uint32_t trigger_cond_id;
5092 uint32_t cca_chgd_bitmap;
5093 uint32_t sig_chgd_bitmap;
5094 uint32_t tx_chgd_bitmap;
5095 uint32_t rx_chgd_bitmap;
5096 uint8_t peer_num;
5097 uint8_t channel_num;
5098 uint32_t tx_mpdu_aggr_array_len;
5099 uint32_t tx_succ_mcs_array_len;
5100 uint32_t tx_fail_mcs_array_len;
5101 uint32_t tx_delay_array_len;
5102 uint32_t rx_mpdu_aggr_array_len;
5103 uint32_t rx_mcs_array_len;
5104 struct sir_wifi_ll_ext_peer_stats *peer_stats;
5105 struct sir_wifi_chan_cca_stats *cca;
5106 uint8_t stats[];
5107};
5108
5109/**
5110 * struct sir_channel_cca_threshold - threshold for channel CCA
5111 * @idle_time: idle time, no TX, no RX, no interference
5112 * @tx_time: time transmitting packets
5113 * @rx_in_bss_time: time receiving packets in current BSSs
5114 * @rx_out_bss_time: time receiving packets not in current BSSs
5115 * @rx_busy_time: time interference detected
5116 * @rx_in_bad_cond_time: receiving packets with errors
5117 * @tx_in_bad_cond_time: time transmitted packets not been ACKed
5118 * @wlan_not_avail_time: wlan card cannot work
5119 */
5120struct sir_channel_cca_threshold {
5121 uint32_t idle_time;
5122 uint32_t tx_time;
5123 uint32_t rx_in_bss_time;
5124 uint32_t rx_out_bss_time;
5125 uint32_t rx_busy_time;
5126 uint32_t rx_in_bad_cond_time;
5127 uint32_t tx_in_bad_cond_time;
5128 uint32_t wlan_not_avail_time;
5129};
5130
5131/**
5132 * struct sir_signal_threshold - threshold for per peer sigbal
5133 * @snr: signal to noise rate
5134 * @nf: noise floor
5135 */
5136struct sir_signal_threshold {
5137 uint32_t snr;
5138 uint32_t nf;
5139};
5140
5141/**
5142 * struct sir_tx_threshold - threshold for TX
5143 * @msdu: TX MSDUs on MAC layer
5144 * @mpdu: TX MPDUs on MAC layer
5145 * @ppdu: TX PPDUs on MAC layer
5146 * @bytes: TX bytes on MAC layer
5147 * @msdu_drop: drooped MSDUs
5148 * @byte_drop: dropped Bytes
5149 * @mpdu_retry: MPDU not acked
5150 * @ppdu_fail: PPDUs which received no block ack
5151 * @aggregation: aggregation size
5152 * @succ_mcs: histogram of encoding rate for acked PPDUs
5153 * @fail_mcs: histogram of encoding rate for no-acked PPDUs
5154 */
5155struct sir_tx_threshold {
5156 uint32_t msdu;
5157 uint32_t mpdu;
5158 uint32_t ppdu;
5159 uint32_t bytes;
5160 uint32_t msdu_drop;
5161 uint32_t byte_drop;
5162 uint32_t mpdu_retry;
5163 uint32_t mpdu_fail;
5164 uint32_t ppdu_fail;
5165 uint32_t aggregation;
5166 uint32_t succ_mcs;
5167 uint32_t fail_mcs;
5168 uint32_t delay;
5169};
5170
5171/**
5172 * struct sir_rx_threshold - threshold for RX
5173 * @mpdu: RX MPDUs on MAC layer
5174 * @bytes: RX bytes on MAC layer
5175 * @ppdu: RX PPDU on PHY layer
5176 * @ppdu_bytes: RX bytes on PHY layer
5177 * @disorder: discontinuity in seqnum
5178 * @mpdu_retry: MPDUs flagged as retry
5179 * @mpdu_dup: MPDUs identified as duplicated
5180 * @aggregation: aggregation size
5181 * @mcs: histogram of encoding rate for PPDUs
5182 * @ps_inds: power save indication
5183 * @ps_durs: total time in power save
5184 * @probe_reqs: probe request received
5185 * @other_mgmt: other MGMT frames received
5186 */
5187struct sir_rx_threshold {
5188 uint32_t mpdu;
5189 uint32_t bytes;
5190 uint32_t ppdu;
5191 uint32_t ppdu_bytes;
5192 uint32_t disorder;
5193 uint32_t mpdu_lost;
5194 uint32_t mpdu_retry;
5195 uint32_t mpdu_dup;
5196 uint32_t mpdu_discard;
5197 uint32_t aggregation;
5198 uint32_t mcs;
5199 uint32_t ps_inds;
5200 uint32_t ps_durs;
5201 uint32_t probe_reqs;
5202 uint32_t other_mgmt;
5203};
5204
5205/**
5206 * struct sir_wifi_ll_ext_stats_threshold - Threshold for stats update
5207 * @period: MAC counter indication period (unit in ms)
5208 * @enable: if threshold mechnism is enabled or disabled
5209 * @enable_bitmap: whether dedicated threshold is enabed.
5210 * Every MAC counter has a dedicated threshold. If the dedicated
5211 * threshold is not set in the bitmap, global threshold will take
5212 * effect.
5213 * @global: whether clobal threshold is enabled.
Jeff Johnsonf2cf6592018-05-06 16:27:44 -07005214 * When both global and dedicated threshold are disabled, MAC counter
Zhang Qian73c348a2017-03-13 16:15:55 +08005215 * will indicate stats periodically.
5216 * @global_threshold: global threshold value
5217 * @cca_bitmap: bitmap for CCA.
5218 * Bit0: idle time
5219 * Bit1: tx time
5220 * Bit2: RX in BSS
5221 * Bit3: RX out of BSS
5222 * Bit4: medium busy
5223 * Bit5: RX bad
5224 * Bit6: TX bad
5225 * Bit7: WLAN card not available
5226 * @signal_bitmap:
5227 * Bit0: Per channel SNR counter
5228 * Bit1: Per channel noise floor counter
5229 * @tx_bitmap: bitmap for TX counters
5230 * Bit0: TX counter unit in MSDU
5231 * Bit1: TX counter unit in MPDU
5232 * Bit2: TX counter unit in PPDU
5233 * Bit3: TX counter unit in byte
5234 * Bit4: Dropped MSDUs
5235 * Bit5: Dropped Bytes
5236 * Bit6: MPDU retry counter
5237 * Bit7: MPDU failure counter
5238 * Bit8: PPDU failure counter
5239 * Bit9: MPDU aggregation counter
5240 * Bit10: MCS counter for ACKed MPDUs
5241 * Bit11: MCS counter for Failed MPDUs
5242 * Bit12: TX Delay counter
5243 * @rx_bitmap:bitmap for RX counters
5244 * Bit0: MAC RX counter unit in MPDU
5245 * Bit1: MAC RX counter unit in byte
5246 * Bit2: PHY RX counter unit in PPDU
5247 * Bit3: PHY RX counter unit in byte
5248 * Bit4: Disorder counter
5249 * Bit5: Retry counter
5250 * Bit6: Duplication counter
5251 * Bit7: Discard counter
5252 * Bit8: MPDU aggregation size counter
5253 * Bit9: MCS counter
5254 * Bit10: Peer STA power state change (wake to sleep) counter
5255 * Bit11: Peer STA power save counter, total time in PS mode
5256 * Bit12: Probe request counter
5257 * Bit13: Other management frames counter
5258 * @cca_thresh: CCA threshold
5259 * @signal_thresh: signal threshold
5260 * @tx_thresh: TX threshold
5261 * @rx_thresh: RX threshold
5262 *
5263 * Generally, Link layer statistics is reported periodically. But if the
5264 * variation of one stats of compared to the pervious notification exceeds
5265 * a threshold, FW will report the new stats immediately.
5266 * This structure contains threshold for different counters.
5267 */
5268struct sir_ll_ext_stats_threshold {
5269 uint32_t period;
5270 uint32_t enable;
5271 uint32_t enable_bitmap;
5272 uint32_t global;
5273 uint32_t global_threshold;
5274 uint32_t cca_bitmap;
5275 uint32_t signal_bitmap;
5276 uint32_t tx_bitmap;
5277 uint32_t rx_bitmap;
5278 struct sir_channel_cca_threshold cca;
5279 struct sir_signal_threshold signal;
5280 struct sir_tx_threshold tx;
5281 struct sir_rx_threshold rx;
5282};
5283
5284#define LL_STATS_MIN_PERIOD 10
5285#define LL_STATS_INVALID_PERIOD 0xFFFFFFFF
5286
Zhang Qiana6e9c102016-12-22 16:47:24 +08005287/* Result ID for LL stats extension */
5288#define WMI_LL_STATS_EXT_PS_CHG 0x00000100
5289#define WMI_LL_STATS_EXT_TX_FAIL 0x00000200
5290#define WMI_LL_STATS_EXT_MAC_COUNTER 0x00000400
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005291#endif /* WLAN_FEATURE_LINK_LAYER_STATS */
5292
5293typedef struct sAniGetLinkStatus {
5294 uint16_t msgType; /* message type is same as the request type */
5295 uint16_t msgLen; /* length of the entire request */
5296 uint8_t linkStatus;
5297 uint8_t sessionId;
5298} tAniGetLinkStatus, *tpAniGetLinkStatus;
5299
5300#ifdef DHCP_SERVER_OFFLOAD
5301typedef struct {
5302 uint32_t vdev_id;
5303 uint32_t dhcpSrvOffloadEnabled;
5304 uint32_t dhcpClientNum;
5305 uint32_t dhcpSrvIP;
5306} tSirDhcpSrvOffloadInfo, *tpSirDhcpSrvOffloadInfo;
5307#endif /* DHCP_SERVER_OFFLOAD */
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05305308
5309/**
5310 * struct sir_lost_link_info - lost link information structure.
5311 *
5312 * @vdev_id: vdev_id from WMA. some modules call sessionId.
5313 * @rssi: rssi at disconnection time.
5314 *
5315 * driver uses this structure to communicate information collected at
5316 * disconnection time.
5317 */
5318struct sir_lost_link_info {
5319 uint32_t vdev_id;
5320 int32_t rssi;
5321};
5322
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005323/* find the size of given member within a structure */
5324#ifndef member_size
5325#define member_size(type, member) (sizeof(((type *)0)->member))
5326#endif
5327
5328#define RTT_INVALID 0x00
5329#define RTT_TIMING_MEAS_CAPABILITY 0x01
5330#define RTT_FINE_TIME_MEAS_INITIATOR_CAPABILITY 0x02
5331#define RTT_FINE_TIME_MEAS_RESPONDER_CAPABILITY 0x03
5332
5333/**
5334 * enum fine_time_meas_mask - bit mask to identify device's
5335 * fine timing measurement capability
5336 * @FINE_TIME_MEAS_STA_INITIATOR - STA role, Initiator capability is supported
5337 * @FINE_TIME_MEAS_STA_RESPONDER - STA role, Responder capability is supported
5338 * @FINE_TIME_MEAS_P2PCLI_INITIATOR - P2P-CLI supports initiator capability
5339 * @FINE_TIME_MEAS_P2PCLI_RESPONDER - P2P-CLI supports responder capability
5340 * @FINE_TIME_MEAS_P2PGO_INITIATOR - P2P-GO supports initiator capability
5341 * @FINE_TIME_MEAS_P2PGO_RESPONDER - P2P-GO supports responder capability
5342 * @FINE_TIME_MEAS_SAP_INITIATOR - SAP role, Initiator capability is supported
5343 * @FINE_TIME_MEAS_SAP_RESPONDER - SAP role, Responder capability is supported
5344 */
5345enum fine_time_meas_mask {
5346 FINE_TIME_MEAS_STA_INITIATOR = (1 << (0)),
5347 FINE_TIME_MEAS_STA_RESPONDER = (1 << (1)),
5348 FINE_TIME_MEAS_P2PCLI_INITIATOR = (1 << (2)),
5349 FINE_TIME_MEAS_P2PCLI_RESPONDER = (1 << (3)),
5350 FINE_TIME_MEAS_P2PGO_INITIATOR = (1 << (4)),
5351 FINE_TIME_MEAS_P2PGO_RESPONDER = (1 << (5)),
5352 FINE_TIME_MEAS_SAP_INITIATOR = (1 << (6)),
5353 FINE_TIME_MEAS_SAP_RESPONDER = (1 << (7)),
5354};
5355
5356/* number of neighbor reports that we can handle in Neighbor Report Response */
5357#define MAX_SUPPORTED_NEIGHBOR_RPT 15
5358
5359/**
5360 * struct sir_stats_avg_factor
5361 * @vdev_id: session id
5362 * @stats_avg_factor: average factor
5363 */
5364struct sir_stats_avg_factor {
5365 uint8_t vdev_id;
5366 uint16_t stats_avg_factor;
5367};
5368
5369/**
5370 * struct sir_guard_time_request
5371 * @vdev_id: session id
5372 * @guard_time: guard time
5373 */
5374struct sir_guard_time_request {
5375 uint8_t vdev_id;
5376 uint32_t guard_time;
5377};
5378
5379/* Max number of rates allowed in Supported Rates IE */
5380#define MAX_NUM_SUPPORTED_RATES (8)
5381
5382/*
5383 * struct rssi_monitor_req - rssi monitoring
5384 * @request_id: request id
5385 * @session_id: session id
5386 * @min_rssi: minimum rssi
5387 * @max_rssi: maximum rssi
5388 * @control: flag to indicate start or stop
5389 */
5390struct rssi_monitor_req {
5391 uint32_t request_id;
5392 uint32_t session_id;
5393 int8_t min_rssi;
5394 int8_t max_rssi;
5395 bool control;
5396};
5397
5398/**
5399 * struct rssi_breach_event - rssi breached event structure
5400 * @request_id: request id
5401 * @session_id: session id
5402 * @curr_rssi: current rssi
5403 * @curr_bssid: current bssid
5404 */
5405struct rssi_breach_event {
5406 uint32_t request_id;
5407 uint32_t session_id;
5408 int8_t curr_rssi;
Anurag Chouhan6d760662016-02-20 16:05:43 +05305409 struct qdf_mac_addr curr_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005410};
5411
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05305412/**
5413 * struct chip_pwr_save_fail_detected_params - chip power save failure detected
5414 * event params
5415 * @failure_reason_code:failure reason code
5416 * @wake_lock_bitmap:bitmap for modules voting against sleep for long duration.
5417 */
5418struct chip_pwr_save_fail_detected_params {
5419 uint32_t failure_reason_code;
5420 uint32_t wake_lock_bitmap[4];
5421};
5422
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005423#define MAX_NUM_FW_SEGMENTS 4
5424
5425/**
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05305426 * DEFAULT_SCAN_IE_ID - Identifier for the collection of IE's added
5427 * by default to the probe request
5428 */
5429#define DEFAULT_SCAN_IE_ID 256
5430
5431 /* MAX_DEFAULT_SCAN_IE_LEN - Maxmimum length of Default Scan IE's */
Selvaraj, Sridhar021ee0a2017-04-07 16:53:31 +05305432#define MAX_DEFAULT_SCAN_IE_LEN 2048
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05305433
5434 /* Extended Capabilities IE header(IE Id + IE Length) length */
5435#define EXT_CAP_IE_HDR_LEN 2
5436
5437/**
5438 * struct hdd_default_scan_ie - HDD default scan IE structure
5439 * @message_type: message type to be set with eWNI_SME_DEFAULT_SCAN_IE
5440 * @length: length of the struct hdd_default_scan_ie
5441 * @session_id: Session Id
5442 * @ie_len: Default scan IE length
5443 * @ie_data: Pointer to default scan IE data
5444 */
5445struct hdd_default_scan_ie {
5446 uint16_t message_type;
5447 uint16_t length;
5448 uint16_t session_id;
5449 uint16_t ie_len;
5450 uint8_t ie_data[MAX_DEFAULT_SCAN_IE_LEN];
5451};
5452
5453/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005454 * struct vdev_ie_info - IE info
5455 * @vdev_id - vdev for which the IE is being sent
5456 * @ie_id - ID of the IE
5457 * @length - length of the IE data
Naveen Rawat03e8d952016-08-01 15:22:20 -07005458 * @band - indicates IE is intended for which band
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005459 * @data - IE data
5460 *
5461 * This structure is used to store the IE information.
5462 */
5463struct vdev_ie_info {
5464 uint32_t vdev_id;
5465 uint32_t ie_id;
5466 uint32_t length;
Naveen Rawat03e8d952016-08-01 15:22:20 -07005467 uint32_t band;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005468 uint8_t *data;
5469};
5470
5471/**
5472 * struct send_extcap_ie - used to pass send_extcap_ie msg from SME to PE
5473 * @type - MSG type
5474 * @length - length of the message
5475 * @seesion_id - session_id for which the message is intended for
5476 *
5477 * This structure is used to pass send_extcap_ie msg from SME to PE
5478 */
5479struct send_extcap_ie {
5480 uint16_t msg_type; /* eWNI_SME_SET_IE_REQ */
5481 uint16_t length;
5482 uint8_t session_id;
5483};
5484
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005485typedef void (*hw_mode_transition_cb)(uint32_t old_hw_mode_index,
5486 uint32_t new_hw_mode_index,
5487 uint32_t num_vdev_mac_entries,
Tushnim Bhattacharyyaeab33dd2017-11-15 15:20:02 -08005488 struct policy_mgr_vdev_mac_map *vdev_mac_map);
Dundi Raviteja6bb9e322018-05-16 17:04:41 +05305489typedef void (*antenna_mode_cb)(uint32_t status, void *context);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005490
5491/**
5492 * struct sir_nss_update_request
5493 * @msgType: nss update msg type
5494 * @msgLen: length of the msg
5495 * @new_nss: new spatial stream value
5496 * @vdev_id: session id
5497 */
5498struct sir_nss_update_request {
5499 uint16_t msgType;
5500 uint16_t msgLen;
5501 uint8_t new_nss;
5502 uint32_t vdev_id;
5503};
5504
5505/**
5506 * struct sir_beacon_tx_complete_rsp
5507 *
5508 * @session_id: session for which beacon update happened
5509 * @tx_status: status of the beacon tx from FW
5510 */
5511struct sir_beacon_tx_complete_rsp {
5512 uint8_t session_id;
5513 uint8_t tx_status;
5514};
5515
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005516/**
5517 * OCB structures
5518 */
5519
5520#define NUM_AC (4)
5521#define OCB_CHANNEL_MAX (5)
5522
5523struct sir_qos_params {
5524 uint8_t aifsn;
5525 uint8_t cwmin;
5526 uint8_t cwmax;
5527};
5528
5529/**
5530 * struct sir_ocb_set_config_response
5531 * @status: response status
5532 */
5533struct sir_ocb_set_config_response {
5534 uint8_t status;
5535};
5536
5537/** Callback for the dcc_stats_event */
5538typedef void (*dcc_stats_event_callback_t)(void *hdd_ctx, uint32_t vdev_id,
5539 uint32_t num_channels, uint32_t stats_per_channel_array_len,
5540 const void *stats_per_channel_array);
5541
5542/**
5543 * struct sir_ocb_config_channel
5544 * @chan_freq: frequency of the channel
5545 * @bandwidth: bandwidth of the channel, either 10 or 20 MHz
5546 * @mac_address: MAC address assigned to this channel
5547 * @qos_params: QoS parameters
5548 * @max_pwr: maximum transmit power of the channel (dBm)
5549 * @min_pwr: minimum transmit power of the channel (dBm)
5550 * @reg_pwr: maximum transmit power specified by the regulatory domain (dBm)
5551 * @antenna_max: maximum antenna gain specified by the regulatory domain (dB)
5552 */
5553struct sir_ocb_config_channel {
5554 uint32_t chan_freq;
5555 uint32_t bandwidth;
Anurag Chouhan6d760662016-02-20 16:05:43 +05305556 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005557 struct sir_qos_params qos_params[MAX_NUM_AC];
5558 uint32_t max_pwr;
5559 uint32_t min_pwr;
5560 uint8_t reg_pwr;
5561 uint8_t antenna_max;
5562 uint16_t flags;
5563};
5564
5565/**
5566 * OCB_CHANNEL_FLAG_NO_RX_HDR - Don't add the RX stats header to packets
5567 * received on this channel.
5568 */
5569#define OCB_CHANNEL_FLAG_DISABLE_RX_STATS_HDR (1 << 0)
5570
5571/**
5572 * struct sir_ocb_config_sched
5573 * @chan_freq: frequency of the channel
5574 * @total_duration: duration of the schedule
5575 * @guard_interval: guard interval on the start of the schedule
5576 */
5577struct sir_ocb_config_sched {
5578 uint32_t chan_freq;
5579 uint32_t total_duration;
5580 uint32_t guard_interval;
5581};
5582
5583/**
5584 * struct sir_ocb_config
5585 * @session_id: session id
5586 * @channel_count: number of channels
5587 * @schedule_size: size of the channel schedule
5588 * @flags: reserved
5589 * @channels: array of OCB channels
5590 * @schedule: array of OCB schedule elements
5591 * @dcc_ndl_chan_list_len: size of the ndl_chan array
5592 * @dcc_ndl_chan_list: array of dcc channel info
5593 * @dcc_ndl_active_state_list_len: size of the active state array
5594 * @dcc_ndl_active_state_list: array of active states
5595 * @adapter: the OCB adapter
5596 * @dcc_stats_callback: callback for the response event
5597 */
5598struct sir_ocb_config {
5599 uint8_t session_id;
5600 uint32_t channel_count;
5601 uint32_t schedule_size;
5602 uint32_t flags;
5603 struct sir_ocb_config_channel *channels;
5604 struct sir_ocb_config_sched *schedule;
5605 uint32_t dcc_ndl_chan_list_len;
5606 void *dcc_ndl_chan_list;
5607 uint32_t dcc_ndl_active_state_list_len;
5608 void *dcc_ndl_active_state_list;
5609};
5610
5611/* The size of the utc time in bytes. */
5612#define SIZE_UTC_TIME (10)
5613/* The size of the utc time error in bytes. */
5614#define SIZE_UTC_TIME_ERROR (5)
5615
5616/**
5617 * struct sir_ocb_utc
5618 * @vdev_id: session id
5619 * @utc_time: number of nanoseconds from Jan 1st 1958
5620 * @time_error: the error in the UTC time. All 1's for unknown
5621 */
5622struct sir_ocb_utc {
5623 uint32_t vdev_id;
5624 uint8_t utc_time[SIZE_UTC_TIME];
5625 uint8_t time_error[SIZE_UTC_TIME_ERROR];
5626};
5627
5628/**
5629 * struct sir_ocb_timing_advert
5630 * @vdev_id: session id
5631 * @chan_freq: frequency on which to advertise
5632 * @repeat_rate: the number of times it will send TA in 5 seconds
5633 * @timestamp_offset: offset of the timestamp field in the TA frame
5634 * @time_value_offset: offset of the time_value field in the TA frame
5635 * @template_length: size in bytes of the TA frame
5636 * @template_value: the TA frame
5637 */
5638struct sir_ocb_timing_advert {
5639 uint32_t vdev_id;
5640 uint32_t chan_freq;
5641 uint32_t repeat_rate;
5642 uint32_t timestamp_offset;
5643 uint32_t time_value_offset;
5644 uint32_t template_length;
5645 uint8_t *template_value;
5646};
5647
5648/**
5649 * struct sir_ocb_get_tsf_timer_response
5650 * @vdev_id: session id
5651 * @timer_high: higher 32-bits of the timer
5652 * @timer_low: lower 32-bits of the timer
5653 */
5654struct sir_ocb_get_tsf_timer_response {
5655 uint32_t vdev_id;
5656 uint32_t timer_high;
5657 uint32_t timer_low;
5658};
5659
5660/**
5661 * struct sir_ocb_get_tsf_timer
5662 * @vdev_id: session id
5663 */
5664struct sir_ocb_get_tsf_timer {
5665 uint32_t vdev_id;
5666};
5667
5668/**
5669 * struct sir_dcc_get_stats_response
5670 * @vdev_id: session id
5671 * @num_channels: number of dcc channels
5672 * @channel_stats_array_len: size in bytes of the stats array
5673 * @channel_stats_array: the stats array
5674 */
5675struct sir_dcc_get_stats_response {
5676 uint32_t vdev_id;
5677 uint32_t num_channels;
5678 uint32_t channel_stats_array_len;
5679 void *channel_stats_array;
5680};
5681
5682/**
5683 * struct sir_dcc_get_stats
5684 * @vdev_id: session id
5685 * @channel_count: number of dcc channels
5686 * @request_array_len: size in bytes of the request array
5687 * @request_array: the request array
5688 */
5689struct sir_dcc_get_stats {
5690 uint32_t vdev_id;
5691 uint32_t channel_count;
5692 uint32_t request_array_len;
5693 void *request_array;
5694};
5695
5696/**
5697 * struct sir_dcc_clear_stats
5698 * @vdev_id: session id
5699 * @dcc_stats_bitmap: bitmap of clear option
5700 */
5701struct sir_dcc_clear_stats {
5702 uint32_t vdev_id;
5703 uint32_t dcc_stats_bitmap;
5704};
5705
5706/**
5707 * struct sir_dcc_update_ndl_response
5708 * @vdev_id: session id
5709 * @status: response status
5710 */
5711struct sir_dcc_update_ndl_response {
5712 uint32_t vdev_id;
5713 uint32_t status;
5714};
5715
5716/**
5717 * struct sir_dcc_update_ndl
5718 * @vdev_id: session id
5719 * @channel_count: number of channels to be updated
5720 * @dcc_ndl_chan_list_len: size in bytes of the ndl_chan array
5721 * @dcc_ndl_chan_list: the ndl_chan array
5722 * @dcc_ndl_active_state_list_len: size in bytes of the active_state array
5723 * @dcc_ndl_active_state_list: the active state array
5724 */
5725struct sir_dcc_update_ndl {
5726 uint32_t vdev_id;
5727 uint32_t channel_count;
5728 uint32_t dcc_ndl_chan_list_len;
5729 void *dcc_ndl_chan_list;
5730 uint32_t dcc_ndl_active_state_list_len;
5731 void *dcc_ndl_active_state_list;
5732};
5733
5734/**
5735 * enum powersave_qpower_mode: QPOWER modes
5736 * @QPOWER_DISABLED: Qpower is disabled
5737 * @QPOWER_ENABLED: Qpower is enabled
5738 * @QPOWER_DUTY_CYCLING: Qpower is enabled with duty cycling
5739 */
5740enum powersave_qpower_mode {
5741 QPOWER_DISABLED = 0,
5742 QPOWER_ENABLED = 1,
5743 QPOWER_DUTY_CYCLING = 2
5744};
5745
5746/**
5747 * enum powersave_qpower_mode: powersave_mode
5748 * @PS_NOT_SUPPORTED: Power save is not supported
5749 * @PS_LEGACY_NODEEPSLEEP: Legacy power save enabled and deep sleep disabled
5750 * @PS_QPOWER_NODEEPSLEEP: QPOWER enabled and deep sleep disabled
5751 * @PS_LEGACY_DEEPSLEEP: Legacy power save enabled and deep sleep enabled
5752 * @PS_QPOWER_DEEPSLEEP: QPOWER enabled and deep sleep enabled
5753 * @PS_DUTY_CYCLING_QPOWER: QPOWER enabled in duty cycling mode
5754 */
5755enum powersave_mode {
5756 PS_NOT_SUPPORTED = 0,
5757 PS_LEGACY_NODEEPSLEEP = 1,
5758 PS_QPOWER_NODEEPSLEEP = 2,
5759 PS_LEGACY_DEEPSLEEP = 3,
5760 PS_QPOWER_DEEPSLEEP = 4,
5761 PS_DUTY_CYCLING_QPOWER = 5
5762};
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08005763#ifdef FEATURE_LFR_SUBNET_DETECTION
5764/**
5765 * struct gateway_param_update_req - gateway parameter update request
5766 * @request_id: request id
5767 * @session_id: session id
5768 * @max_retries: Max ARP/NS retry attempts
5769 * @timeout: Retry interval
5770 * @ipv4_addr_type: on ipv4 network
5771 * @ipv6_addr_type: on ipv6 network
5772 * @gw_mac_addr: gateway mac addr
5773 * @ipv4_addr: ipv4 addr
5774 * @ipv6_addr: ipv6 addr
5775 */
5776struct gateway_param_update_req {
5777 uint32_t request_id;
5778 uint32_t session_id;
5779 uint32_t max_retries;
5780 uint32_t timeout;
5781 uint32_t ipv4_addr_type;
5782 uint32_t ipv6_addr_type;
Anurag Chouhan6d760662016-02-20 16:05:43 +05305783 struct qdf_mac_addr gw_mac_addr;
5784 uint8_t ipv4_addr[QDF_IPV4_ADDR_SIZE];
5785 uint8_t ipv6_addr[QDF_IPV6_ADDR_SIZE];
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08005786};
5787#else
5788struct gateway_param_update_req;
5789#endif /* FEATURE_LFR_SUBNET_DETECTION */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005790
Abhishek Singh518323d2015-10-19 17:42:01 +05305791/**
5792 * struct sir_sme_ext_change_chan_req - channel change request
5793 * @message_type: message id
5794 * @length: msg length
5795 * @new_channel: new channel
5796 * @session_id: session id
5797 */
5798struct sir_sme_ext_cng_chan_req {
5799 uint16_t message_type; /* eWNI_SME_EXT_CHANGE_CHANNEL */
5800 uint16_t length;
5801 uint32_t new_channel;
5802 uint8_t session_id;
5803};
5804
5805/**
5806 * struct sir_sme_ext_change_chan_ind.
5807 * @session_id: session id
5808 * @new_channel: new channel to change
5809 */
5810struct sir_sme_ext_cng_chan_ind {
5811 uint8_t session_id;
5812 uint8_t new_channel;
5813};
5814
Ryan Hsu3c8f79f2015-12-02 16:45:09 -08005815/**
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07005816 * struct stsf - the basic stsf structure
5817 *
5818 * @vdev_id: vdev id
5819 * @tsf_low: low 32bits of tsf
5820 * @tsf_high: high 32bits of tsf
Manikandan Mohan5356c2b2016-04-03 15:51:35 -07005821 * @soc_timer_low: low 32bits of synced SOC timer value
5822 * @soc_timer_high: high 32bits of synced SOC timer value
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07005823 *
5824 * driver use this struct to store the tsf info
5825 */
5826struct stsf {
5827 uint32_t vdev_id;
5828 uint32_t tsf_low;
5829 uint32_t tsf_high;
Manikandan Mohan5356c2b2016-04-03 15:51:35 -07005830 uint32_t soc_timer_low;
5831 uint32_t soc_timer_high;
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07005832};
5833
Gupta, Kapil4cb1d7d2016-04-16 18:16:25 -07005834#define SIR_BCN_FLT_MAX_ELEMS_IE_LIST 8
5835/**
5836 * struct beacon_filter_param - parameters for beacon filtering
5837 * @vdev_id: vdev id
5838 * @ie_map: bitwise map of IEs that needs to be filtered
5839 *
5840 */
5841struct beacon_filter_param {
5842 uint32_t vdev_id;
5843 uint32_t ie_map[SIR_BCN_FLT_MAX_ELEMS_IE_LIST];
5844};
5845
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05305846/**
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +05305847 * struct adaptive_dwelltime_params - the adaptive dwelltime params
5848 * @vdev_id: vdev id
5849 * @is_enabled: Adaptive dwell time is enabled/disabled
5850 * @dwelltime_mode: global default adaptive dwell mode
5851 * @lpf_weight: weight to calculate the average low pass
5852 * filter for channel congestion
5853 * @passive_mon_intval: intval to monitor wifi activity in passive scan in msec
5854 * @wifi_act_threshold: % of wifi activity used in passive scan 0-100
5855 *
5856 */
5857struct adaptive_dwelltime_params {
5858 uint32_t vdev_id;
5859 bool is_enabled;
5860 uint8_t dwelltime_mode;
5861 uint8_t lpf_weight;
5862 uint8_t passive_mon_intval;
5863 uint8_t wifi_act_threshold;
5864};
5865
5866/**
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05305867 * struct csa_offload_params - CSA offload request parameters
5868 * @channel: channel
5869 * @switch_mode: switch mode
5870 * @sec_chan_offset: second channel offset
5871 * @new_ch_width: new channel width
5872 * @new_ch_freq_seg1: channel center freq 1
5873 * @new_ch_freq_seg2: channel center freq 2
5874 * @ies_present_flag: IE present flag
5875 */
5876struct csa_offload_params {
5877 uint8_t channel;
5878 uint8_t switch_mode;
5879 uint8_t sec_chan_offset;
5880 uint8_t new_ch_width;
5881 uint8_t new_op_class;
5882 uint8_t new_ch_freq_seg1;
5883 uint8_t new_ch_freq_seg2;
5884 uint32_t ies_present_flag;
5885 tSirMacAddr bssId;
5886};
5887
5888/**
Sandeep Puligillae0875662016-02-12 16:09:21 -08005889 * enum obss_ht40_scancmd_type - obss scan command type
5890 * @HT40_OBSS_SCAN_PARAM_START: OBSS scan start
5891 * @HT40_OBSS_SCAN_PARAM_UPDATE: OBSS scan param update
5892 */
5893enum obss_ht40_scancmd_type {
5894 HT40_OBSS_SCAN_PARAM_START,
5895 HT40_OBSS_SCAN_PARAM_UPDATE
5896};
5897
5898/**
5899 * struct sme_obss_ht40_scanind_msg - sme obss scan params
5900 * @msg_type: message type
5901 * @length: message length
5902 * @mac_addr: mac address
5903 */
5904struct sme_obss_ht40_scanind_msg {
5905 uint16_t msg_type;
5906 uint16_t length;
5907 struct qdf_mac_addr mac_addr;
5908};
5909
5910/**
5911 * struct obss_ht40_scanind - ht40 obss scan request
5912 * @cmd: message type
5913 * @scan_type: message length
5914 * @obss_passive_dwelltime: obss passive dwelltime
5915 * @obss_active_dwelltime: obss active dwelltime
5916 * @obss_width_trigger_interval: scan interval
5917 * @obss_passive_total_per_channel: total passive scan time per channel
5918 * @obss_active_total_per_channel: total active scan time per channel
5919 * @bsswidth_ch_trans_delay: OBSS transition delay time
5920 * @obss_activity_threshold: OBSS activity threshold
5921 * @self_sta_id: self sta identification
5922 * @bss_id: BSS index
5923 * @fortymhz_intolerent: Ht40mhz intolerance
5924 * @channel_count: channel count
5925 * @channels: channel information
5926 * @current_operatingclass: operating class
5927 * @iefield_len: ie's length
5928 * @iefiled: ie's information
5929 */
5930struct obss_ht40_scanind {
5931 enum obss_ht40_scancmd_type cmd;
5932 enum eSirScanType scan_type;
5933 /* In TUs */
5934 uint16_t obss_passive_dwelltime;
5935 uint16_t obss_active_dwelltime;
5936 /* In seconds */
5937 uint16_t obss_width_trigger_interval;
5938 /* In TU's */
5939 uint16_t obss_passive_total_per_channel;
5940 uint16_t obss_active_total_per_channel;
5941 uint16_t bsswidth_ch_trans_delay;
5942 uint16_t obss_activity_threshold;
5943 uint8_t self_sta_idx;
5944 uint8_t bss_id;
5945 uint8_t fortymhz_intolerent;
5946 uint8_t channel_count;
5947 uint8_t channels[SIR_ROAM_MAX_CHANNELS];
5948 uint8_t current_operatingclass;
5949 uint16_t iefield_len;
5950 uint8_t iefield[SIR_ROAM_SCAN_MAX_PB_REQ_SIZE];
5951};
5952
5953/**
5954 * struct obss_scanparam - OBSS scan parameters
5955 * @obss_passive_dwelltime: message type
5956 * @obss_active_dwelltime: message length
5957 * @obss_width_trigger_interval: obss passive dwelltime
5958 * @obss_passive_total_per_channel: obss passive total scan time
5959 * @obss_active_total_per_channel: obss active total scan time
5960 * @bsswidth_ch_trans_delay: OBSS transition delay time
5961 * @obss_activity_threshold: OBSS activity threshold
5962 */
5963struct obss_scanparam {
5964 uint16_t obss_passive_dwelltime;
5965 uint16_t obss_active_dwelltime;
5966 uint16_t obss_width_trigger_interval;
5967 uint16_t obss_passive_total_per_channel;
5968 uint16_t obss_active_total_per_channel;
5969 uint16_t bsswidth_ch_trans_delay;
5970 uint16_t obss_activity_threshold;
5971};
5972
Arun Khandavalli2476ef52016-04-26 20:19:43 +05305973/**
Nachiket Kukadee547a482018-05-22 16:43:30 +05305974 * struct sir_apf_set_offload - set apf filter instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05305975 * @session_id: session identifier
Nachiket Kukadee547a482018-05-22 16:43:30 +05305976 * @version: host apf version
5977 * @filter_id: Filter ID for APF filter
Arun Khandavalli2476ef52016-04-26 20:19:43 +05305978 * @total_length: The total length of the full instruction
5979 * total_length equal to 0 means reset
5980 * @current_offset: current offset, 0 means start a new setting
5981 * @current_length: Length of current @program
Nachiket Kukadee547a482018-05-22 16:43:30 +05305982 * @program: APF instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05305983 */
Nachiket Kukadee547a482018-05-22 16:43:30 +05305984struct sir_apf_set_offload {
Arun Khandavalli2476ef52016-04-26 20:19:43 +05305985 uint8_t session_id;
5986 uint32_t version;
5987 uint32_t filter_id;
5988 uint32_t total_length;
5989 uint32_t current_offset;
5990 uint32_t current_length;
5991 uint8_t *program;
5992};
5993
5994/**
Nachiket Kukadee547a482018-05-22 16:43:30 +05305995 * struct sir_apf_offload_capabilities - get apf Capabilities
5996 * @apf_version: fw's implement version
5997 * @max_apf_filters: max filters that fw supports
5998 * @max_bytes_for_apf_inst: the max bytes that can be used as apf instructions
5999 * @remaining_bytes_for_apf_inst: remaining bytes for apf instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05306000 *
6001 */
Nachiket Kukadee547a482018-05-22 16:43:30 +05306002struct sir_apf_get_offload {
6003 uint32_t apf_version;
6004 uint32_t max_apf_filters;
6005 uint32_t max_bytes_for_apf_inst;
6006 uint32_t remaining_bytes_for_apf_inst;
Arun Khandavalli2476ef52016-04-26 20:19:43 +05306007};
6008
Naveen Rawat3ff5cff2018-01-29 14:31:16 -08006009#ifndef QCA_SUPPORT_CP_STATS
Sandeep Puligilla607f34a2016-05-25 14:37:47 -07006010/**
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306011 * struct sir_wake_lock_stats - wake lock stats structure
Dustin Brown9d797d62017-01-11 16:39:12 -08006012 * @wow_unspecified_wake_up_count: number of non-wow related wake ups
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306013 * @wow_ucast_wake_up_count: Unicast wakeup count
6014 * @wow_bcast_wake_up_count: Broadcast wakeup count
6015 * @wow_ipv4_mcast_wake_up_count: ipv4 multicast wakeup count
6016 * @wow_ipv6_mcast_wake_up_count: ipv6 multicast wakeup count
6017 * @wow_ipv6_mcast_ra_stats: ipv6 multicast ra stats
6018 * @wow_ipv6_mcast_ns_stats: ipv6 multicast ns stats
6019 * @wow_ipv6_mcast_na_stats: ipv6 multicast na stats
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +05306020 * @wow_icmpv4_count: ipv4 icmp packet count
Himanshu Agarwal4574e282016-08-10 15:22:45 +05306021 * @wow_icmpv6_count: ipv6 icmp packet count
Poddar, Siddarthc01681a2016-12-21 18:36:30 +05306022 * @wow_rssi_breach_wake_up_count: rssi breach wakeup count
6023 * @wow_low_rssi_wake_up_count: low rssi wakeup count
6024 * @wow_gscan_wake_up_count: gscan wakeup count
6025 * @wow_pno_complete_wake_up_count: pno complete wakeup count
6026 * @wow_pno_match_wake_up_count: pno match wakeup count
Dustin Brown9d797d62017-01-11 16:39:12 -08006027 * @wow_oem_response_wake_up_count: oem response wakeup count
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05306028 * @pwr_save_fail_detected: pwr save fail detected wakeup count
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306029 */
6030struct sir_wake_lock_stats {
Dustin Brown9d797d62017-01-11 16:39:12 -08006031 uint32_t wow_unspecified_wake_up_count;
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306032 uint32_t wow_ucast_wake_up_count;
6033 uint32_t wow_bcast_wake_up_count;
6034 uint32_t wow_ipv4_mcast_wake_up_count;
6035 uint32_t wow_ipv6_mcast_wake_up_count;
6036 uint32_t wow_ipv6_mcast_ra_stats;
6037 uint32_t wow_ipv6_mcast_ns_stats;
6038 uint32_t wow_ipv6_mcast_na_stats;
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +05306039 uint32_t wow_icmpv4_count;
Himanshu Agarwal4574e282016-08-10 15:22:45 +05306040 uint32_t wow_icmpv6_count;
Poddar, Siddarthc01681a2016-12-21 18:36:30 +05306041 uint32_t wow_rssi_breach_wake_up_count;
6042 uint32_t wow_low_rssi_wake_up_count;
6043 uint32_t wow_gscan_wake_up_count;
6044 uint32_t wow_pno_complete_wake_up_count;
6045 uint32_t wow_pno_match_wake_up_count;
Dustin Brown9d797d62017-01-11 16:39:12 -08006046 uint32_t wow_oem_response_wake_up_count;
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05306047 uint32_t pwr_save_fail_detected;
Dustin Brown9d797d62017-01-11 16:39:12 -08006048};
6049
6050/**
6051 * struct sir_vdev_wow_stats - container for per vdev wow related stat counters
6052 * @ucast: Unicast wakeup count
6053 * @bcast: Broadcast wakeup count
6054 * @ipv4_mcast: ipv4 multicast wakeup count
6055 * @ipv6_mcast: ipv6 multicast wakeup count
6056 * @ipv6_mcast_ra: ipv6 multicast ra stats
6057 * @ipv6_mcast_ns: ipv6 multicast ns stats
6058 * @ipv6_mcast_na: ipv6 multicast na stats
6059 * @icmpv4: ipv4 icmp packet count
6060 * @icmpv6: ipv6 icmp packet count
6061 * @rssi_breach: rssi breach wakeup count
6062 * @low_rssi: low rssi wakeup count
6063 * @gscan: gscan wakeup count
6064 * @pno_complete: pno complete wakeup count
6065 * @pno_match: pno match wakeup count
Amar Singhal5eb9acb2017-05-26 15:25:27 -07006066 * @oem_response: oem response wakeup coun
6067 * @scan_11d: 11d scan wakeup count
Dustin Brown9d797d62017-01-11 16:39:12 -08006068 */
6069struct sir_vdev_wow_stats {
6070 uint32_t ucast;
6071 uint32_t bcast;
6072 uint32_t ipv4_mcast;
6073 uint32_t ipv6_mcast;
6074 uint32_t ipv6_mcast_ra;
6075 uint32_t ipv6_mcast_ns;
6076 uint32_t ipv6_mcast_na;
6077 uint32_t icmpv4;
6078 uint32_t icmpv6;
6079 uint32_t rssi_breach;
6080 uint32_t low_rssi;
6081 uint32_t gscan;
6082 uint32_t pno_complete;
6083 uint32_t pno_match;
6084 uint32_t oem_response;
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05306085 uint32_t pwr_save_fail_detected;
Amar Singhal5eb9acb2017-05-26 15:25:27 -07006086 uint32_t scan_11d;
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306087};
Naveen Rawat3ff5cff2018-01-29 14:31:16 -08006088#endif
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306089
6090/**
Sandeep Puligilla607f34a2016-05-25 14:37:47 -07006091 * enum ht_capability_fields - HT Capabilities bit fields
6092 * @HT_CAPS_LDPC: ldpc coding capability bit field
6093 * @HT_CAPS_SUPPORTED_CHANNEL_SET: channel width set bit field
6094 * @HT_CAPS_SM_PWR_SAVE: SM power save bit field
6095 * @HT_CAPS_GREENFIELD: greenfield capability bit field
6096 * @HT_CAPS_SHORT_GI20: short GI 20 bit field
6097 * @HT_CAPS_SHORT_GI40: short GI 40 bit field
6098 * @HT_CAPS_TX_STBC: Tx STBC bit field
6099 * @HT_CAPS_RX_STBC: Rx STBC bit fields
6100 */
6101enum ht_capability_fields {
6102 HT_CAPS_LDPC = 0x0001,
6103 HT_CAPS_SUPPORTED_CHANNEL_SET = 0x0002,
6104 HT_CAPS_SM_PWR_SAVE = 0x000c,
6105 HT_CAPS_GREENFIELD = 0x0010,
6106 HT_CAPS_SHORT_GI20 = 0x0020,
6107 HT_CAPS_SHORT_GI40 = 0x0040,
6108 HT_CAPS_TX_STBC = 0x0080,
6109 HT_CAPS_RX_STBC = 0x0300
6110};
6111
Ravi Joshi412f23d2016-05-26 15:09:23 -07006112#ifdef WLAN_FEATURE_NAN_DATAPATH
6113
6114#define IFACE_NAME_SIZE 64
6115
6116/**
6117 * enum ndp_accept_policy - nan data path accept policy
6118 * @NDP_ACCEPT_POLICY_NONE: the framework will decide the policy
6119 * @NDP_ACCEPT_POLICY_ALL: accept policy offloaded to fw
6120 *
6121 */
6122enum ndp_accept_policy {
6123 NDP_ACCEPT_POLICY_NONE = 0,
6124 NDP_ACCEPT_POLICY_ALL = 1,
6125};
6126
6127/**
6128 * enum ndp_self_role - nan data path role
6129 * @NDP_ROLE_INITIATOR: initiator of nan data path request
6130 * @NDP_ROLE_RESPONDER: responder to nan data path request
6131 *
6132 */
6133enum ndp_self_role {
6134 NDP_ROLE_INITIATOR = 0,
6135 NDP_ROLE_RESPONDER = 1,
6136};
6137
6138/**
6139 * enum ndp_response_code - responder's response code to nan data path request
6140 * @NDP_RESPONSE_ACCEPT: ndp request accepted
6141 * @NDP_RESPONSE_REJECT: ndp request rejected
6142 * @NDP_RESPONSE_DEFER: ndp request deferred until later (response to follow
6143 * any time later)
6144 *
6145 */
6146enum ndp_response_code {
6147 NDP_RESPONSE_ACCEPT = 0,
6148 NDP_RESPONSE_REJECT = 1,
6149 NDP_RESPONSE_DEFER = 2,
6150};
6151
6152/**
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07006153 * enum ndp_end_type - NDP end type
6154 * @NDP_END_TYPE_UNSPECIFIED: type is unspecified
6155 * @NDP_END_TYPE_PEER_UNAVAILABLE: type is peer unavailable
6156 * @NDP_END_TYPE_OTA_FRAME: NDP end frame received from peer
6157 *
6158 */
6159enum ndp_end_type {
6160 NDP_END_TYPE_UNSPECIFIED = 0x00,
6161 NDP_END_TYPE_PEER_UNAVAILABLE = 0x01,
6162 NDP_END_TYPE_OTA_FRAME = 0x02,
6163};
6164
6165/**
6166 * enum ndp_end_reason_code - NDP end reason code
6167 * @NDP_END_REASON_UNSPECIFIED: reason is unspecified
6168 * @NDP_END_REASON_INACTIVITY: reason is peer inactivity
6169 * @NDP_END_REASON_PEER_DATA_END: data end indication received from peer
6170 *
6171 */
6172enum ndp_end_reason_code {
6173 NDP_END_REASON_UNSPECIFIED = 0x00,
6174 NDP_END_REASON_INACTIVITY = 0x01,
6175 NDP_END_REASON_PEER_DATA_END = 0x02,
6176};
6177
6178/**
Naveen Rawat8d63a592016-06-29 18:30:59 -07006179 * enum nan_status_type - NDP status type
6180 * @NDP_RSP_STATUS_SUCCESS: request was successful
6181 * @NDP_RSP_STATUS_ERROR: request failed
6182 */
6183enum nan_status_type {
6184 NDP_RSP_STATUS_SUCCESS = 0x00,
6185 NDP_RSP_STATUS_ERROR = 0x01,
6186};
6187
6188/**
6189 * enum nan_reason_code - NDP command rsp reason code value
6190 * @NDP_UNSUPPORTED_CONCURRENCY: Will be used in unsupported concurrency cases
6191 * @NDP_NAN_DATA_IFACE_CREATE_FAILED: ndi create failed
6192 * @NDP_NAN_DATA_IFACE_DELETE_FAILED: ndi delete failed
6193 * @NDP_DATA_INITIATOR_REQ_FAILED: data initiator request failed
6194 * @NDP_DATA_RESPONDER_REQ_FAILED: data responder request failed
6195 * @NDP_INVALID_SERVICE_INSTANCE_ID: invalid service instance id
6196 * @NDP_INVALID_NDP_INSTANCE_ID: invalid ndp instance id
6197 * @NDP_INVALID_RSP_CODE: invalid response code in ndp responder request
6198 * @NDP_INVALID_APP_INFO_LEN: invalid app info length
6199 * @NDP_NMF_REQ_FAIL: OTA nan mgmt frame failure for data request
6200 * @NDP_NMF_RSP_FAIL: OTA nan mgmt frame failure for data response
6201 * @NDP_NMF_CNF_FAIL: OTA nan mgmt frame failure for confirm
6202 * @NDP_END_FAILED: ndp end failed
6203 * @NDP_NMF_END_REQ_FAIL: OTA nan mgmt frame failure for data end
6204 * @NDP_VENDOR_SPECIFIC_ERROR: other vendor specific failures
6205 */
6206enum nan_reason_code {
6207 NDP_UNSUPPORTED_CONCURRENCY = 9000,
6208 NDP_NAN_DATA_IFACE_CREATE_FAILED = 9001,
6209 NDP_NAN_DATA_IFACE_DELETE_FAILED = 9002,
6210 NDP_DATA_INITIATOR_REQ_FAILED = 9003,
6211 NDP_DATA_RESPONDER_REQ_FAILED = 9004,
6212 NDP_INVALID_SERVICE_INSTANCE_ID = 9005,
6213 NDP_INVALID_NDP_INSTANCE_ID = 9006,
6214 NDP_INVALID_RSP_CODE = 9007,
6215 NDP_INVALID_APP_INFO_LEN = 9008,
6216 NDP_NMF_REQ_FAIL = 9009,
6217 NDP_NMF_RSP_FAIL = 9010,
6218 NDP_NMF_CNF_FAIL = 9011,
6219 NDP_END_FAILED = 9012,
6220 NDP_NMF_END_REQ_FAIL = 9013,
6221 /* 9500 onwards vendor specific error codes */
6222 NDP_VENDOR_SPECIFIC_ERROR = 9500,
6223};
6224
6225/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07006226 * struct ndp_cfg - ndp configuration
6227 * @tag: unique identifier
6228 * @ndp_cfg_len: ndp configuration length
6229 * @ndp_cfg: variable length ndp configuration
6230 *
6231 */
6232struct ndp_cfg {
6233 uint32_t tag;
6234 uint32_t ndp_cfg_len;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006235 uint8_t *ndp_cfg;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006236};
6237
6238/**
6239 * struct ndp_qos_cfg - ndp qos configuration
6240 * @tag: unique identifier
6241 * @ndp_qos_cfg_len: ndp qos configuration length
6242 * @ndp_qos_cfg: variable length ndp qos configuration
6243 *
6244 */
6245struct ndp_qos_cfg {
6246 uint32_t tag;
6247 uint32_t ndp_qos_cfg_len;
6248 uint8_t ndp_qos_cfg[];
6249};
6250
6251/**
6252 * struct ndp_app_info - application info shared during ndp setup
6253 * @tag: unique identifier
6254 * @ndp_app_info_len: ndp app info length
6255 * @ndp_app_info: variable length application information
6256 *
6257 */
6258struct ndp_app_info {
6259 uint32_t tag;
6260 uint32_t ndp_app_info_len;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006261 uint8_t *ndp_app_info;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006262};
6263
6264/**
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006265 * struct ndp_scid - structure to hold sceurity context identifier
6266 * @scid_len: length of scid
6267 * @scid: scid
6268 *
6269 */
6270struct ndp_scid {
6271 uint32_t scid_len;
6272 uint8_t *scid;
6273};
6274
6275/**
6276 * struct ndp_pmk - structure to hold pairwise master key
6277 * @pmk_len: length of pairwise master key
6278 * @pmk: buffer containing pairwise master key
6279 *
6280 */
6281struct ndp_pmk {
6282 uint32_t pmk_len;
6283 uint8_t *pmk;
6284};
6285
6286/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07006287 * struct ndi_create_req - ndi create request params
6288 * @transaction_id: unique identifier
6289 * @iface_name: interface name
6290 *
6291 */
6292struct ndi_create_req {
6293 uint32_t transaction_id;
6294 char iface_name[IFACE_NAME_SIZE];
6295};
6296
6297/**
6298 * struct ndi_create_rsp - ndi create response params
Ravi Joshi412f23d2016-05-26 15:09:23 -07006299 * @status: request status
6300 * @reason: reason if any
6301 *
6302 */
6303struct ndi_create_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07006304 uint32_t status;
6305 uint32_t reason;
Rakesh Sunkicf1c9ab2016-08-25 14:11:25 -07006306 uint8_t sta_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006307};
6308
6309/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07006310 * struct ndi_delete_rsp - ndi delete response params
Ravi Joshi412f23d2016-05-26 15:09:23 -07006311 * @status: request status
6312 * @reason: reason if any
6313 *
6314 */
6315struct ndi_delete_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07006316 uint32_t status;
6317 uint32_t reason;
6318};
6319
6320/**
6321 * struct ndp_initiator_req - ndp initiator request params
6322 * @transaction_id: unique identifier
6323 * @vdev_id: session id of the interface over which ndp is being created
6324 * @channel: suggested channel for ndp creation
Naveen Rawat0a017052016-10-19 14:17:07 -07006325 * @channel_cfg: channel config, 0=no channel, 1=optional, 2=mandatory
Ravi Joshi412f23d2016-05-26 15:09:23 -07006326 * @service_instance_id: Service identifier
6327 * @peer_discovery_mac_addr: Peer's discovery mac address
6328 * @self_ndi_mac_addr: self NDI mac address
6329 * @ndp_config: ndp configuration params
6330 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006331 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
6332 * @pmk: pairwise master key
Ravi Joshi412f23d2016-05-26 15:09:23 -07006333 *
6334 */
6335struct ndp_initiator_req {
6336 uint32_t transaction_id;
6337 uint32_t vdev_id;
6338 uint32_t channel;
Naveen Rawat0a017052016-10-19 14:17:07 -07006339 uint32_t channel_cfg;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006340 uint32_t service_instance_id;
6341 struct qdf_mac_addr peer_discovery_mac_addr;
6342 struct qdf_mac_addr self_ndi_mac_addr;
6343 struct ndp_cfg ndp_config;
6344 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006345 uint32_t ncs_sk_type;
6346 struct ndp_pmk pmk;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006347};
6348
6349/**
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006350 * struct ndp_initiator_rsp - response event from FW
Ravi Joshi412f23d2016-05-26 15:09:23 -07006351 * @transaction_id: unique identifier
6352 * @vdev_id: session id of the interface over which ndp is being created
6353 * @ndp_instance_id: locally created NDP instance ID
6354 * @status: status of the ndp request
6355 * @reason: reason for failure if any
6356 *
6357 */
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006358struct ndp_initiator_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07006359 uint32_t transaction_id;
6360 uint32_t vdev_id;
6361 uint32_t ndp_instance_id;
6362 uint32_t status;
Naveen Rawat8d63a592016-06-29 18:30:59 -07006363 uint32_t reason;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006364};
6365
6366/**
6367 * struct ndp_indication_event - create ndp indication on the responder
6368 * @vdev_id: session id of the interface over which ndp is being created
6369 * @service_instance_id: Service identifier
6370 * @peer_discovery_mac_addr: Peer's discovery mac address
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006371 * @peer_mac_addr: Peer's NDI mac address
Ravi Joshi412f23d2016-05-26 15:09:23 -07006372 * @ndp_initiator_mac_addr: NDI mac address of the peer initiating NDP
6373 * @ndp_instance_id: locally created NDP instance ID
6374 * @role: self role for NDP
6375 * @ndp_accept_policy: accept policy configured by the upper layer
6376 * @ndp_config: ndp configuration params
6377 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006378 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
6379 * @scid: security context identifier
Ravi Joshi412f23d2016-05-26 15:09:23 -07006380 *
6381 */
6382struct ndp_indication_event {
6383 uint32_t vdev_id;
6384 uint32_t service_instance_id;
6385 struct qdf_mac_addr peer_discovery_mac_addr;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006386 struct qdf_mac_addr peer_mac_addr;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006387 uint32_t ndp_instance_id;
6388 enum ndp_self_role role;
6389 enum ndp_accept_policy policy;
6390 struct ndp_cfg ndp_config;
6391 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006392 uint32_t ncs_sk_type;
6393 struct ndp_scid scid;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006394};
6395
6396/**
6397 * struct ndp_responder_req - responder's response to ndp create request
6398 * @transaction_id: unique identifier
6399 * @vdev_id: session id of the interface over which ndp is being created
6400 * @ndp_instance_id: locally created NDP instance ID
6401 * @ndp_rsp: response to the ndp create request
6402 * @ndp_config: ndp configuration params
6403 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006404 * @pmk: pairwise master key
6405 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
Ravi Joshi412f23d2016-05-26 15:09:23 -07006406 *
6407 */
6408struct ndp_responder_req {
6409 uint32_t transaction_id;
6410 uint32_t vdev_id;
6411 uint32_t ndp_instance_id;
6412 enum ndp_response_code ndp_rsp;
6413 struct ndp_cfg ndp_config;
6414 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006415 struct ndp_pmk pmk;
6416 uint32_t ncs_sk_type;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006417};
6418
6419/**
6420 * struct ndp_responder_rsp_event - response to responder's request
6421 * @transaction_id: unique identifier
6422 * @vdev_id: session id of the interface over which ndp is being created
6423 * @status: command status
6424 * @reason: reason for failure if any
Abhishek Singh4fef7472016-06-06 11:36:03 -07006425 * @peer_mac_addr: Peer's mac address
Rakesh Sunkid92d1082017-01-04 15:14:28 -08006426 * @create_peer: Flag to indicate to create peer
Ravi Joshi412f23d2016-05-26 15:09:23 -07006427 */
6428struct ndp_responder_rsp_event {
6429 uint32_t transaction_id;
6430 uint32_t vdev_id;
6431 uint32_t status;
6432 uint32_t reason;
Abhishek Singh4fef7472016-06-06 11:36:03 -07006433 struct qdf_mac_addr peer_mac_addr;
Rakesh Sunkid92d1082017-01-04 15:14:28 -08006434 bool create_peer;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006435};
6436
6437/**
6438 * struct ndp_confirm_event - ndp confirmation event from FW
6439 * @vdev_id: session id of the interface over which ndp is being created
6440 * @ndp_instance_id: ndp instance id for which confirm is being generated
Naveen Rawat460be782016-06-29 18:26:22 -07006441 * @reason_code : reason code(opaque to driver)
6442 * @num_active_ndps_on_peer: number of ndp instances on peer
Ravi Joshi412f23d2016-05-26 15:09:23 -07006443 * @peer_ndi_mac_addr: peer NDI mac address
6444 * @rsp_code: ndp response code
Ravi Joshi412f23d2016-05-26 15:09:23 -07006445 * @ndp_info: ndp application info
6446 *
6447 */
6448struct ndp_confirm_event {
6449 uint32_t vdev_id;
6450 uint32_t ndp_instance_id;
Naveen Rawat460be782016-06-29 18:26:22 -07006451 uint32_t reason_code;
6452 uint32_t num_active_ndps_on_peer;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006453 struct qdf_mac_addr peer_ndi_mac_addr;
6454 enum ndp_response_code rsp_code;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006455 struct ndp_app_info ndp_info;
6456};
6457
6458/**
6459 * struct ndp_end_req - ndp end request
6460 * @transaction_id: unique transaction identifier
Ravi Joshi412f23d2016-05-26 15:09:23 -07006461 * @num_ndp_instances: number of ndp instances to be terminated
Naveen Rawatf28315c2016-06-29 18:06:02 -07006462 * @ndp_ids: pointer to array of ndp_instance_id to be terminated
Ravi Joshi412f23d2016-05-26 15:09:23 -07006463 *
6464 */
6465struct ndp_end_req {
6466 uint32_t transaction_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006467 uint32_t num_ndp_instances;
Naveen Rawatf28315c2016-06-29 18:06:02 -07006468 uint32_t *ndp_ids;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006469};
6470
6471/**
6472 * struct peer_ndp_map - mapping of NDP instances to peer to VDEV
6473 * @vdev_id: session id of the interface over which ndp is being created
6474 * @peer_ndi_mac_addr: peer NDI mac address
6475 * @num_active_ndp_sessions: number of active NDP sessions on the peer
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07006476 * @type: NDP end indication type
6477 * @reason_code: NDP end indication reason code
6478 * @ndp_instance_id: NDP instance ID
Ravi Joshi412f23d2016-05-26 15:09:23 -07006479 *
6480 */
6481struct peer_ndp_map {
6482 uint32_t vdev_id;
6483 struct qdf_mac_addr peer_ndi_mac_addr;
6484 uint32_t num_active_ndp_sessions;
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07006485 enum ndp_end_type type;
6486 enum ndp_end_reason_code reason_code;
6487 uint32_t ndp_instance_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006488};
6489
6490/**
6491 * struct ndp_end_rsp_event - firmware response to ndp end request
6492 * @transaction_id: unique identifier for the request
Naveen Rawatf28315c2016-06-29 18:06:02 -07006493 * @status: status of operation
6494 * @reason: reason(opaque to host driver)
Ravi Joshi412f23d2016-05-26 15:09:23 -07006495 *
6496 */
6497struct ndp_end_rsp_event {
6498 uint32_t transaction_id;
Naveen Rawatf28315c2016-06-29 18:06:02 -07006499 uint32_t status;
6500 uint32_t reason;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006501};
6502
6503/**
6504 * struct ndp_end_indication_event - ndp termination notification from FW
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07006505 * @num_ndp_ids: number of NDP ids
6506 * @ndp_map: mapping of NDP instances to peer and vdev
Ravi Joshi412f23d2016-05-26 15:09:23 -07006507 *
6508 */
6509struct ndp_end_indication_event {
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07006510 uint32_t num_ndp_ids;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006511 struct peer_ndp_map ndp_map[];
6512};
6513
6514/**
6515 * struct ndp_schedule_update_req - ndp schedule update request
6516 * @transaction_id: unique identifier
6517 * @vdev_id: session id of the interface over which ndp is being created
6518 * @ndp_instance_id: ndp instance id for which schedule update is requested
6519 * @ndp_qos: new set of qos parameters
6520 *
6521 */
6522struct ndp_schedule_update_req {
6523 uint32_t transaction_id;
6524 uint32_t vdev_id;
6525 uint32_t ndp_instance_id;
6526 struct ndp_qos_cfg ndp_qos;
6527};
6528
6529/**
6530 * struct ndp_schedule_update_rsp - ndp schedule update response
6531 * @transaction_id: unique identifier
6532 * @vdev_id: session id of the interface over which ndp is being created
6533 * @status: status of the request
6534 * @reason: reason code for failure if any
6535 *
6536 */
6537struct ndp_schedule_update_rsp {
6538 uint32_t transaction_id;
6539 uint32_t vdev_id;
6540 uint32_t status;
6541 uint32_t reason;
6542};
6543
6544/**
6545 * struct sme_ndp_peer_ind - ndp peer indication
6546 * @msg_type: message id
6547 * @msg_len: message length
6548 * @session_id: session id
6549 * @peer_mac_addr: peer mac address
6550 * @sta_id: station id
6551 *
6552 */
6553struct sme_ndp_peer_ind {
6554 uint16_t msg_type;
6555 uint16_t msg_len;
6556 uint8_t session_id;
6557 struct qdf_mac_addr peer_mac_addr;
6558 uint16_t sta_id;
6559};
6560
6561#endif /* WLAN_FEATURE_NAN_DATAPATH */
6562
Peng Xu8fdaa492016-06-22 10:20:47 -07006563/**
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05306564 * struct sir_set_tx_rx_aggregation_size - sets tx rx aggregation size
6565 * @vdev_id: vdev id of the session
Arif Hussain0e246802018-05-01 18:13:44 -07006566 * @aggr_type: TX Aggregation Type (0=A-MPDU, 1=A-MSDU)
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05306567 * @tx_aggregation_size: Tx aggregation size
Paul Zhangee09f8e2018-04-23 16:11:32 +08006568 * @tx_aggregation_size_be: Tx aggregation size for be queue
6569 * @tx_aggregation_size_bk: Tx aggregation size for bk queue
6570 * @tx_aggregation_size_vi: Tx aggregation size for vi queue
6571 * @tx_aggregation_size_vo: Tx aggregation size for vo queue
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05306572 * @rx_aggregation_size: Rx aggregation size
6573 */
6574struct sir_set_tx_rx_aggregation_size {
6575 uint8_t vdev_id;
Arif Hussain0e246802018-05-01 18:13:44 -07006576 wmi_vdev_custom_aggr_type_t aggr_type;
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05306577 uint32_t tx_aggregation_size;
Paul Zhangee09f8e2018-04-23 16:11:32 +08006578 uint32_t tx_aggregation_size_be;
6579 uint32_t tx_aggregation_size_bk;
6580 uint32_t tx_aggregation_size_vi;
6581 uint32_t tx_aggregation_size_vo;
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05306582 uint32_t rx_aggregation_size;
6583};
6584
6585/**
Paul Zhang33fae272018-04-23 16:19:00 +08006586 * struct sir_set_tx_aggr_sw_retry_threshold - set sw retry threshold
6587 * @vdev_id: vdev id of the session
6588 * @tx_aggr_sw_retry_threshold_be: sw retry threshold for BE
6589 * @tx_aggr_sw_retry_threshold_bk: sw retry threshold for BK
6590 * @tx_aggr_sw_retry_threshold_vi: sw retry threshold for VI
6591 * @tx_aggr_sw_retry_threshold_vo: sw retry threshold for VO
6592 */
6593struct sir_set_tx_aggr_sw_retry_threshold {
6594 uint8_t vdev_id;
6595 uint32_t tx_aggr_sw_retry_threshold_be;
6596 uint32_t tx_aggr_sw_retry_threshold_bk;
6597 uint32_t tx_aggr_sw_retry_threshold_vi;
6598 uint32_t tx_aggr_sw_retry_threshold_vo;
6599};
6600
6601/**
Peng Xu8fdaa492016-06-22 10:20:47 -07006602 * struct sir_p2p_lo_start - p2p listen offload start
6603 * @vdev_id: vdev identifier
6604 * @ctl_flags: control flag
6605 * @freq: p2p listen frequency
6606 * @period: listen offload period
6607 * @interval: listen offload interval
6608 * @count: number listen offload intervals
6609 * @device_types: device types
6610 * @dev_types_len: device types length
6611 * @probe_resp_tmplt: probe response template
6612 * @probe_resp_len: probe response template length
6613 */
6614struct sir_p2p_lo_start {
6615 uint32_t vdev_id;
6616 uint32_t ctl_flags;
6617 uint32_t freq;
6618 uint32_t period;
6619 uint32_t interval;
6620 uint32_t count;
6621 uint8_t *device_types;
6622 uint32_t dev_types_len;
6623 uint8_t *probe_resp_tmplt;
6624 uint32_t probe_resp_len;
6625};
6626
6627/**
6628 * struct sir_p2p_lo_event - P2P listen offload stop event
6629 * @vdev_id: vdev identifier
6630 * @reason_code: P2P listen offload stop reason
6631 */
6632struct sir_p2p_lo_event {
6633 uint32_t vdev_id;
6634 uint32_t reason_code;
6635};
Manjeet Singhf82ed072016-07-08 11:40:00 +05306636
6637/**
6638 * struct sir_hal_pwr_dbg_cmd - unit test command parameters
6639 * @pdev_id: pdev id
6640 * @module_id: module id
6641 * @num_args: number of arguments
6642 * @args: arguments
6643 */
6644struct sir_mac_pwr_dbg_cmd {
6645 uint32_t pdev_id;
6646 uint32_t module_id;
6647 uint32_t num_args;
6648 uint32_t args[MAX_POWER_DBG_ARGS_SUPPORTED];
6649};
6650
Kondabattini, Ganesh3f2d02c2016-09-13 12:23:47 +05306651/**
6652 * struct sme_send_disassoc_frm_req - send disassoc request frame
6653 * @msg_type: message type
6654 * @length: length of message
6655 * @session_id: session id
6656 * @trans_id: transaction id
6657 * @peer_mac: peer mac address
6658 * @reason: reason for disassoc
6659 * @wait_for_ack: wait for acknowledgment
6660 **/
6661 struct sme_send_disassoc_frm_req {
6662 uint16_t msg_type;
6663 uint16_t length;
6664 uint8_t session_id;
6665 uint16_t trans_id;
6666 uint8_t peer_mac[6];
6667 uint16_t reason;
6668 uint8_t wait_for_ack;
6669 };
6670
Kondabattini, Ganeshe4f18e02016-09-13 13:01:22 +05306671/**
6672 * struct sme_update_access_policy_vendor_ie - update vendor ie and access
6673 * policy
6674 * @msg_type: message id
6675 * @msg_len: message length
6676 * @sme_session_id: sme session id
6677 * @ie: vendor ie
6678 * @access_policy: access policy for vendor ie
6679 */
6680struct sme_update_access_policy_vendor_ie {
6681 uint16_t msg_type;
6682 uint16_t length;
6683 uint32_t sme_session_id;
6684 uint8_t ie[SIR_MAC_MAX_IE_LENGTH];
6685 uint8_t access_policy;
6686};
6687
Padma, Santhosh Kumard7cc0792016-06-28 18:54:12 +05306688/**
6689 * struct sir_encrypt_decrypt_rsp_params - encrypt/decrypt rsp params
6690 * @vdev_id: vdev id
6691 * @status: status
6692 * @data_length: data length
6693 * @data: data pointer
6694 */
6695struct sir_encrypt_decrypt_rsp_params {
6696 uint32_t vdev_id;
6697 int32_t status;
6698 uint32_t data_length;
6699 uint8_t *data;
6700};
6701
Agrawal, Ashish35b251d2016-09-08 19:21:03 +05306702/**
6703 * struct sme_tx_fail_cnt_threshold - tx failure count for disconnect to fw
6704 * @session_id: Session id
6705 * @tx_fail_cnt_threshold: Tx failure count to do disconnect
6706 */
6707struct sme_tx_fail_cnt_threshold {
6708 uint8_t session_id;
6709 uint32_t tx_fail_cnt_threshold;
6710};
Agrawal Ashishda3e9502016-09-21 17:43:51 +05306711
6712/**
6713 * struct sme_short_retry_limit - transmission retry limit for short frames.
6714 * @session_id: Session id
6715 * @short_retry_limit: tranmission retry limit for short frame.
6716 *
6717 */
6718struct sme_short_retry_limit {
6719 uint8_t session_id;
6720 uint32_t short_retry_limit;
6721};
6722
6723/**
6724 * struct sme_long_retry_limit - tranmission retry limit for long frames
6725 * @session_id: Session id
6726 * @short_retry_limit: tranmission retry limit for long frames.
6727 *
6728 */
6729struct sme_long_retry_limit {
6730 uint8_t session_id;
6731 uint32_t long_retry_limit;
6732};
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05306733
6734/**
Kiran Kumar Lokere08195ef2018-01-17 19:25:15 -08006735 * struct sme_addba_accept - Allow/reject the addba request frame
6736 * @session_id: Session id
6737 * @addba_accept: Allow/reject the addba request frame
6738 */
6739struct sme_addba_accept {
6740 uint8_t session_id;
6741 uint8_t addba_accept;
6742};
6743
6744/**
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05306745 * struct sme_sta_inactivity_timeout - set sta_inactivity_timeout
6746 * @session_id: session Id.
6747 * @sta_inactivity_timeout: Timeout to disconnect STA after there
6748 * is no activity.
6749 */
6750struct sme_sta_inactivity_timeout {
6751 uint8_t session_id;
6752 uint32_t sta_inactivity_timeout;
6753};
Yingying Tang95409972016-10-20 15:16:15 +08006754
6755/*
6756 * struct wow_pulse_mode - WoW Pulse set cmd struct
6757 * @wow_pulse_enable: enable or disable this feature
6758 * @wow_pulse_pin: GPIO PIN for Pulse
6759 * @wow_pulse_interval_low: Pulse interval low
6760 * @wow_pulse_interval_high: Pulse interval high
6761 *
6762 * SME uses this structure to configure wow pulse info
6763 * and send it to WMA
6764 */
6765struct wow_pulse_mode {
6766 bool wow_pulse_enable;
6767 uint8_t wow_pulse_pin;
6768 uint16_t wow_pulse_interval_high;
6769 uint16_t wow_pulse_interval_low;
6770};
6771
Rajeev Kumare406d652017-01-30 17:47:05 -08006772
6773/**
Rajeev Kumard138ac52017-01-30 18:38:37 -08006774 * umac_send_mb_message_to_mac(): post message to umac
Rajeev Kumare406d652017-01-30 17:47:05 -08006775 * @msg: opaque message pointer
6776 *
6777 * Return: QDF status
6778 */
Rajeev Kumard138ac52017-01-30 18:38:37 -08006779QDF_STATUS umac_send_mb_message_to_mac(void *msg);
Rajeev Kumare406d652017-01-30 17:47:05 -08006780
Kapil Gupta4f0c0c12017-02-07 15:21:15 +05306781/**
6782 * struct scan_chan_info - channel info
6783 * @freq: radio frequence
6784 * @cmd flag: cmd flag
6785 * @noise_floor: noise floor
6786 * @cycle_count: cycle count
6787 * @rx_clear_count: rx clear count
6788 * @tx_frame_count: TX frame count
6789 * @clock_freq: clock frequence MHZ
6790 */
6791struct scan_chan_info {
6792 uint32_t freq;
6793 uint32_t cmd_flag;
6794 uint32_t noise_floor;
6795 uint32_t cycle_count;
6796 uint32_t rx_clear_count;
6797 uint32_t tx_frame_count;
6798 uint32_t clock_freq;
6799};
Dustin Brown54096432017-02-23 13:00:44 -08006800
6801/**
6802 * enum wow_resume_trigger - resume trigger override setting values
6803 * @WOW_RESUME_TRIGGER_DEFAULT: fw to use platform default resume trigger
6804 * @WOW_RESUME_TRIGGER_HTC_WAKEUP: force fw to use HTC Wakeup to resume
6805 * @WOW_RESUME_TRIGGER_GPIO: force fw to use GPIO to resume
6806 * @WOW_RESUME_TRIGGER_COUNT: number of resume trigger options
6807 */
6808enum wow_resume_trigger {
6809 /* always first */
6810 WOW_RESUME_TRIGGER_DEFAULT = 0,
6811 WOW_RESUME_TRIGGER_HTC_WAKEUP,
6812 WOW_RESUME_TRIGGER_GPIO,
6813 /* always last */
6814 WOW_RESUME_TRIGGER_COUNT
6815};
6816
6817/**
6818 * enum wow_interface_pause - interface pause override setting values
6819 * @WOW_INTERFACE_PAUSE_DEFAULT: use platform default interface pause setting
6820 * @WOW_INTERFACE_PAUSE_ENABLE: force interface pause setting to enabled
6821 * @WOW_INTERFACE_PAUSE_DISABLE: force interface pause setting to disabled
6822 * @WOW_INTERFACE_PAUSE_COUNT: number of interface pause options
6823 */
6824enum wow_interface_pause {
6825 /* always first */
6826 WOW_INTERFACE_PAUSE_DEFAULT = 0,
6827 WOW_INTERFACE_PAUSE_ENABLE,
6828 WOW_INTERFACE_PAUSE_DISABLE,
6829 /* always last */
6830 WOW_INTERFACE_PAUSE_COUNT
6831};
6832
6833/**
6834 * struct wow_enable_params - A collection of wow enable override parameters
6835 * @is_unit_test: true to notify fw this is a unit-test suspend
6836 * @interface_pause: used to override the interface pause indication sent to fw
6837 * @resume_trigger: used to force fw to use a particular resume method
6838 */
6839struct wow_enable_params {
6840 bool is_unit_test;
6841 enum wow_interface_pause interface_pause;
6842 enum wow_resume_trigger resume_trigger;
6843};
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07006844
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08006845#define HE_LTF_1X 0
6846#define HE_LTF_2X 1
6847#define HE_LTF_4X 2
6848
6849#define HE_LTF_ALL 0x7
6850#define HE_SGI_MASK 0xFF00
6851
6852#define AUTO_RATE_GI_400NS 8
6853#define AUTO_RATE_GI_800NS 9
6854#define AUTO_RATE_GI_1600NS 10
6855#define AUTO_RATE_GI_3200NS 11
6856
6857#define SET_AUTO_RATE_SGI_VAL(set_val, bit_mask) \
6858 (set_val = (set_val & HE_LTF_ALL) | bit_mask)
6859
6860#define SET_AUTO_RATE_HE_LTF_VAL(set_val, bit_mask) \
6861 (set_val = (set_val & HE_SGI_MASK) | bit_mask)
6862
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07006863#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -07006864#define HE_CAP_OUI_TYPE "\x23"
6865#define HE_CAP_OUI_SIZE 1
6866#define HE_OP_OUI_TYPE "\x24"
6867#define HE_OP_OUI_SIZE 1
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08006868
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07006869#define HE_RU_ALLOC_INDX0_MASK (0x01 << 0)
6870#define HE_RU_ALLOC_INDX1_MASK (0x01 << 1)
6871#define HE_RU_ALLOC_INDX2_MASK (0x01 << 2)
6872#define HE_RU_ALLOC_INDX3_MASK (0x01 << 3)
6873
6874/* 3 bits for NSS and 4 bits for RU Index */
6875#define HE_PPET_NSS_LEN 3
6876#define HE_PEPT_RU_IDX_LEN 4
6877#define HE_PPET_NSS_RU_LEN (HE_PPET_NSS_LEN + HE_PEPT_RU_IDX_LEN)
6878#define HE_PPET_SIZE 3
6879#define HE_BYTE_SIZE 8
6880
Naveen Rawat819158d2018-01-16 10:56:45 -08006881struct ppet_hdr {
6882 uint8_t nss:3;
6883 uint8_t ru_idx_mask:4;
6884 uint8_t remaining:1;
6885};
6886
6887/* MAX PPET size = 7 bits + (max_nss X max_ru_number X 6) = 25 bytes */
6888#define HE_MAX_PPET_SIZE WNI_CFG_HE_PPET_LEN
6889
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -08006890#define HE_MAX_PHY_CAP_SIZE 3
6891
Naveen Rawataeca1b92017-10-16 16:55:31 -07006892#define HE_CH_WIDTH_GET_BIT(ch_wd, bit) (((ch_wd) >> (bit)) & 1)
6893#define HE_CH_WIDTH_COMBINE(b0, b1, b2, b3, b4, b5, b6) \
6894 ((uint8_t)(b0) | ((b1) << 1) | ((b2) << 2) | ((b3) << 3) | \
6895 ((b4) << 4) | ((b5) << 5) | ((b6) << 6))
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -07006896
Naveen Rawataeca1b92017-10-16 16:55:31 -07006897/*
6898 * MCS values are interpreted as in IEEE 11ax-D1.4 spec onwards
6899 * +-----------------------------------------------------+
6900 * | SS8 | SS7 | SS6 | SS5 | SS4 | SS3 | SS2 | SS1 |
6901 * +-----------------------------------------------------+
6902 * | 15-14 | 13-12 | 11-10 | 9-8 | 7-6 | 5-4 | 3-2 | 1-0 |
6903 * +-----------------------------------------------------+
6904 */
6905#define HE_MCS_NSS_SHIFT(nss) (((nss) - 1) << 1)
6906#define HE_MCS_MSK_4_NSS(nss) (3 << HE_MCS_NSS_SHIFT(nss))
6907#define HE_MCS_INV_MSK_4_NSS(nss) (~HE_MCS_MSK_4_NSS(nss))
6908#define HE_GET_MCS_4_NSS(mcs_set, nss) \
6909 (((mcs_set) >> HE_MCS_NSS_SHIFT(nss)) & 3)
6910#define HE_SET_MCS_4_NSS(mcs_set, mcs, nss) \
6911 (((mcs_set) & HE_MCS_INV_MSK_4_NSS(nss)) | \
6912 ((mcs) << HE_MCS_NSS_SHIFT(nss)))
6913#define HE_MCS_IS_NSS_ENABLED(mcs_set, nss) \
6914 ((HE_MCS_MSK_4_NSS(nss) & (mcs_set)) != HE_MCS_MSK_4_NSS(nss))
6915
6916#define HE_MCS_ALL_DISABLED 0xFFFF
Kiran Kumar Lokere59a569e2018-01-24 15:00:50 -08006917
6918#define HE_MCS_0_7 0x0
6919#define HE_MCS_0_9 0x1
6920#define HE_MCS_0_11 0x2
6921#define HE_MCS_DISABLE 0x3
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08006922
Naveen Rawataeca1b92017-10-16 16:55:31 -07006923/*
6924 * Following formuala has been arrived at using karnaugh map and unit tested
6925 * with sample code. Take MCS for each NSS as 2 bit value first and solve for
6926 * 2 bit intersection of NSS. Use following table/Matrix as guide for solving
6927 * K-Maps
6928 * MCS 1\MCS 2 00 01 10 11
6929 * 00 00 00 00 11
6930 * 01 00 01 01 11
6931 * 10 00 01 10 11
6932 * 11 11 11 11 11
6933 * if output MCS is o1o0, then as per K-map reduction:
6934 * o0 = m1.m0 | n1.n0 | (~m1).m0.(n1^n0) | (~n1).n0.(m1^m0)
6935 * o1 = m1.m0 | n1.n0 | m1.(~m0).n1.(~n0)
6936 *
6937 * Please note: Calculating MCS intersection is 80211 protocol specific and
6938 * should be implemented in PE. WMA can use this macro rather than calling any
6939 * lim API to do the intersection.
6940 */
6941#define HE_INTERSECT_MCS_BITS_PER_NSS(m1, m0, n1, n0) \
6942 (((m1 & m0) | (n1 & n0) | (((~m1) & m0) & (n1 ^ n0)) | \
6943 (((~n1) & n0) & (m1 ^ m0))) | (((m1 & m0) | (n1 & n0) | \
6944 (m1 & ~m0 & n1 & ~n0)) << 1))
6945
6946/* following takes MCS as 2 bits */
6947#define HE_INTERSECT_MCS_PER_NSS(mcs_1, mcs_2) \
6948 HE_INTERSECT_MCS_BITS_PER_NSS((mcs_1 >> 1), (mcs_1 & 1), \
6949 (mcs_2 >> 1), (mcs_2 & 1))
6950
6951/* following takes MCS as 16 bits */
6952#define HE_INTERSECT_MCS(mcs_1, mcs_2) ( \
6953 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 1), \
6954 HE_GET_MCS_4_NSS(mcs_2, 1)) << HE_MCS_NSS_SHIFT(1) | \
6955 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 2), \
6956 HE_GET_MCS_4_NSS(mcs_2, 2)) << HE_MCS_NSS_SHIFT(2) | \
6957 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 3), \
6958 HE_GET_MCS_4_NSS(mcs_2, 3)) << HE_MCS_NSS_SHIFT(3) | \
6959 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 4), \
6960 HE_GET_MCS_4_NSS(mcs_2, 4)) << HE_MCS_NSS_SHIFT(4) | \
6961 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 5), \
6962 HE_GET_MCS_4_NSS(mcs_2, 5)) << HE_MCS_NSS_SHIFT(5) | \
6963 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 6), \
6964 HE_GET_MCS_4_NSS(mcs_2, 6)) << HE_MCS_NSS_SHIFT(6) | \
6965 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 7), \
6966 HE_GET_MCS_4_NSS(mcs_2, 7)) << HE_MCS_NSS_SHIFT(7) | \
6967 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 8), \
6968 HE_GET_MCS_4_NSS(mcs_2, 8)) << HE_MCS_NSS_SHIFT(8))
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -07006969
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -08006970/**
6971 * struct he_capability - to store 11ax HE capabilities
6972 * @phy_cap: HE PHY capabilities
6973 * @mac_cap: HE MAC capabilities
6974 * @mcs: HE MCS
6975 * @ppet: HE PPE threshold
6976 */
6977struct he_capability {
6978 uint32_t phy_cap[HE_MAX_PHY_CAP_SIZE];
6979 uint32_t mac_cap;
6980 uint32_t mcs;
6981 struct wlan_psoc_host_ppe_threshold ppet;
6982};
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07006983#endif
6984
Naveen Rawataeca1b92017-10-16 16:55:31 -07006985#define HE_GET_NSS(mcs, nss) \
6986 do { \
6987 (nss) = 0; \
Naveen Rawatcbcc6542017-10-30 17:55:03 -07006988 while ((((mcs) >> ((nss)*2)) & 3) != 3 && nss < 8) \
Naveen Rawataeca1b92017-10-16 16:55:31 -07006989 (nss)++; \
6990 } while (0)
6991
Nitesh Shah99dd9552017-03-20 19:27:47 +05306992/**
6993 * struct sir_del_all_tdls_peers - delete all tdls peers
6994 * @msg_type: type of message
6995 * @msg_len: length of message
6996 * @bssid: bssid of peer device
6997 */
6998struct sir_del_all_tdls_peers {
6999 uint16_t msg_type;
7000 uint16_t msg_len;
7001 struct qdf_mac_addr bssid;
7002};
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08007003
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05307004/**
7005 * struct rsp_stats - arp packet stats
7006 * @arp_req_enqueue: fw tx count
7007 * @arp_req_tx_success: tx ack count
7008 * @arp_req_tx_failure: tx ack fail count
7009 * @arp_rsp_recvd: rx fw count
7010 * @out_of_order_arp_rsp_drop_cnt: out of order count
7011 * @dad_detected: dad detected
7012 * @connect_status: connection status
7013 * @ba_session_establishment_status: BA session status
Poddar, Siddarth465330e2018-01-08 18:23:54 +05307014 * @connect_stats_present: connectivity stats present or not
7015 * @tcp_ack_recvd: tcp syn ack's count
7016 * @icmpv4_rsp_recvd: icmpv4 responses count
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05307017 */
7018struct rsp_stats {
7019 uint32_t vdev_id;
7020 uint32_t arp_req_enqueue;
7021 uint32_t arp_req_tx_success;
7022 uint32_t arp_req_tx_failure;
7023 uint32_t arp_rsp_recvd;
7024 uint32_t out_of_order_arp_rsp_drop_cnt;
7025 uint32_t dad_detected;
7026 uint32_t connect_status;
7027 uint32_t ba_session_establishment_status;
Poddar, Siddarth465330e2018-01-08 18:23:54 +05307028 bool connect_stats_present;
7029 uint32_t tcp_ack_recvd;
7030 uint32_t icmpv4_rsp_recvd;
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05307031};
7032
7033/**
7034 * struct set_arp_stats_params - set/reset arp stats
7035 * @vdev_id: session id
7036 * @flag: enable/disable stats
7037 * @pkt_type: type of packet(1 - arp)
7038 * @ip_addr: subnet ipv4 address in case of encrypted packets
Poddar, Siddarth465330e2018-01-08 18:23:54 +05307039 * @pkt_type_bitmap: pkt bitmap
7040 * @tcp_src_port: tcp src port for pkt tracking
7041 * @tcp_dst_port: tcp dst port for pkt tracking
7042 * @icmp_ipv4: target ipv4 address to track ping packets
7043 * @reserved: reserved
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05307044 */
7045struct set_arp_stats_params {
7046 uint32_t vdev_id;
7047 uint8_t flag;
7048 uint8_t pkt_type;
7049 uint32_t ip_addr;
Poddar, Siddarth465330e2018-01-08 18:23:54 +05307050 uint32_t pkt_type_bitmap;
7051 uint32_t tcp_src_port;
7052 uint32_t tcp_dst_port;
7053 uint32_t icmp_ipv4;
7054 uint32_t reserved;
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05307055};
7056
7057/**
7058 * struct get_arp_stats_params - get arp stats from firmware
7059 * @pkt_type: packet type(1 - ARP)
7060 * @vdev_id: session id
7061 */
7062struct get_arp_stats_params {
7063 uint8_t pkt_type;
7064 uint32_t vdev_id;
7065};
7066
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05307067typedef void (*sme_rcpi_callback)(void *context, struct qdf_mac_addr mac_addr,
7068 int32_t rcpi, QDF_STATUS status);
7069/**
7070 * struct sme_rcpi_req - structure for querying rcpi info
7071 * @session_id: session for which rcpi is required
7072 * @measurement_type: type of measurement from enum rcpi_measurement_type
7073 * @rcpi_callback: callback function to be invoked for rcpi response
7074 * @rcpi_context: context info for rcpi callback
7075 * @mac_addr: peer addr for which rcpi is required
7076 */
7077struct sme_rcpi_req {
7078 uint32_t session_id;
7079 enum rcpi_measurement_type measurement_type;
7080 sme_rcpi_callback rcpi_callback;
7081 void *rcpi_context;
7082 struct qdf_mac_addr mac_addr;
7083};
7084
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08007085/*
7086 * @SCAN_REJECT_DEFAULT: default value
7087 * @CONNECTION_IN_PROGRESS: connection is in progress
7088 * @REASSOC_IN_PROGRESS: reassociation is in progress
7089 * @EAPOL_IN_PROGRESS: STA/P2P-CLI is in middle of EAPOL/WPS exchange
7090 * @SAP_EAPOL_IN_PROGRESS: SAP/P2P-GO is in middle of EAPOL/WPS exchange
7091 */
7092enum scan_reject_states {
7093 SCAN_REJECT_DEFAULT = 0,
7094 CONNECTION_IN_PROGRESS,
7095 REASSOC_IN_PROGRESS,
7096 EAPOL_IN_PROGRESS,
7097 SAP_EAPOL_IN_PROGRESS,
7098};
Sandeep Puligillaf587adf2017-04-27 19:53:21 -07007099
7100/**
lifeng66831662017-05-19 16:01:35 +08007101 * sir_sme_rx_aggr_hole_ind - sme rx aggr hole indication
7102 * @hole_cnt: num of holes detected
7103 * @hole_info_array: hole info
7104 */
7105struct sir_sme_rx_aggr_hole_ind {
7106 uint32_t hole_cnt;
7107 uint32_t hole_info_array[];
7108};
7109
7110/**
7111 * struct sir_set_rx_reorder_timeout_val - rx reorder timeout
7112 * @rx_timeout_pri: reorder timeout for AC
7113 * rx_timeout_pri[0] : AC_VO
7114 * rx_timeout_pri[1] : AC_VI
7115 * rx_timeout_pri[2] : AC_BE
7116 * rx_timeout_pri[3] : AC_BK
7117 */
7118struct sir_set_rx_reorder_timeout_val {
7119 uint32_t rx_timeout_pri[4];
7120};
7121
7122/**
7123 * struct sir_peer_set_rx_blocksize - set rx blocksize
7124 * @vdev_id: vdev id
7125 * @peer_macaddr: peer mac address
7126 * @rx_block_ack_win_limit: windows size limitation
7127 */
7128struct sir_peer_set_rx_blocksize {
7129 uint32_t vdev_id;
7130 struct qdf_mac_addr peer_macaddr;
7131 uint32_t rx_block_ack_win_limit;
7132};
Abhishek Singhf3756fc2017-06-28 16:04:06 +05307133
7134/**
7135 * struct sir_rssi_disallow_lst - Structure holding Rssi based avoid candidate
7136 * list
7137 * @node: Node pointer
7138 * @bssid: BSSID of the AP
7139 * @retry_delay: Retry delay received during last rejection in ms
7140 * @ expected_rssi: RSSI at which STA can initate
7141 * @time_during_rejection: Timestamp during last rejection in millisec
7142 */
7143struct sir_rssi_disallow_lst {
7144 qdf_list_node_t node;
7145 struct qdf_mac_addr bssid;
7146 uint32_t retry_delay;
7147 int8_t expected_rssi;
7148 qdf_time_t time_during_rejection;
7149};
lifengd217d192017-05-09 19:44:16 +08007150
7151/**
7152 * struct chain_rssi_result - chain rssi result
Jeff Johnson00634ab2018-05-10 14:27:50 -07007153 * num_chains_valid: valid chain num
lifengd217d192017-05-09 19:44:16 +08007154 * @chain_rssi: chain rssi result as dBm unit
lifengfe6c3e22018-04-03 12:10:04 +08007155 * @ant_id: antenna id
lifengd217d192017-05-09 19:44:16 +08007156 */
lifengfe6c3e22018-04-03 12:10:04 +08007157#define CHAIN_MAX_NUM 8
lifengd217d192017-05-09 19:44:16 +08007158struct chain_rssi_result {
lifengfe6c3e22018-04-03 12:10:04 +08007159 uint32_t num_chains_valid;
7160 uint32_t chain_rssi[CHAIN_MAX_NUM];
7161 uint32_t ant_id[CHAIN_MAX_NUM];
lifengd217d192017-05-09 19:44:16 +08007162};
7163
7164/**
7165 * struct get_chain_rssi_req_params - get chain rssi req params
7166 * @peer_macaddr: specific peer mac address
7167 * @session_id: session id
7168 */
7169struct get_chain_rssi_req_params {
7170 struct qdf_mac_addr peer_macaddr;
7171 uint8_t session_id;
7172};
7173
Ganesh Kondabattini35739572017-06-21 16:26:39 +05307174/*
7175 * struct sir_limit_off_chan - limit off-channel command parameters
7176 * @vdev_id: vdev id
7177 * @is_tos_active: status of the traffic (active/inactive)
7178 * @max_off_chan_time: max allowed off channel time
7179 * @rest_time: home channel time
7180 * @skip_dfs_chans: skip dfs channels during scan
7181 */
7182struct sir_limit_off_chan {
7183 uint8_t vdev_id;
7184 bool is_tos_active;
7185 uint32_t max_off_chan_time;
7186 uint32_t rest_time;
7187 bool skip_dfs_chans;
7188};
Padma, Santhosh Kumarb38ab512018-01-16 16:16:46 +05307189
Rajeev Kumar Sirasanagandla4f20b672018-03-12 13:52:50 +05307190typedef void (*roam_scan_stats_cb)(void *context,
7191 struct wmi_roam_scan_stats_res *res);
7192
7193/**
7194 * struct sir_roam_scan_stats - Stores roam scan context
7195 * @vdev_id: vdev id
7196 * @cb: callback to be invoked for roam scan stats response
7197 * @context: context of callback
7198 */
7199struct sir_roam_scan_stats {
7200 uint32_t vdev_id;
7201 roam_scan_stats_cb cb;
7202 void *context;
7203};
7204
Padma, Santhosh Kumarb38ab512018-01-16 16:16:46 +05307205/**
7206 * struct sae_info - SAE info used for commit/confirm messages
7207 * @msg_type: Message type
7208 * @msg_len: length of message
7209 * @vdev_id: vdev id
7210 * @peer_mac_addr: peer MAC address
7211 * @ssid: SSID
7212 */
7213struct sir_sae_info {
7214 uint16_t msg_type;
7215 uint16_t msg_len;
7216 uint32_t vdev_id;
7217 struct qdf_mac_addr peer_mac_addr;
7218 tSirMacSSid ssid;
7219};
Padma, Santhosh Kumardd3f4852018-01-16 18:51:51 +05307220
7221/**
7222 * struct sir_sae_msg - SAE msg used for message posting
7223 * @message_type: message type
7224 * @length: message length
7225 * @session_id: SME session id
7226 * @sae_status: SAE status, 0: Success, Non-zero: Failure.
7227 */
7228struct sir_sae_msg {
7229 uint16_t message_type;
7230 uint16_t length;
7231 uint16_t session_id;
7232 uint8_t sae_status;
7233};
7234
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08007235#endif /* __SIR_API_H */