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