GNU Linux-libre 4.9.337-gnu1
[releases.git] / drivers / net / wireless / ath / wil6210 / wmi.h
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 /* FW capability IDs
50  * Each ID maps to a bit in a 32-bit bitmask value provided by the FW to
51  * the host
52  */
53 enum wmi_fw_capability {
54         WMI_FW_CAPABILITY_FTM           = 0,
55         WMI_FW_CAPABILITY_PS_CONFIG     = 1,
56         WMI_FW_CAPABILITY_MAX,
57 };
58
59 /* WMI_CMD_HDR */
60 struct wmi_cmd_hdr {
61         u8 mid;
62         u8 reserved;
63         __le16 command_id;
64         __le32 fw_timestamp;
65 } __packed;
66
67 /* List of Commands */
68 enum wmi_command_id {
69         WMI_CONNECT_CMDID                       = 0x01,
70         WMI_DISCONNECT_CMDID                    = 0x03,
71         WMI_DISCONNECT_STA_CMDID                = 0x04,
72         WMI_START_SCAN_CMDID                    = 0x07,
73         WMI_SET_BSS_FILTER_CMDID                = 0x09,
74         WMI_SET_PROBED_SSID_CMDID               = 0x0A,
75         WMI_SET_LISTEN_INT_CMDID                = 0x0B,
76         WMI_BCON_CTRL_CMDID                     = 0x0F,
77         WMI_ADD_CIPHER_KEY_CMDID                = 0x16,
78         WMI_DELETE_CIPHER_KEY_CMDID             = 0x17,
79         WMI_PCP_CONF_CMDID                      = 0x18,
80         WMI_SET_APPIE_CMDID                     = 0x3F,
81         WMI_SET_WSC_STATUS_CMDID                = 0x41,
82         WMI_PXMT_RANGE_CFG_CMDID                = 0x42,
83         WMI_PXMT_SNR2_RANGE_CFG_CMDID           = 0x43,
84         WMI_MEM_READ_CMDID                      = 0x800,
85         WMI_MEM_WR_CMDID                        = 0x801,
86         WMI_ECHO_CMDID                          = 0x803,
87         WMI_DEEP_ECHO_CMDID                     = 0x804,
88         WMI_CONFIG_MAC_CMDID                    = 0x805,
89         WMI_CONFIG_PHY_DEBUG_CMDID              = 0x806,
90         WMI_ADD_DEBUG_TX_PCKT_CMDID             = 0x808,
91         WMI_PHY_GET_STATISTICS_CMDID            = 0x809,
92         WMI_FS_TUNE_CMDID                       = 0x80A,
93         WMI_CORR_MEASURE_CMDID                  = 0x80B,
94         WMI_READ_RSSI_CMDID                     = 0x80C,
95         WMI_TEMP_SENSE_CMDID                    = 0x80E,
96         WMI_DC_CALIB_CMDID                      = 0x80F,
97         WMI_SEND_TONE_CMDID                     = 0x810,
98         WMI_IQ_TX_CALIB_CMDID                   = 0x811,
99         WMI_IQ_RX_CALIB_CMDID                   = 0x812,
100         WMI_SET_UCODE_IDLE_CMDID                = 0x813,
101         WMI_SET_WORK_MODE_CMDID                 = 0x815,
102         WMI_LO_LEAKAGE_CALIB_CMDID              = 0x816,
103         WMI_MARLON_R_READ_CMDID                 = 0x818,
104         WMI_MARLON_R_WRITE_CMDID                = 0x819,
105         WMI_MARLON_R_TXRX_SEL_CMDID             = 0x81A,
106         MAC_IO_STATIC_PARAMS_CMDID              = 0x81B,
107         MAC_IO_DYNAMIC_PARAMS_CMDID             = 0x81C,
108         WMI_SILENT_RSSI_CALIB_CMDID             = 0x81D,
109         WMI_RF_RX_TEST_CMDID                    = 0x81E,
110         WMI_CFG_RX_CHAIN_CMDID                  = 0x820,
111         WMI_VRING_CFG_CMDID                     = 0x821,
112         WMI_BCAST_VRING_CFG_CMDID               = 0x822,
113         WMI_VRING_BA_EN_CMDID                   = 0x823,
114         WMI_VRING_BA_DIS_CMDID                  = 0x824,
115         WMI_RCP_ADDBA_RESP_CMDID                = 0x825,
116         WMI_RCP_DELBA_CMDID                     = 0x826,
117         WMI_SET_SSID_CMDID                      = 0x827,
118         WMI_GET_SSID_CMDID                      = 0x828,
119         WMI_SET_PCP_CHANNEL_CMDID               = 0x829,
120         WMI_GET_PCP_CHANNEL_CMDID               = 0x82A,
121         WMI_SW_TX_REQ_CMDID                     = 0x82B,
122         WMI_READ_MAC_RXQ_CMDID                  = 0x830,
123         WMI_READ_MAC_TXQ_CMDID                  = 0x831,
124         WMI_WRITE_MAC_RXQ_CMDID                 = 0x832,
125         WMI_WRITE_MAC_TXQ_CMDID                 = 0x833,
126         WMI_WRITE_MAC_XQ_FIELD_CMDID            = 0x834,
127         WMI_MLME_PUSH_CMDID                     = 0x835,
128         WMI_BEAMFORMING_MGMT_CMDID              = 0x836,
129         WMI_BF_TXSS_MGMT_CMDID                  = 0x837,
130         WMI_BF_SM_MGMT_CMDID                    = 0x838,
131         WMI_BF_RXSS_MGMT_CMDID                  = 0x839,
132         WMI_BF_TRIG_CMDID                       = 0x83A,
133         WMI_LINK_MAINTAIN_CFG_WRITE_CMDID       = 0x842,
134         WMI_LINK_MAINTAIN_CFG_READ_CMDID        = 0x843,
135         WMI_SET_SECTORS_CMDID                   = 0x849,
136         WMI_MAINTAIN_PAUSE_CMDID                = 0x850,
137         WMI_MAINTAIN_RESUME_CMDID               = 0x851,
138         WMI_RS_MGMT_CMDID                       = 0x852,
139         WMI_RF_MGMT_CMDID                       = 0x853,
140         WMI_THERMAL_THROTTLING_CTRL_CMDID       = 0x854,
141         WMI_THERMAL_THROTTLING_GET_STATUS_CMDID = 0x855,
142         WMI_OTP_READ_CMDID                      = 0x856,
143         WMI_OTP_WRITE_CMDID                     = 0x857,
144         WMI_LED_CFG_CMDID                       = 0x858,
145         /* Performance monitoring commands */
146         WMI_BF_CTRL_CMDID                       = 0x862,
147         WMI_NOTIFY_REQ_CMDID                    = 0x863,
148         WMI_GET_STATUS_CMDID                    = 0x864,
149         WMI_GET_RF_STATUS_CMDID                 = 0x866,
150         WMI_GET_BASEBAND_TYPE_CMDID             = 0x867,
151         WMI_UNIT_TEST_CMDID                     = 0x900,
152         WMI_HICCUP_CMDID                        = 0x901,
153         WMI_FLASH_READ_CMDID                    = 0x902,
154         WMI_FLASH_WRITE_CMDID                   = 0x903,
155         /* Power management */
156         WMI_TRAFFIC_DEFERRAL_CMDID              = 0x904,
157         WMI_TRAFFIC_RESUME_CMDID                = 0x905,
158         /* P2P */
159         WMI_P2P_CFG_CMDID                       = 0x910,
160         WMI_PORT_ALLOCATE_CMDID                 = 0x911,
161         WMI_PORT_DELETE_CMDID                   = 0x912,
162         WMI_POWER_MGMT_CFG_CMDID                = 0x913,
163         WMI_START_LISTEN_CMDID                  = 0x914,
164         WMI_START_SEARCH_CMDID                  = 0x915,
165         WMI_DISCOVERY_START_CMDID               = 0x916,
166         WMI_DISCOVERY_STOP_CMDID                = 0x917,
167         WMI_PCP_START_CMDID                     = 0x918,
168         WMI_PCP_STOP_CMDID                      = 0x919,
169         WMI_GET_PCP_FACTOR_CMDID                = 0x91B,
170         /* Power Save Configuration Commands */
171         WMI_PS_DEV_PROFILE_CFG_CMDID            = 0x91C,
172         /* Not supported yet */
173         WMI_PS_DEV_CFG_CMDID                    = 0x91D,
174         /* Not supported yet */
175         WMI_PS_DEV_CFG_READ_CMDID               = 0x91E,
176         /* Per MAC Power Save Configuration commands
177          * Not supported yet
178          */
179         WMI_PS_MID_CFG_CMDID                    = 0x91F,
180         /* Not supported yet */
181         WMI_PS_MID_CFG_READ_CMDID               = 0x920,
182         WMI_RS_CFG_CMDID                        = 0x921,
183         WMI_GET_DETAILED_RS_RES_CMDID           = 0x922,
184         WMI_AOA_MEAS_CMDID                      = 0x923,
185         WMI_TOF_SESSION_START_CMDID             = 0x991,
186         WMI_TOF_GET_CAPABILITIES_CMDID          = 0x992,
187         WMI_TOF_SET_LCR_CMDID                   = 0x993,
188         WMI_TOF_SET_LCI_CMDID                   = 0x994,
189         WMI_TOF_CHANNEL_INFO_CMDID              = 0x995,
190         WMI_SET_MAC_ADDRESS_CMDID               = 0xF003,
191         WMI_ABORT_SCAN_CMDID                    = 0xF007,
192         WMI_SET_PROMISCUOUS_MODE_CMDID          = 0xF041,
193         WMI_GET_PMK_CMDID                       = 0xF048,
194         WMI_SET_PASSPHRASE_CMDID                = 0xF049,
195         WMI_SEND_ASSOC_RES_CMDID                = 0xF04A,
196         WMI_SET_ASSOC_REQ_RELAY_CMDID           = 0xF04B,
197         WMI_MAC_ADDR_REQ_CMDID                  = 0xF04D,
198         WMI_FW_VER_CMDID                        = 0xF04E,
199         WMI_PMC_CMDID                           = 0xF04F,
200 };
201
202 /* WMI_CONNECT_CMDID */
203 enum wmi_network_type {
204         WMI_NETTYPE_INFRA               = 0x01,
205         WMI_NETTYPE_ADHOC               = 0x02,
206         WMI_NETTYPE_ADHOC_CREATOR       = 0x04,
207         WMI_NETTYPE_AP                  = 0x10,
208         WMI_NETTYPE_P2P                 = 0x20,
209         /* PCIE over 60g */
210         WMI_NETTYPE_WBE                 = 0x40,
211 };
212
213 enum wmi_dot11_auth_mode {
214         WMI_AUTH11_OPEN         = 0x01,
215         WMI_AUTH11_SHARED       = 0x02,
216         WMI_AUTH11_LEAP         = 0x04,
217         WMI_AUTH11_WSC          = 0x08,
218 };
219
220 enum wmi_auth_mode {
221         WMI_AUTH_NONE           = 0x01,
222         WMI_AUTH_WPA            = 0x02,
223         WMI_AUTH_WPA2           = 0x04,
224         WMI_AUTH_WPA_PSK        = 0x08,
225         WMI_AUTH_WPA2_PSK       = 0x10,
226         WMI_AUTH_WPA_CCKM       = 0x20,
227         WMI_AUTH_WPA2_CCKM      = 0x40,
228 };
229
230 enum wmi_crypto_type {
231         WMI_CRYPT_NONE          = 0x01,
232         WMI_CRYPT_AES_GCMP      = 0x20,
233 };
234
235 enum wmi_connect_ctrl_flag_bits {
236         WMI_CONNECT_ASSOC_POLICY_USER           = 0x01,
237         WMI_CONNECT_SEND_REASSOC                = 0x02,
238         WMI_CONNECT_IGNORE_WPA_GROUP_CIPHER     = 0x04,
239         WMI_CONNECT_PROFILE_MATCH_DONE          = 0x08,
240         WMI_CONNECT_IGNORE_AAC_BEACON           = 0x10,
241         WMI_CONNECT_CSA_FOLLOW_BSS              = 0x20,
242         WMI_CONNECT_DO_WPA_OFFLOAD              = 0x40,
243         WMI_CONNECT_DO_NOT_DEAUTH               = 0x80,
244 };
245
246 #define WMI_MAX_SSID_LEN        (32)
247
248 /* WMI_CONNECT_CMDID */
249 struct wmi_connect_cmd {
250         u8 network_type;
251         u8 dot11_auth_mode;
252         u8 auth_mode;
253         u8 pairwise_crypto_type;
254         u8 pairwise_crypto_len;
255         u8 group_crypto_type;
256         u8 group_crypto_len;
257         u8 ssid_len;
258         u8 ssid[WMI_MAX_SSID_LEN];
259         u8 channel;
260         u8 reserved0;
261         u8 bssid[WMI_MAC_LEN];
262         __le32 ctrl_flags;
263         u8 dst_mac[WMI_MAC_LEN];
264         u8 reserved1[2];
265 } __packed;
266
267 /* WMI_DISCONNECT_STA_CMDID */
268 struct wmi_disconnect_sta_cmd {
269         u8 dst_mac[WMI_MAC_LEN];
270         __le16 disconnect_reason;
271 } __packed;
272
273 #define WMI_MAX_KEY_INDEX       (3)
274 #define WMI_MAX_KEY_LEN         (32)
275 #define WMI_PASSPHRASE_LEN      (64)
276
277 /* WMI_SET_PASSPHRASE_CMDID */
278 struct wmi_set_passphrase_cmd {
279         u8 ssid[WMI_MAX_SSID_LEN];
280         u8 passphrase[WMI_PASSPHRASE_LEN];
281         u8 ssid_len;
282         u8 passphrase_len;
283 } __packed;
284
285 /* WMI_ADD_CIPHER_KEY_CMDID */
286 enum wmi_key_usage {
287         WMI_KEY_USE_PAIRWISE    = 0x00,
288         WMI_KEY_USE_RX_GROUP    = 0x01,
289         WMI_KEY_USE_TX_GROUP    = 0x02,
290 };
291
292 struct wmi_add_cipher_key_cmd {
293         u8 key_index;
294         u8 key_type;
295         /* enum wmi_key_usage */
296         u8 key_usage;
297         u8 key_len;
298         /* key replay sequence counter */
299         u8 key_rsc[8];
300         u8 key[WMI_MAX_KEY_LEN];
301         /* Additional Key Control information */
302         u8 key_op_ctrl;
303         u8 mac[WMI_MAC_LEN];
304 } __packed;
305
306 /* WMI_DELETE_CIPHER_KEY_CMDID */
307 struct wmi_delete_cipher_key_cmd {
308         u8 key_index;
309         u8 mac[WMI_MAC_LEN];
310 } __packed;
311
312 /* WMI_START_SCAN_CMDID
313  *
314  * Start L1 scan operation
315  *
316  * Returned events:
317  * - WMI_RX_MGMT_PACKET_EVENTID - for every probe resp.
318  * - WMI_SCAN_COMPLETE_EVENTID
319  */
320 enum wmi_scan_type {
321         WMI_ACTIVE_SCAN         = 0x00,
322         WMI_SHORT_SCAN          = 0x01,
323         WMI_PASSIVE_SCAN        = 0x02,
324         WMI_DIRECT_SCAN         = 0x03,
325         WMI_LONG_SCAN           = 0x04,
326 };
327
328 /* WMI_START_SCAN_CMDID */
329 struct wmi_start_scan_cmd {
330         u8 direct_scan_mac_addr[WMI_MAC_LEN];
331         /* run scan with discovery beacon. Relevant for ACTIVE scan only. */
332         u8 discovery_mode;
333         u8 reserved;
334         /* Max duration in the home channel(ms) */
335         __le32 dwell_time;
336         /* Time interval between scans (ms) */
337         __le32 force_scan_interval;
338         /* enum wmi_scan_type */
339         u8 scan_type;
340         /* how many channels follow */
341         u8 num_channels;
342         /* channels ID's:
343          * 0 - 58320 MHz
344          * 1 - 60480 MHz
345          * 2 - 62640 MHz
346          */
347         struct {
348                 u8 channel;
349                 u8 reserved;
350         } channel_list[0];
351 } __packed;
352
353 /* WMI_SET_PROBED_SSID_CMDID */
354 #define MAX_PROBED_SSID_INDEX   (3)
355
356 enum wmi_ssid_flag {
357         /* disables entry */
358         WMI_SSID_FLAG_DISABLE   = 0x00,
359         /* probes specified ssid */
360         WMI_SSID_FLAG_SPECIFIC  = 0x01,
361         /* probes for any ssid */
362         WMI_SSID_FLAG_ANY       = 0x02,
363 };
364
365 struct wmi_probed_ssid_cmd {
366         /* 0 to MAX_PROBED_SSID_INDEX */
367         u8 entry_index;
368         /* enum wmi_ssid_flag */
369         u8 flag;
370         u8 ssid_len;
371         u8 ssid[WMI_MAX_SSID_LEN];
372 } __packed;
373
374 /* WMI_SET_APPIE_CMDID
375  * Add Application specified IE to a management frame
376  */
377 #define WMI_MAX_IE_LEN  (1024)
378
379 /* Frame Types */
380 enum wmi_mgmt_frame_type {
381         WMI_FRAME_BEACON        = 0x00,
382         WMI_FRAME_PROBE_REQ     = 0x01,
383         WMI_FRAME_PROBE_RESP    = 0x02,
384         WMI_FRAME_ASSOC_REQ     = 0x03,
385         WMI_FRAME_ASSOC_RESP    = 0x04,
386         WMI_NUM_MGMT_FRAME      = 0x05,
387 };
388
389 struct wmi_set_appie_cmd {
390         /* enum wmi_mgmt_frame_type */
391         u8 mgmt_frm_type;
392         u8 reserved;
393         /* Length of the IE to be added to MGMT frame */
394         __le16 ie_len;
395         u8 ie_info[0];
396 } __packed;
397
398 /* WMI_PXMT_RANGE_CFG_CMDID */
399 struct wmi_pxmt_range_cfg_cmd {
400         u8 dst_mac[WMI_MAC_LEN];
401         __le16 range;
402 } __packed;
403
404 /* WMI_PXMT_SNR2_RANGE_CFG_CMDID */
405 struct wmi_pxmt_snr2_range_cfg_cmd {
406         s8 snr2range_arr[2];
407 } __packed;
408
409 /* WMI_RF_MGMT_CMDID */
410 enum wmi_rf_mgmt_type {
411         WMI_RF_MGMT_W_DISABLE   = 0x00,
412         WMI_RF_MGMT_W_ENABLE    = 0x01,
413         WMI_RF_MGMT_GET_STATUS  = 0x02,
414 };
415
416 /* WMI_RF_MGMT_CMDID */
417 struct wmi_rf_mgmt_cmd {
418         __le32 rf_mgmt_type;
419 } __packed;
420
421 /* WMI_THERMAL_THROTTLING_CTRL_CMDID */
422 #define THERMAL_THROTTLING_USE_DEFAULT_MAX_TXOP_LENGTH  (0xFFFFFFFF)
423
424 /* WMI_THERMAL_THROTTLING_CTRL_CMDID */
425 struct wmi_thermal_throttling_ctrl_cmd {
426         __le32 time_on_usec;
427         __le32 time_off_usec;
428         __le32 max_txop_length_usec;
429 } __packed;
430
431 /* WMI_RF_RX_TEST_CMDID */
432 struct wmi_rf_rx_test_cmd {
433         __le32 sector;
434 } __packed;
435
436 /* WMI_CORR_MEASURE_CMDID */
437 struct wmi_corr_measure_cmd {
438         __le32 freq_mhz;
439         __le32 length_samples;
440         __le32 iterations;
441 } __packed;
442
443 /* WMI_SET_SSID_CMDID */
444 struct wmi_set_ssid_cmd {
445         __le32 ssid_len;
446         u8 ssid[WMI_MAX_SSID_LEN];
447 } __packed;
448
449 /* WMI_SET_PCP_CHANNEL_CMDID */
450 struct wmi_set_pcp_channel_cmd {
451         u8 channel;
452         u8 reserved[3];
453 } __packed;
454
455 /* WMI_BCON_CTRL_CMDID */
456 struct wmi_bcon_ctrl_cmd {
457         __le16 bcon_interval;
458         __le16 frag_num;
459         __le64 ss_mask;
460         u8 network_type;
461         u8 pcp_max_assoc_sta;
462         u8 disable_sec_offload;
463         u8 disable_sec;
464         u8 hidden_ssid;
465         u8 is_go;
466         u8 reserved[2];
467 } __packed;
468
469 /* WMI_PORT_ALLOCATE_CMDID */
470 enum wmi_port_role {
471         WMI_PORT_STA            = 0x00,
472         WMI_PORT_PCP            = 0x01,
473         WMI_PORT_AP             = 0x02,
474         WMI_PORT_P2P_DEV        = 0x03,
475         WMI_PORT_P2P_CLIENT     = 0x04,
476         WMI_PORT_P2P_GO         = 0x05,
477 };
478
479 /* WMI_PORT_ALLOCATE_CMDID */
480 struct wmi_port_allocate_cmd {
481         u8 mac[WMI_MAC_LEN];
482         u8 port_role;
483         u8 mid;
484 } __packed;
485
486 /* WMI_PORT_DELETE_CMDID */
487 struct wmi_port_delete_cmd {
488         u8 mid;
489         u8 reserved[3];
490 } __packed;
491
492 /* WMI_TRAFFIC_DEFERRAL_CMDID */
493 struct wmi_traffic_deferral_cmd {
494         /* Bit vector: bit[0] - wake on Unicast, bit[1] - wake on Broadcast */
495         u8 wakeup_trigger;
496 } __packed;
497
498 /* WMI_P2P_CFG_CMDID */
499 enum wmi_discovery_mode {
500         WMI_DISCOVERY_MODE_NON_OFFLOAD  = 0x00,
501         WMI_DISCOVERY_MODE_OFFLOAD      = 0x01,
502         WMI_DISCOVERY_MODE_PEER2PEER    = 0x02,
503 };
504
505 struct wmi_p2p_cfg_cmd {
506         /* enum wmi_discovery_mode */
507         u8 discovery_mode;
508         u8 channel;
509         /* base to listen/search duration calculation */
510         __le16 bcon_interval;
511 } __packed;
512
513 /* WMI_POWER_MGMT_CFG_CMDID */
514 enum wmi_power_source_type {
515         WMI_POWER_SOURCE_BATTERY        = 0x00,
516         WMI_POWER_SOURCE_OTHER          = 0x01,
517 };
518
519 struct wmi_power_mgmt_cfg_cmd {
520         /* enum wmi_power_source_type */
521         u8 power_source;
522         u8 reserved[3];
523 } __packed;
524
525 /* WMI_PCP_START_CMDID */
526 struct wmi_pcp_start_cmd {
527         __le16 bcon_interval;
528         u8 pcp_max_assoc_sta;
529         u8 hidden_ssid;
530         u8 is_go;
531         u8 reserved0[7];
532         u8 network_type;
533         u8 channel;
534         u8 disable_sec_offload;
535         u8 disable_sec;
536 } __packed;
537
538 /* WMI_SW_TX_REQ_CMDID */
539 struct wmi_sw_tx_req_cmd {
540         u8 dst_mac[WMI_MAC_LEN];
541         __le16 len;
542         u8 payload[0];
543 } __packed;
544
545 struct wmi_sw_ring_cfg {
546         __le64 ring_mem_base;
547         __le16 ring_size;
548         __le16 max_mpdu_size;
549 } __packed;
550
551 /* wmi_vring_cfg_schd */
552 struct wmi_vring_cfg_schd {
553         __le16 priority;
554         __le16 timeslot_us;
555 } __packed;
556
557 enum wmi_vring_cfg_encap_trans_type {
558         WMI_VRING_ENC_TYPE_802_3        = 0x00,
559         WMI_VRING_ENC_TYPE_NATIVE_WIFI  = 0x01,
560 };
561
562 enum wmi_vring_cfg_ds_cfg {
563         WMI_VRING_DS_PBSS       = 0x00,
564         WMI_VRING_DS_STATION    = 0x01,
565         WMI_VRING_DS_AP         = 0x02,
566         WMI_VRING_DS_ADDR4      = 0x03,
567 };
568
569 enum wmi_vring_cfg_nwifi_ds_trans_type {
570         WMI_NWIFI_TX_TRANS_MODE_NO              = 0x00,
571         WMI_NWIFI_TX_TRANS_MODE_AP2PBSS         = 0x01,
572         WMI_NWIFI_TX_TRANS_MODE_STA2PBSS        = 0x02,
573 };
574
575 enum wmi_vring_cfg_schd_params_priority {
576         WMI_SCH_PRIO_REGULAR    = 0x00,
577         WMI_SCH_PRIO_HIGH       = 0x01,
578 };
579
580 #define CIDXTID_CID_POS                         (0)
581 #define CIDXTID_CID_LEN                         (4)
582 #define CIDXTID_CID_MSK                         (0xF)
583 #define CIDXTID_TID_POS                         (4)
584 #define CIDXTID_TID_LEN                         (4)
585 #define CIDXTID_TID_MSK                         (0xF0)
586 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_POS      (0)
587 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_LEN      (1)
588 #define VRING_CFG_MAC_CTRL_LIFETIME_EN_MSK      (0x1)
589 #define VRING_CFG_MAC_CTRL_AGGR_EN_POS          (1)
590 #define VRING_CFG_MAC_CTRL_AGGR_EN_LEN          (1)
591 #define VRING_CFG_MAC_CTRL_AGGR_EN_MSK          (0x2)
592 #define VRING_CFG_TO_RESOLUTION_VALUE_POS       (0)
593 #define VRING_CFG_TO_RESOLUTION_VALUE_LEN       (6)
594 #define VRING_CFG_TO_RESOLUTION_VALUE_MSK       (0x3F)
595
596 struct wmi_vring_cfg {
597         struct wmi_sw_ring_cfg tx_sw_ring;
598         /* 0-23 vrings */
599         u8 ringid;
600         u8 cidxtid;
601         u8 encap_trans_type;
602         /* 802.3 DS cfg */
603         u8 ds_cfg;
604         u8 nwifi_ds_trans_type;
605         u8 mac_ctrl;
606         u8 to_resolution;
607         u8 agg_max_wsize;
608         struct wmi_vring_cfg_schd schd_params;
609 } __packed;
610
611 enum wmi_vring_cfg_cmd_action {
612         WMI_VRING_CMD_ADD       = 0x00,
613         WMI_VRING_CMD_MODIFY    = 0x01,
614         WMI_VRING_CMD_DELETE    = 0x02,
615 };
616
617 /* WMI_VRING_CFG_CMDID */
618 struct wmi_vring_cfg_cmd {
619         __le32 action;
620         struct wmi_vring_cfg vring_cfg;
621 } __packed;
622
623 struct wmi_bcast_vring_cfg {
624         struct wmi_sw_ring_cfg tx_sw_ring;
625         /* 0-23 vrings */
626         u8 ringid;
627         u8 encap_trans_type;
628         /* 802.3 DS cfg */
629         u8 ds_cfg;
630         u8 nwifi_ds_trans_type;
631 } __packed;
632
633 /* WMI_BCAST_VRING_CFG_CMDID */
634 struct wmi_bcast_vring_cfg_cmd {
635         __le32 action;
636         struct wmi_bcast_vring_cfg vring_cfg;
637 } __packed;
638
639 /* WMI_VRING_BA_EN_CMDID */
640 struct wmi_vring_ba_en_cmd {
641         u8 ringid;
642         u8 agg_max_wsize;
643         __le16 ba_timeout;
644         u8 amsdu;
645         u8 reserved[3];
646 } __packed;
647
648 /* WMI_VRING_BA_DIS_CMDID */
649 struct wmi_vring_ba_dis_cmd {
650         u8 ringid;
651         u8 reserved;
652         __le16 reason;
653 } __packed;
654
655 /* WMI_NOTIFY_REQ_CMDID */
656 struct wmi_notify_req_cmd {
657         u8 cid;
658         u8 year;
659         u8 month;
660         u8 day;
661         __le32 interval_usec;
662         u8 hour;
663         u8 minute;
664         u8 second;
665         u8 miliseconds;
666 } __packed;
667
668 /* WMI_CFG_RX_CHAIN_CMDID */
669 enum wmi_sniffer_cfg_mode {
670         WMI_SNIFFER_OFF = 0x00,
671         WMI_SNIFFER_ON  = 0x01,
672 };
673
674 enum wmi_sniffer_cfg_phy_info_mode {
675         WMI_SNIFFER_PHY_INFO_DISABLED   = 0x00,
676         WMI_SNIFFER_PHY_INFO_ENABLED    = 0x01,
677 };
678
679 enum wmi_sniffer_cfg_phy_support {
680         WMI_SNIFFER_CP          = 0x00,
681         WMI_SNIFFER_DP          = 0x01,
682         WMI_SNIFFER_BOTH_PHYS   = 0x02,
683 };
684
685 /* wmi_sniffer_cfg */
686 struct wmi_sniffer_cfg {
687         /* enum wmi_sniffer_cfg_mode */
688         __le32 mode;
689         /* enum wmi_sniffer_cfg_phy_info_mode */
690         __le32 phy_info_mode;
691         /* enum wmi_sniffer_cfg_phy_support */
692         __le32 phy_support;
693         u8 channel;
694         u8 reserved[3];
695 } __packed;
696
697 enum wmi_cfg_rx_chain_cmd_action {
698         WMI_RX_CHAIN_ADD        = 0x00,
699         WMI_RX_CHAIN_DEL        = 0x01,
700 };
701
702 enum wmi_cfg_rx_chain_cmd_decap_trans_type {
703         WMI_DECAP_TYPE_802_3            = 0x00,
704         WMI_DECAP_TYPE_NATIVE_WIFI      = 0x01,
705         WMI_DECAP_TYPE_NONE             = 0x02,
706 };
707
708 enum wmi_cfg_rx_chain_cmd_nwifi_ds_trans_type {
709         WMI_NWIFI_RX_TRANS_MODE_NO              = 0x00,
710         WMI_NWIFI_RX_TRANS_MODE_PBSS2AP         = 0x01,
711         WMI_NWIFI_RX_TRANS_MODE_PBSS2STA        = 0x02,
712 };
713
714 enum wmi_cfg_rx_chain_cmd_reorder_type {
715         WMI_RX_HW_REORDER       = 0x00,
716         WMI_RX_SW_REORDER       = 0x01,
717 };
718
719 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_POS    (0)
720 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_LEN    (1)
721 #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_MSK    (0x1)
722 #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_POS             (1)
723 #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_LEN             (1)
724 #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_MSK             (0x2)
725 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_POS            (0)
726 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_LEN            (1)
727 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_MSK            (0x1)
728 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_POS             (1)
729 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_LEN             (1)
730 #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_MSK             (0x2)
731 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_POS                 (0)
732 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_LEN                 (1)
733 #define L3_L4_CTRL_IPV4_CHECKSUM_EN_MSK                 (0x1)
734 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_POS                (1)
735 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_LEN                (1)
736 #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_MSK                (0x2)
737 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_POS           (0)
738 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_LEN           (1)
739 #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_MSK           (0x1)
740 #define RING_CTRL_OVERRIDE_WB_THRSH_POS                 (1)
741 #define RING_CTRL_OVERRIDE_WB_THRSH_LEN                 (1)
742 #define RING_CTRL_OVERRIDE_WB_THRSH_MSK                 (0x2)
743 #define RING_CTRL_OVERRIDE_ITR_THRSH_POS                (2)
744 #define RING_CTRL_OVERRIDE_ITR_THRSH_LEN                (1)
745 #define RING_CTRL_OVERRIDE_ITR_THRSH_MSK                (0x4)
746 #define RING_CTRL_OVERRIDE_HOST_THRSH_POS               (3)
747 #define RING_CTRL_OVERRIDE_HOST_THRSH_LEN               (1)
748 #define RING_CTRL_OVERRIDE_HOST_THRSH_MSK               (0x8)
749
750 /* WMI_CFG_RX_CHAIN_CMDID */
751 struct wmi_cfg_rx_chain_cmd {
752         __le32 action;
753         struct wmi_sw_ring_cfg rx_sw_ring;
754         u8 mid;
755         u8 decap_trans_type;
756         u8 l2_802_3_offload_ctrl;
757         u8 l2_nwifi_offload_ctrl;
758         u8 vlan_id;
759         u8 nwifi_ds_trans_type;
760         u8 l3_l4_ctrl;
761         u8 ring_ctrl;
762         __le16 prefetch_thrsh;
763         __le16 wb_thrsh;
764         __le32 itr_value;
765         __le16 host_thrsh;
766         u8 reorder_type;
767         u8 reserved;
768         struct wmi_sniffer_cfg sniffer_cfg;
769         __le16 max_rx_pl_per_desc;
770 } __packed;
771
772 /* WMI_RCP_ADDBA_RESP_CMDID */
773 struct wmi_rcp_addba_resp_cmd {
774         u8 cidxtid;
775         u8 dialog_token;
776         __le16 status_code;
777         /* ieee80211_ba_parameterset field to send */
778         __le16 ba_param_set;
779         __le16 ba_timeout;
780 } __packed;
781
782 /* WMI_RCP_DELBA_CMDID */
783 struct wmi_rcp_delba_cmd {
784         u8 cidxtid;
785         u8 reserved;
786         __le16 reason;
787 } __packed;
788
789 /* WMI_RCP_ADDBA_REQ_CMDID */
790 struct wmi_rcp_addba_req_cmd {
791         u8 cidxtid;
792         u8 dialog_token;
793         /* ieee80211_ba_parameterset field as it received */
794         __le16 ba_param_set;
795         __le16 ba_timeout;
796         /* ieee80211_ba_seqstrl field as it received */
797         __le16 ba_seq_ctrl;
798 } __packed;
799
800 /* WMI_SET_MAC_ADDRESS_CMDID */
801 struct wmi_set_mac_address_cmd {
802         u8 mac[WMI_MAC_LEN];
803         u8 reserved[2];
804 } __packed;
805
806 /* WMI_ECHO_CMDID
807  * Check FW is alive
808  * WMI_DEEP_ECHO_CMDID
809  * Check FW and ucode are alive
810  * Returned event: WMI_ECHO_RSP_EVENTID
811  * same event for both commands
812  */
813 struct wmi_echo_cmd {
814         __le32 value;
815 } __packed;
816
817 /* WMI_OTP_READ_CMDID */
818 struct wmi_otp_read_cmd {
819         __le32 addr;
820         __le32 size;
821         __le32 values;
822 } __packed;
823
824 /* WMI_OTP_WRITE_CMDID */
825 struct wmi_otp_write_cmd {
826         __le32 addr;
827         __le32 size;
828         __le32 values;
829 } __packed;
830
831 /* WMI_TEMP_SENSE_CMDID
832  *
833  * Measure MAC and radio temperatures
834  *
835  * Possible modes for temperature measurement
836  */
837 enum wmi_temperature_measure_mode {
838         TEMPERATURE_USE_OLD_VALUE       = 0x01,
839         TEMPERATURE_MEASURE_NOW         = 0x02,
840 };
841
842 /* WMI_TEMP_SENSE_CMDID */
843 struct wmi_temp_sense_cmd {
844         __le32 measure_baseband_en;
845         __le32 measure_rf_en;
846         __le32 measure_mode;
847 } __packed;
848
849 enum wmi_pmc_op {
850         WMI_PMC_ALLOCATE        = 0x00,
851         WMI_PMC_RELEASE         = 0x01,
852 };
853
854 /* WMI_PMC_CMDID */
855 struct wmi_pmc_cmd {
856         /* enum wmi_pmc_cmd_op_type */
857         u8 op;
858         u8 reserved;
859         __le16 ring_size;
860         __le64 mem_base;
861 } __packed;
862
863 enum wmi_aoa_meas_type {
864         WMI_AOA_PHASE_MEAS      = 0x00,
865         WMI_AOA_PHASE_AMP_MEAS  = 0x01,
866 };
867
868 /* WMI_AOA_MEAS_CMDID */
869 struct wmi_aoa_meas_cmd {
870         u8 mac_addr[WMI_MAC_LEN];
871         /* channels IDs:
872          * 0 - 58320 MHz
873          * 1 - 60480 MHz
874          * 2 - 62640 MHz
875          */
876         u8 channel;
877         /* enum wmi_aoa_meas_type */
878         u8 aoa_meas_type;
879         __le32 meas_rf_mask;
880 } __packed;
881
882 enum wmi_tof_burst_duration {
883         WMI_TOF_BURST_DURATION_250_USEC         = 2,
884         WMI_TOF_BURST_DURATION_500_USEC         = 3,
885         WMI_TOF_BURST_DURATION_1_MSEC           = 4,
886         WMI_TOF_BURST_DURATION_2_MSEC           = 5,
887         WMI_TOF_BURST_DURATION_4_MSEC           = 6,
888         WMI_TOF_BURST_DURATION_8_MSEC           = 7,
889         WMI_TOF_BURST_DURATION_16_MSEC          = 8,
890         WMI_TOF_BURST_DURATION_32_MSEC          = 9,
891         WMI_TOF_BURST_DURATION_64_MSEC          = 10,
892         WMI_TOF_BURST_DURATION_128_MSEC         = 11,
893         WMI_TOF_BURST_DURATION_NO_PREFERENCES   = 15,
894 };
895
896 enum wmi_tof_session_start_flags {
897         WMI_TOF_SESSION_START_FLAG_SECURED      = 0x1,
898         WMI_TOF_SESSION_START_FLAG_ASAP         = 0x2,
899         WMI_TOF_SESSION_START_FLAG_LCI_REQ      = 0x4,
900         WMI_TOF_SESSION_START_FLAG_LCR_REQ      = 0x8,
901 };
902
903 /* WMI_TOF_SESSION_START_CMDID */
904 struct wmi_ftm_dest_info {
905         u8 channel;
906         /* wmi_tof_session_start_flags_e */
907         u8 flags;
908         u8 initial_token;
909         u8 num_of_ftm_per_burst;
910         u8 num_of_bursts_exp;
911         /* wmi_tof_burst_duration_e */
912         u8 burst_duration;
913         /* Burst Period indicate interval between two consecutive burst
914          * instances, in units of 100 ms
915          */
916         __le16 burst_period;
917         u8 dst_mac[WMI_MAC_LEN];
918         __le16 reserved;
919 } __packed;
920
921 /* WMI_TOF_SESSION_START_CMDID */
922 struct wmi_tof_session_start_cmd {
923         __le32 session_id;
924         u8 num_of_aoa_measures;
925         u8 aoa_type;
926         __le16 num_of_dest;
927         u8 reserved[4];
928         struct wmi_ftm_dest_info ftm_dest_info[0];
929 } __packed;
930
931 enum wmi_tof_channel_info_report_type {
932         WMI_TOF_CHANNEL_INFO_TYPE_CIR                   = 0x1,
933         WMI_TOF_CHANNEL_INFO_TYPE_RSSI                  = 0x2,
934         WMI_TOF_CHANNEL_INFO_TYPE_SNR                   = 0x4,
935         WMI_TOF_CHANNEL_INFO_TYPE_DEBUG_DATA            = 0x8,
936         WMI_TOF_CHANNEL_INFO_TYPE_VENDOR_SPECIFIC       = 0x10,
937 };
938
939 /* WMI_TOF_CHANNEL_INFO_CMDID */
940 struct wmi_tof_channel_info_cmd {
941         /* wmi_tof_channel_info_report_type_e */
942         __le32 channel_info_report_request;
943 } __packed;
944
945 /* WMI Events
946  * List of Events (target to host)
947  */
948 enum wmi_event_id {
949         WMI_READY_EVENTID                               = 0x1001,
950         WMI_CONNECT_EVENTID                             = 0x1002,
951         WMI_DISCONNECT_EVENTID                          = 0x1003,
952         WMI_SCAN_COMPLETE_EVENTID                       = 0x100A,
953         WMI_REPORT_STATISTICS_EVENTID                   = 0x100B,
954         WMI_RD_MEM_RSP_EVENTID                          = 0x1800,
955         WMI_FW_READY_EVENTID                            = 0x1801,
956         WMI_EXIT_FAST_MEM_ACC_MODE_EVENTID              = 0x200,
957         WMI_ECHO_RSP_EVENTID                            = 0x1803,
958         WMI_FS_TUNE_DONE_EVENTID                        = 0x180A,
959         WMI_CORR_MEASURE_EVENTID                        = 0x180B,
960         WMI_READ_RSSI_EVENTID                           = 0x180C,
961         WMI_TEMP_SENSE_DONE_EVENTID                     = 0x180E,
962         WMI_DC_CALIB_DONE_EVENTID                       = 0x180F,
963         WMI_IQ_TX_CALIB_DONE_EVENTID                    = 0x1811,
964         WMI_IQ_RX_CALIB_DONE_EVENTID                    = 0x1812,
965         WMI_SET_WORK_MODE_DONE_EVENTID                  = 0x1815,
966         WMI_LO_LEAKAGE_CALIB_DONE_EVENTID               = 0x1816,
967         WMI_MARLON_R_READ_DONE_EVENTID                  = 0x1818,
968         WMI_MARLON_R_WRITE_DONE_EVENTID                 = 0x1819,
969         WMI_MARLON_R_TXRX_SEL_DONE_EVENTID              = 0x181A,
970         WMI_SILENT_RSSI_CALIB_DONE_EVENTID              = 0x181D,
971         WMI_RF_RX_TEST_DONE_EVENTID                     = 0x181E,
972         WMI_CFG_RX_CHAIN_DONE_EVENTID                   = 0x1820,
973         WMI_VRING_CFG_DONE_EVENTID                      = 0x1821,
974         WMI_BA_STATUS_EVENTID                           = 0x1823,
975         WMI_RCP_ADDBA_REQ_EVENTID                       = 0x1824,
976         WMI_RCP_ADDBA_RESP_SENT_EVENTID                 = 0x1825,
977         WMI_DELBA_EVENTID                               = 0x1826,
978         WMI_GET_SSID_EVENTID                            = 0x1828,
979         WMI_GET_PCP_CHANNEL_EVENTID                     = 0x182A,
980         WMI_SW_TX_COMPLETE_EVENTID                      = 0x182B,
981         WMI_READ_MAC_RXQ_EVENTID                        = 0x1830,
982         WMI_READ_MAC_TXQ_EVENTID                        = 0x1831,
983         WMI_WRITE_MAC_RXQ_EVENTID                       = 0x1832,
984         WMI_WRITE_MAC_TXQ_EVENTID                       = 0x1833,
985         WMI_WRITE_MAC_XQ_FIELD_EVENTID                  = 0x1834,
986         WMI_BEAMFORMING_MGMT_DONE_EVENTID               = 0x1836,
987         WMI_BF_TXSS_MGMT_DONE_EVENTID                   = 0x1837,
988         WMI_BF_RXSS_MGMT_DONE_EVENTID                   = 0x1839,
989         WMI_RS_MGMT_DONE_EVENTID                        = 0x1852,
990         WMI_RF_MGMT_STATUS_EVENTID                      = 0x1853,
991         WMI_THERMAL_THROTTLING_STATUS_EVENTID           = 0x1855,
992         WMI_BF_SM_MGMT_DONE_EVENTID                     = 0x1838,
993         WMI_RX_MGMT_PACKET_EVENTID                      = 0x1840,
994         WMI_TX_MGMT_PACKET_EVENTID                      = 0x1841,
995         WMI_LINK_MAINTAIN_CFG_WRITE_DONE_EVENTID        = 0x1842,
996         WMI_LINK_MAINTAIN_CFG_READ_DONE_EVENTID         = 0x1843,
997         WMI_OTP_READ_RESULT_EVENTID                     = 0x1856,
998         WMI_LED_CFG_DONE_EVENTID                        = 0x1858,
999         /* Performance monitoring events */
1000         WMI_DATA_PORT_OPEN_EVENTID                      = 0x1860,
1001         WMI_WBE_LINK_DOWN_EVENTID                       = 0x1861,
1002         WMI_BF_CTRL_DONE_EVENTID                        = 0x1862,
1003         WMI_NOTIFY_REQ_DONE_EVENTID                     = 0x1863,
1004         WMI_GET_STATUS_DONE_EVENTID                     = 0x1864,
1005         WMI_VRING_EN_EVENTID                            = 0x1865,
1006         WMI_GET_RF_STATUS_EVENTID                       = 0x1866,
1007         WMI_GET_BASEBAND_TYPE_EVENTID                   = 0x1867,
1008         WMI_UNIT_TEST_EVENTID                           = 0x1900,
1009         WMI_FLASH_READ_DONE_EVENTID                     = 0x1902,
1010         WMI_FLASH_WRITE_DONE_EVENTID                    = 0x1903,
1011         /* Power management */
1012         WMI_TRAFFIC_DEFERRAL_EVENTID                    = 0x1904,
1013         WMI_TRAFFIC_RESUME_EVENTID                      = 0x1905,
1014         /* P2P */
1015         WMI_P2P_CFG_DONE_EVENTID                        = 0x1910,
1016         WMI_PORT_ALLOCATED_EVENTID                      = 0x1911,
1017         WMI_PORT_DELETED_EVENTID                        = 0x1912,
1018         WMI_LISTEN_STARTED_EVENTID                      = 0x1914,
1019         WMI_SEARCH_STARTED_EVENTID                      = 0x1915,
1020         WMI_DISCOVERY_STARTED_EVENTID                   = 0x1916,
1021         WMI_DISCOVERY_STOPPED_EVENTID                   = 0x1917,
1022         WMI_PCP_STARTED_EVENTID                         = 0x1918,
1023         WMI_PCP_STOPPED_EVENTID                         = 0x1919,
1024         WMI_PCP_FACTOR_EVENTID                          = 0x191A,
1025         /* Power Save Configuration Events */
1026         WMI_PS_DEV_PROFILE_CFG_EVENTID                  = 0x191C,
1027         /* Not supported yet */
1028         WMI_PS_DEV_CFG_EVENTID                          = 0x191D,
1029         /* Not supported yet */
1030         WMI_PS_DEV_CFG_READ_EVENTID                     = 0x191E,
1031         /* Not supported yet */
1032         WMI_PS_MID_CFG_EVENTID                          = 0x191F,
1033         /* Not supported yet */
1034         WMI_PS_MID_CFG_READ_EVENTID                     = 0x1920,
1035         WMI_RS_CFG_DONE_EVENTID                         = 0x1921,
1036         WMI_GET_DETAILED_RS_RES_EVENTID                 = 0x1922,
1037         WMI_AOA_MEAS_EVENTID                            = 0x1923,
1038         WMI_TOF_SESSION_END_EVENTID                     = 0x1991,
1039         WMI_TOF_GET_CAPABILITIES_EVENTID                = 0x1992,
1040         WMI_TOF_SET_LCR_EVENTID                         = 0x1993,
1041         WMI_TOF_SET_LCI_EVENTID                         = 0x1994,
1042         WMI_TOF_FTM_PER_DEST_RES_EVENTID                = 0x1995,
1043         WMI_TOF_CHANNEL_INFO_EVENTID                    = 0x1996,
1044         WMI_SET_CHANNEL_EVENTID                         = 0x9000,
1045         WMI_ASSOC_REQ_EVENTID                           = 0x9001,
1046         WMI_EAPOL_RX_EVENTID                            = 0x9002,
1047         WMI_MAC_ADDR_RESP_EVENTID                       = 0x9003,
1048         WMI_FW_VER_EVENTID                              = 0x9004,
1049         WMI_ACS_PASSIVE_SCAN_COMPLETE_EVENTID           = 0x9005,
1050 };
1051
1052 /* Events data structures */
1053 enum wmi_fw_status {
1054         WMI_FW_STATUS_SUCCESS   = 0x00,
1055         WMI_FW_STATUS_FAILURE   = 0x01,
1056 };
1057
1058 /* WMI_RF_MGMT_STATUS_EVENTID */
1059 enum wmi_rf_status {
1060         WMI_RF_ENABLED          = 0x00,
1061         WMI_RF_DISABLED_HW      = 0x01,
1062         WMI_RF_DISABLED_SW      = 0x02,
1063         WMI_RF_DISABLED_HW_SW   = 0x03,
1064 };
1065
1066 /* WMI_RF_MGMT_STATUS_EVENTID */
1067 struct wmi_rf_mgmt_status_event {
1068         __le32 rf_status;
1069 } __packed;
1070
1071 /* WMI_THERMAL_THROTTLING_STATUS_EVENTID */
1072 struct wmi_thermal_throttling_status_event {
1073         __le32 time_on_usec;
1074         __le32 time_off_usec;
1075         __le32 max_txop_length_usec;
1076 } __packed;
1077
1078 /* WMI_GET_STATUS_DONE_EVENTID */
1079 struct wmi_get_status_done_event {
1080         __le32 is_associated;
1081         u8 cid;
1082         u8 reserved0[3];
1083         u8 bssid[WMI_MAC_LEN];
1084         u8 channel;
1085         u8 reserved1;
1086         u8 network_type;
1087         u8 reserved2[3];
1088         __le32 ssid_len;
1089         u8 ssid[WMI_MAX_SSID_LEN];
1090         __le32 rf_status;
1091         __le32 is_secured;
1092 } __packed;
1093
1094 /* WMI_FW_VER_EVENTID */
1095 struct wmi_fw_ver_event {
1096         /* FW image version */
1097         __le32 fw_major;
1098         __le32 fw_minor;
1099         __le32 fw_subminor;
1100         __le32 fw_build;
1101         /* FW image build time stamp */
1102         __le32 hour;
1103         __le32 minute;
1104         __le32 second;
1105         __le32 day;
1106         __le32 month;
1107         __le32 year;
1108         /* Boot Loader image version */
1109         __le32 bl_major;
1110         __le32 bl_minor;
1111         __le32 bl_subminor;
1112         __le32 bl_build;
1113         /* The number of entries in the FW capabilies array */
1114         u8 fw_capabilities_len;
1115         u8 reserved[3];
1116         /* FW capabilities info
1117          * Must be the last member of the struct
1118          */
1119         __le32 fw_capabilities[0];
1120 } __packed;
1121
1122 /* WMI_GET_RF_STATUS_EVENTID */
1123 enum rf_type {
1124         RF_UNKNOWN      = 0x00,
1125         RF_MARLON       = 0x01,
1126         RF_SPARROW      = 0x02,
1127 };
1128
1129 /* WMI_GET_RF_STATUS_EVENTID */
1130 enum board_file_rf_type {
1131         BF_RF_MARLON    = 0x00,
1132         BF_RF_SPARROW   = 0x01,
1133 };
1134
1135 /* WMI_GET_RF_STATUS_EVENTID */
1136 enum rf_status {
1137         RF_OK                   = 0x00,
1138         RF_NO_COMM              = 0x01,
1139         RF_WRONG_BOARD_FILE     = 0x02,
1140 };
1141
1142 /* WMI_GET_RF_STATUS_EVENTID */
1143 struct wmi_get_rf_status_event {
1144         /* enum rf_type */
1145         __le32 rf_type;
1146         /* attached RFs bit vector */
1147         __le32 attached_rf_vector;
1148         /* enabled RFs bit vector */
1149         __le32 enabled_rf_vector;
1150         /* enum rf_status, refers to enabled RFs */
1151         u8 rf_status[32];
1152         /* enum board file RF type */
1153         __le32 board_file_rf_type;
1154         /* board file platform type */
1155         __le32 board_file_platform_type;
1156         /* board file version */
1157         __le32 board_file_version;
1158         __le32 reserved[2];
1159 } __packed;
1160
1161 /* WMI_GET_BASEBAND_TYPE_EVENTID */
1162 enum baseband_type {
1163         BASEBAND_UNKNOWN        = 0x00,
1164         BASEBAND_SPARROW_M_A0   = 0x03,
1165         BASEBAND_SPARROW_M_A1   = 0x04,
1166         BASEBAND_SPARROW_M_B0   = 0x05,
1167         BASEBAND_SPARROW_M_C0   = 0x06,
1168         BASEBAND_SPARROW_M_D0   = 0x07,
1169 };
1170
1171 /* WMI_GET_BASEBAND_TYPE_EVENTID */
1172 struct wmi_get_baseband_type_event {
1173         /* enum baseband_type */
1174         __le32 baseband_type;
1175 } __packed;
1176
1177 /* WMI_MAC_ADDR_RESP_EVENTID */
1178 struct wmi_mac_addr_resp_event {
1179         u8 mac[WMI_MAC_LEN];
1180         u8 auth_mode;
1181         u8 crypt_mode;
1182         __le32 offload_mode;
1183 } __packed;
1184
1185 /* WMI_EAPOL_RX_EVENTID */
1186 struct wmi_eapol_rx_event {
1187         u8 src_mac[WMI_MAC_LEN];
1188         __le16 eapol_len;
1189         u8 eapol[0];
1190 } __packed;
1191
1192 /* WMI_READY_EVENTID */
1193 enum wmi_phy_capability {
1194         WMI_11A_CAPABILITY              = 0x01,
1195         WMI_11G_CAPABILITY              = 0x02,
1196         WMI_11AG_CAPABILITY             = 0x03,
1197         WMI_11NA_CAPABILITY             = 0x04,
1198         WMI_11NG_CAPABILITY             = 0x05,
1199         WMI_11NAG_CAPABILITY            = 0x06,
1200         WMI_11AD_CAPABILITY             = 0x07,
1201         WMI_11N_CAPABILITY_OFFSET       = 0x03,
1202 };
1203
1204 struct wmi_ready_event {
1205         __le32 sw_version;
1206         __le32 abi_version;
1207         u8 mac[WMI_MAC_LEN];
1208         /* enum wmi_phy_capability */
1209         u8 phy_capability;
1210         u8 numof_additional_mids;
1211 } __packed;
1212
1213 /* WMI_NOTIFY_REQ_DONE_EVENTID */
1214 struct wmi_notify_req_done_event {
1215         /* beamforming status, 0: fail; 1: OK; 2: retrying */
1216         __le32 status;
1217         __le64 tsf;
1218         __le32 snr_val;
1219         __le32 tx_tpt;
1220         __le32 tx_goodput;
1221         __le32 rx_goodput;
1222         __le16 bf_mcs;
1223         __le16 my_rx_sector;
1224         __le16 my_tx_sector;
1225         __le16 other_rx_sector;
1226         __le16 other_tx_sector;
1227         __le16 range;
1228         u8 sqi;
1229         u8 reserved[3];
1230 } __packed;
1231
1232 /* WMI_CONNECT_EVENTID */
1233 struct wmi_connect_event {
1234         u8 channel;
1235         u8 reserved0;
1236         u8 bssid[WMI_MAC_LEN];
1237         __le16 listen_interval;
1238         __le16 beacon_interval;
1239         u8 network_type;
1240         u8 reserved1[3];
1241         u8 beacon_ie_len;
1242         u8 assoc_req_len;
1243         u8 assoc_resp_len;
1244         u8 cid;
1245         u8 reserved2[3];
1246         /* not in use */
1247         u8 assoc_info[0];
1248 } __packed;
1249
1250 /* WMI_DISCONNECT_EVENTID */
1251 enum wmi_disconnect_reason {
1252         WMI_DIS_REASON_NO_NETWORK_AVAIL         = 0x01,
1253         /* bmiss */
1254         WMI_DIS_REASON_LOST_LINK                = 0x02,
1255         WMI_DIS_REASON_DISCONNECT_CMD           = 0x03,
1256         WMI_DIS_REASON_BSS_DISCONNECTED         = 0x04,
1257         WMI_DIS_REASON_AUTH_FAILED              = 0x05,
1258         WMI_DIS_REASON_ASSOC_FAILED             = 0x06,
1259         WMI_DIS_REASON_NO_RESOURCES_AVAIL       = 0x07,
1260         WMI_DIS_REASON_CSERV_DISCONNECT         = 0x08,
1261         WMI_DIS_REASON_INVALID_PROFILE          = 0x0A,
1262         WMI_DIS_REASON_DOT11H_CHANNEL_SWITCH    = 0x0B,
1263         WMI_DIS_REASON_PROFILE_MISMATCH         = 0x0C,
1264         WMI_DIS_REASON_CONNECTION_EVICTED       = 0x0D,
1265         WMI_DIS_REASON_IBSS_MERGE               = 0x0E,
1266 };
1267
1268 struct wmi_disconnect_event {
1269         /* reason code, see 802.11 spec. */
1270         __le16 protocol_reason_status;
1271         /* set if known */
1272         u8 bssid[WMI_MAC_LEN];
1273         /* see enum wmi_disconnect_reason */
1274         u8 disconnect_reason;
1275         /* last assoc req may passed to host - not in used */
1276         u8 assoc_resp_len;
1277         /* last assoc req may passed to host - not in used */
1278         u8 assoc_info[0];
1279 } __packed;
1280
1281 /* WMI_SCAN_COMPLETE_EVENTID */
1282 enum scan_status {
1283         WMI_SCAN_SUCCESS        = 0x00,
1284         WMI_SCAN_FAILED         = 0x01,
1285         WMI_SCAN_ABORTED        = 0x02,
1286         WMI_SCAN_REJECTED       = 0x03,
1287         WMI_SCAN_ABORT_REJECTED = 0x04,
1288 };
1289
1290 struct wmi_scan_complete_event {
1291         /* enum scan_status */
1292         __le32 status;
1293 } __packed;
1294
1295 /* WMI_ACS_PASSIVE_SCAN_COMPLETE_EVENT */
1296 enum wmi_acs_info_bitmask {
1297         WMI_ACS_INFO_BITMASK_BEACON_FOUND       = 0x01,
1298         WMI_ACS_INFO_BITMASK_BUSY_TIME          = 0x02,
1299         WMI_ACS_INFO_BITMASK_TX_TIME            = 0x04,
1300         WMI_ACS_INFO_BITMASK_RX_TIME            = 0x08,
1301         WMI_ACS_INFO_BITMASK_NOISE              = 0x10,
1302 };
1303
1304 struct scan_acs_info {
1305         u8 channel;
1306         u8 beacon_found;
1307         /* msec */
1308         __le16 busy_time;
1309         __le16 tx_time;
1310         __le16 rx_time;
1311         u8 noise;
1312         u8 reserved[3];
1313 } __packed;
1314
1315 struct wmi_acs_passive_scan_complete_event {
1316         __le32 dwell_time;
1317         /* valid fields within channel info according to
1318          * their appearance in struct order
1319          */
1320         __le16 filled;
1321         u8 num_scanned_channels;
1322         u8 reserved;
1323         struct scan_acs_info scan_info_list[0];
1324 } __packed;
1325
1326 /* WMI_BA_STATUS_EVENTID */
1327 enum wmi_vring_ba_status {
1328         WMI_BA_AGREED                   = 0x00,
1329         WMI_BA_NON_AGREED               = 0x01,
1330         /* BA_EN in middle of teardown flow */
1331         WMI_BA_TD_WIP                   = 0x02,
1332         /* BA_DIS or BA_EN in middle of BA SETUP flow */
1333         WMI_BA_SETUP_WIP                = 0x03,
1334         /* BA_EN when the BA session is already active */
1335         WMI_BA_SESSION_ACTIVE           = 0x04,
1336         /* BA_DIS when the BA session is not active */
1337         WMI_BA_SESSION_NOT_ACTIVE       = 0x05,
1338 };
1339
1340 struct wmi_ba_status_event {
1341         /* enum wmi_vring_ba_status */
1342         __le16 status;
1343         u8 reserved[2];
1344         u8 ringid;
1345         u8 agg_wsize;
1346         __le16 ba_timeout;
1347         u8 amsdu;
1348 } __packed;
1349
1350 /* WMI_DELBA_EVENTID */
1351 struct wmi_delba_event {
1352         u8 cidxtid;
1353         u8 from_initiator;
1354         __le16 reason;
1355 } __packed;
1356
1357 /* WMI_VRING_CFG_DONE_EVENTID */
1358 struct wmi_vring_cfg_done_event {
1359         u8 ringid;
1360         u8 status;
1361         u8 reserved[2];
1362         __le32 tx_vring_tail_ptr;
1363 } __packed;
1364
1365 /* WMI_RCP_ADDBA_RESP_SENT_EVENTID */
1366 struct wmi_rcp_addba_resp_sent_event {
1367         u8 cidxtid;
1368         u8 reserved;
1369         __le16 status;
1370 } __packed;
1371
1372 /* WMI_RCP_ADDBA_REQ_EVENTID */
1373 struct wmi_rcp_addba_req_event {
1374         u8 cidxtid;
1375         u8 dialog_token;
1376         /* ieee80211_ba_parameterset as it received */
1377         __le16 ba_param_set;
1378         __le16 ba_timeout;
1379         /* ieee80211_ba_seqstrl field as it received */
1380         __le16 ba_seq_ctrl;
1381 } __packed;
1382
1383 /* WMI_CFG_RX_CHAIN_DONE_EVENTID */
1384 enum wmi_cfg_rx_chain_done_event_status {
1385         WMI_CFG_RX_CHAIN_SUCCESS        = 0x01,
1386 };
1387
1388 struct wmi_cfg_rx_chain_done_event {
1389         /* V-Ring Tail pointer */
1390         __le32 rx_ring_tail_ptr;
1391         __le32 status;
1392 } __packed;
1393
1394 /* WMI_WBE_LINK_DOWN_EVENTID */
1395 enum wmi_wbe_link_down_event_reason {
1396         WMI_WBE_REASON_USER_REQUEST     = 0x00,
1397         WMI_WBE_REASON_RX_DISASSOC      = 0x01,
1398         WMI_WBE_REASON_BAD_PHY_LINK     = 0x02,
1399 };
1400
1401 /* WMI_WBE_LINK_DOWN_EVENTID */
1402 struct wmi_wbe_link_down_event {
1403         u8 cid;
1404         u8 reserved[3];
1405         __le32 reason;
1406 } __packed;
1407
1408 /* WMI_DATA_PORT_OPEN_EVENTID */
1409 struct wmi_data_port_open_event {
1410         u8 cid;
1411         u8 reserved[3];
1412 } __packed;
1413
1414 /* WMI_VRING_EN_EVENTID */
1415 struct wmi_vring_en_event {
1416         u8 vring_index;
1417         u8 reserved[3];
1418 } __packed;
1419
1420 /* WMI_GET_PCP_CHANNEL_EVENTID */
1421 struct wmi_get_pcp_channel_event {
1422         u8 channel;
1423         u8 reserved[3];
1424 } __packed;
1425
1426 /* WMI_P2P_CFG_DONE_EVENTID */
1427 struct wmi_p2p_cfg_done_event {
1428         /* wmi_fw_status */
1429         u8 status;
1430         u8 reserved[3];
1431 } __packed;
1432
1433 /* WMI_PORT_ALLOCATED_EVENTID */
1434 struct wmi_port_allocated_event {
1435         /* wmi_fw_status */
1436         u8 status;
1437         u8 reserved[3];
1438 } __packed;
1439
1440 /* WMI_PORT_DELETED_EVENTID */
1441 struct wmi_port_deleted_event {
1442         /* wmi_fw_status */
1443         u8 status;
1444         u8 reserved[3];
1445 } __packed;
1446
1447 /* WMI_LISTEN_STARTED_EVENTID */
1448 struct wmi_listen_started_event {
1449         /* wmi_fw_status */
1450         u8 status;
1451         u8 reserved[3];
1452 } __packed;
1453
1454 /* WMI_SEARCH_STARTED_EVENTID */
1455 struct wmi_search_started_event {
1456         /* wmi_fw_status */
1457         u8 status;
1458         u8 reserved[3];
1459 } __packed;
1460
1461 /* WMI_PCP_STARTED_EVENTID */
1462 struct wmi_pcp_started_event {
1463         /* wmi_fw_status */
1464         u8 status;
1465         u8 reserved[3];
1466 } __packed;
1467
1468 /* WMI_PCP_FACTOR_EVENTID */
1469 struct wmi_pcp_factor_event {
1470         __le32 pcp_factor;
1471 } __packed;
1472
1473 enum wmi_sw_tx_status {
1474         WMI_TX_SW_STATUS_SUCCESS                = 0x00,
1475         WMI_TX_SW_STATUS_FAILED_NO_RESOURCES    = 0x01,
1476         WMI_TX_SW_STATUS_FAILED_TX              = 0x02,
1477 };
1478
1479 /* WMI_SW_TX_COMPLETE_EVENTID */
1480 struct wmi_sw_tx_complete_event {
1481         /* enum wmi_sw_tx_status */
1482         u8 status;
1483         u8 reserved[3];
1484 } __packed;
1485
1486 /* WMI_CORR_MEASURE_EVENTID */
1487 struct wmi_corr_measure_event {
1488         /* signed */
1489         __le32 i;
1490         /* signed */
1491         __le32 q;
1492         /* signed */
1493         __le32 image_i;
1494         /* signed */
1495         __le32 image_q;
1496 } __packed;
1497
1498 /* WMI_READ_RSSI_EVENTID */
1499 struct wmi_read_rssi_event {
1500         __le32 ina_rssi_adc_dbm;
1501 } __packed;
1502
1503 /* WMI_GET_SSID_EVENTID */
1504 struct wmi_get_ssid_event {
1505         __le32 ssid_len;
1506         u8 ssid[WMI_MAX_SSID_LEN];
1507 } __packed;
1508
1509 /* wmi_rx_mgmt_info */
1510 struct wmi_rx_mgmt_info {
1511         u8 mcs;
1512         s8 snr;
1513         u8 range;
1514         u8 sqi;
1515         __le16 stype;
1516         __le16 status;
1517         __le32 len;
1518         /* Not resolved when == 0xFFFFFFFF  ==> Broadcast to all MIDS */
1519         u8 qid;
1520         /* Not resolved when == 0xFFFFFFFF  ==> Broadcast to all MIDS */
1521         u8 mid;
1522         u8 cid;
1523         /* From Radio MNGR */
1524         u8 channel;
1525 } __packed;
1526
1527 /* wmi_otp_read_write_cmd */
1528 struct wmi_otp_read_write_cmd {
1529         __le32 addr;
1530         __le32 size;
1531         u8 values[0];
1532 } __packed;
1533
1534 /* WMI_OTP_READ_RESULT_EVENTID */
1535 struct wmi_otp_read_result_event {
1536         u8 payload[0];
1537 } __packed;
1538
1539 /* WMI_TX_MGMT_PACKET_EVENTID */
1540 struct wmi_tx_mgmt_packet_event {
1541         u8 payload[0];
1542 } __packed;
1543
1544 /* WMI_RX_MGMT_PACKET_EVENTID */
1545 struct wmi_rx_mgmt_packet_event {
1546         struct wmi_rx_mgmt_info info;
1547         u8 payload[0];
1548 } __packed;
1549
1550 /* WMI_ECHO_RSP_EVENTID */
1551 struct wmi_echo_rsp_event {
1552         __le32 echoed_value;
1553 } __packed;
1554
1555 /* WMI_TEMP_SENSE_DONE_EVENTID
1556  *
1557  * Measure MAC and radio temperatures
1558  */
1559 struct wmi_temp_sense_done_event {
1560         /* Temperature times 1000 (actual temperature will be achieved by
1561          * dividing the value by 1000)
1562          */
1563         __le32 baseband_t1000;
1564         /* Temperature times 1000 (actual temperature will be achieved by
1565          * dividing the value by 1000)
1566          */
1567         __le32 rf_t1000;
1568 } __packed;
1569
1570 #define WMI_SCAN_DWELL_TIME_MS  (100)
1571 #define WMI_SURVEY_TIMEOUT_MS   (10000)
1572
1573 enum wmi_hidden_ssid {
1574         WMI_HIDDEN_SSID_DISABLED        = 0x00,
1575         WMI_HIDDEN_SSID_SEND_EMPTY      = 0x10,
1576         WMI_HIDDEN_SSID_CLEAR           = 0xFE,
1577 };
1578
1579 /* WMI_LED_CFG_CMDID
1580  *
1581  * Configure LED On\Off\Blinking operation
1582  *
1583  * Returned events:
1584  * - WMI_LED_CFG_DONE_EVENTID
1585  */
1586 enum led_mode {
1587         LED_DISABLE     = 0x00,
1588         LED_ENABLE      = 0x01,
1589 };
1590
1591 /* The names of the led as
1592  * described on HW schemes.
1593  */
1594 enum wmi_led_id {
1595         WMI_LED_WLAN    = 0x00,
1596         WMI_LED_WPAN    = 0x01,
1597         WMI_LED_WWAN    = 0x02,
1598 };
1599
1600 /* Led polarity mode. */
1601 enum wmi_led_polarity {
1602         LED_POLARITY_HIGH_ACTIVE        = 0x00,
1603         LED_POLARITY_LOW_ACTIVE         = 0x01,
1604 };
1605
1606 /* Combination of on and off
1607  * creates the blinking period
1608  */
1609 struct wmi_led_blink_mode {
1610         __le32 blink_on;
1611         __le32 blink_off;
1612 } __packed;
1613
1614 /* WMI_LED_CFG_CMDID */
1615 struct wmi_led_cfg_cmd {
1616         /* enum led_mode_e */
1617         u8 led_mode;
1618         /* enum wmi_led_id_e */
1619         u8 id;
1620         /* slow speed blinking combination */
1621         struct wmi_led_blink_mode slow_blink_cfg;
1622         /* medium speed blinking combination */
1623         struct wmi_led_blink_mode medium_blink_cfg;
1624         /* high speed blinking combination */
1625         struct wmi_led_blink_mode fast_blink_cfg;
1626         /* polarity of the led */
1627         u8 led_polarity;
1628         /* reserved */
1629         u8 reserved;
1630 } __packed;
1631
1632 /* WMI_LED_CFG_DONE_EVENTID */
1633 struct wmi_led_cfg_done_event {
1634         /* led config status */
1635         __le32 status;
1636 } __packed;
1637
1638 #define WMI_NUM_MCS     (13)
1639
1640 /* Rate search parameters configuration per connection */
1641 struct wmi_rs_cfg {
1642         /* The maximal allowed PER for each MCS
1643          * MCS will be considered as failed if PER during RS is higher
1644          */
1645         u8 per_threshold[WMI_NUM_MCS];
1646         /* Number of MPDUs for each MCS
1647          * this is the minimal statistic required to make an educated
1648          * decision
1649          */
1650         u8 min_frame_cnt[WMI_NUM_MCS];
1651         /* stop threshold [0-100] */
1652         u8 stop_th;
1653         /* MCS1 stop threshold [0-100] */
1654         u8 mcs1_fail_th;
1655         u8 max_back_failure_th;
1656         /* Debug feature for disabling internal RS trigger (which is
1657          * currently triggered by BF Done)
1658          */
1659         u8 dbg_disable_internal_trigger;
1660         __le32 back_failure_mask;
1661         __le32 mcs_en_vec;
1662 } __packed;
1663
1664 /* WMI_RS_CFG_CMDID */
1665 struct wmi_rs_cfg_cmd {
1666         /* connection id */
1667         u8 cid;
1668         /* enable or disable rate search */
1669         u8 rs_enable;
1670         /* rate search configuration */
1671         struct wmi_rs_cfg rs_cfg;
1672 } __packed;
1673
1674 /* WMI_RS_CFG_DONE_EVENTID */
1675 struct wmi_rs_cfg_done_event {
1676         u8 cid;
1677         /* enum wmi_fw_status */
1678         u8 status;
1679         u8 reserved[2];
1680 } __packed;
1681
1682 /* WMI_GET_DETAILED_RS_RES_CMDID */
1683 struct wmi_get_detailed_rs_res_cmd {
1684         /* connection id */
1685         u8 cid;
1686         u8 reserved[3];
1687 } __packed;
1688
1689 /* RS results status */
1690 enum wmi_rs_results_status {
1691         WMI_RS_RES_VALID        = 0x00,
1692         WMI_RS_RES_INVALID      = 0x01,
1693 };
1694
1695 /* Rate search results */
1696 struct wmi_rs_results {
1697         /* number of sent MPDUs */
1698         u8 num_of_tx_pkt[WMI_NUM_MCS];
1699         /* number of non-acked MPDUs */
1700         u8 num_of_non_acked_pkt[WMI_NUM_MCS];
1701         /* RS timestamp */
1702         __le32 tsf;
1703         /* RS selected MCS */
1704         u8 mcs;
1705 } __packed;
1706
1707 /* WMI_GET_DETAILED_RS_RES_EVENTID */
1708 struct wmi_get_detailed_rs_res_event {
1709         u8 cid;
1710         /* enum wmi_rs_results_status */
1711         u8 status;
1712         /* detailed rs results */
1713         struct wmi_rs_results rs_results;
1714         u8 reserved[3];
1715 } __packed;
1716
1717 /* broadcast connection ID */
1718 #define WMI_LINK_MAINTAIN_CFG_CID_BROADCAST     (0xFFFFFFFF)
1719
1720 /* Types wmi_link_maintain_cfg presets for WMI_LINK_MAINTAIN_CFG_WRITE_CMD */
1721 enum wmi_link_maintain_cfg_type {
1722         /* AP/PCP default normal (non-FST) configuration settings */
1723         WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_NORMAL_AP    = 0x00,
1724         /* AP/PCP  default FST configuration settings */
1725         WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_FST_AP       = 0x01,
1726         /* STA default normal (non-FST) configuration settings */
1727         WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_NORMAL_STA   = 0x02,
1728         /* STA default FST configuration settings */
1729         WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_FST_STA      = 0x03,
1730         /* custom configuration settings */
1731         WMI_LINK_MAINTAIN_CFG_TYPE_CUSTOM               = 0x04,
1732         /* number of defined configuration types */
1733         WMI_LINK_MAINTAIN_CFG_TYPES_NUM                 = 0x05,
1734 };
1735
1736 /* Response status codes for WMI_LINK_MAINTAIN_CFG_WRITE/READ commands */
1737 enum wmi_link_maintain_cfg_response_status {
1738         /* WMI_LINK_MAINTAIN_CFG_WRITE/READ command successfully accomplished
1739          */
1740         WMI_LINK_MAINTAIN_CFG_RESPONSE_STATUS_OK                = 0x00,
1741         /* ERROR due to bad argument in WMI_LINK_MAINTAIN_CFG_WRITE/READ
1742          * command request
1743          */
1744         WMI_LINK_MAINTAIN_CFG_RESPONSE_STATUS_BAD_ARGUMENT      = 0x01,
1745 };
1746
1747 /* Link Loss and Keep Alive configuration */
1748 struct wmi_link_maintain_cfg {
1749         /* link_loss_enable_detectors_vec */
1750         __le32 link_loss_enable_detectors_vec;
1751         /* detectors check period usec */
1752         __le32 check_link_loss_period_usec;
1753         /* max allowed tx ageing */
1754         __le32 tx_ageing_threshold_usec;
1755         /* keep alive period for high SNR */
1756         __le32 keep_alive_period_usec_high_snr;
1757         /* keep alive period for low SNR */
1758         __le32 keep_alive_period_usec_low_snr;
1759         /* lower snr limit for keep alive period update */
1760         __le32 keep_alive_snr_threshold_low_db;
1761         /* upper snr limit for keep alive period update */
1762         __le32 keep_alive_snr_threshold_high_db;
1763         /* num of successive bad bcons causing link-loss */
1764         __le32 bad_beacons_num_threshold;
1765         /* SNR limit for bad_beacons_detector */
1766         __le32 bad_beacons_snr_threshold_db;
1767 } __packed;
1768
1769 /* WMI_LINK_MAINTAIN_CFG_WRITE_CMDID */
1770 struct wmi_link_maintain_cfg_write_cmd {
1771         /* enum wmi_link_maintain_cfg_type_e - type of requested default
1772          * configuration to be applied
1773          */
1774         __le32 cfg_type;
1775         /* requested connection ID or WMI_LINK_MAINTAIN_CFG_CID_BROADCAST */
1776         __le32 cid;
1777         /* custom configuration settings to be applied (relevant only if
1778          * cfg_type==WMI_LINK_MAINTAIN_CFG_TYPE_CUSTOM)
1779          */
1780         struct wmi_link_maintain_cfg lm_cfg;
1781 } __packed;
1782
1783 /* WMI_LINK_MAINTAIN_CFG_READ_CMDID */
1784 struct wmi_link_maintain_cfg_read_cmd {
1785         /* connection ID which configuration settings are requested */
1786         __le32 cid;
1787 } __packed;
1788
1789 /* WMI_LINK_MAINTAIN_CFG_WRITE_DONE_EVENTID */
1790 struct wmi_link_maintain_cfg_write_done_event {
1791         /* requested connection ID */
1792         __le32 cid;
1793         /* wmi_link_maintain_cfg_response_status_e - write status */
1794         __le32 status;
1795 } __packed;
1796
1797 /* \WMI_LINK_MAINTAIN_CFG_READ_DONE_EVENT */
1798 struct wmi_link_maintain_cfg_read_done_event {
1799         /* requested connection ID */
1800         __le32 cid;
1801         /* wmi_link_maintain_cfg_response_status_e - read status */
1802         __le32 status;
1803         /* Retrieved configuration settings */
1804         struct wmi_link_maintain_cfg lm_cfg;
1805 } __packed;
1806
1807 enum wmi_traffic_deferral_status {
1808         WMI_TRAFFIC_DEFERRAL_APPROVED   = 0x0,
1809         WMI_TRAFFIC_DEFERRAL_REJECTED   = 0x1,
1810 };
1811
1812 /* WMI_TRAFFIC_DEFERRAL_EVENTID */
1813 struct wmi_traffic_deferral_event {
1814         /* enum wmi_traffic_deferral_status_e */
1815         u8 status;
1816 } __packed;
1817
1818 enum wmi_traffic_resume_status {
1819         WMI_TRAFFIC_RESUME_SUCCESS      = 0x0,
1820         WMI_TRAFFIC_RESUME_FAILED       = 0x1,
1821 };
1822
1823 /* WMI_TRAFFIC_RESUME_EVENTID */
1824 struct wmi_traffic_resume_event {
1825         /* enum wmi_traffic_resume_status_e */
1826         u8 status;
1827 } __packed;
1828
1829 /* Power Save command completion status codes */
1830 enum wmi_ps_cfg_cmd_status {
1831         WMI_PS_CFG_CMD_STATUS_SUCCESS   = 0x00,
1832         WMI_PS_CFG_CMD_STATUS_BAD_PARAM = 0x01,
1833         /* other error */
1834         WMI_PS_CFG_CMD_STATUS_ERROR     = 0x02,
1835 };
1836
1837 /* Device Power Save Profiles */
1838 enum wmi_ps_profile_type {
1839         WMI_PS_PROFILE_TYPE_DEFAULT             = 0x00,
1840         WMI_PS_PROFILE_TYPE_PS_DISABLED         = 0x01,
1841         WMI_PS_PROFILE_TYPE_MAX_PS              = 0x02,
1842         WMI_PS_PROFILE_TYPE_LOW_LATENCY_PS      = 0x03,
1843 };
1844
1845 /* WMI_PS_DEV_PROFILE_CFG_CMDID
1846  *
1847  * Power save profile to be used by the device
1848  *
1849  * Returned event:
1850  * - WMI_PS_DEV_PROFILE_CFG_EVENTID
1851  */
1852 struct wmi_ps_dev_profile_cfg_cmd {
1853         /* wmi_ps_profile_type_e */
1854         u8 ps_profile;
1855         u8 reserved[3];
1856 } __packed;
1857
1858 /* WMI_PS_DEV_PROFILE_CFG_EVENTID */
1859 struct wmi_ps_dev_profile_cfg_event {
1860         /* wmi_ps_cfg_cmd_status_e */
1861         __le32 status;
1862 } __packed;
1863
1864 enum wmi_ps_level {
1865         WMI_PS_LEVEL_DEEP_SLEEP         = 0x00,
1866         WMI_PS_LEVEL_SHALLOW_SLEEP      = 0x01,
1867         /* awake = all PS mechanisms are disabled */
1868         WMI_PS_LEVEL_AWAKE              = 0x02,
1869 };
1870
1871 enum wmi_ps_deep_sleep_clk_level {
1872         /* 33k */
1873         WMI_PS_DEEP_SLEEP_CLK_LEVEL_RTC         = 0x00,
1874         /* 10k */
1875         WMI_PS_DEEP_SLEEP_CLK_LEVEL_OSC         = 0x01,
1876         /* @RTC Low latency */
1877         WMI_PS_DEEP_SLEEP_CLK_LEVEL_RTC_LT      = 0x02,
1878         WMI_PS_DEEP_SLEEP_CLK_LEVEL_XTAL        = 0x03,
1879         WMI_PS_DEEP_SLEEP_CLK_LEVEL_SYSCLK      = 0x04,
1880         /* Not Applicable */
1881         WMI_PS_DEEP_SLEEP_CLK_LEVEL_N_A         = 0xFF,
1882 };
1883
1884 /* Response by the FW to a D3 entry request */
1885 enum wmi_ps_d3_resp_policy {
1886         WMI_PS_D3_RESP_POLICY_DEFAULT   = 0x00,
1887         /* debug -D3 req is always denied */
1888         WMI_PS_D3_RESP_POLICY_DENIED    = 0x01,
1889         /* debug -D3 req is always approved */
1890         WMI_PS_D3_RESP_POLICY_APPROVED  = 0x02,
1891 };
1892
1893 /* Device common power save configurations */
1894 struct wmi_ps_dev_cfg {
1895         /* lowest level of PS allowed while unassociated, enum wmi_ps_level_e
1896          */
1897         u8 ps_unassoc_min_level;
1898         /* lowest deep sleep clock level while nonassoc, enum
1899          * wmi_ps_deep_sleep_clk_level_e
1900          */
1901         u8 ps_unassoc_deep_sleep_min_level;
1902         /* lowest level of PS allowed while associated, enum wmi_ps_level_e */
1903         u8 ps_assoc_min_level;
1904         /* lowest deep sleep clock level while assoc, enum
1905          * wmi_ps_deep_sleep_clk_level_e
1906          */
1907         u8 ps_assoc_deep_sleep_min_level;
1908         /* enum wmi_ps_deep_sleep_clk_level_e */
1909         u8 ps_assoc_low_latency_ds_min_level;
1910         /* enum wmi_ps_d3_resp_policy_e */
1911         u8 ps_D3_response_policy;
1912         /* BOOL */
1913         u8 ps_D3_pm_pme_enabled;
1914         /* BOOL */
1915         u8 ps_halp_enable;
1916         u8 ps_deep_sleep_enter_thresh_msec;
1917         /* BOOL */
1918         u8 ps_voltage_scaling_en;
1919 } __packed;
1920
1921 /* WMI_PS_DEV_CFG_CMDID
1922  *
1923  * Configure common Power Save parameters of the device and all MIDs.
1924  *
1925  * Returned event:
1926  * - WMI_PS_DEV_CFG_EVENTID
1927  */
1928 struct wmi_ps_dev_cfg_cmd {
1929         /* Device Power Save configuration to be applied */
1930         struct wmi_ps_dev_cfg ps_dev_cfg;
1931         /* alignment to 32b */
1932         u8 reserved[2];
1933 } __packed;
1934
1935 /* WMI_PS_DEV_CFG_EVENTID */
1936 struct wmi_ps_dev_cfg_event {
1937         /* wmi_ps_cfg_cmd_status_e */
1938         __le32 status;
1939 } __packed;
1940
1941 /* WMI_PS_DEV_CFG_READ_CMDID
1942  *
1943  * request to retrieve  device Power Save configuration
1944  * (WMI_PS_DEV_CFG_CMD params)
1945  *
1946  * Returned event:
1947  * - WMI_PS_DEV_CFG_READ_EVENTID
1948  */
1949 struct wmi_ps_dev_cfg_read_cmd {
1950         __le32 reserved;
1951 } __packed;
1952
1953 /* WMI_PS_DEV_CFG_READ_EVENTID */
1954 struct wmi_ps_dev_cfg_read_event {
1955         /* wmi_ps_cfg_cmd_status_e */
1956         __le32 status;
1957         /* Retrieved device Power Save configuration (WMI_PS_DEV_CFG_CMD
1958          * params)
1959          */
1960         struct wmi_ps_dev_cfg dev_ps_cfg;
1961         /* alignment to 32b */
1962         u8 reserved[2];
1963 } __packed;
1964
1965 /* Per Mac Power Save configurations */
1966 struct wmi_ps_mid_cfg {
1967         /* Low power RX in BTI is enabled, BOOL */
1968         u8 beacon_lprx_enable;
1969         /* Sync to sector ID enabled, BOOL */
1970         u8 beacon_sync_to_sectorId_enable;
1971         /* Low power RX in DTI is enabled, BOOL */
1972         u8 frame_exchange_lprx_enable;
1973         /* Sleep Cycle while in scheduled PS, 1-31 */
1974         u8 scheduled_sleep_cycle_pow2;
1975         /* Stay Awake for k BIs every (sleep_cycle - k) BIs, 1-31 */
1976         u8 scheduled_num_of_awake_bis;
1977         u8 am_to_traffic_load_thresh_mbp;
1978         u8 traffic_to_am_load_thresh_mbps;
1979         u8 traffic_to_am_num_of_no_traffic_bis;
1980         /* BOOL */
1981         u8 continuous_traffic_psm;
1982         __le16 no_traffic_to_min_usec;
1983         __le16 no_traffic_to_max_usec;
1984         __le16 snoozing_sleep_interval_milisec;
1985         u8 max_no_data_awake_events;
1986         /* Trigger WEB after k failed beacons */
1987         u8 num_of_failed_beacons_rx_to_trigger_web;
1988         /* Trigger BF after k failed beacons */
1989         u8 num_of_failed_beacons_rx_to_trigger_bf;
1990         /* Trigger SOB after k successful beacons */
1991         u8 num_of_successful_beacons_rx_to_trigger_sob;
1992 } __packed;
1993
1994 /* WMI_PS_MID_CFG_CMDID
1995  *
1996  * Configure Power Save parameters of a specific MID.
1997  * These parameters are relevant for the specific BSS this MID belongs to.
1998  *
1999  * Returned event:
2000  * - WMI_PS_MID_CFG_EVENTID
2001  */
2002 struct wmi_ps_mid_cfg_cmd {
2003         /* MAC ID */
2004         u8 mid;
2005         /* mid PS configuration to be applied */
2006         struct wmi_ps_mid_cfg ps_mid_cfg;
2007 } __packed;
2008
2009 /* WMI_PS_MID_CFG_EVENTID */
2010 struct wmi_ps_mid_cfg_event {
2011         /* MAC ID */
2012         u8 mid;
2013         /* alignment to 32b */
2014         u8 reserved[3];
2015         /* wmi_ps_cfg_cmd_status_e */
2016         __le32 status;
2017 } __packed;
2018
2019 /* WMI_PS_MID_CFG_READ_CMDID
2020  *
2021  * request to retrieve Power Save configuration of mid
2022  * (WMI_PS_MID_CFG_CMD params)
2023  *
2024  * Returned event:
2025  * - WMI_PS_MID_CFG_READ_EVENTID
2026  */
2027 struct wmi_ps_mid_cfg_read_cmd {
2028         /* MAC ID */
2029         u8 mid;
2030         /* alignment to 32b */
2031         u8 reserved[3];
2032 } __packed;
2033
2034 /* WMI_PS_MID_CFG_READ_EVENTID */
2035 struct wmi_ps_mid_cfg_read_event {
2036         /* MAC ID */
2037         u8 mid;
2038         /* Retrieved MID Power Save configuration(WMI_PS_MID_CFG_CMD params) */
2039         struct wmi_ps_mid_cfg mid_ps_cfg;
2040         /* wmi_ps_cfg_cmd_status_e */
2041         __le32 status;
2042 } __packed;
2043
2044 #define WMI_AOA_MAX_DATA_SIZE   (128)
2045
2046 enum wmi_aoa_meas_status {
2047         WMI_AOA_MEAS_SUCCESS            = 0x00,
2048         WMI_AOA_MEAS_PEER_INCAPABLE     = 0x01,
2049         WMI_AOA_MEAS_FAILURE            = 0x02,
2050 };
2051
2052 /* WMI_AOA_MEAS_EVENTID */
2053 struct wmi_aoa_meas_event {
2054         u8 mac_addr[WMI_MAC_LEN];
2055         /* channels IDs:
2056          * 0 - 58320 MHz
2057          * 1 - 60480 MHz
2058          * 2 - 62640 MHz
2059          */
2060         u8 channel;
2061         /* enum wmi_aoa_meas_type */
2062         u8 aoa_meas_type;
2063         /* Measurments are from RFs, defined by the mask */
2064         __le32 meas_rf_mask;
2065         /* enum wmi_aoa_meas_status */
2066         u8 meas_status;
2067         u8 reserved;
2068         /* Length of meas_data in bytes */
2069         __le16 length;
2070         u8 meas_data[WMI_AOA_MAX_DATA_SIZE];
2071 } __packed;
2072
2073 /* WMI_TOF_GET_CAPABILITIES_EVENTID */
2074 struct wmi_tof_get_capabilities_event {
2075         u8 ftm_capability;
2076         /* maximum supported number of destination to start TOF */
2077         u8 max_num_of_dest;
2078         /* maximum supported number of measurements per burst */
2079         u8 max_num_of_meas_per_burst;
2080         u8 reserved;
2081         /* maximum supported multi bursts */
2082         __le16 max_multi_bursts_sessions;
2083         /* maximum supported FTM burst duration , wmi_tof_burst_duration_e */
2084         __le16 max_ftm_burst_duration;
2085         /* AOA supported types */
2086         __le32 aoa_supported_types;
2087 } __packed;
2088
2089 enum wmi_tof_session_end_status {
2090         WMI_TOF_SESSION_END_NO_ERROR            = 0x00,
2091         WMI_TOF_SESSION_END_FAIL                = 0x01,
2092         WMI_TOF_SESSION_END_PARAMS_ERROR        = 0x02,
2093         WMI_TOF_SESSION_END_ABORTED             = 0x03,
2094 };
2095
2096 /* WMI_TOF_SESSION_END_EVENTID */
2097 struct wmi_tof_session_end_event {
2098         /* FTM session ID */
2099         __le32 session_id;
2100         /* wmi_tof_session_end_status_e */
2101         u8 status;
2102         u8 reserved[3];
2103 } __packed;
2104
2105 /* Responder FTM Results */
2106 struct wmi_responder_ftm_res {
2107         u8 t1[6];
2108         u8 t2[6];
2109         u8 t3[6];
2110         u8 t4[6];
2111         __le16 tod_err;
2112         __le16 toa_err;
2113         __le16 tod_err_initiator;
2114         __le16 toa_err_initiator;
2115 } __packed;
2116
2117 enum wmi_tof_ftm_per_dest_res_status {
2118         WMI_PER_DEST_RES_NO_ERROR               = 0x00,
2119         WMI_PER_DEST_RES_TX_RX_FAIL             = 0x01,
2120         WMI_PER_DEST_RES_PARAM_DONT_MATCH       = 0x02,
2121 };
2122
2123 enum wmi_tof_ftm_per_dest_res_flags {
2124         WMI_PER_DEST_RES_REQ_START              = 0x01,
2125         WMI_PER_DEST_RES_BURST_REPORT_END       = 0x02,
2126         WMI_PER_DEST_RES_REQ_END                = 0x04,
2127         WMI_PER_DEST_RES_PARAM_UPDATE           = 0x08,
2128 };
2129
2130 /* WMI_TOF_FTM_PER_DEST_RES_EVENTID */
2131 struct wmi_tof_ftm_per_dest_res_event {
2132         /* FTM session ID */
2133         __le32 session_id;
2134         /* destination MAC address */
2135         u8 dst_mac[WMI_MAC_LEN];
2136         /* wmi_tof_ftm_per_dest_res_flags_e */
2137         u8 flags;
2138         /* wmi_tof_ftm_per_dest_res_status_e */
2139         u8 status;
2140         /* responder ASAP */
2141         u8 responder_asap;
2142         /* responder number of FTM per burst */
2143         u8 responder_num_ftm_per_burst;
2144         /* responder number of FTM burst exponent */
2145         u8 responder_num_ftm_bursts_exp;
2146         /* responder burst duration ,wmi_tof_burst_duration_e */
2147         u8 responder_burst_duration;
2148         /* responder burst period, indicate interval between two consecutive
2149          * burst instances, in units of 100 ms
2150          */
2151         __le16 responder_burst_period;
2152         /* receive burst counter */
2153         __le16 bursts_cnt;
2154         /* tsf of responder start burst */
2155         __le32 tsf_sync;
2156         /* actual received ftm per burst */
2157         u8 actual_ftm_per_burst;
2158         u8 reserved0[7];
2159         struct wmi_responder_ftm_res responder_ftm_res[0];
2160 } __packed;
2161
2162 enum wmi_tof_channel_info_type {
2163         WMI_TOF_CHANNEL_INFO_AOA                = 0x00,
2164         WMI_TOF_CHANNEL_INFO_LCI                = 0x01,
2165         WMI_TOF_CHANNEL_INFO_LCR                = 0x02,
2166         WMI_TOF_CHANNEL_INFO_VENDOR_SPECIFIC    = 0x03,
2167         WMI_TOF_CHANNEL_INFO_CIR                = 0x04,
2168         WMI_TOF_CHANNEL_INFO_RSSI               = 0x05,
2169         WMI_TOF_CHANNEL_INFO_SNR                = 0x06,
2170         WMI_TOF_CHANNEL_INFO_DEBUG              = 0x07,
2171 };
2172
2173 /* WMI_TOF_CHANNEL_INFO_EVENTID */
2174 struct wmi_tof_channel_info_event {
2175         /* FTM session ID */
2176         __le32 session_id;
2177         /* destination MAC address */
2178         u8 dst_mac[WMI_MAC_LEN];
2179         /* wmi_tof_channel_info_type_e */
2180         u8 type;
2181         /* data report length */
2182         u8 len;
2183         /* data report payload */
2184         u8 report[0];
2185 } __packed;
2186
2187 #endif /* __WILOCITY_WMI_H__ */