xref: /openbmc/linux/drivers/net/wireless/ath/wil6210/wmi.h (revision 90ffabb08b7d0627239c7dd53c3c7065a158508c)
12be7d22fSVladimir Kondratiev /*
2849a564bSDedy Lansky  * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
3b874ddecSLior David  * Copyright (c) 2006-2012 Wilocity
42be7d22fSVladimir Kondratiev  *
52be7d22fSVladimir Kondratiev  * Permission to use, copy, modify, and/or distribute this software for any
62be7d22fSVladimir Kondratiev  * purpose with or without fee is hereby granted, provided that the above
72be7d22fSVladimir Kondratiev  * copyright notice and this permission notice appear in all copies.
82be7d22fSVladimir Kondratiev  *
92be7d22fSVladimir Kondratiev  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
102be7d22fSVladimir Kondratiev  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
112be7d22fSVladimir Kondratiev  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
122be7d22fSVladimir Kondratiev  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
132be7d22fSVladimir Kondratiev  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
142be7d22fSVladimir Kondratiev  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
152be7d22fSVladimir Kondratiev  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
162be7d22fSVladimir Kondratiev  */
172be7d22fSVladimir Kondratiev 
182be7d22fSVladimir Kondratiev /*
192be7d22fSVladimir Kondratiev  * This file contains the definitions of the WMI protocol specified in the
20b874ddecSLior David  * Wireless Module Interface (WMI) for the Qualcomm
21b874ddecSLior David  * 60 GHz wireless solution.
222be7d22fSVladimir Kondratiev  * It includes definitions of all the commands and events.
232be7d22fSVladimir Kondratiev  * Commands are messages from the host to the WM.
242be7d22fSVladimir Kondratiev  * Events are messages from the WM to the host.
25b874ddecSLior David  *
26b874ddecSLior David  * This is an automatically generated file.
272be7d22fSVladimir Kondratiev  */
282be7d22fSVladimir Kondratiev 
292be7d22fSVladimir Kondratiev #ifndef __WILOCITY_WMI_H__
302be7d22fSVladimir Kondratiev #define __WILOCITY_WMI_H__
312be7d22fSVladimir Kondratiev 
322be7d22fSVladimir Kondratiev /* General */
33b874ddecSLior David #define WMI_MAX_ASSOC_STA		(8)
34b874ddecSLior David #define WMI_DEFAULT_ASSOC_STA		(1)
352be7d22fSVladimir Kondratiev #define WMI_MAC_LEN			(6)
362be7d22fSVladimir Kondratiev #define WMI_PROX_RANGE_NUM		(3)
37b874ddecSLior David #define WMI_MAX_LOSS_DMG_BEACONS	(20)
388ae5d62cSLior David #define MAX_NUM_OF_SECTORS		(128)
39b874ddecSLior David 
40b874ddecSLior David /* Mailbox interface
41b874ddecSLior David  * used for commands and events
42b874ddecSLior David  */
43b874ddecSLior David enum wmi_mid {
44b874ddecSLior David 	MID_DEFAULT		= 0x00,
45b874ddecSLior David 	FIRST_DBG_MID_ID	= 0x10,
46b874ddecSLior David 	LAST_DBG_MID_ID		= 0xFE,
47b874ddecSLior David 	MID_BROADCAST		= 0xFF,
48b874ddecSLior David };
49b874ddecSLior David 
5008989f96SLior David /* FW capability IDs
5108989f96SLior David  * Each ID maps to a bit in a 32-bit bitmask value provided by the FW to
5208989f96SLior David  * the host
5308989f96SLior David  */
5408989f96SLior David enum wmi_fw_capability {
5508989f96SLior David 	WMI_FW_CAPABILITY_FTM			= 0,
5608989f96SLior David 	WMI_FW_CAPABILITY_PS_CONFIG		= 1,
57cbf795c1SLior David 	WMI_FW_CAPABILITY_RF_SECTORS		= 2,
58cbf795c1SLior David 	WMI_FW_CAPABILITY_MGMT_RETRY_LIMIT	= 3,
59849a564bSDedy Lansky 	WMI_FW_CAPABILITY_DISABLE_AP_SME	= 4,
600d2370e9SDedy Lansky 	WMI_FW_CAPABILITY_WMI_ONLY		= 5,
61*90ffabb0SDedy Lansky 	WMI_FW_CAPABILITY_THERMAL_THROTTLING	= 7,
6208989f96SLior David 	WMI_FW_CAPABILITY_MAX,
6308989f96SLior David };
6408989f96SLior David 
65b874ddecSLior David /* WMI_CMD_HDR */
66b874ddecSLior David struct wmi_cmd_hdr {
67b874ddecSLior David 	u8 mid;
68b874ddecSLior David 	u8 reserved;
69b874ddecSLior David 	__le16 command_id;
70b874ddecSLior David 	__le32 fw_timestamp;
71b874ddecSLior David } __packed;
722be7d22fSVladimir Kondratiev 
732be7d22fSVladimir Kondratiev /* List of Commands */
742be7d22fSVladimir Kondratiev enum wmi_command_id {
75b874ddecSLior David 	WMI_CONNECT_CMDID				= 0x01,
76b874ddecSLior David 	WMI_DISCONNECT_CMDID				= 0x03,
77b874ddecSLior David 	WMI_DISCONNECT_STA_CMDID			= 0x04,
78b874ddecSLior David 	WMI_START_SCAN_CMDID				= 0x07,
79b874ddecSLior David 	WMI_SET_BSS_FILTER_CMDID			= 0x09,
80b874ddecSLior David 	WMI_SET_PROBED_SSID_CMDID			= 0x0A,
81b874ddecSLior David 	WMI_SET_LISTEN_INT_CMDID			= 0x0B,
82b874ddecSLior David 	WMI_BCON_CTRL_CMDID				= 0x0F,
83b874ddecSLior David 	WMI_ADD_CIPHER_KEY_CMDID			= 0x16,
84b874ddecSLior David 	WMI_DELETE_CIPHER_KEY_CMDID			= 0x17,
85b874ddecSLior David 	WMI_PCP_CONF_CMDID				= 0x18,
86b874ddecSLior David 	WMI_SET_APPIE_CMDID				= 0x3F,
87b874ddecSLior David 	WMI_SET_WSC_STATUS_CMDID			= 0x41,
88b874ddecSLior David 	WMI_PXMT_RANGE_CFG_CMDID			= 0x42,
89b874ddecSLior David 	WMI_PXMT_SNR2_RANGE_CFG_CMDID			= 0x43,
90b874ddecSLior David 	WMI_MEM_READ_CMDID				= 0x800,
91b874ddecSLior David 	WMI_MEM_WR_CMDID				= 0x801,
92b874ddecSLior David 	WMI_ECHO_CMDID					= 0x803,
93b874ddecSLior David 	WMI_DEEP_ECHO_CMDID				= 0x804,
94b874ddecSLior David 	WMI_CONFIG_MAC_CMDID				= 0x805,
95b874ddecSLior David 	WMI_CONFIG_PHY_DEBUG_CMDID			= 0x806,
96b874ddecSLior David 	WMI_ADD_DEBUG_TX_PCKT_CMDID			= 0x808,
97b874ddecSLior David 	WMI_PHY_GET_STATISTICS_CMDID			= 0x809,
98b874ddecSLior David 	WMI_FS_TUNE_CMDID				= 0x80A,
99b874ddecSLior David 	WMI_CORR_MEASURE_CMDID				= 0x80B,
100b874ddecSLior David 	WMI_READ_RSSI_CMDID				= 0x80C,
101b874ddecSLior David 	WMI_TEMP_SENSE_CMDID				= 0x80E,
102b874ddecSLior David 	WMI_DC_CALIB_CMDID				= 0x80F,
103b874ddecSLior David 	WMI_SEND_TONE_CMDID				= 0x810,
104b874ddecSLior David 	WMI_IQ_TX_CALIB_CMDID				= 0x811,
105b874ddecSLior David 	WMI_IQ_RX_CALIB_CMDID				= 0x812,
106b874ddecSLior David 	WMI_SET_UCODE_IDLE_CMDID			= 0x813,
107b874ddecSLior David 	WMI_SET_WORK_MODE_CMDID				= 0x815,
108b874ddecSLior David 	WMI_LO_LEAKAGE_CALIB_CMDID			= 0x816,
109b874ddecSLior David 	WMI_MARLON_R_READ_CMDID				= 0x818,
110b874ddecSLior David 	WMI_MARLON_R_WRITE_CMDID			= 0x819,
111b874ddecSLior David 	WMI_MARLON_R_TXRX_SEL_CMDID			= 0x81A,
112b874ddecSLior David 	MAC_IO_STATIC_PARAMS_CMDID			= 0x81B,
113b874ddecSLior David 	MAC_IO_DYNAMIC_PARAMS_CMDID			= 0x81C,
114b874ddecSLior David 	WMI_SILENT_RSSI_CALIB_CMDID			= 0x81D,
115b874ddecSLior David 	WMI_RF_RX_TEST_CMDID				= 0x81E,
116b874ddecSLior David 	WMI_CFG_RX_CHAIN_CMDID				= 0x820,
117b874ddecSLior David 	WMI_VRING_CFG_CMDID				= 0x821,
118b874ddecSLior David 	WMI_BCAST_VRING_CFG_CMDID			= 0x822,
119b874ddecSLior David 	WMI_VRING_BA_EN_CMDID				= 0x823,
120b874ddecSLior David 	WMI_VRING_BA_DIS_CMDID				= 0x824,
121b874ddecSLior David 	WMI_RCP_ADDBA_RESP_CMDID			= 0x825,
122b874ddecSLior David 	WMI_RCP_DELBA_CMDID				= 0x826,
123b874ddecSLior David 	WMI_SET_SSID_CMDID				= 0x827,
124b874ddecSLior David 	WMI_GET_SSID_CMDID				= 0x828,
125b874ddecSLior David 	WMI_SET_PCP_CHANNEL_CMDID			= 0x829,
126b874ddecSLior David 	WMI_GET_PCP_CHANNEL_CMDID			= 0x82A,
127b874ddecSLior David 	WMI_SW_TX_REQ_CMDID				= 0x82B,
128b874ddecSLior David 	WMI_READ_MAC_RXQ_CMDID				= 0x830,
129b874ddecSLior David 	WMI_READ_MAC_TXQ_CMDID				= 0x831,
130b874ddecSLior David 	WMI_WRITE_MAC_RXQ_CMDID				= 0x832,
131b874ddecSLior David 	WMI_WRITE_MAC_TXQ_CMDID				= 0x833,
132b874ddecSLior David 	WMI_WRITE_MAC_XQ_FIELD_CMDID			= 0x834,
133b874ddecSLior David 	WMI_MLME_PUSH_CMDID				= 0x835,
134b874ddecSLior David 	WMI_BEAMFORMING_MGMT_CMDID			= 0x836,
135b874ddecSLior David 	WMI_BF_TXSS_MGMT_CMDID				= 0x837,
136b874ddecSLior David 	WMI_BF_SM_MGMT_CMDID				= 0x838,
137b874ddecSLior David 	WMI_BF_RXSS_MGMT_CMDID				= 0x839,
138b874ddecSLior David 	WMI_BF_TRIG_CMDID				= 0x83A,
1390163b031SMaya Erez 	WMI_LINK_MAINTAIN_CFG_WRITE_CMDID		= 0x842,
1400163b031SMaya Erez 	WMI_LINK_MAINTAIN_CFG_READ_CMDID		= 0x843,
141b874ddecSLior David 	WMI_SET_SECTORS_CMDID				= 0x849,
142b874ddecSLior David 	WMI_MAINTAIN_PAUSE_CMDID			= 0x850,
143b874ddecSLior David 	WMI_MAINTAIN_RESUME_CMDID			= 0x851,
144b874ddecSLior David 	WMI_RS_MGMT_CMDID				= 0x852,
145b874ddecSLior David 	WMI_RF_MGMT_CMDID				= 0x853,
146b874ddecSLior David 	WMI_OTP_READ_CMDID				= 0x856,
147b874ddecSLior David 	WMI_OTP_WRITE_CMDID				= 0x857,
14810d599adSMaya Erez 	WMI_LED_CFG_CMDID				= 0x858,
1492be7d22fSVladimir Kondratiev 	/* Performance monitoring commands */
150b874ddecSLior David 	WMI_BF_CTRL_CMDID				= 0x862,
151b874ddecSLior David 	WMI_NOTIFY_REQ_CMDID				= 0x863,
152b874ddecSLior David 	WMI_GET_STATUS_CMDID				= 0x864,
1530163b031SMaya Erez 	WMI_GET_RF_STATUS_CMDID				= 0x866,
1540163b031SMaya Erez 	WMI_GET_BASEBAND_TYPE_CMDID			= 0x867,
155b874ddecSLior David 	WMI_UNIT_TEST_CMDID				= 0x900,
156b874ddecSLior David 	WMI_HICCUP_CMDID				= 0x901,
157b874ddecSLior David 	WMI_FLASH_READ_CMDID				= 0x902,
158b874ddecSLior David 	WMI_FLASH_WRITE_CMDID				= 0x903,
1590163b031SMaya Erez 	/* Power management */
1600163b031SMaya Erez 	WMI_TRAFFIC_DEFERRAL_CMDID			= 0x904,
1610163b031SMaya Erez 	WMI_TRAFFIC_RESUME_CMDID			= 0x905,
162b8023177SVladimir Kondratiev 	/* P2P */
163b874ddecSLior David 	WMI_P2P_CFG_CMDID				= 0x910,
164b874ddecSLior David 	WMI_PORT_ALLOCATE_CMDID				= 0x911,
165b874ddecSLior David 	WMI_PORT_DELETE_CMDID				= 0x912,
166b874ddecSLior David 	WMI_POWER_MGMT_CFG_CMDID			= 0x913,
167b874ddecSLior David 	WMI_START_LISTEN_CMDID				= 0x914,
168b874ddecSLior David 	WMI_START_SEARCH_CMDID				= 0x915,
169b874ddecSLior David 	WMI_DISCOVERY_START_CMDID			= 0x916,
170b874ddecSLior David 	WMI_DISCOVERY_STOP_CMDID			= 0x917,
171b874ddecSLior David 	WMI_PCP_START_CMDID				= 0x918,
172b874ddecSLior David 	WMI_PCP_STOP_CMDID				= 0x919,
173b874ddecSLior David 	WMI_GET_PCP_FACTOR_CMDID			= 0x91B,
1740163b031SMaya Erez 	/* Power Save Configuration Commands */
1750163b031SMaya Erez 	WMI_PS_DEV_PROFILE_CFG_CMDID			= 0x91C,
1760163b031SMaya Erez 	/* Not supported yet */
1770163b031SMaya Erez 	WMI_PS_DEV_CFG_CMDID				= 0x91D,
1780163b031SMaya Erez 	/* Not supported yet */
1790163b031SMaya Erez 	WMI_PS_DEV_CFG_READ_CMDID			= 0x91E,
1800163b031SMaya Erez 	/* Per MAC Power Save Configuration commands
1810163b031SMaya Erez 	 * Not supported yet
1820163b031SMaya Erez 	 */
1830163b031SMaya Erez 	WMI_PS_MID_CFG_CMDID				= 0x91F,
1840163b031SMaya Erez 	/* Not supported yet */
1850163b031SMaya Erez 	WMI_PS_MID_CFG_READ_CMDID			= 0x920,
1860163b031SMaya Erez 	WMI_RS_CFG_CMDID				= 0x921,
18708989f96SLior David 	WMI_GET_DETAILED_RS_RES_CMDID			= 0x922,
18808989f96SLior David 	WMI_AOA_MEAS_CMDID				= 0x923,
189a52fb913SLior David 	WMI_BRP_SET_ANT_LIMIT_CMDID			= 0x924,
190cbf795c1SLior David 	WMI_SET_MGMT_RETRY_LIMIT_CMDID			= 0x930,
191cbf795c1SLior David 	WMI_GET_MGMT_RETRY_LIMIT_CMDID			= 0x931,
192849a564bSDedy Lansky 	WMI_NEW_STA_CMDID				= 0x935,
193849a564bSDedy Lansky 	WMI_DEL_STA_CMDID				= 0x936,
194*90ffabb0SDedy Lansky 	WMI_SET_THERMAL_THROTTLING_CFG_CMDID		= 0x940,
195*90ffabb0SDedy Lansky 	WMI_GET_THERMAL_THROTTLING_CFG_CMDID		= 0x941,
19608989f96SLior David 	WMI_TOF_SESSION_START_CMDID			= 0x991,
19708989f96SLior David 	WMI_TOF_GET_CAPABILITIES_CMDID			= 0x992,
19808989f96SLior David 	WMI_TOF_SET_LCR_CMDID				= 0x993,
19908989f96SLior David 	WMI_TOF_SET_LCI_CMDID				= 0x994,
20008989f96SLior David 	WMI_TOF_CHANNEL_INFO_CMDID			= 0x995,
2018ae5d62cSLior David 	WMI_TOF_SET_TX_RX_OFFSET_CMDID			= 0x997,
2028ae5d62cSLior David 	WMI_TOF_GET_TX_RX_OFFSET_CMDID			= 0x998,
203cbf795c1SLior David 	WMI_GET_RF_SECTOR_PARAMS_CMDID			= 0x9A0,
204cbf795c1SLior David 	WMI_SET_RF_SECTOR_PARAMS_CMDID			= 0x9A1,
205cbf795c1SLior David 	WMI_GET_SELECTED_RF_SECTOR_INDEX_CMDID		= 0x9A2,
206cbf795c1SLior David 	WMI_SET_SELECTED_RF_SECTOR_INDEX_CMDID		= 0x9A3,
207cbf795c1SLior David 	WMI_SET_RF_SECTOR_ON_CMDID			= 0x9A4,
2088ae5d62cSLior David 	WMI_PRIO_TX_SECTORS_ORDER_CMDID			= 0x9A5,
2098ae5d62cSLior David 	WMI_PRIO_TX_SECTORS_NUMBER_CMDID		= 0x9A6,
2108ae5d62cSLior David 	WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_CMDID	= 0x9A7,
211b874ddecSLior David 	WMI_SET_MAC_ADDRESS_CMDID			= 0xF003,
212b874ddecSLior David 	WMI_ABORT_SCAN_CMDID				= 0xF007,
213b874ddecSLior David 	WMI_SET_PROMISCUOUS_MODE_CMDID			= 0xF041,
214b874ddecSLior David 	WMI_GET_PMK_CMDID				= 0xF048,
215b874ddecSLior David 	WMI_SET_PASSPHRASE_CMDID			= 0xF049,
216b874ddecSLior David 	WMI_SEND_ASSOC_RES_CMDID			= 0xF04A,
217b874ddecSLior David 	WMI_SET_ASSOC_REQ_RELAY_CMDID			= 0xF04B,
218b874ddecSLior David 	WMI_MAC_ADDR_REQ_CMDID				= 0xF04D,
219b874ddecSLior David 	WMI_FW_VER_CMDID				= 0xF04E,
220b874ddecSLior David 	WMI_PMC_CMDID					= 0xF04F,
2212be7d22fSVladimir Kondratiev };
2222be7d22fSVladimir Kondratiev 
223b874ddecSLior David /* WMI_CONNECT_CMDID */
2242be7d22fSVladimir Kondratiev enum wmi_network_type {
2252be7d22fSVladimir Kondratiev 	WMI_NETTYPE_INFRA		= 0x01,
2262be7d22fSVladimir Kondratiev 	WMI_NETTYPE_ADHOC		= 0x02,
2272be7d22fSVladimir Kondratiev 	WMI_NETTYPE_ADHOC_CREATOR	= 0x04,
2282be7d22fSVladimir Kondratiev 	WMI_NETTYPE_AP			= 0x10,
2292be7d22fSVladimir Kondratiev 	WMI_NETTYPE_P2P			= 0x20,
230b874ddecSLior David 	/* PCIE over 60g */
231b874ddecSLior David 	WMI_NETTYPE_WBE			= 0x40,
2322be7d22fSVladimir Kondratiev };
2332be7d22fSVladimir Kondratiev 
2342be7d22fSVladimir Kondratiev enum wmi_dot11_auth_mode {
2352be7d22fSVladimir Kondratiev 	WMI_AUTH11_OPEN		= 0x01,
2362be7d22fSVladimir Kondratiev 	WMI_AUTH11_SHARED	= 0x02,
2372be7d22fSVladimir Kondratiev 	WMI_AUTH11_LEAP		= 0x04,
2382be7d22fSVladimir Kondratiev 	WMI_AUTH11_WSC		= 0x08,
2392be7d22fSVladimir Kondratiev };
2402be7d22fSVladimir Kondratiev 
2412be7d22fSVladimir Kondratiev enum wmi_auth_mode {
2422be7d22fSVladimir Kondratiev 	WMI_AUTH_NONE		= 0x01,
2432be7d22fSVladimir Kondratiev 	WMI_AUTH_WPA		= 0x02,
2442be7d22fSVladimir Kondratiev 	WMI_AUTH_WPA2		= 0x04,
2452be7d22fSVladimir Kondratiev 	WMI_AUTH_WPA_PSK	= 0x08,
2462be7d22fSVladimir Kondratiev 	WMI_AUTH_WPA2_PSK	= 0x10,
2472be7d22fSVladimir Kondratiev 	WMI_AUTH_WPA_CCKM	= 0x20,
2482be7d22fSVladimir Kondratiev 	WMI_AUTH_WPA2_CCKM	= 0x40,
2492be7d22fSVladimir Kondratiev };
2502be7d22fSVladimir Kondratiev 
2512be7d22fSVladimir Kondratiev enum wmi_crypto_type {
2522be7d22fSVladimir Kondratiev 	WMI_CRYPT_NONE		= 0x01,
2532be7d22fSVladimir Kondratiev 	WMI_CRYPT_AES_GCMP	= 0x20,
2542be7d22fSVladimir Kondratiev };
2552be7d22fSVladimir Kondratiev 
2562be7d22fSVladimir Kondratiev enum wmi_connect_ctrl_flag_bits {
257b874ddecSLior David 	WMI_CONNECT_ASSOC_POLICY_USER		= 0x01,
258b874ddecSLior David 	WMI_CONNECT_SEND_REASSOC		= 0x02,
259b874ddecSLior David 	WMI_CONNECT_IGNORE_WPA_GROUP_CIPHER	= 0x04,
260b874ddecSLior David 	WMI_CONNECT_PROFILE_MATCH_DONE		= 0x08,
261b874ddecSLior David 	WMI_CONNECT_IGNORE_AAC_BEACON		= 0x10,
262b874ddecSLior David 	WMI_CONNECT_CSA_FOLLOW_BSS		= 0x20,
263b874ddecSLior David 	WMI_CONNECT_DO_WPA_OFFLOAD		= 0x40,
264b874ddecSLior David 	WMI_CONNECT_DO_NOT_DEAUTH		= 0x80,
2652be7d22fSVladimir Kondratiev };
2662be7d22fSVladimir Kondratiev 
2672be7d22fSVladimir Kondratiev #define WMI_MAX_SSID_LEN	(32)
2682be7d22fSVladimir Kondratiev 
269b874ddecSLior David /* WMI_CONNECT_CMDID */
2702be7d22fSVladimir Kondratiev struct wmi_connect_cmd {
2712be7d22fSVladimir Kondratiev 	u8 network_type;
2722be7d22fSVladimir Kondratiev 	u8 dot11_auth_mode;
2732be7d22fSVladimir Kondratiev 	u8 auth_mode;
2742be7d22fSVladimir Kondratiev 	u8 pairwise_crypto_type;
2752be7d22fSVladimir Kondratiev 	u8 pairwise_crypto_len;
2762be7d22fSVladimir Kondratiev 	u8 group_crypto_type;
2772be7d22fSVladimir Kondratiev 	u8 group_crypto_len;
2782be7d22fSVladimir Kondratiev 	u8 ssid_len;
2792be7d22fSVladimir Kondratiev 	u8 ssid[WMI_MAX_SSID_LEN];
2802be7d22fSVladimir Kondratiev 	u8 channel;
2812be7d22fSVladimir Kondratiev 	u8 reserved0;
2822be7d22fSVladimir Kondratiev 	u8 bssid[WMI_MAC_LEN];
2832be7d22fSVladimir Kondratiev 	__le32 ctrl_flags;
2842be7d22fSVladimir Kondratiev 	u8 dst_mac[WMI_MAC_LEN];
2852be7d22fSVladimir Kondratiev 	u8 reserved1[2];
2862be7d22fSVladimir Kondratiev } __packed;
2872be7d22fSVladimir Kondratiev 
288b874ddecSLior David /* WMI_DISCONNECT_STA_CMDID */
289b8023177SVladimir Kondratiev struct wmi_disconnect_sta_cmd {
290b8023177SVladimir Kondratiev 	u8 dst_mac[WMI_MAC_LEN];
291b8023177SVladimir Kondratiev 	__le16 disconnect_reason;
292b8023177SVladimir Kondratiev } __packed;
2932be7d22fSVladimir Kondratiev 
2942be7d22fSVladimir Kondratiev #define WMI_MAX_KEY_INDEX	(3)
2952be7d22fSVladimir Kondratiev #define WMI_MAX_KEY_LEN		(32)
2962be7d22fSVladimir Kondratiev #define WMI_PASSPHRASE_LEN	(64)
2972be7d22fSVladimir Kondratiev 
298b874ddecSLior David /* WMI_SET_PASSPHRASE_CMDID */
2992be7d22fSVladimir Kondratiev struct wmi_set_passphrase_cmd {
3002be7d22fSVladimir Kondratiev 	u8 ssid[WMI_MAX_SSID_LEN];
3012be7d22fSVladimir Kondratiev 	u8 passphrase[WMI_PASSPHRASE_LEN];
3022be7d22fSVladimir Kondratiev 	u8 ssid_len;
3032be7d22fSVladimir Kondratiev 	u8 passphrase_len;
3042be7d22fSVladimir Kondratiev } __packed;
3052be7d22fSVladimir Kondratiev 
306b874ddecSLior David /* WMI_ADD_CIPHER_KEY_CMDID */
3072be7d22fSVladimir Kondratiev enum wmi_key_usage {
308b874ddecSLior David 	WMI_KEY_USE_PAIRWISE	= 0x00,
309b874ddecSLior David 	WMI_KEY_USE_RX_GROUP	= 0x01,
310b874ddecSLior David 	WMI_KEY_USE_TX_GROUP	= 0x02,
3112be7d22fSVladimir Kondratiev };
3122be7d22fSVladimir Kondratiev 
3132be7d22fSVladimir Kondratiev struct wmi_add_cipher_key_cmd {
3142be7d22fSVladimir Kondratiev 	u8 key_index;
3152be7d22fSVladimir Kondratiev 	u8 key_type;
316b874ddecSLior David 	/* enum wmi_key_usage */
317b874ddecSLior David 	u8 key_usage;
3182be7d22fSVladimir Kondratiev 	u8 key_len;
319b874ddecSLior David 	/* key replay sequence counter */
320b874ddecSLior David 	u8 key_rsc[8];
3212be7d22fSVladimir Kondratiev 	u8 key[WMI_MAX_KEY_LEN];
322b874ddecSLior David 	/* Additional Key Control information */
323b874ddecSLior David 	u8 key_op_ctrl;
3242be7d22fSVladimir Kondratiev 	u8 mac[WMI_MAC_LEN];
3252be7d22fSVladimir Kondratiev } __packed;
3262be7d22fSVladimir Kondratiev 
327b874ddecSLior David /* WMI_DELETE_CIPHER_KEY_CMDID */
3282be7d22fSVladimir Kondratiev struct wmi_delete_cipher_key_cmd {
3292be7d22fSVladimir Kondratiev 	u8 key_index;
3302be7d22fSVladimir Kondratiev 	u8 mac[WMI_MAC_LEN];
3312be7d22fSVladimir Kondratiev } __packed;
3322be7d22fSVladimir Kondratiev 
333b874ddecSLior David /* WMI_START_SCAN_CMDID
3342be7d22fSVladimir Kondratiev  *
3352be7d22fSVladimir Kondratiev  * Start L1 scan operation
3362be7d22fSVladimir Kondratiev  *
3372be7d22fSVladimir Kondratiev  * Returned events:
3382be7d22fSVladimir Kondratiev  * - WMI_RX_MGMT_PACKET_EVENTID - for every probe resp.
3392be7d22fSVladimir Kondratiev  * - WMI_SCAN_COMPLETE_EVENTID
3402be7d22fSVladimir Kondratiev  */
3412be7d22fSVladimir Kondratiev enum wmi_scan_type {
342b874ddecSLior David 	WMI_ACTIVE_SCAN		= 0x00,
343b874ddecSLior David 	WMI_SHORT_SCAN		= 0x01,
344b874ddecSLior David 	WMI_PASSIVE_SCAN	= 0x02,
345b874ddecSLior David 	WMI_DIRECT_SCAN		= 0x03,
346b874ddecSLior David 	WMI_LONG_SCAN		= 0x04,
3472be7d22fSVladimir Kondratiev };
3482be7d22fSVladimir Kondratiev 
349b874ddecSLior David /* WMI_START_SCAN_CMDID */
3502be7d22fSVladimir Kondratiev struct wmi_start_scan_cmd {
351b874ddecSLior David 	u8 direct_scan_mac_addr[WMI_MAC_LEN];
3520163b031SMaya Erez 	/* run scan with discovery beacon. Relevant for ACTIVE scan only. */
35374997a53SLior David 	u8 discovery_mode;
35474997a53SLior David 	u8 reserved;
355b874ddecSLior David 	/* Max duration in the home channel(ms) */
356b874ddecSLior David 	__le32 dwell_time;
357b874ddecSLior David 	/* Time interval between scans (ms) */
358b874ddecSLior David 	__le32 force_scan_interval;
359b874ddecSLior David 	/* enum wmi_scan_type */
360b874ddecSLior David 	u8 scan_type;
361b874ddecSLior David 	/* how many channels follow */
362b874ddecSLior David 	u8 num_channels;
363b874ddecSLior David 	/* channels ID's:
364b874ddecSLior David 	 * 0 - 58320 MHz
365b874ddecSLior David 	 * 1 - 60480 MHz
366b874ddecSLior David 	 * 2 - 62640 MHz
367b874ddecSLior David 	 */
3682be7d22fSVladimir Kondratiev 	struct {
3692be7d22fSVladimir Kondratiev 		u8 channel;
3702be7d22fSVladimir Kondratiev 		u8 reserved;
371b874ddecSLior David 	} channel_list[0];
3722be7d22fSVladimir Kondratiev } __packed;
3732be7d22fSVladimir Kondratiev 
374b874ddecSLior David /* WMI_SET_PROBED_SSID_CMDID */
375b8023177SVladimir Kondratiev #define MAX_PROBED_SSID_INDEX	(3)
3762be7d22fSVladimir Kondratiev 
3772be7d22fSVladimir Kondratiev enum wmi_ssid_flag {
378b874ddecSLior David 	/* disables entry */
379b874ddecSLior David 	WMI_SSID_FLAG_DISABLE	= 0x00,
380b874ddecSLior David 	/* probes specified ssid */
381b874ddecSLior David 	WMI_SSID_FLAG_SPECIFIC	= 0x01,
382b874ddecSLior David 	/* probes for any ssid */
383b874ddecSLior David 	WMI_SSID_FLAG_ANY	= 0x02,
3842be7d22fSVladimir Kondratiev };
3852be7d22fSVladimir Kondratiev 
3862be7d22fSVladimir Kondratiev struct wmi_probed_ssid_cmd {
387b874ddecSLior David 	/* 0 to MAX_PROBED_SSID_INDEX */
388b874ddecSLior David 	u8 entry_index;
389b874ddecSLior David 	/* enum wmi_ssid_flag */
390b874ddecSLior David 	u8 flag;
3912be7d22fSVladimir Kondratiev 	u8 ssid_len;
3922be7d22fSVladimir Kondratiev 	u8 ssid[WMI_MAX_SSID_LEN];
3932be7d22fSVladimir Kondratiev } __packed;
3942be7d22fSVladimir Kondratiev 
395b874ddecSLior David /* WMI_SET_APPIE_CMDID
3962be7d22fSVladimir Kondratiev  * Add Application specified IE to a management frame
3972be7d22fSVladimir Kondratiev  */
398b8023177SVladimir Kondratiev #define WMI_MAX_IE_LEN	(1024)
399b8023177SVladimir Kondratiev 
400b874ddecSLior David /* Frame Types */
401b8023177SVladimir Kondratiev enum wmi_mgmt_frame_type {
402b874ddecSLior David 	WMI_FRAME_BEACON	= 0x00,
403b874ddecSLior David 	WMI_FRAME_PROBE_REQ	= 0x01,
404b874ddecSLior David 	WMI_FRAME_PROBE_RESP	= 0x02,
405b874ddecSLior David 	WMI_FRAME_ASSOC_REQ	= 0x03,
406b874ddecSLior David 	WMI_FRAME_ASSOC_RESP	= 0x04,
407b874ddecSLior David 	WMI_NUM_MGMT_FRAME	= 0x05,
408b8023177SVladimir Kondratiev };
409b8023177SVladimir Kondratiev 
4102be7d22fSVladimir Kondratiev struct wmi_set_appie_cmd {
411b874ddecSLior David 	/* enum wmi_mgmt_frame_type */
412b874ddecSLior David 	u8 mgmt_frm_type;
4132be7d22fSVladimir Kondratiev 	u8 reserved;
414b874ddecSLior David 	/* Length of the IE to be added to MGMT frame */
415b874ddecSLior David 	__le16 ie_len;
4162be7d22fSVladimir Kondratiev 	u8 ie_info[0];
4172be7d22fSVladimir Kondratiev } __packed;
4182be7d22fSVladimir Kondratiev 
419b874ddecSLior David /* WMI_PXMT_RANGE_CFG_CMDID */
4202be7d22fSVladimir Kondratiev struct wmi_pxmt_range_cfg_cmd {
4212be7d22fSVladimir Kondratiev 	u8 dst_mac[WMI_MAC_LEN];
4222be7d22fSVladimir Kondratiev 	__le16 range;
4232be7d22fSVladimir Kondratiev } __packed;
4242be7d22fSVladimir Kondratiev 
425b874ddecSLior David /* WMI_PXMT_SNR2_RANGE_CFG_CMDID */
4262be7d22fSVladimir Kondratiev struct wmi_pxmt_snr2_range_cfg_cmd {
427b874ddecSLior David 	s8 snr2range_arr[2];
4282be7d22fSVladimir Kondratiev } __packed;
4292be7d22fSVladimir Kondratiev 
430b874ddecSLior David /* WMI_RF_MGMT_CMDID */
4312be7d22fSVladimir Kondratiev enum wmi_rf_mgmt_type {
432b874ddecSLior David 	WMI_RF_MGMT_W_DISABLE	= 0x00,
433b874ddecSLior David 	WMI_RF_MGMT_W_ENABLE	= 0x01,
434b874ddecSLior David 	WMI_RF_MGMT_GET_STATUS	= 0x02,
4352be7d22fSVladimir Kondratiev };
4362be7d22fSVladimir Kondratiev 
437b874ddecSLior David /* WMI_RF_MGMT_CMDID */
4382be7d22fSVladimir Kondratiev struct wmi_rf_mgmt_cmd {
4392be7d22fSVladimir Kondratiev 	__le32 rf_mgmt_type;
4402be7d22fSVladimir Kondratiev } __packed;
4412be7d22fSVladimir Kondratiev 
442b874ddecSLior David /* WMI_RF_RX_TEST_CMDID */
443b8023177SVladimir Kondratiev struct wmi_rf_rx_test_cmd {
444b8023177SVladimir Kondratiev 	__le32 sector;
445b8023177SVladimir Kondratiev } __packed;
446b8023177SVladimir Kondratiev 
447b874ddecSLior David /* WMI_CORR_MEASURE_CMDID */
448b8023177SVladimir Kondratiev struct wmi_corr_measure_cmd {
449b874ddecSLior David 	__le32 freq_mhz;
450b8023177SVladimir Kondratiev 	__le32 length_samples;
451b8023177SVladimir Kondratiev 	__le32 iterations;
452b8023177SVladimir Kondratiev } __packed;
453b8023177SVladimir Kondratiev 
454b874ddecSLior David /* WMI_SET_SSID_CMDID */
4552be7d22fSVladimir Kondratiev struct wmi_set_ssid_cmd {
4562be7d22fSVladimir Kondratiev 	__le32 ssid_len;
4572be7d22fSVladimir Kondratiev 	u8 ssid[WMI_MAX_SSID_LEN];
4582be7d22fSVladimir Kondratiev } __packed;
4592be7d22fSVladimir Kondratiev 
460b874ddecSLior David /* WMI_SET_PCP_CHANNEL_CMDID */
4612be7d22fSVladimir Kondratiev struct wmi_set_pcp_channel_cmd {
4622be7d22fSVladimir Kondratiev 	u8 channel;
4632be7d22fSVladimir Kondratiev 	u8 reserved[3];
4642be7d22fSVladimir Kondratiev } __packed;
4652be7d22fSVladimir Kondratiev 
466b874ddecSLior David /* WMI_BCON_CTRL_CMDID */
4672be7d22fSVladimir Kondratiev struct wmi_bcon_ctrl_cmd {
4682be7d22fSVladimir Kondratiev 	__le16 bcon_interval;
4692be7d22fSVladimir Kondratiev 	__le16 frag_num;
4702be7d22fSVladimir Kondratiev 	__le64 ss_mask;
4712be7d22fSVladimir Kondratiev 	u8 network_type;
4726c2faf09SVladimir Kondratiev 	u8 pcp_max_assoc_sta;
4732be7d22fSVladimir Kondratiev 	u8 disable_sec_offload;
4742be7d22fSVladimir Kondratiev 	u8 disable_sec;
475b874ddecSLior David 	u8 hidden_ssid;
476b874ddecSLior David 	u8 is_go;
477b874ddecSLior David 	u8 reserved[2];
4782be7d22fSVladimir Kondratiev } __packed;
4792be7d22fSVladimir Kondratiev 
480b874ddecSLior David /* WMI_PORT_ALLOCATE_CMDID */
481b8023177SVladimir Kondratiev enum wmi_port_role {
482b874ddecSLior David 	WMI_PORT_STA		= 0x00,
483b874ddecSLior David 	WMI_PORT_PCP		= 0x01,
484b874ddecSLior David 	WMI_PORT_AP		= 0x02,
485b874ddecSLior David 	WMI_PORT_P2P_DEV	= 0x03,
486b874ddecSLior David 	WMI_PORT_P2P_CLIENT	= 0x04,
487b874ddecSLior David 	WMI_PORT_P2P_GO		= 0x05,
488b8023177SVladimir Kondratiev };
489b8023177SVladimir Kondratiev 
490b874ddecSLior David /* WMI_PORT_ALLOCATE_CMDID */
491b8023177SVladimir Kondratiev struct wmi_port_allocate_cmd {
492b8023177SVladimir Kondratiev 	u8 mac[WMI_MAC_LEN];
493b8023177SVladimir Kondratiev 	u8 port_role;
4946c2faf09SVladimir Kondratiev 	u8 mid;
495b8023177SVladimir Kondratiev } __packed;
496b8023177SVladimir Kondratiev 
497b874ddecSLior David /* WMI_PORT_DELETE_CMDID */
498b874ddecSLior David struct wmi_port_delete_cmd {
499b8023177SVladimir Kondratiev 	u8 mid;
500b8023177SVladimir Kondratiev 	u8 reserved[3];
501b8023177SVladimir Kondratiev } __packed;
502b8023177SVladimir Kondratiev 
5030163b031SMaya Erez /* WMI_TRAFFIC_DEFERRAL_CMDID */
5040163b031SMaya Erez struct wmi_traffic_deferral_cmd {
5050163b031SMaya Erez 	/* Bit vector: bit[0] - wake on Unicast, bit[1] - wake on Broadcast */
5060163b031SMaya Erez 	u8 wakeup_trigger;
5070163b031SMaya Erez } __packed;
5080163b031SMaya Erez 
509b874ddecSLior David /* WMI_P2P_CFG_CMDID */
510b8023177SVladimir Kondratiev enum wmi_discovery_mode {
511b874ddecSLior David 	WMI_DISCOVERY_MODE_NON_OFFLOAD	= 0x00,
512b874ddecSLior David 	WMI_DISCOVERY_MODE_OFFLOAD	= 0x01,
513b874ddecSLior David 	WMI_DISCOVERY_MODE_PEER2PEER	= 0x02,
514b8023177SVladimir Kondratiev };
515b8023177SVladimir Kondratiev 
516b8023177SVladimir Kondratiev struct wmi_p2p_cfg_cmd {
517b874ddecSLior David 	/* enum wmi_discovery_mode */
518b874ddecSLior David 	u8 discovery_mode;
519b8023177SVladimir Kondratiev 	u8 channel;
520b874ddecSLior David 	/* base to listen/search duration calculation */
521b874ddecSLior David 	__le16 bcon_interval;
522b8023177SVladimir Kondratiev } __packed;
523b8023177SVladimir Kondratiev 
524b874ddecSLior David /* WMI_POWER_MGMT_CFG_CMDID */
525b8023177SVladimir Kondratiev enum wmi_power_source_type {
526b874ddecSLior David 	WMI_POWER_SOURCE_BATTERY	= 0x00,
527b874ddecSLior David 	WMI_POWER_SOURCE_OTHER		= 0x01,
528b8023177SVladimir Kondratiev };
529b8023177SVladimir Kondratiev 
530b8023177SVladimir Kondratiev struct wmi_power_mgmt_cfg_cmd {
531b874ddecSLior David 	/* enum wmi_power_source_type */
532b874ddecSLior David 	u8 power_source;
533b8023177SVladimir Kondratiev 	u8 reserved[3];
534b8023177SVladimir Kondratiev } __packed;
535b8023177SVladimir Kondratiev 
536b874ddecSLior David /* WMI_PCP_START_CMDID */
537b8023177SVladimir Kondratiev struct wmi_pcp_start_cmd {
538b8023177SVladimir Kondratiev 	__le16 bcon_interval;
5396c2faf09SVladimir Kondratiev 	u8 pcp_max_assoc_sta;
5408e52fe30SHamad Kadmany 	u8 hidden_ssid;
541b874ddecSLior David 	u8 is_go;
542a52fb913SLior David 	u8 reserved0[5];
543*90ffabb0SDedy Lansky 	/* A-BFT length override if non-0 */
544a52fb913SLior David 	u8 abft_len;
545849a564bSDedy Lansky 	u8 disable_ap_sme;
546b8023177SVladimir Kondratiev 	u8 network_type;
547b8023177SVladimir Kondratiev 	u8 channel;
548b8023177SVladimir Kondratiev 	u8 disable_sec_offload;
549b8023177SVladimir Kondratiev 	u8 disable_sec;
550b8023177SVladimir Kondratiev } __packed;
551b8023177SVladimir Kondratiev 
552b874ddecSLior David /* WMI_SW_TX_REQ_CMDID */
5532be7d22fSVladimir Kondratiev struct wmi_sw_tx_req_cmd {
5542be7d22fSVladimir Kondratiev 	u8 dst_mac[WMI_MAC_LEN];
5552be7d22fSVladimir Kondratiev 	__le16 len;
5562be7d22fSVladimir Kondratiev 	u8 payload[0];
5572be7d22fSVladimir Kondratiev } __packed;
5582be7d22fSVladimir Kondratiev 
5592be7d22fSVladimir Kondratiev struct wmi_sw_ring_cfg {
5602be7d22fSVladimir Kondratiev 	__le64 ring_mem_base;
5612be7d22fSVladimir Kondratiev 	__le16 ring_size;
5622be7d22fSVladimir Kondratiev 	__le16 max_mpdu_size;
5632be7d22fSVladimir Kondratiev } __packed;
5642be7d22fSVladimir Kondratiev 
565b874ddecSLior David /* wmi_vring_cfg_schd */
5662be7d22fSVladimir Kondratiev struct wmi_vring_cfg_schd {
5672be7d22fSVladimir Kondratiev 	__le16 priority;
5682be7d22fSVladimir Kondratiev 	__le16 timeslot_us;
5692be7d22fSVladimir Kondratiev } __packed;
5702be7d22fSVladimir Kondratiev 
5712be7d22fSVladimir Kondratiev enum wmi_vring_cfg_encap_trans_type {
572b874ddecSLior David 	WMI_VRING_ENC_TYPE_802_3	= 0x00,
573b874ddecSLior David 	WMI_VRING_ENC_TYPE_NATIVE_WIFI	= 0x01,
5742be7d22fSVladimir Kondratiev };
5752be7d22fSVladimir Kondratiev 
5762be7d22fSVladimir Kondratiev enum wmi_vring_cfg_ds_cfg {
577b874ddecSLior David 	WMI_VRING_DS_PBSS	= 0x00,
578b874ddecSLior David 	WMI_VRING_DS_STATION	= 0x01,
579b874ddecSLior David 	WMI_VRING_DS_AP		= 0x02,
580b874ddecSLior David 	WMI_VRING_DS_ADDR4	= 0x03,
5812be7d22fSVladimir Kondratiev };
5822be7d22fSVladimir Kondratiev 
5832be7d22fSVladimir Kondratiev enum wmi_vring_cfg_nwifi_ds_trans_type {
584b874ddecSLior David 	WMI_NWIFI_TX_TRANS_MODE_NO		= 0x00,
585b874ddecSLior David 	WMI_NWIFI_TX_TRANS_MODE_AP2PBSS		= 0x01,
586b874ddecSLior David 	WMI_NWIFI_TX_TRANS_MODE_STA2PBSS	= 0x02,
5872be7d22fSVladimir Kondratiev };
5882be7d22fSVladimir Kondratiev 
5892be7d22fSVladimir Kondratiev enum wmi_vring_cfg_schd_params_priority {
590b874ddecSLior David 	WMI_SCH_PRIO_REGULAR	= 0x00,
591b874ddecSLior David 	WMI_SCH_PRIO_HIGH	= 0x01,
5922be7d22fSVladimir Kondratiev };
5932be7d22fSVladimir Kondratiev 
5942be7d22fSVladimir Kondratiev #define CIDXTID_CID_POS				(0)
5952be7d22fSVladimir Kondratiev #define CIDXTID_CID_LEN				(4)
5962be7d22fSVladimir Kondratiev #define CIDXTID_CID_MSK				(0xF)
5972be7d22fSVladimir Kondratiev #define CIDXTID_TID_POS				(4)
5982be7d22fSVladimir Kondratiev #define CIDXTID_TID_LEN				(4)
5992be7d22fSVladimir Kondratiev #define CIDXTID_TID_MSK				(0xF0)
6002be7d22fSVladimir Kondratiev #define VRING_CFG_MAC_CTRL_LIFETIME_EN_POS	(0)
6012be7d22fSVladimir Kondratiev #define VRING_CFG_MAC_CTRL_LIFETIME_EN_LEN	(1)
6022be7d22fSVladimir Kondratiev #define VRING_CFG_MAC_CTRL_LIFETIME_EN_MSK	(0x1)
6032be7d22fSVladimir Kondratiev #define VRING_CFG_MAC_CTRL_AGGR_EN_POS		(1)
6042be7d22fSVladimir Kondratiev #define VRING_CFG_MAC_CTRL_AGGR_EN_LEN		(1)
6052be7d22fSVladimir Kondratiev #define VRING_CFG_MAC_CTRL_AGGR_EN_MSK		(0x2)
6062be7d22fSVladimir Kondratiev #define VRING_CFG_TO_RESOLUTION_VALUE_POS	(0)
6072be7d22fSVladimir Kondratiev #define VRING_CFG_TO_RESOLUTION_VALUE_LEN	(6)
6082be7d22fSVladimir Kondratiev #define VRING_CFG_TO_RESOLUTION_VALUE_MSK	(0x3F)
609b874ddecSLior David 
610b874ddecSLior David struct wmi_vring_cfg {
611b874ddecSLior David 	struct wmi_sw_ring_cfg tx_sw_ring;
612b874ddecSLior David 	/* 0-23 vrings */
613b874ddecSLior David 	u8 ringid;
614b874ddecSLior David 	u8 cidxtid;
615b874ddecSLior David 	u8 encap_trans_type;
616b874ddecSLior David 	/* 802.3 DS cfg */
617b874ddecSLior David 	u8 ds_cfg;
618b874ddecSLior David 	u8 nwifi_ds_trans_type;
619b874ddecSLior David 	u8 mac_ctrl;
6202be7d22fSVladimir Kondratiev 	u8 to_resolution;
6212be7d22fSVladimir Kondratiev 	u8 agg_max_wsize;
6222be7d22fSVladimir Kondratiev 	struct wmi_vring_cfg_schd schd_params;
6232be7d22fSVladimir Kondratiev } __packed;
6242be7d22fSVladimir Kondratiev 
6252be7d22fSVladimir Kondratiev enum wmi_vring_cfg_cmd_action {
626b874ddecSLior David 	WMI_VRING_CMD_ADD	= 0x00,
627b874ddecSLior David 	WMI_VRING_CMD_MODIFY	= 0x01,
628b874ddecSLior David 	WMI_VRING_CMD_DELETE	= 0x02,
6292be7d22fSVladimir Kondratiev };
6302be7d22fSVladimir Kondratiev 
631b874ddecSLior David /* WMI_VRING_CFG_CMDID */
6322be7d22fSVladimir Kondratiev struct wmi_vring_cfg_cmd {
6332be7d22fSVladimir Kondratiev 	__le32 action;
6342be7d22fSVladimir Kondratiev 	struct wmi_vring_cfg vring_cfg;
6352be7d22fSVladimir Kondratiev } __packed;
6362be7d22fSVladimir Kondratiev 
63762bfd300SVladimir Kondratiev struct wmi_bcast_vring_cfg {
63862bfd300SVladimir Kondratiev 	struct wmi_sw_ring_cfg tx_sw_ring;
639b874ddecSLior David 	/* 0-23 vrings */
640b874ddecSLior David 	u8 ringid;
64162bfd300SVladimir Kondratiev 	u8 encap_trans_type;
642b874ddecSLior David 	/* 802.3 DS cfg */
643b874ddecSLior David 	u8 ds_cfg;
64462bfd300SVladimir Kondratiev 	u8 nwifi_ds_trans_type;
64562bfd300SVladimir Kondratiev } __packed;
64662bfd300SVladimir Kondratiev 
647b874ddecSLior David /* WMI_BCAST_VRING_CFG_CMDID */
64862bfd300SVladimir Kondratiev struct wmi_bcast_vring_cfg_cmd {
64962bfd300SVladimir Kondratiev 	__le32 action;
65062bfd300SVladimir Kondratiev 	struct wmi_bcast_vring_cfg vring_cfg;
65162bfd300SVladimir Kondratiev } __packed;
65262bfd300SVladimir Kondratiev 
653b874ddecSLior David /* WMI_VRING_BA_EN_CMDID */
6542be7d22fSVladimir Kondratiev struct wmi_vring_ba_en_cmd {
6552be7d22fSVladimir Kondratiev 	u8 ringid;
6562be7d22fSVladimir Kondratiev 	u8 agg_max_wsize;
6572be7d22fSVladimir Kondratiev 	__le16 ba_timeout;
658cbcf5866SVladimir Kondratiev 	u8 amsdu;
659b874ddecSLior David 	u8 reserved[3];
6602be7d22fSVladimir Kondratiev } __packed;
6612be7d22fSVladimir Kondratiev 
662b874ddecSLior David /* WMI_VRING_BA_DIS_CMDID */
6632be7d22fSVladimir Kondratiev struct wmi_vring_ba_dis_cmd {
6642be7d22fSVladimir Kondratiev 	u8 ringid;
6652be7d22fSVladimir Kondratiev 	u8 reserved;
6662be7d22fSVladimir Kondratiev 	__le16 reason;
6672be7d22fSVladimir Kondratiev } __packed;
6682be7d22fSVladimir Kondratiev 
669b874ddecSLior David /* WMI_NOTIFY_REQ_CMDID */
6702be7d22fSVladimir Kondratiev struct wmi_notify_req_cmd {
6712be7d22fSVladimir Kondratiev 	u8 cid;
672b8023177SVladimir Kondratiev 	u8 year;
673b8023177SVladimir Kondratiev 	u8 month;
674b8023177SVladimir Kondratiev 	u8 day;
6752be7d22fSVladimir Kondratiev 	__le32 interval_usec;
676b8023177SVladimir Kondratiev 	u8 hour;
677b8023177SVladimir Kondratiev 	u8 minute;
678b8023177SVladimir Kondratiev 	u8 second;
679b8023177SVladimir Kondratiev 	u8 miliseconds;
6802be7d22fSVladimir Kondratiev } __packed;
6812be7d22fSVladimir Kondratiev 
682b874ddecSLior David /* WMI_CFG_RX_CHAIN_CMDID */
6832be7d22fSVladimir Kondratiev enum wmi_sniffer_cfg_mode {
684b874ddecSLior David 	WMI_SNIFFER_OFF	= 0x00,
685b874ddecSLior David 	WMI_SNIFFER_ON	= 0x01,
6862be7d22fSVladimir Kondratiev };
6872be7d22fSVladimir Kondratiev 
6882be7d22fSVladimir Kondratiev enum wmi_sniffer_cfg_phy_info_mode {
689b874ddecSLior David 	WMI_SNIFFER_PHY_INFO_DISABLED	= 0x00,
690b874ddecSLior David 	WMI_SNIFFER_PHY_INFO_ENABLED	= 0x01,
6912be7d22fSVladimir Kondratiev };
6922be7d22fSVladimir Kondratiev 
6932be7d22fSVladimir Kondratiev enum wmi_sniffer_cfg_phy_support {
694b874ddecSLior David 	WMI_SNIFFER_CP		= 0x00,
695b874ddecSLior David 	WMI_SNIFFER_DP		= 0x01,
696b874ddecSLior David 	WMI_SNIFFER_BOTH_PHYS	= 0x02,
6972be7d22fSVladimir Kondratiev };
6982be7d22fSVladimir Kondratiev 
699b874ddecSLior David /* wmi_sniffer_cfg */
7002be7d22fSVladimir Kondratiev struct wmi_sniffer_cfg {
701b874ddecSLior David 	/* enum wmi_sniffer_cfg_mode */
702b874ddecSLior David 	__le32 mode;
703b874ddecSLior David 	/* enum wmi_sniffer_cfg_phy_info_mode */
704b874ddecSLior David 	__le32 phy_info_mode;
705b874ddecSLior David 	/* enum wmi_sniffer_cfg_phy_support */
706b874ddecSLior David 	__le32 phy_support;
7072be7d22fSVladimir Kondratiev 	u8 channel;
7082be7d22fSVladimir Kondratiev 	u8 reserved[3];
7092be7d22fSVladimir Kondratiev } __packed;
7102be7d22fSVladimir Kondratiev 
7112be7d22fSVladimir Kondratiev enum wmi_cfg_rx_chain_cmd_action {
712b874ddecSLior David 	WMI_RX_CHAIN_ADD	= 0x00,
713b874ddecSLior David 	WMI_RX_CHAIN_DEL	= 0x01,
7142be7d22fSVladimir Kondratiev };
7152be7d22fSVladimir Kondratiev 
7162be7d22fSVladimir Kondratiev enum wmi_cfg_rx_chain_cmd_decap_trans_type {
717b874ddecSLior David 	WMI_DECAP_TYPE_802_3		= 0x00,
718b874ddecSLior David 	WMI_DECAP_TYPE_NATIVE_WIFI	= 0x01,
719b874ddecSLior David 	WMI_DECAP_TYPE_NONE		= 0x02,
7202be7d22fSVladimir Kondratiev };
7212be7d22fSVladimir Kondratiev 
7222be7d22fSVladimir Kondratiev enum wmi_cfg_rx_chain_cmd_nwifi_ds_trans_type {
723b874ddecSLior David 	WMI_NWIFI_RX_TRANS_MODE_NO		= 0x00,
724b874ddecSLior David 	WMI_NWIFI_RX_TRANS_MODE_PBSS2AP		= 0x01,
725b874ddecSLior David 	WMI_NWIFI_RX_TRANS_MODE_PBSS2STA	= 0x02,
7262be7d22fSVladimir Kondratiev };
7272be7d22fSVladimir Kondratiev 
728b8023177SVladimir Kondratiev enum wmi_cfg_rx_chain_cmd_reorder_type {
729b874ddecSLior David 	WMI_RX_HW_REORDER	= 0x00,
730b874ddecSLior David 	WMI_RX_SW_REORDER	= 0x01,
731b8023177SVladimir Kondratiev };
732b8023177SVladimir Kondratiev 
7332be7d22fSVladimir Kondratiev #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_POS	(0)
7342be7d22fSVladimir Kondratiev #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_LEN	(1)
7352be7d22fSVladimir Kondratiev #define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_MSK	(0x1)
736c406ea7cSVladimir Kondratiev #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_POS		(1)
737c406ea7cSVladimir Kondratiev #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_LEN		(1)
738c406ea7cSVladimir Kondratiev #define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_MSK		(0x2)
7392be7d22fSVladimir Kondratiev #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_POS		(0)
7402be7d22fSVladimir Kondratiev #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_LEN		(1)
7412be7d22fSVladimir Kondratiev #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_MSK		(0x1)
7422be7d22fSVladimir Kondratiev #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_POS		(1)
7432be7d22fSVladimir Kondratiev #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_LEN		(1)
7442be7d22fSVladimir Kondratiev #define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_MSK		(0x2)
7452be7d22fSVladimir Kondratiev #define L3_L4_CTRL_IPV4_CHECKSUM_EN_POS			(0)
7462be7d22fSVladimir Kondratiev #define L3_L4_CTRL_IPV4_CHECKSUM_EN_LEN			(1)
7472be7d22fSVladimir Kondratiev #define L3_L4_CTRL_IPV4_CHECKSUM_EN_MSK			(0x1)
7482be7d22fSVladimir Kondratiev #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_POS		(1)
7492be7d22fSVladimir Kondratiev #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_LEN		(1)
7502be7d22fSVladimir Kondratiev #define L3_L4_CTRL_TCPIP_CHECKSUM_EN_MSK		(0x2)
7512be7d22fSVladimir Kondratiev #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_POS		(0)
7522be7d22fSVladimir Kondratiev #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_LEN		(1)
7532be7d22fSVladimir Kondratiev #define RING_CTRL_OVERRIDE_PREFETCH_THRSH_MSK		(0x1)
7542be7d22fSVladimir Kondratiev #define RING_CTRL_OVERRIDE_WB_THRSH_POS			(1)
7552be7d22fSVladimir Kondratiev #define RING_CTRL_OVERRIDE_WB_THRSH_LEN			(1)
7562be7d22fSVladimir Kondratiev #define RING_CTRL_OVERRIDE_WB_THRSH_MSK			(0x2)
7572be7d22fSVladimir Kondratiev #define RING_CTRL_OVERRIDE_ITR_THRSH_POS		(2)
7582be7d22fSVladimir Kondratiev #define RING_CTRL_OVERRIDE_ITR_THRSH_LEN		(1)
7592be7d22fSVladimir Kondratiev #define RING_CTRL_OVERRIDE_ITR_THRSH_MSK		(0x4)
7602be7d22fSVladimir Kondratiev #define RING_CTRL_OVERRIDE_HOST_THRSH_POS		(3)
7612be7d22fSVladimir Kondratiev #define RING_CTRL_OVERRIDE_HOST_THRSH_LEN		(1)
7622be7d22fSVladimir Kondratiev #define RING_CTRL_OVERRIDE_HOST_THRSH_MSK		(0x8)
7632be7d22fSVladimir Kondratiev 
764b874ddecSLior David /* WMI_CFG_RX_CHAIN_CMDID */
765b874ddecSLior David struct wmi_cfg_rx_chain_cmd {
766b874ddecSLior David 	__le32 action;
767b874ddecSLior David 	struct wmi_sw_ring_cfg rx_sw_ring;
768b874ddecSLior David 	u8 mid;
769b874ddecSLior David 	u8 decap_trans_type;
770b874ddecSLior David 	u8 l2_802_3_offload_ctrl;
771b874ddecSLior David 	u8 l2_nwifi_offload_ctrl;
772b874ddecSLior David 	u8 vlan_id;
773b874ddecSLior David 	u8 nwifi_ds_trans_type;
774b874ddecSLior David 	u8 l3_l4_ctrl;
775b874ddecSLior David 	u8 ring_ctrl;
7762be7d22fSVladimir Kondratiev 	__le16 prefetch_thrsh;
7772be7d22fSVladimir Kondratiev 	__le16 wb_thrsh;
7782be7d22fSVladimir Kondratiev 	__le32 itr_value;
7792be7d22fSVladimir Kondratiev 	__le16 host_thrsh;
780b8023177SVladimir Kondratiev 	u8 reorder_type;
781b8023177SVladimir Kondratiev 	u8 reserved;
7822be7d22fSVladimir Kondratiev 	struct wmi_sniffer_cfg sniffer_cfg;
783b874ddecSLior David 	__le16 max_rx_pl_per_desc;
7842be7d22fSVladimir Kondratiev } __packed;
7852be7d22fSVladimir Kondratiev 
786b874ddecSLior David /* WMI_RCP_ADDBA_RESP_CMDID */
7872be7d22fSVladimir Kondratiev struct wmi_rcp_addba_resp_cmd {
7882be7d22fSVladimir Kondratiev 	u8 cidxtid;
7892be7d22fSVladimir Kondratiev 	u8 dialog_token;
7902be7d22fSVladimir Kondratiev 	__le16 status_code;
791b874ddecSLior David 	/* ieee80211_ba_parameterset field to send */
792b874ddecSLior David 	__le16 ba_param_set;
7932be7d22fSVladimir Kondratiev 	__le16 ba_timeout;
7942be7d22fSVladimir Kondratiev } __packed;
7952be7d22fSVladimir Kondratiev 
796b874ddecSLior David /* WMI_RCP_DELBA_CMDID */
7972be7d22fSVladimir Kondratiev struct wmi_rcp_delba_cmd {
7982be7d22fSVladimir Kondratiev 	u8 cidxtid;
7992be7d22fSVladimir Kondratiev 	u8 reserved;
8002be7d22fSVladimir Kondratiev 	__le16 reason;
8012be7d22fSVladimir Kondratiev } __packed;
8022be7d22fSVladimir Kondratiev 
803b874ddecSLior David /* WMI_RCP_ADDBA_REQ_CMDID */
8042be7d22fSVladimir Kondratiev struct wmi_rcp_addba_req_cmd {
8052be7d22fSVladimir Kondratiev 	u8 cidxtid;
8062be7d22fSVladimir Kondratiev 	u8 dialog_token;
8072be7d22fSVladimir Kondratiev 	/* ieee80211_ba_parameterset field as it received */
8082be7d22fSVladimir Kondratiev 	__le16 ba_param_set;
8092be7d22fSVladimir Kondratiev 	__le16 ba_timeout;
8102be7d22fSVladimir Kondratiev 	/* ieee80211_ba_seqstrl field as it received */
8112be7d22fSVladimir Kondratiev 	__le16 ba_seq_ctrl;
8122be7d22fSVladimir Kondratiev } __packed;
8132be7d22fSVladimir Kondratiev 
814b874ddecSLior David /* WMI_SET_MAC_ADDRESS_CMDID */
8152be7d22fSVladimir Kondratiev struct wmi_set_mac_address_cmd {
8162be7d22fSVladimir Kondratiev 	u8 mac[WMI_MAC_LEN];
8172be7d22fSVladimir Kondratiev 	u8 reserved[2];
8182be7d22fSVladimir Kondratiev } __packed;
8192be7d22fSVladimir Kondratiev 
820b874ddecSLior David /* WMI_ECHO_CMDID
8212be7d22fSVladimir Kondratiev  * Check FW is alive
8222be7d22fSVladimir Kondratiev  * WMI_DEEP_ECHO_CMDID
8232be7d22fSVladimir Kondratiev  * Check FW and ucode are alive
8242be7d22fSVladimir Kondratiev  * Returned event: WMI_ECHO_RSP_EVENTID
8252be7d22fSVladimir Kondratiev  * same event for both commands
8262be7d22fSVladimir Kondratiev  */
8272be7d22fSVladimir Kondratiev struct wmi_echo_cmd {
8282be7d22fSVladimir Kondratiev 	__le32 value;
8292be7d22fSVladimir Kondratiev } __packed;
8302be7d22fSVladimir Kondratiev 
831b874ddecSLior David /* WMI_OTP_READ_CMDID */
832b874ddecSLior David struct wmi_otp_read_cmd {
833b874ddecSLior David 	__le32 addr;
834b874ddecSLior David 	__le32 size;
835b874ddecSLior David 	__le32 values;
836b874ddecSLior David } __packed;
837b874ddecSLior David 
838b874ddecSLior David /* WMI_OTP_WRITE_CMDID */
839b874ddecSLior David struct wmi_otp_write_cmd {
840b874ddecSLior David 	__le32 addr;
841b874ddecSLior David 	__le32 size;
842b874ddecSLior David 	__le32 values;
843b874ddecSLior David } __packed;
844b874ddecSLior David 
845b874ddecSLior David /* WMI_TEMP_SENSE_CMDID
846b8023177SVladimir Kondratiev  *
847b8023177SVladimir Kondratiev  * Measure MAC and radio temperatures
848b874ddecSLior David  *
849b874ddecSLior David  * Possible modes for temperature measurement
850b8023177SVladimir Kondratiev  */
8518c679675SVladimir Kondratiev enum wmi_temperature_measure_mode {
852b874ddecSLior David 	TEMPERATURE_USE_OLD_VALUE	= 0x01,
853b874ddecSLior David 	TEMPERATURE_MEASURE_NOW		= 0x02,
8548c679675SVladimir Kondratiev };
8558c679675SVladimir Kondratiev 
856b874ddecSLior David /* WMI_TEMP_SENSE_CMDID */
857b8023177SVladimir Kondratiev struct wmi_temp_sense_cmd {
8588c679675SVladimir Kondratiev 	__le32 measure_baseband_en;
8598c679675SVladimir Kondratiev 	__le32 measure_rf_en;
8608c679675SVladimir Kondratiev 	__le32 measure_mode;
861b8023177SVladimir Kondratiev } __packed;
862b8023177SVladimir Kondratiev 
863b874ddecSLior David enum wmi_pmc_op {
864b874ddecSLior David 	WMI_PMC_ALLOCATE	= 0x00,
865b874ddecSLior David 	WMI_PMC_RELEASE		= 0x01,
866dc16427bSVladimir Kondratiev };
867dc16427bSVladimir Kondratiev 
868b874ddecSLior David /* WMI_PMC_CMDID */
869dc16427bSVladimir Kondratiev struct wmi_pmc_cmd {
870b874ddecSLior David 	/* enum wmi_pmc_cmd_op_type */
871b874ddecSLior David 	u8 op;
872dc16427bSVladimir Kondratiev 	u8 reserved;
873dc16427bSVladimir Kondratiev 	__le16 ring_size;
874dc16427bSVladimir Kondratiev 	__le64 mem_base;
875dc16427bSVladimir Kondratiev } __packed;
876dc16427bSVladimir Kondratiev 
87708989f96SLior David enum wmi_aoa_meas_type {
87808989f96SLior David 	WMI_AOA_PHASE_MEAS	= 0x00,
87908989f96SLior David 	WMI_AOA_PHASE_AMP_MEAS	= 0x01,
88008989f96SLior David };
88108989f96SLior David 
88208989f96SLior David /* WMI_AOA_MEAS_CMDID */
88308989f96SLior David struct wmi_aoa_meas_cmd {
88408989f96SLior David 	u8 mac_addr[WMI_MAC_LEN];
88508989f96SLior David 	/* channels IDs:
88608989f96SLior David 	 * 0 - 58320 MHz
88708989f96SLior David 	 * 1 - 60480 MHz
88808989f96SLior David 	 * 2 - 62640 MHz
88908989f96SLior David 	 */
89008989f96SLior David 	u8 channel;
89108989f96SLior David 	/* enum wmi_aoa_meas_type */
89208989f96SLior David 	u8 aoa_meas_type;
89308989f96SLior David 	__le32 meas_rf_mask;
89408989f96SLior David } __packed;
89508989f96SLior David 
896cbf795c1SLior David /* WMI_SET_MGMT_RETRY_LIMIT_CMDID */
897cbf795c1SLior David struct wmi_set_mgmt_retry_limit_cmd {
898cbf795c1SLior David 	/* MAC retransmit limit for mgmt frames */
899cbf795c1SLior David 	u8 mgmt_retry_limit;
900cbf795c1SLior David 	/* alignment to 32b */
901cbf795c1SLior David 	u8 reserved[3];
902cbf795c1SLior David } __packed;
903cbf795c1SLior David 
904*90ffabb0SDedy Lansky /* Zones: HIGH, MAX, CRITICAL */
905*90ffabb0SDedy Lansky #define WMI_NUM_OF_TT_ZONES	(3)
906*90ffabb0SDedy Lansky 
907*90ffabb0SDedy Lansky struct wmi_tt_zone_limits {
908*90ffabb0SDedy Lansky 	/* Above this temperature this zone is active */
909*90ffabb0SDedy Lansky 	u8 temperature_high;
910*90ffabb0SDedy Lansky 	/* Below this temperature the adjacent lower zone is active */
911*90ffabb0SDedy Lansky 	u8 temperature_low;
912*90ffabb0SDedy Lansky 	u8 reserved[2];
913*90ffabb0SDedy Lansky } __packed;
914*90ffabb0SDedy Lansky 
915*90ffabb0SDedy Lansky /* Struct used for both configuration and status commands of thermal
916*90ffabb0SDedy Lansky  * throttling
917*90ffabb0SDedy Lansky  */
918*90ffabb0SDedy Lansky struct wmi_tt_data {
919*90ffabb0SDedy Lansky 	/* Enable/Disable TT algorithm for baseband */
920*90ffabb0SDedy Lansky 	u8 bb_enabled;
921*90ffabb0SDedy Lansky 	u8 reserved0[3];
922*90ffabb0SDedy Lansky 	/* Define zones for baseband */
923*90ffabb0SDedy Lansky 	struct wmi_tt_zone_limits bb_zones[WMI_NUM_OF_TT_ZONES];
924*90ffabb0SDedy Lansky 	/* Enable/Disable TT algorithm for radio */
925*90ffabb0SDedy Lansky 	u8 rf_enabled;
926*90ffabb0SDedy Lansky 	u8 reserved1[3];
927*90ffabb0SDedy Lansky 	/* Define zones for all radio chips */
928*90ffabb0SDedy Lansky 	struct wmi_tt_zone_limits rf_zones[WMI_NUM_OF_TT_ZONES];
929*90ffabb0SDedy Lansky } __packed;
930*90ffabb0SDedy Lansky 
931*90ffabb0SDedy Lansky /* WMI_SET_THERMAL_THROTTLING_CFG_CMDID */
932*90ffabb0SDedy Lansky struct wmi_set_thermal_throttling_cfg_cmd {
933*90ffabb0SDedy Lansky 	/* Command data */
934*90ffabb0SDedy Lansky 	struct wmi_tt_data tt_data;
935*90ffabb0SDedy Lansky } __packed;
936*90ffabb0SDedy Lansky 
937849a564bSDedy Lansky /* WMI_NEW_STA_CMDID */
938849a564bSDedy Lansky struct wmi_new_sta_cmd {
939849a564bSDedy Lansky 	u8 dst_mac[WMI_MAC_LEN];
940849a564bSDedy Lansky 	u8 aid;
941849a564bSDedy Lansky } __packed;
942849a564bSDedy Lansky 
943849a564bSDedy Lansky /* WMI_DEL_STA_CMDID */
944849a564bSDedy Lansky struct wmi_del_sta_cmd {
945849a564bSDedy Lansky 	u8 dst_mac[WMI_MAC_LEN];
946849a564bSDedy Lansky 	__le16 disconnect_reason;
947849a564bSDedy Lansky } __packed;
948849a564bSDedy Lansky 
94908989f96SLior David enum wmi_tof_burst_duration {
95008989f96SLior David 	WMI_TOF_BURST_DURATION_250_USEC		= 2,
95108989f96SLior David 	WMI_TOF_BURST_DURATION_500_USEC		= 3,
95208989f96SLior David 	WMI_TOF_BURST_DURATION_1_MSEC		= 4,
95308989f96SLior David 	WMI_TOF_BURST_DURATION_2_MSEC		= 5,
95408989f96SLior David 	WMI_TOF_BURST_DURATION_4_MSEC		= 6,
95508989f96SLior David 	WMI_TOF_BURST_DURATION_8_MSEC		= 7,
95608989f96SLior David 	WMI_TOF_BURST_DURATION_16_MSEC		= 8,
95708989f96SLior David 	WMI_TOF_BURST_DURATION_32_MSEC		= 9,
95808989f96SLior David 	WMI_TOF_BURST_DURATION_64_MSEC		= 10,
95908989f96SLior David 	WMI_TOF_BURST_DURATION_128_MSEC		= 11,
96008989f96SLior David 	WMI_TOF_BURST_DURATION_NO_PREFERENCES	= 15,
96108989f96SLior David };
96208989f96SLior David 
96308989f96SLior David enum wmi_tof_session_start_flags {
96408989f96SLior David 	WMI_TOF_SESSION_START_FLAG_SECURED	= 0x1,
96508989f96SLior David 	WMI_TOF_SESSION_START_FLAG_ASAP		= 0x2,
96608989f96SLior David 	WMI_TOF_SESSION_START_FLAG_LCI_REQ	= 0x4,
96708989f96SLior David 	WMI_TOF_SESSION_START_FLAG_LCR_REQ	= 0x8,
96808989f96SLior David };
96908989f96SLior David 
97008989f96SLior David /* WMI_TOF_SESSION_START_CMDID */
97108989f96SLior David struct wmi_ftm_dest_info {
97208989f96SLior David 	u8 channel;
97308989f96SLior David 	/* wmi_tof_session_start_flags_e */
97408989f96SLior David 	u8 flags;
97508989f96SLior David 	u8 initial_token;
97608989f96SLior David 	u8 num_of_ftm_per_burst;
97708989f96SLior David 	u8 num_of_bursts_exp;
97808989f96SLior David 	/* wmi_tof_burst_duration_e */
97908989f96SLior David 	u8 burst_duration;
98008989f96SLior David 	/* Burst Period indicate interval between two consecutive burst
98108989f96SLior David 	 * instances, in units of 100 ms
98208989f96SLior David 	 */
98308989f96SLior David 	__le16 burst_period;
98408989f96SLior David 	u8 dst_mac[WMI_MAC_LEN];
98508989f96SLior David 	__le16 reserved;
98608989f96SLior David } __packed;
98708989f96SLior David 
98808989f96SLior David /* WMI_TOF_SESSION_START_CMDID */
98908989f96SLior David struct wmi_tof_session_start_cmd {
99008989f96SLior David 	__le32 session_id;
99108989f96SLior David 	u8 num_of_aoa_measures;
99208989f96SLior David 	u8 aoa_type;
99308989f96SLior David 	__le16 num_of_dest;
99408989f96SLior David 	u8 reserved[4];
99508989f96SLior David 	struct wmi_ftm_dest_info ftm_dest_info[0];
99608989f96SLior David } __packed;
99708989f96SLior David 
99808989f96SLior David enum wmi_tof_channel_info_report_type {
99908989f96SLior David 	WMI_TOF_CHANNEL_INFO_TYPE_CIR			= 0x1,
100008989f96SLior David 	WMI_TOF_CHANNEL_INFO_TYPE_RSSI			= 0x2,
100108989f96SLior David 	WMI_TOF_CHANNEL_INFO_TYPE_SNR			= 0x4,
100208989f96SLior David 	WMI_TOF_CHANNEL_INFO_TYPE_DEBUG_DATA		= 0x8,
100308989f96SLior David 	WMI_TOF_CHANNEL_INFO_TYPE_VENDOR_SPECIFIC	= 0x10,
100408989f96SLior David };
100508989f96SLior David 
100608989f96SLior David /* WMI_TOF_CHANNEL_INFO_CMDID */
100708989f96SLior David struct wmi_tof_channel_info_cmd {
100808989f96SLior David 	/* wmi_tof_channel_info_report_type_e */
100908989f96SLior David 	__le32 channel_info_report_request;
101008989f96SLior David } __packed;
101108989f96SLior David 
10128ae5d62cSLior David /* WMI_TOF_SET_TX_RX_OFFSET_CMDID */
10138ae5d62cSLior David struct wmi_tof_set_tx_rx_offset_cmd {
10148ae5d62cSLior David 	/* TX delay offset */
10158ae5d62cSLior David 	__le32 tx_offset;
10168ae5d62cSLior David 	/* RX delay offset */
10178ae5d62cSLior David 	__le32 rx_offset;
10188ae5d62cSLior David 	__le32 reserved[2];
10198ae5d62cSLior David } __packed;
10208ae5d62cSLior David 
1021b874ddecSLior David /* WMI Events
10222be7d22fSVladimir Kondratiev  * List of Events (target to host)
10232be7d22fSVladimir Kondratiev  */
10242be7d22fSVladimir Kondratiev enum wmi_event_id {
10252be7d22fSVladimir Kondratiev 	WMI_READY_EVENTID				= 0x1001,
10262be7d22fSVladimir Kondratiev 	WMI_CONNECT_EVENTID				= 0x1002,
10272be7d22fSVladimir Kondratiev 	WMI_DISCONNECT_EVENTID				= 0x1003,
1028b874ddecSLior David 	WMI_SCAN_COMPLETE_EVENTID			= 0x100A,
1029b874ddecSLior David 	WMI_REPORT_STATISTICS_EVENTID			= 0x100B,
10302be7d22fSVladimir Kondratiev 	WMI_RD_MEM_RSP_EVENTID				= 0x1800,
10312be7d22fSVladimir Kondratiev 	WMI_FW_READY_EVENTID				= 0x1801,
1032b874ddecSLior David 	WMI_EXIT_FAST_MEM_ACC_MODE_EVENTID		= 0x200,
10332be7d22fSVladimir Kondratiev 	WMI_ECHO_RSP_EVENTID				= 0x1803,
1034b874ddecSLior David 	WMI_FS_TUNE_DONE_EVENTID			= 0x180A,
1035b874ddecSLior David 	WMI_CORR_MEASURE_EVENTID			= 0x180B,
1036b874ddecSLior David 	WMI_READ_RSSI_EVENTID				= 0x180C,
1037b874ddecSLior David 	WMI_TEMP_SENSE_DONE_EVENTID			= 0x180E,
1038b874ddecSLior David 	WMI_DC_CALIB_DONE_EVENTID			= 0x180F,
10392be7d22fSVladimir Kondratiev 	WMI_IQ_TX_CALIB_DONE_EVENTID			= 0x1811,
10402be7d22fSVladimir Kondratiev 	WMI_IQ_RX_CALIB_DONE_EVENTID			= 0x1812,
10412be7d22fSVladimir Kondratiev 	WMI_SET_WORK_MODE_DONE_EVENTID			= 0x1815,
10422be7d22fSVladimir Kondratiev 	WMI_LO_LEAKAGE_CALIB_DONE_EVENTID		= 0x1816,
10432be7d22fSVladimir Kondratiev 	WMI_MARLON_R_READ_DONE_EVENTID			= 0x1818,
10442be7d22fSVladimir Kondratiev 	WMI_MARLON_R_WRITE_DONE_EVENTID			= 0x1819,
1045b874ddecSLior David 	WMI_MARLON_R_TXRX_SEL_DONE_EVENTID		= 0x181A,
1046b874ddecSLior David 	WMI_SILENT_RSSI_CALIB_DONE_EVENTID		= 0x181D,
1047b874ddecSLior David 	WMI_RF_RX_TEST_DONE_EVENTID			= 0x181E,
10482be7d22fSVladimir Kondratiev 	WMI_CFG_RX_CHAIN_DONE_EVENTID			= 0x1820,
10492be7d22fSVladimir Kondratiev 	WMI_VRING_CFG_DONE_EVENTID			= 0x1821,
10502be7d22fSVladimir Kondratiev 	WMI_BA_STATUS_EVENTID				= 0x1823,
10512be7d22fSVladimir Kondratiev 	WMI_RCP_ADDBA_REQ_EVENTID			= 0x1824,
1052230d8442SVladimir Kondratiev 	WMI_RCP_ADDBA_RESP_SENT_EVENTID			= 0x1825,
10532be7d22fSVladimir Kondratiev 	WMI_DELBA_EVENTID				= 0x1826,
10542be7d22fSVladimir Kondratiev 	WMI_GET_SSID_EVENTID				= 0x1828,
1055b874ddecSLior David 	WMI_GET_PCP_CHANNEL_EVENTID			= 0x182A,
1056b874ddecSLior David 	WMI_SW_TX_COMPLETE_EVENTID			= 0x182B,
10572be7d22fSVladimir Kondratiev 	WMI_READ_MAC_RXQ_EVENTID			= 0x1830,
10582be7d22fSVladimir Kondratiev 	WMI_READ_MAC_TXQ_EVENTID			= 0x1831,
10592be7d22fSVladimir Kondratiev 	WMI_WRITE_MAC_RXQ_EVENTID			= 0x1832,
10602be7d22fSVladimir Kondratiev 	WMI_WRITE_MAC_TXQ_EVENTID			= 0x1833,
10612be7d22fSVladimir Kondratiev 	WMI_WRITE_MAC_XQ_FIELD_EVENTID			= 0x1834,
1062230d8442SVladimir Kondratiev 	WMI_BEAMFORMING_MGMT_DONE_EVENTID		= 0x1836,
10632be7d22fSVladimir Kondratiev 	WMI_BF_TXSS_MGMT_DONE_EVENTID			= 0x1837,
10642be7d22fSVladimir Kondratiev 	WMI_BF_RXSS_MGMT_DONE_EVENTID			= 0x1839,
10652be7d22fSVladimir Kondratiev 	WMI_RS_MGMT_DONE_EVENTID			= 0x1852,
10662be7d22fSVladimir Kondratiev 	WMI_RF_MGMT_STATUS_EVENTID			= 0x1853,
10672be7d22fSVladimir Kondratiev 	WMI_BF_SM_MGMT_DONE_EVENTID			= 0x1838,
10682be7d22fSVladimir Kondratiev 	WMI_RX_MGMT_PACKET_EVENTID			= 0x1840,
10696c2faf09SVladimir Kondratiev 	WMI_TX_MGMT_PACKET_EVENTID			= 0x1841,
10700163b031SMaya Erez 	WMI_LINK_MAINTAIN_CFG_WRITE_DONE_EVENTID	= 0x1842,
10710163b031SMaya Erez 	WMI_LINK_MAINTAIN_CFG_READ_DONE_EVENTID		= 0x1843,
1072b874ddecSLior David 	WMI_OTP_READ_RESULT_EVENTID			= 0x1856,
107310d599adSMaya Erez 	WMI_LED_CFG_DONE_EVENTID			= 0x1858,
10742be7d22fSVladimir Kondratiev 	/* Performance monitoring events */
10752be7d22fSVladimir Kondratiev 	WMI_DATA_PORT_OPEN_EVENTID			= 0x1860,
1076230d8442SVladimir Kondratiev 	WMI_WBE_LINK_DOWN_EVENTID			= 0x1861,
10772be7d22fSVladimir Kondratiev 	WMI_BF_CTRL_DONE_EVENTID			= 0x1862,
10782be7d22fSVladimir Kondratiev 	WMI_NOTIFY_REQ_DONE_EVENTID			= 0x1863,
10792be7d22fSVladimir Kondratiev 	WMI_GET_STATUS_DONE_EVENTID			= 0x1864,
1080230d8442SVladimir Kondratiev 	WMI_VRING_EN_EVENTID				= 0x1865,
10810163b031SMaya Erez 	WMI_GET_RF_STATUS_EVENTID			= 0x1866,
10820163b031SMaya Erez 	WMI_GET_BASEBAND_TYPE_EVENTID			= 0x1867,
10832be7d22fSVladimir Kondratiev 	WMI_UNIT_TEST_EVENTID				= 0x1900,
10842be7d22fSVladimir Kondratiev 	WMI_FLASH_READ_DONE_EVENTID			= 0x1902,
10852be7d22fSVladimir Kondratiev 	WMI_FLASH_WRITE_DONE_EVENTID			= 0x1903,
10860163b031SMaya Erez 	/* Power management */
10870163b031SMaya Erez 	WMI_TRAFFIC_DEFERRAL_EVENTID			= 0x1904,
10880163b031SMaya Erez 	WMI_TRAFFIC_RESUME_EVENTID			= 0x1905,
1089b8023177SVladimir Kondratiev 	/* P2P */
10908c679675SVladimir Kondratiev 	WMI_P2P_CFG_DONE_EVENTID			= 0x1910,
1091b8023177SVladimir Kondratiev 	WMI_PORT_ALLOCATED_EVENTID			= 0x1911,
1092b8023177SVladimir Kondratiev 	WMI_PORT_DELETED_EVENTID			= 0x1912,
1093b8023177SVladimir Kondratiev 	WMI_LISTEN_STARTED_EVENTID			= 0x1914,
1094b8023177SVladimir Kondratiev 	WMI_SEARCH_STARTED_EVENTID			= 0x1915,
1095b8023177SVladimir Kondratiev 	WMI_DISCOVERY_STARTED_EVENTID			= 0x1916,
1096b8023177SVladimir Kondratiev 	WMI_DISCOVERY_STOPPED_EVENTID			= 0x1917,
1097b8023177SVladimir Kondratiev 	WMI_PCP_STARTED_EVENTID				= 0x1918,
1098b8023177SVladimir Kondratiev 	WMI_PCP_STOPPED_EVENTID				= 0x1919,
1099b874ddecSLior David 	WMI_PCP_FACTOR_EVENTID				= 0x191A,
11000163b031SMaya Erez 	/* Power Save Configuration Events */
11010163b031SMaya Erez 	WMI_PS_DEV_PROFILE_CFG_EVENTID			= 0x191C,
11020163b031SMaya Erez 	/* Not supported yet */
11030163b031SMaya Erez 	WMI_PS_DEV_CFG_EVENTID				= 0x191D,
11040163b031SMaya Erez 	/* Not supported yet */
11050163b031SMaya Erez 	WMI_PS_DEV_CFG_READ_EVENTID			= 0x191E,
11060163b031SMaya Erez 	/* Not supported yet */
11070163b031SMaya Erez 	WMI_PS_MID_CFG_EVENTID				= 0x191F,
11080163b031SMaya Erez 	/* Not supported yet */
11090163b031SMaya Erez 	WMI_PS_MID_CFG_READ_EVENTID			= 0x1920,
11100163b031SMaya Erez 	WMI_RS_CFG_DONE_EVENTID				= 0x1921,
111108989f96SLior David 	WMI_GET_DETAILED_RS_RES_EVENTID			= 0x1922,
111208989f96SLior David 	WMI_AOA_MEAS_EVENTID				= 0x1923,
1113a52fb913SLior David 	WMI_BRP_SET_ANT_LIMIT_EVENTID			= 0x1924,
1114cbf795c1SLior David 	WMI_SET_MGMT_RETRY_LIMIT_EVENTID		= 0x1930,
1115cbf795c1SLior David 	WMI_GET_MGMT_RETRY_LIMIT_EVENTID		= 0x1931,
1116*90ffabb0SDedy Lansky 	WMI_SET_THERMAL_THROTTLING_CFG_EVENTID		= 0x1940,
1117*90ffabb0SDedy Lansky 	WMI_GET_THERMAL_THROTTLING_CFG_EVENTID		= 0x1941,
111808989f96SLior David 	WMI_TOF_SESSION_END_EVENTID			= 0x1991,
111908989f96SLior David 	WMI_TOF_GET_CAPABILITIES_EVENTID		= 0x1992,
112008989f96SLior David 	WMI_TOF_SET_LCR_EVENTID				= 0x1993,
112108989f96SLior David 	WMI_TOF_SET_LCI_EVENTID				= 0x1994,
112208989f96SLior David 	WMI_TOF_FTM_PER_DEST_RES_EVENTID		= 0x1995,
112308989f96SLior David 	WMI_TOF_CHANNEL_INFO_EVENTID			= 0x1996,
11248ae5d62cSLior David 	WMI_TOF_SET_TX_RX_OFFSET_EVENTID		= 0x1997,
11258ae5d62cSLior David 	WMI_TOF_GET_TX_RX_OFFSET_EVENTID		= 0x1998,
1126cbf795c1SLior David 	WMI_GET_RF_SECTOR_PARAMS_DONE_EVENTID		= 0x19A0,
1127cbf795c1SLior David 	WMI_SET_RF_SECTOR_PARAMS_DONE_EVENTID		= 0x19A1,
1128cbf795c1SLior David 	WMI_GET_SELECTED_RF_SECTOR_INDEX_DONE_EVENTID	= 0x19A2,
1129cbf795c1SLior David 	WMI_SET_SELECTED_RF_SECTOR_INDEX_DONE_EVENTID	= 0x19A3,
1130cbf795c1SLior David 	WMI_SET_RF_SECTOR_ON_DONE_EVENTID		= 0x19A4,
11318ae5d62cSLior David 	WMI_PRIO_TX_SECTORS_ORDER_EVENTID		= 0x19A5,
11328ae5d62cSLior David 	WMI_PRIO_TX_SECTORS_NUMBER_EVENTID		= 0x19A6,
11338ae5d62cSLior David 	WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID	= 0x19A7,
11342be7d22fSVladimir Kondratiev 	WMI_SET_CHANNEL_EVENTID				= 0x9000,
11352be7d22fSVladimir Kondratiev 	WMI_ASSOC_REQ_EVENTID				= 0x9001,
11362be7d22fSVladimir Kondratiev 	WMI_EAPOL_RX_EVENTID				= 0x9002,
11372be7d22fSVladimir Kondratiev 	WMI_MAC_ADDR_RESP_EVENTID			= 0x9003,
11382be7d22fSVladimir Kondratiev 	WMI_FW_VER_EVENTID				= 0x9004,
1139b874ddecSLior David 	WMI_ACS_PASSIVE_SCAN_COMPLETE_EVENTID		= 0x9005,
11402be7d22fSVladimir Kondratiev };
11412be7d22fSVladimir Kondratiev 
1142b874ddecSLior David /* Events data structures */
1143b8023177SVladimir Kondratiev enum wmi_fw_status {
1144b874ddecSLior David 	WMI_FW_STATUS_SUCCESS	= 0x00,
1145b874ddecSLior David 	WMI_FW_STATUS_FAILURE	= 0x01,
1146b8023177SVladimir Kondratiev };
1147b8023177SVladimir Kondratiev 
1148b874ddecSLior David /* WMI_RF_MGMT_STATUS_EVENTID */
11492be7d22fSVladimir Kondratiev enum wmi_rf_status {
1150b874ddecSLior David 	WMI_RF_ENABLED		= 0x00,
1151b874ddecSLior David 	WMI_RF_DISABLED_HW	= 0x01,
1152b874ddecSLior David 	WMI_RF_DISABLED_SW	= 0x02,
1153b874ddecSLior David 	WMI_RF_DISABLED_HW_SW	= 0x03,
11542be7d22fSVladimir Kondratiev };
11552be7d22fSVladimir Kondratiev 
1156b874ddecSLior David /* WMI_RF_MGMT_STATUS_EVENTID */
11572be7d22fSVladimir Kondratiev struct wmi_rf_mgmt_status_event {
11582be7d22fSVladimir Kondratiev 	__le32 rf_status;
11592be7d22fSVladimir Kondratiev } __packed;
11602be7d22fSVladimir Kondratiev 
1161b874ddecSLior David /* WMI_GET_STATUS_DONE_EVENTID */
11622be7d22fSVladimir Kondratiev struct wmi_get_status_done_event {
11632be7d22fSVladimir Kondratiev 	__le32 is_associated;
11642be7d22fSVladimir Kondratiev 	u8 cid;
11652be7d22fSVladimir Kondratiev 	u8 reserved0[3];
11662be7d22fSVladimir Kondratiev 	u8 bssid[WMI_MAC_LEN];
11672be7d22fSVladimir Kondratiev 	u8 channel;
11682be7d22fSVladimir Kondratiev 	u8 reserved1;
11692be7d22fSVladimir Kondratiev 	u8 network_type;
11702be7d22fSVladimir Kondratiev 	u8 reserved2[3];
11712be7d22fSVladimir Kondratiev 	__le32 ssid_len;
11722be7d22fSVladimir Kondratiev 	u8 ssid[WMI_MAX_SSID_LEN];
11732be7d22fSVladimir Kondratiev 	__le32 rf_status;
11742be7d22fSVladimir Kondratiev 	__le32 is_secured;
11752be7d22fSVladimir Kondratiev } __packed;
11762be7d22fSVladimir Kondratiev 
1177b874ddecSLior David /* WMI_FW_VER_EVENTID */
11782be7d22fSVladimir Kondratiev struct wmi_fw_ver_event {
11790163b031SMaya Erez 	/* FW image version */
11800163b031SMaya Erez 	__le32 fw_major;
11810163b031SMaya Erez 	__le32 fw_minor;
11820163b031SMaya Erez 	__le32 fw_subminor;
11830163b031SMaya Erez 	__le32 fw_build;
11840163b031SMaya Erez 	/* FW image build time stamp */
11850163b031SMaya Erez 	__le32 hour;
11860163b031SMaya Erez 	__le32 minute;
11870163b031SMaya Erez 	__le32 second;
11880163b031SMaya Erez 	__le32 day;
11890163b031SMaya Erez 	__le32 month;
11900163b031SMaya Erez 	__le32 year;
11910163b031SMaya Erez 	/* Boot Loader image version */
11920163b031SMaya Erez 	__le32 bl_major;
11930163b031SMaya Erez 	__le32 bl_minor;
11940163b031SMaya Erez 	__le32 bl_subminor;
11950163b031SMaya Erez 	__le32 bl_build;
119608989f96SLior David 	/* The number of entries in the FW capabilies array */
119708989f96SLior David 	u8 fw_capabilities_len;
119808989f96SLior David 	u8 reserved[3];
119908989f96SLior David 	/* FW capabilities info
120008989f96SLior David 	 * Must be the last member of the struct
120108989f96SLior David 	 */
120208989f96SLior David 	__le32 fw_capabilities[0];
12030163b031SMaya Erez } __packed;
12040163b031SMaya Erez 
12050163b031SMaya Erez /* WMI_GET_RF_STATUS_EVENTID */
12060163b031SMaya Erez enum rf_type {
12070163b031SMaya Erez 	RF_UNKNOWN	= 0x00,
12080163b031SMaya Erez 	RF_MARLON	= 0x01,
12090163b031SMaya Erez 	RF_SPARROW	= 0x02,
12100163b031SMaya Erez };
12110163b031SMaya Erez 
12120163b031SMaya Erez /* WMI_GET_RF_STATUS_EVENTID */
12130163b031SMaya Erez enum board_file_rf_type {
12140163b031SMaya Erez 	BF_RF_MARLON	= 0x00,
12150163b031SMaya Erez 	BF_RF_SPARROW	= 0x01,
12160163b031SMaya Erez };
12170163b031SMaya Erez 
12180163b031SMaya Erez /* WMI_GET_RF_STATUS_EVENTID */
12190163b031SMaya Erez enum rf_status {
12200163b031SMaya Erez 	RF_OK			= 0x00,
12210163b031SMaya Erez 	RF_NO_COMM		= 0x01,
12220163b031SMaya Erez 	RF_WRONG_BOARD_FILE	= 0x02,
12230163b031SMaya Erez };
12240163b031SMaya Erez 
12250163b031SMaya Erez /* WMI_GET_RF_STATUS_EVENTID */
12260163b031SMaya Erez struct wmi_get_rf_status_event {
12270163b031SMaya Erez 	/* enum rf_type */
12280163b031SMaya Erez 	__le32 rf_type;
12290163b031SMaya Erez 	/* attached RFs bit vector */
12300163b031SMaya Erez 	__le32 attached_rf_vector;
12310163b031SMaya Erez 	/* enabled RFs bit vector */
12320163b031SMaya Erez 	__le32 enabled_rf_vector;
12330163b031SMaya Erez 	/* enum rf_status, refers to enabled RFs */
12340163b031SMaya Erez 	u8 rf_status[32];
12350163b031SMaya Erez 	/* enum board file RF type */
12360163b031SMaya Erez 	__le32 board_file_rf_type;
12370163b031SMaya Erez 	/* board file platform type */
12380163b031SMaya Erez 	__le32 board_file_platform_type;
12390163b031SMaya Erez 	/* board file version */
12400163b031SMaya Erez 	__le32 board_file_version;
12410163b031SMaya Erez 	__le32 reserved[2];
12420163b031SMaya Erez } __packed;
12430163b031SMaya Erez 
12440163b031SMaya Erez /* WMI_GET_BASEBAND_TYPE_EVENTID */
12450163b031SMaya Erez enum baseband_type {
12460163b031SMaya Erez 	BASEBAND_UNKNOWN	= 0x00,
12470163b031SMaya Erez 	BASEBAND_SPARROW_M_A0	= 0x03,
12480163b031SMaya Erez 	BASEBAND_SPARROW_M_A1	= 0x04,
12490163b031SMaya Erez 	BASEBAND_SPARROW_M_B0	= 0x05,
12500163b031SMaya Erez 	BASEBAND_SPARROW_M_C0	= 0x06,
12510163b031SMaya Erez 	BASEBAND_SPARROW_M_D0	= 0x07,
12528ae5d62cSLior David 	BASEBAND_TALYN_M_A0	= 0x08,
12530163b031SMaya Erez };
12540163b031SMaya Erez 
12550163b031SMaya Erez /* WMI_GET_BASEBAND_TYPE_EVENTID */
12560163b031SMaya Erez struct wmi_get_baseband_type_event {
12570163b031SMaya Erez 	/* enum baseband_type */
12580163b031SMaya Erez 	__le32 baseband_type;
12592be7d22fSVladimir Kondratiev } __packed;
12602be7d22fSVladimir Kondratiev 
1261b874ddecSLior David /* WMI_MAC_ADDR_RESP_EVENTID */
12622be7d22fSVladimir Kondratiev struct wmi_mac_addr_resp_event {
12632be7d22fSVladimir Kondratiev 	u8 mac[WMI_MAC_LEN];
12642be7d22fSVladimir Kondratiev 	u8 auth_mode;
12652be7d22fSVladimir Kondratiev 	u8 crypt_mode;
12662be7d22fSVladimir Kondratiev 	__le32 offload_mode;
12672be7d22fSVladimir Kondratiev } __packed;
12682be7d22fSVladimir Kondratiev 
1269b874ddecSLior David /* WMI_EAPOL_RX_EVENTID */
12702be7d22fSVladimir Kondratiev struct wmi_eapol_rx_event {
12712be7d22fSVladimir Kondratiev 	u8 src_mac[WMI_MAC_LEN];
12722be7d22fSVladimir Kondratiev 	__le16 eapol_len;
12732be7d22fSVladimir Kondratiev 	u8 eapol[0];
12742be7d22fSVladimir Kondratiev } __packed;
12752be7d22fSVladimir Kondratiev 
1276b874ddecSLior David /* WMI_READY_EVENTID */
12772be7d22fSVladimir Kondratiev enum wmi_phy_capability {
1278b874ddecSLior David 	WMI_11A_CAPABILITY		= 0x01,
1279b874ddecSLior David 	WMI_11G_CAPABILITY		= 0x02,
1280b874ddecSLior David 	WMI_11AG_CAPABILITY		= 0x03,
1281b874ddecSLior David 	WMI_11NA_CAPABILITY		= 0x04,
1282b874ddecSLior David 	WMI_11NG_CAPABILITY		= 0x05,
1283b874ddecSLior David 	WMI_11NAG_CAPABILITY		= 0x06,
1284b874ddecSLior David 	WMI_11AD_CAPABILITY		= 0x07,
1285b874ddecSLior David 	WMI_11N_CAPABILITY_OFFSET	= 0x03,
12862be7d22fSVladimir Kondratiev };
12872be7d22fSVladimir Kondratiev 
12882be7d22fSVladimir Kondratiev struct wmi_ready_event {
12892be7d22fSVladimir Kondratiev 	__le32 sw_version;
12902be7d22fSVladimir Kondratiev 	__le32 abi_version;
12912be7d22fSVladimir Kondratiev 	u8 mac[WMI_MAC_LEN];
1292b874ddecSLior David 	/* enum wmi_phy_capability */
1293b874ddecSLior David 	u8 phy_capability;
1294b8023177SVladimir Kondratiev 	u8 numof_additional_mids;
12952be7d22fSVladimir Kondratiev } __packed;
12962be7d22fSVladimir Kondratiev 
1297b874ddecSLior David /* WMI_NOTIFY_REQ_DONE_EVENTID */
12982be7d22fSVladimir Kondratiev struct wmi_notify_req_done_event {
1299b874ddecSLior David 	/* beamforming status, 0: fail; 1: OK; 2: retrying */
1300b874ddecSLior David 	__le32 status;
13012be7d22fSVladimir Kondratiev 	__le64 tsf;
13022be7d22fSVladimir Kondratiev 	__le32 snr_val;
13032be7d22fSVladimir Kondratiev 	__le32 tx_tpt;
13042be7d22fSVladimir Kondratiev 	__le32 tx_goodput;
13052be7d22fSVladimir Kondratiev 	__le32 rx_goodput;
13062be7d22fSVladimir Kondratiev 	__le16 bf_mcs;
13072be7d22fSVladimir Kondratiev 	__le16 my_rx_sector;
13082be7d22fSVladimir Kondratiev 	__le16 my_tx_sector;
13092be7d22fSVladimir Kondratiev 	__le16 other_rx_sector;
13102be7d22fSVladimir Kondratiev 	__le16 other_tx_sector;
13112be7d22fSVladimir Kondratiev 	__le16 range;
1312b8023177SVladimir Kondratiev 	u8 sqi;
1313b8023177SVladimir Kondratiev 	u8 reserved[3];
13142be7d22fSVladimir Kondratiev } __packed;
13152be7d22fSVladimir Kondratiev 
1316b874ddecSLior David /* WMI_CONNECT_EVENTID */
13172be7d22fSVladimir Kondratiev struct wmi_connect_event {
13182be7d22fSVladimir Kondratiev 	u8 channel;
13192be7d22fSVladimir Kondratiev 	u8 reserved0;
13202be7d22fSVladimir Kondratiev 	u8 bssid[WMI_MAC_LEN];
13212be7d22fSVladimir Kondratiev 	__le16 listen_interval;
13222be7d22fSVladimir Kondratiev 	__le16 beacon_interval;
13232be7d22fSVladimir Kondratiev 	u8 network_type;
13242be7d22fSVladimir Kondratiev 	u8 reserved1[3];
13252be7d22fSVladimir Kondratiev 	u8 beacon_ie_len;
13262be7d22fSVladimir Kondratiev 	u8 assoc_req_len;
13272be7d22fSVladimir Kondratiev 	u8 assoc_resp_len;
13282be7d22fSVladimir Kondratiev 	u8 cid;
1329a52fb913SLior David 	u8 aid;
1330a52fb913SLior David 	u8 reserved2[2];
1331b874ddecSLior David 	/* not in use */
13322be7d22fSVladimir Kondratiev 	u8 assoc_info[0];
13332be7d22fSVladimir Kondratiev } __packed;
13342be7d22fSVladimir Kondratiev 
1335849a564bSDedy Lansky /* disconnect_reason */
13362be7d22fSVladimir Kondratiev enum wmi_disconnect_reason {
1337b874ddecSLior David 	WMI_DIS_REASON_NO_NETWORK_AVAIL		= 0x01,
1338b874ddecSLior David 	/* bmiss */
1339b874ddecSLior David 	WMI_DIS_REASON_LOST_LINK		= 0x02,
1340b874ddecSLior David 	WMI_DIS_REASON_DISCONNECT_CMD		= 0x03,
1341b874ddecSLior David 	WMI_DIS_REASON_BSS_DISCONNECTED		= 0x04,
1342b874ddecSLior David 	WMI_DIS_REASON_AUTH_FAILED		= 0x05,
1343b874ddecSLior David 	WMI_DIS_REASON_ASSOC_FAILED		= 0x06,
1344b874ddecSLior David 	WMI_DIS_REASON_NO_RESOURCES_AVAIL	= 0x07,
1345b874ddecSLior David 	WMI_DIS_REASON_CSERV_DISCONNECT		= 0x08,
1346b874ddecSLior David 	WMI_DIS_REASON_INVALID_PROFILE		= 0x0A,
1347b874ddecSLior David 	WMI_DIS_REASON_DOT11H_CHANNEL_SWITCH	= 0x0B,
1348b874ddecSLior David 	WMI_DIS_REASON_PROFILE_MISMATCH		= 0x0C,
1349b874ddecSLior David 	WMI_DIS_REASON_CONNECTION_EVICTED	= 0x0D,
1350b874ddecSLior David 	WMI_DIS_REASON_IBSS_MERGE		= 0x0E,
13512be7d22fSVladimir Kondratiev };
13522be7d22fSVladimir Kondratiev 
1353849a564bSDedy Lansky /* WMI_DISCONNECT_EVENTID */
13542be7d22fSVladimir Kondratiev struct wmi_disconnect_event {
1355b874ddecSLior David 	/* reason code, see 802.11 spec. */
1356b874ddecSLior David 	__le16 protocol_reason_status;
1357b874ddecSLior David 	/* set if known */
1358b874ddecSLior David 	u8 bssid[WMI_MAC_LEN];
1359b874ddecSLior David 	/* see enum wmi_disconnect_reason */
1360b874ddecSLior David 	u8 disconnect_reason;
1361b874ddecSLior David 	/* last assoc req may passed to host - not in used */
1362b874ddecSLior David 	u8 assoc_resp_len;
1363b874ddecSLior David 	/* last assoc req may passed to host - not in used */
1364b874ddecSLior David 	u8 assoc_info[0];
13652be7d22fSVladimir Kondratiev } __packed;
13662be7d22fSVladimir Kondratiev 
1367b874ddecSLior David /* WMI_SCAN_COMPLETE_EVENTID */
13686c2faf09SVladimir Kondratiev enum scan_status {
1369b874ddecSLior David 	WMI_SCAN_SUCCESS	= 0x00,
1370b874ddecSLior David 	WMI_SCAN_FAILED		= 0x01,
1371b874ddecSLior David 	WMI_SCAN_ABORTED	= 0x02,
1372b874ddecSLior David 	WMI_SCAN_REJECTED	= 0x03,
1373b874ddecSLior David 	WMI_SCAN_ABORT_REJECTED	= 0x04,
13746c2faf09SVladimir Kondratiev };
13756c2faf09SVladimir Kondratiev 
13762be7d22fSVladimir Kondratiev struct wmi_scan_complete_event {
1377b874ddecSLior David 	/* enum scan_status */
1378b874ddecSLior David 	__le32 status;
13792be7d22fSVladimir Kondratiev } __packed;
13802be7d22fSVladimir Kondratiev 
1381b874ddecSLior David /* WMI_ACS_PASSIVE_SCAN_COMPLETE_EVENT */
1382b874ddecSLior David enum wmi_acs_info_bitmask {
1383b874ddecSLior David 	WMI_ACS_INFO_BITMASK_BEACON_FOUND	= 0x01,
1384b874ddecSLior David 	WMI_ACS_INFO_BITMASK_BUSY_TIME		= 0x02,
1385b874ddecSLior David 	WMI_ACS_INFO_BITMASK_TX_TIME		= 0x04,
1386b874ddecSLior David 	WMI_ACS_INFO_BITMASK_RX_TIME		= 0x08,
1387b874ddecSLior David 	WMI_ACS_INFO_BITMASK_NOISE		= 0x10,
13882be7d22fSVladimir Kondratiev };
13892be7d22fSVladimir Kondratiev 
1390b874ddecSLior David struct scan_acs_info {
1391b874ddecSLior David 	u8 channel;
1392b874ddecSLior David 	u8 beacon_found;
1393b874ddecSLior David 	/* msec */
1394b874ddecSLior David 	__le16 busy_time;
1395b874ddecSLior David 	__le16 tx_time;
1396b874ddecSLior David 	__le16 rx_time;
1397b874ddecSLior David 	u8 noise;
1398b874ddecSLior David 	u8 reserved[3];
1399b874ddecSLior David } __packed;
1400b874ddecSLior David 
1401b874ddecSLior David struct wmi_acs_passive_scan_complete_event {
1402b874ddecSLior David 	__le32 dwell_time;
1403b874ddecSLior David 	/* valid fields within channel info according to
1404b874ddecSLior David 	 * their appearance in struct order
1405b874ddecSLior David 	 */
1406b874ddecSLior David 	__le16 filled;
1407b874ddecSLior David 	u8 num_scanned_channels;
1408b874ddecSLior David 	u8 reserved;
1409b874ddecSLior David 	struct scan_acs_info scan_info_list[0];
1410b874ddecSLior David } __packed;
1411b874ddecSLior David 
1412b874ddecSLior David /* WMI_BA_STATUS_EVENTID */
1413b874ddecSLior David enum wmi_vring_ba_status {
1414b874ddecSLior David 	WMI_BA_AGREED			= 0x00,
1415b874ddecSLior David 	WMI_BA_NON_AGREED		= 0x01,
1416b874ddecSLior David 	/* BA_EN in middle of teardown flow */
1417b874ddecSLior David 	WMI_BA_TD_WIP			= 0x02,
1418b874ddecSLior David 	/* BA_DIS or BA_EN in middle of BA SETUP flow */
1419b874ddecSLior David 	WMI_BA_SETUP_WIP		= 0x03,
1420b874ddecSLior David 	/* BA_EN when the BA session is already active */
1421b874ddecSLior David 	WMI_BA_SESSION_ACTIVE		= 0x04,
1422b874ddecSLior David 	/* BA_DIS when the BA session is not active */
1423b874ddecSLior David 	WMI_BA_SESSION_NOT_ACTIVE	= 0x05,
1424b874ddecSLior David };
1425b874ddecSLior David 
1426b874ddecSLior David struct wmi_ba_status_event {
1427b874ddecSLior David 	/* enum wmi_vring_ba_status */
1428b874ddecSLior David 	__le16 status;
14292be7d22fSVladimir Kondratiev 	u8 reserved[2];
14302be7d22fSVladimir Kondratiev 	u8 ringid;
14312be7d22fSVladimir Kondratiev 	u8 agg_wsize;
14322be7d22fSVladimir Kondratiev 	__le16 ba_timeout;
1433cbcf5866SVladimir Kondratiev 	u8 amsdu;
14342be7d22fSVladimir Kondratiev } __packed;
14352be7d22fSVladimir Kondratiev 
1436b874ddecSLior David /* WMI_DELBA_EVENTID */
14372be7d22fSVladimir Kondratiev struct wmi_delba_event {
14382be7d22fSVladimir Kondratiev 	u8 cidxtid;
14392be7d22fSVladimir Kondratiev 	u8 from_initiator;
14402be7d22fSVladimir Kondratiev 	__le16 reason;
14412be7d22fSVladimir Kondratiev } __packed;
14422be7d22fSVladimir Kondratiev 
1443b874ddecSLior David /* WMI_VRING_CFG_DONE_EVENTID */
14442be7d22fSVladimir Kondratiev struct wmi_vring_cfg_done_event {
14452be7d22fSVladimir Kondratiev 	u8 ringid;
14462be7d22fSVladimir Kondratiev 	u8 status;
14472be7d22fSVladimir Kondratiev 	u8 reserved[2];
14482be7d22fSVladimir Kondratiev 	__le32 tx_vring_tail_ptr;
14492be7d22fSVladimir Kondratiev } __packed;
14502be7d22fSVladimir Kondratiev 
1451b874ddecSLior David /* WMI_RCP_ADDBA_RESP_SENT_EVENTID */
14522be7d22fSVladimir Kondratiev struct wmi_rcp_addba_resp_sent_event {
14532be7d22fSVladimir Kondratiev 	u8 cidxtid;
14542be7d22fSVladimir Kondratiev 	u8 reserved;
14552be7d22fSVladimir Kondratiev 	__le16 status;
14562be7d22fSVladimir Kondratiev } __packed;
14572be7d22fSVladimir Kondratiev 
1458b874ddecSLior David /* WMI_RCP_ADDBA_REQ_EVENTID */
14592be7d22fSVladimir Kondratiev struct wmi_rcp_addba_req_event {
14602be7d22fSVladimir Kondratiev 	u8 cidxtid;
14612be7d22fSVladimir Kondratiev 	u8 dialog_token;
1462b874ddecSLior David 	/* ieee80211_ba_parameterset as it received */
1463b874ddecSLior David 	__le16 ba_param_set;
14642be7d22fSVladimir Kondratiev 	__le16 ba_timeout;
1465b874ddecSLior David 	/* ieee80211_ba_seqstrl field as it received */
1466b874ddecSLior David 	__le16 ba_seq_ctrl;
14672be7d22fSVladimir Kondratiev } __packed;
14682be7d22fSVladimir Kondratiev 
1469b874ddecSLior David /* WMI_CFG_RX_CHAIN_DONE_EVENTID */
14702be7d22fSVladimir Kondratiev enum wmi_cfg_rx_chain_done_event_status {
1471b874ddecSLior David 	WMI_CFG_RX_CHAIN_SUCCESS	= 0x01,
14722be7d22fSVladimir Kondratiev };
14732be7d22fSVladimir Kondratiev 
14742be7d22fSVladimir Kondratiev struct wmi_cfg_rx_chain_done_event {
1475b874ddecSLior David 	/* V-Ring Tail pointer */
1476b874ddecSLior David 	__le32 rx_ring_tail_ptr;
14772be7d22fSVladimir Kondratiev 	__le32 status;
14782be7d22fSVladimir Kondratiev } __packed;
14792be7d22fSVladimir Kondratiev 
1480b874ddecSLior David /* WMI_WBE_LINK_DOWN_EVENTID */
14812be7d22fSVladimir Kondratiev enum wmi_wbe_link_down_event_reason {
1482b874ddecSLior David 	WMI_WBE_REASON_USER_REQUEST	= 0x00,
1483b874ddecSLior David 	WMI_WBE_REASON_RX_DISASSOC	= 0x01,
1484b874ddecSLior David 	WMI_WBE_REASON_BAD_PHY_LINK	= 0x02,
14852be7d22fSVladimir Kondratiev };
14862be7d22fSVladimir Kondratiev 
1487b874ddecSLior David /* WMI_WBE_LINK_DOWN_EVENTID */
14882be7d22fSVladimir Kondratiev struct wmi_wbe_link_down_event {
14892be7d22fSVladimir Kondratiev 	u8 cid;
14902be7d22fSVladimir Kondratiev 	u8 reserved[3];
14912be7d22fSVladimir Kondratiev 	__le32 reason;
14922be7d22fSVladimir Kondratiev } __packed;
14932be7d22fSVladimir Kondratiev 
1494b874ddecSLior David /* WMI_DATA_PORT_OPEN_EVENTID */
14952be7d22fSVladimir Kondratiev struct wmi_data_port_open_event {
14962be7d22fSVladimir Kondratiev 	u8 cid;
14972be7d22fSVladimir Kondratiev 	u8 reserved[3];
14982be7d22fSVladimir Kondratiev } __packed;
14992be7d22fSVladimir Kondratiev 
1500b874ddecSLior David /* WMI_VRING_EN_EVENTID */
1501230d8442SVladimir Kondratiev struct wmi_vring_en_event {
1502230d8442SVladimir Kondratiev 	u8 vring_index;
1503230d8442SVladimir Kondratiev 	u8 reserved[3];
1504230d8442SVladimir Kondratiev } __packed;
1505230d8442SVladimir Kondratiev 
1506b874ddecSLior David /* WMI_GET_PCP_CHANNEL_EVENTID */
15072be7d22fSVladimir Kondratiev struct wmi_get_pcp_channel_event {
15082be7d22fSVladimir Kondratiev 	u8 channel;
15092be7d22fSVladimir Kondratiev 	u8 reserved[3];
15102be7d22fSVladimir Kondratiev } __packed;
15112be7d22fSVladimir Kondratiev 
1512b874ddecSLior David /* WMI_P2P_CFG_DONE_EVENTID */
15138c679675SVladimir Kondratiev struct wmi_p2p_cfg_done_event {
1514b874ddecSLior David 	/* wmi_fw_status */
1515b874ddecSLior David 	u8 status;
15168c679675SVladimir Kondratiev 	u8 reserved[3];
15178c679675SVladimir Kondratiev } __packed;
15188c679675SVladimir Kondratiev 
1519b874ddecSLior David /* WMI_PORT_ALLOCATED_EVENTID */
1520b8023177SVladimir Kondratiev struct wmi_port_allocated_event {
1521b874ddecSLior David 	/* wmi_fw_status */
1522b874ddecSLior David 	u8 status;
1523b8023177SVladimir Kondratiev 	u8 reserved[3];
1524b8023177SVladimir Kondratiev } __packed;
1525b8023177SVladimir Kondratiev 
1526b874ddecSLior David /* WMI_PORT_DELETED_EVENTID */
1527b8023177SVladimir Kondratiev struct wmi_port_deleted_event {
1528b874ddecSLior David 	/* wmi_fw_status */
1529b874ddecSLior David 	u8 status;
1530b8023177SVladimir Kondratiev 	u8 reserved[3];
1531b8023177SVladimir Kondratiev } __packed;
1532b8023177SVladimir Kondratiev 
1533b874ddecSLior David /* WMI_LISTEN_STARTED_EVENTID */
1534b8023177SVladimir Kondratiev struct wmi_listen_started_event {
1535b874ddecSLior David 	/* wmi_fw_status */
1536b874ddecSLior David 	u8 status;
1537b8023177SVladimir Kondratiev 	u8 reserved[3];
1538b8023177SVladimir Kondratiev } __packed;
1539b8023177SVladimir Kondratiev 
1540b874ddecSLior David /* WMI_SEARCH_STARTED_EVENTID */
1541b8023177SVladimir Kondratiev struct wmi_search_started_event {
1542b874ddecSLior David 	/* wmi_fw_status */
1543b874ddecSLior David 	u8 status;
1544b8023177SVladimir Kondratiev 	u8 reserved[3];
1545b8023177SVladimir Kondratiev } __packed;
1546b8023177SVladimir Kondratiev 
1547b874ddecSLior David /* WMI_PCP_STARTED_EVENTID */
1548b8023177SVladimir Kondratiev struct wmi_pcp_started_event {
1549b874ddecSLior David 	/* wmi_fw_status */
1550b874ddecSLior David 	u8 status;
1551b8023177SVladimir Kondratiev 	u8 reserved[3];
1552b8023177SVladimir Kondratiev } __packed;
1553b8023177SVladimir Kondratiev 
1554b874ddecSLior David /* WMI_PCP_FACTOR_EVENTID */
1555b8023177SVladimir Kondratiev struct wmi_pcp_factor_event {
1556b8023177SVladimir Kondratiev 	__le32 pcp_factor;
1557b8023177SVladimir Kondratiev } __packed;
1558b8023177SVladimir Kondratiev 
15592be7d22fSVladimir Kondratiev enum wmi_sw_tx_status {
1560b874ddecSLior David 	WMI_TX_SW_STATUS_SUCCESS		= 0x00,
1561b874ddecSLior David 	WMI_TX_SW_STATUS_FAILED_NO_RESOURCES	= 0x01,
1562b874ddecSLior David 	WMI_TX_SW_STATUS_FAILED_TX		= 0x02,
15632be7d22fSVladimir Kondratiev };
15642be7d22fSVladimir Kondratiev 
1565b874ddecSLior David /* WMI_SW_TX_COMPLETE_EVENTID */
15662be7d22fSVladimir Kondratiev struct wmi_sw_tx_complete_event {
1567b874ddecSLior David 	/* enum wmi_sw_tx_status */
1568b874ddecSLior David 	u8 status;
15692be7d22fSVladimir Kondratiev 	u8 reserved[3];
15702be7d22fSVladimir Kondratiev } __packed;
15712be7d22fSVladimir Kondratiev 
1572b874ddecSLior David /* WMI_CORR_MEASURE_EVENTID */
1573b8023177SVladimir Kondratiev struct wmi_corr_measure_event {
1574b874ddecSLior David 	/* signed */
1575b874ddecSLior David 	__le32 i;
1576b874ddecSLior David 	/* signed */
1577b874ddecSLior David 	__le32 q;
1578b874ddecSLior David 	/* signed */
1579b874ddecSLior David 	__le32 image_i;
1580b874ddecSLior David 	/* signed */
1581b874ddecSLior David 	__le32 image_q;
1582b8023177SVladimir Kondratiev } __packed;
1583b8023177SVladimir Kondratiev 
1584b874ddecSLior David /* WMI_READ_RSSI_EVENTID */
1585b8023177SVladimir Kondratiev struct wmi_read_rssi_event {
1586b8023177SVladimir Kondratiev 	__le32 ina_rssi_adc_dbm;
1587b8023177SVladimir Kondratiev } __packed;
1588b8023177SVladimir Kondratiev 
1589b874ddecSLior David /* WMI_GET_SSID_EVENTID */
15902be7d22fSVladimir Kondratiev struct wmi_get_ssid_event {
15912be7d22fSVladimir Kondratiev 	__le32 ssid_len;
15922be7d22fSVladimir Kondratiev 	u8 ssid[WMI_MAX_SSID_LEN];
15932be7d22fSVladimir Kondratiev } __packed;
15942be7d22fSVladimir Kondratiev 
1595b874ddecSLior David /* wmi_rx_mgmt_info */
15962be7d22fSVladimir Kondratiev struct wmi_rx_mgmt_info {
15972be7d22fSVladimir Kondratiev 	u8 mcs;
15982be7d22fSVladimir Kondratiev 	s8 snr;
1599b8023177SVladimir Kondratiev 	u8 range;
1600b8023177SVladimir Kondratiev 	u8 sqi;
16012be7d22fSVladimir Kondratiev 	__le16 stype;
16022be7d22fSVladimir Kondratiev 	__le16 status;
16032be7d22fSVladimir Kondratiev 	__le32 len;
1604b874ddecSLior David 	/* Not resolved when == 0xFFFFFFFF  ==> Broadcast to all MIDS */
16052be7d22fSVladimir Kondratiev 	u8 qid;
1606b874ddecSLior David 	/* Not resolved when == 0xFFFFFFFF  ==> Broadcast to all MIDS */
16072be7d22fSVladimir Kondratiev 	u8 mid;
16082be7d22fSVladimir Kondratiev 	u8 cid;
1609b874ddecSLior David 	/* From Radio MNGR */
1610b874ddecSLior David 	u8 channel;
16112be7d22fSVladimir Kondratiev } __packed;
16122be7d22fSVladimir Kondratiev 
1613b874ddecSLior David /* wmi_otp_read_write_cmd */
1614b874ddecSLior David struct wmi_otp_read_write_cmd {
1615b874ddecSLior David 	__le32 addr;
1616b874ddecSLior David 	__le32 size;
1617b874ddecSLior David 	u8 values[0];
1618b874ddecSLior David } __packed;
1619b874ddecSLior David 
1620b874ddecSLior David /* WMI_OTP_READ_RESULT_EVENTID */
1621b874ddecSLior David struct wmi_otp_read_result_event {
1622b874ddecSLior David 	u8 payload[0];
1623b874ddecSLior David } __packed;
1624b874ddecSLior David 
1625b874ddecSLior David /* WMI_TX_MGMT_PACKET_EVENTID */
16266c2faf09SVladimir Kondratiev struct wmi_tx_mgmt_packet_event {
16276c2faf09SVladimir Kondratiev 	u8 payload[0];
16286c2faf09SVladimir Kondratiev } __packed;
16296c2faf09SVladimir Kondratiev 
1630b874ddecSLior David /* WMI_RX_MGMT_PACKET_EVENTID */
16312be7d22fSVladimir Kondratiev struct wmi_rx_mgmt_packet_event {
16322be7d22fSVladimir Kondratiev 	struct wmi_rx_mgmt_info info;
16332be7d22fSVladimir Kondratiev 	u8 payload[0];
16342be7d22fSVladimir Kondratiev } __packed;
16352be7d22fSVladimir Kondratiev 
1636b874ddecSLior David /* WMI_ECHO_RSP_EVENTID */
1637b874ddecSLior David struct wmi_echo_rsp_event {
16382be7d22fSVladimir Kondratiev 	__le32 echoed_value;
16392be7d22fSVladimir Kondratiev } __packed;
16402be7d22fSVladimir Kondratiev 
1641b874ddecSLior David /* WMI_TEMP_SENSE_DONE_EVENTID
1642b8023177SVladimir Kondratiev  *
1643b8023177SVladimir Kondratiev  * Measure MAC and radio temperatures
1644b8023177SVladimir Kondratiev  */
1645b8023177SVladimir Kondratiev struct wmi_temp_sense_done_event {
1646b874ddecSLior David 	/* Temperature times 1000 (actual temperature will be achieved by
1647b874ddecSLior David 	 * dividing the value by 1000)
1648b874ddecSLior David 	 */
16498c679675SVladimir Kondratiev 	__le32 baseband_t1000;
1650b874ddecSLior David 	/* Temperature times 1000 (actual temperature will be achieved by
1651b874ddecSLior David 	 * dividing the value by 1000)
1652b874ddecSLior David 	 */
16538c679675SVladimir Kondratiev 	__le32 rf_t1000;
1654b8023177SVladimir Kondratiev } __packed;
1655b8023177SVladimir Kondratiev 
1656b874ddecSLior David #define WMI_SCAN_DWELL_TIME_MS	(100)
1657b874ddecSLior David #define WMI_SURVEY_TIMEOUT_MS	(10000)
1658b874ddecSLior David 
1659b874ddecSLior David enum wmi_hidden_ssid {
1660b874ddecSLior David 	WMI_HIDDEN_SSID_DISABLED	= 0x00,
1661b874ddecSLior David 	WMI_HIDDEN_SSID_SEND_EMPTY	= 0x10,
1662b874ddecSLior David 	WMI_HIDDEN_SSID_CLEAR		= 0xFE,
1663b874ddecSLior David };
1664b874ddecSLior David 
166510d599adSMaya Erez /* WMI_LED_CFG_CMDID
166610d599adSMaya Erez  *
166710d599adSMaya Erez  * Configure LED On\Off\Blinking operation
166810d599adSMaya Erez  *
166910d599adSMaya Erez  * Returned events:
167010d599adSMaya Erez  * - WMI_LED_CFG_DONE_EVENTID
167110d599adSMaya Erez  */
167210d599adSMaya Erez enum led_mode {
167310d599adSMaya Erez 	LED_DISABLE	= 0x00,
167410d599adSMaya Erez 	LED_ENABLE	= 0x01,
167510d599adSMaya Erez };
167610d599adSMaya Erez 
167710d599adSMaya Erez /* The names of the led as
167810d599adSMaya Erez  * described on HW schemes.
167910d599adSMaya Erez  */
168010d599adSMaya Erez enum wmi_led_id {
168110d599adSMaya Erez 	WMI_LED_WLAN	= 0x00,
168210d599adSMaya Erez 	WMI_LED_WPAN	= 0x01,
168310d599adSMaya Erez 	WMI_LED_WWAN	= 0x02,
168410d599adSMaya Erez };
168510d599adSMaya Erez 
168610d599adSMaya Erez /* Led polarity mode. */
168710d599adSMaya Erez enum wmi_led_polarity {
168810d599adSMaya Erez 	LED_POLARITY_HIGH_ACTIVE	= 0x00,
168910d599adSMaya Erez 	LED_POLARITY_LOW_ACTIVE		= 0x01,
169010d599adSMaya Erez };
169110d599adSMaya Erez 
169210d599adSMaya Erez /* Combination of on and off
169310d599adSMaya Erez  * creates the blinking period
169410d599adSMaya Erez  */
169510d599adSMaya Erez struct wmi_led_blink_mode {
169610d599adSMaya Erez 	__le32 blink_on;
169710d599adSMaya Erez 	__le32 blink_off;
169810d599adSMaya Erez } __packed;
169910d599adSMaya Erez 
170010d599adSMaya Erez /* WMI_LED_CFG_CMDID */
170110d599adSMaya Erez struct wmi_led_cfg_cmd {
170210d599adSMaya Erez 	/* enum led_mode_e */
170310d599adSMaya Erez 	u8 led_mode;
170410d599adSMaya Erez 	/* enum wmi_led_id_e */
170510d599adSMaya Erez 	u8 id;
170610d599adSMaya Erez 	/* slow speed blinking combination */
170710d599adSMaya Erez 	struct wmi_led_blink_mode slow_blink_cfg;
170810d599adSMaya Erez 	/* medium speed blinking combination */
170910d599adSMaya Erez 	struct wmi_led_blink_mode medium_blink_cfg;
171010d599adSMaya Erez 	/* high speed blinking combination */
171110d599adSMaya Erez 	struct wmi_led_blink_mode fast_blink_cfg;
171210d599adSMaya Erez 	/* polarity of the led */
171310d599adSMaya Erez 	u8 led_polarity;
171410d599adSMaya Erez 	/* reserved */
171510d599adSMaya Erez 	u8 reserved;
171610d599adSMaya Erez } __packed;
171710d599adSMaya Erez 
171810d599adSMaya Erez /* WMI_LED_CFG_DONE_EVENTID */
171910d599adSMaya Erez struct wmi_led_cfg_done_event {
172010d599adSMaya Erez 	/* led config status */
172110d599adSMaya Erez 	__le32 status;
172210d599adSMaya Erez } __packed;
172310d599adSMaya Erez 
17240163b031SMaya Erez #define WMI_NUM_MCS	(13)
17250163b031SMaya Erez 
17260163b031SMaya Erez /* Rate search parameters configuration per connection */
17270163b031SMaya Erez struct wmi_rs_cfg {
17280163b031SMaya Erez 	/* The maximal allowed PER for each MCS
17290163b031SMaya Erez 	 * MCS will be considered as failed if PER during RS is higher
17300163b031SMaya Erez 	 */
17310163b031SMaya Erez 	u8 per_threshold[WMI_NUM_MCS];
17320163b031SMaya Erez 	/* Number of MPDUs for each MCS
17330163b031SMaya Erez 	 * this is the minimal statistic required to make an educated
17340163b031SMaya Erez 	 * decision
17350163b031SMaya Erez 	 */
17360163b031SMaya Erez 	u8 min_frame_cnt[WMI_NUM_MCS];
17370163b031SMaya Erez 	/* stop threshold [0-100] */
17380163b031SMaya Erez 	u8 stop_th;
17390163b031SMaya Erez 	/* MCS1 stop threshold [0-100] */
17400163b031SMaya Erez 	u8 mcs1_fail_th;
17410163b031SMaya Erez 	u8 max_back_failure_th;
17420163b031SMaya Erez 	/* Debug feature for disabling internal RS trigger (which is
17430163b031SMaya Erez 	 * currently triggered by BF Done)
17440163b031SMaya Erez 	 */
17450163b031SMaya Erez 	u8 dbg_disable_internal_trigger;
17460163b031SMaya Erez 	__le32 back_failure_mask;
17470163b031SMaya Erez 	__le32 mcs_en_vec;
17480163b031SMaya Erez } __packed;
17490163b031SMaya Erez 
17500163b031SMaya Erez /* WMI_RS_CFG_CMDID */
17510163b031SMaya Erez struct wmi_rs_cfg_cmd {
17520163b031SMaya Erez 	/* connection id */
17530163b031SMaya Erez 	u8 cid;
17540163b031SMaya Erez 	/* enable or disable rate search */
17550163b031SMaya Erez 	u8 rs_enable;
17560163b031SMaya Erez 	/* rate search configuration */
17570163b031SMaya Erez 	struct wmi_rs_cfg rs_cfg;
17580163b031SMaya Erez } __packed;
17590163b031SMaya Erez 
17600163b031SMaya Erez /* WMI_RS_CFG_DONE_EVENTID */
17610163b031SMaya Erez struct wmi_rs_cfg_done_event {
17620163b031SMaya Erez 	u8 cid;
17630163b031SMaya Erez 	/* enum wmi_fw_status */
17640163b031SMaya Erez 	u8 status;
17650163b031SMaya Erez 	u8 reserved[2];
17660163b031SMaya Erez } __packed;
17670163b031SMaya Erez 
176808989f96SLior David /* WMI_GET_DETAILED_RS_RES_CMDID */
176908989f96SLior David struct wmi_get_detailed_rs_res_cmd {
177008989f96SLior David 	/* connection id */
177108989f96SLior David 	u8 cid;
177208989f96SLior David 	u8 reserved[3];
177308989f96SLior David } __packed;
177408989f96SLior David 
177508989f96SLior David /* RS results status */
177608989f96SLior David enum wmi_rs_results_status {
177708989f96SLior David 	WMI_RS_RES_VALID	= 0x00,
177808989f96SLior David 	WMI_RS_RES_INVALID	= 0x01,
177908989f96SLior David };
178008989f96SLior David 
178108989f96SLior David /* Rate search results */
178208989f96SLior David struct wmi_rs_results {
178308989f96SLior David 	/* number of sent MPDUs */
178408989f96SLior David 	u8 num_of_tx_pkt[WMI_NUM_MCS];
178508989f96SLior David 	/* number of non-acked MPDUs */
178608989f96SLior David 	u8 num_of_non_acked_pkt[WMI_NUM_MCS];
178708989f96SLior David 	/* RS timestamp */
178808989f96SLior David 	__le32 tsf;
178908989f96SLior David 	/* RS selected MCS */
179008989f96SLior David 	u8 mcs;
179108989f96SLior David } __packed;
179208989f96SLior David 
179308989f96SLior David /* WMI_GET_DETAILED_RS_RES_EVENTID */
179408989f96SLior David struct wmi_get_detailed_rs_res_event {
179508989f96SLior David 	u8 cid;
179608989f96SLior David 	/* enum wmi_rs_results_status */
179708989f96SLior David 	u8 status;
179808989f96SLior David 	/* detailed rs results */
179908989f96SLior David 	struct wmi_rs_results rs_results;
180008989f96SLior David 	u8 reserved[3];
180108989f96SLior David } __packed;
180208989f96SLior David 
1803a52fb913SLior David /* BRP antenna limit mode */
1804a52fb913SLior David enum wmi_brp_ant_limit_mode {
1805a52fb913SLior David 	/* Disable BRP force antenna limit */
1806a52fb913SLior David 	WMI_BRP_ANT_LIMIT_MODE_DISABLE		= 0x00,
1807a52fb913SLior David 	/* Define maximal antennas limit. Only effective antennas will be
1808a52fb913SLior David 	 * actually used
1809a52fb913SLior David 	 */
1810a52fb913SLior David 	WMI_BRP_ANT_LIMIT_MODE_EFFECTIVE	= 0x01,
1811a52fb913SLior David 	/* Force a specific number of antennas */
1812a52fb913SLior David 	WMI_BRP_ANT_LIMIT_MODE_FORCE		= 0x02,
1813a52fb913SLior David 	/* number of BRP antenna limit modes */
1814a52fb913SLior David 	WMI_BRP_ANT_LIMIT_MODES_NUM		= 0x03,
1815a52fb913SLior David };
1816a52fb913SLior David 
1817a52fb913SLior David /* WMI_BRP_SET_ANT_LIMIT_CMDID */
1818a52fb913SLior David struct wmi_brp_set_ant_limit_cmd {
1819a52fb913SLior David 	/* connection id */
1820a52fb913SLior David 	u8 cid;
1821a52fb913SLior David 	/* enum wmi_brp_ant_limit_mode */
1822a52fb913SLior David 	u8 limit_mode;
1823a52fb913SLior David 	/* antenna limit count, 1-27
1824a52fb913SLior David 	 * disable_mode - ignored
1825a52fb913SLior David 	 * effective_mode - upper limit to number of antennas to be used
1826a52fb913SLior David 	 * force_mode - exact number of antennas to be used
1827a52fb913SLior David 	 */
1828a52fb913SLior David 	u8 ant_limit;
1829a52fb913SLior David 	u8 reserved;
1830a52fb913SLior David } __packed;
1831a52fb913SLior David 
1832a52fb913SLior David /* WMI_BRP_SET_ANT_LIMIT_EVENTID */
1833a52fb913SLior David struct wmi_brp_set_ant_limit_event {
1834a52fb913SLior David 	/* wmi_fw_status */
1835a52fb913SLior David 	u8 status;
1836a52fb913SLior David 	u8 reserved[3];
1837a52fb913SLior David } __packed;
1838a52fb913SLior David 
18390163b031SMaya Erez /* broadcast connection ID */
18400163b031SMaya Erez #define WMI_LINK_MAINTAIN_CFG_CID_BROADCAST	(0xFFFFFFFF)
18410163b031SMaya Erez 
18420163b031SMaya Erez /* Types wmi_link_maintain_cfg presets for WMI_LINK_MAINTAIN_CFG_WRITE_CMD */
18430163b031SMaya Erez enum wmi_link_maintain_cfg_type {
18440163b031SMaya Erez 	/* AP/PCP default normal (non-FST) configuration settings */
18450163b031SMaya Erez 	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_NORMAL_AP	= 0x00,
18460163b031SMaya Erez 	/* AP/PCP  default FST configuration settings */
18470163b031SMaya Erez 	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_FST_AP	= 0x01,
18480163b031SMaya Erez 	/* STA default normal (non-FST) configuration settings */
18490163b031SMaya Erez 	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_NORMAL_STA	= 0x02,
18500163b031SMaya Erez 	/* STA default FST configuration settings */
18510163b031SMaya Erez 	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_FST_STA	= 0x03,
18520163b031SMaya Erez 	/* custom configuration settings */
18530163b031SMaya Erez 	WMI_LINK_MAINTAIN_CFG_TYPE_CUSTOM		= 0x04,
18540163b031SMaya Erez 	/* number of defined configuration types */
18550163b031SMaya Erez 	WMI_LINK_MAINTAIN_CFG_TYPES_NUM			= 0x05,
18560163b031SMaya Erez };
18570163b031SMaya Erez 
18580163b031SMaya Erez /* Response status codes for WMI_LINK_MAINTAIN_CFG_WRITE/READ commands */
18590163b031SMaya Erez enum wmi_link_maintain_cfg_response_status {
18600163b031SMaya Erez 	/* WMI_LINK_MAINTAIN_CFG_WRITE/READ command successfully accomplished
18610163b031SMaya Erez 	 */
18620163b031SMaya Erez 	WMI_LINK_MAINTAIN_CFG_RESPONSE_STATUS_OK		= 0x00,
18630163b031SMaya Erez 	/* ERROR due to bad argument in WMI_LINK_MAINTAIN_CFG_WRITE/READ
18640163b031SMaya Erez 	 * command request
18650163b031SMaya Erez 	 */
18660163b031SMaya Erez 	WMI_LINK_MAINTAIN_CFG_RESPONSE_STATUS_BAD_ARGUMENT	= 0x01,
18670163b031SMaya Erez };
18680163b031SMaya Erez 
18690163b031SMaya Erez /* Link Loss and Keep Alive configuration */
18700163b031SMaya Erez struct wmi_link_maintain_cfg {
18710163b031SMaya Erez 	/* link_loss_enable_detectors_vec */
18720163b031SMaya Erez 	__le32 link_loss_enable_detectors_vec;
18730163b031SMaya Erez 	/* detectors check period usec */
18740163b031SMaya Erez 	__le32 check_link_loss_period_usec;
18750163b031SMaya Erez 	/* max allowed tx ageing */
18760163b031SMaya Erez 	__le32 tx_ageing_threshold_usec;
18770163b031SMaya Erez 	/* keep alive period for high SNR */
18780163b031SMaya Erez 	__le32 keep_alive_period_usec_high_snr;
18790163b031SMaya Erez 	/* keep alive period for low SNR */
18800163b031SMaya Erez 	__le32 keep_alive_period_usec_low_snr;
18810163b031SMaya Erez 	/* lower snr limit for keep alive period update */
18820163b031SMaya Erez 	__le32 keep_alive_snr_threshold_low_db;
18830163b031SMaya Erez 	/* upper snr limit for keep alive period update */
18840163b031SMaya Erez 	__le32 keep_alive_snr_threshold_high_db;
18850163b031SMaya Erez 	/* num of successive bad bcons causing link-loss */
18860163b031SMaya Erez 	__le32 bad_beacons_num_threshold;
18870163b031SMaya Erez 	/* SNR limit for bad_beacons_detector */
18880163b031SMaya Erez 	__le32 bad_beacons_snr_threshold_db;
18890163b031SMaya Erez } __packed;
18900163b031SMaya Erez 
18910163b031SMaya Erez /* WMI_LINK_MAINTAIN_CFG_WRITE_CMDID */
18920163b031SMaya Erez struct wmi_link_maintain_cfg_write_cmd {
18930163b031SMaya Erez 	/* enum wmi_link_maintain_cfg_type_e - type of requested default
18940163b031SMaya Erez 	 * configuration to be applied
18950163b031SMaya Erez 	 */
18960163b031SMaya Erez 	__le32 cfg_type;
18970163b031SMaya Erez 	/* requested connection ID or WMI_LINK_MAINTAIN_CFG_CID_BROADCAST */
18980163b031SMaya Erez 	__le32 cid;
18990163b031SMaya Erez 	/* custom configuration settings to be applied (relevant only if
19000163b031SMaya Erez 	 * cfg_type==WMI_LINK_MAINTAIN_CFG_TYPE_CUSTOM)
19010163b031SMaya Erez 	 */
19020163b031SMaya Erez 	struct wmi_link_maintain_cfg lm_cfg;
19030163b031SMaya Erez } __packed;
19040163b031SMaya Erez 
19050163b031SMaya Erez /* WMI_LINK_MAINTAIN_CFG_READ_CMDID */
19060163b031SMaya Erez struct wmi_link_maintain_cfg_read_cmd {
19070163b031SMaya Erez 	/* connection ID which configuration settings are requested */
19080163b031SMaya Erez 	__le32 cid;
19090163b031SMaya Erez } __packed;
19100163b031SMaya Erez 
19110163b031SMaya Erez /* WMI_LINK_MAINTAIN_CFG_WRITE_DONE_EVENTID */
19120163b031SMaya Erez struct wmi_link_maintain_cfg_write_done_event {
19130163b031SMaya Erez 	/* requested connection ID */
19140163b031SMaya Erez 	__le32 cid;
19150163b031SMaya Erez 	/* wmi_link_maintain_cfg_response_status_e - write status */
19160163b031SMaya Erez 	__le32 status;
19170163b031SMaya Erez } __packed;
19180163b031SMaya Erez 
19190163b031SMaya Erez /* \WMI_LINK_MAINTAIN_CFG_READ_DONE_EVENT */
19200163b031SMaya Erez struct wmi_link_maintain_cfg_read_done_event {
19210163b031SMaya Erez 	/* requested connection ID */
19220163b031SMaya Erez 	__le32 cid;
19230163b031SMaya Erez 	/* wmi_link_maintain_cfg_response_status_e - read status */
19240163b031SMaya Erez 	__le32 status;
19250163b031SMaya Erez 	/* Retrieved configuration settings */
19260163b031SMaya Erez 	struct wmi_link_maintain_cfg lm_cfg;
19270163b031SMaya Erez } __packed;
19280163b031SMaya Erez 
19290163b031SMaya Erez enum wmi_traffic_deferral_status {
19300163b031SMaya Erez 	WMI_TRAFFIC_DEFERRAL_APPROVED	= 0x0,
19310163b031SMaya Erez 	WMI_TRAFFIC_DEFERRAL_REJECTED	= 0x1,
19320163b031SMaya Erez };
19330163b031SMaya Erez 
19340163b031SMaya Erez /* WMI_TRAFFIC_DEFERRAL_EVENTID */
19350163b031SMaya Erez struct wmi_traffic_deferral_event {
19360163b031SMaya Erez 	/* enum wmi_traffic_deferral_status_e */
19370163b031SMaya Erez 	u8 status;
19380163b031SMaya Erez } __packed;
19390163b031SMaya Erez 
19400163b031SMaya Erez enum wmi_traffic_resume_status {
19410163b031SMaya Erez 	WMI_TRAFFIC_RESUME_SUCCESS	= 0x0,
19420163b031SMaya Erez 	WMI_TRAFFIC_RESUME_FAILED	= 0x1,
19430163b031SMaya Erez };
19440163b031SMaya Erez 
19450163b031SMaya Erez /* WMI_TRAFFIC_RESUME_EVENTID */
19460163b031SMaya Erez struct wmi_traffic_resume_event {
19470163b031SMaya Erez 	/* enum wmi_traffic_resume_status_e */
19480163b031SMaya Erez 	u8 status;
19490163b031SMaya Erez } __packed;
19500163b031SMaya Erez 
19510163b031SMaya Erez /* Power Save command completion status codes */
19520163b031SMaya Erez enum wmi_ps_cfg_cmd_status {
19530163b031SMaya Erez 	WMI_PS_CFG_CMD_STATUS_SUCCESS	= 0x00,
19540163b031SMaya Erez 	WMI_PS_CFG_CMD_STATUS_BAD_PARAM	= 0x01,
19550163b031SMaya Erez 	/* other error */
19560163b031SMaya Erez 	WMI_PS_CFG_CMD_STATUS_ERROR	= 0x02,
19570163b031SMaya Erez };
19580163b031SMaya Erez 
19590163b031SMaya Erez /* Device Power Save Profiles */
19600163b031SMaya Erez enum wmi_ps_profile_type {
19610163b031SMaya Erez 	WMI_PS_PROFILE_TYPE_DEFAULT		= 0x00,
19620163b031SMaya Erez 	WMI_PS_PROFILE_TYPE_PS_DISABLED		= 0x01,
19630163b031SMaya Erez 	WMI_PS_PROFILE_TYPE_MAX_PS		= 0x02,
19640163b031SMaya Erez 	WMI_PS_PROFILE_TYPE_LOW_LATENCY_PS	= 0x03,
19650163b031SMaya Erez };
19660163b031SMaya Erez 
19670163b031SMaya Erez /* WMI_PS_DEV_PROFILE_CFG_CMDID
19680163b031SMaya Erez  *
19690163b031SMaya Erez  * Power save profile to be used by the device
19700163b031SMaya Erez  *
19710163b031SMaya Erez  * Returned event:
19720163b031SMaya Erez  * - WMI_PS_DEV_PROFILE_CFG_EVENTID
19730163b031SMaya Erez  */
19740163b031SMaya Erez struct wmi_ps_dev_profile_cfg_cmd {
19750163b031SMaya Erez 	/* wmi_ps_profile_type_e */
19760163b031SMaya Erez 	u8 ps_profile;
19770163b031SMaya Erez 	u8 reserved[3];
19780163b031SMaya Erez } __packed;
19790163b031SMaya Erez 
19800163b031SMaya Erez /* WMI_PS_DEV_PROFILE_CFG_EVENTID */
19810163b031SMaya Erez struct wmi_ps_dev_profile_cfg_event {
19820163b031SMaya Erez 	/* wmi_ps_cfg_cmd_status_e */
19830163b031SMaya Erez 	__le32 status;
19840163b031SMaya Erez } __packed;
19850163b031SMaya Erez 
19860163b031SMaya Erez enum wmi_ps_level {
19870163b031SMaya Erez 	WMI_PS_LEVEL_DEEP_SLEEP		= 0x00,
19880163b031SMaya Erez 	WMI_PS_LEVEL_SHALLOW_SLEEP	= 0x01,
19890163b031SMaya Erez 	/* awake = all PS mechanisms are disabled */
19900163b031SMaya Erez 	WMI_PS_LEVEL_AWAKE		= 0x02,
19910163b031SMaya Erez };
19920163b031SMaya Erez 
19930163b031SMaya Erez enum wmi_ps_deep_sleep_clk_level {
19940163b031SMaya Erez 	/* 33k */
19950163b031SMaya Erez 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_RTC		= 0x00,
19960163b031SMaya Erez 	/* 10k */
19970163b031SMaya Erez 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_OSC		= 0x01,
19980163b031SMaya Erez 	/* @RTC Low latency */
19990163b031SMaya Erez 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_RTC_LT	= 0x02,
20000163b031SMaya Erez 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_XTAL	= 0x03,
20010163b031SMaya Erez 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_SYSCLK	= 0x04,
20020163b031SMaya Erez 	/* Not Applicable */
20030163b031SMaya Erez 	WMI_PS_DEEP_SLEEP_CLK_LEVEL_N_A		= 0xFF,
20040163b031SMaya Erez };
20050163b031SMaya Erez 
20060163b031SMaya Erez /* Response by the FW to a D3 entry request */
20070163b031SMaya Erez enum wmi_ps_d3_resp_policy {
20080163b031SMaya Erez 	WMI_PS_D3_RESP_POLICY_DEFAULT	= 0x00,
20090163b031SMaya Erez 	/* debug -D3 req is always denied */
20100163b031SMaya Erez 	WMI_PS_D3_RESP_POLICY_DENIED	= 0x01,
20110163b031SMaya Erez 	/* debug -D3 req is always approved */
20120163b031SMaya Erez 	WMI_PS_D3_RESP_POLICY_APPROVED	= 0x02,
20130163b031SMaya Erez };
20140163b031SMaya Erez 
20150163b031SMaya Erez /* Device common power save configurations */
20160163b031SMaya Erez struct wmi_ps_dev_cfg {
20170163b031SMaya Erez 	/* lowest level of PS allowed while unassociated, enum wmi_ps_level_e
20180163b031SMaya Erez 	 */
20190163b031SMaya Erez 	u8 ps_unassoc_min_level;
20200163b031SMaya Erez 	/* lowest deep sleep clock level while nonassoc, enum
20210163b031SMaya Erez 	 * wmi_ps_deep_sleep_clk_level_e
20220163b031SMaya Erez 	 */
20230163b031SMaya Erez 	u8 ps_unassoc_deep_sleep_min_level;
20240163b031SMaya Erez 	/* lowest level of PS allowed while associated, enum wmi_ps_level_e */
20250163b031SMaya Erez 	u8 ps_assoc_min_level;
20260163b031SMaya Erez 	/* lowest deep sleep clock level while assoc, enum
20270163b031SMaya Erez 	 * wmi_ps_deep_sleep_clk_level_e
20280163b031SMaya Erez 	 */
20290163b031SMaya Erez 	u8 ps_assoc_deep_sleep_min_level;
20300163b031SMaya Erez 	/* enum wmi_ps_deep_sleep_clk_level_e */
20310163b031SMaya Erez 	u8 ps_assoc_low_latency_ds_min_level;
20320163b031SMaya Erez 	/* enum wmi_ps_d3_resp_policy_e */
20330163b031SMaya Erez 	u8 ps_D3_response_policy;
20340163b031SMaya Erez 	/* BOOL */
20350163b031SMaya Erez 	u8 ps_D3_pm_pme_enabled;
20360163b031SMaya Erez 	/* BOOL */
20370163b031SMaya Erez 	u8 ps_halp_enable;
20380163b031SMaya Erez 	u8 ps_deep_sleep_enter_thresh_msec;
20390163b031SMaya Erez 	/* BOOL */
20400163b031SMaya Erez 	u8 ps_voltage_scaling_en;
20410163b031SMaya Erez } __packed;
20420163b031SMaya Erez 
20430163b031SMaya Erez /* WMI_PS_DEV_CFG_CMDID
20440163b031SMaya Erez  *
20450163b031SMaya Erez  * Configure common Power Save parameters of the device and all MIDs.
20460163b031SMaya Erez  *
20470163b031SMaya Erez  * Returned event:
20480163b031SMaya Erez  * - WMI_PS_DEV_CFG_EVENTID
20490163b031SMaya Erez  */
20500163b031SMaya Erez struct wmi_ps_dev_cfg_cmd {
20510163b031SMaya Erez 	/* Device Power Save configuration to be applied */
20520163b031SMaya Erez 	struct wmi_ps_dev_cfg ps_dev_cfg;
20530163b031SMaya Erez 	/* alignment to 32b */
20540163b031SMaya Erez 	u8 reserved[2];
20550163b031SMaya Erez } __packed;
20560163b031SMaya Erez 
20570163b031SMaya Erez /* WMI_PS_DEV_CFG_EVENTID */
20580163b031SMaya Erez struct wmi_ps_dev_cfg_event {
20590163b031SMaya Erez 	/* wmi_ps_cfg_cmd_status_e */
20600163b031SMaya Erez 	__le32 status;
20610163b031SMaya Erez } __packed;
20620163b031SMaya Erez 
20630163b031SMaya Erez /* WMI_PS_DEV_CFG_READ_CMDID
20640163b031SMaya Erez  *
20650163b031SMaya Erez  * request to retrieve  device Power Save configuration
20660163b031SMaya Erez  * (WMI_PS_DEV_CFG_CMD params)
20670163b031SMaya Erez  *
20680163b031SMaya Erez  * Returned event:
20690163b031SMaya Erez  * - WMI_PS_DEV_CFG_READ_EVENTID
20700163b031SMaya Erez  */
20710163b031SMaya Erez struct wmi_ps_dev_cfg_read_cmd {
20720163b031SMaya Erez 	__le32 reserved;
20730163b031SMaya Erez } __packed;
20740163b031SMaya Erez 
20750163b031SMaya Erez /* WMI_PS_DEV_CFG_READ_EVENTID */
20760163b031SMaya Erez struct wmi_ps_dev_cfg_read_event {
20770163b031SMaya Erez 	/* wmi_ps_cfg_cmd_status_e */
20780163b031SMaya Erez 	__le32 status;
20790163b031SMaya Erez 	/* Retrieved device Power Save configuration (WMI_PS_DEV_CFG_CMD
20800163b031SMaya Erez 	 * params)
20810163b031SMaya Erez 	 */
20820163b031SMaya Erez 	struct wmi_ps_dev_cfg dev_ps_cfg;
20830163b031SMaya Erez 	/* alignment to 32b */
20840163b031SMaya Erez 	u8 reserved[2];
20850163b031SMaya Erez } __packed;
20860163b031SMaya Erez 
20870163b031SMaya Erez /* Per Mac Power Save configurations */
20880163b031SMaya Erez struct wmi_ps_mid_cfg {
20890163b031SMaya Erez 	/* Low power RX in BTI is enabled, BOOL */
20900163b031SMaya Erez 	u8 beacon_lprx_enable;
20910163b031SMaya Erez 	/* Sync to sector ID enabled, BOOL */
20920163b031SMaya Erez 	u8 beacon_sync_to_sectorId_enable;
20930163b031SMaya Erez 	/* Low power RX in DTI is enabled, BOOL */
20940163b031SMaya Erez 	u8 frame_exchange_lprx_enable;
20950163b031SMaya Erez 	/* Sleep Cycle while in scheduled PS, 1-31 */
20960163b031SMaya Erez 	u8 scheduled_sleep_cycle_pow2;
20970163b031SMaya Erez 	/* Stay Awake for k BIs every (sleep_cycle - k) BIs, 1-31 */
20980163b031SMaya Erez 	u8 scheduled_num_of_awake_bis;
20990163b031SMaya Erez 	u8 am_to_traffic_load_thresh_mbp;
21000163b031SMaya Erez 	u8 traffic_to_am_load_thresh_mbps;
21010163b031SMaya Erez 	u8 traffic_to_am_num_of_no_traffic_bis;
21020163b031SMaya Erez 	/* BOOL */
21030163b031SMaya Erez 	u8 continuous_traffic_psm;
21040163b031SMaya Erez 	__le16 no_traffic_to_min_usec;
21050163b031SMaya Erez 	__le16 no_traffic_to_max_usec;
21060163b031SMaya Erez 	__le16 snoozing_sleep_interval_milisec;
21070163b031SMaya Erez 	u8 max_no_data_awake_events;
21080163b031SMaya Erez 	/* Trigger WEB after k failed beacons */
21090163b031SMaya Erez 	u8 num_of_failed_beacons_rx_to_trigger_web;
21100163b031SMaya Erez 	/* Trigger BF after k failed beacons */
21110163b031SMaya Erez 	u8 num_of_failed_beacons_rx_to_trigger_bf;
21120163b031SMaya Erez 	/* Trigger SOB after k successful beacons */
21130163b031SMaya Erez 	u8 num_of_successful_beacons_rx_to_trigger_sob;
21140163b031SMaya Erez } __packed;
21150163b031SMaya Erez 
21160163b031SMaya Erez /* WMI_PS_MID_CFG_CMDID
21170163b031SMaya Erez  *
21180163b031SMaya Erez  * Configure Power Save parameters of a specific MID.
21190163b031SMaya Erez  * These parameters are relevant for the specific BSS this MID belongs to.
21200163b031SMaya Erez  *
21210163b031SMaya Erez  * Returned event:
21220163b031SMaya Erez  * - WMI_PS_MID_CFG_EVENTID
21230163b031SMaya Erez  */
21240163b031SMaya Erez struct wmi_ps_mid_cfg_cmd {
21250163b031SMaya Erez 	/* MAC ID */
21260163b031SMaya Erez 	u8 mid;
21270163b031SMaya Erez 	/* mid PS configuration to be applied */
21280163b031SMaya Erez 	struct wmi_ps_mid_cfg ps_mid_cfg;
21290163b031SMaya Erez } __packed;
21300163b031SMaya Erez 
21310163b031SMaya Erez /* WMI_PS_MID_CFG_EVENTID */
21320163b031SMaya Erez struct wmi_ps_mid_cfg_event {
21330163b031SMaya Erez 	/* MAC ID */
21340163b031SMaya Erez 	u8 mid;
21350163b031SMaya Erez 	/* alignment to 32b */
21360163b031SMaya Erez 	u8 reserved[3];
21370163b031SMaya Erez 	/* wmi_ps_cfg_cmd_status_e */
21380163b031SMaya Erez 	__le32 status;
21390163b031SMaya Erez } __packed;
21400163b031SMaya Erez 
21410163b031SMaya Erez /* WMI_PS_MID_CFG_READ_CMDID
21420163b031SMaya Erez  *
21430163b031SMaya Erez  * request to retrieve Power Save configuration of mid
21440163b031SMaya Erez  * (WMI_PS_MID_CFG_CMD params)
21450163b031SMaya Erez  *
21460163b031SMaya Erez  * Returned event:
21470163b031SMaya Erez  * - WMI_PS_MID_CFG_READ_EVENTID
21480163b031SMaya Erez  */
21490163b031SMaya Erez struct wmi_ps_mid_cfg_read_cmd {
21500163b031SMaya Erez 	/* MAC ID */
21510163b031SMaya Erez 	u8 mid;
21520163b031SMaya Erez 	/* alignment to 32b */
21530163b031SMaya Erez 	u8 reserved[3];
21540163b031SMaya Erez } __packed;
21550163b031SMaya Erez 
21560163b031SMaya Erez /* WMI_PS_MID_CFG_READ_EVENTID */
21570163b031SMaya Erez struct wmi_ps_mid_cfg_read_event {
21580163b031SMaya Erez 	/* MAC ID */
21590163b031SMaya Erez 	u8 mid;
21600163b031SMaya Erez 	/* Retrieved MID Power Save configuration(WMI_PS_MID_CFG_CMD params) */
21610163b031SMaya Erez 	struct wmi_ps_mid_cfg mid_ps_cfg;
21620163b031SMaya Erez 	/* wmi_ps_cfg_cmd_status_e */
21630163b031SMaya Erez 	__le32 status;
21640163b031SMaya Erez } __packed;
21650163b031SMaya Erez 
216608989f96SLior David #define WMI_AOA_MAX_DATA_SIZE	(128)
216708989f96SLior David 
216808989f96SLior David enum wmi_aoa_meas_status {
216908989f96SLior David 	WMI_AOA_MEAS_SUCCESS		= 0x00,
217008989f96SLior David 	WMI_AOA_MEAS_PEER_INCAPABLE	= 0x01,
217108989f96SLior David 	WMI_AOA_MEAS_FAILURE		= 0x02,
217208989f96SLior David };
217308989f96SLior David 
217408989f96SLior David /* WMI_AOA_MEAS_EVENTID */
217508989f96SLior David struct wmi_aoa_meas_event {
217608989f96SLior David 	u8 mac_addr[WMI_MAC_LEN];
217708989f96SLior David 	/* channels IDs:
217808989f96SLior David 	 * 0 - 58320 MHz
217908989f96SLior David 	 * 1 - 60480 MHz
218008989f96SLior David 	 * 2 - 62640 MHz
218108989f96SLior David 	 */
218208989f96SLior David 	u8 channel;
218308989f96SLior David 	/* enum wmi_aoa_meas_type */
218408989f96SLior David 	u8 aoa_meas_type;
218508989f96SLior David 	/* Measurments are from RFs, defined by the mask */
218608989f96SLior David 	__le32 meas_rf_mask;
218708989f96SLior David 	/* enum wmi_aoa_meas_status */
218808989f96SLior David 	u8 meas_status;
218908989f96SLior David 	u8 reserved;
219008989f96SLior David 	/* Length of meas_data in bytes */
219108989f96SLior David 	__le16 length;
219208989f96SLior David 	u8 meas_data[WMI_AOA_MAX_DATA_SIZE];
219308989f96SLior David } __packed;
219408989f96SLior David 
2195cbf795c1SLior David /* WMI_SET_MGMT_RETRY_LIMIT_EVENTID */
2196cbf795c1SLior David struct wmi_set_mgmt_retry_limit_event {
2197cbf795c1SLior David 	/* enum wmi_fw_status */
2198cbf795c1SLior David 	u8 status;
2199cbf795c1SLior David 	/* alignment to 32b */
2200cbf795c1SLior David 	u8 reserved[3];
2201cbf795c1SLior David } __packed;
2202cbf795c1SLior David 
2203cbf795c1SLior David /* WMI_GET_MGMT_RETRY_LIMIT_EVENTID */
2204cbf795c1SLior David struct wmi_get_mgmt_retry_limit_event {
2205cbf795c1SLior David 	/* MAC retransmit limit for mgmt frames */
2206cbf795c1SLior David 	u8 mgmt_retry_limit;
2207cbf795c1SLior David 	/* alignment to 32b */
2208cbf795c1SLior David 	u8 reserved[3];
2209cbf795c1SLior David } __packed;
2210cbf795c1SLior David 
221108989f96SLior David /* WMI_TOF_GET_CAPABILITIES_EVENTID */
221208989f96SLior David struct wmi_tof_get_capabilities_event {
221308989f96SLior David 	u8 ftm_capability;
221408989f96SLior David 	/* maximum supported number of destination to start TOF */
221508989f96SLior David 	u8 max_num_of_dest;
221608989f96SLior David 	/* maximum supported number of measurements per burst */
221708989f96SLior David 	u8 max_num_of_meas_per_burst;
221808989f96SLior David 	u8 reserved;
221908989f96SLior David 	/* maximum supported multi bursts */
222008989f96SLior David 	__le16 max_multi_bursts_sessions;
222108989f96SLior David 	/* maximum supported FTM burst duration , wmi_tof_burst_duration_e */
222208989f96SLior David 	__le16 max_ftm_burst_duration;
222308989f96SLior David 	/* AOA supported types */
222408989f96SLior David 	__le32 aoa_supported_types;
222508989f96SLior David } __packed;
222608989f96SLior David 
2227*90ffabb0SDedy Lansky /* WMI_SET_THERMAL_THROTTLING_CFG_EVENTID */
2228*90ffabb0SDedy Lansky struct wmi_set_thermal_throttling_cfg_event {
2229*90ffabb0SDedy Lansky 	/* wmi_fw_status */
2230*90ffabb0SDedy Lansky 	u8 status;
2231*90ffabb0SDedy Lansky 	u8 reserved[3];
2232*90ffabb0SDedy Lansky } __packed;
2233*90ffabb0SDedy Lansky 
2234*90ffabb0SDedy Lansky /* WMI_GET_THERMAL_THROTTLING_CFG_EVENTID */
2235*90ffabb0SDedy Lansky struct wmi_get_thermal_throttling_cfg_event {
2236*90ffabb0SDedy Lansky 	/* Status data */
2237*90ffabb0SDedy Lansky 	struct wmi_tt_data tt_data;
2238*90ffabb0SDedy Lansky } __packed;
2239*90ffabb0SDedy Lansky 
224008989f96SLior David enum wmi_tof_session_end_status {
224108989f96SLior David 	WMI_TOF_SESSION_END_NO_ERROR		= 0x00,
224208989f96SLior David 	WMI_TOF_SESSION_END_FAIL		= 0x01,
224308989f96SLior David 	WMI_TOF_SESSION_END_PARAMS_ERROR	= 0x02,
224408989f96SLior David 	WMI_TOF_SESSION_END_ABORTED		= 0x03,
224508989f96SLior David };
224608989f96SLior David 
224708989f96SLior David /* WMI_TOF_SESSION_END_EVENTID */
224808989f96SLior David struct wmi_tof_session_end_event {
224908989f96SLior David 	/* FTM session ID */
225008989f96SLior David 	__le32 session_id;
225108989f96SLior David 	/* wmi_tof_session_end_status_e */
225208989f96SLior David 	u8 status;
225308989f96SLior David 	u8 reserved[3];
225408989f96SLior David } __packed;
225508989f96SLior David 
225608989f96SLior David /* Responder FTM Results */
225708989f96SLior David struct wmi_responder_ftm_res {
225808989f96SLior David 	u8 t1[6];
225908989f96SLior David 	u8 t2[6];
226008989f96SLior David 	u8 t3[6];
226108989f96SLior David 	u8 t4[6];
226208989f96SLior David 	__le16 tod_err;
226308989f96SLior David 	__le16 toa_err;
226408989f96SLior David 	__le16 tod_err_initiator;
226508989f96SLior David 	__le16 toa_err_initiator;
226608989f96SLior David } __packed;
226708989f96SLior David 
226808989f96SLior David enum wmi_tof_ftm_per_dest_res_status {
226908989f96SLior David 	WMI_PER_DEST_RES_NO_ERROR		= 0x00,
227008989f96SLior David 	WMI_PER_DEST_RES_TX_RX_FAIL		= 0x01,
227108989f96SLior David 	WMI_PER_DEST_RES_PARAM_DONT_MATCH	= 0x02,
227208989f96SLior David };
227308989f96SLior David 
227408989f96SLior David enum wmi_tof_ftm_per_dest_res_flags {
227508989f96SLior David 	WMI_PER_DEST_RES_REQ_START		= 0x01,
227608989f96SLior David 	WMI_PER_DEST_RES_BURST_REPORT_END	= 0x02,
227708989f96SLior David 	WMI_PER_DEST_RES_REQ_END		= 0x04,
227808989f96SLior David 	WMI_PER_DEST_RES_PARAM_UPDATE		= 0x08,
227908989f96SLior David };
228008989f96SLior David 
228108989f96SLior David /* WMI_TOF_FTM_PER_DEST_RES_EVENTID */
228208989f96SLior David struct wmi_tof_ftm_per_dest_res_event {
228308989f96SLior David 	/* FTM session ID */
228408989f96SLior David 	__le32 session_id;
228508989f96SLior David 	/* destination MAC address */
228608989f96SLior David 	u8 dst_mac[WMI_MAC_LEN];
228708989f96SLior David 	/* wmi_tof_ftm_per_dest_res_flags_e */
228808989f96SLior David 	u8 flags;
228908989f96SLior David 	/* wmi_tof_ftm_per_dest_res_status_e */
229008989f96SLior David 	u8 status;
229108989f96SLior David 	/* responder ASAP */
229208989f96SLior David 	u8 responder_asap;
229308989f96SLior David 	/* responder number of FTM per burst */
229408989f96SLior David 	u8 responder_num_ftm_per_burst;
229508989f96SLior David 	/* responder number of FTM burst exponent */
229608989f96SLior David 	u8 responder_num_ftm_bursts_exp;
229708989f96SLior David 	/* responder burst duration ,wmi_tof_burst_duration_e */
229808989f96SLior David 	u8 responder_burst_duration;
229908989f96SLior David 	/* responder burst period, indicate interval between two consecutive
230008989f96SLior David 	 * burst instances, in units of 100 ms
230108989f96SLior David 	 */
230208989f96SLior David 	__le16 responder_burst_period;
230308989f96SLior David 	/* receive burst counter */
230408989f96SLior David 	__le16 bursts_cnt;
230508989f96SLior David 	/* tsf of responder start burst */
230608989f96SLior David 	__le32 tsf_sync;
230708989f96SLior David 	/* actual received ftm per burst */
230808989f96SLior David 	u8 actual_ftm_per_burst;
230908989f96SLior David 	u8 reserved0[7];
231008989f96SLior David 	struct wmi_responder_ftm_res responder_ftm_res[0];
231108989f96SLior David } __packed;
231208989f96SLior David 
231308989f96SLior David enum wmi_tof_channel_info_type {
231408989f96SLior David 	WMI_TOF_CHANNEL_INFO_AOA		= 0x00,
231508989f96SLior David 	WMI_TOF_CHANNEL_INFO_LCI		= 0x01,
231608989f96SLior David 	WMI_TOF_CHANNEL_INFO_LCR		= 0x02,
231708989f96SLior David 	WMI_TOF_CHANNEL_INFO_VENDOR_SPECIFIC	= 0x03,
231808989f96SLior David 	WMI_TOF_CHANNEL_INFO_CIR		= 0x04,
231908989f96SLior David 	WMI_TOF_CHANNEL_INFO_RSSI		= 0x05,
232008989f96SLior David 	WMI_TOF_CHANNEL_INFO_SNR		= 0x06,
232108989f96SLior David 	WMI_TOF_CHANNEL_INFO_DEBUG		= 0x07,
232208989f96SLior David };
232308989f96SLior David 
232408989f96SLior David /* WMI_TOF_CHANNEL_INFO_EVENTID */
232508989f96SLior David struct wmi_tof_channel_info_event {
232608989f96SLior David 	/* FTM session ID */
232708989f96SLior David 	__le32 session_id;
232808989f96SLior David 	/* destination MAC address */
232908989f96SLior David 	u8 dst_mac[WMI_MAC_LEN];
233008989f96SLior David 	/* wmi_tof_channel_info_type_e */
233108989f96SLior David 	u8 type;
233208989f96SLior David 	/* data report length */
233308989f96SLior David 	u8 len;
233408989f96SLior David 	/* data report payload */
233508989f96SLior David 	u8 report[0];
233608989f96SLior David } __packed;
233708989f96SLior David 
23388ae5d62cSLior David /* WMI_TOF_SET_TX_RX_OFFSET_EVENTID */
23398ae5d62cSLior David struct wmi_tof_set_tx_rx_offset_event {
23408ae5d62cSLior David 	/* enum wmi_fw_status */
23418ae5d62cSLior David 	u8 status;
23428ae5d62cSLior David 	u8 reserved[3];
23438ae5d62cSLior David } __packed;
23448ae5d62cSLior David 
23458ae5d62cSLior David /* WMI_TOF_GET_TX_RX_OFFSET_EVENTID */
23468ae5d62cSLior David struct wmi_tof_get_tx_rx_offset_event {
23478ae5d62cSLior David 	/* enum wmi_fw_status */
23488ae5d62cSLior David 	u8 status;
23498ae5d62cSLior David 	u8 reserved1[3];
23508ae5d62cSLior David 	/* TX delay offset */
23518ae5d62cSLior David 	__le32 tx_offset;
23528ae5d62cSLior David 	/* RX delay offset */
23538ae5d62cSLior David 	__le32 rx_offset;
23548ae5d62cSLior David 	__le32 reserved2[2];
23558ae5d62cSLior David } __packed;
23568ae5d62cSLior David 
2357cbf795c1SLior David /* Result status codes for WMI commands */
2358cbf795c1SLior David enum wmi_rf_sector_status {
2359cbf795c1SLior David 	WMI_RF_SECTOR_STATUS_SUCCESS			= 0x00,
2360cbf795c1SLior David 	WMI_RF_SECTOR_STATUS_BAD_PARAMETERS_ERROR	= 0x01,
2361cbf795c1SLior David 	WMI_RF_SECTOR_STATUS_BUSY_ERROR			= 0x02,
2362cbf795c1SLior David 	WMI_RF_SECTOR_STATUS_NOT_SUPPORTED_ERROR	= 0x03,
2363cbf795c1SLior David };
2364cbf795c1SLior David 
2365cbf795c1SLior David /* Types of the RF sector (TX,RX) */
2366cbf795c1SLior David enum wmi_rf_sector_type {
2367cbf795c1SLior David 	WMI_RF_SECTOR_TYPE_RX	= 0x00,
2368cbf795c1SLior David 	WMI_RF_SECTOR_TYPE_TX	= 0x01,
2369cbf795c1SLior David };
2370cbf795c1SLior David 
2371cbf795c1SLior David /* Content of RF Sector (six 32-bits registers) */
2372cbf795c1SLior David struct wmi_rf_sector_info {
2373cbf795c1SLior David 	/* Phase values for RF Chains[15-0] (2bits per RF chain) */
2374cbf795c1SLior David 	__le32 psh_hi;
2375cbf795c1SLior David 	/* Phase values for RF Chains[31-16] (2bits per RF chain) */
2376cbf795c1SLior David 	__le32 psh_lo;
2377cbf795c1SLior David 	/* ETYPE Bit0 for all RF chains[31-0] - bit0 of Edge amplifier gain
2378cbf795c1SLior David 	 * index
2379cbf795c1SLior David 	 */
2380cbf795c1SLior David 	__le32 etype0;
2381cbf795c1SLior David 	/* ETYPE Bit1 for all RF chains[31-0] - bit1 of Edge amplifier gain
2382cbf795c1SLior David 	 * index
2383cbf795c1SLior David 	 */
2384cbf795c1SLior David 	__le32 etype1;
2385cbf795c1SLior David 	/* ETYPE Bit2 for all RF chains[31-0] - bit2 of Edge amplifier gain
2386cbf795c1SLior David 	 * index
2387cbf795c1SLior David 	 */
2388cbf795c1SLior David 	__le32 etype2;
2389cbf795c1SLior David 	/* D-Type values (3bits each) for 8 Distribution amplifiers + X16
2390cbf795c1SLior David 	 * switch bits
2391cbf795c1SLior David 	 */
2392cbf795c1SLior David 	__le32 dtype_swch_off;
2393cbf795c1SLior David } __packed;
2394cbf795c1SLior David 
2395cbf795c1SLior David #define WMI_INVALID_RF_SECTOR_INDEX	(0xFFFF)
2396cbf795c1SLior David #define WMI_MAX_RF_MODULES_NUM		(8)
2397cbf795c1SLior David 
2398cbf795c1SLior David /* WMI_GET_RF_SECTOR_PARAMS_CMD */
2399cbf795c1SLior David struct wmi_get_rf_sector_params_cmd {
2400cbf795c1SLior David 	/* Sector number to be retrieved */
2401cbf795c1SLior David 	__le16 sector_idx;
2402cbf795c1SLior David 	/* enum wmi_rf_sector_type - type of requested RF sector */
2403cbf795c1SLior David 	u8 sector_type;
2404cbf795c1SLior David 	/* bitmask vector specifying destination RF modules */
2405cbf795c1SLior David 	u8 rf_modules_vec;
2406cbf795c1SLior David } __packed;
2407cbf795c1SLior David 
2408cbf795c1SLior David /* \WMI_GET_RF_SECTOR_PARAMS_DONE_EVENT */
2409cbf795c1SLior David struct wmi_get_rf_sector_params_done_event {
2410cbf795c1SLior David 	/* result status of WMI_GET_RF_SECTOR_PARAMS_CMD (enum
2411cbf795c1SLior David 	 * wmi_rf_sector_status)
2412cbf795c1SLior David 	 */
2413cbf795c1SLior David 	u8 status;
2414cbf795c1SLior David 	/* align next field to U64 boundary */
2415cbf795c1SLior David 	u8 reserved[7];
2416cbf795c1SLior David 	/* TSF timestamp when RF sectors where retrieved */
2417cbf795c1SLior David 	__le64 tsf;
2418cbf795c1SLior David 	/* Content of RF sector retrieved from each RF module */
2419cbf795c1SLior David 	struct wmi_rf_sector_info sectors_info[WMI_MAX_RF_MODULES_NUM];
2420cbf795c1SLior David } __packed;
2421cbf795c1SLior David 
2422cbf795c1SLior David /* WMI_SET_RF_SECTOR_PARAMS_CMD */
2423cbf795c1SLior David struct wmi_set_rf_sector_params_cmd {
2424cbf795c1SLior David 	/* Sector number to be retrieved */
2425cbf795c1SLior David 	__le16 sector_idx;
2426cbf795c1SLior David 	/* enum wmi_rf_sector_type - type of requested RF sector */
2427cbf795c1SLior David 	u8 sector_type;
2428cbf795c1SLior David 	/* bitmask vector specifying destination RF modules */
2429cbf795c1SLior David 	u8 rf_modules_vec;
2430cbf795c1SLior David 	/* Content of RF sector to be written to each RF module */
2431cbf795c1SLior David 	struct wmi_rf_sector_info sectors_info[WMI_MAX_RF_MODULES_NUM];
2432cbf795c1SLior David } __packed;
2433cbf795c1SLior David 
2434cbf795c1SLior David /* \WMI_SET_RF_SECTOR_PARAMS_DONE_EVENT */
2435cbf795c1SLior David struct wmi_set_rf_sector_params_done_event {
2436cbf795c1SLior David 	/* result status of WMI_SET_RF_SECTOR_PARAMS_CMD (enum
2437cbf795c1SLior David 	 * wmi_rf_sector_status)
2438cbf795c1SLior David 	 */
2439cbf795c1SLior David 	u8 status;
2440cbf795c1SLior David } __packed;
2441cbf795c1SLior David 
2442cbf795c1SLior David /* WMI_GET_SELECTED_RF_SECTOR_INDEX_CMD - Get RF sector index selected by
2443cbf795c1SLior David  * TXSS/BRP for communication with specified CID
2444cbf795c1SLior David  */
2445cbf795c1SLior David struct wmi_get_selected_rf_sector_index_cmd {
2446cbf795c1SLior David 	/* Connection/Station ID in [0:7] range */
2447cbf795c1SLior David 	u8 cid;
2448cbf795c1SLior David 	/* type of requested RF sector (enum wmi_rf_sector_type) */
2449cbf795c1SLior David 	u8 sector_type;
2450cbf795c1SLior David 	/* align to U32 boundary */
2451cbf795c1SLior David 	u8 reserved[2];
2452cbf795c1SLior David } __packed;
2453cbf795c1SLior David 
2454cbf795c1SLior David /* \WMI_GET_SELECTED_RF_SECTOR_INDEX_DONE_EVENT - Returns retrieved RF sector
2455cbf795c1SLior David  * index selected by TXSS/BRP for communication with specified CID
2456cbf795c1SLior David  */
2457cbf795c1SLior David struct wmi_get_selected_rf_sector_index_done_event {
2458cbf795c1SLior David 	/* Retrieved sector index selected in TXSS (for TX sector request) or
2459cbf795c1SLior David 	 * BRP (for RX sector request)
2460cbf795c1SLior David 	 */
2461cbf795c1SLior David 	__le16 sector_idx;
2462cbf795c1SLior David 	/* result status of WMI_GET_SELECTED_RF_SECTOR_INDEX_CMD (enum
2463cbf795c1SLior David 	 * wmi_rf_sector_status)
2464cbf795c1SLior David 	 */
2465cbf795c1SLior David 	u8 status;
2466cbf795c1SLior David 	/* align next field to U64 boundary */
2467cbf795c1SLior David 	u8 reserved[5];
2468cbf795c1SLior David 	/* TSF timestamp when result was retrieved */
2469cbf795c1SLior David 	__le64 tsf;
2470cbf795c1SLior David } __packed;
2471cbf795c1SLior David 
2472cbf795c1SLior David /* WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD - Force RF sector index for
2473cbf795c1SLior David  * communication with specified CID. Assumes that TXSS/BRP is disabled by
2474cbf795c1SLior David  * other command
2475cbf795c1SLior David  */
2476cbf795c1SLior David struct wmi_set_selected_rf_sector_index_cmd {
2477cbf795c1SLior David 	/* Connection/Station ID in [0:7] range */
2478cbf795c1SLior David 	u8 cid;
2479cbf795c1SLior David 	/* type of requested RF sector (enum wmi_rf_sector_type) */
2480cbf795c1SLior David 	u8 sector_type;
2481cbf795c1SLior David 	/* Forced sector index */
2482cbf795c1SLior David 	__le16 sector_idx;
2483cbf795c1SLior David } __packed;
2484cbf795c1SLior David 
2485cbf795c1SLior David /* \WMI_SET_SELECTED_RF_SECTOR_INDEX_DONE_EVENT - Success/Fail status for
2486cbf795c1SLior David  * WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD
2487cbf795c1SLior David  */
2488cbf795c1SLior David struct wmi_set_selected_rf_sector_index_done_event {
2489cbf795c1SLior David 	/* result status of WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD (enum
2490cbf795c1SLior David 	 * wmi_rf_sector_status)
2491cbf795c1SLior David 	 */
2492cbf795c1SLior David 	u8 status;
2493cbf795c1SLior David 	/* align to U32 boundary */
2494cbf795c1SLior David 	u8 reserved[3];
2495cbf795c1SLior David } __packed;
2496cbf795c1SLior David 
2497cbf795c1SLior David /* WMI_SET_RF_SECTOR_ON_CMD - Activates specified sector for specified rf
2498cbf795c1SLior David  * modules
2499cbf795c1SLior David  */
2500cbf795c1SLior David struct wmi_set_rf_sector_on_cmd {
2501cbf795c1SLior David 	/* Sector index to be activated */
2502cbf795c1SLior David 	__le16 sector_idx;
2503cbf795c1SLior David 	/* type of requested RF sector (enum wmi_rf_sector_type) */
2504cbf795c1SLior David 	u8 sector_type;
2505cbf795c1SLior David 	/* bitmask vector specifying destination RF modules */
2506cbf795c1SLior David 	u8 rf_modules_vec;
2507cbf795c1SLior David } __packed;
2508cbf795c1SLior David 
2509cbf795c1SLior David /* \WMI_SET_RF_SECTOR_ON_DONE_EVENT - Success/Fail status for
2510cbf795c1SLior David  * WMI_SET_RF_SECTOR_ON_CMD
2511cbf795c1SLior David  */
2512cbf795c1SLior David struct wmi_set_rf_sector_on_done_event {
2513cbf795c1SLior David 	/* result status of WMI_SET_RF_SECTOR_ON_CMD (enum
2514cbf795c1SLior David 	 * wmi_rf_sector_status)
2515cbf795c1SLior David 	 */
2516cbf795c1SLior David 	u8 status;
2517cbf795c1SLior David 	/* align to U32 boundary */
2518cbf795c1SLior David 	u8 reserved[3];
2519cbf795c1SLior David } __packed;
2520cbf795c1SLior David 
25218ae5d62cSLior David enum wmi_sector_sweep_type {
25228ae5d62cSLior David 	WMI_SECTOR_SWEEP_TYPE_TXSS		= 0x00,
25238ae5d62cSLior David 	WMI_SECTOR_SWEEP_TYPE_BCON		= 0x01,
25248ae5d62cSLior David 	WMI_SECTOR_SWEEP_TYPE_TXSS_AND_BCON	= 0x02,
25258ae5d62cSLior David 	WMI_SECTOR_SWEEP_TYPE_NUM		= 0x03,
25268ae5d62cSLior David };
25278ae5d62cSLior David 
25288ae5d62cSLior David /* WMI_PRIO_TX_SECTORS_ORDER_CMDID
25298ae5d62cSLior David  *
25308ae5d62cSLior David  * Set the order of TX sectors in TXSS and/or Beacon(AP).
25318ae5d62cSLior David  *
25328ae5d62cSLior David  * Returned event:
25338ae5d62cSLior David  * - WMI_PRIO_TX_SECTORS_ORDER_EVENTID
25348ae5d62cSLior David  */
25358ae5d62cSLior David struct wmi_prio_tx_sectors_order_cmd {
25368ae5d62cSLior David 	/* tx sectors order to be applied, 0xFF for end of array */
25378ae5d62cSLior David 	u8 tx_sectors_priority_array[MAX_NUM_OF_SECTORS];
25388ae5d62cSLior David 	/* enum wmi_sector_sweep_type, TXSS and/or Beacon */
25398ae5d62cSLior David 	u8 sector_sweep_type;
25408ae5d62cSLior David 	/* needed only for TXSS configuration */
25418ae5d62cSLior David 	u8 cid;
25428ae5d62cSLior David 	/* alignment to 32b */
25438ae5d62cSLior David 	u8 reserved[2];
25448ae5d62cSLior David } __packed;
25458ae5d62cSLior David 
25468ae5d62cSLior David /* completion status codes */
25478ae5d62cSLior David enum wmi_prio_tx_sectors_cmd_status {
25488ae5d62cSLior David 	WMI_PRIO_TX_SECT_CMD_STATUS_SUCCESS	= 0x00,
25498ae5d62cSLior David 	WMI_PRIO_TX_SECT_CMD_STATUS_BAD_PARAM	= 0x01,
25508ae5d62cSLior David 	/* other error */
25518ae5d62cSLior David 	WMI_PRIO_TX_SECT_CMD_STATUS_ERROR	= 0x02,
25528ae5d62cSLior David };
25538ae5d62cSLior David 
25548ae5d62cSLior David /* WMI_PRIO_TX_SECTORS_ORDER_EVENTID */
25558ae5d62cSLior David struct wmi_prio_tx_sectors_order_event {
25568ae5d62cSLior David 	/* enum wmi_prio_tx_sectors_cmd_status */
25578ae5d62cSLior David 	u8 status;
25588ae5d62cSLior David 	/* alignment to 32b */
25598ae5d62cSLior David 	u8 reserved[3];
25608ae5d62cSLior David } __packed;
25618ae5d62cSLior David 
25628ae5d62cSLior David struct wmi_prio_tx_sectors_num_cmd {
25638ae5d62cSLior David 	/* [0-128], 0 = No changes */
25648ae5d62cSLior David 	u8 beacon_number_of_sectors;
25658ae5d62cSLior David 	/* [0-128], 0 = No changes */
25668ae5d62cSLior David 	u8 txss_number_of_sectors;
25678ae5d62cSLior David 	/* [0-8] needed only for TXSS configuration */
25688ae5d62cSLior David 	u8 cid;
25698ae5d62cSLior David } __packed;
25708ae5d62cSLior David 
25718ae5d62cSLior David /* WMI_PRIO_TX_SECTORS_NUMBER_CMDID
25728ae5d62cSLior David  *
25738ae5d62cSLior David  * Set the number of active sectors in TXSS and/or Beacon.
25748ae5d62cSLior David  *
25758ae5d62cSLior David  * Returned event:
25768ae5d62cSLior David  * - WMI_PRIO_TX_SECTORS_NUMBER_EVENTID
25778ae5d62cSLior David  */
25788ae5d62cSLior David struct wmi_prio_tx_sectors_number_cmd {
25798ae5d62cSLior David 	struct wmi_prio_tx_sectors_num_cmd active_sectors_num;
25808ae5d62cSLior David 	/* alignment to 32b */
25818ae5d62cSLior David 	u8 reserved;
25828ae5d62cSLior David } __packed;
25838ae5d62cSLior David 
25848ae5d62cSLior David /* WMI_PRIO_TX_SECTORS_NUMBER_EVENTID */
25858ae5d62cSLior David struct wmi_prio_tx_sectors_number_event {
25868ae5d62cSLior David 	/* enum wmi_prio_tx_sectors_cmd_status */
25878ae5d62cSLior David 	u8 status;
25888ae5d62cSLior David 	/* alignment to 32b */
25898ae5d62cSLior David 	u8 reserved[3];
25908ae5d62cSLior David } __packed;
25918ae5d62cSLior David 
25928ae5d62cSLior David /* WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_CMDID
25938ae5d62cSLior David  *
25948ae5d62cSLior David  * Set default sectors order and number (hard coded in board file)
25958ae5d62cSLior David  * in TXSS and/or Beacon.
25968ae5d62cSLior David  *
25978ae5d62cSLior David  * Returned event:
25988ae5d62cSLior David  * - WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID
25998ae5d62cSLior David  */
26008ae5d62cSLior David struct wmi_prio_tx_sectors_set_default_cfg_cmd {
26018ae5d62cSLior David 	/* enum wmi_sector_sweep_type, TXSS and/or Beacon */
26028ae5d62cSLior David 	u8 sector_sweep_type;
26038ae5d62cSLior David 	/* needed only for TXSS configuration */
26048ae5d62cSLior David 	u8 cid;
26058ae5d62cSLior David 	/* alignment to 32b */
26068ae5d62cSLior David 	u8 reserved[2];
26078ae5d62cSLior David } __packed;
26088ae5d62cSLior David 
26098ae5d62cSLior David /* WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID */
26108ae5d62cSLior David struct wmi_prio_tx_sectors_set_default_cfg_event {
26118ae5d62cSLior David 	/* enum wmi_prio_tx_sectors_cmd_status */
26128ae5d62cSLior David 	u8 status;
26138ae5d62cSLior David 	/* alignment to 32b */
26148ae5d62cSLior David 	u8 reserved[3];
26158ae5d62cSLior David } __packed;
26168ae5d62cSLior David 
26172be7d22fSVladimir Kondratiev #endif /* __WILOCITY_WMI_H__ */
2618