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