blob: 306aad6ed988a4645adec8990adbffbc6ed36943 [file] [log] [blame]
Govind Singh3ddda1f2016-03-09 11:34:12 +05301/*
2 * Copyright (c) 2016 The Linux Foundation. All rights reserved.
3 *
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 contains the API definitions for the Unified Wireless Module
30 * Interface (WMI).
31 */
32
33#ifndef _WMI_UNIFIED_PARAM_H_
34#define _WMI_UNIFIED_PARAM_H_
Govind Singh3ddda1f2016-03-09 11:34:12 +053035#define IEEE80211_ADDR_LEN 6 /* size of 802.11 address */
Govind Singh3ddda1f2016-03-09 11:34:12 +053036#define WMI_MAC_MAX_SSID_LENGTH 32
37#define WMI_SCAN_MAX_NUM_SSID 0x0A
38#define mgmt_tx_dl_frm_len 64
39#define WMI_SMPS_MASK_LOWER_16BITS 0xFF
40#define WMI_SMPS_MASK_UPPER_3BITS 0x7
41#define WMI_SMPS_PARAM_VALUE_S 29
Govind Singhae855362016-03-07 14:24:22 +053042#define WMI_MAX_NUM_ARGS 8
Govind Singhe7b800c2016-03-01 15:30:53 +053043/* The size of the utc time in bytes. */
44#define WMI_SIZE_UTC_TIME (10)
45/* The size of the utc time error in bytes. */
46#define WMI_SIZE_UTC_TIME_ERROR (5)
Govind Singh9bad0002016-03-01 15:54:59 +053047#define WMI_MCC_MIN_CHANNEL_QUOTA 20
48#define WMI_MCC_MAX_CHANNEL_QUOTA 80
49#define WMI_MCC_MIN_NON_ZERO_CHANNEL_LATENCY 30
50#define WMI_BEACON_TX_BUFFER_SIZE (512)
51#define WMI_WIFI_SCANNING_MAC_OUI_LENGTH 3
52#define WMI_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS 64
53#define WMI_RSSI_THOLD_DEFAULT -300
54#define WMI_NLO_FREQ_THRESH 1000
55#define WMI_SEC_TO_MSEC(sec) (sec * 1000)
56#define WMI_MSEC_TO_USEC(msec) (msec * 1000)
57#define WMI_ETH_LEN 64
58#define WMI_QOS_NUM_TSPEC_MAX 2
59#define WMI_QOS_NUM_AC_MAX 4
Govind Singhae855362016-03-07 14:24:22 +053060#define WMI_IPV4_ADDR_LEN 4
61#define WMI_KEEP_ALIVE_NULL_PKT 1
62#define WMI_KEEP_ALIVE_UNSOLICIT_ARP_RSP 2
Himanshu Agarwal9efd9bf2016-03-09 18:49:18 +053063#define WMI_MAC_MAX_KEY_LENGTH 32
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +053064#define WMI_KRK_KEY_LEN 16
65#ifdef WLAN_FEATURE_ROAM_OFFLOAD
66#define WMI_BTK_KEY_LEN 32
67#define WMI_ROAM_R0KH_ID_MAX_LEN 48
68#define WMI_ROAM_SCAN_PSK_SIZE 32
69#endif
70#define WMI_NOISE_FLOOR_DBM_DEFAULT (-96)
Govind Singh89727882016-04-15 13:58:27 +053071#define WMI_MAC_IPV6_ADDR_LEN 16
Govind Singhc7cd2d62016-06-21 14:33:26 +053072#define WMI_OFFLOAD_DISABLE 0
73#define WMI_OFFLOAD_ENABLE 1
Govind Singhfa201d92016-06-08 19:40:11 +053074#ifdef WLAN_NS_OFFLOAD
Govind Singhae855362016-03-07 14:24:22 +053075/* support only one IPv6 offload */
76#define WMI_MAC_NS_OFFLOAD_SIZE 1
77/* Number of target IP V6 addresses for NS offload */
78#define WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA 16
Govind Singhae855362016-03-07 14:24:22 +053079#define WMI_IPV6_ADDR_VALID 1
80#endif /* WLAN_NS_OFFLOAD */
81#define WMI_EXTSCAN_MAX_HOTLIST_SSIDS 8
82#define WMI_ROAM_MAX_CHANNELS 80
Govind Singhd7468a52016-03-09 14:32:57 +053083#ifdef FEATURE_WLAN_EXTSCAN
84#define WMI_MAX_EXTSCAN_MSG_SIZE 1536
85#define WMI_EXTSCAN_REST_TIME 100
86#define WMI_EXTSCAN_MAX_SCAN_TIME 50000
87#define WMI_EXTSCAN_BURST_DURATION 150
88#endif
89#define WMI_SCAN_NPROBES_DEFAULT (2)
90#define WMI_SEC_TO_MSEC(sec) (sec * 1000) /* sec to msec */
91#define WMI_MSEC_TO_USEC(msec) (msec * 1000) /* msec to usec */
92#define WMI_NLO_FREQ_THRESH 1000 /* in MHz */
Govind Singh89727882016-04-15 13:58:27 +053093
94#define MAX_UTF_EVENT_LENGTH 2048
95#define MAX_WMI_UTF_LEN 252
96#define MAX_WMI_QVIT_LEN 252
97#define THERMAL_LEVELS 4
98#define WMI_HOST_BCN_FLT_MAX_SUPPORTED_IES 256
99#define WMI_HOST_BCN_FLT_MAX_ELEMS_IE_LIST \
100 (WMI_HOST_BCN_FLT_MAX_SUPPORTED_IES/32)
101#define LTEU_MAX_BINS 10
102#define ATF_ACTIVED_MAX_CLIENTS 50
103#define ATF_ACTIVED_MAX_ATFGROUPS 8
104#define CTL_5G_SIZE 1536
105#define CTL_2G_SIZE 684
106#define MAX_CTL_SIZE (CTL_5G_SIZE > CTL_2G_SIZE ? CTL_5G_SIZE : CTL_2G_SIZE)
107#define IEEE80211_MICBUF_SIZE (8+8)
108#define IEEE80211_TID_SIZE 17
109#define WME_NUM_AC 4
110#define SMART_ANT_MODE_SERIAL 0
111#define SMART_ANT_MODE_PARALLEL 1
112#define IEEE80211_WEP_NKID 4 /* number of key ids */
113#define WPI_IV_LEN 16
114#define WMI_SCAN_MAX_NUM_BSSID 10
115#define MAX_CHANS 1023
116#define TARGET_OEM_CONFIGURE_LCI 0x0A
117#define RTT_LCI_ALTITUDE_MASK 0x3FFFFFFF
118#define TARGET_OEM_CONFIGURE_LCR 0x09
119#define RTT_TIMEOUT_MS 180
120#define MAX_SUPPORTED_RATES 128
121#define WMI_HOST_MAX_BUFFER_SIZE 1712
Govind Singh41da3152016-05-06 20:20:25 +0530122#define WMI_HAL_MAX_SANTENNA 4
Govind Singh89727882016-04-15 13:58:27 +0530123
Govind Singhec1401a2016-07-08 19:00:56 +0530124#ifdef CONFIG_WIN
125#if ATH_SUPPORT_FIPS
126#define FIPS_ALIGN 4
127#define FIPS_ALIGNTO(__addr, __to) ((((unsigned long int)(__addr)) + (__to) - 1) & ~((__to) - 1))
128#define FIPS_IS_ALIGNED(__addr, __to) (!(((unsigned long int)(__addr)) & ((__to)-1)))
129#endif
130#endif
131
Govind Singh89727882016-04-15 13:58:27 +0530132#define WMI_HOST_F_MS(_v, _f) \
133 (((_v) & (_f)) >> (_f##_S))
134
135#define WMI_HOST_F_RMW(_var, _v, _f) \
136 do { \
137 (_var) &= ~(_f); \
138 (_var) |= (((_v) << (_f##_S)) & (_f)); \
139 } while (0)
140
141/* TXBF capabilities masks */
142#define WMI_HOST_TXBF_CONF_SU_TX_BFEE_S 0
143#define WMI_HOST_TXBF_CONF_SU_TX_BFEE_M 0x1
144#define WMI_HOST_TXBF_CONF_SU_TX_BFEE \
145 (WMI_HOST_TXBF_CONF_SU_TX_BFEE_M << WMI_HOST_TXBF_CONF_SU_TX_BFEE_S)
146#define WMI_HOST_TXBF_CONF_SU_TX_BFEE_GET(x) \
147 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_SU_TX_BFEE)
148#define WMI_HOST_TXBF_CONF_SU_TX_BFEE_SET(x, z) \
149 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_SU_TX_BFEE)
150
151#define WMI_HOST_TXBF_CONF_MU_TX_BFEE_S 1
152#define WMI_HOST_TXBF_CONF_MU_TX_BFEE_M 0x1
153#define WMI_HOST_TXBF_CONF_MU_TX_BFEE \
154 (WMI_HOST_TXBF_CONF_MU_TX_BFEE_M << WMI_HOST_TXBF_CONF_MU_TX_BFEE_S)
155#define WMI_HOST_TXBF_CONF_MU_TX_BFEE_GET(x) \
156 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_MU_TX_BFEE)
157#define WMI_HOST_TXBF_CONF_MU_TX_BFEE_SET(x, z) \
158 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_MU_TX_BFEE)
159
160#define WMI_HOST_TXBF_CONF_SU_TX_BFER_S 2
161#define WMI_HOST_TXBF_CONF_SU_TX_BFER_M 0x1
162#define WMI_HOST_TXBF_CONF_SU_TX_BFER \
163 (WMI_HOST_TXBF_CONF_SU_TX_BFER_M << WMI_HOST_TXBF_CONF_SU_TX_BFER_S)
164#define WMI_HOST_TXBF_CONF_SU_TX_BFER_GET(x) \
165 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_SU_TX_BFER)
166#define WMI_HOST_TXBF_CONF_SU_TX_BFER_SET(x, z) \
167 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_SU_TX_BFER)
168
169#define WMI_HOST_TXBF_CONF_MU_TX_BFER_S 3
170#define WMI_HOST_TXBF_CONF_MU_TX_BFER_M 0x1
171#define WMI_HOST_TXBF_CONF_MU_TX_BFER \
172 (WMI_HOST_TXBF_CONF_MU_TX_BFER_M << WMI_HOST_TXBF_CONF_MU_TX_BFER_S)
173#define WMI_HOST_TXBF_CONF_MU_TX_BFER_GET(x) \
174 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_MU_TX_BFER)
175#define WMI_HOST_TXBF_CONF_MU_TX_BFER_SET(x, z) \
176 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_MU_TX_BFER)
177
178#define WMI_HOST_TXBF_CONF_STS_CAP_S 4
179#define WMI_HOST_TXBF_CONF_STS_CAP_M 0x7
180#define WMI_HOST_TXBF_CONF_STS_CAP \
181 (WMI_HOST_TXBF_CONF_STS_CAP_M << WMI_HOST_TXBF_CONF_STS_CAP_S)
182#define WMI_HOST_TXBF_CONF_STS_CAP_GET(x) \
183 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_STS_CAP);
184#define WMI_HOST_TXBF_CONF_STS_CAP_SET(x, z) \
185 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_STS_CAP)
186
187#define WMI_HOST_TXBF_CONF_IMPLICIT_BF_S 7
188#define WMI_HOST_TXBF_CONF_IMPLICIT_BF_M 0x1
189#define WMI_HOST_TXBF_CONF_IMPLICIT_BF \
190 (WMI_HOST_TXBF_CONF_IMPLICIT_BF_M << WMI_HOST_TXBF_CONF_IMPLICIT_BF_S)
191#define WMI_HOST_TXBF_CONF_IMPLICIT_BF_GET(x) \
192 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_IMPLICIT_BF)
193#define WMI_HOST_TXBF_CONF_IMPLICIT_BF_SET(x, z) \
194 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_IMPLICIT_BF)
195
196#define WMI_HOST_TXBF_CONF_BF_SND_DIM_S 8
197#define WMI_HOST_TXBF_CONF_BF_SND_DIM_M 0x7
198#define WMI_HOST_TXBF_CONF_BF_SND_DIM \
199 (WMI_HOST_TXBF_CONF_BF_SND_DIM_M << WMI_HOST_TXBF_CONF_BF_SND_DIM_S)
200#define WMI_HOST_TXBF_CONF_BF_SND_DIM_GET(x) \
201 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_BF_SND_DIM)
202#define WMI_HOST_TXBF_CONF_BF_SND_DIM_SET(x, z) \
203 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_BF_SND_DIM)
204
205#define WMI_HOST_TPC_RATE_MAX 160
206#define WMI_HOST_TPC_TX_NUM_CHAIN 4
207#define WMI_HOST_RXG_CAL_CHAN_MAX 4
208#define WMI_HOST_MAX_NUM_CHAINS 4
Poddar, Siddarth794b9962016-04-28 15:49:11 +0530209#define WMI_MAX_NUM_OF_RATE_THRESH 4
Govind Singh89727882016-04-15 13:58:27 +0530210
Himanshu Agarwal7e4f4bc2016-03-09 16:49:38 +0530211#include "qdf_atomic.h"
Govind Singhd7468a52016-03-09 14:32:57 +0530212
Govind Singh89727882016-04-15 13:58:27 +0530213#ifdef BIG_ENDIAN_HOST
214 /* This API is used in copying in elements to WMI message,
215 since WMI message uses multilpes of 4 bytes, This API
216 converts length into multiples of 4 bytes, and performs copy
217 */
218#define WMI_HOST_IF_MSG_COPY_CHAR_ARRAY(destp, srcp, len) do { \
219 int j; \
220 u_int32_t *src, *dest; \
221 src = (u_int32_t *)srcp; \
222 dest = (u_int32_t *)destp; \
223 for (j = 0; j < roundup(len, sizeof(u_int32_t))/4; j++) { \
224 *(dest+j) = qdf_le32_to_cpu(*(src+j)); \
225 } \
226} while (0)
227#else
228
229#define WMI_HOST_IF_MSG_COPY_CHAR_ARRAY(destp, srcp, len) OS_MEMCPY(destp,\
230 srcp, len)
231
232#endif
233
234/** macro to convert MAC address from WMI word format to char array */
235#define WMI_HOST_MAC_ADDR_TO_CHAR_ARRAY(pwmi_mac_addr, c_macaddr) do { \
236 (c_macaddr)[0] = ((pwmi_mac_addr)->mac_addr31to0) & 0xff; \
237 (c_macaddr)[1] = (((pwmi_mac_addr)->mac_addr31to0) >> 8) & 0xff; \
238 (c_macaddr)[2] = (((pwmi_mac_addr)->mac_addr31to0) >> 16) & 0xff; \
239 (c_macaddr)[3] = (((pwmi_mac_addr)->mac_addr31to0) >> 24) & 0xff; \
240 (c_macaddr)[4] = ((pwmi_mac_addr)->mac_addr47to32) & 0xff; \
241 (c_macaddr)[5] = (((pwmi_mac_addr)->mac_addr47to32) >> 8) & 0xff; \
242 } while (0)
243
244#define TARGET_INIT_STATUS_SUCCESS 0x0
245#define TARGET_INIT_STATUS_GEN_FAILED 0x1
246#define TARGET_GET_INIT_STATUS_REASON(status) ((status) & 0xffff)
247#define TARGET_GET_INIT_STATUS_MODULE_ID(status) (((status) >> 16) & 0xffff)
Selvaraj, Sridhar0a1427f2016-07-04 21:40:23 +0530248
249#define MAX_ASSOC_IE_LENGTH 1024
Govind Singh89727882016-04-15 13:58:27 +0530250typedef uint32_t TARGET_INIT_STATUS;
251
252typedef enum {
253 WMI_HOST_MODE_11A = 0, /* 11a Mode */
254 WMI_HOST_MODE_11G = 1, /* 11b/g Mode */
255 WMI_HOST_MODE_11B = 2, /* 11b Mode */
256 WMI_HOST_MODE_11GONLY = 3, /* 11g only Mode */
257 WMI_HOST_MODE_11NA_HT20 = 4, /* 11a HT20 mode */
258 WMI_HOST_MODE_11NG_HT20 = 5, /* 11g HT20 mode */
259 WMI_HOST_MODE_11NA_HT40 = 6, /* 11a HT40 mode */
260 WMI_HOST_MODE_11NG_HT40 = 7, /* 11g HT40 mode */
261 WMI_HOST_MODE_11AC_VHT20 = 8,
262 WMI_HOST_MODE_11AC_VHT40 = 9,
263 WMI_HOST_MODE_11AC_VHT80 = 10,
264 WMI_HOST_MODE_11AC_VHT20_2G = 11,
265 WMI_HOST_MODE_11AC_VHT40_2G = 12,
266 WMI_HOST_MODE_11AC_VHT80_2G = 13,
267 WMI_HOST_MODE_11AC_VHT80_80 = 14,
268 WMI_HOST_MODE_11AC_VHT160 = 15,
269 WMI_HOST_MODE_UNKNOWN = 16,
270 WMI_HOST_MODE_MAX = 16
271} WMI_HOST_WLAN_PHY_MODE;
272
273
Gupta, Kapil7b768002016-04-25 19:14:19 +0530274/**
275 * enum wmi_dwelltime_adaptive_mode: dwelltime_mode
276 * @WMI_DWELL_MODE_DEFAULT: Use firmware default mode
277 * @WMI_DWELL_MODE_CONSERVATIVE: Conservative adaptive mode
278 * @WMI_DWELL_MODE_MODERATE: Moderate adaptive mode
279 * @WMI_DWELL_MODE_AGGRESSIVE: Aggressive adaptive mode
280 * @WMI_DWELL_MODE_STATIC: static adaptive mode
281 */
282enum wmi_dwelltime_adaptive_mode {
283 WMI_DWELL_MODE_DEFAULT = 0,
284 WMI_DWELL_MODE_CONSERVATIVE = 1,
285 WMI_DWELL_MODE_MODERATE = 2,
286 WMI_DWELL_MODE_AGGRESSIVE = 3,
287 WMI_DWELL_MODE_STATIC = 4
288};
289
Manishekar Chandrasekaranb8c59382016-04-21 19:16:32 +0530290#define MAX_NUM_CHAN 128
291
Govind Singhc7cd2d62016-06-21 14:33:26 +0530292/* WME stream classes */
Himanshu Agarwal56c292f2016-07-19 15:41:51 +0530293#define WMI_HOST_AC_BE 0 /* best effort */
294#define WMI_HOST_AC_BK 1 /* background */
295#define WMI_HOST_AC_VI 2 /* video */
296#define WMI_HOST_AC_VO 3 /* voice */
Govind Singhc7cd2d62016-06-21 14:33:26 +0530297#define WMI_TID_TO_AC(_tid) (\
Himanshu Agarwal56c292f2016-07-19 15:41:51 +0530298 (((_tid) == 0) || ((_tid) == 3)) ? WMI_HOST_AC_BE : \
299 (((_tid) == 1) || ((_tid) == 2)) ? WMI_HOST_AC_BK : \
300 (((_tid) == 4) || ((_tid) == 5)) ? WMI_HOST_AC_VI : \
301 WMI_HOST_AC_VO)
Govind Singhc7cd2d62016-06-21 14:33:26 +0530302
Govind Singh3ddda1f2016-03-09 11:34:12 +0530303/**
304 * struct vdev_create_params - vdev create cmd parameter
305 * @if_id: interface id
306 * @type: interface type
307 * @subtype: interface subtype
308 */
309struct vdev_create_params {
310 uint8_t if_id;
311 uint32_t type;
312 uint32_t subtype;
Kiran Kumar Lokere0ae9fb92016-05-02 12:32:27 -0700313 uint8_t nss_2g;
314 uint8_t nss_5g;
Govind Singh3ddda1f2016-03-09 11:34:12 +0530315};
316
317/**
318 * struct vdev_delete_params - vdev delete cmd parameter
319 * @if_id: interface id
320 */
321struct vdev_delete_params {
322 uint8_t if_id;
323};
324
325/**
Govind Singh89727882016-04-15 13:58:27 +0530326 * struct channel_param - Channel paramters with all
327 * info required by target.
328 * @chan_id: channel id
329 * @pwr: channel power
330 * @mhz: channel frequency
331 * @half_rate: is half rate
332 * @quarter_rate: is quarter rate
333 * @dfs_set: is dfs channel
334 * @dfs_set_cfreq2: is secondary freq dfs channel
335 * @is_chan_passive: is this passive channel
336 * @allow_ht: HT allowed in chan
337 * @allow_vht: VHT allowed on chan
338 * @phy_mode: phymode (vht80 or ht40 or ...)
339 * @cfreq1: centre frequency on primary
340 * @cfreq2: centre frequency on secondary
341 * @maxpower: max power for channel
342 * @minpower: min power for channel
343 * @maxreqpower: Max regulatory power
344 * @antennamac: Max antenna
345 * @reg_class_id: Regulatory class id.
346 */
347
348struct channel_param {
349 uint8_t chan_id;
350 uint8_t pwr;
351 uint32_t mhz;
352 uint32_t half_rate:1,
353 quarter_rate:1,
354 dfs_set:1,
355 dfs_set_cfreq2:1,
356 is_chan_passive:1,
357 allow_ht:1,
358 allow_vht:1;
359 uint32_t phy_mode;
360 uint32_t cfreq1;
361 uint32_t cfreq2;
362 int8_t maxpower;
363 int8_t minpower;
364 int8_t maxregpower;
365 uint8_t antennamax;
366 uint8_t reg_class_id;
367};
368
369/**
Govind Singh3ddda1f2016-03-09 11:34:12 +0530370 * struct vdev_stop_params - vdev stop cmd parameter
371 * @vdev_id: vdev id
372 */
373struct vdev_stop_params {
374 uint8_t vdev_id;
375};
376
377/**
378 * struct vdev_up_params - vdev up cmd parameter
379 * @vdev_id: vdev id
380 * @assoc_id: association id
381 */
382struct vdev_up_params {
383 uint8_t vdev_id;
384 uint16_t assoc_id;
385};
386
387/**
388 * struct vdev_down_params - vdev down cmd parameter
389 * @vdev_id: vdev id
390 */
391struct vdev_down_params {
392 uint8_t vdev_id;
393};
394
395/**
Himanshu Agarwal7e4f4bc2016-03-09 16:49:38 +0530396 * struct mac_ssid - mac ssid structure
397 * @length:
398 * @mac_ssid[WMI_MAC_MAX_SSID_LENGTH]:
399 */
400struct mac_ssid {
401 uint8_t length;
402 uint8_t mac_ssid[WMI_MAC_MAX_SSID_LENGTH];
403} qdf_packed;
404
405/**
406 * struct vdev_start_params - vdev start cmd parameter
407 * @vdev_id: vdev id
408 * @chan_freq: channel frequency
409 * @chan_mode: channel mode
410 * @band_center_freq1: center freq 1
411 * @band_center_freq2: center freq 2
412 * @flags: flags to set like pmf_enabled etc.
413 * @is_dfs: flag to check if dfs enabled
414 * @beacon_intval: beacon interval
415 * @dtim_period: dtim period
416 * @max_txpow: max tx power
417 * @is_restart: flag to check if it is vdev
418 * @ssid: ssid and ssid length info
419 * @preferred_tx_streams: preferred tx streams
420 * @preferred_rx_streams: preferred rx streams
421 * @intr_update: flag to check if need to update
422 * required wma interface params
423 * @intr_ssid: pointer to wma interface ssid
424 * @intr_flags: poiter to wma interface flags
425 * @requestor_id: to update requestor id
426 * @disable_hw_ack: to update disable hw ack flag
427 * @info: to update channel info
428 * @reg_info_1: to update min power, max power,
429 * reg power and reg class id
430 * @reg_info_2: to update antennamax
Govind Singh89727882016-04-15 13:58:27 +0530431 * @oper_mode: Operating mode
432 * @dfs_pri_multiplier: DFS primary multiplier
433 * allow pulse if they are within multiple of PRI for the radar type
434 * @dot11_mode: Phy mode (VHT20/VHT80...)
435 * @disable_hw_ack: Disable hw ack if chan is dfs channel for cac
436 * @channel_param: Channel params required by target.
Himanshu Agarwal7e4f4bc2016-03-09 16:49:38 +0530437 */
438struct vdev_start_params {
439 uint8_t vdev_id;
440 uint32_t chan_freq;
441 uint32_t chan_mode;
442 uint32_t band_center_freq1;
443 uint32_t band_center_freq2;
444 uint32_t flags;
445 bool is_dfs;
446 uint32_t beacon_intval;
447 uint32_t dtim_period;
448 int32_t max_txpow;
449 bool is_restart;
Siddarth Poddar466963e2016-03-29 15:13:26 +0530450 bool is_half_rate;
451 bool is_quarter_rate;
452 uint32_t dis_hw_ack;
453 uint32_t flag_dfs;
454 uint8_t hidden_ssid;
455 uint8_t pmf_enabled;
Himanshu Agarwal7e4f4bc2016-03-09 16:49:38 +0530456 struct mac_ssid ssid;
Siddarth Poddar466963e2016-03-29 15:13:26 +0530457 uint32_t num_noa_descriptors;
Himanshu Agarwal7e4f4bc2016-03-09 16:49:38 +0530458 uint32_t preferred_rx_streams;
459 uint32_t preferred_tx_streams;
Govind Singh89727882016-04-15 13:58:27 +0530460#ifdef WMI_NON_TLV_SUPPORT
461 uint8_t oper_mode;
462 int32_t dfs_pri_multiplier;
463 uint8_t dot11_mode;
464 uint8_t disable_hw_ack;
465 struct channel_param channel;
466#endif
Himanshu Agarwal7e4f4bc2016-03-09 16:49:38 +0530467};
468
469/**
470 * struct hidden_ssid_vdev_restart_params -
471 * vdev restart cmd parameter
472 * @session_id: session id
473 * @ssid_len: ssid length
474 * @ssid: ssid
475 * @flags: flags
476 * @requestor_id: requestor id
477 * @disable_hw_ack: flag to disable hw ack feature
478 * @mhz: channel frequency
479 * @band_center_freq1: center freq 1
480 * @band_center_freq2: center freq 2
481 * @info: channel info
482 * @reg_info_1: contains min power, max power,
483 * reg power and reg class id
484 * @reg_info_2: contains antennamax
485 * @hidden_ssid_restart_in_progress:
486 * flag to check if restart is in progress
487 */
488struct hidden_ssid_vdev_restart_params {
489 uint8_t session_id;
490 uint32_t ssid_len;
491 uint32_t ssid[8];
492 uint32_t flags;
493 uint32_t requestor_id;
494 uint32_t disable_hw_ack;
495 uint32_t mhz;
496 uint32_t band_center_freq1;
497 uint32_t band_center_freq2;
498 uint32_t info;
499 uint32_t reg_info_1;
500 uint32_t reg_info_2;
501 qdf_atomic_t hidden_ssid_restart_in_progress;
502};
503
504/**
Govind Singh3ddda1f2016-03-09 11:34:12 +0530505 * struct vdev_set_params - vdev set cmd parameter
506 * @if_id: vdev id
507 * @param_id: parameter id
508 * @param_value: parameter value
509 */
510struct vdev_set_params {
511 uint32_t if_id;
512 uint32_t param_id;
513 uint32_t param_value;
514};
515
516/**
Govind Singh89727882016-04-15 13:58:27 +0530517 * struct vdev_install_key_params - vdev key set cmd parameter
518 * @wk_keylen: key length
519 * @wk_flags: key flags
520 * @ic_cipher: cipher
521 * @if_id: vdev id
522 * @is_group_key: Group key
523 * @wk_keyix: key index
524 * @def_keyid: default key index
525 * @wk_keytsc: Key TSC
526 * @wk_keyrsc: key RSC
527 * @key_data: pounter to key data
528 * @force_none: force
529 * @is_host_based_crypt: Host based encrypt
530 * @is_xmit_or_recv_key: xmit or recieve key
531 * @wk_recviv: WAPI recv IV
532 * @wk_txiv: WAPI TX IV
533 */
534struct vdev_install_key_params {
535 uint8_t wk_keylen;
536 uint16_t wk_flags;
537 uint8_t ic_cipher;
538 uint8_t if_id;
539 bool is_group_key;
540 uint16_t wk_keyix;
541 uint8_t def_keyid;
542 uint64_t wk_keytsc;
543 uint64_t *wk_keyrsc;
544 uint8_t *key_data;
545 uint8_t force_none;
546 bool is_host_based_crypt;
547 bool is_xmit_or_recv_key;
548#if ATH_SUPPORT_WAPI
549 uint8_t *wk_recviv;
550 uint32_t *wk_txiv;
551#endif
552};
553
554/**
Govind Singh3ddda1f2016-03-09 11:34:12 +0530555 * struct peer_delete_params - peer delete cmd parameter
556 * @vdev_id: vdev id
557 */
558struct peer_delete_params {
559 uint8_t vdev_id;
560};
561
562/**
563 * struct peer_flush_params - peer flush cmd parameter
564 * @peer_tid_bitmap: peer tid bitmap
565 * @vdev_id: vdev id
566 */
567struct peer_flush_params {
568 uint32_t peer_tid_bitmap;
569 uint8_t vdev_id;
570};
571
572/**
573 * struct peer_set_params - peer set cmd parameter
574 * @param_id: parameter id
575 * @param_value: parameter value
576 * @vdev_id: vdev id
577 */
578struct peer_set_params {
579 uint32_t param_id;
580 uint32_t param_value;
581 uint32_t vdev_id;
582};
583
584/**
585 * struct peer_create_params - peer create cmd parameter
586 * @peer_addr: peer mac addr
587 * @peer_type: peer type
588 * @vdev_id: vdev id
589 */
590struct peer_create_params {
591 const uint8_t *peer_addr;
592 uint32_t peer_type;
593 uint32_t vdev_id;
594};
595
596/**
597 * struct peer_remove_params - peer remove cmd parameter
598 * @bssid: bss id
599 * @vdev_id: vdev id
600 * @roam_synch_in_progress: flag to indicate if roaming is in progress
601 */
602struct peer_remove_params {
603 uint8_t *bssid;
604 uint8_t vdev_id;
605 bool roam_synch_in_progress;
606};
607
608/**
Govind Singh89727882016-04-15 13:58:27 +0530609 * Stats ID enums defined in host
610 */
611typedef enum {
612 WMI_HOST_REQUEST_PEER_STAT = 0x01,
613 WMI_HOST_REQUEST_AP_STAT = 0x02,
614 WMI_HOST_REQUEST_PDEV_STAT = 0x04,
615 WMI_HOST_REQUEST_VDEV_STAT = 0x08,
616 WMI_HOST_REQUEST_BCNFLT_STAT = 0x10,
617 WMI_HOST_REQUEST_VDEV_RATE_STAT = 0x20,
618 WMI_HOST_REQUEST_INST_STAT = 0x40,
619 WMI_HOST_REQUEST_PEER_EXTD_STAT = 0x80,
620 WMI_HOST_REQUEST_VDEV_EXTD_STAT = 0x100,
621} wmi_host_stats_id;
622
623typedef struct {
624 uint16_t cfg_retry_count;
625 uint16_t retry_count;
626} wmi_host_inst_rssi_args;
627
628/**
Govind Singh3ddda1f2016-03-09 11:34:12 +0530629 * struct stats_request_params - stats_request cmd parameter
630 * @stats_id: statistics id
631 * @vdev_id: vdev id
Govind Singh89727882016-04-15 13:58:27 +0530632 * @wmi_host_inst_rssi_args: Instantaneous rssi stats args
Govind Singh3ddda1f2016-03-09 11:34:12 +0530633 */
634struct stats_request_params {
635 uint32_t stats_id;
636 uint32_t vdev_id;
Govind Singh89727882016-04-15 13:58:27 +0530637#ifdef WMI_NON_TLV_SUPPORT
638 wmi_host_inst_rssi_args rssi_args;
639#endif
640};
641
642/**
643 * struct bss_chan_info_request_params - BSS chan info params
644 * @param: parameter value
645 */
646struct bss_chan_info_request_params {
647 uint32_t param;
Govind Singh3ddda1f2016-03-09 11:34:12 +0530648};
649
650/**
651 * struct green_ap_ps_params - green ap ps cmd parameter
652 * @value: parameter value
653 */
654struct green_ap_ps_params {
655 uint32_t value;
656};
657
658/**
659 * struct wow_cmd_params - wow cmd parameter
660 * @enable: wow enable or disable flag
661 * @can_suspend_link: flag to indicate if link can be suspended
662 * @pause_iface_config: interface config
663 */
664struct wow_cmd_params {
665 bool enable;
666 bool can_suspend_link;
667 uint8_t pause_iface_config;
668};
669
670/**
Govind Singh89727882016-04-15 13:58:27 +0530671 * struct wow_add_wakeup_params - wow wakeup parameter
672 * @type: param type
673 */
674struct wow_add_wakeup_params {
675 uint32_t type;
676};
677
678/**
679 * struct wow_add_wakeup_pattern_params - Add WoW pattern params
680 * @pattern_bytes: pointer to pattern bytes
681 * @mask_bytes: pointer to mask bytes
682 * @pattern_len: pattern length
683 * @pattern_id: pattern id
684 */
685struct wow_add_wakeup_pattern_params {
686 uint8_t *pattern_bytes;
687 uint8_t *mask_bytes;
688 uint32_t pattern_len;
689 uint32_t pattern_id;
690};
691
692/**
693 * struct wow_remove_wakeup_pattern params - WoW remove pattern param
694 * @pattern_bytes: pointer to pattern bytes
695 * @mask_bytes: Mask bytes
696 * @pattern_id: pattern identifier
697 */
698struct wow_remove_wakeup_pattern_params {
699 uint32_t *pattern_bytes;
700 uint32_t *mask_bytes;
701 uint32_t pattern_id;
702};
703
704
705/**
Govind Singh3ddda1f2016-03-09 11:34:12 +0530706 * struct packet_enable_params - packet enable cmd parameter
707 * @vdev_id: vdev id
708 * @enable: flag to indicate if parameter can be enabled or disabled
709 */
710struct packet_enable_params {
711 uint8_t vdev_id;
712 bool enable;
713};
714
715/**
716 * struct suspend_params - suspend cmd parameter
717 * @disable_target_intr: disable target interrupt
718 */
719struct suspend_params {
720 uint8_t disable_target_intr;
721};
722
723/**
724 * struct pdev_params - pdev set cmd parameter
725 * @param_id: parameter id
726 * @param_value: parameter value
727 */
728struct pdev_params {
729 uint32_t param_id;
730 uint32_t param_value;
731};
732
733/**
Govind Singh89727882016-04-15 13:58:27 +0530734 * struct beacon_tmpl_params - beacon template cmd parameter
735 * @vdev_id: vdev id
736 * @tim_ie_offset: tim ie offset
737 * @tmpl_len: beacon template length
738 * @tmpl_len_aligned: beacon template alignment
739 * @frm: beacon template parameter
740 */
741struct beacon_tmpl_params {
742 uint8_t vdev_id;
743 uint32_t tim_ie_offset;
744 uint32_t tmpl_len;
745 uint32_t tmpl_len_aligned;
746 uint8_t *frm;
747};
748
Govind Singhfa201d92016-06-08 19:40:11 +0530749#ifdef CONFIG_MCL
Govind Singh89727882016-04-15 13:58:27 +0530750/**
751 * struct beacon_params - beacon cmd parameter
Govind Singh3ddda1f2016-03-09 11:34:12 +0530752 * @vdev_id: vdev id
753 * @tim_ie_offset: tim ie offset
754 * @tmpl_len: beacon template length
755 * @tmpl_len_aligned: beacon template alignment
756 * @frm: beacon template parameter
757 */
758struct beacon_params {
759 uint8_t vdev_id;
760 uint32_t tim_ie_offset;
761 uint32_t tmpl_len;
762 uint32_t tmpl_len_aligned;
763 uint8_t *frm;
764};
Govind Singh89727882016-04-15 13:58:27 +0530765#else
766/**
767 * struct beacon_params - beacon cmd parameter
768 * @vdev_id: vdev id
769 * @beaconInterval: Beacon interval
770 * @wbuf: beacon buffer
771 * @frame_ctrl: frame control field
772 * @bcn_txant: beacon antenna
773 * @is_dtim_count_zero: is it dtim beacon
774 * @is_bitctl_reqd: is Bit control required
775 * @is_high_latency: Is this high latency target
776 */
777struct beacon_params {
778 uint8_t vdev_id;
779 uint16_t beaconInterval;
780 qdf_nbuf_t wbuf;
781 uint16_t frame_ctrl;
782 uint32_t bcn_txant;
783 bool is_dtim_count_zero;
784 bool is_bitctl_reqd;
785 bool is_high_latency;
786};
787#endif
788
789/**
790 * struct bcn_prb_template_params - beacon probe template parameter
791 * @vdev_id: vdev id
792 * @buf_len: Template length
793 * @caps: capabilities field
794 * @erp: ERP field
795 */
796struct bcn_prb_template_params {
797 uint8_t vdev_id;
798 int buf_len;
799 uint16_t caps;
800 uint8_t erp;
801};
802
803#define WMI_MAX_SUPPORTED_RATES 128
804/**
805 * struct target_rate_set - Rate set bitmap
806 * @num_rate: number of rates in rates bitmap
807 * @rates: rates (each 8bit value) packed into a 32 bit word.
808 * the rates are filled from least significant byte to most
809 * significant byte.
810 */
811typedef struct {
812 uint32_t num_rates;
813 uint32_t rates[(WMI_MAX_SUPPORTED_RATES / 4) + 1];
814} target_rate_set;
Govind Singh3ddda1f2016-03-09 11:34:12 +0530815
816/**
Himanshu Agarwal56c292f2016-07-19 15:41:51 +0530817 * struct wmi_host_mac_addr - host mac addr 2 word representation of MAC addr
818 * @mac_addr31to0: upper 4 bytes of MAC address
819 * @mac_addr47to32: lower 2 bytes of MAC address
820 */
821typedef struct {
822 uint32_t mac_addr31to0;
823 uint32_t mac_addr47to32;
824} wmi_host_mac_addr;
825
826/**
Govind Singh3ddda1f2016-03-09 11:34:12 +0530827 * struct peer_assoc_params - peer assoc cmd parameter
828 * @peer_macaddr: peer mac address
829 * @vdev_id: vdev id
830 * @peer_new_assoc: peer association type
831 * @peer_associd: peer association id
832 * @peer_flags: peer flags
833 * @peer_caps: peer capabalities
834 * @peer_listen_intval: peer listen interval
835 * @peer_ht_caps: HT capabalities
836 * @peer_max_mpdu: 0 : 8k , 1 : 16k, 2 : 32k, 3 : 64k
837 * @peer_mpdu_density: 3 : 0~7 : 2^(11nAMPDUdensity -4)
838 * @peer_rate_caps: peer rate capabalities
839 * @peer_nss: peer nss
840 * @peer_phymode: peer phymode
841 * @peer_ht_info: peer HT info
842 * @peer_legacy_rates: peer legacy rates
843 * @peer_ht_rates: peer ht rates
Govind Singh3ddda1f2016-03-09 11:34:12 +0530844 * @rx_max_rate: max rx rates
845 * @rx_mcs_set: rx mcs
846 * @tx_max_rate: max tx rates
847 * @tx_mcs_set: tx mcs
848 * @vht_capable: VHT capabalities
Govind Singh89727882016-04-15 13:58:27 +0530849 * @tx_max_mcs_nss: max tx MCS and NSS
850 * @peer_bw_rxnss_override: Peer BW RX NSS overriden or not.
851 * @is_pmf_enabled: PMF enabled
852 * @is_wme_set: WME enabled
853 * @qos_flag: QoS Flags
854 * @apsd_flag: APSD flags
855 * @ht_flag: HT flags
856 * @bw_40: 40 capabale
857 * @bw_80: 80 capabale
858 * @bw_160: 160 capabale
859 * @stbc_flag: STBC flag
860 * @ldpc_flag: LDPC flag
861 * @static_mimops_flag: statis MIMO PS flags
862 * @dynamic_mimops_flag: Dynamic MIMO PS flags
863 * @spatial_mux_flag: spatial MUX flags
864 * @vht_flag: VHT flags
865 * @vht_ng_flag: VHT on 11N/G flags
866 * @need_ptk_4_way: Needs 4 way handshake
867 * @need_gtk_2_way: Needs 2 way GTK
868 * @auth_flag: Is peer authenticated
869 * @safe_mode_enabled: Safe enabled for this peer
870 * @amsdu_disable: AMSDU disble
871 * @peer_mac: Peer mac address
Govind Singh3ddda1f2016-03-09 11:34:12 +0530872 */
873struct peer_assoc_params {
Himanshu Agarwal56c292f2016-07-19 15:41:51 +0530874 wmi_host_mac_addr peer_macaddr;
Govind Singh3ddda1f2016-03-09 11:34:12 +0530875 uint32_t vdev_id;
876 uint32_t peer_new_assoc;
877 uint32_t peer_associd;
878 uint32_t peer_flags;
879 uint32_t peer_caps;
880 uint32_t peer_listen_intval;
881 uint32_t peer_ht_caps;
882 uint32_t peer_max_mpdu;
883 uint32_t peer_mpdu_density;
884 uint32_t peer_rate_caps;
885 uint32_t peer_nss;
886 uint32_t peer_vht_caps;
887 uint32_t peer_phymode;
888 uint32_t peer_ht_info[2];
Govind Singh89727882016-04-15 13:58:27 +0530889 target_rate_set peer_legacy_rates;
890 target_rate_set peer_ht_rates;
Govind Singh3ddda1f2016-03-09 11:34:12 +0530891 uint32_t rx_max_rate;
892 uint32_t rx_mcs_set;
893 uint32_t tx_max_rate;
894 uint32_t tx_mcs_set;
895 uint8_t vht_capable;
Govind Singh89727882016-04-15 13:58:27 +0530896#ifdef WMI_NON_TLV_SUPPORT
897 uint32_t tx_max_mcs_nss;
898 uint32_t peer_bw_rxnss_override;
899 bool is_pmf_enabled;
900 bool is_wme_set;
901 bool qos_flag;
902 bool apsd_flag;
903 bool ht_flag;
904 bool bw_40;
905 bool bw_80;
906 bool bw_160;
907 bool stbc_flag;
908 bool ldpc_flag;
909 bool static_mimops_flag;
910 bool dynamic_mimops_flag;
911 bool spatial_mux_flag;
912 bool vht_flag;
913 bool vht_ng_flag;
914 bool need_ptk_4_way;
915 bool need_gtk_2_way;
916 bool auth_flag;
917 bool safe_mode_enabled;
918 bool amsdu_disable;
919 /* Use common structure */
920 uint8_t peer_mac[IEEE80211_ADDR_LEN];
921#endif
Govind Singh3ddda1f2016-03-09 11:34:12 +0530922};
923
924/**
925 * struct sta_ps_params - sta ps cmd parameter
926 * @vdev_id: vdev id
927 * @param: sta ps paramter
928 * @value: sta ps parameter value
929 */
930struct sta_ps_params {
931 uint32_t vdev_id;
932 uint32_t param;
933 uint32_t value;
934};
935
936/**
937 * struct ap_ps_params - ap ps cmd parameter
938 * @vdev_id: vdev id
939 * @param: ap ps paramter
940 * @value: ap ps paramter value
941 */
942struct ap_ps_params {
943 uint32_t vdev_id;
944 uint32_t param;
945 uint32_t value;
946};
947
Govind Singh89727882016-04-15 13:58:27 +0530948#define WMI_HOST_SCAN_CHAN_FREQ_SHIFT 0
949#define WMI_HOST_SCAN_CHAN_FREQ_MASK 0xffff
950#define WMI_HOST_SCAN_CHAN_MODE_SHIFT 16
951#define WMI_HOST_SCAN_CHAN_MODE_MASK 0xff
952
Govind Singh3ddda1f2016-03-09 11:34:12 +0530953/**
Govind Singh3ddda1f2016-03-09 11:34:12 +0530954 * struct scan_start_params - start scan cmd parameter
955 * @scan_id: scan id
956 * @scan_req_id: requeted scan id
957 * @vdev_id: vdev id
958 * @scan_priority: scan priority
959 * @notify_scan_events: flag to indicate if scan to be notified
960 * @dwell_time_active: active dwell time
961 * @dwell_time_passive: passive dwell time
962 * @min_rest_time: min rest time
963 * @max_rest_time: max rest time
964 * @repeat_probe_time: repeat probe time
965 * @probe_spacing_time: probe spacing time
966 * @idle_time: idle time
967 * @max_scan_time: max scan time
968 * @probe_delay: probe delay
969 * @scan_ctrl_flags: scan control flag
970 * @burst_duration: burst duration
971 * @num_chan: no of channel
972 * @num_bssid: no of bssid
973 * @num_ssids: no of ssid
974 * @ie_len: ie length
975 * @n_probes: no of probe
976 * @chan_list: channel list
977 * @ie_len_with_pad: ie length with padding
978 * @num_ssid: no of ssid
979 * @sid: pointer to mac_ssid structure
980 * @uie_fieldOffset: ie field offset
981 * @mac_add_bytes: mac address bytes
Govind Singh89727882016-04-15 13:58:27 +0530982 * @is_strict_pscan_en: Is this a strict passive scan
983 * @is_promiscous_mode: Is promiscous mode
984 * @is_phy_error: is Phy error
985 * @add_cck_rates: Add cck rates
986 * @chan_stat_enable: channel stats enabled
987 * @offchan_tx_mgmt: Offchan tx scan
988 * @offchan_tx_data: offchan tx data
989 * @add_bcast_probe_reqd: Add bcast probe request
990 * @bssid_list: Lisst of bssid to scan
991 * @ie_data: IE data buffer pointer
992 * @passive_flag: Is this passive scan
Govind Singh3ddda1f2016-03-09 11:34:12 +0530993 */
994struct scan_start_params {
995 uint32_t scan_id;
996 uint32_t scan_req_id;
997 uint32_t vdev_id;
998 uint32_t scan_priority;
999 uint32_t notify_scan_events;
1000 uint32_t dwell_time_active;
1001 uint32_t dwell_time_passive;
1002 uint32_t min_rest_time;
1003 uint32_t max_rest_time;
1004 uint32_t repeat_probe_time;
1005 uint32_t probe_spacing_time;
1006 uint32_t idle_time;
1007 uint32_t max_scan_time;
1008 uint32_t probe_delay;
1009 uint32_t scan_ctrl_flags;
1010 uint32_t burst_duration;
1011 uint32_t num_chan;
1012 uint32_t num_bssid;
1013 uint32_t num_ssids;
1014 uint32_t ie_len;
1015 uint32_t n_probes;
1016 uint32_t *chan_list;
1017 uint32_t ie_len_with_pad;
1018 struct mac_ssid ssid[WMI_SCAN_MAX_NUM_SSID];
1019 uint8_t *ie_base;
1020 uint16_t uie_fieldOffset;
1021 uint8_t mac_add_bytes[IEEE80211_ADDR_LEN];
Govind Singh89727882016-04-15 13:58:27 +05301022#ifdef WMI_NON_TLV_SUPPORT
1023 bool is_strict_pscan_en;
1024 bool is_promiscous_mode;
1025 bool is_phy_error;
1026 bool add_cck_rates;
1027 bool chan_stat_enable;
1028 bool offchan_tx_mgmt;
1029 bool offchan_tx_data;
1030 bool add_bcast_probe_reqd;
1031 uint8_t bssid_list[WMI_SCAN_MAX_NUM_BSSID][IEEE80211_ADDR_LEN];
1032 uint8_t *ie_data;
1033 int passive_flag;
1034#endif
Govind Singh3ddda1f2016-03-09 11:34:12 +05301035};
1036
1037/**
1038 * struct scan_stop_params - stop scan cmd parameter
1039 * @requestor: scan requestor
1040 * @scan_id: scan id
1041 * @req_type: scan request type
1042 * @vdev_id: vdev id
Govind Singh89727882016-04-15 13:58:27 +05301043 * @all_scans: Stop all scans
1044 * @vap_scans: stop vap scans
1045 * @specific_scan: specific scan
1046 * @flags: scan flags
1047 * @ss_scan_id: ss scan id
Govind Singh3ddda1f2016-03-09 11:34:12 +05301048 */
1049struct scan_stop_params {
1050 uint32_t requestor;
1051 uint32_t scan_id;
1052 uint32_t req_type;
1053 uint32_t vdev_id;
Govind Singh89727882016-04-15 13:58:27 +05301054#ifdef WMI_NON_TLV_SUPPORT
1055 bool all_scans;
1056 bool vap_scans;
1057 bool specific_scan;
1058 uint32_t flags;
1059 uint32_t ss_scan_id;
1060#endif
Govind Singh3ddda1f2016-03-09 11:34:12 +05301061};
1062
1063/**
1064 * struct scan_chan_list_params - scan channel list cmd parameter
1065 * @num_scan_chans: no of scan channels
1066 * @chan_info: pointer to wmi channel info
1067 */
Govind Singhfa201d92016-06-08 19:40:11 +05301068#ifdef CONFIG_MCL
Himanshu Agarwal56c292f2016-07-19 15:41:51 +05301069/* TODO: This needs clean-up based on how its processed. */
1070typedef struct {
1071 /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_channel */
1072 uint32_t tlv_header;
1073 /** primary 20 MHz channel frequency in mhz */
1074 uint32_t mhz;
1075 /** Center frequency 1 in MHz*/
1076 uint32_t band_center_freq1;
1077 /** Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
1078 uint32_t band_center_freq2;
1079 /** channel info described below */
1080 uint32_t info;
1081 /** contains min power, max power, reg power and reg class id. */
1082 uint32_t reg_info_1;
1083 /** contains antennamax */
1084 uint32_t reg_info_2;
1085} wmi_channel_param;
1086
Govind Singh3ddda1f2016-03-09 11:34:12 +05301087struct scan_chan_list_params {
1088 uint8_t num_scan_chans;
Himanshu Agarwal56c292f2016-07-19 15:41:51 +05301089 wmi_channel_param *chan_info;
Govind Singh3ddda1f2016-03-09 11:34:12 +05301090};
Govind Singh89727882016-04-15 13:58:27 +05301091#else
1092/**
1093 * struct scan_chan_list_params - scan channel list cmd parameter
1094 * @num_chan: no of scan channels
1095 * @nallchans: nall chans
1096 * @ch_param: pointer to channel_paramw
1097 */
1098struct scan_chan_list_params {
1099 uint8_t num_chan;
1100 uint16_t nallchans;
1101 struct channel_param ch_param[1];
1102};
1103#endif
Govind Singh3ddda1f2016-03-09 11:34:12 +05301104
1105/**
1106 * struct fw_hang_params - fw hang command parameters
1107 * @type: 0:unused 1: ASSERT, 2:not respond detect command, 3:simulate ep-full
1108 * @delay_time_ms: 0xffffffff means the simulate will delay for random time (0 ~0xffffffff ms)
1109 */
1110struct fw_hang_params {
1111 uint32_t type;
1112 uint32_t delay_time_ms;
1113};
1114
1115/**
1116 * struct pdev_utf_params - pdev utf command parameters
1117 * @utf_payload:
1118 * @len:
Govind Singh89727882016-04-15 13:58:27 +05301119 * @is_ar900b: is it 900b target
Govind Singh3ddda1f2016-03-09 11:34:12 +05301120 */
1121struct pdev_utf_params {
1122 uint8_t *utf_payload;
1123 uint32_t len;
Govind Singh89727882016-04-15 13:58:27 +05301124#ifdef WMI_NON_TLV_SUPPORT
1125 bool is_ar900b;
1126#endif
Govind Singh3ddda1f2016-03-09 11:34:12 +05301127};
1128
Govind Singh89727882016-04-15 13:58:27 +05301129/*Adding this due to dependency on wmi_unified.h
1130 */
1131typedef struct {
1132 uint32_t len;
1133 uint32_t msgref;
1134 uint32_t segmentInfo;
1135} QVIT_SEG_HDR_INFO_STRUCT;
1136
1137struct pdev_qvit_params {
1138 uint8_t *utf_payload;
1139 uint32_t len;
1140};
Govind Singh3ddda1f2016-03-09 11:34:12 +05301141/**
1142 * struct crash_inject - crash inject command parameters
1143 * @type: crash inject type
1144 * @delay_time_ms: time in milliseconds for FW to delay the crash
1145 */
1146struct crash_inject {
1147 uint32_t type;
1148 uint32_t delay_time_ms;
1149};
1150
1151/**
1152 * struct dbglog_params - fw deboglog command parameters
1153 * @param: command parameter
1154 * @val: parameter value
1155 * @module_id_bitmap: fixed length module id bitmap
1156 * @bitmap_len: module id bitmap length
Govind Singh89727882016-04-15 13:58:27 +05301157 * @cfgvalid: cfgvalid
Govind Singh3ddda1f2016-03-09 11:34:12 +05301158 */
1159struct dbglog_params {
1160 uint32_t param;
1161 uint32_t val;
1162 uint32_t *module_id_bitmap;
1163 uint32_t bitmap_len;
Govind Singh89727882016-04-15 13:58:27 +05301164#ifdef WMI_NON_TLV_SUPPORT
1165 uint32_t cfgvalid[2];
1166#endif
Govind Singh3ddda1f2016-03-09 11:34:12 +05301167};
1168
1169/**
1170 * struct seg_hdr_info - header info
1171 * @len: length
1172 * @msgref: message refrence
1173 * @segmentInfo: segment info
1174 * @pad: padding
1175 */
1176struct seg_hdr_info {
1177 uint32_t len;
1178 uint32_t msgref;
1179 uint32_t segmentInfo;
1180 uint32_t pad;
1181};
1182
1183/**
1184 * struct wmi_mgmt_params - wmi mgmt cmd paramters
1185 * @tx_frame: management tx frame
Govind Singh89727882016-04-15 13:58:27 +05301186 * @frm_len: frame length
Govind Singh3ddda1f2016-03-09 11:34:12 +05301187 * @vdev_id: vdev id
1188 * @tx_complete_cb: tx download callback handler
1189 * @tx_ota_post_proc_cb: OTA complition handler
1190 * @chanfreq: channel frequency
1191 * @pdata: frame data
1192 * @wmi_desc: command descriptor
Govind Singh89727882016-04-15 13:58:27 +05301193 * @desc_id: descriptor id relyaed back by target
1194 * @macaddr - macaddr of peer
Govind Singh3ddda1f2016-03-09 11:34:12 +05301195 */
1196struct wmi_mgmt_params {
1197 void *tx_frame;
1198 uint16_t frm_len;
1199 uint8_t vdev_id;
Govind Singh3ddda1f2016-03-09 11:34:12 +05301200 uint16_t chanfreq;
1201 void *pdata;
Govind Singh89727882016-04-15 13:58:27 +05301202 uint16_t desc_id;
1203 uint8_t *macaddr;
Govind Singhd7468a52016-03-09 14:32:57 +05301204 void *qdf_ctx;
Govind Singh3ddda1f2016-03-09 11:34:12 +05301205};
Govind Singhbffe4de2016-02-26 17:50:39 +05301206
1207/**
1208 * struct p2p_ps_params - P2P powersave related params
1209 * @opp_ps: opportunistic power save
1210 * @ctwindow: CT window
1211 * @count: count
1212 * @duration: duration
1213 * @interval: interval
1214 * @single_noa_duration: single shot noa duration
1215 * @ps_selection: power save selection
1216 * @session_id: session id
1217 */
1218struct p2p_ps_params {
1219 uint8_t opp_ps;
1220 uint32_t ctwindow;
1221 uint8_t count;
1222 uint32_t duration;
1223 uint32_t interval;
1224 uint32_t single_noa_duration;
1225 uint8_t ps_selection;
1226 uint8_t session_id;
1227};
1228
1229
1230/**
1231 * struct ta_uapsd_trig_params - uapsd trigger parameter
1232 * @vdevid: vdev id
1233 * @peer_addr: peer address
1234 * @auto_triggerparam: trigger parameters
1235 * @num_ac: no of access category
1236 */
1237struct sta_uapsd_trig_params {
1238 uint32_t vdevid;
1239 uint8_t peer_addr[IEEE80211_ADDR_LEN];
1240 uint8_t *auto_triggerparam;
1241 uint32_t num_ac;
1242};
Govind Singhe7b800c2016-03-01 15:30:53 +05301243
1244/**
1245 * struct ocb_utc_param
1246 * @vdev_id: session id
1247 * @utc_time: number of nanoseconds from Jan 1st 1958
1248 * @time_error: the error in the UTC time. All 1's for unknown
1249 */
1250struct ocb_utc_param {
1251 uint32_t vdev_id;
1252 uint8_t utc_time[WMI_SIZE_UTC_TIME];
1253 uint8_t time_error[WMI_SIZE_UTC_TIME_ERROR];
1254};
1255
1256/**
1257 * struct ocb_timing_advert_param
1258 * @vdev_id: session id
1259 * @chan_freq: frequency on which to advertise
1260 * @repeat_rate: the number of times it will send TA in 5 seconds
1261 * @timestamp_offset: offset of the timestamp field in the TA frame
1262 * @time_value_offset: offset of the time_value field in the TA frame
1263 * @template_length: size in bytes of the TA frame
1264 * @template_value: the TA frame
1265 */
1266struct ocb_timing_advert_param {
1267 uint32_t vdev_id;
1268 uint32_t chan_freq;
1269 uint32_t repeat_rate;
1270 uint32_t timestamp_offset;
1271 uint32_t time_value_offset;
1272 uint32_t template_length;
1273 uint8_t *template_value;
1274};
1275
1276/**
1277 * struct dcc_get_stats_param
1278 * @vdev_id: session id
1279 * @channel_count: number of dcc channels
1280 * @request_array_len: size in bytes of the request array
1281 * @request_array: the request array
1282 */
1283struct dcc_get_stats_param {
1284 uint32_t vdev_id;
1285 uint32_t channel_count;
1286 uint32_t request_array_len;
1287 void *request_array;
1288};
1289
1290/**
1291 * struct dcc_update_ndl_param
1292 * @vdev_id: session id
1293 * @channel_count: number of channels to be updated
1294 * @dcc_ndl_chan_list_len: size in bytes of the ndl_chan array
1295 * @dcc_ndl_chan_list: the ndl_chan array
1296 * @dcc_ndl_active_state_list_len: size in bytes of the active_state array
1297 * @dcc_ndl_active_state_list: the active state array
1298 */
1299struct dcc_update_ndl_param {
1300 uint32_t vdev_id;
1301 uint32_t channel_count;
1302 uint32_t dcc_ndl_chan_list_len;
1303 void *dcc_ndl_chan_list;
1304 uint32_t dcc_ndl_active_state_list_len;
1305 void *dcc_ndl_active_state_list;
1306};
1307
1308/**
1309 * struct ocb_config_sched
1310 * @chan_freq: frequency of the channel
1311 * @total_duration: duration of the schedule
1312 * @guard_interval: guard interval on the start of the schedule
1313 */
1314struct ocb_config_sched {
1315 uint32_t chan_freq;
1316 uint32_t total_duration;
1317 uint32_t guard_interval;
1318};
1319
1320/**
1321 * OCB structures
1322 */
1323
1324#define WMI_NUM_AC (4)
1325#define WMI_OCB_CHANNEL_MAX (5)
1326#define WMI_MAX_NUM_AC 4
1327struct wmi_ocb_qos_params {
1328 uint8_t aifsn;
1329 uint8_t cwmin;
1330 uint8_t cwmax;
1331};
1332/**
1333 * struct ocb_config_channel
1334 * @chan_freq: frequency of the channel
1335 * @bandwidth: bandwidth of the channel, either 10 or 20 MHz
1336 * @mac_address: MAC address assigned to this channel
1337 * @qos_params: QoS parameters
1338 * @max_pwr: maximum transmit power of the channel (dBm)
1339 * @min_pwr: minimum transmit power of the channel (dBm)
1340 * @reg_pwr: maximum transmit power specified by the regulatory domain (dBm)
1341 * @antenna_max: maximum antenna gain specified by the regulatory domain (dB)
1342 */
1343struct ocb_config_channel {
1344 uint32_t chan_freq;
1345 uint32_t bandwidth;
Govind Singhd7468a52016-03-09 14:32:57 +05301346 struct qdf_mac_addr mac_address;
Govind Singhe7b800c2016-03-01 15:30:53 +05301347 struct wmi_ocb_qos_params qos_params[WMI_MAX_NUM_AC];
1348 uint32_t max_pwr;
1349 uint32_t min_pwr;
1350 uint8_t reg_pwr;
1351 uint8_t antenna_max;
1352 uint16_t flags;
1353};
1354
1355/**
1356 * struct ocb_config_param
1357 * @session_id: session id
1358 * @channel_count: number of channels
1359 * @schedule_size: size of the channel schedule
1360 * @flags: reserved
1361 * @channels: array of OCB channels
1362 * @schedule: array of OCB schedule elements
1363 * @dcc_ndl_chan_list_len: size of the ndl_chan array
1364 * @dcc_ndl_chan_list: array of dcc channel info
1365 * @dcc_ndl_active_state_list_len: size of the active state array
1366 * @dcc_ndl_active_state_list: array of active states
1367 * @adapter: the OCB adapter
1368 * @dcc_stats_callback: callback for the response event
1369 */
1370struct ocb_config_param {
1371 uint8_t session_id;
1372 uint32_t channel_count;
1373 uint32_t schedule_size;
1374 uint32_t flags;
1375 struct ocb_config_channel *channels;
1376 struct ocb_config_sched *schedule;
1377 uint32_t dcc_ndl_chan_list_len;
1378 void *dcc_ndl_chan_list;
1379 uint32_t dcc_ndl_active_state_list_len;
1380 void *dcc_ndl_active_state_list;
1381};
Govind Singh9bad0002016-03-01 15:54:59 +05301382
Poddar, Siddarth794b9962016-04-28 15:49:11 +05301383enum wmi_peer_rate_report_cond_phy_type {
1384 WMI_PEER_RATE_REPORT_COND_11B = 0,
1385 WMI_PEER_RATE_REPORT_COND_11A_G,
1386 WMI_PEER_RATE_REPORT_COND_11N,
1387 WMI_PEER_RATE_REPORT_COND_11AC,
1388 WMI_PEER_RATE_REPORT_COND_MAX_NUM
1389};
1390
1391/**
1392 * struct report_rate_delta - peer specific parameters
1393 * @percent: percentage
1394 * @delta_min: rate min delta
1395 */
1396struct report_rate_delta {
Himanshu Agarwal56c292f2016-07-19 15:41:51 +05301397 uint32_t percent; /* in unit of 12.5% */
1398 uint32_t delta_min; /* in unit of Mbps */
Poddar, Siddarth794b9962016-04-28 15:49:11 +05301399};
1400
1401/**
1402 * struct report_rate_per_phy - per phy report parameters
1403 * @cond_flags: condition flag val
1404 * @delta: rate delta
1405 * @report_rate_threshold: rate threshold
1406 */
1407struct report_rate_per_phy {
1408 /*
1409 * PEER_RATE_REPORT_COND_FLAG_DELTA,
1410 * PEER_RATE_REPORT_COND_FLAG_THRESHOLD
1411 * Any of these two conditions or both of
1412 * them can be set.
1413 */
Himanshu Agarwal56c292f2016-07-19 15:41:51 +05301414 uint32_t cond_flags;
Poddar, Siddarth794b9962016-04-28 15:49:11 +05301415 struct report_rate_delta delta;
1416 /*
1417 * In unit of Mbps. There are at most 4 thresholds
1418 * If the threshold count is less than 4, set zero to
1419 * the one following the last threshold
1420 */
Himanshu Agarwal56c292f2016-07-19 15:41:51 +05301421 uint32_t report_rate_threshold[WMI_MAX_NUM_OF_RATE_THRESH];
Poddar, Siddarth794b9962016-04-28 15:49:11 +05301422};
1423
1424/**
1425 * struct peer_rate_report_params - peer rate report parameters
1426 * @rate_report_enable: enable rate report param
1427 * @backoff_time: backoff time
1428 * @timer_period: timer
1429 * @report_per_phy: report per phy type
1430 */
1431struct wmi_peer_rate_report_params {
Himanshu Agarwal56c292f2016-07-19 15:41:51 +05301432 uint32_t rate_report_enable;
1433 uint32_t backoff_time; /* in unit of msecond */
1434 uint32_t timer_period; /* in unit of msecond */
Poddar, Siddarth794b9962016-04-28 15:49:11 +05301435 /*
1436 *In the following field, the array index means the phy type,
1437 * please see enum wmi_peer_rate_report_cond_phy_type for detail
1438 */
1439 struct report_rate_per_phy report_per_phy[
1440 WMI_PEER_RATE_REPORT_COND_MAX_NUM];
1441
1442};
1443
Govind Singh9bad0002016-03-01 15:54:59 +05301444/**
1445 * struct t_thermal_cmd_params - thermal command parameters
1446 * @min_temp: minimum temprature
1447 * @max_temp: maximum temprature
1448 * @thermal_enable: thermal enable
1449 */
1450struct thermal_cmd_params {
1451 uint16_t min_temp;
1452 uint16_t max_temp;
1453 uint8_t thermal_enable;
1454};
1455
1456#define WMI_LRO_IPV4_SEED_ARR_SZ 5
1457#define WMI_LRO_IPV6_SEED_ARR_SZ 11
1458
1459/**
1460 * struct wmi_lro_config_cmd_t - set LRO init parameters
1461 * @lro_enable: indicates whether lro is enabled
1462 * @tcp_flag: If the TCP flags from the packet do not match
1463 * the values in this field after masking with TCP flags mask
1464 * below, packet is not LRO eligible
1465 * @tcp_flag_mask: field for comparing the TCP values provided
1466 * above with the TCP flags field in the received packet
1467 * @toeplitz_hash_ipv4: contains seed needed to compute the flow id
1468 * 5-tuple toeplitz hash for ipv4 packets
1469 * @toeplitz_hash_ipv6: contains seed needed to compute the flow id
1470 * 5-tuple toeplitz hash for ipv6 packets
1471 */
1472struct wmi_lro_config_cmd_t {
1473 uint32_t lro_enable;
1474 uint32_t tcp_flag:9,
1475 tcp_flag_mask:9;
1476 uint32_t toeplitz_hash_ipv4[WMI_LRO_IPV4_SEED_ARR_SZ];
1477 uint32_t toeplitz_hash_ipv6[WMI_LRO_IPV6_SEED_ARR_SZ];
1478};
Govind Singhae855362016-03-07 14:24:22 +05301479
1480/**
1481 * struct gtx_config_t - GTX config
1482 * @gtx_rt_mask: for HT and VHT rate masks
1483 * @gtx_usrcfg: host request for GTX mask
1484 * @gtx_threshold: PER Threshold (default: 10%)
1485 * @gtx_margin: PER margin (default: 2%)
1486 * @gtx_tcpstep: TCP step (default: 1)
1487 * @gtx_tpcMin: TCP min (default: 5)
1488 * @gtx_bwmask: BW mask (20/40/80/160 Mhz)
1489 */
1490struct wmi_gtx_config {
1491 uint32_t gtx_rt_mask[2];
1492 uint32_t gtx_usrcfg;
1493 uint32_t gtx_threshold;
1494 uint32_t gtx_margin;
1495 uint32_t gtx_tpcstep;
1496 uint32_t gtx_tpcmin;
1497 uint32_t gtx_bwmask;
1498};
1499
1500/**
1501 * struct wmi_probe_resp_params - send probe response parameters
1502 * @bssId: BSSID
1503 * @pProbeRespTemplate: probe response template
1504 * @probeRespTemplateLen: probe response template length
1505 * @ucProxyProbeReqValidIEBmap: valid IE bitmap
1506 */
1507struct wmi_probe_resp_params {
Govind Singh8675b862016-03-28 22:09:18 +05301508 uint8_t bssId[IEEE80211_ADDR_LEN];
Govind Singhae855362016-03-07 14:24:22 +05301509 uint8_t *pProbeRespTemplate;
1510 uint32_t probeRespTemplateLen;
1511 uint32_t ucProxyProbeReqValidIEBmap[8];
1512};
1513
Himanshu Agarwal9efd9bf2016-03-09 18:49:18 +05301514/* struct set_key_params: structure containing
1515 * installation key parameters
1516 * @vdev_id: vdev id
1517 * @key_len: key length
1518 * @key_idx: key index
1519 * @peer_mac: peer mac address
1520 * @key_flags: key flags, 0:pairwise key, 1:group key, 2:static key
1521 * @key_cipher: key cipher based on security mode
1522 * @key_txmic_len: tx mic length
1523 * @key_rxmic_len: rx mic length
1524 * @rx_iv: receive IV, applicable only in case of WAPI
1525 * @tx_iv: transmit IV, applicable only in case of WAPI
1526 * @key_data: key data
1527 */
1528struct set_key_params {
1529 uint8_t vdev_id;
1530 uint16_t key_len;
1531 uint32_t key_idx;
1532 uint8_t peer_mac[IEEE80211_ADDR_LEN];
1533 uint32_t key_flags;
1534 uint32_t key_cipher;
1535 uint32_t key_txmic_len;
1536 uint32_t key_rxmic_len;
1537#ifdef FEATURE_WLAN_WAPI
1538 uint8_t rx_iv[16];
1539 uint8_t tx_iv[16];
1540#endif
1541 uint8_t key_data[WMI_MAC_MAX_KEY_LENGTH];
1542};
1543
Govind Singhae855362016-03-07 14:24:22 +05301544/**
1545 * struct sta_params - sta keep alive parameters
1546 * @vdev_id: vdev id
1547 * @method: keep alive method
1548 * @timeperiod: time to keep alive
1549 * @hostv4addr: host ipv4 address
1550 * @destv4addr: destination ipv4 address
1551 * @destmac: destination mac address
1552 */
1553struct sta_params {
1554 uint8_t vdev_id;
1555 uint32_t method;
1556 uint32_t timeperiod;
1557 uint8_t *hostv4addr;
1558 uint8_t *destv4addr;
1559 uint8_t *destmac;
1560};
1561
1562/**
1563 * struct gateway_update_req_param - gateway parameter update request
1564 * @request_id: request id
1565 * @session_id: session id
1566 * @max_retries: Max ARP/NS retry attempts
1567 * @timeout: Retry interval
1568 * @ipv4_addr_type: on ipv4 network
1569 * @ipv6_addr_type: on ipv6 network
1570 * @gw_mac_addr: gateway mac addr
1571 * @ipv4_addr: ipv4 addr
1572 * @ipv6_addr: ipv6 addr
1573 */
1574struct gateway_update_req_param {
1575 uint32_t request_id;
1576 uint32_t session_id;
1577 uint32_t max_retries;
1578 uint32_t timeout;
1579 uint32_t ipv4_addr_type;
1580 uint32_t ipv6_addr_type;
Govind Singhd7468a52016-03-09 14:32:57 +05301581 struct qdf_mac_addr gw_mac_addr;
1582 uint8_t ipv4_addr[QDF_IPV4_ADDR_SIZE];
1583 uint8_t ipv6_addr[QDF_IPV6_ADDR_SIZE];
Govind Singhae855362016-03-07 14:24:22 +05301584};
1585
1586/**
1587 * struct rssi_monitor_param - rssi monitoring
1588 * @request_id: request id
1589 * @session_id: session id
1590 * @min_rssi: minimum rssi
1591 * @max_rssi: maximum rssi
1592 * @control: flag to indicate start or stop
1593 */
1594struct rssi_monitor_param {
1595 uint32_t request_id;
1596 uint32_t session_id;
1597 int8_t min_rssi;
1598 int8_t max_rssi;
1599 bool control;
1600};
1601
1602/**
1603 * struct scan_mac_oui - oui paramters
1604 * @oui: oui parameters
1605 */
1606struct scan_mac_oui {
1607 uint8_t oui[WMI_WIFI_SCANNING_MAC_OUI_LENGTH];
1608};
1609
1610#define WMI_PASSPOINT_REALM_LEN 256
1611#define WMI_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM 16
1612#define WMI_PASSPOINT_PLMN_LEN 3
1613/**
1614 * struct wifi_passpoint_network_param - passpoint network block
1615 * @id: identifier of this network block
1616 * @realm: null terminated UTF8 encoded realm, 0 if unspecified
1617 * @roaming_consortium_ids: roaming consortium ids to match, 0s if unspecified
1618 * @plmn: mcc/mnc combination as per rules, 0s if unspecified
1619 */
1620struct wifi_passpoint_network_param {
1621 uint32_t id;
1622 uint8_t realm[WMI_PASSPOINT_REALM_LEN];
1623 int64_t roaming_consortium_ids[WMI_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM];
1624 uint8_t plmn[WMI_PASSPOINT_PLMN_LEN];
1625};
1626
1627/**
1628 * struct wifi_passpoint_req_param - passpoint request
1629 * @request_id: request identifier
1630 * @num_networks: number of networks
1631 * @networks: passpoint networks
1632 */
1633struct wifi_passpoint_req_param {
1634 uint32_t request_id;
1635 uint32_t session_id;
1636 uint32_t num_networks;
1637 struct wifi_passpoint_network_param networks[];
1638};
1639
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05301640/* struct mobility_domain_info - structure containing
1641 * mobility domain info
1642 * @mdie_present: mobility domain present or not
1643 * @mobility_domain: mobility domain
1644 */
1645struct mobility_domain_info {
1646 uint8_t mdie_present;
1647 uint16_t mobility_domain;
1648};
1649
Himanshu Agarwal56c292f2016-07-19 15:41:51 +05301650#define WMI_HOST_ROAM_OFFLOAD_NUM_MCS_SET (16)
1651
1652/* This TLV will be filled only in case roam offload
1653 * for wpa2-psk/okc/ese/11r is enabled */
1654typedef struct {
1655 /*
1656 * TLV tag and len; tag equals
1657 * WMITLV_TAG_STRUC_wmi_roam_offload_fixed_param
1658 */
1659 uint32_t tlv_header;
1660 uint32_t rssi_cat_gap; /* gap for every category bucket */
1661 uint32_t prefer_5g; /* prefer select 5G candidate */
1662 uint32_t select_5g_margin;
1663 uint32_t reassoc_failure_timeout; /* reassoc failure timeout */
1664 uint32_t capability;
1665 uint32_t ht_caps_info;
1666 uint32_t ampdu_param;
1667 uint32_t ht_ext_cap;
1668 uint32_t ht_txbf;
1669 uint32_t asel_cap;
1670 uint32_t qos_enabled;
1671 uint32_t qos_caps;
1672 uint32_t wmm_caps;
1673 /* since this is 4 byte aligned, we don't declare it as tlv array */
1674 uint32_t mcsset[WMI_HOST_ROAM_OFFLOAD_NUM_MCS_SET >> 2];
1675} roam_offload_param;
1676
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05301677/* struct roam_offload_scan_params - structure
1678 * containing roaming offload scan parameters
1679 * @is_roam_req_valid: flag to tell whether roam req
1680 * is valid or NULL
1681 * @mode: stores flags for scan
1682 * @vdev_id: vdev id
1683 * @roam_offload_enabled: flag for offload enable
1684 * @psk_pmk: pre shared key/pairwise master key
1685 * @pmk_len: length of PMK
1686 * @prefer_5ghz: prefer select 5G candidate
1687 * @roam_rssi_cat_gap: gap for every category bucket
1688 * @select_5ghz_margin: select 5 Ghz margin
1689 * @krk: KRK
1690 * @btk: BTK
1691 * @reassoc_failure_timeout: reassoc failure timeout
1692 * @rokh_id_length: r0kh id length
1693 * @rokh_id: r0kh id
1694 * @roam_key_mgmt_offload_enabled: roam offload flag
1695 * @auth_mode: authentication mode
1696 * @is_ese_assoc: flag to determine ese assoc
1697 * @mdid: mobility domain info
1698 * @roam_offload_params: roam offload tlv params
1699 */
1700struct roam_offload_scan_params {
1701 uint8_t is_roam_req_valid;
1702 uint32_t mode;
1703 uint32_t vdev_id;
1704#ifdef WLAN_FEATURE_ROAM_OFFLOAD
1705 uint8_t roam_offload_enabled;
1706 uint8_t psk_pmk[WMI_ROAM_SCAN_PSK_SIZE];
1707 uint32_t pmk_len;
1708 uint8_t prefer_5ghz;
1709 uint8_t roam_rssi_cat_gap;
1710 uint8_t select_5ghz_margin;
1711 uint8_t krk[WMI_KRK_KEY_LEN];
1712 uint8_t btk[WMI_BTK_KEY_LEN];
1713 uint32_t reassoc_failure_timeout;
1714 uint32_t rokh_id_length;
1715 uint8_t rokh_id[WMI_ROAM_R0KH_ID_MAX_LEN];
1716 uint8_t roam_key_mgmt_offload_enabled;
1717 int auth_mode;
1718#endif
1719 bool is_ese_assoc;
1720 struct mobility_domain_info mdid;
Govind Singh89727882016-04-15 13:58:27 +05301721#ifndef WMI_NON_TLV_SUPPORT
1722 /* THis is not available in non tlv target.
1723 * please remove this and replace with a host based
1724 * structure */
Himanshu Agarwal56c292f2016-07-19 15:41:51 +05301725 roam_offload_param roam_offload_params;
Govind Singh89727882016-04-15 13:58:27 +05301726#endif
Selvaraj, Sridhar0a1427f2016-07-04 21:40:23 +05301727 uint32_t assoc_ie_length;
1728 uint8_t assoc_ie[MAX_ASSOC_IE_LENGTH];
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05301729};
1730
1731/* struct roam_offload_scan_rssi_params - structure containing
1732 * parameters for roam offload scan based on RSSI
1733 * @rssi_thresh: rssi threshold
1734 * @rssi_thresh_diff: difference in rssi threshold
1735 * @hi_rssi_scan_max_count: 5G scan max count
1736 * @hi_rssi_scan_rssi_delta: 5G scan rssi change threshold value
1737 * @hi_rssi_scan_rssi_ub: 5G scan upper bound
1738 * @raise_rssi_thresh_5g: flag to determine penalty and boost thresholds
1739 * @session_id: vdev id
1740 * @penalty_threshold_5g: RSSI threshold below which 5GHz RSSI is penalized
1741 * @boost_threshold_5g: RSSI threshold above which 5GHz RSSI is favored
1742 * @raise_factor_5g: factor by which 5GHz RSSI is boosted
1743 * @drop_factor_5g: factor by which 5GHz RSSI is penalized
1744 * @max_raise_rssi_5g: maximum boost that can be applied to a 5GHz RSSI
1745 * @max_drop_rssi_5g: maximum penalty that can be applied to a 5GHz RSSI
1746 * @good_rssi_threshold: RSSI below which roam is kicked in by background
1747 * scan although rssi is still good
1748 * @roam_earlystop_thres_min: Minimum RSSI threshold value for early stop,
1749 * unit is dB above NF
1750 * @roam_earlystop_thres_max: Maximum RSSI threshold value for early stop,
1751 * unit is dB above NF
Gupta, Kapil1f4a4c32016-04-12 15:02:00 +05301752 * @dense_rssi_thresh_offset: dense roam RSSI threshold difference
1753 * @dense_min_aps_cnt: dense roam minimum APs
1754 * @initial_dense_status: dense status detected by host
1755 * @traffic_threshold: dense roam RSSI threshold
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05301756 */
1757struct roam_offload_scan_rssi_params {
1758 int8_t rssi_thresh;
1759 uint8_t rssi_thresh_diff;
1760 uint32_t hi_rssi_scan_max_count;
1761 uint32_t hi_rssi_scan_rssi_delta;
1762 int32_t hi_rssi_scan_rssi_ub;
1763 int raise_rssi_thresh_5g;
1764 uint8_t session_id;
1765 uint32_t penalty_threshold_5g;
1766 uint32_t boost_threshold_5g;
1767 uint8_t raise_factor_5g;
1768 uint8_t drop_factor_5g;
1769 int max_raise_rssi_5g;
1770 int max_drop_rssi_5g;
1771 uint32_t good_rssi_threshold;
1772 uint32_t roam_earlystop_thres_min;
1773 uint32_t roam_earlystop_thres_max;
Gupta, Kapil1f4a4c32016-04-12 15:02:00 +05301774 int dense_rssi_thresh_offset;
1775 int dense_min_aps_cnt;
1776 int initial_dense_status;
1777 int traffic_threshold;
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05301778};
1779
Govind Singhae855362016-03-07 14:24:22 +05301780/**
1781 * struct wifi_epno_network - enhanced pno network block
1782 * @ssid: ssid
1783 * @rssi_threshold: threshold for considering this SSID as found, required
1784 * granularity for this threshold is 4dBm to 8dBm
1785 * @flags: WIFI_PNO_FLAG_XXX
1786 * @auth_bit_field: auth bit field for matching WPA IE
1787 */
1788struct wifi_epno_network_params {
1789 struct mac_ssid ssid;
1790 int8_t rssi_threshold;
1791 uint8_t flags;
1792 uint8_t auth_bit_field;
1793};
1794
1795/**
1796 * struct wifi_enhanched_pno_params - enhanced pno network params
1797 * @num_networks: number of ssids
1798 * @networks: PNO networks
1799 */
1800struct wifi_enhanched_pno_params {
1801 uint32_t request_id;
1802 uint32_t session_id;
1803 uint32_t num_networks;
1804 struct wifi_epno_network_params networks[];
1805};
1806
1807enum {
1808 WMI_AP_RX_DATA_OFFLOAD = 0x00,
1809 WMI_STA_RX_DATA_OFFLOAD = 0x01,
1810};
1811
1812/**
Govind Singhc7cd2d62016-06-21 14:33:26 +05301813 * enum extscan_configuration_flags - extscan config flags
1814 * @WMI_EXTSCAN_LP_EXTENDED_BATCHING: extended batching
1815 */
1816enum wmi_extscan_configuration_flags {
1817 WMI_EXTSCAN_LP_EXTENDED_BATCHING = 0x00000001,
1818};
1819
1820/**
Govind Singhae855362016-03-07 14:24:22 +05301821 * enum extscan_report_events_type - extscan report events type
1822 * @EXTSCAN_REPORT_EVENTS_BUFFER_FULL: report only when scan history is % full
1823 * @EXTSCAN_REPORT_EVENTS_EACH_SCAN: report a scan completion event after scan
1824 * @EXTSCAN_REPORT_EVENTS_FULL_RESULTS: forward scan results
1825 * (beacons/probe responses + IEs)
1826 * in real time to HAL, in addition to completion events.
1827 * Note: To keep backward compatibility,
1828 * fire completion events regardless of REPORT_EVENTS_EACH_SCAN.
1829 * @EXTSCAN_REPORT_EVENTS_NO_BATCH: controls batching,
1830 * 0 => batching, 1 => no batching
1831 */
1832enum wmi_extscan_report_events_type {
1833 WMI_EXTSCAN_REPORT_EVENTS_BUFFER_FULL = 0x00,
1834 WMI_EXTSCAN_REPORT_EVENTS_EACH_SCAN = 0x01,
1835 WMI_EXTSCAN_REPORT_EVENTS_FULL_RESULTS = 0x02,
1836 WMI_EXTSCAN_REPORT_EVENTS_NO_BATCH = 0x04,
1837};
1838
1839/**
1840 * struct ipa_offload_control_params - ipa offload parameters
1841 * @offload_type: ipa offload type
1842 * @vdev_id: vdev id
1843 * @enable: ipa offload enable/disable
1844 */
1845struct ipa_offload_control_params {
1846 uint32_t offload_type;
1847 uint32_t vdev_id;
1848 uint32_t enable;
1849};
1850
1851/**
1852 * struct extscan_capabilities_params - ext scan capablities
1853 * @request_id: request_id
1854 * @session_id: session_id
1855 */
1856struct extscan_capabilities_params {
1857 uint32_t request_id;
1858 uint8_t session_id;
1859};
1860
1861/**
1862 * struct extscan_capabilities_reset_params - ext scan capablities reset parameter
1863 * @request_id: request_id
1864 * @session_id: session_id
1865 */
1866struct extscan_capabilities_reset_params {
1867 uint32_t request_id;
1868 uint8_t session_id;
1869};
1870
1871/**
1872 * struct extscan_bssid_hotlist_reset_params - ext scan hotlist reset parameter
1873 * @request_id: request_id
1874 * @session_id: session_id
1875 */
1876struct extscan_bssid_hotlist_reset_params {
1877 uint32_t request_id;
1878 uint8_t session_id;
1879};
1880
1881/**
1882 * struct extscan_stop_req_params - ext scan stop parameter
1883 * @request_id: request_id
1884 * @session_id: session_id
1885 */
1886struct extscan_stop_req_params {
1887 uint32_t request_id;
1888 uint8_t session_id;
1889};
1890
1891/**
1892 * struct ap_threshold_params - ap threshold parameter
1893 * @bssid: mac address
1894 * @low: low threshold
1895 * @high: high threshold
1896 */
1897struct ap_threshold_params {
Govind Singhd7468a52016-03-09 14:32:57 +05301898 struct qdf_mac_addr bssid;
Govind Singhae855362016-03-07 14:24:22 +05301899 int32_t low;
1900 int32_t high;
1901};
1902
1903/**
1904 * struct extscan_set_sig_changereq_params - ext scan channel parameter
1905 * @request_id: mac address
1906 * @session_id: low threshold
1907 * @rssi_sample_size: Number of samples for averaging RSSI
1908 * @lostap_sample_size: Number of missed samples to confirm AP loss
1909 * @min_breaching: Number of APs breaching threshold required for firmware
1910 * @num_ap: no of scanned ap
1911 * @ap: ap threshold parameter
1912 */
1913struct extscan_set_sig_changereq_params {
1914 uint32_t request_id;
1915 uint8_t session_id;
1916 uint32_t rssi_sample_size;
1917 uint32_t lostap_sample_size;
1918 uint32_t min_breaching;
1919 uint32_t num_ap;
1920 struct ap_threshold_params ap[WMI_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS];
1921};
1922
1923/**
1924 * struct extscan_cached_result_params - ext scan cached parameter
1925 * @request_id: mac address
1926 * @session_id: low threshold
1927 * @flush: cached results flush
1928 */
1929struct extscan_cached_result_params {
1930 uint32_t request_id;
1931 uint8_t session_id;
1932 bool flush;
1933};
1934
Govind Singhae855362016-03-07 14:24:22 +05301935/* Set PNO */
1936#define WMI_PNO_MAX_NETW_CHANNELS 26
1937#define WMI_PNO_MAX_NETW_CHANNELS_EX 60
1938#define WMI_PNO_MAX_SUPP_NETWORKS 16
1939
1940/*
1941 * size based of dot11 declaration without extra IEs as we will not carry those
1942 * for PNO
1943 */
1944#define WMI_PNO_MAX_PB_REQ_SIZE 450
1945
1946#define WMI_PNO_24G_DEFAULT_CH 1
1947#define WMI_PNO_5G_DEFAULT_CH 36
1948
1949/**
1950 * enum pno_mode - pno mode types
1951 * @WMI_PNO_MODE_IMMEDIATE: immidiate mode
1952 * @WMI_PNO_MODE_ON_SUSPEND: suspend on mode
1953 * @WMI_PNO_MODE_ON_RESUME: resume on mode
1954 * @WMI_PNO_MODE_MAX: max range
1955 */
1956enum pno_mode {
1957 WMI_PNO_MODE_IMMEDIATE,
1958 WMI_PNO_MODE_ON_SUSPEND,
1959 WMI_PNO_MODE_ON_RESUME,
1960 WMI_PNO_MODE_MAX
1961};
1962
1963/**
1964 * struct pno_nw_type - pno nw type
1965 * @ssid: mac ssid
1966 * @authentication: authentication type
1967 * @encryption: encryption type
1968 * @bcastNetwType: broadcast nw type
1969 * @ucChannelCount: uc channel count
1970 * @aChannels: pno channel
1971 * @rssiThreshold: rssi threshold
1972 */
1973struct pno_nw_type {
1974 struct mac_ssid ssid;
1975 uint32_t authentication;
1976 uint32_t encryption;
1977 uint32_t bcastNetwType;
1978 uint8_t ucChannelCount;
1979 uint8_t aChannels[WMI_PNO_MAX_NETW_CHANNELS_EX];
1980 int32_t rssiThreshold;
1981};
1982
1983/**
1984 * struct pno_scan_req_params - PNO Scan request structure
1985 * @enable: flag to enable or disable
1986 * @modePNO: PNO Mode
1987 * @ucNetworksCount: Number of networks
1988 * @aNetworks: Preferred network list
1989 * @sessionId: Session identifier
1990 * @fast_scan_period: Fast Scan period
1991 * @slow_scan_period: Slow scan period
1992 * @fast_scan_max_cycles: Fast scan max cycles
1993 * @us24GProbeTemplateLen: 2.4G probe template length
1994 * @p24GProbeTemplate: 2.4G probe template
1995 * @us5GProbeTemplateLen: 5G probe template length
1996 * @p5GProbeTemplate: 5G probe template
Gupta, Kapil7b768002016-04-25 19:14:19 +05301997 * @pno_channel_prediction: PNO channel prediction feature status
1998 * @top_k_num_of_channels: top K number of channels are used for tanimoto
1999 * distance calculation.
2000 * @stationary_thresh: threshold value to determine that the STA is stationary.
2001 * @pnoscan_adaptive_dwell_mode: adaptive dwelltime mode for pno scan
2002 * @channel_prediction_full_scan: periodic timer upon which a full scan needs
2003 * to be triggered.
Govind Singhae855362016-03-07 14:24:22 +05302004 */
2005struct pno_scan_req_params {
2006 uint8_t enable;
2007 enum pno_mode modePNO;
2008 uint8_t ucNetworksCount;
2009 struct pno_nw_type aNetworks[WMI_PNO_MAX_SUPP_NETWORKS];
2010 uint8_t sessionId;
2011 uint32_t fast_scan_period;
2012 uint32_t slow_scan_period;
2013 uint8_t fast_scan_max_cycles;
2014 uint32_t active_min_time;
2015 uint32_t active_max_time;
2016 uint32_t passive_min_time;
2017 uint32_t passive_max_time;
2018 uint16_t us24GProbeTemplateLen;
2019 uint8_t p24GProbeTemplate[WMI_PNO_MAX_PB_REQ_SIZE];
2020 uint16_t us5GProbeTemplateLen;
2021 uint8_t p5GProbeTemplate[WMI_PNO_MAX_PB_REQ_SIZE];
2022#ifdef FEATURE_WLAN_SCAN_PNO
2023 bool pno_channel_prediction;
2024 uint8_t top_k_num_of_channels;
2025 uint8_t stationary_thresh;
Gupta, Kapil7b768002016-04-25 19:14:19 +05302026 enum wmi_dwelltime_adaptive_mode pnoscan_adaptive_dwell_mode;
Govind Singhae855362016-03-07 14:24:22 +05302027 uint32_t channel_prediction_full_scan;
2028#endif
2029};
2030
Govind Singhae855362016-03-07 14:24:22 +05302031
2032#define WMI_WLAN_EXTSCAN_MAX_CHANNELS 36
2033#define WMI_WLAN_EXTSCAN_MAX_BUCKETS 16
2034#define WMI_WLAN_EXTSCAN_MAX_HOTLIST_APS 128
2035#define WMI_WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS 64
2036#define WMI_EXTSCAN_MAX_HOTLIST_SSIDS 8
2037
2038/**
2039 * struct wifi_scan_channelspec_params - wifi scan channel parameter
2040 * @channel: Frequency in MHz
2041 * @dwellTimeMs: dwell time
2042 * @flush: cached results flush
2043 * @passive: passive scan
2044 * @chnlClass: channel class
2045 */
2046struct wifi_scan_channelspec_params {
2047 uint32_t channel;
2048 uint32_t dwellTimeMs;
2049 bool passive;
2050 uint8_t chnlClass;
2051};
2052
2053/**
2054 * enum wmi_wifi_band - wifi band
2055 * @WMI_WIFI_BAND_UNSPECIFIED: unspecified band
2056 * @WMI_WIFI_BAND_BG: 2.4 GHz
2057 * @WMI_WIFI_BAND_A: 5 GHz without DFS
2058 * @WMI_WIFI_BAND_ABG: 2.4 GHz + 5 GHz; no DFS
2059 * @WMI_WIFI_BAND_A_DFS_ONLY: 5 GHz DFS only
2060 * @WMI_WIFI_BAND_A_WITH_DFS: 5 GHz with DFS
2061 * @WMI_WIFI_BAND_ABG_WITH_DFS: 2.4 GHz + 5 GHz with DFS
2062 * @WMI_WIFI_BAND_MAX: max range
2063 */
2064enum wmi_wifi_band {
2065 WMI_WIFI_BAND_UNSPECIFIED,
2066 WMI_WIFI_BAND_BG = 1,
2067 WMI_WIFI_BAND_A = 2,
2068 WMI_WIFI_BAND_ABG = 3,
2069 WMI_WIFI_BAND_A_DFS_ONLY = 4,
2070 /* 5 is reserved */
2071 WMI_WIFI_BAND_A_WITH_DFS = 6,
2072 WMI_WIFI_BAND_ABG_WITH_DFS = 7,
2073 /* Keep it last */
2074 WMI_WIFI_BAND_MAX
2075};
2076
2077/**
2078 * struct wifi_scan_bucket_params - wifi scan bucket spec
2079 * @bucket: bucket identifier
2080 * @band: wifi band
2081 * @period: Desired period, in millisecond; if this is too
2082 * low, the firmware should choose to generate results as fast as
2083 * it can instead of failing the command byte
2084 * for exponential backoff bucket this is the min_period
2085 * @reportEvents: 0 => normal reporting (reporting rssi history
2086 * only, when rssi history buffer is % full)
2087 * 1 => same as 0 + report a scan completion event after scanning
2088 * this bucket
2089 * 2 => same as 1 + forward scan results
2090 * (beacons/probe responses + IEs) in real time to HAL
2091 * @max_period: if max_period is non zero or different than period,
2092 * then this bucket is an exponential backoff bucket and
2093 * the scan period will grow exponentially as per formula:
2094 * actual_period(N) = period ^ (N/(step_count+1)) to a
2095 * maximum period of max_period
2096 * @exponent: for exponential back off bucket: multiplier:
2097 * new_period = old_period * exponent
2098 * @step_count: for exponential back off bucket, number of scans performed
2099 * at a given period and until the exponent is applied
2100 * @numChannels: channels to scan; these may include DFS channels
2101 * Note that a given channel may appear in multiple buckets
2102 * @min_dwell_time_active: per bucket minimum active dwell time
2103 * @max_dwell_time_active: per bucket maximum active dwell time
2104 * @min_dwell_time_passive: per bucket minimum passive dwell time
2105 * @max_dwell_time_passive: per bucket maximum passive dwell time
2106 * @channels: Channel list
2107 */
2108struct wifi_scan_bucket_params {
2109 uint8_t bucket;
2110 enum wmi_wifi_band band;
2111 uint32_t period;
2112 uint32_t reportEvents;
2113 uint32_t max_period;
2114 uint32_t exponent;
2115 uint32_t step_count;
2116 uint32_t numChannels;
2117 uint32_t min_dwell_time_active;
2118 uint32_t max_dwell_time_active;
2119 uint32_t min_dwell_time_passive;
2120 uint32_t max_dwell_time_passive;
2121 struct wifi_scan_channelspec_params channels[WMI_WLAN_EXTSCAN_MAX_CHANNELS];
2122};
2123
2124/**
2125 * struct wifi_scan_cmd_req_params - wifi scan command request params
2126 * @basePeriod: base timer period
2127 * @maxAPperScan: max ap per scan
2128 * @report_threshold_percent: report threshold
2129 * in %, when buffer is this much full, wake up host
2130 * @report_threshold_num_scans: report threshold number of scans
2131 * in number of scans, wake up host after these many scans
2132 * @requestId: request id
2133 * @sessionId: session id
2134 * @numBuckets: number of buckets
2135 * @min_dwell_time_active: per bucket minimum active dwell time
2136 * @max_dwell_time_active: per bucket maximum active dwell time
2137 * @min_dwell_time_passive: per bucket minimum passive dwell time
2138 * @max_dwell_time_passive: per bucket maximum passive dwell time
2139 * @configuration_flags: configuration flags
Gupta, Kapil7b768002016-04-25 19:14:19 +05302140 * @extscan_adaptive_dwell_mode: adaptive dwelltime mode for extscan
Govind Singhae855362016-03-07 14:24:22 +05302141 * @buckets: buckets array
2142 */
2143struct wifi_scan_cmd_req_params {
2144 uint32_t basePeriod;
2145 uint32_t maxAPperScan;
2146
2147 uint32_t report_threshold_percent;
2148 uint32_t report_threshold_num_scans;
2149
2150 uint32_t requestId;
2151 uint8_t sessionId;
2152 uint32_t numBuckets;
2153
2154 uint32_t min_dwell_time_active;
2155 uint32_t max_dwell_time_active;
2156 uint32_t min_dwell_time_passive;
2157 uint32_t max_dwell_time_passive;
2158 uint32_t configuration_flags;
Gupta, Kapil7b768002016-04-25 19:14:19 +05302159 enum wmi_dwelltime_adaptive_mode extscan_adaptive_dwell_mode;
Govind Singhae855362016-03-07 14:24:22 +05302160 struct wifi_scan_bucket_params buckets[WMI_WLAN_EXTSCAN_MAX_BUCKETS];
2161};
2162
Govind Singhae855362016-03-07 14:24:22 +05302163#define WMI_CFG_VALID_CHANNEL_LIST_LEN 100
Govind Singhc7cd2d62016-06-21 14:33:26 +05302164/* Occupied channel list remains static */
2165#define WMI_CHANNEL_LIST_STATIC 1
2166/* Occupied channel list can be learnt after init */
2167#define WMI_CHANNEL_LIST_DYNAMIC_INIT 2
2168/* Occupied channel list can be learnt after flush */
2169#define WMI_CHANNEL_LIST_DYNAMIC_FLUSH 3
2170/* Occupied channel list can be learnt after update */
2171#define WMI_CHANNEL_LIST_DYNAMIC_UPDATE 4
Govind Singhae855362016-03-07 14:24:22 +05302172
2173/**
2174 * struct plm_req_params - plm req parameter
2175 * @diag_token: Dialog token
2176 * @meas_token: measurement token
2177 * @num_bursts: total number of bursts
2178 * @burst_int: burst interval in seconds
2179 * @meas_duration:in TU's,STA goes off-ch
2180 * @burst_len: no of times the STA should cycle through PLM ch list
2181 * @desired_tx_pwr: desired tx power
2182 * @mac_addr: MC dest addr
2183 * @plm_num_ch: channel numbers
2184 * @plm_ch_list: channel list
2185 * @session_id: session id
2186 * @enable: enable/disable
2187 */
2188struct plm_req_params {
2189 uint16_t diag_token;
2190 uint16_t meas_token;
2191 uint16_t num_bursts;
2192 uint16_t burst_int;
2193 uint16_t meas_duration;
2194 /* no of times the STA should cycle through PLM ch list */
2195 uint8_t burst_len;
2196 int8_t desired_tx_pwr;
Govind Singhd7468a52016-03-09 14:32:57 +05302197 struct qdf_mac_addr mac_addr;
Govind Singhae855362016-03-07 14:24:22 +05302198 /* no of channels */
2199 uint8_t plm_num_ch;
2200 /* channel numbers */
2201 uint8_t plm_ch_list[WMI_CFG_VALID_CHANNEL_LIST_LEN];
2202 uint8_t session_id;
2203 bool enable;
2204};
Naveen Rawatd5ffe152016-04-14 23:42:46 -07002205
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05302206#define MAX_SSID_ALLOWED_LIST 4
2207#define MAX_BSSID_AVOID_LIST 16
2208#define MAX_BSSID_FAVORED 16
Govind Singhae855362016-03-07 14:24:22 +05302209
2210
2211/**
2212 * struct mac_ts_info_tfc - mac ts info parameters
2213 * @burstSizeDefn: burst size
2214 * @reserved: reserved
2215 * @ackPolicy: ack policy
2216 * @psb: psb
2217 * @aggregation: aggregation
2218 * @accessPolicy: access policy
2219 * @direction: direction
2220 * @tsid: direction
2221 * @trafficType: traffic type
2222 */
2223struct mac_ts_info_tfc {
2224#ifndef ANI_LITTLE_BIT_ENDIAN
2225 uint8_t burstSizeDefn:1;
2226 uint8_t reserved:7;
2227#else
2228 uint8_t reserved:7;
2229 uint8_t burstSizeDefn:1;
2230#endif
2231
2232#ifndef ANI_LITTLE_BIT_ENDIAN
2233 uint16_t ackPolicy:2;
2234 uint16_t userPrio:3;
2235 uint16_t psb:1;
2236 uint16_t aggregation:1;
2237 uint16_t accessPolicy:2;
2238 uint16_t direction:2;
2239 uint16_t tsid:4;
2240 uint16_t trafficType:1;
2241#else
2242 uint16_t trafficType:1;
2243 uint16_t tsid:4;
2244 uint16_t direction:2;
2245 uint16_t accessPolicy:2;
2246 uint16_t aggregation:1;
2247 uint16_t psb:1;
2248 uint16_t userPrio:3;
2249 uint16_t ackPolicy:2;
2250#endif
Govind Singhd7468a52016-03-09 14:32:57 +05302251} qdf_packed;
Govind Singhae855362016-03-07 14:24:22 +05302252
2253/**
2254 * struct mac_ts_info_sch - mac ts info schedule parameters
2255 * @rsvd: reserved
2256 * @schedule: schedule bit
2257 */
2258struct mac_ts_info_sch {
2259#ifndef ANI_LITTLE_BIT_ENDIAN
2260 uint8_t rsvd:7;
2261 uint8_t schedule:1;
2262#else
2263 uint8_t schedule:1;
2264 uint8_t rsvd:7;
2265#endif
Govind Singhd7468a52016-03-09 14:32:57 +05302266} qdf_packed;
Govind Singhae855362016-03-07 14:24:22 +05302267
2268/**
2269 * struct mac_ts_info_sch - mac ts info schedule parameters
2270 * @traffic: mac tfc parameter
2271 * @schedule: mac schedule parameters
2272 */
2273struct mac_ts_info {
2274 struct mac_ts_info_tfc traffic;
2275 struct mac_ts_info_sch schedule;
Govind Singhd7468a52016-03-09 14:32:57 +05302276} qdf_packed;
Govind Singhae855362016-03-07 14:24:22 +05302277
2278/**
2279 * struct mac_tspec_ie - mac ts spec
2280 * @type: type
2281 * @length: length
2282 * @tsinfo: tsinfo
2283 * @nomMsduSz: nomMsduSz
2284 * @maxMsduSz: maxMsduSz
2285 * @minSvcInterval: minSvcInterval
2286 * @maxSvcInterval: maxSvcInterval
2287 * @inactInterval: inactInterval
2288 * @suspendInterval: suspendInterval
2289 * @svcStartTime: svcStartTime
2290 * @minDataRate: minDataRate
2291 * @meanDataRate: meanDataRate
2292 * @peakDataRate: peakDataRate
2293 * @maxBurstSz: maxBurstSz
2294 * @delayBound: delayBound
2295 * @minPhyRate: minPhyRate
2296 * @surplusBw: surplusBw
2297 * @mediumTime: mediumTime
2298 */
2299struct mac_tspec_ie {
2300 uint8_t type;
2301 uint8_t length;
2302 struct mac_ts_info tsinfo;
2303 uint16_t nomMsduSz;
2304 uint16_t maxMsduSz;
2305 uint32_t minSvcInterval;
2306 uint32_t maxSvcInterval;
2307 uint32_t inactInterval;
2308 uint32_t suspendInterval;
2309 uint32_t svcStartTime;
2310 uint32_t minDataRate;
2311 uint32_t meanDataRate;
2312 uint32_t peakDataRate;
2313 uint32_t maxBurstSz;
2314 uint32_t delayBound;
2315 uint32_t minPhyRate;
2316 uint16_t surplusBw;
2317 uint16_t mediumTime;
Govind Singhd7468a52016-03-09 14:32:57 +05302318} qdf_packed;
Govind Singhae855362016-03-07 14:24:22 +05302319
2320/**
2321 * struct add_ts_param - ADDTS related parameters
2322 * @staIdx: station index
2323 * @tspecIdx: TSPEC handler uniquely identifying a TSPEC for a STA in a BSS
2324 * @tspec: tspec value
2325 * @status: CDF status
2326 * @sessionId: session id
Govind Singhd7468a52016-03-09 14:32:57 +05302327 * @tsm_interval: TSM interval period passed from UMAC to WMI
Govind Singhae855362016-03-07 14:24:22 +05302328 * @setRICparams: RIC parameters
2329 * @sme_session_id: sme session id
2330 */
2331struct add_ts_param {
2332 uint16_t staIdx;
2333 uint16_t tspecIdx;
2334 struct mac_tspec_ie tspec;
Govind Singhd7468a52016-03-09 14:32:57 +05302335 QDF_STATUS status;
Govind Singhae855362016-03-07 14:24:22 +05302336 uint8_t sessionId;
2337#ifdef FEATURE_WLAN_ESE
2338 uint16_t tsm_interval;
2339#endif /* FEATURE_WLAN_ESE */
2340#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2341 uint8_t setRICparams;
2342#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
2343 uint8_t sme_session_id;
2344};
2345
2346/**
2347 * struct delts_req_info - DELTS request parameter
2348 * @tsinfo: ts info
2349 * @tspec: ts spec
2350 * @wmeTspecPresent: wme ts spec flag
2351 * @wsmTspecPresent: wsm ts spec flag
2352 * @lleTspecPresent: lle ts spec flag
2353 */
2354struct delts_req_info {
2355 struct mac_ts_info tsinfo;
2356 struct mac_tspec_ie tspec;
2357 uint8_t wmeTspecPresent:1;
2358 uint8_t wsmTspecPresent:1;
2359 uint8_t lleTspecPresent:1;
2360};
2361
2362/**
2363 * struct del_ts_params - DELTS related parameters
2364 * @staIdx: station index
2365 * @tspecIdx: TSPEC identifier uniquely identifying a TSPEC for a STA in a BSS
2366 * @bssId: BSSID
2367 * @sessionId: session id
2368 * @userPrio: user priority
2369 * @delTsInfo: DELTS info
2370 * @setRICparams: RIC parameters
2371 */
2372struct del_ts_params {
2373 uint16_t staIdx;
2374 uint16_t tspecIdx;
Govind Singh8675b862016-03-28 22:09:18 +05302375 uint8_t bssId[IEEE80211_ADDR_LEN];
Govind Singhae855362016-03-07 14:24:22 +05302376 uint8_t sessionId;
2377 uint8_t userPrio;
2378#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2379 struct delts_req_info delTsInfo;
2380 uint8_t setRICparams;
2381#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
2382};
2383
2384/**
2385 * struct ll_stats_clear_params - ll stats clear parameter
2386 * @req_id: request id
2387 * @sta_id: sta id
2388 * @stats_clear_mask: stats clear mask
2389 * @stop_req: stop request
2390 */
2391struct ll_stats_clear_params {
2392 uint32_t req_id;
2393 uint8_t sta_id;
2394 uint32_t stats_clear_mask;
2395 uint8_t stop_req;
2396};
2397
2398/**
2399 * struct ll_stats_set_params - ll stats get parameter
2400 * @req_id: request id
2401 * @sta_id: sta id
2402 * @mpdu_size_threshold: mpdu sixe threshold
2403 * @aggressive_statistics_gathering: aggressive_statistics_gathering
2404 */
2405struct ll_stats_set_params {
2406 uint32_t req_id;
2407 uint8_t sta_id;
2408 uint32_t mpdu_size_threshold;
2409 uint32_t aggressive_statistics_gathering;
2410};
2411
2412/**
2413 * struct ll_stats_get_params - ll stats parameter
2414 * @req_id: request id
2415 * @sta_id: sta id
2416 * @param_id_mask: param is mask
2417 */
2418struct ll_stats_get_params {
2419 uint32_t req_id;
2420 uint8_t sta_id;
2421 uint32_t param_id_mask;
2422};
2423
2424/**
2425 * struct pe_stats_req - pe stats parameter
2426 * @msg_type: message type is same as the request type
2427 * @msg_len: length of the entire request
2428 * @sta_id: Per STA stats request must contain valid
2429 * @stats_mask: categories of stats requested
2430 * @session_id: wsm ts spec flag
2431 */
2432struct pe_stats_req {
2433 /* Common for all types are requests */
2434 uint16_t msg_type;
2435 uint16_t msg_len;
2436 uint32_t sta_id;
2437 /* categories of stats requested. look at ePEStatsMask */
2438 uint32_t stats_mask;
2439 uint8_t session_id;
2440};
2441
2442/**
2443 * struct link_status_params - link stats parameter
2444 * @msg_type: message type is same as the request type
2445 * @msg_len: length of the entire request
2446 * @link_status: wme ts spec flag
2447 * @session_id: wsm ts spec flag
2448 */
2449struct link_status_params {
2450 uint16_t msg_type;
2451 uint16_t msg_len;
2452 uint8_t link_status;
2453 uint8_t session_id;
2454};
2455
2456/**
2457 * struct dhcp_stop_ind_params - DHCP Stop indication message
2458 * @msgtype: message type is same as the request type
2459 * @msglen: length of the entire request
2460 * @device_mode: Mode of the device(ex:STA, AP)
2461 * @adapter_macaddr: MAC address of the adapter
2462 * @peer_macaddr: MAC address of the connected peer
2463 */
2464struct dhcp_stop_ind_params {
2465 uint16_t msgtype;
2466 uint16_t msglen;
2467 uint8_t device_mode;
Govind Singhd7468a52016-03-09 14:32:57 +05302468 struct qdf_mac_addr adapter_macaddr;
2469 struct qdf_mac_addr peer_macaddr;
Govind Singhae855362016-03-07 14:24:22 +05302470};
2471
2472/**
2473 * struct aggr_add_ts_param - ADDTS parameters
2474 * @staIdx: station index
2475 * @tspecIdx: TSPEC handler uniquely identifying a TSPEC for a STA in a BSS
2476 * @tspec: tspec value
2477 * @status: CDF status
2478 * @sessionId: session id
2479 */
2480struct aggr_add_ts_param {
2481 uint16_t staIdx;
2482 uint16_t tspecIdx;
2483 struct mac_tspec_ie tspec[WMI_QOS_NUM_AC_MAX];
Govind Singhd7468a52016-03-09 14:32:57 +05302484 QDF_STATUS status[WMI_QOS_NUM_AC_MAX];
Govind Singhae855362016-03-07 14:24:22 +05302485 uint8_t sessionId;
2486};
2487
2488#define WMI_MAX_FILTER_TEST_DATA_LEN 8
2489#define WMI_MAX_NUM_MULTICAST_ADDRESS 240
2490#define WMI_MAX_NUM_FILTERS 20
2491#define WMI_MAX_NUM_TESTS_PER_FILTER 10
2492
2493/**
2494 * enum packet_filter_type - packet filter type
2495 * @WMI_RCV_FILTER_TYPE_INVALID: invalid type
2496 * @WMI_RCV_FILTER_TYPE_FILTER_PKT: filter packet type
2497 * @WMI_RCV_FILTER_TYPE_BUFFER_PKT: buffer packet type
2498 * @WMI_RCV_FILTER_TYPE_MAX_ENUM_SIZE: max enum size
2499 */
2500enum packet_filter_type {
2501 WMI_RCV_FILTER_TYPE_INVALID,
2502 WMI_RCV_FILTER_TYPE_FILTER_PKT,
2503 WMI_RCV_FILTER_TYPE_BUFFER_PKT,
2504 WMI_RCV_FILTER_TYPE_MAX_ENUM_SIZE
2505};
2506
2507/**
2508 * enum packet_protocol_type - packet protocol type
2509 * @WMI_FILTER_HDR_TYPE_INVALID: invalid type
2510 * @WMI_FILTER_HDR_TYPE_MAC: mac type
2511 * @WMI_FILTER_HDR_TYPE_ARP: trp type
2512 * @WMI_FILTER_HDR_TYPE_IPV4: ipv4 type
2513 * @WMI_FILTER_HDR_TYPE_IPV6: ipv6 type
2514 * @WMI_FILTER_HDR_TYPE_UDP: udp type
2515 * @WMI_FILTER_HDR_TYPE_MAX: max type
2516 */
2517enum packet_protocol_type {
2518 WMI_FILTER_HDR_TYPE_INVALID,
2519 WMI_FILTER_HDR_TYPE_MAC,
2520 WMI_FILTER_HDR_TYPE_ARP,
2521 WMI_FILTER_HDR_TYPE_IPV4,
2522 WMI_FILTER_HDR_TYPE_IPV6,
2523 WMI_FILTER_HDR_TYPE_UDP,
2524 WMI_FILTER_HDR_TYPE_MAX
2525};
2526
2527/**
2528 * enum packet_filter_comp_type - packet filter comparison type
2529 * @WMI_FILTER_CMP_TYPE_INVALID: invalid type
2530 * @WMI_FILTER_CMP_TYPE_EQUAL: type equal
2531 * @WMI_FILTER_CMP_TYPE_MASK_EQUAL: mask equal
2532 * @WMI_FILTER_CMP_TYPE_NOT_EQUAL: type not equal
2533 * @WMI_FILTER_CMP_TYPE_MASK_NOT_EQUAL: mask not equal
2534 * @WMI_FILTER_CMP_TYPE_MAX: max type
2535 */
2536enum packet_filter_comp_type {
2537 WMI_FILTER_CMP_TYPE_INVALID,
2538 WMI_FILTER_CMP_TYPE_EQUAL,
2539 WMI_FILTER_CMP_TYPE_MASK_EQUAL,
2540 WMI_FILTER_CMP_TYPE_NOT_EQUAL,
2541 WMI_FILTER_CMP_TYPE_MASK_NOT_EQUAL,
2542 WMI_FILTER_CMP_TYPE_MAX
2543};
2544
2545/**
2546 * struct rcv_pkt_filter_params - recieve packet filter parameters
2547 * @protocolLayer - protocol layer
2548 * @cmpFlag - comparison flag
2549 * @dataLength - data length
2550 * @dataOffset - data offset
2551 * @reserved - resserved
2552 * @compareData - compare data
2553 * @dataMask - data mask
2554 */
2555struct rcv_pkt_filter_params {
2556 enum packet_protocol_type protocolLayer;
2557 enum packet_filter_comp_type cmpFlag;
2558 uint16_t dataLength;
2559 uint8_t dataOffset;
2560 uint8_t reserved;
2561 uint8_t compareData[WMI_MAX_FILTER_TEST_DATA_LEN];
2562 uint8_t dataMask[WMI_MAX_FILTER_TEST_DATA_LEN];
2563};
2564
2565/**
2566 * struct rcv_pkt_filter_config - recieve packet filter info
2567 * @filterId - filter id
2568 * @filterType - filter type
2569 * @numFieldParams - no of fields
2570 * @coalesceTime - reserved parameter
2571 * @self_macaddr - self mac address
2572 * @bssid - Bssid of the connected AP
2573 * @paramsData - data parameter
2574 */
2575struct rcv_pkt_filter_config {
2576 uint8_t filterId;
2577 enum packet_filter_type filterType;
2578 uint32_t numFieldParams;
2579 uint32_t coalesceTime;
Govind Singhd7468a52016-03-09 14:32:57 +05302580 struct qdf_mac_addr self_macaddr;
2581 struct qdf_mac_addr bssid;
Govind Singhae855362016-03-07 14:24:22 +05302582 struct rcv_pkt_filter_params paramsData[WMI_MAX_NUM_TESTS_PER_FILTER];
2583};
2584
2585/**
2586 * struct vdev_ie_info_param - IE info
2587 * @vdev_id - vdev for which the IE is being sent
2588 * @ie_id - ID of the IE
2589 * @length - length of the IE data
2590 * @data - IE data
2591 *
2592 * This structure is used to store the IE information.
2593 */
2594struct vdev_ie_info_param {
2595 uint32_t vdev_id;
2596 uint32_t ie_id;
2597 uint32_t length;
2598 uint8_t *data;
2599};
2600
2601#define WMI_MAX_NUM_FW_SEGMENTS 4
2602
2603/**
2604 * struct fw_dump_seg_req_param - individual segment details
2605 * @seg_id - segment id.
2606 * @seg_start_addr_lo - lower address of the segment.
2607 * @seg_start_addr_hi - higher address of the segment.
2608 * @seg_length - length of the segment.
2609 * @dst_addr_lo - lower address of the destination buffer.
2610 * @dst_addr_hi - higher address of the destination buffer.
2611 *
2612 * This structure carries the information to firmware about the
2613 * individual segments. This structure is part of firmware memory
2614 * dump request.
2615 */
2616struct fw_dump_seg_req_param {
2617 uint8_t seg_id;
2618 uint32_t seg_start_addr_lo;
2619 uint32_t seg_start_addr_hi;
2620 uint32_t seg_length;
2621 uint32_t dst_addr_lo;
2622 uint32_t dst_addr_hi;
2623};
2624
2625/**
2626 * struct fw_dump_req_param - firmware memory dump request details.
2627 * @request_id - request id.
2628 * @num_seg - requested number of segments.
2629 * @fw_dump_seg_req - individual segment information.
2630 *
2631 * This structure carries information about the firmware
2632 * memory dump request.
2633 */
2634struct fw_dump_req_param {
2635 uint32_t request_id;
2636 uint32_t num_seg;
2637 struct fw_dump_seg_req_param segment[WMI_MAX_NUM_FW_SEGMENTS];
2638};
2639
2640#define WMI_TDLS_MAX_SUPP_CHANNELS 128
2641#define WMI_TDLS_MAX_SUPP_OPER_CLASSES 32
2642#define WMI_2_4_GHZ_MAX_FREQ 3000
2643
2644/**
2645 * struct tdls_update_ch_params - channel parameters
2646 * @chanId: ID of the channel
2647 * @pwr: power level
2648 * @dfsSet: is dfs supported or not
2649 * @half_rate: is the channel operating at 10MHz
2650 * @quarter_rate: is the channel operating at 5MHz
2651 */
2652struct tdls_update_ch_params {
2653 uint8_t chanId;
2654 uint8_t pwr;
2655 bool dfsSet;
2656 bool half_rate;
2657 bool quarter_rate;
2658};
2659
2660/**
2661 * struct tdls_peer_cap_params - TDLS peer capablities parameters
2662 * @isPeerResponder: is peer responder or not
2663 * @peerUapsdQueue: peer uapsd queue
2664 * @peerMaxSp: peer max SP value
2665 * @peerBuffStaSupport: peer buffer sta supported or not
2666 * @peerOffChanSupport: peer offchannel support
2667 * @peerCurrOperClass: peer current operating class
2668 * @selfCurrOperClass: self current operating class
2669 * @peerChanLen: peer channel length
2670 * @peerChan: peer channel list
2671 * @peerOperClassLen: peer operating class length
2672 * @peerOperClass: peer operating class
2673 * @prefOffChanNum: peer offchannel number
2674 * @prefOffChanBandwidth: peer offchannel bandwidth
2675 * @opClassForPrefOffChan: operating class for offchannel
2676 */
2677struct tdls_peer_cap_params {
2678 uint8_t isPeerResponder;
2679 uint8_t peerUapsdQueue;
2680 uint8_t peerMaxSp;
2681 uint8_t peerBuffStaSupport;
2682 uint8_t peerOffChanSupport;
2683 uint8_t peerCurrOperClass;
2684 uint8_t selfCurrOperClass;
2685 uint8_t peerChanLen;
2686 struct tdls_update_ch_params peerChan[WMI_TDLS_MAX_SUPP_CHANNELS];
2687 uint8_t peerOperClassLen;
2688 uint8_t peerOperClass[WMI_TDLS_MAX_SUPP_OPER_CLASSES];
2689 uint8_t prefOffChanNum;
2690 uint8_t prefOffChanBandwidth;
2691 uint8_t opClassForPrefOffChan;
2692};
2693
2694/**
2695 * struct tdls_peer_state_params - TDLS peer state parameters
2696 * @vdevId: vdev id
2697 * @peerMacAddr: peer mac address
2698 * @peerCap: peer capabality
2699 */
2700struct tdls_peer_state_params {
2701 uint32_t vdevId;
Govind Singh8675b862016-03-28 22:09:18 +05302702 uint8_t peerMacAddr[IEEE80211_ADDR_LEN];
Govind Singhae855362016-03-07 14:24:22 +05302703 uint32_t peerState;
2704 struct tdls_peer_cap_params peerCap;
2705};
2706
2707/**
2708 * struct wmi_tdls_params - TDLS parameters
2709 * @vdev_id: vdev id
2710 * @tdls_state: TDLS state
2711 * @notification_interval_ms: notification inerval
2712 * @tx_discovery_threshold: tx discovery threshold
2713 * @tx_teardown_threshold: tx teardown threashold
2714 * @rssi_teardown_threshold: RSSI teardown threshold
2715 * @rssi_delta: RSSI delta
2716 * @tdls_options: TDLS options
2717 * @peer_traffic_ind_window: raffic indication window
2718 * @peer_traffic_response_timeout: traffic response timeout
2719 * @puapsd_mask: uapsd mask
2720 * @puapsd_inactivity_time: uapsd inactivity time
2721 * @puapsd_rx_frame_threshold: uapsd rx frame threshold
2722 * @teardown_notification_ms: tdls teardown notification interval
2723 * @tdls_peer_kickout_threshold: tdls packet threshold for
2724 * peer kickout operation
2725 */
2726struct wmi_tdls_params {
2727 uint32_t vdev_id;
2728 uint32_t tdls_state;
2729 uint32_t notification_interval_ms;
2730 uint32_t tx_discovery_threshold;
2731 uint32_t tx_teardown_threshold;
2732 int32_t rssi_teardown_threshold;
2733 int32_t rssi_delta;
2734 uint32_t tdls_options;
2735 uint32_t peer_traffic_ind_window;
2736 uint32_t peer_traffic_response_timeout;
2737 uint32_t puapsd_mask;
2738 uint32_t puapsd_inactivity_time;
2739 uint32_t puapsd_rx_frame_threshold;
2740 uint32_t teardown_notification_ms;
2741 uint32_t tdls_peer_kickout_threshold;
2742};
2743
2744/**
2745 * struct tdls_chan_switch_params - channel switch parameter structure
2746 * @vdev_id: vdev ID
2747 * @peer_mac_addr: Peer mac address
2748 * @tdls_off_ch_bw_offset: Target off-channel bandwitdh offset
2749 * @tdls_off_ch: Target Off Channel
2750 * @oper_class: Operating class for target channel
2751 * @is_responder: Responder or initiator
2752 */
2753struct tdls_channel_switch_params {
2754 uint32_t vdev_id;
Govind Singh8675b862016-03-28 22:09:18 +05302755 uint8_t peer_mac_addr[IEEE80211_ADDR_LEN];
Govind Singhae855362016-03-07 14:24:22 +05302756 uint16_t tdls_off_ch_bw_offset;
2757 uint8_t tdls_off_ch;
2758 uint8_t tdls_sw_mode;
2759 uint8_t oper_class;
2760 uint8_t is_responder;
2761};
2762
2763/**
2764 * struct dhcp_offload_info_params - dhcp offload parameters
2765 * @vdev_id: request data length
2766 * @dhcpSrvOffloadEnabled: dhcp offload enabled
2767 * @dhcpClientNum: dhcp client no
2768 * @dhcpSrvIP: dhcp server ip
2769 */
2770struct dhcp_offload_info_params {
2771 uint32_t vdev_id;
2772 uint32_t dhcpSrvOffloadEnabled;
2773 uint32_t dhcpClientNum;
2774 uint32_t dhcpSrvIP;
2775};
2776
2777/**
2778 * struct nan_req_params - NAN request params
2779 * @request_data_len: request data length
2780 * @request_data: request data
2781 */
2782struct nan_req_params {
2783 uint16_t request_data_len;
2784 uint8_t request_data[];
2785};
2786
2787
2788/**
2789 * struct app_type2_params - app type2parameter
2790 * @vdev_id: vdev id
2791 * @rc4_key: rc4 key
2792 * @rc4_key_len: rc4 key length
2793 * @ip_id: NC id
2794 * @ip_device_ip: NC IP addres
2795 * @ip_server_ip: Push server IP address
2796 * @tcp_src_port: NC TCP port
2797 * @tcp_dst_port: Push server TCP port
2798 * @tcp_seq: tcp sequence
2799 * @tcp_ack_seq: tcp ack sequence
2800 * @keepalive_init: Initial ping interval
2801 * @keepalive_min: Minimum ping interval
2802 * @keepalive_max: Maximum ping interval
2803 * @keepalive_inc: Increment of ping interval
2804 * @gateway_mac: gateway mac address
2805 * @tcp_tx_timeout_val: tcp tx timeout value
2806 * @tcp_rx_timeout_val: tcp rx timeout value
2807 */
2808struct app_type2_params {
2809 uint8_t vdev_id;
2810 uint8_t rc4_key[16];
2811 uint32_t rc4_key_len;
2812 /** ip header parameter */
2813 uint32_t ip_id;
2814 uint32_t ip_device_ip;
2815 uint32_t ip_server_ip;
2816 /** tcp header parameter */
2817 uint16_t tcp_src_port;
2818 uint16_t tcp_dst_port;
2819 uint32_t tcp_seq;
2820 uint32_t tcp_ack_seq;
2821 uint32_t keepalive_init;
2822 uint32_t keepalive_min;
2823 uint32_t keepalive_max;
2824 uint32_t keepalive_inc;
Govind Singhd7468a52016-03-09 14:32:57 +05302825 struct qdf_mac_addr gateway_mac;
Govind Singhae855362016-03-07 14:24:22 +05302826 uint32_t tcp_tx_timeout_val;
2827 uint32_t tcp_rx_timeout_val;
2828};
2829
2830/**
2831 * struct app_type1_params - app type1 parameter
2832 * @vdev_id: vdev id
2833 * @wakee_mac_addr: mac address
2834 * @identification_id: identification id
2835 * @password: password
2836 * @id_length: id length
2837 * @pass_length: password length
2838 */
2839struct app_type1_params {
2840 uint8_t vdev_id;
Govind Singhd7468a52016-03-09 14:32:57 +05302841 struct qdf_mac_addr wakee_mac_addr;
Govind Singhae855362016-03-07 14:24:22 +05302842 uint8_t identification_id[8];
2843 uint8_t password[16];
2844 uint32_t id_length;
2845 uint32_t pass_length;
2846};
2847
2848/**
2849 * enum wmi_ext_wow_type - wow type
2850 * @WMI_EXT_WOW_TYPE_APP_TYPE1: only enable wakeup for app type1
2851 * @WMI_EXT_WOW_TYPE_APP_TYPE2: only enable wakeup for app type2
2852 * @WMI_EXT_WOW_TYPE_APP_TYPE1_2: enable wakeup for app type1&2
2853 */
2854enum wmi_ext_wow_type {
2855 WMI_EXT_WOW_TYPE_APP_TYPE1,
2856 WMI_EXT_WOW_TYPE_APP_TYPE2,
2857 WMI_EXT_WOW_TYPE_APP_TYPE1_2,
2858};
2859
2860/**
2861 * struct ext_wow_params - ext wow parameters
2862 * @vdev_id: vdev id
2863 * @type: wow type
2864 * @wakeup_pin_num: wake up gpio no
2865 */
2866struct ext_wow_params {
2867 uint8_t vdev_id;
2868 enum wmi_ext_wow_type type;
2869 uint32_t wakeup_pin_num;
2870};
2871
2872/**
2873 * struct stats_ext_params - ext stats request
2874 * @vdev_id: vdev id
2875 * @request_data_len: request data length
2876 * @request_data: request data
2877 */
2878struct stats_ext_params {
2879 uint32_t vdev_id;
2880 uint32_t request_data_len;
2881 uint8_t request_data[];
2882};
2883
2884#define WMI_PERIODIC_TX_PTRN_MAX_SIZE 1536
2885/**
2886 * struct periodic_tx_pattern - periodic tx pattern
2887 * @mac_address: MAC Address for the adapter
2888 * @ucPtrnId: Pattern ID
2889 * @ucPtrnSize: Pattern size
2890 * @usPtrnIntervalMs: in ms
2891 * @ucPattern: Pattern buffer
2892 */
2893struct periodic_tx_pattern {
Govind Singhd7468a52016-03-09 14:32:57 +05302894 struct qdf_mac_addr mac_address;
Govind Singhae855362016-03-07 14:24:22 +05302895 uint8_t ucPtrnId;
2896 uint16_t ucPtrnSize;
2897 uint32_t usPtrnIntervalMs;
2898 uint8_t ucPattern[WMI_PERIODIC_TX_PTRN_MAX_SIZE];
2899};
2900
2901#define WMI_GTK_OFFLOAD_KEK_BYTES 16
2902#define WMI_GTK_OFFLOAD_KCK_BYTES 16
Siddarth Poddard9221542016-04-01 17:45:06 +05302903#define WMI_GTK_OFFLOAD_ENABLE 0
2904#define WMI_GTK_OFFLOAD_DISABLE 1
Govind Singhae855362016-03-07 14:24:22 +05302905
2906/**
2907 * struct gtk_offload_params - gtk offload parameters
2908 * @ulFlags: optional flags
2909 * @aKCK: Key confirmation key
2910 * @aKEK: key encryption key
2911 * @ullKeyReplayCounter: replay counter
2912 * @bssid: bss id
2913 */
2914struct gtk_offload_params {
2915 uint32_t ulFlags;
2916 uint8_t aKCK[WMI_GTK_OFFLOAD_KCK_BYTES];
2917 uint8_t aKEK[WMI_GTK_OFFLOAD_KEK_BYTES];
2918 uint64_t ullKeyReplayCounter;
Govind Singhd7468a52016-03-09 14:32:57 +05302919 struct qdf_mac_addr bssid;
Govind Singhae855362016-03-07 14:24:22 +05302920};
2921
2922/**
2923 * struct flashing_req_params - led flashing parameter
2924 * @reqId: request id
2925 * @pattern_id: pattern identifier. 0: disconnected 1: connected
2926 * @led_x0: led flashing parameter0
2927 * @led_x1: led flashing parameter1
2928 */
2929struct flashing_req_params {
2930 uint32_t req_id;
2931 uint32_t pattern_id;
2932 uint32_t led_x0;
2933 uint32_t led_x1;
2934};
2935
Govind Singh89727882016-04-15 13:58:27 +05302936#define MAX_MEM_CHUNKS 32
2937/**
2938 * struct wmi_host_mem_chunk - host memory chunk structure
2939 * @vaddr: Pointer to virtual address
2940 * @paddr: Physical address
2941 * @memctx: qdf memory context for mapped address.
2942 * @len: length of chunk
2943 * @req_id: request id from target
2944 */
Govind Singhae855362016-03-07 14:24:22 +05302945struct wmi_host_mem_chunk {
2946 uint32_t *vaddr;
2947 uint32_t paddr;
Govind Singhd7468a52016-03-09 14:32:57 +05302948 qdf_dma_mem_context(memctx);
Govind Singhae855362016-03-07 14:24:22 +05302949 uint32_t len;
2950 uint32_t req_id;
2951};
2952
Govind Singh89727882016-04-15 13:58:27 +05302953/**
2954 * struct target_resource_config - Resource config given to target
2955 * This structure is union of wmi_resource_config defined
2956 * by both TLV and non-TLV target.
2957 */
Govind Singhae855362016-03-07 14:24:22 +05302958struct target_resource_config {
2959 uint32_t num_vdevs;
2960 uint32_t num_peers;
2961 uint32_t num_active_peers;
2962 uint32_t num_offload_peers;
2963 uint32_t num_offload_reorder_buffs;
2964 uint32_t num_peer_keys;
2965 uint32_t num_tids;
2966 uint32_t ast_skid_limit;
2967 uint32_t tx_chain_mask;
2968 uint32_t rx_chain_mask;
2969 uint32_t rx_timeout_pri[4];
2970 uint32_t rx_decap_mode;
2971 uint32_t scan_max_pending_req;
2972 uint32_t bmiss_offload_max_vdev;
2973 uint32_t roam_offload_max_vdev;
2974 uint32_t roam_offload_max_ap_profiles;
2975 uint32_t num_mcast_groups;
2976 uint32_t num_mcast_table_elems;
2977 uint32_t mcast2ucast_mode;
2978 uint32_t tx_dbg_log_size;
2979 uint32_t num_wds_entries;
2980 uint32_t dma_burst_size;
2981 uint32_t mac_aggr_delim;
2982 uint32_t rx_skip_defrag_timeout_dup_detection_check;
2983 uint32_t vow_config;
2984 uint32_t gtk_offload_max_vdev;
2985 uint32_t num_msdu_desc; /* Number of msdu desc */
2986 uint32_t max_frag_entries;
2987 /* End common */
2988
2989 /* Added in MCL */
2990 uint32_t num_tdls_vdevs;
2991 uint32_t num_tdls_conn_table_entries;
2992 uint32_t beacon_tx_offload_max_vdev;
2993 uint32_t num_multicast_filter_entries;
2994 uint32_t num_wow_filters;
2995 uint32_t num_keep_alive_pattern;
2996 uint32_t keep_alive_pattern_size;
2997 uint32_t max_tdls_concurrent_sleep_sta;
2998 uint32_t max_tdls_concurrent_buffer_sta;
2999 uint32_t wmi_send_separate;
3000 uint32_t num_ocb_vdevs;
3001 uint32_t num_ocb_channels;
3002 uint32_t num_ocb_schedules;
3003};
3004
3005/**
3006 * struct wmi_wifi_start_log - Structure to store the params sent to start/
3007 * stop logging
3008 * @name: Attribute which indicates the type of logging like per packet
3009 * statistics, connectivity etc.
3010 * @verbose_level: Verbose level which can be 0,1,2,3
3011 * @flag: Flag field for future use
3012 */
3013struct wmi_wifi_start_log {
3014 uint32_t ring_id;
3015 uint32_t verbose_level;
3016 uint32_t flag;
3017};
3018
3019/**
3020 * struct wmi_pcl_list - Format of PCL
3021 * @pcl_list: List of preferred channels
Manishekar Chandrasekaranb8c59382016-04-21 19:16:32 +05303022 * @weight_list: Weights of the PCL
Govind Singhae855362016-03-07 14:24:22 +05303023 * @pcl_len: Number of channels in the PCL
3024 */
3025struct wmi_pcl_list {
3026 uint8_t pcl_list[128];
Manishekar Chandrasekaranb8c59382016-04-21 19:16:32 +05303027 uint8_t weight_list[128];
Govind Singhae855362016-03-07 14:24:22 +05303028 uint32_t pcl_len;
3029};
3030
3031/**
Manishekar Chandrasekaranb8c59382016-04-21 19:16:32 +05303032 * struct wmi_pcl_chan_weights - Params to get the valid weighed list
3033 * @pcl_list: Preferred channel list already sorted in the order of preference
3034 * @pcl_len: Length of the PCL
3035 * @saved_chan_list: Valid channel list updated as part of
3036 * WMA_UPDATE_CHAN_LIST_REQ
3037 * @saved_num_chan: Length of the valid channel list
3038 * @weighed_valid_list: Weights of the valid channel list. This will have one
3039 * to one mapping with valid_chan_list. FW expects channel order and size to be
3040 * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID.
3041 * @weight_list: Weights assigned by policy manager
3042 */
3043struct wmi_pcl_chan_weights {
3044 uint8_t pcl_list[MAX_NUM_CHAN];
3045 uint32_t pcl_len;
3046 uint8_t saved_chan_list[MAX_NUM_CHAN];
3047 uint32_t saved_num_chan;
3048 uint8_t weighed_valid_list[MAX_NUM_CHAN];
3049 uint8_t weight_list[MAX_NUM_CHAN];
3050};
3051
3052/**
Govind Singhae855362016-03-07 14:24:22 +05303053 * struct wmi_hw_mode_params - HW mode params
3054 * @mac0_tx_ss: MAC0 Tx spatial stream
3055 * @mac0_rx_ss: MAC0 Rx spatial stream
3056 * @mac1_tx_ss: MAC1 Tx spatial stream
3057 * @mac1_rx_ss: MAC1 Rx spatial stream
3058 * @mac0_bw: MAC0 bandwidth
3059 * @mac1_bw: MAC1 bandwidth
3060 * @dbs_cap: DBS capabality
3061 * @agile_dfs_cap: Agile DFS capabality
3062 */
3063struct wmi_hw_mode_params {
3064 uint8_t mac0_tx_ss;
3065 uint8_t mac0_rx_ss;
3066 uint8_t mac1_tx_ss;
3067 uint8_t mac1_rx_ss;
3068 uint8_t mac0_bw;
3069 uint8_t mac1_bw;
3070 uint8_t dbs_cap;
3071 uint8_t agile_dfs_cap;
3072};
3073
3074/**
3075 * struct wmi_dual_mac_config - Dual MAC configuration
3076 * @scan_config: Scan configuration
3077 * @fw_mode_config: FW mode configuration
3078 * @set_dual_mac_cb: Callback function to be executed on response to the command
3079 */
3080struct wmi_dual_mac_config {
3081 uint32_t scan_config;
3082 uint32_t fw_mode_config;
3083 void *set_dual_mac_cb;
3084};
3085
3086#ifdef WLAN_NS_OFFLOAD
3087/**
3088 * struct ns_offload_req_params - ns offload request paramter
3089 * @srcIPv6Addr: src ipv6 address
3090 * @selfIPv6Addr: self ipv6 address
3091 * @targetIPv6Addr: target ipv6 address
3092 * @self_macaddr: self mac address
3093 * @srcIPv6AddrValid: src ipv6 address valid flag
3094 * @targetIPv6AddrValid: target ipv6 address valid flag
Sravan Kumar Kairam33b95492016-07-26 17:59:59 +05303095 * @target_ipv6_addr_ac_type: target ipv6 address type
Govind Singhae855362016-03-07 14:24:22 +05303096 * @slotIdx: slot index
3097 */
3098struct ns_offload_req_params {
3099 uint8_t srcIPv6Addr[WMI_MAC_IPV6_ADDR_LEN];
3100 uint8_t selfIPv6Addr[WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][WMI_MAC_IPV6_ADDR_LEN];
3101 uint8_t targetIPv6Addr[WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][WMI_MAC_IPV6_ADDR_LEN];
Govind Singhd7468a52016-03-09 14:32:57 +05303102 struct qdf_mac_addr self_macaddr;
Govind Singhae855362016-03-07 14:24:22 +05303103 uint8_t srcIPv6AddrValid;
3104 uint8_t targetIPv6AddrValid[WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA];
Sravan Kumar Kairam33b95492016-07-26 17:59:59 +05303105 uint8_t target_ipv6_addr_ac_type[WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA];
Govind Singhae855362016-03-07 14:24:22 +05303106 uint8_t slotIdx;
3107};
3108#endif /* WLAN_NS_OFFLOAD */
3109
3110/**
3111 * struct host_offload_req_param - arp offload parameter
3112 * @offloadType: offload type
3113 * @enableOrDisable: enable or disable
3114 * @num_ns_offload_count: offload count
3115 */
3116struct host_offload_req_param {
3117 uint8_t offloadType;
3118 uint8_t enableOrDisable;
3119 uint32_t num_ns_offload_count;
3120 union {
3121 uint8_t hostIpv4Addr[WMI_IPV4_ADDR_LEN];
3122 uint8_t hostIpv6Addr[WMI_MAC_IPV6_ADDR_LEN];
3123 } params;
3124#ifdef WLAN_NS_OFFLOAD
3125 struct ns_offload_req_params nsOffloadInfo;
3126#endif /* WLAN_NS_OFFLOAD */
Govind Singhd7468a52016-03-09 14:32:57 +05303127 struct qdf_mac_addr bssid;
Govind Singhae855362016-03-07 14:24:22 +05303128};
3129
3130/**
3131 * struct ssid_hotlist_param - param for SSID Hotlist
3132 * @ssid: SSID which is being hotlisted
3133 * @band: Band in which the given SSID should be scanned
3134 * @rssi_low: Low bound on RSSI
3135 * @rssi_high: High bound on RSSI
3136 */
3137struct ssid_hotlist_param {
3138 struct mac_ssid ssid;
3139 uint8_t band;
3140 int32_t rssi_low;
3141 int32_t rssi_high;
3142};
3143
3144/**
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05303145 * struct roam_scan_filter_params - Structure holding roaming scan
3146 * parameters
3147 * @len: length
3148 * @op_bitmap: bitmap to determine reason of roaming
3149 * @session_id: vdev id
3150 * @num_bssid_black_list: The number of BSSID's that we should
3151 * avoid connecting to. It is like a
3152 * blacklist of BSSID's.
3153 * @num_ssid_white_list: The number of SSID profiles that are
3154 * in the Whitelist. When roaming, we
3155 * consider the BSSID's with this SSID
3156 * also for roaming apart from the connected one's
3157 * @num_bssid_preferred_list: Number of BSSID's which have a preference over
3158 * others
3159 * @bssid_avoid_list: Blacklist SSID's
3160 * @ssid_allowed_list: Whitelist SSID's
3161 * @bssid_favored: Favorable BSSID's
3162 * @bssid_favored_factor: RSSI to be added to this BSSID to prefer it
3163 *
3164 * This structure holds all the key parameters related to
3165 * initial connection and roaming connections.
3166 */
3167
3168struct roam_scan_filter_params {
3169 uint32_t len;
3170 uint32_t op_bitmap;
3171 uint8_t session_id;
3172 uint32_t num_bssid_black_list;
3173 uint32_t num_ssid_white_list;
3174 uint32_t num_bssid_preferred_list;
3175 struct qdf_mac_addr bssid_avoid_list[MAX_BSSID_AVOID_LIST];
3176 struct mac_ssid ssid_allowed_list[MAX_SSID_ALLOWED_LIST];
3177 struct qdf_mac_addr bssid_favored[MAX_BSSID_FAVORED];
3178 uint8_t bssid_favored_factor[MAX_BSSID_FAVORED];
3179};
3180
3181/**
Govind Singhae855362016-03-07 14:24:22 +05303182 * struct ssid_hotlist_request_params - set SSID hotlist request struct
3183 * @request_id: ID of the request
3184 * @session_id: ID of the session
3185 * @lost_ssid_sample_size: Number of consecutive scans in which the SSID
3186 * must not be seen in order to consider the SSID "lost"
3187 * @ssid_count: Number of valid entries in the @ssids array
3188 * @ssids: Array that defines the SSIDs that are in the hotlist
3189 */
3190struct ssid_hotlist_request_params {
3191 uint32_t request_id;
3192 uint8_t session_id;
3193 uint32_t lost_ssid_sample_size;
3194 uint32_t ssid_count;
3195 struct ssid_hotlist_param ssids[WMI_EXTSCAN_MAX_HOTLIST_SSIDS];
3196};
3197
3198/**
3199 * struct wmi_unit_test_cmd - unit test command parameters
3200 * @vdev_id: vdev id
3201 * @module_id: module id
3202 * @num_args: number of arguments
3203 * @args: arguments
3204 */
3205struct wmi_unit_test_cmd {
3206 uint32_t vdev_id;
Govind Singh89727882016-04-15 13:58:27 +05303207 uint32_t module_id;
Govind Singhae855362016-03-07 14:24:22 +05303208 uint32_t num_args;
3209 uint32_t args[WMI_MAX_NUM_ARGS];
3210};
3211
3212/**
3213 * struct wmi_roam_invoke_cmd - roam invoke command
3214 * @vdev_id: vdev id
3215 * @bssid: mac address
3216 * @channel: channel
3217 */
3218struct wmi_roam_invoke_cmd {
3219 uint32_t vdev_id;
3220 uint8_t bssid[IEEE80211_ADDR_LEN];
3221 uint32_t channel;
3222};
3223
3224/**
3225 * struct ext_scan_setbssi_hotlist_params - set hotlist request
3226 * @requestId: request identifier
3227 * @sessionId: session identifier
3228 * @lost_ap_sample_size: number of samples to confirm AP loss
3229 * @numAp: Number of hotlist APs
3230 * @ap: hotlist APs
3231 */
3232struct ext_scan_setbssi_hotlist_params {
3233 uint32_t requestId;
3234 uint8_t sessionId;
3235
3236 uint32_t lost_ap_sample_size;
3237 uint32_t numAp;
3238 struct ap_threshold_params ap[WMI_WLAN_EXTSCAN_MAX_HOTLIST_APS];
3239};
Govind Singh89727882016-04-15 13:58:27 +05303240
3241/**
3242 * struct TARGET_HAL_REG_CAPABILITIES - This is replication of REG table
3243 * structure defined by target. This is added here to remove dependency
3244 * on FW headers so that host can be agnostic to different defintions in
3245 * both the targets.
3246 */
3247typedef struct {
3248 uint32_t eeprom_rd; /* regdomain value specified in EEPROM */
3249 uint32_t eeprom_rd_ext; /* regdomain */
3250 uint32_t regcap1; /* CAP1 capabilities bit map */
3251 uint32_t regcap2; /* REGDMN EEPROM CAP */
3252 uint32_t wireless_modes; /* REGDMN MODE */
3253 uint32_t low_2ghz_chan;
3254 uint32_t high_2ghz_chan;
3255 uint32_t low_5ghz_chan;
3256 uint32_t high_5ghz_chan;
3257} TARGET_HAL_REG_CAPABILITIES;
3258
3259/**
3260 * struct host_mem_req - Host memory request paramseters request by target
3261 * @req_id: Request id to identify the request.
3262 * @unit_size: Size of single unit requested.
3263 * @num_unit_info: Memory chunk info
3264 * @num_units: number of units requested.
3265 */
3266typedef struct {
3267 uint32_t req_id;
3268 uint32_t unit_size;
3269 uint32_t num_unit_info;
3270 uint32_t num_units;
3271} host_mem_req;
3272
3273#define WMI_HOST_DSCP_MAP_MAX (64)
3274
3275/**
3276 * struct wmi_host_ext_resource_config - Extended resource config
3277 * @host_platform_config: Host plaform configuration.
3278 * @fw_featuew_bitmap: FW feature requested bitmap.
3279 */
3280typedef struct {
3281 uint32_t host_platform_config;
3282
3283#define WMI_HOST_FW_FEATURE_LTEU_SUPPORT 0x0001
3284#define WMI_HOST_FW_FEATURE_COEX_GPIO_SUPPORT 0x0002
3285#define WMI_HOST_FW_FEATURE_AUX_RADIO_SPECTRAL_INTF 0x0004
3286#define WMI_HOST_FW_FEATURE_AUX_RADIO_CHAN_LOAD_INTF 0x0008
3287#define WMI_HOST_FW_FEATURE_BSS_CHANNEL_INFO_64 0x0010
3288#define WMI_HOST_FW_FEATURE_PEER_STATS 0x0020
3289#define WMI_HOST_FW_FEATURE_VDEV_STATS 0x0040
3290 /**
3291 * @brief fw_feature_bitmask - Enable/Disable features in FW
3292 * @details
3293 * The bits in fw_feature_bitmask are used as shown by the masks below:
3294 * 0x0001 - LTEU Config enable/disable
3295 * 0x0002 - COEX GPIO Config enable/disable
3296 * 0x0004 - Aux Radio enhancement for spectral scan enable/disable
3297 * 0x0008 - Aux Radio enhancement for chan load scan enable/disable
3298 * 0x0010 - BSS channel info stats enable/disable
3299 * The features in question are enabled by setting
3300 * the feature's bit to 1,
3301 * or disabled by setting the feature's bit to 0.
3302 */
3303 uint32_t fw_feature_bitmap;
3304
3305 /* add new members here */
3306} wmi_host_ext_resource_config;
3307
3308/**
3309 * struct set_neighbour_rx_params - Neighbour RX params
3310 * @vdev_id: vdev id
3311 * @idx: index of param
3312 * @action: action
3313 * @type: Type of param
3314 */
3315struct set_neighbour_rx_params {
3316 uint8_t vdev_id;
3317 uint32_t idx;
3318 uint32_t action;
3319 uint32_t type;
3320};
3321
3322/**
3323 * struct set_fwtest_params - FW test params
3324 * @arg: FW param id
3325 * @value: value
3326 */
3327struct set_fwtest_params {
3328 uint32_t arg;
3329 uint32_t value;
3330};
3331
3332/**
3333 * struct config_ratemask_params - ratemask config parameters
3334 * @vdev_id: vdev id
3335 * @type: Type
3336 * @lower32: Lower 32 bits
3337 * @higher32: Hogher 32 bits
3338 */
3339struct config_ratemask_params {
3340 uint8_t vdev_id;
3341 uint8_t type;
3342 uint32_t lower32;
3343 uint32_t higher32;
3344};
3345
3346/**
3347 * struct peer_add_wds_entry_params - WDS peer entry add params
3348 * @dest_addr: Pointer to destination macaddr
3349 * @peer_addr: Pointer to peer mac addr
3350 * @flags: flags
3351 */
3352struct peer_add_wds_entry_params {
3353 const uint8_t *dest_addr;
3354 uint8_t *peer_addr;
3355 uint32_t flags;
3356};
3357
3358/**
3359 * struct peer_del_wds_entry_params - WDS peer entry del params
3360 * @dest_addr: Pointer to destination macaddr
3361 */
3362struct peer_del_wds_entry_params {
3363 uint8_t *dest_addr;
3364};
3365
3366/**
3367 * struct peer_updatewds_entry_params - WDS peer entry update params
3368 * @wds_macaddr: Pointer to destination macaddr
3369 * @peer_add: Pointer to peer mac addr
3370 * @flags: flags
3371 */
3372struct peer_update_wds_entry_params {
3373 uint8_t *wds_macaddr;
3374 uint8_t *peer_macaddr;
3375 uint32_t flags;
3376};
3377
3378/**
3379 * struct set_ps_mode_params - PS mode params
3380 * @vdev_id: vdev id
3381 * @psmode: PS mode
3382 */
3383struct set_ps_mode_params {
3384 uint8_t vdev_id;
3385 uint8_t psmode;
3386};
3387
3388/**
3389 * @struct tt_level_config - Set Thermal throttlling config
3390 * @tmplwm: Temperature low water mark
3391 * @tmphwm: Temperature high water mark
3392 * @dcoffpercent: dc off percentage
3393 * @priority: priority
3394 */
3395typedef struct {
3396 uint32_t tmplwm;
3397 uint32_t tmphwm;
3398 uint32_t dcoffpercent;
3399 uint32_t priority;
3400} tt_level_config;
3401
3402/**
3403 * struct thermal_mitigation_params - Thermal mitigation params
3404 * @enable: Enable/Disable Thermal mitigation
3405 * @dc: DC
3406 * @dc_per_event: DC per event
3407 * @tt_level_config: TT level config params
3408 */
3409struct thermal_mitigation_params {
3410 uint32_t enable;
3411 uint32_t dc;
3412 uint32_t dc_per_event;
3413 tt_level_config levelconf[THERMAL_LEVELS];
3414};
3415
3416/**
3417 * struct smart_ant_enable_params - Smart antenna params
3418 * @enable: Enable/Disable
3419 * @mode: SA mode
3420 * @rx_antenna: RX antenna config
Govind Singh41da3152016-05-06 20:20:25 +05303421 * @gpio_pin : GPIO pin config
3422 * @gpio_func : GPIO function config
Govind Singh89727882016-04-15 13:58:27 +05303423 */
3424struct smart_ant_enable_params {
3425 uint32_t enable;
3426 uint32_t mode;
3427 uint32_t rx_antenna;
Govind Singh41da3152016-05-06 20:20:25 +05303428 uint32_t gpio_pin[WMI_HAL_MAX_SANTENNA];
3429 uint32_t gpio_func[WMI_HAL_MAX_SANTENNA];
Govind Singh89727882016-04-15 13:58:27 +05303430};
3431
3432/**
3433 * struct smart_ant_rx_ant_params - RX antenna params
3434 * @antenna: RX antenna
3435 */
3436struct smart_ant_rx_ant_params {
3437 uint32_t antenna;
3438};
3439
3440/**
3441 * struct smart_ant_tx_ant_params - TX antenna param
3442 * @antenna_array: Antenna arry
3443 * @vdev_id: VDEV id
3444 */
3445struct smart_ant_tx_ant_params {
3446 uint32_t *antenna_array;
3447 uint8_t vdev_id;
3448};
3449
3450/**
3451 * struct smart_ant_training_info_params - SA training params
3452 * @vdev_id: VDEV id
3453 * @rate_array: Rates array
3454 * @antenna_array: Antenna array
3455 * @numpkts: num packets for training
3456 */
3457struct smart_ant_training_info_params {
3458 uint8_t vdev_id;
3459 uint32_t *rate_array;
3460 uint32_t *antenna_array;
3461 uint32_t numpkts;
3462};
3463
3464/**
3465 * struct smart_ant_node_config_params - SA node config params
3466 * @vdev_id: VDEV id
3467 * @cmd_id: Command id
3468 * @args_count: Arguments count
3469 */
3470struct smart_ant_node_config_params {
3471 uint8_t vdev_id;
3472 uint32_t cmd_id;
3473 uint16_t args_count;
3474 uint32_t *args_arr;
3475};
3476/**
3477 * struct smart_ant_enable_tx_feedback_params - SA tx feeback params
3478 * @enable: Enable TX feedback for SA
3479 */
3480struct smart_ant_enable_tx_feedback_params {
3481 int enable;
3482};
3483
3484/**
3485 * struct vdev_spectral_configure_params - SPectral config params
3486 * @vdev_id: VDEV id
3487 * @count: count
3488 * @period: period
3489 * @spectral_pri: Spectral priority
3490 * @fft_size: FFT size
3491 * @gc_enable: GC enable
3492 * @restart_enable: restart enabled
3493 * @noise_floor_ref: Noise floor reference
3494 * @init_delay: Init delays
3495 * @nb_tone_thr: NB tone threshold
3496 * @str_bin_thr: STR BIN threshold
3497 * @wb_rpt_mode: WB BIN threshold
3498 * @rssi_rpt_mode: RSSI report mode
3499 * @rssi_thr: RSSI threshold
3500 * @pwr_format: Power format
3501 * @rpt_mode: Report mdoe
3502 * @bin_scale: BIN scale
3503 * @dBm_adj: DBM adjust
3504 * @chn_mask: chain mask
3505 */
3506struct vdev_spectral_configure_params {
3507 uint8_t vdev_id;
3508 uint16_t count;
3509 uint16_t period;
3510 uint16_t spectral_pri;
3511 uint16_t fft_size;
3512 uint16_t gc_enable;
3513 uint16_t restart_enable;
3514 uint16_t noise_floor_ref;
3515 uint16_t init_delay;
3516 uint16_t nb_tone_thr;
3517 uint16_t str_bin_thr;
3518 uint16_t wb_rpt_mode;
3519 uint16_t rssi_rpt_mode;
3520 uint16_t rssi_thr;
3521 uint16_t pwr_format;
3522 uint16_t rpt_mode;
3523 uint16_t bin_scale;
3524 uint16_t dBm_adj;
3525 uint16_t chn_mask;
3526};
3527
3528/**
3529 * struct vdev_spectral_enable_params - Spectral enabled params
3530 * @vdev_id: VDEV id
3531 * @active_valid: Active valid
3532 * @active: active
3533 * @enabled_valid: Enabled valid
3534 * @enabled: enabled
3535 */
3536struct vdev_spectral_enable_params {
3537 uint8_t vdev_id;
3538 uint8_t active_valid;
3539 uint8_t active;
3540 uint8_t enabled_valid;
3541 uint8_t enabled;
3542};
3543
3544/**
3545 * struct pdev_set_regdomain_params - PDEV set reg domain params
3546 * @currentRDinuse: Current Reg domain
3547 * @currentRD2G: Current Reg domain 2G
3548 * @currentRD5G: Current Reg domain 5G
3549 * @ctl_2G: CTL 2G
3550 * @ctl_5G: CTL 5G
3551 * @dfsDomain: DFS domain
3552 */
3553struct pdev_set_regdomain_params {
3554 uint16_t currentRDinuse;
3555 uint16_t currentRD2G;
3556 uint16_t currentRD5G;
3557 uint32_t ctl_2G;
3558 uint32_t ctl_5G;
3559 uint8_t dfsDomain;
3560};
3561
3562/**
3563 * struct set_quiet_mode_params - Set quiet mode params
3564 * @enabled: Enabled
3565 * @period: Quite period
3566 * @intval: Quite interval
3567 * @duration: Quite duration
3568 * @offset: offset
3569 */
3570struct set_quiet_mode_params {
3571 uint8_t enabled;
3572 uint8_t period;
3573 uint16_t intval;
3574 uint16_t duration;
3575 uint16_t offset;
3576};
3577
3578/**
3579 * struct set_beacon_filter_params - Set beacon filter params
3580 * @vdev_id: VDEV id
3581 * @ie: Pointer to IE fields
3582 */
3583struct set_beacon_filter_params {
3584 uint8_t vdev_id;
3585 uint32_t *ie;
3586};
3587
3588/**
3589 * struct remove_beacon_filter_params - Remove beacon filter params
3590 * @vdev_id: VDEV id
3591 */
3592struct remove_beacon_filter_params {
3593 uint8_t vdev_id;
3594};
3595
3596/**
3597 * struct mgmt_params - Mgmt params
3598 * @vdev_id: vdev id
3599 * @buf_len: lenght of frame buffer
3600 * @wbuf: frame buffer
3601 */
3602struct mgmt_params {
3603 int vdev_id;
3604 uint32_t buf_len;
3605 qdf_nbuf_t wbuf;
3606};
3607
3608/**
3609 * struct addba_clearresponse_params - Addba clear response params
3610 * @vdev_id: VDEV id
3611 */
3612struct addba_clearresponse_params {
3613 uint8_t vdev_id;
3614};
3615
3616/**
3617 * struct addba_send_params - ADDBA send params
3618 * @vdev_id: vdev id
3619 * @tidno: TID
3620 * @buffersize: buffer size
3621 */
3622struct addba_send_params {
3623 uint8_t vdev_id;
3624 uint8_t tidno;
3625 uint16_t buffersize;
3626};
3627
3628/**
3629 * struct delba_send_params - DELBA send params
3630 * @vdev_id: vdev id
3631 * @tidno: TID
3632 * @initiator: initiator
3633 * @reasoncode: reason code
3634 */
3635struct delba_send_params {
3636 uint8_t vdev_id;
3637 uint8_t tidno;
3638 uint8_t initiator;
3639 uint16_t reasoncode;
3640};
3641/**
3642 * struct addba_setresponse_arams - Set ADDBA response params
3643 * @vdev_id: vdev id
3644 * @tidno: TID
3645 * @statuscode: status code in response
3646 */
3647struct addba_setresponse_params {
3648 uint8_t vdev_id;
3649 uint8_t tidno;
3650 uint16_t statuscode;
3651};
3652
3653/**
3654 * struct singleamsdu_params - Single AMSDU params
3655 * @vdev_id: vdev is
3656 * @tidno: TID
3657 */
3658struct singleamsdu_params {
3659 uint8_t vdev_id;
3660 uint8_t tidno;
3661};
3662
3663/**
3664 * struct set_qbosst_params - Set QBOOST params
3665 * @vdev_id: vdev id
3666 * @value: value
3667 */
3668struct set_qboost_params {
3669 uint8_t vdev_id;
3670 uint32_t value;
3671};
3672
3673/**
3674 * struct mu_scan_params - MU scan params
3675 * @id: id
3676 * @type: type
3677 * @duration: Duration
3678 * @lteu_tx_power: LTEU tx power
3679 */
3680struct mu_scan_params {
3681 uint8_t id;
3682 uint8_t type;
3683 uint32_t duration;
3684 uint32_t lteu_tx_power;
3685};
3686
3687/**
3688 * struct lteu_config_params - LTEU config params
3689 * @lteu_gpio_start: start MU/AP scan after GPIO toggle
3690 * @lteu_num_bins: no. of elements in the following arrays
3691 * @use_actual_nf: whether to use the actual NF obtained or a hardcoded one
3692 * @lteu_weight: weights for MU algo
3693 * @lteu_thresh: thresholds for MU algo
3694 * @lteu_gamma: gamma's for MU algo
3695 * @lteu_scan_timeout: timeout in ms to gpio toggle
3696 * @alpha_num_ssid: alpha for num active bssid calculation
3697 * @wifi_tx_power: Wifi Tx power
3698 */
3699struct lteu_config_params {
3700 uint8_t lteu_gpio_start;
3701 uint8_t lteu_num_bins;
3702 uint8_t use_actual_nf;
3703 uint32_t lteu_weight[LTEU_MAX_BINS];
3704 uint32_t lteu_thresh[LTEU_MAX_BINS];
3705 uint32_t lteu_gamma[LTEU_MAX_BINS];
3706 uint32_t lteu_scan_timeout;
3707 uint32_t alpha_num_bssid;
3708 uint32_t wifi_tx_power;
3709};
3710
3711struct wmi_macaddr_t {
3712 /** upper 4 bytes of MAC address */
3713 uint32_t mac_addr31to0;
3714 /** lower 2 bytes of MAC address */
3715 uint32_t mac_addr47to32;
3716};
3717
3718/**
3719 * struct atf_peer_info - ATF peer info params
3720 * @peer_macaddr: peer mac addr
3721 * @percentage_peer: percentage of air time for this peer
3722 */
3723typedef struct {
3724 struct wmi_macaddr_t peer_macaddr;
3725 uint32_t percentage_peer;
3726} atf_peer_info;
3727
3728/**
Sathish Kumar50232d72016-08-09 16:50:46 +05303729 * struct bwf_peer_info_t - BWF peer info params
3730 * @peer_macaddr: peer mac addr
3731 * @throughput: Throughput
3732 * @max_airtime: Max airtime
3733 * @priority: Priority level
3734 * @reserved: Reserved array
3735 */
3736typedef struct {
3737 struct wmi_macaddr_t peer_macaddr;
3738 uint32_t throughput;
3739 uint32_t max_airtime;
3740 uint32_t priority;
3741 uint32_t reserved[4];
3742} bwf_peer_info;
3743
3744/**
3745 * struct set_bwf_params - BWF params
3746 * @num_peers: number of peers
3747 * @atf_peer_info: BWF peer info
3748 */
3749struct set_bwf_params {
3750 uint32_t num_peers;
3751 bwf_peer_info peer_info[1];
3752};
3753
3754/**
Govind Singh89727882016-04-15 13:58:27 +05303755 * struct set_atf_params - ATF params
3756 * @num_peers: number of peers
3757 * @atf_peer_info: ATF peer info
3758 */
3759struct set_atf_params {
3760 uint32_t num_peers;
3761 atf_peer_info peer_info[ATF_ACTIVED_MAX_CLIENTS];
3762};
3763
3764/**
3765 * struct atf_peer_ext_info - ATF peer ext info params
3766 * @peer_macaddr: peer mac address
3767 * @group_index: group index
3768 * @atf_index_reserved: ATF index rsvd
3769 */
3770typedef struct {
3771 struct wmi_macaddr_t peer_macaddr;
3772 uint32_t group_index;
3773 uint32_t atf_index_reserved;
3774} atf_peer_ext_info;
3775
3776/**
3777 * struct atf_peer_request_params - ATF peer req params
3778 * @num_peers: number of peers
3779 * @atf_peer_ext_info: ATF peer ext info
3780 */
3781struct atf_peer_request_params {
3782 uint32_t num_peers;
3783 atf_peer_ext_info peer_ext_info[ATF_ACTIVED_MAX_CLIENTS];
3784};
3785
3786/**
3787 * struct atf_group_info - ATF group info params
3788 * @percentage_group: Percentage AT for group
3789 * @atf_group_units_reserved: ATF group information
3790 */
3791typedef struct {
3792 uint32_t percentage_group;
3793 uint32_t atf_group_units_reserved;
3794} atf_group_info;
3795
3796/**
3797 * struct atf_grouping_params - ATF grouping params
3798 * @num_groups: number of groups
3799 * @group_inf: Group informaition
3800 */
3801struct atf_grouping_params {
3802 uint32_t num_groups;
3803 atf_group_info group_info[ATF_ACTIVED_MAX_ATFGROUPS];
3804};
3805
3806/**
3807 * struct wlan_profile_params - WLAN profile params
3808 * @param_id: param id
3809 * @profile_id: profile id
3810 * @enable: enable
3811 */
3812struct wlan_profile_params {
3813 uint32_t param_id;
3814 uint32_t profile_id;
3815 uint32_t enable;
3816};
3817
3818/* struct ht_ie_params - HT IE params
3819 * @ie_len: IE length
3820 * @ie_data: pointer to IE data
3821 */
3822struct ht_ie_params {
3823 uint32_t ie_len;
3824 uint8_t *ie_data;
3825};
3826
3827/* struct vht_ie_params - VHT IE params
3828 * @ie_len: IE length
3829 * @ie_data: pointer to IE data
3830 */
3831struct vht_ie_params {
3832 uint32_t ie_len;
3833 uint8_t *ie_data;
3834};
3835
3836/**
3837 * struct wmi_host_wmeParams - WME params
3838 * @wmep_acm: ACM paramete
3839 * @wmep_aifsn: AIFSN parameters
3840 * @wmep_logcwmin: cwmin in exponential form
3841 * @wmep_logcwmax: cwmax in exponential form
3842 * @wmep_txopLimit: txopLimit
3843 * @wmep_noackPolicy: No-Ack Policy: 0=ack, 1=no-ack
3844 */
3845struct wmi_host_wmeParams {
3846 u_int8_t wmep_acm;
3847 u_int8_t wmep_aifsn;
3848 u_int8_t wmep_logcwmin;
3849 u_int8_t wmep_logcwmax;
3850 u_int16_t wmep_txopLimit;
3851 u_int8_t wmep_noackPolicy;
3852};
3853
3854/**
3855 * struct wmm_update_params - WMM update params
3856 * @wmep_array: WME params for each AC
3857 */
3858struct wmm_update_params {
3859 struct wmi_host_wmeParams *wmep_array;
3860};
3861
3862/**
3863 * struct ant_switch_tbl_params - Antenna switch table params
3864 * @ant_ctrl_common1: ANtenna control common param 1
3865 * @ant_ctrl_common2: Antenna control commn param 2
3866 */
3867struct ant_switch_tbl_params {
3868 uint32_t ant_ctrl_common1;
3869 uint32_t ant_ctrl_common2;
3870};
3871
3872/**
3873 * struct ratepwr_table_params - Rate power table params
3874 * @ratepwr_tbl: pointer to rate power table
3875 * @ratepwr_len: rate power table len
3876 */
3877struct ratepwr_table_params {
3878 uint8_t *ratepwr_tbl;
3879 uint16_t ratepwr_len;
3880};
3881
3882/**
3883 * struct ctl_table_params - Ctl table params
3884 * @ctl_array: pointer to ctl array
3885 * @ctl_len: ctl length
3886 * @is_acfg_ctl: is acfg_ctl table
3887 */
3888struct ctl_table_params {
3889 uint8_t *ctl_array;
3890 uint16_t ctl_len;
3891 bool is_acfg_ctl;
3892};
3893
3894/**
3895 * struct mimogain_table_params - MIMO gain table params
3896 * @array_gain: pointer to array gain table
3897 * @tbl_len: table length
3898 * @multichain_gain_bypass: bypass multichain gain
3899 */
3900struct mimogain_table_params {
3901 uint8_t *array_gain;
3902 uint16_t tbl_len;
3903 bool multichain_gain_bypass;
3904};
3905
3906/**
3907 * struct ratepwr_chainmask_params - Rate power chainmask params
3908 * @ratepwr_chain_tbl: pointer to ratepwr chain table
3909 * @num_rate: number of rate in table
3910 * @pream_type: preamble type
3911 * @ops: ops
3912 */
3913struct ratepwr_chainmsk_params {
3914 uint32_t *ratepwr_chain_tbl;
3915 uint16_t num_rate;
3916 uint8_t pream_type;
3917 uint8_t ops;
3918};
3919
3920struct macaddr_params {
3921 uint8_t *macaddr;
3922};
3923
3924/**
3925 * struct acparams_params - acparams config structure
3926 * @ac: AC to configure
3927 * @use_rts: Use rts for this AC
3928 * @aggrsize_scaling: Aggregrate size scaling for the AC
3929 * @min_kbps: min kbps req
3930 */
3931struct acparams_params {
3932 uint8_t ac;
3933 uint8_t use_rts;
3934 uint8_t aggrsize_scaling;
3935 uint32_t min_kbps;
3936};
3937
3938/**
3939 * struct vap_dscp_tid_map_params - DSCP tid map params
3940 * @vdev_id: vdev id
3941 * @dscp_to_tid_map: pointer to arry of tid to dscp map table
3942 */
3943struct vap_dscp_tid_map_params {
3944 uint8_t vdev_id;
3945 uint32_t *dscp_to_tid_map;
3946};
3947
3948/**
3949 * struct proxy_ast_reserve_params - Proxy AST reserve params
3950 * @macaddr: macaddr for proxy ast entry
3951 */
3952struct proxy_ast_reserve_params {
3953 uint8_t *macaddr;
3954};
3955
3956/**
3957 * struct fips_params - FIPS params config
3958 * @key: pointer to key
3959 * @key_len: length of key
3960 * @data: pointer data buf
3961 * @data_len: lenght of sata buf
3962 * @mode: mode
3963 * @op: operation
3964 */
3965struct fips_params {
3966 uint8_t *key;
3967 uint32_t key_len;
3968 uint8_t *data;
3969 uint32_t data_len;
3970 uint32_t mode;
3971 uint32_t op;
3972};
3973
3974/**
3975 * struct mcast_group_update_param - Mcast group table update to target
3976 * @action: Addition/deletion
3977 * @wildcard: iwldcard table entry?
3978 * @mcast_ip_addr: mcast ip address to be updated
3979 * @mcast_ip_addr_bytes: mcast ip addr bytes
3980 * @ucast_mac_addr: ucast peer mac subscribed to mcast ip
3981 * @filter_mode: filter mode
3982 * @nsrcs: number of entries in source list
3983 * @srcs: source mac accpted
3984 * @mask: mask
3985 * @vap_id: vdev id
3986 * @is_action_delete: is delete
3987 * @is_filter_mode_snoop:
3988 * @is_mcast_addr_len:
3989 */
3990struct mcast_group_update_params {
3991 int action;
3992 int wildcard;
3993 uint8_t *mcast_ip_addr;
3994 int mcast_ip_addr_bytes;
3995 uint8_t *ucast_mac_addr;
3996 uint8_t filter_mode;
3997 uint8_t nsrcs;
3998 uint8_t *srcs;
3999 uint8_t *mask;
4000 uint8_t vap_id;
4001 bool is_action_delete;
4002 bool is_filter_mode_snoop;
4003 bool is_mcast_addr_len;
4004};
4005
4006/**
4007 * struct periodic_chan_stats_param - periodic channel stats req param
4008 * @stats_period: stats period update
4009 * @enable: enable/disable
4010 */
4011struct periodic_chan_stats_params {
4012 uint32_t stats_period;
4013 bool enable;
4014};
4015
4016/**
4017 * struct packet_power_info_params - packet power info params
4018 * @rate_flags: rate flags
4019 * @nss: number of spatial streams
4020 * @preamble: preamble
4021 * @hw_rate:
4022 */
4023struct packet_power_info_params {
4024 uint16_t rate_flags;
4025 uint16_t nss;
4026 uint16_t preamble;
4027 uint16_t hw_rate;
4028};
4029
4030/**
4031 * WMI_GPIO_CONFIG_CMDID
4032 */
4033enum {
4034 WMI_HOST_GPIO_PULL_NONE,
4035 WMI_HOST_GPIO_PULL_UP,
4036 WMI_HOST_GPIO_PULL_DOWN,
4037};
4038
4039/**
4040 * WMI_GPIO_INTTYPE
4041 */
4042enum {
4043 WMI_HOST_GPIO_INTTYPE_DISABLE,
4044 WMI_HOST_GPIO_INTTYPE_RISING_EDGE,
4045 WMI_HOST_GPIO_INTTYPE_FALLING_EDGE,
4046 WMI_HOST_GPIO_INTTYPE_BOTH_EDGE,
4047 WMI_HOST_GPIO_INTTYPE_LEVEL_LOW,
4048 WMI_HOST_GPIO_INTTYPE_LEVEL_HIGH
4049};
4050
4051/**
4052 * struct wmi_host_gpio_input_event - GPIO input event structure
4053 * @gpio_num: GPIO number which changed state
4054 */
4055typedef struct {
4056 uint32_t gpio_num; /* GPIO number which changed state */
4057} wmi_host_gpio_input_event;
4058
4059/**
4060 * struct gpio_config_params - GPIO config params
4061 * @gpio_num: GPIO number to config
4062 * @input: input/output
4063 * @pull_type: pull type
4064 * @intr_mode: int mode
4065 */
4066struct gpio_config_params {
4067 uint32_t gpio_num;
4068 uint32_t input;
4069 uint32_t pull_type;
4070 uint32_t intr_mode;
4071};
4072
4073/**
4074 * struct gpio_output_params - GPIO output params
4075 * @gpio_num: GPIO number to configure
4076 * @set: set/reset
4077 */
4078struct gpio_output_params {
4079 uint32_t gpio_num;
4080 uint32_t set;
4081};
4082
4083#define WMI_HOST_RTT_REPORT_CFR 0
4084#define WMI_HOST_RTT_NO_REPORT_CFR 1
4085#define WMI_HOST_RTT_AGGREGATE_REPORT_NON_CFR 2
4086/**
4087 * struct rtt_meas_req_test_params
4088 * @peer: peer mac address
4089 * @req_frame_type: RTT request frame type
4090 * @req_bw: requested bandwidth
4091 * @req_preamble: Preamble
4092 * @req_num_req: num of requests
4093 * @req_report_type: report type
4094 * @num_measurements: number of measurements
4095 * @asap_mode: priority
4096 * @lci_requested: LCI requested
4097 * @loc_civ_requested:
4098 * @channel_param: channel param
4099 * @req_id: requested id
4100 */
4101struct rtt_meas_req_test_params {
4102 uint8_t peer[IEEE80211_ADDR_LEN];
4103 int req_frame_type;
4104 int req_bw;
4105 int req_preamble;
4106 int req_num_req;
4107 int req_report_type;
4108 uint32_t num_measurements;
4109 uint32_t asap_mode;
4110 uint32_t lci_requested;
4111 uint32_t loc_civ_requested;
4112 struct channel_param channel;
4113 uint8_t req_id;
4114};
4115
4116/**
4117 * struct rtt_meas_req_params - RTT measurement request params
4118 * @req_id: Request id
4119 * @vdev_id: vdev id
4120 * @sta_mac_addr: pointer to station mac address
4121 * @spoof_mac_addr: pointer to spoof mac address
4122 * @is_mode_na: 11NA
4123 * @is_mode_ac: AC
4124 * @is_bw_20: 20
4125 * @is_bw_40: 40
4126 * @is_bw_80: 80
4127 * @num_probe_rqst: number of probe request
4128 * @channel_param: channel param
4129 */
4130struct rtt_meas_req_params {
4131 uint8_t req_id;
4132 uint8_t vdev_id;
4133 uint8_t *sta_mac_addr;
4134 uint8_t *spoof_mac_addr;
4135 bool is_mode_na;
4136 bool is_mode_ac;
4137 bool is_bw_20;
4138 bool is_bw_40;
4139 bool is_bw_80;
4140 uint32_t num_probe_rqst;
4141 struct channel_param channel;
4142};
4143
4144/**
4145 * struct lci_set_params - LCI params
4146 * @lci_data: pointer to LCI data
4147 * @latitude_unc: latitude
4148 * @latitude_0_12: bits 0 to 1 of latitude
4149 * @latitude_2_33: bits 2 to 33 of latitude
4150 * @longitude_unc: longitude
4151 * @longitude_0_1: bits 0 to 1 of longitude
4152 * @longitude_2_33: bits 2 to 33 of longitude
4153 * @altitude_type: altitude type
4154 * @altitude_unc_0_3: altitude bits 0 - 3
4155 * @altitude_unc_4_5: altitude bits 4 - 5
4156 * @altitude: altitude
4157 * @datum: dataum
4158 * @reg_loc_agmt:
4159 * @reg_loc_dse:
4160 * @dep_sta:
4161 * @version: version
4162 */
4163struct lci_set_params {
4164 void *lci_data;
4165 uint8_t latitude_unc:6,
4166 latitude_0_1:2;
4167 uint32_t latitude_2_33;
4168 uint8_t longitude_unc:6,
4169 longitude_0_1:2;
4170 uint32_t longitude_2_33;
4171 uint8_t altitude_type:4,
4172 altitude_unc_0_3:4;
4173 uint32_t altitude_unc_4_5:2,
4174 altitude:30;
4175 uint8_t datum:3,
4176 reg_loc_agmt:1,
4177 reg_loc_dse:1,
4178 dep_sta:1,
4179 version:2;
4180};
4181
4182/**
4183 * struct lcr_set_params - LCR params
4184 * @lcr_data: pointer to lcr data
4185 */
4186struct lcr_set_params {
4187 void *lcr_data;
4188};
4189
4190/**
4191 * struct rtt_keepalive_req_params - RTT keepalive params
4192 * @macaddr: pointer to macaddress
4193 * @req_id: Request id
4194 * @vdev_id: vdev id
4195 * @stop: start/stop
4196 */
4197struct rtt_keepalive_req_params {
4198 uint8_t *macaddr;
4199 uint8_t req_id;
4200 uint8_t vdev_id;
4201 bool stop;
4202};
4203
4204/**
4205 * struct wmi_host_stats_event - Stats event params
4206 * @stats_id: stats id of type wmi_host_stats_event
4207 * @num_pdev_stats: number of pdev stats event structures 0 or 1
4208 * @num_pdev_ext_stats: number of pdev ext stats event structures
4209 * @num_vdev_stats: number of vdev stats
4210 * @num_peer_stats: number of peer stats event structures 0 or max peers
4211 * @num_bcnflt_stats: number of beacon filter stats
4212 * @num_chan_stats: number of channel stats
4213 */
4214typedef struct {
4215 wmi_host_stats_id stats_id;
4216 uint32_t num_pdev_stats;
4217 uint32_t num_pdev_ext_stats;
4218 uint32_t num_vdev_stats;
4219 uint32_t num_peer_stats;
4220 uint32_t num_bcnflt_stats;
4221 uint32_t num_chan_stats;
4222} wmi_host_stats_event;
4223
4224/**
Govind Singh89727882016-04-15 13:58:27 +05304225 * struct wmi_host_peer_extd_stats - peer extd stats event structure
4226 * @peer_macaddr: Peer mac address
4227 * @inactive_time: inactive time in secs
4228 * @peer_chain_rssi: peer rssi
4229 * @rx_duration: RX duration
4230 * @peer_tx_bytes: TX bytes
4231 * @peer_rx_bytes: RX bytes
4232 * @last_tx_rate_code: Tx rate code of last frame
4233 * @last_tx_power: Tx power latest
4234 * @atf_tokens_allocated: atf tokens allocated
4235 * @atf_tokens_utilized: atf tokens utilized
4236 * @reserved: for future use
4237 */
4238typedef struct {
4239 wmi_host_mac_addr peer_macaddr;
4240 uint32_t inactive_time;
4241 uint32_t peer_chain_rssi;
4242 uint32_t rx_duration;
4243 uint32_t peer_tx_bytes;
4244 uint32_t peer_rx_bytes;
4245 uint32_t last_tx_rate_code;
4246 uint32_t last_tx_power;
4247 uint32_t atf_tokens_allocated;
4248 uint32_t atf_tokens_utilized;
4249 uint32_t reserved[4];
4250} wmi_host_peer_extd_stats;
4251
4252/**
4253 * struct wmi_host_pdev_ext_stats - peer ext stats structure
4254 * @rx_rssi_comb: RX rssi
4255 * @rx_rssi_chain0: RX rssi chain 0
4256 * @rx_rssi_chain1: RX rssi chain 1
4257 * @rx_rssi_chain2: RX rssi chain 2
4258 * @rx_rssi_chain3: RX rssi chain 3
4259 * @rx_mcs: RX MCS array
4260 * @tx_mcs: TX MCS array
4261 * @ack_rssi: Ack rssi
4262 */
4263typedef struct {
4264 uint32_t rx_rssi_comb;
4265 uint32_t rx_rssi_chain0;
4266 uint32_t rx_rssi_chain1;
4267 uint32_t rx_rssi_chain2;
4268 uint32_t rx_rssi_chain3;
4269 uint32_t rx_mcs[10];
4270 uint32_t tx_mcs[10];
4271 uint32_t ack_rssi;
4272} wmi_host_pdev_ext_stats;
4273
4274/**
4275 * struct wmi_host_dbg_tx_stats - Debug stats
4276 * @comp_queued: Num HTT cookies queued to dispatch list
4277 * @comp_delivered: Num HTT cookies dispatched
4278 * @msdu_enqued: Num MSDU queued to WAL
4279 * @mpdu_enqued: Num MPDU queue to WAL
4280 * @wmm_drop: Num MSDUs dropped by WMM limit
4281 * @local_enqued: Num Local frames queued
4282 * @local_freed: Num Local frames done
4283 * @hw_queued: Num queued to HW
4284 * @hw_reaped: Num PPDU reaped from HW
4285 * @underrun: Num underruns
4286 * @hw_paused: HW Paused.
4287 * @tx_abort: Num PPDUs cleaned up in TX abort
4288 * @mpdus_requed: Num MPDUs requed by SW
4289 * @tx_ko: excessive retries
4290 * @tx_xretry:
4291 * @data_rc: data hw rate code
4292 * @self_triggers: Scheduler self triggers
4293 * @sw_retry_failure: frames dropped due to excessive sw retries
4294 * @illgl_rate_phy_err: illegal rate phy errors
4295 * @pdev_cont_xretry: wal pdev continous xretry
4296 * @pdev_tx_timeout: wal pdev continous xretry
4297 * @pdev_resets: wal pdev resets
4298 * @stateless_tid_alloc_failure: frames dropped due to non-availability of
4299 * stateless TIDs
4300 * @phy_underrun: PhY/BB underrun
4301 * @txop_ovf: MPDU is more than txop limit
4302 * @seq_posted: Number of Sequences posted
4303 * @seq_failed_queueing: Number of Sequences failed queueing
4304 * @seq_completed: Number of Sequences completed
4305 * @seq_restarted: Number of Sequences restarted
4306 * @mu_seq_posted: Number of MU Sequences posted
4307 * @mpdus_sw_flush: Num MPDUs flushed by SW, HWPAUSED, SW TXABORT
4308 * (Reset,channel change)
4309 * @mpdus_hw_filter: Num MPDUs filtered by HW, all filter condition
4310 * (TTL expired)
4311 * @mpdus_truncated: Num MPDUs truncated by PDG (TXOP, TBTT,
4312 * PPDU_duration based on rate, dyn_bw)
4313 * @mpdus_ack_failed: Num MPDUs that was tried but didn't receive ACK or BA
4314 * @mpdus_expired: Num MPDUs that was dropped du to expiry.
4315 * @mc_dropr: Num mc drops
4316 */
4317typedef struct {
4318 int32_t comp_queued;
4319 int32_t comp_delivered;
4320 int32_t msdu_enqued;
4321 int32_t mpdu_enqued;
4322 int32_t wmm_drop;
4323 int32_t local_enqued;
4324 int32_t local_freed;
4325 int32_t hw_queued;
4326 int32_t hw_reaped;
4327 int32_t underrun;
4328 uint32_t hw_paused;
4329 int32_t tx_abort;
4330 int32_t mpdus_requed;
4331 uint32_t tx_ko;
4332 uint32_t tx_xretry;
4333 uint32_t data_rc;
4334 uint32_t self_triggers;
4335 uint32_t sw_retry_failure;
4336 uint32_t illgl_rate_phy_err;
4337 uint32_t pdev_cont_xretry;
4338 uint32_t pdev_tx_timeout;
4339 uint32_t pdev_resets;
4340 uint32_t stateless_tid_alloc_failure;
4341 uint32_t phy_underrun;
4342 uint32_t txop_ovf;
4343 uint32_t seq_posted;
4344 uint32_t seq_failed_queueing;
4345 uint32_t seq_completed;
4346 uint32_t seq_restarted;
4347 uint32_t mu_seq_posted;
4348 int32_t mpdus_sw_flush;
4349 int32_t mpdus_hw_filter;
4350 int32_t mpdus_truncated;
4351 int32_t mpdus_ack_failed;
4352 int32_t mpdus_expired;
4353 uint32_t mc_drop;
4354} wmi_host_dbg_tx_stats;
4355
4356/**
4357 * struct wmi_host_dbg_rx_stats - RX Debug stats
4358 * @mid_ppdu_route_change: Cnts any change in ring routing mid-ppdu
4359 * @status_rcvd: Total number of statuses processed
4360 * @r0_frags: Extra frags on rings 0
4361 * @r1_frags: Extra frags on rings 1
4362 * @r2_frags: Extra frags on rings 2
4363 * @r3_frags: Extra frags on rings 3
4364 * @htt_msdus: MSDUs delivered to HTT
4365 * @htt_mpdus: MPDUs delivered to HTT
4366 * @loc_msdus: MSDUs delivered to local stack
4367 * @loc_mpdus: MPDUS delivered to local stack
4368 * @oversize_amsdu: AMSDUs that have more MSDUs than the status ring size
4369 * @phy_errs: Number of PHY errors
4370 * @phy_err_drop: Number of PHY errors drops
4371 * @mpdu_errs: Number of mpdu errors - FCS, MIC, ENC etc.
4372 * @pdev_rx_timeout: Number of rx inactivity timeouts
4373 * @rx_ovfl_errs: Number of rx overflow errors.
4374 */
4375typedef struct {
4376 int32_t mid_ppdu_route_change;
4377 int32_t status_rcvd;
4378 int32_t r0_frags;
4379 int32_t r1_frags;
4380 int32_t r2_frags;
4381 int32_t r3_frags;
4382 int32_t htt_msdus;
4383 int32_t htt_mpdus;
4384 int32_t loc_msdus;
4385 int32_t loc_mpdus;
4386 int32_t oversize_amsdu;
4387 int32_t phy_errs;
4388 int32_t phy_err_drop;
4389 int32_t mpdu_errs;
4390 uint32_t pdev_rx_timeout;
4391 int32_t rx_ovfl_errs;
4392} wmi_host_dbg_rx_stats;
4393
4394/** struct wmi_host_dbg_mem_stats - memory stats
4395 * @iram_free_size: IRAM free size on target
4396 * @dram_free_size: DRAM free size on target
4397 * @sram_free_size: SRAM free size on target
4398 */
4399typedef struct {
4400 uint32_t iram_free_size;
4401 uint32_t dram_free_size;
4402 /* Only Non-TLV */
4403 uint32_t sram_free_size;
4404} wmi_host_dbg_mem_stats;
4405
4406typedef struct {
4407 /* Only TLV */
4408 int32_t dummy;/* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
4409} wmi_host_dbg_peer_stats;
4410
4411/**
4412 * struct wmi_host_dbg_stats - host debug stats
4413 * @tx: TX stats of type wmi_host_dbg_tx_stats
4414 * @rx: RX stats of type wmi_host_dbg_rx_stats
4415 * @mem: Memory stats of type wmi_host_dbg_mem_stats
4416 * @peer: peer stats of type wmi_host_dbg_peer_stats
4417 */
4418typedef struct {
4419 wmi_host_dbg_tx_stats tx;
4420 wmi_host_dbg_rx_stats rx;
4421 wmi_host_dbg_mem_stats mem;
4422 wmi_host_dbg_peer_stats peer;
4423} wmi_host_dbg_stats;
4424
4425/**
4426 * struct wmi_host_pdev_stats - PDEV stats
4427 * @chan_nf: Channel noise floor
4428 * @tx_frame_count: TX frame count
4429 * @rx_frame_count: RX frame count
4430 * @rx_clear_count: rx clear count
4431 * @cycle_count: cycle count
4432 * @phy_err_count: Phy error count
4433 * @chan_tx_pwr: Channel Tx Power
4434 * @pdev_stats: WAL dbg stats
4435 * @ackRcvBad:
4436 * @rtsBad:
4437 * @rtsGood:
4438 * @fcsBad:
4439 * @noBeacons:
4440 * @mib_int_count:
4441 */
4442typedef struct {
4443 int32_t chan_nf;
4444 uint32_t tx_frame_count;
4445 uint32_t rx_frame_count;
4446 uint32_t rx_clear_count;
4447 uint32_t cycle_count;
4448 uint32_t phy_err_count;
4449 uint32_t chan_tx_pwr;
4450 wmi_host_dbg_stats pdev_stats;
4451 uint32_t ackRcvBad;
4452 uint32_t rtsBad;
4453 uint32_t rtsGood;
4454 uint32_t fcsBad;
4455 uint32_t noBeacons;
4456 uint32_t mib_int_count;
4457} wmi_host_pdev_stats;
4458
4459/**
4460 * struct wmi_host_snr_info - WMI host Signal to noise ration info
4461 * @bcn_snr: beacon SNR
4462 * @dat_snr: Data frames SNR
4463 */
4464typedef struct {
4465 int32_t bcn_snr;
4466 int32_t dat_snr;
4467} wmi_host_snr_info;
4468
4469#define WMI_HOST_MAX_TX_RATE_VALUES 10 /*Max Tx Rates */
4470#define WMI_HOST_MAX_RSSI_VALUES 10 /*Max Rssi values */
4471
4472/* The WLAN_MAX_AC macro cannot be changed without breaking
4473 * * WMI compatibility.
4474 * * The maximum value of access category
4475 * */
4476#define WMI_HOST_WLAN_MAX_AC 4
4477
4478/**
4479 * struct wmi_host_vdev_stats - vdev stats structure
4480 * @vdev_id: unique id identifying the VDEV, generated by the caller
4481 * Rest all Only TLV
4482 * @vdev_snr: wmi_host_snr_info
4483 * @tx_frm_cnt: Total number of packets(per AC) that were successfully
4484 * transmitted (with and without retries,
4485 * including multi-cast, broadcast)
4486 * @rx_frm_cnt: Total number of packets that were successfully received
4487 * (after appropriate filter rules including multi-cast, broadcast)
4488 * @multiple_retry_cnt: The number of MSDU packets and MMPDU frames per AC
4489 * that the 802.11 station successfully transmitted after
4490 * more than one retransmission attempt
4491 * @fail_cnt: Total number packets(per AC) failed to transmit
4492 * @rts_fail_cnt: Total number of RTS/CTS sequence failures for transmission
4493 * of a packet
4494 * @rts_succ_cnt: Total number of RTS/CTS sequence success for transmission
4495 * of a packet
4496 * @rx_err_cnt: The receive error count. HAL will provide the
4497 * RxP FCS error global
4498 * @rx_discard_cnt: The sum of the receive error count and
4499 * dropped-receive-buffer error count (FCS error)
4500 * @ack_fail_cnt: Total number packets failed transmit because of no
4501 * ACK from the remote entity
4502 * @tx_rate_history:History of last ten transmit rate, in units of 500 kbit/sec
4503 * @bcn_rssi_history: History of last ten Beacon rssi of the connected Bss
4504 */
4505typedef struct {
4506 uint32_t vdev_id;
4507 /* Rest all Only TLV */
4508 wmi_host_snr_info vdev_snr;
4509 uint32_t tx_frm_cnt[WMI_HOST_WLAN_MAX_AC];
4510 uint32_t rx_frm_cnt;
4511 uint32_t multiple_retry_cnt[WMI_HOST_WLAN_MAX_AC];
4512 uint32_t fail_cnt[WMI_HOST_WLAN_MAX_AC];
4513 uint32_t rts_fail_cnt;
4514 uint32_t rts_succ_cnt;
4515 uint32_t rx_err_cnt;
4516 uint32_t rx_discard_cnt;
4517 uint32_t ack_fail_cnt;
4518 uint32_t tx_rate_history[WMI_HOST_MAX_TX_RATE_VALUES];
4519 uint32_t bcn_rssi_history[WMI_HOST_MAX_RSSI_VALUES];
4520} wmi_host_vdev_stats;
4521
4522/**
4523 * struct wmi_host_vdev_extd_stats - VDEV extended stats
4524 * @vdev_id: unique id identifying the VDEV, generated by the caller
4525 * @ppdu_aggr_cnt: No of Aggrs Queued to HW
4526 * @ppdu_noack: No of PPDU's not Acked includes both aggr and nonaggr's
4527 * @mpdu_queued: No of MPDU/Subframes's queued to HW in Aggregates
4528 * @ppdu_nonaggr_cnt: No of NonAggr/MPDU/Subframes's queued to HW
4529 * in Legacy NonAggregates
4530 * @mpdu_sw_requed: No of MPDU/Subframes's SW requeued includes
4531 * both Aggr and NonAggr
4532 * @mpdu_suc_retry: No of MPDU/Subframes's transmitted Successfully
4533 * after Single/mul HW retry
4534 * @mpdu_suc_multitry: No of MPDU/Subframes's transmitted Success
4535 * after Multiple HW retry
4536 * @mpdu_fail_retry: No of MPDU/Subframes's failed transmission
4537 * after Multiple HW retry
4538 * @reserved[13]: for future extensions set to 0x0
4539 */
4540typedef struct {
4541 uint32_t vdev_id;
4542 uint32_t ppdu_aggr_cnt;
4543 uint32_t ppdu_noack;
4544 uint32_t mpdu_queued;
4545 uint32_t ppdu_nonaggr_cnt;
4546 uint32_t mpdu_sw_requed;
4547 uint32_t mpdu_suc_retry;
4548 uint32_t mpdu_suc_multitry;
4549 uint32_t mpdu_fail_retry;
4550 uint32_t reserved[13];
4551} wmi_host_vdev_extd_stats;
4552
4553/**
4554 * struct wmi_host_peer_stats - peer stats
4555 * @peer_macaddr: peer MAC address
4556 * @peer_rssi: rssi
4557 * @peer_rssi_seq_num: rssi sequence number
4558 * @peer_tx_rate: last tx data rate used for peer
4559 * @peer_rx_rate: last rx data rate used for peer
4560 * @currentper: Current PER
4561 * @retries: Retries happend during transmission
4562 * @txratecount: Maximum Aggregation Size
4563 * @max4msframelen: Max4msframelen of tx rates used
4564 * @totalsubframes: Total no of subframes
4565 * @txbytes: No of bytes transmitted to the client
4566 * @nobuffs[4]: Packet Loss due to buffer overflows
4567 * @excretries[4]: Packet Loss due to excessive retries
4568 * @peer_rssi_changed: how many times peer's RSSI changed by a
4569 * non-negligible amount
4570 */
4571typedef struct {
4572 wmi_host_mac_addr peer_macaddr;
4573 uint32_t peer_rssi;
4574 uint32_t peer_rssi_seq_num;
4575 uint32_t peer_tx_rate;
4576 uint32_t peer_rx_rate;
4577 uint32_t currentper;
4578 uint32_t retries;
4579 uint32_t txratecount;
4580 uint32_t max4msframelen;
4581 uint32_t totalsubframes;
4582 uint32_t txbytes;
4583 uint32_t nobuffs[4];
4584 uint32_t excretries[4];
4585 uint32_t peer_rssi_changed;
4586} wmi_host_peer_stats;
4587
4588typedef struct {
4589 uint32_t dummy;
4590} wmi_host_bcnflt_stats;
4591
4592/**
4593 * struct wmi_host_chan_stats - WMI chan stats
4594 * @chan_mhz: Primary channel freq of the channel for which stats are sent
4595 * @sampling_period_us: Time spent on the channel
4596 * @rx_clear_count: Aggregate duration over a sampling period for
4597 * which channel activity was observed
4598 * @tx_duration_us: Accumalation of the TX PPDU duration over a sampling period
4599 * @rx_duration_us: Accumalation of the RX PPDU duration over a sampling period
4600 */
4601typedef struct {
4602 uint32_t chan_mhz;
4603 uint32_t sampling_period_us;
4604 uint32_t rx_clear_count;
4605 uint32_t tx_duration_us;
4606 uint32_t rx_duration_us;
4607} wmi_host_chan_stats;
4608
4609#define WMI_EVENT_ID_INVALID 0
4610/**
4611 * Host based ENUM IDs for events to abstract target enums for event_id
4612 */
4613typedef enum {
4614 wmi_service_ready_event_id = 0,
4615 wmi_ready_event_id,
4616 wmi_dbg_msg_event_id,
4617 wmi_scan_event_id,
4618 wmi_echo_event_id,
4619 wmi_update_stats_event_id,
4620 wmi_inst_rssi_stats_event_id,
4621 wmi_vdev_start_resp_event_id,
4622 wmi_vdev_standby_req_event_id,
4623 wmi_vdev_resume_req_event_id,
4624 wmi_vdev_stopped_event_id,
4625 wmi_peer_sta_kickout_event_id,
4626 wmi_host_swba_event_id,
4627 wmi_tbttoffset_update_event_id,
4628 wmi_mgmt_rx_event_id,
4629 wmi_chan_info_event_id,
4630 wmi_phyerr_event_id,
4631 wmi_roam_event_id,
4632 wmi_profile_match,
4633 wmi_debug_print_event_id,
4634 wmi_pdev_qvit_event_id,
4635 wmi_wlan_profile_data_event_id,
4636 wmi_rtt_meas_report_event_id,
4637 wmi_tsf_meas_report_event_id,
4638 wmi_rtt_error_report_event_id,
4639 wmi_rtt_keepalive_event_id,
4640 wmi_oem_cap_event_id,
4641 wmi_oem_meas_report_event_id,
4642 wmi_oem_report_event_id,
4643 wmi_nan_event_id,
4644 wmi_wow_wakeup_host_event_id,
4645 wmi_gtk_offload_status_event_id,
4646 wmi_gtk_rekey_fail_event_id,
4647 wmi_dcs_interference_event_id,
4648 wmi_pdev_tpc_config_event_id,
4649 wmi_csa_handling_event_id,
4650 wmi_gpio_input_event_id,
4651 wmi_peer_ratecode_list_event_id,
4652 wmi_generic_buffer_event_id,
4653 wmi_mcast_buf_release_event_id,
4654 wmi_mcast_list_ageout_event_id,
4655 wmi_vdev_get_keepalive_event_id,
4656 wmi_wds_peer_event_id,
4657 wmi_peer_sta_ps_statechg_event_id,
4658 wmi_pdev_fips_event_id,
4659 wmi_tt_stats_event_id,
4660 wmi_pdev_channel_hopping_event_id,
4661 wmi_pdev_ani_cck_level_event_id,
4662 wmi_pdev_ani_ofdm_level_event_id,
4663 wmi_pdev_reserve_ast_entry_event_id,
4664 wmi_pdev_nfcal_power_event_id,
4665 wmi_pdev_tpc_event_id,
4666 wmi_pdev_get_ast_info_event_id,
4667 wmi_pdev_temperature_event_id,
4668 wmi_pdev_nfcal_power_all_channels_event_id,
4669 wmi_pdev_bss_chan_info_event_id,
4670 wmi_mu_report_event_id,
4671 wmi_pdev_utf_event_id,
4672 wmi_pdev_dump_event_id,
4673 wmi_tx_pause_event_id,
4674 wmi_dfs_radar_event_id,
4675 wmi_pdev_l1ss_track_event_id,
4676 wmi_service_ready_ext_event_id,
4677 wmi_vdev_install_key_complete_event_id,
4678 wmi_vdev_mcc_bcn_intvl_change_req_event_id,
4679 wmi_vdev_tsf_report_event_id,
4680 wmi_peer_info_event_id,
4681 wmi_peer_tx_fail_cnt_thr_event_id,
4682 wmi_peer_estimated_linkspeed_event_id,
4683 wmi_peer_state_event_id,
4684 wmi_offload_bcn_tx_status_event_id,
4685 wmi_offload_prob_resp_tx_status_event_id,
4686 wmi_mgmt_tx_completion_event_id,
4687 wmi_tx_delba_complete_event_id,
4688 wmi_tx_addba_complete_event_id,
4689 wmi_ba_rsp_ssn_event_id,
4690 wmi_aggr_state_trig_event_id,
4691 wmi_roam_synch_event_id,
4692 wmi_p2p_disc_event_id,
4693 wmi_p2p_noa_event_id,
4694 wmi_pdev_resume_event_id,
4695 wmi_do_wow_disable_ack_event_id,
4696 wmi_wow_initial_wakeup_event_id,
4697 wmi_stats_ext_event_id,
4698 wmi_iface_link_stats_event_id,
4699 wmi_peer_link_stats_event_id,
4700 wmi_radio_link_stats_link,
4701 wmi_update_fw_mem_dump_event_id,
4702 wmi_diag_event_id_log_supported_event_id,
4703 wmi_nlo_match_event_id,
4704 wmi_nlo_scan_complete_event_id,
4705 wmi_apfind_event_id,
4706 wmi_passpoint_match_event_id,
4707 wmi_chatter_pc_query_event_id,
4708 wmi_pdev_ftm_intg_event_id,
4709 wmi_wlan_freq_avoid_event_id,
4710 wmi_thermal_mgmt_event_id,
4711 wmi_diag_container_event_id,
4712 wmi_host_auto_shutdown_event_id,
4713 wmi_update_whal_mib_stats_event_id,
4714 wmi_update_vdev_rate_stats_event_id,
4715 wmi_diag_event_id,
4716 wmi_ocb_set_sched_event_id,
4717 wmi_dbg_mesg_flush_complete_event_id,
4718 wmi_rssi_breach_event_id,
4719 wmi_uploadh_event_id,
4720 wmi_captureh_event_id,
4721 wmi_rfkill_state_change_event_id,
4722 wmi_tdls_peer_event_id,
4723 wmi_batch_scan_enabled_event_id,
4724 wmi_batch_scan_result_event_id,
4725 wmi_lpi_result_event_id,
4726 wmi_lpi_status_event_id,
4727 wmi_lpi_handoff_event_id,
4728 wmi_extscan_start_stop_event_id,
4729 wmi_extscan_operation_event_id,
4730 wmi_extscan_table_usage_event_id,
4731 wmi_extscan_cached_results_event_id,
4732 wmi_extscan_wlan_change_results_event_id,
4733 wmi_extscan_hotlist_match_event_id,
4734 wmi_extscan_capabilities_event_id,
4735 wmi_extscan_hotlist_ssid_match_event_id,
4736 wmi_mdns_stats_event_id,
4737 wmi_sap_ofl_add_sta_event_id,
4738 wmi_sap_ofl_del_sta_event_id,
4739 wmi_ocb_set_config_resp_event_id,
4740 wmi_ocb_get_tsf_timer_resp_event_id,
4741 wmi_dcc_get_stats_resp_event_id,
4742 wmi_dcc_update_ndl_resp_event_id,
4743 wmi_dcc_stats_event_id,
4744 wmi_soc_set_hw_mode_resp_event_id,
4745 wmi_soc_hw_mode_transition_event_id,
4746 wmi_soc_set_dual_mac_config_resp_event_id,
4747 wmi_tx_data_traffic_ctrl_event_id,
4748
4749 wmi_events_max,
4750} wmi_conv_event_id;
4751
4752#define WMI_UNAVAILABLE_PARAM 0
4753/**
4754 * Host based ENUM IDs for PDEV params to abstract target enums
4755 */
4756typedef enum {
4757 wmi_pdev_param_tx_chain_mask = 0,
4758 wmi_pdev_param_rx_chain_mask,
4759 wmi_pdev_param_txpower_limit2g,
4760 wmi_pdev_param_txpower_limit5g,
4761 wmi_pdev_param_txpower_scale,
4762 wmi_pdev_param_beacon_gen_mode,
4763 wmi_pdev_param_beacon_tx_mode,
4764 wmi_pdev_param_resmgr_offchan_mode,
4765 wmi_pdev_param_protection_mode,
4766 wmi_pdev_param_dynamic_bw,
4767 wmi_pdev_param_non_agg_sw_retry_th,
4768 wmi_pdev_param_agg_sw_retry_th,
4769 wmi_pdev_param_sta_kickout_th,
4770 wmi_pdev_param_ac_aggrsize_scaling,
4771 wmi_pdev_param_ltr_enable,
4772 wmi_pdev_param_ltr_ac_latency_be,
4773 wmi_pdev_param_ltr_ac_latency_bk,
4774 wmi_pdev_param_ltr_ac_latency_vi,
4775 wmi_pdev_param_ltr_ac_latency_vo,
4776 wmi_pdev_param_ltr_ac_latency_timeout,
4777 wmi_pdev_param_ltr_sleep_override,
4778 wmi_pdev_param_ltr_rx_override,
4779 wmi_pdev_param_ltr_tx_activity_timeout,
4780 wmi_pdev_param_l1ss_enable,
4781 wmi_pdev_param_dsleep_enable,
4782 wmi_pdev_param_pcielp_txbuf_flush,
4783 wmi_pdev_param_pcielp_txbuf_watermark,
4784 wmi_pdev_param_pcielp_txbuf_tmo_en,
4785 wmi_pdev_param_pcielp_txbuf_tmo_value,
4786 wmi_pdev_param_pdev_stats_update_period,
4787 wmi_pdev_param_vdev_stats_update_period,
4788 wmi_pdev_param_peer_stats_update_period,
4789 wmi_pdev_param_bcnflt_stats_update_period,
4790 wmi_pdev_param_pmf_qos,
4791 wmi_pdev_param_arp_ac_override,
4792 wmi_pdev_param_dcs,
4793 wmi_pdev_param_ani_enable,
4794 wmi_pdev_param_ani_poll_period,
4795 wmi_pdev_param_ani_listen_period,
4796 wmi_pdev_param_ani_ofdm_level,
4797 wmi_pdev_param_ani_cck_level,
4798 wmi_pdev_param_dyntxchain,
4799 wmi_pdev_param_proxy_sta,
4800 wmi_pdev_param_idle_ps_config,
4801 wmi_pdev_param_power_gating_sleep,
4802 wmi_pdev_param_aggr_burst,
4803 wmi_pdev_param_rx_decap_mode,
4804 wmi_pdev_param_fast_channel_reset,
4805 wmi_pdev_param_burst_dur,
4806 wmi_pdev_param_burst_enable,
4807 wmi_pdev_param_smart_antenna_default_antenna,
4808 wmi_pdev_param_igmpmld_override,
4809 wmi_pdev_param_igmpmld_tid,
4810 wmi_pdev_param_antenna_gain,
4811 wmi_pdev_param_rx_filter,
4812 wmi_pdev_set_mcast_to_ucast_tid,
4813 wmi_pdev_param_proxy_sta_mode,
4814 wmi_pdev_param_set_mcast2ucast_mode,
4815 wmi_pdev_param_set_mcast2ucast_buffer,
4816 wmi_pdev_param_remove_mcast2ucast_buffer,
4817 wmi_pdev_peer_sta_ps_statechg_enable,
4818 wmi_pdev_param_igmpmld_ac_override,
4819 wmi_pdev_param_block_interbss,
4820 wmi_pdev_param_set_disable_reset_cmdid,
4821 wmi_pdev_param_set_msdu_ttl_cmdid,
4822 wmi_pdev_param_set_ppdu_duration_cmdid,
4823 wmi_pdev_param_txbf_sound_period_cmdid,
4824 wmi_pdev_param_set_promisc_mode_cmdid,
4825 wmi_pdev_param_set_burst_mode_cmdid,
4826 wmi_pdev_param_en_stats,
4827 wmi_pdev_param_mu_group_policy,
4828 wmi_pdev_param_noise_detection,
4829 wmi_pdev_param_noise_threshold,
4830 wmi_pdev_param_dpd_enable,
4831 wmi_pdev_param_set_mcast_bcast_echo,
4832 wmi_pdev_param_atf_strict_sch,
4833 wmi_pdev_param_atf_sched_duration,
4834 wmi_pdev_param_ant_plzn,
4835 wmi_pdev_param_mgmt_retry_limit,
4836 wmi_pdev_param_sensitivity_level,
4837 wmi_pdev_param_signed_txpower_2g,
4838 wmi_pdev_param_signed_txpower_5g,
4839 wmi_pdev_param_enable_per_tid_amsdu,
4840 wmi_pdev_param_enable_per_tid_ampdu,
4841 wmi_pdev_param_cca_threshold,
4842 wmi_pdev_param_rts_fixed_rate,
4843 wmi_pdev_param_cal_period,
4844 wmi_pdev_param_pdev_reset,
4845 wmi_pdev_param_wapi_mbssid_offset,
4846 wmi_pdev_param_arp_srcaddr,
4847 wmi_pdev_param_arp_dstaddr,
4848 wmi_pdev_param_txpower_decr_db,
4849 wmi_pdev_param_rx_batchmode,
4850 wmi_pdev_param_packet_aggr_delay,
4851 wmi_pdev_param_atf_obss_noise_sch,
4852 wmi_pdev_param_atf_obss_noise_scaling_factor,
4853 wmi_pdev_param_cust_txpower_scale,
4854 wmi_pdev_param_atf_dynamic_enable,
4855 wmi_pdev_param_atf_ssid_group_policy,
4856 wmi_pdev_param_rfkill_enable,
4857 wmi_pdev_param_hw_rfkill_config,
4858 wmi_pdev_param_low_power_rf_enable,
4859 wmi_pdev_param_l1ss_track,
4860 wmi_pdev_param_hyst_en,
4861 wmi_pdev_param_power_collapse_enable,
4862 wmi_pdev_param_led_sys_state,
4863 wmi_pdev_param_led_enable,
4864 wmi_pdev_param_audio_over_wlan_latency,
4865 wmi_pdev_param_audio_over_wlan_enable,
4866 wmi_pdev_param_whal_mib_stats_update_enable,
4867 wmi_pdev_param_vdev_rate_stats_update_period,
4868 wmi_pdev_param_cts_cbw,
4869 wmi_pdev_param_wnts_config,
4870 wmi_pdev_param_adaptive_early_rx_enable,
4871 wmi_pdev_param_adaptive_early_rx_min_sleep_slop,
4872 wmi_pdev_param_adaptive_early_rx_inc_dec_step,
4873 wmi_pdev_param_early_rx_fix_sleep_slop,
4874 wmi_pdev_param_bmiss_based_adaptive_bto_enable,
4875 wmi_pdev_param_bmiss_bto_min_bcn_timeout,
4876 wmi_pdev_param_bmiss_bto_inc_dec_step,
4877 wmi_pdev_param_bto_fix_bcn_timeout,
4878 wmi_pdev_param_ce_based_adaptive_bto_enable,
4879 wmi_pdev_param_ce_bto_combo_ce_value,
4880 wmi_pdev_param_tx_chain_mask_2g,
4881 wmi_pdev_param_rx_chain_mask_2g,
4882 wmi_pdev_param_tx_chain_mask_5g,
4883 wmi_pdev_param_rx_chain_mask_5g,
4884 wmi_pdev_param_tx_chain_mask_cck,
4885 wmi_pdev_param_tx_chain_mask_1ss,
4886
4887 wmi_pdev_param_max,
4888} wmi_conv_pdev_params_id;
4889
4890
4891/**
4892 * Host based ENUM IDs for VDEV params to abstract target enums
4893 */
4894typedef enum {
4895 wmi_vdev_param_rts_threshold = 0,
4896 wmi_vdev_param_fragmentation_threshold,
4897 wmi_vdev_param_beacon_interval,
4898 wmi_vdev_param_listen_interval,
4899 wmi_vdev_param_multicast_rate,
4900 wmi_vdev_param_mgmt_tx_rate,
4901 wmi_vdev_param_slot_time,
4902 wmi_vdev_param_preamble,
4903 wmi_vdev_param_swba_time,
4904 wmi_vdev_stats_update_period,
4905 wmi_vdev_pwrsave_ageout_time,
4906 wmi_vdev_host_swba_interval,
4907 wmi_vdev_param_dtim_period,
4908 wmi_vdev_oc_scheduler_air_time_limit,
4909 wmi_vdev_param_wds,
4910 wmi_vdev_param_atim_window,
4911 wmi_vdev_param_bmiss_count_max,
4912 wmi_vdev_param_bmiss_first_bcnt,
4913 wmi_vdev_param_bmiss_final_bcnt,
4914 wmi_vdev_param_feature_wmm,
4915 wmi_vdev_param_chwidth,
4916 wmi_vdev_param_chextoffset,
4917 wmi_vdev_param_disable_htprotection,
4918 wmi_vdev_param_sta_quickkickout,
4919 wmi_vdev_param_mgmt_rate,
4920 wmi_vdev_param_protection_mode,
4921 wmi_vdev_param_fixed_rate,
4922 wmi_vdev_param_sgi,
4923 wmi_vdev_param_ldpc,
4924 wmi_vdev_param_tx_stbc,
4925 wmi_vdev_param_rx_stbc,
4926 wmi_vdev_param_intra_bss_fwd,
4927 wmi_vdev_param_def_keyid,
4928 wmi_vdev_param_nss,
4929 wmi_vdev_param_bcast_data_rate,
4930 wmi_vdev_param_mcast_data_rate,
4931 wmi_vdev_param_mcast_indicate,
4932 wmi_vdev_param_dhcp_indicate,
4933 wmi_vdev_param_unknown_dest_indicate,
4934 wmi_vdev_param_ap_keepalive_min_idle_inactive_time_secs,
4935 wmi_vdev_param_ap_keepalive_max_idle_inactive_time_secs,
4936 wmi_vdev_param_ap_keepalive_max_unresponsive_time_secs,
4937 wmi_vdev_param_ap_enable_nawds,
4938 wmi_vdev_param_mcast2ucast_set,
4939 wmi_vdev_param_enable_rtscts,
4940 wmi_vdev_param_rc_num_retries,
4941 wmi_vdev_param_txbf,
4942 wmi_vdev_param_packet_powersave,
4943 wmi_vdev_param_drop_unencry,
4944 wmi_vdev_param_tx_encap_type,
4945 wmi_vdev_param_ap_detect_out_of_sync_sleeping_sta_time_secs,
4946 wmi_vdev_param_cabq_maxdur,
4947 wmi_vdev_param_mfptest_set,
4948 wmi_vdev_param_rts_fixed_rate,
4949 wmi_vdev_param_vht_sgimask,
4950 wmi_vdev_param_vht80_ratemask,
4951 wmi_vdev_param_early_rx_adjust_enable,
4952 wmi_vdev_param_early_rx_tgt_bmiss_num,
4953 wmi_vdev_param_early_rx_bmiss_sample_cycle,
4954 wmi_vdev_param_early_rx_slop_step,
4955 wmi_vdev_param_early_rx_init_slop,
4956 wmi_vdev_param_early_rx_adjust_pause,
4957 wmi_vdev_param_proxy_sta,
4958 wmi_vdev_param_meru_vc,
4959 wmi_vdev_param_rx_decap_type,
4960 wmi_vdev_param_bw_nss_ratemask,
4961 wmi_vdev_param_sensor_ap,
4962 wmi_vdev_param_beacon_rate,
4963 wmi_vdev_param_dtim_enable_cts,
4964 wmi_vdev_param_sta_kickout,
4965 wmi_vdev_param_tx_pwrlimit,
4966 wmi_vdev_param_snr_num_for_cal,
4967 wmi_vdev_param_roam_fw_offload,
4968 wmi_vdev_param_enable_rmc,
4969 wmi_vdev_param_ibss_max_bcn_lost_ms,
4970 wmi_vdev_param_max_rate,
4971 wmi_vdev_param_early_rx_drift_sample,
4972 wmi_vdev_param_set_ibss_tx_fail_cnt_thr,
4973 wmi_vdev_param_ebt_resync_timeout,
4974 wmi_vdev_param_aggr_trig_event_enable,
4975 wmi_vdev_param_is_ibss_power_save_allowed,
4976 wmi_vdev_param_is_power_collapse_allowed,
4977 wmi_vdev_param_is_awake_on_txrx_enabled,
4978 wmi_vdev_param_inactivity_cnt,
4979 wmi_vdev_param_txsp_end_inactivity_time_ms,
4980 wmi_vdev_param_dtim_policy,
4981 wmi_vdev_param_ibss_ps_warmup_time_secs,
4982 wmi_vdev_param_ibss_ps_1rx_chain_in_atim_window_enable,
4983 wmi_vdev_param_rx_leak_window,
4984 wmi_vdev_param_stats_avg_factor,
4985 wmi_vdev_param_disconnect_th,
4986 wmi_vdev_param_rtscts_rate,
4987 wmi_vdev_param_mcc_rtscts_protection_enable,
4988 wmi_vdev_param_mcc_broadcast_probe_enable,
Himanshu Agarwal56c292f2016-07-19 15:41:51 +05304989 wmi_vdev_param_capabilities,
Govind Singh89727882016-04-15 13:58:27 +05304990
4991 wmi_vdev_param_max,
4992} wmi_conv_vdev_param_id;
4993
4994/**
4995 * Host based ENUM IDs for service bits to abstract target enums
4996 */
4997typedef enum {
4998 wmi_service_beacon_offload = 0,
4999 wmi_service_scan_offload,
5000 wmi_service_roam_offload,
5001 wmi_service_bcn_miss_offload,
5002 wmi_service_sta_pwrsave,
5003 wmi_service_sta_advanced_pwrsave,
5004 wmi_service_ap_uapsd,
5005 wmi_service_ap_dfs,
5006 wmi_service_11ac,
5007 wmi_service_blockack,
5008 wmi_service_phyerr,
5009 wmi_service_bcn_filter,
5010 wmi_service_rtt,
5011 wmi_service_ratectrl,
5012 wmi_service_wow,
5013 wmi_service_ratectrl_cache,
5014 wmi_service_iram_tids,
5015 wmi_service_burst,
5016 wmi_service_smart_antenna_sw_support,
5017 wmi_service_gtk_offload,
5018 wmi_service_scan_sch,
5019 wmi_service_csa_offload,
5020 wmi_service_chatter,
5021 wmi_service_coex_freqavoid,
5022 wmi_service_packet_power_save,
5023 wmi_service_force_fw_hang,
5024 wmi_service_smart_antenna_hw_support,
5025 wmi_service_gpio,
5026 wmi_sta_uapsd_basic_auto_trig,
5027 wmi_sta_uapsd_var_auto_trig,
5028 wmi_service_sta_keep_alive,
5029 wmi_service_tx_encap,
5030 wmi_service_ap_ps_detect_out_of_sync,
5031 wmi_service_early_rx,
5032 wmi_service_enhanced_proxy_sta,
5033 wmi_service_tt,
5034 wmi_service_atf,
5035 wmi_service_peer_caching,
5036 wmi_service_coex_gpio,
5037 wmi_service_aux_spectral_intf,
5038 wmi_service_aux_chan_load_intf,
5039 wmi_service_bss_channel_info_64,
5040 wmi_service_ext_res_cfg_support,
5041 wmi_service_mesh,
5042 wmi_service_restrt_chnl_support,
5043 wmi_service_roam_scan_offload,
5044 wmi_service_arpns_offload,
5045 wmi_service_nlo,
5046 wmi_service_sta_dtim_ps_modulated_dtim,
5047 wmi_service_sta_smps,
5048 wmi_service_fwtest,
5049 wmi_service_sta_wmmac,
5050 wmi_service_tdls,
5051 wmi_service_mcc_bcn_interval_change,
5052 wmi_service_adaptive_ocs,
5053 wmi_service_ba_ssn_support,
5054 wmi_service_filter_ipsec_natkeepalive,
5055 wmi_service_wlan_hb,
5056 wmi_service_lte_ant_share_support,
5057 wmi_service_batch_scan,
5058 wmi_service_qpower,
5059 wmi_service_plmreq,
5060 wmi_service_thermal_mgmt,
5061 wmi_service_rmc,
5062 wmi_service_mhf_offload,
5063 wmi_service_coex_sar,
5064 wmi_service_bcn_txrate_override,
5065 wmi_service_nan,
5066 wmi_service_l1ss_stat,
5067 wmi_service_estimate_linkspeed,
5068 wmi_service_obss_scan,
5069 wmi_service_tdls_offchan,
5070 wmi_service_tdls_uapsd_buffer_sta,
5071 wmi_service_tdls_uapsd_sleep_sta,
5072 wmi_service_ibss_pwrsave,
5073 wmi_service_lpass,
5074 wmi_service_extscan,
5075 wmi_service_d0wow,
5076 wmi_service_hsoffload,
5077 wmi_service_roam_ho_offload,
5078 wmi_service_rx_full_reorder,
5079 wmi_service_dhcp_offload,
5080 wmi_service_sta_rx_ipa_offload_support,
5081 wmi_service_mdns_offload,
5082 wmi_service_sap_auth_offload,
5083 wmi_service_dual_band_simultaneous_support,
5084 wmi_service_ocb,
5085 wmi_service_ap_arpns_offload,
5086 wmi_service_per_band_chainmask_support,
5087 wmi_service_packet_filter_offload,
5088 wmi_service_mgmt_tx_htt,
5089 wmi_service_mgmt_tx_wmi,
5090 wmi_service_ext_msg,
5091 wmi_service_mawc,
5092
5093 wmi_service_peer_stats,
5094 wmi_service_mesh_11s,
5095 wmi_service_periodic_chan_stat_support,
5096 wmi_service_tx_mode_push_only,
5097 wmi_service_tx_mode_push_pull,
5098 wmi_service_tx_mode_dynamic,
5099
5100 wmi_services_max,
5101} wmi_conv_service_ids;
5102#define WMI_SERVICE_UNAVAILABLE 0xFFFF
5103
5104/**
5105 * struct target_capability_info - Target capabilities in service ready
5106 * @phy_capability: PHY capabilities
5107 * @max_frag_entry: Maximum frag entries
5108 * @num_rf_chains: Number of RF chains supported
5109 * @ht_cap_info: HT cap info
5110 * @vht_cap_info: VHT cap info
5111 * @vht_supp_mcs: VHT Supported MCS
5112 * @hw_min_tx_power: HW minimum tx power
5113 * @hw_max_tx_power: HW maximum tx power
5114 * @sys_cap_info: sys capability info
5115 * @min_pkt_size_enable: Enterprise mode short pkt enable
5116 * @max_bcn_ie_size: Max beacon and probe rsp IE offload size
5117 * @max_num_scan_channels: Max scan channels
5118 * @max_supported_macs: max supported MCS
5119 * @wmi_fw_sub_feat_caps: FW sub feature capabilities
5120 * @txrx_chainmask: TXRX chain mask
5121 * @default_dbs_hw_mode_index: DBS hw mode index
5122 * @num_msdu_desc: number of msdu desc
5123 */
5124typedef struct {
5125 uint32_t phy_capability;
5126 uint32_t max_frag_entry;
5127 uint32_t num_rf_chains;
5128 uint32_t ht_cap_info;
5129 uint32_t vht_cap_info;
5130 uint32_t vht_supp_mcs;
5131 uint32_t hw_min_tx_power;
5132 uint32_t hw_max_tx_power;
5133 uint32_t sys_cap_info;
5134 uint32_t min_pkt_size_enable;
5135 uint32_t max_bcn_ie_size;
5136 uint32_t max_num_scan_channels;
5137 uint32_t max_supported_macs;
5138 uint32_t wmi_fw_sub_feat_caps;
5139 uint32_t txrx_chainmask;
5140 uint32_t default_dbs_hw_mode_index;
5141 uint32_t num_msdu_desc;
5142} target_capability_info;
5143
5144/**
5145 * struct wmi_host_fw_ver - FW version in non-tlv target
5146 * @sw_version: Versin info
5147 * @sw_version_1: Second dword of version
5148 */
5149struct wmi_host_fw_ver {
5150 uint32_t sw_version;
5151 uint32_t sw_version_1;
5152};
5153
5154/**
5155 * struct wmi_host_fw_abi_ver - FW version in non-tlv target
5156 * @sw_version: Versin info
5157 * @abi_version: ABI version
5158 */
5159struct wmi_host_fw_abi_ver {
5160 uint32_t sw_version;
5161 uint32_t abi_version;
5162};
5163
5164/**
5165 * struct target_resource_config - Resource config sent from host to target
5166 * abstracted out to include union of both configs
5167 * @num_vdevs: Number vdevs configured
5168 * @num_peers: Number of peers
5169 * @num_active_peers: Number of active peers for peer cache
5170 * @num_offload_peers: Number of offload peers
5171 * @num_offload_reorder_buffs: number of offload reorder buffs
5172 * @num_peer_keys: number of peer keys
5173 * @num_tids: number of tids
5174 * @ast_skid_limit: AST skid limit
5175 * @tx_chain_mask: TX chain mask
5176 * @rx_chain_mask: RX chain mask
5177 * @rx_timeout_pri: RX reorder timeout per AC
5178 * @rx_decap_mode: RX decap mode
5179 * @scan_max_pending_req: Scan mac pending req
5180 * @bmiss_offload_max_vdev: Beacom miss offload max vdevs
5181 * @roam_offload_max_vdev: Roam offload max vdevs
5182 * @roam_offload_max_ap_profiles: roam offload max ap profiles
5183 * @num_mcast_groups: num mcast groups
5184 * @num_mcast_table_elems: number of macst table elems
5185 * @mcast2ucast_mode: mcast enhance mode
5186 * @tx_dbg_log_size: DBG log buf size
5187 * @num_wds_entries: number of WDS entries
5188 * @dma_burst_size: DMA burst size.
5189 * @mac_aggr_delim: Mac aggr delim
5190 * @rx_skip_defrag_timeout_dup_detection_check: Defrag dup check in host?
5191 * @vow_config: vow configuration
5192 * @gtk_offload_max_vdev: Max vdevs for GTK offload
5193 * @num_msdu_desc: Number of msdu desc
5194 * @max_frag_entries: Max frag entries
5195 * End common
5196 * @max_peer_ext_stats: Max peer EXT stats
5197 * @smart_ant_cap: Smart antenna capabilities
5198 * @BK_Minfree: BIN configuration for BK traffic
5199 * @BE_Minfree: BIN configuration for BE traffic
5200 * @VI_Minfree: BIN configuration for VI traffic
5201 * @VO_Minfree: BIN configuration for VO traffic
5202 * @rx_batchmode: RX batch mode
5203 * @tt_support: Thermal throttling support
5204 * @atf_config: ATF config
5205 * @iphdr_pad_config: ipheader pad config
5206 * @qwrap_config: Qwrap configuration
5207 * @alloc_frag_desc_for_data_pkt: Frag desc for data
5208 * Added in MCL
5209 * @num_tdls_vdevs:
5210 * @num_tdls_conn_table_entries:
5211 * @beacon_tx_offload_max_vdev:
5212 * @num_multicast_filter_entries:
5213 * @num_wow_filters:
5214 * @num_keep_alive_pattern:
5215 * @keep_alive_pattern_size:
5216 * @max_tdls_concurrent_sleep_sta:
5217 * @max_tdls_concurrent_buffer_sta:
5218 * @wmi_send_separate:
5219 * @num_ocb_vdevs:
5220 * @num_ocb_channels:
5221 * @num_ocb_schedules:
5222 */
5223typedef struct {
5224 uint32_t num_vdevs;
5225 uint32_t num_peers;
5226 uint32_t num_active_peers;
5227 uint32_t num_offload_peers;
5228 uint32_t num_offload_reorder_buffs;
5229 uint32_t num_peer_keys;
5230 uint32_t num_tids;
5231 uint32_t ast_skid_limit;
5232 uint32_t tx_chain_mask;
5233 uint32_t rx_chain_mask;
5234 uint32_t rx_timeout_pri[4];
5235 uint32_t rx_decap_mode;
5236 uint32_t scan_max_pending_req;
5237 uint32_t bmiss_offload_max_vdev;
5238 uint32_t roam_offload_max_vdev;
5239 uint32_t roam_offload_max_ap_profiles;
5240 uint32_t num_mcast_groups;
5241 uint32_t num_mcast_table_elems;
5242 uint32_t mcast2ucast_mode;
5243 uint32_t tx_dbg_log_size;
5244 uint32_t num_wds_entries;
5245 uint32_t dma_burst_size;
5246 uint32_t mac_aggr_delim;
5247 uint32_t rx_skip_defrag_timeout_dup_detection_check;
5248 uint32_t vow_config;
5249 uint32_t gtk_offload_max_vdev;
5250 uint32_t num_msdu_desc; /* Number of msdu desc */
5251 uint32_t max_frag_entries;
5252 /* End common */
5253
5254 /* Added for Beeliner */
5255 uint32_t max_peer_ext_stats;
5256 uint32_t smart_ant_cap;
5257 uint32_t BK_Minfree;
5258 uint32_t BE_Minfree;
5259 uint32_t VI_Minfree;
5260 uint32_t VO_Minfree;
5261 uint32_t rx_batchmode;
5262 uint32_t tt_support;
5263 uint32_t atf_config;
5264 uint32_t iphdr_pad_config;
5265 uint32_t
5266 qwrap_config:16,
5267 alloc_frag_desc_for_data_pkt:16;
5268
5269 /* Added in MCL */
5270 uint32_t num_tdls_vdevs;
5271 uint32_t num_tdls_conn_table_entries;
5272 uint32_t beacon_tx_offload_max_vdev;
5273 uint32_t num_multicast_filter_entries;
5274 uint32_t num_wow_filters;
5275 uint32_t num_keep_alive_pattern;
5276 uint32_t keep_alive_pattern_size;
5277 uint32_t max_tdls_concurrent_sleep_sta;
5278 uint32_t max_tdls_concurrent_buffer_sta;
5279 uint32_t wmi_send_separate;
5280 uint32_t num_ocb_vdevs;
5281 uint32_t num_ocb_channels;
5282 uint32_t num_ocb_schedules;
5283} target_resource_config;
5284
5285/**
5286 * struct wds_addr_event - WDS addr event structure
5287 * @event_type: event type add/delete
5288 * @peer_mac: peer mac
5289 * @dest_mac: destination mac address
5290 */
5291typedef struct {
5292 uint32_t event_type[4];
5293 u_int8_t peer_mac[IEEE80211_ADDR_LEN];
5294 u_int8_t dest_mac[IEEE80211_ADDR_LEN];
5295} wds_addr_event_t;
5296/**
5297 * Enum replicated for host abstraction with FW
5298 */
5299typedef enum {
5300 /* Event respose of START CMD */
5301 WMI_HOST_VDEV_START_RESP_EVENT = 0,
5302 /* Event respose of RESTART CMD */
5303 WMI_HOST_VDEV_RESTART_RESP_EVENT,
5304} WMI_HOST_START_EVENT_PARAM;
5305
5306/**
5307 * struct wmi_host_vdev_start_resp - VDEV start response
5308 * @vdev_id: vdev id
5309 * @requestor_id: requestor id that requested the VDEV start request
5310 * @resp_type: Respose of Event type START/RESTART
5311 * @status: status of the response
5312 * @chain_mask: Vdev chain mask
5313 * @smps_mode: Vdev mimo power save mode
5314 * @mac_id: mac_id field contains the MAC identifier that the
5315 * VDEV is bound to. The valid range is 0 to (num_macs-1).
5316 * @cfgd_tx_streams: Configured Transmit Streams
5317 * @cfgd_rx_streams: Configured Receive Streams
5318 */
5319typedef struct {
5320 uint32_t vdev_id;
5321 uint32_t requestor_id;
5322 WMI_HOST_START_EVENT_PARAM resp_type;
5323 uint32_t status;
5324 uint32_t chain_mask;
5325 uint32_t smps_mode;
5326 uint32_t mac_id;
5327 uint32_t cfgd_tx_streams;
5328 uint32_t cfgd_rx_streams;
5329} wmi_host_vdev_start_resp;
5330
5331#define WMI_HOST_ATH_MAX_ANTENNA 4
5332/**
5333 * struct wmi_host_mgmt_rx_hdr - host mgmt header params
5334 * @channel: channel on which this frame is received
5335 * @snr: snr information used to cal rssi
5336 * @rssi_ctl[WMI_HOST_ATH_MAX_ANTENNA]: RSSI of PRI 20MHz for each chain.
5337 * @rate: Rate kbps
5338 * @phy_mode: rx phy mode WLAN_PHY_MODE
5339 * @buf_len: length of the frame
5340 * @status: rx status
5341 * @flags: information about the management frame e.g. can give a
5342 * scan source for a scan result mgmt frame
5343 * @rssi: combined RSSI, i.e. the sum of the snr + noise floor (dBm units)
5344 * @tsf_delta:
5345 */
5346typedef struct {
5347 uint32_t channel;
5348 uint32_t snr;
5349 uint8_t rssi_ctl[WMI_HOST_ATH_MAX_ANTENNA];
5350 uint32_t rate;
5351 uint32_t phy_mode;
5352 uint32_t buf_len;
5353 uint32_t status;
5354 uint32_t flags;
5355 int32_t rssi;
5356 uint32_t tsf_delta;
5357} wmi_host_mgmt_rx_hdr;
5358
5359/**
5360 * struct wmi_host_roam_event - host roam event param
5361 * @vdev_id: vdev id
5362 * @reason: roam reason
5363 * @rssi: RSSI
5364 */
5365typedef struct {
5366 uint32_t vdev_id;
5367 uint32_t reason;
5368 uint32_t rssi;
5369} wmi_host_roam_event;
5370
5371/**
5372 * ENUM wmi_host_scan_event_type - Scan event type
5373 */
5374enum wmi_host_scan_event_type {
5375 WMI_HOST_SCAN_EVENT_STARTED = 0x1,
5376 WMI_HOST_SCAN_EVENT_COMPLETED = 0x2,
5377 WMI_HOST_SCAN_EVENT_BSS_CHANNEL = 0x4,
5378 WMI_HOST_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
5379 WMI_HOST_SCAN_EVENT_DEQUEUED = 0x10,
5380 WMI_HOST_SCAN_EVENT_PREEMPTED = 0x20,
5381 WMI_HOST_SCAN_EVENT_START_FAILED = 0x40,
5382 WMI_HOST_SCAN_EVENT_RESTARTED = 0x80,
5383 WMI_HOST_SCAN_EVENT_FOREIGN_CHANNEL_EXIT = 0x100,
5384 WMI_HOST_SCAN_EVENT_INVALID = 0x200,
5385 WMI_HOST_SCAN_EVENT_MAX = 0x8000
5386};
5387
5388/**
5389 * ENUM wmi_host_scan_completion_reason - Scan completion event type
5390 */
5391enum wmi_host_scan_completion_reason {
5392 /** scan related events */
5393 WMI_HOST_SCAN_REASON_NONE = 0xFF,
5394 WMI_HOST_SCAN_REASON_COMPLETED = 0,
5395 WMI_HOST_SCAN_REASON_CANCELLED = 1,
5396 WMI_HOST_SCAN_REASON_PREEMPTED = 2,
5397 WMI_HOST_SCAN_REASON_TIMEDOUT = 3,
5398 WMI_HOST_SCAN_REASON_INTERNAL_FAILURE = 4,
5399 WMI_HOST_SCAN_REASON_MAX,
5400};
5401
5402/**
5403 * struct wmi_host_scan_event - Scan event response from target
5404 * @event: event type
5405 * @reason: Reason for event
5406 * @channel_freq: channel frequency
5407 * @requestor: requestor id
5408 * @scan_id: scan id
5409 * @vdev_id: vdev id
5410 */
5411typedef struct {
5412 uint32_t event;
5413 uint32_t reason;
5414 uint32_t channel_freq;
5415 uint32_t requestor;
5416 uint32_t scan_id;
5417 uint32_t vdev_id;
5418} wmi_host_scan_event;
5419
5420/**
5421 * struct wmi_host_pdev_reserve_ast_entry_event - Reserve AST entry
5422 * @result: result
5423 */
5424typedef struct {
5425 uint32_t result;
5426} wmi_host_pdev_reserve_ast_entry_event;
5427
5428/**
5429 * struct wmi_host_mcast_ageout_entry - mcast aged-out entry
5430 * @grp_addr: IPv4/6 mcast group addr
5431 * @vdev_id: vdev id
5432 */
5433typedef struct {
5434 uint8_t grp_addr[16];
5435 uint32_t vdev_id;
5436} wmi_host_mcast_ageout_entry;
5437
5438/**
5439 * struct wmi_host_mcast_list_ageout_event - List of mcast entry aged-out
5440 * @num_entry: Number of mcast entries timed-out
5441 * @entry: List of wmi_host_mcast_ageout_entry
5442 */
5443typedef struct {
5444 uint32_t num_entry;
5445 wmi_host_mcast_ageout_entry entry[1];
5446} wmi_host_mcast_list_ageout_event;
5447
5448/**
5449 * struct wmi_host_pdev_nfcal_power_all_channels_event - NF cal event data
5450 * @nfdBr:
5451 * chan0: {NFCalPower_chain0, NFCalPower_chain1,
5452 * NFCalPower_chain2, NFCalPower_chain3},
5453 * chan1: {NFCalPower_chain0, NFCalPower_chain1,
5454 * NFCalPower_chain2, NFCalPower_chain3},
5455 * chan2: {NFCalPower_chain0, NFCalPower_chain1,
5456 * NFCalPower_chain2, NFCalPower_chain3},
5457 * chan3: {NFCalPower_chain0, NFCalPower_chain1,
5458 * NFCalPower_chain2, NFCalPower_chain3},
5459 * @nfdBr:
5460 * chan0: {NFCalPower_chain0, NFCalPower_chain1,
5461 * NFCalPower_chain2, NFCalPower_chain3},
5462 * chan1: {NFCalPower_chain0, NFCalPower_chain1,
5463 * NFCalPower_chain2, NFCalPower_chain3},
5464 * chan2: {NFCalPower_chain0, NFCalPower_chain1,
5465 * NFCalPower_chain2, NFCalPower_chain3},
5466 * chan3: {NFCalPower_chain0, NFCalPower_chain1,
5467 * NFCalPower_chain2, NFCalPower_chain3},
5468 * @freqNum: frequency number
5469 */
5470typedef struct {
5471 int8_t nfdBr[WMI_HOST_RXG_CAL_CHAN_MAX * WMI_HOST_MAX_NUM_CHAINS];
5472 int8_t nfdBm[WMI_HOST_RXG_CAL_CHAN_MAX * WMI_HOST_MAX_NUM_CHAINS];
5473 uint32_t freqNum[WMI_HOST_RXG_CAL_CHAN_MAX];
5474} wmi_host_pdev_nfcal_power_all_channels_event;
5475
5476/**
5477 * struct wmi_host_pdev_tpc_event - WMI host pdev TPC event
5478 * @tpc:
5479 */
5480typedef struct {
5481 uint32_t tpc[1];
5482} wmi_host_pdev_tpc_event;
5483
5484/**
5485 * struct wmi_host_pdev_generic_buffer_event
5486 * @buf_type: Buffer type
5487 * @frag_id: Frag id
5488 * @more_frag: more frags pending
5489 * @buf_len: buffer length
5490 * @buf_info: variable length buffer
5491 */
5492typedef struct {
5493 uint32_t buf_type;
5494 uint32_t frag_id;
5495 uint32_t more_frag;
5496 uint32_t buf_len;
5497 uint32_t buf_info[1];
5498} wmi_host_pdev_generic_buffer_event;
5499/**
5500 * Enum for host buffer event
5501 */
5502enum {
5503 WMI_HOST_BUFFER_TYPE_RATEPWR_TABLE,
5504 WMI_HOST_BUFFER_TYPE_CTL_TABLE,
5505};
5506
5507/**
5508 * struct wmi_host_pdev_tpc_config_event - host pdev tpc config event
5509 * @regDomain:
5510 * @chanFreq:
5511 * @phyMode:
5512 * @twiceAntennaReduction:
5513 * @twiceMaxRDPower:
5514 * @twiceAntennaGain:
5515 * @powerLimit:
5516 * @rateMax:
5517 * @numTxChain:
5518 * @ctl:
5519 * @flags:
5520 * @maxRegAllowedPower:
5521 * @maxRegAllowedPowerAGCDD:
5522 * @maxRegAllowedPowerAGSTBC:
5523 * @maxRegAllowedPowerAGTXBF:
5524 * @ratesArray:
5525 */
5526typedef struct {
5527 uint32_t regDomain;
5528 uint32_t chanFreq;
5529 uint32_t phyMode;
5530 uint32_t twiceAntennaReduction;
5531 uint32_t twiceMaxRDPower;
5532 int32_t twiceAntennaGain;
5533 uint32_t powerLimit;
5534 uint32_t rateMax;
5535 uint32_t numTxChain;
5536 uint32_t ctl;
5537 uint32_t flags;
5538 int8_t maxRegAllowedPower[WMI_HOST_TPC_TX_NUM_CHAIN];
5539 int8_t maxRegAllowedPowerAGCDD[WMI_HOST_TPC_TX_NUM_CHAIN][WMI_HOST_TPC_TX_NUM_CHAIN];
5540 int8_t maxRegAllowedPowerAGSTBC[WMI_HOST_TPC_TX_NUM_CHAIN][WMI_HOST_TPC_TX_NUM_CHAIN];
5541 int8_t maxRegAllowedPowerAGTXBF[WMI_HOST_TPC_TX_NUM_CHAIN][WMI_HOST_TPC_TX_NUM_CHAIN];
5542 uint8_t ratesArray[WMI_HOST_TPC_RATE_MAX];
5543} wmi_host_pdev_tpc_config_event;
5544/**
5545 * Enums for TPC event
5546 */
5547typedef enum {
5548 WMI_HOST_TPC_CONFIG_EVENT_FLAG_TABLE_CDD = 0x1,
5549 WMI_HOST_TPC_CONFIG_EVENT_FLAG_TABLE_STBC = 0x2,
5550 WMI_HOST_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF = 0x4,
5551} WMI_HOST_TPC_CONFIG_EVENT_FLAG;
5552
5553/**
5554 * Medium Utilization evaluation algorithms
5555 * These algorithms can be complementary rather than exclusive.
5556 */
5557typedef enum {
5558 WMI_HOST_MU_BASIC_ALGO = 0x1,
5559 WMI_HOST_MU_PER_BSSID_ALGO = 0x2,
5560 WMI_HOST_MU_HIDDEN_NODE_ALGO = 0x4,
5561} WMI_HOST_MU_ALGO_TYPE;
5562/* max MU alg combinations supported by target */
5563#define WMI_HOST_MU_MAX_ALGO_TYPE 3
5564
5565/**
5566 * struct wmi_host_mu_report_event - WMI_MU_REPORT_EVENTID
5567 * @mu_request_id: request id
5568 * @status_reason: MU_STATUS_REASON
5569 * @total_mu: MU_ALG_TYPE combinations
5570 * @num_active_bssid: number of active bssid
5571 */
5572typedef struct {
5573 uint32_t mu_request_id;
5574 uint32_t status_reason;
5575 uint32_t total_mu[WMI_HOST_MU_MAX_ALGO_TYPE];
5576 uint32_t num_active_bssid;
5577} wmi_host_mu_report_event;
5578
5579/**
5580 * struct wmi_host_mgmt_tx_compl_event - TX completion event
5581 * @desc_id: from tx_send_cmd
5582 * @status: WMI_MGMT_TX_COMP_STATUS_TYPE
5583 */
5584typedef struct {
5585 uint32_t desc_id;
5586 uint32_t status;
5587} wmi_host_mgmt_tx_compl_event;
5588
5589#define WMI_HOST_TIM_BITMAP_ARRAY_SIZE 17
5590
5591/**
5592 * struct wmi_host_tim_info - TIM info in SWBA event
5593 * @tim_len: TIM length
5594 * @tim_mcast:
5595 * @tim_bitmap: TIM bitmap
5596 * @tim_changed: TIM changed
5597 * @tim_num_ps_pending: TIM num PS sta pending
5598 */
5599typedef struct {
5600 uint32_t tim_len;
5601 uint32_t tim_mcast;
5602 uint32_t tim_bitmap[WMI_HOST_TIM_BITMAP_ARRAY_SIZE];
5603 uint32_t tim_changed;
5604 uint32_t tim_num_ps_pending;
5605} wmi_host_tim_info;
5606
5607/**
5608 * struct wmi_host_p2p_noa_descriptor - NoA desc in SWBA event
5609 * @type_count: Absence count
5610 * @duration: NoA duration
5611 * @interval: NoA interval
5612 * @start_time: start time
5613 */
5614typedef struct {
5615 uint32_t type_count;
5616 uint32_t duration;
5617 uint32_t interval;
5618 uint32_t start_time;
5619} wmi_host_p2p_noa_descriptor;
5620/* Maximum number of NOA Descriptors supported */
5621#define WMI_HOST_P2P_MAX_NOA_DESCRIPTORS 4
5622/**
5623 * struct wmi_host_p2p_noa_info - p2p noa information
5624 * @modified: NoA modified
5625 * @index: Index
5626 * @oppPS: Oppurtunstic ps
5627 * @ctwindow: CT window
5628 * @num_descriptors: number of descriptors
5629 * @noa_descriptors: noa descriptors
5630 */
5631typedef struct {
5632 uint8_t modified;
5633 uint8_t index;
5634 uint8_t oppPS;
5635 uint8_t ctwindow;
5636 uint8_t num_descriptors;
5637 wmi_host_p2p_noa_descriptor
5638 noa_descriptors[WMI_HOST_P2P_MAX_NOA_DESCRIPTORS];
5639} wmi_host_p2p_noa_info;
5640
5641/**
5642 * struct wmi_host_peer_sta_kickout_event
5643 * @peer_macaddr: peer mac address
5644 * @reason: kickout reason
5645 * @rssi: rssi
5646 */
5647typedef struct {
5648 uint8_t peer_macaddr[IEEE80211_ADDR_LEN];
5649 uint32_t reason;
5650 uint32_t rssi;
5651} wmi_host_peer_sta_kickout_event;
5652
5653/**
5654 * struct wmi_host_peer_sta_ps_statechange_event - ST ps state change event
5655 * @peer_macaddr: peer mac address
5656 * @peer_ps_stats: peer PS state
5657 */
5658typedef struct {
5659 uint8_t peer_macaddr[IEEE80211_ADDR_LEN];
5660 uint32_t peer_ps_state;
5661} wmi_host_peer_sta_ps_statechange_event;
5662
5663/* Maximum CCK, OFDM rates supported */
5664#define WMI_SA_MAX_CCK_OFDM_RATES 12
5665/* Maximum MCS rates supported; 4 rates in each dword */
5666#define WMI_SA_MAX_MCS_RATES 40
5667#define WMI_SA_MAX_RATE_COUNTERS 4
5668/* Maximum rate series used for transmission */
5669#define SA_MAX_RATE_SERIES 2
5670
5671#define SA_MAX_LEGACY_RATE_DWORDS 3
5672#define SA_MAX_HT_RATE_DWORDS 10
5673#define SA_BYTES_IN_DWORD 4
5674#define SA_MASK_BYTE 0xff
5675/* TODO: ratecode_160 needs to add for future chips */
5676/**
5677 * struct wmi_sa_rate_cap - smart antenna rat capabilities
5678 * @ratecode_legacy: Rate code array for CCK OFDM
5679 * @ratecode_20: Rate code array for 20MHz BW
5680 * @ratecode_40: Rate code array for 40MHz BW
5681 * @ratecode_80: Rate code array for 80MHz BW
5682 * @ratecount: Max Rate count for each mode
5683 */
5684typedef struct {
5685 uint8_t ratecode_legacy[WMI_SA_MAX_CCK_OFDM_RATES];
5686 uint8_t ratecode_20[WMI_SA_MAX_MCS_RATES];
5687 uint8_t ratecode_40[WMI_SA_MAX_MCS_RATES];
5688 uint8_t ratecode_80[WMI_SA_MAX_MCS_RATES];
5689 uint8_t ratecount[WMI_SA_MAX_RATE_COUNTERS];
5690} wmi_sa_rate_cap;
5691
5692/** Preamble types to be used with VDEV fixed rate configuration */
5693typedef enum {
5694 WMI_HOST_RATE_PREAMBLE_OFDM,
5695 WMI_HOST_RATE_PREAMBLE_CCK,
5696 WMI_HOST_RATE_PREAMBLE_HT,
5697 WMI_HOST_RATE_PREAMBLE_VHT,
5698} WMI_HOST_RATE_PREAMBLE;
5699
5700#define WMI_HOST_FIXED_RATE_NONE (0xff)
5701
5702/** slot time long */
5703#define WMI_HOST_VDEV_SLOT_TIME_LONG 0x1
5704/** slot time short */
5705#define WMI_HOST_VDEV_SLOT_TIME_SHORT 0x2
5706/** preablbe long */
5707#define WMI_HOST_VDEV_PREAMBLE_LONG 0x1
5708/** preablbe short */
5709#define WMI_HOST_VDEV_PREAMBLE_SHORT 0x2
5710/** found a better AP */
5711#define WMI_HOST_ROAM_REASON_BETTER_AP 0x1
5712/** beacon miss detected */
5713#define WMI_HOST_ROAM_REASON_BMISS 0x2
5714/** deauth/disassoc received */
5715#define WMI_HOST_ROAM_REASON_DEAUTH 0x2
5716/** connected AP's low rssi condition detected */
5717#define WMI_HOST_ROAM_REASON_LOW_RSSI 0x3
5718/** found another AP that matches SSID and Security profile in
5719 * WMI_ROAM_AP_PROFILE, found during scan triggered upon FINAL_BMISS
5720 */
5721#define WMI_HOST_ROAM_REASON_SUITABLE_AP 0x4
5722/** LFR3.0 roaming failed, indicate the disconnection to host */
5723#define WMI_HOST_ROAM_REASON_HO_FAILED 0x5
5724
5725/** values for vdev_type */
5726#define WMI_HOST_VDEV_TYPE_AP 0x1
5727#define WMI_HOST_VDEV_TYPE_STA 0x2
5728#define WMI_HOST_VDEV_TYPE_IBSS 0x3
5729#define WMI_HOST_VDEV_TYPE_MONITOR 0x4
5730
5731/** values for vdev_subtype */
5732#define WMI_HOST_VDEV_SUBTYPE_P2P_DEVICE 0x1
5733#define WMI_HOST_VDEV_SUBTYPE_P2P_CLIENT 0x2
5734#define WMI_HOST_VDEV_SUBTYPE_P2P_GO 0x3
5735#define WMI_HOST_VDEV_SUBTYPE_PROXY_STA 0x4
5736#define WMI_HOST_VDEV_SUBTYPE_MESH 0x5
5737
5738#define WMI_HOST_MGMT_TID 17
5739/* Disable aging & learning */
5740#define WMI_HOST_WDS_FLAG_STATIC 0x1
5741
5742/**
5743 * Peer param enum abstracted from target
5744 */
5745typedef enum {
5746 /** mimo powersave state */
5747 WMI_HOST_PEER_MIMO_PS_STATE = 0x1,
5748 /** enable/disable AMPDU . initial value (enabled) */
5749 WMI_HOST_PEER_AMPDU = 0x2,
5750 /** authorize/unauthorize peer. initial value is unauthorized (0) */
5751 WMI_HOST_PEER_AUTHORIZE = 0x3,
5752 /** peer channel bandwidth */
5753 WMI_HOST_PEER_CHWIDTH = 0x4,
5754 /** peer NSS */
5755 WMI_HOST_PEER_NSS = 0x5,
5756 /** USE 4 ADDR */
5757 WMI_HOST_PEER_USE_4ADDR = 0x6,
5758 /** Enable extended peer stats */
5759 WMI_HOST_PEER_EXT_STATS_ENABLE = 0x7,
5760 /*Use FIXED Pwr */
5761 WMI_HOST_PEER_USE_FIXED_PWR = 0x8,
5762 /* Set peer fixed rate */
5763 WMI_HOST_PEER_PARAM_FIXED_RATE = 0x9,
5764 /* Whitelist peer TIDs */
5765 WMI_HOST_PEER_SET_MU_WHITELIST = 0xa,
5766 /* set group membership status */
5767 WMI_HOST_PEER_MEMBERSHIP = 0xb,
5768 WMI_HOST_PEER_USERPOS = 0xc,
5769} PEER_PARAM_ENUM;
5770#define WMI_HOST_PEER_MIMO_PS_NONE 0x0
5771#define WMI_HOST_PEER_MIMO_PS_STATIC 0x1
5772#define WMI_HOST_PEER_MIMO_PS_DYNAMIC 0x2
5773typedef enum {
5774 HOST_PLATFORM_HIGH_PERF,
5775 HOST_PLATFORM_LOW_PERF,
5776} HOST_PLATFORM_TYPE;
5777
5778enum wmi_host_sta_ps_mode {
5779 /** enable power save for the given STA VDEV */
5780 WMI_HOST_STA_PS_MODE_DISABLED = 0,
5781 /** disable power save for a given STA VDEV */
5782 WMI_HOST_STA_PS_MODE_ENABLED = 1,
5783};
5784enum wmi_host_sta_powersave_param {
5785 /**
5786 * Controls how frames are retrievd from AP while STA is sleeping
5787 *
5788 * (see enum wmi_sta_ps_param_rx_wake_policy)
5789 */
5790 WMI_HOST_STA_PS_PARAM_RX_WAKE_POLICY = 0,
5791
5792 /**
5793 * The STA will go active after this many TX
5794 *
5795 * (see enum wmi_sta_ps_param_tx_wake_threshold)
5796 */
5797 WMI_HOST_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
5798
5799 /**
5800 * Number of PS-Poll to send before STA wakes up
5801 *
5802 * (see enum wmi_sta_ps_param_pspoll_count)
5803 *
5804 */
5805 WMI_HOST_STA_PS_PARAM_PSPOLL_COUNT = 2,
5806
5807 /**
5808 * TX/RX inactivity time in msec before going to sleep.
5809 *
5810 * The power save SM will monitor tx/rx activity on the VDEV, if no
5811 * activity for the specified msec of the parameter
5812 * the Power save SM will go to sleep.
5813 */
5814 WMI_HOST_STA_PS_PARAM_INACTIVITY_TIME = 3,
5815
5816 /**
5817 * Set uapsd configuration.
5818 *
5819 * (see enum wmi_sta_ps_param_uapsd)
5820 */
5821 WMI_HOST_STA_PS_PARAM_UAPSD = 4,
5822};
5823/* prefix used by scan requestor ids on the host
5824 * replicated here form wmi_unified.h*/
5825#define WMI_HOST_P_SCAN_REQUESTOR_ID_PREFIX 0xA000
5826/* prefix used by scan request ids generated on the host */
5827/* host cycles through the lower 12 bits to generate ids */
5828#define WMI_HOST_P_SCAN_REQ_ID_PREFIX 0xA000
5829
5830#define WMI_HOST_RC_DS_FLAG 0x01 /* Dual stream flag */
5831#define WMI_HOST_RC_CW40_FLAG 0x02 /* CW 40 */
5832#define WMI_HOST_RC_SGI_FLAG 0x04 /* Short Guard Interval */
5833#define WMI_HOST_RC_HT_FLAG 0x08 /* HT */
5834#define WMI_HOST_RC_RTSCTS_FLAG 0x10 /* RTS-CTS */
5835#define WMI_HOST_RC_TX_STBC_FLAG 0x20 /* TX STBC */
5836#define WMI_HOST_RC_RX_STBC_FLAG 0xC0 /* RX STBC ,2 bits */
5837#define WMI_HOST_RC_RX_STBC_FLAG_S 6 /* RX STBC ,2 bits */
5838#define WMI_HOST_RC_WEP_TKIP_FLAG 0x100 /* WEP/TKIP encryption */
5839#define WMI_HOST_RC_TS_FLAG 0x200 /* Three stream flag */
5840#define WMI_HOST_RC_UAPSD_FLAG 0x400 /* UAPSD Rate Control */
5841
5842/** HT Capabilities*/
5843#define WMI_HOST_HT_CAP_ENABLED 0x0001 /* HT Enabled/ disabled */
5844/* Short Guard Interval with HT20 */
5845#define WMI_HOST_HT_CAP_HT20_SGI 0x0002
5846#define WMI_HOST_HT_CAP_DYNAMIC_SMPS 0x0004 /* Dynamic MIMO powersave */
5847#define WMI_HOST_HT_CAP_TX_STBC 0x0008 /* B3 TX STBC */
5848#define WMI_HOST_HT_CAP_TX_STBC_MASK_SHIFT 3
5849#define WMI_HOST_HT_CAP_RX_STBC 0x0030 /* B4-B5 RX STBC */
5850#define WMI_HOST_HT_CAP_RX_STBC_MASK_SHIFT 4
5851#define WMI_HOST_HT_CAP_LDPC 0x0040 /* LDPC supported */
5852#define WMI_HOST_HT_CAP_L_SIG_TXOP_PROT 0x0080 /* L-SIG TXOP Protection */
5853#define WMI_HOST_HT_CAP_MPDU_DENSITY 0x0700 /* MPDU Density */
5854#define WMI_HOST_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8
5855#define WMI_HOST_HT_CAP_HT40_SGI 0x0800
5856#define WMI_HOST_HT_CAP_IBF_BFER 0x1000
5857
5858/* These macros should be used when we wish to advertise STBC support for
5859 * only 1SS or 2SS or 3SS. */
5860#define WMI_HOST_HT_CAP_RX_STBC_1SS 0x0010 /* B4-B5 RX STBC */
5861#define WMI_HOST_HT_CAP_RX_STBC_2SS 0x0020 /* B4-B5 RX STBC */
5862#define WMI_HOST_HT_CAP_RX_STBC_3SS 0x0030 /* B4-B5 RX STBC */
5863
5864
5865#define WMI_HOST_HT_CAP_DEFAULT_ALL (WMI_HOST_HT_CAP_ENABLED | \
5866 WMI_HOST_HT_CAP_HT20_SGI | \
5867 WMI_HOST_HT_CAP_HT40_SGI | \
5868 WMI_HOST_HT_CAP_TX_STBC | \
5869 WMI_HOST_HT_CAP_RX_STBC | \
5870 WMI_HOST_HT_CAP_LDPC)
5871
5872/* WMI_HOST_VHT_CAP_* these maps to ieee 802.11ac vht capability information
5873 field. The fields not defined here are not supported, or reserved.
5874 Do not change these masks and if you have to add new one follow the
5875 bitmask as specified by 802.11ac draft.
5876*/
5877
5878#define WMI_HOST_VHT_CAP_MAX_MPDU_LEN_MASK 0x00000003
5879#define WMI_HOST_VHT_CAP_RX_LDPC 0x00000010
5880#define WMI_HOST_VHT_CAP_SGI_80MHZ 0x00000020
5881#define WMI_HOST_VHT_CAP_SGI_160MHZ 0x00000040
5882#define WMI_HOST_VHT_CAP_TX_STBC 0x00000080
5883#define WMI_HOST_VHT_CAP_RX_STBC_MASK 0x00000300
5884#define WMI_HOST_VHT_CAP_RX_STBC_MASK_SHIFT 8
5885#define WMI_HOST_VHT_CAP_SU_BFER 0x00000800
5886#define WMI_HOST_VHT_CAP_SU_BFEE 0x00001000
5887#define WMI_HOST_VHT_CAP_MAX_CS_ANT_MASK 0x0000E000
5888#define WMI_HOST_VHT_CAP_MAX_CS_ANT_MASK_SHIFT 13
5889#define WMI_HOST_VHT_CAP_MAX_SND_DIM_MASK 0x00070000
5890#define WMI_HOST_VHT_CAP_MAX_SND_DIM_MASK_SHIFT 16
5891#define WMI_HOST_VHT_CAP_MU_BFER 0x00080000
5892#define WMI_HOST_VHT_CAP_MU_BFEE 0x00100000
5893#define WMI_HOST_VHT_CAP_MAX_AMPDU_LEN_EXP 0x03800000
5894#define WMI_HOST_VHT_CAP_MAX_AMPDU_LEN_EXP_SHIT 23
5895#define WMI_HOST_VHT_CAP_RX_FIXED_ANT 0x10000000
5896#define WMI_HOST_VHT_CAP_TX_FIXED_ANT 0x20000000
5897
5898#define WMI_HOST_VHT_CAP_MAX_MPDU_LEN_11454 0x00000002
5899
5900/* These macros should be used when we wish to advertise STBC support for
5901 * only 1SS or 2SS or 3SS. */
5902#define WMI_HOST_VHT_CAP_RX_STBC_1SS 0x00000100
5903#define WMI_HOST_VHT_CAP_RX_STBC_2SS 0x00000200
5904#define WMI_HOST_VHT_CAP_RX_STBC_3SS 0x00000300
5905
5906#define WMI_HOST_VHT_CAP_DEFAULT_ALL (WMI_HOST_VHT_CAP_MAX_MPDU_LEN_11454 | \
5907 WMI_HOST_VHT_CAP_SGI_80MHZ | \
5908 WMI_HOST_VHT_CAP_TX_STBC | \
5909 WMI_HOST_VHT_CAP_RX_STBC_MASK | \
5910 WMI_HOST_VHT_CAP_RX_LDPC | \
5911 WMI_HOST_VHT_CAP_MAX_AMPDU_LEN_EXP | \
5912 WMI_HOST_VHT_CAP_RX_FIXED_ANT | \
5913 WMI_HOST_VHT_CAP_TX_FIXED_ANT)
5914
5915/* Interested readers refer to Rx/Tx MCS Map definition as defined in
5916 802.11ac
5917*/
5918#define WMI_HOST_VHT_MAX_MCS_4_SS_MASK(r, ss) ((3 & (r)) << (((ss) - 1) << 1))
5919#define WMI_HOST_VHT_MAX_SUPP_RATE_MASK 0x1fff0000
5920#define WMI_HOST_VHT_MAX_SUPP_RATE_MASK_SHIFT 16
5921
5922/** U-APSD configuration of peer station from (re)assoc request and TSPECs */
5923enum wmi_host_ap_ps_param_uapsd {
5924 WMI_HOST_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
5925 WMI_HOST_AP_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
5926 WMI_HOST_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
5927 WMI_HOST_AP_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
5928 WMI_HOST_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
5929 WMI_HOST_AP_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
5930 WMI_HOST_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
5931 WMI_HOST_AP_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
5932};
5933/** U-APSD maximum service period of peer station */
5934enum wmi_host_ap_ps_peer_param_max_sp {
5935 WMI_HOST_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0,
5936 WMI_HOST_AP_PS_PEER_PARAM_MAX_SP_2 = 1,
5937 WMI_HOST_AP_PS_PEER_PARAM_MAX_SP_4 = 2,
5938 WMI_HOST_AP_PS_PEER_PARAM_MAX_SP_6 = 3,
5939
5940 /* keep last! */
5941 MAX_HOST_WMI_AP_PS_PEER_PARAM_MAX_SP,
5942};
5943
5944#define WMI_HOST_UAPSD_AC_TYPE_DELI 0
5945#define WMI_HOST_UAPSD_AC_TYPE_TRIG 1
5946
5947#define WMI_HOST_UAPSD_AC_BIT_MASK(ac, type) \
5948 ((type == WMI_HOST_UAPSD_AC_TYPE_DELI) ? (1<<(ac<<1)) :\
5949 (1<<((ac<<1)+1)))
5950
5951enum wmi_host_ap_ps_peer_param_wnm_sleep {
5952 WMI_HOST_AP_PS_PEER_PARAM_WNM_SLEEP_ENABLE,
5953 WMI_HOST_AP_PS_PEER_PARAM_WNM_SLEEP_DISABLE,
5954};
5955
5956enum wmi_host_ap_ps_peer_param {
5957 /** Set uapsd configuration for a given peer.
5958 *
5959 * This will include the delivery and trigger enabled state for every AC.
5960 * The host MLME needs to set this based on AP capability and stations
5961 * request Set in the association request received from the station.
5962 *
5963 * Lower 8 bits of the value specify the UAPSD configuration.
5964 *
5965 * (see enum wmi_ap_ps_param_uapsd)
5966 * The default value is 0.
5967 */
5968 WMI_HOST_AP_PS_PEER_PARAM_UAPSD = 0,
5969
5970 /**
5971 * Set the service period for a UAPSD capable station
5972 *
5973 * The service period from wme ie in the (re)assoc request frame.
5974 *
5975 * (see enum wmi_ap_ps_peer_param_max_sp)
5976 */
5977 WMI_HOST_AP_PS_PEER_PARAM_MAX_SP = 1,
5978
5979 /** Time in seconds for aging out buffered frames
5980 * for STA in power save */
5981 WMI_HOST_AP_PS_PEER_PARAM_AGEOUT_TIME = 2,
5982
5983 /** Specify frame types that are considered SIFS
5984 * RESP trigger frame */
5985 WMI_HOST_AP_PS_PEER_PARAM_SIFS_RESP_FRMTYPE = 3,
5986
5987 /** Specifies the trigger state of TID.
5988 * Valid only for UAPSD frame type */
5989 WMI_HOST_AP_PS_PEER_PARAM_SIFS_RESP_UAPSD = 4,
5990
5991 /** Specifies the WNM sleep state of a STA */
5992 WMI_HOST_AP_PS_PEER_PARAM_WNM_SLEEP = 5,
5993};
5994#define WMI_HOST_RXERR_CRC 0x01 /* CRC error on frame */
5995#define WMI_HOST_RXERR_DECRYPT 0x08 /* non-Michael decrypt error */
5996#define WMI_HOST_RXERR_MIC 0x10 /* Michael MIC decrypt error */
5997#define WMI_HOST_RXERR_KEY_CACHE_MISS 0x20 /* No/incorrect key matter in h/w */
5998
5999enum wmi_host_sta_ps_param_uapsd {
6000 WMI_HOST_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
6001 WMI_HOST_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
6002 WMI_HOST_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
6003 WMI_HOST_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
6004 WMI_HOST_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
6005 WMI_HOST_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
6006 WMI_HOST_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
6007 WMI_HOST_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
6008};
6009
6010enum wmi_host_sta_ps_param_rx_wake_policy {
6011 /* Wake up when ever there is an RX activity on the VDEV. In this mode
6012 * the Power save SM(state machine) will come out of sleep by either
6013 * sending null frame (or) a data frame (with PS==0) in response to TIM
6014 * bit set in the received beacon frame from AP.
6015 */
6016 WMI_HOST_STA_PS_RX_WAKE_POLICY_WAKE = 0,
6017
6018 /* Here the power save state machine will not wakeup in response to TIM
6019 * bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD
6020 * configuration setup by WMISET_PS_SET_UAPSD WMI command. When all
6021 * access categories are delivery-enabled, the station will send a UAPSD
6022 * trigger frame, otherwise it will send a PS-Poll.
6023 */
6024 WMI_HOST_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1,
6025};
6026enum wmi_host_sta_ps_param_pspoll_count {
6027 WMI_HOST_STA_PS_PSPOLL_COUNT_NO_MAX = 0,
6028 /* Values greater than 0 indicate the maximum numer of PS-Poll frames FW
6029 * will send before waking up.
6030 */
6031};
6032/** Number of tx frames/beacon that cause the power save SM to wake up.
6033 *
6034 * Value 1 causes the SM to wake up for every TX. Value 0 has a special
6035 * meaning, It will cause the SM to never wake up. This is useful if you want
6036 * to keep the system to sleep all the time for some kind of test mode . host
6037 * can change this parameter any time. It will affect at the next tx frame.
6038 */
6039enum wmi_host_sta_ps_param_tx_wake_threshold {
6040 WMI_HOST_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0,
6041 WMI_HOST_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1,
6042
6043 /* Values greater than one indicate that many TX attempts per beacon
6044 * interval before the STA will wake up
6045 */
6046};
6047/*
6048 * Transmit power scale factor.
6049 *
6050 */
6051typedef enum {
6052 WMI_HOST_TP_SCALE_MAX = 0, /* no scaling (default) */
6053 WMI_HOST_TP_SCALE_50 = 1, /* 50% of max (-3 dBm) */
6054 WMI_HOST_TP_SCALE_25 = 2, /* 25% of max (-6 dBm) */
6055 WMI_HOST_TP_SCALE_12 = 3, /* 12% of max (-9 dBm) */
6056 WMI_HOST_TP_SCALE_MIN = 4, /* min, but still on */
6057 WMI_HOST_TP_SCALE_SIZE = 5, /* max num of enum */
6058} WMI_HOST_TP_SCALE;
6059enum {
6060 WMI_HOST_RATEPWR_TABLE_OPS_SET,
6061 WMI_HOST_RATEPWR_TABLE_OPS_GET,
6062};
6063/* reserved up through 0xF */
6064/**
6065 * struct wmi_host_dcs_mib_stats - WLAN IM stats from target to host
6066 * Below statistics are sent from target to host periodically.
6067 * These are collected at target as long as target is running
6068 * and target chip is not in sleep.
6069 * @listen_time:
6070 * @reg_tx_frame_cnt:
6071 * @reg_rx_frame_cnt:
6072 * @reg_rxclr_cnt:
6073 * @reg_cycle_cnt: delta cycle count
6074 * @reg_rxclr_ext_cnt:
6075 * @reg_ofdm_phyerr_cnt:
6076 * @reg_cck_phyerr_cnt: CCK err count since last reset, read from register
6077 */
6078typedef struct _hp_dcs_mib_stats {
6079 int32_t listen_time;
6080 uint32_t reg_tx_frame_cnt;
6081 uint32_t reg_rx_frame_cnt;
6082 uint32_t reg_rxclr_cnt;
6083 uint32_t reg_cycle_cnt;
6084 uint32_t reg_rxclr_ext_cnt;
6085 uint32_t reg_ofdm_phyerr_cnt;
6086 uint32_t reg_cck_phyerr_cnt;
6087} wmi_host_dcs_mib_stats_t;
6088
6089/**
6090 * struct wmi_host_dcs_im_tgt_stats - DCS IM target stats
6091 * @reg_tsf32: current running TSF from the TSF-1
6092 * @last_ack_rssi: Known last frame rssi, in case of multiple stations, if
6093 * and at different ranges, this would not gaurantee that
6094 * this is the least rssi.
6095 * @tx_waste_time: Sum of all the failed durations in the last
6096 * one second interval.
6097 * @rx_time: count how many times the hal_rxerr_phy is marked, in this
6098 * time period
6099 * @phyerr_cnt:
6100 * @mib_stats: wmi_host_dcs_mib_stats_t - collected mib stats as explained
6101 * in mib structure
6102 */
6103typedef struct _wmi_host_dcs_im_tgt_stats {
6104 uint32_t reg_tsf32;
6105 uint32_t last_ack_rssi;
6106 uint32_t tx_waste_time;
6107 uint32_t rx_time;
6108 uint32_t phyerr_cnt;
6109 wmi_host_dcs_mib_stats_t mib_stats;
6110} wmi_host_dcs_im_tgt_stats_t;
6111
6112/**
6113 * Enum for pktlog req
6114 */
6115typedef enum {
6116 WMI_HOST_PKTLOG_EVENT_RX = 0x1,
6117 WMI_HOST_PKTLOG_EVENT_TX = 0x2,
6118 WMI_HOST_PKTLOG_EVENT_RCF = 0x4, /* Rate Control Find */
6119 WMI_HOST_PKTLOG_EVENT_RCU = 0x8, /* Rate Control Update */
6120 WMI_HOST_PKTLOG_EVENT_DBG_PRINT = 0x10, /* DEBUG prints */
6121 /* To support Smart Antenna */
6122 WMI_HOST_PKTLOG_EVENT_SMART_ANTENNA = 0x20,
6123 WMI_HOST_PKTLOG_EVENT_H_INFO = 0x40,
6124 WMI_HOST_PKTLOG_EVENT_STEERING = 0x80,
6125} WMI_HOST_PKTLOG_EVENT;
6126
6127/**
6128 * wmi_host_phyerr
6129 *
6130 */
6131#define WMI_HOST_PHY_ERROR_SPECTRAL_SCAN 0x26
6132#define WMI_HOST_PHY_ERROR_FALSE_RADAR_EXT 0x24
6133
6134#define WMI_HOST_AR900B_DFS_PHYERR_MASK 0x4
6135#define WMI_HOST_AR900B_SPECTRAL_PHYERR_MASK 0x4000000
6136
6137/**
6138 * struct wmi_host_perchain_rssi_info - per chain RSSI info
6139 * @rssi_pri20: RSSI on primary 20
6140 * @rssi_sec20: RSSI on secomdary 20
6141 * @rssi_sec40: RSSI secondary 40
6142 * @rssi_sec80: RSSI secondary 80
6143 */
6144typedef struct wmi_host_perchain_rssi_info {
6145 int8_t rssi_pri20;
6146 int8_t rssi_sec20;
6147 int8_t rssi_sec40;
6148 int8_t rssi_sec80;
6149} wmi_host_perchain_rssi_info_t;
6150
6151/**
6152 * struct _wmi_host_rf_info - RF measurement information
6153 * @rssi_comb: RSSI Information
6154 * @pc_rssi_info[4]: For now, we know we are getting information
6155 * for only 4 chains at max. For future extensions
6156 * use a define
6157 * @noise_floor: Noise floor information
6158 */
6159typedef struct _wmi_host_rf_info {
6160 int8_t rssi_comb;
6161 wmi_host_perchain_rssi_info_t pc_rssi_info[4];
6162 int16_t noise_floor[4];
6163} wmi_host_rf_info_t;
6164
6165/**
6166 * struct _wmi_host_chan_info
6167 * @center_freq1: center frequency 1 in MHz
6168 * @center_freq2: center frequency 2 in MHz -valid only for
6169 * 11ACVHT 80PLUS80 mode
6170 * @chan_width: channel width in MHz
6171 */
6172typedef struct _wmi_host_chan_info {
6173 u_int16_t center_freq1;
6174 u_int16_t center_freq2;
6175 u_int8_t chan_width;
6176} wmi_host_chan_info_t;
6177
6178/**
6179 * struct wmi_host_phyerr
6180 * @rf_info:
6181 * @chan_info:
6182 * @tsf64:
6183 * @phy_err_code:
6184 * @tsf_timestamp:
6185 * @bufp:
6186 * @buf_len:
6187 * @phy_err_mask0:
6188 * @phy_err_mask1:
6189 */
6190typedef struct _wmi_host_phyerr {
6191 wmi_host_rf_info_t rf_info;
6192 wmi_host_chan_info_t chan_info;
6193 uint64_t tsf64;
6194 int32_t phy_err_code;
6195 uint32_t tsf_timestamp;
6196 uint8_t *bufp;
6197 uint32_t buf_len;
6198 uint32_t phy_err_mask0;
6199 uint32_t phy_err_mask1;
6200} wmi_host_phyerr_t;
6201
6202/**
6203 * struct wmi_host_rtt_event_hdr
6204 * @req_id: request id
6205 * @status: status
6206 * @meas_done: measurement done flag
6207 * @meas_type: measurement type
6208 * @report_type: report type
6209 * @v3_status: v2 status
6210 * @v3_finish:
6211 * @v3_tm_start:
6212 * @num_ap: number of AP
6213 * @result: resuult
6214 * @dest_mac: destination mac
6215 */
6216typedef struct {
6217 uint16_t req_id;
6218 uint16_t status:1,
6219 meas_done:1,
6220 meas_type:3,
6221 report_type:3,
6222 v3_status:2,
6223 v3_finish:1,
6224 v3_tm_start:1,
6225 num_ap:4;
6226 uint16_t result;
6227 uint8_t dest_mac[IEEE80211_ADDR_LEN];
6228} wmi_host_rtt_event_hdr;
6229
6230/**
6231 * struct wmi_host_rtt_meas_event - RTT measurement event
6232 * @chain_mask:
6233 * @bw:
6234 * @rsvd:
6235 * @txrxchain_mask: Bit:0-3:chain mask
6236 * Bit 4-5: band width info
6237 * 00 --Legacy 20, 01 --HT/VHT20
6238 * 10 --HT/VHT40, 11 -- VHT80
6239 * @tod: resolution of 0.1ns
6240 * @toa: resolution of 0.1ns
6241 * @t3:
6242 * @t4:
6243 * @rssi0:
6244 * @rssi1:
6245 * @rssi2:
6246 * @rssi3:
6247 */
6248typedef struct {
6249 uint32_t chain_mask:3,
6250 bw:2,
6251 rsvd:27;
6252 uint32_t txrxchain_mask;
6253 uint64_t tod;
6254 uint64_t toa;
6255 uint64_t t3;
6256 uint64_t t4;
6257 uint32_t rssi0;
6258 uint32_t rssi1;
6259 uint32_t rssi2;
6260 uint32_t rssi3;
6261} wmi_host_rtt_meas_event;
6262
6263/*----RTT Report event definition ----*/
6264typedef enum {
6265 /* rtt cmd header parsing error --terminate */
6266 WMI_HOST_RTT_COMMAND_HEADER_ERROR = 0,
6267 /* rtt body parsing error -- skip current STA REQ */
6268 WMI_HOST_RTT_COMMAND_ERROR,
6269 /* rtt no resource -- terminate */
6270 WMI_HOST_RTT_MODULE_BUSY,
6271 /* STA exceed the support limit -- only server the first n STA */
6272 WMI_HOST_RTT_TOO_MANY_STA,
6273 /* any allocate failure */
6274 WMI_HOST_RTT_NO_RESOURCE,
6275 /* can not find vdev with vdev ID - skip current STA REQ */
6276 WMI_HOST_RTT_VDEV_ERROR,
6277 /* Tx failure -- continiue and measure number */
6278 WMI_HOST_RTT_TRANSIMISSION_ERROR,
6279 /* wait for first TM timer expire-terminate current STA measurement */
6280 WMI_HOST_RTT_TM_TIMER_EXPIRE,
6281 /* we do not support RTT measurement with this type of frame */
6282 WMI_HOST_RTT_FRAME_TYPE_NOSUPPORT,
6283 /* whole RTT measurement timer expire-terminate
6284 ** current STA measurement */
6285 WMI_HOST_RTT_TIMER_EXPIRE,
6286 /* channel swicth failed */
6287 WMI_HOST_RTT_CHAN_SWITCH_ERROR,
6288 /* TMR trans error, this dest peer will be skipped */
6289 WMI_HOST_RTT_TMR_TRANS_ERROR,
6290 /* V3 only. If both CFR and Token mismatch, do not report */
6291 WMI_HOST_RTT_NO_REPORT_BAD_CFR_TOKEN,
6292 /* For First TM, if CFR is bad, then do not report */
6293 WMI_HOST_RTT_NO_REPORT_FIRST_TM_BAD_CFR,
6294 /* do not allow report type2 mix with type 0, 1 */
6295 WMI_HOST_RTT_REPORT_TYPE2_MIX,
6296 /* LCI Configuration OK. - Responder only */
6297 WMI_HOST_RTT_LCI_CFG_OK,
6298 /* LCR configuration OK. - Responder only */
6299 WMI_HOST_RTT_LCR_CFG_OK,
6300 /* Bad configuration LCI (or) LCR request - Responder only */
6301 WMI_HOST_RTT_CFG_ERROR,
6302 WMI_HOST_WMI_RTT_REJECT_MAX,
6303} WMI_HOST_RTT_ERROR_INDICATOR;
6304typedef struct {
6305 wmi_host_rtt_event_hdr hdr;
6306 WMI_HOST_RTT_ERROR_INDICATOR reject_reason;
6307} wmi_host_rtt_error_report_event;
6308
6309#if defined(AR9888)
6310typedef enum {
6311 WMI_HOST_PROF_CPU_IDLE,
6312 WMI_HOST_PROF_PPDU_PROC,
6313 WMI_HOST_PROF_PPDU_POST,
6314 WMI_HOST_PROF_HTT_TX_INPUT,
6315 WMI_HOST_PROF_MSDU_ENQ,
6316 WMI_HOST_PROF_PPDU_POST_HAL,
6317 WMI_HOST_PROF_COMPUTE_TX_TIME,
6318
6319 /* Add new ID's above this. */
6320 WMI_HOST_PROF_MAX_ID,
6321} wmi_host_profile_id_t;
6322#endif
6323
6324#define WMI_HOST_WLAN_PROFILE_MAX_HIST 3
6325#define WMI_HOST_WLAN_PROFILE_MAX_BIN_CNT 32
6326
6327#if defined(AR9888)
6328#define WMI_HOST_MAX_PROFILE WMI_HOST_PROF_MAX_ID
6329#else
6330#define WMI_HOST_MAX_PROFILE WMI_HOST_WLAN_PROFILE_MAX_BIN_CNT
6331#endif
6332
6333/**
6334 * struct wmi_host_wlan_profile - Host profile param
6335 * @id: profile id
6336 * @cnt: Count
6337 * @tot:
6338 * @min: minimum
6339 * @max: Mac
6340 * @hist_intvl: history interval
6341 * @hist: profile data history
6342 */
6343typedef struct {
6344 uint32_t id;
6345 uint32_t cnt;
6346 uint32_t tot;
6347 uint32_t min;
6348 uint32_t max;
6349 uint32_t hist_intvl;
6350 uint32_t hist[WMI_HOST_WLAN_PROFILE_MAX_HIST];
6351} wmi_host_wlan_profile_t;
6352
6353/**
6354 * struct wmi_host_wlan_profile_ctx_t - profile context
6355 * @tot: time in us
6356 * @tx_msdu_cnt: MSDU TX count
6357 * @tx_mpdu_cnt: MPDU tx count
6358 * @tx_ppdu_cnt: PPDU tx count
6359 * @rx_msdu_cnt: MSDU RX count
6360 * @rx_mpdu_cnt: MPDU RXcount
6361 * @bin_count: Bin count
6362 */
6363typedef struct {
6364 uint32_t tot;
6365 uint32_t tx_msdu_cnt;
6366 uint32_t tx_mpdu_cnt;
6367 uint32_t tx_ppdu_cnt;
6368 uint32_t rx_msdu_cnt;
6369 uint32_t rx_mpdu_cnt;
6370 uint32_t bin_count;
6371} wmi_host_wlan_profile_ctx_t;
6372
6373/**
Govind Singh89727882016-04-15 13:58:27 +05306374 * struct wmi_host_chan_info_event - Channel info WMI event
6375 * @err_code: Error code
6376 * @freq: Channel freq
6377 * @cmd_flags: Read flags
6378 * @noise_floor: Noise Floor value
6379 * @rx_clear_count: rx clear count
6380 * @cycle_count: cycle count
6381 * @chan_tx_pwr_range: channel tx power per range
6382 * @chan_tx_pwr_tp: channel tx power per throughput
6383 * @rx_frame_count: rx frame count
6384 * @rx_11b_mode_data_duration: 11b mode data duration
6385 */
6386typedef struct {
6387 uint32_t err_code;
6388 uint32_t freq;
6389 uint32_t cmd_flags;
6390 uint32_t noise_floor;
6391 uint32_t rx_clear_count;
6392 uint32_t cycle_count;
6393 uint32_t chan_tx_pwr_range;
6394 uint32_t chan_tx_pwr_tp;
6395 uint32_t rx_frame_count;
6396 uint32_t rx_11b_mode_data_duration;
6397} wmi_host_chan_info_event;
6398
6399/**
6400 * struct wmi_host_pdev_channel_hopping_event
6401 * @noise_floor_report_iter: Noise threshold iterations with high values
6402 * @noise_floor_total_iter: Total noise threshold iterations
6403 */
6404typedef struct {
6405 uint32_t noise_floor_report_iter;
6406 uint32_t noise_floor_total_iter;
6407} wmi_host_pdev_channel_hopping_event;
6408
6409/**
6410 * struct wmi_host_pdev_bss_chan_info_event
6411 * @freq: Units in MHz
6412 * @noise_floor: units are dBm
6413 * @rx_clear_count_low:
6414 * @rx_clear_count_high:
6415 * @cycle_count_low:
6416 * @cycle_count_high:
6417 * @tx_cycle_count_low:
6418 * @tx_cycle_count_high:
6419 * @rx_cycle_count_low:
6420 * @rx_cycle_count_high:
6421 * @rx_bss_cycle_count_low:
6422 * @rx_bss_cycle_count_high:
6423 * @reserved:
6424 */
6425typedef struct {
6426 uint32_t freq;
6427 uint32_t noise_floor;
6428 uint32_t rx_clear_count_low;
6429 uint32_t rx_clear_count_high;
6430 uint32_t cycle_count_low;
6431 uint32_t cycle_count_high;
6432 uint32_t tx_cycle_count_low;
6433 uint32_t tx_cycle_count_high;
6434 uint32_t rx_cycle_count_low;
6435 uint32_t rx_cycle_count_high;
6436 uint32_t rx_bss_cycle_count_low;
6437 uint32_t rx_bss_cycle_count_high;
6438 uint32_t reserved;
6439} wmi_host_pdev_bss_chan_info_event;
6440
6441#define WMI_HOST_INST_STATS_INVALID_RSSI 0
6442/**
6443 * struct wmi_host_inst_stats_resp
6444 * @iRSSI: Instantaneous RSSI
6445 * @peer_macaddr: peer mac address
6446 */
6447typedef struct {
6448 uint32_t iRSSI;
6449 wmi_host_mac_addr peer_macaddr;
6450} wmi_host_inst_stats_resp;
6451
6452/* Event definition and new structure addition to send event
6453 * to host to block/unblock tx data traffic based on peer_ast_idx or vdev id
6454 */
6455#define WMI_HOST_INVALID_PEER_AST_INDEX 0xffff
6456#define WMI_HOST_TX_DATA_TRAFFIC_CTRL_BLOCK 0x1
6457#define WMI_HOST_TX_DATA_TRAFFIC_CTRL_UNBLOCK 0x2
6458/**
6459 * struct wmi_host_tx_data_traffic_ctrl_event
6460 * @peer_ast_idx: For vdev based control, peer_ast_idx will be
6461 * WMI_INVALID_PEER_AST_INDEX
6462 * @vdev_id: only applies if peer_ast_idx == INVALID
6463 * @ctrl_cmd: WMI_TX_DATA_TRAFFIC_CTRL_BLOCK or
6464 * WMI_TX_DATA_TRAFFIC_CTRL_UNBLOCK
6465 */
6466typedef struct {
6467 uint32_t peer_ast_idx;
6468 uint32_t vdev_id;
6469 uint32_t ctrl_cmd;
6470} wmi_host_tx_data_traffic_ctrl_event;
6471
6472/**
6473 * struct wmi_host_ath_dcs_cw_int
6474 * @channel: either number or freq in mhz
6475 */
6476typedef struct {
6477 uint32_t channel;
6478} wmi_host_ath_dcs_cw_int;
Govind Singhc10bde82016-05-02 17:59:24 +05306479
6480#define WMI_MAX_POWER_DBG_ARGS 8
6481
6482/**
6483 * struct wmi_power_dbg_params - power debug command parameter
6484 * @pdev_id: subsystem identifier
6485 * @module_id: parameter id
6486 * @num_arg: no of arguments
6487 * @args: arguments
6488 */
6489struct wmi_power_dbg_params {
6490 uint32_t pdev_id;
6491 uint32_t module_id;
6492 uint32_t num_args;
6493 uint32_t args[WMI_MAX_POWER_DBG_ARGS];
6494};
6495
Gupta, Kapil7b768002016-04-25 19:14:19 +05306496/**
6497 * struct wmi_adaptive_dwelltime_params - the adaptive dwelltime params
6498 * @vdev_id: vdev id
6499 * @is_enabled: Adaptive dwell time is enabled/disabled
6500 * @dwelltime_mode: global default adaptive dwell mode
6501 * @lpf_weight: weight to calculate the average low pass
6502 * filter for channel congestion
6503 * @passive_mon_intval: intval to monitor wifi activity in passive scan in msec
6504 * @wifi_act_threshold: % of wifi activity used in passive scan 0-100
6505 *
6506 */
6507struct wmi_adaptive_dwelltime_params {
6508 uint32_t vdev_id;
6509 bool is_enabled;
6510 enum wmi_dwelltime_adaptive_mode dwelltime_mode;
6511 uint8_t lpf_weight;
6512 uint8_t passive_mon_intval;
6513 uint8_t wifi_act_threshold;
6514};
Govind Singhc7cd2d62016-06-21 14:33:26 +05306515
6516/**
6517 * struct wmi_fw_dump_seg_req - individual segment details
6518 * @seg_id - segment id.
6519 * @seg_start_addr_lo - lower address of the segment.
6520 * @seg_start_addr_hi - higher address of the segment.
6521 * @seg_length - length of the segment.
6522 * @dst_addr_lo - lower address of the destination buffer.
6523 * @dst_addr_hi - higher address of the destination buffer.
6524 *
6525 * This structure carries the information to firmware about the
6526 * individual segments. This structure is part of firmware memory
6527 * dump request.
6528 */
6529struct wmi_fw_dump_seg_req {
6530 uint8_t seg_id;
6531 uint32_t seg_start_addr_lo;
6532 uint32_t seg_start_addr_hi;
6533 uint32_t seg_length;
6534 uint32_t dst_addr_lo;
6535 uint32_t dst_addr_hi;
6536};
6537
6538/**
6539 * enum wmi_userspace_log_level - Log level at userspace
6540 * @WMI_LOG_LEVEL_NO_COLLECTION: verbose_level 0 corresponds to no collection
6541 * @WMI_LOG_LEVEL_NORMAL_COLLECT: verbose_level 1 correspond to normal log
6542 * level with minimal user impact. This is the default value.
6543 * @WMI_LOG_LEVEL_ISSUE_REPRO: verbose_level 2 are enabled when user is lazily
6544 * trying to reproduce a problem, wifi performances and power can be impacted
6545 * but device should not otherwise be significantly impacted
6546 * @WMI_LOG_LEVEL_ACTIVE: verbose_level 3+ are used when trying to
6547 * actively debug a problem
6548 *
6549 * Various log levels defined in the userspace for logging applications
6550 */
6551enum wmi_userspace_log_level {
6552 WMI_LOG_LEVEL_NO_COLLECTION,
6553 WMI_LOG_LEVEL_NORMAL_COLLECT,
6554 WMI_LOG_LEVEL_ISSUE_REPRO,
6555 WMI_LOG_LEVEL_ACTIVE,
6556};
6557
Govind Singh3ddda1f2016-03-09 11:34:12 +05306558#endif /* _WMI_UNIFIED_PARAM_H_ */
6559