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 
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  * WMI_RECONNECT_CMDID
224  */
225 struct wmi_reconnect_cmd {
226 	u8 channel;			/* hint */
227 	u8 reserved;
228 	u8 bssid[WMI_MAC_LEN];		/* mandatory if set */
229 } __packed;
230 
231 
232 /*
233  * WMI_SET_PMK_CMDID
234  */
235 
236 #define WMI_MIN_KEY_INDEX	(0)
237 #define WMI_MAX_KEY_INDEX	(3)
238 #define WMI_MAX_KEY_LEN		(32)
239 #define WMI_PASSPHRASE_LEN	(64)
240 #define WMI_PMK_LEN		(32)
241 
242 struct  wmi_set_pmk_cmd {
243 	u8 pmk[WMI_PMK_LEN];
244 } __packed;
245 
246 
247 /*
248  * WMI_SET_PASSPHRASE_CMDID
249  */
250 struct wmi_set_passphrase_cmd {
251 	u8 ssid[WMI_MAX_SSID_LEN];
252 	u8 passphrase[WMI_PASSPHRASE_LEN];
253 	u8 ssid_len;
254 	u8 passphrase_len;
255 } __packed;
256 
257 /*
258  * WMI_ADD_CIPHER_KEY_CMDID
259  */
260 enum wmi_key_usage {
261 	WMI_KEY_USE_PAIRWISE	= 0,
262 	WMI_KEY_USE_GROUP	= 1,
263 	WMI_KEY_USE_TX		= 2,  /* default Tx Key - Static WEP only */
264 };
265 
266 struct wmi_add_cipher_key_cmd {
267 	u8 key_index;
268 	u8 key_type;
269 	u8 key_usage;		/* enum wmi_key_usage */
270 	u8 key_len;
271 	u8 key_rsc[8];		/* key replay sequence counter */
272 	u8 key[WMI_MAX_KEY_LEN];
273 	u8 key_op_ctrl;		/* Additional Key Control information */
274 	u8 mac[WMI_MAC_LEN];
275 } __packed;
276 
277 /*
278  * WMI_DELETE_CIPHER_KEY_CMDID
279  */
280 struct wmi_delete_cipher_key_cmd {
281 	u8 key_index;
282 	u8 mac[WMI_MAC_LEN];
283 } __packed;
284 
285 
286 /*
287  * WMI_START_SCAN_CMDID
288  *
289  * Start L1 scan operation
290  *
291  * Returned events:
292  * - WMI_RX_MGMT_PACKET_EVENTID - for every probe resp.
293  * - WMI_SCAN_COMPLETE_EVENTID
294  */
295 enum wmi_scan_type {
296 	WMI_LONG_SCAN		= 0,
297 	WMI_SHORT_SCAN		= 1,
298 	WMI_PBC_SCAN		= 2,
299 };
300 
301 struct wmi_start_scan_cmd {
302 	u8 reserved[8];
303 
304 	__le32 home_dwell_time;	/* Max duration in the home channel(ms) */
305 	__le32 force_scan_interval;	/* Time interval between scans (ms)*/
306 	u8 scan_type;		/* wmi_scan_type */
307 	u8 num_channels;		/* how many channels follow */
308 	struct {
309 		u8 channel;
310 		u8 reserved;
311 	} channel_list[0];	/* channels ID's */
312 				/* 0 - 58320 MHz */
313 				/* 1 - 60480 MHz */
314 				/* 2 - 62640 MHz */
315 } __packed;
316 
317 /*
318  * WMI_SET_PROBED_SSID_CMDID
319  */
320 #define MAX_PROBED_SSID_INDEX	(3)
321 
322 enum wmi_ssid_flag {
323 	WMI_SSID_FLAG_DISABLE	= 0,	/* disables entry */
324 	WMI_SSID_FLAG_SPECIFIC	= 1,	/* probes specified ssid */
325 	WMI_SSID_FLAG_ANY	= 2,	/* probes for any ssid */
326 };
327 
328 struct wmi_probed_ssid_cmd {
329 	u8 entry_index;			/* 0 to MAX_PROBED_SSID_INDEX */
330 	u8 flag;			/* enum wmi_ssid_flag */
331 	u8 ssid_len;
332 	u8 ssid[WMI_MAX_SSID_LEN];
333 } __packed;
334 
335 /*
336  * WMI_SET_APPIE_CMDID
337  * Add Application specified IE to a management frame
338  */
339 #define WMI_MAX_IE_LEN		(1024)
340 
341 /*
342  * Frame Types
343  */
344 enum wmi_mgmt_frame_type {
345 	WMI_FRAME_BEACON	= 0,
346 	WMI_FRAME_PROBE_REQ	= 1,
347 	WMI_FRAME_PROBE_RESP	= 2,
348 	WMI_FRAME_ASSOC_REQ	= 3,
349 	WMI_FRAME_ASSOC_RESP	= 4,
350 	WMI_NUM_MGMT_FRAME,
351 };
352 
353 struct wmi_set_appie_cmd {
354 	u8 mgmt_frm_type;	/* enum wmi_mgmt_frame_type */
355 	u8 reserved;
356 	__le16 ie_len;	/* Length of the IE to be added to MGMT frame */
357 	u8 ie_info[0];
358 } __packed;
359 
360 
361 /*
362  * WMI_PXMT_RANGE_CFG_CMDID
363  */
364 struct wmi_pxmt_range_cfg_cmd {
365 	u8 dst_mac[WMI_MAC_LEN];
366 	__le16 range;
367 } __packed;
368 
369 /*
370  * WMI_PXMT_SNR2_RANGE_CFG_CMDID
371  */
372 struct wmi_pxmt_snr2_range_cfg_cmd {
373 	s8 snr2range_arr[WMI_PROX_RANGE_NUM-1];
374 } __packed;
375 
376 /*
377  * WMI_RF_MGMT_CMDID
378  */
379 enum wmi_rf_mgmt_type {
380 	WMI_RF_MGMT_W_DISABLE	= 0,
381 	WMI_RF_MGMT_W_ENABLE	= 1,
382 	WMI_RF_MGMT_GET_STATUS	= 2,
383 };
384 
385 struct wmi_rf_mgmt_cmd {
386 	__le32 rf_mgmt_type;
387 } __packed;
388 
389 
390 /*
391  * WMI_RF_RX_TEST_CMDID
392  */
393 struct wmi_rf_rx_test_cmd {
394 	__le32 sector;
395 } __packed;
396 
397 /*
398  * WMI_CORR_MEASURE_CMDID
399  */
400 struct wmi_corr_measure_cmd {
401 	s32 freq_mhz;
402 	__le32 length_samples;
403 	__le32 iterations;
404 } __packed;
405 
406 /*
407  * WMI_SET_SSID_CMDID
408  */
409 struct wmi_set_ssid_cmd {
410 	__le32 ssid_len;
411 	u8 ssid[WMI_MAX_SSID_LEN];
412 } __packed;
413 
414 /*
415  * WMI_SET_PCP_CHANNEL_CMDID
416  */
417 struct wmi_set_pcp_channel_cmd {
418 	u8 channel;
419 	u8 reserved[3];
420 } __packed;
421 
422 /*
423  * WMI_BCON_CTRL_CMDID
424  */
425 struct wmi_bcon_ctrl_cmd {
426 	__le16 bcon_interval;
427 	__le16 frag_num;
428 	__le64 ss_mask;
429 	u8 network_type;
430 	u8 reserved;
431 	u8 disable_sec_offload;
432 	u8 disable_sec;
433 } __packed;
434 
435 
436 /******* P2P ***********/
437 
438 /*
439  * WMI_PORT_ALLOCATE_CMDID
440  */
441 enum wmi_port_role {
442 	WMI_PORT_STA		= 0,
443 	WMI_PORT_PCP		= 1,
444 	WMI_PORT_AP		= 2,
445 	WMI_PORT_P2P_DEV	= 3,
446 	WMI_PORT_P2P_CLIENT	= 4,
447 	WMI_PORT_P2P_GO		= 5,
448 };
449 
450 struct wmi_port_allocate_cmd {
451 	u8 mac[WMI_MAC_LEN];
452 	u8 port_role;
453 	u8 midid;
454 } __packed;
455 
456 /*
457  * WMI_PORT_DELETE_CMDID
458  */
459 struct wmi_delete_port_cmd {
460 	u8 mid;
461 	u8 reserved[3];
462 } __packed;
463 
464 /*
465  * WMI_P2P_CFG_CMDID
466  */
467 enum wmi_discovery_mode {
468 	WMI_DISCOVERY_MODE_NON_OFFLOAD	= 0,
469 	WMI_DISCOVERY_MODE_OFFLOAD	= 1,
470 };
471 
472 struct wmi_p2p_cfg_cmd {
473 	u8 discovery_mode;	/* wmi_discovery_mode */
474 	u8 channel;
475 	__le16 bcon_interval; /* base to listen/search duration calculation */
476 } __packed;
477 
478 /*
479  * WMI_POWER_MGMT_CFG_CMDID
480  */
481 enum wmi_power_source_type {
482 	WMI_POWER_SOURCE_BATTERY	= 0,
483 	WMI_POWER_SOURCE_OTHER		= 1,
484 };
485 
486 struct wmi_power_mgmt_cfg_cmd {
487 	u8 power_source;	/* wmi_power_source_type */
488 	u8 reserved[3];
489 } __packed;
490 
491 /*
492  * WMI_PCP_START_CMDID
493  */
494 struct wmi_pcp_start_cmd {
495 	__le16 bcon_interval;
496 	u8 reserved0[10];
497 	u8 network_type;
498 	u8 channel;
499 	u8 disable_sec_offload;
500 	u8 disable_sec;
501 } __packed;
502 
503 /*
504  * WMI_SW_TX_REQ_CMDID
505  */
506 struct wmi_sw_tx_req_cmd {
507 	u8 dst_mac[WMI_MAC_LEN];
508 	__le16 len;
509 	u8 payload[0];
510 } __packed;
511 
512 /*
513  * WMI_VRING_CFG_CMDID
514  */
515 
516 struct wmi_sw_ring_cfg {
517 	__le64 ring_mem_base;
518 	__le16 ring_size;
519 	__le16 max_mpdu_size;
520 } __packed;
521 
522 struct wmi_vring_cfg_schd {
523 	__le16 priority;
524 	__le16 timeslot_us;
525 } __packed;
526 
527 enum wmi_vring_cfg_encap_trans_type {
528 	WMI_VRING_ENC_TYPE_802_3		= 0,
529 	WMI_VRING_ENC_TYPE_NATIVE_WIFI		= 1,
530 };
531 
532 enum wmi_vring_cfg_ds_cfg {
533 	WMI_VRING_DS_PBSS			= 0,
534 	WMI_VRING_DS_STATION			= 1,
535 	WMI_VRING_DS_AP				= 2,
536 	WMI_VRING_DS_ADDR4			= 3,
537 };
538 
539 enum wmi_vring_cfg_nwifi_ds_trans_type {
540 	WMI_NWIFI_TX_TRANS_MODE_NO		= 0,
541 	WMI_NWIFI_TX_TRANS_MODE_AP2PBSS		= 1,
542 	WMI_NWIFI_TX_TRANS_MODE_STA2PBSS	= 2,
543 };
544 
545 enum wmi_vring_cfg_schd_params_priority {
546 	WMI_SCH_PRIO_REGULAR			= 0,
547 	WMI_SCH_PRIO_HIGH			= 1,
548 };
549 
550 #define CIDXTID_CID_POS (0)
551 #define CIDXTID_CID_LEN (4)
552 #define CIDXTID_CID_MSK (0xF)
553 #define CIDXTID_TID_POS (4)
554 #define CIDXTID_TID_LEN (4)
555 #define CIDXTID_TID_MSK (0xF0)
556 
557 struct wmi_vring_cfg {
558 	struct wmi_sw_ring_cfg tx_sw_ring;
559 	u8 ringid;				/* 0-23 vrings */
560 
561 	u8 cidxtid;
562 
563 	u8 encap_trans_type;
564 	u8 ds_cfg;				/* 802.3 DS cfg */
565 	u8 nwifi_ds_trans_type;
566 
567 	#define VRING_CFG_MAC_CTRL_LIFETIME_EN_POS (0)
568 	#define VRING_CFG_MAC_CTRL_LIFETIME_EN_LEN (1)
569 	#define VRING_CFG_MAC_CTRL_LIFETIME_EN_MSK (0x1)
570 	#define VRING_CFG_MAC_CTRL_AGGR_EN_POS (1)
571 	#define VRING_CFG_MAC_CTRL_AGGR_EN_LEN (1)
572 	#define VRING_CFG_MAC_CTRL_AGGR_EN_MSK (0x2)
573 	u8 mac_ctrl;
574 
575 	#define VRING_CFG_TO_RESOLUTION_VALUE_POS (0)
576 	#define VRING_CFG_TO_RESOLUTION_VALUE_LEN (6)
577 	#define VRING_CFG_TO_RESOLUTION_VALUE_MSK (0x3F)
578 	u8 to_resolution;
579 	u8 agg_max_wsize;
580 	struct wmi_vring_cfg_schd schd_params;
581 } __packed;
582 
583 enum wmi_vring_cfg_cmd_action {
584 	WMI_VRING_CMD_ADD			= 0,
585 	WMI_VRING_CMD_MODIFY			= 1,
586 	WMI_VRING_CMD_DELETE			= 2,
587 };
588 
589 struct wmi_vring_cfg_cmd {
590 	__le32 action;
591 	struct wmi_vring_cfg vring_cfg;
592 } __packed;
593 
594 /*
595  * WMI_VRING_BA_EN_CMDID
596  */
597 struct wmi_vring_ba_en_cmd {
598 	u8 ringid;
599 	u8 agg_max_wsize;
600 	__le16 ba_timeout;
601 } __packed;
602 
603 /*
604  * WMI_VRING_BA_DIS_CMDID
605  */
606 struct wmi_vring_ba_dis_cmd {
607 	u8 ringid;
608 	u8 reserved;
609 	__le16 reason;
610 } __packed;
611 
612 /*
613  * WMI_NOTIFY_REQ_CMDID
614  */
615 struct wmi_notify_req_cmd {
616 	u8 cid;
617 	u8 year;
618 	u8 month;
619 	u8 day;
620 	__le32 interval_usec;
621 	u8 hour;
622 	u8 minute;
623 	u8 second;
624 	u8 miliseconds;
625 } __packed;
626 
627 /*
628  * WMI_CFG_RX_CHAIN_CMDID
629  */
630 enum wmi_sniffer_cfg_mode {
631 	WMI_SNIFFER_OFF				= 0,
632 	WMI_SNIFFER_ON				= 1,
633 };
634 
635 enum wmi_sniffer_cfg_phy_info_mode {
636 	WMI_SNIFFER_PHY_INFO_DISABLED		= 0,
637 	WMI_SNIFFER_PHY_INFO_ENABLED		= 1,
638 };
639 
640 enum wmi_sniffer_cfg_phy_support {
641 	WMI_SNIFFER_CP				= 0,
642 	WMI_SNIFFER_DP				= 1,
643 	WMI_SNIFFER_BOTH_PHYS			= 2,
644 };
645 
646 struct wmi_sniffer_cfg {
647 	__le32 mode;		/* enum wmi_sniffer_cfg_mode */
648 	__le32 phy_info_mode;	/* enum wmi_sniffer_cfg_phy_info_mode */
649 	__le32 phy_support;	/* enum wmi_sniffer_cfg_phy_support */
650 	u8 channel;
651 	u8 reserved[3];
652 } __packed;
653 
654 enum wmi_cfg_rx_chain_cmd_action {
655 	WMI_RX_CHAIN_ADD			= 0,
656 	WMI_RX_CHAIN_DEL			= 1,
657 };
658 
659 enum wmi_cfg_rx_chain_cmd_decap_trans_type {
660 	WMI_DECAP_TYPE_802_3			= 0,
661 	WMI_DECAP_TYPE_NATIVE_WIFI		= 1,
662 };
663 
664 enum wmi_cfg_rx_chain_cmd_nwifi_ds_trans_type {
665 	WMI_NWIFI_RX_TRANS_MODE_NO		= 0,
666 	WMI_NWIFI_RX_TRANS_MODE_PBSS2AP		= 1,
667 	WMI_NWIFI_RX_TRANS_MODE_PBSS2STA	= 2,
668 };
669 
670 enum wmi_cfg_rx_chain_cmd_reorder_type {
671 	WMI_RX_HW_REORDER = 0,
672 	WMI_RX_SW_REORDER = 1,
673 };
674 
675 struct wmi_cfg_rx_chain_cmd {
676 	__le32 action;
677 	struct wmi_sw_ring_cfg rx_sw_ring;
678 	u8 mid;
679 	u8 decap_trans_type;
680 
681 	#define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_POS (0)
682 	#define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_LEN (1)
683 	#define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_MSK (0x1)
684 	u8 l2_802_3_offload_ctrl;
685 
686 	#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_POS (0)
687 	#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_LEN (1)
688 	#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_MSK (0x1)
689 	#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_POS (1)
690 	#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_LEN (1)
691 	#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_MSK (0x2)
692 	u8 l2_nwifi_offload_ctrl;
693 
694 	u8 vlan_id;
695 	u8 nwifi_ds_trans_type;
696 
697 	#define L3_L4_CTRL_IPV4_CHECKSUM_EN_POS (0)
698 	#define L3_L4_CTRL_IPV4_CHECKSUM_EN_LEN (1)
699 	#define L3_L4_CTRL_IPV4_CHECKSUM_EN_MSK (0x1)
700 	#define L3_L4_CTRL_TCPIP_CHECKSUM_EN_POS (1)
701 	#define L3_L4_CTRL_TCPIP_CHECKSUM_EN_LEN (1)
702 	#define L3_L4_CTRL_TCPIP_CHECKSUM_EN_MSK (0x2)
703 	u8 l3_l4_ctrl;
704 
705 	#define RING_CTRL_OVERRIDE_PREFETCH_THRSH_POS (0)
706 	#define RING_CTRL_OVERRIDE_PREFETCH_THRSH_LEN (1)
707 	#define RING_CTRL_OVERRIDE_PREFETCH_THRSH_MSK (0x1)
708 	#define RING_CTRL_OVERRIDE_WB_THRSH_POS (1)
709 	#define RING_CTRL_OVERRIDE_WB_THRSH_LEN (1)
710 	#define RING_CTRL_OVERRIDE_WB_THRSH_MSK (0x2)
711 	#define RING_CTRL_OVERRIDE_ITR_THRSH_POS (2)
712 	#define RING_CTRL_OVERRIDE_ITR_THRSH_LEN (1)
713 	#define RING_CTRL_OVERRIDE_ITR_THRSH_MSK (0x4)
714 	#define RING_CTRL_OVERRIDE_HOST_THRSH_POS (3)
715 	#define RING_CTRL_OVERRIDE_HOST_THRSH_LEN (1)
716 	#define RING_CTRL_OVERRIDE_HOST_THRSH_MSK (0x8)
717 	u8 ring_ctrl;
718 
719 	__le16 prefetch_thrsh;
720 	__le16 wb_thrsh;
721 	__le32 itr_value;
722 	__le16 host_thrsh;
723 	u8 reorder_type;
724 	u8 reserved;
725 	struct wmi_sniffer_cfg sniffer_cfg;
726 } __packed;
727 
728 /*
729  * WMI_RCP_ADDBA_RESP_CMDID
730  */
731 struct wmi_rcp_addba_resp_cmd {
732 	u8 cidxtid;
733 	u8 dialog_token;
734 	__le16 status_code;
735 	__le16 ba_param_set;	/* ieee80211_ba_parameterset field to send */
736 	__le16 ba_timeout;
737 } __packed;
738 
739 /*
740  * WMI_RCP_DELBA_CMDID
741  */
742 struct wmi_rcp_delba_cmd {
743 	u8 cidxtid;
744 	u8 reserved;
745 	__le16 reason;
746 } __packed;
747 
748 /*
749  * WMI_RCP_ADDBA_REQ_CMDID
750  */
751 struct wmi_rcp_addba_req_cmd {
752 	u8 cidxtid;
753 	u8 dialog_token;
754 	/* ieee80211_ba_parameterset field as it received */
755 	__le16 ba_param_set;
756 	__le16 ba_timeout;
757 	/* ieee80211_ba_seqstrl field as it received */
758 	__le16 ba_seq_ctrl;
759 } __packed;
760 
761 /*
762  * WMI_SET_MAC_ADDRESS_CMDID
763  */
764 struct wmi_set_mac_address_cmd {
765 	u8 mac[WMI_MAC_LEN];
766 	u8 reserved[2];
767 } __packed;
768 
769 /*
770 * WMI_EAPOL_TX_CMDID
771 */
772 struct wmi_eapol_tx_cmd {
773 	u8 dst_mac[WMI_MAC_LEN];
774 	__le16 eapol_len;
775 	u8 eapol[0];
776 } __packed;
777 
778 /*
779  * WMI_ECHO_CMDID
780  *
781  * Check FW is alive
782  *
783  * WMI_DEEP_ECHO_CMDID
784  *
785  * Check FW and ucode are alive
786  *
787  * Returned event: WMI_ECHO_RSP_EVENTID
788  * same event for both commands
789  */
790 struct wmi_echo_cmd {
791 	__le32 value;
792 } __packed;
793 
794 /*
795  * WMI_TEMP_SENSE_CMDID
796  *
797  * Measure MAC and radio temperatures
798  */
799 struct wmi_temp_sense_cmd {
800 	__le32 measure_marlon_m_en;
801 	__le32 measure_marlon_r_en;
802 } __packed;
803 
804 
805 /*
806  * WMI Events
807  */
808 
809 /*
810  * List of Events (target to host)
811  */
812 enum wmi_event_id {
813 	WMI_READY_EVENTID			= 0x1001,
814 	WMI_CONNECT_EVENTID			= 0x1002,
815 	WMI_DISCONNECT_EVENTID			= 0x1003,
816 	WMI_SCAN_COMPLETE_EVENTID		= 0x100a,
817 	WMI_REPORT_STATISTICS_EVENTID		= 0x100b,
818 	WMI_RD_MEM_RSP_EVENTID			= 0x1800,
819 	WMI_FW_READY_EVENTID			= 0x1801,
820 	WMI_EXIT_FAST_MEM_ACC_MODE_EVENTID	= 0x0200,
821 	WMI_ECHO_RSP_EVENTID			= 0x1803,
822 	WMI_FS_TUNE_DONE_EVENTID		= 0x180a,
823 	WMI_CORR_MEASURE_EVENTID		= 0x180b,
824 	WMI_READ_RSSI_EVENTID			= 0x180c,
825 	WMI_TEMP_SENSE_DONE_EVENTID		= 0x180e,
826 	WMI_DC_CALIB_DONE_EVENTID		= 0x180f,
827 	WMI_IQ_TX_CALIB_DONE_EVENTID		= 0x1811,
828 	WMI_IQ_RX_CALIB_DONE_EVENTID		= 0x1812,
829 	WMI_SET_WORK_MODE_DONE_EVENTID		= 0x1815,
830 	WMI_LO_LEAKAGE_CALIB_DONE_EVENTID	= 0x1816,
831 	WMI_MARLON_R_ACTIVATE_DONE_EVENTID	= 0x1817,
832 	WMI_MARLON_R_READ_DONE_EVENTID		= 0x1818,
833 	WMI_MARLON_R_WRITE_DONE_EVENTID		= 0x1819,
834 	WMI_MARLON_R_TXRX_SEL_DONE_EVENTID	= 0x181a,
835 	WMI_SILENT_RSSI_CALIB_DONE_EVENTID	= 0x181d,
836 	WMI_RF_RX_TEST_DONE_EVENTID		= 0x181e,
837 	WMI_CFG_RX_CHAIN_DONE_EVENTID		= 0x1820,
838 	WMI_VRING_CFG_DONE_EVENTID		= 0x1821,
839 	WMI_BA_STATUS_EVENTID			= 0x1823,
840 	WMI_RCP_ADDBA_REQ_EVENTID		= 0x1824,
841 	WMI_ADDBA_RESP_SENT_EVENTID		= 0x1825,
842 	WMI_DELBA_EVENTID			= 0x1826,
843 	WMI_GET_SSID_EVENTID			= 0x1828,
844 	WMI_GET_PCP_CHANNEL_EVENTID		= 0x182a,
845 	WMI_SW_TX_COMPLETE_EVENTID		= 0x182b,
846 
847 	WMI_READ_MAC_RXQ_EVENTID		= 0x1830,
848 	WMI_READ_MAC_TXQ_EVENTID		= 0x1831,
849 	WMI_WRITE_MAC_RXQ_EVENTID		= 0x1832,
850 	WMI_WRITE_MAC_TXQ_EVENTID		= 0x1833,
851 	WMI_WRITE_MAC_XQ_FIELD_EVENTID		= 0x1834,
852 
853 	WMI_BEAFORMING_MGMT_DONE_EVENTID	= 0x1836,
854 	WMI_BF_TXSS_MGMT_DONE_EVENTID		= 0x1837,
855 	WMI_BF_RXSS_MGMT_DONE_EVENTID		= 0x1839,
856 	WMI_RS_MGMT_DONE_EVENTID		= 0x1852,
857 	WMI_RF_MGMT_STATUS_EVENTID		= 0x1853,
858 	WMI_BF_SM_MGMT_DONE_EVENTID		= 0x1838,
859 	WMI_RX_MGMT_PACKET_EVENTID		= 0x1840,
860 
861 	/* Performance monitoring events */
862 	WMI_DATA_PORT_OPEN_EVENTID		= 0x1860,
863 	WMI_WBE_LINKDOWN_EVENTID		= 0x1861,
864 
865 	WMI_BF_CTRL_DONE_EVENTID		= 0x1862,
866 	WMI_NOTIFY_REQ_DONE_EVENTID		= 0x1863,
867 	WMI_GET_STATUS_DONE_EVENTID		= 0x1864,
868 
869 	WMI_UNIT_TEST_EVENTID			= 0x1900,
870 	WMI_FLASH_READ_DONE_EVENTID		= 0x1902,
871 	WMI_FLASH_WRITE_DONE_EVENTID		= 0x1903,
872 	/*P2P*/
873 	WMI_PORT_ALLOCATED_EVENTID		= 0x1911,
874 	WMI_PORT_DELETED_EVENTID		= 0x1912,
875 	WMI_LISTEN_STARTED_EVENTID		= 0x1914,
876 	WMI_SEARCH_STARTED_EVENTID		= 0x1915,
877 	WMI_DISCOVERY_STARTED_EVENTID		= 0x1916,
878 	WMI_DISCOVERY_STOPPED_EVENTID		= 0x1917,
879 	WMI_PCP_STARTED_EVENTID			= 0x1918,
880 	WMI_PCP_STOPPED_EVENTID			= 0x1919,
881 	WMI_PCP_FACTOR_EVENTID			= 0x191a,
882 	WMI_SET_CHANNEL_EVENTID			= 0x9000,
883 	WMI_ASSOC_REQ_EVENTID			= 0x9001,
884 	WMI_EAPOL_RX_EVENTID			= 0x9002,
885 	WMI_MAC_ADDR_RESP_EVENTID		= 0x9003,
886 	WMI_FW_VER_EVENTID			= 0x9004,
887 };
888 
889 /*
890  * Events data structures
891  */
892 
893 
894 enum wmi_fw_status {
895 	WMI_FW_STATUS_SUCCESS,
896 	WMI_FW_STATUS_FAILURE,
897 };
898 
899 /*
900  * WMI_RF_MGMT_STATUS_EVENTID
901  */
902 enum wmi_rf_status {
903 	WMI_RF_ENABLED			= 0,
904 	WMI_RF_DISABLED_HW		= 1,
905 	WMI_RF_DISABLED_SW		= 2,
906 	WMI_RF_DISABLED_HW_SW		= 3,
907 };
908 
909 struct wmi_rf_mgmt_status_event {
910 	__le32 rf_status;
911 } __packed;
912 
913 /*
914  * WMI_GET_STATUS_DONE_EVENTID
915  */
916 struct wmi_get_status_done_event {
917 	__le32 is_associated;
918 	u8 cid;
919 	u8 reserved0[3];
920 	u8 bssid[WMI_MAC_LEN];
921 	u8 channel;
922 	u8 reserved1;
923 	u8 network_type;
924 	u8 reserved2[3];
925 	__le32 ssid_len;
926 	u8 ssid[WMI_MAX_SSID_LEN];
927 	__le32 rf_status;
928 	__le32 is_secured;
929 } __packed;
930 
931 /*
932  * WMI_FW_VER_EVENTID
933  */
934 struct wmi_fw_ver_event {
935 	u8 major;
936 	u8 minor;
937 	__le16 subminor;
938 	__le16 build;
939 } __packed;
940 
941 /*
942 * WMI_MAC_ADDR_RESP_EVENTID
943 */
944 struct wmi_mac_addr_resp_event {
945 	u8 mac[WMI_MAC_LEN];
946 	u8 auth_mode;
947 	u8 crypt_mode;
948 	__le32 offload_mode;
949 } __packed;
950 
951 /*
952 * WMI_EAPOL_RX_EVENTID
953 */
954 struct wmi_eapol_rx_event {
955 	u8 src_mac[WMI_MAC_LEN];
956 	__le16 eapol_len;
957 	u8 eapol[0];
958 } __packed;
959 
960 /*
961 * WMI_READY_EVENTID
962 */
963 enum wmi_phy_capability {
964 	WMI_11A_CAPABILITY		= 1,
965 	WMI_11G_CAPABILITY		= 2,
966 	WMI_11AG_CAPABILITY		= 3,
967 	WMI_11NA_CAPABILITY		= 4,
968 	WMI_11NG_CAPABILITY		= 5,
969 	WMI_11NAG_CAPABILITY		= 6,
970 	WMI_11AD_CAPABILITY		= 7,
971 	WMI_11N_CAPABILITY_OFFSET = WMI_11NA_CAPABILITY - WMI_11A_CAPABILITY,
972 };
973 
974 struct wmi_ready_event {
975 	__le32 sw_version;
976 	__le32 abi_version;
977 	u8 mac[WMI_MAC_LEN];
978 	u8 phy_capability;		/* enum wmi_phy_capability */
979 	u8 numof_additional_mids;
980 } __packed;
981 
982 /*
983  * WMI_NOTIFY_REQ_DONE_EVENTID
984  */
985 struct wmi_notify_req_done_event {
986 	__le32 status;
987 	__le64 tsf;
988 	__le32 snr_val;
989 	__le32 tx_tpt;
990 	__le32 tx_goodput;
991 	__le32 rx_goodput;
992 	__le16 bf_mcs;
993 	__le16 my_rx_sector;
994 	__le16 my_tx_sector;
995 	__le16 other_rx_sector;
996 	__le16 other_tx_sector;
997 	__le16 range;
998 	u8 sqi;
999 	u8 reserved[3];
1000 } __packed;
1001 
1002 /*
1003  * WMI_CONNECT_EVENTID
1004  */
1005 struct wmi_connect_event {
1006 	u8 channel;
1007 	u8 reserved0;
1008 	u8 bssid[WMI_MAC_LEN];
1009 	__le16 listen_interval;
1010 	__le16 beacon_interval;
1011 	u8 network_type;
1012 	u8 reserved1[3];
1013 	u8 beacon_ie_len;
1014 	u8 assoc_req_len;
1015 	u8 assoc_resp_len;
1016 	u8 cid;
1017 	u8 reserved2[3];
1018 	u8 assoc_info[0];
1019 } __packed;
1020 
1021 /*
1022  * WMI_DISCONNECT_EVENTID
1023  */
1024 enum wmi_disconnect_reason {
1025 	WMI_DIS_REASON_NO_NETWORK_AVAIL		= 1,
1026 	WMI_DIS_REASON_LOST_LINK		= 2, /* bmiss */
1027 	WMI_DIS_REASON_DISCONNECT_CMD		= 3,
1028 	WMI_DIS_REASON_BSS_DISCONNECTED		= 4,
1029 	WMI_DIS_REASON_AUTH_FAILED		= 5,
1030 	WMI_DIS_REASON_ASSOC_FAILED		= 6,
1031 	WMI_DIS_REASON_NO_RESOURCES_AVAIL	= 7,
1032 	WMI_DIS_REASON_CSERV_DISCONNECT		= 8,
1033 	WMI_DIS_REASON_INVALID_PROFILE		= 10,
1034 	WMI_DIS_REASON_DOT11H_CHANNEL_SWITCH	= 11,
1035 	WMI_DIS_REASON_PROFILE_MISMATCH		= 12,
1036 	WMI_DIS_REASON_CONNECTION_EVICTED	= 13,
1037 	WMI_DIS_REASON_IBSS_MERGE		= 14,
1038 };
1039 
1040 struct wmi_disconnect_event {
1041 	__le16 protocol_reason_status;	/* reason code, see 802.11 spec. */
1042 	u8 bssid[WMI_MAC_LEN];		/* set if known */
1043 	u8 disconnect_reason;		/* see wmi_disconnect_reason_e */
1044 	u8 assoc_resp_len;
1045 	u8 assoc_info[0];
1046 } __packed;
1047 
1048 /*
1049  * WMI_SCAN_COMPLETE_EVENTID
1050  */
1051 struct wmi_scan_complete_event {
1052 	__le32 status;
1053 } __packed;
1054 
1055 /*
1056  * WMI_BA_STATUS_EVENTID
1057  */
1058 enum wmi_vring_ba_status {
1059 	WMI_BA_AGREED			= 0,
1060 	WMI_BA_NON_AGREED		= 1,
1061 };
1062 
1063 struct wmi_vring_ba_status_event {
1064 	__le16 status;
1065 	u8 reserved[2];
1066 	u8 ringid;
1067 	u8 agg_wsize;
1068 	__le16 ba_timeout;
1069 } __packed;
1070 
1071 /*
1072  * WMI_DELBA_EVENTID
1073  */
1074 struct wmi_delba_event {
1075 	u8 cidxtid;
1076 	u8 from_initiator;
1077 	__le16 reason;
1078 } __packed;
1079 
1080 
1081 /*
1082  * WMI_VRING_CFG_DONE_EVENTID
1083  */
1084 struct wmi_vring_cfg_done_event {
1085 	u8 ringid;
1086 	u8 status;
1087 	u8 reserved[2];
1088 	__le32 tx_vring_tail_ptr;
1089 } __packed;
1090 
1091 /*
1092  * WMI_ADDBA_RESP_SENT_EVENTID
1093  */
1094 struct wmi_rcp_addba_resp_sent_event {
1095 	u8 cidxtid;
1096 	u8 reserved;
1097 	__le16 status;
1098 } __packed;
1099 
1100 /*
1101  * WMI_RCP_ADDBA_REQ_EVENTID
1102  */
1103 struct wmi_rcp_addba_req_event {
1104 	u8 cidxtid;
1105 	u8 dialog_token;
1106 	__le16 ba_param_set;	/* ieee80211_ba_parameterset as it received */
1107 	__le16 ba_timeout;
1108 	__le16 ba_seq_ctrl;	/* ieee80211_ba_seqstrl field as it received */
1109 } __packed;
1110 
1111 /*
1112  * WMI_CFG_RX_CHAIN_DONE_EVENTID
1113  */
1114 enum wmi_cfg_rx_chain_done_event_status {
1115 	WMI_CFG_RX_CHAIN_SUCCESS	= 1,
1116 };
1117 
1118 struct wmi_cfg_rx_chain_done_event {
1119 	__le32 rx_ring_tail_ptr;	/* Rx V-Ring Tail pointer */
1120 	__le32 status;
1121 } __packed;
1122 
1123 /*
1124  * WMI_WBE_LINKDOWN_EVENTID
1125  */
1126 enum wmi_wbe_link_down_event_reason {
1127 	WMI_WBE_REASON_USER_REQUEST	= 0,
1128 	WMI_WBE_REASON_RX_DISASSOC	= 1,
1129 	WMI_WBE_REASON_BAD_PHY_LINK	= 2,
1130 };
1131 
1132 struct wmi_wbe_link_down_event {
1133 	u8 cid;
1134 	u8 reserved[3];
1135 	__le32 reason;
1136 } __packed;
1137 
1138 /*
1139  * WMI_DATA_PORT_OPEN_EVENTID
1140  */
1141 struct wmi_data_port_open_event {
1142 	u8 cid;
1143 	u8 reserved[3];
1144 } __packed;
1145 
1146 
1147 /*
1148  * WMI_GET_PCP_CHANNEL_EVENTID
1149  */
1150 struct wmi_get_pcp_channel_event {
1151 	u8 channel;
1152 	u8 reserved[3];
1153 } __packed;
1154 
1155 
1156 /*
1157 * WMI_PORT_ALLOCATED_EVENTID
1158 */
1159 struct wmi_port_allocated_event {
1160 	u8 status;	/* wmi_fw_status */
1161 	u8 reserved[3];
1162 } __packed;
1163 
1164 /*
1165 * WMI_PORT_DELETED_EVENTID
1166 */
1167 struct wmi_port_deleted_event {
1168 	u8 status;	/* wmi_fw_status */
1169 	u8 reserved[3];
1170 } __packed;
1171 
1172 /*
1173  * WMI_LISTEN_STARTED_EVENTID
1174  */
1175 struct wmi_listen_started_event {
1176 	u8 status;	/* wmi_fw_status */
1177 	u8 reserved[3];
1178 } __packed;
1179 
1180 /*
1181  * WMI_SEARCH_STARTED_EVENTID
1182  */
1183 struct wmi_search_started_event {
1184 	u8 status;	/* wmi_fw_status */
1185 	u8 reserved[3];
1186 } __packed;
1187 
1188 /*
1189  * WMI_PCP_STARTED_EVENTID
1190  */
1191 struct wmi_pcp_started_event {
1192 	u8 status;	/* wmi_fw_status */
1193 	u8 reserved[3];
1194 } __packed;
1195 
1196 /*
1197  * WMI_PCP_FACTOR_EVENTID
1198  */
1199 struct wmi_pcp_factor_event {
1200 	__le32 pcp_factor;
1201 } __packed;
1202 
1203 /*
1204  * WMI_SW_TX_COMPLETE_EVENTID
1205  */
1206 enum wmi_sw_tx_status {
1207 	WMI_TX_SW_STATUS_SUCCESS		= 0,
1208 	WMI_TX_SW_STATUS_FAILED_NO_RESOURCES	= 1,
1209 	WMI_TX_SW_STATUS_FAILED_TX		= 2,
1210 };
1211 
1212 struct wmi_sw_tx_complete_event {
1213 	u8 status;	/* enum wmi_sw_tx_status */
1214 	u8 reserved[3];
1215 } __packed;
1216 
1217 /*
1218  * WMI_CORR_MEASURE_EVENTID
1219  */
1220 struct wmi_corr_measure_event {
1221 	s32 i;
1222 	s32 q;
1223 	s32 image_i;
1224 	s32 image_q;
1225 } __packed;
1226 
1227 /*
1228  * WMI_READ_RSSI_EVENTID
1229  */
1230 struct wmi_read_rssi_event {
1231 	__le32 ina_rssi_adc_dbm;
1232 } __packed;
1233 
1234 /*
1235  * WMI_GET_SSID_EVENTID
1236  */
1237 struct wmi_get_ssid_event {
1238 	__le32 ssid_len;
1239 	u8 ssid[WMI_MAX_SSID_LEN];
1240 } __packed;
1241 
1242 /*
1243  * WMI_RX_MGMT_PACKET_EVENTID
1244  */
1245 struct wmi_rx_mgmt_info {
1246 	u8 mcs;
1247 	s8 snr;
1248 	u8 range;
1249 	u8 sqi;
1250 	__le16 stype;
1251 	__le16 status;
1252 	__le32 len;
1253 	u8 qid;
1254 	u8 mid;
1255 	u8 cid;
1256 	u8 channel;	/* From Radio MNGR */
1257 } __packed;
1258 
1259 struct wmi_rx_mgmt_packet_event {
1260 	struct wmi_rx_mgmt_info info;
1261 	u8 payload[0];
1262 } __packed;
1263 
1264 /*
1265  * WMI_ECHO_RSP_EVENTID
1266  */
1267 struct wmi_echo_event {
1268 	__le32 echoed_value;
1269 } __packed;
1270 
1271 /*
1272  * WMI_TEMP_SENSE_DONE_EVENTID
1273  *
1274  * Measure MAC and radio temperatures
1275  */
1276 struct wmi_temp_sense_done_event {
1277 	__le32 marlon_m_t1000;
1278 	__le32 marlon_r_t1000;
1279 } __packed;
1280 
1281 #endif /* __WILOCITY_WMI_H__ */
1282