xref: /wlan-dirver/qca-wifi-host-cmn/wmi/inc/wmi_unified_param.h (revision 1397a33f48ea6455be40871470b286e535820eb8)
1 /*
2  * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 /*
20  * This file contains the API definitions for the Unified Wireless Module
21  * Interface (WMI).
22  */
23 
24 #ifndef _WMI_UNIFIED_PARAM_H_
25 #define _WMI_UNIFIED_PARAM_H_
26 
27 #include <wlan_scan_public_structs.h>
28 #ifdef CONVERGED_TDLS_ENABLE
29 #include <wlan_tdls_public_structs.h>
30 #endif
31 
32 #define MAC_MAX_KEY_LENGTH 32
33 #define MAC_PN_LENGTH 8
34 #define MAX_MAC_HEADER_LEN 32
35 #define MIN_MAC_HEADER_LEN 24
36 #define QOS_CONTROL_LEN 2
37 
38 #define IEEE80211_ADDR_LEN  6  /* size of 802.11 address */
39 #define WMI_MAC_MAX_SSID_LENGTH              32
40 #ifndef CONFIG_HL_SUPPORT
41 #define mgmt_tx_dl_frm_len 64
42 #else
43 #define mgmt_tx_dl_frm_len 1532
44 #endif
45 #define WMI_SMPS_MASK_LOWER_16BITS 0xFF
46 #define WMI_SMPS_MASK_UPPER_3BITS 0x7
47 #define WMI_SMPS_PARAM_VALUE_S 29
48 #define WMI_UNIT_TEST_MAX_NUM_ARGS 100
49 /* The size of the utc time in bytes. */
50 #define WMI_SIZE_UTC_TIME (10)
51 /* The size of the utc time error in bytes. */
52 #define WMI_SIZE_UTC_TIME_ERROR (5)
53 #define WMI_MCC_MIN_CHANNEL_QUOTA             20
54 #define WMI_MCC_MAX_CHANNEL_QUOTA             80
55 #define WMI_MCC_MIN_NON_ZERO_CHANNEL_LATENCY  30
56 #define WMI_BEACON_TX_BUFFER_SIZE             (512)
57 #define WMI_WIFI_SCANNING_MAC_OUI_LENGTH      3
58 #define WMI_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS   64
59 #define WMI_RSSI_THOLD_DEFAULT   -300
60 #define WMI_NLO_FREQ_THRESH          1000
61 #define WMI_SEC_TO_MSEC(sec)         (sec * 1000)
62 #define WMI_MSEC_TO_USEC(msec)	     (msec * 1000)
63 #define WMI_ETH_LEN      64
64 #define WMI_QOS_NUM_TSPEC_MAX 2
65 #define WMI_IPV4_ADDR_LEN       4
66 #define WMI_KEEP_ALIVE_NULL_PKT              1
67 #define WMI_KEEP_ALIVE_UNSOLICIT_ARP_RSP     2
68 #define WMI_MAC_MAX_KEY_LENGTH          32
69 #define WMI_KRK_KEY_LEN     16
70 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
71 #define WMI_BTK_KEY_LEN     32
72 #define WMI_ROAM_R0KH_ID_MAX_LEN    48
73 #define WMI_ROAM_SCAN_PSK_SIZE    32
74 #endif
75 #define WMI_NOISE_FLOOR_DBM_DEFAULT      (-96)
76 #define WMI_EXTSCAN_MAX_HOTLIST_SSIDS                    8
77 #define WMI_ROAM_MAX_CHANNELS                            80
78 #ifdef FEATURE_WLAN_EXTSCAN
79 #define WMI_MAX_EXTSCAN_MSG_SIZE        1536
80 #define WMI_EXTSCAN_REST_TIME           100
81 #define WMI_EXTSCAN_MAX_SCAN_TIME       50000
82 #define WMI_EXTSCAN_BURST_DURATION      150
83 #endif
84 #define WMI_SCAN_NPROBES_DEFAULT            (2)
85 #define WMI_SEC_TO_MSEC(sec)         (sec * 1000)  /* sec to msec */
86 #define WMI_MSEC_TO_USEC(msec)       (msec * 1000) /* msec to usec */
87 #define WMI_NLO_FREQ_THRESH          1000       /* in MHz */
88 
89 #define WMI_SVC_MSG_MAX_SIZE   1536
90 #define MAX_UTF_EVENT_LENGTH	2048
91 #define MAX_WMI_UTF_LEN	252
92 #define MAX_WMI_QVIT_LEN	252
93 #define THERMAL_LEVELS	4
94 #define WMI_HOST_BCN_FLT_MAX_SUPPORTED_IES	256
95 #define WMI_HOST_BCN_FLT_MAX_ELEMS_IE_LIST \
96 			(WMI_HOST_BCN_FLT_MAX_SUPPORTED_IES/32)
97 #define LTEU_MAX_BINS	10
98 #define ATF_ACTIVED_MAX_CLIENTS   50
99 #define ATF_ACTIVED_MAX_ATFGROUPS 16
100 #define CTL_5G_SIZE 1536
101 #define CTL_2G_SIZE 684
102 #define MAX_CTL_SIZE (CTL_5G_SIZE > CTL_2G_SIZE ? CTL_5G_SIZE : CTL_2G_SIZE)
103 #define IEEE80211_MICBUF_SIZE   (8+8)
104 #define IEEE80211_TID_SIZE	17
105 #define WME_NUM_AC	4
106 #define SMART_ANT_MODE_SERIAL   0
107 #define SMART_ANT_MODE_PARALLEL   1
108 #define IEEE80211_WEP_NKID	4   /* number of key ids */
109 #define WPI_IV_LEN	16
110 #define WMI_SCAN_MAX_NUM_BSSID	10
111 #define MAX_CHANS	1023
112 #define TARGET_OEM_CONFIGURE_LCI	0x0A
113 #define RTT_LCI_ALTITUDE_MASK	0x3FFFFFFF
114 #define TARGET_OEM_CONFIGURE_LCR	0x09
115 #define RTT_TIMEOUT_MS 180
116 #define MAX_SUPPORTED_RATES 128
117 #define WMI_HOST_MAX_BUFFER_SIZE	1712
118 #define WMI_HAL_MAX_SANTENNA 4
119 #define WMI_HOST_PDEV_VI_PRIORITY_BIT     (1<<2)
120 #define WMI_HOST_PDEV_BEACON_PRIORITY_BIT (1<<4)
121 #define WMI_HOST_PDEV_MGMT_PRIORITY_BIT   (1<<5)
122 #define WMI_MAX_CMDS 1024
123 
124 #define FIPS_ALIGN 4
125 #define FIPS_ALIGNTO(__addr, __to) \
126 		((((unsigned long int)(__addr)) + (__to) -  1) & ~((__to) - 1))
127 #define FIPS_IS_ALIGNED(__addr, __to) \
128 		(!(((unsigned long int)(__addr)) & ((__to)-1)))
129 
130 #define WMI_HOST_MAX_SERIAL_ANTENNA 2
131 #define WMI_SMART_ANT_MAX_RATE_SERIES 2
132 
133 #define WMI_HOST_F_MS(_v, _f)	\
134 	(((_v) & (_f)) >> (_f##_S))
135 
136 #define WMI_HOST_F_RMW(_var, _v, _f)	\
137 	do {	\
138 		(_var) &= ~(_f);	\
139 		(_var) |= (((_v) << (_f##_S)) & (_f));	\
140 	} while (0)
141 
142 /* vdev capabilities bit mask */
143 #define WMI_HOST_VDEV_BEACON_SUPPORT  0x1
144 #define WMI_HOST_VDEV_WDS_LRN_ENABLED 0x2
145 #define WMI_HOST_VDEV_VOW_ENABLED     0x4
146 #define WMI_HOST_VDEV_IS_BEACON_SUPPORTED(param) \
147 	((param) & WMI_HOST_VDEV_BEACON_SUPPORT)
148 #define WMI_HOST_VDEV_IS_WDS_LRN_ENABLED(param) \
149 	((param) & WMI_HOST_VDEV_WDS_LRN_ENABLED)
150 #define WMI_HOST_VDEV_IS_VOW_ENABLED(param) \
151 	((param) & WMI_HOST_VDEV_VOW_ENABLED)
152 
153 /* TXBF capabilities masks */
154 #define WMI_HOST_TXBF_CONF_SU_TX_BFEE_S 0
155 #define WMI_HOST_TXBF_CONF_SU_TX_BFEE_M 0x1
156 #define WMI_HOST_TXBF_CONF_SU_TX_BFEE \
157 	(WMI_HOST_TXBF_CONF_SU_TX_BFEE_M << WMI_HOST_TXBF_CONF_SU_TX_BFEE_S)
158 #define WMI_HOST_TXBF_CONF_SU_TX_BFEE_GET(x) \
159 	WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_SU_TX_BFEE)
160 #define WMI_HOST_TXBF_CONF_SU_TX_BFEE_SET(x, z) \
161 	WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_SU_TX_BFEE)
162 
163 #define WMI_HOST_TXBF_CONF_MU_TX_BFEE_S 1
164 #define WMI_HOST_TXBF_CONF_MU_TX_BFEE_M 0x1
165 #define WMI_HOST_TXBF_CONF_MU_TX_BFEE \
166 	(WMI_HOST_TXBF_CONF_MU_TX_BFEE_M << WMI_HOST_TXBF_CONF_MU_TX_BFEE_S)
167 #define WMI_HOST_TXBF_CONF_MU_TX_BFEE_GET(x) \
168 	WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_MU_TX_BFEE)
169 #define WMI_HOST_TXBF_CONF_MU_TX_BFEE_SET(x, z) \
170 	WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_MU_TX_BFEE)
171 
172 #define WMI_HOST_TXBF_CONF_SU_TX_BFER_S 2
173 #define WMI_HOST_TXBF_CONF_SU_TX_BFER_M 0x1
174 #define WMI_HOST_TXBF_CONF_SU_TX_BFER \
175 	(WMI_HOST_TXBF_CONF_SU_TX_BFER_M << WMI_HOST_TXBF_CONF_SU_TX_BFER_S)
176 #define WMI_HOST_TXBF_CONF_SU_TX_BFER_GET(x) \
177 	WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_SU_TX_BFER)
178 #define WMI_HOST_TXBF_CONF_SU_TX_BFER_SET(x, z) \
179 	WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_SU_TX_BFER)
180 
181 #define WMI_HOST_TXBF_CONF_MU_TX_BFER_S 3
182 #define WMI_HOST_TXBF_CONF_MU_TX_BFER_M 0x1
183 #define WMI_HOST_TXBF_CONF_MU_TX_BFER \
184 	(WMI_HOST_TXBF_CONF_MU_TX_BFER_M << WMI_HOST_TXBF_CONF_MU_TX_BFER_S)
185 #define WMI_HOST_TXBF_CONF_MU_TX_BFER_GET(x) \
186 	WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_MU_TX_BFER)
187 #define WMI_HOST_TXBF_CONF_MU_TX_BFER_SET(x, z) \
188 	WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_MU_TX_BFER)
189 
190 #define WMI_HOST_TXBF_CONF_STS_CAP_S 4
191 #define WMI_HOST_TXBF_CONF_STS_CAP_M 0x7
192 #define WMI_HOST_TXBF_CONF_STS_CAP \
193 	(WMI_HOST_TXBF_CONF_STS_CAP_M << WMI_HOST_TXBF_CONF_STS_CAP_S)
194 #define WMI_HOST_TXBF_CONF_STS_CAP_GET(x) \
195 	WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_STS_CAP);
196 #define WMI_HOST_TXBF_CONF_STS_CAP_SET(x, z) \
197 	WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_STS_CAP)
198 
199 #define WMI_HOST_TXBF_CONF_IMPLICIT_BF_S 7
200 #define WMI_HOST_TXBF_CONF_IMPLICIT_BF_M 0x1
201 #define WMI_HOST_TXBF_CONF_IMPLICIT_BF \
202 	(WMI_HOST_TXBF_CONF_IMPLICIT_BF_M << WMI_HOST_TXBF_CONF_IMPLICIT_BF_S)
203 #define WMI_HOST_TXBF_CONF_IMPLICIT_BF_GET(x) \
204 	WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_IMPLICIT_BF)
205 #define WMI_HOST_TXBF_CONF_IMPLICIT_BF_SET(x, z) \
206 	WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_IMPLICIT_BF)
207 
208 #define WMI_HOST_TXBF_CONF_BF_SND_DIM_S 8
209 #define WMI_HOST_TXBF_CONF_BF_SND_DIM_M 0x7
210 #define WMI_HOST_TXBF_CONF_BF_SND_DIM \
211 	(WMI_HOST_TXBF_CONF_BF_SND_DIM_M << WMI_HOST_TXBF_CONF_BF_SND_DIM_S)
212 #define WMI_HOST_TXBF_CONF_BF_SND_DIM_GET(x) \
213 	WMI_HOST_F_MS(x, WMI_HOST_TXBF_CONF_BF_SND_DIM)
214 #define WMI_HOST_TXBF_CONF_BF_SND_DIM_SET(x, z) \
215 	WMI_HOST_F_RMW(x, z, WMI_HOST_TXBF_CONF_BF_SND_DIM)
216 
217 /* The following WMI_HOST_HEOPS_BSSCOLOR_XXX macros correspond to the
218  *  WMI_HEOPS_COLOR_XXX macros in the FW wmi_unified.h */
219 #define WMI_HOST_HEOPS_BSSCOLOR_S 0
220 #define WMI_HOST_HEOPS_BSSCOLOR_M 0x3f
221 #define WMI_HOST_HEOPS_BSSCOLOR \
222 	(WMI_HOST_HEOPS_BSSCOLOR_M << WMI_HOST_HEOPS_BSSCOLOR_S)
223 #define WMI_HOST_HEOPS_BSSCOLOR_GET(x) \
224 	WMI_HOST_F_MS(x, WMI_HOST_HEOPS_BSSCOLOR)
225 #define WMI_HOST_HEOPS_BSSCOLOR_SET(x, z) \
226 	WMI_HOST_F_RMW(x, z, WMI_HOST_HEOPS_BSSCOLOR)
227 
228 /* The following WMI_HOST_HEOPS_BSSCOLOR_DISABLE_XXX macros correspond to the
229  *  WMI_HEOPS_BSSCOLORDISABLE_XXX macros in the FW wmi_unified.h */
230 #define WMI_HOST_HEOPS_BSSCOLOR_DISABLE_S 30
231 #define WMI_HOST_HEOPS_BSSCOLOR_DISABLE_M 0x1
232 #define WMI_HOST_HEOPS_BSSCOLOR_DISABLE \
233 	(WMI_HOST_HEOPS_BSSCOLOR_DISABLE_M << WMI_HOST_HEOPS_BSSCOLOR_DISABLE_S)
234 #define WMI_HOST_HEOPS_BSSCOLOR_DISABLE_GET(x) \
235 	WMI_HOST_F_MS(x, WMI_HOST_HEOPS_BSSCOLOR_DISABLE)
236 #define WMI_HOST_HEOPS_BSSCOLOR_DISABLE_SET(x, z) \
237 	WMI_HOST_F_RMW(x, z, WMI_HOST_HEOPS_BSSCOLOR_DISABLE)
238 
239 /* HE BF capabilities mask */
240 #define WMI_HOST_HE_BF_CONF_SU_BFEE_S 0
241 #define WMI_HOST_HE_BF_CONF_SU_BFEE_M 0x1
242 #define WMI_HOST_HE_BF_CONF_SU_BFEE \
243 	(WMI_HOST_HE_BF_CONF_SU_BFEE_M << WMI_HOST_HE_BF_CONF_SU_BFEE_S)
244 #define WMI_HOST_HE_BF_CONF_SU_BFEE_GET(x) \
245 	WMI_HOST_F_MS(x, WMI_HOST_HE_BF_CONF_SU_BFEE)
246 #define WMI_HOST_HE_BF_CONF_SU_BFEE_SET(x, z) \
247 	WMI_HOST_F_RMW(x, z, WMI_HOST_HE_BF_CONF_SU_BFEE)
248 
249 #define WMI_HOST_HE_BF_CONF_SU_BFER_S 1
250 #define WMI_HOST_HE_BF_CONF_SU_BFER_M 0x1
251 #define WMI_HOST_HE_BF_CONF_SU_BFER \
252 	(WMI_HOST_HE_BF_CONF_SU_BFER_M << WMI_HOST_HE_BF_CONF_SU_BFER_S)
253 #define WMI_HOST_HE_BF_CONF_SU_BFER_GET(x) \
254 	WMI_HOST_F_MS(x, WMI_HOST_HE_BF_CONF_SU_BFER)
255 #define WMI_HOST_HE_BF_CONF_SU_BFER_SET(x, z) \
256 	WMI_HOST_F_RMW(x, z, WMI_HOST_HE_BF_CONF_SU_BFER)
257 
258 #define WMI_HOST_HE_BF_CONF_MU_BFEE_S 2
259 #define WMI_HOST_HE_BF_CONF_MU_BFEE_M 0x1
260 #define WMI_HOST_HE_BF_CONF_MU_BFEE \
261 	(WMI_HOST_HE_BF_CONF_MU_BFEE_M << WMI_HOST_HE_BF_CONF_MU_BFEE_S)
262 #define WMI_HOST_HE_BF_CONF_MU_BFEE_GET(x) \
263 	WMI_HOST_F_MS(x, WMI_HOST_HE_BF_CONF_MU_BFEE)
264 #define WMI_HOST_HE_BF_CONF_MU_BFEE_SET(x, z) \
265 	WMI_HOST_F_RMW(x, z, WMI_HOST_HE_BF_CONF_MU_BFEE)
266 
267 #define WMI_HOST_HE_BF_CONF_MU_BFER_S 3
268 #define WMI_HOST_HE_BF_CONF_MU_BFER_M 0x1
269 #define WMI_HOST_HE_BF_CONF_MU_BFER \
270 	(WMI_HOST_HE_BF_CONF_MU_BFER_M << WMI_HOST_HE_BF_CONF_MU_BFER_S)
271 #define WMI_HOST_HE_BF_CONF_MU_BFER_GET(x) \
272 	WMI_HOST_F_MS(x, WMI_HOST_HE_BF_CONF_MU_BFER)
273 #define WMI_HOST_HE_BF_CONF_MU_BFER_SET(x, z) \
274 	WMI_HOST_F_RMW(x, z, WMI_HOST_HE_BF_CONF_MU_BFER)
275 
276 #define WMI_HOST_HE_BF_CONF_DL_OFDMA_S 4
277 #define WMI_HOST_HE_BF_CONF_DL_OFDMA_M 0x1
278 #define WMI_HOST_HE_BF_CONF_DL_OFDMA \
279 	(WMI_HOST_HE_BF_CONF_DL_OFDMA_M << WMI_HOST_HE_BF_CONF_DL_OFDMA_S)
280 #define WMI_HOST_HE_BF_CONF_DL_OFDMA_GET(x) \
281 	WMI_HOST_F_MS(x, WMI_HOST_HE_BF_CONF_DL_OFDMA)
282 #define WMI_HOST_HE_BF_CONF_DL_OFDMA_SET(x, z) \
283 	WMI_HOST_F_RMW(x, z, WMI_HOST_HE_BF_CONF_DL_OFDMA)
284 
285 #define WMI_HOST_HE_BF_CONF_UL_OFDMA_S 5
286 #define WMI_HOST_HE_BF_CONF_UL_OFDMA_M 0x1
287 #define WMI_HOST_HE_BF_CONF_UL_OFDMA \
288 	(WMI_HOST_HE_BF_CONF_UL_OFDMA_M << WMI_HOST_HE_BF_CONF_UL_OFDMA_S)
289 #define WMI_HOST_HE_BF_CONF_UL_OFDMA_GET(x) \
290 	WMI_HOST_F_MS(x, WMI_HOST_HE_BF_CONF_UL_OFDMA)
291 #define WMI_HOST_HE_BF_CONF_UL_OFDMA_SET(x, z) \
292 	WMI_HOST_F_RMW(x, z, WMI_HOST_HE_BF_CONF_UL_OFDMA)
293 
294 #define WMI_HOST_HE_BF_CONF_UL_MUMIMO_S 6
295 #define WMI_HOST_HE_BF_CONF_UL_MUMIMO_M 0x1
296 #define WMI_HOST_HE_BF_CONF_UL_MUMIMO \
297 	(WMI_HOST_HE_BF_CONF_UL_MUMIMO_M << WMI_HOST_HE_BF_CONF_UL_MUMIMO_S)
298 #define WMI_HOST_HE_BF_CONF_UL_MUMIMO_GET(x) \
299 	WMI_HOST_F_MS(x, WMI_HOST_HE_BF_CONF_UL_MUMIMO)
300 #define WMI_HOST_HE_BF_CONF_UL_MUMIMO_SET(x, z) \
301 	WMI_HOST_F_RMW(x, z, WMI_HOST_HE_BF_CONF_UL_MUMIMO)
302 
303 /* HE or VHT Sounding */
304 #define WMI_HOST_HE_VHT_SOUNDING_MODE_S 0
305 #define WMI_HOST_HE_VHT_SOUNDING_MODE_M 0x1
306 #define WMI_HOST_HE_VHT_SOUNDING_MODE \
307 	(WMI_HOST_HE_VHT_SOUNDING_MODE_M << WMI_HOST_HE_VHT_SOUNDING_MODE_S)
308 #define WMI_HOST_HE_VHT_SOUNDING_MODE_GET(x) \
309 	WMI_HOST_F_MS(x, WMI_HOST_HE_VHT_SOUNDING_MODE)
310 #define WMI_HOST_HE_VHT_SOUNDING_MODE_SET(x, z) \
311 	WMI_HOST_F_RMW(x, z, WMI_HOST_HE_VHT_SOUNDING_MODE)
312 
313 /* SU or MU Sounding */
314 #define WMI_HOST_SU_MU_SOUNDING_MODE_S 2
315 #define WMI_HOST_SU_MU_SOUNDING_MODE_M 0x1
316 #define WMI_HOST_SU_MU_SOUNDING_MODE \
317 	(WMI_HOST_SU_MU_SOUNDING_MODE_M << \
318 	 WMI_HOST_SU_MU_SOUNDING_MODE_S)
319 #define WMI_HOST_SU_MU_SOUNDING_MODE_GET(x) \
320 	WMI_HOST_F_MS(x, WMI_HOST_SU_MU_SOUNDING_MODE)
321 #define WMI_HOST_SU_MU_SOUNDING_MODE_SET(x, z) \
322 	WMI_HOST_F_RMW(x, z, WMI_HOST_SU_MU_SOUNDING_MODE)
323 
324 /* Trig or Non-Trig Sounding */
325 #define WMI_HOST_TRIG_NONTRIG_SOUNDING_MODE_S  3
326 #define WMI_HOST_TRIG_NONTRIG_SOUNDING_MODE_M 0x1
327 #define WMI_HOST_TRIG_NONTRIG_SOUNDING_MODE \
328 	(WMI_HOST_TRIG_NONTRIG_SOUNDING_MODE_M << \
329 	 WMI_HOST_TRIG_NONTRIG_SOUNDING_MODE_S)
330 #define WMI_HOST_TRIG_NONTRIG_SOUNDING_MODE_GET(x) \
331 	WMI_HOST_F_MS(x, WMI_HOST_TRIG_NONTRIG_SOUNDING_MODE)
332 #define WMI_HOST_HE_VHT_SU_MU_SOUNDING_MODE_SET(x, z) \
333 	WMI_HOST_F_RMW(x, z, WMI_HOST_TRIG_NONTRIG_SOUNDING_MODE)
334 
335 #define WMI_HOST_TPC_RATE_MAX	160
336 #define WMI_HOST_TPC_TX_NUM_CHAIN	4
337 #define WMI_HOST_RXG_CAL_CHAN_MAX	8
338 #define WMI_HOST_MAX_NUM_CHAINS	8
339 #define WMI_MAX_NUM_OF_RATE_THRESH   4
340 
341 #define WMI_HOST_PDEV_MAX_VDEVS         17
342 
343 /* for QC98XX only */
344 /*6 modes (A, HT20, HT40, VHT20, VHT40, VHT80) * 3 reg dommains
345  */
346 #define WMI_HOST_NUM_CTLS_5G                18
347 /*6 modes (B, G, HT20, HT40, VHT20, VHT40) * 3 reg domains */
348 #define WMI_HOST_NUM_CTLS_2G                18
349 #define WMI_HOST_NUM_BAND_EDGES_5G          8
350 #define WMI_HOST_NUM_BAND_EDGES_2G          4
351 
352 /*Beelinier 5G*/
353 #define WMI_HOST_NUM_CTLS_5G_11A            9
354 #define WMI_HOST_NUM_BAND_EDGES_5G_11A      25
355 #define WMI_HOST_NUM_CTLS_5G_HT20           24
356 #define WMI_HOST_NUM_BAND_EDGES_5G_HT20     25
357 #define WMI_HOST_NUM_CTLS_5G_HT40           18
358 #define WMI_HOST_NUM_BAND_EDGES_5G_HT40     12
359 #define WMI_HOST_NUM_CTLS_5G_HT80           18
360 #define WMI_HOST_NUM_BAND_EDGES_5G_HT80     6
361 #define WMI_HOST_NUM_CTLS_5G_HT160          9
362 #define WMI_HOST_NUM_BAND_EDGES_5G_HT160    2
363 
364 /* Beeliner 2G */
365 #define WMI_HOST_NUM_CTLS_2G_11B            6
366 #define WMI_HOST_NUM_BAND_EDGES_2G_11B      9
367 #define WMI_HOST_NUM_CTLS_2G_20MHZ          30
368 #define WMI_HOST_NUM_BAND_EDGES_2G_20MHZ    11
369 #define WMI_HOST_NUM_CTLS_2G_40MHZ          18
370 #define WMI_HOST_NUM_BAND_EDGES_2G_40MHZ    6
371 
372 /* for QC98XX only */
373 #define WMI_HOST_TX_NUM_CHAIN               0x3
374 #define WMI_HOST_TPC_REGINDEX_MAX           4
375 #define WMI_HOST_ARRAY_GAIN_NUM_STREAMS     2
376 
377 #include "qdf_atomic.h"
378 
379 #ifdef BIG_ENDIAN_HOST
380 	/* This API is used in copying in elements to WMI message,
381 	since WMI message uses multilpes of 4 bytes, This API
382 	converts length into multiples of 4 bytes, and performs copy
383 	*/
384 #define WMI_HOST_IF_MSG_COPY_CHAR_ARRAY(destp, srcp, len)  do { \
385 	int j; \
386 	u_int32_t *src, *dest; \
387 	src = (u_int32_t *)srcp; \
388 	dest = (u_int32_t *)destp; \
389 	for (j = 0; j < roundup(len, sizeof(u_int32_t))/4; j++) { \
390 		*(dest+j) = qdf_le32_to_cpu(*(src+j)); \
391 	} \
392 } while (0)
393 #else
394 
395 #define WMI_HOST_IF_MSG_COPY_CHAR_ARRAY(destp, srcp, len) OS_MEMCPY(destp,\
396 		srcp, len)
397 
398 #endif
399 
400 /** macro to convert MAC address from WMI word format to char array */
401 #define WMI_HOST_MAC_ADDR_TO_CHAR_ARRAY(pwmi_mac_addr, c_macaddr) do {	\
402 	(c_macaddr)[0] =  ((pwmi_mac_addr)->mac_addr31to0) & 0xff; \
403 	(c_macaddr)[1] =  (((pwmi_mac_addr)->mac_addr31to0) >> 8) & 0xff; \
404 	(c_macaddr)[2] =  (((pwmi_mac_addr)->mac_addr31to0) >> 16) & 0xff; \
405 	(c_macaddr)[3] =  (((pwmi_mac_addr)->mac_addr31to0) >> 24) & 0xff;  \
406 	(c_macaddr)[4] =  ((pwmi_mac_addr)->mac_addr47to32) & 0xff; \
407 	(c_macaddr)[5] =  (((pwmi_mac_addr)->mac_addr47to32) >> 8) & 0xff; \
408 	} while (0)
409 
410 #define TARGET_INIT_STATUS_SUCCESS   0x0
411 #define TARGET_INIT_STATUS_GEN_FAILED   0x1
412 #define TARGET_GET_INIT_STATUS_REASON(status)	((status) & 0xffff)
413 #define TARGET_GET_INIT_STATUS_MODULE_ID(status) (((status) >> 16) & 0xffff)
414 
415 #define MAX_ASSOC_IE_LENGTH 1024
416 typedef uint32_t TARGET_INIT_STATUS;
417 
418 /**
419  * @brief Opaque handle of wmi structure
420  */
421 struct wmi_unified;
422 typedef struct wmi_unified *wmi_unified_t;
423 
424 typedef void *ol_scn_t;
425 /**
426  * @wmi_event_handler function prototype
427  */
428 typedef int (*wmi_unified_event_handler)(ol_scn_t scn_handle,
429 		 uint8_t *event_buf, uint32_t len);
430 
431 /**
432  * @WMI_HOST_WLAN_PHY_MODE: Host based enum ID for corresponding in
433  * WLAN_PHY_MODE. This should be consistent with WLAN_PHY_MODE always to avoid
434  * breaking the WMI
435  */
436 typedef enum {
437 	WMI_HOST_MODE_11A	= 0,   /* 11a Mode */
438 	WMI_HOST_MODE_11G	= 1,   /* 11b/g Mode */
439 	WMI_HOST_MODE_11B	= 2,   /* 11b Mode */
440 	WMI_HOST_MODE_11GONLY	= 3,   /* 11g only Mode */
441 	WMI_HOST_MODE_11NA_HT20   = 4,  /* 11a HT20 mode */
442 	WMI_HOST_MODE_11NG_HT20   = 5,  /* 11g HT20 mode */
443 	WMI_HOST_MODE_11NA_HT40   = 6,  /* 11a HT40 mode */
444 	WMI_HOST_MODE_11NG_HT40   = 7,  /* 11g HT40 mode */
445 	WMI_HOST_MODE_11AC_VHT20 = 8,
446 	WMI_HOST_MODE_11AC_VHT40 = 9,
447 	WMI_HOST_MODE_11AC_VHT80 = 10,
448 	WMI_HOST_MODE_11AC_VHT20_2G = 11,
449 	WMI_HOST_MODE_11AC_VHT40_2G = 12,
450 	WMI_HOST_MODE_11AC_VHT80_2G = 13,
451 	WMI_HOST_MODE_11AC_VHT80_80 = 14,
452 	WMI_HOST_MODE_11AC_VHT160 = 15,
453 	WMI_HOST_MODE_11AX_HE20 = 16,
454 	WMI_HOST_MODE_11AX_HE40 = 17,
455 	WMI_HOST_MODE_11AX_HE80 = 18,
456 	WMI_HOST_MODE_11AX_HE80_80 = 19,
457 	WMI_HOST_MODE_11AX_HE160 = 20,
458 	WMI_HOST_MODE_11AX_HE20_2G = 21,
459 	WMI_HOST_MODE_11AX_HE40_2G = 22,
460 	WMI_HOST_MODE_11AX_HE80_2G = 23,
461 	WMI_HOST_MODE_UNKNOWN = 24,
462 	WMI_HOST_MODE_MAX = 24
463 } WMI_HOST_WLAN_PHY_MODE;
464 
465 typedef enum {
466 	WMI_HOST_VDEV_START_OK = 0,
467 	WMI_HOST_VDEV_START_CHAN_INVALID,
468 	WMI_HOST_VDEV_START_CHAN_BLOCKED,
469 	WMI_HOST_VDEV_START_CHAN_DFS_VIOLATION,
470 } WMI_HOST_VDEV_START_STATUS;
471 
472 /*
473  * Needs to be removed and use channel_param based
474  * on how it is processed
475  */
476 typedef struct {
477 	/** primary 20 MHz channel frequency in mhz */
478 	uint32_t mhz;
479 	/** Center frequency 1 in MHz*/
480 	uint32_t band_center_freq1;
481 	/** Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
482 	uint32_t band_center_freq2;
483 	/** channel info described below */
484 	uint32_t info;
485 	/** contains min power, max power, reg power and reg class id.  */
486 	uint32_t reg_info_1;
487 	/** contains antennamax */
488 	uint32_t reg_info_2;
489 } wmi_host_channel;
490 
491 /**
492  * enum WMI_HOST_REGDMN_MODE:
493  * @WMI_HOST_REGDMN_MODE_11A: 11a channels
494  * @WMI_HOST_REGDMN_MODE_TURBO: 11a turbo-only channels
495  * @WMI_HOST_REGDMN_MODE_11B: 11b channels
496  * @WMI_HOST_REGDMN_MODE_PUREG: 11g channels (OFDM only)
497  * @WMI_HOST_REGDMN_MODE_11G: historical
498  * @WMI_HOST_REGDMN_MODE_108G: 11g+Turbo channels
499  * @WMI_HOST_REGDMN_MODE_108A: 11a+Turbo channels
500  * @WMI_HOST_REGDMN_MODE_XR: XR channels
501  * @WMI_HOST_REGDMN_MODE_11A_HALF_RATE: 11a half rate channels
502  * @WMI_HOST_REGDMN_MODE_11A_QUARTER_RATE: 11a quarter rate channels
503  * @WMI_HOST_REGDMN_MODE_11NG_HT20: 11ng HT20 channels
504  * @WMI_HOST_REGDMN_MODE_11NA_HT20: 11na HT20 channels
505  * @WMI_HOST_REGDMN_MODE_11NG_HT40PLUS: 11ng HT40+ channels
506  * @WMI_HOST_REGDMN_MODE_11NG_HT40MINUS: 11ng HT40- channels
507  * @WMI_HOST_REGDMN_MODE_11NA_HT40PLUS: 11na HT40+ channels
508  * @WMI_HOST_REGDMN_MODE_11NA_HT40MINUS: 11na HT40- channels
509  * @WMI_HOST_REGDMN_MODE_11AC_VHT20: 5GHz, VHT20
510  * @WMI_HOST_REGDMN_MODE_11AC_VHT40PLUS: 5GHz, VHT40+ channels
511  * @WMI_HOST_REGDMN_MODE_11AC_VHT40MINUS: 5GHz, VHT40- channels
512  * @WMI_HOST_REGDMN_MODE_11AC_VHT80: 5GHz, VHT80 channels
513  * @WMI_HOST_REGDMN_MODE_11AC_VHT160: 5GHz, VHT160 channels
514  * @WMI_HOST_REGDMN_MODE_11AC_VHT80_80: 5GHz, VHT80+80 channels
515  * @WMI_HOST_REGDMN_MODE_11AXG_HE20: 11ax 2.4GHz, HE20 channels
516  * @WMI_HOST_REGDMN_MODE_11AXA_HE20: 11ax 5GHz, HE20 channels
517  * @WMI_HOST_REGDMN_MODE_11AXG_HE40PLUS: 11ax 2.4GHz, HE40+ channels
518  * @WMI_HOST_REGDMN_MODE_11AXG_HE40MINUS: 11ax 2.4GHz, HE40- channels
519  * @WMI_HOST_REGDMN_MODE_11AXA_HE40PLUS: 11ax 5GHz, HE40+ channels
520  * @WMI_HOST_REGDMN_MODE_11AXA_HE40MINUS: 11ax 5GHz, HE40- channels
521  * @WMI_HOST_REGDMN_MODE_11AXA_HE80: 11ax 5GHz, HE80 channels
522  * @WMI_HOST_REGDMN_MODE_11AXA_HE160: 11ax 5GHz, HE160 channels
523  * @WMI_HOST_REGDMN_MODE_11AXA_HE80_80: 11ax 5GHz, HE80+80 channels
524  */
525 typedef enum {
526 	WMI_HOST_REGDMN_MODE_11A = 0x00000001,
527 	WMI_HOST_REGDMN_MODE_TURBO = 0x00000002,
528 	WMI_HOST_REGDMN_MODE_11B = 0x00000004,
529 	WMI_HOST_REGDMN_MODE_PUREG = 0x00000008,
530 	WMI_HOST_REGDMN_MODE_11G = 0x00000008,
531 	WMI_HOST_REGDMN_MODE_108G = 0x00000020,
532 	WMI_HOST_REGDMN_MODE_108A = 0x00000040,
533 	WMI_HOST_REGDMN_MODE_XR = 0x00000100,
534 	WMI_HOST_REGDMN_MODE_11A_HALF_RATE = 0x00000200,
535 	WMI_HOST_REGDMN_MODE_11A_QUARTER_RATE = 0x00000400,
536 	WMI_HOST_REGDMN_MODE_11NG_HT20 = 0x00000800,
537 	WMI_HOST_REGDMN_MODE_11NA_HT20 = 0x00001000,
538 	WMI_HOST_REGDMN_MODE_11NG_HT40PLUS = 0x00002000,
539 	WMI_HOST_REGDMN_MODE_11NG_HT40MINUS = 0x00004000,
540 	WMI_HOST_REGDMN_MODE_11NA_HT40PLUS = 0x00008000,
541 	WMI_HOST_REGDMN_MODE_11NA_HT40MINUS = 0x00010000,
542 	WMI_HOST_REGDMN_MODE_11AC_VHT20 = 0x00020000,
543 	WMI_HOST_REGDMN_MODE_11AC_VHT40PLUS = 0x00040000,
544 	WMI_HOST_REGDMN_MODE_11AC_VHT40MINUS = 0x00080000,
545 	WMI_HOST_REGDMN_MODE_11AC_VHT80 = 0x00100000,
546 	WMI_HOST_REGDMN_MODE_11AC_VHT160 = 0x00200000,
547 	WMI_HOST_REGDMN_MODE_11AC_VHT80_80 = 0x00400000,
548 	WMI_HOST_REGDMN_MODE_11AXG_HE20 = 0x00800000,
549 	WMI_HOST_REGDMN_MODE_11AXA_HE20 = 0x01000000,
550 	WMI_HOST_REGDMN_MODE_11AXG_HE40PLUS = 0x02000000,
551 	WMI_HOST_REGDMN_MODE_11AXG_HE40MINUS = 0x04000000,
552 	WMI_HOST_REGDMN_MODE_11AXA_HE40PLUS = 0x08000000,
553 	WMI_HOST_REGDMN_MODE_11AXA_HE40MINUS = 0x10000000,
554 	WMI_HOST_REGDMN_MODE_11AXA_HE80 = 0x20000000,
555 	WMI_HOST_REGDMN_MODE_11AXA_HE160 = 0x40000000,
556 	WMI_HOST_REGDMN_MODE_11AXA_HE80_80 = 0x80000000,
557 	WMI_HOST_REGDMN_MODE_ALL = 0xffffffff
558 } WMI_HOST_REGDMN_MODE;
559 
560 /**
561  * enum WMI_HOST_WLAN_BAND_CAPABILITY: Band capability (2.4 GHz, 5 GHz). Maps to
562  *               WLAN_BAND_CAPABILITY used in firmware header file(s).
563  * @WMI_HOST_WLAN_2G_CAPABILITY: 2.4 GHz capable
564  * @WMI_HOST_WLAN_5G_CAPABILITY: 5 GHz capable
565  */
566 typedef enum {
567 	WMI_HOST_WLAN_2G_CAPABILITY = 0x1,
568 	WMI_HOST_WLAN_5G_CAPABILITY = 0x2,
569 } WMI_HOST_WLAN_BAND_CAPABILITY;
570 
571 /**
572  * enum wmi_host_channel_width: Channel operating width. Maps to
573  *               wmi_channel_width used in firmware header file(s).
574  * @WMI_HOST_CHAN_WIDTH_20: 20 MHz channel operating width
575  * @WMI_HOST_CHAN_WIDTH_40: 40 MHz channel operating width
576  * @WMI_HOST_CHAN_WIDTH_80: 80 MHz channel operating width
577  * @WMI_HOST_CHAN_WIDTH_160: 160 MHz channel operating width
578  * @WMI_HOST_CHAN_WIDTH_80P80: 80+80 MHz channel operating width
579  * @WMI_HOST_CHAN_WIDTH_5: 5 MHz channel operating width
580  * @WMI_HOST_CHAN_WIDTH_10: 10 MHz channel operating width
581  */
582 typedef enum {
583 	WMI_HOST_CHAN_WIDTH_20    = 0,
584 	WMI_HOST_CHAN_WIDTH_40    = 1,
585 	WMI_HOST_CHAN_WIDTH_80    = 2,
586 	WMI_HOST_CHAN_WIDTH_160   = 3,
587 	WMI_HOST_CHAN_WIDTH_80P80 = 4,
588 	WMI_HOST_CHAN_WIDTH_5     = 5,
589 	WMI_HOST_CHAN_WIDTH_10    = 6,
590 } wmi_host_channel_width;
591 
592 #define ATH_EXPONENT_TO_VALUE(v)	((1<<v)-1)
593 #define ATH_TXOP_TO_US(v)		   (v<<5)
594 /* WME stream classes */
595 #define WMI_HOST_AC_BE                          0    /* best effort */
596 #define WMI_HOST_AC_BK                          1    /* background */
597 #define WMI_HOST_AC_VI                          2    /* video */
598 #define WMI_HOST_AC_VO                          3    /* voice */
599 #define WMI_TID_TO_AC(_tid) (\
600 		(((_tid) == 0) || ((_tid) == 3)) ? WMI_HOST_AC_BE : \
601 		(((_tid) == 1) || ((_tid) == 2)) ? WMI_HOST_AC_BK : \
602 		(((_tid) == 4) || ((_tid) == 5)) ? WMI_HOST_AC_VI : \
603 		WMI_HOST_AC_VO)
604 
605 /**
606  * struct vdev_create_params - vdev create cmd parameter
607  * @if_id: interface id
608  * @type: interface type
609  * @subtype: interface subtype
610  * @nss_2g: NSS for 2G
611  * @nss_5g: NSS for 5G
612  * @pdev_id: pdev id on pdev for this vdev
613  * @mbssid-flags: MBSS IE flags indicating vdev type
614  * @vdevid_trans: id of transmitting vdev for MBSS IE
615  */
616 struct vdev_create_params {
617 	uint8_t if_id;
618 	uint32_t type;
619 	uint32_t subtype;
620 	uint8_t nss_2g;
621 	uint8_t nss_5g;
622 	uint32_t pdev_id;
623 	uint32_t mbssid_flags;
624 	uint8_t vdevid_trans;
625 };
626 
627 /**
628  * struct vdev_delete_params - vdev delete cmd parameter
629  * @if_id: interface id
630  */
631 struct vdev_delete_params {
632 	uint8_t if_id;
633 };
634 
635 /**
636  * struct channel_param - Channel parameters with all
637  *			info required by target.
638  * @chan_id: channel id
639  * @pwr: channel power
640  * @mhz: channel frequency
641  * @half_rate: is half rate
642  * @quarter_rate: is quarter rate
643  * @dfs_set: is dfs channel
644  * @dfs_set_cfreq2: is secondary freq dfs channel
645  * @is_chan_passive: is this passive channel
646  * @allow_ht: HT allowed in chan
647  * @allow_vht: VHT allowed on chan
648  * @set_agile: is agile mode
649  * @phy_mode: phymode (vht80 or ht40 or ...)
650  * @cfreq1: centre frequency on primary
651  * @cfreq2: centre frequency on secondary
652  * @maxpower: max power for channel
653  * @minpower: min power for channel
654  * @maxreqpower: Max regulatory power
655  * @antennamac: Max antenna
656  * @reg_class_id: Regulatory class id.
657  */
658 
659 struct channel_param {
660 	uint8_t chan_id;
661 	uint8_t pwr;
662 	uint32_t mhz;
663 	uint32_t half_rate:1,
664 		quarter_rate:1,
665 		dfs_set:1,
666 		dfs_set_cfreq2:1,
667 		is_chan_passive:1,
668 		allow_ht:1,
669 		allow_vht:1,
670 		set_agile:1;
671 	uint32_t phy_mode;
672 	uint32_t cfreq1;
673 	uint32_t cfreq2;
674 	int8_t   maxpower;
675 	int8_t   minpower;
676 	int8_t   maxregpower;
677 	uint8_t  antennamax;
678 	uint8_t  reg_class_id;
679 };
680 
681 /**
682  * struct vdev_stop_params - vdev stop cmd parameter
683  * @vdev_id: vdev id
684  */
685 struct vdev_stop_params {
686 	uint8_t vdev_id;
687 };
688 
689 /**
690  * struct vdev_up_params - vdev up cmd parameter
691  * @vdev_id: vdev id
692  * @assoc_id: association id
693  * @profile_idx: profile index of the connected non-trans ap (mbssid case).
694  *		0  means invalid.
695  * @profile_num: the total profile numbers of non-trans aps (mbssid case).
696  *		0 means non-MBSS AP.
697  * @trans_bssid: bssid of transmitted AP (MBSS IE case)
698  */
699 struct vdev_up_params {
700 	uint8_t vdev_id;
701 	uint16_t assoc_id;
702 	uint32_t profile_idx;
703 	uint32_t profile_num;
704 	uint8_t trans_bssid[IEEE80211_ADDR_LEN];
705 };
706 
707 /**
708  * struct vdev_down_params - vdev down cmd parameter
709  * @vdev_id: vdev id
710  */
711 struct vdev_down_params {
712 	uint8_t vdev_id;
713 };
714 
715 /**
716  * struct mac_ssid - mac ssid structure
717  * @length:
718  * @mac_ssid[WMI_MAC_MAX_SSID_LENGTH]:
719  */
720 struct mac_ssid {
721 	uint8_t length;
722 	uint8_t mac_ssid[WMI_MAC_MAX_SSID_LENGTH];
723 } qdf_packed;
724 
725 /**
726  * enum wmi_bcn_tx_rate_code - beacon tx rate code
727  */
728 enum wmi_bcn_tx_rate_code {
729 	WMI_BCN_TX_RATE_CODE_1_M = 0x43,
730 	WMI_BCN_TX_RATE_CODE_2_M = 0x42,
731 	WMI_BCN_TX_RATE_CODE_5_5_M = 0x41,
732 	WMI_BCN_TX_RATE_CODE_6_M = 0x03,
733 	WMI_BCN_TX_RATE_CODE_9_M = 0x07,
734 	WMI_BCN_TX_RATE_CODE_11M = 0x40,
735 	WMI_BCN_TX_RATE_CODE_12_M = 0x02,
736 	WMI_BCN_TX_RATE_CODE_18_M = 0x06,
737 	WMI_BCN_TX_RATE_CODE_24_M = 0x01,
738 	WMI_BCN_TX_RATE_CODE_36_M = 0x05,
739 	WMI_BCN_TX_RATE_CODE_48_M = 0x00,
740 	WMI_BCN_TX_RATE_CODE_54_M = 0x04,
741 };
742 
743 /**
744  * struct vdev_start_params - vdev start cmd parameter
745  * @vdev_id: vdev id
746  * @flags: flags to set like pmf_enabled etc.
747  * @beacon_intval: beacon interval
748  * @dtim_period: dtim period
749  * @is_restart: flag to check if it is vdev
750  * @disable_hw_ack: to update disable hw ack flag
751  * @hidden_ssid: hidden ssid
752  * @pmf_enabled: pmf enabled
753  * @ssid: ssid MAC
754  * @num_noa_descriptors: number of noa descriptors
755  * @preferred_tx_streams: preferred tx streams
756  * @preferred_rx_streams: preferred rx streams
757  * @cac_duration_ms: cac duration in milliseconds
758  * @regdomain: Regulatory domain
759  * @he_ops: HE ops
760  * @channel_param: Channel params required by target.
761  * @bcn_tx_rate_code: Beacon tx rate code.
762  * @ldpc_rx_enabled: Enable/Disable LDPC RX for this vdev
763  */
764 struct vdev_start_params {
765 	uint8_t vdev_id;
766 	uint32_t flags;
767 	uint32_t beacon_intval;
768 	uint32_t dtim_period;
769 	bool is_restart;
770 	uint32_t disable_hw_ack;
771 	uint8_t hidden_ssid;
772 	uint8_t pmf_enabled;
773 	struct mac_ssid ssid;
774 	uint32_t num_noa_descriptors;
775 	uint32_t preferred_rx_streams;
776 	uint32_t preferred_tx_streams;
777 	uint32_t cac_duration_ms;
778 	uint32_t regdomain;
779 	uint32_t he_ops;
780 	struct channel_param channel;
781 	enum wmi_bcn_tx_rate_code bcn_tx_rate_code;
782 	bool ldpc_rx_enabled;
783 };
784 
785 /**
786  * struct vdev_scan_nac_rssi_params - NAC_RSSI cmd parameter
787  * @vdev_id: vdev id
788  * @bssid_addr: BSSID address
789  * @client_addr: client address
790  * @chan_num: channel number
791  * @action:NAC_RSSI action,
792  */
793 struct vdev_scan_nac_rssi_params {
794 	uint32_t vdev_id;
795 	uint8_t bssid_addr[IEEE80211_ADDR_LEN];
796 	uint8_t client_addr[IEEE80211_ADDR_LEN];
797 	uint32_t chan_num;
798 	uint32_t action; /* WMI_FILTER_NAC_RSSI_ACTION */
799 };
800 
801 /**
802  * enum nss_chains_band_info - Band info for dynamic nss, chains change feature
803  * @NSS_CHAINS_BAND_2GHZ: 2.4Ghz band
804  * @NSS_CHAINS_BAND_5GHZ: 5Ghz band
805  * @NSS_CHAINS_BAND_MAX: Max bands supported
806  */
807 enum nss_chains_band_info {
808 	NSS_CHAINS_BAND_2GHZ = 0,
809 	NSS_CHAINS_BAND_5GHZ,
810 	NSS_CHAINS_BAND_MAX,
811 };
812 
813 /**
814  * struct vdev_nss_chains -          vdev config of nss, and chains
815  * @num_tx_chains:                   tx chains of vdev config
816  * @num_rx_chains:                   rx chains of vdev config
817  * @tx_nss:                          tx nss of vdev config
818  * @rx_nss:                          rx nss of vdev config
819  * @num_tx_chains_11b:               number of tx chains in 11b mode
820  * @num_tx_chains_11g:               number of tx chains in 11g mode
821  * @num_tx_chains_11a:               number of tx chains in 11a mode
822  * @disable_rx_mrc:                  disable 2 rx chains, in rx nss 1 mode
823  * @disable_tx_mrc:                  disable 2 tx chains, in tx nss 1 mode
824  */
825 struct vdev_nss_chains {
826 	uint32_t num_tx_chains[NSS_CHAINS_BAND_MAX];
827 	uint32_t num_rx_chains[NSS_CHAINS_BAND_MAX];
828 	uint32_t tx_nss[NSS_CHAINS_BAND_MAX];
829 	uint32_t rx_nss[NSS_CHAINS_BAND_MAX];
830 	uint32_t num_tx_chains_11b;
831 	uint32_t num_tx_chains_11g;
832 	uint32_t num_tx_chains_11a;
833 	bool disable_rx_mrc[NSS_CHAINS_BAND_MAX];
834 	bool disable_tx_mrc[NSS_CHAINS_BAND_MAX];
835 };
836 
837 /**
838  * struct hidden_ssid_vdev_restart_params -
839  *                    vdev restart cmd parameter
840  * @session_id: session id
841  * @ssid_len: ssid length
842  * @ssid: ssid
843  * @flags: flags
844  * @requestor_id: requestor id
845  * @disable_hw_ack: flag to disable hw ack feature
846  * @mhz: channel frequency
847  * @band_center_freq1: center freq 1
848  * @band_center_freq2: center freq 2
849  * @info: channel info
850  * @reg_info_1: contains min power, max power,
851  *              reg power and reg class id
852  * @reg_info_2: contains antennamax
853  * @hidden_ssid_restart_in_progress:
854  *      flag to check if restart is in progress
855  */
856 struct hidden_ssid_vdev_restart_params {
857 	uint8_t session_id;
858 	uint32_t ssid_len;
859 	uint32_t ssid[8];
860 	uint32_t flags;
861 	uint32_t requestor_id;
862 	uint32_t disable_hw_ack;
863 	uint32_t mhz;
864 	uint32_t band_center_freq1;
865 	uint32_t band_center_freq2;
866 	uint32_t info;
867 	uint32_t reg_info_1;
868 	uint32_t reg_info_2;
869 #ifndef CONFIG_VDEV_SM
870 	qdf_atomic_t hidden_ssid_restart_in_progress;
871 #endif
872 };
873 
874 /**
875  * struct vdev_set_params - vdev set cmd parameter
876  * @if_id: vdev id
877  * @param_id: parameter id
878  * @param_value: parameter value
879  */
880 struct vdev_set_params {
881 	uint32_t if_id;
882 	uint32_t param_id;
883 	uint32_t param_value;
884 };
885 
886 /**
887  * struct sifs_trigger_param - sifs_trigger cmd parameter
888  * @if_id: vdev id
889  * @param_value: parameter value
890  */
891 struct sifs_trigger_param {
892 	uint32_t if_id;
893 	uint32_t param_value;
894 };
895 
896 /**
897  * struct peer_delete_params - peer delete cmd parameter
898  * @vdev_id: vdev id
899  */
900 struct peer_delete_params {
901 	uint8_t vdev_id;
902 };
903 
904 /**
905  * struct peer_flush_params - peer flush cmd parameter
906  * @peer_tid_bitmap: peer tid bitmap
907  * @vdev_id: vdev id
908  */
909 struct peer_flush_params {
910 	uint32_t peer_tid_bitmap;
911 	uint8_t vdev_id;
912 };
913 
914 /**
915  * struct peer_set_params - peer set cmd parameter
916  * @param_id: parameter id
917  * @param_value: parameter value
918  * @vdev_id: vdev id
919  */
920 struct peer_set_params {
921 	uint32_t param_id;
922 	uint32_t param_value;
923 	uint32_t vdev_id;
924 };
925 
926 /**
927  * struct peer_create_params - peer create cmd parameter
928  * @peer_addr: peer mac addr
929  * @peer_type: peer type
930  * @vdev_id: vdev id
931  */
932 struct peer_create_params {
933 	const uint8_t *peer_addr;
934 	uint32_t peer_type;
935 	uint32_t vdev_id;
936 };
937 
938 /**
939  * struct peer_remove_params - peer remove cmd parameter
940  * @bssid: bss id
941  * @vdev_id: vdev id
942  * @roam_synch_in_progress: flag to indicate if roaming is in progress
943  */
944 struct peer_remove_params {
945 	uint8_t *bssid;
946 	uint8_t vdev_id;
947 	bool roam_synch_in_progress;
948 };
949 
950 /**
951  * Stats ID enums defined in host
952  */
953 typedef enum {
954 	WMI_HOST_REQUEST_PEER_STAT = 0x01,
955 	WMI_HOST_REQUEST_AP_STAT = 0x02,
956 	WMI_HOST_REQUEST_PDEV_STAT = 0x04,
957 	WMI_HOST_REQUEST_VDEV_STAT = 0x08,
958 	WMI_HOST_REQUEST_BCNFLT_STAT = 0x10,
959 	WMI_HOST_REQUEST_VDEV_RATE_STAT = 0x20,
960 	WMI_HOST_REQUEST_INST_STAT  = 0x40,
961 	WMI_HOST_REQUEST_PEER_EXTD_STAT =  0x80,
962 	WMI_HOST_REQUEST_VDEV_EXTD_STAT =  0x100,
963 	WMI_HOST_REQUEST_NAC_RSSI =  0x200,
964 	WMI_HOST_REQUEST_BCN_STAT =  0x800,
965 	WMI_HOST_REQUEST_BCN_STAT_RESET =  0x1000,
966 	WMI_HOST_REQUEST_PEER_RETRY_STAT = 0x2000,
967 } wmi_host_stats_id;
968 
969 typedef struct {
970 	uint16_t cfg_retry_count;
971 	uint16_t retry_count;
972 } wmi_host_inst_rssi_args;
973 
974 /**
975  * struct stats_request_params - stats_request cmd parameter
976  * @stats_id: Bit mask of all the STATS request are specified with values from wmi_host_stats_id
977  * @vdev_id: vdev id
978  * @pdev_id: pdev_id
979  * @wmi_host_inst_rssi_args: Instantaneous rssi stats args
980  */
981 struct stats_request_params {
982 	uint32_t stats_id;
983 	uint8_t vdev_id;
984 	uint8_t pdev_id;
985 	wmi_host_inst_rssi_args rssi_args;
986 };
987 
988 /**
989  * struct bss_chan_info_request_params - BSS chan info params
990  * @param: parameter value
991  */
992 struct bss_chan_info_request_params {
993 	uint32_t param;
994 };
995 
996 /**
997  * struct wow_cmd_params - wow cmd parameter
998  * @enable: wow enable or disable flag
999  * @can_suspend_link: flag to indicate if link can be suspended
1000  * @pause_iface_config: interface config
1001  */
1002 struct wow_cmd_params {
1003 	bool enable;
1004 	bool can_suspend_link;
1005 	uint8_t pause_iface_config;
1006 	uint32_t flags;
1007 };
1008 
1009 /**
1010  * struct wow_add_wakeup_params - wow wakeup parameter
1011  * @type: param type
1012  */
1013 struct wow_add_wakeup_params {
1014 	uint32_t type;
1015 };
1016 
1017 /**
1018  * struct wow_add_wakeup_pattern_params - Add WoW pattern params
1019  * @pattern_bytes: pointer to pattern bytes
1020  * @mask_bytes: pointer to mask bytes
1021  * @pattern_len: pattern length
1022  * @pattern_id: pattern id
1023  */
1024 struct wow_add_wakeup_pattern_params {
1025 	uint8_t *pattern_bytes;
1026 	uint8_t *mask_bytes;
1027 	uint32_t pattern_len;
1028 	uint32_t pattern_id;
1029 };
1030 
1031 /**
1032  * struct wow_remove_wakeup_pattern params - WoW remove pattern param
1033  * @pattern_bytes: pointer to pattern bytes
1034  * @mask_bytes: Mask bytes
1035  * @pattern_id: pattern identifier
1036  */
1037 struct wow_remove_wakeup_pattern_params {
1038 	uint32_t *pattern_bytes;
1039 	uint32_t *mask_bytes;
1040 	uint32_t pattern_id;
1041 };
1042 
1043 
1044 /**
1045  * struct packet_enable_params - packet enable cmd parameter
1046  * @vdev_id: vdev id
1047  * @enable: flag to indicate if parameter can be enabled or disabled
1048  */
1049 struct packet_enable_params {
1050 	uint8_t vdev_id;
1051 	bool enable;
1052 };
1053 
1054 /**
1055  * struct suspend_params - suspend cmd parameter
1056  * @disable_target_intr: disable target interrupt
1057  */
1058 struct suspend_params {
1059 	uint8_t disable_target_intr;
1060 };
1061 
1062 /**
1063  * struct pdev_params - pdev set cmd parameter
1064  * @param_id: parameter id
1065  * @param_value: parameter value
1066  */
1067 struct pdev_params {
1068 	uint32_t param_id;
1069 	uint32_t param_value;
1070 };
1071 
1072 /**
1073  * struct beacon_tmpl_params - beacon template cmd parameter
1074  * @vdev_id: vdev id
1075  * @tim_ie_offset: tim ie offset
1076  * @mbssid_ie_offset: mbssid ie offset
1077  * @tmpl_len: beacon template length
1078  * @tmpl_len_aligned: beacon template alignment
1079  * @csa_switch_count_offset: CSA swith count offset in beacon frame
1080  * @ext_csa_switch_count_offset: ECSA switch count offset in beacon frame
1081  * @esp_ie_offset: ESP IE offset in beacon frame
1082  * @frm: beacon template parameter
1083  */
1084 struct beacon_tmpl_params {
1085 	uint8_t vdev_id;
1086 	uint32_t tim_ie_offset;
1087 	uint32_t mbssid_ie_offset;
1088 	uint32_t tmpl_len;
1089 	uint32_t tmpl_len_aligned;
1090 	uint32_t csa_switch_count_offset;
1091 	uint32_t ext_csa_switch_count_offset;
1092 	uint32_t esp_ie_offset;
1093 	uint8_t *frm;
1094 };
1095 
1096 /**
1097  * struct beacon_params - beacon cmd parameter
1098  * @vdev_id: vdev id
1099  * @beaconInterval: Beacon interval
1100  * @wbuf: beacon buffer
1101  * @frame_ctrl: frame control field
1102  * @bcn_txant: beacon antenna
1103  * @is_dtim_count_zero: is it dtim beacon
1104  * @is_bitctl_reqd: is Bit control required
1105  * @is_high_latency: Is this high latency target
1106  */
1107 struct beacon_params {
1108 	uint8_t vdev_id;
1109 	uint16_t beaconInterval;
1110 	qdf_nbuf_t wbuf;
1111 	uint16_t frame_ctrl;
1112 	uint32_t bcn_txant;
1113 	bool is_dtim_count_zero;
1114 	bool is_bitctl_reqd;
1115 	bool is_high_latency;
1116 };
1117 
1118 /**
1119  * struct fd_params - FD cmd parameter
1120  * @vdev_id: vdev id
1121  * @wbuf: FD buffer
1122  * @frame_ctrl: frame control field
1123  */
1124 struct fd_params {
1125 	uint8_t vdev_id;
1126 	qdf_nbuf_t wbuf;
1127 	uint16_t frame_ctrl;
1128 };
1129 
1130 /**
1131  * struct bcn_prb_template_params - beacon probe template parameter
1132  * @vdev_id: vdev id
1133  * @buf_len: Template length
1134  * @caps: capabilities field
1135  * @erp: ERP field
1136  */
1137 struct bcn_prb_template_params {
1138 	uint8_t vdev_id;
1139 	int buf_len;
1140 	uint16_t caps;
1141 	uint8_t erp;
1142 };
1143 
1144 #define WMI_MAX_SUPPORTED_RATES 128
1145 /**
1146  * struct target_rate_set - Rate set bitmap
1147  * @num_rate: number of rates in rates bitmap
1148  * @rates: rates (each 8bit value) packed into a 32 bit word.
1149  *      the rates are filled from least significant byte to most
1150  *      significant byte.
1151  */
1152 typedef struct {
1153 	uint32_t num_rates;
1154 	uint32_t rates[(WMI_MAX_SUPPORTED_RATES / 4) + 1];
1155 } target_rate_set;
1156 
1157 
1158 #define WMI_HOST_MAX_NUM_SS		8
1159 #define WMI_HOST_MAX_HECAP_PHY_SIZE	3
1160 #define WMI_HOST_MAX_HECAP_MAC_SIZE	2
1161 #define WMI_HOST_HECAP_MAC_WORD1	0
1162 #define WMI_HOST_HECAP_MAC_WORD2	1
1163 #define WMI_HOST_MAX_HE_RATE_SET	3
1164 /**
1165  * struct wmi_host_ppe_threshold -PPE threshold
1166  * @numss_m1: NSS - 1
1167  * @ru_bit_mask: RU bit mask indicating the supported RU's
1168  * @ppet16_ppet8_ru3_ru0: ppet8 and ppet16 for max num ss
1169  */
1170 struct wmi_host_ppe_threshold {
1171 	uint32_t numss_m1;
1172 	uint32_t ru_bit_mask;
1173 	uint32_t ppet16_ppet8_ru3_ru0[WMI_HOST_MAX_NUM_SS];
1174 };
1175 
1176 /**
1177  * struct wmi_host_mac_addr - host mac addr 2 word representation of MAC addr
1178  * @mac_addr31to0: upper 4 bytes of  MAC address
1179  * @mac_addr47to32: lower 2 bytes of  MAC address
1180  */
1181 typedef struct {
1182 	uint32_t mac_addr31to0;
1183 	uint32_t mac_addr47to32;
1184 } wmi_host_mac_addr;
1185 
1186 /**
1187  * struct peer_assoc_params - peer assoc cmd parameter
1188  * @peer_macaddr: peer mac address
1189  * @vdev_id: vdev id
1190  * @peer_new_assoc: peer association type
1191  * @peer_associd: peer association id
1192  * @peer_flags: peer flags
1193  * @peer_caps: peer capabalities
1194  * @peer_listen_intval: peer listen interval
1195  * @peer_ht_caps: HT capabalities
1196  * @peer_max_mpdu: 0 : 8k , 1 : 16k, 2 : 32k, 3 : 64k
1197  * @peer_mpdu_density: 3 : 0~7 : 2^(11nAMPDUdensity -4)
1198  * @peer_rate_caps: peer rate capabalities
1199  * @peer_nss: peer nss
1200  * @peer_phymode: peer phymode
1201  * @peer_ht_info: peer HT info
1202  * @peer_legacy_rates: peer legacy rates
1203  * @peer_ht_rates: peer ht rates
1204  * @rx_max_rate: max rx rates
1205  * @rx_mcs_set: rx mcs
1206  * @tx_max_rate: max tx rates
1207  * @tx_mcs_set: tx mcs
1208  * @vht_capable: VHT capabalities
1209  * @tx_max_mcs_nss: max tx MCS and NSS
1210  * @peer_bw_rxnss_override: Peer BW RX NSS overridden or not.
1211  * @is_pmf_enabled: PMF enabled
1212  * @is_wme_set: WME enabled
1213  * @qos_flag: QoS Flags
1214  * @apsd_flag: APSD flags
1215  * @ht_flag: HT flags
1216  * @bw_40: 40 capabale
1217  * @bw_80: 80 capabale
1218  * @bw_160: 160 capabale
1219  * @stbc_flag: STBC flag
1220  * @ldpc_flag: LDPC flag
1221  * @static_mimops_flag: statis MIMO PS flags
1222  * @dynamic_mimops_flag: Dynamic MIMO PS flags
1223  * @spatial_mux_flag: spatial MUX flags
1224  * @vht_flag: VHT flags
1225  * @vht_ng_flag: VHT on 11N/G flags
1226  * @need_ptk_4_way: Needs 4 way handshake
1227  * @need_gtk_2_way: Needs 2 way GTK
1228  * @auth_flag: Is peer authenticated
1229  * @safe_mode_enabled: Safe enabled for this peer
1230  * @amsdu_disable: AMSDU disble
1231  * @peer_mac: Peer mac address
1232  * @he_flag: HE flags
1233  * @twt_requester: TWT Requester Support bit in Extended Capabilities element
1234  * @twt_responder: TWT Responder Support bit in Extended Capabilities element
1235  * @peer_he_cap_macinfo: Peer HE Cap MAC info
1236  * @peer_he_ops: Peer HE operation info
1237  * @peer_he_cap_phyinfo: Peer HE Cap PHY info
1238  * @peer_he_mcs_count: Peer HE MCS TX/RX MAP count
1239  * @peer_he_rx_mcs_set: Peer HE RX MCS MAP
1240  * @peer_he_tx_mcs_set: Peer HE TX MCS MAP
1241  * @peer_ppet: Peer HE PPET info
1242  */
1243 struct peer_assoc_params {
1244 	wmi_host_mac_addr peer_macaddr;
1245 	uint32_t vdev_id;
1246 	uint32_t peer_new_assoc;
1247 	uint32_t peer_associd;
1248 	uint32_t peer_flags;
1249 	uint32_t peer_caps;
1250 	uint32_t peer_listen_intval;
1251 	uint32_t peer_ht_caps;
1252 	uint32_t peer_max_mpdu;
1253 	uint32_t peer_mpdu_density;
1254 	uint32_t peer_rate_caps;
1255 	uint32_t peer_nss;
1256 	uint32_t peer_vht_caps;
1257 	uint32_t peer_phymode;
1258 	uint32_t peer_ht_info[2];
1259 	target_rate_set peer_legacy_rates;
1260 	target_rate_set peer_ht_rates;
1261 	uint32_t rx_max_rate;
1262 	uint32_t rx_mcs_set;
1263 	uint32_t tx_max_rate;
1264 	uint32_t tx_mcs_set;
1265 	uint8_t vht_capable;
1266 	uint32_t peer_bw_rxnss_override;
1267 #ifndef CONFIG_MCL
1268 	uint32_t tx_max_mcs_nss;
1269 	bool is_pmf_enabled;
1270 	bool is_wme_set;
1271 	bool qos_flag;
1272 	bool apsd_flag;
1273 	bool ht_flag;
1274 	bool bw_40;
1275 	bool bw_80;
1276 	bool bw_160;
1277 	bool stbc_flag;
1278 	bool ldpc_flag;
1279 	bool static_mimops_flag;
1280 	bool dynamic_mimops_flag;
1281 	bool spatial_mux_flag;
1282 	bool vht_flag;
1283 	bool vht_ng_flag;
1284 	bool need_ptk_4_way;
1285 	bool need_gtk_2_way;
1286 	bool auth_flag;
1287 	bool safe_mode_enabled;
1288 	bool amsdu_disable;
1289 	/* Use common structure */
1290 	uint8_t peer_mac[IEEE80211_ADDR_LEN];
1291 #endif
1292 	bool he_flag;
1293 	bool twt_requester;
1294 	bool twt_responder;
1295 	uint32_t peer_he_cap_macinfo[WMI_HOST_MAX_HECAP_MAC_SIZE];
1296 	uint32_t peer_he_ops;
1297 	uint32_t peer_he_cap_phyinfo[WMI_HOST_MAX_HECAP_PHY_SIZE];
1298 	uint32_t peer_he_mcs_count;
1299 	uint32_t peer_he_rx_mcs_set[WMI_HOST_MAX_HE_RATE_SET];
1300 	uint32_t peer_he_tx_mcs_set[WMI_HOST_MAX_HE_RATE_SET];
1301 	struct wmi_host_ppe_threshold peer_ppet;
1302 };
1303 
1304 /**
1305  * struct sta_ps_params - sta ps cmd parameter
1306  * @vdev_id: vdev id
1307  * @param: sta ps parameter
1308  * @value: sta ps parameter value
1309  */
1310 struct sta_ps_params {
1311 	uint32_t vdev_id;
1312 	uint32_t param;
1313 	uint32_t value;
1314 };
1315 
1316 /**
1317  * struct ap_ps_params - ap ps cmd parameter
1318  * @vdev_id: vdev id
1319  * @param: ap ps parameter
1320  * @value: ap ps parameter value
1321  */
1322 struct ap_ps_params {
1323 	uint32_t vdev_id;
1324 	uint32_t param;
1325 	uint32_t value;
1326 };
1327 
1328 #define WMI_HOST_SCAN_CHAN_FREQ_SHIFT	0
1329 #define WMI_HOST_SCAN_CHAN_FREQ_MASK	0xffff
1330 #define WMI_HOST_SCAN_CHAN_MODE_SHIFT	16
1331 #define WMI_HOST_SCAN_CHAN_MODE_MASK	0xff
1332 
1333 #define WMI_HOST_MAX_CHANS_PER_WMI_CMD  58
1334 
1335 /**
1336  * struct scan_chan_list_params  - scan channel list cmd parameter
1337  * @pdev_id: pdev_id
1338  * @num_chan: no of scan channels
1339  * @nallchans: nall chans
1340  * @append: append to existing chan list
1341  * @ch_param: pointer to channel_paramw
1342  */
1343 struct scan_chan_list_params {
1344 	uint32_t pdev_id;
1345 	uint16_t nallchans;
1346 	bool append;
1347 	struct channel_param ch_param[1];
1348 };
1349 
1350 /**
1351  * struct multiple_vdev_restart_params - Multiple vdev restart cmd parameter
1352  * @pdev_id: Pdev identifier
1353  * @requestor_id: Unique id identifying the module
1354  * @disable_hw_ack: Flag to indicate disabling HW ACK during CAC
1355  * @cac_duration_ms: CAC duration on the given channel
1356  * @num_vdevs: No. of vdevs that need to be restarted
1357  * @ch_param: Pointer to channel_param
1358  * @vdev_ids: Pointer to array of vdev_ids
1359  */
1360 struct multiple_vdev_restart_params {
1361 	uint32_t pdev_id;
1362 	uint32_t requestor_id;
1363 	uint32_t disable_hw_ack;
1364 	uint32_t cac_duration_ms;
1365 	uint32_t num_vdevs;
1366 	struct channel_param ch_param;
1367 	uint32_t vdev_ids[WMI_HOST_PDEV_MAX_VDEVS];
1368 };
1369 /**
1370  * struct fw_hang_params - fw hang command parameters
1371  * @type: 0:unused 1: ASSERT, 2:not respond detect command, 3:simulate ep-full
1372  * @delay_time_ms: 0xffffffff means the simulate will delay for random time (0 ~0xffffffff ms)
1373  */
1374 struct fw_hang_params {
1375 	uint32_t type;
1376 	uint32_t delay_time_ms;
1377 };
1378 
1379 /**
1380  * struct pdev_utf_params - pdev utf command parameters
1381  * @utf_payload:
1382  * @len:
1383  * @is_ar900b: is it 900b target
1384  */
1385 struct pdev_utf_params {
1386 	uint8_t *utf_payload;
1387 	uint32_t len;
1388 #ifndef CONFIG_MCL
1389 	bool is_ar900b;
1390 #endif
1391 };
1392 
1393 /*Adding this due to dependency on wmi_unified.h
1394  */
1395 typedef struct {
1396 	uint32_t len;
1397 	uint32_t msgref;
1398 	uint32_t segmentInfo;
1399 } QVIT_SEG_HDR_INFO_STRUCT;
1400 
1401 struct pdev_qvit_params {
1402 	uint8_t *utf_payload;
1403 	uint32_t len;
1404 };
1405 /**
1406  * struct crash_inject - crash inject command parameters
1407  * @type: crash inject type
1408  * @delay_time_ms: time in milliseconds for FW to delay the crash
1409  */
1410 struct crash_inject {
1411 	uint32_t type;
1412 	uint32_t delay_time_ms;
1413 };
1414 
1415 /**
1416  * struct dbglog_params - fw deboglog command parameters
1417  * @param: command parameter
1418  * @val: parameter value
1419  * @module_id_bitmap: fixed length module id bitmap
1420  * @bitmap_len: module id bitmap length
1421  * @cfgvalid: cfgvalid
1422  */
1423 struct dbglog_params {
1424 	uint32_t param;
1425 	uint32_t val;
1426 	uint32_t *module_id_bitmap;
1427 	uint32_t bitmap_len;
1428 #ifndef CONFIG_MCL
1429 	uint32_t cfgvalid[2];
1430 #endif
1431 };
1432 
1433 /**
1434  * struct seg_hdr_info - header info
1435  * @len: length
1436  * @msgref: message reference
1437  * @segmentInfo: segment info
1438  * @pad: padding
1439  */
1440 struct seg_hdr_info {
1441 	uint32_t len;
1442 	uint32_t msgref;
1443 	uint32_t segmentInfo;
1444 	uint32_t pad;
1445 };
1446 
1447 /**
1448  * struct tx_send_params - TX parameters
1449  * @pwr: Tx frame transmission power
1450  * @mcs_mask: Modulation and coding index mask for transmission
1451  *	      bit  0 -> CCK 1 Mbps rate is allowed
1452  *	      bit  1 -> CCK 2 Mbps rate is allowed
1453  *	      bit  2 -> CCK 5.5 Mbps rate is allowed
1454  *	      bit  3 -> CCK 11 Mbps rate is allowed
1455  *	      bit  4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
1456  *	      bit  5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
1457  *	      bit  6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
1458  *	      bit  7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
1459  *	      bit  8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
1460  *	      bit  9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
1461  *	      bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
1462  *	      bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
1463  * @nss_mask: Spatial streams permitted
1464  *	      bit 0: if set, Nss = 1 (non-MIMO) is permitted
1465  *	      bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
1466  *	      bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
1467  *	      bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
1468  *	      bit 4: if set, Nss = 5 (5x5 MIMO) is permitted
1469  *	      bit 5: if set, Nss = 6 (6x6 MIMO) is permitted
1470  *	      bit 6: if set, Nss = 7 (7x7 MIMO) is permitted
1471  *	      bit 7: if set, Nss = 8 (8x8 MIMO) is permitted
1472  *            If no bits are set, target will choose what NSS type to use
1473  * @retry_limit: Maximum number of retries before ACK
1474  * @chain_mask: Chains to be used for transmission
1475  * @bw_mask: Bandwidth to be used for transmission
1476  *	     bit  0 -> 5MHz
1477  *	     bit  1 -> 10MHz
1478  *	     bit  2 -> 20MHz
1479  *	     bit  3 -> 40MHz
1480  *	     bit  4 -> 80MHz
1481  *	     bit  5 -> 160MHz
1482  *	     bit  6 -> 80_80MHz
1483  * @preamble_type: Preamble types for transmission
1484  *	     bit 0: if set, OFDM
1485  *	     bit 1: if set, CCK
1486  *	     bit 2: if set, HT
1487  *	     bit 3: if set, VHT
1488  *	     bit 4: if set, HE
1489  * @frame_type: Data or Management frame
1490  *	        Data:1 Mgmt:0
1491  */
1492 struct tx_send_params {
1493 	uint32_t pwr:8,
1494 		 mcs_mask:12,
1495 		 nss_mask:8,
1496 		 retry_limit:4;
1497 	uint32_t chain_mask:8,
1498 		 bw_mask:7,
1499 		 preamble_type:5,
1500 		 frame_type:1,
1501 		 reserved:11;
1502 };
1503 
1504 /**
1505  * struct wmi_mgmt_params - wmi mgmt cmd parameters
1506  * @tx_frame: management tx frame
1507  * @frm_len: frame length
1508  * @vdev_id: vdev id
1509  * @chanfreq: channel frequency
1510  * @pdata: frame data
1511  * @desc_id: descriptor id relyaed back by target
1512  * @macaddr: macaddr of peer
1513  * @qdf_ctx: qdf context for qdf_nbuf_map
1514  * @tx_param: TX send parameters
1515  * @tx_params_valid: Flag that indicates if TX params are valid
1516  * @use_6mbps: specify whether management frame to transmit should
1517  *  use 6 Mbps rather than 1 Mbps min rate(for 5GHz band or P2P)
1518  * @tx_type: type of management frame (determines what callback to use)
1519  */
1520 struct wmi_mgmt_params {
1521 	void *tx_frame;
1522 	uint16_t frm_len;
1523 	uint8_t vdev_id;
1524 	uint16_t chanfreq;
1525 	void *pdata;
1526 	uint16_t desc_id;
1527 	uint8_t *macaddr;
1528 	void *qdf_ctx;
1529 	struct tx_send_params tx_param;
1530 	bool tx_params_valid;
1531 	uint8_t use_6mbps;
1532 	uint8_t tx_type;
1533 };
1534 
1535 /**
1536  * struct wmi_offchan_data_tx_params - wmi offchan data tx cmd parameters
1537  * @tx_frame: management tx frame
1538  * @frm_len: frame length
1539  * @vdev_id: vdev id
1540  * @chanfreq: channel frequency
1541  * @pdata: frame data
1542  * @desc_id: descriptor id relyaed back by target
1543  * @macaddr: macaddr of peer
1544  * @qdf_ctx: qdf context for qdf_nbuf_map
1545  * @tx_param: TX send parameters
1546  * @tx_params_valid: Flag that indicates if TX params are valid
1547  */
1548 struct wmi_offchan_data_tx_params {
1549 	void *tx_frame;
1550 	uint16_t frm_len;
1551 	uint8_t vdev_id;
1552 	uint16_t chanfreq;
1553 	void *pdata;
1554 	uint16_t desc_id;
1555 	uint8_t *macaddr;
1556 	void *qdf_ctx;
1557 	struct tx_send_params tx_param;
1558 	bool tx_params_valid;
1559 };
1560 
1561 #ifndef CONVERGED_TDLS_ENABLE
1562 /**
1563  * struct sta_uapsd_params - uapsd auto trig params
1564  * @wmm_ac: WMM access category from 0 to 3
1565  * @user_priority: User priority to use in trigger frames
1566  * @service_interval: service interval
1567  * @suspend_interval: suspend interval
1568  * @delay_interval: delay interval
1569  */
1570 struct sta_uapsd_params {
1571 	uint32_t wmm_ac;
1572 	uint32_t user_priority;
1573 	uint32_t service_interval;
1574 	uint32_t suspend_interval;
1575 	uint32_t delay_interval;
1576 };
1577 
1578 /**
1579  * struct ta_uapsd_trig_params - uapsd trigger parameter
1580  * @vdevid: vdev id
1581  * @peer_addr: peer address
1582  * @auto_triggerparam: trigger parameters
1583  * @num_ac: no of access category
1584  */
1585 struct sta_uapsd_trig_params {
1586 		uint32_t vdevid;
1587 		uint8_t peer_addr[IEEE80211_ADDR_LEN];
1588 		struct sta_uapsd_params *auto_triggerparam;
1589 		uint32_t num_ac;
1590 };
1591 #endif
1592 
1593 #define WMI_NUM_AC                     (4)
1594 #define WMI_MAX_NUM_AC 4
1595 
1596 
1597 enum wmi_peer_rate_report_cond_phy_type {
1598 	WMI_PEER_RATE_REPORT_COND_11B = 0,
1599 	WMI_PEER_RATE_REPORT_COND_11A_G,
1600 	WMI_PEER_RATE_REPORT_COND_11N,
1601 	WMI_PEER_RATE_REPORT_COND_11AC,
1602 	WMI_PEER_RATE_REPORT_COND_MAX_NUM
1603 };
1604 
1605 /**
1606  * struct report_rate_delta - peer specific parameters
1607  * @percent: percentage
1608  * @delta_min: rate min delta
1609  */
1610 struct report_rate_delta {
1611 	uint32_t percent; /* in unit of 12.5% */
1612 	uint32_t delta_min;  /* in unit of Mbps */
1613 };
1614 
1615 /**
1616  * struct report_rate_per_phy - per phy report parameters
1617  * @cond_flags: condition flag val
1618  * @delta: rate delta
1619  * @report_rate_threshold: rate threshold
1620  */
1621 struct report_rate_per_phy {
1622 	/*
1623 	 * PEER_RATE_REPORT_COND_FLAG_DELTA,
1624 	 * PEER_RATE_REPORT_COND_FLAG_THRESHOLD
1625 	 * Any of these two conditions or both of
1626 	 * them can be set.
1627 	 */
1628 	uint32_t cond_flags;
1629 	struct report_rate_delta delta;
1630 	/*
1631 	 * In unit of Mbps. There are at most 4 thresholds
1632 	 * If the threshold count is less than 4, set zero to
1633 	 * the one following the last threshold
1634 	 */
1635 	uint32_t report_rate_threshold[WMI_MAX_NUM_OF_RATE_THRESH];
1636 };
1637 
1638 /**
1639  * struct peer_rate_report_params - peer rate report parameters
1640  * @rate_report_enable: enable rate report param
1641  * @backoff_time: backoff time
1642  * @timer_period: timer
1643  * @report_per_phy: report per phy type
1644  */
1645 struct wmi_peer_rate_report_params {
1646 	uint32_t rate_report_enable;
1647 	uint32_t backoff_time;            /* in unit of msecond */
1648 	uint32_t timer_period;            /* in unit of msecond */
1649 	/*
1650 	 *In the following field, the array index means the phy type,
1651 	 * please see enum wmi_peer_rate_report_cond_phy_type for detail
1652 	 */
1653 	struct report_rate_per_phy report_per_phy[
1654 				WMI_PEER_RATE_REPORT_COND_MAX_NUM];
1655 
1656 };
1657 
1658 /**
1659  * struct t_thermal_cmd_params - thermal command parameters
1660  * @min_temp: minimum temprature
1661  * @max_temp: maximum temprature
1662  * @thermal_enable: thermal enable
1663  */
1664 struct thermal_cmd_params {
1665 	uint16_t min_temp;
1666 	uint16_t max_temp;
1667 	uint8_t thermal_enable;
1668 };
1669 
1670 #define WMI_LRO_IPV4_SEED_ARR_SZ 5
1671 #define WMI_LRO_IPV6_SEED_ARR_SZ 11
1672 
1673 /**
1674  * struct wmi_lro_config_cmd_t - set LRO init parameters
1675  * @lro_enable: indicates whether lro is enabled
1676  * @tcp_flag: If the TCP flags from the packet do not match
1677  * the values in this field after masking with TCP flags mask
1678  * below, packet is not LRO eligible
1679  * @tcp_flag_mask: field for comparing the TCP values provided
1680  * above with the TCP flags field in the received packet
1681  * @toeplitz_hash_ipv4: contains seed needed to compute the flow id
1682  * 5-tuple toeplitz hash for ipv4 packets
1683  * @toeplitz_hash_ipv6: contains seed needed to compute the flow id
1684  * 5-tuple toeplitz hash for ipv6 packets
1685  * @pdev_id: radio on which lro hash is configured
1686  */
1687 struct wmi_lro_config_cmd_t {
1688 	uint32_t lro_enable;
1689 	uint32_t tcp_flag:9,
1690 		tcp_flag_mask:9;
1691 	uint32_t toeplitz_hash_ipv4[WMI_LRO_IPV4_SEED_ARR_SZ];
1692 	uint32_t toeplitz_hash_ipv6[WMI_LRO_IPV6_SEED_ARR_SZ];
1693 	uint32_t pdev_id;
1694 };
1695 
1696 /**
1697  * struct wmi_probe_resp_params - send probe response parameters
1698  * @prb_rsp_template_frm: pointer to template probe response template
1699  * @prb_rsp_template_len: length of probe response template
1700  */
1701 struct wmi_probe_resp_params {
1702 	uint8_t *prb_rsp_template_frm;
1703 	uint32_t prb_rsp_template_len;
1704 };
1705 
1706 /* struct set_key_params: structure containing
1707  *                        installation key parameters
1708  * @vdev_id: vdev id
1709  * @key_len: key length
1710  * @key_idx: key index
1711  * @peer_mac: peer mac address
1712  * @key_flags: key flags, 0:pairwise key, 1:group key, 2:static key
1713  * @key_cipher: key cipher based on security mode
1714  * @key_txmic_len: tx mic length
1715  * @key_rxmic_len: rx mic length
1716  * @key_tsc_counter:  key tx sc counter
1717  * @key_rsc_counter:  key rx sc counter
1718  * @key_rsc_ctr:  key rx sc counter (stack variable, unnecessary heap alloc for
1719  *                key_rsc_counter should be cleaned up eventually)
1720  * @rx_iv: receive IV, applicable only in case of WAPI
1721  * @tx_iv: transmit IV, applicable only in case of WAPI
1722  * @key_data: key data
1723  */
1724 struct set_key_params {
1725 	uint8_t vdev_id;
1726 	uint16_t key_len;
1727 	uint32_t key_idx;
1728 	uint8_t peer_mac[IEEE80211_ADDR_LEN];
1729 	uint32_t key_flags;
1730 	uint32_t key_cipher;
1731 	uint32_t key_txmic_len;
1732 	uint32_t key_rxmic_len;
1733 	uint64_t key_tsc_counter;
1734 	uint64_t *key_rsc_counter;
1735 	uint64_t key_rsc_ctr;
1736 #if defined(ATH_SUPPORT_WAPI) || defined(FEATURE_WLAN_WAPI)
1737 	uint8_t rx_iv[16];
1738 	uint8_t tx_iv[16];
1739 #endif
1740 	uint8_t key_data[WMI_MAC_MAX_KEY_LENGTH];
1741 };
1742 
1743 /**
1744  * struct scan_mac_oui - oui parameters
1745  * @oui: oui parameters
1746  * @vdev_id: interface id
1747  * @enb_probe_req_sno_randomization: control probe req sequence no randomization
1748  * @ie_whitelist: probe req IE whitelist attrs
1749  */
1750 struct scan_mac_oui {
1751 	uint8_t oui[WMI_WIFI_SCANNING_MAC_OUI_LENGTH];
1752 	uint32_t vdev_id;
1753 	bool enb_probe_req_sno_randomization;
1754 	struct probe_req_whitelist_attr ie_whitelist;
1755 };
1756 
1757 #define WMI_PASSPOINT_REALM_LEN 256
1758 #define WMI_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM 16
1759 #define WMI_PASSPOINT_PLMN_LEN 3
1760 /**
1761  * struct wifi_passpoint_network_param - passpoint network block
1762  * @id: identifier of this network block
1763  * @realm: null terminated UTF8 encoded realm, 0 if unspecified
1764  * @roaming_consortium_ids: roaming consortium ids to match, 0s if unspecified
1765  * @plmn: mcc/mnc combination as per rules, 0s if unspecified
1766  */
1767 struct wifi_passpoint_network_param {
1768 	uint32_t id;
1769 	uint8_t  realm[WMI_PASSPOINT_REALM_LEN];
1770 	int64_t  roaming_consortium_ids[WMI_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM];
1771 	uint8_t  plmn[WMI_PASSPOINT_PLMN_LEN];
1772 };
1773 
1774 /**
1775  * struct wifi_passpoint_req_param - passpoint request
1776  * @request_id: request identifier
1777  * @vdev_id: vdev that is the target of the request
1778  * @num_networks: number of valid entries in @networks
1779  * @networks: passpoint networks
1780  */
1781 struct wifi_passpoint_req_param {
1782 	uint32_t request_id;
1783 	uint32_t vdev_id;
1784 	uint32_t num_networks;
1785 	struct wifi_passpoint_network_param networks[];
1786 };
1787 
1788 /* struct mobility_domain_info - structure containing
1789  *                               mobility domain info
1790  * @mdie_present: mobility domain present or not
1791  * @mobility_domain: mobility domain
1792  */
1793 struct mobility_domain_info {
1794 	uint8_t mdie_present;
1795 	uint16_t mobility_domain;
1796 };
1797 
1798 #define WMI_HOST_ROAM_OFFLOAD_NUM_MCS_SET     (16)
1799 
1800 /* This TLV will be filled only in case roam offload
1801  * for wpa2-psk/pmkid/ese/11r is enabled */
1802 typedef struct {
1803 	/*
1804 	 * TLV tag and len; tag equals
1805 	 * WMITLV_TAG_STRUC_wmi_roam_offload_fixed_param
1806 	 */
1807 	uint32_t tlv_header;
1808 	uint32_t rssi_cat_gap;          /* gap for every category bucket */
1809 	uint32_t prefer_5g;             /* prefer select 5G candidate */
1810 	uint32_t select_5g_margin;
1811 	uint32_t reassoc_failure_timeout;       /* reassoc failure timeout */
1812 	uint32_t capability;
1813 	uint32_t ht_caps_info;
1814 	uint32_t ampdu_param;
1815 	uint32_t ht_ext_cap;
1816 	uint32_t ht_txbf;
1817 	uint32_t asel_cap;
1818 	uint32_t qos_enabled;
1819 	uint32_t qos_caps;
1820 	uint32_t wmm_caps;
1821 	/* since this is 4 byte aligned, we don't declare it as tlv array */
1822 	uint32_t mcsset[WMI_HOST_ROAM_OFFLOAD_NUM_MCS_SET >> 2];
1823 	uint32_t ho_delay_for_rx;
1824 	uint32_t roam_preauth_retry_count;
1825 	uint32_t roam_preauth_no_ack_timeout;
1826 } roam_offload_param;
1827 
1828 #define WMI_FILS_MAX_RRK_LENGTH 64
1829 #define WMI_FILS_MAX_RIK_LENGTH WMI_FILS_MAX_RRK_LENGTH
1830 #define WMI_FILS_MAX_REALM_LENGTH 256
1831 #define WMI_FILS_MAX_USERNAME_LENGTH 16
1832 
1833 /**
1834  * struct roam_fils_params - Roam FILS params
1835  * @username: username
1836  * @username_length: username length
1837  * @next_erp_seq_num: next ERP sequence number
1838  * @rrk: RRK
1839  * @rrk_length: length of @rrk
1840  * @rik: RIK
1841  * @rik_length: length of @rik
1842  * @realm: realm
1843  * @realm_len: length of @realm
1844  */
1845 struct roam_fils_params {
1846 	uint8_t username[WMI_FILS_MAX_USERNAME_LENGTH];
1847 	uint32_t username_length;
1848 	uint32_t next_erp_seq_num;
1849 	uint8_t rrk[WMI_FILS_MAX_RRK_LENGTH];
1850 	uint32_t rrk_length;
1851 	uint8_t rik[WMI_FILS_MAX_RIK_LENGTH];
1852 	uint32_t rik_length;
1853 	uint8_t realm[WMI_FILS_MAX_REALM_LENGTH];
1854 	uint32_t realm_len;
1855 };
1856 
1857 /* struct roam_offload_scan_params - structure
1858  *     containing roaming offload scan parameters
1859  * @is_roam_req_valid: flag to tell whether roam req
1860  *                     is valid or NULL
1861  * @mode: stores flags for scan
1862  * @vdev_id: vdev id
1863  * @roam_offload_enabled: flag for offload enable
1864  * @psk_pmk: pre shared key/pairwise master key
1865  * @pmk_len: length of PMK
1866  * @prefer_5ghz: prefer select 5G candidate
1867  * @roam_rssi_cat_gap: gap for every category bucket
1868  * @select_5ghz_margin: select 5 Ghz margin
1869  * @krk: KRK
1870  * @btk: BTK
1871  * @reassoc_failure_timeout: reassoc failure timeout
1872  * @rokh_id_length: r0kh id length
1873  * @rokh_id: r0kh id
1874  * @roam_key_mgmt_offload_enabled: roam offload flag
1875  * @auth_mode: authentication mode
1876  * @fw_okc: use OKC in firmware
1877  * @fw_pmksa_cache: use PMKSA cache in firmware
1878  * @is_ese_assoc: flag to determine ese assoc
1879  * @mdid: mobility domain info
1880  * @roam_offload_params: roam offload tlv params
1881  * @min_delay_btw_roam_scans: Delay btw two scans
1882  * @roam_trigger_reason_bitmask: Roam reason bitmark
1883  * @roam_offload_params: roam offload tlv params, unused
1884  *     in non tlv target, only for roam offload feature
1885  * @assoc_ie_length: Assoc IE length
1886  * @assoc_ie: Assoc IE buffer
1887  * @add_fils_tlv: add FILS TLV boolean
1888  * @roam_fils_params: roam fils params
1889  * @rct_validity_timer: duration value for which the entries in
1890  * roam candidate table are valid
1891  */
1892 struct roam_offload_scan_params {
1893 	uint8_t is_roam_req_valid;
1894 	uint32_t mode;
1895 	uint32_t vdev_id;
1896 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
1897 	uint8_t roam_offload_enabled;
1898 	uint8_t psk_pmk[WMI_ROAM_SCAN_PSK_SIZE];
1899 	uint32_t pmk_len;
1900 	uint8_t prefer_5ghz;
1901 	uint8_t roam_rssi_cat_gap;
1902 	uint8_t select_5ghz_margin;
1903 	uint8_t krk[WMI_KRK_KEY_LEN];
1904 	uint8_t btk[WMI_BTK_KEY_LEN];
1905 	uint32_t reassoc_failure_timeout;
1906 	uint32_t rokh_id_length;
1907 	uint8_t rokh_id[WMI_ROAM_R0KH_ID_MAX_LEN];
1908 	uint8_t roam_key_mgmt_offload_enabled;
1909 	int auth_mode;
1910 	bool fw_okc;
1911 	bool fw_pmksa_cache;
1912 	uint32_t rct_validity_timer;
1913 #endif
1914 	uint32_t min_delay_btw_roam_scans;
1915 	uint32_t roam_trigger_reason_bitmask;
1916 	bool is_ese_assoc;
1917 	bool is_11r_assoc;
1918 	struct mobility_domain_info mdid;
1919 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
1920 	roam_offload_param roam_offload_params;
1921 #endif
1922 	uint32_t assoc_ie_length;
1923 	uint8_t  assoc_ie[MAX_ASSOC_IE_LENGTH];
1924 	bool add_fils_tlv;
1925 #ifdef WLAN_FEATURE_FILS_SK
1926 	struct roam_fils_params roam_fils_params;
1927 #endif
1928 };
1929 
1930 /**
1931  * struct wifi_epno_network - enhanced pno network block
1932  * @ssid: ssid
1933  * @rssi_threshold: threshold for considering this SSID as found, required
1934  *		    granularity for this threshold is 4dBm to 8dBm
1935  * @flags: WIFI_PNO_FLAG_XXX
1936  * @auth_bit_field: auth bit field for matching WPA IE
1937  */
1938 struct wifi_epno_network_params {
1939 	struct mac_ssid  ssid;
1940 	int8_t       rssi_threshold;
1941 	uint8_t      flags;
1942 	uint8_t      auth_bit_field;
1943 };
1944 
1945 /**
1946  * struct wifi_enhanced_pno_params - enhanced pno network params
1947  * @request_id: request id number
1948  * @vdev_id: vdev id
1949  * @min_5ghz_rssi: minimum 5GHz RSSI for a BSSID to be considered
1950  * @min_24ghz_rssi: minimum 2.4GHz RSSI for a BSSID to be considered
1951  * @initial_score_max: maximum score that a network can have before bonuses
1952  * @current_connection_bonus: only report when there is a network's score this
1953  *    much higher than the current connection
1954  * @same_network_bonus: score bonus for all n/w with the same network flag
1955  * @secure_bonus: score bonus for networks that are not open
1956  * @band_5ghz_bonus: 5GHz RSSI score bonus (applied to all 5GHz networks)
1957  * @num_networks: number of ssids
1958  * @networks: EPNO networks
1959  */
1960 struct wifi_enhanced_pno_params {
1961 	uint32_t    request_id;
1962 	uint32_t    vdev_id;
1963 	uint32_t    min_5ghz_rssi;
1964 	uint32_t    min_24ghz_rssi;
1965 	uint32_t    initial_score_max;
1966 	uint32_t    current_connection_bonus;
1967 	uint32_t    same_network_bonus;
1968 	uint32_t    secure_bonus;
1969 	uint32_t    band_5ghz_bonus;
1970 	uint32_t    num_networks;
1971 	struct wifi_epno_network_params networks[];
1972 };
1973 
1974 enum {
1975 	WMI_AP_RX_DATA_OFFLOAD             = 0x00,
1976 	WMI_STA_RX_DATA_OFFLOAD            = 0x01,
1977 };
1978 
1979 /**
1980  * enum extscan_configuration_flags - extscan config flags
1981  * @WMI_EXTSCAN_LP_EXTENDED_BATCHING: extended batching
1982  */
1983 enum wmi_extscan_configuration_flags {
1984 	WMI_EXTSCAN_LP_EXTENDED_BATCHING = 0x00000001,
1985 };
1986 
1987 /**
1988  * enum extscan_report_events_type - extscan report events type
1989  * @EXTSCAN_REPORT_EVENTS_BUFFER_FULL: report only when scan history is % full
1990  * @EXTSCAN_REPORT_EVENTS_EACH_SCAN: report a scan completion event after scan
1991  * @EXTSCAN_REPORT_EVENTS_FULL_RESULTS: forward scan results
1992  *		(beacons/probe responses + IEs)
1993  *		in real time to HAL, in addition to completion events.
1994  *		Note: To keep backward compatibility,
1995  *		fire completion events regardless of REPORT_EVENTS_EACH_SCAN.
1996  * @EXTSCAN_REPORT_EVENTS_NO_BATCH: controls batching,
1997  *		0 => batching, 1 => no batching
1998  */
1999 enum wmi_extscan_report_events_type {
2000 	WMI_EXTSCAN_REPORT_EVENTS_BUFFER_FULL   = 0x00,
2001 	WMI_EXTSCAN_REPORT_EVENTS_EACH_SCAN     = 0x01,
2002 	WMI_EXTSCAN_REPORT_EVENTS_FULL_RESULTS  = 0x02,
2003 	WMI_EXTSCAN_REPORT_EVENTS_NO_BATCH      = 0x04,
2004 };
2005 
2006 /**
2007  * struct extscan_capabilities_params - ext scan capablities
2008  * @request_id: request_id
2009  * @vdev_id: vdev id
2010  */
2011 struct extscan_capabilities_params {
2012 	uint32_t request_id;
2013 	uint8_t vdev_id;
2014 };
2015 
2016 /**
2017  * struct extscan_capabilities_reset_params - ext scan capablities reset
2018  *                                            parameter
2019  * @request_id: request_id
2020  * @vdev_id: vdev id
2021  */
2022 struct extscan_capabilities_reset_params {
2023 	uint32_t request_id;
2024 	uint8_t vdev_id;
2025 };
2026 
2027 /**
2028  * struct extscan_bssid_hotlist_reset_params - ext scan hotlist reset parameter
2029  * @request_id: request_id
2030  * @vdev_id: vdev id
2031  */
2032 struct extscan_bssid_hotlist_reset_params {
2033 	uint32_t request_id;
2034 	uint8_t vdev_id;
2035 };
2036 
2037 /**
2038  * struct extscan_stop_req_params - ext scan stop parameter
2039  * @request_id: request_id
2040  * @vdev_id: vdev id
2041  */
2042 struct extscan_stop_req_params {
2043 	uint32_t request_id;
2044 	uint8_t vdev_id;
2045 };
2046 
2047 /**
2048  * struct ap_threshold_params - ap threshold parameter
2049  * @bssid: mac address
2050  * @low: low threshold
2051  * @high: high threshold
2052  */
2053 struct ap_threshold_params {
2054 	struct qdf_mac_addr bssid;
2055 	int32_t low;
2056 	int32_t high;
2057 };
2058 
2059 /**
2060  * struct extscan_set_sig_changereq_params - ext scan channel parameter
2061  * @request_id: request_id
2062  * @vdev_id: vdev id
2063  * @rssi_sample_size: Number of samples for averaging RSSI
2064  * @lostap_sample_size: Number of missed samples to confirm AP loss
2065  * @min_breaching: Number of APs breaching threshold required for firmware
2066  * @num_ap: no of scanned ap
2067  * @ap: ap threshold parameter
2068  */
2069 struct extscan_set_sig_changereq_params {
2070 	uint32_t request_id;
2071 	uint8_t vdev_id;
2072 	uint32_t rssi_sample_size;
2073 	uint32_t lostap_sample_size;
2074 	uint32_t min_breaching;
2075 	uint32_t num_ap;
2076 	struct ap_threshold_params ap[WMI_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS];
2077 };
2078 
2079 /**
2080  * struct extscan_cached_result_params - ext scan cached parameter
2081  * @request_id: request_id
2082  * @vdev_id: vdev id
2083  * @flush: cached results flush
2084  */
2085 struct extscan_cached_result_params {
2086 	uint32_t request_id;
2087 	uint8_t vdev_id;
2088 	bool flush;
2089 };
2090 
2091 #define WMI_WLAN_EXTSCAN_MAX_CHANNELS                 36
2092 #define WMI_WLAN_EXTSCAN_MAX_BUCKETS                  16
2093 #define WMI_WLAN_EXTSCAN_MAX_HOTLIST_APS              128
2094 #define WMI_WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS   64
2095 #define WMI_EXTSCAN_MAX_HOTLIST_SSIDS            8
2096 
2097 /**
2098  * struct wifi_scan_channelspec_params - wifi scan channel parameter
2099  * @channel: Frequency in MHz
2100  * @dwell_time_ms: dwell time in milliseconds
2101  * @passive: passive scan
2102  * @channel_class: channel class
2103  */
2104 struct wifi_scan_channelspec_params {
2105 	uint32_t channel;
2106 	uint32_t dwell_time_ms;
2107 	bool passive;
2108 	uint8_t channel_class;
2109 };
2110 
2111 /**
2112  * enum wmi_wifi_band - wifi band
2113  * @WMI_WIFI_BAND_UNSPECIFIED: unspecified band
2114  * @WMI_WIFI_BAND_BG: 2.4 GHz
2115  * @WMI_WIFI_BAND_A: 5 GHz without DFS
2116  * @WMI_WIFI_BAND_ABG: 2.4 GHz + 5 GHz; no DFS
2117  * @WMI_WIFI_BAND_A_DFS_ONLY: 5 GHz DFS only
2118  * @WMI_WIFI_BAND_A_WITH_DFS: 5 GHz with DFS
2119  * @WMI_WIFI_BAND_ABG_WITH_DFS: 2.4 GHz + 5 GHz with DFS
2120  * @WMI_WIFI_BAND_MAX: max range
2121  */
2122 enum wmi_wifi_band {
2123 	WMI_WIFI_BAND_UNSPECIFIED,
2124 	WMI_WIFI_BAND_BG = 1,
2125 	WMI_WIFI_BAND_A = 2,
2126 	WMI_WIFI_BAND_ABG = 3,
2127 	WMI_WIFI_BAND_A_DFS_ONLY = 4,
2128 	/* 5 is reserved */
2129 	WMI_WIFI_BAND_A_WITH_DFS = 6,
2130 	WMI_WIFI_BAND_ABG_WITH_DFS = 7,
2131 	/* Keep it last */
2132 	WMI_WIFI_BAND_MAX
2133 };
2134 
2135 /**
2136  * struct wifi_scan_bucket_params - wifi scan bucket spec
2137  * @bucket: bucket identifier
2138  * @band: wifi band
2139  * @period: Desired period, in millisecond; if this is too
2140  *		low, the firmware should choose to generate results as fast as
2141  *		it can instead of failing the command byte
2142  *		for exponential backoff bucket this is the min_period
2143  * @report_events: 0 => normal reporting (reporting rssi history
2144  *		only, when rssi history buffer is % full)
2145  *		1 => same as 0 + report a scan completion event after scanning
2146  *		this bucket
2147  *		2 => same as 1 + forward scan results
2148  *		(beacons/probe responses + IEs) in real time to HAL
2149  * @max_period: if max_period is non zero or different than period,
2150  *		then this bucket is an exponential backoff bucket and
2151  *		the scan period will grow exponentially as per formula:
2152  *		actual_period(N) = period ^ (N/(step_count+1)) to a
2153  *		maximum period of max_period
2154  * @exponent: for exponential back off bucket: multiplier:
2155  *		new_period = old_period * exponent
2156  * @step_count: for exponential back off bucket, number of scans performed
2157  *		at a given period and until the exponent is applied
2158  * @num_channels: channels to scan; these may include DFS channels
2159  *		Note that a given channel may appear in multiple buckets
2160  * @min_dwell_time_active: per bucket minimum active dwell time
2161  * @max_dwell_time_active: per bucket maximum active dwell time
2162  * @min_dwell_time_passive: per bucket minimum passive dwell time
2163  * @max_dwell_time_passive: per bucket maximum passive dwell time
2164  * @channels: Channel list
2165  */
2166 struct wifi_scan_bucket_params {
2167 	uint8_t         bucket;
2168 	enum wmi_wifi_band   band;
2169 	uint32_t        period;
2170 	uint32_t        report_events;
2171 	uint32_t        max_period;
2172 	uint32_t        exponent;
2173 	uint32_t        step_count;
2174 	uint32_t        num_channels;
2175 	uint32_t        min_dwell_time_active;
2176 	uint32_t        max_dwell_time_active;
2177 	uint32_t        min_dwell_time_passive;
2178 	uint32_t        max_dwell_time_passive;
2179 	struct wifi_scan_channelspec_params
2180 			channels[WMI_WLAN_EXTSCAN_MAX_CHANNELS];
2181 };
2182 
2183 /**
2184  * struct wifi_scan_cmd_req_params - wifi scan command request params
2185  * @base_period: base timer period
2186  * @max_ap_per_scan: max ap per scan
2187  * @report_threshold_percent: report threshold
2188  *	in %, when buffer is this much full, wake up host
2189  * @report_threshold_num_scans: report threshold number of scans
2190  *	in number of scans, wake up host after these many scans
2191  * @request_id: request id
2192  * @vdev_id: vdev that is the target of the request
2193  * @num_buckets: number of buckets
2194  * @min_dwell_time_active: per bucket minimum active dwell time
2195  * @max_dwell_time_active: per bucket maximum active dwell time
2196  * @min_dwell_time_passive: per bucket minimum passive dwell time
2197  * @max_dwell_time_passive: per bucket maximum passive dwell time
2198  * @configuration_flags: configuration flags
2199  * @extscan_adaptive_dwell_mode: adaptive dwelltime mode for extscan
2200  * @buckets: buckets array
2201  */
2202 struct wifi_scan_cmd_req_params {
2203 	uint32_t base_period;
2204 	uint32_t max_ap_per_scan;
2205 	uint32_t report_threshold_percent;
2206 	uint32_t report_threshold_num_scans;
2207 	uint32_t request_id;
2208 	uint8_t  vdev_id;
2209 	uint32_t num_buckets;
2210 	uint32_t min_dwell_time_active;
2211 	uint32_t max_dwell_time_active;
2212 	uint32_t min_dwell_time_passive;
2213 	uint32_t max_dwell_time_passive;
2214 	uint32_t configuration_flags;
2215 	enum scan_dwelltime_adaptive_mode extscan_adaptive_dwell_mode;
2216 	struct wifi_scan_bucket_params buckets[WMI_WLAN_EXTSCAN_MAX_BUCKETS];
2217 };
2218 
2219 /**
2220  * struct mac_ts_info_tfc - mac ts info parameters
2221  * @burstSizeDefn: burst size
2222  * @reserved: reserved
2223  * @ackPolicy: ack policy
2224  * @psb: psb
2225  * @aggregation: aggregation
2226  * @accessPolicy: access policy
2227  * @direction: direction
2228  * @tsid: direction
2229  * @trafficType: traffic type
2230  */
2231 struct mac_ts_info_tfc {
2232 #ifndef ANI_LITTLE_BIT_ENDIAN
2233 	uint8_t burstSizeDefn:1;
2234 	uint8_t reserved:7;
2235 #else
2236 	uint8_t reserved:7;
2237 	uint8_t burstSizeDefn:1;
2238 #endif
2239 
2240 #ifndef ANI_LITTLE_BIT_ENDIAN
2241 	uint16_t ackPolicy:2;
2242 	uint16_t userPrio:3;
2243 	uint16_t psb:1;
2244 	uint16_t aggregation:1;
2245 	uint16_t accessPolicy:2;
2246 	uint16_t direction:2;
2247 	uint16_t tsid:4;
2248 	uint16_t trafficType:1;
2249 #else
2250 	uint16_t trafficType:1;
2251 	uint16_t tsid:4;
2252 	uint16_t direction:2;
2253 	uint16_t accessPolicy:2;
2254 	uint16_t aggregation:1;
2255 	uint16_t psb:1;
2256 	uint16_t userPrio:3;
2257 	uint16_t ackPolicy:2;
2258 #endif
2259 } qdf_packed;
2260 
2261 /**
2262  * struct mac_ts_info_sch - mac ts info schedule parameters
2263  * @rsvd: reserved
2264  * @schedule: schedule bit
2265  */
2266 struct mac_ts_info_sch {
2267 #ifndef ANI_LITTLE_BIT_ENDIAN
2268 	uint8_t rsvd:7;
2269 	uint8_t schedule:1;
2270 #else
2271 	uint8_t schedule:1;
2272 	uint8_t rsvd:7;
2273 #endif
2274 } qdf_packed;
2275 
2276 /**
2277  * struct mac_ts_info_sch - mac ts info schedule parameters
2278  * @traffic: mac tfc parameter
2279  * @schedule: mac schedule parameters
2280  */
2281 struct mac_ts_info {
2282 	struct mac_ts_info_tfc traffic;
2283 	struct mac_ts_info_sch schedule;
2284 } qdf_packed;
2285 
2286 /**
2287  * struct mac_tspec_ie - mac ts spec
2288  * @type: type
2289  * @length: length
2290  * @tsinfo: tsinfo
2291  * @nomMsduSz: nomMsduSz
2292  * @maxMsduSz: maxMsduSz
2293  * @minSvcInterval: minSvcInterval
2294  * @maxSvcInterval: maxSvcInterval
2295  * @inactInterval: inactInterval
2296  * @suspendInterval: suspendInterval
2297  * @svcStartTime: svcStartTime
2298  * @minDataRate: minDataRate
2299  * @meanDataRate: meanDataRate
2300  * @peakDataRate: peakDataRate
2301  * @maxBurstSz: maxBurstSz
2302  * @delayBound: delayBound
2303  * @minPhyRate: minPhyRate
2304  * @surplusBw: surplusBw
2305  * @mediumTime: mediumTime
2306  */
2307 struct mac_tspec_ie {
2308 	uint8_t type;
2309 	uint8_t length;
2310 	struct mac_ts_info tsinfo;
2311 	uint16_t nomMsduSz;
2312 	uint16_t maxMsduSz;
2313 	uint32_t minSvcInterval;
2314 	uint32_t maxSvcInterval;
2315 	uint32_t inactInterval;
2316 	uint32_t suspendInterval;
2317 	uint32_t svcStartTime;
2318 	uint32_t minDataRate;
2319 	uint32_t meanDataRate;
2320 	uint32_t peakDataRate;
2321 	uint32_t maxBurstSz;
2322 	uint32_t delayBound;
2323 	uint32_t minPhyRate;
2324 	uint16_t surplusBw;
2325 	uint16_t mediumTime;
2326 } qdf_packed;
2327 
2328 /**
2329  * struct add_ts_param - ADDTS related parameters
2330  * @staIdx: station index
2331  * @tspecIdx: TSPEC handler uniquely identifying a TSPEC for a STA in a BSS
2332  * @tspec: tspec value
2333  * @status: CDF status
2334  * @sessionId: session id
2335  * @tsm_interval: TSM interval period passed from UMAC to WMI
2336  * @setRICparams: RIC parameters
2337  * @sme_session_id: sme session id
2338  */
2339 struct add_ts_param {
2340 	uint16_t staIdx;
2341 	uint16_t tspecIdx;
2342 	struct mac_tspec_ie tspec;
2343 	QDF_STATUS status;
2344 	uint8_t sessionId;
2345 #ifdef FEATURE_WLAN_ESE
2346 	uint16_t tsm_interval;
2347 #endif /* FEATURE_WLAN_ESE */
2348 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
2349 	uint8_t setRICparams;
2350 #endif /* WLAN_FEATURE_ROAM_OFFLOAD */
2351 	uint8_t sme_session_id;
2352 };
2353 
2354 /**
2355  * struct delts_req_info - DELTS request parameter
2356  * @tsinfo: ts info
2357  * @tspec: ts spec
2358  * @wmeTspecPresent: wme ts spec flag
2359  * @wsmTspecPresent: wsm ts spec flag
2360  * @lleTspecPresent: lle ts spec flag
2361  */
2362 struct delts_req_info {
2363 	struct mac_ts_info tsinfo;
2364 	struct mac_tspec_ie tspec;
2365 	uint8_t wmeTspecPresent:1;
2366 	uint8_t wsmTspecPresent:1;
2367 	uint8_t lleTspecPresent:1;
2368 };
2369 
2370 /**
2371  * struct del_ts_params - DELTS related parameters
2372  * @staIdx: station index
2373  * @tspecIdx: TSPEC identifier uniquely identifying a TSPEC for a STA in a BSS
2374  * @bssId: BSSID
2375  * @sessionId: session id
2376  * @userPrio: user priority
2377  * @delTsInfo: DELTS info
2378  * @setRICparams: RIC parameters
2379  */
2380 struct del_ts_params {
2381 	uint16_t staIdx;
2382 	uint16_t tspecIdx;
2383 	uint8_t bssId[IEEE80211_ADDR_LEN];
2384 	uint8_t sessionId;
2385 	uint8_t userPrio;
2386 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
2387 	struct delts_req_info delTsInfo;
2388 	uint8_t setRICparams;
2389 #endif /* WLAN_FEATURE_ROAM_OFFLOAD */
2390 };
2391 
2392 /**
2393  * struct ll_stats_clear_params - ll stats clear parameter
2394  * @req_id: request id
2395  * @sta_id: sta id
2396  * @stats_clear_mask: stats clear mask
2397  * @stop_req: stop request
2398  */
2399 struct ll_stats_clear_params {
2400 	uint32_t req_id;
2401 	uint8_t sta_id;
2402 	uint32_t stats_clear_mask;
2403 	uint8_t stop_req;
2404 };
2405 
2406 /**
2407  * struct ll_stats_set_params - ll stats get parameter
2408  * @req_id: request id
2409  * @sta_id: sta id
2410  * @mpdu_size_threshold: mpdu sixe threshold
2411  * @aggressive_statistics_gathering: aggressive_statistics_gathering
2412  */
2413 struct ll_stats_set_params {
2414 	uint32_t req_id;
2415 	uint8_t sta_id;
2416 	uint32_t mpdu_size_threshold;
2417 	uint32_t aggressive_statistics_gathering;
2418 };
2419 
2420 /**
2421  * struct ll_stats_get_params - ll stats parameter
2422  * @req_id: request id
2423  * @sta_id: sta id
2424  * @param_id_mask: param is mask
2425  */
2426 struct ll_stats_get_params {
2427 	uint32_t req_id;
2428 	uint8_t sta_id;
2429 	uint32_t param_id_mask;
2430 };
2431 
2432 
2433 /**
2434  * struct link_status_params - link stats parameter
2435  * @msg_type: message type is same as the request type
2436  * @msg_len: length of the entire request
2437  * @link_status: wme ts spec flag
2438  * @session_id: wsm ts spec flag
2439  */
2440 struct link_status_params {
2441 	uint16_t msg_type;
2442 	uint16_t msg_len;
2443 	uint8_t link_status;
2444 	uint8_t session_id;
2445 };
2446 
2447 /**
2448  * struct dhcp_stop_ind_params - DHCP Stop indication message
2449  * @msgtype: message type is same as the request type
2450  * @msglen: length of the entire request
2451  * @device_mode: Mode of the device(ex:STA, AP)
2452  * @adapter_macaddr: MAC address of the adapter
2453  * @peer_macaddr: MAC address of the connected peer
2454  */
2455 struct dhcp_stop_ind_params {
2456 	uint16_t msgtype;
2457 	uint16_t msglen;
2458 	uint8_t device_mode;
2459 	struct qdf_mac_addr adapter_macaddr;
2460 	struct qdf_mac_addr peer_macaddr;
2461 };
2462 
2463 #define    WMI_MAX_FILTER_TEST_DATA_LEN       8
2464 #define    WMI_MAX_NUM_MULTICAST_ADDRESS    240
2465 #define    WMI_MAX_NUM_FILTERS               20
2466 #define    WMI_MAX_NUM_TESTS_PER_FILTER      10
2467 
2468 /**
2469  * enum packet_filter_type - packet filter type
2470  * @WMI_RCV_FILTER_TYPE_INVALID: invalid type
2471  * @WMI_RCV_FILTER_TYPE_FILTER_PKT: filter packet type
2472  * @WMI_RCV_FILTER_TYPE_BUFFER_PKT: buffer packet type
2473  * @WMI_RCV_FILTER_TYPE_MAX_ENUM_SIZE: max enum size
2474  */
2475 enum packet_filter_type {
2476 	WMI_RCV_FILTER_TYPE_INVALID,
2477 	WMI_RCV_FILTER_TYPE_FILTER_PKT,
2478 	WMI_RCV_FILTER_TYPE_BUFFER_PKT,
2479 	WMI_RCV_FILTER_TYPE_MAX_ENUM_SIZE
2480 };
2481 
2482 /**
2483  * enum packet_protocol_type - packet protocol type
2484  * @WMI_FILTER_HDR_TYPE_INVALID: invalid type
2485  * @WMI_FILTER_HDR_TYPE_MAC: mac type
2486  * @WMI_FILTER_HDR_TYPE_ARP: trp type
2487  * @WMI_FILTER_HDR_TYPE_IPV4: ipv4 type
2488  * @WMI_FILTER_HDR_TYPE_IPV6: ipv6 type
2489  * @WMI_FILTER_HDR_TYPE_UDP: udp type
2490  * @WMI_FILTER_HDR_TYPE_MAX: max type
2491  */
2492 enum packet_protocol_type {
2493 	WMI_FILTER_HDR_TYPE_INVALID,
2494 	WMI_FILTER_HDR_TYPE_MAC,
2495 	WMI_FILTER_HDR_TYPE_ARP,
2496 	WMI_FILTER_HDR_TYPE_IPV4,
2497 	WMI_FILTER_HDR_TYPE_IPV6,
2498 	WMI_FILTER_HDR_TYPE_UDP,
2499 	WMI_FILTER_HDR_TYPE_MAX
2500 };
2501 
2502 /**
2503  * enum packet_filter_comp_type - packet filter comparison type
2504  * @WMI_FILTER_CMP_TYPE_INVALID: invalid type
2505  * @WMI_FILTER_CMP_TYPE_EQUAL: type equal
2506  * @WMI_FILTER_CMP_TYPE_MASK_EQUAL: mask equal
2507  * @WMI_FILTER_CMP_TYPE_NOT_EQUAL: type not equal
2508  * @WMI_FILTER_CMP_TYPE_MASK_NOT_EQUAL: mask not equal
2509  * @WMI_FILTER_CMP_TYPE_MAX: max type
2510  */
2511 enum packet_filter_comp_type {
2512 	WMI_FILTER_CMP_TYPE_INVALID,
2513 	WMI_FILTER_CMP_TYPE_EQUAL,
2514 	WMI_FILTER_CMP_TYPE_MASK_EQUAL,
2515 	WMI_FILTER_CMP_TYPE_NOT_EQUAL,
2516 	WMI_FILTER_CMP_TYPE_MASK_NOT_EQUAL,
2517 	WMI_FILTER_CMP_TYPE_MAX
2518 };
2519 
2520 /**
2521  * struct rcv_pkt_filter_params - receive packet filter parameters
2522  * @protocolLayer - protocol layer
2523  * @cmpFlag - comparison flag
2524  * @dataLength - data length
2525  * @dataOffset - data offset
2526  * @reserved - resserved
2527  * @compareData - compare data
2528  * @dataMask - data mask
2529  */
2530 struct rcv_pkt_filter_params {
2531 	enum packet_protocol_type protocolLayer;
2532 	enum packet_filter_comp_type cmpFlag;
2533 	uint16_t dataLength;
2534 	uint8_t dataOffset;
2535 	uint8_t reserved;
2536 	uint8_t compareData[WMI_MAX_FILTER_TEST_DATA_LEN];
2537 	uint8_t dataMask[WMI_MAX_FILTER_TEST_DATA_LEN];
2538 };
2539 
2540 /**
2541  * struct rcv_pkt_filter_config - receive packet filter info
2542  * @filterId - filter id
2543  * @filterType - filter type
2544  * @numFieldParams - no of fields
2545  * @coalesceTime - reserved parameter
2546  * @self_macaddr - self mac address
2547  * @bssid - Bssid of the connected AP
2548  * @paramsData - data parameter
2549  */
2550 struct rcv_pkt_filter_config {
2551 	uint8_t filterId;
2552 	enum packet_filter_type filterType;
2553 	uint32_t numFieldParams;
2554 	uint32_t coalesceTime;
2555 	struct qdf_mac_addr self_macaddr;
2556 	struct qdf_mac_addr bssid;
2557 	struct rcv_pkt_filter_params paramsData[WMI_MAX_NUM_TESTS_PER_FILTER];
2558 };
2559 
2560 /**
2561  * struct cfg_action_frm_tb_ppdu_param - action frm in TB PPDU cfg
2562  * @cfg - enable/disable
2563  * @frm_len - length of the frame
2564  * @data - data pointer
2565  */
2566 struct cfg_action_frm_tb_ppdu_param {
2567 	uint32_t cfg;
2568 	uint32_t frm_len;
2569 	uint8_t *data;
2570 };
2571 
2572 #define WMI_MAX_NUM_FW_SEGMENTS 4
2573 
2574 /**
2575  * struct fw_dump_seg_req_param - individual segment details
2576  * @seg_id - segment id.
2577  * @seg_start_addr_lo - lower address of the segment.
2578  * @seg_start_addr_hi - higher address of the segment.
2579  * @seg_length - length of the segment.
2580  * @dst_addr_lo - lower address of the destination buffer.
2581  * @dst_addr_hi - higher address of the destination buffer.
2582  *
2583  * This structure carries the information to firmware about the
2584  * individual segments. This structure is part of firmware memory
2585  * dump request.
2586  */
2587 struct fw_dump_seg_req_param {
2588 	uint8_t seg_id;
2589 	uint32_t seg_start_addr_lo;
2590 	uint32_t seg_start_addr_hi;
2591 	uint32_t seg_length;
2592 	uint32_t dst_addr_lo;
2593 	uint32_t dst_addr_hi;
2594 };
2595 
2596 /**
2597  * struct fw_dump_req_param - firmware memory dump request details.
2598  * @request_id - request id.
2599  * @num_seg - requested number of segments.
2600  * @fw_dump_seg_req - individual segment information.
2601  *
2602  * This structure carries information about the firmware
2603  * memory dump request.
2604  */
2605 struct fw_dump_req_param {
2606 	uint32_t request_id;
2607 	uint32_t num_seg;
2608 	struct fw_dump_seg_req_param segment[WMI_MAX_NUM_FW_SEGMENTS];
2609 };
2610 
2611 /**
2612  * struct dhcp_offload_info_params - dhcp offload parameters
2613  * @vdev_id: request data length
2614  * @dhcp_offload_enabled: dhcp offload enabled
2615  * @dhcp_client_num: dhcp client no
2616  * @dhcp_srv_addr: dhcp server ip
2617  */
2618 struct dhcp_offload_info_params {
2619 	uint32_t vdev_id;
2620 	bool dhcp_offload_enabled;
2621 	uint32_t dhcp_client_num;
2622 	uint32_t dhcp_srv_addr;
2623 };
2624 
2625 /**
2626  * struct app_type2_params - app type2parameter
2627  * @vdev_id: vdev id
2628  * @rc4_key: rc4 key
2629  * @rc4_key_len: rc4 key length
2630  * @ip_id: NC id
2631  * @ip_device_ip: NC IP address
2632  * @ip_server_ip: Push server IP address
2633  * @tcp_src_port: NC TCP port
2634  * @tcp_dst_port: Push server TCP port
2635  * @tcp_seq: tcp sequence
2636  * @tcp_ack_seq: tcp ack sequence
2637  * @keepalive_init: Initial ping interval
2638  * @keepalive_min: Minimum ping interval
2639  * @keepalive_max: Maximum ping interval
2640  * @keepalive_inc: Increment of ping interval
2641  * @gateway_mac: gateway mac address
2642  * @tcp_tx_timeout_val: tcp tx timeout value
2643  * @tcp_rx_timeout_val: tcp rx timeout value
2644  */
2645 struct app_type2_params {
2646 	uint8_t vdev_id;
2647 	uint8_t rc4_key[16];
2648 	uint32_t rc4_key_len;
2649 	/** ip header parameter */
2650 	uint32_t ip_id;
2651 	uint32_t ip_device_ip;
2652 	uint32_t ip_server_ip;
2653 	/** tcp header parameter */
2654 	uint16_t tcp_src_port;
2655 	uint16_t tcp_dst_port;
2656 	uint32_t tcp_seq;
2657 	uint32_t tcp_ack_seq;
2658 	uint32_t keepalive_init;
2659 	uint32_t keepalive_min;
2660 	uint32_t keepalive_max;
2661 	uint32_t keepalive_inc;
2662 	struct qdf_mac_addr gateway_mac;
2663 	uint32_t tcp_tx_timeout_val;
2664 	uint32_t tcp_rx_timeout_val;
2665 };
2666 
2667 /**
2668  * struct app_type1_params - app type1 parameter
2669  * @vdev_id: vdev id
2670  * @wakee_mac_addr: mac address
2671  * @identification_id: identification id
2672  * @password: password
2673  * @id_length: id length
2674  * @pass_length: password length
2675  */
2676 struct app_type1_params {
2677 	uint8_t vdev_id;
2678 	struct qdf_mac_addr wakee_mac_addr;
2679 	uint8_t identification_id[8];
2680 	uint8_t password[16];
2681 	uint32_t id_length;
2682 	uint32_t pass_length;
2683 };
2684 
2685 /**
2686  * enum wmi_ext_wow_type - wow type
2687  * @WMI_EXT_WOW_TYPE_APP_TYPE1: only enable wakeup for app type1
2688  * @WMI_EXT_WOW_TYPE_APP_TYPE2: only enable wakeup for app type2
2689  * @WMI_EXT_WOW_TYPE_APP_TYPE1_2: enable wakeup for app type1&2
2690  */
2691 enum wmi_ext_wow_type {
2692 	WMI_EXT_WOW_TYPE_APP_TYPE1,
2693 	WMI_EXT_WOW_TYPE_APP_TYPE2,
2694 	WMI_EXT_WOW_TYPE_APP_TYPE1_2,
2695 };
2696 
2697 /**
2698  * struct ext_wow_params - ext wow parameters
2699  * @vdev_id: vdev id
2700  * @type: wow type
2701  * @wakeup_pin_num: wake up gpio no
2702  */
2703 struct ext_wow_params {
2704 	uint8_t vdev_id;
2705 	enum wmi_ext_wow_type type;
2706 	uint32_t wakeup_pin_num;
2707 };
2708 
2709 /**
2710  * struct stats_ext_params - ext stats request
2711  * @vdev_id: vdev id
2712  * @request_data_len: request data length
2713  * @request_data: request data
2714  */
2715 struct stats_ext_params {
2716 	uint32_t vdev_id;
2717 	uint32_t request_data_len;
2718 	uint8_t request_data[];
2719 };
2720 
2721 #define WMI_GTK_OFFLOAD_KEK_BYTES       64
2722 #define WMI_GTK_OFFLOAD_KCK_BYTES       16
2723 #define WMI_GTK_OFFLOAD_ENABLE          0
2724 #define WMI_GTK_OFFLOAD_DISABLE         1
2725 
2726 #define MAX_MEM_CHUNKS 32
2727 /**
2728  * struct wmi_host_mem_chunk - host memory chunk structure
2729  * @vaddr: Pointer to virtual address
2730  * @paddr: Physical address
2731  * @memctx: qdf memory context for mapped address.
2732  * @len: length of chunk
2733  * @req_id: request id from target
2734  */
2735 struct wmi_host_mem_chunk {
2736 	uint32_t *vaddr;
2737 	uint32_t paddr;
2738 	qdf_dma_mem_context(memctx);
2739 	uint32_t len;
2740 	uint32_t req_id;
2741 };
2742 
2743 /**
2744  * struct wmi_wifi_start_log - Structure to store the params sent to start/
2745  * stop logging
2746  * @name:          Attribute which indicates the type of logging like per packet
2747  *                 statistics, connectivity etc.
2748  * @verbose_level: Verbose level which can be 0,1,2,3
2749  * @flag:          Flag field for future use
2750  */
2751 struct wmi_wifi_start_log {
2752 	uint32_t ring_id;
2753 	uint32_t verbose_level;
2754 	uint32_t flag;
2755 };
2756 
2757 /**
2758  * struct wmi_pcl_list - Format of PCL
2759  * @pcl_list: List of preferred channels
2760  * @weight_list: Weights of the PCL
2761  * @pcl_len: Number of channels in the PCL
2762  */
2763 struct wmi_pcl_list {
2764 	uint8_t pcl_list[128];
2765 	uint8_t weight_list[128];
2766 	uint32_t pcl_len;
2767 };
2768 
2769 /**
2770  * struct wmi_hw_mode_params - HW mode params
2771  * @mac0_tx_ss: MAC0 Tx spatial stream
2772  * @mac0_rx_ss: MAC0 Rx spatial stream
2773  * @mac1_tx_ss: MAC1 Tx spatial stream
2774  * @mac1_rx_ss: MAC1 Rx spatial stream
2775  * @mac0_bw: MAC0 bandwidth
2776  * @mac1_bw: MAC1 bandwidth
2777  * @dbs_cap: DBS capabality
2778  * @agile_dfs_cap: Agile DFS capabality
2779  */
2780 struct wmi_hw_mode_params {
2781 	uint8_t mac0_tx_ss;
2782 	uint8_t mac0_rx_ss;
2783 	uint8_t mac1_tx_ss;
2784 	uint8_t mac1_rx_ss;
2785 	uint8_t mac0_bw;
2786 	uint8_t mac1_bw;
2787 	uint8_t dbs_cap;
2788 	uint8_t agile_dfs_cap;
2789 };
2790 
2791 /**
2792  * struct wmi_unit_test_cmd - unit test command parameters
2793  * @vdev_id: vdev id
2794  * @module_id: module id
2795  * @num_args: number of arguments
2796  * @diag_token: dialog token, which identifies the transaction.
2797  *              this number is generated by wifitool and may be used to
2798  *              identify the transaction in the event path
2799  * @args: arguments
2800  */
2801 struct wmi_unit_test_cmd {
2802 	uint32_t vdev_id;
2803 	uint32_t module_id;
2804 	uint32_t num_args;
2805 	uint32_t diag_token;
2806 	uint32_t args[WMI_UNIT_TEST_MAX_NUM_ARGS];
2807 };
2808 
2809 /**
2810  * struct extscan_bssid_hotlist_set_params - set hotlist request
2811  * @request_id: request_id
2812  * @vdev_id: vdev id
2813  * @lost_ap_sample_size: number of samples to confirm AP loss
2814  * @num_ap: Number of hotlist APs
2815  * @ap: hotlist APs
2816  */
2817 struct extscan_bssid_hotlist_set_params {
2818 	uint32_t  request_id;
2819 	uint8_t   vdev_id;
2820 	uint32_t  lost_ap_sample_size;
2821 	uint32_t  num_ap;
2822 	struct ap_threshold_params ap[WMI_WLAN_EXTSCAN_MAX_HOTLIST_APS];
2823 };
2824 
2825 /**
2826  * struct host_mem_req - Host memory request paramseters request by target
2827  * @req_id: Request id to identify the request.
2828  * @unit_size: Size of single unit requested.
2829  * @num_unit_info: Memory chunk info
2830  * @num_units: number of units requested.
2831  */
2832 typedef struct {
2833 	uint32_t	req_id;
2834 	uint32_t	unit_size;
2835 	uint32_t	num_unit_info;
2836 	uint32_t	num_units;
2837 } host_mem_req;
2838 
2839 #define WMI_HOST_DSCP_MAP_MAX	(64)
2840 
2841 /**
2842  * struct wmi_host_ext_resource_config - Extended resource config
2843  * @host_platform_config: Host plaform configuration.
2844  * @fw_featuew_bitmap: FW feature requested bitmap.
2845  */
2846 typedef struct {
2847 	uint32_t host_platform_config;
2848 
2849 #define WMI_HOST_FW_FEATURE_LTEU_SUPPORT	           0x0001
2850 #define WMI_HOST_FW_FEATURE_COEX_GPIO_SUPPORT	       0x0002
2851 #define WMI_HOST_FW_FEATURE_AUX_RADIO_SPECTRAL_INTF	   0x0004
2852 #define WMI_HOST_FW_FEATURE_AUX_RADIO_CHAN_LOAD_INTF   0x0008
2853 #define WMI_HOST_FW_FEATURE_BSS_CHANNEL_INFO_64	       0x0010
2854 #define WMI_HOST_FW_FEATURE_PEER_STATS                 0x0020
2855 #define WMI_HOST_FW_FEATURE_VDEV_STATS                 0x0040
2856 #define WMI_HOST_FW_FEATURE_VOW_FEATURES               0x00004000
2857 #define WMI_HOST_FW_FEATURE_VOW_STATS                  0x00008000
2858 	/**
2859 	* @brief fw_feature_bitmask - Enable/Disable features in FW
2860 	* @details
2861 	*  The bits in fw_feature_bitmask are used as shown by the masks below:
2862 	*	0x0001 - LTEU Config enable/disable
2863 	*	0x0002 - COEX GPIO Config enable/disable
2864 	*	0x0004 - Aux Radio enhancement for spectral scan enable/disable
2865 	*	0x0008 - Aux Radio enhancement for chan load scan enable/disable
2866 	*	0x0010 - BSS channel info stats enable/disable
2867 	* The features in question are enabled by setting
2868 	* the feature's bit to 1,
2869 	*  or disabled by setting the feature's bit to 0.
2870 	*/
2871 	uint32_t fw_feature_bitmap;
2872 
2873 	/* WLAN priority GPIO number
2874 	 * The target uses a GPIO pin to indicate when it is transmitting
2875 	 * high-priority traffic (e.g. beacon, management, or AC_VI) or
2876 	 * low-priority traffic (e.g. AC_BE, AC_BK).  The HW uses this
2877 	 * WLAN GPIO pin to determine whether to abort WLAN tx in favor of
2878 	 * BT activity.
2879 	 * Which GPIO is used for this WLAN tx traffic priority specification
2880 	 * varies between platforms, so the host needs to indicate to the
2881 	 * target which GPIO to use.
2882 	 */
2883 	uint32_t wlan_priority_gpio;
2884 
2885 	/* Host will notify target which coex algorithm has to be
2886 	 * enabled based on HW, FW capability and device tree config.
2887 	 * Till now the coex algorithms were target specific. Now the
2888 	 * same target can choose between multiple coex algorithms
2889 	 * depending on device tree config on host. For backward
2890 	 * compatibility, version support will have option 0 and will
2891 	 * rely on FW compile time flags to decide the coex version
2892 	 * between VERSION_1, VERSION_2 and VERSION_3. Version info is
2893 	 * mandatory from VERSION_4 onwards for any new coex algorithms.
2894 	 *
2895 	 * 0 = no version support
2896 	 * 1 = COEX_VERSION_1 (3 wire coex)
2897 	 * 2 = COEX_VERSION_2 (2.5 wire coex)
2898 	 * 3 = COEX_VERSION_3 (2.5 wire coex+duty cycle)
2899 	 * 4 = COEX_VERSION_4 (4 wire coex)
2900 	 */
2901 	uint32_t coex_version;
2902 
2903 	/* There are multiple coex implementations on FW to support different
2904 	 * hardwares. Since the coex algos are mutually exclusive, host will
2905 	 * use below fields to send GPIO info to FW and these GPIO pins will
2906 	 * have different usages depending on the feature enabled. This is to
2907 	 * avoid adding multiple GPIO fields here for different features.
2908 	 *
2909 	 * COEX VERSION_4 (4 wire coex) :
2910 	 * 4 wire coex feature uses 1 common input request line from BT/ZB/
2911 	 * Thread which interrupts the WLAN target processor directly, 1 input
2912 	 * priority line from BT and ZB each, 1 output line to grant access to
2913 	 * requesting IOT subsystem. WLAN uses the input priority line to
2914 	 * identify the requesting IOT subsystem. Request is granted based on
2915 	 * IOT interface priority and WLAN traffic. GPIO pin usage is as below:
2916 	 * coex_gpio_pin_1 = BT PRIORITY INPUT GPIO
2917 	 * coex_gpio_pin_2 = ZIGBEE PRIORITY INPUT GPIO
2918 	 * coex_gpio_pin_3 = GRANT OUTPUT GPIO
2919 	 * when a BT active interrupt is raised, WLAN reads
2920 	 * BT and ZB priority input GPIO pins to compare against the coex
2921 	 * priority table and accordingly sets the grant output GPIO to give
2922 	 * access to requesting IOT subsystem.
2923 	 */
2924 	uint32_t coex_gpio_pin_1;
2925 	uint32_t coex_gpio_pin_2;
2926 	uint32_t coex_gpio_pin_3;
2927 
2928 	/* add new members here */
2929 } wmi_host_ext_resource_config;
2930 
2931 /**
2932  * struct set_neighbour_rx_params - Neighbour RX params
2933  * @vdev_id: vdev id
2934  * @idx: index of param
2935  * @action: action
2936  * @type: Type of param
2937  */
2938 struct set_neighbour_rx_params {
2939 	uint8_t vdev_id;
2940 	uint32_t idx;
2941 	uint32_t action;
2942 	uint32_t type;
2943 };
2944 
2945 /**
2946  * struct set_fwtest_params - FW test params
2947  * @arg: FW param id
2948  * @value: value
2949  */
2950 struct set_fwtest_params {
2951 	uint32_t arg;
2952 	uint32_t value;
2953 };
2954 
2955 /**
2956  * struct set_custom_aggr_size_params - custom aggr size params
2957  * @vdev_id      : vdev id
2958  * @tx_aggr_size : TX aggr size
2959  * @rx_aggr_size : RX aggr size
2960  * @enable_bitmap: Bitmap for aggr size check
2961  */
2962 struct set_custom_aggr_size_params {
2963 	uint32_t  vdev_id;
2964 	uint32_t tx_aggr_size;
2965 	uint32_t rx_aggr_size;
2966 	uint32_t ac:2,
2967 		 aggr_type:1,
2968 		 tx_aggr_size_disable:1,
2969 		 rx_aggr_size_disable:1,
2970 		 tx_ac_enable:1,
2971 		 reserved:26;
2972 };
2973 
2974 /**
2975  * enum wmi_host_custom_aggr_type_t: custon aggregate type
2976  * @WMI_HOST_CUSTOM_AGGR_TYPE_AMPDU: A-MPDU aggregation
2977  * @WMI_HOST_CUSTOM_AGGR_TYPE_AMSDU: A-MSDU aggregation
2978  * @WMI_HOST_CUSTOM_AGGR_TYPE_MAX: Max type
2979  */
2980 enum wmi_host_custom_aggr_type_t {
2981 	WMI_HOST_CUSTOM_AGGR_TYPE_AMPDU = 0,
2982 	WMI_HOST_CUSTOM_AGGR_TYPE_AMSDU = 1,
2983 	WMI_HOST_CUSTOM_AGGR_TYPE_MAX,
2984 };
2985 
2986 /*
2987  * msduq_update_params - MSDUQ update param structure
2988  * @tid_num: TID number
2989  * @msduq_update_mask: update bit mask
2990  * @qdepth_thresh_value: threshold value for the queue depth
2991  */
2992 
2993 #define QDEPTH_THRESH_MAX_UPDATES 1
2994 
2995 typedef struct {
2996 	uint32_t tid_num;
2997 	uint32_t msduq_update_mask;
2998 	uint32_t qdepth_thresh_value;
2999 } msduq_update_params;
3000 
3001 /**
3002  * struct set_qdepth_thresh_params - MSDU Queue Depth Threshold Params
3003  * @vdev_id: vdev id
3004  * @pdev_id: pdev id
3005  * @mac_addr: MAC address
3006  * @num_of_msduq_updates: holds the number of tid updates
3007  */
3008 
3009 struct set_qdepth_thresh_params {
3010 	uint32_t pdev_id;
3011 	uint32_t vdev_id;
3012 	uint8_t mac_addr[IEEE80211_ADDR_LEN];
3013 	uint32_t num_of_msduq_updates;
3014 	msduq_update_params update_params[QDEPTH_THRESH_MAX_UPDATES];
3015 };
3016 
3017 /**
3018  * struct peer_chan_width_switch_info - Peer channel width capability params
3019  * @mac_addr: MAC address of peer
3020  * @chan_width: Max supported channel width of peer
3021  *              (enum ieee80211_cwm_width)
3022  */
3023 
3024 struct peer_chan_width_switch_info {
3025 	uint8_t mac_addr[IEEE80211_ADDR_LEN];
3026 	uint32_t chan_width;
3027 };
3028 
3029 /**
3030  * struct peer_chan_width_switch_params - Peer channel width capability wrapper
3031  * @num_peers: Total number of peers connected to AP
3032  * @chan_width_peer_list: List of capabilities for all connected peers
3033  */
3034 
3035 struct peer_chan_width_switch_params {
3036 	uint32_t num_peers;
3037 	struct peer_chan_width_switch_info *chan_width_peer_list;
3038 };
3039 
3040 /**
3041  * struct config_ratemask_params - ratemask config parameters
3042  * @vdev_id: vdev id
3043  * @type: Type
3044  * @lower32: Lower 32 bits in the 1st 64-bit value
3045  * @higher32: Higher 32 bits in the 1st 64-bit value
3046  * @lower32_2: Lower 32 bits in the 2nd 64-bit value
3047  */
3048 struct config_ratemask_params {
3049 	uint8_t vdev_id;
3050 	uint8_t type;
3051 	uint32_t lower32;
3052 	uint32_t higher32;
3053 	uint32_t lower32_2;
3054 };
3055 
3056 /**
3057  * struct config_fils_params - FILS config params
3058  * @vdev_id:  vdev id
3059  * @fd_period:  0 - Disabled, non-zero - Period in ms (mili seconds)
3060  */
3061 struct config_fils_params {
3062 	uint8_t vdev_id;
3063 	uint32_t fd_period;
3064 };
3065 
3066 /**
3067  * struct peer_add_wds_entry_params - WDS peer entry add params
3068  * @dest_addr: Pointer to destination macaddr
3069  * @peer_addr: Pointer to peer mac addr
3070  * @flags: flags
3071  * @vdev_id: Vdev id
3072  */
3073 struct peer_add_wds_entry_params {
3074 	const uint8_t *dest_addr;
3075 	uint8_t *peer_addr;
3076 	uint32_t flags;
3077 	uint32_t vdev_id;
3078 };
3079 
3080 /**
3081  * struct peer_del_wds_entry_params - WDS peer entry del params
3082  * @dest_addr: Pointer to destination macaddr
3083  * @vdev_id: Vdev id
3084  */
3085 struct peer_del_wds_entry_params {
3086 	uint8_t *dest_addr;
3087 	uint32_t vdev_id;
3088 };
3089 
3090 /**
3091  * struct set_bridge_mac_addr_params - set bridge MAC addr params
3092  * @dest_addr: Pointer to bridge macaddr
3093  */
3094 struct set_bridge_mac_addr_params {
3095 	uint8_t *bridge_addr;
3096 };
3097 
3098 /**
3099  * struct peer_updatewds_entry_params - WDS peer entry update params
3100  * @wds_macaddr: Pointer to destination macaddr
3101  * @peer_add: Pointer to peer mac addr
3102  * @flags: flags
3103  * @vdev_id: Vdev id
3104  */
3105 struct peer_update_wds_entry_params {
3106 	uint8_t *wds_macaddr;
3107 	uint8_t *peer_macaddr;
3108 	uint32_t flags;
3109 	uint32_t vdev_id;
3110 };
3111 
3112 /**
3113  * struct peer_del_all_wds_entries_params - WDS peer entries del params
3114  * @wds_macaddr: Pointer to destination macaddr
3115  * @peer_macaddr: Pointer to peer mac addr
3116  * @flags: flags
3117  */
3118 struct peer_del_all_wds_entries_params {
3119 	uint8_t *wds_macaddr;
3120 	uint8_t *peer_macaddr;
3121 	uint32_t flags;
3122 };
3123 
3124 /**
3125  * struct set_ps_mode_params - PS mode params
3126  * @vdev_id: vdev id
3127  * @psmode: PS mode
3128  */
3129 struct set_ps_mode_params {
3130 	uint8_t vdev_id;
3131 	uint8_t psmode;
3132 };
3133 
3134 /**
3135  * @struct tt_level_config - Set Thermal throttlling config
3136  * @tmplwm: Temperature low water mark
3137  * @tmphwm: Temperature high water mark
3138  * @dcoffpercent: dc off percentage
3139  * @priority: priority
3140  */
3141 typedef struct {
3142 	uint32_t tmplwm;
3143 	uint32_t tmphwm;
3144 	uint32_t dcoffpercent;
3145 	uint32_t priority;
3146 } tt_level_config;
3147 
3148 /**
3149  * struct thermal_mitigation_params - Thermal mitigation params
3150  * @enable: Enable/Disable Thermal mitigation
3151  * @dc: DC
3152  * @dc_per_event: DC per event
3153  * @tt_level_config: TT level config params
3154  */
3155 struct thermal_mitigation_params {
3156 	uint32_t pdev_id;
3157 	uint32_t enable;
3158 	uint32_t dc;
3159 	uint32_t dc_per_event;
3160 	tt_level_config levelconf[THERMAL_LEVELS];
3161 };
3162 
3163 /**
3164  * struct smart_ant_enable_tx_feedback_params - SA tx feeback params
3165  * @enable: Enable TX feedback for SA
3166  */
3167 struct smart_ant_enable_tx_feedback_params {
3168 	int enable;
3169 };
3170 
3171 /**
3172  * struct vdev_spectral_configure_params - SPectral config params
3173  * @vdev_id: VDEV id
3174  * @count: count
3175  * @period: period
3176  * @spectral_pri: Spectral priority
3177  * @fft_size: FFT size
3178  * @gc_enable: GC enable
3179  * @restart_enable: restart enabled
3180  * @noise_floor_ref: Noise floor reference
3181  * @init_delay: Init delays
3182  * @nb_tone_thr: NB tone threshold
3183  * @str_bin_thr: STR BIN threshold
3184  * @wb_rpt_mode: WB BIN threshold
3185  * @rssi_rpt_mode: RSSI report mode
3186  * @rssi_thr: RSSI threshold
3187  * @pwr_format: Power format
3188  * @rpt_mode: Report mdoe
3189  * @bin_scale: BIN scale
3190  * @dbm_adj: DBM adjust
3191  * @chn_mask: chain mask
3192  */
3193 struct vdev_spectral_configure_params {
3194 	uint8_t vdev_id;
3195 	uint16_t count;
3196 	uint16_t period;
3197 	uint16_t spectral_pri;
3198 	uint16_t fft_size;
3199 	uint16_t gc_enable;
3200 	uint16_t restart_enable;
3201 	uint16_t noise_floor_ref;
3202 	uint16_t init_delay;
3203 	uint16_t nb_tone_thr;
3204 	uint16_t str_bin_thr;
3205 	uint16_t wb_rpt_mode;
3206 	uint16_t rssi_rpt_mode;
3207 	uint16_t rssi_thr;
3208 	uint16_t pwr_format;
3209 	uint16_t rpt_mode;
3210 	uint16_t bin_scale;
3211 	uint16_t dbm_adj;
3212 	uint16_t chn_mask;
3213 };
3214 
3215 /**
3216  * struct vdev_spectral_enable_params - Spectral enabled params
3217  * @vdev_id: VDEV id
3218  * @active_valid: Active valid
3219  * @active: active
3220  * @enabled_valid: Enabled valid
3221  * @enabled: enabled
3222  */
3223 struct vdev_spectral_enable_params {
3224 	uint8_t vdev_id;
3225 	uint8_t active_valid;
3226 	uint8_t active;
3227 	uint8_t enabled_valid;
3228 	uint8_t enabled;
3229 };
3230 
3231 /**
3232  * struct pdev_set_regdomain_params - PDEV set reg domain params
3233  * @currentRDinuse: Current Reg domain
3234  * @currentRD2G: Current Reg domain 2G
3235  * @currentRD5G: Current Reg domain 5G
3236  * @ctl_2G: CTL 2G
3237  * @ctl_5G: CTL 5G
3238  * @dfsDomain: DFS domain
3239  * @pdev_id: pdev_id
3240  */
3241 struct pdev_set_regdomain_params {
3242 	uint16_t currentRDinuse;
3243 	uint16_t currentRD2G;
3244 	uint16_t currentRD5G;
3245 	uint32_t ctl_2G;
3246 	uint32_t ctl_5G;
3247 	uint8_t dfsDomain;
3248 	uint32_t pdev_id;
3249 };
3250 
3251 /**
3252  * struct set_quiet_mode_params - Set quiet mode params
3253  * @enabled: Enabled
3254  * @period: Quite period
3255  * @intval: Quite interval
3256  * @duration: Quite duration
3257  * @offset: offset
3258  */
3259 struct set_quiet_mode_params {
3260 	uint8_t enabled;
3261 	uint8_t period;
3262 	uint16_t intval;
3263 	uint16_t duration;
3264 	uint16_t offset;
3265 };
3266 
3267 /**
3268  * struct set_bcn_offload_quiet_mode_params - Set quiet mode params
3269  * @vdev_id: Vdev ID
3270  * @period: Quite period
3271  * @duration: Quite duration
3272  * @next_start: Next quiet start
3273  * @flag: 0 - disable, 1 - enable and continuous, 3 - enable and single shot
3274  */
3275 struct set_bcn_offload_quiet_mode_params {
3276 	uint32_t vdev_id;
3277 	uint32_t period;
3278 	uint32_t duration;
3279 	uint32_t next_start;
3280 	uint32_t flag;
3281 };
3282 
3283 /**
3284  * struct set_beacon_filter_params - Set beacon filter params
3285  * @vdev_id: VDEV id
3286  * @ie: Pointer to IE fields
3287  */
3288 struct set_beacon_filter_params {
3289 	uint8_t vdev_id;
3290 	uint32_t *ie;
3291 };
3292 
3293 /**
3294  * struct remove_beacon_filter_params - Remove beacon filter params
3295  * @vdev_id: VDEV id
3296  */
3297 struct remove_beacon_filter_params {
3298 	uint8_t vdev_id;
3299 };
3300 
3301 /**
3302  * struct mgmt_params - Mgmt params
3303  * @vdev_id: vdev id
3304  * @buf_len: length of frame buffer
3305  * @wbuf: frame buffer
3306  */
3307 struct mgmt_params {
3308 	int vdev_id;
3309 	uint32_t buf_len;
3310 	qdf_nbuf_t wbuf;
3311 };
3312 
3313 /**
3314  * struct addba_clearresponse_params - Addba clear response params
3315  * @vdev_id: VDEV id
3316  */
3317 struct addba_clearresponse_params {
3318 	uint8_t vdev_id;
3319 };
3320 
3321 /**
3322  * struct addba_send_params - ADDBA send params
3323  * @vdev_id: vdev id
3324  * @tidno: TID
3325  * @buffersize: buffer size
3326  */
3327 struct addba_send_params {
3328 	uint8_t vdev_id;
3329 	uint8_t tidno;
3330 	uint16_t buffersize;
3331 };
3332 
3333 /**
3334  * struct delba_send_params - DELBA send params
3335  * @vdev_id: vdev id
3336  * @tidno: TID
3337  * @initiator: initiator
3338  * @reasoncode: reason code
3339  */
3340 struct delba_send_params {
3341 	uint8_t vdev_id;
3342 	uint8_t tidno;
3343 	uint8_t initiator;
3344 	uint16_t reasoncode;
3345 };
3346 /**
3347  * struct addba_setresponse_arams - Set ADDBA response params
3348  * @vdev_id: vdev id
3349  * @tidno: TID
3350  * @statuscode: status code in response
3351  */
3352 struct addba_setresponse_params {
3353 	uint8_t vdev_id;
3354 	uint8_t tidno;
3355 	uint16_t statuscode;
3356 };
3357 
3358 /**
3359  * struct singleamsdu_params - Single AMSDU params
3360  * @vdev_id: vdev is
3361  * @tidno: TID
3362  */
3363 struct singleamsdu_params {
3364 	uint8_t vdev_id;
3365 	uint8_t tidno;
3366 };
3367 
3368 /**
3369  * struct set_qbosst_params - Set QBOOST params
3370  * @vdev_id: vdev id
3371  * @value: value
3372  */
3373 struct set_qboost_params {
3374 	uint8_t vdev_id;
3375 	uint32_t value;
3376 };
3377 
3378 /**
3379  * struct mu_scan_params - MU scan params
3380  * @id: id
3381  * @type: type
3382  * @duration: Duration
3383  * @lteu_tx_power: LTEU tx power
3384  */
3385 struct mu_scan_params {
3386 	uint8_t id;
3387 	uint8_t type;
3388 	uint32_t duration;
3389 	uint32_t lteu_tx_power;
3390 	uint32_t rssi_thr_bssid;
3391 	uint32_t rssi_thr_sta;
3392 	uint32_t rssi_thr_sc;
3393 	uint32_t plmn_id;
3394 	uint32_t alpha_num_bssid;
3395 };
3396 
3397 /**
3398  * struct lteu_config_params - LTEU config params
3399  * @lteu_gpio_start: start MU/AP scan after GPIO toggle
3400  * @lteu_num_bins: no. of elements in the following arrays
3401  * @use_actual_nf: whether to use the actual NF obtained or a hardcoded one
3402  * @lteu_weight: weights for MU algo
3403  * @lteu_thresh: thresholds for MU algo
3404  * @lteu_gamma:  gamma's for MU algo
3405  * @lteu_scan_timeout: timeout in ms to gpio toggle
3406  * @alpha_num_ssid: alpha for num active bssid calculation
3407  * @wifi_tx_power: Wifi Tx power
3408  */
3409 struct lteu_config_params {
3410 	uint8_t lteu_gpio_start;
3411 	uint8_t lteu_num_bins;
3412 	uint8_t use_actual_nf;
3413 	uint32_t lteu_weight[LTEU_MAX_BINS];
3414 	uint32_t lteu_thresh[LTEU_MAX_BINS];
3415 	uint32_t lteu_gamma[LTEU_MAX_BINS];
3416 	uint32_t lteu_scan_timeout;
3417 	uint32_t alpha_num_bssid;
3418 	uint32_t wifi_tx_power;
3419 	uint32_t allow_err_packets;
3420 };
3421 
3422 struct wmi_macaddr_t {
3423 	/** upper 4 bytes of  MAC address */
3424 	uint32_t mac_addr31to0;
3425 	/** lower 2 bytes of  MAC address */
3426 	uint32_t mac_addr47to32;
3427 };
3428 
3429 /**
3430  * struct wlan_profile_params - WLAN profile params
3431  * @param_id: param id
3432  * @profile_id: profile id
3433  * @enable: enable
3434  */
3435 struct wlan_profile_params {
3436 	uint32_t param_id;
3437 	uint32_t profile_id;
3438 	uint32_t enable;
3439 };
3440 
3441 /* struct ht_ie_params - HT IE params
3442  * @ie_len: IE length
3443  * @ie_data: pointer to IE data
3444  * @tx_streams: Tx streams supported for this HT IE
3445  * @rx_streams: Rx streams supported for this HT IE
3446  */
3447 struct ht_ie_params {
3448 	uint32_t ie_len;
3449 	uint8_t *ie_data;
3450 	uint32_t tx_streams;
3451 	uint32_t rx_streams;
3452 };
3453 
3454 /* struct vht_ie_params - VHT IE params
3455  * @ie_len: IE length
3456  * @ie_data: pointer to IE data
3457  * @tx_streams: Tx streams supported for this VHT IE
3458  * @rx_streams: Rx streams supported for this VHT IE
3459  */
3460 struct vht_ie_params {
3461 	uint32_t ie_len;
3462 	uint8_t *ie_data;
3463 	uint32_t tx_streams;
3464 	uint32_t rx_streams;
3465 };
3466 
3467 /**
3468  * struct wmi_host_wmeParams - WME params
3469  * @wmep_acm: ACM paramete
3470  * @wmep_aifsn:	AIFSN parameters
3471  * @wmep_logcwmin: cwmin in exponential form
3472  * @wmep_logcwmax: cwmax in exponential form
3473  * @wmep_txopLimit: txopLimit
3474  * @wmep_noackPolicy: No-Ack Policy: 0=ack, 1=no-ack
3475  */
3476 struct wmi_host_wmeParams {
3477 	u_int8_t	wmep_acm;
3478 	u_int8_t	wmep_aifsn;
3479 	u_int8_t	wmep_logcwmin;
3480 	u_int8_t	wmep_logcwmax;
3481 	u_int16_t   wmep_txopLimit;
3482 	u_int8_t	wmep_noackPolicy;
3483 };
3484 
3485 /**
3486  * struct wmm_update_params - WMM update params
3487  * @wmep_array: WME params for each AC
3488  */
3489 struct wmm_update_params {
3490 	struct wmi_host_wmeParams *wmep_array;
3491 };
3492 
3493 /**
3494  * struct wmi_host_wmevParams - WME params
3495  * @wmep_acm: ACM paramete
3496  * @wmep_aifsn:	AIFSN parameters
3497  * @wmep_logcwmin: cwmin in exponential form
3498  * @wmep_logcwmax: cwmax in exponential form
3499  * @wmep_txopLimit: txopLimit
3500  * @wmep_noackPolicy: No-Ack Policy: 0=ack, 1=no-ack
3501  */
3502 struct wmi_host_wme_vparams {
3503 	u_int32_t	acm;
3504 	u_int32_t	aifs;
3505 	u_int32_t	cwmin;
3506 	u_int32_t	cwmax;
3507 	union {
3508 		u_int32_t txoplimit;
3509 		u_int32_t mu_edca_timer;
3510 	};
3511 	u_int32_t	noackpolicy;
3512 };
3513 
3514 /**
3515  * struct ratepwr_table_params - Rate power table params
3516  * @ratepwr_tbl: pointer to rate power table
3517  * @ratepwr_len: rate power table len
3518  */
3519 struct ratepwr_table_params {
3520 	uint8_t *ratepwr_tbl;
3521 	uint16_t ratepwr_len;
3522 };
3523 
3524 /**
3525  * struct ctl_table_params - Ctl table params
3526  * @ctl_array: pointer to ctl array
3527  * @ctl_cmd_len: ctl command length
3528  * @is_acfg_ctl: is acfg_ctl table
3529  */
3530 struct ctl_table_params {
3531 	uint8_t *ctl_array;
3532 	uint16_t ctl_cmd_len;
3533 	uint32_t target_type;
3534 	bool is_2g;
3535 	uint32_t ctl_band;
3536 	uint32_t pdev_id;
3537 };
3538 
3539 /**
3540  * struct mimogain_table_params - MIMO gain table params
3541  * @array_gain: pointer to array gain table
3542  * @tbl_len: table length
3543  * @multichain_gain_bypass: bypass multichain gain
3544  */
3545 struct mimogain_table_params {
3546 	uint8_t *array_gain;
3547 	uint16_t tbl_len;
3548 	bool multichain_gain_bypass;
3549 	uint32_t pdev_id;
3550 };
3551 
3552 /**
3553  * struct ratepwr_chainmask_params - Rate power chainmask params
3554  * @ratepwr_chain_tbl: pointer to ratepwr chain table
3555  * @num_rate: number of rate in table
3556  * @pream_type: preamble type
3557  * @ops: ops
3558  */
3559 struct ratepwr_chainmsk_params {
3560 	uint32_t *ratepwr_chain_tbl;
3561 	uint16_t num_rate;
3562 	uint8_t pream_type;
3563 	uint8_t ops;
3564 };
3565 
3566 struct macaddr_params {
3567 	uint8_t *macaddr;
3568 };
3569 
3570 /**
3571  * struct acparams_params - acparams config structure
3572  * @ac: AC to configure
3573  * @use_rts: Use rts for this AC
3574  * @aggrsize_scaling: Aggregrate size scaling for the AC
3575  * @min_kbps: min kbps req
3576  */
3577 struct acparams_params {
3578 	uint8_t ac;
3579 	uint8_t use_rts;
3580 	uint8_t aggrsize_scaling;
3581 	uint32_t min_kbps;
3582 };
3583 
3584 /**
3585  * struct vap_dscp_tid_map_params - DSCP tid map params
3586  * @vdev_id: vdev id
3587  * @dscp_to_tid_map: pointer to arry of tid to dscp map table
3588  */
3589 struct vap_dscp_tid_map_params {
3590 	uint8_t vdev_id;
3591 	uint32_t *dscp_to_tid_map;
3592 };
3593 
3594 /**
3595  * struct proxy_ast_reserve_params - Proxy AST reserve params
3596  * @macaddr: macaddr for proxy ast entry
3597  */
3598 struct proxy_ast_reserve_params {
3599 	uint8_t *macaddr;
3600 };
3601 
3602 /**
3603  * struct fips_params - FIPS params config
3604  * @key: pointer to key
3605  * @key_len: length of key
3606  * @data: pointer data buf
3607  * @data_len: length of data buf
3608  * @mode: mode
3609  * @op: operation
3610  * @pdev_id: pdev_id for identifying the MAC
3611  */
3612 struct fips_params {
3613 	uint8_t *key;
3614 	uint32_t key_len;
3615 	uint8_t *data;
3616 	uint32_t data_len;
3617 	uint32_t mode;
3618 	uint32_t op;
3619 	uint32_t pdev_id;
3620 };
3621 
3622 /**
3623  * struct mcast_group_update_param - Mcast group table update to target
3624  * @action: Addition/deletion
3625  * @wildcard: iwldcard table entry?
3626  * @mcast_ip_addr: mcast ip address to be updated
3627  * @mcast_ip_addr_bytes: mcast ip addr bytes
3628  * @ucast_mac_addr: ucast peer mac subscribed to mcast ip
3629  * @filter_mode: filter mode
3630  * @nsrcs: number of entries in source list
3631  * @srcs: source mac accpted
3632  * @mask: mask
3633  * @vap_id: vdev id
3634  * @is_action_delete: is delete
3635  * @is_filter_mode_snoop:
3636  * @is_mcast_addr_len:
3637  */
3638 struct mcast_group_update_params {
3639 	int action;
3640 	int wildcard;
3641 	uint8_t *mcast_ip_addr;
3642 	int mcast_ip_addr_bytes;
3643 	uint8_t *ucast_mac_addr;
3644 	uint8_t filter_mode;
3645 	uint8_t nsrcs;
3646 	uint8_t *srcs;
3647 	uint8_t *mask;
3648 	uint8_t vap_id;
3649 	bool is_action_delete;
3650 	bool is_filter_mode_snoop;
3651 	bool is_mcast_addr_len;
3652 };
3653 
3654 /**
3655  * struct periodic_chan_stats_param - periodic channel stats req param
3656  * @stats_period: stats period update
3657  * @enable: enable/disable
3658  */
3659 struct periodic_chan_stats_params {
3660 	uint32_t stats_period;
3661 	bool enable;
3662 	uint32_t pdev_id;
3663 };
3664 
3665 /**
3666  * enum wmi_host_packet_power_rate_flags: packer power rate flags
3667  * @WMI_HOST_FLAG_RTSENA: RTS enabled
3668  * @WMI_HOST_FLAG_CTSENA: CTS enabled
3669  * @WMI_HOST_FLAG_STBC: STBC is set
3670  * @WMI_HOST_FLAG_LDPC: LDPC is set
3671  * @WMI_HOST_FLAG_TXBF: Tx Bf enabled
3672  * @WMI_HOST_FLAG_MU2: MU2 data
3673  * @WMI_HOST_FLAG_MU3: MU3 data
3674  * @WMI_HOST_FLAG_SERIES1: Rate series 1
3675  * @WMI_HOST_FLAG_SGI: Short gaurd interval
3676  */
3677 enum wmi_host_packet_power_rate_flags {
3678 	WMI_HOST_FLAG_RTSENA        =  0x0001,
3679 	WMI_HOST_FLAG_CTSENA        =  0x0002,
3680 	WMI_HOST_FLAG_STBC          =  0x0004,
3681 	WMI_HOST_FLAG_LDPC          =  0x0008,
3682 	WMI_HOST_FLAG_TXBF          =  0x0010,
3683 	WMI_HOST_FLAG_MU2           =  0x0020,
3684 	WMI_HOST_FLAG_MU3           =  0x0040,
3685 	WMI_HOST_FLAG_SERIES1       =  0x0080,
3686 	WMI_HOST_FLAG_SGI           =  0x0100,
3687 };
3688 
3689 /**
3690  * enum wmi_host_su_mu_ofdma_flags: packer power su mu ofdma flags
3691  * @WMI_HOST_FLAG_SU: SU Data
3692  * @WMI_HOST_FLAG_DL_MU_MIMO_AC: DL AC MU data
3693  * @WMI_HOST_FLAG_DL_MU_MIMO_AX: DL AX MU data
3694  * @WMI_HOST_FLAG_DL_OFDMA: DL OFDMA data
3695  * @WMI_HOST_FLAG_UL_OFDMA: UL OFDMA data
3696  * @WMI_HOST_FLAG_UL_MU_MIMO: UL MU data
3697  */
3698 enum wmi_host_su_mu_ofdma_flags {
3699 	WMI_HOST_FLAG_SU            =  0x0001,
3700 	WMI_HOST_FLAG_DL_MU_MIMO_AC =  0x0002,
3701 	WMI_HOST_FLAG_DL_MU_MIMO_AX =  0x0003,
3702 	WMI_HOST_FLAG_DL_OFDMA      =  0x0004,
3703 	WMI_HOST_FLAG_UL_OFDMA      =  0x0005,
3704 	WMI_HOST_FLAG_UL_MU_MIMO    =  0x0006,
3705 };
3706 
3707 /**
3708  * enum wmi_host_preamble_type: preamble type
3709  * @WMI_HOST_PREAMBLE_OFDM: ofdm rate
3710  * @WMI_HOST_PREAMBLE_CCK:  cck rate
3711  * @WMI_HOST_PREAMBLE_HT: ht rate
3712  * @WMI_HOST_PREAMBLE_VHT: vht rate
3713  * @WMI_HOST_PREAMBLE_HE: 11ax he rate
3714  */
3715 enum wmi_host_preamble_type {
3716 	WMI_HOST_PREAMBLE_OFDM  =  0,
3717 	WMI_HOST_PREAMBLE_CCK   =  1,
3718 	WMI_HOST_PREAMBLE_HT    =  2,
3719 	WMI_HOST_PREAMBLE_VHT   =  3,
3720 	WMI_HOST_PREAMBLE_HE    =  4,
3721 };
3722 
3723 /**
3724  * struct packet_power_info_params - packet power info params
3725  * @chainmask: chain mask
3726  * @chan_width: channel bandwidth
3727  * @rate_flags: rate flags
3728  * @su_mu_ofdma: su/mu/ofdma flags
3729  * @nss: number of spatial streams
3730  * @preamble: preamble
3731  * @hw_rate:
3732  */
3733 struct packet_power_info_params {
3734 	uint16_t chainmask;
3735 	uint16_t chan_width;
3736 	uint16_t rate_flags;
3737 	uint16_t su_mu_ofdma;
3738 	uint16_t nss;
3739 	uint16_t preamble;
3740 	uint16_t hw_rate;
3741 	uint32_t pdev_id;
3742 };
3743 
3744 /**
3745  * WMI_GPIO_CONFIG_CMDID
3746  */
3747 enum {
3748 	WMI_HOST_GPIO_PULL_NONE,
3749 	WMI_HOST_GPIO_PULL_UP,
3750 	WMI_HOST_GPIO_PULL_DOWN,
3751 };
3752 
3753 /**
3754  * WMI_GPIO_INTTYPE
3755  */
3756 enum {
3757 	WMI_HOST_GPIO_INTTYPE_DISABLE,
3758 	WMI_HOST_GPIO_INTTYPE_RISING_EDGE,
3759 	WMI_HOST_GPIO_INTTYPE_FALLING_EDGE,
3760 	WMI_HOST_GPIO_INTTYPE_BOTH_EDGE,
3761 	WMI_HOST_GPIO_INTTYPE_LEVEL_LOW,
3762 	WMI_HOST_GPIO_INTTYPE_LEVEL_HIGH
3763 };
3764 
3765 /**
3766  * struct wmi_host_gpio_input_event - GPIO input event structure
3767  * @gpio_num: GPIO number which changed state
3768  */
3769 typedef struct {
3770 	uint32_t gpio_num;	/* GPIO number which changed state */
3771 } wmi_host_gpio_input_event;
3772 
3773 /**
3774  * struct gpio_config_params - GPIO config params
3775  * @gpio_num: GPIO number to config
3776  * @input: input/output
3777  * @pull_type: pull type
3778  * @intr_mode: int mode
3779  */
3780 struct gpio_config_params {
3781 	uint32_t gpio_num;
3782 	uint32_t input;
3783 	uint32_t pull_type;
3784 	uint32_t intr_mode;
3785 };
3786 
3787 /**
3788  * struct gpio_output_params - GPIO output params
3789  * @gpio_num: GPIO number to configure
3790  * @set: set/reset
3791  */
3792 struct gpio_output_params {
3793 	uint32_t gpio_num;
3794 	uint32_t set;
3795 };
3796 
3797 /* flags bit 0: to configure wlan priority bitmap */
3798 #define WMI_HOST_BTCOEX_PARAM_FLAGS_WLAN_PRIORITY_BITMAP_BIT (1<<0)
3799 /* flags bit 1: to configure both period and wlan duration */
3800 #define WMI_HOST_BTCOEX_PARAM_FLAGS_DUTY_CYCLE_BIT (1<<1)
3801 struct btcoex_cfg_params {
3802 	/* WLAN priority bitmask for different frame types */
3803 	uint32_t  btcoex_wlan_priority_bitmap;
3804 	/* This command is used to configure different btcoex params
3805 	 * in different situations.The host sets the appropriate bit(s)
3806 	 * in btcoex_param_flags to indicate which configuration parameters
3807 	 * are valid within a particular BT coex config message, so that one
3808 	 * BT configuration parameter can be configured without affecting
3809 	 * other BT configuration parameters.E.g. if the host wants to
3810 	 * configure only btcoex_wlan_priority_bitmap it sets only
3811 	 * WMI_BTCOEX_PARAM_FLAGS_WLAN_PRIORITY_BITMAP_BIT in
3812 	 * btcoex_param_flags so that firmware will not overwrite
3813 	 * other params with default value passed in the command.
3814 	 * Host can also set multiple bits in btcoex_param_flags
3815 	 * to configure more than one param in single message.
3816 	 */
3817 	uint32_t btcoex_param_flags;
3818 	/* period denotes the total time in milliseconds which WLAN and BT share
3819 	 * configured percentage for transmission and reception.
3820 	 */
3821 	uint32_t period;
3822 	/* wlan duration is the time in milliseconds given for wlan
3823 	 * in above period.
3824 	 */
3825 	uint32_t wlan_duration;
3826 };
3827 
3828 #define WMI_HOST_COEX_CONFIG_BUF_MAX_LEN 32 /* 128 bytes */
3829 /**
3830  * coex_ver_cfg_t
3831  * @coex_version: Version for 4 wire coex
3832  * @length: Length of payload buffer based on version
3833  * @config_buf: Payload Buffer
3834  */
3835 typedef struct {
3836 	/* VERSION_4 (4 wire coex) */
3837 	uint32_t coex_version;
3838 
3839 	/* No. of uint32_t elements in payload buffer. Will depend on the coex
3840 	 * version
3841 	 */
3842 	uint32_t length;
3843 
3844 	/* Payload buffer */
3845 	uint32_t config_buf[WMI_HOST_COEX_CONFIG_BUF_MAX_LEN];
3846 } coex_ver_cfg_t;
3847 
3848 #define WMI_HOST_RTT_REPORT_CFR	0
3849 #define WMI_HOST_RTT_NO_REPORT_CFR	1
3850 #define WMI_HOST_RTT_AGGREGATE_REPORT_NON_CFR	2
3851 /**
3852  * struct rtt_meas_req_test_params
3853  * @peer: peer mac address
3854  * @req_frame_type: RTT request frame type
3855  * @req_bw: requested bandwidth
3856  * @req_preamble: Preamble
3857  * @req_num_req: num of requests
3858  * @req_report_type: report type
3859  * @num_measurements: number of measurements
3860  * @asap_mode: priority
3861  * @lci_requested: LCI requested
3862  * @loc_civ_requested:
3863  * @channel_param: channel param
3864  * @req_id: requested id
3865  */
3866 struct rtt_meas_req_test_params {
3867 	uint8_t peer[IEEE80211_ADDR_LEN];
3868 	int req_frame_type;
3869 	int req_bw;
3870 	int req_preamble;
3871 	int req_num_req;
3872 	int req_report_type;
3873 	uint32_t num_measurements;
3874 	uint32_t asap_mode;
3875 	uint32_t lci_requested;
3876 	uint32_t loc_civ_requested;
3877 	struct channel_param channel;
3878 	uint8_t req_id;
3879 };
3880 
3881 /**
3882  * struct rtt_meas_req_params - RTT measurement request params
3883  * @req_id: Request id
3884  * @vdev_id: vdev id
3885  * @sta_mac_addr: pointer to station mac address
3886  * @spoof_mac_addr: pointer to spoof mac address
3887  * @is_mode_na: 11NA
3888  * @is_mode_ac: AC
3889  * @is_bw_20: 20
3890  * @is_bw_40: 40
3891  * @is_bw_80: 80
3892  * @num_probe_rqst: number of probe request
3893  * @channel_param: channel param
3894  */
3895 struct rtt_meas_req_params {
3896 	uint8_t req_id;
3897 	uint8_t vdev_id;
3898 	uint8_t *sta_mac_addr;
3899 	uint8_t *spoof_mac_addr;
3900 	bool is_mode_na;
3901 	bool is_mode_ac;
3902 	bool is_bw_20;
3903 	bool is_bw_40;
3904 	bool is_bw_80;
3905 	uint32_t num_probe_rqst;
3906 	struct channel_param channel;
3907 };
3908 
3909 /**
3910  * struct lci_set_params - LCI params
3911  * @lci_data: pointer to LCI data
3912  * @latitude_unc: latitude
3913  * @latitude_0_12: bits 0 to 1 of latitude
3914  * @latitude_2_33: bits 2 to 33 of latitude
3915  * @longitude_unc: longitude
3916  * @longitude_0_1: bits 0 to 1 of longitude
3917  * @longitude_2_33: bits 2 to 33 of longitude
3918  * @altitude_type: altitude type
3919  * @altitude_unc_0_3: altitude bits 0 - 3
3920  * @altitude_unc_4_5: altitude bits 4 - 5
3921  * @altitude: altitude
3922  * @datum: dataum
3923  * @reg_loc_agmt:
3924  * @reg_loc_dse:
3925  * @dep_sta:
3926  * @version: version
3927  */
3928 struct lci_set_params {
3929 	void *lci_data;
3930 	uint8_t	latitude_unc:6,
3931 		latitude_0_1:2;
3932 	uint32_t latitude_2_33;
3933 	uint8_t	longitude_unc:6,
3934 		longitude_0_1:2;
3935 	uint32_t longitude_2_33;
3936 	uint8_t	altitude_type:4,
3937 		altitude_unc_0_3:4;
3938 	uint32_t altitude_unc_4_5:2,
3939 		altitude:30;
3940 	uint8_t	datum:3,
3941 		reg_loc_agmt:1,
3942 		reg_loc_dse:1,
3943 		dep_sta:1,
3944 		version:2;
3945 	uint8_t *colocated_bss;
3946 	int msg_len;
3947 };
3948 
3949 /**
3950  * struct lcr_set_params - LCR params
3951  * @lcr_data: pointer to lcr data
3952  */
3953 struct lcr_set_params {
3954 	void *lcr_data;
3955 	int msg_len;
3956 };
3957 
3958 /**
3959  * struct rtt_keepalive_req_params - RTT keepalive params
3960  * @macaddr: pointer to macaddress
3961  * @req_id: Request id
3962  * @vdev_id: vdev id
3963  * @stop: start/stop
3964  */
3965 struct rtt_keepalive_req_params {
3966 	uint8_t *macaddr;
3967 	uint8_t req_id;
3968 	uint8_t vdev_id;
3969 	bool stop;
3970 };
3971 
3972 /**
3973  * struct rx_reorder_queue_setup_params  - Reorder queue setup params
3974  * @peer_mac_addr: Peer mac address
3975  * @tid: TID
3976  * @vdev_id: vdev id
3977  * @hw_qdesc_paddr_lo: lower 32 bits of queue desc adddress
3978  * @hw_qdesc_paddr_hi: upper 32 bits of queue desc adddress
3979  * @queue_no: 16-bit number assigned by host for queue
3980  * @ba_window_size_valid: BA window size validity flag
3981  * @ba_window_size: BA window size
3982  */
3983 struct rx_reorder_queue_setup_params {
3984 	uint8_t *peer_macaddr;
3985 	uint16_t tid;
3986 	uint16_t vdev_id;
3987 	uint32_t hw_qdesc_paddr_lo;
3988 	uint32_t hw_qdesc_paddr_hi;
3989 	uint16_t queue_no;
3990 	uint8_t ba_window_size_valid;
3991 	uint16_t ba_window_size;
3992 
3993 };
3994 
3995 /**
3996  * struct rx_reorder_queue_remove_params  - Reorder queue setup params
3997  * @peer_mac_addr: Peer mac address
3998  * @vdev_id: vdev id
3999  * @peer_tid_bitmap: peer tid bitmap
4000  */
4001 struct rx_reorder_queue_remove_params {
4002 	uint8_t *peer_macaddr;
4003 	uint16_t vdev_id;
4004 	uint32_t peer_tid_bitmap;
4005 };
4006 
4007 /**
4008  * struct wmi_host_stats_event - Stats event params
4009  * @stats_id: stats id of type wmi_host_stats_event
4010  * @num_pdev_stats: number of pdev stats event structures 0 or 1
4011  * @num_pdev_ext_stats: number of pdev ext stats event structures
4012  * @num_vdev_stats: number of vdev stats
4013  * @num_peer_stats: number of peer stats event structures 0 or max peers
4014  * @num_bcnflt_stats: number of beacon filter stats
4015  * @num_chan_stats: number of channel stats
4016  * @pdev_id: device id for the radio
4017  * @num_bcn_stats: number of beacon stats
4018  * @num_rssi_stats: number of rssi stats
4019  */
4020 typedef struct {
4021 	wmi_host_stats_id stats_id;
4022 	uint32_t num_pdev_stats;
4023 	uint32_t num_pdev_ext_stats;
4024 	uint32_t num_vdev_stats;
4025 	uint32_t num_peer_stats;
4026 	uint32_t num_bcnflt_stats;
4027 	uint32_t num_chan_stats;
4028 	uint32_t pdev_id;
4029 	uint32_t num_bcn_stats;
4030 	uint32_t num_rssi_stats;
4031 } wmi_host_stats_event;
4032 
4033 /**
4034  * struct wmi_host_peer_extd_stats - peer extd stats event structure
4035  * @peer_macaddr: Peer mac address
4036  * @inactive_time: inactive time in secs
4037  * @peer_chain_rssi: peer rssi
4038  * @rx_duration: RX duration
4039  * @peer_tx_bytes: TX bytes
4040  * @peer_rx_bytes: RX bytes
4041  * @last_tx_rate_code: Tx rate code of last frame
4042  * @last_tx_power: Tx power latest
4043  * @atf_tokens_allocated: atf tokens allocated
4044  * @atf_tokens_utilized: atf tokens utilized
4045  * @num_mu_tx_blacklisted: Blacklisted MU Tx count
4046  * @sgi_count: sgi count of the peer
4047  * @reserved: for future use
4048  */
4049 typedef struct {
4050 	wmi_host_mac_addr peer_macaddr;
4051 	uint32_t inactive_time;
4052 	uint32_t peer_chain_rssi;
4053 	uint32_t rx_duration;
4054 	uint32_t peer_tx_bytes;
4055 	uint32_t peer_rx_bytes;
4056 	uint32_t last_tx_rate_code;
4057 	uint32_t last_tx_power;
4058 	uint32_t atf_tokens_allocated;
4059 	uint32_t atf_tokens_utilized;
4060 	uint32_t num_mu_tx_blacklisted;
4061 	uint32_t sgi_count;
4062 	uint32_t reserved[2];
4063 } wmi_host_peer_extd_stats;
4064 
4065 /**
4066  * struct wmi_host_pdev_ext_stats - peer ext stats structure
4067  * @rx_rssi_comb: RX rssi
4068  * @rx_rssi_chain0: RX rssi chain 0
4069  * @rx_rssi_chain1: RX rssi chain 1
4070  * @rx_rssi_chain2: RX rssi chain 2
4071  * @rx_rssi_chain3: RX rssi chain 3
4072  * @rx_mcs: RX MCS array
4073  * @tx_mcs: TX MCS array
4074  * @ack_rssi: Ack rssi
4075  */
4076 typedef struct {
4077 	uint32_t	rx_rssi_comb;
4078 	uint32_t	rx_rssi_chain0;
4079 	uint32_t	rx_rssi_chain1;
4080 	uint32_t	rx_rssi_chain2;
4081 	uint32_t	rx_rssi_chain3;
4082 	uint32_t	rx_mcs[10];
4083 	uint32_t	tx_mcs[10];
4084 	uint32_t	ack_rssi;
4085 } wmi_host_pdev_ext_stats;
4086 
4087 /**
4088  * struct wmi_host_dbg_tx_stats - Debug stats
4089  * @comp_queued: Num HTT cookies queued to dispatch list
4090  * @comp_delivered: Num HTT cookies dispatched
4091  * @msdu_enqued: Num MSDU queued to WAL
4092  * @mpdu_enqued: Num MPDU queue to WAL
4093  * @wmm_drop: Num MSDUs dropped by WMM limit
4094  * @local_enqued: Num Local frames queued
4095  * @local_freed: Num Local frames done
4096  * @hw_queued: Num queued to HW
4097  * @hw_reaped: Num PPDU reaped from HW
4098  * @underrun: Num underruns
4099  * @hw_paused: HW Paused.
4100  * @tx_abort: Num PPDUs cleaned up in TX abort
4101  * @mpdus_requed: Num MPDUs requed by SW
4102  * @tx_ko: excessive retries
4103  * @tx_xretry:
4104  * @data_rc: data hw rate code
4105  * @self_triggers: Scheduler self triggers
4106  * @sw_retry_failure: frames dropped due to excessive sw retries
4107  * @illgl_rate_phy_err: illegal rate phy errors
4108  * @pdev_cont_xretry: wal pdev continuous xretry
4109  * @pdev_tx_timeout: wal pdev continuous xretry
4110  * @pdev_resets: wal pdev resets
4111  * @stateless_tid_alloc_failure: frames dropped due to non-availability of
4112  *                               stateless TIDs
4113  * @phy_underrun: PhY/BB underrun
4114  * @txop_ovf: MPDU is more than txop limit
4115  * @seq_posted: Number of Sequences posted
4116  * @seq_failed_queueing: Number of Sequences failed queueing
4117  * @seq_completed: Number of Sequences completed
4118  * @seq_restarted: Number of Sequences restarted
4119  * @mu_seq_posted: Number of MU Sequences posted
4120  * @mpdus_sw_flush: Num MPDUs flushed by SW, HWPAUSED, SW TXABORT
4121  *                  (Reset,channel change)
4122  * @mpdus_hw_filter: Num MPDUs filtered by HW, all filter condition
4123  *                   (TTL expired)
4124  * @mpdus_truncated: Num MPDUs truncated by PDG (TXOP, TBTT,
4125  *                   PPDU_duration based on rate, dyn_bw)
4126  * @mpdus_ack_failed: Num MPDUs that was tried but didn't receive ACK or BA
4127  * @mpdus_expired: Num MPDUs that was dropped du to expiry.
4128  * @mc_dropr: Num mc drops
4129  */
4130 typedef struct {
4131 	int32_t comp_queued;
4132 	int32_t comp_delivered;
4133 	int32_t msdu_enqued;
4134 	int32_t mpdu_enqued;
4135 	int32_t wmm_drop;
4136 	int32_t local_enqued;
4137 	int32_t local_freed;
4138 	int32_t hw_queued;
4139 	int32_t hw_reaped;
4140 	int32_t underrun;
4141 	uint32_t hw_paused;
4142 	int32_t tx_abort;
4143 	int32_t mpdus_requed;
4144 	uint32_t tx_ko;
4145 	uint32_t tx_xretry;
4146 	uint32_t data_rc;
4147 	uint32_t self_triggers;
4148 	uint32_t sw_retry_failure;
4149 	uint32_t illgl_rate_phy_err;
4150 	uint32_t pdev_cont_xretry;
4151 	uint32_t pdev_tx_timeout;
4152 	uint32_t pdev_resets;
4153 	uint32_t stateless_tid_alloc_failure;
4154 	uint32_t phy_underrun;
4155 	uint32_t txop_ovf;
4156 	uint32_t seq_posted;
4157 	uint32_t seq_failed_queueing;
4158 	uint32_t seq_completed;
4159 	uint32_t seq_restarted;
4160 	uint32_t mu_seq_posted;
4161 	int32_t mpdus_sw_flush;
4162 	int32_t mpdus_hw_filter;
4163 	int32_t mpdus_truncated;
4164 	int32_t mpdus_ack_failed;
4165 	int32_t mpdus_expired;
4166 	uint32_t mc_drop;
4167 } wmi_host_dbg_tx_stats;
4168 
4169 /**
4170  * struct wmi_host_dbg_rx_stats - RX Debug stats
4171  * @mid_ppdu_route_change: Cnts any change in ring routing mid-ppdu
4172  * @status_rcvd: Total number of statuses processed
4173  * @r0_frags: Extra frags on rings 0
4174  * @r1_frags: Extra frags on rings 1
4175  * @r2_frags: Extra frags on rings 2
4176  * @r3_frags: Extra frags on rings 3
4177  * @htt_msdus: MSDUs delivered to HTT
4178  * @htt_mpdus: MPDUs delivered to HTT
4179  * @loc_msdus: MSDUs delivered to local stack
4180  * @loc_mpdus: MPDUS delivered to local stack
4181  * @oversize_amsdu: AMSDUs that have more MSDUs than the status ring size
4182  * @phy_errs: Number of PHY errors
4183  * @phy_err_drop: Number of PHY errors drops
4184  * @mpdu_errs: Number of mpdu errors - FCS, MIC, ENC etc.
4185  * @pdev_rx_timeout: Number of rx inactivity timeouts
4186  * @rx_ovfl_errs: Number of rx overflow errors.
4187  */
4188 typedef struct {
4189 	int32_t mid_ppdu_route_change;
4190 	int32_t status_rcvd;
4191 	int32_t r0_frags;
4192 	int32_t r1_frags;
4193 	int32_t r2_frags;
4194 	int32_t r3_frags;
4195 	int32_t htt_msdus;
4196 	int32_t htt_mpdus;
4197 	int32_t loc_msdus;
4198 	int32_t loc_mpdus;
4199 	int32_t oversize_amsdu;
4200 	int32_t phy_errs;
4201 	int32_t phy_err_drop;
4202 	int32_t mpdu_errs;
4203 	uint32_t pdev_rx_timeout;
4204 	int32_t rx_ovfl_errs;
4205 } wmi_host_dbg_rx_stats;
4206 
4207 /** struct wmi_host_dbg_mem_stats - memory stats
4208  * @iram_free_size: IRAM free size on target
4209  * @dram_free_size: DRAM free size on target
4210  * @sram_free_size: SRAM free size on target
4211  */
4212 typedef struct {
4213 	uint32_t iram_free_size;
4214 	uint32_t dram_free_size;
4215 	/* Only Non-TLV */
4216 	uint32_t sram_free_size;
4217 } wmi_host_dbg_mem_stats;
4218 
4219 typedef struct {
4220 	/* Only TLV */
4221 	int32_t dummy;/* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
4222 } wmi_host_dbg_peer_stats;
4223 
4224 /**
4225  * struct wmi_host_dbg_stats - host debug stats
4226  * @tx: TX stats of type wmi_host_dbg_tx_stats
4227  * @rx: RX stats of type wmi_host_dbg_rx_stats
4228  * @mem: Memory stats of type wmi_host_dbg_mem_stats
4229  * @peer: peer stats of type wmi_host_dbg_peer_stats
4230  */
4231 typedef struct {
4232 	wmi_host_dbg_tx_stats tx;
4233 	wmi_host_dbg_rx_stats rx;
4234 	wmi_host_dbg_mem_stats mem;
4235 	wmi_host_dbg_peer_stats peer;
4236 } wmi_host_dbg_stats;
4237 
4238 /**
4239  * struct wmi_host_pdev_stats - PDEV stats
4240  * @chan_nf: Channel noise floor
4241  * @tx_frame_count: TX frame count
4242  * @rx_frame_count: RX frame count
4243  * @rx_clear_count: rx clear count
4244  * @cycle_count: cycle count
4245  * @phy_err_count: Phy error count
4246  * @chan_tx_pwr: Channel Tx Power
4247  * @pdev_stats: WAL dbg stats
4248  * @ackRcvBad:
4249  * @rtsBad:
4250  * @rtsGood:
4251  * @fcsBad:
4252  * @noBeacons:
4253  * @mib_int_count:
4254  */
4255 typedef struct {
4256 	int32_t chan_nf;
4257 	uint32_t tx_frame_count;
4258 	uint32_t rx_frame_count;
4259 	uint32_t rx_clear_count;
4260 	uint32_t cycle_count;
4261 	uint32_t phy_err_count;
4262 	uint32_t chan_tx_pwr;
4263 	wmi_host_dbg_stats pdev_stats;
4264 	uint32_t	ackRcvBad;
4265 	uint32_t	rtsBad;
4266 	uint32_t	rtsGood;
4267 	uint32_t	fcsBad;
4268 	uint32_t	noBeacons;
4269 	uint32_t	mib_int_count;
4270 } wmi_host_pdev_stats;
4271 
4272 
4273 /**
4274  * struct wmi_unit_test_event - Structure corresponding to WMI Unit test event
4275  * @vdev_id: VDEV ID
4276  * @module_id: MODULE ID
4277  * @diag_token: Diag Token (the number that was generated in the unit-test cmd)
4278  * @flag: flag has 2 bits 0x1 indicates status, and 0x2 indicates done-bit
4279  * @payload_len: payload_len (blindly copied from payload_len field in WMI)
4280  * @buffer_len: actual number of data bytes in the variable data size TLV
4281  *              buffer_len is likely to be the nearest multiple of 4 (from
4282  *              payload_len). both buffer_len and payload_len need to be
4283  *              passed to wifitool so that the driver can be agnostic
4284  *              regarding these differences.
4285  * @buffer: data buffer
4286  */
4287 typedef struct {
4288 	uint32_t vdev_id;
4289 	uint32_t module_id;
4290 	uint32_t diag_token;
4291 	uint32_t flag;
4292 	uint32_t payload_len;
4293 	uint32_t buffer_len;
4294 	uint8_t buffer[1];
4295 } wmi_unit_test_event;
4296 
4297 
4298 /**
4299  * struct wmi_host_snr_info - WMI host Signal to noise ration info
4300  * @bcn_snr: beacon SNR
4301  * @dat_snr: Data frames SNR
4302  */
4303 typedef struct {
4304 	int32_t bcn_snr;
4305 	int32_t dat_snr;
4306 } wmi_host_snr_info;
4307 
4308 #define WMI_HOST_MAX_TX_RATE_VALUES	10	/*Max Tx Rates */
4309 #define WMI_HOST_MAX_RSSI_VALUES	10	/*Max Rssi values */
4310 
4311 /* The WLAN_MAX_AC macro cannot be changed without breaking
4312  *  * WMI compatibility.
4313  *   * The maximum value of access category
4314  *	*/
4315 #define WMI_HOST_WLAN_MAX_AC  4
4316 
4317 /* The WMI_HOST_MAX_CHAINS macro cannot be changed without breaking WMI
4318  * compatibility.
4319  * The maximum value of number of chains
4320  */
4321 #define WMI_HOST_MAX_CHAINS   8
4322 
4323 /**
4324  * struct wmi_host_vdev_stats - vdev stats structure
4325  * @vdev_id: unique id identifying the VDEV, generated by the caller
4326  *        Rest all Only TLV
4327  * @vdev_snr: wmi_host_snr_info
4328  * @tx_frm_cnt: Total number of packets(per AC) that were successfully
4329  *              transmitted (with and without retries,
4330  *              including multi-cast, broadcast)
4331  * @rx_frm_cnt: Total number of packets that were successfully received
4332  *             (after appropriate filter rules including multi-cast, broadcast)
4333  * @multiple_retry_cnt: The number of MSDU packets and MMPDU frames per AC
4334  *      that the 802.11 station successfully transmitted after
4335  *      more than one retransmission attempt
4336  * @fail_cnt: Total number packets(per AC) failed to transmit
4337  * @rts_fail_cnt: Total number of RTS/CTS sequence failures for transmission
4338  *      of a packet
4339  * @rts_succ_cnt: Total number of RTS/CTS sequence success for transmission
4340  *      of a packet
4341  * @rx_err_cnt: The receive error count. HAL will provide the
4342  *      RxP FCS error global
4343  * @rx_discard_cnt: The sum of the receive error count and
4344  *      dropped-receive-buffer error count (FCS error)
4345  * @ack_fail_cnt: Total number packets failed transmit because of no
4346  *      ACK from the remote entity
4347  * @tx_rate_history:History of last ten transmit rate, in units of 500 kbit/sec
4348  * @bcn_rssi_history: History of last ten Beacon rssi of the connected Bss
4349  */
4350 typedef struct {
4351 	uint32_t vdev_id;
4352 	/* Rest all Only TLV */
4353 	wmi_host_snr_info vdev_snr;
4354 	uint32_t tx_frm_cnt[WMI_HOST_WLAN_MAX_AC];
4355 	uint32_t rx_frm_cnt;
4356 	uint32_t multiple_retry_cnt[WMI_HOST_WLAN_MAX_AC];
4357 	uint32_t fail_cnt[WMI_HOST_WLAN_MAX_AC];
4358 	uint32_t rts_fail_cnt;
4359 	uint32_t rts_succ_cnt;
4360 	uint32_t rx_err_cnt;
4361 	uint32_t rx_discard_cnt;
4362 	uint32_t ack_fail_cnt;
4363 	uint32_t tx_rate_history[WMI_HOST_MAX_TX_RATE_VALUES];
4364 	uint32_t bcn_rssi_history[WMI_HOST_MAX_RSSI_VALUES];
4365 } wmi_host_vdev_stats;
4366 
4367 /**
4368  * struct wmi_host_vdev_stats - vdev stats structure
4369  * @vdev_id: unique id identifying the VDEV, generated by the caller
4370  * @tx_bcn_succ_cnt: Total number of beacon frame transmitted successfully
4371  * @tx_bcn_outage_cnt: Total number of failed beacons
4372  */
4373 typedef struct {
4374 	uint32_t vdev_id;
4375 	uint32_t tx_bcn_succ_cnt;
4376 	uint32_t tx_bcn_outage_cnt;
4377 } wmi_host_bcn_stats;
4378 
4379 /**
4380  * struct wmi_host_vdev_extd_stats - VDEV extended stats
4381  * @vdev_id: unique id identifying the VDEV, generated by the caller
4382  * @ppdu_aggr_cnt: No of Aggrs Queued to HW
4383  * @ppdu_noack: No of PPDU's not Acked includes both aggr and nonaggr's
4384  * @mpdu_queued: No of MPDU/Subframes's queued to HW in Aggregates
4385  * @ppdu_nonaggr_cnt: No of NonAggr/MPDU/Subframes's queued to HW
4386  *         in Legacy NonAggregates
4387  * @mpdu_sw_requed: No of MPDU/Subframes's SW requeued includes
4388  *         both Aggr and NonAggr
4389  * @mpdu_suc_retry: No of MPDU/Subframes's transmitted Successfully
4390  *         after Single/mul HW retry
4391  * @mpdu_suc_multitry: No of MPDU/Subframes's transmitted Success
4392  *         after Multiple HW retry
4393  * @mpdu_fail_retry: No of MPDU/Subframes's failed transmission
4394  *         after Multiple HW retry
4395  * @reserved[13]: for future extensions set to 0x0
4396  */
4397 typedef struct {
4398 	uint32_t vdev_id;
4399 	uint32_t ppdu_aggr_cnt;
4400 	uint32_t ppdu_noack;
4401 	uint32_t mpdu_queued;
4402 	uint32_t ppdu_nonaggr_cnt;
4403 	uint32_t mpdu_sw_requed;
4404 	uint32_t mpdu_suc_retry;
4405 	uint32_t mpdu_suc_multitry;
4406 	uint32_t mpdu_fail_retry;
4407 	uint32_t reserved[13];
4408 } wmi_host_vdev_extd_stats;
4409 
4410 /**
4411  * struct wmi_host_vdev_nac_rssi_event - VDEV nac rssi stats
4412  * @vdev_id: unique id identifying the VDEV, generated by the caller
4413  * @last_rssi: rssi
4414  * @avg_rssi: averge rssi
4415  * @rssi_seq_num: rssi sequence number
4416  */
4417 struct wmi_host_vdev_nac_rssi_event {
4418 	uint32_t vdev_id;
4419 	uint32_t last_rssi;
4420 	uint32_t avg_rssi;
4421 	uint32_t rssi_seq_num;
4422 };
4423 
4424 /**
4425  * structure wmi_host_peer_retry_stats - peer retry stats
4426  * @peer_macaddr: peer macaddr
4427  * @retry_counter_wraparnd_ind: wraparound counter indication
4428  * @msdu_success: successfully transmitted msdus
4429  * @msdu_retried: Retried msdus
4430  * @msdu_mul_retried: msdus retried for more than once
4431  * @msdu_failed: msdus failed
4432  * @reserved: for furure extensions
4433  */
4434 struct wmi_host_peer_retry_stats {
4435 	wmi_host_mac_addr peer_macaddr;
4436 	uint32_t retry_counter_wraparnd_ind;
4437 	uint32_t msdus_success;
4438 	uint32_t msdus_retried;
4439 	uint32_t msdus_mul_retried;
4440 	uint32_t msdus_failed;
4441 	uint32_t reserved[4];
4442 };
4443 
4444 /**
4445  * struct wmi_host_per_chain_rssi_stats - VDEV nac rssi stats
4446  * @vdev_id: unique id identifying the VDEV, generated by the caller
4447  * @rssi_avg_beacon: per chain avg rssi for beacon
4448  * @rssi_avg_data: per chain avg rssi for data
4449  * @peer_macaddr: peer macaddr
4450  */
4451 struct wmi_host_per_chain_rssi_stats {
4452 	uint32_t vdev_id;
4453 	int32_t rssi_avg_beacon[WMI_HOST_MAX_CHAINS];
4454 	int32_t rssi_avg_data[WMI_HOST_MAX_CHAINS];
4455 	wmi_host_mac_addr peer_macaddr;
4456 };
4457 
4458 /**
4459  * struct wmi_host_peer_stats - peer stats
4460  * @peer_macaddr: peer MAC address
4461  * @peer_rssi: rssi
4462  * @peer_rssi_seq_num: rssi sequence number
4463  * @peer_tx_rate: last tx data rate used for peer
4464  * @peer_rx_rate: last rx data rate used for peer
4465  * @currentper: Current PER
4466  * @retries: Retries happened during transmission
4467  * @txratecount: Maximum Aggregation Size
4468  * @max4msframelen: Max4msframelen of tx rates used
4469  * @totalsubframes: Total no of subframes
4470  * @txbytes: No of bytes transmitted to the client
4471  * @nobuffs[4]: Packet Loss due to buffer overflows
4472  * @excretries[4]: Packet Loss due to excessive retries
4473  * @peer_rssi_changed: how many times peer's RSSI changed by a
4474  *        non-negligible amount
4475  */
4476 typedef struct {
4477 	wmi_host_mac_addr peer_macaddr;
4478 	int8_t  peer_rssi;
4479 	uint32_t  peer_rssi_seq_num;
4480 	uint32_t  peer_tx_rate;
4481 	uint32_t  peer_rx_rate;
4482 	uint32_t  currentper;
4483 	uint32_t  retries;
4484 	uint32_t  txratecount;
4485 	uint32_t  max4msframelen;
4486 	uint32_t  totalsubframes;
4487 	uint32_t txbytes;
4488 	uint32_t  nobuffs[4];
4489 	uint32_t  excretries[4];
4490 	uint32_t  peer_rssi_changed;
4491 } wmi_host_peer_stats;
4492 
4493 typedef struct {
4494 	uint32_t dummy;
4495 } wmi_host_bcnflt_stats;
4496 
4497 /**
4498  * struct wmi_host_chan_stats - WMI chan stats
4499  * @chan_mhz: Primary channel freq of the channel for which stats are sent
4500  * @sampling_period_us: Time spent on the channel
4501  * @rx_clear_count: Aggregate duration over a sampling period for
4502  *       which channel activity was observed
4503  * @tx_duration_us: Accumalation of the TX PPDU duration over a sampling period
4504  * @rx_duration_us: Accumalation of the RX PPDU duration over a sampling period
4505  */
4506 typedef struct {
4507 	uint32_t chan_mhz;
4508 	uint32_t sampling_period_us;
4509 	uint32_t rx_clear_count;
4510 	uint32_t tx_duration_us;
4511 	uint32_t rx_duration_us;
4512 } wmi_host_chan_stats;
4513 
4514 #define WMI_EVENT_ID_INVALID 0
4515 /**
4516  * Host based ENUM IDs for events to abstract target enums for event_id
4517  */
4518 typedef enum {
4519 	wmi_service_ready_event_id = 0,
4520 	wmi_ready_event_id,
4521 	wmi_dbg_msg_event_id,
4522 	wmi_scan_event_id,
4523 	wmi_echo_event_id,
4524 	wmi_update_stats_event_id,
4525 	wmi_inst_rssi_stats_event_id,
4526 	wmi_vdev_start_resp_event_id,
4527 	wmi_vdev_standby_req_event_id,
4528 	wmi_vdev_resume_req_event_id,
4529 	wmi_vdev_stopped_event_id,
4530 	wmi_peer_sta_kickout_event_id,
4531 	wmi_host_swba_event_id,
4532 	wmi_tbttoffset_update_event_id,
4533 	wmi_mgmt_rx_event_id,
4534 	wmi_chan_info_event_id,
4535 	wmi_phyerr_event_id,
4536 	wmi_roam_event_id,
4537 	wmi_profile_match,
4538 	wmi_debug_print_event_id,
4539 	wmi_pdev_qvit_event_id,
4540 	wmi_wlan_profile_data_event_id,
4541 	wmi_rtt_meas_report_event_id,
4542 	wmi_tsf_meas_report_event_id,
4543 	wmi_rtt_error_report_event_id,
4544 	wmi_rtt_keepalive_event_id,
4545 	wmi_oem_cap_event_id,
4546 	wmi_oem_meas_report_event_id,
4547 	wmi_oem_report_event_id,
4548 	wmi_nan_event_id,
4549 	wmi_wow_wakeup_host_event_id,
4550 	wmi_gtk_offload_status_event_id,
4551 	wmi_gtk_rekey_fail_event_id,
4552 	wmi_dcs_interference_event_id,
4553 	wmi_pdev_tpc_config_event_id,
4554 	wmi_csa_handling_event_id,
4555 	wmi_gpio_input_event_id,
4556 	wmi_peer_ratecode_list_event_id,
4557 	wmi_generic_buffer_event_id,
4558 	wmi_mcast_buf_release_event_id,
4559 	wmi_mcast_list_ageout_event_id,
4560 	wmi_vdev_get_keepalive_event_id,
4561 	wmi_wds_peer_event_id,
4562 	wmi_peer_sta_ps_statechg_event_id,
4563 	wmi_pdev_fips_event_id,
4564 	wmi_tt_stats_event_id,
4565 	wmi_pdev_channel_hopping_event_id,
4566 	wmi_pdev_ani_cck_level_event_id,
4567 	wmi_pdev_ani_ofdm_level_event_id,
4568 	wmi_pdev_reserve_ast_entry_event_id,
4569 	wmi_pdev_nfcal_power_event_id,
4570 	wmi_pdev_tpc_event_id,
4571 	wmi_pdev_get_ast_info_event_id,
4572 	wmi_pdev_temperature_event_id,
4573 	wmi_pdev_nfcal_power_all_channels_event_id,
4574 	wmi_pdev_bss_chan_info_event_id,
4575 	wmi_mu_report_event_id,
4576 	wmi_pdev_utf_event_id,
4577 	wmi_pdev_dump_event_id,
4578 	wmi_tx_pause_event_id,
4579 	wmi_dfs_radar_event_id,
4580 	wmi_pdev_l1ss_track_event_id,
4581 	wmi_service_ready_ext_event_id,
4582 	wmi_vdev_install_key_complete_event_id,
4583 	wmi_vdev_mcc_bcn_intvl_change_req_event_id,
4584 	wmi_vdev_tsf_report_event_id,
4585 	wmi_peer_info_event_id,
4586 	wmi_peer_tx_fail_cnt_thr_event_id,
4587 	wmi_peer_estimated_linkspeed_event_id,
4588 	wmi_peer_state_event_id,
4589 	wmi_offload_bcn_tx_status_event_id,
4590 	wmi_offload_prob_resp_tx_status_event_id,
4591 	wmi_mgmt_tx_completion_event_id,
4592 	wmi_tx_delba_complete_event_id,
4593 	wmi_tx_addba_complete_event_id,
4594 	wmi_ba_rsp_ssn_event_id,
4595 	wmi_aggr_state_trig_event_id,
4596 	wmi_roam_synch_event_id,
4597 	wmi_roam_synch_frame_event_id,
4598 	wmi_p2p_disc_event_id,
4599 	wmi_p2p_noa_event_id,
4600 	wmi_p2p_lo_stop_event_id,
4601 	wmi_vdev_add_macaddr_rx_filter_event_id,
4602 	wmi_pdev_resume_event_id,
4603 	wmi_d0_wow_disable_ack_event_id,
4604 	wmi_wow_initial_wakeup_event_id,
4605 	wmi_stats_ext_event_id,
4606 	wmi_iface_link_stats_event_id,
4607 	wmi_peer_link_stats_event_id,
4608 	wmi_radio_link_stats_link,
4609 	wmi_update_fw_mem_dump_event_id,
4610 	wmi_diag_event_id_log_supported_event_id,
4611 	wmi_nlo_match_event_id,
4612 	wmi_nlo_scan_complete_event_id,
4613 	wmi_apfind_event_id,
4614 	wmi_passpoint_match_event_id,
4615 	wmi_chatter_pc_query_event_id,
4616 	wmi_pdev_ftm_intg_event_id,
4617 	wmi_wlan_freq_avoid_event_id,
4618 	wmi_thermal_mgmt_event_id,
4619 	wmi_diag_container_event_id,
4620 	wmi_host_auto_shutdown_event_id,
4621 	wmi_update_whal_mib_stats_event_id,
4622 	wmi_update_vdev_rate_stats_event_id,
4623 	wmi_diag_event_id,
4624 	wmi_unit_test_event_id,
4625 	wmi_ocb_set_sched_event_id,
4626 	wmi_dbg_mesg_flush_complete_event_id,
4627 	wmi_rssi_breach_event_id,
4628 	wmi_uploadh_event_id,
4629 	wmi_captureh_event_id,
4630 	wmi_rfkill_state_change_event_id,
4631 	wmi_tdls_peer_event_id,
4632 	wmi_batch_scan_enabled_event_id,
4633 	wmi_batch_scan_result_event_id,
4634 	wmi_lpi_result_event_id,
4635 	wmi_lpi_status_event_id,
4636 	wmi_lpi_handoff_event_id,
4637 	wmi_extscan_start_stop_event_id,
4638 	wmi_extscan_operation_event_id,
4639 	wmi_extscan_table_usage_event_id,
4640 	wmi_extscan_cached_results_event_id,
4641 	wmi_extscan_wlan_change_results_event_id,
4642 	wmi_extscan_hotlist_match_event_id,
4643 	wmi_extscan_capabilities_event_id,
4644 	wmi_extscan_hotlist_ssid_match_event_id,
4645 	wmi_mdns_stats_event_id,
4646 	wmi_sap_ofl_add_sta_event_id,
4647 	wmi_sap_ofl_del_sta_event_id,
4648 	wmi_ocb_set_config_resp_event_id,
4649 	wmi_ocb_get_tsf_timer_resp_event_id,
4650 	wmi_dcc_get_stats_resp_event_id,
4651 	wmi_dcc_update_ndl_resp_event_id,
4652 	wmi_dcc_stats_event_id,
4653 	wmi_soc_set_hw_mode_resp_event_id,
4654 	wmi_soc_hw_mode_transition_event_id,
4655 	wmi_soc_set_dual_mac_config_resp_event_id,
4656 	wmi_tx_data_traffic_ctrl_event_id,
4657 	wmi_peer_tx_mu_txmit_count_event_id,
4658 	wmi_peer_gid_userpos_list_event_id,
4659 	wmi_pdev_check_cal_version_event_id,
4660 	wmi_atf_peer_stats_event_id,
4661 	wmi_peer_delete_response_event_id,
4662 	wmi_pdev_csa_switch_count_status_event_id,
4663 	wmi_reg_chan_list_cc_event_id,
4664 	wmi_offchan_data_tx_completion_event,
4665 	wmi_dfs_cac_complete_id,
4666 	wmi_dfs_radar_detection_event_id,
4667 	wmi_ext_tbttoffset_update_event_id,
4668 	wmi_11d_new_country_event_id,
4669 	wmi_get_arp_stats_req_id,
4670 	wmi_service_available_event_id,
4671 	wmi_update_rcpi_event_id,
4672 	wmi_pdev_wds_entry_list_event_id,
4673 	wmi_ndp_initiator_rsp_event_id,
4674 	wmi_ndp_indication_event_id,
4675 	wmi_ndp_confirm_event_id,
4676 	wmi_ndp_responder_rsp_event_id,
4677 	wmi_ndp_end_indication_event_id,
4678 	wmi_ndp_end_rsp_event_id,
4679 	wmi_ndl_schedule_update_event_id,
4680 	wmi_oem_response_event_id,
4681 	wmi_peer_stats_info_event_id,
4682 	wmi_pdev_chip_power_stats_event_id,
4683 	wmi_ap_ps_egap_info_event_id,
4684 	wmi_peer_assoc_conf_event_id,
4685 	wmi_vdev_delete_resp_event_id,
4686 	wmi_apf_capability_info_event_id,
4687 	wmi_vdev_encrypt_decrypt_data_rsp_event_id,
4688 	wmi_report_rx_aggr_failure_event_id,
4689 	wmi_pdev_chip_pwr_save_failure_detect_event_id,
4690 	wmi_peer_antdiv_info_event_id,
4691 	wmi_pdev_set_hw_mode_rsp_event_id,
4692 	wmi_pdev_hw_mode_transition_event_id,
4693 	wmi_pdev_set_mac_config_resp_event_id,
4694 	wmi_coex_bt_activity_event_id,
4695 	wmi_mgmt_tx_bundle_completion_event_id,
4696 	wmi_radio_tx_power_level_stats_event_id,
4697 	wmi_report_stats_event_id,
4698 	wmi_dma_buf_release_event_id,
4699 	wmi_sap_obss_detection_report_event_id,
4700 	wmi_obss_color_collision_report_event_id,
4701 	wmi_host_swfda_event_id,
4702 	wmi_sar_get_limits_event_id,
4703 	wmi_pdev_div_rssi_antid_event_id,
4704 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
4705 	wmi_host_dfs_status_check_event_id,
4706 #endif
4707 	wmi_twt_enable_complete_event_id,
4708 	wmi_apf_get_vdev_work_memory_resp_event_id,
4709 	wmi_roam_scan_stats_event_id,
4710 
4711 #ifdef OL_ATH_SMART_LOGGING
4712 	wmi_debug_fatal_condition_eventid,
4713 #endif /* OL_ATH_SMART_LOGGING */
4714 	wmi_wlan_sar2_result_event_id,
4715 	wmi_esp_estimate_event_id,
4716 	wmi_pdev_ctl_failsafe_check_event_id,
4717 	wmi_vdev_bcn_reception_stats_event_id,
4718 	wmi_roam_blacklist_event_id,
4719 	wmi_events_max,
4720 } wmi_conv_event_id;
4721 
4722 #define WMI_UNAVAILABLE_PARAM 0
4723 /**
4724  * Host based ENUM IDs for PDEV params to abstract target enums
4725  */
4726 typedef enum {
4727 	wmi_pdev_param_tx_chain_mask = 0,
4728 	wmi_pdev_param_rx_chain_mask,
4729 	wmi_pdev_param_txpower_limit2g,
4730 	wmi_pdev_param_txpower_limit5g,
4731 	wmi_pdev_param_txpower_scale,
4732 	wmi_pdev_param_beacon_gen_mode,
4733 	wmi_pdev_param_beacon_tx_mode,
4734 	wmi_pdev_param_resmgr_offchan_mode,
4735 	wmi_pdev_param_protection_mode,
4736 	wmi_pdev_param_dynamic_bw,
4737 	wmi_pdev_param_non_agg_sw_retry_th,
4738 	wmi_pdev_param_agg_sw_retry_th,
4739 	wmi_pdev_param_sta_kickout_th,
4740 	wmi_pdev_param_ac_aggrsize_scaling,
4741 	wmi_pdev_param_ltr_enable,
4742 	wmi_pdev_param_ltr_ac_latency_be,
4743 	wmi_pdev_param_ltr_ac_latency_bk,
4744 	wmi_pdev_param_ltr_ac_latency_vi,
4745 	wmi_pdev_param_ltr_ac_latency_vo,
4746 	wmi_pdev_param_ltr_ac_latency_timeout,
4747 	wmi_pdev_param_ltr_sleep_override,
4748 	wmi_pdev_param_ltr_rx_override,
4749 	wmi_pdev_param_ltr_tx_activity_timeout,
4750 	wmi_pdev_param_l1ss_enable,
4751 	wmi_pdev_param_dsleep_enable,
4752 	wmi_pdev_param_pcielp_txbuf_flush,
4753 	wmi_pdev_param_pcielp_txbuf_watermark,
4754 	wmi_pdev_param_pcielp_txbuf_tmo_en,
4755 	wmi_pdev_param_pcielp_txbuf_tmo_value,
4756 	wmi_pdev_param_pdev_stats_update_period,
4757 	wmi_pdev_param_vdev_stats_update_period,
4758 	wmi_pdev_param_peer_stats_update_period,
4759 	wmi_pdev_param_bcnflt_stats_update_period,
4760 	wmi_pdev_param_pmf_qos,
4761 	wmi_pdev_param_arp_ac_override,
4762 	wmi_pdev_param_dcs,
4763 	wmi_pdev_param_ani_enable,
4764 	wmi_pdev_param_ani_poll_period,
4765 	wmi_pdev_param_ani_listen_period,
4766 	wmi_pdev_param_ani_ofdm_level,
4767 	wmi_pdev_param_ani_cck_level,
4768 	wmi_pdev_param_dyntxchain,
4769 	wmi_pdev_param_proxy_sta,
4770 	wmi_pdev_param_idle_ps_config,
4771 	wmi_pdev_param_power_gating_sleep,
4772 	wmi_pdev_param_aggr_burst,
4773 	wmi_pdev_param_rx_decap_mode,
4774 	wmi_pdev_param_fast_channel_reset,
4775 	wmi_pdev_param_burst_dur,
4776 	wmi_pdev_param_burst_enable,
4777 	wmi_pdev_param_smart_antenna_default_antenna,
4778 	wmi_pdev_param_igmpmld_override,
4779 	wmi_pdev_param_igmpmld_tid,
4780 	wmi_pdev_param_antenna_gain,
4781 	wmi_pdev_param_rx_filter,
4782 	wmi_pdev_set_mcast_to_ucast_tid,
4783 	wmi_pdev_param_proxy_sta_mode,
4784 	wmi_pdev_param_set_mcast2ucast_mode,
4785 	wmi_pdev_param_set_mcast2ucast_buffer,
4786 	wmi_pdev_param_remove_mcast2ucast_buffer,
4787 	wmi_pdev_peer_sta_ps_statechg_enable,
4788 	wmi_pdev_param_block_interbss,
4789 	wmi_pdev_param_set_disable_reset_cmdid,
4790 	wmi_pdev_param_set_msdu_ttl_cmdid,
4791 	wmi_pdev_param_set_ppdu_duration_cmdid,
4792 	wmi_pdev_param_txbf_sound_period_cmdid,
4793 	wmi_pdev_param_set_promisc_mode_cmdid,
4794 	wmi_pdev_param_set_burst_mode_cmdid,
4795 	wmi_pdev_param_en_stats,
4796 	wmi_pdev_param_mu_group_policy,
4797 	wmi_pdev_param_noise_detection,
4798 	wmi_pdev_param_noise_threshold,
4799 	wmi_pdev_param_dpd_enable,
4800 	wmi_pdev_param_set_mcast_bcast_echo,
4801 	wmi_pdev_param_atf_strict_sch,
4802 	wmi_pdev_param_atf_sched_duration,
4803 	wmi_pdev_param_ant_plzn,
4804 	wmi_pdev_param_mgmt_retry_limit,
4805 	wmi_pdev_param_sensitivity_level,
4806 	wmi_pdev_param_signed_txpower_2g,
4807 	wmi_pdev_param_signed_txpower_5g,
4808 	wmi_pdev_param_enable_per_tid_amsdu,
4809 	wmi_pdev_param_enable_per_tid_ampdu,
4810 	wmi_pdev_param_cca_threshold,
4811 	wmi_pdev_param_rts_fixed_rate,
4812 	wmi_pdev_param_cal_period,
4813 	wmi_pdev_param_pdev_reset,
4814 	wmi_pdev_param_wapi_mbssid_offset,
4815 	wmi_pdev_param_arp_srcaddr,
4816 	wmi_pdev_param_arp_dstaddr,
4817 	wmi_pdev_param_txpower_decr_db,
4818 	wmi_pdev_param_rx_batchmode,
4819 	wmi_pdev_param_packet_aggr_delay,
4820 	wmi_pdev_param_atf_obss_noise_sch,
4821 	wmi_pdev_param_atf_obss_noise_scaling_factor,
4822 	wmi_pdev_param_cust_txpower_scale,
4823 	wmi_pdev_param_atf_dynamic_enable,
4824 	wmi_pdev_param_atf_ssid_group_policy,
4825 	wmi_pdev_param_rfkill_enable,
4826 	wmi_pdev_param_hw_rfkill_config,
4827 	wmi_pdev_param_low_power_rf_enable,
4828 	wmi_pdev_param_l1ss_track,
4829 	wmi_pdev_param_hyst_en,
4830 	wmi_pdev_param_power_collapse_enable,
4831 	wmi_pdev_param_led_sys_state,
4832 	wmi_pdev_param_led_enable,
4833 	wmi_pdev_param_audio_over_wlan_latency,
4834 	wmi_pdev_param_audio_over_wlan_enable,
4835 	wmi_pdev_param_whal_mib_stats_update_enable,
4836 	wmi_pdev_param_vdev_rate_stats_update_period,
4837 	wmi_pdev_param_cts_cbw,
4838 	wmi_pdev_param_wnts_config,
4839 	wmi_pdev_param_adaptive_early_rx_enable,
4840 	wmi_pdev_param_adaptive_early_rx_min_sleep_slop,
4841 	wmi_pdev_param_adaptive_early_rx_inc_dec_step,
4842 	wmi_pdev_param_early_rx_fix_sleep_slop,
4843 	wmi_pdev_param_bmiss_based_adaptive_bto_enable,
4844 	wmi_pdev_param_bmiss_bto_min_bcn_timeout,
4845 	wmi_pdev_param_bmiss_bto_inc_dec_step,
4846 	wmi_pdev_param_bto_fix_bcn_timeout,
4847 	wmi_pdev_param_ce_based_adaptive_bto_enable,
4848 	wmi_pdev_param_ce_bto_combo_ce_value,
4849 	wmi_pdev_param_tx_chain_mask_2g,
4850 	wmi_pdev_param_rx_chain_mask_2g,
4851 	wmi_pdev_param_tx_chain_mask_5g,
4852 	wmi_pdev_param_rx_chain_mask_5g,
4853 	wmi_pdev_param_tx_chain_mask_cck,
4854 	wmi_pdev_param_tx_chain_mask_1ss,
4855 	wmi_pdev_param_enable_btcoex,
4856 	wmi_pdev_param_atf_peer_stats,
4857 	wmi_pdev_param_btcoex_cfg,
4858 	wmi_pdev_param_mesh_mcast_enable,
4859 	wmi_pdev_param_tx_ack_timeout,
4860 	wmi_pdev_param_soft_tx_chain_mask,
4861 	wmi_pdev_param_cck_tx_enable,
4862 	wmi_pdev_param_esp_indication_period,
4863 	wmi_pdev_param_antenna_gain_half_db,
4864 	wmi_pdev_param_ru26_allowed,
4865 	wmi_pdev_param_esp_ba_window,
4866 	wmi_pdev_param_esp_airtime_fraction,
4867 	wmi_pdev_param_esp_ppdu_duration,
4868 	wmi_pdev_param_use_nol,
4869 	wmi_pdev_param_enable_peer_retry_stats,
4870 	wmi_pdev_param_ul_trig_int,
4871 	wmi_pdev_param_sub_channel_marking,
4872 	wmi_pdev_param_max,
4873 } wmi_conv_pdev_params_id;
4874 
4875 
4876 /**
4877  * Host based ENUM IDs for VDEV params to abstract target enums
4878  */
4879 typedef enum {
4880 	wmi_vdev_param_rts_threshold = 0,
4881 	wmi_vdev_param_fragmentation_threshold,
4882 	wmi_vdev_param_beacon_interval,
4883 	wmi_vdev_param_listen_interval,
4884 	wmi_vdev_param_multicast_rate,
4885 	wmi_vdev_param_mgmt_tx_rate,
4886 	wmi_vdev_param_slot_time,
4887 	wmi_vdev_param_preamble,
4888 	wmi_vdev_param_swba_time,
4889 	wmi_vdev_stats_update_period,
4890 	wmi_vdev_pwrsave_ageout_time,
4891 	wmi_vdev_host_swba_interval,
4892 	wmi_vdev_param_dtim_period,
4893 	wmi_vdev_oc_scheduler_air_time_limit,
4894 	wmi_vdev_param_wds,
4895 	wmi_vdev_param_atim_window,
4896 	wmi_vdev_param_bmiss_count_max,
4897 	wmi_vdev_param_bmiss_first_bcnt,
4898 	wmi_vdev_param_bmiss_final_bcnt,
4899 	wmi_vdev_param_feature_wmm,
4900 	wmi_vdev_param_chwidth,
4901 	wmi_vdev_param_chextoffset,
4902 	wmi_vdev_param_disable_htprotection,
4903 	wmi_vdev_param_sta_quickkickout,
4904 	wmi_vdev_param_mgmt_rate,
4905 	wmi_vdev_param_protection_mode,
4906 	wmi_vdev_param_fixed_rate,
4907 	wmi_vdev_param_sgi,
4908 	wmi_vdev_param_ldpc,
4909 	wmi_vdev_param_tx_stbc,
4910 	wmi_vdev_param_rx_stbc,
4911 	wmi_vdev_param_intra_bss_fwd,
4912 	wmi_vdev_param_def_keyid,
4913 	wmi_vdev_param_nss,
4914 	wmi_vdev_param_bcast_data_rate,
4915 	wmi_vdev_param_mcast_data_rate,
4916 	wmi_vdev_param_mcast_indicate,
4917 	wmi_vdev_param_dhcp_indicate,
4918 	wmi_vdev_param_unknown_dest_indicate,
4919 	wmi_vdev_param_ap_keepalive_min_idle_inactive_time_secs,
4920 	wmi_vdev_param_ap_keepalive_max_idle_inactive_time_secs,
4921 	wmi_vdev_param_ap_keepalive_max_unresponsive_time_secs,
4922 	wmi_vdev_param_ap_enable_nawds,
4923 	wmi_vdev_param_mcast2ucast_set,
4924 	wmi_vdev_param_enable_rtscts,
4925 	wmi_vdev_param_rc_num_retries,
4926 	wmi_vdev_param_txbf,
4927 	wmi_vdev_param_packet_powersave,
4928 	wmi_vdev_param_drop_unencry,
4929 	wmi_vdev_param_tx_encap_type,
4930 	wmi_vdev_param_ap_detect_out_of_sync_sleeping_sta_time_secs,
4931 	wmi_vdev_param_cabq_maxdur,
4932 	wmi_vdev_param_mfptest_set,
4933 	wmi_vdev_param_rts_fixed_rate,
4934 	wmi_vdev_param_vht_sgimask,
4935 	wmi_vdev_param_vht80_ratemask,
4936 	wmi_vdev_param_early_rx_adjust_enable,
4937 	wmi_vdev_param_early_rx_tgt_bmiss_num,
4938 	wmi_vdev_param_early_rx_bmiss_sample_cycle,
4939 	wmi_vdev_param_early_rx_slop_step,
4940 	wmi_vdev_param_early_rx_init_slop,
4941 	wmi_vdev_param_early_rx_adjust_pause,
4942 	wmi_vdev_param_proxy_sta,
4943 	wmi_vdev_param_meru_vc,
4944 	wmi_vdev_param_rx_decap_type,
4945 	wmi_vdev_param_bw_nss_ratemask,
4946 	wmi_vdev_param_sensor_ap,
4947 	wmi_vdev_param_beacon_rate,
4948 	wmi_vdev_param_dtim_enable_cts,
4949 	wmi_vdev_param_sta_kickout,
4950 	wmi_vdev_param_tx_pwrlimit,
4951 	wmi_vdev_param_snr_num_for_cal,
4952 	wmi_vdev_param_roam_fw_offload,
4953 	wmi_vdev_param_enable_rmc,
4954 	wmi_vdev_param_ibss_max_bcn_lost_ms,
4955 	wmi_vdev_param_max_rate,
4956 	wmi_vdev_param_early_rx_drift_sample,
4957 	wmi_vdev_param_set_ibss_tx_fail_cnt_thr,
4958 	wmi_vdev_param_ebt_resync_timeout,
4959 	wmi_vdev_param_aggr_trig_event_enable,
4960 	wmi_vdev_param_is_ibss_power_save_allowed,
4961 	wmi_vdev_param_is_power_collapse_allowed,
4962 	wmi_vdev_param_is_awake_on_txrx_enabled,
4963 	wmi_vdev_param_inactivity_cnt,
4964 	wmi_vdev_param_txsp_end_inactivity_time_ms,
4965 	wmi_vdev_param_dtim_policy,
4966 	wmi_vdev_param_ibss_ps_warmup_time_secs,
4967 	wmi_vdev_param_ibss_ps_1rx_chain_in_atim_window_enable,
4968 	wmi_vdev_param_rx_leak_window,
4969 	wmi_vdev_param_stats_avg_factor,
4970 	wmi_vdev_param_disconnect_th,
4971 	wmi_vdev_param_rtscts_rate,
4972 	wmi_vdev_param_mcc_rtscts_protection_enable,
4973 	wmi_vdev_param_mcc_broadcast_probe_enable,
4974 	wmi_vdev_param_capabilities,
4975 	wmi_vdev_param_mgmt_tx_power,
4976 	wmi_vdev_param_atf_ssid_sched_policy,
4977 	wmi_vdev_param_disable_dyn_bw_rts,
4978 	wmi_vdev_param_ampdu_subframe_size_per_ac,
4979 	wmi_vdev_param_he_dcm_enable,
4980 	wmi_vdev_param_he_bss_color,
4981 	wmi_vdev_param_he_range_ext_enable,
4982 	wmi_vdev_param_set_hemu_mode,
4983 	wmi_vdev_param_set_he_ltf,
4984 	wmi_vdev_param_set_heop,
4985 	wmi_vdev_param_disable_cabq,
4986 	wmi_vdev_param_rate_dropdown_bmap,
4987 	wmi_vdev_param_tx_power,
4988 	wmi_vdev_param_set_ba_mode,
4989 	wmi_vdev_param_autorate_misc_cfg,
4990 	wmi_vdev_param_amsdu_subframe_size_per_ac,
4991 	wmi_vdev_param_set_he_sounding_mode,
4992 	wmi_vdev_param_sifs_trigger_rate,
4993 	wmi_vdev_param_ul_shortgi,
4994 	wmi_vdev_param_ul_he_ltf,
4995 	wmi_vdev_param_ul_nss,
4996 	wmi_vdev_param_ul_ppdu_bw,
4997 	wmi_vdev_param_ul_ldpc,
4998 	wmi_vdev_param_ul_stbc,
4999 	wmi_vdev_param_ul_fixed_rate,
5000 	wmi_vdev_param_rawmode_open_war,
5001 
5002 	wmi_vdev_param_max,
5003 } wmi_conv_vdev_param_id;
5004 
5005 /**
5006  * Host based ENUM IDs for service bits to abstract target enums
5007  */
5008 typedef enum {
5009 	wmi_service_beacon_offload = 0,
5010 	wmi_service_scan_offload,
5011 	wmi_service_roam_offload,
5012 	wmi_service_bcn_miss_offload,
5013 	wmi_service_sta_pwrsave,
5014 	wmi_service_sta_advanced_pwrsave,
5015 	wmi_service_ap_uapsd,
5016 	wmi_service_ap_dfs,
5017 	wmi_service_11ac,
5018 	wmi_service_blockack,
5019 	wmi_service_phyerr,
5020 	wmi_service_bcn_filter,
5021 	wmi_service_rtt,
5022 	wmi_service_ratectrl,
5023 	wmi_service_wow,
5024 	wmi_service_ratectrl_cache,
5025 	wmi_service_iram_tids,
5026 	wmi_service_burst,
5027 	wmi_service_smart_antenna_sw_support,
5028 	wmi_service_gtk_offload,
5029 	wmi_service_scan_sch,
5030 	wmi_service_csa_offload,
5031 	wmi_service_chatter,
5032 	wmi_service_coex_freqavoid,
5033 	wmi_service_packet_power_save,
5034 	wmi_service_force_fw_hang,
5035 	wmi_service_smart_antenna_hw_support,
5036 	wmi_service_gpio,
5037 	wmi_sta_uapsd_basic_auto_trig,
5038 	wmi_sta_uapsd_var_auto_trig,
5039 	wmi_service_sta_keep_alive,
5040 	wmi_service_tx_encap,
5041 	wmi_service_ap_ps_detect_out_of_sync,
5042 	wmi_service_early_rx,
5043 	wmi_service_enhanced_proxy_sta,
5044 	wmi_service_tt,
5045 	wmi_service_atf,
5046 	wmi_service_peer_caching,
5047 	wmi_service_coex_gpio,
5048 	wmi_service_aux_spectral_intf,
5049 	wmi_service_aux_chan_load_intf,
5050 	wmi_service_bss_channel_info_64,
5051 	wmi_service_ext_res_cfg_support,
5052 	wmi_service_mesh,
5053 	wmi_service_restrt_chnl_support,
5054 	wmi_service_roam_scan_offload,
5055 	wmi_service_arpns_offload,
5056 	wmi_service_nlo,
5057 	wmi_service_sta_dtim_ps_modulated_dtim,
5058 	wmi_service_sta_smps,
5059 	wmi_service_fwtest,
5060 	wmi_service_sta_wmmac,
5061 	wmi_service_tdls,
5062 	wmi_service_mcc_bcn_interval_change,
5063 	wmi_service_adaptive_ocs,
5064 	wmi_service_ba_ssn_support,
5065 	wmi_service_filter_ipsec_natkeepalive,
5066 	wmi_service_wlan_hb,
5067 	wmi_service_lte_ant_share_support,
5068 	wmi_service_batch_scan,
5069 	wmi_service_qpower,
5070 	wmi_service_plmreq,
5071 	wmi_service_thermal_mgmt,
5072 	wmi_service_rmc,
5073 	wmi_service_mhf_offload,
5074 	wmi_service_coex_sar,
5075 	wmi_service_bcn_txrate_override,
5076 	wmi_service_nan,
5077 	wmi_service_l1ss_stat,
5078 	wmi_service_estimate_linkspeed,
5079 	wmi_service_obss_scan,
5080 	wmi_service_tdls_offchan,
5081 	wmi_service_tdls_uapsd_buffer_sta,
5082 	wmi_service_tdls_uapsd_sleep_sta,
5083 	wmi_service_ibss_pwrsave,
5084 	wmi_service_lpass,
5085 	wmi_service_extscan,
5086 	wmi_service_d0wow,
5087 	wmi_service_hsoffload,
5088 	wmi_service_roam_ho_offload,
5089 	wmi_service_rx_full_reorder,
5090 	wmi_service_dhcp_offload,
5091 	wmi_service_sta_rx_ipa_offload_support,
5092 	wmi_service_mdns_offload,
5093 	wmi_service_sap_auth_offload,
5094 	wmi_service_dual_band_simultaneous_support,
5095 	wmi_service_ocb,
5096 	wmi_service_ap_arpns_offload,
5097 	wmi_service_per_band_chainmask_support,
5098 	wmi_service_packet_filter_offload,
5099 	wmi_service_mgmt_tx_htt,
5100 	wmi_service_mgmt_tx_wmi,
5101 	wmi_service_ext_msg,
5102 	wmi_service_mawc,
5103 
5104 	wmi_service_peer_stats,
5105 	wmi_service_mesh_11s,
5106 	wmi_service_periodic_chan_stat_support,
5107 	wmi_service_tx_mode_push_only,
5108 	wmi_service_tx_mode_push_pull,
5109 	wmi_service_tx_mode_dynamic,
5110 	wmi_service_check_cal_version,
5111 	wmi_service_btcoex_duty_cycle,
5112 	wmi_service_4_wire_coex_support,
5113 	wmi_service_multiple_vdev_restart,
5114 	wmi_service_peer_assoc_conf,
5115 	wmi_service_egap,
5116 	wmi_service_sta_pmf_offload,
5117 	wmi_service_unified_wow_capability,
5118 	wmi_service_enterprise_mesh,
5119 	wmi_service_apf_offload,
5120 	wmi_service_sync_delete_cmds,
5121 	wmi_service_ratectrl_limit_max_min_rates,
5122 	wmi_service_nan_data,
5123 	wmi_service_nan_rtt,
5124 	wmi_service_11ax,
5125 	wmi_service_deprecated_replace,
5126 	wmi_service_tdls_conn_tracker_in_host_mode,
5127 	wmi_service_enhanced_mcast_filter,
5128 	wmi_service_half_rate_quarter_rate_support,
5129 	wmi_service_vdev_rx_filter,
5130 	wmi_service_p2p_listen_offload_support,
5131 	wmi_service_mark_first_wakeup_packet,
5132 	wmi_service_multiple_mcast_filter_set,
5133 	wmi_service_host_managed_rx_reorder,
5134 	wmi_service_flash_rdwr_support,
5135 	wmi_service_wlan_stats_report,
5136 	wmi_service_tx_msdu_id_new_partition_support,
5137 	wmi_service_dfs_phyerr_offload,
5138 	wmi_service_rcpi_support,
5139 	wmi_service_fw_mem_dump_support,
5140 	wmi_service_peer_stats_info,
5141 	wmi_service_regulatory_db,
5142 	wmi_service_11d_offload,
5143 	wmi_service_hw_data_filtering,
5144 	wmi_service_pkt_routing,
5145 	wmi_service_offchan_tx_wmi,
5146 	wmi_service_chan_load_info,
5147 	wmi_service_extended_nss_support,
5148 	wmi_service_ack_timeout,
5149 	wmi_service_widebw_scan,
5150 	wmi_service_bcn_offload_start_stop_support,
5151 	wmi_service_offchan_data_tid_support,
5152 	wmi_service_support_dma,
5153 	wmi_service_8ss_tx_bfee,
5154 	wmi_service_fils_support,
5155 	wmi_service_mawc_support,
5156 	wmi_service_wow_wakeup_by_timer_pattern,
5157 	wmi_service_11k_neighbour_report_support,
5158 	wmi_service_ap_obss_detection_offload,
5159 	wmi_service_bss_color_offload,
5160 	wmi_service_gmac_offload_support,
5161 	wmi_service_host_dfs_check_support,
5162 	wmi_service_dual_beacon_on_single_mac_scc_support,
5163 	wmi_service_dual_beacon_on_single_mac_mcc_support,
5164 	wmi_service_twt_requestor,
5165 	wmi_service_twt_responder,
5166 	wmi_service_listen_interval_offload_support,
5167 
5168 #ifdef OL_ATH_SMART_LOGGING
5169 	wmi_service_smart_logging_support,
5170 #endif
5171 	wmi_service_infra_mbssid,
5172 	wmi_service_esp_support,
5173 	wmi_service_obss_spatial_reuse,
5174 	wmi_service_per_vdev_chain_support,
5175 	wmi_service_new_htt_msg_format,
5176 	wmi_service_peer_unmap_cnf_support,
5177 	wmi_service_beacon_reception_stats,
5178 	wmi_service_vdev_latency_config,
5179 	wmi_service_nan_dbs_support,
5180 	wmi_service_ndi_dbs_support,
5181 	wmi_service_nan_sap_support,
5182 	wmi_service_ndi_sap_support,
5183 	wmi_service_nan_disable_support,
5184 	wmi_service_hw_db2dbm_support,
5185 	wmi_services_max,
5186 } wmi_conv_service_ids;
5187 #define WMI_SERVICE_UNAVAILABLE 0xFFFF
5188 
5189 /**
5190  * enum WMI_DBG_PARAM - Debug params
5191  * @WMI_DBGLOG_LOG_LEVEL: Set the loglevel
5192  * @WMI_DBGLOG_VAP_ENABLE:  Enable VAP level debug
5193  * @WMI_DBGLOG_VAP_DISABLE: Disable VAP level debug
5194  * @WMI_DBGLOG_MODULE_ENABLE: Enable MODULE level debug
5195  * @WMI_DBGLOG_MODULE_DISABLE: Disable MODULE level debug
5196  * @WMI_DBGLOG_MOD_LOG_LEVEL: Enable MODULE level debug
5197  * @WMI_DBGLOG_TYPE: set type of the debug output
5198  * @WMI_DBGLOG_REPORT_ENABLE: Enable Disable debug
5199  */
5200 typedef enum {
5201 	WMI_DBGLOG_LOG_LEVEL = 0x1,
5202 	WMI_DBGLOG_VAP_ENABLE,
5203 	WMI_DBGLOG_VAP_DISABLE,
5204 	WMI_DBGLOG_MODULE_ENABLE,
5205 	WMI_DBGLOG_MODULE_DISABLE,
5206 	WMI_DBGLOG_MOD_LOG_LEVEL,
5207 	WMI_DBGLOG_TYPE,
5208 	WMI_DBGLOG_REPORT_ENABLE
5209 } WMI_DBG_PARAM;
5210 
5211 /**
5212  * struct wmi_host_fw_ver - FW version in non-tlv target
5213  * @sw_version: Versin info
5214  * @sw_version_1: Second dword of version
5215  */
5216 struct wmi_host_fw_ver {
5217 	uint32_t    sw_version;
5218 	uint32_t    sw_version_1;
5219 };
5220 
5221 /**
5222  * struct wmi_host_fw_abi_ver - FW version in non-tlv target
5223  * @sw_version: Versin info
5224  * @abi_version: ABI version
5225  */
5226 struct wmi_host_fw_abi_ver {
5227 	uint32_t    sw_version;
5228 	uint32_t    abi_version;
5229 };
5230 
5231 /**
5232  * struct target_resource_config - Resource config sent from host to target
5233  *               abstracted out to include union of both configs
5234  * @num_vdevs: Number vdevs configured
5235  * @num_peers: Number of peers
5236  * @num_active_peers: Number of active peers for peer cache
5237  * @num_offload_peers: Number of offload peers
5238  * @num_offload_reorder_buffs: number of offload reorder buffs
5239  * @num_peer_keys: number of peer keys
5240  * @num_tids: number of tids
5241  * @ast_skid_limit: AST skid limit
5242  * @tx_chain_mask: TX chain mask
5243  * @rx_chain_mask: RX chain mask
5244  * @rx_timeout_pri: RX reorder timeout per AC
5245  * @rx_decap_mode: RX decap mode
5246  * @scan_max_pending_req: Scan mac pending req
5247  * @bmiss_offload_max_vdev: Beacom miss offload max vdevs
5248  * @roam_offload_max_vdev: Roam offload max vdevs
5249  * @roam_offload_max_ap_profiles: roam offload max ap profiles
5250  * @num_mcast_groups: num mcast groups
5251  * @num_mcast_table_elems: number of macst table elems
5252  * @mcast2ucast_mode: mcast enhance mode
5253  * @tx_dbg_log_size: DBG log buf size
5254  * @num_wds_entries: number of WDS entries
5255  * @dma_burst_size: DMA burst size.
5256  * @mac_aggr_delim: Mac aggr delim
5257  * @rx_skip_defrag_timeout_dup_detection_check: Defrag dup check in host?
5258  * @vow_config: vow configuration
5259  * @gtk_offload_max_vdev: Max vdevs for GTK offload
5260  * @num_msdu_desc: Number of msdu desc
5261  * @max_frag_entries: Max frag entries
5262  *      End common
5263  * @max_peer_ext_stats: Max peer EXT stats
5264  * @smart_ant_cap: Smart antenna capabilities
5265  * @BK_Minfree: BIN configuration for BK traffic
5266  * @BE_Minfree: BIN configuration for BE traffic
5267  * @VI_Minfree: BIN configuration for VI traffic
5268  * @VO_Minfree: BIN configuration for VO traffic
5269  * @rx_batchmode: RX batch mode
5270  * @tt_support: Thermal throttling support
5271  * @atf_config: ATF config
5272  * @mgmt_comp_evt_bundle_support: bundle support required for mgmt complete evt
5273  * @tx_msdu_new_partition_id_support: new partiition id support for tx msdu
5274  * @peer_unmap_conf_support: peer unmap conf support in fw
5275  * @iphdr_pad_config: ipheader pad config
5276  * @qwrap_config: Qwrap configuration
5277  * @alloc_frag_desc_for_data_pkt: Frag desc for data
5278  *      Added in MCL
5279  * @num_tdls_vdevs:
5280  * @num_tdls_conn_table_entries:
5281  * @beacon_tx_offload_max_vdev:
5282  * @num_multicast_filter_entries:
5283  * @num_wow_filters:
5284  * @num_keep_alive_pattern:
5285  * @keep_alive_pattern_size:
5286  * @max_tdls_concurrent_sleep_sta:
5287  * @max_tdls_concurrent_buffer_sta:
5288  * @wmi_send_separate:
5289  * @num_ocb_vdevs:
5290  * @num_ocb_channels:
5291  * @num_ocb_schedules:
5292  * @num_packet_filters: maximum number of packet filter rules to support
5293  * @num_max_sta_vdevs: maximum number of concurrent station vdevs to support
5294  * @num_ns_ext_tuples_cfg:
5295  * @apf_instruction_size:
5296  * @max_bssid_rx_filters:
5297  * @use_pdev_id:
5298  * @max_num_dbs_scan_duty_cycle: max dbs can duty cycle value
5299  * @cce_disable: disable cce component
5300  * @peer_map_unmap_v2: enable peer map/unmap version 2 messaging
5301  * @twt_ap_pdev_count: Number of MAC on which AP TWT feature is supported
5302  * @twt_ap_sta_count: Max no of STA with which TWT sessions can be formed
5303  *                    by the AP
5304  * @max_bssid_indicator: max number of MBSS VAPs
5305  */
5306 typedef struct {
5307 	uint32_t num_vdevs;
5308 	uint32_t num_peers;
5309 	uint32_t num_active_peers;
5310 	uint32_t num_offload_peers;
5311 	uint32_t num_offload_reorder_buffs;
5312 	uint32_t num_peer_keys;
5313 	uint32_t num_tids;
5314 	uint32_t ast_skid_limit;
5315 	uint32_t tx_chain_mask;
5316 	uint32_t rx_chain_mask;
5317 	uint32_t rx_timeout_pri[4];
5318 	uint32_t rx_decap_mode;
5319 	uint32_t scan_max_pending_req;
5320 	uint32_t bmiss_offload_max_vdev;
5321 	uint32_t roam_offload_max_vdev;
5322 	uint32_t roam_offload_max_ap_profiles;
5323 	uint32_t num_mcast_groups;
5324 	uint32_t num_mcast_table_elems;
5325 	uint32_t mcast2ucast_mode;
5326 	uint32_t tx_dbg_log_size;
5327 	uint32_t num_wds_entries;
5328 	uint32_t dma_burst_size;
5329 	uint32_t mac_aggr_delim;
5330 	uint32_t rx_skip_defrag_timeout_dup_detection_check;
5331 	uint32_t vow_config;
5332 	uint32_t gtk_offload_max_vdev;
5333 	uint32_t num_msdu_desc; /* Number of msdu desc */
5334 	uint32_t max_frag_entries;
5335 	uint32_t scheduler_params;
5336 	/* End common */
5337 
5338 	/* Added for Beeliner */
5339 	uint32_t max_peer_ext_stats;
5340 	uint32_t smart_ant_cap;
5341 	uint32_t BK_Minfree;
5342 	uint32_t BE_Minfree;
5343 	uint32_t VI_Minfree;
5344 	uint32_t VO_Minfree;
5345 	uint32_t rx_batchmode;
5346 	uint32_t tt_support;
5347 	uint32_t atf_config:1,
5348 		 mgmt_comp_evt_bundle_support:1,
5349 		 tx_msdu_new_partition_id_support:1,
5350 		 new_htt_msg_format:1,
5351 		 peer_unmap_conf_support:1;
5352 	uint32_t iphdr_pad_config;
5353 	uint32_t
5354 		qwrap_config:16,
5355 		alloc_frag_desc_for_data_pkt:16;
5356 
5357 	/* Added in MCL */
5358 	uint32_t num_tdls_vdevs;
5359 	uint32_t num_tdls_conn_table_entries;
5360 	uint32_t beacon_tx_offload_max_vdev;
5361 	uint32_t num_multicast_filter_entries;
5362 	uint32_t num_wow_filters;
5363 	uint32_t num_keep_alive_pattern;
5364 	uint32_t keep_alive_pattern_size;
5365 	uint32_t max_tdls_concurrent_sleep_sta;
5366 	uint32_t max_tdls_concurrent_buffer_sta;
5367 	uint32_t wmi_send_separate;
5368 	uint32_t num_ocb_vdevs;
5369 	uint32_t num_ocb_channels;
5370 	uint32_t num_ocb_schedules;
5371 	uint32_t num_packet_filters;
5372 	uint32_t num_max_sta_vdevs;
5373 	uint32_t num_ns_ext_tuples_cfg;
5374 	uint32_t apf_instruction_size;
5375 	uint32_t max_bssid_rx_filters;
5376 	uint32_t use_pdev_id;
5377 	uint32_t max_num_dbs_scan_duty_cycle;
5378 	bool cce_disable;
5379 	bool peer_map_unmap_v2;
5380 	uint32_t twt_ap_pdev_count;
5381 	uint32_t twt_ap_sta_count;
5382 	uint32_t max_bssid_indicator;
5383 	uint32_t eapol_minrate_set:1,
5384 		 eapol_minrate_ac_set:2;
5385 } target_resource_config;
5386 
5387 /**
5388  * struct wds_addr_event - WDS addr event structure
5389  * @event_type: event type add/delete
5390  * @peer_mac: peer mac
5391  * @dest_mac: destination mac address
5392  * @vdev_id: vdev id
5393  */
5394 typedef struct {
5395 	uint32_t event_type[4];
5396 	u_int8_t peer_mac[IEEE80211_ADDR_LEN];
5397 	u_int8_t dest_mac[IEEE80211_ADDR_LEN];
5398 	uint32_t vdev_id;
5399 } wds_addr_event_t;
5400 /**
5401  * Enum replicated for host abstraction with FW
5402  */
5403 typedef enum {
5404 	/* Event respose of START CMD */
5405 	WMI_HOST_VDEV_START_RESP_EVENT = 0,
5406 	/* Event respose of RESTART CMD */
5407 	WMI_HOST_VDEV_RESTART_RESP_EVENT,
5408 } WMI_HOST_START_EVENT_PARAM;
5409 
5410 /**
5411  * struct wmi_host_vdev_start_resp - VDEV start response
5412  * @vdev_id: vdev id
5413  * @requestor_id: requestor id that requested the VDEV start request
5414  * @resp_type: Respose of Event type START/RESTART
5415  * @status: status of the response
5416  * @chain_mask: Vdev chain mask
5417  * @smps_mode: Vdev mimo power save mode
5418  * @mac_id: mac_id field contains the MAC identifier that the
5419  *          VDEV is bound to. The valid range is 0 to (num_macs-1).
5420  * @cfgd_tx_streams: Configured Transmit Streams
5421  * @cfgd_rx_streams: Configured Receive Streams
5422  */
5423 typedef struct {
5424 	uint32_t vdev_id;
5425 	uint32_t requestor_id;
5426 	WMI_HOST_START_EVENT_PARAM resp_type;
5427 	uint32_t status;
5428 	uint32_t chain_mask;
5429 	uint32_t smps_mode;
5430 	uint32_t mac_id;
5431 	uint32_t cfgd_tx_streams;
5432 	uint32_t cfgd_rx_streams;
5433 } wmi_host_vdev_start_resp;
5434 
5435 /**
5436  * struct wmi_host_vdev_delete_resp - VDEV delete response
5437  * @vdev_id: vdev id
5438  */
5439 struct wmi_host_vdev_delete_resp {
5440 	uint32_t vdev_id;
5441 };
5442 
5443 /**
5444  * struct wmi_host_roam_event - host roam event param
5445  * @vdev_id: vdev id
5446  * @reason: roam reason
5447  * @rssi: RSSI
5448  */
5449 typedef struct {
5450 	uint32_t vdev_id;
5451 	uint32_t reason;
5452 	uint32_t rssi;
5453 } wmi_host_roam_event;
5454 
5455 /**
5456  * ENUM wmi_host_scan_event_type - Scan event type
5457  */
5458 enum wmi_host_scan_event_type {
5459 	WMI_HOST_SCAN_EVENT_STARTED = 0x1,
5460 	WMI_HOST_SCAN_EVENT_COMPLETED = 0x2,
5461 	WMI_HOST_SCAN_EVENT_BSS_CHANNEL = 0x4,
5462 	WMI_HOST_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
5463 	WMI_HOST_SCAN_EVENT_DEQUEUED = 0x10,
5464 	WMI_HOST_SCAN_EVENT_PREEMPTED = 0x20,
5465 	WMI_HOST_SCAN_EVENT_START_FAILED = 0x40,
5466 	WMI_HOST_SCAN_EVENT_RESTARTED = 0x80,
5467 	WMI_HOST_SCAN_EVENT_FOREIGN_CHANNEL_EXIT = 0x100,
5468 	WMI_HOST_SCAN_EVENT_INVALID = 0x200,
5469 	WMI_HOST_SCAN_EVENT_GPIO_TIMEOUT = 0x400,
5470 	WMI_HOST_SCAN_EVENT_MAX = 0x8000
5471 };
5472 
5473 /**
5474  * ENUM wmi_host_scan_completion_reason - Scan completion event type
5475  */
5476 enum wmi_host_scan_completion_reason {
5477 	/** scan related events */
5478 	WMI_HOST_SCAN_REASON_NONE = 0xFF,
5479 	WMI_HOST_SCAN_REASON_COMPLETED = 0,
5480 	WMI_HOST_SCAN_REASON_CANCELLED = 1,
5481 	WMI_HOST_SCAN_REASON_PREEMPTED = 2,
5482 	WMI_HOST_SCAN_REASON_TIMEDOUT = 3,
5483 	WMI_HOST_SCAN_REASON_INTERNAL_FAILURE = 4,
5484 	WMI_HOST_SCAN_REASON_MAX,
5485 };
5486 
5487 /**
5488  * struct wmi_host_scan_event - Scan event response from target
5489  * @event: event type
5490  * @reason: Reason for event
5491  * @channel_freq: channel frequency
5492  * @requestor: requestor id
5493  * @scan_id: scan id
5494  * @vdev_id: vdev id
5495  */
5496 typedef struct {
5497 	uint32_t event;
5498 	uint32_t reason;
5499 	uint32_t channel_freq;
5500 	uint32_t requestor;
5501 	uint32_t scan_id;
5502 	uint32_t vdev_id;
5503 } wmi_host_scan_event;
5504 
5505 /**
5506  * struct wmi_host_pdev_reserve_ast_entry_event - Reserve AST entry
5507  * @result: result
5508  */
5509 typedef struct {
5510 	uint32_t result;
5511 } wmi_host_pdev_reserve_ast_entry_event;
5512 
5513 /**
5514  * struct wmi_host_mcast_ageout_entry - mcast aged-out entry
5515  * @grp_addr: IPv4/6 mcast group addr
5516  * @vdev_id: vdev id
5517  */
5518 typedef struct {
5519 	uint8_t grp_addr[16];
5520 	uint32_t vdev_id;
5521 } wmi_host_mcast_ageout_entry;
5522 
5523 /**
5524  * struct wmi_host_mcast_list_ageout_event - List of mcast entry aged-out
5525  * @num_entry: Number of mcast entries timed-out
5526  * @entry: List of wmi_host_mcast_ageout_entry
5527  */
5528 typedef struct {
5529 	uint32_t num_entry;
5530 	wmi_host_mcast_ageout_entry entry[1];
5531 } wmi_host_mcast_list_ageout_event;
5532 
5533 /**
5534  * struct wmi_host_pdev_nfcal_power_all_channels_event - NF cal event data
5535  * @nfdbr:
5536  *   chan[0 ~ 7]: {NFCalPower_chain0, NFCalPower_chain1,
5537  *                 NFCalPower_chain2, NFCalPower_chain3,
5538  *                 NFCalPower_chain4, NFCalPower_chain5,
5539  *                 NFCalPower_chain6, NFCalPower_chain7},
5540  * @nfdbm:
5541  *   chan[0 ~ 7]: {NFCalPower_chain0, NFCalPower_chain1,
5542  *                 NFCalPower_chain2, NFCalPower_chain3,
5543  *                 NFCalPower_chain4, NFCalPower_chain5,
5544  *                 NFCalPower_chain6, NFCalPower_chain7},
5545  * @freqnum:
5546  *   chan[0 ~ 7]: frequency number
5547  * @pdev_id: pdev_id
5548  */
5549 typedef struct {
5550 	int8_t nfdbr[WMI_HOST_RXG_CAL_CHAN_MAX * WMI_HOST_MAX_NUM_CHAINS];
5551 	int8_t nfdbm[WMI_HOST_RXG_CAL_CHAN_MAX * WMI_HOST_MAX_NUM_CHAINS];
5552 	uint32_t freqnum[WMI_HOST_RXG_CAL_CHAN_MAX];
5553 	uint32_t pdev_id;
5554 } wmi_host_pdev_nfcal_power_all_channels_event;
5555 
5556 /**
5557  * enum wmi_host_pdev_tpc_event_offset: offsets of TPC events
5558  * @WMI_HOST_TX_POWER_MAX: offset of max tx power
5559  * @WMI_HOST_TX_POWER_MIN: offset of min tx power
5560  * @WMI_HOST_TX_POWER_LEN: size of tpc values
5561  */
5562 enum wmi_host_pdev_tpc_event_offset {
5563 	WMI_HOST_TX_POWER_MAX,
5564 	WMI_HOST_TX_POWER_MIN,
5565 	WMI_HOST_TX_POWER_LEN,
5566 };
5567 
5568 /**
5569  * struct wmi_host_pdev_tpc_event - WMI host pdev TPC event
5570  * @pdev_id: pdev_id
5571  * @tpc:
5572  */
5573 typedef struct {
5574 	uint32_t pdev_id;
5575 	int32_t tpc[WMI_HOST_TX_POWER_LEN];
5576 } wmi_host_pdev_tpc_event;
5577 
5578 /**
5579  * struct wmi_host_pdev_generic_buffer_event
5580  * @buf_type: Buffer type
5581  * @frag_id: Frag id
5582  * @more_frag: more frags pending
5583  * @buf_len: buffer length
5584  * @buf_info: variable length buffer
5585  */
5586 typedef struct {
5587 	uint32_t buf_type;
5588 	uint32_t frag_id;
5589 	uint32_t more_frag;
5590 	uint32_t buf_len;
5591 	uint32_t buf_info[1];
5592 } wmi_host_pdev_generic_buffer_event;
5593 /**
5594  * Enum for host buffer event
5595  */
5596 enum {
5597 	WMI_HOST_BUFFER_TYPE_RATEPWR_TABLE,
5598 	WMI_HOST_BUFFER_TYPE_CTL_TABLE,
5599 };
5600 
5601 /**
5602  * struct wmi_host_pdev_tpc_config_event - host pdev tpc config event
5603  * @pdev_id: pdev_id
5604  * @regDomain:
5605  * @chanFreq:
5606  * @phyMode:
5607  * @twiceAntennaReduction:
5608  * @twiceMaxRDPower:
5609  * @twiceAntennaGain:
5610  * @powerLimit:
5611  * @rateMax:
5612  * @numTxChain:
5613  * @ctl:
5614  * @flags:
5615  * @maxRegAllowedPower:
5616  * @maxRegAllowedPowerAGCDD:
5617  * @maxRegAllowedPowerAGSTBC:
5618  * @maxRegAllowedPowerAGTXBF:
5619  * @ratesArray:
5620  */
5621 typedef struct {
5622 	uint32_t pdev_id;
5623 	uint32_t regDomain;
5624 	uint32_t chanFreq;
5625 	uint32_t phyMode;
5626 	uint32_t twiceAntennaReduction;
5627 	uint32_t twiceMaxRDPower;
5628 	int32_t  twiceAntennaGain;
5629 	uint32_t powerLimit;
5630 	uint32_t rateMax;
5631 	uint32_t numTxChain;
5632 	uint32_t ctl;
5633 	uint32_t flags;
5634 	int8_t  maxRegAllowedPower[WMI_HOST_TPC_TX_NUM_CHAIN];
5635 	int8_t  maxRegAllowedPowerAGCDD[WMI_HOST_TPC_TX_NUM_CHAIN][WMI_HOST_TPC_TX_NUM_CHAIN];
5636 	int8_t  maxRegAllowedPowerAGSTBC[WMI_HOST_TPC_TX_NUM_CHAIN][WMI_HOST_TPC_TX_NUM_CHAIN];
5637 	int8_t  maxRegAllowedPowerAGTXBF[WMI_HOST_TPC_TX_NUM_CHAIN][WMI_HOST_TPC_TX_NUM_CHAIN];
5638 	uint8_t ratesArray[WMI_HOST_TPC_RATE_MAX];
5639 } wmi_host_pdev_tpc_config_event;
5640 /**
5641  * Enums for TPC event
5642  */
5643 typedef enum {
5644 	WMI_HOST_TPC_CONFIG_EVENT_FLAG_TABLE_CDD	= 0x1,
5645 	WMI_HOST_TPC_CONFIG_EVENT_FLAG_TABLE_STBC	= 0x2,
5646 	WMI_HOST_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF	= 0x4,
5647 } WMI_HOST_TPC_CONFIG_EVENT_FLAG;
5648 
5649 /**
5650  * Medium Utilization evaluation algorithms
5651  * These algorithms can be complementary rather than exclusive.
5652  */
5653 typedef enum {
5654 	WMI_HOST_MU_BASIC_ALGO = 0x1,
5655 	WMI_HOST_MU_PER_BSSID_ALGO = 0x2,
5656 	WMI_HOST_MU_HIDDEN_NODE_ALGO = 0x4,
5657 } WMI_HOST_MU_ALGO_TYPE;
5658 /* max MU alg combinations supported by target */
5659 #define WMI_HOST_MU_MAX_ALGO_TYPE 3
5660 
5661 /**
5662  * struct wmi_host_mu_db_entry
5663  * @event_type: 0=AP, 1=STA, 2=Small Cell(SC)
5664  * @bssid_mac_addr: Transmitter MAC if entry is WiFi node. PLMNID if SC
5665  * @tx_addr: Transmitter MAC if entry is WiFi node. PLMNID if SC
5666  * @avg_duration_us: Avg. duration for which node was transmitting
5667  * @avg_rssi: Avg. RSSI of all TX packets by node. Unit dBm
5668  * @mu_percent: % medium utilization by node
5669  */
5670 typedef struct {
5671 	uint32_t     entry_type;
5672 	wmi_host_mac_addr bssid_mac_addr;
5673 	wmi_host_mac_addr tx_addr;
5674 	uint32_t     avg_duration_us;
5675 	uint32_t     avg_rssi;
5676 	uint32_t     mu_percent;
5677 } wmi_host_mu_db_entry;
5678 
5679 /**
5680  * struct wmi_host_mu_report_event - WMI_MU_REPORT_EVENTID
5681  * @mu_request_id: request id
5682  * @status_reason: MU_STATUS_REASON
5683  * @total_mu: MU_ALG_TYPE combinations
5684  * @num_active_bssid: number of active bssid
5685  * @hidden_node_mu : hidden node algo MU per bin
5686  * @num_TA_entries : No. of entries found in MU db report
5687  */
5688 typedef struct {
5689 	uint32_t mu_request_id;
5690 	uint32_t status_reason;
5691 	uint32_t total_mu[WMI_HOST_MU_MAX_ALGO_TYPE];
5692 	uint32_t num_active_bssid;
5693 	uint32_t hidden_node_mu[LTEU_MAX_BINS];
5694 	uint32_t num_TA_entries;
5695 } wmi_host_mu_report_event;
5696 
5697 /**
5698  * struct wmi_host_mgmt_tx_compl_event - TX completion event
5699  * @desc_id: from tx_send_cmd
5700  * @status: WMI_MGMT_TX_COMP_STATUS_TYPE
5701  * @pdev_id: pdev_id
5702  * @ppdu_id: ppdu_id
5703  */
5704 typedef struct {
5705 	uint32_t	desc_id;
5706 	uint32_t	status;
5707 	uint32_t	pdev_id;
5708 	uint32_t        ppdu_id;
5709 } wmi_host_mgmt_tx_compl_event;
5710 
5711 /**
5712  * struct wmi_host_offchan_data_tx_compl_event - TX completion event
5713  * @desc_id: from tx_send_cmd
5714  * @status: VWMI_MGMT_TX_COMP_STATUS_TYPE
5715  * @pdev_id: pdev_id
5716  */
5717 struct wmi_host_offchan_data_tx_compl_event {
5718 	uint32_t desc_id;
5719 	uint32_t status;
5720 	uint32_t pdev_id;
5721 };
5722 
5723 #define WMI_HOST_TIM_BITMAP_ARRAY_SIZE 17
5724 
5725 /**
5726  * struct wmi_host_tim_info - TIM info in SWBA event
5727  * @tim_len: TIM length
5728  * @tim_mcast:
5729  * @tim_bitmap: TIM bitmap
5730  * @tim_changed: TIM changed
5731  * @tim_num_ps_pending: TIM num PS sta pending
5732  * @vdev_id: Vdev id
5733  */
5734 typedef struct {
5735 	uint32_t tim_len;
5736 	uint32_t tim_mcast;
5737 	uint32_t tim_bitmap[WMI_HOST_TIM_BITMAP_ARRAY_SIZE];
5738 	uint32_t tim_changed;
5739 	uint32_t tim_num_ps_pending;
5740 	uint32_t vdev_id;
5741 } wmi_host_tim_info;
5742 
5743 /**
5744  * struct wmi_host_p2p_noa_descriptor - NoA desc in SWBA event
5745  * @type_count: Absence count
5746  * @duration: NoA duration
5747  * @interval: NoA interval
5748  * @start_time: start time
5749  */
5750 typedef struct {
5751 	uint32_t type_count;
5752 	uint32_t duration;
5753 	uint32_t interval;
5754 	uint32_t start_time;
5755 } wmi_host_p2p_noa_descriptor;
5756 /* Maximum number of NOA Descriptors supported */
5757 #define WMI_HOST_P2P_MAX_NOA_DESCRIPTORS 4
5758 /**
5759  * struct wmi_host_p2p_noa_info - p2p noa information
5760  * @modified: NoA modified
5761  * @index: Index
5762  * @oppPS: Oppurtunstic ps
5763  * @ctwindow: CT window
5764  * @num_descriptors: number of descriptors
5765  * @noa_descriptors: noa descriptors
5766  * @vdev_id: Vdev id
5767  */
5768 typedef struct {
5769 	uint8_t modified;
5770 	uint8_t index;
5771 	uint8_t oppPS;
5772 	uint8_t ctwindow;
5773 	uint8_t num_descriptors;
5774 	wmi_host_p2p_noa_descriptor
5775 		noa_descriptors[WMI_HOST_P2P_MAX_NOA_DESCRIPTORS];
5776 	uint32_t vdev_id;
5777 } wmi_host_p2p_noa_info;
5778 
5779 /**
5780  * struct wmi_host_peer_sta_kickout_event
5781  * @peer_macaddr: peer mac address
5782  * @reason: kickout reason
5783  * @rssi: rssi
5784  * @pdev_id: pdev_id
5785  */
5786 typedef struct {
5787 	uint8_t peer_macaddr[IEEE80211_ADDR_LEN];
5788 	uint32_t reason;
5789 	uint32_t rssi;
5790 } wmi_host_peer_sta_kickout_event;
5791 
5792 /**
5793  * struct wmi_host_peer_sta_ps_statechange_event - ST ps state change event
5794  * @peer_macaddr: peer mac address
5795  * @peer_ps_stats: peer PS state
5796  * @pdev_id: pdev_id
5797  */
5798 typedef struct {
5799 	uint8_t peer_macaddr[IEEE80211_ADDR_LEN];
5800 	uint32_t peer_ps_state;
5801 } wmi_host_peer_sta_ps_statechange_event;
5802 
5803 /* Maximum CCK, OFDM rates supported */
5804 #define WMI_SA_MAX_CCK_OFDM_RATES 12
5805 /* Maximum MCS rates supported; 4 rates in each dword */
5806 #define WMI_SA_MAX_MCS_RATES 40
5807 #define WMI_SA_MAX_RATE_COUNTERS 4
5808 /* Maximum rate series used for transmission */
5809 #define SA_MAX_RATE_SERIES 2
5810 
5811 #define SA_MAX_LEGACY_RATE_DWORDS 3
5812 #define SA_MAX_HT_RATE_DWORDS 10
5813 #define SA_BYTES_IN_DWORD 4
5814 #define SA_MASK_BYTE 0xff
5815 /* TODO: ratecode_160 needs to add for future chips */
5816 /**
5817  * struct wmi_sa_rate_cap - smart antenna rat capabilities
5818  * @pdev_id: pdev_id
5819  * @ratecode_legacy: Rate code array for CCK OFDM
5820  * @ratecode_20: Rate code array for 20MHz BW
5821  * @ratecode_40: Rate code array for 40MHz BW
5822  * @ratecode_80: Rate code array for 80MHz BW
5823  * @ratecount: Max Rate count for each mode
5824  */
5825 typedef struct {
5826 	uint8_t ratecode_legacy[WMI_SA_MAX_CCK_OFDM_RATES];
5827 	uint8_t ratecode_20[WMI_SA_MAX_MCS_RATES];
5828 	uint8_t ratecode_40[WMI_SA_MAX_MCS_RATES];
5829 	uint8_t ratecode_80[WMI_SA_MAX_MCS_RATES];
5830 	uint8_t ratecount[WMI_SA_MAX_RATE_COUNTERS];
5831 } wmi_sa_rate_cap;
5832 
5833 /** Preamble types to be used with VDEV fixed rate configuration */
5834 typedef enum {
5835 	WMI_HOST_RATE_PREAMBLE_OFDM,
5836 	WMI_HOST_RATE_PREAMBLE_CCK,
5837 	WMI_HOST_RATE_PREAMBLE_HT,
5838 	WMI_HOST_RATE_PREAMBLE_VHT,
5839 	WMI_HOST_RATE_PREAMBLE_HE,
5840 } WMI_HOST_RATE_PREAMBLE;
5841 
5842 #define WMI_HOST_FIXED_RATE_NONE	(0xff)
5843 
5844 /** slot time long */
5845 #define WMI_HOST_VDEV_SLOT_TIME_LONG	0x1
5846 /** slot time short */
5847 #define WMI_HOST_VDEV_SLOT_TIME_SHORT	0x2
5848 /** preablbe long */
5849 #define WMI_HOST_VDEV_PREAMBLE_LONG	0x1
5850 /** preablbe short */
5851 #define WMI_HOST_VDEV_PREAMBLE_SHORT	0x2
5852 /** found a better AP */
5853 #define WMI_HOST_ROAM_REASON_BETTER_AP  0x1
5854 /** beacon miss detected */
5855 #define WMI_HOST_ROAM_REASON_BMISS	0x2
5856 /** deauth/disassoc received */
5857 #define WMI_HOST_ROAM_REASON_DEAUTH	0x2
5858 /** connected AP's low rssi condition detected */
5859 #define WMI_HOST_ROAM_REASON_LOW_RSSI  0x3
5860 /** found another AP that matches SSID and Security profile in
5861  * WMI_ROAM_AP_PROFILE, found during scan triggered upon FINAL_BMISS
5862  */
5863 #define WMI_HOST_ROAM_REASON_SUITABLE_AP 0x4
5864 /** LFR3.0 roaming failed, indicate the disconnection to host */
5865 #define WMI_HOST_ROAM_REASON_HO_FAILED  0x5
5866 
5867 /** values for vdev_type */
5868 #define WMI_HOST_VDEV_TYPE_AP	0x1
5869 #define WMI_HOST_VDEV_TYPE_STA	0x2
5870 #define WMI_HOST_VDEV_TYPE_IBSS	0x3
5871 #define WMI_HOST_VDEV_TYPE_MONITOR	0x4
5872 
5873 /** values for vdev_subtype */
5874 #define WMI_HOST_VDEV_SUBTYPE_P2P_DEVICE 0x1
5875 #define WMI_HOST_VDEV_SUBTYPE_P2P_CLIENT 0x2
5876 #define WMI_HOST_VDEV_SUBTYPE_P2P_GO	0x3
5877 #define WMI_HOST_VDEV_SUBTYPE_PROXY_STA  0x4
5878 #define WMI_HOST_VDEV_SUBTYPE_MESH	0x5
5879 
5880 #define WMI_HOST_MGMT_TID	17
5881 /* Disable aging & learning */
5882 #define WMI_HOST_WDS_FLAG_STATIC	0x1
5883 
5884 /**
5885  * Peer param enum abstracted from target
5886  */
5887 typedef enum {
5888 	/** mimo powersave state */
5889 	WMI_HOST_PEER_MIMO_PS_STATE = 0x1,
5890 	/** enable/disable AMPDU . initial value (enabled) */
5891 	WMI_HOST_PEER_AMPDU = 0x2,
5892 	/** authorize/unauthorize peer. initial value is unauthorized (0)  */
5893 	WMI_HOST_PEER_AUTHORIZE = 0x3,
5894 	/** peer channel bandwidth */
5895 	WMI_HOST_PEER_CHWIDTH = 0x4,
5896 	/** peer NSS */
5897 	WMI_HOST_PEER_NSS = 0x5,
5898 	/** USE 4 ADDR */
5899 	WMI_HOST_PEER_USE_4ADDR = 0x6,
5900 	/** Enable extended peer stats */
5901 	WMI_HOST_PEER_EXT_STATS_ENABLE = 0x7,
5902 	/*Use FIXED Pwr */
5903 	WMI_HOST_PEER_USE_FIXED_PWR = 0x8,
5904 	/* Set peer fixed rate */
5905 	WMI_HOST_PEER_PARAM_FIXED_RATE = 0x9,
5906 	/* Whitelist peer TIDs */
5907 	WMI_HOST_PEER_SET_MU_WHITELIST = 0xa,
5908 	/* set group membership status */
5909 	WMI_HOST_PEER_MEMBERSHIP = 0xb,
5910 	WMI_HOST_PEER_USERPOS = 0xc,
5911 	WMI_HOST_PEER_CRIT_PROTO_HINT_ENABLED = 0xd,
5912 	WMI_HOST_PEER_TX_FAIL_CNT_THR = 0xe,
5913 	WMI_HOST_PEER_SET_HW_RETRY_CTS2S = 0xf,
5914 	WMI_HOST_PEER_IBSS_ATIM_WINDOW_LENGTH = 0x10,
5915 	WMI_HOST_PEER_PHYMODE = 0x11,
5916 	WMI_HOST_PEER_SET_MAC_TX_RATE = 0x12,
5917 	/* Set default Rx routing */
5918 	WMI_HOST_PEER_SET_DEFAULT_ROUTING = 0x13,
5919 	WMI_HOST_PEER_SET_MIN_TX_RATE = 0x14,
5920 	/* peer NSS for 160Mhx */
5921 	WMI_HOST_PEER_NSS_VHT160 = 0x15,
5922 	/* peer NSS for 160Mhx */
5923 	WMI_HOST_PEER_NSS_VHT80_80 = 0x16,
5924 	/* Set SU sounding interval */
5925 	WMI_HOST_PEER_PARAM_SU_TXBF_SOUNDING_INTERVAL = 0x17,
5926 	/* Set MU sounding interval */
5927 	WMI_HOST_PEER_PARAM_MU_TXBF_SOUNDING_INTERVAL = 0x18,
5928 	/* Enable sounding interval set */
5929 	WMI_HOST_PEER_PARAM_TXBF_SOUNDING_ENABLE = 0x19,
5930 	/* Enable MU support */
5931 	WMI_HOST_PEER_PARAM_MU_ENABLE = 0x1a,
5932 	/* Enable OFDMA support */
5933 	WMI_HOST_PEER_PARAM_OFDMA_ENABLE = 0x1b,
5934 	/* Notify FT roam */
5935 	WMI_HOST_PEER_PARAM_ENABLE_FT = 0x1c,
5936 } PEER_PARAM_ENUM;
5937 #define WMI_HOST_PEER_MIMO_PS_NONE	0x0
5938 #define WMI_HOST_PEER_MIMO_PS_STATIC	0x1
5939 #define WMI_HOST_PEER_MIMO_PS_DYNAMIC	0x2
5940 typedef enum {
5941 	HOST_PLATFORM_HIGH_PERF,
5942 	HOST_PLATFORM_LOW_PERF,
5943 	HOST_PLATFORM_LOW_PERF_NO_FETCH,
5944 } HOST_PLATFORM_TYPE;
5945 
5946 enum wmi_host_sta_ps_mode {
5947 	/** enable power save for the given STA VDEV */
5948 	WMI_HOST_STA_PS_MODE_DISABLED = 0,
5949 	/** disable power save  for a given STA VDEV */
5950 	WMI_HOST_STA_PS_MODE_ENABLED = 1,
5951 };
5952 enum wmi_host_sta_powersave_param {
5953 	/**
5954 	* Controls how frames are retrievd from AP while STA is sleeping
5955 	*
5956 	* (see enum wmi_sta_ps_param_rx_wake_policy)
5957 	*/
5958 	WMI_HOST_STA_PS_PARAM_RX_WAKE_POLICY = 0,
5959 
5960 	/**
5961 	* The STA will go active after this many TX
5962 	*
5963 	* (see enum wmi_sta_ps_param_tx_wake_threshold)
5964 	*/
5965 	WMI_HOST_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
5966 
5967 	/**
5968 	* Number of PS-Poll to send before STA wakes up
5969 	*
5970 	* (see enum wmi_sta_ps_param_pspoll_count)
5971 	*
5972 	*/
5973 	WMI_HOST_STA_PS_PARAM_PSPOLL_COUNT = 2,
5974 
5975 	/**
5976 	* TX/RX inactivity time in msec before going to sleep.
5977 	*
5978 	* The power save SM will monitor tx/rx activity on the VDEV, if no
5979 	* activity for the specified msec of the parameter
5980 	* the Power save SM will go to sleep.
5981 	*/
5982 	WMI_HOST_STA_PS_PARAM_INACTIVITY_TIME = 3,
5983 
5984 	/**
5985 	* Set uapsd configuration.
5986 	*
5987 	* (see enum wmi_sta_ps_param_uapsd)
5988 	*/
5989 	WMI_HOST_STA_PS_PARAM_UAPSD = 4,
5990 };
5991 /* prefix used by scan requestor ids on the host
5992  * replicated here form wmi_unified.h*/
5993 #define WMI_HOST_P_SCAN_REQUESTOR_ID_PREFIX 0xA000
5994 /* prefix used by scan request ids generated on the host */
5995 /* host cycles through the lower 12 bits to generate ids */
5996 #define WMI_HOST_P_SCAN_REQ_ID_PREFIX 0xA000
5997 
5998 #define WMI_HOST_RC_DS_FLAG	0x01	/* Dual stream flag */
5999 #define WMI_HOST_RC_CW40_FLAG	0x02	/* CW 40 */
6000 #define WMI_HOST_RC_SGI_FLAG	0x04	/* Short Guard Interval */
6001 #define WMI_HOST_RC_HT_FLAG	0x08	/* HT */
6002 #define WMI_HOST_RC_RTSCTS_FLAG	0x10	/* RTS-CTS */
6003 #define WMI_HOST_RC_TX_STBC_FLAG	0x20	/* TX STBC */
6004 #define WMI_HOST_RC_RX_STBC_FLAG	0xC0	/* RX STBC ,2 bits */
6005 #define WMI_HOST_RC_RX_STBC_FLAG_S   6	/* RX STBC ,2 bits */
6006 #define WMI_HOST_RC_WEP_TKIP_FLAG	0x100   /* WEP/TKIP encryption */
6007 #define WMI_HOST_RC_TS_FLAG	0x200   /* Three stream flag */
6008 #define WMI_HOST_RC_UAPSD_FLAG	0x400   /* UAPSD Rate Control */
6009 
6010 /** HT Capabilities*/
6011 #define WMI_HOST_HT_CAP_ENABLED	0x0001   /* HT Enabled/ disabled */
6012 /* Short Guard Interval with HT20 */
6013 #define WMI_HOST_HT_CAP_HT20_SGI	0x0002
6014 #define WMI_HOST_HT_CAP_DYNAMIC_SMPS	0x0004   /* Dynamic MIMO powersave */
6015 #define WMI_HOST_HT_CAP_TX_STBC	0x0008   /* B3 TX STBC */
6016 #define WMI_HOST_HT_CAP_TX_STBC_MASK_SHIFT	3
6017 #define WMI_HOST_HT_CAP_RX_STBC	0x0030   /* B4-B5 RX STBC */
6018 #define WMI_HOST_HT_CAP_RX_STBC_MASK_SHIFT	4
6019 #define WMI_HOST_HT_CAP_LDPC	0x0040   /* LDPC supported */
6020 #define WMI_HOST_HT_CAP_L_SIG_TXOP_PROT	0x0080   /* L-SIG TXOP Protection */
6021 #define WMI_HOST_HT_CAP_MPDU_DENSITY	0x0700   /* MPDU Density */
6022 #define WMI_HOST_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8
6023 #define WMI_HOST_HT_CAP_HT40_SGI	0x0800
6024 #define WMI_HOST_HT_CAP_RX_LDPC         0x1000
6025 #define WMI_HOST_HT_CAP_TX_LDPC         0x2000
6026 #define WMI_HOST_HT_CAP_IBF_BFER	0x4000
6027 
6028 /* These macros should be used when we wish to advertise STBC support for
6029  * only 1SS or 2SS or 3SS. */
6030 #define WMI_HOST_HT_CAP_RX_STBC_1SS	0x0010   /* B4-B5 RX STBC */
6031 #define WMI_HOST_HT_CAP_RX_STBC_2SS	0x0020   /* B4-B5 RX STBC */
6032 #define WMI_HOST_HT_CAP_RX_STBC_3SS	0x0030   /* B4-B5 RX STBC */
6033 
6034 
6035 #define WMI_HOST_HT_CAP_DEFAULT_ALL (WMI_HOST_HT_CAP_ENABLED	| \
6036 	WMI_HOST_HT_CAP_HT20_SGI	| \
6037 	WMI_HOST_HT_CAP_HT40_SGI	| \
6038 	WMI_HOST_HT_CAP_TX_STBC	| \
6039 	WMI_HOST_HT_CAP_RX_STBC	| \
6040 	WMI_HOST_HT_CAP_LDPC)
6041 
6042 /* WMI_HOST_VHT_CAP_* these maps to ieee 802.11ac vht capability information
6043    field. The fields not defined here are not supported, or reserved.
6044    Do not change these masks and if you have to add new one follow the
6045    bitmask as specified by 802.11ac draft.
6046 */
6047 
6048 #define WMI_HOST_VHT_CAP_MAX_MPDU_LEN_MASK	0x00000003
6049 #define WMI_HOST_VHT_CAP_RX_LDPC	0x00000010
6050 #define WMI_HOST_VHT_CAP_SGI_80MHZ	0x00000020
6051 #define WMI_HOST_VHT_CAP_SGI_160MHZ	0x00000040
6052 #define WMI_HOST_VHT_CAP_TX_STBC	0x00000080
6053 #define WMI_HOST_VHT_CAP_RX_STBC_MASK	0x00000300
6054 #define WMI_HOST_VHT_CAP_RX_STBC_MASK_SHIFT	8
6055 #define WMI_HOST_VHT_CAP_SU_BFER	0x00000800
6056 #define WMI_HOST_VHT_CAP_SU_BFEE	0x00001000
6057 #define WMI_HOST_VHT_CAP_MAX_CS_ANT_MASK	0x0000E000
6058 #define WMI_HOST_VHT_CAP_MAX_CS_ANT_MASK_SHIFT	13
6059 #define WMI_HOST_VHT_CAP_MAX_SND_DIM_MASK	0x00070000
6060 #define WMI_HOST_VHT_CAP_MAX_SND_DIM_MASK_SHIFT	16
6061 #define WMI_HOST_VHT_CAP_MU_BFER	0x00080000
6062 #define WMI_HOST_VHT_CAP_MU_BFEE	0x00100000
6063 #define WMI_HOST_VHT_CAP_MAX_AMPDU_LEN_EXP	0x03800000
6064 #define WMI_HOST_VHT_CAP_MAX_AMPDU_LEN_EXP_SHIT	23
6065 #define WMI_HOST_VHT_CAP_RX_FIXED_ANT	0x10000000
6066 #define WMI_HOST_VHT_CAP_TX_FIXED_ANT	0x20000000
6067 
6068 #define WMI_HOST_VHT_CAP_MAX_MPDU_LEN_11454	0x00000002
6069 
6070 /* These macros should be used when we wish to advertise STBC support for
6071  * only 1SS or 2SS or 3SS. */
6072 #define WMI_HOST_VHT_CAP_RX_STBC_1SS	0x00000100
6073 #define WMI_HOST_VHT_CAP_RX_STBC_2SS	0x00000200
6074 #define WMI_HOST_VHT_CAP_RX_STBC_3SS	0x00000300
6075 
6076 #define WMI_HOST_VHT_CAP_DEFAULT_ALL (WMI_HOST_VHT_CAP_MAX_MPDU_LEN_11454  | \
6077 	WMI_HOST_VHT_CAP_SGI_80MHZ	|	\
6078 	WMI_HOST_VHT_CAP_TX_STBC	|	\
6079 	WMI_HOST_VHT_CAP_RX_STBC_MASK	|	\
6080 	WMI_HOST_VHT_CAP_RX_LDPC	|	\
6081 	WMI_HOST_VHT_CAP_MAX_AMPDU_LEN_EXP   |	\
6082 	WMI_HOST_VHT_CAP_RX_FIXED_ANT	|	\
6083 	WMI_HOST_VHT_CAP_TX_FIXED_ANT)
6084 
6085 /* Interested readers refer to Rx/Tx MCS Map definition as defined in
6086    802.11ac
6087 */
6088 #define WMI_HOST_VHT_MAX_MCS_4_SS_MASK(r, ss) ((3 & (r)) << (((ss) - 1) << 1))
6089 #define WMI_HOST_VHT_MAX_SUPP_RATE_MASK	0x1fff0000
6090 #define WMI_HOST_VHT_MAX_SUPP_RATE_MASK_SHIFT 16
6091 
6092 /** U-APSD configuration of peer station from (re)assoc request and TSPECs */
6093 enum wmi_host_ap_ps_param_uapsd {
6094 	WMI_HOST_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
6095 	WMI_HOST_AP_PS_UAPSD_AC0_TRIGGER_EN  = (1 << 1),
6096 	WMI_HOST_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
6097 	WMI_HOST_AP_PS_UAPSD_AC1_TRIGGER_EN  = (1 << 3),
6098 	WMI_HOST_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
6099 	WMI_HOST_AP_PS_UAPSD_AC2_TRIGGER_EN  = (1 << 5),
6100 	WMI_HOST_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
6101 	WMI_HOST_AP_PS_UAPSD_AC3_TRIGGER_EN  = (1 << 7),
6102 };
6103 /** U-APSD maximum service period of peer station */
6104 enum wmi_host_ap_ps_peer_param_max_sp {
6105 	WMI_HOST_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0,
6106 	WMI_HOST_AP_PS_PEER_PARAM_MAX_SP_2 = 1,
6107 	WMI_HOST_AP_PS_PEER_PARAM_MAX_SP_4 = 2,
6108 	WMI_HOST_AP_PS_PEER_PARAM_MAX_SP_6 = 3,
6109 
6110 	/* keep last! */
6111 	MAX_HOST_WMI_AP_PS_PEER_PARAM_MAX_SP,
6112 };
6113 
6114 #define WMI_HOST_UAPSD_AC_TYPE_DELI 0
6115 #define WMI_HOST_UAPSD_AC_TYPE_TRIG 1
6116 
6117 #define WMI_HOST_UAPSD_AC_BIT_MASK(ac, type) \
6118 	((type ==  WMI_HOST_UAPSD_AC_TYPE_DELI) ? (1<<(ac<<1)) :\
6119 	 (1<<((ac<<1)+1)))
6120 
6121 enum wmi_host_ap_ps_peer_param_wnm_sleep {
6122 	WMI_HOST_AP_PS_PEER_PARAM_WNM_SLEEP_ENABLE,
6123 	WMI_HOST_AP_PS_PEER_PARAM_WNM_SLEEP_DISABLE,
6124 };
6125 
6126 enum wmi_host_ap_ps_peer_param {
6127 	/** Set uapsd configuration for a given peer.
6128 	*
6129 	* This will include the delivery and trigger enabled state for every AC.
6130 	* The host  MLME needs to set this based on AP capability and stations
6131 	* request Set in the association request  received from the station.
6132 	*
6133 	* Lower 8 bits of the value specify the UAPSD configuration.
6134 	*
6135 	* (see enum wmi_ap_ps_param_uapsd)
6136 	* The default value is 0.
6137 	*/
6138 	WMI_HOST_AP_PS_PEER_PARAM_UAPSD = 0,
6139 
6140 	/**
6141 	* Set the service period for a UAPSD capable station
6142 	*
6143 	* The service period from wme ie in the (re)assoc request frame.
6144 	*
6145 	* (see enum wmi_ap_ps_peer_param_max_sp)
6146 	*/
6147 	WMI_HOST_AP_PS_PEER_PARAM_MAX_SP = 1,
6148 
6149 	/** Time in seconds for aging out buffered frames
6150       * for STA in power save */
6151 	WMI_HOST_AP_PS_PEER_PARAM_AGEOUT_TIME = 2,
6152 
6153 	/** Specify frame types that are considered SIFS
6154       * RESP trigger frame */
6155 	WMI_HOST_AP_PS_PEER_PARAM_SIFS_RESP_FRMTYPE = 3,
6156 
6157 	/** Specifies the trigger state of TID.
6158 	* Valid only for UAPSD frame type  */
6159 	WMI_HOST_AP_PS_PEER_PARAM_SIFS_RESP_UAPSD = 4,
6160 
6161 	/** Specifies the WNM sleep state of a STA */
6162 	WMI_HOST_AP_PS_PEER_PARAM_WNM_SLEEP = 5,
6163 };
6164 #define WMI_HOST_RXERR_CRC	0x01 /* CRC error on frame */
6165 #define WMI_HOST_RXERR_DECRYPT	0x08 /* non-Michael decrypt error */
6166 #define WMI_HOST_RXERR_MIC	0x10 /* Michael MIC decrypt error */
6167 #define WMI_HOST_RXERR_KEY_CACHE_MISS 0x20 /* No/incorrect key matter in h/w */
6168 
6169 enum wmi_host_sta_ps_param_uapsd {
6170 	WMI_HOST_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
6171 	WMI_HOST_STA_PS_UAPSD_AC0_TRIGGER_EN  = (1 << 1),
6172 	WMI_HOST_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
6173 	WMI_HOST_STA_PS_UAPSD_AC1_TRIGGER_EN  = (1 << 3),
6174 	WMI_HOST_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
6175 	WMI_HOST_STA_PS_UAPSD_AC2_TRIGGER_EN  = (1 << 5),
6176 	WMI_HOST_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
6177 	WMI_HOST_STA_PS_UAPSD_AC3_TRIGGER_EN  = (1 << 7),
6178 };
6179 
6180 enum wmi_host_sta_ps_param_rx_wake_policy {
6181 	/* Wake up when ever there is an  RX activity on the VDEV. In this mode
6182 	* the Power save SM(state machine) will come out of sleep by either
6183 	* sending null frame (or) a data frame (with PS==0) in response to TIM
6184 	* bit set in the received beacon frame from AP.
6185 	*/
6186 	WMI_HOST_STA_PS_RX_WAKE_POLICY_WAKE = 0,
6187 
6188 	/* Here the power save state machine will not wakeup in response to TIM
6189 	* bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD
6190 	* configuration setup by WMISET_PS_SET_UAPSD  WMI command.  When all
6191 	* access categories are delivery-enabled, the station will send a UAPSD
6192 	* trigger frame, otherwise it will send a PS-Poll.
6193 	*/
6194 	WMI_HOST_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1,
6195 };
6196 enum wmi_host_sta_ps_param_pspoll_count {
6197 	WMI_HOST_STA_PS_PSPOLL_COUNT_NO_MAX = 0,
6198 	/* Values greater than 0 indicate the maximum numer of PS-Poll frames FW
6199 	* will send before waking up.
6200 	*/
6201 };
6202 /** Number of tx frames/beacon  that cause the power save SM to wake up.
6203  *
6204  * Value 1 causes the SM to wake up for every TX. Value 0 has a special
6205  * meaning, It will cause the SM to never wake up. This is useful if you want
6206  * to keep the system to sleep all the time for some kind of test mode . host
6207  * can change this parameter any time.  It will affect at the next tx frame.
6208  */
6209 enum wmi_host_sta_ps_param_tx_wake_threshold {
6210 	WMI_HOST_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0,
6211 	WMI_HOST_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1,
6212 
6213 	/* Values greater than one indicate that many TX attempts per beacon
6214 	* interval before the STA will wake up
6215 	*/
6216 };
6217 /*
6218  * Transmit power scale factor.
6219  *
6220  */
6221 typedef enum {
6222 	WMI_HOST_TP_SCALE_MAX	= 0,	/* no scaling (default) */
6223 	WMI_HOST_TP_SCALE_50	= 1,	/* 50% of max (-3 dBm) */
6224 	WMI_HOST_TP_SCALE_25	= 2,	/* 25% of max (-6 dBm) */
6225 	WMI_HOST_TP_SCALE_12	= 3,	/* 12% of max (-9 dBm) */
6226 	WMI_HOST_TP_SCALE_MIN	= 4,	/* min, but still on   */
6227 	WMI_HOST_TP_SCALE_SIZE   = 5,	/* max num of enum	*/
6228 } WMI_HOST_TP_SCALE;
6229 enum {
6230 	WMI_HOST_RATEPWR_TABLE_OPS_SET,
6231 	WMI_HOST_RATEPWR_TABLE_OPS_GET,
6232 };
6233 /* reserved up through 0xF */
6234 /**
6235  *  struct wmi_host_dcs_mib_stats - WLAN IM stats from target to host
6236  *      Below statistics are sent from target to host periodically.
6237  *      These are collected at target as long as target is running
6238  *      and target chip is not in sleep.
6239  * @listen_time:
6240  * @reg_tx_frame_cnt:
6241  * @reg_rx_frame_cnt:
6242  * @reg_rxclr_cnt:
6243  * @reg_cycle_cnt: delta cycle count
6244  * @reg_rxclr_ext_cnt:
6245  * @reg_ofdm_phyerr_cnt:
6246  * @reg_cck_phyerr_cnt: CCK err count since last reset, read from register
6247  */
6248 typedef struct _hp_dcs_mib_stats  {
6249 	int32_t    listen_time;
6250 	uint32_t   reg_tx_frame_cnt;
6251 	uint32_t   reg_rx_frame_cnt;
6252 	uint32_t   reg_rxclr_cnt;
6253 	uint32_t   reg_cycle_cnt;
6254 	uint32_t   reg_rxclr_ext_cnt;
6255 	uint32_t   reg_ofdm_phyerr_cnt;
6256 	uint32_t   reg_cck_phyerr_cnt;
6257 } wmi_host_dcs_mib_stats_t;
6258 
6259 /**
6260  * struct wmi_host_dcs_im_tgt_stats - DCS IM target stats
6261  * @reg_tsf32: current running TSF from the TSF-1
6262  * @last_ack_rssi: Known last frame rssi, in case of multiple stations, if
6263  *      and at different ranges, this would not gaurantee that
6264  *      this is the least rssi.
6265  * @tx_waste_time: Sum of all the failed durations in the last
6266  *      one second interval.
6267  * @rx_time: count how many times the hal_rxerr_phy is marked, in this
6268  *      time period
6269  * @phyerr_cnt:
6270  * @mib_stats: wmi_host_dcs_mib_stats_t - collected mib stats as explained
6271  *      in mib structure
6272  * @chan_nf: Channel noise floor (Units are in dBm)
6273  * @my_bss_rx_cycle_count: BSS rx cycle count
6274  * @reg_rxclr_ext40_cnt: extension channel 40Mhz rxclear count
6275  * @reg_rxclr_ext80_cnt: extension channel 80Mhz rxclear count
6276  */
6277 typedef struct _wmi_host_dcs_im_tgt_stats {
6278 	uint32_t                     reg_tsf32;
6279 	uint32_t                     last_ack_rssi;
6280 	uint32_t                     tx_waste_time;
6281 	uint32_t                     rx_time;
6282 	uint32_t                     phyerr_cnt;
6283 	wmi_host_dcs_mib_stats_t     mib_stats;
6284 	uint32_t		     chan_nf;
6285 	uint32_t		     my_bss_rx_cycle_count;
6286 	/* these fields are added here for backward compatibility instead of
6287 	 * wmi_host_dcs_mib_stats_t
6288 	 */
6289 	uint32_t                     reg_rxclr_ext40_cnt;
6290 	uint32_t                     reg_rxclr_ext80_cnt;
6291 } wmi_host_dcs_im_tgt_stats_t;
6292 
6293 /**
6294  * Enum for pktlog req
6295  */
6296 typedef enum {
6297 	WMI_HOST_PKTLOG_EVENT_RX	= 0x1,
6298 	WMI_HOST_PKTLOG_EVENT_TX	= 0x2,
6299 	WMI_HOST_PKTLOG_EVENT_RCF	= 0x4, /* Rate Control Find */
6300 	WMI_HOST_PKTLOG_EVENT_RCU	= 0x8, /* Rate Control Update */
6301 	WMI_HOST_PKTLOG_EVENT_DBG_PRINT = 0x10, /* DEBUG prints */
6302 	/* To support Smart Antenna */
6303 	WMI_HOST_PKTLOG_EVENT_SMART_ANTENNA = 0x20,
6304 	WMI_HOST_PKTLOG_EVENT_H_INFO = 0x40,
6305 	WMI_HOST_PKTLOG_EVENT_STEERING = 0x80,
6306 	/* To support Tx data Capture */
6307 	WMI_HOST_PKTLOG_EVENT_TX_DATA_CAPTURE = 0x100,
6308 } WMI_HOST_PKTLOG_EVENT;
6309 
6310 /**
6311  * wmi_host_phyerr
6312  *
6313  */
6314 #define WMI_HOST_PHY_ERROR_SPECTRAL_SCAN	0x26
6315 #define WMI_HOST_PHY_ERROR_FALSE_RADAR_EXT	0x24
6316 
6317 #define WMI_HOST_AR900B_DFS_PHYERR_MASK	0x4
6318 #define WMI_HOST_AR900B_SPECTRAL_PHYERR_MASK	0x4000000
6319 
6320 /**
6321  * struct wmi_host_perchain_rssi_info - per chain RSSI info
6322  * @rssi_pri20: RSSI on primary 20
6323  * @rssi_sec20: RSSI on secomdary 20
6324  * @rssi_sec40: RSSI secondary 40
6325  * @rssi_sec80: RSSI secondary 80
6326  */
6327 typedef struct wmi_host_perchain_rssi_info {
6328 	int8_t rssi_pri20;
6329 	int8_t rssi_sec20;
6330 	int8_t rssi_sec40;
6331 	int8_t rssi_sec80;
6332 } wmi_host_perchain_rssi_info_t;
6333 
6334 /**
6335  * struct _wmi_host_rf_info - RF measurement information
6336  * @rssi_comb: RSSI Information
6337  * @pc_rssi_info[4]: For now, we know we are getting information
6338  *      for only 4 chains at max. For future extensions
6339  *      use a define
6340  * @noise_floor: Noise floor information
6341  */
6342 typedef struct _wmi_host_rf_info {
6343 	int8_t rssi_comb;
6344 	wmi_host_perchain_rssi_info_t pc_rssi_info[4];
6345 	int16_t noise_floor[4];
6346 } wmi_host_rf_info_t;
6347 
6348 /**
6349  * struct _wmi_host_chan_info
6350  * @center_freq1: center frequency 1 in MHz
6351  * @center_freq2: center frequency 2 in MHz -valid only for
6352  *                11ACVHT 80PLUS80 mode
6353  * @chan_width: channel width in MHz
6354  */
6355 typedef struct _wmi_host_chan_info {
6356 	u_int16_t center_freq1;
6357 	u_int16_t center_freq2;
6358 	u_int8_t chan_width;
6359 } wmi_host_chan_info_t;
6360 
6361 /**
6362  * struct wmi_host_phyerr
6363  * @rf_info:
6364  * @chan_info:
6365  * @tsf64:
6366  * @phy_err_code:
6367  * @tsf_timestamp:
6368  * @bufp:
6369  * @buf_len:
6370  * @phy_err_mask0:
6371  * @phy_err_mask1:
6372  * @pdev_id: pdev_id
6373  */
6374 typedef struct _wmi_host_phyerr {
6375 	wmi_host_rf_info_t rf_info;
6376 	wmi_host_chan_info_t chan_info;
6377 	uint64_t tsf64;
6378 	int32_t phy_err_code;
6379 	uint32_t tsf_timestamp;
6380 	uint8_t *bufp;
6381 	uint32_t buf_len;
6382 	uint32_t phy_err_mask0;
6383 	uint32_t phy_err_mask1;
6384 	uint32_t pdev_id;
6385 } wmi_host_phyerr_t;
6386 
6387 /**
6388  * struct wmi_host_rtt_event_hdr
6389  * @req_id: request id
6390  * @status: status
6391  * @meas_done: measurement done flag
6392  * @meas_type: measurement type
6393  * @report_type: report type
6394  * @v3_status: v2 status
6395  * @v3_finish:
6396  * @v3_tm_start:
6397  * @num_ap: number of AP
6398  * @result: resuult
6399  * @dest_mac: destination mac
6400  */
6401 typedef struct {
6402 	uint16_t req_id;
6403 	uint16_t status:1,
6404 		meas_done:1,
6405 		meas_type:3,
6406 		report_type:3,
6407 		v3_status:2,
6408 		v3_finish:1,
6409 		v3_tm_start:1,
6410 		num_ap:4;
6411 	uint16_t result;
6412 	uint8_t  dest_mac[IEEE80211_ADDR_LEN];
6413 } wmi_host_rtt_event_hdr;
6414 
6415 /**
6416  * struct wmi_host_rtt_meas_event - RTT measurement event
6417  * @chain_mask:
6418  * @bw:
6419  * @rsvd:
6420  * @txrxchain_mask: Bit:0-3:chain mask
6421  *                  Bit 4-5: band width info
6422  *                  00 --Legacy 20, 01 --HT/VHT20
6423  *                  10 --HT/VHT40, 11 -- VHT80
6424  * @tod: resolution of 0.1ns
6425  * @toa: resolution of 0.1ns
6426  * @t3:
6427  * @t4:
6428  * @rssi0:
6429  * @rssi1:
6430  * @rssi2:
6431  * @rssi3:
6432  */
6433 typedef struct {
6434 	uint32_t chain_mask:3,
6435 		bw:2,
6436 		rsvd:27;
6437 	uint32_t txrxchain_mask;
6438 	uint64_t tod;
6439 	uint64_t toa;
6440 	uint64_t t3;
6441 	uint64_t t4;
6442 	uint32_t rssi0;
6443 	uint32_t rssi1;
6444 	uint32_t rssi2;
6445 	uint32_t rssi3;
6446 } wmi_host_rtt_meas_event;
6447 
6448 /*----RTT Report event definition  ----*/
6449 typedef enum {
6450 	/* rtt cmd header parsing error  --terminate */
6451 	WMI_HOST_RTT_COMMAND_HEADER_ERROR = 0,
6452 	/* rtt body parsing error -- skip current STA REQ */
6453 	WMI_HOST_RTT_COMMAND_ERROR,
6454 	/* rtt no resource	-- terminate */
6455 	WMI_HOST_RTT_MODULE_BUSY,
6456 	/* STA exceed the support limit -- only server the first n STA */
6457 	WMI_HOST_RTT_TOO_MANY_STA,
6458 	/* any allocate failure */
6459 	WMI_HOST_RTT_NO_RESOURCE,
6460 	/* can not find vdev with vdev ID - skip current STA REQ */
6461 	WMI_HOST_RTT_VDEV_ERROR,
6462 	/* Tx failure   -- continiue and measure number */
6463 	WMI_HOST_RTT_TRANSIMISSION_ERROR,
6464 	/* wait for first TM timer expire-terminate current STA measurement */
6465 	WMI_HOST_RTT_TM_TIMER_EXPIRE,
6466 	/* we do not support RTT measurement with this type of frame */
6467 	WMI_HOST_RTT_FRAME_TYPE_NOSUPPORT,
6468 	/* whole RTT measurement timer expire-terminate
6469 	** current STA measurement */
6470 	WMI_HOST_RTT_TIMER_EXPIRE,
6471 	/* channel swicth failed */
6472 	WMI_HOST_RTT_CHAN_SWITCH_ERROR,
6473 	/* TMR trans error, this dest peer will be skipped */
6474 	WMI_HOST_RTT_TMR_TRANS_ERROR,
6475 	/* V3 only. If both CFR and Token mismatch, do not report */
6476 	WMI_HOST_RTT_NO_REPORT_BAD_CFR_TOKEN,
6477 	/* For First TM, if CFR is bad, then do not report */
6478 	WMI_HOST_RTT_NO_REPORT_FIRST_TM_BAD_CFR,
6479 	/* do not allow report type2 mix with type 0, 1 */
6480 	WMI_HOST_RTT_REPORT_TYPE2_MIX,
6481 	/* LCI Configuration OK. - Responder only */
6482 	WMI_HOST_RTT_LCI_CFG_OK,
6483 	/* LCR configuration OK. - Responder only */
6484 	WMI_HOST_RTT_LCR_CFG_OK,
6485 	/* Bad configuration LCI (or) LCR request - Responder only */
6486 	WMI_HOST_RTT_CFG_ERROR,
6487 	WMI_HOST_WMI_RTT_REJECT_MAX,
6488 } WMI_HOST_RTT_ERROR_INDICATOR;
6489 typedef struct {
6490 	wmi_host_rtt_event_hdr hdr;
6491 	WMI_HOST_RTT_ERROR_INDICATOR reject_reason;
6492 } wmi_host_rtt_error_report_event;
6493 
6494 #if defined(AR9888)
6495 typedef enum {
6496 	WMI_HOST_PROF_CPU_IDLE,
6497 	WMI_HOST_PROF_PPDU_PROC,
6498 	WMI_HOST_PROF_PPDU_POST,
6499 	WMI_HOST_PROF_HTT_TX_INPUT,
6500 	WMI_HOST_PROF_MSDU_ENQ,
6501 	WMI_HOST_PROF_PPDU_POST_HAL,
6502 	WMI_HOST_PROF_COMPUTE_TX_TIME,
6503 
6504 	/* Add new ID's above this. */
6505 	WMI_HOST_PROF_MAX_ID,
6506 } wmi_host_profile_id_t;
6507 #endif
6508 
6509 #define WMI_HOST_WLAN_PROFILE_MAX_HIST	3
6510 #define WMI_HOST_WLAN_PROFILE_MAX_BIN_CNT 32
6511 
6512 #if defined(AR9888)
6513 #define WMI_HOST_MAX_PROFILE	WMI_HOST_PROF_MAX_ID
6514 #else
6515 #define WMI_HOST_MAX_PROFILE	WMI_HOST_WLAN_PROFILE_MAX_BIN_CNT
6516 #endif
6517 
6518 /**
6519  * struct wmi_host_wlan_profile - Host profile param
6520  * @id: profile id
6521  * @cnt: Count
6522  * @tot:
6523  * @min: minimum
6524  * @max: Mac
6525  * @hist_intvl: history interval
6526  * @hist: profile data history
6527  */
6528 typedef struct {
6529 	uint32_t id;
6530 	uint32_t cnt;
6531 	uint32_t tot;
6532 	uint32_t min;
6533 	uint32_t max;
6534 	uint32_t hist_intvl;
6535 	uint32_t hist[WMI_HOST_WLAN_PROFILE_MAX_HIST];
6536 } wmi_host_wlan_profile_t;
6537 
6538 /**
6539  * struct wmi_host_wlan_profile_ctx_t - profile context
6540  * @tot: time in us
6541  * @tx_msdu_cnt: MSDU TX count
6542  * @tx_mpdu_cnt: MPDU tx count
6543  * @tx_ppdu_cnt: PPDU tx count
6544  * @rx_msdu_cnt: MSDU RX count
6545  * @rx_mpdu_cnt: MPDU RXcount
6546  * @bin_count: Bin count
6547  */
6548 typedef struct {
6549 	uint32_t tot;
6550 	uint32_t tx_msdu_cnt;
6551 	uint32_t tx_mpdu_cnt;
6552 	uint32_t tx_ppdu_cnt;
6553 	uint32_t rx_msdu_cnt;
6554 	uint32_t rx_mpdu_cnt;
6555 	uint32_t bin_count;
6556 } wmi_host_wlan_profile_ctx_t;
6557 
6558 /**
6559  * struct wmi_host_chan_info_event - Channel info WMI event
6560  * @pdev_id: pdev_id
6561  * @err_code: Error code
6562  * @freq: Channel freq
6563  * @cmd_flags: Read flags
6564  * @noise_floor: Noise Floor value
6565  * @rx_clear_count: rx clear count
6566  * @cycle_count: cycle count
6567  * @chan_tx_pwr_range: channel tx power per range
6568  * @chan_tx_pwr_tp: channel tx power per throughput
6569  * @rx_frame_count: rx frame count
6570  * @rx_11b_mode_data_duration: 11b mode data duration
6571  * @my_bss_rx_cycle_count: BSS rx cycle count
6572  * @tx_frame_cnt: tx frame count
6573  * @mac_clk_mhz: mac clock
6574  * @vdev_id: unique id identifying the VDEV
6575  */
6576 typedef struct {
6577 	uint32_t pdev_id;
6578 	uint32_t err_code;
6579 	uint32_t freq;
6580 	uint32_t cmd_flags;
6581 	uint32_t noise_floor;
6582 	uint32_t rx_clear_count;
6583 	uint32_t cycle_count;
6584 	uint32_t chan_tx_pwr_range;
6585 	uint32_t chan_tx_pwr_tp;
6586 	uint32_t rx_frame_count;
6587 	uint32_t rx_11b_mode_data_duration;
6588 	uint32_t my_bss_rx_cycle_count;
6589 	uint32_t tx_frame_cnt;
6590 	uint32_t mac_clk_mhz;
6591 	uint32_t vdev_id;
6592 } wmi_host_chan_info_event;
6593 
6594 /**
6595  * struct wmi_host_pdev_channel_hopping_event
6596  * @pdev_id: pdev_id
6597  * @noise_floor_report_iter: Noise threshold iterations with high values
6598  * @noise_floor_total_iter: Total noise threshold iterations
6599  */
6600 typedef struct {
6601 	uint32_t pdev_id;
6602 	uint32_t noise_floor_report_iter;
6603 	uint32_t noise_floor_total_iter;
6604 } wmi_host_pdev_channel_hopping_event;
6605 
6606 /**
6607  * struct wmi_host_pdev_bss_chan_info_event
6608  * @pdev_id: pdev_id
6609  * @freq: Units in MHz
6610  * @noise_floor: units are dBm
6611  * @rx_clear_count_low:
6612  * @rx_clear_count_high:
6613  * @cycle_count_low:
6614  * @cycle_count_high:
6615  * @tx_cycle_count_low:
6616  * @tx_cycle_count_high:
6617  * @rx_cycle_count_low:
6618  * @rx_cycle_count_high:
6619  * @rx_bss_cycle_count_low:
6620  * @rx_bss_cycle_count_high:
6621  * @reserved:
6622  */
6623 typedef struct {
6624 	uint32_t pdev_id;
6625 	uint32_t freq;
6626 	uint32_t noise_floor;
6627 	uint32_t rx_clear_count_low;
6628 	uint32_t rx_clear_count_high;
6629 	uint32_t cycle_count_low;
6630 	uint32_t cycle_count_high;
6631 	uint32_t tx_cycle_count_low;
6632 	uint32_t tx_cycle_count_high;
6633 	uint32_t rx_cycle_count_low;
6634 	uint32_t rx_cycle_count_high;
6635 	uint32_t rx_bss_cycle_count_low;
6636 	uint32_t rx_bss_cycle_count_high;
6637 	uint32_t reserved;
6638 } wmi_host_pdev_bss_chan_info_event;
6639 
6640 /**
6641  * struct wmi_host_pdev_ctl_failsafe_event
6642  * @ctl_failsafe_status: Indicate if Failsafe value is imposed on CTL
6643  */
6644 struct wmi_host_pdev_ctl_failsafe_event {
6645 	uint32_t ctl_failsafe_status;
6646 };
6647 
6648 #define WMI_HOST_INST_STATS_INVALID_RSSI 0
6649 /**
6650  * struct wmi_host_inst_stats_resp
6651  * @iRSSI: Instantaneous RSSI
6652  * @peer_macaddr: peer mac address
6653  * @pdev_id: pdev_id
6654  */
6655 typedef struct {
6656 	uint32_t iRSSI;
6657 	wmi_host_mac_addr peer_macaddr;
6658 	uint32_t pdev_id;
6659 } wmi_host_inst_stats_resp;
6660 
6661 /* Event definition and new structure addition to send event
6662  * to host to block/unblock tx data traffic based on peer_ast_idx or vdev id
6663  */
6664 #define WMI_HOST_INVALID_PEER_AST_INDEX              0xffff
6665 #define WMI_HOST_TX_DATA_TRAFFIC_CTRL_BLOCK          0x1
6666 #define WMI_HOST_TX_DATA_TRAFFIC_CTRL_UNBLOCK        0x2
6667 /**
6668  * struct wmi_host_tx_data_traffic_ctrl_event
6669  * @peer_ast_idx: For vdev based control, peer_ast_idx will be
6670  *                WMI_INVALID_PEER_AST_INDEX
6671  * @vdev_id: only applies if peer_ast_idx == INVALID
6672  * @ctrl_cmd: WMI_TX_DATA_TRAFFIC_CTRL_BLOCK or
6673  *            WMI_TX_DATA_TRAFFIC_CTRL_UNBLOCK
6674  * @wmm_ac: Indicates AC to be blocked or unblocked
6675  *          Bits  4-31 : Reserved (Shall be zero)
6676  *          Bits  0-3  : WMM AC NO [ BE (1), BK (2), VI (3), VO (4)]
6677  *          Started numbering from 1 to preserve backward compatibility
6678  */
6679 typedef struct {
6680 	uint32_t peer_ast_idx;
6681 	uint32_t vdev_id;
6682 	uint32_t ctrl_cmd;
6683 	uint32_t wmm_ac;
6684 } wmi_host_tx_data_traffic_ctrl_event;
6685 
6686 /**
6687  * struct wmi_host_ath_dcs_cw_int
6688  * @channel: either number or freq in mhz
6689  */
6690 typedef struct {
6691 	uint32_t channel;
6692 } wmi_host_ath_dcs_cw_int;
6693 
6694 #define WMI_MAX_POWER_DBG_ARGS 8
6695 
6696 /**
6697  * struct wmi_power_dbg_params - power debug command parameter
6698  * @pdev_id: subsystem identifier
6699  * @module_id: parameter id
6700  * @num_arg: no of arguments
6701  * @args: arguments
6702  */
6703 struct wmi_power_dbg_params {
6704 	uint32_t pdev_id;
6705 	uint32_t module_id;
6706 	uint32_t num_args;
6707 	uint32_t args[WMI_MAX_POWER_DBG_ARGS];
6708 };
6709 
6710 /**
6711  * struct wmi_fw_dump_seg_req - individual segment details
6712  * @seg_id - segment id.
6713  * @seg_start_addr_lo - lower address of the segment.
6714  * @seg_start_addr_hi - higher address of the segment.
6715  * @seg_length - length of the segment.
6716  * @dst_addr_lo - lower address of the destination buffer.
6717  * @dst_addr_hi - higher address of the destination buffer.
6718  *
6719  * This structure carries the information to firmware about the
6720  * individual segments. This structure is part of firmware memory
6721  * dump request.
6722  */
6723 struct wmi_fw_dump_seg_req {
6724 	uint8_t seg_id;
6725 	uint32_t seg_start_addr_lo;
6726 	uint32_t seg_start_addr_hi;
6727 	uint32_t seg_length;
6728 	uint32_t dst_addr_lo;
6729 	uint32_t dst_addr_hi;
6730 };
6731 
6732 /**
6733  * enum wmi_userspace_log_level - Log level at userspace
6734  * @WMI_LOG_LEVEL_NO_COLLECTION: verbose_level 0 corresponds to no collection
6735  * @WMI_LOG_LEVEL_NORMAL_COLLECT: verbose_level 1 correspond to normal log
6736  * level with minimal user impact. This is the default value.
6737  * @WMI_LOG_LEVEL_ISSUE_REPRO: verbose_level 2 are enabled when user is lazily
6738  * trying to reproduce a problem, wifi performances and power can be impacted
6739  * but device should not otherwise be significantly impacted
6740  * @WMI_LOG_LEVEL_ACTIVE: verbose_level 3+ are used when trying to
6741  * actively debug a problem
6742  *
6743  * Various log levels defined in the userspace for logging applications
6744  */
6745 enum wmi_userspace_log_level {
6746 	WMI_LOG_LEVEL_NO_COLLECTION,
6747 	WMI_LOG_LEVEL_NORMAL_COLLECT,
6748 	WMI_LOG_LEVEL_ISSUE_REPRO,
6749 	WMI_LOG_LEVEL_ACTIVE,
6750 };
6751 
6752 /**
6753  * HW mode config type replicated from FW header
6754  * @WMI_HOST_HW_MODE_SINGLE: Only one PHY is active.
6755  * @WMI_HOST_HW_MODE_DBS: Both PHYs are active in different bands,
6756  *                        one in 2G and another in 5G.
6757  * @WMI_HOST_HW_MODE_SBS_PASSIVE: Both PHYs are in passive mode (only rx) in
6758  *                        same band; no tx allowed.
6759  * @WMI_HOST_HW_MODE_SBS: Both PHYs are active in the same band.
6760  *                        Support for both PHYs within one band is planned
6761  *                        for 5G only(as indicated in WMI_MAC_PHY_CAPABILITIES),
6762  *                        but could be extended to other bands in the future.
6763  *                        The separation of the band between the two PHYs needs
6764  *                        to be communicated separately.
6765  * @WMI_HOST_HW_MODE_DBS_SBS: 3 PHYs, with 2 on the same band doing SBS
6766  *                           as in WMI_HW_MODE_SBS, and 3rd on the other band
6767  * @WMI_HOST_HW_MODE_DBS_OR_SBS: Two PHY with one PHY capabale of both 2G and
6768  *                        5G. It can support SBS (5G + 5G) OR DBS (5G + 2G).
6769  * @WMI_HOST_HW_MODE_MAX: Max hw_mode_id. Used to indicate invalid mode.
6770  * @WMI_HOST_HW_MODE_DETECT: Mode id used by host to choose mode from target
6771  *                        supported modes.
6772  */
6773 enum wmi_host_hw_mode_config_type {
6774 	WMI_HOST_HW_MODE_SINGLE       = 0,
6775 	WMI_HOST_HW_MODE_DBS          = 1,
6776 	WMI_HOST_HW_MODE_SBS_PASSIVE  = 2,
6777 	WMI_HOST_HW_MODE_SBS          = 3,
6778 	WMI_HOST_HW_MODE_DBS_SBS      = 4,
6779 	WMI_HOST_HW_MODE_DBS_OR_SBS   = 5,
6780 	WMI_HOST_HW_MODE_MAX,
6781 	WMI_HOST_HW_MODE_DETECT,
6782 };
6783 
6784 /*
6785  * struct wmi_host_peer_txmu_cnt_event
6786  * @tx_mu_transmitted - MU-MIMO tx count
6787  */
6788 typedef struct {
6789 	uint32_t tx_mu_transmitted;
6790 } wmi_host_peer_txmu_cnt_event;
6791 
6792 /**
6793  * struct esp_estimation_event - esp airtime estimation event
6794  * @ac_airtime_percentage: Estimated Airtime
6795  * @pdev_id: PDEV_ID of Data
6796  */
6797 struct esp_estimation_event {
6798 	uint32_t ac_airtime_percentage;
6799 	uint32_t pdev_id;
6800 };
6801 
6802 /*
6803  * struct wmi_peer_gid_userpos_list_event
6804  * @usr_list - User list
6805  */
6806 #define GID_OVERLOAD_GROUP_COUNT  15
6807 typedef struct {
6808 	uint32_t usr_list[GID_OVERLOAD_GROUP_COUNT];
6809 } wmi_host_peer_gid_userpos_list_event;
6810 
6811 /**
6812  * enum rcpi_measurement_type - for identifying type of rcpi measurement
6813  * @RCPI_MEASUREMENT_TYPE_AVG_MGMT: avg rcpi of mgmt frames
6814  * @RCPI_MEASUREMENT_TYPE_AVG_DATA: avg rcpi of data frames
6815  * @RCPI_MEASUREMENT_TYPE_LAST_MGMT: rcpi of last mgmt frame
6816  * @RCPI_MEASUREMENT_TYPE_LAST_DATA: rcpi of last data frame
6817  * @RCPI_MEASUREMENT_TYPE_INVALID: invalid rcpi measurement type
6818  */
6819 enum rcpi_measurement_type {
6820 	RCPI_MEASUREMENT_TYPE_AVG_MGMT  = 0x1,
6821 	RCPI_MEASUREMENT_TYPE_AVG_DATA  = 0x2,
6822 	RCPI_MEASUREMENT_TYPE_LAST_MGMT = 0x3,
6823 	RCPI_MEASUREMENT_TYPE_LAST_DATA = 0x4,
6824 	RCPI_MEASUREMENT_TYPE_INVALID = 0x5,
6825 };
6826 
6827 /**
6828  * struct rcpi_req - RCPI req parameter
6829  * @vdev_id: virtual device id
6830  * @measurement_type: type of rcpi from enum wmi_rcpi_measurement_type
6831  * @mac_addr: peer mac addr for which measurement is required
6832  */
6833 struct rcpi_req {
6834 	uint32_t vdev_id;
6835 	enum rcpi_measurement_type measurement_type;
6836 	uint8_t mac_addr[IEEE80211_ADDR_LEN];
6837 };
6838 
6839 /**
6840  * struct rcpi_res - RCPI response parameter
6841  * @vdev_id: virtual device id
6842  * @measurement_type: type of rcpi from enum wmi_rcpi_measurement_type
6843  * @mac_addr: peer mac addr for which measurement is required
6844  * @rcpi_value: value of RCPI computed by firmware
6845  */
6846 struct rcpi_res {
6847 	uint32_t vdev_id;
6848 	enum rcpi_measurement_type measurement_type;
6849 	uint8_t mac_addr[IEEE80211_ADDR_LEN];
6850 	int32_t rcpi_value;
6851 };
6852 
6853 #define WMI_HOST_BOARD_MCN_STRING_MAX_SIZE 19
6854 #define WMI_HOST_BOARD_MCN_STRING_BUF_SIZE \
6855 	(WMI_HOST_BOARD_MCN_STRING_MAX_SIZE+1) /* null-terminator */
6856 
6857 typedef struct {
6858 	uint32_t software_cal_version;
6859 	uint32_t board_cal_version;
6860 	/* board_mcn_detail:
6861 	 * Provide a calibration message string for the host to display.
6862 	 * Note: on a big-endian host, the 4 bytes within each uint32_t portion
6863 	 * of a WMI message will be automatically byteswapped by the copy engine
6864 	 * as the messages are transferred between host and target, to convert
6865 	 * between the target's little-endianness and the host's big-endianness.
6866 	 * Consequently, a big-endian host should manually unswap the bytes
6867 	 * within the board_mcn_detail string buffer to get the bytes back into
6868 	 * the desired natural order.
6869 	 */
6870 	uint8_t board_mcn_detail[WMI_HOST_BOARD_MCN_STRING_BUF_SIZE];
6871 	uint32_t cal_ok; /* filled with CALIBRATION_STATUS enum value */
6872 } wmi_host_pdev_check_cal_version_event;
6873 
6874 /**
6875  * enum WMI_HOST_CALIBRATION_STATUS - Host defined Enums for cal status
6876  * @WMI_HOST_NO_FEATURE: The board was calibrated with a meta
6877  *                       which did not have this feature
6878  * @WMI_HOST_CALIBRATION_OK: The calibration status is OK
6879  * @WMI_HOST_CALIBRATION_NOT_OK: The calibration status is NOT OK
6880  */
6881 enum WMI_HOST_CALIBRATION_STATUS {
6882 	WMI_HOST_NO_FEATURE = 0,
6883 	WMI_HOST_CALIBRATION_OK,
6884 	WMI_HOST_CALIBRATION_NOT_OK,
6885 };
6886 
6887 /**
6888  * struct wmi_host_pdev_utf_event - Host defined struct to hold utf event data
6889  * @data:        Pointer to data
6890  * @datalen:     Data length
6891  * @pdev_id:     Pdev_id of data
6892  *
6893  */
6894 struct wmi_host_pdev_utf_event {
6895 	uint8_t *data;
6896 	uint16_t datalen;
6897 	uint32_t pdev_id;
6898 };
6899 
6900 /**
6901  * struct wmi_host_utf_seg_header_info - Host defined struct to map seg info in
6902  *                         UTF event
6903  * @len:        segment length
6904  * @msgref:     message reference
6905  * @segment_info: segment info
6906  * @pdev_id:  pdev_id
6907  *
6908  */
6909 struct wmi_host_utf_seg_header_info {
6910 	uint32_t len;
6911 	uint32_t msgref;
6912 	uint32_t segment_info;
6913 	uint32_t pdev_id;
6914 };
6915 
6916 /**
6917  * struct wmi_host_pdev_qvit_event - Host defined struct to hold qvit event data
6918  * @data:        Pointer to data
6919  * @datalen:     Data length
6920  *
6921  */
6922 struct wmi_host_pdev_qvit_event {
6923 	uint8_t *data;
6924 	uint16_t datalen;
6925 	uint32_t pdev_id;
6926 };
6927 
6928 /**
6929  * struct wmi_host_peer_delete_response_event - Peer Delete response event param
6930  * @vdev_id: vdev id
6931  * @mac_address: Peer Mac Address
6932  *
6933  */
6934 struct wmi_host_peer_delete_response_event {
6935 	uint32_t vdev_id;
6936 	struct qdf_mac_addr mac_address;
6937 };
6938 
6939 /**
6940  * @struct wmi_host_dcs_interference_param
6941  * @interference_type: Type of DCS Interference
6942  * @uint32_t pdev_id: pdev id
6943  */
6944 struct wmi_host_dcs_interference_param {
6945 	uint32_t interference_type;
6946 	uint32_t pdev_id;
6947 };
6948 
6949 /*
6950  * struct wmi_host_fips_event_param: FIPS event param
6951  * @pdev_id: pdev id
6952  * @error_status: Error status: 0 (no err), 1, or OPER_TIMEOUR
6953  * @data_len: FIPS data length
6954  * @data: pointer to data
6955  */
6956 struct wmi_host_fips_event_param {
6957 	uint32_t pdev_id;
6958 	uint32_t error_status;
6959 	uint32_t data_len;
6960 	uint32_t *data;
6961 };
6962 
6963 /**
6964  * struct wmi_host_proxy_ast_reserve_param
6965  * @pdev_id: pdev id
6966  * @result: result
6967  */
6968 struct wmi_host_proxy_ast_reserve_param {
6969 	uint32_t pdev_id;
6970 	uint32_t result;
6971 };
6972 
6973 /**
6974  * struct wmi_host_pdev_band_to_mac - freq range for mac
6975  * @pdev_id: PDEV ID to identifiy mac
6976  * @start_freq: start frequency value
6977  * @end_freq: end frequency value
6978  */
6979 struct wmi_host_pdev_band_to_mac {
6980 	uint32_t pdev_id;
6981 	uint32_t start_freq;
6982 	uint32_t end_freq;
6983 };
6984 #define WMI_HOST_MAX_PDEV 3
6985 
6986 #ifdef OL_ATH_SMART_LOGGING
6987 
6988 #define WMI_HOST_SMART_LOG_SCENARIO_SET(flag, scenario) ((flag) |= (scenario))
6989 #define WMI_HOST_SMART_LOG_SCENARIO_GET(flag, scenario) ((flag) &  (scenario))
6990 
6991 /**
6992  * enum wmi_host_smart_log_scenario - Smart log scenarios to be enabled/disabled
6993  * @WMI_HOST_SMART_LOG_ALL: All smart logging features.
6994  * @WMI_HOST_SMART_LOG_CE_FULL_DETECT_BY_FW: CE with full detect by FW.
6995  * @WMI_HOST_SMART_LOG_TX_RX_TIMEOUT: Tx/Rx timeout.
6996  * @WMI_HOST_SMART_LOG_STA_KICKOUT: STA Kickout.
6997  * @WMI_HOST_SMART_LOG_BCN_CMD_FAILURE: Beacon command failure.
6998  * @WMI_HOST_SMART_LOG_P1_PING_FAILURE: P1 ping failure. Ping failure detection
6999  * is done by host entities. So, host should be able to control the
7000  * enable/disable of this feature. Yet, this is provided in case the
7001  * corresponding FW specific debugs alone have to be enabled/disabled.
7002  * @WMI_HOST_SMART_LOG_CONNECTION_FAILURE: Connection failure. Connection
7003  * failure detection is done by host entities. So, host should be able to
7004  * control the enable/disable of this feature. Yet, this is provided in case the
7005  * corresponding FW specific debugs alone have to be enabled/disabled.
7006  * @WMI_HOST_SMART_LOG_FW_INITIATED_PKT_LOG: FW Initiated packetlog.
7007  * @WMI_HOST_SMART_LOG_EXTENSION_1: If WMI_HOST_SMART_LOG_EXTENSION_1 is set,
7008  * then the 'log_case_ext_1' field in 'wmi_smart_logging' is used; else
7009  * log_case_ext_1 is ignored.
7010  */
7011 enum wmi_host_smart_log_scenario {
7012 	WMI_HOST_SMART_LOG_ALL                      =        0x0,
7013 	WMI_HOST_SMART_LOG_CE_FULL_DETECT_BY_FW     =        0x1,
7014 	WMI_HOST_SMART_LOG_TX_RX_TIMEOUT            =        0x2,
7015 	WMI_HOST_SMART_LOG_STA_KICKOUT              =        0x4,
7016 	WMI_HOST_SMART_LOG_BCN_CMD_FAILURE          =        0x8,
7017 	WMI_HOST_SMART_LOG_P1_PING_FAILURE          =       0x10,
7018 	WMI_HOST_SMART_LOG_CONNECTION_FAILURE       =       0x20,
7019 	WMI_HOST_SMART_LOG_FW_INITIATED_PKT_LOG     =       0x40,
7020 
7021 	/* New scenarios to be added here */
7022 
7023 	WMI_HOST_SMART_LOG_EXTENSION_1              = 0x80000000,
7024 };
7025 
7026 /**
7027  * struct wmi_fatal_condition_event - Fatal condition event param
7028  * @type: Type of event
7029  * @subtype: Subtype of event
7030  * @type_subtype_specific_data: Data specific to combination of type and
7031  * subtype. This is held in a union with the original "reserved0" for backward
7032  * compatibility with any code that might refer to it. The previously-reserved
7033  * field now holds data under some conditions. The kind of data depends on the
7034  * above "type" and "subtype" fields. The interpretation of the
7035  * type_subtype_specific_data field based on different type + subtype values is
7036  * shown below:
7037  * 1. type == WMI_HOST_FATAL_CONDITION_PACKET_LOG_CONFIG + subtype
7038  * == WMI_HOST_FATAL_SUBTYPE_PACKET_LOG_CONFIG_START ->
7039  * type_subtype_specific_data = WMI_HOST_PKTLOG_EVENT
7040  * For any type+subtype combinations not listed above, the recipient is expected
7041  * to ignore the type_subtype_specific_data field.
7042  */
7043 struct wmi_fatal_condition_event {
7044 	uint32_t type;
7045 	uint32_t subtype;
7046 	union {
7047 		uint32_t reserved0;
7048 		uint32_t type_subtype_specific_data;
7049 	};
7050 };
7051 
7052 /*Currently the Max fatal events is 3 */
7053 #define FATAL_EVENTS_MAX 3
7054 
7055 /**
7056  * struct wmi_debug_fatal_events: Fatal events list
7057  * @num_events:Number of events
7058  * @event[FATAL_EVENTS_MAX]: Each event data
7059  */
7060 struct wmi_debug_fatal_events {
7061 	uint32_t num_events;
7062 	struct wmi_fatal_condition_event event[FATAL_EVENTS_MAX];
7063 };
7064 
7065 /**
7066  * enum wmi_host_fatal_condition_type - Values that 'type' can take in
7067  * wmi_fatal_condition_event
7068  * @WMI_HOST_FATAL_CONDITION_EVENT_COMPLETION: Fatal condition event completion
7069  * @WMI_HOST_FATAL_CONDITION_CE_FAILURE: CE failure
7070  * @WMI_HOST_FATAL_CONDITION_TIMEOUTS: Communication timeouts
7071  * @WMI_HOST_FATAL_CONDITION_CONNECTION_ISSUE: Connection issue
7072  * @WMI_HOST_FATAL_CONDITION_PACKET_LOG_CONFIG: Configuration for FW initiated
7073  * packetlog
7074  */
7075 enum wmi_host_fatal_condition_type {
7076 	WMI_HOST_FATAL_CONDITION_EVENT_COMPLETION,
7077 	WMI_HOST_FATAL_CONDITION_CE_FAILURE,
7078 	WMI_HOST_FATAL_CONDITION_TIMEOUTS,
7079 	WMI_HOST_FATAL_CONDITION_CONNECTION_ISSUE,
7080 	WMI_HOST_FATAL_CONDITION_PACKET_LOG_CONFIG,
7081 };
7082 
7083 /**
7084  * enum wmi_host_fatal_condition_subtype_timeouts - Possible subtypes for
7085  * WMI_HOST_FATAL_CONDITION_TIMEOUTS
7086  * @WMI_HOST_FATAL_SUBTYPE_TX_TIMEOUT: Tx timeout
7087  * @WMI_HOST_FATAL_SUBTYPE_RX_TIMEOUT: Rx timeout
7088  */
7089 enum wmi_host_fatal_condition_subtype_timeouts {
7090 	WMI_HOST_FATAL_SUBTYPE_TX_TIMEOUT,
7091 	WMI_HOST_FATAL_SUBTYPE_RX_TIMEOUT,
7092 };
7093 
7094 /**
7095  * enum wmi_host_fatal_condition_subtype_connection_issue - Possible subtypes
7096  * for WMI_HOST_FATAL_CONDITION_CONNECTION_ISSUE
7097  * @WMI_HOST_FATAL_SUBTYPE_STA_KICKOUT: STA Kickout
7098  * @WMI_HOST_FATAL_SUBTYPE_P1_PING_FAILURE_START_DEBUG: Start debugging for P1
7099  * ping failure
7100  * @WMI_HOST_FATAL_SUBTYPE_P1_PING_FAILURE_STOP_DEBUG: Stop debugging for P1
7101  * ping failure
7102  * @WMI_HOST_FATAL_SUBTYPE_CONNECTION_FAILURE_START_DEBUG: Start debugging for
7103  * connection failure
7104  * @WMI_HOST_FATAL_SUBTYPE_CONNECTION_FAILURE_STOP_DEBUG: Stop debugging for
7105  * connection failure
7106  */
7107 enum wmi_host_fatal_condition_subtype_connection_issue {
7108 	WMI_HOST_FATAL_SUBTYPE_STA_KICKOUT,
7109 	WMI_HOST_FATAL_SUBTYPE_P1_PING_FAILURE_START_DEBUG,
7110 	WMI_HOST_FATAL_SUBTYPE_P1_PING_FAILURE_STOP_DEBUG,
7111 	WMI_HOST_FATAL_SUBTYPE_CONNECTION_FAILURE_START_DEBUG,
7112 	WMI_HOST_FATAL_SUBTYPE_CONNECTION_FAILURE_STOP_DEBUG,
7113 };
7114 
7115 /**
7116  * enum wmi_host_fatal_condition_subtype_packet_log_config - Possible subtypes
7117  * for WMI_HOST_FATAL_CONDITION_PACKET_LOG_CONFIG
7118  * @WMI_HOST_FATAL_SUBTYPE_PACKET_LOG_CONFIG_START: Start FW initiated packetlog
7119  * @WMI_HOST_FATAL_SUBTYPE_PACKET_LOG_CONFIG_STOP: Stop FW initiated packetlog
7120  */
7121 enum wmi_host_fatal_condition_subtype_packet_log_config {
7122 	WMI_HOST_FATAL_SUBTYPE_PACKET_LOG_CONFIG_START,
7123 	WMI_HOST_FATAL_SUBTYPE_PACKET_LOG_CONFIG_STOP,
7124 };
7125 
7126 #endif /* OL_ATH_SMART_LOGGING */
7127 
7128 /**
7129  * struct wmi_init_cmd_param - INIT command params
7130  * @target_resource_config: pointer to resource config
7131  * @num_mem_chunks: number of memory chunks
7132  * @struct wmi_host_mem_chunk: pointer to memory chunks
7133  * @hw_mode_index: HW mode index chosen
7134  * @num_band_to_mac: Number of band to mac setting
7135  * @struct wmi_host_pdev_band_to_mac: band to mac setting
7136  */
7137 struct wmi_init_cmd_param {
7138 	target_resource_config *res_cfg;
7139 	uint8_t num_mem_chunks;
7140 	struct wmi_host_mem_chunk *mem_chunks;
7141 	uint32_t hw_mode_id;
7142 	uint32_t num_band_to_mac;
7143 	struct wmi_host_pdev_band_to_mac band_to_mac[WMI_HOST_MAX_PDEV];
7144 };
7145 
7146 /**
7147  * struct pdev_csa_switch_count_status - CSA switch count status event param
7148  * @pdev_id: Physical device identifier
7149  * @current_switch_count: Current CSA switch count
7150  * @num_vdevs: Number of vdevs that need restart
7151  * @vdev_ids: Array containing the vdev ids that need restart
7152  */
7153 struct pdev_csa_switch_count_status {
7154 	uint32_t pdev_id;
7155 	uint32_t current_switch_count;
7156 	uint32_t num_vdevs;
7157 	uint32_t *vdev_ids;
7158 };
7159 
7160 /**
7161  * enum wmi_host_active-apf_mode - FW_ACTIVE_APF_MODE, replicated from FW header
7162  * @WMI_HOST_ACTIVE_APF_DISABLED: APF is disabled for all packets in active mode
7163  * @WMI_HOST_ACTIVE_APF_ENABLED: APF is enabled for all packets in active mode
7164  * @WMI_HOST_ACTIVE_APF_ADAPTIVE: APF is enabled for packets up to some
7165  *	threshold in active mode
7166  */
7167 enum wmi_host_active_apf_mode {
7168 	WMI_HOST_ACTIVE_APF_DISABLED =	(1 << 1),
7169 	WMI_HOST_ACTIVE_APF_ENABLED =	(1 << 2),
7170 	WMI_HOST_ACTIVE_APF_ADAPTIVE =	(1 << 3)
7171 };
7172 
7173 /**
7174  * struct coex_config_params - Coex config command params
7175  * @vdev_id: Virtual AP device identifier
7176  * @config_type: Configuration type - wmi_coex_config_type enum
7177  * @config_arg1: Configuration argument based on config type
7178  * @config_arg2: Configuration argument based on config type
7179  * @config_arg3: Configuration argument based on config type
7180  * @config_arg4: Configuration argument based on config type
7181  * @config_arg5: Configuration argument based on config type
7182  * @config_arg6: Configuration argument based on config type
7183  */
7184 struct coex_config_params {
7185 	uint32_t vdev_id;
7186 	uint32_t config_type;
7187 	uint32_t config_arg1;
7188 	uint32_t config_arg2;
7189 	uint32_t config_arg3;
7190 	uint32_t config_arg4;
7191 	uint32_t config_arg5;
7192 	uint32_t config_arg6;
7193 };
7194 
7195 #define WMI_HOST_PDEV_ID_SOC 0xFF
7196 #define WMI_HOST_PDEV_ID_0   0
7197 #define WMI_HOST_PDEV_ID_1   1
7198 #define WMI_HOST_PDEV_ID_2   2
7199 
7200 /**
7201  * struct tbttoffset_params - Tbttoffset event params
7202  * @vdev_id: Virtual AP device identifier
7203  * @tbttoffset : Tbttoffset for the virtual AP device
7204  */
7205 struct tbttoffset_params {
7206 	uint32_t vdev_id;
7207 	uint32_t tbttoffset;
7208 };
7209 
7210 /**
7211  * struct wmi_host_ready_ev_param - Data revieved in ready event
7212  * @status:         FW init status. Success or Failure.
7213  * @num_dscp_table: Number of DSCP table supported in FW
7214  * @num_extra_mac_addr: Extra mac address present in ready event. Used
7215  *                  in DBDC mode to provide multiple mac per pdev.
7216  * @num_total_peer: Total number of peers FW could allocate. Zero means
7217  *                  FW could  allocate num peers requested by host in init.
7218  *                  Otherwise, host need update it max_peer to this value.
7219  * @num_extra_peer: Number of extra peers created and used within FW. Host
7220  *                  should expect peer_id can be num_total_peer + num_extra_peer
7221  *                  but it can create only upto num_total_peer.
7222  * @agile_capability: Boolean specification of whether the target supports
7223  *                  agile DFS, by means of using one 80 MHz radio chain for
7224  *                  radar detection, concurrently with using another radio
7225  *                  chain for non-160 MHz regular operation.
7226  */
7227 struct wmi_host_ready_ev_param {
7228 	uint32_t status;
7229 	uint32_t num_dscp_table;
7230 	uint32_t num_extra_mac_addr;
7231 	uint32_t num_total_peer;
7232 	uint32_t num_extra_peer;
7233 	bool agile_capability;
7234 };
7235 
7236 enum bcn_offload_control_param {
7237 	BCN_OFFLD_CTRL_TX_DISABLE = 0,
7238 	BCN_OFFLD_CTRL_TX_ENABLE,
7239 	BCN_OFFLD_CTRL_SWBA_DISABLE,
7240 	BCN_OFFLD_CTRL_SWBA_ENABLE,
7241 };
7242 
7243 /**
7244  * struct bcn_offload_control - Beacon offload control params
7245  * @vdev_id: vdev identifer of VAP to control beacon tx
7246  * @bcn_ctrl_op: values from enum bcn_offload_control_param
7247  */
7248 struct bcn_offload_control {
7249 	uint32_t vdev_id;
7250 	enum bcn_offload_control_param bcn_ctrl_op;
7251 };
7252 
7253 #ifdef OBSS_PD
7254 /**
7255  * struct wmi_host_obss_spatial_reuse_set_param - OBSS_PD_SPATIAL Reuse
7256  *                                                structure
7257  * @enable: Enable/Disable Spatial Reuse
7258  * @obss_min: Minimum OBSS level to use
7259  * @obss_max: Maximum OBSS level to use
7260  * @pdev_id: Pdev id
7261  */
7262 struct wmi_host_obss_spatial_reuse_set_param {
7263 	uint32_t enable;
7264 	int32_t obss_min;
7265 	int32_t obss_max;
7266 	uint32_t vdev_id;
7267 };
7268 
7269 /**
7270  * struct wmi_host_obss_spatial_reuse_set_def_thresh - default obsspd offsets
7271  * @obss_min: Minimum OBSS level to use
7272  * @obss_max: Maximum OBSS level to use
7273  * @vdev_type: vdev_type should be one of WMI_VDEV_TYPE_STA or WMI_VDEV_TYPE_AP
7274  */
7275 struct wmi_host_obss_spatial_reuse_set_def_thresh {
7276 	int32_t obss_min;
7277 	int32_t obss_max;
7278 	uint32_t vdev_type;
7279 };
7280 #endif
7281 
7282 /**
7283  * struct wds_entry - WDS entry structure
7284  * @peer_mac: peer mac
7285  * @wds_mac: wds mac address
7286  * @flags: flags
7287  */
7288 struct wdsentry {
7289 	u_int8_t peer_mac[IEEE80211_ADDR_LEN];
7290 	u_int8_t wds_mac[IEEE80211_ADDR_LEN];
7291 	uint32_t flags;
7292 };
7293 
7294 /**
7295  * struct wmi_obss_detection_cfg_param - obss detection cfg
7296  * @vdev_id: vdev id
7297  * @obss_detect_period_ms: detection period in ms
7298  * @obss_11b_ap_detect_mode: detect whether there is 11b ap/ibss
7299  * @obss_11b_sta_detect_mode: detect whether there is 11b sta
7300  *                            connected with other APs
7301  * @obss_11g_ap_detect_mode: detect whether there is 11g AP
7302  * @obss_11a_detect_mode: detect whether there is legacy 11a traffic
7303  * @obss_ht_legacy_detect_mode: detect whether there is ap which is
7304  *                              ht legacy mode
7305  * @obss_ht_mixed_detect_mode: detect whether there is ap which is ht mixed mode
7306  * @obss_ht_20mhz_detect_mode: detect whether there is ap which has 20M only
7307  *                             station
7308  */
7309 struct wmi_obss_detection_cfg_param {
7310 	uint32_t vdev_id;
7311 	uint32_t obss_detect_period_ms;
7312 	uint32_t obss_11b_ap_detect_mode;
7313 	uint32_t obss_11b_sta_detect_mode;
7314 	uint32_t obss_11g_ap_detect_mode;
7315 	uint32_t obss_11a_detect_mode;
7316 	uint32_t obss_ht_legacy_detect_mode;
7317 	uint32_t obss_ht_mixed_detect_mode;
7318 	uint32_t obss_ht_20mhz_detect_mode;
7319 };
7320 
7321 /**
7322  * enum wmi_obss_detection_reason - obss detection event reasons
7323  * @OBSS_OFFLOAD_DETECTION_DISABLED: OBSS detection disabled
7324  * @OBSS_OFFLOAD_DETECTION_PRESENT: OBSS present detection
7325  * @OBSS_OFFLOAD_DETECTION_ABSENT: OBSS absent detection
7326  *
7327  * Defines different types of reasons for obss detection event from firmware.
7328  */
7329 enum wmi_obss_detection_reason {
7330 	OBSS_OFFLOAD_DETECTION_DISABLED = 0,
7331 	OBSS_OFFLOAD_DETECTION_PRESENT  = 1,
7332 	OBSS_OFFLOAD_DETECTION_ABSENT   = 2,
7333 };
7334 
7335 /**
7336  * struct wmi_obss_detect_info - OBSS detection info from firmware
7337  * @vdev_id: ID of the vdev to which this info belongs.
7338  * @reason: Indicate if present or Absent detection,
7339  *          also if not supported offload for this vdev.
7340  * @matched_detection_masks: Detection bit map.
7341  * @matched_bssid_addr: MAC address valid for only if info is present detection.
7342  */
7343 struct wmi_obss_detect_info {
7344 	uint32_t vdev_id;
7345 	enum wmi_obss_detection_reason reason;
7346 	uint32_t matched_detection_masks;
7347 	uint8_t matched_bssid_addr[IEEE80211_ADDR_LEN];
7348 };
7349 
7350 #ifdef QCA_SUPPORT_CP_STATS
7351 /**
7352  * struct wmi_host_congestion_stats - host definition of congestion stats
7353  * @vdev_id: ID of the vdev to which this info belongs.
7354  * @congestion: This field holds the congestion percentage =
7355  *                                             (busy_time/total_time)*100
7356  * for the interval from when the vdev was started to the current time
7357  * (or the time at which the vdev was stopped).
7358  */
7359 struct wmi_host_congestion_stats {
7360 	uint32_t vdev_id;
7361 	uint32_t congestion;
7362 };
7363 #endif
7364 
7365 #ifdef FEATURE_WLAN_APF
7366 /**
7367  * struct wmi_apf_write_memory_params - Android Packet Filter write memory
7368  * params
7369  * @vdev_id: VDEV on which APF memory is to be written
7370  * @apf_version: APF version number
7371  * @program_len: Length reserved for program in the APF work memory
7372  * @addr_offset: Relative address in APF work memory to start writing
7373  * @length: Size of the write
7374  * @buf: Pointer to the buffer
7375  */
7376 struct wmi_apf_write_memory_params {
7377 	uint8_t vdev_id;
7378 	uint32_t apf_version;
7379 	uint32_t program_len;
7380 	uint32_t addr_offset;
7381 	uint32_t length;
7382 	uint8_t *buf;
7383 };
7384 
7385 /**
7386  * struct wmi_apf_read_memory_params - Android Packet Filter read memory params
7387  * @vdev_id: vdev id
7388  * @addr_offset: Relative address in APF work memory to read from
7389  * @length: Size of the memory fetch
7390  */
7391 struct wmi_apf_read_memory_params {
7392 	uint8_t vdev_id;
7393 	uint32_t addr_offset;
7394 	uint32_t length;
7395 };
7396 
7397 /**
7398  * struct wmi_apf_read_memory_resp_event_params - Event containing read Android
7399  *	Packet Filter memory response
7400  * @vdev_id: vdev id
7401  * @offset: Read memory offset
7402  * @length: Read memory length
7403  * @more_data: Indicates more data to come
7404  * @data: Pointer to the data
7405  */
7406 struct wmi_apf_read_memory_resp_event_params {
7407 	uint32_t vdev_id;
7408 	uint32_t offset;
7409 	uint32_t length;
7410 	bool more_data;
7411 	uint8_t *data;
7412 };
7413 #endif /* FEATURE_WLAN_APF */
7414 
7415 /* vdev control flags (per bits) */
7416 #define WMI_HOST_VDEV_FLAGS_NON_MBSSID_AP      0x00000001
7417 #define WMI_HOST_VDEV_FLAGS_TRANSMIT_AP        0x00000002
7418 #define WMI_HOST_VDEV_FLAGS_NON_TRANSMIT_AP    0x00000004
7419 
7420 /* Begin of roam scan stats definitions */
7421 
7422 #define WMI_ROAM_SCAN_STATS_MAX             5
7423 #define WMI_ROAM_SCAN_STATS_CANDIDATES_MAX  4
7424 #define WMI_ROAM_SCAN_STATS_CHANNELS_MAX    50
7425 
7426 /**
7427  * struct wmi_roam_scan_stats_req - Structure to hold roam scan stats request
7428  * @vdev_id: interface id
7429  */
7430 struct wmi_roam_scan_stats_req {
7431 	uint32_t vdev_id;
7432 };
7433 
7434 /**
7435  * struct wmi_roam_scan_cand - Roam scan candidates
7436  * @score: score of AP
7437  * @rssi: rssi of the AP
7438  * @freq: center frequency
7439  * @bssid: bssid of AP
7440  */
7441 struct wmi_roam_scan_cand {
7442 	uint32_t score;
7443 	uint32_t rssi;
7444 	uint32_t freq;
7445 	uint8_t  bssid[QDF_MAC_ADDR_SIZE];
7446 };
7447 
7448 /**
7449  * struct wmi_roam_scan_stats_params - Roam scan details
7450  * @time_stamp: time at which this roam scan happened
7451  * @client_id: id of client which triggered this scan
7452  * @num_scan_chans: number of channels that were scanned as part of this scan
7453  * @scan_freqs: frequencies of the channels that were scanned
7454  * @is_roam_successful: whether a successful roaming happened after this scan
7455  * @old_bssid: bssid to which STA is connected just before this scan
7456  * @new_bssid: bssid to which STA is roamed to in case of successful roaming
7457  * @num_roam_candidates: no.of roam candidates that are being reported
7458  * @roam_candidate: roam scan candidate details
7459  * @trigger_id: reason for triggering this roam or roam scan
7460  * @trigger_value: threshold value related to trigger_id
7461  */
7462 struct wmi_roam_scan_stats_params {
7463 	uint64_t time_stamp;
7464 	uint32_t client_id;
7465 	uint32_t num_scan_chans;
7466 	uint32_t scan_freqs[WMI_ROAM_SCAN_STATS_CHANNELS_MAX];
7467 	uint32_t is_roam_successful;
7468 
7469 	/* Bssid to which STA is connected when the roam scan is triggered */
7470 	uint8_t  old_bssid[QDF_MAC_ADDR_SIZE];
7471 
7472 	/*
7473 	 * Bssid to which STA is connected after roaming. Will be valid only
7474 	 * if is_roam_successful is true.
7475 	 */
7476 	uint8_t  new_bssid[QDF_MAC_ADDR_SIZE];
7477 
7478 	/* Number of roam candidates that are being reported in the stats */
7479 	uint32_t num_roam_candidates;
7480 	struct wmi_roam_scan_cand cand[WMI_ROAM_SCAN_STATS_CANDIDATES_MAX];
7481 	uint32_t trigger_id;
7482 	uint32_t trigger_value;
7483 };
7484 
7485 /**
7486  * struct wmi_roam_scan_stats_res - Roam scan stats response from firmware
7487  * @num_roam_scan: number of roam scans triggered
7488  * @roam_scan: place holder to indicate the array of
7489  *             wmi_roam_scan_stats_params followed by this structure
7490  */
7491 struct wmi_roam_scan_stats_res {
7492 	uint32_t num_roam_scans;
7493 	struct wmi_roam_scan_stats_params roam_scan[0];
7494 };
7495 
7496 /* End of roam scan stats definitions */
7497 
7498 /**
7499  * enum wmi_obss_color_collision_evt_type - bss color collision event type
7500  * @OBSS_COLOR_COLLISION_DETECTION_DISABLE: OBSS color detection disabled
7501  * @OBSS_COLOR_COLLISION_DETECTION: OBSS color collision detection
7502  * @OBSS_COLOR_FREE_SLOT_TIMER_EXPIRY: OBSS free slot detection with
7503  *                                     within expiry period
7504  * @OBSS_COLOR_FREE_SLOT_AVAILABLE: OBSS free slot detection
7505  *
7506  * Defines different types of type for obss color collision event type.
7507  */
7508 enum wmi_obss_color_collision_evt_type {
7509 	OBSS_COLOR_COLLISION_DETECTION_DISABLE = 0,
7510 	OBSS_COLOR_COLLISION_DETECTION = 1,
7511 	OBSS_COLOR_FREE_SLOT_TIMER_EXPIRY = 2,
7512 	OBSS_COLOR_FREE_SLOT_AVAILABLE = 3,
7513 };
7514 
7515 /**
7516  * struct wmi_obss_color_collision_cfg_param - obss color collision cfg
7517  * @vdev_id: vdev id
7518  * @flags: proposed for future use cases, currently not used.
7519  * @evt_type: bss color collision event.
7520  * @current_bss_color: current bss color.
7521  * @detection_period_ms: scan interval for both AP and STA mode.
7522  * @scan_period_ms: scan period for passive scan to detect collision.
7523  * @free_slot_expiry_time_ms: FW to notify host at timer expiry after
7524  *                            which Host will disable the bss color.
7525  */
7526 struct wmi_obss_color_collision_cfg_param {
7527 	uint32_t vdev_id;
7528 	uint32_t flags;
7529 	enum wmi_obss_color_collision_evt_type evt_type;
7530 	uint32_t current_bss_color;
7531 	uint32_t detection_period_ms;
7532 	uint32_t scan_period_ms;
7533 	uint32_t free_slot_expiry_time_ms;
7534 };
7535 
7536 /**
7537  * struct wmi_obss_color_collision_info - bss color detection info from firmware
7538  * @vdev_id: ID of the vdev to which this info belongs.
7539  * @evt_type: bss color collision event.
7540  * @obss_color_bitmap_bit0to31: Bit set indicating BSS color present.
7541  * @obss_color_bitmap_bit32to63: Bit set indicating BSS color present.
7542  */
7543 struct wmi_obss_color_collision_info {
7544 	uint32_t vdev_id;
7545 	enum wmi_obss_color_collision_evt_type evt_type;
7546 	uint32_t obss_color_bitmap_bit0to31;
7547 	uint32_t obss_color_bitmap_bit32to63;
7548 };
7549 
7550 #endif /* _WMI_UNIFIED_PARAM_H_ */
7551