blob: 917c01225df07c40c57be0d101eff01ffb36ccdf [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 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28/*
29 * This file sir_api.h contains definitions exported by
30 * Sirius software.
31 * Author: Chandra Modumudi
32 * Date: 04/16/2002
33 * History:-
34 * Date Modified by Modification Information
35 * --------------------------------------------------------------------
36 */
37
38#ifndef __SIR_API_H
39#define __SIR_API_H
40
Anurag Chouhan5de8d172016-07-13 14:44:28 +053041
42/* Take care to avoid redefinition of this type, if it is */
43/* already defined in "halWmmApi.h" */
44#if !defined(_HALMAC_WMM_API_H)
45typedef struct sAniSirGlobal *tpAniSirGlobal;
46#endif
47
Amar Singhale4f28ee2015-10-21 14:36:56 -070048#include "qdf_types.h"
Amar Singhale4f28ee2015-10-21 14:36:56 -070049#include "cds_regdomain.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080050#include "sir_types.h"
51#include "sir_mac_prot_def.h"
52#include "ani_system_defs.h"
53#include "sir_params.h"
Naveen Rawat3b6068c2016-04-14 19:01:06 -070054#include "cds_regdomain.h"
Dustin Brown877a5a92016-11-17 13:56:52 -080055#include "wmi_unified.h"
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +053056#include "wmi_unified_param.h"
Zhang Qiana6e9c102016-12-22 16:47:24 +080057#include "ol_txrx_htt_api.h"
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -070058#include "wlan_reg_services_api.h"
Anurag Chouhan5de8d172016-07-13 14:44:28 +053059#include <dot11f.h>
Tushnim Bhattacharyya9e81b4c2017-02-15 17:11:14 -080060#include "wlan_policy_mgr_api.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080061
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -080062#define SIR_MAX_SUPPORTED_BSS 5
63
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080064#define OFFSET_OF(structType, fldName) (&((structType *)0)->fldName)
65
66/* / Max supported channel list */
67#define SIR_MAX_SUPPORTED_CHANNEL_LIST 96
68
69#define SIR_MDIE_ELEMENT_ID 54
Srinivas Girigowdad65dc5a2016-01-14 17:08:26 -080070#define SIR_MDIE_SIZE 3 /* MD ID(2 bytes), Capability(1 byte) */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080071
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +053072#define SIR_MAX_ELEMENT_ID 255
73
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080074/* Increase dwell time for P2P search in ms */
75#define P2P_SEARCH_DWELL_TIME_INCREASE 20
76#define P2P_SOCIAL_CHANNELS 3
77
78/* Max number of channels are 165, but to access 165th element of array,
79 *array of 166 is required.
80 */
81#define SIR_MAX_24G_5G_CHANNEL_RANGE 166
82#define SIR_BCN_REPORT_MAX_BSS_DESC 4
83
84#define SIR_NUM_11B_RATES 4 /* 1,2,5.5,11 */
85#define SIR_NUM_11A_RATES 8 /* 6,9,12,18,24,36,48,54 */
86
87#define SIR_PM_SLEEP_MODE 0
88#define SIR_PM_ACTIVE_MODE 1
89
90/* hidden SSID options */
91#define SIR_SCAN_NO_HIDDEN_SSID 0
92#define SIR_SCAN_HIDDEN_SSID_PE_DECISION 1
93
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080094#define SIR_IPV4_ADDR_LEN 4
95
96typedef uint8_t tSirIpv4Addr[SIR_IPV4_ADDR_LEN];
97
98#define SIR_VERSION_STRING_LEN 64
99typedef uint8_t tSirVersionString[SIR_VERSION_STRING_LEN];
100
101/* Periodic Tx pattern offload feature */
102#define PERIODIC_TX_PTRN_MAX_SIZE 1536
103#define MAXNUM_PERIODIC_TX_PTRNS 6
104#define WIFI_SCANNING_MAC_OUI_LENGTH 3
105
106#ifdef FEATURE_WLAN_EXTSCAN
107
108#define WLAN_EXTSCAN_MAX_CHANNELS 36
109#define WLAN_EXTSCAN_MAX_BUCKETS 16
110#define WLAN_EXTSCAN_MAX_HOTLIST_APS 128
111#define WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS 64
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800112
113/* This should not be greater than MAX_NUMBER_OF_CONC_CONNECTIONS */
114#define MAX_VDEV_SUPPORTED 4
115
Manjeet Singhf82ed072016-07-08 11:40:00 +0530116#define MAX_POWER_DBG_ARGS_SUPPORTED 8
Agrawal Ashishad16bda2016-09-16 20:16:04 +0530117#define QOS_MAP_MAX_EX 21
118#define QOS_MAP_LEN_MIN 16
119#define QOS_MAP_LEN_MAX \
120 (QOS_MAP_LEN_MIN + 2 * QOS_MAP_MAX_EX)
Himanshu Agarwal37e42412016-07-21 14:35:09 +0530121#define NUM_CHAINS_MAX 2
122
Abhishek Singhf3756fc2017-06-28 16:04:06 +0530123#define MAX_RSSI_AVOID_BSSID_LIST 10
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530124
125/* Maximum number of realms present in fils indication element */
126#define SIR_MAX_REALM_COUNT 7
127/* Realm length */
128#define SIR_REALM_LEN 2
129/* Cache ID length */
130#define CACHE_ID_LEN 2
131
Will Huang496b36c2017-07-11 16:38:50 +0800132/* Maximum peer station number query one time */
133#define MAX_PEER_STA 12
134
Naveen Rawatb0c5b6b2017-11-27 17:37:40 -0800135/* Maximum number of peers for SAP */
136#define SIR_SAP_MAX_NUM_PEERS 32
137
Chandrasekaran, Manishekaref70c0d2015-10-20 19:54:55 +0530138/**
Chandrasekaran, Manishekarce2172e2016-02-18 16:12:43 +0530139 * enum sir_conn_update_reason: Reason for conc connection update
140 * @SIR_UPDATE_REASON_SET_OPER_CHAN: Set probable operating channel
141 * @SIR_UPDATE_REASON_JOIN_IBSS: Join IBSS
142 * @SIR_UPDATE_REASON_UT: Unit test related
143 * @SIR_UPDATE_REASON_START_AP: Start AP
144 * @SIR_UPDATE_REASON_NORMAL_STA: Connection to Normal STA
145 * @SIR_UPDATE_REASON_HIDDEN_STA: Connection to Hidden STA
146 * @SIR_UPDATE_REASON_OPPORTUNISTIC: Opportunistic HW mode update
147 * @SIR_UPDATE_REASON_NSS_UPDATE: NSS update
148 * @SIR_UPDATE_REASON_CHANNEL_SWITCH: Channel switch
149 * @SIR_UPDATE_REASON_CHANNEL_SWITCH_STA: Channel switch for STA
Chandrasekaran, Manishekaref70c0d2015-10-20 19:54:55 +0530150 */
Chandrasekaran, Manishekarce2172e2016-02-18 16:12:43 +0530151enum sir_conn_update_reason {
152 SIR_UPDATE_REASON_SET_OPER_CHAN,
153 SIR_UPDATE_REASON_JOIN_IBSS,
154 SIR_UPDATE_REASON_UT,
155 SIR_UPDATE_REASON_START_AP,
156 SIR_UPDATE_REASON_NORMAL_STA,
157 SIR_UPDATE_REASON_HIDDEN_STA,
158 SIR_UPDATE_REASON_OPPORTUNISTIC,
159 SIR_UPDATE_REASON_NSS_UPDATE,
160 SIR_UPDATE_REASON_CHANNEL_SWITCH,
161 SIR_UPDATE_REASON_CHANNEL_SWITCH_STA,
Manishekar Chandrasekaran9e8c7be2016-08-03 14:57:14 +0530162 SIR_UPDATE_REASON_PRE_CAC,
Chandrasekaran, Manishekaref70c0d2015-10-20 19:54:55 +0530163};
164
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800165typedef enum {
166 eSIR_EXTSCAN_INVALID,
167 eSIR_EXTSCAN_START_RSP,
168 eSIR_EXTSCAN_STOP_RSP,
169 eSIR_EXTSCAN_CACHED_RESULTS_RSP,
170 eSIR_EXTSCAN_SET_BSSID_HOTLIST_RSP,
171 eSIR_EXTSCAN_RESET_BSSID_HOTLIST_RSP,
172 eSIR_EXTSCAN_SET_SIGNIFICANT_WIFI_CHANGE_RSP,
173 eSIR_EXTSCAN_RESET_SIGNIFICANT_WIFI_CHANGE_RSP,
174
175 eSIR_EXTSCAN_GET_CAPABILITIES_IND,
176 eSIR_EXTSCAN_HOTLIST_MATCH_IND,
177 eSIR_EXTSCAN_SIGNIFICANT_WIFI_CHANGE_RESULTS_IND,
178 eSIR_EXTSCAN_CACHED_RESULTS_IND,
179 eSIR_EXTSCAN_SCAN_RES_AVAILABLE_IND,
180 eSIR_EXTSCAN_SCAN_PROGRESS_EVENT_IND,
181 eSIR_EXTSCAN_FULL_SCAN_RESULT_IND,
182 eSIR_EPNO_NETWORK_FOUND_IND,
183 eSIR_PASSPOINT_NETWORK_FOUND_IND,
184 eSIR_EXTSCAN_SET_SSID_HOTLIST_RSP,
185 eSIR_EXTSCAN_RESET_SSID_HOTLIST_RSP,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800186
187 /* Keep this last */
188 eSIR_EXTSCAN_CALLBACK_TYPE_MAX,
189} tSirExtScanCallbackType;
190
191#endif /* FEATURE_WLAN_EXTSCAN */
192
193#define SIR_KRK_KEY_LEN 16
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800194#define SIR_BTK_KEY_LEN 32
195#define SIR_KCK_KEY_LEN 16
196#define SIR_KEK_KEY_LEN 16
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +0530197#define SIR_KEK_KEY_LEN_FILS 64
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800198#define SIR_REPLAY_CTR_LEN 8
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +0530199#define SIR_PMK_LEN 48
200#define SIR_PMKID_LEN 16
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -0800201#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800202#define SIR_UAPSD_BITOFFSET_ACVO 0
203#define SIR_UAPSD_BITOFFSET_ACVI 1
204#define SIR_UAPSD_BITOFFSET_ACBK 2
205#define SIR_UAPSD_BITOFFSET_ACBE 3
206
207#define SIR_UAPSD_FLAG_ACVO (1 << SIR_UAPSD_BITOFFSET_ACVO)
208#define SIR_UAPSD_FLAG_ACVI (1 << SIR_UAPSD_BITOFFSET_ACVI)
209#define SIR_UAPSD_FLAG_ACBK (1 << SIR_UAPSD_BITOFFSET_ACBK)
210#define SIR_UAPSD_FLAG_ACBE (1 << SIR_UAPSD_BITOFFSET_ACBE)
211#define SIR_UAPSD_GET(ac, mask) (((mask) & (SIR_UAPSD_FLAG_ ## ac)) >> SIR_UAPSD_BITOFFSET_ ## ac)
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800212
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800213#endif
214
215/**
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700216 * enum sir_roam_op_code - Operation to be done by the callback.
217 * @SIR_ROAM_SYNCH_PROPAGATION: Propagate the new BSS info after roaming.
218 * @SIR_ROAMING_DEREGISTER_STA: Deregister the old STA after roaming.
Naveen Rawat8cc23b02016-07-14 12:22:56 -0700219 * @SIR_ROAMING_START: Firmware started roaming operation
220 * @SIR_ROAMING_ABORT: Firmware aborted roaming operation, still connected.
221 * @SIR_ROAM_SYNCH_COMPLETE: Roam sync propagation is complete.
Arif Hussain43354e62017-05-24 11:24:25 -0700222 * @SIR_ROAMING_INVOKE_FAIL: Firmware roaming failed.
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700223 */
224enum sir_roam_op_code {
225 SIR_ROAM_SYNCH_PROPAGATION = 1,
226 SIR_ROAMING_DEREGISTER_STA,
Naveen Rawat8cc23b02016-07-14 12:22:56 -0700227 SIR_ROAMING_START,
228 SIR_ROAMING_ABORT,
229 SIR_ROAM_SYNCH_COMPLETE,
Varun Reddy Yeturu04251862016-09-16 10:33:19 -0700230 SIR_ROAM_SYNCH_NAPI_OFF,
Arif Hussain43354e62017-05-24 11:24:25 -0700231 SIR_ROAMING_INVOKE_FAIL,
Varun Reddy Yeturuf907f912016-03-21 15:06:22 -0700232};
233/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800234 * Module ID definitions.
235 */
236enum {
237 SIR_BOOT_MODULE_ID = 1,
238 SIR_HAL_MODULE_ID = 0x10,
239 SIR_CFG_MODULE_ID = 0x12,
240 SIR_LIM_MODULE_ID,
241 SIR_ARQ_MODULE_ID,
242 SIR_SCH_MODULE_ID,
243 SIR_PMM_MODULE_ID,
244 SIR_MNT_MODULE_ID,
245 SIR_DBG_MODULE_ID,
246 SIR_DPH_MODULE_ID,
247 SIR_SYS_MODULE_ID,
248 SIR_SMS_MODULE_ID,
249};
250
251#define SIR_WMA_MODULE_ID SIR_HAL_MODULE_ID
252
253/**
254 * First and last module definition for logging utility
255 *
256 * NOTE: The following definitions need to be updated if
257 * the above list is changed.
258 */
259#define SIR_FIRST_MODULE_ID SIR_HAL_MODULE_ID
260#define SIR_LAST_MODULE_ID SIR_SMS_MODULE_ID
261
262/* Type declarations used by Firmware and Host software */
263
264/* Scan type enum used in scan request */
265typedef enum eSirScanType {
266 eSIR_PASSIVE_SCAN,
267 eSIR_ACTIVE_SCAN,
268 eSIR_BEACON_TABLE,
269} tSirScanType;
270
271/* / Result codes Firmware return to Host SW */
272typedef enum eSirResultCodes {
273 eSIR_SME_SUCCESS,
Abhishek Singh4294f802017-08-10 16:37:07 +0530274 eSIR_LOGE_EXCEPTION,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800275 eSIR_SME_INVALID_PARAMETERS = 500,
276 eSIR_SME_UNEXPECTED_REQ_RESULT_CODE,
277 eSIR_SME_RESOURCES_UNAVAILABLE,
278 /* Unable to find a BssDescription */
279 eSIR_SME_SCAN_FAILED,
280 /* matching requested scan criteria */
281 eSIR_SME_BSS_ALREADY_STARTED_OR_JOINED,
282 eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE,
283 eSIR_SME_REFUSED,
284 eSIR_SME_JOIN_DEAUTH_FROM_AP_DURING_ADD_STA,
285 eSIR_SME_JOIN_TIMEOUT_RESULT_CODE,
286 eSIR_SME_AUTH_TIMEOUT_RESULT_CODE,
287 eSIR_SME_ASSOC_TIMEOUT_RESULT_CODE,
288 eSIR_SME_REASSOC_TIMEOUT_RESULT_CODE,
289 eSIR_SME_MAX_NUM_OF_PRE_AUTH_REACHED,
290 eSIR_SME_AUTH_REFUSED,
291 eSIR_SME_INVALID_WEP_DEFAULT_KEY,
292 eSIR_SME_NO_KEY_MAPPING_KEY_FOR_PEER,
293 eSIR_SME_ASSOC_REFUSED,
294 eSIR_SME_REASSOC_REFUSED,
295 /* Recvd Deauth while join/pre-auth */
296 eSIR_SME_DEAUTH_WHILE_JOIN,
297 eSIR_SME_STA_NOT_AUTHENTICATED,
298 eSIR_SME_STA_NOT_ASSOCIATED,
299 eSIR_SME_ALREADY_JOINED_A_BSS,
300 /* Given in SME_SCAN_RSP msg */
301 eSIR_SME_MORE_SCAN_RESULTS_FOLLOW,
302 /* that more SME_SCAN_RSP */
303 /* messages are following. */
304 /* SME_SCAN_RSP message with */
305 /* eSIR_SME_SUCCESS status */
306 /* code is the last one. */
307 /* Sent in SME_JOIN/REASSOC_RSP */
308 eSIR_SME_INVALID_ASSOC_RSP_RXED,
309 /* messages upon receiving */
310 /* invalid Re/Assoc Rsp frame. */
311 /* STOP BSS triggered by MIC failures: MAC software to
312 * disassoc all stations
313 */
314 eSIR_SME_MIC_COUNTER_MEASURES,
315 /* with MIC_FAILURE reason code and perform the stop bss operation */
316 /* didn't get rsp from peer within timeout interval */
317 eSIR_SME_ADDTS_RSP_TIMEOUT,
318 /* didn't get success rsp from HAL */
319 eSIR_SME_ADDTS_RSP_FAILED,
320 /* failed to send ch switch act frm */
321 eSIR_SME_CHANNEL_SWITCH_FAIL,
322 eSIR_SME_INVALID_STATE,
323 /* SIR_HAL_SIR_HAL_INIT_SCAN_RSP returned failed status */
324 eSIR_SME_HAL_SCAN_INIT_FAILED,
325 /* SIR_HAL_END_SCAN_RSP returned failed status */
326 eSIR_SME_HAL_SCAN_END_FAILED,
327 /* SIR_HAL_FINISH_SCAN_RSP returned failed status */
328 eSIR_SME_HAL_SCAN_FINISH_FAILED,
329 /* Failed to send a message to HAL */
330 eSIR_SME_HAL_SEND_MESSAGE_FAIL,
331 /* Failed to stop the bss */
332 eSIR_SME_STOP_BSS_FAILURE,
333 eSIR_SME_WOWL_ENTER_REQ_FAILED,
334 eSIR_SME_WOWL_EXIT_REQ_FAILED,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800335 eSIR_SME_FT_REASSOC_TIMEOUT_FAILURE,
336 eSIR_SME_FT_REASSOC_FAILURE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800337 eSIR_SME_SEND_ACTION_FAIL,
338 eSIR_SME_DEAUTH_STATUS,
339 eSIR_PNO_SCAN_SUCCESS,
Varun Reddy Yeturu371404b2017-11-30 15:31:35 -0800340 eSIR_SME_INVALID_SESSION,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800341 eSIR_DONOT_USE_RESULT_CODE = SIR_MAX_ENUM_SIZE
342} tSirResultCodes;
343
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +0530344#ifdef WLAN_FEATURE_FILS_SK
345struct fils_join_rsp_params {
346 uint8_t *fils_pmk;
347 uint8_t fils_pmk_len;
348 uint8_t fils_pmkid[PMKID_LEN];
349 uint8_t kek[MAX_KEK_LEN];
350 uint8_t kek_len;
351 uint8_t tk[MAX_TK_LEN];
352 uint8_t tk_len;
353 uint8_t gtk_len;
354 uint8_t gtk[MAX_GTK_LEN];
Vignesh Viswanathana1bb0922017-09-15 12:58:48 +0530355 struct qdf_mac_addr dst_mac;
356 struct qdf_mac_addr src_mac;
357 uint16_t hlp_data_len;
358 uint8_t hlp_data[FILS_MAX_HLP_DATA_LEN];
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +0530359};
360#endif
361
Krishna Kumaar Natarajanf599c6e2015-11-03 11:44:03 -0800362#define RMENABLEDCAP_MAX_LEN 5
363
364struct rrm_config_param {
365 uint8_t rrm_enabled;
366 uint8_t max_randn_interval;
367 uint8_t rm_capability[RMENABLEDCAP_MAX_LEN];
368};
369
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800370/*
371 * although in tSirSupportedRates each IE is 16bit but PE only passes IEs in 8
372 * bits with MSB=1 for basic rates. change the mask for bit0-7 only so HAL gets
373 * correct basic rates for setting response rates.
374 */
375#define IERATE_BASICRATE_MASK 0x80
376#define IERATE_RATE_MASK 0x7f
377#define IERATE_IS_BASICRATE(x) ((x) & IERATE_BASICRATE_MASK)
378
Sreelakshmi Konamki39acb132015-12-16 13:06:22 +0530379const char *lim_bss_type_to_string(const uint16_t bss_type);
380const char *lim_scan_type_to_string(const uint8_t scan_type);
381
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700382/**
383 * struct sSirSupportedRates - stores rates/MCS supported
384 * @llbRates: 11b rates in unit of 500kbps
385 * @llaRates: 11a rates in unit of 500kbps
386 * @supportedMCSSet: supported basic MCS, 0-76 bits used, remaining reserved
387 * bits 0-15 and 32 should be set.
388 * @rxHighestDataRate: RX Highest Supported Data Rate defines the highest data
389 * rate that the STA is able to receive, in unites of 1Mbps
390 * This value is derived from "Supported MCS Set field"
391 * inside the HT capability element.
392 * @vhtRxMCSMap: Indicates the Maximum MCS(VHT) that can be received for each
393 * number of spacial streams
394 * @vhtRxHighestDataRate: Indicate the highest VHT data rate that the STA is
395 * able to receive
396 * @vhtTxMCSMap: Indicates the Maximum MCS(VHT) that can be transmitted for
397 * each number of spacial streams
398 * @vhtTxHighestDataRate: Indicate the highest VHT data rate that the STA is
399 * able to transmit
400 * @he_rx_mcs: Indicates the Maximum MCS(HE) that can be received for each
401 * number of spacial streams
402 * @he_tx_mcs: Indicates the Maximum MCS(HE) that can be transmitted for each
403 * number of spacial streams
404 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800405typedef struct sSirSupportedRates {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800406 uint16_t llbRates[SIR_NUM_11B_RATES];
407 uint16_t llaRates[SIR_NUM_11A_RATES];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800408 uint8_t supportedMCSSet[SIR_MAC_MAX_SUPPORTED_MCS_SET];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800409 uint16_t rxHighestDataRate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800410 uint16_t vhtRxMCSMap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800411 uint16_t vhtRxHighestDataRate;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800412 uint16_t vhtTxMCSMap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800413 uint16_t vhtTxHighestDataRate;
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700414#ifdef WLAN_FEATURE_11AX
Naveen Rawataeca1b92017-10-16 16:55:31 -0700415 uint16_t rx_he_mcs_map_lt_80;
416 uint16_t tx_he_mcs_map_lt_80;
417 uint16_t rx_he_mcs_map_160;
418 uint16_t tx_he_mcs_map_160;
419 uint16_t rx_he_mcs_map_80_80;
420 uint16_t tx_he_mcs_map_80_80;
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -0700421#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800422} tSirSupportedRates, *tpSirSupportedRates;
423
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800424typedef struct sSirRemainOnChnReq {
425 uint16_t messageType;
426 uint16_t length;
427 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530428 struct qdf_mac_addr selfMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800429 uint8_t chnNum;
430 uint8_t phyMode;
431 uint32_t duration;
432 uint8_t isProbeRequestAllowed;
433 uint32_t scan_id;
434 uint8_t probeRspIe[1];
435} tSirRemainOnChnReq, *tpSirRemainOnChnReq;
436
437/**
438 * struct sir_roc_rsp - Structure to store the remain on channel response
439 * @message_type: Message Type
440 * @length: Message Length
441 * @session_id: SME session Id
442 * @scan_id : scan identifier
443 * @status: result status
444 */
445struct sir_roc_rsp {
446 uint16_t message_type;
447 uint16_t length;
448 uint8_t session_id;
449 uint32_t scan_id;
450 tSirResultCodes status;
451};
452
453typedef struct sSirRegisterMgmtFrame {
454 uint16_t messageType;
455 uint16_t length;
456 uint8_t sessionId;
457 bool registerFrame;
458 uint16_t frameType;
459 uint16_t matchLen;
460 uint8_t matchData[1];
461} tSirRegisterMgmtFrame, *tpSirRegisterMgmtFrame;
462
463/* / Generic type for sending a response message */
464/* / with result code to host software */
465typedef struct sSirSmeRsp {
466 uint16_t messageType; /* eWNI_SME_*_RSP */
467 uint16_t length;
468 uint8_t sessionId; /* To support BT-AMP */
469 uint16_t transactionId; /* To support BT-AMP */
470 tSirResultCodes statusCode;
Kabilan Kannanf56f9d52017-04-05 03:31:34 -0700471 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800472} tSirSmeRsp, *tpSirSmeRsp;
473
474/* / Definition for indicating all modules ready on STA */
475typedef struct sSirSmeReadyReq {
476 uint16_t messageType; /* eWNI_SME_SYS_READY_IND */
477 uint16_t length;
478 uint16_t transactionId;
479 void *add_bssdescr_cb;
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -0800480 void *csr_roam_synch_cb;
481 void *pe_roam_synch_cb;
Sandeep Puligilla1426d612017-04-12 18:22:06 -0700482 void *sme_msg_cb;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800483} tSirSmeReadyReq, *tpSirSmeReadyReq;
484
485/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800486 * struct s_sir_set_hw_mode - Set HW mode request
487 * @messageType: Message type
488 * @length: Length of the message
489 * @set_hw: Params containing the HW mode index and callback
490 */
491struct s_sir_set_hw_mode {
492 uint16_t messageType;
493 uint16_t length;
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -0800494 struct policy_mgr_hw_mode set_hw;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800495};
496
497/**
498 * struct sir_dual_mac_config - Dual MAC configuration
499 * @scan_config: Scan configuration
500 * @fw_mode_config: FW mode configuration
501 * @set_dual_mac_cb: Callback function to be executed on response to the command
502 */
503struct sir_dual_mac_config {
504 uint32_t scan_config;
505 uint32_t fw_mode_config;
506 void *set_dual_mac_cb;
507};
508
509/**
510 * struct sir_set_dual_mac_cfg - Set Dual mac config request
511 * @message_type: Message type
512 * @length: Length of the message
513 * @set_dual_mac: Params containing the dual mac config and callback
514 */
515struct sir_set_dual_mac_cfg {
516 uint16_t message_type;
517 uint16_t length;
518 struct sir_dual_mac_config set_dual_mac;
519};
520
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -0800521/**
522 * struct sir_antenna_mode_param - antenna mode param
523 * @num_tx_chains: Number of TX chains
524 * @num_rx_chains: Number of RX chains
525 * @reason: Reason for setting antenna mode
526 * @set_antenna_mode_resp: callback to set antenna mode command
527 */
528struct sir_antenna_mode_param {
529 uint32_t num_tx_chains;
530 uint32_t num_rx_chains;
531 void *set_antenna_mode_resp;
532};
533
534/**
535 * struct sir_set_antenna_mode - Set antenna mode request
536 * @message_type: Message type
537 * @length: Length of the message
538 * @set_antenna_mode: Params containing antenna mode params
539 */
540struct sir_set_antenna_mode {
541 uint16_t message_type;
542 uint16_t length;
543 struct sir_antenna_mode_param set_antenna_mode;
544};
545
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700546/**
547 * enum tSirBssType - Enum for BSS type used in scanning/joining etc.
548 *
549 * @eSIR_INFRASTRUCTURE_MODE: Infrastructure station
550 * @eSIR_INFRA_AP_MODE: softAP mode
551 * @eSIR_IBSS_MODE: IBSS mode
552 * @eSIR_AUTO_MODE: Auto role
553 * @eSIR_MONITOR_MODE: Monitor mode
554 * @eSIR_NDI_MODE: NAN datapath mode
555 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800556typedef enum eSirBssType {
557 eSIR_INFRASTRUCTURE_MODE,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700558 eSIR_INFRA_AP_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800559 eSIR_IBSS_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800560 eSIR_AUTO_MODE,
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -0700561 eSIR_MONITOR_MODE,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -0700562 eSIR_NDI_MODE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800563 eSIR_DONOT_USE_BSS_TYPE = SIR_MAX_ENUM_SIZE
564} tSirBssType;
565
566/* / Power Capability info used in 11H */
567typedef struct sSirMacPowerCapInfo {
568 uint8_t minTxPower;
569 uint8_t maxTxPower;
570} tSirMacPowerCapInfo, *tpSirMacPowerCapInfo;
571
572/* / Supported Channel info used in 11H */
573typedef struct sSirSupChnl {
574 uint8_t numChnl;
575 uint8_t channelList[SIR_MAX_SUPPORTED_CHANNEL_LIST];
576} tSirSupChnl, *tpSirSupChnl;
577
578typedef enum eSirNwType {
579 eSIR_11A_NW_TYPE,
580 eSIR_11B_NW_TYPE,
581 eSIR_11G_NW_TYPE,
582 eSIR_11N_NW_TYPE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800583 eSIR_11AC_NW_TYPE,
Krishna Kumaar Natarajan4f1d7722017-03-03 21:12:51 -0800584 eSIR_11AX_NW_TYPE,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800585 eSIR_DONOT_USE_NW_TYPE = SIR_MAX_ENUM_SIZE
586} tSirNwType;
587
588/* / Definition for new iBss peer info */
589typedef struct sSirNewIbssPeerInfo {
Anurag Chouhan6d760662016-02-20 16:05:43 +0530590 struct qdf_mac_addr peerAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800591 uint16_t aid;
592} tSirNewIbssPeerInfo, *tpSirNewIbssPeerInfo;
593
594/* HT configuration values */
595typedef struct sSirHtConfig {
596 /* Enable/Disable receiving LDPC coded packets */
597 uint32_t ht_rx_ldpc:1;
598 /* Enable/Disable TX STBC */
599 uint32_t ht_tx_stbc:1;
600 /* Enable/Disable RX STBC */
601 uint32_t ht_rx_stbc:2;
602 /* Enable/Disable SGI */
Sandeep Puligilla607f34a2016-05-25 14:37:47 -0700603 uint32_t ht_sgi20:1;
604 uint32_t ht_sgi40:1;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800605 uint32_t unused:27;
Anurag Chouhan6d760662016-02-20 16:05:43 +0530606} qdf_packed tSirHTConfig, *tpSirHTConfig;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800607
Sandeep Puligilla98917432016-06-10 13:50:28 -0700608/**
609 * struct sir_vht_config - VHT capabilites
610 * @max_mpdu_len: MPDU length
611 * @supported_channel_widthset: channel width set
612 * @ldpc_coding: LDPC coding capability
613 * @shortgi80: short GI 80 support
614 * @shortgi160and80plus80: short Gi 160 & 80+80 support
615 * @tx_stbc; Tx STBC cap
616 * @tx_stbc: Rx STBC cap
617 * @su_beam_former: SU beam former cap
618 * @su_beam_formee: SU beam formee cap
619 * @csnof_beamformer_antSup: Antenna support for beamforming
620 * @num_soundingdim: Sound dimensions
621 * @mu_beam_former: MU beam former cap
622 * @mu_beam_formee: MU beam formee cap
623 * @vht_txops: TXOP power save
624 * @htc_vhtcap: HTC VHT capability
625 * @max_ampdu_lenexp: AMPDU length
626 * @vht_link_adapt: VHT link adapatation capable
627 * @rx_antpattern: Rx Antenna pattern
628 * @tx_antpattern: Tx Antenna pattern
629 */
630struct sir_vht_config {
631 uint32_t max_mpdu_len:2;
632 uint32_t supported_channel_widthset:2;
633 uint32_t ldpc_coding:1;
634 uint32_t shortgi80:1;
635 uint32_t shortgi160and80plus80:1;
636 uint32_t tx_stbc:1;
637 uint32_t rx_stbc:3;
638 uint32_t su_beam_former:1;
639 uint32_t su_beam_formee:1;
640 uint32_t csnof_beamformer_antSup:3;
641 uint32_t num_soundingdim:3;
642 uint32_t mu_beam_former:1;
643 uint32_t mu_beam_formee:1;
644 uint32_t vht_txops:1;
645 uint32_t htc_vhtcap:1;
646 uint32_t max_ampdu_lenexp:3;
647 uint32_t vht_link_adapt:2;
648 uint32_t rx_antpattern:1;
649 uint32_t tx_antpattern:1;
650 uint32_t unused:2;
651};
652
653
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800654typedef struct sSirAddIeParams {
655 uint16_t probeRespDataLen;
656 uint8_t *probeRespData_buff;
657 uint16_t assocRespDataLen;
658 uint8_t *assocRespData_buff;
659 uint16_t probeRespBCNDataLen;
660 uint8_t *probeRespBCNData_buff;
661} tSirAddIeParams, *tpSirAddIeParams;
662
663/* / Definition for kick starting BSS */
664/* / ---> MAC */
665/**
666 * Usage of ssId, numSSID & ssIdList:
667 * ---------------------------------
668 * 1. ssId.length of zero indicates that Broadcast/Suppress SSID
669 * feature is enabled.
670 * 2. If ssId.length is zero, MAC SW will advertise NULL SSID
671 * and interpret the SSID list from numSSID & ssIdList.
672 * 3. If ssId.length is non-zero, MAC SW will advertise the SSID
673 * specified in the ssId field and it is expected that
674 * application will set numSSID to one (only one SSID present
675 * in the list) and SSID in the list is same as ssId field.
676 * 4. Application will always set numSSID >= 1.
677 */
678/* ***** NOTE: Please make sure all codes are updated if inserting field into
679 * this structure..********** */
680typedef struct sSirSmeStartBssReq {
681 uint16_t messageType; /* eWNI_SME_START_BSS_REQ */
682 uint16_t length;
683 uint8_t sessionId; /* Added for BT-AMP Support */
684 uint16_t transactionId; /* Added for BT-AMP Support */
Anurag Chouhan6d760662016-02-20 16:05:43 +0530685 struct qdf_mac_addr bssid; /* Added for BT-AMP Support */
686 struct qdf_mac_addr self_macaddr; /* Added for BT-AMP Support */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800687 uint16_t beaconInterval; /* Added for BT-AMP Support */
688 uint8_t dot11mode;
689#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
690 uint8_t cc_switch_mode;
691#endif
692 tSirBssType bssType;
693 tSirMacSSid ssId;
694 uint8_t channelId;
695 ePhyChanBondState cbMode;
696 uint8_t vht_channel_width;
697 uint8_t center_freq_seg0;
698 uint8_t center_freq_seg1;
699 uint8_t sec_ch_offset;
700
701 uint8_t privacy;
702 uint8_t apUapsdEnable;
703 uint8_t ssidHidden;
704 bool fwdWPSPBCProbeReq;
705 bool protEnabled;
706 bool obssProtEnabled;
707 uint16_t ht_capab;
708 tAniAuthType authType;
709 uint32_t dtimPeriod;
710 uint8_t wps_state;
711 uint8_t isCoalesingInIBSSAllowed; /* Coalesing on/off knob */
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800712 enum QDF_OPMODE bssPersona;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800713
714 uint8_t txLdpcIniFeatureEnabled;
715
716 tSirRSNie rsnIE; /* RSN IE to be sent in */
717 /* Beacon and Probe */
718 /* Response frames */
719 tSirNwType nwType; /* Indicates 11a/b/g */
720 tSirMacRateSet operationalRateSet; /* Has 11a or 11b rates */
721 tSirMacRateSet extendedRateSet; /* Has 11g rates */
722 tSirHTConfig htConfig;
Sandeep Puligilla98917432016-06-10 13:50:28 -0700723 struct sir_vht_config vht_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800724#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -0700725 tDot11fIEhe_cap he_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800726#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800727#ifdef WLAN_FEATURE_11W
728 bool pmfCapable;
729 bool pmfRequired;
730#endif
731
732 tSirAddIeParams addIeParams;
733
734 bool obssEnabled;
735 uint8_t sap_dot11mc;
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800736 uint16_t beacon_tx_rate;
Kapil Gupta4b2efbb2016-10-03 13:07:20 +0530737 bool vendor_vht_sap;
Arif Hussain671a1902017-03-17 09:08:32 -0700738 uint32_t cac_duration_ms;
739 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800740
741} tSirSmeStartBssReq, *tpSirSmeStartBssReq;
742
743#define GET_IE_LEN_IN_BSS(lenInBss) (lenInBss + sizeof(lenInBss) - \
744 ((uintptr_t)OFFSET_OF(tSirBssDescription,\
745 ieFields)))
746
747#define WSCIE_PROBE_RSP_LEN (317 + 2)
748
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530749#ifdef WLAN_FEATURE_FILS_SK
750/* struct fils_ind_elements: elements parsed from fils indication present
751 * in beacon/probe resp
752 * @realm_cnt: number of realm present
753 * @realm: realms
754 * @is_fils_sk_supported: if FILS SK supported
755 * @is_cache_id_present: if cache id present
756 * @cache_id: cache id
757 */
758struct fils_ind_elements {
759 uint16_t realm_cnt;
760 uint8_t realm[SIR_MAX_REALM_COUNT][SIR_REALM_LEN];
761 bool is_fils_sk_supported;
762 bool is_cache_id_present;
763 uint8_t cache_id[CACHE_ID_LEN];
764};
765#endif
766
Jeff Johnsone58271f2017-10-06 09:58:59 -0700767struct bss_description {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800768 /* offset of the ieFields from bssId. */
769 uint16_t length;
770 tSirMacAddr bssId;
Arun Khandavalli8a711cb2017-01-03 20:23:56 +0530771 unsigned long scansystimensec;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800772 uint32_t timeStamp[2];
773 uint16_t beaconInterval;
774 uint16_t capabilityInfo;
775 tSirNwType nwType; /* Indicates 11a/b/g */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800776 int8_t rssi;
Deepak Dhamdhere68929ec2015-08-05 15:16:35 -0700777 int8_t rssi_raw;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800778 int8_t sinr;
779 /* channelId what peer sent in beacon/probersp. */
780 uint8_t channelId;
781 /* channelId on which we are parked at. */
782 /* used only in scan case. */
783 uint8_t channelIdSelf;
784 uint8_t sSirBssDescriptionRsvd[3];
Deepthi Gowri6acee342016-10-28 15:00:38 +0530785 /* Based on system time, not a relative time. */
786 uint64_t received_time;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800787 uint32_t parentTSF;
788 uint32_t startTSF[2];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800789 uint8_t mdiePresent;
790 /* MDIE for 11r, picked from the beacons */
791 uint8_t mdie[SIR_MDIE_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800792#ifdef FEATURE_WLAN_ESE
793 uint16_t QBSSLoad_present;
794 uint16_t QBSSLoad_avail;
795 /* To achieve 8-byte alignment with ESE enabled */
796 uint32_t reservedPadding5;
797#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800798 /* whether it is from a probe rsp */
799 uint8_t fProbeRsp;
Deepak Dhamdhere652d7e82015-08-06 14:16:53 -0700800 /* Actual channel the beacon/probe response was received on */
801 uint8_t rx_channel;
Krishna Kumaar Natarajan89a99d42016-08-04 15:44:38 -0700802 tSirMacSeqCtl seq_ctrl;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800803 uint32_t WscIeLen;
804 uint8_t WscIeProbeRsp[WSCIE_PROBE_RSP_LEN];
805 uint8_t reservedPadding4;
806 uint32_t tsf_delta;
Sridhar Selvaraja44c19e2017-08-21 14:20:20 +0530807#ifdef WLAN_FEATURE_FILS_SK
808 struct fils_ind_elements fils_info_element;
809#endif
810 /* Please keep the structure 4 bytes aligned above the ieFields */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800811 uint32_t ieFields[1];
Jeff Johnsone58271f2017-10-06 09:58:59 -0700812};
813typedef struct bss_description tSirBssDescription, *tpSirBssDescription;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800814
815#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
816typedef struct sSirSmeHTProfile {
817 uint8_t dot11mode;
818 uint8_t htCapability;
819 uint8_t htSupportedChannelWidthSet;
820 uint8_t htRecommendedTxWidthSet;
821 ePhyChanBondState htSecondaryChannelOffset;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800822 uint8_t vhtCapability;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800823 uint8_t apCenterChan;
824 uint8_t apChanWidth;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800825} tSirSmeHTProfile;
826#endif
827/* / Definition for response message to previously */
828/* / issued start BSS request */
829/* / MAC ---> */
830typedef struct sSirSmeStartBssRsp {
831 uint16_t messageType; /* eWNI_SME_START_BSS_RSP */
832 uint16_t length;
833 uint8_t sessionId;
834 uint16_t transactionId; /* transaction ID for cmd */
835 tSirResultCodes statusCode;
836 tSirBssType bssType; /* Add new type for WDS mode */
837 uint16_t beaconInterval; /* Beacon Interval for both type */
838 uint32_t staId; /* Staion ID for Self */
839#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
840 tSirSmeHTProfile HTProfile;
841#endif
842 tSirBssDescription bssDescription; /* Peer BSS description */
843} tSirSmeStartBssRsp, *tpSirSmeStartBssRsp;
844
845typedef struct sSirChannelList {
846 uint8_t numChannels;
847 uint8_t channelNumber[SIR_ESE_MAX_MEAS_IE_REQS];
848} tSirChannelList, *tpSirChannelList;
849
850typedef struct sSirDFSChannelList {
851 uint32_t timeStamp[SIR_MAX_24G_5G_CHANNEL_RANGE];
852
853} tSirDFSChannelList, *tpSirDFSChannelList;
854
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800855/* / Two Background Scan mode */
856typedef enum eSirBackgroundScanMode {
857 eSIR_ROAMING_SCAN = 2,
858} tSirBackgroundScanMode;
859
860/* / Two types of traffic check */
861typedef enum eSirLinkTrafficCheck {
862 eSIR_DONT_CHECK_LINK_TRAFFIC_BEFORE_SCAN = 0,
863 eSIR_CHECK_LINK_TRAFFIC_BEFORE_SCAN = 1,
864 eSIR_CHECK_ROAMING_SCAN = 2,
865} tSirLinkTrafficCheck;
866
867#define SIR_BG_SCAN_RETURN_CACHED_RESULTS 0x0
868#define SIR_BG_SCAN_PURGE_RESUTLS 0x80
869#define SIR_BG_SCAN_RETURN_FRESH_RESULTS 0x01
870#define SIR_SCAN_MAX_NUM_SSID 0x0A
871#define SIR_BG_SCAN_RETURN_LFR_CACHED_RESULTS 0x02
872#define SIR_BG_SCAN_PURGE_LFR_RESULTS 0x40
873
874/* / Definition for scan request */
875typedef struct sSirSmeScanReq {
876 uint16_t messageType; /* eWNI_SME_SCAN_REQ */
877 uint16_t length;
878 uint8_t sessionId; /* Session ID */
879 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +0530880 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800881 tSirMacSSid ssId[SIR_SCAN_MAX_NUM_SSID];
Anurag Chouhan6d760662016-02-20 16:05:43 +0530882 struct qdf_mac_addr selfMacAddr; /* Added For BT-AMP Support */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800883 tSirBssType bssType;
884 uint8_t dot11mode;
885 tSirScanType scanType;
886 uint32_t scan_id;
887 /**
888 * minChannelTime. Not used if scanType is passive.
889 * 0x0 - Dont Use min channel timer. Only max channel timeout will used.
890 * 11k measurements set this to 0 to user only single duration for scan.
891 * <valid timeout> - Timeout value used for min channel timeout.
892 */
893 uint32_t minChannelTime;
894 /**
895 * maxChannelTime.
896 * 0x0 - Invalid. In case of active scan.
897 * In case of passive scan, MAX( maxChannelTime,
898 * WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME) is used.
899 */
900 uint32_t maxChannelTime;
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +0530901 enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800902 /**
903 * returnAfterFirstMatch can take following values:
904 * 0x00 - Return SCAN_RSP message after complete channel scan
905 * 0x01 - Return SCAN_RSP message after collecting BSS description
906 * that matches scan criteria.
907 * 0xC0 - Return after collecting first 11d IE from 2.4 GHz &
908 * 5 GHz band channels
909 * 0x80 - Return after collecting first 11d IE from 5 GHz band
910 * channels
911 * 0x40 - Return after collecting first 11d IE from 2.4 GHz
912 * band channels
913 *
914 * Values of 0xC0, 0x80 & 0x40 are to be used by
915 * Roaming/application when 11d is enabled.
916 */
917 /* in units of milliseconds, ignored when not connected */
918 uint32_t restTime;
Agrawal Ashish17bb3902016-05-05 13:29:40 +0530919 /*in units of milliseconds, ignored when not connected*/
920 uint32_t min_rest_time;
921 /*in units of milliseconds, ignored when not connected*/
922 uint32_t idle_time;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800923 uint8_t returnAfterFirstMatch;
924
925 /**
926 * returnUniqueResults can take following values:
927 * 0 - Collect & report all received BSS descriptions from same BSS.
928 * 1 - Collect & report unique BSS description from same BSS.
929 */
930 uint8_t returnUniqueResults;
931
932 /**
933 * returnFreshResults can take following values:
934 * 0x00 - Return background scan results.
935 * 0x80 - Return & purge background scan results
936 * 0x01 - Trigger fresh scan instead of returning background scan
937 * results.
938 * 0x81 - Trigger fresh scan instead of returning background scan
939 * results and purge background scan results.
940 */
941 uint8_t returnFreshResults;
942
943 /* backgroundScanMode can take following values:
944 * 0x0 - agressive scan
945 * 0x1 - normal scan where HAL will check for link traffic
946 * prior to proceeding with the scan
947 */
948 tSirBackgroundScanMode backgroundScanMode;
949
950 uint8_t hiddenSsid;
951
952 /* Number of SSIDs to scan */
953 uint8_t numSsid;
954
955 /* channelList has to be the last member of this structure. Check
956 * tSirChannelList for the reason. This MUST be the last field of the
957 * structure
958 */
959
960 bool p2pSearch;
961 uint16_t uIEFieldLen;
962 uint16_t uIEFieldOffset;
963
964 /* channelList MUST be the last field of this structure */
965 tSirChannelList channelList;
966 /*-----------------------------
967 tSirSmeScanReq....
968 -----------------------------
969 uIEFiledLen
970 -----------------------------
971 uIEFiledOffset ----+
972 ----------------------------- |
973 channelList.numChannels |
974 ----------------------------- |
975 ... variable size up to |
976 channelNumber[numChannels-1] |
977 This can be zero, if |
978 numChannel is zero. |
979 ----------------------------- <--+
980 ... variable size uIEFiled
981 up to uIEFieldLen (can be 0)
982 -----------------------------*/
983} tSirSmeScanReq, *tpSirSmeScanReq;
984
985typedef struct sSirSmeScanAbortReq {
986 uint16_t type;
987 uint16_t msgLen;
988 uint8_t sessionId;
989 uint32_t scan_id;
990} tSirSmeScanAbortReq, *tpSirSmeScanAbortReq;
991
992typedef struct sSirSmeScanChanReq {
993 uint16_t type;
994 uint16_t msgLen;
995 uint8_t sessionId;
996 uint16_t transcationId;
997} tSirSmeGetScanChanReq, *tpSirSmeGetScanChanReq;
998
999#ifdef FEATURE_OEM_DATA_SUPPORT
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -07001000struct oem_data_req {
Gupta, Kapil8a605e12016-06-08 14:14:35 +05301001 uint32_t data_len;
Krishna Kumaar Natarajan9ac8efd2015-11-20 13:40:24 -08001002 uint8_t *data;
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -07001003};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001004
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -07001005struct oem_data_rsp {
Krishna Kumaar Natarajan608291e2015-12-14 18:17:27 -08001006 uint32_t rsp_len;
Krishna Kumaar Natarajan73ea9f22016-06-30 18:38:47 -07001007 uint8_t *data;
Krishna Kumaar Natarajanc1fa17d2016-08-03 14:19:20 -07001008};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001009#endif /* FEATURE_OEM_DATA_SUPPORT */
1010
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001011#ifdef FEATURE_WLAN_ESE
yeshwanth sriram guntuka27e4ffc2016-12-01 18:00:17 +05301012typedef struct ese_wmm_tspec_ie {
1013 uint16_t traffic_type:1;
1014 uint16_t tsid:4;
1015 uint16_t direction:2;
1016 uint16_t access_policy:2;
1017 uint16_t aggregation:1;
1018 uint16_t psb:1;
1019 uint16_t user_priority:3;
1020 uint16_t tsinfo_ack_pol:2;
1021 uint8_t tsinfo_rsvd:7;
1022 uint8_t burst_size_defn:1;
1023 uint16_t size:15;
1024 uint16_t fixed:1;
1025 uint16_t max_msdu_size;
1026 uint32_t min_service_int;
1027 uint32_t max_service_int;
1028 uint32_t inactivity_int;
1029 uint32_t suspension_int;
1030 uint32_t service_start_time;
1031 uint32_t min_data_rate;
1032 uint32_t mean_data_rate;
1033 uint32_t peak_data_rate;
1034 uint32_t burst_size;
1035 uint32_t delay_bound;
1036 uint32_t min_phy_rate;
1037 uint16_t surplus_bw_allowance;
1038 uint16_t medium_time;
1039} qdf_packed ese_wmm_tspec_ie;
1040
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001041typedef struct sTspecInfo {
1042 uint8_t valid;
1043 tSirMacTspecIE tspec;
1044} tTspecInfo;
1045
1046#define SIR_ESE_MAX_TSPEC_IES 4
1047typedef struct sESETspecTspecInfo {
1048 uint8_t numTspecs;
1049 tTspecInfo tspec[SIR_ESE_MAX_TSPEC_IES];
1050} tESETspecInfo;
1051
1052typedef struct sSirTsmIE {
1053 uint8_t tsid;
1054 uint8_t state;
1055 uint16_t msmt_interval;
1056} tSirTsmIE, *tpSirTsmIE;
1057typedef struct sSirSmeTsmIEInd {
1058 tSirTsmIE tsmIe;
1059 uint8_t sessionId;
1060} tSirSmeTsmIEInd, *tpSirSmeTsmIEInd;
1061typedef struct sAniTrafStrmMetrics {
1062 uint16_t UplinkPktQueueDly;
1063 uint16_t UplinkPktQueueDlyHist[4];
1064 uint32_t UplinkPktTxDly;
1065 uint16_t UplinkPktLoss;
1066 uint16_t UplinkPktCount;
1067 uint8_t RoamingCount;
1068 uint16_t RoamingDly;
1069} tAniTrafStrmMetrics, *tpAniTrafStrmMetrics;
1070
1071typedef struct sAniGetTsmStatsReq {
1072 /* Common for all types are requests */
1073 uint16_t msgType; /* message type is same as the request type */
1074 uint16_t msgLen; /* length of the entire request */
1075 uint8_t staId;
1076 uint8_t tid; /* traffic id */
1077 struct qdf_mac_addr bssId;
1078 void *tsmStatsCallback;
1079 void *pDevContext; /* device context */
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08001080} tAniGetTsmStatsReq, *tpAniGetTsmStatsReq;
1081
1082typedef struct sAniGetTsmStatsRsp {
1083 /* Common for all types are responses */
1084 uint16_t msgType; /*
1085 * message type is same as
1086 * the request type
1087 */
1088 uint16_t msgLen; /*
1089 * length of the entire request,
1090 * includes the pStatsBuf length too
1091 */
1092 uint8_t sessionId;
1093 uint32_t rc; /* success/failure */
1094 uint32_t staId; /*
1095 * Per STA stats request must
1096 * contain valid
1097 */
1098 tAniTrafStrmMetrics tsmMetrics;
1099 void *tsmStatsReq; /* tsm stats request backup */
1100} tAniGetTsmStatsRsp, *tpAniGetTsmStatsRsp;
1101
1102typedef struct sSirEseBcnReportBssInfo {
1103 tBcnReportFields bcnReportFields;
1104 uint8_t ieLen;
1105 uint8_t *pBuf;
1106} tSirEseBcnReportBssInfo, *tpSirEseBcnReportBssInfo;
1107
1108typedef struct sSirEseBcnReportRsp {
1109 uint16_t measurementToken;
1110 uint8_t flag; /* Flag to report measurement done and more data */
1111 uint8_t numBss;
1112 tSirEseBcnReportBssInfo bcnRepBssInfo[SIR_BCN_REPORT_MAX_BSS_DESC];
1113} tSirEseBcnReportRsp, *tpSirEseBcnReportRsp;
1114
1115#define TSRS_11AG_RATE_6MBPS 0xC
1116#define TSRS_11B_RATE_5_5MBPS 0xB
1117typedef struct sSirMacESETSRSIE {
1118 uint8_t tsid;
1119 uint8_t rates[8];
1120} tSirMacESETSRSIE;
1121typedef struct sSirMacESETSMIE {
1122 uint8_t tsid;
1123 uint8_t state;
1124 uint16_t msmt_interval;
1125} tSirMacESETSMIE;
1126typedef struct sTSMStats {
1127 uint8_t tid;
1128 struct qdf_mac_addr bssid;
1129 tTrafStrmMetrics tsmMetrics;
1130} tTSMStats, *tpTSMStats;
1131typedef struct sEseTSMContext {
1132 uint8_t tid;
1133 tSirMacESETSMIE tsmInfo;
1134 tTrafStrmMetrics tsmMetrics;
1135} tEseTSMContext, *tpEseTSMContext;
1136typedef struct sEsePEContext {
1137 tEseTSMContext tsm;
1138} tEsePEContext, *tpEsePEContext;
1139
1140typedef struct sSirPlmReq {
1141 uint16_t diag_token; /* Dialog token */
1142 uint16_t meas_token; /* measurement token */
1143 uint16_t numBursts; /* total number of bursts */
1144 uint16_t burstInt; /* burst interval in seconds */
1145 uint16_t measDuration; /* in TU's,STA goes off-ch */
1146 /* no of times the STA should cycle through PLM ch list */
1147 uint8_t burstLen;
1148 int8_t desiredTxPwr; /* desired tx power */
1149 struct qdf_mac_addr mac_addr; /* MC dest addr */
1150 /* no of channels */
1151 uint8_t plmNumCh;
1152 /* channel numbers */
1153 uint8_t plmChList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
1154 uint8_t sessionId;
1155 bool enable;
1156} tSirPlmReq, *tpSirPlmReq;
1157
1158#endif /* FEATURE_WLAN_ESE */
1159
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001160/* / Definition for response message to previously issued scan request */
1161typedef struct sSirSmeScanRsp {
1162 uint16_t messageType; /* eWNI_SME_SCAN_RSP */
1163 uint16_t length;
1164 uint8_t sessionId;
1165 tSirResultCodes statusCode;
1166 uint16_t transcationId;
1167 uint32_t scan_id;
1168} tSirSmeScanRsp, *tpSirSmeScanRsp;
1169
1170/* / Definition for join request */
1171/* / ---> MAC */
1172/* / WARNING! If you add a field in JOIN REQ. */
1173/* / Make sure to add it in REASSOC REQ */
1174/* / The Serdes function is the same and its */
1175/* / shared with REASSOC. So if we add a field */
1176/* here and dont add it in REASSOC REQ. It will BREAK!!! REASSOC. */
1177typedef struct sSirSmeJoinReq {
1178 uint16_t messageType; /* eWNI_SME_JOIN_REQ */
1179 uint16_t length;
1180 uint8_t sessionId;
1181 uint16_t transactionId;
1182 tSirMacSSid ssId;
1183 tSirMacAddr selfMacAddr; /* self Mac address */
1184 tSirBssType bsstype; /* add new type for BT-AMP STA and AP Modules */
1185 uint8_t dot11mode; /* to support BT-AMP */
1186#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
1187 uint8_t cc_switch_mode;
1188#endif
Jeff Johnsonc1e62782017-11-09 09:50:17 -08001189 enum QDF_OPMODE staPersona; /* Persona */
Abhishek Singhf78bd2d2016-04-27 16:47:56 +05301190 bool wps_registration;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001191 ePhyChanBondState cbMode; /* Pass CB mode value in Join. */
1192
1193 /*This contains the UAPSD Flag for all 4 AC
1194 * B0: AC_VO UAPSD FLAG
1195 * B1: AC_VI UAPSD FLAG
1196 * B2: AC_BK UAPSD FLAG
1197 * B3: AC_BE UASPD FLAG
1198 */
1199 uint8_t uapsdPerAcBitmask;
1200
1201 tSirMacRateSet operationalRateSet; /* Has 11a or 11b rates */
1202 tSirMacRateSet extendedRateSet; /* Has 11g rates */
1203 tSirRSNie rsnIE; /* RSN IE to be sent in */
1204 /* (Re) Association Request */
1205#ifdef FEATURE_WLAN_ESE
1206 /* CCMK IE to be included as handler for join and reassoc is */
1207 tSirCCKMie cckmIE;
1208 /* the same. The join will never carry cckm, but will be set to */
1209 /* 0. */
1210#endif
1211
1212 tSirAddie addIEScan; /* Additional IE to be sent in */
1213 /* (unicast) Probe Request at the time of join */
1214
1215 tSirAddie addIEAssoc; /* Additional IE to be sent in */
1216 /* (Re) Association Request */
1217
1218 tAniEdType UCEncryptionType;
1219
1220 tAniEdType MCEncryptionType;
1221
1222#ifdef WLAN_FEATURE_11W
1223 tAniEdType MgmtEncryptionType;
1224#endif
1225
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001226 bool is11Rconnection;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001227#ifdef FEATURE_WLAN_ESE
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001228 bool isESEFeatureIniEnabled;
1229 bool isESEconnection;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001230 tESETspecInfo eseTspecInfo;
1231#endif
1232
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001233 bool isFastTransitionEnabled;
1234 bool isFastRoamIniFeatureEnabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001235
1236 uint8_t txLdpcIniFeatureEnabled;
1237 tSirHTConfig htConfig;
Sandeep Puligilla98917432016-06-10 13:50:28 -07001238 struct sir_vht_config vht_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08001239#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -07001240 tDot11fIEhe_cap he_config;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08001241#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001242 uint8_t enableVhtpAid;
1243 uint8_t enableVhtGid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001244 uint8_t enableAmpduPs;
1245 uint8_t enableHtSmps;
1246 uint8_t htSmps;
Archana Ramachandranfec24812016-02-16 16:31:56 -08001247 bool send_smps_action;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001248
Deepak Dhamdhere612392c2016-08-28 02:56:51 -07001249 uint8_t max_amsdu_num;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001250 bool isWMEenabled;
1251 bool isQosEnabled;
1252 bool isOSENConnection;
Krishna Kumaar Natarajanf599c6e2015-11-03 11:44:03 -08001253 struct rrm_config_param rrm_config;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001254 bool spectrumMgtIndicator;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001255 tSirMacPowerCapInfo powerCap;
1256 tSirSupChnl supportedChannels;
Selvaraj, Sridhar05ea0792017-05-17 12:17:03 +05301257 bool enable_bcast_probe_rsp;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +05301258#ifdef WLAN_FEATURE_FILS_SK
1259 struct cds_fils_connection_info fils_con_info;
1260#endif
1261 /* Pls make this as last variable in struct */
Abhishek Singhb59f8d42017-07-31 14:42:47 +05301262 bool force_24ghz_in_ht20;
Selvaraj, Sridhar81ab80d2017-06-08 12:21:39 +05301263 tSirBssDescription bssDescription;
1264 /*
1265 * WARNING: Pls make bssDescription as last variable in struct
1266 * tSirSmeJoinReq as it has ieFields followed after this bss
1267 * description. Adding a variable after this corrupts the ieFields
1268 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001269} tSirSmeJoinReq, *tpSirSmeJoinReq;
1270
1271/* / Definition for reponse message to previously issued join request */
1272/* / MAC ---> */
1273typedef struct sSirSmeJoinRsp {
1274 uint16_t messageType; /* eWNI_SME_JOIN_RSP */
1275 uint16_t length;
1276 uint8_t sessionId; /* Session ID */
1277 uint16_t transactionId; /* Transaction ID for cmd */
1278 tSirResultCodes statusCode;
1279 tAniAuthType authType;
1280 uint32_t vht_channel_width;
1281 /* It holds reasonCode when join fails due to deauth/disassoc frame.
1282 * Otherwise it holds status code.
1283 */
1284 uint16_t protStatusCode;
1285 uint16_t aid;
1286 uint32_t beaconLength;
1287 uint32_t assocReqLength;
1288 uint32_t assocRspLength;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001289 uint32_t parsedRicRspLen;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001290#ifdef FEATURE_WLAN_ESE
1291 uint32_t tspecIeLen;
1292#endif
1293 uint32_t staId; /* Station ID for peer */
1294
1295 /* The DPU signatures will be sent eventually to TL to help it determine
1296 * the association to which a packet belongs to
1297 * Unicast DPU signature
1298 */
1299 uint8_t ucastSig;
1300
1301 /*Broadcast DPU signature */
1302 uint8_t bcastSig;
1303
1304 /*Timing measurement capability */
1305 uint8_t timingMeasCap;
1306
1307#ifdef FEATURE_WLAN_TDLS
1308 /* TDLS prohibited and TDLS channel switch prohibited are set as
1309 * per ExtCap IE in received assoc/re-assoc response from AP
1310 */
1311 bool tdls_prohibited;
1312 bool tdls_chan_swit_prohibited;
1313#endif
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301314 uint8_t nss;
1315 uint32_t max_rate_flags;
1316
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001317#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
1318 tSirSmeHTProfile HTProfile;
1319#endif
Archana Ramachandran20d2e232016-02-11 16:58:40 -08001320 bool supported_nss_1x1;
Anurag Chouhan5de8d172016-07-13 14:44:28 +05301321 tDot11fIEHTCaps ht_caps;
1322 tDot11fIEVHTCaps vht_caps;
1323 tDot11fIEHTInfo ht_operation;
1324 tDot11fIEVHTOperation vht_operation;
1325 tDot11fIEhs20vendor_ie hs20vendor_ie;
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301326 bool is_fils_connection;
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301327 uint16_t fils_seq_num;
Vignesh Viswanathan0b0fa272017-09-18 17:12:04 +05301328#ifdef WLAN_FEATURE_FILS_SK
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +05301329 struct fils_join_rsp_params *fils_join_rsp;
1330#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001331 uint8_t frames[1];
1332} tSirSmeJoinRsp, *tpSirSmeJoinRsp;
1333
1334/* / probereq from peer, when wsc is enabled */
1335typedef struct sSirSmeProbereq {
1336 uint16_t messageType;
1337 uint16_t length;
1338 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301339 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001340 uint16_t devicePasswdId;
1341} tSirSmeProbeReq, *tpSirSmeProbeReq;
1342
1343typedef struct sSirSmeChanInfo {
1344 uint8_t chan_id;
1345 uint32_t mhz;
1346 uint32_t band_center_freq1;
1347 uint32_t band_center_freq2;
1348 uint32_t info;
1349 uint32_t reg_info_1;
1350 uint32_t reg_info_2;
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301351 uint8_t nss;
1352 uint32_t rate_flags;
Manishekar Chandrasekaranec267592016-05-26 19:10:04 +05301353 uint8_t sec_ch_offset;
1354 enum phy_ch_width ch_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001355} tSirSmeChanInfo, *tpSirSmeChanInfo;
Kanchanapally, Vidyullathae3062812015-05-22 17:28:57 +05301356
Will Huang558f8082017-05-31 16:22:24 +08001357enum sir_sme_phy_mode {
1358 SIR_SME_PHY_MODE_LEGACY = 0,
1359 SIR_SME_PHY_MODE_HT = 1,
1360 SIR_SME_PHY_MODE_VHT = 2
1361};
1362
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001363/* / Definition for Association indication from peer */
1364/* / MAC ---> */
1365typedef struct sSirSmeAssocInd {
1366 uint16_t messageType; /* eWNI_SME_ASSOC_IND */
1367 uint16_t length;
1368 uint8_t sessionId;
1369 tSirMacAddr peerMacAddr;
1370 uint16_t aid;
1371 tSirMacAddr bssId; /* Self BSSID */
1372 uint16_t staId; /* Station ID for peer */
1373 uint8_t uniSig; /* DPU signature for unicast packets */
1374 uint8_t bcastSig; /* DPU signature for broadcast packets */
1375 tAniAuthType authType;
1376 tAniSSID ssId; /* SSID used by STA to associate */
1377 tSirWAPIie wapiIE; /* WAPI IE received from peer */
1378 tSirRSNie rsnIE; /* RSN IE received from peer */
1379 /* Additional IE received from peer, which possibly include
1380 * WSC IE and/or P2P IE
1381 */
1382 tSirAddie addIE;
1383
1384 /* powerCap & supportedChannels are present only when */
1385 /* spectrumMgtIndicator flag is set */
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001386 bool spectrumMgtIndicator;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001387 tSirMacPowerCapInfo powerCap;
1388 tSirSupChnl supportedChannels;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001389 bool wmmEnabledSta; /* if present - STA is WMM enabled */
1390 bool reassocReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001391 /* Required for indicating the frames to upper layer */
1392 uint32_t beaconLength;
1393 uint8_t *beaconPtr;
1394 uint32_t assocReqLength;
1395 uint8_t *assocReqPtr;
1396
1397 /* Timing measurement capability */
1398 uint8_t timingMeasCap;
1399 tSirSmeChanInfo chan_info;
Will Huang558f8082017-05-31 16:22:24 +08001400 bool ampdu;
1401 bool sgi_enable;
1402 bool tx_stbc;
1403 bool rx_stbc;
1404 tSirMacHTChannelWidth ch_width;
1405 enum sir_sme_phy_mode mode;
1406 uint8_t max_supp_idx;
1407 uint8_t max_ext_idx;
1408 uint8_t max_mcs_idx;
1409 uint8_t rx_mcs_map;
1410 uint8_t tx_mcs_map;
gaolez7bb1e742017-03-21 16:37:38 +08001411 /* Extended CSA capability of station */
1412 uint8_t ecsa_capable;
Ashish Kumar Dhanotiya443d31f2017-10-13 12:41:19 +05301413 tDot11fIEHTCaps HTCaps;
1414 tDot11fIEVHTCaps VHTCaps;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001415} tSirSmeAssocInd, *tpSirSmeAssocInd;
1416
1417/* / Definition for Association confirm */
1418/* / ---> MAC */
1419typedef struct sSirSmeAssocCnf {
1420 uint16_t messageType; /* eWNI_SME_ASSOC_CNF */
1421 uint16_t length;
1422 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301423 struct qdf_mac_addr bssid; /* Self BSSID */
1424 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001425 uint16_t aid;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301426 struct qdf_mac_addr alternate_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001427 uint8_t alternateChannelId;
1428} tSirSmeAssocCnf, *tpSirSmeAssocCnf;
1429
1430/* / Enum definition for Wireless medium status change codes */
1431typedef enum eSirSmeStatusChangeCode {
1432 eSIR_SME_DEAUTH_FROM_PEER,
1433 eSIR_SME_DISASSOC_FROM_PEER,
1434 eSIR_SME_LOST_LINK_WITH_PEER,
1435 eSIR_SME_CHANNEL_SWITCH,
1436 eSIR_SME_JOINED_NEW_BSS,
1437 eSIR_SME_LEAVING_BSS,
1438 eSIR_SME_IBSS_ACTIVE,
1439 eSIR_SME_IBSS_INACTIVE,
1440 eSIR_SME_IBSS_PEER_DEPARTED,
1441 eSIR_SME_RADAR_DETECTED,
1442 eSIR_SME_IBSS_NEW_PEER,
1443 eSIR_SME_AP_CAPS_CHANGED,
1444} tSirSmeStatusChangeCode;
1445
1446typedef struct sSirSmeNewBssInfo {
Anurag Chouhan6d760662016-02-20 16:05:43 +05301447 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001448 uint8_t channelNumber;
1449 uint8_t reserved;
1450 tSirMacSSid ssId;
1451} tSirSmeNewBssInfo, *tpSirSmeNewBssInfo;
1452
1453typedef struct sSirSmeApNewCaps {
1454 uint16_t capabilityInfo;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301455 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001456 uint8_t channelId;
1457 uint8_t reserved[3];
1458 tSirMacSSid ssId;
1459} tSirSmeApNewCaps, *tpSirSmeApNewCaps;
1460
1461/**
1462 * Table below indicates what information is passed for each of
1463 * the Wireless Media status change notifications:
1464 *
1465 * Status Change code Status change info
1466 * ----------------------------------------------------------------------
1467 * eSIR_SME_DEAUTH_FROM_PEER Reason code received in DEAUTH frame
1468 * eSIR_SME_DISASSOC_FROM_PEER Reason code received in DISASSOC frame
1469 * eSIR_SME_LOST_LINK_WITH_PEER None
1470 * eSIR_SME_CHANNEL_SWITCH New channel number
1471 * eSIR_SME_JOINED_NEW_BSS BSSID, SSID and channel number
1472 * eSIR_SME_LEAVING_BSS None
1473 * eSIR_SME_IBSS_ACTIVE Indicates that another STA joined
1474 * IBSS apart from this STA that
1475 * started IBSS
1476 * eSIR_SME_IBSS_INACTIVE Indicates that only this STA is left
1477 * in IBSS
1478 * eSIR_SME_RADAR_DETECTED Indicates that radar is detected
1479 * eSIR_SME_IBSS_NEW_PEER Indicates that a new peer is detected
1480 * eSIR_SME_AP_CAPS_CHANGED Indicates that capabilities of the AP
1481 * that STA is currently associated with
1482 * have changed.
1483 */
1484
1485/* / Definition for Wireless medium status change notification */
1486typedef struct sSirSmeWmStatusChangeNtf {
1487 uint16_t messageType; /* eWNI_SME_WM_STATUS_CHANGE_NTF */
1488 uint16_t length;
1489 uint8_t sessionId; /* Session ID */
1490 tSirSmeStatusChangeCode statusChangeCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301491 struct qdf_mac_addr bssid; /* Self BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001492 union {
1493 uint16_t deAuthReasonCode; /* eSIR_SME_DEAUTH_FROM_PEER */
1494 /* eSIR_SME_DISASSOC_FROM_PEER */
1495 uint16_t disassocReasonCode;
1496 /* none for eSIR_SME_LOST_LINK_WITH_PEER */
1497 uint8_t newChannelId; /* eSIR_SME_CHANNEL_SWITCH */
1498 tSirSmeNewBssInfo newBssInfo; /* eSIR_SME_JOINED_NEW_BSS */
1499 /* none for eSIR_SME_LEAVING_BSS */
1500 /* none for eSIR_SME_IBSS_ACTIVE */
1501 /* none for eSIR_SME_IBSS_INACTIVE */
1502 /* eSIR_SME_IBSS_NEW_PEER */
1503 tSirNewIbssPeerInfo newIbssPeerInfo;
1504 tSirSmeApNewCaps apNewCaps; /* eSIR_SME_AP_CAPS_CHANGED */
1505 } statusChangeInfo;
1506} tSirSmeWmStatusChangeNtf, *tpSirSmeWmStatusChangeNtf;
1507
1508/* Definition for Disassociation request */
1509typedef struct sSirSmeDisassocReq {
1510 uint16_t messageType; /* eWNI_SME_DISASSOC_REQ */
1511 uint16_t length;
1512 uint8_t sessionId; /* Session ID */
1513 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301514 struct qdf_mac_addr bssid; /* Peer BSSID */
1515 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001516 uint16_t reasonCode;
1517 /* This flag tells LIM whether to send the disassoc OTA or not */
1518 /* This will be set in while handing off from one AP to other */
1519 uint8_t doNotSendOverTheAir;
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -07001520 bool process_ho_fail;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301521} qdf_packed tSirSmeDisassocReq, *tpSirSmeDisassocReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001522
1523/* / Definition for Tkip countermeasures request */
1524typedef struct sSirSmeTkipCntrMeasReq {
1525 uint16_t messageType; /* eWNI_SME_DISASSOC_REQ */
1526 uint16_t length;
1527 uint8_t sessionId; /* Session ID */
1528 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301529 struct qdf_mac_addr bssId; /* Peer BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001530 bool bEnable; /* Start/stop countermeasures */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301531} qdf_packed tSirSmeTkipCntrMeasReq, *tpSirSmeTkipCntrMeasReq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001532
1533typedef struct sAni64BitCounters {
1534 uint32_t Hi;
1535 uint32_t Lo;
1536} tAni64BitCounters, *tpAni64BitCounters;
1537
1538typedef struct sAniSecurityStat {
1539 tAni64BitCounters txBlks;
1540 tAni64BitCounters rxBlks;
1541 tAni64BitCounters formatErrorCnt;
1542 tAni64BitCounters decryptErr;
1543 tAni64BitCounters protExclCnt;
1544 tAni64BitCounters unDecryptableCnt;
1545 tAni64BitCounters decryptOkCnt;
1546
1547} tAniSecurityStat, *tpAniSecurityStat;
1548
1549typedef struct sAniTxRxStats {
1550 tAni64BitCounters txFrames;
1551 tAni64BitCounters rxFrames;
1552 tAni64BitCounters nRcvBytes;
1553 tAni64BitCounters nXmitBytes;
1554
1555} tAniTxRxStats, *tpAniTxRxStats;
1556
1557typedef struct sAniSecStats {
1558 tAniSecurityStat aes;
1559 tAni64BitCounters aesReplays;
1560 tAniSecurityStat tkip;
1561 tAni64BitCounters tkipReplays;
1562 tAni64BitCounters tkipMicError;
1563
1564 tAniSecurityStat wep;
1565#if defined(FEATURE_WLAN_WAPI) && !defined(LIBRA_WAPI_SUPPORT)
1566 tAniSecurityStat wpi;
1567 tAni64BitCounters wpiReplays;
1568 tAni64BitCounters wpiMicError;
1569#endif
1570} tAniSecStats, *tpAniSecStats;
1571
1572#define SIR_MAX_RX_CHAINS 3
1573
1574typedef struct sAniStaStatStruct {
1575 /* following statistic elements till expandPktRxCntLo are not filled
1576 * with valid data. These are kept as it is, since WSM is using this
1577 * structure. These elements can be removed whenever WSM is updated.
1578 * Phystats is used to hold phystats from BD.
1579 */
1580 uint32_t sentAesBlksUcastHi;
1581 uint32_t sentAesBlksUcastLo;
1582 uint32_t recvAesBlksUcastHi;
1583 uint32_t recvAesBlksUcastLo;
1584 uint32_t aesFormatErrorUcastCnts;
1585 uint32_t aesReplaysUcast;
1586 uint32_t aesDecryptErrUcast;
1587 uint32_t singleRetryPkts;
1588 uint32_t failedTxPkts;
1589 uint32_t ackTimeouts;
1590 uint32_t multiRetryPkts;
1591 uint32_t fragTxCntsHi;
1592 uint32_t fragTxCntsLo;
1593 uint32_t transmittedPktsHi;
1594 uint32_t transmittedPktsLo;
1595 uint32_t phyStatHi; /* These are used to fill in the phystats. */
1596 uint32_t phyStatLo; /* This is only for private use. */
1597
1598 uint32_t uplinkRssi;
1599 uint32_t uplinkSinr;
1600 uint32_t uplinkRate;
1601 uint32_t downlinkRssi;
1602 uint32_t downlinkSinr;
1603 uint32_t downlinkRate;
1604 uint32_t nRcvBytes;
1605 uint32_t nXmitBytes;
1606
1607 /*
1608 * Following elements are valid and filled in correctly. They have
1609 * valid values.
1610 */
1611
1612 /* Unicast frames and bytes. */
1613 tAniTxRxStats ucStats;
1614
1615 /* Broadcast frames and bytes. */
1616 tAniTxRxStats bcStats;
1617
1618 /* Multicast frames and bytes. */
1619 tAniTxRxStats mcStats;
1620
1621 uint32_t currentTxRate;
1622 uint32_t currentRxRate; /* Rate in 100Kbps */
1623
1624 uint32_t maxTxRate;
1625 uint32_t maxRxRate;
1626
1627 int8_t rssi[SIR_MAX_RX_CHAINS];
1628
1629 tAniSecStats securityStats;
1630
1631 uint8_t currentRxRateIdx; /* This the softmac rate Index. */
1632 uint8_t currentTxRateIdx;
1633
1634} tAniStaStatStruct, *tpAniStaStatStruct;
1635
1636typedef enum sPacketType {
1637 ePACKET_TYPE_UNKNOWN,
1638 ePACKET_TYPE_11A,
1639 ePACKET_TYPE_11G,
1640 ePACKET_TYPE_11B,
1641 ePACKET_TYPE_11N
1642} tPacketType, *tpPacketType;
1643
1644/* / Definition for Disassociation response */
1645typedef struct sSirSmeDisassocRsp {
1646 uint16_t messageType; /* eWNI_SME_DISASSOC_RSP */
1647 uint16_t length;
1648 uint8_t sessionId; /* Session ID */
1649 uint16_t transactionId; /* Transaction ID for cmd */
1650 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301651 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001652 tAniStaStatStruct perStaStats; /* STA stats */
1653 uint16_t staId;
Srinivas Girigowdaeaf136a2017-06-12 19:03:19 -07001654} tSirSmeDisassocRsp, *tpSirSmeDisassocRsp;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001655
1656/* / Definition for Disassociation indication from peer */
1657typedef struct sSirSmeDisassocInd {
1658 uint16_t messageType; /* eWNI_SME_DISASSOC_IND */
1659 uint16_t length;
1660 uint8_t sessionId; /* Session Identifier */
1661 uint16_t transactionId; /* Transaction Identifier with PE */
1662 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301663 struct qdf_mac_addr bssid;
1664 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001665 tAniStaStatStruct perStaStats; /* STA stats */
1666 uint16_t staId;
1667 uint32_t reasonCode;
1668} tSirSmeDisassocInd, *tpSirSmeDisassocInd;
1669
1670/* / Definition for Disassociation confirm */
1671/* / MAC ---> */
1672typedef struct sSirSmeDisassocCnf {
1673 uint16_t messageType; /* eWNI_SME_DISASSOC_CNF */
1674 uint16_t length;
1675 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301676 struct qdf_mac_addr bssid;
1677 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001678} tSirSmeDisassocCnf, *tpSirSmeDisassocCnf,
1679 tSirSmeDeauthCnf, *tpSirSmeDeauthCnf;
1680
Hanumantha Reddy Pothula3e5d6aa2016-09-08 15:21:54 +05301681/**
1682 * struct sir_sme_discon_done_ind - disconnect done indiaction
1683 * @message_type: msg type
1684 * @length: length of msg
1685 * @session_id: session id of the indication
1686 * @reason_code: reason for disconnect indication
1687 * @peer_mac: peer mac
1688 */
1689struct sir_sme_discon_done_ind {
1690 uint16_t message_type;
1691 uint16_t length;
1692 uint8_t session_id;
1693 tSirResultCodes reason_code;
1694 tSirMacAddr peer_mac;
1695};
1696
1697
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001698/* / Definition for Deauthetication request */
1699typedef struct sSirSmeDeauthReq {
1700 uint16_t messageType; /* eWNI_SME_DEAUTH_REQ */
1701 uint16_t length;
1702 uint8_t sessionId; /* Session ID */
1703 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301704 struct qdf_mac_addr bssid; /* AP BSSID */
1705 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001706 uint16_t reasonCode;
1707} tSirSmeDeauthReq, *tpSirSmeDeauthReq;
1708
1709/* / Definition for Deauthetication response */
1710typedef struct sSirSmeDeauthRsp {
1711 uint16_t messageType; /* eWNI_SME_DEAUTH_RSP */
1712 uint16_t length;
1713 uint8_t sessionId; /* Session ID */
1714 uint16_t transactionId; /* Transaction ID for cmd */
1715 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301716 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001717} tSirSmeDeauthRsp, *tpSirSmeDeauthRsp;
1718
1719/* / Definition for Deauthetication indication from peer */
1720typedef struct sSirSmeDeauthInd {
1721 uint16_t messageType; /* eWNI_SME_DEAUTH_IND */
1722 uint16_t length;
1723 uint8_t sessionId; /* Added for BT-AMP */
1724 uint16_t transactionId; /* Added for BT-AMP */
1725 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301726 struct qdf_mac_addr bssid; /* AP BSSID */
1727 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001728
1729 uint16_t staId;
1730 uint32_t reasonCode;
Kiran Kumar Lokere37d3aa22015-11-03 14:58:26 -08001731 int8_t rssi;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001732} tSirSmeDeauthInd, *tpSirSmeDeauthInd;
1733
1734/* / Definition for stop BSS request message */
1735typedef struct sSirSmeStopBssReq {
1736 uint16_t messageType; /* eWNI_SME_STOP_BSS_REQ */
1737 uint16_t length;
1738 uint8_t sessionId; /* Session ID */
1739 uint16_t transactionId; /* tranSaction ID for cmd */
1740 tSirResultCodes reasonCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301741 struct qdf_mac_addr bssid; /* Self BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001742} tSirSmeStopBssReq, *tpSirSmeStopBssReq;
1743
1744/* / Definition for stop BSS response message */
1745typedef struct sSirSmeStopBssRsp {
1746 uint16_t messageType; /* eWNI_SME_STOP_BSS_RSP */
1747 uint16_t length;
1748 tSirResultCodes statusCode;
1749 uint8_t sessionId; /* Session ID */
1750 uint16_t transactionId; /* Transaction ID for cmd */
1751} tSirSmeStopBssRsp, *tpSirSmeStopBssRsp;
1752
1753/* / Definition for Channel Switch indication for station */
1754/* / MAC ---> */
1755typedef struct sSirSmeSwitchChannelInd {
1756 uint16_t messageType; /* eWNI_SME_SWITCH_CHL_IND */
1757 uint16_t length;
1758 uint8_t sessionId;
1759 uint16_t newChannelId;
Amar Singhal5cccafe2017-02-15 12:42:58 -08001760 struct ch_params chan_params;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301761 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001762} tSirSmeSwitchChannelInd, *tpSirSmeSwitchChannelInd;
1763
1764/* / Definition for Neighbor BSS indication */
1765/* / MAC ---> */
1766/* / MAC reports this each time a new I/BSS is detected */
1767typedef struct sSirSmeNeighborBssInd {
1768 uint16_t messageType; /* eWNI_SME_NEIGHBOR_BSS_IND */
1769 uint16_t length;
1770 uint8_t sessionId;
1771 tSirBssDescription bssDescription[1];
1772} tSirSmeNeighborBssInd, *tpSirSmeNeighborBssInd;
1773
1774/* / Definition for MIC failure indication */
1775/* / MAC ---> */
1776/* / MAC reports this each time a MIC failure occures on Rx TKIP packet */
1777typedef struct sSirSmeMicFailureInd {
1778 uint16_t messageType; /* eWNI_SME_MIC_FAILURE_IND */
1779 uint16_t length;
1780 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301781 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001782 tSirMicFailureInfo info;
1783} tSirSmeMicFailureInd, *tpSirSmeMicFailureInd;
1784
1785typedef struct sSirSmeMissedBeaconInd {
1786 uint16_t messageType; /* eWNI_SME_MISSED_BEACON_IND */
1787 uint16_t length;
1788 uint8_t bssIdx;
1789} tSirSmeMissedBeaconInd, *tpSirSmeMissedBeaconInd;
1790
1791/* / Definition for Set Context request */
1792/* / ---> MAC */
1793typedef struct sSirSmeSetContextReq {
1794 uint16_t messageType; /* eWNI_SME_SET_CONTEXT_REQ */
1795 uint16_t length;
1796 uint8_t sessionId; /* Session ID */
1797 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05301798 struct qdf_mac_addr peer_macaddr;
1799 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001800 tSirKeyMaterial keyMaterial;
1801} tSirSmeSetContextReq, *tpSirSmeSetContextReq;
1802
1803/* / Definition for Set Context response */
1804/* / MAC ---> */
1805typedef struct sSirSmeSetContextRsp {
1806 uint16_t messageType; /* eWNI_SME_SET_CONTEXT_RSP */
1807 uint16_t length;
1808 uint8_t sessionId; /* Session ID */
1809 uint16_t transactionId; /* Transaction ID for cmd */
1810 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05301811 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001812} tSirSmeSetContextRsp, *tpSirSmeSetContextRsp;
1813
1814/* / Statistic definitions */
1815/* ============================================================= */
1816/* Per STA statistic structure; This same struct will be used for Aggregate */
1817/* STA stats as well. */
1818
1819/* Clear radio stats and clear per sta stats */
1820typedef enum {
1821 eANI_CLEAR_ALL_STATS, /* Clears all stats */
1822 eANI_CLEAR_RX_STATS, /* Clears RX stats of the radio interface */
1823 eANI_CLEAR_TX_STATS, /* Clears TX stats of the radio interface */
1824 eANI_CLEAR_RADIO_STATS, /* Clears all the radio stats */
1825 eANI_CLEAR_PER_STA_STATS, /* Clears Per STA stats */
1826 eANI_CLEAR_AGGR_PER_STA_STATS, /* Clears aggregate stats */
1827
1828 /* Used to distinguish between per sta to security stats. */
1829 /* Used only by AP, FW just returns the same param as it received. */
1830 eANI_LINK_STATS, /* Get Per STA stats */
1831 eANI_SECURITY_STATS, /* Get Per STA security stats */
1832
1833 eANI_CLEAR_STAT_TYPES_END
1834} tAniStatSubTypes;
1835
1836typedef struct sAniTxCtrs {
1837 /* add the rate counters here */
1838 uint32_t tx1Mbps;
1839 uint32_t tx2Mbps;
1840 uint32_t tx5_5Mbps;
1841 uint32_t tx6Mbps;
1842 uint32_t tx9Mbps;
1843 uint32_t tx11Mbps;
1844 uint32_t tx12Mbps;
1845 uint32_t tx18Mbps;
1846 uint32_t tx24Mbps;
1847 uint32_t tx36Mbps;
1848 uint32_t tx48Mbps;
1849 uint32_t tx54Mbps;
1850 uint32_t tx72Mbps;
1851 uint32_t tx96Mbps;
1852 uint32_t tx108Mbps;
1853
1854 /* tx path radio counts */
1855 uint32_t txFragHi;
1856 uint32_t txFragLo;
1857 uint32_t txFrameHi;
1858 uint32_t txFrameLo;
1859 uint32_t txMulticastFrameHi;
1860 uint32_t txMulticastFrameLo;
1861 uint32_t txFailedHi;
1862 uint32_t txFailedLo;
1863 uint32_t multipleRetryHi;
1864 uint32_t multipleRetryLo;
1865 uint32_t singleRetryHi;
1866 uint32_t singleRetryLo;
1867 uint32_t ackFailureHi;
1868 uint32_t ackFailureLo;
1869 uint32_t xmitBeacons;
1870} tAniTxCtrs, *tpAniTxCtrs;
1871
1872typedef struct sAniRxCtrs {
1873 /* receive frame rate counters */
1874 uint32_t rx1Mbps;
1875 uint32_t rx2Mbps;
1876 uint32_t rx5_5Mbps;
1877 uint32_t rx6Mbps;
1878 uint32_t rx9Mbps;
1879 uint32_t rx11Mbps;
1880 uint32_t rx12Mbps;
1881 uint32_t rx18Mbps;
1882 uint32_t rx24Mbps;
1883 uint32_t rx36Mbps;
1884 uint32_t rx48Mbps;
1885 uint32_t rx54Mbps;
1886 uint32_t rx72Mbps;
1887 uint32_t rx96Mbps;
1888 uint32_t rx108Mbps;
1889
1890 /* receive size counters; 'Lte' = Less than or equal to */
1891 uint32_t rxLte64;
1892 uint32_t rxLte128Gt64;
1893 uint32_t rxLte256Gt128;
1894 uint32_t rxLte512Gt256;
1895 uint32_t rxLte1kGt512;
1896 uint32_t rxLte1518Gt1k;
1897 uint32_t rxLte2kGt1518;
1898 uint32_t rxLte4kGt2k;
1899
1900 /* rx radio stats */
1901 uint32_t rxFrag;
1902 uint32_t rxFrame;
1903 uint32_t fcsError;
1904 uint32_t rxMulticast;
1905 uint32_t duplicate;
1906 uint32_t rtsSuccess;
1907 uint32_t rtsFailed;
1908 uint32_t wepUndecryptables;
1909 uint32_t drops;
1910 uint32_t aesFormatErrorUcastCnts;
1911 uint32_t aesReplaysUcast;
1912 uint32_t aesDecryptErrUcast;
1913} tAniRxCtrs, *tpAniRxCtrs;
1914
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001915/* *************************************************************** */
1916
1917/*******************PE Statistics*************************/
1918
1919/*
1920 * tpAniGetPEStatsReq is tied to
1921 * for SME ==> PE eWNI_SME_GET_STATISTICS_REQ msgId and
1922 * for PE ==> HAL SIR_HAL_GET_STATISTICS_REQ msgId
1923 */
1924typedef struct sAniGetPEStatsReq {
1925 /* Common for all types are requests */
1926 uint16_t msgType; /* message type is same as the request type */
1927 uint16_t msgLen; /* length of the entire request */
1928 uint32_t staId; /* Per STA stats request must contain valid */
1929 /* categories of stats requested. look at ePEStatsMask */
1930 uint32_t statsMask;
1931 uint8_t sessionId;
1932} tAniGetPEStatsReq, *tpAniGetPEStatsReq;
1933
1934/*
1935 * tpAniGetPEStatsRsp is tied to
1936 * for PE ==> SME eWNI_SME_GET_STATISTICS_RSP msgId and
1937 * for HAL ==> PE SIR_HAL_GET_STATISTICS_RSP msgId
1938 */
1939typedef struct sAniGetPEStatsRsp {
1940 /* Common for all types are responses */
1941 uint16_t msgType; /* message type is same as the request type */
1942 /* length of the entire request, includes the pStatsBuf length too */
1943 uint16_t msgLen;
1944 uint8_t sessionId;
1945 uint32_t rc; /* success/failure */
1946 uint32_t staId; /* Per STA stats request must contain valid */
1947 /* categories of stats requested. look at ePEStatsMask */
1948 uint32_t statsMask;
1949 /* void *pStatsBuf; */
1950 /*
1951 * The Stats buffer starts here and can be an aggregate of more than one
1952 * statistics structure depending on statsMask. The void pointer
1953 * "pStatsBuf" is commented out intentionally and the src code that uses
1954 * this structure should take that into account.
1955 */
1956} tAniGetPEStatsRsp, *tpAniGetPEStatsRsp;
1957
1958typedef struct sAniGetRssiReq {
1959 /* Common for all types are requests */
1960 uint16_t msgType; /* message type is same as the request type */
1961 uint16_t msgLen; /* length of the entire request */
1962 uint8_t sessionId;
1963 uint8_t staId;
1964 int8_t lastRSSI; /* in case of error, return last RSSI */
1965 void *rssiCallback;
1966 void *pDevContext; /* device context */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001967} tAniGetRssiReq, *tpAniGetRssiReq;
1968
1969typedef struct sAniGetSnrReq {
1970 /* Common for all types are requests */
1971 uint16_t msgType; /* message type is same as the request type */
1972 uint16_t msgLen; /* length of the entire request */
1973 uint8_t sessionId;
1974 uint8_t staId;
1975 void *snrCallback;
1976 void *pDevContext; /* device context */
1977 int8_t snr;
1978} tAniGetSnrReq, *tpAniGetSnrReq;
1979
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001980/* Change country code request MSG structure */
1981typedef struct sAniChangeCountryCodeReq {
1982 /* Common for all types are requests */
1983 uint16_t msgType; /* message type is same as the request type */
1984 uint16_t msgLen; /* length of the entire request */
1985 uint8_t countryCode[WNI_CFG_COUNTRY_CODE_LEN]; /* 3 char country code */
Srinivas Girigowda74a66d62017-06-21 23:28:25 -07001986 bool countryFromUserSpace;
1987 bool sendRegHint; /* true if we want to send hint to NL80211 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001988 void *changeCCCallback;
1989 void *pDevContext; /* device context */
1990 void *p_cds_context; /* cds context */
1991
1992} tAniChangeCountryCodeReq, *tpAniChangeCountryCodeReq;
1993
1994/**
1995 * struct ani_scan_req - Scan request
1996 * @msg_type: Message type
1997 * @msg_len: Message Length
1998 * @session_id: SME session Id
1999 * @scan_param: scan request parameter
2000 * @callback: call back function for scan result
2001 * @ctx: Global context
2002 *
2003 * Scan request message structure
2004 */
2005struct ani_scan_req {
2006 /* message type is same as the request type */
2007 uint16_t msg_type;
2008 /* length of the entire request */
2009 uint16_t msg_len;
2010 uint16_t session_id;
2011 void *scan_param;
2012 void *callback;
2013 void *ctx;
2014};
2015
2016/**
2017 * struct ani_roc_req - Remain on channel request
2018 * @msg_type: Message type
2019 * @msg_len: Message Length
2020 * @session_id: SME session Id
2021 * @channel: channel number
2022 * @callback: call back function for scan result
2023 * @duration: Roc duration
2024 * @is_p2pprobe_allowed : flag for p2p probe request
2025 * @ctx: Global context
2026 * @scan_id: Scan Identifier
2027 *
2028 * Remain on channel request message structure
2029 */
2030struct ani_roc_req {
2031 /* message type is same as the request type */
2032 uint16_t msg_type;
2033 /* length of the entire request */
2034 uint16_t msg_len;
2035 uint16_t session_id;
2036 uint8_t channel;
2037 uint32_t duration;
2038 uint8_t is_p2pprobe_allowed;
2039 void *callback;
2040 void *ctx;
2041 uint32_t scan_id;
2042};
2043
2044/* generic country code change request MSG structure */
2045typedef struct sAniGenericChangeCountryCodeReq {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002046 uint16_t msgType; /* message type is same as the request type */
2047 uint16_t msgLen; /* length of the entire request */
2048 uint8_t countryCode[WNI_CFG_COUNTRY_CODE_LEN]; /* 3 char country code */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002049} tAniGenericChangeCountryCodeReq, *tpAniGenericChangeCountryCodeReq;
2050
Srinivas Girigowda296105a2015-09-24 16:31:16 -07002051/**
2052 * struct sAniDHCPStopInd - DHCP Stop indication message
2053 * @msgType: message type is same as the request type
2054 * @msgLen: length of the entire request
2055 * @device_mode: Mode of the device(ex:STA, AP)
2056 * @adapterMacAddr: MAC address of the adapter
2057 * @peerMacAddr: MAC address of the connected peer
2058 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002059typedef struct sAniDHCPStopInd {
Srinivas Girigowda296105a2015-09-24 16:31:16 -07002060 uint16_t msgType;
2061 uint16_t msgLen;
2062 uint8_t device_mode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302063 struct qdf_mac_addr adapterMacAddr;
2064 struct qdf_mac_addr peerMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002065} tAniDHCPInd, *tpAniDHCPInd;
2066
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08002067typedef struct sAniTXFailMonitorInd {
2068 uint16_t msgType; /* message type is same as the request type */
2069 uint16_t msgLen; /* length of the entire request */
2070 uint8_t tx_fail_count;
2071 void *txFailIndCallback;
2072} tAniTXFailMonitorInd, *tpAniTXFailMonitorInd;
2073
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002074typedef enum eTxRateInfo {
2075 eHAL_TX_RATE_LEGACY = 0x1, /* Legacy rates */
2076 eHAL_TX_RATE_HT20 = 0x2, /* HT20 rates */
2077 eHAL_TX_RATE_HT40 = 0x4, /* HT40 rates */
2078 eHAL_TX_RATE_SGI = 0x8, /* Rate with Short guard interval */
2079 eHAL_TX_RATE_LGI = 0x10, /* Rate with Long guard interval */
2080 eHAL_TX_RATE_VHT20 = 0x20, /* VHT 20 rates */
2081 eHAL_TX_RATE_VHT40 = 0x40, /* VHT 40 rates */
2082 eHAL_TX_RATE_VHT80 = 0x80 /* VHT 80 rates */
2083} tTxrateinfoflags;
2084
2085/**********************PE Statistics end*************************/
2086
2087typedef struct sSirP2PNoaStart {
2088 uint32_t status;
2089 uint32_t bssIdx;
2090} tSirP2PNoaStart, *tpSirP2PNoaStart;
2091
2092typedef struct sSirTdlsInd {
2093 uint16_t status;
2094 uint16_t assocId;
2095 uint16_t staIdx;
2096 uint16_t reasonCode;
2097} tSirTdlsInd, *tpSirTdlsInd;
2098
2099typedef struct sSirP2PNoaAttr {
2100#ifdef ANI_BIG_BYTE_ENDIAN
2101 uint32_t index:8;
2102 uint32_t oppPsFlag:1;
2103 uint32_t ctWin:7;
2104 uint32_t rsvd1:16;
2105#else
2106 uint32_t rsvd1:16;
2107 uint32_t ctWin:7;
2108 uint32_t oppPsFlag:1;
2109 uint32_t index:8;
2110#endif
2111
2112#ifdef ANI_BIG_BYTE_ENDIAN
2113 uint32_t uNoa1IntervalCnt:8;
2114 uint32_t rsvd2:24;
2115#else
2116 uint32_t rsvd2:24;
2117 uint32_t uNoa1IntervalCnt:8;
2118#endif
2119 uint32_t uNoa1Duration;
2120 uint32_t uNoa1Interval;
2121 uint32_t uNoa1StartTime;
2122
2123#ifdef ANI_BIG_BYTE_ENDIAN
2124 uint32_t uNoa2IntervalCnt:8;
2125 uint32_t rsvd3:24;
2126#else
2127 uint32_t rsvd3:24;
2128 uint32_t uNoa2IntervalCnt:8;
2129#endif
2130 uint32_t uNoa2Duration;
2131 uint32_t uNoa2Interval;
2132 uint32_t uNoa2StartTime;
2133} tSirP2PNoaAttr, *tpSirP2PNoaAttr;
2134
2135typedef struct sSirTclasInfo {
2136 tSirMacTclasIE tclas;
2137 uint8_t version; /* applies only for classifier type ip */
2138 union {
2139 tSirMacTclasParamEthernet eth;
2140 tSirMacTclasParamIPv4 ipv4;
2141 tSirMacTclasParamIPv6 ipv6;
2142 tSirMacTclasParam8021dq t8021dq;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302143 } qdf_packed tclasParams;
2144} qdf_packed tSirTclasInfo;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002145
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002146typedef struct sSirAddtsReqInfo {
2147 uint8_t dialogToken;
2148 tSirMacTspecIE tspec;
2149
2150 uint8_t numTclas; /* number of Tclas elements */
2151 tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM];
2152 uint8_t tclasProc;
2153#if defined(FEATURE_WLAN_ESE)
2154 tSirMacESETSRSIE tsrsIE;
2155 uint8_t tsrsPresent:1;
2156#endif
2157 uint8_t wmeTspecPresent:1;
2158 uint8_t wsmTspecPresent:1;
2159 uint8_t lleTspecPresent:1;
2160 uint8_t tclasProcPresent:1;
2161} tSirAddtsReqInfo, *tpSirAddtsReqInfo;
2162
2163typedef struct sSirAddtsRspInfo {
2164 uint8_t dialogToken;
2165 tSirMacStatusCodes status;
2166 tSirMacTsDelayIE delay;
2167
2168 tSirMacTspecIE tspec;
2169 uint8_t numTclas; /* number of Tclas elements */
2170 tSirTclasInfo tclasInfo[SIR_MAC_TCLASIE_MAXNUM];
2171 uint8_t tclasProc;
2172 tSirMacScheduleIE schedule;
Srinivas Girigowda515a9ef2015-12-11 11:00:48 -08002173#ifdef FEATURE_WLAN_ESE
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002174 tSirMacESETSMIE tsmIE;
2175 uint8_t tsmPresent:1;
2176#endif
2177 uint8_t wmeTspecPresent:1;
2178 uint8_t wsmTspecPresent:1;
2179 uint8_t lleTspecPresent:1;
2180 uint8_t tclasProcPresent:1;
2181 uint8_t schedulePresent:1;
2182} tSirAddtsRspInfo, *tpSirAddtsRspInfo;
2183
2184typedef struct sSirDeltsReqInfo {
2185 tSirMacTSInfo tsinfo;
2186 tSirMacTspecIE tspec;
2187 uint8_t wmeTspecPresent:1;
2188 uint8_t wsmTspecPresent:1;
2189 uint8_t lleTspecPresent:1;
2190} tSirDeltsReqInfo, *tpSirDeltsReqInfo;
2191
2192/* / Add a tspec as defined */
2193typedef struct sSirAddtsReq {
2194 uint16_t messageType; /* eWNI_SME_ADDTS_REQ */
2195 uint16_t length;
2196 uint8_t sessionId; /* Session ID */
2197 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302198 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002199 uint32_t timeout; /* in ms */
2200 uint8_t rspReqd;
2201 tSirAddtsReqInfo req;
2202} tSirAddtsReq, *tpSirAddtsReq;
2203
2204typedef struct sSirAddtsRsp {
2205 uint16_t messageType; /* eWNI_SME_ADDTS_RSP */
2206 uint16_t length;
2207 uint8_t sessionId; /* sme sessionId Added for BT-AMP support */
2208 uint16_t transactionId; /* sme transaction Id - for BT-AMP Support */
2209 uint32_t rc; /* return code */
2210 tSirAddtsRspInfo rsp;
2211} tSirAddtsRsp, *tpSirAddtsRsp;
2212
2213typedef struct sSirDeltsReq {
2214 uint16_t messageType; /* eWNI_SME_DELTS_REQ */
2215 uint16_t length;
2216 uint8_t sessionId; /* Session ID */
2217 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302218 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002219 uint16_t aid; /* use 0 if macAddr is being specified */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302220 struct qdf_mac_addr macaddr; /* only on AP to specify the STA */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002221 uint8_t rspReqd;
2222 tSirDeltsReqInfo req;
2223} tSirDeltsReq, *tpSirDeltsReq;
2224
2225typedef struct sSirDeltsRsp {
2226 uint16_t messageType; /* eWNI_SME_DELTS_RSP */
2227 uint16_t length;
2228 uint8_t sessionId; /* sme sessionId Added for BT-AMP support */
2229 uint16_t transactionId; /* sme transaction Id - for BT-AMP Support */
2230 uint32_t rc;
2231 uint16_t aid; /* use 0 if macAddr is being specified */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302232 struct qdf_mac_addr macaddr; /* only on AP to specify the STA */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002233 tSirDeltsReqInfo rsp;
2234} tSirDeltsRsp, *tpSirDeltsRsp;
2235
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002236#define SIR_QOS_NUM_AC_MAX 4
2237
2238typedef struct sSirAggrQosReqInfo {
2239 uint16_t tspecIdx;
2240 tSirAddtsReqInfo aggrAddTsInfo[SIR_QOS_NUM_AC_MAX];
2241} tSirAggrQosReqInfo, *tpSirAggrQosReqInfo;
2242
2243typedef struct sSirAggrQosReq {
2244 uint16_t messageType; /* eWNI_SME_ADDTS_REQ */
2245 uint16_t length;
2246 uint8_t sessionId; /* Session ID */
2247 uint16_t transactionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302248 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002249 uint32_t timeout; /* in ms */
2250 uint8_t rspReqd;
2251 tSirAggrQosReqInfo aggrInfo;
2252} tSirAggrQosReq, *tpSirAggrQosReq;
2253
2254typedef struct sSirAggrQosRspInfo {
2255 uint16_t tspecIdx;
2256 tSirAddtsRspInfo aggrRsp[SIR_QOS_NUM_AC_MAX];
2257} tSirAggrQosRspInfo, *tpSirAggrQosRspInfo;
2258
2259typedef struct sSirAggrQosRsp {
2260 uint16_t messageType;
2261 uint16_t length;
2262 uint8_t sessionId;
2263 tSirAggrQosRspInfo aggrInfo;
2264} tSirAggrQosRsp, *tpSirAggrQosRsp;
2265
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002266
2267typedef struct sSirQosMapSet {
2268 uint8_t present;
2269 uint8_t num_dscp_exceptions;
2270 uint8_t dscp_exceptions[21][2];
2271 uint8_t dscp_range[8][2];
2272} tSirQosMapSet, *tpSirQosMapSet;
2273
2274typedef struct sSmeIbssPeerInd {
2275 uint16_t mesgType;
2276 uint16_t mesgLen;
2277 uint8_t sessionId;
2278
Anurag Chouhan6d760662016-02-20 16:05:43 +05302279 struct qdf_mac_addr peer_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002280 uint16_t staId;
2281
2282 /*
2283 * The DPU signatures will be sent eventually to TL to help it determine
2284 * the association to which a packet belongs to
2285 */
2286 /* Unicast DPU signature */
2287 uint8_t ucastSig;
2288
2289 /*Broadcast DPU signature */
2290 uint8_t bcastSig;
2291
2292 /* Beacon will be appended for new Peer indication. */
2293} tSmeIbssPeerInd, *tpSmeIbssPeerInd;
2294
2295typedef struct sSirIbssPeerInactivityInd {
2296 uint8_t bssIdx;
2297 uint8_t staIdx;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302298 struct qdf_mac_addr peer_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002299} tSirIbssPeerInactivityInd, *tpSirIbssPeerInactivityInd;
2300
2301typedef struct sLimScanChn {
2302 uint16_t numTimeScan; /* how many time this channel is scan */
2303 uint8_t channelId;
2304} tLimScanChn;
2305
gaoleze5108942017-03-31 16:56:42 +08002306/**
2307 * struct lim_channel_status
2308 * @channelfreq: Channel freq
2309 * @noise_floor: Noise Floor value
2310 * @rx_clear_count: rx clear count
2311 * @cycle_count: cycle count
2312 * @chan_tx_pwr_range: channel tx power per range in 0.5dBm steps
2313 * @chan_tx_pwr_throughput: channel tx power per throughput
2314 * @rx_frame_count: rx frame count (cumulative)
2315 * @bss_rx_cycle_count: BSS rx cycle count
2316 * @rx_11b_mode_data_duration: b-mode data rx time (units are microseconds)
2317 * @tx_frame_count: BSS tx cycle count
2318 * @mac_clk_mhz: sample frequency
2319 * @channel_id: channel index
2320 * @cmd_flags: indicate which stat event is this status coming from
2321 */
2322struct lim_channel_status {
2323 uint32_t channelfreq;
2324 uint32_t noise_floor;
2325 uint32_t rx_clear_count;
2326 uint32_t cycle_count;
2327 uint32_t chan_tx_pwr_range;
2328 uint32_t chan_tx_pwr_throughput;
2329 uint32_t rx_frame_count;
2330 uint32_t bss_rx_cycle_count;
2331 uint32_t rx_11b_mode_data_duration;
2332 uint32_t tx_frame_count;
2333 uint32_t mac_clk_mhz;
2334 uint32_t channel_id;
2335 uint32_t cmd_flags;
2336};
2337
2338/**
2339 * struct lim_scan_channel_status
2340 * @total_channel: total number of be scanned channel
2341 * @channel_status_list: channel status info store in this array
2342 */
2343struct lim_scan_channel_status {
2344 uint8_t total_channel;
2345 struct lim_channel_status
2346 channel_status_list[SIR_MAX_SUPPORTED_CHANNEL_LIST];
2347};
2348
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002349typedef struct sSmeGetScanChnRsp {
2350 /* Message Type */
2351 uint16_t mesgType;
2352 /* Message Length */
2353 uint16_t mesgLen;
2354 uint8_t sessionId;
2355 uint8_t numChn;
2356 tLimScanChn scanChn[1];
2357} tSmeGetScanChnRsp, *tpSmeGetScanChnRsp;
2358
2359typedef struct sLimScanChnInfo {
2360 uint8_t numChnInfo; /* number of channels in scanChn */
2361 tLimScanChn scanChn[SIR_MAX_SUPPORTED_CHANNEL_LIST];
2362} tLimScanChnInfo;
2363
2364typedef struct sSirSmeGetAssocSTAsReq {
2365 uint16_t messageType; /* eWNI_SME_GET_ASSOC_STAS_REQ */
2366 uint16_t length;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302367 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002368 uint16_t modId;
2369 void *pUsrContext;
2370 void *pSapEventCallback;
2371 /* Pointer to allocated mem passed in wlansap_get_assoc_stations API */
2372 void *pAssocStasArray;
2373} tSirSmeGetAssocSTAsReq, *tpSirSmeGetAssocSTAsReq;
2374
2375typedef struct sSmeMaxAssocInd {
2376 uint16_t mesgType; /* eWNI_SME_MAX_ASSOC_EXCEEDED */
2377 uint16_t mesgLen;
2378 uint8_t sessionId;
2379 /* the new peer that got rejected max assoc limit reached */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302380 struct qdf_mac_addr peer_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002381} tSmeMaxAssocInd, *tpSmeMaxAssocInd;
2382
2383typedef struct sSmeCsaOffloadInd {
2384 uint16_t mesgType; /* eWNI_SME_CSA_OFFLOAD_EVENT */
2385 uint16_t mesgLen;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302386 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002387} tSmeCsaOffloadInd, *tpSmeCsaOffloadInd;
2388
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002389/* SME->PE: Enter WOWLAN parameters */
2390typedef struct sSirSmeWowlEnterParams {
2391 uint8_t sessionId;
2392
2393 /* Enables/disables magic packet filtering */
2394 uint8_t ucMagicPktEnable;
2395
2396 /* Magic pattern */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302397 struct qdf_mac_addr magic_ptrn;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002398
2399 /* Enables/disables packet pattern filtering */
2400 uint8_t ucPatternFilteringEnable;
2401
2402#ifdef WLAN_WAKEUP_EVENTS
2403 /*
2404 * This configuration directs the WoW packet filtering to look at EAP-ID
2405 * requests embedded in EAPOL frames and use this as a wake source.
2406 */
2407 uint8_t ucWoWEAPIDRequestEnable;
2408
2409 /*
2410 * This configuration directs the WoW packet filtering to look for
2411 * EAPOL-4WAY requests and use this as a wake source.
2412 */
2413 uint8_t ucWoWEAPOL4WayEnable;
2414
2415 /*
2416 * This configuration allows a host wakeup on an network scan
2417 * offload match.
2418 */
2419 uint8_t ucWowNetScanOffloadMatch;
2420
2421 /* This configuration allows a host wakeup on any GTK rekeying error.
2422 */
2423 uint8_t ucWowGTKRekeyError;
2424
2425 /* This configuration allows a host wakeup on BSS connection loss.
2426 */
2427 uint8_t ucWoWBSSConnLoss;
2428#endif /* WLAN_WAKEUP_EVENTS */
2429
Anurag Chouhan6d760662016-02-20 16:05:43 +05302430 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002431} tSirSmeWowlEnterParams, *tpSirSmeWowlEnterParams;
2432
2433/* PE<->HAL: Enter WOWLAN parameters */
2434typedef struct sSirHalWowlEnterParams {
2435 uint8_t sessionId;
2436
2437 /* Enables/disables magic packet filtering */
2438 uint8_t ucMagicPktEnable;
2439
2440 /* Magic pattern */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302441 struct qdf_mac_addr magic_ptrn;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002442
2443 /* Enables/disables packet pattern filtering in firmware.
2444 Enabling this flag enables broadcast pattern matching
2445 in Firmware. If unicast pattern matching is also desired,
2446 ucUcastPatternFilteringEnable flag must be set tot true
2447 as well
2448 */
2449 uint8_t ucPatternFilteringEnable;
2450
2451 /* Enables/disables unicast packet pattern filtering.
2452 This flag specifies whether we want to do pattern match
2453 on unicast packets as well and not just broadcast packets.
2454 This flag has no effect if the ucPatternFilteringEnable
2455 (main controlling flag) is set to false
2456 */
2457 uint8_t ucUcastPatternFilteringEnable;
2458
2459 /* This configuration is valid only when magicPktEnable=1.
2460 * It requests hardware to wake up when it receives the
2461 * Channel Switch Action Frame.
2462 */
2463 uint8_t ucWowChnlSwitchRcv;
2464
2465 /* This configuration is valid only when magicPktEnable=1.
2466 * It requests hardware to wake up when it receives the
2467 * Deauthentication Frame.
2468 */
2469 uint8_t ucWowDeauthRcv;
2470
2471 /* This configuration is valid only when magicPktEnable=1.
2472 * It requests hardware to wake up when it receives the
2473 * Disassociation Frame.
2474 */
2475 uint8_t ucWowDisassocRcv;
2476
2477 /* This configuration is valid only when magicPktEnable=1.
2478 * It requests hardware to wake up when it has missed
2479 * consecutive beacons. This is a hardware register
2480 * configuration (NOT a firmware configuration).
2481 */
2482 uint8_t ucWowMaxMissedBeacons;
2483
2484 /* This configuration is valid only when magicPktEnable=1.
2485 * This is a timeout value in units of microsec. It requests
2486 * hardware to unconditionally wake up after it has stayed
2487 * in WoWLAN mode for some time. Set 0 to disable this feature.
2488 */
2489 uint8_t ucWowMaxSleepUsec;
2490
2491#ifdef WLAN_WAKEUP_EVENTS
2492 /* This config directs the WoW pkt filtering to look for EAP-ID
2493 * requests embedded in EAPOL frames and use this as a wake source.
2494 */
2495 uint8_t ucWoWEAPIDRequestEnable;
2496
2497 /* This config directs the WoW pkt filtering to look for EAPOL-4WAY
2498 * requests and use this as a wake source.
2499 */
2500 uint8_t ucWoWEAPOL4WayEnable;
2501
2502 /* This config allows a host wakeup on an network scan offload match.
2503 */
2504 uint8_t ucWowNetScanOffloadMatch;
2505
2506 /* This configuration allows a host wakeup on any GTK rekeying error.
2507 */
2508 uint8_t ucWowGTKRekeyError;
2509
2510 /* This configuration allows a host wakeup on BSS connection loss.
2511 */
2512 uint8_t ucWoWBSSConnLoss;
2513#endif /* WLAN_WAKEUP_EVENTS */
2514
2515 /* Status code to be filled by HAL when it sends
2516 * SIR_HAL_WOWL_ENTER_RSP to PE.
2517 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302518 QDF_STATUS status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002519
2520 /*BSSID to find the current session
2521 */
2522 uint8_t bssIdx;
2523} tSirHalWowlEnterParams, *tpSirHalWowlEnterParams;
2524
2525/* SME->PE: Exit WOWLAN parameters */
2526typedef struct sSirSmeWowlExitParams {
2527 uint8_t sessionId;
2528
2529} tSirSmeWowlExitParams, *tpSirSmeWowlExitParams;
2530
2531/* PE<->HAL: Exit WOWLAN parameters */
2532typedef struct sSirHalWowlExitParams {
2533 uint8_t sessionId;
2534
2535 /* Status code to be filled by HAL when it sends
2536 * SIR_HAL_WOWL_EXIT_RSP to PE.
2537 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05302538 QDF_STATUS status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002539
2540 /*BSSIDX to find the current session
2541 */
2542 uint8_t bssIdx;
2543} tSirHalWowlExitParams, *tpSirHalWowlExitParams;
2544
2545#define SIR_MAX_NAME_SIZE 64
2546#define SIR_MAX_TEXT_SIZE 32
2547
2548typedef struct sSirName {
2549 uint8_t num_name;
2550 uint8_t name[SIR_MAX_NAME_SIZE];
2551} tSirName;
2552
2553typedef struct sSirText {
2554 uint8_t num_text;
2555 uint8_t text[SIR_MAX_TEXT_SIZE];
2556} tSirText;
2557
2558#define SIR_WPS_PROBRSP_VER_PRESENT 0x00000001
2559#define SIR_WPS_PROBRSP_STATE_PRESENT 0x00000002
2560#define SIR_WPS_PROBRSP_APSETUPLOCK_PRESENT 0x00000004
2561#define SIR_WPS_PROBRSP_SELECTEDREGISTRA_PRESENT 0x00000008
2562#define SIR_WPS_PROBRSP_DEVICEPASSWORDID_PRESENT 0x00000010
2563#define SIR_WPS_PROBRSP_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020
2564#define SIR_WPS_PROBRSP_RESPONSETYPE_PRESENT 0x00000040
2565#define SIR_WPS_PROBRSP_UUIDE_PRESENT 0x00000080
2566#define SIR_WPS_PROBRSP_MANUFACTURE_PRESENT 0x00000100
2567#define SIR_WPS_PROBRSP_MODELNAME_PRESENT 0x00000200
2568#define SIR_WPS_PROBRSP_MODELNUMBER_PRESENT 0x00000400
2569#define SIR_WPS_PROBRSP_SERIALNUMBER_PRESENT 0x00000800
2570#define SIR_WPS_PROBRSP_PRIMARYDEVICETYPE_PRESENT 0x00001000
2571#define SIR_WPS_PROBRSP_DEVICENAME_PRESENT 0x00002000
2572#define SIR_WPS_PROBRSP_CONFIGMETHODS_PRESENT 0x00004000
2573#define SIR_WPS_PROBRSP_RF_BANDS_PRESENT 0x00008000
2574
2575typedef struct sSirWPSProbeRspIE {
2576 uint32_t FieldPresent;
2577 uint32_t Version; /* Version. 0x10 = version 1.0, 0x11 = etc. */
2578 uint32_t wpsState; /* 1 = unconfigured, 2 = configured. */
2579 bool APSetupLocked; /* Must be included if value is true */
2580 /*
2581 * BOOL: indicates if the user has recently activated a Registrar to
2582 * add an Enrollee.
2583 */
2584 bool SelectedRegistra;
2585 uint16_t DevicePasswordID; /* Device Password ID */
2586 /* Selected Registrar config method */
2587 uint16_t SelectedRegistraCfgMethod;
2588 uint8_t ResponseType; /* Response type */
2589 uint8_t UUID_E[16]; /* Unique identifier of the AP. */
2590 tSirName Manufacture;
2591 tSirText ModelName;
2592 tSirText ModelNumber;
2593 tSirText SerialNumber;
2594 /* Device Category ID: 1Computer, 2Input Device, ... */
2595 uint32_t PrimaryDeviceCategory;
2596 /* Vendor specific OUI for Device Sub Category */
2597 uint8_t PrimaryDeviceOUI[4];
2598 /*
2599 Device Sub Category ID: 1-PC, 2-Server if Device Category ID
2600 * is computer
2601 */
2602 uint32_t DeviceSubCategory;
2603 tSirText DeviceName;
2604 uint16_t ConfigMethod; /* Configuaration method */
2605 uint8_t RFBand; /* RF bands available on the AP */
2606} tSirWPSProbeRspIE;
2607
2608#define SIR_WPS_BEACON_VER_PRESENT 0x00000001
2609#define SIR_WPS_BEACON_STATE_PRESENT 0x00000002
2610#define SIR_WPS_BEACON_APSETUPLOCK_PRESENT 0x00000004
2611#define SIR_WPS_BEACON_SELECTEDREGISTRA_PRESENT 0x00000008
2612#define SIR_WPS_BEACON_DEVICEPASSWORDID_PRESENT 0x00000010
2613#define SIR_WPS_BEACON_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020
2614#define SIR_WPS_BEACON_UUIDE_PRESENT 0x00000080
2615#define SIR_WPS_BEACON_RF_BANDS_PRESENT 0x00000100
2616#define SIR_WPS_UUID_LEN 16
2617
2618typedef struct sSirWPSBeaconIE {
2619 uint32_t FieldPresent;
2620 uint32_t Version; /* Version. 0x10 = version 1.0, 0x11 = etc. */
2621 uint32_t wpsState; /* 1 = unconfigured, 2 = configured. */
2622 bool APSetupLocked; /* Must be included if value is true */
2623 /*
2624 * BOOL: indicates if the user has recently activated a Registrar to
2625 * add an Enrollee.
2626 */
2627 bool SelectedRegistra;
2628 uint16_t DevicePasswordID; /* Device Password ID */
2629 /* Selected Registrar config method */
2630 uint16_t SelectedRegistraCfgMethod;
2631 uint8_t UUID_E[SIR_WPS_UUID_LEN]; /* Unique identifier of the AP. */
2632 uint8_t RFBand; /* RF bands available on the AP */
2633} tSirWPSBeaconIE;
2634
2635#define SIR_WPS_ASSOCRSP_VER_PRESENT 0x00000001
2636#define SIR_WPS_ASSOCRSP_RESPONSETYPE_PRESENT 0x00000002
2637
2638typedef struct sSirWPSAssocRspIE {
2639 uint32_t FieldPresent;
2640 uint32_t Version;
2641 uint8_t ResposeType;
2642} tSirWPSAssocRspIE;
2643
2644typedef struct sSirAPWPSIEs {
2645 tSirWPSProbeRspIE SirWPSProbeRspIE; /*WPS Set Probe Respose IE */
2646 tSirWPSBeaconIE SirWPSBeaconIE; /*WPS Set Beacon IE */
2647 tSirWPSAssocRspIE SirWPSAssocRspIE; /*WPS Set Assoc Response IE */
2648} tSirAPWPSIEs, *tpSiriAPWPSIEs;
2649
2650typedef struct sSirUpdateAPWPSIEsReq {
2651 uint16_t messageType; /* eWNI_SME_UPDATE_APWPSIE_REQ */
2652 uint16_t length;
2653 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302654 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002655 uint8_t sessionId; /* Session ID */
2656 tSirAPWPSIEs APWPSIEs;
2657} tSirUpdateAPWPSIEsReq, *tpSirUpdateAPWPSIEsReq;
2658
Naveen Rawat8029a402017-06-01 10:54:19 -07002659struct update_config {
2660 uint16_t messageType; /* eWNI_SME_UPDATE_CONFIG */
2661 uint16_t length;
2662 uint8_t sme_session_id;
2663 uint16_t capab;
2664 uint32_t value;
2665};
2666
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302667/*
2668 * enum sir_update_session_param_type - session param type
2669 * @SIR_PARAM_SSID_HIDDEN: ssidHidden parameter
Selvaraj, Sridharac4fcf32016-09-28 12:57:32 +05302670 * @SIR_PARAM_IGNORE_ASSOC_DISALLOWED: ignore_assoc_disallowed parameter
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302671 */
2672enum sir_update_session_param_type {
2673 SIR_PARAM_SSID_HIDDEN,
Selvaraj, Sridharac4fcf32016-09-28 12:57:32 +05302674 SIR_PARAM_IGNORE_ASSOC_DISALLOWED,
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302675};
2676
2677/*
2678 * struct sir_update_session_param
2679 * @message_type: SME message type
2680 * @length: size of struct sir_update_session_param
2681 * @session_id: Session ID
2682 * @param_type: parameter to be updated
2683 * @param_val: Parameter value to update
2684 */
2685struct sir_update_session_param {
2686 uint16_t message_type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002687 uint16_t length;
Selvaraj, Sridhar7231c5f2016-09-28 12:42:33 +05302688 uint8_t session_id;
2689 uint32_t param_type;
2690 uint32_t param_val;
2691};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002692
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07002693/**
Kiran Kumar Lokeree6476b22017-10-16 23:40:32 -07002694 * struct sir_set_he_bss_color
2695 * @message_type: SME message type
2696 * @length: size of struct sir_set_he_bss_color
2697 * @session_id: Session ID
2698 * @bss_color: bss color value
2699 */
2700struct sir_set_he_bss_color {
2701 uint16_t message_type;
2702 uint16_t length;
2703 uint8_t session_id;
2704 uint8_t bss_color;
2705};
2706
2707/**
Manjunathappa Prakash59f861d2016-04-21 10:33:31 -07002708 * struct sir_create_session - Used for creating session in monitor mode
2709 * @type: SME host message type.
2710 * @msg_len: Length of the message.
2711 * @bss_id: bss_id for creating the session.
2712 */
2713struct sir_create_session {
2714 uint16_t type;
2715 uint16_t msg_len;
2716 struct qdf_mac_addr bss_id;
2717};
2718
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002719/* Beacon Interval */
2720typedef struct sSirChangeBIParams {
2721 uint16_t messageType;
2722 uint16_t length;
2723 uint16_t beaconInterval; /* Beacon Interval */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302724 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002725 uint8_t sessionId; /* Session ID */
2726} tSirChangeBIParams, *tpSirChangeBIParams;
2727
2728#ifdef QCA_HT_2040_COEX
2729typedef struct sSirSetHT2040Mode {
2730 uint16_t messageType;
2731 uint16_t length;
2732 uint8_t cbMode;
2733 bool obssEnabled;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302734 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002735 uint8_t sessionId; /* Session ID */
2736} tSirSetHT2040Mode, *tpSirSetHT2040Mode;
2737#endif
2738
2739#define SIR_WPS_PBC_WALK_TIME 120 /* 120 Second */
2740
2741typedef struct sSirWPSPBCSession {
2742 struct sSirWPSPBCSession *next;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302743 struct qdf_mac_addr addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002744 uint8_t uuid_e[SIR_WPS_UUID_LEN];
2745 uint32_t timestamp;
2746} tSirWPSPBCSession;
2747
2748typedef struct sSirSmeGetWPSPBCSessionsReq {
2749 uint16_t messageType; /* eWNI_SME_GET_WPSPBC_SESSION_REQ */
2750 uint16_t length;
2751 void *pUsrContext;
2752 void *pSapEventCallback;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302753 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002754 /* MAC Address of STA in WPS Session to be removed */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302755 struct qdf_mac_addr remove_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002756} tSirSmeGetWPSPBCSessionsReq, *tpSirSmeGetWPSPBCSessionsReq;
2757
2758typedef struct sSirWPSPBCProbeReq {
Anurag Chouhan6d760662016-02-20 16:05:43 +05302759 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002760 uint16_t probeReqIELen;
2761 uint8_t probeReqIE[512];
2762} tSirWPSPBCProbeReq, *tpSirWPSPBCProbeReq;
2763
2764/* probereq from peer, when wsc is enabled */
2765typedef struct sSirSmeProbeReqInd {
2766 uint16_t messageType; /* eWNI_SME_WPS_PBC_PROBE_REQ_IND */
2767 uint16_t length;
2768 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302769 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002770 tSirWPSPBCProbeReq WPSPBCProbeReq;
2771} tSirSmeProbeReqInd, *tpSirSmeProbeReqInd;
2772
2773typedef struct sSirUpdateAPWPARSNIEsReq {
2774 uint16_t messageType; /* eWNI_SME_SET_APWPARSNIEs_REQ */
2775 uint16_t length;
2776 uint16_t transactionId; /* Transaction ID for cmd */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302777 struct qdf_mac_addr bssid; /* BSSID */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002778 uint8_t sessionId; /* Session ID */
2779 tSirRSNie APWPARSNIEs;
2780} tSirUpdateAPWPARSNIEsReq, *tpSirUpdateAPWPARSNIEsReq;
2781
2782#define SIR_ROAM_MAX_CHANNELS 80
2783#define SIR_ROAM_SCAN_MAX_PB_REQ_SIZE 450
2784/* Occupied channel list remains static */
2785#define CHANNEL_LIST_STATIC 1
2786/* Occupied channel list can be learnt after init */
2787#define CHANNEL_LIST_DYNAMIC_INIT 2
2788/* Occupied channel list can be learnt after flush */
2789#define CHANNEL_LIST_DYNAMIC_FLUSH 3
2790/* Occupied channel list can be learnt after update */
2791#define CHANNEL_LIST_DYNAMIC_UPDATE 4
2792#define SIR_ROAM_SCAN_24G_DEFAULT_CH 1
2793#define SIR_ROAM_SCAN_5G_DEFAULT_CH 36
2794#define SIR_ROAM_SCAN_RESERVED_BYTES 61
2795
2796#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2797#define SIR_ROAM_SCAN_PSK_SIZE 32
2798#define SIR_ROAM_R0KH_ID_MAX_LEN 48
2799#endif
2800/* SME -> HAL - This is the host offload request. */
2801#define SIR_IPV4_ARP_REPLY_OFFLOAD 0
2802#define SIR_IPV6_NEIGHBOR_DISCOVERY_OFFLOAD 1
2803#define SIR_IPV6_NS_OFFLOAD 2
2804#define SIR_OFFLOAD_DISABLE 0
2805#define SIR_OFFLOAD_ENABLE 1
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002806
2807#ifdef WLAN_NS_OFFLOAD
2808typedef struct sSirNsOffloadReq {
Srinivas Girigowdac79a7102015-12-08 15:18:26 -08002809 uint8_t srcIPv6Addr[SIR_MAC_IPV6_ADDR_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002810 uint8_t selfIPv6Addr[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][SIR_MAC_IPV6_ADDR_LEN];
2811 uint8_t targetIPv6Addr[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][SIR_MAC_IPV6_ADDR_LEN];
Anurag Chouhan6d760662016-02-20 16:05:43 +05302812 struct qdf_mac_addr self_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002813 uint8_t srcIPv6AddrValid;
2814 uint8_t targetIPv6AddrValid[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA];
Sravan Kumar Kairamc0873582016-07-26 17:34:57 +05302815 uint8_t target_ipv6_addr_ac_type[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002816 uint8_t slotIdx;
2817} tSirNsOffloadReq, *tpSirNsOffloadReq;
2818#endif /* WLAN_NS_OFFLOAD */
2819
2820typedef struct sSirHostOffloadReq {
2821 uint8_t offloadType;
2822 uint8_t enableOrDisable;
2823 uint32_t num_ns_offload_count;
2824 union {
Srinivas Girigowdac79a7102015-12-08 15:18:26 -08002825 uint8_t hostIpv4Addr[SIR_IPV4_ADDR_LEN];
2826 uint8_t hostIpv6Addr[SIR_MAC_IPV6_ADDR_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002827 } params;
2828#ifdef WLAN_NS_OFFLOAD
2829 tSirNsOffloadReq nsOffloadInfo;
2830#endif /* WLAN_NS_OFFLOAD */
Anurag Chouhan6d760662016-02-20 16:05:43 +05302831 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002832} tSirHostOffloadReq, *tpSirHostOffloadReq;
2833
2834/* Packet Types. */
2835#define SIR_KEEP_ALIVE_NULL_PKT 1
2836#define SIR_KEEP_ALIVE_UNSOLICIT_ARP_RSP 2
2837
2838/* Keep Alive request. */
2839typedef struct sSirKeepAliveReq {
2840 uint8_t packetType;
2841 uint32_t timePeriod;
2842 tSirIpv4Addr hostIpv4Addr;
2843 tSirIpv4Addr destIpv4Addr;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302844 struct qdf_mac_addr dest_macaddr;
2845 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002846 uint8_t sessionId;
2847} tSirKeepAliveReq, *tpSirKeepAliveReq;
2848
2849typedef struct sSirSmeMgmtFrameInd {
Abhishek Singh7996eb72015-12-30 17:24:02 +05302850 uint16_t frame_len;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002851 uint32_t rxChan;
2852 uint8_t sessionId;
2853 uint8_t frameType;
2854 int8_t rxRssi;
2855 uint8_t frameBuf[1]; /* variable */
2856} tSirSmeMgmtFrameInd, *tpSirSmeMgmtFrameInd;
2857
Abhishek Singh7996eb72015-12-30 17:24:02 +05302858typedef void (*sir_mgmt_frame_ind_callback)(tSirSmeMgmtFrameInd *frame_ind);
2859/**
2860 * struct sir_sme_mgmt_frame_cb_req - Register a
2861 * management frame callback req
2862 *
2863 * @message_type: message id
2864 * @length: msg length
2865 * @callback: callback for management frame indication
2866 */
2867struct sir_sme_mgmt_frame_cb_req {
2868 uint16_t message_type;
2869 uint16_t length;
2870 sir_mgmt_frame_ind_callback callback;
2871};
2872
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002873#ifdef WLAN_FEATURE_11W
2874typedef struct sSirSmeUnprotMgmtFrameInd {
2875 uint8_t sessionId;
2876 uint8_t frameType;
2877 uint8_t frameLen;
2878 uint8_t frameBuf[1]; /* variable */
2879} tSirSmeUnprotMgmtFrameInd, *tpSirSmeUnprotMgmtFrameInd;
2880#endif
2881
2882#define SIR_IS_FULL_POWER_REASON_DISCONNECTED(eReason) \
2883 ((eSME_LINK_DISCONNECTED_BY_HDD == (eReason)) || \
2884 (eSME_LINK_DISCONNECTED_BY_OTHER == (eReason)))
2885#define SIR_IS_FULL_POWER_NEEDED_BY_HDD(eReason) \
2886 ((eSME_LINK_DISCONNECTED_BY_HDD == (eReason)) || \
2887 (eSME_FULL_PWR_NEEDED_BY_HDD == (eReason)))
2888
2889/* P2P Power Save Related */
2890typedef struct sSirNoAParam {
2891 uint8_t ctWindow:7;
2892 uint8_t OppPS:1;
2893 uint8_t count;
2894 uint32_t duration;
2895 uint32_t interval;
2896 uint32_t singleNoADuration;
2897 uint8_t psSelection;
2898} tSirNoAParam, *tpSirNoAParam;
2899
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002900typedef struct sSirWlanResumeParam {
2901 uint8_t configuredMcstBcstFilterSetting;
2902} tSirWlanResumeParam, *tpSirWlanResumeParam;
2903
2904#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
2905
2906typedef enum ext_wow_type {
2907 EXT_WOW_TYPE_APP_TYPE1, /* wow type: only enable wakeup for app type1 */
2908 EXT_WOW_TYPE_APP_TYPE2, /* wow type: only enable wakeup for app type2 */
2909 EXT_WOW_TYPE_APP_TYPE1_2, /* wow type: enable wakeup for app type1&2 */
2910} EXT_WOW_TYPE;
2911
2912typedef struct {
2913 uint8_t vdev_id;
2914 EXT_WOW_TYPE type;
2915 uint32_t wakeup_pin_num;
2916} tSirExtWoWParams, *tpSirExtWoWParams;
2917
2918typedef struct {
2919 uint8_t vdev_id;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302920 struct qdf_mac_addr wakee_mac_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002921 uint8_t identification_id[8];
2922 uint8_t password[16];
2923 uint32_t id_length;
2924 uint32_t pass_length;
2925} tSirAppType1Params, *tpSirAppType1Params;
2926
2927typedef struct {
2928 uint8_t vdev_id;
2929
2930 uint8_t rc4_key[16];
2931 uint32_t rc4_key_len;
2932
2933 /** ip header parameter */
2934 uint32_t ip_id; /* NC id */
2935 uint32_t ip_device_ip; /* NC IP address */
2936 uint32_t ip_server_ip; /* Push server IP address */
2937
2938 /** tcp header parameter */
2939 uint16_t tcp_src_port; /* NC TCP port */
2940 uint16_t tcp_dst_port; /* Push server TCP port */
2941 uint32_t tcp_seq;
2942 uint32_t tcp_ack_seq;
2943
2944 uint32_t keepalive_init; /* Initial ping interval */
2945 uint32_t keepalive_min; /* Minimum ping interval */
2946 uint32_t keepalive_max; /* Maximum ping interval */
2947 uint32_t keepalive_inc; /* Increment of ping interval */
2948
Anurag Chouhan6d760662016-02-20 16:05:43 +05302949 struct qdf_mac_addr gateway_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002950 uint32_t tcp_tx_timeout_val;
2951 uint32_t tcp_rx_timeout_val;
2952} tSirAppType2Params, *tpSirAppType2Params;
2953#endif
2954
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002955#define ANI_MAX_IBSS_ROUTE_TABLE_ENTRY 100
2956
2957typedef struct sAniDestIpNextHopMacPair {
Anurag Chouhan6d760662016-02-20 16:05:43 +05302958 uint8_t destIpv4Addr[QDF_IPV4_ADDR_SIZE];
2959 uint8_t nextHopMacAddr[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002960} tAniDestIpNextHopMacPair;
2961
2962typedef struct sAniIbssRouteTable {
2963 uint8_t sessionId;
2964 uint16_t numEntries;
2965 tAniDestIpNextHopMacPair destIpNextHopPair[1];
2966} tAniIbssRouteTable;
2967
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002968#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2969typedef struct {
2970 uint8_t acvo_uapsd:1;
2971 uint8_t acvi_uapsd:1;
2972 uint8_t acbk_uapsd:1;
2973 uint8_t acbe_uapsd:1;
2974 uint8_t reserved:4;
2975} tSirAcUapsd, *tpSirAcUapsd;
2976#endif
2977
2978typedef struct {
2979 tSirMacSSid ssId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05302980 uint8_t currAPbssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08002981 uint32_t authentication;
2982 uint8_t encryption;
2983 uint8_t mcencryption;
2984 uint8_t ChannelCount;
2985 uint8_t ChannelCache[SIR_ROAM_MAX_CHANNELS];
2986#ifdef WLAN_FEATURE_11W
2987 bool mfp_enabled;
2988#endif
2989
2990} tSirRoamNetworkType;
2991
2992typedef struct SirMobilityDomainInfo {
2993 uint8_t mdiePresent;
2994 uint16_t mobilityDomain;
2995} tSirMobilityDomainInfo;
2996
2997typedef enum {
2998 SIR_ROAMING_DFS_CHANNEL_DISABLED = 0,
2999 SIR_ROAMING_DFS_CHANNEL_ENABLED_NORMAL = 1,
3000 SIR_ROAMING_DFS_CHANNEL_ENABLED_ACTIVE = 2
3001} eSirDFSRoamScanMode;
3002#define MAX_SSID_ALLOWED_LIST 4
3003#define MAX_BSSID_AVOID_LIST 16
3004#define MAX_BSSID_FAVORED 16
3005/**
3006 * struct roam_ext_params - Structure holding roaming parameters
3007 * @num_bssid_avoid_list: The number of BSSID's that we should
3008 * avoid connecting to. It is like a
3009 * blacklist of BSSID's.
3010 * @num_ssid_allowed_list: The number of SSID profiles that are
3011 * in the Whitelist. When roaming, we
3012 * consider the BSSID's with this SSID
3013 * also for roaming apart from the connected one's
3014 * @num_bssid_favored: Number of BSSID's which have a preference over
3015 * others
3016 * @ssid_allowed_list: Whitelist SSID's
3017 * @bssid_avoid_list: Blacklist SSID's
3018 * @bssid_favored: Favorable BSSID's
3019 * @bssid_favored_factor: RSSI to be added to this BSSID to prefer it
3020 * @raise_rssi_thresh_5g: The RSSI threshold below which the
3021 * raise_factor_5g (boost factor) should be
3022 * applied.
3023 * @drop_rssi_thresh_5g: The RSSI threshold beyond which the
3024 * drop_factor_5g (penalty factor) should be
3025 * applied
3026 * @raise_rssi_type_5g: Algorithm to apply the boost factor
3027 * @raise_factor_5g: Boost factor
3028 * @drop_rssi_type_5g: Algorithm to apply the penalty factor
3029 * @drop_factor_5g: Penalty factor
3030 * @max_raise_rssi_5g: Maximum amount of Boost that can added
3031 * @max_drop_rssi_5g: Maximum amount of penalty that can be subtracted
3032 * @good_rssi_threshold: The Lookup UP threshold beyond which roaming
3033 * scan should be performed.
3034 * @rssi_diff: RSSI difference for the AP to be better over the
3035 * current AP to avoid ping pong effects
3036 * @good_rssi_roam: Lazy Roam
3037 * @is_5g_pref_enabled: 5GHz BSSID preference feature enable/disable.
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07003038 * @bg_scan_bad_rssi_thresh: Bad RSSI threshold to perform bg scan.
Vignesh Viswanathanc018e982017-09-07 18:49:19 +05303039 * @bad_rssi_thresh_offset_2g: Offset from Bad RSSI threshold for 2G to 5G Roam
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07003040 * @bg_scan_client_bitmap: Bitmap to identify the client scans to snoop.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003041 *
3042 * This structure holds all the key parameters related to
3043 * initial connection and also roaming connections.
3044 * */
3045struct roam_ext_params {
3046 uint8_t num_bssid_avoid_list;
3047 uint8_t num_ssid_allowed_list;
3048 uint8_t num_bssid_favored;
3049 tSirMacSSid ssid_allowed_list[MAX_SSID_ALLOWED_LIST];
Anurag Chouhan6d760662016-02-20 16:05:43 +05303050 struct qdf_mac_addr bssid_avoid_list[MAX_BSSID_AVOID_LIST];
3051 struct qdf_mac_addr bssid_favored[MAX_BSSID_FAVORED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003052 uint8_t bssid_favored_factor[MAX_BSSID_FAVORED];
3053 int raise_rssi_thresh_5g;
3054 int drop_rssi_thresh_5g;
3055 uint8_t raise_rssi_type_5g;
3056 uint8_t raise_factor_5g;
3057 uint8_t drop_rssi_type_5g;
3058 uint8_t drop_factor_5g;
3059 int max_raise_rssi_5g;
3060 int max_drop_rssi_5g;
3061 int alert_rssi_threshold;
3062 int rssi_diff;
3063 int good_rssi_roam;
3064 bool is_5g_pref_enabled;
Gupta, Kapilc68ad462016-02-01 19:17:23 +05303065 int dense_rssi_thresh_offset;
3066 int dense_min_aps_cnt;
3067 int initial_dense_status;
3068 int traffic_threshold;
Abhishek Singh4db8c152017-07-18 10:40:08 +05303069 uint8_t num_rssi_rejection_ap;
3070 struct rssi_disallow_bssid rssi_rejection_ap[MAX_RSSI_AVOID_BSSID_LIST];
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07003071 int8_t bg_scan_bad_rssi_thresh;
Vignesh Viswanathanc018e982017-09-07 18:49:19 +05303072 uint8_t roam_bad_rssi_thresh_offset_2g;
Varun Reddy Yeturufaad37e2017-07-26 10:54:13 -07003073 uint32_t bg_scan_client_bitmap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003074};
3075
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08003076/**
Himanshu Agarwal8bcec572017-09-28 11:54:37 +05303077 * struct sir_weight_config - weight params to
3078 * calculate best candidate
3079 * @rssi_weightage: RSSI weightage
3080 * @ht_caps_weightage: HT caps weightage
3081 * @vht_caps_weightage: VHT caps weightage
3082 * @he_caps_weightage: HE caps weightage
3083 * @chan_width_weightage: Channel width weightage
3084 * @chan_band_weightage: Channel band weightage
3085 * @nss_weightage: NSS weightage
3086 * @beamforming_cap_weightage: Beamforming caps weightage
3087 * @pcl_weightage: PCL weightage
3088 * @channel_congestion_weightage: channel congestion weightage
3089 * @oce_wan_weightage: OCE WAN metrics weightage
3090 */
3091struct sir_weight_config {
3092 uint8_t rssi_weightage;
3093 uint8_t ht_caps_weightage;
3094 uint8_t vht_caps_weightage;
3095 uint8_t he_caps_weightage;
3096 uint8_t chan_width_weightage;
3097 uint8_t chan_band_weightage;
3098 uint8_t nss_weightage;
3099 uint8_t beamforming_cap_weightage;
3100 uint8_t pcl_weightage;
3101 uint8_t channel_congestion_weightage;
3102 uint8_t oce_wan_weightage;
3103};
3104
3105struct sir_rssi_cfg_score {
3106 uint32_t best_rssi_threshold;
3107 uint32_t good_rssi_threshold;
3108 uint32_t bad_rssi_threshold;
3109 uint32_t good_rssi_pcnt;
3110 uint32_t bad_rssi_pcnt;
3111 uint32_t good_rssi_bucket_size;
3112 uint32_t bad_rssi_bucket_size;
3113 uint32_t rssi_pref_5g_rssi_thresh;
3114};
3115
3116/**
3117 * struct sir_per_slot_scoring - define % score for differents slots for a
3118 * scoring param.
3119 * num_slot: number of slots in which the param will be divided.
3120 * Max 15. index 0 is used for 'not_present. Num_slot will
3121 * equally divide 100. e.g, if num_slot = 4 slot 0 = 0-25%, slot
3122 * 1 = 26-50% slot 2 = 51-75%, slot 3 = 76-100%
3123 * score_pcnt3_to_0: Conatins score percentage for slot 0-3
3124 * BITS 0-7 :- the scoring pcnt when not present
3125 * BITS 8-15 :- SLOT_1
3126 * BITS 16-23 :- SLOT_2
3127 * BITS 24-31 :- SLOT_3
3128 * score_pcnt7_to_4: Conatins score percentage for slot 4-7
3129 * BITS 0-7 :- SLOT_4
3130 * BITS 8-15 :- SLOT_5
3131 * BITS 16-23 :- SLOT_6
3132 * BITS 24-31 :- SLOT_7
3133 * score_pcnt11_to_8: Conatins score percentage for slot 8-11
3134 * BITS 0-7 :- SLOT_8
3135 * BITS 8-15 :- SLOT_9
3136 * BITS 16-23 :- SLOT_10
3137 * BITS 24-31 :- SLOT_11
3138 * score_pcnt15_to_12: Conatins score percentage for slot 12-15
3139 * BITS 0-7 :- SLOT_12
3140 * BITS 8-15 :- SLOT_13
3141 * BITS 16-23 :- SLOT_14
3142 * BITS 24-31 :- SLOT_15
3143 */
3144struct sir_per_slot_scoring {
3145 uint32_t num_slot;
3146 uint32_t score_pcnt3_to_0;
3147 uint32_t score_pcnt7_to_4;
3148 uint32_t score_pcnt11_to_8;
3149 uint32_t score_pcnt15_to_12;
3150};
3151
3152struct sir_score_config {
3153 bool enable_scoring_for_roam;
3154 struct sir_weight_config weight_cfg;
3155 struct sir_rssi_cfg_score rssi_score;
3156 struct sir_per_slot_scoring esp_qbss_scoring;
3157 struct sir_per_slot_scoring oce_wan_scoring;
3158 uint32_t bandwidth_weight_per_index;
3159 uint32_t nss_weight_per_index;
3160 uint32_t band_weight_per_index;
3161};
3162
3163/**
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08003164 * struct pmkid_mode_bits - Bit flags for PMKID usage in RSN IE
3165 * @fw_okc: Opportunistic key caching enable in firmware
3166 * @fw_pmksa_cache: PMKSA caching enable in firmware, remember previously
3167 * visited BSSID/PMK pairs
3168 */
3169struct pmkid_mode_bits {
3170 uint32_t fw_okc:1;
3171 uint32_t fw_pmksa_cache:1;
3172 uint32_t unused:30;
3173};
3174
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05303175/**
3176 * struct lca_disallow_config_params - LCA[Last Connected AP]
3177 * disallow config params
3178 * @disallow_duration: LCA AP disallowed duration
3179 * @rssi_channel_penalization: RSSI channel Penalization
3180 * @num_disallowed_aps: Maximum number of AP's in LCA list
3181 *
3182 */
Srinivas Girigowdaea4d8062017-10-14 12:40:48 -07003183struct lca_disallow_config_params {
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05303184 uint32_t disallow_duration;
3185 uint32_t rssi_channel_penalization;
3186 uint32_t num_disallowed_aps;
3187};
3188
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07003189/**
3190 * struct mawc_params - Motion Aided Wireless Connectivity configuration
3191 * @MAWCEnabled: Global configuration for MAWC (Roaming/PNO/ExtScan)
3192 * @mawc_roam_enabled: MAWC roaming enable/disable
3193 * @mawc_roam_traffic_threshold: Traffic threshold in kBps for MAWC roaming
3194 * @mawc_roam_ap_rssi_threshold: AP RSSI threshold for MAWC roaming
3195 * @mawc_roam_rssi_high_adjust: High Adjustment value for suppressing scan
3196 * @mawc_roam_rssi_low_adjust: Low Adjustment value for suppressing scan
3197 */
3198struct mawc_params {
3199 bool mawc_enabled;
3200 bool mawc_roam_enabled;
3201 uint32_t mawc_roam_traffic_threshold;
3202 int8_t mawc_roam_ap_rssi_threshold;
3203 uint8_t mawc_roam_rssi_high_adjust;
3204 uint8_t mawc_roam_rssi_low_adjust;
3205};
3206
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003207typedef struct sSirRoamOffloadScanReq {
Selvaraj, Sridhar01741822016-08-30 18:26:19 +05303208 uint16_t message_type;
3209 uint16_t length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003210 bool RoamScanOffloadEnabled;
Varun Reddy Yeturu061d4d62017-07-20 09:39:32 -07003211 struct mawc_params mawc_roam_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003212 int8_t LookupThreshold;
Varun Reddy Yeturu168134f2017-06-26 13:46:05 -07003213 int8_t rssi_thresh_offset_5g;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003214 uint8_t delay_before_vdev_stop;
3215 uint8_t OpportunisticScanThresholdDiff;
3216 uint8_t RoamRescanRssiDiff;
3217 uint8_t RoamRssiDiff;
Abhishek Singh34c0e632017-09-28 14:39:29 +05303218 int32_t rssi_abs_thresh;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003219 uint8_t ChannelCacheType;
3220 uint8_t Command;
3221 uint8_t reason;
3222 uint16_t NeighborScanTimerPeriod;
Sridhar Selvaraj1b2330c2017-07-21 15:16:42 +05303223 uint16_t neighbor_scan_min_timer_period;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003224 uint16_t NeighborRoamScanRefreshPeriod;
3225 uint16_t NeighborScanChannelMinTime;
3226 uint16_t NeighborScanChannelMaxTime;
3227 uint16_t EmptyRefreshScanPeriod;
3228 uint8_t ValidChannelCount;
3229 uint8_t ValidChannelList[SIR_ROAM_MAX_CHANNELS];
3230 bool IsESEAssoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003231 uint8_t nProbes;
3232 uint16_t HomeAwayTime;
3233 tSirRoamNetworkType ConnectedNetwork;
3234 tSirMobilityDomainInfo MDID;
3235 uint8_t sessionId;
3236 uint8_t RoamBmissFirstBcnt;
3237 uint8_t RoamBmissFinalBcnt;
3238 uint8_t RoamBeaconRssiWeight;
3239 eSirDFSRoamScanMode allowDFSChannelRoam;
3240#ifdef WLAN_FEATURE_ROAM_OFFLOAD
3241 uint8_t RoamOffloadEnabled;
3242 uint8_t PSK_PMK[SIR_ROAM_SCAN_PSK_SIZE];
3243 uint32_t pmk_len;
3244 uint8_t Prefer5GHz;
3245 uint8_t RoamRssiCatGap;
3246 uint8_t Select5GHzMargin;
3247 uint8_t KRK[SIR_KRK_KEY_LEN];
3248 uint8_t BTK[SIR_BTK_KEY_LEN];
3249 uint32_t ReassocFailureTimeout;
3250 tSirAcUapsd AcUapsd;
3251 uint8_t R0KH_ID[SIR_ROAM_R0KH_ID_MAX_LEN];
3252 uint32_t R0KH_ID_Length;
3253 uint8_t RoamKeyMgmtOffloadEnabled;
Deepak Dhamdhere828f1892017-02-09 11:51:19 -08003254 struct pmkid_mode_bits pmkid_modes;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003255#endif
3256 struct roam_ext_params roam_params;
3257 uint8_t middle_of_roaming;
3258 uint32_t hi_rssi_scan_max_count;
3259 uint32_t hi_rssi_scan_rssi_delta;
3260 uint32_t hi_rssi_scan_delay;
3261 int32_t hi_rssi_scan_rssi_ub;
Varun Reddy Yeturu05186292015-09-28 17:12:33 -07003262 uint8_t early_stop_scan_enable;
3263 int8_t early_stop_scan_min_threshold;
3264 int8_t early_stop_scan_max_threshold;
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +05303265 enum wmi_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode;
Selvaraj, Sridhara7fc7632016-09-04 13:13:38 +05303266 tSirAddie assoc_ie;
Selvaraj, Sridhar57ce4df2017-05-29 18:30:49 +05303267 struct lca_disallow_config_params lca_config_params;
Himanshu Agarwal8bcec572017-09-28 11:54:37 +05303268 struct scoring_param score_params;
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05303269#ifdef WLAN_FEATURE_FILS_SK
3270 bool is_fils_connection;
3271 struct roam_fils_params roam_fils_params;
3272#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003273} tSirRoamOffloadScanReq, *tpSirRoamOffloadScanReq;
3274
3275typedef struct sSirRoamOffloadScanRsp {
3276 uint8_t sessionId;
3277 uint32_t reason;
3278} tSirRoamOffloadScanRsp, *tpSirRoamOffloadScanRsp;
3279
3280
3281#ifdef WLAN_FEATURE_PACKET_FILTERING
3282/*---------------------------------------------------------------------------
3283 Packet Filtering Parameters
3284 ---------------------------------------------------------------------------*/
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003285#define SIR_MAX_FILTER_TEST_DATA_LEN 8
Dustin Brown4d1e8462016-12-14 12:12:24 -08003286#define SIR_MAX_FILTER_TEST_DATA_OFFSET 200
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003287#define SIR_MAX_NUM_MULTICAST_ADDRESS 240
3288#define SIR_MAX_NUM_FILTERS 20
3289#define SIR_MAX_NUM_TESTS_PER_FILTER 10
3290
3291/* */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003292/* Filter Packet Match Count Parameters */
3293/* */
3294typedef struct sSirRcvFltPktMatchCnt {
3295 uint8_t filterId;
3296 uint32_t matchCnt;
3297} tSirRcvFltPktMatchCnt, tpSirRcvFltPktMatchCnt;
3298
3299typedef struct sSirRcvFltPktMatchRsp {
3300 uint16_t mesgType;
3301 uint16_t mesgLen;
3302
3303 /* Success or Failure */
3304 uint32_t status;
3305 tSirRcvFltPktMatchCnt filterMatchCnt[SIR_MAX_NUM_FILTERS];
Anurag Chouhan6d760662016-02-20 16:05:43 +05303306 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003307} tSirRcvFltPktMatchRsp, *tpSirRcvFltPktMatchRsp;
3308
3309/* */
3310/* Receive Filter Clear Parameters */
3311/* */
3312typedef struct sSirRcvFltPktClearParam {
3313 uint32_t status; /* only valid for response message */
3314 uint8_t filterId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303315 struct qdf_mac_addr self_macaddr;
3316 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003317} tSirRcvFltPktClearParam, *tpSirRcvFltPktClearParam;
3318
3319/* */
3320/* Multicast Address List Parameters */
3321/* */
3322typedef struct sSirRcvFltMcAddrList {
3323 uint32_t ulMulticastAddrCnt;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303324 struct qdf_mac_addr multicastAddr[SIR_MAX_NUM_MULTICAST_ADDRESS];
3325 struct qdf_mac_addr self_macaddr;
3326 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003327 uint8_t action;
3328} tSirRcvFltMcAddrList, *tpSirRcvFltMcAddrList;
3329#endif /* WLAN_FEATURE_PACKET_FILTERING */
3330
3331/* */
3332/* Generic version information */
3333/* */
3334typedef struct {
3335 uint8_t revision;
3336 uint8_t version;
3337 uint8_t minor;
3338 uint8_t major;
3339} tSirVersionType;
3340
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003341/**
3342 * struct sir_wifi_start_log - Structure to store the params sent to start/
3343 * stop logging
3344 * @name: Attribute which indicates the type of logging like per packet
3345 * statistics, connectivity etc.
3346 * @verbose_level: Verbose level which can be 0,1,2,3
Poddar, Siddartheefe3482016-09-21 18:12:59 +05303347 * @is_iwpriv_command: Set 1 for iwpriv command
Srinivas Girigowdac34f11d2016-02-25 16:02:42 -08003348 * @ini_triggered: triggered using ini
3349 * @user_triggered: triggered by user
Poddar, Siddarth176c4362016-10-03 12:25:00 +05303350 * @size: pktlog buffer size
Poddar, Siddarthab99a272017-04-10 12:53:26 +05303351 * @is_pktlog_buff_clear: clear the pktlog buffer
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003352 */
3353struct sir_wifi_start_log {
3354 uint32_t ring_id;
3355 uint32_t verbose_level;
Poddar, Siddartheefe3482016-09-21 18:12:59 +05303356 uint32_t is_iwpriv_command;
Srinivas Girigowdac34f11d2016-02-25 16:02:42 -08003357 bool ini_triggered;
3358 uint8_t user_triggered;
Poddar, Siddarth176c4362016-10-03 12:25:00 +05303359 int size;
Poddar, Siddarthab99a272017-04-10 12:53:26 +05303360 bool is_pktlog_buff_clear;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003361};
3362
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003363
3364/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003365 * struct sir_pcl_list - Format of PCL
3366 * @pcl_list: List of preferred channels
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05303367 * @weight_list: Weights of the PCL
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003368 * @pcl_len: Number of channels in the PCL
3369 */
3370struct sir_pcl_list {
3371 uint8_t pcl_list[128];
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05303372 uint8_t weight_list[128];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003373 uint32_t pcl_len;
3374};
3375
3376/**
Manishekar Chandrasekaran7009f252016-04-21 19:14:15 +05303377 * struct sir_pcl_chan_weights - Params to get the valid weighed list
3378 * @pcl_list: Preferred channel list already sorted in the order of preference
3379 * @pcl_len: Length of the PCL
3380 * @saved_chan_list: Valid channel list updated as part of
3381 * WMA_UPDATE_CHAN_LIST_REQ
3382 * @saved_num_chan: Length of the valid channel list
3383 * @weighed_valid_list: Weights of the valid channel list. This will have one
3384 * to one mapping with valid_chan_list. FW expects channel order and size to be
3385 * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID.
3386 * @weight_list: Weights assigned by policy manager
3387 */
3388struct sir_pcl_chan_weights {
3389 uint8_t pcl_list[128];
3390 uint32_t pcl_len;
3391 uint8_t saved_chan_list[128];
3392 uint32_t saved_num_chan;
3393 uint8_t weighed_valid_list[128];
3394 uint8_t weight_list[128];
3395};
3396
3397/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003398 * struct sir_hw_mode_params - HW mode params
3399 * @mac0_tx_ss: MAC0 Tx spatial stream
3400 * @mac0_rx_ss: MAC0 Rx spatial stream
3401 * @mac1_tx_ss: MAC1 Tx spatial stream
3402 * @mac1_rx_ss: MAC1 Rx spatial stream
3403 * @mac0_bw: MAC0 bandwidth
3404 * @mac1_bw: MAC1 bandwidth
3405 * @dbs_cap: DBS capabality
3406 * @agile_dfs_cap: Agile DFS capabality
3407 */
3408struct sir_hw_mode_params {
3409 uint8_t mac0_tx_ss;
3410 uint8_t mac0_rx_ss;
3411 uint8_t mac1_tx_ss;
3412 uint8_t mac1_rx_ss;
3413 uint8_t mac0_bw;
3414 uint8_t mac1_bw;
3415 uint8_t dbs_cap;
3416 uint8_t agile_dfs_cap;
Nitesh Shah5b7bae02016-09-28 18:58:33 +05303417 uint8_t sbs_cap;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003418};
3419
3420/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003421 * struct sir_set_hw_mode_resp - HW mode response
3422 * @status: Status
3423 * @cfgd_hw_mode_index: Configured HW mode index
3424 * @num_vdev_mac_entries: Number of vdev-mac id entries
3425 * @vdev_mac_map: vdev id-mac id map
3426 */
3427struct sir_set_hw_mode_resp {
3428 uint32_t status;
3429 uint32_t cfgd_hw_mode_index;
3430 uint32_t num_vdev_mac_entries;
Tushnim Bhattacharyyaeab33dd2017-11-15 15:20:02 -08003431 struct policy_mgr_vdev_mac_map vdev_mac_map[MAX_VDEV_SUPPORTED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003432};
3433
3434/**
3435 * struct sir_hw_mode_trans_ind - HW mode transition indication
3436 * @old_hw_mode_index: Index of old HW mode
3437 * @new_hw_mode_index: Index of new HW mode
3438 * @num_vdev_mac_entries: Number of vdev-mac id entries
3439 * @vdev_mac_map: vdev id-mac id map
3440 */
3441struct sir_hw_mode_trans_ind {
3442 uint32_t old_hw_mode_index;
3443 uint32_t new_hw_mode_index;
3444 uint32_t num_vdev_mac_entries;
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08003445 struct policy_mgr_vdev_mac_map vdev_mac_map[MAX_VDEV_SUPPORTED];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003446};
3447
3448/**
3449 * struct sir_dual_mac_config_resp - Dual MAC config response
3450 * @status: Status of setting the dual mac configuration
3451 */
3452struct sir_dual_mac_config_resp {
3453 uint32_t status;
3454};
3455
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -08003456/**
3457 * enum set_antenna_mode_status - Status of set antenna mode
3458 * command
3459 * @SET_ANTENNA_MODE_STATUS_OK: command successful
3460 * @SET_ANTENNA_MODE_STATUS_EINVAL: invalid antenna mode
3461 * @SET_ANTENNA_MODE_STATUS_ECANCELED: mode change cancelled
3462 * @SET_ANTENNA_MODE_STATUS_ENOTSUP: mode not supported
3463 */
3464enum set_antenna_mode_status {
3465 SET_ANTENNA_MODE_STATUS_OK,
3466 SET_ANTENNA_MODE_STATUS_EINVAL,
3467 SET_ANTENNA_MODE_STATUS_ECANCELED,
3468 SET_ANTENNA_MODE_STATUS_ENOTSUP,
3469};
3470
3471/**
3472 * struct sir_antenna_mode_resp - set antenna mode response
3473 * @status: Status of setting the antenna mode
3474 */
3475struct sir_antenna_mode_resp {
3476 enum set_antenna_mode_status status;
3477};
3478
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003479#ifdef WLAN_WAKEUP_EVENTS
3480/*---------------------------------------------------------------------------
3481 tSirWakeReasonInd
3482 ---------------------------------------------------------------------------*/
3483typedef struct {
3484 uint16_t mesgType;
3485 uint16_t mesgLen;
3486 uint32_t ulReason; /* see tWakeReasonType */
3487 uint32_t ulReasonArg; /* argument specific to the reason type */
3488 /* length of optional data stored in this message, in case
3489 * HAL truncates the data (i.e. data packets) this length
3490 * will be less than the actual length
3491 */
3492 uint32_t ulStoredDataLen;
3493 uint32_t ulActualDataLen; /* actual length of data */
3494 /* variable length start of data (length == storedDataLen)
3495 * see specific wake type
3496 */
3497 uint8_t aDataStart[1];
3498} tSirWakeReasonInd, *tpSirWakeReasonInd;
3499#endif /* WLAN_WAKEUP_EVENTS */
3500
3501/*---------------------------------------------------------------------------
3502 sAniSetTmLevelReq
3503 ---------------------------------------------------------------------------*/
3504typedef struct sAniSetTmLevelReq {
3505 uint16_t tmMode;
3506 uint16_t newTmLevel;
3507} tAniSetTmLevelReq, *tpAniSetTmLevelReq;
3508
3509#ifdef FEATURE_WLAN_TDLS
3510/* TDLS Request struct SME-->PE */
3511typedef struct sSirTdlsSendMgmtReq {
3512 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
3513 uint16_t length;
3514 uint8_t sessionId; /* Session ID */
3515 uint16_t transactionId; /* Transaction ID for cmd */
3516 uint8_t reqType;
3517 uint8_t dialog;
3518 uint16_t statusCode;
3519 uint8_t responder;
3520 uint32_t peerCapability;
3521 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303522 struct qdf_mac_addr bssid;
3523 struct qdf_mac_addr peer_mac;
Ganesh Kondabattinidd726522017-05-10 18:09:37 +05303524 enum wifi_traffic_ac ac;
Srinivas Girigowdaa9d12f12015-11-24 11:26:40 -08003525 /* Variable length. Dont add any field after this. */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003526 uint8_t addIe[1];
3527} tSirTdlsSendMgmtReq, *tpSirSmeTdlsSendMgmtReq;
3528
3529typedef enum TdlsAddOper {
3530 TDLS_OPER_NONE,
3531 TDLS_OPER_ADD,
3532 TDLS_OPER_UPDATE
3533} eTdlsAddOper;
3534
3535/* TDLS Request struct SME-->PE */
3536typedef struct sSirTdlsAddStaReq {
3537 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
3538 uint16_t length;
3539 uint8_t sessionId; /* Session ID */
3540 uint16_t transactionId; /* Transaction ID for cmd */
3541 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303542 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003543 eTdlsAddOper tdlsAddOper;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303544 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003545 uint16_t capability;
3546 uint8_t extn_capability[SIR_MAC_MAX_EXTN_CAP];
3547 uint8_t supported_rates_length;
3548 uint8_t supported_rates[SIR_MAC_MAX_SUPP_RATES];
3549 uint8_t htcap_present;
3550 tSirHTCap htCap;
3551 uint8_t vhtcap_present;
3552 tSirVHTCap vhtCap;
3553 uint8_t uapsd_queues;
3554 uint8_t max_sp;
3555} tSirTdlsAddStaReq, *tpSirSmeTdlsAddStaReq;
3556
3557/* TDLS Response struct PE-->SME */
3558typedef struct sSirTdlsAddStaRsp {
3559 uint16_t messageType;
3560 uint16_t length;
3561 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303562 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003563 uint8_t sessionId; /* Session ID */
3564 uint16_t staId;
3565 uint16_t staType;
3566 uint8_t ucastSig;
3567 uint8_t bcastSig;
3568 eTdlsAddOper tdlsAddOper;
Frank Liud4b2fa02017-03-29 11:46:48 +08003569 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003570} tSirTdlsAddStaRsp;
3571
3572/* TDLS Request struct SME-->PE */
3573typedef struct {
3574 uint16_t messageType; /* eWNI_SME_TDLS_LINK_ESTABLISH_REQ */
3575 uint16_t length;
3576 uint8_t sessionId; /* Session ID */
3577 uint16_t transactionId; /* Transaction ID for cmd */
3578 uint8_t uapsdQueues; /* Peer's uapsd Queues Information */
3579 uint8_t maxSp; /* Peer's Supported Maximum Service Period */
3580 uint8_t isBufSta; /* Does Peer Support as Buffer Station. */
3581 /* Does Peer Support as TDLS Off Channel. */
3582 uint8_t isOffChannelSupported;
3583 uint8_t isResponder; /* Is Peer a responder. */
3584 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303585 struct qdf_mac_addr bssid;
3586 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003587 uint8_t supportedChannelsLen;
3588 uint8_t supportedChannels[SIR_MAC_MAX_SUPP_CHANNELS];
3589 uint8_t supportedOperClassesLen;
Kiran Kumar Lokerea3de2262017-04-12 12:15:04 -07003590 uint8_t supportedOperClasses[REG_MAX_SUPP_OPER_CLASSES];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003591} tSirTdlsLinkEstablishReq, *tpSirTdlsLinkEstablishReq;
3592
3593/* TDLS Request struct SME-->PE */
3594typedef struct {
3595 uint16_t messageType; /* eWNI_SME_TDLS_LINK_ESTABLISH_RSP */
3596 uint16_t length;
3597 uint8_t sessionId; /* Session ID */
3598 uint16_t transactionId; /* Transaction ID for cmd */
3599 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303600 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003601} tSirTdlsLinkEstablishReqRsp, *tpSirTdlsLinkEstablishReqRsp;
3602
3603/* TDLS Request struct SME-->PE */
3604typedef struct sSirTdlsDelStaReq {
3605 uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */
3606 uint16_t length;
3607 uint8_t sessionId; /* Session ID */
3608 uint16_t transactionId; /* Transaction ID for cmd */
3609 /* For multi-session, for PE to locate peSession ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303610 struct qdf_mac_addr bssid;
3611 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003612} tSirTdlsDelStaReq, *tpSirSmeTdlsDelStaReq;
3613/* TDLS Response struct PE-->SME */
3614typedef struct sSirTdlsDelStaRsp {
3615 uint16_t messageType;
3616 uint16_t length;
3617 uint8_t sessionId; /* Session ID */
3618 tSirResultCodes statusCode;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303619 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003620 uint16_t staId;
Frank Liud4b2fa02017-03-29 11:46:48 +08003621 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003622} tSirTdlsDelStaRsp, *tpSirTdlsDelStaRsp;
3623/* TDLS Delete Indication struct PE-->SME */
3624typedef struct sSirTdlsDelStaInd {
3625 uint16_t messageType;
3626 uint16_t length;
3627 uint8_t sessionId; /* Session ID */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303628 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003629 uint16_t staId;
3630 uint16_t reasonCode;
3631} tSirTdlsDelStaInd, *tpSirTdlsDelStaInd;
3632typedef struct sSirTdlsDelAllPeerInd {
3633 uint16_t messageType;
3634 uint16_t length;
3635 uint8_t sessionId; /* Session ID */
3636} tSirTdlsDelAllPeerInd, *tpSirTdlsDelAllPeerInd;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003637typedef struct sSirMgmtTxCompletionInd {
3638 uint16_t messageType;
3639 uint16_t length;
3640 uint8_t sessionId; /* Session ID */
3641 uint32_t txCompleteStatus;
Kabilan Kannanf56f9d52017-04-05 03:31:34 -07003642 struct wlan_objmgr_psoc *psoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003643} tSirMgmtTxCompletionInd, *tpSirMgmtTxCompletionInd;
3644
3645typedef struct sSirTdlsEventnotify {
3646 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303647 struct qdf_mac_addr peermac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003648 uint16_t messageType;
3649 uint32_t peer_reason;
3650} tSirTdlsEventnotify;
3651#endif /* FEATURE_WLAN_TDLS */
3652
3653typedef struct sSirActiveModeSetBcnFilterReq {
3654 uint16_t messageType;
3655 uint16_t length;
3656 uint8_t seesionId;
Sreelakshmi Konamki336e16e2016-09-07 14:35:22 +05303657 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003658} tSirSetActiveModeSetBncFilterReq, *tpSirSetActiveModeSetBncFilterReq;
3659
3660/* Reset AP Caps Changed */
3661typedef struct sSirResetAPCapsChange {
3662 uint16_t messageType;
3663 uint16_t length;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303664 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003665} tSirResetAPCapsChange, *tpSirResetAPCapsChange;
3666
3667/* / Definition for Candidate found indication from FW */
3668typedef struct sSirSmeCandidateFoundInd {
3669 uint16_t messageType; /* eWNI_SME_CANDIDATE_FOUND_IND */
3670 uint16_t length;
3671 uint8_t sessionId; /* Session Identifier */
3672} tSirSmeCandidateFoundInd, *tpSirSmeCandidateFoundInd;
3673
3674#ifdef WLAN_FEATURE_11W
3675typedef struct sSirWlanExcludeUnencryptParam {
3676 bool excludeUnencrypt;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303677 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003678} tSirWlanExcludeUnencryptParam, *tpSirWlanExcludeUnencryptParam;
3679#endif
3680
3681typedef enum {
3682 P2P_SCAN_TYPE_SEARCH = 1, /* P2P Search */
3683 P2P_SCAN_TYPE_LISTEN /* P2P Listen */
3684} tSirP2pScanType;
3685
3686typedef struct sAniHandoffReq {
3687 /* Common for all types are requests */
3688 uint16_t msgType; /* message type is same as the request type */
3689 uint16_t msgLen; /* length of the entire request */
3690 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303691 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003692 uint8_t channel;
3693 uint8_t handoff_src;
3694} tAniHandoffReq, *tpAniHandoffReq;
3695
3696typedef struct sSirScanOffloadReq {
3697 uint8_t sessionId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303698 struct qdf_mac_addr bssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003699 uint8_t numSsid;
3700 tSirMacSSid ssId[SIR_SCAN_MAX_NUM_SSID];
3701 uint8_t hiddenSsid;
Anurag Chouhan6d760662016-02-20 16:05:43 +05303702 struct qdf_mac_addr selfMacAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003703 tSirBssType bssType;
3704 uint8_t dot11mode;
3705 tSirScanType scanType;
3706 uint32_t minChannelTime;
3707 uint32_t maxChannelTime;
3708 uint32_t scan_id;
Deepak Dhamdhered97bfb32015-10-11 15:16:18 -07003709 uint32_t scan_requestor_id;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003710 /* in units of milliseconds, ignored when not connected */
3711 uint32_t restTime;
Agrawal Ashish17bb3902016-05-05 13:29:40 +05303712 /*in units of milliseconds, ignored when not connected*/
3713 uint32_t min_rest_time;
3714 /*in units of milliseconds, ignored when not connected*/
3715 uint32_t idle_time;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003716 tSirP2pScanType p2pScanType;
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +05303717 enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003718 uint16_t uIEFieldLen;
3719 uint16_t uIEFieldOffset;
Paul Zhangd2315472017-02-22 10:02:50 +08003720 uint32_t burst_scan_duration;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003721 tSirChannelList channelList;
3722 /*-----------------------------
3723 sSirScanOffloadReq....
3724 -----------------------------
3725 uIEFieldLen
3726 -----------------------------
3727 uIEFieldOffset ----+
3728 ----------------------------- |
3729 channelList.numChannels |
3730 ----------------------------- |
3731 ... variable size up to |
3732 channelNumber[numChannels-1] |
3733 This can be zero, if |
3734 numChannel is zero. |
3735 ----------------------------- <--+
3736 ... variable size uIEField
3737 up to uIEFieldLen (can be 0)
3738 -----------------------------*/
3739} tSirScanOffloadReq, *tpSirScanOffloadReq;
3740
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08003741/**
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07003742 * sir_scan_event_type - scan event types used in LIM
3743 * @SIR_SCAN_EVENT_STARTED - scan command accepted by FW
3744 * @SIR_SCAN_EVENT_COMPLETED - scan has been completed by FW
3745 * @SIR_SCAN_EVENT_BSS_CHANNEL - FW is going to move to HOME channel
3746 * @SIR_SCAN_EVENT_FOREIGN_CHANNEL - FW is going to move to FORIEGN channel
3747 * @SIR_SCAN_EVENT_DEQUEUED - scan request got dequeued
3748 * @SIR_SCAN_EVENT_PREEMPTED - preempted by other high priority scan
3749 * @SIR_SCAN_EVENT_START_FAILED - scan start failed
3750 * @SIR_SCAN_EVENT_RESTARTED - scan restarted
3751 * @SIR_SCAN_EVENT_MAX - max value for event type
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08003752*/
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07003753enum sir_scan_event_type {
3754 SIR_SCAN_EVENT_STARTED = 0x1,
3755 SIR_SCAN_EVENT_COMPLETED = 0x2,
3756 SIR_SCAN_EVENT_BSS_CHANNEL = 0x4,
3757 SIR_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
3758 SIR_SCAN_EVENT_DEQUEUED = 0x10,
3759 SIR_SCAN_EVENT_PREEMPTED = 0x20,
3760 SIR_SCAN_EVENT_START_FAILED = 0x40,
3761 SIR_SCAN_EVENT_RESTARTED = 0x80,
3762 SIR_SCAN_EVENT_MAX = 0x8000
Krishna Kumaar Natarajan3c443552016-02-19 18:34:40 -08003763};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003764
3765typedef struct sSirScanOffloadEvent {
Krishna Kumaar Natarajan3eed86b2016-03-25 16:55:21 -07003766 enum sir_scan_event_type event;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003767 tSirResultCodes reasonCode;
3768 uint32_t chanFreq;
3769 uint32_t requestor;
3770 uint32_t scanId;
3771 tSirP2pScanType p2pScanType;
3772 uint8_t sessionId;
3773} tSirScanOffloadEvent, *tpSirScanOffloadEvent;
3774
3775/**
3776 * struct sSirUpdateChanParam - channel parameters
3777 * @chanId: ID of the channel
3778 * @pwr: power level
3779 * @dfsSet: is dfs supported or not
3780 * @half_rate: is the channel operating at 10MHz
3781 * @quarter_rate: is the channel operating at 5MHz
3782 */
3783typedef struct sSirUpdateChanParam {
3784 uint8_t chanId;
3785 uint8_t pwr;
3786 bool dfsSet;
3787 bool half_rate;
3788 bool quarter_rate;
3789} tSirUpdateChanParam, *tpSirUpdateChanParam;
3790
3791typedef struct sSirUpdateChan {
3792 uint8_t numChan;
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07003793 uint8_t ht_en;
3794 uint8_t vht_en;
3795 uint8_t vht_24_en;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003796 tSirUpdateChanParam chanParam[1];
3797} tSirUpdateChanList, *tpSirUpdateChanList;
3798
3799typedef enum eSirAddonPsReq {
3800 eSIR_ADDON_NOTHING,
3801 eSIR_ADDON_ENABLE_UAPSD,
3802 eSIR_ADDON_DISABLE_UAPSD
3803} tSirAddonPsReq;
3804
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003805#ifdef FEATURE_WLAN_CH_AVOID
3806typedef struct sSirChAvoidUpdateReq {
3807 uint32_t reserved_param;
3808} tSirChAvoidUpdateReq;
3809#endif /* FEATURE_WLAN_CH_AVOID */
3810
3811typedef struct sSirLinkSpeedInfo {
3812 /* MAC Address for the peer */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303813 struct qdf_mac_addr peer_macaddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003814 uint32_t estLinkSpeed; /* Linkspeed from firmware */
3815} tSirLinkSpeedInfo, *tpSirLinkSpeedInfo;
3816
Will Huanga9814592017-05-24 15:47:58 +08003817/**
3818 * struct sir_peer_info_req - peer info request struct
3819 * @peer_macaddr: MAC address
3820 * @sessionid: vdev id
3821 *
3822 * peer info request message's struct
3823 */
3824struct sir_peer_info_req {
3825 struct qdf_mac_addr peer_macaddr;
3826 uint8_t sessionid;
3827};
3828
3829/**
3830 * struct sir_peer_info - peer information struct
3831 * @peer_macaddr: MAC address
3832 * @rssi: rssi
3833 * @tx_rate: last tx rate
3834 * @rx_rate: last rx rate
3835 *
3836 * a station's information
3837 */
3838struct sir_peer_info {
3839 struct qdf_mac_addr peer_macaddr;
3840 int8_t rssi;
3841 uint32_t tx_rate;
3842 uint32_t rx_rate;
3843};
3844
3845/**
3846 * struct sir_peer_info_resp - all peers information struct
3847 * @count: peer's number
3848 * @info: peer information
3849 *
3850 * all station's information
3851 */
3852struct sir_peer_info_resp {
3853 uint8_t count;
3854 struct sir_peer_info info[0];
3855};
3856
3857/**
3858 * struct sir_peer_info_ext_req - peer info request struct
3859 * @peer_macaddr: MAC address
3860 * @sessionid: vdev id
3861 * @reset_after_request: fw reset statistics after query
3862 *
3863 * peer info request message's struct
3864 */
3865struct sir_peer_info_ext_req {
3866 struct qdf_mac_addr peer_macaddr;
3867 uint8_t sessionid;
3868 uint8_t reset_after_request;
3869};
3870
3871/**
3872 * struct sir_peer_info_ext - peer info information struct
3873 * (refer to station_info struct in Kernel)
3874 * @peer_macaddr: MAC address
3875 * @tx_packets: packets transmitted to this station
3876 * @tx_bytes: bytes transmitted to this station
3877 * @rx_packets: packets received from this station
3878 * @rx_bytes: bytes received from this station
3879 * @rx_retries: cumulative retry counts
3880 * @tx_failed: number of failed transmissions
3881 * @rssi: The signal strength
3882 * @tx_rate: last used tx bitrate (kbps)
3883 * @tx_rate_code: last tx rate code (last_tx_rate_code of wmi_peer_stats_info)
3884 * @rx_rate: last used rx bitrate (kbps)
3885 * @rx_rate_code: last rx rate code (last_rx_rate_code of wmi_peer_stats_info)
3886 *
3887 * a station's information
3888 */
3889struct sir_peer_info_ext {
3890 struct qdf_mac_addr peer_macaddr;
3891 uint32_t tx_packets;
3892 uint64_t tx_bytes;
3893 uint32_t rx_packets;
3894 uint64_t rx_bytes;
3895 uint32_t tx_retries;
3896 uint32_t tx_failed;
3897 int32_t rssi;
3898 uint32_t tx_rate;
3899 uint32_t tx_rate_code;
3900 uint32_t rx_rate;
3901 uint32_t rx_rate_code;
3902};
3903
3904/**
3905 * struct sir_peer_info_ext_resp - all peers' information struct
3906 * @count: peer's number
3907 * @info: peer information
3908 *
3909 * all station's information
3910 */
3911struct sir_peer_info_ext_resp {
3912 uint8_t count;
3913 struct sir_peer_info_ext info[0];
3914};
3915
Will Huang496b36c2017-07-11 16:38:50 +08003916/**
3917 * @sta_num: number of peer station which has valid info
3918 * @info: peer information
3919 *
3920 * all SAP peer station's information retrieved
3921 */
3922struct sir_peer_sta_info {
3923 uint8_t sta_num;
3924 struct sir_peer_info info[MAX_PEER_STA];
3925};
3926
3927/**
3928 * @sta_num: number of peer station which has valid info
3929 * @info: peer extended information
3930 *
3931 * all SAP peer station's extended information retrieved
3932 */
3933struct sir_peer_sta_ext_info {
3934 uint8_t sta_num;
3935 struct sir_peer_info_ext info[MAX_PEER_STA];
3936};
3937
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003938typedef struct sSirAddPeriodicTxPtrn {
3939 /* MAC Address for the adapter */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303940 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003941 uint8_t ucPtrnId; /* Pattern ID */
3942 uint16_t ucPtrnSize; /* Pattern size */
3943 uint32_t usPtrnIntervalMs; /* In msec */
3944 uint8_t ucPattern[PERIODIC_TX_PTRN_MAX_SIZE]; /* Pattern buffer */
3945} tSirAddPeriodicTxPtrn, *tpSirAddPeriodicTxPtrn;
3946
3947typedef struct sSirDelPeriodicTxPtrn {
3948 /* MAC Address for the adapter */
Anurag Chouhan6d760662016-02-20 16:05:43 +05303949 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003950 /* Bitmap of pattern IDs that need to be deleted */
3951 uint32_t ucPatternIdBitmap;
3952 uint8_t ucPtrnId; /* Pattern ID */
3953} tSirDelPeriodicTxPtrn, *tpSirDelPeriodicTxPtrn;
3954
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08003955/*---------------------------------------------------------------------------
3956* tSirIbssGetPeerInfoReqParams
3957*--------------------------------------------------------------------------*/
3958typedef struct {
3959 bool allPeerInfoReqd; /* If set, all IBSS peers stats are reported */
3960 uint8_t staIdx; /* If allPeerInfoReqd is not set, only stats */
3961 /* of peer with staIdx is reported */
3962} tSirIbssGetPeerInfoReqParams, *tpSirIbssGetPeerInfoReqParams;
3963
Rajeev Kumar94c9b452016-03-24 12:58:47 -07003964/**
3965 * typedef struct - tSirIbssGetPeerInfoParams
3966 * @mac_addr: mac address received from target
3967 * @txRate: TX rate
3968 * @mcsIndex: MCS index
3969 * @txRateFlags: TX rate flags
3970 * @rssi: RSSI
3971 */
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08003972typedef struct {
Rajeev Kumar94c9b452016-03-24 12:58:47 -07003973 uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
3974 uint32_t txRate;
3975 uint32_t mcsIndex;
3976 uint32_t txRateFlags;
3977 int8_t rssi;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08003978} tSirIbssPeerInfoParams;
3979
3980typedef struct {
3981 uint32_t status;
3982 uint8_t numPeers;
3983 tSirIbssPeerInfoParams peerInfoParams[32];
3984} tSirPeerInfoRspParams, *tpSirIbssPeerInfoRspParams;
3985
3986/*---------------------------------------------------------------------------
3987* tSirIbssGetPeerInfoRspParams
3988*--------------------------------------------------------------------------*/
3989typedef struct {
3990 uint16_t mesgType;
3991 uint16_t mesgLen;
3992 tSirPeerInfoRspParams ibssPeerInfoRspParams;
3993} tSirIbssGetPeerInfoRspParams, *tpSirIbssGetPeerInfoRspParams;
3994
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003995typedef struct {
3996 uint16_t mesgType;
3997 uint16_t mesgLen;
3998 bool suspended;
3999} tSirReadyToSuspendInd, *tpSirReadyToSuspendInd;
4000#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
4001typedef struct {
4002 uint16_t mesgType;
4003 uint16_t mesgLen;
4004 bool status;
4005} tSirReadyToExtWoWInd, *tpSirReadyToExtWoWInd;
4006#endif
4007typedef struct sSirRateUpdateInd {
4008 uint8_t nss; /* 0: 1x1, 1: 2x2 */
Anurag Chouhan6d760662016-02-20 16:05:43 +05304009 struct qdf_mac_addr bssid;
Jeff Johnsonc1e62782017-11-09 09:50:17 -08004010 enum QDF_OPMODE dev_mode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004011 int32_t bcastDataRate; /* bcast rate unit Mbpsx10, -1:not used */
4012 /*
4013 * 0 implies RA, positive value implies fixed rate, -1 implies ignore
4014 * this param.
4015 */
4016 int32_t ucastDataRate;
4017
4018 /* TX flag to differentiate between HT20, HT40 etc */
4019 tTxrateinfoflags ucastDataRateTxFlag;
4020
4021 /*
4022 * 0 implies MCAST RA, positive value implies fixed rate,
4023 * -1 implies ignore this param
4024 */
4025 int32_t reliableMcastDataRate; /* unit Mbpsx10 */
4026
4027 /* TX flag to differentiate between HT20, HT40 etc */
4028 tTxrateinfoflags reliableMcastDataRateTxFlag;
4029
4030 /*
4031 * MCAST(or BCAST) fixed data rate in 2.4 GHz, unit Mbpsx10,
4032 * 0 implies ignore
4033 */
4034 uint32_t mcastDataRate24GHz;
4035
4036 /* TX flag to differentiate between HT20, HT40 etc */
4037 tTxrateinfoflags mcastDataRate24GHzTxFlag;
4038
4039 /*
4040 * MCAST(or BCAST) fixed data rate in 5 GHz,
4041 * unit Mbpsx10, 0 implies ignore
4042 */
4043 uint32_t mcastDataRate5GHz;
4044
4045 /* TX flag to differentiate between HT20, HT40 etc */
4046 tTxrateinfoflags mcastDataRate5GHzTxFlag;
4047
4048} tSirRateUpdateInd, *tpSirRateUpdateInd;
4049
4050#if defined(FEATURE_WLAN_CH_AVOID) || defined(FEATURE_WLAN_FORCE_SAP_SCC)
4051#define SIR_CH_AVOID_MAX_RANGE 4
4052
4053typedef struct sSirChAvoidFreqType {
4054 uint32_t start_freq;
4055 uint32_t end_freq;
4056} tSirChAvoidFreqType;
4057
4058typedef struct sSirChAvoidIndType {
4059 uint32_t avoid_range_count;
4060 tSirChAvoidFreqType avoid_freq_range[SIR_CH_AVOID_MAX_RANGE];
4061} tSirChAvoidIndType;
4062#endif /* FEATURE_WLAN_CH_AVOID || FEATURE_WLAN_FORCE_SAP_SCC */
4063
4064#define SIR_DFS_MAX_20M_SUB_CH 8
Sandeep Puligilla949eaa72015-12-17 18:43:52 -08004065#define SIR_80MHZ_START_CENTER_CH_DIFF 6
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004066
4067typedef struct sSirSmeDfsChannelList {
4068 uint32_t nchannels;
4069 /* Ch num including bonded channels on which the RADAR is present */
4070 uint8_t channels[SIR_DFS_MAX_20M_SUB_CH];
4071} tSirSmeDfsChannelList, *tpSirSmeDfsChannelList;
4072
4073typedef struct sSirSmeDfsEventInd {
4074 uint32_t sessionId;
4075 tSirSmeDfsChannelList chan_list;
4076 uint32_t dfs_radar_status;
4077 int use_nol;
4078} tSirSmeDfsEventInd, *tpSirSmeDfsEventInd;
4079
4080typedef struct sSirChanChangeRequest {
4081 uint16_t messageType;
4082 uint16_t messageLen;
4083 uint8_t targetChannel;
Kiran Kumar Lokere999e58c2016-01-07 02:18:39 -08004084 uint8_t sec_ch_offset;
Kiran Kumar Lokere13644672016-02-29 15:40:10 -08004085 enum phy_ch_width ch_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004086 uint8_t center_freq_seg_0;
4087 uint8_t center_freq_seg_1;
Anurag Chouhan6d760662016-02-20 16:05:43 +05304088 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004089 uint32_t dot11mode;
4090 tSirMacRateSet operational_rateset;
4091 tSirMacRateSet extended_rateset;
Arif Hussain671a1902017-03-17 09:08:32 -07004092 uint32_t cac_duration_ms;
4093 uint32_t dfs_regdomain;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004094} tSirChanChangeRequest, *tpSirChanChangeRequest;
4095
4096typedef struct sSirChanChangeResponse {
4097 uint8_t sessionId;
4098 uint8_t newChannelNumber;
4099 uint8_t channelChangeStatus;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004100} tSirChanChangeResponse, *tpSirChanChangeResponse;
4101
4102typedef struct sSirStartBeaconIndication {
4103 uint16_t messageType;
4104 uint16_t messageLen;
4105 uint8_t beaconStartStatus;
Anurag Chouhan6d760662016-02-20 16:05:43 +05304106 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004107} tSirStartBeaconIndication, *tpSirStartBeaconIndication;
4108
4109/* additional IE type */
4110typedef enum tUpdateIEsType {
4111 eUPDATE_IE_NONE,
4112 eUPDATE_IE_PROBE_BCN,
4113 eUPDATE_IE_PROBE_RESP,
4114 eUPDATE_IE_ASSOC_RESP,
4115
4116 /* Add type above this line */
4117 /* this is used to reset all buffer */
4118 eUPDATE_IE_ALL,
4119 eUPDATE_IE_MAX
4120} eUpdateIEsType;
4121
4122/* Modify particular IE in addition IE for prob resp Bcn */
4123typedef struct sSirModifyIE {
Anurag Chouhan6d760662016-02-20 16:05:43 +05304124 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004125 uint16_t smeSessionId;
4126 bool notify;
4127 uint8_t ieID;
4128 uint8_t ieIDLen; /*ie length as per spec */
4129 uint16_t ieBufferlength;
4130 uint8_t *pIEBuffer;
Rajeev Kumar8e3e2832015-11-06 16:02:54 -08004131 int32_t oui_length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004132
4133} tSirModifyIE, *tpSirModifyIE;
4134
4135/* Message format for Update IE message sent to PE */
4136typedef struct sSirModifyIEsInd {
4137 uint16_t msgType;
4138 uint16_t msgLen;
4139 tSirModifyIE modifyIE;
4140 eUpdateIEsType updateType;
4141} tSirModifyIEsInd, *tpSirModifyIEsInd;
4142
4143/* Message format for Update IE message sent to PE */
4144typedef struct sSirUpdateIE {
Anurag Chouhan6d760662016-02-20 16:05:43 +05304145 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004146 uint16_t smeSessionId;
4147 bool append;
4148 bool notify;
4149 uint16_t ieBufferlength;
4150 uint8_t *pAdditionIEBuffer;
4151} tSirUpdateIE, *tpSirUpdateIE;
4152
4153/* Message format for Update IE message sent to PE */
4154typedef struct sSirUpdateIEsInd {
4155 uint16_t msgType;
4156 uint16_t msgLen;
4157 tSirUpdateIE updateIE;
4158 eUpdateIEsType updateType;
4159} tSirUpdateIEsInd, *tpSirUpdateIEsInd;
4160
4161/* Message format for requesting channel switch announcement to lower layers */
4162typedef struct sSirDfsCsaIeRequest {
4163 uint16_t msgType;
4164 uint16_t msgLen;
4165 uint8_t targetChannel;
4166 uint8_t csaIeRequired;
Anurag Chouhan6d760662016-02-20 16:05:43 +05304167 uint8_t bssid[QDF_MAC_ADDR_SIZE];
Amar Singhal5cccafe2017-02-15 12:42:58 -08004168 struct ch_params ch_params;
gaoleze2920bd2017-03-21 17:38:42 +08004169 uint8_t ch_switch_beacon_cnt;
gaolez76d2a162017-03-21 19:23:58 +08004170 uint8_t ch_switch_mode;
4171 uint8_t dfs_ch_switch_disable;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004172} tSirDfsCsaIeRequest, *tpSirDfsCsaIeRequest;
4173
4174/* Indication from lower layer indicating the completion of first beacon send
4175 * after the beacon template update
4176 */
4177typedef struct sSirFirstBeaconTxCompleteInd {
4178 uint16_t messageType; /* eWNI_SME_MISSED_BEACON_IND */
4179 uint16_t length;
4180 uint8_t bssIdx;
4181} tSirFirstBeaconTxCompleteInd, *tpSirFirstBeaconTxCompleteInd;
4182
4183typedef struct sSirSmeCSAIeTxCompleteRsp {
4184 uint8_t sessionId;
4185 uint8_t chanSwIeTxStatus;
4186} tSirSmeCSAIeTxCompleteRsp, *tpSirSmeCSAIeTxCompleteRsp;
4187
4188/* Thermal Mitigation*/
4189
4190typedef struct {
4191 uint16_t minTempThreshold;
4192 uint16_t maxTempThreshold;
4193} t_thermal_level_info, *tp_thermal_level_info;
4194
4195typedef enum {
4196 WLAN_WMA_THERMAL_LEVEL_0,
4197 WLAN_WMA_THERMAL_LEVEL_1,
4198 WLAN_WMA_THERMAL_LEVEL_2,
4199 WLAN_WMA_THERMAL_LEVEL_3,
4200 WLAN_WMA_MAX_THERMAL_LEVELS
4201} t_thermal_level;
4202
Poddar, Siddarth83905022016-04-16 17:56:08 -07004203#define WLAN_THROTTLE_DUTY_CYCLE_LEVEL_MAX (4)
4204
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004205typedef struct {
4206 /* Array of thermal levels */
4207 t_thermal_level_info thermalLevels[WLAN_WMA_MAX_THERMAL_LEVELS];
4208 uint8_t thermalCurrLevel;
4209 uint8_t thermalMgmtEnabled;
4210 uint32_t throttlePeriod;
Poddar, Siddarth83905022016-04-16 17:56:08 -07004211 uint8_t throttle_duty_cycle_tbl[WLAN_THROTTLE_DUTY_CYCLE_LEVEL_MAX];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004212} t_thermal_mgmt, *tp_thermal_mgmt;
4213
4214typedef struct sSirTxPowerLimit {
4215 /* Thermal limits for 2g and 5g */
4216 uint32_t txPower2g;
4217 uint32_t txPower5g;
4218} tSirTxPowerLimit;
4219
Poddar, Siddarth5a91f5b2016-04-28 12:24:10 +05304220enum bad_peer_thresh_levels {
4221 WLAN_WMA_IEEE80211_B_LEVEL = 0,
4222 WLAN_WMA_IEEE80211_AG_LEVEL,
4223 WLAN_WMA_IEEE80211_N_LEVEL,
4224 WLAN_WMA_IEEE80211_AC_LEVEL,
4225 WLAN_WMA_IEEE80211_AX_LEVEL,
4226 WLAN_WMA_IEEE80211_MAX_LEVEL,
4227};
4228
4229#define NUM_OF_RATE_THRESH_MAX (4)
4230struct t_bad_peer_info {
4231 uint32_t cond;
4232 uint32_t delta;
4233 uint32_t percentage;
4234 uint32_t thresh[NUM_OF_RATE_THRESH_MAX];
4235 uint32_t txlimit;
4236};
4237
4238struct t_bad_peer_txtcl_config {
4239 /* Array of thermal levels */
4240 struct t_bad_peer_info threshold[WLAN_WMA_IEEE80211_MAX_LEVEL];
4241 uint32_t enable;
4242 uint32_t period;
4243 uint32_t txq_limit;
4244 uint32_t tgt_backoff;
4245 uint32_t tgt_report_prd;
4246};
4247
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004248/* notify MODEM power state to FW */
4249typedef struct {
4250 uint32_t param;
4251} tSirModemPowerStateInd, *tpSirModemPowerStateInd;
4252
4253#ifdef WLAN_FEATURE_STATS_EXT
4254typedef struct {
4255 uint32_t vdev_id;
4256 uint32_t event_data_len;
4257 uint8_t event_data[];
4258} tSirStatsExtEvent, *tpSirStatsExtEvent;
4259#endif
4260
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004261typedef struct {
4262 uint32_t event_data_len;
4263 uint8_t event_data[];
4264} tSirNanEvent, *tpSirNanEvent;
Mahesh Kumar Kalikot Veetil919e01d2016-09-09 17:09:10 -07004265
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004266typedef struct sSirSmeRoamOffloadSynchInd {
4267 uint16_t messageType; /*eWNI_SME_ROAM_OFFLOAD_SYNCH_IND */
4268 uint16_t length;
4269 uint16_t beaconProbeRespOffset;
4270 uint16_t beaconProbeRespLength;
4271 uint16_t reassocRespOffset;
4272 uint16_t reassocRespLength;
Naveen Rawat14298b92015-11-25 16:27:41 -08004273 uint16_t reassoc_req_offset;
4274 uint16_t reassoc_req_length;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004275 uint8_t isBeacon;
4276 uint8_t roamedVdevId;
Anurag Chouhan6d760662016-02-20 16:05:43 +05304277 struct qdf_mac_addr bssid;
Varun Reddy Yeturu28925b42016-02-08 07:18:50 -08004278 struct qdf_mac_addr self_mac;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004279 int8_t txMgmtPower;
4280 uint32_t authStatus;
4281 uint8_t rssi;
4282 uint8_t roamReason;
4283 uint32_t chan_freq;
4284 uint8_t kck[SIR_KCK_KEY_LEN];
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05304285 uint32_t kek_len;
4286 uint8_t kek[SIR_KEK_KEY_LEN_FILS];
4287 uint32_t pmk_len;
4288 uint8_t pmk[SIR_PMK_LEN];
4289 uint8_t pmkid[SIR_PMKID_LEN];
4290 bool update_erp_next_seq_num;
4291 uint16_t next_erp_seq_num;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004292 uint8_t replay_ctr[SIR_REPLAY_CTR_LEN];
Varun Reddy Yeturud5939f82015-12-24 18:14:02 -08004293 void *add_bss_params;
4294 tpSirSmeJoinRsp join_rsp;
4295 uint16_t aid;
Naveen Rawat8cc23b02016-07-14 12:22:56 -07004296 struct sir_hw_mode_trans_ind hw_mode_trans_ind;
Naveen Rawat746a90b2017-06-07 15:16:35 -07004297 uint8_t nss;
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +05304298 struct qdf_mac_addr dst_mac;
4299 struct qdf_mac_addr src_mac;
4300 uint16_t hlp_data_len;
4301 uint8_t hlp_data[FILS_MAX_HLP_DATA_LEN];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004302} roam_offload_synch_ind;
4303
Varun Reddy Yeturubbbbe232016-02-29 14:01:57 -08004304#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004305typedef struct sSirSmeRoamOffloadSynchCnf {
4306 uint8_t sessionId;
4307} tSirSmeRoamOffloadSynchCnf, *tpSirSmeRoamOffloadSynchCnf;
4308
4309typedef struct sSirSmeHOFailureInd {
4310 uint8_t sessionId;
4311} tSirSmeHOFailureInd, *tpSirSmeHOFailureInd;
4312
4313struct roam_offload_synch_fail {
4314 uint8_t session_id;
4315};
4316
4317#endif
4318
4319#ifdef FEATURE_WLAN_EXTSCAN
4320
4321/**
4322 * typedef enum wifi_scan_flags - wifi scan flags
4323 * @WIFI_SCAN_FLAG_INTERRUPTED: Indicates that scan results are not complete
4324 * because probes were not sent on some channels
4325 */
4326typedef enum {
4327 WIFI_SCAN_FLAG_INTERRUPTED = 1,
4328} wifi_scan_flags;
4329
4330typedef enum {
4331 WIFI_BAND_UNSPECIFIED,
4332 WIFI_BAND_BG = 1, /* 2.4 GHz */
4333 WIFI_BAND_A = 2, /* 5 GHz without DFS */
4334 WIFI_BAND_ABG = 3, /* 2.4 GHz + 5 GHz; no DFS */
4335 WIFI_BAND_A_DFS_ONLY = 4, /* 5 GHz DFS only */
4336 /* 5 is reserved */
4337 WIFI_BAND_A_WITH_DFS = 6, /* 5 GHz with DFS */
4338 WIFI_BAND_ABG_WITH_DFS = 7, /* 2.4 GHz + 5 GHz with DFS */
4339
4340 /* Keep it last */
4341 WIFI_BAND_MAX
4342} tWifiBand;
4343
Mukul Sharma45114d92016-08-12 19:34:14 +05304344/**
4345 * enum wifi_extscan_event_type - extscan event type
4346 * @WIFI_EXTSCAN_RESULTS_AVAILABLE: reported when REPORT_EVENTS_EACH_SCAN is set
4347 * and a scan cycle completes. WIFI_SCAN_THRESHOLD_NUM_SCANS or
4348 * WIFI_SCAN_THRESHOLD_PERCENT can be reported instead if the
4349 * reason for the event is available; however, at most one of
4350 * these events should be reported per scan.
4351 * @WIFI_EXTSCAN_THRESHOLD_NUM_SCANS: can be reported when
4352 * REPORT_EVENTS_EACH_SCAN is not set and
4353 * report_threshold_num_scans is reached.
4354 * @WIFI_EXTSCAN_THRESHOLD_PERCENT: can be reported when REPORT_EVENTS_EACH_SCAN
4355 * is not set and report_threshold_percent is reached.
4356 * @WIFI_SCAN_DISABLED: reported when currently executing gscans are disabled
4357 * start_gscan will need to be called again in order to continue
4358 * scanning.
4359 * @WIFI_EXTSCAN_BUCKET_STARTED_EVENT: Bucket started event
4360 * This event is consumed in driver only.
4361 * @WIFI_EXTSCAN_CYCLE_STARTED_EVENT: Cycle started event.
4362 * This event is consumed in driver only.
4363 * @WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT: Cycle complete event. This event
4364 * triggers @WIFI_EXTSCAN_RESULTS_AVAILABLE to the user space.
4365 */
4366enum wifi_extscan_event_type {
Mukul Sharmafa937be2016-08-12 18:13:36 +05304367 WIFI_EXTSCAN_RESULTS_AVAILABLE,
Mukul Sharmafa937be2016-08-12 18:13:36 +05304368 WIFI_EXTSCAN_THRESHOLD_NUM_SCANS,
Mukul Sharmafa937be2016-08-12 18:13:36 +05304369 WIFI_EXTSCAN_THRESHOLD_PERCENT,
Mukul Sharmafa937be2016-08-12 18:13:36 +05304370 WIFI_SCAN_DISABLED,
4371
Mukul Sharmafa937be2016-08-12 18:13:36 +05304372 WIFI_EXTSCAN_BUCKET_STARTED_EVENT = 0x10,
4373 WIFI_EXTSCAN_CYCLE_STARTED_EVENT,
4374 WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT,
Mukul Sharma45114d92016-08-12 19:34:14 +05304375};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004376
4377/**
4378 * enum extscan_configuration_flags - extscan config flags
4379 * @EXTSCAN_LP_EXTENDED_BATCHING: extended batching
4380 */
4381enum extscan_configuration_flags {
4382 EXTSCAN_LP_EXTENDED_BATCHING = 0x00000001,
4383};
4384
4385typedef struct {
Anurag Chouhan6d760662016-02-20 16:05:43 +05304386 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004387
4388 /* Low threshold */
4389 int32_t low;
4390
4391 /* High threshold */
4392 int32_t high;
4393} tSirAPThresholdParam, *tpSirAPThresholdParam;
4394
4395typedef struct {
4396 uint32_t requestId;
4397 uint8_t sessionId;
4398} tSirGetExtScanCapabilitiesReqParams, *tpSirGetExtScanCapabilitiesReqParams;
4399
4400/**
4401 * struct ext_scan_capabilities_response - extscan capabilities response data
4402 * @requestId: request identifier
4403 * @status: status
4404 * @max_scan_cache_size: total space allocated for scan (in bytes)
4405 * @max_scan_buckets: maximum number of channel buckets
4406 * @max_ap_cache_per_scan: maximum number of APs that can be stored per scan
4407 * @max_rssi_sample_size: number of RSSI samples used for averaging RSSI
4408 * @ax_scan_reporting_threshold: max possible report_threshold
4409 * @max_hotlist_bssids: maximum number of entries for hotlist APs
4410 * @max_significant_wifi_change_aps: maximum number of entries for
4411 * significant wifi change APs
4412 * @max_bssid_history_entries: number of BSSID/RSSI entries that device can hold
4413 * @max_hotlist_ssids: maximum number of entries for hotlist SSIDs
4414 * @max_number_epno_networks: max number of epno entries
4415 * @max_number_epno_networks_by_ssid: max number of epno entries
4416 * if ssid is specified, that is, epno entries for
4417 * which an exact match is required,
4418 * or entries corresponding to hidden ssids
4419 * @max_number_of_white_listed_ssid: max number of white listed SSIDs
Padma, Santhosh Kumar1ac02402016-11-02 18:04:14 +05304420 * @max_number_of_black_listed_bssid: max number of black listed BSSIDs
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004421 */
4422struct ext_scan_capabilities_response {
4423 uint32_t requestId;
4424 uint32_t status;
4425
4426 uint32_t max_scan_cache_size;
4427 uint32_t max_scan_buckets;
4428 uint32_t max_ap_cache_per_scan;
4429 uint32_t max_rssi_sample_size;
4430 uint32_t max_scan_reporting_threshold;
4431
4432 uint32_t max_hotlist_bssids;
4433 uint32_t max_significant_wifi_change_aps;
4434
4435 uint32_t max_bssid_history_entries;
4436 uint32_t max_hotlist_ssids;
4437 uint32_t max_number_epno_networks;
4438 uint32_t max_number_epno_networks_by_ssid;
4439 uint32_t max_number_of_white_listed_ssid;
Padma, Santhosh Kumar1ac02402016-11-02 18:04:14 +05304440 uint32_t max_number_of_black_listed_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004441};
4442
4443typedef struct {
4444 uint32_t requestId;
4445 uint8_t sessionId;
4446
4447 /*
4448 * 1 - return cached results and flush it
4449 * 0 - return cached results and do not flush
4450 */
4451 bool flush;
4452} tSirExtScanGetCachedResultsReqParams, *tpSirExtScanGetCachedResultsReqParams;
4453
4454typedef struct {
4455 uint32_t requestId;
4456 uint32_t status;
4457} tSirExtScanGetCachedResultsRspParams, *tpSirExtScanGetCachedResultsRspParams;
4458
4459typedef struct {
4460 /* Time of discovery */
4461 uint64_t ts;
4462
4463 /* Null terminated SSID */
4464 uint8_t ssid[SIR_MAC_MAX_SSID_LENGTH + 1];
4465
Anurag Chouhan6d760662016-02-20 16:05:43 +05304466 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004467
4468 /* Frequency in MHz */
4469 uint32_t channel;
4470
4471 /* RSSI in dBm */
4472 int32_t rssi;
4473
4474 /* RTT in nanoseconds */
4475 uint32_t rtt;
4476
4477 /* Standard deviation in rtt */
4478 uint32_t rtt_sd;
4479
4480 /* Period advertised in the beacon */
4481 uint16_t beaconPeriod;
4482
4483 /* Capabilities advertised in the beacon */
4484 uint16_t capability;
4485
4486 uint16_t ieLength;
4487
4488 uint8_t ieData[];
4489} tSirWifiScanResult, *tpSirWifiScanResult;
4490
4491/**
4492 * struct extscan_hotlist_match - extscan hotlist match
4493 * @requestId: request identifier
4494 * @numOfAps: number of bssids retrieved by the scan
4495 * @moreData: 0 - for last fragment
4496 * 1 - still more fragment(s) coming
4497 * @ap: wifi scan result
4498 */
4499struct extscan_hotlist_match {
4500 uint32_t requestId;
4501 bool moreData;
4502 bool ap_found;
4503 uint32_t numOfAps;
4504 tSirWifiScanResult ap[];
4505};
4506
4507/**
4508 * struct extscan_cached_scan_result - extscan cached scan result
4509 * @scan_id: a unique identifier for the scan unit
4510 * @flags: a bitmask with additional information about scan
4511 * @num_results: number of bssids retrieved by the scan
Mukul Sharmaf7cb3ab2016-08-12 19:53:52 +05304512 * @buckets_scanned: bitmask of buckets scanned in current extscan cycle
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004513 * @ap: wifi scan bssid results info
4514 */
4515struct extscan_cached_scan_result {
4516 uint32_t scan_id;
4517 uint32_t flags;
4518 uint32_t num_results;
Mukul Sharmaf7cb3ab2016-08-12 19:53:52 +05304519 uint32_t buckets_scanned;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004520 tSirWifiScanResult *ap;
4521};
4522
4523/**
4524 * struct tSirWifiScanResultEvent - wifi scan result event
4525 * @requestId: request identifier
4526 * @ap_found: flag to indicate ap found or not
4527 * true: AP was found
4528 * false: AP was lost
4529 * @numOfAps: number of aps
4530 * @moreData: more data
4531 * @ap: bssid information
4532 *
4533 */
4534typedef struct {
4535 uint32_t requestId;
4536 bool ap_found;
4537 uint32_t numOfAps;
4538 bool moreData;
4539 tSirWifiScanResult ap[];
4540} tSirWifiScanResultEvent, *tpSirWifiScanResultEvent;
4541
4542/**
4543 * struct extscan_cached_scan_results - extscan cached scan results
4544 * @request_id: request identifier
4545 * @more_data: 0 - for last fragment
4546 * 1 - still more fragment(s) coming
4547 * @num_scan_ids: number of scan ids
4548 * @result: wifi scan result
4549 */
4550struct extscan_cached_scan_results {
4551 uint32_t request_id;
4552 bool more_data;
4553 uint32_t num_scan_ids;
4554 struct extscan_cached_scan_result *result;
4555};
4556
4557
4558/**
4559 * struct tSirWifiFullScanResultEvent - extscan full scan event
4560 * @request_id: request identifier
4561 * @moreData: 0 - for last fragment
4562 * 1 - still more fragment(s) coming
4563 * @ap: bssid info
4564 *
4565 * Reported when each probe response is received, if reportEvents
4566 * enabled in tSirWifiScanCmdReqParams
4567 */
4568typedef struct {
4569 uint32_t requestId;
4570 bool moreData;
4571 tSirWifiScanResult ap;
4572} tSirWifiFullScanResultEvent, *tpSirWifiFullScanResultEvent;
4573
4574/**
4575 * struct pno_match_found - epno match found
4576 * @request_id: request identifier
4577 * @moreData: 0 - for last fragment
4578 * 1 - still more fragment(s) coming
4579 * @num_results: number of bssids, driver sends this event to upper layer
4580 * for every beacon, hence %num_results is always set to 1.
4581 * @ap: bssid info
4582 *
4583 * Reported when each beacon probe response is received with
4584 * epno match found tag.
4585 */
4586struct pno_match_found {
4587 uint32_t request_id;
4588 bool more_data;
4589 uint32_t num_results;
4590 tSirWifiScanResult ap[];
4591};
4592
4593typedef struct {
4594 /* Frequency in MHz */
4595 uint32_t channel;
4596
4597 uint32_t dwellTimeMs;
4598
4599 /* 0 => active
4600 1 => passive scan; ignored for DFS */
4601 bool passive;
4602
4603 uint8_t chnlClass;
4604} tSirWifiScanChannelSpec, *tpSirWifiScanChannelSpec;
4605
4606/**
4607 * struct tSirWifiScanBucketSpec - wifi scan bucket spec
4608 * @bucket: bucket identifier
4609 * @band: wifi band
4610 * @period: Desired period, in millisecond; if this is too
4611 * low, the firmware should choose to generate results as fast as
4612 * it can instead of failing the command byte
4613 * for exponential backoff bucket this is the min_period
4614 * @reportEvents: 0 => normal reporting (reporting rssi history
4615 * only, when rssi history buffer is % full)
4616 * 1 => same as 0 + report a scan completion event after scanning
4617 * this bucket
4618 * 2 => same as 1 + forward scan results
4619 * (beacons/probe responses + IEs) in real time to HAL
4620 * @max_period: if max_period is non zero or different than period,
4621 * then this bucket is an exponential backoff bucket and
4622 * the scan period will grow exponentially as per formula:
4623 * actual_period(N) = period ^ (N/(step_count+1)) to a
4624 * maximum period of max_period
4625 * @exponent: for exponential back off bucket: multiplier:
4626 * new_period = old_period * exponent
4627 * @step_count: for exponential back off bucket, number of scans performed
4628 * at a given period and until the exponent is applied
4629 * @numChannels: channels to scan; these may include DFS channels
4630 * Note that a given channel may appear in multiple buckets
4631 * @min_dwell_time_active: per bucket minimum active dwell time
4632 * @max_dwell_time_active: per bucket maximum active dwell time
4633 * @min_dwell_time_passive: per bucket minimum passive dwell time
4634 * @max_dwell_time_passive: per bucket maximum passive dwell time
4635 * @channels: Channel list
4636 */
4637typedef struct {
4638 uint8_t bucket;
4639 tWifiBand band;
4640 uint32_t period;
4641 uint32_t reportEvents;
4642 uint32_t max_period;
4643 uint32_t exponent;
4644 uint32_t step_count;
4645 uint32_t numChannels;
4646
4647 uint32_t min_dwell_time_active;
4648 uint32_t max_dwell_time_active;
4649 uint32_t min_dwell_time_passive;
4650 uint32_t max_dwell_time_passive;
4651 tSirWifiScanChannelSpec channels[WLAN_EXTSCAN_MAX_CHANNELS];
4652} tSirWifiScanBucketSpec, *tpSirWifiScanBucketSpec;
4653
4654/**
4655 * struct tSirWifiScanCmdReqParams - wifi scan command request params
4656 * @basePeriod: base timer period
4657 * @maxAPperScan: max ap per scan
4658 * @report_threshold_percent: report threshold
4659 * in %, when buffer is this much full, wake up host
4660 * @report_threshold_num_scans: report threshold number of scans
4661 * in number of scans, wake up host after these many scans
4662 * @requestId: request id
4663 * @sessionId: session id
4664 * @numBuckets: number of buckets
4665 * @min_dwell_time_active: per bucket minimum active dwell time
4666 * @max_dwell_time_active: per bucket maximum active dwell time
4667 * @min_dwell_time_passive: per bucket minimum passive dwell time
4668 * @max_dwell_time_passive: per bucket maximum passive dwell time
4669 * @configuration_flags: configuration flags
4670 * @buckets: buckets array
4671 */
4672typedef struct {
4673 uint32_t basePeriod;
4674 uint32_t maxAPperScan;
4675
4676 uint32_t report_threshold_percent;
4677 uint32_t report_threshold_num_scans;
4678
4679 uint32_t requestId;
4680 uint8_t sessionId;
4681 uint32_t numBuckets;
4682
4683 uint32_t min_dwell_time_active;
4684 uint32_t max_dwell_time_active;
4685 uint32_t min_dwell_time_passive;
4686 uint32_t max_dwell_time_passive;
4687 uint32_t configuration_flags;
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +05304688 enum wmi_dwelltime_adaptive_mode extscan_adaptive_dwell_mode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004689 tSirWifiScanBucketSpec buckets[WLAN_EXTSCAN_MAX_BUCKETS];
4690} tSirWifiScanCmdReqParams, *tpSirWifiScanCmdReqParams;
4691
4692/**
4693 * struct sir_extscan_generic_response -
4694 * Generic ExtScan Response structure
4695 * @request_id: ID of the request
4696 * @status: operation status returned by firmware
4697 */
4698struct sir_extscan_generic_response {
4699 uint32_t request_id;
4700 uint32_t status;
4701};
4702
4703typedef struct {
4704 uint32_t requestId;
4705 uint8_t sessionId;
4706} tSirExtScanStopReqParams, *tpSirExtScanStopReqParams;
4707
4708/**
4709 * struct tSirExtScanSetBssidHotListReqParams - set hotlist request
4710 * @requestId: request identifier
4711 * @sessionId: session identifier
4712 * @lost_ap_sample_size: number of samples to confirm AP loss
4713 * @numAp: Number of hotlist APs
4714 * @ap: hotlist APs
4715 */
4716typedef struct {
4717 uint32_t requestId;
4718 uint8_t sessionId;
4719
4720 uint32_t lost_ap_sample_size;
4721 uint32_t numAp;
4722 tSirAPThresholdParam ap[WLAN_EXTSCAN_MAX_HOTLIST_APS];
4723} tSirExtScanSetBssidHotListReqParams, *tpSirExtScanSetBssidHotListReqParams;
4724
4725typedef struct {
4726 uint32_t requestId;
4727 uint8_t sessionId;
4728} tSirExtScanResetBssidHotlistReqParams,
4729*tpSirExtScanResetBssidHotlistReqParams;
4730
4731/**
Manikandan Mohan80dea792016-04-28 16:36:48 -07004732 * struct sir_wisa_params - WISA Mode Parameters
4733 * @mode: WISA mode
4734 * @session_id: Session ID of vdev
4735 */
4736struct sir_wisa_params {
4737 bool mode;
4738 uint8_t vdev_id;
4739};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004740
4741typedef struct {
4742 uint32_t requestId;
4743 uint8_t sessionId;
4744
4745 /* Number of samples for averaging RSSI */
4746 uint32_t rssiSampleSize;
4747
4748 /* Number of missed samples to confirm AP loss */
4749 uint32_t lostApSampleSize;
4750
4751 /* Number of APs breaching threshold required for firmware
4752 * to generate event
4753 */
4754 uint32_t minBreaching;
4755
4756 uint32_t numAp;
4757 tSirAPThresholdParam ap[WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS];
4758} tSirExtScanSetSigChangeReqParams, *tpSirExtScanSetSigChangeReqParams;
4759
4760typedef struct {
Anurag Chouhan6d760662016-02-20 16:05:43 +05304761 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004762 uint32_t channel;
4763 uint32_t numOfRssi;
4764
4765 /* Rssi history in db */
4766 int32_t rssi[];
4767} tSirWifiSignificantChange, *tpSirWifiSignificantChange;
4768
4769typedef struct {
4770 uint32_t requestId;
4771
4772 bool moreData;
4773 uint32_t numResults;
4774 tSirWifiSignificantChange ap[];
4775} tSirWifiSignificantChangeEvent, *tpSirWifiSignificantChangeEvent;
4776
4777typedef struct {
4778 uint32_t requestId;
4779 uint8_t sessionId;
4780} tSirExtScanResetSignificantChangeReqParams,
4781*tpSirExtScanResetSignificantChangeReqParams;
4782
4783typedef struct {
4784 uint32_t requestId;
4785 uint32_t numResultsAvailable;
4786} tSirExtScanResultsAvailableIndParams, *tpSirExtScanResultsAvailableIndParams;
4787
4788typedef struct {
4789 uint32_t requestId;
4790 uint32_t status;
4791 uint8_t scanEventType;
Mukul Sharmafa937be2016-08-12 18:13:36 +05304792 uint32_t buckets_scanned;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004793} tSirExtScanOnScanEventIndParams, *tpSirExtScanOnScanEventIndParams;
4794
Mukul Sharmae8c919f2016-10-02 20:35:15 +05304795#define MAX_EPNO_NETWORKS 64
4796
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004797/**
4798 * struct wifi_epno_network - enhanced pno network block
4799 * @ssid: ssid
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004800 * @flags: WIFI_PNO_FLAG_XXX
4801 * @auth_bit_field: auth bit field for matching WPA IE
4802 */
4803struct wifi_epno_network {
4804 tSirMacSSid ssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004805 uint8_t flags;
4806 uint8_t auth_bit_field;
4807};
4808
4809/**
4810 * struct wifi_epno_params - enhanced pno network params
Mukul Sharmae8c919f2016-10-02 20:35:15 +05304811 * @request_id: request id number
4812 * @session_id: session_id number
4813 * @min_5ghz_rssi: minimum 5GHz RSSI for a BSSID to be considered
4814 * @min_24ghz_rssi: minimum 2.4GHz RSSI for a BSSID to be considered
4815 * @initial_score_max: maximum score that a network can have before bonuses
4816 * @current_connection_bonus: only report when there is a network's score this
4817 * much higher than the current connection
4818 * @same_network_bonus: score bonus for all n/w with the same network flag
4819 * @secure_bonus: score bonus for networks that are not open
4820 * @band_5ghz_bonus: 5GHz RSSI score bonus (applied to all 5GHz networks)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004821 * @num_networks: number of ssids
Mukul Sharmae8c919f2016-10-02 20:35:15 +05304822 * @networks: EPNO networks
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004823 */
4824struct wifi_epno_params {
4825 uint32_t request_id;
4826 uint32_t session_id;
Mukul Sharmae8c919f2016-10-02 20:35:15 +05304827 uint32_t min_5ghz_rssi;
4828 uint32_t min_24ghz_rssi;
4829 uint32_t initial_score_max;
4830 uint32_t current_connection_bonus;
4831 uint32_t same_network_bonus;
4832 uint32_t secure_bonus;
4833 uint32_t band_5ghz_bonus;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004834 uint32_t num_networks;
4835 struct wifi_epno_network networks[];
4836};
4837
Jeff Johnson96f93a32016-11-18 11:02:24 -08004838#define SIR_PASSPOINT_LIST_MAX_NETWORKS 8
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004839#define SIR_PASSPOINT_REALM_LEN 256
4840#define SIR_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM 16
4841#define SIR_PASSPOINT_PLMN_LEN 3
4842/**
4843 * struct wifi_passpoint_network - passpoint network block
4844 * @id: identifier of this network block
4845 * @realm: null terminated UTF8 encoded realm, 0 if unspecified
4846 * @roaming_consortium_ids: roaming consortium ids to match, 0s if unspecified
4847 * @plmn: mcc/mnc combination as per rules, 0s if unspecified
4848 */
4849struct wifi_passpoint_network {
4850 uint32_t id;
4851 uint8_t realm[SIR_PASSPOINT_REALM_LEN];
4852 int64_t roaming_consortium_ids[SIR_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM];
4853 uint8_t plmn[SIR_PASSPOINT_PLMN_LEN];
4854};
4855
4856/**
4857 * struct wifi_passpoint_req - passpoint request
4858 * @request_id: request identifier
4859 * @num_networks: number of networks
4860 * @networks: passpoint networks
4861 */
4862struct wifi_passpoint_req {
4863 uint32_t request_id;
4864 uint32_t session_id;
4865 uint32_t num_networks;
4866 struct wifi_passpoint_network networks[];
4867};
4868
4869/**
4870 * struct wifi_passpoint_match - wifi passpoint network match
4871 * @id: network block identifier for the matched network
4872 * @anqp_len: length of ANQP blob
4873 * @ap: scan result, with channel and beacon information
4874 * @anqp: ANQP data, in the information_element format
4875 */
4876struct wifi_passpoint_match {
4877 uint32_t request_id;
4878 uint32_t id;
4879 uint32_t anqp_len;
4880 tSirWifiScanResult ap;
4881 uint8_t anqp[];
4882};
4883#endif /* FEATURE_WLAN_EXTSCAN */
4884
4885#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
4886typedef struct {
4887 uint32_t timer_val;
4888} tSirAutoShutdownCmdParams;
4889
4890typedef struct {
4891 uint32_t shutdown_reason;
4892} tSirAutoShutdownEvtParams;
4893#endif
4894
4895#ifdef WLAN_FEATURE_LINK_LAYER_STATS
4896
4897typedef struct {
4898 uint32_t reqId;
4899 uint8_t staId;
4900 uint32_t mpduSizeThreshold;
4901 uint32_t aggressiveStatisticsGathering;
4902} tSirLLStatsSetReq, *tpSirLLStatsSetReq;
4903
4904typedef struct {
4905 uint32_t reqId;
4906 uint8_t staId;
4907 uint32_t paramIdMask;
4908} tSirLLStatsGetReq, *tpSirLLStatsGetReq;
4909
4910typedef struct {
4911 uint32_t reqId;
4912 uint8_t staId;
4913 uint32_t statsClearReqMask;
4914 uint8_t stopReq;
4915} tSirLLStatsClearReq, *tpSirLLStatsClearReq;
4916
Sridhar Selvarajdc400d22016-10-18 17:18:03 +05304917#ifdef WLAN_POWER_DEBUGFS
4918/**
4919 * struct power_stats_response - Power stats response
4920 * @cumulative_sleep_time_ms: cumulative sleep time in ms
4921 * @cumulative_total_on_time_ms: total awake time in ms
4922 * @deep_sleep_enter_counter: deep sleep enter counter
4923 * @last_deep_sleep_enter_tstamp_ms: last deep sleep enter timestamp
4924 * @debug_register_fmt: debug registers format
4925 * @num_debug_register: number of debug registers
4926 * @debug_registers: Pointer to the debug registers buffer
4927 */
4928struct power_stats_response {
4929 uint32_t cumulative_sleep_time_ms;
4930 uint32_t cumulative_total_on_time_ms;
4931 uint32_t deep_sleep_enter_counter;
4932 uint32_t last_deep_sleep_enter_tstamp_ms;
4933 uint32_t debug_register_fmt;
4934 uint32_t num_debug_register;
4935 uint32_t *debug_registers;
4936};
4937#endif
4938
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +05304939/**
4940 * struct lfr_firmware_status - LFR status in firmware
4941 * @is_disabled: Is LFR disabled in FW
4942 * @disable_lfr_event: Disable attempt done in FW
4943 */
4944struct lfr_firmware_status {
4945 uint32_t is_disabled;
4946 struct completion disable_lfr_event;
4947};
4948
4949/**
4950 * struct rso_cmd_status - RSO Command status
4951 * @vdev_id: Vdev ID for which RSO command sent
4952 * @status: Status of RSO command sent to FW
4953 */
4954struct rso_cmd_status {
4955 uint32_t vdev_id;
4956 bool status;
4957};
4958
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004959typedef struct {
4960 uint8_t oui[WIFI_SCANNING_MAC_OUI_LENGTH];
Rajeev Kumar Sirasanagandla686abd92017-06-08 18:09:01 +05304961 uint32_t vdev_id;
4962 bool enb_probe_req_sno_randomization;
Rajeev Kumar Sirasanagandlaaec0b082017-06-21 11:59:41 +05304963 struct probe_req_whitelist_attr ie_whitelist;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004964} tSirScanMacOui, *tpSirScanMacOui;
4965
4966enum {
4967 SIR_AP_RX_DATA_OFFLOAD = 0x00,
4968 SIR_STA_RX_DATA_OFFLOAD = 0x01,
4969};
4970
4971struct sir_ipa_offload_enable_disable {
4972 uint32_t offload_type;
4973 uint32_t vdev_id;
4974 uint32_t enable;
4975};
4976
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07004977/**
Naveen Rawata410c5a2016-09-19 14:22:33 -07004978 * struct sir_set_vdev_ies_per_band
4979 * @msg_type: message type
4980 * @len: message length
4981 * @vdev_id: vdev id
4982 *
4983 * Message wrapper structure for eWNI_SME_SET_VDEV_IES_PER_BAND.
4984 */
4985struct sir_set_vdev_ies_per_band {
4986 uint16_t msg_type;
4987 uint16_t len;
4988 uint32_t vdev_id;
4989};
4990
4991/**
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -07004992 * struct sir_set_ht_vht_cfg - ht, vht IE config
4993 * @msg_type: message type
4994 * @len: message length
4995 * @pdev_id: pdev id
4996 * @nss: Nss value
4997 * @dot11mode: Dot11 mode.
4998 *
4999 * Message wrapper structure for set HT/VHT IE req.
5000 */
5001struct sir_set_ht_vht_cfg {
5002 uint16_t msg_type;
5003 uint16_t len;
5004 uint32_t pdev_id;
5005 uint32_t nss;
5006 uint32_t dot11mode;
5007};
5008
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005009/*---------------------------------------------------------------------------
5010 WLAN_HAL_LL_NOTIFY_STATS
5011 ---------------------------------------------------------------------------*/
5012
5013/******************************LINK LAYER Statistics**********************/
5014
5015typedef int tSirWifiRadio;
5016typedef int tSirWifiChannel;
5017typedef int tSirwifiTxRate;
5018
5019/* channel operating width */
5020typedef enum {
5021 WIFI_CHAN_WIDTH_20 = 0,
5022 WIFI_CHAN_WIDTH_40 = 1,
5023 WIFI_CHAN_WIDTH_80 = 2,
5024 WIFI_CHAN_WIDTH_160 = 3,
5025 WIFI_CHAN_WIDTH_80P80 = 4,
5026 WIFI_CHAN_WIDTH_5 = 5,
5027 WIFI_CHAN_WIDTH_10 = 6,
5028} tSirWifiChannelWidth;
5029
5030typedef enum {
5031 WIFI_DISCONNECTED = 0,
5032 WIFI_AUTHENTICATING = 1,
5033 WIFI_ASSOCIATING = 2,
5034 WIFI_ASSOCIATED = 3,
5035 WIFI_EAPOL_STARTED = 4, /* if done by firmware/driver */
5036 WIFI_EAPOL_COMPLETED = 5, /* if done by firmware/driver */
5037} tSirWifiConnectionState;
5038
5039typedef enum {
5040 WIFI_ROAMING_IDLE = 0,
5041 WIFI_ROAMING_ACTIVE = 1,
5042} tSirWifiRoamState;
5043
5044typedef enum {
5045 WIFI_INTERFACE_STA = 0,
5046 WIFI_INTERFACE_SOFTAP = 1,
5047 WIFI_INTERFACE_IBSS = 2,
5048 WIFI_INTERFACE_P2P_CLIENT = 3,
5049 WIFI_INTERFACE_P2P_GO = 4,
5050 WIFI_INTERFACE_NAN = 5,
5051 WIFI_INTERFACE_MESH = 6,
Deepak Dhamdherec9acc442016-05-26 02:12:58 -07005052 WIFI_INTERFACE_NDI = 7,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005053} tSirWifiInterfaceMode;
5054
5055/* set for QOS association */
5056#define WIFI_CAPABILITY_QOS 0x00000001
5057/* set for protected assoc (802.11 beacon frame control protected bit set) */
5058#define WIFI_CAPABILITY_PROTECTED 0x00000002
5059/* set if 802.11 Extended Capabilities element interworking bit is set */
5060#define WIFI_CAPABILITY_INTERWORKING 0x00000004
5061/* set for HS20 association */
5062#define WIFI_CAPABILITY_HS20 0x00000008
5063/* set is 802.11 Extended Capabilities element UTF-8 SSID bit is set */
5064#define WIFI_CAPABILITY_SSID_UTF8 0x00000010
5065/* set is 802.11 Country Element is present */
5066#define WIFI_CAPABILITY_COUNTRY 0x00000020
5067
5068typedef struct {
5069 /* tSirWifiInterfaceMode */
5070 /* interface mode */
5071 uint8_t mode;
5072 /* interface mac address (self) */
Anurag Chouhan6d760662016-02-20 16:05:43 +05305073 struct qdf_mac_addr macAddr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005074 /* tSirWifiConnectionState */
5075 /* connection state (valid for STA, CLI only) */
5076 uint8_t state;
5077 /* tSirWifiRoamState */
5078 /* roaming state */
5079 uint32_t roaming;
5080 /* WIFI_CAPABILITY_XXX (self) */
5081 uint32_t capabilities;
5082 /* null terminated SSID */
5083 uint8_t ssid[33];
5084 /* bssid */
Anurag Chouhan6d760662016-02-20 16:05:43 +05305085 struct qdf_mac_addr bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005086 /* country string advertised by AP */
5087 uint8_t apCountryStr[WNI_CFG_COUNTRY_CODE_LEN];
5088 /* country string for this association */
5089 uint8_t countryStr[WNI_CFG_COUNTRY_CODE_LEN];
5090} tSirWifiInterfaceInfo, *tpSirWifiInterfaceInfo;
5091
5092/* channel information */
5093typedef struct {
5094 /* channel width (20, 40, 80, 80+80, 160) */
5095 tSirWifiChannelWidth width;
5096 /* primary 20 MHz channel */
5097 tSirWifiChannel centerFreq;
5098 /* center frequency (MHz) first segment */
5099 tSirWifiChannel centerFreq0;
5100 /* center frequency (MHz) second segment */
5101 tSirWifiChannel centerFreq1;
5102} tSirWifiChannelInfo, *tpSirWifiChannelInfo;
5103
5104/* wifi rate info */
5105typedef struct {
5106 /* 0: OFDM, 1:CCK, 2:HT 3:VHT 4..7 reserved */
5107 uint32_t preamble:3;
5108 /* 0:1x1, 1:2x2, 3:3x3, 4:4x4 */
5109 uint32_t nss:2;
5110 /* 0:20MHz, 1:40Mhz, 2:80Mhz, 3:160Mhz */
5111 uint32_t bw:3;
5112 /* OFDM/CCK rate code would be as per ieee std in units of 0.5mbps */
5113 /* HT/VHT it would be mcs index */
5114 uint32_t rateMcsIdx:8;
5115 /* reserved */
5116 uint32_t reserved:16;
5117 /* units of 100 Kbps */
5118 uint32_t bitrate;
5119} tSirWifiRate, *tpSirWifiRate;
5120
5121/* channel statistics */
5122typedef struct {
5123 /* channel */
5124 tSirWifiChannelInfo channel;
5125 /* msecs the radio is awake (32 bits number accruing over time) */
5126 uint32_t onTime;
5127 /* msecs the CCA register is busy (32 bits number accruing over time) */
5128 uint32_t ccaBusyTime;
5129} tSirWifiChannelStats, *tpSirWifiChannelStats;
5130
Srinivas Girigowda458f2282016-10-25 11:27:52 -07005131#define MAX_TPC_LEVELS 64
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005132/* radio statistics */
5133typedef struct {
5134 /* wifi radio (if multiple radio supported) */
5135 tSirWifiRadio radio;
5136 /* msecs the radio is awake (32 bits number accruing over time) */
5137 uint32_t onTime;
5138 /* msecs the radio is transmitting
5139 * (32 bits number accruing over time)
5140 */
5141 uint32_t txTime;
5142 /* msecs the radio is in active receive
5143 *(32 bits number accruing over time)
5144 */
5145 uint32_t rxTime;
5146 /* msecs the radio is awake due to all scan
5147 * (32 bits number accruing over time)
5148 */
5149 uint32_t onTimeScan;
5150 /* msecs the radio is awake due to NAN
5151 * (32 bits number accruing over time)
5152 */
5153 uint32_t onTimeNbd;
5154 /* msecs the radio is awake due to Gscan
5155 * (32 bits number accruing over time)
5156 */
5157 uint32_t onTimeGscan;
5158 /* msecs the radio is awake due to roam?scan
5159 * (32 bits number accruing over time)
5160 */
5161 uint32_t onTimeRoamScan;
5162 /* msecs the radio is awake due to PNO scan
5163 * (32 bits number accruing over time)
5164 */
5165 uint32_t onTimePnoScan;
5166 /* msecs the radio is awake due to HS2.0 scans and GAS exchange
5167 * (32 bits number accruing over time)
5168 */
5169 uint32_t onTimeHs20;
Srinivas Girigowdaad874a82016-10-25 14:08:00 -07005170
5171 /* tx time (in milliseconds) per TPC level (0.5 dBm) */
5172 uint32_t total_num_tx_power_levels;
5173 uint32_t *tx_time_per_power_level;
5174
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005175 /* number of channels */
5176 uint32_t numChannels;
Srinivas Girigowda458f2282016-10-25 11:27:52 -07005177
5178 /* tx time (in milliseconds) per TPC level (0.5 dBm) */
5179 uint32_t tx_time_per_tpc[MAX_TPC_LEVELS];
5180
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08005181 uint32_t on_time_host_scan;
5182 uint32_t on_time_lpi_scan;
5183
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005184 /* channel statistics tSirWifiChannelStats */
Srinivas Girigowda57b450e2016-10-27 21:00:46 -07005185 tSirWifiChannelStats *channels;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005186} tSirWifiRadioStat, *tpSirWifiRadioStat;
5187
5188/* per rate statistics */
5189typedef struct {
5190 /* rate information */
5191 tSirWifiRate rate;
5192 /* number of successfully transmitted data pkts (ACK rcvd) */
5193 uint32_t txMpdu;
5194 /* number of received data pkts */
5195 uint32_t rxMpdu;
5196 /* number of data packet losses (no ACK) */
5197 uint32_t mpduLost;
5198 /* total number of data pkt retries * */
5199 uint32_t retries;
5200 /* number of short data pkt retries */
5201 uint32_t retriesShort;
5202 /* number of long data pkt retries */
5203 uint32_t retriesLong;
5204} tSirWifiRateStat, *tpSirWifiRateStat;
5205
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005206/* wifi peer type */
5207typedef enum {
5208 WIFI_PEER_STA,
5209 WIFI_PEER_AP,
5210 WIFI_PEER_P2P_GO,
5211 WIFI_PEER_P2P_CLIENT,
5212 WIFI_PEER_NAN,
5213 WIFI_PEER_TDLS,
5214 WIFI_PEER_INVALID,
5215} tSirWifiPeerType;
5216
5217/* per peer statistics */
5218typedef struct {
5219 /* peer type (AP, TDLS, GO etc.) */
Dustin Brown877a5a92016-11-17 13:56:52 -08005220 enum wmi_peer_type type;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005221 /* mac address */
Anurag Chouhan6d760662016-02-20 16:05:43 +05305222 struct qdf_mac_addr peerMacAddress;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005223 /* peer WIFI_CAPABILITY_XXX */
5224 uint32_t capabilities;
Zhang Qiana6e9c102016-12-22 16:47:24 +08005225 union {
5226 /* peer power saving mode */
5227 uint32_t power_saving;
5228 /* number of rates */
5229 uint32_t numRate;
5230 };
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005231 /* per rate statistics, number of entries = num_rate */
5232 tSirWifiRateStat rateStats[0];
5233} tSirWifiPeerInfo, *tpSirWifiPeerInfo;
5234
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08005235/**
5236 * struct wifi_iface_offload_stat - Wifi Iface offload statistics
5237 * @type: type of offload stats (enum wmi_offload_stats_type)
5238 * @rx_count: Number of (MSDUs) frames Received
5239 * @drp_count: Number of frames Dropped
5240 * @fwd_count:
5241 * Number of frames for which FW Responded (Valid for ARP and NS only).(or)
5242 * Number of frames forwarded to Host (Valid for stats type except ARP and NS).
5243 */
5244struct wifi_iface_offload_stat {
5245 wmi_offload_stats_type type;
5246 uint32_t rx_count;
5247 uint32_t drp_count;
5248 uint32_t fwd_count;
5249};
5250
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005251/* per access category statistics */
5252typedef struct {
5253 /* tSirWifiTrafficAc */
5254 /* access category (VI, VO, BE, BK) */
5255 uint32_t ac;
5256 /* number of successfully transmitted unicast data pkts (ACK rcvd) */
5257 uint32_t txMpdu;
5258 /* number of received unicast mpdus */
5259 uint32_t rxMpdu;
5260 /* number of succesfully transmitted multicast data packets */
5261 /* STA case: implies ACK received from AP for the unicast */
5262 /* packet in which mcast pkt was sent */
5263 uint32_t txMcast;
5264 /* number of received multicast data packets */
5265 uint32_t rxMcast;
5266 /* number of received unicast a-mpdus */
5267 uint32_t rxAmpdu;
5268 /* number of transmitted unicast a-mpdus */
5269 uint32_t txAmpdu;
5270 /* number of data pkt losses (no ACK) */
5271 uint32_t mpduLost;
5272 /* total number of data pkt retries */
5273 uint32_t retries;
5274 /* number of short data pkt retries */
5275 uint32_t retriesShort;
5276 /* number of long data pkt retries */
5277 uint32_t retriesLong;
5278 /* data pkt min contention time (usecs) */
5279 uint32_t contentionTimeMin;
5280 /* data pkt max contention time (usecs) */
5281 uint32_t contentionTimeMax;
5282 /* data pkt avg contention time (usecs) */
5283 uint32_t contentionTimeAvg;
5284 /* num of data pkts used for contention statistics */
5285 uint32_t contentionNumSamples;
5286} tSirWifiWmmAcStat, *tpSirWifiWmmAcStat;
5287
5288/* Interface statistics - corresponding to 2nd most
5289 * LSB in wifi statistics bitmap for getting statistics
5290 */
5291typedef struct {
5292 /* current state of the interface */
5293 tSirWifiInterfaceInfo info;
5294 /* access point beacon received count from connected AP */
5295 uint32_t beaconRx;
5296 /* access point mgmt frames received count from */
5297 /* connected AP (including Beacon) */
5298 uint32_t mgmtRx;
5299 /* action frames received count */
5300 uint32_t mgmtActionRx;
5301 /* action frames transmit count */
5302 uint32_t mgmtActionTx;
5303 /* access Point Beacon and Management frames RSSI (averaged) */
5304 uint32_t rssiMgmt;
5305 /* access Point Data Frames RSSI (averaged) from connected AP */
5306 uint32_t rssiData;
5307 /* access Point ACK RSSI (averaged) from connected AP */
5308 uint32_t rssiAck;
5309 /* number of peers */
5310 uint32_t num_peers;
5311 /*
5312 * Indicates how many peer_stats events will be sent depending on the
5313 * num_peers.
5314 */
5315 uint32_t num_peer_events;
5316 /* number of ac */
5317 uint32_t num_ac;
5318 /* Roaming Stat */
5319 uint32_t roam_state;
5320 /*
5321 * Average Beacon spread offset is the averaged time delay between TBTT
5322 * and beacon TSF. Upper 32 bits of averaged 64 bit beacon spread offset
5323 */
5324 uint32_t avg_bcn_spread_offset_high;
5325 /* Lower 32 bits of averaged 64 bit beacon spread offset */
5326 uint32_t avg_bcn_spread_offset_low;
5327 /*
5328 * Takes value of 1 if AP leaks packets after sending an ACK for PM=1
5329 * otherwise 0
5330 */
5331 uint32_t is_leaky_ap;
5332 /*
5333 * Average number of frames received from AP after receiving the ACK
5334 * for a frame with PM = 1
5335 */
5336 uint32_t avg_rx_frms_leaked;
5337 /*
5338 * Rx leak watch window currently in force to minimize data loss
5339 * because of leaky AP. Rx leak window is the
5340 * time driver waits before shutting down the radio or switching
5341 * the channel and after receiving an ACK for
5342 * a data frame with PM bit set.
5343 */
5344 uint32_t rx_leak_window;
gaolezb432ed92017-03-16 18:40:04 +08005345 uint32_t rts_succ_cnt;
5346 uint32_t rts_fail_cnt;
5347 uint32_t ppdu_succ_cnt;
5348 uint32_t ppdu_fail_cnt;
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08005349
5350 uint32_t tx_rts_succ_cnt;
5351 uint32_t tx_rts_fail_cnt;
5352 uint32_t tx_ppdu_succ_cnt;
5353 uint32_t tx_ppdu_fail_cnt;
5354 uint32_t connected_duration;
5355 uint32_t disconnected_duration;
5356 uint32_t rtt_ranging_duration;
5357 uint32_t rtt_responder_duration;
5358 uint32_t num_probes_tx;
5359 uint32_t num_beacon_miss;
5360
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005361 /* per ac data packet statistics */
5362 tSirWifiWmmAcStat AccessclassStats[WIFI_AC_MAX];
Krishna Kumaar Natarajan7bff29b2017-03-08 16:05:05 -08005363
5364 uint32_t num_offload_stats;
5365 struct wifi_iface_offload_stat offload_stat[WMI_OFFLOAD_STATS_TYPE_MAX];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005366} tSirWifiIfaceStat, *tpSirWifiIfaceStat;
5367
5368/* Peer statistics - corresponding to 3rd most LSB in
5369 * wifi statistics bitmap for getting statistics
5370 */
5371typedef struct {
5372 /* number of peers */
5373 uint32_t numPeers;
5374 /* per peer statistics */
5375 tSirWifiPeerInfo peerInfo[0];
5376} tSirWifiPeerStat, *tpSirWifiPeerStat;
5377
5378/* wifi statistics bitmap for getting statistics */
5379#define WMI_LINK_STATS_RADIO 0x00000001
5380#define WMI_LINK_STATS_IFACE 0x00000002
5381#define WMI_LINK_STATS_ALL_PEER 0x00000004
5382#define WMI_LINK_STATS_PER_PEER 0x00000008
5383
5384/* wifi statistics bitmap for clearing statistics */
5385/* all radio statistics */
5386#define WIFI_STATS_RADIO 0x00000001
5387/* cca_busy_time (within radio statistics) */
5388#define WIFI_STATS_RADIO_CCA 0x00000002
5389/* all channel statistics (within radio statistics) */
5390#define WIFI_STATS_RADIO_CHANNELS 0x00000004
5391/* all scan statistics (within radio statistics) */
5392#define WIFI_STATS_RADIO_SCAN 0x00000008
5393/* all interface statistics */
5394#define WIFI_STATS_IFACE 0x00000010
5395/* all tx rate statistics (within interface statistics) */
5396#define WIFI_STATS_IFACE_TXRATE 0x00000020
5397/* all ac statistics (within interface statistics) */
5398#define WIFI_STATS_IFACE_AC 0x00000040
5399/* all contention (min, max, avg) statistics (within ac statistics) */
5400#define WIFI_STATS_IFACE_CONTENTION 0x00000080
Mukul Sharma491021c2016-09-29 21:39:19 +05305401/* All peer stats on this interface */
5402#define WIFI_STATS_IFACE_ALL_PEER 0x00000100
5403/* Clear particular peer stats depending on the peer_mac */
5404#define WIFI_STATS_IFACE_PER_PEER 0x00000200
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005405
Zhang Qiana6e9c102016-12-22 16:47:24 +08005406/**
5407 * struct sir_wifi_iface_tx_fail - TX failure event
5408 * @tid: TX TID
5409 * @msdu_num: TX MSDU failed counter
5410 * @status: TX status from HTT message.
5411 * Only failure status will be involved.
5412 */
5413struct sir_wifi_iface_tx_fail {
5414 uint8_t tid;
5415 uint16_t msdu_num;
5416 enum htt_tx_status status;
5417};
5418
Zhang Qian73c348a2017-03-13 16:15:55 +08005419/**
5420 * struct sir_wifi_chan_cca_stats - channal CCA stats
5421 * @vdev_id: vdev ID
5422 * @idle_time: percentage of idle time, no TX, no RX, no interference
5423 * @tx_time: percentage of time transmitting packets
5424 * @rx_in_bss_time: percentage of time receiving packets in current BSS
5425 * @rx_out_bss_time: percentage of time receiving packets not in current BSS
5426 * @rx_busy_time: percentage of time interference detected
5427 * @rx_in_bad_cond_time: percentage of time receiving packets with errors
5428 * or packets flagged as retransmission or seqnum discontinued.
5429 * @tx_in_bad_cond_time: percentage of time the device transmitted packets
5430 * that haven't been ACKed.
5431 * @wlan_not_avail_time: percentage of time the chip is unable to
5432 * work in normal conditions.
5433 */
5434struct sir_wifi_chan_cca_stats {
5435 uint32_t vdev_id;
5436 uint32_t idle_time;
5437 uint32_t tx_time;
5438 uint32_t rx_in_bss_time;
5439 uint32_t rx_out_bss_time;
5440 uint32_t rx_busy_time;
5441 uint32_t rx_in_bad_cond_time;
5442 uint32_t tx_in_bad_cond_time;
5443 uint32_t wlan_not_avail_time;
5444};
5445
5446#define WIFI_MAX_CHAINS 8
5447
5448/**
5449 * struct sir_wifi_peer_signal_stats - peer signal stats
5450 * @vdev_id: vdev ID
5451 * @peer_id: peer ID
5452 * @per_ant_snr: per antenna SNR
5453 * @nf: peer background noise
Zhang Qian303ebe92017-05-18 13:59:07 +08005454 * @per_ant_rx_mpdus: MPDUs received per antenna
5455 * @per_ant_tx_mpdus: MPDUs transferred per antenna
5456 * @num_chain: valid chain count
Zhang Qian73c348a2017-03-13 16:15:55 +08005457 */
5458struct sir_wifi_peer_signal_stats {
5459 uint32_t vdev_id;
5460 uint32_t peer_id;
5461
5462 /* per antenna SNR in current bss */
5463 int32_t per_ant_snr[WIFI_MAX_CHAINS];
5464
5465 /* Background noise */
5466 int32_t nf[WIFI_MAX_CHAINS];
Zhang Qian303ebe92017-05-18 13:59:07 +08005467
5468 int32_t per_ant_rx_mpdus[WIFI_MAX_CHAINS];
5469 int32_t per_ant_tx_mpdus[WIFI_MAX_CHAINS];
5470 int32_t num_chain;
Zhang Qian73c348a2017-03-13 16:15:55 +08005471};
5472
5473#define WIFI_VDEV_NUM 4
5474#define WFIF_MCS_NUM 10
5475#define WIFI_AGGR_NUM 8
5476#define WIFI_DELAY_SIZE 11
5477
5478/**
5479 * struct sir_wifi_tx - per AC tx stats
5480 * @msdus: number of totoal MSDUs on MAC layer in the period
5481 * @mpdus: number of totoal MPDUs on MAC layer in the period
5482 * @ppdus: number of totoal PPDUs on PHY layer in the period
5483 * @bytes: bytes of tx data on MAC layer in the period
5484 * @drops: number of TX packets cancelled due to any reason in the period,
5485 * such as WMM limitation/bandwidth limitation/radio congestion
5486 * @drop_bytes: bytes of dropped TX packets in the period
5487 * @retries: number of unacked transmissions of MPDUs
5488 * @failed: number of packets have not been ACKed despite retried
5489 * @aggr_len: length of the MPDU aggregation size buffer
5490 * @mpdu_aggr_size: histogram of MPDU aggregation size
5491 * @success_mcs_len: length of success mcs buffer
5492 * @success_mcs: histogram of successed received MPDUs encoding rate
5493 * @fail_mcs_len: length of failed mcs buffer
5494 * @fail_mcs: histogram of failed received MPDUs encoding rate
5495 * @delay_len: length of the delay histofram buffer
5496 * @delay: histogram of delays on MAC layer
5497 */
5498struct sir_wifi_tx {
5499 uint32_t msdus;
5500 uint32_t mpdus;
5501 uint32_t ppdus;
5502 uint32_t bytes;
5503 uint32_t drops;
5504 uint32_t drop_bytes;
5505 uint32_t retries;
5506 uint32_t failed;
5507 uint32_t aggr_len;
5508 uint32_t *mpdu_aggr_size;
5509 uint32_t success_mcs_len;
5510 uint32_t *success_mcs;
5511 uint32_t fail_mcs_len;
5512 uint32_t *fail_mcs;
5513 uint32_t delay_len;
5514 uint32_t *delay;
5515};
5516
5517/**
5518 * struct sir_wifi_rx - per AC rx stats
5519 * @mpdus: number of RX packets on MAC layer
5520 * @bytes: bytes of RX packets on MAC layer
5521 * @ppdus: number of RX packets on PHY layer
5522 * @ppdu_bytes: bytes of RX packets on PHY layer
5523 * @mpdu_lost: number of discontinuity in seqnum
5524 * @mpdu_retry: number of RX packets flagged as retransmissions
5525 * @mpdu_dup: number of RX packets identified as duplicates
5526 * @mpdu_discard: number of RX packets discarded
5527 * @aggr_len: length of MPDU aggregation histogram buffer
5528 * @mpdu_aggr: histogram of MPDU aggregation size
5529 * @mcs_len: length of mcs histogram buffer
5530 * @mcs: histogram of encoding rate.
5531 */
5532struct sir_wifi_rx {
5533 uint32_t mpdus;
5534 uint32_t bytes;
5535 uint32_t ppdus;
5536 uint32_t ppdu_bytes;
5537 uint32_t mpdu_lost;
5538 uint32_t mpdu_retry;
5539 uint32_t mpdu_dup;
5540 uint32_t mpdu_discard;
5541 uint32_t aggr_len;
5542 uint32_t *mpdu_aggr;
5543 uint32_t mcs_len;
5544 uint32_t *mcs;
5545};
5546
5547/**
5548 * struct sir_wifi_ll_ext_wmm_ac_stats - stats for WMM AC
5549 * @type: WMM AC type
5550 * @tx_stats: pointer to TX stats
5551 * @rx_stats: pointer to RX stats
5552 */
5553struct sir_wifi_ll_ext_wmm_ac_stats {
5554 uint32_t type;
5555 struct sir_wifi_tx *tx_stats;
5556 struct sir_wifi_rx *rx_stats;
5557};
5558
5559#define WIFI_INVALID_PEER_ID (-1)
5560#define WIFI_INVALID_VDEV_ID (-1)
5561#define WIFI_MAX_AC (4)
5562
5563/**
5564 * struct sir_wifi_ll_ext_peer_stats - per peer stats
5565 * @peer_id: peer ID
5566 * @vdev_id: VDEV ID
5567 * mac_address: MAC address
5568 * @sta_ps_inds: how many times STAs go to sleep
5569 * @sta_ps_durs: total sleep time of STAs (units in ms)
5570 * @rx_probe_reqs: number of probe requests received
5571 * @rx_oth_mgmts: number of other management frames received,
5572 * not including probe requests
5573 * @peer_signal_stat: signal stats
5574 * @ac_stats: WMM BE/BK/VI/VO stats
5575 */
5576struct sir_wifi_ll_ext_peer_stats {
5577 uint32_t peer_id;
5578 uint32_t vdev_id;
5579 tSirMacAddr mac_address;
5580 uint32_t sta_ps_inds;
5581 uint32_t sta_ps_durs;
5582 uint32_t rx_probe_reqs;
5583 uint32_t rx_oth_mgmts;
5584 struct sir_wifi_peer_signal_stats peer_signal_stats;
5585 struct sir_wifi_ll_ext_wmm_ac_stats ac_stats[WIFI_MAX_AC];
5586};
5587
5588/**
5589 * struct sir_wifi_ll_ext_stats - link layer stats report
5590 * @trigger_cond_id: Indicate what triggered this event.
5591 * 1: timeout. 2: threshold
5592 * @cca_chgd_bitmap: Bitmap to indicate changed channel CCA stats
5593 * which exceeded the thresholds
5594 * @sig_chgd_bitmap: Bitmap to indicate changed peer signal stats
5595 * which exceeded the thresholds
5596 * @tx_chgd_bitmap: Bitmap to indicate changed TX counters
5597 * which exceeded the thresholds
5598 * @rx_chgd_bitmap: Bitmap to indicate changed RX counters
5599 * which exceeded the thresholds
5600 * @chan_cca_stats: channel CCA stats
5601 * @peer_signal_stats: peer signal stats
5602 * @tx_mpdu_aggr_array_len: length of TX MPDU aggregation buffer
5603 * @tx_succ_mcs_array_len: length of mcs buffer for ACKed MPDUs
5604 * @tx_fail_mcs_array_len: length of mcs buffer for no-ACKed MPDUs
5605 * @tx_delay_array_len: length of delay stats buffer
5606 * @rx_mpdu_aggr_array_len: length of RX MPDU aggregation buffer
5607 * @rx_mcs_array_len: length of RX mcs stats buffer
5608 * @peer_stats: peer stats
5609 * @cca: physical channel CCA stats
5610 * @stats: pointer to stats data buffer.
5611 *
5612 * Structure of the whole statictics is like this:
5613 * ---------------------------------
5614 * | trigger_cond_i |
5615 * +-------------------------------+
5616 * | cca_chgd_bitmap |
5617 * +-------------------------------+
5618 * | sig_chgd_bitmap |
5619 * +-------------------------------+
5620 * | tx_chgd_bitmap |
5621 * +-------------------------------+
5622 * | rx_chgd_bitmap |
5623 * +-------------------------------+
5624 * | peer_num |
5625 * +-------------------------------+
5626 * | channel_num |
5627 * +-------------------------------+
5628 * | tx_mpdu_aggr_array_len |
5629 * +-------------------------------+
5630 * | tx_succ_mcs_array_len |
5631 * +-------------------------------+
5632 * | tx_fail_mcs_array_len |
5633 * +-------------------------------+
5634 * | tx_delay_array_len |
5635 * +-------------------------------+
5636 * | rx_mpdu_aggr_array_len |
5637 * +-------------------------------+
5638 * | rx_mcs_array_len |
5639 * +-------------------------------+
5640 * | pointer to CCA stats |
5641 * +-------------------------------+
5642 * | pointer to peer stats |
5643 * +-------------------------------+
5644 * | CCA stats |
5645 * +-------------------------------+
5646 * | peer_stats |----+
5647 * +-------------------------------+ |
5648 * | per peer signals stats |<---+
5649 * | peer0 ~ peern | |
5650 * +-------------------------------+ |
5651 * | TX aggr/mcs parameters array | |
5652 * | Length of this buffer is | |
5653 * | configurable for user layer. |<-+ |
5654 * +-------------------------------+ | |
5655 * | per peer tx stats |--+ |
5656 * | BE | <--+
5657 * | BK | |
5658 * | VI | |
5659 * | VO | |
5660 * +-------------------------------+ |
5661 * | TX aggr/mcs parameters array | |
5662 * | Length of this buffer is | |
5663 * | configurable for user layer. |<-+ |
5664 * +-------------------------------+ | |
5665 * | peer peer rx stats |--+ |
5666 * | BE | <--+
5667 * | BE |
5668 * | BK |
5669 * | VI |
5670 * | VO |
5671 * ---------------------------------
5672 */
5673struct sir_wifi_ll_ext_stats {
5674 uint32_t trigger_cond_id;
5675 uint32_t cca_chgd_bitmap;
5676 uint32_t sig_chgd_bitmap;
5677 uint32_t tx_chgd_bitmap;
5678 uint32_t rx_chgd_bitmap;
5679 uint8_t peer_num;
5680 uint8_t channel_num;
5681 uint32_t tx_mpdu_aggr_array_len;
5682 uint32_t tx_succ_mcs_array_len;
5683 uint32_t tx_fail_mcs_array_len;
5684 uint32_t tx_delay_array_len;
5685 uint32_t rx_mpdu_aggr_array_len;
5686 uint32_t rx_mcs_array_len;
5687 struct sir_wifi_ll_ext_peer_stats *peer_stats;
5688 struct sir_wifi_chan_cca_stats *cca;
5689 uint8_t stats[];
5690};
5691
5692/**
5693 * struct sir_channel_cca_threshold - threshold for channel CCA
5694 * @idle_time: idle time, no TX, no RX, no interference
5695 * @tx_time: time transmitting packets
5696 * @rx_in_bss_time: time receiving packets in current BSSs
5697 * @rx_out_bss_time: time receiving packets not in current BSSs
5698 * @rx_busy_time: time interference detected
5699 * @rx_in_bad_cond_time: receiving packets with errors
5700 * @tx_in_bad_cond_time: time transmitted packets not been ACKed
5701 * @wlan_not_avail_time: wlan card cannot work
5702 */
5703struct sir_channel_cca_threshold {
5704 uint32_t idle_time;
5705 uint32_t tx_time;
5706 uint32_t rx_in_bss_time;
5707 uint32_t rx_out_bss_time;
5708 uint32_t rx_busy_time;
5709 uint32_t rx_in_bad_cond_time;
5710 uint32_t tx_in_bad_cond_time;
5711 uint32_t wlan_not_avail_time;
5712};
5713
5714/**
5715 * struct sir_signal_threshold - threshold for per peer sigbal
5716 * @snr: signal to noise rate
5717 * @nf: noise floor
5718 */
5719struct sir_signal_threshold {
5720 uint32_t snr;
5721 uint32_t nf;
5722};
5723
5724/**
5725 * struct sir_tx_threshold - threshold for TX
5726 * @msdu: TX MSDUs on MAC layer
5727 * @mpdu: TX MPDUs on MAC layer
5728 * @ppdu: TX PPDUs on MAC layer
5729 * @bytes: TX bytes on MAC layer
5730 * @msdu_drop: drooped MSDUs
5731 * @byte_drop: dropped Bytes
5732 * @mpdu_retry: MPDU not acked
5733 * @ppdu_fail: PPDUs which received no block ack
5734 * @aggregation: aggregation size
5735 * @succ_mcs: histogram of encoding rate for acked PPDUs
5736 * @fail_mcs: histogram of encoding rate for no-acked PPDUs
5737 */
5738struct sir_tx_threshold {
5739 uint32_t msdu;
5740 uint32_t mpdu;
5741 uint32_t ppdu;
5742 uint32_t bytes;
5743 uint32_t msdu_drop;
5744 uint32_t byte_drop;
5745 uint32_t mpdu_retry;
5746 uint32_t mpdu_fail;
5747 uint32_t ppdu_fail;
5748 uint32_t aggregation;
5749 uint32_t succ_mcs;
5750 uint32_t fail_mcs;
5751 uint32_t delay;
5752};
5753
5754/**
5755 * struct sir_rx_threshold - threshold for RX
5756 * @mpdu: RX MPDUs on MAC layer
5757 * @bytes: RX bytes on MAC layer
5758 * @ppdu: RX PPDU on PHY layer
5759 * @ppdu_bytes: RX bytes on PHY layer
5760 * @disorder: discontinuity in seqnum
5761 * @mpdu_retry: MPDUs flagged as retry
5762 * @mpdu_dup: MPDUs identified as duplicated
5763 * @aggregation: aggregation size
5764 * @mcs: histogram of encoding rate for PPDUs
5765 * @ps_inds: power save indication
5766 * @ps_durs: total time in power save
5767 * @probe_reqs: probe request received
5768 * @other_mgmt: other MGMT frames received
5769 */
5770struct sir_rx_threshold {
5771 uint32_t mpdu;
5772 uint32_t bytes;
5773 uint32_t ppdu;
5774 uint32_t ppdu_bytes;
5775 uint32_t disorder;
5776 uint32_t mpdu_lost;
5777 uint32_t mpdu_retry;
5778 uint32_t mpdu_dup;
5779 uint32_t mpdu_discard;
5780 uint32_t aggregation;
5781 uint32_t mcs;
5782 uint32_t ps_inds;
5783 uint32_t ps_durs;
5784 uint32_t probe_reqs;
5785 uint32_t other_mgmt;
5786};
5787
5788/**
5789 * struct sir_wifi_ll_ext_stats_threshold - Threshold for stats update
5790 * @period: MAC counter indication period (unit in ms)
5791 * @enable: if threshold mechnism is enabled or disabled
5792 * @enable_bitmap: whether dedicated threshold is enabed.
5793 * Every MAC counter has a dedicated threshold. If the dedicated
5794 * threshold is not set in the bitmap, global threshold will take
5795 * effect.
5796 * @global: whether clobal threshold is enabled.
5797 * When both global and dedicated threshold are diabled, MAC counter
5798 * will indicate stats periodically.
5799 * @global_threshold: global threshold value
5800 * @cca_bitmap: bitmap for CCA.
5801 * Bit0: idle time
5802 * Bit1: tx time
5803 * Bit2: RX in BSS
5804 * Bit3: RX out of BSS
5805 * Bit4: medium busy
5806 * Bit5: RX bad
5807 * Bit6: TX bad
5808 * Bit7: WLAN card not available
5809 * @signal_bitmap:
5810 * Bit0: Per channel SNR counter
5811 * Bit1: Per channel noise floor counter
5812 * @tx_bitmap: bitmap for TX counters
5813 * Bit0: TX counter unit in MSDU
5814 * Bit1: TX counter unit in MPDU
5815 * Bit2: TX counter unit in PPDU
5816 * Bit3: TX counter unit in byte
5817 * Bit4: Dropped MSDUs
5818 * Bit5: Dropped Bytes
5819 * Bit6: MPDU retry counter
5820 * Bit7: MPDU failure counter
5821 * Bit8: PPDU failure counter
5822 * Bit9: MPDU aggregation counter
5823 * Bit10: MCS counter for ACKed MPDUs
5824 * Bit11: MCS counter for Failed MPDUs
5825 * Bit12: TX Delay counter
5826 * @rx_bitmap:bitmap for RX counters
5827 * Bit0: MAC RX counter unit in MPDU
5828 * Bit1: MAC RX counter unit in byte
5829 * Bit2: PHY RX counter unit in PPDU
5830 * Bit3: PHY RX counter unit in byte
5831 * Bit4: Disorder counter
5832 * Bit5: Retry counter
5833 * Bit6: Duplication counter
5834 * Bit7: Discard counter
5835 * Bit8: MPDU aggregation size counter
5836 * Bit9: MCS counter
5837 * Bit10: Peer STA power state change (wake to sleep) counter
5838 * Bit11: Peer STA power save counter, total time in PS mode
5839 * Bit12: Probe request counter
5840 * Bit13: Other management frames counter
5841 * @cca_thresh: CCA threshold
5842 * @signal_thresh: signal threshold
5843 * @tx_thresh: TX threshold
5844 * @rx_thresh: RX threshold
5845 *
5846 * Generally, Link layer statistics is reported periodically. But if the
5847 * variation of one stats of compared to the pervious notification exceeds
5848 * a threshold, FW will report the new stats immediately.
5849 * This structure contains threshold for different counters.
5850 */
5851struct sir_ll_ext_stats_threshold {
5852 uint32_t period;
5853 uint32_t enable;
5854 uint32_t enable_bitmap;
5855 uint32_t global;
5856 uint32_t global_threshold;
5857 uint32_t cca_bitmap;
5858 uint32_t signal_bitmap;
5859 uint32_t tx_bitmap;
5860 uint32_t rx_bitmap;
5861 struct sir_channel_cca_threshold cca;
5862 struct sir_signal_threshold signal;
5863 struct sir_tx_threshold tx;
5864 struct sir_rx_threshold rx;
5865};
5866
5867#define LL_STATS_MIN_PERIOD 10
5868#define LL_STATS_INVALID_PERIOD 0xFFFFFFFF
5869
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005870typedef struct {
5871 uint32_t paramId;
5872 uint8_t ifaceId;
5873 uint32_t rspId;
5874 uint32_t moreResultToFollow;
Srinivas Girigowda57b450e2016-10-27 21:00:46 -07005875 uint32_t nr_received;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005876 union {
5877 uint32_t num_peers;
5878 uint32_t num_radio;
5879 };
5880
5881 uint32_t peer_event_number;
5882 /* Variable length field - Do not add anything after this */
5883 uint8_t results[0];
5884} tSirLLStatsResults, *tpSirLLStatsResults;
5885
Zhang Qiana6e9c102016-12-22 16:47:24 +08005886/* Result ID for LL stats extension */
5887#define WMI_LL_STATS_EXT_PS_CHG 0x00000100
5888#define WMI_LL_STATS_EXT_TX_FAIL 0x00000200
5889#define WMI_LL_STATS_EXT_MAC_COUNTER 0x00000400
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005890#endif /* WLAN_FEATURE_LINK_LAYER_STATS */
5891
5892typedef struct sAniGetLinkStatus {
5893 uint16_t msgType; /* message type is same as the request type */
5894 uint16_t msgLen; /* length of the entire request */
5895 uint8_t linkStatus;
5896 uint8_t sessionId;
5897} tAniGetLinkStatus, *tpAniGetLinkStatus;
5898
5899#ifdef DHCP_SERVER_OFFLOAD
5900typedef struct {
5901 uint32_t vdev_id;
5902 uint32_t dhcpSrvOffloadEnabled;
5903 uint32_t dhcpClientNum;
5904 uint32_t dhcpSrvIP;
5905} tSirDhcpSrvOffloadInfo, *tpSirDhcpSrvOffloadInfo;
5906#endif /* DHCP_SERVER_OFFLOAD */
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +05305907
5908/**
5909 * struct sir_lost_link_info - lost link information structure.
5910 *
5911 * @vdev_id: vdev_id from WMA. some modules call sessionId.
5912 * @rssi: rssi at disconnection time.
5913 *
5914 * driver uses this structure to communicate information collected at
5915 * disconnection time.
5916 */
5917struct sir_lost_link_info {
5918 uint32_t vdev_id;
5919 int32_t rssi;
5920};
5921
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08005922/* find the size of given member within a structure */
5923#ifndef member_size
5924#define member_size(type, member) (sizeof(((type *)0)->member))
5925#endif
5926
5927#define RTT_INVALID 0x00
5928#define RTT_TIMING_MEAS_CAPABILITY 0x01
5929#define RTT_FINE_TIME_MEAS_INITIATOR_CAPABILITY 0x02
5930#define RTT_FINE_TIME_MEAS_RESPONDER_CAPABILITY 0x03
5931
5932/**
5933 * enum fine_time_meas_mask - bit mask to identify device's
5934 * fine timing measurement capability
5935 * @FINE_TIME_MEAS_STA_INITIATOR - STA role, Initiator capability is supported
5936 * @FINE_TIME_MEAS_STA_RESPONDER - STA role, Responder capability is supported
5937 * @FINE_TIME_MEAS_P2PCLI_INITIATOR - P2P-CLI supports initiator capability
5938 * @FINE_TIME_MEAS_P2PCLI_RESPONDER - P2P-CLI supports responder capability
5939 * @FINE_TIME_MEAS_P2PGO_INITIATOR - P2P-GO supports initiator capability
5940 * @FINE_TIME_MEAS_P2PGO_RESPONDER - P2P-GO supports responder capability
5941 * @FINE_TIME_MEAS_SAP_INITIATOR - SAP role, Initiator capability is supported
5942 * @FINE_TIME_MEAS_SAP_RESPONDER - SAP role, Responder capability is supported
5943 */
5944enum fine_time_meas_mask {
5945 FINE_TIME_MEAS_STA_INITIATOR = (1 << (0)),
5946 FINE_TIME_MEAS_STA_RESPONDER = (1 << (1)),
5947 FINE_TIME_MEAS_P2PCLI_INITIATOR = (1 << (2)),
5948 FINE_TIME_MEAS_P2PCLI_RESPONDER = (1 << (3)),
5949 FINE_TIME_MEAS_P2PGO_INITIATOR = (1 << (4)),
5950 FINE_TIME_MEAS_P2PGO_RESPONDER = (1 << (5)),
5951 FINE_TIME_MEAS_SAP_INITIATOR = (1 << (6)),
5952 FINE_TIME_MEAS_SAP_RESPONDER = (1 << (7)),
5953};
5954
5955/* number of neighbor reports that we can handle in Neighbor Report Response */
5956#define MAX_SUPPORTED_NEIGHBOR_RPT 15
5957
5958/**
5959 * struct sir_stats_avg_factor
5960 * @vdev_id: session id
5961 * @stats_avg_factor: average factor
5962 */
5963struct sir_stats_avg_factor {
5964 uint8_t vdev_id;
5965 uint16_t stats_avg_factor;
5966};
5967
5968/**
5969 * struct sir_guard_time_request
5970 * @vdev_id: session id
5971 * @guard_time: guard time
5972 */
5973struct sir_guard_time_request {
5974 uint8_t vdev_id;
5975 uint32_t guard_time;
5976};
5977
5978/* Max number of rates allowed in Supported Rates IE */
5979#define MAX_NUM_SUPPORTED_RATES (8)
5980
5981/*
5982 * struct rssi_monitor_req - rssi monitoring
5983 * @request_id: request id
5984 * @session_id: session id
5985 * @min_rssi: minimum rssi
5986 * @max_rssi: maximum rssi
5987 * @control: flag to indicate start or stop
5988 */
5989struct rssi_monitor_req {
5990 uint32_t request_id;
5991 uint32_t session_id;
5992 int8_t min_rssi;
5993 int8_t max_rssi;
5994 bool control;
5995};
5996
5997/**
5998 * struct rssi_breach_event - rssi breached event structure
5999 * @request_id: request id
6000 * @session_id: session id
6001 * @curr_rssi: current rssi
6002 * @curr_bssid: current bssid
6003 */
6004struct rssi_breach_event {
6005 uint32_t request_id;
6006 uint32_t session_id;
6007 int8_t curr_rssi;
Anurag Chouhan6d760662016-02-20 16:05:43 +05306008 struct qdf_mac_addr curr_bssid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08006009};
6010
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05306011/**
6012 * struct chip_pwr_save_fail_detected_params - chip power save failure detected
6013 * event params
6014 * @failure_reason_code:failure reason code
6015 * @wake_lock_bitmap:bitmap for modules voting against sleep for long duration.
6016 */
6017struct chip_pwr_save_fail_detected_params {
6018 uint32_t failure_reason_code;
6019 uint32_t wake_lock_bitmap[4];
6020};
6021
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08006022#define MAX_NUM_FW_SEGMENTS 4
6023
6024/**
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05306025 * DEFAULT_SCAN_IE_ID - Identifier for the collection of IE's added
6026 * by default to the probe request
6027 */
6028#define DEFAULT_SCAN_IE_ID 256
6029
6030 /* MAX_DEFAULT_SCAN_IE_LEN - Maxmimum length of Default Scan IE's */
Selvaraj, Sridhar021ee0a2017-04-07 16:53:31 +05306031#define MAX_DEFAULT_SCAN_IE_LEN 2048
Deepak Dhamdhereb106ae52016-08-10 20:55:30 +05306032
6033 /* Extended Capabilities IE header(IE Id + IE Length) length */
6034#define EXT_CAP_IE_HDR_LEN 2
6035
6036/**
6037 * struct hdd_default_scan_ie - HDD default scan IE structure
6038 * @message_type: message type to be set with eWNI_SME_DEFAULT_SCAN_IE
6039 * @length: length of the struct hdd_default_scan_ie
6040 * @session_id: Session Id
6041 * @ie_len: Default scan IE length
6042 * @ie_data: Pointer to default scan IE data
6043 */
6044struct hdd_default_scan_ie {
6045 uint16_t message_type;
6046 uint16_t length;
6047 uint16_t session_id;
6048 uint16_t ie_len;
6049 uint8_t ie_data[MAX_DEFAULT_SCAN_IE_LEN];
6050};
6051
6052/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08006053 * struct vdev_ie_info - IE info
6054 * @vdev_id - vdev for which the IE is being sent
6055 * @ie_id - ID of the IE
6056 * @length - length of the IE data
Naveen Rawat03e8d952016-08-01 15:22:20 -07006057 * @band - indicates IE is intended for which band
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08006058 * @data - IE data
6059 *
6060 * This structure is used to store the IE information.
6061 */
6062struct vdev_ie_info {
6063 uint32_t vdev_id;
6064 uint32_t ie_id;
6065 uint32_t length;
Naveen Rawat03e8d952016-08-01 15:22:20 -07006066 uint32_t band;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08006067 uint8_t *data;
6068};
6069
6070/**
6071 * struct send_extcap_ie - used to pass send_extcap_ie msg from SME to PE
6072 * @type - MSG type
6073 * @length - length of the message
6074 * @seesion_id - session_id for which the message is intended for
6075 *
6076 * This structure is used to pass send_extcap_ie msg from SME to PE
6077 */
6078struct send_extcap_ie {
6079 uint16_t msg_type; /* eWNI_SME_SET_IE_REQ */
6080 uint16_t length;
6081 uint8_t session_id;
6082};
6083
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08006084typedef void (*hw_mode_transition_cb)(uint32_t old_hw_mode_index,
6085 uint32_t new_hw_mode_index,
6086 uint32_t num_vdev_mac_entries,
Tushnim Bhattacharyyaeab33dd2017-11-15 15:20:02 -08006087 struct policy_mgr_vdev_mac_map *vdev_mac_map);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08006088typedef void (*dual_mac_cb)(uint32_t status, uint32_t scan_config,
6089 uint32_t fw_mode_config);
Archana Ramachandrand41c3ed2016-02-10 15:48:06 -08006090typedef void (*antenna_mode_cb)(uint32_t status);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08006091
6092/**
6093 * struct sir_nss_update_request
6094 * @msgType: nss update msg type
6095 * @msgLen: length of the msg
6096 * @new_nss: new spatial stream value
6097 * @vdev_id: session id
6098 */
6099struct sir_nss_update_request {
6100 uint16_t msgType;
6101 uint16_t msgLen;
6102 uint8_t new_nss;
6103 uint32_t vdev_id;
6104};
6105
6106/**
6107 * struct sir_beacon_tx_complete_rsp
6108 *
6109 * @session_id: session for which beacon update happened
6110 * @tx_status: status of the beacon tx from FW
6111 */
6112struct sir_beacon_tx_complete_rsp {
6113 uint8_t session_id;
6114 uint8_t tx_status;
6115};
6116
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08006117/**
6118 * OCB structures
6119 */
6120
6121#define NUM_AC (4)
6122#define OCB_CHANNEL_MAX (5)
6123
6124struct sir_qos_params {
6125 uint8_t aifsn;
6126 uint8_t cwmin;
6127 uint8_t cwmax;
6128};
6129
6130/**
6131 * struct sir_ocb_set_config_response
6132 * @status: response status
6133 */
6134struct sir_ocb_set_config_response {
6135 uint8_t status;
6136};
6137
6138/** Callback for the dcc_stats_event */
6139typedef void (*dcc_stats_event_callback_t)(void *hdd_ctx, uint32_t vdev_id,
6140 uint32_t num_channels, uint32_t stats_per_channel_array_len,
6141 const void *stats_per_channel_array);
6142
6143/**
6144 * struct sir_ocb_config_channel
6145 * @chan_freq: frequency of the channel
6146 * @bandwidth: bandwidth of the channel, either 10 or 20 MHz
6147 * @mac_address: MAC address assigned to this channel
6148 * @qos_params: QoS parameters
6149 * @max_pwr: maximum transmit power of the channel (dBm)
6150 * @min_pwr: minimum transmit power of the channel (dBm)
6151 * @reg_pwr: maximum transmit power specified by the regulatory domain (dBm)
6152 * @antenna_max: maximum antenna gain specified by the regulatory domain (dB)
6153 */
6154struct sir_ocb_config_channel {
6155 uint32_t chan_freq;
6156 uint32_t bandwidth;
Anurag Chouhan6d760662016-02-20 16:05:43 +05306157 struct qdf_mac_addr mac_address;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08006158 struct sir_qos_params qos_params[MAX_NUM_AC];
6159 uint32_t max_pwr;
6160 uint32_t min_pwr;
6161 uint8_t reg_pwr;
6162 uint8_t antenna_max;
6163 uint16_t flags;
6164};
6165
6166/**
6167 * OCB_CHANNEL_FLAG_NO_RX_HDR - Don't add the RX stats header to packets
6168 * received on this channel.
6169 */
6170#define OCB_CHANNEL_FLAG_DISABLE_RX_STATS_HDR (1 << 0)
6171
6172/**
6173 * struct sir_ocb_config_sched
6174 * @chan_freq: frequency of the channel
6175 * @total_duration: duration of the schedule
6176 * @guard_interval: guard interval on the start of the schedule
6177 */
6178struct sir_ocb_config_sched {
6179 uint32_t chan_freq;
6180 uint32_t total_duration;
6181 uint32_t guard_interval;
6182};
6183
6184/**
6185 * struct sir_ocb_config
6186 * @session_id: session id
6187 * @channel_count: number of channels
6188 * @schedule_size: size of the channel schedule
6189 * @flags: reserved
6190 * @channels: array of OCB channels
6191 * @schedule: array of OCB schedule elements
6192 * @dcc_ndl_chan_list_len: size of the ndl_chan array
6193 * @dcc_ndl_chan_list: array of dcc channel info
6194 * @dcc_ndl_active_state_list_len: size of the active state array
6195 * @dcc_ndl_active_state_list: array of active states
6196 * @adapter: the OCB adapter
6197 * @dcc_stats_callback: callback for the response event
6198 */
6199struct sir_ocb_config {
6200 uint8_t session_id;
6201 uint32_t channel_count;
6202 uint32_t schedule_size;
6203 uint32_t flags;
6204 struct sir_ocb_config_channel *channels;
6205 struct sir_ocb_config_sched *schedule;
6206 uint32_t dcc_ndl_chan_list_len;
6207 void *dcc_ndl_chan_list;
6208 uint32_t dcc_ndl_active_state_list_len;
6209 void *dcc_ndl_active_state_list;
6210};
6211
6212/* The size of the utc time in bytes. */
6213#define SIZE_UTC_TIME (10)
6214/* The size of the utc time error in bytes. */
6215#define SIZE_UTC_TIME_ERROR (5)
6216
6217/**
6218 * struct sir_ocb_utc
6219 * @vdev_id: session id
6220 * @utc_time: number of nanoseconds from Jan 1st 1958
6221 * @time_error: the error in the UTC time. All 1's for unknown
6222 */
6223struct sir_ocb_utc {
6224 uint32_t vdev_id;
6225 uint8_t utc_time[SIZE_UTC_TIME];
6226 uint8_t time_error[SIZE_UTC_TIME_ERROR];
6227};
6228
6229/**
6230 * struct sir_ocb_timing_advert
6231 * @vdev_id: session id
6232 * @chan_freq: frequency on which to advertise
6233 * @repeat_rate: the number of times it will send TA in 5 seconds
6234 * @timestamp_offset: offset of the timestamp field in the TA frame
6235 * @time_value_offset: offset of the time_value field in the TA frame
6236 * @template_length: size in bytes of the TA frame
6237 * @template_value: the TA frame
6238 */
6239struct sir_ocb_timing_advert {
6240 uint32_t vdev_id;
6241 uint32_t chan_freq;
6242 uint32_t repeat_rate;
6243 uint32_t timestamp_offset;
6244 uint32_t time_value_offset;
6245 uint32_t template_length;
6246 uint8_t *template_value;
6247};
6248
6249/**
6250 * struct sir_ocb_get_tsf_timer_response
6251 * @vdev_id: session id
6252 * @timer_high: higher 32-bits of the timer
6253 * @timer_low: lower 32-bits of the timer
6254 */
6255struct sir_ocb_get_tsf_timer_response {
6256 uint32_t vdev_id;
6257 uint32_t timer_high;
6258 uint32_t timer_low;
6259};
6260
6261/**
6262 * struct sir_ocb_get_tsf_timer
6263 * @vdev_id: session id
6264 */
6265struct sir_ocb_get_tsf_timer {
6266 uint32_t vdev_id;
6267};
6268
6269/**
6270 * struct sir_dcc_get_stats_response
6271 * @vdev_id: session id
6272 * @num_channels: number of dcc channels
6273 * @channel_stats_array_len: size in bytes of the stats array
6274 * @channel_stats_array: the stats array
6275 */
6276struct sir_dcc_get_stats_response {
6277 uint32_t vdev_id;
6278 uint32_t num_channels;
6279 uint32_t channel_stats_array_len;
6280 void *channel_stats_array;
6281};
6282
6283/**
6284 * struct sir_dcc_get_stats
6285 * @vdev_id: session id
6286 * @channel_count: number of dcc channels
6287 * @request_array_len: size in bytes of the request array
6288 * @request_array: the request array
6289 */
6290struct sir_dcc_get_stats {
6291 uint32_t vdev_id;
6292 uint32_t channel_count;
6293 uint32_t request_array_len;
6294 void *request_array;
6295};
6296
6297/**
6298 * struct sir_dcc_clear_stats
6299 * @vdev_id: session id
6300 * @dcc_stats_bitmap: bitmap of clear option
6301 */
6302struct sir_dcc_clear_stats {
6303 uint32_t vdev_id;
6304 uint32_t dcc_stats_bitmap;
6305};
6306
6307/**
6308 * struct sir_dcc_update_ndl_response
6309 * @vdev_id: session id
6310 * @status: response status
6311 */
6312struct sir_dcc_update_ndl_response {
6313 uint32_t vdev_id;
6314 uint32_t status;
6315};
6316
6317/**
6318 * struct sir_dcc_update_ndl
6319 * @vdev_id: session id
6320 * @channel_count: number of channels to be updated
6321 * @dcc_ndl_chan_list_len: size in bytes of the ndl_chan array
6322 * @dcc_ndl_chan_list: the ndl_chan array
6323 * @dcc_ndl_active_state_list_len: size in bytes of the active_state array
6324 * @dcc_ndl_active_state_list: the active state array
6325 */
6326struct sir_dcc_update_ndl {
6327 uint32_t vdev_id;
6328 uint32_t channel_count;
6329 uint32_t dcc_ndl_chan_list_len;
6330 void *dcc_ndl_chan_list;
6331 uint32_t dcc_ndl_active_state_list_len;
6332 void *dcc_ndl_active_state_list;
6333};
6334
6335/**
6336 * enum powersave_qpower_mode: QPOWER modes
6337 * @QPOWER_DISABLED: Qpower is disabled
6338 * @QPOWER_ENABLED: Qpower is enabled
6339 * @QPOWER_DUTY_CYCLING: Qpower is enabled with duty cycling
6340 */
6341enum powersave_qpower_mode {
6342 QPOWER_DISABLED = 0,
6343 QPOWER_ENABLED = 1,
6344 QPOWER_DUTY_CYCLING = 2
6345};
6346
6347/**
6348 * enum powersave_qpower_mode: powersave_mode
6349 * @PS_NOT_SUPPORTED: Power save is not supported
6350 * @PS_LEGACY_NODEEPSLEEP: Legacy power save enabled and deep sleep disabled
6351 * @PS_QPOWER_NODEEPSLEEP: QPOWER enabled and deep sleep disabled
6352 * @PS_LEGACY_DEEPSLEEP: Legacy power save enabled and deep sleep enabled
6353 * @PS_QPOWER_DEEPSLEEP: QPOWER enabled and deep sleep enabled
6354 * @PS_DUTY_CYCLING_QPOWER: QPOWER enabled in duty cycling mode
6355 */
6356enum powersave_mode {
6357 PS_NOT_SUPPORTED = 0,
6358 PS_LEGACY_NODEEPSLEEP = 1,
6359 PS_QPOWER_NODEEPSLEEP = 2,
6360 PS_LEGACY_DEEPSLEEP = 3,
6361 PS_QPOWER_DEEPSLEEP = 4,
6362 PS_DUTY_CYCLING_QPOWER = 5
6363};
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08006364#ifdef FEATURE_LFR_SUBNET_DETECTION
6365/**
6366 * struct gateway_param_update_req - gateway parameter update request
6367 * @request_id: request id
6368 * @session_id: session id
6369 * @max_retries: Max ARP/NS retry attempts
6370 * @timeout: Retry interval
6371 * @ipv4_addr_type: on ipv4 network
6372 * @ipv6_addr_type: on ipv6 network
6373 * @gw_mac_addr: gateway mac addr
6374 * @ipv4_addr: ipv4 addr
6375 * @ipv6_addr: ipv6 addr
6376 */
6377struct gateway_param_update_req {
6378 uint32_t request_id;
6379 uint32_t session_id;
6380 uint32_t max_retries;
6381 uint32_t timeout;
6382 uint32_t ipv4_addr_type;
6383 uint32_t ipv6_addr_type;
Anurag Chouhan6d760662016-02-20 16:05:43 +05306384 struct qdf_mac_addr gw_mac_addr;
6385 uint8_t ipv4_addr[QDF_IPV4_ADDR_SIZE];
6386 uint8_t ipv6_addr[QDF_IPV6_ADDR_SIZE];
Ravi Joshi61c3c7a2015-11-09 18:41:20 -08006387};
6388#else
6389struct gateway_param_update_req;
6390#endif /* FEATURE_LFR_SUBNET_DETECTION */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08006391
Abhishek Singh518323d2015-10-19 17:42:01 +05306392/**
6393 * struct sir_sme_ext_change_chan_req - channel change request
6394 * @message_type: message id
6395 * @length: msg length
6396 * @new_channel: new channel
6397 * @session_id: session id
6398 */
6399struct sir_sme_ext_cng_chan_req {
6400 uint16_t message_type; /* eWNI_SME_EXT_CHANGE_CHANNEL */
6401 uint16_t length;
6402 uint32_t new_channel;
6403 uint8_t session_id;
6404};
6405
6406/**
6407 * struct sir_sme_ext_change_chan_ind.
6408 * @session_id: session id
6409 * @new_channel: new channel to change
6410 */
6411struct sir_sme_ext_cng_chan_ind {
6412 uint8_t session_id;
6413 uint8_t new_channel;
6414};
6415
Ryan Hsu3c8f79f2015-12-02 16:45:09 -08006416/**
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07006417 * struct stsf - the basic stsf structure
6418 *
6419 * @vdev_id: vdev id
6420 * @tsf_low: low 32bits of tsf
6421 * @tsf_high: high 32bits of tsf
Manikandan Mohan5356c2b2016-04-03 15:51:35 -07006422 * @soc_timer_low: low 32bits of synced SOC timer value
6423 * @soc_timer_high: high 32bits of synced SOC timer value
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07006424 *
6425 * driver use this struct to store the tsf info
6426 */
6427struct stsf {
6428 uint32_t vdev_id;
6429 uint32_t tsf_low;
6430 uint32_t tsf_high;
Manikandan Mohan5356c2b2016-04-03 15:51:35 -07006431 uint32_t soc_timer_low;
6432 uint32_t soc_timer_high;
Manikandan Mohandcc21ba2016-03-15 14:31:56 -07006433};
6434
Gupta, Kapil4cb1d7d2016-04-16 18:16:25 -07006435#define SIR_BCN_FLT_MAX_ELEMS_IE_LIST 8
6436/**
6437 * struct beacon_filter_param - parameters for beacon filtering
6438 * @vdev_id: vdev id
6439 * @ie_map: bitwise map of IEs that needs to be filtered
6440 *
6441 */
6442struct beacon_filter_param {
6443 uint32_t vdev_id;
6444 uint32_t ie_map[SIR_BCN_FLT_MAX_ELEMS_IE_LIST];
6445};
6446
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05306447/**
Gupta, Kapil96c7f2f2016-04-25 19:13:41 +05306448 * struct adaptive_dwelltime_params - the adaptive dwelltime params
6449 * @vdev_id: vdev id
6450 * @is_enabled: Adaptive dwell time is enabled/disabled
6451 * @dwelltime_mode: global default adaptive dwell mode
6452 * @lpf_weight: weight to calculate the average low pass
6453 * filter for channel congestion
6454 * @passive_mon_intval: intval to monitor wifi activity in passive scan in msec
6455 * @wifi_act_threshold: % of wifi activity used in passive scan 0-100
6456 *
6457 */
6458struct adaptive_dwelltime_params {
6459 uint32_t vdev_id;
6460 bool is_enabled;
6461 uint8_t dwelltime_mode;
6462 uint8_t lpf_weight;
6463 uint8_t passive_mon_intval;
6464 uint8_t wifi_act_threshold;
6465};
6466
6467/**
Chandrasekaran, Manishekar5c19dc52016-02-04 14:58:26 +05306468 * struct csa_offload_params - CSA offload request parameters
6469 * @channel: channel
6470 * @switch_mode: switch mode
6471 * @sec_chan_offset: second channel offset
6472 * @new_ch_width: new channel width
6473 * @new_ch_freq_seg1: channel center freq 1
6474 * @new_ch_freq_seg2: channel center freq 2
6475 * @ies_present_flag: IE present flag
6476 */
6477struct csa_offload_params {
6478 uint8_t channel;
6479 uint8_t switch_mode;
6480 uint8_t sec_chan_offset;
6481 uint8_t new_ch_width;
6482 uint8_t new_op_class;
6483 uint8_t new_ch_freq_seg1;
6484 uint8_t new_ch_freq_seg2;
6485 uint32_t ies_present_flag;
6486 tSirMacAddr bssId;
6487};
6488
6489/**
Sandeep Puligillae0875662016-02-12 16:09:21 -08006490 * enum obss_ht40_scancmd_type - obss scan command type
6491 * @HT40_OBSS_SCAN_PARAM_START: OBSS scan start
6492 * @HT40_OBSS_SCAN_PARAM_UPDATE: OBSS scan param update
6493 */
6494enum obss_ht40_scancmd_type {
6495 HT40_OBSS_SCAN_PARAM_START,
6496 HT40_OBSS_SCAN_PARAM_UPDATE
6497};
6498
6499/**
6500 * struct sme_obss_ht40_scanind_msg - sme obss scan params
6501 * @msg_type: message type
6502 * @length: message length
6503 * @mac_addr: mac address
6504 */
6505struct sme_obss_ht40_scanind_msg {
6506 uint16_t msg_type;
6507 uint16_t length;
6508 struct qdf_mac_addr mac_addr;
6509};
6510
6511/**
6512 * struct obss_ht40_scanind - ht40 obss scan request
6513 * @cmd: message type
6514 * @scan_type: message length
6515 * @obss_passive_dwelltime: obss passive dwelltime
6516 * @obss_active_dwelltime: obss active dwelltime
6517 * @obss_width_trigger_interval: scan interval
6518 * @obss_passive_total_per_channel: total passive scan time per channel
6519 * @obss_active_total_per_channel: total active scan time per channel
6520 * @bsswidth_ch_trans_delay: OBSS transition delay time
6521 * @obss_activity_threshold: OBSS activity threshold
6522 * @self_sta_id: self sta identification
6523 * @bss_id: BSS index
6524 * @fortymhz_intolerent: Ht40mhz intolerance
6525 * @channel_count: channel count
6526 * @channels: channel information
6527 * @current_operatingclass: operating class
6528 * @iefield_len: ie's length
6529 * @iefiled: ie's information
6530 */
6531struct obss_ht40_scanind {
6532 enum obss_ht40_scancmd_type cmd;
6533 enum eSirScanType scan_type;
6534 /* In TUs */
6535 uint16_t obss_passive_dwelltime;
6536 uint16_t obss_active_dwelltime;
6537 /* In seconds */
6538 uint16_t obss_width_trigger_interval;
6539 /* In TU's */
6540 uint16_t obss_passive_total_per_channel;
6541 uint16_t obss_active_total_per_channel;
6542 uint16_t bsswidth_ch_trans_delay;
6543 uint16_t obss_activity_threshold;
6544 uint8_t self_sta_idx;
6545 uint8_t bss_id;
6546 uint8_t fortymhz_intolerent;
6547 uint8_t channel_count;
6548 uint8_t channels[SIR_ROAM_MAX_CHANNELS];
6549 uint8_t current_operatingclass;
6550 uint16_t iefield_len;
6551 uint8_t iefield[SIR_ROAM_SCAN_MAX_PB_REQ_SIZE];
6552};
6553
6554/**
6555 * struct obss_scanparam - OBSS scan parameters
6556 * @obss_passive_dwelltime: message type
6557 * @obss_active_dwelltime: message length
6558 * @obss_width_trigger_interval: obss passive dwelltime
6559 * @obss_passive_total_per_channel: obss passive total scan time
6560 * @obss_active_total_per_channel: obss active total scan time
6561 * @bsswidth_ch_trans_delay: OBSS transition delay time
6562 * @obss_activity_threshold: OBSS activity threshold
6563 */
6564struct obss_scanparam {
6565 uint16_t obss_passive_dwelltime;
6566 uint16_t obss_active_dwelltime;
6567 uint16_t obss_width_trigger_interval;
6568 uint16_t obss_passive_total_per_channel;
6569 uint16_t obss_active_total_per_channel;
6570 uint16_t bsswidth_ch_trans_delay;
6571 uint16_t obss_activity_threshold;
6572};
6573
Arun Khandavalli2476ef52016-04-26 20:19:43 +05306574/**
6575 * struct sir_bpf_set_offload - set bpf filter instructions
6576 * @session_id: session identifier
6577 * @version: host bpf version
6578 * @filter_id: Filter ID for BPF filter
6579 * @total_length: The total length of the full instruction
6580 * total_length equal to 0 means reset
6581 * @current_offset: current offset, 0 means start a new setting
6582 * @current_length: Length of current @program
6583 * @program: BPF instructions
6584 */
6585struct sir_bpf_set_offload {
6586 uint8_t session_id;
6587 uint32_t version;
6588 uint32_t filter_id;
6589 uint32_t total_length;
6590 uint32_t current_offset;
6591 uint32_t current_length;
6592 uint8_t *program;
6593};
6594
6595/**
6596 * struct sir_bpf_offload_capabilities - get bpf Capabilities
6597 * @bpf_version: fw's implement version
6598 * @max_bpf_filters: max filters that fw supports
6599 * @max_bytes_for_bpf_inst: the max bytes that can be used as bpf instructions
6600 * @remaining_bytes_for_bpf_inst: remaining bytes for bpf instructions
6601 *
6602 */
6603struct sir_bpf_get_offload {
6604 uint32_t bpf_version;
6605 uint32_t max_bpf_filters;
6606 uint32_t max_bytes_for_bpf_inst;
6607 uint32_t remaining_bytes_for_bpf_inst;
6608};
6609
Sandeep Puligilla607f34a2016-05-25 14:37:47 -07006610/**
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306611 * struct sir_wake_lock_stats - wake lock stats structure
Dustin Brown9d797d62017-01-11 16:39:12 -08006612 * @wow_unspecified_wake_up_count: number of non-wow related wake ups
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306613 * @wow_ucast_wake_up_count: Unicast wakeup count
6614 * @wow_bcast_wake_up_count: Broadcast wakeup count
6615 * @wow_ipv4_mcast_wake_up_count: ipv4 multicast wakeup count
6616 * @wow_ipv6_mcast_wake_up_count: ipv6 multicast wakeup count
6617 * @wow_ipv6_mcast_ra_stats: ipv6 multicast ra stats
6618 * @wow_ipv6_mcast_ns_stats: ipv6 multicast ns stats
6619 * @wow_ipv6_mcast_na_stats: ipv6 multicast na stats
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +05306620 * @wow_icmpv4_count: ipv4 icmp packet count
Himanshu Agarwal4574e282016-08-10 15:22:45 +05306621 * @wow_icmpv6_count: ipv6 icmp packet count
Poddar, Siddarthc01681a2016-12-21 18:36:30 +05306622 * @wow_rssi_breach_wake_up_count: rssi breach wakeup count
6623 * @wow_low_rssi_wake_up_count: low rssi wakeup count
6624 * @wow_gscan_wake_up_count: gscan wakeup count
6625 * @wow_pno_complete_wake_up_count: pno complete wakeup count
6626 * @wow_pno_match_wake_up_count: pno match wakeup count
Dustin Brown9d797d62017-01-11 16:39:12 -08006627 * @wow_oem_response_wake_up_count: oem response wakeup count
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05306628 * @pwr_save_fail_detected: pwr save fail detected wakeup count
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306629 */
6630struct sir_wake_lock_stats {
Dustin Brown9d797d62017-01-11 16:39:12 -08006631 uint32_t wow_unspecified_wake_up_count;
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306632 uint32_t wow_ucast_wake_up_count;
6633 uint32_t wow_bcast_wake_up_count;
6634 uint32_t wow_ipv4_mcast_wake_up_count;
6635 uint32_t wow_ipv6_mcast_wake_up_count;
6636 uint32_t wow_ipv6_mcast_ra_stats;
6637 uint32_t wow_ipv6_mcast_ns_stats;
6638 uint32_t wow_ipv6_mcast_na_stats;
Sreelakshmi Konamkie1cd51f2016-08-19 16:58:24 +05306639 uint32_t wow_icmpv4_count;
Himanshu Agarwal4574e282016-08-10 15:22:45 +05306640 uint32_t wow_icmpv6_count;
Poddar, Siddarthc01681a2016-12-21 18:36:30 +05306641 uint32_t wow_rssi_breach_wake_up_count;
6642 uint32_t wow_low_rssi_wake_up_count;
6643 uint32_t wow_gscan_wake_up_count;
6644 uint32_t wow_pno_complete_wake_up_count;
6645 uint32_t wow_pno_match_wake_up_count;
Dustin Brown9d797d62017-01-11 16:39:12 -08006646 uint32_t wow_oem_response_wake_up_count;
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05306647 uint32_t pwr_save_fail_detected;
Dustin Brown9d797d62017-01-11 16:39:12 -08006648};
6649
6650/**
6651 * struct sir_vdev_wow_stats - container for per vdev wow related stat counters
6652 * @ucast: Unicast wakeup count
6653 * @bcast: Broadcast wakeup count
6654 * @ipv4_mcast: ipv4 multicast wakeup count
6655 * @ipv6_mcast: ipv6 multicast wakeup count
6656 * @ipv6_mcast_ra: ipv6 multicast ra stats
6657 * @ipv6_mcast_ns: ipv6 multicast ns stats
6658 * @ipv6_mcast_na: ipv6 multicast na stats
6659 * @icmpv4: ipv4 icmp packet count
6660 * @icmpv6: ipv6 icmp packet count
6661 * @rssi_breach: rssi breach wakeup count
6662 * @low_rssi: low rssi wakeup count
6663 * @gscan: gscan wakeup count
6664 * @pno_complete: pno complete wakeup count
6665 * @pno_match: pno match wakeup count
Amar Singhal5eb9acb2017-05-26 15:25:27 -07006666 * @oem_response: oem response wakeup coun
6667 * @scan_11d: 11d scan wakeup count
Dustin Brown9d797d62017-01-11 16:39:12 -08006668 */
6669struct sir_vdev_wow_stats {
6670 uint32_t ucast;
6671 uint32_t bcast;
6672 uint32_t ipv4_mcast;
6673 uint32_t ipv6_mcast;
6674 uint32_t ipv6_mcast_ra;
6675 uint32_t ipv6_mcast_ns;
6676 uint32_t ipv6_mcast_na;
6677 uint32_t icmpv4;
6678 uint32_t icmpv6;
6679 uint32_t rssi_breach;
6680 uint32_t low_rssi;
6681 uint32_t gscan;
6682 uint32_t pno_complete;
6683 uint32_t pno_match;
6684 uint32_t oem_response;
Ravi Kumar Bokka05c14e52017-03-27 14:48:23 +05306685 uint32_t pwr_save_fail_detected;
Amar Singhal5eb9acb2017-05-26 15:25:27 -07006686 uint32_t scan_11d;
Padma, Santhosh Kumar5e33beb2016-08-08 19:07:06 +05306687};
6688
6689/**
Sandeep Puligilla607f34a2016-05-25 14:37:47 -07006690 * enum ht_capability_fields - HT Capabilities bit fields
6691 * @HT_CAPS_LDPC: ldpc coding capability bit field
6692 * @HT_CAPS_SUPPORTED_CHANNEL_SET: channel width set bit field
6693 * @HT_CAPS_SM_PWR_SAVE: SM power save bit field
6694 * @HT_CAPS_GREENFIELD: greenfield capability bit field
6695 * @HT_CAPS_SHORT_GI20: short GI 20 bit field
6696 * @HT_CAPS_SHORT_GI40: short GI 40 bit field
6697 * @HT_CAPS_TX_STBC: Tx STBC bit field
6698 * @HT_CAPS_RX_STBC: Rx STBC bit fields
6699 */
6700enum ht_capability_fields {
6701 HT_CAPS_LDPC = 0x0001,
6702 HT_CAPS_SUPPORTED_CHANNEL_SET = 0x0002,
6703 HT_CAPS_SM_PWR_SAVE = 0x000c,
6704 HT_CAPS_GREENFIELD = 0x0010,
6705 HT_CAPS_SHORT_GI20 = 0x0020,
6706 HT_CAPS_SHORT_GI40 = 0x0040,
6707 HT_CAPS_TX_STBC = 0x0080,
6708 HT_CAPS_RX_STBC = 0x0300
6709};
6710
Ravi Joshi412f23d2016-05-26 15:09:23 -07006711#ifdef WLAN_FEATURE_NAN_DATAPATH
6712
6713#define IFACE_NAME_SIZE 64
6714
6715/**
6716 * enum ndp_accept_policy - nan data path accept policy
6717 * @NDP_ACCEPT_POLICY_NONE: the framework will decide the policy
6718 * @NDP_ACCEPT_POLICY_ALL: accept policy offloaded to fw
6719 *
6720 */
6721enum ndp_accept_policy {
6722 NDP_ACCEPT_POLICY_NONE = 0,
6723 NDP_ACCEPT_POLICY_ALL = 1,
6724};
6725
6726/**
6727 * enum ndp_self_role - nan data path role
6728 * @NDP_ROLE_INITIATOR: initiator of nan data path request
6729 * @NDP_ROLE_RESPONDER: responder to nan data path request
6730 *
6731 */
6732enum ndp_self_role {
6733 NDP_ROLE_INITIATOR = 0,
6734 NDP_ROLE_RESPONDER = 1,
6735};
6736
6737/**
6738 * enum ndp_response_code - responder's response code to nan data path request
6739 * @NDP_RESPONSE_ACCEPT: ndp request accepted
6740 * @NDP_RESPONSE_REJECT: ndp request rejected
6741 * @NDP_RESPONSE_DEFER: ndp request deferred until later (response to follow
6742 * any time later)
6743 *
6744 */
6745enum ndp_response_code {
6746 NDP_RESPONSE_ACCEPT = 0,
6747 NDP_RESPONSE_REJECT = 1,
6748 NDP_RESPONSE_DEFER = 2,
6749};
6750
6751/**
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07006752 * enum ndp_end_type - NDP end type
6753 * @NDP_END_TYPE_UNSPECIFIED: type is unspecified
6754 * @NDP_END_TYPE_PEER_UNAVAILABLE: type is peer unavailable
6755 * @NDP_END_TYPE_OTA_FRAME: NDP end frame received from peer
6756 *
6757 */
6758enum ndp_end_type {
6759 NDP_END_TYPE_UNSPECIFIED = 0x00,
6760 NDP_END_TYPE_PEER_UNAVAILABLE = 0x01,
6761 NDP_END_TYPE_OTA_FRAME = 0x02,
6762};
6763
6764/**
6765 * enum ndp_end_reason_code - NDP end reason code
6766 * @NDP_END_REASON_UNSPECIFIED: reason is unspecified
6767 * @NDP_END_REASON_INACTIVITY: reason is peer inactivity
6768 * @NDP_END_REASON_PEER_DATA_END: data end indication received from peer
6769 *
6770 */
6771enum ndp_end_reason_code {
6772 NDP_END_REASON_UNSPECIFIED = 0x00,
6773 NDP_END_REASON_INACTIVITY = 0x01,
6774 NDP_END_REASON_PEER_DATA_END = 0x02,
6775};
6776
6777/**
Naveen Rawat8d63a592016-06-29 18:30:59 -07006778 * enum nan_status_type - NDP status type
6779 * @NDP_RSP_STATUS_SUCCESS: request was successful
6780 * @NDP_RSP_STATUS_ERROR: request failed
6781 */
6782enum nan_status_type {
6783 NDP_RSP_STATUS_SUCCESS = 0x00,
6784 NDP_RSP_STATUS_ERROR = 0x01,
6785};
6786
6787/**
6788 * enum nan_reason_code - NDP command rsp reason code value
6789 * @NDP_UNSUPPORTED_CONCURRENCY: Will be used in unsupported concurrency cases
6790 * @NDP_NAN_DATA_IFACE_CREATE_FAILED: ndi create failed
6791 * @NDP_NAN_DATA_IFACE_DELETE_FAILED: ndi delete failed
6792 * @NDP_DATA_INITIATOR_REQ_FAILED: data initiator request failed
6793 * @NDP_DATA_RESPONDER_REQ_FAILED: data responder request failed
6794 * @NDP_INVALID_SERVICE_INSTANCE_ID: invalid service instance id
6795 * @NDP_INVALID_NDP_INSTANCE_ID: invalid ndp instance id
6796 * @NDP_INVALID_RSP_CODE: invalid response code in ndp responder request
6797 * @NDP_INVALID_APP_INFO_LEN: invalid app info length
6798 * @NDP_NMF_REQ_FAIL: OTA nan mgmt frame failure for data request
6799 * @NDP_NMF_RSP_FAIL: OTA nan mgmt frame failure for data response
6800 * @NDP_NMF_CNF_FAIL: OTA nan mgmt frame failure for confirm
6801 * @NDP_END_FAILED: ndp end failed
6802 * @NDP_NMF_END_REQ_FAIL: OTA nan mgmt frame failure for data end
6803 * @NDP_VENDOR_SPECIFIC_ERROR: other vendor specific failures
6804 */
6805enum nan_reason_code {
6806 NDP_UNSUPPORTED_CONCURRENCY = 9000,
6807 NDP_NAN_DATA_IFACE_CREATE_FAILED = 9001,
6808 NDP_NAN_DATA_IFACE_DELETE_FAILED = 9002,
6809 NDP_DATA_INITIATOR_REQ_FAILED = 9003,
6810 NDP_DATA_RESPONDER_REQ_FAILED = 9004,
6811 NDP_INVALID_SERVICE_INSTANCE_ID = 9005,
6812 NDP_INVALID_NDP_INSTANCE_ID = 9006,
6813 NDP_INVALID_RSP_CODE = 9007,
6814 NDP_INVALID_APP_INFO_LEN = 9008,
6815 NDP_NMF_REQ_FAIL = 9009,
6816 NDP_NMF_RSP_FAIL = 9010,
6817 NDP_NMF_CNF_FAIL = 9011,
6818 NDP_END_FAILED = 9012,
6819 NDP_NMF_END_REQ_FAIL = 9013,
6820 /* 9500 onwards vendor specific error codes */
6821 NDP_VENDOR_SPECIFIC_ERROR = 9500,
6822};
6823
6824/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07006825 * struct ndp_cfg - ndp configuration
6826 * @tag: unique identifier
6827 * @ndp_cfg_len: ndp configuration length
6828 * @ndp_cfg: variable length ndp configuration
6829 *
6830 */
6831struct ndp_cfg {
6832 uint32_t tag;
6833 uint32_t ndp_cfg_len;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006834 uint8_t *ndp_cfg;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006835};
6836
6837/**
6838 * struct ndp_qos_cfg - ndp qos configuration
6839 * @tag: unique identifier
6840 * @ndp_qos_cfg_len: ndp qos configuration length
6841 * @ndp_qos_cfg: variable length ndp qos configuration
6842 *
6843 */
6844struct ndp_qos_cfg {
6845 uint32_t tag;
6846 uint32_t ndp_qos_cfg_len;
6847 uint8_t ndp_qos_cfg[];
6848};
6849
6850/**
6851 * struct ndp_app_info - application info shared during ndp setup
6852 * @tag: unique identifier
6853 * @ndp_app_info_len: ndp app info length
6854 * @ndp_app_info: variable length application information
6855 *
6856 */
6857struct ndp_app_info {
6858 uint32_t tag;
6859 uint32_t ndp_app_info_len;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006860 uint8_t *ndp_app_info;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006861};
6862
6863/**
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006864 * struct ndp_scid - structure to hold sceurity context identifier
6865 * @scid_len: length of scid
6866 * @scid: scid
6867 *
6868 */
6869struct ndp_scid {
6870 uint32_t scid_len;
6871 uint8_t *scid;
6872};
6873
6874/**
6875 * struct ndp_pmk - structure to hold pairwise master key
6876 * @pmk_len: length of pairwise master key
6877 * @pmk: buffer containing pairwise master key
6878 *
6879 */
6880struct ndp_pmk {
6881 uint32_t pmk_len;
6882 uint8_t *pmk;
6883};
6884
6885/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07006886 * struct ndi_create_req - ndi create request params
6887 * @transaction_id: unique identifier
6888 * @iface_name: interface name
6889 *
6890 */
6891struct ndi_create_req {
6892 uint32_t transaction_id;
6893 char iface_name[IFACE_NAME_SIZE];
6894};
6895
6896/**
6897 * struct ndi_create_rsp - ndi create response params
Ravi Joshi412f23d2016-05-26 15:09:23 -07006898 * @status: request status
6899 * @reason: reason if any
6900 *
6901 */
6902struct ndi_create_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07006903 uint32_t status;
6904 uint32_t reason;
Rakesh Sunkicf1c9ab2016-08-25 14:11:25 -07006905 uint8_t sta_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006906};
6907
6908/**
Ravi Joshi412f23d2016-05-26 15:09:23 -07006909 * struct ndi_delete_rsp - ndi delete response params
Ravi Joshi412f23d2016-05-26 15:09:23 -07006910 * @status: request status
6911 * @reason: reason if any
6912 *
6913 */
6914struct ndi_delete_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07006915 uint32_t status;
6916 uint32_t reason;
6917};
6918
6919/**
6920 * struct ndp_initiator_req - ndp initiator request params
6921 * @transaction_id: unique identifier
6922 * @vdev_id: session id of the interface over which ndp is being created
6923 * @channel: suggested channel for ndp creation
Naveen Rawat0a017052016-10-19 14:17:07 -07006924 * @channel_cfg: channel config, 0=no channel, 1=optional, 2=mandatory
Ravi Joshi412f23d2016-05-26 15:09:23 -07006925 * @service_instance_id: Service identifier
6926 * @peer_discovery_mac_addr: Peer's discovery mac address
6927 * @self_ndi_mac_addr: self NDI mac address
6928 * @ndp_config: ndp configuration params
6929 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006930 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
6931 * @pmk: pairwise master key
Ravi Joshi412f23d2016-05-26 15:09:23 -07006932 *
6933 */
6934struct ndp_initiator_req {
6935 uint32_t transaction_id;
6936 uint32_t vdev_id;
6937 uint32_t channel;
Naveen Rawat0a017052016-10-19 14:17:07 -07006938 uint32_t channel_cfg;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006939 uint32_t service_instance_id;
6940 struct qdf_mac_addr peer_discovery_mac_addr;
6941 struct qdf_mac_addr self_ndi_mac_addr;
6942 struct ndp_cfg ndp_config;
6943 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006944 uint32_t ncs_sk_type;
6945 struct ndp_pmk pmk;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006946};
6947
6948/**
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006949 * struct ndp_initiator_rsp - response event from FW
Ravi Joshi412f23d2016-05-26 15:09:23 -07006950 * @transaction_id: unique identifier
6951 * @vdev_id: session id of the interface over which ndp is being created
6952 * @ndp_instance_id: locally created NDP instance ID
6953 * @status: status of the ndp request
6954 * @reason: reason for failure if any
6955 *
6956 */
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006957struct ndp_initiator_rsp {
Ravi Joshi412f23d2016-05-26 15:09:23 -07006958 uint32_t transaction_id;
6959 uint32_t vdev_id;
6960 uint32_t ndp_instance_id;
6961 uint32_t status;
Naveen Rawat8d63a592016-06-29 18:30:59 -07006962 uint32_t reason;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006963};
6964
6965/**
6966 * struct ndp_indication_event - create ndp indication on the responder
6967 * @vdev_id: session id of the interface over which ndp is being created
6968 * @service_instance_id: Service identifier
6969 * @peer_discovery_mac_addr: Peer's discovery mac address
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006970 * @peer_mac_addr: Peer's NDI mac address
Ravi Joshi412f23d2016-05-26 15:09:23 -07006971 * @ndp_initiator_mac_addr: NDI mac address of the peer initiating NDP
6972 * @ndp_instance_id: locally created NDP instance ID
6973 * @role: self role for NDP
6974 * @ndp_accept_policy: accept policy configured by the upper layer
6975 * @ndp_config: ndp configuration params
6976 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006977 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
6978 * @scid: security context identifier
Ravi Joshi412f23d2016-05-26 15:09:23 -07006979 *
6980 */
6981struct ndp_indication_event {
6982 uint32_t vdev_id;
6983 uint32_t service_instance_id;
6984 struct qdf_mac_addr peer_discovery_mac_addr;
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -07006985 struct qdf_mac_addr peer_mac_addr;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006986 uint32_t ndp_instance_id;
6987 enum ndp_self_role role;
6988 enum ndp_accept_policy policy;
6989 struct ndp_cfg ndp_config;
6990 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08006991 uint32_t ncs_sk_type;
6992 struct ndp_scid scid;
Ravi Joshi412f23d2016-05-26 15:09:23 -07006993};
6994
6995/**
6996 * struct ndp_responder_req - responder's response to ndp create request
6997 * @transaction_id: unique identifier
6998 * @vdev_id: session id of the interface over which ndp is being created
6999 * @ndp_instance_id: locally created NDP instance ID
7000 * @ndp_rsp: response to the ndp create request
7001 * @ndp_config: ndp configuration params
7002 * @ndp_info: ndp application info
Naveen Rawat4f3983e2016-11-29 16:12:09 -08007003 * @pmk: pairwise master key
7004 * @ncs_sk_type: indicates NCS_SK_128 or NCS_SK_256
Ravi Joshi412f23d2016-05-26 15:09:23 -07007005 *
7006 */
7007struct ndp_responder_req {
7008 uint32_t transaction_id;
7009 uint32_t vdev_id;
7010 uint32_t ndp_instance_id;
7011 enum ndp_response_code ndp_rsp;
7012 struct ndp_cfg ndp_config;
7013 struct ndp_app_info ndp_info;
Naveen Rawat4f3983e2016-11-29 16:12:09 -08007014 struct ndp_pmk pmk;
7015 uint32_t ncs_sk_type;
Ravi Joshi412f23d2016-05-26 15:09:23 -07007016};
7017
7018/**
7019 * struct ndp_responder_rsp_event - response to responder's request
7020 * @transaction_id: unique identifier
7021 * @vdev_id: session id of the interface over which ndp is being created
7022 * @status: command status
7023 * @reason: reason for failure if any
Abhishek Singh4fef7472016-06-06 11:36:03 -07007024 * @peer_mac_addr: Peer's mac address
Rakesh Sunkid92d1082017-01-04 15:14:28 -08007025 * @create_peer: Flag to indicate to create peer
Ravi Joshi412f23d2016-05-26 15:09:23 -07007026 */
7027struct ndp_responder_rsp_event {
7028 uint32_t transaction_id;
7029 uint32_t vdev_id;
7030 uint32_t status;
7031 uint32_t reason;
Abhishek Singh4fef7472016-06-06 11:36:03 -07007032 struct qdf_mac_addr peer_mac_addr;
Rakesh Sunkid92d1082017-01-04 15:14:28 -08007033 bool create_peer;
Ravi Joshi412f23d2016-05-26 15:09:23 -07007034};
7035
7036/**
7037 * struct ndp_confirm_event - ndp confirmation event from FW
7038 * @vdev_id: session id of the interface over which ndp is being created
7039 * @ndp_instance_id: ndp instance id for which confirm is being generated
Naveen Rawat460be782016-06-29 18:26:22 -07007040 * @reason_code : reason code(opaque to driver)
7041 * @num_active_ndps_on_peer: number of ndp instances on peer
Ravi Joshi412f23d2016-05-26 15:09:23 -07007042 * @peer_ndi_mac_addr: peer NDI mac address
7043 * @rsp_code: ndp response code
Ravi Joshi412f23d2016-05-26 15:09:23 -07007044 * @ndp_info: ndp application info
7045 *
7046 */
7047struct ndp_confirm_event {
7048 uint32_t vdev_id;
7049 uint32_t ndp_instance_id;
Naveen Rawat460be782016-06-29 18:26:22 -07007050 uint32_t reason_code;
7051 uint32_t num_active_ndps_on_peer;
Ravi Joshi412f23d2016-05-26 15:09:23 -07007052 struct qdf_mac_addr peer_ndi_mac_addr;
7053 enum ndp_response_code rsp_code;
Ravi Joshi412f23d2016-05-26 15:09:23 -07007054 struct ndp_app_info ndp_info;
7055};
7056
7057/**
7058 * struct ndp_end_req - ndp end request
7059 * @transaction_id: unique transaction identifier
Ravi Joshi412f23d2016-05-26 15:09:23 -07007060 * @num_ndp_instances: number of ndp instances to be terminated
Naveen Rawatf28315c2016-06-29 18:06:02 -07007061 * @ndp_ids: pointer to array of ndp_instance_id to be terminated
Ravi Joshi412f23d2016-05-26 15:09:23 -07007062 *
7063 */
7064struct ndp_end_req {
7065 uint32_t transaction_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07007066 uint32_t num_ndp_instances;
Naveen Rawatf28315c2016-06-29 18:06:02 -07007067 uint32_t *ndp_ids;
Ravi Joshi412f23d2016-05-26 15:09:23 -07007068};
7069
7070/**
7071 * struct peer_ndp_map - mapping of NDP instances to peer to VDEV
7072 * @vdev_id: session id of the interface over which ndp is being created
7073 * @peer_ndi_mac_addr: peer NDI mac address
7074 * @num_active_ndp_sessions: number of active NDP sessions on the peer
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07007075 * @type: NDP end indication type
7076 * @reason_code: NDP end indication reason code
7077 * @ndp_instance_id: NDP instance ID
Ravi Joshi412f23d2016-05-26 15:09:23 -07007078 *
7079 */
7080struct peer_ndp_map {
7081 uint32_t vdev_id;
7082 struct qdf_mac_addr peer_ndi_mac_addr;
7083 uint32_t num_active_ndp_sessions;
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07007084 enum ndp_end_type type;
7085 enum ndp_end_reason_code reason_code;
7086 uint32_t ndp_instance_id;
Ravi Joshi412f23d2016-05-26 15:09:23 -07007087};
7088
7089/**
7090 * struct ndp_end_rsp_event - firmware response to ndp end request
7091 * @transaction_id: unique identifier for the request
Naveen Rawatf28315c2016-06-29 18:06:02 -07007092 * @status: status of operation
7093 * @reason: reason(opaque to host driver)
Ravi Joshi412f23d2016-05-26 15:09:23 -07007094 *
7095 */
7096struct ndp_end_rsp_event {
7097 uint32_t transaction_id;
Naveen Rawatf28315c2016-06-29 18:06:02 -07007098 uint32_t status;
7099 uint32_t reason;
Ravi Joshi412f23d2016-05-26 15:09:23 -07007100};
7101
7102/**
7103 * struct ndp_end_indication_event - ndp termination notification from FW
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07007104 * @num_ndp_ids: number of NDP ids
7105 * @ndp_map: mapping of NDP instances to peer and vdev
Ravi Joshi412f23d2016-05-26 15:09:23 -07007106 *
7107 */
7108struct ndp_end_indication_event {
Deepak Dhamdherea6d2f4c2016-06-04 00:24:52 -07007109 uint32_t num_ndp_ids;
Ravi Joshi412f23d2016-05-26 15:09:23 -07007110 struct peer_ndp_map ndp_map[];
7111};
7112
7113/**
7114 * struct ndp_schedule_update_req - ndp schedule update request
7115 * @transaction_id: unique identifier
7116 * @vdev_id: session id of the interface over which ndp is being created
7117 * @ndp_instance_id: ndp instance id for which schedule update is requested
7118 * @ndp_qos: new set of qos parameters
7119 *
7120 */
7121struct ndp_schedule_update_req {
7122 uint32_t transaction_id;
7123 uint32_t vdev_id;
7124 uint32_t ndp_instance_id;
7125 struct ndp_qos_cfg ndp_qos;
7126};
7127
7128/**
7129 * struct ndp_schedule_update_rsp - ndp schedule update response
7130 * @transaction_id: unique identifier
7131 * @vdev_id: session id of the interface over which ndp is being created
7132 * @status: status of the request
7133 * @reason: reason code for failure if any
7134 *
7135 */
7136struct ndp_schedule_update_rsp {
7137 uint32_t transaction_id;
7138 uint32_t vdev_id;
7139 uint32_t status;
7140 uint32_t reason;
7141};
7142
7143/**
7144 * struct sme_ndp_peer_ind - ndp peer indication
7145 * @msg_type: message id
7146 * @msg_len: message length
7147 * @session_id: session id
7148 * @peer_mac_addr: peer mac address
7149 * @sta_id: station id
7150 *
7151 */
7152struct sme_ndp_peer_ind {
7153 uint16_t msg_type;
7154 uint16_t msg_len;
7155 uint8_t session_id;
7156 struct qdf_mac_addr peer_mac_addr;
7157 uint16_t sta_id;
7158};
7159
7160#endif /* WLAN_FEATURE_NAN_DATAPATH */
7161
Peng Xu8fdaa492016-06-22 10:20:47 -07007162/**
Padma, Santhosh Kumara7119672016-08-16 16:05:14 +05307163 * struct sir_set_tx_rx_aggregation_size - sets tx rx aggregation size
7164 * @vdev_id: vdev id of the session
7165 * @tx_aggregation_size: Tx aggregation size
7166 * @rx_aggregation_size: Rx aggregation size
7167 */
7168struct sir_set_tx_rx_aggregation_size {
7169 uint8_t vdev_id;
7170 uint32_t tx_aggregation_size;
7171 uint32_t rx_aggregation_size;
7172};
7173
7174/**
Peng Xu8fdaa492016-06-22 10:20:47 -07007175 * struct sir_p2p_lo_start - p2p listen offload start
7176 * @vdev_id: vdev identifier
7177 * @ctl_flags: control flag
7178 * @freq: p2p listen frequency
7179 * @period: listen offload period
7180 * @interval: listen offload interval
7181 * @count: number listen offload intervals
7182 * @device_types: device types
7183 * @dev_types_len: device types length
7184 * @probe_resp_tmplt: probe response template
7185 * @probe_resp_len: probe response template length
7186 */
7187struct sir_p2p_lo_start {
7188 uint32_t vdev_id;
7189 uint32_t ctl_flags;
7190 uint32_t freq;
7191 uint32_t period;
7192 uint32_t interval;
7193 uint32_t count;
7194 uint8_t *device_types;
7195 uint32_t dev_types_len;
7196 uint8_t *probe_resp_tmplt;
7197 uint32_t probe_resp_len;
7198};
7199
7200/**
7201 * struct sir_p2p_lo_event - P2P listen offload stop event
7202 * @vdev_id: vdev identifier
7203 * @reason_code: P2P listen offload stop reason
7204 */
7205struct sir_p2p_lo_event {
7206 uint32_t vdev_id;
7207 uint32_t reason_code;
7208};
Manjeet Singhf82ed072016-07-08 11:40:00 +05307209
7210/**
7211 * struct sir_hal_pwr_dbg_cmd - unit test command parameters
7212 * @pdev_id: pdev id
7213 * @module_id: module id
7214 * @num_args: number of arguments
7215 * @args: arguments
7216 */
7217struct sir_mac_pwr_dbg_cmd {
7218 uint32_t pdev_id;
7219 uint32_t module_id;
7220 uint32_t num_args;
7221 uint32_t args[MAX_POWER_DBG_ARGS_SUPPORTED];
7222};
7223
Kondabattini, Ganesh3f2d02c2016-09-13 12:23:47 +05307224/**
7225 * struct sme_send_disassoc_frm_req - send disassoc request frame
7226 * @msg_type: message type
7227 * @length: length of message
7228 * @session_id: session id
7229 * @trans_id: transaction id
7230 * @peer_mac: peer mac address
7231 * @reason: reason for disassoc
7232 * @wait_for_ack: wait for acknowledgment
7233 **/
7234 struct sme_send_disassoc_frm_req {
7235 uint16_t msg_type;
7236 uint16_t length;
7237 uint8_t session_id;
7238 uint16_t trans_id;
7239 uint8_t peer_mac[6];
7240 uint16_t reason;
7241 uint8_t wait_for_ack;
7242 };
7243
Kondabattini, Ganeshe4f18e02016-09-13 13:01:22 +05307244/**
7245 * struct sme_update_access_policy_vendor_ie - update vendor ie and access
7246 * policy
7247 * @msg_type: message id
7248 * @msg_len: message length
7249 * @sme_session_id: sme session id
7250 * @ie: vendor ie
7251 * @access_policy: access policy for vendor ie
7252 */
7253struct sme_update_access_policy_vendor_ie {
7254 uint16_t msg_type;
7255 uint16_t length;
7256 uint32_t sme_session_id;
7257 uint8_t ie[SIR_MAC_MAX_IE_LENGTH];
7258 uint8_t access_policy;
7259};
7260
Padma, Santhosh Kumard7cc0792016-06-28 18:54:12 +05307261/**
7262 * struct sir_encrypt_decrypt_rsp_params - encrypt/decrypt rsp params
7263 * @vdev_id: vdev id
7264 * @status: status
7265 * @data_length: data length
7266 * @data: data pointer
7267 */
7268struct sir_encrypt_decrypt_rsp_params {
7269 uint32_t vdev_id;
7270 int32_t status;
7271 uint32_t data_length;
7272 uint8_t *data;
7273};
7274
Agrawal, Ashish35b251d2016-09-08 19:21:03 +05307275/**
7276 * struct sme_tx_fail_cnt_threshold - tx failure count for disconnect to fw
7277 * @session_id: Session id
7278 * @tx_fail_cnt_threshold: Tx failure count to do disconnect
7279 */
7280struct sme_tx_fail_cnt_threshold {
7281 uint8_t session_id;
7282 uint32_t tx_fail_cnt_threshold;
7283};
Agrawal Ashishda3e9502016-09-21 17:43:51 +05307284
7285/**
7286 * struct sme_short_retry_limit - transmission retry limit for short frames.
7287 * @session_id: Session id
7288 * @short_retry_limit: tranmission retry limit for short frame.
7289 *
7290 */
7291struct sme_short_retry_limit {
7292 uint8_t session_id;
7293 uint32_t short_retry_limit;
7294};
7295
7296/**
7297 * struct sme_long_retry_limit - tranmission retry limit for long frames
7298 * @session_id: Session id
7299 * @short_retry_limit: tranmission retry limit for long frames.
7300 *
7301 */
7302struct sme_long_retry_limit {
7303 uint8_t session_id;
7304 uint32_t long_retry_limit;
7305};
Agrawal, Ashish4e5fa1c2016-09-21 19:03:43 +05307306
7307/**
7308 * struct sme_sta_inactivity_timeout - set sta_inactivity_timeout
7309 * @session_id: session Id.
7310 * @sta_inactivity_timeout: Timeout to disconnect STA after there
7311 * is no activity.
7312 */
7313struct sme_sta_inactivity_timeout {
7314 uint8_t session_id;
7315 uint32_t sta_inactivity_timeout;
7316};
Yingying Tang95409972016-10-20 15:16:15 +08007317
7318/*
7319 * struct wow_pulse_mode - WoW Pulse set cmd struct
7320 * @wow_pulse_enable: enable or disable this feature
7321 * @wow_pulse_pin: GPIO PIN for Pulse
7322 * @wow_pulse_interval_low: Pulse interval low
7323 * @wow_pulse_interval_high: Pulse interval high
7324 *
7325 * SME uses this structure to configure wow pulse info
7326 * and send it to WMA
7327 */
7328struct wow_pulse_mode {
7329 bool wow_pulse_enable;
7330 uint8_t wow_pulse_pin;
7331 uint16_t wow_pulse_interval_high;
7332 uint16_t wow_pulse_interval_low;
7333};
7334
Rajeev Kumare406d652017-01-30 17:47:05 -08007335
7336/**
Rajeev Kumard138ac52017-01-30 18:38:37 -08007337 * umac_send_mb_message_to_mac(): post message to umac
Rajeev Kumare406d652017-01-30 17:47:05 -08007338 * @msg: opaque message pointer
7339 *
7340 * Return: QDF status
7341 */
Rajeev Kumard138ac52017-01-30 18:38:37 -08007342QDF_STATUS umac_send_mb_message_to_mac(void *msg);
Rajeev Kumare406d652017-01-30 17:47:05 -08007343
Kapil Gupta4f0c0c12017-02-07 15:21:15 +05307344/**
7345 * struct scan_chan_info - channel info
7346 * @freq: radio frequence
7347 * @cmd flag: cmd flag
7348 * @noise_floor: noise floor
7349 * @cycle_count: cycle count
7350 * @rx_clear_count: rx clear count
7351 * @tx_frame_count: TX frame count
7352 * @clock_freq: clock frequence MHZ
7353 */
7354struct scan_chan_info {
7355 uint32_t freq;
7356 uint32_t cmd_flag;
7357 uint32_t noise_floor;
7358 uint32_t cycle_count;
7359 uint32_t rx_clear_count;
7360 uint32_t tx_frame_count;
7361 uint32_t clock_freq;
7362};
Dustin Brown54096432017-02-23 13:00:44 -08007363
7364/**
7365 * enum wow_resume_trigger - resume trigger override setting values
7366 * @WOW_RESUME_TRIGGER_DEFAULT: fw to use platform default resume trigger
7367 * @WOW_RESUME_TRIGGER_HTC_WAKEUP: force fw to use HTC Wakeup to resume
7368 * @WOW_RESUME_TRIGGER_GPIO: force fw to use GPIO to resume
7369 * @WOW_RESUME_TRIGGER_COUNT: number of resume trigger options
7370 */
7371enum wow_resume_trigger {
7372 /* always first */
7373 WOW_RESUME_TRIGGER_DEFAULT = 0,
7374 WOW_RESUME_TRIGGER_HTC_WAKEUP,
7375 WOW_RESUME_TRIGGER_GPIO,
7376 /* always last */
7377 WOW_RESUME_TRIGGER_COUNT
7378};
7379
7380/**
7381 * enum wow_interface_pause - interface pause override setting values
7382 * @WOW_INTERFACE_PAUSE_DEFAULT: use platform default interface pause setting
7383 * @WOW_INTERFACE_PAUSE_ENABLE: force interface pause setting to enabled
7384 * @WOW_INTERFACE_PAUSE_DISABLE: force interface pause setting to disabled
7385 * @WOW_INTERFACE_PAUSE_COUNT: number of interface pause options
7386 */
7387enum wow_interface_pause {
7388 /* always first */
7389 WOW_INTERFACE_PAUSE_DEFAULT = 0,
7390 WOW_INTERFACE_PAUSE_ENABLE,
7391 WOW_INTERFACE_PAUSE_DISABLE,
7392 /* always last */
7393 WOW_INTERFACE_PAUSE_COUNT
7394};
7395
7396/**
7397 * struct wow_enable_params - A collection of wow enable override parameters
7398 * @is_unit_test: true to notify fw this is a unit-test suspend
7399 * @interface_pause: used to override the interface pause indication sent to fw
7400 * @resume_trigger: used to force fw to use a particular resume method
7401 */
7402struct wow_enable_params {
7403 bool is_unit_test;
7404 enum wow_interface_pause interface_pause;
7405 enum wow_resume_trigger resume_trigger;
7406};
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07007407
7408#ifdef WLAN_FEATURE_11AX
Naveen Rawatd8feac12017-09-08 15:08:39 -07007409#define HE_CAP_OUI_TYPE "\x23"
7410#define HE_CAP_OUI_SIZE 1
7411#define HE_OP_OUI_TYPE "\x24"
7412#define HE_OP_OUI_SIZE 1
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -08007413
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07007414#define HE_RU_ALLOC_INDX0_MASK (0x01 << 0)
7415#define HE_RU_ALLOC_INDX1_MASK (0x01 << 1)
7416#define HE_RU_ALLOC_INDX2_MASK (0x01 << 2)
7417#define HE_RU_ALLOC_INDX3_MASK (0x01 << 3)
7418
7419/* 3 bits for NSS and 4 bits for RU Index */
7420#define HE_PPET_NSS_LEN 3
7421#define HE_PEPT_RU_IDX_LEN 4
7422#define HE_PPET_NSS_RU_LEN (HE_PPET_NSS_LEN + HE_PEPT_RU_IDX_LEN)
7423#define HE_PPET_SIZE 3
7424#define HE_BYTE_SIZE 8
7425
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -08007426#define HE_MAX_PHY_CAP_SIZE 3
7427
Naveen Rawataeca1b92017-10-16 16:55:31 -07007428#define HE_CH_WIDTH_GET_BIT(ch_wd, bit) (((ch_wd) >> (bit)) & 1)
7429#define HE_CH_WIDTH_COMBINE(b0, b1, b2, b3, b4, b5, b6) \
7430 ((uint8_t)(b0) | ((b1) << 1) | ((b2) << 2) | ((b3) << 3) | \
7431 ((b4) << 4) | ((b5) << 5) | ((b6) << 6))
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -07007432
Naveen Rawataeca1b92017-10-16 16:55:31 -07007433/*
7434 * MCS values are interpreted as in IEEE 11ax-D1.4 spec onwards
7435 * +-----------------------------------------------------+
7436 * | SS8 | SS7 | SS6 | SS5 | SS4 | SS3 | SS2 | SS1 |
7437 * +-----------------------------------------------------+
7438 * | 15-14 | 13-12 | 11-10 | 9-8 | 7-6 | 5-4 | 3-2 | 1-0 |
7439 * +-----------------------------------------------------+
7440 */
7441#define HE_MCS_NSS_SHIFT(nss) (((nss) - 1) << 1)
7442#define HE_MCS_MSK_4_NSS(nss) (3 << HE_MCS_NSS_SHIFT(nss))
7443#define HE_MCS_INV_MSK_4_NSS(nss) (~HE_MCS_MSK_4_NSS(nss))
7444#define HE_GET_MCS_4_NSS(mcs_set, nss) \
7445 (((mcs_set) >> HE_MCS_NSS_SHIFT(nss)) & 3)
7446#define HE_SET_MCS_4_NSS(mcs_set, mcs, nss) \
7447 (((mcs_set) & HE_MCS_INV_MSK_4_NSS(nss)) | \
7448 ((mcs) << HE_MCS_NSS_SHIFT(nss)))
7449#define HE_MCS_IS_NSS_ENABLED(mcs_set, nss) \
7450 ((HE_MCS_MSK_4_NSS(nss) & (mcs_set)) != HE_MCS_MSK_4_NSS(nss))
7451
7452#define HE_MCS_ALL_DISABLED 0xFFFF
7453/*
7454 * Following formuala has been arrived at using karnaugh map and unit tested
7455 * with sample code. Take MCS for each NSS as 2 bit value first and solve for
7456 * 2 bit intersection of NSS. Use following table/Matrix as guide for solving
7457 * K-Maps
7458 * MCS 1\MCS 2 00 01 10 11
7459 * 00 00 00 00 11
7460 * 01 00 01 01 11
7461 * 10 00 01 10 11
7462 * 11 11 11 11 11
7463 * if output MCS is o1o0, then as per K-map reduction:
7464 * o0 = m1.m0 | n1.n0 | (~m1).m0.(n1^n0) | (~n1).n0.(m1^m0)
7465 * o1 = m1.m0 | n1.n0 | m1.(~m0).n1.(~n0)
7466 *
7467 * Please note: Calculating MCS intersection is 80211 protocol specific and
7468 * should be implemented in PE. WMA can use this macro rather than calling any
7469 * lim API to do the intersection.
7470 */
7471#define HE_INTERSECT_MCS_BITS_PER_NSS(m1, m0, n1, n0) \
7472 (((m1 & m0) | (n1 & n0) | (((~m1) & m0) & (n1 ^ n0)) | \
7473 (((~n1) & n0) & (m1 ^ m0))) | (((m1 & m0) | (n1 & n0) | \
7474 (m1 & ~m0 & n1 & ~n0)) << 1))
7475
7476/* following takes MCS as 2 bits */
7477#define HE_INTERSECT_MCS_PER_NSS(mcs_1, mcs_2) \
7478 HE_INTERSECT_MCS_BITS_PER_NSS((mcs_1 >> 1), (mcs_1 & 1), \
7479 (mcs_2 >> 1), (mcs_2 & 1))
7480
7481/* following takes MCS as 16 bits */
7482#define HE_INTERSECT_MCS(mcs_1, mcs_2) ( \
7483 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 1), \
7484 HE_GET_MCS_4_NSS(mcs_2, 1)) << HE_MCS_NSS_SHIFT(1) | \
7485 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 2), \
7486 HE_GET_MCS_4_NSS(mcs_2, 2)) << HE_MCS_NSS_SHIFT(2) | \
7487 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 3), \
7488 HE_GET_MCS_4_NSS(mcs_2, 3)) << HE_MCS_NSS_SHIFT(3) | \
7489 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 4), \
7490 HE_GET_MCS_4_NSS(mcs_2, 4)) << HE_MCS_NSS_SHIFT(4) | \
7491 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 5), \
7492 HE_GET_MCS_4_NSS(mcs_2, 5)) << HE_MCS_NSS_SHIFT(5) | \
7493 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 6), \
7494 HE_GET_MCS_4_NSS(mcs_2, 6)) << HE_MCS_NSS_SHIFT(6) | \
7495 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 7), \
7496 HE_GET_MCS_4_NSS(mcs_2, 7)) << HE_MCS_NSS_SHIFT(7) | \
7497 HE_INTERSECT_MCS_PER_NSS(HE_GET_MCS_4_NSS(mcs_1, 8), \
7498 HE_GET_MCS_4_NSS(mcs_2, 8)) << HE_MCS_NSS_SHIFT(8))
Krishna Kumaar Natarajand1cd56e2016-09-30 08:43:03 -07007499
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -08007500/**
7501 * struct he_capability - to store 11ax HE capabilities
7502 * @phy_cap: HE PHY capabilities
7503 * @mac_cap: HE MAC capabilities
7504 * @mcs: HE MCS
7505 * @ppet: HE PPE threshold
7506 */
7507struct he_capability {
7508 uint32_t phy_cap[HE_MAX_PHY_CAP_SIZE];
7509 uint32_t mac_cap;
7510 uint32_t mcs;
7511 struct wlan_psoc_host_ppe_threshold ppet;
7512};
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07007513#endif
7514
Naveen Rawataeca1b92017-10-16 16:55:31 -07007515#define HE_GET_NSS(mcs, nss) \
7516 do { \
7517 (nss) = 0; \
Naveen Rawatcbcc6542017-10-30 17:55:03 -07007518 while ((((mcs) >> ((nss)*2)) & 3) != 3 && nss < 8) \
Naveen Rawataeca1b92017-10-16 16:55:31 -07007519 (nss)++; \
7520 } while (0)
7521
Nitesh Shah99dd9552017-03-20 19:27:47 +05307522/**
7523 * struct sir_del_all_tdls_peers - delete all tdls peers
7524 * @msg_type: type of message
7525 * @msg_len: length of message
7526 * @bssid: bssid of peer device
7527 */
7528struct sir_del_all_tdls_peers {
7529 uint16_t msg_type;
7530 uint16_t msg_len;
7531 struct qdf_mac_addr bssid;
7532};
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08007533
Anurag Chouhan3920c0f2017-09-11 17:10:56 +05307534/**
7535 * struct rsp_stats - arp packet stats
7536 * @arp_req_enqueue: fw tx count
7537 * @arp_req_tx_success: tx ack count
7538 * @arp_req_tx_failure: tx ack fail count
7539 * @arp_rsp_recvd: rx fw count
7540 * @out_of_order_arp_rsp_drop_cnt: out of order count
7541 * @dad_detected: dad detected
7542 * @connect_status: connection status
7543 * @ba_session_establishment_status: BA session status
7544 */
7545struct rsp_stats {
7546 uint32_t vdev_id;
7547 uint32_t arp_req_enqueue;
7548 uint32_t arp_req_tx_success;
7549 uint32_t arp_req_tx_failure;
7550 uint32_t arp_rsp_recvd;
7551 uint32_t out_of_order_arp_rsp_drop_cnt;
7552 uint32_t dad_detected;
7553 uint32_t connect_status;
7554 uint32_t ba_session_establishment_status;
7555};
7556
7557/**
7558 * struct set_arp_stats_params - set/reset arp stats
7559 * @vdev_id: session id
7560 * @flag: enable/disable stats
7561 * @pkt_type: type of packet(1 - arp)
7562 * @ip_addr: subnet ipv4 address in case of encrypted packets
7563 */
7564struct set_arp_stats_params {
7565 uint32_t vdev_id;
7566 uint8_t flag;
7567 uint8_t pkt_type;
7568 uint32_t ip_addr;
7569};
7570
7571/**
7572 * struct get_arp_stats_params - get arp stats from firmware
7573 * @pkt_type: packet type(1 - ARP)
7574 * @vdev_id: session id
7575 */
7576struct get_arp_stats_params {
7577 uint8_t pkt_type;
7578 uint32_t vdev_id;
7579};
7580
Rajeev Kumar Sirasanagandla996e5292016-11-22 21:20:33 +05307581typedef void (*sme_rcpi_callback)(void *context, struct qdf_mac_addr mac_addr,
7582 int32_t rcpi, QDF_STATUS status);
7583/**
7584 * struct sme_rcpi_req - structure for querying rcpi info
7585 * @session_id: session for which rcpi is required
7586 * @measurement_type: type of measurement from enum rcpi_measurement_type
7587 * @rcpi_callback: callback function to be invoked for rcpi response
7588 * @rcpi_context: context info for rcpi callback
7589 * @mac_addr: peer addr for which rcpi is required
7590 */
7591struct sme_rcpi_req {
7592 uint32_t session_id;
7593 enum rcpi_measurement_type measurement_type;
7594 sme_rcpi_callback rcpi_callback;
7595 void *rcpi_context;
7596 struct qdf_mac_addr mac_addr;
7597};
7598
Tushnim Bhattacharyya0c4ad2d2017-03-09 15:59:03 -08007599/*
7600 * @SCAN_REJECT_DEFAULT: default value
7601 * @CONNECTION_IN_PROGRESS: connection is in progress
7602 * @REASSOC_IN_PROGRESS: reassociation is in progress
7603 * @EAPOL_IN_PROGRESS: STA/P2P-CLI is in middle of EAPOL/WPS exchange
7604 * @SAP_EAPOL_IN_PROGRESS: SAP/P2P-GO is in middle of EAPOL/WPS exchange
7605 */
7606enum scan_reject_states {
7607 SCAN_REJECT_DEFAULT = 0,
7608 CONNECTION_IN_PROGRESS,
7609 REASSOC_IN_PROGRESS,
7610 EAPOL_IN_PROGRESS,
7611 SAP_EAPOL_IN_PROGRESS,
7612};
Sandeep Puligillaf587adf2017-04-27 19:53:21 -07007613
7614/**
lifeng66831662017-05-19 16:01:35 +08007615 * sir_sme_rx_aggr_hole_ind - sme rx aggr hole indication
7616 * @hole_cnt: num of holes detected
7617 * @hole_info_array: hole info
7618 */
7619struct sir_sme_rx_aggr_hole_ind {
7620 uint32_t hole_cnt;
7621 uint32_t hole_info_array[];
7622};
7623
7624/**
7625 * struct sir_set_rx_reorder_timeout_val - rx reorder timeout
7626 * @rx_timeout_pri: reorder timeout for AC
7627 * rx_timeout_pri[0] : AC_VO
7628 * rx_timeout_pri[1] : AC_VI
7629 * rx_timeout_pri[2] : AC_BE
7630 * rx_timeout_pri[3] : AC_BK
7631 */
7632struct sir_set_rx_reorder_timeout_val {
7633 uint32_t rx_timeout_pri[4];
7634};
7635
7636/**
7637 * struct sir_peer_set_rx_blocksize - set rx blocksize
7638 * @vdev_id: vdev id
7639 * @peer_macaddr: peer mac address
7640 * @rx_block_ack_win_limit: windows size limitation
7641 */
7642struct sir_peer_set_rx_blocksize {
7643 uint32_t vdev_id;
7644 struct qdf_mac_addr peer_macaddr;
7645 uint32_t rx_block_ack_win_limit;
7646};
Abhishek Singhf3756fc2017-06-28 16:04:06 +05307647
7648/**
7649 * struct sir_rssi_disallow_lst - Structure holding Rssi based avoid candidate
7650 * list
7651 * @node: Node pointer
7652 * @bssid: BSSID of the AP
7653 * @retry_delay: Retry delay received during last rejection in ms
7654 * @ expected_rssi: RSSI at which STA can initate
7655 * @time_during_rejection: Timestamp during last rejection in millisec
7656 */
7657struct sir_rssi_disallow_lst {
7658 qdf_list_node_t node;
7659 struct qdf_mac_addr bssid;
7660 uint32_t retry_delay;
7661 int8_t expected_rssi;
7662 qdf_time_t time_during_rejection;
7663};
lifengd217d192017-05-09 19:44:16 +08007664
7665/**
7666 * struct chain_rssi_result - chain rssi result
7667 * @chain_rssi: chain rssi result as dBm unit
7668 */
7669#define CHAIN_RSSI_NUM 8
7670struct chain_rssi_result {
7671 int32_t chain_rssi[CHAIN_RSSI_NUM];
7672};
7673
7674/**
7675 * struct get_chain_rssi_req_params - get chain rssi req params
7676 * @peer_macaddr: specific peer mac address
7677 * @session_id: session id
7678 */
7679struct get_chain_rssi_req_params {
7680 struct qdf_mac_addr peer_macaddr;
7681 uint8_t session_id;
7682};
7683
Ganesh Kondabattini35739572017-06-21 16:26:39 +05307684/*
7685 * struct sir_limit_off_chan - limit off-channel command parameters
7686 * @vdev_id: vdev id
7687 * @is_tos_active: status of the traffic (active/inactive)
7688 * @max_off_chan_time: max allowed off channel time
7689 * @rest_time: home channel time
7690 * @skip_dfs_chans: skip dfs channels during scan
7691 */
7692struct sir_limit_off_chan {
7693 uint8_t vdev_id;
7694 bool is_tos_active;
7695 uint32_t max_off_chan_time;
7696 uint32_t rest_time;
7697 bool skip_dfs_chans;
7698};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08007699#endif /* __SIR_API_H */