1 /*
2  * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
3  * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
4  * Copyright (c) 2006-2012 Wilocity
5  *
6  * Permission to use, copy, modify, and/or distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 /*
20  * This file contains the definitions of the WMI protocol specified in the
21  * Wireless Module Interface (WMI) for the Qualcomm
22  * 60 GHz wireless solution.
23  * It includes definitions of all the commands and events.
24  * Commands are messages from the host to the WM.
25  * Events are messages from the WM to the host.
26  *
27  * This is an automatically generated file.
28  */
29 
30 #ifndef __WILOCITY_WMI_H__
31 #define __WILOCITY_WMI_H__
32 
33 #define WMI_DEFAULT_ASSOC_STA		(1)
34 #define WMI_MAC_LEN			(6)
35 #define WMI_PROX_RANGE_NUM		(3)
36 #define WMI_MAX_LOSS_DMG_BEACONS	(20)
37 #define MAX_NUM_OF_SECTORS		(128)
38 #define WMI_INVALID_TEMPERATURE		(0xFFFFFFFF)
39 #define WMI_SCHED_MAX_ALLOCS_PER_CMD	(4)
40 #define WMI_RF_DTYPE_LENGTH		(3)
41 #define WMI_RF_ETYPE_LENGTH		(3)
42 #define WMI_RF_RX2TX_LENGTH		(3)
43 #define WMI_RF_ETYPE_VAL_PER_RANGE	(5)
44 /* DTYPE configuration array size
45  * must always be kept equal to (WMI_RF_DTYPE_LENGTH+1)
46  */
47 #define WMI_RF_DTYPE_CONF_LENGTH	(4)
48 /* ETYPE configuration array size
49  * must always be kept equal to
50  * (WMI_RF_ETYPE_LENGTH+WMI_RF_ETYPE_VAL_PER_RANGE)
51  */
52 #define WMI_RF_ETYPE_CONF_LENGTH	(8)
53 /* RX2TX configuration array size
54  * must always be kept equal to (WMI_RF_RX2TX_LENGTH+1)
55  */
56 #define WMI_RF_RX2TX_CONF_LENGTH	(4)
57 /* Qos configuration */
58 #define WMI_QOS_NUM_OF_PRIORITY		(4)
59 #define WMI_QOS_MIN_DEFAULT_WEIGHT	(10)
60 #define WMI_QOS_VRING_SLOT_MIN_MS	(2)
61 #define WMI_QOS_VRING_SLOT_MAX_MS	(10)
62 /* (WMI_QOS_MIN_DEFAULT_WEIGHT * WMI_QOS_VRING_SLOT_MAX_MS /
63  * WMI_QOS_VRING_SLOT_MIN_MS)
64  */
65 #define WMI_QOS_MAX_WEIGHT		50
66 #define WMI_QOS_SET_VIF_PRIORITY	(0xFF)
67 #define WMI_QOS_DEFAULT_PRIORITY	(WMI_QOS_NUM_OF_PRIORITY)
68 #define WMI_MAX_XIF_PORTS_NUM		(8)
69 
70 /* Mailbox interface
71  * used for commands and events
72  */
73 enum wmi_mid {
74 	MID_DEFAULT		= 0x00,
75 	FIRST_DBG_MID_ID	= 0x10,
76 	LAST_DBG_MID_ID		= 0xFE,
77 	MID_BROADCAST		= 0xFF,
78 };
79 
80 /* FW capability IDs
81  * Each ID maps to a bit in a 32-bit bitmask value provided by the FW to
82  * the host
83  */
84 enum wmi_fw_capability {
85 	WMI_FW_CAPABILITY_FTM				= 0,
86 	WMI_FW_CAPABILITY_PS_CONFIG			= 1,
87 	WMI_FW_CAPABILITY_RF_SECTORS			= 2,
88 	WMI_FW_CAPABILITY_MGMT_RETRY_LIMIT		= 3,
89 	WMI_FW_CAPABILITY_AP_SME_OFFLOAD_PARTIAL	= 4,
90 	WMI_FW_CAPABILITY_WMI_ONLY			= 5,
91 	WMI_FW_CAPABILITY_THERMAL_THROTTLING		= 7,
92 	WMI_FW_CAPABILITY_D3_SUSPEND			= 8,
93 	WMI_FW_CAPABILITY_LONG_RANGE			= 9,
94 	WMI_FW_CAPABILITY_FIXED_SCHEDULING		= 10,
95 	WMI_FW_CAPABILITY_MULTI_DIRECTED_OMNIS		= 11,
96 	WMI_FW_CAPABILITY_RSSI_REPORTING		= 12,
97 	WMI_FW_CAPABILITY_SET_SILENT_RSSI_TABLE		= 13,
98 	WMI_FW_CAPABILITY_LO_POWER_CALIB_FROM_OTP	= 14,
99 	WMI_FW_CAPABILITY_PNO				= 15,
100 	WMI_FW_CAPABILITY_REF_CLOCK_CONTROL		= 18,
101 	WMI_FW_CAPABILITY_AP_SME_OFFLOAD_NONE		= 19,
102 	WMI_FW_CAPABILITY_MULTI_VIFS			= 20,
103 	WMI_FW_CAPABILITY_FT_ROAMING			= 21,
104 	WMI_FW_CAPABILITY_BACK_WIN_SIZE_64		= 22,
105 	WMI_FW_CAPABILITY_AMSDU				= 23,
106 	WMI_FW_CAPABILITY_RAW_MODE			= 24,
107 	WMI_FW_CAPABILITY_TX_REQ_EXT			= 25,
108 	WMI_FW_CAPABILITY_CHANNEL_4			= 26,
109 	WMI_FW_CAPABILITY_IPA				= 27,
110 	WMI_FW_CAPABILITY_TEMPERATURE_ALL_RF		= 30,
111 	WMI_FW_CAPABILITY_MAX,
112 };
113 
114 /* WMI_CMD_HDR */
115 struct wmi_cmd_hdr {
116 	u8 mid;
117 	u8 reserved;
118 	__le16 command_id;
119 	__le32 fw_timestamp;
120 } __packed;
121 
122 /* List of Commands */
123 enum wmi_command_id {
124 	WMI_CONNECT_CMDID				= 0x01,
125 	WMI_DISCONNECT_CMDID				= 0x03,
126 	WMI_DISCONNECT_STA_CMDID			= 0x04,
127 	WMI_START_SCHED_SCAN_CMDID			= 0x05,
128 	WMI_STOP_SCHED_SCAN_CMDID			= 0x06,
129 	WMI_START_SCAN_CMDID				= 0x07,
130 	WMI_SET_BSS_FILTER_CMDID			= 0x09,
131 	WMI_SET_PROBED_SSID_CMDID			= 0x0A,
132 	/* deprecated */
133 	WMI_SET_LISTEN_INT_CMDID			= 0x0B,
134 	WMI_FT_AUTH_CMDID				= 0x0C,
135 	WMI_FT_REASSOC_CMDID				= 0x0D,
136 	WMI_UPDATE_FT_IES_CMDID				= 0x0E,
137 	WMI_BCON_CTRL_CMDID				= 0x0F,
138 	WMI_ADD_CIPHER_KEY_CMDID			= 0x16,
139 	WMI_DELETE_CIPHER_KEY_CMDID			= 0x17,
140 	WMI_PCP_CONF_CMDID				= 0x18,
141 	WMI_SET_APPIE_CMDID				= 0x3F,
142 	WMI_SET_WSC_STATUS_CMDID			= 0x41,
143 	WMI_PXMT_RANGE_CFG_CMDID			= 0x42,
144 	WMI_PXMT_SNR2_RANGE_CFG_CMDID			= 0x43,
145 	WMI_RADAR_GENERAL_CONFIG_CMDID			= 0x100,
146 	WMI_RADAR_CONFIG_SELECT_CMDID			= 0x101,
147 	WMI_RADAR_PARAMS_CONFIG_CMDID			= 0x102,
148 	WMI_RADAR_SET_MODE_CMDID			= 0x103,
149 	WMI_RADAR_CONTROL_CMDID				= 0x104,
150 	WMI_RADAR_PCI_CONTROL_CMDID			= 0x105,
151 	WMI_MEM_READ_CMDID				= 0x800,
152 	WMI_MEM_WR_CMDID				= 0x801,
153 	WMI_ECHO_CMDID					= 0x803,
154 	WMI_DEEP_ECHO_CMDID				= 0x804,
155 	WMI_CONFIG_MAC_CMDID				= 0x805,
156 	/* deprecated */
157 	WMI_CONFIG_PHY_DEBUG_CMDID			= 0x806,
158 	WMI_ADD_DEBUG_TX_PCKT_CMDID			= 0x808,
159 	WMI_PHY_GET_STATISTICS_CMDID			= 0x809,
160 	/* deprecated */
161 	WMI_FS_TUNE_CMDID				= 0x80A,
162 	/* deprecated */
163 	WMI_CORR_MEASURE_CMDID				= 0x80B,
164 	WMI_READ_RSSI_CMDID				= 0x80C,
165 	WMI_TEMP_SENSE_CMDID				= 0x80E,
166 	WMI_DC_CALIB_CMDID				= 0x80F,
167 	/* deprecated */
168 	WMI_SEND_TONE_CMDID				= 0x810,
169 	/* deprecated */
170 	WMI_IQ_TX_CALIB_CMDID				= 0x811,
171 	/* deprecated */
172 	WMI_IQ_RX_CALIB_CMDID				= 0x812,
173 	WMI_SET_WORK_MODE_CMDID				= 0x815,
174 	WMI_LO_LEAKAGE_CALIB_CMDID			= 0x816,
175 	WMI_LO_POWER_CALIB_FROM_OTP_CMDID		= 0x817,
176 	WMI_SILENT_RSSI_CALIB_CMDID			= 0x81D,
177 	/* deprecated */
178 	WMI_RF_RX_TEST_CMDID				= 0x81E,
179 	WMI_CFG_RX_CHAIN_CMDID				= 0x820,
180 	WMI_VRING_CFG_CMDID				= 0x821,
181 	WMI_BCAST_VRING_CFG_CMDID			= 0x822,
182 	WMI_RING_BA_EN_CMDID				= 0x823,
183 	WMI_RING_BA_DIS_CMDID				= 0x824,
184 	WMI_RCP_ADDBA_RESP_CMDID			= 0x825,
185 	WMI_RCP_DELBA_CMDID				= 0x826,
186 	WMI_SET_SSID_CMDID				= 0x827,
187 	WMI_GET_SSID_CMDID				= 0x828,
188 	WMI_SET_PCP_CHANNEL_CMDID			= 0x829,
189 	WMI_GET_PCP_CHANNEL_CMDID			= 0x82A,
190 	WMI_SW_TX_REQ_CMDID				= 0x82B,
191 	/* Event is shared between WMI_SW_TX_REQ_CMDID and
192 	 * WMI_SW_TX_REQ_EXT_CMDID
193 	 */
194 	WMI_SW_TX_REQ_EXT_CMDID				= 0x82C,
195 	WMI_MLME_PUSH_CMDID				= 0x835,
196 	WMI_BEAMFORMING_MGMT_CMDID			= 0x836,
197 	WMI_BF_TXSS_MGMT_CMDID				= 0x837,
198 	WMI_BF_SM_MGMT_CMDID				= 0x838,
199 	WMI_BF_RXSS_MGMT_CMDID				= 0x839,
200 	WMI_BF_TRIG_CMDID				= 0x83A,
201 	WMI_RCP_ADDBA_RESP_EDMA_CMDID			= 0x83B,
202 	WMI_LINK_MAINTAIN_CFG_WRITE_CMDID		= 0x842,
203 	WMI_LINK_MAINTAIN_CFG_READ_CMDID		= 0x843,
204 	WMI_SET_SECTORS_CMDID				= 0x849,
205 	WMI_MAINTAIN_PAUSE_CMDID			= 0x850,
206 	WMI_MAINTAIN_RESUME_CMDID			= 0x851,
207 	WMI_RS_MGMT_CMDID				= 0x852,
208 	WMI_RF_MGMT_CMDID				= 0x853,
209 	WMI_RF_XPM_READ_CMDID				= 0x856,
210 	WMI_RF_XPM_WRITE_CMDID				= 0x857,
211 	WMI_LED_CFG_CMDID				= 0x858,
212 	WMI_SET_CONNECT_SNR_THR_CMDID			= 0x85B,
213 	WMI_SET_ACTIVE_SILENT_RSSI_TABLE_CMDID		= 0x85C,
214 	WMI_RF_PWR_ON_DELAY_CMDID			= 0x85D,
215 	WMI_SET_HIGH_POWER_TABLE_PARAMS_CMDID		= 0x85E,
216 	WMI_FIXED_SCHEDULING_UL_CONFIG_CMDID		= 0x85F,
217 	/* Performance monitoring commands */
218 	WMI_BF_CTRL_CMDID				= 0x862,
219 	WMI_NOTIFY_REQ_CMDID				= 0x863,
220 	WMI_GET_STATUS_CMDID				= 0x864,
221 	WMI_GET_RF_STATUS_CMDID				= 0x866,
222 	WMI_GET_BASEBAND_TYPE_CMDID			= 0x867,
223 	WMI_VRING_SWITCH_TIMING_CONFIG_CMDID		= 0x868,
224 	WMI_UNIT_TEST_CMDID				= 0x900,
225 	WMI_FLASH_READ_CMDID				= 0x902,
226 	WMI_FLASH_WRITE_CMDID				= 0x903,
227 	/* Power management */
228 	WMI_TRAFFIC_SUSPEND_CMDID			= 0x904,
229 	WMI_TRAFFIC_RESUME_CMDID			= 0x905,
230 	/* P2P */
231 	WMI_P2P_CFG_CMDID				= 0x910,
232 	WMI_PORT_ALLOCATE_CMDID				= 0x911,
233 	WMI_PORT_DELETE_CMDID				= 0x912,
234 	WMI_POWER_MGMT_CFG_CMDID			= 0x913,
235 	WMI_START_LISTEN_CMDID				= 0x914,
236 	WMI_START_SEARCH_CMDID				= 0x915,
237 	WMI_DISCOVERY_START_CMDID			= 0x916,
238 	WMI_DISCOVERY_STOP_CMDID			= 0x917,
239 	WMI_PCP_START_CMDID				= 0x918,
240 	WMI_PCP_STOP_CMDID				= 0x919,
241 	WMI_GET_PCP_FACTOR_CMDID			= 0x91B,
242 	/* Power Save Configuration Commands */
243 	WMI_PS_DEV_PROFILE_CFG_CMDID			= 0x91C,
244 	WMI_RS_ENABLE_CMDID				= 0x91E,
245 	WMI_RS_CFG_EX_CMDID				= 0x91F,
246 	WMI_GET_DETAILED_RS_RES_EX_CMDID		= 0x920,
247 	/* deprecated */
248 	WMI_RS_CFG_CMDID				= 0x921,
249 	/* deprecated */
250 	WMI_GET_DETAILED_RS_RES_CMDID			= 0x922,
251 	WMI_AOA_MEAS_CMDID				= 0x923,
252 	WMI_BRP_SET_ANT_LIMIT_CMDID			= 0x924,
253 	WMI_SET_MGMT_RETRY_LIMIT_CMDID			= 0x930,
254 	WMI_GET_MGMT_RETRY_LIMIT_CMDID			= 0x931,
255 	WMI_NEW_STA_CMDID				= 0x935,
256 	WMI_DEL_STA_CMDID				= 0x936,
257 	WMI_SET_THERMAL_THROTTLING_CFG_CMDID		= 0x940,
258 	WMI_GET_THERMAL_THROTTLING_CFG_CMDID		= 0x941,
259 	/* Read Power Save profile type */
260 	WMI_PS_DEV_PROFILE_CFG_READ_CMDID		= 0x942,
261 	WMI_TSF_SYNC_CMDID				= 0x973,
262 	WMI_TOF_SESSION_START_CMDID			= 0x991,
263 	WMI_TOF_GET_CAPABILITIES_CMDID			= 0x992,
264 	WMI_TOF_SET_LCR_CMDID				= 0x993,
265 	WMI_TOF_SET_LCI_CMDID				= 0x994,
266 	WMI_TOF_CFG_RESPONDER_CMDID			= 0x996,
267 	WMI_TOF_SET_TX_RX_OFFSET_CMDID			= 0x997,
268 	WMI_TOF_GET_TX_RX_OFFSET_CMDID			= 0x998,
269 	WMI_TOF_CHANNEL_INFO_CMDID			= 0x999,
270 	WMI_GET_RF_SECTOR_PARAMS_CMDID			= 0x9A0,
271 	WMI_SET_RF_SECTOR_PARAMS_CMDID			= 0x9A1,
272 	WMI_GET_SELECTED_RF_SECTOR_INDEX_CMDID		= 0x9A2,
273 	WMI_SET_SELECTED_RF_SECTOR_INDEX_CMDID		= 0x9A3,
274 	WMI_SET_RF_SECTOR_ON_CMDID			= 0x9A4,
275 	WMI_PRIO_TX_SECTORS_ORDER_CMDID			= 0x9A5,
276 	WMI_PRIO_TX_SECTORS_NUMBER_CMDID		= 0x9A6,
277 	WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_CMDID	= 0x9A7,
278 	/* deprecated */
279 	WMI_BF_CONTROL_CMDID				= 0x9AA,
280 	WMI_BF_CONTROL_EX_CMDID				= 0x9AB,
281 	WMI_TX_STATUS_RING_ADD_CMDID			= 0x9C0,
282 	WMI_RX_STATUS_RING_ADD_CMDID			= 0x9C1,
283 	WMI_TX_DESC_RING_ADD_CMDID			= 0x9C2,
284 	WMI_RX_DESC_RING_ADD_CMDID			= 0x9C3,
285 	WMI_BCAST_DESC_RING_ADD_CMDID			= 0x9C4,
286 	WMI_CFG_DEF_RX_OFFLOAD_CMDID			= 0x9C5,
287 	WMI_SCHEDULING_SCHEME_CMDID			= 0xA01,
288 	WMI_FIXED_SCHEDULING_CONFIG_CMDID		= 0xA02,
289 	WMI_ENABLE_FIXED_SCHEDULING_CMDID		= 0xA03,
290 	WMI_SET_MULTI_DIRECTED_OMNIS_CONFIG_CMDID	= 0xA04,
291 	WMI_SET_LONG_RANGE_CONFIG_CMDID			= 0xA05,
292 	WMI_GET_ASSOC_LIST_CMDID			= 0xA06,
293 	WMI_GET_CCA_INDICATIONS_CMDID			= 0xA07,
294 	WMI_SET_CCA_INDICATIONS_BI_AVG_NUM_CMDID	= 0xA08,
295 	WMI_INTERNAL_FW_IOCTL_CMDID			= 0xA0B,
296 	WMI_LINK_STATS_CMDID				= 0xA0C,
297 	WMI_SET_GRANT_MCS_CMDID				= 0xA0E,
298 	WMI_SET_AP_SLOT_SIZE_CMDID			= 0xA0F,
299 	WMI_SET_VRING_PRIORITY_WEIGHT_CMDID		= 0xA10,
300 	WMI_SET_VRING_PRIORITY_CMDID			= 0xA11,
301 	WMI_RBUFCAP_CFG_CMDID				= 0xA12,
302 	WMI_TEMP_SENSE_ALL_CMDID			= 0xA13,
303 	WMI_SET_MAC_ADDRESS_CMDID			= 0xF003,
304 	WMI_ABORT_SCAN_CMDID				= 0xF007,
305 	WMI_SET_PROMISCUOUS_MODE_CMDID			= 0xF041,
306 	/* deprecated */
307 	WMI_GET_PMK_CMDID				= 0xF048,
308 	WMI_SET_PASSPHRASE_CMDID			= 0xF049,
309 	/* deprecated */
310 	WMI_SEND_ASSOC_RES_CMDID			= 0xF04A,
311 	/* deprecated */
312 	WMI_SET_ASSOC_REQ_RELAY_CMDID			= 0xF04B,
313 	WMI_MAC_ADDR_REQ_CMDID				= 0xF04D,
314 	WMI_FW_VER_CMDID				= 0xF04E,
315 	WMI_PMC_CMDID					= 0xF04F,
316 };
317 
318 /* WMI_CONNECT_CMDID */
319 enum wmi_network_type {
320 	WMI_NETTYPE_INFRA		= 0x01,
321 	WMI_NETTYPE_ADHOC		= 0x02,
322 	WMI_NETTYPE_ADHOC_CREATOR	= 0x04,
323 	WMI_NETTYPE_AP			= 0x10,
324 	WMI_NETTYPE_P2P			= 0x20,
325 	/* PCIE over 60g */
326 	WMI_NETTYPE_WBE			= 0x40,
327 };
328 
329 enum wmi_dot11_auth_mode {
330 	WMI_AUTH11_OPEN		= 0x01,
331 	WMI_AUTH11_SHARED	= 0x02,
332 	WMI_AUTH11_LEAP		= 0x04,
333 	WMI_AUTH11_WSC		= 0x08,
334 };
335 
336 enum wmi_auth_mode {
337 	WMI_AUTH_NONE		= 0x01,
338 	WMI_AUTH_WPA		= 0x02,
339 	WMI_AUTH_WPA2		= 0x04,
340 	WMI_AUTH_WPA_PSK	= 0x08,
341 	WMI_AUTH_WPA2_PSK	= 0x10,
342 	WMI_AUTH_WPA_CCKM	= 0x20,
343 	WMI_AUTH_WPA2_CCKM	= 0x40,
344 };
345 
346 enum wmi_crypto_type {
347 	WMI_CRYPT_NONE		= 0x01,
348 	WMI_CRYPT_AES_GCMP	= 0x20,
349 };
350 
351 enum wmi_connect_ctrl_flag_bits {
352 	WMI_CONNECT_ASSOC_POLICY_USER		= 0x01,
353 	WMI_CONNECT_SEND_REASSOC		= 0x02,
354 	WMI_CONNECT_IGNORE_WPA_GROUP_CIPHER	= 0x04,
355 	WMI_CONNECT_PROFILE_MATCH_DONE		= 0x08,
356 	WMI_CONNECT_IGNORE_AAC_BEACON		= 0x10,
357 	WMI_CONNECT_CSA_FOLLOW_BSS		= 0x20,
358 	WMI_CONNECT_DO_WPA_OFFLOAD		= 0x40,
359 	WMI_CONNECT_DO_NOT_DEAUTH		= 0x80,
360 };
361 
362 #define WMI_MAX_SSID_LEN	(32)
363 
364 /* WMI_CONNECT_CMDID */
365 struct wmi_connect_cmd {
366 	u8 network_type;
367 	u8 dot11_auth_mode;
368 	u8 auth_mode;
369 	u8 pairwise_crypto_type;
370 	u8 pairwise_crypto_len;
371 	u8 group_crypto_type;
372 	u8 group_crypto_len;
373 	u8 ssid_len;
374 	u8 ssid[WMI_MAX_SSID_LEN];
375 	u8 channel;
376 	u8 reserved0;
377 	u8 bssid[WMI_MAC_LEN];
378 	__le32 ctrl_flags;
379 	u8 dst_mac[WMI_MAC_LEN];
380 	u8 reserved1[2];
381 } __packed;
382 
383 /* WMI_DISCONNECT_STA_CMDID */
384 struct wmi_disconnect_sta_cmd {
385 	u8 dst_mac[WMI_MAC_LEN];
386 	__le16 disconnect_reason;
387 } __packed;
388 
389 #define WMI_MAX_KEY_INDEX	(3)
390 #define WMI_MAX_KEY_LEN		(32)
391 #define WMI_PASSPHRASE_LEN	(64)
392 
393 /* WMI_SET_PASSPHRASE_CMDID */
394 struct wmi_set_passphrase_cmd {
395 	u8 ssid[WMI_MAX_SSID_LEN];
396 	u8 passphrase[WMI_PASSPHRASE_LEN];
397 	u8 ssid_len;
398 	u8 passphrase_len;
399 } __packed;
400 
401 /* WMI_ADD_CIPHER_KEY_CMDID */
402 enum wmi_key_usage {
403 	WMI_KEY_USE_PAIRWISE	= 0x00,
404 	WMI_KEY_USE_RX_GROUP	= 0x01,
405 	WMI_KEY_USE_TX_GROUP	= 0x02,
406 };
407 
408 struct wmi_add_cipher_key_cmd {
409 	u8 key_index;
410 	u8 key_type;
411 	/* enum wmi_key_usage */
412 	u8 key_usage;
413 	u8 key_len;
414 	/* key replay sequence counter */
415 	u8 key_rsc[8];
416 	u8 key[WMI_MAX_KEY_LEN];
417 	/* Additional Key Control information */
418 	u8 key_op_ctrl;
419 	u8 mac[WMI_MAC_LEN];
420 } __packed;
421 
422 /* WMI_DELETE_CIPHER_KEY_CMDID */
423 struct wmi_delete_cipher_key_cmd {
424 	u8 key_index;
425 	u8 mac[WMI_MAC_LEN];
426 } __packed;
427 
428 /* WMI_START_SCAN_CMDID
429  *
430  * Start L1 scan operation
431  *
432  * Returned events:
433  * - WMI_RX_MGMT_PACKET_EVENTID - for every probe resp.
434  * - WMI_SCAN_COMPLETE_EVENTID
435  */
436 enum wmi_scan_type {
437 	WMI_ACTIVE_SCAN		= 0x00,
438 	WMI_SHORT_SCAN		= 0x01,
439 	WMI_PASSIVE_SCAN	= 0x02,
440 	WMI_DIRECT_SCAN		= 0x03,
441 	WMI_LONG_SCAN		= 0x04,
442 };
443 
444 /* WMI_START_SCAN_CMDID */
445 struct wmi_start_scan_cmd {
446 	u8 direct_scan_mac_addr[WMI_MAC_LEN];
447 	/* run scan with discovery beacon. Relevant for ACTIVE scan only. */
448 	u8 discovery_mode;
449 	u8 reserved;
450 	/* Max duration in the home channel(ms) */
451 	__le32 dwell_time;
452 	/* Time interval between scans (ms) */
453 	__le32 force_scan_interval;
454 	/* enum wmi_scan_type */
455 	u8 scan_type;
456 	/* how many channels follow */
457 	u8 num_channels;
458 	/* channels ID's:
459 	 * 0 - 58320 MHz
460 	 * 1 - 60480 MHz
461 	 * 2 - 62640 MHz
462 	 */
463 	struct {
464 		u8 channel;
465 		u8 reserved;
466 	} channel_list[0];
467 } __packed;
468 
469 #define WMI_MAX_PNO_SSID_NUM	(16)
470 #define WMI_MAX_CHANNEL_NUM	(6)
471 #define WMI_MAX_PLANS_NUM	(2)
472 
473 /* WMI_START_SCHED_SCAN_CMDID */
474 struct wmi_sched_scan_ssid_match {
475 	u8 ssid_len;
476 	u8 ssid[WMI_MAX_SSID_LEN];
477 	s8 rssi_threshold;
478 	/* boolean */
479 	u8 add_ssid_to_probe;
480 	u8 reserved;
481 } __packed;
482 
483 /* WMI_START_SCHED_SCAN_CMDID */
484 struct wmi_sched_scan_plan {
485 	__le16 interval_sec;
486 	__le16 num_of_iterations;
487 } __packed;
488 
489 /* WMI_START_SCHED_SCAN_CMDID */
490 struct wmi_start_sched_scan_cmd {
491 	struct wmi_sched_scan_ssid_match ssid_for_match[WMI_MAX_PNO_SSID_NUM];
492 	u8 num_of_ssids;
493 	s8 min_rssi_threshold;
494 	u8 channel_list[WMI_MAX_CHANNEL_NUM];
495 	u8 num_of_channels;
496 	u8 reserved;
497 	__le16 initial_delay_sec;
498 	struct wmi_sched_scan_plan scan_plans[WMI_MAX_PLANS_NUM];
499 } __packed;
500 
501 /* WMI_FT_AUTH_CMDID */
502 struct wmi_ft_auth_cmd {
503 	u8 bssid[WMI_MAC_LEN];
504 	/* enum wmi_channel */
505 	u8 channel;
506 	/* enum wmi_channel */
507 	u8 edmg_channel;
508 	u8 reserved[4];
509 } __packed;
510 
511 /* WMI_FT_REASSOC_CMDID */
512 struct wmi_ft_reassoc_cmd {
513 	u8 bssid[WMI_MAC_LEN];
514 	u8 reserved[2];
515 } __packed;
516 
517 /* WMI_UPDATE_FT_IES_CMDID */
518 struct wmi_update_ft_ies_cmd {
519 	/* Length of the FT IEs */
520 	__le16 ie_len;
521 	u8 reserved[2];
522 	u8 ie_info[0];
523 } __packed;
524 
525 /* WMI_SET_PROBED_SSID_CMDID */
526 #define MAX_PROBED_SSID_INDEX	(3)
527 
528 enum wmi_ssid_flag {
529 	/* disables entry */
530 	WMI_SSID_FLAG_DISABLE	= 0x00,
531 	/* probes specified ssid */
532 	WMI_SSID_FLAG_SPECIFIC	= 0x01,
533 	/* probes for any ssid */
534 	WMI_SSID_FLAG_ANY	= 0x02,
535 };
536 
537 struct wmi_probed_ssid_cmd {
538 	/* 0 to MAX_PROBED_SSID_INDEX */
539 	u8 entry_index;
540 	/* enum wmi_ssid_flag */
541 	u8 flag;
542 	u8 ssid_len;
543 	u8 ssid[WMI_MAX_SSID_LEN];
544 } __packed;
545 
546 /* WMI_SET_APPIE_CMDID
547  * Add Application specified IE to a management frame
548  */
549 #define WMI_MAX_IE_LEN	(1024)
550 
551 /* Frame Types */
552 enum wmi_mgmt_frame_type {
553 	WMI_FRAME_BEACON	= 0x00,
554 	WMI_FRAME_PROBE_REQ	= 0x01,
555 	WMI_FRAME_PROBE_RESP	= 0x02,
556 	WMI_FRAME_ASSOC_REQ	= 0x03,
557 	WMI_FRAME_ASSOC_RESP	= 0x04,
558 	WMI_NUM_MGMT_FRAME	= 0x05,
559 };
560 
561 struct wmi_set_appie_cmd {
562 	/* enum wmi_mgmt_frame_type */
563 	u8 mgmt_frm_type;
564 	u8 reserved;
565 	/* Length of the IE to be added to MGMT frame */
566 	__le16 ie_len;
567 	u8 ie_info[0];
568 } __packed;
569 
570 /* WMI_PXMT_RANGE_CFG_CMDID */
571 struct wmi_pxmt_range_cfg_cmd {
572 	u8 dst_mac[WMI_MAC_LEN];
573 	__le16 range;
574 } __packed;
575 
576 /* WMI_PXMT_SNR2_RANGE_CFG_CMDID */
577 struct wmi_pxmt_snr2_range_cfg_cmd {
578 	s8 snr2range_arr[2];
579 } __packed;
580 
581 /* WMI_RADAR_GENERAL_CONFIG_CMDID */
582 struct wmi_radar_general_config_cmd {
583 	/* Number of pulses (CIRs) in FW FIFO to initiate pulses transfer
584 	 * from FW to Host
585 	 */
586 	__le32 fifo_watermark;
587 	/* In unit of us, in the range [100, 1000000] */
588 	__le32 t_burst;
589 	/* Valid in the range [1, 32768], 0xFFFF means infinite */
590 	__le32 n_bursts;
591 	/* In unit of 330Mhz clk, in the range [4, 2000]*330 */
592 	__le32 t_pulse;
593 	/* In the range of [1,4096] */
594 	__le16 n_pulses;
595 	/* Number of taps after cTap per CIR */
596 	__le16 n_samples;
597 	/* Offset from the main tap (0 = zero-distance). In the range of [0,
598 	 * 255]
599 	 */
600 	u8 first_sample_offset;
601 	/* Number of Pulses to average, 1, 2, 4, 8 */
602 	u8 pulses_to_avg;
603 	/* Number of adjacent taps to average, 1, 2, 4, 8 */
604 	u8 samples_to_avg;
605 	/* The index to config general params */
606 	u8 general_index;
607 	u8 reserved[4];
608 } __packed;
609 
610 /* WMI_RADAR_CONFIG_SELECT_CMDID */
611 struct wmi_radar_config_select_cmd {
612 	/* Select the general params index to use */
613 	u8 general_index;
614 	u8 reserved[3];
615 	/* 0 means don't update burst_active_vector */
616 	__le32 burst_active_vector;
617 	/* 0 means don't update pulse_active_vector */
618 	__le32 pulse_active_vector;
619 } __packed;
620 
621 /* WMI_RADAR_PARAMS_CONFIG_CMDID */
622 struct wmi_radar_params_config_cmd {
623 	/* The burst index selected to config */
624 	u8 burst_index;
625 	/* 0-not active, 1-active */
626 	u8 burst_en;
627 	/* The pulse index selected to config */
628 	u8 pulse_index;
629 	/* 0-not active, 1-active */
630 	u8 pulse_en;
631 	/* TX RF to use on current pulse */
632 	u8 tx_rfc_idx;
633 	u8 tx_sector;
634 	/* Offset from calibrated value.(expected to be 0)(value is row in
635 	 * Gain-LUT, not dB)
636 	 */
637 	s8 tx_rf_gain_comp;
638 	/* expected to be 0 */
639 	s8 tx_bb_gain_comp;
640 	/* RX RF to use on current pulse */
641 	u8 rx_rfc_idx;
642 	u8 rx_sector;
643 	/* Offset from calibrated value.(expected to be 0)(value is row in
644 	 * Gain-LUT, not dB)
645 	 */
646 	s8 rx_rf_gain_comp;
647 	/* Value in dB.(expected to be 0) */
648 	s8 rx_bb_gain_comp;
649 	/* Offset from calibrated value.(expected to be 0) */
650 	s8 rx_timing_offset;
651 	u8 reserved[3];
652 } __packed;
653 
654 /* WMI_RADAR_SET_MODE_CMDID */
655 struct wmi_radar_set_mode_cmd {
656 	/* 0-disable/1-enable */
657 	u8 enable;
658 	/* enum wmi_channel */
659 	u8 channel;
660 	/* In the range of [0,7], 0xff means use default */
661 	u8 tx_rfc_idx;
662 	/* In the range of [0,7], 0xff means use default */
663 	u8 rx_rfc_idx;
664 } __packed;
665 
666 /* WMI_RADAR_CONTROL_CMDID */
667 struct wmi_radar_control_cmd {
668 	/* 0-stop/1-start */
669 	u8 start;
670 	u8 reserved[3];
671 } __packed;
672 
673 /* WMI_RADAR_PCI_CONTROL_CMDID */
674 struct wmi_radar_pci_control_cmd {
675 	/* pcie host buffer start address */
676 	__le64 base_addr;
677 	/* pcie host control block address */
678 	__le64 control_block_addr;
679 	/* pcie host buffer size */
680 	__le32 buffer_size;
681 	__le32 reserved;
682 } __packed;
683 
684 /* WMI_RF_MGMT_CMDID */
685 enum wmi_rf_mgmt_type {
686 	WMI_RF_MGMT_W_DISABLE	= 0x00,
687 	WMI_RF_MGMT_W_ENABLE	= 0x01,
688 	WMI_RF_MGMT_GET_STATUS	= 0x02,
689 };
690 
691 /* WMI_BF_CONTROL_CMDID */
692 enum wmi_bf_triggers {
693 	WMI_BF_TRIGGER_RS_MCS1_TH_FAILURE		= 0x01,
694 	WMI_BF_TRIGGER_RS_MCS1_NO_BACK_FAILURE		= 0x02,
695 	WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_TXOP		= 0x04,
696 	WMI_BF_TRIGGER_MAX_BACK_FAILURE			= 0x08,
697 	WMI_BF_TRIGGER_FW				= 0x10,
698 	WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_KEEP_ALIVE	= 0x20,
699 	WMI_BF_TRIGGER_AOA				= 0x40,
700 	WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_UPM		= 0x80,
701 };
702 
703 /* WMI_RF_MGMT_CMDID */
704 struct wmi_rf_mgmt_cmd {
705 	__le32 rf_mgmt_type;
706 } __packed;
707 
708 /* WMI_CORR_MEASURE_CMDID */
709 struct wmi_corr_measure_cmd {
710 	__le32 freq_mhz;
711 	__le32 length_samples;
712 	__le32 iterations;
713 } __packed;
714 
715 /* WMI_SET_SSID_CMDID */
716 struct wmi_set_ssid_cmd {
717 	__le32 ssid_len;
718 	u8 ssid[WMI_MAX_SSID_LEN];
719 } __packed;
720 
721 /* WMI_SET_PCP_CHANNEL_CMDID */
722 struct wmi_set_pcp_channel_cmd {
723 	u8 channel;
724 	u8 reserved[3];
725 } __packed;
726 
727 /* WMI_BCON_CTRL_CMDID */
728 struct wmi_bcon_ctrl_cmd {
729 	__le16 bcon_interval;
730 	__le16 frag_num;
731 	__le64 ss_mask;
732 	u8 network_type;
733 	u8 pcp_max_assoc_sta;
734 	u8 disable_sec_offload;
735 	u8 disable_sec;
736 	u8 hidden_ssid;
737 	u8 is_go;
738 	/* A-BFT length override if non-0 */
739 	u8 abft_len;
740 	u8 reserved;
741 } __packed;
742 
743 /* WMI_PORT_ALLOCATE_CMDID */
744 enum wmi_port_role {
745 	WMI_PORT_STA		= 0x00,
746 	WMI_PORT_PCP		= 0x01,
747 	WMI_PORT_AP		= 0x02,
748 	WMI_PORT_P2P_DEV	= 0x03,
749 	WMI_PORT_P2P_CLIENT	= 0x04,
750 	WMI_PORT_P2P_GO		= 0x05,
751 };
752 
753 /* WMI_PORT_ALLOCATE_CMDID */
754 struct wmi_port_allocate_cmd {
755 	u8 mac[WMI_MAC_LEN];
756 	u8 port_role;
757 	u8 mid;
758 } __packed;
759 
760 /* WMI_PORT_DELETE_CMDID */
761 struct wmi_port_delete_cmd {
762 	u8 mid;
763 	u8 reserved[3];
764 } __packed;
765 
766 /* WMI_TRAFFIC_SUSPEND_CMD wakeup trigger bit mask values */
767 enum wmi_wakeup_trigger {
768 	WMI_WAKEUP_TRIGGER_UCAST	= 0x01,
769 	WMI_WAKEUP_TRIGGER_BCAST	= 0x02,
770 };
771 
772 /* WMI_TRAFFIC_SUSPEND_CMDID */
773 struct wmi_traffic_suspend_cmd {
774 	/* Bit vector: bit[0] - wake on Unicast, bit[1] - wake on Broadcast */
775 	u8 wakeup_trigger;
776 } __packed;
777 
778 /* WMI_P2P_CFG_CMDID */
779 enum wmi_discovery_mode {
780 	WMI_DISCOVERY_MODE_NON_OFFLOAD	= 0x00,
781 	WMI_DISCOVERY_MODE_OFFLOAD	= 0x01,
782 	WMI_DISCOVERY_MODE_PEER2PEER	= 0x02,
783 };
784 
785 struct wmi_p2p_cfg_cmd {
786 	/* enum wmi_discovery_mode */
787 	u8 discovery_mode;
788 	u8 channel;
789 	/* base to listen/search duration calculation */
790 	__le16 bcon_interval;
791 } __packed;
792 
793 /* WMI_POWER_MGMT_CFG_CMDID */
794 enum wmi_power_source_type {
795 	WMI_POWER_SOURCE_BATTERY	= 0x00,
796 	WMI_POWER_SOURCE_OTHER		= 0x01,
797 };
798 
799 struct wmi_power_mgmt_cfg_cmd {
800 	/* enum wmi_power_source_type */
801 	u8 power_source;
802 	u8 reserved[3];
803 } __packed;
804 
805 /* WMI_PCP_START_CMDID */
806 enum wmi_ap_sme_offload_mode {
807 	/* Full AP SME in FW */
808 	WMI_AP_SME_OFFLOAD_FULL		= 0x00,
809 	/* Probe AP SME in FW */
810 	WMI_AP_SME_OFFLOAD_PARTIAL	= 0x01,
811 	/* AP SME in host */
812 	WMI_AP_SME_OFFLOAD_NONE		= 0x02,
813 };
814 
815 /* WMI_PCP_START_CMDID */
816 struct wmi_pcp_start_cmd {
817 	__le16 bcon_interval;
818 	u8 pcp_max_assoc_sta;
819 	u8 hidden_ssid;
820 	u8 is_go;
821 	/* enum wmi_channel WMI_CHANNEL_9..WMI_CHANNEL_12 */
822 	u8 edmg_channel;
823 	u8 raw_mode;
824 	u8 reserved[3];
825 	/* A-BFT length override if non-0 */
826 	u8 abft_len;
827 	/* enum wmi_ap_sme_offload_mode_e */
828 	u8 ap_sme_offload_mode;
829 	u8 network_type;
830 	/* enum wmi_channel WMI_CHANNEL_1..WMI_CHANNEL_6; for EDMG this is
831 	 * the primary channel number
832 	 */
833 	u8 channel;
834 	u8 disable_sec_offload;
835 	u8 disable_sec;
836 } __packed;
837 
838 /* WMI_SW_TX_REQ_CMDID */
839 struct wmi_sw_tx_req_cmd {
840 	u8 dst_mac[WMI_MAC_LEN];
841 	__le16 len;
842 	u8 payload[0];
843 } __packed;
844 
845 /* WMI_SW_TX_REQ_EXT_CMDID */
846 struct wmi_sw_tx_req_ext_cmd {
847 	u8 dst_mac[WMI_MAC_LEN];
848 	__le16 len;
849 	__le16 duration_ms;
850 	/* Channel to use, 0xFF for currently active channel */
851 	u8 channel;
852 	u8 reserved[5];
853 	u8 payload[0];
854 } __packed;
855 
856 /* WMI_VRING_SWITCH_TIMING_CONFIG_CMDID */
857 struct wmi_vring_switch_timing_config_cmd {
858 	/* Set vring timing configuration:
859 	 *
860 	 * defined interval for vring switch
861 	 */
862 	__le32 interval_usec;
863 	/* vring inactivity threshold */
864 	__le32 idle_th_usec;
865 } __packed;
866 
867 struct wmi_sw_ring_cfg {
868 	__le64 ring_mem_base;
869 	__le16 ring_size;
870 	__le16 max_mpdu_size;
871 } __packed;
872 
873 /* wmi_vring_cfg_schd */
874 struct wmi_vring_cfg_schd {
875 	__le16 priority;
876 	__le16 timeslot_us;
877 } __packed;
878 
879 enum wmi_vring_cfg_encap_trans_type {
880 	WMI_VRING_ENC_TYPE_802_3	= 0x00,
881 	WMI_VRING_ENC_TYPE_NATIVE_WIFI	= 0x01,
882 	WMI_VRING_ENC_TYPE_NONE		= 0x02,
883 };
884 
885 enum wmi_vring_cfg_ds_cfg {
886 	WMI_VRING_DS_PBSS	= 0x00,
887 	WMI_VRING_DS_STATION	= 0x01,
888 	WMI_VRING_DS_AP		= 0x02,
889 	WMI_VRING_DS_ADDR4	= 0x03,
890 };
891 
892 enum wmi_vring_cfg_nwifi_ds_trans_type {
893 	WMI_NWIFI_TX_TRANS_MODE_NO		= 0x00,
894 	WMI_NWIFI_TX_TRANS_MODE_AP2PBSS		= 0x01,
895 	WMI_NWIFI_TX_TRANS_MODE_STA2PBSS	= 0x02,
896 };
897 
898 enum wmi_vring_cfg_schd_params_priority {
899 	WMI_SCH_PRIO_REGULAR	= 0x00,
900 	WMI_SCH_PRIO_HIGH	= 0x01,
901 };
902 
903 #define CIDXTID_EXTENDED_CID_TID		(0xFF)
904 #define CIDXTID_CID_POS				(0)
905 #define CIDXTID_CID_LEN				(4)
906 #define CIDXTID_CID_MSK				(0xF)
907 #define CIDXTID_TID_POS				(4)
908 #define CIDXTID_TID_LEN				(4)
909 #define CIDXTID_TID_MSK				(0xF0)
910 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_POS	(0)
911 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_LEN	(1)
912 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_MSK	(0x1)
913 #define VRING_CFG_MAC_CTRL_AGGR_EN_POS		(1)
914 #define VRING_CFG_MAC_CTRL_AGGR_EN_LEN		(1)
915 #define VRING_CFG_MAC_CTRL_AGGR_EN_MSK		(0x2)
916 #define VRING_CFG_TO_RESOLUTION_VALUE_POS	(0)
917 #define VRING_CFG_TO_RESOLUTION_VALUE_LEN	(6)
918 #define VRING_CFG_TO_RESOLUTION_VALUE_MSK	(0x3F)
919 
920 struct wmi_vring_cfg {
921 	struct wmi_sw_ring_cfg tx_sw_ring;
922 	/* 0-23 vrings */
923 	u8 ringid;
924 	/* Used for cid less than 8. For higher cid set
925 	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
926 	 */
927 	u8 cidxtid;
928 	u8 encap_trans_type;
929 	/* 802.3 DS cfg */
930 	u8 ds_cfg;
931 	u8 nwifi_ds_trans_type;
932 	u8 mac_ctrl;
933 	u8 to_resolution;
934 	u8 agg_max_wsize;
935 	struct wmi_vring_cfg_schd schd_params;
936 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
937 	u8 cid;
938 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
939 	u8 tid;
940 	/* Update the vring's priority for Qos purpose. Set to
941 	 * WMI_QOS_DEFAULT_PRIORITY to use MID's QoS priority
942 	 */
943 	u8 qos_priority;
944 	u8 reserved;
945 } __packed;
946 
947 enum wmi_vring_cfg_cmd_action {
948 	WMI_VRING_CMD_ADD	= 0x00,
949 	WMI_VRING_CMD_MODIFY	= 0x01,
950 	WMI_VRING_CMD_DELETE	= 0x02,
951 };
952 
953 /* WMI_VRING_CFG_CMDID */
954 struct wmi_vring_cfg_cmd {
955 	__le32 action;
956 	struct wmi_vring_cfg vring_cfg;
957 } __packed;
958 
959 struct wmi_bcast_vring_cfg {
960 	struct wmi_sw_ring_cfg tx_sw_ring;
961 	/* 0-23 vrings */
962 	u8 ringid;
963 	u8 encap_trans_type;
964 	/* 802.3 DS cfg */
965 	u8 ds_cfg;
966 	u8 nwifi_ds_trans_type;
967 } __packed;
968 
969 /* WMI_BCAST_VRING_CFG_CMDID */
970 struct wmi_bcast_vring_cfg_cmd {
971 	__le32 action;
972 	struct wmi_bcast_vring_cfg vring_cfg;
973 } __packed;
974 
975 struct wmi_edma_ring_cfg {
976 	__le64 ring_mem_base;
977 	/* size in number of items */
978 	__le16 ring_size;
979 	u8 ring_id;
980 	u8 reserved;
981 } __packed;
982 
983 enum wmi_rx_msg_type {
984 	WMI_RX_MSG_TYPE_COMPRESSED	= 0x00,
985 	WMI_RX_MSG_TYPE_EXTENDED	= 0x01,
986 };
987 
988 enum wmi_ring_add_irq_mode {
989 	/* Backwards compatibility
990 	 *  for DESC ring - interrupt disabled
991 	 *  for STATUS ring - interrupt enabled
992 	 */
993 	WMI_RING_ADD_IRQ_MODE_BWC	= 0x00,
994 	WMI_RING_ADD_IRQ_MODE_DISABLE	= 0x01,
995 	WMI_RING_ADD_IRQ_MODE_ENABLE	= 0x02,
996 };
997 
998 struct wmi_tx_status_ring_add_cmd {
999 	struct wmi_edma_ring_cfg ring_cfg;
1000 	u8 irq_index;
1001 	/* wmi_ring_add_irq_mode */
1002 	u8 irq_mode;
1003 	u8 reserved[2];
1004 } __packed;
1005 
1006 struct wmi_rx_status_ring_add_cmd {
1007 	struct wmi_edma_ring_cfg ring_cfg;
1008 	u8 irq_index;
1009 	/* wmi_rx_msg_type */
1010 	u8 rx_msg_type;
1011 	u8 reserved[2];
1012 } __packed;
1013 
1014 struct wmi_cfg_def_rx_offload_cmd {
1015 	__le16 max_msdu_size;
1016 	__le16 max_rx_pl_per_desc;
1017 	u8 decap_trans_type;
1018 	u8 l2_802_3_offload_ctrl;
1019 	u8 l2_nwifi_offload_ctrl;
1020 	u8 vlan_id;
1021 	u8 nwifi_ds_trans_type;
1022 	u8 l3_l4_ctrl;
1023 	u8 reserved[6];
1024 } __packed;
1025 
1026 struct wmi_tx_desc_ring_add_cmd {
1027 	struct wmi_edma_ring_cfg ring_cfg;
1028 	__le16 max_msdu_size;
1029 	/* Correlated status ring (0-63) */
1030 	u8 status_ring_id;
1031 	u8 cid;
1032 	u8 tid;
1033 	u8 encap_trans_type;
1034 	u8 mac_ctrl;
1035 	u8 to_resolution;
1036 	u8 agg_max_wsize;
1037 	u8 irq_index;
1038 	/* wmi_ring_add_irq_mode */
1039 	u8 irq_mode;
1040 	u8 reserved;
1041 	struct wmi_vring_cfg_schd schd_params;
1042 } __packed;
1043 
1044 struct wmi_rx_desc_ring_add_cmd {
1045 	struct wmi_edma_ring_cfg ring_cfg;
1046 	u8 irq_index;
1047 	/* 0-63 status rings */
1048 	u8 status_ring_id;
1049 	u8 reserved[2];
1050 	__le64 sw_tail_host_addr;
1051 } __packed;
1052 
1053 struct wmi_bcast_desc_ring_add_cmd {
1054 	struct wmi_edma_ring_cfg ring_cfg;
1055 	__le16 max_msdu_size;
1056 	/* Correlated status ring (0-63) */
1057 	u8 status_ring_id;
1058 	u8 encap_trans_type;
1059 	u8 reserved[4];
1060 } __packed;
1061 
1062 /* WMI_LO_POWER_CALIB_FROM_OTP_CMDID */
1063 struct wmi_lo_power_calib_from_otp_cmd {
1064 	/* index to read from OTP. zero based */
1065 	u8 index;
1066 	u8 reserved[3];
1067 } __packed;
1068 
1069 /* WMI_LO_POWER_CALIB_FROM_OTP_EVENTID */
1070 struct wmi_lo_power_calib_from_otp_event {
1071 	/* wmi_fw_status */
1072 	u8 status;
1073 	u8 reserved[3];
1074 } __packed;
1075 
1076 /* WMI_RING_BA_EN_CMDID */
1077 struct wmi_ring_ba_en_cmd {
1078 	u8 ring_id;
1079 	u8 agg_max_wsize;
1080 	__le16 ba_timeout;
1081 	u8 amsdu;
1082 	u8 reserved[3];
1083 } __packed;
1084 
1085 /* WMI_RING_BA_DIS_CMDID */
1086 struct wmi_ring_ba_dis_cmd {
1087 	u8 ring_id;
1088 	u8 reserved;
1089 	__le16 reason;
1090 } __packed;
1091 
1092 /* WMI_NOTIFY_REQ_CMDID */
1093 struct wmi_notify_req_cmd {
1094 	u8 cid;
1095 	u8 year;
1096 	u8 month;
1097 	u8 day;
1098 	__le32 interval_usec;
1099 	u8 hour;
1100 	u8 minute;
1101 	u8 second;
1102 	u8 miliseconds;
1103 } __packed;
1104 
1105 /* WMI_CFG_RX_CHAIN_CMDID */
1106 enum wmi_sniffer_cfg_mode {
1107 	WMI_SNIFFER_OFF	= 0x00,
1108 	WMI_SNIFFER_ON	= 0x01,
1109 };
1110 
1111 /* WMI_SILENT_RSSI_TABLE */
1112 enum wmi_silent_rssi_table {
1113 	RF_TEMPERATURE_CALIB_DEFAULT_DB		= 0x00,
1114 	RF_TEMPERATURE_CALIB_HIGH_POWER_DB	= 0x01,
1115 };
1116 
1117 /* WMI_SILENT_RSSI_STATUS */
1118 enum wmi_silent_rssi_status {
1119 	SILENT_RSSI_SUCCESS	= 0x00,
1120 	SILENT_RSSI_FAILURE	= 0x01,
1121 };
1122 
1123 /* WMI_SET_ACTIVE_SILENT_RSSI_TABLE_CMDID */
1124 struct wmi_set_active_silent_rssi_table_cmd {
1125 	/* enum wmi_silent_rssi_table */
1126 	__le32 table;
1127 } __packed;
1128 
1129 enum wmi_sniffer_cfg_phy_info_mode {
1130 	WMI_SNIFFER_PHY_INFO_DISABLED	= 0x00,
1131 	WMI_SNIFFER_PHY_INFO_ENABLED	= 0x01,
1132 };
1133 
1134 enum wmi_sniffer_cfg_phy_support {
1135 	WMI_SNIFFER_CP		= 0x00,
1136 	WMI_SNIFFER_DP		= 0x01,
1137 	WMI_SNIFFER_BOTH_PHYS	= 0x02,
1138 };
1139 
1140 /* wmi_sniffer_cfg */
1141 struct wmi_sniffer_cfg {
1142 	/* enum wmi_sniffer_cfg_mode */
1143 	__le32 mode;
1144 	/* enum wmi_sniffer_cfg_phy_info_mode */
1145 	__le32 phy_info_mode;
1146 	/* enum wmi_sniffer_cfg_phy_support */
1147 	__le32 phy_support;
1148 	u8 channel;
1149 	u8 reserved[3];
1150 } __packed;
1151 
1152 enum wmi_cfg_rx_chain_cmd_action {
1153 	WMI_RX_CHAIN_ADD	= 0x00,
1154 	WMI_RX_CHAIN_DEL	= 0x01,
1155 };
1156 
1157 enum wmi_cfg_rx_chain_cmd_decap_trans_type {
1158 	WMI_DECAP_TYPE_802_3		= 0x00,
1159 	WMI_DECAP_TYPE_NATIVE_WIFI	= 0x01,
1160 	WMI_DECAP_TYPE_NONE		= 0x02,
1161 };
1162 
1163 enum wmi_cfg_rx_chain_cmd_nwifi_ds_trans_type {
1164 	WMI_NWIFI_RX_TRANS_MODE_NO		= 0x00,
1165 	WMI_NWIFI_RX_TRANS_MODE_PBSS2AP		= 0x01,
1166 	WMI_NWIFI_RX_TRANS_MODE_PBSS2STA	= 0x02,
1167 };
1168 
1169 enum wmi_cfg_rx_chain_cmd_reorder_type {
1170 	WMI_RX_HW_REORDER	= 0x00,
1171 	WMI_RX_SW_REORDER	= 0x01,
1172 };
1173 
1174 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_POS	(0)
1175 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_LEN	(1)
1176 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_MSK	(0x1)
1177 #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_POS		(1)
1178 #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_LEN		(1)
1179 #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_MSK		(0x2)
1180 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_POS		(0)
1181 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_LEN		(1)
1182 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_MSK		(0x1)
1183 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_POS		(1)
1184 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_LEN		(1)
1185 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_MSK		(0x2)
1186 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_POS			(0)
1187 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_LEN			(1)
1188 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_MSK			(0x1)
1189 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_POS		(1)
1190 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_LEN		(1)
1191 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_MSK		(0x2)
1192 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_POS		(0)
1193 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_LEN		(1)
1194 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_MSK		(0x1)
1195 #define RING_CTRL_OVERRIDE_WB_THRSH_POS			(1)
1196 #define RING_CTRL_OVERRIDE_WB_THRSH_LEN			(1)
1197 #define RING_CTRL_OVERRIDE_WB_THRSH_MSK			(0x2)
1198 #define RING_CTRL_OVERRIDE_ITR_THRSH_POS		(2)
1199 #define RING_CTRL_OVERRIDE_ITR_THRSH_LEN		(1)
1200 #define RING_CTRL_OVERRIDE_ITR_THRSH_MSK		(0x4)
1201 #define RING_CTRL_OVERRIDE_HOST_THRSH_POS		(3)
1202 #define RING_CTRL_OVERRIDE_HOST_THRSH_LEN		(1)
1203 #define RING_CTRL_OVERRIDE_HOST_THRSH_MSK		(0x8)
1204 
1205 /* WMI_CFG_RX_CHAIN_CMDID */
1206 struct wmi_cfg_rx_chain_cmd {
1207 	__le32 action;
1208 	struct wmi_sw_ring_cfg rx_sw_ring;
1209 	u8 mid;
1210 	u8 decap_trans_type;
1211 	u8 l2_802_3_offload_ctrl;
1212 	u8 l2_nwifi_offload_ctrl;
1213 	u8 vlan_id;
1214 	u8 nwifi_ds_trans_type;
1215 	u8 l3_l4_ctrl;
1216 	u8 ring_ctrl;
1217 	__le16 prefetch_thrsh;
1218 	__le16 wb_thrsh;
1219 	__le32 itr_value;
1220 	__le16 host_thrsh;
1221 	u8 reorder_type;
1222 	u8 reserved;
1223 	struct wmi_sniffer_cfg sniffer_cfg;
1224 	__le16 max_rx_pl_per_desc;
1225 } __packed;
1226 
1227 /* WMI_RCP_ADDBA_RESP_CMDID */
1228 struct wmi_rcp_addba_resp_cmd {
1229 	/* Used for cid less than 8. For higher cid set
1230 	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
1231 	 */
1232 	u8 cidxtid;
1233 	u8 dialog_token;
1234 	__le16 status_code;
1235 	/* ieee80211_ba_parameterset field to send */
1236 	__le16 ba_param_set;
1237 	__le16 ba_timeout;
1238 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
1239 	u8 cid;
1240 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
1241 	u8 tid;
1242 	u8 reserved[2];
1243 } __packed;
1244 
1245 /* WMI_RCP_ADDBA_RESP_EDMA_CMDID */
1246 struct wmi_rcp_addba_resp_edma_cmd {
1247 	u8 cid;
1248 	u8 tid;
1249 	u8 dialog_token;
1250 	u8 reserved;
1251 	__le16 status_code;
1252 	/* ieee80211_ba_parameterset field to send */
1253 	__le16 ba_param_set;
1254 	__le16 ba_timeout;
1255 	u8 status_ring_id;
1256 	/* wmi_cfg_rx_chain_cmd_reorder_type */
1257 	u8 reorder_type;
1258 } __packed;
1259 
1260 /* WMI_RCP_DELBA_CMDID */
1261 struct wmi_rcp_delba_cmd {
1262 	/* Used for cid less than 8. For higher cid set
1263 	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
1264 	 */
1265 	u8 cidxtid;
1266 	u8 reserved;
1267 	__le16 reason;
1268 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
1269 	u8 cid;
1270 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
1271 	u8 tid;
1272 	u8 reserved2[2];
1273 } __packed;
1274 
1275 /* WMI_RCP_ADDBA_REQ_CMDID */
1276 struct wmi_rcp_addba_req_cmd {
1277 	/* Used for cid less than 8. For higher cid set
1278 	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
1279 	 */
1280 	u8 cidxtid;
1281 	u8 dialog_token;
1282 	/* ieee80211_ba_parameterset field as it received */
1283 	__le16 ba_param_set;
1284 	__le16 ba_timeout;
1285 	/* ieee80211_ba_seqstrl field as it received */
1286 	__le16 ba_seq_ctrl;
1287 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
1288 	u8 cid;
1289 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
1290 	u8 tid;
1291 	u8 reserved[2];
1292 } __packed;
1293 
1294 /* WMI_SET_MAC_ADDRESS_CMDID */
1295 struct wmi_set_mac_address_cmd {
1296 	u8 mac[WMI_MAC_LEN];
1297 	u8 reserved[2];
1298 } __packed;
1299 
1300 /* WMI_ECHO_CMDID
1301  * Check FW is alive
1302  * Returned event: WMI_ECHO_RSP_EVENTID
1303  */
1304 struct wmi_echo_cmd {
1305 	__le32 value;
1306 } __packed;
1307 
1308 /* WMI_DEEP_ECHO_CMDID
1309  * Check FW and uCode is alive
1310  * Returned event: WMI_DEEP_ECHO_RSP_EVENTID
1311  */
1312 struct wmi_deep_echo_cmd {
1313 	__le32 value;
1314 } __packed;
1315 
1316 /* WMI_RF_PWR_ON_DELAY_CMDID
1317  * set FW time parameters used through RF resetting
1318  *  RF reset consists of bringing its power down for a period of time, then
1319  * bringing the power up
1320  * Returned event: WMI_RF_PWR_ON_DELAY_RSP_EVENTID
1321  */
1322 struct wmi_rf_pwr_on_delay_cmd {
1323 	/* time in usec the FW waits after bringing the RF PWR down,
1324 	 * set 0 for default
1325 	 */
1326 	__le16 down_delay_usec;
1327 	/* time in usec the FW waits after bringing the RF PWR up,
1328 	 * set 0 for default
1329 	 */
1330 	__le16 up_delay_usec;
1331 } __packed;
1332 
1333 /* WMI_SET_HIGH_POWER_TABLE_PARAMS_CMDID
1334  * This API controls the Tx and Rx gain over temperature.
1335  * It controls the Tx D-type, Rx D-type and Rx E-type amplifiers.
1336  * It also controls the Tx gain index, by controlling the Rx to Tx gain index
1337  * offset.
1338  * The control is divided by 3 temperature values to 4 temperature ranges.
1339  * Each parameter uses its own temperature values.
1340  * Returned event: WMI_SET_HIGH_POWER_TABLE_PARAMS_EVENTID
1341  */
1342 struct wmi_set_high_power_table_params_cmd {
1343 	/* Temperature range for Tx D-type parameters */
1344 	u8 tx_dtype_temp[WMI_RF_DTYPE_LENGTH];
1345 	u8 reserved0;
1346 	/* Tx D-type values to be used for each temperature range */
1347 	__le32 tx_dtype_conf[WMI_RF_DTYPE_CONF_LENGTH];
1348 	/* Temperature range for Tx E-type parameters */
1349 	u8 tx_etype_temp[WMI_RF_ETYPE_LENGTH];
1350 	u8 reserved1;
1351 	/* Tx E-type values to be used for each temperature range.
1352 	 * The last 4 values of any range are the first 4 values of the next
1353 	 * range and so on
1354 	 */
1355 	__le32 tx_etype_conf[WMI_RF_ETYPE_CONF_LENGTH];
1356 	/* Temperature range for Rx D-type parameters */
1357 	u8 rx_dtype_temp[WMI_RF_DTYPE_LENGTH];
1358 	u8 reserved2;
1359 	/* Rx D-type values to be used for each temperature range */
1360 	__le32 rx_dtype_conf[WMI_RF_DTYPE_CONF_LENGTH];
1361 	/* Temperature range for Rx E-type parameters */
1362 	u8 rx_etype_temp[WMI_RF_ETYPE_LENGTH];
1363 	u8 reserved3;
1364 	/* Rx E-type values to be used for each temperature range.
1365 	 * The last 4 values of any range are the first 4 values of the next
1366 	 * range and so on
1367 	 */
1368 	__le32 rx_etype_conf[WMI_RF_ETYPE_CONF_LENGTH];
1369 	/* Temperature range for rx_2_tx_offs parameters */
1370 	u8 rx_2_tx_temp[WMI_RF_RX2TX_LENGTH];
1371 	u8 reserved4;
1372 	/* Rx to Tx gain index offset */
1373 	s8 rx_2_tx_offs[WMI_RF_RX2TX_CONF_LENGTH];
1374 } __packed;
1375 
1376 /* WMI_FIXED_SCHEDULING_UL_CONFIG_CMDID
1377  * This API sets rd parameter per mcs.
1378  * Relevant only in Fixed Scheduling mode.
1379  * Returned event: WMI_FIXED_SCHEDULING_UL_CONFIG_EVENTID
1380  */
1381 struct wmi_fixed_scheduling_ul_config_cmd {
1382 	/* Use mcs -1 to set for every mcs */
1383 	s8 mcs;
1384 	/* Number of frames with rd bit set in a single virtual slot */
1385 	u8 rd_count_per_slot;
1386 	u8 reserved[2];
1387 } __packed;
1388 
1389 /* CMD: WMI_RF_XPM_READ_CMDID */
1390 struct wmi_rf_xpm_read_cmd {
1391 	u8 rf_id;
1392 	u8 reserved[3];
1393 	/* XPM bit start address in range [0,8191]bits - rounded by FW to
1394 	 * multiple of 8bits
1395 	 */
1396 	__le32 xpm_bit_address;
1397 	__le32 num_bytes;
1398 } __packed;
1399 
1400 /* CMD: WMI_RF_XPM_WRITE_CMDID */
1401 struct wmi_rf_xpm_write_cmd {
1402 	u8 rf_id;
1403 	u8 reserved0[3];
1404 	/* XPM bit start address in range [0,8191]bits - rounded by FW to
1405 	 * multiple of 8bits
1406 	 */
1407 	__le32 xpm_bit_address;
1408 	__le32 num_bytes;
1409 	/* boolean flag indicating whether FW should verify the write
1410 	 * operation
1411 	 */
1412 	u8 verify;
1413 	u8 reserved1[3];
1414 	/* actual size=num_bytes */
1415 	u8 data_bytes[0];
1416 } __packed;
1417 
1418 /* Possible modes for temperature measurement */
1419 enum wmi_temperature_measure_mode {
1420 	TEMPERATURE_USE_OLD_VALUE	= 0x01,
1421 	TEMPERATURE_MEASURE_NOW		= 0x02,
1422 };
1423 
1424 /* WMI_TEMP_SENSE_CMDID */
1425 struct wmi_temp_sense_cmd {
1426 	__le32 measure_baseband_en;
1427 	__le32 measure_rf_en;
1428 	__le32 measure_mode;
1429 } __packed;
1430 
1431 enum wmi_pmc_op {
1432 	WMI_PMC_ALLOCATE	= 0x00,
1433 	WMI_PMC_RELEASE		= 0x01,
1434 };
1435 
1436 /* WMI_PMC_CMDID */
1437 struct wmi_pmc_cmd {
1438 	/* enum wmi_pmc_cmd_op_type */
1439 	u8 op;
1440 	u8 reserved;
1441 	__le16 ring_size;
1442 	__le64 mem_base;
1443 } __packed;
1444 
1445 enum wmi_aoa_meas_type {
1446 	WMI_AOA_PHASE_MEAS	= 0x00,
1447 	WMI_AOA_PHASE_AMP_MEAS	= 0x01,
1448 };
1449 
1450 /* WMI_AOA_MEAS_CMDID */
1451 struct wmi_aoa_meas_cmd {
1452 	u8 mac_addr[WMI_MAC_LEN];
1453 	/* channels IDs:
1454 	 * 0 - 58320 MHz
1455 	 * 1 - 60480 MHz
1456 	 * 2 - 62640 MHz
1457 	 */
1458 	u8 channel;
1459 	/* enum wmi_aoa_meas_type */
1460 	u8 aoa_meas_type;
1461 	__le32 meas_rf_mask;
1462 } __packed;
1463 
1464 /* WMI_SET_MGMT_RETRY_LIMIT_CMDID */
1465 struct wmi_set_mgmt_retry_limit_cmd {
1466 	/* MAC retransmit limit for mgmt frames */
1467 	u8 mgmt_retry_limit;
1468 	/* alignment to 32b */
1469 	u8 reserved[3];
1470 } __packed;
1471 
1472 /* Zones: HIGH, MAX, CRITICAL */
1473 #define WMI_NUM_OF_TT_ZONES	(3)
1474 
1475 struct wmi_tt_zone_limits {
1476 	/* Above this temperature this zone is active */
1477 	u8 temperature_high;
1478 	/* Below this temperature the adjacent lower zone is active */
1479 	u8 temperature_low;
1480 	u8 reserved[2];
1481 } __packed;
1482 
1483 /* Struct used for both configuration and status commands of thermal
1484  * throttling
1485  */
1486 struct wmi_tt_data {
1487 	/* Enable/Disable TT algorithm for baseband */
1488 	u8 bb_enabled;
1489 	u8 reserved0[3];
1490 	/* Define zones for baseband */
1491 	struct wmi_tt_zone_limits bb_zones[WMI_NUM_OF_TT_ZONES];
1492 	/* Enable/Disable TT algorithm for radio */
1493 	u8 rf_enabled;
1494 	u8 reserved1[3];
1495 	/* Define zones for all radio chips */
1496 	struct wmi_tt_zone_limits rf_zones[WMI_NUM_OF_TT_ZONES];
1497 } __packed;
1498 
1499 /* WMI_SET_THERMAL_THROTTLING_CFG_CMDID */
1500 struct wmi_set_thermal_throttling_cfg_cmd {
1501 	/* Command data */
1502 	struct wmi_tt_data tt_data;
1503 } __packed;
1504 
1505 /* WMI_NEW_STA_CMDID */
1506 struct wmi_new_sta_cmd {
1507 	u8 dst_mac[WMI_MAC_LEN];
1508 	u8 aid;
1509 } __packed;
1510 
1511 /* WMI_DEL_STA_CMDID */
1512 struct wmi_del_sta_cmd {
1513 	u8 dst_mac[WMI_MAC_LEN];
1514 	__le16 disconnect_reason;
1515 } __packed;
1516 
1517 enum wmi_tof_burst_duration {
1518 	WMI_TOF_BURST_DURATION_250_USEC		= 2,
1519 	WMI_TOF_BURST_DURATION_500_USEC		= 3,
1520 	WMI_TOF_BURST_DURATION_1_MSEC		= 4,
1521 	WMI_TOF_BURST_DURATION_2_MSEC		= 5,
1522 	WMI_TOF_BURST_DURATION_4_MSEC		= 6,
1523 	WMI_TOF_BURST_DURATION_8_MSEC		= 7,
1524 	WMI_TOF_BURST_DURATION_16_MSEC		= 8,
1525 	WMI_TOF_BURST_DURATION_32_MSEC		= 9,
1526 	WMI_TOF_BURST_DURATION_64_MSEC		= 10,
1527 	WMI_TOF_BURST_DURATION_128_MSEC		= 11,
1528 	WMI_TOF_BURST_DURATION_NO_PREFERENCES	= 15,
1529 };
1530 
1531 enum wmi_tof_session_start_flags {
1532 	WMI_TOF_SESSION_START_FLAG_SECURED	= 0x1,
1533 	WMI_TOF_SESSION_START_FLAG_ASAP		= 0x2,
1534 	WMI_TOF_SESSION_START_FLAG_LCI_REQ	= 0x4,
1535 	WMI_TOF_SESSION_START_FLAG_LCR_REQ	= 0x8,
1536 };
1537 
1538 /* WMI_TOF_SESSION_START_CMDID */
1539 struct wmi_ftm_dest_info {
1540 	u8 channel;
1541 	/* wmi_tof_session_start_flags_e */
1542 	u8 flags;
1543 	u8 initial_token;
1544 	u8 num_of_ftm_per_burst;
1545 	u8 num_of_bursts_exp;
1546 	/* wmi_tof_burst_duration_e */
1547 	u8 burst_duration;
1548 	/* Burst Period indicate interval between two consecutive burst
1549 	 * instances, in units of 100 ms
1550 	 */
1551 	__le16 burst_period;
1552 	u8 dst_mac[WMI_MAC_LEN];
1553 	u8 reserved;
1554 	u8 num_burst_per_aoa_meas;
1555 } __packed;
1556 
1557 /* WMI_TOF_SESSION_START_CMDID */
1558 struct wmi_tof_session_start_cmd {
1559 	__le32 session_id;
1560 	u8 reserved1;
1561 	u8 aoa_type;
1562 	__le16 num_of_dest;
1563 	u8 reserved[4];
1564 	struct wmi_ftm_dest_info ftm_dest_info[0];
1565 } __packed;
1566 
1567 /* WMI_TOF_CFG_RESPONDER_CMDID */
1568 struct wmi_tof_cfg_responder_cmd {
1569 	u8 enable;
1570 	u8 reserved[3];
1571 } __packed;
1572 
1573 enum wmi_tof_channel_info_report_type {
1574 	WMI_TOF_CHANNEL_INFO_TYPE_CIR			= 0x1,
1575 	WMI_TOF_CHANNEL_INFO_TYPE_RSSI			= 0x2,
1576 	WMI_TOF_CHANNEL_INFO_TYPE_SNR			= 0x4,
1577 	WMI_TOF_CHANNEL_INFO_TYPE_DEBUG_DATA		= 0x8,
1578 	WMI_TOF_CHANNEL_INFO_TYPE_VENDOR_SPECIFIC	= 0x10,
1579 };
1580 
1581 /* WMI_TOF_CHANNEL_INFO_CMDID */
1582 struct wmi_tof_channel_info_cmd {
1583 	/* wmi_tof_channel_info_report_type_e */
1584 	__le32 channel_info_report_request;
1585 } __packed;
1586 
1587 /* WMI_TOF_SET_TX_RX_OFFSET_CMDID */
1588 struct wmi_tof_set_tx_rx_offset_cmd {
1589 	/* TX delay offset */
1590 	__le32 tx_offset;
1591 	/* RX delay offset */
1592 	__le32 rx_offset;
1593 	/* Mask to define which RFs to configure. 0 means all RFs */
1594 	__le32 rf_mask;
1595 	/* Offset to strongest tap of CIR */
1596 	__le32 precursor;
1597 } __packed;
1598 
1599 /* WMI_TOF_GET_TX_RX_OFFSET_CMDID */
1600 struct wmi_tof_get_tx_rx_offset_cmd {
1601 	/* rf index to read offsets from */
1602 	u8 rf_index;
1603 	u8 reserved[3];
1604 } __packed;
1605 
1606 /* WMI_FIXED_SCHEDULING_CONFIG_CMDID */
1607 struct wmi_map_mcs_to_schd_params {
1608 	u8 mcs;
1609 	/* time in usec from start slot to start tx flow - default 15 */
1610 	u8 time_in_usec_before_initiate_tx;
1611 	/* RD enable - if yes consider RD according to STA mcs */
1612 	u8 rd_enabled;
1613 	u8 reserved;
1614 	/* time in usec from start slot to stop vring */
1615 	__le16 time_in_usec_to_stop_vring;
1616 	/* timeout to force flush from start of slot */
1617 	__le16 flush_to_in_usec;
1618 	/* per mcs the mac buffer limit size in bytes */
1619 	__le32 mac_buff_size_in_bytes;
1620 } __packed;
1621 
1622 /* WMI_FIXED_SCHEDULING_CONFIG_COMPLETE_EVENTID */
1623 struct wmi_fixed_scheduling_config_complete_event {
1624 	/* wmi_fw_status */
1625 	u8 status;
1626 	u8 reserved[3];
1627 } __packed;
1628 
1629 /* This value exists for backwards compatibility only.
1630  * Do not use it in new commands.
1631  * Use dynamic arrays where possible.
1632  */
1633 #define WMI_NUM_MCS	(13)
1634 
1635 /* WMI_FIXED_SCHEDULING_CONFIG_CMDID */
1636 struct wmi_fixed_scheduling_config_cmd {
1637 	/* defaults in the SAS table */
1638 	struct wmi_map_mcs_to_schd_params mcs_to_schd_params_map[WMI_NUM_MCS];
1639 	/* default 150 uSec */
1640 	__le16 max_sta_rd_ppdu_duration_in_usec;
1641 	/* default 300 uSec */
1642 	__le16 max_sta_grant_ppdu_duration_in_usec;
1643 	/* default 1000 uSec */
1644 	__le16 assoc_slot_duration_in_usec;
1645 	/* default 360 uSec */
1646 	__le16 virtual_slot_duration_in_usec;
1647 	/* each this field value slots start with grant frame to the station
1648 	 * - default 2
1649 	 */
1650 	u8 number_of_ap_slots_for_initiate_grant;
1651 	u8 reserved[3];
1652 } __packed;
1653 
1654 /* WMI_ENABLE_FIXED_SCHEDULING_CMDID */
1655 struct wmi_enable_fixed_scheduling_cmd {
1656 	__le32 reserved;
1657 } __packed;
1658 
1659 /* WMI_ENABLE_FIXED_SCHEDULING_COMPLETE_EVENTID */
1660 struct wmi_enable_fixed_scheduling_complete_event {
1661 	/* wmi_fw_status */
1662 	u8 status;
1663 	u8 reserved[3];
1664 } __packed;
1665 
1666 /* WMI_SET_MULTI_DIRECTED_OMNIS_CONFIG_CMDID */
1667 struct wmi_set_multi_directed_omnis_config_cmd {
1668 	/* number of directed omnis at destination AP */
1669 	u8 dest_ap_num_directed_omnis;
1670 	u8 reserved[3];
1671 } __packed;
1672 
1673 /* WMI_SET_MULTI_DIRECTED_OMNIS_CONFIG_EVENTID */
1674 struct wmi_set_multi_directed_omnis_config_event {
1675 	/* wmi_fw_status */
1676 	u8 status;
1677 	u8 reserved[3];
1678 } __packed;
1679 
1680 /* WMI_RADAR_GENERAL_CONFIG_EVENTID */
1681 struct wmi_radar_general_config_event {
1682 	/* wmi_fw_status */
1683 	u8 status;
1684 	u8 reserved[3];
1685 } __packed;
1686 
1687 /* WMI_RADAR_CONFIG_SELECT_EVENTID */
1688 struct wmi_radar_config_select_event {
1689 	/* wmi_fw_status */
1690 	u8 status;
1691 	u8 reserved[3];
1692 	/* In unit of bytes */
1693 	__le32 fifo_size;
1694 	/* In unit of bytes */
1695 	__le32 pulse_size;
1696 } __packed;
1697 
1698 /* WMI_RADAR_PARAMS_CONFIG_EVENTID */
1699 struct wmi_radar_params_config_event {
1700 	/* wmi_fw_status */
1701 	u8 status;
1702 	u8 reserved[3];
1703 } __packed;
1704 
1705 /* WMI_RADAR_SET_MODE_EVENTID */
1706 struct wmi_radar_set_mode_event {
1707 	/* wmi_fw_status */
1708 	u8 status;
1709 	u8 reserved[3];
1710 } __packed;
1711 
1712 /* WMI_RADAR_CONTROL_EVENTID */
1713 struct wmi_radar_control_event {
1714 	/* wmi_fw_status */
1715 	u8 status;
1716 	u8 reserved[3];
1717 } __packed;
1718 
1719 /* WMI_RADAR_PCI_CONTROL_EVENTID */
1720 struct wmi_radar_pci_control_event {
1721 	/* wmi_fw_status */
1722 	u8 status;
1723 	u8 reserved[3];
1724 } __packed;
1725 
1726 /* WMI_SET_LONG_RANGE_CONFIG_CMDID */
1727 struct wmi_set_long_range_config_cmd {
1728 	__le32 reserved;
1729 } __packed;
1730 
1731 /* WMI_SET_LONG_RANGE_CONFIG_COMPLETE_EVENTID */
1732 struct wmi_set_long_range_config_complete_event {
1733 	/* wmi_fw_status */
1734 	u8 status;
1735 	u8 reserved[3];
1736 } __packed;
1737 
1738 /* payload max size is 1024 bytes: max event buffer size (1044) - WMI headers
1739  * (16) - prev struct field size (4)
1740  */
1741 #define WMI_MAX_IOCTL_PAYLOAD_SIZE		(1024)
1742 #define WMI_MAX_IOCTL_REPLY_PAYLOAD_SIZE	(1024)
1743 #define WMI_MAX_INTERNAL_EVENT_PAYLOAD_SIZE	(1024)
1744 
1745 enum wmi_internal_fw_ioctl_code {
1746 	WMI_INTERNAL_FW_CODE_NONE	= 0x0,
1747 	WMI_INTERNAL_FW_CODE_QCOM	= 0x1,
1748 };
1749 
1750 /* WMI_INTERNAL_FW_IOCTL_CMDID */
1751 struct wmi_internal_fw_ioctl_cmd {
1752 	/* enum wmi_internal_fw_ioctl_code */
1753 	__le16 code;
1754 	__le16 length;
1755 	/* payload max size is WMI_MAX_IOCTL_PAYLOAD_SIZE
1756 	 * Must be the last member of the struct
1757 	 */
1758 	__le32 payload[0];
1759 } __packed;
1760 
1761 /* WMI_INTERNAL_FW_IOCTL_EVENTID */
1762 struct wmi_internal_fw_ioctl_event {
1763 	/* wmi_fw_status */
1764 	u8 status;
1765 	u8 reserved;
1766 	__le16 length;
1767 	/* payload max size is WMI_MAX_IOCTL_REPLY_PAYLOAD_SIZE
1768 	 * Must be the last member of the struct
1769 	 */
1770 	__le32 payload[0];
1771 } __packed;
1772 
1773 /* WMI_INTERNAL_FW_EVENT_EVENTID */
1774 struct wmi_internal_fw_event_event {
1775 	__le16 id;
1776 	__le16 length;
1777 	/* payload max size is WMI_MAX_INTERNAL_EVENT_PAYLOAD_SIZE
1778 	 * Must be the last member of the struct
1779 	 */
1780 	__le32 payload[0];
1781 } __packed;
1782 
1783 /* WMI_SET_VRING_PRIORITY_WEIGHT_CMDID */
1784 struct wmi_set_vring_priority_weight_cmd {
1785 	/* Array of weights. Valid values are
1786 	 * WMI_QOS_MIN_DEFAULT_WEIGHT...WMI_QOS_MAX_WEIGHT. Weight #0 is
1787 	 * hard-coded WMI_QOS_MIN_WEIGHT. This array provide the weights
1788 	 * #1..#3
1789 	 */
1790 	u8 weight[3];
1791 	u8 reserved;
1792 } __packed;
1793 
1794 /* WMI_SET_VRING_PRIORITY_CMDID */
1795 struct wmi_vring_priority {
1796 	u8 vring_idx;
1797 	/* Weight index. Valid value is 0-3 */
1798 	u8 priority;
1799 	u8 reserved[2];
1800 } __packed;
1801 
1802 /* WMI_SET_VRING_PRIORITY_CMDID */
1803 struct wmi_set_vring_priority_cmd {
1804 	/* number of entries in vring_priority. Set to
1805 	 * WMI_QOS_SET_VIF_PRIORITY to update the VIF's priority, and there
1806 	 * will be only one entry in vring_priority
1807 	 */
1808 	u8 num_of_vrings;
1809 	u8 reserved[3];
1810 	struct wmi_vring_priority vring_priority[0];
1811 } __packed;
1812 
1813 /* WMI_BF_CONTROL_CMDID - deprecated */
1814 struct wmi_bf_control_cmd {
1815 	/* wmi_bf_triggers */
1816 	__le32 triggers;
1817 	u8 cid;
1818 	/* DISABLED = 0, ENABLED = 1 , DRY_RUN = 2 */
1819 	u8 txss_mode;
1820 	/* DISABLED = 0, ENABLED = 1, DRY_RUN = 2 */
1821 	u8 brp_mode;
1822 	/* Max cts threshold (correspond to
1823 	 * WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_TXOP)
1824 	 */
1825 	u8 bf_trigger_max_cts_failure_thr;
1826 	/* Max cts threshold in dense (correspond to
1827 	 * WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_TXOP)
1828 	 */
1829 	u8 bf_trigger_max_cts_failure_dense_thr;
1830 	/* Max b-ack threshold (correspond to
1831 	 * WMI_BF_TRIGGER_MAX_BACK_FAILURE)
1832 	 */
1833 	u8 bf_trigger_max_back_failure_thr;
1834 	/* Max b-ack threshold in dense (correspond to
1835 	 * WMI_BF_TRIGGER_MAX_BACK_FAILURE)
1836 	 */
1837 	u8 bf_trigger_max_back_failure_dense_thr;
1838 	u8 reserved0;
1839 	/* Wrong sectors threshold */
1840 	__le32 wrong_sector_bis_thr;
1841 	/* BOOL to enable/disable long term trigger */
1842 	u8 long_term_enable;
1843 	/* 1 = Update long term thresholds from the long_term_mbps_th_tbl and
1844 	 * long_term_trig_timeout_per_mcs arrays, 0 = Ignore
1845 	 */
1846 	u8 long_term_update_thr;
1847 	/* Long term throughput threshold [Mbps] */
1848 	u8 long_term_mbps_th_tbl[WMI_NUM_MCS];
1849 	u8 reserved1;
1850 	/* Long term timeout threshold table [msec] */
1851 	__le16 long_term_trig_timeout_per_mcs[WMI_NUM_MCS];
1852 	u8 reserved2[2];
1853 } __packed;
1854 
1855 /* BF configuration for each MCS */
1856 struct wmi_bf_control_ex_mcs {
1857 	/* Long term throughput threshold [Mbps] */
1858 	u8 long_term_mbps_th_tbl;
1859 	u8 reserved;
1860 	/* Long term timeout threshold table [msec] */
1861 	__le16 long_term_trig_timeout_per_mcs;
1862 } __packed;
1863 
1864 /* WMI_BF_CONTROL_EX_CMDID */
1865 struct wmi_bf_control_ex_cmd {
1866 	/* wmi_bf_triggers */
1867 	__le32 triggers;
1868 	/* enum wmi_edmg_tx_mode */
1869 	u8 tx_mode;
1870 	/* DISABLED = 0, ENABLED = 1 , DRY_RUN = 2 */
1871 	u8 txss_mode;
1872 	/* DISABLED = 0, ENABLED = 1, DRY_RUN = 2 */
1873 	u8 brp_mode;
1874 	/* Max cts threshold (correspond to
1875 	 * WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_TXOP)
1876 	 */
1877 	u8 bf_trigger_max_cts_failure_thr;
1878 	/* Max cts threshold in dense (correspond to
1879 	 * WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_TXOP)
1880 	 */
1881 	u8 bf_trigger_max_cts_failure_dense_thr;
1882 	/* Max b-ack threshold (correspond to
1883 	 * WMI_BF_TRIGGER_MAX_BACK_FAILURE)
1884 	 */
1885 	u8 bf_trigger_max_back_failure_thr;
1886 	/* Max b-ack threshold in dense (correspond to
1887 	 * WMI_BF_TRIGGER_MAX_BACK_FAILURE)
1888 	 */
1889 	u8 bf_trigger_max_back_failure_dense_thr;
1890 	u8 reserved0;
1891 	/* Wrong sectors threshold */
1892 	__le32 wrong_sector_bis_thr;
1893 	/* BOOL to enable/disable long term trigger */
1894 	u8 long_term_enable;
1895 	/* 1 = Update long term thresholds from the long_term_mbps_th_tbl and
1896 	 * long_term_trig_timeout_per_mcs arrays, 0 = Ignore
1897 	 */
1898 	u8 long_term_update_thr;
1899 	u8 each_mcs_cfg_size;
1900 	u8 reserved1;
1901 	/* Configuration for each MCS */
1902 	struct wmi_bf_control_ex_mcs each_mcs_cfg[0];
1903 } __packed;
1904 
1905 /* WMI_LINK_STATS_CMD */
1906 enum wmi_link_stats_action {
1907 	WMI_LINK_STATS_SNAPSHOT		= 0x00,
1908 	WMI_LINK_STATS_PERIODIC		= 0x01,
1909 	WMI_LINK_STATS_STOP_PERIODIC	= 0x02,
1910 };
1911 
1912 /* WMI_LINK_STATS_EVENT record identifiers */
1913 enum wmi_link_stats_record_type {
1914 	WMI_LINK_STATS_TYPE_BASIC	= 0x01,
1915 	WMI_LINK_STATS_TYPE_GLOBAL	= 0x02,
1916 };
1917 
1918 /* WMI_LINK_STATS_CMDID */
1919 struct wmi_link_stats_cmd {
1920 	/* bitmask of required record types
1921 	 * (wmi_link_stats_record_type_e)
1922 	 */
1923 	__le32 record_type_mask;
1924 	/* 0xff for all cids */
1925 	u8 cid;
1926 	/* wmi_link_stats_action_e */
1927 	u8 action;
1928 	u8 reserved[6];
1929 	/* range = 100 - 10000 */
1930 	__le32 interval_msec;
1931 } __packed;
1932 
1933 /* WMI_SET_GRANT_MCS_CMDID */
1934 struct wmi_set_grant_mcs_cmd {
1935 	u8 mcs;
1936 	u8 reserved[3];
1937 } __packed;
1938 
1939 /* WMI_SET_AP_SLOT_SIZE_CMDID */
1940 struct wmi_set_ap_slot_size_cmd {
1941 	__le32 slot_size;
1942 } __packed;
1943 
1944 /* WMI_TEMP_SENSE_ALL_CMDID */
1945 struct wmi_temp_sense_all_cmd {
1946 	u8 measure_baseband_en;
1947 	u8 measure_rf_en;
1948 	u8 measure_mode;
1949 	u8 reserved;
1950 } __packed;
1951 
1952 /* WMI Events
1953  * List of Events (target to host)
1954  */
1955 enum wmi_event_id {
1956 	WMI_READY_EVENTID				= 0x1001,
1957 	WMI_CONNECT_EVENTID				= 0x1002,
1958 	WMI_DISCONNECT_EVENTID				= 0x1003,
1959 	WMI_START_SCHED_SCAN_EVENTID			= 0x1005,
1960 	WMI_STOP_SCHED_SCAN_EVENTID			= 0x1006,
1961 	WMI_SCHED_SCAN_RESULT_EVENTID			= 0x1007,
1962 	WMI_SCAN_COMPLETE_EVENTID			= 0x100A,
1963 	WMI_REPORT_STATISTICS_EVENTID			= 0x100B,
1964 	WMI_FT_AUTH_STATUS_EVENTID			= 0x100C,
1965 	WMI_FT_REASSOC_STATUS_EVENTID			= 0x100D,
1966 	WMI_RADAR_GENERAL_CONFIG_EVENTID		= 0x1100,
1967 	WMI_RADAR_CONFIG_SELECT_EVENTID			= 0x1101,
1968 	WMI_RADAR_PARAMS_CONFIG_EVENTID			= 0x1102,
1969 	WMI_RADAR_SET_MODE_EVENTID			= 0x1103,
1970 	WMI_RADAR_CONTROL_EVENTID			= 0x1104,
1971 	WMI_RADAR_PCI_CONTROL_EVENTID			= 0x1105,
1972 	WMI_RD_MEM_RSP_EVENTID				= 0x1800,
1973 	WMI_FW_READY_EVENTID				= 0x1801,
1974 	WMI_EXIT_FAST_MEM_ACC_MODE_EVENTID		= 0x200,
1975 	WMI_ECHO_RSP_EVENTID				= 0x1803,
1976 	WMI_DEEP_ECHO_RSP_EVENTID			= 0x1804,
1977 	/* deprecated */
1978 	WMI_FS_TUNE_DONE_EVENTID			= 0x180A,
1979 	/* deprecated */
1980 	WMI_CORR_MEASURE_EVENTID			= 0x180B,
1981 	WMI_READ_RSSI_EVENTID				= 0x180C,
1982 	WMI_TEMP_SENSE_DONE_EVENTID			= 0x180E,
1983 	WMI_DC_CALIB_DONE_EVENTID			= 0x180F,
1984 	/* deprecated */
1985 	WMI_IQ_TX_CALIB_DONE_EVENTID			= 0x1811,
1986 	/* deprecated */
1987 	WMI_IQ_RX_CALIB_DONE_EVENTID			= 0x1812,
1988 	WMI_SET_WORK_MODE_DONE_EVENTID			= 0x1815,
1989 	WMI_LO_LEAKAGE_CALIB_DONE_EVENTID		= 0x1816,
1990 	WMI_LO_POWER_CALIB_FROM_OTP_EVENTID		= 0x1817,
1991 	WMI_SILENT_RSSI_CALIB_DONE_EVENTID		= 0x181D,
1992 	/* deprecated */
1993 	WMI_RF_RX_TEST_DONE_EVENTID			= 0x181E,
1994 	WMI_CFG_RX_CHAIN_DONE_EVENTID			= 0x1820,
1995 	WMI_VRING_CFG_DONE_EVENTID			= 0x1821,
1996 	WMI_BA_STATUS_EVENTID				= 0x1823,
1997 	WMI_RCP_ADDBA_REQ_EVENTID			= 0x1824,
1998 	WMI_RCP_ADDBA_RESP_SENT_EVENTID			= 0x1825,
1999 	WMI_DELBA_EVENTID				= 0x1826,
2000 	WMI_GET_SSID_EVENTID				= 0x1828,
2001 	WMI_GET_PCP_CHANNEL_EVENTID			= 0x182A,
2002 	/* Event is shared between WMI_SW_TX_REQ_CMDID and
2003 	 * WMI_SW_TX_REQ_EXT_CMDID
2004 	 */
2005 	WMI_SW_TX_COMPLETE_EVENTID			= 0x182B,
2006 	WMI_BEAMFORMING_MGMT_DONE_EVENTID		= 0x1836,
2007 	WMI_BF_TXSS_MGMT_DONE_EVENTID			= 0x1837,
2008 	WMI_BF_RXSS_MGMT_DONE_EVENTID			= 0x1839,
2009 	WMI_BF_TRIG_EVENTID				= 0x183A,
2010 	WMI_RS_MGMT_DONE_EVENTID			= 0x1852,
2011 	WMI_RF_MGMT_STATUS_EVENTID			= 0x1853,
2012 	WMI_BF_SM_MGMT_DONE_EVENTID			= 0x1838,
2013 	WMI_RX_MGMT_PACKET_EVENTID			= 0x1840,
2014 	WMI_TX_MGMT_PACKET_EVENTID			= 0x1841,
2015 	WMI_LINK_MAINTAIN_CFG_WRITE_DONE_EVENTID	= 0x1842,
2016 	WMI_LINK_MAINTAIN_CFG_READ_DONE_EVENTID		= 0x1843,
2017 	WMI_RF_XPM_READ_RESULT_EVENTID			= 0x1856,
2018 	WMI_RF_XPM_WRITE_RESULT_EVENTID			= 0x1857,
2019 	WMI_LED_CFG_DONE_EVENTID			= 0x1858,
2020 	WMI_SET_SILENT_RSSI_TABLE_DONE_EVENTID		= 0x185C,
2021 	WMI_RF_PWR_ON_DELAY_RSP_EVENTID			= 0x185D,
2022 	WMI_SET_HIGH_POWER_TABLE_PARAMS_EVENTID		= 0x185E,
2023 	WMI_FIXED_SCHEDULING_UL_CONFIG_EVENTID		= 0x185F,
2024 	/* Performance monitoring events */
2025 	WMI_DATA_PORT_OPEN_EVENTID			= 0x1860,
2026 	WMI_WBE_LINK_DOWN_EVENTID			= 0x1861,
2027 	WMI_BF_CTRL_DONE_EVENTID			= 0x1862,
2028 	WMI_NOTIFY_REQ_DONE_EVENTID			= 0x1863,
2029 	WMI_GET_STATUS_DONE_EVENTID			= 0x1864,
2030 	WMI_RING_EN_EVENTID				= 0x1865,
2031 	WMI_GET_RF_STATUS_EVENTID			= 0x1866,
2032 	WMI_GET_BASEBAND_TYPE_EVENTID			= 0x1867,
2033 	WMI_VRING_SWITCH_TIMING_CONFIG_EVENTID		= 0x1868,
2034 	WMI_UNIT_TEST_EVENTID				= 0x1900,
2035 	WMI_FLASH_READ_DONE_EVENTID			= 0x1902,
2036 	WMI_FLASH_WRITE_DONE_EVENTID			= 0x1903,
2037 	/* Power management */
2038 	WMI_TRAFFIC_SUSPEND_EVENTID			= 0x1904,
2039 	WMI_TRAFFIC_RESUME_EVENTID			= 0x1905,
2040 	/* P2P */
2041 	WMI_P2P_CFG_DONE_EVENTID			= 0x1910,
2042 	WMI_PORT_ALLOCATED_EVENTID			= 0x1911,
2043 	WMI_PORT_DELETED_EVENTID			= 0x1912,
2044 	WMI_LISTEN_STARTED_EVENTID			= 0x1914,
2045 	WMI_SEARCH_STARTED_EVENTID			= 0x1915,
2046 	WMI_DISCOVERY_STARTED_EVENTID			= 0x1916,
2047 	WMI_DISCOVERY_STOPPED_EVENTID			= 0x1917,
2048 	WMI_PCP_STARTED_EVENTID				= 0x1918,
2049 	WMI_PCP_STOPPED_EVENTID				= 0x1919,
2050 	WMI_PCP_FACTOR_EVENTID				= 0x191A,
2051 	/* Power Save Configuration Events */
2052 	WMI_PS_DEV_PROFILE_CFG_EVENTID			= 0x191C,
2053 	WMI_RS_ENABLE_EVENTID				= 0x191E,
2054 	WMI_RS_CFG_EX_EVENTID				= 0x191F,
2055 	WMI_GET_DETAILED_RS_RES_EX_EVENTID		= 0x1920,
2056 	/* deprecated */
2057 	WMI_RS_CFG_DONE_EVENTID				= 0x1921,
2058 	/* deprecated */
2059 	WMI_GET_DETAILED_RS_RES_EVENTID			= 0x1922,
2060 	WMI_AOA_MEAS_EVENTID				= 0x1923,
2061 	WMI_BRP_SET_ANT_LIMIT_EVENTID			= 0x1924,
2062 	WMI_SET_MGMT_RETRY_LIMIT_EVENTID		= 0x1930,
2063 	WMI_GET_MGMT_RETRY_LIMIT_EVENTID		= 0x1931,
2064 	WMI_SET_THERMAL_THROTTLING_CFG_EVENTID		= 0x1940,
2065 	WMI_GET_THERMAL_THROTTLING_CFG_EVENTID		= 0x1941,
2066 	/* return the Power Save profile */
2067 	WMI_PS_DEV_PROFILE_CFG_READ_EVENTID		= 0x1942,
2068 	WMI_TSF_SYNC_STATUS_EVENTID			= 0x1973,
2069 	WMI_TOF_SESSION_END_EVENTID			= 0x1991,
2070 	WMI_TOF_GET_CAPABILITIES_EVENTID		= 0x1992,
2071 	WMI_TOF_SET_LCR_EVENTID				= 0x1993,
2072 	WMI_TOF_SET_LCI_EVENTID				= 0x1994,
2073 	WMI_TOF_FTM_PER_DEST_RES_EVENTID		= 0x1995,
2074 	WMI_TOF_CFG_RESPONDER_EVENTID			= 0x1996,
2075 	WMI_TOF_SET_TX_RX_OFFSET_EVENTID		= 0x1997,
2076 	WMI_TOF_GET_TX_RX_OFFSET_EVENTID		= 0x1998,
2077 	WMI_TOF_CHANNEL_INFO_EVENTID			= 0x1999,
2078 	WMI_GET_RF_SECTOR_PARAMS_DONE_EVENTID		= 0x19A0,
2079 	WMI_SET_RF_SECTOR_PARAMS_DONE_EVENTID		= 0x19A1,
2080 	WMI_GET_SELECTED_RF_SECTOR_INDEX_DONE_EVENTID	= 0x19A2,
2081 	WMI_SET_SELECTED_RF_SECTOR_INDEX_DONE_EVENTID	= 0x19A3,
2082 	WMI_SET_RF_SECTOR_ON_DONE_EVENTID		= 0x19A4,
2083 	WMI_PRIO_TX_SECTORS_ORDER_EVENTID		= 0x19A5,
2084 	WMI_PRIO_TX_SECTORS_NUMBER_EVENTID		= 0x19A6,
2085 	WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID	= 0x19A7,
2086 	/* deprecated */
2087 	WMI_BF_CONTROL_EVENTID				= 0x19AA,
2088 	WMI_BF_CONTROL_EX_EVENTID			= 0x19AB,
2089 	WMI_TX_STATUS_RING_CFG_DONE_EVENTID		= 0x19C0,
2090 	WMI_RX_STATUS_RING_CFG_DONE_EVENTID		= 0x19C1,
2091 	WMI_TX_DESC_RING_CFG_DONE_EVENTID		= 0x19C2,
2092 	WMI_RX_DESC_RING_CFG_DONE_EVENTID		= 0x19C3,
2093 	WMI_CFG_DEF_RX_OFFLOAD_DONE_EVENTID		= 0x19C5,
2094 	WMI_SCHEDULING_SCHEME_EVENTID			= 0x1A01,
2095 	WMI_FIXED_SCHEDULING_CONFIG_COMPLETE_EVENTID	= 0x1A02,
2096 	WMI_ENABLE_FIXED_SCHEDULING_COMPLETE_EVENTID	= 0x1A03,
2097 	WMI_SET_MULTI_DIRECTED_OMNIS_CONFIG_EVENTID	= 0x1A04,
2098 	WMI_SET_LONG_RANGE_CONFIG_COMPLETE_EVENTID	= 0x1A05,
2099 	WMI_GET_ASSOC_LIST_RES_EVENTID			= 0x1A06,
2100 	WMI_GET_CCA_INDICATIONS_EVENTID			= 0x1A07,
2101 	WMI_SET_CCA_INDICATIONS_BI_AVG_NUM_EVENTID	= 0x1A08,
2102 	WMI_INTERNAL_FW_EVENT_EVENTID			= 0x1A0A,
2103 	WMI_INTERNAL_FW_IOCTL_EVENTID			= 0x1A0B,
2104 	WMI_LINK_STATS_CONFIG_DONE_EVENTID		= 0x1A0C,
2105 	WMI_LINK_STATS_EVENTID				= 0x1A0D,
2106 	WMI_SET_GRANT_MCS_EVENTID			= 0x1A0E,
2107 	WMI_SET_AP_SLOT_SIZE_EVENTID			= 0x1A0F,
2108 	WMI_SET_VRING_PRIORITY_WEIGHT_EVENTID		= 0x1A10,
2109 	WMI_SET_VRING_PRIORITY_EVENTID			= 0x1A11,
2110 	WMI_RBUFCAP_CFG_EVENTID				= 0x1A12,
2111 	WMI_TEMP_SENSE_ALL_DONE_EVENTID			= 0x1A13,
2112 	WMI_SET_CHANNEL_EVENTID				= 0x9000,
2113 	WMI_ASSOC_REQ_EVENTID				= 0x9001,
2114 	WMI_EAPOL_RX_EVENTID				= 0x9002,
2115 	WMI_MAC_ADDR_RESP_EVENTID			= 0x9003,
2116 	WMI_FW_VER_EVENTID				= 0x9004,
2117 	WMI_ACS_PASSIVE_SCAN_COMPLETE_EVENTID		= 0x9005,
2118 	WMI_INTERNAL_FW_SET_CHANNEL			= 0x9006,
2119 	WMI_COMMAND_NOT_SUPPORTED_EVENTID		= 0xFFFF,
2120 };
2121 
2122 /* Events data structures */
2123 enum wmi_fw_status {
2124 	WMI_FW_STATUS_SUCCESS	= 0x00,
2125 	WMI_FW_STATUS_FAILURE	= 0x01,
2126 };
2127 
2128 /* WMI_RF_MGMT_STATUS_EVENTID */
2129 enum wmi_rf_status {
2130 	WMI_RF_ENABLED		= 0x00,
2131 	WMI_RF_DISABLED_HW	= 0x01,
2132 	WMI_RF_DISABLED_SW	= 0x02,
2133 	WMI_RF_DISABLED_HW_SW	= 0x03,
2134 };
2135 
2136 /* WMI_RF_MGMT_STATUS_EVENTID */
2137 struct wmi_rf_mgmt_status_event {
2138 	__le32 rf_status;
2139 } __packed;
2140 
2141 /* WMI_GET_STATUS_DONE_EVENTID */
2142 struct wmi_get_status_done_event {
2143 	__le32 is_associated;
2144 	u8 cid;
2145 	u8 reserved0[3];
2146 	u8 bssid[WMI_MAC_LEN];
2147 	u8 channel;
2148 	u8 reserved1;
2149 	u8 network_type;
2150 	u8 reserved2[3];
2151 	__le32 ssid_len;
2152 	u8 ssid[WMI_MAX_SSID_LEN];
2153 	__le32 rf_status;
2154 	__le32 is_secured;
2155 } __packed;
2156 
2157 /* WMI_FW_VER_EVENTID */
2158 struct wmi_fw_ver_event {
2159 	/* FW image version */
2160 	__le32 fw_major;
2161 	__le32 fw_minor;
2162 	__le32 fw_subminor;
2163 	__le32 fw_build;
2164 	/* FW image build time stamp */
2165 	__le32 hour;
2166 	__le32 minute;
2167 	__le32 second;
2168 	__le32 day;
2169 	__le32 month;
2170 	__le32 year;
2171 	/* Boot Loader image version */
2172 	__le32 bl_major;
2173 	__le32 bl_minor;
2174 	__le32 bl_subminor;
2175 	__le32 bl_build;
2176 	/* The number of entries in the FW capabilities array */
2177 	u8 fw_capabilities_len;
2178 	u8 reserved[3];
2179 	/* FW capabilities info
2180 	 * Must be the last member of the struct
2181 	 */
2182 	__le32 fw_capabilities[0];
2183 } __packed;
2184 
2185 /* WMI_GET_RF_STATUS_EVENTID */
2186 enum rf_type {
2187 	RF_UNKNOWN	= 0x00,
2188 	RF_MARLON	= 0x01,
2189 	RF_SPARROW	= 0x02,
2190 	RF_TALYNA1	= 0x03,
2191 	RF_TALYNA2	= 0x04,
2192 };
2193 
2194 /* WMI_GET_RF_STATUS_EVENTID */
2195 enum board_file_rf_type {
2196 	BF_RF_MARLON	= 0x00,
2197 	BF_RF_SPARROW	= 0x01,
2198 	BF_RF_TALYNA1	= 0x02,
2199 	BF_RF_TALYNA2	= 0x03,
2200 };
2201 
2202 /* WMI_GET_RF_STATUS_EVENTID */
2203 enum rf_status {
2204 	RF_OK			= 0x00,
2205 	RF_NO_COMM		= 0x01,
2206 	RF_WRONG_BOARD_FILE	= 0x02,
2207 };
2208 
2209 /* WMI_GET_RF_STATUS_EVENTID */
2210 struct wmi_get_rf_status_event {
2211 	/* enum rf_type */
2212 	__le32 rf_type;
2213 	/* attached RFs bit vector */
2214 	__le32 attached_rf_vector;
2215 	/* enabled RFs bit vector */
2216 	__le32 enabled_rf_vector;
2217 	/* enum rf_status, refers to enabled RFs */
2218 	u8 rf_status[32];
2219 	/* enum board file RF type */
2220 	__le32 board_file_rf_type;
2221 	/* board file platform type */
2222 	__le32 board_file_platform_type;
2223 	/* board file version */
2224 	__le32 board_file_version;
2225 	/* enabled XIFs bit vector */
2226 	__le32 enabled_xif_vector;
2227 	__le32 reserved;
2228 } __packed;
2229 
2230 /* WMI_GET_BASEBAND_TYPE_EVENTID */
2231 enum baseband_type {
2232 	BASEBAND_UNKNOWN	= 0x00,
2233 	BASEBAND_SPARROW_M_A0	= 0x03,
2234 	BASEBAND_SPARROW_M_A1	= 0x04,
2235 	BASEBAND_SPARROW_M_B0	= 0x05,
2236 	BASEBAND_SPARROW_M_C0	= 0x06,
2237 	BASEBAND_SPARROW_M_D0	= 0x07,
2238 	BASEBAND_TALYN_M_A0	= 0x08,
2239 	BASEBAND_TALYN_M_B0	= 0x09,
2240 };
2241 
2242 /* WMI_GET_BASEBAND_TYPE_EVENTID */
2243 struct wmi_get_baseband_type_event {
2244 	/* enum baseband_type */
2245 	__le32 baseband_type;
2246 } __packed;
2247 
2248 /* WMI_MAC_ADDR_RESP_EVENTID */
2249 struct wmi_mac_addr_resp_event {
2250 	u8 mac[WMI_MAC_LEN];
2251 	u8 auth_mode;
2252 	u8 crypt_mode;
2253 	__le32 offload_mode;
2254 } __packed;
2255 
2256 /* WMI_EAPOL_RX_EVENTID */
2257 struct wmi_eapol_rx_event {
2258 	u8 src_mac[WMI_MAC_LEN];
2259 	__le16 eapol_len;
2260 	u8 eapol[0];
2261 } __packed;
2262 
2263 /* WMI_READY_EVENTID */
2264 enum wmi_phy_capability {
2265 	WMI_11A_CAPABILITY		= 0x01,
2266 	WMI_11G_CAPABILITY		= 0x02,
2267 	WMI_11AG_CAPABILITY		= 0x03,
2268 	WMI_11NA_CAPABILITY		= 0x04,
2269 	WMI_11NG_CAPABILITY		= 0x05,
2270 	WMI_11NAG_CAPABILITY		= 0x06,
2271 	WMI_11AD_CAPABILITY		= 0x07,
2272 	WMI_11N_CAPABILITY_OFFSET	= 0x03,
2273 };
2274 
2275 struct wmi_ready_event {
2276 	__le32 sw_version;
2277 	__le32 abi_version;
2278 	u8 mac[WMI_MAC_LEN];
2279 	/* enum wmi_phy_capability */
2280 	u8 phy_capability;
2281 	u8 numof_additional_mids;
2282 	/* rfc read calibration result. 5..15 */
2283 	u8 rfc_read_calib_result;
2284 	/* Max associated STAs supported by FW in AP mode (default 0 means 8
2285 	 * STA)
2286 	 */
2287 	u8 max_assoc_sta;
2288 	u8 reserved[2];
2289 } __packed;
2290 
2291 /* WMI_NOTIFY_REQ_DONE_EVENTID */
2292 struct wmi_notify_req_done_event {
2293 	/* beamforming status, 0: fail; 1: OK; 2: retrying */
2294 	__le32 status;
2295 	__le64 tsf;
2296 	s8 rssi;
2297 	/* enum wmi_edmg_tx_mode */
2298 	u8 tx_mode;
2299 	u8 reserved0[2];
2300 	__le32 tx_tpt;
2301 	__le32 tx_goodput;
2302 	__le32 rx_goodput;
2303 	__le16 bf_mcs;
2304 	__le16 my_rx_sector;
2305 	__le16 my_tx_sector;
2306 	__le16 other_rx_sector;
2307 	__le16 other_tx_sector;
2308 	__le16 range;
2309 	u8 sqi;
2310 	u8 reserved[3];
2311 } __packed;
2312 
2313 /* WMI_CONNECT_EVENTID */
2314 struct wmi_connect_event {
2315 	u8 channel;
2316 	u8 reserved0;
2317 	u8 bssid[WMI_MAC_LEN];
2318 	__le16 listen_interval;
2319 	__le16 beacon_interval;
2320 	u8 network_type;
2321 	u8 reserved1[3];
2322 	u8 beacon_ie_len;
2323 	u8 assoc_req_len;
2324 	u8 assoc_resp_len;
2325 	u8 cid;
2326 	u8 aid;
2327 	u8 reserved2[2];
2328 	/* not in use */
2329 	u8 assoc_info[0];
2330 } __packed;
2331 
2332 /* disconnect_reason */
2333 enum wmi_disconnect_reason {
2334 	WMI_DIS_REASON_NO_NETWORK_AVAIL		= 0x01,
2335 	/* bmiss */
2336 	WMI_DIS_REASON_LOST_LINK		= 0x02,
2337 	WMI_DIS_REASON_DISCONNECT_CMD		= 0x03,
2338 	WMI_DIS_REASON_BSS_DISCONNECTED		= 0x04,
2339 	WMI_DIS_REASON_AUTH_FAILED		= 0x05,
2340 	WMI_DIS_REASON_ASSOC_FAILED		= 0x06,
2341 	WMI_DIS_REASON_NO_RESOURCES_AVAIL	= 0x07,
2342 	WMI_DIS_REASON_CSERV_DISCONNECT		= 0x08,
2343 	WMI_DIS_REASON_INVALID_PROFILE		= 0x0A,
2344 	WMI_DIS_REASON_DOT11H_CHANNEL_SWITCH	= 0x0B,
2345 	WMI_DIS_REASON_PROFILE_MISMATCH		= 0x0C,
2346 	WMI_DIS_REASON_CONNECTION_EVICTED	= 0x0D,
2347 	WMI_DIS_REASON_IBSS_MERGE		= 0x0E,
2348 	WMI_DIS_REASON_HIGH_TEMPERATURE		= 0x0F,
2349 };
2350 
2351 /* WMI_DISCONNECT_EVENTID */
2352 struct wmi_disconnect_event {
2353 	/* reason code, see 802.11 spec. */
2354 	__le16 protocol_reason_status;
2355 	/* set if known */
2356 	u8 bssid[WMI_MAC_LEN];
2357 	/* see enum wmi_disconnect_reason */
2358 	u8 disconnect_reason;
2359 	/* last assoc req may passed to host - not in used */
2360 	u8 assoc_resp_len;
2361 	/* last assoc req may passed to host - not in used */
2362 	u8 assoc_info[0];
2363 } __packed;
2364 
2365 /* WMI_SCAN_COMPLETE_EVENTID */
2366 enum scan_status {
2367 	WMI_SCAN_SUCCESS	= 0x00,
2368 	WMI_SCAN_FAILED		= 0x01,
2369 	WMI_SCAN_ABORTED	= 0x02,
2370 	WMI_SCAN_REJECTED	= 0x03,
2371 	WMI_SCAN_ABORT_REJECTED	= 0x04,
2372 };
2373 
2374 struct wmi_scan_complete_event {
2375 	/* enum scan_status */
2376 	__le32 status;
2377 } __packed;
2378 
2379 /* WMI_FT_AUTH_STATUS_EVENTID */
2380 struct wmi_ft_auth_status_event {
2381 	/* enum wmi_fw_status */
2382 	u8 status;
2383 	u8 reserved[3];
2384 	u8 mac_addr[WMI_MAC_LEN];
2385 	__le16 ie_len;
2386 	u8 ie_info[0];
2387 } __packed;
2388 
2389 /* WMI_FT_REASSOC_STATUS_EVENTID */
2390 struct wmi_ft_reassoc_status_event {
2391 	/* enum wmi_fw_status */
2392 	u8 status;
2393 	/* association id received from new AP */
2394 	u8 aid;
2395 	/* enum wmi_channel */
2396 	u8 channel;
2397 	/* enum wmi_channel */
2398 	u8 edmg_channel;
2399 	u8 mac_addr[WMI_MAC_LEN];
2400 	__le16 beacon_ie_len;
2401 	__le16 reassoc_req_ie_len;
2402 	__le16 reassoc_resp_ie_len;
2403 	u8 reserved[4];
2404 	u8 ie_info[0];
2405 } __packed;
2406 
2407 /* wmi_rx_mgmt_info */
2408 struct wmi_rx_mgmt_info {
2409 	u8 mcs;
2410 	s8 rssi;
2411 	u8 range;
2412 	u8 sqi;
2413 	__le16 stype;
2414 	__le16 status;
2415 	__le32 len;
2416 	/* Not resolved when == 0xFFFFFFFF == > Broadcast to all MIDS */
2417 	u8 qid;
2418 	/* Not resolved when == 0xFFFFFFFF == > Broadcast to all MIDS */
2419 	u8 mid;
2420 	u8 cid;
2421 	/* From Radio MNGR */
2422 	u8 channel;
2423 } __packed;
2424 
2425 /* WMI_START_SCHED_SCAN_EVENTID */
2426 enum wmi_pno_result {
2427 	WMI_PNO_SUCCESS			= 0x00,
2428 	WMI_PNO_REJECT			= 0x01,
2429 	WMI_PNO_INVALID_PARAMETERS	= 0x02,
2430 	WMI_PNO_NOT_ENABLED		= 0x03,
2431 };
2432 
2433 struct wmi_start_sched_scan_event {
2434 	/* wmi_pno_result */
2435 	u8 result;
2436 	u8 reserved[3];
2437 } __packed;
2438 
2439 struct wmi_stop_sched_scan_event {
2440 	/* wmi_pno_result */
2441 	u8 result;
2442 	u8 reserved[3];
2443 } __packed;
2444 
2445 struct wmi_sched_scan_result_event {
2446 	struct wmi_rx_mgmt_info info;
2447 	u8 payload[0];
2448 } __packed;
2449 
2450 /* WMI_ACS_PASSIVE_SCAN_COMPLETE_EVENT */
2451 enum wmi_acs_info_bitmask {
2452 	WMI_ACS_INFO_BITMASK_BEACON_FOUND	= 0x01,
2453 	WMI_ACS_INFO_BITMASK_BUSY_TIME		= 0x02,
2454 	WMI_ACS_INFO_BITMASK_TX_TIME		= 0x04,
2455 	WMI_ACS_INFO_BITMASK_RX_TIME		= 0x08,
2456 	WMI_ACS_INFO_BITMASK_NOISE		= 0x10,
2457 };
2458 
2459 struct scan_acs_info {
2460 	u8 channel;
2461 	u8 beacon_found;
2462 	/* msec */
2463 	__le16 busy_time;
2464 	__le16 tx_time;
2465 	__le16 rx_time;
2466 	u8 noise;
2467 	u8 reserved[3];
2468 } __packed;
2469 
2470 struct wmi_acs_passive_scan_complete_event {
2471 	__le32 dwell_time;
2472 	/* valid fields within channel info according to
2473 	 * their appearance in struct order
2474 	 */
2475 	__le16 filled;
2476 	u8 num_scanned_channels;
2477 	u8 reserved;
2478 	struct scan_acs_info scan_info_list[0];
2479 } __packed;
2480 
2481 /* WMI_BA_STATUS_EVENTID */
2482 enum wmi_vring_ba_status {
2483 	WMI_BA_AGREED			= 0x00,
2484 	WMI_BA_NON_AGREED		= 0x01,
2485 	/* BA_EN in middle of teardown flow */
2486 	WMI_BA_TD_WIP			= 0x02,
2487 	/* BA_DIS or BA_EN in middle of BA SETUP flow */
2488 	WMI_BA_SETUP_WIP		= 0x03,
2489 	/* BA_EN when the BA session is already active */
2490 	WMI_BA_SESSION_ACTIVE		= 0x04,
2491 	/* BA_DIS when the BA session is not active */
2492 	WMI_BA_SESSION_NOT_ACTIVE	= 0x05,
2493 };
2494 
2495 struct wmi_ba_status_event {
2496 	/* enum wmi_vring_ba_status */
2497 	__le16 status;
2498 	u8 reserved[2];
2499 	u8 ringid;
2500 	u8 agg_wsize;
2501 	__le16 ba_timeout;
2502 	u8 amsdu;
2503 } __packed;
2504 
2505 /* WMI_DELBA_EVENTID */
2506 struct wmi_delba_event {
2507 	/* Used for cid less than 8. For higher cid set
2508 	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
2509 	 */
2510 	u8 cidxtid;
2511 	u8 from_initiator;
2512 	__le16 reason;
2513 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
2514 	u8 cid;
2515 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
2516 	u8 tid;
2517 	u8 reserved[2];
2518 } __packed;
2519 
2520 /* WMI_VRING_CFG_DONE_EVENTID */
2521 struct wmi_vring_cfg_done_event {
2522 	u8 ringid;
2523 	u8 status;
2524 	u8 reserved[2];
2525 	__le32 tx_vring_tail_ptr;
2526 } __packed;
2527 
2528 /* WMI_RCP_ADDBA_RESP_SENT_EVENTID */
2529 struct wmi_rcp_addba_resp_sent_event {
2530 	/* Used for cid less than 8. For higher cid set
2531 	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
2532 	 */
2533 	u8 cidxtid;
2534 	u8 reserved;
2535 	__le16 status;
2536 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
2537 	u8 cid;
2538 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
2539 	u8 tid;
2540 	u8 reserved2[2];
2541 } __packed;
2542 
2543 /* WMI_TX_STATUS_RING_CFG_DONE_EVENTID */
2544 struct wmi_tx_status_ring_cfg_done_event {
2545 	u8 ring_id;
2546 	/* wmi_fw_status */
2547 	u8 status;
2548 	u8 reserved[2];
2549 	__le32 ring_tail_ptr;
2550 } __packed;
2551 
2552 /* WMI_RX_STATUS_RING_CFG_DONE_EVENTID */
2553 struct wmi_rx_status_ring_cfg_done_event {
2554 	u8 ring_id;
2555 	/* wmi_fw_status */
2556 	u8 status;
2557 	u8 reserved[2];
2558 	__le32 ring_tail_ptr;
2559 } __packed;
2560 
2561 /* WMI_CFG_DEF_RX_OFFLOAD_DONE_EVENTID */
2562 struct wmi_cfg_def_rx_offload_done_event {
2563 	/* wmi_fw_status */
2564 	u8 status;
2565 	u8 reserved[3];
2566 } __packed;
2567 
2568 /* WMI_TX_DESC_RING_CFG_DONE_EVENTID */
2569 struct wmi_tx_desc_ring_cfg_done_event {
2570 	u8 ring_id;
2571 	/* wmi_fw_status */
2572 	u8 status;
2573 	u8 reserved[2];
2574 	__le32 ring_tail_ptr;
2575 } __packed;
2576 
2577 /* WMI_RX_DESC_RING_CFG_DONE_EVENTID */
2578 struct wmi_rx_desc_ring_cfg_done_event {
2579 	u8 ring_id;
2580 	/* wmi_fw_status */
2581 	u8 status;
2582 	u8 reserved[2];
2583 	__le32 ring_tail_ptr;
2584 } __packed;
2585 
2586 /* WMI_RCP_ADDBA_REQ_EVENTID */
2587 struct wmi_rcp_addba_req_event {
2588 	/* Used for cid less than 8. For higher cid set
2589 	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
2590 	 */
2591 	u8 cidxtid;
2592 	u8 dialog_token;
2593 	/* ieee80211_ba_parameterset as it received */
2594 	__le16 ba_param_set;
2595 	__le16 ba_timeout;
2596 	/* ieee80211_ba_seqstrl field as it received */
2597 	__le16 ba_seq_ctrl;
2598 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
2599 	u8 cid;
2600 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
2601 	u8 tid;
2602 	u8 reserved[2];
2603 } __packed;
2604 
2605 /* WMI_CFG_RX_CHAIN_DONE_EVENTID */
2606 enum wmi_cfg_rx_chain_done_event_status {
2607 	WMI_CFG_RX_CHAIN_SUCCESS	= 0x01,
2608 };
2609 
2610 struct wmi_cfg_rx_chain_done_event {
2611 	/* V-Ring Tail pointer */
2612 	__le32 rx_ring_tail_ptr;
2613 	__le32 status;
2614 } __packed;
2615 
2616 /* WMI_WBE_LINK_DOWN_EVENTID */
2617 enum wmi_wbe_link_down_event_reason {
2618 	WMI_WBE_REASON_USER_REQUEST	= 0x00,
2619 	WMI_WBE_REASON_RX_DISASSOC	= 0x01,
2620 	WMI_WBE_REASON_BAD_PHY_LINK	= 0x02,
2621 };
2622 
2623 /* WMI_WBE_LINK_DOWN_EVENTID */
2624 struct wmi_wbe_link_down_event {
2625 	u8 cid;
2626 	u8 reserved[3];
2627 	__le32 reason;
2628 } __packed;
2629 
2630 /* WMI_DATA_PORT_OPEN_EVENTID */
2631 struct wmi_data_port_open_event {
2632 	u8 cid;
2633 	u8 reserved[3];
2634 } __packed;
2635 
2636 /* WMI_RING_EN_EVENTID */
2637 struct wmi_ring_en_event {
2638 	u8 ring_index;
2639 	u8 reserved[3];
2640 } __packed;
2641 
2642 /* WMI_GET_PCP_CHANNEL_EVENTID */
2643 struct wmi_get_pcp_channel_event {
2644 	u8 channel;
2645 	u8 reserved[3];
2646 } __packed;
2647 
2648 /* WMI_P2P_CFG_DONE_EVENTID */
2649 struct wmi_p2p_cfg_done_event {
2650 	/* wmi_fw_status */
2651 	u8 status;
2652 	u8 reserved[3];
2653 } __packed;
2654 
2655 /* WMI_PORT_ALLOCATED_EVENTID */
2656 struct wmi_port_allocated_event {
2657 	/* wmi_fw_status */
2658 	u8 status;
2659 	u8 reserved[3];
2660 } __packed;
2661 
2662 /* WMI_PORT_DELETED_EVENTID */
2663 struct wmi_port_deleted_event {
2664 	/* wmi_fw_status */
2665 	u8 status;
2666 	u8 reserved[3];
2667 } __packed;
2668 
2669 /* WMI_LISTEN_STARTED_EVENTID */
2670 struct wmi_listen_started_event {
2671 	/* wmi_fw_status */
2672 	u8 status;
2673 	u8 reserved[3];
2674 } __packed;
2675 
2676 /* WMI_SEARCH_STARTED_EVENTID */
2677 struct wmi_search_started_event {
2678 	/* wmi_fw_status */
2679 	u8 status;
2680 	u8 reserved[3];
2681 } __packed;
2682 
2683 /* WMI_PCP_STARTED_EVENTID */
2684 struct wmi_pcp_started_event {
2685 	/* wmi_fw_status */
2686 	u8 status;
2687 	u8 reserved[3];
2688 } __packed;
2689 
2690 /* WMI_PCP_FACTOR_EVENTID */
2691 struct wmi_pcp_factor_event {
2692 	__le32 pcp_factor;
2693 } __packed;
2694 
2695 enum wmi_sw_tx_status {
2696 	WMI_TX_SW_STATUS_SUCCESS		= 0x00,
2697 	WMI_TX_SW_STATUS_FAILED_NO_RESOURCES	= 0x01,
2698 	WMI_TX_SW_STATUS_FAILED_TX		= 0x02,
2699 };
2700 
2701 /* WMI_SW_TX_COMPLETE_EVENTID */
2702 struct wmi_sw_tx_complete_event {
2703 	/* enum wmi_sw_tx_status */
2704 	u8 status;
2705 	u8 reserved[3];
2706 } __packed;
2707 
2708 /* WMI_CORR_MEASURE_EVENTID - deprecated */
2709 struct wmi_corr_measure_event {
2710 	/* signed */
2711 	__le32 i;
2712 	/* signed */
2713 	__le32 q;
2714 	/* signed */
2715 	__le32 image_i;
2716 	/* signed */
2717 	__le32 image_q;
2718 } __packed;
2719 
2720 /* WMI_READ_RSSI_EVENTID */
2721 struct wmi_read_rssi_event {
2722 	__le32 ina_rssi_adc_dbm;
2723 } __packed;
2724 
2725 /* WMI_GET_SSID_EVENTID */
2726 struct wmi_get_ssid_event {
2727 	__le32 ssid_len;
2728 	u8 ssid[WMI_MAX_SSID_LEN];
2729 } __packed;
2730 
2731 /* EVENT: WMI_RF_XPM_READ_RESULT_EVENTID */
2732 struct wmi_rf_xpm_read_result_event {
2733 	/* enum wmi_fw_status_e - success=0 or fail=1 */
2734 	u8 status;
2735 	u8 reserved[3];
2736 	/* requested num_bytes of data */
2737 	u8 data_bytes[0];
2738 } __packed;
2739 
2740 /* EVENT: WMI_RF_XPM_WRITE_RESULT_EVENTID */
2741 struct wmi_rf_xpm_write_result_event {
2742 	/* enum wmi_fw_status_e - success=0 or fail=1 */
2743 	u8 status;
2744 	u8 reserved[3];
2745 } __packed;
2746 
2747 /* WMI_TX_MGMT_PACKET_EVENTID */
2748 struct wmi_tx_mgmt_packet_event {
2749 	u8 payload[0];
2750 } __packed;
2751 
2752 /* WMI_RX_MGMT_PACKET_EVENTID */
2753 struct wmi_rx_mgmt_packet_event {
2754 	struct wmi_rx_mgmt_info info;
2755 	u8 payload[0];
2756 } __packed;
2757 
2758 /* WMI_ECHO_RSP_EVENTID */
2759 struct wmi_echo_rsp_event {
2760 	__le32 echoed_value;
2761 } __packed;
2762 
2763 /* WMI_DEEP_ECHO_RSP_EVENTID */
2764 struct wmi_deep_echo_rsp_event {
2765 	__le32 echoed_value;
2766 } __packed;
2767 
2768 /* WMI_RF_PWR_ON_DELAY_RSP_EVENTID */
2769 struct wmi_rf_pwr_on_delay_rsp_event {
2770 	/* wmi_fw_status */
2771 	u8 status;
2772 	u8 reserved[3];
2773 } __packed;
2774 
2775 /* WMI_SET_HIGH_POWER_TABLE_PARAMS_EVENTID */
2776 struct wmi_set_high_power_table_params_event {
2777 	/* wmi_fw_status */
2778 	u8 status;
2779 	u8 reserved[3];
2780 } __packed;
2781 
2782 /* WMI_FIXED_SCHEDULING_UL_CONFIG_EVENTID */
2783 struct wmi_fixed_scheduling_ul_config_event {
2784 	/* wmi_fw_status */
2785 	u8 status;
2786 	u8 reserved[3];
2787 } __packed;
2788 
2789 /* WMI_TEMP_SENSE_DONE_EVENTID
2790  *
2791  * Measure MAC and radio temperatures
2792  */
2793 struct wmi_temp_sense_done_event {
2794 	/* Temperature times 1000 (actual temperature will be achieved by
2795 	 * dividing the value by 1000). When temperature cannot be read from
2796 	 * device return WMI_INVALID_TEMPERATURE
2797 	 */
2798 	__le32 baseband_t1000;
2799 	/* Temperature times 1000 (actual temperature will be achieved by
2800 	 * dividing the value by 1000). When temperature cannot be read from
2801 	 * device return WMI_INVALID_TEMPERATURE
2802 	 */
2803 	__le32 rf_t1000;
2804 } __packed;
2805 
2806 #define WMI_SCAN_DWELL_TIME_MS	(100)
2807 #define WMI_SURVEY_TIMEOUT_MS	(10000)
2808 
2809 enum wmi_hidden_ssid {
2810 	WMI_HIDDEN_SSID_DISABLED	= 0x00,
2811 	WMI_HIDDEN_SSID_SEND_EMPTY	= 0x10,
2812 	WMI_HIDDEN_SSID_CLEAR		= 0xFE,
2813 };
2814 
2815 /* WMI_LED_CFG_CMDID
2816  *
2817  * Configure LED On\Off\Blinking operation
2818  *
2819  * Returned events:
2820  * - WMI_LED_CFG_DONE_EVENTID
2821  */
2822 enum led_mode {
2823 	LED_DISABLE	= 0x00,
2824 	LED_ENABLE	= 0x01,
2825 };
2826 
2827 /* The names of the led as
2828  * described on HW schemes.
2829  */
2830 enum wmi_led_id {
2831 	WMI_LED_WLAN	= 0x00,
2832 	WMI_LED_WPAN	= 0x01,
2833 	WMI_LED_WWAN	= 0x02,
2834 };
2835 
2836 /* Led polarity mode. */
2837 enum wmi_led_polarity {
2838 	LED_POLARITY_HIGH_ACTIVE	= 0x00,
2839 	LED_POLARITY_LOW_ACTIVE		= 0x01,
2840 };
2841 
2842 /* Combination of on and off
2843  * creates the blinking period
2844  */
2845 struct wmi_led_blink_mode {
2846 	__le32 blink_on;
2847 	__le32 blink_off;
2848 } __packed;
2849 
2850 /* WMI_LED_CFG_CMDID */
2851 struct wmi_led_cfg_cmd {
2852 	/* enum led_mode_e */
2853 	u8 led_mode;
2854 	/* enum wmi_led_id_e */
2855 	u8 id;
2856 	/* slow speed blinking combination */
2857 	struct wmi_led_blink_mode slow_blink_cfg;
2858 	/* medium speed blinking combination */
2859 	struct wmi_led_blink_mode medium_blink_cfg;
2860 	/* high speed blinking combination */
2861 	struct wmi_led_blink_mode fast_blink_cfg;
2862 	/* polarity of the led */
2863 	u8 led_polarity;
2864 	/* reserved */
2865 	u8 reserved;
2866 } __packed;
2867 
2868 /* \WMI_SET_CONNECT_SNR_THR_CMDID */
2869 struct wmi_set_connect_snr_thr_cmd {
2870 	u8 enable;
2871 	u8 reserved;
2872 	/* 1/4 Db units */
2873 	__le16 omni_snr_thr;
2874 	/* 1/4 Db units */
2875 	__le16 direct_snr_thr;
2876 } __packed;
2877 
2878 /* WMI_LED_CFG_DONE_EVENTID */
2879 struct wmi_led_cfg_done_event {
2880 	/* led config status */
2881 	__le32 status;
2882 } __packed;
2883 
2884 /* Rate search parameters configuration per connection */
2885 struct wmi_rs_cfg {
2886 	/* The maximal allowed PER for each MCS
2887 	 * MCS will be considered as failed if PER during RS is higher
2888 	 */
2889 	u8 per_threshold[WMI_NUM_MCS];
2890 	/* Number of MPDUs for each MCS
2891 	 * this is the minimal statistic required to make an educated
2892 	 * decision
2893 	 */
2894 	u8 min_frame_cnt[WMI_NUM_MCS];
2895 	/* stop threshold [0-100] */
2896 	u8 stop_th;
2897 	/* MCS1 stop threshold [0-100] */
2898 	u8 mcs1_fail_th;
2899 	u8 max_back_failure_th;
2900 	/* Debug feature for disabling internal RS trigger (which is
2901 	 * currently triggered by BF Done)
2902 	 */
2903 	u8 dbg_disable_internal_trigger;
2904 	__le32 back_failure_mask;
2905 	__le32 mcs_en_vec;
2906 } __packed;
2907 
2908 enum wmi_edmg_tx_mode {
2909 	WMI_TX_MODE_DMG			= 0x0,
2910 	WMI_TX_MODE_EDMG_CB1		= 0x1,
2911 	WMI_TX_MODE_EDMG_CB2		= 0x2,
2912 	WMI_TX_MODE_EDMG_CB1_LONG_LDPC	= 0x3,
2913 	WMI_TX_MODE_EDMG_CB2_LONG_LDPC	= 0x4,
2914 	WMI_TX_MODE_MAX,
2915 };
2916 
2917 /* Rate search parameters common configuration */
2918 struct wmi_rs_cfg_ex_common {
2919 	/* enum wmi_edmg_tx_mode */
2920 	u8 mode;
2921 	/* stop threshold [0-100] */
2922 	u8 stop_th;
2923 	/* MCS1 stop threshold [0-100] */
2924 	u8 mcs1_fail_th;
2925 	u8 max_back_failure_th;
2926 	/* Debug feature for disabling internal RS trigger (which is
2927 	 * currently triggered by BF Done)
2928 	 */
2929 	u8 dbg_disable_internal_trigger;
2930 	u8 reserved[3];
2931 	__le32 back_failure_mask;
2932 } __packed;
2933 
2934 /* Rate search parameters configuration per MCS */
2935 struct wmi_rs_cfg_ex_mcs {
2936 	/* The maximal allowed PER for each MCS
2937 	 * MCS will be considered as failed if PER during RS is higher
2938 	 */
2939 	u8 per_threshold;
2940 	/* Number of MPDUs for each MCS
2941 	 * this is the minimal statistic required to make an educated
2942 	 * decision
2943 	 */
2944 	u8 min_frame_cnt;
2945 	u8 reserved[2];
2946 } __packed;
2947 
2948 /* WMI_RS_CFG_EX_CMDID */
2949 struct wmi_rs_cfg_ex_cmd {
2950 	/* Configuration for all MCSs */
2951 	struct wmi_rs_cfg_ex_common common_cfg;
2952 	u8 each_mcs_cfg_size;
2953 	u8 reserved[3];
2954 	/* Configuration for each MCS */
2955 	struct wmi_rs_cfg_ex_mcs each_mcs_cfg[0];
2956 } __packed;
2957 
2958 /* WMI_RS_CFG_EX_EVENTID */
2959 struct wmi_rs_cfg_ex_event {
2960 	/* enum wmi_edmg_tx_mode */
2961 	u8 mode;
2962 	/* enum wmi_fw_status */
2963 	u8 status;
2964 	u8 reserved[2];
2965 } __packed;
2966 
2967 /* WMI_RS_ENABLE_CMDID */
2968 struct wmi_rs_enable_cmd {
2969 	u8 cid;
2970 	/* enable or disable rate search */
2971 	u8 rs_enable;
2972 	u8 reserved[2];
2973 	__le32 mcs_en_vec;
2974 } __packed;
2975 
2976 /* WMI_RS_ENABLE_EVENTID */
2977 struct wmi_rs_enable_event {
2978 	/* enum wmi_fw_status */
2979 	u8 status;
2980 	u8 reserved[3];
2981 } __packed;
2982 
2983 /* Slot types */
2984 enum wmi_sched_scheme_slot_type {
2985 	WMI_SCHED_SLOT_SP		= 0x0,
2986 	WMI_SCHED_SLOT_CBAP		= 0x1,
2987 	WMI_SCHED_SLOT_IDLE		= 0x2,
2988 	WMI_SCHED_SLOT_ANNOUNCE_NO_ACK	= 0x3,
2989 	WMI_SCHED_SLOT_DISCOVERY	= 0x4,
2990 };
2991 
2992 enum wmi_sched_scheme_slot_flags {
2993 	WMI_SCHED_SCHEME_SLOT_PERIODIC	= 0x1,
2994 };
2995 
2996 struct wmi_sched_scheme_slot {
2997 	/* in microsecond */
2998 	__le32 tbtt_offset;
2999 	/* wmi_sched_scheme_slot_flags */
3000 	u8 flags;
3001 	/* wmi_sched_scheme_slot_type */
3002 	u8 type;
3003 	/* in microsecond */
3004 	__le16 duration;
3005 	/* frame_exchange_sequence_duration */
3006 	__le16 tx_op;
3007 	/* time in microseconds between two consecutive slots
3008 	 * relevant only if flag WMI_SCHED_SCHEME_SLOT_PERIODIC set
3009 	 */
3010 	__le16 period;
3011 	/* relevant only if flag WMI_SCHED_SCHEME_SLOT_PERIODIC set
3012 	 * number of times to repeat allocation
3013 	 */
3014 	u8 num_of_blocks;
3015 	/* relevant only if flag WMI_SCHED_SCHEME_SLOT_PERIODIC set
3016 	 * every idle_period allocation will be idle
3017 	 */
3018 	u8 idle_period;
3019 	u8 src_aid;
3020 	u8 dest_aid;
3021 	__le32 reserved;
3022 } __packed;
3023 
3024 enum wmi_sched_scheme_flags {
3025 	/* should not be set when clearing scheduling scheme */
3026 	WMI_SCHED_SCHEME_ENABLE		= 0x01,
3027 	WMI_SCHED_PROTECTED_SP		= 0x02,
3028 	/* should be set only on first WMI fragment of scheme */
3029 	WMI_SCHED_FIRST			= 0x04,
3030 	/* should be set only on last WMI fragment of scheme */
3031 	WMI_SCHED_LAST			= 0x08,
3032 	WMI_SCHED_IMMEDIATE_START	= 0x10,
3033 };
3034 
3035 enum wmi_sched_scheme_advertisment {
3036 	/* ESE is not advertised at all, STA has to be configured with WMI
3037 	 * also
3038 	 */
3039 	WMI_ADVERTISE_ESE_DISABLED		= 0x0,
3040 	WMI_ADVERTISE_ESE_IN_BEACON		= 0x1,
3041 	WMI_ADVERTISE_ESE_IN_ANNOUNCE_FRAME	= 0x2,
3042 };
3043 
3044 /* WMI_SCHEDULING_SCHEME_CMD */
3045 struct wmi_scheduling_scheme_cmd {
3046 	u8 serial_num;
3047 	/* wmi_sched_scheme_advertisment */
3048 	u8 ese_advertisment;
3049 	/* wmi_sched_scheme_flags */
3050 	__le16 flags;
3051 	u8 num_allocs;
3052 	u8 reserved[3];
3053 	__le64 start_tbtt;
3054 	/* allocations list */
3055 	struct wmi_sched_scheme_slot allocs[WMI_SCHED_MAX_ALLOCS_PER_CMD];
3056 } __packed;
3057 
3058 enum wmi_sched_scheme_failure_type {
3059 	WMI_SCHED_SCHEME_FAILURE_NO_ERROR		= 0x00,
3060 	WMI_SCHED_SCHEME_FAILURE_OLD_START_TSF_ERR	= 0x01,
3061 };
3062 
3063 /* WMI_SCHEDULING_SCHEME_EVENTID */
3064 struct wmi_scheduling_scheme_event {
3065 	/* wmi_fw_status_e */
3066 	u8 status;
3067 	/* serial number given in command */
3068 	u8 serial_num;
3069 	/* wmi_sched_scheme_failure_type */
3070 	u8 failure_type;
3071 	/* alignment to 32b */
3072 	u8 reserved[1];
3073 } __packed;
3074 
3075 /* WMI_RS_CFG_CMDID - deprecated */
3076 struct wmi_rs_cfg_cmd {
3077 	/* connection id */
3078 	u8 cid;
3079 	/* enable or disable rate search */
3080 	u8 rs_enable;
3081 	/* rate search configuration */
3082 	struct wmi_rs_cfg rs_cfg;
3083 } __packed;
3084 
3085 /* WMI_RS_CFG_DONE_EVENTID - deprecated */
3086 struct wmi_rs_cfg_done_event {
3087 	u8 cid;
3088 	/* enum wmi_fw_status */
3089 	u8 status;
3090 	u8 reserved[2];
3091 } __packed;
3092 
3093 /* WMI_GET_DETAILED_RS_RES_CMDID - deprecated */
3094 struct wmi_get_detailed_rs_res_cmd {
3095 	/* connection id */
3096 	u8 cid;
3097 	u8 reserved[3];
3098 } __packed;
3099 
3100 /* RS results status */
3101 enum wmi_rs_results_status {
3102 	WMI_RS_RES_VALID	= 0x00,
3103 	WMI_RS_RES_INVALID	= 0x01,
3104 };
3105 
3106 /* Rate search results */
3107 struct wmi_rs_results {
3108 	/* number of sent MPDUs */
3109 	u8 num_of_tx_pkt[WMI_NUM_MCS];
3110 	/* number of non-acked MPDUs */
3111 	u8 num_of_non_acked_pkt[WMI_NUM_MCS];
3112 	/* RS timestamp */
3113 	__le32 tsf;
3114 	/* RS selected MCS */
3115 	u8 mcs;
3116 } __packed;
3117 
3118 /* WMI_GET_DETAILED_RS_RES_EVENTID - deprecated */
3119 struct wmi_get_detailed_rs_res_event {
3120 	u8 cid;
3121 	/* enum wmi_rs_results_status */
3122 	u8 status;
3123 	/* detailed rs results */
3124 	struct wmi_rs_results rs_results;
3125 	u8 reserved[3];
3126 } __packed;
3127 
3128 /* WMI_GET_DETAILED_RS_RES_EX_CMDID */
3129 struct wmi_get_detailed_rs_res_ex_cmd {
3130 	u8 cid;
3131 	u8 reserved[3];
3132 } __packed;
3133 
3134 /* Rate search results */
3135 struct wmi_rs_results_ex_common {
3136 	/* RS timestamp */
3137 	__le32 tsf;
3138 	/* RS selected MCS */
3139 	u8 mcs;
3140 	/* enum wmi_edmg_tx_mode */
3141 	u8 mode;
3142 	u8 reserved[2];
3143 } __packed;
3144 
3145 /* Rate search results */
3146 struct wmi_rs_results_ex_mcs {
3147 	/* number of sent MPDUs */
3148 	u8 num_of_tx_pkt;
3149 	/* number of non-acked MPDUs */
3150 	u8 num_of_non_acked_pkt;
3151 	u8 reserved[2];
3152 } __packed;
3153 
3154 /* WMI_GET_DETAILED_RS_RES_EX_EVENTID */
3155 struct wmi_get_detailed_rs_res_ex_event {
3156 	u8 cid;
3157 	/* enum wmi_rs_results_status */
3158 	u8 status;
3159 	u8 reserved0[2];
3160 	struct wmi_rs_results_ex_common common_rs_results;
3161 	u8 each_mcs_results_size;
3162 	u8 reserved1[3];
3163 	/* Results for each MCS */
3164 	struct wmi_rs_results_ex_mcs each_mcs_results[0];
3165 } __packed;
3166 
3167 /* BRP antenna limit mode */
3168 enum wmi_brp_ant_limit_mode {
3169 	/* Disable BRP force antenna limit */
3170 	WMI_BRP_ANT_LIMIT_MODE_DISABLE		= 0x00,
3171 	/* Define maximal antennas limit. Only effective antennas will be
3172 	 * actually used
3173 	 */
3174 	WMI_BRP_ANT_LIMIT_MODE_EFFECTIVE	= 0x01,
3175 	/* Force a specific number of antennas */
3176 	WMI_BRP_ANT_LIMIT_MODE_FORCE		= 0x02,
3177 	/* number of BRP antenna limit modes */
3178 	WMI_BRP_ANT_LIMIT_MODES_NUM		= 0x03,
3179 };
3180 
3181 /* WMI_BRP_SET_ANT_LIMIT_CMDID */
3182 struct wmi_brp_set_ant_limit_cmd {
3183 	/* connection id */
3184 	u8 cid;
3185 	/* enum wmi_brp_ant_limit_mode */
3186 	u8 limit_mode;
3187 	/* antenna limit count, 1-27
3188 	 * disable_mode - ignored
3189 	 * effective_mode - upper limit to number of antennas to be used
3190 	 * force_mode - exact number of antennas to be used
3191 	 */
3192 	u8 ant_limit;
3193 	u8 reserved;
3194 } __packed;
3195 
3196 /* WMI_BRP_SET_ANT_LIMIT_EVENTID */
3197 struct wmi_brp_set_ant_limit_event {
3198 	/* wmi_fw_status */
3199 	u8 status;
3200 	u8 reserved[3];
3201 } __packed;
3202 
3203 enum wmi_bf_type {
3204 	WMI_BF_TYPE_SLS		= 0x00,
3205 	WMI_BF_TYPE_BRP_RX	= 0x01,
3206 };
3207 
3208 /* WMI_BF_TRIG_CMDID */
3209 struct wmi_bf_trig_cmd {
3210 	/* enum wmi_bf_type - type of requested beamforming */
3211 	u8 bf_type;
3212 	/* used only for WMI_BF_TYPE_BRP_RX */
3213 	u8 cid;
3214 	/* used only for WMI_BF_TYPE_SLS */
3215 	u8 dst_mac[WMI_MAC_LEN];
3216 	u8 reserved[4];
3217 } __packed;
3218 
3219 /* WMI_BF_TRIG_EVENTID */
3220 struct wmi_bf_trig_event {
3221 	/* enum wmi_fw_status */
3222 	u8 status;
3223 	u8 cid;
3224 	u8 reserved[2];
3225 } __packed;
3226 
3227 /* broadcast connection ID */
3228 #define WMI_LINK_MAINTAIN_CFG_CID_BROADCAST	(0xFFFFFFFF)
3229 
3230 /* Types wmi_link_maintain_cfg presets for WMI_LINK_MAINTAIN_CFG_WRITE_CMD */
3231 enum wmi_link_maintain_cfg_type {
3232 	/* AP/PCP default normal (non-FST) configuration settings */
3233 	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_NORMAL_AP	= 0x00,
3234 	/* AP/PCP  default FST configuration settings */
3235 	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_FST_AP	= 0x01,
3236 	/* STA default normal (non-FST) configuration settings */
3237 	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_NORMAL_STA	= 0x02,
3238 	/* STA default FST configuration settings */
3239 	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_FST_STA	= 0x03,
3240 	/* custom configuration settings */
3241 	WMI_LINK_MAINTAIN_CFG_TYPE_CUSTOM		= 0x04,
3242 	/* number of defined configuration types */
3243 	WMI_LINK_MAINTAIN_CFG_TYPES_NUM			= 0x05,
3244 };
3245 
3246 /* Response status codes for WMI_LINK_MAINTAIN_CFG_WRITE/READ commands */
3247 enum wmi_link_maintain_cfg_response_status {
3248 	/* WMI_LINK_MAINTAIN_CFG_WRITE/READ command successfully accomplished
3249 	 */
3250 	WMI_LINK_MAINTAIN_CFG_RESPONSE_STATUS_OK		= 0x00,
3251 	/* ERROR due to bad argument in WMI_LINK_MAINTAIN_CFG_WRITE/READ
3252 	 * command request
3253 	 */
3254 	WMI_LINK_MAINTAIN_CFG_RESPONSE_STATUS_BAD_ARGUMENT	= 0x01,
3255 };
3256 
3257 /* Link Loss and Keep Alive configuration */
3258 struct wmi_link_maintain_cfg {
3259 	/* link_loss_enable_detectors_vec */
3260 	__le32 link_loss_enable_detectors_vec;
3261 	/* detectors check period usec */
3262 	__le32 check_link_loss_period_usec;
3263 	/* max allowed tx ageing */
3264 	__le32 tx_ageing_threshold_usec;
3265 	/* keep alive period for high SNR */
3266 	__le32 keep_alive_period_usec_high_snr;
3267 	/* keep alive period for low SNR */
3268 	__le32 keep_alive_period_usec_low_snr;
3269 	/* lower snr limit for keep alive period update */
3270 	__le32 keep_alive_snr_threshold_low_db;
3271 	/* upper snr limit for keep alive period update */
3272 	__le32 keep_alive_snr_threshold_high_db;
3273 	/* num of successive bad bcons causing link-loss */
3274 	__le32 bad_beacons_num_threshold;
3275 	/* SNR limit for bad_beacons_detector */
3276 	__le32 bad_beacons_snr_threshold_db;
3277 	/* timeout for disassoc response frame in uSec */
3278 	__le32 disconnect_timeout;
3279 } __packed;
3280 
3281 /* WMI_LINK_MAINTAIN_CFG_WRITE_CMDID */
3282 struct wmi_link_maintain_cfg_write_cmd {
3283 	/* enum wmi_link_maintain_cfg_type_e - type of requested default
3284 	 * configuration to be applied
3285 	 */
3286 	__le32 cfg_type;
3287 	/* requested connection ID or WMI_LINK_MAINTAIN_CFG_CID_BROADCAST */
3288 	__le32 cid;
3289 	/* custom configuration settings to be applied (relevant only if
3290 	 * cfg_type==WMI_LINK_MAINTAIN_CFG_TYPE_CUSTOM)
3291 	 */
3292 	struct wmi_link_maintain_cfg lm_cfg;
3293 } __packed;
3294 
3295 /* WMI_LINK_MAINTAIN_CFG_READ_CMDID */
3296 struct wmi_link_maintain_cfg_read_cmd {
3297 	/* connection ID which configuration settings are requested */
3298 	__le32 cid;
3299 } __packed;
3300 
3301 /* WMI_LINK_MAINTAIN_CFG_WRITE_DONE_EVENTID */
3302 struct wmi_link_maintain_cfg_write_done_event {
3303 	/* requested connection ID */
3304 	__le32 cid;
3305 	/* wmi_link_maintain_cfg_response_status_e - write status */
3306 	__le32 status;
3307 } __packed;
3308 
3309 /* \WMI_LINK_MAINTAIN_CFG_READ_DONE_EVENT */
3310 struct wmi_link_maintain_cfg_read_done_event {
3311 	/* requested connection ID */
3312 	__le32 cid;
3313 	/* wmi_link_maintain_cfg_response_status_e - read status */
3314 	__le32 status;
3315 	/* Retrieved configuration settings */
3316 	struct wmi_link_maintain_cfg lm_cfg;
3317 } __packed;
3318 
3319 enum wmi_traffic_suspend_status {
3320 	WMI_TRAFFIC_SUSPEND_APPROVED			= 0x0,
3321 	WMI_TRAFFIC_SUSPEND_REJECTED_LINK_NOT_IDLE	= 0x1,
3322 	WMI_TRAFFIC_SUSPEND_REJECTED_DISCONNECT		= 0x2,
3323 	WMI_TRAFFIC_SUSPEND_REJECTED_OTHER		= 0x3,
3324 };
3325 
3326 /* WMI_TRAFFIC_SUSPEND_EVENTID */
3327 struct wmi_traffic_suspend_event {
3328 	/* enum wmi_traffic_suspend_status_e */
3329 	u8 status;
3330 } __packed;
3331 
3332 enum wmi_traffic_resume_status {
3333 	WMI_TRAFFIC_RESUME_SUCCESS	= 0x0,
3334 	WMI_TRAFFIC_RESUME_FAILED	= 0x1,
3335 };
3336 
3337 enum wmi_resume_trigger {
3338 	WMI_RESUME_TRIGGER_UNKNOWN	= 0x0,
3339 	WMI_RESUME_TRIGGER_HOST		= 0x1,
3340 	WMI_RESUME_TRIGGER_UCAST_RX	= 0x2,
3341 	WMI_RESUME_TRIGGER_BCAST_RX	= 0x4,
3342 	WMI_RESUME_TRIGGER_WMI_EVT	= 0x8,
3343 	WMI_RESUME_TRIGGER_DISCONNECT	= 0x10,
3344 };
3345 
3346 /* WMI_TRAFFIC_RESUME_EVENTID */
3347 struct wmi_traffic_resume_event {
3348 	/* enum wmi_traffic_resume_status */
3349 	u8 status;
3350 	u8 reserved[3];
3351 	/* enum wmi_resume_trigger bitmap */
3352 	__le32 resume_triggers;
3353 } __packed;
3354 
3355 /* Power Save command completion status codes */
3356 enum wmi_ps_cfg_cmd_status {
3357 	WMI_PS_CFG_CMD_STATUS_SUCCESS	= 0x00,
3358 	WMI_PS_CFG_CMD_STATUS_BAD_PARAM	= 0x01,
3359 	/* other error */
3360 	WMI_PS_CFG_CMD_STATUS_ERROR	= 0x02,
3361 };
3362 
3363 /* Device Power Save Profiles */
3364 enum wmi_ps_profile_type {
3365 	WMI_PS_PROFILE_TYPE_DEFAULT		= 0x00,
3366 	WMI_PS_PROFILE_TYPE_PS_DISABLED		= 0x01,
3367 	WMI_PS_PROFILE_TYPE_MAX_PS		= 0x02,
3368 	WMI_PS_PROFILE_TYPE_LOW_LATENCY_PS	= 0x03,
3369 };
3370 
3371 /* WMI_PS_DEV_PROFILE_CFG_READ_CMDID */
3372 struct wmi_ps_dev_profile_cfg_read_cmd {
3373 	/* reserved */
3374 	__le32 reserved;
3375 } __packed;
3376 
3377 /* WMI_PS_DEV_PROFILE_CFG_READ_EVENTID */
3378 struct wmi_ps_dev_profile_cfg_read_event {
3379 	/* wmi_ps_profile_type_e */
3380 	u8 ps_profile;
3381 	u8 reserved[3];
3382 } __packed;
3383 
3384 /* WMI_PS_DEV_PROFILE_CFG_CMDID
3385  *
3386  * Power save profile to be used by the device
3387  *
3388  * Returned event:
3389  * - WMI_PS_DEV_PROFILE_CFG_EVENTID
3390  */
3391 struct wmi_ps_dev_profile_cfg_cmd {
3392 	/* wmi_ps_profile_type_e */
3393 	u8 ps_profile;
3394 	u8 reserved[3];
3395 } __packed;
3396 
3397 /* WMI_PS_DEV_PROFILE_CFG_EVENTID */
3398 struct wmi_ps_dev_profile_cfg_event {
3399 	/* wmi_ps_cfg_cmd_status_e */
3400 	__le32 status;
3401 } __packed;
3402 
3403 enum wmi_ps_level {
3404 	WMI_PS_LEVEL_DEEP_SLEEP		= 0x00,
3405 	WMI_PS_LEVEL_SHALLOW_SLEEP	= 0x01,
3406 	/* awake = all PS mechanisms are disabled */
3407 	WMI_PS_LEVEL_AWAKE		= 0x02,
3408 };
3409 
3410 enum wmi_ps_deep_sleep_clk_level {
3411 	/* 33k */
3412 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_RTC		= 0x00,
3413 	/* 10k */
3414 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_OSC		= 0x01,
3415 	/* @RTC Low latency */
3416 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_RTC_LT	= 0x02,
3417 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_XTAL	= 0x03,
3418 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_SYSCLK	= 0x04,
3419 	/* Not Applicable */
3420 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_N_A		= 0xFF,
3421 };
3422 
3423 /* Response by the FW to a D3 entry request */
3424 enum wmi_ps_d3_resp_policy {
3425 	WMI_PS_D3_RESP_POLICY_DEFAULT	= 0x00,
3426 	/* debug -D3 req is always denied */
3427 	WMI_PS_D3_RESP_POLICY_DENIED	= 0x01,
3428 	/* debug -D3 req is always approved */
3429 	WMI_PS_D3_RESP_POLICY_APPROVED	= 0x02,
3430 };
3431 
3432 #define WMI_AOA_MAX_DATA_SIZE	(128)
3433 
3434 enum wmi_aoa_meas_status {
3435 	WMI_AOA_MEAS_SUCCESS		= 0x00,
3436 	WMI_AOA_MEAS_PEER_INCAPABLE	= 0x01,
3437 	WMI_AOA_MEAS_FAILURE		= 0x02,
3438 };
3439 
3440 /* WMI_AOA_MEAS_EVENTID */
3441 struct wmi_aoa_meas_event {
3442 	u8 mac_addr[WMI_MAC_LEN];
3443 	/* channels IDs:
3444 	 * 0 - 58320 MHz
3445 	 * 1 - 60480 MHz
3446 	 * 2 - 62640 MHz
3447 	 */
3448 	u8 channel;
3449 	/* enum wmi_aoa_meas_type */
3450 	u8 aoa_meas_type;
3451 	/* Measurments are from RFs, defined by the mask */
3452 	__le32 meas_rf_mask;
3453 	/* enum wmi_aoa_meas_status */
3454 	u8 meas_status;
3455 	u8 reserved;
3456 	/* Length of meas_data in bytes */
3457 	__le16 length;
3458 	u8 meas_data[WMI_AOA_MAX_DATA_SIZE];
3459 } __packed;
3460 
3461 /* WMI_SET_MGMT_RETRY_LIMIT_EVENTID */
3462 struct wmi_set_mgmt_retry_limit_event {
3463 	/* enum wmi_fw_status */
3464 	u8 status;
3465 	/* alignment to 32b */
3466 	u8 reserved[3];
3467 } __packed;
3468 
3469 /* WMI_GET_MGMT_RETRY_LIMIT_EVENTID */
3470 struct wmi_get_mgmt_retry_limit_event {
3471 	/* MAC retransmit limit for mgmt frames */
3472 	u8 mgmt_retry_limit;
3473 	/* alignment to 32b */
3474 	u8 reserved[3];
3475 } __packed;
3476 
3477 /* WMI_TOF_GET_CAPABILITIES_EVENTID */
3478 struct wmi_tof_get_capabilities_event {
3479 	u8 ftm_capability;
3480 	/* maximum supported number of destination to start TOF */
3481 	u8 max_num_of_dest;
3482 	/* maximum supported number of measurements per burst */
3483 	u8 max_num_of_meas_per_burst;
3484 	u8 reserved;
3485 	/* maximum supported multi bursts */
3486 	__le16 max_multi_bursts_sessions;
3487 	/* maximum supported FTM burst duration , wmi_tof_burst_duration_e */
3488 	__le16 max_ftm_burst_duration;
3489 	/* AOA supported types */
3490 	__le32 aoa_supported_types;
3491 } __packed;
3492 
3493 /* WMI_SET_THERMAL_THROTTLING_CFG_EVENTID */
3494 struct wmi_set_thermal_throttling_cfg_event {
3495 	/* wmi_fw_status */
3496 	u8 status;
3497 	u8 reserved[3];
3498 } __packed;
3499 
3500 /* WMI_GET_THERMAL_THROTTLING_CFG_EVENTID */
3501 struct wmi_get_thermal_throttling_cfg_event {
3502 	/* Status data */
3503 	struct wmi_tt_data tt_data;
3504 } __packed;
3505 
3506 enum wmi_tof_session_end_status {
3507 	WMI_TOF_SESSION_END_NO_ERROR		= 0x00,
3508 	WMI_TOF_SESSION_END_FAIL		= 0x01,
3509 	WMI_TOF_SESSION_END_PARAMS_ERROR	= 0x02,
3510 	WMI_TOF_SESSION_END_ABORTED		= 0x03,
3511 	WMI_TOF_SESSION_END_BUSY		= 0x04,
3512 };
3513 
3514 /* WMI_TOF_SESSION_END_EVENTID */
3515 struct wmi_tof_session_end_event {
3516 	/* FTM session ID */
3517 	__le32 session_id;
3518 	/* wmi_tof_session_end_status_e */
3519 	u8 status;
3520 	u8 reserved[3];
3521 } __packed;
3522 
3523 /* WMI_TOF_SET_LCI_EVENTID */
3524 struct wmi_tof_set_lci_event {
3525 	/* enum wmi_fw_status */
3526 	u8 status;
3527 	u8 reserved[3];
3528 } __packed;
3529 
3530 /* WMI_TOF_SET_LCR_EVENTID */
3531 struct wmi_tof_set_lcr_event {
3532 	/* enum wmi_fw_status */
3533 	u8 status;
3534 	u8 reserved[3];
3535 } __packed;
3536 
3537 /* Responder FTM Results */
3538 struct wmi_responder_ftm_res {
3539 	u8 t1[6];
3540 	u8 t2[6];
3541 	u8 t3[6];
3542 	u8 t4[6];
3543 	__le16 tod_err;
3544 	__le16 toa_err;
3545 	__le16 tod_err_initiator;
3546 	__le16 toa_err_initiator;
3547 } __packed;
3548 
3549 enum wmi_tof_ftm_per_dest_res_status {
3550 	WMI_PER_DEST_RES_NO_ERROR		= 0x00,
3551 	WMI_PER_DEST_RES_TX_RX_FAIL		= 0x01,
3552 	WMI_PER_DEST_RES_PARAM_DONT_MATCH	= 0x02,
3553 };
3554 
3555 enum wmi_tof_ftm_per_dest_res_flags {
3556 	WMI_PER_DEST_RES_REQ_START		= 0x01,
3557 	WMI_PER_DEST_RES_BURST_REPORT_END	= 0x02,
3558 	WMI_PER_DEST_RES_REQ_END		= 0x04,
3559 	WMI_PER_DEST_RES_PARAM_UPDATE		= 0x08,
3560 };
3561 
3562 /* WMI_TOF_FTM_PER_DEST_RES_EVENTID */
3563 struct wmi_tof_ftm_per_dest_res_event {
3564 	/* FTM session ID */
3565 	__le32 session_id;
3566 	/* destination MAC address */
3567 	u8 dst_mac[WMI_MAC_LEN];
3568 	/* wmi_tof_ftm_per_dest_res_flags_e */
3569 	u8 flags;
3570 	/* wmi_tof_ftm_per_dest_res_status_e */
3571 	u8 status;
3572 	/* responder ASAP */
3573 	u8 responder_asap;
3574 	/* responder number of FTM per burst */
3575 	u8 responder_num_ftm_per_burst;
3576 	/* responder number of FTM burst exponent */
3577 	u8 responder_num_ftm_bursts_exp;
3578 	/* responder burst duration ,wmi_tof_burst_duration_e */
3579 	u8 responder_burst_duration;
3580 	/* responder burst period, indicate interval between two consecutive
3581 	 * burst instances, in units of 100 ms
3582 	 */
3583 	__le16 responder_burst_period;
3584 	/* receive burst counter */
3585 	__le16 bursts_cnt;
3586 	/* tsf of responder start burst */
3587 	__le32 tsf_sync;
3588 	/* actual received ftm per burst */
3589 	u8 actual_ftm_per_burst;
3590 	/* Measurments are from RFs, defined by the mask */
3591 	__le32 meas_rf_mask;
3592 	u8 reserved0[3];
3593 	struct wmi_responder_ftm_res responder_ftm_res[0];
3594 } __packed;
3595 
3596 /* WMI_TOF_CFG_RESPONDER_EVENTID */
3597 struct wmi_tof_cfg_responder_event {
3598 	/* enum wmi_fw_status */
3599 	u8 status;
3600 	u8 reserved[3];
3601 } __packed;
3602 
3603 enum wmi_tof_channel_info_type {
3604 	WMI_TOF_CHANNEL_INFO_AOA		= 0x00,
3605 	WMI_TOF_CHANNEL_INFO_LCI		= 0x01,
3606 	WMI_TOF_CHANNEL_INFO_LCR		= 0x02,
3607 	WMI_TOF_CHANNEL_INFO_VENDOR_SPECIFIC	= 0x03,
3608 	WMI_TOF_CHANNEL_INFO_CIR		= 0x04,
3609 	WMI_TOF_CHANNEL_INFO_RSSI		= 0x05,
3610 	WMI_TOF_CHANNEL_INFO_SNR		= 0x06,
3611 	WMI_TOF_CHANNEL_INFO_DEBUG		= 0x07,
3612 };
3613 
3614 /* WMI_TOF_CHANNEL_INFO_EVENTID */
3615 struct wmi_tof_channel_info_event {
3616 	/* FTM session ID */
3617 	__le32 session_id;
3618 	/* destination MAC address */
3619 	u8 dst_mac[WMI_MAC_LEN];
3620 	/* wmi_tof_channel_info_type_e */
3621 	u8 type;
3622 	/* data report length */
3623 	u8 len;
3624 	/* data report payload */
3625 	u8 report[0];
3626 } __packed;
3627 
3628 /* WMI_TOF_SET_TX_RX_OFFSET_EVENTID */
3629 struct wmi_tof_set_tx_rx_offset_event {
3630 	/* enum wmi_fw_status */
3631 	u8 status;
3632 	u8 reserved[3];
3633 } __packed;
3634 
3635 /* WMI_TOF_GET_TX_RX_OFFSET_EVENTID */
3636 struct wmi_tof_get_tx_rx_offset_event {
3637 	/* enum wmi_fw_status */
3638 	u8 status;
3639 	/* RF index used to read the offsets */
3640 	u8 rf_index;
3641 	u8 reserved1[2];
3642 	/* TX delay offset */
3643 	__le32 tx_offset;
3644 	/* RX delay offset */
3645 	__le32 rx_offset;
3646 	/* Offset to strongest tap of CIR */
3647 	__le32 precursor;
3648 } __packed;
3649 
3650 /* Result status codes for WMI commands */
3651 enum wmi_rf_sector_status {
3652 	WMI_RF_SECTOR_STATUS_SUCCESS			= 0x00,
3653 	WMI_RF_SECTOR_STATUS_BAD_PARAMETERS_ERROR	= 0x01,
3654 	WMI_RF_SECTOR_STATUS_BUSY_ERROR			= 0x02,
3655 	WMI_RF_SECTOR_STATUS_NOT_SUPPORTED_ERROR	= 0x03,
3656 };
3657 
3658 /* Types of the RF sector (TX,RX) */
3659 enum wmi_rf_sector_type {
3660 	WMI_RF_SECTOR_TYPE_RX	= 0x00,
3661 	WMI_RF_SECTOR_TYPE_TX	= 0x01,
3662 };
3663 
3664 /* Content of RF Sector (six 32-bits registers) */
3665 struct wmi_rf_sector_info {
3666 	/* Phase values for RF Chains[15-0] (2bits per RF chain) */
3667 	__le32 psh_hi;
3668 	/* Phase values for RF Chains[31-16] (2bits per RF chain) */
3669 	__le32 psh_lo;
3670 	/* ETYPE Bit0 for all RF chains[31-0] - bit0 of Edge amplifier gain
3671 	 * index
3672 	 */
3673 	__le32 etype0;
3674 	/* ETYPE Bit1 for all RF chains[31-0] - bit1 of Edge amplifier gain
3675 	 * index
3676 	 */
3677 	__le32 etype1;
3678 	/* ETYPE Bit2 for all RF chains[31-0] - bit2 of Edge amplifier gain
3679 	 * index
3680 	 */
3681 	__le32 etype2;
3682 	/* D-Type values (3bits each) for 8 Distribution amplifiers + X16
3683 	 * switch bits
3684 	 */
3685 	__le32 dtype_swch_off;
3686 } __packed;
3687 
3688 #define WMI_INVALID_RF_SECTOR_INDEX	(0xFFFF)
3689 #define WMI_MAX_RF_MODULES_NUM		(8)
3690 
3691 /* WMI_GET_RF_SECTOR_PARAMS_CMD */
3692 struct wmi_get_rf_sector_params_cmd {
3693 	/* Sector number to be retrieved */
3694 	__le16 sector_idx;
3695 	/* enum wmi_rf_sector_type - type of requested RF sector */
3696 	u8 sector_type;
3697 	/* bitmask vector specifying destination RF modules */
3698 	u8 rf_modules_vec;
3699 } __packed;
3700 
3701 /* \WMI_GET_RF_SECTOR_PARAMS_DONE_EVENT */
3702 struct wmi_get_rf_sector_params_done_event {
3703 	/* result status of WMI_GET_RF_SECTOR_PARAMS_CMD (enum
3704 	 * wmi_rf_sector_status)
3705 	 */
3706 	u8 status;
3707 	/* align next field to U64 boundary */
3708 	u8 reserved[7];
3709 	/* TSF timestamp when RF sectors where retrieved */
3710 	__le64 tsf;
3711 	/* Content of RF sector retrieved from each RF module */
3712 	struct wmi_rf_sector_info sectors_info[WMI_MAX_RF_MODULES_NUM];
3713 } __packed;
3714 
3715 /* WMI_SET_RF_SECTOR_PARAMS_CMD */
3716 struct wmi_set_rf_sector_params_cmd {
3717 	/* Sector number to be retrieved */
3718 	__le16 sector_idx;
3719 	/* enum wmi_rf_sector_type - type of requested RF sector */
3720 	u8 sector_type;
3721 	/* bitmask vector specifying destination RF modules */
3722 	u8 rf_modules_vec;
3723 	/* Content of RF sector to be written to each RF module */
3724 	struct wmi_rf_sector_info sectors_info[WMI_MAX_RF_MODULES_NUM];
3725 } __packed;
3726 
3727 /* \WMI_SET_RF_SECTOR_PARAMS_DONE_EVENT */
3728 struct wmi_set_rf_sector_params_done_event {
3729 	/* result status of WMI_SET_RF_SECTOR_PARAMS_CMD (enum
3730 	 * wmi_rf_sector_status)
3731 	 */
3732 	u8 status;
3733 } __packed;
3734 
3735 /* WMI_GET_SELECTED_RF_SECTOR_INDEX_CMD - Get RF sector index selected by
3736  * TXSS/BRP for communication with specified CID
3737  */
3738 struct wmi_get_selected_rf_sector_index_cmd {
3739 	/* Connection/Station ID in [0:7] range */
3740 	u8 cid;
3741 	/* type of requested RF sector (enum wmi_rf_sector_type) */
3742 	u8 sector_type;
3743 	/* align to U32 boundary */
3744 	u8 reserved[2];
3745 } __packed;
3746 
3747 /* \WMI_GET_SELECTED_RF_SECTOR_INDEX_DONE_EVENT - Returns retrieved RF sector
3748  * index selected by TXSS/BRP for communication with specified CID
3749  */
3750 struct wmi_get_selected_rf_sector_index_done_event {
3751 	/* Retrieved sector index selected in TXSS (for TX sector request) or
3752 	 * BRP (for RX sector request)
3753 	 */
3754 	__le16 sector_idx;
3755 	/* result status of WMI_GET_SELECTED_RF_SECTOR_INDEX_CMD (enum
3756 	 * wmi_rf_sector_status)
3757 	 */
3758 	u8 status;
3759 	/* align next field to U64 boundary */
3760 	u8 reserved[5];
3761 	/* TSF timestamp when result was retrieved */
3762 	__le64 tsf;
3763 } __packed;
3764 
3765 /* WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD - Force RF sector index for
3766  * communication with specified CID. Assumes that TXSS/BRP is disabled by
3767  * other command
3768  */
3769 struct wmi_set_selected_rf_sector_index_cmd {
3770 	/* Connection/Station ID in [0:7] range */
3771 	u8 cid;
3772 	/* type of requested RF sector (enum wmi_rf_sector_type) */
3773 	u8 sector_type;
3774 	/* Forced sector index */
3775 	__le16 sector_idx;
3776 } __packed;
3777 
3778 /* \WMI_SET_SELECTED_RF_SECTOR_INDEX_DONE_EVENT - Success/Fail status for
3779  * WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD
3780  */
3781 struct wmi_set_selected_rf_sector_index_done_event {
3782 	/* result status of WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD (enum
3783 	 * wmi_rf_sector_status)
3784 	 */
3785 	u8 status;
3786 	/* align to U32 boundary */
3787 	u8 reserved[3];
3788 } __packed;
3789 
3790 /* WMI_SET_RF_SECTOR_ON_CMD - Activates specified sector for specified rf
3791  * modules
3792  */
3793 struct wmi_set_rf_sector_on_cmd {
3794 	/* Sector index to be activated */
3795 	__le16 sector_idx;
3796 	/* type of requested RF sector (enum wmi_rf_sector_type) */
3797 	u8 sector_type;
3798 	/* bitmask vector specifying destination RF modules */
3799 	u8 rf_modules_vec;
3800 } __packed;
3801 
3802 /* \WMI_SET_RF_SECTOR_ON_DONE_EVENT - Success/Fail status for
3803  * WMI_SET_RF_SECTOR_ON_CMD
3804  */
3805 struct wmi_set_rf_sector_on_done_event {
3806 	/* result status of WMI_SET_RF_SECTOR_ON_CMD (enum
3807 	 * wmi_rf_sector_status)
3808 	 */
3809 	u8 status;
3810 	/* align to U32 boundary */
3811 	u8 reserved[3];
3812 } __packed;
3813 
3814 enum wmi_sector_sweep_type {
3815 	WMI_SECTOR_SWEEP_TYPE_TXSS		= 0x00,
3816 	WMI_SECTOR_SWEEP_TYPE_BCON		= 0x01,
3817 	WMI_SECTOR_SWEEP_TYPE_TXSS_AND_BCON	= 0x02,
3818 	WMI_SECTOR_SWEEP_TYPE_NUM		= 0x03,
3819 };
3820 
3821 /* WMI_PRIO_TX_SECTORS_ORDER_CMDID
3822  *
3823  * Set the order of TX sectors in TXSS and/or Beacon(AP).
3824  *
3825  * Returned event:
3826  * - WMI_PRIO_TX_SECTORS_ORDER_EVENTID
3827  */
3828 struct wmi_prio_tx_sectors_order_cmd {
3829 	/* tx sectors order to be applied, 0xFF for end of array */
3830 	u8 tx_sectors_priority_array[MAX_NUM_OF_SECTORS];
3831 	/* enum wmi_sector_sweep_type, TXSS and/or Beacon */
3832 	u8 sector_sweep_type;
3833 	/* needed only for TXSS configuration */
3834 	u8 cid;
3835 	/* alignment to 32b */
3836 	u8 reserved[2];
3837 } __packed;
3838 
3839 /* completion status codes */
3840 enum wmi_prio_tx_sectors_cmd_status {
3841 	WMI_PRIO_TX_SECT_CMD_STATUS_SUCCESS	= 0x00,
3842 	WMI_PRIO_TX_SECT_CMD_STATUS_BAD_PARAM	= 0x01,
3843 	/* other error */
3844 	WMI_PRIO_TX_SECT_CMD_STATUS_ERROR	= 0x02,
3845 };
3846 
3847 /* WMI_PRIO_TX_SECTORS_ORDER_EVENTID */
3848 struct wmi_prio_tx_sectors_order_event {
3849 	/* enum wmi_prio_tx_sectors_cmd_status */
3850 	u8 status;
3851 	/* alignment to 32b */
3852 	u8 reserved[3];
3853 } __packed;
3854 
3855 struct wmi_prio_tx_sectors_num_cmd {
3856 	/* [0-128], 0 = No changes */
3857 	u8 beacon_number_of_sectors;
3858 	/* [0-128], 0 = No changes */
3859 	u8 txss_number_of_sectors;
3860 	/* [0-8] needed only for TXSS configuration */
3861 	u8 cid;
3862 } __packed;
3863 
3864 /* WMI_PRIO_TX_SECTORS_NUMBER_CMDID
3865  *
3866  * Set the number of active sectors in TXSS and/or Beacon.
3867  *
3868  * Returned event:
3869  * - WMI_PRIO_TX_SECTORS_NUMBER_EVENTID
3870  */
3871 struct wmi_prio_tx_sectors_number_cmd {
3872 	struct wmi_prio_tx_sectors_num_cmd active_sectors_num;
3873 	/* alignment to 32b */
3874 	u8 reserved;
3875 } __packed;
3876 
3877 /* WMI_PRIO_TX_SECTORS_NUMBER_EVENTID */
3878 struct wmi_prio_tx_sectors_number_event {
3879 	/* enum wmi_prio_tx_sectors_cmd_status */
3880 	u8 status;
3881 	/* alignment to 32b */
3882 	u8 reserved[3];
3883 } __packed;
3884 
3885 /* WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_CMDID
3886  *
3887  * Set default sectors order and number (hard coded in board file)
3888  * in TXSS and/or Beacon.
3889  *
3890  * Returned event:
3891  * - WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID
3892  */
3893 struct wmi_prio_tx_sectors_set_default_cfg_cmd {
3894 	/* enum wmi_sector_sweep_type, TXSS and/or Beacon */
3895 	u8 sector_sweep_type;
3896 	/* needed only for TXSS configuration */
3897 	u8 cid;
3898 	/* alignment to 32b */
3899 	u8 reserved[2];
3900 } __packed;
3901 
3902 /* WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID */
3903 struct wmi_prio_tx_sectors_set_default_cfg_event {
3904 	/* enum wmi_prio_tx_sectors_cmd_status */
3905 	u8 status;
3906 	/* alignment to 32b */
3907 	u8 reserved[3];
3908 } __packed;
3909 
3910 /* WMI_SET_SILENT_RSSI_TABLE_DONE_EVENTID */
3911 struct wmi_set_silent_rssi_table_done_event {
3912 	/* enum wmi_silent_rssi_status */
3913 	__le32 status;
3914 	/* enum wmi_silent_rssi_table */
3915 	__le32 table;
3916 } __packed;
3917 
3918 /* WMI_VRING_SWITCH_TIMING_CONFIG_EVENTID */
3919 struct wmi_vring_switch_timing_config_event {
3920 	/* enum wmi_fw_status */
3921 	u8 status;
3922 	u8 reserved[3];
3923 } __packed;
3924 
3925 /* WMI_GET_ASSOC_LIST_RES_EVENTID */
3926 struct wmi_assoc_sta_info {
3927 	u8 mac[WMI_MAC_LEN];
3928 	u8 omni_index_address;
3929 	u8 reserved;
3930 } __packed;
3931 
3932 #define WMI_GET_ASSOC_LIST_SIZE	(8)
3933 
3934 /* WMI_GET_ASSOC_LIST_RES_EVENTID
3935  * Returns up to MAX_ASSOC_STA_LIST_SIZE associated STAs
3936  */
3937 struct wmi_get_assoc_list_res_event {
3938 	struct wmi_assoc_sta_info assoc_sta_list[WMI_GET_ASSOC_LIST_SIZE];
3939 	/* STA count */
3940 	u8 count;
3941 	u8 reserved[3];
3942 } __packed;
3943 
3944 /* WMI_BF_CONTROL_EVENTID - deprecated */
3945 struct wmi_bf_control_event {
3946 	/* wmi_fw_status */
3947 	u8 status;
3948 	u8 reserved[3];
3949 } __packed;
3950 
3951 /* WMI_BF_CONTROL_EX_EVENTID */
3952 struct wmi_bf_control_ex_event {
3953 	/* wmi_fw_status */
3954 	u8 status;
3955 	u8 reserved[3];
3956 } __packed;
3957 
3958 /* WMI_COMMAND_NOT_SUPPORTED_EVENTID */
3959 struct wmi_command_not_supported_event {
3960 	/* device id */
3961 	u8 mid;
3962 	u8 reserved0;
3963 	__le16 command_id;
3964 	/* for UT command only, otherwise reserved */
3965 	__le16 command_subtype;
3966 	__le16 reserved1;
3967 } __packed;
3968 
3969 /* WMI_TSF_SYNC_CMDID */
3970 struct wmi_tsf_sync_cmd {
3971 	/* The time interval to send announce frame in one BI */
3972 	u8 interval_ms;
3973 	/* The mcs to send announce frame */
3974 	u8 mcs;
3975 	u8 reserved[6];
3976 } __packed;
3977 
3978 /* WMI_TSF_SYNC_STATUS_EVENTID */
3979 enum wmi_tsf_sync_status {
3980 	WMI_TSF_SYNC_SUCCESS	= 0x00,
3981 	WMI_TSF_SYNC_FAILED	= 0x01,
3982 	WMI_TSF_SYNC_REJECTED	= 0x02,
3983 };
3984 
3985 /* WMI_TSF_SYNC_STATUS_EVENTID */
3986 struct wmi_tsf_sync_status_event {
3987 	/* enum wmi_tsf_sync_status */
3988 	u8 status;
3989 	u8 reserved[3];
3990 } __packed;
3991 
3992 /* WMI_GET_CCA_INDICATIONS_EVENTID */
3993 struct wmi_get_cca_indications_event {
3994 	/* wmi_fw_status */
3995 	u8 status;
3996 	/* CCA-Energy Detect in percentage over last BI (0..100) */
3997 	u8 cca_ed_percent;
3998 	/* Averaged CCA-Energy Detect in percent over number of BIs (0..100) */
3999 	u8 cca_ed_avg_percent;
4000 	/* NAV percent over last BI (0..100) */
4001 	u8 nav_percent;
4002 	/* Averaged NAV percent over number of BIs (0..100) */
4003 	u8 nav_avg_percent;
4004 	u8 reserved[3];
4005 } __packed;
4006 
4007 /* WMI_SET_CCA_INDICATIONS_BI_AVG_NUM_CMDID */
4008 struct wmi_set_cca_indications_bi_avg_num_cmd {
4009 	/* set the number of bis to average cca_ed (0..255) */
4010 	u8 bi_number;
4011 	u8 reserved[3];
4012 } __packed;
4013 
4014 /* WMI_SET_CCA_INDICATIONS_BI_AVG_NUM_EVENTID */
4015 struct wmi_set_cca_indications_bi_avg_num_event {
4016 	/* wmi_fw_status */
4017 	u8 status;
4018 	u8 reserved[3];
4019 } __packed;
4020 
4021 /* WMI_INTERNAL_FW_SET_CHANNEL */
4022 struct wmi_internal_fw_set_channel_event {
4023 	u8 channel_num;
4024 	u8 reserved[3];
4025 } __packed;
4026 
4027 /* WMI_LINK_STATS_CONFIG_DONE_EVENTID */
4028 struct wmi_link_stats_config_done_event {
4029 	/* wmi_fw_status_e */
4030 	u8 status;
4031 	u8 reserved[3];
4032 } __packed;
4033 
4034 /* WMI_LINK_STATS_EVENTID */
4035 struct wmi_link_stats_event {
4036 	__le64 tsf;
4037 	__le16 payload_size;
4038 	u8 has_next;
4039 	u8 reserved[5];
4040 	/* a stream of wmi_link_stats_record_s */
4041 	u8 payload[0];
4042 } __packed;
4043 
4044 /* WMI_LINK_STATS_EVENT */
4045 struct wmi_link_stats_record {
4046 	/* wmi_link_stats_record_type_e */
4047 	u8 record_type_id;
4048 	u8 reserved;
4049 	__le16 record_size;
4050 	u8 record[0];
4051 } __packed;
4052 
4053 /* WMI_LINK_STATS_TYPE_BASIC */
4054 struct wmi_link_stats_basic {
4055 	u8 cid;
4056 	s8 rssi;
4057 	u8 sqi;
4058 	u8 bf_mcs;
4059 	u8 per_average;
4060 	u8 selected_rfc;
4061 	u8 rx_effective_ant_num;
4062 	u8 my_rx_sector;
4063 	u8 my_tx_sector;
4064 	u8 other_rx_sector;
4065 	u8 other_tx_sector;
4066 	u8 reserved[7];
4067 	/* 1/4 Db units */
4068 	__le16 snr;
4069 	__le32 tx_tpt;
4070 	__le32 tx_goodput;
4071 	__le32 rx_goodput;
4072 	__le32 bf_count;
4073 	__le32 rx_bcast_frames;
4074 } __packed;
4075 
4076 /* WMI_LINK_STATS_TYPE_GLOBAL */
4077 struct wmi_link_stats_global {
4078 	/* all ack-able frames */
4079 	__le32 rx_frames;
4080 	/* all ack-able frames */
4081 	__le32 tx_frames;
4082 	__le32 rx_ba_frames;
4083 	__le32 tx_ba_frames;
4084 	__le32 tx_beacons;
4085 	__le32 rx_mic_errors;
4086 	__le32 rx_crc_errors;
4087 	__le32 tx_fail_no_ack;
4088 	u8 reserved[8];
4089 } __packed;
4090 
4091 /* WMI_SET_GRANT_MCS_EVENTID */
4092 struct wmi_set_grant_mcs_event {
4093 	/* wmi_fw_status */
4094 	u8 status;
4095 	u8 reserved[3];
4096 } __packed;
4097 
4098 /* WMI_SET_AP_SLOT_SIZE_EVENTID */
4099 struct wmi_set_ap_slot_size_event {
4100 	/* wmi_fw_status */
4101 	u8 status;
4102 	u8 reserved[3];
4103 } __packed;
4104 
4105 /* WMI_SET_VRING_PRIORITY_WEIGHT_EVENTID */
4106 struct wmi_set_vring_priority_weight_event {
4107 	/* wmi_fw_status */
4108 	u8 status;
4109 	u8 reserved[3];
4110 } __packed;
4111 
4112 /* WMI_SET_VRING_PRIORITY_EVENTID */
4113 struct wmi_set_vring_priority_event {
4114 	/* wmi_fw_status */
4115 	u8 status;
4116 	u8 reserved[3];
4117 } __packed;
4118 
4119 /* WMI_RADAR_PCI_CTRL_BLOCK struct */
4120 struct wmi_radar_pci_ctrl_block {
4121 	/* last fw tail address index */
4122 	__le32 fw_tail_index;
4123 	/* last SW head address index known to FW */
4124 	__le32 sw_head_index;
4125 	__le32 last_wr_pulse_tsf_low;
4126 	__le32 last_wr_pulse_count;
4127 	__le32 last_wr_in_bytes;
4128 	__le32 last_wr_pulse_id;
4129 	__le32 last_wr_burst_id;
4130 	/* When pre overflow detected, advance sw head in unit of pulses */
4131 	__le32 sw_head_inc;
4132 	__le32 reserved[8];
4133 } __packed;
4134 
4135 /* WMI_RBUFCAP_CFG_CMD */
4136 struct wmi_rbufcap_cfg_cmd {
4137 	u8 enable;
4138 	u8 reserved;
4139 	/* RBUFCAP indicates rx space unavailable when number of rx
4140 	 * descriptors drops below this threshold. Set 0 to use system
4141 	 * default
4142 	 */
4143 	__le16 rx_desc_threshold;
4144 } __packed;
4145 
4146 /* WMI_RBUFCAP_CFG_EVENTID */
4147 struct wmi_rbufcap_cfg_event {
4148 	/* enum wmi_fw_status */
4149 	u8 status;
4150 	u8 reserved[3];
4151 } __packed;
4152 
4153 /* WMI_TEMP_SENSE_ALL_DONE_EVENTID
4154  * Measure MAC and all radio temperatures
4155  */
4156 struct wmi_temp_sense_all_done_event {
4157 	/* enum wmi_fw_status */
4158 	u8 status;
4159 	/* Bitmap of connected RFs */
4160 	u8 rf_bitmap;
4161 	u8 reserved[2];
4162 	/* Temperature times 1000 (actual temperature will be achieved by
4163 	 * dividing the value by 1000). When temperature cannot be read from
4164 	 * device return WMI_INVALID_TEMPERATURE
4165 	 */
4166 	__le32 rf_t1000[WMI_MAX_XIF_PORTS_NUM];
4167 	/* Temperature times 1000 (actual temperature will be achieved by
4168 	 * dividing the value by 1000). When temperature cannot be read from
4169 	 * device return WMI_INVALID_TEMPERATURE
4170 	 */
4171 	__le32 baseband_t1000;
4172 } __packed;
4173 
4174 #endif /* __WILOCITY_WMI_H__ */
4175