xref: /linux/drivers/net/wireless/ath/wil6210/wmi.h (revision 80d443e8876602be2c130f79c4de81e12e2a700d)
1 /*
2  * Copyright (c) 2012-2016 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 
40 /* Mailbox interface
41  * used for commands and events
42  */
43 enum wmi_mid {
44 	MID_DEFAULT		= 0x00,
45 	FIRST_DBG_MID_ID	= 0x10,
46 	LAST_DBG_MID_ID		= 0xFE,
47 	MID_BROADCAST		= 0xFF,
48 };
49 
50 /* FW capability IDs
51  * Each ID maps to a bit in a 32-bit bitmask value provided by the FW to
52  * the host
53  */
54 enum wmi_fw_capability {
55 	WMI_FW_CAPABILITY_FTM			= 0,
56 	WMI_FW_CAPABILITY_PS_CONFIG		= 1,
57 	WMI_FW_CAPABILITY_RF_SECTORS		= 2,
58 	WMI_FW_CAPABILITY_MGMT_RETRY_LIMIT	= 3,
59 	WMI_FW_CAPABILITY_MAX,
60 };
61 
62 /* WMI_CMD_HDR */
63 struct wmi_cmd_hdr {
64 	u8 mid;
65 	u8 reserved;
66 	__le16 command_id;
67 	__le32 fw_timestamp;
68 } __packed;
69 
70 /* List of Commands */
71 enum wmi_command_id {
72 	WMI_CONNECT_CMDID				= 0x01,
73 	WMI_DISCONNECT_CMDID				= 0x03,
74 	WMI_DISCONNECT_STA_CMDID			= 0x04,
75 	WMI_START_SCAN_CMDID				= 0x07,
76 	WMI_SET_BSS_FILTER_CMDID			= 0x09,
77 	WMI_SET_PROBED_SSID_CMDID			= 0x0A,
78 	WMI_SET_LISTEN_INT_CMDID			= 0x0B,
79 	WMI_BCON_CTRL_CMDID				= 0x0F,
80 	WMI_ADD_CIPHER_KEY_CMDID			= 0x16,
81 	WMI_DELETE_CIPHER_KEY_CMDID			= 0x17,
82 	WMI_PCP_CONF_CMDID				= 0x18,
83 	WMI_SET_APPIE_CMDID				= 0x3F,
84 	WMI_SET_WSC_STATUS_CMDID			= 0x41,
85 	WMI_PXMT_RANGE_CFG_CMDID			= 0x42,
86 	WMI_PXMT_SNR2_RANGE_CFG_CMDID			= 0x43,
87 	WMI_MEM_READ_CMDID				= 0x800,
88 	WMI_MEM_WR_CMDID				= 0x801,
89 	WMI_ECHO_CMDID					= 0x803,
90 	WMI_DEEP_ECHO_CMDID				= 0x804,
91 	WMI_CONFIG_MAC_CMDID				= 0x805,
92 	WMI_CONFIG_PHY_DEBUG_CMDID			= 0x806,
93 	WMI_ADD_DEBUG_TX_PCKT_CMDID			= 0x808,
94 	WMI_PHY_GET_STATISTICS_CMDID			= 0x809,
95 	WMI_FS_TUNE_CMDID				= 0x80A,
96 	WMI_CORR_MEASURE_CMDID				= 0x80B,
97 	WMI_READ_RSSI_CMDID				= 0x80C,
98 	WMI_TEMP_SENSE_CMDID				= 0x80E,
99 	WMI_DC_CALIB_CMDID				= 0x80F,
100 	WMI_SEND_TONE_CMDID				= 0x810,
101 	WMI_IQ_TX_CALIB_CMDID				= 0x811,
102 	WMI_IQ_RX_CALIB_CMDID				= 0x812,
103 	WMI_SET_UCODE_IDLE_CMDID			= 0x813,
104 	WMI_SET_WORK_MODE_CMDID				= 0x815,
105 	WMI_LO_LEAKAGE_CALIB_CMDID			= 0x816,
106 	WMI_MARLON_R_READ_CMDID				= 0x818,
107 	WMI_MARLON_R_WRITE_CMDID			= 0x819,
108 	WMI_MARLON_R_TXRX_SEL_CMDID			= 0x81A,
109 	MAC_IO_STATIC_PARAMS_CMDID			= 0x81B,
110 	MAC_IO_DYNAMIC_PARAMS_CMDID			= 0x81C,
111 	WMI_SILENT_RSSI_CALIB_CMDID			= 0x81D,
112 	WMI_RF_RX_TEST_CMDID				= 0x81E,
113 	WMI_CFG_RX_CHAIN_CMDID				= 0x820,
114 	WMI_VRING_CFG_CMDID				= 0x821,
115 	WMI_BCAST_VRING_CFG_CMDID			= 0x822,
116 	WMI_VRING_BA_EN_CMDID				= 0x823,
117 	WMI_VRING_BA_DIS_CMDID				= 0x824,
118 	WMI_RCP_ADDBA_RESP_CMDID			= 0x825,
119 	WMI_RCP_DELBA_CMDID				= 0x826,
120 	WMI_SET_SSID_CMDID				= 0x827,
121 	WMI_GET_SSID_CMDID				= 0x828,
122 	WMI_SET_PCP_CHANNEL_CMDID			= 0x829,
123 	WMI_GET_PCP_CHANNEL_CMDID			= 0x82A,
124 	WMI_SW_TX_REQ_CMDID				= 0x82B,
125 	WMI_READ_MAC_RXQ_CMDID				= 0x830,
126 	WMI_READ_MAC_TXQ_CMDID				= 0x831,
127 	WMI_WRITE_MAC_RXQ_CMDID				= 0x832,
128 	WMI_WRITE_MAC_TXQ_CMDID				= 0x833,
129 	WMI_WRITE_MAC_XQ_FIELD_CMDID			= 0x834,
130 	WMI_MLME_PUSH_CMDID				= 0x835,
131 	WMI_BEAMFORMING_MGMT_CMDID			= 0x836,
132 	WMI_BF_TXSS_MGMT_CMDID				= 0x837,
133 	WMI_BF_SM_MGMT_CMDID				= 0x838,
134 	WMI_BF_RXSS_MGMT_CMDID				= 0x839,
135 	WMI_BF_TRIG_CMDID				= 0x83A,
136 	WMI_LINK_MAINTAIN_CFG_WRITE_CMDID		= 0x842,
137 	WMI_LINK_MAINTAIN_CFG_READ_CMDID		= 0x843,
138 	WMI_SET_SECTORS_CMDID				= 0x849,
139 	WMI_MAINTAIN_PAUSE_CMDID			= 0x850,
140 	WMI_MAINTAIN_RESUME_CMDID			= 0x851,
141 	WMI_RS_MGMT_CMDID				= 0x852,
142 	WMI_RF_MGMT_CMDID				= 0x853,
143 	WMI_THERMAL_THROTTLING_CTRL_CMDID		= 0x854,
144 	WMI_THERMAL_THROTTLING_GET_STATUS_CMDID		= 0x855,
145 	WMI_OTP_READ_CMDID				= 0x856,
146 	WMI_OTP_WRITE_CMDID				= 0x857,
147 	WMI_LED_CFG_CMDID				= 0x858,
148 	/* Performance monitoring commands */
149 	WMI_BF_CTRL_CMDID				= 0x862,
150 	WMI_NOTIFY_REQ_CMDID				= 0x863,
151 	WMI_GET_STATUS_CMDID				= 0x864,
152 	WMI_GET_RF_STATUS_CMDID				= 0x866,
153 	WMI_GET_BASEBAND_TYPE_CMDID			= 0x867,
154 	WMI_UNIT_TEST_CMDID				= 0x900,
155 	WMI_HICCUP_CMDID				= 0x901,
156 	WMI_FLASH_READ_CMDID				= 0x902,
157 	WMI_FLASH_WRITE_CMDID				= 0x903,
158 	/* Power management */
159 	WMI_TRAFFIC_DEFERRAL_CMDID			= 0x904,
160 	WMI_TRAFFIC_RESUME_CMDID			= 0x905,
161 	/* P2P */
162 	WMI_P2P_CFG_CMDID				= 0x910,
163 	WMI_PORT_ALLOCATE_CMDID				= 0x911,
164 	WMI_PORT_DELETE_CMDID				= 0x912,
165 	WMI_POWER_MGMT_CFG_CMDID			= 0x913,
166 	WMI_START_LISTEN_CMDID				= 0x914,
167 	WMI_START_SEARCH_CMDID				= 0x915,
168 	WMI_DISCOVERY_START_CMDID			= 0x916,
169 	WMI_DISCOVERY_STOP_CMDID			= 0x917,
170 	WMI_PCP_START_CMDID				= 0x918,
171 	WMI_PCP_STOP_CMDID				= 0x919,
172 	WMI_GET_PCP_FACTOR_CMDID			= 0x91B,
173 	/* Power Save Configuration Commands */
174 	WMI_PS_DEV_PROFILE_CFG_CMDID			= 0x91C,
175 	/* Not supported yet */
176 	WMI_PS_DEV_CFG_CMDID				= 0x91D,
177 	/* Not supported yet */
178 	WMI_PS_DEV_CFG_READ_CMDID			= 0x91E,
179 	/* Per MAC Power Save Configuration commands
180 	 * Not supported yet
181 	 */
182 	WMI_PS_MID_CFG_CMDID				= 0x91F,
183 	/* Not supported yet */
184 	WMI_PS_MID_CFG_READ_CMDID			= 0x920,
185 	WMI_RS_CFG_CMDID				= 0x921,
186 	WMI_GET_DETAILED_RS_RES_CMDID			= 0x922,
187 	WMI_AOA_MEAS_CMDID				= 0x923,
188 	WMI_SET_MGMT_RETRY_LIMIT_CMDID			= 0x930,
189 	WMI_GET_MGMT_RETRY_LIMIT_CMDID			= 0x931,
190 	WMI_TOF_SESSION_START_CMDID			= 0x991,
191 	WMI_TOF_GET_CAPABILITIES_CMDID			= 0x992,
192 	WMI_TOF_SET_LCR_CMDID				= 0x993,
193 	WMI_TOF_SET_LCI_CMDID				= 0x994,
194 	WMI_TOF_CHANNEL_INFO_CMDID			= 0x995,
195 	WMI_TOF_SET_TX_RX_OFFSET_CMDID			= 0x997,
196 	WMI_TOF_GET_TX_RX_OFFSET_CMDID			= 0x998,
197 	WMI_GET_RF_SECTOR_PARAMS_CMDID			= 0x9A0,
198 	WMI_SET_RF_SECTOR_PARAMS_CMDID			= 0x9A1,
199 	WMI_GET_SELECTED_RF_SECTOR_INDEX_CMDID		= 0x9A2,
200 	WMI_SET_SELECTED_RF_SECTOR_INDEX_CMDID		= 0x9A3,
201 	WMI_SET_RF_SECTOR_ON_CMDID			= 0x9A4,
202 	WMI_PRIO_TX_SECTORS_ORDER_CMDID			= 0x9A5,
203 	WMI_PRIO_TX_SECTORS_NUMBER_CMDID		= 0x9A6,
204 	WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_CMDID	= 0x9A7,
205 	WMI_SET_MAC_ADDRESS_CMDID			= 0xF003,
206 	WMI_ABORT_SCAN_CMDID				= 0xF007,
207 	WMI_SET_PROMISCUOUS_MODE_CMDID			= 0xF041,
208 	WMI_GET_PMK_CMDID				= 0xF048,
209 	WMI_SET_PASSPHRASE_CMDID			= 0xF049,
210 	WMI_SEND_ASSOC_RES_CMDID			= 0xF04A,
211 	WMI_SET_ASSOC_REQ_RELAY_CMDID			= 0xF04B,
212 	WMI_MAC_ADDR_REQ_CMDID				= 0xF04D,
213 	WMI_FW_VER_CMDID				= 0xF04E,
214 	WMI_PMC_CMDID					= 0xF04F,
215 };
216 
217 /* WMI_CONNECT_CMDID */
218 enum wmi_network_type {
219 	WMI_NETTYPE_INFRA		= 0x01,
220 	WMI_NETTYPE_ADHOC		= 0x02,
221 	WMI_NETTYPE_ADHOC_CREATOR	= 0x04,
222 	WMI_NETTYPE_AP			= 0x10,
223 	WMI_NETTYPE_P2P			= 0x20,
224 	/* PCIE over 60g */
225 	WMI_NETTYPE_WBE			= 0x40,
226 };
227 
228 enum wmi_dot11_auth_mode {
229 	WMI_AUTH11_OPEN		= 0x01,
230 	WMI_AUTH11_SHARED	= 0x02,
231 	WMI_AUTH11_LEAP		= 0x04,
232 	WMI_AUTH11_WSC		= 0x08,
233 };
234 
235 enum wmi_auth_mode {
236 	WMI_AUTH_NONE		= 0x01,
237 	WMI_AUTH_WPA		= 0x02,
238 	WMI_AUTH_WPA2		= 0x04,
239 	WMI_AUTH_WPA_PSK	= 0x08,
240 	WMI_AUTH_WPA2_PSK	= 0x10,
241 	WMI_AUTH_WPA_CCKM	= 0x20,
242 	WMI_AUTH_WPA2_CCKM	= 0x40,
243 };
244 
245 enum wmi_crypto_type {
246 	WMI_CRYPT_NONE		= 0x01,
247 	WMI_CRYPT_AES_GCMP	= 0x20,
248 };
249 
250 enum wmi_connect_ctrl_flag_bits {
251 	WMI_CONNECT_ASSOC_POLICY_USER		= 0x01,
252 	WMI_CONNECT_SEND_REASSOC		= 0x02,
253 	WMI_CONNECT_IGNORE_WPA_GROUP_CIPHER	= 0x04,
254 	WMI_CONNECT_PROFILE_MATCH_DONE		= 0x08,
255 	WMI_CONNECT_IGNORE_AAC_BEACON		= 0x10,
256 	WMI_CONNECT_CSA_FOLLOW_BSS		= 0x20,
257 	WMI_CONNECT_DO_WPA_OFFLOAD		= 0x40,
258 	WMI_CONNECT_DO_NOT_DEAUTH		= 0x80,
259 };
260 
261 #define WMI_MAX_SSID_LEN	(32)
262 
263 /* WMI_CONNECT_CMDID */
264 struct wmi_connect_cmd {
265 	u8 network_type;
266 	u8 dot11_auth_mode;
267 	u8 auth_mode;
268 	u8 pairwise_crypto_type;
269 	u8 pairwise_crypto_len;
270 	u8 group_crypto_type;
271 	u8 group_crypto_len;
272 	u8 ssid_len;
273 	u8 ssid[WMI_MAX_SSID_LEN];
274 	u8 channel;
275 	u8 reserved0;
276 	u8 bssid[WMI_MAC_LEN];
277 	__le32 ctrl_flags;
278 	u8 dst_mac[WMI_MAC_LEN];
279 	u8 reserved1[2];
280 } __packed;
281 
282 /* WMI_DISCONNECT_STA_CMDID */
283 struct wmi_disconnect_sta_cmd {
284 	u8 dst_mac[WMI_MAC_LEN];
285 	__le16 disconnect_reason;
286 } __packed;
287 
288 #define WMI_MAX_KEY_INDEX	(3)
289 #define WMI_MAX_KEY_LEN		(32)
290 #define WMI_PASSPHRASE_LEN	(64)
291 
292 /* WMI_SET_PASSPHRASE_CMDID */
293 struct wmi_set_passphrase_cmd {
294 	u8 ssid[WMI_MAX_SSID_LEN];
295 	u8 passphrase[WMI_PASSPHRASE_LEN];
296 	u8 ssid_len;
297 	u8 passphrase_len;
298 } __packed;
299 
300 /* WMI_ADD_CIPHER_KEY_CMDID */
301 enum wmi_key_usage {
302 	WMI_KEY_USE_PAIRWISE	= 0x00,
303 	WMI_KEY_USE_RX_GROUP	= 0x01,
304 	WMI_KEY_USE_TX_GROUP	= 0x02,
305 };
306 
307 struct wmi_add_cipher_key_cmd {
308 	u8 key_index;
309 	u8 key_type;
310 	/* enum wmi_key_usage */
311 	u8 key_usage;
312 	u8 key_len;
313 	/* key replay sequence counter */
314 	u8 key_rsc[8];
315 	u8 key[WMI_MAX_KEY_LEN];
316 	/* Additional Key Control information */
317 	u8 key_op_ctrl;
318 	u8 mac[WMI_MAC_LEN];
319 } __packed;
320 
321 /* WMI_DELETE_CIPHER_KEY_CMDID */
322 struct wmi_delete_cipher_key_cmd {
323 	u8 key_index;
324 	u8 mac[WMI_MAC_LEN];
325 } __packed;
326 
327 /* WMI_START_SCAN_CMDID
328  *
329  * Start L1 scan operation
330  *
331  * Returned events:
332  * - WMI_RX_MGMT_PACKET_EVENTID - for every probe resp.
333  * - WMI_SCAN_COMPLETE_EVENTID
334  */
335 enum wmi_scan_type {
336 	WMI_ACTIVE_SCAN		= 0x00,
337 	WMI_SHORT_SCAN		= 0x01,
338 	WMI_PASSIVE_SCAN	= 0x02,
339 	WMI_DIRECT_SCAN		= 0x03,
340 	WMI_LONG_SCAN		= 0x04,
341 };
342 
343 /* WMI_START_SCAN_CMDID */
344 struct wmi_start_scan_cmd {
345 	u8 direct_scan_mac_addr[WMI_MAC_LEN];
346 	/* run scan with discovery beacon. Relevant for ACTIVE scan only. */
347 	u8 discovery_mode;
348 	u8 reserved;
349 	/* Max duration in the home channel(ms) */
350 	__le32 dwell_time;
351 	/* Time interval between scans (ms) */
352 	__le32 force_scan_interval;
353 	/* enum wmi_scan_type */
354 	u8 scan_type;
355 	/* how many channels follow */
356 	u8 num_channels;
357 	/* channels ID's:
358 	 * 0 - 58320 MHz
359 	 * 1 - 60480 MHz
360 	 * 2 - 62640 MHz
361 	 */
362 	struct {
363 		u8 channel;
364 		u8 reserved;
365 	} channel_list[0];
366 } __packed;
367 
368 /* WMI_SET_PROBED_SSID_CMDID */
369 #define MAX_PROBED_SSID_INDEX	(3)
370 
371 enum wmi_ssid_flag {
372 	/* disables entry */
373 	WMI_SSID_FLAG_DISABLE	= 0x00,
374 	/* probes specified ssid */
375 	WMI_SSID_FLAG_SPECIFIC	= 0x01,
376 	/* probes for any ssid */
377 	WMI_SSID_FLAG_ANY	= 0x02,
378 };
379 
380 struct wmi_probed_ssid_cmd {
381 	/* 0 to MAX_PROBED_SSID_INDEX */
382 	u8 entry_index;
383 	/* enum wmi_ssid_flag */
384 	u8 flag;
385 	u8 ssid_len;
386 	u8 ssid[WMI_MAX_SSID_LEN];
387 } __packed;
388 
389 /* WMI_SET_APPIE_CMDID
390  * Add Application specified IE to a management frame
391  */
392 #define WMI_MAX_IE_LEN	(1024)
393 
394 /* Frame Types */
395 enum wmi_mgmt_frame_type {
396 	WMI_FRAME_BEACON	= 0x00,
397 	WMI_FRAME_PROBE_REQ	= 0x01,
398 	WMI_FRAME_PROBE_RESP	= 0x02,
399 	WMI_FRAME_ASSOC_REQ	= 0x03,
400 	WMI_FRAME_ASSOC_RESP	= 0x04,
401 	WMI_NUM_MGMT_FRAME	= 0x05,
402 };
403 
404 struct wmi_set_appie_cmd {
405 	/* enum wmi_mgmt_frame_type */
406 	u8 mgmt_frm_type;
407 	u8 reserved;
408 	/* Length of the IE to be added to MGMT frame */
409 	__le16 ie_len;
410 	u8 ie_info[0];
411 } __packed;
412 
413 /* WMI_PXMT_RANGE_CFG_CMDID */
414 struct wmi_pxmt_range_cfg_cmd {
415 	u8 dst_mac[WMI_MAC_LEN];
416 	__le16 range;
417 } __packed;
418 
419 /* WMI_PXMT_SNR2_RANGE_CFG_CMDID */
420 struct wmi_pxmt_snr2_range_cfg_cmd {
421 	s8 snr2range_arr[2];
422 } __packed;
423 
424 /* WMI_RF_MGMT_CMDID */
425 enum wmi_rf_mgmt_type {
426 	WMI_RF_MGMT_W_DISABLE	= 0x00,
427 	WMI_RF_MGMT_W_ENABLE	= 0x01,
428 	WMI_RF_MGMT_GET_STATUS	= 0x02,
429 };
430 
431 /* WMI_RF_MGMT_CMDID */
432 struct wmi_rf_mgmt_cmd {
433 	__le32 rf_mgmt_type;
434 } __packed;
435 
436 /* WMI_THERMAL_THROTTLING_CTRL_CMDID */
437 #define THERMAL_THROTTLING_USE_DEFAULT_MAX_TXOP_LENGTH	(0xFFFFFFFF)
438 
439 /* WMI_THERMAL_THROTTLING_CTRL_CMDID */
440 struct wmi_thermal_throttling_ctrl_cmd {
441 	__le32 time_on_usec;
442 	__le32 time_off_usec;
443 	__le32 max_txop_length_usec;
444 } __packed;
445 
446 /* WMI_RF_RX_TEST_CMDID */
447 struct wmi_rf_rx_test_cmd {
448 	__le32 sector;
449 } __packed;
450 
451 /* WMI_CORR_MEASURE_CMDID */
452 struct wmi_corr_measure_cmd {
453 	__le32 freq_mhz;
454 	__le32 length_samples;
455 	__le32 iterations;
456 } __packed;
457 
458 /* WMI_SET_SSID_CMDID */
459 struct wmi_set_ssid_cmd {
460 	__le32 ssid_len;
461 	u8 ssid[WMI_MAX_SSID_LEN];
462 } __packed;
463 
464 /* WMI_SET_PCP_CHANNEL_CMDID */
465 struct wmi_set_pcp_channel_cmd {
466 	u8 channel;
467 	u8 reserved[3];
468 } __packed;
469 
470 /* WMI_BCON_CTRL_CMDID */
471 struct wmi_bcon_ctrl_cmd {
472 	__le16 bcon_interval;
473 	__le16 frag_num;
474 	__le64 ss_mask;
475 	u8 network_type;
476 	u8 pcp_max_assoc_sta;
477 	u8 disable_sec_offload;
478 	u8 disable_sec;
479 	u8 hidden_ssid;
480 	u8 is_go;
481 	u8 reserved[2];
482 } __packed;
483 
484 /* WMI_PORT_ALLOCATE_CMDID */
485 enum wmi_port_role {
486 	WMI_PORT_STA		= 0x00,
487 	WMI_PORT_PCP		= 0x01,
488 	WMI_PORT_AP		= 0x02,
489 	WMI_PORT_P2P_DEV	= 0x03,
490 	WMI_PORT_P2P_CLIENT	= 0x04,
491 	WMI_PORT_P2P_GO		= 0x05,
492 };
493 
494 /* WMI_PORT_ALLOCATE_CMDID */
495 struct wmi_port_allocate_cmd {
496 	u8 mac[WMI_MAC_LEN];
497 	u8 port_role;
498 	u8 mid;
499 } __packed;
500 
501 /* WMI_PORT_DELETE_CMDID */
502 struct wmi_port_delete_cmd {
503 	u8 mid;
504 	u8 reserved[3];
505 } __packed;
506 
507 /* WMI_TRAFFIC_DEFERRAL_CMDID */
508 struct wmi_traffic_deferral_cmd {
509 	/* Bit vector: bit[0] - wake on Unicast, bit[1] - wake on Broadcast */
510 	u8 wakeup_trigger;
511 } __packed;
512 
513 /* WMI_P2P_CFG_CMDID */
514 enum wmi_discovery_mode {
515 	WMI_DISCOVERY_MODE_NON_OFFLOAD	= 0x00,
516 	WMI_DISCOVERY_MODE_OFFLOAD	= 0x01,
517 	WMI_DISCOVERY_MODE_PEER2PEER	= 0x02,
518 };
519 
520 struct wmi_p2p_cfg_cmd {
521 	/* enum wmi_discovery_mode */
522 	u8 discovery_mode;
523 	u8 channel;
524 	/* base to listen/search duration calculation */
525 	__le16 bcon_interval;
526 } __packed;
527 
528 /* WMI_POWER_MGMT_CFG_CMDID */
529 enum wmi_power_source_type {
530 	WMI_POWER_SOURCE_BATTERY	= 0x00,
531 	WMI_POWER_SOURCE_OTHER		= 0x01,
532 };
533 
534 struct wmi_power_mgmt_cfg_cmd {
535 	/* enum wmi_power_source_type */
536 	u8 power_source;
537 	u8 reserved[3];
538 } __packed;
539 
540 /* WMI_PCP_START_CMDID */
541 struct wmi_pcp_start_cmd {
542 	__le16 bcon_interval;
543 	u8 pcp_max_assoc_sta;
544 	u8 hidden_ssid;
545 	u8 is_go;
546 	u8 reserved0[7];
547 	u8 network_type;
548 	u8 channel;
549 	u8 disable_sec_offload;
550 	u8 disable_sec;
551 } __packed;
552 
553 /* WMI_SW_TX_REQ_CMDID */
554 struct wmi_sw_tx_req_cmd {
555 	u8 dst_mac[WMI_MAC_LEN];
556 	__le16 len;
557 	u8 payload[0];
558 } __packed;
559 
560 struct wmi_sw_ring_cfg {
561 	__le64 ring_mem_base;
562 	__le16 ring_size;
563 	__le16 max_mpdu_size;
564 } __packed;
565 
566 /* wmi_vring_cfg_schd */
567 struct wmi_vring_cfg_schd {
568 	__le16 priority;
569 	__le16 timeslot_us;
570 } __packed;
571 
572 enum wmi_vring_cfg_encap_trans_type {
573 	WMI_VRING_ENC_TYPE_802_3	= 0x00,
574 	WMI_VRING_ENC_TYPE_NATIVE_WIFI	= 0x01,
575 };
576 
577 enum wmi_vring_cfg_ds_cfg {
578 	WMI_VRING_DS_PBSS	= 0x00,
579 	WMI_VRING_DS_STATION	= 0x01,
580 	WMI_VRING_DS_AP		= 0x02,
581 	WMI_VRING_DS_ADDR4	= 0x03,
582 };
583 
584 enum wmi_vring_cfg_nwifi_ds_trans_type {
585 	WMI_NWIFI_TX_TRANS_MODE_NO		= 0x00,
586 	WMI_NWIFI_TX_TRANS_MODE_AP2PBSS		= 0x01,
587 	WMI_NWIFI_TX_TRANS_MODE_STA2PBSS	= 0x02,
588 };
589 
590 enum wmi_vring_cfg_schd_params_priority {
591 	WMI_SCH_PRIO_REGULAR	= 0x00,
592 	WMI_SCH_PRIO_HIGH	= 0x01,
593 };
594 
595 #define CIDXTID_CID_POS				(0)
596 #define CIDXTID_CID_LEN				(4)
597 #define CIDXTID_CID_MSK				(0xF)
598 #define CIDXTID_TID_POS				(4)
599 #define CIDXTID_TID_LEN				(4)
600 #define CIDXTID_TID_MSK				(0xF0)
601 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_POS	(0)
602 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_LEN	(1)
603 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_MSK	(0x1)
604 #define VRING_CFG_MAC_CTRL_AGGR_EN_POS		(1)
605 #define VRING_CFG_MAC_CTRL_AGGR_EN_LEN		(1)
606 #define VRING_CFG_MAC_CTRL_AGGR_EN_MSK		(0x2)
607 #define VRING_CFG_TO_RESOLUTION_VALUE_POS	(0)
608 #define VRING_CFG_TO_RESOLUTION_VALUE_LEN	(6)
609 #define VRING_CFG_TO_RESOLUTION_VALUE_MSK	(0x3F)
610 
611 struct wmi_vring_cfg {
612 	struct wmi_sw_ring_cfg tx_sw_ring;
613 	/* 0-23 vrings */
614 	u8 ringid;
615 	u8 cidxtid;
616 	u8 encap_trans_type;
617 	/* 802.3 DS cfg */
618 	u8 ds_cfg;
619 	u8 nwifi_ds_trans_type;
620 	u8 mac_ctrl;
621 	u8 to_resolution;
622 	u8 agg_max_wsize;
623 	struct wmi_vring_cfg_schd schd_params;
624 } __packed;
625 
626 enum wmi_vring_cfg_cmd_action {
627 	WMI_VRING_CMD_ADD	= 0x00,
628 	WMI_VRING_CMD_MODIFY	= 0x01,
629 	WMI_VRING_CMD_DELETE	= 0x02,
630 };
631 
632 /* WMI_VRING_CFG_CMDID */
633 struct wmi_vring_cfg_cmd {
634 	__le32 action;
635 	struct wmi_vring_cfg vring_cfg;
636 } __packed;
637 
638 struct wmi_bcast_vring_cfg {
639 	struct wmi_sw_ring_cfg tx_sw_ring;
640 	/* 0-23 vrings */
641 	u8 ringid;
642 	u8 encap_trans_type;
643 	/* 802.3 DS cfg */
644 	u8 ds_cfg;
645 	u8 nwifi_ds_trans_type;
646 } __packed;
647 
648 /* WMI_BCAST_VRING_CFG_CMDID */
649 struct wmi_bcast_vring_cfg_cmd {
650 	__le32 action;
651 	struct wmi_bcast_vring_cfg vring_cfg;
652 } __packed;
653 
654 /* WMI_VRING_BA_EN_CMDID */
655 struct wmi_vring_ba_en_cmd {
656 	u8 ringid;
657 	u8 agg_max_wsize;
658 	__le16 ba_timeout;
659 	u8 amsdu;
660 	u8 reserved[3];
661 } __packed;
662 
663 /* WMI_VRING_BA_DIS_CMDID */
664 struct wmi_vring_ba_dis_cmd {
665 	u8 ringid;
666 	u8 reserved;
667 	__le16 reason;
668 } __packed;
669 
670 /* WMI_NOTIFY_REQ_CMDID */
671 struct wmi_notify_req_cmd {
672 	u8 cid;
673 	u8 year;
674 	u8 month;
675 	u8 day;
676 	__le32 interval_usec;
677 	u8 hour;
678 	u8 minute;
679 	u8 second;
680 	u8 miliseconds;
681 } __packed;
682 
683 /* WMI_CFG_RX_CHAIN_CMDID */
684 enum wmi_sniffer_cfg_mode {
685 	WMI_SNIFFER_OFF	= 0x00,
686 	WMI_SNIFFER_ON	= 0x01,
687 };
688 
689 enum wmi_sniffer_cfg_phy_info_mode {
690 	WMI_SNIFFER_PHY_INFO_DISABLED	= 0x00,
691 	WMI_SNIFFER_PHY_INFO_ENABLED	= 0x01,
692 };
693 
694 enum wmi_sniffer_cfg_phy_support {
695 	WMI_SNIFFER_CP		= 0x00,
696 	WMI_SNIFFER_DP		= 0x01,
697 	WMI_SNIFFER_BOTH_PHYS	= 0x02,
698 };
699 
700 /* wmi_sniffer_cfg */
701 struct wmi_sniffer_cfg {
702 	/* enum wmi_sniffer_cfg_mode */
703 	__le32 mode;
704 	/* enum wmi_sniffer_cfg_phy_info_mode */
705 	__le32 phy_info_mode;
706 	/* enum wmi_sniffer_cfg_phy_support */
707 	__le32 phy_support;
708 	u8 channel;
709 	u8 reserved[3];
710 } __packed;
711 
712 enum wmi_cfg_rx_chain_cmd_action {
713 	WMI_RX_CHAIN_ADD	= 0x00,
714 	WMI_RX_CHAIN_DEL	= 0x01,
715 };
716 
717 enum wmi_cfg_rx_chain_cmd_decap_trans_type {
718 	WMI_DECAP_TYPE_802_3		= 0x00,
719 	WMI_DECAP_TYPE_NATIVE_WIFI	= 0x01,
720 	WMI_DECAP_TYPE_NONE		= 0x02,
721 };
722 
723 enum wmi_cfg_rx_chain_cmd_nwifi_ds_trans_type {
724 	WMI_NWIFI_RX_TRANS_MODE_NO		= 0x00,
725 	WMI_NWIFI_RX_TRANS_MODE_PBSS2AP		= 0x01,
726 	WMI_NWIFI_RX_TRANS_MODE_PBSS2STA	= 0x02,
727 };
728 
729 enum wmi_cfg_rx_chain_cmd_reorder_type {
730 	WMI_RX_HW_REORDER	= 0x00,
731 	WMI_RX_SW_REORDER	= 0x01,
732 };
733 
734 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_POS	(0)
735 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_LEN	(1)
736 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_MSK	(0x1)
737 #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_POS		(1)
738 #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_LEN		(1)
739 #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_MSK		(0x2)
740 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_POS		(0)
741 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_LEN		(1)
742 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_MSK		(0x1)
743 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_POS		(1)
744 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_LEN		(1)
745 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_MSK		(0x2)
746 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_POS			(0)
747 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_LEN			(1)
748 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_MSK			(0x1)
749 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_POS		(1)
750 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_LEN		(1)
751 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_MSK		(0x2)
752 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_POS		(0)
753 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_LEN		(1)
754 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_MSK		(0x1)
755 #define RING_CTRL_OVERRIDE_WB_THRSH_POS			(1)
756 #define RING_CTRL_OVERRIDE_WB_THRSH_LEN			(1)
757 #define RING_CTRL_OVERRIDE_WB_THRSH_MSK			(0x2)
758 #define RING_CTRL_OVERRIDE_ITR_THRSH_POS		(2)
759 #define RING_CTRL_OVERRIDE_ITR_THRSH_LEN		(1)
760 #define RING_CTRL_OVERRIDE_ITR_THRSH_MSK		(0x4)
761 #define RING_CTRL_OVERRIDE_HOST_THRSH_POS		(3)
762 #define RING_CTRL_OVERRIDE_HOST_THRSH_LEN		(1)
763 #define RING_CTRL_OVERRIDE_HOST_THRSH_MSK		(0x8)
764 
765 /* WMI_CFG_RX_CHAIN_CMDID */
766 struct wmi_cfg_rx_chain_cmd {
767 	__le32 action;
768 	struct wmi_sw_ring_cfg rx_sw_ring;
769 	u8 mid;
770 	u8 decap_trans_type;
771 	u8 l2_802_3_offload_ctrl;
772 	u8 l2_nwifi_offload_ctrl;
773 	u8 vlan_id;
774 	u8 nwifi_ds_trans_type;
775 	u8 l3_l4_ctrl;
776 	u8 ring_ctrl;
777 	__le16 prefetch_thrsh;
778 	__le16 wb_thrsh;
779 	__le32 itr_value;
780 	__le16 host_thrsh;
781 	u8 reorder_type;
782 	u8 reserved;
783 	struct wmi_sniffer_cfg sniffer_cfg;
784 	__le16 max_rx_pl_per_desc;
785 } __packed;
786 
787 /* WMI_RCP_ADDBA_RESP_CMDID */
788 struct wmi_rcp_addba_resp_cmd {
789 	u8 cidxtid;
790 	u8 dialog_token;
791 	__le16 status_code;
792 	/* ieee80211_ba_parameterset field to send */
793 	__le16 ba_param_set;
794 	__le16 ba_timeout;
795 } __packed;
796 
797 /* WMI_RCP_DELBA_CMDID */
798 struct wmi_rcp_delba_cmd {
799 	u8 cidxtid;
800 	u8 reserved;
801 	__le16 reason;
802 } __packed;
803 
804 /* WMI_RCP_ADDBA_REQ_CMDID */
805 struct wmi_rcp_addba_req_cmd {
806 	u8 cidxtid;
807 	u8 dialog_token;
808 	/* ieee80211_ba_parameterset field as it received */
809 	__le16 ba_param_set;
810 	__le16 ba_timeout;
811 	/* ieee80211_ba_seqstrl field as it received */
812 	__le16 ba_seq_ctrl;
813 } __packed;
814 
815 /* WMI_SET_MAC_ADDRESS_CMDID */
816 struct wmi_set_mac_address_cmd {
817 	u8 mac[WMI_MAC_LEN];
818 	u8 reserved[2];
819 } __packed;
820 
821 /* WMI_ECHO_CMDID
822  * Check FW is alive
823  * WMI_DEEP_ECHO_CMDID
824  * Check FW and ucode are alive
825  * Returned event: WMI_ECHO_RSP_EVENTID
826  * same event for both commands
827  */
828 struct wmi_echo_cmd {
829 	__le32 value;
830 } __packed;
831 
832 /* WMI_OTP_READ_CMDID */
833 struct wmi_otp_read_cmd {
834 	__le32 addr;
835 	__le32 size;
836 	__le32 values;
837 } __packed;
838 
839 /* WMI_OTP_WRITE_CMDID */
840 struct wmi_otp_write_cmd {
841 	__le32 addr;
842 	__le32 size;
843 	__le32 values;
844 } __packed;
845 
846 /* WMI_TEMP_SENSE_CMDID
847  *
848  * Measure MAC and radio temperatures
849  *
850  * Possible modes for temperature measurement
851  */
852 enum wmi_temperature_measure_mode {
853 	TEMPERATURE_USE_OLD_VALUE	= 0x01,
854 	TEMPERATURE_MEASURE_NOW		= 0x02,
855 };
856 
857 /* WMI_TEMP_SENSE_CMDID */
858 struct wmi_temp_sense_cmd {
859 	__le32 measure_baseband_en;
860 	__le32 measure_rf_en;
861 	__le32 measure_mode;
862 } __packed;
863 
864 enum wmi_pmc_op {
865 	WMI_PMC_ALLOCATE	= 0x00,
866 	WMI_PMC_RELEASE		= 0x01,
867 };
868 
869 /* WMI_PMC_CMDID */
870 struct wmi_pmc_cmd {
871 	/* enum wmi_pmc_cmd_op_type */
872 	u8 op;
873 	u8 reserved;
874 	__le16 ring_size;
875 	__le64 mem_base;
876 } __packed;
877 
878 enum wmi_aoa_meas_type {
879 	WMI_AOA_PHASE_MEAS	= 0x00,
880 	WMI_AOA_PHASE_AMP_MEAS	= 0x01,
881 };
882 
883 /* WMI_AOA_MEAS_CMDID */
884 struct wmi_aoa_meas_cmd {
885 	u8 mac_addr[WMI_MAC_LEN];
886 	/* channels IDs:
887 	 * 0 - 58320 MHz
888 	 * 1 - 60480 MHz
889 	 * 2 - 62640 MHz
890 	 */
891 	u8 channel;
892 	/* enum wmi_aoa_meas_type */
893 	u8 aoa_meas_type;
894 	__le32 meas_rf_mask;
895 } __packed;
896 
897 /* WMI_SET_MGMT_RETRY_LIMIT_CMDID */
898 struct wmi_set_mgmt_retry_limit_cmd {
899 	/* MAC retransmit limit for mgmt frames */
900 	u8 mgmt_retry_limit;
901 	/* alignment to 32b */
902 	u8 reserved[3];
903 } __packed;
904 
905 enum wmi_tof_burst_duration {
906 	WMI_TOF_BURST_DURATION_250_USEC		= 2,
907 	WMI_TOF_BURST_DURATION_500_USEC		= 3,
908 	WMI_TOF_BURST_DURATION_1_MSEC		= 4,
909 	WMI_TOF_BURST_DURATION_2_MSEC		= 5,
910 	WMI_TOF_BURST_DURATION_4_MSEC		= 6,
911 	WMI_TOF_BURST_DURATION_8_MSEC		= 7,
912 	WMI_TOF_BURST_DURATION_16_MSEC		= 8,
913 	WMI_TOF_BURST_DURATION_32_MSEC		= 9,
914 	WMI_TOF_BURST_DURATION_64_MSEC		= 10,
915 	WMI_TOF_BURST_DURATION_128_MSEC		= 11,
916 	WMI_TOF_BURST_DURATION_NO_PREFERENCES	= 15,
917 };
918 
919 enum wmi_tof_session_start_flags {
920 	WMI_TOF_SESSION_START_FLAG_SECURED	= 0x1,
921 	WMI_TOF_SESSION_START_FLAG_ASAP		= 0x2,
922 	WMI_TOF_SESSION_START_FLAG_LCI_REQ	= 0x4,
923 	WMI_TOF_SESSION_START_FLAG_LCR_REQ	= 0x8,
924 };
925 
926 /* WMI_TOF_SESSION_START_CMDID */
927 struct wmi_ftm_dest_info {
928 	u8 channel;
929 	/* wmi_tof_session_start_flags_e */
930 	u8 flags;
931 	u8 initial_token;
932 	u8 num_of_ftm_per_burst;
933 	u8 num_of_bursts_exp;
934 	/* wmi_tof_burst_duration_e */
935 	u8 burst_duration;
936 	/* Burst Period indicate interval between two consecutive burst
937 	 * instances, in units of 100 ms
938 	 */
939 	__le16 burst_period;
940 	u8 dst_mac[WMI_MAC_LEN];
941 	__le16 reserved;
942 } __packed;
943 
944 /* WMI_TOF_SESSION_START_CMDID */
945 struct wmi_tof_session_start_cmd {
946 	__le32 session_id;
947 	u8 num_of_aoa_measures;
948 	u8 aoa_type;
949 	__le16 num_of_dest;
950 	u8 reserved[4];
951 	struct wmi_ftm_dest_info ftm_dest_info[0];
952 } __packed;
953 
954 enum wmi_tof_channel_info_report_type {
955 	WMI_TOF_CHANNEL_INFO_TYPE_CIR			= 0x1,
956 	WMI_TOF_CHANNEL_INFO_TYPE_RSSI			= 0x2,
957 	WMI_TOF_CHANNEL_INFO_TYPE_SNR			= 0x4,
958 	WMI_TOF_CHANNEL_INFO_TYPE_DEBUG_DATA		= 0x8,
959 	WMI_TOF_CHANNEL_INFO_TYPE_VENDOR_SPECIFIC	= 0x10,
960 };
961 
962 /* WMI_TOF_CHANNEL_INFO_CMDID */
963 struct wmi_tof_channel_info_cmd {
964 	/* wmi_tof_channel_info_report_type_e */
965 	__le32 channel_info_report_request;
966 } __packed;
967 
968 /* WMI_TOF_SET_TX_RX_OFFSET_CMDID */
969 struct wmi_tof_set_tx_rx_offset_cmd {
970 	/* TX delay offset */
971 	__le32 tx_offset;
972 	/* RX delay offset */
973 	__le32 rx_offset;
974 	__le32 reserved[2];
975 } __packed;
976 
977 /* WMI Events
978  * List of Events (target to host)
979  */
980 enum wmi_event_id {
981 	WMI_READY_EVENTID				= 0x1001,
982 	WMI_CONNECT_EVENTID				= 0x1002,
983 	WMI_DISCONNECT_EVENTID				= 0x1003,
984 	WMI_SCAN_COMPLETE_EVENTID			= 0x100A,
985 	WMI_REPORT_STATISTICS_EVENTID			= 0x100B,
986 	WMI_RD_MEM_RSP_EVENTID				= 0x1800,
987 	WMI_FW_READY_EVENTID				= 0x1801,
988 	WMI_EXIT_FAST_MEM_ACC_MODE_EVENTID		= 0x200,
989 	WMI_ECHO_RSP_EVENTID				= 0x1803,
990 	WMI_FS_TUNE_DONE_EVENTID			= 0x180A,
991 	WMI_CORR_MEASURE_EVENTID			= 0x180B,
992 	WMI_READ_RSSI_EVENTID				= 0x180C,
993 	WMI_TEMP_SENSE_DONE_EVENTID			= 0x180E,
994 	WMI_DC_CALIB_DONE_EVENTID			= 0x180F,
995 	WMI_IQ_TX_CALIB_DONE_EVENTID			= 0x1811,
996 	WMI_IQ_RX_CALIB_DONE_EVENTID			= 0x1812,
997 	WMI_SET_WORK_MODE_DONE_EVENTID			= 0x1815,
998 	WMI_LO_LEAKAGE_CALIB_DONE_EVENTID		= 0x1816,
999 	WMI_MARLON_R_READ_DONE_EVENTID			= 0x1818,
1000 	WMI_MARLON_R_WRITE_DONE_EVENTID			= 0x1819,
1001 	WMI_MARLON_R_TXRX_SEL_DONE_EVENTID		= 0x181A,
1002 	WMI_SILENT_RSSI_CALIB_DONE_EVENTID		= 0x181D,
1003 	WMI_RF_RX_TEST_DONE_EVENTID			= 0x181E,
1004 	WMI_CFG_RX_CHAIN_DONE_EVENTID			= 0x1820,
1005 	WMI_VRING_CFG_DONE_EVENTID			= 0x1821,
1006 	WMI_BA_STATUS_EVENTID				= 0x1823,
1007 	WMI_RCP_ADDBA_REQ_EVENTID			= 0x1824,
1008 	WMI_RCP_ADDBA_RESP_SENT_EVENTID			= 0x1825,
1009 	WMI_DELBA_EVENTID				= 0x1826,
1010 	WMI_GET_SSID_EVENTID				= 0x1828,
1011 	WMI_GET_PCP_CHANNEL_EVENTID			= 0x182A,
1012 	WMI_SW_TX_COMPLETE_EVENTID			= 0x182B,
1013 	WMI_READ_MAC_RXQ_EVENTID			= 0x1830,
1014 	WMI_READ_MAC_TXQ_EVENTID			= 0x1831,
1015 	WMI_WRITE_MAC_RXQ_EVENTID			= 0x1832,
1016 	WMI_WRITE_MAC_TXQ_EVENTID			= 0x1833,
1017 	WMI_WRITE_MAC_XQ_FIELD_EVENTID			= 0x1834,
1018 	WMI_BEAMFORMING_MGMT_DONE_EVENTID		= 0x1836,
1019 	WMI_BF_TXSS_MGMT_DONE_EVENTID			= 0x1837,
1020 	WMI_BF_RXSS_MGMT_DONE_EVENTID			= 0x1839,
1021 	WMI_RS_MGMT_DONE_EVENTID			= 0x1852,
1022 	WMI_RF_MGMT_STATUS_EVENTID			= 0x1853,
1023 	WMI_THERMAL_THROTTLING_STATUS_EVENTID		= 0x1855,
1024 	WMI_BF_SM_MGMT_DONE_EVENTID			= 0x1838,
1025 	WMI_RX_MGMT_PACKET_EVENTID			= 0x1840,
1026 	WMI_TX_MGMT_PACKET_EVENTID			= 0x1841,
1027 	WMI_LINK_MAINTAIN_CFG_WRITE_DONE_EVENTID	= 0x1842,
1028 	WMI_LINK_MAINTAIN_CFG_READ_DONE_EVENTID		= 0x1843,
1029 	WMI_OTP_READ_RESULT_EVENTID			= 0x1856,
1030 	WMI_LED_CFG_DONE_EVENTID			= 0x1858,
1031 	/* Performance monitoring events */
1032 	WMI_DATA_PORT_OPEN_EVENTID			= 0x1860,
1033 	WMI_WBE_LINK_DOWN_EVENTID			= 0x1861,
1034 	WMI_BF_CTRL_DONE_EVENTID			= 0x1862,
1035 	WMI_NOTIFY_REQ_DONE_EVENTID			= 0x1863,
1036 	WMI_GET_STATUS_DONE_EVENTID			= 0x1864,
1037 	WMI_VRING_EN_EVENTID				= 0x1865,
1038 	WMI_GET_RF_STATUS_EVENTID			= 0x1866,
1039 	WMI_GET_BASEBAND_TYPE_EVENTID			= 0x1867,
1040 	WMI_UNIT_TEST_EVENTID				= 0x1900,
1041 	WMI_FLASH_READ_DONE_EVENTID			= 0x1902,
1042 	WMI_FLASH_WRITE_DONE_EVENTID			= 0x1903,
1043 	/* Power management */
1044 	WMI_TRAFFIC_DEFERRAL_EVENTID			= 0x1904,
1045 	WMI_TRAFFIC_RESUME_EVENTID			= 0x1905,
1046 	/* P2P */
1047 	WMI_P2P_CFG_DONE_EVENTID			= 0x1910,
1048 	WMI_PORT_ALLOCATED_EVENTID			= 0x1911,
1049 	WMI_PORT_DELETED_EVENTID			= 0x1912,
1050 	WMI_LISTEN_STARTED_EVENTID			= 0x1914,
1051 	WMI_SEARCH_STARTED_EVENTID			= 0x1915,
1052 	WMI_DISCOVERY_STARTED_EVENTID			= 0x1916,
1053 	WMI_DISCOVERY_STOPPED_EVENTID			= 0x1917,
1054 	WMI_PCP_STARTED_EVENTID				= 0x1918,
1055 	WMI_PCP_STOPPED_EVENTID				= 0x1919,
1056 	WMI_PCP_FACTOR_EVENTID				= 0x191A,
1057 	/* Power Save Configuration Events */
1058 	WMI_PS_DEV_PROFILE_CFG_EVENTID			= 0x191C,
1059 	/* Not supported yet */
1060 	WMI_PS_DEV_CFG_EVENTID				= 0x191D,
1061 	/* Not supported yet */
1062 	WMI_PS_DEV_CFG_READ_EVENTID			= 0x191E,
1063 	/* Not supported yet */
1064 	WMI_PS_MID_CFG_EVENTID				= 0x191F,
1065 	/* Not supported yet */
1066 	WMI_PS_MID_CFG_READ_EVENTID			= 0x1920,
1067 	WMI_RS_CFG_DONE_EVENTID				= 0x1921,
1068 	WMI_GET_DETAILED_RS_RES_EVENTID			= 0x1922,
1069 	WMI_AOA_MEAS_EVENTID				= 0x1923,
1070 	WMI_SET_MGMT_RETRY_LIMIT_EVENTID		= 0x1930,
1071 	WMI_GET_MGMT_RETRY_LIMIT_EVENTID		= 0x1931,
1072 	WMI_TOF_SESSION_END_EVENTID			= 0x1991,
1073 	WMI_TOF_GET_CAPABILITIES_EVENTID		= 0x1992,
1074 	WMI_TOF_SET_LCR_EVENTID				= 0x1993,
1075 	WMI_TOF_SET_LCI_EVENTID				= 0x1994,
1076 	WMI_TOF_FTM_PER_DEST_RES_EVENTID		= 0x1995,
1077 	WMI_TOF_CHANNEL_INFO_EVENTID			= 0x1996,
1078 	WMI_TOF_SET_TX_RX_OFFSET_EVENTID		= 0x1997,
1079 	WMI_TOF_GET_TX_RX_OFFSET_EVENTID		= 0x1998,
1080 	WMI_GET_RF_SECTOR_PARAMS_DONE_EVENTID		= 0x19A0,
1081 	WMI_SET_RF_SECTOR_PARAMS_DONE_EVENTID		= 0x19A1,
1082 	WMI_GET_SELECTED_RF_SECTOR_INDEX_DONE_EVENTID	= 0x19A2,
1083 	WMI_SET_SELECTED_RF_SECTOR_INDEX_DONE_EVENTID	= 0x19A3,
1084 	WMI_SET_RF_SECTOR_ON_DONE_EVENTID		= 0x19A4,
1085 	WMI_PRIO_TX_SECTORS_ORDER_EVENTID		= 0x19A5,
1086 	WMI_PRIO_TX_SECTORS_NUMBER_EVENTID		= 0x19A6,
1087 	WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID	= 0x19A7,
1088 	WMI_SET_CHANNEL_EVENTID				= 0x9000,
1089 	WMI_ASSOC_REQ_EVENTID				= 0x9001,
1090 	WMI_EAPOL_RX_EVENTID				= 0x9002,
1091 	WMI_MAC_ADDR_RESP_EVENTID			= 0x9003,
1092 	WMI_FW_VER_EVENTID				= 0x9004,
1093 	WMI_ACS_PASSIVE_SCAN_COMPLETE_EVENTID		= 0x9005,
1094 };
1095 
1096 /* Events data structures */
1097 enum wmi_fw_status {
1098 	WMI_FW_STATUS_SUCCESS	= 0x00,
1099 	WMI_FW_STATUS_FAILURE	= 0x01,
1100 };
1101 
1102 /* WMI_RF_MGMT_STATUS_EVENTID */
1103 enum wmi_rf_status {
1104 	WMI_RF_ENABLED		= 0x00,
1105 	WMI_RF_DISABLED_HW	= 0x01,
1106 	WMI_RF_DISABLED_SW	= 0x02,
1107 	WMI_RF_DISABLED_HW_SW	= 0x03,
1108 };
1109 
1110 /* WMI_RF_MGMT_STATUS_EVENTID */
1111 struct wmi_rf_mgmt_status_event {
1112 	__le32 rf_status;
1113 } __packed;
1114 
1115 /* WMI_THERMAL_THROTTLING_STATUS_EVENTID */
1116 struct wmi_thermal_throttling_status_event {
1117 	__le32 time_on_usec;
1118 	__le32 time_off_usec;
1119 	__le32 max_txop_length_usec;
1120 } __packed;
1121 
1122 /* WMI_GET_STATUS_DONE_EVENTID */
1123 struct wmi_get_status_done_event {
1124 	__le32 is_associated;
1125 	u8 cid;
1126 	u8 reserved0[3];
1127 	u8 bssid[WMI_MAC_LEN];
1128 	u8 channel;
1129 	u8 reserved1;
1130 	u8 network_type;
1131 	u8 reserved2[3];
1132 	__le32 ssid_len;
1133 	u8 ssid[WMI_MAX_SSID_LEN];
1134 	__le32 rf_status;
1135 	__le32 is_secured;
1136 } __packed;
1137 
1138 /* WMI_FW_VER_EVENTID */
1139 struct wmi_fw_ver_event {
1140 	/* FW image version */
1141 	__le32 fw_major;
1142 	__le32 fw_minor;
1143 	__le32 fw_subminor;
1144 	__le32 fw_build;
1145 	/* FW image build time stamp */
1146 	__le32 hour;
1147 	__le32 minute;
1148 	__le32 second;
1149 	__le32 day;
1150 	__le32 month;
1151 	__le32 year;
1152 	/* Boot Loader image version */
1153 	__le32 bl_major;
1154 	__le32 bl_minor;
1155 	__le32 bl_subminor;
1156 	__le32 bl_build;
1157 	/* The number of entries in the FW capabilies array */
1158 	u8 fw_capabilities_len;
1159 	u8 reserved[3];
1160 	/* FW capabilities info
1161 	 * Must be the last member of the struct
1162 	 */
1163 	__le32 fw_capabilities[0];
1164 } __packed;
1165 
1166 /* WMI_GET_RF_STATUS_EVENTID */
1167 enum rf_type {
1168 	RF_UNKNOWN	= 0x00,
1169 	RF_MARLON	= 0x01,
1170 	RF_SPARROW	= 0x02,
1171 };
1172 
1173 /* WMI_GET_RF_STATUS_EVENTID */
1174 enum board_file_rf_type {
1175 	BF_RF_MARLON	= 0x00,
1176 	BF_RF_SPARROW	= 0x01,
1177 };
1178 
1179 /* WMI_GET_RF_STATUS_EVENTID */
1180 enum rf_status {
1181 	RF_OK			= 0x00,
1182 	RF_NO_COMM		= 0x01,
1183 	RF_WRONG_BOARD_FILE	= 0x02,
1184 };
1185 
1186 /* WMI_GET_RF_STATUS_EVENTID */
1187 struct wmi_get_rf_status_event {
1188 	/* enum rf_type */
1189 	__le32 rf_type;
1190 	/* attached RFs bit vector */
1191 	__le32 attached_rf_vector;
1192 	/* enabled RFs bit vector */
1193 	__le32 enabled_rf_vector;
1194 	/* enum rf_status, refers to enabled RFs */
1195 	u8 rf_status[32];
1196 	/* enum board file RF type */
1197 	__le32 board_file_rf_type;
1198 	/* board file platform type */
1199 	__le32 board_file_platform_type;
1200 	/* board file version */
1201 	__le32 board_file_version;
1202 	__le32 reserved[2];
1203 } __packed;
1204 
1205 /* WMI_GET_BASEBAND_TYPE_EVENTID */
1206 enum baseband_type {
1207 	BASEBAND_UNKNOWN	= 0x00,
1208 	BASEBAND_SPARROW_M_A0	= 0x03,
1209 	BASEBAND_SPARROW_M_A1	= 0x04,
1210 	BASEBAND_SPARROW_M_B0	= 0x05,
1211 	BASEBAND_SPARROW_M_C0	= 0x06,
1212 	BASEBAND_SPARROW_M_D0	= 0x07,
1213 	BASEBAND_TALYN_M_A0	= 0x08,
1214 };
1215 
1216 /* WMI_GET_BASEBAND_TYPE_EVENTID */
1217 struct wmi_get_baseband_type_event {
1218 	/* enum baseband_type */
1219 	__le32 baseband_type;
1220 } __packed;
1221 
1222 /* WMI_MAC_ADDR_RESP_EVENTID */
1223 struct wmi_mac_addr_resp_event {
1224 	u8 mac[WMI_MAC_LEN];
1225 	u8 auth_mode;
1226 	u8 crypt_mode;
1227 	__le32 offload_mode;
1228 } __packed;
1229 
1230 /* WMI_EAPOL_RX_EVENTID */
1231 struct wmi_eapol_rx_event {
1232 	u8 src_mac[WMI_MAC_LEN];
1233 	__le16 eapol_len;
1234 	u8 eapol[0];
1235 } __packed;
1236 
1237 /* WMI_READY_EVENTID */
1238 enum wmi_phy_capability {
1239 	WMI_11A_CAPABILITY		= 0x01,
1240 	WMI_11G_CAPABILITY		= 0x02,
1241 	WMI_11AG_CAPABILITY		= 0x03,
1242 	WMI_11NA_CAPABILITY		= 0x04,
1243 	WMI_11NG_CAPABILITY		= 0x05,
1244 	WMI_11NAG_CAPABILITY		= 0x06,
1245 	WMI_11AD_CAPABILITY		= 0x07,
1246 	WMI_11N_CAPABILITY_OFFSET	= 0x03,
1247 };
1248 
1249 struct wmi_ready_event {
1250 	__le32 sw_version;
1251 	__le32 abi_version;
1252 	u8 mac[WMI_MAC_LEN];
1253 	/* enum wmi_phy_capability */
1254 	u8 phy_capability;
1255 	u8 numof_additional_mids;
1256 } __packed;
1257 
1258 /* WMI_NOTIFY_REQ_DONE_EVENTID */
1259 struct wmi_notify_req_done_event {
1260 	/* beamforming status, 0: fail; 1: OK; 2: retrying */
1261 	__le32 status;
1262 	__le64 tsf;
1263 	__le32 snr_val;
1264 	__le32 tx_tpt;
1265 	__le32 tx_goodput;
1266 	__le32 rx_goodput;
1267 	__le16 bf_mcs;
1268 	__le16 my_rx_sector;
1269 	__le16 my_tx_sector;
1270 	__le16 other_rx_sector;
1271 	__le16 other_tx_sector;
1272 	__le16 range;
1273 	u8 sqi;
1274 	u8 reserved[3];
1275 } __packed;
1276 
1277 /* WMI_CONNECT_EVENTID */
1278 struct wmi_connect_event {
1279 	u8 channel;
1280 	u8 reserved0;
1281 	u8 bssid[WMI_MAC_LEN];
1282 	__le16 listen_interval;
1283 	__le16 beacon_interval;
1284 	u8 network_type;
1285 	u8 reserved1[3];
1286 	u8 beacon_ie_len;
1287 	u8 assoc_req_len;
1288 	u8 assoc_resp_len;
1289 	u8 cid;
1290 	u8 reserved2[3];
1291 	/* not in use */
1292 	u8 assoc_info[0];
1293 } __packed;
1294 
1295 /* WMI_DISCONNECT_EVENTID */
1296 enum wmi_disconnect_reason {
1297 	WMI_DIS_REASON_NO_NETWORK_AVAIL		= 0x01,
1298 	/* bmiss */
1299 	WMI_DIS_REASON_LOST_LINK		= 0x02,
1300 	WMI_DIS_REASON_DISCONNECT_CMD		= 0x03,
1301 	WMI_DIS_REASON_BSS_DISCONNECTED		= 0x04,
1302 	WMI_DIS_REASON_AUTH_FAILED		= 0x05,
1303 	WMI_DIS_REASON_ASSOC_FAILED		= 0x06,
1304 	WMI_DIS_REASON_NO_RESOURCES_AVAIL	= 0x07,
1305 	WMI_DIS_REASON_CSERV_DISCONNECT		= 0x08,
1306 	WMI_DIS_REASON_INVALID_PROFILE		= 0x0A,
1307 	WMI_DIS_REASON_DOT11H_CHANNEL_SWITCH	= 0x0B,
1308 	WMI_DIS_REASON_PROFILE_MISMATCH		= 0x0C,
1309 	WMI_DIS_REASON_CONNECTION_EVICTED	= 0x0D,
1310 	WMI_DIS_REASON_IBSS_MERGE		= 0x0E,
1311 };
1312 
1313 struct wmi_disconnect_event {
1314 	/* reason code, see 802.11 spec. */
1315 	__le16 protocol_reason_status;
1316 	/* set if known */
1317 	u8 bssid[WMI_MAC_LEN];
1318 	/* see enum wmi_disconnect_reason */
1319 	u8 disconnect_reason;
1320 	/* last assoc req may passed to host - not in used */
1321 	u8 assoc_resp_len;
1322 	/* last assoc req may passed to host - not in used */
1323 	u8 assoc_info[0];
1324 } __packed;
1325 
1326 /* WMI_SCAN_COMPLETE_EVENTID */
1327 enum scan_status {
1328 	WMI_SCAN_SUCCESS	= 0x00,
1329 	WMI_SCAN_FAILED		= 0x01,
1330 	WMI_SCAN_ABORTED	= 0x02,
1331 	WMI_SCAN_REJECTED	= 0x03,
1332 	WMI_SCAN_ABORT_REJECTED	= 0x04,
1333 };
1334 
1335 struct wmi_scan_complete_event {
1336 	/* enum scan_status */
1337 	__le32 status;
1338 } __packed;
1339 
1340 /* WMI_ACS_PASSIVE_SCAN_COMPLETE_EVENT */
1341 enum wmi_acs_info_bitmask {
1342 	WMI_ACS_INFO_BITMASK_BEACON_FOUND	= 0x01,
1343 	WMI_ACS_INFO_BITMASK_BUSY_TIME		= 0x02,
1344 	WMI_ACS_INFO_BITMASK_TX_TIME		= 0x04,
1345 	WMI_ACS_INFO_BITMASK_RX_TIME		= 0x08,
1346 	WMI_ACS_INFO_BITMASK_NOISE		= 0x10,
1347 };
1348 
1349 struct scan_acs_info {
1350 	u8 channel;
1351 	u8 beacon_found;
1352 	/* msec */
1353 	__le16 busy_time;
1354 	__le16 tx_time;
1355 	__le16 rx_time;
1356 	u8 noise;
1357 	u8 reserved[3];
1358 } __packed;
1359 
1360 struct wmi_acs_passive_scan_complete_event {
1361 	__le32 dwell_time;
1362 	/* valid fields within channel info according to
1363 	 * their appearance in struct order
1364 	 */
1365 	__le16 filled;
1366 	u8 num_scanned_channels;
1367 	u8 reserved;
1368 	struct scan_acs_info scan_info_list[0];
1369 } __packed;
1370 
1371 /* WMI_BA_STATUS_EVENTID */
1372 enum wmi_vring_ba_status {
1373 	WMI_BA_AGREED			= 0x00,
1374 	WMI_BA_NON_AGREED		= 0x01,
1375 	/* BA_EN in middle of teardown flow */
1376 	WMI_BA_TD_WIP			= 0x02,
1377 	/* BA_DIS or BA_EN in middle of BA SETUP flow */
1378 	WMI_BA_SETUP_WIP		= 0x03,
1379 	/* BA_EN when the BA session is already active */
1380 	WMI_BA_SESSION_ACTIVE		= 0x04,
1381 	/* BA_DIS when the BA session is not active */
1382 	WMI_BA_SESSION_NOT_ACTIVE	= 0x05,
1383 };
1384 
1385 struct wmi_ba_status_event {
1386 	/* enum wmi_vring_ba_status */
1387 	__le16 status;
1388 	u8 reserved[2];
1389 	u8 ringid;
1390 	u8 agg_wsize;
1391 	__le16 ba_timeout;
1392 	u8 amsdu;
1393 } __packed;
1394 
1395 /* WMI_DELBA_EVENTID */
1396 struct wmi_delba_event {
1397 	u8 cidxtid;
1398 	u8 from_initiator;
1399 	__le16 reason;
1400 } __packed;
1401 
1402 /* WMI_VRING_CFG_DONE_EVENTID */
1403 struct wmi_vring_cfg_done_event {
1404 	u8 ringid;
1405 	u8 status;
1406 	u8 reserved[2];
1407 	__le32 tx_vring_tail_ptr;
1408 } __packed;
1409 
1410 /* WMI_RCP_ADDBA_RESP_SENT_EVENTID */
1411 struct wmi_rcp_addba_resp_sent_event {
1412 	u8 cidxtid;
1413 	u8 reserved;
1414 	__le16 status;
1415 } __packed;
1416 
1417 /* WMI_RCP_ADDBA_REQ_EVENTID */
1418 struct wmi_rcp_addba_req_event {
1419 	u8 cidxtid;
1420 	u8 dialog_token;
1421 	/* ieee80211_ba_parameterset as it received */
1422 	__le16 ba_param_set;
1423 	__le16 ba_timeout;
1424 	/* ieee80211_ba_seqstrl field as it received */
1425 	__le16 ba_seq_ctrl;
1426 } __packed;
1427 
1428 /* WMI_CFG_RX_CHAIN_DONE_EVENTID */
1429 enum wmi_cfg_rx_chain_done_event_status {
1430 	WMI_CFG_RX_CHAIN_SUCCESS	= 0x01,
1431 };
1432 
1433 struct wmi_cfg_rx_chain_done_event {
1434 	/* V-Ring Tail pointer */
1435 	__le32 rx_ring_tail_ptr;
1436 	__le32 status;
1437 } __packed;
1438 
1439 /* WMI_WBE_LINK_DOWN_EVENTID */
1440 enum wmi_wbe_link_down_event_reason {
1441 	WMI_WBE_REASON_USER_REQUEST	= 0x00,
1442 	WMI_WBE_REASON_RX_DISASSOC	= 0x01,
1443 	WMI_WBE_REASON_BAD_PHY_LINK	= 0x02,
1444 };
1445 
1446 /* WMI_WBE_LINK_DOWN_EVENTID */
1447 struct wmi_wbe_link_down_event {
1448 	u8 cid;
1449 	u8 reserved[3];
1450 	__le32 reason;
1451 } __packed;
1452 
1453 /* WMI_DATA_PORT_OPEN_EVENTID */
1454 struct wmi_data_port_open_event {
1455 	u8 cid;
1456 	u8 reserved[3];
1457 } __packed;
1458 
1459 /* WMI_VRING_EN_EVENTID */
1460 struct wmi_vring_en_event {
1461 	u8 vring_index;
1462 	u8 reserved[3];
1463 } __packed;
1464 
1465 /* WMI_GET_PCP_CHANNEL_EVENTID */
1466 struct wmi_get_pcp_channel_event {
1467 	u8 channel;
1468 	u8 reserved[3];
1469 } __packed;
1470 
1471 /* WMI_P2P_CFG_DONE_EVENTID */
1472 struct wmi_p2p_cfg_done_event {
1473 	/* wmi_fw_status */
1474 	u8 status;
1475 	u8 reserved[3];
1476 } __packed;
1477 
1478 /* WMI_PORT_ALLOCATED_EVENTID */
1479 struct wmi_port_allocated_event {
1480 	/* wmi_fw_status */
1481 	u8 status;
1482 	u8 reserved[3];
1483 } __packed;
1484 
1485 /* WMI_PORT_DELETED_EVENTID */
1486 struct wmi_port_deleted_event {
1487 	/* wmi_fw_status */
1488 	u8 status;
1489 	u8 reserved[3];
1490 } __packed;
1491 
1492 /* WMI_LISTEN_STARTED_EVENTID */
1493 struct wmi_listen_started_event {
1494 	/* wmi_fw_status */
1495 	u8 status;
1496 	u8 reserved[3];
1497 } __packed;
1498 
1499 /* WMI_SEARCH_STARTED_EVENTID */
1500 struct wmi_search_started_event {
1501 	/* wmi_fw_status */
1502 	u8 status;
1503 	u8 reserved[3];
1504 } __packed;
1505 
1506 /* WMI_PCP_STARTED_EVENTID */
1507 struct wmi_pcp_started_event {
1508 	/* wmi_fw_status */
1509 	u8 status;
1510 	u8 reserved[3];
1511 } __packed;
1512 
1513 /* WMI_PCP_FACTOR_EVENTID */
1514 struct wmi_pcp_factor_event {
1515 	__le32 pcp_factor;
1516 } __packed;
1517 
1518 enum wmi_sw_tx_status {
1519 	WMI_TX_SW_STATUS_SUCCESS		= 0x00,
1520 	WMI_TX_SW_STATUS_FAILED_NO_RESOURCES	= 0x01,
1521 	WMI_TX_SW_STATUS_FAILED_TX		= 0x02,
1522 };
1523 
1524 /* WMI_SW_TX_COMPLETE_EVENTID */
1525 struct wmi_sw_tx_complete_event {
1526 	/* enum wmi_sw_tx_status */
1527 	u8 status;
1528 	u8 reserved[3];
1529 } __packed;
1530 
1531 /* WMI_CORR_MEASURE_EVENTID */
1532 struct wmi_corr_measure_event {
1533 	/* signed */
1534 	__le32 i;
1535 	/* signed */
1536 	__le32 q;
1537 	/* signed */
1538 	__le32 image_i;
1539 	/* signed */
1540 	__le32 image_q;
1541 } __packed;
1542 
1543 /* WMI_READ_RSSI_EVENTID */
1544 struct wmi_read_rssi_event {
1545 	__le32 ina_rssi_adc_dbm;
1546 } __packed;
1547 
1548 /* WMI_GET_SSID_EVENTID */
1549 struct wmi_get_ssid_event {
1550 	__le32 ssid_len;
1551 	u8 ssid[WMI_MAX_SSID_LEN];
1552 } __packed;
1553 
1554 /* wmi_rx_mgmt_info */
1555 struct wmi_rx_mgmt_info {
1556 	u8 mcs;
1557 	s8 snr;
1558 	u8 range;
1559 	u8 sqi;
1560 	__le16 stype;
1561 	__le16 status;
1562 	__le32 len;
1563 	/* Not resolved when == 0xFFFFFFFF  ==> Broadcast to all MIDS */
1564 	u8 qid;
1565 	/* Not resolved when == 0xFFFFFFFF  ==> Broadcast to all MIDS */
1566 	u8 mid;
1567 	u8 cid;
1568 	/* From Radio MNGR */
1569 	u8 channel;
1570 } __packed;
1571 
1572 /* wmi_otp_read_write_cmd */
1573 struct wmi_otp_read_write_cmd {
1574 	__le32 addr;
1575 	__le32 size;
1576 	u8 values[0];
1577 } __packed;
1578 
1579 /* WMI_OTP_READ_RESULT_EVENTID */
1580 struct wmi_otp_read_result_event {
1581 	u8 payload[0];
1582 } __packed;
1583 
1584 /* WMI_TX_MGMT_PACKET_EVENTID */
1585 struct wmi_tx_mgmt_packet_event {
1586 	u8 payload[0];
1587 } __packed;
1588 
1589 /* WMI_RX_MGMT_PACKET_EVENTID */
1590 struct wmi_rx_mgmt_packet_event {
1591 	struct wmi_rx_mgmt_info info;
1592 	u8 payload[0];
1593 } __packed;
1594 
1595 /* WMI_ECHO_RSP_EVENTID */
1596 struct wmi_echo_rsp_event {
1597 	__le32 echoed_value;
1598 } __packed;
1599 
1600 /* WMI_TEMP_SENSE_DONE_EVENTID
1601  *
1602  * Measure MAC and radio temperatures
1603  */
1604 struct wmi_temp_sense_done_event {
1605 	/* Temperature times 1000 (actual temperature will be achieved by
1606 	 * dividing the value by 1000)
1607 	 */
1608 	__le32 baseband_t1000;
1609 	/* Temperature times 1000 (actual temperature will be achieved by
1610 	 * dividing the value by 1000)
1611 	 */
1612 	__le32 rf_t1000;
1613 } __packed;
1614 
1615 #define WMI_SCAN_DWELL_TIME_MS	(100)
1616 #define WMI_SURVEY_TIMEOUT_MS	(10000)
1617 
1618 enum wmi_hidden_ssid {
1619 	WMI_HIDDEN_SSID_DISABLED	= 0x00,
1620 	WMI_HIDDEN_SSID_SEND_EMPTY	= 0x10,
1621 	WMI_HIDDEN_SSID_CLEAR		= 0xFE,
1622 };
1623 
1624 /* WMI_LED_CFG_CMDID
1625  *
1626  * Configure LED On\Off\Blinking operation
1627  *
1628  * Returned events:
1629  * - WMI_LED_CFG_DONE_EVENTID
1630  */
1631 enum led_mode {
1632 	LED_DISABLE	= 0x00,
1633 	LED_ENABLE	= 0x01,
1634 };
1635 
1636 /* The names of the led as
1637  * described on HW schemes.
1638  */
1639 enum wmi_led_id {
1640 	WMI_LED_WLAN	= 0x00,
1641 	WMI_LED_WPAN	= 0x01,
1642 	WMI_LED_WWAN	= 0x02,
1643 };
1644 
1645 /* Led polarity mode. */
1646 enum wmi_led_polarity {
1647 	LED_POLARITY_HIGH_ACTIVE	= 0x00,
1648 	LED_POLARITY_LOW_ACTIVE		= 0x01,
1649 };
1650 
1651 /* Combination of on and off
1652  * creates the blinking period
1653  */
1654 struct wmi_led_blink_mode {
1655 	__le32 blink_on;
1656 	__le32 blink_off;
1657 } __packed;
1658 
1659 /* WMI_LED_CFG_CMDID */
1660 struct wmi_led_cfg_cmd {
1661 	/* enum led_mode_e */
1662 	u8 led_mode;
1663 	/* enum wmi_led_id_e */
1664 	u8 id;
1665 	/* slow speed blinking combination */
1666 	struct wmi_led_blink_mode slow_blink_cfg;
1667 	/* medium speed blinking combination */
1668 	struct wmi_led_blink_mode medium_blink_cfg;
1669 	/* high speed blinking combination */
1670 	struct wmi_led_blink_mode fast_blink_cfg;
1671 	/* polarity of the led */
1672 	u8 led_polarity;
1673 	/* reserved */
1674 	u8 reserved;
1675 } __packed;
1676 
1677 /* WMI_LED_CFG_DONE_EVENTID */
1678 struct wmi_led_cfg_done_event {
1679 	/* led config status */
1680 	__le32 status;
1681 } __packed;
1682 
1683 #define WMI_NUM_MCS	(13)
1684 
1685 /* Rate search parameters configuration per connection */
1686 struct wmi_rs_cfg {
1687 	/* The maximal allowed PER for each MCS
1688 	 * MCS will be considered as failed if PER during RS is higher
1689 	 */
1690 	u8 per_threshold[WMI_NUM_MCS];
1691 	/* Number of MPDUs for each MCS
1692 	 * this is the minimal statistic required to make an educated
1693 	 * decision
1694 	 */
1695 	u8 min_frame_cnt[WMI_NUM_MCS];
1696 	/* stop threshold [0-100] */
1697 	u8 stop_th;
1698 	/* MCS1 stop threshold [0-100] */
1699 	u8 mcs1_fail_th;
1700 	u8 max_back_failure_th;
1701 	/* Debug feature for disabling internal RS trigger (which is
1702 	 * currently triggered by BF Done)
1703 	 */
1704 	u8 dbg_disable_internal_trigger;
1705 	__le32 back_failure_mask;
1706 	__le32 mcs_en_vec;
1707 } __packed;
1708 
1709 /* WMI_RS_CFG_CMDID */
1710 struct wmi_rs_cfg_cmd {
1711 	/* connection id */
1712 	u8 cid;
1713 	/* enable or disable rate search */
1714 	u8 rs_enable;
1715 	/* rate search configuration */
1716 	struct wmi_rs_cfg rs_cfg;
1717 } __packed;
1718 
1719 /* WMI_RS_CFG_DONE_EVENTID */
1720 struct wmi_rs_cfg_done_event {
1721 	u8 cid;
1722 	/* enum wmi_fw_status */
1723 	u8 status;
1724 	u8 reserved[2];
1725 } __packed;
1726 
1727 /* WMI_GET_DETAILED_RS_RES_CMDID */
1728 struct wmi_get_detailed_rs_res_cmd {
1729 	/* connection id */
1730 	u8 cid;
1731 	u8 reserved[3];
1732 } __packed;
1733 
1734 /* RS results status */
1735 enum wmi_rs_results_status {
1736 	WMI_RS_RES_VALID	= 0x00,
1737 	WMI_RS_RES_INVALID	= 0x01,
1738 };
1739 
1740 /* Rate search results */
1741 struct wmi_rs_results {
1742 	/* number of sent MPDUs */
1743 	u8 num_of_tx_pkt[WMI_NUM_MCS];
1744 	/* number of non-acked MPDUs */
1745 	u8 num_of_non_acked_pkt[WMI_NUM_MCS];
1746 	/* RS timestamp */
1747 	__le32 tsf;
1748 	/* RS selected MCS */
1749 	u8 mcs;
1750 } __packed;
1751 
1752 /* WMI_GET_DETAILED_RS_RES_EVENTID */
1753 struct wmi_get_detailed_rs_res_event {
1754 	u8 cid;
1755 	/* enum wmi_rs_results_status */
1756 	u8 status;
1757 	/* detailed rs results */
1758 	struct wmi_rs_results rs_results;
1759 	u8 reserved[3];
1760 } __packed;
1761 
1762 /* broadcast connection ID */
1763 #define WMI_LINK_MAINTAIN_CFG_CID_BROADCAST	(0xFFFFFFFF)
1764 
1765 /* Types wmi_link_maintain_cfg presets for WMI_LINK_MAINTAIN_CFG_WRITE_CMD */
1766 enum wmi_link_maintain_cfg_type {
1767 	/* AP/PCP default normal (non-FST) configuration settings */
1768 	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_NORMAL_AP	= 0x00,
1769 	/* AP/PCP  default FST configuration settings */
1770 	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_FST_AP	= 0x01,
1771 	/* STA default normal (non-FST) configuration settings */
1772 	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_NORMAL_STA	= 0x02,
1773 	/* STA default FST configuration settings */
1774 	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_FST_STA	= 0x03,
1775 	/* custom configuration settings */
1776 	WMI_LINK_MAINTAIN_CFG_TYPE_CUSTOM		= 0x04,
1777 	/* number of defined configuration types */
1778 	WMI_LINK_MAINTAIN_CFG_TYPES_NUM			= 0x05,
1779 };
1780 
1781 /* Response status codes for WMI_LINK_MAINTAIN_CFG_WRITE/READ commands */
1782 enum wmi_link_maintain_cfg_response_status {
1783 	/* WMI_LINK_MAINTAIN_CFG_WRITE/READ command successfully accomplished
1784 	 */
1785 	WMI_LINK_MAINTAIN_CFG_RESPONSE_STATUS_OK		= 0x00,
1786 	/* ERROR due to bad argument in WMI_LINK_MAINTAIN_CFG_WRITE/READ
1787 	 * command request
1788 	 */
1789 	WMI_LINK_MAINTAIN_CFG_RESPONSE_STATUS_BAD_ARGUMENT	= 0x01,
1790 };
1791 
1792 /* Link Loss and Keep Alive configuration */
1793 struct wmi_link_maintain_cfg {
1794 	/* link_loss_enable_detectors_vec */
1795 	__le32 link_loss_enable_detectors_vec;
1796 	/* detectors check period usec */
1797 	__le32 check_link_loss_period_usec;
1798 	/* max allowed tx ageing */
1799 	__le32 tx_ageing_threshold_usec;
1800 	/* keep alive period for high SNR */
1801 	__le32 keep_alive_period_usec_high_snr;
1802 	/* keep alive period for low SNR */
1803 	__le32 keep_alive_period_usec_low_snr;
1804 	/* lower snr limit for keep alive period update */
1805 	__le32 keep_alive_snr_threshold_low_db;
1806 	/* upper snr limit for keep alive period update */
1807 	__le32 keep_alive_snr_threshold_high_db;
1808 	/* num of successive bad bcons causing link-loss */
1809 	__le32 bad_beacons_num_threshold;
1810 	/* SNR limit for bad_beacons_detector */
1811 	__le32 bad_beacons_snr_threshold_db;
1812 } __packed;
1813 
1814 /* WMI_LINK_MAINTAIN_CFG_WRITE_CMDID */
1815 struct wmi_link_maintain_cfg_write_cmd {
1816 	/* enum wmi_link_maintain_cfg_type_e - type of requested default
1817 	 * configuration to be applied
1818 	 */
1819 	__le32 cfg_type;
1820 	/* requested connection ID or WMI_LINK_MAINTAIN_CFG_CID_BROADCAST */
1821 	__le32 cid;
1822 	/* custom configuration settings to be applied (relevant only if
1823 	 * cfg_type==WMI_LINK_MAINTAIN_CFG_TYPE_CUSTOM)
1824 	 */
1825 	struct wmi_link_maintain_cfg lm_cfg;
1826 } __packed;
1827 
1828 /* WMI_LINK_MAINTAIN_CFG_READ_CMDID */
1829 struct wmi_link_maintain_cfg_read_cmd {
1830 	/* connection ID which configuration settings are requested */
1831 	__le32 cid;
1832 } __packed;
1833 
1834 /* WMI_LINK_MAINTAIN_CFG_WRITE_DONE_EVENTID */
1835 struct wmi_link_maintain_cfg_write_done_event {
1836 	/* requested connection ID */
1837 	__le32 cid;
1838 	/* wmi_link_maintain_cfg_response_status_e - write status */
1839 	__le32 status;
1840 } __packed;
1841 
1842 /* \WMI_LINK_MAINTAIN_CFG_READ_DONE_EVENT */
1843 struct wmi_link_maintain_cfg_read_done_event {
1844 	/* requested connection ID */
1845 	__le32 cid;
1846 	/* wmi_link_maintain_cfg_response_status_e - read status */
1847 	__le32 status;
1848 	/* Retrieved configuration settings */
1849 	struct wmi_link_maintain_cfg lm_cfg;
1850 } __packed;
1851 
1852 enum wmi_traffic_deferral_status {
1853 	WMI_TRAFFIC_DEFERRAL_APPROVED	= 0x0,
1854 	WMI_TRAFFIC_DEFERRAL_REJECTED	= 0x1,
1855 };
1856 
1857 /* WMI_TRAFFIC_DEFERRAL_EVENTID */
1858 struct wmi_traffic_deferral_event {
1859 	/* enum wmi_traffic_deferral_status_e */
1860 	u8 status;
1861 } __packed;
1862 
1863 enum wmi_traffic_resume_status {
1864 	WMI_TRAFFIC_RESUME_SUCCESS	= 0x0,
1865 	WMI_TRAFFIC_RESUME_FAILED	= 0x1,
1866 };
1867 
1868 /* WMI_TRAFFIC_RESUME_EVENTID */
1869 struct wmi_traffic_resume_event {
1870 	/* enum wmi_traffic_resume_status_e */
1871 	u8 status;
1872 } __packed;
1873 
1874 /* Power Save command completion status codes */
1875 enum wmi_ps_cfg_cmd_status {
1876 	WMI_PS_CFG_CMD_STATUS_SUCCESS	= 0x00,
1877 	WMI_PS_CFG_CMD_STATUS_BAD_PARAM	= 0x01,
1878 	/* other error */
1879 	WMI_PS_CFG_CMD_STATUS_ERROR	= 0x02,
1880 };
1881 
1882 /* Device Power Save Profiles */
1883 enum wmi_ps_profile_type {
1884 	WMI_PS_PROFILE_TYPE_DEFAULT		= 0x00,
1885 	WMI_PS_PROFILE_TYPE_PS_DISABLED		= 0x01,
1886 	WMI_PS_PROFILE_TYPE_MAX_PS		= 0x02,
1887 	WMI_PS_PROFILE_TYPE_LOW_LATENCY_PS	= 0x03,
1888 };
1889 
1890 /* WMI_PS_DEV_PROFILE_CFG_CMDID
1891  *
1892  * Power save profile to be used by the device
1893  *
1894  * Returned event:
1895  * - WMI_PS_DEV_PROFILE_CFG_EVENTID
1896  */
1897 struct wmi_ps_dev_profile_cfg_cmd {
1898 	/* wmi_ps_profile_type_e */
1899 	u8 ps_profile;
1900 	u8 reserved[3];
1901 } __packed;
1902 
1903 /* WMI_PS_DEV_PROFILE_CFG_EVENTID */
1904 struct wmi_ps_dev_profile_cfg_event {
1905 	/* wmi_ps_cfg_cmd_status_e */
1906 	__le32 status;
1907 } __packed;
1908 
1909 enum wmi_ps_level {
1910 	WMI_PS_LEVEL_DEEP_SLEEP		= 0x00,
1911 	WMI_PS_LEVEL_SHALLOW_SLEEP	= 0x01,
1912 	/* awake = all PS mechanisms are disabled */
1913 	WMI_PS_LEVEL_AWAKE		= 0x02,
1914 };
1915 
1916 enum wmi_ps_deep_sleep_clk_level {
1917 	/* 33k */
1918 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_RTC		= 0x00,
1919 	/* 10k */
1920 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_OSC		= 0x01,
1921 	/* @RTC Low latency */
1922 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_RTC_LT	= 0x02,
1923 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_XTAL	= 0x03,
1924 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_SYSCLK	= 0x04,
1925 	/* Not Applicable */
1926 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_N_A		= 0xFF,
1927 };
1928 
1929 /* Response by the FW to a D3 entry request */
1930 enum wmi_ps_d3_resp_policy {
1931 	WMI_PS_D3_RESP_POLICY_DEFAULT	= 0x00,
1932 	/* debug -D3 req is always denied */
1933 	WMI_PS_D3_RESP_POLICY_DENIED	= 0x01,
1934 	/* debug -D3 req is always approved */
1935 	WMI_PS_D3_RESP_POLICY_APPROVED	= 0x02,
1936 };
1937 
1938 /* Device common power save configurations */
1939 struct wmi_ps_dev_cfg {
1940 	/* lowest level of PS allowed while unassociated, enum wmi_ps_level_e
1941 	 */
1942 	u8 ps_unassoc_min_level;
1943 	/* lowest deep sleep clock level while nonassoc, enum
1944 	 * wmi_ps_deep_sleep_clk_level_e
1945 	 */
1946 	u8 ps_unassoc_deep_sleep_min_level;
1947 	/* lowest level of PS allowed while associated, enum wmi_ps_level_e */
1948 	u8 ps_assoc_min_level;
1949 	/* lowest deep sleep clock level while assoc, enum
1950 	 * wmi_ps_deep_sleep_clk_level_e
1951 	 */
1952 	u8 ps_assoc_deep_sleep_min_level;
1953 	/* enum wmi_ps_deep_sleep_clk_level_e */
1954 	u8 ps_assoc_low_latency_ds_min_level;
1955 	/* enum wmi_ps_d3_resp_policy_e */
1956 	u8 ps_D3_response_policy;
1957 	/* BOOL */
1958 	u8 ps_D3_pm_pme_enabled;
1959 	/* BOOL */
1960 	u8 ps_halp_enable;
1961 	u8 ps_deep_sleep_enter_thresh_msec;
1962 	/* BOOL */
1963 	u8 ps_voltage_scaling_en;
1964 } __packed;
1965 
1966 /* WMI_PS_DEV_CFG_CMDID
1967  *
1968  * Configure common Power Save parameters of the device and all MIDs.
1969  *
1970  * Returned event:
1971  * - WMI_PS_DEV_CFG_EVENTID
1972  */
1973 struct wmi_ps_dev_cfg_cmd {
1974 	/* Device Power Save configuration to be applied */
1975 	struct wmi_ps_dev_cfg ps_dev_cfg;
1976 	/* alignment to 32b */
1977 	u8 reserved[2];
1978 } __packed;
1979 
1980 /* WMI_PS_DEV_CFG_EVENTID */
1981 struct wmi_ps_dev_cfg_event {
1982 	/* wmi_ps_cfg_cmd_status_e */
1983 	__le32 status;
1984 } __packed;
1985 
1986 /* WMI_PS_DEV_CFG_READ_CMDID
1987  *
1988  * request to retrieve  device Power Save configuration
1989  * (WMI_PS_DEV_CFG_CMD params)
1990  *
1991  * Returned event:
1992  * - WMI_PS_DEV_CFG_READ_EVENTID
1993  */
1994 struct wmi_ps_dev_cfg_read_cmd {
1995 	__le32 reserved;
1996 } __packed;
1997 
1998 /* WMI_PS_DEV_CFG_READ_EVENTID */
1999 struct wmi_ps_dev_cfg_read_event {
2000 	/* wmi_ps_cfg_cmd_status_e */
2001 	__le32 status;
2002 	/* Retrieved device Power Save configuration (WMI_PS_DEV_CFG_CMD
2003 	 * params)
2004 	 */
2005 	struct wmi_ps_dev_cfg dev_ps_cfg;
2006 	/* alignment to 32b */
2007 	u8 reserved[2];
2008 } __packed;
2009 
2010 /* Per Mac Power Save configurations */
2011 struct wmi_ps_mid_cfg {
2012 	/* Low power RX in BTI is enabled, BOOL */
2013 	u8 beacon_lprx_enable;
2014 	/* Sync to sector ID enabled, BOOL */
2015 	u8 beacon_sync_to_sectorId_enable;
2016 	/* Low power RX in DTI is enabled, BOOL */
2017 	u8 frame_exchange_lprx_enable;
2018 	/* Sleep Cycle while in scheduled PS, 1-31 */
2019 	u8 scheduled_sleep_cycle_pow2;
2020 	/* Stay Awake for k BIs every (sleep_cycle - k) BIs, 1-31 */
2021 	u8 scheduled_num_of_awake_bis;
2022 	u8 am_to_traffic_load_thresh_mbp;
2023 	u8 traffic_to_am_load_thresh_mbps;
2024 	u8 traffic_to_am_num_of_no_traffic_bis;
2025 	/* BOOL */
2026 	u8 continuous_traffic_psm;
2027 	__le16 no_traffic_to_min_usec;
2028 	__le16 no_traffic_to_max_usec;
2029 	__le16 snoozing_sleep_interval_milisec;
2030 	u8 max_no_data_awake_events;
2031 	/* Trigger WEB after k failed beacons */
2032 	u8 num_of_failed_beacons_rx_to_trigger_web;
2033 	/* Trigger BF after k failed beacons */
2034 	u8 num_of_failed_beacons_rx_to_trigger_bf;
2035 	/* Trigger SOB after k successful beacons */
2036 	u8 num_of_successful_beacons_rx_to_trigger_sob;
2037 } __packed;
2038 
2039 /* WMI_PS_MID_CFG_CMDID
2040  *
2041  * Configure Power Save parameters of a specific MID.
2042  * These parameters are relevant for the specific BSS this MID belongs to.
2043  *
2044  * Returned event:
2045  * - WMI_PS_MID_CFG_EVENTID
2046  */
2047 struct wmi_ps_mid_cfg_cmd {
2048 	/* MAC ID */
2049 	u8 mid;
2050 	/* mid PS configuration to be applied */
2051 	struct wmi_ps_mid_cfg ps_mid_cfg;
2052 } __packed;
2053 
2054 /* WMI_PS_MID_CFG_EVENTID */
2055 struct wmi_ps_mid_cfg_event {
2056 	/* MAC ID */
2057 	u8 mid;
2058 	/* alignment to 32b */
2059 	u8 reserved[3];
2060 	/* wmi_ps_cfg_cmd_status_e */
2061 	__le32 status;
2062 } __packed;
2063 
2064 /* WMI_PS_MID_CFG_READ_CMDID
2065  *
2066  * request to retrieve Power Save configuration of mid
2067  * (WMI_PS_MID_CFG_CMD params)
2068  *
2069  * Returned event:
2070  * - WMI_PS_MID_CFG_READ_EVENTID
2071  */
2072 struct wmi_ps_mid_cfg_read_cmd {
2073 	/* MAC ID */
2074 	u8 mid;
2075 	/* alignment to 32b */
2076 	u8 reserved[3];
2077 } __packed;
2078 
2079 /* WMI_PS_MID_CFG_READ_EVENTID */
2080 struct wmi_ps_mid_cfg_read_event {
2081 	/* MAC ID */
2082 	u8 mid;
2083 	/* Retrieved MID Power Save configuration(WMI_PS_MID_CFG_CMD params) */
2084 	struct wmi_ps_mid_cfg mid_ps_cfg;
2085 	/* wmi_ps_cfg_cmd_status_e */
2086 	__le32 status;
2087 } __packed;
2088 
2089 #define WMI_AOA_MAX_DATA_SIZE	(128)
2090 
2091 enum wmi_aoa_meas_status {
2092 	WMI_AOA_MEAS_SUCCESS		= 0x00,
2093 	WMI_AOA_MEAS_PEER_INCAPABLE	= 0x01,
2094 	WMI_AOA_MEAS_FAILURE		= 0x02,
2095 };
2096 
2097 /* WMI_AOA_MEAS_EVENTID */
2098 struct wmi_aoa_meas_event {
2099 	u8 mac_addr[WMI_MAC_LEN];
2100 	/* channels IDs:
2101 	 * 0 - 58320 MHz
2102 	 * 1 - 60480 MHz
2103 	 * 2 - 62640 MHz
2104 	 */
2105 	u8 channel;
2106 	/* enum wmi_aoa_meas_type */
2107 	u8 aoa_meas_type;
2108 	/* Measurments are from RFs, defined by the mask */
2109 	__le32 meas_rf_mask;
2110 	/* enum wmi_aoa_meas_status */
2111 	u8 meas_status;
2112 	u8 reserved;
2113 	/* Length of meas_data in bytes */
2114 	__le16 length;
2115 	u8 meas_data[WMI_AOA_MAX_DATA_SIZE];
2116 } __packed;
2117 
2118 /* WMI_SET_MGMT_RETRY_LIMIT_EVENTID */
2119 struct wmi_set_mgmt_retry_limit_event {
2120 	/* enum wmi_fw_status */
2121 	u8 status;
2122 	/* alignment to 32b */
2123 	u8 reserved[3];
2124 } __packed;
2125 
2126 /* WMI_GET_MGMT_RETRY_LIMIT_EVENTID */
2127 struct wmi_get_mgmt_retry_limit_event {
2128 	/* MAC retransmit limit for mgmt frames */
2129 	u8 mgmt_retry_limit;
2130 	/* alignment to 32b */
2131 	u8 reserved[3];
2132 } __packed;
2133 
2134 /* WMI_TOF_GET_CAPABILITIES_EVENTID */
2135 struct wmi_tof_get_capabilities_event {
2136 	u8 ftm_capability;
2137 	/* maximum supported number of destination to start TOF */
2138 	u8 max_num_of_dest;
2139 	/* maximum supported number of measurements per burst */
2140 	u8 max_num_of_meas_per_burst;
2141 	u8 reserved;
2142 	/* maximum supported multi bursts */
2143 	__le16 max_multi_bursts_sessions;
2144 	/* maximum supported FTM burst duration , wmi_tof_burst_duration_e */
2145 	__le16 max_ftm_burst_duration;
2146 	/* AOA supported types */
2147 	__le32 aoa_supported_types;
2148 } __packed;
2149 
2150 enum wmi_tof_session_end_status {
2151 	WMI_TOF_SESSION_END_NO_ERROR		= 0x00,
2152 	WMI_TOF_SESSION_END_FAIL		= 0x01,
2153 	WMI_TOF_SESSION_END_PARAMS_ERROR	= 0x02,
2154 	WMI_TOF_SESSION_END_ABORTED		= 0x03,
2155 };
2156 
2157 /* WMI_TOF_SESSION_END_EVENTID */
2158 struct wmi_tof_session_end_event {
2159 	/* FTM session ID */
2160 	__le32 session_id;
2161 	/* wmi_tof_session_end_status_e */
2162 	u8 status;
2163 	u8 reserved[3];
2164 } __packed;
2165 
2166 /* Responder FTM Results */
2167 struct wmi_responder_ftm_res {
2168 	u8 t1[6];
2169 	u8 t2[6];
2170 	u8 t3[6];
2171 	u8 t4[6];
2172 	__le16 tod_err;
2173 	__le16 toa_err;
2174 	__le16 tod_err_initiator;
2175 	__le16 toa_err_initiator;
2176 } __packed;
2177 
2178 enum wmi_tof_ftm_per_dest_res_status {
2179 	WMI_PER_DEST_RES_NO_ERROR		= 0x00,
2180 	WMI_PER_DEST_RES_TX_RX_FAIL		= 0x01,
2181 	WMI_PER_DEST_RES_PARAM_DONT_MATCH	= 0x02,
2182 };
2183 
2184 enum wmi_tof_ftm_per_dest_res_flags {
2185 	WMI_PER_DEST_RES_REQ_START		= 0x01,
2186 	WMI_PER_DEST_RES_BURST_REPORT_END	= 0x02,
2187 	WMI_PER_DEST_RES_REQ_END		= 0x04,
2188 	WMI_PER_DEST_RES_PARAM_UPDATE		= 0x08,
2189 };
2190 
2191 /* WMI_TOF_FTM_PER_DEST_RES_EVENTID */
2192 struct wmi_tof_ftm_per_dest_res_event {
2193 	/* FTM session ID */
2194 	__le32 session_id;
2195 	/* destination MAC address */
2196 	u8 dst_mac[WMI_MAC_LEN];
2197 	/* wmi_tof_ftm_per_dest_res_flags_e */
2198 	u8 flags;
2199 	/* wmi_tof_ftm_per_dest_res_status_e */
2200 	u8 status;
2201 	/* responder ASAP */
2202 	u8 responder_asap;
2203 	/* responder number of FTM per burst */
2204 	u8 responder_num_ftm_per_burst;
2205 	/* responder number of FTM burst exponent */
2206 	u8 responder_num_ftm_bursts_exp;
2207 	/* responder burst duration ,wmi_tof_burst_duration_e */
2208 	u8 responder_burst_duration;
2209 	/* responder burst period, indicate interval between two consecutive
2210 	 * burst instances, in units of 100 ms
2211 	 */
2212 	__le16 responder_burst_period;
2213 	/* receive burst counter */
2214 	__le16 bursts_cnt;
2215 	/* tsf of responder start burst */
2216 	__le32 tsf_sync;
2217 	/* actual received ftm per burst */
2218 	u8 actual_ftm_per_burst;
2219 	u8 reserved0[7];
2220 	struct wmi_responder_ftm_res responder_ftm_res[0];
2221 } __packed;
2222 
2223 enum wmi_tof_channel_info_type {
2224 	WMI_TOF_CHANNEL_INFO_AOA		= 0x00,
2225 	WMI_TOF_CHANNEL_INFO_LCI		= 0x01,
2226 	WMI_TOF_CHANNEL_INFO_LCR		= 0x02,
2227 	WMI_TOF_CHANNEL_INFO_VENDOR_SPECIFIC	= 0x03,
2228 	WMI_TOF_CHANNEL_INFO_CIR		= 0x04,
2229 	WMI_TOF_CHANNEL_INFO_RSSI		= 0x05,
2230 	WMI_TOF_CHANNEL_INFO_SNR		= 0x06,
2231 	WMI_TOF_CHANNEL_INFO_DEBUG		= 0x07,
2232 };
2233 
2234 /* WMI_TOF_CHANNEL_INFO_EVENTID */
2235 struct wmi_tof_channel_info_event {
2236 	/* FTM session ID */
2237 	__le32 session_id;
2238 	/* destination MAC address */
2239 	u8 dst_mac[WMI_MAC_LEN];
2240 	/* wmi_tof_channel_info_type_e */
2241 	u8 type;
2242 	/* data report length */
2243 	u8 len;
2244 	/* data report payload */
2245 	u8 report[0];
2246 } __packed;
2247 
2248 /* WMI_TOF_SET_TX_RX_OFFSET_EVENTID */
2249 struct wmi_tof_set_tx_rx_offset_event {
2250 	/* enum wmi_fw_status */
2251 	u8 status;
2252 	u8 reserved[3];
2253 } __packed;
2254 
2255 /* WMI_TOF_GET_TX_RX_OFFSET_EVENTID */
2256 struct wmi_tof_get_tx_rx_offset_event {
2257 	/* enum wmi_fw_status */
2258 	u8 status;
2259 	u8 reserved1[3];
2260 	/* TX delay offset */
2261 	__le32 tx_offset;
2262 	/* RX delay offset */
2263 	__le32 rx_offset;
2264 	__le32 reserved2[2];
2265 } __packed;
2266 
2267 /* Result status codes for WMI commands */
2268 enum wmi_rf_sector_status {
2269 	WMI_RF_SECTOR_STATUS_SUCCESS			= 0x00,
2270 	WMI_RF_SECTOR_STATUS_BAD_PARAMETERS_ERROR	= 0x01,
2271 	WMI_RF_SECTOR_STATUS_BUSY_ERROR			= 0x02,
2272 	WMI_RF_SECTOR_STATUS_NOT_SUPPORTED_ERROR	= 0x03,
2273 };
2274 
2275 /* Types of the RF sector (TX,RX) */
2276 enum wmi_rf_sector_type {
2277 	WMI_RF_SECTOR_TYPE_RX	= 0x00,
2278 	WMI_RF_SECTOR_TYPE_TX	= 0x01,
2279 };
2280 
2281 /* Content of RF Sector (six 32-bits registers) */
2282 struct wmi_rf_sector_info {
2283 	/* Phase values for RF Chains[15-0] (2bits per RF chain) */
2284 	__le32 psh_hi;
2285 	/* Phase values for RF Chains[31-16] (2bits per RF chain) */
2286 	__le32 psh_lo;
2287 	/* ETYPE Bit0 for all RF chains[31-0] - bit0 of Edge amplifier gain
2288 	 * index
2289 	 */
2290 	__le32 etype0;
2291 	/* ETYPE Bit1 for all RF chains[31-0] - bit1 of Edge amplifier gain
2292 	 * index
2293 	 */
2294 	__le32 etype1;
2295 	/* ETYPE Bit2 for all RF chains[31-0] - bit2 of Edge amplifier gain
2296 	 * index
2297 	 */
2298 	__le32 etype2;
2299 	/* D-Type values (3bits each) for 8 Distribution amplifiers + X16
2300 	 * switch bits
2301 	 */
2302 	__le32 dtype_swch_off;
2303 } __packed;
2304 
2305 #define WMI_INVALID_RF_SECTOR_INDEX	(0xFFFF)
2306 #define WMI_MAX_RF_MODULES_NUM		(8)
2307 
2308 /* WMI_GET_RF_SECTOR_PARAMS_CMD */
2309 struct wmi_get_rf_sector_params_cmd {
2310 	/* Sector number to be retrieved */
2311 	__le16 sector_idx;
2312 	/* enum wmi_rf_sector_type - type of requested RF sector */
2313 	u8 sector_type;
2314 	/* bitmask vector specifying destination RF modules */
2315 	u8 rf_modules_vec;
2316 } __packed;
2317 
2318 /* \WMI_GET_RF_SECTOR_PARAMS_DONE_EVENT */
2319 struct wmi_get_rf_sector_params_done_event {
2320 	/* result status of WMI_GET_RF_SECTOR_PARAMS_CMD (enum
2321 	 * wmi_rf_sector_status)
2322 	 */
2323 	u8 status;
2324 	/* align next field to U64 boundary */
2325 	u8 reserved[7];
2326 	/* TSF timestamp when RF sectors where retrieved */
2327 	__le64 tsf;
2328 	/* Content of RF sector retrieved from each RF module */
2329 	struct wmi_rf_sector_info sectors_info[WMI_MAX_RF_MODULES_NUM];
2330 } __packed;
2331 
2332 /* WMI_SET_RF_SECTOR_PARAMS_CMD */
2333 struct wmi_set_rf_sector_params_cmd {
2334 	/* Sector number to be retrieved */
2335 	__le16 sector_idx;
2336 	/* enum wmi_rf_sector_type - type of requested RF sector */
2337 	u8 sector_type;
2338 	/* bitmask vector specifying destination RF modules */
2339 	u8 rf_modules_vec;
2340 	/* Content of RF sector to be written to each RF module */
2341 	struct wmi_rf_sector_info sectors_info[WMI_MAX_RF_MODULES_NUM];
2342 } __packed;
2343 
2344 /* \WMI_SET_RF_SECTOR_PARAMS_DONE_EVENT */
2345 struct wmi_set_rf_sector_params_done_event {
2346 	/* result status of WMI_SET_RF_SECTOR_PARAMS_CMD (enum
2347 	 * wmi_rf_sector_status)
2348 	 */
2349 	u8 status;
2350 } __packed;
2351 
2352 /* WMI_GET_SELECTED_RF_SECTOR_INDEX_CMD - Get RF sector index selected by
2353  * TXSS/BRP for communication with specified CID
2354  */
2355 struct wmi_get_selected_rf_sector_index_cmd {
2356 	/* Connection/Station ID in [0:7] range */
2357 	u8 cid;
2358 	/* type of requested RF sector (enum wmi_rf_sector_type) */
2359 	u8 sector_type;
2360 	/* align to U32 boundary */
2361 	u8 reserved[2];
2362 } __packed;
2363 
2364 /* \WMI_GET_SELECTED_RF_SECTOR_INDEX_DONE_EVENT - Returns retrieved RF sector
2365  * index selected by TXSS/BRP for communication with specified CID
2366  */
2367 struct wmi_get_selected_rf_sector_index_done_event {
2368 	/* Retrieved sector index selected in TXSS (for TX sector request) or
2369 	 * BRP (for RX sector request)
2370 	 */
2371 	__le16 sector_idx;
2372 	/* result status of WMI_GET_SELECTED_RF_SECTOR_INDEX_CMD (enum
2373 	 * wmi_rf_sector_status)
2374 	 */
2375 	u8 status;
2376 	/* align next field to U64 boundary */
2377 	u8 reserved[5];
2378 	/* TSF timestamp when result was retrieved */
2379 	__le64 tsf;
2380 } __packed;
2381 
2382 /* WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD - Force RF sector index for
2383  * communication with specified CID. Assumes that TXSS/BRP is disabled by
2384  * other command
2385  */
2386 struct wmi_set_selected_rf_sector_index_cmd {
2387 	/* Connection/Station ID in [0:7] range */
2388 	u8 cid;
2389 	/* type of requested RF sector (enum wmi_rf_sector_type) */
2390 	u8 sector_type;
2391 	/* Forced sector index */
2392 	__le16 sector_idx;
2393 } __packed;
2394 
2395 /* \WMI_SET_SELECTED_RF_SECTOR_INDEX_DONE_EVENT - Success/Fail status for
2396  * WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD
2397  */
2398 struct wmi_set_selected_rf_sector_index_done_event {
2399 	/* result status of WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD (enum
2400 	 * wmi_rf_sector_status)
2401 	 */
2402 	u8 status;
2403 	/* align to U32 boundary */
2404 	u8 reserved[3];
2405 } __packed;
2406 
2407 /* WMI_SET_RF_SECTOR_ON_CMD - Activates specified sector for specified rf
2408  * modules
2409  */
2410 struct wmi_set_rf_sector_on_cmd {
2411 	/* Sector index to be activated */
2412 	__le16 sector_idx;
2413 	/* type of requested RF sector (enum wmi_rf_sector_type) */
2414 	u8 sector_type;
2415 	/* bitmask vector specifying destination RF modules */
2416 	u8 rf_modules_vec;
2417 } __packed;
2418 
2419 /* \WMI_SET_RF_SECTOR_ON_DONE_EVENT - Success/Fail status for
2420  * WMI_SET_RF_SECTOR_ON_CMD
2421  */
2422 struct wmi_set_rf_sector_on_done_event {
2423 	/* result status of WMI_SET_RF_SECTOR_ON_CMD (enum
2424 	 * wmi_rf_sector_status)
2425 	 */
2426 	u8 status;
2427 	/* align to U32 boundary */
2428 	u8 reserved[3];
2429 } __packed;
2430 
2431 enum wmi_sector_sweep_type {
2432 	WMI_SECTOR_SWEEP_TYPE_TXSS		= 0x00,
2433 	WMI_SECTOR_SWEEP_TYPE_BCON		= 0x01,
2434 	WMI_SECTOR_SWEEP_TYPE_TXSS_AND_BCON	= 0x02,
2435 	WMI_SECTOR_SWEEP_TYPE_NUM		= 0x03,
2436 };
2437 
2438 /* WMI_PRIO_TX_SECTORS_ORDER_CMDID
2439  *
2440  * Set the order of TX sectors in TXSS and/or Beacon(AP).
2441  *
2442  * Returned event:
2443  * - WMI_PRIO_TX_SECTORS_ORDER_EVENTID
2444  */
2445 struct wmi_prio_tx_sectors_order_cmd {
2446 	/* tx sectors order to be applied, 0xFF for end of array */
2447 	u8 tx_sectors_priority_array[MAX_NUM_OF_SECTORS];
2448 	/* enum wmi_sector_sweep_type, TXSS and/or Beacon */
2449 	u8 sector_sweep_type;
2450 	/* needed only for TXSS configuration */
2451 	u8 cid;
2452 	/* alignment to 32b */
2453 	u8 reserved[2];
2454 } __packed;
2455 
2456 /* completion status codes */
2457 enum wmi_prio_tx_sectors_cmd_status {
2458 	WMI_PRIO_TX_SECT_CMD_STATUS_SUCCESS	= 0x00,
2459 	WMI_PRIO_TX_SECT_CMD_STATUS_BAD_PARAM	= 0x01,
2460 	/* other error */
2461 	WMI_PRIO_TX_SECT_CMD_STATUS_ERROR	= 0x02,
2462 };
2463 
2464 /* WMI_PRIO_TX_SECTORS_ORDER_EVENTID */
2465 struct wmi_prio_tx_sectors_order_event {
2466 	/* enum wmi_prio_tx_sectors_cmd_status */
2467 	u8 status;
2468 	/* alignment to 32b */
2469 	u8 reserved[3];
2470 } __packed;
2471 
2472 struct wmi_prio_tx_sectors_num_cmd {
2473 	/* [0-128], 0 = No changes */
2474 	u8 beacon_number_of_sectors;
2475 	/* [0-128], 0 = No changes */
2476 	u8 txss_number_of_sectors;
2477 	/* [0-8] needed only for TXSS configuration */
2478 	u8 cid;
2479 } __packed;
2480 
2481 /* WMI_PRIO_TX_SECTORS_NUMBER_CMDID
2482  *
2483  * Set the number of active sectors in TXSS and/or Beacon.
2484  *
2485  * Returned event:
2486  * - WMI_PRIO_TX_SECTORS_NUMBER_EVENTID
2487  */
2488 struct wmi_prio_tx_sectors_number_cmd {
2489 	struct wmi_prio_tx_sectors_num_cmd active_sectors_num;
2490 	/* alignment to 32b */
2491 	u8 reserved;
2492 } __packed;
2493 
2494 /* WMI_PRIO_TX_SECTORS_NUMBER_EVENTID */
2495 struct wmi_prio_tx_sectors_number_event {
2496 	/* enum wmi_prio_tx_sectors_cmd_status */
2497 	u8 status;
2498 	/* alignment to 32b */
2499 	u8 reserved[3];
2500 } __packed;
2501 
2502 /* WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_CMDID
2503  *
2504  * Set default sectors order and number (hard coded in board file)
2505  * in TXSS and/or Beacon.
2506  *
2507  * Returned event:
2508  * - WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID
2509  */
2510 struct wmi_prio_tx_sectors_set_default_cfg_cmd {
2511 	/* enum wmi_sector_sweep_type, TXSS and/or Beacon */
2512 	u8 sector_sweep_type;
2513 	/* needed only for TXSS configuration */
2514 	u8 cid;
2515 	/* alignment to 32b */
2516 	u8 reserved[2];
2517 } __packed;
2518 
2519 /* WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID */
2520 struct wmi_prio_tx_sectors_set_default_cfg_event {
2521 	/* enum wmi_prio_tx_sectors_cmd_status */
2522 	u8 status;
2523 	/* alignment to 32b */
2524 	u8 reserved[3];
2525 } __packed;
2526 
2527 #endif /* __WILOCITY_WMI_H__ */
2528