1 /*
2  * Copyright (c) 2012 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 Wilocity
21  * MARLON 60 Gigabit 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 
27 #ifndef __WILOCITY_WMI_H__
28 #define __WILOCITY_WMI_H__
29 
30 /* General */
31 #define WILOCITY_MAX_ASSOC_STA (8)
32 #define WMI_MAC_LEN		(6)
33 #define WMI_PROX_RANGE_NUM	(3)
34 
35 /* List of Commands */
36 enum wmi_command_id {
37 	WMI_CONNECT_CMDID		= 0x0001,
38 	WMI_DISCONNECT_CMDID		= 0x0003,
39 	WMI_DISCONNECT_STA_CMDID	= 0x0004,
40 	WMI_START_SCAN_CMDID		= 0x0007,
41 	WMI_SET_BSS_FILTER_CMDID	= 0x0009,
42 	WMI_SET_PROBED_SSID_CMDID	= 0x000a,
43 	WMI_SET_LISTEN_INT_CMDID	= 0x000b,
44 	WMI_BCON_CTRL_CMDID		= 0x000f,
45 	WMI_ADD_CIPHER_KEY_CMDID	= 0x0016,
46 	WMI_DELETE_CIPHER_KEY_CMDID	= 0x0017,
47 	WMI_SET_APPIE_CMDID		= 0x003f,
48 	WMI_SET_WSC_STATUS_CMDID	= 0x0041,
49 	WMI_PXMT_RANGE_CFG_CMDID	= 0x0042,
50 	WMI_PXMT_SNR2_RANGE_CFG_CMDID	= 0x0043,
51 	WMI_FAST_MEM_ACC_MODE_CMDID	= 0x0300,
52 	WMI_MEM_READ_CMDID		= 0x0800,
53 	WMI_MEM_WR_CMDID		= 0x0801,
54 	WMI_ECHO_CMDID			= 0x0803,
55 	WMI_DEEP_ECHO_CMDID		= 0x0804,
56 	WMI_CONFIG_MAC_CMDID		= 0x0805,
57 	WMI_CONFIG_PHY_DEBUG_CMDID	= 0x0806,
58 	WMI_ADD_DEBUG_TX_PCKT_CMDID	= 0x0808,
59 	WMI_PHY_GET_STATISTICS_CMDID	= 0x0809,
60 	WMI_FS_TUNE_CMDID		= 0x080a,
61 	WMI_CORR_MEASURE_CMDID		= 0x080b,
62 	WMI_READ_RSSI_CMDID		= 0x080c,
63 	WMI_TEMP_SENSE_CMDID		= 0x080e,
64 	WMI_DC_CALIB_CMDID		= 0x080f,
65 	WMI_SEND_TONE_CMDID		= 0x0810,
66 	WMI_IQ_TX_CALIB_CMDID		= 0x0811,
67 	WMI_IQ_RX_CALIB_CMDID		= 0x0812,
68 	WMI_SET_UCODE_IDLE_CMDID	= 0x0813,
69 	WMI_SET_WORK_MODE_CMDID		= 0x0815,
70 	WMI_LO_LEAKAGE_CALIB_CMDID	= 0x0816,
71 	WMI_MARLON_R_ACTIVATE_CMDID	= 0x0817,
72 	WMI_MARLON_R_READ_CMDID		= 0x0818,
73 	WMI_MARLON_R_WRITE_CMDID	= 0x0819,
74 	WMI_MARLON_R_TXRX_SEL_CMDID	= 0x081a,
75 	MAC_IO_STATIC_PARAMS_CMDID	= 0x081b,
76 	MAC_IO_DYNAMIC_PARAMS_CMDID	= 0x081c,
77 	WMI_SILENT_RSSI_CALIB_CMDID	= 0x081d,
78 	WMI_RF_RX_TEST_CMDID		= 0x081e,
79 	WMI_CFG_RX_CHAIN_CMDID		= 0x0820,
80 	WMI_VRING_CFG_CMDID		= 0x0821,
81 	WMI_VRING_BA_EN_CMDID		= 0x0823,
82 	WMI_VRING_BA_DIS_CMDID		= 0x0824,
83 	WMI_RCP_ADDBA_RESP_CMDID	= 0x0825,
84 	WMI_RCP_DELBA_CMDID		= 0x0826,
85 	WMI_SET_SSID_CMDID		= 0x0827,
86 	WMI_GET_SSID_CMDID		= 0x0828,
87 	WMI_SET_PCP_CHANNEL_CMDID	= 0x0829,
88 	WMI_GET_PCP_CHANNEL_CMDID	= 0x082a,
89 	WMI_SW_TX_REQ_CMDID		= 0x082b,
90 	WMI_READ_MAC_RXQ_CMDID		= 0x0830,
91 	WMI_READ_MAC_TXQ_CMDID		= 0x0831,
92 	WMI_WRITE_MAC_RXQ_CMDID		= 0x0832,
93 	WMI_WRITE_MAC_TXQ_CMDID		= 0x0833,
94 	WMI_WRITE_MAC_XQ_FIELD_CMDID	= 0x0834,
95 	WMI_MLME_PUSH_CMDID		= 0x0835,
96 	WMI_BEAMFORMING_MGMT_CMDID	= 0x0836,
97 	WMI_BF_TXSS_MGMT_CMDID		= 0x0837,
98 	WMI_BF_SM_MGMT_CMDID		= 0x0838,
99 	WMI_BF_RXSS_MGMT_CMDID		= 0x0839,
100 	WMI_SET_SECTORS_CMDID		= 0x0849,
101 	WMI_MAINTAIN_PAUSE_CMDID	= 0x0850,
102 	WMI_MAINTAIN_RESUME_CMDID	= 0x0851,
103 	WMI_RS_MGMT_CMDID		= 0x0852,
104 	WMI_RF_MGMT_CMDID		= 0x0853,
105 	/* Performance monitoring commands */
106 	WMI_BF_CTRL_CMDID		= 0x0862,
107 	WMI_NOTIFY_REQ_CMDID		= 0x0863,
108 	WMI_GET_STATUS_CMDID		= 0x0864,
109 	WMI_UNIT_TEST_CMDID		= 0x0900,
110 	WMI_HICCUP_CMDID		= 0x0901,
111 	WMI_FLASH_READ_CMDID		= 0x0902,
112 	WMI_FLASH_WRITE_CMDID		= 0x0903,
113 	WMI_SECURITY_UNIT_TEST_CMDID	= 0x0904,
114 	/*P2P*/
115 	WMI_P2P_CFG_CMDID		= 0x0910,
116 	WMI_PORT_ALLOCATE_CMDID		= 0x0911,
117 	WMI_PORT_DELETE_CMDID		= 0x0912,
118 	WMI_POWER_MGMT_CFG_CMDID	= 0x0913,
119 	WMI_START_LISTEN_CMDID		= 0x0914,
120 	WMI_START_SEARCH_CMDID		= 0x0915,
121 	WMI_DISCOVERY_START_CMDID	= 0x0916,
122 	WMI_DISCOVERY_STOP_CMDID	= 0x0917,
123 	WMI_PCP_START_CMDID		= 0x0918,
124 	WMI_PCP_STOP_CMDID		= 0x0919,
125 	WMI_GET_PCP_FACTOR_CMDID	= 0x091b,
126 
127 	WMI_SET_MAC_ADDRESS_CMDID	= 0xf003,
128 	WMI_ABORT_SCAN_CMDID		= 0xf007,
129 	WMI_SET_PMK_CMDID		= 0xf028,
130 
131 	WMI_SET_PROMISCUOUS_MODE_CMDID	= 0xf041,
132 	WMI_GET_PMK_CMDID		= 0xf048,
133 	WMI_SET_PASSPHRASE_CMDID	= 0xf049,
134 	WMI_SEND_ASSOC_RES_CMDID	= 0xf04a,
135 	WMI_SET_ASSOC_REQ_RELAY_CMDID	= 0xf04b,
136 	WMI_EAPOL_TX_CMDID		= 0xf04c,
137 	WMI_MAC_ADDR_REQ_CMDID		= 0xf04d,
138 	WMI_FW_VER_CMDID		= 0xf04e,
139 };
140 
141 /*
142  * Commands data structures
143  */
144 
145 /*
146  * WMI_CONNECT_CMDID
147  */
148 enum wmi_network_type {
149 	WMI_NETTYPE_INFRA		= 0x01,
150 	WMI_NETTYPE_ADHOC		= 0x02,
151 	WMI_NETTYPE_ADHOC_CREATOR	= 0x04,
152 	WMI_NETTYPE_AP			= 0x10,
153 	WMI_NETTYPE_P2P			= 0x20,
154 	WMI_NETTYPE_WBE			= 0x40, /* PCIE over 60g */
155 };
156 
157 enum wmi_dot11_auth_mode {
158 	WMI_AUTH11_OPEN			= 0x01,
159 	WMI_AUTH11_SHARED		= 0x02,
160 	WMI_AUTH11_LEAP			= 0x04,
161 	WMI_AUTH11_WSC			= 0x08,
162 };
163 
164 enum wmi_auth_mode {
165 	WMI_AUTH_NONE			= 0x01,
166 	WMI_AUTH_WPA			= 0x02,
167 	WMI_AUTH_WPA2			= 0x04,
168 	WMI_AUTH_WPA_PSK		= 0x08,
169 	WMI_AUTH_WPA2_PSK		= 0x10,
170 	WMI_AUTH_WPA_CCKM		= 0x20,
171 	WMI_AUTH_WPA2_CCKM		= 0x40,
172 };
173 
174 enum wmi_crypto_type {
175 	WMI_CRYPT_NONE			= 0x01,
176 	WMI_CRYPT_WEP			= 0x02,
177 	WMI_CRYPT_TKIP			= 0x04,
178 	WMI_CRYPT_AES			= 0x08,
179 	WMI_CRYPT_AES_GCMP		= 0x20,
180 };
181 
182 
183 enum wmi_connect_ctrl_flag_bits {
184 	WMI_CONNECT_ASSOC_POLICY_USER		= 0x0001,
185 	WMI_CONNECT_SEND_REASSOC		= 0x0002,
186 	WMI_CONNECT_IGNORE_WPA_GROUP_CIPHER	= 0x0004,
187 	WMI_CONNECT_PROFILE_MATCH_DONE		= 0x0008,
188 	WMI_CONNECT_IGNORE_AAC_BEACON		= 0x0010,
189 	WMI_CONNECT_CSA_FOLLOW_BSS		= 0x0020,
190 	WMI_CONNECT_DO_WPA_OFFLOAD		= 0x0040,
191 	WMI_CONNECT_DO_NOT_DEAUTH		= 0x0080,
192 };
193 
194 #define WMI_MAX_SSID_LEN    (32)
195 
196 struct wmi_connect_cmd {
197 	u8 network_type;
198 	u8 dot11_auth_mode;
199 	u8 auth_mode;
200 	u8 pairwise_crypto_type;
201 	u8 pairwise_crypto_len;
202 	u8 group_crypto_type;
203 	u8 group_crypto_len;
204 	u8 ssid_len;
205 	u8 ssid[WMI_MAX_SSID_LEN];
206 	u8 channel;
207 	u8 reserved0;
208 	u8 bssid[WMI_MAC_LEN];
209 	__le32 ctrl_flags;
210 	u8 dst_mac[WMI_MAC_LEN];
211 	u8 reserved1[2];
212 } __packed;
213 
214 /*
215  * WMI_DISCONNECT_STA_CMDID
216  */
217 struct wmi_disconnect_sta_cmd {
218 	u8 dst_mac[WMI_MAC_LEN];
219 	__le16 disconnect_reason;
220 } __packed;
221 
222 
223 /*
224  * WMI_SET_PMK_CMDID
225  */
226 
227 #define WMI_MIN_KEY_INDEX	(0)
228 #define WMI_MAX_KEY_INDEX	(3)
229 #define WMI_MAX_KEY_LEN		(32)
230 #define WMI_PASSPHRASE_LEN	(64)
231 #define WMI_PMK_LEN		(32)
232 
233 struct  wmi_set_pmk_cmd {
234 	u8 pmk[WMI_PMK_LEN];
235 } __packed;
236 
237 
238 /*
239  * WMI_SET_PASSPHRASE_CMDID
240  */
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 /*
249  * WMI_ADD_CIPHER_KEY_CMDID
250  */
251 enum wmi_key_usage {
252 	WMI_KEY_USE_PAIRWISE	= 0,
253 	WMI_KEY_USE_GROUP	= 1,
254 	WMI_KEY_USE_TX		= 2,  /* default Tx Key - Static WEP only */
255 };
256 
257 struct wmi_add_cipher_key_cmd {
258 	u8 key_index;
259 	u8 key_type;
260 	u8 key_usage;		/* enum wmi_key_usage */
261 	u8 key_len;
262 	u8 key_rsc[8];		/* key replay sequence counter */
263 	u8 key[WMI_MAX_KEY_LEN];
264 	u8 key_op_ctrl;		/* Additional Key Control information */
265 	u8 mac[WMI_MAC_LEN];
266 } __packed;
267 
268 /*
269  * WMI_DELETE_CIPHER_KEY_CMDID
270  */
271 struct wmi_delete_cipher_key_cmd {
272 	u8 key_index;
273 	u8 mac[WMI_MAC_LEN];
274 } __packed;
275 
276 
277 /*
278  * WMI_START_SCAN_CMDID
279  *
280  * Start L1 scan operation
281  *
282  * Returned events:
283  * - WMI_RX_MGMT_PACKET_EVENTID - for every probe resp.
284  * - WMI_SCAN_COMPLETE_EVENTID
285  */
286 enum wmi_scan_type {
287 	WMI_LONG_SCAN		= 0,
288 	WMI_SHORT_SCAN		= 1,
289 	WMI_PBC_SCAN		= 2,
290 	WMI_ACTIVE_SCAN		= 3,
291 	WMI_DIRECT_SCAN		= 4,
292 };
293 
294 struct wmi_start_scan_cmd {
295 	u8 direct_scan_mac_addr[6];
296 	u8 reserved[2];
297 	__le32 home_dwell_time;	/* Max duration in the home channel(ms) */
298 	__le32 force_scan_interval;	/* Time interval between scans (ms)*/
299 	u8 scan_type;		/* wmi_scan_type */
300 	u8 num_channels;		/* how many channels follow */
301 	struct {
302 		u8 channel;
303 		u8 reserved;
304 	} channel_list[0];	/* channels ID's */
305 				/* 0 - 58320 MHz */
306 				/* 1 - 60480 MHz */
307 				/* 2 - 62640 MHz */
308 } __packed;
309 
310 /*
311  * WMI_SET_PROBED_SSID_CMDID
312  */
313 #define MAX_PROBED_SSID_INDEX	(3)
314 
315 enum wmi_ssid_flag {
316 	WMI_SSID_FLAG_DISABLE	= 0,	/* disables entry */
317 	WMI_SSID_FLAG_SPECIFIC	= 1,	/* probes specified ssid */
318 	WMI_SSID_FLAG_ANY	= 2,	/* probes for any ssid */
319 };
320 
321 struct wmi_probed_ssid_cmd {
322 	u8 entry_index;			/* 0 to MAX_PROBED_SSID_INDEX */
323 	u8 flag;			/* enum wmi_ssid_flag */
324 	u8 ssid_len;
325 	u8 ssid[WMI_MAX_SSID_LEN];
326 } __packed;
327 
328 
329 /*
330  * WMI_SET_APPIE_CMDID
331  * Add Application specified IE to a management frame
332  */
333 #define WMI_MAX_IE_LEN		(1024)
334 
335 /*
336  * Frame Types
337  */
338 enum wmi_mgmt_frame_type {
339 	WMI_FRAME_BEACON	= 0,
340 	WMI_FRAME_PROBE_REQ	= 1,
341 	WMI_FRAME_PROBE_RESP	= 2,
342 	WMI_FRAME_ASSOC_REQ	= 3,
343 	WMI_FRAME_ASSOC_RESP	= 4,
344 	WMI_NUM_MGMT_FRAME,
345 };
346 
347 struct wmi_set_appie_cmd {
348 	u8 mgmt_frm_type;	/* enum wmi_mgmt_frame_type */
349 	u8 reserved;
350 	__le16 ie_len;	/* Length of the IE to be added to MGMT frame */
351 	u8 ie_info[0];
352 } __packed;
353 
354 
355 /*
356  * WMI_PXMT_RANGE_CFG_CMDID
357  */
358 struct wmi_pxmt_range_cfg_cmd {
359 	u8 dst_mac[WMI_MAC_LEN];
360 	__le16 range;
361 } __packed;
362 
363 /*
364  * WMI_PXMT_SNR2_RANGE_CFG_CMDID
365  */
366 struct wmi_pxmt_snr2_range_cfg_cmd {
367 	s8 snr2range_arr[WMI_PROX_RANGE_NUM-1];
368 } __packed;
369 
370 /*
371  * WMI_RF_MGMT_CMDID
372  */
373 enum wmi_rf_mgmt_type {
374 	WMI_RF_MGMT_W_DISABLE	= 0,
375 	WMI_RF_MGMT_W_ENABLE	= 1,
376 	WMI_RF_MGMT_GET_STATUS	= 2,
377 };
378 
379 struct wmi_rf_mgmt_cmd {
380 	__le32 rf_mgmt_type;
381 } __packed;
382 
383 
384 /*
385  * WMI_RF_RX_TEST_CMDID
386  */
387 struct wmi_rf_rx_test_cmd {
388 	__le32 sector;
389 } __packed;
390 
391 /*
392  * WMI_CORR_MEASURE_CMDID
393  */
394 struct wmi_corr_measure_cmd {
395 	s32 freq_mhz;
396 	__le32 length_samples;
397 	__le32 iterations;
398 } __packed;
399 
400 /*
401  * WMI_SET_SSID_CMDID
402  */
403 struct wmi_set_ssid_cmd {
404 	__le32 ssid_len;
405 	u8 ssid[WMI_MAX_SSID_LEN];
406 } __packed;
407 
408 /*
409  * WMI_SET_PCP_CHANNEL_CMDID
410  */
411 struct wmi_set_pcp_channel_cmd {
412 	u8 channel;
413 	u8 reserved[3];
414 } __packed;
415 
416 /*
417  * WMI_BCON_CTRL_CMDID
418  */
419 struct wmi_bcon_ctrl_cmd {
420 	__le16 bcon_interval;
421 	__le16 frag_num;
422 	__le64 ss_mask;
423 	u8 network_type;
424 	u8 pcp_max_assoc_sta;
425 	u8 disable_sec_offload;
426 	u8 disable_sec;
427 } __packed;
428 
429 
430 /******* P2P ***********/
431 
432 /*
433  * WMI_PORT_ALLOCATE_CMDID
434  */
435 enum wmi_port_role {
436 	WMI_PORT_STA		= 0,
437 	WMI_PORT_PCP		= 1,
438 	WMI_PORT_AP		= 2,
439 	WMI_PORT_P2P_DEV	= 3,
440 	WMI_PORT_P2P_CLIENT	= 4,
441 	WMI_PORT_P2P_GO		= 5,
442 };
443 
444 struct wmi_port_allocate_cmd {
445 	u8 mac[WMI_MAC_LEN];
446 	u8 port_role;
447 	u8 mid;
448 } __packed;
449 
450 /*
451  * WMI_PORT_DELETE_CMDID
452  */
453 struct wmi_delete_port_cmd {
454 	u8 mid;
455 	u8 reserved[3];
456 } __packed;
457 
458 /*
459  * WMI_P2P_CFG_CMDID
460  */
461 enum wmi_discovery_mode {
462 	WMI_DISCOVERY_MODE_NON_OFFLOAD	= 0,
463 	WMI_DISCOVERY_MODE_OFFLOAD	= 1,
464 	WMI_DISCOVERY_MODE_PEER2PEER	= 2,
465 };
466 
467 struct wmi_p2p_cfg_cmd {
468 	u8 discovery_mode;	/* wmi_discovery_mode */
469 	u8 channel;
470 	__le16 bcon_interval; /* base to listen/search duration calculation */
471 } __packed;
472 
473 /*
474  * WMI_POWER_MGMT_CFG_CMDID
475  */
476 enum wmi_power_source_type {
477 	WMI_POWER_SOURCE_BATTERY	= 0,
478 	WMI_POWER_SOURCE_OTHER		= 1,
479 };
480 
481 struct wmi_power_mgmt_cfg_cmd {
482 	u8 power_source;	/* wmi_power_source_type */
483 	u8 reserved[3];
484 } __packed;
485 
486 /*
487  * WMI_PCP_START_CMDID
488  */
489 struct wmi_pcp_start_cmd {
490 	__le16 bcon_interval;
491 	u8 pcp_max_assoc_sta;
492 	u8 reserved0[9];
493 	u8 network_type;
494 	u8 channel;
495 	u8 disable_sec_offload;
496 	u8 disable_sec;
497 } __packed;
498 
499 /*
500  * WMI_SW_TX_REQ_CMDID
501  */
502 struct wmi_sw_tx_req_cmd {
503 	u8 dst_mac[WMI_MAC_LEN];
504 	__le16 len;
505 	u8 payload[0];
506 } __packed;
507 
508 /*
509  * WMI_VRING_CFG_CMDID
510  */
511 
512 struct wmi_sw_ring_cfg {
513 	__le64 ring_mem_base;
514 	__le16 ring_size;
515 	__le16 max_mpdu_size;
516 } __packed;
517 
518 struct wmi_vring_cfg_schd {
519 	__le16 priority;
520 	__le16 timeslot_us;
521 } __packed;
522 
523 enum wmi_vring_cfg_encap_trans_type {
524 	WMI_VRING_ENC_TYPE_802_3		= 0,
525 	WMI_VRING_ENC_TYPE_NATIVE_WIFI		= 1,
526 };
527 
528 enum wmi_vring_cfg_ds_cfg {
529 	WMI_VRING_DS_PBSS			= 0,
530 	WMI_VRING_DS_STATION			= 1,
531 	WMI_VRING_DS_AP				= 2,
532 	WMI_VRING_DS_ADDR4			= 3,
533 };
534 
535 enum wmi_vring_cfg_nwifi_ds_trans_type {
536 	WMI_NWIFI_TX_TRANS_MODE_NO		= 0,
537 	WMI_NWIFI_TX_TRANS_MODE_AP2PBSS		= 1,
538 	WMI_NWIFI_TX_TRANS_MODE_STA2PBSS	= 2,
539 };
540 
541 enum wmi_vring_cfg_schd_params_priority {
542 	WMI_SCH_PRIO_REGULAR			= 0,
543 	WMI_SCH_PRIO_HIGH			= 1,
544 };
545 
546 #define CIDXTID_CID_POS (0)
547 #define CIDXTID_CID_LEN (4)
548 #define CIDXTID_CID_MSK (0xF)
549 #define CIDXTID_TID_POS (4)
550 #define CIDXTID_TID_LEN (4)
551 #define CIDXTID_TID_MSK (0xF0)
552 
553 struct wmi_vring_cfg {
554 	struct wmi_sw_ring_cfg tx_sw_ring;
555 	u8 ringid;				/* 0-23 vrings */
556 
557 	u8 cidxtid;
558 
559 	u8 encap_trans_type;
560 	u8 ds_cfg;				/* 802.3 DS cfg */
561 	u8 nwifi_ds_trans_type;
562 
563 	#define VRING_CFG_MAC_CTRL_LIFETIME_EN_POS (0)
564 	#define VRING_CFG_MAC_CTRL_LIFETIME_EN_LEN (1)
565 	#define VRING_CFG_MAC_CTRL_LIFETIME_EN_MSK (0x1)
566 	#define VRING_CFG_MAC_CTRL_AGGR_EN_POS (1)
567 	#define VRING_CFG_MAC_CTRL_AGGR_EN_LEN (1)
568 	#define VRING_CFG_MAC_CTRL_AGGR_EN_MSK (0x2)
569 	u8 mac_ctrl;
570 
571 	#define VRING_CFG_TO_RESOLUTION_VALUE_POS (0)
572 	#define VRING_CFG_TO_RESOLUTION_VALUE_LEN (6)
573 	#define VRING_CFG_TO_RESOLUTION_VALUE_MSK (0x3F)
574 	u8 to_resolution;
575 	u8 agg_max_wsize;
576 	struct wmi_vring_cfg_schd schd_params;
577 } __packed;
578 
579 enum wmi_vring_cfg_cmd_action {
580 	WMI_VRING_CMD_ADD			= 0,
581 	WMI_VRING_CMD_MODIFY			= 1,
582 	WMI_VRING_CMD_DELETE			= 2,
583 };
584 
585 struct wmi_vring_cfg_cmd {
586 	__le32 action;
587 	struct wmi_vring_cfg vring_cfg;
588 } __packed;
589 
590 /*
591  * WMI_VRING_BA_EN_CMDID
592  */
593 struct wmi_vring_ba_en_cmd {
594 	u8 ringid;
595 	u8 agg_max_wsize;
596 	__le16 ba_timeout;
597 } __packed;
598 
599 /*
600  * WMI_VRING_BA_DIS_CMDID
601  */
602 struct wmi_vring_ba_dis_cmd {
603 	u8 ringid;
604 	u8 reserved;
605 	__le16 reason;
606 } __packed;
607 
608 /*
609  * WMI_NOTIFY_REQ_CMDID
610  */
611 struct wmi_notify_req_cmd {
612 	u8 cid;
613 	u8 year;
614 	u8 month;
615 	u8 day;
616 	__le32 interval_usec;
617 	u8 hour;
618 	u8 minute;
619 	u8 second;
620 	u8 miliseconds;
621 } __packed;
622 
623 /*
624  * WMI_CFG_RX_CHAIN_CMDID
625  */
626 enum wmi_sniffer_cfg_mode {
627 	WMI_SNIFFER_OFF				= 0,
628 	WMI_SNIFFER_ON				= 1,
629 };
630 
631 enum wmi_sniffer_cfg_phy_info_mode {
632 	WMI_SNIFFER_PHY_INFO_DISABLED		= 0,
633 	WMI_SNIFFER_PHY_INFO_ENABLED		= 1,
634 };
635 
636 enum wmi_sniffer_cfg_phy_support {
637 	WMI_SNIFFER_CP				= 0,
638 	WMI_SNIFFER_DP				= 1,
639 	WMI_SNIFFER_BOTH_PHYS			= 2,
640 };
641 
642 struct wmi_sniffer_cfg {
643 	__le32 mode;		/* enum wmi_sniffer_cfg_mode */
644 	__le32 phy_info_mode;	/* enum wmi_sniffer_cfg_phy_info_mode */
645 	__le32 phy_support;	/* enum wmi_sniffer_cfg_phy_support */
646 	u8 channel;
647 	u8 reserved[3];
648 } __packed;
649 
650 enum wmi_cfg_rx_chain_cmd_action {
651 	WMI_RX_CHAIN_ADD			= 0,
652 	WMI_RX_CHAIN_DEL			= 1,
653 };
654 
655 enum wmi_cfg_rx_chain_cmd_decap_trans_type {
656 	WMI_DECAP_TYPE_802_3			= 0,
657 	WMI_DECAP_TYPE_NATIVE_WIFI		= 1,
658 };
659 
660 enum wmi_cfg_rx_chain_cmd_nwifi_ds_trans_type {
661 	WMI_NWIFI_RX_TRANS_MODE_NO		= 0,
662 	WMI_NWIFI_RX_TRANS_MODE_PBSS2AP		= 1,
663 	WMI_NWIFI_RX_TRANS_MODE_PBSS2STA	= 2,
664 };
665 
666 enum wmi_cfg_rx_chain_cmd_reorder_type {
667 	WMI_RX_HW_REORDER = 0,
668 	WMI_RX_SW_REORDER = 1,
669 };
670 
671 struct wmi_cfg_rx_chain_cmd {
672 	__le32 action;
673 	struct wmi_sw_ring_cfg rx_sw_ring;
674 	u8 mid;
675 	u8 decap_trans_type;
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 	u8 l2_802_3_offload_ctrl;
681 
682 	#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_POS (0)
683 	#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_LEN (1)
684 	#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_MSK (0x1)
685 	#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_POS (1)
686 	#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_LEN (1)
687 	#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_MSK (0x2)
688 	u8 l2_nwifi_offload_ctrl;
689 
690 	u8 vlan_id;
691 	u8 nwifi_ds_trans_type;
692 
693 	#define L3_L4_CTRL_IPV4_CHECKSUM_EN_POS (0)
694 	#define L3_L4_CTRL_IPV4_CHECKSUM_EN_LEN (1)
695 	#define L3_L4_CTRL_IPV4_CHECKSUM_EN_MSK (0x1)
696 	#define L3_L4_CTRL_TCPIP_CHECKSUM_EN_POS (1)
697 	#define L3_L4_CTRL_TCPIP_CHECKSUM_EN_LEN (1)
698 	#define L3_L4_CTRL_TCPIP_CHECKSUM_EN_MSK (0x2)
699 	u8 l3_l4_ctrl;
700 
701 	#define RING_CTRL_OVERRIDE_PREFETCH_THRSH_POS (0)
702 	#define RING_CTRL_OVERRIDE_PREFETCH_THRSH_LEN (1)
703 	#define RING_CTRL_OVERRIDE_PREFETCH_THRSH_MSK (0x1)
704 	#define RING_CTRL_OVERRIDE_WB_THRSH_POS (1)
705 	#define RING_CTRL_OVERRIDE_WB_THRSH_LEN (1)
706 	#define RING_CTRL_OVERRIDE_WB_THRSH_MSK (0x2)
707 	#define RING_CTRL_OVERRIDE_ITR_THRSH_POS (2)
708 	#define RING_CTRL_OVERRIDE_ITR_THRSH_LEN (1)
709 	#define RING_CTRL_OVERRIDE_ITR_THRSH_MSK (0x4)
710 	#define RING_CTRL_OVERRIDE_HOST_THRSH_POS (3)
711 	#define RING_CTRL_OVERRIDE_HOST_THRSH_LEN (1)
712 	#define RING_CTRL_OVERRIDE_HOST_THRSH_MSK (0x8)
713 	u8 ring_ctrl;
714 
715 	__le16 prefetch_thrsh;
716 	__le16 wb_thrsh;
717 	__le32 itr_value;
718 	__le16 host_thrsh;
719 	u8 reorder_type;
720 	u8 reserved;
721 	struct wmi_sniffer_cfg sniffer_cfg;
722 } __packed;
723 
724 /*
725  * WMI_RCP_ADDBA_RESP_CMDID
726  */
727 struct wmi_rcp_addba_resp_cmd {
728 	u8 cidxtid;
729 	u8 dialog_token;
730 	__le16 status_code;
731 	__le16 ba_param_set;	/* ieee80211_ba_parameterset field to send */
732 	__le16 ba_timeout;
733 } __packed;
734 
735 /*
736  * WMI_RCP_DELBA_CMDID
737  */
738 struct wmi_rcp_delba_cmd {
739 	u8 cidxtid;
740 	u8 reserved;
741 	__le16 reason;
742 } __packed;
743 
744 /*
745  * WMI_RCP_ADDBA_REQ_CMDID
746  */
747 struct wmi_rcp_addba_req_cmd {
748 	u8 cidxtid;
749 	u8 dialog_token;
750 	/* ieee80211_ba_parameterset field as it received */
751 	__le16 ba_param_set;
752 	__le16 ba_timeout;
753 	/* ieee80211_ba_seqstrl field as it received */
754 	__le16 ba_seq_ctrl;
755 } __packed;
756 
757 /*
758  * WMI_SET_MAC_ADDRESS_CMDID
759  */
760 struct wmi_set_mac_address_cmd {
761 	u8 mac[WMI_MAC_LEN];
762 	u8 reserved[2];
763 } __packed;
764 
765 /*
766 * WMI_EAPOL_TX_CMDID
767 */
768 struct wmi_eapol_tx_cmd {
769 	u8 dst_mac[WMI_MAC_LEN];
770 	__le16 eapol_len;
771 	u8 eapol[0];
772 } __packed;
773 
774 /*
775  * WMI_ECHO_CMDID
776  *
777  * Check FW is alive
778  *
779  * WMI_DEEP_ECHO_CMDID
780  *
781  * Check FW and ucode are alive
782  *
783  * Returned event: WMI_ECHO_RSP_EVENTID
784  * same event for both commands
785  */
786 struct wmi_echo_cmd {
787 	__le32 value;
788 } __packed;
789 
790 /*
791  * WMI_TEMP_SENSE_CMDID
792  *
793  * Measure MAC and radio temperatures
794  */
795 struct wmi_temp_sense_cmd {
796 	__le32 measure_marlon_m_en;
797 	__le32 measure_marlon_r_en;
798 } __packed;
799 
800 
801 /*
802  * WMI Events
803  */
804 
805 /*
806  * List of Events (target to host)
807  */
808 enum wmi_event_id {
809 	WMI_READY_EVENTID			= 0x1001,
810 	WMI_CONNECT_EVENTID			= 0x1002,
811 	WMI_DISCONNECT_EVENTID			= 0x1003,
812 	WMI_SCAN_COMPLETE_EVENTID		= 0x100a,
813 	WMI_REPORT_STATISTICS_EVENTID		= 0x100b,
814 	WMI_RD_MEM_RSP_EVENTID			= 0x1800,
815 	WMI_FW_READY_EVENTID			= 0x1801,
816 	WMI_EXIT_FAST_MEM_ACC_MODE_EVENTID	= 0x0200,
817 	WMI_ECHO_RSP_EVENTID			= 0x1803,
818 	WMI_FS_TUNE_DONE_EVENTID		= 0x180a,
819 	WMI_CORR_MEASURE_EVENTID		= 0x180b,
820 	WMI_READ_RSSI_EVENTID			= 0x180c,
821 	WMI_TEMP_SENSE_DONE_EVENTID		= 0x180e,
822 	WMI_DC_CALIB_DONE_EVENTID		= 0x180f,
823 	WMI_IQ_TX_CALIB_DONE_EVENTID		= 0x1811,
824 	WMI_IQ_RX_CALIB_DONE_EVENTID		= 0x1812,
825 	WMI_SET_WORK_MODE_DONE_EVENTID		= 0x1815,
826 	WMI_LO_LEAKAGE_CALIB_DONE_EVENTID	= 0x1816,
827 	WMI_MARLON_R_ACTIVATE_DONE_EVENTID	= 0x1817,
828 	WMI_MARLON_R_READ_DONE_EVENTID		= 0x1818,
829 	WMI_MARLON_R_WRITE_DONE_EVENTID		= 0x1819,
830 	WMI_MARLON_R_TXRX_SEL_DONE_EVENTID	= 0x181a,
831 	WMI_SILENT_RSSI_CALIB_DONE_EVENTID	= 0x181d,
832 	WMI_RF_RX_TEST_DONE_EVENTID		= 0x181e,
833 	WMI_CFG_RX_CHAIN_DONE_EVENTID		= 0x1820,
834 	WMI_VRING_CFG_DONE_EVENTID		= 0x1821,
835 	WMI_BA_STATUS_EVENTID			= 0x1823,
836 	WMI_RCP_ADDBA_REQ_EVENTID		= 0x1824,
837 	WMI_ADDBA_RESP_SENT_EVENTID		= 0x1825,
838 	WMI_DELBA_EVENTID			= 0x1826,
839 	WMI_GET_SSID_EVENTID			= 0x1828,
840 	WMI_GET_PCP_CHANNEL_EVENTID		= 0x182a,
841 	WMI_SW_TX_COMPLETE_EVENTID		= 0x182b,
842 
843 	WMI_READ_MAC_RXQ_EVENTID		= 0x1830,
844 	WMI_READ_MAC_TXQ_EVENTID		= 0x1831,
845 	WMI_WRITE_MAC_RXQ_EVENTID		= 0x1832,
846 	WMI_WRITE_MAC_TXQ_EVENTID		= 0x1833,
847 	WMI_WRITE_MAC_XQ_FIELD_EVENTID		= 0x1834,
848 
849 	WMI_BEAFORMING_MGMT_DONE_EVENTID	= 0x1836,
850 	WMI_BF_TXSS_MGMT_DONE_EVENTID		= 0x1837,
851 	WMI_BF_RXSS_MGMT_DONE_EVENTID		= 0x1839,
852 	WMI_RS_MGMT_DONE_EVENTID		= 0x1852,
853 	WMI_RF_MGMT_STATUS_EVENTID		= 0x1853,
854 	WMI_BF_SM_MGMT_DONE_EVENTID		= 0x1838,
855 	WMI_RX_MGMT_PACKET_EVENTID		= 0x1840,
856 	WMI_TX_MGMT_PACKET_EVENTID		= 0x1841,
857 
858 	/* Performance monitoring events */
859 	WMI_DATA_PORT_OPEN_EVENTID		= 0x1860,
860 	WMI_WBE_LINKDOWN_EVENTID		= 0x1861,
861 
862 	WMI_BF_CTRL_DONE_EVENTID		= 0x1862,
863 	WMI_NOTIFY_REQ_DONE_EVENTID		= 0x1863,
864 	WMI_GET_STATUS_DONE_EVENTID		= 0x1864,
865 
866 	WMI_UNIT_TEST_EVENTID			= 0x1900,
867 	WMI_FLASH_READ_DONE_EVENTID		= 0x1902,
868 	WMI_FLASH_WRITE_DONE_EVENTID		= 0x1903,
869 	/*P2P*/
870 	WMI_PORT_ALLOCATED_EVENTID		= 0x1911,
871 	WMI_PORT_DELETED_EVENTID		= 0x1912,
872 	WMI_LISTEN_STARTED_EVENTID		= 0x1914,
873 	WMI_SEARCH_STARTED_EVENTID		= 0x1915,
874 	WMI_DISCOVERY_STARTED_EVENTID		= 0x1916,
875 	WMI_DISCOVERY_STOPPED_EVENTID		= 0x1917,
876 	WMI_PCP_STARTED_EVENTID			= 0x1918,
877 	WMI_PCP_STOPPED_EVENTID			= 0x1919,
878 	WMI_PCP_FACTOR_EVENTID			= 0x191a,
879 	WMI_SET_CHANNEL_EVENTID			= 0x9000,
880 	WMI_ASSOC_REQ_EVENTID			= 0x9001,
881 	WMI_EAPOL_RX_EVENTID			= 0x9002,
882 	WMI_MAC_ADDR_RESP_EVENTID		= 0x9003,
883 	WMI_FW_VER_EVENTID			= 0x9004,
884 };
885 
886 /*
887  * Events data structures
888  */
889 
890 
891 enum wmi_fw_status {
892 	WMI_FW_STATUS_SUCCESS,
893 	WMI_FW_STATUS_FAILURE,
894 };
895 
896 /*
897  * WMI_RF_MGMT_STATUS_EVENTID
898  */
899 enum wmi_rf_status {
900 	WMI_RF_ENABLED			= 0,
901 	WMI_RF_DISABLED_HW		= 1,
902 	WMI_RF_DISABLED_SW		= 2,
903 	WMI_RF_DISABLED_HW_SW		= 3,
904 };
905 
906 struct wmi_rf_mgmt_status_event {
907 	__le32 rf_status;
908 } __packed;
909 
910 /*
911  * WMI_GET_STATUS_DONE_EVENTID
912  */
913 struct wmi_get_status_done_event {
914 	__le32 is_associated;
915 	u8 cid;
916 	u8 reserved0[3];
917 	u8 bssid[WMI_MAC_LEN];
918 	u8 channel;
919 	u8 reserved1;
920 	u8 network_type;
921 	u8 reserved2[3];
922 	__le32 ssid_len;
923 	u8 ssid[WMI_MAX_SSID_LEN];
924 	__le32 rf_status;
925 	__le32 is_secured;
926 } __packed;
927 
928 /*
929  * WMI_FW_VER_EVENTID
930  */
931 struct wmi_fw_ver_event {
932 	u8 major;
933 	u8 minor;
934 	__le16 subminor;
935 	__le16 build;
936 } __packed;
937 
938 /*
939 * WMI_MAC_ADDR_RESP_EVENTID
940 */
941 struct wmi_mac_addr_resp_event {
942 	u8 mac[WMI_MAC_LEN];
943 	u8 auth_mode;
944 	u8 crypt_mode;
945 	__le32 offload_mode;
946 } __packed;
947 
948 /*
949 * WMI_EAPOL_RX_EVENTID
950 */
951 struct wmi_eapol_rx_event {
952 	u8 src_mac[WMI_MAC_LEN];
953 	__le16 eapol_len;
954 	u8 eapol[0];
955 } __packed;
956 
957 /*
958 * WMI_READY_EVENTID
959 */
960 enum wmi_phy_capability {
961 	WMI_11A_CAPABILITY		= 1,
962 	WMI_11G_CAPABILITY		= 2,
963 	WMI_11AG_CAPABILITY		= 3,
964 	WMI_11NA_CAPABILITY		= 4,
965 	WMI_11NG_CAPABILITY		= 5,
966 	WMI_11NAG_CAPABILITY		= 6,
967 	WMI_11AD_CAPABILITY		= 7,
968 	WMI_11N_CAPABILITY_OFFSET = WMI_11NA_CAPABILITY - WMI_11A_CAPABILITY,
969 };
970 
971 struct wmi_ready_event {
972 	__le32 sw_version;
973 	__le32 abi_version;
974 	u8 mac[WMI_MAC_LEN];
975 	u8 phy_capability;		/* enum wmi_phy_capability */
976 	u8 numof_additional_mids;
977 } __packed;
978 
979 /*
980  * WMI_NOTIFY_REQ_DONE_EVENTID
981  */
982 struct wmi_notify_req_done_event {
983 	__le32 status;
984 	__le64 tsf;
985 	__le32 snr_val;
986 	__le32 tx_tpt;
987 	__le32 tx_goodput;
988 	__le32 rx_goodput;
989 	__le16 bf_mcs;
990 	__le16 my_rx_sector;
991 	__le16 my_tx_sector;
992 	__le16 other_rx_sector;
993 	__le16 other_tx_sector;
994 	__le16 range;
995 	u8 sqi;
996 	u8 reserved[3];
997 } __packed;
998 
999 /*
1000  * WMI_CONNECT_EVENTID
1001  */
1002 struct wmi_connect_event {
1003 	u8 channel;
1004 	u8 reserved0;
1005 	u8 bssid[WMI_MAC_LEN];
1006 	__le16 listen_interval;
1007 	__le16 beacon_interval;
1008 	u8 network_type;
1009 	u8 reserved1[3];
1010 	u8 beacon_ie_len;
1011 	u8 assoc_req_len;
1012 	u8 assoc_resp_len;
1013 	u8 cid;
1014 	u8 reserved2[3];
1015 	u8 assoc_info[0];
1016 } __packed;
1017 
1018 /*
1019  * WMI_DISCONNECT_EVENTID
1020  */
1021 enum wmi_disconnect_reason {
1022 	WMI_DIS_REASON_NO_NETWORK_AVAIL		= 1,
1023 	WMI_DIS_REASON_LOST_LINK		= 2, /* bmiss */
1024 	WMI_DIS_REASON_DISCONNECT_CMD		= 3,
1025 	WMI_DIS_REASON_BSS_DISCONNECTED		= 4,
1026 	WMI_DIS_REASON_AUTH_FAILED		= 5,
1027 	WMI_DIS_REASON_ASSOC_FAILED		= 6,
1028 	WMI_DIS_REASON_NO_RESOURCES_AVAIL	= 7,
1029 	WMI_DIS_REASON_CSERV_DISCONNECT		= 8,
1030 	WMI_DIS_REASON_INVALID_PROFILE		= 10,
1031 	WMI_DIS_REASON_DOT11H_CHANNEL_SWITCH	= 11,
1032 	WMI_DIS_REASON_PROFILE_MISMATCH		= 12,
1033 	WMI_DIS_REASON_CONNECTION_EVICTED	= 13,
1034 	WMI_DIS_REASON_IBSS_MERGE		= 14,
1035 };
1036 
1037 struct wmi_disconnect_event {
1038 	__le16 protocol_reason_status;	/* reason code, see 802.11 spec. */
1039 	u8 bssid[WMI_MAC_LEN];		/* set if known */
1040 	u8 disconnect_reason;		/* see wmi_disconnect_reason */
1041 	u8 assoc_resp_len;		/* not in use */
1042 	u8 assoc_info[0];		/* not in use */
1043 } __packed;
1044 
1045 /*
1046  * WMI_SCAN_COMPLETE_EVENTID
1047  */
1048 enum scan_status {
1049 	WMI_SCAN_SUCCESS	= 0,
1050 	WMI_SCAN_FAILED		= 1,
1051 	WMI_SCAN_ABORTED	= 2,
1052 	WMI_SCAN_REJECTED	= 3,
1053 };
1054 
1055 struct wmi_scan_complete_event {
1056 	__le32 status;	/* scan_status */
1057 } __packed;
1058 
1059 /*
1060  * WMI_BA_STATUS_EVENTID
1061  */
1062 enum wmi_vring_ba_status {
1063 	WMI_BA_AGREED			= 0,
1064 	WMI_BA_NON_AGREED		= 1,
1065 };
1066 
1067 struct wmi_vring_ba_status_event {
1068 	__le16 status;
1069 	u8 reserved[2];
1070 	u8 ringid;
1071 	u8 agg_wsize;
1072 	__le16 ba_timeout;
1073 } __packed;
1074 
1075 /*
1076  * WMI_DELBA_EVENTID
1077  */
1078 struct wmi_delba_event {
1079 	u8 cidxtid;
1080 	u8 from_initiator;
1081 	__le16 reason;
1082 } __packed;
1083 
1084 
1085 /*
1086  * WMI_VRING_CFG_DONE_EVENTID
1087  */
1088 struct wmi_vring_cfg_done_event {
1089 	u8 ringid;
1090 	u8 status;
1091 	u8 reserved[2];
1092 	__le32 tx_vring_tail_ptr;
1093 } __packed;
1094 
1095 /*
1096  * WMI_ADDBA_RESP_SENT_EVENTID
1097  */
1098 struct wmi_rcp_addba_resp_sent_event {
1099 	u8 cidxtid;
1100 	u8 reserved;
1101 	__le16 status;
1102 } __packed;
1103 
1104 /*
1105  * WMI_RCP_ADDBA_REQ_EVENTID
1106  */
1107 struct wmi_rcp_addba_req_event {
1108 	u8 cidxtid;
1109 	u8 dialog_token;
1110 	__le16 ba_param_set;	/* ieee80211_ba_parameterset as it received */
1111 	__le16 ba_timeout;
1112 	__le16 ba_seq_ctrl;	/* ieee80211_ba_seqstrl field as it received */
1113 } __packed;
1114 
1115 /*
1116  * WMI_CFG_RX_CHAIN_DONE_EVENTID
1117  */
1118 enum wmi_cfg_rx_chain_done_event_status {
1119 	WMI_CFG_RX_CHAIN_SUCCESS	= 1,
1120 };
1121 
1122 struct wmi_cfg_rx_chain_done_event {
1123 	__le32 rx_ring_tail_ptr;	/* Rx V-Ring Tail pointer */
1124 	__le32 status;
1125 } __packed;
1126 
1127 /*
1128  * WMI_WBE_LINKDOWN_EVENTID
1129  */
1130 enum wmi_wbe_link_down_event_reason {
1131 	WMI_WBE_REASON_USER_REQUEST	= 0,
1132 	WMI_WBE_REASON_RX_DISASSOC	= 1,
1133 	WMI_WBE_REASON_BAD_PHY_LINK	= 2,
1134 };
1135 
1136 struct wmi_wbe_link_down_event {
1137 	u8 cid;
1138 	u8 reserved[3];
1139 	__le32 reason;
1140 } __packed;
1141 
1142 /*
1143  * WMI_DATA_PORT_OPEN_EVENTID
1144  */
1145 struct wmi_data_port_open_event {
1146 	u8 cid;
1147 	u8 reserved[3];
1148 } __packed;
1149 
1150 
1151 /*
1152  * WMI_GET_PCP_CHANNEL_EVENTID
1153  */
1154 struct wmi_get_pcp_channel_event {
1155 	u8 channel;
1156 	u8 reserved[3];
1157 } __packed;
1158 
1159 
1160 /*
1161 * WMI_PORT_ALLOCATED_EVENTID
1162 */
1163 struct wmi_port_allocated_event {
1164 	u8 status;	/* wmi_fw_status */
1165 	u8 reserved[3];
1166 } __packed;
1167 
1168 /*
1169 * WMI_PORT_DELETED_EVENTID
1170 */
1171 struct wmi_port_deleted_event {
1172 	u8 status;	/* wmi_fw_status */
1173 	u8 reserved[3];
1174 } __packed;
1175 
1176 /*
1177  * WMI_LISTEN_STARTED_EVENTID
1178  */
1179 struct wmi_listen_started_event {
1180 	u8 status;	/* wmi_fw_status */
1181 	u8 reserved[3];
1182 } __packed;
1183 
1184 /*
1185  * WMI_SEARCH_STARTED_EVENTID
1186  */
1187 struct wmi_search_started_event {
1188 	u8 status;	/* wmi_fw_status */
1189 	u8 reserved[3];
1190 } __packed;
1191 
1192 /*
1193  * WMI_PCP_STARTED_EVENTID
1194  */
1195 struct wmi_pcp_started_event {
1196 	u8 status;	/* wmi_fw_status */
1197 	u8 reserved[3];
1198 } __packed;
1199 
1200 /*
1201  * WMI_PCP_FACTOR_EVENTID
1202  */
1203 struct wmi_pcp_factor_event {
1204 	__le32 pcp_factor;
1205 } __packed;
1206 
1207 /*
1208  * WMI_SW_TX_COMPLETE_EVENTID
1209  */
1210 enum wmi_sw_tx_status {
1211 	WMI_TX_SW_STATUS_SUCCESS		= 0,
1212 	WMI_TX_SW_STATUS_FAILED_NO_RESOURCES	= 1,
1213 	WMI_TX_SW_STATUS_FAILED_TX		= 2,
1214 };
1215 
1216 struct wmi_sw_tx_complete_event {
1217 	u8 status;	/* enum wmi_sw_tx_status */
1218 	u8 reserved[3];
1219 } __packed;
1220 
1221 /*
1222  * WMI_CORR_MEASURE_EVENTID
1223  */
1224 struct wmi_corr_measure_event {
1225 	s32 i;
1226 	s32 q;
1227 	s32 image_i;
1228 	s32 image_q;
1229 } __packed;
1230 
1231 /*
1232  * WMI_READ_RSSI_EVENTID
1233  */
1234 struct wmi_read_rssi_event {
1235 	__le32 ina_rssi_adc_dbm;
1236 } __packed;
1237 
1238 /*
1239  * WMI_GET_SSID_EVENTID
1240  */
1241 struct wmi_get_ssid_event {
1242 	__le32 ssid_len;
1243 	u8 ssid[WMI_MAX_SSID_LEN];
1244 } __packed;
1245 
1246 /*
1247  * WMI_RX_MGMT_PACKET_EVENTID
1248  */
1249 struct wmi_rx_mgmt_info {
1250 	u8 mcs;
1251 	s8 snr;
1252 	u8 range;
1253 	u8 sqi;
1254 	__le16 stype;
1255 	__le16 status;
1256 	__le32 len;
1257 	u8 qid;
1258 	u8 mid;
1259 	u8 cid;
1260 	u8 channel;	/* From Radio MNGR */
1261 } __packed;
1262 
1263 
1264 /*
1265  * WMI_TX_MGMT_PACKET_EVENTID
1266  */
1267 struct wmi_tx_mgmt_packet_event {
1268 	u8 payload[0];
1269 } __packed;
1270 
1271 struct wmi_rx_mgmt_packet_event {
1272 	struct wmi_rx_mgmt_info info;
1273 	u8 payload[0];
1274 } __packed;
1275 
1276 /*
1277  * WMI_ECHO_RSP_EVENTID
1278  */
1279 struct wmi_echo_event {
1280 	__le32 echoed_value;
1281 } __packed;
1282 
1283 /*
1284  * WMI_TEMP_SENSE_DONE_EVENTID
1285  *
1286  * Measure MAC and radio temperatures
1287  */
1288 struct wmi_temp_sense_done_event {
1289 	__le32 marlon_m_t1000;
1290 	__le32 marlon_r_t1000;
1291 } __packed;
1292 
1293 #endif /* __WILOCITY_WMI_H__ */
1294