blob: 2b90af51a6961c98f3954e667fc0b11c457ffa78 [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,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800281 eSIR_DONOT_USE_RESULT_CODE = SIR_MAX_ENUM_SIZE
282} tSirResultCodes;
283
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +0530284#ifdef WLAN_FEATURE_FILS_SK
285struct fils_join_rsp_params {
286 uint8_t *fils_pmk;
287 uint8_t fils_pmk_len;
288 uint8_t fils_pmkid[PMKID_LEN];
289 uint8_t kek[MAX_KEK_LEN];
290 uint8_t kek_len;
291 uint8_t tk[MAX_TK_LEN];
292 uint8_t tk_len;
293 uint8_t gtk_len;
294 uint8_t gtk[MAX_GTK_LEN];
Vignesh Viswanathana1bb0922017-09-15 12:58:48 +0530295 struct qdf_mac_addr dst_mac;
296 struct qdf_mac_addr src_mac;
297 uint16_t hlp_data_len;
298 uint8_t hlp_data[FILS_MAX_HLP_DATA_LEN];
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +0530299};
300#endif
301
Krishna Kumaar Natarajanf599c6e2015-11-03 11:44:03 -0800302#define RMENABLEDCAP_MAX_LEN 5
303
304struct rrm_config_param {
305 uint8_t rrm_enabled;
306 uint8_t max_randn_interval;
307 uint8_t rm_capability[RMENABLEDCAP_MAX_LEN];
308};
309
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800310/*
311 * although in tSirSupportedRates each IE is 16bit but PE only passes IEs in 8
312 * bits with MSB=1 for basic rates. change the mask for bit0-7 only so HAL gets
313 * correct basic rates for setting response rates.
314 */
315#define IERATE_BASICRATE_MASK 0x80
316#define IERATE_RATE_MASK 0x7f
317#define IERATE_IS_BASICRATE(x) ((x) & IERATE_BASICRATE_MASK)
318
Sreelakshmi Konamki39acb132015-12-16 13:06:22 +0530319const char *lim_bss_type_to_string(const uint16_t bss_type);
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700320/**
321 * struct sSirSupportedRates - stores rates/MCS supported
322 * @llbRates: 11b rates in unit of 500kbps
323 * @llaRates: 11a rates in unit of 500kbps
324 * @supportedMCSSet: supported basic MCS, 0-76 bits used, remaining reserved
325 * bits 0-15 and 32 should be set.
326 * @rxHighestDataRate: RX Highest Supported Data Rate defines the highest data
327 * rate that the STA is able to receive, in unites of 1Mbps
328 * This value is derived from "Supported MCS Set field"
329 * inside the HT capability element.
330 * @vhtRxMCSMap: Indicates the Maximum MCS(VHT) that can be received for each
331 * number of spacial streams
332 * @vhtRxHighestDataRate: Indicate the highest VHT data rate that the STA is
333 * able to receive
334 * @vhtTxMCSMap: Indicates the Maximum MCS(VHT) that can be transmitted for
335 * each number of spacial streams
336 * @vhtTxHighestDataRate: Indicate the highest VHT data rate that the STA is
337 * able to transmit
338 * @he_rx_mcs: Indicates the Maximum MCS(HE) that can be received for each
339 * number of spacial streams
340 * @he_tx_mcs: Indicates the Maximum MCS(HE) that can be transmitted for each
341 * number of spacial streams
342 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800343typedef struct sSirSupportedRates {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800344 uint16_t llbRates[SIR_NUM_11B_RATES];
345 uint16_t llaRates[SIR_NUM_11A_RATES];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800346 uint8_t supportedMCSSet[SIR_MAC_MAX_SUPPORTED_MCS_SET];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800347 uint16_t rxHighestDataRate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800348 uint16_t vhtRxMCSMap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800349 uint16_t vhtRxHighestDataRate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800350 uint16_t vhtTxMCSMap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800351 uint16_t vhtTxHighestDataRate;
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700352#ifdef WLAN_FEATURE_11AX
Naveen Rawataeca1b92017-10-16 16:55:31 -0700353 uint16_t rx_he_mcs_map_lt_80;
354 uint16_t tx_he_mcs_map_lt_80;
355 uint16_t rx_he_mcs_map_160;
356 uint16_t tx_he_mcs_map_160;
357 uint16_t rx_he_mcs_map_80_80;
358 uint16_t tx_he_mcs_map_80_80;
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700359#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800360} tSirSupportedRates, *tpSirSupportedRates;
361
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800362typedef struct sSirRemainOnChnReq {
363 uint16_t messageType;
364 uint16_t length;
365 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530366 struct qdf_mac_addr selfMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800367 uint8_t chnNum;
368 uint8_t phyMode;
369 uint32_t duration;
370 uint8_t isProbeRequestAllowed;
371 uint32_t scan_id;
372 uint8_t probeRspIe[1];
373} tSirRemainOnChnReq, *tpSirRemainOnChnReq;
374
375/**
376 * struct sir_roc_rsp - Structure to store the remain on channel response
377 * @message_type: Message Type
378 * @length: Message Length
379 * @session_id: SME session Id
380 * @scan_id : scan identifier
381 * @status: result status
382 */
383struct sir_roc_rsp {
384 uint16_t message_type;
385 uint16_t length;
386 uint8_t session_id;
387 uint32_t scan_id;
388 tSirResultCodes status;
389};
390
391typedef struct sSirRegisterMgmtFrame {
392 uint16_t messageType;
393 uint16_t length;
394 uint8_t sessionId;
395 bool registerFrame;
396 uint16_t frameType;
397 uint16_t matchLen;
398 uint8_t matchData[1];
399} tSirRegisterMgmtFrame, *tpSirRegisterMgmtFrame;
400
401/* / Generic type for sending a response message */
402/* / with result code to host software */
403typedef struct sSirSmeRsp {
404 uint16_t messageType; /* eWNI_SME_*_RSP */
405 uint16_t length;
406 uint8_t sessionId; /* To support BT-AMP */
407 uint16_t transactionId; /* To support BT-AMP */
408 tSirResultCodes statusCode;
Kabilan Kannanf56f9d52017-04-05 03:31:34 -0700409 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800410} tSirSmeRsp, *tpSirSmeRsp;
411
412/* / Definition for indicating all modules ready on STA */
413typedef struct sSirSmeReadyReq {
414 uint16_t messageType; /* eWNI_SME_SYS_READY_IND */
415 uint16_t length;
416 uint16_t transactionId;
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800417 void *csr_roam_synch_cb;
418 void *pe_roam_synch_cb;
Jeff Johnson5f9ce2d2018-06-09 21:20:45 -0700419 QDF_STATUS (*sme_msg_cb)(tpAniSirGlobal mac,
420 struct scheduler_msg *msg);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800421} tSirSmeReadyReq, *tpSirSmeReadyReq;
422
423/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800424 * struct s_sir_set_hw_mode - Set HW mode request
425 * @messageType: Message type
426 * @length: Length of the message
427 * @set_hw: Params containing the HW mode index and callback
428 */
429struct s_sir_set_hw_mode {
430 uint16_t messageType;
431 uint16_t length;
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -0800432 struct policy_mgr_hw_mode set_hw;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800433};
434
435/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800436 * struct sir_set_dual_mac_cfg - Set Dual mac config request
437 * @message_type: Message type
438 * @length: Length of the message
439 * @set_dual_mac: Params containing the dual mac config and callback
440 */
441struct sir_set_dual_mac_cfg {
442 uint16_t message_type;
443 uint16_t length;
Srinivas Girigowdaeb6ecf32018-02-15 17:04:22 -0800444 struct policy_mgr_dual_mac_config set_dual_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800445};
446
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800447/**
448 * struct sir_antenna_mode_param - antenna mode param
449 * @num_tx_chains: Number of TX chains
450 * @num_rx_chains: Number of RX chains
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800451 * @set_antenna_mode_resp: callback to set antenna mode command
Dundi Raviteja6bb9e322018-05-16 17:04:41 +0530452 * @set_antenna_mode_ctx: callback context to set antenna mode command
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800453 */
454struct sir_antenna_mode_param {
455 uint32_t num_tx_chains;
456 uint32_t num_rx_chains;
457 void *set_antenna_mode_resp;
Dundi Raviteja6bb9e322018-05-16 17:04:41 +0530458 void *set_antenna_mode_ctx;
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800459};
460
461/**
462 * struct sir_set_antenna_mode - Set antenna mode request
463 * @message_type: Message type
464 * @length: Length of the message
465 * @set_antenna_mode: Params containing antenna mode params
466 */
467struct sir_set_antenna_mode {
468 uint16_t message_type;
469 uint16_t length;
470 struct sir_antenna_mode_param set_antenna_mode;
471};
472
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700473/**
474 * enum tSirBssType - Enum for BSS type used in scanning/joining etc.
475 *
476 * @eSIR_INFRASTRUCTURE_MODE: Infrastructure station
477 * @eSIR_INFRA_AP_MODE: softAP mode
478 * @eSIR_IBSS_MODE: IBSS mode
479 * @eSIR_AUTO_MODE: Auto role
480 * @eSIR_MONITOR_MODE: Monitor mode
481 * @eSIR_NDI_MODE: NAN datapath mode
482 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800483typedef enum eSirBssType {
484 eSIR_INFRASTRUCTURE_MODE,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700485 eSIR_INFRA_AP_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800486 eSIR_IBSS_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800487 eSIR_AUTO_MODE,
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -0700488 eSIR_MONITOR_MODE,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700489 eSIR_NDI_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800490 eSIR_DONOT_USE_BSS_TYPE = SIR_MAX_ENUM_SIZE
491} tSirBssType;
492
493/* / Power Capability info used in 11H */
494typedef struct sSirMacPowerCapInfo {
495 uint8_t minTxPower;
496 uint8_t maxTxPower;
497} tSirMacPowerCapInfo, *tpSirMacPowerCapInfo;
498
499/* / Supported Channel info used in 11H */
500typedef struct sSirSupChnl {
501 uint8_t numChnl;
502 uint8_t channelList[SIR_MAX_SUPPORTED_CHANNEL_LIST];
503} tSirSupChnl, *tpSirSupChnl;
504
505typedef enum eSirNwType {
506 eSIR_11A_NW_TYPE,
507 eSIR_11B_NW_TYPE,
508 eSIR_11G_NW_TYPE,
509 eSIR_11N_NW_TYPE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800510 eSIR_11AC_NW_TYPE,
Krishna Kumaar Natarajan4f1d7722017-03-03 21:12:51 -0800511 eSIR_11AX_NW_TYPE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800512 eSIR_DONOT_USE_NW_TYPE = SIR_MAX_ENUM_SIZE
513} tSirNwType;
514
515/* / Definition for new iBss peer info */
516typedef struct sSirNewIbssPeerInfo {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530517 struct qdf_mac_addr peerAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800518 uint16_t aid;
519} tSirNewIbssPeerInfo, *tpSirNewIbssPeerInfo;
520
521/* HT configuration values */
522typedef struct sSirHtConfig {
523 /* Enable/Disable receiving LDPC coded packets */
524 uint32_t ht_rx_ldpc:1;
525 /* Enable/Disable TX STBC */
526 uint32_t ht_tx_stbc:1;
527 /* Enable/Disable RX STBC */
528 uint32_t ht_rx_stbc:2;
529 /* Enable/Disable SGI */
Sandeep Puligilla607f34a2016-05-25 14:37:47 -0700530 uint32_t ht_sgi20:1;
531 uint32_t ht_sgi40:1;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800532 uint32_t unused:27;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530533} qdf_packed tSirHTConfig, *tpSirHTConfig;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800534
Sandeep Puligilla98917432016-06-10 13:50:28 -0700535/**
Jeff Johnson118a4a02018-05-06 00:14:15 -0700536 * struct sir_vht_config - VHT capabilities
Sandeep Puligilla98917432016-06-10 13:50:28 -0700537 * @max_mpdu_len: MPDU length
538 * @supported_channel_widthset: channel width set
539 * @ldpc_coding: LDPC coding capability
540 * @shortgi80: short GI 80 support
541 * @shortgi160and80plus80: short Gi 160 & 80+80 support
542 * @tx_stbc; Tx STBC cap
543 * @tx_stbc: Rx STBC cap
544 * @su_beam_former: SU beam former cap
545 * @su_beam_formee: SU beam formee cap
546 * @csnof_beamformer_antSup: Antenna support for beamforming
547 * @num_soundingdim: Sound dimensions
548 * @mu_beam_former: MU beam former cap
549 * @mu_beam_formee: MU beam formee cap
550 * @vht_txops: TXOP power save
551 * @htc_vhtcap: HTC VHT capability
552 * @max_ampdu_lenexp: AMPDU length
553 * @vht_link_adapt: VHT link adapatation capable
554 * @rx_antpattern: Rx Antenna pattern
555 * @tx_antpattern: Tx Antenna pattern
556 */
557struct sir_vht_config {
558 uint32_t max_mpdu_len:2;
559 uint32_t supported_channel_widthset:2;
560 uint32_t ldpc_coding:1;
561 uint32_t shortgi80:1;
562 uint32_t shortgi160and80plus80:1;
563 uint32_t tx_stbc:1;
564 uint32_t rx_stbc:3;
565 uint32_t su_beam_former:1;
566 uint32_t su_beam_formee:1;
567 uint32_t csnof_beamformer_antSup:3;
568 uint32_t num_soundingdim:3;
569 uint32_t mu_beam_former:1;
570 uint32_t mu_beam_formee:1;
571 uint32_t vht_txops:1;
572 uint32_t htc_vhtcap:1;
573 uint32_t max_ampdu_lenexp:3;
574 uint32_t vht_link_adapt:2;
575 uint32_t rx_antpattern:1;
576 uint32_t tx_antpattern:1;
577 uint32_t unused:2;
578};
579
580
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800581typedef struct sSirAddIeParams {
582 uint16_t probeRespDataLen;
583 uint8_t *probeRespData_buff;
584 uint16_t assocRespDataLen;
585 uint8_t *assocRespData_buff;
586 uint16_t probeRespBCNDataLen;
587 uint8_t *probeRespBCNData_buff;
588} tSirAddIeParams, *tpSirAddIeParams;
589
590/* / Definition for kick starting BSS */
591/* / ---> MAC */
592/**
593 * Usage of ssId, numSSID & ssIdList:
594 * ---------------------------------
595 * 1. ssId.length of zero indicates that Broadcast/Suppress SSID
596 * feature is enabled.
597 * 2. If ssId.length is zero, MAC SW will advertise NULL SSID
598 * and interpret the SSID list from numSSID & ssIdList.
599 * 3. If ssId.length is non-zero, MAC SW will advertise the SSID
600 * specified in the ssId field and it is expected that
601 * application will set numSSID to one (only one SSID present
602 * in the list) and SSID in the list is same as ssId field.
603 * 4. Application will always set numSSID >= 1.
604 */
605/* ***** NOTE: Please make sure all codes are updated if inserting field into
606 * this structure..********** */
607typedef struct sSirSmeStartBssReq {
608 uint16_t messageType; /* eWNI_SME_START_BSS_REQ */
609 uint16_t length;
610 uint8_t sessionId; /* Added for BT-AMP Support */
611 uint16_t transactionId; /* Added for BT-AMP Support */
Anurag Chouhan6d760662016-02-20 16:05:43 +0530612 struct qdf_mac_addr bssid; /* Added for BT-AMP Support */
613 struct qdf_mac_addr self_macaddr; /* Added for BT-AMP Support */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800614 uint16_t beaconInterval; /* Added for BT-AMP Support */
615 uint8_t dot11mode;
616#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
617 uint8_t cc_switch_mode;
618#endif
619 tSirBssType bssType;
620 tSirMacSSid ssId;
621 uint8_t channelId;
622 ePhyChanBondState cbMode;
623 uint8_t vht_channel_width;
624 uint8_t center_freq_seg0;
625 uint8_t center_freq_seg1;
626 uint8_t sec_ch_offset;
627
628 uint8_t privacy;
629 uint8_t apUapsdEnable;
630 uint8_t ssidHidden;
631 bool fwdWPSPBCProbeReq;
632 bool protEnabled;
633 bool obssProtEnabled;
634 uint16_t ht_capab;
635 tAniAuthType authType;
636 uint32_t dtimPeriod;
637 uint8_t wps_state;
638 uint8_t isCoalesingInIBSSAllowed; /* Coalesing on/off knob */
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800639 enum QDF_OPMODE bssPersona;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800640
641 uint8_t txLdpcIniFeatureEnabled;
642
643 tSirRSNie rsnIE; /* RSN IE to be sent in */
644 /* Beacon and Probe */
645 /* Response frames */
646 tSirNwType nwType; /* Indicates 11a/b/g */
647 tSirMacRateSet operationalRateSet; /* Has 11a or 11b rates */
648 tSirMacRateSet extendedRateSet; /* Has 11g rates */
649 tSirHTConfig htConfig;
Sandeep Puligilla98917432016-06-10 13:50:28 -0700650 struct sir_vht_config vht_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800651#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -0700652 tDot11fIEhe_cap he_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800653#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800654#ifdef WLAN_FEATURE_11W
655 bool pmfCapable;
656 bool pmfRequired;
657#endif
658
659 tSirAddIeParams addIeParams;
660
661 bool obssEnabled;
662 uint8_t sap_dot11mc;
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800663 uint16_t beacon_tx_rate;
Kapil Gupta4b2efbb2016-10-03 13:07:20 +0530664 bool vendor_vht_sap;
Arif Hussain671a1902017-03-17 09:08:32 -0700665 uint32_t cac_duration_ms;
666 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800667
668} tSirSmeStartBssReq, *tpSirSmeStartBssReq;
669
670#define GET_IE_LEN_IN_BSS(lenInBss) (lenInBss + sizeof(lenInBss) - \
671 ((uintptr_t)OFFSET_OF(tSirBssDescription,\
672 ieFields)))
673
674#define WSCIE_PROBE_RSP_LEN (317 + 2)
675
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530676#ifdef WLAN_FEATURE_FILS_SK
677/* struct fils_ind_elements: elements parsed from fils indication present
678 * in beacon/probe resp
679 * @realm_cnt: number of realm present
680 * @realm: realms
681 * @is_fils_sk_supported: if FILS SK supported
682 * @is_cache_id_present: if cache id present
683 * @cache_id: cache id
684 */
685struct fils_ind_elements {
686 uint16_t realm_cnt;
687 uint8_t realm[SIR_MAX_REALM_COUNT][SIR_REALM_LEN];
688 bool is_fils_sk_supported;
689 bool is_cache_id_present;
690 uint8_t cache_id[CACHE_ID_LEN];
691};
692#endif
693
Jeff Johnsone58271f2017-10-06 09:58:59 -0700694struct bss_description {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800695 /* offset of the ieFields from bssId. */
696 uint16_t length;
697 tSirMacAddr bssId;
Arun Khandavalli8a711cb2017-01-03 20:23:56 +0530698 unsigned long scansystimensec;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800699 uint32_t timeStamp[2];
700 uint16_t beaconInterval;
701 uint16_t capabilityInfo;
702 tSirNwType nwType; /* Indicates 11a/b/g */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800703 int8_t rssi;
Deepak Dhamdhere68929ec2015-08-05 15:16:35 -0700704 int8_t rssi_raw;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800705 int8_t sinr;
706 /* channelId what peer sent in beacon/probersp. */
707 uint8_t channelId;
708 /* channelId on which we are parked at. */
709 /* used only in scan case. */
710 uint8_t channelIdSelf;
711 uint8_t sSirBssDescriptionRsvd[3];
Deepthi Gowri6acee342016-10-28 15:00:38 +0530712 /* Based on system time, not a relative time. */
713 uint64_t received_time;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800714 uint32_t parentTSF;
715 uint32_t startTSF[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800716 uint8_t mdiePresent;
717 /* MDIE for 11r, picked from the beacons */
718 uint8_t mdie[SIR_MDIE_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800719#ifdef FEATURE_WLAN_ESE
720 uint16_t QBSSLoad_present;
721 uint16_t QBSSLoad_avail;
722 /* To achieve 8-byte alignment with ESE enabled */
723 uint32_t reservedPadding5;
724#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800725 /* whether it is from a probe rsp */
726 uint8_t fProbeRsp;
Deepak Dhamdhere652d7e82015-08-06 14:16:53 -0700727 /* Actual channel the beacon/probe response was received on */
728 uint8_t rx_channel;
Krishna Kumaar Natarajan89a99d42016-08-04 15:44:38 -0700729 tSirMacSeqCtl seq_ctrl;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800730 uint32_t WscIeLen;
731 uint8_t WscIeProbeRsp[WSCIE_PROBE_RSP_LEN];
732 uint8_t reservedPadding4;
733 uint32_t tsf_delta;
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530734#ifdef WLAN_FEATURE_FILS_SK
735 struct fils_ind_elements fils_info_element;
736#endif
737 /* Please keep the structure 4 bytes aligned above the ieFields */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800738 uint32_t ieFields[1];
Jeff Johnsone58271f2017-10-06 09:58:59 -0700739};
740typedef struct bss_description tSirBssDescription, *tpSirBssDescription;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800741
742#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
743typedef struct sSirSmeHTProfile {
744 uint8_t dot11mode;
745 uint8_t htCapability;
746 uint8_t htSupportedChannelWidthSet;
747 uint8_t htRecommendedTxWidthSet;
748 ePhyChanBondState htSecondaryChannelOffset;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800749 uint8_t vhtCapability;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800750 uint8_t apCenterChan;
751 uint8_t apChanWidth;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800752} tSirSmeHTProfile;
753#endif
754/* / Definition for response message to previously */
755/* / issued start BSS request */
756/* / MAC ---> */
757typedef struct sSirSmeStartBssRsp {
758 uint16_t messageType; /* eWNI_SME_START_BSS_RSP */
759 uint16_t length;
760 uint8_t sessionId;
761 uint16_t transactionId; /* transaction ID for cmd */
762 tSirResultCodes statusCode;
763 tSirBssType bssType; /* Add new type for WDS mode */
764 uint16_t beaconInterval; /* Beacon Interval for both type */
Jeff Johnson179fd8a2018-05-11 14:20:05 -0700765 uint32_t staId; /* Station ID for Self */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800766#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
767 tSirSmeHTProfile HTProfile;
768#endif
769 tSirBssDescription bssDescription; /* Peer BSS description */
770} tSirSmeStartBssRsp, *tpSirSmeStartBssRsp;
771
772typedef struct sSirChannelList {
773 uint8_t numChannels;
774 uint8_t channelNumber[SIR_ESE_MAX_MEAS_IE_REQS];
775} tSirChannelList, *tpSirChannelList;
776
777typedef struct sSirDFSChannelList {
778 uint32_t timeStamp[SIR_MAX_24G_5G_CHANNEL_RANGE];
779
780} tSirDFSChannelList, *tpSirDFSChannelList;
781
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800782/* / Two Background Scan mode */
783typedef enum eSirBackgroundScanMode {
784 eSIR_ROAMING_SCAN = 2,
785} tSirBackgroundScanMode;
786
787/* / Two types of traffic check */
788typedef enum eSirLinkTrafficCheck {
789 eSIR_DONT_CHECK_LINK_TRAFFIC_BEFORE_SCAN = 0,
790 eSIR_CHECK_LINK_TRAFFIC_BEFORE_SCAN = 1,
791 eSIR_CHECK_ROAMING_SCAN = 2,
792} tSirLinkTrafficCheck;
793
794#define SIR_BG_SCAN_RETURN_CACHED_RESULTS 0x0
795#define SIR_BG_SCAN_PURGE_RESUTLS 0x80
796#define SIR_BG_SCAN_RETURN_FRESH_RESULTS 0x01
797#define SIR_SCAN_MAX_NUM_SSID 0x0A
798#define SIR_BG_SCAN_RETURN_LFR_CACHED_RESULTS 0x02
799#define SIR_BG_SCAN_PURGE_LFR_RESULTS 0x40
800
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800801typedef struct sSirSmeScanAbortReq {
802 uint16_t type;
803 uint16_t msgLen;
804 uint8_t sessionId;
805 uint32_t scan_id;
806} tSirSmeScanAbortReq, *tpSirSmeScanAbortReq;
807
808typedef struct sSirSmeScanChanReq {
809 uint16_t type;
810 uint16_t msgLen;
811 uint8_t sessionId;
812 uint16_t transcationId;
813} tSirSmeGetScanChanReq, *tpSirSmeGetScanChanReq;
814
815#ifdef FEATURE_OEM_DATA_SUPPORT
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700816struct oem_data_req {
Gupta, Kapil8a605e12016-06-08 14:14:35 +0530817 uint32_t data_len;
Krishna Kumaar Natarajan9ac8efd2015-11-20 13:40:24 -0800818 uint8_t *data;
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700819};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800820
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700821struct oem_data_rsp {
Krishna Kumaar Natarajan608291e2015-12-14 18:17:27 -0800822 uint32_t rsp_len;
Krishna Kumaar Natarajan73ea9f22016-06-30 18:38:47 -0700823 uint8_t *data;
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -0700824};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800825#endif /* FEATURE_OEM_DATA_SUPPORT */
826
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800827#ifdef FEATURE_WLAN_ESE
yeshwanth sriram guntuka27e4ffc2016-12-01 18:00:17 +0530828typedef struct ese_wmm_tspec_ie {
829 uint16_t traffic_type:1;
830 uint16_t tsid:4;
831 uint16_t direction:2;
832 uint16_t access_policy:2;
833 uint16_t aggregation:1;
834 uint16_t psb:1;
835 uint16_t user_priority:3;
836 uint16_t tsinfo_ack_pol:2;
837 uint8_t tsinfo_rsvd:7;
838 uint8_t burst_size_defn:1;
839 uint16_t size:15;
840 uint16_t fixed:1;
841 uint16_t max_msdu_size;
842 uint32_t min_service_int;
843 uint32_t max_service_int;
844 uint32_t inactivity_int;
845 uint32_t suspension_int;
846 uint32_t service_start_time;
847 uint32_t min_data_rate;
848 uint32_t mean_data_rate;
849 uint32_t peak_data_rate;
850 uint32_t burst_size;
851 uint32_t delay_bound;
852 uint32_t min_phy_rate;
853 uint16_t surplus_bw_allowance;
854 uint16_t medium_time;
855} qdf_packed ese_wmm_tspec_ie;
856
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800857typedef struct sTspecInfo {
858 uint8_t valid;
859 tSirMacTspecIE tspec;
860} tTspecInfo;
861
862#define SIR_ESE_MAX_TSPEC_IES 4
863typedef struct sESETspecTspecInfo {
864 uint8_t numTspecs;
865 tTspecInfo tspec[SIR_ESE_MAX_TSPEC_IES];
866} tESETspecInfo;
867
868typedef struct sSirTsmIE {
869 uint8_t tsid;
870 uint8_t state;
871 uint16_t msmt_interval;
872} tSirTsmIE, *tpSirTsmIE;
873typedef struct sSirSmeTsmIEInd {
874 tSirTsmIE tsmIe;
875 uint8_t sessionId;
876} tSirSmeTsmIEInd, *tpSirSmeTsmIEInd;
877typedef struct sAniTrafStrmMetrics {
878 uint16_t UplinkPktQueueDly;
879 uint16_t UplinkPktQueueDlyHist[4];
880 uint32_t UplinkPktTxDly;
881 uint16_t UplinkPktLoss;
882 uint16_t UplinkPktCount;
883 uint8_t RoamingCount;
884 uint16_t RoamingDly;
885} tAniTrafStrmMetrics, *tpAniTrafStrmMetrics;
886
887typedef struct sAniGetTsmStatsReq {
888 /* Common for all types are requests */
889 uint16_t msgType; /* message type is same as the request type */
890 uint16_t msgLen; /* length of the entire request */
891 uint8_t staId;
892 uint8_t tid; /* traffic id */
893 struct qdf_mac_addr bssId;
894 void *tsmStatsCallback;
895 void *pDevContext; /* device context */
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -0800896} tAniGetTsmStatsReq, *tpAniGetTsmStatsReq;
897
898typedef struct sAniGetTsmStatsRsp {
899 /* Common for all types are responses */
900 uint16_t msgType; /*
901 * message type is same as
902 * the request type
903 */
904 uint16_t msgLen; /*
905 * length of the entire request,
906 * includes the pStatsBuf length too
907 */
908 uint8_t sessionId;
909 uint32_t rc; /* success/failure */
910 uint32_t staId; /*
911 * Per STA stats request must
912 * contain valid
913 */
914 tAniTrafStrmMetrics tsmMetrics;
915 void *tsmStatsReq; /* tsm stats request backup */
916} tAniGetTsmStatsRsp, *tpAniGetTsmStatsRsp;
917
918typedef struct sSirEseBcnReportBssInfo {
919 tBcnReportFields bcnReportFields;
920 uint8_t ieLen;
921 uint8_t *pBuf;
922} tSirEseBcnReportBssInfo, *tpSirEseBcnReportBssInfo;
923
924typedef struct sSirEseBcnReportRsp {
925 uint16_t measurementToken;
926 uint8_t flag; /* Flag to report measurement done and more data */
927 uint8_t numBss;
928 tSirEseBcnReportBssInfo bcnRepBssInfo[SIR_BCN_REPORT_MAX_BSS_DESC];
929} tSirEseBcnReportRsp, *tpSirEseBcnReportRsp;
930
931#define TSRS_11AG_RATE_6MBPS 0xC
932#define TSRS_11B_RATE_5_5MBPS 0xB
933typedef struct sSirMacESETSRSIE {
934 uint8_t tsid;
935 uint8_t rates[8];
936} tSirMacESETSRSIE;
937typedef struct sSirMacESETSMIE {
938 uint8_t tsid;
939 uint8_t state;
940 uint16_t msmt_interval;
941} tSirMacESETSMIE;
942typedef struct sTSMStats {
943 uint8_t tid;
944 struct qdf_mac_addr bssid;
945 tTrafStrmMetrics tsmMetrics;
946} tTSMStats, *tpTSMStats;
947typedef struct sEseTSMContext {
948 uint8_t tid;
949 tSirMacESETSMIE tsmInfo;
950 tTrafStrmMetrics tsmMetrics;
951} tEseTSMContext, *tpEseTSMContext;
952typedef struct sEsePEContext {
953 tEseTSMContext tsm;
954} tEsePEContext, *tpEsePEContext;
955
956typedef struct sSirPlmReq {
957 uint16_t diag_token; /* Dialog token */
958 uint16_t meas_token; /* measurement token */
959 uint16_t numBursts; /* total number of bursts */
960 uint16_t burstInt; /* burst interval in seconds */
961 uint16_t measDuration; /* in TU's,STA goes off-ch */
962 /* no of times the STA should cycle through PLM ch list */
963 uint8_t burstLen;
964 int8_t desiredTxPwr; /* desired tx power */
965 struct qdf_mac_addr mac_addr; /* MC dest addr */
966 /* no of channels */
967 uint8_t plmNumCh;
968 /* channel numbers */
969 uint8_t plmChList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
970 uint8_t sessionId;
971 bool enable;
972} tSirPlmReq, *tpSirPlmReq;
973
974#endif /* FEATURE_WLAN_ESE */
975
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800976/* / Definition for response message to previously issued scan request */
977typedef struct sSirSmeScanRsp {
978 uint16_t messageType; /* eWNI_SME_SCAN_RSP */
979 uint16_t length;
980 uint8_t sessionId;
981 tSirResultCodes statusCode;
982 uint16_t transcationId;
983 uint32_t scan_id;
984} tSirSmeScanRsp, *tpSirSmeScanRsp;
985
986/* / Definition for join request */
987/* / ---> MAC */
988/* / WARNING! If you add a field in JOIN REQ. */
989/* / Make sure to add it in REASSOC REQ */
990/* / The Serdes function is the same and its */
991/* / shared with REASSOC. So if we add a field */
992/* here and dont add it in REASSOC REQ. It will BREAK!!! REASSOC. */
993typedef struct sSirSmeJoinReq {
994 uint16_t messageType; /* eWNI_SME_JOIN_REQ */
995 uint16_t length;
996 uint8_t sessionId;
997 uint16_t transactionId;
998 tSirMacSSid ssId;
999 tSirMacAddr selfMacAddr; /* self Mac address */
1000 tSirBssType bsstype; /* add new type for BT-AMP STA and AP Modules */
1001 uint8_t dot11mode; /* to support BT-AMP */
1002#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
1003 uint8_t cc_switch_mode;
1004#endif
Jeff Johnsonc1e62782017-11-09 09:50:17 -08001005 enum QDF_OPMODE staPersona; /* Persona */
Abhishek Singhf78bd2d2016-04-27 16:47:56 +05301006 bool wps_registration;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001007 ePhyChanBondState cbMode; /* Pass CB mode value in Join. */
1008
1009 /*This contains the UAPSD Flag for all 4 AC
1010 * B0: AC_VO UAPSD FLAG
1011 * B1: AC_VI UAPSD FLAG
1012 * B2: AC_BK UAPSD FLAG
1013 * B3: AC_BE UASPD FLAG
1014 */
1015 uint8_t uapsdPerAcBitmask;
1016
1017 tSirMacRateSet operationalRateSet; /* Has 11a or 11b rates */
1018 tSirMacRateSet extendedRateSet; /* Has 11g rates */
1019 tSirRSNie rsnIE; /* RSN IE to be sent in */
1020 /* (Re) Association Request */
1021#ifdef FEATURE_WLAN_ESE
1022 /* CCMK IE to be included as handler for join and reassoc is */
1023 tSirCCKMie cckmIE;
1024 /* the same. The join will never carry cckm, but will be set to */
1025 /* 0. */
1026#endif
1027
1028 tSirAddie addIEScan; /* Additional IE to be sent in */
1029 /* (unicast) Probe Request at the time of join */
1030
1031 tSirAddie addIEAssoc; /* Additional IE to be sent in */
1032 /* (Re) Association Request */
1033
1034 tAniEdType UCEncryptionType;
1035
1036 tAniEdType MCEncryptionType;
1037
1038#ifdef WLAN_FEATURE_11W
1039 tAniEdType MgmtEncryptionType;
1040#endif
1041
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001042 bool is11Rconnection;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001043#ifdef FEATURE_WLAN_ESE
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001044 bool isESEFeatureIniEnabled;
1045 bool isESEconnection;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001046 tESETspecInfo eseTspecInfo;
1047#endif
1048
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001049 bool isFastTransitionEnabled;
1050 bool isFastRoamIniFeatureEnabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001051
1052 uint8_t txLdpcIniFeatureEnabled;
1053 tSirHTConfig htConfig;
Sandeep Puligilla98917432016-06-10 13:50:28 -07001054 struct sir_vht_config vht_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08001055#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -07001056 tDot11fIEhe_cap he_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08001057#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001058 uint8_t enableVhtpAid;
1059 uint8_t enableVhtGid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001060 uint8_t enableAmpduPs;
1061 uint8_t enableHtSmps;
1062 uint8_t htSmps;
Archana Ramachandranfec24812016-02-16 16:31:56 -08001063 bool send_smps_action;
Kiran Kumar Lokere722dccd2018-02-23 13:23:52 -08001064 bool he_with_wep_tkip;
Deepak Dhamdhere612392c2016-08-28 02:56:51 -07001065 uint8_t max_amsdu_num;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001066 bool isWMEenabled;
1067 bool isQosEnabled;
1068 bool isOSENConnection;
Krishna Kumaar Natarajanf599c6e2015-11-03 11:44:03 -08001069 struct rrm_config_param rrm_config;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001070 bool spectrumMgtIndicator;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001071 tSirMacPowerCapInfo powerCap;
1072 tSirSupChnl supportedChannels;
Selvaraj, Sridhar05ea0792017-05-17 12:17:03 +05301073 bool enable_bcast_probe_rsp;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +05301074#ifdef WLAN_FEATURE_FILS_SK
1075 struct cds_fils_connection_info fils_con_info;
1076#endif
Padma, Santhosh Kumarb8f65d92017-09-14 13:05:42 +05301077 bool sae_pmk_cached;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +05301078 /* Pls make this as last variable in struct */
Abhishek Singhb59f8d42017-07-31 14:42:47 +05301079 bool force_24ghz_in_ht20;
Abhishek Singh6454ad32017-12-20 10:42:21 +05301080 bool force_rsne_override;
Selvaraj, Sridhar81ab80d2017-06-08 12:21:39 +05301081 tSirBssDescription bssDescription;
1082 /*
1083 * WARNING: Pls make bssDescription as last variable in struct
1084 * tSirSmeJoinReq as it has ieFields followed after this bss
1085 * description. Adding a variable after this corrupts the ieFields
1086 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001087} tSirSmeJoinReq, *tpSirSmeJoinReq;
1088
Jeff Johnson47d75242018-05-12 15:58:53 -07001089/* / Definition for response message to previously issued join request */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001090/* / MAC ---> */
1091typedef struct sSirSmeJoinRsp {
1092 uint16_t messageType; /* eWNI_SME_JOIN_RSP */
1093 uint16_t length;
1094 uint8_t sessionId; /* Session ID */
1095 uint16_t transactionId; /* Transaction ID for cmd */
1096 tSirResultCodes statusCode;
1097 tAniAuthType authType;
1098 uint32_t vht_channel_width;
1099 /* It holds reasonCode when join fails due to deauth/disassoc frame.
1100 * Otherwise it holds status code.
1101 */
1102 uint16_t protStatusCode;
1103 uint16_t aid;
1104 uint32_t beaconLength;
1105 uint32_t assocReqLength;
1106 uint32_t assocRspLength;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001107 uint32_t parsedRicRspLen;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001108#ifdef FEATURE_WLAN_ESE
1109 uint32_t tspecIeLen;
1110#endif
1111 uint32_t staId; /* Station ID for peer */
1112
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001113 /*Timing measurement capability */
1114 uint8_t timingMeasCap;
1115
1116#ifdef FEATURE_WLAN_TDLS
1117 /* TDLS prohibited and TDLS channel switch prohibited are set as
1118 * per ExtCap IE in received assoc/re-assoc response from AP
1119 */
1120 bool tdls_prohibited;
1121 bool tdls_chan_swit_prohibited;
1122#endif
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301123 uint8_t nss;
1124 uint32_t max_rate_flags;
1125
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001126#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
1127 tSirSmeHTProfile HTProfile;
1128#endif
Archana Ramachandran20d2e232016-02-11 16:58:40 -08001129 bool supported_nss_1x1;
Anurag Chouhan5de8d172016-07-13 14:44:28 +05301130 tDot11fIEHTCaps ht_caps;
1131 tDot11fIEVHTCaps vht_caps;
1132 tDot11fIEHTInfo ht_operation;
1133 tDot11fIEVHTOperation vht_operation;
1134 tDot11fIEhs20vendor_ie hs20vendor_ie;
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301135 bool is_fils_connection;
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301136 uint16_t fils_seq_num;
Vignesh Viswanathan0b0fa272017-09-18 17:12:04 +05301137#ifdef WLAN_FEATURE_FILS_SK
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301138 struct fils_join_rsp_params *fils_join_rsp;
1139#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001140 uint8_t frames[1];
1141} tSirSmeJoinRsp, *tpSirSmeJoinRsp;
1142
1143/* / probereq from peer, when wsc is enabled */
1144typedef struct sSirSmeProbereq {
1145 uint16_t messageType;
1146 uint16_t length;
1147 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301148 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001149 uint16_t devicePasswdId;
1150} tSirSmeProbeReq, *tpSirSmeProbeReq;
1151
1152typedef struct sSirSmeChanInfo {
1153 uint8_t chan_id;
1154 uint32_t mhz;
1155 uint32_t band_center_freq1;
1156 uint32_t band_center_freq2;
1157 uint32_t info;
1158 uint32_t reg_info_1;
1159 uint32_t reg_info_2;
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301160 uint8_t nss;
1161 uint32_t rate_flags;
Manishekar Chandrasekaranec267592016-05-26 19:10:04 +05301162 uint8_t sec_ch_offset;
1163 enum phy_ch_width ch_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001164} tSirSmeChanInfo, *tpSirSmeChanInfo;
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301165
Will Huang558f8082017-05-31 16:22:24 +08001166enum sir_sme_phy_mode {
1167 SIR_SME_PHY_MODE_LEGACY = 0,
1168 SIR_SME_PHY_MODE_HT = 1,
1169 SIR_SME_PHY_MODE_VHT = 2
1170};
1171
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001172/* / Definition for Association indication from peer */
1173/* / MAC ---> */
1174typedef struct sSirSmeAssocInd {
1175 uint16_t messageType; /* eWNI_SME_ASSOC_IND */
1176 uint16_t length;
1177 uint8_t sessionId;
1178 tSirMacAddr peerMacAddr;
1179 uint16_t aid;
1180 tSirMacAddr bssId; /* Self BSSID */
1181 uint16_t staId; /* Station ID for peer */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001182 tAniAuthType authType;
1183 tAniSSID ssId; /* SSID used by STA to associate */
1184 tSirWAPIie wapiIE; /* WAPI IE received from peer */
1185 tSirRSNie rsnIE; /* RSN IE received from peer */
1186 /* Additional IE received from peer, which possibly include
1187 * WSC IE and/or P2P IE
1188 */
1189 tSirAddie addIE;
1190
1191 /* powerCap & supportedChannels are present only when */
1192 /* spectrumMgtIndicator flag is set */
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001193 bool spectrumMgtIndicator;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001194 tSirMacPowerCapInfo powerCap;
1195 tSirSupChnl supportedChannels;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001196 bool wmmEnabledSta; /* if present - STA is WMM enabled */
1197 bool reassocReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001198 /* Required for indicating the frames to upper layer */
1199 uint32_t beaconLength;
1200 uint8_t *beaconPtr;
1201 uint32_t assocReqLength;
1202 uint8_t *assocReqPtr;
1203
1204 /* Timing measurement capability */
1205 uint8_t timingMeasCap;
1206 tSirSmeChanInfo chan_info;
Will Huang558f8082017-05-31 16:22:24 +08001207 bool ampdu;
1208 bool sgi_enable;
1209 bool tx_stbc;
1210 bool rx_stbc;
1211 tSirMacHTChannelWidth ch_width;
1212 enum sir_sme_phy_mode mode;
1213 uint8_t max_supp_idx;
1214 uint8_t max_ext_idx;
1215 uint8_t max_mcs_idx;
1216 uint8_t rx_mcs_map;
1217 uint8_t tx_mcs_map;
gaolez7bb1e742017-03-21 16:37:38 +08001218 /* Extended CSA capability of station */
1219 uint8_t ecsa_capable;
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +05301220 tDot11fIEHTCaps HTCaps;
1221 tDot11fIEVHTCaps VHTCaps;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001222} tSirSmeAssocInd, *tpSirSmeAssocInd;
1223
1224/* / Definition for Association confirm */
1225/* / ---> MAC */
1226typedef struct sSirSmeAssocCnf {
1227 uint16_t messageType; /* eWNI_SME_ASSOC_CNF */
1228 uint16_t length;
1229 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301230 struct qdf_mac_addr bssid; /* Self BSSID */
1231 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001232 uint16_t aid;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301233 struct qdf_mac_addr alternate_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001234 uint8_t alternateChannelId;
1235} tSirSmeAssocCnf, *tpSirSmeAssocCnf;
1236
1237/* / Enum definition for Wireless medium status change codes */
1238typedef enum eSirSmeStatusChangeCode {
1239 eSIR_SME_DEAUTH_FROM_PEER,
1240 eSIR_SME_DISASSOC_FROM_PEER,
1241 eSIR_SME_LOST_LINK_WITH_PEER,
1242 eSIR_SME_CHANNEL_SWITCH,
1243 eSIR_SME_JOINED_NEW_BSS,
1244 eSIR_SME_LEAVING_BSS,
1245 eSIR_SME_IBSS_ACTIVE,
1246 eSIR_SME_IBSS_INACTIVE,
1247 eSIR_SME_IBSS_PEER_DEPARTED,
1248 eSIR_SME_RADAR_DETECTED,
1249 eSIR_SME_IBSS_NEW_PEER,
1250 eSIR_SME_AP_CAPS_CHANGED,
1251} tSirSmeStatusChangeCode;
1252
1253typedef struct sSirSmeNewBssInfo {
Anurag Chouhan6d760662016-02-20 16:05:43 +05301254 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001255 uint8_t channelNumber;
1256 uint8_t reserved;
1257 tSirMacSSid ssId;
1258} tSirSmeNewBssInfo, *tpSirSmeNewBssInfo;
1259
1260typedef struct sSirSmeApNewCaps {
1261 uint16_t capabilityInfo;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301262 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001263 uint8_t channelId;
1264 uint8_t reserved[3];
1265 tSirMacSSid ssId;
1266} tSirSmeApNewCaps, *tpSirSmeApNewCaps;
1267
1268/**
1269 * Table below indicates what information is passed for each of
1270 * the Wireless Media status change notifications:
1271 *
1272 * Status Change code Status change info
1273 * ----------------------------------------------------------------------
1274 * eSIR_SME_DEAUTH_FROM_PEER Reason code received in DEAUTH frame
1275 * eSIR_SME_DISASSOC_FROM_PEER Reason code received in DISASSOC frame
1276 * eSIR_SME_LOST_LINK_WITH_PEER None
1277 * eSIR_SME_CHANNEL_SWITCH New channel number
1278 * eSIR_SME_JOINED_NEW_BSS BSSID, SSID and channel number
1279 * eSIR_SME_LEAVING_BSS None
1280 * eSIR_SME_IBSS_ACTIVE Indicates that another STA joined
1281 * IBSS apart from this STA that
1282 * started IBSS
1283 * eSIR_SME_IBSS_INACTIVE Indicates that only this STA is left
1284 * in IBSS
1285 * eSIR_SME_RADAR_DETECTED Indicates that radar is detected
1286 * eSIR_SME_IBSS_NEW_PEER Indicates that a new peer is detected
1287 * eSIR_SME_AP_CAPS_CHANGED Indicates that capabilities of the AP
1288 * that STA is currently associated with
1289 * have changed.
1290 */
1291
1292/* / Definition for Wireless medium status change notification */
1293typedef struct sSirSmeWmStatusChangeNtf {
1294 uint16_t messageType; /* eWNI_SME_WM_STATUS_CHANGE_NTF */
1295 uint16_t length;
1296 uint8_t sessionId; /* Session ID */
1297 tSirSmeStatusChangeCode statusChangeCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301298 struct qdf_mac_addr bssid; /* Self BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001299 union {
1300 uint16_t deAuthReasonCode; /* eSIR_SME_DEAUTH_FROM_PEER */
1301 /* eSIR_SME_DISASSOC_FROM_PEER */
1302 uint16_t disassocReasonCode;
1303 /* none for eSIR_SME_LOST_LINK_WITH_PEER */
1304 uint8_t newChannelId; /* eSIR_SME_CHANNEL_SWITCH */
1305 tSirSmeNewBssInfo newBssInfo; /* eSIR_SME_JOINED_NEW_BSS */
1306 /* none for eSIR_SME_LEAVING_BSS */
1307 /* none for eSIR_SME_IBSS_ACTIVE */
1308 /* none for eSIR_SME_IBSS_INACTIVE */
1309 /* eSIR_SME_IBSS_NEW_PEER */
1310 tSirNewIbssPeerInfo newIbssPeerInfo;
1311 tSirSmeApNewCaps apNewCaps; /* eSIR_SME_AP_CAPS_CHANGED */
1312 } statusChangeInfo;
1313} tSirSmeWmStatusChangeNtf, *tpSirSmeWmStatusChangeNtf;
1314
1315/* Definition for Disassociation request */
1316typedef struct sSirSmeDisassocReq {
1317 uint16_t messageType; /* eWNI_SME_DISASSOC_REQ */
1318 uint16_t length;
1319 uint8_t sessionId; /* Session ID */
1320 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301321 struct qdf_mac_addr bssid; /* Peer BSSID */
1322 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001323 uint16_t reasonCode;
1324 /* This flag tells LIM whether to send the disassoc OTA or not */
1325 /* This will be set in while handing off from one AP to other */
1326 uint8_t doNotSendOverTheAir;
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -07001327 bool process_ho_fail;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301328} qdf_packed tSirSmeDisassocReq, *tpSirSmeDisassocReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001329
1330/* / Definition for Tkip countermeasures request */
1331typedef struct sSirSmeTkipCntrMeasReq {
1332 uint16_t messageType; /* eWNI_SME_DISASSOC_REQ */
1333 uint16_t length;
1334 uint8_t sessionId; /* Session ID */
1335 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301336 struct qdf_mac_addr bssId; /* Peer BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001337 bool bEnable; /* Start/stop countermeasures */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301338} qdf_packed tSirSmeTkipCntrMeasReq, *tpSirSmeTkipCntrMeasReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001339
1340typedef struct sAni64BitCounters {
1341 uint32_t Hi;
1342 uint32_t Lo;
1343} tAni64BitCounters, *tpAni64BitCounters;
1344
1345typedef struct sAniSecurityStat {
1346 tAni64BitCounters txBlks;
1347 tAni64BitCounters rxBlks;
1348 tAni64BitCounters formatErrorCnt;
1349 tAni64BitCounters decryptErr;
1350 tAni64BitCounters protExclCnt;
1351 tAni64BitCounters unDecryptableCnt;
1352 tAni64BitCounters decryptOkCnt;
1353
1354} tAniSecurityStat, *tpAniSecurityStat;
1355
1356typedef struct sAniTxRxStats {
1357 tAni64BitCounters txFrames;
1358 tAni64BitCounters rxFrames;
1359 tAni64BitCounters nRcvBytes;
1360 tAni64BitCounters nXmitBytes;
1361
1362} tAniTxRxStats, *tpAniTxRxStats;
1363
1364typedef struct sAniSecStats {
1365 tAniSecurityStat aes;
1366 tAni64BitCounters aesReplays;
1367 tAniSecurityStat tkip;
1368 tAni64BitCounters tkipReplays;
1369 tAni64BitCounters tkipMicError;
1370
1371 tAniSecurityStat wep;
1372#if defined(FEATURE_WLAN_WAPI) && !defined(LIBRA_WAPI_SUPPORT)
1373 tAniSecurityStat wpi;
1374 tAni64BitCounters wpiReplays;
1375 tAni64BitCounters wpiMicError;
1376#endif
1377} tAniSecStats, *tpAniSecStats;
1378
1379#define SIR_MAX_RX_CHAINS 3
1380
1381typedef struct sAniStaStatStruct {
1382 /* following statistic elements till expandPktRxCntLo are not filled
1383 * with valid data. These are kept as it is, since WSM is using this
1384 * structure. These elements can be removed whenever WSM is updated.
1385 * Phystats is used to hold phystats from BD.
1386 */
1387 uint32_t sentAesBlksUcastHi;
1388 uint32_t sentAesBlksUcastLo;
1389 uint32_t recvAesBlksUcastHi;
1390 uint32_t recvAesBlksUcastLo;
1391 uint32_t aesFormatErrorUcastCnts;
1392 uint32_t aesReplaysUcast;
1393 uint32_t aesDecryptErrUcast;
1394 uint32_t singleRetryPkts;
1395 uint32_t failedTxPkts;
1396 uint32_t ackTimeouts;
1397 uint32_t multiRetryPkts;
1398 uint32_t fragTxCntsHi;
1399 uint32_t fragTxCntsLo;
1400 uint32_t transmittedPktsHi;
1401 uint32_t transmittedPktsLo;
1402 uint32_t phyStatHi; /* These are used to fill in the phystats. */
1403 uint32_t phyStatLo; /* This is only for private use. */
1404
1405 uint32_t uplinkRssi;
1406 uint32_t uplinkSinr;
1407 uint32_t uplinkRate;
1408 uint32_t downlinkRssi;
1409 uint32_t downlinkSinr;
1410 uint32_t downlinkRate;
1411 uint32_t nRcvBytes;
1412 uint32_t nXmitBytes;
1413
1414 /*
1415 * Following elements are valid and filled in correctly. They have
1416 * valid values.
1417 */
1418
1419 /* Unicast frames and bytes. */
1420 tAniTxRxStats ucStats;
1421
1422 /* Broadcast frames and bytes. */
1423 tAniTxRxStats bcStats;
1424
1425 /* Multicast frames and bytes. */
1426 tAniTxRxStats mcStats;
1427
1428 uint32_t currentTxRate;
1429 uint32_t currentRxRate; /* Rate in 100Kbps */
1430
1431 uint32_t maxTxRate;
1432 uint32_t maxRxRate;
1433
1434 int8_t rssi[SIR_MAX_RX_CHAINS];
1435
1436 tAniSecStats securityStats;
1437
1438 uint8_t currentRxRateIdx; /* This the softmac rate Index. */
1439 uint8_t currentTxRateIdx;
1440
1441} tAniStaStatStruct, *tpAniStaStatStruct;
1442
1443typedef enum sPacketType {
1444 ePACKET_TYPE_UNKNOWN,
1445 ePACKET_TYPE_11A,
1446 ePACKET_TYPE_11G,
1447 ePACKET_TYPE_11B,
1448 ePACKET_TYPE_11N
1449} tPacketType, *tpPacketType;
1450
1451/* / Definition for Disassociation response */
1452typedef struct sSirSmeDisassocRsp {
1453 uint16_t messageType; /* eWNI_SME_DISASSOC_RSP */
1454 uint16_t length;
1455 uint8_t sessionId; /* Session ID */
1456 uint16_t transactionId; /* Transaction ID for cmd */
1457 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301458 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001459 tAniStaStatStruct perStaStats; /* STA stats */
1460 uint16_t staId;
Srinivas Girigowdaeaf136a2017-06-12 19:03:19 -07001461} tSirSmeDisassocRsp, *tpSirSmeDisassocRsp;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001462
1463/* / Definition for Disassociation indication from peer */
1464typedef struct sSirSmeDisassocInd {
1465 uint16_t messageType; /* eWNI_SME_DISASSOC_IND */
1466 uint16_t length;
1467 uint8_t sessionId; /* Session Identifier */
1468 uint16_t transactionId; /* Transaction Identifier with PE */
1469 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301470 struct qdf_mac_addr bssid;
1471 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001472 tAniStaStatStruct perStaStats; /* STA stats */
1473 uint16_t staId;
1474 uint32_t reasonCode;
1475} tSirSmeDisassocInd, *tpSirSmeDisassocInd;
1476
1477/* / Definition for Disassociation confirm */
1478/* / MAC ---> */
1479typedef struct sSirSmeDisassocCnf {
1480 uint16_t messageType; /* eWNI_SME_DISASSOC_CNF */
1481 uint16_t length;
Vignesh Viswanathanb2dcdd02018-05-24 11:48:12 +05301482 uint8_t sme_session_id;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001483 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301484 struct qdf_mac_addr bssid;
1485 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001486} tSirSmeDisassocCnf, *tpSirSmeDisassocCnf,
1487 tSirSmeDeauthCnf, *tpSirSmeDeauthCnf;
1488
Hanumantha Reddy Pothula3e5d6aa2016-09-08 15:21:54 +05301489/**
1490 * struct sir_sme_discon_done_ind - disconnect done indiaction
1491 * @message_type: msg type
1492 * @length: length of msg
1493 * @session_id: session id of the indication
1494 * @reason_code: reason for disconnect indication
1495 * @peer_mac: peer mac
1496 */
1497struct sir_sme_discon_done_ind {
1498 uint16_t message_type;
1499 uint16_t length;
1500 uint8_t session_id;
1501 tSirResultCodes reason_code;
1502 tSirMacAddr peer_mac;
1503};
1504
1505
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001506/* / Definition for Deauthetication request */
1507typedef struct sSirSmeDeauthReq {
1508 uint16_t messageType; /* eWNI_SME_DEAUTH_REQ */
1509 uint16_t length;
1510 uint8_t sessionId; /* Session ID */
1511 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301512 struct qdf_mac_addr bssid; /* AP BSSID */
1513 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001514 uint16_t reasonCode;
1515} tSirSmeDeauthReq, *tpSirSmeDeauthReq;
1516
1517/* / Definition for Deauthetication response */
1518typedef struct sSirSmeDeauthRsp {
1519 uint16_t messageType; /* eWNI_SME_DEAUTH_RSP */
1520 uint16_t length;
1521 uint8_t sessionId; /* Session ID */
1522 uint16_t transactionId; /* Transaction ID for cmd */
1523 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301524 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001525} tSirSmeDeauthRsp, *tpSirSmeDeauthRsp;
1526
1527/* / Definition for Deauthetication indication from peer */
1528typedef struct sSirSmeDeauthInd {
1529 uint16_t messageType; /* eWNI_SME_DEAUTH_IND */
1530 uint16_t length;
1531 uint8_t sessionId; /* Added for BT-AMP */
1532 uint16_t transactionId; /* Added for BT-AMP */
1533 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301534 struct qdf_mac_addr bssid; /* AP BSSID */
1535 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001536
1537 uint16_t staId;
1538 uint32_t reasonCode;
Kiran Kumar Lokere37d3aa22015-11-03 14:58:26 -08001539 int8_t rssi;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001540} tSirSmeDeauthInd, *tpSirSmeDeauthInd;
1541
1542/* / Definition for stop BSS request message */
1543typedef struct sSirSmeStopBssReq {
1544 uint16_t messageType; /* eWNI_SME_STOP_BSS_REQ */
1545 uint16_t length;
1546 uint8_t sessionId; /* Session ID */
1547 uint16_t transactionId; /* tranSaction ID for cmd */
1548 tSirResultCodes reasonCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301549 struct qdf_mac_addr bssid; /* Self BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001550} tSirSmeStopBssReq, *tpSirSmeStopBssReq;
1551
1552/* / Definition for stop BSS response message */
1553typedef struct sSirSmeStopBssRsp {
1554 uint16_t messageType; /* eWNI_SME_STOP_BSS_RSP */
1555 uint16_t length;
1556 tSirResultCodes statusCode;
1557 uint8_t sessionId; /* Session ID */
1558 uint16_t transactionId; /* Transaction ID for cmd */
1559} tSirSmeStopBssRsp, *tpSirSmeStopBssRsp;
1560
1561/* / Definition for Channel Switch indication for station */
1562/* / MAC ---> */
1563typedef struct sSirSmeSwitchChannelInd {
1564 uint16_t messageType; /* eWNI_SME_SWITCH_CHL_IND */
1565 uint16_t length;
1566 uint8_t sessionId;
1567 uint16_t newChannelId;
Amar Singhal5cccafe2017-02-15 12:42:58 -08001568 struct ch_params chan_params;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301569 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001570} tSirSmeSwitchChannelInd, *tpSirSmeSwitchChannelInd;
1571
1572/* / Definition for Neighbor BSS indication */
1573/* / MAC ---> */
1574/* / MAC reports this each time a new I/BSS is detected */
1575typedef struct sSirSmeNeighborBssInd {
1576 uint16_t messageType; /* eWNI_SME_NEIGHBOR_BSS_IND */
1577 uint16_t length;
1578 uint8_t sessionId;
1579 tSirBssDescription bssDescription[1];
1580} tSirSmeNeighborBssInd, *tpSirSmeNeighborBssInd;
1581
1582/* / Definition for MIC failure indication */
1583/* / MAC ---> */
1584/* / MAC reports this each time a MIC failure occures on Rx TKIP packet */
1585typedef struct sSirSmeMicFailureInd {
1586 uint16_t messageType; /* eWNI_SME_MIC_FAILURE_IND */
1587 uint16_t length;
1588 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301589 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001590 tSirMicFailureInfo info;
1591} tSirSmeMicFailureInd, *tpSirSmeMicFailureInd;
1592
1593typedef struct sSirSmeMissedBeaconInd {
1594 uint16_t messageType; /* eWNI_SME_MISSED_BEACON_IND */
1595 uint16_t length;
1596 uint8_t bssIdx;
1597} tSirSmeMissedBeaconInd, *tpSirSmeMissedBeaconInd;
1598
1599/* / Definition for Set Context request */
1600/* / ---> MAC */
1601typedef struct sSirSmeSetContextReq {
1602 uint16_t messageType; /* eWNI_SME_SET_CONTEXT_REQ */
1603 uint16_t length;
1604 uint8_t sessionId; /* Session ID */
1605 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301606 struct qdf_mac_addr peer_macaddr;
1607 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001608 tSirKeyMaterial keyMaterial;
1609} tSirSmeSetContextReq, *tpSirSmeSetContextReq;
1610
1611/* / Definition for Set Context response */
1612/* / MAC ---> */
1613typedef struct sSirSmeSetContextRsp {
1614 uint16_t messageType; /* eWNI_SME_SET_CONTEXT_RSP */
1615 uint16_t length;
1616 uint8_t sessionId; /* Session ID */
1617 uint16_t transactionId; /* Transaction ID for cmd */
1618 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301619 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001620} tSirSmeSetContextRsp, *tpSirSmeSetContextRsp;
1621
1622/* / Statistic definitions */
1623/* ============================================================= */
1624/* Per STA statistic structure; This same struct will be used for Aggregate */
1625/* STA stats as well. */
1626
1627/* Clear radio stats and clear per sta stats */
1628typedef enum {
1629 eANI_CLEAR_ALL_STATS, /* Clears all stats */
1630 eANI_CLEAR_RX_STATS, /* Clears RX stats of the radio interface */
1631 eANI_CLEAR_TX_STATS, /* Clears TX stats of the radio interface */
1632 eANI_CLEAR_RADIO_STATS, /* Clears all the radio stats */
1633 eANI_CLEAR_PER_STA_STATS, /* Clears Per STA stats */
1634 eANI_CLEAR_AGGR_PER_STA_STATS, /* Clears aggregate stats */
1635
1636 /* Used to distinguish between per sta to security stats. */
1637 /* Used only by AP, FW just returns the same param as it received. */
1638 eANI_LINK_STATS, /* Get Per STA stats */
1639 eANI_SECURITY_STATS, /* Get Per STA security stats */
1640
1641 eANI_CLEAR_STAT_TYPES_END
1642} tAniStatSubTypes;
1643
1644typedef struct sAniTxCtrs {
1645 /* add the rate counters here */
1646 uint32_t tx1Mbps;
1647 uint32_t tx2Mbps;
1648 uint32_t tx5_5Mbps;
1649 uint32_t tx6Mbps;
1650 uint32_t tx9Mbps;
1651 uint32_t tx11Mbps;
1652 uint32_t tx12Mbps;
1653 uint32_t tx18Mbps;
1654 uint32_t tx24Mbps;
1655 uint32_t tx36Mbps;
1656 uint32_t tx48Mbps;
1657 uint32_t tx54Mbps;
1658 uint32_t tx72Mbps;
1659 uint32_t tx96Mbps;
1660 uint32_t tx108Mbps;
1661
1662 /* tx path radio counts */
1663 uint32_t txFragHi;
1664 uint32_t txFragLo;
1665 uint32_t txFrameHi;
1666 uint32_t txFrameLo;
1667 uint32_t txMulticastFrameHi;
1668 uint32_t txMulticastFrameLo;
1669 uint32_t txFailedHi;
1670 uint32_t txFailedLo;
1671 uint32_t multipleRetryHi;
1672 uint32_t multipleRetryLo;
1673 uint32_t singleRetryHi;
1674 uint32_t singleRetryLo;
1675 uint32_t ackFailureHi;
1676 uint32_t ackFailureLo;
1677 uint32_t xmitBeacons;
1678} tAniTxCtrs, *tpAniTxCtrs;
1679
1680typedef struct sAniRxCtrs {
1681 /* receive frame rate counters */
1682 uint32_t rx1Mbps;
1683 uint32_t rx2Mbps;
1684 uint32_t rx5_5Mbps;
1685 uint32_t rx6Mbps;
1686 uint32_t rx9Mbps;
1687 uint32_t rx11Mbps;
1688 uint32_t rx12Mbps;
1689 uint32_t rx18Mbps;
1690 uint32_t rx24Mbps;
1691 uint32_t rx36Mbps;
1692 uint32_t rx48Mbps;
1693 uint32_t rx54Mbps;
1694 uint32_t rx72Mbps;
1695 uint32_t rx96Mbps;
1696 uint32_t rx108Mbps;
1697
1698 /* receive size counters; 'Lte' = Less than or equal to */
1699 uint32_t rxLte64;
1700 uint32_t rxLte128Gt64;
1701 uint32_t rxLte256Gt128;
1702 uint32_t rxLte512Gt256;
1703 uint32_t rxLte1kGt512;
1704 uint32_t rxLte1518Gt1k;
1705 uint32_t rxLte2kGt1518;
1706 uint32_t rxLte4kGt2k;
1707
1708 /* rx radio stats */
1709 uint32_t rxFrag;
1710 uint32_t rxFrame;
1711 uint32_t fcsError;
1712 uint32_t rxMulticast;
1713 uint32_t duplicate;
1714 uint32_t rtsSuccess;
1715 uint32_t rtsFailed;
1716 uint32_t wepUndecryptables;
1717 uint32_t drops;
1718 uint32_t aesFormatErrorUcastCnts;
1719 uint32_t aesReplaysUcast;
1720 uint32_t aesDecryptErrUcast;
1721} tAniRxCtrs, *tpAniRxCtrs;
1722
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001723/* *************************************************************** */
1724
1725/*******************PE Statistics*************************/
1726
1727/*
1728 * tpAniGetPEStatsReq is tied to
1729 * for SME ==> PE eWNI_SME_GET_STATISTICS_REQ msgId and
1730 * for PE ==> HAL SIR_HAL_GET_STATISTICS_REQ msgId
1731 */
1732typedef struct sAniGetPEStatsReq {
1733 /* Common for all types are requests */
1734 uint16_t msgType; /* message type is same as the request type */
1735 uint16_t msgLen; /* length of the entire request */
1736 uint32_t staId; /* Per STA stats request must contain valid */
1737 /* categories of stats requested. look at ePEStatsMask */
1738 uint32_t statsMask;
1739 uint8_t sessionId;
1740} tAniGetPEStatsReq, *tpAniGetPEStatsReq;
1741
1742/*
1743 * tpAniGetPEStatsRsp is tied to
1744 * for PE ==> SME eWNI_SME_GET_STATISTICS_RSP msgId and
1745 * for HAL ==> PE SIR_HAL_GET_STATISTICS_RSP msgId
1746 */
1747typedef struct sAniGetPEStatsRsp {
1748 /* Common for all types are responses */
1749 uint16_t msgType; /* message type is same as the request type */
1750 /* length of the entire request, includes the pStatsBuf length too */
1751 uint16_t msgLen;
1752 uint8_t sessionId;
1753 uint32_t rc; /* success/failure */
1754 uint32_t staId; /* Per STA stats request must contain valid */
1755 /* categories of stats requested. look at ePEStatsMask */
1756 uint32_t statsMask;
1757 /* void *pStatsBuf; */
1758 /*
1759 * The Stats buffer starts here and can be an aggregate of more than one
1760 * statistics structure depending on statsMask. The void pointer
1761 * "pStatsBuf" is commented out intentionally and the src code that uses
1762 * this structure should take that into account.
1763 */
1764} tAniGetPEStatsRsp, *tpAniGetPEStatsRsp;
1765
1766typedef struct sAniGetRssiReq {
1767 /* Common for all types are requests */
1768 uint16_t msgType; /* message type is same as the request type */
1769 uint16_t msgLen; /* length of the entire request */
1770 uint8_t sessionId;
1771 uint8_t staId;
1772 int8_t lastRSSI; /* in case of error, return last RSSI */
1773 void *rssiCallback;
1774 void *pDevContext; /* device context */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001775} tAniGetRssiReq, *tpAniGetRssiReq;
1776
1777typedef struct sAniGetSnrReq {
1778 /* Common for all types are requests */
1779 uint16_t msgType; /* message type is same as the request type */
1780 uint16_t msgLen; /* length of the entire request */
1781 uint8_t sessionId;
1782 uint8_t staId;
1783 void *snrCallback;
1784 void *pDevContext; /* device context */
1785 int8_t snr;
1786} tAniGetSnrReq, *tpAniGetSnrReq;
1787
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001788/**
1789 * struct ani_scan_req - Scan request
1790 * @msg_type: Message type
1791 * @msg_len: Message Length
1792 * @session_id: SME session Id
1793 * @scan_param: scan request parameter
1794 * @callback: call back function for scan result
1795 * @ctx: Global context
1796 *
1797 * Scan request message structure
1798 */
1799struct ani_scan_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 void *scan_param;
1806 void *callback;
1807 void *ctx;
1808};
1809
1810/**
1811 * struct ani_roc_req - Remain on channel request
1812 * @msg_type: Message type
1813 * @msg_len: Message Length
1814 * @session_id: SME session Id
1815 * @channel: channel number
1816 * @callback: call back function for scan result
1817 * @duration: Roc duration
1818 * @is_p2pprobe_allowed : flag for p2p probe request
1819 * @ctx: Global context
1820 * @scan_id: Scan Identifier
1821 *
1822 * Remain on channel request message structure
1823 */
1824struct ani_roc_req {
1825 /* message type is same as the request type */
1826 uint16_t msg_type;
1827 /* length of the entire request */
1828 uint16_t msg_len;
1829 uint16_t session_id;
1830 uint8_t channel;
1831 uint32_t duration;
1832 uint8_t is_p2pprobe_allowed;
1833 void *callback;
1834 void *ctx;
1835 uint32_t scan_id;
1836};
1837
1838/* generic country code change request MSG structure */
1839typedef struct sAniGenericChangeCountryCodeReq {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001840 uint16_t msgType; /* message type is same as the request type */
1841 uint16_t msgLen; /* length of the entire request */
1842 uint8_t countryCode[WNI_CFG_COUNTRY_CODE_LEN]; /* 3 char country code */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001843} tAniGenericChangeCountryCodeReq, *tpAniGenericChangeCountryCodeReq;
1844
Srinivas Girigowda296105a2015-09-24 16:31:16 -07001845/**
1846 * struct sAniDHCPStopInd - DHCP Stop indication message
1847 * @msgType: message type is same as the request type
1848 * @msgLen: length of the entire request
1849 * @device_mode: Mode of the device(ex:STA, AP)
1850 * @adapterMacAddr: MAC address of the adapter
1851 * @peerMacAddr: MAC address of the connected peer
1852 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001853typedef struct sAniDHCPStopInd {
Srinivas Girigowda296105a2015-09-24 16:31:16 -07001854 uint16_t msgType;
1855 uint16_t msgLen;
1856 uint8_t device_mode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301857 struct qdf_mac_addr adapterMacAddr;
1858 struct qdf_mac_addr peerMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001859} tAniDHCPInd, *tpAniDHCPInd;
1860
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08001861typedef struct sAniTXFailMonitorInd {
1862 uint16_t msgType; /* message type is same as the request type */
1863 uint16_t msgLen; /* length of the entire request */
1864 uint8_t tx_fail_count;
1865 void *txFailIndCallback;
1866} tAniTXFailMonitorInd, *tpAniTXFailMonitorInd;
1867
Naveen Rawatea1564b2018-05-17 15:56:11 -07001868#ifndef QCA_SUPPORT_CP_STATS
1869/**
1870 * enum tx_rate_info - tx_rate flags
1871 * @TX_RATE_LEGACY: Legacy rates
1872 * @TX_RATE_HT20: HT20 rates
1873 * @TX_RATE_HT40: HT40 rates
1874 * @TX_RATE_SGI: Rate with Short guard interval
1875 * @TX_RATE_LGI: Rate with Long guard interval
1876 * @TX_RATE_VHT20: VHT 20 rates
1877 * @TX_RATE_VHT40: VHT 40 rates
1878 * @TX_RATE_VHT80: VHT 80 rates
1879 */
1880enum tx_rate_info {
1881 TX_RATE_LEGACY = 0x1,
1882 TX_RATE_HT20 = 0x2,
1883 TX_RATE_HT40 = 0x4,
1884 TX_RATE_SGI = 0x8,
1885 TX_RATE_LGI = 0x10,
1886 TX_RATE_VHT20 = 0x20,
1887 TX_RATE_VHT40 = 0x40,
1888 TX_RATE_VHT80 = 0x80
1889};
1890#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001891/**********************PE Statistics end*************************/
1892
1893typedef struct sSirP2PNoaStart {
1894 uint32_t status;
1895 uint32_t bssIdx;
1896} tSirP2PNoaStart, *tpSirP2PNoaStart;
1897
1898typedef struct sSirTdlsInd {
1899 uint16_t status;
1900 uint16_t assocId;
1901 uint16_t staIdx;
1902 uint16_t reasonCode;
1903} tSirTdlsInd, *tpSirTdlsInd;
1904
1905typedef struct sSirP2PNoaAttr {
1906#ifdef ANI_BIG_BYTE_ENDIAN
1907 uint32_t index:8;
1908 uint32_t oppPsFlag:1;
1909 uint32_t ctWin:7;
1910 uint32_t rsvd1:16;
1911#else
1912 uint32_t rsvd1:16;
1913 uint32_t ctWin:7;
1914 uint32_t oppPsFlag:1;
1915 uint32_t index:8;
1916#endif
1917
1918#ifdef ANI_BIG_BYTE_ENDIAN
1919 uint32_t uNoa1IntervalCnt:8;
1920 uint32_t rsvd2:24;
1921#else
1922 uint32_t rsvd2:24;
1923 uint32_t uNoa1IntervalCnt:8;
1924#endif
1925 uint32_t uNoa1Duration;
1926 uint32_t uNoa1Interval;
1927 uint32_t uNoa1StartTime;
1928
1929#ifdef ANI_BIG_BYTE_ENDIAN
1930 uint32_t uNoa2IntervalCnt:8;
1931 uint32_t rsvd3:24;
1932#else
1933 uint32_t rsvd3:24;
1934 uint32_t uNoa2IntervalCnt:8;
1935#endif
1936 uint32_t uNoa2Duration;
1937 uint32_t uNoa2Interval;
1938 uint32_t uNoa2StartTime;
1939} tSirP2PNoaAttr, *tpSirP2PNoaAttr;
1940
1941typedef struct sSirTclasInfo {
1942 tSirMacTclasIE tclas;
1943 uint8_t version; /* applies only for classifier type ip */
1944 union {
1945 tSirMacTclasParamEthernet eth;
1946 tSirMacTclasParamIPv4 ipv4;
1947 tSirMacTclasParamIPv6 ipv6;
1948 tSirMacTclasParam8021dq t8021dq;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301949 } qdf_packed tclasParams;
1950} qdf_packed tSirTclasInfo;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001951
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001952typedef struct sSirAddtsReqInfo {
1953 uint8_t dialogToken;
1954 tSirMacTspecIE tspec;
1955
1956 uint8_t numTclas; /* number of Tclas elements */
1957 tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM];
1958 uint8_t tclasProc;
1959#if defined(FEATURE_WLAN_ESE)
1960 tSirMacESETSRSIE tsrsIE;
1961 uint8_t tsrsPresent:1;
1962#endif
1963 uint8_t wmeTspecPresent:1;
1964 uint8_t wsmTspecPresent:1;
1965 uint8_t lleTspecPresent:1;
1966 uint8_t tclasProcPresent:1;
1967} tSirAddtsReqInfo, *tpSirAddtsReqInfo;
1968
1969typedef struct sSirAddtsRspInfo {
1970 uint8_t dialogToken;
1971 tSirMacStatusCodes status;
1972 tSirMacTsDelayIE delay;
1973
1974 tSirMacTspecIE tspec;
1975 uint8_t numTclas; /* number of Tclas elements */
1976 tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM];
1977 uint8_t tclasProc;
1978 tSirMacScheduleIE schedule;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001979#ifdef FEATURE_WLAN_ESE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001980 tSirMacESETSMIE tsmIE;
1981 uint8_t tsmPresent:1;
1982#endif
1983 uint8_t wmeTspecPresent:1;
1984 uint8_t wsmTspecPresent:1;
1985 uint8_t lleTspecPresent:1;
1986 uint8_t tclasProcPresent:1;
1987 uint8_t schedulePresent:1;
1988} tSirAddtsRspInfo, *tpSirAddtsRspInfo;
1989
1990typedef struct sSirDeltsReqInfo {
1991 tSirMacTSInfo tsinfo;
1992 tSirMacTspecIE tspec;
1993 uint8_t wmeTspecPresent:1;
1994 uint8_t wsmTspecPresent:1;
1995 uint8_t lleTspecPresent:1;
1996} tSirDeltsReqInfo, *tpSirDeltsReqInfo;
1997
1998/* / Add a tspec as defined */
1999typedef struct sSirAddtsReq {
2000 uint16_t messageType; /* eWNI_SME_ADDTS_REQ */
2001 uint16_t length;
2002 uint8_t sessionId; /* Session ID */
2003 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302004 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002005 uint32_t timeout; /* in ms */
2006 uint8_t rspReqd;
2007 tSirAddtsReqInfo req;
2008} tSirAddtsReq, *tpSirAddtsReq;
2009
2010typedef struct sSirAddtsRsp {
2011 uint16_t messageType; /* eWNI_SME_ADDTS_RSP */
2012 uint16_t length;
2013 uint8_t sessionId; /* sme sessionId Added for BT-AMP support */
2014 uint16_t transactionId; /* sme transaction Id - for BT-AMP Support */
2015 uint32_t rc; /* return code */
2016 tSirAddtsRspInfo rsp;
2017} tSirAddtsRsp, *tpSirAddtsRsp;
2018
2019typedef struct sSirDeltsReq {
2020 uint16_t messageType; /* eWNI_SME_DELTS_REQ */
2021 uint16_t length;
2022 uint8_t sessionId; /* Session ID */
2023 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302024 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002025 uint16_t aid; /* use 0 if macAddr is being specified */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302026 struct qdf_mac_addr macaddr; /* only on AP to specify the STA */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002027 uint8_t rspReqd;
2028 tSirDeltsReqInfo req;
2029} tSirDeltsReq, *tpSirDeltsReq;
2030
2031typedef struct sSirDeltsRsp {
2032 uint16_t messageType; /* eWNI_SME_DELTS_RSP */
2033 uint16_t length;
2034 uint8_t sessionId; /* sme sessionId Added for BT-AMP support */
2035 uint16_t transactionId; /* sme transaction Id - for BT-AMP Support */
2036 uint32_t rc;
2037 uint16_t aid; /* use 0 if macAddr is being specified */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302038 struct qdf_mac_addr macaddr; /* only on AP to specify the STA */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002039 tSirDeltsReqInfo rsp;
2040} tSirDeltsRsp, *tpSirDeltsRsp;
2041
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002042#define SIR_QOS_NUM_AC_MAX 4
2043
2044typedef struct sSirAggrQosReqInfo {
2045 uint16_t tspecIdx;
2046 tSirAddtsReqInfo aggrAddTsInfo[SIR_QOS_NUM_AC_MAX];
2047} tSirAggrQosReqInfo, *tpSirAggrQosReqInfo;
2048
2049typedef struct sSirAggrQosReq {
2050 uint16_t messageType; /* eWNI_SME_ADDTS_REQ */
2051 uint16_t length;
2052 uint8_t sessionId; /* Session ID */
2053 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302054 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002055 uint32_t timeout; /* in ms */
2056 uint8_t rspReqd;
2057 tSirAggrQosReqInfo aggrInfo;
2058} tSirAggrQosReq, *tpSirAggrQosReq;
2059
2060typedef struct sSirAggrQosRspInfo {
2061 uint16_t tspecIdx;
2062 tSirAddtsRspInfo aggrRsp[SIR_QOS_NUM_AC_MAX];
2063} tSirAggrQosRspInfo, *tpSirAggrQosRspInfo;
2064
2065typedef struct sSirAggrQosRsp {
2066 uint16_t messageType;
2067 uint16_t length;
2068 uint8_t sessionId;
2069 tSirAggrQosRspInfo aggrInfo;
2070} tSirAggrQosRsp, *tpSirAggrQosRsp;
2071
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002072
2073typedef struct sSirQosMapSet {
2074 uint8_t present;
2075 uint8_t num_dscp_exceptions;
2076 uint8_t dscp_exceptions[21][2];
2077 uint8_t dscp_range[8][2];
2078} tSirQosMapSet, *tpSirQosMapSet;
2079
2080typedef struct sSmeIbssPeerInd {
2081 uint16_t mesgType;
2082 uint16_t mesgLen;
2083 uint8_t sessionId;
2084
Anurag Chouhan6d760662016-02-20 16:05:43 +05302085 struct qdf_mac_addr peer_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002086 uint16_t staId;
2087
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002088 /* Beacon will be appended for new Peer indication. */
2089} tSmeIbssPeerInd, *tpSmeIbssPeerInd;
2090
2091typedef struct sSirIbssPeerInactivityInd {
2092 uint8_t bssIdx;
2093 uint8_t staIdx;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302094 struct qdf_mac_addr peer_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002095} tSirIbssPeerInactivityInd, *tpSirIbssPeerInactivityInd;
2096
2097typedef struct sLimScanChn {
2098 uint16_t numTimeScan; /* how many time this channel is scan */
2099 uint8_t channelId;
2100} tLimScanChn;
2101
gaoleze5108942017-03-31 16:56:42 +08002102/**
2103 * struct lim_channel_status
2104 * @channelfreq: Channel freq
2105 * @noise_floor: Noise Floor value
2106 * @rx_clear_count: rx clear count
2107 * @cycle_count: cycle count
2108 * @chan_tx_pwr_range: channel tx power per range in 0.5dBm steps
2109 * @chan_tx_pwr_throughput: channel tx power per throughput
2110 * @rx_frame_count: rx frame count (cumulative)
2111 * @bss_rx_cycle_count: BSS rx cycle count
2112 * @rx_11b_mode_data_duration: b-mode data rx time (units are microseconds)
2113 * @tx_frame_count: BSS tx cycle count
2114 * @mac_clk_mhz: sample frequency
2115 * @channel_id: channel index
2116 * @cmd_flags: indicate which stat event is this status coming from
2117 */
2118struct lim_channel_status {
2119 uint32_t channelfreq;
2120 uint32_t noise_floor;
2121 uint32_t rx_clear_count;
2122 uint32_t cycle_count;
2123 uint32_t chan_tx_pwr_range;
2124 uint32_t chan_tx_pwr_throughput;
2125 uint32_t rx_frame_count;
2126 uint32_t bss_rx_cycle_count;
2127 uint32_t rx_11b_mode_data_duration;
2128 uint32_t tx_frame_count;
2129 uint32_t mac_clk_mhz;
2130 uint32_t channel_id;
2131 uint32_t cmd_flags;
2132};
2133
2134/**
2135 * struct lim_scan_channel_status
2136 * @total_channel: total number of be scanned channel
2137 * @channel_status_list: channel status info store in this array
2138 */
2139struct lim_scan_channel_status {
2140 uint8_t total_channel;
2141 struct lim_channel_status
2142 channel_status_list[SIR_MAX_SUPPORTED_CHANNEL_LIST];
2143};
2144
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002145typedef struct sSmeGetScanChnRsp {
2146 /* Message Type */
2147 uint16_t mesgType;
2148 /* Message Length */
2149 uint16_t mesgLen;
2150 uint8_t sessionId;
2151 uint8_t numChn;
2152 tLimScanChn scanChn[1];
2153} tSmeGetScanChnRsp, *tpSmeGetScanChnRsp;
2154
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002155typedef struct sSirSmeGetAssocSTAsReq {
2156 uint16_t messageType; /* eWNI_SME_GET_ASSOC_STAS_REQ */
2157 uint16_t length;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302158 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002159 uint16_t modId;
2160 void *pUsrContext;
2161 void *pSapEventCallback;
2162 /* Pointer to allocated mem passed in wlansap_get_assoc_stations API */
2163 void *pAssocStasArray;
2164} tSirSmeGetAssocSTAsReq, *tpSirSmeGetAssocSTAsReq;
2165
2166typedef struct sSmeMaxAssocInd {
2167 uint16_t mesgType; /* eWNI_SME_MAX_ASSOC_EXCEEDED */
2168 uint16_t mesgLen;
2169 uint8_t sessionId;
2170 /* the new peer that got rejected max assoc limit reached */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302171 struct qdf_mac_addr peer_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002172} tSmeMaxAssocInd, *tpSmeMaxAssocInd;
2173
2174typedef struct sSmeCsaOffloadInd {
2175 uint16_t mesgType; /* eWNI_SME_CSA_OFFLOAD_EVENT */
2176 uint16_t mesgLen;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302177 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002178} tSmeCsaOffloadInd, *tpSmeCsaOffloadInd;
2179
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002180#define SIR_MAX_NAME_SIZE 64
2181#define SIR_MAX_TEXT_SIZE 32
2182
2183typedef struct sSirName {
2184 uint8_t num_name;
2185 uint8_t name[SIR_MAX_NAME_SIZE];
2186} tSirName;
2187
2188typedef struct sSirText {
2189 uint8_t num_text;
2190 uint8_t text[SIR_MAX_TEXT_SIZE];
2191} tSirText;
2192
2193#define SIR_WPS_PROBRSP_VER_PRESENT 0x00000001
2194#define SIR_WPS_PROBRSP_STATE_PRESENT 0x00000002
2195#define SIR_WPS_PROBRSP_APSETUPLOCK_PRESENT 0x00000004
2196#define SIR_WPS_PROBRSP_SELECTEDREGISTRA_PRESENT 0x00000008
2197#define SIR_WPS_PROBRSP_DEVICEPASSWORDID_PRESENT 0x00000010
2198#define SIR_WPS_PROBRSP_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020
2199#define SIR_WPS_PROBRSP_RESPONSETYPE_PRESENT 0x00000040
2200#define SIR_WPS_PROBRSP_UUIDE_PRESENT 0x00000080
2201#define SIR_WPS_PROBRSP_MANUFACTURE_PRESENT 0x00000100
2202#define SIR_WPS_PROBRSP_MODELNAME_PRESENT 0x00000200
2203#define SIR_WPS_PROBRSP_MODELNUMBER_PRESENT 0x00000400
2204#define SIR_WPS_PROBRSP_SERIALNUMBER_PRESENT 0x00000800
2205#define SIR_WPS_PROBRSP_PRIMARYDEVICETYPE_PRESENT 0x00001000
2206#define SIR_WPS_PROBRSP_DEVICENAME_PRESENT 0x00002000
2207#define SIR_WPS_PROBRSP_CONFIGMETHODS_PRESENT 0x00004000
2208#define SIR_WPS_PROBRSP_RF_BANDS_PRESENT 0x00008000
2209
2210typedef struct sSirWPSProbeRspIE {
2211 uint32_t FieldPresent;
2212 uint32_t Version; /* Version. 0x10 = version 1.0, 0x11 = etc. */
2213 uint32_t wpsState; /* 1 = unconfigured, 2 = configured. */
2214 bool APSetupLocked; /* Must be included if value is true */
2215 /*
2216 * BOOL: indicates if the user has recently activated a Registrar to
2217 * add an Enrollee.
2218 */
2219 bool SelectedRegistra;
2220 uint16_t DevicePasswordID; /* Device Password ID */
2221 /* Selected Registrar config method */
2222 uint16_t SelectedRegistraCfgMethod;
2223 uint8_t ResponseType; /* Response type */
2224 uint8_t UUID_E[16]; /* Unique identifier of the AP. */
2225 tSirName Manufacture;
2226 tSirText ModelName;
2227 tSirText ModelNumber;
2228 tSirText SerialNumber;
2229 /* Device Category ID: 1Computer, 2Input Device, ... */
2230 uint32_t PrimaryDeviceCategory;
2231 /* Vendor specific OUI for Device Sub Category */
2232 uint8_t PrimaryDeviceOUI[4];
2233 /*
2234 Device Sub Category ID: 1-PC, 2-Server if Device Category ID
2235 * is computer
2236 */
2237 uint32_t DeviceSubCategory;
2238 tSirText DeviceName;
2239 uint16_t ConfigMethod; /* Configuaration method */
2240 uint8_t RFBand; /* RF bands available on the AP */
2241} tSirWPSProbeRspIE;
2242
2243#define SIR_WPS_BEACON_VER_PRESENT 0x00000001
2244#define SIR_WPS_BEACON_STATE_PRESENT 0x00000002
2245#define SIR_WPS_BEACON_APSETUPLOCK_PRESENT 0x00000004
2246#define SIR_WPS_BEACON_SELECTEDREGISTRA_PRESENT 0x00000008
2247#define SIR_WPS_BEACON_DEVICEPASSWORDID_PRESENT 0x00000010
2248#define SIR_WPS_BEACON_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020
2249#define SIR_WPS_BEACON_UUIDE_PRESENT 0x00000080
2250#define SIR_WPS_BEACON_RF_BANDS_PRESENT 0x00000100
2251#define SIR_WPS_UUID_LEN 16
2252
2253typedef struct sSirWPSBeaconIE {
2254 uint32_t FieldPresent;
2255 uint32_t Version; /* Version. 0x10 = version 1.0, 0x11 = etc. */
2256 uint32_t wpsState; /* 1 = unconfigured, 2 = configured. */
2257 bool APSetupLocked; /* Must be included if value is true */
2258 /*
2259 * BOOL: indicates if the user has recently activated a Registrar to
2260 * add an Enrollee.
2261 */
2262 bool SelectedRegistra;
2263 uint16_t DevicePasswordID; /* Device Password ID */
2264 /* Selected Registrar config method */
2265 uint16_t SelectedRegistraCfgMethod;
2266 uint8_t UUID_E[SIR_WPS_UUID_LEN]; /* Unique identifier of the AP. */
2267 uint8_t RFBand; /* RF bands available on the AP */
2268} tSirWPSBeaconIE;
2269
2270#define SIR_WPS_ASSOCRSP_VER_PRESENT 0x00000001
2271#define SIR_WPS_ASSOCRSP_RESPONSETYPE_PRESENT 0x00000002
2272
2273typedef struct sSirWPSAssocRspIE {
2274 uint32_t FieldPresent;
2275 uint32_t Version;
2276 uint8_t ResposeType;
2277} tSirWPSAssocRspIE;
2278
2279typedef struct sSirAPWPSIEs {
2280 tSirWPSProbeRspIE SirWPSProbeRspIE; /*WPS Set Probe Respose IE */
2281 tSirWPSBeaconIE SirWPSBeaconIE; /*WPS Set Beacon IE */
2282 tSirWPSAssocRspIE SirWPSAssocRspIE; /*WPS Set Assoc Response IE */
2283} tSirAPWPSIEs, *tpSiriAPWPSIEs;
2284
2285typedef struct sSirUpdateAPWPSIEsReq {
2286 uint16_t messageType; /* eWNI_SME_UPDATE_APWPSIE_REQ */
2287 uint16_t length;
2288 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302289 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002290 uint8_t sessionId; /* Session ID */
2291 tSirAPWPSIEs APWPSIEs;
2292} tSirUpdateAPWPSIEsReq, *tpSirUpdateAPWPSIEsReq;
2293
Naveen Rawat8029a402017-06-01 10:54:19 -07002294struct update_config {
2295 uint16_t messageType; /* eWNI_SME_UPDATE_CONFIG */
2296 uint16_t length;
2297 uint8_t sme_session_id;
2298 uint16_t capab;
2299 uint32_t value;
2300};
2301
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302302/*
2303 * enum sir_update_session_param_type - session param type
2304 * @SIR_PARAM_SSID_HIDDEN: ssidHidden parameter
Selvaraj, Sridharac4fcf32016-09-28 12:57:32 +05302305 * @SIR_PARAM_IGNORE_ASSOC_DISALLOWED: ignore_assoc_disallowed parameter
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302306 */
2307enum sir_update_session_param_type {
2308 SIR_PARAM_SSID_HIDDEN,
Selvaraj, Sridharac4fcf32016-09-28 12:57:32 +05302309 SIR_PARAM_IGNORE_ASSOC_DISALLOWED,
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302310};
2311
2312/*
2313 * struct sir_update_session_param
2314 * @message_type: SME message type
2315 * @length: size of struct sir_update_session_param
2316 * @session_id: Session ID
2317 * @param_type: parameter to be updated
2318 * @param_val: Parameter value to update
2319 */
2320struct sir_update_session_param {
2321 uint16_t message_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002322 uint16_t length;
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302323 uint8_t session_id;
2324 uint32_t param_type;
2325 uint32_t param_val;
2326};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002327
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07002328/**
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -07002329 * struct sir_set_he_bss_color
2330 * @message_type: SME message type
2331 * @length: size of struct sir_set_he_bss_color
2332 * @session_id: Session ID
2333 * @bss_color: bss color value
2334 */
2335struct sir_set_he_bss_color {
2336 uint16_t message_type;
2337 uint16_t length;
2338 uint8_t session_id;
2339 uint8_t bss_color;
2340};
2341
2342/**
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07002343 * struct sir_create_session - Used for creating session in monitor mode
2344 * @type: SME host message type.
2345 * @msg_len: Length of the message.
2346 * @bss_id: bss_id for creating the session.
2347 */
2348struct sir_create_session {
2349 uint16_t type;
2350 uint16_t msg_len;
2351 struct qdf_mac_addr bss_id;
2352};
2353
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002354/* Beacon Interval */
2355typedef struct sSirChangeBIParams {
2356 uint16_t messageType;
2357 uint16_t length;
2358 uint16_t beaconInterval; /* Beacon Interval */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302359 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002360 uint8_t sessionId; /* Session ID */
2361} tSirChangeBIParams, *tpSirChangeBIParams;
2362
2363#ifdef QCA_HT_2040_COEX
2364typedef struct sSirSetHT2040Mode {
2365 uint16_t messageType;
2366 uint16_t length;
2367 uint8_t cbMode;
2368 bool obssEnabled;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302369 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002370 uint8_t sessionId; /* Session ID */
2371} tSirSetHT2040Mode, *tpSirSetHT2040Mode;
2372#endif
2373
2374#define SIR_WPS_PBC_WALK_TIME 120 /* 120 Second */
2375
2376typedef struct sSirWPSPBCSession {
2377 struct sSirWPSPBCSession *next;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302378 struct qdf_mac_addr addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002379 uint8_t uuid_e[SIR_WPS_UUID_LEN];
2380 uint32_t timestamp;
2381} tSirWPSPBCSession;
2382
2383typedef struct sSirSmeGetWPSPBCSessionsReq {
2384 uint16_t messageType; /* eWNI_SME_GET_WPSPBC_SESSION_REQ */
2385 uint16_t length;
2386 void *pUsrContext;
2387 void *pSapEventCallback;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302388 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002389 /* MAC Address of STA in WPS Session to be removed */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302390 struct qdf_mac_addr remove_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002391} tSirSmeGetWPSPBCSessionsReq, *tpSirSmeGetWPSPBCSessionsReq;
2392
2393typedef struct sSirWPSPBCProbeReq {
Anurag Chouhan6d760662016-02-20 16:05:43 +05302394 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002395 uint16_t probeReqIELen;
2396 uint8_t probeReqIE[512];
2397} tSirWPSPBCProbeReq, *tpSirWPSPBCProbeReq;
2398
2399/* probereq from peer, when wsc is enabled */
2400typedef struct sSirSmeProbeReqInd {
2401 uint16_t messageType; /* eWNI_SME_WPS_PBC_PROBE_REQ_IND */
2402 uint16_t length;
2403 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302404 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002405 tSirWPSPBCProbeReq WPSPBCProbeReq;
2406} tSirSmeProbeReqInd, *tpSirSmeProbeReqInd;
2407
2408typedef struct sSirUpdateAPWPARSNIEsReq {
2409 uint16_t messageType; /* eWNI_SME_SET_APWPARSNIEs_REQ */
2410 uint16_t length;
2411 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302412 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002413 uint8_t sessionId; /* Session ID */
2414 tSirRSNie APWPARSNIEs;
2415} tSirUpdateAPWPARSNIEsReq, *tpSirUpdateAPWPARSNIEsReq;
2416
2417#define SIR_ROAM_MAX_CHANNELS 80
2418#define SIR_ROAM_SCAN_MAX_PB_REQ_SIZE 450
2419/* Occupied channel list remains static */
2420#define CHANNEL_LIST_STATIC 1
Himanshu Agarwalb23aa572018-06-14 17:04:44 +05302421/* Occupied channel list can be dynamic */
2422#define CHANNEL_LIST_DYNAMIC 2
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002423#define SIR_ROAM_SCAN_24G_DEFAULT_CH 1
2424#define SIR_ROAM_SCAN_5G_DEFAULT_CH 36
2425#define SIR_ROAM_SCAN_RESERVED_BYTES 61
2426
2427#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2428#define SIR_ROAM_SCAN_PSK_SIZE 32
2429#define SIR_ROAM_R0KH_ID_MAX_LEN 48
2430#endif
2431/* SME -> HAL - This is the host offload request. */
2432#define SIR_IPV4_ARP_REPLY_OFFLOAD 0
2433#define SIR_IPV6_NEIGHBOR_DISCOVERY_OFFLOAD 1
2434#define SIR_IPV6_NS_OFFLOAD 2
2435#define SIR_OFFLOAD_DISABLE 0
2436#define SIR_OFFLOAD_ENABLE 1
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002437
2438#ifdef WLAN_NS_OFFLOAD
2439typedef struct sSirNsOffloadReq {
Srinivas Girigowdac79a7102015-12-08 15:18:26 -08002440 uint8_t srcIPv6Addr[SIR_MAC_IPV6_ADDR_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002441 uint8_t selfIPv6Addr[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][SIR_MAC_IPV6_ADDR_LEN];
2442 uint8_t targetIPv6Addr[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][SIR_MAC_IPV6_ADDR_LEN];
Anurag Chouhan6d760662016-02-20 16:05:43 +05302443 struct qdf_mac_addr self_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002444 uint8_t srcIPv6AddrValid;
2445 uint8_t targetIPv6AddrValid[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA];
Sravan Kumar Kairamc0873582016-07-26 17:34:57 +05302446 uint8_t target_ipv6_addr_ac_type[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002447 uint8_t slotIdx;
2448} tSirNsOffloadReq, *tpSirNsOffloadReq;
2449#endif /* WLAN_NS_OFFLOAD */
2450
2451typedef struct sSirHostOffloadReq {
2452 uint8_t offloadType;
2453 uint8_t enableOrDisable;
2454 uint32_t num_ns_offload_count;
2455 union {
Srinivas Girigowdac79a7102015-12-08 15:18:26 -08002456 uint8_t hostIpv4Addr[SIR_IPV4_ADDR_LEN];
2457 uint8_t hostIpv6Addr[SIR_MAC_IPV6_ADDR_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002458 } params;
2459#ifdef WLAN_NS_OFFLOAD
2460 tSirNsOffloadReq nsOffloadInfo;
2461#endif /* WLAN_NS_OFFLOAD */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302462 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002463} tSirHostOffloadReq, *tpSirHostOffloadReq;
2464
2465/* Packet Types. */
2466#define SIR_KEEP_ALIVE_NULL_PKT 1
2467#define SIR_KEEP_ALIVE_UNSOLICIT_ARP_RSP 2
2468
2469/* Keep Alive request. */
2470typedef struct sSirKeepAliveReq {
2471 uint8_t packetType;
2472 uint32_t timePeriod;
2473 tSirIpv4Addr hostIpv4Addr;
2474 tSirIpv4Addr destIpv4Addr;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302475 struct qdf_mac_addr dest_macaddr;
2476 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002477 uint8_t sessionId;
2478} tSirKeepAliveReq, *tpSirKeepAliveReq;
2479
2480typedef struct sSirSmeMgmtFrameInd {
Abhishek Singh7996eb72015-12-30 17:24:02 +05302481 uint16_t frame_len;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002482 uint32_t rxChan;
2483 uint8_t sessionId;
2484 uint8_t frameType;
2485 int8_t rxRssi;
2486 uint8_t frameBuf[1]; /* variable */
2487} tSirSmeMgmtFrameInd, *tpSirSmeMgmtFrameInd;
2488
Abhishek Singh7996eb72015-12-30 17:24:02 +05302489typedef void (*sir_mgmt_frame_ind_callback)(tSirSmeMgmtFrameInd *frame_ind);
2490/**
2491 * struct sir_sme_mgmt_frame_cb_req - Register a
2492 * management frame callback req
2493 *
2494 * @message_type: message id
2495 * @length: msg length
2496 * @callback: callback for management frame indication
2497 */
2498struct sir_sme_mgmt_frame_cb_req {
2499 uint16_t message_type;
2500 uint16_t length;
2501 sir_mgmt_frame_ind_callback callback;
2502};
2503
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002504#ifdef WLAN_FEATURE_11W
2505typedef struct sSirSmeUnprotMgmtFrameInd {
2506 uint8_t sessionId;
2507 uint8_t frameType;
2508 uint8_t frameLen;
2509 uint8_t frameBuf[1]; /* variable */
2510} tSirSmeUnprotMgmtFrameInd, *tpSirSmeUnprotMgmtFrameInd;
2511#endif
2512
2513#define SIR_IS_FULL_POWER_REASON_DISCONNECTED(eReason) \
2514 ((eSME_LINK_DISCONNECTED_BY_HDD == (eReason)) || \
2515 (eSME_LINK_DISCONNECTED_BY_OTHER == (eReason)))
2516#define SIR_IS_FULL_POWER_NEEDED_BY_HDD(eReason) \
2517 ((eSME_LINK_DISCONNECTED_BY_HDD == (eReason)) || \
2518 (eSME_FULL_PWR_NEEDED_BY_HDD == (eReason)))
2519
2520/* P2P Power Save Related */
2521typedef struct sSirNoAParam {
2522 uint8_t ctWindow:7;
2523 uint8_t OppPS:1;
2524 uint8_t count;
2525 uint32_t duration;
2526 uint32_t interval;
2527 uint32_t singleNoADuration;
2528 uint8_t psSelection;
2529} tSirNoAParam, *tpSirNoAParam;
2530
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002531typedef struct sSirWlanResumeParam {
2532 uint8_t configuredMcstBcstFilterSetting;
2533} tSirWlanResumeParam, *tpSirWlanResumeParam;
2534
2535#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
2536
2537typedef enum ext_wow_type {
2538 EXT_WOW_TYPE_APP_TYPE1, /* wow type: only enable wakeup for app type1 */
2539 EXT_WOW_TYPE_APP_TYPE2, /* wow type: only enable wakeup for app type2 */
2540 EXT_WOW_TYPE_APP_TYPE1_2, /* wow type: enable wakeup for app type1&2 */
2541} EXT_WOW_TYPE;
2542
2543typedef struct {
2544 uint8_t vdev_id;
2545 EXT_WOW_TYPE type;
2546 uint32_t wakeup_pin_num;
2547} tSirExtWoWParams, *tpSirExtWoWParams;
2548
2549typedef struct {
2550 uint8_t vdev_id;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302551 struct qdf_mac_addr wakee_mac_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002552 uint8_t identification_id[8];
2553 uint8_t password[16];
2554 uint32_t id_length;
2555 uint32_t pass_length;
2556} tSirAppType1Params, *tpSirAppType1Params;
2557
2558typedef struct {
2559 uint8_t vdev_id;
2560
2561 uint8_t rc4_key[16];
2562 uint32_t rc4_key_len;
2563
2564 /** ip header parameter */
2565 uint32_t ip_id; /* NC id */
2566 uint32_t ip_device_ip; /* NC IP address */
2567 uint32_t ip_server_ip; /* Push server IP address */
2568
2569 /** tcp header parameter */
2570 uint16_t tcp_src_port; /* NC TCP port */
2571 uint16_t tcp_dst_port; /* Push server TCP port */
2572 uint32_t tcp_seq;
2573 uint32_t tcp_ack_seq;
2574
2575 uint32_t keepalive_init; /* Initial ping interval */
2576 uint32_t keepalive_min; /* Minimum ping interval */
2577 uint32_t keepalive_max; /* Maximum ping interval */
2578 uint32_t keepalive_inc; /* Increment of ping interval */
2579
Anurag Chouhan6d760662016-02-20 16:05:43 +05302580 struct qdf_mac_addr gateway_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002581 uint32_t tcp_tx_timeout_val;
2582 uint32_t tcp_rx_timeout_val;
2583} tSirAppType2Params, *tpSirAppType2Params;
2584#endif
2585
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002586#define ANI_MAX_IBSS_ROUTE_TABLE_ENTRY 100
2587
2588typedef struct sAniDestIpNextHopMacPair {
Anurag Chouhan6d760662016-02-20 16:05:43 +05302589 uint8_t destIpv4Addr[QDF_IPV4_ADDR_SIZE];
2590 uint8_t nextHopMacAddr[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002591} tAniDestIpNextHopMacPair;
2592
2593typedef struct sAniIbssRouteTable {
2594 uint8_t sessionId;
2595 uint16_t numEntries;
2596 tAniDestIpNextHopMacPair destIpNextHopPair[1];
2597} tAniIbssRouteTable;
2598
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002599#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2600typedef struct {
2601 uint8_t acvo_uapsd:1;
2602 uint8_t acvi_uapsd:1;
2603 uint8_t acbk_uapsd:1;
2604 uint8_t acbe_uapsd:1;
2605 uint8_t reserved:4;
2606} tSirAcUapsd, *tpSirAcUapsd;
2607#endif
2608
2609typedef struct {
2610 tSirMacSSid ssId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302611 uint8_t currAPbssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002612 uint32_t authentication;
2613 uint8_t encryption;
2614 uint8_t mcencryption;
2615 uint8_t ChannelCount;
2616 uint8_t ChannelCache[SIR_ROAM_MAX_CHANNELS];
2617#ifdef WLAN_FEATURE_11W
2618 bool mfp_enabled;
2619#endif
2620
2621} tSirRoamNetworkType;
2622
2623typedef struct SirMobilityDomainInfo {
2624 uint8_t mdiePresent;
2625 uint16_t mobilityDomain;
2626} tSirMobilityDomainInfo;
2627
2628typedef enum {
2629 SIR_ROAMING_DFS_CHANNEL_DISABLED = 0,
2630 SIR_ROAMING_DFS_CHANNEL_ENABLED_NORMAL = 1,
2631 SIR_ROAMING_DFS_CHANNEL_ENABLED_ACTIVE = 2
2632} eSirDFSRoamScanMode;
2633#define MAX_SSID_ALLOWED_LIST 4
2634#define MAX_BSSID_AVOID_LIST 16
2635#define MAX_BSSID_FAVORED 16
2636/**
2637 * struct roam_ext_params - Structure holding roaming parameters
2638 * @num_bssid_avoid_list: The number of BSSID's that we should
2639 * avoid connecting to. It is like a
2640 * blacklist of BSSID's.
2641 * @num_ssid_allowed_list: The number of SSID profiles that are
2642 * in the Whitelist. When roaming, we
2643 * consider the BSSID's with this SSID
2644 * also for roaming apart from the connected one's
2645 * @num_bssid_favored: Number of BSSID's which have a preference over
2646 * others
2647 * @ssid_allowed_list: Whitelist SSID's
2648 * @bssid_avoid_list: Blacklist SSID's
2649 * @bssid_favored: Favorable BSSID's
2650 * @bssid_favored_factor: RSSI to be added to this BSSID to prefer it
2651 * @raise_rssi_thresh_5g: The RSSI threshold below which the
2652 * raise_factor_5g (boost factor) should be
2653 * applied.
2654 * @drop_rssi_thresh_5g: The RSSI threshold beyond which the
2655 * drop_factor_5g (penalty factor) should be
2656 * applied
2657 * @raise_rssi_type_5g: Algorithm to apply the boost factor
2658 * @raise_factor_5g: Boost factor
2659 * @drop_rssi_type_5g: Algorithm to apply the penalty factor
2660 * @drop_factor_5g: Penalty factor
2661 * @max_raise_rssi_5g: Maximum amount of Boost that can added
2662 * @max_drop_rssi_5g: Maximum amount of penalty that can be subtracted
2663 * @good_rssi_threshold: The Lookup UP threshold beyond which roaming
2664 * scan should be performed.
2665 * @rssi_diff: RSSI difference for the AP to be better over the
2666 * current AP to avoid ping pong effects
2667 * @good_rssi_roam: Lazy Roam
2668 * @is_5g_pref_enabled: 5GHz BSSID preference feature enable/disable.
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002669 * @bg_scan_bad_rssi_thresh: Bad RSSI threshold to perform bg scan.
Vignesh Viswanathanc018e982017-09-07 18:49:19 +05302670 * @bad_rssi_thresh_offset_2g: Offset from Bad RSSI threshold for 2G to 5G Roam
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002671 * @bg_scan_client_bitmap: Bitmap to identify the client scans to snoop.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002672 *
2673 * This structure holds all the key parameters related to
2674 * initial connection and also roaming connections.
2675 * */
2676struct roam_ext_params {
2677 uint8_t num_bssid_avoid_list;
2678 uint8_t num_ssid_allowed_list;
2679 uint8_t num_bssid_favored;
2680 tSirMacSSid ssid_allowed_list[MAX_SSID_ALLOWED_LIST];
Anurag Chouhan6d760662016-02-20 16:05:43 +05302681 struct qdf_mac_addr bssid_avoid_list[MAX_BSSID_AVOID_LIST];
2682 struct qdf_mac_addr bssid_favored[MAX_BSSID_FAVORED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002683 uint8_t bssid_favored_factor[MAX_BSSID_FAVORED];
2684 int raise_rssi_thresh_5g;
2685 int drop_rssi_thresh_5g;
2686 uint8_t raise_rssi_type_5g;
2687 uint8_t raise_factor_5g;
2688 uint8_t drop_rssi_type_5g;
2689 uint8_t drop_factor_5g;
2690 int max_raise_rssi_5g;
2691 int max_drop_rssi_5g;
2692 int alert_rssi_threshold;
2693 int rssi_diff;
2694 int good_rssi_roam;
2695 bool is_5g_pref_enabled;
Gupta, Kapilc68ad462016-02-01 19:17:23 +05302696 int dense_rssi_thresh_offset;
2697 int dense_min_aps_cnt;
2698 int initial_dense_status;
2699 int traffic_threshold;
Abhishek Singh4db8c152017-07-18 10:40:08 +05302700 uint8_t num_rssi_rejection_ap;
2701 struct rssi_disallow_bssid rssi_rejection_ap[MAX_RSSI_AVOID_BSSID_LIST];
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002702 int8_t bg_scan_bad_rssi_thresh;
Vignesh Viswanathanc018e982017-09-07 18:49:19 +05302703 uint8_t roam_bad_rssi_thresh_offset_2g;
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07002704 uint32_t bg_scan_client_bitmap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002705};
2706
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08002707/**
Himanshu Agarwal8bcec572017-09-28 11:54:37 +05302708 * struct sir_weight_config - weight params to
2709 * calculate best candidate
2710 * @rssi_weightage: RSSI weightage
2711 * @ht_caps_weightage: HT caps weightage
2712 * @vht_caps_weightage: VHT caps weightage
2713 * @he_caps_weightage: HE caps weightage
2714 * @chan_width_weightage: Channel width weightage
2715 * @chan_band_weightage: Channel band weightage
2716 * @nss_weightage: NSS weightage
2717 * @beamforming_cap_weightage: Beamforming caps weightage
2718 * @pcl_weightage: PCL weightage
2719 * @channel_congestion_weightage: channel congestion weightage
2720 * @oce_wan_weightage: OCE WAN metrics weightage
2721 */
2722struct sir_weight_config {
2723 uint8_t rssi_weightage;
2724 uint8_t ht_caps_weightage;
2725 uint8_t vht_caps_weightage;
2726 uint8_t he_caps_weightage;
2727 uint8_t chan_width_weightage;
2728 uint8_t chan_band_weightage;
2729 uint8_t nss_weightage;
2730 uint8_t beamforming_cap_weightage;
2731 uint8_t pcl_weightage;
2732 uint8_t channel_congestion_weightage;
2733 uint8_t oce_wan_weightage;
2734};
2735
2736struct sir_rssi_cfg_score {
2737 uint32_t best_rssi_threshold;
2738 uint32_t good_rssi_threshold;
2739 uint32_t bad_rssi_threshold;
2740 uint32_t good_rssi_pcnt;
2741 uint32_t bad_rssi_pcnt;
2742 uint32_t good_rssi_bucket_size;
2743 uint32_t bad_rssi_bucket_size;
2744 uint32_t rssi_pref_5g_rssi_thresh;
2745};
2746
2747/**
2748 * struct sir_per_slot_scoring - define % score for differents slots for a
2749 * scoring param.
2750 * num_slot: number of slots in which the param will be divided.
2751 * Max 15. index 0 is used for 'not_present. Num_slot will
2752 * equally divide 100. e.g, if num_slot = 4 slot 0 = 0-25%, slot
2753 * 1 = 26-50% slot 2 = 51-75%, slot 3 = 76-100%
2754 * score_pcnt3_to_0: Conatins score percentage for slot 0-3
2755 * BITS 0-7 :- the scoring pcnt when not present
2756 * BITS 8-15 :- SLOT_1
2757 * BITS 16-23 :- SLOT_2
2758 * BITS 24-31 :- SLOT_3
2759 * score_pcnt7_to_4: Conatins score percentage for slot 4-7
2760 * BITS 0-7 :- SLOT_4
2761 * BITS 8-15 :- SLOT_5
2762 * BITS 16-23 :- SLOT_6
2763 * BITS 24-31 :- SLOT_7
2764 * score_pcnt11_to_8: Conatins score percentage for slot 8-11
2765 * BITS 0-7 :- SLOT_8
2766 * BITS 8-15 :- SLOT_9
2767 * BITS 16-23 :- SLOT_10
2768 * BITS 24-31 :- SLOT_11
2769 * score_pcnt15_to_12: Conatins score percentage for slot 12-15
2770 * BITS 0-7 :- SLOT_12
2771 * BITS 8-15 :- SLOT_13
2772 * BITS 16-23 :- SLOT_14
2773 * BITS 24-31 :- SLOT_15
2774 */
2775struct sir_per_slot_scoring {
2776 uint32_t num_slot;
2777 uint32_t score_pcnt3_to_0;
2778 uint32_t score_pcnt7_to_4;
2779 uint32_t score_pcnt11_to_8;
2780 uint32_t score_pcnt15_to_12;
2781};
2782
2783struct sir_score_config {
2784 bool enable_scoring_for_roam;
2785 struct sir_weight_config weight_cfg;
2786 struct sir_rssi_cfg_score rssi_score;
2787 struct sir_per_slot_scoring esp_qbss_scoring;
2788 struct sir_per_slot_scoring oce_wan_scoring;
2789 uint32_t bandwidth_weight_per_index;
2790 uint32_t nss_weight_per_index;
2791 uint32_t band_weight_per_index;
2792};
2793
2794/**
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08002795 * struct pmkid_mode_bits - Bit flags for PMKID usage in RSN IE
2796 * @fw_okc: Opportunistic key caching enable in firmware
2797 * @fw_pmksa_cache: PMKSA caching enable in firmware, remember previously
2798 * visited BSSID/PMK pairs
2799 */
2800struct pmkid_mode_bits {
2801 uint32_t fw_okc:1;
2802 uint32_t fw_pmksa_cache:1;
2803 uint32_t unused:30;
2804};
2805
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302806/**
2807 * struct lca_disallow_config_params - LCA[Last Connected AP]
2808 * disallow config params
2809 * @disallow_duration: LCA AP disallowed duration
2810 * @rssi_channel_penalization: RSSI channel Penalization
2811 * @num_disallowed_aps: Maximum number of AP's in LCA list
2812 *
2813 */
Srinivas Girigowdaea4d8062017-10-14 12:40:48 -07002814struct lca_disallow_config_params {
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302815 uint32_t disallow_duration;
2816 uint32_t rssi_channel_penalization;
2817 uint32_t num_disallowed_aps;
2818};
2819
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002820/**
2821 * struct mawc_params - Motion Aided Wireless Connectivity configuration
2822 * @MAWCEnabled: Global configuration for MAWC (Roaming/PNO/ExtScan)
2823 * @mawc_roam_enabled: MAWC roaming enable/disable
2824 * @mawc_roam_traffic_threshold: Traffic threshold in kBps for MAWC roaming
2825 * @mawc_roam_ap_rssi_threshold: AP RSSI threshold for MAWC roaming
2826 * @mawc_roam_rssi_high_adjust: High Adjustment value for suppressing scan
2827 * @mawc_roam_rssi_low_adjust: Low Adjustment value for suppressing scan
2828 */
2829struct mawc_params {
2830 bool mawc_enabled;
2831 bool mawc_roam_enabled;
2832 uint32_t mawc_roam_traffic_threshold;
2833 int8_t mawc_roam_ap_rssi_threshold;
2834 uint8_t mawc_roam_rssi_high_adjust;
2835 uint8_t mawc_roam_rssi_low_adjust;
2836};
2837
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002838typedef struct sSirRoamOffloadScanReq {
Selvaraj, Sridhar01741822016-08-30 18:26:19 +05302839 uint16_t message_type;
2840 uint16_t length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002841 bool RoamScanOffloadEnabled;
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07002842 struct mawc_params mawc_roam_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002843 int8_t LookupThreshold;
Varun Reddy Yeturu168134f2017-06-26 13:46:05 -07002844 int8_t rssi_thresh_offset_5g;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002845 uint8_t delay_before_vdev_stop;
2846 uint8_t OpportunisticScanThresholdDiff;
2847 uint8_t RoamRescanRssiDiff;
2848 uint8_t RoamRssiDiff;
gaurank kathpaliac63859d2018-05-03 18:48:41 +05302849 struct rsn_caps rsn_caps;
Abhishek Singh34c0e632017-09-28 14:39:29 +05302850 int32_t rssi_abs_thresh;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002851 uint8_t ChannelCacheType;
2852 uint8_t Command;
2853 uint8_t reason;
2854 uint16_t NeighborScanTimerPeriod;
Sridhar Selvaraj1b2330c2017-07-21 15:16:42 +05302855 uint16_t neighbor_scan_min_timer_period;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002856 uint16_t NeighborRoamScanRefreshPeriod;
2857 uint16_t NeighborScanChannelMinTime;
2858 uint16_t NeighborScanChannelMaxTime;
2859 uint16_t EmptyRefreshScanPeriod;
2860 uint8_t ValidChannelCount;
2861 uint8_t ValidChannelList[SIR_ROAM_MAX_CHANNELS];
2862 bool IsESEAssoc;
Abhinav Kumar271f0632018-03-29 16:01:30 +05302863 bool is_11r_assoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002864 uint8_t nProbes;
2865 uint16_t HomeAwayTime;
2866 tSirRoamNetworkType ConnectedNetwork;
2867 tSirMobilityDomainInfo MDID;
2868 uint8_t sessionId;
2869 uint8_t RoamBmissFirstBcnt;
2870 uint8_t RoamBmissFinalBcnt;
2871 uint8_t RoamBeaconRssiWeight;
2872 eSirDFSRoamScanMode allowDFSChannelRoam;
2873#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2874 uint8_t RoamOffloadEnabled;
2875 uint8_t PSK_PMK[SIR_ROAM_SCAN_PSK_SIZE];
2876 uint32_t pmk_len;
2877 uint8_t Prefer5GHz;
2878 uint8_t RoamRssiCatGap;
2879 uint8_t Select5GHzMargin;
2880 uint8_t KRK[SIR_KRK_KEY_LEN];
2881 uint8_t BTK[SIR_BTK_KEY_LEN];
2882 uint32_t ReassocFailureTimeout;
2883 tSirAcUapsd AcUapsd;
2884 uint8_t R0KH_ID[SIR_ROAM_R0KH_ID_MAX_LEN];
2885 uint32_t R0KH_ID_Length;
2886 uint8_t RoamKeyMgmtOffloadEnabled;
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08002887 struct pmkid_mode_bits pmkid_modes;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002888#endif
2889 struct roam_ext_params roam_params;
2890 uint8_t middle_of_roaming;
2891 uint32_t hi_rssi_scan_max_count;
2892 uint32_t hi_rssi_scan_rssi_delta;
2893 uint32_t hi_rssi_scan_delay;
2894 int32_t hi_rssi_scan_rssi_ub;
Varun Reddy Yeturu05186292015-09-28 17:12:33 -07002895 uint8_t early_stop_scan_enable;
2896 int8_t early_stop_scan_min_threshold;
2897 int8_t early_stop_scan_max_threshold;
Sandeep Puligillaf5ccbf62018-03-26 16:37:05 -07002898 enum scan_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode;
Selvaraj, Sridhara7fc7632016-09-04 13:13:38 +05302899 tSirAddie assoc_ie;
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05302900 struct lca_disallow_config_params lca_config_params;
Himanshu Agarwal8bcec572017-09-28 11:54:37 +05302901 struct scoring_param score_params;
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05302902#ifdef WLAN_FEATURE_FILS_SK
2903 bool is_fils_connection;
2904 struct roam_fils_params roam_fils_params;
2905#endif
yeshwanth sriram guntuka41f936c2017-09-01 17:53:49 +05302906 uint32_t btm_offload_config;
Jiachao Wu84bb2ea2018-01-08 16:17:33 +08002907 uint32_t btm_solicited_timeout;
2908 uint32_t btm_max_attempt_cnt;
2909 uint32_t btm_sticky_time;
Vignesh Viswanathanfb9d0752018-02-06 16:19:00 +05302910 struct wmi_11k_offload_params offload_11k_params;
Abhinav Kumara083f212018-04-05 18:49:45 +05302911 uint32_t ho_delay_for_rx;
Abhinav Kumara95af7c2018-04-06 17:08:00 +05302912 uint32_t min_delay_btw_roam_scans;
2913 uint32_t roam_trigger_reason_bitmask;
Abhinav Kumaredd1d372018-05-11 15:33:35 +05302914 bool roam_force_rssi_trigger;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002915} tSirRoamOffloadScanReq, *tpSirRoamOffloadScanReq;
2916
2917typedef struct sSirRoamOffloadScanRsp {
2918 uint8_t sessionId;
2919 uint32_t reason;
2920} tSirRoamOffloadScanRsp, *tpSirRoamOffloadScanRsp;
2921
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002922/*---------------------------------------------------------------------------
2923 Packet Filtering Parameters
2924 ---------------------------------------------------------------------------*/
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002925#define SIR_MAX_FILTER_TEST_DATA_LEN 8
Dustin Brown4d1e8462016-12-14 12:12:24 -08002926#define SIR_MAX_FILTER_TEST_DATA_OFFSET 200
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002927#define SIR_MAX_NUM_MULTICAST_ADDRESS 240
2928#define SIR_MAX_NUM_FILTERS 20
2929#define SIR_MAX_NUM_TESTS_PER_FILTER 10
2930
Qiwei Cai4505fc62018-05-17 18:35:19 +08002931#ifdef WLAN_FEATURE_PACKET_FILTERING
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002932/* */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002933/* Filter Packet Match Count Parameters */
2934/* */
2935typedef struct sSirRcvFltPktMatchCnt {
2936 uint8_t filterId;
2937 uint32_t matchCnt;
2938} tSirRcvFltPktMatchCnt, tpSirRcvFltPktMatchCnt;
2939
2940typedef struct sSirRcvFltPktMatchRsp {
2941 uint16_t mesgType;
2942 uint16_t mesgLen;
2943
2944 /* Success or Failure */
2945 uint32_t status;
2946 tSirRcvFltPktMatchCnt filterMatchCnt[SIR_MAX_NUM_FILTERS];
Anurag Chouhan6d760662016-02-20 16:05:43 +05302947 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002948} tSirRcvFltPktMatchRsp, *tpSirRcvFltPktMatchRsp;
2949
2950/* */
2951/* Receive Filter Clear Parameters */
2952/* */
2953typedef struct sSirRcvFltPktClearParam {
2954 uint32_t status; /* only valid for response message */
2955 uint8_t filterId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302956 struct qdf_mac_addr self_macaddr;
2957 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002958} tSirRcvFltPktClearParam, *tpSirRcvFltPktClearParam;
Qiwei Cai4505fc62018-05-17 18:35:19 +08002959#endif /* WLAN_FEATURE_PACKET_FILTERING */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002960
2961/* */
2962/* Multicast Address List Parameters */
2963/* */
2964typedef struct sSirRcvFltMcAddrList {
2965 uint32_t ulMulticastAddrCnt;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302966 struct qdf_mac_addr multicastAddr[SIR_MAX_NUM_MULTICAST_ADDRESS];
2967 struct qdf_mac_addr self_macaddr;
2968 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002969 uint8_t action;
2970} tSirRcvFltMcAddrList, *tpSirRcvFltMcAddrList;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002971
2972/* */
2973/* Generic version information */
2974/* */
2975typedef struct {
2976 uint8_t revision;
2977 uint8_t version;
2978 uint8_t minor;
2979 uint8_t major;
2980} tSirVersionType;
2981
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002982/**
2983 * struct sir_wifi_start_log - Structure to store the params sent to start/
2984 * stop logging
2985 * @name: Attribute which indicates the type of logging like per packet
2986 * statistics, connectivity etc.
2987 * @verbose_level: Verbose level which can be 0,1,2,3
Poddar, Siddartheefe3482016-09-21 18:12:59 +05302988 * @is_iwpriv_command: Set 1 for iwpriv command
Srinivas Girigowdac34f11d2016-02-25 16:02:42 -08002989 * @ini_triggered: triggered using ini
2990 * @user_triggered: triggered by user
Poddar, Siddarth176c4362016-10-03 12:25:00 +05302991 * @size: pktlog buffer size
Poddar, Siddarthab99a272017-04-10 12:53:26 +05302992 * @is_pktlog_buff_clear: clear the pktlog buffer
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002993 */
2994struct sir_wifi_start_log {
2995 uint32_t ring_id;
2996 uint32_t verbose_level;
Poddar, Siddartheefe3482016-09-21 18:12:59 +05302997 uint32_t is_iwpriv_command;
Srinivas Girigowdac34f11d2016-02-25 16:02:42 -08002998 bool ini_triggered;
2999 uint8_t user_triggered;
Poddar, Siddarth176c4362016-10-03 12:25:00 +05303000 int size;
Poddar, Siddarthab99a272017-04-10 12:53:26 +05303001 bool is_pktlog_buff_clear;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003002};
3003
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003004
3005/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003006 * struct sir_pcl_list - Format of PCL
3007 * @pcl_list: List of preferred channels
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05303008 * @weight_list: Weights of the PCL
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003009 * @pcl_len: Number of channels in the PCL
3010 */
3011struct sir_pcl_list {
3012 uint8_t pcl_list[128];
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05303013 uint8_t weight_list[128];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003014 uint32_t pcl_len;
3015};
3016
3017/**
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05303018 * struct sir_pcl_chan_weights - Params to get the valid weighed list
3019 * @pcl_list: Preferred channel list already sorted in the order of preference
3020 * @pcl_len: Length of the PCL
3021 * @saved_chan_list: Valid channel list updated as part of
3022 * WMA_UPDATE_CHAN_LIST_REQ
3023 * @saved_num_chan: Length of the valid channel list
3024 * @weighed_valid_list: Weights of the valid channel list. This will have one
3025 * to one mapping with valid_chan_list. FW expects channel order and size to be
3026 * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID.
3027 * @weight_list: Weights assigned by policy manager
3028 */
3029struct sir_pcl_chan_weights {
3030 uint8_t pcl_list[128];
3031 uint32_t pcl_len;
3032 uint8_t saved_chan_list[128];
3033 uint32_t saved_num_chan;
3034 uint8_t weighed_valid_list[128];
3035 uint8_t weight_list[128];
3036};
3037
3038/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003039 * struct sir_hw_mode_params - HW mode params
3040 * @mac0_tx_ss: MAC0 Tx spatial stream
3041 * @mac0_rx_ss: MAC0 Rx spatial stream
3042 * @mac1_tx_ss: MAC1 Tx spatial stream
3043 * @mac1_rx_ss: MAC1 Rx spatial stream
3044 * @mac0_bw: MAC0 bandwidth
3045 * @mac1_bw: MAC1 bandwidth
3046 * @dbs_cap: DBS capabality
3047 * @agile_dfs_cap: Agile DFS capabality
3048 */
3049struct sir_hw_mode_params {
3050 uint8_t mac0_tx_ss;
3051 uint8_t mac0_rx_ss;
3052 uint8_t mac1_tx_ss;
3053 uint8_t mac1_rx_ss;
3054 uint8_t mac0_bw;
3055 uint8_t mac1_bw;
3056 uint8_t dbs_cap;
3057 uint8_t agile_dfs_cap;
Nitesh Shah5b7bae02016-09-28 18:58:33 +05303058 uint8_t sbs_cap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003059};
3060
3061/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003062 * struct sir_set_hw_mode_resp - HW mode response
3063 * @status: Status
3064 * @cfgd_hw_mode_index: Configured HW mode index
3065 * @num_vdev_mac_entries: Number of vdev-mac id entries
3066 * @vdev_mac_map: vdev id-mac id map
3067 */
3068struct sir_set_hw_mode_resp {
3069 uint32_t status;
3070 uint32_t cfgd_hw_mode_index;
3071 uint32_t num_vdev_mac_entries;
Tushnim Bhattacharyyaeab33dd2017-11-15 15:20:02 -08003072 struct policy_mgr_vdev_mac_map vdev_mac_map[MAX_VDEV_SUPPORTED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003073};
3074
3075/**
3076 * struct sir_hw_mode_trans_ind - HW mode transition indication
3077 * @old_hw_mode_index: Index of old HW mode
3078 * @new_hw_mode_index: Index of new HW mode
3079 * @num_vdev_mac_entries: Number of vdev-mac id entries
3080 * @vdev_mac_map: vdev id-mac id map
3081 */
3082struct sir_hw_mode_trans_ind {
3083 uint32_t old_hw_mode_index;
3084 uint32_t new_hw_mode_index;
3085 uint32_t num_vdev_mac_entries;
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08003086 struct policy_mgr_vdev_mac_map vdev_mac_map[MAX_VDEV_SUPPORTED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003087};
3088
3089/**
3090 * struct sir_dual_mac_config_resp - Dual MAC config response
3091 * @status: Status of setting the dual mac configuration
3092 */
3093struct sir_dual_mac_config_resp {
3094 uint32_t status;
3095};
3096
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -08003097/**
3098 * enum set_antenna_mode_status - Status of set antenna mode
3099 * command
3100 * @SET_ANTENNA_MODE_STATUS_OK: command successful
3101 * @SET_ANTENNA_MODE_STATUS_EINVAL: invalid antenna mode
3102 * @SET_ANTENNA_MODE_STATUS_ECANCELED: mode change cancelled
3103 * @SET_ANTENNA_MODE_STATUS_ENOTSUP: mode not supported
3104 */
3105enum set_antenna_mode_status {
3106 SET_ANTENNA_MODE_STATUS_OK,
3107 SET_ANTENNA_MODE_STATUS_EINVAL,
3108 SET_ANTENNA_MODE_STATUS_ECANCELED,
3109 SET_ANTENNA_MODE_STATUS_ENOTSUP,
3110};
3111
3112/**
3113 * struct sir_antenna_mode_resp - set antenna mode response
3114 * @status: Status of setting the antenna mode
3115 */
3116struct sir_antenna_mode_resp {
3117 enum set_antenna_mode_status status;
3118};
3119
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003120/*---------------------------------------------------------------------------
3121 sAniSetTmLevelReq
3122 ---------------------------------------------------------------------------*/
3123typedef struct sAniSetTmLevelReq {
3124 uint16_t tmMode;
3125 uint16_t newTmLevel;
3126} tAniSetTmLevelReq, *tpAniSetTmLevelReq;
3127
3128#ifdef FEATURE_WLAN_TDLS
3129/* TDLS Request struct SME-->PE */
3130typedef struct sSirTdlsSendMgmtReq {
3131 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
3132 uint16_t length;
3133 uint8_t sessionId; /* Session ID */
3134 uint16_t transactionId; /* Transaction ID for cmd */
3135 uint8_t reqType;
3136 uint8_t dialog;
3137 uint16_t statusCode;
3138 uint8_t responder;
3139 uint32_t peerCapability;
3140 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303141 struct qdf_mac_addr bssid;
3142 struct qdf_mac_addr peer_mac;
Ganesh Kondabattinidd726522017-05-10 18:09:37 +05303143 enum wifi_traffic_ac ac;
Srinivas Girigowdaa9d12f12015-11-24 11:26:40 -08003144 /* Variable length. Dont add any field after this. */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003145 uint8_t addIe[1];
3146} tSirTdlsSendMgmtReq, *tpSirSmeTdlsSendMgmtReq;
3147
3148typedef enum TdlsAddOper {
3149 TDLS_OPER_NONE,
3150 TDLS_OPER_ADD,
3151 TDLS_OPER_UPDATE
3152} eTdlsAddOper;
3153
3154/* TDLS Request struct SME-->PE */
3155typedef struct sSirTdlsAddStaReq {
3156 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
3157 uint16_t length;
3158 uint8_t sessionId; /* Session ID */
3159 uint16_t transactionId; /* Transaction ID for cmd */
3160 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303161 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003162 eTdlsAddOper tdlsAddOper;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303163 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003164 uint16_t capability;
3165 uint8_t extn_capability[SIR_MAC_MAX_EXTN_CAP];
3166 uint8_t supported_rates_length;
3167 uint8_t supported_rates[SIR_MAC_MAX_SUPP_RATES];
3168 uint8_t htcap_present;
3169 tSirHTCap htCap;
3170 uint8_t vhtcap_present;
3171 tSirVHTCap vhtCap;
3172 uint8_t uapsd_queues;
3173 uint8_t max_sp;
3174} tSirTdlsAddStaReq, *tpSirSmeTdlsAddStaReq;
3175
3176/* TDLS Response struct PE-->SME */
3177typedef struct sSirTdlsAddStaRsp {
3178 uint16_t messageType;
3179 uint16_t length;
3180 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303181 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003182 uint8_t sessionId; /* Session ID */
3183 uint16_t staId;
3184 uint16_t staType;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003185 eTdlsAddOper tdlsAddOper;
Frank Liud4b2fa02017-03-29 11:46:48 +08003186 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003187} tSirTdlsAddStaRsp;
3188
3189/* TDLS Request struct SME-->PE */
3190typedef struct {
3191 uint16_t messageType; /* eWNI_SME_TDLS_LINK_ESTABLISH_REQ */
3192 uint16_t length;
3193 uint8_t sessionId; /* Session ID */
3194 uint16_t transactionId; /* Transaction ID for cmd */
3195 uint8_t uapsdQueues; /* Peer's uapsd Queues Information */
3196 uint8_t maxSp; /* Peer's Supported Maximum Service Period */
3197 uint8_t isBufSta; /* Does Peer Support as Buffer Station. */
3198 /* Does Peer Support as TDLS Off Channel. */
3199 uint8_t isOffChannelSupported;
3200 uint8_t isResponder; /* Is Peer a responder. */
3201 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303202 struct qdf_mac_addr bssid;
3203 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003204 uint8_t supportedChannelsLen;
3205 uint8_t supportedChannels[SIR_MAC_MAX_SUPP_CHANNELS];
3206 uint8_t supportedOperClassesLen;
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -07003207 uint8_t supportedOperClasses[REG_MAX_SUPP_OPER_CLASSES];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003208} tSirTdlsLinkEstablishReq, *tpSirTdlsLinkEstablishReq;
3209
3210/* TDLS Request struct SME-->PE */
3211typedef struct {
3212 uint16_t messageType; /* eWNI_SME_TDLS_LINK_ESTABLISH_RSP */
3213 uint16_t length;
3214 uint8_t sessionId; /* Session ID */
3215 uint16_t transactionId; /* Transaction ID for cmd */
3216 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303217 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003218} tSirTdlsLinkEstablishReqRsp, *tpSirTdlsLinkEstablishReqRsp;
3219
3220/* TDLS Request struct SME-->PE */
3221typedef struct sSirTdlsDelStaReq {
3222 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
3223 uint16_t length;
3224 uint8_t sessionId; /* Session ID */
3225 uint16_t transactionId; /* Transaction ID for cmd */
3226 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303227 struct qdf_mac_addr bssid;
3228 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003229} tSirTdlsDelStaReq, *tpSirSmeTdlsDelStaReq;
3230/* TDLS Response struct PE-->SME */
3231typedef struct sSirTdlsDelStaRsp {
3232 uint16_t messageType;
3233 uint16_t length;
3234 uint8_t sessionId; /* Session ID */
3235 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303236 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003237 uint16_t staId;
Frank Liud4b2fa02017-03-29 11:46:48 +08003238 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003239} tSirTdlsDelStaRsp, *tpSirTdlsDelStaRsp;
3240/* TDLS Delete Indication struct PE-->SME */
3241typedef struct sSirTdlsDelStaInd {
3242 uint16_t messageType;
3243 uint16_t length;
3244 uint8_t sessionId; /* Session ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303245 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003246 uint16_t staId;
3247 uint16_t reasonCode;
3248} tSirTdlsDelStaInd, *tpSirTdlsDelStaInd;
3249typedef struct sSirTdlsDelAllPeerInd {
3250 uint16_t messageType;
3251 uint16_t length;
3252 uint8_t sessionId; /* Session ID */
3253} tSirTdlsDelAllPeerInd, *tpSirTdlsDelAllPeerInd;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003254typedef struct sSirMgmtTxCompletionInd {
3255 uint16_t messageType;
3256 uint16_t length;
3257 uint8_t sessionId; /* Session ID */
3258 uint32_t txCompleteStatus;
Kabilan Kannanf56f9d52017-04-05 03:31:34 -07003259 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003260} tSirMgmtTxCompletionInd, *tpSirMgmtTxCompletionInd;
3261
3262typedef struct sSirTdlsEventnotify {
3263 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303264 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003265 uint16_t messageType;
3266 uint32_t peer_reason;
3267} tSirTdlsEventnotify;
3268#endif /* FEATURE_WLAN_TDLS */
3269
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003270/* Reset AP Caps Changed */
3271typedef struct sSirResetAPCapsChange {
3272 uint16_t messageType;
3273 uint16_t length;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303274 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003275} tSirResetAPCapsChange, *tpSirResetAPCapsChange;
3276
3277/* / Definition for Candidate found indication from FW */
3278typedef struct sSirSmeCandidateFoundInd {
3279 uint16_t messageType; /* eWNI_SME_CANDIDATE_FOUND_IND */
3280 uint16_t length;
3281 uint8_t sessionId; /* Session Identifier */
3282} tSirSmeCandidateFoundInd, *tpSirSmeCandidateFoundInd;
3283
3284#ifdef WLAN_FEATURE_11W
3285typedef struct sSirWlanExcludeUnencryptParam {
3286 bool excludeUnencrypt;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303287 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003288} tSirWlanExcludeUnencryptParam, *tpSirWlanExcludeUnencryptParam;
3289#endif
3290
3291typedef enum {
3292 P2P_SCAN_TYPE_SEARCH = 1, /* P2P Search */
3293 P2P_SCAN_TYPE_LISTEN /* P2P Listen */
3294} tSirP2pScanType;
3295
3296typedef struct sAniHandoffReq {
3297 /* Common for all types are requests */
3298 uint16_t msgType; /* message type is same as the request type */
3299 uint16_t msgLen; /* length of the entire request */
3300 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303301 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003302 uint8_t channel;
3303 uint8_t handoff_src;
3304} tAniHandoffReq, *tpAniHandoffReq;
3305
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08003306/**
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07003307 * sir_scan_event_type - scan event types used in LIM
3308 * @SIR_SCAN_EVENT_STARTED - scan command accepted by FW
3309 * @SIR_SCAN_EVENT_COMPLETED - scan has been completed by FW
3310 * @SIR_SCAN_EVENT_BSS_CHANNEL - FW is going to move to HOME channel
3311 * @SIR_SCAN_EVENT_FOREIGN_CHANNEL - FW is going to move to FORIEGN channel
3312 * @SIR_SCAN_EVENT_DEQUEUED - scan request got dequeued
3313 * @SIR_SCAN_EVENT_PREEMPTED - preempted by other high priority scan
3314 * @SIR_SCAN_EVENT_START_FAILED - scan start failed
3315 * @SIR_SCAN_EVENT_RESTARTED - scan restarted
3316 * @SIR_SCAN_EVENT_MAX - max value for event type
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08003317*/
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07003318enum sir_scan_event_type {
3319 SIR_SCAN_EVENT_STARTED = 0x1,
3320 SIR_SCAN_EVENT_COMPLETED = 0x2,
3321 SIR_SCAN_EVENT_BSS_CHANNEL = 0x4,
3322 SIR_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
3323 SIR_SCAN_EVENT_DEQUEUED = 0x10,
3324 SIR_SCAN_EVENT_PREEMPTED = 0x20,
3325 SIR_SCAN_EVENT_START_FAILED = 0x40,
3326 SIR_SCAN_EVENT_RESTARTED = 0x80,
3327 SIR_SCAN_EVENT_MAX = 0x8000
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08003328};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003329
3330typedef struct sSirScanOffloadEvent {
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07003331 enum sir_scan_event_type event;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003332 tSirResultCodes reasonCode;
3333 uint32_t chanFreq;
3334 uint32_t requestor;
3335 uint32_t scanId;
3336 tSirP2pScanType p2pScanType;
3337 uint8_t sessionId;
3338} tSirScanOffloadEvent, *tpSirScanOffloadEvent;
3339
3340/**
3341 * struct sSirUpdateChanParam - channel parameters
3342 * @chanId: ID of the channel
3343 * @pwr: power level
3344 * @dfsSet: is dfs supported or not
3345 * @half_rate: is the channel operating at 10MHz
3346 * @quarter_rate: is the channel operating at 5MHz
3347 */
3348typedef struct sSirUpdateChanParam {
3349 uint8_t chanId;
3350 uint8_t pwr;
3351 bool dfsSet;
3352 bool half_rate;
3353 bool quarter_rate;
3354} tSirUpdateChanParam, *tpSirUpdateChanParam;
3355
3356typedef struct sSirUpdateChan {
3357 uint8_t numChan;
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07003358 uint8_t ht_en;
3359 uint8_t vht_en;
3360 uint8_t vht_24_en;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003361 tSirUpdateChanParam chanParam[1];
3362} tSirUpdateChanList, *tpSirUpdateChanList;
3363
3364typedef enum eSirAddonPsReq {
3365 eSIR_ADDON_NOTHING,
3366 eSIR_ADDON_ENABLE_UAPSD,
3367 eSIR_ADDON_DISABLE_UAPSD
3368} tSirAddonPsReq;
3369
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003370#ifdef FEATURE_WLAN_CH_AVOID
3371typedef struct sSirChAvoidUpdateReq {
3372 uint32_t reserved_param;
3373} tSirChAvoidUpdateReq;
3374#endif /* FEATURE_WLAN_CH_AVOID */
3375
3376typedef struct sSirLinkSpeedInfo {
3377 /* MAC Address for the peer */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303378 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003379 uint32_t estLinkSpeed; /* Linkspeed from firmware */
3380} tSirLinkSpeedInfo, *tpSirLinkSpeedInfo;
3381
Will Huanga9814592017-05-24 15:47:58 +08003382/**
3383 * struct sir_peer_info_req - peer info request struct
3384 * @peer_macaddr: MAC address
3385 * @sessionid: vdev id
3386 *
3387 * peer info request message's struct
3388 */
3389struct sir_peer_info_req {
3390 struct qdf_mac_addr peer_macaddr;
3391 uint8_t sessionid;
3392};
3393
3394/**
3395 * struct sir_peer_info - peer information struct
3396 * @peer_macaddr: MAC address
3397 * @rssi: rssi
3398 * @tx_rate: last tx rate
3399 * @rx_rate: last rx rate
3400 *
3401 * a station's information
3402 */
3403struct sir_peer_info {
3404 struct qdf_mac_addr peer_macaddr;
3405 int8_t rssi;
3406 uint32_t tx_rate;
3407 uint32_t rx_rate;
3408};
3409
3410/**
3411 * struct sir_peer_info_resp - all peers information struct
3412 * @count: peer's number
3413 * @info: peer information
3414 *
3415 * all station's information
3416 */
3417struct sir_peer_info_resp {
3418 uint8_t count;
3419 struct sir_peer_info info[0];
3420};
3421
3422/**
3423 * struct sir_peer_info_ext_req - peer info request struct
3424 * @peer_macaddr: MAC address
3425 * @sessionid: vdev id
3426 * @reset_after_request: fw reset statistics after query
3427 *
3428 * peer info request message's struct
3429 */
3430struct sir_peer_info_ext_req {
3431 struct qdf_mac_addr peer_macaddr;
3432 uint8_t sessionid;
3433 uint8_t reset_after_request;
3434};
3435
3436/**
3437 * struct sir_peer_info_ext - peer info information struct
3438 * (refer to station_info struct in Kernel)
3439 * @peer_macaddr: MAC address
3440 * @tx_packets: packets transmitted to this station
3441 * @tx_bytes: bytes transmitted to this station
3442 * @rx_packets: packets received from this station
3443 * @rx_bytes: bytes received from this station
3444 * @rx_retries: cumulative retry counts
3445 * @tx_failed: number of failed transmissions
3446 * @rssi: The signal strength
3447 * @tx_rate: last used tx bitrate (kbps)
3448 * @tx_rate_code: last tx rate code (last_tx_rate_code of wmi_peer_stats_info)
3449 * @rx_rate: last used rx bitrate (kbps)
3450 * @rx_rate_code: last rx rate code (last_rx_rate_code of wmi_peer_stats_info)
3451 *
3452 * a station's information
3453 */
3454struct sir_peer_info_ext {
3455 struct qdf_mac_addr peer_macaddr;
3456 uint32_t tx_packets;
3457 uint64_t tx_bytes;
3458 uint32_t rx_packets;
3459 uint64_t rx_bytes;
3460 uint32_t tx_retries;
3461 uint32_t tx_failed;
3462 int32_t rssi;
3463 uint32_t tx_rate;
3464 uint32_t tx_rate_code;
3465 uint32_t rx_rate;
3466 uint32_t rx_rate_code;
3467};
3468
3469/**
3470 * struct sir_peer_info_ext_resp - all peers' information struct
3471 * @count: peer's number
3472 * @info: peer information
3473 *
3474 * all station's information
3475 */
3476struct sir_peer_info_ext_resp {
3477 uint8_t count;
3478 struct sir_peer_info_ext info[0];
3479};
3480
Will Huang496b36c2017-07-11 16:38:50 +08003481/**
3482 * @sta_num: number of peer station which has valid info
3483 * @info: peer information
3484 *
3485 * all SAP peer station's information retrieved
3486 */
3487struct sir_peer_sta_info {
3488 uint8_t sta_num;
3489 struct sir_peer_info info[MAX_PEER_STA];
3490};
3491
3492/**
3493 * @sta_num: number of peer station which has valid info
3494 * @info: peer extended information
3495 *
3496 * all SAP peer station's extended information retrieved
3497 */
3498struct sir_peer_sta_ext_info {
3499 uint8_t sta_num;
3500 struct sir_peer_info_ext info[MAX_PEER_STA];
3501};
3502
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003503typedef struct sSirAddPeriodicTxPtrn {
3504 /* MAC Address for the adapter */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303505 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003506 uint8_t ucPtrnId; /* Pattern ID */
3507 uint16_t ucPtrnSize; /* Pattern size */
3508 uint32_t usPtrnIntervalMs; /* In msec */
3509 uint8_t ucPattern[PERIODIC_TX_PTRN_MAX_SIZE]; /* Pattern buffer */
3510} tSirAddPeriodicTxPtrn, *tpSirAddPeriodicTxPtrn;
3511
3512typedef struct sSirDelPeriodicTxPtrn {
3513 /* MAC Address for the adapter */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303514 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003515 /* Bitmap of pattern IDs that need to be deleted */
3516 uint32_t ucPatternIdBitmap;
3517 uint8_t ucPtrnId; /* Pattern ID */
3518} tSirDelPeriodicTxPtrn, *tpSirDelPeriodicTxPtrn;
3519
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08003520/*---------------------------------------------------------------------------
3521* tSirIbssGetPeerInfoReqParams
3522*--------------------------------------------------------------------------*/
3523typedef struct {
3524 bool allPeerInfoReqd; /* If set, all IBSS peers stats are reported */
3525 uint8_t staIdx; /* If allPeerInfoReqd is not set, only stats */
3526 /* of peer with staIdx is reported */
3527} tSirIbssGetPeerInfoReqParams, *tpSirIbssGetPeerInfoReqParams;
3528
Rajeev Kumar94c9b452016-03-24 12:58:47 -07003529/**
3530 * typedef struct - tSirIbssGetPeerInfoParams
3531 * @mac_addr: mac address received from target
3532 * @txRate: TX rate
3533 * @mcsIndex: MCS index
3534 * @txRateFlags: TX rate flags
3535 * @rssi: RSSI
3536 */
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08003537typedef struct {
Rajeev Kumar94c9b452016-03-24 12:58:47 -07003538 uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
3539 uint32_t txRate;
3540 uint32_t mcsIndex;
3541 uint32_t txRateFlags;
3542 int8_t rssi;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08003543} tSirIbssPeerInfoParams;
3544
3545typedef struct {
3546 uint32_t status;
3547 uint8_t numPeers;
3548 tSirIbssPeerInfoParams peerInfoParams[32];
3549} tSirPeerInfoRspParams, *tpSirIbssPeerInfoRspParams;
3550
3551/*---------------------------------------------------------------------------
3552* tSirIbssGetPeerInfoRspParams
3553*--------------------------------------------------------------------------*/
3554typedef struct {
3555 uint16_t mesgType;
3556 uint16_t mesgLen;
3557 tSirPeerInfoRspParams ibssPeerInfoRspParams;
3558} tSirIbssGetPeerInfoRspParams, *tpSirIbssGetPeerInfoRspParams;
3559
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003560typedef struct {
3561 uint16_t mesgType;
3562 uint16_t mesgLen;
3563 bool suspended;
3564} tSirReadyToSuspendInd, *tpSirReadyToSuspendInd;
3565#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
3566typedef struct {
3567 uint16_t mesgType;
3568 uint16_t mesgLen;
3569 bool status;
3570} tSirReadyToExtWoWInd, *tpSirReadyToExtWoWInd;
3571#endif
3572typedef struct sSirRateUpdateInd {
3573 uint8_t nss; /* 0: 1x1, 1: 2x2 */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303574 struct qdf_mac_addr bssid;
Jeff Johnsonc1e62782017-11-09 09:50:17 -08003575 enum QDF_OPMODE dev_mode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003576 int32_t bcastDataRate; /* bcast rate unit Mbpsx10, -1:not used */
3577 /*
3578 * 0 implies RA, positive value implies fixed rate, -1 implies ignore
3579 * this param.
3580 */
3581 int32_t ucastDataRate;
3582
3583 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07003584 enum tx_rate_info ucastDataRateTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003585
3586 /*
3587 * 0 implies MCAST RA, positive value implies fixed rate,
3588 * -1 implies ignore this param
3589 */
3590 int32_t reliableMcastDataRate; /* unit Mbpsx10 */
3591
3592 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07003593 enum tx_rate_info reliableMcastDataRateTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003594
3595 /*
3596 * MCAST(or BCAST) fixed data rate in 2.4 GHz, unit Mbpsx10,
3597 * 0 implies ignore
3598 */
3599 uint32_t mcastDataRate24GHz;
3600
3601 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07003602 enum tx_rate_info mcastDataRate24GHzTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003603
3604 /*
3605 * MCAST(or BCAST) fixed data rate in 5 GHz,
3606 * unit Mbpsx10, 0 implies ignore
3607 */
3608 uint32_t mcastDataRate5GHz;
3609
3610 /* TX flag to differentiate between HT20, HT40 etc */
Naveen Rawatea1564b2018-05-17 15:56:11 -07003611 enum tx_rate_info mcastDataRate5GHzTxFlag;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003612
3613} tSirRateUpdateInd, *tpSirRateUpdateInd;
3614
3615#if defined(FEATURE_WLAN_CH_AVOID) || defined(FEATURE_WLAN_FORCE_SAP_SCC)
3616#define SIR_CH_AVOID_MAX_RANGE 4
3617
3618typedef struct sSirChAvoidFreqType {
3619 uint32_t start_freq;
3620 uint32_t end_freq;
3621} tSirChAvoidFreqType;
3622
3623typedef struct sSirChAvoidIndType {
3624 uint32_t avoid_range_count;
3625 tSirChAvoidFreqType avoid_freq_range[SIR_CH_AVOID_MAX_RANGE];
3626} tSirChAvoidIndType;
3627#endif /* FEATURE_WLAN_CH_AVOID || FEATURE_WLAN_FORCE_SAP_SCC */
3628
3629#define SIR_DFS_MAX_20M_SUB_CH 8
Sandeep Puligilla949eaa72015-12-17 18:43:52 -08003630#define SIR_80MHZ_START_CENTER_CH_DIFF 6
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003631
3632typedef struct sSirSmeDfsChannelList {
3633 uint32_t nchannels;
3634 /* Ch num including bonded channels on which the RADAR is present */
3635 uint8_t channels[SIR_DFS_MAX_20M_SUB_CH];
3636} tSirSmeDfsChannelList, *tpSirSmeDfsChannelList;
3637
3638typedef struct sSirSmeDfsEventInd {
3639 uint32_t sessionId;
3640 tSirSmeDfsChannelList chan_list;
3641 uint32_t dfs_radar_status;
3642 int use_nol;
3643} tSirSmeDfsEventInd, *tpSirSmeDfsEventInd;
3644
3645typedef struct sSirChanChangeRequest {
3646 uint16_t messageType;
3647 uint16_t messageLen;
3648 uint8_t targetChannel;
Kiran Kumar Lokere999e58c2016-01-07 02:18:39 -08003649 uint8_t sec_ch_offset;
Kiran Kumar Lokere13644672016-02-29 15:40:10 -08003650 enum phy_ch_width ch_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003651 uint8_t center_freq_seg_0;
3652 uint8_t center_freq_seg_1;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303653 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003654 uint32_t dot11mode;
Bala Venkateshb39ed152017-12-26 19:35:27 +05303655 tSirNwType nw_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003656 tSirMacRateSet operational_rateset;
3657 tSirMacRateSet extended_rateset;
Arif Hussain671a1902017-03-17 09:08:32 -07003658 uint32_t cac_duration_ms;
3659 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003660} tSirChanChangeRequest, *tpSirChanChangeRequest;
3661
3662typedef struct sSirChanChangeResponse {
3663 uint8_t sessionId;
3664 uint8_t newChannelNumber;
3665 uint8_t channelChangeStatus;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003666} tSirChanChangeResponse, *tpSirChanChangeResponse;
3667
3668typedef struct sSirStartBeaconIndication {
3669 uint16_t messageType;
3670 uint16_t messageLen;
3671 uint8_t beaconStartStatus;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303672 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003673} tSirStartBeaconIndication, *tpSirStartBeaconIndication;
3674
3675/* additional IE type */
3676typedef enum tUpdateIEsType {
3677 eUPDATE_IE_NONE,
3678 eUPDATE_IE_PROBE_BCN,
3679 eUPDATE_IE_PROBE_RESP,
3680 eUPDATE_IE_ASSOC_RESP,
3681
3682 /* Add type above this line */
3683 /* this is used to reset all buffer */
3684 eUPDATE_IE_ALL,
3685 eUPDATE_IE_MAX
3686} eUpdateIEsType;
3687
3688/* Modify particular IE in addition IE for prob resp Bcn */
3689typedef struct sSirModifyIE {
Anurag Chouhan6d760662016-02-20 16:05:43 +05303690 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003691 uint16_t smeSessionId;
3692 bool notify;
3693 uint8_t ieID;
3694 uint8_t ieIDLen; /*ie length as per spec */
3695 uint16_t ieBufferlength;
3696 uint8_t *pIEBuffer;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08003697 int32_t oui_length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003698
3699} tSirModifyIE, *tpSirModifyIE;
3700
Kiran Kumar Lokerebc87bec2018-02-27 20:06:42 -08003701struct send_add_ba_req {
3702 uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
3703 struct addba_send_params param;
3704};
3705
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003706/* Message format for Update IE message sent to PE */
3707typedef struct sSirModifyIEsInd {
3708 uint16_t msgType;
3709 uint16_t msgLen;
3710 tSirModifyIE modifyIE;
3711 eUpdateIEsType updateType;
3712} tSirModifyIEsInd, *tpSirModifyIEsInd;
3713
3714/* Message format for Update IE message sent to PE */
3715typedef struct sSirUpdateIE {
Anurag Chouhan6d760662016-02-20 16:05:43 +05303716 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003717 uint16_t smeSessionId;
3718 bool append;
3719 bool notify;
3720 uint16_t ieBufferlength;
3721 uint8_t *pAdditionIEBuffer;
3722} tSirUpdateIE, *tpSirUpdateIE;
3723
3724/* Message format for Update IE message sent to PE */
3725typedef struct sSirUpdateIEsInd {
3726 uint16_t msgType;
3727 uint16_t msgLen;
3728 tSirUpdateIE updateIE;
3729 eUpdateIEsType updateType;
3730} tSirUpdateIEsInd, *tpSirUpdateIEsInd;
3731
3732/* Message format for requesting channel switch announcement to lower layers */
3733typedef struct sSirDfsCsaIeRequest {
3734 uint16_t msgType;
3735 uint16_t msgLen;
3736 uint8_t targetChannel;
3737 uint8_t csaIeRequired;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303738 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Amar Singhal5cccafe2017-02-15 12:42:58 -08003739 struct ch_params ch_params;
gaoleze2920bd2017-03-21 17:38:42 +08003740 uint8_t ch_switch_beacon_cnt;
gaolez76d2a162017-03-21 19:23:58 +08003741 uint8_t ch_switch_mode;
3742 uint8_t dfs_ch_switch_disable;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003743} tSirDfsCsaIeRequest, *tpSirDfsCsaIeRequest;
3744
3745/* Indication from lower layer indicating the completion of first beacon send
3746 * after the beacon template update
3747 */
3748typedef struct sSirFirstBeaconTxCompleteInd {
3749 uint16_t messageType; /* eWNI_SME_MISSED_BEACON_IND */
3750 uint16_t length;
3751 uint8_t bssIdx;
3752} tSirFirstBeaconTxCompleteInd, *tpSirFirstBeaconTxCompleteInd;
3753
3754typedef struct sSirSmeCSAIeTxCompleteRsp {
3755 uint8_t sessionId;
3756 uint8_t chanSwIeTxStatus;
3757} tSirSmeCSAIeTxCompleteRsp, *tpSirSmeCSAIeTxCompleteRsp;
3758
3759/* Thermal Mitigation*/
3760
3761typedef struct {
3762 uint16_t minTempThreshold;
3763 uint16_t maxTempThreshold;
3764} t_thermal_level_info, *tp_thermal_level_info;
3765
3766typedef enum {
3767 WLAN_WMA_THERMAL_LEVEL_0,
3768 WLAN_WMA_THERMAL_LEVEL_1,
3769 WLAN_WMA_THERMAL_LEVEL_2,
3770 WLAN_WMA_THERMAL_LEVEL_3,
3771 WLAN_WMA_MAX_THERMAL_LEVELS
3772} t_thermal_level;
3773
Poddar, Siddarth83905022016-04-16 17:56:08 -07003774#define WLAN_THROTTLE_DUTY_CYCLE_LEVEL_MAX (4)
3775
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003776typedef struct {
3777 /* Array of thermal levels */
3778 t_thermal_level_info thermalLevels[WLAN_WMA_MAX_THERMAL_LEVELS];
3779 uint8_t thermalCurrLevel;
3780 uint8_t thermalMgmtEnabled;
3781 uint32_t throttlePeriod;
Poddar, Siddarth83905022016-04-16 17:56:08 -07003782 uint8_t throttle_duty_cycle_tbl[WLAN_THROTTLE_DUTY_CYCLE_LEVEL_MAX];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003783} t_thermal_mgmt, *tp_thermal_mgmt;
3784
3785typedef struct sSirTxPowerLimit {
3786 /* Thermal limits for 2g and 5g */
3787 uint32_t txPower2g;
3788 uint32_t txPower5g;
3789} tSirTxPowerLimit;
3790
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +05303791enum bad_peer_thresh_levels {
3792 WLAN_WMA_IEEE80211_B_LEVEL = 0,
3793 WLAN_WMA_IEEE80211_AG_LEVEL,
3794 WLAN_WMA_IEEE80211_N_LEVEL,
3795 WLAN_WMA_IEEE80211_AC_LEVEL,
3796 WLAN_WMA_IEEE80211_AX_LEVEL,
3797 WLAN_WMA_IEEE80211_MAX_LEVEL,
3798};
3799
3800#define NUM_OF_RATE_THRESH_MAX (4)
3801struct t_bad_peer_info {
3802 uint32_t cond;
3803 uint32_t delta;
3804 uint32_t percentage;
3805 uint32_t thresh[NUM_OF_RATE_THRESH_MAX];
3806 uint32_t txlimit;
3807};
3808
3809struct t_bad_peer_txtcl_config {
3810 /* Array of thermal levels */
3811 struct t_bad_peer_info threshold[WLAN_WMA_IEEE80211_MAX_LEVEL];
3812 uint32_t enable;
3813 uint32_t period;
3814 uint32_t txq_limit;
3815 uint32_t tgt_backoff;
3816 uint32_t tgt_report_prd;
3817};
3818
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003819/* notify MODEM power state to FW */
3820typedef struct {
3821 uint32_t param;
3822} tSirModemPowerStateInd, *tpSirModemPowerStateInd;
3823
3824#ifdef WLAN_FEATURE_STATS_EXT
3825typedef struct {
3826 uint32_t vdev_id;
3827 uint32_t event_data_len;
3828 uint8_t event_data[];
3829} tSirStatsExtEvent, *tpSirStatsExtEvent;
3830#endif
3831
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003832typedef struct {
3833 uint32_t event_data_len;
3834 uint8_t event_data[];
3835} tSirNanEvent, *tpSirNanEvent;
Mahesh Kumar Kalikot Veetil919e01d2016-09-09 17:09:10 -07003836
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003837typedef struct sSirSmeRoamOffloadSynchInd {
3838 uint16_t messageType; /*eWNI_SME_ROAM_OFFLOAD_SYNCH_IND */
3839 uint16_t length;
3840 uint16_t beaconProbeRespOffset;
3841 uint16_t beaconProbeRespLength;
3842 uint16_t reassocRespOffset;
3843 uint16_t reassocRespLength;
Naveen Rawat14298b92015-11-25 16:27:41 -08003844 uint16_t reassoc_req_offset;
3845 uint16_t reassoc_req_length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003846 uint8_t isBeacon;
3847 uint8_t roamedVdevId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303848 struct qdf_mac_addr bssid;
Varun Reddy Yeturu28925b42016-02-08 07:18:50 -08003849 struct qdf_mac_addr self_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003850 int8_t txMgmtPower;
3851 uint32_t authStatus;
3852 uint8_t rssi;
3853 uint8_t roamReason;
3854 uint32_t chan_freq;
3855 uint8_t kck[SIR_KCK_KEY_LEN];
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05303856 uint32_t kek_len;
3857 uint8_t kek[SIR_KEK_KEY_LEN_FILS];
3858 uint32_t pmk_len;
3859 uint8_t pmk[SIR_PMK_LEN];
3860 uint8_t pmkid[SIR_PMKID_LEN];
3861 bool update_erp_next_seq_num;
3862 uint16_t next_erp_seq_num;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003863 uint8_t replay_ctr[SIR_REPLAY_CTR_LEN];
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08003864 void *add_bss_params;
3865 tpSirSmeJoinRsp join_rsp;
3866 uint16_t aid;
Naveen Rawat8cc23b02016-07-14 12:22:56 -07003867 struct sir_hw_mode_trans_ind hw_mode_trans_ind;
Naveen Rawat746a90b2017-06-07 15:16:35 -07003868 uint8_t nss;
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05303869 struct qdf_mac_addr dst_mac;
3870 struct qdf_mac_addr src_mac;
3871 uint16_t hlp_data_len;
3872 uint8_t hlp_data[FILS_MAX_HLP_DATA_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003873} roam_offload_synch_ind;
3874
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -08003875#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003876typedef struct sSirSmeRoamOffloadSynchCnf {
3877 uint8_t sessionId;
3878} tSirSmeRoamOffloadSynchCnf, *tpSirSmeRoamOffloadSynchCnf;
3879
3880typedef struct sSirSmeHOFailureInd {
3881 uint8_t sessionId;
3882} tSirSmeHOFailureInd, *tpSirSmeHOFailureInd;
3883
3884struct roam_offload_synch_fail {
3885 uint8_t session_id;
3886};
3887
3888#endif
3889
Wen Gong7952fbd2018-04-18 11:27:23 +08003890/**
3891 * struct sir_wisa_params - WISA Mode Parameters
3892 * @mode: WISA mode
3893 * @session_id: Session ID of vdev
3894 */
3895struct sir_wisa_params {
3896 bool mode;
3897 uint8_t vdev_id;
3898};
3899
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003900#ifdef FEATURE_WLAN_EXTSCAN
3901
Wen Gong7952fbd2018-04-18 11:27:23 +08003902#define WLAN_EXTSCAN_MAX_CHANNELS 36
3903#define WLAN_EXTSCAN_MAX_BUCKETS 16
3904#define WLAN_EXTSCAN_MAX_HOTLIST_APS 128
3905#define WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS 64
3906
3907typedef enum {
3908 eSIR_EXTSCAN_INVALID,
3909 eSIR_EXTSCAN_START_RSP,
3910 eSIR_EXTSCAN_STOP_RSP,
3911 eSIR_EXTSCAN_CACHED_RESULTS_RSP,
3912 eSIR_EXTSCAN_SET_BSSID_HOTLIST_RSP,
3913 eSIR_EXTSCAN_RESET_BSSID_HOTLIST_RSP,
3914 eSIR_EXTSCAN_SET_SIGNIFICANT_WIFI_CHANGE_RSP,
3915 eSIR_EXTSCAN_RESET_SIGNIFICANT_WIFI_CHANGE_RSP,
3916
3917 eSIR_EXTSCAN_GET_CAPABILITIES_IND,
3918 eSIR_EXTSCAN_HOTLIST_MATCH_IND,
3919 eSIR_EXTSCAN_SIGNIFICANT_WIFI_CHANGE_RESULTS_IND,
3920 eSIR_EXTSCAN_CACHED_RESULTS_IND,
3921 eSIR_EXTSCAN_SCAN_RES_AVAILABLE_IND,
3922 eSIR_EXTSCAN_SCAN_PROGRESS_EVENT_IND,
3923 eSIR_EXTSCAN_FULL_SCAN_RESULT_IND,
3924 eSIR_EPNO_NETWORK_FOUND_IND,
3925 eSIR_PASSPOINT_NETWORK_FOUND_IND,
3926 eSIR_EXTSCAN_SET_SSID_HOTLIST_RSP,
3927 eSIR_EXTSCAN_RESET_SSID_HOTLIST_RSP,
3928
3929 /* Keep this last */
3930 eSIR_EXTSCAN_CALLBACK_TYPE_MAX,
3931} tSirExtScanCallbackType;
3932
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003933/**
3934 * typedef enum wifi_scan_flags - wifi scan flags
3935 * @WIFI_SCAN_FLAG_INTERRUPTED: Indicates that scan results are not complete
3936 * because probes were not sent on some channels
3937 */
3938typedef enum {
3939 WIFI_SCAN_FLAG_INTERRUPTED = 1,
3940} wifi_scan_flags;
3941
3942typedef enum {
3943 WIFI_BAND_UNSPECIFIED,
3944 WIFI_BAND_BG = 1, /* 2.4 GHz */
3945 WIFI_BAND_A = 2, /* 5 GHz without DFS */
3946 WIFI_BAND_ABG = 3, /* 2.4 GHz + 5 GHz; no DFS */
3947 WIFI_BAND_A_DFS_ONLY = 4, /* 5 GHz DFS only */
3948 /* 5 is reserved */
3949 WIFI_BAND_A_WITH_DFS = 6, /* 5 GHz with DFS */
3950 WIFI_BAND_ABG_WITH_DFS = 7, /* 2.4 GHz + 5 GHz with DFS */
3951
3952 /* Keep it last */
3953 WIFI_BAND_MAX
3954} tWifiBand;
3955
Mukul Sharma45114d92016-08-12 19:34:14 +05303956/**
3957 * enum wifi_extscan_event_type - extscan event type
3958 * @WIFI_EXTSCAN_RESULTS_AVAILABLE: reported when REPORT_EVENTS_EACH_SCAN is set
3959 * and a scan cycle completes. WIFI_SCAN_THRESHOLD_NUM_SCANS or
3960 * WIFI_SCAN_THRESHOLD_PERCENT can be reported instead if the
3961 * reason for the event is available; however, at most one of
3962 * these events should be reported per scan.
3963 * @WIFI_EXTSCAN_THRESHOLD_NUM_SCANS: can be reported when
3964 * REPORT_EVENTS_EACH_SCAN is not set and
3965 * report_threshold_num_scans is reached.
3966 * @WIFI_EXTSCAN_THRESHOLD_PERCENT: can be reported when REPORT_EVENTS_EACH_SCAN
3967 * is not set and report_threshold_percent is reached.
3968 * @WIFI_SCAN_DISABLED: reported when currently executing gscans are disabled
3969 * start_gscan will need to be called again in order to continue
3970 * scanning.
3971 * @WIFI_EXTSCAN_BUCKET_STARTED_EVENT: Bucket started event
3972 * This event is consumed in driver only.
3973 * @WIFI_EXTSCAN_CYCLE_STARTED_EVENT: Cycle started event.
3974 * This event is consumed in driver only.
3975 * @WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT: Cycle complete event. This event
3976 * triggers @WIFI_EXTSCAN_RESULTS_AVAILABLE to the user space.
3977 */
3978enum wifi_extscan_event_type {
Mukul Sharmafa937be2016-08-12 18:13:36 +05303979 WIFI_EXTSCAN_RESULTS_AVAILABLE,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303980 WIFI_EXTSCAN_THRESHOLD_NUM_SCANS,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303981 WIFI_EXTSCAN_THRESHOLD_PERCENT,
Mukul Sharmafa937be2016-08-12 18:13:36 +05303982 WIFI_SCAN_DISABLED,
3983
Mukul Sharmafa937be2016-08-12 18:13:36 +05303984 WIFI_EXTSCAN_BUCKET_STARTED_EVENT = 0x10,
3985 WIFI_EXTSCAN_CYCLE_STARTED_EVENT,
3986 WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT,
Mukul Sharma45114d92016-08-12 19:34:14 +05303987};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003988
3989/**
3990 * enum extscan_configuration_flags - extscan config flags
3991 * @EXTSCAN_LP_EXTENDED_BATCHING: extended batching
3992 */
3993enum extscan_configuration_flags {
3994 EXTSCAN_LP_EXTENDED_BATCHING = 0x00000001,
3995};
3996
3997typedef struct {
Anurag Chouhan6d760662016-02-20 16:05:43 +05303998 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003999
4000 /* Low threshold */
4001 int32_t low;
4002
4003 /* High threshold */
4004 int32_t high;
4005} tSirAPThresholdParam, *tpSirAPThresholdParam;
4006
4007typedef struct {
4008 uint32_t requestId;
4009 uint8_t sessionId;
4010} tSirGetExtScanCapabilitiesReqParams, *tpSirGetExtScanCapabilitiesReqParams;
4011
4012/**
4013 * struct ext_scan_capabilities_response - extscan capabilities response data
4014 * @requestId: request identifier
4015 * @status: status
4016 * @max_scan_cache_size: total space allocated for scan (in bytes)
4017 * @max_scan_buckets: maximum number of channel buckets
4018 * @max_ap_cache_per_scan: maximum number of APs that can be stored per scan
4019 * @max_rssi_sample_size: number of RSSI samples used for averaging RSSI
4020 * @ax_scan_reporting_threshold: max possible report_threshold
4021 * @max_hotlist_bssids: maximum number of entries for hotlist APs
4022 * @max_significant_wifi_change_aps: maximum number of entries for
4023 * significant wifi change APs
4024 * @max_bssid_history_entries: number of BSSID/RSSI entries that device can hold
4025 * @max_hotlist_ssids: maximum number of entries for hotlist SSIDs
4026 * @max_number_epno_networks: max number of epno entries
4027 * @max_number_epno_networks_by_ssid: max number of epno entries
4028 * if ssid is specified, that is, epno entries for
4029 * which an exact match is required,
4030 * or entries corresponding to hidden ssids
4031 * @max_number_of_white_listed_ssid: max number of white listed SSIDs
Padma, Santhosh Kumar1ac02402016-11-02 18:04:14 +05304032 * @max_number_of_black_listed_bssid: max number of black listed BSSIDs
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004033 */
4034struct ext_scan_capabilities_response {
4035 uint32_t requestId;
4036 uint32_t status;
4037
4038 uint32_t max_scan_cache_size;
4039 uint32_t max_scan_buckets;
4040 uint32_t max_ap_cache_per_scan;
4041 uint32_t max_rssi_sample_size;
4042 uint32_t max_scan_reporting_threshold;
4043
4044 uint32_t max_hotlist_bssids;
4045 uint32_t max_significant_wifi_change_aps;
4046
4047 uint32_t max_bssid_history_entries;
4048 uint32_t max_hotlist_ssids;
4049 uint32_t max_number_epno_networks;
4050 uint32_t max_number_epno_networks_by_ssid;
4051 uint32_t max_number_of_white_listed_ssid;
Padma, Santhosh Kumar1ac02402016-11-02 18:04:14 +05304052 uint32_t max_number_of_black_listed_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004053};
4054
4055typedef struct {
4056 uint32_t requestId;
4057 uint8_t sessionId;
4058
4059 /*
4060 * 1 - return cached results and flush it
4061 * 0 - return cached results and do not flush
4062 */
4063 bool flush;
4064} tSirExtScanGetCachedResultsReqParams, *tpSirExtScanGetCachedResultsReqParams;
4065
4066typedef struct {
4067 uint32_t requestId;
4068 uint32_t status;
4069} tSirExtScanGetCachedResultsRspParams, *tpSirExtScanGetCachedResultsRspParams;
4070
4071typedef struct {
4072 /* Time of discovery */
4073 uint64_t ts;
4074
4075 /* Null terminated SSID */
4076 uint8_t ssid[SIR_MAC_MAX_SSID_LENGTH + 1];
4077
Anurag Chouhan6d760662016-02-20 16:05:43 +05304078 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004079
4080 /* Frequency in MHz */
4081 uint32_t channel;
4082
4083 /* RSSI in dBm */
4084 int32_t rssi;
4085
4086 /* RTT in nanoseconds */
4087 uint32_t rtt;
4088
4089 /* Standard deviation in rtt */
4090 uint32_t rtt_sd;
4091
4092 /* Period advertised in the beacon */
4093 uint16_t beaconPeriod;
4094
4095 /* Capabilities advertised in the beacon */
4096 uint16_t capability;
4097
4098 uint16_t ieLength;
4099
4100 uint8_t ieData[];
4101} tSirWifiScanResult, *tpSirWifiScanResult;
4102
4103/**
4104 * struct extscan_hotlist_match - extscan hotlist match
4105 * @requestId: request identifier
4106 * @numOfAps: number of bssids retrieved by the scan
4107 * @moreData: 0 - for last fragment
4108 * 1 - still more fragment(s) coming
4109 * @ap: wifi scan result
4110 */
4111struct extscan_hotlist_match {
4112 uint32_t requestId;
4113 bool moreData;
4114 bool ap_found;
4115 uint32_t numOfAps;
4116 tSirWifiScanResult ap[];
4117};
4118
4119/**
4120 * struct extscan_cached_scan_result - extscan cached scan result
4121 * @scan_id: a unique identifier for the scan unit
4122 * @flags: a bitmask with additional information about scan
4123 * @num_results: number of bssids retrieved by the scan
Mukul Sharmaf7cb3ab2016-08-12 19:53:52 +05304124 * @buckets_scanned: bitmask of buckets scanned in current extscan cycle
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004125 * @ap: wifi scan bssid results info
4126 */
4127struct extscan_cached_scan_result {
4128 uint32_t scan_id;
4129 uint32_t flags;
4130 uint32_t num_results;
Mukul Sharmaf7cb3ab2016-08-12 19:53:52 +05304131 uint32_t buckets_scanned;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004132 tSirWifiScanResult *ap;
4133};
4134
4135/**
4136 * struct tSirWifiScanResultEvent - wifi scan result event
4137 * @requestId: request identifier
4138 * @ap_found: flag to indicate ap found or not
4139 * true: AP was found
4140 * false: AP was lost
4141 * @numOfAps: number of aps
4142 * @moreData: more data
4143 * @ap: bssid information
4144 *
4145 */
4146typedef struct {
4147 uint32_t requestId;
4148 bool ap_found;
4149 uint32_t numOfAps;
4150 bool moreData;
4151 tSirWifiScanResult ap[];
4152} tSirWifiScanResultEvent, *tpSirWifiScanResultEvent;
4153
4154/**
4155 * struct extscan_cached_scan_results - extscan cached scan results
4156 * @request_id: request identifier
4157 * @more_data: 0 - for last fragment
4158 * 1 - still more fragment(s) coming
4159 * @num_scan_ids: number of scan ids
4160 * @result: wifi scan result
4161 */
4162struct extscan_cached_scan_results {
4163 uint32_t request_id;
4164 bool more_data;
4165 uint32_t num_scan_ids;
4166 struct extscan_cached_scan_result *result;
4167};
4168
4169
4170/**
4171 * struct tSirWifiFullScanResultEvent - extscan full scan event
4172 * @request_id: request identifier
4173 * @moreData: 0 - for last fragment
4174 * 1 - still more fragment(s) coming
4175 * @ap: bssid info
4176 *
4177 * Reported when each probe response is received, if reportEvents
4178 * enabled in tSirWifiScanCmdReqParams
4179 */
4180typedef struct {
4181 uint32_t requestId;
4182 bool moreData;
4183 tSirWifiScanResult ap;
4184} tSirWifiFullScanResultEvent, *tpSirWifiFullScanResultEvent;
4185
4186/**
4187 * struct pno_match_found - epno match found
4188 * @request_id: request identifier
4189 * @moreData: 0 - for last fragment
4190 * 1 - still more fragment(s) coming
4191 * @num_results: number of bssids, driver sends this event to upper layer
4192 * for every beacon, hence %num_results is always set to 1.
4193 * @ap: bssid info
4194 *
4195 * Reported when each beacon probe response is received with
4196 * epno match found tag.
4197 */
4198struct pno_match_found {
4199 uint32_t request_id;
4200 bool more_data;
4201 uint32_t num_results;
4202 tSirWifiScanResult ap[];
4203};
4204
4205typedef struct {
4206 /* Frequency in MHz */
4207 uint32_t channel;
4208
4209 uint32_t dwellTimeMs;
4210
4211 /* 0 => active
4212 1 => passive scan; ignored for DFS */
4213 bool passive;
4214
4215 uint8_t chnlClass;
4216} tSirWifiScanChannelSpec, *tpSirWifiScanChannelSpec;
4217
4218/**
4219 * struct tSirWifiScanBucketSpec - wifi scan bucket spec
4220 * @bucket: bucket identifier
4221 * @band: wifi band
4222 * @period: Desired period, in millisecond; if this is too
4223 * low, the firmware should choose to generate results as fast as
4224 * it can instead of failing the command byte
4225 * for exponential backoff bucket this is the min_period
4226 * @reportEvents: 0 => normal reporting (reporting rssi history
4227 * only, when rssi history buffer is % full)
4228 * 1 => same as 0 + report a scan completion event after scanning
4229 * this bucket
4230 * 2 => same as 1 + forward scan results
4231 * (beacons/probe responses + IEs) in real time to HAL
4232 * @max_period: if max_period is non zero or different than period,
4233 * then this bucket is an exponential backoff bucket and
4234 * the scan period will grow exponentially as per formula:
4235 * actual_period(N) = period ^ (N/(step_count+1)) to a
4236 * maximum period of max_period
4237 * @exponent: for exponential back off bucket: multiplier:
4238 * new_period = old_period * exponent
4239 * @step_count: for exponential back off bucket, number of scans performed
4240 * at a given period and until the exponent is applied
4241 * @numChannels: channels to scan; these may include DFS channels
4242 * Note that a given channel may appear in multiple buckets
4243 * @min_dwell_time_active: per bucket minimum active dwell time
4244 * @max_dwell_time_active: per bucket maximum active dwell time
4245 * @min_dwell_time_passive: per bucket minimum passive dwell time
4246 * @max_dwell_time_passive: per bucket maximum passive dwell time
4247 * @channels: Channel list
4248 */
4249typedef struct {
4250 uint8_t bucket;
4251 tWifiBand band;
4252 uint32_t period;
4253 uint32_t reportEvents;
4254 uint32_t max_period;
4255 uint32_t exponent;
4256 uint32_t step_count;
4257 uint32_t numChannels;
4258
4259 uint32_t min_dwell_time_active;
4260 uint32_t max_dwell_time_active;
4261 uint32_t min_dwell_time_passive;
4262 uint32_t max_dwell_time_passive;
4263 tSirWifiScanChannelSpec channels[WLAN_EXTSCAN_MAX_CHANNELS];
4264} tSirWifiScanBucketSpec, *tpSirWifiScanBucketSpec;
4265
4266/**
4267 * struct tSirWifiScanCmdReqParams - wifi scan command request params
4268 * @basePeriod: base timer period
4269 * @maxAPperScan: max ap per scan
4270 * @report_threshold_percent: report threshold
4271 * in %, when buffer is this much full, wake up host
4272 * @report_threshold_num_scans: report threshold number of scans
4273 * in number of scans, wake up host after these many scans
4274 * @requestId: request id
4275 * @sessionId: session id
4276 * @numBuckets: number of buckets
4277 * @min_dwell_time_active: per bucket minimum active dwell time
4278 * @max_dwell_time_active: per bucket maximum active dwell time
4279 * @min_dwell_time_passive: per bucket minimum passive dwell time
4280 * @max_dwell_time_passive: per bucket maximum passive dwell time
4281 * @configuration_flags: configuration flags
4282 * @buckets: buckets array
4283 */
4284typedef struct {
4285 uint32_t basePeriod;
4286 uint32_t maxAPperScan;
4287
4288 uint32_t report_threshold_percent;
4289 uint32_t report_threshold_num_scans;
4290
4291 uint32_t requestId;
4292 uint8_t sessionId;
4293 uint32_t numBuckets;
4294
4295 uint32_t min_dwell_time_active;
4296 uint32_t max_dwell_time_active;
4297 uint32_t min_dwell_time_passive;
4298 uint32_t max_dwell_time_passive;
4299 uint32_t configuration_flags;
Sandeep Puligillaf5ccbf62018-03-26 16:37:05 -07004300 enum scan_dwelltime_adaptive_mode extscan_adaptive_dwell_mode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004301 tSirWifiScanBucketSpec buckets[WLAN_EXTSCAN_MAX_BUCKETS];
4302} tSirWifiScanCmdReqParams, *tpSirWifiScanCmdReqParams;
4303
4304/**
4305 * struct sir_extscan_generic_response -
4306 * Generic ExtScan Response structure
4307 * @request_id: ID of the request
4308 * @status: operation status returned by firmware
4309 */
4310struct sir_extscan_generic_response {
4311 uint32_t request_id;
4312 uint32_t status;
4313};
4314
4315typedef struct {
4316 uint32_t requestId;
4317 uint8_t sessionId;
4318} tSirExtScanStopReqParams, *tpSirExtScanStopReqParams;
4319
4320/**
4321 * struct tSirExtScanSetBssidHotListReqParams - set hotlist request
4322 * @requestId: request identifier
4323 * @sessionId: session identifier
4324 * @lost_ap_sample_size: number of samples to confirm AP loss
4325 * @numAp: Number of hotlist APs
4326 * @ap: hotlist APs
4327 */
4328typedef struct {
4329 uint32_t requestId;
4330 uint8_t sessionId;
4331
4332 uint32_t lost_ap_sample_size;
4333 uint32_t numAp;
4334 tSirAPThresholdParam ap[WLAN_EXTSCAN_MAX_HOTLIST_APS];
4335} tSirExtScanSetBssidHotListReqParams, *tpSirExtScanSetBssidHotListReqParams;
4336
4337typedef struct {
4338 uint32_t requestId;
4339 uint8_t sessionId;
4340} tSirExtScanResetBssidHotlistReqParams,
4341*tpSirExtScanResetBssidHotlistReqParams;
4342
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004343typedef struct {
4344 uint32_t requestId;
4345 uint8_t sessionId;
4346
4347 /* Number of samples for averaging RSSI */
4348 uint32_t rssiSampleSize;
4349
4350 /* Number of missed samples to confirm AP loss */
4351 uint32_t lostApSampleSize;
4352
4353 /* Number of APs breaching threshold required for firmware
4354 * to generate event
4355 */
4356 uint32_t minBreaching;
4357
4358 uint32_t numAp;
4359 tSirAPThresholdParam ap[WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS];
4360} tSirExtScanSetSigChangeReqParams, *tpSirExtScanSetSigChangeReqParams;
4361
4362typedef struct {
Anurag Chouhan6d760662016-02-20 16:05:43 +05304363 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004364 uint32_t channel;
4365 uint32_t numOfRssi;
4366
4367 /* Rssi history in db */
4368 int32_t rssi[];
4369} tSirWifiSignificantChange, *tpSirWifiSignificantChange;
4370
4371typedef struct {
4372 uint32_t requestId;
4373
4374 bool moreData;
4375 uint32_t numResults;
4376 tSirWifiSignificantChange ap[];
4377} tSirWifiSignificantChangeEvent, *tpSirWifiSignificantChangeEvent;
4378
4379typedef struct {
4380 uint32_t requestId;
4381 uint8_t sessionId;
4382} tSirExtScanResetSignificantChangeReqParams,
4383*tpSirExtScanResetSignificantChangeReqParams;
4384
4385typedef struct {
4386 uint32_t requestId;
4387 uint32_t numResultsAvailable;
4388} tSirExtScanResultsAvailableIndParams, *tpSirExtScanResultsAvailableIndParams;
4389
4390typedef struct {
4391 uint32_t requestId;
4392 uint32_t status;
4393 uint8_t scanEventType;
Mukul Sharmafa937be2016-08-12 18:13:36 +05304394 uint32_t buckets_scanned;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004395} tSirExtScanOnScanEventIndParams, *tpSirExtScanOnScanEventIndParams;
4396
Mukul Sharmae8c919f2016-10-02 20:35:15 +05304397#define MAX_EPNO_NETWORKS 64
4398
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004399/**
4400 * struct wifi_epno_network - enhanced pno network block
4401 * @ssid: ssid
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004402 * @flags: WIFI_PNO_FLAG_XXX
4403 * @auth_bit_field: auth bit field for matching WPA IE
4404 */
4405struct wifi_epno_network {
4406 tSirMacSSid ssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004407 uint8_t flags;
4408 uint8_t auth_bit_field;
4409};
4410
4411/**
4412 * struct wifi_epno_params - enhanced pno network params
Mukul Sharmae8c919f2016-10-02 20:35:15 +05304413 * @request_id: request id number
4414 * @session_id: session_id number
4415 * @min_5ghz_rssi: minimum 5GHz RSSI for a BSSID to be considered
4416 * @min_24ghz_rssi: minimum 2.4GHz RSSI for a BSSID to be considered
4417 * @initial_score_max: maximum score that a network can have before bonuses
4418 * @current_connection_bonus: only report when there is a network's score this
4419 * much higher than the current connection
4420 * @same_network_bonus: score bonus for all n/w with the same network flag
4421 * @secure_bonus: score bonus for networks that are not open
4422 * @band_5ghz_bonus: 5GHz RSSI score bonus (applied to all 5GHz networks)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004423 * @num_networks: number of ssids
Mukul Sharmae8c919f2016-10-02 20:35:15 +05304424 * @networks: EPNO networks
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004425 */
4426struct wifi_epno_params {
4427 uint32_t request_id;
4428 uint32_t session_id;
Mukul Sharmae8c919f2016-10-02 20:35:15 +05304429 uint32_t min_5ghz_rssi;
4430 uint32_t min_24ghz_rssi;
4431 uint32_t initial_score_max;
4432 uint32_t current_connection_bonus;
4433 uint32_t same_network_bonus;
4434 uint32_t secure_bonus;
4435 uint32_t band_5ghz_bonus;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004436 uint32_t num_networks;
4437 struct wifi_epno_network networks[];
4438};
4439
Jeff Johnson96f93a32016-11-18 11:02:24 -08004440#define SIR_PASSPOINT_LIST_MAX_NETWORKS 8
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004441#define SIR_PASSPOINT_REALM_LEN 256
4442#define SIR_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM 16
4443#define SIR_PASSPOINT_PLMN_LEN 3
4444/**
4445 * struct wifi_passpoint_network - passpoint network block
4446 * @id: identifier of this network block
4447 * @realm: null terminated UTF8 encoded realm, 0 if unspecified
4448 * @roaming_consortium_ids: roaming consortium ids to match, 0s if unspecified
4449 * @plmn: mcc/mnc combination as per rules, 0s if unspecified
4450 */
4451struct wifi_passpoint_network {
4452 uint32_t id;
4453 uint8_t realm[SIR_PASSPOINT_REALM_LEN];
4454 int64_t roaming_consortium_ids[SIR_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM];
4455 uint8_t plmn[SIR_PASSPOINT_PLMN_LEN];
4456};
4457
4458/**
4459 * struct wifi_passpoint_req - passpoint request
4460 * @request_id: request identifier
4461 * @num_networks: number of networks
4462 * @networks: passpoint networks
4463 */
4464struct wifi_passpoint_req {
4465 uint32_t request_id;
4466 uint32_t session_id;
4467 uint32_t num_networks;
4468 struct wifi_passpoint_network networks[];
4469};
4470
4471/**
4472 * struct wifi_passpoint_match - wifi passpoint network match
4473 * @id: network block identifier for the matched network
4474 * @anqp_len: length of ANQP blob
4475 * @ap: scan result, with channel and beacon information
4476 * @anqp: ANQP data, in the information_element format
4477 */
4478struct wifi_passpoint_match {
4479 uint32_t request_id;
4480 uint32_t id;
4481 uint32_t anqp_len;
4482 tSirWifiScanResult ap;
4483 uint8_t anqp[];
4484};
4485#endif /* FEATURE_WLAN_EXTSCAN */
4486
4487#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
4488typedef struct {
4489 uint32_t timer_val;
4490} tSirAutoShutdownCmdParams;
4491
4492typedef struct {
4493 uint32_t shutdown_reason;
4494} tSirAutoShutdownEvtParams;
4495#endif
4496
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05304497#ifdef WLAN_POWER_DEBUGFS
4498/**
4499 * struct power_stats_response - Power stats response
4500 * @cumulative_sleep_time_ms: cumulative sleep time in ms
4501 * @cumulative_total_on_time_ms: total awake time in ms
4502 * @deep_sleep_enter_counter: deep sleep enter counter
4503 * @last_deep_sleep_enter_tstamp_ms: last deep sleep enter timestamp
4504 * @debug_register_fmt: debug registers format
4505 * @num_debug_register: number of debug registers
4506 * @debug_registers: Pointer to the debug registers buffer
4507 */
4508struct power_stats_response {
4509 uint32_t cumulative_sleep_time_ms;
4510 uint32_t cumulative_total_on_time_ms;
4511 uint32_t deep_sleep_enter_counter;
4512 uint32_t last_deep_sleep_enter_tstamp_ms;
4513 uint32_t debug_register_fmt;
4514 uint32_t num_debug_register;
4515 uint32_t *debug_registers;
4516};
4517#endif
4518
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +05304519/**
4520 * struct lfr_firmware_status - LFR status in firmware
4521 * @is_disabled: Is LFR disabled in FW
4522 * @disable_lfr_event: Disable attempt done in FW
4523 */
4524struct lfr_firmware_status {
4525 uint32_t is_disabled;
4526 struct completion disable_lfr_event;
4527};
4528
4529/**
4530 * struct rso_cmd_status - RSO Command status
4531 * @vdev_id: Vdev ID for which RSO command sent
4532 * @status: Status of RSO command sent to FW
4533 */
4534struct rso_cmd_status {
4535 uint32_t vdev_id;
4536 bool status;
4537};
4538
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004539typedef struct {
4540 uint8_t oui[WIFI_SCANNING_MAC_OUI_LENGTH];
Rajeev Kumar Sirasanagandla686abd92017-06-08 18:09:01 +05304541 uint32_t vdev_id;
4542 bool enb_probe_req_sno_randomization;
Rajeev Kumar Sirasanagandlaaec0b082017-06-21 11:59:41 +05304543 struct probe_req_whitelist_attr ie_whitelist;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004544} tSirScanMacOui, *tpSirScanMacOui;
4545
4546enum {
4547 SIR_AP_RX_DATA_OFFLOAD = 0x00,
4548 SIR_STA_RX_DATA_OFFLOAD = 0x01,
4549};
4550
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07004551/**
Naveen Rawata410c5a2016-09-19 14:22:33 -07004552 * struct sir_set_vdev_ies_per_band
4553 * @msg_type: message type
4554 * @len: message length
4555 * @vdev_id: vdev id
4556 *
4557 * Message wrapper structure for eWNI_SME_SET_VDEV_IES_PER_BAND.
4558 */
4559struct sir_set_vdev_ies_per_band {
4560 uint16_t msg_type;
4561 uint16_t len;
4562 uint32_t vdev_id;
4563};
4564
4565/**
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07004566 * struct sir_set_ht_vht_cfg - ht, vht IE config
4567 * @msg_type: message type
4568 * @len: message length
4569 * @pdev_id: pdev id
4570 * @nss: Nss value
4571 * @dot11mode: Dot11 mode.
4572 *
4573 * Message wrapper structure for set HT/VHT IE req.
4574 */
4575struct sir_set_ht_vht_cfg {
4576 uint16_t msg_type;
4577 uint16_t len;
4578 uint32_t pdev_id;
4579 uint32_t nss;
4580 uint32_t dot11mode;
4581};
4582
Qiwei Cai3719efe2018-06-11 21:09:29 +08004583#define WIFI_INVALID_PEER_ID (-1)
4584#define WIFI_INVALID_VDEV_ID (-1)
4585#define WIFI_MAX_AC (4)
4586
4587typedef struct {
4588 uint32_t paramId;
4589 uint8_t ifaceId;
4590 uint32_t rspId;
4591 uint32_t moreResultToFollow;
4592 uint32_t nr_received;
4593 union {
4594 uint32_t num_peers;
4595 uint32_t num_radio;
4596 };
4597
4598 uint32_t peer_event_number;
4599 /* Variable length field - Do not add anything after this */
4600 uint8_t results[0];
4601} tSirLLStatsResults, *tpSirLLStatsResults;
4602
4603#ifdef WLAN_FEATURE_LINK_LAYER_STATS
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004604/*---------------------------------------------------------------------------
4605 WLAN_HAL_LL_NOTIFY_STATS
4606 ---------------------------------------------------------------------------*/
4607
4608/******************************LINK LAYER Statistics**********************/
4609
4610typedef int tSirWifiRadio;
4611typedef int tSirWifiChannel;
4612typedef int tSirwifiTxRate;
4613
Qiwei Cai3719efe2018-06-11 21:09:29 +08004614typedef struct {
4615 uint32_t reqId;
4616 uint8_t staId;
4617 uint32_t mpduSizeThreshold;
4618 uint32_t aggressiveStatisticsGathering;
4619} tSirLLStatsSetReq, *tpSirLLStatsSetReq;
4620
4621typedef struct {
4622 uint32_t reqId;
4623 uint8_t staId;
4624 uint32_t paramIdMask;
4625} tSirLLStatsGetReq, *tpSirLLStatsGetReq;
4626
4627typedef struct {
4628 uint32_t reqId;
4629 uint8_t staId;
4630 uint32_t statsClearReqMask;
4631 uint8_t stopReq;
4632} tSirLLStatsClearReq, *tpSirLLStatsClearReq;
4633
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004634/* channel operating width */
4635typedef enum {
4636 WIFI_CHAN_WIDTH_20 = 0,
4637 WIFI_CHAN_WIDTH_40 = 1,
4638 WIFI_CHAN_WIDTH_80 = 2,
4639 WIFI_CHAN_WIDTH_160 = 3,
4640 WIFI_CHAN_WIDTH_80P80 = 4,
4641 WIFI_CHAN_WIDTH_5 = 5,
4642 WIFI_CHAN_WIDTH_10 = 6,
4643} tSirWifiChannelWidth;
4644
4645typedef enum {
4646 WIFI_DISCONNECTED = 0,
4647 WIFI_AUTHENTICATING = 1,
4648 WIFI_ASSOCIATING = 2,
4649 WIFI_ASSOCIATED = 3,
4650 WIFI_EAPOL_STARTED = 4, /* if done by firmware/driver */
4651 WIFI_EAPOL_COMPLETED = 5, /* if done by firmware/driver */
4652} tSirWifiConnectionState;
4653
4654typedef enum {
4655 WIFI_ROAMING_IDLE = 0,
4656 WIFI_ROAMING_ACTIVE = 1,
4657} tSirWifiRoamState;
4658
4659typedef enum {
4660 WIFI_INTERFACE_STA = 0,
4661 WIFI_INTERFACE_SOFTAP = 1,
4662 WIFI_INTERFACE_IBSS = 2,
4663 WIFI_INTERFACE_P2P_CLIENT = 3,
4664 WIFI_INTERFACE_P2P_GO = 4,
4665 WIFI_INTERFACE_NAN = 5,
4666 WIFI_INTERFACE_MESH = 6,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -07004667 WIFI_INTERFACE_NDI = 7,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004668} tSirWifiInterfaceMode;
4669
4670/* set for QOS association */
4671#define WIFI_CAPABILITY_QOS 0x00000001
4672/* set for protected assoc (802.11 beacon frame control protected bit set) */
4673#define WIFI_CAPABILITY_PROTECTED 0x00000002
4674/* set if 802.11 Extended Capabilities element interworking bit is set */
4675#define WIFI_CAPABILITY_INTERWORKING 0x00000004
4676/* set for HS20 association */
4677#define WIFI_CAPABILITY_HS20 0x00000008
4678/* set is 802.11 Extended Capabilities element UTF-8 SSID bit is set */
4679#define WIFI_CAPABILITY_SSID_UTF8 0x00000010
4680/* set is 802.11 Country Element is present */
4681#define WIFI_CAPABILITY_COUNTRY 0x00000020
4682
4683typedef struct {
4684 /* tSirWifiInterfaceMode */
4685 /* interface mode */
4686 uint8_t mode;
4687 /* interface mac address (self) */
Anurag Chouhan6d760662016-02-20 16:05:43 +05304688 struct qdf_mac_addr macAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004689 /* tSirWifiConnectionState */
4690 /* connection state (valid for STA, CLI only) */
4691 uint8_t state;
4692 /* tSirWifiRoamState */
4693 /* roaming state */
4694 uint32_t roaming;
4695 /* WIFI_CAPABILITY_XXX (self) */
4696 uint32_t capabilities;
4697 /* null terminated SSID */
4698 uint8_t ssid[33];
4699 /* bssid */
Anurag Chouhan6d760662016-02-20 16:05:43 +05304700 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004701 /* country string advertised by AP */
4702 uint8_t apCountryStr[WNI_CFG_COUNTRY_CODE_LEN];
4703 /* country string for this association */
4704 uint8_t countryStr[WNI_CFG_COUNTRY_CODE_LEN];
4705} tSirWifiInterfaceInfo, *tpSirWifiInterfaceInfo;
4706
4707/* channel information */
4708typedef struct {
4709 /* channel width (20, 40, 80, 80+80, 160) */
4710 tSirWifiChannelWidth width;
4711 /* primary 20 MHz channel */
4712 tSirWifiChannel centerFreq;
4713 /* center frequency (MHz) first segment */
4714 tSirWifiChannel centerFreq0;
4715 /* center frequency (MHz) second segment */
4716 tSirWifiChannel centerFreq1;
4717} tSirWifiChannelInfo, *tpSirWifiChannelInfo;
4718
4719/* wifi rate info */
4720typedef struct {
4721 /* 0: OFDM, 1:CCK, 2:HT 3:VHT 4..7 reserved */
4722 uint32_t preamble:3;
4723 /* 0:1x1, 1:2x2, 3:3x3, 4:4x4 */
4724 uint32_t nss:2;
4725 /* 0:20MHz, 1:40Mhz, 2:80Mhz, 3:160Mhz */
4726 uint32_t bw:3;
4727 /* OFDM/CCK rate code would be as per ieee std in units of 0.5mbps */
4728 /* HT/VHT it would be mcs index */
4729 uint32_t rateMcsIdx:8;
4730 /* reserved */
4731 uint32_t reserved:16;
4732 /* units of 100 Kbps */
4733 uint32_t bitrate;
4734} tSirWifiRate, *tpSirWifiRate;
4735
4736/* channel statistics */
4737typedef struct {
4738 /* channel */
4739 tSirWifiChannelInfo channel;
4740 /* msecs the radio is awake (32 bits number accruing over time) */
4741 uint32_t onTime;
4742 /* msecs the CCA register is busy (32 bits number accruing over time) */
4743 uint32_t ccaBusyTime;
4744} tSirWifiChannelStats, *tpSirWifiChannelStats;
4745
Srinivas Girigowda458f2282016-10-25 11:27:52 -07004746#define MAX_TPC_LEVELS 64
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004747/* radio statistics */
4748typedef struct {
4749 /* wifi radio (if multiple radio supported) */
4750 tSirWifiRadio radio;
4751 /* msecs the radio is awake (32 bits number accruing over time) */
4752 uint32_t onTime;
4753 /* msecs the radio is transmitting
4754 * (32 bits number accruing over time)
4755 */
4756 uint32_t txTime;
4757 /* msecs the radio is in active receive
4758 *(32 bits number accruing over time)
4759 */
4760 uint32_t rxTime;
4761 /* msecs the radio is awake due to all scan
4762 * (32 bits number accruing over time)
4763 */
4764 uint32_t onTimeScan;
4765 /* msecs the radio is awake due to NAN
4766 * (32 bits number accruing over time)
4767 */
4768 uint32_t onTimeNbd;
4769 /* msecs the radio is awake due to Gscan
4770 * (32 bits number accruing over time)
4771 */
4772 uint32_t onTimeGscan;
4773 /* msecs the radio is awake due to roam?scan
4774 * (32 bits number accruing over time)
4775 */
4776 uint32_t onTimeRoamScan;
4777 /* msecs the radio is awake due to PNO scan
4778 * (32 bits number accruing over time)
4779 */
4780 uint32_t onTimePnoScan;
4781 /* msecs the radio is awake due to HS2.0 scans and GAS exchange
4782 * (32 bits number accruing over time)
4783 */
4784 uint32_t onTimeHs20;
Srinivas Girigowdaad874a82016-10-25 14:08:00 -07004785
4786 /* tx time (in milliseconds) per TPC level (0.5 dBm) */
4787 uint32_t total_num_tx_power_levels;
4788 uint32_t *tx_time_per_power_level;
4789
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004790 /* number of channels */
4791 uint32_t numChannels;
Srinivas Girigowda458f2282016-10-25 11:27:52 -07004792
4793 /* tx time (in milliseconds) per TPC level (0.5 dBm) */
4794 uint32_t tx_time_per_tpc[MAX_TPC_LEVELS];
4795
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08004796 uint32_t on_time_host_scan;
4797 uint32_t on_time_lpi_scan;
4798
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004799 /* channel statistics tSirWifiChannelStats */
Srinivas Girigowda57b450e2016-10-27 21:00:46 -07004800 tSirWifiChannelStats *channels;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004801} tSirWifiRadioStat, *tpSirWifiRadioStat;
4802
4803/* per rate statistics */
4804typedef struct {
4805 /* rate information */
4806 tSirWifiRate rate;
4807 /* number of successfully transmitted data pkts (ACK rcvd) */
4808 uint32_t txMpdu;
4809 /* number of received data pkts */
4810 uint32_t rxMpdu;
4811 /* number of data packet losses (no ACK) */
4812 uint32_t mpduLost;
4813 /* total number of data pkt retries * */
4814 uint32_t retries;
4815 /* number of short data pkt retries */
4816 uint32_t retriesShort;
4817 /* number of long data pkt retries */
4818 uint32_t retriesLong;
4819} tSirWifiRateStat, *tpSirWifiRateStat;
4820
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004821/* wifi peer type */
4822typedef enum {
4823 WIFI_PEER_STA,
4824 WIFI_PEER_AP,
4825 WIFI_PEER_P2P_GO,
4826 WIFI_PEER_P2P_CLIENT,
4827 WIFI_PEER_NAN,
4828 WIFI_PEER_TDLS,
4829 WIFI_PEER_INVALID,
4830} tSirWifiPeerType;
4831
4832/* per peer statistics */
4833typedef struct {
4834 /* peer type (AP, TDLS, GO etc.) */
Dustin Brown877a5a92016-11-17 13:56:52 -08004835 enum wmi_peer_type type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004836 /* mac address */
Anurag Chouhan6d760662016-02-20 16:05:43 +05304837 struct qdf_mac_addr peerMacAddress;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004838 /* peer WIFI_CAPABILITY_XXX */
4839 uint32_t capabilities;
Zhang Qiana6e9c102016-12-22 16:47:24 +08004840 union {
4841 /* peer power saving mode */
4842 uint32_t power_saving;
4843 /* number of rates */
4844 uint32_t numRate;
4845 };
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004846 /* per rate statistics, number of entries = num_rate */
4847 tSirWifiRateStat rateStats[0];
4848} tSirWifiPeerInfo, *tpSirWifiPeerInfo;
4849
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004850/* Interface statistics - corresponding to 2nd most
4851 * LSB in wifi statistics bitmap for getting statistics
4852 */
4853typedef struct {
4854 /* current state of the interface */
4855 tSirWifiInterfaceInfo info;
Min Liuffb250d2018-07-11 17:35:32 +08004856
gaolezb432ed92017-03-16 18:40:04 +08004857 uint32_t rts_succ_cnt;
4858 uint32_t rts_fail_cnt;
4859 uint32_t ppdu_succ_cnt;
4860 uint32_t ppdu_fail_cnt;
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08004861
Min Liuffb250d2018-07-11 17:35:32 +08004862 /* link statistics */
4863 wmi_iface_link_stats link_stats;
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08004864
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004865 /* per ac data packet statistics */
Min Liuffb250d2018-07-11 17:35:32 +08004866 wmi_wmm_ac_stats ac_stats[WIFI_AC_MAX];
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08004867
4868 uint32_t num_offload_stats;
Min Liuffb250d2018-07-11 17:35:32 +08004869 wmi_iface_offload_stats offload_stats[WMI_OFFLOAD_STATS_TYPE_MAX];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004870} tSirWifiIfaceStat, *tpSirWifiIfaceStat;
4871
4872/* Peer statistics - corresponding to 3rd most LSB in
4873 * wifi statistics bitmap for getting statistics
4874 */
4875typedef struct {
4876 /* number of peers */
4877 uint32_t numPeers;
4878 /* per peer statistics */
4879 tSirWifiPeerInfo peerInfo[0];
4880} tSirWifiPeerStat, *tpSirWifiPeerStat;
4881
4882/* wifi statistics bitmap for getting statistics */
4883#define WMI_LINK_STATS_RADIO 0x00000001
4884#define WMI_LINK_STATS_IFACE 0x00000002
4885#define WMI_LINK_STATS_ALL_PEER 0x00000004
4886#define WMI_LINK_STATS_PER_PEER 0x00000008
4887
4888/* wifi statistics bitmap for clearing statistics */
4889/* all radio statistics */
4890#define WIFI_STATS_RADIO 0x00000001
4891/* cca_busy_time (within radio statistics) */
4892#define WIFI_STATS_RADIO_CCA 0x00000002
4893/* all channel statistics (within radio statistics) */
4894#define WIFI_STATS_RADIO_CHANNELS 0x00000004
4895/* all scan statistics (within radio statistics) */
4896#define WIFI_STATS_RADIO_SCAN 0x00000008
4897/* all interface statistics */
4898#define WIFI_STATS_IFACE 0x00000010
4899/* all tx rate statistics (within interface statistics) */
4900#define WIFI_STATS_IFACE_TXRATE 0x00000020
4901/* all ac statistics (within interface statistics) */
4902#define WIFI_STATS_IFACE_AC 0x00000040
4903/* all contention (min, max, avg) statistics (within ac statistics) */
4904#define WIFI_STATS_IFACE_CONTENTION 0x00000080
Mukul Sharma491021c2016-09-29 21:39:19 +05304905/* All peer stats on this interface */
4906#define WIFI_STATS_IFACE_ALL_PEER 0x00000100
4907/* Clear particular peer stats depending on the peer_mac */
4908#define WIFI_STATS_IFACE_PER_PEER 0x00000200
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004909
Zhang Qiana6e9c102016-12-22 16:47:24 +08004910/**
4911 * struct sir_wifi_iface_tx_fail - TX failure event
4912 * @tid: TX TID
4913 * @msdu_num: TX MSDU failed counter
4914 * @status: TX status from HTT message.
4915 * Only failure status will be involved.
4916 */
4917struct sir_wifi_iface_tx_fail {
4918 uint8_t tid;
4919 uint16_t msdu_num;
4920 enum htt_tx_status status;
4921};
4922
Zhang Qian73c348a2017-03-13 16:15:55 +08004923/**
4924 * struct sir_wifi_chan_cca_stats - channal CCA stats
4925 * @vdev_id: vdev ID
4926 * @idle_time: percentage of idle time, no TX, no RX, no interference
4927 * @tx_time: percentage of time transmitting packets
4928 * @rx_in_bss_time: percentage of time receiving packets in current BSS
4929 * @rx_out_bss_time: percentage of time receiving packets not in current BSS
4930 * @rx_busy_time: percentage of time interference detected
4931 * @rx_in_bad_cond_time: percentage of time receiving packets with errors
4932 * or packets flagged as retransmission or seqnum discontinued.
4933 * @tx_in_bad_cond_time: percentage of time the device transmitted packets
4934 * that haven't been ACKed.
4935 * @wlan_not_avail_time: percentage of time the chip is unable to
4936 * work in normal conditions.
4937 */
4938struct sir_wifi_chan_cca_stats {
4939 uint32_t vdev_id;
4940 uint32_t idle_time;
4941 uint32_t tx_time;
4942 uint32_t rx_in_bss_time;
4943 uint32_t rx_out_bss_time;
4944 uint32_t rx_busy_time;
4945 uint32_t rx_in_bad_cond_time;
4946 uint32_t tx_in_bad_cond_time;
4947 uint32_t wlan_not_avail_time;
4948};
4949
4950#define WIFI_MAX_CHAINS 8
4951
4952/**
4953 * struct sir_wifi_peer_signal_stats - peer signal stats
4954 * @vdev_id: vdev ID
4955 * @peer_id: peer ID
4956 * @per_ant_snr: per antenna SNR
4957 * @nf: peer background noise
Zhang Qian303ebe92017-05-18 13:59:07 +08004958 * @per_ant_rx_mpdus: MPDUs received per antenna
4959 * @per_ant_tx_mpdus: MPDUs transferred per antenna
4960 * @num_chain: valid chain count
Zhang Qian73c348a2017-03-13 16:15:55 +08004961 */
4962struct sir_wifi_peer_signal_stats {
4963 uint32_t vdev_id;
4964 uint32_t peer_id;
4965
4966 /* per antenna SNR in current bss */
4967 int32_t per_ant_snr[WIFI_MAX_CHAINS];
4968
4969 /* Background noise */
4970 int32_t nf[WIFI_MAX_CHAINS];
Zhang Qian303ebe92017-05-18 13:59:07 +08004971
4972 int32_t per_ant_rx_mpdus[WIFI_MAX_CHAINS];
4973 int32_t per_ant_tx_mpdus[WIFI_MAX_CHAINS];
4974 int32_t num_chain;
Zhang Qian73c348a2017-03-13 16:15:55 +08004975};
4976
4977#define WIFI_VDEV_NUM 4
4978#define WFIF_MCS_NUM 10
4979#define WIFI_AGGR_NUM 8
4980#define WIFI_DELAY_SIZE 11
4981
4982/**
4983 * struct sir_wifi_tx - per AC tx stats
4984 * @msdus: number of totoal MSDUs on MAC layer in the period
4985 * @mpdus: number of totoal MPDUs on MAC layer in the period
4986 * @ppdus: number of totoal PPDUs on PHY layer in the period
4987 * @bytes: bytes of tx data on MAC layer in the period
4988 * @drops: number of TX packets cancelled due to any reason in the period,
4989 * such as WMM limitation/bandwidth limitation/radio congestion
4990 * @drop_bytes: bytes of dropped TX packets in the period
4991 * @retries: number of unacked transmissions of MPDUs
4992 * @failed: number of packets have not been ACKed despite retried
4993 * @aggr_len: length of the MPDU aggregation size buffer
4994 * @mpdu_aggr_size: histogram of MPDU aggregation size
4995 * @success_mcs_len: length of success mcs buffer
4996 * @success_mcs: histogram of successed received MPDUs encoding rate
4997 * @fail_mcs_len: length of failed mcs buffer
4998 * @fail_mcs: histogram of failed received MPDUs encoding rate
4999 * @delay_len: length of the delay histofram buffer
5000 * @delay: histogram of delays on MAC layer
5001 */
5002struct sir_wifi_tx {
5003 uint32_t msdus;
5004 uint32_t mpdus;
5005 uint32_t ppdus;
5006 uint32_t bytes;
5007 uint32_t drops;
5008 uint32_t drop_bytes;
5009 uint32_t retries;
5010 uint32_t failed;
5011 uint32_t aggr_len;
5012 uint32_t *mpdu_aggr_size;
5013 uint32_t success_mcs_len;
5014 uint32_t *success_mcs;
5015 uint32_t fail_mcs_len;
5016 uint32_t *fail_mcs;
5017 uint32_t delay_len;
5018 uint32_t *delay;
5019};
5020
5021/**
5022 * struct sir_wifi_rx - per AC rx stats
5023 * @mpdus: number of RX packets on MAC layer
5024 * @bytes: bytes of RX packets on MAC layer
5025 * @ppdus: number of RX packets on PHY layer
5026 * @ppdu_bytes: bytes of RX packets on PHY layer
5027 * @mpdu_lost: number of discontinuity in seqnum
5028 * @mpdu_retry: number of RX packets flagged as retransmissions
5029 * @mpdu_dup: number of RX packets identified as duplicates
5030 * @mpdu_discard: number of RX packets discarded
5031 * @aggr_len: length of MPDU aggregation histogram buffer
5032 * @mpdu_aggr: histogram of MPDU aggregation size
5033 * @mcs_len: length of mcs histogram buffer
5034 * @mcs: histogram of encoding rate.
5035 */
5036struct sir_wifi_rx {
5037 uint32_t mpdus;
5038 uint32_t bytes;
5039 uint32_t ppdus;
5040 uint32_t ppdu_bytes;
5041 uint32_t mpdu_lost;
5042 uint32_t mpdu_retry;
5043 uint32_t mpdu_dup;
5044 uint32_t mpdu_discard;
5045 uint32_t aggr_len;
5046 uint32_t *mpdu_aggr;
5047 uint32_t mcs_len;
5048 uint32_t *mcs;
5049};
5050
5051/**
5052 * struct sir_wifi_ll_ext_wmm_ac_stats - stats for WMM AC
5053 * @type: WMM AC type
5054 * @tx_stats: pointer to TX stats
5055 * @rx_stats: pointer to RX stats
5056 */
5057struct sir_wifi_ll_ext_wmm_ac_stats {
5058 uint32_t type;
5059 struct sir_wifi_tx *tx_stats;
5060 struct sir_wifi_rx *rx_stats;
5061};
5062
Zhang Qian73c348a2017-03-13 16:15:55 +08005063/**
5064 * struct sir_wifi_ll_ext_peer_stats - per peer stats
5065 * @peer_id: peer ID
5066 * @vdev_id: VDEV ID
5067 * mac_address: MAC address
5068 * @sta_ps_inds: how many times STAs go to sleep
5069 * @sta_ps_durs: total sleep time of STAs (units in ms)
5070 * @rx_probe_reqs: number of probe requests received
5071 * @rx_oth_mgmts: number of other management frames received,
5072 * not including probe requests
5073 * @peer_signal_stat: signal stats
5074 * @ac_stats: WMM BE/BK/VI/VO stats
5075 */
5076struct sir_wifi_ll_ext_peer_stats {
5077 uint32_t peer_id;
5078 uint32_t vdev_id;
5079 tSirMacAddr mac_address;
5080 uint32_t sta_ps_inds;
5081 uint32_t sta_ps_durs;
5082 uint32_t rx_probe_reqs;
5083 uint32_t rx_oth_mgmts;
5084 struct sir_wifi_peer_signal_stats peer_signal_stats;
5085 struct sir_wifi_ll_ext_wmm_ac_stats ac_stats[WIFI_MAX_AC];
5086};
5087
5088/**
5089 * struct sir_wifi_ll_ext_stats - link layer stats report
5090 * @trigger_cond_id: Indicate what triggered this event.
5091 * 1: timeout. 2: threshold
5092 * @cca_chgd_bitmap: Bitmap to indicate changed channel CCA stats
5093 * which exceeded the thresholds
5094 * @sig_chgd_bitmap: Bitmap to indicate changed peer signal stats
5095 * which exceeded the thresholds
5096 * @tx_chgd_bitmap: Bitmap to indicate changed TX counters
5097 * which exceeded the thresholds
5098 * @rx_chgd_bitmap: Bitmap to indicate changed RX counters
5099 * which exceeded the thresholds
5100 * @chan_cca_stats: channel CCA stats
5101 * @peer_signal_stats: peer signal stats
5102 * @tx_mpdu_aggr_array_len: length of TX MPDU aggregation buffer
5103 * @tx_succ_mcs_array_len: length of mcs buffer for ACKed MPDUs
5104 * @tx_fail_mcs_array_len: length of mcs buffer for no-ACKed MPDUs
5105 * @tx_delay_array_len: length of delay stats buffer
5106 * @rx_mpdu_aggr_array_len: length of RX MPDU aggregation buffer
5107 * @rx_mcs_array_len: length of RX mcs stats buffer
5108 * @peer_stats: peer stats
5109 * @cca: physical channel CCA stats
5110 * @stats: pointer to stats data buffer.
5111 *
5112 * Structure of the whole statictics is like this:
5113 * ---------------------------------
5114 * | trigger_cond_i |
5115 * +-------------------------------+
5116 * | cca_chgd_bitmap |
5117 * +-------------------------------+
5118 * | sig_chgd_bitmap |
5119 * +-------------------------------+
5120 * | tx_chgd_bitmap |
5121 * +-------------------------------+
5122 * | rx_chgd_bitmap |
5123 * +-------------------------------+
5124 * | peer_num |
5125 * +-------------------------------+
5126 * | channel_num |
5127 * +-------------------------------+
5128 * | tx_mpdu_aggr_array_len |
5129 * +-------------------------------+
5130 * | tx_succ_mcs_array_len |
5131 * +-------------------------------+
5132 * | tx_fail_mcs_array_len |
5133 * +-------------------------------+
5134 * | tx_delay_array_len |
5135 * +-------------------------------+
5136 * | rx_mpdu_aggr_array_len |
5137 * +-------------------------------+
5138 * | rx_mcs_array_len |
5139 * +-------------------------------+
5140 * | pointer to CCA stats |
5141 * +-------------------------------+
5142 * | pointer to peer stats |
5143 * +-------------------------------+
5144 * | CCA stats |
5145 * +-------------------------------+
5146 * | peer_stats |----+
5147 * +-------------------------------+ |
5148 * | per peer signals stats |<---+
5149 * | peer0 ~ peern | |
5150 * +-------------------------------+ |
5151 * | TX aggr/mcs parameters array | |
5152 * | Length of this buffer is | |
5153 * | configurable for user layer. |<-+ |
5154 * +-------------------------------+ | |
5155 * | per peer tx stats |--+ |
5156 * | BE | <--+
5157 * | BK | |
5158 * | VI | |
5159 * | VO | |
5160 * +-------------------------------+ |
5161 * | TX aggr/mcs parameters array | |
5162 * | Length of this buffer is | |
5163 * | configurable for user layer. |<-+ |
5164 * +-------------------------------+ | |
5165 * | peer peer rx stats |--+ |
5166 * | BE | <--+
5167 * | BE |
5168 * | BK |
5169 * | VI |
5170 * | VO |
5171 * ---------------------------------
5172 */
5173struct sir_wifi_ll_ext_stats {
5174 uint32_t trigger_cond_id;
5175 uint32_t cca_chgd_bitmap;
5176 uint32_t sig_chgd_bitmap;
5177 uint32_t tx_chgd_bitmap;
5178 uint32_t rx_chgd_bitmap;
5179 uint8_t peer_num;
5180 uint8_t channel_num;
5181 uint32_t tx_mpdu_aggr_array_len;
5182 uint32_t tx_succ_mcs_array_len;
5183 uint32_t tx_fail_mcs_array_len;
5184 uint32_t tx_delay_array_len;
5185 uint32_t rx_mpdu_aggr_array_len;
5186 uint32_t rx_mcs_array_len;
5187 struct sir_wifi_ll_ext_peer_stats *peer_stats;
5188 struct sir_wifi_chan_cca_stats *cca;
5189 uint8_t stats[];
5190};
5191
5192/**
5193 * struct sir_channel_cca_threshold - threshold for channel CCA
5194 * @idle_time: idle time, no TX, no RX, no interference
5195 * @tx_time: time transmitting packets
5196 * @rx_in_bss_time: time receiving packets in current BSSs
5197 * @rx_out_bss_time: time receiving packets not in current BSSs
5198 * @rx_busy_time: time interference detected
5199 * @rx_in_bad_cond_time: receiving packets with errors
5200 * @tx_in_bad_cond_time: time transmitted packets not been ACKed
5201 * @wlan_not_avail_time: wlan card cannot work
5202 */
5203struct sir_channel_cca_threshold {
5204 uint32_t idle_time;
5205 uint32_t tx_time;
5206 uint32_t rx_in_bss_time;
5207 uint32_t rx_out_bss_time;
5208 uint32_t rx_busy_time;
5209 uint32_t rx_in_bad_cond_time;
5210 uint32_t tx_in_bad_cond_time;
5211 uint32_t wlan_not_avail_time;
5212};
5213
5214/**
5215 * struct sir_signal_threshold - threshold for per peer sigbal
5216 * @snr: signal to noise rate
5217 * @nf: noise floor
5218 */
5219struct sir_signal_threshold {
5220 uint32_t snr;
5221 uint32_t nf;
5222};
5223
5224/**
5225 * struct sir_tx_threshold - threshold for TX
5226 * @msdu: TX MSDUs on MAC layer
5227 * @mpdu: TX MPDUs on MAC layer
5228 * @ppdu: TX PPDUs on MAC layer
5229 * @bytes: TX bytes on MAC layer
5230 * @msdu_drop: drooped MSDUs
5231 * @byte_drop: dropped Bytes
5232 * @mpdu_retry: MPDU not acked
5233 * @ppdu_fail: PPDUs which received no block ack
5234 * @aggregation: aggregation size
5235 * @succ_mcs: histogram of encoding rate for acked PPDUs
5236 * @fail_mcs: histogram of encoding rate for no-acked PPDUs
5237 */
5238struct sir_tx_threshold {
5239 uint32_t msdu;
5240 uint32_t mpdu;
5241 uint32_t ppdu;
5242 uint32_t bytes;
5243 uint32_t msdu_drop;
5244 uint32_t byte_drop;
5245 uint32_t mpdu_retry;
5246 uint32_t mpdu_fail;
5247 uint32_t ppdu_fail;
5248 uint32_t aggregation;
5249 uint32_t succ_mcs;
5250 uint32_t fail_mcs;
5251 uint32_t delay;
5252};
5253
5254/**
5255 * struct sir_rx_threshold - threshold for RX
5256 * @mpdu: RX MPDUs on MAC layer
5257 * @bytes: RX bytes on MAC layer
5258 * @ppdu: RX PPDU on PHY layer
5259 * @ppdu_bytes: RX bytes on PHY layer
5260 * @disorder: discontinuity in seqnum
5261 * @mpdu_retry: MPDUs flagged as retry
5262 * @mpdu_dup: MPDUs identified as duplicated
5263 * @aggregation: aggregation size
5264 * @mcs: histogram of encoding rate for PPDUs
5265 * @ps_inds: power save indication
5266 * @ps_durs: total time in power save
5267 * @probe_reqs: probe request received
5268 * @other_mgmt: other MGMT frames received
5269 */
5270struct sir_rx_threshold {
5271 uint32_t mpdu;
5272 uint32_t bytes;
5273 uint32_t ppdu;
5274 uint32_t ppdu_bytes;
5275 uint32_t disorder;
5276 uint32_t mpdu_lost;
5277 uint32_t mpdu_retry;
5278 uint32_t mpdu_dup;
5279 uint32_t mpdu_discard;
5280 uint32_t aggregation;
5281 uint32_t mcs;
5282 uint32_t ps_inds;
5283 uint32_t ps_durs;
5284 uint32_t probe_reqs;
5285 uint32_t other_mgmt;
5286};
5287
5288/**
5289 * struct sir_wifi_ll_ext_stats_threshold - Threshold for stats update
5290 * @period: MAC counter indication period (unit in ms)
5291 * @enable: if threshold mechnism is enabled or disabled
5292 * @enable_bitmap: whether dedicated threshold is enabed.
5293 * Every MAC counter has a dedicated threshold. If the dedicated
5294 * threshold is not set in the bitmap, global threshold will take
5295 * effect.
5296 * @global: whether clobal threshold is enabled.
Jeff Johnsonf2cf6592018-05-06 16:27:44 -07005297 * When both global and dedicated threshold are disabled, MAC counter
Zhang Qian73c348a2017-03-13 16:15:55 +08005298 * will indicate stats periodically.
5299 * @global_threshold: global threshold value
5300 * @cca_bitmap: bitmap for CCA.
5301 * Bit0: idle time
5302 * Bit1: tx time
5303 * Bit2: RX in BSS
5304 * Bit3: RX out of BSS
5305 * Bit4: medium busy
5306 * Bit5: RX bad
5307 * Bit6: TX bad
5308 * Bit7: WLAN card not available
5309 * @signal_bitmap:
5310 * Bit0: Per channel SNR counter
5311 * Bit1: Per channel noise floor counter
5312 * @tx_bitmap: bitmap for TX counters
5313 * Bit0: TX counter unit in MSDU
5314 * Bit1: TX counter unit in MPDU
5315 * Bit2: TX counter unit in PPDU
5316 * Bit3: TX counter unit in byte
5317 * Bit4: Dropped MSDUs
5318 * Bit5: Dropped Bytes
5319 * Bit6: MPDU retry counter
5320 * Bit7: MPDU failure counter
5321 * Bit8: PPDU failure counter
5322 * Bit9: MPDU aggregation counter
5323 * Bit10: MCS counter for ACKed MPDUs
5324 * Bit11: MCS counter for Failed MPDUs
5325 * Bit12: TX Delay counter
5326 * @rx_bitmap:bitmap for RX counters
5327 * Bit0: MAC RX counter unit in MPDU
5328 * Bit1: MAC RX counter unit in byte
5329 * Bit2: PHY RX counter unit in PPDU
5330 * Bit3: PHY RX counter unit in byte
5331 * Bit4: Disorder counter
5332 * Bit5: Retry counter
5333 * Bit6: Duplication counter
5334 * Bit7: Discard counter
5335 * Bit8: MPDU aggregation size counter
5336 * Bit9: MCS counter
5337 * Bit10: Peer STA power state change (wake to sleep) counter
5338 * Bit11: Peer STA power save counter, total time in PS mode
5339 * Bit12: Probe request counter
5340 * Bit13: Other management frames counter
5341 * @cca_thresh: CCA threshold
5342 * @signal_thresh: signal threshold
5343 * @tx_thresh: TX threshold
5344 * @rx_thresh: RX threshold
5345 *
5346 * Generally, Link layer statistics is reported periodically. But if the
5347 * variation of one stats of compared to the pervious notification exceeds
5348 * a threshold, FW will report the new stats immediately.
5349 * This structure contains threshold for different counters.
5350 */
5351struct sir_ll_ext_stats_threshold {
5352 uint32_t period;
5353 uint32_t enable;
5354 uint32_t enable_bitmap;
5355 uint32_t global;
5356 uint32_t global_threshold;
5357 uint32_t cca_bitmap;
5358 uint32_t signal_bitmap;
5359 uint32_t tx_bitmap;
5360 uint32_t rx_bitmap;
5361 struct sir_channel_cca_threshold cca;
5362 struct sir_signal_threshold signal;
5363 struct sir_tx_threshold tx;
5364 struct sir_rx_threshold rx;
5365};
5366
5367#define LL_STATS_MIN_PERIOD 10
5368#define LL_STATS_INVALID_PERIOD 0xFFFFFFFF
5369
Zhang Qiana6e9c102016-12-22 16:47:24 +08005370/* Result ID for LL stats extension */
5371#define WMI_LL_STATS_EXT_PS_CHG 0x00000100
5372#define WMI_LL_STATS_EXT_TX_FAIL 0x00000200
5373#define WMI_LL_STATS_EXT_MAC_COUNTER 0x00000400
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005374#endif /* WLAN_FEATURE_LINK_LAYER_STATS */
5375
5376typedef struct sAniGetLinkStatus {
5377 uint16_t msgType; /* message type is same as the request type */
5378 uint16_t msgLen; /* length of the entire request */
5379 uint8_t linkStatus;
5380 uint8_t sessionId;
5381} tAniGetLinkStatus, *tpAniGetLinkStatus;
5382
5383#ifdef DHCP_SERVER_OFFLOAD
5384typedef struct {
5385 uint32_t vdev_id;
5386 uint32_t dhcpSrvOffloadEnabled;
5387 uint32_t dhcpClientNum;
5388 uint32_t dhcpSrvIP;
5389} tSirDhcpSrvOffloadInfo, *tpSirDhcpSrvOffloadInfo;
5390#endif /* DHCP_SERVER_OFFLOAD */
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05305391
5392/**
5393 * struct sir_lost_link_info - lost link information structure.
5394 *
5395 * @vdev_id: vdev_id from WMA. some modules call sessionId.
5396 * @rssi: rssi at disconnection time.
5397 *
5398 * driver uses this structure to communicate information collected at
5399 * disconnection time.
5400 */
5401struct sir_lost_link_info {
5402 uint32_t vdev_id;
5403 int32_t rssi;
5404};
5405
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005406/* find the size of given member within a structure */
5407#ifndef member_size
5408#define member_size(type, member) (sizeof(((type *)0)->member))
5409#endif
5410
5411#define RTT_INVALID 0x00
5412#define RTT_TIMING_MEAS_CAPABILITY 0x01
5413#define RTT_FINE_TIME_MEAS_INITIATOR_CAPABILITY 0x02
5414#define RTT_FINE_TIME_MEAS_RESPONDER_CAPABILITY 0x03
5415
5416/**
5417 * enum fine_time_meas_mask - bit mask to identify device's
5418 * fine timing measurement capability
5419 * @FINE_TIME_MEAS_STA_INITIATOR - STA role, Initiator capability is supported
5420 * @FINE_TIME_MEAS_STA_RESPONDER - STA role, Responder capability is supported
5421 * @FINE_TIME_MEAS_P2PCLI_INITIATOR - P2P-CLI supports initiator capability
5422 * @FINE_TIME_MEAS_P2PCLI_RESPONDER - P2P-CLI supports responder capability
5423 * @FINE_TIME_MEAS_P2PGO_INITIATOR - P2P-GO supports initiator capability
5424 * @FINE_TIME_MEAS_P2PGO_RESPONDER - P2P-GO supports responder capability
5425 * @FINE_TIME_MEAS_SAP_INITIATOR - SAP role, Initiator capability is supported
5426 * @FINE_TIME_MEAS_SAP_RESPONDER - SAP role, Responder capability is supported
5427 */
5428enum fine_time_meas_mask {
5429 FINE_TIME_MEAS_STA_INITIATOR = (1 << (0)),
5430 FINE_TIME_MEAS_STA_RESPONDER = (1 << (1)),
5431 FINE_TIME_MEAS_P2PCLI_INITIATOR = (1 << (2)),
5432 FINE_TIME_MEAS_P2PCLI_RESPONDER = (1 << (3)),
5433 FINE_TIME_MEAS_P2PGO_INITIATOR = (1 << (4)),
5434 FINE_TIME_MEAS_P2PGO_RESPONDER = (1 << (5)),
5435 FINE_TIME_MEAS_SAP_INITIATOR = (1 << (6)),
5436 FINE_TIME_MEAS_SAP_RESPONDER = (1 << (7)),
5437};
5438
5439/* number of neighbor reports that we can handle in Neighbor Report Response */
5440#define MAX_SUPPORTED_NEIGHBOR_RPT 15
5441
5442/**
5443 * struct sir_stats_avg_factor
5444 * @vdev_id: session id
5445 * @stats_avg_factor: average factor
5446 */
5447struct sir_stats_avg_factor {
5448 uint8_t vdev_id;
5449 uint16_t stats_avg_factor;
5450};
5451
5452/**
5453 * struct sir_guard_time_request
5454 * @vdev_id: session id
5455 * @guard_time: guard time
5456 */
5457struct sir_guard_time_request {
5458 uint8_t vdev_id;
5459 uint32_t guard_time;
5460};
5461
5462/* Max number of rates allowed in Supported Rates IE */
5463#define MAX_NUM_SUPPORTED_RATES (8)
5464
5465/*
5466 * struct rssi_monitor_req - rssi monitoring
5467 * @request_id: request id
5468 * @session_id: session id
5469 * @min_rssi: minimum rssi
5470 * @max_rssi: maximum rssi
5471 * @control: flag to indicate start or stop
5472 */
5473struct rssi_monitor_req {
5474 uint32_t request_id;
5475 uint32_t session_id;
5476 int8_t min_rssi;
5477 int8_t max_rssi;
5478 bool control;
5479};
5480
5481/**
5482 * struct rssi_breach_event - rssi breached event structure
5483 * @request_id: request id
5484 * @session_id: session id
5485 * @curr_rssi: current rssi
5486 * @curr_bssid: current bssid
5487 */
5488struct rssi_breach_event {
5489 uint32_t request_id;
5490 uint32_t session_id;
5491 int8_t curr_rssi;
Anurag Chouhan6d760662016-02-20 16:05:43 +05305492 struct qdf_mac_addr curr_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005493};
5494
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05305495/**
5496 * struct chip_pwr_save_fail_detected_params - chip power save failure detected
5497 * event params
5498 * @failure_reason_code:failure reason code
5499 * @wake_lock_bitmap:bitmap for modules voting against sleep for long duration.
5500 */
5501struct chip_pwr_save_fail_detected_params {
5502 uint32_t failure_reason_code;
5503 uint32_t wake_lock_bitmap[4];
5504};
5505
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005506#define MAX_NUM_FW_SEGMENTS 4
5507
5508/**
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05305509 * DEFAULT_SCAN_IE_ID - Identifier for the collection of IE's added
5510 * by default to the probe request
5511 */
5512#define DEFAULT_SCAN_IE_ID 256
5513
5514 /* MAX_DEFAULT_SCAN_IE_LEN - Maxmimum length of Default Scan IE's */
Selvaraj, Sridhar021ee0a2017-04-07 16:53:31 +05305515#define MAX_DEFAULT_SCAN_IE_LEN 2048
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05305516
5517 /* Extended Capabilities IE header(IE Id + IE Length) length */
5518#define EXT_CAP_IE_HDR_LEN 2
5519
5520/**
5521 * struct hdd_default_scan_ie - HDD default scan IE structure
5522 * @message_type: message type to be set with eWNI_SME_DEFAULT_SCAN_IE
5523 * @length: length of the struct hdd_default_scan_ie
5524 * @session_id: Session Id
5525 * @ie_len: Default scan IE length
5526 * @ie_data: Pointer to default scan IE data
5527 */
5528struct hdd_default_scan_ie {
5529 uint16_t message_type;
5530 uint16_t length;
5531 uint16_t session_id;
5532 uint16_t ie_len;
5533 uint8_t ie_data[MAX_DEFAULT_SCAN_IE_LEN];
5534};
5535
5536/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005537 * struct vdev_ie_info - IE info
5538 * @vdev_id - vdev for which the IE is being sent
5539 * @ie_id - ID of the IE
5540 * @length - length of the IE data
Naveen Rawat03e8d952016-08-01 15:22:20 -07005541 * @band - indicates IE is intended for which band
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005542 * @data - IE data
5543 *
5544 * This structure is used to store the IE information.
5545 */
5546struct vdev_ie_info {
5547 uint32_t vdev_id;
5548 uint32_t ie_id;
5549 uint32_t length;
Naveen Rawat03e8d952016-08-01 15:22:20 -07005550 uint32_t band;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005551 uint8_t *data;
5552};
5553
5554/**
5555 * struct send_extcap_ie - used to pass send_extcap_ie msg from SME to PE
5556 * @type - MSG type
5557 * @length - length of the message
5558 * @seesion_id - session_id for which the message is intended for
5559 *
5560 * This structure is used to pass send_extcap_ie msg from SME to PE
5561 */
5562struct send_extcap_ie {
5563 uint16_t msg_type; /* eWNI_SME_SET_IE_REQ */
5564 uint16_t length;
5565 uint8_t session_id;
5566};
5567
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005568typedef void (*hw_mode_transition_cb)(uint32_t old_hw_mode_index,
5569 uint32_t new_hw_mode_index,
5570 uint32_t num_vdev_mac_entries,
Tushnim Bhattacharyyaeab33dd2017-11-15 15:20:02 -08005571 struct policy_mgr_vdev_mac_map *vdev_mac_map);
Dundi Raviteja6bb9e322018-05-16 17:04:41 +05305572typedef void (*antenna_mode_cb)(uint32_t status, void *context);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005573
5574/**
5575 * struct sir_nss_update_request
5576 * @msgType: nss update msg type
5577 * @msgLen: length of the msg
5578 * @new_nss: new spatial stream value
5579 * @vdev_id: session id
5580 */
5581struct sir_nss_update_request {
5582 uint16_t msgType;
5583 uint16_t msgLen;
5584 uint8_t new_nss;
5585 uint32_t vdev_id;
5586};
5587
5588/**
5589 * struct sir_beacon_tx_complete_rsp
5590 *
5591 * @session_id: session for which beacon update happened
5592 * @tx_status: status of the beacon tx from FW
5593 */
5594struct sir_beacon_tx_complete_rsp {
5595 uint8_t session_id;
5596 uint8_t tx_status;
5597};
5598
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005599/**
5600 * OCB structures
5601 */
5602
5603#define NUM_AC (4)
5604#define OCB_CHANNEL_MAX (5)
5605
5606struct sir_qos_params {
5607 uint8_t aifsn;
5608 uint8_t cwmin;
5609 uint8_t cwmax;
5610};
5611
5612/**
5613 * struct sir_ocb_set_config_response
5614 * @status: response status
5615 */
5616struct sir_ocb_set_config_response {
5617 uint8_t status;
5618};
5619
5620/** Callback for the dcc_stats_event */
5621typedef void (*dcc_stats_event_callback_t)(void *hdd_ctx, uint32_t vdev_id,
5622 uint32_t num_channels, uint32_t stats_per_channel_array_len,
5623 const void *stats_per_channel_array);
5624
5625/**
5626 * struct sir_ocb_config_channel
5627 * @chan_freq: frequency of the channel
5628 * @bandwidth: bandwidth of the channel, either 10 or 20 MHz
5629 * @mac_address: MAC address assigned to this channel
5630 * @qos_params: QoS parameters
5631 * @max_pwr: maximum transmit power of the channel (dBm)
5632 * @min_pwr: minimum transmit power of the channel (dBm)
5633 * @reg_pwr: maximum transmit power specified by the regulatory domain (dBm)
5634 * @antenna_max: maximum antenna gain specified by the regulatory domain (dB)
5635 */
5636struct sir_ocb_config_channel {
5637 uint32_t chan_freq;
5638 uint32_t bandwidth;
Anurag Chouhan6d760662016-02-20 16:05:43 +05305639 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005640 struct sir_qos_params qos_params[MAX_NUM_AC];
5641 uint32_t max_pwr;
5642 uint32_t min_pwr;
5643 uint8_t reg_pwr;
5644 uint8_t antenna_max;
5645 uint16_t flags;
5646};
5647
5648/**
5649 * OCB_CHANNEL_FLAG_NO_RX_HDR - Don't add the RX stats header to packets
5650 * received on this channel.
5651 */
5652#define OCB_CHANNEL_FLAG_DISABLE_RX_STATS_HDR (1 << 0)
5653
5654/**
5655 * struct sir_ocb_config_sched
5656 * @chan_freq: frequency of the channel
5657 * @total_duration: duration of the schedule
5658 * @guard_interval: guard interval on the start of the schedule
5659 */
5660struct sir_ocb_config_sched {
5661 uint32_t chan_freq;
5662 uint32_t total_duration;
5663 uint32_t guard_interval;
5664};
5665
5666/**
5667 * struct sir_ocb_config
5668 * @session_id: session id
5669 * @channel_count: number of channels
5670 * @schedule_size: size of the channel schedule
5671 * @flags: reserved
5672 * @channels: array of OCB channels
5673 * @schedule: array of OCB schedule elements
5674 * @dcc_ndl_chan_list_len: size of the ndl_chan array
5675 * @dcc_ndl_chan_list: array of dcc channel info
5676 * @dcc_ndl_active_state_list_len: size of the active state array
5677 * @dcc_ndl_active_state_list: array of active states
5678 * @adapter: the OCB adapter
5679 * @dcc_stats_callback: callback for the response event
5680 */
5681struct sir_ocb_config {
5682 uint8_t session_id;
5683 uint32_t channel_count;
5684 uint32_t schedule_size;
5685 uint32_t flags;
5686 struct sir_ocb_config_channel *channels;
5687 struct sir_ocb_config_sched *schedule;
5688 uint32_t dcc_ndl_chan_list_len;
5689 void *dcc_ndl_chan_list;
5690 uint32_t dcc_ndl_active_state_list_len;
5691 void *dcc_ndl_active_state_list;
5692};
5693
5694/* The size of the utc time in bytes. */
5695#define SIZE_UTC_TIME (10)
5696/* The size of the utc time error in bytes. */
5697#define SIZE_UTC_TIME_ERROR (5)
5698
5699/**
5700 * struct sir_ocb_utc
5701 * @vdev_id: session id
5702 * @utc_time: number of nanoseconds from Jan 1st 1958
5703 * @time_error: the error in the UTC time. All 1's for unknown
5704 */
5705struct sir_ocb_utc {
5706 uint32_t vdev_id;
5707 uint8_t utc_time[SIZE_UTC_TIME];
5708 uint8_t time_error[SIZE_UTC_TIME_ERROR];
5709};
5710
5711/**
5712 * struct sir_ocb_timing_advert
5713 * @vdev_id: session id
5714 * @chan_freq: frequency on which to advertise
5715 * @repeat_rate: the number of times it will send TA in 5 seconds
5716 * @timestamp_offset: offset of the timestamp field in the TA frame
5717 * @time_value_offset: offset of the time_value field in the TA frame
5718 * @template_length: size in bytes of the TA frame
5719 * @template_value: the TA frame
5720 */
5721struct sir_ocb_timing_advert {
5722 uint32_t vdev_id;
5723 uint32_t chan_freq;
5724 uint32_t repeat_rate;
5725 uint32_t timestamp_offset;
5726 uint32_t time_value_offset;
5727 uint32_t template_length;
5728 uint8_t *template_value;
5729};
5730
5731/**
5732 * struct sir_ocb_get_tsf_timer_response
5733 * @vdev_id: session id
5734 * @timer_high: higher 32-bits of the timer
5735 * @timer_low: lower 32-bits of the timer
5736 */
5737struct sir_ocb_get_tsf_timer_response {
5738 uint32_t vdev_id;
5739 uint32_t timer_high;
5740 uint32_t timer_low;
5741};
5742
5743/**
5744 * struct sir_ocb_get_tsf_timer
5745 * @vdev_id: session id
5746 */
5747struct sir_ocb_get_tsf_timer {
5748 uint32_t vdev_id;
5749};
5750
5751/**
5752 * struct sir_dcc_get_stats_response
5753 * @vdev_id: session id
5754 * @num_channels: number of dcc channels
5755 * @channel_stats_array_len: size in bytes of the stats array
5756 * @channel_stats_array: the stats array
5757 */
5758struct sir_dcc_get_stats_response {
5759 uint32_t vdev_id;
5760 uint32_t num_channels;
5761 uint32_t channel_stats_array_len;
5762 void *channel_stats_array;
5763};
5764
5765/**
5766 * struct sir_dcc_get_stats
5767 * @vdev_id: session id
5768 * @channel_count: number of dcc channels
5769 * @request_array_len: size in bytes of the request array
5770 * @request_array: the request array
5771 */
5772struct sir_dcc_get_stats {
5773 uint32_t vdev_id;
5774 uint32_t channel_count;
5775 uint32_t request_array_len;
5776 void *request_array;
5777};
5778
5779/**
5780 * struct sir_dcc_clear_stats
5781 * @vdev_id: session id
5782 * @dcc_stats_bitmap: bitmap of clear option
5783 */
5784struct sir_dcc_clear_stats {
5785 uint32_t vdev_id;
5786 uint32_t dcc_stats_bitmap;
5787};
5788
5789/**
5790 * struct sir_dcc_update_ndl_response
5791 * @vdev_id: session id
5792 * @status: response status
5793 */
5794struct sir_dcc_update_ndl_response {
5795 uint32_t vdev_id;
5796 uint32_t status;
5797};
5798
5799/**
5800 * struct sir_dcc_update_ndl
5801 * @vdev_id: session id
5802 * @channel_count: number of channels to be updated
5803 * @dcc_ndl_chan_list_len: size in bytes of the ndl_chan array
5804 * @dcc_ndl_chan_list: the ndl_chan array
5805 * @dcc_ndl_active_state_list_len: size in bytes of the active_state array
5806 * @dcc_ndl_active_state_list: the active state array
5807 */
5808struct sir_dcc_update_ndl {
5809 uint32_t vdev_id;
5810 uint32_t channel_count;
5811 uint32_t dcc_ndl_chan_list_len;
5812 void *dcc_ndl_chan_list;
5813 uint32_t dcc_ndl_active_state_list_len;
5814 void *dcc_ndl_active_state_list;
5815};
5816
5817/**
5818 * enum powersave_qpower_mode: QPOWER modes
5819 * @QPOWER_DISABLED: Qpower is disabled
5820 * @QPOWER_ENABLED: Qpower is enabled
5821 * @QPOWER_DUTY_CYCLING: Qpower is enabled with duty cycling
5822 */
5823enum powersave_qpower_mode {
5824 QPOWER_DISABLED = 0,
5825 QPOWER_ENABLED = 1,
5826 QPOWER_DUTY_CYCLING = 2
5827};
5828
5829/**
5830 * enum powersave_qpower_mode: powersave_mode
5831 * @PS_NOT_SUPPORTED: Power save is not supported
5832 * @PS_LEGACY_NODEEPSLEEP: Legacy power save enabled and deep sleep disabled
5833 * @PS_QPOWER_NODEEPSLEEP: QPOWER enabled and deep sleep disabled
5834 * @PS_LEGACY_DEEPSLEEP: Legacy power save enabled and deep sleep enabled
5835 * @PS_QPOWER_DEEPSLEEP: QPOWER enabled and deep sleep enabled
5836 * @PS_DUTY_CYCLING_QPOWER: QPOWER enabled in duty cycling mode
5837 */
5838enum powersave_mode {
5839 PS_NOT_SUPPORTED = 0,
5840 PS_LEGACY_NODEEPSLEEP = 1,
5841 PS_QPOWER_NODEEPSLEEP = 2,
5842 PS_LEGACY_DEEPSLEEP = 3,
5843 PS_QPOWER_DEEPSLEEP = 4,
5844 PS_DUTY_CYCLING_QPOWER = 5
5845};
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08005846#ifdef FEATURE_LFR_SUBNET_DETECTION
5847/**
5848 * struct gateway_param_update_req - gateway parameter update request
5849 * @request_id: request id
5850 * @session_id: session id
5851 * @max_retries: Max ARP/NS retry attempts
5852 * @timeout: Retry interval
5853 * @ipv4_addr_type: on ipv4 network
5854 * @ipv6_addr_type: on ipv6 network
5855 * @gw_mac_addr: gateway mac addr
5856 * @ipv4_addr: ipv4 addr
5857 * @ipv6_addr: ipv6 addr
5858 */
5859struct gateway_param_update_req {
5860 uint32_t request_id;
5861 uint32_t session_id;
5862 uint32_t max_retries;
5863 uint32_t timeout;
5864 uint32_t ipv4_addr_type;
5865 uint32_t ipv6_addr_type;
Anurag Chouhan6d760662016-02-20 16:05:43 +05305866 struct qdf_mac_addr gw_mac_addr;
5867 uint8_t ipv4_addr[QDF_IPV4_ADDR_SIZE];
5868 uint8_t ipv6_addr[QDF_IPV6_ADDR_SIZE];
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08005869};
5870#else
5871struct gateway_param_update_req;
5872#endif /* FEATURE_LFR_SUBNET_DETECTION */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005873
Abhishek Singh518323d2015-10-19 17:42:01 +05305874/**
5875 * struct sir_sme_ext_change_chan_req - channel change request
5876 * @message_type: message id
5877 * @length: msg length
5878 * @new_channel: new channel
5879 * @session_id: session id
5880 */
5881struct sir_sme_ext_cng_chan_req {
5882 uint16_t message_type; /* eWNI_SME_EXT_CHANGE_CHANNEL */
5883 uint16_t length;
5884 uint32_t new_channel;
5885 uint8_t session_id;
5886};
5887
5888/**
5889 * struct sir_sme_ext_change_chan_ind.
5890 * @session_id: session id
5891 * @new_channel: new channel to change
5892 */
5893struct sir_sme_ext_cng_chan_ind {
5894 uint8_t session_id;
5895 uint8_t new_channel;
5896};
5897
Ryan Hsu3c8f79f2015-12-02 16:45:09 -08005898/**
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07005899 * struct stsf - the basic stsf structure
5900 *
5901 * @vdev_id: vdev id
5902 * @tsf_low: low 32bits of tsf
5903 * @tsf_high: high 32bits of tsf
Manikandan Mohan5356c2b2016-04-03 15:51:35 -07005904 * @soc_timer_low: low 32bits of synced SOC timer value
5905 * @soc_timer_high: high 32bits of synced SOC timer value
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07005906 *
5907 * driver use this struct to store the tsf info
5908 */
5909struct stsf {
5910 uint32_t vdev_id;
5911 uint32_t tsf_low;
5912 uint32_t tsf_high;
Manikandan Mohan5356c2b2016-04-03 15:51:35 -07005913 uint32_t soc_timer_low;
5914 uint32_t soc_timer_high;
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07005915};
5916
Gupta, Kapil4cb1d7d2016-04-16 18:16:25 -07005917#define SIR_BCN_FLT_MAX_ELEMS_IE_LIST 8
5918/**
5919 * struct beacon_filter_param - parameters for beacon filtering
5920 * @vdev_id: vdev id
5921 * @ie_map: bitwise map of IEs that needs to be filtered
5922 *
5923 */
5924struct beacon_filter_param {
5925 uint32_t vdev_id;
5926 uint32_t ie_map[SIR_BCN_FLT_MAX_ELEMS_IE_LIST];
5927};
5928
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05305929/**
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +05305930 * struct adaptive_dwelltime_params - the adaptive dwelltime params
5931 * @vdev_id: vdev id
5932 * @is_enabled: Adaptive dwell time is enabled/disabled
5933 * @dwelltime_mode: global default adaptive dwell mode
5934 * @lpf_weight: weight to calculate the average low pass
5935 * filter for channel congestion
5936 * @passive_mon_intval: intval to monitor wifi activity in passive scan in msec
5937 * @wifi_act_threshold: % of wifi activity used in passive scan 0-100
5938 *
5939 */
5940struct adaptive_dwelltime_params {
5941 uint32_t vdev_id;
5942 bool is_enabled;
5943 uint8_t dwelltime_mode;
5944 uint8_t lpf_weight;
5945 uint8_t passive_mon_intval;
5946 uint8_t wifi_act_threshold;
5947};
5948
5949/**
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05305950 * struct csa_offload_params - CSA offload request parameters
5951 * @channel: channel
5952 * @switch_mode: switch mode
5953 * @sec_chan_offset: second channel offset
5954 * @new_ch_width: new channel width
5955 * @new_ch_freq_seg1: channel center freq 1
5956 * @new_ch_freq_seg2: channel center freq 2
5957 * @ies_present_flag: IE present flag
5958 */
5959struct csa_offload_params {
5960 uint8_t channel;
5961 uint8_t switch_mode;
5962 uint8_t sec_chan_offset;
5963 uint8_t new_ch_width;
5964 uint8_t new_op_class;
5965 uint8_t new_ch_freq_seg1;
5966 uint8_t new_ch_freq_seg2;
5967 uint32_t ies_present_flag;
5968 tSirMacAddr bssId;
5969};
5970
5971/**
Sandeep Puligillae0875662016-02-12 16:09:21 -08005972 * enum obss_ht40_scancmd_type - obss scan command type
5973 * @HT40_OBSS_SCAN_PARAM_START: OBSS scan start
5974 * @HT40_OBSS_SCAN_PARAM_UPDATE: OBSS scan param update
5975 */
5976enum obss_ht40_scancmd_type {
5977 HT40_OBSS_SCAN_PARAM_START,
5978 HT40_OBSS_SCAN_PARAM_UPDATE
5979};
5980
5981/**
5982 * struct sme_obss_ht40_scanind_msg - sme obss scan params
5983 * @msg_type: message type
5984 * @length: message length
5985 * @mac_addr: mac address
5986 */
5987struct sme_obss_ht40_scanind_msg {
5988 uint16_t msg_type;
5989 uint16_t length;
5990 struct qdf_mac_addr mac_addr;
5991};
5992
5993/**
5994 * struct obss_ht40_scanind - ht40 obss scan request
5995 * @cmd: message type
5996 * @scan_type: message length
5997 * @obss_passive_dwelltime: obss passive dwelltime
5998 * @obss_active_dwelltime: obss active dwelltime
5999 * @obss_width_trigger_interval: scan interval
6000 * @obss_passive_total_per_channel: total passive scan time per channel
6001 * @obss_active_total_per_channel: total active scan time per channel
6002 * @bsswidth_ch_trans_delay: OBSS transition delay time
6003 * @obss_activity_threshold: OBSS activity threshold
6004 * @self_sta_id: self sta identification
6005 * @bss_id: BSS index
6006 * @fortymhz_intolerent: Ht40mhz intolerance
6007 * @channel_count: channel count
6008 * @channels: channel information
6009 * @current_operatingclass: operating class
6010 * @iefield_len: ie's length
6011 * @iefiled: ie's information
6012 */
6013struct obss_ht40_scanind {
6014 enum obss_ht40_scancmd_type cmd;
6015 enum eSirScanType scan_type;
6016 /* In TUs */
6017 uint16_t obss_passive_dwelltime;
6018 uint16_t obss_active_dwelltime;
6019 /* In seconds */
6020 uint16_t obss_width_trigger_interval;
6021 /* In TU's */
6022 uint16_t obss_passive_total_per_channel;
6023 uint16_t obss_active_total_per_channel;
6024 uint16_t bsswidth_ch_trans_delay;
6025 uint16_t obss_activity_threshold;
6026 uint8_t self_sta_idx;
6027 uint8_t bss_id;
6028 uint8_t fortymhz_intolerent;
6029 uint8_t channel_count;
6030 uint8_t channels[SIR_ROAM_MAX_CHANNELS];
6031 uint8_t current_operatingclass;
6032 uint16_t iefield_len;
6033 uint8_t iefield[SIR_ROAM_SCAN_MAX_PB_REQ_SIZE];
6034};
6035
6036/**
6037 * struct obss_scanparam - OBSS scan parameters
6038 * @obss_passive_dwelltime: message type
6039 * @obss_active_dwelltime: message length
6040 * @obss_width_trigger_interval: obss passive dwelltime
6041 * @obss_passive_total_per_channel: obss passive total scan time
6042 * @obss_active_total_per_channel: obss active total scan time
6043 * @bsswidth_ch_trans_delay: OBSS transition delay time
6044 * @obss_activity_threshold: OBSS activity threshold
6045 */
6046struct obss_scanparam {
6047 uint16_t obss_passive_dwelltime;
6048 uint16_t obss_active_dwelltime;
6049 uint16_t obss_width_trigger_interval;
6050 uint16_t obss_passive_total_per_channel;
6051 uint16_t obss_active_total_per_channel;
6052 uint16_t bsswidth_ch_trans_delay;
6053 uint16_t obss_activity_threshold;
6054};
6055
Arun Khandavalli2476ef52016-04-26 20:19:43 +05306056/**
Nachiket Kukadee547a482018-05-22 16:43:30 +05306057 * struct sir_apf_set_offload - set apf filter instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05306058 * @session_id: session identifier
Nachiket Kukadee547a482018-05-22 16:43:30 +05306059 * @version: host apf version
6060 * @filter_id: Filter ID for APF filter
Arun Khandavalli2476ef52016-04-26 20:19:43 +05306061 * @total_length: The total length of the full instruction
6062 * total_length equal to 0 means reset
6063 * @current_offset: current offset, 0 means start a new setting
6064 * @current_length: Length of current @program
Nachiket Kukadee547a482018-05-22 16:43:30 +05306065 * @program: APF instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05306066 */
Nachiket Kukadee547a482018-05-22 16:43:30 +05306067struct sir_apf_set_offload {
Arun Khandavalli2476ef52016-04-26 20:19:43 +05306068 uint8_t session_id;
6069 uint32_t version;
6070 uint32_t filter_id;
6071 uint32_t total_length;
6072 uint32_t current_offset;
6073 uint32_t current_length;
6074 uint8_t *program;
6075};
6076
6077/**
Nachiket Kukadee547a482018-05-22 16:43:30 +05306078 * struct sir_apf_offload_capabilities - get apf Capabilities
6079 * @apf_version: fw's implement version
6080 * @max_apf_filters: max filters that fw supports
6081 * @max_bytes_for_apf_inst: the max bytes that can be used as apf instructions
6082 * @remaining_bytes_for_apf_inst: remaining bytes for apf instructions
Arun Khandavalli2476ef52016-04-26 20:19:43 +05306083 *
6084 */
Nachiket Kukadee547a482018-05-22 16:43:30 +05306085struct sir_apf_get_offload {
6086 uint32_t apf_version;
6087 uint32_t max_apf_filters;
6088 uint32_t max_bytes_for_apf_inst;
6089 uint32_t remaining_bytes_for_apf_inst;
Arun Khandavalli2476ef52016-04-26 20:19:43 +05306090};
6091
Naveen Rawat3ff5cff2018-01-29 14:31:16 -08006092#ifndef QCA_SUPPORT_CP_STATS
Sandeep Puligilla607f34a2016-05-25 14:37:47 -07006093/**
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306094 * struct sir_wake_lock_stats - wake lock stats structure
Dustin Brown9d797d62017-01-11 16:39:12 -08006095 * @wow_unspecified_wake_up_count: number of non-wow related wake ups
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306096 * @wow_ucast_wake_up_count: Unicast wakeup count
6097 * @wow_bcast_wake_up_count: Broadcast wakeup count
6098 * @wow_ipv4_mcast_wake_up_count: ipv4 multicast wakeup count
6099 * @wow_ipv6_mcast_wake_up_count: ipv6 multicast wakeup count
6100 * @wow_ipv6_mcast_ra_stats: ipv6 multicast ra stats
6101 * @wow_ipv6_mcast_ns_stats: ipv6 multicast ns stats
6102 * @wow_ipv6_mcast_na_stats: ipv6 multicast na stats
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +05306103 * @wow_icmpv4_count: ipv4 icmp packet count
Himanshu Agarwal4574e282016-08-10 15:22:45 +05306104 * @wow_icmpv6_count: ipv6 icmp packet count
Poddar, Siddarthc01681a2016-12-21 18:36:30 +05306105 * @wow_rssi_breach_wake_up_count: rssi breach wakeup count
6106 * @wow_low_rssi_wake_up_count: low rssi wakeup count
6107 * @wow_gscan_wake_up_count: gscan wakeup count
6108 * @wow_pno_complete_wake_up_count: pno complete wakeup count
6109 * @wow_pno_match_wake_up_count: pno match wakeup count
Dustin Brown9d797d62017-01-11 16:39:12 -08006110 * @wow_oem_response_wake_up_count: oem response wakeup count
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05306111 * @pwr_save_fail_detected: pwr save fail detected wakeup count
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306112 */
6113struct sir_wake_lock_stats {
Dustin Brown9d797d62017-01-11 16:39:12 -08006114 uint32_t wow_unspecified_wake_up_count;
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306115 uint32_t wow_ucast_wake_up_count;
6116 uint32_t wow_bcast_wake_up_count;
6117 uint32_t wow_ipv4_mcast_wake_up_count;
6118 uint32_t wow_ipv6_mcast_wake_up_count;
6119 uint32_t wow_ipv6_mcast_ra_stats;
6120 uint32_t wow_ipv6_mcast_ns_stats;
6121 uint32_t wow_ipv6_mcast_na_stats;
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +05306122 uint32_t wow_icmpv4_count;
Himanshu Agarwal4574e282016-08-10 15:22:45 +05306123 uint32_t wow_icmpv6_count;
Poddar, Siddarthc01681a2016-12-21 18:36:30 +05306124 uint32_t wow_rssi_breach_wake_up_count;
6125 uint32_t wow_low_rssi_wake_up_count;
6126 uint32_t wow_gscan_wake_up_count;
6127 uint32_t wow_pno_complete_wake_up_count;
6128 uint32_t wow_pno_match_wake_up_count;
Dustin Brown9d797d62017-01-11 16:39:12 -08006129 uint32_t wow_oem_response_wake_up_count;
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05306130 uint32_t pwr_save_fail_detected;
Dustin Brown9d797d62017-01-11 16:39:12 -08006131};
6132
6133/**
6134 * struct sir_vdev_wow_stats - container for per vdev wow related stat counters
6135 * @ucast: Unicast wakeup count
6136 * @bcast: Broadcast wakeup count
6137 * @ipv4_mcast: ipv4 multicast wakeup count
6138 * @ipv6_mcast: ipv6 multicast wakeup count
6139 * @ipv6_mcast_ra: ipv6 multicast ra stats
6140 * @ipv6_mcast_ns: ipv6 multicast ns stats
6141 * @ipv6_mcast_na: ipv6 multicast na stats
6142 * @icmpv4: ipv4 icmp packet count
6143 * @icmpv6: ipv6 icmp packet count
6144 * @rssi_breach: rssi breach wakeup count
6145 * @low_rssi: low rssi wakeup count
6146 * @gscan: gscan wakeup count
6147 * @pno_complete: pno complete wakeup count
6148 * @pno_match: pno match wakeup count
Amar Singhal5eb9acb2017-05-26 15:25:27 -07006149 * @oem_response: oem response wakeup coun
6150 * @scan_11d: 11d scan wakeup count
Dustin Brown9d797d62017-01-11 16:39:12 -08006151 */
6152struct sir_vdev_wow_stats {
6153 uint32_t ucast;
6154 uint32_t bcast;
6155 uint32_t ipv4_mcast;
6156 uint32_t ipv6_mcast;
6157 uint32_t ipv6_mcast_ra;
6158 uint32_t ipv6_mcast_ns;
6159 uint32_t ipv6_mcast_na;
6160 uint32_t icmpv4;
6161 uint32_t icmpv6;
6162 uint32_t rssi_breach;
6163 uint32_t low_rssi;
6164 uint32_t gscan;
6165 uint32_t pno_complete;
6166 uint32_t pno_match;
6167 uint32_t oem_response;
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05306168 uint32_t pwr_save_fail_detected;
Amar Singhal5eb9acb2017-05-26 15:25:27 -07006169 uint32_t scan_11d;
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306170};
Naveen Rawat3ff5cff2018-01-29 14:31:16 -08006171#endif
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306172
6173/**
Sandeep Puligilla607f34a2016-05-25 14:37:47 -07006174 * enum ht_capability_fields - HT Capabilities bit fields
6175 * @HT_CAPS_LDPC: ldpc coding capability bit field
6176 * @HT_CAPS_SUPPORTED_CHANNEL_SET: channel width set bit field
6177 * @HT_CAPS_SM_PWR_SAVE: SM power save bit field
6178 * @HT_CAPS_GREENFIELD: greenfield capability bit field
6179 * @HT_CAPS_SHORT_GI20: short GI 20 bit field
6180 * @HT_CAPS_SHORT_GI40: short GI 40 bit field
6181 * @HT_CAPS_TX_STBC: Tx STBC bit field
6182 * @HT_CAPS_RX_STBC: Rx STBC bit fields
6183 */
6184enum ht_capability_fields {
6185 HT_CAPS_LDPC = 0x0001,
6186 HT_CAPS_SUPPORTED_CHANNEL_SET = 0x0002,
6187 HT_CAPS_SM_PWR_SAVE = 0x000c,
6188 HT_CAPS_GREENFIELD = 0x0010,
6189 HT_CAPS_SHORT_GI20 = 0x0020,
6190 HT_CAPS_SHORT_GI40 = 0x0040,
6191 HT_CAPS_TX_STBC = 0x0080,
6192 HT_CAPS_RX_STBC = 0x0300
6193};
6194
Ravi Joshi412f23d2016-05-26 15:09:23 -07006195#ifdef WLAN_FEATURE_NAN_DATAPATH
6196
6197#define IFACE_NAME_SIZE 64
6198
6199/**
6200 * enum ndp_accept_policy - nan data path accept policy
6201 * @NDP_ACCEPT_POLICY_NONE: the framework will decide the policy
6202 * @NDP_ACCEPT_POLICY_ALL: accept policy offloaded to fw
6203 *
6204 */
6205enum ndp_accept_policy {
6206 NDP_ACCEPT_POLICY_NONE = 0,
6207 NDP_ACCEPT_POLICY_ALL = 1,
6208};
6209
6210/**
6211 * enum ndp_self_role - nan data path role
6212 * @NDP_ROLE_INITIATOR: initiator of nan data path request
6213 * @NDP_ROLE_RESPONDER: responder to nan data path request
6214 *
6215 */
6216enum ndp_self_role {
6217 NDP_ROLE_INITIATOR = 0,
6218 NDP_ROLE_RESPONDER = 1,
6219};
6220
6221/**
6222 * enum ndp_response_code - responder's response code to nan data path request
6223 * @NDP_RESPONSE_ACCEPT: ndp request accepted
6224 * @NDP_RESPONSE_REJECT: ndp request rejected
6225 * @NDP_RESPONSE_DEFER: ndp request deferred until later (response to follow
6226 * any time later)
6227 *
6228 */
6229enum ndp_response_code {
6230 NDP_RESPONSE_ACCEPT = 0,
6231 NDP_RESPONSE_REJECT = 1,
6232 NDP_RESPONSE_DEFER = 2,
6233};
6234
6235/**
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07006236 * enum ndp_end_type - NDP end type
6237 * @NDP_END_TYPE_UNSPECIFIED: type is unspecified
6238 * @NDP_END_TYPE_PEER_UNAVAILABLE: type is peer unavailable
6239 * @NDP_END_TYPE_OTA_FRAME: NDP end frame received from peer
6240 *
6241 */
6242enum ndp_end_type {
6243 NDP_END_TYPE_UNSPECIFIED = 0x00,
6244 NDP_END_TYPE_PEER_UNAVAILABLE = 0x01,
6245 NDP_END_TYPE_OTA_FRAME = 0x02,
6246};
6247
6248/**
6249 * enum ndp_end_reason_code - NDP end reason code
6250 * @NDP_END_REASON_UNSPECIFIED: reason is unspecified
6251 * @NDP_END_REASON_INACTIVITY: reason is peer inactivity
6252 * @NDP_END_REASON_PEER_DATA_END: data end indication received from peer
6253 *
6254 */
6255enum ndp_end_reason_code {
6256 NDP_END_REASON_UNSPECIFIED = 0x00,
6257 NDP_END_REASON_INACTIVITY = 0x01,
6258 NDP_END_REASON_PEER_DATA_END = 0x02,
6259};
6260
6261/**
Naveen Rawat8d63a592016-06-29 18:30:59 -07006262 * enum nan_status_type - NDP status type
6263 * @NDP_RSP_STATUS_SUCCESS: request was successful
6264 * @NDP_RSP_STATUS_ERROR: request failed
6265 */
6266enum nan_status_type {
6267 NDP_RSP_STATUS_SUCCESS = 0x00,
6268 NDP_RSP_STATUS_ERROR = 0x01,
6269};
6270
6271/**
6272 * enum nan_reason_code - NDP command rsp reason code value
6273 * @NDP_UNSUPPORTED_CONCURRENCY: Will be used in unsupported concurrency cases
6274 * @NDP_NAN_DATA_IFACE_CREATE_FAILED: ndi create failed
6275 * @NDP_NAN_DATA_IFACE_DELETE_FAILED: ndi delete failed
6276 * @NDP_DATA_INITIATOR_REQ_FAILED: data initiator request failed
6277 * @NDP_DATA_RESPONDER_REQ_FAILED: data responder request failed
6278 * @NDP_INVALID_SERVICE_INSTANCE_ID: invalid service instance id
6279 * @NDP_INVALID_NDP_INSTANCE_ID: invalid ndp instance id
6280 * @NDP_INVALID_RSP_CODE: invalid response code in ndp responder request
6281 * @NDP_INVALID_APP_INFO_LEN: invalid app info length
6282 * @NDP_NMF_REQ_FAIL: OTA nan mgmt frame failure for data request
6283 * @NDP_NMF_RSP_FAIL: OTA nan mgmt frame failure for data response
6284 * @NDP_NMF_CNF_FAIL: OTA nan mgmt frame failure for confirm
6285 * @NDP_END_FAILED: ndp end failed
6286 * @NDP_NMF_END_REQ_FAIL: OTA nan mgmt frame failure for data end
6287 * @NDP_VENDOR_SPECIFIC_ERROR: other vendor specific failures
6288 */
6289enum nan_reason_code {
6290 NDP_UNSUPPORTED_CONCURRENCY = 9000,
6291 NDP_NAN_DATA_IFACE_CREATE_FAILED = 9001,
6292 NDP_NAN_DATA_IFACE_DELETE_FAILED = 9002,
6293 NDP_DATA_INITIATOR_REQ_FAILED = 9003,
6294 NDP_DATA_RESPONDER_REQ_FAILED = 9004,
6295 NDP_INVALID_SERVICE_INSTANCE_ID = 9005,
6296 NDP_INVALID_NDP_INSTANCE_ID = 9006,
6297 NDP_INVALID_RSP_CODE = 9007,
6298 NDP_INVALID_APP_INFO_LEN = 9008,
6299 NDP_NMF_REQ_FAIL = 9009,
6300 NDP_NMF_RSP_FAIL = 9010,
6301 NDP_NMF_CNF_FAIL = 9011,
6302 NDP_END_FAILED = 9012,
6303 NDP_NMF_END_REQ_FAIL = 9013,
6304 /* 9500 onwards vendor specific error codes */
6305 NDP_VENDOR_SPECIFIC_ERROR = 9500,
6306};
6307
6308/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07006309 * struct ndp_cfg - ndp configuration
6310 * @tag: unique identifier
6311 * @ndp_cfg_len: ndp configuration length
6312 * @ndp_cfg: variable length ndp configuration
6313 *
6314 */
6315struct ndp_cfg {
6316 uint32_t tag;
6317 uint32_t ndp_cfg_len;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006318 uint8_t *ndp_cfg;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006319};
6320
6321/**
6322 * struct ndp_qos_cfg - ndp qos configuration
6323 * @tag: unique identifier
6324 * @ndp_qos_cfg_len: ndp qos configuration length
6325 * @ndp_qos_cfg: variable length ndp qos configuration
6326 *
6327 */
6328struct ndp_qos_cfg {
6329 uint32_t tag;
6330 uint32_t ndp_qos_cfg_len;
6331 uint8_t ndp_qos_cfg[];
6332};
6333
6334/**
6335 * struct ndp_app_info - application info shared during ndp setup
6336 * @tag: unique identifier
6337 * @ndp_app_info_len: ndp app info length
6338 * @ndp_app_info: variable length application information
6339 *
6340 */
6341struct ndp_app_info {
6342 uint32_t tag;
6343 uint32_t ndp_app_info_len;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006344 uint8_t *ndp_app_info;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006345};
6346
6347/**
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006348 * struct ndp_scid - structure to hold sceurity context identifier
6349 * @scid_len: length of scid
6350 * @scid: scid
6351 *
6352 */
6353struct ndp_scid {
6354 uint32_t scid_len;
6355 uint8_t *scid;
6356};
6357
6358/**
6359 * struct ndp_pmk - structure to hold pairwise master key
6360 * @pmk_len: length of pairwise master key
6361 * @pmk: buffer containing pairwise master key
6362 *
6363 */
6364struct ndp_pmk {
6365 uint32_t pmk_len;
6366 uint8_t *pmk;
6367};
6368
6369/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07006370 * struct ndi_create_req - ndi create request params
6371 * @transaction_id: unique identifier
6372 * @iface_name: interface name
6373 *
6374 */
6375struct ndi_create_req {
6376 uint32_t transaction_id;
6377 char iface_name[IFACE_NAME_SIZE];
6378};
6379
6380/**
6381 * struct ndi_create_rsp - ndi create response params
Ravi Joshi412f23d2016-05-26 15:09:23 -07006382 * @status: request status
6383 * @reason: reason if any
6384 *
6385 */
6386struct ndi_create_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07006387 uint32_t status;
6388 uint32_t reason;
Rakesh Sunkicf1c9ab2016-08-25 14:11:25 -07006389 uint8_t sta_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006390};
6391
6392/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07006393 * struct ndi_delete_rsp - ndi delete response params
Ravi Joshi412f23d2016-05-26 15:09:23 -07006394 * @status: request status
6395 * @reason: reason if any
6396 *
6397 */
6398struct ndi_delete_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07006399 uint32_t status;
6400 uint32_t reason;
6401};
6402
6403/**
6404 * struct ndp_initiator_req - ndp initiator request params
6405 * @transaction_id: unique identifier
6406 * @vdev_id: session id of the interface over which ndp is being created
6407 * @channel: suggested channel for ndp creation
Naveen Rawat0a017052016-10-19 14:17:07 -07006408 * @channel_cfg: channel config, 0=no channel, 1=optional, 2=mandatory
Ravi Joshi412f23d2016-05-26 15:09:23 -07006409 * @service_instance_id: Service identifier
6410 * @peer_discovery_mac_addr: Peer's discovery mac address
6411 * @self_ndi_mac_addr: self NDI mac address
6412 * @ndp_config: ndp configuration params
6413 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006414 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
6415 * @pmk: pairwise master key
Ravi Joshi412f23d2016-05-26 15:09:23 -07006416 *
6417 */
6418struct ndp_initiator_req {
6419 uint32_t transaction_id;
6420 uint32_t vdev_id;
6421 uint32_t channel;
Naveen Rawat0a017052016-10-19 14:17:07 -07006422 uint32_t channel_cfg;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006423 uint32_t service_instance_id;
6424 struct qdf_mac_addr peer_discovery_mac_addr;
6425 struct qdf_mac_addr self_ndi_mac_addr;
6426 struct ndp_cfg ndp_config;
6427 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006428 uint32_t ncs_sk_type;
6429 struct ndp_pmk pmk;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006430};
6431
6432/**
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006433 * struct ndp_initiator_rsp - response event from FW
Ravi Joshi412f23d2016-05-26 15:09:23 -07006434 * @transaction_id: unique identifier
6435 * @vdev_id: session id of the interface over which ndp is being created
6436 * @ndp_instance_id: locally created NDP instance ID
6437 * @status: status of the ndp request
6438 * @reason: reason for failure if any
6439 *
6440 */
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006441struct ndp_initiator_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07006442 uint32_t transaction_id;
6443 uint32_t vdev_id;
6444 uint32_t ndp_instance_id;
6445 uint32_t status;
Naveen Rawat8d63a592016-06-29 18:30:59 -07006446 uint32_t reason;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006447};
6448
6449/**
6450 * struct ndp_indication_event - create ndp indication on the responder
6451 * @vdev_id: session id of the interface over which ndp is being created
6452 * @service_instance_id: Service identifier
6453 * @peer_discovery_mac_addr: Peer's discovery mac address
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006454 * @peer_mac_addr: Peer's NDI mac address
Ravi Joshi412f23d2016-05-26 15:09:23 -07006455 * @ndp_initiator_mac_addr: NDI mac address of the peer initiating NDP
6456 * @ndp_instance_id: locally created NDP instance ID
6457 * @role: self role for NDP
6458 * @ndp_accept_policy: accept policy configured by the upper layer
6459 * @ndp_config: ndp configuration params
6460 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006461 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
6462 * @scid: security context identifier
Ravi Joshi412f23d2016-05-26 15:09:23 -07006463 *
6464 */
6465struct ndp_indication_event {
6466 uint32_t vdev_id;
6467 uint32_t service_instance_id;
6468 struct qdf_mac_addr peer_discovery_mac_addr;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006469 struct qdf_mac_addr peer_mac_addr;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006470 uint32_t ndp_instance_id;
6471 enum ndp_self_role role;
6472 enum ndp_accept_policy policy;
6473 struct ndp_cfg ndp_config;
6474 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006475 uint32_t ncs_sk_type;
6476 struct ndp_scid scid;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006477};
6478
6479/**
6480 * struct ndp_responder_req - responder's response to ndp create request
6481 * @transaction_id: unique identifier
6482 * @vdev_id: session id of the interface over which ndp is being created
6483 * @ndp_instance_id: locally created NDP instance ID
6484 * @ndp_rsp: response to the ndp create request
6485 * @ndp_config: ndp configuration params
6486 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006487 * @pmk: pairwise master key
6488 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
Ravi Joshi412f23d2016-05-26 15:09:23 -07006489 *
6490 */
6491struct ndp_responder_req {
6492 uint32_t transaction_id;
6493 uint32_t vdev_id;
6494 uint32_t ndp_instance_id;
6495 enum ndp_response_code ndp_rsp;
6496 struct ndp_cfg ndp_config;
6497 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006498 struct ndp_pmk pmk;
6499 uint32_t ncs_sk_type;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006500};
6501
6502/**
6503 * struct ndp_responder_rsp_event - response to responder's request
6504 * @transaction_id: unique identifier
6505 * @vdev_id: session id of the interface over which ndp is being created
6506 * @status: command status
6507 * @reason: reason for failure if any
Abhishek Singh4fef7472016-06-06 11:36:03 -07006508 * @peer_mac_addr: Peer's mac address
Rakesh Sunkid92d1082017-01-04 15:14:28 -08006509 * @create_peer: Flag to indicate to create peer
Ravi Joshi412f23d2016-05-26 15:09:23 -07006510 */
6511struct ndp_responder_rsp_event {
6512 uint32_t transaction_id;
6513 uint32_t vdev_id;
6514 uint32_t status;
6515 uint32_t reason;
Abhishek Singh4fef7472016-06-06 11:36:03 -07006516 struct qdf_mac_addr peer_mac_addr;
Rakesh Sunkid92d1082017-01-04 15:14:28 -08006517 bool create_peer;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006518};
6519
6520/**
6521 * struct ndp_confirm_event - ndp confirmation event from FW
6522 * @vdev_id: session id of the interface over which ndp is being created
6523 * @ndp_instance_id: ndp instance id for which confirm is being generated
Naveen Rawat460be782016-06-29 18:26:22 -07006524 * @reason_code : reason code(opaque to driver)
6525 * @num_active_ndps_on_peer: number of ndp instances on peer
Ravi Joshi412f23d2016-05-26 15:09:23 -07006526 * @peer_ndi_mac_addr: peer NDI mac address
6527 * @rsp_code: ndp response code
Ravi Joshi412f23d2016-05-26 15:09:23 -07006528 * @ndp_info: ndp application info
6529 *
6530 */
6531struct ndp_confirm_event {
6532 uint32_t vdev_id;
6533 uint32_t ndp_instance_id;
Naveen Rawat460be782016-06-29 18:26:22 -07006534 uint32_t reason_code;
6535 uint32_t num_active_ndps_on_peer;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006536 struct qdf_mac_addr peer_ndi_mac_addr;
6537 enum ndp_response_code rsp_code;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006538 struct ndp_app_info ndp_info;
6539};
6540
6541/**
6542 * struct ndp_end_req - ndp end request
6543 * @transaction_id: unique transaction identifier
Ravi Joshi412f23d2016-05-26 15:09:23 -07006544 * @num_ndp_instances: number of ndp instances to be terminated
Naveen Rawatf28315c2016-06-29 18:06:02 -07006545 * @ndp_ids: pointer to array of ndp_instance_id to be terminated
Ravi Joshi412f23d2016-05-26 15:09:23 -07006546 *
6547 */
6548struct ndp_end_req {
6549 uint32_t transaction_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006550 uint32_t num_ndp_instances;
Naveen Rawatf28315c2016-06-29 18:06:02 -07006551 uint32_t *ndp_ids;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006552};
6553
6554/**
6555 * struct peer_ndp_map - mapping of NDP instances to peer to VDEV
6556 * @vdev_id: session id of the interface over which ndp is being created
6557 * @peer_ndi_mac_addr: peer NDI mac address
6558 * @num_active_ndp_sessions: number of active NDP sessions on the peer
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07006559 * @type: NDP end indication type
6560 * @reason_code: NDP end indication reason code
6561 * @ndp_instance_id: NDP instance ID
Ravi Joshi412f23d2016-05-26 15:09:23 -07006562 *
6563 */
6564struct peer_ndp_map {
6565 uint32_t vdev_id;
6566 struct qdf_mac_addr peer_ndi_mac_addr;
6567 uint32_t num_active_ndp_sessions;
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07006568 enum ndp_end_type type;
6569 enum ndp_end_reason_code reason_code;
6570 uint32_t ndp_instance_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006571};
6572
6573/**
6574 * struct ndp_end_rsp_event - firmware response to ndp end request
6575 * @transaction_id: unique identifier for the request
Naveen Rawatf28315c2016-06-29 18:06:02 -07006576 * @status: status of operation
6577 * @reason: reason(opaque to host driver)
Ravi Joshi412f23d2016-05-26 15:09:23 -07006578 *
6579 */
6580struct ndp_end_rsp_event {
6581 uint32_t transaction_id;
Naveen Rawatf28315c2016-06-29 18:06:02 -07006582 uint32_t status;
6583 uint32_t reason;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006584};
6585
6586/**
6587 * struct ndp_end_indication_event - ndp termination notification from FW
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07006588 * @num_ndp_ids: number of NDP ids
6589 * @ndp_map: mapping of NDP instances to peer and vdev
Ravi Joshi412f23d2016-05-26 15:09:23 -07006590 *
6591 */
6592struct ndp_end_indication_event {
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07006593 uint32_t num_ndp_ids;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006594 struct peer_ndp_map ndp_map[];
6595};
6596
6597/**
6598 * struct ndp_schedule_update_req - ndp schedule update request
6599 * @transaction_id: unique identifier
6600 * @vdev_id: session id of the interface over which ndp is being created
6601 * @ndp_instance_id: ndp instance id for which schedule update is requested
6602 * @ndp_qos: new set of qos parameters
6603 *
6604 */
6605struct ndp_schedule_update_req {
6606 uint32_t transaction_id;
6607 uint32_t vdev_id;
6608 uint32_t ndp_instance_id;
6609 struct ndp_qos_cfg ndp_qos;
6610};
6611
6612/**
6613 * struct ndp_schedule_update_rsp - ndp schedule update response
6614 * @transaction_id: unique identifier
6615 * @vdev_id: session id of the interface over which ndp is being created
6616 * @status: status of the request
6617 * @reason: reason code for failure if any
6618 *
6619 */
6620struct ndp_schedule_update_rsp {
6621 uint32_t transaction_id;
6622 uint32_t vdev_id;
6623 uint32_t status;
6624 uint32_t reason;
6625};
6626
6627/**
6628 * struct sme_ndp_peer_ind - ndp peer indication
6629 * @msg_type: message id
6630 * @msg_len: message length
6631 * @session_id: session id
6632 * @peer_mac_addr: peer mac address
6633 * @sta_id: station id
6634 *
6635 */
6636struct sme_ndp_peer_ind {
6637 uint16_t msg_type;
6638 uint16_t msg_len;
6639 uint8_t session_id;
6640 struct qdf_mac_addr peer_mac_addr;
6641 uint16_t sta_id;
6642};
6643
6644#endif /* WLAN_FEATURE_NAN_DATAPATH */
6645
Peng Xu8fdaa492016-06-22 10:20:47 -07006646/**
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05306647 * struct sir_set_tx_rx_aggregation_size - sets tx rx aggregation size
6648 * @vdev_id: vdev id of the session
Arif Hussain0e246802018-05-01 18:13:44 -07006649 * @aggr_type: TX Aggregation Type (0=A-MPDU, 1=A-MSDU)
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05306650 * @tx_aggregation_size: Tx aggregation size
Paul Zhangee09f8e2018-04-23 16:11:32 +08006651 * @tx_aggregation_size_be: Tx aggregation size for be queue
6652 * @tx_aggregation_size_bk: Tx aggregation size for bk queue
6653 * @tx_aggregation_size_vi: Tx aggregation size for vi queue
6654 * @tx_aggregation_size_vo: Tx aggregation size for vo queue
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05306655 * @rx_aggregation_size: Rx aggregation size
6656 */
6657struct sir_set_tx_rx_aggregation_size {
6658 uint8_t vdev_id;
Arif Hussain0e246802018-05-01 18:13:44 -07006659 wmi_vdev_custom_aggr_type_t aggr_type;
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05306660 uint32_t tx_aggregation_size;
Paul Zhangee09f8e2018-04-23 16:11:32 +08006661 uint32_t tx_aggregation_size_be;
6662 uint32_t tx_aggregation_size_bk;
6663 uint32_t tx_aggregation_size_vi;
6664 uint32_t tx_aggregation_size_vo;
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05306665 uint32_t rx_aggregation_size;
6666};
6667
6668/**
Paul Zhang33fae272018-04-23 16:19:00 +08006669 * struct sir_set_tx_aggr_sw_retry_threshold - set sw retry threshold
6670 * @vdev_id: vdev id of the session
6671 * @tx_aggr_sw_retry_threshold_be: sw retry threshold for BE
6672 * @tx_aggr_sw_retry_threshold_bk: sw retry threshold for BK
6673 * @tx_aggr_sw_retry_threshold_vi: sw retry threshold for VI
6674 * @tx_aggr_sw_retry_threshold_vo: sw retry threshold for VO
6675 */
6676struct sir_set_tx_aggr_sw_retry_threshold {
6677 uint8_t vdev_id;
6678 uint32_t tx_aggr_sw_retry_threshold_be;
6679 uint32_t tx_aggr_sw_retry_threshold_bk;
6680 uint32_t tx_aggr_sw_retry_threshold_vi;
6681 uint32_t tx_aggr_sw_retry_threshold_vo;
6682};
6683
6684/**
Peng Xu8fdaa492016-06-22 10:20:47 -07006685 * struct sir_p2p_lo_start - p2p listen offload start
6686 * @vdev_id: vdev identifier
6687 * @ctl_flags: control flag
6688 * @freq: p2p listen frequency
6689 * @period: listen offload period
6690 * @interval: listen offload interval
6691 * @count: number listen offload intervals
6692 * @device_types: device types
6693 * @dev_types_len: device types length
6694 * @probe_resp_tmplt: probe response template
6695 * @probe_resp_len: probe response template length
6696 */
6697struct sir_p2p_lo_start {
6698 uint32_t vdev_id;
6699 uint32_t ctl_flags;
6700 uint32_t freq;
6701 uint32_t period;
6702 uint32_t interval;
6703 uint32_t count;
6704 uint8_t *device_types;
6705 uint32_t dev_types_len;
6706 uint8_t *probe_resp_tmplt;
6707 uint32_t probe_resp_len;
6708};
6709
6710/**
6711 * struct sir_p2p_lo_event - P2P listen offload stop event
6712 * @vdev_id: vdev identifier
6713 * @reason_code: P2P listen offload stop reason
6714 */
6715struct sir_p2p_lo_event {
6716 uint32_t vdev_id;
6717 uint32_t reason_code;
6718};
Manjeet Singhf82ed072016-07-08 11:40:00 +05306719
6720/**
6721 * struct sir_hal_pwr_dbg_cmd - unit test command parameters
6722 * @pdev_id: pdev id
6723 * @module_id: module id
6724 * @num_args: number of arguments
6725 * @args: arguments
6726 */
6727struct sir_mac_pwr_dbg_cmd {
6728 uint32_t pdev_id;
6729 uint32_t module_id;
6730 uint32_t num_args;
6731 uint32_t args[MAX_POWER_DBG_ARGS_SUPPORTED];
6732};
6733
Kondabattini, Ganesh3f2d02c2016-09-13 12:23:47 +05306734/**
6735 * struct sme_send_disassoc_frm_req - send disassoc request frame
6736 * @msg_type: message type
6737 * @length: length of message
6738 * @session_id: session id
6739 * @trans_id: transaction id
6740 * @peer_mac: peer mac address
6741 * @reason: reason for disassoc
6742 * @wait_for_ack: wait for acknowledgment
6743 **/
6744 struct sme_send_disassoc_frm_req {
6745 uint16_t msg_type;
6746 uint16_t length;
6747 uint8_t session_id;
6748 uint16_t trans_id;
6749 uint8_t peer_mac[6];
6750 uint16_t reason;
6751 uint8_t wait_for_ack;
6752 };
6753
Kondabattini, Ganeshe4f18e02016-09-13 13:01:22 +05306754/**
6755 * struct sme_update_access_policy_vendor_ie - update vendor ie and access
6756 * policy
6757 * @msg_type: message id
6758 * @msg_len: message length
6759 * @sme_session_id: sme session id
6760 * @ie: vendor ie
6761 * @access_policy: access policy for vendor ie
6762 */
6763struct sme_update_access_policy_vendor_ie {
6764 uint16_t msg_type;
6765 uint16_t length;
6766 uint32_t sme_session_id;
6767 uint8_t ie[SIR_MAC_MAX_IE_LENGTH];
6768 uint8_t access_policy;
6769};
6770
Padma, Santhosh Kumard7cc0792016-06-28 18:54:12 +05306771/**
6772 * struct sir_encrypt_decrypt_rsp_params - encrypt/decrypt rsp params
6773 * @vdev_id: vdev id
6774 * @status: status
6775 * @data_length: data length
6776 * @data: data pointer
6777 */
6778struct sir_encrypt_decrypt_rsp_params {
6779 uint32_t vdev_id;
6780 int32_t status;
6781 uint32_t data_length;
6782 uint8_t *data;
6783};
6784
Agrawal, Ashish35b251d2016-09-08 19:21:03 +05306785/**
6786 * struct sme_tx_fail_cnt_threshold - tx failure count for disconnect to fw
6787 * @session_id: Session id
6788 * @tx_fail_cnt_threshold: Tx failure count to do disconnect
6789 */
6790struct sme_tx_fail_cnt_threshold {
6791 uint8_t session_id;
6792 uint32_t tx_fail_cnt_threshold;
6793};
Agrawal Ashishda3e9502016-09-21 17:43:51 +05306794
6795/**
6796 * struct sme_short_retry_limit - transmission retry limit for short frames.
6797 * @session_id: Session id
6798 * @short_retry_limit: tranmission retry limit for short frame.
6799 *
6800 */
6801struct sme_short_retry_limit {
6802 uint8_t session_id;
6803 uint32_t short_retry_limit;
6804};
6805
6806/**
6807 * struct sme_long_retry_limit - tranmission retry limit for long frames
6808 * @session_id: Session id
6809 * @short_retry_limit: tranmission retry limit for long frames.
6810 *
6811 */
6812struct sme_long_retry_limit {
6813 uint8_t session_id;
6814 uint32_t long_retry_limit;
6815};
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05306816
6817/**
Kiran Kumar Lokere08195ef2018-01-17 19:25:15 -08006818 * struct sme_addba_accept - Allow/reject the addba request frame
6819 * @session_id: Session id
6820 * @addba_accept: Allow/reject the addba request frame
6821 */
6822struct sme_addba_accept {
6823 uint8_t session_id;
6824 uint8_t addba_accept;
6825};
6826
6827/**
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05306828 * struct sme_sta_inactivity_timeout - set sta_inactivity_timeout
6829 * @session_id: session Id.
6830 * @sta_inactivity_timeout: Timeout to disconnect STA after there
6831 * is no activity.
6832 */
6833struct sme_sta_inactivity_timeout {
6834 uint8_t session_id;
6835 uint32_t sta_inactivity_timeout;
6836};
Yingying Tang95409972016-10-20 15:16:15 +08006837
6838/*
6839 * struct wow_pulse_mode - WoW Pulse set cmd struct
6840 * @wow_pulse_enable: enable or disable this feature
6841 * @wow_pulse_pin: GPIO PIN for Pulse
6842 * @wow_pulse_interval_low: Pulse interval low
6843 * @wow_pulse_interval_high: Pulse interval high
6844 *
6845 * SME uses this structure to configure wow pulse info
6846 * and send it to WMA
6847 */
6848struct wow_pulse_mode {
6849 bool wow_pulse_enable;
6850 uint8_t wow_pulse_pin;
6851 uint16_t wow_pulse_interval_high;
6852 uint16_t wow_pulse_interval_low;
6853};
6854
Rajeev Kumare406d652017-01-30 17:47:05 -08006855
6856/**
Rajeev Kumard138ac52017-01-30 18:38:37 -08006857 * umac_send_mb_message_to_mac(): post message to umac
Rajeev Kumare406d652017-01-30 17:47:05 -08006858 * @msg: opaque message pointer
6859 *
6860 * Return: QDF status
6861 */
Rajeev Kumard138ac52017-01-30 18:38:37 -08006862QDF_STATUS umac_send_mb_message_to_mac(void *msg);
Rajeev Kumare406d652017-01-30 17:47:05 -08006863
Kapil Gupta4f0c0c12017-02-07 15:21:15 +05306864/**
6865 * struct scan_chan_info - channel info
6866 * @freq: radio frequence
6867 * @cmd flag: cmd flag
6868 * @noise_floor: noise floor
6869 * @cycle_count: cycle count
6870 * @rx_clear_count: rx clear count
6871 * @tx_frame_count: TX frame count
6872 * @clock_freq: clock frequence MHZ
6873 */
6874struct scan_chan_info {
6875 uint32_t freq;
6876 uint32_t cmd_flag;
6877 uint32_t noise_floor;
6878 uint32_t cycle_count;
6879 uint32_t rx_clear_count;
6880 uint32_t tx_frame_count;
6881 uint32_t clock_freq;
6882};
Dustin Brown54096432017-02-23 13:00:44 -08006883
6884/**
6885 * enum wow_resume_trigger - resume trigger override setting values
6886 * @WOW_RESUME_TRIGGER_DEFAULT: fw to use platform default resume trigger
6887 * @WOW_RESUME_TRIGGER_HTC_WAKEUP: force fw to use HTC Wakeup to resume
6888 * @WOW_RESUME_TRIGGER_GPIO: force fw to use GPIO to resume
6889 * @WOW_RESUME_TRIGGER_COUNT: number of resume trigger options
6890 */
6891enum wow_resume_trigger {
6892 /* always first */
6893 WOW_RESUME_TRIGGER_DEFAULT = 0,
6894 WOW_RESUME_TRIGGER_HTC_WAKEUP,
6895 WOW_RESUME_TRIGGER_GPIO,
6896 /* always last */
6897 WOW_RESUME_TRIGGER_COUNT
6898};
6899
6900/**
6901 * enum wow_interface_pause - interface pause override setting values
6902 * @WOW_INTERFACE_PAUSE_DEFAULT: use platform default interface pause setting
6903 * @WOW_INTERFACE_PAUSE_ENABLE: force interface pause setting to enabled
6904 * @WOW_INTERFACE_PAUSE_DISABLE: force interface pause setting to disabled
6905 * @WOW_INTERFACE_PAUSE_COUNT: number of interface pause options
6906 */
6907enum wow_interface_pause {
6908 /* always first */
6909 WOW_INTERFACE_PAUSE_DEFAULT = 0,
6910 WOW_INTERFACE_PAUSE_ENABLE,
6911 WOW_INTERFACE_PAUSE_DISABLE,
6912 /* always last */
6913 WOW_INTERFACE_PAUSE_COUNT
6914};
6915
6916/**
6917 * struct wow_enable_params - A collection of wow enable override parameters
6918 * @is_unit_test: true to notify fw this is a unit-test suspend
6919 * @interface_pause: used to override the interface pause indication sent to fw
6920 * @resume_trigger: used to force fw to use a particular resume method
6921 */
6922struct wow_enable_params {
6923 bool is_unit_test;
6924 enum wow_interface_pause interface_pause;
6925 enum wow_resume_trigger resume_trigger;
6926};
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07006927
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08006928#define HE_LTF_1X 0
6929#define HE_LTF_2X 1
6930#define HE_LTF_4X 2
6931
6932#define HE_LTF_ALL 0x7
6933#define HE_SGI_MASK 0xFF00
6934
6935#define AUTO_RATE_GI_400NS 8
6936#define AUTO_RATE_GI_800NS 9
6937#define AUTO_RATE_GI_1600NS 10
6938#define AUTO_RATE_GI_3200NS 11
6939
6940#define SET_AUTO_RATE_SGI_VAL(set_val, bit_mask) \
6941 (set_val = (set_val & HE_LTF_ALL) | bit_mask)
6942
6943#define SET_AUTO_RATE_HE_LTF_VAL(set_val, bit_mask) \
6944 (set_val = (set_val & HE_SGI_MASK) | bit_mask)
6945
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07006946#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -07006947#define HE_CAP_OUI_TYPE "\x23"
6948#define HE_CAP_OUI_SIZE 1
6949#define HE_OP_OUI_TYPE "\x24"
6950#define HE_OP_OUI_SIZE 1
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08006951
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07006952#define HE_RU_ALLOC_INDX0_MASK (0x01 << 0)
6953#define HE_RU_ALLOC_INDX1_MASK (0x01 << 1)
6954#define HE_RU_ALLOC_INDX2_MASK (0x01 << 2)
6955#define HE_RU_ALLOC_INDX3_MASK (0x01 << 3)
6956
6957/* 3 bits for NSS and 4 bits for RU Index */
6958#define HE_PPET_NSS_LEN 3
6959#define HE_PEPT_RU_IDX_LEN 4
6960#define HE_PPET_NSS_RU_LEN (HE_PPET_NSS_LEN + HE_PEPT_RU_IDX_LEN)
6961#define HE_PPET_SIZE 3
6962#define HE_BYTE_SIZE 8
6963
Naveen Rawat819158d2018-01-16 10:56:45 -08006964struct ppet_hdr {
6965 uint8_t nss:3;
6966 uint8_t ru_idx_mask:4;
6967 uint8_t remaining:1;
6968};
6969
6970/* MAX PPET size = 7 bits + (max_nss X max_ru_number X 6) = 25 bytes */
6971#define HE_MAX_PPET_SIZE WNI_CFG_HE_PPET_LEN
6972
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -08006973#define HE_MAX_PHY_CAP_SIZE 3
6974
Naveen Rawataeca1b92017-10-16 16:55:31 -07006975#define HE_CH_WIDTH_GET_BIT(ch_wd, bit) (((ch_wd) >> (bit)) & 1)
6976#define HE_CH_WIDTH_COMBINE(b0, b1, b2, b3, b4, b5, b6) \
6977 ((uint8_t)(b0) | ((b1) << 1) | ((b2) << 2) | ((b3) << 3) | \
6978 ((b4) << 4) | ((b5) << 5) | ((b6) << 6))
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -07006979
Naveen Rawataeca1b92017-10-16 16:55:31 -07006980/*
6981 * MCS values are interpreted as in IEEE 11ax-D1.4 spec onwards
6982 * +-----------------------------------------------------+
6983 * | SS8 | SS7 | SS6 | SS5 | SS4 | SS3 | SS2 | SS1 |
6984 * +-----------------------------------------------------+
6985 * | 15-14 | 13-12 | 11-10 | 9-8 | 7-6 | 5-4 | 3-2 | 1-0 |
6986 * +-----------------------------------------------------+
6987 */
6988#define HE_MCS_NSS_SHIFT(nss) (((nss) - 1) << 1)
6989#define HE_MCS_MSK_4_NSS(nss) (3 << HE_MCS_NSS_SHIFT(nss))
6990#define HE_MCS_INV_MSK_4_NSS(nss) (~HE_MCS_MSK_4_NSS(nss))
6991#define HE_GET_MCS_4_NSS(mcs_set, nss) \
6992 (((mcs_set) >> HE_MCS_NSS_SHIFT(nss)) & 3)
6993#define HE_SET_MCS_4_NSS(mcs_set, mcs, nss) \
6994 (((mcs_set) & HE_MCS_INV_MSK_4_NSS(nss)) | \
6995 ((mcs) << HE_MCS_NSS_SHIFT(nss)))
6996#define HE_MCS_IS_NSS_ENABLED(mcs_set, nss) \
6997 ((HE_MCS_MSK_4_NSS(nss) & (mcs_set)) != HE_MCS_MSK_4_NSS(nss))
6998
6999#define HE_MCS_ALL_DISABLED 0xFFFF
Kiran Kumar Lokere59a569e2018-01-24 15:00:50 -08007000
7001#define HE_MCS_0_7 0x0
7002#define HE_MCS_0_9 0x1
7003#define HE_MCS_0_11 0x2
7004#define HE_MCS_DISABLE 0x3
Kiran Kumar Lokerea006a302018-03-07 20:58:13 -08007005
Naveen Rawataeca1b92017-10-16 16:55:31 -07007006/*
7007 * Following formuala has been arrived at using karnaugh map and unit tested
7008 * with sample code. Take MCS for each NSS as 2 bit value first and solve for
7009 * 2 bit intersection of NSS. Use following table/Matrix as guide for solving
7010 * K-Maps
7011 * MCS 1\MCS 2 00 01 10 11
7012 * 00 00 00 00 11
7013 * 01 00 01 01 11
7014 * 10 00 01 10 11
7015 * 11 11 11 11 11
7016 * if output MCS is o1o0, then as per K-map reduction:
7017 * o0 = m1.m0 | n1.n0 | (~m1).m0.(n1^n0) | (~n1).n0.(m1^m0)
7018 * o1 = m1.m0 | n1.n0 | m1.(~m0).n1.(~n0)
7019 *
7020 * Please note: Calculating MCS intersection is 80211 protocol specific and
7021 * should be implemented in PE. WMA can use this macro rather than calling any
7022 * lim API to do the intersection.
7023 */
7024#define HE_INTERSECT_MCS_BITS_PER_NSS(m1, m0, n1, n0) \
7025 (((m1 & m0) | (n1 & n0) | (((~m1) & m0) & (n1 ^ n0)) | \
7026 (((~n1) & n0) & (m1 ^ m0))) | (((m1 & m0) | (n1 & n0) | \
7027 (m1 & ~m0 & n1 & ~n0)) << 1))
7028
7029/* following takes MCS as 2 bits */
7030#define HE_INTERSECT_MCS_PER_NSS(mcs_1, mcs_2) \
7031 HE_INTERSECT_MCS_BITS_PER_NSS((mcs_1 >> 1), (mcs_1 & 1), \
7032 (mcs_2 >> 1), (mcs_2 & 1))
7033
7034/* following takes MCS as 16 bits */
7035#define HE_INTERSECT_MCS(mcs_1, mcs_2) ( \
7036 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 1), \
7037 HE_GET_MCS_4_NSS(mcs_2, 1)) << HE_MCS_NSS_SHIFT(1) | \
7038 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 2), \
7039 HE_GET_MCS_4_NSS(mcs_2, 2)) << HE_MCS_NSS_SHIFT(2) | \
7040 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 3), \
7041 HE_GET_MCS_4_NSS(mcs_2, 3)) << HE_MCS_NSS_SHIFT(3) | \
7042 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 4), \
7043 HE_GET_MCS_4_NSS(mcs_2, 4)) << HE_MCS_NSS_SHIFT(4) | \
7044 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 5), \
7045 HE_GET_MCS_4_NSS(mcs_2, 5)) << HE_MCS_NSS_SHIFT(5) | \
7046 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 6), \
7047 HE_GET_MCS_4_NSS(mcs_2, 6)) << HE_MCS_NSS_SHIFT(6) | \
7048 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 7), \
7049 HE_GET_MCS_4_NSS(mcs_2, 7)) << HE_MCS_NSS_SHIFT(7) | \
7050 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 8), \
7051 HE_GET_MCS_4_NSS(mcs_2, 8)) << HE_MCS_NSS_SHIFT(8))
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -07007052
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -08007053/**
7054 * struct he_capability - to store 11ax HE capabilities
7055 * @phy_cap: HE PHY capabilities
7056 * @mac_cap: HE MAC capabilities
7057 * @mcs: HE MCS
7058 * @ppet: HE PPE threshold
7059 */
7060struct he_capability {
7061 uint32_t phy_cap[HE_MAX_PHY_CAP_SIZE];
7062 uint32_t mac_cap;
7063 uint32_t mcs;
7064 struct wlan_psoc_host_ppe_threshold ppet;
7065};
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07007066#endif
7067
Naveen Rawataeca1b92017-10-16 16:55:31 -07007068#define HE_GET_NSS(mcs, nss) \
7069 do { \
7070 (nss) = 0; \
Naveen Rawatcbcc6542017-10-30 17:55:03 -07007071 while ((((mcs) >> ((nss)*2)) & 3) != 3 && nss < 8) \
Naveen Rawataeca1b92017-10-16 16:55:31 -07007072 (nss)++; \
7073 } while (0)
7074
Nitesh Shah99dd9552017-03-20 19:27:47 +05307075/**
7076 * struct sir_del_all_tdls_peers - delete all tdls peers
7077 * @msg_type: type of message
7078 * @msg_len: length of message
7079 * @bssid: bssid of peer device
7080 */
7081struct sir_del_all_tdls_peers {
7082 uint16_t msg_type;
7083 uint16_t msg_len;
7084 struct qdf_mac_addr bssid;
7085};
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08007086
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05307087/**
7088 * struct rsp_stats - arp packet stats
7089 * @arp_req_enqueue: fw tx count
7090 * @arp_req_tx_success: tx ack count
7091 * @arp_req_tx_failure: tx ack fail count
7092 * @arp_rsp_recvd: rx fw count
7093 * @out_of_order_arp_rsp_drop_cnt: out of order count
7094 * @dad_detected: dad detected
7095 * @connect_status: connection status
7096 * @ba_session_establishment_status: BA session status
Poddar, Siddarth465330e2018-01-08 18:23:54 +05307097 * @connect_stats_present: connectivity stats present or not
7098 * @tcp_ack_recvd: tcp syn ack's count
7099 * @icmpv4_rsp_recvd: icmpv4 responses count
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05307100 */
7101struct rsp_stats {
7102 uint32_t vdev_id;
7103 uint32_t arp_req_enqueue;
7104 uint32_t arp_req_tx_success;
7105 uint32_t arp_req_tx_failure;
7106 uint32_t arp_rsp_recvd;
7107 uint32_t out_of_order_arp_rsp_drop_cnt;
7108 uint32_t dad_detected;
7109 uint32_t connect_status;
7110 uint32_t ba_session_establishment_status;
Poddar, Siddarth465330e2018-01-08 18:23:54 +05307111 bool connect_stats_present;
7112 uint32_t tcp_ack_recvd;
7113 uint32_t icmpv4_rsp_recvd;
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05307114};
7115
7116/**
7117 * struct set_arp_stats_params - set/reset arp stats
7118 * @vdev_id: session id
7119 * @flag: enable/disable stats
7120 * @pkt_type: type of packet(1 - arp)
7121 * @ip_addr: subnet ipv4 address in case of encrypted packets
Poddar, Siddarth465330e2018-01-08 18:23:54 +05307122 * @pkt_type_bitmap: pkt bitmap
7123 * @tcp_src_port: tcp src port for pkt tracking
7124 * @tcp_dst_port: tcp dst port for pkt tracking
7125 * @icmp_ipv4: target ipv4 address to track ping packets
7126 * @reserved: reserved
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05307127 */
7128struct set_arp_stats_params {
7129 uint32_t vdev_id;
7130 uint8_t flag;
7131 uint8_t pkt_type;
7132 uint32_t ip_addr;
Poddar, Siddarth465330e2018-01-08 18:23:54 +05307133 uint32_t pkt_type_bitmap;
7134 uint32_t tcp_src_port;
7135 uint32_t tcp_dst_port;
7136 uint32_t icmp_ipv4;
7137 uint32_t reserved;
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05307138};
7139
7140/**
7141 * struct get_arp_stats_params - get arp stats from firmware
7142 * @pkt_type: packet type(1 - ARP)
7143 * @vdev_id: session id
7144 */
7145struct get_arp_stats_params {
7146 uint8_t pkt_type;
7147 uint32_t vdev_id;
7148};
7149
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05307150typedef void (*sme_rcpi_callback)(void *context, struct qdf_mac_addr mac_addr,
7151 int32_t rcpi, QDF_STATUS status);
7152/**
7153 * struct sme_rcpi_req - structure for querying rcpi info
7154 * @session_id: session for which rcpi is required
7155 * @measurement_type: type of measurement from enum rcpi_measurement_type
7156 * @rcpi_callback: callback function to be invoked for rcpi response
7157 * @rcpi_context: context info for rcpi callback
7158 * @mac_addr: peer addr for which rcpi is required
7159 */
7160struct sme_rcpi_req {
7161 uint32_t session_id;
7162 enum rcpi_measurement_type measurement_type;
7163 sme_rcpi_callback rcpi_callback;
7164 void *rcpi_context;
7165 struct qdf_mac_addr mac_addr;
7166};
7167
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08007168/*
7169 * @SCAN_REJECT_DEFAULT: default value
7170 * @CONNECTION_IN_PROGRESS: connection is in progress
7171 * @REASSOC_IN_PROGRESS: reassociation is in progress
7172 * @EAPOL_IN_PROGRESS: STA/P2P-CLI is in middle of EAPOL/WPS exchange
7173 * @SAP_EAPOL_IN_PROGRESS: SAP/P2P-GO is in middle of EAPOL/WPS exchange
7174 */
7175enum scan_reject_states {
7176 SCAN_REJECT_DEFAULT = 0,
7177 CONNECTION_IN_PROGRESS,
7178 REASSOC_IN_PROGRESS,
7179 EAPOL_IN_PROGRESS,
7180 SAP_EAPOL_IN_PROGRESS,
7181};
Sandeep Puligillaf587adf2017-04-27 19:53:21 -07007182
7183/**
lifeng66831662017-05-19 16:01:35 +08007184 * sir_sme_rx_aggr_hole_ind - sme rx aggr hole indication
7185 * @hole_cnt: num of holes detected
7186 * @hole_info_array: hole info
7187 */
7188struct sir_sme_rx_aggr_hole_ind {
7189 uint32_t hole_cnt;
7190 uint32_t hole_info_array[];
7191};
7192
7193/**
7194 * struct sir_set_rx_reorder_timeout_val - rx reorder timeout
7195 * @rx_timeout_pri: reorder timeout for AC
7196 * rx_timeout_pri[0] : AC_VO
7197 * rx_timeout_pri[1] : AC_VI
7198 * rx_timeout_pri[2] : AC_BE
7199 * rx_timeout_pri[3] : AC_BK
7200 */
7201struct sir_set_rx_reorder_timeout_val {
7202 uint32_t rx_timeout_pri[4];
7203};
7204
7205/**
7206 * struct sir_peer_set_rx_blocksize - set rx blocksize
7207 * @vdev_id: vdev id
7208 * @peer_macaddr: peer mac address
7209 * @rx_block_ack_win_limit: windows size limitation
7210 */
7211struct sir_peer_set_rx_blocksize {
7212 uint32_t vdev_id;
7213 struct qdf_mac_addr peer_macaddr;
7214 uint32_t rx_block_ack_win_limit;
7215};
Abhishek Singhf3756fc2017-06-28 16:04:06 +05307216
7217/**
7218 * struct sir_rssi_disallow_lst - Structure holding Rssi based avoid candidate
7219 * list
7220 * @node: Node pointer
7221 * @bssid: BSSID of the AP
7222 * @retry_delay: Retry delay received during last rejection in ms
7223 * @ expected_rssi: RSSI at which STA can initate
7224 * @time_during_rejection: Timestamp during last rejection in millisec
7225 */
7226struct sir_rssi_disallow_lst {
7227 qdf_list_node_t node;
7228 struct qdf_mac_addr bssid;
7229 uint32_t retry_delay;
7230 int8_t expected_rssi;
7231 qdf_time_t time_during_rejection;
7232};
lifengd217d192017-05-09 19:44:16 +08007233
7234/**
7235 * struct chain_rssi_result - chain rssi result
Jeff Johnson00634ab2018-05-10 14:27:50 -07007236 * num_chains_valid: valid chain num
lifengd217d192017-05-09 19:44:16 +08007237 * @chain_rssi: chain rssi result as dBm unit
lifengfe6c3e22018-04-03 12:10:04 +08007238 * @ant_id: antenna id
lifengd217d192017-05-09 19:44:16 +08007239 */
lifengfe6c3e22018-04-03 12:10:04 +08007240#define CHAIN_MAX_NUM 8
lifengd217d192017-05-09 19:44:16 +08007241struct chain_rssi_result {
lifengfe6c3e22018-04-03 12:10:04 +08007242 uint32_t num_chains_valid;
7243 uint32_t chain_rssi[CHAIN_MAX_NUM];
7244 uint32_t ant_id[CHAIN_MAX_NUM];
lifengd217d192017-05-09 19:44:16 +08007245};
7246
7247/**
7248 * struct get_chain_rssi_req_params - get chain rssi req params
7249 * @peer_macaddr: specific peer mac address
7250 * @session_id: session id
7251 */
7252struct get_chain_rssi_req_params {
7253 struct qdf_mac_addr peer_macaddr;
7254 uint8_t session_id;
7255};
7256
Ganesh Kondabattini35739572017-06-21 16:26:39 +05307257/*
7258 * struct sir_limit_off_chan - limit off-channel command parameters
7259 * @vdev_id: vdev id
7260 * @is_tos_active: status of the traffic (active/inactive)
7261 * @max_off_chan_time: max allowed off channel time
7262 * @rest_time: home channel time
7263 * @skip_dfs_chans: skip dfs channels during scan
7264 */
7265struct sir_limit_off_chan {
7266 uint8_t vdev_id;
7267 bool is_tos_active;
7268 uint32_t max_off_chan_time;
7269 uint32_t rest_time;
7270 bool skip_dfs_chans;
7271};
Padma, Santhosh Kumarb38ab512018-01-16 16:16:46 +05307272
7273/**
7274 * struct sae_info - SAE info used for commit/confirm messages
7275 * @msg_type: Message type
7276 * @msg_len: length of message
7277 * @vdev_id: vdev id
7278 * @peer_mac_addr: peer MAC address
7279 * @ssid: SSID
7280 */
7281struct sir_sae_info {
7282 uint16_t msg_type;
7283 uint16_t msg_len;
7284 uint32_t vdev_id;
7285 struct qdf_mac_addr peer_mac_addr;
7286 tSirMacSSid ssid;
7287};
Padma, Santhosh Kumardd3f4852018-01-16 18:51:51 +05307288
7289/**
7290 * struct sir_sae_msg - SAE msg used for message posting
7291 * @message_type: message type
7292 * @length: message length
7293 * @session_id: SME session id
7294 * @sae_status: SAE status, 0: Success, Non-zero: Failure.
7295 */
7296struct sir_sae_msg {
7297 uint16_t message_type;
7298 uint16_t length;
7299 uint16_t session_id;
7300 uint8_t sae_status;
7301};
7302
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08007303#endif /* __SIR_API_H */