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