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