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