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