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