xref: /linux/drivers/net/wireless/ath/wil6210/wmi.h (revision 0883c2c06fb5bcf5b9e008270827e63c09a88c1e)
1 /*
2  * Copyright (c) 2012-2016 Qualcomm Atheros, Inc.
3  * Copyright (c) 2006-2012 Wilocity
4  *
5  * Permission to use, copy, modify, and/or distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  */
17 
18 /*
19  * This file contains the definitions of the WMI protocol specified in the
20  * Wireless Module Interface (WMI) for the Qualcomm
21  * 60 GHz wireless solution.
22  * It includes definitions of all the commands and events.
23  * Commands are messages from the host to the WM.
24  * Events are messages from the WM to the host.
25  *
26  * This is an automatically generated file.
27  */
28 
29 #ifndef __WILOCITY_WMI_H__
30 #define __WILOCITY_WMI_H__
31 
32 /* General */
33 #define WMI_MAX_ASSOC_STA		(8)
34 #define WMI_DEFAULT_ASSOC_STA		(1)
35 #define WMI_MAC_LEN			(6)
36 #define WMI_PROX_RANGE_NUM		(3)
37 #define WMI_MAX_LOSS_DMG_BEACONS	(20)
38 
39 /* Mailbox interface
40  * used for commands and events
41  */
42 enum wmi_mid {
43 	MID_DEFAULT		= 0x00,
44 	FIRST_DBG_MID_ID	= 0x10,
45 	LAST_DBG_MID_ID		= 0xFE,
46 	MID_BROADCAST		= 0xFF,
47 };
48 
49 /* WMI_CMD_HDR */
50 struct wmi_cmd_hdr {
51 	u8 mid;
52 	u8 reserved;
53 	__le16 command_id;
54 	__le32 fw_timestamp;
55 } __packed;
56 
57 /* List of Commands */
58 enum wmi_command_id {
59 	WMI_CONNECT_CMDID			= 0x01,
60 	WMI_DISCONNECT_CMDID			= 0x03,
61 	WMI_DISCONNECT_STA_CMDID		= 0x04,
62 	WMI_START_SCAN_CMDID			= 0x07,
63 	WMI_SET_BSS_FILTER_CMDID		= 0x09,
64 	WMI_SET_PROBED_SSID_CMDID		= 0x0A,
65 	WMI_SET_LISTEN_INT_CMDID		= 0x0B,
66 	WMI_BCON_CTRL_CMDID			= 0x0F,
67 	WMI_ADD_CIPHER_KEY_CMDID		= 0x16,
68 	WMI_DELETE_CIPHER_KEY_CMDID		= 0x17,
69 	WMI_PCP_CONF_CMDID			= 0x18,
70 	WMI_SET_APPIE_CMDID			= 0x3F,
71 	WMI_SET_WSC_STATUS_CMDID		= 0x41,
72 	WMI_PXMT_RANGE_CFG_CMDID		= 0x42,
73 	WMI_PXMT_SNR2_RANGE_CFG_CMDID		= 0x43,
74 	WMI_MEM_READ_CMDID			= 0x800,
75 	WMI_MEM_WR_CMDID			= 0x801,
76 	WMI_ECHO_CMDID				= 0x803,
77 	WMI_DEEP_ECHO_CMDID			= 0x804,
78 	WMI_CONFIG_MAC_CMDID			= 0x805,
79 	WMI_CONFIG_PHY_DEBUG_CMDID		= 0x806,
80 	WMI_ADD_DEBUG_TX_PCKT_CMDID		= 0x808,
81 	WMI_PHY_GET_STATISTICS_CMDID		= 0x809,
82 	WMI_FS_TUNE_CMDID			= 0x80A,
83 	WMI_CORR_MEASURE_CMDID			= 0x80B,
84 	WMI_READ_RSSI_CMDID			= 0x80C,
85 	WMI_TEMP_SENSE_CMDID			= 0x80E,
86 	WMI_DC_CALIB_CMDID			= 0x80F,
87 	WMI_SEND_TONE_CMDID			= 0x810,
88 	WMI_IQ_TX_CALIB_CMDID			= 0x811,
89 	WMI_IQ_RX_CALIB_CMDID			= 0x812,
90 	WMI_SET_UCODE_IDLE_CMDID		= 0x813,
91 	WMI_SET_WORK_MODE_CMDID			= 0x815,
92 	WMI_LO_LEAKAGE_CALIB_CMDID		= 0x816,
93 	WMI_MARLON_R_READ_CMDID			= 0x818,
94 	WMI_MARLON_R_WRITE_CMDID		= 0x819,
95 	WMI_MARLON_R_TXRX_SEL_CMDID		= 0x81A,
96 	MAC_IO_STATIC_PARAMS_CMDID		= 0x81B,
97 	MAC_IO_DYNAMIC_PARAMS_CMDID		= 0x81C,
98 	WMI_SILENT_RSSI_CALIB_CMDID		= 0x81D,
99 	WMI_RF_RX_TEST_CMDID			= 0x81E,
100 	WMI_CFG_RX_CHAIN_CMDID			= 0x820,
101 	WMI_VRING_CFG_CMDID			= 0x821,
102 	WMI_BCAST_VRING_CFG_CMDID		= 0x822,
103 	WMI_VRING_BA_EN_CMDID			= 0x823,
104 	WMI_VRING_BA_DIS_CMDID			= 0x824,
105 	WMI_RCP_ADDBA_RESP_CMDID		= 0x825,
106 	WMI_RCP_DELBA_CMDID			= 0x826,
107 	WMI_SET_SSID_CMDID			= 0x827,
108 	WMI_GET_SSID_CMDID			= 0x828,
109 	WMI_SET_PCP_CHANNEL_CMDID		= 0x829,
110 	WMI_GET_PCP_CHANNEL_CMDID		= 0x82A,
111 	WMI_SW_TX_REQ_CMDID			= 0x82B,
112 	WMI_READ_MAC_RXQ_CMDID			= 0x830,
113 	WMI_READ_MAC_TXQ_CMDID			= 0x831,
114 	WMI_WRITE_MAC_RXQ_CMDID			= 0x832,
115 	WMI_WRITE_MAC_TXQ_CMDID			= 0x833,
116 	WMI_WRITE_MAC_XQ_FIELD_CMDID		= 0x834,
117 	WMI_MLME_PUSH_CMDID			= 0x835,
118 	WMI_BEAMFORMING_MGMT_CMDID		= 0x836,
119 	WMI_BF_TXSS_MGMT_CMDID			= 0x837,
120 	WMI_BF_SM_MGMT_CMDID			= 0x838,
121 	WMI_BF_RXSS_MGMT_CMDID			= 0x839,
122 	WMI_BF_TRIG_CMDID			= 0x83A,
123 	WMI_SET_SECTORS_CMDID			= 0x849,
124 	WMI_MAINTAIN_PAUSE_CMDID		= 0x850,
125 	WMI_MAINTAIN_RESUME_CMDID		= 0x851,
126 	WMI_RS_MGMT_CMDID			= 0x852,
127 	WMI_RF_MGMT_CMDID			= 0x853,
128 	WMI_THERMAL_THROTTLING_CTRL_CMDID	= 0x854,
129 	WMI_THERMAL_THROTTLING_GET_STATUS_CMDID	= 0x855,
130 	WMI_OTP_READ_CMDID			= 0x856,
131 	WMI_OTP_WRITE_CMDID			= 0x857,
132 	WMI_LED_CFG_CMDID			= 0x858,
133 	/* Performance monitoring commands */
134 	WMI_BF_CTRL_CMDID			= 0x862,
135 	WMI_NOTIFY_REQ_CMDID			= 0x863,
136 	WMI_GET_STATUS_CMDID			= 0x864,
137 	WMI_UNIT_TEST_CMDID			= 0x900,
138 	WMI_HICCUP_CMDID			= 0x901,
139 	WMI_FLASH_READ_CMDID			= 0x902,
140 	WMI_FLASH_WRITE_CMDID			= 0x903,
141 	/* P2P */
142 	WMI_P2P_CFG_CMDID			= 0x910,
143 	WMI_PORT_ALLOCATE_CMDID			= 0x911,
144 	WMI_PORT_DELETE_CMDID			= 0x912,
145 	WMI_POWER_MGMT_CFG_CMDID		= 0x913,
146 	WMI_START_LISTEN_CMDID			= 0x914,
147 	WMI_START_SEARCH_CMDID			= 0x915,
148 	WMI_DISCOVERY_START_CMDID		= 0x916,
149 	WMI_DISCOVERY_STOP_CMDID		= 0x917,
150 	WMI_PCP_START_CMDID			= 0x918,
151 	WMI_PCP_STOP_CMDID			= 0x919,
152 	WMI_GET_PCP_FACTOR_CMDID		= 0x91B,
153 	WMI_SET_MAC_ADDRESS_CMDID		= 0xF003,
154 	WMI_ABORT_SCAN_CMDID			= 0xF007,
155 	WMI_SET_PROMISCUOUS_MODE_CMDID		= 0xF041,
156 	WMI_GET_PMK_CMDID			= 0xF048,
157 	WMI_SET_PASSPHRASE_CMDID		= 0xF049,
158 	WMI_SEND_ASSOC_RES_CMDID		= 0xF04A,
159 	WMI_SET_ASSOC_REQ_RELAY_CMDID		= 0xF04B,
160 	WMI_MAC_ADDR_REQ_CMDID			= 0xF04D,
161 	WMI_FW_VER_CMDID			= 0xF04E,
162 	WMI_PMC_CMDID				= 0xF04F,
163 };
164 
165 /* WMI_CONNECT_CMDID */
166 enum wmi_network_type {
167 	WMI_NETTYPE_INFRA		= 0x01,
168 	WMI_NETTYPE_ADHOC		= 0x02,
169 	WMI_NETTYPE_ADHOC_CREATOR	= 0x04,
170 	WMI_NETTYPE_AP			= 0x10,
171 	WMI_NETTYPE_P2P			= 0x20,
172 	/* PCIE over 60g */
173 	WMI_NETTYPE_WBE			= 0x40,
174 };
175 
176 enum wmi_dot11_auth_mode {
177 	WMI_AUTH11_OPEN		= 0x01,
178 	WMI_AUTH11_SHARED	= 0x02,
179 	WMI_AUTH11_LEAP		= 0x04,
180 	WMI_AUTH11_WSC		= 0x08,
181 };
182 
183 enum wmi_auth_mode {
184 	WMI_AUTH_NONE		= 0x01,
185 	WMI_AUTH_WPA		= 0x02,
186 	WMI_AUTH_WPA2		= 0x04,
187 	WMI_AUTH_WPA_PSK	= 0x08,
188 	WMI_AUTH_WPA2_PSK	= 0x10,
189 	WMI_AUTH_WPA_CCKM	= 0x20,
190 	WMI_AUTH_WPA2_CCKM	= 0x40,
191 };
192 
193 enum wmi_crypto_type {
194 	WMI_CRYPT_NONE		= 0x01,
195 	WMI_CRYPT_AES_GCMP	= 0x20,
196 };
197 
198 enum wmi_connect_ctrl_flag_bits {
199 	WMI_CONNECT_ASSOC_POLICY_USER		= 0x01,
200 	WMI_CONNECT_SEND_REASSOC		= 0x02,
201 	WMI_CONNECT_IGNORE_WPA_GROUP_CIPHER	= 0x04,
202 	WMI_CONNECT_PROFILE_MATCH_DONE		= 0x08,
203 	WMI_CONNECT_IGNORE_AAC_BEACON		= 0x10,
204 	WMI_CONNECT_CSA_FOLLOW_BSS		= 0x20,
205 	WMI_CONNECT_DO_WPA_OFFLOAD		= 0x40,
206 	WMI_CONNECT_DO_NOT_DEAUTH		= 0x80,
207 };
208 
209 #define WMI_MAX_SSID_LEN	(32)
210 
211 /* WMI_CONNECT_CMDID */
212 struct wmi_connect_cmd {
213 	u8 network_type;
214 	u8 dot11_auth_mode;
215 	u8 auth_mode;
216 	u8 pairwise_crypto_type;
217 	u8 pairwise_crypto_len;
218 	u8 group_crypto_type;
219 	u8 group_crypto_len;
220 	u8 ssid_len;
221 	u8 ssid[WMI_MAX_SSID_LEN];
222 	u8 channel;
223 	u8 reserved0;
224 	u8 bssid[WMI_MAC_LEN];
225 	__le32 ctrl_flags;
226 	u8 dst_mac[WMI_MAC_LEN];
227 	u8 reserved1[2];
228 } __packed;
229 
230 /* WMI_DISCONNECT_STA_CMDID */
231 struct wmi_disconnect_sta_cmd {
232 	u8 dst_mac[WMI_MAC_LEN];
233 	__le16 disconnect_reason;
234 } __packed;
235 
236 #define WMI_MAX_KEY_INDEX	(3)
237 #define WMI_MAX_KEY_LEN		(32)
238 #define WMI_PASSPHRASE_LEN	(64)
239 
240 /* WMI_SET_PASSPHRASE_CMDID */
241 struct wmi_set_passphrase_cmd {
242 	u8 ssid[WMI_MAX_SSID_LEN];
243 	u8 passphrase[WMI_PASSPHRASE_LEN];
244 	u8 ssid_len;
245 	u8 passphrase_len;
246 } __packed;
247 
248 /* WMI_ADD_CIPHER_KEY_CMDID */
249 enum wmi_key_usage {
250 	WMI_KEY_USE_PAIRWISE	= 0x00,
251 	WMI_KEY_USE_RX_GROUP	= 0x01,
252 	WMI_KEY_USE_TX_GROUP	= 0x02,
253 };
254 
255 struct wmi_add_cipher_key_cmd {
256 	u8 key_index;
257 	u8 key_type;
258 	/* enum wmi_key_usage */
259 	u8 key_usage;
260 	u8 key_len;
261 	/* key replay sequence counter */
262 	u8 key_rsc[8];
263 	u8 key[WMI_MAX_KEY_LEN];
264 	/* Additional Key Control information */
265 	u8 key_op_ctrl;
266 	u8 mac[WMI_MAC_LEN];
267 } __packed;
268 
269 /* WMI_DELETE_CIPHER_KEY_CMDID */
270 struct wmi_delete_cipher_key_cmd {
271 	u8 key_index;
272 	u8 mac[WMI_MAC_LEN];
273 } __packed;
274 
275 /* WMI_START_SCAN_CMDID
276  *
277  * Start L1 scan operation
278  *
279  * Returned events:
280  * - WMI_RX_MGMT_PACKET_EVENTID - for every probe resp.
281  * - WMI_SCAN_COMPLETE_EVENTID
282  */
283 enum wmi_scan_type {
284 	WMI_ACTIVE_SCAN		= 0x00,
285 	WMI_SHORT_SCAN		= 0x01,
286 	WMI_PASSIVE_SCAN	= 0x02,
287 	WMI_DIRECT_SCAN		= 0x03,
288 	WMI_LONG_SCAN		= 0x04,
289 };
290 
291 /* WMI_START_SCAN_CMDID */
292 struct wmi_start_scan_cmd {
293 	u8 direct_scan_mac_addr[WMI_MAC_LEN];
294 	/* DMG Beacon frame is transmitted during active scanning */
295 	u8 discovery_mode;
296 	/* reserved */
297 	u8 reserved;
298 	/* Max duration in the home channel(ms) */
299 	__le32 dwell_time;
300 	/* Time interval between scans (ms) */
301 	__le32 force_scan_interval;
302 	/* enum wmi_scan_type */
303 	u8 scan_type;
304 	/* how many channels follow */
305 	u8 num_channels;
306 	/* channels ID's:
307 	 * 0 - 58320 MHz
308 	 * 1 - 60480 MHz
309 	 * 2 - 62640 MHz
310 	 */
311 	struct {
312 		u8 channel;
313 		u8 reserved;
314 	} channel_list[0];
315 } __packed;
316 
317 /* WMI_SET_PROBED_SSID_CMDID */
318 #define MAX_PROBED_SSID_INDEX	(3)
319 
320 enum wmi_ssid_flag {
321 	/* disables entry */
322 	WMI_SSID_FLAG_DISABLE	= 0x00,
323 	/* probes specified ssid */
324 	WMI_SSID_FLAG_SPECIFIC	= 0x01,
325 	/* probes for any ssid */
326 	WMI_SSID_FLAG_ANY	= 0x02,
327 };
328 
329 struct wmi_probed_ssid_cmd {
330 	/* 0 to MAX_PROBED_SSID_INDEX */
331 	u8 entry_index;
332 	/* enum wmi_ssid_flag */
333 	u8 flag;
334 	u8 ssid_len;
335 	u8 ssid[WMI_MAX_SSID_LEN];
336 } __packed;
337 
338 /* WMI_SET_APPIE_CMDID
339  * Add Application specified IE to a management frame
340  */
341 #define WMI_MAX_IE_LEN	(1024)
342 
343 /* Frame Types */
344 enum wmi_mgmt_frame_type {
345 	WMI_FRAME_BEACON	= 0x00,
346 	WMI_FRAME_PROBE_REQ	= 0x01,
347 	WMI_FRAME_PROBE_RESP	= 0x02,
348 	WMI_FRAME_ASSOC_REQ	= 0x03,
349 	WMI_FRAME_ASSOC_RESP	= 0x04,
350 	WMI_NUM_MGMT_FRAME	= 0x05,
351 };
352 
353 struct wmi_set_appie_cmd {
354 	/* enum wmi_mgmt_frame_type */
355 	u8 mgmt_frm_type;
356 	u8 reserved;
357 	/* Length of the IE to be added to MGMT frame */
358 	__le16 ie_len;
359 	u8 ie_info[0];
360 } __packed;
361 
362 /* WMI_PXMT_RANGE_CFG_CMDID */
363 struct wmi_pxmt_range_cfg_cmd {
364 	u8 dst_mac[WMI_MAC_LEN];
365 	__le16 range;
366 } __packed;
367 
368 /* WMI_PXMT_SNR2_RANGE_CFG_CMDID */
369 struct wmi_pxmt_snr2_range_cfg_cmd {
370 	s8 snr2range_arr[2];
371 } __packed;
372 
373 /* WMI_RF_MGMT_CMDID */
374 enum wmi_rf_mgmt_type {
375 	WMI_RF_MGMT_W_DISABLE	= 0x00,
376 	WMI_RF_MGMT_W_ENABLE	= 0x01,
377 	WMI_RF_MGMT_GET_STATUS	= 0x02,
378 };
379 
380 /* WMI_RF_MGMT_CMDID */
381 struct wmi_rf_mgmt_cmd {
382 	__le32 rf_mgmt_type;
383 } __packed;
384 
385 /* WMI_THERMAL_THROTTLING_CTRL_CMDID */
386 #define THERMAL_THROTTLING_USE_DEFAULT_MAX_TXOP_LENGTH	(0xFFFFFFFF)
387 
388 /* WMI_THERMAL_THROTTLING_CTRL_CMDID */
389 struct wmi_thermal_throttling_ctrl_cmd {
390 	__le32 time_on_usec;
391 	__le32 time_off_usec;
392 	__le32 max_txop_length_usec;
393 } __packed;
394 
395 /* WMI_RF_RX_TEST_CMDID */
396 struct wmi_rf_rx_test_cmd {
397 	__le32 sector;
398 } __packed;
399 
400 /* WMI_CORR_MEASURE_CMDID */
401 struct wmi_corr_measure_cmd {
402 	__le32 freq_mhz;
403 	__le32 length_samples;
404 	__le32 iterations;
405 } __packed;
406 
407 /* WMI_SET_SSID_CMDID */
408 struct wmi_set_ssid_cmd {
409 	__le32 ssid_len;
410 	u8 ssid[WMI_MAX_SSID_LEN];
411 } __packed;
412 
413 /* WMI_SET_PCP_CHANNEL_CMDID */
414 struct wmi_set_pcp_channel_cmd {
415 	u8 channel;
416 	u8 reserved[3];
417 } __packed;
418 
419 /* WMI_BCON_CTRL_CMDID */
420 struct wmi_bcon_ctrl_cmd {
421 	__le16 bcon_interval;
422 	__le16 frag_num;
423 	__le64 ss_mask;
424 	u8 network_type;
425 	u8 pcp_max_assoc_sta;
426 	u8 disable_sec_offload;
427 	u8 disable_sec;
428 	u8 hidden_ssid;
429 	u8 is_go;
430 	u8 reserved[2];
431 } __packed;
432 
433 /* WMI_PORT_ALLOCATE_CMDID */
434 enum wmi_port_role {
435 	WMI_PORT_STA		= 0x00,
436 	WMI_PORT_PCP		= 0x01,
437 	WMI_PORT_AP		= 0x02,
438 	WMI_PORT_P2P_DEV	= 0x03,
439 	WMI_PORT_P2P_CLIENT	= 0x04,
440 	WMI_PORT_P2P_GO		= 0x05,
441 };
442 
443 /* WMI_PORT_ALLOCATE_CMDID */
444 struct wmi_port_allocate_cmd {
445 	u8 mac[WMI_MAC_LEN];
446 	u8 port_role;
447 	u8 mid;
448 } __packed;
449 
450 /* WMI_PORT_DELETE_CMDID */
451 struct wmi_port_delete_cmd {
452 	u8 mid;
453 	u8 reserved[3];
454 } __packed;
455 
456 /* WMI_P2P_CFG_CMDID */
457 enum wmi_discovery_mode {
458 	WMI_DISCOVERY_MODE_NON_OFFLOAD	= 0x00,
459 	WMI_DISCOVERY_MODE_OFFLOAD	= 0x01,
460 	WMI_DISCOVERY_MODE_PEER2PEER	= 0x02,
461 };
462 
463 struct wmi_p2p_cfg_cmd {
464 	/* enum wmi_discovery_mode */
465 	u8 discovery_mode;
466 	u8 channel;
467 	/* base to listen/search duration calculation */
468 	__le16 bcon_interval;
469 } __packed;
470 
471 /* WMI_POWER_MGMT_CFG_CMDID */
472 enum wmi_power_source_type {
473 	WMI_POWER_SOURCE_BATTERY	= 0x00,
474 	WMI_POWER_SOURCE_OTHER		= 0x01,
475 };
476 
477 struct wmi_power_mgmt_cfg_cmd {
478 	/* enum wmi_power_source_type */
479 	u8 power_source;
480 	u8 reserved[3];
481 } __packed;
482 
483 /* WMI_PCP_START_CMDID */
484 struct wmi_pcp_start_cmd {
485 	__le16 bcon_interval;
486 	u8 pcp_max_assoc_sta;
487 	u8 hidden_ssid;
488 	u8 is_go;
489 	u8 reserved0[7];
490 	u8 network_type;
491 	u8 channel;
492 	u8 disable_sec_offload;
493 	u8 disable_sec;
494 } __packed;
495 
496 /* WMI_SW_TX_REQ_CMDID */
497 struct wmi_sw_tx_req_cmd {
498 	u8 dst_mac[WMI_MAC_LEN];
499 	__le16 len;
500 	u8 payload[0];
501 } __packed;
502 
503 struct wmi_sw_ring_cfg {
504 	__le64 ring_mem_base;
505 	__le16 ring_size;
506 	__le16 max_mpdu_size;
507 } __packed;
508 
509 /* wmi_vring_cfg_schd */
510 struct wmi_vring_cfg_schd {
511 	__le16 priority;
512 	__le16 timeslot_us;
513 } __packed;
514 
515 enum wmi_vring_cfg_encap_trans_type {
516 	WMI_VRING_ENC_TYPE_802_3	= 0x00,
517 	WMI_VRING_ENC_TYPE_NATIVE_WIFI	= 0x01,
518 };
519 
520 enum wmi_vring_cfg_ds_cfg {
521 	WMI_VRING_DS_PBSS	= 0x00,
522 	WMI_VRING_DS_STATION	= 0x01,
523 	WMI_VRING_DS_AP		= 0x02,
524 	WMI_VRING_DS_ADDR4	= 0x03,
525 };
526 
527 enum wmi_vring_cfg_nwifi_ds_trans_type {
528 	WMI_NWIFI_TX_TRANS_MODE_NO		= 0x00,
529 	WMI_NWIFI_TX_TRANS_MODE_AP2PBSS		= 0x01,
530 	WMI_NWIFI_TX_TRANS_MODE_STA2PBSS	= 0x02,
531 };
532 
533 enum wmi_vring_cfg_schd_params_priority {
534 	WMI_SCH_PRIO_REGULAR	= 0x00,
535 	WMI_SCH_PRIO_HIGH	= 0x01,
536 };
537 
538 #define CIDXTID_CID_POS				(0)
539 #define CIDXTID_CID_LEN				(4)
540 #define CIDXTID_CID_MSK				(0xF)
541 #define CIDXTID_TID_POS				(4)
542 #define CIDXTID_TID_LEN				(4)
543 #define CIDXTID_TID_MSK				(0xF0)
544 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_POS	(0)
545 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_LEN	(1)
546 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_MSK	(0x1)
547 #define VRING_CFG_MAC_CTRL_AGGR_EN_POS		(1)
548 #define VRING_CFG_MAC_CTRL_AGGR_EN_LEN		(1)
549 #define VRING_CFG_MAC_CTRL_AGGR_EN_MSK		(0x2)
550 #define VRING_CFG_TO_RESOLUTION_VALUE_POS	(0)
551 #define VRING_CFG_TO_RESOLUTION_VALUE_LEN	(6)
552 #define VRING_CFG_TO_RESOLUTION_VALUE_MSK	(0x3F)
553 
554 struct wmi_vring_cfg {
555 	struct wmi_sw_ring_cfg tx_sw_ring;
556 	/* 0-23 vrings */
557 	u8 ringid;
558 	u8 cidxtid;
559 	u8 encap_trans_type;
560 	/* 802.3 DS cfg */
561 	u8 ds_cfg;
562 	u8 nwifi_ds_trans_type;
563 	u8 mac_ctrl;
564 	u8 to_resolution;
565 	u8 agg_max_wsize;
566 	struct wmi_vring_cfg_schd schd_params;
567 } __packed;
568 
569 enum wmi_vring_cfg_cmd_action {
570 	WMI_VRING_CMD_ADD	= 0x00,
571 	WMI_VRING_CMD_MODIFY	= 0x01,
572 	WMI_VRING_CMD_DELETE	= 0x02,
573 };
574 
575 /* WMI_VRING_CFG_CMDID */
576 struct wmi_vring_cfg_cmd {
577 	__le32 action;
578 	struct wmi_vring_cfg vring_cfg;
579 } __packed;
580 
581 struct wmi_bcast_vring_cfg {
582 	struct wmi_sw_ring_cfg tx_sw_ring;
583 	/* 0-23 vrings */
584 	u8 ringid;
585 	u8 encap_trans_type;
586 	/* 802.3 DS cfg */
587 	u8 ds_cfg;
588 	u8 nwifi_ds_trans_type;
589 } __packed;
590 
591 /* WMI_BCAST_VRING_CFG_CMDID */
592 struct wmi_bcast_vring_cfg_cmd {
593 	__le32 action;
594 	struct wmi_bcast_vring_cfg vring_cfg;
595 } __packed;
596 
597 /* WMI_VRING_BA_EN_CMDID */
598 struct wmi_vring_ba_en_cmd {
599 	u8 ringid;
600 	u8 agg_max_wsize;
601 	__le16 ba_timeout;
602 	u8 amsdu;
603 	u8 reserved[3];
604 } __packed;
605 
606 /* WMI_VRING_BA_DIS_CMDID */
607 struct wmi_vring_ba_dis_cmd {
608 	u8 ringid;
609 	u8 reserved;
610 	__le16 reason;
611 } __packed;
612 
613 /* WMI_NOTIFY_REQ_CMDID */
614 struct wmi_notify_req_cmd {
615 	u8 cid;
616 	u8 year;
617 	u8 month;
618 	u8 day;
619 	__le32 interval_usec;
620 	u8 hour;
621 	u8 minute;
622 	u8 second;
623 	u8 miliseconds;
624 } __packed;
625 
626 /* WMI_CFG_RX_CHAIN_CMDID */
627 enum wmi_sniffer_cfg_mode {
628 	WMI_SNIFFER_OFF	= 0x00,
629 	WMI_SNIFFER_ON	= 0x01,
630 };
631 
632 enum wmi_sniffer_cfg_phy_info_mode {
633 	WMI_SNIFFER_PHY_INFO_DISABLED	= 0x00,
634 	WMI_SNIFFER_PHY_INFO_ENABLED	= 0x01,
635 };
636 
637 enum wmi_sniffer_cfg_phy_support {
638 	WMI_SNIFFER_CP		= 0x00,
639 	WMI_SNIFFER_DP		= 0x01,
640 	WMI_SNIFFER_BOTH_PHYS	= 0x02,
641 };
642 
643 /* wmi_sniffer_cfg */
644 struct wmi_sniffer_cfg {
645 	/* enum wmi_sniffer_cfg_mode */
646 	__le32 mode;
647 	/* enum wmi_sniffer_cfg_phy_info_mode */
648 	__le32 phy_info_mode;
649 	/* enum wmi_sniffer_cfg_phy_support */
650 	__le32 phy_support;
651 	u8 channel;
652 	u8 reserved[3];
653 } __packed;
654 
655 enum wmi_cfg_rx_chain_cmd_action {
656 	WMI_RX_CHAIN_ADD	= 0x00,
657 	WMI_RX_CHAIN_DEL	= 0x01,
658 };
659 
660 enum wmi_cfg_rx_chain_cmd_decap_trans_type {
661 	WMI_DECAP_TYPE_802_3		= 0x00,
662 	WMI_DECAP_TYPE_NATIVE_WIFI	= 0x01,
663 	WMI_DECAP_TYPE_NONE		= 0x02,
664 };
665 
666 enum wmi_cfg_rx_chain_cmd_nwifi_ds_trans_type {
667 	WMI_NWIFI_RX_TRANS_MODE_NO		= 0x00,
668 	WMI_NWIFI_RX_TRANS_MODE_PBSS2AP		= 0x01,
669 	WMI_NWIFI_RX_TRANS_MODE_PBSS2STA	= 0x02,
670 };
671 
672 enum wmi_cfg_rx_chain_cmd_reorder_type {
673 	WMI_RX_HW_REORDER	= 0x00,
674 	WMI_RX_SW_REORDER	= 0x01,
675 };
676 
677 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_POS	(0)
678 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_LEN	(1)
679 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_MSK	(0x1)
680 #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_POS		(1)
681 #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_LEN		(1)
682 #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_MSK		(0x2)
683 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_POS		(0)
684 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_LEN		(1)
685 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_MSK		(0x1)
686 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_POS		(1)
687 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_LEN		(1)
688 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_MSK		(0x2)
689 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_POS			(0)
690 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_LEN			(1)
691 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_MSK			(0x1)
692 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_POS		(1)
693 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_LEN		(1)
694 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_MSK		(0x2)
695 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_POS		(0)
696 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_LEN		(1)
697 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_MSK		(0x1)
698 #define RING_CTRL_OVERRIDE_WB_THRSH_POS			(1)
699 #define RING_CTRL_OVERRIDE_WB_THRSH_LEN			(1)
700 #define RING_CTRL_OVERRIDE_WB_THRSH_MSK			(0x2)
701 #define RING_CTRL_OVERRIDE_ITR_THRSH_POS		(2)
702 #define RING_CTRL_OVERRIDE_ITR_THRSH_LEN		(1)
703 #define RING_CTRL_OVERRIDE_ITR_THRSH_MSK		(0x4)
704 #define RING_CTRL_OVERRIDE_HOST_THRSH_POS		(3)
705 #define RING_CTRL_OVERRIDE_HOST_THRSH_LEN		(1)
706 #define RING_CTRL_OVERRIDE_HOST_THRSH_MSK		(0x8)
707 
708 /* WMI_CFG_RX_CHAIN_CMDID */
709 struct wmi_cfg_rx_chain_cmd {
710 	__le32 action;
711 	struct wmi_sw_ring_cfg rx_sw_ring;
712 	u8 mid;
713 	u8 decap_trans_type;
714 	u8 l2_802_3_offload_ctrl;
715 	u8 l2_nwifi_offload_ctrl;
716 	u8 vlan_id;
717 	u8 nwifi_ds_trans_type;
718 	u8 l3_l4_ctrl;
719 	u8 ring_ctrl;
720 	__le16 prefetch_thrsh;
721 	__le16 wb_thrsh;
722 	__le32 itr_value;
723 	__le16 host_thrsh;
724 	u8 reorder_type;
725 	u8 reserved;
726 	struct wmi_sniffer_cfg sniffer_cfg;
727 	__le16 max_rx_pl_per_desc;
728 } __packed;
729 
730 /* WMI_RCP_ADDBA_RESP_CMDID */
731 struct wmi_rcp_addba_resp_cmd {
732 	u8 cidxtid;
733 	u8 dialog_token;
734 	__le16 status_code;
735 	/* ieee80211_ba_parameterset field to send */
736 	__le16 ba_param_set;
737 	__le16 ba_timeout;
738 } __packed;
739 
740 /* WMI_RCP_DELBA_CMDID */
741 struct wmi_rcp_delba_cmd {
742 	u8 cidxtid;
743 	u8 reserved;
744 	__le16 reason;
745 } __packed;
746 
747 /* WMI_RCP_ADDBA_REQ_CMDID */
748 struct wmi_rcp_addba_req_cmd {
749 	u8 cidxtid;
750 	u8 dialog_token;
751 	/* ieee80211_ba_parameterset field as it received */
752 	__le16 ba_param_set;
753 	__le16 ba_timeout;
754 	/* ieee80211_ba_seqstrl field as it received */
755 	__le16 ba_seq_ctrl;
756 } __packed;
757 
758 /* WMI_SET_MAC_ADDRESS_CMDID */
759 struct wmi_set_mac_address_cmd {
760 	u8 mac[WMI_MAC_LEN];
761 	u8 reserved[2];
762 } __packed;
763 
764 /* WMI_ECHO_CMDID
765  * Check FW is alive
766  * WMI_DEEP_ECHO_CMDID
767  * Check FW and ucode are alive
768  * Returned event: WMI_ECHO_RSP_EVENTID
769  * same event for both commands
770  */
771 struct wmi_echo_cmd {
772 	__le32 value;
773 } __packed;
774 
775 /* WMI_OTP_READ_CMDID */
776 struct wmi_otp_read_cmd {
777 	__le32 addr;
778 	__le32 size;
779 	__le32 values;
780 } __packed;
781 
782 /* WMI_OTP_WRITE_CMDID */
783 struct wmi_otp_write_cmd {
784 	__le32 addr;
785 	__le32 size;
786 	__le32 values;
787 } __packed;
788 
789 /* WMI_TEMP_SENSE_CMDID
790  *
791  * Measure MAC and radio temperatures
792  *
793  * Possible modes for temperature measurement
794  */
795 enum wmi_temperature_measure_mode {
796 	TEMPERATURE_USE_OLD_VALUE	= 0x01,
797 	TEMPERATURE_MEASURE_NOW		= 0x02,
798 };
799 
800 /* WMI_TEMP_SENSE_CMDID */
801 struct wmi_temp_sense_cmd {
802 	__le32 measure_baseband_en;
803 	__le32 measure_rf_en;
804 	__le32 measure_mode;
805 } __packed;
806 
807 enum wmi_pmc_op {
808 	WMI_PMC_ALLOCATE	= 0x00,
809 	WMI_PMC_RELEASE		= 0x01,
810 };
811 
812 /* WMI_PMC_CMDID */
813 struct wmi_pmc_cmd {
814 	/* enum wmi_pmc_cmd_op_type */
815 	u8 op;
816 	u8 reserved;
817 	__le16 ring_size;
818 	__le64 mem_base;
819 } __packed;
820 
821 /* WMI Events
822  * List of Events (target to host)
823  */
824 enum wmi_event_id {
825 	WMI_READY_EVENTID			= 0x1001,
826 	WMI_CONNECT_EVENTID			= 0x1002,
827 	WMI_DISCONNECT_EVENTID			= 0x1003,
828 	WMI_SCAN_COMPLETE_EVENTID		= 0x100A,
829 	WMI_REPORT_STATISTICS_EVENTID		= 0x100B,
830 	WMI_RD_MEM_RSP_EVENTID			= 0x1800,
831 	WMI_FW_READY_EVENTID			= 0x1801,
832 	WMI_EXIT_FAST_MEM_ACC_MODE_EVENTID	= 0x200,
833 	WMI_ECHO_RSP_EVENTID			= 0x1803,
834 	WMI_FS_TUNE_DONE_EVENTID		= 0x180A,
835 	WMI_CORR_MEASURE_EVENTID		= 0x180B,
836 	WMI_READ_RSSI_EVENTID			= 0x180C,
837 	WMI_TEMP_SENSE_DONE_EVENTID		= 0x180E,
838 	WMI_DC_CALIB_DONE_EVENTID		= 0x180F,
839 	WMI_IQ_TX_CALIB_DONE_EVENTID		= 0x1811,
840 	WMI_IQ_RX_CALIB_DONE_EVENTID		= 0x1812,
841 	WMI_SET_WORK_MODE_DONE_EVENTID		= 0x1815,
842 	WMI_LO_LEAKAGE_CALIB_DONE_EVENTID	= 0x1816,
843 	WMI_MARLON_R_READ_DONE_EVENTID		= 0x1818,
844 	WMI_MARLON_R_WRITE_DONE_EVENTID		= 0x1819,
845 	WMI_MARLON_R_TXRX_SEL_DONE_EVENTID	= 0x181A,
846 	WMI_SILENT_RSSI_CALIB_DONE_EVENTID	= 0x181D,
847 	WMI_RF_RX_TEST_DONE_EVENTID		= 0x181E,
848 	WMI_CFG_RX_CHAIN_DONE_EVENTID		= 0x1820,
849 	WMI_VRING_CFG_DONE_EVENTID		= 0x1821,
850 	WMI_BA_STATUS_EVENTID			= 0x1823,
851 	WMI_RCP_ADDBA_REQ_EVENTID		= 0x1824,
852 	WMI_RCP_ADDBA_RESP_SENT_EVENTID		= 0x1825,
853 	WMI_DELBA_EVENTID			= 0x1826,
854 	WMI_GET_SSID_EVENTID			= 0x1828,
855 	WMI_GET_PCP_CHANNEL_EVENTID		= 0x182A,
856 	WMI_SW_TX_COMPLETE_EVENTID		= 0x182B,
857 	WMI_READ_MAC_RXQ_EVENTID		= 0x1830,
858 	WMI_READ_MAC_TXQ_EVENTID		= 0x1831,
859 	WMI_WRITE_MAC_RXQ_EVENTID		= 0x1832,
860 	WMI_WRITE_MAC_TXQ_EVENTID		= 0x1833,
861 	WMI_WRITE_MAC_XQ_FIELD_EVENTID		= 0x1834,
862 	WMI_BEAMFORMING_MGMT_DONE_EVENTID	= 0x1836,
863 	WMI_BF_TXSS_MGMT_DONE_EVENTID		= 0x1837,
864 	WMI_BF_RXSS_MGMT_DONE_EVENTID		= 0x1839,
865 	WMI_RS_MGMT_DONE_EVENTID		= 0x1852,
866 	WMI_RF_MGMT_STATUS_EVENTID		= 0x1853,
867 	WMI_THERMAL_THROTTLING_STATUS_EVENTID	= 0x1855,
868 	WMI_BF_SM_MGMT_DONE_EVENTID		= 0x1838,
869 	WMI_RX_MGMT_PACKET_EVENTID		= 0x1840,
870 	WMI_TX_MGMT_PACKET_EVENTID		= 0x1841,
871 	WMI_OTP_READ_RESULT_EVENTID		= 0x1856,
872 	WMI_LED_CFG_DONE_EVENTID		= 0x1858,
873 	/* Performance monitoring events */
874 	WMI_DATA_PORT_OPEN_EVENTID		= 0x1860,
875 	WMI_WBE_LINK_DOWN_EVENTID		= 0x1861,
876 	WMI_BF_CTRL_DONE_EVENTID		= 0x1862,
877 	WMI_NOTIFY_REQ_DONE_EVENTID		= 0x1863,
878 	WMI_GET_STATUS_DONE_EVENTID		= 0x1864,
879 	WMI_VRING_EN_EVENTID			= 0x1865,
880 	WMI_UNIT_TEST_EVENTID			= 0x1900,
881 	WMI_FLASH_READ_DONE_EVENTID		= 0x1902,
882 	WMI_FLASH_WRITE_DONE_EVENTID		= 0x1903,
883 	/* P2P */
884 	WMI_P2P_CFG_DONE_EVENTID		= 0x1910,
885 	WMI_PORT_ALLOCATED_EVENTID		= 0x1911,
886 	WMI_PORT_DELETED_EVENTID		= 0x1912,
887 	WMI_LISTEN_STARTED_EVENTID		= 0x1914,
888 	WMI_SEARCH_STARTED_EVENTID		= 0x1915,
889 	WMI_DISCOVERY_STARTED_EVENTID		= 0x1916,
890 	WMI_DISCOVERY_STOPPED_EVENTID		= 0x1917,
891 	WMI_PCP_STARTED_EVENTID			= 0x1918,
892 	WMI_PCP_STOPPED_EVENTID			= 0x1919,
893 	WMI_PCP_FACTOR_EVENTID			= 0x191A,
894 	WMI_SET_CHANNEL_EVENTID			= 0x9000,
895 	WMI_ASSOC_REQ_EVENTID			= 0x9001,
896 	WMI_EAPOL_RX_EVENTID			= 0x9002,
897 	WMI_MAC_ADDR_RESP_EVENTID		= 0x9003,
898 	WMI_FW_VER_EVENTID			= 0x9004,
899 	WMI_ACS_PASSIVE_SCAN_COMPLETE_EVENTID	= 0x9005,
900 };
901 
902 /* Events data structures */
903 enum wmi_fw_status {
904 	WMI_FW_STATUS_SUCCESS	= 0x00,
905 	WMI_FW_STATUS_FAILURE	= 0x01,
906 };
907 
908 /* WMI_RF_MGMT_STATUS_EVENTID */
909 enum wmi_rf_status {
910 	WMI_RF_ENABLED		= 0x00,
911 	WMI_RF_DISABLED_HW	= 0x01,
912 	WMI_RF_DISABLED_SW	= 0x02,
913 	WMI_RF_DISABLED_HW_SW	= 0x03,
914 };
915 
916 /* WMI_RF_MGMT_STATUS_EVENTID */
917 struct wmi_rf_mgmt_status_event {
918 	__le32 rf_status;
919 } __packed;
920 
921 /* WMI_THERMAL_THROTTLING_STATUS_EVENTID */
922 struct wmi_thermal_throttling_status_event {
923 	__le32 time_on_usec;
924 	__le32 time_off_usec;
925 	__le32 max_txop_length_usec;
926 } __packed;
927 
928 /* WMI_GET_STATUS_DONE_EVENTID */
929 struct wmi_get_status_done_event {
930 	__le32 is_associated;
931 	u8 cid;
932 	u8 reserved0[3];
933 	u8 bssid[WMI_MAC_LEN];
934 	u8 channel;
935 	u8 reserved1;
936 	u8 network_type;
937 	u8 reserved2[3];
938 	__le32 ssid_len;
939 	u8 ssid[WMI_MAX_SSID_LEN];
940 	__le32 rf_status;
941 	__le32 is_secured;
942 } __packed;
943 
944 /* WMI_FW_VER_EVENTID */
945 struct wmi_fw_ver_event {
946 	u8 major;
947 	u8 minor;
948 	__le16 subminor;
949 	__le16 build;
950 } __packed;
951 
952 /* WMI_MAC_ADDR_RESP_EVENTID */
953 struct wmi_mac_addr_resp_event {
954 	u8 mac[WMI_MAC_LEN];
955 	u8 auth_mode;
956 	u8 crypt_mode;
957 	__le32 offload_mode;
958 } __packed;
959 
960 /* WMI_EAPOL_RX_EVENTID */
961 struct wmi_eapol_rx_event {
962 	u8 src_mac[WMI_MAC_LEN];
963 	__le16 eapol_len;
964 	u8 eapol[0];
965 } __packed;
966 
967 /* WMI_READY_EVENTID */
968 enum wmi_phy_capability {
969 	WMI_11A_CAPABILITY		= 0x01,
970 	WMI_11G_CAPABILITY		= 0x02,
971 	WMI_11AG_CAPABILITY		= 0x03,
972 	WMI_11NA_CAPABILITY		= 0x04,
973 	WMI_11NG_CAPABILITY		= 0x05,
974 	WMI_11NAG_CAPABILITY		= 0x06,
975 	WMI_11AD_CAPABILITY		= 0x07,
976 	WMI_11N_CAPABILITY_OFFSET	= 0x03,
977 };
978 
979 struct wmi_ready_event {
980 	__le32 sw_version;
981 	__le32 abi_version;
982 	u8 mac[WMI_MAC_LEN];
983 	/* enum wmi_phy_capability */
984 	u8 phy_capability;
985 	u8 numof_additional_mids;
986 } __packed;
987 
988 /* WMI_NOTIFY_REQ_DONE_EVENTID */
989 struct wmi_notify_req_done_event {
990 	/* beamforming status, 0: fail; 1: OK; 2: retrying */
991 	__le32 status;
992 	__le64 tsf;
993 	__le32 snr_val;
994 	__le32 tx_tpt;
995 	__le32 tx_goodput;
996 	__le32 rx_goodput;
997 	__le16 bf_mcs;
998 	__le16 my_rx_sector;
999 	__le16 my_tx_sector;
1000 	__le16 other_rx_sector;
1001 	__le16 other_tx_sector;
1002 	__le16 range;
1003 	u8 sqi;
1004 	u8 reserved[3];
1005 } __packed;
1006 
1007 /* WMI_CONNECT_EVENTID */
1008 struct wmi_connect_event {
1009 	u8 channel;
1010 	u8 reserved0;
1011 	u8 bssid[WMI_MAC_LEN];
1012 	__le16 listen_interval;
1013 	__le16 beacon_interval;
1014 	u8 network_type;
1015 	u8 reserved1[3];
1016 	u8 beacon_ie_len;
1017 	u8 assoc_req_len;
1018 	u8 assoc_resp_len;
1019 	u8 cid;
1020 	u8 reserved2[3];
1021 	/* not in use */
1022 	u8 assoc_info[0];
1023 } __packed;
1024 
1025 /* WMI_DISCONNECT_EVENTID */
1026 enum wmi_disconnect_reason {
1027 	WMI_DIS_REASON_NO_NETWORK_AVAIL		= 0x01,
1028 	/* bmiss */
1029 	WMI_DIS_REASON_LOST_LINK		= 0x02,
1030 	WMI_DIS_REASON_DISCONNECT_CMD		= 0x03,
1031 	WMI_DIS_REASON_BSS_DISCONNECTED		= 0x04,
1032 	WMI_DIS_REASON_AUTH_FAILED		= 0x05,
1033 	WMI_DIS_REASON_ASSOC_FAILED		= 0x06,
1034 	WMI_DIS_REASON_NO_RESOURCES_AVAIL	= 0x07,
1035 	WMI_DIS_REASON_CSERV_DISCONNECT		= 0x08,
1036 	WMI_DIS_REASON_INVALID_PROFILE		= 0x0A,
1037 	WMI_DIS_REASON_DOT11H_CHANNEL_SWITCH	= 0x0B,
1038 	WMI_DIS_REASON_PROFILE_MISMATCH		= 0x0C,
1039 	WMI_DIS_REASON_CONNECTION_EVICTED	= 0x0D,
1040 	WMI_DIS_REASON_IBSS_MERGE		= 0x0E,
1041 };
1042 
1043 struct wmi_disconnect_event {
1044 	/* reason code, see 802.11 spec. */
1045 	__le16 protocol_reason_status;
1046 	/* set if known */
1047 	u8 bssid[WMI_MAC_LEN];
1048 	/* see enum wmi_disconnect_reason */
1049 	u8 disconnect_reason;
1050 	/* last assoc req may passed to host - not in used */
1051 	u8 assoc_resp_len;
1052 	/* last assoc req may passed to host - not in used */
1053 	u8 assoc_info[0];
1054 } __packed;
1055 
1056 /* WMI_SCAN_COMPLETE_EVENTID */
1057 enum scan_status {
1058 	WMI_SCAN_SUCCESS	= 0x00,
1059 	WMI_SCAN_FAILED		= 0x01,
1060 	WMI_SCAN_ABORTED	= 0x02,
1061 	WMI_SCAN_REJECTED	= 0x03,
1062 	WMI_SCAN_ABORT_REJECTED	= 0x04,
1063 };
1064 
1065 struct wmi_scan_complete_event {
1066 	/* enum scan_status */
1067 	__le32 status;
1068 } __packed;
1069 
1070 /* WMI_ACS_PASSIVE_SCAN_COMPLETE_EVENT */
1071 enum wmi_acs_info_bitmask {
1072 	WMI_ACS_INFO_BITMASK_BEACON_FOUND	= 0x01,
1073 	WMI_ACS_INFO_BITMASK_BUSY_TIME		= 0x02,
1074 	WMI_ACS_INFO_BITMASK_TX_TIME		= 0x04,
1075 	WMI_ACS_INFO_BITMASK_RX_TIME		= 0x08,
1076 	WMI_ACS_INFO_BITMASK_NOISE		= 0x10,
1077 };
1078 
1079 struct scan_acs_info {
1080 	u8 channel;
1081 	u8 beacon_found;
1082 	/* msec */
1083 	__le16 busy_time;
1084 	__le16 tx_time;
1085 	__le16 rx_time;
1086 	u8 noise;
1087 	u8 reserved[3];
1088 } __packed;
1089 
1090 struct wmi_acs_passive_scan_complete_event {
1091 	__le32 dwell_time;
1092 	/* valid fields within channel info according to
1093 	 * their appearance in struct order
1094 	 */
1095 	__le16 filled;
1096 	u8 num_scanned_channels;
1097 	u8 reserved;
1098 	struct scan_acs_info scan_info_list[0];
1099 } __packed;
1100 
1101 /* WMI_BA_STATUS_EVENTID */
1102 enum wmi_vring_ba_status {
1103 	WMI_BA_AGREED			= 0x00,
1104 	WMI_BA_NON_AGREED		= 0x01,
1105 	/* BA_EN in middle of teardown flow */
1106 	WMI_BA_TD_WIP			= 0x02,
1107 	/* BA_DIS or BA_EN in middle of BA SETUP flow */
1108 	WMI_BA_SETUP_WIP		= 0x03,
1109 	/* BA_EN when the BA session is already active */
1110 	WMI_BA_SESSION_ACTIVE		= 0x04,
1111 	/* BA_DIS when the BA session is not active */
1112 	WMI_BA_SESSION_NOT_ACTIVE	= 0x05,
1113 };
1114 
1115 struct wmi_ba_status_event {
1116 	/* enum wmi_vring_ba_status */
1117 	__le16 status;
1118 	u8 reserved[2];
1119 	u8 ringid;
1120 	u8 agg_wsize;
1121 	__le16 ba_timeout;
1122 	u8 amsdu;
1123 } __packed;
1124 
1125 /* WMI_DELBA_EVENTID */
1126 struct wmi_delba_event {
1127 	u8 cidxtid;
1128 	u8 from_initiator;
1129 	__le16 reason;
1130 } __packed;
1131 
1132 /* WMI_VRING_CFG_DONE_EVENTID */
1133 struct wmi_vring_cfg_done_event {
1134 	u8 ringid;
1135 	u8 status;
1136 	u8 reserved[2];
1137 	__le32 tx_vring_tail_ptr;
1138 } __packed;
1139 
1140 /* WMI_RCP_ADDBA_RESP_SENT_EVENTID */
1141 struct wmi_rcp_addba_resp_sent_event {
1142 	u8 cidxtid;
1143 	u8 reserved;
1144 	__le16 status;
1145 } __packed;
1146 
1147 /* WMI_RCP_ADDBA_REQ_EVENTID */
1148 struct wmi_rcp_addba_req_event {
1149 	u8 cidxtid;
1150 	u8 dialog_token;
1151 	/* ieee80211_ba_parameterset as it received */
1152 	__le16 ba_param_set;
1153 	__le16 ba_timeout;
1154 	/* ieee80211_ba_seqstrl field as it received */
1155 	__le16 ba_seq_ctrl;
1156 } __packed;
1157 
1158 /* WMI_CFG_RX_CHAIN_DONE_EVENTID */
1159 enum wmi_cfg_rx_chain_done_event_status {
1160 	WMI_CFG_RX_CHAIN_SUCCESS	= 0x01,
1161 };
1162 
1163 struct wmi_cfg_rx_chain_done_event {
1164 	/* V-Ring Tail pointer */
1165 	__le32 rx_ring_tail_ptr;
1166 	__le32 status;
1167 } __packed;
1168 
1169 /* WMI_WBE_LINK_DOWN_EVENTID */
1170 enum wmi_wbe_link_down_event_reason {
1171 	WMI_WBE_REASON_USER_REQUEST	= 0x00,
1172 	WMI_WBE_REASON_RX_DISASSOC	= 0x01,
1173 	WMI_WBE_REASON_BAD_PHY_LINK	= 0x02,
1174 };
1175 
1176 /* WMI_WBE_LINK_DOWN_EVENTID */
1177 struct wmi_wbe_link_down_event {
1178 	u8 cid;
1179 	u8 reserved[3];
1180 	__le32 reason;
1181 } __packed;
1182 
1183 /* WMI_DATA_PORT_OPEN_EVENTID */
1184 struct wmi_data_port_open_event {
1185 	u8 cid;
1186 	u8 reserved[3];
1187 } __packed;
1188 
1189 /* WMI_VRING_EN_EVENTID */
1190 struct wmi_vring_en_event {
1191 	u8 vring_index;
1192 	u8 reserved[3];
1193 } __packed;
1194 
1195 /* WMI_GET_PCP_CHANNEL_EVENTID */
1196 struct wmi_get_pcp_channel_event {
1197 	u8 channel;
1198 	u8 reserved[3];
1199 } __packed;
1200 
1201 /* WMI_P2P_CFG_DONE_EVENTID */
1202 struct wmi_p2p_cfg_done_event {
1203 	/* wmi_fw_status */
1204 	u8 status;
1205 	u8 reserved[3];
1206 } __packed;
1207 
1208 /* WMI_PORT_ALLOCATED_EVENTID */
1209 struct wmi_port_allocated_event {
1210 	/* wmi_fw_status */
1211 	u8 status;
1212 	u8 reserved[3];
1213 } __packed;
1214 
1215 /* WMI_PORT_DELETED_EVENTID */
1216 struct wmi_port_deleted_event {
1217 	/* wmi_fw_status */
1218 	u8 status;
1219 	u8 reserved[3];
1220 } __packed;
1221 
1222 /* WMI_LISTEN_STARTED_EVENTID */
1223 struct wmi_listen_started_event {
1224 	/* wmi_fw_status */
1225 	u8 status;
1226 	u8 reserved[3];
1227 } __packed;
1228 
1229 /* WMI_SEARCH_STARTED_EVENTID */
1230 struct wmi_search_started_event {
1231 	/* wmi_fw_status */
1232 	u8 status;
1233 	u8 reserved[3];
1234 } __packed;
1235 
1236 /* WMI_PCP_STARTED_EVENTID */
1237 struct wmi_pcp_started_event {
1238 	/* wmi_fw_status */
1239 	u8 status;
1240 	u8 reserved[3];
1241 } __packed;
1242 
1243 /* WMI_PCP_FACTOR_EVENTID */
1244 struct wmi_pcp_factor_event {
1245 	__le32 pcp_factor;
1246 } __packed;
1247 
1248 enum wmi_sw_tx_status {
1249 	WMI_TX_SW_STATUS_SUCCESS		= 0x00,
1250 	WMI_TX_SW_STATUS_FAILED_NO_RESOURCES	= 0x01,
1251 	WMI_TX_SW_STATUS_FAILED_TX		= 0x02,
1252 };
1253 
1254 /* WMI_SW_TX_COMPLETE_EVENTID */
1255 struct wmi_sw_tx_complete_event {
1256 	/* enum wmi_sw_tx_status */
1257 	u8 status;
1258 	u8 reserved[3];
1259 } __packed;
1260 
1261 /* WMI_CORR_MEASURE_EVENTID */
1262 struct wmi_corr_measure_event {
1263 	/* signed */
1264 	__le32 i;
1265 	/* signed */
1266 	__le32 q;
1267 	/* signed */
1268 	__le32 image_i;
1269 	/* signed */
1270 	__le32 image_q;
1271 } __packed;
1272 
1273 /* WMI_READ_RSSI_EVENTID */
1274 struct wmi_read_rssi_event {
1275 	__le32 ina_rssi_adc_dbm;
1276 } __packed;
1277 
1278 /* WMI_GET_SSID_EVENTID */
1279 struct wmi_get_ssid_event {
1280 	__le32 ssid_len;
1281 	u8 ssid[WMI_MAX_SSID_LEN];
1282 } __packed;
1283 
1284 /* wmi_rx_mgmt_info */
1285 struct wmi_rx_mgmt_info {
1286 	u8 mcs;
1287 	s8 snr;
1288 	u8 range;
1289 	u8 sqi;
1290 	__le16 stype;
1291 	__le16 status;
1292 	__le32 len;
1293 	/* Not resolved when == 0xFFFFFFFF  ==> Broadcast to all MIDS */
1294 	u8 qid;
1295 	/* Not resolved when == 0xFFFFFFFF  ==> Broadcast to all MIDS */
1296 	u8 mid;
1297 	u8 cid;
1298 	/* From Radio MNGR */
1299 	u8 channel;
1300 } __packed;
1301 
1302 /* wmi_otp_read_write_cmd */
1303 struct wmi_otp_read_write_cmd {
1304 	__le32 addr;
1305 	__le32 size;
1306 	u8 values[0];
1307 } __packed;
1308 
1309 /* WMI_OTP_READ_RESULT_EVENTID */
1310 struct wmi_otp_read_result_event {
1311 	u8 payload[0];
1312 } __packed;
1313 
1314 /* WMI_TX_MGMT_PACKET_EVENTID */
1315 struct wmi_tx_mgmt_packet_event {
1316 	u8 payload[0];
1317 } __packed;
1318 
1319 /* WMI_RX_MGMT_PACKET_EVENTID */
1320 struct wmi_rx_mgmt_packet_event {
1321 	struct wmi_rx_mgmt_info info;
1322 	u8 payload[0];
1323 } __packed;
1324 
1325 /* WMI_ECHO_RSP_EVENTID */
1326 struct wmi_echo_rsp_event {
1327 	__le32 echoed_value;
1328 } __packed;
1329 
1330 /* WMI_TEMP_SENSE_DONE_EVENTID
1331  *
1332  * Measure MAC and radio temperatures
1333  */
1334 struct wmi_temp_sense_done_event {
1335 	/* Temperature times 1000 (actual temperature will be achieved by
1336 	 * dividing the value by 1000)
1337 	 */
1338 	__le32 baseband_t1000;
1339 	/* Temperature times 1000 (actual temperature will be achieved by
1340 	 * dividing the value by 1000)
1341 	 */
1342 	__le32 rf_t1000;
1343 } __packed;
1344 
1345 #define WMI_SCAN_DWELL_TIME_MS	(100)
1346 #define WMI_SURVEY_TIMEOUT_MS	(10000)
1347 
1348 enum wmi_hidden_ssid {
1349 	WMI_HIDDEN_SSID_DISABLED	= 0x00,
1350 	WMI_HIDDEN_SSID_SEND_EMPTY	= 0x10,
1351 	WMI_HIDDEN_SSID_CLEAR		= 0xFE,
1352 };
1353 
1354 /* WMI_LED_CFG_CMDID
1355  *
1356  * Configure LED On\Off\Blinking operation
1357  *
1358  * Returned events:
1359  * - WMI_LED_CFG_DONE_EVENTID
1360  */
1361 enum led_mode {
1362 	LED_DISABLE	= 0x00,
1363 	LED_ENABLE	= 0x01,
1364 };
1365 
1366 /* The names of the led as
1367  * described on HW schemes.
1368  */
1369 enum wmi_led_id {
1370 	WMI_LED_WLAN	= 0x00,
1371 	WMI_LED_WPAN	= 0x01,
1372 	WMI_LED_WWAN	= 0x02,
1373 };
1374 
1375 /* Led polarity mode. */
1376 enum wmi_led_polarity {
1377 	LED_POLARITY_HIGH_ACTIVE	= 0x00,
1378 	LED_POLARITY_LOW_ACTIVE		= 0x01,
1379 };
1380 
1381 /* Combination of on and off
1382  * creates the blinking period
1383  */
1384 struct wmi_led_blink_mode {
1385 	__le32 blink_on;
1386 	__le32 blink_off;
1387 } __packed;
1388 
1389 /* WMI_LED_CFG_CMDID */
1390 struct wmi_led_cfg_cmd {
1391 	/* enum led_mode_e */
1392 	u8 led_mode;
1393 	/* enum wmi_led_id_e */
1394 	u8 id;
1395 	/* slow speed blinking combination */
1396 	struct wmi_led_blink_mode slow_blink_cfg;
1397 	/* medium speed blinking combination */
1398 	struct wmi_led_blink_mode medium_blink_cfg;
1399 	/* high speed blinking combination */
1400 	struct wmi_led_blink_mode fast_blink_cfg;
1401 	/* polarity of the led */
1402 	u8 led_polarity;
1403 	/* reserved */
1404 	u8 reserved;
1405 } __packed;
1406 
1407 /* WMI_LED_CFG_DONE_EVENTID */
1408 struct wmi_led_cfg_done_event {
1409 	/* led config status */
1410 	__le32 status;
1411 } __packed;
1412 
1413 #endif /* __WILOCITY_WMI_H__ */
1414