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