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