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