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