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