xref: /openbmc/linux/drivers/net/wireless/ath/wil6210/wmi.h (revision a5dc688392737bbab3699d63f26e853a40c52d2d)
1 /*
2  * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
3  * Copyright (c) 2006-2012 Wilocity
4  *
5  * Permission to use, copy, modify, and/or distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  */
17 
18 /*
19  * This file contains the definitions of the WMI protocol specified in the
20  * Wireless Module Interface (WMI) for the Qualcomm
21  * 60 GHz wireless solution.
22  * It includes definitions of all the commands and events.
23  * Commands are messages from the host to the WM.
24  * Events are messages from the WM to the host.
25  *
26  * This is an automatically generated file.
27  */
28 
29 #ifndef __WILOCITY_WMI_H__
30 #define __WILOCITY_WMI_H__
31 
32 /* General */
33 #define WMI_MAX_ASSOC_STA		(8)
34 #define WMI_DEFAULT_ASSOC_STA		(1)
35 #define WMI_MAC_LEN			(6)
36 #define WMI_PROX_RANGE_NUM		(3)
37 #define WMI_MAX_LOSS_DMG_BEACONS	(20)
38 #define MAX_NUM_OF_SECTORS		(128)
39 #define WMI_SCHED_MAX_ALLOCS_PER_CMD	(4)
40 #define WMI_RF_DTYPE_LENGTH		(3)
41 #define WMI_RF_ETYPE_LENGTH		(3)
42 #define WMI_RF_RX2TX_LENGTH		(3)
43 #define WMI_RF_ETYPE_VAL_PER_RANGE	(5)
44 
45 /* Mailbox interface
46  * used for commands and events
47  */
48 enum wmi_mid {
49 	MID_DEFAULT		= 0x00,
50 	FIRST_DBG_MID_ID	= 0x10,
51 	LAST_DBG_MID_ID		= 0xFE,
52 	MID_BROADCAST		= 0xFF,
53 };
54 
55 /* FW capability IDs
56  * Each ID maps to a bit in a 32-bit bitmask value provided by the FW to
57  * the host
58  */
59 enum wmi_fw_capability {
60 	WMI_FW_CAPABILITY_FTM				= 0,
61 	WMI_FW_CAPABILITY_PS_CONFIG			= 1,
62 	WMI_FW_CAPABILITY_RF_SECTORS			= 2,
63 	WMI_FW_CAPABILITY_MGMT_RETRY_LIMIT		= 3,
64 	WMI_FW_CAPABILITY_DISABLE_AP_SME		= 4,
65 	WMI_FW_CAPABILITY_WMI_ONLY			= 5,
66 	WMI_FW_CAPABILITY_THERMAL_THROTTLING		= 7,
67 	WMI_FW_CAPABILITY_D3_SUSPEND			= 8,
68 	WMI_FW_CAPABILITY_LONG_RANGE			= 9,
69 	WMI_FW_CAPABILITY_FIXED_SCHEDULING		= 10,
70 	WMI_FW_CAPABILITY_MULTI_DIRECTED_OMNIS		= 11,
71 	WMI_FW_CAPABILITY_RSSI_REPORTING		= 12,
72 	WMI_FW_CAPABILITY_SET_SILENT_RSSI_TABLE		= 13,
73 	WMI_FW_CAPABILITY_LO_POWER_CALIB_FROM_OTP	= 14,
74 	WMI_FW_CAPABILITY_PNO				= 15,
75 	WMI_FW_CAPABILITY_MAX,
76 };
77 
78 /* WMI_CMD_HDR */
79 struct wmi_cmd_hdr {
80 	u8 mid;
81 	u8 reserved;
82 	__le16 command_id;
83 	__le32 fw_timestamp;
84 } __packed;
85 
86 /* List of Commands */
87 enum wmi_command_id {
88 	WMI_CONNECT_CMDID				= 0x01,
89 	WMI_DISCONNECT_CMDID				= 0x03,
90 	WMI_DISCONNECT_STA_CMDID			= 0x04,
91 	WMI_START_SCHED_SCAN_CMDID			= 0x05,
92 	WMI_STOP_SCHED_SCAN_CMDID			= 0x06,
93 	WMI_START_SCAN_CMDID				= 0x07,
94 	WMI_SET_BSS_FILTER_CMDID			= 0x09,
95 	WMI_SET_PROBED_SSID_CMDID			= 0x0A,
96 	/* deprecated */
97 	WMI_SET_LISTEN_INT_CMDID			= 0x0B,
98 	WMI_BCON_CTRL_CMDID				= 0x0F,
99 	WMI_ADD_CIPHER_KEY_CMDID			= 0x16,
100 	WMI_DELETE_CIPHER_KEY_CMDID			= 0x17,
101 	WMI_PCP_CONF_CMDID				= 0x18,
102 	WMI_SET_APPIE_CMDID				= 0x3F,
103 	WMI_SET_WSC_STATUS_CMDID			= 0x41,
104 	WMI_PXMT_RANGE_CFG_CMDID			= 0x42,
105 	WMI_PXMT_SNR2_RANGE_CFG_CMDID			= 0x43,
106 	WMI_MEM_READ_CMDID				= 0x800,
107 	WMI_MEM_WR_CMDID				= 0x801,
108 	WMI_ECHO_CMDID					= 0x803,
109 	WMI_DEEP_ECHO_CMDID				= 0x804,
110 	WMI_CONFIG_MAC_CMDID				= 0x805,
111 	/* deprecated */
112 	WMI_CONFIG_PHY_DEBUG_CMDID			= 0x806,
113 	WMI_ADD_DEBUG_TX_PCKT_CMDID			= 0x808,
114 	WMI_PHY_GET_STATISTICS_CMDID			= 0x809,
115 	/* deprecated */
116 	WMI_FS_TUNE_CMDID				= 0x80A,
117 	/* deprecated */
118 	WMI_CORR_MEASURE_CMDID				= 0x80B,
119 	WMI_READ_RSSI_CMDID				= 0x80C,
120 	WMI_TEMP_SENSE_CMDID				= 0x80E,
121 	WMI_DC_CALIB_CMDID				= 0x80F,
122 	/* deprecated */
123 	WMI_SEND_TONE_CMDID				= 0x810,
124 	/* deprecated */
125 	WMI_IQ_TX_CALIB_CMDID				= 0x811,
126 	/* deprecated */
127 	WMI_IQ_RX_CALIB_CMDID				= 0x812,
128 	WMI_SET_WORK_MODE_CMDID				= 0x815,
129 	WMI_LO_LEAKAGE_CALIB_CMDID			= 0x816,
130 	WMI_LO_POWER_CALIB_FROM_OTP_CMDID		= 0x817,
131 	WMI_SILENT_RSSI_CALIB_CMDID			= 0x81D,
132 	/* deprecated */
133 	WMI_RF_RX_TEST_CMDID				= 0x81E,
134 	WMI_CFG_RX_CHAIN_CMDID				= 0x820,
135 	WMI_VRING_CFG_CMDID				= 0x821,
136 	WMI_BCAST_VRING_CFG_CMDID			= 0x822,
137 	WMI_VRING_BA_EN_CMDID				= 0x823,
138 	WMI_VRING_BA_DIS_CMDID				= 0x824,
139 	WMI_RCP_ADDBA_RESP_CMDID			= 0x825,
140 	WMI_RCP_DELBA_CMDID				= 0x826,
141 	WMI_SET_SSID_CMDID				= 0x827,
142 	WMI_GET_SSID_CMDID				= 0x828,
143 	WMI_SET_PCP_CHANNEL_CMDID			= 0x829,
144 	WMI_GET_PCP_CHANNEL_CMDID			= 0x82A,
145 	WMI_SW_TX_REQ_CMDID				= 0x82B,
146 	WMI_MLME_PUSH_CMDID				= 0x835,
147 	WMI_BEAMFORMING_MGMT_CMDID			= 0x836,
148 	WMI_BF_TXSS_MGMT_CMDID				= 0x837,
149 	WMI_BF_SM_MGMT_CMDID				= 0x838,
150 	WMI_BF_RXSS_MGMT_CMDID				= 0x839,
151 	WMI_BF_TRIG_CMDID				= 0x83A,
152 	WMI_LINK_MAINTAIN_CFG_WRITE_CMDID		= 0x842,
153 	WMI_LINK_MAINTAIN_CFG_READ_CMDID		= 0x843,
154 	WMI_SET_SECTORS_CMDID				= 0x849,
155 	WMI_MAINTAIN_PAUSE_CMDID			= 0x850,
156 	WMI_MAINTAIN_RESUME_CMDID			= 0x851,
157 	WMI_RS_MGMT_CMDID				= 0x852,
158 	WMI_RF_MGMT_CMDID				= 0x853,
159 	WMI_RF_XPM_READ_CMDID				= 0x856,
160 	WMI_RF_XPM_WRITE_CMDID				= 0x857,
161 	WMI_LED_CFG_CMDID				= 0x858,
162 	WMI_SET_CONNECT_SNR_THR_CMDID			= 0x85B,
163 	WMI_SET_ACTIVE_SILENT_RSSI_TABLE_CMDID		= 0x85C,
164 	WMI_RF_PWR_ON_DELAY_CMDID			= 0x85D,
165 	WMI_SET_HIGH_POWER_TABLE_PARAMS_CMDID		= 0x85E,
166 	/* Performance monitoring commands */
167 	WMI_BF_CTRL_CMDID				= 0x862,
168 	WMI_NOTIFY_REQ_CMDID				= 0x863,
169 	WMI_GET_STATUS_CMDID				= 0x864,
170 	WMI_GET_RF_STATUS_CMDID				= 0x866,
171 	WMI_GET_BASEBAND_TYPE_CMDID			= 0x867,
172 	WMI_UNIT_TEST_CMDID				= 0x900,
173 	WMI_FLASH_READ_CMDID				= 0x902,
174 	WMI_FLASH_WRITE_CMDID				= 0x903,
175 	/* Power management */
176 	WMI_TRAFFIC_SUSPEND_CMDID			= 0x904,
177 	WMI_TRAFFIC_RESUME_CMDID			= 0x905,
178 	/* P2P */
179 	WMI_P2P_CFG_CMDID				= 0x910,
180 	WMI_PORT_ALLOCATE_CMDID				= 0x911,
181 	WMI_PORT_DELETE_CMDID				= 0x912,
182 	WMI_POWER_MGMT_CFG_CMDID			= 0x913,
183 	WMI_START_LISTEN_CMDID				= 0x914,
184 	WMI_START_SEARCH_CMDID				= 0x915,
185 	WMI_DISCOVERY_START_CMDID			= 0x916,
186 	WMI_DISCOVERY_STOP_CMDID			= 0x917,
187 	WMI_PCP_START_CMDID				= 0x918,
188 	WMI_PCP_STOP_CMDID				= 0x919,
189 	WMI_GET_PCP_FACTOR_CMDID			= 0x91B,
190 	/* Power Save Configuration Commands */
191 	WMI_PS_DEV_PROFILE_CFG_CMDID			= 0x91C,
192 	WMI_RS_CFG_CMDID				= 0x921,
193 	WMI_GET_DETAILED_RS_RES_CMDID			= 0x922,
194 	WMI_AOA_MEAS_CMDID				= 0x923,
195 	WMI_BRP_SET_ANT_LIMIT_CMDID			= 0x924,
196 	WMI_SET_MGMT_RETRY_LIMIT_CMDID			= 0x930,
197 	WMI_GET_MGMT_RETRY_LIMIT_CMDID			= 0x931,
198 	WMI_NEW_STA_CMDID				= 0x935,
199 	WMI_DEL_STA_CMDID				= 0x936,
200 	WMI_SET_THERMAL_THROTTLING_CFG_CMDID		= 0x940,
201 	WMI_GET_THERMAL_THROTTLING_CFG_CMDID		= 0x941,
202 	/* Read Power Save profile type */
203 	WMI_PS_DEV_PROFILE_CFG_READ_CMDID		= 0x942,
204 	WMI_TOF_SESSION_START_CMDID			= 0x991,
205 	WMI_TOF_GET_CAPABILITIES_CMDID			= 0x992,
206 	WMI_TOF_SET_LCR_CMDID				= 0x993,
207 	WMI_TOF_SET_LCI_CMDID				= 0x994,
208 	WMI_TOF_CFG_RESPONDER_CMDID			= 0x996,
209 	WMI_TOF_SET_TX_RX_OFFSET_CMDID			= 0x997,
210 	WMI_TOF_GET_TX_RX_OFFSET_CMDID			= 0x998,
211 	WMI_TOF_CHANNEL_INFO_CMDID			= 0x999,
212 	WMI_GET_RF_SECTOR_PARAMS_CMDID			= 0x9A0,
213 	WMI_SET_RF_SECTOR_PARAMS_CMDID			= 0x9A1,
214 	WMI_GET_SELECTED_RF_SECTOR_INDEX_CMDID		= 0x9A2,
215 	WMI_SET_SELECTED_RF_SECTOR_INDEX_CMDID		= 0x9A3,
216 	WMI_SET_RF_SECTOR_ON_CMDID			= 0x9A4,
217 	WMI_PRIO_TX_SECTORS_ORDER_CMDID			= 0x9A5,
218 	WMI_PRIO_TX_SECTORS_NUMBER_CMDID		= 0x9A6,
219 	WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_CMDID	= 0x9A7,
220 	WMI_SCHEDULING_SCHEME_CMDID			= 0xA01,
221 	WMI_FIXED_SCHEDULING_CONFIG_CMDID		= 0xA02,
222 	WMI_ENABLE_FIXED_SCHEDULING_CMDID		= 0xA03,
223 	WMI_SET_MULTI_DIRECTED_OMNIS_CONFIG_CMDID	= 0xA04,
224 	WMI_SET_LONG_RANGE_CONFIG_CMDID			= 0xA05,
225 	WMI_SET_MAC_ADDRESS_CMDID			= 0xF003,
226 	WMI_ABORT_SCAN_CMDID				= 0xF007,
227 	WMI_SET_PROMISCUOUS_MODE_CMDID			= 0xF041,
228 	/* deprecated */
229 	WMI_GET_PMK_CMDID				= 0xF048,
230 	WMI_SET_PASSPHRASE_CMDID			= 0xF049,
231 	/* deprecated */
232 	WMI_SEND_ASSOC_RES_CMDID			= 0xF04A,
233 	/* deprecated */
234 	WMI_SET_ASSOC_REQ_RELAY_CMDID			= 0xF04B,
235 	WMI_MAC_ADDR_REQ_CMDID				= 0xF04D,
236 	WMI_FW_VER_CMDID				= 0xF04E,
237 	WMI_PMC_CMDID					= 0xF04F,
238 };
239 
240 /* WMI_CONNECT_CMDID */
241 enum wmi_network_type {
242 	WMI_NETTYPE_INFRA		= 0x01,
243 	WMI_NETTYPE_ADHOC		= 0x02,
244 	WMI_NETTYPE_ADHOC_CREATOR	= 0x04,
245 	WMI_NETTYPE_AP			= 0x10,
246 	WMI_NETTYPE_P2P			= 0x20,
247 	/* PCIE over 60g */
248 	WMI_NETTYPE_WBE			= 0x40,
249 };
250 
251 enum wmi_dot11_auth_mode {
252 	WMI_AUTH11_OPEN		= 0x01,
253 	WMI_AUTH11_SHARED	= 0x02,
254 	WMI_AUTH11_LEAP		= 0x04,
255 	WMI_AUTH11_WSC		= 0x08,
256 };
257 
258 enum wmi_auth_mode {
259 	WMI_AUTH_NONE		= 0x01,
260 	WMI_AUTH_WPA		= 0x02,
261 	WMI_AUTH_WPA2		= 0x04,
262 	WMI_AUTH_WPA_PSK	= 0x08,
263 	WMI_AUTH_WPA2_PSK	= 0x10,
264 	WMI_AUTH_WPA_CCKM	= 0x20,
265 	WMI_AUTH_WPA2_CCKM	= 0x40,
266 };
267 
268 enum wmi_crypto_type {
269 	WMI_CRYPT_NONE		= 0x01,
270 	WMI_CRYPT_AES_GCMP	= 0x20,
271 };
272 
273 enum wmi_connect_ctrl_flag_bits {
274 	WMI_CONNECT_ASSOC_POLICY_USER		= 0x01,
275 	WMI_CONNECT_SEND_REASSOC		= 0x02,
276 	WMI_CONNECT_IGNORE_WPA_GROUP_CIPHER	= 0x04,
277 	WMI_CONNECT_PROFILE_MATCH_DONE		= 0x08,
278 	WMI_CONNECT_IGNORE_AAC_BEACON		= 0x10,
279 	WMI_CONNECT_CSA_FOLLOW_BSS		= 0x20,
280 	WMI_CONNECT_DO_WPA_OFFLOAD		= 0x40,
281 	WMI_CONNECT_DO_NOT_DEAUTH		= 0x80,
282 };
283 
284 #define WMI_MAX_SSID_LEN	(32)
285 
286 /* WMI_CONNECT_CMDID */
287 struct wmi_connect_cmd {
288 	u8 network_type;
289 	u8 dot11_auth_mode;
290 	u8 auth_mode;
291 	u8 pairwise_crypto_type;
292 	u8 pairwise_crypto_len;
293 	u8 group_crypto_type;
294 	u8 group_crypto_len;
295 	u8 ssid_len;
296 	u8 ssid[WMI_MAX_SSID_LEN];
297 	u8 channel;
298 	u8 reserved0;
299 	u8 bssid[WMI_MAC_LEN];
300 	__le32 ctrl_flags;
301 	u8 dst_mac[WMI_MAC_LEN];
302 	u8 reserved1[2];
303 } __packed;
304 
305 /* WMI_DISCONNECT_STA_CMDID */
306 struct wmi_disconnect_sta_cmd {
307 	u8 dst_mac[WMI_MAC_LEN];
308 	__le16 disconnect_reason;
309 } __packed;
310 
311 #define WMI_MAX_KEY_INDEX	(3)
312 #define WMI_MAX_KEY_LEN		(32)
313 #define WMI_PASSPHRASE_LEN	(64)
314 
315 /* WMI_SET_PASSPHRASE_CMDID */
316 struct wmi_set_passphrase_cmd {
317 	u8 ssid[WMI_MAX_SSID_LEN];
318 	u8 passphrase[WMI_PASSPHRASE_LEN];
319 	u8 ssid_len;
320 	u8 passphrase_len;
321 } __packed;
322 
323 /* WMI_ADD_CIPHER_KEY_CMDID */
324 enum wmi_key_usage {
325 	WMI_KEY_USE_PAIRWISE	= 0x00,
326 	WMI_KEY_USE_RX_GROUP	= 0x01,
327 	WMI_KEY_USE_TX_GROUP	= 0x02,
328 };
329 
330 struct wmi_add_cipher_key_cmd {
331 	u8 key_index;
332 	u8 key_type;
333 	/* enum wmi_key_usage */
334 	u8 key_usage;
335 	u8 key_len;
336 	/* key replay sequence counter */
337 	u8 key_rsc[8];
338 	u8 key[WMI_MAX_KEY_LEN];
339 	/* Additional Key Control information */
340 	u8 key_op_ctrl;
341 	u8 mac[WMI_MAC_LEN];
342 } __packed;
343 
344 /* WMI_DELETE_CIPHER_KEY_CMDID */
345 struct wmi_delete_cipher_key_cmd {
346 	u8 key_index;
347 	u8 mac[WMI_MAC_LEN];
348 } __packed;
349 
350 /* WMI_START_SCAN_CMDID
351  *
352  * Start L1 scan operation
353  *
354  * Returned events:
355  * - WMI_RX_MGMT_PACKET_EVENTID - for every probe resp.
356  * - WMI_SCAN_COMPLETE_EVENTID
357  */
358 enum wmi_scan_type {
359 	WMI_ACTIVE_SCAN		= 0x00,
360 	WMI_SHORT_SCAN		= 0x01,
361 	WMI_PASSIVE_SCAN	= 0x02,
362 	WMI_DIRECT_SCAN		= 0x03,
363 	WMI_LONG_SCAN		= 0x04,
364 };
365 
366 /* WMI_START_SCAN_CMDID */
367 struct wmi_start_scan_cmd {
368 	u8 direct_scan_mac_addr[WMI_MAC_LEN];
369 	/* run scan with discovery beacon. Relevant for ACTIVE scan only. */
370 	u8 discovery_mode;
371 	u8 reserved;
372 	/* Max duration in the home channel(ms) */
373 	__le32 dwell_time;
374 	/* Time interval between scans (ms) */
375 	__le32 force_scan_interval;
376 	/* enum wmi_scan_type */
377 	u8 scan_type;
378 	/* how many channels follow */
379 	u8 num_channels;
380 	/* channels ID's:
381 	 * 0 - 58320 MHz
382 	 * 1 - 60480 MHz
383 	 * 2 - 62640 MHz
384 	 */
385 	struct {
386 		u8 channel;
387 		u8 reserved;
388 	} channel_list[0];
389 } __packed;
390 
391 #define WMI_MAX_PNO_SSID_NUM	(16)
392 #define WMI_MAX_CHANNEL_NUM	(6)
393 #define WMI_MAX_PLANS_NUM	(2)
394 
395 /* WMI_START_SCHED_SCAN_CMDID */
396 struct wmi_sched_scan_ssid_match {
397 	u8 ssid_len;
398 	u8 ssid[WMI_MAX_SSID_LEN];
399 	s8 rssi_threshold;
400 	/* boolean */
401 	u8 add_ssid_to_probe;
402 	u8 reserved;
403 } __packed;
404 
405 /* WMI_START_SCHED_SCAN_CMDID */
406 struct wmi_sched_scan_plan {
407 	__le16 interval_sec;
408 	__le16 num_of_iterations;
409 } __packed;
410 
411 /* WMI_START_SCHED_SCAN_CMDID */
412 struct wmi_start_sched_scan_cmd {
413 	struct wmi_sched_scan_ssid_match ssid_for_match[WMI_MAX_PNO_SSID_NUM];
414 	u8 num_of_ssids;
415 	s8 min_rssi_threshold;
416 	u8 channel_list[WMI_MAX_CHANNEL_NUM];
417 	u8 num_of_channels;
418 	u8 reserved;
419 	__le16 initial_delay_sec;
420 	struct wmi_sched_scan_plan scan_plans[WMI_MAX_PLANS_NUM];
421 } __packed;
422 
423 /* WMI_SET_PROBED_SSID_CMDID */
424 #define MAX_PROBED_SSID_INDEX	(3)
425 
426 enum wmi_ssid_flag {
427 	/* disables entry */
428 	WMI_SSID_FLAG_DISABLE	= 0x00,
429 	/* probes specified ssid */
430 	WMI_SSID_FLAG_SPECIFIC	= 0x01,
431 	/* probes for any ssid */
432 	WMI_SSID_FLAG_ANY	= 0x02,
433 };
434 
435 struct wmi_probed_ssid_cmd {
436 	/* 0 to MAX_PROBED_SSID_INDEX */
437 	u8 entry_index;
438 	/* enum wmi_ssid_flag */
439 	u8 flag;
440 	u8 ssid_len;
441 	u8 ssid[WMI_MAX_SSID_LEN];
442 } __packed;
443 
444 /* WMI_SET_APPIE_CMDID
445  * Add Application specified IE to a management frame
446  */
447 #define WMI_MAX_IE_LEN	(1024)
448 
449 /* Frame Types */
450 enum wmi_mgmt_frame_type {
451 	WMI_FRAME_BEACON	= 0x00,
452 	WMI_FRAME_PROBE_REQ	= 0x01,
453 	WMI_FRAME_PROBE_RESP	= 0x02,
454 	WMI_FRAME_ASSOC_REQ	= 0x03,
455 	WMI_FRAME_ASSOC_RESP	= 0x04,
456 	WMI_NUM_MGMT_FRAME	= 0x05,
457 };
458 
459 struct wmi_set_appie_cmd {
460 	/* enum wmi_mgmt_frame_type */
461 	u8 mgmt_frm_type;
462 	u8 reserved;
463 	/* Length of the IE to be added to MGMT frame */
464 	__le16 ie_len;
465 	u8 ie_info[0];
466 } __packed;
467 
468 /* WMI_PXMT_RANGE_CFG_CMDID */
469 struct wmi_pxmt_range_cfg_cmd {
470 	u8 dst_mac[WMI_MAC_LEN];
471 	__le16 range;
472 } __packed;
473 
474 /* WMI_PXMT_SNR2_RANGE_CFG_CMDID */
475 struct wmi_pxmt_snr2_range_cfg_cmd {
476 	s8 snr2range_arr[2];
477 } __packed;
478 
479 /* WMI_RF_MGMT_CMDID */
480 enum wmi_rf_mgmt_type {
481 	WMI_RF_MGMT_W_DISABLE	= 0x00,
482 	WMI_RF_MGMT_W_ENABLE	= 0x01,
483 	WMI_RF_MGMT_GET_STATUS	= 0x02,
484 };
485 
486 /* WMI_RF_MGMT_CMDID */
487 struct wmi_rf_mgmt_cmd {
488 	__le32 rf_mgmt_type;
489 } __packed;
490 
491 /* WMI_CORR_MEASURE_CMDID */
492 struct wmi_corr_measure_cmd {
493 	__le32 freq_mhz;
494 	__le32 length_samples;
495 	__le32 iterations;
496 } __packed;
497 
498 /* WMI_SET_SSID_CMDID */
499 struct wmi_set_ssid_cmd {
500 	__le32 ssid_len;
501 	u8 ssid[WMI_MAX_SSID_LEN];
502 } __packed;
503 
504 /* WMI_SET_PCP_CHANNEL_CMDID */
505 struct wmi_set_pcp_channel_cmd {
506 	u8 channel;
507 	u8 reserved[3];
508 } __packed;
509 
510 /* WMI_BCON_CTRL_CMDID */
511 struct wmi_bcon_ctrl_cmd {
512 	__le16 bcon_interval;
513 	__le16 frag_num;
514 	__le64 ss_mask;
515 	u8 network_type;
516 	u8 pcp_max_assoc_sta;
517 	u8 disable_sec_offload;
518 	u8 disable_sec;
519 	u8 hidden_ssid;
520 	u8 is_go;
521 	u8 reserved[2];
522 } __packed;
523 
524 /* WMI_PORT_ALLOCATE_CMDID */
525 enum wmi_port_role {
526 	WMI_PORT_STA		= 0x00,
527 	WMI_PORT_PCP		= 0x01,
528 	WMI_PORT_AP		= 0x02,
529 	WMI_PORT_P2P_DEV	= 0x03,
530 	WMI_PORT_P2P_CLIENT	= 0x04,
531 	WMI_PORT_P2P_GO		= 0x05,
532 };
533 
534 /* WMI_PORT_ALLOCATE_CMDID */
535 struct wmi_port_allocate_cmd {
536 	u8 mac[WMI_MAC_LEN];
537 	u8 port_role;
538 	u8 mid;
539 } __packed;
540 
541 /* WMI_PORT_DELETE_CMDID */
542 struct wmi_port_delete_cmd {
543 	u8 mid;
544 	u8 reserved[3];
545 } __packed;
546 
547 /* WMI_TRAFFIC_SUSPEND_CMD wakeup trigger bit mask values */
548 enum wmi_wakeup_trigger {
549 	WMI_WAKEUP_TRIGGER_UCAST	= 0x01,
550 	WMI_WAKEUP_TRIGGER_BCAST	= 0x02,
551 };
552 
553 /* WMI_TRAFFIC_SUSPEND_CMDID */
554 struct wmi_traffic_suspend_cmd {
555 	/* Bit vector: bit[0] - wake on Unicast, bit[1] - wake on Broadcast */
556 	u8 wakeup_trigger;
557 } __packed;
558 
559 /* WMI_P2P_CFG_CMDID */
560 enum wmi_discovery_mode {
561 	WMI_DISCOVERY_MODE_NON_OFFLOAD	= 0x00,
562 	WMI_DISCOVERY_MODE_OFFLOAD	= 0x01,
563 	WMI_DISCOVERY_MODE_PEER2PEER	= 0x02,
564 };
565 
566 struct wmi_p2p_cfg_cmd {
567 	/* enum wmi_discovery_mode */
568 	u8 discovery_mode;
569 	u8 channel;
570 	/* base to listen/search duration calculation */
571 	__le16 bcon_interval;
572 } __packed;
573 
574 /* WMI_POWER_MGMT_CFG_CMDID */
575 enum wmi_power_source_type {
576 	WMI_POWER_SOURCE_BATTERY	= 0x00,
577 	WMI_POWER_SOURCE_OTHER		= 0x01,
578 };
579 
580 struct wmi_power_mgmt_cfg_cmd {
581 	/* enum wmi_power_source_type */
582 	u8 power_source;
583 	u8 reserved[3];
584 } __packed;
585 
586 /* WMI_PCP_START_CMDID */
587 struct wmi_pcp_start_cmd {
588 	__le16 bcon_interval;
589 	u8 pcp_max_assoc_sta;
590 	u8 hidden_ssid;
591 	u8 is_go;
592 	u8 reserved0[5];
593 	/* A-BFT length override if non-0 */
594 	u8 abft_len;
595 	u8 disable_ap_sme;
596 	u8 network_type;
597 	u8 channel;
598 	u8 disable_sec_offload;
599 	u8 disable_sec;
600 } __packed;
601 
602 /* WMI_SW_TX_REQ_CMDID */
603 struct wmi_sw_tx_req_cmd {
604 	u8 dst_mac[WMI_MAC_LEN];
605 	__le16 len;
606 	u8 payload[0];
607 } __packed;
608 
609 struct wmi_sw_ring_cfg {
610 	__le64 ring_mem_base;
611 	__le16 ring_size;
612 	__le16 max_mpdu_size;
613 } __packed;
614 
615 /* wmi_vring_cfg_schd */
616 struct wmi_vring_cfg_schd {
617 	__le16 priority;
618 	__le16 timeslot_us;
619 } __packed;
620 
621 enum wmi_vring_cfg_encap_trans_type {
622 	WMI_VRING_ENC_TYPE_802_3	= 0x00,
623 	WMI_VRING_ENC_TYPE_NATIVE_WIFI	= 0x01,
624 };
625 
626 enum wmi_vring_cfg_ds_cfg {
627 	WMI_VRING_DS_PBSS	= 0x00,
628 	WMI_VRING_DS_STATION	= 0x01,
629 	WMI_VRING_DS_AP		= 0x02,
630 	WMI_VRING_DS_ADDR4	= 0x03,
631 };
632 
633 enum wmi_vring_cfg_nwifi_ds_trans_type {
634 	WMI_NWIFI_TX_TRANS_MODE_NO		= 0x00,
635 	WMI_NWIFI_TX_TRANS_MODE_AP2PBSS		= 0x01,
636 	WMI_NWIFI_TX_TRANS_MODE_STA2PBSS	= 0x02,
637 };
638 
639 enum wmi_vring_cfg_schd_params_priority {
640 	WMI_SCH_PRIO_REGULAR	= 0x00,
641 	WMI_SCH_PRIO_HIGH	= 0x01,
642 };
643 
644 #define CIDXTID_CID_POS				(0)
645 #define CIDXTID_CID_LEN				(4)
646 #define CIDXTID_CID_MSK				(0xF)
647 #define CIDXTID_TID_POS				(4)
648 #define CIDXTID_TID_LEN				(4)
649 #define CIDXTID_TID_MSK				(0xF0)
650 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_POS	(0)
651 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_LEN	(1)
652 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_MSK	(0x1)
653 #define VRING_CFG_MAC_CTRL_AGGR_EN_POS		(1)
654 #define VRING_CFG_MAC_CTRL_AGGR_EN_LEN		(1)
655 #define VRING_CFG_MAC_CTRL_AGGR_EN_MSK		(0x2)
656 #define VRING_CFG_TO_RESOLUTION_VALUE_POS	(0)
657 #define VRING_CFG_TO_RESOLUTION_VALUE_LEN	(6)
658 #define VRING_CFG_TO_RESOLUTION_VALUE_MSK	(0x3F)
659 
660 struct wmi_vring_cfg {
661 	struct wmi_sw_ring_cfg tx_sw_ring;
662 	/* 0-23 vrings */
663 	u8 ringid;
664 	u8 cidxtid;
665 	u8 encap_trans_type;
666 	/* 802.3 DS cfg */
667 	u8 ds_cfg;
668 	u8 nwifi_ds_trans_type;
669 	u8 mac_ctrl;
670 	u8 to_resolution;
671 	u8 agg_max_wsize;
672 	struct wmi_vring_cfg_schd schd_params;
673 } __packed;
674 
675 enum wmi_vring_cfg_cmd_action {
676 	WMI_VRING_CMD_ADD	= 0x00,
677 	WMI_VRING_CMD_MODIFY	= 0x01,
678 	WMI_VRING_CMD_DELETE	= 0x02,
679 };
680 
681 /* WMI_VRING_CFG_CMDID */
682 struct wmi_vring_cfg_cmd {
683 	__le32 action;
684 	struct wmi_vring_cfg vring_cfg;
685 } __packed;
686 
687 struct wmi_bcast_vring_cfg {
688 	struct wmi_sw_ring_cfg tx_sw_ring;
689 	/* 0-23 vrings */
690 	u8 ringid;
691 	u8 encap_trans_type;
692 	/* 802.3 DS cfg */
693 	u8 ds_cfg;
694 	u8 nwifi_ds_trans_type;
695 } __packed;
696 
697 /* WMI_BCAST_VRING_CFG_CMDID */
698 struct wmi_bcast_vring_cfg_cmd {
699 	__le32 action;
700 	struct wmi_bcast_vring_cfg vring_cfg;
701 } __packed;
702 
703 /* WMI_LO_POWER_CALIB_FROM_OTP_CMDID */
704 struct wmi_lo_power_calib_from_otp_cmd {
705 	/* index to read from OTP. zero based */
706 	u8 index;
707 	u8 reserved[3];
708 } __packed;
709 
710 /* WMI_LO_POWER_CALIB_FROM_OTP_EVENTID */
711 struct wmi_lo_power_calib_from_otp_event {
712 	/* wmi_fw_status */
713 	u8 status;
714 	u8 reserved[3];
715 } __packed;
716 
717 /* WMI_VRING_BA_EN_CMDID */
718 struct wmi_vring_ba_en_cmd {
719 	u8 ringid;
720 	u8 agg_max_wsize;
721 	__le16 ba_timeout;
722 	u8 amsdu;
723 	u8 reserved[3];
724 } __packed;
725 
726 /* WMI_VRING_BA_DIS_CMDID */
727 struct wmi_vring_ba_dis_cmd {
728 	u8 ringid;
729 	u8 reserved;
730 	__le16 reason;
731 } __packed;
732 
733 /* WMI_NOTIFY_REQ_CMDID */
734 struct wmi_notify_req_cmd {
735 	u8 cid;
736 	u8 year;
737 	u8 month;
738 	u8 day;
739 	__le32 interval_usec;
740 	u8 hour;
741 	u8 minute;
742 	u8 second;
743 	u8 miliseconds;
744 } __packed;
745 
746 /* WMI_CFG_RX_CHAIN_CMDID */
747 enum wmi_sniffer_cfg_mode {
748 	WMI_SNIFFER_OFF	= 0x00,
749 	WMI_SNIFFER_ON	= 0x01,
750 };
751 
752 /* WMI_SILENT_RSSI_TABLE */
753 enum wmi_silent_rssi_table {
754 	RF_TEMPERATURE_CALIB_DEFAULT_DB		= 0x00,
755 	RF_TEMPERATURE_CALIB_HIGH_POWER_DB	= 0x01,
756 };
757 
758 /* WMI_SILENT_RSSI_STATUS */
759 enum wmi_silent_rssi_status {
760 	SILENT_RSSI_SUCCESS	= 0x00,
761 	SILENT_RSSI_FAILURE	= 0x01,
762 };
763 
764 /* WMI_SET_ACTIVE_SILENT_RSSI_TABLE_CMDID */
765 struct wmi_set_active_silent_rssi_table_cmd {
766 	/* enum wmi_silent_rssi_table */
767 	__le32 table;
768 } __packed;
769 
770 enum wmi_sniffer_cfg_phy_info_mode {
771 	WMI_SNIFFER_PHY_INFO_DISABLED	= 0x00,
772 	WMI_SNIFFER_PHY_INFO_ENABLED	= 0x01,
773 };
774 
775 enum wmi_sniffer_cfg_phy_support {
776 	WMI_SNIFFER_CP		= 0x00,
777 	WMI_SNIFFER_DP		= 0x01,
778 	WMI_SNIFFER_BOTH_PHYS	= 0x02,
779 };
780 
781 /* wmi_sniffer_cfg */
782 struct wmi_sniffer_cfg {
783 	/* enum wmi_sniffer_cfg_mode */
784 	__le32 mode;
785 	/* enum wmi_sniffer_cfg_phy_info_mode */
786 	__le32 phy_info_mode;
787 	/* enum wmi_sniffer_cfg_phy_support */
788 	__le32 phy_support;
789 	u8 channel;
790 	u8 reserved[3];
791 } __packed;
792 
793 enum wmi_cfg_rx_chain_cmd_action {
794 	WMI_RX_CHAIN_ADD	= 0x00,
795 	WMI_RX_CHAIN_DEL	= 0x01,
796 };
797 
798 enum wmi_cfg_rx_chain_cmd_decap_trans_type {
799 	WMI_DECAP_TYPE_802_3		= 0x00,
800 	WMI_DECAP_TYPE_NATIVE_WIFI	= 0x01,
801 	WMI_DECAP_TYPE_NONE		= 0x02,
802 };
803 
804 enum wmi_cfg_rx_chain_cmd_nwifi_ds_trans_type {
805 	WMI_NWIFI_RX_TRANS_MODE_NO		= 0x00,
806 	WMI_NWIFI_RX_TRANS_MODE_PBSS2AP		= 0x01,
807 	WMI_NWIFI_RX_TRANS_MODE_PBSS2STA	= 0x02,
808 };
809 
810 enum wmi_cfg_rx_chain_cmd_reorder_type {
811 	WMI_RX_HW_REORDER	= 0x00,
812 	WMI_RX_SW_REORDER	= 0x01,
813 };
814 
815 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_POS	(0)
816 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_LEN	(1)
817 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_MSK	(0x1)
818 #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_POS		(1)
819 #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_LEN		(1)
820 #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_MSK		(0x2)
821 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_POS		(0)
822 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_LEN		(1)
823 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_MSK		(0x1)
824 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_POS		(1)
825 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_LEN		(1)
826 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_MSK		(0x2)
827 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_POS			(0)
828 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_LEN			(1)
829 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_MSK			(0x1)
830 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_POS		(1)
831 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_LEN		(1)
832 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_MSK		(0x2)
833 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_POS		(0)
834 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_LEN		(1)
835 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_MSK		(0x1)
836 #define RING_CTRL_OVERRIDE_WB_THRSH_POS			(1)
837 #define RING_CTRL_OVERRIDE_WB_THRSH_LEN			(1)
838 #define RING_CTRL_OVERRIDE_WB_THRSH_MSK			(0x2)
839 #define RING_CTRL_OVERRIDE_ITR_THRSH_POS		(2)
840 #define RING_CTRL_OVERRIDE_ITR_THRSH_LEN		(1)
841 #define RING_CTRL_OVERRIDE_ITR_THRSH_MSK		(0x4)
842 #define RING_CTRL_OVERRIDE_HOST_THRSH_POS		(3)
843 #define RING_CTRL_OVERRIDE_HOST_THRSH_LEN		(1)
844 #define RING_CTRL_OVERRIDE_HOST_THRSH_MSK		(0x8)
845 
846 /* WMI_CFG_RX_CHAIN_CMDID */
847 struct wmi_cfg_rx_chain_cmd {
848 	__le32 action;
849 	struct wmi_sw_ring_cfg rx_sw_ring;
850 	u8 mid;
851 	u8 decap_trans_type;
852 	u8 l2_802_3_offload_ctrl;
853 	u8 l2_nwifi_offload_ctrl;
854 	u8 vlan_id;
855 	u8 nwifi_ds_trans_type;
856 	u8 l3_l4_ctrl;
857 	u8 ring_ctrl;
858 	__le16 prefetch_thrsh;
859 	__le16 wb_thrsh;
860 	__le32 itr_value;
861 	__le16 host_thrsh;
862 	u8 reorder_type;
863 	u8 reserved;
864 	struct wmi_sniffer_cfg sniffer_cfg;
865 	__le16 max_rx_pl_per_desc;
866 } __packed;
867 
868 /* WMI_RCP_ADDBA_RESP_CMDID */
869 struct wmi_rcp_addba_resp_cmd {
870 	u8 cidxtid;
871 	u8 dialog_token;
872 	__le16 status_code;
873 	/* ieee80211_ba_parameterset field to send */
874 	__le16 ba_param_set;
875 	__le16 ba_timeout;
876 } __packed;
877 
878 /* WMI_RCP_DELBA_CMDID */
879 struct wmi_rcp_delba_cmd {
880 	u8 cidxtid;
881 	u8 reserved;
882 	__le16 reason;
883 } __packed;
884 
885 /* WMI_RCP_ADDBA_REQ_CMDID */
886 struct wmi_rcp_addba_req_cmd {
887 	u8 cidxtid;
888 	u8 dialog_token;
889 	/* ieee80211_ba_parameterset field as it received */
890 	__le16 ba_param_set;
891 	__le16 ba_timeout;
892 	/* ieee80211_ba_seqstrl field as it received */
893 	__le16 ba_seq_ctrl;
894 } __packed;
895 
896 /* WMI_SET_MAC_ADDRESS_CMDID */
897 struct wmi_set_mac_address_cmd {
898 	u8 mac[WMI_MAC_LEN];
899 	u8 reserved[2];
900 } __packed;
901 
902 /* WMI_ECHO_CMDID
903  * Check FW is alive
904  * WMI_DEEP_ECHO_CMDID
905  * Check FW and ucode are alive
906  * Returned event: WMI_ECHO_RSP_EVENTID
907  * same event for both commands
908  */
909 struct wmi_echo_cmd {
910 	__le32 value;
911 } __packed;
912 
913 /* WMI_RF_PWR_ON_DELAY_CMDID
914  * set FW time parameters used through RF resetting
915  *  RF reset consists of bringing its power down for a period of time, then
916  * bringing the power up
917  * Returned event: WMI_RF_PWR_ON_DELAY_RSP_EVENTID
918  */
919 struct wmi_rf_pwr_on_delay_cmd {
920 	/* time in usec the FW waits after bringing the RF PWR down,
921 	 * set 0 for default
922 	 */
923 	__le16 down_delay_usec;
924 	/* time in usec the FW waits after bringing the RF PWR up,
925 	 * set 0 for default
926 	 */
927 	__le16 up_delay_usec;
928 } __packed;
929 
930 /* \WMI_SET_HIGH_POWER_TABLE_PARAMS_CMDID
931  * This API controls the Tx and Rx gain over temperature.
932  * It controls the Tx D-type, Rx D-type and Rx E-type amplifiers.
933  * It also controls the Tx gain index, by controlling the Rx to Tx gain index
934  * offset.
935  * The control is divided by 3 temperature values to 4 temperature ranges.
936  * Each parameter uses its own temperature values.
937  * Returned event: WMI_SET_HIGH_POWER_TABLE_PARAMS_EVENTID
938  */
939 struct wmi_set_high_power_table_params_cmd {
940 	/* Temperature range for Tx D-type parameters */
941 	u8 tx_dtype_temp[WMI_RF_DTYPE_LENGTH];
942 	u8 reserved0;
943 	/* Tx D-type values to be used for each temperature range */
944 	__le32 tx_dtype_conf[WMI_RF_DTYPE_LENGTH + 1];
945 	/* Temperature range for Rx D-type parameters */
946 	u8 rx_dtype_temp[WMI_RF_DTYPE_LENGTH];
947 	u8 reserved1;
948 	/* Rx D-type values to be used for each temperature range */
949 	__le32 rx_dtype_conf[WMI_RF_DTYPE_LENGTH + 1];
950 	/* Temperature range for Rx E-type parameters */
951 	u8 rx_etype_temp[WMI_RF_ETYPE_LENGTH];
952 	u8 reserved2;
953 	/* Rx E-type values to be used for each temperature range.
954 	 * The last 4 values of any range are the first 4 values of the next
955 	 * range and so on
956 	 */
957 	__le32 rx_etype_conf[WMI_RF_ETYPE_VAL_PER_RANGE + WMI_RF_ETYPE_LENGTH];
958 	/* Temperature range for rx_2_tx_offs parameters */
959 	u8 rx_2_tx_temp[WMI_RF_RX2TX_LENGTH];
960 	u8 reserved3;
961 	/* Rx to Tx gain index offset */
962 	s8 rx_2_tx_offs[WMI_RF_RX2TX_LENGTH + 1];
963 } __packed;
964 
965 /* CMD: WMI_RF_XPM_READ_CMDID */
966 struct wmi_rf_xpm_read_cmd {
967 	u8 rf_id;
968 	u8 reserved[3];
969 	/* XPM bit start address in range [0,8191]bits - rounded by FW to
970 	 * multiple of 8bits
971 	 */
972 	__le32 xpm_bit_address;
973 	__le32 num_bytes;
974 } __packed;
975 
976 /* CMD: WMI_RF_XPM_WRITE_CMDID */
977 struct wmi_rf_xpm_write_cmd {
978 	u8 rf_id;
979 	u8 reserved0[3];
980 	/* XPM bit start address in range [0,8191]bits - rounded by FW to
981 	 * multiple of 8bits
982 	 */
983 	__le32 xpm_bit_address;
984 	__le32 num_bytes;
985 	/* boolean flag indicating whether FW should verify the write
986 	 * operation
987 	 */
988 	u8 verify;
989 	u8 reserved1[3];
990 	/* actual size=num_bytes */
991 	u8 data_bytes[0];
992 } __packed;
993 
994 /* WMI_TEMP_SENSE_CMDID
995  *
996  * Measure MAC and radio temperatures
997  *
998  * Possible modes for temperature measurement
999  */
1000 enum wmi_temperature_measure_mode {
1001 	TEMPERATURE_USE_OLD_VALUE	= 0x01,
1002 	TEMPERATURE_MEASURE_NOW		= 0x02,
1003 };
1004 
1005 /* WMI_TEMP_SENSE_CMDID */
1006 struct wmi_temp_sense_cmd {
1007 	__le32 measure_baseband_en;
1008 	__le32 measure_rf_en;
1009 	__le32 measure_mode;
1010 } __packed;
1011 
1012 enum wmi_pmc_op {
1013 	WMI_PMC_ALLOCATE	= 0x00,
1014 	WMI_PMC_RELEASE		= 0x01,
1015 };
1016 
1017 /* WMI_PMC_CMDID */
1018 struct wmi_pmc_cmd {
1019 	/* enum wmi_pmc_cmd_op_type */
1020 	u8 op;
1021 	u8 reserved;
1022 	__le16 ring_size;
1023 	__le64 mem_base;
1024 } __packed;
1025 
1026 enum wmi_aoa_meas_type {
1027 	WMI_AOA_PHASE_MEAS	= 0x00,
1028 	WMI_AOA_PHASE_AMP_MEAS	= 0x01,
1029 };
1030 
1031 /* WMI_AOA_MEAS_CMDID */
1032 struct wmi_aoa_meas_cmd {
1033 	u8 mac_addr[WMI_MAC_LEN];
1034 	/* channels IDs:
1035 	 * 0 - 58320 MHz
1036 	 * 1 - 60480 MHz
1037 	 * 2 - 62640 MHz
1038 	 */
1039 	u8 channel;
1040 	/* enum wmi_aoa_meas_type */
1041 	u8 aoa_meas_type;
1042 	__le32 meas_rf_mask;
1043 } __packed;
1044 
1045 /* WMI_SET_MGMT_RETRY_LIMIT_CMDID */
1046 struct wmi_set_mgmt_retry_limit_cmd {
1047 	/* MAC retransmit limit for mgmt frames */
1048 	u8 mgmt_retry_limit;
1049 	/* alignment to 32b */
1050 	u8 reserved[3];
1051 } __packed;
1052 
1053 /* Zones: HIGH, MAX, CRITICAL */
1054 #define WMI_NUM_OF_TT_ZONES	(3)
1055 
1056 struct wmi_tt_zone_limits {
1057 	/* Above this temperature this zone is active */
1058 	u8 temperature_high;
1059 	/* Below this temperature the adjacent lower zone is active */
1060 	u8 temperature_low;
1061 	u8 reserved[2];
1062 } __packed;
1063 
1064 /* Struct used for both configuration and status commands of thermal
1065  * throttling
1066  */
1067 struct wmi_tt_data {
1068 	/* Enable/Disable TT algorithm for baseband */
1069 	u8 bb_enabled;
1070 	u8 reserved0[3];
1071 	/* Define zones for baseband */
1072 	struct wmi_tt_zone_limits bb_zones[WMI_NUM_OF_TT_ZONES];
1073 	/* Enable/Disable TT algorithm for radio */
1074 	u8 rf_enabled;
1075 	u8 reserved1[3];
1076 	/* Define zones for all radio chips */
1077 	struct wmi_tt_zone_limits rf_zones[WMI_NUM_OF_TT_ZONES];
1078 } __packed;
1079 
1080 /* WMI_SET_THERMAL_THROTTLING_CFG_CMDID */
1081 struct wmi_set_thermal_throttling_cfg_cmd {
1082 	/* Command data */
1083 	struct wmi_tt_data tt_data;
1084 } __packed;
1085 
1086 /* WMI_NEW_STA_CMDID */
1087 struct wmi_new_sta_cmd {
1088 	u8 dst_mac[WMI_MAC_LEN];
1089 	u8 aid;
1090 } __packed;
1091 
1092 /* WMI_DEL_STA_CMDID */
1093 struct wmi_del_sta_cmd {
1094 	u8 dst_mac[WMI_MAC_LEN];
1095 	__le16 disconnect_reason;
1096 } __packed;
1097 
1098 enum wmi_tof_burst_duration {
1099 	WMI_TOF_BURST_DURATION_250_USEC		= 2,
1100 	WMI_TOF_BURST_DURATION_500_USEC		= 3,
1101 	WMI_TOF_BURST_DURATION_1_MSEC		= 4,
1102 	WMI_TOF_BURST_DURATION_2_MSEC		= 5,
1103 	WMI_TOF_BURST_DURATION_4_MSEC		= 6,
1104 	WMI_TOF_BURST_DURATION_8_MSEC		= 7,
1105 	WMI_TOF_BURST_DURATION_16_MSEC		= 8,
1106 	WMI_TOF_BURST_DURATION_32_MSEC		= 9,
1107 	WMI_TOF_BURST_DURATION_64_MSEC		= 10,
1108 	WMI_TOF_BURST_DURATION_128_MSEC		= 11,
1109 	WMI_TOF_BURST_DURATION_NO_PREFERENCES	= 15,
1110 };
1111 
1112 enum wmi_tof_session_start_flags {
1113 	WMI_TOF_SESSION_START_FLAG_SECURED	= 0x1,
1114 	WMI_TOF_SESSION_START_FLAG_ASAP		= 0x2,
1115 	WMI_TOF_SESSION_START_FLAG_LCI_REQ	= 0x4,
1116 	WMI_TOF_SESSION_START_FLAG_LCR_REQ	= 0x8,
1117 };
1118 
1119 /* WMI_TOF_SESSION_START_CMDID */
1120 struct wmi_ftm_dest_info {
1121 	u8 channel;
1122 	/* wmi_tof_session_start_flags_e */
1123 	u8 flags;
1124 	u8 initial_token;
1125 	u8 num_of_ftm_per_burst;
1126 	u8 num_of_bursts_exp;
1127 	/* wmi_tof_burst_duration_e */
1128 	u8 burst_duration;
1129 	/* Burst Period indicate interval between two consecutive burst
1130 	 * instances, in units of 100 ms
1131 	 */
1132 	__le16 burst_period;
1133 	u8 dst_mac[WMI_MAC_LEN];
1134 	u8 reserved;
1135 	u8 num_burst_per_aoa_meas;
1136 } __packed;
1137 
1138 /* WMI_TOF_SESSION_START_CMDID */
1139 struct wmi_tof_session_start_cmd {
1140 	__le32 session_id;
1141 	u8 reserved1;
1142 	u8 aoa_type;
1143 	__le16 num_of_dest;
1144 	u8 reserved[4];
1145 	struct wmi_ftm_dest_info ftm_dest_info[0];
1146 } __packed;
1147 
1148 /* WMI_TOF_CFG_RESPONDER_CMDID */
1149 struct wmi_tof_cfg_responder_cmd {
1150 	u8 enable;
1151 	u8 reserved[3];
1152 } __packed;
1153 
1154 enum wmi_tof_channel_info_report_type {
1155 	WMI_TOF_CHANNEL_INFO_TYPE_CIR			= 0x1,
1156 	WMI_TOF_CHANNEL_INFO_TYPE_RSSI			= 0x2,
1157 	WMI_TOF_CHANNEL_INFO_TYPE_SNR			= 0x4,
1158 	WMI_TOF_CHANNEL_INFO_TYPE_DEBUG_DATA		= 0x8,
1159 	WMI_TOF_CHANNEL_INFO_TYPE_VENDOR_SPECIFIC	= 0x10,
1160 };
1161 
1162 /* WMI_TOF_CHANNEL_INFO_CMDID */
1163 struct wmi_tof_channel_info_cmd {
1164 	/* wmi_tof_channel_info_report_type_e */
1165 	__le32 channel_info_report_request;
1166 } __packed;
1167 
1168 /* WMI_TOF_SET_TX_RX_OFFSET_CMDID */
1169 struct wmi_tof_set_tx_rx_offset_cmd {
1170 	/* TX delay offset */
1171 	__le32 tx_offset;
1172 	/* RX delay offset */
1173 	__le32 rx_offset;
1174 	/* Mask to define which RFs to configure. 0 means all RFs */
1175 	__le32 rf_mask;
1176 	/* Offset to strongest tap of CIR */
1177 	__le32 precursor;
1178 } __packed;
1179 
1180 /* WMI_TOF_GET_TX_RX_OFFSET_CMDID */
1181 struct wmi_tof_get_tx_rx_offset_cmd {
1182 	/* rf index to read offsets from */
1183 	u8 rf_index;
1184 	u8 reserved[3];
1185 } __packed;
1186 
1187 /* WMI_FIXED_SCHEDULING_CONFIG_CMDID */
1188 struct wmi_map_mcs_to_schd_params {
1189 	u8 mcs;
1190 	/* time in usec from start slot to start tx flow - default 15 */
1191 	u8 time_in_usec_before_initiate_tx;
1192 	/* RD enable - if yes consider RD according to STA mcs */
1193 	u8 rd_enabled;
1194 	u8 reserved;
1195 	/* time in usec from start slot to stop vring */
1196 	__le16 time_in_usec_to_stop_vring;
1197 	/* timeout to force flush from start of slot */
1198 	__le16 flush_to_in_usec;
1199 	/* per mcs the mac buffer limit size in bytes */
1200 	__le32 mac_buff_size_in_bytes;
1201 } __packed;
1202 
1203 /* WMI_FIXED_SCHEDULING_CONFIG_COMPLETE_EVENTID */
1204 struct wmi_fixed_scheduling_config_complete_event {
1205 	/* wmi_fw_status */
1206 	u8 status;
1207 	u8 reserved[3];
1208 } __packed;
1209 
1210 #define WMI_NUM_MCS	(13)
1211 
1212 /* WMI_FIXED_SCHEDULING_CONFIG_CMDID */
1213 struct wmi_fixed_scheduling_config_cmd {
1214 	/* defaults in the SAS table */
1215 	struct wmi_map_mcs_to_schd_params mcs_to_schd_params_map[WMI_NUM_MCS];
1216 	/* default 150 uSec */
1217 	__le16 max_sta_rd_ppdu_duration_in_usec;
1218 	/* default 300 uSec */
1219 	__le16 max_sta_grant_ppdu_duration_in_usec;
1220 	/* default 1000 uSec */
1221 	__le16 assoc_slot_duration_in_usec;
1222 	/* default 360 uSec */
1223 	__le16 virtual_slot_duration_in_usec;
1224 	/* each this field value slots start with grant frame to the station
1225 	 * - default 2
1226 	 */
1227 	u8 number_of_ap_slots_for_initiate_grant;
1228 	u8 reserved[3];
1229 } __packed;
1230 
1231 /* WMI_ENABLE_FIXED_SCHEDULING_CMDID */
1232 struct wmi_enable_fixed_scheduling_cmd {
1233 	__le32 reserved;
1234 } __packed;
1235 
1236 /* WMI_ENABLE_FIXED_SCHEDULING_COMPLETE_EVENTID */
1237 struct wmi_enable_fixed_scheduling_complete_event {
1238 	/* wmi_fw_status */
1239 	u8 status;
1240 	u8 reserved[3];
1241 } __packed;
1242 
1243 /* WMI_SET_MULTI_DIRECTED_OMNIS_CONFIG_CMDID */
1244 struct wmi_set_multi_directed_omnis_config_cmd {
1245 	/* number of directed omnis at destination AP */
1246 	u8 dest_ap_num_directed_omnis;
1247 	u8 reserved[3];
1248 } __packed;
1249 
1250 /* WMI_SET_MULTI_DIRECTED_OMNIS_CONFIG_EVENTID */
1251 struct wmi_set_multi_directed_omnis_config_event {
1252 	/* wmi_fw_status */
1253 	u8 status;
1254 	u8 reserved[3];
1255 } __packed;
1256 
1257 /* WMI_SET_LONG_RANGE_CONFIG_CMDID */
1258 struct wmi_set_long_range_config_cmd {
1259 	__le32 reserved;
1260 } __packed;
1261 
1262 /* WMI_SET_LONG_RANGE_CONFIG_COMPLETE_EVENTID */
1263 struct wmi_set_long_range_config_complete_event {
1264 	/* wmi_fw_status */
1265 	u8 status;
1266 	u8 reserved[3];
1267 } __packed;
1268 
1269 /* WMI Events
1270  * List of Events (target to host)
1271  */
1272 enum wmi_event_id {
1273 	WMI_READY_EVENTID				= 0x1001,
1274 	WMI_CONNECT_EVENTID				= 0x1002,
1275 	WMI_DISCONNECT_EVENTID				= 0x1003,
1276 	WMI_START_SCHED_SCAN_EVENTID			= 0x1005,
1277 	WMI_STOP_SCHED_SCAN_EVENTID			= 0x1006,
1278 	WMI_SCHED_SCAN_RESULT_EVENTID			= 0x1007,
1279 	WMI_SCAN_COMPLETE_EVENTID			= 0x100A,
1280 	WMI_REPORT_STATISTICS_EVENTID			= 0x100B,
1281 	WMI_RD_MEM_RSP_EVENTID				= 0x1800,
1282 	WMI_FW_READY_EVENTID				= 0x1801,
1283 	WMI_EXIT_FAST_MEM_ACC_MODE_EVENTID		= 0x200,
1284 	WMI_ECHO_RSP_EVENTID				= 0x1803,
1285 	/* deprecated */
1286 	WMI_FS_TUNE_DONE_EVENTID			= 0x180A,
1287 	/* deprecated */
1288 	WMI_CORR_MEASURE_EVENTID			= 0x180B,
1289 	WMI_READ_RSSI_EVENTID				= 0x180C,
1290 	WMI_TEMP_SENSE_DONE_EVENTID			= 0x180E,
1291 	WMI_DC_CALIB_DONE_EVENTID			= 0x180F,
1292 	/* deprecated */
1293 	WMI_IQ_TX_CALIB_DONE_EVENTID			= 0x1811,
1294 	/* deprecated */
1295 	WMI_IQ_RX_CALIB_DONE_EVENTID			= 0x1812,
1296 	WMI_SET_WORK_MODE_DONE_EVENTID			= 0x1815,
1297 	WMI_LO_LEAKAGE_CALIB_DONE_EVENTID		= 0x1816,
1298 	WMI_LO_POWER_CALIB_FROM_OTP_EVENTID		= 0x1817,
1299 	WMI_SILENT_RSSI_CALIB_DONE_EVENTID		= 0x181D,
1300 	/* deprecated */
1301 	WMI_RF_RX_TEST_DONE_EVENTID			= 0x181E,
1302 	WMI_CFG_RX_CHAIN_DONE_EVENTID			= 0x1820,
1303 	WMI_VRING_CFG_DONE_EVENTID			= 0x1821,
1304 	WMI_BA_STATUS_EVENTID				= 0x1823,
1305 	WMI_RCP_ADDBA_REQ_EVENTID			= 0x1824,
1306 	WMI_RCP_ADDBA_RESP_SENT_EVENTID			= 0x1825,
1307 	WMI_DELBA_EVENTID				= 0x1826,
1308 	WMI_GET_SSID_EVENTID				= 0x1828,
1309 	WMI_GET_PCP_CHANNEL_EVENTID			= 0x182A,
1310 	WMI_SW_TX_COMPLETE_EVENTID			= 0x182B,
1311 	WMI_BEAMFORMING_MGMT_DONE_EVENTID		= 0x1836,
1312 	WMI_BF_TXSS_MGMT_DONE_EVENTID			= 0x1837,
1313 	WMI_BF_RXSS_MGMT_DONE_EVENTID			= 0x1839,
1314 	WMI_RS_MGMT_DONE_EVENTID			= 0x1852,
1315 	WMI_RF_MGMT_STATUS_EVENTID			= 0x1853,
1316 	WMI_BF_SM_MGMT_DONE_EVENTID			= 0x1838,
1317 	WMI_RX_MGMT_PACKET_EVENTID			= 0x1840,
1318 	WMI_TX_MGMT_PACKET_EVENTID			= 0x1841,
1319 	WMI_LINK_MAINTAIN_CFG_WRITE_DONE_EVENTID	= 0x1842,
1320 	WMI_LINK_MAINTAIN_CFG_READ_DONE_EVENTID		= 0x1843,
1321 	WMI_RF_XPM_READ_RESULT_EVENTID			= 0x1856,
1322 	WMI_RF_XPM_WRITE_RESULT_EVENTID			= 0x1857,
1323 	WMI_LED_CFG_DONE_EVENTID			= 0x1858,
1324 	WMI_SET_SILENT_RSSI_TABLE_DONE_EVENTID		= 0x185C,
1325 	WMI_RF_PWR_ON_DELAY_RSP_EVENTID			= 0x185D,
1326 	WMI_SET_HIGH_POWER_TABLE_PARAMS_EVENTID		= 0x185E,
1327 	/* Performance monitoring events */
1328 	WMI_DATA_PORT_OPEN_EVENTID			= 0x1860,
1329 	WMI_WBE_LINK_DOWN_EVENTID			= 0x1861,
1330 	WMI_BF_CTRL_DONE_EVENTID			= 0x1862,
1331 	WMI_NOTIFY_REQ_DONE_EVENTID			= 0x1863,
1332 	WMI_GET_STATUS_DONE_EVENTID			= 0x1864,
1333 	WMI_VRING_EN_EVENTID				= 0x1865,
1334 	WMI_GET_RF_STATUS_EVENTID			= 0x1866,
1335 	WMI_GET_BASEBAND_TYPE_EVENTID			= 0x1867,
1336 	WMI_UNIT_TEST_EVENTID				= 0x1900,
1337 	WMI_FLASH_READ_DONE_EVENTID			= 0x1902,
1338 	WMI_FLASH_WRITE_DONE_EVENTID			= 0x1903,
1339 	/* Power management */
1340 	WMI_TRAFFIC_SUSPEND_EVENTID			= 0x1904,
1341 	WMI_TRAFFIC_RESUME_EVENTID			= 0x1905,
1342 	/* P2P */
1343 	WMI_P2P_CFG_DONE_EVENTID			= 0x1910,
1344 	WMI_PORT_ALLOCATED_EVENTID			= 0x1911,
1345 	WMI_PORT_DELETED_EVENTID			= 0x1912,
1346 	WMI_LISTEN_STARTED_EVENTID			= 0x1914,
1347 	WMI_SEARCH_STARTED_EVENTID			= 0x1915,
1348 	WMI_DISCOVERY_STARTED_EVENTID			= 0x1916,
1349 	WMI_DISCOVERY_STOPPED_EVENTID			= 0x1917,
1350 	WMI_PCP_STARTED_EVENTID				= 0x1918,
1351 	WMI_PCP_STOPPED_EVENTID				= 0x1919,
1352 	WMI_PCP_FACTOR_EVENTID				= 0x191A,
1353 	/* Power Save Configuration Events */
1354 	WMI_PS_DEV_PROFILE_CFG_EVENTID			= 0x191C,
1355 	WMI_RS_CFG_DONE_EVENTID				= 0x1921,
1356 	WMI_GET_DETAILED_RS_RES_EVENTID			= 0x1922,
1357 	WMI_AOA_MEAS_EVENTID				= 0x1923,
1358 	WMI_BRP_SET_ANT_LIMIT_EVENTID			= 0x1924,
1359 	WMI_SET_MGMT_RETRY_LIMIT_EVENTID		= 0x1930,
1360 	WMI_GET_MGMT_RETRY_LIMIT_EVENTID		= 0x1931,
1361 	WMI_SET_THERMAL_THROTTLING_CFG_EVENTID		= 0x1940,
1362 	WMI_GET_THERMAL_THROTTLING_CFG_EVENTID		= 0x1941,
1363 	/* return the Power Save profile */
1364 	WMI_PS_DEV_PROFILE_CFG_READ_EVENTID		= 0x1942,
1365 	WMI_TOF_SESSION_END_EVENTID			= 0x1991,
1366 	WMI_TOF_GET_CAPABILITIES_EVENTID		= 0x1992,
1367 	WMI_TOF_SET_LCR_EVENTID				= 0x1993,
1368 	WMI_TOF_SET_LCI_EVENTID				= 0x1994,
1369 	WMI_TOF_FTM_PER_DEST_RES_EVENTID		= 0x1995,
1370 	WMI_TOF_CFG_RESPONDER_EVENTID			= 0x1996,
1371 	WMI_TOF_SET_TX_RX_OFFSET_EVENTID		= 0x1997,
1372 	WMI_TOF_GET_TX_RX_OFFSET_EVENTID		= 0x1998,
1373 	WMI_TOF_CHANNEL_INFO_EVENTID			= 0x1999,
1374 	WMI_GET_RF_SECTOR_PARAMS_DONE_EVENTID		= 0x19A0,
1375 	WMI_SET_RF_SECTOR_PARAMS_DONE_EVENTID		= 0x19A1,
1376 	WMI_GET_SELECTED_RF_SECTOR_INDEX_DONE_EVENTID	= 0x19A2,
1377 	WMI_SET_SELECTED_RF_SECTOR_INDEX_DONE_EVENTID	= 0x19A3,
1378 	WMI_SET_RF_SECTOR_ON_DONE_EVENTID		= 0x19A4,
1379 	WMI_PRIO_TX_SECTORS_ORDER_EVENTID		= 0x19A5,
1380 	WMI_PRIO_TX_SECTORS_NUMBER_EVENTID		= 0x19A6,
1381 	WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID	= 0x19A7,
1382 	WMI_SCHEDULING_SCHEME_EVENTID			= 0x1A01,
1383 	WMI_FIXED_SCHEDULING_CONFIG_COMPLETE_EVENTID	= 0x1A02,
1384 	WMI_ENABLE_FIXED_SCHEDULING_COMPLETE_EVENTID	= 0x1A03,
1385 	WMI_SET_MULTI_DIRECTED_OMNIS_CONFIG_EVENTID	= 0x1A04,
1386 	WMI_SET_LONG_RANGE_CONFIG_COMPLETE_EVENTID	= 0x1A05,
1387 	WMI_SET_CHANNEL_EVENTID				= 0x9000,
1388 	WMI_ASSOC_REQ_EVENTID				= 0x9001,
1389 	WMI_EAPOL_RX_EVENTID				= 0x9002,
1390 	WMI_MAC_ADDR_RESP_EVENTID			= 0x9003,
1391 	WMI_FW_VER_EVENTID				= 0x9004,
1392 	WMI_ACS_PASSIVE_SCAN_COMPLETE_EVENTID		= 0x9005,
1393 	WMI_COMMAND_NOT_SUPPORTED_EVENTID		= 0xFFFF,
1394 };
1395 
1396 /* Events data structures */
1397 enum wmi_fw_status {
1398 	WMI_FW_STATUS_SUCCESS	= 0x00,
1399 	WMI_FW_STATUS_FAILURE	= 0x01,
1400 };
1401 
1402 /* WMI_RF_MGMT_STATUS_EVENTID */
1403 enum wmi_rf_status {
1404 	WMI_RF_ENABLED		= 0x00,
1405 	WMI_RF_DISABLED_HW	= 0x01,
1406 	WMI_RF_DISABLED_SW	= 0x02,
1407 	WMI_RF_DISABLED_HW_SW	= 0x03,
1408 };
1409 
1410 /* WMI_RF_MGMT_STATUS_EVENTID */
1411 struct wmi_rf_mgmt_status_event {
1412 	__le32 rf_status;
1413 } __packed;
1414 
1415 /* WMI_GET_STATUS_DONE_EVENTID */
1416 struct wmi_get_status_done_event {
1417 	__le32 is_associated;
1418 	u8 cid;
1419 	u8 reserved0[3];
1420 	u8 bssid[WMI_MAC_LEN];
1421 	u8 channel;
1422 	u8 reserved1;
1423 	u8 network_type;
1424 	u8 reserved2[3];
1425 	__le32 ssid_len;
1426 	u8 ssid[WMI_MAX_SSID_LEN];
1427 	__le32 rf_status;
1428 	__le32 is_secured;
1429 } __packed;
1430 
1431 /* WMI_FW_VER_EVENTID */
1432 struct wmi_fw_ver_event {
1433 	/* FW image version */
1434 	__le32 fw_major;
1435 	__le32 fw_minor;
1436 	__le32 fw_subminor;
1437 	__le32 fw_build;
1438 	/* FW image build time stamp */
1439 	__le32 hour;
1440 	__le32 minute;
1441 	__le32 second;
1442 	__le32 day;
1443 	__le32 month;
1444 	__le32 year;
1445 	/* Boot Loader image version */
1446 	__le32 bl_major;
1447 	__le32 bl_minor;
1448 	__le32 bl_subminor;
1449 	__le32 bl_build;
1450 	/* The number of entries in the FW capabilities array */
1451 	u8 fw_capabilities_len;
1452 	u8 reserved[3];
1453 	/* FW capabilities info
1454 	 * Must be the last member of the struct
1455 	 */
1456 	__le32 fw_capabilities[0];
1457 } __packed;
1458 
1459 /* WMI_GET_RF_STATUS_EVENTID */
1460 enum rf_type {
1461 	RF_UNKNOWN	= 0x00,
1462 	RF_MARLON	= 0x01,
1463 	RF_SPARROW	= 0x02,
1464 };
1465 
1466 /* WMI_GET_RF_STATUS_EVENTID */
1467 enum board_file_rf_type {
1468 	BF_RF_MARLON	= 0x00,
1469 	BF_RF_SPARROW	= 0x01,
1470 };
1471 
1472 /* WMI_GET_RF_STATUS_EVENTID */
1473 enum rf_status {
1474 	RF_OK			= 0x00,
1475 	RF_NO_COMM		= 0x01,
1476 	RF_WRONG_BOARD_FILE	= 0x02,
1477 };
1478 
1479 /* WMI_GET_RF_STATUS_EVENTID */
1480 struct wmi_get_rf_status_event {
1481 	/* enum rf_type */
1482 	__le32 rf_type;
1483 	/* attached RFs bit vector */
1484 	__le32 attached_rf_vector;
1485 	/* enabled RFs bit vector */
1486 	__le32 enabled_rf_vector;
1487 	/* enum rf_status, refers to enabled RFs */
1488 	u8 rf_status[32];
1489 	/* enum board file RF type */
1490 	__le32 board_file_rf_type;
1491 	/* board file platform type */
1492 	__le32 board_file_platform_type;
1493 	/* board file version */
1494 	__le32 board_file_version;
1495 	/* enabled XIFs bit vector */
1496 	__le32 enabled_xif_vector;
1497 	__le32 reserved;
1498 } __packed;
1499 
1500 /* WMI_GET_BASEBAND_TYPE_EVENTID */
1501 enum baseband_type {
1502 	BASEBAND_UNKNOWN	= 0x00,
1503 	BASEBAND_SPARROW_M_A0	= 0x03,
1504 	BASEBAND_SPARROW_M_A1	= 0x04,
1505 	BASEBAND_SPARROW_M_B0	= 0x05,
1506 	BASEBAND_SPARROW_M_C0	= 0x06,
1507 	BASEBAND_SPARROW_M_D0	= 0x07,
1508 	BASEBAND_TALYN_M_A0	= 0x08,
1509 };
1510 
1511 /* WMI_GET_BASEBAND_TYPE_EVENTID */
1512 struct wmi_get_baseband_type_event {
1513 	/* enum baseband_type */
1514 	__le32 baseband_type;
1515 } __packed;
1516 
1517 /* WMI_MAC_ADDR_RESP_EVENTID */
1518 struct wmi_mac_addr_resp_event {
1519 	u8 mac[WMI_MAC_LEN];
1520 	u8 auth_mode;
1521 	u8 crypt_mode;
1522 	__le32 offload_mode;
1523 } __packed;
1524 
1525 /* WMI_EAPOL_RX_EVENTID */
1526 struct wmi_eapol_rx_event {
1527 	u8 src_mac[WMI_MAC_LEN];
1528 	__le16 eapol_len;
1529 	u8 eapol[0];
1530 } __packed;
1531 
1532 /* WMI_READY_EVENTID */
1533 enum wmi_phy_capability {
1534 	WMI_11A_CAPABILITY		= 0x01,
1535 	WMI_11G_CAPABILITY		= 0x02,
1536 	WMI_11AG_CAPABILITY		= 0x03,
1537 	WMI_11NA_CAPABILITY		= 0x04,
1538 	WMI_11NG_CAPABILITY		= 0x05,
1539 	WMI_11NAG_CAPABILITY		= 0x06,
1540 	WMI_11AD_CAPABILITY		= 0x07,
1541 	WMI_11N_CAPABILITY_OFFSET	= 0x03,
1542 };
1543 
1544 struct wmi_ready_event {
1545 	__le32 sw_version;
1546 	__le32 abi_version;
1547 	u8 mac[WMI_MAC_LEN];
1548 	/* enum wmi_phy_capability */
1549 	u8 phy_capability;
1550 	u8 numof_additional_mids;
1551 	/* rfc read calibration result. 5..15 */
1552 	u8 rfc_read_calib_result;
1553 	u8 reserved[3];
1554 } __packed;
1555 
1556 /* WMI_NOTIFY_REQ_DONE_EVENTID */
1557 struct wmi_notify_req_done_event {
1558 	/* beamforming status, 0: fail; 1: OK; 2: retrying */
1559 	__le32 status;
1560 	__le64 tsf;
1561 	s8 rssi;
1562 	u8 reserved0[3];
1563 	__le32 tx_tpt;
1564 	__le32 tx_goodput;
1565 	__le32 rx_goodput;
1566 	__le16 bf_mcs;
1567 	__le16 my_rx_sector;
1568 	__le16 my_tx_sector;
1569 	__le16 other_rx_sector;
1570 	__le16 other_tx_sector;
1571 	__le16 range;
1572 	u8 sqi;
1573 	u8 reserved[3];
1574 } __packed;
1575 
1576 /* WMI_CONNECT_EVENTID */
1577 struct wmi_connect_event {
1578 	u8 channel;
1579 	u8 reserved0;
1580 	u8 bssid[WMI_MAC_LEN];
1581 	__le16 listen_interval;
1582 	__le16 beacon_interval;
1583 	u8 network_type;
1584 	u8 reserved1[3];
1585 	u8 beacon_ie_len;
1586 	u8 assoc_req_len;
1587 	u8 assoc_resp_len;
1588 	u8 cid;
1589 	u8 aid;
1590 	u8 reserved2[2];
1591 	/* not in use */
1592 	u8 assoc_info[0];
1593 } __packed;
1594 
1595 /* disconnect_reason */
1596 enum wmi_disconnect_reason {
1597 	WMI_DIS_REASON_NO_NETWORK_AVAIL		= 0x01,
1598 	/* bmiss */
1599 	WMI_DIS_REASON_LOST_LINK		= 0x02,
1600 	WMI_DIS_REASON_DISCONNECT_CMD		= 0x03,
1601 	WMI_DIS_REASON_BSS_DISCONNECTED		= 0x04,
1602 	WMI_DIS_REASON_AUTH_FAILED		= 0x05,
1603 	WMI_DIS_REASON_ASSOC_FAILED		= 0x06,
1604 	WMI_DIS_REASON_NO_RESOURCES_AVAIL	= 0x07,
1605 	WMI_DIS_REASON_CSERV_DISCONNECT		= 0x08,
1606 	WMI_DIS_REASON_INVALID_PROFILE		= 0x0A,
1607 	WMI_DIS_REASON_DOT11H_CHANNEL_SWITCH	= 0x0B,
1608 	WMI_DIS_REASON_PROFILE_MISMATCH		= 0x0C,
1609 	WMI_DIS_REASON_CONNECTION_EVICTED	= 0x0D,
1610 	WMI_DIS_REASON_IBSS_MERGE		= 0x0E,
1611 };
1612 
1613 /* WMI_DISCONNECT_EVENTID */
1614 struct wmi_disconnect_event {
1615 	/* reason code, see 802.11 spec. */
1616 	__le16 protocol_reason_status;
1617 	/* set if known */
1618 	u8 bssid[WMI_MAC_LEN];
1619 	/* see enum wmi_disconnect_reason */
1620 	u8 disconnect_reason;
1621 	/* last assoc req may passed to host - not in used */
1622 	u8 assoc_resp_len;
1623 	/* last assoc req may passed to host - not in used */
1624 	u8 assoc_info[0];
1625 } __packed;
1626 
1627 /* WMI_SCAN_COMPLETE_EVENTID */
1628 enum scan_status {
1629 	WMI_SCAN_SUCCESS	= 0x00,
1630 	WMI_SCAN_FAILED		= 0x01,
1631 	WMI_SCAN_ABORTED	= 0x02,
1632 	WMI_SCAN_REJECTED	= 0x03,
1633 	WMI_SCAN_ABORT_REJECTED	= 0x04,
1634 };
1635 
1636 struct wmi_scan_complete_event {
1637 	/* enum scan_status */
1638 	__le32 status;
1639 } __packed;
1640 
1641 /* wmi_rx_mgmt_info */
1642 struct wmi_rx_mgmt_info {
1643 	u8 mcs;
1644 	s8 rssi;
1645 	u8 range;
1646 	u8 sqi;
1647 	__le16 stype;
1648 	__le16 status;
1649 	__le32 len;
1650 	/* Not resolved when == 0xFFFFFFFF == > Broadcast to all MIDS */
1651 	u8 qid;
1652 	/* Not resolved when == 0xFFFFFFFF == > Broadcast to all MIDS */
1653 	u8 mid;
1654 	u8 cid;
1655 	/* From Radio MNGR */
1656 	u8 channel;
1657 } __packed;
1658 
1659 /* WMI_START_SCHED_SCAN_EVENTID */
1660 enum wmi_pno_result {
1661 	WMI_PNO_SUCCESS			= 0x00,
1662 	WMI_PNO_REJECT			= 0x01,
1663 	WMI_PNO_INVALID_PARAMETERS	= 0x02,
1664 	WMI_PNO_NOT_ENABLED		= 0x03,
1665 };
1666 
1667 struct wmi_start_sched_scan_event {
1668 	/* pno_result */
1669 	u8 result;
1670 	u8 reserved[3];
1671 } __packed;
1672 
1673 struct wmi_stop_sched_scan_event {
1674 	/* pno_result */
1675 	u8 result;
1676 	u8 reserved[3];
1677 } __packed;
1678 
1679 struct wmi_sched_scan_result_event {
1680 	struct wmi_rx_mgmt_info info;
1681 	u8 payload[0];
1682 } __packed;
1683 
1684 /* WMI_ACS_PASSIVE_SCAN_COMPLETE_EVENT */
1685 enum wmi_acs_info_bitmask {
1686 	WMI_ACS_INFO_BITMASK_BEACON_FOUND	= 0x01,
1687 	WMI_ACS_INFO_BITMASK_BUSY_TIME		= 0x02,
1688 	WMI_ACS_INFO_BITMASK_TX_TIME		= 0x04,
1689 	WMI_ACS_INFO_BITMASK_RX_TIME		= 0x08,
1690 	WMI_ACS_INFO_BITMASK_NOISE		= 0x10,
1691 };
1692 
1693 struct scan_acs_info {
1694 	u8 channel;
1695 	u8 beacon_found;
1696 	/* msec */
1697 	__le16 busy_time;
1698 	__le16 tx_time;
1699 	__le16 rx_time;
1700 	u8 noise;
1701 	u8 reserved[3];
1702 } __packed;
1703 
1704 struct wmi_acs_passive_scan_complete_event {
1705 	__le32 dwell_time;
1706 	/* valid fields within channel info according to
1707 	 * their appearance in struct order
1708 	 */
1709 	__le16 filled;
1710 	u8 num_scanned_channels;
1711 	u8 reserved;
1712 	struct scan_acs_info scan_info_list[0];
1713 } __packed;
1714 
1715 /* WMI_BA_STATUS_EVENTID */
1716 enum wmi_vring_ba_status {
1717 	WMI_BA_AGREED			= 0x00,
1718 	WMI_BA_NON_AGREED		= 0x01,
1719 	/* BA_EN in middle of teardown flow */
1720 	WMI_BA_TD_WIP			= 0x02,
1721 	/* BA_DIS or BA_EN in middle of BA SETUP flow */
1722 	WMI_BA_SETUP_WIP		= 0x03,
1723 	/* BA_EN when the BA session is already active */
1724 	WMI_BA_SESSION_ACTIVE		= 0x04,
1725 	/* BA_DIS when the BA session is not active */
1726 	WMI_BA_SESSION_NOT_ACTIVE	= 0x05,
1727 };
1728 
1729 struct wmi_ba_status_event {
1730 	/* enum wmi_vring_ba_status */
1731 	__le16 status;
1732 	u8 reserved[2];
1733 	u8 ringid;
1734 	u8 agg_wsize;
1735 	__le16 ba_timeout;
1736 	u8 amsdu;
1737 } __packed;
1738 
1739 /* WMI_DELBA_EVENTID */
1740 struct wmi_delba_event {
1741 	u8 cidxtid;
1742 	u8 from_initiator;
1743 	__le16 reason;
1744 } __packed;
1745 
1746 /* WMI_VRING_CFG_DONE_EVENTID */
1747 struct wmi_vring_cfg_done_event {
1748 	u8 ringid;
1749 	u8 status;
1750 	u8 reserved[2];
1751 	__le32 tx_vring_tail_ptr;
1752 } __packed;
1753 
1754 /* WMI_RCP_ADDBA_RESP_SENT_EVENTID */
1755 struct wmi_rcp_addba_resp_sent_event {
1756 	u8 cidxtid;
1757 	u8 reserved;
1758 	__le16 status;
1759 } __packed;
1760 
1761 /* WMI_RCP_ADDBA_REQ_EVENTID */
1762 struct wmi_rcp_addba_req_event {
1763 	u8 cidxtid;
1764 	u8 dialog_token;
1765 	/* ieee80211_ba_parameterset as it received */
1766 	__le16 ba_param_set;
1767 	__le16 ba_timeout;
1768 	/* ieee80211_ba_seqstrl field as it received */
1769 	__le16 ba_seq_ctrl;
1770 } __packed;
1771 
1772 /* WMI_CFG_RX_CHAIN_DONE_EVENTID */
1773 enum wmi_cfg_rx_chain_done_event_status {
1774 	WMI_CFG_RX_CHAIN_SUCCESS	= 0x01,
1775 };
1776 
1777 struct wmi_cfg_rx_chain_done_event {
1778 	/* V-Ring Tail pointer */
1779 	__le32 rx_ring_tail_ptr;
1780 	__le32 status;
1781 } __packed;
1782 
1783 /* WMI_WBE_LINK_DOWN_EVENTID */
1784 enum wmi_wbe_link_down_event_reason {
1785 	WMI_WBE_REASON_USER_REQUEST	= 0x00,
1786 	WMI_WBE_REASON_RX_DISASSOC	= 0x01,
1787 	WMI_WBE_REASON_BAD_PHY_LINK	= 0x02,
1788 };
1789 
1790 /* WMI_WBE_LINK_DOWN_EVENTID */
1791 struct wmi_wbe_link_down_event {
1792 	u8 cid;
1793 	u8 reserved[3];
1794 	__le32 reason;
1795 } __packed;
1796 
1797 /* WMI_DATA_PORT_OPEN_EVENTID */
1798 struct wmi_data_port_open_event {
1799 	u8 cid;
1800 	u8 reserved[3];
1801 } __packed;
1802 
1803 /* WMI_VRING_EN_EVENTID */
1804 struct wmi_vring_en_event {
1805 	u8 vring_index;
1806 	u8 reserved[3];
1807 } __packed;
1808 
1809 /* WMI_GET_PCP_CHANNEL_EVENTID */
1810 struct wmi_get_pcp_channel_event {
1811 	u8 channel;
1812 	u8 reserved[3];
1813 } __packed;
1814 
1815 /* WMI_P2P_CFG_DONE_EVENTID */
1816 struct wmi_p2p_cfg_done_event {
1817 	/* wmi_fw_status */
1818 	u8 status;
1819 	u8 reserved[3];
1820 } __packed;
1821 
1822 /* WMI_PORT_ALLOCATED_EVENTID */
1823 struct wmi_port_allocated_event {
1824 	/* wmi_fw_status */
1825 	u8 status;
1826 	u8 reserved[3];
1827 } __packed;
1828 
1829 /* WMI_PORT_DELETED_EVENTID */
1830 struct wmi_port_deleted_event {
1831 	/* wmi_fw_status */
1832 	u8 status;
1833 	u8 reserved[3];
1834 } __packed;
1835 
1836 /* WMI_LISTEN_STARTED_EVENTID */
1837 struct wmi_listen_started_event {
1838 	/* wmi_fw_status */
1839 	u8 status;
1840 	u8 reserved[3];
1841 } __packed;
1842 
1843 /* WMI_SEARCH_STARTED_EVENTID */
1844 struct wmi_search_started_event {
1845 	/* wmi_fw_status */
1846 	u8 status;
1847 	u8 reserved[3];
1848 } __packed;
1849 
1850 /* WMI_PCP_STARTED_EVENTID */
1851 struct wmi_pcp_started_event {
1852 	/* wmi_fw_status */
1853 	u8 status;
1854 	u8 reserved[3];
1855 } __packed;
1856 
1857 /* WMI_PCP_FACTOR_EVENTID */
1858 struct wmi_pcp_factor_event {
1859 	__le32 pcp_factor;
1860 } __packed;
1861 
1862 enum wmi_sw_tx_status {
1863 	WMI_TX_SW_STATUS_SUCCESS		= 0x00,
1864 	WMI_TX_SW_STATUS_FAILED_NO_RESOURCES	= 0x01,
1865 	WMI_TX_SW_STATUS_FAILED_TX		= 0x02,
1866 };
1867 
1868 /* WMI_SW_TX_COMPLETE_EVENTID */
1869 struct wmi_sw_tx_complete_event {
1870 	/* enum wmi_sw_tx_status */
1871 	u8 status;
1872 	u8 reserved[3];
1873 } __packed;
1874 
1875 /* WMI_CORR_MEASURE_EVENTID - deprecated */
1876 struct wmi_corr_measure_event {
1877 	/* signed */
1878 	__le32 i;
1879 	/* signed */
1880 	__le32 q;
1881 	/* signed */
1882 	__le32 image_i;
1883 	/* signed */
1884 	__le32 image_q;
1885 } __packed;
1886 
1887 /* WMI_READ_RSSI_EVENTID */
1888 struct wmi_read_rssi_event {
1889 	__le32 ina_rssi_adc_dbm;
1890 } __packed;
1891 
1892 /* WMI_GET_SSID_EVENTID */
1893 struct wmi_get_ssid_event {
1894 	__le32 ssid_len;
1895 	u8 ssid[WMI_MAX_SSID_LEN];
1896 } __packed;
1897 
1898 /* EVENT: WMI_RF_XPM_READ_RESULT_EVENTID */
1899 struct wmi_rf_xpm_read_result_event {
1900 	/* enum wmi_fw_status_e - success=0 or fail=1 */
1901 	u8 status;
1902 	u8 reserved[3];
1903 	/* requested num_bytes of data */
1904 	u8 data_bytes[0];
1905 } __packed;
1906 
1907 /* EVENT: WMI_RF_XPM_WRITE_RESULT_EVENTID */
1908 struct wmi_rf_xpm_write_result_event {
1909 	/* enum wmi_fw_status_e - success=0 or fail=1 */
1910 	u8 status;
1911 	u8 reserved[3];
1912 } __packed;
1913 
1914 /* WMI_TX_MGMT_PACKET_EVENTID */
1915 struct wmi_tx_mgmt_packet_event {
1916 	u8 payload[0];
1917 } __packed;
1918 
1919 /* WMI_RX_MGMT_PACKET_EVENTID */
1920 struct wmi_rx_mgmt_packet_event {
1921 	struct wmi_rx_mgmt_info info;
1922 	u8 payload[0];
1923 } __packed;
1924 
1925 /* WMI_ECHO_RSP_EVENTID */
1926 struct wmi_echo_rsp_event {
1927 	__le32 echoed_value;
1928 } __packed;
1929 
1930 /* WMI_RF_PWR_ON_DELAY_RSP_EVENTID */
1931 struct wmi_rf_pwr_on_delay_rsp_event {
1932 	/* wmi_fw_status */
1933 	u8 status;
1934 	u8 reserved[3];
1935 } __packed;
1936 
1937 /* WMI_SET_HIGH_POWER_TABLE_PARAMS_EVENTID */
1938 struct wmi_set_high_power_table_params_event {
1939 	/* wmi_fw_status */
1940 	u8 status;
1941 	u8 reserved[3];
1942 } __packed;
1943 
1944 /* WMI_TEMP_SENSE_DONE_EVENTID
1945  *
1946  * Measure MAC and radio temperatures
1947  */
1948 struct wmi_temp_sense_done_event {
1949 	/* Temperature times 1000 (actual temperature will be achieved by
1950 	 * dividing the value by 1000)
1951 	 */
1952 	__le32 baseband_t1000;
1953 	/* Temperature times 1000 (actual temperature will be achieved by
1954 	 * dividing the value by 1000)
1955 	 */
1956 	__le32 rf_t1000;
1957 } __packed;
1958 
1959 #define WMI_SCAN_DWELL_TIME_MS	(100)
1960 #define WMI_SURVEY_TIMEOUT_MS	(10000)
1961 
1962 enum wmi_hidden_ssid {
1963 	WMI_HIDDEN_SSID_DISABLED	= 0x00,
1964 	WMI_HIDDEN_SSID_SEND_EMPTY	= 0x10,
1965 	WMI_HIDDEN_SSID_CLEAR		= 0xFE,
1966 };
1967 
1968 /* WMI_LED_CFG_CMDID
1969  *
1970  * Configure LED On\Off\Blinking operation
1971  *
1972  * Returned events:
1973  * - WMI_LED_CFG_DONE_EVENTID
1974  */
1975 enum led_mode {
1976 	LED_DISABLE	= 0x00,
1977 	LED_ENABLE	= 0x01,
1978 };
1979 
1980 /* The names of the led as
1981  * described on HW schemes.
1982  */
1983 enum wmi_led_id {
1984 	WMI_LED_WLAN	= 0x00,
1985 	WMI_LED_WPAN	= 0x01,
1986 	WMI_LED_WWAN	= 0x02,
1987 };
1988 
1989 /* Led polarity mode. */
1990 enum wmi_led_polarity {
1991 	LED_POLARITY_HIGH_ACTIVE	= 0x00,
1992 	LED_POLARITY_LOW_ACTIVE		= 0x01,
1993 };
1994 
1995 /* Combination of on and off
1996  * creates the blinking period
1997  */
1998 struct wmi_led_blink_mode {
1999 	__le32 blink_on;
2000 	__le32 blink_off;
2001 } __packed;
2002 
2003 /* WMI_LED_CFG_CMDID */
2004 struct wmi_led_cfg_cmd {
2005 	/* enum led_mode_e */
2006 	u8 led_mode;
2007 	/* enum wmi_led_id_e */
2008 	u8 id;
2009 	/* slow speed blinking combination */
2010 	struct wmi_led_blink_mode slow_blink_cfg;
2011 	/* medium speed blinking combination */
2012 	struct wmi_led_blink_mode medium_blink_cfg;
2013 	/* high speed blinking combination */
2014 	struct wmi_led_blink_mode fast_blink_cfg;
2015 	/* polarity of the led */
2016 	u8 led_polarity;
2017 	/* reserved */
2018 	u8 reserved;
2019 } __packed;
2020 
2021 /* \WMI_SET_CONNECT_SNR_THR_CMDID */
2022 struct wmi_set_connect_snr_thr_cmd {
2023 	u8 enable;
2024 	u8 reserved;
2025 	/* 1/4 Db units */
2026 	__le16 omni_snr_thr;
2027 	/* 1/4 Db units */
2028 	__le16 direct_snr_thr;
2029 } __packed;
2030 
2031 /* WMI_LED_CFG_DONE_EVENTID */
2032 struct wmi_led_cfg_done_event {
2033 	/* led config status */
2034 	__le32 status;
2035 } __packed;
2036 
2037 /* Rate search parameters configuration per connection */
2038 struct wmi_rs_cfg {
2039 	/* The maximal allowed PER for each MCS
2040 	 * MCS will be considered as failed if PER during RS is higher
2041 	 */
2042 	u8 per_threshold[WMI_NUM_MCS];
2043 	/* Number of MPDUs for each MCS
2044 	 * this is the minimal statistic required to make an educated
2045 	 * decision
2046 	 */
2047 	u8 min_frame_cnt[WMI_NUM_MCS];
2048 	/* stop threshold [0-100] */
2049 	u8 stop_th;
2050 	/* MCS1 stop threshold [0-100] */
2051 	u8 mcs1_fail_th;
2052 	u8 max_back_failure_th;
2053 	/* Debug feature for disabling internal RS trigger (which is
2054 	 * currently triggered by BF Done)
2055 	 */
2056 	u8 dbg_disable_internal_trigger;
2057 	__le32 back_failure_mask;
2058 	__le32 mcs_en_vec;
2059 } __packed;
2060 
2061 /* Slot types */
2062 enum wmi_sched_scheme_slot_type {
2063 	WMI_SCHED_SLOT_SP		= 0x0,
2064 	WMI_SCHED_SLOT_CBAP		= 0x1,
2065 	WMI_SCHED_SLOT_IDLE		= 0x2,
2066 	WMI_SCHED_SLOT_ANNOUNCE_NO_ACK	= 0x3,
2067 	WMI_SCHED_SLOT_DISCOVERY	= 0x4,
2068 };
2069 
2070 enum wmi_sched_scheme_slot_flags {
2071 	WMI_SCHED_SCHEME_SLOT_PERIODIC	= 0x1,
2072 };
2073 
2074 struct wmi_sched_scheme_slot {
2075 	/* in microsecond */
2076 	__le32 tbtt_offset;
2077 	/* wmi_sched_scheme_slot_flags */
2078 	u8 flags;
2079 	/* wmi_sched_scheme_slot_type */
2080 	u8 type;
2081 	/* in microsecond */
2082 	__le16 duration;
2083 	/* frame_exchange_sequence_duration */
2084 	__le16 tx_op;
2085 	/* time in microseconds between two consecutive slots
2086 	 * relevant only if flag WMI_SCHED_SCHEME_SLOT_PERIODIC set
2087 	 */
2088 	__le16 period;
2089 	/* relevant only if flag WMI_SCHED_SCHEME_SLOT_PERIODIC set
2090 	 * number of times to repeat allocation
2091 	 */
2092 	u8 num_of_blocks;
2093 	/* relevant only if flag WMI_SCHED_SCHEME_SLOT_PERIODIC set
2094 	 * every idle_period allocation will be idle
2095 	 */
2096 	u8 idle_period;
2097 	u8 src_aid;
2098 	u8 dest_aid;
2099 	__le32 reserved;
2100 } __packed;
2101 
2102 enum wmi_sched_scheme_flags {
2103 	/* should not be set when clearing scheduling scheme */
2104 	WMI_SCHED_SCHEME_ENABLE		= 0x01,
2105 	WMI_SCHED_PROTECTED_SP		= 0x02,
2106 	/* should be set only on first WMI fragment of scheme */
2107 	WMI_SCHED_FIRST			= 0x04,
2108 	/* should be set only on last WMI fragment of scheme */
2109 	WMI_SCHED_LAST			= 0x08,
2110 	WMI_SCHED_IMMEDIATE_START	= 0x10,
2111 };
2112 
2113 enum wmi_sched_scheme_advertisment {
2114 	/* ESE is not advertised at all, STA has to be configured with WMI
2115 	 * also
2116 	 */
2117 	WMI_ADVERTISE_ESE_DISABLED		= 0x0,
2118 	WMI_ADVERTISE_ESE_IN_BEACON		= 0x1,
2119 	WMI_ADVERTISE_ESE_IN_ANNOUNCE_FRAME	= 0x2,
2120 };
2121 
2122 /* WMI_SCHEDULING_SCHEME_CMD */
2123 struct wmi_scheduling_scheme_cmd {
2124 	u8 serial_num;
2125 	/* wmi_sched_scheme_advertisment */
2126 	u8 ese_advertisment;
2127 	/* wmi_sched_scheme_flags */
2128 	__le16 flags;
2129 	u8 num_allocs;
2130 	u8 reserved[3];
2131 	__le64 start_tbtt;
2132 	/* allocations list */
2133 	struct wmi_sched_scheme_slot allocs[WMI_SCHED_MAX_ALLOCS_PER_CMD];
2134 } __packed;
2135 
2136 enum wmi_sched_scheme_failure_type {
2137 	WMI_SCHED_SCHEME_FAILURE_NO_ERROR		= 0x00,
2138 	WMI_SCHED_SCHEME_FAILURE_OLD_START_TSF_ERR	= 0x01,
2139 };
2140 
2141 /* WMI_SCHEDULING_SCHEME_EVENTID */
2142 struct wmi_scheduling_scheme_event {
2143 	/* wmi_fw_status_e */
2144 	u8 status;
2145 	/* serial number given in command */
2146 	u8 serial_num;
2147 	/* wmi_sched_scheme_failure_type */
2148 	u8 failure_type;
2149 	/* alignment to 32b */
2150 	u8 reserved[1];
2151 } __packed;
2152 
2153 /* WMI_RS_CFG_CMDID */
2154 struct wmi_rs_cfg_cmd {
2155 	/* connection id */
2156 	u8 cid;
2157 	/* enable or disable rate search */
2158 	u8 rs_enable;
2159 	/* rate search configuration */
2160 	struct wmi_rs_cfg rs_cfg;
2161 } __packed;
2162 
2163 /* WMI_RS_CFG_DONE_EVENTID */
2164 struct wmi_rs_cfg_done_event {
2165 	u8 cid;
2166 	/* enum wmi_fw_status */
2167 	u8 status;
2168 	u8 reserved[2];
2169 } __packed;
2170 
2171 /* WMI_GET_DETAILED_RS_RES_CMDID */
2172 struct wmi_get_detailed_rs_res_cmd {
2173 	/* connection id */
2174 	u8 cid;
2175 	u8 reserved[3];
2176 } __packed;
2177 
2178 /* RS results status */
2179 enum wmi_rs_results_status {
2180 	WMI_RS_RES_VALID	= 0x00,
2181 	WMI_RS_RES_INVALID	= 0x01,
2182 };
2183 
2184 /* Rate search results */
2185 struct wmi_rs_results {
2186 	/* number of sent MPDUs */
2187 	u8 num_of_tx_pkt[WMI_NUM_MCS];
2188 	/* number of non-acked MPDUs */
2189 	u8 num_of_non_acked_pkt[WMI_NUM_MCS];
2190 	/* RS timestamp */
2191 	__le32 tsf;
2192 	/* RS selected MCS */
2193 	u8 mcs;
2194 } __packed;
2195 
2196 /* WMI_GET_DETAILED_RS_RES_EVENTID */
2197 struct wmi_get_detailed_rs_res_event {
2198 	u8 cid;
2199 	/* enum wmi_rs_results_status */
2200 	u8 status;
2201 	/* detailed rs results */
2202 	struct wmi_rs_results rs_results;
2203 	u8 reserved[3];
2204 } __packed;
2205 
2206 /* BRP antenna limit mode */
2207 enum wmi_brp_ant_limit_mode {
2208 	/* Disable BRP force antenna limit */
2209 	WMI_BRP_ANT_LIMIT_MODE_DISABLE		= 0x00,
2210 	/* Define maximal antennas limit. Only effective antennas will be
2211 	 * actually used
2212 	 */
2213 	WMI_BRP_ANT_LIMIT_MODE_EFFECTIVE	= 0x01,
2214 	/* Force a specific number of antennas */
2215 	WMI_BRP_ANT_LIMIT_MODE_FORCE		= 0x02,
2216 	/* number of BRP antenna limit modes */
2217 	WMI_BRP_ANT_LIMIT_MODES_NUM		= 0x03,
2218 };
2219 
2220 /* WMI_BRP_SET_ANT_LIMIT_CMDID */
2221 struct wmi_brp_set_ant_limit_cmd {
2222 	/* connection id */
2223 	u8 cid;
2224 	/* enum wmi_brp_ant_limit_mode */
2225 	u8 limit_mode;
2226 	/* antenna limit count, 1-27
2227 	 * disable_mode - ignored
2228 	 * effective_mode - upper limit to number of antennas to be used
2229 	 * force_mode - exact number of antennas to be used
2230 	 */
2231 	u8 ant_limit;
2232 	u8 reserved;
2233 } __packed;
2234 
2235 /* WMI_BRP_SET_ANT_LIMIT_EVENTID */
2236 struct wmi_brp_set_ant_limit_event {
2237 	/* wmi_fw_status */
2238 	u8 status;
2239 	u8 reserved[3];
2240 } __packed;
2241 
2242 /* broadcast connection ID */
2243 #define WMI_LINK_MAINTAIN_CFG_CID_BROADCAST	(0xFFFFFFFF)
2244 
2245 /* Types wmi_link_maintain_cfg presets for WMI_LINK_MAINTAIN_CFG_WRITE_CMD */
2246 enum wmi_link_maintain_cfg_type {
2247 	/* AP/PCP default normal (non-FST) configuration settings */
2248 	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_NORMAL_AP	= 0x00,
2249 	/* AP/PCP  default FST configuration settings */
2250 	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_FST_AP	= 0x01,
2251 	/* STA default normal (non-FST) configuration settings */
2252 	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_NORMAL_STA	= 0x02,
2253 	/* STA default FST configuration settings */
2254 	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_FST_STA	= 0x03,
2255 	/* custom configuration settings */
2256 	WMI_LINK_MAINTAIN_CFG_TYPE_CUSTOM		= 0x04,
2257 	/* number of defined configuration types */
2258 	WMI_LINK_MAINTAIN_CFG_TYPES_NUM			= 0x05,
2259 };
2260 
2261 /* Response status codes for WMI_LINK_MAINTAIN_CFG_WRITE/READ commands */
2262 enum wmi_link_maintain_cfg_response_status {
2263 	/* WMI_LINK_MAINTAIN_CFG_WRITE/READ command successfully accomplished
2264 	 */
2265 	WMI_LINK_MAINTAIN_CFG_RESPONSE_STATUS_OK		= 0x00,
2266 	/* ERROR due to bad argument in WMI_LINK_MAINTAIN_CFG_WRITE/READ
2267 	 * command request
2268 	 */
2269 	WMI_LINK_MAINTAIN_CFG_RESPONSE_STATUS_BAD_ARGUMENT	= 0x01,
2270 };
2271 
2272 /* Link Loss and Keep Alive configuration */
2273 struct wmi_link_maintain_cfg {
2274 	/* link_loss_enable_detectors_vec */
2275 	__le32 link_loss_enable_detectors_vec;
2276 	/* detectors check period usec */
2277 	__le32 check_link_loss_period_usec;
2278 	/* max allowed tx ageing */
2279 	__le32 tx_ageing_threshold_usec;
2280 	/* keep alive period for high SNR */
2281 	__le32 keep_alive_period_usec_high_snr;
2282 	/* keep alive period for low SNR */
2283 	__le32 keep_alive_period_usec_low_snr;
2284 	/* lower snr limit for keep alive period update */
2285 	__le32 keep_alive_snr_threshold_low_db;
2286 	/* upper snr limit for keep alive period update */
2287 	__le32 keep_alive_snr_threshold_high_db;
2288 	/* num of successive bad bcons causing link-loss */
2289 	__le32 bad_beacons_num_threshold;
2290 	/* SNR limit for bad_beacons_detector */
2291 	__le32 bad_beacons_snr_threshold_db;
2292 } __packed;
2293 
2294 /* WMI_LINK_MAINTAIN_CFG_WRITE_CMDID */
2295 struct wmi_link_maintain_cfg_write_cmd {
2296 	/* enum wmi_link_maintain_cfg_type_e - type of requested default
2297 	 * configuration to be applied
2298 	 */
2299 	__le32 cfg_type;
2300 	/* requested connection ID or WMI_LINK_MAINTAIN_CFG_CID_BROADCAST */
2301 	__le32 cid;
2302 	/* custom configuration settings to be applied (relevant only if
2303 	 * cfg_type==WMI_LINK_MAINTAIN_CFG_TYPE_CUSTOM)
2304 	 */
2305 	struct wmi_link_maintain_cfg lm_cfg;
2306 } __packed;
2307 
2308 /* WMI_LINK_MAINTAIN_CFG_READ_CMDID */
2309 struct wmi_link_maintain_cfg_read_cmd {
2310 	/* connection ID which configuration settings are requested */
2311 	__le32 cid;
2312 } __packed;
2313 
2314 /* WMI_LINK_MAINTAIN_CFG_WRITE_DONE_EVENTID */
2315 struct wmi_link_maintain_cfg_write_done_event {
2316 	/* requested connection ID */
2317 	__le32 cid;
2318 	/* wmi_link_maintain_cfg_response_status_e - write status */
2319 	__le32 status;
2320 } __packed;
2321 
2322 /* \WMI_LINK_MAINTAIN_CFG_READ_DONE_EVENT */
2323 struct wmi_link_maintain_cfg_read_done_event {
2324 	/* requested connection ID */
2325 	__le32 cid;
2326 	/* wmi_link_maintain_cfg_response_status_e - read status */
2327 	__le32 status;
2328 	/* Retrieved configuration settings */
2329 	struct wmi_link_maintain_cfg lm_cfg;
2330 } __packed;
2331 
2332 enum wmi_traffic_suspend_status {
2333 	WMI_TRAFFIC_SUSPEND_APPROVED			= 0x0,
2334 	WMI_TRAFFIC_SUSPEND_REJECTED_LINK_NOT_IDLE	= 0x1,
2335 };
2336 
2337 /* WMI_TRAFFIC_SUSPEND_EVENTID */
2338 struct wmi_traffic_suspend_event {
2339 	/* enum wmi_traffic_suspend_status_e */
2340 	u8 status;
2341 } __packed;
2342 
2343 enum wmi_traffic_resume_status {
2344 	WMI_TRAFFIC_RESUME_SUCCESS	= 0x0,
2345 	WMI_TRAFFIC_RESUME_FAILED	= 0x1,
2346 };
2347 
2348 enum wmi_resume_trigger {
2349 	WMI_RESUME_TRIGGER_UNKNOWN	= 0x0,
2350 	WMI_RESUME_TRIGGER_HOST		= 0x1,
2351 	WMI_RESUME_TRIGGER_UCAST_RX	= 0x2,
2352 	WMI_RESUME_TRIGGER_BCAST_RX	= 0x4,
2353 	WMI_RESUME_TRIGGER_WMI_EVT	= 0x8,
2354 };
2355 
2356 /* WMI_TRAFFIC_RESUME_EVENTID */
2357 struct wmi_traffic_resume_event {
2358 	/* enum wmi_traffic_resume_status */
2359 	u8 status;
2360 	u8 reserved[3];
2361 	/* enum wmi_resume_trigger bitmap */
2362 	__le32 resume_triggers;
2363 } __packed;
2364 
2365 /* Power Save command completion status codes */
2366 enum wmi_ps_cfg_cmd_status {
2367 	WMI_PS_CFG_CMD_STATUS_SUCCESS	= 0x00,
2368 	WMI_PS_CFG_CMD_STATUS_BAD_PARAM	= 0x01,
2369 	/* other error */
2370 	WMI_PS_CFG_CMD_STATUS_ERROR	= 0x02,
2371 };
2372 
2373 /* Device Power Save Profiles */
2374 enum wmi_ps_profile_type {
2375 	WMI_PS_PROFILE_TYPE_DEFAULT		= 0x00,
2376 	WMI_PS_PROFILE_TYPE_PS_DISABLED		= 0x01,
2377 	WMI_PS_PROFILE_TYPE_MAX_PS		= 0x02,
2378 	WMI_PS_PROFILE_TYPE_LOW_LATENCY_PS	= 0x03,
2379 };
2380 
2381 /* WMI_PS_DEV_PROFILE_CFG_READ_CMDID */
2382 struct wmi_ps_dev_profile_cfg_read_cmd {
2383 	/* reserved */
2384 	__le32 reserved;
2385 } __packed;
2386 
2387 /* WMI_PS_DEV_PROFILE_CFG_READ_EVENTID */
2388 struct wmi_ps_dev_profile_cfg_read_event {
2389 	/* wmi_ps_profile_type_e */
2390 	u8 ps_profile;
2391 	u8 reserved[3];
2392 } __packed;
2393 
2394 /* WMI_PS_DEV_PROFILE_CFG_CMDID
2395  *
2396  * Power save profile to be used by the device
2397  *
2398  * Returned event:
2399  * - WMI_PS_DEV_PROFILE_CFG_EVENTID
2400  */
2401 struct wmi_ps_dev_profile_cfg_cmd {
2402 	/* wmi_ps_profile_type_e */
2403 	u8 ps_profile;
2404 	u8 reserved[3];
2405 } __packed;
2406 
2407 /* WMI_PS_DEV_PROFILE_CFG_EVENTID */
2408 struct wmi_ps_dev_profile_cfg_event {
2409 	/* wmi_ps_cfg_cmd_status_e */
2410 	__le32 status;
2411 } __packed;
2412 
2413 enum wmi_ps_level {
2414 	WMI_PS_LEVEL_DEEP_SLEEP		= 0x00,
2415 	WMI_PS_LEVEL_SHALLOW_SLEEP	= 0x01,
2416 	/* awake = all PS mechanisms are disabled */
2417 	WMI_PS_LEVEL_AWAKE		= 0x02,
2418 };
2419 
2420 enum wmi_ps_deep_sleep_clk_level {
2421 	/* 33k */
2422 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_RTC		= 0x00,
2423 	/* 10k */
2424 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_OSC		= 0x01,
2425 	/* @RTC Low latency */
2426 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_RTC_LT	= 0x02,
2427 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_XTAL	= 0x03,
2428 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_SYSCLK	= 0x04,
2429 	/* Not Applicable */
2430 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_N_A		= 0xFF,
2431 };
2432 
2433 /* Response by the FW to a D3 entry request */
2434 enum wmi_ps_d3_resp_policy {
2435 	WMI_PS_D3_RESP_POLICY_DEFAULT	= 0x00,
2436 	/* debug -D3 req is always denied */
2437 	WMI_PS_D3_RESP_POLICY_DENIED	= 0x01,
2438 	/* debug -D3 req is always approved */
2439 	WMI_PS_D3_RESP_POLICY_APPROVED	= 0x02,
2440 };
2441 
2442 #define WMI_AOA_MAX_DATA_SIZE	(128)
2443 
2444 enum wmi_aoa_meas_status {
2445 	WMI_AOA_MEAS_SUCCESS		= 0x00,
2446 	WMI_AOA_MEAS_PEER_INCAPABLE	= 0x01,
2447 	WMI_AOA_MEAS_FAILURE		= 0x02,
2448 };
2449 
2450 /* WMI_AOA_MEAS_EVENTID */
2451 struct wmi_aoa_meas_event {
2452 	u8 mac_addr[WMI_MAC_LEN];
2453 	/* channels IDs:
2454 	 * 0 - 58320 MHz
2455 	 * 1 - 60480 MHz
2456 	 * 2 - 62640 MHz
2457 	 */
2458 	u8 channel;
2459 	/* enum wmi_aoa_meas_type */
2460 	u8 aoa_meas_type;
2461 	/* Measurments are from RFs, defined by the mask */
2462 	__le32 meas_rf_mask;
2463 	/* enum wmi_aoa_meas_status */
2464 	u8 meas_status;
2465 	u8 reserved;
2466 	/* Length of meas_data in bytes */
2467 	__le16 length;
2468 	u8 meas_data[WMI_AOA_MAX_DATA_SIZE];
2469 } __packed;
2470 
2471 /* WMI_SET_MGMT_RETRY_LIMIT_EVENTID */
2472 struct wmi_set_mgmt_retry_limit_event {
2473 	/* enum wmi_fw_status */
2474 	u8 status;
2475 	/* alignment to 32b */
2476 	u8 reserved[3];
2477 } __packed;
2478 
2479 /* WMI_GET_MGMT_RETRY_LIMIT_EVENTID */
2480 struct wmi_get_mgmt_retry_limit_event {
2481 	/* MAC retransmit limit for mgmt frames */
2482 	u8 mgmt_retry_limit;
2483 	/* alignment to 32b */
2484 	u8 reserved[3];
2485 } __packed;
2486 
2487 /* WMI_TOF_GET_CAPABILITIES_EVENTID */
2488 struct wmi_tof_get_capabilities_event {
2489 	u8 ftm_capability;
2490 	/* maximum supported number of destination to start TOF */
2491 	u8 max_num_of_dest;
2492 	/* maximum supported number of measurements per burst */
2493 	u8 max_num_of_meas_per_burst;
2494 	u8 reserved;
2495 	/* maximum supported multi bursts */
2496 	__le16 max_multi_bursts_sessions;
2497 	/* maximum supported FTM burst duration , wmi_tof_burst_duration_e */
2498 	__le16 max_ftm_burst_duration;
2499 	/* AOA supported types */
2500 	__le32 aoa_supported_types;
2501 } __packed;
2502 
2503 /* WMI_SET_THERMAL_THROTTLING_CFG_EVENTID */
2504 struct wmi_set_thermal_throttling_cfg_event {
2505 	/* wmi_fw_status */
2506 	u8 status;
2507 	u8 reserved[3];
2508 } __packed;
2509 
2510 /* WMI_GET_THERMAL_THROTTLING_CFG_EVENTID */
2511 struct wmi_get_thermal_throttling_cfg_event {
2512 	/* Status data */
2513 	struct wmi_tt_data tt_data;
2514 } __packed;
2515 
2516 enum wmi_tof_session_end_status {
2517 	WMI_TOF_SESSION_END_NO_ERROR		= 0x00,
2518 	WMI_TOF_SESSION_END_FAIL		= 0x01,
2519 	WMI_TOF_SESSION_END_PARAMS_ERROR	= 0x02,
2520 	WMI_TOF_SESSION_END_ABORTED		= 0x03,
2521 };
2522 
2523 /* WMI_TOF_SESSION_END_EVENTID */
2524 struct wmi_tof_session_end_event {
2525 	/* FTM session ID */
2526 	__le32 session_id;
2527 	/* wmi_tof_session_end_status_e */
2528 	u8 status;
2529 	u8 reserved[3];
2530 } __packed;
2531 
2532 /* WMI_TOF_SET_LCI_EVENTID */
2533 struct wmi_tof_set_lci_event {
2534 	/* enum wmi_fw_status */
2535 	u8 status;
2536 	u8 reserved[3];
2537 } __packed;
2538 
2539 /* WMI_TOF_SET_LCR_EVENTID */
2540 struct wmi_tof_set_lcr_event {
2541 	/* enum wmi_fw_status */
2542 	u8 status;
2543 	u8 reserved[3];
2544 } __packed;
2545 
2546 /* Responder FTM Results */
2547 struct wmi_responder_ftm_res {
2548 	u8 t1[6];
2549 	u8 t2[6];
2550 	u8 t3[6];
2551 	u8 t4[6];
2552 	__le16 tod_err;
2553 	__le16 toa_err;
2554 	__le16 tod_err_initiator;
2555 	__le16 toa_err_initiator;
2556 } __packed;
2557 
2558 enum wmi_tof_ftm_per_dest_res_status {
2559 	WMI_PER_DEST_RES_NO_ERROR		= 0x00,
2560 	WMI_PER_DEST_RES_TX_RX_FAIL		= 0x01,
2561 	WMI_PER_DEST_RES_PARAM_DONT_MATCH	= 0x02,
2562 };
2563 
2564 enum wmi_tof_ftm_per_dest_res_flags {
2565 	WMI_PER_DEST_RES_REQ_START		= 0x01,
2566 	WMI_PER_DEST_RES_BURST_REPORT_END	= 0x02,
2567 	WMI_PER_DEST_RES_REQ_END		= 0x04,
2568 	WMI_PER_DEST_RES_PARAM_UPDATE		= 0x08,
2569 };
2570 
2571 /* WMI_TOF_FTM_PER_DEST_RES_EVENTID */
2572 struct wmi_tof_ftm_per_dest_res_event {
2573 	/* FTM session ID */
2574 	__le32 session_id;
2575 	/* destination MAC address */
2576 	u8 dst_mac[WMI_MAC_LEN];
2577 	/* wmi_tof_ftm_per_dest_res_flags_e */
2578 	u8 flags;
2579 	/* wmi_tof_ftm_per_dest_res_status_e */
2580 	u8 status;
2581 	/* responder ASAP */
2582 	u8 responder_asap;
2583 	/* responder number of FTM per burst */
2584 	u8 responder_num_ftm_per_burst;
2585 	/* responder number of FTM burst exponent */
2586 	u8 responder_num_ftm_bursts_exp;
2587 	/* responder burst duration ,wmi_tof_burst_duration_e */
2588 	u8 responder_burst_duration;
2589 	/* responder burst period, indicate interval between two consecutive
2590 	 * burst instances, in units of 100 ms
2591 	 */
2592 	__le16 responder_burst_period;
2593 	/* receive burst counter */
2594 	__le16 bursts_cnt;
2595 	/* tsf of responder start burst */
2596 	__le32 tsf_sync;
2597 	/* actual received ftm per burst */
2598 	u8 actual_ftm_per_burst;
2599 	/* Measurments are from RFs, defined by the mask */
2600 	__le32 meas_rf_mask;
2601 	u8 reserved0[3];
2602 	struct wmi_responder_ftm_res responder_ftm_res[0];
2603 } __packed;
2604 
2605 /* WMI_TOF_CFG_RESPONDER_EVENTID */
2606 struct wmi_tof_cfg_responder_event {
2607 	/* enum wmi_fw_status */
2608 	u8 status;
2609 	u8 reserved[3];
2610 } __packed;
2611 
2612 enum wmi_tof_channel_info_type {
2613 	WMI_TOF_CHANNEL_INFO_AOA		= 0x00,
2614 	WMI_TOF_CHANNEL_INFO_LCI		= 0x01,
2615 	WMI_TOF_CHANNEL_INFO_LCR		= 0x02,
2616 	WMI_TOF_CHANNEL_INFO_VENDOR_SPECIFIC	= 0x03,
2617 	WMI_TOF_CHANNEL_INFO_CIR		= 0x04,
2618 	WMI_TOF_CHANNEL_INFO_RSSI		= 0x05,
2619 	WMI_TOF_CHANNEL_INFO_SNR		= 0x06,
2620 	WMI_TOF_CHANNEL_INFO_DEBUG		= 0x07,
2621 };
2622 
2623 /* WMI_TOF_CHANNEL_INFO_EVENTID */
2624 struct wmi_tof_channel_info_event {
2625 	/* FTM session ID */
2626 	__le32 session_id;
2627 	/* destination MAC address */
2628 	u8 dst_mac[WMI_MAC_LEN];
2629 	/* wmi_tof_channel_info_type_e */
2630 	u8 type;
2631 	/* data report length */
2632 	u8 len;
2633 	/* data report payload */
2634 	u8 report[0];
2635 } __packed;
2636 
2637 /* WMI_TOF_SET_TX_RX_OFFSET_EVENTID */
2638 struct wmi_tof_set_tx_rx_offset_event {
2639 	/* enum wmi_fw_status */
2640 	u8 status;
2641 	u8 reserved[3];
2642 } __packed;
2643 
2644 /* WMI_TOF_GET_TX_RX_OFFSET_EVENTID */
2645 struct wmi_tof_get_tx_rx_offset_event {
2646 	/* enum wmi_fw_status */
2647 	u8 status;
2648 	/* RF index used to read the offsets */
2649 	u8 rf_index;
2650 	u8 reserved1[2];
2651 	/* TX delay offset */
2652 	__le32 tx_offset;
2653 	/* RX delay offset */
2654 	__le32 rx_offset;
2655 	/* Offset to strongest tap of CIR */
2656 	__le32 precursor;
2657 } __packed;
2658 
2659 /* Result status codes for WMI commands */
2660 enum wmi_rf_sector_status {
2661 	WMI_RF_SECTOR_STATUS_SUCCESS			= 0x00,
2662 	WMI_RF_SECTOR_STATUS_BAD_PARAMETERS_ERROR	= 0x01,
2663 	WMI_RF_SECTOR_STATUS_BUSY_ERROR			= 0x02,
2664 	WMI_RF_SECTOR_STATUS_NOT_SUPPORTED_ERROR	= 0x03,
2665 };
2666 
2667 /* Types of the RF sector (TX,RX) */
2668 enum wmi_rf_sector_type {
2669 	WMI_RF_SECTOR_TYPE_RX	= 0x00,
2670 	WMI_RF_SECTOR_TYPE_TX	= 0x01,
2671 };
2672 
2673 /* Content of RF Sector (six 32-bits registers) */
2674 struct wmi_rf_sector_info {
2675 	/* Phase values for RF Chains[15-0] (2bits per RF chain) */
2676 	__le32 psh_hi;
2677 	/* Phase values for RF Chains[31-16] (2bits per RF chain) */
2678 	__le32 psh_lo;
2679 	/* ETYPE Bit0 for all RF chains[31-0] - bit0 of Edge amplifier gain
2680 	 * index
2681 	 */
2682 	__le32 etype0;
2683 	/* ETYPE Bit1 for all RF chains[31-0] - bit1 of Edge amplifier gain
2684 	 * index
2685 	 */
2686 	__le32 etype1;
2687 	/* ETYPE Bit2 for all RF chains[31-0] - bit2 of Edge amplifier gain
2688 	 * index
2689 	 */
2690 	__le32 etype2;
2691 	/* D-Type values (3bits each) for 8 Distribution amplifiers + X16
2692 	 * switch bits
2693 	 */
2694 	__le32 dtype_swch_off;
2695 } __packed;
2696 
2697 #define WMI_INVALID_RF_SECTOR_INDEX	(0xFFFF)
2698 #define WMI_MAX_RF_MODULES_NUM		(8)
2699 
2700 /* WMI_GET_RF_SECTOR_PARAMS_CMD */
2701 struct wmi_get_rf_sector_params_cmd {
2702 	/* Sector number to be retrieved */
2703 	__le16 sector_idx;
2704 	/* enum wmi_rf_sector_type - type of requested RF sector */
2705 	u8 sector_type;
2706 	/* bitmask vector specifying destination RF modules */
2707 	u8 rf_modules_vec;
2708 } __packed;
2709 
2710 /* \WMI_GET_RF_SECTOR_PARAMS_DONE_EVENT */
2711 struct wmi_get_rf_sector_params_done_event {
2712 	/* result status of WMI_GET_RF_SECTOR_PARAMS_CMD (enum
2713 	 * wmi_rf_sector_status)
2714 	 */
2715 	u8 status;
2716 	/* align next field to U64 boundary */
2717 	u8 reserved[7];
2718 	/* TSF timestamp when RF sectors where retrieved */
2719 	__le64 tsf;
2720 	/* Content of RF sector retrieved from each RF module */
2721 	struct wmi_rf_sector_info sectors_info[WMI_MAX_RF_MODULES_NUM];
2722 } __packed;
2723 
2724 /* WMI_SET_RF_SECTOR_PARAMS_CMD */
2725 struct wmi_set_rf_sector_params_cmd {
2726 	/* Sector number to be retrieved */
2727 	__le16 sector_idx;
2728 	/* enum wmi_rf_sector_type - type of requested RF sector */
2729 	u8 sector_type;
2730 	/* bitmask vector specifying destination RF modules */
2731 	u8 rf_modules_vec;
2732 	/* Content of RF sector to be written to each RF module */
2733 	struct wmi_rf_sector_info sectors_info[WMI_MAX_RF_MODULES_NUM];
2734 } __packed;
2735 
2736 /* \WMI_SET_RF_SECTOR_PARAMS_DONE_EVENT */
2737 struct wmi_set_rf_sector_params_done_event {
2738 	/* result status of WMI_SET_RF_SECTOR_PARAMS_CMD (enum
2739 	 * wmi_rf_sector_status)
2740 	 */
2741 	u8 status;
2742 } __packed;
2743 
2744 /* WMI_GET_SELECTED_RF_SECTOR_INDEX_CMD - Get RF sector index selected by
2745  * TXSS/BRP for communication with specified CID
2746  */
2747 struct wmi_get_selected_rf_sector_index_cmd {
2748 	/* Connection/Station ID in [0:7] range */
2749 	u8 cid;
2750 	/* type of requested RF sector (enum wmi_rf_sector_type) */
2751 	u8 sector_type;
2752 	/* align to U32 boundary */
2753 	u8 reserved[2];
2754 } __packed;
2755 
2756 /* \WMI_GET_SELECTED_RF_SECTOR_INDEX_DONE_EVENT - Returns retrieved RF sector
2757  * index selected by TXSS/BRP for communication with specified CID
2758  */
2759 struct wmi_get_selected_rf_sector_index_done_event {
2760 	/* Retrieved sector index selected in TXSS (for TX sector request) or
2761 	 * BRP (for RX sector request)
2762 	 */
2763 	__le16 sector_idx;
2764 	/* result status of WMI_GET_SELECTED_RF_SECTOR_INDEX_CMD (enum
2765 	 * wmi_rf_sector_status)
2766 	 */
2767 	u8 status;
2768 	/* align next field to U64 boundary */
2769 	u8 reserved[5];
2770 	/* TSF timestamp when result was retrieved */
2771 	__le64 tsf;
2772 } __packed;
2773 
2774 /* WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD - Force RF sector index for
2775  * communication with specified CID. Assumes that TXSS/BRP is disabled by
2776  * other command
2777  */
2778 struct wmi_set_selected_rf_sector_index_cmd {
2779 	/* Connection/Station ID in [0:7] range */
2780 	u8 cid;
2781 	/* type of requested RF sector (enum wmi_rf_sector_type) */
2782 	u8 sector_type;
2783 	/* Forced sector index */
2784 	__le16 sector_idx;
2785 } __packed;
2786 
2787 /* \WMI_SET_SELECTED_RF_SECTOR_INDEX_DONE_EVENT - Success/Fail status for
2788  * WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD
2789  */
2790 struct wmi_set_selected_rf_sector_index_done_event {
2791 	/* result status of WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD (enum
2792 	 * wmi_rf_sector_status)
2793 	 */
2794 	u8 status;
2795 	/* align to U32 boundary */
2796 	u8 reserved[3];
2797 } __packed;
2798 
2799 /* WMI_SET_RF_SECTOR_ON_CMD - Activates specified sector for specified rf
2800  * modules
2801  */
2802 struct wmi_set_rf_sector_on_cmd {
2803 	/* Sector index to be activated */
2804 	__le16 sector_idx;
2805 	/* type of requested RF sector (enum wmi_rf_sector_type) */
2806 	u8 sector_type;
2807 	/* bitmask vector specifying destination RF modules */
2808 	u8 rf_modules_vec;
2809 } __packed;
2810 
2811 /* \WMI_SET_RF_SECTOR_ON_DONE_EVENT - Success/Fail status for
2812  * WMI_SET_RF_SECTOR_ON_CMD
2813  */
2814 struct wmi_set_rf_sector_on_done_event {
2815 	/* result status of WMI_SET_RF_SECTOR_ON_CMD (enum
2816 	 * wmi_rf_sector_status)
2817 	 */
2818 	u8 status;
2819 	/* align to U32 boundary */
2820 	u8 reserved[3];
2821 } __packed;
2822 
2823 enum wmi_sector_sweep_type {
2824 	WMI_SECTOR_SWEEP_TYPE_TXSS		= 0x00,
2825 	WMI_SECTOR_SWEEP_TYPE_BCON		= 0x01,
2826 	WMI_SECTOR_SWEEP_TYPE_TXSS_AND_BCON	= 0x02,
2827 	WMI_SECTOR_SWEEP_TYPE_NUM		= 0x03,
2828 };
2829 
2830 /* WMI_PRIO_TX_SECTORS_ORDER_CMDID
2831  *
2832  * Set the order of TX sectors in TXSS and/or Beacon(AP).
2833  *
2834  * Returned event:
2835  * - WMI_PRIO_TX_SECTORS_ORDER_EVENTID
2836  */
2837 struct wmi_prio_tx_sectors_order_cmd {
2838 	/* tx sectors order to be applied, 0xFF for end of array */
2839 	u8 tx_sectors_priority_array[MAX_NUM_OF_SECTORS];
2840 	/* enum wmi_sector_sweep_type, TXSS and/or Beacon */
2841 	u8 sector_sweep_type;
2842 	/* needed only for TXSS configuration */
2843 	u8 cid;
2844 	/* alignment to 32b */
2845 	u8 reserved[2];
2846 } __packed;
2847 
2848 /* completion status codes */
2849 enum wmi_prio_tx_sectors_cmd_status {
2850 	WMI_PRIO_TX_SECT_CMD_STATUS_SUCCESS	= 0x00,
2851 	WMI_PRIO_TX_SECT_CMD_STATUS_BAD_PARAM	= 0x01,
2852 	/* other error */
2853 	WMI_PRIO_TX_SECT_CMD_STATUS_ERROR	= 0x02,
2854 };
2855 
2856 /* WMI_PRIO_TX_SECTORS_ORDER_EVENTID */
2857 struct wmi_prio_tx_sectors_order_event {
2858 	/* enum wmi_prio_tx_sectors_cmd_status */
2859 	u8 status;
2860 	/* alignment to 32b */
2861 	u8 reserved[3];
2862 } __packed;
2863 
2864 struct wmi_prio_tx_sectors_num_cmd {
2865 	/* [0-128], 0 = No changes */
2866 	u8 beacon_number_of_sectors;
2867 	/* [0-128], 0 = No changes */
2868 	u8 txss_number_of_sectors;
2869 	/* [0-8] needed only for TXSS configuration */
2870 	u8 cid;
2871 } __packed;
2872 
2873 /* WMI_PRIO_TX_SECTORS_NUMBER_CMDID
2874  *
2875  * Set the number of active sectors in TXSS and/or Beacon.
2876  *
2877  * Returned event:
2878  * - WMI_PRIO_TX_SECTORS_NUMBER_EVENTID
2879  */
2880 struct wmi_prio_tx_sectors_number_cmd {
2881 	struct wmi_prio_tx_sectors_num_cmd active_sectors_num;
2882 	/* alignment to 32b */
2883 	u8 reserved;
2884 } __packed;
2885 
2886 /* WMI_PRIO_TX_SECTORS_NUMBER_EVENTID */
2887 struct wmi_prio_tx_sectors_number_event {
2888 	/* enum wmi_prio_tx_sectors_cmd_status */
2889 	u8 status;
2890 	/* alignment to 32b */
2891 	u8 reserved[3];
2892 } __packed;
2893 
2894 /* WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_CMDID
2895  *
2896  * Set default sectors order and number (hard coded in board file)
2897  * in TXSS and/or Beacon.
2898  *
2899  * Returned event:
2900  * - WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID
2901  */
2902 struct wmi_prio_tx_sectors_set_default_cfg_cmd {
2903 	/* enum wmi_sector_sweep_type, TXSS and/or Beacon */
2904 	u8 sector_sweep_type;
2905 	/* needed only for TXSS configuration */
2906 	u8 cid;
2907 	/* alignment to 32b */
2908 	u8 reserved[2];
2909 } __packed;
2910 
2911 /* WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID */
2912 struct wmi_prio_tx_sectors_set_default_cfg_event {
2913 	/* enum wmi_prio_tx_sectors_cmd_status */
2914 	u8 status;
2915 	/* alignment to 32b */
2916 	u8 reserved[3];
2917 } __packed;
2918 
2919 /* WMI_SET_SILENT_RSSI_TABLE_DONE_EVENTID */
2920 struct wmi_set_silent_rssi_table_done_event {
2921 	/* enum wmi_silent_rssi_status */
2922 	__le32 status;
2923 	/* enum wmi_silent_rssi_table */
2924 	__le32 table;
2925 } __packed;
2926 
2927 /* \WMI_COMMAND_NOT_SUPPORTED_EVENTID */
2928 struct wmi_command_not_supported_event {
2929 	/* device id */
2930 	u8 mid;
2931 	u8 reserved0;
2932 	__le16 command_id;
2933 	/* for UT command only, otherwise reserved */
2934 	__le16 command_subtype;
2935 	__le16 reserved1;
2936 } __packed;
2937 
2938 #endif /* __WILOCITY_WMI_H__ */
2939