blob: 9d10763b5ef4478a1505d775bb84676315db0517 [file] [log] [blame]
Govind Singh3ddda1f2016-03-09 11:34:12 +05301/*
Kiran Venkatappa4110f0a2016-12-27 22:51:29 +05302 * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
Govind Singh3ddda1f2016-03-09 11:34:12 +05303 *
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_
Padma, Santhosh Kumar73524052016-09-11 18:24:59 +053035
36#define MAC_MAX_KEY_LENGTH 32
37#define MAC_PN_LENGTH 8
38#define MAX_MAC_HEADER_LEN 32
39#define MIN_MAC_HEADER_LEN 24
40#define QOS_CONTROL_LEN 2
41
Govind Singh3ddda1f2016-03-09 11:34:12 +053042#define IEEE80211_ADDR_LEN 6 /* size of 802.11 address */
Govind Singh3ddda1f2016-03-09 11:34:12 +053043#define WMI_MAC_MAX_SSID_LENGTH 32
44#define WMI_SCAN_MAX_NUM_SSID 0x0A
45#define mgmt_tx_dl_frm_len 64
46#define WMI_SMPS_MASK_LOWER_16BITS 0xFF
47#define WMI_SMPS_MASK_UPPER_3BITS 0x7
48#define WMI_SMPS_PARAM_VALUE_S 29
Govind Singhae855362016-03-07 14:24:22 +053049#define WMI_MAX_NUM_ARGS 8
Govind Singhe7b800c2016-03-01 15:30:53 +053050/* The size of the utc time in bytes. */
51#define WMI_SIZE_UTC_TIME (10)
52/* The size of the utc time error in bytes. */
53#define WMI_SIZE_UTC_TIME_ERROR (5)
Govind Singh9bad0002016-03-01 15:54:59 +053054#define WMI_MCC_MIN_CHANNEL_QUOTA 20
55#define WMI_MCC_MAX_CHANNEL_QUOTA 80
56#define WMI_MCC_MIN_NON_ZERO_CHANNEL_LATENCY 30
57#define WMI_BEACON_TX_BUFFER_SIZE (512)
58#define WMI_WIFI_SCANNING_MAC_OUI_LENGTH 3
59#define WMI_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS 64
60#define WMI_RSSI_THOLD_DEFAULT -300
61#define WMI_NLO_FREQ_THRESH 1000
62#define WMI_SEC_TO_MSEC(sec) (sec * 1000)
63#define WMI_MSEC_TO_USEC(msec) (msec * 1000)
64#define WMI_ETH_LEN 64
65#define WMI_QOS_NUM_TSPEC_MAX 2
66#define WMI_QOS_NUM_AC_MAX 4
Govind Singhae855362016-03-07 14:24:22 +053067#define WMI_IPV4_ADDR_LEN 4
68#define WMI_KEEP_ALIVE_NULL_PKT 1
69#define WMI_KEEP_ALIVE_UNSOLICIT_ARP_RSP 2
Himanshu Agarwal9efd9bf2016-03-09 18:49:18 +053070#define WMI_MAC_MAX_KEY_LENGTH 32
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +053071#define WMI_KRK_KEY_LEN 16
72#ifdef WLAN_FEATURE_ROAM_OFFLOAD
73#define WMI_BTK_KEY_LEN 32
74#define WMI_ROAM_R0KH_ID_MAX_LEN 48
75#define WMI_ROAM_SCAN_PSK_SIZE 32
76#endif
77#define WMI_NOISE_FLOOR_DBM_DEFAULT (-96)
Govind Singh89727882016-04-15 13:58:27 +053078#define WMI_MAC_IPV6_ADDR_LEN 16
Govind Singhc7cd2d62016-06-21 14:33:26 +053079#define WMI_OFFLOAD_DISABLE 0
80#define WMI_OFFLOAD_ENABLE 1
Govind Singhfa201d92016-06-08 19:40:11 +053081#ifdef WLAN_NS_OFFLOAD
Govind Singhae855362016-03-07 14:24:22 +053082/* support only one IPv6 offload */
83#define WMI_MAC_NS_OFFLOAD_SIZE 1
84/* Number of target IP V6 addresses for NS offload */
85#define WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA 16
Govind Singhae855362016-03-07 14:24:22 +053086#define WMI_IPV6_ADDR_VALID 1
87#endif /* WLAN_NS_OFFLOAD */
88#define WMI_EXTSCAN_MAX_HOTLIST_SSIDS 8
89#define WMI_ROAM_MAX_CHANNELS 80
Govind Singhd7468a52016-03-09 14:32:57 +053090#ifdef FEATURE_WLAN_EXTSCAN
91#define WMI_MAX_EXTSCAN_MSG_SIZE 1536
92#define WMI_EXTSCAN_REST_TIME 100
93#define WMI_EXTSCAN_MAX_SCAN_TIME 50000
94#define WMI_EXTSCAN_BURST_DURATION 150
95#endif
96#define WMI_SCAN_NPROBES_DEFAULT (2)
97#define WMI_SEC_TO_MSEC(sec) (sec * 1000) /* sec to msec */
98#define WMI_MSEC_TO_USEC(msec) (msec * 1000) /* msec to usec */
99#define WMI_NLO_FREQ_THRESH 1000 /* in MHz */
Govind Singh89727882016-04-15 13:58:27 +0530100
101#define MAX_UTF_EVENT_LENGTH 2048
102#define MAX_WMI_UTF_LEN 252
103#define MAX_WMI_QVIT_LEN 252
104#define THERMAL_LEVELS 4
105#define WMI_HOST_BCN_FLT_MAX_SUPPORTED_IES 256
106#define WMI_HOST_BCN_FLT_MAX_ELEMS_IE_LIST \
107 (WMI_HOST_BCN_FLT_MAX_SUPPORTED_IES/32)
108#define LTEU_MAX_BINS 10
109#define ATF_ACTIVED_MAX_CLIENTS 50
110#define ATF_ACTIVED_MAX_ATFGROUPS 8
111#define CTL_5G_SIZE 1536
112#define CTL_2G_SIZE 684
113#define MAX_CTL_SIZE (CTL_5G_SIZE > CTL_2G_SIZE ? CTL_5G_SIZE : CTL_2G_SIZE)
114#define IEEE80211_MICBUF_SIZE (8+8)
115#define IEEE80211_TID_SIZE 17
116#define WME_NUM_AC 4
117#define SMART_ANT_MODE_SERIAL 0
118#define SMART_ANT_MODE_PARALLEL 1
119#define IEEE80211_WEP_NKID 4 /* number of key ids */
120#define WPI_IV_LEN 16
121#define WMI_SCAN_MAX_NUM_BSSID 10
122#define MAX_CHANS 1023
123#define TARGET_OEM_CONFIGURE_LCI 0x0A
124#define RTT_LCI_ALTITUDE_MASK 0x3FFFFFFF
125#define TARGET_OEM_CONFIGURE_LCR 0x09
126#define RTT_TIMEOUT_MS 180
127#define MAX_SUPPORTED_RATES 128
128#define WMI_HOST_MAX_BUFFER_SIZE 1712
Govind Singh41da3152016-05-06 20:20:25 +0530129#define WMI_HAL_MAX_SANTENNA 4
Sathish Kumar7e2eaed2016-11-14 17:44:29 +0530130#define WMI_HOST_PDEV_VI_PRIORITY_BIT (1<<2)
131#define WMI_HOST_PDEV_BEACON_PRIORITY_BIT (1<<4)
132#define WMI_HOST_PDEV_MGMT_PRIORITY_BIT (1<<5)
Govind Singh89727882016-04-15 13:58:27 +0530133
Govind Singhec1401a2016-07-08 19:00:56 +0530134#define FIPS_ALIGN 4
Kiran Venkatappa9f5fcc02016-12-29 22:07:14 +0530135#define FIPS_ALIGNTO(__addr, __to) \
136 ((((unsigned long int)(__addr)) + (__to) - 1) & ~((__to) - 1))
137#define FIPS_IS_ALIGNED(__addr, __to) \
138 (!(((unsigned long int)(__addr)) & ((__to)-1)))
Govind Singhec1401a2016-07-08 19:00:56 +0530139
Govind Singh89727882016-04-15 13:58:27 +0530140#define WMI_HOST_F_MS(_v, _f) \
141 (((_v) & (_f)) >> (_f##_S))
142
143#define WMI_HOST_F_RMW(_var, _v, _f) \
144 do { \
145 (_var) &= ~(_f); \
146 (_var) |= (((_v) << (_f##_S)) & (_f)); \
147 } while (0)
148
Sathish Kumar7e2eaed2016-11-14 17:44:29 +0530149/* vdev capabilities bit mask */
150#define WMI_HOST_VDEV_BEACON_SUPPORT 0x1
151#define WMI_HOST_VDEV_WDS_LRN_ENABLED 0x2
152#define WMI_HOST_VDEV_VOW_ENABLED 0x4
153#define WMI_HOST_VDEV_IS_BEACON_SUPPORTED(param) \
154 ((param) & WMI_HOST_VDEV_BEACON_SUPPORT)
155#define WMI_HOST_VDEV_IS_WDS_LRN_ENABLED(param) \
156 ((param) & WMI_HOST_VDEV_WDS_LRN_ENABLED)
157#define WMI_HOST_VDEV_IS_VOW_ENABLED(param) \
158 ((param) & WMI_HOST_VDEV_VOW_ENABLED)
159
Govind Singh89727882016-04-15 13:58:27 +0530160/* TXBF capabilities masks */
161#define WMI_HOST_TXBF_CONF_SU_TX_BFEE_S 0
162#define WMI_HOST_TXBF_CONF_SU_TX_BFEE_M 0x1
163#define WMI_HOST_TXBF_CONF_SU_TX_BFEE \
164 (WMI_HOST_TXBF_CONF_SU_TX_BFEE_M << WMI_HOST_TXBF_CONF_SU_TX_BFEE_S)
165#define WMI_HOST_TXBF_CONF_SU_TX_BFEE_GET(x) \
166 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_SU_TX_BFEE)
167#define WMI_HOST_TXBF_CONF_SU_TX_BFEE_SET(x, z) \
168 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_SU_TX_BFEE)
169
170#define WMI_HOST_TXBF_CONF_MU_TX_BFEE_S 1
171#define WMI_HOST_TXBF_CONF_MU_TX_BFEE_M 0x1
172#define WMI_HOST_TXBF_CONF_MU_TX_BFEE \
173 (WMI_HOST_TXBF_CONF_MU_TX_BFEE_M << WMI_HOST_TXBF_CONF_MU_TX_BFEE_S)
174#define WMI_HOST_TXBF_CONF_MU_TX_BFEE_GET(x) \
175 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_MU_TX_BFEE)
176#define WMI_HOST_TXBF_CONF_MU_TX_BFEE_SET(x, z) \
177 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_MU_TX_BFEE)
178
179#define WMI_HOST_TXBF_CONF_SU_TX_BFER_S 2
180#define WMI_HOST_TXBF_CONF_SU_TX_BFER_M 0x1
181#define WMI_HOST_TXBF_CONF_SU_TX_BFER \
182 (WMI_HOST_TXBF_CONF_SU_TX_BFER_M << WMI_HOST_TXBF_CONF_SU_TX_BFER_S)
183#define WMI_HOST_TXBF_CONF_SU_TX_BFER_GET(x) \
184 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_SU_TX_BFER)
185#define WMI_HOST_TXBF_CONF_SU_TX_BFER_SET(x, z) \
186 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_SU_TX_BFER)
187
188#define WMI_HOST_TXBF_CONF_MU_TX_BFER_S 3
189#define WMI_HOST_TXBF_CONF_MU_TX_BFER_M 0x1
190#define WMI_HOST_TXBF_CONF_MU_TX_BFER \
191 (WMI_HOST_TXBF_CONF_MU_TX_BFER_M << WMI_HOST_TXBF_CONF_MU_TX_BFER_S)
192#define WMI_HOST_TXBF_CONF_MU_TX_BFER_GET(x) \
193 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_MU_TX_BFER)
194#define WMI_HOST_TXBF_CONF_MU_TX_BFER_SET(x, z) \
195 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_MU_TX_BFER)
196
197#define WMI_HOST_TXBF_CONF_STS_CAP_S 4
198#define WMI_HOST_TXBF_CONF_STS_CAP_M 0x7
199#define WMI_HOST_TXBF_CONF_STS_CAP \
200 (WMI_HOST_TXBF_CONF_STS_CAP_M << WMI_HOST_TXBF_CONF_STS_CAP_S)
201#define WMI_HOST_TXBF_CONF_STS_CAP_GET(x) \
202 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_STS_CAP);
203#define WMI_HOST_TXBF_CONF_STS_CAP_SET(x, z) \
204 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_STS_CAP)
205
206#define WMI_HOST_TXBF_CONF_IMPLICIT_BF_S 7
207#define WMI_HOST_TXBF_CONF_IMPLICIT_BF_M 0x1
208#define WMI_HOST_TXBF_CONF_IMPLICIT_BF \
209 (WMI_HOST_TXBF_CONF_IMPLICIT_BF_M << WMI_HOST_TXBF_CONF_IMPLICIT_BF_S)
210#define WMI_HOST_TXBF_CONF_IMPLICIT_BF_GET(x) \
211 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_IMPLICIT_BF)
212#define WMI_HOST_TXBF_CONF_IMPLICIT_BF_SET(x, z) \
213 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_IMPLICIT_BF)
214
215#define WMI_HOST_TXBF_CONF_BF_SND_DIM_S 8
216#define WMI_HOST_TXBF_CONF_BF_SND_DIM_M 0x7
217#define WMI_HOST_TXBF_CONF_BF_SND_DIM \
218 (WMI_HOST_TXBF_CONF_BF_SND_DIM_M << WMI_HOST_TXBF_CONF_BF_SND_DIM_S)
219#define WMI_HOST_TXBF_CONF_BF_SND_DIM_GET(x) \
220 WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_BF_SND_DIM)
221#define WMI_HOST_TXBF_CONF_BF_SND_DIM_SET(x, z) \
222 WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_BF_SND_DIM)
223
224#define WMI_HOST_TPC_RATE_MAX 160
225#define WMI_HOST_TPC_TX_NUM_CHAIN 4
226#define WMI_HOST_RXG_CAL_CHAN_MAX 4
227#define WMI_HOST_MAX_NUM_CHAINS 4
Poddar, Siddarth794b9962016-04-28 15:49:11 +0530228#define WMI_MAX_NUM_OF_RATE_THRESH 4
Govind Singh89727882016-04-15 13:58:27 +0530229
Sathish Kumar907a7462017-02-27 10:35:40 +0530230#define WMI_HOST_PDEV_MAX_VDEVS 17
231
Himanshu Agarwal7e4f4bc2016-03-09 16:49:38 +0530232#include "qdf_atomic.h"
Govind Singhd7468a52016-03-09 14:32:57 +0530233
Govind Singh89727882016-04-15 13:58:27 +0530234#ifdef BIG_ENDIAN_HOST
235 /* This API is used in copying in elements to WMI message,
236 since WMI message uses multilpes of 4 bytes, This API
237 converts length into multiples of 4 bytes, and performs copy
238 */
239#define WMI_HOST_IF_MSG_COPY_CHAR_ARRAY(destp, srcp, len) do { \
240 int j; \
241 u_int32_t *src, *dest; \
242 src = (u_int32_t *)srcp; \
243 dest = (u_int32_t *)destp; \
244 for (j = 0; j < roundup(len, sizeof(u_int32_t))/4; j++) { \
245 *(dest+j) = qdf_le32_to_cpu(*(src+j)); \
246 } \
247} while (0)
248#else
249
250#define WMI_HOST_IF_MSG_COPY_CHAR_ARRAY(destp, srcp, len) OS_MEMCPY(destp,\
251 srcp, len)
252
253#endif
254
255/** macro to convert MAC address from WMI word format to char array */
256#define WMI_HOST_MAC_ADDR_TO_CHAR_ARRAY(pwmi_mac_addr, c_macaddr) do { \
257 (c_macaddr)[0] = ((pwmi_mac_addr)->mac_addr31to0) & 0xff; \
258 (c_macaddr)[1] = (((pwmi_mac_addr)->mac_addr31to0) >> 8) & 0xff; \
259 (c_macaddr)[2] = (((pwmi_mac_addr)->mac_addr31to0) >> 16) & 0xff; \
260 (c_macaddr)[3] = (((pwmi_mac_addr)->mac_addr31to0) >> 24) & 0xff; \
261 (c_macaddr)[4] = ((pwmi_mac_addr)->mac_addr47to32) & 0xff; \
262 (c_macaddr)[5] = (((pwmi_mac_addr)->mac_addr47to32) >> 8) & 0xff; \
263 } while (0)
264
265#define TARGET_INIT_STATUS_SUCCESS 0x0
266#define TARGET_INIT_STATUS_GEN_FAILED 0x1
267#define TARGET_GET_INIT_STATUS_REASON(status) ((status) & 0xffff)
268#define TARGET_GET_INIT_STATUS_MODULE_ID(status) (((status) >> 16) & 0xffff)
Selvaraj, Sridhar0a1427f2016-07-04 21:40:23 +0530269
270#define MAX_ASSOC_IE_LENGTH 1024
Govind Singh89727882016-04-15 13:58:27 +0530271typedef uint32_t TARGET_INIT_STATUS;
272
273typedef enum {
274 WMI_HOST_MODE_11A = 0, /* 11a Mode */
275 WMI_HOST_MODE_11G = 1, /* 11b/g Mode */
276 WMI_HOST_MODE_11B = 2, /* 11b Mode */
277 WMI_HOST_MODE_11GONLY = 3, /* 11g only Mode */
278 WMI_HOST_MODE_11NA_HT20 = 4, /* 11a HT20 mode */
279 WMI_HOST_MODE_11NG_HT20 = 5, /* 11g HT20 mode */
280 WMI_HOST_MODE_11NA_HT40 = 6, /* 11a HT40 mode */
281 WMI_HOST_MODE_11NG_HT40 = 7, /* 11g HT40 mode */
282 WMI_HOST_MODE_11AC_VHT20 = 8,
283 WMI_HOST_MODE_11AC_VHT40 = 9,
284 WMI_HOST_MODE_11AC_VHT80 = 10,
285 WMI_HOST_MODE_11AC_VHT20_2G = 11,
286 WMI_HOST_MODE_11AC_VHT40_2G = 12,
287 WMI_HOST_MODE_11AC_VHT80_2G = 13,
288 WMI_HOST_MODE_11AC_VHT80_80 = 14,
289 WMI_HOST_MODE_11AC_VHT160 = 15,
Krishna Raoc5a97ba2017-01-12 18:05:02 +0530290 WMI_HOST_MODE_11AX_HE20 = 16,
291 WMI_HOST_MODE_11AX_HE40 = 17,
292 WMI_HOST_MODE_11AX_HE80 = 18,
293 WMI_HOST_MODE_11AX_HE80_80 = 19,
294 WMI_HOST_MODE_11AX_HE160 = 20,
295 WMI_HOST_MODE_11AX_HE20_2G = 21,
296 WMI_HOST_MODE_11AX_HE40_2G = 22,
297 WMI_HOST_MODE_11AX_HE80_2G = 23,
298 WMI_HOST_MODE_UNKNOWN = 24,
299 WMI_HOST_MODE_MAX = 24
Govind Singh89727882016-04-15 13:58:27 +0530300} WMI_HOST_WLAN_PHY_MODE;
301
Sathish Kumar753eb7d2016-10-25 18:47:52 +0530302typedef enum {
303 WMI_HOST_VDEV_START_OK = 0,
304 WMI_HOST_VDEV_START_CHAN_INVALID,
305} WMI_HOST_VDEV_START_STATUS;
306
307/*
308 * Needs to be removed and use channel_param based
309 * on how it is processed
310 */
311typedef struct {
312 /** primary 20 MHz channel frequency in mhz */
313 uint32_t mhz;
314 /** Center frequency 1 in MHz*/
315 uint32_t band_center_freq1;
316 /** Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
317 uint32_t band_center_freq2;
318 /** channel info described below */
319 uint32_t info;
320 /** contains min power, max power, reg power and reg class id. */
321 uint32_t reg_info_1;
322 /** contains antennamax */
323 uint32_t reg_info_2;
324} wmi_host_channel;
Govind Singh89727882016-04-15 13:58:27 +0530325
Gupta, Kapil7b768002016-04-25 19:14:19 +0530326/**
Pratik Gandhi74ff2e52017-01-05 19:38:41 +0530327 * enum WMI_HOST_REGDMN_MODE:
328 * @WMI_HOST_REGDMN_MODE_11A: 11a channels
329 * @WMI_HOST_REGDMN_MODE_TURBO: 11a turbo-only channels
330 * @WMI_HOST_REGDMN_MODE_11B: 11b channels
331 * @WMI_HOST_REGDMN_MODE_PUREG: 11g channels (OFDM only)
332 * @WMI_HOST_REGDMN_MODE_11G: historical
333 * @WMI_HOST_REGDMN_MODE_108G: 11g+Turbo channels
334 * @WMI_HOST_REGDMN_MODE_108A: 11a+Turbo channels
335 * @WMI_HOST_REGDMN_MODE_XR: XR channels
336 * @WMI_HOST_REGDMN_MODE_11A_HALF_RATE: 11a half rate channels
337 * @WMI_HOST_REGDMN_MODE_11A_QUARTER_RATE: 11a quarter rate channels
338 * @WMI_HOST_REGDMN_MODE_11NG_HT20: 11ng HT20 channels
339 * @WMI_HOST_REGDMN_MODE_11NA_HT20: 11na HT20 channels
340 * @WMI_HOST_REGDMN_MODE_11NG_HT40PLUS: 11ng HT40+ channels
341 * @WMI_HOST_REGDMN_MODE_11NG_HT40MINUS: 11ng HT40- channels
342 * @WMI_HOST_REGDMN_MODE_11NA_HT40PLUS: 11na HT40+ channels
343 * @WMI_HOST_REGDMN_MODE_11NA_HT40MINUS: 11na HT40- channels
344 * @WMI_HOST_REGDMN_MODE_11AC_VHT20: 5GHz, VHT20
345 * @WMI_HOST_REGDMN_MODE_11AC_VHT40PLUS: 5GHz, VHT40+ channels
346 * @WMI_HOST_REGDMN_MODE_11AC_VHT40MINUS: 5GHz, VHT40- channels
347 * @WMI_HOST_REGDMN_MODE_11AC_VHT80: 5GHz, VHT80 channels
348 * @WMI_HOST_REGDMN_MODE_11AC_VHT160: 5GHz, VHT160 channels
349 * @WMI_HOST_REGDMN_MODE_11AC_VHT80_80: 5GHz, VHT80+80 channels
350 * @WMI_HOST_REGDMN_MODE_11AXG_HE20: 11ax 2.4GHz, HE20 channels
351 * @WMI_HOST_REGDMN_MODE_11AXA_HE20: 11ax 5GHz, HE20 channels
352 * @WMI_HOST_REGDMN_MODE_11AXG_HE40PLUS: 11ax 2.4GHz, HE40+ channels
353 * @WMI_HOST_REGDMN_MODE_11AXG_HE40MINUS: 11ax 2.4GHz, HE40- channels
354 * @WMI_HOST_REGDMN_MODE_11AXA_HE40PLUS: 11ax 5GHz, HE40+ channels
355 * @WMI_HOST_REGDMN_MODE_11AXA_HE40MINUS: 11ax 5GHz, HE40- channels
356 * @WMI_HOST_REGDMN_MODE_11AXA_HE80: 11ax 5GHz, HE80 channels
357 * @WMI_HOST_REGDMN_MODE_11AXA_HE160: 11ax 5GHz, HE160 channels
358 * @WMI_HOST_REGDMN_MODE_11AXA_HE80_80: 11ax 5GHz, HE80+80 channels
359 */
360typedef enum {
361 WMI_HOST_REGDMN_MODE_11A = 0x00000001,
362 WMI_HOST_REGDMN_MODE_TURBO = 0x00000002,
363 WMI_HOST_REGDMN_MODE_11B = 0x00000004,
364 WMI_HOST_REGDMN_MODE_PUREG = 0x00000008,
365 WMI_HOST_REGDMN_MODE_11G = 0x00000008,
366 WMI_HOST_REGDMN_MODE_108G = 0x00000020,
367 WMI_HOST_REGDMN_MODE_108A = 0x00000040,
368 WMI_HOST_REGDMN_MODE_XR = 0x00000100,
369 WMI_HOST_REGDMN_MODE_11A_HALF_RATE = 0x00000200,
370 WMI_HOST_REGDMN_MODE_11A_QUARTER_RATE = 0x00000400,
371 WMI_HOST_REGDMN_MODE_11NG_HT20 = 0x00000800,
372 WMI_HOST_REGDMN_MODE_11NA_HT20 = 0x00001000,
373 WMI_HOST_REGDMN_MODE_11NG_HT40PLUS = 0x00002000,
374 WMI_HOST_REGDMN_MODE_11NG_HT40MINUS = 0x00004000,
375 WMI_HOST_REGDMN_MODE_11NA_HT40PLUS = 0x00008000,
376 WMI_HOST_REGDMN_MODE_11NA_HT40MINUS = 0x00010000,
377 WMI_HOST_REGDMN_MODE_11AC_VHT20 = 0x00020000,
378 WMI_HOST_REGDMN_MODE_11AC_VHT40PLUS = 0x00040000,
379 WMI_HOST_REGDMN_MODE_11AC_VHT40MINUS = 0x00080000,
380 WMI_HOST_REGDMN_MODE_11AC_VHT80 = 0x00100000,
381 WMI_HOST_REGDMN_MODE_11AC_VHT160 = 0x00200000,
382 WMI_HOST_REGDMN_MODE_11AC_VHT80_80 = 0x00400000,
383 WMI_HOST_REGDMN_MODE_11AXG_HE20 = 0x00800000,
384 WMI_HOST_REGDMN_MODE_11AXA_HE20 = 0x01000000,
385 WMI_HOST_REGDMN_MODE_11AXG_HE40PLUS = 0x02000000,
386 WMI_HOST_REGDMN_MODE_11AXG_HE40MINUS = 0x04000000,
387 WMI_HOST_REGDMN_MODE_11AXA_HE40PLUS = 0x08000000,
388 WMI_HOST_REGDMN_MODE_11AXA_HE40MINUS = 0x10000000,
389 WMI_HOST_REGDMN_MODE_11AXA_HE80 = 0x20000000,
390 WMI_HOST_REGDMN_MODE_11AXA_HE160 = 0x40000000,
391 WMI_HOST_REGDMN_MODE_11AXA_HE80_80 = 0x80000000,
392 WMI_HOST_REGDMN_MODE_ALL = 0xffffffff
393} WMI_HOST_REGDMN_MODE;
394
395/**
Krishna Rao7462a8a2017-02-13 15:14:11 +0530396 * enum WMI_HOST_WLAN_BAND_CAPABILITY: Band capability (2.4 GHz, 5 GHz). Maps to
397 * WLAN_BAND_CAPABILITY used in firmware header file(s).
398 * @WMI_HOST_WLAN_2G_CAPABILITY: 2.4 GHz capable
399 * @WMI_HOST_WLAN_5G_CAPABILITY: 5 GHz capable
400 */
401typedef enum {
402 WMI_HOST_WLAN_2G_CAPABILITY = 0x1,
403 WMI_HOST_WLAN_5G_CAPABILITY = 0x2,
404} WMI_HOST_WLAN_BAND_CAPABILITY;
405
406/**
407 * enum wmi_host_channel_width: Channel operating width. Maps to
408 * wmi_channel_width used in firmware header file(s).
409 * @WMI_HOST_CHAN_WIDTH_20: 20 MHz channel operating width
410 * @WMI_HOST_CHAN_WIDTH_40: 40 MHz channel operating width
411 * @WMI_HOST_CHAN_WIDTH_80: 80 MHz channel operating width
412 * @WMI_HOST_CHAN_WIDTH_160: 160 MHz channel operating width
413 * @WMI_HOST_CHAN_WIDTH_80P80: 80+80 MHz channel operating width
414 * @WMI_HOST_CHAN_WIDTH_5: 5 MHz channel operating width
415 * @WMI_HOST_CHAN_WIDTH_10: 10 MHz channel operating width
416 */
417typedef enum {
418 WMI_HOST_CHAN_WIDTH_20 = 0,
419 WMI_HOST_CHAN_WIDTH_40 = 1,
420 WMI_HOST_CHAN_WIDTH_80 = 2,
421 WMI_HOST_CHAN_WIDTH_160 = 3,
422 WMI_HOST_CHAN_WIDTH_80P80 = 4,
423 WMI_HOST_CHAN_WIDTH_5 = 5,
424 WMI_HOST_CHAN_WIDTH_10 = 6,
425} wmi_host_channel_width;
426
427/**
Gupta, Kapil7b768002016-04-25 19:14:19 +0530428 * enum wmi_dwelltime_adaptive_mode: dwelltime_mode
429 * @WMI_DWELL_MODE_DEFAULT: Use firmware default mode
430 * @WMI_DWELL_MODE_CONSERVATIVE: Conservative adaptive mode
431 * @WMI_DWELL_MODE_MODERATE: Moderate adaptive mode
432 * @WMI_DWELL_MODE_AGGRESSIVE: Aggressive adaptive mode
433 * @WMI_DWELL_MODE_STATIC: static adaptive mode
434 */
435enum wmi_dwelltime_adaptive_mode {
436 WMI_DWELL_MODE_DEFAULT = 0,
437 WMI_DWELL_MODE_CONSERVATIVE = 1,
438 WMI_DWELL_MODE_MODERATE = 2,
439 WMI_DWELL_MODE_AGGRESSIVE = 3,
440 WMI_DWELL_MODE_STATIC = 4
441};
442
Manishekar Chandrasekaranb8c59382016-04-21 19:16:32 +0530443#define MAX_NUM_CHAN 128
444
Govind Singhc7cd2d62016-06-21 14:33:26 +0530445/* WME stream classes */
Himanshu Agarwal56c292f2016-07-19 15:41:51 +0530446#define WMI_HOST_AC_BE 0 /* best effort */
447#define WMI_HOST_AC_BK 1 /* background */
448#define WMI_HOST_AC_VI 2 /* video */
449#define WMI_HOST_AC_VO 3 /* voice */
Govind Singhc7cd2d62016-06-21 14:33:26 +0530450#define WMI_TID_TO_AC(_tid) (\
Himanshu Agarwal56c292f2016-07-19 15:41:51 +0530451 (((_tid) == 0) || ((_tid) == 3)) ? WMI_HOST_AC_BE : \
452 (((_tid) == 1) || ((_tid) == 2)) ? WMI_HOST_AC_BK : \
453 (((_tid) == 4) || ((_tid) == 5)) ? WMI_HOST_AC_VI : \
454 WMI_HOST_AC_VO)
Govind Singhc7cd2d62016-06-21 14:33:26 +0530455
Govind Singh3ddda1f2016-03-09 11:34:12 +0530456/**
457 * struct vdev_create_params - vdev create cmd parameter
458 * @if_id: interface id
459 * @type: interface type
460 * @subtype: interface subtype
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +0530461 * @nss_2g: NSS for 2G
462 * @nss_5g: NSS for 5G
463 * @pdev_id: pdev id on pdev for this vdev
Govind Singh3ddda1f2016-03-09 11:34:12 +0530464 */
465struct vdev_create_params {
466 uint8_t if_id;
467 uint32_t type;
468 uint32_t subtype;
Kiran Kumar Lokere0ae9fb92016-05-02 12:32:27 -0700469 uint8_t nss_2g;
470 uint8_t nss_5g;
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +0530471 uint32_t pdev_id;
Govind Singh3ddda1f2016-03-09 11:34:12 +0530472};
473
474/**
475 * struct vdev_delete_params - vdev delete cmd parameter
476 * @if_id: interface id
477 */
478struct vdev_delete_params {
479 uint8_t if_id;
480};
481
482/**
Govind Singh89727882016-04-15 13:58:27 +0530483 * struct channel_param - Channel paramters with all
484 * info required by target.
485 * @chan_id: channel id
486 * @pwr: channel power
487 * @mhz: channel frequency
488 * @half_rate: is half rate
489 * @quarter_rate: is quarter rate
490 * @dfs_set: is dfs channel
491 * @dfs_set_cfreq2: is secondary freq dfs channel
492 * @is_chan_passive: is this passive channel
493 * @allow_ht: HT allowed in chan
494 * @allow_vht: VHT allowed on chan
Nandha Kishore Easwaran3f1115a2016-11-10 16:01:07 +0530495 * @set_agile: is agile mode
Govind Singh89727882016-04-15 13:58:27 +0530496 * @phy_mode: phymode (vht80 or ht40 or ...)
497 * @cfreq1: centre frequency on primary
498 * @cfreq2: centre frequency on secondary
499 * @maxpower: max power for channel
500 * @minpower: min power for channel
501 * @maxreqpower: Max regulatory power
502 * @antennamac: Max antenna
503 * @reg_class_id: Regulatory class id.
504 */
505
506struct channel_param {
507 uint8_t chan_id;
508 uint8_t pwr;
509 uint32_t mhz;
510 uint32_t half_rate:1,
511 quarter_rate:1,
512 dfs_set:1,
513 dfs_set_cfreq2:1,
514 is_chan_passive:1,
515 allow_ht:1,
Nandha Kishore Easwaran5bee1432016-10-18 10:30:14 +0530516 allow_vht:1,
Nandha Kishore Easwaran3f1115a2016-11-10 16:01:07 +0530517 set_agile:1;
Govind Singh89727882016-04-15 13:58:27 +0530518 uint32_t phy_mode;
519 uint32_t cfreq1;
520 uint32_t cfreq2;
521 int8_t maxpower;
522 int8_t minpower;
523 int8_t maxregpower;
524 uint8_t antennamax;
525 uint8_t reg_class_id;
526};
527
528/**
Govind Singh3ddda1f2016-03-09 11:34:12 +0530529 * struct vdev_stop_params - vdev stop cmd parameter
530 * @vdev_id: vdev id
531 */
532struct vdev_stop_params {
533 uint8_t vdev_id;
534};
535
536/**
537 * struct vdev_up_params - vdev up cmd parameter
538 * @vdev_id: vdev id
539 * @assoc_id: association id
540 */
541struct vdev_up_params {
542 uint8_t vdev_id;
543 uint16_t assoc_id;
544};
545
546/**
547 * struct vdev_down_params - vdev down cmd parameter
548 * @vdev_id: vdev id
549 */
550struct vdev_down_params {
551 uint8_t vdev_id;
552};
553
554/**
Himanshu Agarwal7e4f4bc2016-03-09 16:49:38 +0530555 * struct mac_ssid - mac ssid structure
556 * @length:
557 * @mac_ssid[WMI_MAC_MAX_SSID_LENGTH]:
558 */
559struct mac_ssid {
560 uint8_t length;
561 uint8_t mac_ssid[WMI_MAC_MAX_SSID_LENGTH];
562} qdf_packed;
563
564/**
565 * struct vdev_start_params - vdev start cmd parameter
566 * @vdev_id: vdev id
567 * @chan_freq: channel frequency
568 * @chan_mode: channel mode
569 * @band_center_freq1: center freq 1
570 * @band_center_freq2: center freq 2
571 * @flags: flags to set like pmf_enabled etc.
572 * @is_dfs: flag to check if dfs enabled
573 * @beacon_intval: beacon interval
574 * @dtim_period: dtim period
575 * @max_txpow: max tx power
576 * @is_restart: flag to check if it is vdev
577 * @ssid: ssid and ssid length info
578 * @preferred_tx_streams: preferred tx streams
579 * @preferred_rx_streams: preferred rx streams
580 * @intr_update: flag to check if need to update
581 * required wma interface params
582 * @intr_ssid: pointer to wma interface ssid
583 * @intr_flags: poiter to wma interface flags
584 * @requestor_id: to update requestor id
585 * @disable_hw_ack: to update disable hw ack flag
586 * @info: to update channel info
587 * @reg_info_1: to update min power, max power,
588 * reg power and reg class id
589 * @reg_info_2: to update antennamax
Govind Singh89727882016-04-15 13:58:27 +0530590 * @oper_mode: Operating mode
591 * @dfs_pri_multiplier: DFS primary multiplier
592 * allow pulse if they are within multiple of PRI for the radar type
593 * @dot11_mode: Phy mode (VHT20/VHT80...)
594 * @disable_hw_ack: Disable hw ack if chan is dfs channel for cac
595 * @channel_param: Channel params required by target.
Himanshu Agarwal7e4f4bc2016-03-09 16:49:38 +0530596 */
597struct vdev_start_params {
598 uint8_t vdev_id;
599 uint32_t chan_freq;
600 uint32_t chan_mode;
601 uint32_t band_center_freq1;
602 uint32_t band_center_freq2;
603 uint32_t flags;
604 bool is_dfs;
605 uint32_t beacon_intval;
606 uint32_t dtim_period;
607 int32_t max_txpow;
608 bool is_restart;
Siddarth Poddar466963e2016-03-29 15:13:26 +0530609 bool is_half_rate;
610 bool is_quarter_rate;
611 uint32_t dis_hw_ack;
612 uint32_t flag_dfs;
613 uint8_t hidden_ssid;
614 uint8_t pmf_enabled;
Himanshu Agarwal7e4f4bc2016-03-09 16:49:38 +0530615 struct mac_ssid ssid;
Siddarth Poddar466963e2016-03-29 15:13:26 +0530616 uint32_t num_noa_descriptors;
Himanshu Agarwal7e4f4bc2016-03-09 16:49:38 +0530617 uint32_t preferred_rx_streams;
618 uint32_t preferred_tx_streams;
Kiran Venkatappa9da7e042016-08-09 22:52:35 +0530619#ifndef CONFIG_MCL
Govind Singh89727882016-04-15 13:58:27 +0530620 uint8_t oper_mode;
621 int32_t dfs_pri_multiplier;
622 uint8_t dot11_mode;
623 uint8_t disable_hw_ack;
624 struct channel_param channel;
625#endif
Himanshu Agarwal7e4f4bc2016-03-09 16:49:38 +0530626};
627
628/**
629 * struct hidden_ssid_vdev_restart_params -
630 * vdev restart cmd parameter
631 * @session_id: session id
632 * @ssid_len: ssid length
633 * @ssid: ssid
634 * @flags: flags
635 * @requestor_id: requestor id
636 * @disable_hw_ack: flag to disable hw ack feature
637 * @mhz: channel frequency
638 * @band_center_freq1: center freq 1
639 * @band_center_freq2: center freq 2
640 * @info: channel info
641 * @reg_info_1: contains min power, max power,
642 * reg power and reg class id
643 * @reg_info_2: contains antennamax
644 * @hidden_ssid_restart_in_progress:
645 * flag to check if restart is in progress
646 */
647struct hidden_ssid_vdev_restart_params {
648 uint8_t session_id;
649 uint32_t ssid_len;
650 uint32_t ssid[8];
651 uint32_t flags;
652 uint32_t requestor_id;
653 uint32_t disable_hw_ack;
654 uint32_t mhz;
655 uint32_t band_center_freq1;
656 uint32_t band_center_freq2;
657 uint32_t info;
658 uint32_t reg_info_1;
659 uint32_t reg_info_2;
660 qdf_atomic_t hidden_ssid_restart_in_progress;
661};
662
663/**
Govind Singh3ddda1f2016-03-09 11:34:12 +0530664 * struct vdev_set_params - vdev set cmd parameter
665 * @if_id: vdev id
666 * @param_id: parameter id
667 * @param_value: parameter value
668 */
669struct vdev_set_params {
670 uint32_t if_id;
671 uint32_t param_id;
672 uint32_t param_value;
673};
674
Govind Singh89727882016-04-15 13:58:27 +0530675
676/**
Govind Singh3ddda1f2016-03-09 11:34:12 +0530677 * struct peer_delete_params - peer delete cmd parameter
678 * @vdev_id: vdev id
679 */
680struct peer_delete_params {
681 uint8_t vdev_id;
682};
683
684/**
685 * struct peer_flush_params - peer flush cmd parameter
686 * @peer_tid_bitmap: peer tid bitmap
687 * @vdev_id: vdev id
688 */
689struct peer_flush_params {
690 uint32_t peer_tid_bitmap;
691 uint8_t vdev_id;
692};
693
694/**
695 * struct peer_set_params - peer set cmd parameter
696 * @param_id: parameter id
697 * @param_value: parameter value
698 * @vdev_id: vdev id
699 */
700struct peer_set_params {
701 uint32_t param_id;
702 uint32_t param_value;
703 uint32_t vdev_id;
704};
705
706/**
707 * struct peer_create_params - peer create cmd parameter
708 * @peer_addr: peer mac addr
709 * @peer_type: peer type
710 * @vdev_id: vdev id
711 */
712struct peer_create_params {
713 const uint8_t *peer_addr;
714 uint32_t peer_type;
715 uint32_t vdev_id;
716};
717
718/**
719 * struct peer_remove_params - peer remove cmd parameter
720 * @bssid: bss id
721 * @vdev_id: vdev id
722 * @roam_synch_in_progress: flag to indicate if roaming is in progress
723 */
724struct peer_remove_params {
725 uint8_t *bssid;
726 uint8_t vdev_id;
727 bool roam_synch_in_progress;
728};
729
730/**
Govind Singh89727882016-04-15 13:58:27 +0530731 * Stats ID enums defined in host
732 */
733typedef enum {
734 WMI_HOST_REQUEST_PEER_STAT = 0x01,
735 WMI_HOST_REQUEST_AP_STAT = 0x02,
736 WMI_HOST_REQUEST_PDEV_STAT = 0x04,
737 WMI_HOST_REQUEST_VDEV_STAT = 0x08,
738 WMI_HOST_REQUEST_BCNFLT_STAT = 0x10,
739 WMI_HOST_REQUEST_VDEV_RATE_STAT = 0x20,
740 WMI_HOST_REQUEST_INST_STAT = 0x40,
741 WMI_HOST_REQUEST_PEER_EXTD_STAT = 0x80,
742 WMI_HOST_REQUEST_VDEV_EXTD_STAT = 0x100,
743} wmi_host_stats_id;
744
745typedef struct {
746 uint16_t cfg_retry_count;
747 uint16_t retry_count;
748} wmi_host_inst_rssi_args;
749
750/**
Govind Singh3ddda1f2016-03-09 11:34:12 +0530751 * struct stats_request_params - stats_request cmd parameter
752 * @stats_id: statistics id
753 * @vdev_id: vdev id
Govind Singh89727882016-04-15 13:58:27 +0530754 * @wmi_host_inst_rssi_args: Instantaneous rssi stats args
Govind Singh3ddda1f2016-03-09 11:34:12 +0530755 */
756struct stats_request_params {
757 uint32_t stats_id;
758 uint32_t vdev_id;
Kiran Venkatappa9da7e042016-08-09 22:52:35 +0530759#ifndef CONFIG_MCL
Govind Singh89727882016-04-15 13:58:27 +0530760 wmi_host_inst_rssi_args rssi_args;
761#endif
762};
763
764/**
765 * struct bss_chan_info_request_params - BSS chan info params
766 * @param: parameter value
767 */
768struct bss_chan_info_request_params {
769 uint32_t param;
Govind Singh3ddda1f2016-03-09 11:34:12 +0530770};
771
772/**
773 * struct green_ap_ps_params - green ap ps cmd parameter
774 * @value: parameter value
775 */
776struct green_ap_ps_params {
777 uint32_t value;
778};
779
780/**
781 * struct wow_cmd_params - wow cmd parameter
782 * @enable: wow enable or disable flag
783 * @can_suspend_link: flag to indicate if link can be suspended
784 * @pause_iface_config: interface config
785 */
786struct wow_cmd_params {
787 bool enable;
788 bool can_suspend_link;
789 uint8_t pause_iface_config;
Dustin Browndee95c72016-11-10 11:25:36 -0800790 uint32_t flags;
Govind Singh3ddda1f2016-03-09 11:34:12 +0530791};
792
793/**
Govind Singh89727882016-04-15 13:58:27 +0530794 * struct wow_add_wakeup_params - wow wakeup parameter
795 * @type: param type
796 */
797struct wow_add_wakeup_params {
798 uint32_t type;
799};
800
801/**
802 * struct wow_add_wakeup_pattern_params - Add WoW pattern params
803 * @pattern_bytes: pointer to pattern bytes
804 * @mask_bytes: pointer to mask bytes
805 * @pattern_len: pattern length
806 * @pattern_id: pattern id
807 */
808struct wow_add_wakeup_pattern_params {
809 uint8_t *pattern_bytes;
810 uint8_t *mask_bytes;
811 uint32_t pattern_len;
812 uint32_t pattern_id;
813};
814
815/**
816 * struct wow_remove_wakeup_pattern params - WoW remove pattern param
817 * @pattern_bytes: pointer to pattern bytes
818 * @mask_bytes: Mask bytes
819 * @pattern_id: pattern identifier
820 */
821struct wow_remove_wakeup_pattern_params {
822 uint32_t *pattern_bytes;
823 uint32_t *mask_bytes;
824 uint32_t pattern_id;
825};
826
827
828/**
Govind Singh3ddda1f2016-03-09 11:34:12 +0530829 * struct packet_enable_params - packet enable cmd parameter
830 * @vdev_id: vdev id
831 * @enable: flag to indicate if parameter can be enabled or disabled
832 */
833struct packet_enable_params {
834 uint8_t vdev_id;
835 bool enable;
836};
837
838/**
839 * struct suspend_params - suspend cmd parameter
840 * @disable_target_intr: disable target interrupt
841 */
842struct suspend_params {
843 uint8_t disable_target_intr;
844};
845
846/**
847 * struct pdev_params - pdev set cmd parameter
848 * @param_id: parameter id
849 * @param_value: parameter value
850 */
851struct pdev_params {
852 uint32_t param_id;
853 uint32_t param_value;
854};
855
856/**
Govind Singh89727882016-04-15 13:58:27 +0530857 * struct beacon_tmpl_params - beacon template cmd parameter
858 * @vdev_id: vdev id
859 * @tim_ie_offset: tim ie offset
860 * @tmpl_len: beacon template length
861 * @tmpl_len_aligned: beacon template alignment
Sathish Kumar907a7462017-02-27 10:35:40 +0530862 * @csa_switch_count_offset: CSA swith count offset in beacon frame
863 * @ext_csa_switch_count_offset: ECSA switch count offset in beacon frame
Govind Singh89727882016-04-15 13:58:27 +0530864 * @frm: beacon template parameter
865 */
866struct beacon_tmpl_params {
867 uint8_t vdev_id;
868 uint32_t tim_ie_offset;
869 uint32_t tmpl_len;
870 uint32_t tmpl_len_aligned;
Sathish Kumar907a7462017-02-27 10:35:40 +0530871 uint32_t csa_switch_count_offset;
872 uint32_t ext_csa_switch_count_offset;
Govind Singh89727882016-04-15 13:58:27 +0530873 uint8_t *frm;
874};
875
Govind Singhfa201d92016-06-08 19:40:11 +0530876#ifdef CONFIG_MCL
Govind Singh89727882016-04-15 13:58:27 +0530877/**
878 * struct beacon_params - beacon cmd parameter
Govind Singh3ddda1f2016-03-09 11:34:12 +0530879 * @vdev_id: vdev id
880 * @tim_ie_offset: tim ie offset
881 * @tmpl_len: beacon template length
882 * @tmpl_len_aligned: beacon template alignment
883 * @frm: beacon template parameter
884 */
885struct beacon_params {
886 uint8_t vdev_id;
887 uint32_t tim_ie_offset;
888 uint32_t tmpl_len;
889 uint32_t tmpl_len_aligned;
890 uint8_t *frm;
891};
Govind Singh89727882016-04-15 13:58:27 +0530892#else
893/**
894 * struct beacon_params - beacon cmd parameter
895 * @vdev_id: vdev id
896 * @beaconInterval: Beacon interval
897 * @wbuf: beacon buffer
898 * @frame_ctrl: frame control field
899 * @bcn_txant: beacon antenna
900 * @is_dtim_count_zero: is it dtim beacon
901 * @is_bitctl_reqd: is Bit control required
902 * @is_high_latency: Is this high latency target
903 */
904struct beacon_params {
905 uint8_t vdev_id;
906 uint16_t beaconInterval;
907 qdf_nbuf_t wbuf;
908 uint16_t frame_ctrl;
909 uint32_t bcn_txant;
910 bool is_dtim_count_zero;
911 bool is_bitctl_reqd;
912 bool is_high_latency;
913};
914#endif
915
916/**
917 * struct bcn_prb_template_params - beacon probe template parameter
918 * @vdev_id: vdev id
919 * @buf_len: Template length
920 * @caps: capabilities field
921 * @erp: ERP field
922 */
923struct bcn_prb_template_params {
924 uint8_t vdev_id;
925 int buf_len;
926 uint16_t caps;
927 uint8_t erp;
928};
929
930#define WMI_MAX_SUPPORTED_RATES 128
931/**
932 * struct target_rate_set - Rate set bitmap
933 * @num_rate: number of rates in rates bitmap
934 * @rates: rates (each 8bit value) packed into a 32 bit word.
935 * the rates are filled from least significant byte to most
936 * significant byte.
937 */
938typedef struct {
939 uint32_t num_rates;
940 uint32_t rates[(WMI_MAX_SUPPORTED_RATES / 4) + 1];
941} target_rate_set;
Govind Singh3ddda1f2016-03-09 11:34:12 +0530942
Kris Muthusamy1499bac2017-02-20 02:35:47 -0800943
944#define WMI_HOST_MAX_NUM_SS 8
945#define WMI_MAX_HECAP_PHY_SIZE 3
946
947/**
948 * struct wmi_host_ppe_threshold -PPE threshold
949 * @numss_m1: NSS - 1
950 * @ru_count: Max RU count
951 * @ppet16_ppet8_ru3_ru0: ppet8 and ppet16 for max num ss
952 */
953struct wmi_host_ppe_threshold {
954 uint32_t numss_m1;
955 uint32_t ru_count;
956 uint32_t ppet16_ppet8_ru3_ru0[WMI_HOST_MAX_NUM_SS];
957};
958
959
Govind Singh3ddda1f2016-03-09 11:34:12 +0530960/**
Himanshu Agarwal56c292f2016-07-19 15:41:51 +0530961 * struct wmi_host_mac_addr - host mac addr 2 word representation of MAC addr
962 * @mac_addr31to0: upper 4 bytes of MAC address
963 * @mac_addr47to32: lower 2 bytes of MAC address
964 */
965typedef struct {
966 uint32_t mac_addr31to0;
967 uint32_t mac_addr47to32;
968} wmi_host_mac_addr;
969
970/**
Govind Singh3ddda1f2016-03-09 11:34:12 +0530971 * struct peer_assoc_params - peer assoc cmd parameter
972 * @peer_macaddr: peer mac address
973 * @vdev_id: vdev id
974 * @peer_new_assoc: peer association type
975 * @peer_associd: peer association id
976 * @peer_flags: peer flags
977 * @peer_caps: peer capabalities
978 * @peer_listen_intval: peer listen interval
979 * @peer_ht_caps: HT capabalities
980 * @peer_max_mpdu: 0 : 8k , 1 : 16k, 2 : 32k, 3 : 64k
981 * @peer_mpdu_density: 3 : 0~7 : 2^(11nAMPDUdensity -4)
982 * @peer_rate_caps: peer rate capabalities
983 * @peer_nss: peer nss
984 * @peer_phymode: peer phymode
985 * @peer_ht_info: peer HT info
986 * @peer_legacy_rates: peer legacy rates
987 * @peer_ht_rates: peer ht rates
Govind Singh3ddda1f2016-03-09 11:34:12 +0530988 * @rx_max_rate: max rx rates
989 * @rx_mcs_set: rx mcs
990 * @tx_max_rate: max tx rates
991 * @tx_mcs_set: tx mcs
992 * @vht_capable: VHT capabalities
Govind Singh89727882016-04-15 13:58:27 +0530993 * @tx_max_mcs_nss: max tx MCS and NSS
994 * @peer_bw_rxnss_override: Peer BW RX NSS overriden or not.
995 * @is_pmf_enabled: PMF enabled
996 * @is_wme_set: WME enabled
997 * @qos_flag: QoS Flags
998 * @apsd_flag: APSD flags
999 * @ht_flag: HT flags
1000 * @bw_40: 40 capabale
1001 * @bw_80: 80 capabale
1002 * @bw_160: 160 capabale
1003 * @stbc_flag: STBC flag
1004 * @ldpc_flag: LDPC flag
1005 * @static_mimops_flag: statis MIMO PS flags
1006 * @dynamic_mimops_flag: Dynamic MIMO PS flags
1007 * @spatial_mux_flag: spatial MUX flags
1008 * @vht_flag: VHT flags
1009 * @vht_ng_flag: VHT on 11N/G flags
1010 * @need_ptk_4_way: Needs 4 way handshake
1011 * @need_gtk_2_way: Needs 2 way GTK
1012 * @auth_flag: Is peer authenticated
1013 * @safe_mode_enabled: Safe enabled for this peer
1014 * @amsdu_disable: AMSDU disble
1015 * @peer_mac: Peer mac address
Kris Muthusamy1499bac2017-02-20 02:35:47 -08001016 * @peer_he_cap_macinfo: Peer HE Cap MAC info
1017 * @peer_he_ops: Peer HE operation info
1018 * @peer_he_cap_phyinfo: Peer HE Cap PHY info
1019 * @peer_he_mcs: Peer HE MCS MAP
1020 * @peer_ppet: Peer HE PPET info
Govind Singh3ddda1f2016-03-09 11:34:12 +05301021 */
1022struct peer_assoc_params {
Himanshu Agarwal56c292f2016-07-19 15:41:51 +05301023 wmi_host_mac_addr peer_macaddr;
Govind Singh3ddda1f2016-03-09 11:34:12 +05301024 uint32_t vdev_id;
1025 uint32_t peer_new_assoc;
1026 uint32_t peer_associd;
1027 uint32_t peer_flags;
1028 uint32_t peer_caps;
1029 uint32_t peer_listen_intval;
1030 uint32_t peer_ht_caps;
1031 uint32_t peer_max_mpdu;
1032 uint32_t peer_mpdu_density;
1033 uint32_t peer_rate_caps;
1034 uint32_t peer_nss;
1035 uint32_t peer_vht_caps;
1036 uint32_t peer_phymode;
1037 uint32_t peer_ht_info[2];
Govind Singh89727882016-04-15 13:58:27 +05301038 target_rate_set peer_legacy_rates;
1039 target_rate_set peer_ht_rates;
Govind Singh3ddda1f2016-03-09 11:34:12 +05301040 uint32_t rx_max_rate;
1041 uint32_t rx_mcs_set;
1042 uint32_t tx_max_rate;
1043 uint32_t tx_mcs_set;
1044 uint8_t vht_capable;
Kiran Venkatappa9da7e042016-08-09 22:52:35 +05301045#ifndef CONFIG_MCL
Govind Singh89727882016-04-15 13:58:27 +05301046 uint32_t tx_max_mcs_nss;
1047 uint32_t peer_bw_rxnss_override;
1048 bool is_pmf_enabled;
1049 bool is_wme_set;
1050 bool qos_flag;
1051 bool apsd_flag;
1052 bool ht_flag;
1053 bool bw_40;
1054 bool bw_80;
1055 bool bw_160;
1056 bool stbc_flag;
1057 bool ldpc_flag;
1058 bool static_mimops_flag;
1059 bool dynamic_mimops_flag;
1060 bool spatial_mux_flag;
1061 bool vht_flag;
1062 bool vht_ng_flag;
1063 bool need_ptk_4_way;
1064 bool need_gtk_2_way;
1065 bool auth_flag;
1066 bool safe_mode_enabled;
1067 bool amsdu_disable;
1068 /* Use common structure */
1069 uint8_t peer_mac[IEEE80211_ADDR_LEN];
1070#endif
Kris Muthusamy1499bac2017-02-20 02:35:47 -08001071 uint32_t peer_he_cap_macinfo;
1072 uint32_t peer_he_ops;
1073 uint32_t peer_he_cap_phyinfo[WMI_MAX_HECAP_PHY_SIZE];
1074 uint32_t peer_he_mcs;
1075 struct wmi_host_ppe_threshold peer_ppet;
Govind Singh3ddda1f2016-03-09 11:34:12 +05301076};
1077
1078/**
1079 * struct sta_ps_params - sta ps cmd parameter
1080 * @vdev_id: vdev id
1081 * @param: sta ps paramter
1082 * @value: sta ps parameter value
1083 */
1084struct sta_ps_params {
1085 uint32_t vdev_id;
1086 uint32_t param;
1087 uint32_t value;
1088};
1089
1090/**
1091 * struct ap_ps_params - ap ps cmd parameter
1092 * @vdev_id: vdev id
1093 * @param: ap ps paramter
1094 * @value: ap ps paramter value
1095 */
1096struct ap_ps_params {
1097 uint32_t vdev_id;
1098 uint32_t param;
1099 uint32_t value;
1100};
1101
Govind Singh89727882016-04-15 13:58:27 +05301102#define WMI_HOST_SCAN_CHAN_FREQ_SHIFT 0
1103#define WMI_HOST_SCAN_CHAN_FREQ_MASK 0xffff
1104#define WMI_HOST_SCAN_CHAN_MODE_SHIFT 16
1105#define WMI_HOST_SCAN_CHAN_MODE_MASK 0xff
1106
Govind Singh3ddda1f2016-03-09 11:34:12 +05301107/**
Govind Singh3ddda1f2016-03-09 11:34:12 +05301108 * struct scan_start_params - start scan cmd parameter
1109 * @scan_id: scan id
1110 * @scan_req_id: requeted scan id
1111 * @vdev_id: vdev id
1112 * @scan_priority: scan priority
1113 * @notify_scan_events: flag to indicate if scan to be notified
1114 * @dwell_time_active: active dwell time
1115 * @dwell_time_passive: passive dwell time
1116 * @min_rest_time: min rest time
1117 * @max_rest_time: max rest time
1118 * @repeat_probe_time: repeat probe time
1119 * @probe_spacing_time: probe spacing time
1120 * @idle_time: idle time
1121 * @max_scan_time: max scan time
1122 * @probe_delay: probe delay
1123 * @scan_ctrl_flags: scan control flag
1124 * @burst_duration: burst duration
1125 * @num_chan: no of channel
1126 * @num_bssid: no of bssid
1127 * @num_ssids: no of ssid
1128 * @ie_len: ie length
1129 * @n_probes: no of probe
1130 * @chan_list: channel list
1131 * @ie_len_with_pad: ie length with padding
1132 * @num_ssid: no of ssid
1133 * @sid: pointer to mac_ssid structure
1134 * @uie_fieldOffset: ie field offset
1135 * @mac_add_bytes: mac address bytes
Govind Singh89727882016-04-15 13:58:27 +05301136 * @is_strict_pscan_en: Is this a strict passive scan
1137 * @is_promiscous_mode: Is promiscous mode
1138 * @is_phy_error: is Phy error
1139 * @add_cck_rates: Add cck rates
1140 * @chan_stat_enable: channel stats enabled
1141 * @offchan_tx_mgmt: Offchan tx scan
1142 * @offchan_tx_data: offchan tx data
1143 * @add_bcast_probe_reqd: Add bcast probe request
1144 * @bssid_list: Lisst of bssid to scan
1145 * @ie_data: IE data buffer pointer
1146 * @passive_flag: Is this passive scan
Govind Singh3ddda1f2016-03-09 11:34:12 +05301147 */
1148struct scan_start_params {
1149 uint32_t scan_id;
1150 uint32_t scan_req_id;
1151 uint32_t vdev_id;
1152 uint32_t scan_priority;
1153 uint32_t notify_scan_events;
1154 uint32_t dwell_time_active;
1155 uint32_t dwell_time_passive;
1156 uint32_t min_rest_time;
1157 uint32_t max_rest_time;
1158 uint32_t repeat_probe_time;
1159 uint32_t probe_spacing_time;
1160 uint32_t idle_time;
1161 uint32_t max_scan_time;
1162 uint32_t probe_delay;
1163 uint32_t scan_ctrl_flags;
1164 uint32_t burst_duration;
1165 uint32_t num_chan;
1166 uint32_t num_bssid;
1167 uint32_t num_ssids;
1168 uint32_t ie_len;
1169 uint32_t n_probes;
1170 uint32_t *chan_list;
1171 uint32_t ie_len_with_pad;
1172 struct mac_ssid ssid[WMI_SCAN_MAX_NUM_SSID];
1173 uint8_t *ie_base;
1174 uint16_t uie_fieldOffset;
1175 uint8_t mac_add_bytes[IEEE80211_ADDR_LEN];
Kiran Venkatappa9da7e042016-08-09 22:52:35 +05301176#ifndef CONFIG_MCL
Sathish Kumar7e2eaed2016-11-14 17:44:29 +05301177 bool half_rate;
1178 bool quarter_rate;
Govind Singh89727882016-04-15 13:58:27 +05301179 bool is_strict_pscan_en;
1180 bool is_promiscous_mode;
1181 bool is_phy_error;
1182 bool add_cck_rates;
1183 bool chan_stat_enable;
1184 bool offchan_tx_mgmt;
1185 bool offchan_tx_data;
1186 bool add_bcast_probe_reqd;
1187 uint8_t bssid_list[WMI_SCAN_MAX_NUM_BSSID][IEEE80211_ADDR_LEN];
1188 uint8_t *ie_data;
1189 int passive_flag;
1190#endif
Govind Singh3ddda1f2016-03-09 11:34:12 +05301191};
1192
1193/**
1194 * struct scan_stop_params - stop scan cmd parameter
1195 * @requestor: scan requestor
1196 * @scan_id: scan id
1197 * @req_type: scan request type
1198 * @vdev_id: vdev id
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05301199 * @pdev_id: pdev_id
Govind Singh89727882016-04-15 13:58:27 +05301200 * @all_scans: Stop all scans
1201 * @vap_scans: stop vap scans
1202 * @specific_scan: specific scan
1203 * @flags: scan flags
1204 * @ss_scan_id: ss scan id
Govind Singh3ddda1f2016-03-09 11:34:12 +05301205 */
1206struct scan_stop_params {
1207 uint32_t requestor;
1208 uint32_t scan_id;
1209 uint32_t req_type;
1210 uint32_t vdev_id;
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05301211 uint32_t pdev_id;
Kiran Venkatappa9da7e042016-08-09 22:52:35 +05301212#ifndef CONFIG_MCL
Govind Singh89727882016-04-15 13:58:27 +05301213 bool all_scans;
1214 bool vap_scans;
1215 bool specific_scan;
1216 uint32_t flags;
1217 uint32_t ss_scan_id;
1218#endif
Govind Singh3ddda1f2016-03-09 11:34:12 +05301219};
1220
1221/**
1222 * struct scan_chan_list_params - scan channel list cmd parameter
1223 * @num_scan_chans: no of scan channels
1224 * @chan_info: pointer to wmi channel info
1225 */
Govind Singhfa201d92016-06-08 19:40:11 +05301226#ifdef CONFIG_MCL
Himanshu Agarwal56c292f2016-07-19 15:41:51 +05301227/* TODO: This needs clean-up based on how its processed. */
1228typedef struct {
1229 /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_channel */
1230 uint32_t tlv_header;
1231 /** primary 20 MHz channel frequency in mhz */
1232 uint32_t mhz;
1233 /** Center frequency 1 in MHz*/
1234 uint32_t band_center_freq1;
1235 /** Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
1236 uint32_t band_center_freq2;
1237 /** channel info described below */
1238 uint32_t info;
1239 /** contains min power, max power, reg power and reg class id. */
1240 uint32_t reg_info_1;
1241 /** contains antennamax */
1242 uint32_t reg_info_2;
1243} wmi_channel_param;
1244
Govind Singh3ddda1f2016-03-09 11:34:12 +05301245struct scan_chan_list_params {
1246 uint8_t num_scan_chans;
Himanshu Agarwal56c292f2016-07-19 15:41:51 +05301247 wmi_channel_param *chan_info;
Govind Singh3ddda1f2016-03-09 11:34:12 +05301248};
Govind Singh89727882016-04-15 13:58:27 +05301249#else
1250/**
1251 * struct scan_chan_list_params - scan channel list cmd parameter
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05301252 * @pdev_id: pdev_id
Govind Singh89727882016-04-15 13:58:27 +05301253 * @num_chan: no of scan channels
1254 * @nallchans: nall chans
1255 * @ch_param: pointer to channel_paramw
1256 */
1257struct scan_chan_list_params {
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05301258 uint32_t pdev_id;
Govind Singh89727882016-04-15 13:58:27 +05301259 uint16_t nallchans;
1260 struct channel_param ch_param[1];
1261};
1262#endif
Govind Singh3ddda1f2016-03-09 11:34:12 +05301263
1264/**
Sathish Kumar907a7462017-02-27 10:35:40 +05301265 * struct multiple_vdev_restart_params - Multiple vdev restart cmd parameter
1266 * @pdev_id: Pdev identifier
1267 * @requestor_id: Unique id identifying the module
1268 * @disable_hw_ack: Flag to indicate disabling HW ACK during CAC
1269 * @cac_duration_ms: CAC duration on the given channel
1270 * @num_vdevs: No. of vdevs that need to be restarted
1271 * @ch_param: Pointer to channel_param
1272 * @vdev_ids: Pointer to array of vdev_ids
1273 */
1274struct multiple_vdev_restart_params {
1275 uint32_t pdev_id;
1276 uint32_t requestor_id;
1277 uint32_t disable_hw_ack;
1278 uint32_t cac_duration_ms;
1279 uint32_t num_vdevs;
1280 struct channel_param ch_param;
1281 uint32_t vdev_ids[WMI_HOST_PDEV_MAX_VDEVS];
1282};
1283/**
Govind Singh3ddda1f2016-03-09 11:34:12 +05301284 * struct fw_hang_params - fw hang command parameters
1285 * @type: 0:unused 1: ASSERT, 2:not respond detect command, 3:simulate ep-full
1286 * @delay_time_ms: 0xffffffff means the simulate will delay for random time (0 ~0xffffffff ms)
1287 */
1288struct fw_hang_params {
1289 uint32_t type;
1290 uint32_t delay_time_ms;
1291};
1292
1293/**
1294 * struct pdev_utf_params - pdev utf command parameters
1295 * @utf_payload:
1296 * @len:
Govind Singh89727882016-04-15 13:58:27 +05301297 * @is_ar900b: is it 900b target
Govind Singh3ddda1f2016-03-09 11:34:12 +05301298 */
1299struct pdev_utf_params {
1300 uint8_t *utf_payload;
1301 uint32_t len;
Kiran Venkatappa9da7e042016-08-09 22:52:35 +05301302#ifndef CONFIG_MCL
Govind Singh89727882016-04-15 13:58:27 +05301303 bool is_ar900b;
1304#endif
Govind Singh3ddda1f2016-03-09 11:34:12 +05301305};
1306
Govind Singh89727882016-04-15 13:58:27 +05301307/*Adding this due to dependency on wmi_unified.h
1308 */
1309typedef struct {
1310 uint32_t len;
1311 uint32_t msgref;
1312 uint32_t segmentInfo;
1313} QVIT_SEG_HDR_INFO_STRUCT;
1314
1315struct pdev_qvit_params {
1316 uint8_t *utf_payload;
1317 uint32_t len;
1318};
Govind Singh3ddda1f2016-03-09 11:34:12 +05301319/**
1320 * struct crash_inject - crash inject command parameters
1321 * @type: crash inject type
1322 * @delay_time_ms: time in milliseconds for FW to delay the crash
1323 */
1324struct crash_inject {
1325 uint32_t type;
1326 uint32_t delay_time_ms;
1327};
1328
1329/**
1330 * struct dbglog_params - fw deboglog command parameters
1331 * @param: command parameter
1332 * @val: parameter value
1333 * @module_id_bitmap: fixed length module id bitmap
1334 * @bitmap_len: module id bitmap length
Govind Singh89727882016-04-15 13:58:27 +05301335 * @cfgvalid: cfgvalid
Govind Singh3ddda1f2016-03-09 11:34:12 +05301336 */
1337struct dbglog_params {
1338 uint32_t param;
1339 uint32_t val;
1340 uint32_t *module_id_bitmap;
1341 uint32_t bitmap_len;
Kiran Venkatappa9da7e042016-08-09 22:52:35 +05301342#ifndef CONFIG_MCL
Govind Singh89727882016-04-15 13:58:27 +05301343 uint32_t cfgvalid[2];
1344#endif
Govind Singh3ddda1f2016-03-09 11:34:12 +05301345};
1346
1347/**
1348 * struct seg_hdr_info - header info
1349 * @len: length
1350 * @msgref: message refrence
1351 * @segmentInfo: segment info
1352 * @pad: padding
1353 */
1354struct seg_hdr_info {
1355 uint32_t len;
1356 uint32_t msgref;
1357 uint32_t segmentInfo;
1358 uint32_t pad;
1359};
1360
1361/**
1362 * struct wmi_mgmt_params - wmi mgmt cmd paramters
1363 * @tx_frame: management tx frame
Govind Singh89727882016-04-15 13:58:27 +05301364 * @frm_len: frame length
Govind Singh3ddda1f2016-03-09 11:34:12 +05301365 * @vdev_id: vdev id
1366 * @tx_complete_cb: tx download callback handler
1367 * @tx_ota_post_proc_cb: OTA complition handler
1368 * @chanfreq: channel frequency
1369 * @pdata: frame data
1370 * @wmi_desc: command descriptor
Govind Singh89727882016-04-15 13:58:27 +05301371 * @desc_id: descriptor id relyaed back by target
1372 * @macaddr - macaddr of peer
Govind Singh3ddda1f2016-03-09 11:34:12 +05301373 */
1374struct wmi_mgmt_params {
1375 void *tx_frame;
1376 uint16_t frm_len;
1377 uint8_t vdev_id;
Govind Singh3ddda1f2016-03-09 11:34:12 +05301378 uint16_t chanfreq;
1379 void *pdata;
Govind Singh89727882016-04-15 13:58:27 +05301380 uint16_t desc_id;
1381 uint8_t *macaddr;
Govind Singhd7468a52016-03-09 14:32:57 +05301382 void *qdf_ctx;
Govind Singh3ddda1f2016-03-09 11:34:12 +05301383};
Govind Singhbffe4de2016-02-26 17:50:39 +05301384
1385/**
1386 * struct p2p_ps_params - P2P powersave related params
1387 * @opp_ps: opportunistic power save
1388 * @ctwindow: CT window
1389 * @count: count
1390 * @duration: duration
1391 * @interval: interval
1392 * @single_noa_duration: single shot noa duration
1393 * @ps_selection: power save selection
1394 * @session_id: session id
1395 */
1396struct p2p_ps_params {
1397 uint8_t opp_ps;
1398 uint32_t ctwindow;
1399 uint8_t count;
1400 uint32_t duration;
1401 uint32_t interval;
1402 uint32_t single_noa_duration;
1403 uint8_t ps_selection;
1404 uint8_t session_id;
1405};
1406
1407
1408/**
1409 * struct ta_uapsd_trig_params - uapsd trigger parameter
1410 * @vdevid: vdev id
1411 * @peer_addr: peer address
1412 * @auto_triggerparam: trigger parameters
1413 * @num_ac: no of access category
1414 */
1415struct sta_uapsd_trig_params {
1416 uint32_t vdevid;
1417 uint8_t peer_addr[IEEE80211_ADDR_LEN];
1418 uint8_t *auto_triggerparam;
1419 uint32_t num_ac;
1420};
Govind Singhe7b800c2016-03-01 15:30:53 +05301421
1422/**
1423 * struct ocb_utc_param
1424 * @vdev_id: session id
1425 * @utc_time: number of nanoseconds from Jan 1st 1958
1426 * @time_error: the error in the UTC time. All 1's for unknown
1427 */
1428struct ocb_utc_param {
1429 uint32_t vdev_id;
1430 uint8_t utc_time[WMI_SIZE_UTC_TIME];
1431 uint8_t time_error[WMI_SIZE_UTC_TIME_ERROR];
1432};
1433
1434/**
1435 * struct ocb_timing_advert_param
1436 * @vdev_id: session id
1437 * @chan_freq: frequency on which to advertise
1438 * @repeat_rate: the number of times it will send TA in 5 seconds
1439 * @timestamp_offset: offset of the timestamp field in the TA frame
1440 * @time_value_offset: offset of the time_value field in the TA frame
1441 * @template_length: size in bytes of the TA frame
1442 * @template_value: the TA frame
1443 */
1444struct ocb_timing_advert_param {
1445 uint32_t vdev_id;
1446 uint32_t chan_freq;
1447 uint32_t repeat_rate;
1448 uint32_t timestamp_offset;
1449 uint32_t time_value_offset;
1450 uint32_t template_length;
1451 uint8_t *template_value;
1452};
1453
1454/**
1455 * struct dcc_get_stats_param
1456 * @vdev_id: session id
1457 * @channel_count: number of dcc channels
1458 * @request_array_len: size in bytes of the request array
1459 * @request_array: the request array
1460 */
1461struct dcc_get_stats_param {
1462 uint32_t vdev_id;
1463 uint32_t channel_count;
1464 uint32_t request_array_len;
1465 void *request_array;
1466};
1467
1468/**
1469 * struct dcc_update_ndl_param
1470 * @vdev_id: session id
1471 * @channel_count: number of channels to be updated
1472 * @dcc_ndl_chan_list_len: size in bytes of the ndl_chan array
1473 * @dcc_ndl_chan_list: the ndl_chan array
1474 * @dcc_ndl_active_state_list_len: size in bytes of the active_state array
1475 * @dcc_ndl_active_state_list: the active state array
1476 */
1477struct dcc_update_ndl_param {
1478 uint32_t vdev_id;
1479 uint32_t channel_count;
1480 uint32_t dcc_ndl_chan_list_len;
1481 void *dcc_ndl_chan_list;
1482 uint32_t dcc_ndl_active_state_list_len;
1483 void *dcc_ndl_active_state_list;
1484};
1485
1486/**
1487 * struct ocb_config_sched
1488 * @chan_freq: frequency of the channel
1489 * @total_duration: duration of the schedule
1490 * @guard_interval: guard interval on the start of the schedule
1491 */
1492struct ocb_config_sched {
1493 uint32_t chan_freq;
1494 uint32_t total_duration;
1495 uint32_t guard_interval;
1496};
1497
1498/**
1499 * OCB structures
1500 */
1501
1502#define WMI_NUM_AC (4)
1503#define WMI_OCB_CHANNEL_MAX (5)
1504#define WMI_MAX_NUM_AC 4
1505struct wmi_ocb_qos_params {
1506 uint8_t aifsn;
1507 uint8_t cwmin;
1508 uint8_t cwmax;
1509};
1510/**
1511 * struct ocb_config_channel
1512 * @chan_freq: frequency of the channel
1513 * @bandwidth: bandwidth of the channel, either 10 or 20 MHz
1514 * @mac_address: MAC address assigned to this channel
1515 * @qos_params: QoS parameters
1516 * @max_pwr: maximum transmit power of the channel (dBm)
1517 * @min_pwr: minimum transmit power of the channel (dBm)
1518 * @reg_pwr: maximum transmit power specified by the regulatory domain (dBm)
1519 * @antenna_max: maximum antenna gain specified by the regulatory domain (dB)
1520 */
1521struct ocb_config_channel {
1522 uint32_t chan_freq;
1523 uint32_t bandwidth;
Govind Singhd7468a52016-03-09 14:32:57 +05301524 struct qdf_mac_addr mac_address;
Govind Singhe7b800c2016-03-01 15:30:53 +05301525 struct wmi_ocb_qos_params qos_params[WMI_MAX_NUM_AC];
1526 uint32_t max_pwr;
1527 uint32_t min_pwr;
1528 uint8_t reg_pwr;
1529 uint8_t antenna_max;
1530 uint16_t flags;
1531};
1532
1533/**
1534 * struct ocb_config_param
1535 * @session_id: session id
1536 * @channel_count: number of channels
1537 * @schedule_size: size of the channel schedule
1538 * @flags: reserved
1539 * @channels: array of OCB channels
1540 * @schedule: array of OCB schedule elements
1541 * @dcc_ndl_chan_list_len: size of the ndl_chan array
1542 * @dcc_ndl_chan_list: array of dcc channel info
1543 * @dcc_ndl_active_state_list_len: size of the active state array
1544 * @dcc_ndl_active_state_list: array of active states
1545 * @adapter: the OCB adapter
1546 * @dcc_stats_callback: callback for the response event
1547 */
1548struct ocb_config_param {
1549 uint8_t session_id;
1550 uint32_t channel_count;
1551 uint32_t schedule_size;
1552 uint32_t flags;
1553 struct ocb_config_channel *channels;
1554 struct ocb_config_sched *schedule;
1555 uint32_t dcc_ndl_chan_list_len;
1556 void *dcc_ndl_chan_list;
1557 uint32_t dcc_ndl_active_state_list_len;
1558 void *dcc_ndl_active_state_list;
1559};
Govind Singh9bad0002016-03-01 15:54:59 +05301560
Poddar, Siddarth794b9962016-04-28 15:49:11 +05301561enum wmi_peer_rate_report_cond_phy_type {
1562 WMI_PEER_RATE_REPORT_COND_11B = 0,
1563 WMI_PEER_RATE_REPORT_COND_11A_G,
1564 WMI_PEER_RATE_REPORT_COND_11N,
1565 WMI_PEER_RATE_REPORT_COND_11AC,
1566 WMI_PEER_RATE_REPORT_COND_MAX_NUM
1567};
1568
1569/**
1570 * struct report_rate_delta - peer specific parameters
1571 * @percent: percentage
1572 * @delta_min: rate min delta
1573 */
1574struct report_rate_delta {
Himanshu Agarwal56c292f2016-07-19 15:41:51 +05301575 uint32_t percent; /* in unit of 12.5% */
1576 uint32_t delta_min; /* in unit of Mbps */
Poddar, Siddarth794b9962016-04-28 15:49:11 +05301577};
1578
1579/**
1580 * struct report_rate_per_phy - per phy report parameters
1581 * @cond_flags: condition flag val
1582 * @delta: rate delta
1583 * @report_rate_threshold: rate threshold
1584 */
1585struct report_rate_per_phy {
1586 /*
1587 * PEER_RATE_REPORT_COND_FLAG_DELTA,
1588 * PEER_RATE_REPORT_COND_FLAG_THRESHOLD
1589 * Any of these two conditions or both of
1590 * them can be set.
1591 */
Himanshu Agarwal56c292f2016-07-19 15:41:51 +05301592 uint32_t cond_flags;
Poddar, Siddarth794b9962016-04-28 15:49:11 +05301593 struct report_rate_delta delta;
1594 /*
1595 * In unit of Mbps. There are at most 4 thresholds
1596 * If the threshold count is less than 4, set zero to
1597 * the one following the last threshold
1598 */
Himanshu Agarwal56c292f2016-07-19 15:41:51 +05301599 uint32_t report_rate_threshold[WMI_MAX_NUM_OF_RATE_THRESH];
Poddar, Siddarth794b9962016-04-28 15:49:11 +05301600};
1601
1602/**
1603 * struct peer_rate_report_params - peer rate report parameters
1604 * @rate_report_enable: enable rate report param
1605 * @backoff_time: backoff time
1606 * @timer_period: timer
1607 * @report_per_phy: report per phy type
1608 */
1609struct wmi_peer_rate_report_params {
Himanshu Agarwal56c292f2016-07-19 15:41:51 +05301610 uint32_t rate_report_enable;
1611 uint32_t backoff_time; /* in unit of msecond */
1612 uint32_t timer_period; /* in unit of msecond */
Poddar, Siddarth794b9962016-04-28 15:49:11 +05301613 /*
1614 *In the following field, the array index means the phy type,
1615 * please see enum wmi_peer_rate_report_cond_phy_type for detail
1616 */
1617 struct report_rate_per_phy report_per_phy[
1618 WMI_PEER_RATE_REPORT_COND_MAX_NUM];
1619
1620};
1621
Govind Singh9bad0002016-03-01 15:54:59 +05301622/**
1623 * struct t_thermal_cmd_params - thermal command parameters
1624 * @min_temp: minimum temprature
1625 * @max_temp: maximum temprature
1626 * @thermal_enable: thermal enable
1627 */
1628struct thermal_cmd_params {
1629 uint16_t min_temp;
1630 uint16_t max_temp;
1631 uint8_t thermal_enable;
1632};
1633
1634#define WMI_LRO_IPV4_SEED_ARR_SZ 5
1635#define WMI_LRO_IPV6_SEED_ARR_SZ 11
1636
1637/**
1638 * struct wmi_lro_config_cmd_t - set LRO init parameters
1639 * @lro_enable: indicates whether lro is enabled
1640 * @tcp_flag: If the TCP flags from the packet do not match
1641 * the values in this field after masking with TCP flags mask
1642 * below, packet is not LRO eligible
1643 * @tcp_flag_mask: field for comparing the TCP values provided
1644 * above with the TCP flags field in the received packet
1645 * @toeplitz_hash_ipv4: contains seed needed to compute the flow id
1646 * 5-tuple toeplitz hash for ipv4 packets
1647 * @toeplitz_hash_ipv6: contains seed needed to compute the flow id
1648 * 5-tuple toeplitz hash for ipv6 packets
1649 */
1650struct wmi_lro_config_cmd_t {
1651 uint32_t lro_enable;
1652 uint32_t tcp_flag:9,
1653 tcp_flag_mask:9;
1654 uint32_t toeplitz_hash_ipv4[WMI_LRO_IPV4_SEED_ARR_SZ];
1655 uint32_t toeplitz_hash_ipv6[WMI_LRO_IPV6_SEED_ARR_SZ];
1656};
Govind Singhae855362016-03-07 14:24:22 +05301657
1658/**
1659 * struct gtx_config_t - GTX config
1660 * @gtx_rt_mask: for HT and VHT rate masks
1661 * @gtx_usrcfg: host request for GTX mask
1662 * @gtx_threshold: PER Threshold (default: 10%)
1663 * @gtx_margin: PER margin (default: 2%)
1664 * @gtx_tcpstep: TCP step (default: 1)
1665 * @gtx_tpcMin: TCP min (default: 5)
1666 * @gtx_bwmask: BW mask (20/40/80/160 Mhz)
1667 */
1668struct wmi_gtx_config {
1669 uint32_t gtx_rt_mask[2];
1670 uint32_t gtx_usrcfg;
1671 uint32_t gtx_threshold;
1672 uint32_t gtx_margin;
1673 uint32_t gtx_tpcstep;
1674 uint32_t gtx_tpcmin;
1675 uint32_t gtx_bwmask;
1676};
1677
1678/**
1679 * struct wmi_probe_resp_params - send probe response parameters
1680 * @bssId: BSSID
1681 * @pProbeRespTemplate: probe response template
1682 * @probeRespTemplateLen: probe response template length
1683 * @ucProxyProbeReqValidIEBmap: valid IE bitmap
1684 */
1685struct wmi_probe_resp_params {
Govind Singh8675b862016-03-28 22:09:18 +05301686 uint8_t bssId[IEEE80211_ADDR_LEN];
Govind Singhae855362016-03-07 14:24:22 +05301687 uint8_t *pProbeRespTemplate;
1688 uint32_t probeRespTemplateLen;
1689 uint32_t ucProxyProbeReqValidIEBmap[8];
1690};
1691
Himanshu Agarwal9efd9bf2016-03-09 18:49:18 +05301692/* struct set_key_params: structure containing
1693 * installation key parameters
1694 * @vdev_id: vdev id
1695 * @key_len: key length
1696 * @key_idx: key index
1697 * @peer_mac: peer mac address
1698 * @key_flags: key flags, 0:pairwise key, 1:group key, 2:static key
1699 * @key_cipher: key cipher based on security mode
1700 * @key_txmic_len: tx mic length
1701 * @key_rxmic_len: rx mic length
Gurumoorthi Gnanasambandhan0d283282017-01-10 20:51:02 +05301702 * @key_tsc_counter: key tx sc counter
1703 * @key_rsc_counter: key rx sc counter
Himanshu Agarwal9efd9bf2016-03-09 18:49:18 +05301704 * @rx_iv: receive IV, applicable only in case of WAPI
1705 * @tx_iv: transmit IV, applicable only in case of WAPI
1706 * @key_data: key data
1707 */
1708struct set_key_params {
1709 uint8_t vdev_id;
1710 uint16_t key_len;
1711 uint32_t key_idx;
1712 uint8_t peer_mac[IEEE80211_ADDR_LEN];
1713 uint32_t key_flags;
1714 uint32_t key_cipher;
1715 uint32_t key_txmic_len;
1716 uint32_t key_rxmic_len;
Gurumoorthi Gnanasambandhan0d283282017-01-10 20:51:02 +05301717 uint64_t key_tsc_counter;
1718 uint64_t *key_rsc_counter;
1719#if defined(ATH_SUPPORT_WAPI) || defined(FEATURE_WLAN_WAPI)
Himanshu Agarwal9efd9bf2016-03-09 18:49:18 +05301720 uint8_t rx_iv[16];
1721 uint8_t tx_iv[16];
1722#endif
1723 uint8_t key_data[WMI_MAC_MAX_KEY_LENGTH];
1724};
1725
Govind Singhae855362016-03-07 14:24:22 +05301726/**
1727 * struct sta_params - sta keep alive parameters
1728 * @vdev_id: vdev id
1729 * @method: keep alive method
1730 * @timeperiod: time to keep alive
1731 * @hostv4addr: host ipv4 address
1732 * @destv4addr: destination ipv4 address
1733 * @destmac: destination mac address
1734 */
1735struct sta_params {
1736 uint8_t vdev_id;
1737 uint32_t method;
1738 uint32_t timeperiod;
1739 uint8_t *hostv4addr;
1740 uint8_t *destv4addr;
1741 uint8_t *destmac;
1742};
1743
1744/**
1745 * struct gateway_update_req_param - gateway parameter update request
1746 * @request_id: request id
1747 * @session_id: session id
1748 * @max_retries: Max ARP/NS retry attempts
1749 * @timeout: Retry interval
1750 * @ipv4_addr_type: on ipv4 network
1751 * @ipv6_addr_type: on ipv6 network
1752 * @gw_mac_addr: gateway mac addr
1753 * @ipv4_addr: ipv4 addr
1754 * @ipv6_addr: ipv6 addr
1755 */
1756struct gateway_update_req_param {
1757 uint32_t request_id;
1758 uint32_t session_id;
1759 uint32_t max_retries;
1760 uint32_t timeout;
1761 uint32_t ipv4_addr_type;
1762 uint32_t ipv6_addr_type;
Govind Singhd7468a52016-03-09 14:32:57 +05301763 struct qdf_mac_addr gw_mac_addr;
1764 uint8_t ipv4_addr[QDF_IPV4_ADDR_SIZE];
1765 uint8_t ipv6_addr[QDF_IPV6_ADDR_SIZE];
Govind Singhae855362016-03-07 14:24:22 +05301766};
1767
1768/**
1769 * struct rssi_monitor_param - rssi monitoring
1770 * @request_id: request id
1771 * @session_id: session id
1772 * @min_rssi: minimum rssi
1773 * @max_rssi: maximum rssi
1774 * @control: flag to indicate start or stop
1775 */
1776struct rssi_monitor_param {
1777 uint32_t request_id;
1778 uint32_t session_id;
1779 int8_t min_rssi;
1780 int8_t max_rssi;
1781 bool control;
1782};
1783
1784/**
1785 * struct scan_mac_oui - oui paramters
1786 * @oui: oui parameters
1787 */
1788struct scan_mac_oui {
1789 uint8_t oui[WMI_WIFI_SCANNING_MAC_OUI_LENGTH];
1790};
1791
1792#define WMI_PASSPOINT_REALM_LEN 256
1793#define WMI_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM 16
1794#define WMI_PASSPOINT_PLMN_LEN 3
1795/**
1796 * struct wifi_passpoint_network_param - passpoint network block
1797 * @id: identifier of this network block
1798 * @realm: null terminated UTF8 encoded realm, 0 if unspecified
1799 * @roaming_consortium_ids: roaming consortium ids to match, 0s if unspecified
1800 * @plmn: mcc/mnc combination as per rules, 0s if unspecified
1801 */
1802struct wifi_passpoint_network_param {
1803 uint32_t id;
1804 uint8_t realm[WMI_PASSPOINT_REALM_LEN];
1805 int64_t roaming_consortium_ids[WMI_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM];
1806 uint8_t plmn[WMI_PASSPOINT_PLMN_LEN];
1807};
1808
1809/**
1810 * struct wifi_passpoint_req_param - passpoint request
1811 * @request_id: request identifier
1812 * @num_networks: number of networks
1813 * @networks: passpoint networks
1814 */
1815struct wifi_passpoint_req_param {
1816 uint32_t request_id;
1817 uint32_t session_id;
1818 uint32_t num_networks;
1819 struct wifi_passpoint_network_param networks[];
1820};
1821
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05301822/* struct mobility_domain_info - structure containing
1823 * mobility domain info
1824 * @mdie_present: mobility domain present or not
1825 * @mobility_domain: mobility domain
1826 */
1827struct mobility_domain_info {
1828 uint8_t mdie_present;
1829 uint16_t mobility_domain;
1830};
1831
Himanshu Agarwal56c292f2016-07-19 15:41:51 +05301832#define WMI_HOST_ROAM_OFFLOAD_NUM_MCS_SET (16)
1833
1834/* This TLV will be filled only in case roam offload
1835 * for wpa2-psk/okc/ese/11r is enabled */
1836typedef struct {
1837 /*
1838 * TLV tag and len; tag equals
1839 * WMITLV_TAG_STRUC_wmi_roam_offload_fixed_param
1840 */
1841 uint32_t tlv_header;
1842 uint32_t rssi_cat_gap; /* gap for every category bucket */
1843 uint32_t prefer_5g; /* prefer select 5G candidate */
1844 uint32_t select_5g_margin;
1845 uint32_t reassoc_failure_timeout; /* reassoc failure timeout */
1846 uint32_t capability;
1847 uint32_t ht_caps_info;
1848 uint32_t ampdu_param;
1849 uint32_t ht_ext_cap;
1850 uint32_t ht_txbf;
1851 uint32_t asel_cap;
1852 uint32_t qos_enabled;
1853 uint32_t qos_caps;
1854 uint32_t wmm_caps;
1855 /* since this is 4 byte aligned, we don't declare it as tlv array */
1856 uint32_t mcsset[WMI_HOST_ROAM_OFFLOAD_NUM_MCS_SET >> 2];
1857} roam_offload_param;
1858
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05301859/* struct roam_offload_scan_params - structure
1860 * containing roaming offload scan parameters
1861 * @is_roam_req_valid: flag to tell whether roam req
1862 * is valid or NULL
1863 * @mode: stores flags for scan
1864 * @vdev_id: vdev id
1865 * @roam_offload_enabled: flag for offload enable
1866 * @psk_pmk: pre shared key/pairwise master key
1867 * @pmk_len: length of PMK
1868 * @prefer_5ghz: prefer select 5G candidate
1869 * @roam_rssi_cat_gap: gap for every category bucket
1870 * @select_5ghz_margin: select 5 Ghz margin
1871 * @krk: KRK
1872 * @btk: BTK
1873 * @reassoc_failure_timeout: reassoc failure timeout
1874 * @rokh_id_length: r0kh id length
1875 * @rokh_id: r0kh id
1876 * @roam_key_mgmt_offload_enabled: roam offload flag
1877 * @auth_mode: authentication mode
Deepak Dhamdhere3ae33a32016-08-22 18:04:00 -07001878 * @okc_enabled: enable opportunistic key caching
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05301879 * @is_ese_assoc: flag to determine ese assoc
1880 * @mdid: mobility domain info
1881 * @roam_offload_params: roam offload tlv params
1882 */
1883struct roam_offload_scan_params {
1884 uint8_t is_roam_req_valid;
1885 uint32_t mode;
1886 uint32_t vdev_id;
1887#ifdef WLAN_FEATURE_ROAM_OFFLOAD
1888 uint8_t roam_offload_enabled;
1889 uint8_t psk_pmk[WMI_ROAM_SCAN_PSK_SIZE];
1890 uint32_t pmk_len;
1891 uint8_t prefer_5ghz;
1892 uint8_t roam_rssi_cat_gap;
1893 uint8_t select_5ghz_margin;
1894 uint8_t krk[WMI_KRK_KEY_LEN];
1895 uint8_t btk[WMI_BTK_KEY_LEN];
1896 uint32_t reassoc_failure_timeout;
1897 uint32_t rokh_id_length;
1898 uint8_t rokh_id[WMI_ROAM_R0KH_ID_MAX_LEN];
1899 uint8_t roam_key_mgmt_offload_enabled;
1900 int auth_mode;
Deepak Dhamdhere3ae33a32016-08-22 18:04:00 -07001901 bool okc_enabled;
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05301902#endif
1903 bool is_ese_assoc;
1904 struct mobility_domain_info mdid;
Kiran Venkatappa9da7e042016-08-09 22:52:35 +05301905#ifdef CONFIG_MCL
Govind Singh89727882016-04-15 13:58:27 +05301906 /* THis is not available in non tlv target.
1907 * please remove this and replace with a host based
1908 * structure */
Himanshu Agarwal56c292f2016-07-19 15:41:51 +05301909 roam_offload_param roam_offload_params;
Govind Singh89727882016-04-15 13:58:27 +05301910#endif
Selvaraj, Sridhar0a1427f2016-07-04 21:40:23 +05301911 uint32_t assoc_ie_length;
1912 uint8_t assoc_ie[MAX_ASSOC_IE_LENGTH];
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05301913};
1914
1915/* struct roam_offload_scan_rssi_params - structure containing
1916 * parameters for roam offload scan based on RSSI
1917 * @rssi_thresh: rssi threshold
1918 * @rssi_thresh_diff: difference in rssi threshold
1919 * @hi_rssi_scan_max_count: 5G scan max count
1920 * @hi_rssi_scan_rssi_delta: 5G scan rssi change threshold value
1921 * @hi_rssi_scan_rssi_ub: 5G scan upper bound
1922 * @raise_rssi_thresh_5g: flag to determine penalty and boost thresholds
1923 * @session_id: vdev id
1924 * @penalty_threshold_5g: RSSI threshold below which 5GHz RSSI is penalized
1925 * @boost_threshold_5g: RSSI threshold above which 5GHz RSSI is favored
1926 * @raise_factor_5g: factor by which 5GHz RSSI is boosted
1927 * @drop_factor_5g: factor by which 5GHz RSSI is penalized
1928 * @max_raise_rssi_5g: maximum boost that can be applied to a 5GHz RSSI
1929 * @max_drop_rssi_5g: maximum penalty that can be applied to a 5GHz RSSI
1930 * @good_rssi_threshold: RSSI below which roam is kicked in by background
1931 * scan although rssi is still good
1932 * @roam_earlystop_thres_min: Minimum RSSI threshold value for early stop,
1933 * unit is dB above NF
1934 * @roam_earlystop_thres_max: Maximum RSSI threshold value for early stop,
1935 * unit is dB above NF
Gupta, Kapil1f4a4c32016-04-12 15:02:00 +05301936 * @dense_rssi_thresh_offset: dense roam RSSI threshold difference
1937 * @dense_min_aps_cnt: dense roam minimum APs
1938 * @initial_dense_status: dense status detected by host
1939 * @traffic_threshold: dense roam RSSI threshold
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05301940 */
1941struct roam_offload_scan_rssi_params {
1942 int8_t rssi_thresh;
1943 uint8_t rssi_thresh_diff;
1944 uint32_t hi_rssi_scan_max_count;
1945 uint32_t hi_rssi_scan_rssi_delta;
1946 int32_t hi_rssi_scan_rssi_ub;
1947 int raise_rssi_thresh_5g;
1948 uint8_t session_id;
1949 uint32_t penalty_threshold_5g;
1950 uint32_t boost_threshold_5g;
1951 uint8_t raise_factor_5g;
1952 uint8_t drop_factor_5g;
1953 int max_raise_rssi_5g;
1954 int max_drop_rssi_5g;
1955 uint32_t good_rssi_threshold;
1956 uint32_t roam_earlystop_thres_min;
1957 uint32_t roam_earlystop_thres_max;
Gupta, Kapil1f4a4c32016-04-12 15:02:00 +05301958 int dense_rssi_thresh_offset;
1959 int dense_min_aps_cnt;
1960 int initial_dense_status;
1961 int traffic_threshold;
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05301962};
1963
Govind Singhae855362016-03-07 14:24:22 +05301964/**
1965 * struct wifi_epno_network - enhanced pno network block
1966 * @ssid: ssid
1967 * @rssi_threshold: threshold for considering this SSID as found, required
1968 * granularity for this threshold is 4dBm to 8dBm
1969 * @flags: WIFI_PNO_FLAG_XXX
1970 * @auth_bit_field: auth bit field for matching WPA IE
1971 */
1972struct wifi_epno_network_params {
1973 struct mac_ssid ssid;
1974 int8_t rssi_threshold;
1975 uint8_t flags;
1976 uint8_t auth_bit_field;
1977};
1978
1979/**
1980 * struct wifi_enhanched_pno_params - enhanced pno network params
Mukul Sharma90bc73b2016-10-03 15:04:20 +05301981 * @request_id: request id number
1982 * @session_id: session_id number
1983 * @min_5ghz_rssi: minimum 5GHz RSSI for a BSSID to be considered
1984 * @min_24ghz_rssi: minimum 2.4GHz RSSI for a BSSID to be considered
1985 * @initial_score_max: maximum score that a network can have before bonuses
1986 * @current_connection_bonus: only report when there is a network's score this
1987 * much higher than the current connection
1988 * @same_network_bonus: score bonus for all n/w with the same network flag
1989 * @secure_bonus: score bonus for networks that are not open
1990 * @band_5ghz_bonus: 5GHz RSSI score bonus (applied to all 5GHz networks)
Govind Singhae855362016-03-07 14:24:22 +05301991 * @num_networks: number of ssids
Mukul Sharma90bc73b2016-10-03 15:04:20 +05301992 * @networks: EPNO networks
Govind Singhae855362016-03-07 14:24:22 +05301993 */
1994struct wifi_enhanched_pno_params {
1995 uint32_t request_id;
1996 uint32_t session_id;
Mukul Sharma90bc73b2016-10-03 15:04:20 +05301997 uint32_t min_5ghz_rssi;
1998 uint32_t min_24ghz_rssi;
1999 uint32_t initial_score_max;
2000 uint32_t current_connection_bonus;
2001 uint32_t same_network_bonus;
2002 uint32_t secure_bonus;
2003 uint32_t band_5ghz_bonus;
Govind Singhae855362016-03-07 14:24:22 +05302004 uint32_t num_networks;
2005 struct wifi_epno_network_params networks[];
2006};
2007
2008enum {
2009 WMI_AP_RX_DATA_OFFLOAD = 0x00,
2010 WMI_STA_RX_DATA_OFFLOAD = 0x01,
2011};
2012
2013/**
Govind Singhc7cd2d62016-06-21 14:33:26 +05302014 * enum extscan_configuration_flags - extscan config flags
2015 * @WMI_EXTSCAN_LP_EXTENDED_BATCHING: extended batching
2016 */
2017enum wmi_extscan_configuration_flags {
2018 WMI_EXTSCAN_LP_EXTENDED_BATCHING = 0x00000001,
2019};
2020
2021/**
Govind Singhae855362016-03-07 14:24:22 +05302022 * enum extscan_report_events_type - extscan report events type
2023 * @EXTSCAN_REPORT_EVENTS_BUFFER_FULL: report only when scan history is % full
2024 * @EXTSCAN_REPORT_EVENTS_EACH_SCAN: report a scan completion event after scan
2025 * @EXTSCAN_REPORT_EVENTS_FULL_RESULTS: forward scan results
2026 * (beacons/probe responses + IEs)
2027 * in real time to HAL, in addition to completion events.
2028 * Note: To keep backward compatibility,
2029 * fire completion events regardless of REPORT_EVENTS_EACH_SCAN.
2030 * @EXTSCAN_REPORT_EVENTS_NO_BATCH: controls batching,
2031 * 0 => batching, 1 => no batching
2032 */
2033enum wmi_extscan_report_events_type {
2034 WMI_EXTSCAN_REPORT_EVENTS_BUFFER_FULL = 0x00,
2035 WMI_EXTSCAN_REPORT_EVENTS_EACH_SCAN = 0x01,
2036 WMI_EXTSCAN_REPORT_EVENTS_FULL_RESULTS = 0x02,
2037 WMI_EXTSCAN_REPORT_EVENTS_NO_BATCH = 0x04,
2038};
2039
2040/**
2041 * struct ipa_offload_control_params - ipa offload parameters
2042 * @offload_type: ipa offload type
2043 * @vdev_id: vdev id
2044 * @enable: ipa offload enable/disable
2045 */
2046struct ipa_offload_control_params {
2047 uint32_t offload_type;
2048 uint32_t vdev_id;
2049 uint32_t enable;
2050};
2051
2052/**
2053 * struct extscan_capabilities_params - ext scan capablities
2054 * @request_id: request_id
2055 * @session_id: session_id
2056 */
2057struct extscan_capabilities_params {
2058 uint32_t request_id;
2059 uint8_t session_id;
2060};
2061
2062/**
2063 * struct extscan_capabilities_reset_params - ext scan capablities reset parameter
2064 * @request_id: request_id
2065 * @session_id: session_id
2066 */
2067struct extscan_capabilities_reset_params {
2068 uint32_t request_id;
2069 uint8_t session_id;
2070};
2071
2072/**
2073 * struct extscan_bssid_hotlist_reset_params - ext scan hotlist reset parameter
2074 * @request_id: request_id
2075 * @session_id: session_id
2076 */
2077struct extscan_bssid_hotlist_reset_params {
2078 uint32_t request_id;
2079 uint8_t session_id;
2080};
2081
2082/**
2083 * struct extscan_stop_req_params - ext scan stop parameter
2084 * @request_id: request_id
2085 * @session_id: session_id
2086 */
2087struct extscan_stop_req_params {
2088 uint32_t request_id;
2089 uint8_t session_id;
2090};
2091
2092/**
2093 * struct ap_threshold_params - ap threshold parameter
2094 * @bssid: mac address
2095 * @low: low threshold
2096 * @high: high threshold
2097 */
2098struct ap_threshold_params {
Govind Singhd7468a52016-03-09 14:32:57 +05302099 struct qdf_mac_addr bssid;
Govind Singhae855362016-03-07 14:24:22 +05302100 int32_t low;
2101 int32_t high;
2102};
2103
2104/**
2105 * struct extscan_set_sig_changereq_params - ext scan channel parameter
2106 * @request_id: mac address
2107 * @session_id: low threshold
2108 * @rssi_sample_size: Number of samples for averaging RSSI
2109 * @lostap_sample_size: Number of missed samples to confirm AP loss
2110 * @min_breaching: Number of APs breaching threshold required for firmware
2111 * @num_ap: no of scanned ap
2112 * @ap: ap threshold parameter
2113 */
2114struct extscan_set_sig_changereq_params {
2115 uint32_t request_id;
2116 uint8_t session_id;
2117 uint32_t rssi_sample_size;
2118 uint32_t lostap_sample_size;
2119 uint32_t min_breaching;
2120 uint32_t num_ap;
2121 struct ap_threshold_params ap[WMI_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS];
2122};
2123
2124/**
2125 * struct extscan_cached_result_params - ext scan cached parameter
2126 * @request_id: mac address
2127 * @session_id: low threshold
2128 * @flush: cached results flush
2129 */
2130struct extscan_cached_result_params {
2131 uint32_t request_id;
2132 uint8_t session_id;
2133 bool flush;
2134};
2135
Govind Singhae855362016-03-07 14:24:22 +05302136/* Set PNO */
2137#define WMI_PNO_MAX_NETW_CHANNELS 26
2138#define WMI_PNO_MAX_NETW_CHANNELS_EX 60
2139#define WMI_PNO_MAX_SUPP_NETWORKS 16
2140
2141/*
2142 * size based of dot11 declaration without extra IEs as we will not carry those
2143 * for PNO
2144 */
2145#define WMI_PNO_MAX_PB_REQ_SIZE 450
2146
2147#define WMI_PNO_24G_DEFAULT_CH 1
2148#define WMI_PNO_5G_DEFAULT_CH 36
2149
2150/**
2151 * enum pno_mode - pno mode types
2152 * @WMI_PNO_MODE_IMMEDIATE: immidiate mode
2153 * @WMI_PNO_MODE_ON_SUSPEND: suspend on mode
2154 * @WMI_PNO_MODE_ON_RESUME: resume on mode
2155 * @WMI_PNO_MODE_MAX: max range
2156 */
2157enum pno_mode {
2158 WMI_PNO_MODE_IMMEDIATE,
2159 WMI_PNO_MODE_ON_SUSPEND,
2160 WMI_PNO_MODE_ON_RESUME,
2161 WMI_PNO_MODE_MAX
2162};
2163
2164/**
2165 * struct pno_nw_type - pno nw type
2166 * @ssid: mac ssid
2167 * @authentication: authentication type
2168 * @encryption: encryption type
2169 * @bcastNetwType: broadcast nw type
2170 * @ucChannelCount: uc channel count
2171 * @aChannels: pno channel
2172 * @rssiThreshold: rssi threshold
2173 */
2174struct pno_nw_type {
2175 struct mac_ssid ssid;
2176 uint32_t authentication;
2177 uint32_t encryption;
2178 uint32_t bcastNetwType;
2179 uint8_t ucChannelCount;
2180 uint8_t aChannels[WMI_PNO_MAX_NETW_CHANNELS_EX];
2181 int32_t rssiThreshold;
2182};
2183
2184/**
2185 * struct pno_scan_req_params - PNO Scan request structure
2186 * @enable: flag to enable or disable
2187 * @modePNO: PNO Mode
2188 * @ucNetworksCount: Number of networks
2189 * @aNetworks: Preferred network list
2190 * @sessionId: Session identifier
2191 * @fast_scan_period: Fast Scan period
2192 * @slow_scan_period: Slow scan period
2193 * @fast_scan_max_cycles: Fast scan max cycles
2194 * @us24GProbeTemplateLen: 2.4G probe template length
2195 * @p24GProbeTemplate: 2.4G probe template
2196 * @us5GProbeTemplateLen: 5G probe template length
2197 * @p5GProbeTemplate: 5G probe template
Gupta, Kapil7b768002016-04-25 19:14:19 +05302198 * @pno_channel_prediction: PNO channel prediction feature status
2199 * @top_k_num_of_channels: top K number of channels are used for tanimoto
2200 * distance calculation.
2201 * @stationary_thresh: threshold value to determine that the STA is stationary.
2202 * @pnoscan_adaptive_dwell_mode: adaptive dwelltime mode for pno scan
2203 * @channel_prediction_full_scan: periodic timer upon which a full scan needs
2204 * to be triggered.
Govind Singhae855362016-03-07 14:24:22 +05302205 */
2206struct pno_scan_req_params {
2207 uint8_t enable;
2208 enum pno_mode modePNO;
2209 uint8_t ucNetworksCount;
2210 struct pno_nw_type aNetworks[WMI_PNO_MAX_SUPP_NETWORKS];
2211 uint8_t sessionId;
2212 uint32_t fast_scan_period;
2213 uint32_t slow_scan_period;
2214 uint8_t fast_scan_max_cycles;
2215 uint32_t active_min_time;
2216 uint32_t active_max_time;
2217 uint32_t passive_min_time;
2218 uint32_t passive_max_time;
2219 uint16_t us24GProbeTemplateLen;
2220 uint8_t p24GProbeTemplate[WMI_PNO_MAX_PB_REQ_SIZE];
2221 uint16_t us5GProbeTemplateLen;
2222 uint8_t p5GProbeTemplate[WMI_PNO_MAX_PB_REQ_SIZE];
2223#ifdef FEATURE_WLAN_SCAN_PNO
2224 bool pno_channel_prediction;
2225 uint8_t top_k_num_of_channels;
2226 uint8_t stationary_thresh;
Gupta, Kapil7b768002016-04-25 19:14:19 +05302227 enum wmi_dwelltime_adaptive_mode pnoscan_adaptive_dwell_mode;
Govind Singhae855362016-03-07 14:24:22 +05302228 uint32_t channel_prediction_full_scan;
2229#endif
2230};
2231
Govind Singhae855362016-03-07 14:24:22 +05302232
2233#define WMI_WLAN_EXTSCAN_MAX_CHANNELS 36
2234#define WMI_WLAN_EXTSCAN_MAX_BUCKETS 16
2235#define WMI_WLAN_EXTSCAN_MAX_HOTLIST_APS 128
2236#define WMI_WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS 64
2237#define WMI_EXTSCAN_MAX_HOTLIST_SSIDS 8
2238
2239/**
2240 * struct wifi_scan_channelspec_params - wifi scan channel parameter
2241 * @channel: Frequency in MHz
2242 * @dwellTimeMs: dwell time
2243 * @flush: cached results flush
2244 * @passive: passive scan
2245 * @chnlClass: channel class
2246 */
2247struct wifi_scan_channelspec_params {
2248 uint32_t channel;
2249 uint32_t dwellTimeMs;
2250 bool passive;
2251 uint8_t chnlClass;
2252};
2253
2254/**
2255 * enum wmi_wifi_band - wifi band
2256 * @WMI_WIFI_BAND_UNSPECIFIED: unspecified band
2257 * @WMI_WIFI_BAND_BG: 2.4 GHz
2258 * @WMI_WIFI_BAND_A: 5 GHz without DFS
2259 * @WMI_WIFI_BAND_ABG: 2.4 GHz + 5 GHz; no DFS
2260 * @WMI_WIFI_BAND_A_DFS_ONLY: 5 GHz DFS only
2261 * @WMI_WIFI_BAND_A_WITH_DFS: 5 GHz with DFS
2262 * @WMI_WIFI_BAND_ABG_WITH_DFS: 2.4 GHz + 5 GHz with DFS
2263 * @WMI_WIFI_BAND_MAX: max range
2264 */
2265enum wmi_wifi_band {
2266 WMI_WIFI_BAND_UNSPECIFIED,
2267 WMI_WIFI_BAND_BG = 1,
2268 WMI_WIFI_BAND_A = 2,
2269 WMI_WIFI_BAND_ABG = 3,
2270 WMI_WIFI_BAND_A_DFS_ONLY = 4,
2271 /* 5 is reserved */
2272 WMI_WIFI_BAND_A_WITH_DFS = 6,
2273 WMI_WIFI_BAND_ABG_WITH_DFS = 7,
2274 /* Keep it last */
2275 WMI_WIFI_BAND_MAX
2276};
2277
2278/**
2279 * struct wifi_scan_bucket_params - wifi scan bucket spec
2280 * @bucket: bucket identifier
2281 * @band: wifi band
2282 * @period: Desired period, in millisecond; if this is too
2283 * low, the firmware should choose to generate results as fast as
2284 * it can instead of failing the command byte
2285 * for exponential backoff bucket this is the min_period
2286 * @reportEvents: 0 => normal reporting (reporting rssi history
2287 * only, when rssi history buffer is % full)
2288 * 1 => same as 0 + report a scan completion event after scanning
2289 * this bucket
2290 * 2 => same as 1 + forward scan results
2291 * (beacons/probe responses + IEs) in real time to HAL
2292 * @max_period: if max_period is non zero or different than period,
2293 * then this bucket is an exponential backoff bucket and
2294 * the scan period will grow exponentially as per formula:
2295 * actual_period(N) = period ^ (N/(step_count+1)) to a
2296 * maximum period of max_period
2297 * @exponent: for exponential back off bucket: multiplier:
2298 * new_period = old_period * exponent
2299 * @step_count: for exponential back off bucket, number of scans performed
2300 * at a given period and until the exponent is applied
2301 * @numChannels: channels to scan; these may include DFS channels
2302 * Note that a given channel may appear in multiple buckets
2303 * @min_dwell_time_active: per bucket minimum active dwell time
2304 * @max_dwell_time_active: per bucket maximum active dwell time
2305 * @min_dwell_time_passive: per bucket minimum passive dwell time
2306 * @max_dwell_time_passive: per bucket maximum passive dwell time
2307 * @channels: Channel list
2308 */
2309struct wifi_scan_bucket_params {
2310 uint8_t bucket;
2311 enum wmi_wifi_band band;
2312 uint32_t period;
2313 uint32_t reportEvents;
2314 uint32_t max_period;
2315 uint32_t exponent;
2316 uint32_t step_count;
2317 uint32_t numChannels;
2318 uint32_t min_dwell_time_active;
2319 uint32_t max_dwell_time_active;
2320 uint32_t min_dwell_time_passive;
2321 uint32_t max_dwell_time_passive;
2322 struct wifi_scan_channelspec_params channels[WMI_WLAN_EXTSCAN_MAX_CHANNELS];
2323};
2324
2325/**
2326 * struct wifi_scan_cmd_req_params - wifi scan command request params
2327 * @basePeriod: base timer period
2328 * @maxAPperScan: max ap per scan
2329 * @report_threshold_percent: report threshold
2330 * in %, when buffer is this much full, wake up host
2331 * @report_threshold_num_scans: report threshold number of scans
2332 * in number of scans, wake up host after these many scans
2333 * @requestId: request id
2334 * @sessionId: session id
2335 * @numBuckets: number of buckets
2336 * @min_dwell_time_active: per bucket minimum active dwell time
2337 * @max_dwell_time_active: per bucket maximum active dwell time
2338 * @min_dwell_time_passive: per bucket minimum passive dwell time
2339 * @max_dwell_time_passive: per bucket maximum passive dwell time
2340 * @configuration_flags: configuration flags
Gupta, Kapil7b768002016-04-25 19:14:19 +05302341 * @extscan_adaptive_dwell_mode: adaptive dwelltime mode for extscan
Govind Singhae855362016-03-07 14:24:22 +05302342 * @buckets: buckets array
2343 */
2344struct wifi_scan_cmd_req_params {
2345 uint32_t basePeriod;
2346 uint32_t maxAPperScan;
2347
2348 uint32_t report_threshold_percent;
2349 uint32_t report_threshold_num_scans;
2350
2351 uint32_t requestId;
2352 uint8_t sessionId;
2353 uint32_t numBuckets;
2354
2355 uint32_t min_dwell_time_active;
2356 uint32_t max_dwell_time_active;
2357 uint32_t min_dwell_time_passive;
2358 uint32_t max_dwell_time_passive;
2359 uint32_t configuration_flags;
Gupta, Kapil7b768002016-04-25 19:14:19 +05302360 enum wmi_dwelltime_adaptive_mode extscan_adaptive_dwell_mode;
Govind Singhae855362016-03-07 14:24:22 +05302361 struct wifi_scan_bucket_params buckets[WMI_WLAN_EXTSCAN_MAX_BUCKETS];
2362};
2363
Govind Singhae855362016-03-07 14:24:22 +05302364#define WMI_CFG_VALID_CHANNEL_LIST_LEN 100
Govind Singhc7cd2d62016-06-21 14:33:26 +05302365/* Occupied channel list remains static */
2366#define WMI_CHANNEL_LIST_STATIC 1
2367/* Occupied channel list can be learnt after init */
2368#define WMI_CHANNEL_LIST_DYNAMIC_INIT 2
2369/* Occupied channel list can be learnt after flush */
2370#define WMI_CHANNEL_LIST_DYNAMIC_FLUSH 3
2371/* Occupied channel list can be learnt after update */
2372#define WMI_CHANNEL_LIST_DYNAMIC_UPDATE 4
Govind Singhae855362016-03-07 14:24:22 +05302373
2374/**
2375 * struct plm_req_params - plm req parameter
2376 * @diag_token: Dialog token
2377 * @meas_token: measurement token
2378 * @num_bursts: total number of bursts
2379 * @burst_int: burst interval in seconds
2380 * @meas_duration:in TU's,STA goes off-ch
2381 * @burst_len: no of times the STA should cycle through PLM ch list
2382 * @desired_tx_pwr: desired tx power
2383 * @mac_addr: MC dest addr
2384 * @plm_num_ch: channel numbers
2385 * @plm_ch_list: channel list
2386 * @session_id: session id
2387 * @enable: enable/disable
2388 */
2389struct plm_req_params {
2390 uint16_t diag_token;
2391 uint16_t meas_token;
2392 uint16_t num_bursts;
2393 uint16_t burst_int;
2394 uint16_t meas_duration;
2395 /* no of times the STA should cycle through PLM ch list */
2396 uint8_t burst_len;
2397 int8_t desired_tx_pwr;
Govind Singhd7468a52016-03-09 14:32:57 +05302398 struct qdf_mac_addr mac_addr;
Govind Singhae855362016-03-07 14:24:22 +05302399 /* no of channels */
2400 uint8_t plm_num_ch;
2401 /* channel numbers */
2402 uint8_t plm_ch_list[WMI_CFG_VALID_CHANNEL_LIST_LEN];
2403 uint8_t session_id;
2404 bool enable;
2405};
Naveen Rawatd5ffe152016-04-14 23:42:46 -07002406
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05302407#define MAX_SSID_ALLOWED_LIST 4
2408#define MAX_BSSID_AVOID_LIST 16
2409#define MAX_BSSID_FAVORED 16
Govind Singhae855362016-03-07 14:24:22 +05302410
2411
2412/**
2413 * struct mac_ts_info_tfc - mac ts info parameters
2414 * @burstSizeDefn: burst size
2415 * @reserved: reserved
2416 * @ackPolicy: ack policy
2417 * @psb: psb
2418 * @aggregation: aggregation
2419 * @accessPolicy: access policy
2420 * @direction: direction
2421 * @tsid: direction
2422 * @trafficType: traffic type
2423 */
2424struct mac_ts_info_tfc {
2425#ifndef ANI_LITTLE_BIT_ENDIAN
2426 uint8_t burstSizeDefn:1;
2427 uint8_t reserved:7;
2428#else
2429 uint8_t reserved:7;
2430 uint8_t burstSizeDefn:1;
2431#endif
2432
2433#ifndef ANI_LITTLE_BIT_ENDIAN
2434 uint16_t ackPolicy:2;
2435 uint16_t userPrio:3;
2436 uint16_t psb:1;
2437 uint16_t aggregation:1;
2438 uint16_t accessPolicy:2;
2439 uint16_t direction:2;
2440 uint16_t tsid:4;
2441 uint16_t trafficType:1;
2442#else
2443 uint16_t trafficType:1;
2444 uint16_t tsid:4;
2445 uint16_t direction:2;
2446 uint16_t accessPolicy:2;
2447 uint16_t aggregation:1;
2448 uint16_t psb:1;
2449 uint16_t userPrio:3;
2450 uint16_t ackPolicy:2;
2451#endif
Govind Singhd7468a52016-03-09 14:32:57 +05302452} qdf_packed;
Govind Singhae855362016-03-07 14:24:22 +05302453
2454/**
2455 * struct mac_ts_info_sch - mac ts info schedule parameters
2456 * @rsvd: reserved
2457 * @schedule: schedule bit
2458 */
2459struct mac_ts_info_sch {
2460#ifndef ANI_LITTLE_BIT_ENDIAN
2461 uint8_t rsvd:7;
2462 uint8_t schedule:1;
2463#else
2464 uint8_t schedule:1;
2465 uint8_t rsvd:7;
2466#endif
Govind Singhd7468a52016-03-09 14:32:57 +05302467} qdf_packed;
Govind Singhae855362016-03-07 14:24:22 +05302468
2469/**
2470 * struct mac_ts_info_sch - mac ts info schedule parameters
2471 * @traffic: mac tfc parameter
2472 * @schedule: mac schedule parameters
2473 */
2474struct mac_ts_info {
2475 struct mac_ts_info_tfc traffic;
2476 struct mac_ts_info_sch schedule;
Govind Singhd7468a52016-03-09 14:32:57 +05302477} qdf_packed;
Govind Singhae855362016-03-07 14:24:22 +05302478
2479/**
2480 * struct mac_tspec_ie - mac ts spec
2481 * @type: type
2482 * @length: length
2483 * @tsinfo: tsinfo
2484 * @nomMsduSz: nomMsduSz
2485 * @maxMsduSz: maxMsduSz
2486 * @minSvcInterval: minSvcInterval
2487 * @maxSvcInterval: maxSvcInterval
2488 * @inactInterval: inactInterval
2489 * @suspendInterval: suspendInterval
2490 * @svcStartTime: svcStartTime
2491 * @minDataRate: minDataRate
2492 * @meanDataRate: meanDataRate
2493 * @peakDataRate: peakDataRate
2494 * @maxBurstSz: maxBurstSz
2495 * @delayBound: delayBound
2496 * @minPhyRate: minPhyRate
2497 * @surplusBw: surplusBw
2498 * @mediumTime: mediumTime
2499 */
2500struct mac_tspec_ie {
2501 uint8_t type;
2502 uint8_t length;
2503 struct mac_ts_info tsinfo;
2504 uint16_t nomMsduSz;
2505 uint16_t maxMsduSz;
2506 uint32_t minSvcInterval;
2507 uint32_t maxSvcInterval;
2508 uint32_t inactInterval;
2509 uint32_t suspendInterval;
2510 uint32_t svcStartTime;
2511 uint32_t minDataRate;
2512 uint32_t meanDataRate;
2513 uint32_t peakDataRate;
2514 uint32_t maxBurstSz;
2515 uint32_t delayBound;
2516 uint32_t minPhyRate;
2517 uint16_t surplusBw;
2518 uint16_t mediumTime;
Govind Singhd7468a52016-03-09 14:32:57 +05302519} qdf_packed;
Govind Singhae855362016-03-07 14:24:22 +05302520
2521/**
2522 * struct add_ts_param - ADDTS related parameters
2523 * @staIdx: station index
2524 * @tspecIdx: TSPEC handler uniquely identifying a TSPEC for a STA in a BSS
2525 * @tspec: tspec value
2526 * @status: CDF status
2527 * @sessionId: session id
Govind Singhd7468a52016-03-09 14:32:57 +05302528 * @tsm_interval: TSM interval period passed from UMAC to WMI
Govind Singhae855362016-03-07 14:24:22 +05302529 * @setRICparams: RIC parameters
2530 * @sme_session_id: sme session id
2531 */
2532struct add_ts_param {
2533 uint16_t staIdx;
2534 uint16_t tspecIdx;
2535 struct mac_tspec_ie tspec;
Govind Singhd7468a52016-03-09 14:32:57 +05302536 QDF_STATUS status;
Govind Singhae855362016-03-07 14:24:22 +05302537 uint8_t sessionId;
2538#ifdef FEATURE_WLAN_ESE
2539 uint16_t tsm_interval;
2540#endif /* FEATURE_WLAN_ESE */
2541#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2542 uint8_t setRICparams;
2543#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
2544 uint8_t sme_session_id;
2545};
2546
2547/**
2548 * struct delts_req_info - DELTS request parameter
2549 * @tsinfo: ts info
2550 * @tspec: ts spec
2551 * @wmeTspecPresent: wme ts spec flag
2552 * @wsmTspecPresent: wsm ts spec flag
2553 * @lleTspecPresent: lle ts spec flag
2554 */
2555struct delts_req_info {
2556 struct mac_ts_info tsinfo;
2557 struct mac_tspec_ie tspec;
2558 uint8_t wmeTspecPresent:1;
2559 uint8_t wsmTspecPresent:1;
2560 uint8_t lleTspecPresent:1;
2561};
2562
2563/**
2564 * struct del_ts_params - DELTS related parameters
2565 * @staIdx: station index
2566 * @tspecIdx: TSPEC identifier uniquely identifying a TSPEC for a STA in a BSS
2567 * @bssId: BSSID
2568 * @sessionId: session id
2569 * @userPrio: user priority
2570 * @delTsInfo: DELTS info
2571 * @setRICparams: RIC parameters
2572 */
2573struct del_ts_params {
2574 uint16_t staIdx;
2575 uint16_t tspecIdx;
Govind Singh8675b862016-03-28 22:09:18 +05302576 uint8_t bssId[IEEE80211_ADDR_LEN];
Govind Singhae855362016-03-07 14:24:22 +05302577 uint8_t sessionId;
2578 uint8_t userPrio;
2579#ifdef WLAN_FEATURE_ROAM_OFFLOAD
2580 struct delts_req_info delTsInfo;
2581 uint8_t setRICparams;
2582#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
2583};
2584
2585/**
2586 * struct ll_stats_clear_params - ll stats clear parameter
2587 * @req_id: request id
2588 * @sta_id: sta id
2589 * @stats_clear_mask: stats clear mask
2590 * @stop_req: stop request
2591 */
2592struct ll_stats_clear_params {
2593 uint32_t req_id;
2594 uint8_t sta_id;
2595 uint32_t stats_clear_mask;
2596 uint8_t stop_req;
2597};
2598
2599/**
2600 * struct ll_stats_set_params - ll stats get parameter
2601 * @req_id: request id
2602 * @sta_id: sta id
2603 * @mpdu_size_threshold: mpdu sixe threshold
2604 * @aggressive_statistics_gathering: aggressive_statistics_gathering
2605 */
2606struct ll_stats_set_params {
2607 uint32_t req_id;
2608 uint8_t sta_id;
2609 uint32_t mpdu_size_threshold;
2610 uint32_t aggressive_statistics_gathering;
2611};
2612
2613/**
2614 * struct ll_stats_get_params - ll stats parameter
2615 * @req_id: request id
2616 * @sta_id: sta id
2617 * @param_id_mask: param is mask
2618 */
2619struct ll_stats_get_params {
2620 uint32_t req_id;
2621 uint8_t sta_id;
2622 uint32_t param_id_mask;
2623};
2624
2625/**
2626 * struct pe_stats_req - pe stats parameter
2627 * @msg_type: message type is same as the request type
2628 * @msg_len: length of the entire request
2629 * @sta_id: Per STA stats request must contain valid
2630 * @stats_mask: categories of stats requested
2631 * @session_id: wsm ts spec flag
2632 */
2633struct pe_stats_req {
2634 /* Common for all types are requests */
2635 uint16_t msg_type;
2636 uint16_t msg_len;
2637 uint32_t sta_id;
2638 /* categories of stats requested. look at ePEStatsMask */
2639 uint32_t stats_mask;
2640 uint8_t session_id;
2641};
2642
2643/**
2644 * struct link_status_params - link stats parameter
2645 * @msg_type: message type is same as the request type
2646 * @msg_len: length of the entire request
2647 * @link_status: wme ts spec flag
2648 * @session_id: wsm ts spec flag
2649 */
2650struct link_status_params {
2651 uint16_t msg_type;
2652 uint16_t msg_len;
2653 uint8_t link_status;
2654 uint8_t session_id;
2655};
2656
2657/**
2658 * struct dhcp_stop_ind_params - DHCP Stop indication message
2659 * @msgtype: message type is same as the request type
2660 * @msglen: length of the entire request
2661 * @device_mode: Mode of the device(ex:STA, AP)
2662 * @adapter_macaddr: MAC address of the adapter
2663 * @peer_macaddr: MAC address of the connected peer
2664 */
2665struct dhcp_stop_ind_params {
2666 uint16_t msgtype;
2667 uint16_t msglen;
2668 uint8_t device_mode;
Govind Singhd7468a52016-03-09 14:32:57 +05302669 struct qdf_mac_addr adapter_macaddr;
2670 struct qdf_mac_addr peer_macaddr;
Govind Singhae855362016-03-07 14:24:22 +05302671};
2672
2673/**
2674 * struct aggr_add_ts_param - ADDTS parameters
2675 * @staIdx: station index
2676 * @tspecIdx: TSPEC handler uniquely identifying a TSPEC for a STA in a BSS
2677 * @tspec: tspec value
2678 * @status: CDF status
2679 * @sessionId: session id
2680 */
2681struct aggr_add_ts_param {
2682 uint16_t staIdx;
2683 uint16_t tspecIdx;
2684 struct mac_tspec_ie tspec[WMI_QOS_NUM_AC_MAX];
Govind Singhd7468a52016-03-09 14:32:57 +05302685 QDF_STATUS status[WMI_QOS_NUM_AC_MAX];
Govind Singhae855362016-03-07 14:24:22 +05302686 uint8_t sessionId;
2687};
2688
2689#define WMI_MAX_FILTER_TEST_DATA_LEN 8
2690#define WMI_MAX_NUM_MULTICAST_ADDRESS 240
2691#define WMI_MAX_NUM_FILTERS 20
2692#define WMI_MAX_NUM_TESTS_PER_FILTER 10
2693
2694/**
2695 * enum packet_filter_type - packet filter type
2696 * @WMI_RCV_FILTER_TYPE_INVALID: invalid type
2697 * @WMI_RCV_FILTER_TYPE_FILTER_PKT: filter packet type
2698 * @WMI_RCV_FILTER_TYPE_BUFFER_PKT: buffer packet type
2699 * @WMI_RCV_FILTER_TYPE_MAX_ENUM_SIZE: max enum size
2700 */
2701enum packet_filter_type {
2702 WMI_RCV_FILTER_TYPE_INVALID,
2703 WMI_RCV_FILTER_TYPE_FILTER_PKT,
2704 WMI_RCV_FILTER_TYPE_BUFFER_PKT,
2705 WMI_RCV_FILTER_TYPE_MAX_ENUM_SIZE
2706};
2707
2708/**
2709 * enum packet_protocol_type - packet protocol type
2710 * @WMI_FILTER_HDR_TYPE_INVALID: invalid type
2711 * @WMI_FILTER_HDR_TYPE_MAC: mac type
2712 * @WMI_FILTER_HDR_TYPE_ARP: trp type
2713 * @WMI_FILTER_HDR_TYPE_IPV4: ipv4 type
2714 * @WMI_FILTER_HDR_TYPE_IPV6: ipv6 type
2715 * @WMI_FILTER_HDR_TYPE_UDP: udp type
2716 * @WMI_FILTER_HDR_TYPE_MAX: max type
2717 */
2718enum packet_protocol_type {
2719 WMI_FILTER_HDR_TYPE_INVALID,
2720 WMI_FILTER_HDR_TYPE_MAC,
2721 WMI_FILTER_HDR_TYPE_ARP,
2722 WMI_FILTER_HDR_TYPE_IPV4,
2723 WMI_FILTER_HDR_TYPE_IPV6,
2724 WMI_FILTER_HDR_TYPE_UDP,
2725 WMI_FILTER_HDR_TYPE_MAX
2726};
2727
2728/**
2729 * enum packet_filter_comp_type - packet filter comparison type
2730 * @WMI_FILTER_CMP_TYPE_INVALID: invalid type
2731 * @WMI_FILTER_CMP_TYPE_EQUAL: type equal
2732 * @WMI_FILTER_CMP_TYPE_MASK_EQUAL: mask equal
2733 * @WMI_FILTER_CMP_TYPE_NOT_EQUAL: type not equal
2734 * @WMI_FILTER_CMP_TYPE_MASK_NOT_EQUAL: mask not equal
2735 * @WMI_FILTER_CMP_TYPE_MAX: max type
2736 */
2737enum packet_filter_comp_type {
2738 WMI_FILTER_CMP_TYPE_INVALID,
2739 WMI_FILTER_CMP_TYPE_EQUAL,
2740 WMI_FILTER_CMP_TYPE_MASK_EQUAL,
2741 WMI_FILTER_CMP_TYPE_NOT_EQUAL,
2742 WMI_FILTER_CMP_TYPE_MASK_NOT_EQUAL,
2743 WMI_FILTER_CMP_TYPE_MAX
2744};
2745
2746/**
2747 * struct rcv_pkt_filter_params - recieve packet filter parameters
2748 * @protocolLayer - protocol layer
2749 * @cmpFlag - comparison flag
2750 * @dataLength - data length
2751 * @dataOffset - data offset
2752 * @reserved - resserved
2753 * @compareData - compare data
2754 * @dataMask - data mask
2755 */
2756struct rcv_pkt_filter_params {
2757 enum packet_protocol_type protocolLayer;
2758 enum packet_filter_comp_type cmpFlag;
2759 uint16_t dataLength;
2760 uint8_t dataOffset;
2761 uint8_t reserved;
2762 uint8_t compareData[WMI_MAX_FILTER_TEST_DATA_LEN];
2763 uint8_t dataMask[WMI_MAX_FILTER_TEST_DATA_LEN];
2764};
2765
2766/**
2767 * struct rcv_pkt_filter_config - recieve packet filter info
2768 * @filterId - filter id
2769 * @filterType - filter type
2770 * @numFieldParams - no of fields
2771 * @coalesceTime - reserved parameter
2772 * @self_macaddr - self mac address
2773 * @bssid - Bssid of the connected AP
2774 * @paramsData - data parameter
2775 */
2776struct rcv_pkt_filter_config {
2777 uint8_t filterId;
2778 enum packet_filter_type filterType;
2779 uint32_t numFieldParams;
2780 uint32_t coalesceTime;
Govind Singhd7468a52016-03-09 14:32:57 +05302781 struct qdf_mac_addr self_macaddr;
2782 struct qdf_mac_addr bssid;
Govind Singhae855362016-03-07 14:24:22 +05302783 struct rcv_pkt_filter_params paramsData[WMI_MAX_NUM_TESTS_PER_FILTER];
2784};
2785
2786/**
2787 * struct vdev_ie_info_param - IE info
2788 * @vdev_id - vdev for which the IE is being sent
2789 * @ie_id - ID of the IE
2790 * @length - length of the IE data
2791 * @data - IE data
2792 *
2793 * This structure is used to store the IE information.
2794 */
2795struct vdev_ie_info_param {
2796 uint32_t vdev_id;
2797 uint32_t ie_id;
2798 uint32_t length;
Selvaraj, Sridharce064292016-07-25 16:25:14 +05302799 uint32_t ie_source;
Naveen Rawat71268882016-08-03 16:41:33 -07002800 uint32_t band;
Govind Singhae855362016-03-07 14:24:22 +05302801 uint8_t *data;
2802};
2803
2804#define WMI_MAX_NUM_FW_SEGMENTS 4
2805
2806/**
2807 * struct fw_dump_seg_req_param - individual segment details
2808 * @seg_id - segment id.
2809 * @seg_start_addr_lo - lower address of the segment.
2810 * @seg_start_addr_hi - higher address of the segment.
2811 * @seg_length - length of the segment.
2812 * @dst_addr_lo - lower address of the destination buffer.
2813 * @dst_addr_hi - higher address of the destination buffer.
2814 *
2815 * This structure carries the information to firmware about the
2816 * individual segments. This structure is part of firmware memory
2817 * dump request.
2818 */
2819struct fw_dump_seg_req_param {
2820 uint8_t seg_id;
2821 uint32_t seg_start_addr_lo;
2822 uint32_t seg_start_addr_hi;
2823 uint32_t seg_length;
2824 uint32_t dst_addr_lo;
2825 uint32_t dst_addr_hi;
2826};
2827
2828/**
2829 * struct fw_dump_req_param - firmware memory dump request details.
2830 * @request_id - request id.
2831 * @num_seg - requested number of segments.
2832 * @fw_dump_seg_req - individual segment information.
2833 *
2834 * This structure carries information about the firmware
2835 * memory dump request.
2836 */
2837struct fw_dump_req_param {
2838 uint32_t request_id;
2839 uint32_t num_seg;
2840 struct fw_dump_seg_req_param segment[WMI_MAX_NUM_FW_SEGMENTS];
2841};
2842
2843#define WMI_TDLS_MAX_SUPP_CHANNELS 128
2844#define WMI_TDLS_MAX_SUPP_OPER_CLASSES 32
2845#define WMI_2_4_GHZ_MAX_FREQ 3000
2846
2847/**
2848 * struct tdls_update_ch_params - channel parameters
2849 * @chanId: ID of the channel
2850 * @pwr: power level
2851 * @dfsSet: is dfs supported or not
2852 * @half_rate: is the channel operating at 10MHz
2853 * @quarter_rate: is the channel operating at 5MHz
2854 */
2855struct tdls_update_ch_params {
2856 uint8_t chanId;
2857 uint8_t pwr;
2858 bool dfsSet;
2859 bool half_rate;
2860 bool quarter_rate;
2861};
2862
2863/**
2864 * struct tdls_peer_cap_params - TDLS peer capablities parameters
2865 * @isPeerResponder: is peer responder or not
2866 * @peerUapsdQueue: peer uapsd queue
2867 * @peerMaxSp: peer max SP value
2868 * @peerBuffStaSupport: peer buffer sta supported or not
2869 * @peerOffChanSupport: peer offchannel support
2870 * @peerCurrOperClass: peer current operating class
2871 * @selfCurrOperClass: self current operating class
2872 * @peerChanLen: peer channel length
2873 * @peerChan: peer channel list
2874 * @peerOperClassLen: peer operating class length
2875 * @peerOperClass: peer operating class
2876 * @prefOffChanNum: peer offchannel number
2877 * @prefOffChanBandwidth: peer offchannel bandwidth
2878 * @opClassForPrefOffChan: operating class for offchannel
2879 */
2880struct tdls_peer_cap_params {
2881 uint8_t isPeerResponder;
2882 uint8_t peerUapsdQueue;
2883 uint8_t peerMaxSp;
2884 uint8_t peerBuffStaSupport;
2885 uint8_t peerOffChanSupport;
2886 uint8_t peerCurrOperClass;
2887 uint8_t selfCurrOperClass;
2888 uint8_t peerChanLen;
2889 struct tdls_update_ch_params peerChan[WMI_TDLS_MAX_SUPP_CHANNELS];
2890 uint8_t peerOperClassLen;
2891 uint8_t peerOperClass[WMI_TDLS_MAX_SUPP_OPER_CLASSES];
2892 uint8_t prefOffChanNum;
2893 uint8_t prefOffChanBandwidth;
2894 uint8_t opClassForPrefOffChan;
2895};
2896
2897/**
2898 * struct tdls_peer_state_params - TDLS peer state parameters
2899 * @vdevId: vdev id
2900 * @peerMacAddr: peer mac address
2901 * @peerCap: peer capabality
2902 */
2903struct tdls_peer_state_params {
2904 uint32_t vdevId;
Govind Singh8675b862016-03-28 22:09:18 +05302905 uint8_t peerMacAddr[IEEE80211_ADDR_LEN];
Govind Singhae855362016-03-07 14:24:22 +05302906 uint32_t peerState;
2907 struct tdls_peer_cap_params peerCap;
2908};
2909
2910/**
2911 * struct wmi_tdls_params - TDLS parameters
2912 * @vdev_id: vdev id
2913 * @tdls_state: TDLS state
2914 * @notification_interval_ms: notification inerval
2915 * @tx_discovery_threshold: tx discovery threshold
2916 * @tx_teardown_threshold: tx teardown threashold
2917 * @rssi_teardown_threshold: RSSI teardown threshold
2918 * @rssi_delta: RSSI delta
2919 * @tdls_options: TDLS options
2920 * @peer_traffic_ind_window: raffic indication window
2921 * @peer_traffic_response_timeout: traffic response timeout
2922 * @puapsd_mask: uapsd mask
2923 * @puapsd_inactivity_time: uapsd inactivity time
2924 * @puapsd_rx_frame_threshold: uapsd rx frame threshold
2925 * @teardown_notification_ms: tdls teardown notification interval
2926 * @tdls_peer_kickout_threshold: tdls packet threshold for
2927 * peer kickout operation
2928 */
2929struct wmi_tdls_params {
2930 uint32_t vdev_id;
2931 uint32_t tdls_state;
2932 uint32_t notification_interval_ms;
2933 uint32_t tx_discovery_threshold;
2934 uint32_t tx_teardown_threshold;
2935 int32_t rssi_teardown_threshold;
2936 int32_t rssi_delta;
2937 uint32_t tdls_options;
2938 uint32_t peer_traffic_ind_window;
2939 uint32_t peer_traffic_response_timeout;
2940 uint32_t puapsd_mask;
2941 uint32_t puapsd_inactivity_time;
2942 uint32_t puapsd_rx_frame_threshold;
2943 uint32_t teardown_notification_ms;
2944 uint32_t tdls_peer_kickout_threshold;
2945};
2946
2947/**
2948 * struct tdls_chan_switch_params - channel switch parameter structure
2949 * @vdev_id: vdev ID
2950 * @peer_mac_addr: Peer mac address
2951 * @tdls_off_ch_bw_offset: Target off-channel bandwitdh offset
2952 * @tdls_off_ch: Target Off Channel
2953 * @oper_class: Operating class for target channel
2954 * @is_responder: Responder or initiator
2955 */
2956struct tdls_channel_switch_params {
2957 uint32_t vdev_id;
Govind Singh8675b862016-03-28 22:09:18 +05302958 uint8_t peer_mac_addr[IEEE80211_ADDR_LEN];
Govind Singhae855362016-03-07 14:24:22 +05302959 uint16_t tdls_off_ch_bw_offset;
2960 uint8_t tdls_off_ch;
2961 uint8_t tdls_sw_mode;
2962 uint8_t oper_class;
2963 uint8_t is_responder;
2964};
2965
2966/**
2967 * struct dhcp_offload_info_params - dhcp offload parameters
2968 * @vdev_id: request data length
2969 * @dhcpSrvOffloadEnabled: dhcp offload enabled
2970 * @dhcpClientNum: dhcp client no
2971 * @dhcpSrvIP: dhcp server ip
2972 */
2973struct dhcp_offload_info_params {
2974 uint32_t vdev_id;
2975 uint32_t dhcpSrvOffloadEnabled;
2976 uint32_t dhcpClientNum;
2977 uint32_t dhcpSrvIP;
2978};
2979
2980/**
2981 * struct nan_req_params - NAN request params
2982 * @request_data_len: request data length
2983 * @request_data: request data
2984 */
2985struct nan_req_params {
2986 uint16_t request_data_len;
2987 uint8_t request_data[];
2988};
2989
2990
2991/**
2992 * struct app_type2_params - app type2parameter
2993 * @vdev_id: vdev id
2994 * @rc4_key: rc4 key
2995 * @rc4_key_len: rc4 key length
2996 * @ip_id: NC id
2997 * @ip_device_ip: NC IP addres
2998 * @ip_server_ip: Push server IP address
2999 * @tcp_src_port: NC TCP port
3000 * @tcp_dst_port: Push server TCP port
3001 * @tcp_seq: tcp sequence
3002 * @tcp_ack_seq: tcp ack sequence
3003 * @keepalive_init: Initial ping interval
3004 * @keepalive_min: Minimum ping interval
3005 * @keepalive_max: Maximum ping interval
3006 * @keepalive_inc: Increment of ping interval
3007 * @gateway_mac: gateway mac address
3008 * @tcp_tx_timeout_val: tcp tx timeout value
3009 * @tcp_rx_timeout_val: tcp rx timeout value
3010 */
3011struct app_type2_params {
3012 uint8_t vdev_id;
3013 uint8_t rc4_key[16];
3014 uint32_t rc4_key_len;
3015 /** ip header parameter */
3016 uint32_t ip_id;
3017 uint32_t ip_device_ip;
3018 uint32_t ip_server_ip;
3019 /** tcp header parameter */
3020 uint16_t tcp_src_port;
3021 uint16_t tcp_dst_port;
3022 uint32_t tcp_seq;
3023 uint32_t tcp_ack_seq;
3024 uint32_t keepalive_init;
3025 uint32_t keepalive_min;
3026 uint32_t keepalive_max;
3027 uint32_t keepalive_inc;
Govind Singhd7468a52016-03-09 14:32:57 +05303028 struct qdf_mac_addr gateway_mac;
Govind Singhae855362016-03-07 14:24:22 +05303029 uint32_t tcp_tx_timeout_val;
3030 uint32_t tcp_rx_timeout_val;
3031};
3032
3033/**
3034 * struct app_type1_params - app type1 parameter
3035 * @vdev_id: vdev id
3036 * @wakee_mac_addr: mac address
3037 * @identification_id: identification id
3038 * @password: password
3039 * @id_length: id length
3040 * @pass_length: password length
3041 */
3042struct app_type1_params {
3043 uint8_t vdev_id;
Govind Singhd7468a52016-03-09 14:32:57 +05303044 struct qdf_mac_addr wakee_mac_addr;
Govind Singhae855362016-03-07 14:24:22 +05303045 uint8_t identification_id[8];
3046 uint8_t password[16];
3047 uint32_t id_length;
3048 uint32_t pass_length;
3049};
3050
3051/**
3052 * enum wmi_ext_wow_type - wow type
3053 * @WMI_EXT_WOW_TYPE_APP_TYPE1: only enable wakeup for app type1
3054 * @WMI_EXT_WOW_TYPE_APP_TYPE2: only enable wakeup for app type2
3055 * @WMI_EXT_WOW_TYPE_APP_TYPE1_2: enable wakeup for app type1&2
3056 */
3057enum wmi_ext_wow_type {
3058 WMI_EXT_WOW_TYPE_APP_TYPE1,
3059 WMI_EXT_WOW_TYPE_APP_TYPE2,
3060 WMI_EXT_WOW_TYPE_APP_TYPE1_2,
3061};
3062
3063/**
3064 * struct ext_wow_params - ext wow parameters
3065 * @vdev_id: vdev id
3066 * @type: wow type
3067 * @wakeup_pin_num: wake up gpio no
3068 */
3069struct ext_wow_params {
3070 uint8_t vdev_id;
3071 enum wmi_ext_wow_type type;
3072 uint32_t wakeup_pin_num;
3073};
3074
3075/**
3076 * struct stats_ext_params - ext stats request
3077 * @vdev_id: vdev id
3078 * @request_data_len: request data length
3079 * @request_data: request data
3080 */
3081struct stats_ext_params {
3082 uint32_t vdev_id;
3083 uint32_t request_data_len;
3084 uint8_t request_data[];
3085};
3086
3087#define WMI_PERIODIC_TX_PTRN_MAX_SIZE 1536
3088/**
3089 * struct periodic_tx_pattern - periodic tx pattern
3090 * @mac_address: MAC Address for the adapter
3091 * @ucPtrnId: Pattern ID
3092 * @ucPtrnSize: Pattern size
3093 * @usPtrnIntervalMs: in ms
3094 * @ucPattern: Pattern buffer
3095 */
3096struct periodic_tx_pattern {
Govind Singhd7468a52016-03-09 14:32:57 +05303097 struct qdf_mac_addr mac_address;
Govind Singhae855362016-03-07 14:24:22 +05303098 uint8_t ucPtrnId;
3099 uint16_t ucPtrnSize;
3100 uint32_t usPtrnIntervalMs;
3101 uint8_t ucPattern[WMI_PERIODIC_TX_PTRN_MAX_SIZE];
3102};
3103
3104#define WMI_GTK_OFFLOAD_KEK_BYTES 16
3105#define WMI_GTK_OFFLOAD_KCK_BYTES 16
Siddarth Poddard9221542016-04-01 17:45:06 +05303106#define WMI_GTK_OFFLOAD_ENABLE 0
3107#define WMI_GTK_OFFLOAD_DISABLE 1
Govind Singhae855362016-03-07 14:24:22 +05303108
3109/**
3110 * struct gtk_offload_params - gtk offload parameters
3111 * @ulFlags: optional flags
3112 * @aKCK: Key confirmation key
3113 * @aKEK: key encryption key
3114 * @ullKeyReplayCounter: replay counter
3115 * @bssid: bss id
3116 */
3117struct gtk_offload_params {
3118 uint32_t ulFlags;
3119 uint8_t aKCK[WMI_GTK_OFFLOAD_KCK_BYTES];
3120 uint8_t aKEK[WMI_GTK_OFFLOAD_KEK_BYTES];
3121 uint64_t ullKeyReplayCounter;
Govind Singhd7468a52016-03-09 14:32:57 +05303122 struct qdf_mac_addr bssid;
Govind Singhae855362016-03-07 14:24:22 +05303123};
3124
3125/**
3126 * struct flashing_req_params - led flashing parameter
3127 * @reqId: request id
3128 * @pattern_id: pattern identifier. 0: disconnected 1: connected
3129 * @led_x0: led flashing parameter0
3130 * @led_x1: led flashing parameter1
3131 */
3132struct flashing_req_params {
3133 uint32_t req_id;
3134 uint32_t pattern_id;
3135 uint32_t led_x0;
3136 uint32_t led_x1;
3137};
3138
Govind Singh89727882016-04-15 13:58:27 +05303139#define MAX_MEM_CHUNKS 32
3140/**
3141 * struct wmi_host_mem_chunk - host memory chunk structure
3142 * @vaddr: Pointer to virtual address
3143 * @paddr: Physical address
3144 * @memctx: qdf memory context for mapped address.
3145 * @len: length of chunk
3146 * @req_id: request id from target
3147 */
Govind Singhae855362016-03-07 14:24:22 +05303148struct wmi_host_mem_chunk {
3149 uint32_t *vaddr;
3150 uint32_t paddr;
Govind Singhd7468a52016-03-09 14:32:57 +05303151 qdf_dma_mem_context(memctx);
Govind Singhae855362016-03-07 14:24:22 +05303152 uint32_t len;
3153 uint32_t req_id;
3154};
3155
Govind Singh89727882016-04-15 13:58:27 +05303156/**
3157 * struct target_resource_config - Resource config given to target
3158 * This structure is union of wmi_resource_config defined
3159 * by both TLV and non-TLV target.
3160 */
Govind Singhae855362016-03-07 14:24:22 +05303161struct target_resource_config {
3162 uint32_t num_vdevs;
3163 uint32_t num_peers;
3164 uint32_t num_active_peers;
3165 uint32_t num_offload_peers;
3166 uint32_t num_offload_reorder_buffs;
3167 uint32_t num_peer_keys;
3168 uint32_t num_tids;
3169 uint32_t ast_skid_limit;
3170 uint32_t tx_chain_mask;
3171 uint32_t rx_chain_mask;
3172 uint32_t rx_timeout_pri[4];
3173 uint32_t rx_decap_mode;
3174 uint32_t scan_max_pending_req;
3175 uint32_t bmiss_offload_max_vdev;
3176 uint32_t roam_offload_max_vdev;
3177 uint32_t roam_offload_max_ap_profiles;
3178 uint32_t num_mcast_groups;
3179 uint32_t num_mcast_table_elems;
3180 uint32_t mcast2ucast_mode;
3181 uint32_t tx_dbg_log_size;
3182 uint32_t num_wds_entries;
3183 uint32_t dma_burst_size;
3184 uint32_t mac_aggr_delim;
3185 uint32_t rx_skip_defrag_timeout_dup_detection_check;
3186 uint32_t vow_config;
3187 uint32_t gtk_offload_max_vdev;
3188 uint32_t num_msdu_desc; /* Number of msdu desc */
3189 uint32_t max_frag_entries;
3190 /* End common */
3191
3192 /* Added in MCL */
3193 uint32_t num_tdls_vdevs;
3194 uint32_t num_tdls_conn_table_entries;
3195 uint32_t beacon_tx_offload_max_vdev;
3196 uint32_t num_multicast_filter_entries;
3197 uint32_t num_wow_filters;
3198 uint32_t num_keep_alive_pattern;
3199 uint32_t keep_alive_pattern_size;
3200 uint32_t max_tdls_concurrent_sleep_sta;
3201 uint32_t max_tdls_concurrent_buffer_sta;
3202 uint32_t wmi_send_separate;
3203 uint32_t num_ocb_vdevs;
3204 uint32_t num_ocb_channels;
3205 uint32_t num_ocb_schedules;
3206};
3207
3208/**
3209 * struct wmi_wifi_start_log - Structure to store the params sent to start/
3210 * stop logging
3211 * @name: Attribute which indicates the type of logging like per packet
3212 * statistics, connectivity etc.
3213 * @verbose_level: Verbose level which can be 0,1,2,3
3214 * @flag: Flag field for future use
3215 */
3216struct wmi_wifi_start_log {
3217 uint32_t ring_id;
3218 uint32_t verbose_level;
3219 uint32_t flag;
3220};
3221
3222/**
3223 * struct wmi_pcl_list - Format of PCL
3224 * @pcl_list: List of preferred channels
Manishekar Chandrasekaranb8c59382016-04-21 19:16:32 +05303225 * @weight_list: Weights of the PCL
Govind Singhae855362016-03-07 14:24:22 +05303226 * @pcl_len: Number of channels in the PCL
3227 */
3228struct wmi_pcl_list {
3229 uint8_t pcl_list[128];
Manishekar Chandrasekaranb8c59382016-04-21 19:16:32 +05303230 uint8_t weight_list[128];
Govind Singhae855362016-03-07 14:24:22 +05303231 uint32_t pcl_len;
3232};
3233
3234/**
Manishekar Chandrasekaranb8c59382016-04-21 19:16:32 +05303235 * struct wmi_pcl_chan_weights - Params to get the valid weighed list
3236 * @pcl_list: Preferred channel list already sorted in the order of preference
3237 * @pcl_len: Length of the PCL
3238 * @saved_chan_list: Valid channel list updated as part of
3239 * WMA_UPDATE_CHAN_LIST_REQ
3240 * @saved_num_chan: Length of the valid channel list
3241 * @weighed_valid_list: Weights of the valid channel list. This will have one
3242 * to one mapping with valid_chan_list. FW expects channel order and size to be
3243 * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID.
3244 * @weight_list: Weights assigned by policy manager
3245 */
3246struct wmi_pcl_chan_weights {
3247 uint8_t pcl_list[MAX_NUM_CHAN];
3248 uint32_t pcl_len;
3249 uint8_t saved_chan_list[MAX_NUM_CHAN];
3250 uint32_t saved_num_chan;
3251 uint8_t weighed_valid_list[MAX_NUM_CHAN];
3252 uint8_t weight_list[MAX_NUM_CHAN];
3253};
3254
3255/**
Govind Singhae855362016-03-07 14:24:22 +05303256 * struct wmi_hw_mode_params - HW mode params
3257 * @mac0_tx_ss: MAC0 Tx spatial stream
3258 * @mac0_rx_ss: MAC0 Rx spatial stream
3259 * @mac1_tx_ss: MAC1 Tx spatial stream
3260 * @mac1_rx_ss: MAC1 Rx spatial stream
3261 * @mac0_bw: MAC0 bandwidth
3262 * @mac1_bw: MAC1 bandwidth
3263 * @dbs_cap: DBS capabality
3264 * @agile_dfs_cap: Agile DFS capabality
3265 */
3266struct wmi_hw_mode_params {
3267 uint8_t mac0_tx_ss;
3268 uint8_t mac0_rx_ss;
3269 uint8_t mac1_tx_ss;
3270 uint8_t mac1_rx_ss;
3271 uint8_t mac0_bw;
3272 uint8_t mac1_bw;
3273 uint8_t dbs_cap;
3274 uint8_t agile_dfs_cap;
3275};
3276
3277/**
3278 * struct wmi_dual_mac_config - Dual MAC configuration
3279 * @scan_config: Scan configuration
3280 * @fw_mode_config: FW mode configuration
3281 * @set_dual_mac_cb: Callback function to be executed on response to the command
3282 */
3283struct wmi_dual_mac_config {
3284 uint32_t scan_config;
3285 uint32_t fw_mode_config;
3286 void *set_dual_mac_cb;
3287};
3288
3289#ifdef WLAN_NS_OFFLOAD
3290/**
3291 * struct ns_offload_req_params - ns offload request paramter
3292 * @srcIPv6Addr: src ipv6 address
3293 * @selfIPv6Addr: self ipv6 address
3294 * @targetIPv6Addr: target ipv6 address
3295 * @self_macaddr: self mac address
3296 * @srcIPv6AddrValid: src ipv6 address valid flag
3297 * @targetIPv6AddrValid: target ipv6 address valid flag
Sravan Kumar Kairam33b95492016-07-26 17:59:59 +05303298 * @target_ipv6_addr_ac_type: target ipv6 address type
Govind Singhae855362016-03-07 14:24:22 +05303299 * @slotIdx: slot index
3300 */
3301struct ns_offload_req_params {
3302 uint8_t srcIPv6Addr[WMI_MAC_IPV6_ADDR_LEN];
3303 uint8_t selfIPv6Addr[WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][WMI_MAC_IPV6_ADDR_LEN];
3304 uint8_t targetIPv6Addr[WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][WMI_MAC_IPV6_ADDR_LEN];
Govind Singhd7468a52016-03-09 14:32:57 +05303305 struct qdf_mac_addr self_macaddr;
Govind Singhae855362016-03-07 14:24:22 +05303306 uint8_t srcIPv6AddrValid;
3307 uint8_t targetIPv6AddrValid[WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA];
Sravan Kumar Kairam33b95492016-07-26 17:59:59 +05303308 uint8_t target_ipv6_addr_ac_type[WMI_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA];
Govind Singhae855362016-03-07 14:24:22 +05303309 uint8_t slotIdx;
3310};
3311#endif /* WLAN_NS_OFFLOAD */
3312
3313/**
3314 * struct host_offload_req_param - arp offload parameter
3315 * @offloadType: offload type
3316 * @enableOrDisable: enable or disable
3317 * @num_ns_offload_count: offload count
3318 */
3319struct host_offload_req_param {
3320 uint8_t offloadType;
3321 uint8_t enableOrDisable;
3322 uint32_t num_ns_offload_count;
3323 union {
3324 uint8_t hostIpv4Addr[WMI_IPV4_ADDR_LEN];
3325 uint8_t hostIpv6Addr[WMI_MAC_IPV6_ADDR_LEN];
3326 } params;
3327#ifdef WLAN_NS_OFFLOAD
3328 struct ns_offload_req_params nsOffloadInfo;
3329#endif /* WLAN_NS_OFFLOAD */
Govind Singhd7468a52016-03-09 14:32:57 +05303330 struct qdf_mac_addr bssid;
Govind Singhae855362016-03-07 14:24:22 +05303331};
3332
3333/**
3334 * struct ssid_hotlist_param - param for SSID Hotlist
3335 * @ssid: SSID which is being hotlisted
3336 * @band: Band in which the given SSID should be scanned
3337 * @rssi_low: Low bound on RSSI
3338 * @rssi_high: High bound on RSSI
3339 */
3340struct ssid_hotlist_param {
3341 struct mac_ssid ssid;
3342 uint8_t band;
3343 int32_t rssi_low;
3344 int32_t rssi_high;
3345};
3346
3347/**
Himanshu Agarwal5f2d0482016-03-09 15:25:44 +05303348 * struct roam_scan_filter_params - Structure holding roaming scan
3349 * parameters
3350 * @len: length
3351 * @op_bitmap: bitmap to determine reason of roaming
3352 * @session_id: vdev id
3353 * @num_bssid_black_list: The number of BSSID's that we should
3354 * avoid connecting to. It is like a
3355 * blacklist of BSSID's.
3356 * @num_ssid_white_list: The number of SSID profiles that are
3357 * in the Whitelist. When roaming, we
3358 * consider the BSSID's with this SSID
3359 * also for roaming apart from the connected one's
3360 * @num_bssid_preferred_list: Number of BSSID's which have a preference over
3361 * others
3362 * @bssid_avoid_list: Blacklist SSID's
3363 * @ssid_allowed_list: Whitelist SSID's
3364 * @bssid_favored: Favorable BSSID's
3365 * @bssid_favored_factor: RSSI to be added to this BSSID to prefer it
3366 *
3367 * This structure holds all the key parameters related to
3368 * initial connection and roaming connections.
3369 */
3370
3371struct roam_scan_filter_params {
3372 uint32_t len;
3373 uint32_t op_bitmap;
3374 uint8_t session_id;
3375 uint32_t num_bssid_black_list;
3376 uint32_t num_ssid_white_list;
3377 uint32_t num_bssid_preferred_list;
3378 struct qdf_mac_addr bssid_avoid_list[MAX_BSSID_AVOID_LIST];
3379 struct mac_ssid ssid_allowed_list[MAX_SSID_ALLOWED_LIST];
3380 struct qdf_mac_addr bssid_favored[MAX_BSSID_FAVORED];
3381 uint8_t bssid_favored_factor[MAX_BSSID_FAVORED];
3382};
3383
3384/**
Govind Singhae855362016-03-07 14:24:22 +05303385 * struct ssid_hotlist_request_params - set SSID hotlist request struct
3386 * @request_id: ID of the request
3387 * @session_id: ID of the session
3388 * @lost_ssid_sample_size: Number of consecutive scans in which the SSID
3389 * must not be seen in order to consider the SSID "lost"
3390 * @ssid_count: Number of valid entries in the @ssids array
3391 * @ssids: Array that defines the SSIDs that are in the hotlist
3392 */
3393struct ssid_hotlist_request_params {
3394 uint32_t request_id;
3395 uint8_t session_id;
3396 uint32_t lost_ssid_sample_size;
3397 uint32_t ssid_count;
3398 struct ssid_hotlist_param ssids[WMI_EXTSCAN_MAX_HOTLIST_SSIDS];
3399};
3400
3401/**
3402 * struct wmi_unit_test_cmd - unit test command parameters
3403 * @vdev_id: vdev id
3404 * @module_id: module id
3405 * @num_args: number of arguments
3406 * @args: arguments
3407 */
3408struct wmi_unit_test_cmd {
3409 uint32_t vdev_id;
Govind Singh89727882016-04-15 13:58:27 +05303410 uint32_t module_id;
Govind Singhae855362016-03-07 14:24:22 +05303411 uint32_t num_args;
3412 uint32_t args[WMI_MAX_NUM_ARGS];
3413};
3414
3415/**
3416 * struct wmi_roam_invoke_cmd - roam invoke command
3417 * @vdev_id: vdev id
3418 * @bssid: mac address
3419 * @channel: channel
Naveen Rawatccc1b072017-01-20 17:00:07 -08003420 * @frame_len: frame length, includs mac header, fixed params and ies
3421 * @frame_buf: buffer contaning probe response or beacon
Govind Singhae855362016-03-07 14:24:22 +05303422 */
3423struct wmi_roam_invoke_cmd {
3424 uint32_t vdev_id;
3425 uint8_t bssid[IEEE80211_ADDR_LEN];
3426 uint32_t channel;
Naveen Rawatccc1b072017-01-20 17:00:07 -08003427 uint32_t frame_len;
3428 uint8_t *frame_buf;
Govind Singhae855362016-03-07 14:24:22 +05303429};
3430
3431/**
3432 * struct ext_scan_setbssi_hotlist_params - set hotlist request
3433 * @requestId: request identifier
3434 * @sessionId: session identifier
3435 * @lost_ap_sample_size: number of samples to confirm AP loss
3436 * @numAp: Number of hotlist APs
3437 * @ap: hotlist APs
3438 */
3439struct ext_scan_setbssi_hotlist_params {
3440 uint32_t requestId;
3441 uint8_t sessionId;
3442
3443 uint32_t lost_ap_sample_size;
3444 uint32_t numAp;
3445 struct ap_threshold_params ap[WMI_WLAN_EXTSCAN_MAX_HOTLIST_APS];
3446};
Govind Singh89727882016-04-15 13:58:27 +05303447
3448/**
3449 * struct TARGET_HAL_REG_CAPABILITIES - This is replication of REG table
3450 * structure defined by target. This is added here to remove dependency
3451 * on FW headers so that host can be agnostic to different defintions in
3452 * both the targets.
3453 */
3454typedef struct {
3455 uint32_t eeprom_rd; /* regdomain value specified in EEPROM */
3456 uint32_t eeprom_rd_ext; /* regdomain */
3457 uint32_t regcap1; /* CAP1 capabilities bit map */
3458 uint32_t regcap2; /* REGDMN EEPROM CAP */
3459 uint32_t wireless_modes; /* REGDMN MODE */
3460 uint32_t low_2ghz_chan;
3461 uint32_t high_2ghz_chan;
3462 uint32_t low_5ghz_chan;
3463 uint32_t high_5ghz_chan;
3464} TARGET_HAL_REG_CAPABILITIES;
3465
3466/**
3467 * struct host_mem_req - Host memory request paramseters request by target
3468 * @req_id: Request id to identify the request.
3469 * @unit_size: Size of single unit requested.
3470 * @num_unit_info: Memory chunk info
3471 * @num_units: number of units requested.
3472 */
3473typedef struct {
3474 uint32_t req_id;
3475 uint32_t unit_size;
3476 uint32_t num_unit_info;
3477 uint32_t num_units;
3478} host_mem_req;
3479
3480#define WMI_HOST_DSCP_MAP_MAX (64)
3481
3482/**
3483 * struct wmi_host_ext_resource_config - Extended resource config
3484 * @host_platform_config: Host plaform configuration.
3485 * @fw_featuew_bitmap: FW feature requested bitmap.
3486 */
3487typedef struct {
3488 uint32_t host_platform_config;
3489
3490#define WMI_HOST_FW_FEATURE_LTEU_SUPPORT 0x0001
3491#define WMI_HOST_FW_FEATURE_COEX_GPIO_SUPPORT 0x0002
3492#define WMI_HOST_FW_FEATURE_AUX_RADIO_SPECTRAL_INTF 0x0004
3493#define WMI_HOST_FW_FEATURE_AUX_RADIO_CHAN_LOAD_INTF 0x0008
3494#define WMI_HOST_FW_FEATURE_BSS_CHANNEL_INFO_64 0x0010
3495#define WMI_HOST_FW_FEATURE_PEER_STATS 0x0020
3496#define WMI_HOST_FW_FEATURE_VDEV_STATS 0x0040
3497 /**
3498 * @brief fw_feature_bitmask - Enable/Disable features in FW
3499 * @details
3500 * The bits in fw_feature_bitmask are used as shown by the masks below:
3501 * 0x0001 - LTEU Config enable/disable
3502 * 0x0002 - COEX GPIO Config enable/disable
3503 * 0x0004 - Aux Radio enhancement for spectral scan enable/disable
3504 * 0x0008 - Aux Radio enhancement for chan load scan enable/disable
3505 * 0x0010 - BSS channel info stats enable/disable
3506 * The features in question are enabled by setting
3507 * the feature's bit to 1,
3508 * or disabled by setting the feature's bit to 0.
3509 */
3510 uint32_t fw_feature_bitmap;
3511
Sathish Kumar7e2eaed2016-11-14 17:44:29 +05303512 /* WLAN priority GPIO number
3513 * The target uses a GPIO pin to indicate when it is transmitting
3514 * high-priority traffic (e.g. beacon, management, or AC_VI) or
3515 * low-priority traffic (e.g. AC_BE, AC_BK). The HW uses this
3516 * WLAN GPIO pin to determine whether to abort WLAN tx in favor of
3517 * BT activity.
3518 * Which GPIO is used for this WLAN tx traffic priority specification
3519 * varies between platforms, so the host needs to indicate to the
3520 * target which GPIO to use.
3521 */
3522 uint32_t wlan_priority_gpio;
3523
Sathish Kumar612d0c22017-01-19 14:57:37 +05303524 /* Host will notify target which coex algorithm has to be
3525 * enabled based on HW, FW capability and device tree config.
3526 * Till now the coex algorithms were target specific. Now the
3527 * same target can choose between multiple coex algorithms
3528 * depending on device tree config on host. For backward
3529 * compatibility, version support will have option 0 and will
3530 * rely on FW compile time flags to decide the coex version
3531 * between VERSION_1, VERSION_2 and VERSION_3. Version info is
3532 * mandatory from VERSION_4 onwards for any new coex algorithms.
3533 *
3534 * 0 = no version support
3535 * 1 = COEX_VERSION_1 (3 wire coex)
3536 * 2 = COEX_VERSION_2 (2.5 wire coex)
3537 * 3 = COEX_VERSION_3 (2.5 wire coex+duty cycle)
3538 * 4 = COEX_VERSION_4 (4 wire coex)
3539 */
3540 uint32_t coex_version;
3541
3542 /* There are multiple coex implementations on FW to support different
3543 * hardwares. Since the coex algos are mutually exclusive, host will
3544 * use below fields to send GPIO info to FW and these GPIO pins will
3545 * have different usages depending on the feature enabled. This is to
3546 * avoid adding multiple GPIO fields here for different features.
3547 *
3548 * COEX VERSION_4 (4 wire coex) :
3549 * 4 wire coex feature uses 1 common input request line from BT/ZB/
3550 * Thread which interrupts the WLAN target processor directly, 1 input
3551 * priority line from BT and ZB each, 1 output line to grant access to
3552 * requesting IOT subsystem. WLAN uses the input priority line to
3553 * identify the requesting IOT subsystem. Request is granted based on
3554 * IOT interface priority and WLAN traffic. GPIO pin usage is as below:
3555 * coex_gpio_pin_1 = BT PRIORITY INPUT GPIO
3556 * coex_gpio_pin_2 = ZIGBEE PRIORITY INPUT GPIO
3557 * coex_gpio_pin_3 = GRANT OUTPUT GPIO
3558 * when a BT active interrupt is raised, WLAN reads
3559 * BT and ZB priority input GPIO pins to compare against the coex
3560 * priority table and accordingly sets the grant output GPIO to give
3561 * access to requesting IOT subsystem.
3562 */
3563 uint32_t coex_gpio_pin_1;
3564 uint32_t coex_gpio_pin_2;
3565 uint32_t coex_gpio_pin_3;
3566
Govind Singh89727882016-04-15 13:58:27 +05303567 /* add new members here */
3568} wmi_host_ext_resource_config;
3569
3570/**
3571 * struct set_neighbour_rx_params - Neighbour RX params
3572 * @vdev_id: vdev id
3573 * @idx: index of param
3574 * @action: action
3575 * @type: Type of param
3576 */
3577struct set_neighbour_rx_params {
3578 uint8_t vdev_id;
3579 uint32_t idx;
3580 uint32_t action;
3581 uint32_t type;
3582};
3583
3584/**
3585 * struct set_fwtest_params - FW test params
3586 * @arg: FW param id
3587 * @value: value
3588 */
3589struct set_fwtest_params {
3590 uint32_t arg;
3591 uint32_t value;
3592};
3593
3594/**
3595 * struct config_ratemask_params - ratemask config parameters
3596 * @vdev_id: vdev id
3597 * @type: Type
3598 * @lower32: Lower 32 bits
3599 * @higher32: Hogher 32 bits
3600 */
3601struct config_ratemask_params {
3602 uint8_t vdev_id;
3603 uint8_t type;
3604 uint32_t lower32;
3605 uint32_t higher32;
3606};
3607
3608/**
3609 * struct peer_add_wds_entry_params - WDS peer entry add params
3610 * @dest_addr: Pointer to destination macaddr
3611 * @peer_addr: Pointer to peer mac addr
3612 * @flags: flags
3613 */
3614struct peer_add_wds_entry_params {
3615 const uint8_t *dest_addr;
3616 uint8_t *peer_addr;
3617 uint32_t flags;
3618};
3619
3620/**
3621 * struct peer_del_wds_entry_params - WDS peer entry del params
3622 * @dest_addr: Pointer to destination macaddr
3623 */
3624struct peer_del_wds_entry_params {
3625 uint8_t *dest_addr;
3626};
3627
3628/**
3629 * struct peer_updatewds_entry_params - WDS peer entry update params
3630 * @wds_macaddr: Pointer to destination macaddr
3631 * @peer_add: Pointer to peer mac addr
3632 * @flags: flags
3633 */
3634struct peer_update_wds_entry_params {
3635 uint8_t *wds_macaddr;
3636 uint8_t *peer_macaddr;
3637 uint32_t flags;
3638};
3639
3640/**
3641 * struct set_ps_mode_params - PS mode params
3642 * @vdev_id: vdev id
3643 * @psmode: PS mode
3644 */
3645struct set_ps_mode_params {
3646 uint8_t vdev_id;
3647 uint8_t psmode;
3648};
3649
3650/**
3651 * @struct tt_level_config - Set Thermal throttlling config
3652 * @tmplwm: Temperature low water mark
3653 * @tmphwm: Temperature high water mark
3654 * @dcoffpercent: dc off percentage
3655 * @priority: priority
3656 */
3657typedef struct {
3658 uint32_t tmplwm;
3659 uint32_t tmphwm;
3660 uint32_t dcoffpercent;
3661 uint32_t priority;
3662} tt_level_config;
3663
3664/**
3665 * struct thermal_mitigation_params - Thermal mitigation params
3666 * @enable: Enable/Disable Thermal mitigation
3667 * @dc: DC
3668 * @dc_per_event: DC per event
3669 * @tt_level_config: TT level config params
3670 */
3671struct thermal_mitigation_params {
3672 uint32_t enable;
3673 uint32_t dc;
3674 uint32_t dc_per_event;
3675 tt_level_config levelconf[THERMAL_LEVELS];
3676};
3677
3678/**
3679 * struct smart_ant_enable_params - Smart antenna params
3680 * @enable: Enable/Disable
3681 * @mode: SA mode
3682 * @rx_antenna: RX antenna config
Govind Singh41da3152016-05-06 20:20:25 +05303683 * @gpio_pin : GPIO pin config
3684 * @gpio_func : GPIO function config
Govind Singh89727882016-04-15 13:58:27 +05303685 */
3686struct smart_ant_enable_params {
3687 uint32_t enable;
3688 uint32_t mode;
3689 uint32_t rx_antenna;
Govind Singh41da3152016-05-06 20:20:25 +05303690 uint32_t gpio_pin[WMI_HAL_MAX_SANTENNA];
3691 uint32_t gpio_func[WMI_HAL_MAX_SANTENNA];
Govind Singh89727882016-04-15 13:58:27 +05303692};
3693
3694/**
3695 * struct smart_ant_rx_ant_params - RX antenna params
3696 * @antenna: RX antenna
3697 */
3698struct smart_ant_rx_ant_params {
3699 uint32_t antenna;
3700};
3701
3702/**
3703 * struct smart_ant_tx_ant_params - TX antenna param
3704 * @antenna_array: Antenna arry
3705 * @vdev_id: VDEV id
3706 */
3707struct smart_ant_tx_ant_params {
3708 uint32_t *antenna_array;
3709 uint8_t vdev_id;
3710};
3711
3712/**
3713 * struct smart_ant_training_info_params - SA training params
3714 * @vdev_id: VDEV id
3715 * @rate_array: Rates array
3716 * @antenna_array: Antenna array
3717 * @numpkts: num packets for training
3718 */
3719struct smart_ant_training_info_params {
3720 uint8_t vdev_id;
3721 uint32_t *rate_array;
3722 uint32_t *antenna_array;
3723 uint32_t numpkts;
3724};
3725
3726/**
3727 * struct smart_ant_node_config_params - SA node config params
3728 * @vdev_id: VDEV id
3729 * @cmd_id: Command id
3730 * @args_count: Arguments count
3731 */
3732struct smart_ant_node_config_params {
3733 uint8_t vdev_id;
3734 uint32_t cmd_id;
3735 uint16_t args_count;
3736 uint32_t *args_arr;
3737};
3738/**
3739 * struct smart_ant_enable_tx_feedback_params - SA tx feeback params
3740 * @enable: Enable TX feedback for SA
3741 */
3742struct smart_ant_enable_tx_feedback_params {
3743 int enable;
3744};
3745
3746/**
3747 * struct vdev_spectral_configure_params - SPectral config params
3748 * @vdev_id: VDEV id
3749 * @count: count
3750 * @period: period
3751 * @spectral_pri: Spectral priority
3752 * @fft_size: FFT size
3753 * @gc_enable: GC enable
3754 * @restart_enable: restart enabled
3755 * @noise_floor_ref: Noise floor reference
3756 * @init_delay: Init delays
3757 * @nb_tone_thr: NB tone threshold
3758 * @str_bin_thr: STR BIN threshold
3759 * @wb_rpt_mode: WB BIN threshold
3760 * @rssi_rpt_mode: RSSI report mode
3761 * @rssi_thr: RSSI threshold
3762 * @pwr_format: Power format
3763 * @rpt_mode: Report mdoe
3764 * @bin_scale: BIN scale
3765 * @dBm_adj: DBM adjust
3766 * @chn_mask: chain mask
3767 */
3768struct vdev_spectral_configure_params {
3769 uint8_t vdev_id;
3770 uint16_t count;
3771 uint16_t period;
3772 uint16_t spectral_pri;
3773 uint16_t fft_size;
3774 uint16_t gc_enable;
3775 uint16_t restart_enable;
3776 uint16_t noise_floor_ref;
3777 uint16_t init_delay;
3778 uint16_t nb_tone_thr;
3779 uint16_t str_bin_thr;
3780 uint16_t wb_rpt_mode;
3781 uint16_t rssi_rpt_mode;
3782 uint16_t rssi_thr;
3783 uint16_t pwr_format;
3784 uint16_t rpt_mode;
3785 uint16_t bin_scale;
3786 uint16_t dBm_adj;
3787 uint16_t chn_mask;
3788};
3789
3790/**
3791 * struct vdev_spectral_enable_params - Spectral enabled params
3792 * @vdev_id: VDEV id
3793 * @active_valid: Active valid
3794 * @active: active
3795 * @enabled_valid: Enabled valid
3796 * @enabled: enabled
3797 */
3798struct vdev_spectral_enable_params {
3799 uint8_t vdev_id;
3800 uint8_t active_valid;
3801 uint8_t active;
3802 uint8_t enabled_valid;
3803 uint8_t enabled;
3804};
3805
3806/**
3807 * struct pdev_set_regdomain_params - PDEV set reg domain params
3808 * @currentRDinuse: Current Reg domain
3809 * @currentRD2G: Current Reg domain 2G
3810 * @currentRD5G: Current Reg domain 5G
3811 * @ctl_2G: CTL 2G
3812 * @ctl_5G: CTL 5G
3813 * @dfsDomain: DFS domain
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05303814 * @pdev_id: pdev_id
Govind Singh89727882016-04-15 13:58:27 +05303815 */
3816struct pdev_set_regdomain_params {
3817 uint16_t currentRDinuse;
3818 uint16_t currentRD2G;
3819 uint16_t currentRD5G;
3820 uint32_t ctl_2G;
3821 uint32_t ctl_5G;
3822 uint8_t dfsDomain;
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05303823 uint32_t pdev_id;
Govind Singh89727882016-04-15 13:58:27 +05303824};
3825
3826/**
3827 * struct set_quiet_mode_params - Set quiet mode params
3828 * @enabled: Enabled
3829 * @period: Quite period
3830 * @intval: Quite interval
3831 * @duration: Quite duration
3832 * @offset: offset
3833 */
3834struct set_quiet_mode_params {
3835 uint8_t enabled;
3836 uint8_t period;
3837 uint16_t intval;
3838 uint16_t duration;
3839 uint16_t offset;
3840};
3841
3842/**
3843 * struct set_beacon_filter_params - Set beacon filter params
3844 * @vdev_id: VDEV id
3845 * @ie: Pointer to IE fields
3846 */
3847struct set_beacon_filter_params {
3848 uint8_t vdev_id;
3849 uint32_t *ie;
3850};
3851
3852/**
3853 * struct remove_beacon_filter_params - Remove beacon filter params
3854 * @vdev_id: VDEV id
3855 */
3856struct remove_beacon_filter_params {
3857 uint8_t vdev_id;
3858};
3859
3860/**
3861 * struct mgmt_params - Mgmt params
3862 * @vdev_id: vdev id
3863 * @buf_len: lenght of frame buffer
3864 * @wbuf: frame buffer
3865 */
3866struct mgmt_params {
3867 int vdev_id;
3868 uint32_t buf_len;
3869 qdf_nbuf_t wbuf;
3870};
3871
3872/**
3873 * struct addba_clearresponse_params - Addba clear response params
3874 * @vdev_id: VDEV id
3875 */
3876struct addba_clearresponse_params {
3877 uint8_t vdev_id;
3878};
3879
3880/**
3881 * struct addba_send_params - ADDBA send params
3882 * @vdev_id: vdev id
3883 * @tidno: TID
3884 * @buffersize: buffer size
3885 */
3886struct addba_send_params {
3887 uint8_t vdev_id;
3888 uint8_t tidno;
3889 uint16_t buffersize;
3890};
3891
3892/**
3893 * struct delba_send_params - DELBA send params
3894 * @vdev_id: vdev id
3895 * @tidno: TID
3896 * @initiator: initiator
3897 * @reasoncode: reason code
3898 */
3899struct delba_send_params {
3900 uint8_t vdev_id;
3901 uint8_t tidno;
3902 uint8_t initiator;
3903 uint16_t reasoncode;
3904};
3905/**
3906 * struct addba_setresponse_arams - Set ADDBA response params
3907 * @vdev_id: vdev id
3908 * @tidno: TID
3909 * @statuscode: status code in response
3910 */
3911struct addba_setresponse_params {
3912 uint8_t vdev_id;
3913 uint8_t tidno;
3914 uint16_t statuscode;
3915};
3916
3917/**
3918 * struct singleamsdu_params - Single AMSDU params
3919 * @vdev_id: vdev is
3920 * @tidno: TID
3921 */
3922struct singleamsdu_params {
3923 uint8_t vdev_id;
3924 uint8_t tidno;
3925};
3926
3927/**
3928 * struct set_qbosst_params - Set QBOOST params
3929 * @vdev_id: vdev id
3930 * @value: value
3931 */
3932struct set_qboost_params {
3933 uint8_t vdev_id;
3934 uint32_t value;
3935};
3936
3937/**
3938 * struct mu_scan_params - MU scan params
3939 * @id: id
3940 * @type: type
3941 * @duration: Duration
3942 * @lteu_tx_power: LTEU tx power
3943 */
3944struct mu_scan_params {
3945 uint8_t id;
3946 uint8_t type;
3947 uint32_t duration;
3948 uint32_t lteu_tx_power;
Sathish Kumar7e2eaed2016-11-14 17:44:29 +05303949 uint32_t rssi_thr_bssid;
3950 uint32_t rssi_thr_sta;
3951 uint32_t rssi_thr_sc;
3952 uint32_t plmn_id;
3953 uint32_t alpha_num_bssid;
Govind Singh89727882016-04-15 13:58:27 +05303954};
3955
3956/**
3957 * struct lteu_config_params - LTEU config params
3958 * @lteu_gpio_start: start MU/AP scan after GPIO toggle
3959 * @lteu_num_bins: no. of elements in the following arrays
3960 * @use_actual_nf: whether to use the actual NF obtained or a hardcoded one
3961 * @lteu_weight: weights for MU algo
3962 * @lteu_thresh: thresholds for MU algo
3963 * @lteu_gamma: gamma's for MU algo
3964 * @lteu_scan_timeout: timeout in ms to gpio toggle
3965 * @alpha_num_ssid: alpha for num active bssid calculation
3966 * @wifi_tx_power: Wifi Tx power
3967 */
3968struct lteu_config_params {
3969 uint8_t lteu_gpio_start;
3970 uint8_t lteu_num_bins;
3971 uint8_t use_actual_nf;
3972 uint32_t lteu_weight[LTEU_MAX_BINS];
3973 uint32_t lteu_thresh[LTEU_MAX_BINS];
3974 uint32_t lteu_gamma[LTEU_MAX_BINS];
3975 uint32_t lteu_scan_timeout;
3976 uint32_t alpha_num_bssid;
3977 uint32_t wifi_tx_power;
Sathish Kumar7e2eaed2016-11-14 17:44:29 +05303978 uint32_t allow_err_packets;
Govind Singh89727882016-04-15 13:58:27 +05303979};
3980
3981struct wmi_macaddr_t {
3982 /** upper 4 bytes of MAC address */
3983 uint32_t mac_addr31to0;
3984 /** lower 2 bytes of MAC address */
3985 uint32_t mac_addr47to32;
3986};
3987
3988/**
3989 * struct atf_peer_info - ATF peer info params
3990 * @peer_macaddr: peer mac addr
3991 * @percentage_peer: percentage of air time for this peer
3992 */
3993typedef struct {
3994 struct wmi_macaddr_t peer_macaddr;
3995 uint32_t percentage_peer;
3996} atf_peer_info;
3997
3998/**
Sathish Kumar50232d72016-08-09 16:50:46 +05303999 * struct bwf_peer_info_t - BWF peer info params
4000 * @peer_macaddr: peer mac addr
4001 * @throughput: Throughput
4002 * @max_airtime: Max airtime
4003 * @priority: Priority level
4004 * @reserved: Reserved array
4005 */
4006typedef struct {
4007 struct wmi_macaddr_t peer_macaddr;
4008 uint32_t throughput;
4009 uint32_t max_airtime;
4010 uint32_t priority;
4011 uint32_t reserved[4];
4012} bwf_peer_info;
4013
4014/**
4015 * struct set_bwf_params - BWF params
4016 * @num_peers: number of peers
4017 * @atf_peer_info: BWF peer info
4018 */
4019struct set_bwf_params {
4020 uint32_t num_peers;
4021 bwf_peer_info peer_info[1];
4022};
4023
4024/**
Govind Singh89727882016-04-15 13:58:27 +05304025 * struct set_atf_params - ATF params
4026 * @num_peers: number of peers
4027 * @atf_peer_info: ATF peer info
4028 */
4029struct set_atf_params {
4030 uint32_t num_peers;
4031 atf_peer_info peer_info[ATF_ACTIVED_MAX_CLIENTS];
4032};
4033
4034/**
4035 * struct atf_peer_ext_info - ATF peer ext info params
4036 * @peer_macaddr: peer mac address
4037 * @group_index: group index
4038 * @atf_index_reserved: ATF index rsvd
4039 */
4040typedef struct {
4041 struct wmi_macaddr_t peer_macaddr;
4042 uint32_t group_index;
4043 uint32_t atf_index_reserved;
4044} atf_peer_ext_info;
4045
4046/**
4047 * struct atf_peer_request_params - ATF peer req params
4048 * @num_peers: number of peers
4049 * @atf_peer_ext_info: ATF peer ext info
4050 */
4051struct atf_peer_request_params {
4052 uint32_t num_peers;
4053 atf_peer_ext_info peer_ext_info[ATF_ACTIVED_MAX_CLIENTS];
4054};
4055
4056/**
4057 * struct atf_group_info - ATF group info params
4058 * @percentage_group: Percentage AT for group
4059 * @atf_group_units_reserved: ATF group information
4060 */
4061typedef struct {
4062 uint32_t percentage_group;
4063 uint32_t atf_group_units_reserved;
4064} atf_group_info;
4065
4066/**
4067 * struct atf_grouping_params - ATF grouping params
4068 * @num_groups: number of groups
4069 * @group_inf: Group informaition
4070 */
4071struct atf_grouping_params {
4072 uint32_t num_groups;
4073 atf_group_info group_info[ATF_ACTIVED_MAX_ATFGROUPS];
4074};
4075
4076/**
4077 * struct wlan_profile_params - WLAN profile params
4078 * @param_id: param id
4079 * @profile_id: profile id
4080 * @enable: enable
4081 */
4082struct wlan_profile_params {
4083 uint32_t param_id;
4084 uint32_t profile_id;
4085 uint32_t enable;
4086};
4087
4088/* struct ht_ie_params - HT IE params
4089 * @ie_len: IE length
4090 * @ie_data: pointer to IE data
4091 */
4092struct ht_ie_params {
4093 uint32_t ie_len;
4094 uint8_t *ie_data;
4095};
4096
4097/* struct vht_ie_params - VHT IE params
4098 * @ie_len: IE length
4099 * @ie_data: pointer to IE data
4100 */
4101struct vht_ie_params {
4102 uint32_t ie_len;
4103 uint8_t *ie_data;
4104};
4105
4106/**
4107 * struct wmi_host_wmeParams - WME params
4108 * @wmep_acm: ACM paramete
4109 * @wmep_aifsn: AIFSN parameters
4110 * @wmep_logcwmin: cwmin in exponential form
4111 * @wmep_logcwmax: cwmax in exponential form
4112 * @wmep_txopLimit: txopLimit
4113 * @wmep_noackPolicy: No-Ack Policy: 0=ack, 1=no-ack
4114 */
4115struct wmi_host_wmeParams {
4116 u_int8_t wmep_acm;
4117 u_int8_t wmep_aifsn;
4118 u_int8_t wmep_logcwmin;
4119 u_int8_t wmep_logcwmax;
4120 u_int16_t wmep_txopLimit;
4121 u_int8_t wmep_noackPolicy;
4122};
4123
4124/**
4125 * struct wmm_update_params - WMM update params
4126 * @wmep_array: WME params for each AC
4127 */
4128struct wmm_update_params {
4129 struct wmi_host_wmeParams *wmep_array;
4130};
4131
4132/**
4133 * struct ant_switch_tbl_params - Antenna switch table params
4134 * @ant_ctrl_common1: ANtenna control common param 1
4135 * @ant_ctrl_common2: Antenna control commn param 2
4136 */
4137struct ant_switch_tbl_params {
4138 uint32_t ant_ctrl_common1;
4139 uint32_t ant_ctrl_common2;
4140};
4141
4142/**
4143 * struct ratepwr_table_params - Rate power table params
4144 * @ratepwr_tbl: pointer to rate power table
4145 * @ratepwr_len: rate power table len
4146 */
4147struct ratepwr_table_params {
4148 uint8_t *ratepwr_tbl;
4149 uint16_t ratepwr_len;
4150};
4151
4152/**
4153 * struct ctl_table_params - Ctl table params
4154 * @ctl_array: pointer to ctl array
Sathish Kumar990089f2016-11-09 11:44:50 +05304155 * @ctl_cmd_len: ctl command length
Govind Singh89727882016-04-15 13:58:27 +05304156 * @is_acfg_ctl: is acfg_ctl table
4157 */
4158struct ctl_table_params {
4159 uint8_t *ctl_array;
Sathish Kumar990089f2016-11-09 11:44:50 +05304160 uint16_t ctl_cmd_len;
Nandha Kishore Easwaranda8e13c2016-10-14 15:22:05 +05304161 uint32_t target_type;
4162 bool is_2g;
Sathish Kumar990089f2016-11-09 11:44:50 +05304163 uint32_t ctl_band;
Govind Singh89727882016-04-15 13:58:27 +05304164};
4165
4166/**
4167 * struct mimogain_table_params - MIMO gain table params
4168 * @array_gain: pointer to array gain table
4169 * @tbl_len: table length
4170 * @multichain_gain_bypass: bypass multichain gain
4171 */
4172struct mimogain_table_params {
4173 uint8_t *array_gain;
4174 uint16_t tbl_len;
4175 bool multichain_gain_bypass;
4176};
4177
4178/**
4179 * struct ratepwr_chainmask_params - Rate power chainmask params
4180 * @ratepwr_chain_tbl: pointer to ratepwr chain table
4181 * @num_rate: number of rate in table
4182 * @pream_type: preamble type
4183 * @ops: ops
4184 */
4185struct ratepwr_chainmsk_params {
4186 uint32_t *ratepwr_chain_tbl;
4187 uint16_t num_rate;
4188 uint8_t pream_type;
4189 uint8_t ops;
4190};
4191
4192struct macaddr_params {
4193 uint8_t *macaddr;
4194};
4195
4196/**
4197 * struct acparams_params - acparams config structure
4198 * @ac: AC to configure
4199 * @use_rts: Use rts for this AC
4200 * @aggrsize_scaling: Aggregrate size scaling for the AC
4201 * @min_kbps: min kbps req
4202 */
4203struct acparams_params {
4204 uint8_t ac;
4205 uint8_t use_rts;
4206 uint8_t aggrsize_scaling;
4207 uint32_t min_kbps;
4208};
4209
4210/**
4211 * struct vap_dscp_tid_map_params - DSCP tid map params
4212 * @vdev_id: vdev id
4213 * @dscp_to_tid_map: pointer to arry of tid to dscp map table
4214 */
4215struct vap_dscp_tid_map_params {
4216 uint8_t vdev_id;
4217 uint32_t *dscp_to_tid_map;
4218};
4219
4220/**
4221 * struct proxy_ast_reserve_params - Proxy AST reserve params
4222 * @macaddr: macaddr for proxy ast entry
4223 */
4224struct proxy_ast_reserve_params {
4225 uint8_t *macaddr;
4226};
4227
4228/**
4229 * struct fips_params - FIPS params config
4230 * @key: pointer to key
4231 * @key_len: length of key
4232 * @data: pointer data buf
Nandha Kishore Easwaran2ccd4242017-01-09 21:33:00 +05304233 * @data_len: lenght of data buf
Govind Singh89727882016-04-15 13:58:27 +05304234 * @mode: mode
4235 * @op: operation
Nandha Kishore Easwaran2ccd4242017-01-09 21:33:00 +05304236 * @pdev_id: pdev_id for identifying the MAC
Govind Singh89727882016-04-15 13:58:27 +05304237 */
4238struct fips_params {
4239 uint8_t *key;
4240 uint32_t key_len;
4241 uint8_t *data;
4242 uint32_t data_len;
4243 uint32_t mode;
4244 uint32_t op;
Nandha Kishore Easwaran2ccd4242017-01-09 21:33:00 +05304245 uint32_t pdev_id;
Govind Singh89727882016-04-15 13:58:27 +05304246};
4247
4248/**
4249 * struct mcast_group_update_param - Mcast group table update to target
4250 * @action: Addition/deletion
4251 * @wildcard: iwldcard table entry?
4252 * @mcast_ip_addr: mcast ip address to be updated
4253 * @mcast_ip_addr_bytes: mcast ip addr bytes
4254 * @ucast_mac_addr: ucast peer mac subscribed to mcast ip
4255 * @filter_mode: filter mode
4256 * @nsrcs: number of entries in source list
4257 * @srcs: source mac accpted
4258 * @mask: mask
4259 * @vap_id: vdev id
4260 * @is_action_delete: is delete
4261 * @is_filter_mode_snoop:
4262 * @is_mcast_addr_len:
4263 */
4264struct mcast_group_update_params {
4265 int action;
4266 int wildcard;
4267 uint8_t *mcast_ip_addr;
4268 int mcast_ip_addr_bytes;
4269 uint8_t *ucast_mac_addr;
4270 uint8_t filter_mode;
4271 uint8_t nsrcs;
4272 uint8_t *srcs;
4273 uint8_t *mask;
4274 uint8_t vap_id;
4275 bool is_action_delete;
4276 bool is_filter_mode_snoop;
4277 bool is_mcast_addr_len;
4278};
4279
4280/**
4281 * struct periodic_chan_stats_param - periodic channel stats req param
4282 * @stats_period: stats period update
4283 * @enable: enable/disable
4284 */
4285struct periodic_chan_stats_params {
4286 uint32_t stats_period;
4287 bool enable;
4288};
4289
4290/**
4291 * struct packet_power_info_params - packet power info params
4292 * @rate_flags: rate flags
4293 * @nss: number of spatial streams
4294 * @preamble: preamble
4295 * @hw_rate:
4296 */
4297struct packet_power_info_params {
4298 uint16_t rate_flags;
4299 uint16_t nss;
4300 uint16_t preamble;
4301 uint16_t hw_rate;
4302};
4303
4304/**
4305 * WMI_GPIO_CONFIG_CMDID
4306 */
4307enum {
4308 WMI_HOST_GPIO_PULL_NONE,
4309 WMI_HOST_GPIO_PULL_UP,
4310 WMI_HOST_GPIO_PULL_DOWN,
4311};
4312
4313/**
4314 * WMI_GPIO_INTTYPE
4315 */
4316enum {
4317 WMI_HOST_GPIO_INTTYPE_DISABLE,
4318 WMI_HOST_GPIO_INTTYPE_RISING_EDGE,
4319 WMI_HOST_GPIO_INTTYPE_FALLING_EDGE,
4320 WMI_HOST_GPIO_INTTYPE_BOTH_EDGE,
4321 WMI_HOST_GPIO_INTTYPE_LEVEL_LOW,
4322 WMI_HOST_GPIO_INTTYPE_LEVEL_HIGH
4323};
4324
4325/**
4326 * struct wmi_host_gpio_input_event - GPIO input event structure
4327 * @gpio_num: GPIO number which changed state
4328 */
4329typedef struct {
4330 uint32_t gpio_num; /* GPIO number which changed state */
4331} wmi_host_gpio_input_event;
4332
4333/**
4334 * struct gpio_config_params - GPIO config params
4335 * @gpio_num: GPIO number to config
4336 * @input: input/output
4337 * @pull_type: pull type
4338 * @intr_mode: int mode
4339 */
4340struct gpio_config_params {
4341 uint32_t gpio_num;
4342 uint32_t input;
4343 uint32_t pull_type;
4344 uint32_t intr_mode;
4345};
4346
4347/**
4348 * struct gpio_output_params - GPIO output params
4349 * @gpio_num: GPIO number to configure
4350 * @set: set/reset
4351 */
4352struct gpio_output_params {
4353 uint32_t gpio_num;
4354 uint32_t set;
4355};
4356
Sathish Kumar7e566c52016-11-10 15:30:22 +05304357/* flags bit 0: to configure wlan priority bitmap */
4358#define WMI_HOST_BTCOEX_PARAM_FLAGS_WLAN_PRIORITY_BITMAP_BIT (1<<0)
4359/* flags bit 1: to configure both period and wlan duration */
4360#define WMI_HOST_BTCOEX_PARAM_FLAGS_DUTY_CYCLE_BIT (1<<1)
4361struct btcoex_cfg_params {
4362 /* WLAN priority bitmask for different frame types */
4363 uint32_t btcoex_wlan_priority_bitmap;
4364 /* This command is used to configure different btcoex params
4365 * in different situations.The host sets the appropriate bit(s)
4366 * in btcoex_param_flags to indicate which configuration parameters
4367 * are valid within a particular BT coex config message, so that one
4368 * BT configuration parameter can be configured without affecting
4369 * other BT configuration parameters.E.g. if the host wants to
4370 * configure only btcoex_wlan_priority_bitmap it sets only
4371 * WMI_BTCOEX_PARAM_FLAGS_WLAN_PRIORITY_BITMAP_BIT in
4372 * btcoex_param_flags so that firmware will not overwrite
4373 * other params with default value passed in the command.
4374 * Host can also set multiple bits in btcoex_param_flags
4375 * to configure more than one param in single message.
4376 */
4377 uint32_t btcoex_param_flags;
4378 /* period denotes the total time in milliseconds which WLAN and BT share
4379 * configured percentage for transmission and reception.
4380 */
4381 uint32_t period;
4382 /* wlan duration is the time in milliseconds given for wlan
4383 * in above period.
4384 */
4385 uint32_t wlan_duration;
4386};
4387
Sathish Kumar612d0c22017-01-19 14:57:37 +05304388#define WMI_HOST_COEX_CONFIG_BUF_MAX_LEN 32 /* 128 bytes */
4389/**
4390 * coex_ver_cfg_t
4391 * @coex_version: Version for 4 wire coex
4392 * @length: Length of payload buffer based on version
4393 * @config_buf: Payload Buffer
4394 */
4395typedef struct {
4396 /* VERSION_4 (4 wire coex) */
4397 uint32_t coex_version;
4398
4399 /* No. of A_UINT32 elements in payload buffer. Will depend on the coex
4400 * version
4401 */
4402 uint32_t length;
4403
4404 /* Payload buffer */
4405 uint32_t config_buf[WMI_HOST_COEX_CONFIG_BUF_MAX_LEN];
4406} coex_ver_cfg_t;
Sathish Kumar7e566c52016-11-10 15:30:22 +05304407
Govind Singh89727882016-04-15 13:58:27 +05304408#define WMI_HOST_RTT_REPORT_CFR 0
4409#define WMI_HOST_RTT_NO_REPORT_CFR 1
4410#define WMI_HOST_RTT_AGGREGATE_REPORT_NON_CFR 2
4411/**
4412 * struct rtt_meas_req_test_params
4413 * @peer: peer mac address
4414 * @req_frame_type: RTT request frame type
4415 * @req_bw: requested bandwidth
4416 * @req_preamble: Preamble
4417 * @req_num_req: num of requests
4418 * @req_report_type: report type
4419 * @num_measurements: number of measurements
4420 * @asap_mode: priority
4421 * @lci_requested: LCI requested
4422 * @loc_civ_requested:
4423 * @channel_param: channel param
4424 * @req_id: requested id
4425 */
4426struct rtt_meas_req_test_params {
4427 uint8_t peer[IEEE80211_ADDR_LEN];
4428 int req_frame_type;
4429 int req_bw;
4430 int req_preamble;
4431 int req_num_req;
4432 int req_report_type;
4433 uint32_t num_measurements;
4434 uint32_t asap_mode;
4435 uint32_t lci_requested;
4436 uint32_t loc_civ_requested;
4437 struct channel_param channel;
4438 uint8_t req_id;
4439};
4440
4441/**
4442 * struct rtt_meas_req_params - RTT measurement request params
4443 * @req_id: Request id
4444 * @vdev_id: vdev id
4445 * @sta_mac_addr: pointer to station mac address
4446 * @spoof_mac_addr: pointer to spoof mac address
4447 * @is_mode_na: 11NA
4448 * @is_mode_ac: AC
4449 * @is_bw_20: 20
4450 * @is_bw_40: 40
4451 * @is_bw_80: 80
4452 * @num_probe_rqst: number of probe request
4453 * @channel_param: channel param
4454 */
4455struct rtt_meas_req_params {
4456 uint8_t req_id;
4457 uint8_t vdev_id;
4458 uint8_t *sta_mac_addr;
4459 uint8_t *spoof_mac_addr;
4460 bool is_mode_na;
4461 bool is_mode_ac;
4462 bool is_bw_20;
4463 bool is_bw_40;
4464 bool is_bw_80;
4465 uint32_t num_probe_rqst;
4466 struct channel_param channel;
4467};
4468
4469/**
4470 * struct lci_set_params - LCI params
4471 * @lci_data: pointer to LCI data
4472 * @latitude_unc: latitude
4473 * @latitude_0_12: bits 0 to 1 of latitude
4474 * @latitude_2_33: bits 2 to 33 of latitude
4475 * @longitude_unc: longitude
4476 * @longitude_0_1: bits 0 to 1 of longitude
4477 * @longitude_2_33: bits 2 to 33 of longitude
4478 * @altitude_type: altitude type
4479 * @altitude_unc_0_3: altitude bits 0 - 3
4480 * @altitude_unc_4_5: altitude bits 4 - 5
4481 * @altitude: altitude
4482 * @datum: dataum
4483 * @reg_loc_agmt:
4484 * @reg_loc_dse:
4485 * @dep_sta:
4486 * @version: version
4487 */
4488struct lci_set_params {
4489 void *lci_data;
4490 uint8_t latitude_unc:6,
4491 latitude_0_1:2;
4492 uint32_t latitude_2_33;
4493 uint8_t longitude_unc:6,
4494 longitude_0_1:2;
4495 uint32_t longitude_2_33;
4496 uint8_t altitude_type:4,
4497 altitude_unc_0_3:4;
4498 uint32_t altitude_unc_4_5:2,
4499 altitude:30;
4500 uint8_t datum:3,
4501 reg_loc_agmt:1,
4502 reg_loc_dse:1,
4503 dep_sta:1,
4504 version:2;
Sathish Kumar38bf0d82016-10-20 14:07:21 +05304505 uint8_t *colocated_bss;
4506 int msg_len;
Govind Singh89727882016-04-15 13:58:27 +05304507};
4508
4509/**
4510 * struct lcr_set_params - LCR params
4511 * @lcr_data: pointer to lcr data
4512 */
4513struct lcr_set_params {
4514 void *lcr_data;
Sathish Kumar38bf0d82016-10-20 14:07:21 +05304515 int msg_len;
Govind Singh89727882016-04-15 13:58:27 +05304516};
4517
4518/**
4519 * struct rtt_keepalive_req_params - RTT keepalive params
4520 * @macaddr: pointer to macaddress
4521 * @req_id: Request id
4522 * @vdev_id: vdev id
4523 * @stop: start/stop
4524 */
4525struct rtt_keepalive_req_params {
4526 uint8_t *macaddr;
4527 uint8_t req_id;
4528 uint8_t vdev_id;
4529 bool stop;
4530};
4531
4532/**
Leo Chang8184e9c2016-09-28 13:43:36 -07004533 * struct rx_reorder_queue_setup_params - Reorder queue setup params
4534 * @peer_mac_addr: Peer mac address
4535 * @tid: TID
4536 * @vdev_id: vdev id
4537 * @hw_qdesc_paddr_lo: lower 32 bits of queue desc adddress
4538 * @hw_qdesc_paddr_hi: upper 32 bits of queue desc adddress
4539 * @queue_no: 16-bit number assigned by host for queue
4540 */
4541struct rx_reorder_queue_setup_params {
4542 uint8_t *peer_macaddr;
4543 uint16_t tid;
4544 uint16_t vdev_id;
4545 uint32_t hw_qdesc_paddr_lo;
4546 uint32_t hw_qdesc_paddr_hi;
4547 uint16_t queue_no;
4548};
4549
4550/**
4551 * struct rx_reorder_queue_remove_params - Reorder queue setup params
4552 * @peer_mac_addr: Peer mac address
4553 * @vdev_id: vdev id
4554 * @peer_tid_bitmap: peer tid bitmap
4555 */
4556struct rx_reorder_queue_remove_params {
4557 uint8_t *peer_macaddr;
4558 uint16_t vdev_id;
4559 uint32_t peer_tid_bitmap;
4560};
4561
4562/**
Govind Singh89727882016-04-15 13:58:27 +05304563 * struct wmi_host_stats_event - Stats event params
4564 * @stats_id: stats id of type wmi_host_stats_event
4565 * @num_pdev_stats: number of pdev stats event structures 0 or 1
4566 * @num_pdev_ext_stats: number of pdev ext stats event structures
4567 * @num_vdev_stats: number of vdev stats
4568 * @num_peer_stats: number of peer stats event structures 0 or max peers
4569 * @num_bcnflt_stats: number of beacon filter stats
4570 * @num_chan_stats: number of channel stats
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05304571 * @pdev_id: pdev_id
Govind Singh89727882016-04-15 13:58:27 +05304572 */
4573typedef struct {
4574 wmi_host_stats_id stats_id;
4575 uint32_t num_pdev_stats;
4576 uint32_t num_pdev_ext_stats;
4577 uint32_t num_vdev_stats;
4578 uint32_t num_peer_stats;
4579 uint32_t num_bcnflt_stats;
4580 uint32_t num_chan_stats;
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05304581 uint32_t pdev_id;
Govind Singh89727882016-04-15 13:58:27 +05304582} wmi_host_stats_event;
4583
4584/**
Govind Singh89727882016-04-15 13:58:27 +05304585 * struct wmi_host_peer_extd_stats - peer extd stats event structure
4586 * @peer_macaddr: Peer mac address
4587 * @inactive_time: inactive time in secs
4588 * @peer_chain_rssi: peer rssi
4589 * @rx_duration: RX duration
4590 * @peer_tx_bytes: TX bytes
4591 * @peer_rx_bytes: RX bytes
4592 * @last_tx_rate_code: Tx rate code of last frame
4593 * @last_tx_power: Tx power latest
4594 * @atf_tokens_allocated: atf tokens allocated
4595 * @atf_tokens_utilized: atf tokens utilized
4596 * @reserved: for future use
4597 */
4598typedef struct {
4599 wmi_host_mac_addr peer_macaddr;
4600 uint32_t inactive_time;
4601 uint32_t peer_chain_rssi;
4602 uint32_t rx_duration;
4603 uint32_t peer_tx_bytes;
4604 uint32_t peer_rx_bytes;
4605 uint32_t last_tx_rate_code;
4606 uint32_t last_tx_power;
4607 uint32_t atf_tokens_allocated;
4608 uint32_t atf_tokens_utilized;
4609 uint32_t reserved[4];
4610} wmi_host_peer_extd_stats;
4611
4612/**
4613 * struct wmi_host_pdev_ext_stats - peer ext stats structure
4614 * @rx_rssi_comb: RX rssi
4615 * @rx_rssi_chain0: RX rssi chain 0
4616 * @rx_rssi_chain1: RX rssi chain 1
4617 * @rx_rssi_chain2: RX rssi chain 2
4618 * @rx_rssi_chain3: RX rssi chain 3
4619 * @rx_mcs: RX MCS array
4620 * @tx_mcs: TX MCS array
4621 * @ack_rssi: Ack rssi
4622 */
4623typedef struct {
4624 uint32_t rx_rssi_comb;
4625 uint32_t rx_rssi_chain0;
4626 uint32_t rx_rssi_chain1;
4627 uint32_t rx_rssi_chain2;
4628 uint32_t rx_rssi_chain3;
4629 uint32_t rx_mcs[10];
4630 uint32_t tx_mcs[10];
4631 uint32_t ack_rssi;
4632} wmi_host_pdev_ext_stats;
4633
4634/**
4635 * struct wmi_host_dbg_tx_stats - Debug stats
4636 * @comp_queued: Num HTT cookies queued to dispatch list
4637 * @comp_delivered: Num HTT cookies dispatched
4638 * @msdu_enqued: Num MSDU queued to WAL
4639 * @mpdu_enqued: Num MPDU queue to WAL
4640 * @wmm_drop: Num MSDUs dropped by WMM limit
4641 * @local_enqued: Num Local frames queued
4642 * @local_freed: Num Local frames done
4643 * @hw_queued: Num queued to HW
4644 * @hw_reaped: Num PPDU reaped from HW
4645 * @underrun: Num underruns
4646 * @hw_paused: HW Paused.
4647 * @tx_abort: Num PPDUs cleaned up in TX abort
4648 * @mpdus_requed: Num MPDUs requed by SW
4649 * @tx_ko: excessive retries
4650 * @tx_xretry:
4651 * @data_rc: data hw rate code
4652 * @self_triggers: Scheduler self triggers
4653 * @sw_retry_failure: frames dropped due to excessive sw retries
4654 * @illgl_rate_phy_err: illegal rate phy errors
4655 * @pdev_cont_xretry: wal pdev continous xretry
4656 * @pdev_tx_timeout: wal pdev continous xretry
4657 * @pdev_resets: wal pdev resets
4658 * @stateless_tid_alloc_failure: frames dropped due to non-availability of
4659 * stateless TIDs
4660 * @phy_underrun: PhY/BB underrun
4661 * @txop_ovf: MPDU is more than txop limit
4662 * @seq_posted: Number of Sequences posted
4663 * @seq_failed_queueing: Number of Sequences failed queueing
4664 * @seq_completed: Number of Sequences completed
4665 * @seq_restarted: Number of Sequences restarted
4666 * @mu_seq_posted: Number of MU Sequences posted
4667 * @mpdus_sw_flush: Num MPDUs flushed by SW, HWPAUSED, SW TXABORT
4668 * (Reset,channel change)
4669 * @mpdus_hw_filter: Num MPDUs filtered by HW, all filter condition
4670 * (TTL expired)
4671 * @mpdus_truncated: Num MPDUs truncated by PDG (TXOP, TBTT,
4672 * PPDU_duration based on rate, dyn_bw)
4673 * @mpdus_ack_failed: Num MPDUs that was tried but didn't receive ACK or BA
4674 * @mpdus_expired: Num MPDUs that was dropped du to expiry.
4675 * @mc_dropr: Num mc drops
4676 */
4677typedef struct {
4678 int32_t comp_queued;
4679 int32_t comp_delivered;
4680 int32_t msdu_enqued;
4681 int32_t mpdu_enqued;
4682 int32_t wmm_drop;
4683 int32_t local_enqued;
4684 int32_t local_freed;
4685 int32_t hw_queued;
4686 int32_t hw_reaped;
4687 int32_t underrun;
4688 uint32_t hw_paused;
4689 int32_t tx_abort;
4690 int32_t mpdus_requed;
4691 uint32_t tx_ko;
4692 uint32_t tx_xretry;
4693 uint32_t data_rc;
4694 uint32_t self_triggers;
4695 uint32_t sw_retry_failure;
4696 uint32_t illgl_rate_phy_err;
4697 uint32_t pdev_cont_xretry;
4698 uint32_t pdev_tx_timeout;
4699 uint32_t pdev_resets;
4700 uint32_t stateless_tid_alloc_failure;
4701 uint32_t phy_underrun;
4702 uint32_t txop_ovf;
4703 uint32_t seq_posted;
4704 uint32_t seq_failed_queueing;
4705 uint32_t seq_completed;
4706 uint32_t seq_restarted;
4707 uint32_t mu_seq_posted;
4708 int32_t mpdus_sw_flush;
4709 int32_t mpdus_hw_filter;
4710 int32_t mpdus_truncated;
4711 int32_t mpdus_ack_failed;
4712 int32_t mpdus_expired;
4713 uint32_t mc_drop;
4714} wmi_host_dbg_tx_stats;
4715
4716/**
4717 * struct wmi_host_dbg_rx_stats - RX Debug stats
4718 * @mid_ppdu_route_change: Cnts any change in ring routing mid-ppdu
4719 * @status_rcvd: Total number of statuses processed
4720 * @r0_frags: Extra frags on rings 0
4721 * @r1_frags: Extra frags on rings 1
4722 * @r2_frags: Extra frags on rings 2
4723 * @r3_frags: Extra frags on rings 3
4724 * @htt_msdus: MSDUs delivered to HTT
4725 * @htt_mpdus: MPDUs delivered to HTT
4726 * @loc_msdus: MSDUs delivered to local stack
4727 * @loc_mpdus: MPDUS delivered to local stack
4728 * @oversize_amsdu: AMSDUs that have more MSDUs than the status ring size
4729 * @phy_errs: Number of PHY errors
4730 * @phy_err_drop: Number of PHY errors drops
4731 * @mpdu_errs: Number of mpdu errors - FCS, MIC, ENC etc.
4732 * @pdev_rx_timeout: Number of rx inactivity timeouts
4733 * @rx_ovfl_errs: Number of rx overflow errors.
4734 */
4735typedef struct {
4736 int32_t mid_ppdu_route_change;
4737 int32_t status_rcvd;
4738 int32_t r0_frags;
4739 int32_t r1_frags;
4740 int32_t r2_frags;
4741 int32_t r3_frags;
4742 int32_t htt_msdus;
4743 int32_t htt_mpdus;
4744 int32_t loc_msdus;
4745 int32_t loc_mpdus;
4746 int32_t oversize_amsdu;
4747 int32_t phy_errs;
4748 int32_t phy_err_drop;
4749 int32_t mpdu_errs;
4750 uint32_t pdev_rx_timeout;
4751 int32_t rx_ovfl_errs;
4752} wmi_host_dbg_rx_stats;
4753
4754/** struct wmi_host_dbg_mem_stats - memory stats
4755 * @iram_free_size: IRAM free size on target
4756 * @dram_free_size: DRAM free size on target
4757 * @sram_free_size: SRAM free size on target
4758 */
4759typedef struct {
4760 uint32_t iram_free_size;
4761 uint32_t dram_free_size;
4762 /* Only Non-TLV */
4763 uint32_t sram_free_size;
4764} wmi_host_dbg_mem_stats;
4765
4766typedef struct {
4767 /* Only TLV */
4768 int32_t dummy;/* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
4769} wmi_host_dbg_peer_stats;
4770
4771/**
4772 * struct wmi_host_dbg_stats - host debug stats
4773 * @tx: TX stats of type wmi_host_dbg_tx_stats
4774 * @rx: RX stats of type wmi_host_dbg_rx_stats
4775 * @mem: Memory stats of type wmi_host_dbg_mem_stats
4776 * @peer: peer stats of type wmi_host_dbg_peer_stats
4777 */
4778typedef struct {
4779 wmi_host_dbg_tx_stats tx;
4780 wmi_host_dbg_rx_stats rx;
4781 wmi_host_dbg_mem_stats mem;
4782 wmi_host_dbg_peer_stats peer;
4783} wmi_host_dbg_stats;
4784
4785/**
4786 * struct wmi_host_pdev_stats - PDEV stats
4787 * @chan_nf: Channel noise floor
4788 * @tx_frame_count: TX frame count
4789 * @rx_frame_count: RX frame count
4790 * @rx_clear_count: rx clear count
4791 * @cycle_count: cycle count
4792 * @phy_err_count: Phy error count
4793 * @chan_tx_pwr: Channel Tx Power
4794 * @pdev_stats: WAL dbg stats
4795 * @ackRcvBad:
4796 * @rtsBad:
4797 * @rtsGood:
4798 * @fcsBad:
4799 * @noBeacons:
4800 * @mib_int_count:
4801 */
4802typedef struct {
4803 int32_t chan_nf;
4804 uint32_t tx_frame_count;
4805 uint32_t rx_frame_count;
4806 uint32_t rx_clear_count;
4807 uint32_t cycle_count;
4808 uint32_t phy_err_count;
4809 uint32_t chan_tx_pwr;
4810 wmi_host_dbg_stats pdev_stats;
4811 uint32_t ackRcvBad;
4812 uint32_t rtsBad;
4813 uint32_t rtsGood;
4814 uint32_t fcsBad;
4815 uint32_t noBeacons;
4816 uint32_t mib_int_count;
4817} wmi_host_pdev_stats;
4818
4819/**
4820 * struct wmi_host_snr_info - WMI host Signal to noise ration info
4821 * @bcn_snr: beacon SNR
4822 * @dat_snr: Data frames SNR
4823 */
4824typedef struct {
4825 int32_t bcn_snr;
4826 int32_t dat_snr;
4827} wmi_host_snr_info;
4828
4829#define WMI_HOST_MAX_TX_RATE_VALUES 10 /*Max Tx Rates */
4830#define WMI_HOST_MAX_RSSI_VALUES 10 /*Max Rssi values */
4831
4832/* The WLAN_MAX_AC macro cannot be changed without breaking
4833 * * WMI compatibility.
4834 * * The maximum value of access category
4835 * */
4836#define WMI_HOST_WLAN_MAX_AC 4
4837
4838/**
4839 * struct wmi_host_vdev_stats - vdev stats structure
4840 * @vdev_id: unique id identifying the VDEV, generated by the caller
4841 * Rest all Only TLV
4842 * @vdev_snr: wmi_host_snr_info
4843 * @tx_frm_cnt: Total number of packets(per AC) that were successfully
4844 * transmitted (with and without retries,
4845 * including multi-cast, broadcast)
4846 * @rx_frm_cnt: Total number of packets that were successfully received
4847 * (after appropriate filter rules including multi-cast, broadcast)
4848 * @multiple_retry_cnt: The number of MSDU packets and MMPDU frames per AC
4849 * that the 802.11 station successfully transmitted after
4850 * more than one retransmission attempt
4851 * @fail_cnt: Total number packets(per AC) failed to transmit
4852 * @rts_fail_cnt: Total number of RTS/CTS sequence failures for transmission
4853 * of a packet
4854 * @rts_succ_cnt: Total number of RTS/CTS sequence success for transmission
4855 * of a packet
4856 * @rx_err_cnt: The receive error count. HAL will provide the
4857 * RxP FCS error global
4858 * @rx_discard_cnt: The sum of the receive error count and
4859 * dropped-receive-buffer error count (FCS error)
4860 * @ack_fail_cnt: Total number packets failed transmit because of no
4861 * ACK from the remote entity
4862 * @tx_rate_history:History of last ten transmit rate, in units of 500 kbit/sec
4863 * @bcn_rssi_history: History of last ten Beacon rssi of the connected Bss
4864 */
4865typedef struct {
4866 uint32_t vdev_id;
4867 /* Rest all Only TLV */
4868 wmi_host_snr_info vdev_snr;
4869 uint32_t tx_frm_cnt[WMI_HOST_WLAN_MAX_AC];
4870 uint32_t rx_frm_cnt;
4871 uint32_t multiple_retry_cnt[WMI_HOST_WLAN_MAX_AC];
4872 uint32_t fail_cnt[WMI_HOST_WLAN_MAX_AC];
4873 uint32_t rts_fail_cnt;
4874 uint32_t rts_succ_cnt;
4875 uint32_t rx_err_cnt;
4876 uint32_t rx_discard_cnt;
4877 uint32_t ack_fail_cnt;
4878 uint32_t tx_rate_history[WMI_HOST_MAX_TX_RATE_VALUES];
4879 uint32_t bcn_rssi_history[WMI_HOST_MAX_RSSI_VALUES];
4880} wmi_host_vdev_stats;
4881
4882/**
4883 * struct wmi_host_vdev_extd_stats - VDEV extended stats
4884 * @vdev_id: unique id identifying the VDEV, generated by the caller
4885 * @ppdu_aggr_cnt: No of Aggrs Queued to HW
4886 * @ppdu_noack: No of PPDU's not Acked includes both aggr and nonaggr's
4887 * @mpdu_queued: No of MPDU/Subframes's queued to HW in Aggregates
4888 * @ppdu_nonaggr_cnt: No of NonAggr/MPDU/Subframes's queued to HW
4889 * in Legacy NonAggregates
4890 * @mpdu_sw_requed: No of MPDU/Subframes's SW requeued includes
4891 * both Aggr and NonAggr
4892 * @mpdu_suc_retry: No of MPDU/Subframes's transmitted Successfully
4893 * after Single/mul HW retry
4894 * @mpdu_suc_multitry: No of MPDU/Subframes's transmitted Success
4895 * after Multiple HW retry
4896 * @mpdu_fail_retry: No of MPDU/Subframes's failed transmission
4897 * after Multiple HW retry
4898 * @reserved[13]: for future extensions set to 0x0
4899 */
4900typedef struct {
4901 uint32_t vdev_id;
4902 uint32_t ppdu_aggr_cnt;
4903 uint32_t ppdu_noack;
4904 uint32_t mpdu_queued;
4905 uint32_t ppdu_nonaggr_cnt;
4906 uint32_t mpdu_sw_requed;
4907 uint32_t mpdu_suc_retry;
4908 uint32_t mpdu_suc_multitry;
4909 uint32_t mpdu_fail_retry;
4910 uint32_t reserved[13];
4911} wmi_host_vdev_extd_stats;
4912
4913/**
4914 * struct wmi_host_peer_stats - peer stats
4915 * @peer_macaddr: peer MAC address
4916 * @peer_rssi: rssi
4917 * @peer_rssi_seq_num: rssi sequence number
4918 * @peer_tx_rate: last tx data rate used for peer
4919 * @peer_rx_rate: last rx data rate used for peer
4920 * @currentper: Current PER
4921 * @retries: Retries happend during transmission
4922 * @txratecount: Maximum Aggregation Size
4923 * @max4msframelen: Max4msframelen of tx rates used
4924 * @totalsubframes: Total no of subframes
4925 * @txbytes: No of bytes transmitted to the client
4926 * @nobuffs[4]: Packet Loss due to buffer overflows
4927 * @excretries[4]: Packet Loss due to excessive retries
4928 * @peer_rssi_changed: how many times peer's RSSI changed by a
4929 * non-negligible amount
4930 */
4931typedef struct {
4932 wmi_host_mac_addr peer_macaddr;
4933 uint32_t peer_rssi;
4934 uint32_t peer_rssi_seq_num;
4935 uint32_t peer_tx_rate;
4936 uint32_t peer_rx_rate;
4937 uint32_t currentper;
4938 uint32_t retries;
4939 uint32_t txratecount;
4940 uint32_t max4msframelen;
4941 uint32_t totalsubframes;
4942 uint32_t txbytes;
4943 uint32_t nobuffs[4];
4944 uint32_t excretries[4];
4945 uint32_t peer_rssi_changed;
4946} wmi_host_peer_stats;
4947
4948typedef struct {
4949 uint32_t dummy;
4950} wmi_host_bcnflt_stats;
4951
4952/**
4953 * struct wmi_host_chan_stats - WMI chan stats
4954 * @chan_mhz: Primary channel freq of the channel for which stats are sent
4955 * @sampling_period_us: Time spent on the channel
4956 * @rx_clear_count: Aggregate duration over a sampling period for
4957 * which channel activity was observed
4958 * @tx_duration_us: Accumalation of the TX PPDU duration over a sampling period
4959 * @rx_duration_us: Accumalation of the RX PPDU duration over a sampling period
4960 */
4961typedef struct {
4962 uint32_t chan_mhz;
4963 uint32_t sampling_period_us;
4964 uint32_t rx_clear_count;
4965 uint32_t tx_duration_us;
4966 uint32_t rx_duration_us;
4967} wmi_host_chan_stats;
4968
4969#define WMI_EVENT_ID_INVALID 0
4970/**
4971 * Host based ENUM IDs for events to abstract target enums for event_id
4972 */
4973typedef enum {
4974 wmi_service_ready_event_id = 0,
4975 wmi_ready_event_id,
4976 wmi_dbg_msg_event_id,
4977 wmi_scan_event_id,
4978 wmi_echo_event_id,
4979 wmi_update_stats_event_id,
4980 wmi_inst_rssi_stats_event_id,
4981 wmi_vdev_start_resp_event_id,
4982 wmi_vdev_standby_req_event_id,
4983 wmi_vdev_resume_req_event_id,
4984 wmi_vdev_stopped_event_id,
4985 wmi_peer_sta_kickout_event_id,
4986 wmi_host_swba_event_id,
4987 wmi_tbttoffset_update_event_id,
4988 wmi_mgmt_rx_event_id,
4989 wmi_chan_info_event_id,
4990 wmi_phyerr_event_id,
4991 wmi_roam_event_id,
4992 wmi_profile_match,
4993 wmi_debug_print_event_id,
4994 wmi_pdev_qvit_event_id,
4995 wmi_wlan_profile_data_event_id,
4996 wmi_rtt_meas_report_event_id,
4997 wmi_tsf_meas_report_event_id,
4998 wmi_rtt_error_report_event_id,
4999 wmi_rtt_keepalive_event_id,
5000 wmi_oem_cap_event_id,
5001 wmi_oem_meas_report_event_id,
5002 wmi_oem_report_event_id,
5003 wmi_nan_event_id,
5004 wmi_wow_wakeup_host_event_id,
5005 wmi_gtk_offload_status_event_id,
5006 wmi_gtk_rekey_fail_event_id,
5007 wmi_dcs_interference_event_id,
5008 wmi_pdev_tpc_config_event_id,
5009 wmi_csa_handling_event_id,
5010 wmi_gpio_input_event_id,
5011 wmi_peer_ratecode_list_event_id,
5012 wmi_generic_buffer_event_id,
5013 wmi_mcast_buf_release_event_id,
5014 wmi_mcast_list_ageout_event_id,
5015 wmi_vdev_get_keepalive_event_id,
5016 wmi_wds_peer_event_id,
5017 wmi_peer_sta_ps_statechg_event_id,
5018 wmi_pdev_fips_event_id,
5019 wmi_tt_stats_event_id,
5020 wmi_pdev_channel_hopping_event_id,
5021 wmi_pdev_ani_cck_level_event_id,
5022 wmi_pdev_ani_ofdm_level_event_id,
5023 wmi_pdev_reserve_ast_entry_event_id,
5024 wmi_pdev_nfcal_power_event_id,
5025 wmi_pdev_tpc_event_id,
5026 wmi_pdev_get_ast_info_event_id,
5027 wmi_pdev_temperature_event_id,
5028 wmi_pdev_nfcal_power_all_channels_event_id,
5029 wmi_pdev_bss_chan_info_event_id,
5030 wmi_mu_report_event_id,
5031 wmi_pdev_utf_event_id,
5032 wmi_pdev_dump_event_id,
5033 wmi_tx_pause_event_id,
5034 wmi_dfs_radar_event_id,
5035 wmi_pdev_l1ss_track_event_id,
5036 wmi_service_ready_ext_event_id,
5037 wmi_vdev_install_key_complete_event_id,
5038 wmi_vdev_mcc_bcn_intvl_change_req_event_id,
5039 wmi_vdev_tsf_report_event_id,
5040 wmi_peer_info_event_id,
5041 wmi_peer_tx_fail_cnt_thr_event_id,
5042 wmi_peer_estimated_linkspeed_event_id,
5043 wmi_peer_state_event_id,
5044 wmi_offload_bcn_tx_status_event_id,
5045 wmi_offload_prob_resp_tx_status_event_id,
5046 wmi_mgmt_tx_completion_event_id,
5047 wmi_tx_delba_complete_event_id,
5048 wmi_tx_addba_complete_event_id,
5049 wmi_ba_rsp_ssn_event_id,
5050 wmi_aggr_state_trig_event_id,
5051 wmi_roam_synch_event_id,
5052 wmi_p2p_disc_event_id,
5053 wmi_p2p_noa_event_id,
5054 wmi_pdev_resume_event_id,
5055 wmi_do_wow_disable_ack_event_id,
5056 wmi_wow_initial_wakeup_event_id,
5057 wmi_stats_ext_event_id,
5058 wmi_iface_link_stats_event_id,
5059 wmi_peer_link_stats_event_id,
5060 wmi_radio_link_stats_link,
5061 wmi_update_fw_mem_dump_event_id,
5062 wmi_diag_event_id_log_supported_event_id,
5063 wmi_nlo_match_event_id,
5064 wmi_nlo_scan_complete_event_id,
5065 wmi_apfind_event_id,
5066 wmi_passpoint_match_event_id,
5067 wmi_chatter_pc_query_event_id,
5068 wmi_pdev_ftm_intg_event_id,
5069 wmi_wlan_freq_avoid_event_id,
5070 wmi_thermal_mgmt_event_id,
5071 wmi_diag_container_event_id,
5072 wmi_host_auto_shutdown_event_id,
5073 wmi_update_whal_mib_stats_event_id,
5074 wmi_update_vdev_rate_stats_event_id,
5075 wmi_diag_event_id,
5076 wmi_ocb_set_sched_event_id,
5077 wmi_dbg_mesg_flush_complete_event_id,
5078 wmi_rssi_breach_event_id,
5079 wmi_uploadh_event_id,
5080 wmi_captureh_event_id,
5081 wmi_rfkill_state_change_event_id,
5082 wmi_tdls_peer_event_id,
5083 wmi_batch_scan_enabled_event_id,
5084 wmi_batch_scan_result_event_id,
5085 wmi_lpi_result_event_id,
5086 wmi_lpi_status_event_id,
5087 wmi_lpi_handoff_event_id,
5088 wmi_extscan_start_stop_event_id,
5089 wmi_extscan_operation_event_id,
5090 wmi_extscan_table_usage_event_id,
5091 wmi_extscan_cached_results_event_id,
5092 wmi_extscan_wlan_change_results_event_id,
5093 wmi_extscan_hotlist_match_event_id,
5094 wmi_extscan_capabilities_event_id,
5095 wmi_extscan_hotlist_ssid_match_event_id,
5096 wmi_mdns_stats_event_id,
5097 wmi_sap_ofl_add_sta_event_id,
5098 wmi_sap_ofl_del_sta_event_id,
5099 wmi_ocb_set_config_resp_event_id,
5100 wmi_ocb_get_tsf_timer_resp_event_id,
5101 wmi_dcc_get_stats_resp_event_id,
5102 wmi_dcc_update_ndl_resp_event_id,
5103 wmi_dcc_stats_event_id,
5104 wmi_soc_set_hw_mode_resp_event_id,
5105 wmi_soc_hw_mode_transition_event_id,
5106 wmi_soc_set_dual_mac_config_resp_event_id,
5107 wmi_tx_data_traffic_ctrl_event_id,
Sathish Kumar7e2eaed2016-11-14 17:44:29 +05305108 wmi_peer_tx_mu_txmit_count_event_id,
5109 wmi_peer_gid_userpos_list_event_id,
5110 wmi_pdev_check_cal_version_event_id,
5111 wmi_atf_peer_stats_event_id,
Vijay Pamidipatiadd0ba72017-01-17 12:53:05 +05305112 wmi_peer_delete_response_event_id,
Sathish Kumar907a7462017-02-27 10:35:40 +05305113 wmi_pdev_csa_switch_count_status_event_id,
Govind Singh89727882016-04-15 13:58:27 +05305114
5115 wmi_events_max,
5116} wmi_conv_event_id;
5117
5118#define WMI_UNAVAILABLE_PARAM 0
5119/**
5120 * Host based ENUM IDs for PDEV params to abstract target enums
5121 */
5122typedef enum {
5123 wmi_pdev_param_tx_chain_mask = 0,
5124 wmi_pdev_param_rx_chain_mask,
5125 wmi_pdev_param_txpower_limit2g,
5126 wmi_pdev_param_txpower_limit5g,
5127 wmi_pdev_param_txpower_scale,
5128 wmi_pdev_param_beacon_gen_mode,
5129 wmi_pdev_param_beacon_tx_mode,
5130 wmi_pdev_param_resmgr_offchan_mode,
5131 wmi_pdev_param_protection_mode,
5132 wmi_pdev_param_dynamic_bw,
5133 wmi_pdev_param_non_agg_sw_retry_th,
5134 wmi_pdev_param_agg_sw_retry_th,
5135 wmi_pdev_param_sta_kickout_th,
5136 wmi_pdev_param_ac_aggrsize_scaling,
5137 wmi_pdev_param_ltr_enable,
5138 wmi_pdev_param_ltr_ac_latency_be,
5139 wmi_pdev_param_ltr_ac_latency_bk,
5140 wmi_pdev_param_ltr_ac_latency_vi,
5141 wmi_pdev_param_ltr_ac_latency_vo,
5142 wmi_pdev_param_ltr_ac_latency_timeout,
5143 wmi_pdev_param_ltr_sleep_override,
5144 wmi_pdev_param_ltr_rx_override,
5145 wmi_pdev_param_ltr_tx_activity_timeout,
5146 wmi_pdev_param_l1ss_enable,
5147 wmi_pdev_param_dsleep_enable,
5148 wmi_pdev_param_pcielp_txbuf_flush,
5149 wmi_pdev_param_pcielp_txbuf_watermark,
5150 wmi_pdev_param_pcielp_txbuf_tmo_en,
5151 wmi_pdev_param_pcielp_txbuf_tmo_value,
5152 wmi_pdev_param_pdev_stats_update_period,
5153 wmi_pdev_param_vdev_stats_update_period,
5154 wmi_pdev_param_peer_stats_update_period,
5155 wmi_pdev_param_bcnflt_stats_update_period,
5156 wmi_pdev_param_pmf_qos,
5157 wmi_pdev_param_arp_ac_override,
5158 wmi_pdev_param_dcs,
5159 wmi_pdev_param_ani_enable,
5160 wmi_pdev_param_ani_poll_period,
5161 wmi_pdev_param_ani_listen_period,
5162 wmi_pdev_param_ani_ofdm_level,
5163 wmi_pdev_param_ani_cck_level,
5164 wmi_pdev_param_dyntxchain,
5165 wmi_pdev_param_proxy_sta,
5166 wmi_pdev_param_idle_ps_config,
5167 wmi_pdev_param_power_gating_sleep,
5168 wmi_pdev_param_aggr_burst,
5169 wmi_pdev_param_rx_decap_mode,
5170 wmi_pdev_param_fast_channel_reset,
5171 wmi_pdev_param_burst_dur,
5172 wmi_pdev_param_burst_enable,
5173 wmi_pdev_param_smart_antenna_default_antenna,
5174 wmi_pdev_param_igmpmld_override,
5175 wmi_pdev_param_igmpmld_tid,
5176 wmi_pdev_param_antenna_gain,
5177 wmi_pdev_param_rx_filter,
5178 wmi_pdev_set_mcast_to_ucast_tid,
5179 wmi_pdev_param_proxy_sta_mode,
5180 wmi_pdev_param_set_mcast2ucast_mode,
5181 wmi_pdev_param_set_mcast2ucast_buffer,
5182 wmi_pdev_param_remove_mcast2ucast_buffer,
5183 wmi_pdev_peer_sta_ps_statechg_enable,
5184 wmi_pdev_param_igmpmld_ac_override,
5185 wmi_pdev_param_block_interbss,
5186 wmi_pdev_param_set_disable_reset_cmdid,
5187 wmi_pdev_param_set_msdu_ttl_cmdid,
5188 wmi_pdev_param_set_ppdu_duration_cmdid,
5189 wmi_pdev_param_txbf_sound_period_cmdid,
5190 wmi_pdev_param_set_promisc_mode_cmdid,
5191 wmi_pdev_param_set_burst_mode_cmdid,
5192 wmi_pdev_param_en_stats,
5193 wmi_pdev_param_mu_group_policy,
5194 wmi_pdev_param_noise_detection,
5195 wmi_pdev_param_noise_threshold,
5196 wmi_pdev_param_dpd_enable,
5197 wmi_pdev_param_set_mcast_bcast_echo,
5198 wmi_pdev_param_atf_strict_sch,
5199 wmi_pdev_param_atf_sched_duration,
5200 wmi_pdev_param_ant_plzn,
5201 wmi_pdev_param_mgmt_retry_limit,
5202 wmi_pdev_param_sensitivity_level,
5203 wmi_pdev_param_signed_txpower_2g,
5204 wmi_pdev_param_signed_txpower_5g,
5205 wmi_pdev_param_enable_per_tid_amsdu,
5206 wmi_pdev_param_enable_per_tid_ampdu,
5207 wmi_pdev_param_cca_threshold,
5208 wmi_pdev_param_rts_fixed_rate,
5209 wmi_pdev_param_cal_period,
5210 wmi_pdev_param_pdev_reset,
5211 wmi_pdev_param_wapi_mbssid_offset,
5212 wmi_pdev_param_arp_srcaddr,
5213 wmi_pdev_param_arp_dstaddr,
5214 wmi_pdev_param_txpower_decr_db,
5215 wmi_pdev_param_rx_batchmode,
5216 wmi_pdev_param_packet_aggr_delay,
5217 wmi_pdev_param_atf_obss_noise_sch,
5218 wmi_pdev_param_atf_obss_noise_scaling_factor,
5219 wmi_pdev_param_cust_txpower_scale,
5220 wmi_pdev_param_atf_dynamic_enable,
5221 wmi_pdev_param_atf_ssid_group_policy,
5222 wmi_pdev_param_rfkill_enable,
5223 wmi_pdev_param_hw_rfkill_config,
5224 wmi_pdev_param_low_power_rf_enable,
5225 wmi_pdev_param_l1ss_track,
5226 wmi_pdev_param_hyst_en,
5227 wmi_pdev_param_power_collapse_enable,
5228 wmi_pdev_param_led_sys_state,
5229 wmi_pdev_param_led_enable,
5230 wmi_pdev_param_audio_over_wlan_latency,
5231 wmi_pdev_param_audio_over_wlan_enable,
5232 wmi_pdev_param_whal_mib_stats_update_enable,
5233 wmi_pdev_param_vdev_rate_stats_update_period,
5234 wmi_pdev_param_cts_cbw,
5235 wmi_pdev_param_wnts_config,
5236 wmi_pdev_param_adaptive_early_rx_enable,
5237 wmi_pdev_param_adaptive_early_rx_min_sleep_slop,
5238 wmi_pdev_param_adaptive_early_rx_inc_dec_step,
5239 wmi_pdev_param_early_rx_fix_sleep_slop,
5240 wmi_pdev_param_bmiss_based_adaptive_bto_enable,
5241 wmi_pdev_param_bmiss_bto_min_bcn_timeout,
5242 wmi_pdev_param_bmiss_bto_inc_dec_step,
5243 wmi_pdev_param_bto_fix_bcn_timeout,
5244 wmi_pdev_param_ce_based_adaptive_bto_enable,
5245 wmi_pdev_param_ce_bto_combo_ce_value,
5246 wmi_pdev_param_tx_chain_mask_2g,
5247 wmi_pdev_param_rx_chain_mask_2g,
5248 wmi_pdev_param_tx_chain_mask_5g,
5249 wmi_pdev_param_rx_chain_mask_5g,
5250 wmi_pdev_param_tx_chain_mask_cck,
5251 wmi_pdev_param_tx_chain_mask_1ss,
Sathish Kumar7e2eaed2016-11-14 17:44:29 +05305252 wmi_pdev_param_enable_btcoex,
5253 wmi_pdev_param_atf_peer_stats,
Sathish Kumar612d0c22017-01-19 14:57:37 +05305254 wmi_pdev_param_btcoex_cfg,
Venkateswara Swamy Bandarud8ac3e72017-02-24 17:09:46 +05305255 wmi_pdev_param_mesh_mcast_enable,
Govind Singh89727882016-04-15 13:58:27 +05305256
5257 wmi_pdev_param_max,
5258} wmi_conv_pdev_params_id;
5259
5260
5261/**
5262 * Host based ENUM IDs for VDEV params to abstract target enums
5263 */
5264typedef enum {
5265 wmi_vdev_param_rts_threshold = 0,
5266 wmi_vdev_param_fragmentation_threshold,
5267 wmi_vdev_param_beacon_interval,
5268 wmi_vdev_param_listen_interval,
5269 wmi_vdev_param_multicast_rate,
5270 wmi_vdev_param_mgmt_tx_rate,
5271 wmi_vdev_param_slot_time,
5272 wmi_vdev_param_preamble,
5273 wmi_vdev_param_swba_time,
5274 wmi_vdev_stats_update_period,
5275 wmi_vdev_pwrsave_ageout_time,
5276 wmi_vdev_host_swba_interval,
5277 wmi_vdev_param_dtim_period,
5278 wmi_vdev_oc_scheduler_air_time_limit,
5279 wmi_vdev_param_wds,
5280 wmi_vdev_param_atim_window,
5281 wmi_vdev_param_bmiss_count_max,
5282 wmi_vdev_param_bmiss_first_bcnt,
5283 wmi_vdev_param_bmiss_final_bcnt,
5284 wmi_vdev_param_feature_wmm,
5285 wmi_vdev_param_chwidth,
5286 wmi_vdev_param_chextoffset,
5287 wmi_vdev_param_disable_htprotection,
5288 wmi_vdev_param_sta_quickkickout,
5289 wmi_vdev_param_mgmt_rate,
5290 wmi_vdev_param_protection_mode,
5291 wmi_vdev_param_fixed_rate,
5292 wmi_vdev_param_sgi,
5293 wmi_vdev_param_ldpc,
5294 wmi_vdev_param_tx_stbc,
5295 wmi_vdev_param_rx_stbc,
5296 wmi_vdev_param_intra_bss_fwd,
5297 wmi_vdev_param_def_keyid,
5298 wmi_vdev_param_nss,
5299 wmi_vdev_param_bcast_data_rate,
5300 wmi_vdev_param_mcast_data_rate,
5301 wmi_vdev_param_mcast_indicate,
5302 wmi_vdev_param_dhcp_indicate,
5303 wmi_vdev_param_unknown_dest_indicate,
5304 wmi_vdev_param_ap_keepalive_min_idle_inactive_time_secs,
5305 wmi_vdev_param_ap_keepalive_max_idle_inactive_time_secs,
5306 wmi_vdev_param_ap_keepalive_max_unresponsive_time_secs,
5307 wmi_vdev_param_ap_enable_nawds,
5308 wmi_vdev_param_mcast2ucast_set,
5309 wmi_vdev_param_enable_rtscts,
5310 wmi_vdev_param_rc_num_retries,
5311 wmi_vdev_param_txbf,
5312 wmi_vdev_param_packet_powersave,
5313 wmi_vdev_param_drop_unencry,
5314 wmi_vdev_param_tx_encap_type,
5315 wmi_vdev_param_ap_detect_out_of_sync_sleeping_sta_time_secs,
5316 wmi_vdev_param_cabq_maxdur,
5317 wmi_vdev_param_mfptest_set,
5318 wmi_vdev_param_rts_fixed_rate,
5319 wmi_vdev_param_vht_sgimask,
5320 wmi_vdev_param_vht80_ratemask,
5321 wmi_vdev_param_early_rx_adjust_enable,
5322 wmi_vdev_param_early_rx_tgt_bmiss_num,
5323 wmi_vdev_param_early_rx_bmiss_sample_cycle,
5324 wmi_vdev_param_early_rx_slop_step,
5325 wmi_vdev_param_early_rx_init_slop,
5326 wmi_vdev_param_early_rx_adjust_pause,
5327 wmi_vdev_param_proxy_sta,
5328 wmi_vdev_param_meru_vc,
5329 wmi_vdev_param_rx_decap_type,
5330 wmi_vdev_param_bw_nss_ratemask,
5331 wmi_vdev_param_sensor_ap,
5332 wmi_vdev_param_beacon_rate,
5333 wmi_vdev_param_dtim_enable_cts,
5334 wmi_vdev_param_sta_kickout,
5335 wmi_vdev_param_tx_pwrlimit,
5336 wmi_vdev_param_snr_num_for_cal,
5337 wmi_vdev_param_roam_fw_offload,
5338 wmi_vdev_param_enable_rmc,
5339 wmi_vdev_param_ibss_max_bcn_lost_ms,
5340 wmi_vdev_param_max_rate,
5341 wmi_vdev_param_early_rx_drift_sample,
5342 wmi_vdev_param_set_ibss_tx_fail_cnt_thr,
5343 wmi_vdev_param_ebt_resync_timeout,
5344 wmi_vdev_param_aggr_trig_event_enable,
5345 wmi_vdev_param_is_ibss_power_save_allowed,
5346 wmi_vdev_param_is_power_collapse_allowed,
5347 wmi_vdev_param_is_awake_on_txrx_enabled,
5348 wmi_vdev_param_inactivity_cnt,
5349 wmi_vdev_param_txsp_end_inactivity_time_ms,
5350 wmi_vdev_param_dtim_policy,
5351 wmi_vdev_param_ibss_ps_warmup_time_secs,
5352 wmi_vdev_param_ibss_ps_1rx_chain_in_atim_window_enable,
5353 wmi_vdev_param_rx_leak_window,
5354 wmi_vdev_param_stats_avg_factor,
5355 wmi_vdev_param_disconnect_th,
5356 wmi_vdev_param_rtscts_rate,
5357 wmi_vdev_param_mcc_rtscts_protection_enable,
5358 wmi_vdev_param_mcc_broadcast_probe_enable,
Himanshu Agarwal56c292f2016-07-19 15:41:51 +05305359 wmi_vdev_param_capabilities,
Sathish Kumar7e2eaed2016-11-14 17:44:29 +05305360 wmi_vdev_param_mgmt_tx_power,
5361 wmi_vdev_param_atf_ssid_sched_policy,
5362 wmi_vdev_param_disable_dyn_bw_rts,
Nandha Kishore Easwaranb3da4222017-02-01 10:59:00 +05305363 wmi_vdev_param_ampdu_subframe_size_per_ac,
Govind Singh89727882016-04-15 13:58:27 +05305364
5365 wmi_vdev_param_max,
5366} wmi_conv_vdev_param_id;
5367
5368/**
5369 * Host based ENUM IDs for service bits to abstract target enums
5370 */
5371typedef enum {
5372 wmi_service_beacon_offload = 0,
5373 wmi_service_scan_offload,
5374 wmi_service_roam_offload,
5375 wmi_service_bcn_miss_offload,
5376 wmi_service_sta_pwrsave,
5377 wmi_service_sta_advanced_pwrsave,
5378 wmi_service_ap_uapsd,
5379 wmi_service_ap_dfs,
5380 wmi_service_11ac,
5381 wmi_service_blockack,
5382 wmi_service_phyerr,
5383 wmi_service_bcn_filter,
5384 wmi_service_rtt,
5385 wmi_service_ratectrl,
5386 wmi_service_wow,
5387 wmi_service_ratectrl_cache,
5388 wmi_service_iram_tids,
5389 wmi_service_burst,
5390 wmi_service_smart_antenna_sw_support,
5391 wmi_service_gtk_offload,
5392 wmi_service_scan_sch,
5393 wmi_service_csa_offload,
5394 wmi_service_chatter,
5395 wmi_service_coex_freqavoid,
5396 wmi_service_packet_power_save,
5397 wmi_service_force_fw_hang,
5398 wmi_service_smart_antenna_hw_support,
5399 wmi_service_gpio,
5400 wmi_sta_uapsd_basic_auto_trig,
5401 wmi_sta_uapsd_var_auto_trig,
5402 wmi_service_sta_keep_alive,
5403 wmi_service_tx_encap,
5404 wmi_service_ap_ps_detect_out_of_sync,
5405 wmi_service_early_rx,
5406 wmi_service_enhanced_proxy_sta,
5407 wmi_service_tt,
5408 wmi_service_atf,
5409 wmi_service_peer_caching,
5410 wmi_service_coex_gpio,
5411 wmi_service_aux_spectral_intf,
5412 wmi_service_aux_chan_load_intf,
5413 wmi_service_bss_channel_info_64,
5414 wmi_service_ext_res_cfg_support,
5415 wmi_service_mesh,
5416 wmi_service_restrt_chnl_support,
5417 wmi_service_roam_scan_offload,
5418 wmi_service_arpns_offload,
5419 wmi_service_nlo,
5420 wmi_service_sta_dtim_ps_modulated_dtim,
5421 wmi_service_sta_smps,
5422 wmi_service_fwtest,
5423 wmi_service_sta_wmmac,
5424 wmi_service_tdls,
5425 wmi_service_mcc_bcn_interval_change,
5426 wmi_service_adaptive_ocs,
5427 wmi_service_ba_ssn_support,
5428 wmi_service_filter_ipsec_natkeepalive,
5429 wmi_service_wlan_hb,
5430 wmi_service_lte_ant_share_support,
5431 wmi_service_batch_scan,
5432 wmi_service_qpower,
5433 wmi_service_plmreq,
5434 wmi_service_thermal_mgmt,
5435 wmi_service_rmc,
5436 wmi_service_mhf_offload,
5437 wmi_service_coex_sar,
5438 wmi_service_bcn_txrate_override,
5439 wmi_service_nan,
5440 wmi_service_l1ss_stat,
5441 wmi_service_estimate_linkspeed,
5442 wmi_service_obss_scan,
5443 wmi_service_tdls_offchan,
5444 wmi_service_tdls_uapsd_buffer_sta,
5445 wmi_service_tdls_uapsd_sleep_sta,
5446 wmi_service_ibss_pwrsave,
5447 wmi_service_lpass,
5448 wmi_service_extscan,
5449 wmi_service_d0wow,
5450 wmi_service_hsoffload,
5451 wmi_service_roam_ho_offload,
5452 wmi_service_rx_full_reorder,
5453 wmi_service_dhcp_offload,
5454 wmi_service_sta_rx_ipa_offload_support,
5455 wmi_service_mdns_offload,
5456 wmi_service_sap_auth_offload,
5457 wmi_service_dual_band_simultaneous_support,
5458 wmi_service_ocb,
5459 wmi_service_ap_arpns_offload,
5460 wmi_service_per_band_chainmask_support,
5461 wmi_service_packet_filter_offload,
5462 wmi_service_mgmt_tx_htt,
5463 wmi_service_mgmt_tx_wmi,
5464 wmi_service_ext_msg,
5465 wmi_service_mawc,
5466
5467 wmi_service_peer_stats,
5468 wmi_service_mesh_11s,
5469 wmi_service_periodic_chan_stat_support,
5470 wmi_service_tx_mode_push_only,
5471 wmi_service_tx_mode_push_pull,
5472 wmi_service_tx_mode_dynamic,
Sathish Kumar7e2eaed2016-11-14 17:44:29 +05305473 wmi_service_check_cal_version,
Sathish Kumar7e566c52016-11-10 15:30:22 +05305474 wmi_service_btcoex_duty_cycle,
Sathish Kumar612d0c22017-01-19 14:57:37 +05305475 wmi_service_4_wire_coex_support,
Sathish Kumar907a7462017-02-27 10:35:40 +05305476 wmi_service_multiple_vdev_restart,
Govind Singh89727882016-04-15 13:58:27 +05305477
5478 wmi_services_max,
5479} wmi_conv_service_ids;
5480#define WMI_SERVICE_UNAVAILABLE 0xFFFF
5481
5482/**
5483 * struct target_capability_info - Target capabilities in service ready
5484 * @phy_capability: PHY capabilities
5485 * @max_frag_entry: Maximum frag entries
5486 * @num_rf_chains: Number of RF chains supported
5487 * @ht_cap_info: HT cap info
5488 * @vht_cap_info: VHT cap info
5489 * @vht_supp_mcs: VHT Supported MCS
5490 * @hw_min_tx_power: HW minimum tx power
5491 * @hw_max_tx_power: HW maximum tx power
5492 * @sys_cap_info: sys capability info
5493 * @min_pkt_size_enable: Enterprise mode short pkt enable
5494 * @max_bcn_ie_size: Max beacon and probe rsp IE offload size
5495 * @max_num_scan_channels: Max scan channels
5496 * @max_supported_macs: max supported MCS
5497 * @wmi_fw_sub_feat_caps: FW sub feature capabilities
5498 * @txrx_chainmask: TXRX chain mask
5499 * @default_dbs_hw_mode_index: DBS hw mode index
5500 * @num_msdu_desc: number of msdu desc
5501 */
5502typedef struct {
5503 uint32_t phy_capability;
5504 uint32_t max_frag_entry;
5505 uint32_t num_rf_chains;
5506 uint32_t ht_cap_info;
5507 uint32_t vht_cap_info;
5508 uint32_t vht_supp_mcs;
5509 uint32_t hw_min_tx_power;
5510 uint32_t hw_max_tx_power;
5511 uint32_t sys_cap_info;
5512 uint32_t min_pkt_size_enable;
5513 uint32_t max_bcn_ie_size;
5514 uint32_t max_num_scan_channels;
5515 uint32_t max_supported_macs;
5516 uint32_t wmi_fw_sub_feat_caps;
5517 uint32_t txrx_chainmask;
5518 uint32_t default_dbs_hw_mode_index;
5519 uint32_t num_msdu_desc;
5520} target_capability_info;
5521
5522/**
Sandeep Puligilla82b95ca2017-01-04 16:45:45 -08005523 * enum WMI_DBG_PARAM - Debug params
5524 * @WMI_DBGLOG_LOG_LEVEL: Set the loglevel
5525 * @WMI_DBGLOG_VAP_ENABLE: Enable VAP level debug
5526 * @WMI_DBGLOG_VAP_DISABLE: Disable VAP level debug
5527 * @WMI_DBGLOG_MODULE_ENABLE: Enable MODULE level debug
5528 * @WMI_DBGLOG_MODULE_DISABLE: Disable MODULE level debug
5529 * @WMI_DBGLOG_MOD_LOG_LEVEL: Enable MODULE level debug
5530 * @WMI_DBGLOG_TYPE: set type of the debug output
5531 * @WMI_DBGLOG_REPORT_ENABLE: Enable Disable debug
5532 */
5533typedef enum {
5534 WMI_DBGLOG_LOG_LEVEL = 0x1,
5535 WMI_DBGLOG_VAP_ENABLE,
5536 WMI_DBGLOG_VAP_DISABLE,
5537 WMI_DBGLOG_MODULE_ENABLE,
5538 WMI_DBGLOG_MODULE_DISABLE,
5539 WMI_DBGLOG_MOD_LOG_LEVEL,
5540 WMI_DBGLOG_TYPE,
5541 WMI_DBGLOG_REPORT_ENABLE
5542} WMI_DBG_PARAM;
5543
5544/**
Govind Singh89727882016-04-15 13:58:27 +05305545 * struct wmi_host_fw_ver - FW version in non-tlv target
5546 * @sw_version: Versin info
5547 * @sw_version_1: Second dword of version
5548 */
5549struct wmi_host_fw_ver {
5550 uint32_t sw_version;
5551 uint32_t sw_version_1;
5552};
5553
5554/**
5555 * struct wmi_host_fw_abi_ver - FW version in non-tlv target
5556 * @sw_version: Versin info
5557 * @abi_version: ABI version
5558 */
5559struct wmi_host_fw_abi_ver {
5560 uint32_t sw_version;
5561 uint32_t abi_version;
5562};
5563
5564/**
5565 * struct target_resource_config - Resource config sent from host to target
5566 * abstracted out to include union of both configs
5567 * @num_vdevs: Number vdevs configured
5568 * @num_peers: Number of peers
5569 * @num_active_peers: Number of active peers for peer cache
5570 * @num_offload_peers: Number of offload peers
5571 * @num_offload_reorder_buffs: number of offload reorder buffs
5572 * @num_peer_keys: number of peer keys
5573 * @num_tids: number of tids
5574 * @ast_skid_limit: AST skid limit
5575 * @tx_chain_mask: TX chain mask
5576 * @rx_chain_mask: RX chain mask
5577 * @rx_timeout_pri: RX reorder timeout per AC
5578 * @rx_decap_mode: RX decap mode
5579 * @scan_max_pending_req: Scan mac pending req
5580 * @bmiss_offload_max_vdev: Beacom miss offload max vdevs
5581 * @roam_offload_max_vdev: Roam offload max vdevs
5582 * @roam_offload_max_ap_profiles: roam offload max ap profiles
5583 * @num_mcast_groups: num mcast groups
5584 * @num_mcast_table_elems: number of macst table elems
5585 * @mcast2ucast_mode: mcast enhance mode
5586 * @tx_dbg_log_size: DBG log buf size
5587 * @num_wds_entries: number of WDS entries
5588 * @dma_burst_size: DMA burst size.
5589 * @mac_aggr_delim: Mac aggr delim
5590 * @rx_skip_defrag_timeout_dup_detection_check: Defrag dup check in host?
5591 * @vow_config: vow configuration
5592 * @gtk_offload_max_vdev: Max vdevs for GTK offload
5593 * @num_msdu_desc: Number of msdu desc
5594 * @max_frag_entries: Max frag entries
5595 * End common
5596 * @max_peer_ext_stats: Max peer EXT stats
5597 * @smart_ant_cap: Smart antenna capabilities
5598 * @BK_Minfree: BIN configuration for BK traffic
5599 * @BE_Minfree: BIN configuration for BE traffic
5600 * @VI_Minfree: BIN configuration for VI traffic
5601 * @VO_Minfree: BIN configuration for VO traffic
5602 * @rx_batchmode: RX batch mode
5603 * @tt_support: Thermal throttling support
5604 * @atf_config: ATF config
5605 * @iphdr_pad_config: ipheader pad config
5606 * @qwrap_config: Qwrap configuration
5607 * @alloc_frag_desc_for_data_pkt: Frag desc for data
5608 * Added in MCL
5609 * @num_tdls_vdevs:
5610 * @num_tdls_conn_table_entries:
5611 * @beacon_tx_offload_max_vdev:
5612 * @num_multicast_filter_entries:
5613 * @num_wow_filters:
5614 * @num_keep_alive_pattern:
5615 * @keep_alive_pattern_size:
5616 * @max_tdls_concurrent_sleep_sta:
5617 * @max_tdls_concurrent_buffer_sta:
5618 * @wmi_send_separate:
5619 * @num_ocb_vdevs:
5620 * @num_ocb_channels:
5621 * @num_ocb_schedules:
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05305622 * @num_ns_ext_tuples_cfg:
5623 * @bpf_instruction_size:
5624 * @max_bssid_rx_filters:
5625 * @use_pdev_id:
Govind Singh89727882016-04-15 13:58:27 +05305626 */
5627typedef struct {
5628 uint32_t num_vdevs;
5629 uint32_t num_peers;
5630 uint32_t num_active_peers;
5631 uint32_t num_offload_peers;
5632 uint32_t num_offload_reorder_buffs;
5633 uint32_t num_peer_keys;
5634 uint32_t num_tids;
5635 uint32_t ast_skid_limit;
5636 uint32_t tx_chain_mask;
5637 uint32_t rx_chain_mask;
5638 uint32_t rx_timeout_pri[4];
5639 uint32_t rx_decap_mode;
5640 uint32_t scan_max_pending_req;
5641 uint32_t bmiss_offload_max_vdev;
5642 uint32_t roam_offload_max_vdev;
5643 uint32_t roam_offload_max_ap_profiles;
5644 uint32_t num_mcast_groups;
5645 uint32_t num_mcast_table_elems;
5646 uint32_t mcast2ucast_mode;
5647 uint32_t tx_dbg_log_size;
5648 uint32_t num_wds_entries;
5649 uint32_t dma_burst_size;
5650 uint32_t mac_aggr_delim;
5651 uint32_t rx_skip_defrag_timeout_dup_detection_check;
5652 uint32_t vow_config;
5653 uint32_t gtk_offload_max_vdev;
5654 uint32_t num_msdu_desc; /* Number of msdu desc */
5655 uint32_t max_frag_entries;
5656 /* End common */
5657
5658 /* Added for Beeliner */
5659 uint32_t max_peer_ext_stats;
5660 uint32_t smart_ant_cap;
5661 uint32_t BK_Minfree;
5662 uint32_t BE_Minfree;
5663 uint32_t VI_Minfree;
5664 uint32_t VO_Minfree;
5665 uint32_t rx_batchmode;
5666 uint32_t tt_support;
5667 uint32_t atf_config;
5668 uint32_t iphdr_pad_config;
5669 uint32_t
5670 qwrap_config:16,
5671 alloc_frag_desc_for_data_pkt:16;
5672
5673 /* Added in MCL */
5674 uint32_t num_tdls_vdevs;
5675 uint32_t num_tdls_conn_table_entries;
5676 uint32_t beacon_tx_offload_max_vdev;
5677 uint32_t num_multicast_filter_entries;
5678 uint32_t num_wow_filters;
5679 uint32_t num_keep_alive_pattern;
5680 uint32_t keep_alive_pattern_size;
5681 uint32_t max_tdls_concurrent_sleep_sta;
5682 uint32_t max_tdls_concurrent_buffer_sta;
5683 uint32_t wmi_send_separate;
5684 uint32_t num_ocb_vdevs;
5685 uint32_t num_ocb_channels;
5686 uint32_t num_ocb_schedules;
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05305687 uint32_t num_ns_ext_tuples_cfg;
5688 uint32_t bpf_instruction_size;
5689 uint32_t max_bssid_rx_filters;
5690 uint32_t use_pdev_id;
Govind Singh89727882016-04-15 13:58:27 +05305691} target_resource_config;
5692
5693/**
5694 * struct wds_addr_event - WDS addr event structure
5695 * @event_type: event type add/delete
5696 * @peer_mac: peer mac
5697 * @dest_mac: destination mac address
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05305698 * @vdev_id: vdev id
Govind Singh89727882016-04-15 13:58:27 +05305699 */
5700typedef struct {
5701 uint32_t event_type[4];
5702 u_int8_t peer_mac[IEEE80211_ADDR_LEN];
5703 u_int8_t dest_mac[IEEE80211_ADDR_LEN];
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05305704 uint32_t vdev_id;
Govind Singh89727882016-04-15 13:58:27 +05305705} wds_addr_event_t;
5706/**
5707 * Enum replicated for host abstraction with FW
5708 */
5709typedef enum {
5710 /* Event respose of START CMD */
5711 WMI_HOST_VDEV_START_RESP_EVENT = 0,
5712 /* Event respose of RESTART CMD */
5713 WMI_HOST_VDEV_RESTART_RESP_EVENT,
5714} WMI_HOST_START_EVENT_PARAM;
5715
5716/**
5717 * struct wmi_host_vdev_start_resp - VDEV start response
5718 * @vdev_id: vdev id
5719 * @requestor_id: requestor id that requested the VDEV start request
5720 * @resp_type: Respose of Event type START/RESTART
5721 * @status: status of the response
5722 * @chain_mask: Vdev chain mask
5723 * @smps_mode: Vdev mimo power save mode
5724 * @mac_id: mac_id field contains the MAC identifier that the
5725 * VDEV is bound to. The valid range is 0 to (num_macs-1).
5726 * @cfgd_tx_streams: Configured Transmit Streams
5727 * @cfgd_rx_streams: Configured Receive Streams
5728 */
5729typedef struct {
5730 uint32_t vdev_id;
5731 uint32_t requestor_id;
5732 WMI_HOST_START_EVENT_PARAM resp_type;
5733 uint32_t status;
5734 uint32_t chain_mask;
5735 uint32_t smps_mode;
5736 uint32_t mac_id;
5737 uint32_t cfgd_tx_streams;
5738 uint32_t cfgd_rx_streams;
5739} wmi_host_vdev_start_resp;
5740
Govind Singh89727882016-04-15 13:58:27 +05305741/**
5742 * struct wmi_host_roam_event - host roam event param
5743 * @vdev_id: vdev id
5744 * @reason: roam reason
5745 * @rssi: RSSI
5746 */
5747typedef struct {
5748 uint32_t vdev_id;
5749 uint32_t reason;
5750 uint32_t rssi;
5751} wmi_host_roam_event;
5752
5753/**
5754 * ENUM wmi_host_scan_event_type - Scan event type
5755 */
5756enum wmi_host_scan_event_type {
5757 WMI_HOST_SCAN_EVENT_STARTED = 0x1,
5758 WMI_HOST_SCAN_EVENT_COMPLETED = 0x2,
5759 WMI_HOST_SCAN_EVENT_BSS_CHANNEL = 0x4,
5760 WMI_HOST_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
5761 WMI_HOST_SCAN_EVENT_DEQUEUED = 0x10,
5762 WMI_HOST_SCAN_EVENT_PREEMPTED = 0x20,
5763 WMI_HOST_SCAN_EVENT_START_FAILED = 0x40,
5764 WMI_HOST_SCAN_EVENT_RESTARTED = 0x80,
5765 WMI_HOST_SCAN_EVENT_FOREIGN_CHANNEL_EXIT = 0x100,
5766 WMI_HOST_SCAN_EVENT_INVALID = 0x200,
Sathish Kumar753eb7d2016-10-25 18:47:52 +05305767 WMI_HOST_SCAN_EVENT_GPIO_TIMEOUT = 0x400,
Govind Singh89727882016-04-15 13:58:27 +05305768 WMI_HOST_SCAN_EVENT_MAX = 0x8000
5769};
5770
5771/**
5772 * ENUM wmi_host_scan_completion_reason - Scan completion event type
5773 */
5774enum wmi_host_scan_completion_reason {
5775 /** scan related events */
5776 WMI_HOST_SCAN_REASON_NONE = 0xFF,
5777 WMI_HOST_SCAN_REASON_COMPLETED = 0,
5778 WMI_HOST_SCAN_REASON_CANCELLED = 1,
5779 WMI_HOST_SCAN_REASON_PREEMPTED = 2,
5780 WMI_HOST_SCAN_REASON_TIMEDOUT = 3,
5781 WMI_HOST_SCAN_REASON_INTERNAL_FAILURE = 4,
5782 WMI_HOST_SCAN_REASON_MAX,
5783};
5784
5785/**
5786 * struct wmi_host_scan_event - Scan event response from target
5787 * @event: event type
5788 * @reason: Reason for event
5789 * @channel_freq: channel frequency
5790 * @requestor: requestor id
5791 * @scan_id: scan id
5792 * @vdev_id: vdev id
5793 */
5794typedef struct {
5795 uint32_t event;
5796 uint32_t reason;
5797 uint32_t channel_freq;
5798 uint32_t requestor;
5799 uint32_t scan_id;
5800 uint32_t vdev_id;
5801} wmi_host_scan_event;
5802
5803/**
5804 * struct wmi_host_pdev_reserve_ast_entry_event - Reserve AST entry
5805 * @result: result
5806 */
5807typedef struct {
5808 uint32_t result;
5809} wmi_host_pdev_reserve_ast_entry_event;
5810
5811/**
5812 * struct wmi_host_mcast_ageout_entry - mcast aged-out entry
5813 * @grp_addr: IPv4/6 mcast group addr
5814 * @vdev_id: vdev id
5815 */
5816typedef struct {
5817 uint8_t grp_addr[16];
5818 uint32_t vdev_id;
5819} wmi_host_mcast_ageout_entry;
5820
5821/**
5822 * struct wmi_host_mcast_list_ageout_event - List of mcast entry aged-out
5823 * @num_entry: Number of mcast entries timed-out
5824 * @entry: List of wmi_host_mcast_ageout_entry
5825 */
5826typedef struct {
5827 uint32_t num_entry;
5828 wmi_host_mcast_ageout_entry entry[1];
5829} wmi_host_mcast_list_ageout_event;
5830
5831/**
5832 * struct wmi_host_pdev_nfcal_power_all_channels_event - NF cal event data
5833 * @nfdBr:
5834 * chan0: {NFCalPower_chain0, NFCalPower_chain1,
5835 * NFCalPower_chain2, NFCalPower_chain3},
5836 * chan1: {NFCalPower_chain0, NFCalPower_chain1,
5837 * NFCalPower_chain2, NFCalPower_chain3},
5838 * chan2: {NFCalPower_chain0, NFCalPower_chain1,
5839 * NFCalPower_chain2, NFCalPower_chain3},
5840 * chan3: {NFCalPower_chain0, NFCalPower_chain1,
5841 * NFCalPower_chain2, NFCalPower_chain3},
5842 * @nfdBr:
5843 * chan0: {NFCalPower_chain0, NFCalPower_chain1,
5844 * NFCalPower_chain2, NFCalPower_chain3},
5845 * chan1: {NFCalPower_chain0, NFCalPower_chain1,
5846 * NFCalPower_chain2, NFCalPower_chain3},
5847 * chan2: {NFCalPower_chain0, NFCalPower_chain1,
5848 * NFCalPower_chain2, NFCalPower_chain3},
5849 * chan3: {NFCalPower_chain0, NFCalPower_chain1,
5850 * NFCalPower_chain2, NFCalPower_chain3},
5851 * @freqNum: frequency number
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05305852 * @pdev_id: pdev_id
Govind Singh89727882016-04-15 13:58:27 +05305853 */
5854typedef struct {
5855 int8_t nfdBr[WMI_HOST_RXG_CAL_CHAN_MAX * WMI_HOST_MAX_NUM_CHAINS];
5856 int8_t nfdBm[WMI_HOST_RXG_CAL_CHAN_MAX * WMI_HOST_MAX_NUM_CHAINS];
5857 uint32_t freqNum[WMI_HOST_RXG_CAL_CHAN_MAX];
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05305858 uint32_t pdev_id;
Govind Singh89727882016-04-15 13:58:27 +05305859} wmi_host_pdev_nfcal_power_all_channels_event;
5860
5861/**
5862 * struct wmi_host_pdev_tpc_event - WMI host pdev TPC event
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05305863 * @pdev_id: pdev_id
Govind Singh89727882016-04-15 13:58:27 +05305864 * @tpc:
5865 */
5866typedef struct {
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05305867 uint32_t pdev_id;
Govind Singh89727882016-04-15 13:58:27 +05305868 uint32_t tpc[1];
5869} wmi_host_pdev_tpc_event;
5870
5871/**
5872 * struct wmi_host_pdev_generic_buffer_event
5873 * @buf_type: Buffer type
5874 * @frag_id: Frag id
5875 * @more_frag: more frags pending
5876 * @buf_len: buffer length
5877 * @buf_info: variable length buffer
5878 */
5879typedef struct {
5880 uint32_t buf_type;
5881 uint32_t frag_id;
5882 uint32_t more_frag;
5883 uint32_t buf_len;
5884 uint32_t buf_info[1];
5885} wmi_host_pdev_generic_buffer_event;
5886/**
5887 * Enum for host buffer event
5888 */
5889enum {
5890 WMI_HOST_BUFFER_TYPE_RATEPWR_TABLE,
5891 WMI_HOST_BUFFER_TYPE_CTL_TABLE,
5892};
5893
5894/**
5895 * struct wmi_host_pdev_tpc_config_event - host pdev tpc config event
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05305896 * @pdev_id: pdev_id
Govind Singh89727882016-04-15 13:58:27 +05305897 * @regDomain:
5898 * @chanFreq:
5899 * @phyMode:
5900 * @twiceAntennaReduction:
5901 * @twiceMaxRDPower:
5902 * @twiceAntennaGain:
5903 * @powerLimit:
5904 * @rateMax:
5905 * @numTxChain:
5906 * @ctl:
5907 * @flags:
5908 * @maxRegAllowedPower:
5909 * @maxRegAllowedPowerAGCDD:
5910 * @maxRegAllowedPowerAGSTBC:
5911 * @maxRegAllowedPowerAGTXBF:
5912 * @ratesArray:
5913 */
5914typedef struct {
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05305915 uint32_t pdev_id;
Govind Singh89727882016-04-15 13:58:27 +05305916 uint32_t regDomain;
5917 uint32_t chanFreq;
5918 uint32_t phyMode;
5919 uint32_t twiceAntennaReduction;
5920 uint32_t twiceMaxRDPower;
5921 int32_t twiceAntennaGain;
5922 uint32_t powerLimit;
5923 uint32_t rateMax;
5924 uint32_t numTxChain;
5925 uint32_t ctl;
5926 uint32_t flags;
5927 int8_t maxRegAllowedPower[WMI_HOST_TPC_TX_NUM_CHAIN];
5928 int8_t maxRegAllowedPowerAGCDD[WMI_HOST_TPC_TX_NUM_CHAIN][WMI_HOST_TPC_TX_NUM_CHAIN];
5929 int8_t maxRegAllowedPowerAGSTBC[WMI_HOST_TPC_TX_NUM_CHAIN][WMI_HOST_TPC_TX_NUM_CHAIN];
5930 int8_t maxRegAllowedPowerAGTXBF[WMI_HOST_TPC_TX_NUM_CHAIN][WMI_HOST_TPC_TX_NUM_CHAIN];
5931 uint8_t ratesArray[WMI_HOST_TPC_RATE_MAX];
5932} wmi_host_pdev_tpc_config_event;
5933/**
5934 * Enums for TPC event
5935 */
5936typedef enum {
5937 WMI_HOST_TPC_CONFIG_EVENT_FLAG_TABLE_CDD = 0x1,
5938 WMI_HOST_TPC_CONFIG_EVENT_FLAG_TABLE_STBC = 0x2,
5939 WMI_HOST_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF = 0x4,
5940} WMI_HOST_TPC_CONFIG_EVENT_FLAG;
5941
5942/**
5943 * Medium Utilization evaluation algorithms
5944 * These algorithms can be complementary rather than exclusive.
5945 */
5946typedef enum {
5947 WMI_HOST_MU_BASIC_ALGO = 0x1,
5948 WMI_HOST_MU_PER_BSSID_ALGO = 0x2,
5949 WMI_HOST_MU_HIDDEN_NODE_ALGO = 0x4,
5950} WMI_HOST_MU_ALGO_TYPE;
5951/* max MU alg combinations supported by target */
5952#define WMI_HOST_MU_MAX_ALGO_TYPE 3
5953
5954/**
Sathish Kumar7e2eaed2016-11-14 17:44:29 +05305955 * struct wmi_host_mu_db_entry
5956 * @event_type: 0=AP, 1=STA, 2=Small Cell(SC)
5957 * @bssid_mac_addr: Transmitter MAC if entry is WiFi node. PLMNID if SC
5958 * @tx_addr: Transmitter MAC if entry is WiFi node. PLMNID if SC
5959 * @avg_duration_us: Avg. duration for which node was transmitting
5960 * @avg_rssi: Avg. RSSI of all TX packets by node. Unit dBm
5961 * @mu_percent: % medium utilization by node
5962 */
5963typedef struct {
5964 uint32_t entry_type;
5965 wmi_host_mac_addr bssid_mac_addr;
5966 wmi_host_mac_addr tx_addr;
5967 uint32_t avg_duration_us;
5968 uint32_t avg_rssi;
5969 uint32_t mu_percent;
5970} wmi_host_mu_db_entry;
5971
5972/**
Govind Singh89727882016-04-15 13:58:27 +05305973 * struct wmi_host_mu_report_event - WMI_MU_REPORT_EVENTID
5974 * @mu_request_id: request id
5975 * @status_reason: MU_STATUS_REASON
5976 * @total_mu: MU_ALG_TYPE combinations
5977 * @num_active_bssid: number of active bssid
Sathish Kumar7e2eaed2016-11-14 17:44:29 +05305978 * @hidden_node_mu : hidden node algo MU per bin
5979 * @num_TA_entries : No. of entries found in MU db report
Govind Singh89727882016-04-15 13:58:27 +05305980 */
5981typedef struct {
5982 uint32_t mu_request_id;
5983 uint32_t status_reason;
5984 uint32_t total_mu[WMI_HOST_MU_MAX_ALGO_TYPE];
5985 uint32_t num_active_bssid;
Sathish Kumar7e2eaed2016-11-14 17:44:29 +05305986 uint32_t hidden_node_mu[LTEU_MAX_BINS];
5987 uint32_t num_TA_entries;
Govind Singh89727882016-04-15 13:58:27 +05305988} wmi_host_mu_report_event;
5989
5990/**
5991 * struct wmi_host_mgmt_tx_compl_event - TX completion event
5992 * @desc_id: from tx_send_cmd
5993 * @status: WMI_MGMT_TX_COMP_STATUS_TYPE
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05305994 * @pdev_id: pdev_id
Govind Singh89727882016-04-15 13:58:27 +05305995 */
5996typedef struct {
5997 uint32_t desc_id;
5998 uint32_t status;
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05305999 uint32_t pdev_id;
Govind Singh89727882016-04-15 13:58:27 +05306000} wmi_host_mgmt_tx_compl_event;
6001
6002#define WMI_HOST_TIM_BITMAP_ARRAY_SIZE 17
6003
6004/**
6005 * struct wmi_host_tim_info - TIM info in SWBA event
6006 * @tim_len: TIM length
6007 * @tim_mcast:
6008 * @tim_bitmap: TIM bitmap
6009 * @tim_changed: TIM changed
6010 * @tim_num_ps_pending: TIM num PS sta pending
6011 */
6012typedef struct {
6013 uint32_t tim_len;
6014 uint32_t tim_mcast;
6015 uint32_t tim_bitmap[WMI_HOST_TIM_BITMAP_ARRAY_SIZE];
6016 uint32_t tim_changed;
6017 uint32_t tim_num_ps_pending;
6018} wmi_host_tim_info;
6019
6020/**
6021 * struct wmi_host_p2p_noa_descriptor - NoA desc in SWBA event
6022 * @type_count: Absence count
6023 * @duration: NoA duration
6024 * @interval: NoA interval
6025 * @start_time: start time
6026 */
6027typedef struct {
6028 uint32_t type_count;
6029 uint32_t duration;
6030 uint32_t interval;
6031 uint32_t start_time;
6032} wmi_host_p2p_noa_descriptor;
6033/* Maximum number of NOA Descriptors supported */
6034#define WMI_HOST_P2P_MAX_NOA_DESCRIPTORS 4
6035/**
6036 * struct wmi_host_p2p_noa_info - p2p noa information
6037 * @modified: NoA modified
6038 * @index: Index
6039 * @oppPS: Oppurtunstic ps
6040 * @ctwindow: CT window
6041 * @num_descriptors: number of descriptors
6042 * @noa_descriptors: noa descriptors
6043 */
6044typedef struct {
6045 uint8_t modified;
6046 uint8_t index;
6047 uint8_t oppPS;
6048 uint8_t ctwindow;
6049 uint8_t num_descriptors;
6050 wmi_host_p2p_noa_descriptor
6051 noa_descriptors[WMI_HOST_P2P_MAX_NOA_DESCRIPTORS];
6052} wmi_host_p2p_noa_info;
6053
6054/**
6055 * struct wmi_host_peer_sta_kickout_event
6056 * @peer_macaddr: peer mac address
6057 * @reason: kickout reason
6058 * @rssi: rssi
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05306059 * @pdev_id: pdev_id
Govind Singh89727882016-04-15 13:58:27 +05306060 */
6061typedef struct {
6062 uint8_t peer_macaddr[IEEE80211_ADDR_LEN];
6063 uint32_t reason;
6064 uint32_t rssi;
6065} wmi_host_peer_sta_kickout_event;
6066
6067/**
6068 * struct wmi_host_peer_sta_ps_statechange_event - ST ps state change event
6069 * @peer_macaddr: peer mac address
6070 * @peer_ps_stats: peer PS state
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05306071 * @pdev_id: pdev_id
Govind Singh89727882016-04-15 13:58:27 +05306072 */
6073typedef struct {
6074 uint8_t peer_macaddr[IEEE80211_ADDR_LEN];
6075 uint32_t peer_ps_state;
6076} wmi_host_peer_sta_ps_statechange_event;
6077
6078/* Maximum CCK, OFDM rates supported */
6079#define WMI_SA_MAX_CCK_OFDM_RATES 12
6080/* Maximum MCS rates supported; 4 rates in each dword */
6081#define WMI_SA_MAX_MCS_RATES 40
6082#define WMI_SA_MAX_RATE_COUNTERS 4
6083/* Maximum rate series used for transmission */
6084#define SA_MAX_RATE_SERIES 2
6085
6086#define SA_MAX_LEGACY_RATE_DWORDS 3
6087#define SA_MAX_HT_RATE_DWORDS 10
6088#define SA_BYTES_IN_DWORD 4
6089#define SA_MASK_BYTE 0xff
6090/* TODO: ratecode_160 needs to add for future chips */
6091/**
6092 * struct wmi_sa_rate_cap - smart antenna rat capabilities
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05306093 * @pdev_id: pdev_id
Govind Singh89727882016-04-15 13:58:27 +05306094 * @ratecode_legacy: Rate code array for CCK OFDM
6095 * @ratecode_20: Rate code array for 20MHz BW
6096 * @ratecode_40: Rate code array for 40MHz BW
6097 * @ratecode_80: Rate code array for 80MHz BW
6098 * @ratecount: Max Rate count for each mode
6099 */
6100typedef struct {
6101 uint8_t ratecode_legacy[WMI_SA_MAX_CCK_OFDM_RATES];
6102 uint8_t ratecode_20[WMI_SA_MAX_MCS_RATES];
6103 uint8_t ratecode_40[WMI_SA_MAX_MCS_RATES];
6104 uint8_t ratecode_80[WMI_SA_MAX_MCS_RATES];
6105 uint8_t ratecount[WMI_SA_MAX_RATE_COUNTERS];
6106} wmi_sa_rate_cap;
6107
6108/** Preamble types to be used with VDEV fixed rate configuration */
6109typedef enum {
6110 WMI_HOST_RATE_PREAMBLE_OFDM,
6111 WMI_HOST_RATE_PREAMBLE_CCK,
6112 WMI_HOST_RATE_PREAMBLE_HT,
6113 WMI_HOST_RATE_PREAMBLE_VHT,
6114} WMI_HOST_RATE_PREAMBLE;
6115
6116#define WMI_HOST_FIXED_RATE_NONE (0xff)
6117
6118/** slot time long */
6119#define WMI_HOST_VDEV_SLOT_TIME_LONG 0x1
6120/** slot time short */
6121#define WMI_HOST_VDEV_SLOT_TIME_SHORT 0x2
6122/** preablbe long */
6123#define WMI_HOST_VDEV_PREAMBLE_LONG 0x1
6124/** preablbe short */
6125#define WMI_HOST_VDEV_PREAMBLE_SHORT 0x2
6126/** found a better AP */
6127#define WMI_HOST_ROAM_REASON_BETTER_AP 0x1
6128/** beacon miss detected */
6129#define WMI_HOST_ROAM_REASON_BMISS 0x2
6130/** deauth/disassoc received */
6131#define WMI_HOST_ROAM_REASON_DEAUTH 0x2
6132/** connected AP's low rssi condition detected */
6133#define WMI_HOST_ROAM_REASON_LOW_RSSI 0x3
6134/** found another AP that matches SSID and Security profile in
6135 * WMI_ROAM_AP_PROFILE, found during scan triggered upon FINAL_BMISS
6136 */
6137#define WMI_HOST_ROAM_REASON_SUITABLE_AP 0x4
6138/** LFR3.0 roaming failed, indicate the disconnection to host */
6139#define WMI_HOST_ROAM_REASON_HO_FAILED 0x5
6140
6141/** values for vdev_type */
6142#define WMI_HOST_VDEV_TYPE_AP 0x1
6143#define WMI_HOST_VDEV_TYPE_STA 0x2
6144#define WMI_HOST_VDEV_TYPE_IBSS 0x3
6145#define WMI_HOST_VDEV_TYPE_MONITOR 0x4
6146
6147/** values for vdev_subtype */
6148#define WMI_HOST_VDEV_SUBTYPE_P2P_DEVICE 0x1
6149#define WMI_HOST_VDEV_SUBTYPE_P2P_CLIENT 0x2
6150#define WMI_HOST_VDEV_SUBTYPE_P2P_GO 0x3
6151#define WMI_HOST_VDEV_SUBTYPE_PROXY_STA 0x4
6152#define WMI_HOST_VDEV_SUBTYPE_MESH 0x5
6153
6154#define WMI_HOST_MGMT_TID 17
6155/* Disable aging & learning */
6156#define WMI_HOST_WDS_FLAG_STATIC 0x1
6157
6158/**
6159 * Peer param enum abstracted from target
6160 */
6161typedef enum {
6162 /** mimo powersave state */
6163 WMI_HOST_PEER_MIMO_PS_STATE = 0x1,
6164 /** enable/disable AMPDU . initial value (enabled) */
6165 WMI_HOST_PEER_AMPDU = 0x2,
6166 /** authorize/unauthorize peer. initial value is unauthorized (0) */
6167 WMI_HOST_PEER_AUTHORIZE = 0x3,
6168 /** peer channel bandwidth */
6169 WMI_HOST_PEER_CHWIDTH = 0x4,
6170 /** peer NSS */
6171 WMI_HOST_PEER_NSS = 0x5,
6172 /** USE 4 ADDR */
6173 WMI_HOST_PEER_USE_4ADDR = 0x6,
6174 /** Enable extended peer stats */
6175 WMI_HOST_PEER_EXT_STATS_ENABLE = 0x7,
6176 /*Use FIXED Pwr */
6177 WMI_HOST_PEER_USE_FIXED_PWR = 0x8,
6178 /* Set peer fixed rate */
6179 WMI_HOST_PEER_PARAM_FIXED_RATE = 0x9,
6180 /* Whitelist peer TIDs */
6181 WMI_HOST_PEER_SET_MU_WHITELIST = 0xa,
6182 /* set group membership status */
6183 WMI_HOST_PEER_MEMBERSHIP = 0xb,
6184 WMI_HOST_PEER_USERPOS = 0xc,
Kiran Venkatappa9da7e042016-08-09 22:52:35 +05306185 WMI_HOST_PEER_CRIT_PROTO_HINT_ENABLED = 0xd,
6186 WMI_HOST_PEER_TX_FAIL_CNT_THR = 0xe,
6187 WMI_HOST_PEER_SET_HW_RETRY_CTS2S = 0xf,
6188 WMI_HOST_PEER_IBSS_ATIM_WINDOW_LENGTH = 0x10,
6189 WMI_HOST_PEER_PHYMODE = 0x11,
6190 WMI_HOST_PEER_SET_MAC_TX_RATE = 0x12,
6191 /* Set default Rx routing */
6192 WMI_HOST_PEER_SET_DEFAULT_ROUTING = 0x13,
6193 WMI_HOST_PEER_SET_MIN_TX_RATE = 0x14,
Govind Singh89727882016-04-15 13:58:27 +05306194} PEER_PARAM_ENUM;
6195#define WMI_HOST_PEER_MIMO_PS_NONE 0x0
6196#define WMI_HOST_PEER_MIMO_PS_STATIC 0x1
6197#define WMI_HOST_PEER_MIMO_PS_DYNAMIC 0x2
6198typedef enum {
6199 HOST_PLATFORM_HIGH_PERF,
6200 HOST_PLATFORM_LOW_PERF,
Sathish Kumar41eca492016-09-16 16:55:35 +05306201 HOST_PLATFORM_LOW_PERF_NO_FETCH,
Govind Singh89727882016-04-15 13:58:27 +05306202} HOST_PLATFORM_TYPE;
6203
6204enum wmi_host_sta_ps_mode {
6205 /** enable power save for the given STA VDEV */
6206 WMI_HOST_STA_PS_MODE_DISABLED = 0,
6207 /** disable power save for a given STA VDEV */
6208 WMI_HOST_STA_PS_MODE_ENABLED = 1,
6209};
6210enum wmi_host_sta_powersave_param {
6211 /**
6212 * Controls how frames are retrievd from AP while STA is sleeping
6213 *
6214 * (see enum wmi_sta_ps_param_rx_wake_policy)
6215 */
6216 WMI_HOST_STA_PS_PARAM_RX_WAKE_POLICY = 0,
6217
6218 /**
6219 * The STA will go active after this many TX
6220 *
6221 * (see enum wmi_sta_ps_param_tx_wake_threshold)
6222 */
6223 WMI_HOST_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
6224
6225 /**
6226 * Number of PS-Poll to send before STA wakes up
6227 *
6228 * (see enum wmi_sta_ps_param_pspoll_count)
6229 *
6230 */
6231 WMI_HOST_STA_PS_PARAM_PSPOLL_COUNT = 2,
6232
6233 /**
6234 * TX/RX inactivity time in msec before going to sleep.
6235 *
6236 * The power save SM will monitor tx/rx activity on the VDEV, if no
6237 * activity for the specified msec of the parameter
6238 * the Power save SM will go to sleep.
6239 */
6240 WMI_HOST_STA_PS_PARAM_INACTIVITY_TIME = 3,
6241
6242 /**
6243 * Set uapsd configuration.
6244 *
6245 * (see enum wmi_sta_ps_param_uapsd)
6246 */
6247 WMI_HOST_STA_PS_PARAM_UAPSD = 4,
6248};
6249/* prefix used by scan requestor ids on the host
6250 * replicated here form wmi_unified.h*/
6251#define WMI_HOST_P_SCAN_REQUESTOR_ID_PREFIX 0xA000
6252/* prefix used by scan request ids generated on the host */
6253/* host cycles through the lower 12 bits to generate ids */
6254#define WMI_HOST_P_SCAN_REQ_ID_PREFIX 0xA000
6255
6256#define WMI_HOST_RC_DS_FLAG 0x01 /* Dual stream flag */
6257#define WMI_HOST_RC_CW40_FLAG 0x02 /* CW 40 */
6258#define WMI_HOST_RC_SGI_FLAG 0x04 /* Short Guard Interval */
6259#define WMI_HOST_RC_HT_FLAG 0x08 /* HT */
6260#define WMI_HOST_RC_RTSCTS_FLAG 0x10 /* RTS-CTS */
6261#define WMI_HOST_RC_TX_STBC_FLAG 0x20 /* TX STBC */
6262#define WMI_HOST_RC_RX_STBC_FLAG 0xC0 /* RX STBC ,2 bits */
6263#define WMI_HOST_RC_RX_STBC_FLAG_S 6 /* RX STBC ,2 bits */
6264#define WMI_HOST_RC_WEP_TKIP_FLAG 0x100 /* WEP/TKIP encryption */
6265#define WMI_HOST_RC_TS_FLAG 0x200 /* Three stream flag */
6266#define WMI_HOST_RC_UAPSD_FLAG 0x400 /* UAPSD Rate Control */
6267
6268/** HT Capabilities*/
6269#define WMI_HOST_HT_CAP_ENABLED 0x0001 /* HT Enabled/ disabled */
6270/* Short Guard Interval with HT20 */
6271#define WMI_HOST_HT_CAP_HT20_SGI 0x0002
6272#define WMI_HOST_HT_CAP_DYNAMIC_SMPS 0x0004 /* Dynamic MIMO powersave */
6273#define WMI_HOST_HT_CAP_TX_STBC 0x0008 /* B3 TX STBC */
6274#define WMI_HOST_HT_CAP_TX_STBC_MASK_SHIFT 3
6275#define WMI_HOST_HT_CAP_RX_STBC 0x0030 /* B4-B5 RX STBC */
6276#define WMI_HOST_HT_CAP_RX_STBC_MASK_SHIFT 4
6277#define WMI_HOST_HT_CAP_LDPC 0x0040 /* LDPC supported */
6278#define WMI_HOST_HT_CAP_L_SIG_TXOP_PROT 0x0080 /* L-SIG TXOP Protection */
6279#define WMI_HOST_HT_CAP_MPDU_DENSITY 0x0700 /* MPDU Density */
6280#define WMI_HOST_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8
6281#define WMI_HOST_HT_CAP_HT40_SGI 0x0800
6282#define WMI_HOST_HT_CAP_IBF_BFER 0x1000
6283
6284/* These macros should be used when we wish to advertise STBC support for
6285 * only 1SS or 2SS or 3SS. */
6286#define WMI_HOST_HT_CAP_RX_STBC_1SS 0x0010 /* B4-B5 RX STBC */
6287#define WMI_HOST_HT_CAP_RX_STBC_2SS 0x0020 /* B4-B5 RX STBC */
6288#define WMI_HOST_HT_CAP_RX_STBC_3SS 0x0030 /* B4-B5 RX STBC */
6289
6290
6291#define WMI_HOST_HT_CAP_DEFAULT_ALL (WMI_HOST_HT_CAP_ENABLED | \
6292 WMI_HOST_HT_CAP_HT20_SGI | \
6293 WMI_HOST_HT_CAP_HT40_SGI | \
6294 WMI_HOST_HT_CAP_TX_STBC | \
6295 WMI_HOST_HT_CAP_RX_STBC | \
6296 WMI_HOST_HT_CAP_LDPC)
6297
6298/* WMI_HOST_VHT_CAP_* these maps to ieee 802.11ac vht capability information
6299 field. The fields not defined here are not supported, or reserved.
6300 Do not change these masks and if you have to add new one follow the
6301 bitmask as specified by 802.11ac draft.
6302*/
6303
6304#define WMI_HOST_VHT_CAP_MAX_MPDU_LEN_MASK 0x00000003
6305#define WMI_HOST_VHT_CAP_RX_LDPC 0x00000010
6306#define WMI_HOST_VHT_CAP_SGI_80MHZ 0x00000020
6307#define WMI_HOST_VHT_CAP_SGI_160MHZ 0x00000040
6308#define WMI_HOST_VHT_CAP_TX_STBC 0x00000080
6309#define WMI_HOST_VHT_CAP_RX_STBC_MASK 0x00000300
6310#define WMI_HOST_VHT_CAP_RX_STBC_MASK_SHIFT 8
6311#define WMI_HOST_VHT_CAP_SU_BFER 0x00000800
6312#define WMI_HOST_VHT_CAP_SU_BFEE 0x00001000
6313#define WMI_HOST_VHT_CAP_MAX_CS_ANT_MASK 0x0000E000
6314#define WMI_HOST_VHT_CAP_MAX_CS_ANT_MASK_SHIFT 13
6315#define WMI_HOST_VHT_CAP_MAX_SND_DIM_MASK 0x00070000
6316#define WMI_HOST_VHT_CAP_MAX_SND_DIM_MASK_SHIFT 16
6317#define WMI_HOST_VHT_CAP_MU_BFER 0x00080000
6318#define WMI_HOST_VHT_CAP_MU_BFEE 0x00100000
6319#define WMI_HOST_VHT_CAP_MAX_AMPDU_LEN_EXP 0x03800000
6320#define WMI_HOST_VHT_CAP_MAX_AMPDU_LEN_EXP_SHIT 23
6321#define WMI_HOST_VHT_CAP_RX_FIXED_ANT 0x10000000
6322#define WMI_HOST_VHT_CAP_TX_FIXED_ANT 0x20000000
6323
6324#define WMI_HOST_VHT_CAP_MAX_MPDU_LEN_11454 0x00000002
6325
6326/* These macros should be used when we wish to advertise STBC support for
6327 * only 1SS or 2SS or 3SS. */
6328#define WMI_HOST_VHT_CAP_RX_STBC_1SS 0x00000100
6329#define WMI_HOST_VHT_CAP_RX_STBC_2SS 0x00000200
6330#define WMI_HOST_VHT_CAP_RX_STBC_3SS 0x00000300
6331
6332#define WMI_HOST_VHT_CAP_DEFAULT_ALL (WMI_HOST_VHT_CAP_MAX_MPDU_LEN_11454 | \
6333 WMI_HOST_VHT_CAP_SGI_80MHZ | \
6334 WMI_HOST_VHT_CAP_TX_STBC | \
6335 WMI_HOST_VHT_CAP_RX_STBC_MASK | \
6336 WMI_HOST_VHT_CAP_RX_LDPC | \
6337 WMI_HOST_VHT_CAP_MAX_AMPDU_LEN_EXP | \
6338 WMI_HOST_VHT_CAP_RX_FIXED_ANT | \
6339 WMI_HOST_VHT_CAP_TX_FIXED_ANT)
6340
6341/* Interested readers refer to Rx/Tx MCS Map definition as defined in
6342 802.11ac
6343*/
6344#define WMI_HOST_VHT_MAX_MCS_4_SS_MASK(r, ss) ((3 & (r)) << (((ss) - 1) << 1))
6345#define WMI_HOST_VHT_MAX_SUPP_RATE_MASK 0x1fff0000
6346#define WMI_HOST_VHT_MAX_SUPP_RATE_MASK_SHIFT 16
6347
6348/** U-APSD configuration of peer station from (re)assoc request and TSPECs */
6349enum wmi_host_ap_ps_param_uapsd {
6350 WMI_HOST_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
6351 WMI_HOST_AP_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
6352 WMI_HOST_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
6353 WMI_HOST_AP_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
6354 WMI_HOST_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
6355 WMI_HOST_AP_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
6356 WMI_HOST_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
6357 WMI_HOST_AP_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
6358};
6359/** U-APSD maximum service period of peer station */
6360enum wmi_host_ap_ps_peer_param_max_sp {
6361 WMI_HOST_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0,
6362 WMI_HOST_AP_PS_PEER_PARAM_MAX_SP_2 = 1,
6363 WMI_HOST_AP_PS_PEER_PARAM_MAX_SP_4 = 2,
6364 WMI_HOST_AP_PS_PEER_PARAM_MAX_SP_6 = 3,
6365
6366 /* keep last! */
6367 MAX_HOST_WMI_AP_PS_PEER_PARAM_MAX_SP,
6368};
6369
6370#define WMI_HOST_UAPSD_AC_TYPE_DELI 0
6371#define WMI_HOST_UAPSD_AC_TYPE_TRIG 1
6372
6373#define WMI_HOST_UAPSD_AC_BIT_MASK(ac, type) \
6374 ((type == WMI_HOST_UAPSD_AC_TYPE_DELI) ? (1<<(ac<<1)) :\
6375 (1<<((ac<<1)+1)))
6376
6377enum wmi_host_ap_ps_peer_param_wnm_sleep {
6378 WMI_HOST_AP_PS_PEER_PARAM_WNM_SLEEP_ENABLE,
6379 WMI_HOST_AP_PS_PEER_PARAM_WNM_SLEEP_DISABLE,
6380};
6381
6382enum wmi_host_ap_ps_peer_param {
6383 /** Set uapsd configuration for a given peer.
6384 *
6385 * This will include the delivery and trigger enabled state for every AC.
6386 * The host MLME needs to set this based on AP capability and stations
6387 * request Set in the association request received from the station.
6388 *
6389 * Lower 8 bits of the value specify the UAPSD configuration.
6390 *
6391 * (see enum wmi_ap_ps_param_uapsd)
6392 * The default value is 0.
6393 */
6394 WMI_HOST_AP_PS_PEER_PARAM_UAPSD = 0,
6395
6396 /**
6397 * Set the service period for a UAPSD capable station
6398 *
6399 * The service period from wme ie in the (re)assoc request frame.
6400 *
6401 * (see enum wmi_ap_ps_peer_param_max_sp)
6402 */
6403 WMI_HOST_AP_PS_PEER_PARAM_MAX_SP = 1,
6404
6405 /** Time in seconds for aging out buffered frames
6406 * for STA in power save */
6407 WMI_HOST_AP_PS_PEER_PARAM_AGEOUT_TIME = 2,
6408
6409 /** Specify frame types that are considered SIFS
6410 * RESP trigger frame */
6411 WMI_HOST_AP_PS_PEER_PARAM_SIFS_RESP_FRMTYPE = 3,
6412
6413 /** Specifies the trigger state of TID.
6414 * Valid only for UAPSD frame type */
6415 WMI_HOST_AP_PS_PEER_PARAM_SIFS_RESP_UAPSD = 4,
6416
6417 /** Specifies the WNM sleep state of a STA */
6418 WMI_HOST_AP_PS_PEER_PARAM_WNM_SLEEP = 5,
6419};
6420#define WMI_HOST_RXERR_CRC 0x01 /* CRC error on frame */
6421#define WMI_HOST_RXERR_DECRYPT 0x08 /* non-Michael decrypt error */
6422#define WMI_HOST_RXERR_MIC 0x10 /* Michael MIC decrypt error */
6423#define WMI_HOST_RXERR_KEY_CACHE_MISS 0x20 /* No/incorrect key matter in h/w */
6424
6425enum wmi_host_sta_ps_param_uapsd {
6426 WMI_HOST_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
6427 WMI_HOST_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
6428 WMI_HOST_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
6429 WMI_HOST_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
6430 WMI_HOST_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
6431 WMI_HOST_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
6432 WMI_HOST_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
6433 WMI_HOST_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
6434};
6435
6436enum wmi_host_sta_ps_param_rx_wake_policy {
6437 /* Wake up when ever there is an RX activity on the VDEV. In this mode
6438 * the Power save SM(state machine) will come out of sleep by either
6439 * sending null frame (or) a data frame (with PS==0) in response to TIM
6440 * bit set in the received beacon frame from AP.
6441 */
6442 WMI_HOST_STA_PS_RX_WAKE_POLICY_WAKE = 0,
6443
6444 /* Here the power save state machine will not wakeup in response to TIM
6445 * bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD
6446 * configuration setup by WMISET_PS_SET_UAPSD WMI command. When all
6447 * access categories are delivery-enabled, the station will send a UAPSD
6448 * trigger frame, otherwise it will send a PS-Poll.
6449 */
6450 WMI_HOST_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1,
6451};
6452enum wmi_host_sta_ps_param_pspoll_count {
6453 WMI_HOST_STA_PS_PSPOLL_COUNT_NO_MAX = 0,
6454 /* Values greater than 0 indicate the maximum numer of PS-Poll frames FW
6455 * will send before waking up.
6456 */
6457};
6458/** Number of tx frames/beacon that cause the power save SM to wake up.
6459 *
6460 * Value 1 causes the SM to wake up for every TX. Value 0 has a special
6461 * meaning, It will cause the SM to never wake up. This is useful if you want
6462 * to keep the system to sleep all the time for some kind of test mode . host
6463 * can change this parameter any time. It will affect at the next tx frame.
6464 */
6465enum wmi_host_sta_ps_param_tx_wake_threshold {
6466 WMI_HOST_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0,
6467 WMI_HOST_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1,
6468
6469 /* Values greater than one indicate that many TX attempts per beacon
6470 * interval before the STA will wake up
6471 */
6472};
6473/*
6474 * Transmit power scale factor.
6475 *
6476 */
6477typedef enum {
6478 WMI_HOST_TP_SCALE_MAX = 0, /* no scaling (default) */
6479 WMI_HOST_TP_SCALE_50 = 1, /* 50% of max (-3 dBm) */
6480 WMI_HOST_TP_SCALE_25 = 2, /* 25% of max (-6 dBm) */
6481 WMI_HOST_TP_SCALE_12 = 3, /* 12% of max (-9 dBm) */
6482 WMI_HOST_TP_SCALE_MIN = 4, /* min, but still on */
6483 WMI_HOST_TP_SCALE_SIZE = 5, /* max num of enum */
6484} WMI_HOST_TP_SCALE;
6485enum {
6486 WMI_HOST_RATEPWR_TABLE_OPS_SET,
6487 WMI_HOST_RATEPWR_TABLE_OPS_GET,
6488};
6489/* reserved up through 0xF */
6490/**
6491 * struct wmi_host_dcs_mib_stats - WLAN IM stats from target to host
6492 * Below statistics are sent from target to host periodically.
6493 * These are collected at target as long as target is running
6494 * and target chip is not in sleep.
6495 * @listen_time:
6496 * @reg_tx_frame_cnt:
6497 * @reg_rx_frame_cnt:
6498 * @reg_rxclr_cnt:
6499 * @reg_cycle_cnt: delta cycle count
6500 * @reg_rxclr_ext_cnt:
6501 * @reg_ofdm_phyerr_cnt:
6502 * @reg_cck_phyerr_cnt: CCK err count since last reset, read from register
6503 */
6504typedef struct _hp_dcs_mib_stats {
6505 int32_t listen_time;
6506 uint32_t reg_tx_frame_cnt;
6507 uint32_t reg_rx_frame_cnt;
6508 uint32_t reg_rxclr_cnt;
6509 uint32_t reg_cycle_cnt;
6510 uint32_t reg_rxclr_ext_cnt;
6511 uint32_t reg_ofdm_phyerr_cnt;
6512 uint32_t reg_cck_phyerr_cnt;
6513} wmi_host_dcs_mib_stats_t;
6514
6515/**
6516 * struct wmi_host_dcs_im_tgt_stats - DCS IM target stats
6517 * @reg_tsf32: current running TSF from the TSF-1
6518 * @last_ack_rssi: Known last frame rssi, in case of multiple stations, if
6519 * and at different ranges, this would not gaurantee that
6520 * this is the least rssi.
6521 * @tx_waste_time: Sum of all the failed durations in the last
6522 * one second interval.
6523 * @rx_time: count how many times the hal_rxerr_phy is marked, in this
6524 * time period
6525 * @phyerr_cnt:
6526 * @mib_stats: wmi_host_dcs_mib_stats_t - collected mib stats as explained
6527 * in mib structure
Sathish Kumarba2b5da2016-11-08 14:58:29 +05306528 * @chan_nf: Channel noise floor (Units are in dBm)
6529 * @my_bss_rx_cycle_count: BSS rx cycle count
Govind Singh89727882016-04-15 13:58:27 +05306530 */
6531typedef struct _wmi_host_dcs_im_tgt_stats {
6532 uint32_t reg_tsf32;
6533 uint32_t last_ack_rssi;
6534 uint32_t tx_waste_time;
6535 uint32_t rx_time;
6536 uint32_t phyerr_cnt;
6537 wmi_host_dcs_mib_stats_t mib_stats;
Sathish Kumarba2b5da2016-11-08 14:58:29 +05306538 uint32_t chan_nf;
6539 uint32_t my_bss_rx_cycle_count;
Govind Singh89727882016-04-15 13:58:27 +05306540} wmi_host_dcs_im_tgt_stats_t;
6541
6542/**
6543 * Enum for pktlog req
6544 */
6545typedef enum {
6546 WMI_HOST_PKTLOG_EVENT_RX = 0x1,
6547 WMI_HOST_PKTLOG_EVENT_TX = 0x2,
6548 WMI_HOST_PKTLOG_EVENT_RCF = 0x4, /* Rate Control Find */
6549 WMI_HOST_PKTLOG_EVENT_RCU = 0x8, /* Rate Control Update */
6550 WMI_HOST_PKTLOG_EVENT_DBG_PRINT = 0x10, /* DEBUG prints */
6551 /* To support Smart Antenna */
6552 WMI_HOST_PKTLOG_EVENT_SMART_ANTENNA = 0x20,
6553 WMI_HOST_PKTLOG_EVENT_H_INFO = 0x40,
6554 WMI_HOST_PKTLOG_EVENT_STEERING = 0x80,
Sathish Kumar657402a2016-09-26 14:48:09 +05306555 /* To support Tx data Capture */
6556 WMI_HOST_PKTLOG_EVENT_TX_DATA_CAPTURE = 0x100,
Govind Singh89727882016-04-15 13:58:27 +05306557} WMI_HOST_PKTLOG_EVENT;
6558
6559/**
6560 * wmi_host_phyerr
6561 *
6562 */
6563#define WMI_HOST_PHY_ERROR_SPECTRAL_SCAN 0x26
6564#define WMI_HOST_PHY_ERROR_FALSE_RADAR_EXT 0x24
6565
6566#define WMI_HOST_AR900B_DFS_PHYERR_MASK 0x4
6567#define WMI_HOST_AR900B_SPECTRAL_PHYERR_MASK 0x4000000
6568
6569/**
6570 * struct wmi_host_perchain_rssi_info - per chain RSSI info
6571 * @rssi_pri20: RSSI on primary 20
6572 * @rssi_sec20: RSSI on secomdary 20
6573 * @rssi_sec40: RSSI secondary 40
6574 * @rssi_sec80: RSSI secondary 80
6575 */
6576typedef struct wmi_host_perchain_rssi_info {
6577 int8_t rssi_pri20;
6578 int8_t rssi_sec20;
6579 int8_t rssi_sec40;
6580 int8_t rssi_sec80;
6581} wmi_host_perchain_rssi_info_t;
6582
6583/**
6584 * struct _wmi_host_rf_info - RF measurement information
6585 * @rssi_comb: RSSI Information
6586 * @pc_rssi_info[4]: For now, we know we are getting information
6587 * for only 4 chains at max. For future extensions
6588 * use a define
6589 * @noise_floor: Noise floor information
6590 */
6591typedef struct _wmi_host_rf_info {
6592 int8_t rssi_comb;
6593 wmi_host_perchain_rssi_info_t pc_rssi_info[4];
6594 int16_t noise_floor[4];
6595} wmi_host_rf_info_t;
6596
6597/**
6598 * struct _wmi_host_chan_info
6599 * @center_freq1: center frequency 1 in MHz
6600 * @center_freq2: center frequency 2 in MHz -valid only for
6601 * 11ACVHT 80PLUS80 mode
6602 * @chan_width: channel width in MHz
6603 */
6604typedef struct _wmi_host_chan_info {
6605 u_int16_t center_freq1;
6606 u_int16_t center_freq2;
6607 u_int8_t chan_width;
6608} wmi_host_chan_info_t;
6609
6610/**
6611 * struct wmi_host_phyerr
6612 * @rf_info:
6613 * @chan_info:
6614 * @tsf64:
6615 * @phy_err_code:
6616 * @tsf_timestamp:
6617 * @bufp:
6618 * @buf_len:
6619 * @phy_err_mask0:
6620 * @phy_err_mask1:
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05306621 * @pdev_id: pdev_id
Govind Singh89727882016-04-15 13:58:27 +05306622 */
6623typedef struct _wmi_host_phyerr {
6624 wmi_host_rf_info_t rf_info;
6625 wmi_host_chan_info_t chan_info;
6626 uint64_t tsf64;
6627 int32_t phy_err_code;
6628 uint32_t tsf_timestamp;
6629 uint8_t *bufp;
6630 uint32_t buf_len;
6631 uint32_t phy_err_mask0;
6632 uint32_t phy_err_mask1;
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05306633 uint32_t pdev_id;
Govind Singh89727882016-04-15 13:58:27 +05306634} wmi_host_phyerr_t;
6635
6636/**
6637 * struct wmi_host_rtt_event_hdr
6638 * @req_id: request id
6639 * @status: status
6640 * @meas_done: measurement done flag
6641 * @meas_type: measurement type
6642 * @report_type: report type
6643 * @v3_status: v2 status
6644 * @v3_finish:
6645 * @v3_tm_start:
6646 * @num_ap: number of AP
6647 * @result: resuult
6648 * @dest_mac: destination mac
6649 */
6650typedef struct {
6651 uint16_t req_id;
6652 uint16_t status:1,
6653 meas_done:1,
6654 meas_type:3,
6655 report_type:3,
6656 v3_status:2,
6657 v3_finish:1,
6658 v3_tm_start:1,
6659 num_ap:4;
6660 uint16_t result;
6661 uint8_t dest_mac[IEEE80211_ADDR_LEN];
6662} wmi_host_rtt_event_hdr;
6663
6664/**
6665 * struct wmi_host_rtt_meas_event - RTT measurement event
6666 * @chain_mask:
6667 * @bw:
6668 * @rsvd:
6669 * @txrxchain_mask: Bit:0-3:chain mask
6670 * Bit 4-5: band width info
6671 * 00 --Legacy 20, 01 --HT/VHT20
6672 * 10 --HT/VHT40, 11 -- VHT80
6673 * @tod: resolution of 0.1ns
6674 * @toa: resolution of 0.1ns
6675 * @t3:
6676 * @t4:
6677 * @rssi0:
6678 * @rssi1:
6679 * @rssi2:
6680 * @rssi3:
6681 */
6682typedef struct {
6683 uint32_t chain_mask:3,
6684 bw:2,
6685 rsvd:27;
6686 uint32_t txrxchain_mask;
6687 uint64_t tod;
6688 uint64_t toa;
6689 uint64_t t3;
6690 uint64_t t4;
6691 uint32_t rssi0;
6692 uint32_t rssi1;
6693 uint32_t rssi2;
6694 uint32_t rssi3;
6695} wmi_host_rtt_meas_event;
6696
6697/*----RTT Report event definition ----*/
6698typedef enum {
6699 /* rtt cmd header parsing error --terminate */
6700 WMI_HOST_RTT_COMMAND_HEADER_ERROR = 0,
6701 /* rtt body parsing error -- skip current STA REQ */
6702 WMI_HOST_RTT_COMMAND_ERROR,
6703 /* rtt no resource -- terminate */
6704 WMI_HOST_RTT_MODULE_BUSY,
6705 /* STA exceed the support limit -- only server the first n STA */
6706 WMI_HOST_RTT_TOO_MANY_STA,
6707 /* any allocate failure */
6708 WMI_HOST_RTT_NO_RESOURCE,
6709 /* can not find vdev with vdev ID - skip current STA REQ */
6710 WMI_HOST_RTT_VDEV_ERROR,
6711 /* Tx failure -- continiue and measure number */
6712 WMI_HOST_RTT_TRANSIMISSION_ERROR,
6713 /* wait for first TM timer expire-terminate current STA measurement */
6714 WMI_HOST_RTT_TM_TIMER_EXPIRE,
6715 /* we do not support RTT measurement with this type of frame */
6716 WMI_HOST_RTT_FRAME_TYPE_NOSUPPORT,
6717 /* whole RTT measurement timer expire-terminate
6718 ** current STA measurement */
6719 WMI_HOST_RTT_TIMER_EXPIRE,
6720 /* channel swicth failed */
6721 WMI_HOST_RTT_CHAN_SWITCH_ERROR,
6722 /* TMR trans error, this dest peer will be skipped */
6723 WMI_HOST_RTT_TMR_TRANS_ERROR,
6724 /* V3 only. If both CFR and Token mismatch, do not report */
6725 WMI_HOST_RTT_NO_REPORT_BAD_CFR_TOKEN,
6726 /* For First TM, if CFR is bad, then do not report */
6727 WMI_HOST_RTT_NO_REPORT_FIRST_TM_BAD_CFR,
6728 /* do not allow report type2 mix with type 0, 1 */
6729 WMI_HOST_RTT_REPORT_TYPE2_MIX,
6730 /* LCI Configuration OK. - Responder only */
6731 WMI_HOST_RTT_LCI_CFG_OK,
6732 /* LCR configuration OK. - Responder only */
6733 WMI_HOST_RTT_LCR_CFG_OK,
6734 /* Bad configuration LCI (or) LCR request - Responder only */
6735 WMI_HOST_RTT_CFG_ERROR,
6736 WMI_HOST_WMI_RTT_REJECT_MAX,
6737} WMI_HOST_RTT_ERROR_INDICATOR;
6738typedef struct {
6739 wmi_host_rtt_event_hdr hdr;
6740 WMI_HOST_RTT_ERROR_INDICATOR reject_reason;
6741} wmi_host_rtt_error_report_event;
6742
6743#if defined(AR9888)
6744typedef enum {
6745 WMI_HOST_PROF_CPU_IDLE,
6746 WMI_HOST_PROF_PPDU_PROC,
6747 WMI_HOST_PROF_PPDU_POST,
6748 WMI_HOST_PROF_HTT_TX_INPUT,
6749 WMI_HOST_PROF_MSDU_ENQ,
6750 WMI_HOST_PROF_PPDU_POST_HAL,
6751 WMI_HOST_PROF_COMPUTE_TX_TIME,
6752
6753 /* Add new ID's above this. */
6754 WMI_HOST_PROF_MAX_ID,
6755} wmi_host_profile_id_t;
6756#endif
6757
6758#define WMI_HOST_WLAN_PROFILE_MAX_HIST 3
6759#define WMI_HOST_WLAN_PROFILE_MAX_BIN_CNT 32
6760
6761#if defined(AR9888)
6762#define WMI_HOST_MAX_PROFILE WMI_HOST_PROF_MAX_ID
6763#else
6764#define WMI_HOST_MAX_PROFILE WMI_HOST_WLAN_PROFILE_MAX_BIN_CNT
6765#endif
6766
6767/**
6768 * struct wmi_host_wlan_profile - Host profile param
6769 * @id: profile id
6770 * @cnt: Count
6771 * @tot:
6772 * @min: minimum
6773 * @max: Mac
6774 * @hist_intvl: history interval
6775 * @hist: profile data history
6776 */
6777typedef struct {
6778 uint32_t id;
6779 uint32_t cnt;
6780 uint32_t tot;
6781 uint32_t min;
6782 uint32_t max;
6783 uint32_t hist_intvl;
6784 uint32_t hist[WMI_HOST_WLAN_PROFILE_MAX_HIST];
6785} wmi_host_wlan_profile_t;
6786
6787/**
6788 * struct wmi_host_wlan_profile_ctx_t - profile context
6789 * @tot: time in us
6790 * @tx_msdu_cnt: MSDU TX count
6791 * @tx_mpdu_cnt: MPDU tx count
6792 * @tx_ppdu_cnt: PPDU tx count
6793 * @rx_msdu_cnt: MSDU RX count
6794 * @rx_mpdu_cnt: MPDU RXcount
6795 * @bin_count: Bin count
6796 */
6797typedef struct {
6798 uint32_t tot;
6799 uint32_t tx_msdu_cnt;
6800 uint32_t tx_mpdu_cnt;
6801 uint32_t tx_ppdu_cnt;
6802 uint32_t rx_msdu_cnt;
6803 uint32_t rx_mpdu_cnt;
6804 uint32_t bin_count;
6805} wmi_host_wlan_profile_ctx_t;
6806
6807/**
Govind Singh89727882016-04-15 13:58:27 +05306808 * struct wmi_host_chan_info_event - Channel info WMI event
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05306809 * @pdev_id: pdev_id
Govind Singh89727882016-04-15 13:58:27 +05306810 * @err_code: Error code
6811 * @freq: Channel freq
6812 * @cmd_flags: Read flags
6813 * @noise_floor: Noise Floor value
6814 * @rx_clear_count: rx clear count
6815 * @cycle_count: cycle count
6816 * @chan_tx_pwr_range: channel tx power per range
6817 * @chan_tx_pwr_tp: channel tx power per throughput
6818 * @rx_frame_count: rx frame count
6819 * @rx_11b_mode_data_duration: 11b mode data duration
6820 */
6821typedef struct {
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05306822 uint32_t pdev_id;
Govind Singh89727882016-04-15 13:58:27 +05306823 uint32_t err_code;
6824 uint32_t freq;
6825 uint32_t cmd_flags;
6826 uint32_t noise_floor;
6827 uint32_t rx_clear_count;
6828 uint32_t cycle_count;
6829 uint32_t chan_tx_pwr_range;
6830 uint32_t chan_tx_pwr_tp;
6831 uint32_t rx_frame_count;
6832 uint32_t rx_11b_mode_data_duration;
6833} wmi_host_chan_info_event;
6834
6835/**
6836 * struct wmi_host_pdev_channel_hopping_event
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05306837 * @pdev_id: pdev_id
Govind Singh89727882016-04-15 13:58:27 +05306838 * @noise_floor_report_iter: Noise threshold iterations with high values
6839 * @noise_floor_total_iter: Total noise threshold iterations
6840 */
6841typedef struct {
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05306842 uint32_t pdev_id;
Govind Singh89727882016-04-15 13:58:27 +05306843 uint32_t noise_floor_report_iter;
6844 uint32_t noise_floor_total_iter;
6845} wmi_host_pdev_channel_hopping_event;
6846
6847/**
6848 * struct wmi_host_pdev_bss_chan_info_event
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05306849 * @pdev_id: pdev_id
Govind Singh89727882016-04-15 13:58:27 +05306850 * @freq: Units in MHz
6851 * @noise_floor: units are dBm
6852 * @rx_clear_count_low:
6853 * @rx_clear_count_high:
6854 * @cycle_count_low:
6855 * @cycle_count_high:
6856 * @tx_cycle_count_low:
6857 * @tx_cycle_count_high:
6858 * @rx_cycle_count_low:
6859 * @rx_cycle_count_high:
6860 * @rx_bss_cycle_count_low:
6861 * @rx_bss_cycle_count_high:
6862 * @reserved:
6863 */
6864typedef struct {
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05306865 uint32_t pdev_id;
Govind Singh89727882016-04-15 13:58:27 +05306866 uint32_t freq;
6867 uint32_t noise_floor;
6868 uint32_t rx_clear_count_low;
6869 uint32_t rx_clear_count_high;
6870 uint32_t cycle_count_low;
6871 uint32_t cycle_count_high;
6872 uint32_t tx_cycle_count_low;
6873 uint32_t tx_cycle_count_high;
6874 uint32_t rx_cycle_count_low;
6875 uint32_t rx_cycle_count_high;
6876 uint32_t rx_bss_cycle_count_low;
6877 uint32_t rx_bss_cycle_count_high;
6878 uint32_t reserved;
6879} wmi_host_pdev_bss_chan_info_event;
6880
6881#define WMI_HOST_INST_STATS_INVALID_RSSI 0
6882/**
6883 * struct wmi_host_inst_stats_resp
6884 * @iRSSI: Instantaneous RSSI
6885 * @peer_macaddr: peer mac address
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05306886 * @pdev_id: pdev_id
Govind Singh89727882016-04-15 13:58:27 +05306887 */
6888typedef struct {
6889 uint32_t iRSSI;
6890 wmi_host_mac_addr peer_macaddr;
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05306891 uint32_t pdev_id;
Govind Singh89727882016-04-15 13:58:27 +05306892} wmi_host_inst_stats_resp;
6893
6894/* Event definition and new structure addition to send event
6895 * to host to block/unblock tx data traffic based on peer_ast_idx or vdev id
6896 */
6897#define WMI_HOST_INVALID_PEER_AST_INDEX 0xffff
6898#define WMI_HOST_TX_DATA_TRAFFIC_CTRL_BLOCK 0x1
6899#define WMI_HOST_TX_DATA_TRAFFIC_CTRL_UNBLOCK 0x2
6900/**
6901 * struct wmi_host_tx_data_traffic_ctrl_event
6902 * @peer_ast_idx: For vdev based control, peer_ast_idx will be
6903 * WMI_INVALID_PEER_AST_INDEX
6904 * @vdev_id: only applies if peer_ast_idx == INVALID
6905 * @ctrl_cmd: WMI_TX_DATA_TRAFFIC_CTRL_BLOCK or
6906 * WMI_TX_DATA_TRAFFIC_CTRL_UNBLOCK
6907 */
6908typedef struct {
6909 uint32_t peer_ast_idx;
6910 uint32_t vdev_id;
6911 uint32_t ctrl_cmd;
6912} wmi_host_tx_data_traffic_ctrl_event;
6913
Sathish Kumar7e2eaed2016-11-14 17:44:29 +05306914enum {
6915 WMI_HOST_ATF_PEER_STATS_DISABLED = 0,
6916 WMI_HOST_ATF_PEER_STATS_ENABLED = 1,
6917};
6918
6919#define WMI_HOST_ATF_PEER_STATS_GET_PEER_AST_IDX(token_info) \
6920 (token_info.field1 & 0xffff)
6921
6922#define WMI_HOST_ATF_PEER_STATS_GET_USED_TOKENS(token_info) \
6923 ((token_info.field2 & 0xffff0000) >> 16)
6924
6925#define WMI_HOST_ATF_PEER_STATS_GET_UNUSED_TOKENS(token_info) \
6926 (token_info.field2 & 0xffff)
6927
6928#define WMI_HOST_ATF_PEER_STATS_SET_PEER_AST_IDX(token_info, peer_ast_idx) \
6929 do { \
6930 token_info.field1 &= 0xffff0000; \
6931 token_info.field1 |= ((peer_ast_idx) & 0xffff); \
6932 } while (0)
6933
6934#define WMI_HOST_ATF_PEER_STATS_SET_USED_TOKENS(token_info, used_token) \
6935 do { \
6936 token_info.field2 &= 0x0000ffff; \
6937 token_info.field2 |= (((used_token) & 0xffff) << 16); \
6938 } while (0)
6939
6940#define WMI_HOST_ATF_PEER_STATS_SET_UNUSED_TOKENS(token_info, unused_token) \
6941 do { \
6942 token_info.field2 &= 0xffff0000; \
6943 token_info.field2 |= ((unused_token) & 0xffff); \
6944 } while (0)
6945
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05306946/**
6947 * struct wmi_host_atf_peer_stats_info
6948 * @field1: bits 15:0 peer_ast_index WMI_ATF_PEER_STATS_GET_PEER_AST_IDX
6949 * bits 31:16 reserved
6950 * @field2: bits 15:0 used tokens WMI_ATF_PEER_STATS_GET_USED_TOKENS
6951 * bits 31:16 unused tokens WMI_ATF_PEER_STATS_GET_UNUSED_TOKENS
6952 * @field3: for future use
6953 */
Sathish Kumar7e2eaed2016-11-14 17:44:29 +05306954typedef struct {
Sathish Kumar7e2eaed2016-11-14 17:44:29 +05306955 uint32_t field1;
6956 uint32_t field2;
6957 uint32_t field3;
6958} wmi_host_atf_peer_stats_info;
6959
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05306960/**
6961 * struct wmi_host_atf_peer_stats_event
6962 * @pdev_id: pdev_id
6963 * @num_atf_peers: number of peers in token_info_list
6964 * @comp_usable_airtime: computed usable airtime in tokens
6965 * @reserved[4]: reserved for future use
6966 * @wmi_host_atf_peer_stats_info token_info_list: list of num_atf_peers
6967 */
Sathish Kumar7e2eaed2016-11-14 17:44:29 +05306968typedef struct {
Kiran Venkatappa6e7bb5e2017-02-08 14:51:13 +05306969 uint32_t pdev_id;
6970 uint32_t num_atf_peers;
6971 uint32_t comp_usable_airtime;
6972 uint32_t reserved[4];
6973 wmi_host_atf_peer_stats_info token_info_list[1];
Sathish Kumar7e2eaed2016-11-14 17:44:29 +05306974} wmi_host_atf_peer_stats_event;
6975
Govind Singh89727882016-04-15 13:58:27 +05306976/**
6977 * struct wmi_host_ath_dcs_cw_int
6978 * @channel: either number or freq in mhz
6979 */
6980typedef struct {
6981 uint32_t channel;
6982} wmi_host_ath_dcs_cw_int;
Govind Singhc10bde82016-05-02 17:59:24 +05306983
6984#define WMI_MAX_POWER_DBG_ARGS 8
6985
6986/**
6987 * struct wmi_power_dbg_params - power debug command parameter
6988 * @pdev_id: subsystem identifier
6989 * @module_id: parameter id
6990 * @num_arg: no of arguments
6991 * @args: arguments
6992 */
6993struct wmi_power_dbg_params {
6994 uint32_t pdev_id;
6995 uint32_t module_id;
6996 uint32_t num_args;
6997 uint32_t args[WMI_MAX_POWER_DBG_ARGS];
6998};
6999
Gupta, Kapil7b768002016-04-25 19:14:19 +05307000/**
7001 * struct wmi_adaptive_dwelltime_params - the adaptive dwelltime params
7002 * @vdev_id: vdev id
7003 * @is_enabled: Adaptive dwell time is enabled/disabled
7004 * @dwelltime_mode: global default adaptive dwell mode
7005 * @lpf_weight: weight to calculate the average low pass
7006 * filter for channel congestion
7007 * @passive_mon_intval: intval to monitor wifi activity in passive scan in msec
7008 * @wifi_act_threshold: % of wifi activity used in passive scan 0-100
7009 *
7010 */
7011struct wmi_adaptive_dwelltime_params {
7012 uint32_t vdev_id;
7013 bool is_enabled;
7014 enum wmi_dwelltime_adaptive_mode dwelltime_mode;
7015 uint8_t lpf_weight;
7016 uint8_t passive_mon_intval;
7017 uint8_t wifi_act_threshold;
7018};
Govind Singhc7cd2d62016-06-21 14:33:26 +05307019
7020/**
7021 * struct wmi_fw_dump_seg_req - individual segment details
7022 * @seg_id - segment id.
7023 * @seg_start_addr_lo - lower address of the segment.
7024 * @seg_start_addr_hi - higher address of the segment.
7025 * @seg_length - length of the segment.
7026 * @dst_addr_lo - lower address of the destination buffer.
7027 * @dst_addr_hi - higher address of the destination buffer.
7028 *
7029 * This structure carries the information to firmware about the
7030 * individual segments. This structure is part of firmware memory
7031 * dump request.
7032 */
7033struct wmi_fw_dump_seg_req {
7034 uint8_t seg_id;
7035 uint32_t seg_start_addr_lo;
7036 uint32_t seg_start_addr_hi;
7037 uint32_t seg_length;
7038 uint32_t dst_addr_lo;
7039 uint32_t dst_addr_hi;
7040};
7041
7042/**
7043 * enum wmi_userspace_log_level - Log level at userspace
7044 * @WMI_LOG_LEVEL_NO_COLLECTION: verbose_level 0 corresponds to no collection
7045 * @WMI_LOG_LEVEL_NORMAL_COLLECT: verbose_level 1 correspond to normal log
7046 * level with minimal user impact. This is the default value.
7047 * @WMI_LOG_LEVEL_ISSUE_REPRO: verbose_level 2 are enabled when user is lazily
7048 * trying to reproduce a problem, wifi performances and power can be impacted
7049 * but device should not otherwise be significantly impacted
7050 * @WMI_LOG_LEVEL_ACTIVE: verbose_level 3+ are used when trying to
7051 * actively debug a problem
7052 *
7053 * Various log levels defined in the userspace for logging applications
7054 */
7055enum wmi_userspace_log_level {
7056 WMI_LOG_LEVEL_NO_COLLECTION,
7057 WMI_LOG_LEVEL_NORMAL_COLLECT,
7058 WMI_LOG_LEVEL_ISSUE_REPRO,
7059 WMI_LOG_LEVEL_ACTIVE,
7060};
7061
Padma, Santhosh Kumar73524052016-09-11 18:24:59 +05307062/**
7063 * struct encrypt_decrypt_req_params - encrypt/decrypt params
7064 * @vdev_id: virtual device id
7065 * @key_flag: This indicates firmware to encrypt/decrypt payload
7066 * see ENCRYPT_DECRYPT_FLAG
7067 * @key_idx: Index used in storing key
7068 * @key_cipher: cipher used for encryption/decryption
7069 * Eg: see WMI_CIPHER_AES_CCM for CCMP
7070 * @key_len: length of key data
7071 * @key_txmic_len: length of Tx MIC
7072 * @key_rxmic_len: length of Rx MIC
7073 * @key_data: Key
7074 * @pn: packet number
7075 * @mac_header: MAC header
7076 * @data_len: length of data
7077 * @data: pointer to payload
7078 */
7079struct encrypt_decrypt_req_params {
7080 uint32_t vdev_id;
7081 uint8_t key_flag;
7082 uint32_t key_idx;
7083 uint32_t key_cipher;
7084 uint32_t key_len;
7085 uint32_t key_txmic_len;
7086 uint32_t key_rxmic_len;
7087 uint8_t key_data[MAC_MAX_KEY_LENGTH];
7088 uint8_t pn[MAC_PN_LENGTH];
7089 uint8_t mac_header[MAX_MAC_HEADER_LEN];
7090 uint32_t data_len;
7091 uint8_t *data;
7092};
7093
Kiran Venkatappa176fe6c2016-12-26 15:38:06 +05307094/*
7095 * HW mode config type replicated from FW header
7096 * @WMI_HOST_HW_MODE_SINGLE: Only one PHY is active.
7097 * @WMI_HOST_HW_MODE_DBS: Both PHYs are active in different bands,
7098 * one in 2G and another in 5G.
7099 * @WMI_HOST_HW_MODE_SBS_PASSIVE: Both PHYs are in passive mode (only rx) in
7100 * same band; no tx allowed.
7101 * @WMI_HOST_HW_MODE_SBS: Both PHYs are active in the same band.
7102 * Support for both PHYs within one band is planned
7103 * for 5G only(as indicated in WMI_MAC_PHY_CAPABILITIES),
7104 * but could be extended to other bands in the future.
7105 * The separation of the band between the two PHYs needs
7106 * to be communicated separately.
7107 * @WMI_HOST_HW_MODE_DBS_SBS: 3 PHYs, with 2 on the same band doing SBS
7108 * as in WMI_HW_MODE_SBS, and 3rd on the other band
Kiran Venkatappaaf1dae32016-12-23 19:58:54 +05307109 * @WMI_HOST_HW_MODE_MAX: Max hw_mode_id. Used to indicate invalid mode.
Kiran Venkatappa176fe6c2016-12-26 15:38:06 +05307110 */
7111enum wmi_host_hw_mode_config_type {
7112 WMI_HOST_HW_MODE_SINGLE = 0,
7113 WMI_HOST_HW_MODE_DBS = 1,
7114 WMI_HOST_HW_MODE_SBS_PASSIVE = 2,
7115 WMI_HOST_HW_MODE_SBS = 3,
7116 WMI_HOST_HW_MODE_DBS_SBS = 4,
Kiran Venkatappaaf1dae32016-12-23 19:58:54 +05307117 WMI_HOST_HW_MODE_MAX,
Kiran Venkatappa176fe6c2016-12-26 15:38:06 +05307118};
7119
Kiran Venkatappa9c71b362016-08-10 23:55:40 +05307120/**
7121 * struct wmi_host_service_ext_param - EXT service base params in event
7122 * @default_conc_scan_config_bits: Default concurrenct scan config
7123 * @default_fw_config_bits: Default HW config bits
7124 * @wmi_host_ppe_threshold ppet: Host PPE threshold struct
7125 * @he_cap_info: HE capabality info
7126 * @mpdu_density: units are microseconds
7127 * @max_bssid_rx_filters: Maximum no of BSSID based RX filters host can program
7128 * Value 0 means FW hasn't given any limit to host.
7129 * @num_hw_modes: Number of HW modes in event
7130 * @num_phy: Number of Phy mode.
7131 */
7132struct wmi_host_service_ext_param {
7133 uint32_t default_conc_scan_config_bits;
7134 uint32_t default_fw_config_bits;
7135 struct wmi_host_ppe_threshold ppet;
7136 uint32_t he_cap_info;
7137 uint32_t mpdu_density;
7138 uint32_t max_bssid_rx_filters;
7139 uint32_t num_hw_modes;
7140 uint32_t num_phy;
7141};
7142
7143/**
7144 * struct wmi_host_hw_mode_caps - HW mode capabilities in EXT event
7145 * @hw_mode_id: identify a particular set of HW characteristics,
7146 * as specified by the subsequent fields
7147 * @phy_id_map: BIT0 represents phy_id 0, BIT1 represent phy_id 1 and so on
Kiran Venkatappa176fe6c2016-12-26 15:38:06 +05307148 * @hw_mode_config_type: HW mode config type
Kiran Venkatappa9c71b362016-08-10 23:55:40 +05307149 */
7150struct wmi_host_hw_mode_caps {
7151 uint32_t hw_mode_id;
7152 uint32_t phy_id_map;
Kiran Venkatappa176fe6c2016-12-26 15:38:06 +05307153 uint32_t hw_mode_config_type;
Kiran Venkatappa9c71b362016-08-10 23:55:40 +05307154};
7155
7156/**
7157 * struct wmi_host_mac_phy_caps - Phy caps recvd in EXT service
7158 * @hw_mode_id: identify a particular set of HW characteristics,
7159 * as specified by the subsequent fields. WMI_MAC_PHY_CAPABILITIES
7160 * element must be mapped to its parent WMI_HW_MODE_CAPABILITIES
7161 * element using hw_mode_id. No particular ordering of
7162 * WMI_MAC_PHY_CAPABILITIES elements should be
7163 * assumed, though in practice the elements may always be ordered
7164 * by hw_mode_id.
7165 * @pdev_id: pdev_id starts with 1. pdev_id 1 => phy_id 0, pdev_id 2 => phy_id 1
7166 * @phy_id: Starts with 0
Kiran Venkatappa176fe6c2016-12-26 15:38:06 +05307167 * @bitmap of supported modulations
Krishna Rao7462a8a2017-02-13 15:14:11 +05307168 * @supported_bands: supported bands, enum WLAN_BAND_CAPABILITY (mapped to
7169 * enum WMI_HOST_WLAN_BAND_CAPABILITY within host)
Kiran Venkatappa9c71b362016-08-10 23:55:40 +05307170 * @ampdu_density: ampdu density 0 for no restriction, 1 for 1/4 us,
7171 * 2 for 1/2 us, 3 for 1 us,4 for 2 us, 5 for 4 us,
7172 * 6 for 8 us,7 for 16 us
Krishna Rao7462a8a2017-02-13 15:14:11 +05307173 * @max_bw_supported_2G: max bw supported 2G, enum wmi_channel_width (mapped to
7174 * enum wmi_host_channel_width within host)
Kiran Venkatappa9c71b362016-08-10 23:55:40 +05307175 * @ht_cap_info_2G: WMI HT Capability, WMI_HT_CAP defines
7176 * @vht_cap_info_2G: VHT capability info field of 802.11ac, WMI_VHT_CAP defines
7177 * @vht_supp_mcs_2G: VHT Supported MCS Set field Rx/Tx same
7178 * The max VHT-MCS for n SS subfield (where n = 1,...,8) is encoded as
7179 * follows
7180 * - 0 indicates support for VHT-MCS 0-7 for n spatial streams
7181 * - 1 indicates support for VHT-MCS 0-8 for n spatial streams
7182 * - 2 indicates support for VHT-MCS 0-9 for n spatial streams
7183 * - 3 indicates that n spatial streams is not supported
7184 * @he_cap_info_2G: HE capability info field of 802.11ax, WMI_HE_CAP defines
7185 * @he_supp_mcs_2G: HE Supported MCS Set field Rx/Tx same
7186 * @tx_chain_mask_2G: Valid Transmit chain mask
7187 * @rx_chain_mask_2G: Valid Receive chain mask
Krishna Rao7462a8a2017-02-13 15:14:11 +05307188 * @max_bw_supported_5G: max bw supported 5G, enum wmi_channel_width (mapped to
7189 * enum wmi_host_channel_width within host)
Kiran Venkatappa9c71b362016-08-10 23:55:40 +05307190 * @ht_cap_info_5G: WMI HT Capability, WMI_HT_CAP defines
7191 * @vht_cap_info_5G: VHT capability info field of 802.11ac, WMI_VHT_CAP defines
7192 * @vht_supp_mcs_5G: VHT Supported MCS Set field Rx/Tx same
7193 * The max VHT-MCS for n SS subfield (where n = 1,...,8) is encoded as
7194 * follows
7195 * - 0 indicates support for VHT-MCS 0-7 for n spatial streams
7196 * - 1 indicates support for VHT-MCS 0-8 for n spatial streams
7197 * - 2 indicates support for VHT-MCS 0-9 for n spatial streams
7198 * - 3 indicates that n spatial streams is not supported
7199 * @he_cap_info_5G: HE capability info field of 802.11ax, WMI_HE_CAP defines
7200 * @he_supp_mcs_5G: HE Supported MCS Set field Rx/Tx same
7201 * @tx_chain_mask_5G: Valid Transmit chain mask
7202 * @rx_chain_mask_5G: Valid Receive chain mask
Kris Muthusamy1499bac2017-02-20 02:35:47 -08007203 * @he_cap_phy_info_2G: 2G HE capability phy field
7204 * @he_cap_phy_info_5G: 5G HE capability phy field
7205 * @he_ppet2G: 2G HE PPET info
7206 * @he_ppet5G: 5G HE PPET info
Kiran Venkatappa9c71b362016-08-10 23:55:40 +05307207 */
7208struct wmi_host_mac_phy_caps {
7209 uint32_t hw_mode_id;
7210 uint32_t pdev_id;
7211 uint32_t phy_id;
Kiran Venkatappa176fe6c2016-12-26 15:38:06 +05307212 uint32_t supports_11b:1,
7213 supports_11g:1,
7214 supports_11a:1,
7215 supports_11n:1,
7216 supports_11ac:1,
7217 supports_11ax:1;
Kiran Venkatappa9c71b362016-08-10 23:55:40 +05307218 uint32_t supported_bands;
7219 uint32_t ampdu_density;
7220 uint32_t max_bw_supported_2G;
7221 uint32_t ht_cap_info_2G;
7222 uint32_t vht_cap_info_2G;
7223 uint32_t vht_supp_mcs_2G;
7224 uint32_t he_cap_info_2G;
7225 uint32_t he_supp_mcs_2G;
7226 uint32_t tx_chain_mask_2G;
7227 uint32_t rx_chain_mask_2G;
7228 uint32_t max_bw_supported_5G;
7229 uint32_t ht_cap_info_5G;
7230 uint32_t vht_cap_info_5G;
7231 uint32_t vht_supp_mcs_5G;
7232 uint32_t he_cap_info_5G;
7233 uint32_t he_supp_mcs_5G;
7234 uint32_t tx_chain_mask_5G;
7235 uint32_t rx_chain_mask_5G;
Kris Muthusamy1499bac2017-02-20 02:35:47 -08007236 uint32_t he_cap_phy_info_2G[WMI_MAX_HECAP_PHY_SIZE];
7237 uint32_t he_cap_phy_info_5G[WMI_MAX_HECAP_PHY_SIZE];
7238 struct wmi_host_ppe_threshold he_ppet2G;
7239 struct wmi_host_ppe_threshold he_ppet5G;
Kiran Venkatappa9c71b362016-08-10 23:55:40 +05307240};
7241
7242/**
7243 * struct WMI_HOST_HAL_REG_CAPABILITIES_EXT: Below are Reg caps per PHY.
7244 * Please note PHY ID starts with 0.
7245 * @phy_id: phy id starts with 0.
7246 * @eeprom_reg_domain: regdomain value specified in EEPROM
7247 * @eeprom_reg_domain_ext: regdomain
7248 * @regcap1: CAP1 capabilities bit map, see REGDMN_CAP1_ defines
7249 * @regcap2: REGDMN EEPROM CAP, see REGDMN_EEPROM_EEREGCAP_ defines
7250 * @wireless_modes: REGDMN MODE, see REGDMN_MODE_ enum
7251 * @low_2ghz_chan: 2G channel low
7252 * @high_2ghz_chan: 2G channel High
7253 * @low_5ghz_chan: 5G channel low
7254 * @high_5ghz_chan: 5G channel High
7255 */
7256struct WMI_HOST_HAL_REG_CAPABILITIES_EXT {
7257 uint32_t phy_id;
7258 uint32_t eeprom_reg_domain;
7259 uint32_t eeprom_reg_domain_ext;
7260 uint32_t regcap1;
7261 uint32_t regcap2;
7262 uint32_t wireless_modes;
7263 uint32_t low_2ghz_chan;
7264 uint32_t high_2ghz_chan;
7265 uint32_t low_5ghz_chan;
7266 uint32_t high_5ghz_chan;
7267};
Govind Singh3ddda1f2016-03-09 11:34:12 +05307268
Sathish Kumar7e2eaed2016-11-14 17:44:29 +05307269/*
7270 * struct wmi_host_peer_txmu_cnt_event
7271 * @tx_mu_transmitted - MU-MIMO tx count
7272 */
7273typedef struct {
7274 uint32_t tx_mu_transmitted;
7275} wmi_host_peer_txmu_cnt_event;
7276
Manikandan Mohan7e5ad482016-12-13 13:14:06 -08007277#define MAX_SAR_LIMIT_ROWS_SUPPORTED 64
7278/**
7279 * struct sar_limit_cmd_row - sar limts row
7280 * @band_id: Optional param for frequency band
7281 * @chain_id: Optional param for antenna chain id
7282 * @mod_id: Optional param for modulation scheme
7283 * @limit_value: Mandatory param providing power limits in steps of 0.5 dbm
7284 * @validity_bitmap: bitmap of valid optional params in sar_limit_cmd_row struct
7285 */
7286struct sar_limit_cmd_row {
7287 uint32_t band_id;
7288 uint32_t chain_id;
7289 uint32_t mod_id;
7290 uint32_t limit_value;
7291 uint32_t validity_bitmap;
7292};
7293
7294/**
7295 * struct sar_limit_cmd_params - sar limts params
7296 * @sar_enable: flag to enable SAR
7297 * @num_limit_rows: number of items in sar_limits
7298 * @commit_limits: indicates firmware to start apply new SAR values
7299 * @sar_limit_row_list: pointer to array of sar limit rows
7300 */
7301struct sar_limit_cmd_params {
7302 uint32_t sar_enable;
7303 uint32_t num_limit_rows;
7304 uint32_t commit_limits;
7305 struct sar_limit_cmd_row *sar_limit_row_list;
7306};
7307
Sathish Kumar7e2eaed2016-11-14 17:44:29 +05307308/*
7309 * struct wmi_peer_gid_userpos_list_event
7310 * @usr_list - User list
7311 */
7312#define GID_OVERLOAD_GROUP_COUNT 15
7313typedef struct {
7314 uint32_t usr_list[GID_OVERLOAD_GROUP_COUNT];
7315} wmi_host_peer_gid_userpos_list_event;
7316
7317#define WMI_HOST_BOARD_MCN_STRING_MAX_SIZE 19
7318#define WMI_HOST_BOARD_MCN_STRING_BUF_SIZE \
7319 (WMI_HOST_BOARD_MCN_STRING_MAX_SIZE+1) /* null-terminator */
7320
7321typedef struct {
7322 uint32_t software_cal_version;
7323 uint32_t board_cal_version;
7324 /* board_mcn_detail:
7325 * Provide a calibration message string for the host to display.
7326 * Note: on a big-endian host, the 4 bytes within each A_UINT32 portion
7327 * of a WMI message will be automatically byteswapped by the copy engine
7328 * as the messages are transferred between host and target, to convert
7329 * between the target's little-endianness and the host's big-endianness.
7330 * Consequently, a big-endian host should manually unswap the bytes
7331 * within the board_mcn_detail string buffer to get the bytes back into
7332 * the desired natural order.
7333 */
7334 uint8_t board_mcn_detail[WMI_HOST_BOARD_MCN_STRING_BUF_SIZE];
7335 uint32_t cal_ok; /* filled with CALIBRATION_STATUS enum value */
7336} wmi_host_pdev_check_cal_version_event;
7337
Kiran Venkatappa4110f0a2016-12-27 22:51:29 +05307338/**
7339 * enum WMI_HOST_CALIBRATION_STATUS - Host defined Enums for cal status
7340 * @WMI_HOST_NO_FEATURE: The board was calibrated with a meta
7341 * which did not have this feature
7342 * @WMI_HOST_CALIBRATION_OK: The calibration status is OK
7343 * @WMI_HOST_CALIBRATION_NOT_OK: The calibration status is NOT OK
7344 */
7345enum WMI_HOST_CALIBRATION_STATUS {
7346 WMI_HOST_NO_FEATURE = 0,
7347 WMI_HOST_CALIBRATION_OK,
7348 WMI_HOST_CALIBRATION_NOT_OK,
7349};
7350
Paul Zhanga9ec9432017-01-04 16:45:42 +08007351#define WMI_SUPPORTED_ACTION_CATEGORY 256
7352#define WMI_SUPPORTED_ACTION_CATEGORY_ELE_LIST (WMI_SUPPORTED_ACTION_CATEGORY/32)
7353
7354/**
7355 * struct action_wakeup_set_param - action wakeup set params
7356 * @vdev_id: virtual device id
7357 * @operation: 0 reset to fw default, 1 set the bits,
7358 * 2 add the setting bits, 3 delete the setting bits
7359 * @action_category_map: bit mapping.
7360 */
7361struct action_wakeup_set_param {
7362 uint32_t vdev_id;
7363 uint32_t operation;
7364 uint32_t action_category_map[WMI_SUPPORTED_ACTION_CATEGORY_ELE_LIST];
7365};
7366
Sathish Kumar617535c2017-01-24 17:51:26 +05307367/**
7368 * struct wmi_host_pdev_utf_event - Host defined struct to hold utf event data
7369 * @data: Pointer to data
7370 * @datalen: Data length
7371 *
7372 */
7373struct wmi_host_pdev_utf_event {
7374 uint8_t *data;
7375 uint16_t datalen;
7376};
7377
Kiran Venkatappa9b7a9592016-12-29 18:09:32 +05307378/**
Vijay Pamidipatiadd0ba72017-01-17 12:53:05 +05307379 * struct wmi_host_peer_delete_response_event - Peer Delete response event param
7380 * @vdev_id: vdev id
7381 * @mac_address: Peer Mac Address
7382 *
7383 */
7384struct wmi_host_peer_delete_response_event {
7385 uint32_t vdev_id;
7386 struct qdf_mac_addr mac_address;
7387};
7388
7389/**
Kiran Venkatappa9b7a9592016-12-29 18:09:32 +05307390 * @struct wmi_host_dcs_interference_param
7391 * @interference_type: Type of DCS Interference
7392 * @uint32_t pdev_id: pdev id
7393 */
7394struct wmi_host_dcs_interference_param {
7395 uint32_t interference_type;
7396 uint32_t pdev_id;
7397};
7398
Kiran Venkatappa9f5fcc02016-12-29 22:07:14 +05307399/*
7400 * struct wmi_host_fips_event_param: FIPS event param
7401 * @pdev_id: pdev id
7402 * @error_status: Error status: 0 (no err), 1, or OPER_TIMEOUR
7403 * @data_len: FIPS data lenght
7404 * @data: pointer to data
7405 */
7406struct wmi_host_fips_event_param {
7407 uint32_t pdev_id;
7408 uint32_t error_status;
7409 uint32_t data_len;
7410 uint32_t *data;
7411};
Kiran Venkatappa3f061a92017-02-08 14:57:16 +05307412
7413/**
7414 * struct wmi_host_proxy_ast_reserve_param
7415 * @pdev_id: pdev id
7416 * @result: result
7417 */
7418struct wmi_host_proxy_ast_reserve_param {
7419 uint32_t pdev_id;
7420 uint32_t result;
7421};
Kiran Venkatappaaf1dae32016-12-23 19:58:54 +05307422
7423/**
7424 * struct wmi_host_pdev_band_to_mac - freq range for mac
7425 * @pdev_id: PDEV ID to identifiy mac
7426 * @start_freq: start frequency value
7427 * @end_freq: end frequency value
7428 */
7429struct wmi_host_pdev_band_to_mac {
7430 uint32_t pdev_id;
7431 uint32_t start_freq;
7432 uint32_t end_freq;
7433};
7434#define WMI_HOST_MAX_PDEV 3
7435
7436/**
7437 * struct wmi_init_cmd_param - INIT command params
7438 * @target_resource_config: pointer to resource config
7439 * @num_mem_chunks: number of memory chunks
7440 * @struct wmi_host_mem_chunk: pointer to memory chunks
7441 * @hw_mode_index: HW mode index chosen
7442 * @num_band_to_mac: Number of band to mac setting
7443 * @struct wmi_host_pdev_band_to_mac: band to mac setting
7444 */
7445struct wmi_init_cmd_param {
7446 target_resource_config *res_cfg;
7447 uint8_t num_mem_chunks;
7448 struct wmi_host_mem_chunk *mem_chunks;
7449 uint32_t hw_mode_id;
7450 uint32_t num_band_to_mac;
7451 struct wmi_host_pdev_band_to_mac band_to_mac[WMI_HOST_MAX_PDEV];
7452};
Sathish Kumar907a7462017-02-27 10:35:40 +05307453
7454/**
7455 * struct pdev_csa_switch_count_status - CSA switch count status event param
7456 * @pdev_id: Physical device identifier
7457 * @current_switch_count: Current CSA switch count
7458 * @num_vdevs: Number of vdevs that need restart
7459 * @vdev_ids: Array containing the vdev ids that need restart
7460 */
7461struct pdev_csa_switch_count_status {
7462 uint32_t pdev_id;
7463 uint32_t current_switch_count;
7464 uint32_t num_vdevs;
7465 uint32_t *vdev_ids;
7466};
7467
Sathish Kumar7e2eaed2016-11-14 17:44:29 +05307468#endif /* _WMI_UNIFIED_PARAM_H_ */