1 /* SPDX-License-Identifier: ISC */
2 /*
3  * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
4  * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
5  * Copyright (c) 2006-2012 Wilocity
6  */
7 
8 /*
9  * This file contains the definitions of the WMI protocol specified in the
10  * Wireless Module Interface (WMI) for the Qualcomm
11  * 60 GHz wireless solution.
12  * It includes definitions of all the commands and events.
13  * Commands are messages from the host to the WM.
14  * Events are messages from the WM to the host.
15  *
16  * This is an automatically generated file.
17  */
18 
19 #ifndef __WILOCITY_WMI_H__
20 #define __WILOCITY_WMI_H__
21 
22 #define WMI_DEFAULT_ASSOC_STA		(1)
23 #define WMI_MAC_LEN			(6)
24 #define WMI_PROX_RANGE_NUM		(3)
25 #define WMI_MAX_LOSS_DMG_BEACONS	(20)
26 #define MAX_NUM_OF_SECTORS		(128)
27 #define WMI_INVALID_TEMPERATURE		(0xFFFFFFFF)
28 #define WMI_SCHED_MAX_ALLOCS_PER_CMD	(4)
29 #define WMI_RF_DTYPE_LENGTH		(3)
30 #define WMI_RF_ETYPE_LENGTH		(3)
31 #define WMI_RF_RX2TX_LENGTH		(3)
32 #define WMI_RF_ETYPE_VAL_PER_RANGE	(5)
33 /* DTYPE configuration array size
34  * must always be kept equal to (WMI_RF_DTYPE_LENGTH+1)
35  */
36 #define WMI_RF_DTYPE_CONF_LENGTH	(4)
37 /* ETYPE configuration array size
38  * must always be kept equal to
39  * (WMI_RF_ETYPE_LENGTH+WMI_RF_ETYPE_VAL_PER_RANGE)
40  */
41 #define WMI_RF_ETYPE_CONF_LENGTH	(8)
42 /* RX2TX configuration array size
43  * must always be kept equal to (WMI_RF_RX2TX_LENGTH+1)
44  */
45 #define WMI_RF_RX2TX_CONF_LENGTH	(4)
46 /* Qos configuration */
47 #define WMI_QOS_NUM_OF_PRIORITY		(4)
48 #define WMI_QOS_MIN_DEFAULT_WEIGHT	(10)
49 #define WMI_QOS_VRING_SLOT_MIN_MS	(2)
50 #define WMI_QOS_VRING_SLOT_MAX_MS	(10)
51 /* (WMI_QOS_MIN_DEFAULT_WEIGHT * WMI_QOS_VRING_SLOT_MAX_MS /
52  * WMI_QOS_VRING_SLOT_MIN_MS)
53  */
54 #define WMI_QOS_MAX_WEIGHT		50
55 #define WMI_QOS_SET_VIF_PRIORITY	(0xFF)
56 #define WMI_QOS_DEFAULT_PRIORITY	(WMI_QOS_NUM_OF_PRIORITY)
57 #define WMI_MAX_XIF_PORTS_NUM		(8)
58 
59 /* Mailbox interface
60  * used for commands and events
61  */
62 enum wmi_mid {
63 	MID_DEFAULT		= 0x00,
64 	FIRST_DBG_MID_ID	= 0x10,
65 	LAST_DBG_MID_ID		= 0xFE,
66 	MID_BROADCAST		= 0xFF,
67 };
68 
69 /* FW capability IDs
70  * Each ID maps to a bit in a 32-bit bitmask value provided by the FW to
71  * the host
72  */
73 enum wmi_fw_capability {
74 	WMI_FW_CAPABILITY_FTM				= 0,
75 	WMI_FW_CAPABILITY_PS_CONFIG			= 1,
76 	WMI_FW_CAPABILITY_RF_SECTORS			= 2,
77 	WMI_FW_CAPABILITY_MGMT_RETRY_LIMIT		= 3,
78 	WMI_FW_CAPABILITY_AP_SME_OFFLOAD_PARTIAL	= 4,
79 	WMI_FW_CAPABILITY_WMI_ONLY			= 5,
80 	WMI_FW_CAPABILITY_THERMAL_THROTTLING		= 7,
81 	WMI_FW_CAPABILITY_D3_SUSPEND			= 8,
82 	WMI_FW_CAPABILITY_LONG_RANGE			= 9,
83 	WMI_FW_CAPABILITY_FIXED_SCHEDULING		= 10,
84 	WMI_FW_CAPABILITY_MULTI_DIRECTED_OMNIS		= 11,
85 	WMI_FW_CAPABILITY_RSSI_REPORTING		= 12,
86 	WMI_FW_CAPABILITY_SET_SILENT_RSSI_TABLE		= 13,
87 	WMI_FW_CAPABILITY_LO_POWER_CALIB_FROM_OTP	= 14,
88 	WMI_FW_CAPABILITY_PNO				= 15,
89 	WMI_FW_CAPABILITY_CHANNEL_BONDING		= 17,
90 	WMI_FW_CAPABILITY_REF_CLOCK_CONTROL		= 18,
91 	WMI_FW_CAPABILITY_AP_SME_OFFLOAD_NONE		= 19,
92 	WMI_FW_CAPABILITY_MULTI_VIFS			= 20,
93 	WMI_FW_CAPABILITY_FT_ROAMING			= 21,
94 	WMI_FW_CAPABILITY_BACK_WIN_SIZE_64		= 22,
95 	WMI_FW_CAPABILITY_AMSDU				= 23,
96 	WMI_FW_CAPABILITY_RAW_MODE			= 24,
97 	WMI_FW_CAPABILITY_TX_REQ_EXT			= 25,
98 	WMI_FW_CAPABILITY_CHANNEL_4			= 26,
99 	WMI_FW_CAPABILITY_IPA				= 27,
100 	WMI_FW_CAPABILITY_TEMPERATURE_ALL_RF		= 30,
101 	WMI_FW_CAPABILITY_SPLIT_REKEY			= 31,
102 	WMI_FW_CAPABILITY_MAX,
103 };
104 
105 /* WMI_CMD_HDR */
106 struct wmi_cmd_hdr {
107 	u8 mid;
108 	u8 reserved;
109 	__le16 command_id;
110 	__le32 fw_timestamp;
111 } __packed;
112 
113 /* List of Commands */
114 enum wmi_command_id {
115 	WMI_CONNECT_CMDID				= 0x01,
116 	WMI_DISCONNECT_CMDID				= 0x03,
117 	WMI_DISCONNECT_STA_CMDID			= 0x04,
118 	WMI_START_SCHED_SCAN_CMDID			= 0x05,
119 	WMI_STOP_SCHED_SCAN_CMDID			= 0x06,
120 	WMI_START_SCAN_CMDID				= 0x07,
121 	WMI_SET_BSS_FILTER_CMDID			= 0x09,
122 	WMI_SET_PROBED_SSID_CMDID			= 0x0A,
123 	/* deprecated */
124 	WMI_SET_LISTEN_INT_CMDID			= 0x0B,
125 	WMI_FT_AUTH_CMDID				= 0x0C,
126 	WMI_FT_REASSOC_CMDID				= 0x0D,
127 	WMI_UPDATE_FT_IES_CMDID				= 0x0E,
128 	WMI_BCON_CTRL_CMDID				= 0x0F,
129 	WMI_ADD_CIPHER_KEY_CMDID			= 0x16,
130 	WMI_DELETE_CIPHER_KEY_CMDID			= 0x17,
131 	WMI_PCP_CONF_CMDID				= 0x18,
132 	WMI_SET_APPIE_CMDID				= 0x3F,
133 	WMI_SET_WSC_STATUS_CMDID			= 0x41,
134 	WMI_PXMT_RANGE_CFG_CMDID			= 0x42,
135 	WMI_PXMT_SNR2_RANGE_CFG_CMDID			= 0x43,
136 	WMI_RADAR_GENERAL_CONFIG_CMDID			= 0x100,
137 	WMI_RADAR_CONFIG_SELECT_CMDID			= 0x101,
138 	WMI_RADAR_PARAMS_CONFIG_CMDID			= 0x102,
139 	WMI_RADAR_SET_MODE_CMDID			= 0x103,
140 	WMI_RADAR_CONTROL_CMDID				= 0x104,
141 	WMI_RADAR_PCI_CONTROL_CMDID			= 0x105,
142 	WMI_MEM_READ_CMDID				= 0x800,
143 	WMI_MEM_WR_CMDID				= 0x801,
144 	WMI_ECHO_CMDID					= 0x803,
145 	WMI_DEEP_ECHO_CMDID				= 0x804,
146 	WMI_CONFIG_MAC_CMDID				= 0x805,
147 	/* deprecated */
148 	WMI_CONFIG_PHY_DEBUG_CMDID			= 0x806,
149 	WMI_ADD_DEBUG_TX_PCKT_CMDID			= 0x808,
150 	WMI_PHY_GET_STATISTICS_CMDID			= 0x809,
151 	/* deprecated */
152 	WMI_FS_TUNE_CMDID				= 0x80A,
153 	/* deprecated */
154 	WMI_CORR_MEASURE_CMDID				= 0x80B,
155 	WMI_READ_RSSI_CMDID				= 0x80C,
156 	WMI_TEMP_SENSE_CMDID				= 0x80E,
157 	WMI_DC_CALIB_CMDID				= 0x80F,
158 	/* deprecated */
159 	WMI_SEND_TONE_CMDID				= 0x810,
160 	/* deprecated */
161 	WMI_IQ_TX_CALIB_CMDID				= 0x811,
162 	/* deprecated */
163 	WMI_IQ_RX_CALIB_CMDID				= 0x812,
164 	WMI_SET_WORK_MODE_CMDID				= 0x815,
165 	WMI_LO_LEAKAGE_CALIB_CMDID			= 0x816,
166 	WMI_LO_POWER_CALIB_FROM_OTP_CMDID		= 0x817,
167 	WMI_SILENT_RSSI_CALIB_CMDID			= 0x81D,
168 	/* deprecated */
169 	WMI_RF_RX_TEST_CMDID				= 0x81E,
170 	WMI_CFG_RX_CHAIN_CMDID				= 0x820,
171 	WMI_VRING_CFG_CMDID				= 0x821,
172 	WMI_BCAST_VRING_CFG_CMDID			= 0x822,
173 	WMI_RING_BA_EN_CMDID				= 0x823,
174 	WMI_RING_BA_DIS_CMDID				= 0x824,
175 	WMI_RCP_ADDBA_RESP_CMDID			= 0x825,
176 	WMI_RCP_DELBA_CMDID				= 0x826,
177 	WMI_SET_SSID_CMDID				= 0x827,
178 	WMI_GET_SSID_CMDID				= 0x828,
179 	WMI_SET_PCP_CHANNEL_CMDID			= 0x829,
180 	WMI_GET_PCP_CHANNEL_CMDID			= 0x82A,
181 	WMI_SW_TX_REQ_CMDID				= 0x82B,
182 	/* Event is shared between WMI_SW_TX_REQ_CMDID and
183 	 * WMI_SW_TX_REQ_EXT_CMDID
184 	 */
185 	WMI_SW_TX_REQ_EXT_CMDID				= 0x82C,
186 	WMI_MLME_PUSH_CMDID				= 0x835,
187 	WMI_BEAMFORMING_MGMT_CMDID			= 0x836,
188 	WMI_BF_TXSS_MGMT_CMDID				= 0x837,
189 	WMI_BF_SM_MGMT_CMDID				= 0x838,
190 	WMI_BF_RXSS_MGMT_CMDID				= 0x839,
191 	WMI_BF_TRIG_CMDID				= 0x83A,
192 	WMI_RCP_ADDBA_RESP_EDMA_CMDID			= 0x83B,
193 	WMI_LINK_MAINTAIN_CFG_WRITE_CMDID		= 0x842,
194 	WMI_LINK_MAINTAIN_CFG_READ_CMDID		= 0x843,
195 	WMI_SET_SECTORS_CMDID				= 0x849,
196 	WMI_MAINTAIN_PAUSE_CMDID			= 0x850,
197 	WMI_MAINTAIN_RESUME_CMDID			= 0x851,
198 	WMI_RS_MGMT_CMDID				= 0x852,
199 	WMI_RF_MGMT_CMDID				= 0x853,
200 	WMI_RF_XPM_READ_CMDID				= 0x856,
201 	WMI_RF_XPM_WRITE_CMDID				= 0x857,
202 	WMI_LED_CFG_CMDID				= 0x858,
203 	WMI_SET_CONNECT_SNR_THR_CMDID			= 0x85B,
204 	WMI_SET_ACTIVE_SILENT_RSSI_TABLE_CMDID		= 0x85C,
205 	WMI_RF_PWR_ON_DELAY_CMDID			= 0x85D,
206 	WMI_SET_HIGH_POWER_TABLE_PARAMS_CMDID		= 0x85E,
207 	WMI_FIXED_SCHEDULING_UL_CONFIG_CMDID		= 0x85F,
208 	/* Performance monitoring commands */
209 	WMI_BF_CTRL_CMDID				= 0x862,
210 	WMI_NOTIFY_REQ_CMDID				= 0x863,
211 	WMI_GET_STATUS_CMDID				= 0x864,
212 	WMI_GET_RF_STATUS_CMDID				= 0x866,
213 	WMI_GET_BASEBAND_TYPE_CMDID			= 0x867,
214 	WMI_VRING_SWITCH_TIMING_CONFIG_CMDID		= 0x868,
215 	WMI_UNIT_TEST_CMDID				= 0x900,
216 	WMI_FLASH_READ_CMDID				= 0x902,
217 	WMI_FLASH_WRITE_CMDID				= 0x903,
218 	/* Power management */
219 	WMI_TRAFFIC_SUSPEND_CMDID			= 0x904,
220 	WMI_TRAFFIC_RESUME_CMDID			= 0x905,
221 	/* P2P */
222 	WMI_P2P_CFG_CMDID				= 0x910,
223 	WMI_PORT_ALLOCATE_CMDID				= 0x911,
224 	WMI_PORT_DELETE_CMDID				= 0x912,
225 	WMI_POWER_MGMT_CFG_CMDID			= 0x913,
226 	WMI_START_LISTEN_CMDID				= 0x914,
227 	WMI_START_SEARCH_CMDID				= 0x915,
228 	WMI_DISCOVERY_START_CMDID			= 0x916,
229 	WMI_DISCOVERY_STOP_CMDID			= 0x917,
230 	WMI_PCP_START_CMDID				= 0x918,
231 	WMI_PCP_STOP_CMDID				= 0x919,
232 	WMI_GET_PCP_FACTOR_CMDID			= 0x91B,
233 	/* Power Save Configuration Commands */
234 	WMI_PS_DEV_PROFILE_CFG_CMDID			= 0x91C,
235 	WMI_RS_ENABLE_CMDID				= 0x91E,
236 	WMI_RS_CFG_EX_CMDID				= 0x91F,
237 	WMI_GET_DETAILED_RS_RES_EX_CMDID		= 0x920,
238 	/* deprecated */
239 	WMI_RS_CFG_CMDID				= 0x921,
240 	/* deprecated */
241 	WMI_GET_DETAILED_RS_RES_CMDID			= 0x922,
242 	WMI_AOA_MEAS_CMDID				= 0x923,
243 	WMI_BRP_SET_ANT_LIMIT_CMDID			= 0x924,
244 	WMI_SET_MGMT_RETRY_LIMIT_CMDID			= 0x930,
245 	WMI_GET_MGMT_RETRY_LIMIT_CMDID			= 0x931,
246 	WMI_NEW_STA_CMDID				= 0x935,
247 	WMI_DEL_STA_CMDID				= 0x936,
248 	WMI_SET_THERMAL_THROTTLING_CFG_CMDID		= 0x940,
249 	WMI_GET_THERMAL_THROTTLING_CFG_CMDID		= 0x941,
250 	/* Read Power Save profile type */
251 	WMI_PS_DEV_PROFILE_CFG_READ_CMDID		= 0x942,
252 	WMI_TSF_SYNC_CMDID				= 0x973,
253 	WMI_TOF_SESSION_START_CMDID			= 0x991,
254 	WMI_TOF_GET_CAPABILITIES_CMDID			= 0x992,
255 	WMI_TOF_SET_LCR_CMDID				= 0x993,
256 	WMI_TOF_SET_LCI_CMDID				= 0x994,
257 	WMI_TOF_CFG_RESPONDER_CMDID			= 0x996,
258 	WMI_TOF_SET_TX_RX_OFFSET_CMDID			= 0x997,
259 	WMI_TOF_GET_TX_RX_OFFSET_CMDID			= 0x998,
260 	WMI_TOF_CHANNEL_INFO_CMDID			= 0x999,
261 	WMI_GET_RF_SECTOR_PARAMS_CMDID			= 0x9A0,
262 	WMI_SET_RF_SECTOR_PARAMS_CMDID			= 0x9A1,
263 	WMI_GET_SELECTED_RF_SECTOR_INDEX_CMDID		= 0x9A2,
264 	WMI_SET_SELECTED_RF_SECTOR_INDEX_CMDID		= 0x9A3,
265 	WMI_SET_RF_SECTOR_ON_CMDID			= 0x9A4,
266 	WMI_PRIO_TX_SECTORS_ORDER_CMDID			= 0x9A5,
267 	WMI_PRIO_TX_SECTORS_NUMBER_CMDID		= 0x9A6,
268 	WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_CMDID	= 0x9A7,
269 	/* deprecated */
270 	WMI_BF_CONTROL_CMDID				= 0x9AA,
271 	WMI_BF_CONTROL_EX_CMDID				= 0x9AB,
272 	WMI_TX_STATUS_RING_ADD_CMDID			= 0x9C0,
273 	WMI_RX_STATUS_RING_ADD_CMDID			= 0x9C1,
274 	WMI_TX_DESC_RING_ADD_CMDID			= 0x9C2,
275 	WMI_RX_DESC_RING_ADD_CMDID			= 0x9C3,
276 	WMI_BCAST_DESC_RING_ADD_CMDID			= 0x9C4,
277 	WMI_CFG_DEF_RX_OFFLOAD_CMDID			= 0x9C5,
278 	WMI_SCHEDULING_SCHEME_CMDID			= 0xA01,
279 	WMI_FIXED_SCHEDULING_CONFIG_CMDID		= 0xA02,
280 	WMI_ENABLE_FIXED_SCHEDULING_CMDID		= 0xA03,
281 	WMI_SET_MULTI_DIRECTED_OMNIS_CONFIG_CMDID	= 0xA04,
282 	WMI_SET_LONG_RANGE_CONFIG_CMDID			= 0xA05,
283 	WMI_GET_ASSOC_LIST_CMDID			= 0xA06,
284 	WMI_GET_CCA_INDICATIONS_CMDID			= 0xA07,
285 	WMI_SET_CCA_INDICATIONS_BI_AVG_NUM_CMDID	= 0xA08,
286 	WMI_INTERNAL_FW_IOCTL_CMDID			= 0xA0B,
287 	WMI_LINK_STATS_CMDID				= 0xA0C,
288 	WMI_SET_GRANT_MCS_CMDID				= 0xA0E,
289 	WMI_SET_AP_SLOT_SIZE_CMDID			= 0xA0F,
290 	WMI_SET_VRING_PRIORITY_WEIGHT_CMDID		= 0xA10,
291 	WMI_SET_VRING_PRIORITY_CMDID			= 0xA11,
292 	WMI_RBUFCAP_CFG_CMDID				= 0xA12,
293 	WMI_TEMP_SENSE_ALL_CMDID			= 0xA13,
294 	WMI_SET_MAC_ADDRESS_CMDID			= 0xF003,
295 	WMI_ABORT_SCAN_CMDID				= 0xF007,
296 	WMI_SET_PROMISCUOUS_MODE_CMDID			= 0xF041,
297 	/* deprecated */
298 	WMI_GET_PMK_CMDID				= 0xF048,
299 	WMI_SET_PASSPHRASE_CMDID			= 0xF049,
300 	/* deprecated */
301 	WMI_SEND_ASSOC_RES_CMDID			= 0xF04A,
302 	/* deprecated */
303 	WMI_SET_ASSOC_REQ_RELAY_CMDID			= 0xF04B,
304 	WMI_MAC_ADDR_REQ_CMDID				= 0xF04D,
305 	WMI_FW_VER_CMDID				= 0xF04E,
306 	WMI_PMC_CMDID					= 0xF04F,
307 };
308 
309 /* WMI_CONNECT_CMDID */
310 enum wmi_network_type {
311 	WMI_NETTYPE_INFRA		= 0x01,
312 	WMI_NETTYPE_ADHOC		= 0x02,
313 	WMI_NETTYPE_ADHOC_CREATOR	= 0x04,
314 	WMI_NETTYPE_AP			= 0x10,
315 	WMI_NETTYPE_P2P			= 0x20,
316 	/* PCIE over 60g */
317 	WMI_NETTYPE_WBE			= 0x40,
318 };
319 
320 enum wmi_dot11_auth_mode {
321 	WMI_AUTH11_OPEN		= 0x01,
322 	WMI_AUTH11_SHARED	= 0x02,
323 	WMI_AUTH11_LEAP		= 0x04,
324 	WMI_AUTH11_WSC		= 0x08,
325 };
326 
327 enum wmi_auth_mode {
328 	WMI_AUTH_NONE		= 0x01,
329 	WMI_AUTH_WPA		= 0x02,
330 	WMI_AUTH_WPA2		= 0x04,
331 	WMI_AUTH_WPA_PSK	= 0x08,
332 	WMI_AUTH_WPA2_PSK	= 0x10,
333 	WMI_AUTH_WPA_CCKM	= 0x20,
334 	WMI_AUTH_WPA2_CCKM	= 0x40,
335 };
336 
337 enum wmi_crypto_type {
338 	WMI_CRYPT_NONE		= 0x01,
339 	WMI_CRYPT_AES_GCMP	= 0x20,
340 };
341 
342 enum wmi_connect_ctrl_flag_bits {
343 	WMI_CONNECT_ASSOC_POLICY_USER		= 0x01,
344 	WMI_CONNECT_SEND_REASSOC		= 0x02,
345 	WMI_CONNECT_IGNORE_WPA_GROUP_CIPHER	= 0x04,
346 	WMI_CONNECT_PROFILE_MATCH_DONE		= 0x08,
347 	WMI_CONNECT_IGNORE_AAC_BEACON		= 0x10,
348 	WMI_CONNECT_CSA_FOLLOW_BSS		= 0x20,
349 	WMI_CONNECT_DO_WPA_OFFLOAD		= 0x40,
350 	WMI_CONNECT_DO_NOT_DEAUTH		= 0x80,
351 };
352 
353 #define WMI_MAX_SSID_LEN	(32)
354 
355 enum wmi_channel {
356 	WMI_CHANNEL_1	= 0x00,
357 	WMI_CHANNEL_2	= 0x01,
358 	WMI_CHANNEL_3	= 0x02,
359 	WMI_CHANNEL_4	= 0x03,
360 	WMI_CHANNEL_5	= 0x04,
361 	WMI_CHANNEL_6	= 0x05,
362 	WMI_CHANNEL_9	= 0x06,
363 	WMI_CHANNEL_10	= 0x07,
364 	WMI_CHANNEL_11	= 0x08,
365 	WMI_CHANNEL_12	= 0x09,
366 };
367 
368 /* WMI_CONNECT_CMDID */
369 struct wmi_connect_cmd {
370 	u8 network_type;
371 	u8 dot11_auth_mode;
372 	u8 auth_mode;
373 	u8 pairwise_crypto_type;
374 	u8 pairwise_crypto_len;
375 	u8 group_crypto_type;
376 	u8 group_crypto_len;
377 	u8 ssid_len;
378 	u8 ssid[WMI_MAX_SSID_LEN];
379 	/* enum wmi_channel WMI_CHANNEL_1..WMI_CHANNEL_6; for EDMG this is
380 	 * the primary channel number
381 	 */
382 	u8 channel;
383 	/* enum wmi_channel WMI_CHANNEL_9..WMI_CHANNEL_12 */
384 	u8 edmg_channel;
385 	u8 bssid[WMI_MAC_LEN];
386 	__le32 ctrl_flags;
387 	u8 dst_mac[WMI_MAC_LEN];
388 	u8 reserved1[2];
389 } __packed;
390 
391 /* WMI_DISCONNECT_STA_CMDID */
392 struct wmi_disconnect_sta_cmd {
393 	u8 dst_mac[WMI_MAC_LEN];
394 	__le16 disconnect_reason;
395 } __packed;
396 
397 #define WMI_MAX_KEY_INDEX	(3)
398 #define WMI_MAX_KEY_LEN		(32)
399 #define WMI_PASSPHRASE_LEN	(64)
400 
401 /* WMI_SET_PASSPHRASE_CMDID */
402 struct wmi_set_passphrase_cmd {
403 	u8 ssid[WMI_MAX_SSID_LEN];
404 	u8 passphrase[WMI_PASSPHRASE_LEN];
405 	u8 ssid_len;
406 	u8 passphrase_len;
407 } __packed;
408 
409 /* WMI_ADD_CIPHER_KEY_CMDID */
410 enum wmi_key_usage {
411 	WMI_KEY_USE_PAIRWISE	= 0x00,
412 	WMI_KEY_USE_RX_GROUP	= 0x01,
413 	WMI_KEY_USE_TX_GROUP	= 0x02,
414 	WMI_KEY_USE_STORE_PTK	= 0x03,
415 	WMI_KEY_USE_APPLY_PTK	= 0x04,
416 };
417 
418 struct wmi_add_cipher_key_cmd {
419 	u8 key_index;
420 	u8 key_type;
421 	/* enum wmi_key_usage */
422 	u8 key_usage;
423 	u8 key_len;
424 	/* key replay sequence counter */
425 	u8 key_rsc[8];
426 	u8 key[WMI_MAX_KEY_LEN];
427 	/* Additional Key Control information */
428 	u8 key_op_ctrl;
429 	u8 mac[WMI_MAC_LEN];
430 } __packed;
431 
432 /* WMI_DELETE_CIPHER_KEY_CMDID */
433 struct wmi_delete_cipher_key_cmd {
434 	u8 key_index;
435 	u8 mac[WMI_MAC_LEN];
436 } __packed;
437 
438 /* WMI_START_SCAN_CMDID
439  *
440  * Start L1 scan operation
441  *
442  * Returned events:
443  * - WMI_RX_MGMT_PACKET_EVENTID - for every probe resp.
444  * - WMI_SCAN_COMPLETE_EVENTID
445  */
446 enum wmi_scan_type {
447 	WMI_ACTIVE_SCAN		= 0x00,
448 	WMI_SHORT_SCAN		= 0x01,
449 	WMI_PASSIVE_SCAN	= 0x02,
450 	WMI_DIRECT_SCAN		= 0x03,
451 	WMI_LONG_SCAN		= 0x04,
452 };
453 
454 /* WMI_START_SCAN_CMDID */
455 struct wmi_start_scan_cmd {
456 	u8 direct_scan_mac_addr[WMI_MAC_LEN];
457 	/* run scan with discovery beacon. Relevant for ACTIVE scan only. */
458 	u8 discovery_mode;
459 	u8 reserved;
460 	/* Max duration in the home channel(ms) */
461 	__le32 dwell_time;
462 	/* Time interval between scans (ms) */
463 	__le32 force_scan_interval;
464 	/* enum wmi_scan_type */
465 	u8 scan_type;
466 	/* how many channels follow */
467 	u8 num_channels;
468 	/* channels ID's:
469 	 * 0 - 58320 MHz
470 	 * 1 - 60480 MHz
471 	 * 2 - 62640 MHz
472 	 */
473 	struct {
474 		u8 channel;
475 		u8 reserved;
476 	} channel_list[0];
477 } __packed;
478 
479 #define WMI_MAX_PNO_SSID_NUM	(16)
480 #define WMI_MAX_CHANNEL_NUM	(6)
481 #define WMI_MAX_PLANS_NUM	(2)
482 
483 /* WMI_START_SCHED_SCAN_CMDID */
484 struct wmi_sched_scan_ssid_match {
485 	u8 ssid_len;
486 	u8 ssid[WMI_MAX_SSID_LEN];
487 	s8 rssi_threshold;
488 	/* boolean */
489 	u8 add_ssid_to_probe;
490 	u8 reserved;
491 } __packed;
492 
493 /* WMI_START_SCHED_SCAN_CMDID */
494 struct wmi_sched_scan_plan {
495 	__le16 interval_sec;
496 	__le16 num_of_iterations;
497 } __packed;
498 
499 /* WMI_START_SCHED_SCAN_CMDID */
500 struct wmi_start_sched_scan_cmd {
501 	struct wmi_sched_scan_ssid_match ssid_for_match[WMI_MAX_PNO_SSID_NUM];
502 	u8 num_of_ssids;
503 	s8 min_rssi_threshold;
504 	u8 channel_list[WMI_MAX_CHANNEL_NUM];
505 	u8 num_of_channels;
506 	u8 reserved;
507 	__le16 initial_delay_sec;
508 	struct wmi_sched_scan_plan scan_plans[WMI_MAX_PLANS_NUM];
509 } __packed;
510 
511 /* WMI_FT_AUTH_CMDID */
512 struct wmi_ft_auth_cmd {
513 	u8 bssid[WMI_MAC_LEN];
514 	/* enum wmi_channel */
515 	u8 channel;
516 	/* enum wmi_channel */
517 	u8 edmg_channel;
518 	u8 reserved[4];
519 } __packed;
520 
521 /* WMI_FT_REASSOC_CMDID */
522 struct wmi_ft_reassoc_cmd {
523 	u8 bssid[WMI_MAC_LEN];
524 	u8 reserved[2];
525 } __packed;
526 
527 /* WMI_UPDATE_FT_IES_CMDID */
528 struct wmi_update_ft_ies_cmd {
529 	/* Length of the FT IEs */
530 	__le16 ie_len;
531 	u8 reserved[2];
532 	u8 ie_info[0];
533 } __packed;
534 
535 /* WMI_SET_PROBED_SSID_CMDID */
536 #define MAX_PROBED_SSID_INDEX	(3)
537 
538 enum wmi_ssid_flag {
539 	/* disables entry */
540 	WMI_SSID_FLAG_DISABLE	= 0x00,
541 	/* probes specified ssid */
542 	WMI_SSID_FLAG_SPECIFIC	= 0x01,
543 	/* probes for any ssid */
544 	WMI_SSID_FLAG_ANY	= 0x02,
545 };
546 
547 struct wmi_probed_ssid_cmd {
548 	/* 0 to MAX_PROBED_SSID_INDEX */
549 	u8 entry_index;
550 	/* enum wmi_ssid_flag */
551 	u8 flag;
552 	u8 ssid_len;
553 	u8 ssid[WMI_MAX_SSID_LEN];
554 } __packed;
555 
556 /* WMI_SET_APPIE_CMDID
557  * Add Application specified IE to a management frame
558  */
559 #define WMI_MAX_IE_LEN	(1024)
560 
561 /* Frame Types */
562 enum wmi_mgmt_frame_type {
563 	WMI_FRAME_BEACON	= 0x00,
564 	WMI_FRAME_PROBE_REQ	= 0x01,
565 	WMI_FRAME_PROBE_RESP	= 0x02,
566 	WMI_FRAME_ASSOC_REQ	= 0x03,
567 	WMI_FRAME_ASSOC_RESP	= 0x04,
568 	WMI_NUM_MGMT_FRAME	= 0x05,
569 };
570 
571 struct wmi_set_appie_cmd {
572 	/* enum wmi_mgmt_frame_type */
573 	u8 mgmt_frm_type;
574 	u8 reserved;
575 	/* Length of the IE to be added to MGMT frame */
576 	__le16 ie_len;
577 	u8 ie_info[0];
578 } __packed;
579 
580 /* WMI_PXMT_RANGE_CFG_CMDID */
581 struct wmi_pxmt_range_cfg_cmd {
582 	u8 dst_mac[WMI_MAC_LEN];
583 	__le16 range;
584 } __packed;
585 
586 /* WMI_PXMT_SNR2_RANGE_CFG_CMDID */
587 struct wmi_pxmt_snr2_range_cfg_cmd {
588 	s8 snr2range_arr[2];
589 } __packed;
590 
591 /* WMI_RADAR_GENERAL_CONFIG_CMDID */
592 struct wmi_radar_general_config_cmd {
593 	/* Number of pulses (CIRs) in FW FIFO to initiate pulses transfer
594 	 * from FW to Host
595 	 */
596 	__le32 fifo_watermark;
597 	/* In unit of us, in the range [100, 1000000] */
598 	__le32 t_burst;
599 	/* Valid in the range [1, 32768], 0xFFFF means infinite */
600 	__le32 n_bursts;
601 	/* In unit of 330Mhz clk, in the range [4, 2000]*330 */
602 	__le32 t_pulse;
603 	/* In the range of [1,4096] */
604 	__le16 n_pulses;
605 	/* Number of taps after cTap per CIR */
606 	__le16 n_samples;
607 	/* Offset from the main tap (0 = zero-distance). In the range of [0,
608 	 * 255]
609 	 */
610 	u8 first_sample_offset;
611 	/* Number of Pulses to average, 1, 2, 4, 8 */
612 	u8 pulses_to_avg;
613 	/* Number of adjacent taps to average, 1, 2, 4, 8 */
614 	u8 samples_to_avg;
615 	/* The index to config general params */
616 	u8 general_index;
617 	u8 reserved[4];
618 } __packed;
619 
620 /* WMI_RADAR_CONFIG_SELECT_CMDID */
621 struct wmi_radar_config_select_cmd {
622 	/* Select the general params index to use */
623 	u8 general_index;
624 	u8 reserved[3];
625 	/* 0 means don't update burst_active_vector */
626 	__le32 burst_active_vector;
627 	/* 0 means don't update pulse_active_vector */
628 	__le32 pulse_active_vector;
629 } __packed;
630 
631 /* WMI_RADAR_PARAMS_CONFIG_CMDID */
632 struct wmi_radar_params_config_cmd {
633 	/* The burst index selected to config */
634 	u8 burst_index;
635 	/* 0-not active, 1-active */
636 	u8 burst_en;
637 	/* The pulse index selected to config */
638 	u8 pulse_index;
639 	/* 0-not active, 1-active */
640 	u8 pulse_en;
641 	/* TX RF to use on current pulse */
642 	u8 tx_rfc_idx;
643 	u8 tx_sector;
644 	/* Offset from calibrated value.(expected to be 0)(value is row in
645 	 * Gain-LUT, not dB)
646 	 */
647 	s8 tx_rf_gain_comp;
648 	/* expected to be 0 */
649 	s8 tx_bb_gain_comp;
650 	/* RX RF to use on current pulse */
651 	u8 rx_rfc_idx;
652 	u8 rx_sector;
653 	/* Offset from calibrated value.(expected to be 0)(value is row in
654 	 * Gain-LUT, not dB)
655 	 */
656 	s8 rx_rf_gain_comp;
657 	/* Value in dB.(expected to be 0) */
658 	s8 rx_bb_gain_comp;
659 	/* Offset from calibrated value.(expected to be 0) */
660 	s8 rx_timing_offset;
661 	u8 reserved[3];
662 } __packed;
663 
664 /* WMI_RADAR_SET_MODE_CMDID */
665 struct wmi_radar_set_mode_cmd {
666 	/* 0-disable/1-enable */
667 	u8 enable;
668 	/* enum wmi_channel */
669 	u8 channel;
670 	/* In the range of [0,7], 0xff means use default */
671 	u8 tx_rfc_idx;
672 	/* In the range of [0,7], 0xff means use default */
673 	u8 rx_rfc_idx;
674 } __packed;
675 
676 /* WMI_RADAR_CONTROL_CMDID */
677 struct wmi_radar_control_cmd {
678 	/* 0-stop/1-start */
679 	u8 start;
680 	u8 reserved[3];
681 } __packed;
682 
683 /* WMI_RADAR_PCI_CONTROL_CMDID */
684 struct wmi_radar_pci_control_cmd {
685 	/* pcie host buffer start address */
686 	__le64 base_addr;
687 	/* pcie host control block address */
688 	__le64 control_block_addr;
689 	/* pcie host buffer size */
690 	__le32 buffer_size;
691 	__le32 reserved;
692 } __packed;
693 
694 /* WMI_RF_MGMT_CMDID */
695 enum wmi_rf_mgmt_type {
696 	WMI_RF_MGMT_W_DISABLE	= 0x00,
697 	WMI_RF_MGMT_W_ENABLE	= 0x01,
698 	WMI_RF_MGMT_GET_STATUS	= 0x02,
699 };
700 
701 /* WMI_BF_CONTROL_CMDID */
702 enum wmi_bf_triggers {
703 	WMI_BF_TRIGGER_RS_MCS1_TH_FAILURE		= 0x01,
704 	WMI_BF_TRIGGER_RS_MCS1_NO_BACK_FAILURE		= 0x02,
705 	WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_TXOP		= 0x04,
706 	WMI_BF_TRIGGER_MAX_BACK_FAILURE			= 0x08,
707 	WMI_BF_TRIGGER_FW				= 0x10,
708 	WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_KEEP_ALIVE	= 0x20,
709 	WMI_BF_TRIGGER_AOA				= 0x40,
710 	WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_UPM		= 0x80,
711 };
712 
713 /* WMI_RF_MGMT_CMDID */
714 struct wmi_rf_mgmt_cmd {
715 	__le32 rf_mgmt_type;
716 } __packed;
717 
718 /* WMI_CORR_MEASURE_CMDID */
719 struct wmi_corr_measure_cmd {
720 	__le32 freq_mhz;
721 	__le32 length_samples;
722 	__le32 iterations;
723 } __packed;
724 
725 /* WMI_SET_SSID_CMDID */
726 struct wmi_set_ssid_cmd {
727 	__le32 ssid_len;
728 	u8 ssid[WMI_MAX_SSID_LEN];
729 } __packed;
730 
731 /* WMI_SET_PCP_CHANNEL_CMDID */
732 struct wmi_set_pcp_channel_cmd {
733 	u8 channel;
734 	u8 reserved[3];
735 } __packed;
736 
737 /* WMI_BCON_CTRL_CMDID */
738 struct wmi_bcon_ctrl_cmd {
739 	__le16 bcon_interval;
740 	__le16 frag_num;
741 	__le64 ss_mask;
742 	u8 network_type;
743 	u8 pcp_max_assoc_sta;
744 	u8 disable_sec_offload;
745 	u8 disable_sec;
746 	u8 hidden_ssid;
747 	u8 is_go;
748 	/* A-BFT length override if non-0 */
749 	u8 abft_len;
750 	u8 reserved;
751 } __packed;
752 
753 /* WMI_PORT_ALLOCATE_CMDID */
754 enum wmi_port_role {
755 	WMI_PORT_STA		= 0x00,
756 	WMI_PORT_PCP		= 0x01,
757 	WMI_PORT_AP		= 0x02,
758 	WMI_PORT_P2P_DEV	= 0x03,
759 	WMI_PORT_P2P_CLIENT	= 0x04,
760 	WMI_PORT_P2P_GO		= 0x05,
761 };
762 
763 /* WMI_PORT_ALLOCATE_CMDID */
764 struct wmi_port_allocate_cmd {
765 	u8 mac[WMI_MAC_LEN];
766 	u8 port_role;
767 	u8 mid;
768 } __packed;
769 
770 /* WMI_PORT_DELETE_CMDID */
771 struct wmi_port_delete_cmd {
772 	u8 mid;
773 	u8 reserved[3];
774 } __packed;
775 
776 /* WMI_TRAFFIC_SUSPEND_CMD wakeup trigger bit mask values */
777 enum wmi_wakeup_trigger {
778 	WMI_WAKEUP_TRIGGER_UCAST	= 0x01,
779 	WMI_WAKEUP_TRIGGER_BCAST	= 0x02,
780 };
781 
782 /* WMI_TRAFFIC_SUSPEND_CMDID */
783 struct wmi_traffic_suspend_cmd {
784 	/* Bit vector: bit[0] - wake on Unicast, bit[1] - wake on Broadcast */
785 	u8 wakeup_trigger;
786 } __packed;
787 
788 /* WMI_P2P_CFG_CMDID */
789 enum wmi_discovery_mode {
790 	WMI_DISCOVERY_MODE_NON_OFFLOAD	= 0x00,
791 	WMI_DISCOVERY_MODE_OFFLOAD	= 0x01,
792 	WMI_DISCOVERY_MODE_PEER2PEER	= 0x02,
793 };
794 
795 struct wmi_p2p_cfg_cmd {
796 	/* enum wmi_discovery_mode */
797 	u8 discovery_mode;
798 	u8 channel;
799 	/* base to listen/search duration calculation */
800 	__le16 bcon_interval;
801 } __packed;
802 
803 /* WMI_POWER_MGMT_CFG_CMDID */
804 enum wmi_power_source_type {
805 	WMI_POWER_SOURCE_BATTERY	= 0x00,
806 	WMI_POWER_SOURCE_OTHER		= 0x01,
807 };
808 
809 struct wmi_power_mgmt_cfg_cmd {
810 	/* enum wmi_power_source_type */
811 	u8 power_source;
812 	u8 reserved[3];
813 } __packed;
814 
815 /* WMI_PCP_START_CMDID */
816 enum wmi_ap_sme_offload_mode {
817 	/* Full AP SME in FW */
818 	WMI_AP_SME_OFFLOAD_FULL		= 0x00,
819 	/* Probe AP SME in FW */
820 	WMI_AP_SME_OFFLOAD_PARTIAL	= 0x01,
821 	/* AP SME in host */
822 	WMI_AP_SME_OFFLOAD_NONE		= 0x02,
823 };
824 
825 /* WMI_PCP_START_CMDID */
826 struct wmi_pcp_start_cmd {
827 	__le16 bcon_interval;
828 	u8 pcp_max_assoc_sta;
829 	u8 hidden_ssid;
830 	u8 is_go;
831 	/* enum wmi_channel WMI_CHANNEL_9..WMI_CHANNEL_12 */
832 	u8 edmg_channel;
833 	u8 raw_mode;
834 	u8 reserved[3];
835 	/* A-BFT length override if non-0 */
836 	u8 abft_len;
837 	/* enum wmi_ap_sme_offload_mode_e */
838 	u8 ap_sme_offload_mode;
839 	u8 network_type;
840 	/* enum wmi_channel WMI_CHANNEL_1..WMI_CHANNEL_6; for EDMG this is
841 	 * the primary channel number
842 	 */
843 	u8 channel;
844 	u8 disable_sec_offload;
845 	u8 disable_sec;
846 } __packed;
847 
848 /* WMI_SW_TX_REQ_CMDID */
849 struct wmi_sw_tx_req_cmd {
850 	u8 dst_mac[WMI_MAC_LEN];
851 	__le16 len;
852 	u8 payload[0];
853 } __packed;
854 
855 /* WMI_SW_TX_REQ_EXT_CMDID */
856 struct wmi_sw_tx_req_ext_cmd {
857 	u8 dst_mac[WMI_MAC_LEN];
858 	__le16 len;
859 	__le16 duration_ms;
860 	/* Channel to use, 0xFF for currently active channel */
861 	u8 channel;
862 	u8 reserved[5];
863 	u8 payload[0];
864 } __packed;
865 
866 /* WMI_VRING_SWITCH_TIMING_CONFIG_CMDID */
867 struct wmi_vring_switch_timing_config_cmd {
868 	/* Set vring timing configuration:
869 	 *
870 	 * defined interval for vring switch
871 	 */
872 	__le32 interval_usec;
873 	/* vring inactivity threshold */
874 	__le32 idle_th_usec;
875 } __packed;
876 
877 struct wmi_sw_ring_cfg {
878 	__le64 ring_mem_base;
879 	__le16 ring_size;
880 	__le16 max_mpdu_size;
881 } __packed;
882 
883 /* wmi_vring_cfg_schd */
884 struct wmi_vring_cfg_schd {
885 	__le16 priority;
886 	__le16 timeslot_us;
887 } __packed;
888 
889 enum wmi_vring_cfg_encap_trans_type {
890 	WMI_VRING_ENC_TYPE_802_3	= 0x00,
891 	WMI_VRING_ENC_TYPE_NATIVE_WIFI	= 0x01,
892 	WMI_VRING_ENC_TYPE_NONE		= 0x02,
893 };
894 
895 enum wmi_vring_cfg_ds_cfg {
896 	WMI_VRING_DS_PBSS	= 0x00,
897 	WMI_VRING_DS_STATION	= 0x01,
898 	WMI_VRING_DS_AP		= 0x02,
899 	WMI_VRING_DS_ADDR4	= 0x03,
900 };
901 
902 enum wmi_vring_cfg_nwifi_ds_trans_type {
903 	WMI_NWIFI_TX_TRANS_MODE_NO		= 0x00,
904 	WMI_NWIFI_TX_TRANS_MODE_AP2PBSS		= 0x01,
905 	WMI_NWIFI_TX_TRANS_MODE_STA2PBSS	= 0x02,
906 };
907 
908 enum wmi_vring_cfg_schd_params_priority {
909 	WMI_SCH_PRIO_REGULAR	= 0x00,
910 	WMI_SCH_PRIO_HIGH	= 0x01,
911 };
912 
913 #define CIDXTID_EXTENDED_CID_TID		(0xFF)
914 #define CIDXTID_CID_POS				(0)
915 #define CIDXTID_CID_LEN				(4)
916 #define CIDXTID_CID_MSK				(0xF)
917 #define CIDXTID_TID_POS				(4)
918 #define CIDXTID_TID_LEN				(4)
919 #define CIDXTID_TID_MSK				(0xF0)
920 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_POS	(0)
921 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_LEN	(1)
922 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_MSK	(0x1)
923 #define VRING_CFG_MAC_CTRL_AGGR_EN_POS		(1)
924 #define VRING_CFG_MAC_CTRL_AGGR_EN_LEN		(1)
925 #define VRING_CFG_MAC_CTRL_AGGR_EN_MSK		(0x2)
926 #define VRING_CFG_TO_RESOLUTION_VALUE_POS	(0)
927 #define VRING_CFG_TO_RESOLUTION_VALUE_LEN	(6)
928 #define VRING_CFG_TO_RESOLUTION_VALUE_MSK	(0x3F)
929 
930 struct wmi_vring_cfg {
931 	struct wmi_sw_ring_cfg tx_sw_ring;
932 	/* 0-23 vrings */
933 	u8 ringid;
934 	/* Used for cid less than 8. For higher cid set
935 	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
936 	 */
937 	u8 cidxtid;
938 	u8 encap_trans_type;
939 	/* 802.3 DS cfg */
940 	u8 ds_cfg;
941 	u8 nwifi_ds_trans_type;
942 	u8 mac_ctrl;
943 	u8 to_resolution;
944 	u8 agg_max_wsize;
945 	struct wmi_vring_cfg_schd schd_params;
946 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
947 	u8 cid;
948 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
949 	u8 tid;
950 	/* Update the vring's priority for Qos purpose. Set to
951 	 * WMI_QOS_DEFAULT_PRIORITY to use MID's QoS priority
952 	 */
953 	u8 qos_priority;
954 	u8 reserved;
955 } __packed;
956 
957 enum wmi_vring_cfg_cmd_action {
958 	WMI_VRING_CMD_ADD	= 0x00,
959 	WMI_VRING_CMD_MODIFY	= 0x01,
960 	WMI_VRING_CMD_DELETE	= 0x02,
961 };
962 
963 /* WMI_VRING_CFG_CMDID */
964 struct wmi_vring_cfg_cmd {
965 	__le32 action;
966 	struct wmi_vring_cfg vring_cfg;
967 } __packed;
968 
969 struct wmi_bcast_vring_cfg {
970 	struct wmi_sw_ring_cfg tx_sw_ring;
971 	/* 0-23 vrings */
972 	u8 ringid;
973 	u8 encap_trans_type;
974 	/* 802.3 DS cfg */
975 	u8 ds_cfg;
976 	u8 nwifi_ds_trans_type;
977 } __packed;
978 
979 /* WMI_BCAST_VRING_CFG_CMDID */
980 struct wmi_bcast_vring_cfg_cmd {
981 	__le32 action;
982 	struct wmi_bcast_vring_cfg vring_cfg;
983 } __packed;
984 
985 struct wmi_edma_ring_cfg {
986 	__le64 ring_mem_base;
987 	/* size in number of items */
988 	__le16 ring_size;
989 	u8 ring_id;
990 	u8 reserved;
991 } __packed;
992 
993 enum wmi_rx_msg_type {
994 	WMI_RX_MSG_TYPE_COMPRESSED	= 0x00,
995 	WMI_RX_MSG_TYPE_EXTENDED	= 0x01,
996 };
997 
998 enum wmi_ring_add_irq_mode {
999 	/* Backwards compatibility
1000 	 *  for DESC ring - interrupt disabled
1001 	 *  for STATUS ring - interrupt enabled
1002 	 */
1003 	WMI_RING_ADD_IRQ_MODE_BWC	= 0x00,
1004 	WMI_RING_ADD_IRQ_MODE_DISABLE	= 0x01,
1005 	WMI_RING_ADD_IRQ_MODE_ENABLE	= 0x02,
1006 };
1007 
1008 struct wmi_tx_status_ring_add_cmd {
1009 	struct wmi_edma_ring_cfg ring_cfg;
1010 	u8 irq_index;
1011 	/* wmi_ring_add_irq_mode */
1012 	u8 irq_mode;
1013 	u8 reserved[2];
1014 } __packed;
1015 
1016 struct wmi_rx_status_ring_add_cmd {
1017 	struct wmi_edma_ring_cfg ring_cfg;
1018 	u8 irq_index;
1019 	/* wmi_rx_msg_type */
1020 	u8 rx_msg_type;
1021 	u8 reserved[2];
1022 } __packed;
1023 
1024 struct wmi_cfg_def_rx_offload_cmd {
1025 	__le16 max_msdu_size;
1026 	__le16 max_rx_pl_per_desc;
1027 	u8 decap_trans_type;
1028 	u8 l2_802_3_offload_ctrl;
1029 	u8 l2_nwifi_offload_ctrl;
1030 	u8 vlan_id;
1031 	u8 nwifi_ds_trans_type;
1032 	u8 l3_l4_ctrl;
1033 	u8 reserved[6];
1034 } __packed;
1035 
1036 struct wmi_tx_desc_ring_add_cmd {
1037 	struct wmi_edma_ring_cfg ring_cfg;
1038 	__le16 max_msdu_size;
1039 	/* Correlated status ring (0-63) */
1040 	u8 status_ring_id;
1041 	u8 cid;
1042 	u8 tid;
1043 	u8 encap_trans_type;
1044 	u8 mac_ctrl;
1045 	u8 to_resolution;
1046 	u8 agg_max_wsize;
1047 	u8 irq_index;
1048 	/* wmi_ring_add_irq_mode */
1049 	u8 irq_mode;
1050 	u8 reserved;
1051 	struct wmi_vring_cfg_schd schd_params;
1052 } __packed;
1053 
1054 struct wmi_rx_desc_ring_add_cmd {
1055 	struct wmi_edma_ring_cfg ring_cfg;
1056 	u8 irq_index;
1057 	/* 0-63 status rings */
1058 	u8 status_ring_id;
1059 	u8 reserved[2];
1060 	__le64 sw_tail_host_addr;
1061 } __packed;
1062 
1063 struct wmi_bcast_desc_ring_add_cmd {
1064 	struct wmi_edma_ring_cfg ring_cfg;
1065 	__le16 max_msdu_size;
1066 	/* Correlated status ring (0-63) */
1067 	u8 status_ring_id;
1068 	u8 encap_trans_type;
1069 	u8 reserved[4];
1070 } __packed;
1071 
1072 /* WMI_LO_POWER_CALIB_FROM_OTP_CMDID */
1073 struct wmi_lo_power_calib_from_otp_cmd {
1074 	/* index to read from OTP. zero based */
1075 	u8 index;
1076 	u8 reserved[3];
1077 } __packed;
1078 
1079 /* WMI_LO_POWER_CALIB_FROM_OTP_EVENTID */
1080 struct wmi_lo_power_calib_from_otp_event {
1081 	/* wmi_fw_status */
1082 	u8 status;
1083 	u8 reserved[3];
1084 } __packed;
1085 
1086 /* WMI_RING_BA_EN_CMDID */
1087 struct wmi_ring_ba_en_cmd {
1088 	u8 ring_id;
1089 	u8 agg_max_wsize;
1090 	__le16 ba_timeout;
1091 	u8 amsdu;
1092 	u8 reserved[3];
1093 } __packed;
1094 
1095 /* WMI_RING_BA_DIS_CMDID */
1096 struct wmi_ring_ba_dis_cmd {
1097 	u8 ring_id;
1098 	u8 reserved;
1099 	__le16 reason;
1100 } __packed;
1101 
1102 /* WMI_NOTIFY_REQ_CMDID */
1103 struct wmi_notify_req_cmd {
1104 	u8 cid;
1105 	u8 year;
1106 	u8 month;
1107 	u8 day;
1108 	__le32 interval_usec;
1109 	u8 hour;
1110 	u8 minute;
1111 	u8 second;
1112 	u8 miliseconds;
1113 } __packed;
1114 
1115 /* WMI_CFG_RX_CHAIN_CMDID */
1116 enum wmi_sniffer_cfg_mode {
1117 	WMI_SNIFFER_OFF	= 0x00,
1118 	WMI_SNIFFER_ON	= 0x01,
1119 };
1120 
1121 /* WMI_SILENT_RSSI_TABLE */
1122 enum wmi_silent_rssi_table {
1123 	RF_TEMPERATURE_CALIB_DEFAULT_DB		= 0x00,
1124 	RF_TEMPERATURE_CALIB_HIGH_POWER_DB	= 0x01,
1125 };
1126 
1127 /* WMI_SILENT_RSSI_STATUS */
1128 enum wmi_silent_rssi_status {
1129 	SILENT_RSSI_SUCCESS	= 0x00,
1130 	SILENT_RSSI_FAILURE	= 0x01,
1131 };
1132 
1133 /* WMI_SET_ACTIVE_SILENT_RSSI_TABLE_CMDID */
1134 struct wmi_set_active_silent_rssi_table_cmd {
1135 	/* enum wmi_silent_rssi_table */
1136 	__le32 table;
1137 } __packed;
1138 
1139 enum wmi_sniffer_cfg_phy_info_mode {
1140 	WMI_SNIFFER_PHY_INFO_DISABLED	= 0x00,
1141 	WMI_SNIFFER_PHY_INFO_ENABLED	= 0x01,
1142 };
1143 
1144 enum wmi_sniffer_cfg_phy_support {
1145 	WMI_SNIFFER_CP		= 0x00,
1146 	WMI_SNIFFER_DP		= 0x01,
1147 	WMI_SNIFFER_BOTH_PHYS	= 0x02,
1148 };
1149 
1150 /* wmi_sniffer_cfg */
1151 struct wmi_sniffer_cfg {
1152 	/* enum wmi_sniffer_cfg_mode */
1153 	__le32 mode;
1154 	/* enum wmi_sniffer_cfg_phy_info_mode */
1155 	__le32 phy_info_mode;
1156 	/* enum wmi_sniffer_cfg_phy_support */
1157 	__le32 phy_support;
1158 	u8 channel;
1159 	u8 reserved[3];
1160 } __packed;
1161 
1162 enum wmi_cfg_rx_chain_cmd_action {
1163 	WMI_RX_CHAIN_ADD	= 0x00,
1164 	WMI_RX_CHAIN_DEL	= 0x01,
1165 };
1166 
1167 enum wmi_cfg_rx_chain_cmd_decap_trans_type {
1168 	WMI_DECAP_TYPE_802_3		= 0x00,
1169 	WMI_DECAP_TYPE_NATIVE_WIFI	= 0x01,
1170 	WMI_DECAP_TYPE_NONE		= 0x02,
1171 };
1172 
1173 enum wmi_cfg_rx_chain_cmd_nwifi_ds_trans_type {
1174 	WMI_NWIFI_RX_TRANS_MODE_NO		= 0x00,
1175 	WMI_NWIFI_RX_TRANS_MODE_PBSS2AP		= 0x01,
1176 	WMI_NWIFI_RX_TRANS_MODE_PBSS2STA	= 0x02,
1177 };
1178 
1179 enum wmi_cfg_rx_chain_cmd_reorder_type {
1180 	WMI_RX_HW_REORDER	= 0x00,
1181 	WMI_RX_SW_REORDER	= 0x01,
1182 };
1183 
1184 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_POS	(0)
1185 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_LEN	(1)
1186 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_MSK	(0x1)
1187 #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_POS		(1)
1188 #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_LEN		(1)
1189 #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_MSK		(0x2)
1190 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_POS		(0)
1191 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_LEN		(1)
1192 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_MSK		(0x1)
1193 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_POS		(1)
1194 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_LEN		(1)
1195 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_MSK		(0x2)
1196 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_POS			(0)
1197 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_LEN			(1)
1198 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_MSK			(0x1)
1199 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_POS		(1)
1200 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_LEN		(1)
1201 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_MSK		(0x2)
1202 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_POS		(0)
1203 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_LEN		(1)
1204 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_MSK		(0x1)
1205 #define RING_CTRL_OVERRIDE_WB_THRSH_POS			(1)
1206 #define RING_CTRL_OVERRIDE_WB_THRSH_LEN			(1)
1207 #define RING_CTRL_OVERRIDE_WB_THRSH_MSK			(0x2)
1208 #define RING_CTRL_OVERRIDE_ITR_THRSH_POS		(2)
1209 #define RING_CTRL_OVERRIDE_ITR_THRSH_LEN		(1)
1210 #define RING_CTRL_OVERRIDE_ITR_THRSH_MSK		(0x4)
1211 #define RING_CTRL_OVERRIDE_HOST_THRSH_POS		(3)
1212 #define RING_CTRL_OVERRIDE_HOST_THRSH_LEN		(1)
1213 #define RING_CTRL_OVERRIDE_HOST_THRSH_MSK		(0x8)
1214 
1215 /* WMI_CFG_RX_CHAIN_CMDID */
1216 struct wmi_cfg_rx_chain_cmd {
1217 	__le32 action;
1218 	struct wmi_sw_ring_cfg rx_sw_ring;
1219 	u8 mid;
1220 	u8 decap_trans_type;
1221 	u8 l2_802_3_offload_ctrl;
1222 	u8 l2_nwifi_offload_ctrl;
1223 	u8 vlan_id;
1224 	u8 nwifi_ds_trans_type;
1225 	u8 l3_l4_ctrl;
1226 	u8 ring_ctrl;
1227 	__le16 prefetch_thrsh;
1228 	__le16 wb_thrsh;
1229 	__le32 itr_value;
1230 	__le16 host_thrsh;
1231 	u8 reorder_type;
1232 	u8 reserved;
1233 	struct wmi_sniffer_cfg sniffer_cfg;
1234 	__le16 max_rx_pl_per_desc;
1235 } __packed;
1236 
1237 /* WMI_RCP_ADDBA_RESP_CMDID */
1238 struct wmi_rcp_addba_resp_cmd {
1239 	/* Used for cid less than 8. For higher cid set
1240 	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
1241 	 */
1242 	u8 cidxtid;
1243 	u8 dialog_token;
1244 	__le16 status_code;
1245 	/* ieee80211_ba_parameterset field to send */
1246 	__le16 ba_param_set;
1247 	__le16 ba_timeout;
1248 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
1249 	u8 cid;
1250 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
1251 	u8 tid;
1252 	u8 reserved[2];
1253 } __packed;
1254 
1255 /* WMI_RCP_ADDBA_RESP_EDMA_CMDID */
1256 struct wmi_rcp_addba_resp_edma_cmd {
1257 	u8 cid;
1258 	u8 tid;
1259 	u8 dialog_token;
1260 	u8 reserved;
1261 	__le16 status_code;
1262 	/* ieee80211_ba_parameterset field to send */
1263 	__le16 ba_param_set;
1264 	__le16 ba_timeout;
1265 	u8 status_ring_id;
1266 	/* wmi_cfg_rx_chain_cmd_reorder_type */
1267 	u8 reorder_type;
1268 } __packed;
1269 
1270 /* WMI_RCP_DELBA_CMDID */
1271 struct wmi_rcp_delba_cmd {
1272 	/* Used for cid less than 8. For higher cid set
1273 	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
1274 	 */
1275 	u8 cidxtid;
1276 	u8 reserved;
1277 	__le16 reason;
1278 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
1279 	u8 cid;
1280 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
1281 	u8 tid;
1282 	u8 reserved2[2];
1283 } __packed;
1284 
1285 /* WMI_RCP_ADDBA_REQ_CMDID */
1286 struct wmi_rcp_addba_req_cmd {
1287 	/* Used for cid less than 8. For higher cid set
1288 	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
1289 	 */
1290 	u8 cidxtid;
1291 	u8 dialog_token;
1292 	/* ieee80211_ba_parameterset field as it received */
1293 	__le16 ba_param_set;
1294 	__le16 ba_timeout;
1295 	/* ieee80211_ba_seqstrl field as it received */
1296 	__le16 ba_seq_ctrl;
1297 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
1298 	u8 cid;
1299 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
1300 	u8 tid;
1301 	u8 reserved[2];
1302 } __packed;
1303 
1304 /* WMI_SET_MAC_ADDRESS_CMDID */
1305 struct wmi_set_mac_address_cmd {
1306 	u8 mac[WMI_MAC_LEN];
1307 	u8 reserved[2];
1308 } __packed;
1309 
1310 /* WMI_ECHO_CMDID
1311  * Check FW is alive
1312  * Returned event: WMI_ECHO_RSP_EVENTID
1313  */
1314 struct wmi_echo_cmd {
1315 	__le32 value;
1316 } __packed;
1317 
1318 /* WMI_DEEP_ECHO_CMDID
1319  * Check FW and uCode is alive
1320  * Returned event: WMI_DEEP_ECHO_RSP_EVENTID
1321  */
1322 struct wmi_deep_echo_cmd {
1323 	__le32 value;
1324 } __packed;
1325 
1326 /* WMI_RF_PWR_ON_DELAY_CMDID
1327  * set FW time parameters used through RF resetting
1328  *  RF reset consists of bringing its power down for a period of time, then
1329  * bringing the power up
1330  * Returned event: WMI_RF_PWR_ON_DELAY_RSP_EVENTID
1331  */
1332 struct wmi_rf_pwr_on_delay_cmd {
1333 	/* time in usec the FW waits after bringing the RF PWR down,
1334 	 * set 0 for default
1335 	 */
1336 	__le16 down_delay_usec;
1337 	/* time in usec the FW waits after bringing the RF PWR up,
1338 	 * set 0 for default
1339 	 */
1340 	__le16 up_delay_usec;
1341 } __packed;
1342 
1343 /* WMI_SET_HIGH_POWER_TABLE_PARAMS_CMDID
1344  * This API controls the Tx and Rx gain over temperature.
1345  * It controls the Tx D-type, Rx D-type and Rx E-type amplifiers.
1346  * It also controls the Tx gain index, by controlling the Rx to Tx gain index
1347  * offset.
1348  * The control is divided by 3 temperature values to 4 temperature ranges.
1349  * Each parameter uses its own temperature values.
1350  * Returned event: WMI_SET_HIGH_POWER_TABLE_PARAMS_EVENTID
1351  */
1352 struct wmi_set_high_power_table_params_cmd {
1353 	/* Temperature range for Tx D-type parameters */
1354 	u8 tx_dtype_temp[WMI_RF_DTYPE_LENGTH];
1355 	u8 reserved0;
1356 	/* Tx D-type values to be used for each temperature range */
1357 	__le32 tx_dtype_conf[WMI_RF_DTYPE_CONF_LENGTH];
1358 	/* Temperature range for Tx E-type parameters */
1359 	u8 tx_etype_temp[WMI_RF_ETYPE_LENGTH];
1360 	u8 reserved1;
1361 	/* Tx E-type values to be used for each temperature range.
1362 	 * The last 4 values of any range are the first 4 values of the next
1363 	 * range and so on
1364 	 */
1365 	__le32 tx_etype_conf[WMI_RF_ETYPE_CONF_LENGTH];
1366 	/* Temperature range for Rx D-type parameters */
1367 	u8 rx_dtype_temp[WMI_RF_DTYPE_LENGTH];
1368 	u8 reserved2;
1369 	/* Rx D-type values to be used for each temperature range */
1370 	__le32 rx_dtype_conf[WMI_RF_DTYPE_CONF_LENGTH];
1371 	/* Temperature range for Rx E-type parameters */
1372 	u8 rx_etype_temp[WMI_RF_ETYPE_LENGTH];
1373 	u8 reserved3;
1374 	/* Rx E-type values to be used for each temperature range.
1375 	 * The last 4 values of any range are the first 4 values of the next
1376 	 * range and so on
1377 	 */
1378 	__le32 rx_etype_conf[WMI_RF_ETYPE_CONF_LENGTH];
1379 	/* Temperature range for rx_2_tx_offs parameters */
1380 	u8 rx_2_tx_temp[WMI_RF_RX2TX_LENGTH];
1381 	u8 reserved4;
1382 	/* Rx to Tx gain index offset */
1383 	s8 rx_2_tx_offs[WMI_RF_RX2TX_CONF_LENGTH];
1384 } __packed;
1385 
1386 /* WMI_FIXED_SCHEDULING_UL_CONFIG_CMDID
1387  * This API sets rd parameter per mcs.
1388  * Relevant only in Fixed Scheduling mode.
1389  * Returned event: WMI_FIXED_SCHEDULING_UL_CONFIG_EVENTID
1390  */
1391 struct wmi_fixed_scheduling_ul_config_cmd {
1392 	/* Use mcs -1 to set for every mcs */
1393 	s8 mcs;
1394 	/* Number of frames with rd bit set in a single virtual slot */
1395 	u8 rd_count_per_slot;
1396 	u8 reserved[2];
1397 } __packed;
1398 
1399 /* CMD: WMI_RF_XPM_READ_CMDID */
1400 struct wmi_rf_xpm_read_cmd {
1401 	u8 rf_id;
1402 	u8 reserved[3];
1403 	/* XPM bit start address in range [0,8191]bits - rounded by FW to
1404 	 * multiple of 8bits
1405 	 */
1406 	__le32 xpm_bit_address;
1407 	__le32 num_bytes;
1408 } __packed;
1409 
1410 /* CMD: WMI_RF_XPM_WRITE_CMDID */
1411 struct wmi_rf_xpm_write_cmd {
1412 	u8 rf_id;
1413 	u8 reserved0[3];
1414 	/* XPM bit start address in range [0,8191]bits - rounded by FW to
1415 	 * multiple of 8bits
1416 	 */
1417 	__le32 xpm_bit_address;
1418 	__le32 num_bytes;
1419 	/* boolean flag indicating whether FW should verify the write
1420 	 * operation
1421 	 */
1422 	u8 verify;
1423 	u8 reserved1[3];
1424 	/* actual size=num_bytes */
1425 	u8 data_bytes[0];
1426 } __packed;
1427 
1428 /* Possible modes for temperature measurement */
1429 enum wmi_temperature_measure_mode {
1430 	TEMPERATURE_USE_OLD_VALUE	= 0x01,
1431 	TEMPERATURE_MEASURE_NOW		= 0x02,
1432 };
1433 
1434 /* WMI_TEMP_SENSE_CMDID */
1435 struct wmi_temp_sense_cmd {
1436 	__le32 measure_baseband_en;
1437 	__le32 measure_rf_en;
1438 	__le32 measure_mode;
1439 } __packed;
1440 
1441 enum wmi_pmc_op {
1442 	WMI_PMC_ALLOCATE	= 0x00,
1443 	WMI_PMC_RELEASE		= 0x01,
1444 };
1445 
1446 /* WMI_PMC_CMDID */
1447 struct wmi_pmc_cmd {
1448 	/* enum wmi_pmc_cmd_op_type */
1449 	u8 op;
1450 	u8 reserved;
1451 	__le16 ring_size;
1452 	__le64 mem_base;
1453 } __packed;
1454 
1455 enum wmi_aoa_meas_type {
1456 	WMI_AOA_PHASE_MEAS	= 0x00,
1457 	WMI_AOA_PHASE_AMP_MEAS	= 0x01,
1458 };
1459 
1460 /* WMI_AOA_MEAS_CMDID */
1461 struct wmi_aoa_meas_cmd {
1462 	u8 mac_addr[WMI_MAC_LEN];
1463 	/* channels IDs:
1464 	 * 0 - 58320 MHz
1465 	 * 1 - 60480 MHz
1466 	 * 2 - 62640 MHz
1467 	 */
1468 	u8 channel;
1469 	/* enum wmi_aoa_meas_type */
1470 	u8 aoa_meas_type;
1471 	__le32 meas_rf_mask;
1472 } __packed;
1473 
1474 /* WMI_SET_MGMT_RETRY_LIMIT_CMDID */
1475 struct wmi_set_mgmt_retry_limit_cmd {
1476 	/* MAC retransmit limit for mgmt frames */
1477 	u8 mgmt_retry_limit;
1478 	/* alignment to 32b */
1479 	u8 reserved[3];
1480 } __packed;
1481 
1482 /* Zones: HIGH, MAX, CRITICAL */
1483 #define WMI_NUM_OF_TT_ZONES	(3)
1484 
1485 struct wmi_tt_zone_limits {
1486 	/* Above this temperature this zone is active */
1487 	u8 temperature_high;
1488 	/* Below this temperature the adjacent lower zone is active */
1489 	u8 temperature_low;
1490 	u8 reserved[2];
1491 } __packed;
1492 
1493 /* Struct used for both configuration and status commands of thermal
1494  * throttling
1495  */
1496 struct wmi_tt_data {
1497 	/* Enable/Disable TT algorithm for baseband */
1498 	u8 bb_enabled;
1499 	u8 reserved0[3];
1500 	/* Define zones for baseband */
1501 	struct wmi_tt_zone_limits bb_zones[WMI_NUM_OF_TT_ZONES];
1502 	/* Enable/Disable TT algorithm for radio */
1503 	u8 rf_enabled;
1504 	u8 reserved1[3];
1505 	/* Define zones for all radio chips */
1506 	struct wmi_tt_zone_limits rf_zones[WMI_NUM_OF_TT_ZONES];
1507 } __packed;
1508 
1509 /* WMI_SET_THERMAL_THROTTLING_CFG_CMDID */
1510 struct wmi_set_thermal_throttling_cfg_cmd {
1511 	/* Command data */
1512 	struct wmi_tt_data tt_data;
1513 } __packed;
1514 
1515 /* WMI_NEW_STA_CMDID */
1516 struct wmi_new_sta_cmd {
1517 	u8 dst_mac[WMI_MAC_LEN];
1518 	u8 aid;
1519 } __packed;
1520 
1521 /* WMI_DEL_STA_CMDID */
1522 struct wmi_del_sta_cmd {
1523 	u8 dst_mac[WMI_MAC_LEN];
1524 	__le16 disconnect_reason;
1525 } __packed;
1526 
1527 enum wmi_tof_burst_duration {
1528 	WMI_TOF_BURST_DURATION_250_USEC		= 2,
1529 	WMI_TOF_BURST_DURATION_500_USEC		= 3,
1530 	WMI_TOF_BURST_DURATION_1_MSEC		= 4,
1531 	WMI_TOF_BURST_DURATION_2_MSEC		= 5,
1532 	WMI_TOF_BURST_DURATION_4_MSEC		= 6,
1533 	WMI_TOF_BURST_DURATION_8_MSEC		= 7,
1534 	WMI_TOF_BURST_DURATION_16_MSEC		= 8,
1535 	WMI_TOF_BURST_DURATION_32_MSEC		= 9,
1536 	WMI_TOF_BURST_DURATION_64_MSEC		= 10,
1537 	WMI_TOF_BURST_DURATION_128_MSEC		= 11,
1538 	WMI_TOF_BURST_DURATION_NO_PREFERENCES	= 15,
1539 };
1540 
1541 enum wmi_tof_session_start_flags {
1542 	WMI_TOF_SESSION_START_FLAG_SECURED	= 0x1,
1543 	WMI_TOF_SESSION_START_FLAG_ASAP		= 0x2,
1544 	WMI_TOF_SESSION_START_FLAG_LCI_REQ	= 0x4,
1545 	WMI_TOF_SESSION_START_FLAG_LCR_REQ	= 0x8,
1546 };
1547 
1548 /* WMI_TOF_SESSION_START_CMDID */
1549 struct wmi_ftm_dest_info {
1550 	u8 channel;
1551 	/* wmi_tof_session_start_flags_e */
1552 	u8 flags;
1553 	u8 initial_token;
1554 	u8 num_of_ftm_per_burst;
1555 	u8 num_of_bursts_exp;
1556 	/* wmi_tof_burst_duration_e */
1557 	u8 burst_duration;
1558 	/* Burst Period indicate interval between two consecutive burst
1559 	 * instances, in units of 100 ms
1560 	 */
1561 	__le16 burst_period;
1562 	u8 dst_mac[WMI_MAC_LEN];
1563 	u8 reserved;
1564 	u8 num_burst_per_aoa_meas;
1565 } __packed;
1566 
1567 /* WMI_TOF_SESSION_START_CMDID */
1568 struct wmi_tof_session_start_cmd {
1569 	__le32 session_id;
1570 	u8 reserved1;
1571 	u8 aoa_type;
1572 	__le16 num_of_dest;
1573 	u8 reserved[4];
1574 	struct wmi_ftm_dest_info ftm_dest_info[0];
1575 } __packed;
1576 
1577 /* WMI_TOF_CFG_RESPONDER_CMDID */
1578 struct wmi_tof_cfg_responder_cmd {
1579 	u8 enable;
1580 	u8 reserved[3];
1581 } __packed;
1582 
1583 enum wmi_tof_channel_info_report_type {
1584 	WMI_TOF_CHANNEL_INFO_TYPE_CIR			= 0x1,
1585 	WMI_TOF_CHANNEL_INFO_TYPE_RSSI			= 0x2,
1586 	WMI_TOF_CHANNEL_INFO_TYPE_SNR			= 0x4,
1587 	WMI_TOF_CHANNEL_INFO_TYPE_DEBUG_DATA		= 0x8,
1588 	WMI_TOF_CHANNEL_INFO_TYPE_VENDOR_SPECIFIC	= 0x10,
1589 };
1590 
1591 /* WMI_TOF_CHANNEL_INFO_CMDID */
1592 struct wmi_tof_channel_info_cmd {
1593 	/* wmi_tof_channel_info_report_type_e */
1594 	__le32 channel_info_report_request;
1595 } __packed;
1596 
1597 /* WMI_TOF_SET_TX_RX_OFFSET_CMDID */
1598 struct wmi_tof_set_tx_rx_offset_cmd {
1599 	/* TX delay offset */
1600 	__le32 tx_offset;
1601 	/* RX delay offset */
1602 	__le32 rx_offset;
1603 	/* Mask to define which RFs to configure. 0 means all RFs */
1604 	__le32 rf_mask;
1605 	/* Offset to strongest tap of CIR */
1606 	__le32 precursor;
1607 } __packed;
1608 
1609 /* WMI_TOF_GET_TX_RX_OFFSET_CMDID */
1610 struct wmi_tof_get_tx_rx_offset_cmd {
1611 	/* rf index to read offsets from */
1612 	u8 rf_index;
1613 	u8 reserved[3];
1614 } __packed;
1615 
1616 /* WMI_FIXED_SCHEDULING_CONFIG_CMDID */
1617 struct wmi_map_mcs_to_schd_params {
1618 	u8 mcs;
1619 	/* time in usec from start slot to start tx flow - default 15 */
1620 	u8 time_in_usec_before_initiate_tx;
1621 	/* RD enable - if yes consider RD according to STA mcs */
1622 	u8 rd_enabled;
1623 	u8 reserved;
1624 	/* time in usec from start slot to stop vring */
1625 	__le16 time_in_usec_to_stop_vring;
1626 	/* timeout to force flush from start of slot */
1627 	__le16 flush_to_in_usec;
1628 	/* per mcs the mac buffer limit size in bytes */
1629 	__le32 mac_buff_size_in_bytes;
1630 } __packed;
1631 
1632 /* WMI_FIXED_SCHEDULING_CONFIG_COMPLETE_EVENTID */
1633 struct wmi_fixed_scheduling_config_complete_event {
1634 	/* wmi_fw_status */
1635 	u8 status;
1636 	u8 reserved[3];
1637 } __packed;
1638 
1639 /* This value exists for backwards compatibility only.
1640  * Do not use it in new commands.
1641  * Use dynamic arrays where possible.
1642  */
1643 #define WMI_NUM_MCS	(13)
1644 
1645 /* WMI_FIXED_SCHEDULING_CONFIG_CMDID */
1646 struct wmi_fixed_scheduling_config_cmd {
1647 	/* defaults in the SAS table */
1648 	struct wmi_map_mcs_to_schd_params mcs_to_schd_params_map[WMI_NUM_MCS];
1649 	/* default 150 uSec */
1650 	__le16 max_sta_rd_ppdu_duration_in_usec;
1651 	/* default 300 uSec */
1652 	__le16 max_sta_grant_ppdu_duration_in_usec;
1653 	/* default 1000 uSec */
1654 	__le16 assoc_slot_duration_in_usec;
1655 	/* default 360 uSec */
1656 	__le16 virtual_slot_duration_in_usec;
1657 	/* each this field value slots start with grant frame to the station
1658 	 * - default 2
1659 	 */
1660 	u8 number_of_ap_slots_for_initiate_grant;
1661 	u8 reserved[3];
1662 } __packed;
1663 
1664 /* WMI_ENABLE_FIXED_SCHEDULING_CMDID */
1665 struct wmi_enable_fixed_scheduling_cmd {
1666 	__le32 reserved;
1667 } __packed;
1668 
1669 /* WMI_ENABLE_FIXED_SCHEDULING_COMPLETE_EVENTID */
1670 struct wmi_enable_fixed_scheduling_complete_event {
1671 	/* wmi_fw_status */
1672 	u8 status;
1673 	u8 reserved[3];
1674 } __packed;
1675 
1676 /* WMI_SET_MULTI_DIRECTED_OMNIS_CONFIG_CMDID */
1677 struct wmi_set_multi_directed_omnis_config_cmd {
1678 	/* number of directed omnis at destination AP */
1679 	u8 dest_ap_num_directed_omnis;
1680 	u8 reserved[3];
1681 } __packed;
1682 
1683 /* WMI_SET_MULTI_DIRECTED_OMNIS_CONFIG_EVENTID */
1684 struct wmi_set_multi_directed_omnis_config_event {
1685 	/* wmi_fw_status */
1686 	u8 status;
1687 	u8 reserved[3];
1688 } __packed;
1689 
1690 /* WMI_RADAR_GENERAL_CONFIG_EVENTID */
1691 struct wmi_radar_general_config_event {
1692 	/* wmi_fw_status */
1693 	u8 status;
1694 	u8 reserved[3];
1695 } __packed;
1696 
1697 /* WMI_RADAR_CONFIG_SELECT_EVENTID */
1698 struct wmi_radar_config_select_event {
1699 	/* wmi_fw_status */
1700 	u8 status;
1701 	u8 reserved[3];
1702 	/* In unit of bytes */
1703 	__le32 fifo_size;
1704 	/* In unit of bytes */
1705 	__le32 pulse_size;
1706 } __packed;
1707 
1708 /* WMI_RADAR_PARAMS_CONFIG_EVENTID */
1709 struct wmi_radar_params_config_event {
1710 	/* wmi_fw_status */
1711 	u8 status;
1712 	u8 reserved[3];
1713 } __packed;
1714 
1715 /* WMI_RADAR_SET_MODE_EVENTID */
1716 struct wmi_radar_set_mode_event {
1717 	/* wmi_fw_status */
1718 	u8 status;
1719 	u8 reserved[3];
1720 } __packed;
1721 
1722 /* WMI_RADAR_CONTROL_EVENTID */
1723 struct wmi_radar_control_event {
1724 	/* wmi_fw_status */
1725 	u8 status;
1726 	u8 reserved[3];
1727 } __packed;
1728 
1729 /* WMI_RADAR_PCI_CONTROL_EVENTID */
1730 struct wmi_radar_pci_control_event {
1731 	/* wmi_fw_status */
1732 	u8 status;
1733 	u8 reserved[3];
1734 } __packed;
1735 
1736 /* WMI_SET_LONG_RANGE_CONFIG_CMDID */
1737 struct wmi_set_long_range_config_cmd {
1738 	__le32 reserved;
1739 } __packed;
1740 
1741 /* WMI_SET_LONG_RANGE_CONFIG_COMPLETE_EVENTID */
1742 struct wmi_set_long_range_config_complete_event {
1743 	/* wmi_fw_status */
1744 	u8 status;
1745 	u8 reserved[3];
1746 } __packed;
1747 
1748 /* payload max size is 1024 bytes: max event buffer size (1044) - WMI headers
1749  * (16) - prev struct field size (4)
1750  */
1751 #define WMI_MAX_IOCTL_PAYLOAD_SIZE		(1024)
1752 #define WMI_MAX_IOCTL_REPLY_PAYLOAD_SIZE	(1024)
1753 #define WMI_MAX_INTERNAL_EVENT_PAYLOAD_SIZE	(1024)
1754 
1755 enum wmi_internal_fw_ioctl_code {
1756 	WMI_INTERNAL_FW_CODE_NONE	= 0x0,
1757 	WMI_INTERNAL_FW_CODE_QCOM	= 0x1,
1758 };
1759 
1760 /* WMI_INTERNAL_FW_IOCTL_CMDID */
1761 struct wmi_internal_fw_ioctl_cmd {
1762 	/* enum wmi_internal_fw_ioctl_code */
1763 	__le16 code;
1764 	__le16 length;
1765 	/* payload max size is WMI_MAX_IOCTL_PAYLOAD_SIZE
1766 	 * Must be the last member of the struct
1767 	 */
1768 	__le32 payload[0];
1769 } __packed;
1770 
1771 /* WMI_INTERNAL_FW_IOCTL_EVENTID */
1772 struct wmi_internal_fw_ioctl_event {
1773 	/* wmi_fw_status */
1774 	u8 status;
1775 	u8 reserved;
1776 	__le16 length;
1777 	/* payload max size is WMI_MAX_IOCTL_REPLY_PAYLOAD_SIZE
1778 	 * Must be the last member of the struct
1779 	 */
1780 	__le32 payload[0];
1781 } __packed;
1782 
1783 /* WMI_INTERNAL_FW_EVENT_EVENTID */
1784 struct wmi_internal_fw_event_event {
1785 	__le16 id;
1786 	__le16 length;
1787 	/* payload max size is WMI_MAX_INTERNAL_EVENT_PAYLOAD_SIZE
1788 	 * Must be the last member of the struct
1789 	 */
1790 	__le32 payload[0];
1791 } __packed;
1792 
1793 /* WMI_SET_VRING_PRIORITY_WEIGHT_CMDID */
1794 struct wmi_set_vring_priority_weight_cmd {
1795 	/* Array of weights. Valid values are
1796 	 * WMI_QOS_MIN_DEFAULT_WEIGHT...WMI_QOS_MAX_WEIGHT. Weight #0 is
1797 	 * hard-coded WMI_QOS_MIN_WEIGHT. This array provide the weights
1798 	 * #1..#3
1799 	 */
1800 	u8 weight[3];
1801 	u8 reserved;
1802 } __packed;
1803 
1804 /* WMI_SET_VRING_PRIORITY_CMDID */
1805 struct wmi_vring_priority {
1806 	u8 vring_idx;
1807 	/* Weight index. Valid value is 0-3 */
1808 	u8 priority;
1809 	u8 reserved[2];
1810 } __packed;
1811 
1812 /* WMI_SET_VRING_PRIORITY_CMDID */
1813 struct wmi_set_vring_priority_cmd {
1814 	/* number of entries in vring_priority. Set to
1815 	 * WMI_QOS_SET_VIF_PRIORITY to update the VIF's priority, and there
1816 	 * will be only one entry in vring_priority
1817 	 */
1818 	u8 num_of_vrings;
1819 	u8 reserved[3];
1820 	struct wmi_vring_priority vring_priority[0];
1821 } __packed;
1822 
1823 /* WMI_BF_CONTROL_CMDID - deprecated */
1824 struct wmi_bf_control_cmd {
1825 	/* wmi_bf_triggers */
1826 	__le32 triggers;
1827 	u8 cid;
1828 	/* DISABLED = 0, ENABLED = 1 , DRY_RUN = 2 */
1829 	u8 txss_mode;
1830 	/* DISABLED = 0, ENABLED = 1, DRY_RUN = 2 */
1831 	u8 brp_mode;
1832 	/* Max cts threshold (correspond to
1833 	 * WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_TXOP)
1834 	 */
1835 	u8 bf_trigger_max_cts_failure_thr;
1836 	/* Max cts threshold in dense (correspond to
1837 	 * WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_TXOP)
1838 	 */
1839 	u8 bf_trigger_max_cts_failure_dense_thr;
1840 	/* Max b-ack threshold (correspond to
1841 	 * WMI_BF_TRIGGER_MAX_BACK_FAILURE)
1842 	 */
1843 	u8 bf_trigger_max_back_failure_thr;
1844 	/* Max b-ack threshold in dense (correspond to
1845 	 * WMI_BF_TRIGGER_MAX_BACK_FAILURE)
1846 	 */
1847 	u8 bf_trigger_max_back_failure_dense_thr;
1848 	u8 reserved0;
1849 	/* Wrong sectors threshold */
1850 	__le32 wrong_sector_bis_thr;
1851 	/* BOOL to enable/disable long term trigger */
1852 	u8 long_term_enable;
1853 	/* 1 = Update long term thresholds from the long_term_mbps_th_tbl and
1854 	 * long_term_trig_timeout_per_mcs arrays, 0 = Ignore
1855 	 */
1856 	u8 long_term_update_thr;
1857 	/* Long term throughput threshold [Mbps] */
1858 	u8 long_term_mbps_th_tbl[WMI_NUM_MCS];
1859 	u8 reserved1;
1860 	/* Long term timeout threshold table [msec] */
1861 	__le16 long_term_trig_timeout_per_mcs[WMI_NUM_MCS];
1862 	u8 reserved2[2];
1863 } __packed;
1864 
1865 /* BF configuration for each MCS */
1866 struct wmi_bf_control_ex_mcs {
1867 	/* Long term throughput threshold [Mbps] */
1868 	u8 long_term_mbps_th_tbl;
1869 	u8 reserved;
1870 	/* Long term timeout threshold table [msec] */
1871 	__le16 long_term_trig_timeout_per_mcs;
1872 } __packed;
1873 
1874 /* WMI_BF_CONTROL_EX_CMDID */
1875 struct wmi_bf_control_ex_cmd {
1876 	/* wmi_bf_triggers */
1877 	__le32 triggers;
1878 	/* enum wmi_edmg_tx_mode */
1879 	u8 tx_mode;
1880 	/* DISABLED = 0, ENABLED = 1 , DRY_RUN = 2 */
1881 	u8 txss_mode;
1882 	/* DISABLED = 0, ENABLED = 1, DRY_RUN = 2 */
1883 	u8 brp_mode;
1884 	/* Max cts threshold (correspond to
1885 	 * WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_TXOP)
1886 	 */
1887 	u8 bf_trigger_max_cts_failure_thr;
1888 	/* Max cts threshold in dense (correspond to
1889 	 * WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_TXOP)
1890 	 */
1891 	u8 bf_trigger_max_cts_failure_dense_thr;
1892 	/* Max b-ack threshold (correspond to
1893 	 * WMI_BF_TRIGGER_MAX_BACK_FAILURE)
1894 	 */
1895 	u8 bf_trigger_max_back_failure_thr;
1896 	/* Max b-ack threshold in dense (correspond to
1897 	 * WMI_BF_TRIGGER_MAX_BACK_FAILURE)
1898 	 */
1899 	u8 bf_trigger_max_back_failure_dense_thr;
1900 	u8 reserved0;
1901 	/* Wrong sectors threshold */
1902 	__le32 wrong_sector_bis_thr;
1903 	/* BOOL to enable/disable long term trigger */
1904 	u8 long_term_enable;
1905 	/* 1 = Update long term thresholds from the long_term_mbps_th_tbl and
1906 	 * long_term_trig_timeout_per_mcs arrays, 0 = Ignore
1907 	 */
1908 	u8 long_term_update_thr;
1909 	u8 each_mcs_cfg_size;
1910 	u8 reserved1;
1911 	/* Configuration for each MCS */
1912 	struct wmi_bf_control_ex_mcs each_mcs_cfg[0];
1913 } __packed;
1914 
1915 /* WMI_LINK_STATS_CMD */
1916 enum wmi_link_stats_action {
1917 	WMI_LINK_STATS_SNAPSHOT		= 0x00,
1918 	WMI_LINK_STATS_PERIODIC		= 0x01,
1919 	WMI_LINK_STATS_STOP_PERIODIC	= 0x02,
1920 };
1921 
1922 /* WMI_LINK_STATS_EVENT record identifiers */
1923 enum wmi_link_stats_record_type {
1924 	WMI_LINK_STATS_TYPE_BASIC	= 0x01,
1925 	WMI_LINK_STATS_TYPE_GLOBAL	= 0x02,
1926 };
1927 
1928 /* WMI_LINK_STATS_CMDID */
1929 struct wmi_link_stats_cmd {
1930 	/* bitmask of required record types
1931 	 * (wmi_link_stats_record_type_e)
1932 	 */
1933 	__le32 record_type_mask;
1934 	/* 0xff for all cids */
1935 	u8 cid;
1936 	/* wmi_link_stats_action_e */
1937 	u8 action;
1938 	u8 reserved[6];
1939 	/* range = 100 - 10000 */
1940 	__le32 interval_msec;
1941 } __packed;
1942 
1943 /* WMI_SET_GRANT_MCS_CMDID */
1944 struct wmi_set_grant_mcs_cmd {
1945 	u8 mcs;
1946 	u8 reserved[3];
1947 } __packed;
1948 
1949 /* WMI_SET_AP_SLOT_SIZE_CMDID */
1950 struct wmi_set_ap_slot_size_cmd {
1951 	__le32 slot_size;
1952 } __packed;
1953 
1954 /* WMI_TEMP_SENSE_ALL_CMDID */
1955 struct wmi_temp_sense_all_cmd {
1956 	u8 measure_baseband_en;
1957 	u8 measure_rf_en;
1958 	u8 measure_mode;
1959 	u8 reserved;
1960 } __packed;
1961 
1962 /* WMI Events
1963  * List of Events (target to host)
1964  */
1965 enum wmi_event_id {
1966 	WMI_READY_EVENTID				= 0x1001,
1967 	WMI_CONNECT_EVENTID				= 0x1002,
1968 	WMI_DISCONNECT_EVENTID				= 0x1003,
1969 	WMI_START_SCHED_SCAN_EVENTID			= 0x1005,
1970 	WMI_STOP_SCHED_SCAN_EVENTID			= 0x1006,
1971 	WMI_SCHED_SCAN_RESULT_EVENTID			= 0x1007,
1972 	WMI_SCAN_COMPLETE_EVENTID			= 0x100A,
1973 	WMI_REPORT_STATISTICS_EVENTID			= 0x100B,
1974 	WMI_FT_AUTH_STATUS_EVENTID			= 0x100C,
1975 	WMI_FT_REASSOC_STATUS_EVENTID			= 0x100D,
1976 	WMI_RADAR_GENERAL_CONFIG_EVENTID		= 0x1100,
1977 	WMI_RADAR_CONFIG_SELECT_EVENTID			= 0x1101,
1978 	WMI_RADAR_PARAMS_CONFIG_EVENTID			= 0x1102,
1979 	WMI_RADAR_SET_MODE_EVENTID			= 0x1103,
1980 	WMI_RADAR_CONTROL_EVENTID			= 0x1104,
1981 	WMI_RADAR_PCI_CONTROL_EVENTID			= 0x1105,
1982 	WMI_RD_MEM_RSP_EVENTID				= 0x1800,
1983 	WMI_FW_READY_EVENTID				= 0x1801,
1984 	WMI_EXIT_FAST_MEM_ACC_MODE_EVENTID		= 0x200,
1985 	WMI_ECHO_RSP_EVENTID				= 0x1803,
1986 	WMI_DEEP_ECHO_RSP_EVENTID			= 0x1804,
1987 	/* deprecated */
1988 	WMI_FS_TUNE_DONE_EVENTID			= 0x180A,
1989 	/* deprecated */
1990 	WMI_CORR_MEASURE_EVENTID			= 0x180B,
1991 	WMI_READ_RSSI_EVENTID				= 0x180C,
1992 	WMI_TEMP_SENSE_DONE_EVENTID			= 0x180E,
1993 	WMI_DC_CALIB_DONE_EVENTID			= 0x180F,
1994 	/* deprecated */
1995 	WMI_IQ_TX_CALIB_DONE_EVENTID			= 0x1811,
1996 	/* deprecated */
1997 	WMI_IQ_RX_CALIB_DONE_EVENTID			= 0x1812,
1998 	WMI_SET_WORK_MODE_DONE_EVENTID			= 0x1815,
1999 	WMI_LO_LEAKAGE_CALIB_DONE_EVENTID		= 0x1816,
2000 	WMI_LO_POWER_CALIB_FROM_OTP_EVENTID		= 0x1817,
2001 	WMI_SILENT_RSSI_CALIB_DONE_EVENTID		= 0x181D,
2002 	/* deprecated */
2003 	WMI_RF_RX_TEST_DONE_EVENTID			= 0x181E,
2004 	WMI_CFG_RX_CHAIN_DONE_EVENTID			= 0x1820,
2005 	WMI_VRING_CFG_DONE_EVENTID			= 0x1821,
2006 	WMI_BA_STATUS_EVENTID				= 0x1823,
2007 	WMI_RCP_ADDBA_REQ_EVENTID			= 0x1824,
2008 	WMI_RCP_ADDBA_RESP_SENT_EVENTID			= 0x1825,
2009 	WMI_DELBA_EVENTID				= 0x1826,
2010 	WMI_GET_SSID_EVENTID				= 0x1828,
2011 	WMI_GET_PCP_CHANNEL_EVENTID			= 0x182A,
2012 	/* Event is shared between WMI_SW_TX_REQ_CMDID and
2013 	 * WMI_SW_TX_REQ_EXT_CMDID
2014 	 */
2015 	WMI_SW_TX_COMPLETE_EVENTID			= 0x182B,
2016 	WMI_BEAMFORMING_MGMT_DONE_EVENTID		= 0x1836,
2017 	WMI_BF_TXSS_MGMT_DONE_EVENTID			= 0x1837,
2018 	WMI_BF_RXSS_MGMT_DONE_EVENTID			= 0x1839,
2019 	WMI_BF_TRIG_EVENTID				= 0x183A,
2020 	WMI_RS_MGMT_DONE_EVENTID			= 0x1852,
2021 	WMI_RF_MGMT_STATUS_EVENTID			= 0x1853,
2022 	WMI_BF_SM_MGMT_DONE_EVENTID			= 0x1838,
2023 	WMI_RX_MGMT_PACKET_EVENTID			= 0x1840,
2024 	WMI_TX_MGMT_PACKET_EVENTID			= 0x1841,
2025 	WMI_LINK_MAINTAIN_CFG_WRITE_DONE_EVENTID	= 0x1842,
2026 	WMI_LINK_MAINTAIN_CFG_READ_DONE_EVENTID		= 0x1843,
2027 	WMI_RF_XPM_READ_RESULT_EVENTID			= 0x1856,
2028 	WMI_RF_XPM_WRITE_RESULT_EVENTID			= 0x1857,
2029 	WMI_LED_CFG_DONE_EVENTID			= 0x1858,
2030 	WMI_SET_SILENT_RSSI_TABLE_DONE_EVENTID		= 0x185C,
2031 	WMI_RF_PWR_ON_DELAY_RSP_EVENTID			= 0x185D,
2032 	WMI_SET_HIGH_POWER_TABLE_PARAMS_EVENTID		= 0x185E,
2033 	WMI_FIXED_SCHEDULING_UL_CONFIG_EVENTID		= 0x185F,
2034 	/* Performance monitoring events */
2035 	WMI_DATA_PORT_OPEN_EVENTID			= 0x1860,
2036 	WMI_WBE_LINK_DOWN_EVENTID			= 0x1861,
2037 	WMI_BF_CTRL_DONE_EVENTID			= 0x1862,
2038 	WMI_NOTIFY_REQ_DONE_EVENTID			= 0x1863,
2039 	WMI_GET_STATUS_DONE_EVENTID			= 0x1864,
2040 	WMI_RING_EN_EVENTID				= 0x1865,
2041 	WMI_GET_RF_STATUS_EVENTID			= 0x1866,
2042 	WMI_GET_BASEBAND_TYPE_EVENTID			= 0x1867,
2043 	WMI_VRING_SWITCH_TIMING_CONFIG_EVENTID		= 0x1868,
2044 	WMI_UNIT_TEST_EVENTID				= 0x1900,
2045 	WMI_FLASH_READ_DONE_EVENTID			= 0x1902,
2046 	WMI_FLASH_WRITE_DONE_EVENTID			= 0x1903,
2047 	/* Power management */
2048 	WMI_TRAFFIC_SUSPEND_EVENTID			= 0x1904,
2049 	WMI_TRAFFIC_RESUME_EVENTID			= 0x1905,
2050 	/* P2P */
2051 	WMI_P2P_CFG_DONE_EVENTID			= 0x1910,
2052 	WMI_PORT_ALLOCATED_EVENTID			= 0x1911,
2053 	WMI_PORT_DELETED_EVENTID			= 0x1912,
2054 	WMI_LISTEN_STARTED_EVENTID			= 0x1914,
2055 	WMI_SEARCH_STARTED_EVENTID			= 0x1915,
2056 	WMI_DISCOVERY_STARTED_EVENTID			= 0x1916,
2057 	WMI_DISCOVERY_STOPPED_EVENTID			= 0x1917,
2058 	WMI_PCP_STARTED_EVENTID				= 0x1918,
2059 	WMI_PCP_STOPPED_EVENTID				= 0x1919,
2060 	WMI_PCP_FACTOR_EVENTID				= 0x191A,
2061 	/* Power Save Configuration Events */
2062 	WMI_PS_DEV_PROFILE_CFG_EVENTID			= 0x191C,
2063 	WMI_RS_ENABLE_EVENTID				= 0x191E,
2064 	WMI_RS_CFG_EX_EVENTID				= 0x191F,
2065 	WMI_GET_DETAILED_RS_RES_EX_EVENTID		= 0x1920,
2066 	/* deprecated */
2067 	WMI_RS_CFG_DONE_EVENTID				= 0x1921,
2068 	/* deprecated */
2069 	WMI_GET_DETAILED_RS_RES_EVENTID			= 0x1922,
2070 	WMI_AOA_MEAS_EVENTID				= 0x1923,
2071 	WMI_BRP_SET_ANT_LIMIT_EVENTID			= 0x1924,
2072 	WMI_SET_MGMT_RETRY_LIMIT_EVENTID		= 0x1930,
2073 	WMI_GET_MGMT_RETRY_LIMIT_EVENTID		= 0x1931,
2074 	WMI_SET_THERMAL_THROTTLING_CFG_EVENTID		= 0x1940,
2075 	WMI_GET_THERMAL_THROTTLING_CFG_EVENTID		= 0x1941,
2076 	/* return the Power Save profile */
2077 	WMI_PS_DEV_PROFILE_CFG_READ_EVENTID		= 0x1942,
2078 	WMI_TSF_SYNC_STATUS_EVENTID			= 0x1973,
2079 	WMI_TOF_SESSION_END_EVENTID			= 0x1991,
2080 	WMI_TOF_GET_CAPABILITIES_EVENTID		= 0x1992,
2081 	WMI_TOF_SET_LCR_EVENTID				= 0x1993,
2082 	WMI_TOF_SET_LCI_EVENTID				= 0x1994,
2083 	WMI_TOF_FTM_PER_DEST_RES_EVENTID		= 0x1995,
2084 	WMI_TOF_CFG_RESPONDER_EVENTID			= 0x1996,
2085 	WMI_TOF_SET_TX_RX_OFFSET_EVENTID		= 0x1997,
2086 	WMI_TOF_GET_TX_RX_OFFSET_EVENTID		= 0x1998,
2087 	WMI_TOF_CHANNEL_INFO_EVENTID			= 0x1999,
2088 	WMI_GET_RF_SECTOR_PARAMS_DONE_EVENTID		= 0x19A0,
2089 	WMI_SET_RF_SECTOR_PARAMS_DONE_EVENTID		= 0x19A1,
2090 	WMI_GET_SELECTED_RF_SECTOR_INDEX_DONE_EVENTID	= 0x19A2,
2091 	WMI_SET_SELECTED_RF_SECTOR_INDEX_DONE_EVENTID	= 0x19A3,
2092 	WMI_SET_RF_SECTOR_ON_DONE_EVENTID		= 0x19A4,
2093 	WMI_PRIO_TX_SECTORS_ORDER_EVENTID		= 0x19A5,
2094 	WMI_PRIO_TX_SECTORS_NUMBER_EVENTID		= 0x19A6,
2095 	WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID	= 0x19A7,
2096 	/* deprecated */
2097 	WMI_BF_CONTROL_EVENTID				= 0x19AA,
2098 	WMI_BF_CONTROL_EX_EVENTID			= 0x19AB,
2099 	WMI_TX_STATUS_RING_CFG_DONE_EVENTID		= 0x19C0,
2100 	WMI_RX_STATUS_RING_CFG_DONE_EVENTID		= 0x19C1,
2101 	WMI_TX_DESC_RING_CFG_DONE_EVENTID		= 0x19C2,
2102 	WMI_RX_DESC_RING_CFG_DONE_EVENTID		= 0x19C3,
2103 	WMI_CFG_DEF_RX_OFFLOAD_DONE_EVENTID		= 0x19C5,
2104 	WMI_SCHEDULING_SCHEME_EVENTID			= 0x1A01,
2105 	WMI_FIXED_SCHEDULING_CONFIG_COMPLETE_EVENTID	= 0x1A02,
2106 	WMI_ENABLE_FIXED_SCHEDULING_COMPLETE_EVENTID	= 0x1A03,
2107 	WMI_SET_MULTI_DIRECTED_OMNIS_CONFIG_EVENTID	= 0x1A04,
2108 	WMI_SET_LONG_RANGE_CONFIG_COMPLETE_EVENTID	= 0x1A05,
2109 	WMI_GET_ASSOC_LIST_RES_EVENTID			= 0x1A06,
2110 	WMI_GET_CCA_INDICATIONS_EVENTID			= 0x1A07,
2111 	WMI_SET_CCA_INDICATIONS_BI_AVG_NUM_EVENTID	= 0x1A08,
2112 	WMI_INTERNAL_FW_EVENT_EVENTID			= 0x1A0A,
2113 	WMI_INTERNAL_FW_IOCTL_EVENTID			= 0x1A0B,
2114 	WMI_LINK_STATS_CONFIG_DONE_EVENTID		= 0x1A0C,
2115 	WMI_LINK_STATS_EVENTID				= 0x1A0D,
2116 	WMI_SET_GRANT_MCS_EVENTID			= 0x1A0E,
2117 	WMI_SET_AP_SLOT_SIZE_EVENTID			= 0x1A0F,
2118 	WMI_SET_VRING_PRIORITY_WEIGHT_EVENTID		= 0x1A10,
2119 	WMI_SET_VRING_PRIORITY_EVENTID			= 0x1A11,
2120 	WMI_RBUFCAP_CFG_EVENTID				= 0x1A12,
2121 	WMI_TEMP_SENSE_ALL_DONE_EVENTID			= 0x1A13,
2122 	WMI_SET_CHANNEL_EVENTID				= 0x9000,
2123 	WMI_ASSOC_REQ_EVENTID				= 0x9001,
2124 	WMI_EAPOL_RX_EVENTID				= 0x9002,
2125 	WMI_MAC_ADDR_RESP_EVENTID			= 0x9003,
2126 	WMI_FW_VER_EVENTID				= 0x9004,
2127 	WMI_ACS_PASSIVE_SCAN_COMPLETE_EVENTID		= 0x9005,
2128 	WMI_INTERNAL_FW_SET_CHANNEL			= 0x9006,
2129 	WMI_COMMAND_NOT_SUPPORTED_EVENTID		= 0xFFFF,
2130 };
2131 
2132 /* Events data structures */
2133 enum wmi_fw_status {
2134 	WMI_FW_STATUS_SUCCESS	= 0x00,
2135 	WMI_FW_STATUS_FAILURE	= 0x01,
2136 };
2137 
2138 /* WMI_RF_MGMT_STATUS_EVENTID */
2139 enum wmi_rf_status {
2140 	WMI_RF_ENABLED		= 0x00,
2141 	WMI_RF_DISABLED_HW	= 0x01,
2142 	WMI_RF_DISABLED_SW	= 0x02,
2143 	WMI_RF_DISABLED_HW_SW	= 0x03,
2144 };
2145 
2146 /* WMI_RF_MGMT_STATUS_EVENTID */
2147 struct wmi_rf_mgmt_status_event {
2148 	__le32 rf_status;
2149 } __packed;
2150 
2151 /* WMI_GET_STATUS_DONE_EVENTID */
2152 struct wmi_get_status_done_event {
2153 	__le32 is_associated;
2154 	u8 cid;
2155 	u8 reserved0[3];
2156 	u8 bssid[WMI_MAC_LEN];
2157 	u8 channel;
2158 	u8 reserved1;
2159 	u8 network_type;
2160 	u8 reserved2[3];
2161 	__le32 ssid_len;
2162 	u8 ssid[WMI_MAX_SSID_LEN];
2163 	__le32 rf_status;
2164 	__le32 is_secured;
2165 } __packed;
2166 
2167 /* WMI_FW_VER_EVENTID */
2168 struct wmi_fw_ver_event {
2169 	/* FW image version */
2170 	__le32 fw_major;
2171 	__le32 fw_minor;
2172 	__le32 fw_subminor;
2173 	__le32 fw_build;
2174 	/* FW image build time stamp */
2175 	__le32 hour;
2176 	__le32 minute;
2177 	__le32 second;
2178 	__le32 day;
2179 	__le32 month;
2180 	__le32 year;
2181 	/* Boot Loader image version */
2182 	__le32 bl_major;
2183 	__le32 bl_minor;
2184 	__le32 bl_subminor;
2185 	__le32 bl_build;
2186 	/* The number of entries in the FW capabilities array */
2187 	u8 fw_capabilities_len;
2188 	u8 reserved[3];
2189 	/* FW capabilities info
2190 	 * Must be the last member of the struct
2191 	 */
2192 	__le32 fw_capabilities[0];
2193 } __packed;
2194 
2195 /* WMI_GET_RF_STATUS_EVENTID */
2196 enum rf_type {
2197 	RF_UNKNOWN	= 0x00,
2198 	RF_MARLON	= 0x01,
2199 	RF_SPARROW	= 0x02,
2200 	RF_TALYNA1	= 0x03,
2201 	RF_TALYNA2	= 0x04,
2202 };
2203 
2204 /* WMI_GET_RF_STATUS_EVENTID */
2205 enum board_file_rf_type {
2206 	BF_RF_MARLON	= 0x00,
2207 	BF_RF_SPARROW	= 0x01,
2208 	BF_RF_TALYNA1	= 0x02,
2209 	BF_RF_TALYNA2	= 0x03,
2210 };
2211 
2212 /* WMI_GET_RF_STATUS_EVENTID */
2213 enum rf_status {
2214 	RF_OK			= 0x00,
2215 	RF_NO_COMM		= 0x01,
2216 	RF_WRONG_BOARD_FILE	= 0x02,
2217 };
2218 
2219 /* WMI_GET_RF_STATUS_EVENTID */
2220 struct wmi_get_rf_status_event {
2221 	/* enum rf_type */
2222 	__le32 rf_type;
2223 	/* attached RFs bit vector */
2224 	__le32 attached_rf_vector;
2225 	/* enabled RFs bit vector */
2226 	__le32 enabled_rf_vector;
2227 	/* enum rf_status, refers to enabled RFs */
2228 	u8 rf_status[32];
2229 	/* enum board file RF type */
2230 	__le32 board_file_rf_type;
2231 	/* board file platform type */
2232 	__le32 board_file_platform_type;
2233 	/* board file version */
2234 	__le32 board_file_version;
2235 	/* enabled XIFs bit vector */
2236 	__le32 enabled_xif_vector;
2237 	__le32 reserved;
2238 } __packed;
2239 
2240 /* WMI_GET_BASEBAND_TYPE_EVENTID */
2241 enum baseband_type {
2242 	BASEBAND_UNKNOWN	= 0x00,
2243 	BASEBAND_SPARROW_M_A0	= 0x03,
2244 	BASEBAND_SPARROW_M_A1	= 0x04,
2245 	BASEBAND_SPARROW_M_B0	= 0x05,
2246 	BASEBAND_SPARROW_M_C0	= 0x06,
2247 	BASEBAND_SPARROW_M_D0	= 0x07,
2248 	BASEBAND_TALYN_M_A0	= 0x08,
2249 	BASEBAND_TALYN_M_B0	= 0x09,
2250 };
2251 
2252 /* WMI_GET_BASEBAND_TYPE_EVENTID */
2253 struct wmi_get_baseband_type_event {
2254 	/* enum baseband_type */
2255 	__le32 baseband_type;
2256 } __packed;
2257 
2258 /* WMI_MAC_ADDR_RESP_EVENTID */
2259 struct wmi_mac_addr_resp_event {
2260 	u8 mac[WMI_MAC_LEN];
2261 	u8 auth_mode;
2262 	u8 crypt_mode;
2263 	__le32 offload_mode;
2264 } __packed;
2265 
2266 /* WMI_EAPOL_RX_EVENTID */
2267 struct wmi_eapol_rx_event {
2268 	u8 src_mac[WMI_MAC_LEN];
2269 	__le16 eapol_len;
2270 	u8 eapol[0];
2271 } __packed;
2272 
2273 /* WMI_READY_EVENTID */
2274 enum wmi_phy_capability {
2275 	WMI_11A_CAPABILITY		= 0x01,
2276 	WMI_11G_CAPABILITY		= 0x02,
2277 	WMI_11AG_CAPABILITY		= 0x03,
2278 	WMI_11NA_CAPABILITY		= 0x04,
2279 	WMI_11NG_CAPABILITY		= 0x05,
2280 	WMI_11NAG_CAPABILITY		= 0x06,
2281 	WMI_11AD_CAPABILITY		= 0x07,
2282 	WMI_11N_CAPABILITY_OFFSET	= 0x03,
2283 };
2284 
2285 struct wmi_ready_event {
2286 	__le32 sw_version;
2287 	__le32 abi_version;
2288 	u8 mac[WMI_MAC_LEN];
2289 	/* enum wmi_phy_capability */
2290 	u8 phy_capability;
2291 	u8 numof_additional_mids;
2292 	/* rfc read calibration result. 5..15 */
2293 	u8 rfc_read_calib_result;
2294 	/* Max associated STAs supported by FW in AP mode (default 0 means 8
2295 	 * STA)
2296 	 */
2297 	u8 max_assoc_sta;
2298 	u8 reserved[2];
2299 } __packed;
2300 
2301 /* WMI_NOTIFY_REQ_DONE_EVENTID */
2302 struct wmi_notify_req_done_event {
2303 	/* beamforming status, 0: fail; 1: OK; 2: retrying */
2304 	__le32 status;
2305 	__le64 tsf;
2306 	s8 rssi;
2307 	/* enum wmi_edmg_tx_mode */
2308 	u8 tx_mode;
2309 	u8 reserved0[2];
2310 	__le32 tx_tpt;
2311 	__le32 tx_goodput;
2312 	__le32 rx_goodput;
2313 	__le16 bf_mcs;
2314 	__le16 my_rx_sector;
2315 	__le16 my_tx_sector;
2316 	__le16 other_rx_sector;
2317 	__le16 other_tx_sector;
2318 	__le16 range;
2319 	u8 sqi;
2320 	u8 reserved[3];
2321 } __packed;
2322 
2323 /* WMI_CONNECT_EVENTID */
2324 struct wmi_connect_event {
2325 	/* enum wmi_channel WMI_CHANNEL_1..WMI_CHANNEL_6; for EDMG this is
2326 	 * the primary channel number
2327 	 */
2328 	u8 channel;
2329 	/* enum wmi_channel WMI_CHANNEL_9..WMI_CHANNEL_12 */
2330 	u8 edmg_channel;
2331 	u8 bssid[WMI_MAC_LEN];
2332 	__le16 listen_interval;
2333 	__le16 beacon_interval;
2334 	u8 network_type;
2335 	u8 reserved1[3];
2336 	u8 beacon_ie_len;
2337 	u8 assoc_req_len;
2338 	u8 assoc_resp_len;
2339 	u8 cid;
2340 	u8 aid;
2341 	u8 reserved2[2];
2342 	/* not in use */
2343 	u8 assoc_info[0];
2344 } __packed;
2345 
2346 /* disconnect_reason */
2347 enum wmi_disconnect_reason {
2348 	WMI_DIS_REASON_NO_NETWORK_AVAIL		= 0x01,
2349 	/* bmiss */
2350 	WMI_DIS_REASON_LOST_LINK		= 0x02,
2351 	WMI_DIS_REASON_DISCONNECT_CMD		= 0x03,
2352 	WMI_DIS_REASON_BSS_DISCONNECTED		= 0x04,
2353 	WMI_DIS_REASON_AUTH_FAILED		= 0x05,
2354 	WMI_DIS_REASON_ASSOC_FAILED		= 0x06,
2355 	WMI_DIS_REASON_NO_RESOURCES_AVAIL	= 0x07,
2356 	WMI_DIS_REASON_CSERV_DISCONNECT		= 0x08,
2357 	WMI_DIS_REASON_INVALID_PROFILE		= 0x0A,
2358 	WMI_DIS_REASON_DOT11H_CHANNEL_SWITCH	= 0x0B,
2359 	WMI_DIS_REASON_PROFILE_MISMATCH		= 0x0C,
2360 	WMI_DIS_REASON_CONNECTION_EVICTED	= 0x0D,
2361 	WMI_DIS_REASON_IBSS_MERGE		= 0x0E,
2362 	WMI_DIS_REASON_HIGH_TEMPERATURE		= 0x0F,
2363 };
2364 
2365 /* WMI_DISCONNECT_EVENTID */
2366 struct wmi_disconnect_event {
2367 	/* reason code, see 802.11 spec. */
2368 	__le16 protocol_reason_status;
2369 	/* set if known */
2370 	u8 bssid[WMI_MAC_LEN];
2371 	/* see enum wmi_disconnect_reason */
2372 	u8 disconnect_reason;
2373 	/* last assoc req may passed to host - not in used */
2374 	u8 assoc_resp_len;
2375 	/* last assoc req may passed to host - not in used */
2376 	u8 assoc_info[0];
2377 } __packed;
2378 
2379 /* WMI_SCAN_COMPLETE_EVENTID */
2380 enum scan_status {
2381 	WMI_SCAN_SUCCESS	= 0x00,
2382 	WMI_SCAN_FAILED		= 0x01,
2383 	WMI_SCAN_ABORTED	= 0x02,
2384 	WMI_SCAN_REJECTED	= 0x03,
2385 	WMI_SCAN_ABORT_REJECTED	= 0x04,
2386 };
2387 
2388 struct wmi_scan_complete_event {
2389 	/* enum scan_status */
2390 	__le32 status;
2391 } __packed;
2392 
2393 /* WMI_FT_AUTH_STATUS_EVENTID */
2394 struct wmi_ft_auth_status_event {
2395 	/* enum wmi_fw_status */
2396 	u8 status;
2397 	u8 reserved[3];
2398 	u8 mac_addr[WMI_MAC_LEN];
2399 	__le16 ie_len;
2400 	u8 ie_info[0];
2401 } __packed;
2402 
2403 /* WMI_FT_REASSOC_STATUS_EVENTID */
2404 struct wmi_ft_reassoc_status_event {
2405 	/* enum wmi_fw_status */
2406 	u8 status;
2407 	/* association id received from new AP */
2408 	u8 aid;
2409 	/* enum wmi_channel */
2410 	u8 channel;
2411 	/* enum wmi_channel */
2412 	u8 edmg_channel;
2413 	u8 mac_addr[WMI_MAC_LEN];
2414 	__le16 beacon_ie_len;
2415 	__le16 reassoc_req_ie_len;
2416 	__le16 reassoc_resp_ie_len;
2417 	u8 reserved[4];
2418 	u8 ie_info[0];
2419 } __packed;
2420 
2421 /* wmi_rx_mgmt_info */
2422 struct wmi_rx_mgmt_info {
2423 	u8 mcs;
2424 	s8 rssi;
2425 	u8 range;
2426 	u8 sqi;
2427 	__le16 stype;
2428 	__le16 status;
2429 	__le32 len;
2430 	/* Not resolved when == 0xFFFFFFFF == > Broadcast to all MIDS */
2431 	u8 qid;
2432 	/* Not resolved when == 0xFFFFFFFF == > Broadcast to all MIDS */
2433 	u8 mid;
2434 	u8 cid;
2435 	/* From Radio MNGR */
2436 	u8 channel;
2437 } __packed;
2438 
2439 /* WMI_START_SCHED_SCAN_EVENTID */
2440 enum wmi_pno_result {
2441 	WMI_PNO_SUCCESS			= 0x00,
2442 	WMI_PNO_REJECT			= 0x01,
2443 	WMI_PNO_INVALID_PARAMETERS	= 0x02,
2444 	WMI_PNO_NOT_ENABLED		= 0x03,
2445 };
2446 
2447 struct wmi_start_sched_scan_event {
2448 	/* wmi_pno_result */
2449 	u8 result;
2450 	u8 reserved[3];
2451 } __packed;
2452 
2453 struct wmi_stop_sched_scan_event {
2454 	/* wmi_pno_result */
2455 	u8 result;
2456 	u8 reserved[3];
2457 } __packed;
2458 
2459 struct wmi_sched_scan_result_event {
2460 	struct wmi_rx_mgmt_info info;
2461 	u8 payload[0];
2462 } __packed;
2463 
2464 /* WMI_ACS_PASSIVE_SCAN_COMPLETE_EVENT */
2465 enum wmi_acs_info_bitmask {
2466 	WMI_ACS_INFO_BITMASK_BEACON_FOUND	= 0x01,
2467 	WMI_ACS_INFO_BITMASK_BUSY_TIME		= 0x02,
2468 	WMI_ACS_INFO_BITMASK_TX_TIME		= 0x04,
2469 	WMI_ACS_INFO_BITMASK_RX_TIME		= 0x08,
2470 	WMI_ACS_INFO_BITMASK_NOISE		= 0x10,
2471 };
2472 
2473 struct scan_acs_info {
2474 	u8 channel;
2475 	u8 beacon_found;
2476 	/* msec */
2477 	__le16 busy_time;
2478 	__le16 tx_time;
2479 	__le16 rx_time;
2480 	u8 noise;
2481 	u8 reserved[3];
2482 } __packed;
2483 
2484 struct wmi_acs_passive_scan_complete_event {
2485 	__le32 dwell_time;
2486 	/* valid fields within channel info according to
2487 	 * their appearance in struct order
2488 	 */
2489 	__le16 filled;
2490 	u8 num_scanned_channels;
2491 	u8 reserved;
2492 	struct scan_acs_info scan_info_list[0];
2493 } __packed;
2494 
2495 /* WMI_BA_STATUS_EVENTID */
2496 enum wmi_vring_ba_status {
2497 	WMI_BA_AGREED			= 0x00,
2498 	WMI_BA_NON_AGREED		= 0x01,
2499 	/* BA_EN in middle of teardown flow */
2500 	WMI_BA_TD_WIP			= 0x02,
2501 	/* BA_DIS or BA_EN in middle of BA SETUP flow */
2502 	WMI_BA_SETUP_WIP		= 0x03,
2503 	/* BA_EN when the BA session is already active */
2504 	WMI_BA_SESSION_ACTIVE		= 0x04,
2505 	/* BA_DIS when the BA session is not active */
2506 	WMI_BA_SESSION_NOT_ACTIVE	= 0x05,
2507 };
2508 
2509 struct wmi_ba_status_event {
2510 	/* enum wmi_vring_ba_status */
2511 	__le16 status;
2512 	u8 reserved[2];
2513 	u8 ringid;
2514 	u8 agg_wsize;
2515 	__le16 ba_timeout;
2516 	u8 amsdu;
2517 } __packed;
2518 
2519 /* WMI_DELBA_EVENTID */
2520 struct wmi_delba_event {
2521 	/* Used for cid less than 8. For higher cid set
2522 	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
2523 	 */
2524 	u8 cidxtid;
2525 	u8 from_initiator;
2526 	__le16 reason;
2527 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
2528 	u8 cid;
2529 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
2530 	u8 tid;
2531 	u8 reserved[2];
2532 } __packed;
2533 
2534 /* WMI_VRING_CFG_DONE_EVENTID */
2535 struct wmi_vring_cfg_done_event {
2536 	u8 ringid;
2537 	u8 status;
2538 	u8 reserved[2];
2539 	__le32 tx_vring_tail_ptr;
2540 } __packed;
2541 
2542 /* WMI_RCP_ADDBA_RESP_SENT_EVENTID */
2543 struct wmi_rcp_addba_resp_sent_event {
2544 	/* Used for cid less than 8. For higher cid set
2545 	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
2546 	 */
2547 	u8 cidxtid;
2548 	u8 reserved;
2549 	__le16 status;
2550 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
2551 	u8 cid;
2552 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
2553 	u8 tid;
2554 	u8 reserved2[2];
2555 } __packed;
2556 
2557 /* WMI_TX_STATUS_RING_CFG_DONE_EVENTID */
2558 struct wmi_tx_status_ring_cfg_done_event {
2559 	u8 ring_id;
2560 	/* wmi_fw_status */
2561 	u8 status;
2562 	u8 reserved[2];
2563 	__le32 ring_tail_ptr;
2564 } __packed;
2565 
2566 /* WMI_RX_STATUS_RING_CFG_DONE_EVENTID */
2567 struct wmi_rx_status_ring_cfg_done_event {
2568 	u8 ring_id;
2569 	/* wmi_fw_status */
2570 	u8 status;
2571 	u8 reserved[2];
2572 	__le32 ring_tail_ptr;
2573 } __packed;
2574 
2575 /* WMI_CFG_DEF_RX_OFFLOAD_DONE_EVENTID */
2576 struct wmi_cfg_def_rx_offload_done_event {
2577 	/* wmi_fw_status */
2578 	u8 status;
2579 	u8 reserved[3];
2580 } __packed;
2581 
2582 /* WMI_TX_DESC_RING_CFG_DONE_EVENTID */
2583 struct wmi_tx_desc_ring_cfg_done_event {
2584 	u8 ring_id;
2585 	/* wmi_fw_status */
2586 	u8 status;
2587 	u8 reserved[2];
2588 	__le32 ring_tail_ptr;
2589 } __packed;
2590 
2591 /* WMI_RX_DESC_RING_CFG_DONE_EVENTID */
2592 struct wmi_rx_desc_ring_cfg_done_event {
2593 	u8 ring_id;
2594 	/* wmi_fw_status */
2595 	u8 status;
2596 	u8 reserved[2];
2597 	__le32 ring_tail_ptr;
2598 } __packed;
2599 
2600 /* WMI_RCP_ADDBA_REQ_EVENTID */
2601 struct wmi_rcp_addba_req_event {
2602 	/* Used for cid less than 8. For higher cid set
2603 	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
2604 	 */
2605 	u8 cidxtid;
2606 	u8 dialog_token;
2607 	/* ieee80211_ba_parameterset as it received */
2608 	__le16 ba_param_set;
2609 	__le16 ba_timeout;
2610 	/* ieee80211_ba_seqstrl field as it received */
2611 	__le16 ba_seq_ctrl;
2612 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
2613 	u8 cid;
2614 	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
2615 	u8 tid;
2616 	u8 reserved[2];
2617 } __packed;
2618 
2619 /* WMI_CFG_RX_CHAIN_DONE_EVENTID */
2620 enum wmi_cfg_rx_chain_done_event_status {
2621 	WMI_CFG_RX_CHAIN_SUCCESS	= 0x01,
2622 };
2623 
2624 struct wmi_cfg_rx_chain_done_event {
2625 	/* V-Ring Tail pointer */
2626 	__le32 rx_ring_tail_ptr;
2627 	__le32 status;
2628 } __packed;
2629 
2630 /* WMI_WBE_LINK_DOWN_EVENTID */
2631 enum wmi_wbe_link_down_event_reason {
2632 	WMI_WBE_REASON_USER_REQUEST	= 0x00,
2633 	WMI_WBE_REASON_RX_DISASSOC	= 0x01,
2634 	WMI_WBE_REASON_BAD_PHY_LINK	= 0x02,
2635 };
2636 
2637 /* WMI_WBE_LINK_DOWN_EVENTID */
2638 struct wmi_wbe_link_down_event {
2639 	u8 cid;
2640 	u8 reserved[3];
2641 	__le32 reason;
2642 } __packed;
2643 
2644 /* WMI_DATA_PORT_OPEN_EVENTID */
2645 struct wmi_data_port_open_event {
2646 	u8 cid;
2647 	u8 reserved[3];
2648 } __packed;
2649 
2650 /* WMI_RING_EN_EVENTID */
2651 struct wmi_ring_en_event {
2652 	u8 ring_index;
2653 	u8 reserved[3];
2654 } __packed;
2655 
2656 /* WMI_GET_PCP_CHANNEL_EVENTID */
2657 struct wmi_get_pcp_channel_event {
2658 	u8 channel;
2659 	u8 reserved[3];
2660 } __packed;
2661 
2662 /* WMI_P2P_CFG_DONE_EVENTID */
2663 struct wmi_p2p_cfg_done_event {
2664 	/* wmi_fw_status */
2665 	u8 status;
2666 	u8 reserved[3];
2667 } __packed;
2668 
2669 /* WMI_PORT_ALLOCATED_EVENTID */
2670 struct wmi_port_allocated_event {
2671 	/* wmi_fw_status */
2672 	u8 status;
2673 	u8 reserved[3];
2674 } __packed;
2675 
2676 /* WMI_PORT_DELETED_EVENTID */
2677 struct wmi_port_deleted_event {
2678 	/* wmi_fw_status */
2679 	u8 status;
2680 	u8 reserved[3];
2681 } __packed;
2682 
2683 /* WMI_LISTEN_STARTED_EVENTID */
2684 struct wmi_listen_started_event {
2685 	/* wmi_fw_status */
2686 	u8 status;
2687 	u8 reserved[3];
2688 } __packed;
2689 
2690 /* WMI_SEARCH_STARTED_EVENTID */
2691 struct wmi_search_started_event {
2692 	/* wmi_fw_status */
2693 	u8 status;
2694 	u8 reserved[3];
2695 } __packed;
2696 
2697 /* WMI_PCP_STARTED_EVENTID */
2698 struct wmi_pcp_started_event {
2699 	/* wmi_fw_status */
2700 	u8 status;
2701 	u8 reserved[3];
2702 } __packed;
2703 
2704 /* WMI_PCP_FACTOR_EVENTID */
2705 struct wmi_pcp_factor_event {
2706 	__le32 pcp_factor;
2707 } __packed;
2708 
2709 enum wmi_sw_tx_status {
2710 	WMI_TX_SW_STATUS_SUCCESS		= 0x00,
2711 	WMI_TX_SW_STATUS_FAILED_NO_RESOURCES	= 0x01,
2712 	WMI_TX_SW_STATUS_FAILED_TX		= 0x02,
2713 };
2714 
2715 /* WMI_SW_TX_COMPLETE_EVENTID */
2716 struct wmi_sw_tx_complete_event {
2717 	/* enum wmi_sw_tx_status */
2718 	u8 status;
2719 	u8 reserved[3];
2720 } __packed;
2721 
2722 /* WMI_CORR_MEASURE_EVENTID - deprecated */
2723 struct wmi_corr_measure_event {
2724 	/* signed */
2725 	__le32 i;
2726 	/* signed */
2727 	__le32 q;
2728 	/* signed */
2729 	__le32 image_i;
2730 	/* signed */
2731 	__le32 image_q;
2732 } __packed;
2733 
2734 /* WMI_READ_RSSI_EVENTID */
2735 struct wmi_read_rssi_event {
2736 	__le32 ina_rssi_adc_dbm;
2737 } __packed;
2738 
2739 /* WMI_GET_SSID_EVENTID */
2740 struct wmi_get_ssid_event {
2741 	__le32 ssid_len;
2742 	u8 ssid[WMI_MAX_SSID_LEN];
2743 } __packed;
2744 
2745 /* EVENT: WMI_RF_XPM_READ_RESULT_EVENTID */
2746 struct wmi_rf_xpm_read_result_event {
2747 	/* enum wmi_fw_status_e - success=0 or fail=1 */
2748 	u8 status;
2749 	u8 reserved[3];
2750 	/* requested num_bytes of data */
2751 	u8 data_bytes[0];
2752 } __packed;
2753 
2754 /* EVENT: WMI_RF_XPM_WRITE_RESULT_EVENTID */
2755 struct wmi_rf_xpm_write_result_event {
2756 	/* enum wmi_fw_status_e - success=0 or fail=1 */
2757 	u8 status;
2758 	u8 reserved[3];
2759 } __packed;
2760 
2761 /* WMI_TX_MGMT_PACKET_EVENTID */
2762 struct wmi_tx_mgmt_packet_event {
2763 	u8 payload[0];
2764 } __packed;
2765 
2766 /* WMI_RX_MGMT_PACKET_EVENTID */
2767 struct wmi_rx_mgmt_packet_event {
2768 	struct wmi_rx_mgmt_info info;
2769 	u8 payload[0];
2770 } __packed;
2771 
2772 /* WMI_ECHO_RSP_EVENTID */
2773 struct wmi_echo_rsp_event {
2774 	__le32 echoed_value;
2775 } __packed;
2776 
2777 /* WMI_DEEP_ECHO_RSP_EVENTID */
2778 struct wmi_deep_echo_rsp_event {
2779 	__le32 echoed_value;
2780 } __packed;
2781 
2782 /* WMI_RF_PWR_ON_DELAY_RSP_EVENTID */
2783 struct wmi_rf_pwr_on_delay_rsp_event {
2784 	/* wmi_fw_status */
2785 	u8 status;
2786 	u8 reserved[3];
2787 } __packed;
2788 
2789 /* WMI_SET_HIGH_POWER_TABLE_PARAMS_EVENTID */
2790 struct wmi_set_high_power_table_params_event {
2791 	/* wmi_fw_status */
2792 	u8 status;
2793 	u8 reserved[3];
2794 } __packed;
2795 
2796 /* WMI_FIXED_SCHEDULING_UL_CONFIG_EVENTID */
2797 struct wmi_fixed_scheduling_ul_config_event {
2798 	/* wmi_fw_status */
2799 	u8 status;
2800 	u8 reserved[3];
2801 } __packed;
2802 
2803 /* WMI_TEMP_SENSE_DONE_EVENTID
2804  *
2805  * Measure MAC and radio temperatures
2806  */
2807 struct wmi_temp_sense_done_event {
2808 	/* Temperature times 1000 (actual temperature will be achieved by
2809 	 * dividing the value by 1000). When temperature cannot be read from
2810 	 * device return WMI_INVALID_TEMPERATURE
2811 	 */
2812 	__le32 baseband_t1000;
2813 	/* Temperature times 1000 (actual temperature will be achieved by
2814 	 * dividing the value by 1000). When temperature cannot be read from
2815 	 * device return WMI_INVALID_TEMPERATURE
2816 	 */
2817 	__le32 rf_t1000;
2818 } __packed;
2819 
2820 #define WMI_SCAN_DWELL_TIME_MS	(100)
2821 #define WMI_SURVEY_TIMEOUT_MS	(10000)
2822 
2823 enum wmi_hidden_ssid {
2824 	WMI_HIDDEN_SSID_DISABLED	= 0x00,
2825 	WMI_HIDDEN_SSID_SEND_EMPTY	= 0x10,
2826 	WMI_HIDDEN_SSID_CLEAR		= 0xFE,
2827 };
2828 
2829 /* WMI_LED_CFG_CMDID
2830  *
2831  * Configure LED On\Off\Blinking operation
2832  *
2833  * Returned events:
2834  * - WMI_LED_CFG_DONE_EVENTID
2835  */
2836 enum led_mode {
2837 	LED_DISABLE	= 0x00,
2838 	LED_ENABLE	= 0x01,
2839 };
2840 
2841 /* The names of the led as
2842  * described on HW schemes.
2843  */
2844 enum wmi_led_id {
2845 	WMI_LED_WLAN	= 0x00,
2846 	WMI_LED_WPAN	= 0x01,
2847 	WMI_LED_WWAN	= 0x02,
2848 };
2849 
2850 /* Led polarity mode. */
2851 enum wmi_led_polarity {
2852 	LED_POLARITY_HIGH_ACTIVE	= 0x00,
2853 	LED_POLARITY_LOW_ACTIVE		= 0x01,
2854 };
2855 
2856 /* Combination of on and off
2857  * creates the blinking period
2858  */
2859 struct wmi_led_blink_mode {
2860 	__le32 blink_on;
2861 	__le32 blink_off;
2862 } __packed;
2863 
2864 /* WMI_LED_CFG_CMDID */
2865 struct wmi_led_cfg_cmd {
2866 	/* enum led_mode_e */
2867 	u8 led_mode;
2868 	/* enum wmi_led_id_e */
2869 	u8 id;
2870 	/* slow speed blinking combination */
2871 	struct wmi_led_blink_mode slow_blink_cfg;
2872 	/* medium speed blinking combination */
2873 	struct wmi_led_blink_mode medium_blink_cfg;
2874 	/* high speed blinking combination */
2875 	struct wmi_led_blink_mode fast_blink_cfg;
2876 	/* polarity of the led */
2877 	u8 led_polarity;
2878 	/* reserved */
2879 	u8 reserved;
2880 } __packed;
2881 
2882 /* \WMI_SET_CONNECT_SNR_THR_CMDID */
2883 struct wmi_set_connect_snr_thr_cmd {
2884 	u8 enable;
2885 	u8 reserved;
2886 	/* 1/4 Db units */
2887 	__le16 omni_snr_thr;
2888 	/* 1/4 Db units */
2889 	__le16 direct_snr_thr;
2890 } __packed;
2891 
2892 /* WMI_LED_CFG_DONE_EVENTID */
2893 struct wmi_led_cfg_done_event {
2894 	/* led config status */
2895 	__le32 status;
2896 } __packed;
2897 
2898 /* Rate search parameters configuration per connection */
2899 struct wmi_rs_cfg {
2900 	/* The maximal allowed PER for each MCS
2901 	 * MCS will be considered as failed if PER during RS is higher
2902 	 */
2903 	u8 per_threshold[WMI_NUM_MCS];
2904 	/* Number of MPDUs for each MCS
2905 	 * this is the minimal statistic required to make an educated
2906 	 * decision
2907 	 */
2908 	u8 min_frame_cnt[WMI_NUM_MCS];
2909 	/* stop threshold [0-100] */
2910 	u8 stop_th;
2911 	/* MCS1 stop threshold [0-100] */
2912 	u8 mcs1_fail_th;
2913 	u8 max_back_failure_th;
2914 	/* Debug feature for disabling internal RS trigger (which is
2915 	 * currently triggered by BF Done)
2916 	 */
2917 	u8 dbg_disable_internal_trigger;
2918 	__le32 back_failure_mask;
2919 	__le32 mcs_en_vec;
2920 } __packed;
2921 
2922 enum wmi_edmg_tx_mode {
2923 	WMI_TX_MODE_DMG			= 0x0,
2924 	WMI_TX_MODE_EDMG_CB1		= 0x1,
2925 	WMI_TX_MODE_EDMG_CB2		= 0x2,
2926 	WMI_TX_MODE_EDMG_CB1_LONG_LDPC	= 0x3,
2927 	WMI_TX_MODE_EDMG_CB2_LONG_LDPC	= 0x4,
2928 	WMI_TX_MODE_MAX,
2929 };
2930 
2931 /* Rate search parameters common configuration */
2932 struct wmi_rs_cfg_ex_common {
2933 	/* enum wmi_edmg_tx_mode */
2934 	u8 mode;
2935 	/* stop threshold [0-100] */
2936 	u8 stop_th;
2937 	/* MCS1 stop threshold [0-100] */
2938 	u8 mcs1_fail_th;
2939 	u8 max_back_failure_th;
2940 	/* Debug feature for disabling internal RS trigger (which is
2941 	 * currently triggered by BF Done)
2942 	 */
2943 	u8 dbg_disable_internal_trigger;
2944 	u8 reserved[3];
2945 	__le32 back_failure_mask;
2946 } __packed;
2947 
2948 /* Rate search parameters configuration per MCS */
2949 struct wmi_rs_cfg_ex_mcs {
2950 	/* The maximal allowed PER for each MCS
2951 	 * MCS will be considered as failed if PER during RS is higher
2952 	 */
2953 	u8 per_threshold;
2954 	/* Number of MPDUs for each MCS
2955 	 * this is the minimal statistic required to make an educated
2956 	 * decision
2957 	 */
2958 	u8 min_frame_cnt;
2959 	u8 reserved[2];
2960 } __packed;
2961 
2962 /* WMI_RS_CFG_EX_CMDID */
2963 struct wmi_rs_cfg_ex_cmd {
2964 	/* Configuration for all MCSs */
2965 	struct wmi_rs_cfg_ex_common common_cfg;
2966 	u8 each_mcs_cfg_size;
2967 	u8 reserved[3];
2968 	/* Configuration for each MCS */
2969 	struct wmi_rs_cfg_ex_mcs each_mcs_cfg[0];
2970 } __packed;
2971 
2972 /* WMI_RS_CFG_EX_EVENTID */
2973 struct wmi_rs_cfg_ex_event {
2974 	/* enum wmi_edmg_tx_mode */
2975 	u8 mode;
2976 	/* enum wmi_fw_status */
2977 	u8 status;
2978 	u8 reserved[2];
2979 } __packed;
2980 
2981 /* WMI_RS_ENABLE_CMDID */
2982 struct wmi_rs_enable_cmd {
2983 	u8 cid;
2984 	/* enable or disable rate search */
2985 	u8 rs_enable;
2986 	u8 reserved[2];
2987 	__le32 mcs_en_vec;
2988 } __packed;
2989 
2990 /* WMI_RS_ENABLE_EVENTID */
2991 struct wmi_rs_enable_event {
2992 	/* enum wmi_fw_status */
2993 	u8 status;
2994 	u8 reserved[3];
2995 } __packed;
2996 
2997 /* Slot types */
2998 enum wmi_sched_scheme_slot_type {
2999 	WMI_SCHED_SLOT_SP		= 0x0,
3000 	WMI_SCHED_SLOT_CBAP		= 0x1,
3001 	WMI_SCHED_SLOT_IDLE		= 0x2,
3002 	WMI_SCHED_SLOT_ANNOUNCE_NO_ACK	= 0x3,
3003 	WMI_SCHED_SLOT_DISCOVERY	= 0x4,
3004 };
3005 
3006 enum wmi_sched_scheme_slot_flags {
3007 	WMI_SCHED_SCHEME_SLOT_PERIODIC	= 0x1,
3008 };
3009 
3010 struct wmi_sched_scheme_slot {
3011 	/* in microsecond */
3012 	__le32 tbtt_offset;
3013 	/* wmi_sched_scheme_slot_flags */
3014 	u8 flags;
3015 	/* wmi_sched_scheme_slot_type */
3016 	u8 type;
3017 	/* in microsecond */
3018 	__le16 duration;
3019 	/* frame_exchange_sequence_duration */
3020 	__le16 tx_op;
3021 	/* time in microseconds between two consecutive slots
3022 	 * relevant only if flag WMI_SCHED_SCHEME_SLOT_PERIODIC set
3023 	 */
3024 	__le16 period;
3025 	/* relevant only if flag WMI_SCHED_SCHEME_SLOT_PERIODIC set
3026 	 * number of times to repeat allocation
3027 	 */
3028 	u8 num_of_blocks;
3029 	/* relevant only if flag WMI_SCHED_SCHEME_SLOT_PERIODIC set
3030 	 * every idle_period allocation will be idle
3031 	 */
3032 	u8 idle_period;
3033 	u8 src_aid;
3034 	u8 dest_aid;
3035 	__le32 reserved;
3036 } __packed;
3037 
3038 enum wmi_sched_scheme_flags {
3039 	/* should not be set when clearing scheduling scheme */
3040 	WMI_SCHED_SCHEME_ENABLE		= 0x01,
3041 	WMI_SCHED_PROTECTED_SP		= 0x02,
3042 	/* should be set only on first WMI fragment of scheme */
3043 	WMI_SCHED_FIRST			= 0x04,
3044 	/* should be set only on last WMI fragment of scheme */
3045 	WMI_SCHED_LAST			= 0x08,
3046 	WMI_SCHED_IMMEDIATE_START	= 0x10,
3047 };
3048 
3049 enum wmi_sched_scheme_advertisment {
3050 	/* ESE is not advertised at all, STA has to be configured with WMI
3051 	 * also
3052 	 */
3053 	WMI_ADVERTISE_ESE_DISABLED		= 0x0,
3054 	WMI_ADVERTISE_ESE_IN_BEACON		= 0x1,
3055 	WMI_ADVERTISE_ESE_IN_ANNOUNCE_FRAME	= 0x2,
3056 };
3057 
3058 /* WMI_SCHEDULING_SCHEME_CMD */
3059 struct wmi_scheduling_scheme_cmd {
3060 	u8 serial_num;
3061 	/* wmi_sched_scheme_advertisment */
3062 	u8 ese_advertisment;
3063 	/* wmi_sched_scheme_flags */
3064 	__le16 flags;
3065 	u8 num_allocs;
3066 	u8 reserved[3];
3067 	__le64 start_tbtt;
3068 	/* allocations list */
3069 	struct wmi_sched_scheme_slot allocs[WMI_SCHED_MAX_ALLOCS_PER_CMD];
3070 } __packed;
3071 
3072 enum wmi_sched_scheme_failure_type {
3073 	WMI_SCHED_SCHEME_FAILURE_NO_ERROR		= 0x00,
3074 	WMI_SCHED_SCHEME_FAILURE_OLD_START_TSF_ERR	= 0x01,
3075 };
3076 
3077 /* WMI_SCHEDULING_SCHEME_EVENTID */
3078 struct wmi_scheduling_scheme_event {
3079 	/* wmi_fw_status_e */
3080 	u8 status;
3081 	/* serial number given in command */
3082 	u8 serial_num;
3083 	/* wmi_sched_scheme_failure_type */
3084 	u8 failure_type;
3085 	/* alignment to 32b */
3086 	u8 reserved[1];
3087 } __packed;
3088 
3089 /* WMI_RS_CFG_CMDID - deprecated */
3090 struct wmi_rs_cfg_cmd {
3091 	/* connection id */
3092 	u8 cid;
3093 	/* enable or disable rate search */
3094 	u8 rs_enable;
3095 	/* rate search configuration */
3096 	struct wmi_rs_cfg rs_cfg;
3097 } __packed;
3098 
3099 /* WMI_RS_CFG_DONE_EVENTID - deprecated */
3100 struct wmi_rs_cfg_done_event {
3101 	u8 cid;
3102 	/* enum wmi_fw_status */
3103 	u8 status;
3104 	u8 reserved[2];
3105 } __packed;
3106 
3107 /* WMI_GET_DETAILED_RS_RES_CMDID - deprecated */
3108 struct wmi_get_detailed_rs_res_cmd {
3109 	/* connection id */
3110 	u8 cid;
3111 	u8 reserved[3];
3112 } __packed;
3113 
3114 /* RS results status */
3115 enum wmi_rs_results_status {
3116 	WMI_RS_RES_VALID	= 0x00,
3117 	WMI_RS_RES_INVALID	= 0x01,
3118 };
3119 
3120 /* Rate search results */
3121 struct wmi_rs_results {
3122 	/* number of sent MPDUs */
3123 	u8 num_of_tx_pkt[WMI_NUM_MCS];
3124 	/* number of non-acked MPDUs */
3125 	u8 num_of_non_acked_pkt[WMI_NUM_MCS];
3126 	/* RS timestamp */
3127 	__le32 tsf;
3128 	/* RS selected MCS */
3129 	u8 mcs;
3130 } __packed;
3131 
3132 /* WMI_GET_DETAILED_RS_RES_EVENTID - deprecated */
3133 struct wmi_get_detailed_rs_res_event {
3134 	u8 cid;
3135 	/* enum wmi_rs_results_status */
3136 	u8 status;
3137 	/* detailed rs results */
3138 	struct wmi_rs_results rs_results;
3139 	u8 reserved[3];
3140 } __packed;
3141 
3142 /* WMI_GET_DETAILED_RS_RES_EX_CMDID */
3143 struct wmi_get_detailed_rs_res_ex_cmd {
3144 	u8 cid;
3145 	u8 reserved[3];
3146 } __packed;
3147 
3148 /* Rate search results */
3149 struct wmi_rs_results_ex_common {
3150 	/* RS timestamp */
3151 	__le32 tsf;
3152 	/* RS selected MCS */
3153 	u8 mcs;
3154 	/* enum wmi_edmg_tx_mode */
3155 	u8 mode;
3156 	u8 reserved[2];
3157 } __packed;
3158 
3159 /* Rate search results */
3160 struct wmi_rs_results_ex_mcs {
3161 	/* number of sent MPDUs */
3162 	u8 num_of_tx_pkt;
3163 	/* number of non-acked MPDUs */
3164 	u8 num_of_non_acked_pkt;
3165 	u8 reserved[2];
3166 } __packed;
3167 
3168 /* WMI_GET_DETAILED_RS_RES_EX_EVENTID */
3169 struct wmi_get_detailed_rs_res_ex_event {
3170 	u8 cid;
3171 	/* enum wmi_rs_results_status */
3172 	u8 status;
3173 	u8 reserved0[2];
3174 	struct wmi_rs_results_ex_common common_rs_results;
3175 	u8 each_mcs_results_size;
3176 	u8 reserved1[3];
3177 	/* Results for each MCS */
3178 	struct wmi_rs_results_ex_mcs each_mcs_results[0];
3179 } __packed;
3180 
3181 /* BRP antenna limit mode */
3182 enum wmi_brp_ant_limit_mode {
3183 	/* Disable BRP force antenna limit */
3184 	WMI_BRP_ANT_LIMIT_MODE_DISABLE		= 0x00,
3185 	/* Define maximal antennas limit. Only effective antennas will be
3186 	 * actually used
3187 	 */
3188 	WMI_BRP_ANT_LIMIT_MODE_EFFECTIVE	= 0x01,
3189 	/* Force a specific number of antennas */
3190 	WMI_BRP_ANT_LIMIT_MODE_FORCE		= 0x02,
3191 	/* number of BRP antenna limit modes */
3192 	WMI_BRP_ANT_LIMIT_MODES_NUM		= 0x03,
3193 };
3194 
3195 /* WMI_BRP_SET_ANT_LIMIT_CMDID */
3196 struct wmi_brp_set_ant_limit_cmd {
3197 	/* connection id */
3198 	u8 cid;
3199 	/* enum wmi_brp_ant_limit_mode */
3200 	u8 limit_mode;
3201 	/* antenna limit count, 1-27
3202 	 * disable_mode - ignored
3203 	 * effective_mode - upper limit to number of antennas to be used
3204 	 * force_mode - exact number of antennas to be used
3205 	 */
3206 	u8 ant_limit;
3207 	u8 reserved;
3208 } __packed;
3209 
3210 /* WMI_BRP_SET_ANT_LIMIT_EVENTID */
3211 struct wmi_brp_set_ant_limit_event {
3212 	/* wmi_fw_status */
3213 	u8 status;
3214 	u8 reserved[3];
3215 } __packed;
3216 
3217 enum wmi_bf_type {
3218 	WMI_BF_TYPE_SLS		= 0x00,
3219 	WMI_BF_TYPE_BRP_RX	= 0x01,
3220 };
3221 
3222 /* WMI_BF_TRIG_CMDID */
3223 struct wmi_bf_trig_cmd {
3224 	/* enum wmi_bf_type - type of requested beamforming */
3225 	u8 bf_type;
3226 	/* used only for WMI_BF_TYPE_BRP_RX */
3227 	u8 cid;
3228 	/* used only for WMI_BF_TYPE_SLS */
3229 	u8 dst_mac[WMI_MAC_LEN];
3230 	u8 reserved[4];
3231 } __packed;
3232 
3233 /* WMI_BF_TRIG_EVENTID */
3234 struct wmi_bf_trig_event {
3235 	/* enum wmi_fw_status */
3236 	u8 status;
3237 	u8 cid;
3238 	u8 reserved[2];
3239 } __packed;
3240 
3241 /* broadcast connection ID */
3242 #define WMI_LINK_MAINTAIN_CFG_CID_BROADCAST	(0xFFFFFFFF)
3243 
3244 /* Types wmi_link_maintain_cfg presets for WMI_LINK_MAINTAIN_CFG_WRITE_CMD */
3245 enum wmi_link_maintain_cfg_type {
3246 	/* AP/PCP default normal (non-FST) configuration settings */
3247 	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_NORMAL_AP	= 0x00,
3248 	/* AP/PCP  default FST configuration settings */
3249 	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_FST_AP	= 0x01,
3250 	/* STA default normal (non-FST) configuration settings */
3251 	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_NORMAL_STA	= 0x02,
3252 	/* STA default FST configuration settings */
3253 	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_FST_STA	= 0x03,
3254 	/* custom configuration settings */
3255 	WMI_LINK_MAINTAIN_CFG_TYPE_CUSTOM		= 0x04,
3256 	/* number of defined configuration types */
3257 	WMI_LINK_MAINTAIN_CFG_TYPES_NUM			= 0x05,
3258 };
3259 
3260 /* Response status codes for WMI_LINK_MAINTAIN_CFG_WRITE/READ commands */
3261 enum wmi_link_maintain_cfg_response_status {
3262 	/* WMI_LINK_MAINTAIN_CFG_WRITE/READ command successfully accomplished
3263 	 */
3264 	WMI_LINK_MAINTAIN_CFG_RESPONSE_STATUS_OK		= 0x00,
3265 	/* ERROR due to bad argument in WMI_LINK_MAINTAIN_CFG_WRITE/READ
3266 	 * command request
3267 	 */
3268 	WMI_LINK_MAINTAIN_CFG_RESPONSE_STATUS_BAD_ARGUMENT	= 0x01,
3269 };
3270 
3271 /* Link Loss and Keep Alive configuration */
3272 struct wmi_link_maintain_cfg {
3273 	/* link_loss_enable_detectors_vec */
3274 	__le32 link_loss_enable_detectors_vec;
3275 	/* detectors check period usec */
3276 	__le32 check_link_loss_period_usec;
3277 	/* max allowed tx ageing */
3278 	__le32 tx_ageing_threshold_usec;
3279 	/* keep alive period for high SNR */
3280 	__le32 keep_alive_period_usec_high_snr;
3281 	/* keep alive period for low SNR */
3282 	__le32 keep_alive_period_usec_low_snr;
3283 	/* lower snr limit for keep alive period update */
3284 	__le32 keep_alive_snr_threshold_low_db;
3285 	/* upper snr limit for keep alive period update */
3286 	__le32 keep_alive_snr_threshold_high_db;
3287 	/* num of successive bad bcons causing link-loss */
3288 	__le32 bad_beacons_num_threshold;
3289 	/* SNR limit for bad_beacons_detector */
3290 	__le32 bad_beacons_snr_threshold_db;
3291 	/* timeout for disassoc response frame in uSec */
3292 	__le32 disconnect_timeout;
3293 } __packed;
3294 
3295 /* WMI_LINK_MAINTAIN_CFG_WRITE_CMDID */
3296 struct wmi_link_maintain_cfg_write_cmd {
3297 	/* enum wmi_link_maintain_cfg_type_e - type of requested default
3298 	 * configuration to be applied
3299 	 */
3300 	__le32 cfg_type;
3301 	/* requested connection ID or WMI_LINK_MAINTAIN_CFG_CID_BROADCAST */
3302 	__le32 cid;
3303 	/* custom configuration settings to be applied (relevant only if
3304 	 * cfg_type==WMI_LINK_MAINTAIN_CFG_TYPE_CUSTOM)
3305 	 */
3306 	struct wmi_link_maintain_cfg lm_cfg;
3307 } __packed;
3308 
3309 /* WMI_LINK_MAINTAIN_CFG_READ_CMDID */
3310 struct wmi_link_maintain_cfg_read_cmd {
3311 	/* connection ID which configuration settings are requested */
3312 	__le32 cid;
3313 } __packed;
3314 
3315 /* WMI_LINK_MAINTAIN_CFG_WRITE_DONE_EVENTID */
3316 struct wmi_link_maintain_cfg_write_done_event {
3317 	/* requested connection ID */
3318 	__le32 cid;
3319 	/* wmi_link_maintain_cfg_response_status_e - write status */
3320 	__le32 status;
3321 } __packed;
3322 
3323 /* \WMI_LINK_MAINTAIN_CFG_READ_DONE_EVENT */
3324 struct wmi_link_maintain_cfg_read_done_event {
3325 	/* requested connection ID */
3326 	__le32 cid;
3327 	/* wmi_link_maintain_cfg_response_status_e - read status */
3328 	__le32 status;
3329 	/* Retrieved configuration settings */
3330 	struct wmi_link_maintain_cfg lm_cfg;
3331 } __packed;
3332 
3333 enum wmi_traffic_suspend_status {
3334 	WMI_TRAFFIC_SUSPEND_APPROVED			= 0x0,
3335 	WMI_TRAFFIC_SUSPEND_REJECTED_LINK_NOT_IDLE	= 0x1,
3336 	WMI_TRAFFIC_SUSPEND_REJECTED_DISCONNECT		= 0x2,
3337 	WMI_TRAFFIC_SUSPEND_REJECTED_OTHER		= 0x3,
3338 };
3339 
3340 /* WMI_TRAFFIC_SUSPEND_EVENTID */
3341 struct wmi_traffic_suspend_event {
3342 	/* enum wmi_traffic_suspend_status_e */
3343 	u8 status;
3344 } __packed;
3345 
3346 enum wmi_traffic_resume_status {
3347 	WMI_TRAFFIC_RESUME_SUCCESS	= 0x0,
3348 	WMI_TRAFFIC_RESUME_FAILED	= 0x1,
3349 };
3350 
3351 enum wmi_resume_trigger {
3352 	WMI_RESUME_TRIGGER_UNKNOWN	= 0x0,
3353 	WMI_RESUME_TRIGGER_HOST		= 0x1,
3354 	WMI_RESUME_TRIGGER_UCAST_RX	= 0x2,
3355 	WMI_RESUME_TRIGGER_BCAST_RX	= 0x4,
3356 	WMI_RESUME_TRIGGER_WMI_EVT	= 0x8,
3357 	WMI_RESUME_TRIGGER_DISCONNECT	= 0x10,
3358 };
3359 
3360 /* WMI_TRAFFIC_RESUME_EVENTID */
3361 struct wmi_traffic_resume_event {
3362 	/* enum wmi_traffic_resume_status */
3363 	u8 status;
3364 	u8 reserved[3];
3365 	/* enum wmi_resume_trigger bitmap */
3366 	__le32 resume_triggers;
3367 } __packed;
3368 
3369 /* Power Save command completion status codes */
3370 enum wmi_ps_cfg_cmd_status {
3371 	WMI_PS_CFG_CMD_STATUS_SUCCESS	= 0x00,
3372 	WMI_PS_CFG_CMD_STATUS_BAD_PARAM	= 0x01,
3373 	/* other error */
3374 	WMI_PS_CFG_CMD_STATUS_ERROR	= 0x02,
3375 };
3376 
3377 /* Device Power Save Profiles */
3378 enum wmi_ps_profile_type {
3379 	WMI_PS_PROFILE_TYPE_DEFAULT		= 0x00,
3380 	WMI_PS_PROFILE_TYPE_PS_DISABLED		= 0x01,
3381 	WMI_PS_PROFILE_TYPE_MAX_PS		= 0x02,
3382 	WMI_PS_PROFILE_TYPE_LOW_LATENCY_PS	= 0x03,
3383 };
3384 
3385 /* WMI_PS_DEV_PROFILE_CFG_READ_CMDID */
3386 struct wmi_ps_dev_profile_cfg_read_cmd {
3387 	/* reserved */
3388 	__le32 reserved;
3389 } __packed;
3390 
3391 /* WMI_PS_DEV_PROFILE_CFG_READ_EVENTID */
3392 struct wmi_ps_dev_profile_cfg_read_event {
3393 	/* wmi_ps_profile_type_e */
3394 	u8 ps_profile;
3395 	u8 reserved[3];
3396 } __packed;
3397 
3398 /* WMI_PS_DEV_PROFILE_CFG_CMDID
3399  *
3400  * Power save profile to be used by the device
3401  *
3402  * Returned event:
3403  * - WMI_PS_DEV_PROFILE_CFG_EVENTID
3404  */
3405 struct wmi_ps_dev_profile_cfg_cmd {
3406 	/* wmi_ps_profile_type_e */
3407 	u8 ps_profile;
3408 	u8 reserved[3];
3409 } __packed;
3410 
3411 /* WMI_PS_DEV_PROFILE_CFG_EVENTID */
3412 struct wmi_ps_dev_profile_cfg_event {
3413 	/* wmi_ps_cfg_cmd_status_e */
3414 	__le32 status;
3415 } __packed;
3416 
3417 enum wmi_ps_level {
3418 	WMI_PS_LEVEL_DEEP_SLEEP		= 0x00,
3419 	WMI_PS_LEVEL_SHALLOW_SLEEP	= 0x01,
3420 	/* awake = all PS mechanisms are disabled */
3421 	WMI_PS_LEVEL_AWAKE		= 0x02,
3422 };
3423 
3424 enum wmi_ps_deep_sleep_clk_level {
3425 	/* 33k */
3426 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_RTC		= 0x00,
3427 	/* 10k */
3428 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_OSC		= 0x01,
3429 	/* @RTC Low latency */
3430 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_RTC_LT	= 0x02,
3431 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_XTAL	= 0x03,
3432 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_SYSCLK	= 0x04,
3433 	/* Not Applicable */
3434 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_N_A		= 0xFF,
3435 };
3436 
3437 /* Response by the FW to a D3 entry request */
3438 enum wmi_ps_d3_resp_policy {
3439 	WMI_PS_D3_RESP_POLICY_DEFAULT	= 0x00,
3440 	/* debug -D3 req is always denied */
3441 	WMI_PS_D3_RESP_POLICY_DENIED	= 0x01,
3442 	/* debug -D3 req is always approved */
3443 	WMI_PS_D3_RESP_POLICY_APPROVED	= 0x02,
3444 };
3445 
3446 #define WMI_AOA_MAX_DATA_SIZE	(128)
3447 
3448 enum wmi_aoa_meas_status {
3449 	WMI_AOA_MEAS_SUCCESS		= 0x00,
3450 	WMI_AOA_MEAS_PEER_INCAPABLE	= 0x01,
3451 	WMI_AOA_MEAS_FAILURE		= 0x02,
3452 };
3453 
3454 /* WMI_AOA_MEAS_EVENTID */
3455 struct wmi_aoa_meas_event {
3456 	u8 mac_addr[WMI_MAC_LEN];
3457 	/* channels IDs:
3458 	 * 0 - 58320 MHz
3459 	 * 1 - 60480 MHz
3460 	 * 2 - 62640 MHz
3461 	 */
3462 	u8 channel;
3463 	/* enum wmi_aoa_meas_type */
3464 	u8 aoa_meas_type;
3465 	/* Measurments are from RFs, defined by the mask */
3466 	__le32 meas_rf_mask;
3467 	/* enum wmi_aoa_meas_status */
3468 	u8 meas_status;
3469 	u8 reserved;
3470 	/* Length of meas_data in bytes */
3471 	__le16 length;
3472 	u8 meas_data[WMI_AOA_MAX_DATA_SIZE];
3473 } __packed;
3474 
3475 /* WMI_SET_MGMT_RETRY_LIMIT_EVENTID */
3476 struct wmi_set_mgmt_retry_limit_event {
3477 	/* enum wmi_fw_status */
3478 	u8 status;
3479 	/* alignment to 32b */
3480 	u8 reserved[3];
3481 } __packed;
3482 
3483 /* WMI_GET_MGMT_RETRY_LIMIT_EVENTID */
3484 struct wmi_get_mgmt_retry_limit_event {
3485 	/* MAC retransmit limit for mgmt frames */
3486 	u8 mgmt_retry_limit;
3487 	/* alignment to 32b */
3488 	u8 reserved[3];
3489 } __packed;
3490 
3491 /* WMI_TOF_GET_CAPABILITIES_EVENTID */
3492 struct wmi_tof_get_capabilities_event {
3493 	u8 ftm_capability;
3494 	/* maximum supported number of destination to start TOF */
3495 	u8 max_num_of_dest;
3496 	/* maximum supported number of measurements per burst */
3497 	u8 max_num_of_meas_per_burst;
3498 	u8 reserved;
3499 	/* maximum supported multi bursts */
3500 	__le16 max_multi_bursts_sessions;
3501 	/* maximum supported FTM burst duration , wmi_tof_burst_duration_e */
3502 	__le16 max_ftm_burst_duration;
3503 	/* AOA supported types */
3504 	__le32 aoa_supported_types;
3505 } __packed;
3506 
3507 /* WMI_SET_THERMAL_THROTTLING_CFG_EVENTID */
3508 struct wmi_set_thermal_throttling_cfg_event {
3509 	/* wmi_fw_status */
3510 	u8 status;
3511 	u8 reserved[3];
3512 } __packed;
3513 
3514 /* WMI_GET_THERMAL_THROTTLING_CFG_EVENTID */
3515 struct wmi_get_thermal_throttling_cfg_event {
3516 	/* Status data */
3517 	struct wmi_tt_data tt_data;
3518 } __packed;
3519 
3520 enum wmi_tof_session_end_status {
3521 	WMI_TOF_SESSION_END_NO_ERROR		= 0x00,
3522 	WMI_TOF_SESSION_END_FAIL		= 0x01,
3523 	WMI_TOF_SESSION_END_PARAMS_ERROR	= 0x02,
3524 	WMI_TOF_SESSION_END_ABORTED		= 0x03,
3525 	WMI_TOF_SESSION_END_BUSY		= 0x04,
3526 };
3527 
3528 /* WMI_TOF_SESSION_END_EVENTID */
3529 struct wmi_tof_session_end_event {
3530 	/* FTM session ID */
3531 	__le32 session_id;
3532 	/* wmi_tof_session_end_status_e */
3533 	u8 status;
3534 	u8 reserved[3];
3535 } __packed;
3536 
3537 /* WMI_TOF_SET_LCI_EVENTID */
3538 struct wmi_tof_set_lci_event {
3539 	/* enum wmi_fw_status */
3540 	u8 status;
3541 	u8 reserved[3];
3542 } __packed;
3543 
3544 /* WMI_TOF_SET_LCR_EVENTID */
3545 struct wmi_tof_set_lcr_event {
3546 	/* enum wmi_fw_status */
3547 	u8 status;
3548 	u8 reserved[3];
3549 } __packed;
3550 
3551 /* Responder FTM Results */
3552 struct wmi_responder_ftm_res {
3553 	u8 t1[6];
3554 	u8 t2[6];
3555 	u8 t3[6];
3556 	u8 t4[6];
3557 	__le16 tod_err;
3558 	__le16 toa_err;
3559 	__le16 tod_err_initiator;
3560 	__le16 toa_err_initiator;
3561 } __packed;
3562 
3563 enum wmi_tof_ftm_per_dest_res_status {
3564 	WMI_PER_DEST_RES_NO_ERROR		= 0x00,
3565 	WMI_PER_DEST_RES_TX_RX_FAIL		= 0x01,
3566 	WMI_PER_DEST_RES_PARAM_DONT_MATCH	= 0x02,
3567 };
3568 
3569 enum wmi_tof_ftm_per_dest_res_flags {
3570 	WMI_PER_DEST_RES_REQ_START		= 0x01,
3571 	WMI_PER_DEST_RES_BURST_REPORT_END	= 0x02,
3572 	WMI_PER_DEST_RES_REQ_END		= 0x04,
3573 	WMI_PER_DEST_RES_PARAM_UPDATE		= 0x08,
3574 };
3575 
3576 /* WMI_TOF_FTM_PER_DEST_RES_EVENTID */
3577 struct wmi_tof_ftm_per_dest_res_event {
3578 	/* FTM session ID */
3579 	__le32 session_id;
3580 	/* destination MAC address */
3581 	u8 dst_mac[WMI_MAC_LEN];
3582 	/* wmi_tof_ftm_per_dest_res_flags_e */
3583 	u8 flags;
3584 	/* wmi_tof_ftm_per_dest_res_status_e */
3585 	u8 status;
3586 	/* responder ASAP */
3587 	u8 responder_asap;
3588 	/* responder number of FTM per burst */
3589 	u8 responder_num_ftm_per_burst;
3590 	/* responder number of FTM burst exponent */
3591 	u8 responder_num_ftm_bursts_exp;
3592 	/* responder burst duration ,wmi_tof_burst_duration_e */
3593 	u8 responder_burst_duration;
3594 	/* responder burst period, indicate interval between two consecutive
3595 	 * burst instances, in units of 100 ms
3596 	 */
3597 	__le16 responder_burst_period;
3598 	/* receive burst counter */
3599 	__le16 bursts_cnt;
3600 	/* tsf of responder start burst */
3601 	__le32 tsf_sync;
3602 	/* actual received ftm per burst */
3603 	u8 actual_ftm_per_burst;
3604 	/* Measurments are from RFs, defined by the mask */
3605 	__le32 meas_rf_mask;
3606 	u8 reserved0[3];
3607 	struct wmi_responder_ftm_res responder_ftm_res[0];
3608 } __packed;
3609 
3610 /* WMI_TOF_CFG_RESPONDER_EVENTID */
3611 struct wmi_tof_cfg_responder_event {
3612 	/* enum wmi_fw_status */
3613 	u8 status;
3614 	u8 reserved[3];
3615 } __packed;
3616 
3617 enum wmi_tof_channel_info_type {
3618 	WMI_TOF_CHANNEL_INFO_AOA		= 0x00,
3619 	WMI_TOF_CHANNEL_INFO_LCI		= 0x01,
3620 	WMI_TOF_CHANNEL_INFO_LCR		= 0x02,
3621 	WMI_TOF_CHANNEL_INFO_VENDOR_SPECIFIC	= 0x03,
3622 	WMI_TOF_CHANNEL_INFO_CIR		= 0x04,
3623 	WMI_TOF_CHANNEL_INFO_RSSI		= 0x05,
3624 	WMI_TOF_CHANNEL_INFO_SNR		= 0x06,
3625 	WMI_TOF_CHANNEL_INFO_DEBUG		= 0x07,
3626 };
3627 
3628 /* WMI_TOF_CHANNEL_INFO_EVENTID */
3629 struct wmi_tof_channel_info_event {
3630 	/* FTM session ID */
3631 	__le32 session_id;
3632 	/* destination MAC address */
3633 	u8 dst_mac[WMI_MAC_LEN];
3634 	/* wmi_tof_channel_info_type_e */
3635 	u8 type;
3636 	/* data report length */
3637 	u8 len;
3638 	/* data report payload */
3639 	u8 report[0];
3640 } __packed;
3641 
3642 /* WMI_TOF_SET_TX_RX_OFFSET_EVENTID */
3643 struct wmi_tof_set_tx_rx_offset_event {
3644 	/* enum wmi_fw_status */
3645 	u8 status;
3646 	u8 reserved[3];
3647 } __packed;
3648 
3649 /* WMI_TOF_GET_TX_RX_OFFSET_EVENTID */
3650 struct wmi_tof_get_tx_rx_offset_event {
3651 	/* enum wmi_fw_status */
3652 	u8 status;
3653 	/* RF index used to read the offsets */
3654 	u8 rf_index;
3655 	u8 reserved1[2];
3656 	/* TX delay offset */
3657 	__le32 tx_offset;
3658 	/* RX delay offset */
3659 	__le32 rx_offset;
3660 	/* Offset to strongest tap of CIR */
3661 	__le32 precursor;
3662 } __packed;
3663 
3664 /* Result status codes for WMI commands */
3665 enum wmi_rf_sector_status {
3666 	WMI_RF_SECTOR_STATUS_SUCCESS			= 0x00,
3667 	WMI_RF_SECTOR_STATUS_BAD_PARAMETERS_ERROR	= 0x01,
3668 	WMI_RF_SECTOR_STATUS_BUSY_ERROR			= 0x02,
3669 	WMI_RF_SECTOR_STATUS_NOT_SUPPORTED_ERROR	= 0x03,
3670 };
3671 
3672 /* Types of the RF sector (TX,RX) */
3673 enum wmi_rf_sector_type {
3674 	WMI_RF_SECTOR_TYPE_RX	= 0x00,
3675 	WMI_RF_SECTOR_TYPE_TX	= 0x01,
3676 };
3677 
3678 /* Content of RF Sector (six 32-bits registers) */
3679 struct wmi_rf_sector_info {
3680 	/* Phase values for RF Chains[15-0] (2bits per RF chain) */
3681 	__le32 psh_hi;
3682 	/* Phase values for RF Chains[31-16] (2bits per RF chain) */
3683 	__le32 psh_lo;
3684 	/* ETYPE Bit0 for all RF chains[31-0] - bit0 of Edge amplifier gain
3685 	 * index
3686 	 */
3687 	__le32 etype0;
3688 	/* ETYPE Bit1 for all RF chains[31-0] - bit1 of Edge amplifier gain
3689 	 * index
3690 	 */
3691 	__le32 etype1;
3692 	/* ETYPE Bit2 for all RF chains[31-0] - bit2 of Edge amplifier gain
3693 	 * index
3694 	 */
3695 	__le32 etype2;
3696 	/* D-Type values (3bits each) for 8 Distribution amplifiers + X16
3697 	 * switch bits
3698 	 */
3699 	__le32 dtype_swch_off;
3700 } __packed;
3701 
3702 #define WMI_INVALID_RF_SECTOR_INDEX	(0xFFFF)
3703 #define WMI_MAX_RF_MODULES_NUM		(8)
3704 
3705 /* WMI_GET_RF_SECTOR_PARAMS_CMD */
3706 struct wmi_get_rf_sector_params_cmd {
3707 	/* Sector number to be retrieved */
3708 	__le16 sector_idx;
3709 	/* enum wmi_rf_sector_type - type of requested RF sector */
3710 	u8 sector_type;
3711 	/* bitmask vector specifying destination RF modules */
3712 	u8 rf_modules_vec;
3713 } __packed;
3714 
3715 /* \WMI_GET_RF_SECTOR_PARAMS_DONE_EVENT */
3716 struct wmi_get_rf_sector_params_done_event {
3717 	/* result status of WMI_GET_RF_SECTOR_PARAMS_CMD (enum
3718 	 * wmi_rf_sector_status)
3719 	 */
3720 	u8 status;
3721 	/* align next field to U64 boundary */
3722 	u8 reserved[7];
3723 	/* TSF timestamp when RF sectors where retrieved */
3724 	__le64 tsf;
3725 	/* Content of RF sector retrieved from each RF module */
3726 	struct wmi_rf_sector_info sectors_info[WMI_MAX_RF_MODULES_NUM];
3727 } __packed;
3728 
3729 /* WMI_SET_RF_SECTOR_PARAMS_CMD */
3730 struct wmi_set_rf_sector_params_cmd {
3731 	/* Sector number to be retrieved */
3732 	__le16 sector_idx;
3733 	/* enum wmi_rf_sector_type - type of requested RF sector */
3734 	u8 sector_type;
3735 	/* bitmask vector specifying destination RF modules */
3736 	u8 rf_modules_vec;
3737 	/* Content of RF sector to be written to each RF module */
3738 	struct wmi_rf_sector_info sectors_info[WMI_MAX_RF_MODULES_NUM];
3739 } __packed;
3740 
3741 /* \WMI_SET_RF_SECTOR_PARAMS_DONE_EVENT */
3742 struct wmi_set_rf_sector_params_done_event {
3743 	/* result status of WMI_SET_RF_SECTOR_PARAMS_CMD (enum
3744 	 * wmi_rf_sector_status)
3745 	 */
3746 	u8 status;
3747 } __packed;
3748 
3749 /* WMI_GET_SELECTED_RF_SECTOR_INDEX_CMD - Get RF sector index selected by
3750  * TXSS/BRP for communication with specified CID
3751  */
3752 struct wmi_get_selected_rf_sector_index_cmd {
3753 	/* Connection/Station ID in [0:7] range */
3754 	u8 cid;
3755 	/* type of requested RF sector (enum wmi_rf_sector_type) */
3756 	u8 sector_type;
3757 	/* align to U32 boundary */
3758 	u8 reserved[2];
3759 } __packed;
3760 
3761 /* \WMI_GET_SELECTED_RF_SECTOR_INDEX_DONE_EVENT - Returns retrieved RF sector
3762  * index selected by TXSS/BRP for communication with specified CID
3763  */
3764 struct wmi_get_selected_rf_sector_index_done_event {
3765 	/* Retrieved sector index selected in TXSS (for TX sector request) or
3766 	 * BRP (for RX sector request)
3767 	 */
3768 	__le16 sector_idx;
3769 	/* result status of WMI_GET_SELECTED_RF_SECTOR_INDEX_CMD (enum
3770 	 * wmi_rf_sector_status)
3771 	 */
3772 	u8 status;
3773 	/* align next field to U64 boundary */
3774 	u8 reserved[5];
3775 	/* TSF timestamp when result was retrieved */
3776 	__le64 tsf;
3777 } __packed;
3778 
3779 /* WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD - Force RF sector index for
3780  * communication with specified CID. Assumes that TXSS/BRP is disabled by
3781  * other command
3782  */
3783 struct wmi_set_selected_rf_sector_index_cmd {
3784 	/* Connection/Station ID in [0:7] range */
3785 	u8 cid;
3786 	/* type of requested RF sector (enum wmi_rf_sector_type) */
3787 	u8 sector_type;
3788 	/* Forced sector index */
3789 	__le16 sector_idx;
3790 } __packed;
3791 
3792 /* \WMI_SET_SELECTED_RF_SECTOR_INDEX_DONE_EVENT - Success/Fail status for
3793  * WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD
3794  */
3795 struct wmi_set_selected_rf_sector_index_done_event {
3796 	/* result status of WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD (enum
3797 	 * wmi_rf_sector_status)
3798 	 */
3799 	u8 status;
3800 	/* align to U32 boundary */
3801 	u8 reserved[3];
3802 } __packed;
3803 
3804 /* WMI_SET_RF_SECTOR_ON_CMD - Activates specified sector for specified rf
3805  * modules
3806  */
3807 struct wmi_set_rf_sector_on_cmd {
3808 	/* Sector index to be activated */
3809 	__le16 sector_idx;
3810 	/* type of requested RF sector (enum wmi_rf_sector_type) */
3811 	u8 sector_type;
3812 	/* bitmask vector specifying destination RF modules */
3813 	u8 rf_modules_vec;
3814 } __packed;
3815 
3816 /* \WMI_SET_RF_SECTOR_ON_DONE_EVENT - Success/Fail status for
3817  * WMI_SET_RF_SECTOR_ON_CMD
3818  */
3819 struct wmi_set_rf_sector_on_done_event {
3820 	/* result status of WMI_SET_RF_SECTOR_ON_CMD (enum
3821 	 * wmi_rf_sector_status)
3822 	 */
3823 	u8 status;
3824 	/* align to U32 boundary */
3825 	u8 reserved[3];
3826 } __packed;
3827 
3828 enum wmi_sector_sweep_type {
3829 	WMI_SECTOR_SWEEP_TYPE_TXSS		= 0x00,
3830 	WMI_SECTOR_SWEEP_TYPE_BCON		= 0x01,
3831 	WMI_SECTOR_SWEEP_TYPE_TXSS_AND_BCON	= 0x02,
3832 	WMI_SECTOR_SWEEP_TYPE_NUM		= 0x03,
3833 };
3834 
3835 /* WMI_PRIO_TX_SECTORS_ORDER_CMDID
3836  *
3837  * Set the order of TX sectors in TXSS and/or Beacon(AP).
3838  *
3839  * Returned event:
3840  * - WMI_PRIO_TX_SECTORS_ORDER_EVENTID
3841  */
3842 struct wmi_prio_tx_sectors_order_cmd {
3843 	/* tx sectors order to be applied, 0xFF for end of array */
3844 	u8 tx_sectors_priority_array[MAX_NUM_OF_SECTORS];
3845 	/* enum wmi_sector_sweep_type, TXSS and/or Beacon */
3846 	u8 sector_sweep_type;
3847 	/* needed only for TXSS configuration */
3848 	u8 cid;
3849 	/* alignment to 32b */
3850 	u8 reserved[2];
3851 } __packed;
3852 
3853 /* completion status codes */
3854 enum wmi_prio_tx_sectors_cmd_status {
3855 	WMI_PRIO_TX_SECT_CMD_STATUS_SUCCESS	= 0x00,
3856 	WMI_PRIO_TX_SECT_CMD_STATUS_BAD_PARAM	= 0x01,
3857 	/* other error */
3858 	WMI_PRIO_TX_SECT_CMD_STATUS_ERROR	= 0x02,
3859 };
3860 
3861 /* WMI_PRIO_TX_SECTORS_ORDER_EVENTID */
3862 struct wmi_prio_tx_sectors_order_event {
3863 	/* enum wmi_prio_tx_sectors_cmd_status */
3864 	u8 status;
3865 	/* alignment to 32b */
3866 	u8 reserved[3];
3867 } __packed;
3868 
3869 struct wmi_prio_tx_sectors_num_cmd {
3870 	/* [0-128], 0 = No changes */
3871 	u8 beacon_number_of_sectors;
3872 	/* [0-128], 0 = No changes */
3873 	u8 txss_number_of_sectors;
3874 	/* [0-8] needed only for TXSS configuration */
3875 	u8 cid;
3876 } __packed;
3877 
3878 /* WMI_PRIO_TX_SECTORS_NUMBER_CMDID
3879  *
3880  * Set the number of active sectors in TXSS and/or Beacon.
3881  *
3882  * Returned event:
3883  * - WMI_PRIO_TX_SECTORS_NUMBER_EVENTID
3884  */
3885 struct wmi_prio_tx_sectors_number_cmd {
3886 	struct wmi_prio_tx_sectors_num_cmd active_sectors_num;
3887 	/* alignment to 32b */
3888 	u8 reserved;
3889 } __packed;
3890 
3891 /* WMI_PRIO_TX_SECTORS_NUMBER_EVENTID */
3892 struct wmi_prio_tx_sectors_number_event {
3893 	/* enum wmi_prio_tx_sectors_cmd_status */
3894 	u8 status;
3895 	/* alignment to 32b */
3896 	u8 reserved[3];
3897 } __packed;
3898 
3899 /* WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_CMDID
3900  *
3901  * Set default sectors order and number (hard coded in board file)
3902  * in TXSS and/or Beacon.
3903  *
3904  * Returned event:
3905  * - WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID
3906  */
3907 struct wmi_prio_tx_sectors_set_default_cfg_cmd {
3908 	/* enum wmi_sector_sweep_type, TXSS and/or Beacon */
3909 	u8 sector_sweep_type;
3910 	/* needed only for TXSS configuration */
3911 	u8 cid;
3912 	/* alignment to 32b */
3913 	u8 reserved[2];
3914 } __packed;
3915 
3916 /* WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID */
3917 struct wmi_prio_tx_sectors_set_default_cfg_event {
3918 	/* enum wmi_prio_tx_sectors_cmd_status */
3919 	u8 status;
3920 	/* alignment to 32b */
3921 	u8 reserved[3];
3922 } __packed;
3923 
3924 /* WMI_SET_SILENT_RSSI_TABLE_DONE_EVENTID */
3925 struct wmi_set_silent_rssi_table_done_event {
3926 	/* enum wmi_silent_rssi_status */
3927 	__le32 status;
3928 	/* enum wmi_silent_rssi_table */
3929 	__le32 table;
3930 } __packed;
3931 
3932 /* WMI_VRING_SWITCH_TIMING_CONFIG_EVENTID */
3933 struct wmi_vring_switch_timing_config_event {
3934 	/* enum wmi_fw_status */
3935 	u8 status;
3936 	u8 reserved[3];
3937 } __packed;
3938 
3939 /* WMI_GET_ASSOC_LIST_RES_EVENTID */
3940 struct wmi_assoc_sta_info {
3941 	u8 mac[WMI_MAC_LEN];
3942 	u8 omni_index_address;
3943 	u8 reserved;
3944 } __packed;
3945 
3946 #define WMI_GET_ASSOC_LIST_SIZE	(8)
3947 
3948 /* WMI_GET_ASSOC_LIST_RES_EVENTID
3949  * Returns up to MAX_ASSOC_STA_LIST_SIZE associated STAs
3950  */
3951 struct wmi_get_assoc_list_res_event {
3952 	struct wmi_assoc_sta_info assoc_sta_list[WMI_GET_ASSOC_LIST_SIZE];
3953 	/* STA count */
3954 	u8 count;
3955 	u8 reserved[3];
3956 } __packed;
3957 
3958 /* WMI_BF_CONTROL_EVENTID - deprecated */
3959 struct wmi_bf_control_event {
3960 	/* wmi_fw_status */
3961 	u8 status;
3962 	u8 reserved[3];
3963 } __packed;
3964 
3965 /* WMI_BF_CONTROL_EX_EVENTID */
3966 struct wmi_bf_control_ex_event {
3967 	/* wmi_fw_status */
3968 	u8 status;
3969 	u8 reserved[3];
3970 } __packed;
3971 
3972 /* WMI_COMMAND_NOT_SUPPORTED_EVENTID */
3973 struct wmi_command_not_supported_event {
3974 	/* device id */
3975 	u8 mid;
3976 	u8 reserved0;
3977 	__le16 command_id;
3978 	/* for UT command only, otherwise reserved */
3979 	__le16 command_subtype;
3980 	__le16 reserved1;
3981 } __packed;
3982 
3983 /* WMI_TSF_SYNC_CMDID */
3984 struct wmi_tsf_sync_cmd {
3985 	/* The time interval to send announce frame in one BI */
3986 	u8 interval_ms;
3987 	/* The mcs to send announce frame */
3988 	u8 mcs;
3989 	u8 reserved[6];
3990 } __packed;
3991 
3992 /* WMI_TSF_SYNC_STATUS_EVENTID */
3993 enum wmi_tsf_sync_status {
3994 	WMI_TSF_SYNC_SUCCESS	= 0x00,
3995 	WMI_TSF_SYNC_FAILED	= 0x01,
3996 	WMI_TSF_SYNC_REJECTED	= 0x02,
3997 };
3998 
3999 /* WMI_TSF_SYNC_STATUS_EVENTID */
4000 struct wmi_tsf_sync_status_event {
4001 	/* enum wmi_tsf_sync_status */
4002 	u8 status;
4003 	u8 reserved[3];
4004 } __packed;
4005 
4006 /* WMI_GET_CCA_INDICATIONS_EVENTID */
4007 struct wmi_get_cca_indications_event {
4008 	/* wmi_fw_status */
4009 	u8 status;
4010 	/* CCA-Energy Detect in percentage over last BI (0..100) */
4011 	u8 cca_ed_percent;
4012 	/* Averaged CCA-Energy Detect in percent over number of BIs (0..100) */
4013 	u8 cca_ed_avg_percent;
4014 	/* NAV percent over last BI (0..100) */
4015 	u8 nav_percent;
4016 	/* Averaged NAV percent over number of BIs (0..100) */
4017 	u8 nav_avg_percent;
4018 	u8 reserved[3];
4019 } __packed;
4020 
4021 /* WMI_SET_CCA_INDICATIONS_BI_AVG_NUM_CMDID */
4022 struct wmi_set_cca_indications_bi_avg_num_cmd {
4023 	/* set the number of bis to average cca_ed (0..255) */
4024 	u8 bi_number;
4025 	u8 reserved[3];
4026 } __packed;
4027 
4028 /* WMI_SET_CCA_INDICATIONS_BI_AVG_NUM_EVENTID */
4029 struct wmi_set_cca_indications_bi_avg_num_event {
4030 	/* wmi_fw_status */
4031 	u8 status;
4032 	u8 reserved[3];
4033 } __packed;
4034 
4035 /* WMI_INTERNAL_FW_SET_CHANNEL */
4036 struct wmi_internal_fw_set_channel_event {
4037 	u8 channel_num;
4038 	u8 reserved[3];
4039 } __packed;
4040 
4041 /* WMI_LINK_STATS_CONFIG_DONE_EVENTID */
4042 struct wmi_link_stats_config_done_event {
4043 	/* wmi_fw_status_e */
4044 	u8 status;
4045 	u8 reserved[3];
4046 } __packed;
4047 
4048 /* WMI_LINK_STATS_EVENTID */
4049 struct wmi_link_stats_event {
4050 	__le64 tsf;
4051 	__le16 payload_size;
4052 	u8 has_next;
4053 	u8 reserved[5];
4054 	/* a stream of wmi_link_stats_record_s */
4055 	u8 payload[0];
4056 } __packed;
4057 
4058 /* WMI_LINK_STATS_EVENT */
4059 struct wmi_link_stats_record {
4060 	/* wmi_link_stats_record_type_e */
4061 	u8 record_type_id;
4062 	u8 reserved;
4063 	__le16 record_size;
4064 	u8 record[0];
4065 } __packed;
4066 
4067 /* WMI_LINK_STATS_TYPE_BASIC */
4068 struct wmi_link_stats_basic {
4069 	u8 cid;
4070 	s8 rssi;
4071 	u8 sqi;
4072 	u8 bf_mcs;
4073 	u8 per_average;
4074 	u8 selected_rfc;
4075 	u8 rx_effective_ant_num;
4076 	u8 my_rx_sector;
4077 	u8 my_tx_sector;
4078 	u8 other_rx_sector;
4079 	u8 other_tx_sector;
4080 	u8 reserved[7];
4081 	/* 1/4 Db units */
4082 	__le16 snr;
4083 	__le32 tx_tpt;
4084 	__le32 tx_goodput;
4085 	__le32 rx_goodput;
4086 	__le32 bf_count;
4087 	__le32 rx_bcast_frames;
4088 } __packed;
4089 
4090 /* WMI_LINK_STATS_TYPE_GLOBAL */
4091 struct wmi_link_stats_global {
4092 	/* all ack-able frames */
4093 	__le32 rx_frames;
4094 	/* all ack-able frames */
4095 	__le32 tx_frames;
4096 	__le32 rx_ba_frames;
4097 	__le32 tx_ba_frames;
4098 	__le32 tx_beacons;
4099 	__le32 rx_mic_errors;
4100 	__le32 rx_crc_errors;
4101 	__le32 tx_fail_no_ack;
4102 	u8 reserved[8];
4103 } __packed;
4104 
4105 /* WMI_SET_GRANT_MCS_EVENTID */
4106 struct wmi_set_grant_mcs_event {
4107 	/* wmi_fw_status */
4108 	u8 status;
4109 	u8 reserved[3];
4110 } __packed;
4111 
4112 /* WMI_SET_AP_SLOT_SIZE_EVENTID */
4113 struct wmi_set_ap_slot_size_event {
4114 	/* wmi_fw_status */
4115 	u8 status;
4116 	u8 reserved[3];
4117 } __packed;
4118 
4119 /* WMI_SET_VRING_PRIORITY_WEIGHT_EVENTID */
4120 struct wmi_set_vring_priority_weight_event {
4121 	/* wmi_fw_status */
4122 	u8 status;
4123 	u8 reserved[3];
4124 } __packed;
4125 
4126 /* WMI_SET_VRING_PRIORITY_EVENTID */
4127 struct wmi_set_vring_priority_event {
4128 	/* wmi_fw_status */
4129 	u8 status;
4130 	u8 reserved[3];
4131 } __packed;
4132 
4133 /* WMI_RADAR_PCI_CTRL_BLOCK struct */
4134 struct wmi_radar_pci_ctrl_block {
4135 	/* last fw tail address index */
4136 	__le32 fw_tail_index;
4137 	/* last SW head address index known to FW */
4138 	__le32 sw_head_index;
4139 	__le32 last_wr_pulse_tsf_low;
4140 	__le32 last_wr_pulse_count;
4141 	__le32 last_wr_in_bytes;
4142 	__le32 last_wr_pulse_id;
4143 	__le32 last_wr_burst_id;
4144 	/* When pre overflow detected, advance sw head in unit of pulses */
4145 	__le32 sw_head_inc;
4146 	__le32 reserved[8];
4147 } __packed;
4148 
4149 /* WMI_RBUFCAP_CFG_CMD */
4150 struct wmi_rbufcap_cfg_cmd {
4151 	u8 enable;
4152 	u8 reserved;
4153 	/* RBUFCAP indicates rx space unavailable when number of rx
4154 	 * descriptors drops below this threshold. Set 0 to use system
4155 	 * default
4156 	 */
4157 	__le16 rx_desc_threshold;
4158 } __packed;
4159 
4160 /* WMI_RBUFCAP_CFG_EVENTID */
4161 struct wmi_rbufcap_cfg_event {
4162 	/* enum wmi_fw_status */
4163 	u8 status;
4164 	u8 reserved[3];
4165 } __packed;
4166 
4167 /* WMI_TEMP_SENSE_ALL_DONE_EVENTID
4168  * Measure MAC and all radio temperatures
4169  */
4170 struct wmi_temp_sense_all_done_event {
4171 	/* enum wmi_fw_status */
4172 	u8 status;
4173 	/* Bitmap of connected RFs */
4174 	u8 rf_bitmap;
4175 	u8 reserved[2];
4176 	/* Temperature times 1000 (actual temperature will be achieved by
4177 	 * dividing the value by 1000). When temperature cannot be read from
4178 	 * device return WMI_INVALID_TEMPERATURE
4179 	 */
4180 	__le32 rf_t1000[WMI_MAX_XIF_PORTS_NUM];
4181 	/* Temperature times 1000 (actual temperature will be achieved by
4182 	 * dividing the value by 1000). When temperature cannot be read from
4183 	 * device return WMI_INVALID_TEMPERATURE
4184 	 */
4185 	__le32 baseband_t1000;
4186 } __packed;
4187 
4188 #endif /* __WILOCITY_WMI_H__ */
4189