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