Linux Audio

Check our new training course

Loading...
v4.17
   1/*
 
   2 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
   3 * Copyright (c) 2006-2012 Wilocity
   4 *
   5 * Permission to use, copy, modify, and/or distribute this software for any
   6 * purpose with or without fee is hereby granted, provided that the above
   7 * copyright notice and this permission notice appear in all copies.
   8 *
   9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16 */
  17
  18/*
  19 * This file contains the definitions of the WMI protocol specified in the
  20 * Wireless Module Interface (WMI) for the Qualcomm
  21 * 60 GHz wireless solution.
  22 * It includes definitions of all the commands and events.
  23 * Commands are messages from the host to the WM.
  24 * Events are messages from the WM to the host.
  25 *
  26 * This is an automatically generated file.
  27 */
  28
  29#ifndef __WILOCITY_WMI_H__
  30#define __WILOCITY_WMI_H__
  31
  32/* General */
  33#define WMI_MAX_ASSOC_STA		(8)
  34#define WMI_DEFAULT_ASSOC_STA		(1)
  35#define WMI_MAC_LEN			(6)
  36#define WMI_PROX_RANGE_NUM		(3)
  37#define WMI_MAX_LOSS_DMG_BEACONS	(20)
  38#define MAX_NUM_OF_SECTORS		(128)
 
  39#define WMI_SCHED_MAX_ALLOCS_PER_CMD	(4)
  40#define WMI_RF_DTYPE_LENGTH		(3)
  41#define WMI_RF_ETYPE_LENGTH		(3)
  42#define WMI_RF_RX2TX_LENGTH		(3)
  43#define WMI_RF_ETYPE_VAL_PER_RANGE	(5)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  44
  45/* Mailbox interface
  46 * used for commands and events
  47 */
  48enum wmi_mid {
  49	MID_DEFAULT		= 0x00,
  50	FIRST_DBG_MID_ID	= 0x10,
  51	LAST_DBG_MID_ID		= 0xFE,
  52	MID_BROADCAST		= 0xFF,
  53};
  54
  55/* FW capability IDs
  56 * Each ID maps to a bit in a 32-bit bitmask value provided by the FW to
  57 * the host
  58 */
  59enum wmi_fw_capability {
  60	WMI_FW_CAPABILITY_FTM				= 0,
  61	WMI_FW_CAPABILITY_PS_CONFIG			= 1,
  62	WMI_FW_CAPABILITY_RF_SECTORS			= 2,
  63	WMI_FW_CAPABILITY_MGMT_RETRY_LIMIT		= 3,
  64	WMI_FW_CAPABILITY_DISABLE_AP_SME		= 4,
  65	WMI_FW_CAPABILITY_WMI_ONLY			= 5,
  66	WMI_FW_CAPABILITY_THERMAL_THROTTLING		= 7,
  67	WMI_FW_CAPABILITY_D3_SUSPEND			= 8,
  68	WMI_FW_CAPABILITY_LONG_RANGE			= 9,
  69	WMI_FW_CAPABILITY_FIXED_SCHEDULING		= 10,
  70	WMI_FW_CAPABILITY_MULTI_DIRECTED_OMNIS		= 11,
  71	WMI_FW_CAPABILITY_RSSI_REPORTING		= 12,
  72	WMI_FW_CAPABILITY_SET_SILENT_RSSI_TABLE		= 13,
  73	WMI_FW_CAPABILITY_LO_POWER_CALIB_FROM_OTP	= 14,
  74	WMI_FW_CAPABILITY_PNO				= 15,
 
  75	WMI_FW_CAPABILITY_REF_CLOCK_CONTROL		= 18,
 
 
 
 
 
 
 
 
 
 
 
  76	WMI_FW_CAPABILITY_MAX,
  77};
  78
  79/* WMI_CMD_HDR */
  80struct wmi_cmd_hdr {
  81	u8 mid;
  82	u8 reserved;
  83	__le16 command_id;
  84	__le32 fw_timestamp;
  85} __packed;
  86
  87/* List of Commands */
  88enum wmi_command_id {
  89	WMI_CONNECT_CMDID				= 0x01,
  90	WMI_DISCONNECT_CMDID				= 0x03,
  91	WMI_DISCONNECT_STA_CMDID			= 0x04,
  92	WMI_START_SCHED_SCAN_CMDID			= 0x05,
  93	WMI_STOP_SCHED_SCAN_CMDID			= 0x06,
  94	WMI_START_SCAN_CMDID				= 0x07,
  95	WMI_SET_BSS_FILTER_CMDID			= 0x09,
  96	WMI_SET_PROBED_SSID_CMDID			= 0x0A,
  97	/* deprecated */
  98	WMI_SET_LISTEN_INT_CMDID			= 0x0B,
 
 
 
  99	WMI_BCON_CTRL_CMDID				= 0x0F,
 100	WMI_ADD_CIPHER_KEY_CMDID			= 0x16,
 101	WMI_DELETE_CIPHER_KEY_CMDID			= 0x17,
 102	WMI_PCP_CONF_CMDID				= 0x18,
 103	WMI_SET_APPIE_CMDID				= 0x3F,
 104	WMI_SET_WSC_STATUS_CMDID			= 0x41,
 105	WMI_PXMT_RANGE_CFG_CMDID			= 0x42,
 106	WMI_PXMT_SNR2_RANGE_CFG_CMDID			= 0x43,
 
 
 
 
 
 
 107	WMI_MEM_READ_CMDID				= 0x800,
 108	WMI_MEM_WR_CMDID				= 0x801,
 109	WMI_ECHO_CMDID					= 0x803,
 110	WMI_DEEP_ECHO_CMDID				= 0x804,
 111	WMI_CONFIG_MAC_CMDID				= 0x805,
 112	/* deprecated */
 113	WMI_CONFIG_PHY_DEBUG_CMDID			= 0x806,
 114	WMI_ADD_DEBUG_TX_PCKT_CMDID			= 0x808,
 115	WMI_PHY_GET_STATISTICS_CMDID			= 0x809,
 116	/* deprecated */
 117	WMI_FS_TUNE_CMDID				= 0x80A,
 118	/* deprecated */
 119	WMI_CORR_MEASURE_CMDID				= 0x80B,
 120	WMI_READ_RSSI_CMDID				= 0x80C,
 121	WMI_TEMP_SENSE_CMDID				= 0x80E,
 122	WMI_DC_CALIB_CMDID				= 0x80F,
 123	/* deprecated */
 124	WMI_SEND_TONE_CMDID				= 0x810,
 125	/* deprecated */
 126	WMI_IQ_TX_CALIB_CMDID				= 0x811,
 127	/* deprecated */
 128	WMI_IQ_RX_CALIB_CMDID				= 0x812,
 129	WMI_SET_WORK_MODE_CMDID				= 0x815,
 130	WMI_LO_LEAKAGE_CALIB_CMDID			= 0x816,
 131	WMI_LO_POWER_CALIB_FROM_OTP_CMDID		= 0x817,
 132	WMI_SILENT_RSSI_CALIB_CMDID			= 0x81D,
 133	/* deprecated */
 134	WMI_RF_RX_TEST_CMDID				= 0x81E,
 135	WMI_CFG_RX_CHAIN_CMDID				= 0x820,
 136	WMI_VRING_CFG_CMDID				= 0x821,
 137	WMI_BCAST_VRING_CFG_CMDID			= 0x822,
 138	WMI_VRING_BA_EN_CMDID				= 0x823,
 139	WMI_VRING_BA_DIS_CMDID				= 0x824,
 140	WMI_RCP_ADDBA_RESP_CMDID			= 0x825,
 141	WMI_RCP_DELBA_CMDID				= 0x826,
 142	WMI_SET_SSID_CMDID				= 0x827,
 143	WMI_GET_SSID_CMDID				= 0x828,
 144	WMI_SET_PCP_CHANNEL_CMDID			= 0x829,
 145	WMI_GET_PCP_CHANNEL_CMDID			= 0x82A,
 146	WMI_SW_TX_REQ_CMDID				= 0x82B,
 
 
 
 
 147	WMI_MLME_PUSH_CMDID				= 0x835,
 148	WMI_BEAMFORMING_MGMT_CMDID			= 0x836,
 149	WMI_BF_TXSS_MGMT_CMDID				= 0x837,
 150	WMI_BF_SM_MGMT_CMDID				= 0x838,
 151	WMI_BF_RXSS_MGMT_CMDID				= 0x839,
 152	WMI_BF_TRIG_CMDID				= 0x83A,
 
 153	WMI_LINK_MAINTAIN_CFG_WRITE_CMDID		= 0x842,
 154	WMI_LINK_MAINTAIN_CFG_READ_CMDID		= 0x843,
 155	WMI_SET_SECTORS_CMDID				= 0x849,
 156	WMI_MAINTAIN_PAUSE_CMDID			= 0x850,
 157	WMI_MAINTAIN_RESUME_CMDID			= 0x851,
 158	WMI_RS_MGMT_CMDID				= 0x852,
 159	WMI_RF_MGMT_CMDID				= 0x853,
 160	WMI_RF_XPM_READ_CMDID				= 0x856,
 161	WMI_RF_XPM_WRITE_CMDID				= 0x857,
 162	WMI_LED_CFG_CMDID				= 0x858,
 163	WMI_SET_CONNECT_SNR_THR_CMDID			= 0x85B,
 164	WMI_SET_ACTIVE_SILENT_RSSI_TABLE_CMDID		= 0x85C,
 165	WMI_RF_PWR_ON_DELAY_CMDID			= 0x85D,
 166	WMI_SET_HIGH_POWER_TABLE_PARAMS_CMDID		= 0x85E,
 
 167	/* Performance monitoring commands */
 168	WMI_BF_CTRL_CMDID				= 0x862,
 169	WMI_NOTIFY_REQ_CMDID				= 0x863,
 170	WMI_GET_STATUS_CMDID				= 0x864,
 171	WMI_GET_RF_STATUS_CMDID				= 0x866,
 172	WMI_GET_BASEBAND_TYPE_CMDID			= 0x867,
 
 173	WMI_UNIT_TEST_CMDID				= 0x900,
 174	WMI_FLASH_READ_CMDID				= 0x902,
 175	WMI_FLASH_WRITE_CMDID				= 0x903,
 176	/* Power management */
 177	WMI_TRAFFIC_SUSPEND_CMDID			= 0x904,
 178	WMI_TRAFFIC_RESUME_CMDID			= 0x905,
 179	/* P2P */
 180	WMI_P2P_CFG_CMDID				= 0x910,
 181	WMI_PORT_ALLOCATE_CMDID				= 0x911,
 182	WMI_PORT_DELETE_CMDID				= 0x912,
 183	WMI_POWER_MGMT_CFG_CMDID			= 0x913,
 184	WMI_START_LISTEN_CMDID				= 0x914,
 185	WMI_START_SEARCH_CMDID				= 0x915,
 186	WMI_DISCOVERY_START_CMDID			= 0x916,
 187	WMI_DISCOVERY_STOP_CMDID			= 0x917,
 188	WMI_PCP_START_CMDID				= 0x918,
 189	WMI_PCP_STOP_CMDID				= 0x919,
 190	WMI_GET_PCP_FACTOR_CMDID			= 0x91B,
 191	/* Power Save Configuration Commands */
 192	WMI_PS_DEV_PROFILE_CFG_CMDID			= 0x91C,
 
 
 
 
 193	WMI_RS_CFG_CMDID				= 0x921,
 
 194	WMI_GET_DETAILED_RS_RES_CMDID			= 0x922,
 195	WMI_AOA_MEAS_CMDID				= 0x923,
 196	WMI_BRP_SET_ANT_LIMIT_CMDID			= 0x924,
 197	WMI_SET_MGMT_RETRY_LIMIT_CMDID			= 0x930,
 198	WMI_GET_MGMT_RETRY_LIMIT_CMDID			= 0x931,
 199	WMI_NEW_STA_CMDID				= 0x935,
 200	WMI_DEL_STA_CMDID				= 0x936,
 201	WMI_SET_THERMAL_THROTTLING_CFG_CMDID		= 0x940,
 202	WMI_GET_THERMAL_THROTTLING_CFG_CMDID		= 0x941,
 203	/* Read Power Save profile type */
 204	WMI_PS_DEV_PROFILE_CFG_READ_CMDID		= 0x942,
 
 205	WMI_TOF_SESSION_START_CMDID			= 0x991,
 206	WMI_TOF_GET_CAPABILITIES_CMDID			= 0x992,
 207	WMI_TOF_SET_LCR_CMDID				= 0x993,
 208	WMI_TOF_SET_LCI_CMDID				= 0x994,
 209	WMI_TOF_CFG_RESPONDER_CMDID			= 0x996,
 210	WMI_TOF_SET_TX_RX_OFFSET_CMDID			= 0x997,
 211	WMI_TOF_GET_TX_RX_OFFSET_CMDID			= 0x998,
 212	WMI_TOF_CHANNEL_INFO_CMDID			= 0x999,
 213	WMI_GET_RF_SECTOR_PARAMS_CMDID			= 0x9A0,
 214	WMI_SET_RF_SECTOR_PARAMS_CMDID			= 0x9A1,
 215	WMI_GET_SELECTED_RF_SECTOR_INDEX_CMDID		= 0x9A2,
 216	WMI_SET_SELECTED_RF_SECTOR_INDEX_CMDID		= 0x9A3,
 217	WMI_SET_RF_SECTOR_ON_CMDID			= 0x9A4,
 218	WMI_PRIO_TX_SECTORS_ORDER_CMDID			= 0x9A5,
 219	WMI_PRIO_TX_SECTORS_NUMBER_CMDID		= 0x9A6,
 220	WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_CMDID	= 0x9A7,
 
 
 
 
 
 
 
 
 
 221	WMI_SCHEDULING_SCHEME_CMDID			= 0xA01,
 222	WMI_FIXED_SCHEDULING_CONFIG_CMDID		= 0xA02,
 223	WMI_ENABLE_FIXED_SCHEDULING_CMDID		= 0xA03,
 224	WMI_SET_MULTI_DIRECTED_OMNIS_CONFIG_CMDID	= 0xA04,
 225	WMI_SET_LONG_RANGE_CONFIG_CMDID			= 0xA05,
 
 
 
 
 
 
 
 
 
 
 
 226	WMI_SET_MAC_ADDRESS_CMDID			= 0xF003,
 227	WMI_ABORT_SCAN_CMDID				= 0xF007,
 228	WMI_SET_PROMISCUOUS_MODE_CMDID			= 0xF041,
 229	/* deprecated */
 230	WMI_GET_PMK_CMDID				= 0xF048,
 231	WMI_SET_PASSPHRASE_CMDID			= 0xF049,
 232	/* deprecated */
 233	WMI_SEND_ASSOC_RES_CMDID			= 0xF04A,
 234	/* deprecated */
 235	WMI_SET_ASSOC_REQ_RELAY_CMDID			= 0xF04B,
 236	WMI_MAC_ADDR_REQ_CMDID				= 0xF04D,
 237	WMI_FW_VER_CMDID				= 0xF04E,
 238	WMI_PMC_CMDID					= 0xF04F,
 239};
 240
 241/* WMI_CONNECT_CMDID */
 242enum wmi_network_type {
 243	WMI_NETTYPE_INFRA		= 0x01,
 244	WMI_NETTYPE_ADHOC		= 0x02,
 245	WMI_NETTYPE_ADHOC_CREATOR	= 0x04,
 246	WMI_NETTYPE_AP			= 0x10,
 247	WMI_NETTYPE_P2P			= 0x20,
 248	/* PCIE over 60g */
 249	WMI_NETTYPE_WBE			= 0x40,
 250};
 251
 252enum wmi_dot11_auth_mode {
 253	WMI_AUTH11_OPEN		= 0x01,
 254	WMI_AUTH11_SHARED	= 0x02,
 255	WMI_AUTH11_LEAP		= 0x04,
 256	WMI_AUTH11_WSC		= 0x08,
 257};
 258
 259enum wmi_auth_mode {
 260	WMI_AUTH_NONE		= 0x01,
 261	WMI_AUTH_WPA		= 0x02,
 262	WMI_AUTH_WPA2		= 0x04,
 263	WMI_AUTH_WPA_PSK	= 0x08,
 264	WMI_AUTH_WPA2_PSK	= 0x10,
 265	WMI_AUTH_WPA_CCKM	= 0x20,
 266	WMI_AUTH_WPA2_CCKM	= 0x40,
 267};
 268
 269enum wmi_crypto_type {
 270	WMI_CRYPT_NONE		= 0x01,
 271	WMI_CRYPT_AES_GCMP	= 0x20,
 272};
 273
 274enum wmi_connect_ctrl_flag_bits {
 275	WMI_CONNECT_ASSOC_POLICY_USER		= 0x01,
 276	WMI_CONNECT_SEND_REASSOC		= 0x02,
 277	WMI_CONNECT_IGNORE_WPA_GROUP_CIPHER	= 0x04,
 278	WMI_CONNECT_PROFILE_MATCH_DONE		= 0x08,
 279	WMI_CONNECT_IGNORE_AAC_BEACON		= 0x10,
 280	WMI_CONNECT_CSA_FOLLOW_BSS		= 0x20,
 281	WMI_CONNECT_DO_WPA_OFFLOAD		= 0x40,
 282	WMI_CONNECT_DO_NOT_DEAUTH		= 0x80,
 283};
 284
 285#define WMI_MAX_SSID_LEN	(32)
 286
 
 
 
 
 
 
 
 
 
 
 
 
 
 287/* WMI_CONNECT_CMDID */
 288struct wmi_connect_cmd {
 289	u8 network_type;
 290	u8 dot11_auth_mode;
 291	u8 auth_mode;
 292	u8 pairwise_crypto_type;
 293	u8 pairwise_crypto_len;
 294	u8 group_crypto_type;
 295	u8 group_crypto_len;
 296	u8 ssid_len;
 297	u8 ssid[WMI_MAX_SSID_LEN];
 
 
 
 298	u8 channel;
 299	u8 reserved0;
 
 300	u8 bssid[WMI_MAC_LEN];
 301	__le32 ctrl_flags;
 302	u8 dst_mac[WMI_MAC_LEN];
 303	u8 reserved1[2];
 304} __packed;
 305
 306/* WMI_DISCONNECT_STA_CMDID */
 307struct wmi_disconnect_sta_cmd {
 308	u8 dst_mac[WMI_MAC_LEN];
 309	__le16 disconnect_reason;
 310} __packed;
 311
 312#define WMI_MAX_KEY_INDEX	(3)
 313#define WMI_MAX_KEY_LEN		(32)
 314#define WMI_PASSPHRASE_LEN	(64)
 315
 316/* WMI_SET_PASSPHRASE_CMDID */
 317struct wmi_set_passphrase_cmd {
 318	u8 ssid[WMI_MAX_SSID_LEN];
 319	u8 passphrase[WMI_PASSPHRASE_LEN];
 320	u8 ssid_len;
 321	u8 passphrase_len;
 322} __packed;
 323
 324/* WMI_ADD_CIPHER_KEY_CMDID */
 325enum wmi_key_usage {
 326	WMI_KEY_USE_PAIRWISE	= 0x00,
 327	WMI_KEY_USE_RX_GROUP	= 0x01,
 328	WMI_KEY_USE_TX_GROUP	= 0x02,
 
 
 329};
 330
 331struct wmi_add_cipher_key_cmd {
 332	u8 key_index;
 333	u8 key_type;
 334	/* enum wmi_key_usage */
 335	u8 key_usage;
 336	u8 key_len;
 337	/* key replay sequence counter */
 338	u8 key_rsc[8];
 339	u8 key[WMI_MAX_KEY_LEN];
 340	/* Additional Key Control information */
 341	u8 key_op_ctrl;
 342	u8 mac[WMI_MAC_LEN];
 343} __packed;
 344
 345/* WMI_DELETE_CIPHER_KEY_CMDID */
 346struct wmi_delete_cipher_key_cmd {
 347	u8 key_index;
 348	u8 mac[WMI_MAC_LEN];
 349} __packed;
 350
 351/* WMI_START_SCAN_CMDID
 352 *
 353 * Start L1 scan operation
 354 *
 355 * Returned events:
 356 * - WMI_RX_MGMT_PACKET_EVENTID - for every probe resp.
 357 * - WMI_SCAN_COMPLETE_EVENTID
 358 */
 359enum wmi_scan_type {
 360	WMI_ACTIVE_SCAN		= 0x00,
 361	WMI_SHORT_SCAN		= 0x01,
 362	WMI_PASSIVE_SCAN	= 0x02,
 363	WMI_DIRECT_SCAN		= 0x03,
 364	WMI_LONG_SCAN		= 0x04,
 365};
 366
 367/* WMI_START_SCAN_CMDID */
 368struct wmi_start_scan_cmd {
 369	u8 direct_scan_mac_addr[WMI_MAC_LEN];
 370	/* run scan with discovery beacon. Relevant for ACTIVE scan only. */
 371	u8 discovery_mode;
 372	u8 reserved;
 373	/* Max duration in the home channel(ms) */
 374	__le32 dwell_time;
 375	/* Time interval between scans (ms) */
 376	__le32 force_scan_interval;
 377	/* enum wmi_scan_type */
 378	u8 scan_type;
 379	/* how many channels follow */
 380	u8 num_channels;
 381	/* channels ID's:
 382	 * 0 - 58320 MHz
 383	 * 1 - 60480 MHz
 384	 * 2 - 62640 MHz
 385	 */
 386	struct {
 387		u8 channel;
 388		u8 reserved;
 389	} channel_list[0];
 390} __packed;
 391
 392#define WMI_MAX_PNO_SSID_NUM	(16)
 393#define WMI_MAX_CHANNEL_NUM	(6)
 394#define WMI_MAX_PLANS_NUM	(2)
 395
 396/* WMI_START_SCHED_SCAN_CMDID */
 397struct wmi_sched_scan_ssid_match {
 398	u8 ssid_len;
 399	u8 ssid[WMI_MAX_SSID_LEN];
 400	s8 rssi_threshold;
 401	/* boolean */
 402	u8 add_ssid_to_probe;
 403	u8 reserved;
 404} __packed;
 405
 406/* WMI_START_SCHED_SCAN_CMDID */
 407struct wmi_sched_scan_plan {
 408	__le16 interval_sec;
 409	__le16 num_of_iterations;
 410} __packed;
 411
 412/* WMI_START_SCHED_SCAN_CMDID */
 413struct wmi_start_sched_scan_cmd {
 414	struct wmi_sched_scan_ssid_match ssid_for_match[WMI_MAX_PNO_SSID_NUM];
 415	u8 num_of_ssids;
 416	s8 min_rssi_threshold;
 417	u8 channel_list[WMI_MAX_CHANNEL_NUM];
 418	u8 num_of_channels;
 419	u8 reserved;
 420	__le16 initial_delay_sec;
 421	struct wmi_sched_scan_plan scan_plans[WMI_MAX_PLANS_NUM];
 422} __packed;
 423
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 424/* WMI_SET_PROBED_SSID_CMDID */
 425#define MAX_PROBED_SSID_INDEX	(3)
 426
 427enum wmi_ssid_flag {
 428	/* disables entry */
 429	WMI_SSID_FLAG_DISABLE	= 0x00,
 430	/* probes specified ssid */
 431	WMI_SSID_FLAG_SPECIFIC	= 0x01,
 432	/* probes for any ssid */
 433	WMI_SSID_FLAG_ANY	= 0x02,
 434};
 435
 436struct wmi_probed_ssid_cmd {
 437	/* 0 to MAX_PROBED_SSID_INDEX */
 438	u8 entry_index;
 439	/* enum wmi_ssid_flag */
 440	u8 flag;
 441	u8 ssid_len;
 442	u8 ssid[WMI_MAX_SSID_LEN];
 443} __packed;
 444
 445/* WMI_SET_APPIE_CMDID
 446 * Add Application specified IE to a management frame
 447 */
 448#define WMI_MAX_IE_LEN	(1024)
 449
 450/* Frame Types */
 451enum wmi_mgmt_frame_type {
 452	WMI_FRAME_BEACON	= 0x00,
 453	WMI_FRAME_PROBE_REQ	= 0x01,
 454	WMI_FRAME_PROBE_RESP	= 0x02,
 455	WMI_FRAME_ASSOC_REQ	= 0x03,
 456	WMI_FRAME_ASSOC_RESP	= 0x04,
 457	WMI_NUM_MGMT_FRAME	= 0x05,
 458};
 459
 460struct wmi_set_appie_cmd {
 461	/* enum wmi_mgmt_frame_type */
 462	u8 mgmt_frm_type;
 463	u8 reserved;
 464	/* Length of the IE to be added to MGMT frame */
 465	__le16 ie_len;
 466	u8 ie_info[0];
 467} __packed;
 468
 469/* WMI_PXMT_RANGE_CFG_CMDID */
 470struct wmi_pxmt_range_cfg_cmd {
 471	u8 dst_mac[WMI_MAC_LEN];
 472	__le16 range;
 473} __packed;
 474
 475/* WMI_PXMT_SNR2_RANGE_CFG_CMDID */
 476struct wmi_pxmt_snr2_range_cfg_cmd {
 477	s8 snr2range_arr[2];
 478} __packed;
 479
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 480/* WMI_RF_MGMT_CMDID */
 481enum wmi_rf_mgmt_type {
 482	WMI_RF_MGMT_W_DISABLE	= 0x00,
 483	WMI_RF_MGMT_W_ENABLE	= 0x01,
 484	WMI_RF_MGMT_GET_STATUS	= 0x02,
 485};
 486
 
 
 
 
 
 
 
 
 
 
 
 
 487/* WMI_RF_MGMT_CMDID */
 488struct wmi_rf_mgmt_cmd {
 489	__le32 rf_mgmt_type;
 490} __packed;
 491
 492/* WMI_CORR_MEASURE_CMDID */
 493struct wmi_corr_measure_cmd {
 494	__le32 freq_mhz;
 495	__le32 length_samples;
 496	__le32 iterations;
 497} __packed;
 498
 499/* WMI_SET_SSID_CMDID */
 500struct wmi_set_ssid_cmd {
 501	__le32 ssid_len;
 502	u8 ssid[WMI_MAX_SSID_LEN];
 503} __packed;
 504
 505/* WMI_SET_PCP_CHANNEL_CMDID */
 506struct wmi_set_pcp_channel_cmd {
 507	u8 channel;
 508	u8 reserved[3];
 509} __packed;
 510
 511/* WMI_BCON_CTRL_CMDID */
 512struct wmi_bcon_ctrl_cmd {
 513	__le16 bcon_interval;
 514	__le16 frag_num;
 515	__le64 ss_mask;
 516	u8 network_type;
 517	u8 pcp_max_assoc_sta;
 518	u8 disable_sec_offload;
 519	u8 disable_sec;
 520	u8 hidden_ssid;
 521	u8 is_go;
 522	u8 reserved[2];
 
 
 523} __packed;
 524
 525/* WMI_PORT_ALLOCATE_CMDID */
 526enum wmi_port_role {
 527	WMI_PORT_STA		= 0x00,
 528	WMI_PORT_PCP		= 0x01,
 529	WMI_PORT_AP		= 0x02,
 530	WMI_PORT_P2P_DEV	= 0x03,
 531	WMI_PORT_P2P_CLIENT	= 0x04,
 532	WMI_PORT_P2P_GO		= 0x05,
 533};
 534
 535/* WMI_PORT_ALLOCATE_CMDID */
 536struct wmi_port_allocate_cmd {
 537	u8 mac[WMI_MAC_LEN];
 538	u8 port_role;
 539	u8 mid;
 540} __packed;
 541
 542/* WMI_PORT_DELETE_CMDID */
 543struct wmi_port_delete_cmd {
 544	u8 mid;
 545	u8 reserved[3];
 546} __packed;
 547
 548/* WMI_TRAFFIC_SUSPEND_CMD wakeup trigger bit mask values */
 549enum wmi_wakeup_trigger {
 550	WMI_WAKEUP_TRIGGER_UCAST	= 0x01,
 551	WMI_WAKEUP_TRIGGER_BCAST	= 0x02,
 552};
 553
 554/* WMI_TRAFFIC_SUSPEND_CMDID */
 555struct wmi_traffic_suspend_cmd {
 556	/* Bit vector: bit[0] - wake on Unicast, bit[1] - wake on Broadcast */
 557	u8 wakeup_trigger;
 558} __packed;
 559
 560/* WMI_P2P_CFG_CMDID */
 561enum wmi_discovery_mode {
 562	WMI_DISCOVERY_MODE_NON_OFFLOAD	= 0x00,
 563	WMI_DISCOVERY_MODE_OFFLOAD	= 0x01,
 564	WMI_DISCOVERY_MODE_PEER2PEER	= 0x02,
 565};
 566
 567struct wmi_p2p_cfg_cmd {
 568	/* enum wmi_discovery_mode */
 569	u8 discovery_mode;
 570	u8 channel;
 571	/* base to listen/search duration calculation */
 572	__le16 bcon_interval;
 573} __packed;
 574
 575/* WMI_POWER_MGMT_CFG_CMDID */
 576enum wmi_power_source_type {
 577	WMI_POWER_SOURCE_BATTERY	= 0x00,
 578	WMI_POWER_SOURCE_OTHER		= 0x01,
 579};
 580
 581struct wmi_power_mgmt_cfg_cmd {
 582	/* enum wmi_power_source_type */
 583	u8 power_source;
 584	u8 reserved[3];
 585} __packed;
 586
 587/* WMI_PCP_START_CMDID */
 
 
 
 
 
 
 
 
 
 
 588struct wmi_pcp_start_cmd {
 589	__le16 bcon_interval;
 590	u8 pcp_max_assoc_sta;
 591	u8 hidden_ssid;
 592	u8 is_go;
 593	u8 reserved0[5];
 
 
 
 594	/* A-BFT length override if non-0 */
 595	u8 abft_len;
 596	u8 disable_ap_sme;
 
 597	u8 network_type;
 
 
 
 598	u8 channel;
 599	u8 disable_sec_offload;
 600	u8 disable_sec;
 601} __packed;
 602
 603/* WMI_SW_TX_REQ_CMDID */
 604struct wmi_sw_tx_req_cmd {
 605	u8 dst_mac[WMI_MAC_LEN];
 606	__le16 len;
 607	u8 payload[0];
 608} __packed;
 609
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 610struct wmi_sw_ring_cfg {
 611	__le64 ring_mem_base;
 612	__le16 ring_size;
 613	__le16 max_mpdu_size;
 614} __packed;
 615
 616/* wmi_vring_cfg_schd */
 617struct wmi_vring_cfg_schd {
 618	__le16 priority;
 619	__le16 timeslot_us;
 620} __packed;
 621
 622enum wmi_vring_cfg_encap_trans_type {
 623	WMI_VRING_ENC_TYPE_802_3	= 0x00,
 624	WMI_VRING_ENC_TYPE_NATIVE_WIFI	= 0x01,
 
 625};
 626
 627enum wmi_vring_cfg_ds_cfg {
 628	WMI_VRING_DS_PBSS	= 0x00,
 629	WMI_VRING_DS_STATION	= 0x01,
 630	WMI_VRING_DS_AP		= 0x02,
 631	WMI_VRING_DS_ADDR4	= 0x03,
 632};
 633
 634enum wmi_vring_cfg_nwifi_ds_trans_type {
 635	WMI_NWIFI_TX_TRANS_MODE_NO		= 0x00,
 636	WMI_NWIFI_TX_TRANS_MODE_AP2PBSS		= 0x01,
 637	WMI_NWIFI_TX_TRANS_MODE_STA2PBSS	= 0x02,
 638};
 639
 640enum wmi_vring_cfg_schd_params_priority {
 641	WMI_SCH_PRIO_REGULAR	= 0x00,
 642	WMI_SCH_PRIO_HIGH	= 0x01,
 643};
 644
 
 645#define CIDXTID_CID_POS				(0)
 646#define CIDXTID_CID_LEN				(4)
 647#define CIDXTID_CID_MSK				(0xF)
 648#define CIDXTID_TID_POS				(4)
 649#define CIDXTID_TID_LEN				(4)
 650#define CIDXTID_TID_MSK				(0xF0)
 651#define VRING_CFG_MAC_CTRL_LIFETIME_EN_POS	(0)
 652#define VRING_CFG_MAC_CTRL_LIFETIME_EN_LEN	(1)
 653#define VRING_CFG_MAC_CTRL_LIFETIME_EN_MSK	(0x1)
 654#define VRING_CFG_MAC_CTRL_AGGR_EN_POS		(1)
 655#define VRING_CFG_MAC_CTRL_AGGR_EN_LEN		(1)
 656#define VRING_CFG_MAC_CTRL_AGGR_EN_MSK		(0x2)
 657#define VRING_CFG_TO_RESOLUTION_VALUE_POS	(0)
 658#define VRING_CFG_TO_RESOLUTION_VALUE_LEN	(6)
 659#define VRING_CFG_TO_RESOLUTION_VALUE_MSK	(0x3F)
 660
 661struct wmi_vring_cfg {
 662	struct wmi_sw_ring_cfg tx_sw_ring;
 663	/* 0-23 vrings */
 664	u8 ringid;
 
 
 
 665	u8 cidxtid;
 666	u8 encap_trans_type;
 667	/* 802.3 DS cfg */
 668	u8 ds_cfg;
 669	u8 nwifi_ds_trans_type;
 670	u8 mac_ctrl;
 671	u8 to_resolution;
 672	u8 agg_max_wsize;
 673	struct wmi_vring_cfg_schd schd_params;
 
 
 
 
 
 
 
 
 
 674} __packed;
 675
 676enum wmi_vring_cfg_cmd_action {
 677	WMI_VRING_CMD_ADD	= 0x00,
 678	WMI_VRING_CMD_MODIFY	= 0x01,
 679	WMI_VRING_CMD_DELETE	= 0x02,
 680};
 681
 682/* WMI_VRING_CFG_CMDID */
 683struct wmi_vring_cfg_cmd {
 684	__le32 action;
 685	struct wmi_vring_cfg vring_cfg;
 686} __packed;
 687
 688struct wmi_bcast_vring_cfg {
 689	struct wmi_sw_ring_cfg tx_sw_ring;
 690	/* 0-23 vrings */
 691	u8 ringid;
 692	u8 encap_trans_type;
 693	/* 802.3 DS cfg */
 694	u8 ds_cfg;
 695	u8 nwifi_ds_trans_type;
 696} __packed;
 697
 698/* WMI_BCAST_VRING_CFG_CMDID */
 699struct wmi_bcast_vring_cfg_cmd {
 700	__le32 action;
 701	struct wmi_bcast_vring_cfg vring_cfg;
 702} __packed;
 703
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 704/* WMI_LO_POWER_CALIB_FROM_OTP_CMDID */
 705struct wmi_lo_power_calib_from_otp_cmd {
 706	/* index to read from OTP. zero based */
 707	u8 index;
 708	u8 reserved[3];
 709} __packed;
 710
 711/* WMI_LO_POWER_CALIB_FROM_OTP_EVENTID */
 712struct wmi_lo_power_calib_from_otp_event {
 713	/* wmi_fw_status */
 714	u8 status;
 715	u8 reserved[3];
 716} __packed;
 717
 718/* WMI_VRING_BA_EN_CMDID */
 719struct wmi_vring_ba_en_cmd {
 720	u8 ringid;
 721	u8 agg_max_wsize;
 722	__le16 ba_timeout;
 723	u8 amsdu;
 724	u8 reserved[3];
 725} __packed;
 726
 727/* WMI_VRING_BA_DIS_CMDID */
 728struct wmi_vring_ba_dis_cmd {
 729	u8 ringid;
 730	u8 reserved;
 731	__le16 reason;
 732} __packed;
 733
 734/* WMI_NOTIFY_REQ_CMDID */
 735struct wmi_notify_req_cmd {
 736	u8 cid;
 737	u8 year;
 738	u8 month;
 739	u8 day;
 740	__le32 interval_usec;
 741	u8 hour;
 742	u8 minute;
 743	u8 second;
 744	u8 miliseconds;
 745} __packed;
 746
 747/* WMI_CFG_RX_CHAIN_CMDID */
 748enum wmi_sniffer_cfg_mode {
 749	WMI_SNIFFER_OFF	= 0x00,
 750	WMI_SNIFFER_ON	= 0x01,
 751};
 752
 753/* WMI_SILENT_RSSI_TABLE */
 754enum wmi_silent_rssi_table {
 755	RF_TEMPERATURE_CALIB_DEFAULT_DB		= 0x00,
 756	RF_TEMPERATURE_CALIB_HIGH_POWER_DB	= 0x01,
 757};
 758
 759/* WMI_SILENT_RSSI_STATUS */
 760enum wmi_silent_rssi_status {
 761	SILENT_RSSI_SUCCESS	= 0x00,
 762	SILENT_RSSI_FAILURE	= 0x01,
 763};
 764
 765/* WMI_SET_ACTIVE_SILENT_RSSI_TABLE_CMDID */
 766struct wmi_set_active_silent_rssi_table_cmd {
 767	/* enum wmi_silent_rssi_table */
 768	__le32 table;
 769} __packed;
 770
 771enum wmi_sniffer_cfg_phy_info_mode {
 772	WMI_SNIFFER_PHY_INFO_DISABLED	= 0x00,
 773	WMI_SNIFFER_PHY_INFO_ENABLED	= 0x01,
 774};
 775
 776enum wmi_sniffer_cfg_phy_support {
 777	WMI_SNIFFER_CP		= 0x00,
 778	WMI_SNIFFER_DP		= 0x01,
 779	WMI_SNIFFER_BOTH_PHYS	= 0x02,
 780};
 781
 782/* wmi_sniffer_cfg */
 783struct wmi_sniffer_cfg {
 784	/* enum wmi_sniffer_cfg_mode */
 785	__le32 mode;
 786	/* enum wmi_sniffer_cfg_phy_info_mode */
 787	__le32 phy_info_mode;
 788	/* enum wmi_sniffer_cfg_phy_support */
 789	__le32 phy_support;
 790	u8 channel;
 791	u8 reserved[3];
 792} __packed;
 793
 794enum wmi_cfg_rx_chain_cmd_action {
 795	WMI_RX_CHAIN_ADD	= 0x00,
 796	WMI_RX_CHAIN_DEL	= 0x01,
 797};
 798
 799enum wmi_cfg_rx_chain_cmd_decap_trans_type {
 800	WMI_DECAP_TYPE_802_3		= 0x00,
 801	WMI_DECAP_TYPE_NATIVE_WIFI	= 0x01,
 802	WMI_DECAP_TYPE_NONE		= 0x02,
 803};
 804
 805enum wmi_cfg_rx_chain_cmd_nwifi_ds_trans_type {
 806	WMI_NWIFI_RX_TRANS_MODE_NO		= 0x00,
 807	WMI_NWIFI_RX_TRANS_MODE_PBSS2AP		= 0x01,
 808	WMI_NWIFI_RX_TRANS_MODE_PBSS2STA	= 0x02,
 809};
 810
 811enum wmi_cfg_rx_chain_cmd_reorder_type {
 812	WMI_RX_HW_REORDER	= 0x00,
 813	WMI_RX_SW_REORDER	= 0x01,
 814};
 815
 816#define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_POS	(0)
 817#define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_LEN	(1)
 818#define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_MSK	(0x1)
 819#define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_POS		(1)
 820#define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_LEN		(1)
 821#define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_MSK		(0x2)
 822#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_POS		(0)
 823#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_LEN		(1)
 824#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_MSK		(0x1)
 825#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_POS		(1)
 826#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_LEN		(1)
 827#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_MSK		(0x2)
 828#define L3_L4_CTRL_IPV4_CHECKSUM_EN_POS			(0)
 829#define L3_L4_CTRL_IPV4_CHECKSUM_EN_LEN			(1)
 830#define L3_L4_CTRL_IPV4_CHECKSUM_EN_MSK			(0x1)
 831#define L3_L4_CTRL_TCPIP_CHECKSUM_EN_POS		(1)
 832#define L3_L4_CTRL_TCPIP_CHECKSUM_EN_LEN		(1)
 833#define L3_L4_CTRL_TCPIP_CHECKSUM_EN_MSK		(0x2)
 834#define RING_CTRL_OVERRIDE_PREFETCH_THRSH_POS		(0)
 835#define RING_CTRL_OVERRIDE_PREFETCH_THRSH_LEN		(1)
 836#define RING_CTRL_OVERRIDE_PREFETCH_THRSH_MSK		(0x1)
 837#define RING_CTRL_OVERRIDE_WB_THRSH_POS			(1)
 838#define RING_CTRL_OVERRIDE_WB_THRSH_LEN			(1)
 839#define RING_CTRL_OVERRIDE_WB_THRSH_MSK			(0x2)
 840#define RING_CTRL_OVERRIDE_ITR_THRSH_POS		(2)
 841#define RING_CTRL_OVERRIDE_ITR_THRSH_LEN		(1)
 842#define RING_CTRL_OVERRIDE_ITR_THRSH_MSK		(0x4)
 843#define RING_CTRL_OVERRIDE_HOST_THRSH_POS		(3)
 844#define RING_CTRL_OVERRIDE_HOST_THRSH_LEN		(1)
 845#define RING_CTRL_OVERRIDE_HOST_THRSH_MSK		(0x8)
 846
 847/* WMI_CFG_RX_CHAIN_CMDID */
 848struct wmi_cfg_rx_chain_cmd {
 849	__le32 action;
 850	struct wmi_sw_ring_cfg rx_sw_ring;
 851	u8 mid;
 852	u8 decap_trans_type;
 853	u8 l2_802_3_offload_ctrl;
 854	u8 l2_nwifi_offload_ctrl;
 855	u8 vlan_id;
 856	u8 nwifi_ds_trans_type;
 857	u8 l3_l4_ctrl;
 858	u8 ring_ctrl;
 859	__le16 prefetch_thrsh;
 860	__le16 wb_thrsh;
 861	__le32 itr_value;
 862	__le16 host_thrsh;
 863	u8 reorder_type;
 864	u8 reserved;
 865	struct wmi_sniffer_cfg sniffer_cfg;
 866	__le16 max_rx_pl_per_desc;
 867} __packed;
 868
 869/* WMI_RCP_ADDBA_RESP_CMDID */
 870struct wmi_rcp_addba_resp_cmd {
 
 
 
 871	u8 cidxtid;
 872	u8 dialog_token;
 873	__le16 status_code;
 874	/* ieee80211_ba_parameterset field to send */
 875	__le16 ba_param_set;
 876	__le16 ba_timeout;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 877} __packed;
 878
 879/* WMI_RCP_DELBA_CMDID */
 880struct wmi_rcp_delba_cmd {
 
 
 
 881	u8 cidxtid;
 882	u8 reserved;
 883	__le16 reason;
 
 
 
 
 
 884} __packed;
 885
 886/* WMI_RCP_ADDBA_REQ_CMDID */
 887struct wmi_rcp_addba_req_cmd {
 
 
 
 888	u8 cidxtid;
 889	u8 dialog_token;
 890	/* ieee80211_ba_parameterset field as it received */
 891	__le16 ba_param_set;
 892	__le16 ba_timeout;
 893	/* ieee80211_ba_seqstrl field as it received */
 894	__le16 ba_seq_ctrl;
 
 
 
 
 
 895} __packed;
 896
 897/* WMI_SET_MAC_ADDRESS_CMDID */
 898struct wmi_set_mac_address_cmd {
 899	u8 mac[WMI_MAC_LEN];
 900	u8 reserved[2];
 901} __packed;
 902
 903/* WMI_ECHO_CMDID
 904 * Check FW is alive
 905 * WMI_DEEP_ECHO_CMDID
 906 * Check FW and ucode are alive
 907 * Returned event: WMI_ECHO_RSP_EVENTID
 908 * same event for both commands
 909 */
 910struct wmi_echo_cmd {
 911	__le32 value;
 912} __packed;
 913
 
 
 
 
 
 
 
 
 914/* WMI_RF_PWR_ON_DELAY_CMDID
 915 * set FW time parameters used through RF resetting
 916 *  RF reset consists of bringing its power down for a period of time, then
 917 * bringing the power up
 918 * Returned event: WMI_RF_PWR_ON_DELAY_RSP_EVENTID
 919 */
 920struct wmi_rf_pwr_on_delay_cmd {
 921	/* time in usec the FW waits after bringing the RF PWR down,
 922	 * set 0 for default
 923	 */
 924	__le16 down_delay_usec;
 925	/* time in usec the FW waits after bringing the RF PWR up,
 926	 * set 0 for default
 927	 */
 928	__le16 up_delay_usec;
 929} __packed;
 930
 931/* \WMI_SET_HIGH_POWER_TABLE_PARAMS_CMDID
 932 * This API controls the Tx and Rx gain over temperature.
 933 * It controls the Tx D-type, Rx D-type and Rx E-type amplifiers.
 934 * It also controls the Tx gain index, by controlling the Rx to Tx gain index
 935 * offset.
 936 * The control is divided by 3 temperature values to 4 temperature ranges.
 937 * Each parameter uses its own temperature values.
 938 * Returned event: WMI_SET_HIGH_POWER_TABLE_PARAMS_EVENTID
 939 */
 940struct wmi_set_high_power_table_params_cmd {
 941	/* Temperature range for Tx D-type parameters */
 942	u8 tx_dtype_temp[WMI_RF_DTYPE_LENGTH];
 943	u8 reserved0;
 944	/* Tx D-type values to be used for each temperature range */
 945	__le32 tx_dtype_conf[WMI_RF_DTYPE_LENGTH + 1];
 
 
 
 
 
 
 
 
 946	/* Temperature range for Rx D-type parameters */
 947	u8 rx_dtype_temp[WMI_RF_DTYPE_LENGTH];
 948	u8 reserved1;
 949	/* Rx D-type values to be used for each temperature range */
 950	__le32 rx_dtype_conf[WMI_RF_DTYPE_LENGTH + 1];
 951	/* Temperature range for Rx E-type parameters */
 952	u8 rx_etype_temp[WMI_RF_ETYPE_LENGTH];
 953	u8 reserved2;
 954	/* Rx E-type values to be used for each temperature range.
 955	 * The last 4 values of any range are the first 4 values of the next
 956	 * range and so on
 957	 */
 958	__le32 rx_etype_conf[WMI_RF_ETYPE_VAL_PER_RANGE + WMI_RF_ETYPE_LENGTH];
 959	/* Temperature range for rx_2_tx_offs parameters */
 960	u8 rx_2_tx_temp[WMI_RF_RX2TX_LENGTH];
 961	u8 reserved3;
 962	/* Rx to Tx gain index offset */
 963	s8 rx_2_tx_offs[WMI_RF_RX2TX_LENGTH + 1];
 
 
 
 
 
 
 
 
 
 
 
 
 
 964} __packed;
 965
 966/* CMD: WMI_RF_XPM_READ_CMDID */
 967struct wmi_rf_xpm_read_cmd {
 968	u8 rf_id;
 969	u8 reserved[3];
 970	/* XPM bit start address in range [0,8191]bits - rounded by FW to
 971	 * multiple of 8bits
 972	 */
 973	__le32 xpm_bit_address;
 974	__le32 num_bytes;
 975} __packed;
 976
 977/* CMD: WMI_RF_XPM_WRITE_CMDID */
 978struct wmi_rf_xpm_write_cmd {
 979	u8 rf_id;
 980	u8 reserved0[3];
 981	/* XPM bit start address in range [0,8191]bits - rounded by FW to
 982	 * multiple of 8bits
 983	 */
 984	__le32 xpm_bit_address;
 985	__le32 num_bytes;
 986	/* boolean flag indicating whether FW should verify the write
 987	 * operation
 988	 */
 989	u8 verify;
 990	u8 reserved1[3];
 991	/* actual size=num_bytes */
 992	u8 data_bytes[0];
 993} __packed;
 994
 995/* WMI_TEMP_SENSE_CMDID
 996 *
 997 * Measure MAC and radio temperatures
 998 *
 999 * Possible modes for temperature measurement
1000 */
1001enum wmi_temperature_measure_mode {
1002	TEMPERATURE_USE_OLD_VALUE	= 0x01,
1003	TEMPERATURE_MEASURE_NOW		= 0x02,
1004};
1005
1006/* WMI_TEMP_SENSE_CMDID */
1007struct wmi_temp_sense_cmd {
1008	__le32 measure_baseband_en;
1009	__le32 measure_rf_en;
1010	__le32 measure_mode;
1011} __packed;
1012
1013enum wmi_pmc_op {
1014	WMI_PMC_ALLOCATE	= 0x00,
1015	WMI_PMC_RELEASE		= 0x01,
1016};
1017
1018/* WMI_PMC_CMDID */
1019struct wmi_pmc_cmd {
1020	/* enum wmi_pmc_cmd_op_type */
1021	u8 op;
1022	u8 reserved;
1023	__le16 ring_size;
1024	__le64 mem_base;
1025} __packed;
1026
1027enum wmi_aoa_meas_type {
1028	WMI_AOA_PHASE_MEAS	= 0x00,
1029	WMI_AOA_PHASE_AMP_MEAS	= 0x01,
1030};
1031
1032/* WMI_AOA_MEAS_CMDID */
1033struct wmi_aoa_meas_cmd {
1034	u8 mac_addr[WMI_MAC_LEN];
1035	/* channels IDs:
1036	 * 0 - 58320 MHz
1037	 * 1 - 60480 MHz
1038	 * 2 - 62640 MHz
1039	 */
1040	u8 channel;
1041	/* enum wmi_aoa_meas_type */
1042	u8 aoa_meas_type;
1043	__le32 meas_rf_mask;
1044} __packed;
1045
1046/* WMI_SET_MGMT_RETRY_LIMIT_CMDID */
1047struct wmi_set_mgmt_retry_limit_cmd {
1048	/* MAC retransmit limit for mgmt frames */
1049	u8 mgmt_retry_limit;
1050	/* alignment to 32b */
1051	u8 reserved[3];
1052} __packed;
1053
1054/* Zones: HIGH, MAX, CRITICAL */
1055#define WMI_NUM_OF_TT_ZONES	(3)
1056
1057struct wmi_tt_zone_limits {
1058	/* Above this temperature this zone is active */
1059	u8 temperature_high;
1060	/* Below this temperature the adjacent lower zone is active */
1061	u8 temperature_low;
1062	u8 reserved[2];
1063} __packed;
1064
1065/* Struct used for both configuration and status commands of thermal
1066 * throttling
1067 */
1068struct wmi_tt_data {
1069	/* Enable/Disable TT algorithm for baseband */
1070	u8 bb_enabled;
1071	u8 reserved0[3];
1072	/* Define zones for baseband */
1073	struct wmi_tt_zone_limits bb_zones[WMI_NUM_OF_TT_ZONES];
1074	/* Enable/Disable TT algorithm for radio */
1075	u8 rf_enabled;
1076	u8 reserved1[3];
1077	/* Define zones for all radio chips */
1078	struct wmi_tt_zone_limits rf_zones[WMI_NUM_OF_TT_ZONES];
1079} __packed;
1080
1081/* WMI_SET_THERMAL_THROTTLING_CFG_CMDID */
1082struct wmi_set_thermal_throttling_cfg_cmd {
1083	/* Command data */
1084	struct wmi_tt_data tt_data;
1085} __packed;
1086
1087/* WMI_NEW_STA_CMDID */
1088struct wmi_new_sta_cmd {
1089	u8 dst_mac[WMI_MAC_LEN];
1090	u8 aid;
1091} __packed;
1092
1093/* WMI_DEL_STA_CMDID */
1094struct wmi_del_sta_cmd {
1095	u8 dst_mac[WMI_MAC_LEN];
1096	__le16 disconnect_reason;
1097} __packed;
1098
1099enum wmi_tof_burst_duration {
1100	WMI_TOF_BURST_DURATION_250_USEC		= 2,
1101	WMI_TOF_BURST_DURATION_500_USEC		= 3,
1102	WMI_TOF_BURST_DURATION_1_MSEC		= 4,
1103	WMI_TOF_BURST_DURATION_2_MSEC		= 5,
1104	WMI_TOF_BURST_DURATION_4_MSEC		= 6,
1105	WMI_TOF_BURST_DURATION_8_MSEC		= 7,
1106	WMI_TOF_BURST_DURATION_16_MSEC		= 8,
1107	WMI_TOF_BURST_DURATION_32_MSEC		= 9,
1108	WMI_TOF_BURST_DURATION_64_MSEC		= 10,
1109	WMI_TOF_BURST_DURATION_128_MSEC		= 11,
1110	WMI_TOF_BURST_DURATION_NO_PREFERENCES	= 15,
1111};
1112
1113enum wmi_tof_session_start_flags {
1114	WMI_TOF_SESSION_START_FLAG_SECURED	= 0x1,
1115	WMI_TOF_SESSION_START_FLAG_ASAP		= 0x2,
1116	WMI_TOF_SESSION_START_FLAG_LCI_REQ	= 0x4,
1117	WMI_TOF_SESSION_START_FLAG_LCR_REQ	= 0x8,
1118};
1119
1120/* WMI_TOF_SESSION_START_CMDID */
1121struct wmi_ftm_dest_info {
1122	u8 channel;
1123	/* wmi_tof_session_start_flags_e */
1124	u8 flags;
1125	u8 initial_token;
1126	u8 num_of_ftm_per_burst;
1127	u8 num_of_bursts_exp;
1128	/* wmi_tof_burst_duration_e */
1129	u8 burst_duration;
1130	/* Burst Period indicate interval between two consecutive burst
1131	 * instances, in units of 100 ms
1132	 */
1133	__le16 burst_period;
1134	u8 dst_mac[WMI_MAC_LEN];
1135	u8 reserved;
1136	u8 num_burst_per_aoa_meas;
1137} __packed;
1138
1139/* WMI_TOF_SESSION_START_CMDID */
1140struct wmi_tof_session_start_cmd {
1141	__le32 session_id;
1142	u8 reserved1;
1143	u8 aoa_type;
1144	__le16 num_of_dest;
1145	u8 reserved[4];
1146	struct wmi_ftm_dest_info ftm_dest_info[0];
1147} __packed;
1148
1149/* WMI_TOF_CFG_RESPONDER_CMDID */
1150struct wmi_tof_cfg_responder_cmd {
1151	u8 enable;
1152	u8 reserved[3];
1153} __packed;
1154
1155enum wmi_tof_channel_info_report_type {
1156	WMI_TOF_CHANNEL_INFO_TYPE_CIR			= 0x1,
1157	WMI_TOF_CHANNEL_INFO_TYPE_RSSI			= 0x2,
1158	WMI_TOF_CHANNEL_INFO_TYPE_SNR			= 0x4,
1159	WMI_TOF_CHANNEL_INFO_TYPE_DEBUG_DATA		= 0x8,
1160	WMI_TOF_CHANNEL_INFO_TYPE_VENDOR_SPECIFIC	= 0x10,
1161};
1162
1163/* WMI_TOF_CHANNEL_INFO_CMDID */
1164struct wmi_tof_channel_info_cmd {
1165	/* wmi_tof_channel_info_report_type_e */
1166	__le32 channel_info_report_request;
1167} __packed;
1168
1169/* WMI_TOF_SET_TX_RX_OFFSET_CMDID */
1170struct wmi_tof_set_tx_rx_offset_cmd {
1171	/* TX delay offset */
1172	__le32 tx_offset;
1173	/* RX delay offset */
1174	__le32 rx_offset;
1175	/* Mask to define which RFs to configure. 0 means all RFs */
1176	__le32 rf_mask;
1177	/* Offset to strongest tap of CIR */
1178	__le32 precursor;
1179} __packed;
1180
1181/* WMI_TOF_GET_TX_RX_OFFSET_CMDID */
1182struct wmi_tof_get_tx_rx_offset_cmd {
1183	/* rf index to read offsets from */
1184	u8 rf_index;
1185	u8 reserved[3];
1186} __packed;
1187
1188/* WMI_FIXED_SCHEDULING_CONFIG_CMDID */
1189struct wmi_map_mcs_to_schd_params {
1190	u8 mcs;
1191	/* time in usec from start slot to start tx flow - default 15 */
1192	u8 time_in_usec_before_initiate_tx;
1193	/* RD enable - if yes consider RD according to STA mcs */
1194	u8 rd_enabled;
1195	u8 reserved;
1196	/* time in usec from start slot to stop vring */
1197	__le16 time_in_usec_to_stop_vring;
1198	/* timeout to force flush from start of slot */
1199	__le16 flush_to_in_usec;
1200	/* per mcs the mac buffer limit size in bytes */
1201	__le32 mac_buff_size_in_bytes;
1202} __packed;
1203
1204/* WMI_FIXED_SCHEDULING_CONFIG_COMPLETE_EVENTID */
1205struct wmi_fixed_scheduling_config_complete_event {
1206	/* wmi_fw_status */
1207	u8 status;
1208	u8 reserved[3];
1209} __packed;
1210
 
 
 
 
1211#define WMI_NUM_MCS	(13)
1212
1213/* WMI_FIXED_SCHEDULING_CONFIG_CMDID */
1214struct wmi_fixed_scheduling_config_cmd {
1215	/* defaults in the SAS table */
1216	struct wmi_map_mcs_to_schd_params mcs_to_schd_params_map[WMI_NUM_MCS];
1217	/* default 150 uSec */
1218	__le16 max_sta_rd_ppdu_duration_in_usec;
1219	/* default 300 uSec */
1220	__le16 max_sta_grant_ppdu_duration_in_usec;
1221	/* default 1000 uSec */
1222	__le16 assoc_slot_duration_in_usec;
1223	/* default 360 uSec */
1224	__le16 virtual_slot_duration_in_usec;
1225	/* each this field value slots start with grant frame to the station
1226	 * - default 2
1227	 */
1228	u8 number_of_ap_slots_for_initiate_grant;
1229	u8 reserved[3];
1230} __packed;
1231
1232/* WMI_ENABLE_FIXED_SCHEDULING_CMDID */
1233struct wmi_enable_fixed_scheduling_cmd {
1234	__le32 reserved;
1235} __packed;
1236
1237/* WMI_ENABLE_FIXED_SCHEDULING_COMPLETE_EVENTID */
1238struct wmi_enable_fixed_scheduling_complete_event {
1239	/* wmi_fw_status */
1240	u8 status;
1241	u8 reserved[3];
1242} __packed;
1243
1244/* WMI_SET_MULTI_DIRECTED_OMNIS_CONFIG_CMDID */
1245struct wmi_set_multi_directed_omnis_config_cmd {
1246	/* number of directed omnis at destination AP */
1247	u8 dest_ap_num_directed_omnis;
1248	u8 reserved[3];
1249} __packed;
1250
1251/* WMI_SET_MULTI_DIRECTED_OMNIS_CONFIG_EVENTID */
1252struct wmi_set_multi_directed_omnis_config_event {
1253	/* wmi_fw_status */
1254	u8 status;
1255	u8 reserved[3];
1256} __packed;
1257
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1258/* WMI_SET_LONG_RANGE_CONFIG_CMDID */
1259struct wmi_set_long_range_config_cmd {
1260	__le32 reserved;
1261} __packed;
1262
1263/* WMI_SET_LONG_RANGE_CONFIG_COMPLETE_EVENTID */
1264struct wmi_set_long_range_config_complete_event {
1265	/* wmi_fw_status */
1266	u8 status;
1267	u8 reserved[3];
1268} __packed;
1269
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1270/* WMI Events
1271 * List of Events (target to host)
1272 */
1273enum wmi_event_id {
1274	WMI_READY_EVENTID				= 0x1001,
1275	WMI_CONNECT_EVENTID				= 0x1002,
1276	WMI_DISCONNECT_EVENTID				= 0x1003,
1277	WMI_START_SCHED_SCAN_EVENTID			= 0x1005,
1278	WMI_STOP_SCHED_SCAN_EVENTID			= 0x1006,
1279	WMI_SCHED_SCAN_RESULT_EVENTID			= 0x1007,
1280	WMI_SCAN_COMPLETE_EVENTID			= 0x100A,
1281	WMI_REPORT_STATISTICS_EVENTID			= 0x100B,
 
 
 
 
 
 
 
 
1282	WMI_RD_MEM_RSP_EVENTID				= 0x1800,
1283	WMI_FW_READY_EVENTID				= 0x1801,
1284	WMI_EXIT_FAST_MEM_ACC_MODE_EVENTID		= 0x200,
1285	WMI_ECHO_RSP_EVENTID				= 0x1803,
 
1286	/* deprecated */
1287	WMI_FS_TUNE_DONE_EVENTID			= 0x180A,
1288	/* deprecated */
1289	WMI_CORR_MEASURE_EVENTID			= 0x180B,
1290	WMI_READ_RSSI_EVENTID				= 0x180C,
1291	WMI_TEMP_SENSE_DONE_EVENTID			= 0x180E,
1292	WMI_DC_CALIB_DONE_EVENTID			= 0x180F,
1293	/* deprecated */
1294	WMI_IQ_TX_CALIB_DONE_EVENTID			= 0x1811,
1295	/* deprecated */
1296	WMI_IQ_RX_CALIB_DONE_EVENTID			= 0x1812,
1297	WMI_SET_WORK_MODE_DONE_EVENTID			= 0x1815,
1298	WMI_LO_LEAKAGE_CALIB_DONE_EVENTID		= 0x1816,
1299	WMI_LO_POWER_CALIB_FROM_OTP_EVENTID		= 0x1817,
1300	WMI_SILENT_RSSI_CALIB_DONE_EVENTID		= 0x181D,
1301	/* deprecated */
1302	WMI_RF_RX_TEST_DONE_EVENTID			= 0x181E,
1303	WMI_CFG_RX_CHAIN_DONE_EVENTID			= 0x1820,
1304	WMI_VRING_CFG_DONE_EVENTID			= 0x1821,
1305	WMI_BA_STATUS_EVENTID				= 0x1823,
1306	WMI_RCP_ADDBA_REQ_EVENTID			= 0x1824,
1307	WMI_RCP_ADDBA_RESP_SENT_EVENTID			= 0x1825,
1308	WMI_DELBA_EVENTID				= 0x1826,
1309	WMI_GET_SSID_EVENTID				= 0x1828,
1310	WMI_GET_PCP_CHANNEL_EVENTID			= 0x182A,
 
 
 
1311	WMI_SW_TX_COMPLETE_EVENTID			= 0x182B,
1312	WMI_BEAMFORMING_MGMT_DONE_EVENTID		= 0x1836,
1313	WMI_BF_TXSS_MGMT_DONE_EVENTID			= 0x1837,
1314	WMI_BF_RXSS_MGMT_DONE_EVENTID			= 0x1839,
 
1315	WMI_RS_MGMT_DONE_EVENTID			= 0x1852,
1316	WMI_RF_MGMT_STATUS_EVENTID			= 0x1853,
1317	WMI_BF_SM_MGMT_DONE_EVENTID			= 0x1838,
1318	WMI_RX_MGMT_PACKET_EVENTID			= 0x1840,
1319	WMI_TX_MGMT_PACKET_EVENTID			= 0x1841,
1320	WMI_LINK_MAINTAIN_CFG_WRITE_DONE_EVENTID	= 0x1842,
1321	WMI_LINK_MAINTAIN_CFG_READ_DONE_EVENTID		= 0x1843,
1322	WMI_RF_XPM_READ_RESULT_EVENTID			= 0x1856,
1323	WMI_RF_XPM_WRITE_RESULT_EVENTID			= 0x1857,
1324	WMI_LED_CFG_DONE_EVENTID			= 0x1858,
1325	WMI_SET_SILENT_RSSI_TABLE_DONE_EVENTID		= 0x185C,
1326	WMI_RF_PWR_ON_DELAY_RSP_EVENTID			= 0x185D,
1327	WMI_SET_HIGH_POWER_TABLE_PARAMS_EVENTID		= 0x185E,
 
1328	/* Performance monitoring events */
1329	WMI_DATA_PORT_OPEN_EVENTID			= 0x1860,
1330	WMI_WBE_LINK_DOWN_EVENTID			= 0x1861,
1331	WMI_BF_CTRL_DONE_EVENTID			= 0x1862,
1332	WMI_NOTIFY_REQ_DONE_EVENTID			= 0x1863,
1333	WMI_GET_STATUS_DONE_EVENTID			= 0x1864,
1334	WMI_VRING_EN_EVENTID				= 0x1865,
1335	WMI_GET_RF_STATUS_EVENTID			= 0x1866,
1336	WMI_GET_BASEBAND_TYPE_EVENTID			= 0x1867,
 
1337	WMI_UNIT_TEST_EVENTID				= 0x1900,
1338	WMI_FLASH_READ_DONE_EVENTID			= 0x1902,
1339	WMI_FLASH_WRITE_DONE_EVENTID			= 0x1903,
1340	/* Power management */
1341	WMI_TRAFFIC_SUSPEND_EVENTID			= 0x1904,
1342	WMI_TRAFFIC_RESUME_EVENTID			= 0x1905,
1343	/* P2P */
1344	WMI_P2P_CFG_DONE_EVENTID			= 0x1910,
1345	WMI_PORT_ALLOCATED_EVENTID			= 0x1911,
1346	WMI_PORT_DELETED_EVENTID			= 0x1912,
1347	WMI_LISTEN_STARTED_EVENTID			= 0x1914,
1348	WMI_SEARCH_STARTED_EVENTID			= 0x1915,
1349	WMI_DISCOVERY_STARTED_EVENTID			= 0x1916,
1350	WMI_DISCOVERY_STOPPED_EVENTID			= 0x1917,
1351	WMI_PCP_STARTED_EVENTID				= 0x1918,
1352	WMI_PCP_STOPPED_EVENTID				= 0x1919,
1353	WMI_PCP_FACTOR_EVENTID				= 0x191A,
1354	/* Power Save Configuration Events */
1355	WMI_PS_DEV_PROFILE_CFG_EVENTID			= 0x191C,
 
 
 
 
1356	WMI_RS_CFG_DONE_EVENTID				= 0x1921,
 
1357	WMI_GET_DETAILED_RS_RES_EVENTID			= 0x1922,
1358	WMI_AOA_MEAS_EVENTID				= 0x1923,
1359	WMI_BRP_SET_ANT_LIMIT_EVENTID			= 0x1924,
1360	WMI_SET_MGMT_RETRY_LIMIT_EVENTID		= 0x1930,
1361	WMI_GET_MGMT_RETRY_LIMIT_EVENTID		= 0x1931,
1362	WMI_SET_THERMAL_THROTTLING_CFG_EVENTID		= 0x1940,
1363	WMI_GET_THERMAL_THROTTLING_CFG_EVENTID		= 0x1941,
1364	/* return the Power Save profile */
1365	WMI_PS_DEV_PROFILE_CFG_READ_EVENTID		= 0x1942,
 
1366	WMI_TOF_SESSION_END_EVENTID			= 0x1991,
1367	WMI_TOF_GET_CAPABILITIES_EVENTID		= 0x1992,
1368	WMI_TOF_SET_LCR_EVENTID				= 0x1993,
1369	WMI_TOF_SET_LCI_EVENTID				= 0x1994,
1370	WMI_TOF_FTM_PER_DEST_RES_EVENTID		= 0x1995,
1371	WMI_TOF_CFG_RESPONDER_EVENTID			= 0x1996,
1372	WMI_TOF_SET_TX_RX_OFFSET_EVENTID		= 0x1997,
1373	WMI_TOF_GET_TX_RX_OFFSET_EVENTID		= 0x1998,
1374	WMI_TOF_CHANNEL_INFO_EVENTID			= 0x1999,
1375	WMI_GET_RF_SECTOR_PARAMS_DONE_EVENTID		= 0x19A0,
1376	WMI_SET_RF_SECTOR_PARAMS_DONE_EVENTID		= 0x19A1,
1377	WMI_GET_SELECTED_RF_SECTOR_INDEX_DONE_EVENTID	= 0x19A2,
1378	WMI_SET_SELECTED_RF_SECTOR_INDEX_DONE_EVENTID	= 0x19A3,
1379	WMI_SET_RF_SECTOR_ON_DONE_EVENTID		= 0x19A4,
1380	WMI_PRIO_TX_SECTORS_ORDER_EVENTID		= 0x19A5,
1381	WMI_PRIO_TX_SECTORS_NUMBER_EVENTID		= 0x19A6,
1382	WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID	= 0x19A7,
 
 
 
 
 
 
 
 
1383	WMI_SCHEDULING_SCHEME_EVENTID			= 0x1A01,
1384	WMI_FIXED_SCHEDULING_CONFIG_COMPLETE_EVENTID	= 0x1A02,
1385	WMI_ENABLE_FIXED_SCHEDULING_COMPLETE_EVENTID	= 0x1A03,
1386	WMI_SET_MULTI_DIRECTED_OMNIS_CONFIG_EVENTID	= 0x1A04,
1387	WMI_SET_LONG_RANGE_CONFIG_COMPLETE_EVENTID	= 0x1A05,
 
 
 
 
 
 
 
 
 
 
 
 
 
1388	WMI_SET_CHANNEL_EVENTID				= 0x9000,
1389	WMI_ASSOC_REQ_EVENTID				= 0x9001,
1390	WMI_EAPOL_RX_EVENTID				= 0x9002,
1391	WMI_MAC_ADDR_RESP_EVENTID			= 0x9003,
1392	WMI_FW_VER_EVENTID				= 0x9004,
1393	WMI_ACS_PASSIVE_SCAN_COMPLETE_EVENTID		= 0x9005,
 
1394	WMI_COMMAND_NOT_SUPPORTED_EVENTID		= 0xFFFF,
1395};
1396
1397/* Events data structures */
1398enum wmi_fw_status {
1399	WMI_FW_STATUS_SUCCESS	= 0x00,
1400	WMI_FW_STATUS_FAILURE	= 0x01,
1401};
1402
1403/* WMI_RF_MGMT_STATUS_EVENTID */
1404enum wmi_rf_status {
1405	WMI_RF_ENABLED		= 0x00,
1406	WMI_RF_DISABLED_HW	= 0x01,
1407	WMI_RF_DISABLED_SW	= 0x02,
1408	WMI_RF_DISABLED_HW_SW	= 0x03,
1409};
1410
1411/* WMI_RF_MGMT_STATUS_EVENTID */
1412struct wmi_rf_mgmt_status_event {
1413	__le32 rf_status;
1414} __packed;
1415
1416/* WMI_GET_STATUS_DONE_EVENTID */
1417struct wmi_get_status_done_event {
1418	__le32 is_associated;
1419	u8 cid;
1420	u8 reserved0[3];
1421	u8 bssid[WMI_MAC_LEN];
1422	u8 channel;
1423	u8 reserved1;
1424	u8 network_type;
1425	u8 reserved2[3];
1426	__le32 ssid_len;
1427	u8 ssid[WMI_MAX_SSID_LEN];
1428	__le32 rf_status;
1429	__le32 is_secured;
1430} __packed;
1431
1432/* WMI_FW_VER_EVENTID */
1433struct wmi_fw_ver_event {
1434	/* FW image version */
1435	__le32 fw_major;
1436	__le32 fw_minor;
1437	__le32 fw_subminor;
1438	__le32 fw_build;
1439	/* FW image build time stamp */
1440	__le32 hour;
1441	__le32 minute;
1442	__le32 second;
1443	__le32 day;
1444	__le32 month;
1445	__le32 year;
1446	/* Boot Loader image version */
1447	__le32 bl_major;
1448	__le32 bl_minor;
1449	__le32 bl_subminor;
1450	__le32 bl_build;
1451	/* The number of entries in the FW capabilities array */
1452	u8 fw_capabilities_len;
1453	u8 reserved[3];
1454	/* FW capabilities info
1455	 * Must be the last member of the struct
1456	 */
1457	__le32 fw_capabilities[0];
1458} __packed;
1459
1460/* WMI_GET_RF_STATUS_EVENTID */
1461enum rf_type {
1462	RF_UNKNOWN	= 0x00,
1463	RF_MARLON	= 0x01,
1464	RF_SPARROW	= 0x02,
 
 
1465};
1466
1467/* WMI_GET_RF_STATUS_EVENTID */
1468enum board_file_rf_type {
1469	BF_RF_MARLON	= 0x00,
1470	BF_RF_SPARROW	= 0x01,
 
 
1471};
1472
1473/* WMI_GET_RF_STATUS_EVENTID */
1474enum rf_status {
1475	RF_OK			= 0x00,
1476	RF_NO_COMM		= 0x01,
1477	RF_WRONG_BOARD_FILE	= 0x02,
1478};
1479
1480/* WMI_GET_RF_STATUS_EVENTID */
1481struct wmi_get_rf_status_event {
1482	/* enum rf_type */
1483	__le32 rf_type;
1484	/* attached RFs bit vector */
1485	__le32 attached_rf_vector;
1486	/* enabled RFs bit vector */
1487	__le32 enabled_rf_vector;
1488	/* enum rf_status, refers to enabled RFs */
1489	u8 rf_status[32];
1490	/* enum board file RF type */
1491	__le32 board_file_rf_type;
1492	/* board file platform type */
1493	__le32 board_file_platform_type;
1494	/* board file version */
1495	__le32 board_file_version;
1496	/* enabled XIFs bit vector */
1497	__le32 enabled_xif_vector;
1498	__le32 reserved;
1499} __packed;
1500
1501/* WMI_GET_BASEBAND_TYPE_EVENTID */
1502enum baseband_type {
1503	BASEBAND_UNKNOWN	= 0x00,
1504	BASEBAND_SPARROW_M_A0	= 0x03,
1505	BASEBAND_SPARROW_M_A1	= 0x04,
1506	BASEBAND_SPARROW_M_B0	= 0x05,
1507	BASEBAND_SPARROW_M_C0	= 0x06,
1508	BASEBAND_SPARROW_M_D0	= 0x07,
1509	BASEBAND_TALYN_M_A0	= 0x08,
 
1510};
1511
1512/* WMI_GET_BASEBAND_TYPE_EVENTID */
1513struct wmi_get_baseband_type_event {
1514	/* enum baseband_type */
1515	__le32 baseband_type;
1516} __packed;
1517
1518/* WMI_MAC_ADDR_RESP_EVENTID */
1519struct wmi_mac_addr_resp_event {
1520	u8 mac[WMI_MAC_LEN];
1521	u8 auth_mode;
1522	u8 crypt_mode;
1523	__le32 offload_mode;
1524} __packed;
1525
1526/* WMI_EAPOL_RX_EVENTID */
1527struct wmi_eapol_rx_event {
1528	u8 src_mac[WMI_MAC_LEN];
1529	__le16 eapol_len;
1530	u8 eapol[0];
1531} __packed;
1532
1533/* WMI_READY_EVENTID */
1534enum wmi_phy_capability {
1535	WMI_11A_CAPABILITY		= 0x01,
1536	WMI_11G_CAPABILITY		= 0x02,
1537	WMI_11AG_CAPABILITY		= 0x03,
1538	WMI_11NA_CAPABILITY		= 0x04,
1539	WMI_11NG_CAPABILITY		= 0x05,
1540	WMI_11NAG_CAPABILITY		= 0x06,
1541	WMI_11AD_CAPABILITY		= 0x07,
1542	WMI_11N_CAPABILITY_OFFSET	= 0x03,
1543};
1544
1545struct wmi_ready_event {
1546	__le32 sw_version;
1547	__le32 abi_version;
1548	u8 mac[WMI_MAC_LEN];
1549	/* enum wmi_phy_capability */
1550	u8 phy_capability;
1551	u8 numof_additional_mids;
1552	/* rfc read calibration result. 5..15 */
1553	u8 rfc_read_calib_result;
1554	u8 reserved[3];
 
 
 
 
1555} __packed;
1556
1557/* WMI_NOTIFY_REQ_DONE_EVENTID */
1558struct wmi_notify_req_done_event {
1559	/* beamforming status, 0: fail; 1: OK; 2: retrying */
1560	__le32 status;
1561	__le64 tsf;
1562	s8 rssi;
1563	u8 reserved0[3];
 
 
1564	__le32 tx_tpt;
1565	__le32 tx_goodput;
1566	__le32 rx_goodput;
1567	__le16 bf_mcs;
1568	__le16 my_rx_sector;
1569	__le16 my_tx_sector;
1570	__le16 other_rx_sector;
1571	__le16 other_tx_sector;
1572	__le16 range;
1573	u8 sqi;
1574	u8 reserved[3];
1575} __packed;
1576
1577/* WMI_CONNECT_EVENTID */
1578struct wmi_connect_event {
 
 
 
1579	u8 channel;
1580	u8 reserved0;
 
1581	u8 bssid[WMI_MAC_LEN];
1582	__le16 listen_interval;
1583	__le16 beacon_interval;
1584	u8 network_type;
1585	u8 reserved1[3];
1586	u8 beacon_ie_len;
1587	u8 assoc_req_len;
1588	u8 assoc_resp_len;
1589	u8 cid;
1590	u8 aid;
1591	u8 reserved2[2];
1592	/* not in use */
1593	u8 assoc_info[0];
1594} __packed;
1595
1596/* disconnect_reason */
1597enum wmi_disconnect_reason {
1598	WMI_DIS_REASON_NO_NETWORK_AVAIL		= 0x01,
1599	/* bmiss */
1600	WMI_DIS_REASON_LOST_LINK		= 0x02,
1601	WMI_DIS_REASON_DISCONNECT_CMD		= 0x03,
1602	WMI_DIS_REASON_BSS_DISCONNECTED		= 0x04,
1603	WMI_DIS_REASON_AUTH_FAILED		= 0x05,
1604	WMI_DIS_REASON_ASSOC_FAILED		= 0x06,
1605	WMI_DIS_REASON_NO_RESOURCES_AVAIL	= 0x07,
1606	WMI_DIS_REASON_CSERV_DISCONNECT		= 0x08,
1607	WMI_DIS_REASON_INVALID_PROFILE		= 0x0A,
1608	WMI_DIS_REASON_DOT11H_CHANNEL_SWITCH	= 0x0B,
1609	WMI_DIS_REASON_PROFILE_MISMATCH		= 0x0C,
1610	WMI_DIS_REASON_CONNECTION_EVICTED	= 0x0D,
1611	WMI_DIS_REASON_IBSS_MERGE		= 0x0E,
 
1612};
1613
1614/* WMI_DISCONNECT_EVENTID */
1615struct wmi_disconnect_event {
1616	/* reason code, see 802.11 spec. */
1617	__le16 protocol_reason_status;
1618	/* set if known */
1619	u8 bssid[WMI_MAC_LEN];
1620	/* see enum wmi_disconnect_reason */
1621	u8 disconnect_reason;
1622	/* last assoc req may passed to host - not in used */
1623	u8 assoc_resp_len;
1624	/* last assoc req may passed to host - not in used */
1625	u8 assoc_info[0];
1626} __packed;
1627
1628/* WMI_SCAN_COMPLETE_EVENTID */
1629enum scan_status {
1630	WMI_SCAN_SUCCESS	= 0x00,
1631	WMI_SCAN_FAILED		= 0x01,
1632	WMI_SCAN_ABORTED	= 0x02,
1633	WMI_SCAN_REJECTED	= 0x03,
1634	WMI_SCAN_ABORT_REJECTED	= 0x04,
1635};
1636
1637struct wmi_scan_complete_event {
1638	/* enum scan_status */
1639	__le32 status;
1640} __packed;
1641
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1642/* wmi_rx_mgmt_info */
1643struct wmi_rx_mgmt_info {
1644	u8 mcs;
1645	s8 rssi;
1646	u8 range;
1647	u8 sqi;
1648	__le16 stype;
1649	__le16 status;
1650	__le32 len;
1651	/* Not resolved when == 0xFFFFFFFF == > Broadcast to all MIDS */
1652	u8 qid;
1653	/* Not resolved when == 0xFFFFFFFF == > Broadcast to all MIDS */
1654	u8 mid;
1655	u8 cid;
1656	/* From Radio MNGR */
1657	u8 channel;
1658} __packed;
1659
1660/* WMI_START_SCHED_SCAN_EVENTID */
1661enum wmi_pno_result {
1662	WMI_PNO_SUCCESS			= 0x00,
1663	WMI_PNO_REJECT			= 0x01,
1664	WMI_PNO_INVALID_PARAMETERS	= 0x02,
1665	WMI_PNO_NOT_ENABLED		= 0x03,
1666};
1667
1668struct wmi_start_sched_scan_event {
1669	/* pno_result */
1670	u8 result;
1671	u8 reserved[3];
1672} __packed;
1673
1674struct wmi_stop_sched_scan_event {
1675	/* pno_result */
1676	u8 result;
1677	u8 reserved[3];
1678} __packed;
1679
1680struct wmi_sched_scan_result_event {
1681	struct wmi_rx_mgmt_info info;
1682	u8 payload[0];
1683} __packed;
1684
1685/* WMI_ACS_PASSIVE_SCAN_COMPLETE_EVENT */
1686enum wmi_acs_info_bitmask {
1687	WMI_ACS_INFO_BITMASK_BEACON_FOUND	= 0x01,
1688	WMI_ACS_INFO_BITMASK_BUSY_TIME		= 0x02,
1689	WMI_ACS_INFO_BITMASK_TX_TIME		= 0x04,
1690	WMI_ACS_INFO_BITMASK_RX_TIME		= 0x08,
1691	WMI_ACS_INFO_BITMASK_NOISE		= 0x10,
1692};
1693
1694struct scan_acs_info {
1695	u8 channel;
1696	u8 beacon_found;
1697	/* msec */
1698	__le16 busy_time;
1699	__le16 tx_time;
1700	__le16 rx_time;
1701	u8 noise;
1702	u8 reserved[3];
1703} __packed;
1704
1705struct wmi_acs_passive_scan_complete_event {
1706	__le32 dwell_time;
1707	/* valid fields within channel info according to
1708	 * their appearance in struct order
1709	 */
1710	__le16 filled;
1711	u8 num_scanned_channels;
1712	u8 reserved;
1713	struct scan_acs_info scan_info_list[0];
1714} __packed;
1715
1716/* WMI_BA_STATUS_EVENTID */
1717enum wmi_vring_ba_status {
1718	WMI_BA_AGREED			= 0x00,
1719	WMI_BA_NON_AGREED		= 0x01,
1720	/* BA_EN in middle of teardown flow */
1721	WMI_BA_TD_WIP			= 0x02,
1722	/* BA_DIS or BA_EN in middle of BA SETUP flow */
1723	WMI_BA_SETUP_WIP		= 0x03,
1724	/* BA_EN when the BA session is already active */
1725	WMI_BA_SESSION_ACTIVE		= 0x04,
1726	/* BA_DIS when the BA session is not active */
1727	WMI_BA_SESSION_NOT_ACTIVE	= 0x05,
1728};
1729
1730struct wmi_ba_status_event {
1731	/* enum wmi_vring_ba_status */
1732	__le16 status;
1733	u8 reserved[2];
1734	u8 ringid;
1735	u8 agg_wsize;
1736	__le16 ba_timeout;
1737	u8 amsdu;
1738} __packed;
1739
1740/* WMI_DELBA_EVENTID */
1741struct wmi_delba_event {
 
 
 
1742	u8 cidxtid;
1743	u8 from_initiator;
1744	__le16 reason;
 
 
 
 
 
1745} __packed;
1746
1747/* WMI_VRING_CFG_DONE_EVENTID */
1748struct wmi_vring_cfg_done_event {
1749	u8 ringid;
1750	u8 status;
1751	u8 reserved[2];
1752	__le32 tx_vring_tail_ptr;
1753} __packed;
1754
1755/* WMI_RCP_ADDBA_RESP_SENT_EVENTID */
1756struct wmi_rcp_addba_resp_sent_event {
 
 
 
1757	u8 cidxtid;
1758	u8 reserved;
1759	__le16 status;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1760} __packed;
1761
1762/* WMI_RCP_ADDBA_REQ_EVENTID */
1763struct wmi_rcp_addba_req_event {
 
 
 
1764	u8 cidxtid;
1765	u8 dialog_token;
1766	/* ieee80211_ba_parameterset as it received */
1767	__le16 ba_param_set;
1768	__le16 ba_timeout;
1769	/* ieee80211_ba_seqstrl field as it received */
1770	__le16 ba_seq_ctrl;
 
 
 
 
 
1771} __packed;
1772
1773/* WMI_CFG_RX_CHAIN_DONE_EVENTID */
1774enum wmi_cfg_rx_chain_done_event_status {
1775	WMI_CFG_RX_CHAIN_SUCCESS	= 0x01,
1776};
1777
1778struct wmi_cfg_rx_chain_done_event {
1779	/* V-Ring Tail pointer */
1780	__le32 rx_ring_tail_ptr;
1781	__le32 status;
1782} __packed;
1783
1784/* WMI_WBE_LINK_DOWN_EVENTID */
1785enum wmi_wbe_link_down_event_reason {
1786	WMI_WBE_REASON_USER_REQUEST	= 0x00,
1787	WMI_WBE_REASON_RX_DISASSOC	= 0x01,
1788	WMI_WBE_REASON_BAD_PHY_LINK	= 0x02,
1789};
1790
1791/* WMI_WBE_LINK_DOWN_EVENTID */
1792struct wmi_wbe_link_down_event {
1793	u8 cid;
1794	u8 reserved[3];
1795	__le32 reason;
1796} __packed;
1797
1798/* WMI_DATA_PORT_OPEN_EVENTID */
1799struct wmi_data_port_open_event {
1800	u8 cid;
1801	u8 reserved[3];
1802} __packed;
1803
1804/* WMI_VRING_EN_EVENTID */
1805struct wmi_vring_en_event {
1806	u8 vring_index;
1807	u8 reserved[3];
1808} __packed;
1809
1810/* WMI_GET_PCP_CHANNEL_EVENTID */
1811struct wmi_get_pcp_channel_event {
1812	u8 channel;
1813	u8 reserved[3];
1814} __packed;
1815
1816/* WMI_P2P_CFG_DONE_EVENTID */
1817struct wmi_p2p_cfg_done_event {
1818	/* wmi_fw_status */
1819	u8 status;
1820	u8 reserved[3];
1821} __packed;
1822
1823/* WMI_PORT_ALLOCATED_EVENTID */
1824struct wmi_port_allocated_event {
1825	/* wmi_fw_status */
1826	u8 status;
1827	u8 reserved[3];
1828} __packed;
1829
1830/* WMI_PORT_DELETED_EVENTID */
1831struct wmi_port_deleted_event {
1832	/* wmi_fw_status */
1833	u8 status;
1834	u8 reserved[3];
1835} __packed;
1836
1837/* WMI_LISTEN_STARTED_EVENTID */
1838struct wmi_listen_started_event {
1839	/* wmi_fw_status */
1840	u8 status;
1841	u8 reserved[3];
1842} __packed;
1843
1844/* WMI_SEARCH_STARTED_EVENTID */
1845struct wmi_search_started_event {
1846	/* wmi_fw_status */
1847	u8 status;
1848	u8 reserved[3];
1849} __packed;
1850
1851/* WMI_PCP_STARTED_EVENTID */
1852struct wmi_pcp_started_event {
1853	/* wmi_fw_status */
1854	u8 status;
1855	u8 reserved[3];
1856} __packed;
1857
1858/* WMI_PCP_FACTOR_EVENTID */
1859struct wmi_pcp_factor_event {
1860	__le32 pcp_factor;
1861} __packed;
1862
1863enum wmi_sw_tx_status {
1864	WMI_TX_SW_STATUS_SUCCESS		= 0x00,
1865	WMI_TX_SW_STATUS_FAILED_NO_RESOURCES	= 0x01,
1866	WMI_TX_SW_STATUS_FAILED_TX		= 0x02,
1867};
1868
1869/* WMI_SW_TX_COMPLETE_EVENTID */
1870struct wmi_sw_tx_complete_event {
1871	/* enum wmi_sw_tx_status */
1872	u8 status;
1873	u8 reserved[3];
1874} __packed;
1875
1876/* WMI_CORR_MEASURE_EVENTID - deprecated */
1877struct wmi_corr_measure_event {
1878	/* signed */
1879	__le32 i;
1880	/* signed */
1881	__le32 q;
1882	/* signed */
1883	__le32 image_i;
1884	/* signed */
1885	__le32 image_q;
1886} __packed;
1887
1888/* WMI_READ_RSSI_EVENTID */
1889struct wmi_read_rssi_event {
1890	__le32 ina_rssi_adc_dbm;
1891} __packed;
1892
1893/* WMI_GET_SSID_EVENTID */
1894struct wmi_get_ssid_event {
1895	__le32 ssid_len;
1896	u8 ssid[WMI_MAX_SSID_LEN];
1897} __packed;
1898
1899/* EVENT: WMI_RF_XPM_READ_RESULT_EVENTID */
1900struct wmi_rf_xpm_read_result_event {
1901	/* enum wmi_fw_status_e - success=0 or fail=1 */
1902	u8 status;
1903	u8 reserved[3];
1904	/* requested num_bytes of data */
1905	u8 data_bytes[0];
1906} __packed;
1907
1908/* EVENT: WMI_RF_XPM_WRITE_RESULT_EVENTID */
1909struct wmi_rf_xpm_write_result_event {
1910	/* enum wmi_fw_status_e - success=0 or fail=1 */
1911	u8 status;
1912	u8 reserved[3];
1913} __packed;
1914
1915/* WMI_TX_MGMT_PACKET_EVENTID */
1916struct wmi_tx_mgmt_packet_event {
1917	u8 payload[0];
1918} __packed;
1919
1920/* WMI_RX_MGMT_PACKET_EVENTID */
1921struct wmi_rx_mgmt_packet_event {
1922	struct wmi_rx_mgmt_info info;
1923	u8 payload[0];
1924} __packed;
1925
1926/* WMI_ECHO_RSP_EVENTID */
1927struct wmi_echo_rsp_event {
1928	__le32 echoed_value;
1929} __packed;
1930
 
 
 
 
 
1931/* WMI_RF_PWR_ON_DELAY_RSP_EVENTID */
1932struct wmi_rf_pwr_on_delay_rsp_event {
1933	/* wmi_fw_status */
1934	u8 status;
1935	u8 reserved[3];
1936} __packed;
1937
1938/* WMI_SET_HIGH_POWER_TABLE_PARAMS_EVENTID */
1939struct wmi_set_high_power_table_params_event {
1940	/* wmi_fw_status */
1941	u8 status;
1942	u8 reserved[3];
1943} __packed;
1944
 
 
 
 
 
 
 
1945/* WMI_TEMP_SENSE_DONE_EVENTID
1946 *
1947 * Measure MAC and radio temperatures
1948 */
1949struct wmi_temp_sense_done_event {
1950	/* Temperature times 1000 (actual temperature will be achieved by
1951	 * dividing the value by 1000)
 
1952	 */
1953	__le32 baseband_t1000;
1954	/* Temperature times 1000 (actual temperature will be achieved by
1955	 * dividing the value by 1000)
 
1956	 */
1957	__le32 rf_t1000;
1958} __packed;
1959
1960#define WMI_SCAN_DWELL_TIME_MS	(100)
1961#define WMI_SURVEY_TIMEOUT_MS	(10000)
1962
1963enum wmi_hidden_ssid {
1964	WMI_HIDDEN_SSID_DISABLED	= 0x00,
1965	WMI_HIDDEN_SSID_SEND_EMPTY	= 0x10,
1966	WMI_HIDDEN_SSID_CLEAR		= 0xFE,
1967};
1968
1969/* WMI_LED_CFG_CMDID
1970 *
1971 * Configure LED On\Off\Blinking operation
1972 *
1973 * Returned events:
1974 * - WMI_LED_CFG_DONE_EVENTID
1975 */
1976enum led_mode {
1977	LED_DISABLE	= 0x00,
1978	LED_ENABLE	= 0x01,
1979};
1980
1981/* The names of the led as
1982 * described on HW schemes.
1983 */
1984enum wmi_led_id {
1985	WMI_LED_WLAN	= 0x00,
1986	WMI_LED_WPAN	= 0x01,
1987	WMI_LED_WWAN	= 0x02,
1988};
1989
1990/* Led polarity mode. */
1991enum wmi_led_polarity {
1992	LED_POLARITY_HIGH_ACTIVE	= 0x00,
1993	LED_POLARITY_LOW_ACTIVE		= 0x01,
1994};
1995
1996/* Combination of on and off
1997 * creates the blinking period
1998 */
1999struct wmi_led_blink_mode {
2000	__le32 blink_on;
2001	__le32 blink_off;
2002} __packed;
2003
2004/* WMI_LED_CFG_CMDID */
2005struct wmi_led_cfg_cmd {
2006	/* enum led_mode_e */
2007	u8 led_mode;
2008	/* enum wmi_led_id_e */
2009	u8 id;
2010	/* slow speed blinking combination */
2011	struct wmi_led_blink_mode slow_blink_cfg;
2012	/* medium speed blinking combination */
2013	struct wmi_led_blink_mode medium_blink_cfg;
2014	/* high speed blinking combination */
2015	struct wmi_led_blink_mode fast_blink_cfg;
2016	/* polarity of the led */
2017	u8 led_polarity;
2018	/* reserved */
2019	u8 reserved;
2020} __packed;
2021
2022/* \WMI_SET_CONNECT_SNR_THR_CMDID */
2023struct wmi_set_connect_snr_thr_cmd {
2024	u8 enable;
2025	u8 reserved;
2026	/* 1/4 Db units */
2027	__le16 omni_snr_thr;
2028	/* 1/4 Db units */
2029	__le16 direct_snr_thr;
2030} __packed;
2031
2032/* WMI_LED_CFG_DONE_EVENTID */
2033struct wmi_led_cfg_done_event {
2034	/* led config status */
2035	__le32 status;
2036} __packed;
2037
2038/* Rate search parameters configuration per connection */
2039struct wmi_rs_cfg {
2040	/* The maximal allowed PER for each MCS
2041	 * MCS will be considered as failed if PER during RS is higher
2042	 */
2043	u8 per_threshold[WMI_NUM_MCS];
2044	/* Number of MPDUs for each MCS
2045	 * this is the minimal statistic required to make an educated
2046	 * decision
2047	 */
2048	u8 min_frame_cnt[WMI_NUM_MCS];
2049	/* stop threshold [0-100] */
2050	u8 stop_th;
2051	/* MCS1 stop threshold [0-100] */
2052	u8 mcs1_fail_th;
2053	u8 max_back_failure_th;
2054	/* Debug feature for disabling internal RS trigger (which is
2055	 * currently triggered by BF Done)
2056	 */
2057	u8 dbg_disable_internal_trigger;
2058	__le32 back_failure_mask;
2059	__le32 mcs_en_vec;
2060} __packed;
2061
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2062/* Slot types */
2063enum wmi_sched_scheme_slot_type {
2064	WMI_SCHED_SLOT_SP		= 0x0,
2065	WMI_SCHED_SLOT_CBAP		= 0x1,
2066	WMI_SCHED_SLOT_IDLE		= 0x2,
2067	WMI_SCHED_SLOT_ANNOUNCE_NO_ACK	= 0x3,
2068	WMI_SCHED_SLOT_DISCOVERY	= 0x4,
2069};
2070
2071enum wmi_sched_scheme_slot_flags {
2072	WMI_SCHED_SCHEME_SLOT_PERIODIC	= 0x1,
2073};
2074
2075struct wmi_sched_scheme_slot {
2076	/* in microsecond */
2077	__le32 tbtt_offset;
2078	/* wmi_sched_scheme_slot_flags */
2079	u8 flags;
2080	/* wmi_sched_scheme_slot_type */
2081	u8 type;
2082	/* in microsecond */
2083	__le16 duration;
2084	/* frame_exchange_sequence_duration */
2085	__le16 tx_op;
2086	/* time in microseconds between two consecutive slots
2087	 * relevant only if flag WMI_SCHED_SCHEME_SLOT_PERIODIC set
2088	 */
2089	__le16 period;
2090	/* relevant only if flag WMI_SCHED_SCHEME_SLOT_PERIODIC set
2091	 * number of times to repeat allocation
2092	 */
2093	u8 num_of_blocks;
2094	/* relevant only if flag WMI_SCHED_SCHEME_SLOT_PERIODIC set
2095	 * every idle_period allocation will be idle
2096	 */
2097	u8 idle_period;
2098	u8 src_aid;
2099	u8 dest_aid;
2100	__le32 reserved;
2101} __packed;
2102
2103enum wmi_sched_scheme_flags {
2104	/* should not be set when clearing scheduling scheme */
2105	WMI_SCHED_SCHEME_ENABLE		= 0x01,
2106	WMI_SCHED_PROTECTED_SP		= 0x02,
2107	/* should be set only on first WMI fragment of scheme */
2108	WMI_SCHED_FIRST			= 0x04,
2109	/* should be set only on last WMI fragment of scheme */
2110	WMI_SCHED_LAST			= 0x08,
2111	WMI_SCHED_IMMEDIATE_START	= 0x10,
2112};
2113
2114enum wmi_sched_scheme_advertisment {
2115	/* ESE is not advertised at all, STA has to be configured with WMI
2116	 * also
2117	 */
2118	WMI_ADVERTISE_ESE_DISABLED		= 0x0,
2119	WMI_ADVERTISE_ESE_IN_BEACON		= 0x1,
2120	WMI_ADVERTISE_ESE_IN_ANNOUNCE_FRAME	= 0x2,
2121};
2122
2123/* WMI_SCHEDULING_SCHEME_CMD */
2124struct wmi_scheduling_scheme_cmd {
2125	u8 serial_num;
2126	/* wmi_sched_scheme_advertisment */
2127	u8 ese_advertisment;
2128	/* wmi_sched_scheme_flags */
2129	__le16 flags;
2130	u8 num_allocs;
2131	u8 reserved[3];
2132	__le64 start_tbtt;
2133	/* allocations list */
2134	struct wmi_sched_scheme_slot allocs[WMI_SCHED_MAX_ALLOCS_PER_CMD];
2135} __packed;
2136
2137enum wmi_sched_scheme_failure_type {
2138	WMI_SCHED_SCHEME_FAILURE_NO_ERROR		= 0x00,
2139	WMI_SCHED_SCHEME_FAILURE_OLD_START_TSF_ERR	= 0x01,
2140};
2141
2142/* WMI_SCHEDULING_SCHEME_EVENTID */
2143struct wmi_scheduling_scheme_event {
2144	/* wmi_fw_status_e */
2145	u8 status;
2146	/* serial number given in command */
2147	u8 serial_num;
2148	/* wmi_sched_scheme_failure_type */
2149	u8 failure_type;
2150	/* alignment to 32b */
2151	u8 reserved[1];
2152} __packed;
2153
2154/* WMI_RS_CFG_CMDID */
2155struct wmi_rs_cfg_cmd {
2156	/* connection id */
2157	u8 cid;
2158	/* enable or disable rate search */
2159	u8 rs_enable;
2160	/* rate search configuration */
2161	struct wmi_rs_cfg rs_cfg;
2162} __packed;
2163
2164/* WMI_RS_CFG_DONE_EVENTID */
2165struct wmi_rs_cfg_done_event {
2166	u8 cid;
2167	/* enum wmi_fw_status */
2168	u8 status;
2169	u8 reserved[2];
2170} __packed;
2171
2172/* WMI_GET_DETAILED_RS_RES_CMDID */
2173struct wmi_get_detailed_rs_res_cmd {
2174	/* connection id */
2175	u8 cid;
2176	u8 reserved[3];
2177} __packed;
2178
2179/* RS results status */
2180enum wmi_rs_results_status {
2181	WMI_RS_RES_VALID	= 0x00,
2182	WMI_RS_RES_INVALID	= 0x01,
2183};
2184
2185/* Rate search results */
2186struct wmi_rs_results {
2187	/* number of sent MPDUs */
2188	u8 num_of_tx_pkt[WMI_NUM_MCS];
2189	/* number of non-acked MPDUs */
2190	u8 num_of_non_acked_pkt[WMI_NUM_MCS];
2191	/* RS timestamp */
2192	__le32 tsf;
2193	/* RS selected MCS */
2194	u8 mcs;
2195} __packed;
2196
2197/* WMI_GET_DETAILED_RS_RES_EVENTID */
2198struct wmi_get_detailed_rs_res_event {
2199	u8 cid;
2200	/* enum wmi_rs_results_status */
2201	u8 status;
2202	/* detailed rs results */
2203	struct wmi_rs_results rs_results;
2204	u8 reserved[3];
2205} __packed;
2206
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2207/* BRP antenna limit mode */
2208enum wmi_brp_ant_limit_mode {
2209	/* Disable BRP force antenna limit */
2210	WMI_BRP_ANT_LIMIT_MODE_DISABLE		= 0x00,
2211	/* Define maximal antennas limit. Only effective antennas will be
2212	 * actually used
2213	 */
2214	WMI_BRP_ANT_LIMIT_MODE_EFFECTIVE	= 0x01,
2215	/* Force a specific number of antennas */
2216	WMI_BRP_ANT_LIMIT_MODE_FORCE		= 0x02,
2217	/* number of BRP antenna limit modes */
2218	WMI_BRP_ANT_LIMIT_MODES_NUM		= 0x03,
2219};
2220
2221/* WMI_BRP_SET_ANT_LIMIT_CMDID */
2222struct wmi_brp_set_ant_limit_cmd {
2223	/* connection id */
2224	u8 cid;
2225	/* enum wmi_brp_ant_limit_mode */
2226	u8 limit_mode;
2227	/* antenna limit count, 1-27
2228	 * disable_mode - ignored
2229	 * effective_mode - upper limit to number of antennas to be used
2230	 * force_mode - exact number of antennas to be used
2231	 */
2232	u8 ant_limit;
2233	u8 reserved;
2234} __packed;
2235
2236/* WMI_BRP_SET_ANT_LIMIT_EVENTID */
2237struct wmi_brp_set_ant_limit_event {
2238	/* wmi_fw_status */
2239	u8 status;
2240	u8 reserved[3];
2241} __packed;
2242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2243/* broadcast connection ID */
2244#define WMI_LINK_MAINTAIN_CFG_CID_BROADCAST	(0xFFFFFFFF)
2245
2246/* Types wmi_link_maintain_cfg presets for WMI_LINK_MAINTAIN_CFG_WRITE_CMD */
2247enum wmi_link_maintain_cfg_type {
2248	/* AP/PCP default normal (non-FST) configuration settings */
2249	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_NORMAL_AP	= 0x00,
2250	/* AP/PCP  default FST configuration settings */
2251	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_FST_AP	= 0x01,
2252	/* STA default normal (non-FST) configuration settings */
2253	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_NORMAL_STA	= 0x02,
2254	/* STA default FST configuration settings */
2255	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_FST_STA	= 0x03,
2256	/* custom configuration settings */
2257	WMI_LINK_MAINTAIN_CFG_TYPE_CUSTOM		= 0x04,
2258	/* number of defined configuration types */
2259	WMI_LINK_MAINTAIN_CFG_TYPES_NUM			= 0x05,
2260};
2261
2262/* Response status codes for WMI_LINK_MAINTAIN_CFG_WRITE/READ commands */
2263enum wmi_link_maintain_cfg_response_status {
2264	/* WMI_LINK_MAINTAIN_CFG_WRITE/READ command successfully accomplished
2265	 */
2266	WMI_LINK_MAINTAIN_CFG_RESPONSE_STATUS_OK		= 0x00,
2267	/* ERROR due to bad argument in WMI_LINK_MAINTAIN_CFG_WRITE/READ
2268	 * command request
2269	 */
2270	WMI_LINK_MAINTAIN_CFG_RESPONSE_STATUS_BAD_ARGUMENT	= 0x01,
2271};
2272
2273/* Link Loss and Keep Alive configuration */
2274struct wmi_link_maintain_cfg {
2275	/* link_loss_enable_detectors_vec */
2276	__le32 link_loss_enable_detectors_vec;
2277	/* detectors check period usec */
2278	__le32 check_link_loss_period_usec;
2279	/* max allowed tx ageing */
2280	__le32 tx_ageing_threshold_usec;
2281	/* keep alive period for high SNR */
2282	__le32 keep_alive_period_usec_high_snr;
2283	/* keep alive period for low SNR */
2284	__le32 keep_alive_period_usec_low_snr;
2285	/* lower snr limit for keep alive period update */
2286	__le32 keep_alive_snr_threshold_low_db;
2287	/* upper snr limit for keep alive period update */
2288	__le32 keep_alive_snr_threshold_high_db;
2289	/* num of successive bad bcons causing link-loss */
2290	__le32 bad_beacons_num_threshold;
2291	/* SNR limit for bad_beacons_detector */
2292	__le32 bad_beacons_snr_threshold_db;
 
 
2293} __packed;
2294
2295/* WMI_LINK_MAINTAIN_CFG_WRITE_CMDID */
2296struct wmi_link_maintain_cfg_write_cmd {
2297	/* enum wmi_link_maintain_cfg_type_e - type of requested default
2298	 * configuration to be applied
2299	 */
2300	__le32 cfg_type;
2301	/* requested connection ID or WMI_LINK_MAINTAIN_CFG_CID_BROADCAST */
2302	__le32 cid;
2303	/* custom configuration settings to be applied (relevant only if
2304	 * cfg_type==WMI_LINK_MAINTAIN_CFG_TYPE_CUSTOM)
2305	 */
2306	struct wmi_link_maintain_cfg lm_cfg;
2307} __packed;
2308
2309/* WMI_LINK_MAINTAIN_CFG_READ_CMDID */
2310struct wmi_link_maintain_cfg_read_cmd {
2311	/* connection ID which configuration settings are requested */
2312	__le32 cid;
2313} __packed;
2314
2315/* WMI_LINK_MAINTAIN_CFG_WRITE_DONE_EVENTID */
2316struct wmi_link_maintain_cfg_write_done_event {
2317	/* requested connection ID */
2318	__le32 cid;
2319	/* wmi_link_maintain_cfg_response_status_e - write status */
2320	__le32 status;
2321} __packed;
2322
2323/* \WMI_LINK_MAINTAIN_CFG_READ_DONE_EVENT */
2324struct wmi_link_maintain_cfg_read_done_event {
2325	/* requested connection ID */
2326	__le32 cid;
2327	/* wmi_link_maintain_cfg_response_status_e - read status */
2328	__le32 status;
2329	/* Retrieved configuration settings */
2330	struct wmi_link_maintain_cfg lm_cfg;
2331} __packed;
2332
2333enum wmi_traffic_suspend_status {
2334	WMI_TRAFFIC_SUSPEND_APPROVED			= 0x0,
2335	WMI_TRAFFIC_SUSPEND_REJECTED_LINK_NOT_IDLE	= 0x1,
 
 
2336};
2337
2338/* WMI_TRAFFIC_SUSPEND_EVENTID */
2339struct wmi_traffic_suspend_event {
2340	/* enum wmi_traffic_suspend_status_e */
2341	u8 status;
2342} __packed;
2343
2344enum wmi_traffic_resume_status {
2345	WMI_TRAFFIC_RESUME_SUCCESS	= 0x0,
2346	WMI_TRAFFIC_RESUME_FAILED	= 0x1,
2347};
2348
2349enum wmi_resume_trigger {
2350	WMI_RESUME_TRIGGER_UNKNOWN	= 0x0,
2351	WMI_RESUME_TRIGGER_HOST		= 0x1,
2352	WMI_RESUME_TRIGGER_UCAST_RX	= 0x2,
2353	WMI_RESUME_TRIGGER_BCAST_RX	= 0x4,
2354	WMI_RESUME_TRIGGER_WMI_EVT	= 0x8,
 
2355};
2356
2357/* WMI_TRAFFIC_RESUME_EVENTID */
2358struct wmi_traffic_resume_event {
2359	/* enum wmi_traffic_resume_status */
2360	u8 status;
2361	u8 reserved[3];
2362	/* enum wmi_resume_trigger bitmap */
2363	__le32 resume_triggers;
2364} __packed;
2365
2366/* Power Save command completion status codes */
2367enum wmi_ps_cfg_cmd_status {
2368	WMI_PS_CFG_CMD_STATUS_SUCCESS	= 0x00,
2369	WMI_PS_CFG_CMD_STATUS_BAD_PARAM	= 0x01,
2370	/* other error */
2371	WMI_PS_CFG_CMD_STATUS_ERROR	= 0x02,
2372};
2373
2374/* Device Power Save Profiles */
2375enum wmi_ps_profile_type {
2376	WMI_PS_PROFILE_TYPE_DEFAULT		= 0x00,
2377	WMI_PS_PROFILE_TYPE_PS_DISABLED		= 0x01,
2378	WMI_PS_PROFILE_TYPE_MAX_PS		= 0x02,
2379	WMI_PS_PROFILE_TYPE_LOW_LATENCY_PS	= 0x03,
2380};
2381
2382/* WMI_PS_DEV_PROFILE_CFG_READ_CMDID */
2383struct wmi_ps_dev_profile_cfg_read_cmd {
2384	/* reserved */
2385	__le32 reserved;
2386} __packed;
2387
2388/* WMI_PS_DEV_PROFILE_CFG_READ_EVENTID */
2389struct wmi_ps_dev_profile_cfg_read_event {
2390	/* wmi_ps_profile_type_e */
2391	u8 ps_profile;
2392	u8 reserved[3];
2393} __packed;
2394
2395/* WMI_PS_DEV_PROFILE_CFG_CMDID
2396 *
2397 * Power save profile to be used by the device
2398 *
2399 * Returned event:
2400 * - WMI_PS_DEV_PROFILE_CFG_EVENTID
2401 */
2402struct wmi_ps_dev_profile_cfg_cmd {
2403	/* wmi_ps_profile_type_e */
2404	u8 ps_profile;
2405	u8 reserved[3];
2406} __packed;
2407
2408/* WMI_PS_DEV_PROFILE_CFG_EVENTID */
2409struct wmi_ps_dev_profile_cfg_event {
2410	/* wmi_ps_cfg_cmd_status_e */
2411	__le32 status;
2412} __packed;
2413
2414enum wmi_ps_level {
2415	WMI_PS_LEVEL_DEEP_SLEEP		= 0x00,
2416	WMI_PS_LEVEL_SHALLOW_SLEEP	= 0x01,
2417	/* awake = all PS mechanisms are disabled */
2418	WMI_PS_LEVEL_AWAKE		= 0x02,
2419};
2420
2421enum wmi_ps_deep_sleep_clk_level {
2422	/* 33k */
2423	WMI_PS_DEEP_SLEEP_CLK_LEVEL_RTC		= 0x00,
2424	/* 10k */
2425	WMI_PS_DEEP_SLEEP_CLK_LEVEL_OSC		= 0x01,
2426	/* @RTC Low latency */
2427	WMI_PS_DEEP_SLEEP_CLK_LEVEL_RTC_LT	= 0x02,
2428	WMI_PS_DEEP_SLEEP_CLK_LEVEL_XTAL	= 0x03,
2429	WMI_PS_DEEP_SLEEP_CLK_LEVEL_SYSCLK	= 0x04,
2430	/* Not Applicable */
2431	WMI_PS_DEEP_SLEEP_CLK_LEVEL_N_A		= 0xFF,
2432};
2433
2434/* Response by the FW to a D3 entry request */
2435enum wmi_ps_d3_resp_policy {
2436	WMI_PS_D3_RESP_POLICY_DEFAULT	= 0x00,
2437	/* debug -D3 req is always denied */
2438	WMI_PS_D3_RESP_POLICY_DENIED	= 0x01,
2439	/* debug -D3 req is always approved */
2440	WMI_PS_D3_RESP_POLICY_APPROVED	= 0x02,
2441};
2442
2443#define WMI_AOA_MAX_DATA_SIZE	(128)
2444
2445enum wmi_aoa_meas_status {
2446	WMI_AOA_MEAS_SUCCESS		= 0x00,
2447	WMI_AOA_MEAS_PEER_INCAPABLE	= 0x01,
2448	WMI_AOA_MEAS_FAILURE		= 0x02,
2449};
2450
2451/* WMI_AOA_MEAS_EVENTID */
2452struct wmi_aoa_meas_event {
2453	u8 mac_addr[WMI_MAC_LEN];
2454	/* channels IDs:
2455	 * 0 - 58320 MHz
2456	 * 1 - 60480 MHz
2457	 * 2 - 62640 MHz
2458	 */
2459	u8 channel;
2460	/* enum wmi_aoa_meas_type */
2461	u8 aoa_meas_type;
2462	/* Measurments are from RFs, defined by the mask */
2463	__le32 meas_rf_mask;
2464	/* enum wmi_aoa_meas_status */
2465	u8 meas_status;
2466	u8 reserved;
2467	/* Length of meas_data in bytes */
2468	__le16 length;
2469	u8 meas_data[WMI_AOA_MAX_DATA_SIZE];
2470} __packed;
2471
2472/* WMI_SET_MGMT_RETRY_LIMIT_EVENTID */
2473struct wmi_set_mgmt_retry_limit_event {
2474	/* enum wmi_fw_status */
2475	u8 status;
2476	/* alignment to 32b */
2477	u8 reserved[3];
2478} __packed;
2479
2480/* WMI_GET_MGMT_RETRY_LIMIT_EVENTID */
2481struct wmi_get_mgmt_retry_limit_event {
2482	/* MAC retransmit limit for mgmt frames */
2483	u8 mgmt_retry_limit;
2484	/* alignment to 32b */
2485	u8 reserved[3];
2486} __packed;
2487
2488/* WMI_TOF_GET_CAPABILITIES_EVENTID */
2489struct wmi_tof_get_capabilities_event {
2490	u8 ftm_capability;
2491	/* maximum supported number of destination to start TOF */
2492	u8 max_num_of_dest;
2493	/* maximum supported number of measurements per burst */
2494	u8 max_num_of_meas_per_burst;
2495	u8 reserved;
2496	/* maximum supported multi bursts */
2497	__le16 max_multi_bursts_sessions;
2498	/* maximum supported FTM burst duration , wmi_tof_burst_duration_e */
2499	__le16 max_ftm_burst_duration;
2500	/* AOA supported types */
2501	__le32 aoa_supported_types;
2502} __packed;
2503
2504/* WMI_SET_THERMAL_THROTTLING_CFG_EVENTID */
2505struct wmi_set_thermal_throttling_cfg_event {
2506	/* wmi_fw_status */
2507	u8 status;
2508	u8 reserved[3];
2509} __packed;
2510
2511/* WMI_GET_THERMAL_THROTTLING_CFG_EVENTID */
2512struct wmi_get_thermal_throttling_cfg_event {
2513	/* Status data */
2514	struct wmi_tt_data tt_data;
2515} __packed;
2516
2517enum wmi_tof_session_end_status {
2518	WMI_TOF_SESSION_END_NO_ERROR		= 0x00,
2519	WMI_TOF_SESSION_END_FAIL		= 0x01,
2520	WMI_TOF_SESSION_END_PARAMS_ERROR	= 0x02,
2521	WMI_TOF_SESSION_END_ABORTED		= 0x03,
 
2522};
2523
2524/* WMI_TOF_SESSION_END_EVENTID */
2525struct wmi_tof_session_end_event {
2526	/* FTM session ID */
2527	__le32 session_id;
2528	/* wmi_tof_session_end_status_e */
2529	u8 status;
2530	u8 reserved[3];
2531} __packed;
2532
2533/* WMI_TOF_SET_LCI_EVENTID */
2534struct wmi_tof_set_lci_event {
2535	/* enum wmi_fw_status */
2536	u8 status;
2537	u8 reserved[3];
2538} __packed;
2539
2540/* WMI_TOF_SET_LCR_EVENTID */
2541struct wmi_tof_set_lcr_event {
2542	/* enum wmi_fw_status */
2543	u8 status;
2544	u8 reserved[3];
2545} __packed;
2546
2547/* Responder FTM Results */
2548struct wmi_responder_ftm_res {
2549	u8 t1[6];
2550	u8 t2[6];
2551	u8 t3[6];
2552	u8 t4[6];
2553	__le16 tod_err;
2554	__le16 toa_err;
2555	__le16 tod_err_initiator;
2556	__le16 toa_err_initiator;
2557} __packed;
2558
2559enum wmi_tof_ftm_per_dest_res_status {
2560	WMI_PER_DEST_RES_NO_ERROR		= 0x00,
2561	WMI_PER_DEST_RES_TX_RX_FAIL		= 0x01,
2562	WMI_PER_DEST_RES_PARAM_DONT_MATCH	= 0x02,
2563};
2564
2565enum wmi_tof_ftm_per_dest_res_flags {
2566	WMI_PER_DEST_RES_REQ_START		= 0x01,
2567	WMI_PER_DEST_RES_BURST_REPORT_END	= 0x02,
2568	WMI_PER_DEST_RES_REQ_END		= 0x04,
2569	WMI_PER_DEST_RES_PARAM_UPDATE		= 0x08,
2570};
2571
2572/* WMI_TOF_FTM_PER_DEST_RES_EVENTID */
2573struct wmi_tof_ftm_per_dest_res_event {
2574	/* FTM session ID */
2575	__le32 session_id;
2576	/* destination MAC address */
2577	u8 dst_mac[WMI_MAC_LEN];
2578	/* wmi_tof_ftm_per_dest_res_flags_e */
2579	u8 flags;
2580	/* wmi_tof_ftm_per_dest_res_status_e */
2581	u8 status;
2582	/* responder ASAP */
2583	u8 responder_asap;
2584	/* responder number of FTM per burst */
2585	u8 responder_num_ftm_per_burst;
2586	/* responder number of FTM burst exponent */
2587	u8 responder_num_ftm_bursts_exp;
2588	/* responder burst duration ,wmi_tof_burst_duration_e */
2589	u8 responder_burst_duration;
2590	/* responder burst period, indicate interval between two consecutive
2591	 * burst instances, in units of 100 ms
2592	 */
2593	__le16 responder_burst_period;
2594	/* receive burst counter */
2595	__le16 bursts_cnt;
2596	/* tsf of responder start burst */
2597	__le32 tsf_sync;
2598	/* actual received ftm per burst */
2599	u8 actual_ftm_per_burst;
2600	/* Measurments are from RFs, defined by the mask */
2601	__le32 meas_rf_mask;
2602	u8 reserved0[3];
2603	struct wmi_responder_ftm_res responder_ftm_res[0];
2604} __packed;
2605
2606/* WMI_TOF_CFG_RESPONDER_EVENTID */
2607struct wmi_tof_cfg_responder_event {
2608	/* enum wmi_fw_status */
2609	u8 status;
2610	u8 reserved[3];
2611} __packed;
2612
2613enum wmi_tof_channel_info_type {
2614	WMI_TOF_CHANNEL_INFO_AOA		= 0x00,
2615	WMI_TOF_CHANNEL_INFO_LCI		= 0x01,
2616	WMI_TOF_CHANNEL_INFO_LCR		= 0x02,
2617	WMI_TOF_CHANNEL_INFO_VENDOR_SPECIFIC	= 0x03,
2618	WMI_TOF_CHANNEL_INFO_CIR		= 0x04,
2619	WMI_TOF_CHANNEL_INFO_RSSI		= 0x05,
2620	WMI_TOF_CHANNEL_INFO_SNR		= 0x06,
2621	WMI_TOF_CHANNEL_INFO_DEBUG		= 0x07,
2622};
2623
2624/* WMI_TOF_CHANNEL_INFO_EVENTID */
2625struct wmi_tof_channel_info_event {
2626	/* FTM session ID */
2627	__le32 session_id;
2628	/* destination MAC address */
2629	u8 dst_mac[WMI_MAC_LEN];
2630	/* wmi_tof_channel_info_type_e */
2631	u8 type;
2632	/* data report length */
2633	u8 len;
2634	/* data report payload */
2635	u8 report[0];
2636} __packed;
2637
2638/* WMI_TOF_SET_TX_RX_OFFSET_EVENTID */
2639struct wmi_tof_set_tx_rx_offset_event {
2640	/* enum wmi_fw_status */
2641	u8 status;
2642	u8 reserved[3];
2643} __packed;
2644
2645/* WMI_TOF_GET_TX_RX_OFFSET_EVENTID */
2646struct wmi_tof_get_tx_rx_offset_event {
2647	/* enum wmi_fw_status */
2648	u8 status;
2649	/* RF index used to read the offsets */
2650	u8 rf_index;
2651	u8 reserved1[2];
2652	/* TX delay offset */
2653	__le32 tx_offset;
2654	/* RX delay offset */
2655	__le32 rx_offset;
2656	/* Offset to strongest tap of CIR */
2657	__le32 precursor;
2658} __packed;
2659
2660/* Result status codes for WMI commands */
2661enum wmi_rf_sector_status {
2662	WMI_RF_SECTOR_STATUS_SUCCESS			= 0x00,
2663	WMI_RF_SECTOR_STATUS_BAD_PARAMETERS_ERROR	= 0x01,
2664	WMI_RF_SECTOR_STATUS_BUSY_ERROR			= 0x02,
2665	WMI_RF_SECTOR_STATUS_NOT_SUPPORTED_ERROR	= 0x03,
2666};
2667
2668/* Types of the RF sector (TX,RX) */
2669enum wmi_rf_sector_type {
2670	WMI_RF_SECTOR_TYPE_RX	= 0x00,
2671	WMI_RF_SECTOR_TYPE_TX	= 0x01,
2672};
2673
2674/* Content of RF Sector (six 32-bits registers) */
2675struct wmi_rf_sector_info {
2676	/* Phase values for RF Chains[15-0] (2bits per RF chain) */
2677	__le32 psh_hi;
2678	/* Phase values for RF Chains[31-16] (2bits per RF chain) */
2679	__le32 psh_lo;
2680	/* ETYPE Bit0 for all RF chains[31-0] - bit0 of Edge amplifier gain
2681	 * index
2682	 */
2683	__le32 etype0;
2684	/* ETYPE Bit1 for all RF chains[31-0] - bit1 of Edge amplifier gain
2685	 * index
2686	 */
2687	__le32 etype1;
2688	/* ETYPE Bit2 for all RF chains[31-0] - bit2 of Edge amplifier gain
2689	 * index
2690	 */
2691	__le32 etype2;
2692	/* D-Type values (3bits each) for 8 Distribution amplifiers + X16
2693	 * switch bits
2694	 */
2695	__le32 dtype_swch_off;
2696} __packed;
2697
2698#define WMI_INVALID_RF_SECTOR_INDEX	(0xFFFF)
2699#define WMI_MAX_RF_MODULES_NUM		(8)
2700
2701/* WMI_GET_RF_SECTOR_PARAMS_CMD */
2702struct wmi_get_rf_sector_params_cmd {
2703	/* Sector number to be retrieved */
2704	__le16 sector_idx;
2705	/* enum wmi_rf_sector_type - type of requested RF sector */
2706	u8 sector_type;
2707	/* bitmask vector specifying destination RF modules */
2708	u8 rf_modules_vec;
2709} __packed;
2710
2711/* \WMI_GET_RF_SECTOR_PARAMS_DONE_EVENT */
2712struct wmi_get_rf_sector_params_done_event {
2713	/* result status of WMI_GET_RF_SECTOR_PARAMS_CMD (enum
2714	 * wmi_rf_sector_status)
2715	 */
2716	u8 status;
2717	/* align next field to U64 boundary */
2718	u8 reserved[7];
2719	/* TSF timestamp when RF sectors where retrieved */
2720	__le64 tsf;
2721	/* Content of RF sector retrieved from each RF module */
2722	struct wmi_rf_sector_info sectors_info[WMI_MAX_RF_MODULES_NUM];
2723} __packed;
2724
2725/* WMI_SET_RF_SECTOR_PARAMS_CMD */
2726struct wmi_set_rf_sector_params_cmd {
2727	/* Sector number to be retrieved */
2728	__le16 sector_idx;
2729	/* enum wmi_rf_sector_type - type of requested RF sector */
2730	u8 sector_type;
2731	/* bitmask vector specifying destination RF modules */
2732	u8 rf_modules_vec;
2733	/* Content of RF sector to be written to each RF module */
2734	struct wmi_rf_sector_info sectors_info[WMI_MAX_RF_MODULES_NUM];
2735} __packed;
2736
2737/* \WMI_SET_RF_SECTOR_PARAMS_DONE_EVENT */
2738struct wmi_set_rf_sector_params_done_event {
2739	/* result status of WMI_SET_RF_SECTOR_PARAMS_CMD (enum
2740	 * wmi_rf_sector_status)
2741	 */
2742	u8 status;
2743} __packed;
2744
2745/* WMI_GET_SELECTED_RF_SECTOR_INDEX_CMD - Get RF sector index selected by
2746 * TXSS/BRP for communication with specified CID
2747 */
2748struct wmi_get_selected_rf_sector_index_cmd {
2749	/* Connection/Station ID in [0:7] range */
2750	u8 cid;
2751	/* type of requested RF sector (enum wmi_rf_sector_type) */
2752	u8 sector_type;
2753	/* align to U32 boundary */
2754	u8 reserved[2];
2755} __packed;
2756
2757/* \WMI_GET_SELECTED_RF_SECTOR_INDEX_DONE_EVENT - Returns retrieved RF sector
2758 * index selected by TXSS/BRP for communication with specified CID
2759 */
2760struct wmi_get_selected_rf_sector_index_done_event {
2761	/* Retrieved sector index selected in TXSS (for TX sector request) or
2762	 * BRP (for RX sector request)
2763	 */
2764	__le16 sector_idx;
2765	/* result status of WMI_GET_SELECTED_RF_SECTOR_INDEX_CMD (enum
2766	 * wmi_rf_sector_status)
2767	 */
2768	u8 status;
2769	/* align next field to U64 boundary */
2770	u8 reserved[5];
2771	/* TSF timestamp when result was retrieved */
2772	__le64 tsf;
2773} __packed;
2774
2775/* WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD - Force RF sector index for
2776 * communication with specified CID. Assumes that TXSS/BRP is disabled by
2777 * other command
2778 */
2779struct wmi_set_selected_rf_sector_index_cmd {
2780	/* Connection/Station ID in [0:7] range */
2781	u8 cid;
2782	/* type of requested RF sector (enum wmi_rf_sector_type) */
2783	u8 sector_type;
2784	/* Forced sector index */
2785	__le16 sector_idx;
2786} __packed;
2787
2788/* \WMI_SET_SELECTED_RF_SECTOR_INDEX_DONE_EVENT - Success/Fail status for
2789 * WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD
2790 */
2791struct wmi_set_selected_rf_sector_index_done_event {
2792	/* result status of WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD (enum
2793	 * wmi_rf_sector_status)
2794	 */
2795	u8 status;
2796	/* align to U32 boundary */
2797	u8 reserved[3];
2798} __packed;
2799
2800/* WMI_SET_RF_SECTOR_ON_CMD - Activates specified sector for specified rf
2801 * modules
2802 */
2803struct wmi_set_rf_sector_on_cmd {
2804	/* Sector index to be activated */
2805	__le16 sector_idx;
2806	/* type of requested RF sector (enum wmi_rf_sector_type) */
2807	u8 sector_type;
2808	/* bitmask vector specifying destination RF modules */
2809	u8 rf_modules_vec;
2810} __packed;
2811
2812/* \WMI_SET_RF_SECTOR_ON_DONE_EVENT - Success/Fail status for
2813 * WMI_SET_RF_SECTOR_ON_CMD
2814 */
2815struct wmi_set_rf_sector_on_done_event {
2816	/* result status of WMI_SET_RF_SECTOR_ON_CMD (enum
2817	 * wmi_rf_sector_status)
2818	 */
2819	u8 status;
2820	/* align to U32 boundary */
2821	u8 reserved[3];
2822} __packed;
2823
2824enum wmi_sector_sweep_type {
2825	WMI_SECTOR_SWEEP_TYPE_TXSS		= 0x00,
2826	WMI_SECTOR_SWEEP_TYPE_BCON		= 0x01,
2827	WMI_SECTOR_SWEEP_TYPE_TXSS_AND_BCON	= 0x02,
2828	WMI_SECTOR_SWEEP_TYPE_NUM		= 0x03,
2829};
2830
2831/* WMI_PRIO_TX_SECTORS_ORDER_CMDID
2832 *
2833 * Set the order of TX sectors in TXSS and/or Beacon(AP).
2834 *
2835 * Returned event:
2836 * - WMI_PRIO_TX_SECTORS_ORDER_EVENTID
2837 */
2838struct wmi_prio_tx_sectors_order_cmd {
2839	/* tx sectors order to be applied, 0xFF for end of array */
2840	u8 tx_sectors_priority_array[MAX_NUM_OF_SECTORS];
2841	/* enum wmi_sector_sweep_type, TXSS and/or Beacon */
2842	u8 sector_sweep_type;
2843	/* needed only for TXSS configuration */
2844	u8 cid;
2845	/* alignment to 32b */
2846	u8 reserved[2];
2847} __packed;
2848
2849/* completion status codes */
2850enum wmi_prio_tx_sectors_cmd_status {
2851	WMI_PRIO_TX_SECT_CMD_STATUS_SUCCESS	= 0x00,
2852	WMI_PRIO_TX_SECT_CMD_STATUS_BAD_PARAM	= 0x01,
2853	/* other error */
2854	WMI_PRIO_TX_SECT_CMD_STATUS_ERROR	= 0x02,
2855};
2856
2857/* WMI_PRIO_TX_SECTORS_ORDER_EVENTID */
2858struct wmi_prio_tx_sectors_order_event {
2859	/* enum wmi_prio_tx_sectors_cmd_status */
2860	u8 status;
2861	/* alignment to 32b */
2862	u8 reserved[3];
2863} __packed;
2864
2865struct wmi_prio_tx_sectors_num_cmd {
2866	/* [0-128], 0 = No changes */
2867	u8 beacon_number_of_sectors;
2868	/* [0-128], 0 = No changes */
2869	u8 txss_number_of_sectors;
2870	/* [0-8] needed only for TXSS configuration */
2871	u8 cid;
2872} __packed;
2873
2874/* WMI_PRIO_TX_SECTORS_NUMBER_CMDID
2875 *
2876 * Set the number of active sectors in TXSS and/or Beacon.
2877 *
2878 * Returned event:
2879 * - WMI_PRIO_TX_SECTORS_NUMBER_EVENTID
2880 */
2881struct wmi_prio_tx_sectors_number_cmd {
2882	struct wmi_prio_tx_sectors_num_cmd active_sectors_num;
2883	/* alignment to 32b */
2884	u8 reserved;
2885} __packed;
2886
2887/* WMI_PRIO_TX_SECTORS_NUMBER_EVENTID */
2888struct wmi_prio_tx_sectors_number_event {
2889	/* enum wmi_prio_tx_sectors_cmd_status */
2890	u8 status;
2891	/* alignment to 32b */
2892	u8 reserved[3];
2893} __packed;
2894
2895/* WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_CMDID
2896 *
2897 * Set default sectors order and number (hard coded in board file)
2898 * in TXSS and/or Beacon.
2899 *
2900 * Returned event:
2901 * - WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID
2902 */
2903struct wmi_prio_tx_sectors_set_default_cfg_cmd {
2904	/* enum wmi_sector_sweep_type, TXSS and/or Beacon */
2905	u8 sector_sweep_type;
2906	/* needed only for TXSS configuration */
2907	u8 cid;
2908	/* alignment to 32b */
2909	u8 reserved[2];
2910} __packed;
2911
2912/* WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID */
2913struct wmi_prio_tx_sectors_set_default_cfg_event {
2914	/* enum wmi_prio_tx_sectors_cmd_status */
2915	u8 status;
2916	/* alignment to 32b */
2917	u8 reserved[3];
2918} __packed;
2919
2920/* WMI_SET_SILENT_RSSI_TABLE_DONE_EVENTID */
2921struct wmi_set_silent_rssi_table_done_event {
2922	/* enum wmi_silent_rssi_status */
2923	__le32 status;
2924	/* enum wmi_silent_rssi_table */
2925	__le32 table;
2926} __packed;
2927
2928/* \WMI_COMMAND_NOT_SUPPORTED_EVENTID */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2929struct wmi_command_not_supported_event {
2930	/* device id */
2931	u8 mid;
2932	u8 reserved0;
2933	__le16 command_id;
2934	/* for UT command only, otherwise reserved */
2935	__le16 command_subtype;
2936	__le16 reserved1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2937} __packed;
2938
2939#endif /* __WILOCITY_WMI_H__ */
v5.4
   1/*
   2 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
   3 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
   4 * Copyright (c) 2006-2012 Wilocity
   5 *
   6 * Permission to use, copy, modify, and/or distribute this software for any
   7 * purpose with or without fee is hereby granted, provided that the above
   8 * copyright notice and this permission notice appear in all copies.
   9 *
  10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  17 */
  18
  19/*
  20 * This file contains the definitions of the WMI protocol specified in the
  21 * Wireless Module Interface (WMI) for the Qualcomm
  22 * 60 GHz wireless solution.
  23 * It includes definitions of all the commands and events.
  24 * Commands are messages from the host to the WM.
  25 * Events are messages from the WM to the host.
  26 *
  27 * This is an automatically generated file.
  28 */
  29
  30#ifndef __WILOCITY_WMI_H__
  31#define __WILOCITY_WMI_H__
  32
 
 
  33#define WMI_DEFAULT_ASSOC_STA		(1)
  34#define WMI_MAC_LEN			(6)
  35#define WMI_PROX_RANGE_NUM		(3)
  36#define WMI_MAX_LOSS_DMG_BEACONS	(20)
  37#define MAX_NUM_OF_SECTORS		(128)
  38#define WMI_INVALID_TEMPERATURE		(0xFFFFFFFF)
  39#define WMI_SCHED_MAX_ALLOCS_PER_CMD	(4)
  40#define WMI_RF_DTYPE_LENGTH		(3)
  41#define WMI_RF_ETYPE_LENGTH		(3)
  42#define WMI_RF_RX2TX_LENGTH		(3)
  43#define WMI_RF_ETYPE_VAL_PER_RANGE	(5)
  44/* DTYPE configuration array size
  45 * must always be kept equal to (WMI_RF_DTYPE_LENGTH+1)
  46 */
  47#define WMI_RF_DTYPE_CONF_LENGTH	(4)
  48/* ETYPE configuration array size
  49 * must always be kept equal to
  50 * (WMI_RF_ETYPE_LENGTH+WMI_RF_ETYPE_VAL_PER_RANGE)
  51 */
  52#define WMI_RF_ETYPE_CONF_LENGTH	(8)
  53/* RX2TX configuration array size
  54 * must always be kept equal to (WMI_RF_RX2TX_LENGTH+1)
  55 */
  56#define WMI_RF_RX2TX_CONF_LENGTH	(4)
  57/* Qos configuration */
  58#define WMI_QOS_NUM_OF_PRIORITY		(4)
  59#define WMI_QOS_MIN_DEFAULT_WEIGHT	(10)
  60#define WMI_QOS_VRING_SLOT_MIN_MS	(2)
  61#define WMI_QOS_VRING_SLOT_MAX_MS	(10)
  62/* (WMI_QOS_MIN_DEFAULT_WEIGHT * WMI_QOS_VRING_SLOT_MAX_MS /
  63 * WMI_QOS_VRING_SLOT_MIN_MS)
  64 */
  65#define WMI_QOS_MAX_WEIGHT		50
  66#define WMI_QOS_SET_VIF_PRIORITY	(0xFF)
  67#define WMI_QOS_DEFAULT_PRIORITY	(WMI_QOS_NUM_OF_PRIORITY)
  68#define WMI_MAX_XIF_PORTS_NUM		(8)
  69
  70/* Mailbox interface
  71 * used for commands and events
  72 */
  73enum wmi_mid {
  74	MID_DEFAULT		= 0x00,
  75	FIRST_DBG_MID_ID	= 0x10,
  76	LAST_DBG_MID_ID		= 0xFE,
  77	MID_BROADCAST		= 0xFF,
  78};
  79
  80/* FW capability IDs
  81 * Each ID maps to a bit in a 32-bit bitmask value provided by the FW to
  82 * the host
  83 */
  84enum wmi_fw_capability {
  85	WMI_FW_CAPABILITY_FTM				= 0,
  86	WMI_FW_CAPABILITY_PS_CONFIG			= 1,
  87	WMI_FW_CAPABILITY_RF_SECTORS			= 2,
  88	WMI_FW_CAPABILITY_MGMT_RETRY_LIMIT		= 3,
  89	WMI_FW_CAPABILITY_AP_SME_OFFLOAD_PARTIAL	= 4,
  90	WMI_FW_CAPABILITY_WMI_ONLY			= 5,
  91	WMI_FW_CAPABILITY_THERMAL_THROTTLING		= 7,
  92	WMI_FW_CAPABILITY_D3_SUSPEND			= 8,
  93	WMI_FW_CAPABILITY_LONG_RANGE			= 9,
  94	WMI_FW_CAPABILITY_FIXED_SCHEDULING		= 10,
  95	WMI_FW_CAPABILITY_MULTI_DIRECTED_OMNIS		= 11,
  96	WMI_FW_CAPABILITY_RSSI_REPORTING		= 12,
  97	WMI_FW_CAPABILITY_SET_SILENT_RSSI_TABLE		= 13,
  98	WMI_FW_CAPABILITY_LO_POWER_CALIB_FROM_OTP	= 14,
  99	WMI_FW_CAPABILITY_PNO				= 15,
 100	WMI_FW_CAPABILITY_CHANNEL_BONDING		= 17,
 101	WMI_FW_CAPABILITY_REF_CLOCK_CONTROL		= 18,
 102	WMI_FW_CAPABILITY_AP_SME_OFFLOAD_NONE		= 19,
 103	WMI_FW_CAPABILITY_MULTI_VIFS			= 20,
 104	WMI_FW_CAPABILITY_FT_ROAMING			= 21,
 105	WMI_FW_CAPABILITY_BACK_WIN_SIZE_64		= 22,
 106	WMI_FW_CAPABILITY_AMSDU				= 23,
 107	WMI_FW_CAPABILITY_RAW_MODE			= 24,
 108	WMI_FW_CAPABILITY_TX_REQ_EXT			= 25,
 109	WMI_FW_CAPABILITY_CHANNEL_4			= 26,
 110	WMI_FW_CAPABILITY_IPA				= 27,
 111	WMI_FW_CAPABILITY_TEMPERATURE_ALL_RF		= 30,
 112	WMI_FW_CAPABILITY_SPLIT_REKEY			= 31,
 113	WMI_FW_CAPABILITY_MAX,
 114};
 115
 116/* WMI_CMD_HDR */
 117struct wmi_cmd_hdr {
 118	u8 mid;
 119	u8 reserved;
 120	__le16 command_id;
 121	__le32 fw_timestamp;
 122} __packed;
 123
 124/* List of Commands */
 125enum wmi_command_id {
 126	WMI_CONNECT_CMDID				= 0x01,
 127	WMI_DISCONNECT_CMDID				= 0x03,
 128	WMI_DISCONNECT_STA_CMDID			= 0x04,
 129	WMI_START_SCHED_SCAN_CMDID			= 0x05,
 130	WMI_STOP_SCHED_SCAN_CMDID			= 0x06,
 131	WMI_START_SCAN_CMDID				= 0x07,
 132	WMI_SET_BSS_FILTER_CMDID			= 0x09,
 133	WMI_SET_PROBED_SSID_CMDID			= 0x0A,
 134	/* deprecated */
 135	WMI_SET_LISTEN_INT_CMDID			= 0x0B,
 136	WMI_FT_AUTH_CMDID				= 0x0C,
 137	WMI_FT_REASSOC_CMDID				= 0x0D,
 138	WMI_UPDATE_FT_IES_CMDID				= 0x0E,
 139	WMI_BCON_CTRL_CMDID				= 0x0F,
 140	WMI_ADD_CIPHER_KEY_CMDID			= 0x16,
 141	WMI_DELETE_CIPHER_KEY_CMDID			= 0x17,
 142	WMI_PCP_CONF_CMDID				= 0x18,
 143	WMI_SET_APPIE_CMDID				= 0x3F,
 144	WMI_SET_WSC_STATUS_CMDID			= 0x41,
 145	WMI_PXMT_RANGE_CFG_CMDID			= 0x42,
 146	WMI_PXMT_SNR2_RANGE_CFG_CMDID			= 0x43,
 147	WMI_RADAR_GENERAL_CONFIG_CMDID			= 0x100,
 148	WMI_RADAR_CONFIG_SELECT_CMDID			= 0x101,
 149	WMI_RADAR_PARAMS_CONFIG_CMDID			= 0x102,
 150	WMI_RADAR_SET_MODE_CMDID			= 0x103,
 151	WMI_RADAR_CONTROL_CMDID				= 0x104,
 152	WMI_RADAR_PCI_CONTROL_CMDID			= 0x105,
 153	WMI_MEM_READ_CMDID				= 0x800,
 154	WMI_MEM_WR_CMDID				= 0x801,
 155	WMI_ECHO_CMDID					= 0x803,
 156	WMI_DEEP_ECHO_CMDID				= 0x804,
 157	WMI_CONFIG_MAC_CMDID				= 0x805,
 158	/* deprecated */
 159	WMI_CONFIG_PHY_DEBUG_CMDID			= 0x806,
 160	WMI_ADD_DEBUG_TX_PCKT_CMDID			= 0x808,
 161	WMI_PHY_GET_STATISTICS_CMDID			= 0x809,
 162	/* deprecated */
 163	WMI_FS_TUNE_CMDID				= 0x80A,
 164	/* deprecated */
 165	WMI_CORR_MEASURE_CMDID				= 0x80B,
 166	WMI_READ_RSSI_CMDID				= 0x80C,
 167	WMI_TEMP_SENSE_CMDID				= 0x80E,
 168	WMI_DC_CALIB_CMDID				= 0x80F,
 169	/* deprecated */
 170	WMI_SEND_TONE_CMDID				= 0x810,
 171	/* deprecated */
 172	WMI_IQ_TX_CALIB_CMDID				= 0x811,
 173	/* deprecated */
 174	WMI_IQ_RX_CALIB_CMDID				= 0x812,
 175	WMI_SET_WORK_MODE_CMDID				= 0x815,
 176	WMI_LO_LEAKAGE_CALIB_CMDID			= 0x816,
 177	WMI_LO_POWER_CALIB_FROM_OTP_CMDID		= 0x817,
 178	WMI_SILENT_RSSI_CALIB_CMDID			= 0x81D,
 179	/* deprecated */
 180	WMI_RF_RX_TEST_CMDID				= 0x81E,
 181	WMI_CFG_RX_CHAIN_CMDID				= 0x820,
 182	WMI_VRING_CFG_CMDID				= 0x821,
 183	WMI_BCAST_VRING_CFG_CMDID			= 0x822,
 184	WMI_RING_BA_EN_CMDID				= 0x823,
 185	WMI_RING_BA_DIS_CMDID				= 0x824,
 186	WMI_RCP_ADDBA_RESP_CMDID			= 0x825,
 187	WMI_RCP_DELBA_CMDID				= 0x826,
 188	WMI_SET_SSID_CMDID				= 0x827,
 189	WMI_GET_SSID_CMDID				= 0x828,
 190	WMI_SET_PCP_CHANNEL_CMDID			= 0x829,
 191	WMI_GET_PCP_CHANNEL_CMDID			= 0x82A,
 192	WMI_SW_TX_REQ_CMDID				= 0x82B,
 193	/* Event is shared between WMI_SW_TX_REQ_CMDID and
 194	 * WMI_SW_TX_REQ_EXT_CMDID
 195	 */
 196	WMI_SW_TX_REQ_EXT_CMDID				= 0x82C,
 197	WMI_MLME_PUSH_CMDID				= 0x835,
 198	WMI_BEAMFORMING_MGMT_CMDID			= 0x836,
 199	WMI_BF_TXSS_MGMT_CMDID				= 0x837,
 200	WMI_BF_SM_MGMT_CMDID				= 0x838,
 201	WMI_BF_RXSS_MGMT_CMDID				= 0x839,
 202	WMI_BF_TRIG_CMDID				= 0x83A,
 203	WMI_RCP_ADDBA_RESP_EDMA_CMDID			= 0x83B,
 204	WMI_LINK_MAINTAIN_CFG_WRITE_CMDID		= 0x842,
 205	WMI_LINK_MAINTAIN_CFG_READ_CMDID		= 0x843,
 206	WMI_SET_SECTORS_CMDID				= 0x849,
 207	WMI_MAINTAIN_PAUSE_CMDID			= 0x850,
 208	WMI_MAINTAIN_RESUME_CMDID			= 0x851,
 209	WMI_RS_MGMT_CMDID				= 0x852,
 210	WMI_RF_MGMT_CMDID				= 0x853,
 211	WMI_RF_XPM_READ_CMDID				= 0x856,
 212	WMI_RF_XPM_WRITE_CMDID				= 0x857,
 213	WMI_LED_CFG_CMDID				= 0x858,
 214	WMI_SET_CONNECT_SNR_THR_CMDID			= 0x85B,
 215	WMI_SET_ACTIVE_SILENT_RSSI_TABLE_CMDID		= 0x85C,
 216	WMI_RF_PWR_ON_DELAY_CMDID			= 0x85D,
 217	WMI_SET_HIGH_POWER_TABLE_PARAMS_CMDID		= 0x85E,
 218	WMI_FIXED_SCHEDULING_UL_CONFIG_CMDID		= 0x85F,
 219	/* Performance monitoring commands */
 220	WMI_BF_CTRL_CMDID				= 0x862,
 221	WMI_NOTIFY_REQ_CMDID				= 0x863,
 222	WMI_GET_STATUS_CMDID				= 0x864,
 223	WMI_GET_RF_STATUS_CMDID				= 0x866,
 224	WMI_GET_BASEBAND_TYPE_CMDID			= 0x867,
 225	WMI_VRING_SWITCH_TIMING_CONFIG_CMDID		= 0x868,
 226	WMI_UNIT_TEST_CMDID				= 0x900,
 227	WMI_FLASH_READ_CMDID				= 0x902,
 228	WMI_FLASH_WRITE_CMDID				= 0x903,
 229	/* Power management */
 230	WMI_TRAFFIC_SUSPEND_CMDID			= 0x904,
 231	WMI_TRAFFIC_RESUME_CMDID			= 0x905,
 232	/* P2P */
 233	WMI_P2P_CFG_CMDID				= 0x910,
 234	WMI_PORT_ALLOCATE_CMDID				= 0x911,
 235	WMI_PORT_DELETE_CMDID				= 0x912,
 236	WMI_POWER_MGMT_CFG_CMDID			= 0x913,
 237	WMI_START_LISTEN_CMDID				= 0x914,
 238	WMI_START_SEARCH_CMDID				= 0x915,
 239	WMI_DISCOVERY_START_CMDID			= 0x916,
 240	WMI_DISCOVERY_STOP_CMDID			= 0x917,
 241	WMI_PCP_START_CMDID				= 0x918,
 242	WMI_PCP_STOP_CMDID				= 0x919,
 243	WMI_GET_PCP_FACTOR_CMDID			= 0x91B,
 244	/* Power Save Configuration Commands */
 245	WMI_PS_DEV_PROFILE_CFG_CMDID			= 0x91C,
 246	WMI_RS_ENABLE_CMDID				= 0x91E,
 247	WMI_RS_CFG_EX_CMDID				= 0x91F,
 248	WMI_GET_DETAILED_RS_RES_EX_CMDID		= 0x920,
 249	/* deprecated */
 250	WMI_RS_CFG_CMDID				= 0x921,
 251	/* deprecated */
 252	WMI_GET_DETAILED_RS_RES_CMDID			= 0x922,
 253	WMI_AOA_MEAS_CMDID				= 0x923,
 254	WMI_BRP_SET_ANT_LIMIT_CMDID			= 0x924,
 255	WMI_SET_MGMT_RETRY_LIMIT_CMDID			= 0x930,
 256	WMI_GET_MGMT_RETRY_LIMIT_CMDID			= 0x931,
 257	WMI_NEW_STA_CMDID				= 0x935,
 258	WMI_DEL_STA_CMDID				= 0x936,
 259	WMI_SET_THERMAL_THROTTLING_CFG_CMDID		= 0x940,
 260	WMI_GET_THERMAL_THROTTLING_CFG_CMDID		= 0x941,
 261	/* Read Power Save profile type */
 262	WMI_PS_DEV_PROFILE_CFG_READ_CMDID		= 0x942,
 263	WMI_TSF_SYNC_CMDID				= 0x973,
 264	WMI_TOF_SESSION_START_CMDID			= 0x991,
 265	WMI_TOF_GET_CAPABILITIES_CMDID			= 0x992,
 266	WMI_TOF_SET_LCR_CMDID				= 0x993,
 267	WMI_TOF_SET_LCI_CMDID				= 0x994,
 268	WMI_TOF_CFG_RESPONDER_CMDID			= 0x996,
 269	WMI_TOF_SET_TX_RX_OFFSET_CMDID			= 0x997,
 270	WMI_TOF_GET_TX_RX_OFFSET_CMDID			= 0x998,
 271	WMI_TOF_CHANNEL_INFO_CMDID			= 0x999,
 272	WMI_GET_RF_SECTOR_PARAMS_CMDID			= 0x9A0,
 273	WMI_SET_RF_SECTOR_PARAMS_CMDID			= 0x9A1,
 274	WMI_GET_SELECTED_RF_SECTOR_INDEX_CMDID		= 0x9A2,
 275	WMI_SET_SELECTED_RF_SECTOR_INDEX_CMDID		= 0x9A3,
 276	WMI_SET_RF_SECTOR_ON_CMDID			= 0x9A4,
 277	WMI_PRIO_TX_SECTORS_ORDER_CMDID			= 0x9A5,
 278	WMI_PRIO_TX_SECTORS_NUMBER_CMDID		= 0x9A6,
 279	WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_CMDID	= 0x9A7,
 280	/* deprecated */
 281	WMI_BF_CONTROL_CMDID				= 0x9AA,
 282	WMI_BF_CONTROL_EX_CMDID				= 0x9AB,
 283	WMI_TX_STATUS_RING_ADD_CMDID			= 0x9C0,
 284	WMI_RX_STATUS_RING_ADD_CMDID			= 0x9C1,
 285	WMI_TX_DESC_RING_ADD_CMDID			= 0x9C2,
 286	WMI_RX_DESC_RING_ADD_CMDID			= 0x9C3,
 287	WMI_BCAST_DESC_RING_ADD_CMDID			= 0x9C4,
 288	WMI_CFG_DEF_RX_OFFLOAD_CMDID			= 0x9C5,
 289	WMI_SCHEDULING_SCHEME_CMDID			= 0xA01,
 290	WMI_FIXED_SCHEDULING_CONFIG_CMDID		= 0xA02,
 291	WMI_ENABLE_FIXED_SCHEDULING_CMDID		= 0xA03,
 292	WMI_SET_MULTI_DIRECTED_OMNIS_CONFIG_CMDID	= 0xA04,
 293	WMI_SET_LONG_RANGE_CONFIG_CMDID			= 0xA05,
 294	WMI_GET_ASSOC_LIST_CMDID			= 0xA06,
 295	WMI_GET_CCA_INDICATIONS_CMDID			= 0xA07,
 296	WMI_SET_CCA_INDICATIONS_BI_AVG_NUM_CMDID	= 0xA08,
 297	WMI_INTERNAL_FW_IOCTL_CMDID			= 0xA0B,
 298	WMI_LINK_STATS_CMDID				= 0xA0C,
 299	WMI_SET_GRANT_MCS_CMDID				= 0xA0E,
 300	WMI_SET_AP_SLOT_SIZE_CMDID			= 0xA0F,
 301	WMI_SET_VRING_PRIORITY_WEIGHT_CMDID		= 0xA10,
 302	WMI_SET_VRING_PRIORITY_CMDID			= 0xA11,
 303	WMI_RBUFCAP_CFG_CMDID				= 0xA12,
 304	WMI_TEMP_SENSE_ALL_CMDID			= 0xA13,
 305	WMI_SET_MAC_ADDRESS_CMDID			= 0xF003,
 306	WMI_ABORT_SCAN_CMDID				= 0xF007,
 307	WMI_SET_PROMISCUOUS_MODE_CMDID			= 0xF041,
 308	/* deprecated */
 309	WMI_GET_PMK_CMDID				= 0xF048,
 310	WMI_SET_PASSPHRASE_CMDID			= 0xF049,
 311	/* deprecated */
 312	WMI_SEND_ASSOC_RES_CMDID			= 0xF04A,
 313	/* deprecated */
 314	WMI_SET_ASSOC_REQ_RELAY_CMDID			= 0xF04B,
 315	WMI_MAC_ADDR_REQ_CMDID				= 0xF04D,
 316	WMI_FW_VER_CMDID				= 0xF04E,
 317	WMI_PMC_CMDID					= 0xF04F,
 318};
 319
 320/* WMI_CONNECT_CMDID */
 321enum wmi_network_type {
 322	WMI_NETTYPE_INFRA		= 0x01,
 323	WMI_NETTYPE_ADHOC		= 0x02,
 324	WMI_NETTYPE_ADHOC_CREATOR	= 0x04,
 325	WMI_NETTYPE_AP			= 0x10,
 326	WMI_NETTYPE_P2P			= 0x20,
 327	/* PCIE over 60g */
 328	WMI_NETTYPE_WBE			= 0x40,
 329};
 330
 331enum wmi_dot11_auth_mode {
 332	WMI_AUTH11_OPEN		= 0x01,
 333	WMI_AUTH11_SHARED	= 0x02,
 334	WMI_AUTH11_LEAP		= 0x04,
 335	WMI_AUTH11_WSC		= 0x08,
 336};
 337
 338enum wmi_auth_mode {
 339	WMI_AUTH_NONE		= 0x01,
 340	WMI_AUTH_WPA		= 0x02,
 341	WMI_AUTH_WPA2		= 0x04,
 342	WMI_AUTH_WPA_PSK	= 0x08,
 343	WMI_AUTH_WPA2_PSK	= 0x10,
 344	WMI_AUTH_WPA_CCKM	= 0x20,
 345	WMI_AUTH_WPA2_CCKM	= 0x40,
 346};
 347
 348enum wmi_crypto_type {
 349	WMI_CRYPT_NONE		= 0x01,
 350	WMI_CRYPT_AES_GCMP	= 0x20,
 351};
 352
 353enum wmi_connect_ctrl_flag_bits {
 354	WMI_CONNECT_ASSOC_POLICY_USER		= 0x01,
 355	WMI_CONNECT_SEND_REASSOC		= 0x02,
 356	WMI_CONNECT_IGNORE_WPA_GROUP_CIPHER	= 0x04,
 357	WMI_CONNECT_PROFILE_MATCH_DONE		= 0x08,
 358	WMI_CONNECT_IGNORE_AAC_BEACON		= 0x10,
 359	WMI_CONNECT_CSA_FOLLOW_BSS		= 0x20,
 360	WMI_CONNECT_DO_WPA_OFFLOAD		= 0x40,
 361	WMI_CONNECT_DO_NOT_DEAUTH		= 0x80,
 362};
 363
 364#define WMI_MAX_SSID_LEN	(32)
 365
 366enum wmi_channel {
 367	WMI_CHANNEL_1	= 0x00,
 368	WMI_CHANNEL_2	= 0x01,
 369	WMI_CHANNEL_3	= 0x02,
 370	WMI_CHANNEL_4	= 0x03,
 371	WMI_CHANNEL_5	= 0x04,
 372	WMI_CHANNEL_6	= 0x05,
 373	WMI_CHANNEL_9	= 0x06,
 374	WMI_CHANNEL_10	= 0x07,
 375	WMI_CHANNEL_11	= 0x08,
 376	WMI_CHANNEL_12	= 0x09,
 377};
 378
 379/* WMI_CONNECT_CMDID */
 380struct wmi_connect_cmd {
 381	u8 network_type;
 382	u8 dot11_auth_mode;
 383	u8 auth_mode;
 384	u8 pairwise_crypto_type;
 385	u8 pairwise_crypto_len;
 386	u8 group_crypto_type;
 387	u8 group_crypto_len;
 388	u8 ssid_len;
 389	u8 ssid[WMI_MAX_SSID_LEN];
 390	/* enum wmi_channel WMI_CHANNEL_1..WMI_CHANNEL_6; for EDMG this is
 391	 * the primary channel number
 392	 */
 393	u8 channel;
 394	/* enum wmi_channel WMI_CHANNEL_9..WMI_CHANNEL_12 */
 395	u8 edmg_channel;
 396	u8 bssid[WMI_MAC_LEN];
 397	__le32 ctrl_flags;
 398	u8 dst_mac[WMI_MAC_LEN];
 399	u8 reserved1[2];
 400} __packed;
 401
 402/* WMI_DISCONNECT_STA_CMDID */
 403struct wmi_disconnect_sta_cmd {
 404	u8 dst_mac[WMI_MAC_LEN];
 405	__le16 disconnect_reason;
 406} __packed;
 407
 408#define WMI_MAX_KEY_INDEX	(3)
 409#define WMI_MAX_KEY_LEN		(32)
 410#define WMI_PASSPHRASE_LEN	(64)
 411
 412/* WMI_SET_PASSPHRASE_CMDID */
 413struct wmi_set_passphrase_cmd {
 414	u8 ssid[WMI_MAX_SSID_LEN];
 415	u8 passphrase[WMI_PASSPHRASE_LEN];
 416	u8 ssid_len;
 417	u8 passphrase_len;
 418} __packed;
 419
 420/* WMI_ADD_CIPHER_KEY_CMDID */
 421enum wmi_key_usage {
 422	WMI_KEY_USE_PAIRWISE	= 0x00,
 423	WMI_KEY_USE_RX_GROUP	= 0x01,
 424	WMI_KEY_USE_TX_GROUP	= 0x02,
 425	WMI_KEY_USE_STORE_PTK	= 0x03,
 426	WMI_KEY_USE_APPLY_PTK	= 0x04,
 427};
 428
 429struct wmi_add_cipher_key_cmd {
 430	u8 key_index;
 431	u8 key_type;
 432	/* enum wmi_key_usage */
 433	u8 key_usage;
 434	u8 key_len;
 435	/* key replay sequence counter */
 436	u8 key_rsc[8];
 437	u8 key[WMI_MAX_KEY_LEN];
 438	/* Additional Key Control information */
 439	u8 key_op_ctrl;
 440	u8 mac[WMI_MAC_LEN];
 441} __packed;
 442
 443/* WMI_DELETE_CIPHER_KEY_CMDID */
 444struct wmi_delete_cipher_key_cmd {
 445	u8 key_index;
 446	u8 mac[WMI_MAC_LEN];
 447} __packed;
 448
 449/* WMI_START_SCAN_CMDID
 450 *
 451 * Start L1 scan operation
 452 *
 453 * Returned events:
 454 * - WMI_RX_MGMT_PACKET_EVENTID - for every probe resp.
 455 * - WMI_SCAN_COMPLETE_EVENTID
 456 */
 457enum wmi_scan_type {
 458	WMI_ACTIVE_SCAN		= 0x00,
 459	WMI_SHORT_SCAN		= 0x01,
 460	WMI_PASSIVE_SCAN	= 0x02,
 461	WMI_DIRECT_SCAN		= 0x03,
 462	WMI_LONG_SCAN		= 0x04,
 463};
 464
 465/* WMI_START_SCAN_CMDID */
 466struct wmi_start_scan_cmd {
 467	u8 direct_scan_mac_addr[WMI_MAC_LEN];
 468	/* run scan with discovery beacon. Relevant for ACTIVE scan only. */
 469	u8 discovery_mode;
 470	u8 reserved;
 471	/* Max duration in the home channel(ms) */
 472	__le32 dwell_time;
 473	/* Time interval between scans (ms) */
 474	__le32 force_scan_interval;
 475	/* enum wmi_scan_type */
 476	u8 scan_type;
 477	/* how many channels follow */
 478	u8 num_channels;
 479	/* channels ID's:
 480	 * 0 - 58320 MHz
 481	 * 1 - 60480 MHz
 482	 * 2 - 62640 MHz
 483	 */
 484	struct {
 485		u8 channel;
 486		u8 reserved;
 487	} channel_list[0];
 488} __packed;
 489
 490#define WMI_MAX_PNO_SSID_NUM	(16)
 491#define WMI_MAX_CHANNEL_NUM	(6)
 492#define WMI_MAX_PLANS_NUM	(2)
 493
 494/* WMI_START_SCHED_SCAN_CMDID */
 495struct wmi_sched_scan_ssid_match {
 496	u8 ssid_len;
 497	u8 ssid[WMI_MAX_SSID_LEN];
 498	s8 rssi_threshold;
 499	/* boolean */
 500	u8 add_ssid_to_probe;
 501	u8 reserved;
 502} __packed;
 503
 504/* WMI_START_SCHED_SCAN_CMDID */
 505struct wmi_sched_scan_plan {
 506	__le16 interval_sec;
 507	__le16 num_of_iterations;
 508} __packed;
 509
 510/* WMI_START_SCHED_SCAN_CMDID */
 511struct wmi_start_sched_scan_cmd {
 512	struct wmi_sched_scan_ssid_match ssid_for_match[WMI_MAX_PNO_SSID_NUM];
 513	u8 num_of_ssids;
 514	s8 min_rssi_threshold;
 515	u8 channel_list[WMI_MAX_CHANNEL_NUM];
 516	u8 num_of_channels;
 517	u8 reserved;
 518	__le16 initial_delay_sec;
 519	struct wmi_sched_scan_plan scan_plans[WMI_MAX_PLANS_NUM];
 520} __packed;
 521
 522/* WMI_FT_AUTH_CMDID */
 523struct wmi_ft_auth_cmd {
 524	u8 bssid[WMI_MAC_LEN];
 525	/* enum wmi_channel */
 526	u8 channel;
 527	/* enum wmi_channel */
 528	u8 edmg_channel;
 529	u8 reserved[4];
 530} __packed;
 531
 532/* WMI_FT_REASSOC_CMDID */
 533struct wmi_ft_reassoc_cmd {
 534	u8 bssid[WMI_MAC_LEN];
 535	u8 reserved[2];
 536} __packed;
 537
 538/* WMI_UPDATE_FT_IES_CMDID */
 539struct wmi_update_ft_ies_cmd {
 540	/* Length of the FT IEs */
 541	__le16 ie_len;
 542	u8 reserved[2];
 543	u8 ie_info[0];
 544} __packed;
 545
 546/* WMI_SET_PROBED_SSID_CMDID */
 547#define MAX_PROBED_SSID_INDEX	(3)
 548
 549enum wmi_ssid_flag {
 550	/* disables entry */
 551	WMI_SSID_FLAG_DISABLE	= 0x00,
 552	/* probes specified ssid */
 553	WMI_SSID_FLAG_SPECIFIC	= 0x01,
 554	/* probes for any ssid */
 555	WMI_SSID_FLAG_ANY	= 0x02,
 556};
 557
 558struct wmi_probed_ssid_cmd {
 559	/* 0 to MAX_PROBED_SSID_INDEX */
 560	u8 entry_index;
 561	/* enum wmi_ssid_flag */
 562	u8 flag;
 563	u8 ssid_len;
 564	u8 ssid[WMI_MAX_SSID_LEN];
 565} __packed;
 566
 567/* WMI_SET_APPIE_CMDID
 568 * Add Application specified IE to a management frame
 569 */
 570#define WMI_MAX_IE_LEN	(1024)
 571
 572/* Frame Types */
 573enum wmi_mgmt_frame_type {
 574	WMI_FRAME_BEACON	= 0x00,
 575	WMI_FRAME_PROBE_REQ	= 0x01,
 576	WMI_FRAME_PROBE_RESP	= 0x02,
 577	WMI_FRAME_ASSOC_REQ	= 0x03,
 578	WMI_FRAME_ASSOC_RESP	= 0x04,
 579	WMI_NUM_MGMT_FRAME	= 0x05,
 580};
 581
 582struct wmi_set_appie_cmd {
 583	/* enum wmi_mgmt_frame_type */
 584	u8 mgmt_frm_type;
 585	u8 reserved;
 586	/* Length of the IE to be added to MGMT frame */
 587	__le16 ie_len;
 588	u8 ie_info[0];
 589} __packed;
 590
 591/* WMI_PXMT_RANGE_CFG_CMDID */
 592struct wmi_pxmt_range_cfg_cmd {
 593	u8 dst_mac[WMI_MAC_LEN];
 594	__le16 range;
 595} __packed;
 596
 597/* WMI_PXMT_SNR2_RANGE_CFG_CMDID */
 598struct wmi_pxmt_snr2_range_cfg_cmd {
 599	s8 snr2range_arr[2];
 600} __packed;
 601
 602/* WMI_RADAR_GENERAL_CONFIG_CMDID */
 603struct wmi_radar_general_config_cmd {
 604	/* Number of pulses (CIRs) in FW FIFO to initiate pulses transfer
 605	 * from FW to Host
 606	 */
 607	__le32 fifo_watermark;
 608	/* In unit of us, in the range [100, 1000000] */
 609	__le32 t_burst;
 610	/* Valid in the range [1, 32768], 0xFFFF means infinite */
 611	__le32 n_bursts;
 612	/* In unit of 330Mhz clk, in the range [4, 2000]*330 */
 613	__le32 t_pulse;
 614	/* In the range of [1,4096] */
 615	__le16 n_pulses;
 616	/* Number of taps after cTap per CIR */
 617	__le16 n_samples;
 618	/* Offset from the main tap (0 = zero-distance). In the range of [0,
 619	 * 255]
 620	 */
 621	u8 first_sample_offset;
 622	/* Number of Pulses to average, 1, 2, 4, 8 */
 623	u8 pulses_to_avg;
 624	/* Number of adjacent taps to average, 1, 2, 4, 8 */
 625	u8 samples_to_avg;
 626	/* The index to config general params */
 627	u8 general_index;
 628	u8 reserved[4];
 629} __packed;
 630
 631/* WMI_RADAR_CONFIG_SELECT_CMDID */
 632struct wmi_radar_config_select_cmd {
 633	/* Select the general params index to use */
 634	u8 general_index;
 635	u8 reserved[3];
 636	/* 0 means don't update burst_active_vector */
 637	__le32 burst_active_vector;
 638	/* 0 means don't update pulse_active_vector */
 639	__le32 pulse_active_vector;
 640} __packed;
 641
 642/* WMI_RADAR_PARAMS_CONFIG_CMDID */
 643struct wmi_radar_params_config_cmd {
 644	/* The burst index selected to config */
 645	u8 burst_index;
 646	/* 0-not active, 1-active */
 647	u8 burst_en;
 648	/* The pulse index selected to config */
 649	u8 pulse_index;
 650	/* 0-not active, 1-active */
 651	u8 pulse_en;
 652	/* TX RF to use on current pulse */
 653	u8 tx_rfc_idx;
 654	u8 tx_sector;
 655	/* Offset from calibrated value.(expected to be 0)(value is row in
 656	 * Gain-LUT, not dB)
 657	 */
 658	s8 tx_rf_gain_comp;
 659	/* expected to be 0 */
 660	s8 tx_bb_gain_comp;
 661	/* RX RF to use on current pulse */
 662	u8 rx_rfc_idx;
 663	u8 rx_sector;
 664	/* Offset from calibrated value.(expected to be 0)(value is row in
 665	 * Gain-LUT, not dB)
 666	 */
 667	s8 rx_rf_gain_comp;
 668	/* Value in dB.(expected to be 0) */
 669	s8 rx_bb_gain_comp;
 670	/* Offset from calibrated value.(expected to be 0) */
 671	s8 rx_timing_offset;
 672	u8 reserved[3];
 673} __packed;
 674
 675/* WMI_RADAR_SET_MODE_CMDID */
 676struct wmi_radar_set_mode_cmd {
 677	/* 0-disable/1-enable */
 678	u8 enable;
 679	/* enum wmi_channel */
 680	u8 channel;
 681	/* In the range of [0,7], 0xff means use default */
 682	u8 tx_rfc_idx;
 683	/* In the range of [0,7], 0xff means use default */
 684	u8 rx_rfc_idx;
 685} __packed;
 686
 687/* WMI_RADAR_CONTROL_CMDID */
 688struct wmi_radar_control_cmd {
 689	/* 0-stop/1-start */
 690	u8 start;
 691	u8 reserved[3];
 692} __packed;
 693
 694/* WMI_RADAR_PCI_CONTROL_CMDID */
 695struct wmi_radar_pci_control_cmd {
 696	/* pcie host buffer start address */
 697	__le64 base_addr;
 698	/* pcie host control block address */
 699	__le64 control_block_addr;
 700	/* pcie host buffer size */
 701	__le32 buffer_size;
 702	__le32 reserved;
 703} __packed;
 704
 705/* WMI_RF_MGMT_CMDID */
 706enum wmi_rf_mgmt_type {
 707	WMI_RF_MGMT_W_DISABLE	= 0x00,
 708	WMI_RF_MGMT_W_ENABLE	= 0x01,
 709	WMI_RF_MGMT_GET_STATUS	= 0x02,
 710};
 711
 712/* WMI_BF_CONTROL_CMDID */
 713enum wmi_bf_triggers {
 714	WMI_BF_TRIGGER_RS_MCS1_TH_FAILURE		= 0x01,
 715	WMI_BF_TRIGGER_RS_MCS1_NO_BACK_FAILURE		= 0x02,
 716	WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_TXOP		= 0x04,
 717	WMI_BF_TRIGGER_MAX_BACK_FAILURE			= 0x08,
 718	WMI_BF_TRIGGER_FW				= 0x10,
 719	WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_KEEP_ALIVE	= 0x20,
 720	WMI_BF_TRIGGER_AOA				= 0x40,
 721	WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_UPM		= 0x80,
 722};
 723
 724/* WMI_RF_MGMT_CMDID */
 725struct wmi_rf_mgmt_cmd {
 726	__le32 rf_mgmt_type;
 727} __packed;
 728
 729/* WMI_CORR_MEASURE_CMDID */
 730struct wmi_corr_measure_cmd {
 731	__le32 freq_mhz;
 732	__le32 length_samples;
 733	__le32 iterations;
 734} __packed;
 735
 736/* WMI_SET_SSID_CMDID */
 737struct wmi_set_ssid_cmd {
 738	__le32 ssid_len;
 739	u8 ssid[WMI_MAX_SSID_LEN];
 740} __packed;
 741
 742/* WMI_SET_PCP_CHANNEL_CMDID */
 743struct wmi_set_pcp_channel_cmd {
 744	u8 channel;
 745	u8 reserved[3];
 746} __packed;
 747
 748/* WMI_BCON_CTRL_CMDID */
 749struct wmi_bcon_ctrl_cmd {
 750	__le16 bcon_interval;
 751	__le16 frag_num;
 752	__le64 ss_mask;
 753	u8 network_type;
 754	u8 pcp_max_assoc_sta;
 755	u8 disable_sec_offload;
 756	u8 disable_sec;
 757	u8 hidden_ssid;
 758	u8 is_go;
 759	/* A-BFT length override if non-0 */
 760	u8 abft_len;
 761	u8 reserved;
 762} __packed;
 763
 764/* WMI_PORT_ALLOCATE_CMDID */
 765enum wmi_port_role {
 766	WMI_PORT_STA		= 0x00,
 767	WMI_PORT_PCP		= 0x01,
 768	WMI_PORT_AP		= 0x02,
 769	WMI_PORT_P2P_DEV	= 0x03,
 770	WMI_PORT_P2P_CLIENT	= 0x04,
 771	WMI_PORT_P2P_GO		= 0x05,
 772};
 773
 774/* WMI_PORT_ALLOCATE_CMDID */
 775struct wmi_port_allocate_cmd {
 776	u8 mac[WMI_MAC_LEN];
 777	u8 port_role;
 778	u8 mid;
 779} __packed;
 780
 781/* WMI_PORT_DELETE_CMDID */
 782struct wmi_port_delete_cmd {
 783	u8 mid;
 784	u8 reserved[3];
 785} __packed;
 786
 787/* WMI_TRAFFIC_SUSPEND_CMD wakeup trigger bit mask values */
 788enum wmi_wakeup_trigger {
 789	WMI_WAKEUP_TRIGGER_UCAST	= 0x01,
 790	WMI_WAKEUP_TRIGGER_BCAST	= 0x02,
 791};
 792
 793/* WMI_TRAFFIC_SUSPEND_CMDID */
 794struct wmi_traffic_suspend_cmd {
 795	/* Bit vector: bit[0] - wake on Unicast, bit[1] - wake on Broadcast */
 796	u8 wakeup_trigger;
 797} __packed;
 798
 799/* WMI_P2P_CFG_CMDID */
 800enum wmi_discovery_mode {
 801	WMI_DISCOVERY_MODE_NON_OFFLOAD	= 0x00,
 802	WMI_DISCOVERY_MODE_OFFLOAD	= 0x01,
 803	WMI_DISCOVERY_MODE_PEER2PEER	= 0x02,
 804};
 805
 806struct wmi_p2p_cfg_cmd {
 807	/* enum wmi_discovery_mode */
 808	u8 discovery_mode;
 809	u8 channel;
 810	/* base to listen/search duration calculation */
 811	__le16 bcon_interval;
 812} __packed;
 813
 814/* WMI_POWER_MGMT_CFG_CMDID */
 815enum wmi_power_source_type {
 816	WMI_POWER_SOURCE_BATTERY	= 0x00,
 817	WMI_POWER_SOURCE_OTHER		= 0x01,
 818};
 819
 820struct wmi_power_mgmt_cfg_cmd {
 821	/* enum wmi_power_source_type */
 822	u8 power_source;
 823	u8 reserved[3];
 824} __packed;
 825
 826/* WMI_PCP_START_CMDID */
 827enum wmi_ap_sme_offload_mode {
 828	/* Full AP SME in FW */
 829	WMI_AP_SME_OFFLOAD_FULL		= 0x00,
 830	/* Probe AP SME in FW */
 831	WMI_AP_SME_OFFLOAD_PARTIAL	= 0x01,
 832	/* AP SME in host */
 833	WMI_AP_SME_OFFLOAD_NONE		= 0x02,
 834};
 835
 836/* WMI_PCP_START_CMDID */
 837struct wmi_pcp_start_cmd {
 838	__le16 bcon_interval;
 839	u8 pcp_max_assoc_sta;
 840	u8 hidden_ssid;
 841	u8 is_go;
 842	/* enum wmi_channel WMI_CHANNEL_9..WMI_CHANNEL_12 */
 843	u8 edmg_channel;
 844	u8 raw_mode;
 845	u8 reserved[3];
 846	/* A-BFT length override if non-0 */
 847	u8 abft_len;
 848	/* enum wmi_ap_sme_offload_mode_e */
 849	u8 ap_sme_offload_mode;
 850	u8 network_type;
 851	/* enum wmi_channel WMI_CHANNEL_1..WMI_CHANNEL_6; for EDMG this is
 852	 * the primary channel number
 853	 */
 854	u8 channel;
 855	u8 disable_sec_offload;
 856	u8 disable_sec;
 857} __packed;
 858
 859/* WMI_SW_TX_REQ_CMDID */
 860struct wmi_sw_tx_req_cmd {
 861	u8 dst_mac[WMI_MAC_LEN];
 862	__le16 len;
 863	u8 payload[0];
 864} __packed;
 865
 866/* WMI_SW_TX_REQ_EXT_CMDID */
 867struct wmi_sw_tx_req_ext_cmd {
 868	u8 dst_mac[WMI_MAC_LEN];
 869	__le16 len;
 870	__le16 duration_ms;
 871	/* Channel to use, 0xFF for currently active channel */
 872	u8 channel;
 873	u8 reserved[5];
 874	u8 payload[0];
 875} __packed;
 876
 877/* WMI_VRING_SWITCH_TIMING_CONFIG_CMDID */
 878struct wmi_vring_switch_timing_config_cmd {
 879	/* Set vring timing configuration:
 880	 *
 881	 * defined interval for vring switch
 882	 */
 883	__le32 interval_usec;
 884	/* vring inactivity threshold */
 885	__le32 idle_th_usec;
 886} __packed;
 887
 888struct wmi_sw_ring_cfg {
 889	__le64 ring_mem_base;
 890	__le16 ring_size;
 891	__le16 max_mpdu_size;
 892} __packed;
 893
 894/* wmi_vring_cfg_schd */
 895struct wmi_vring_cfg_schd {
 896	__le16 priority;
 897	__le16 timeslot_us;
 898} __packed;
 899
 900enum wmi_vring_cfg_encap_trans_type {
 901	WMI_VRING_ENC_TYPE_802_3	= 0x00,
 902	WMI_VRING_ENC_TYPE_NATIVE_WIFI	= 0x01,
 903	WMI_VRING_ENC_TYPE_NONE		= 0x02,
 904};
 905
 906enum wmi_vring_cfg_ds_cfg {
 907	WMI_VRING_DS_PBSS	= 0x00,
 908	WMI_VRING_DS_STATION	= 0x01,
 909	WMI_VRING_DS_AP		= 0x02,
 910	WMI_VRING_DS_ADDR4	= 0x03,
 911};
 912
 913enum wmi_vring_cfg_nwifi_ds_trans_type {
 914	WMI_NWIFI_TX_TRANS_MODE_NO		= 0x00,
 915	WMI_NWIFI_TX_TRANS_MODE_AP2PBSS		= 0x01,
 916	WMI_NWIFI_TX_TRANS_MODE_STA2PBSS	= 0x02,
 917};
 918
 919enum wmi_vring_cfg_schd_params_priority {
 920	WMI_SCH_PRIO_REGULAR	= 0x00,
 921	WMI_SCH_PRIO_HIGH	= 0x01,
 922};
 923
 924#define CIDXTID_EXTENDED_CID_TID		(0xFF)
 925#define CIDXTID_CID_POS				(0)
 926#define CIDXTID_CID_LEN				(4)
 927#define CIDXTID_CID_MSK				(0xF)
 928#define CIDXTID_TID_POS				(4)
 929#define CIDXTID_TID_LEN				(4)
 930#define CIDXTID_TID_MSK				(0xF0)
 931#define VRING_CFG_MAC_CTRL_LIFETIME_EN_POS	(0)
 932#define VRING_CFG_MAC_CTRL_LIFETIME_EN_LEN	(1)
 933#define VRING_CFG_MAC_CTRL_LIFETIME_EN_MSK	(0x1)
 934#define VRING_CFG_MAC_CTRL_AGGR_EN_POS		(1)
 935#define VRING_CFG_MAC_CTRL_AGGR_EN_LEN		(1)
 936#define VRING_CFG_MAC_CTRL_AGGR_EN_MSK		(0x2)
 937#define VRING_CFG_TO_RESOLUTION_VALUE_POS	(0)
 938#define VRING_CFG_TO_RESOLUTION_VALUE_LEN	(6)
 939#define VRING_CFG_TO_RESOLUTION_VALUE_MSK	(0x3F)
 940
 941struct wmi_vring_cfg {
 942	struct wmi_sw_ring_cfg tx_sw_ring;
 943	/* 0-23 vrings */
 944	u8 ringid;
 945	/* Used for cid less than 8. For higher cid set
 946	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
 947	 */
 948	u8 cidxtid;
 949	u8 encap_trans_type;
 950	/* 802.3 DS cfg */
 951	u8 ds_cfg;
 952	u8 nwifi_ds_trans_type;
 953	u8 mac_ctrl;
 954	u8 to_resolution;
 955	u8 agg_max_wsize;
 956	struct wmi_vring_cfg_schd schd_params;
 957	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
 958	u8 cid;
 959	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
 960	u8 tid;
 961	/* Update the vring's priority for Qos purpose. Set to
 962	 * WMI_QOS_DEFAULT_PRIORITY to use MID's QoS priority
 963	 */
 964	u8 qos_priority;
 965	u8 reserved;
 966} __packed;
 967
 968enum wmi_vring_cfg_cmd_action {
 969	WMI_VRING_CMD_ADD	= 0x00,
 970	WMI_VRING_CMD_MODIFY	= 0x01,
 971	WMI_VRING_CMD_DELETE	= 0x02,
 972};
 973
 974/* WMI_VRING_CFG_CMDID */
 975struct wmi_vring_cfg_cmd {
 976	__le32 action;
 977	struct wmi_vring_cfg vring_cfg;
 978} __packed;
 979
 980struct wmi_bcast_vring_cfg {
 981	struct wmi_sw_ring_cfg tx_sw_ring;
 982	/* 0-23 vrings */
 983	u8 ringid;
 984	u8 encap_trans_type;
 985	/* 802.3 DS cfg */
 986	u8 ds_cfg;
 987	u8 nwifi_ds_trans_type;
 988} __packed;
 989
 990/* WMI_BCAST_VRING_CFG_CMDID */
 991struct wmi_bcast_vring_cfg_cmd {
 992	__le32 action;
 993	struct wmi_bcast_vring_cfg vring_cfg;
 994} __packed;
 995
 996struct wmi_edma_ring_cfg {
 997	__le64 ring_mem_base;
 998	/* size in number of items */
 999	__le16 ring_size;
1000	u8 ring_id;
1001	u8 reserved;
1002} __packed;
1003
1004enum wmi_rx_msg_type {
1005	WMI_RX_MSG_TYPE_COMPRESSED	= 0x00,
1006	WMI_RX_MSG_TYPE_EXTENDED	= 0x01,
1007};
1008
1009enum wmi_ring_add_irq_mode {
1010	/* Backwards compatibility
1011	 *  for DESC ring - interrupt disabled
1012	 *  for STATUS ring - interrupt enabled
1013	 */
1014	WMI_RING_ADD_IRQ_MODE_BWC	= 0x00,
1015	WMI_RING_ADD_IRQ_MODE_DISABLE	= 0x01,
1016	WMI_RING_ADD_IRQ_MODE_ENABLE	= 0x02,
1017};
1018
1019struct wmi_tx_status_ring_add_cmd {
1020	struct wmi_edma_ring_cfg ring_cfg;
1021	u8 irq_index;
1022	/* wmi_ring_add_irq_mode */
1023	u8 irq_mode;
1024	u8 reserved[2];
1025} __packed;
1026
1027struct wmi_rx_status_ring_add_cmd {
1028	struct wmi_edma_ring_cfg ring_cfg;
1029	u8 irq_index;
1030	/* wmi_rx_msg_type */
1031	u8 rx_msg_type;
1032	u8 reserved[2];
1033} __packed;
1034
1035struct wmi_cfg_def_rx_offload_cmd {
1036	__le16 max_msdu_size;
1037	__le16 max_rx_pl_per_desc;
1038	u8 decap_trans_type;
1039	u8 l2_802_3_offload_ctrl;
1040	u8 l2_nwifi_offload_ctrl;
1041	u8 vlan_id;
1042	u8 nwifi_ds_trans_type;
1043	u8 l3_l4_ctrl;
1044	u8 reserved[6];
1045} __packed;
1046
1047struct wmi_tx_desc_ring_add_cmd {
1048	struct wmi_edma_ring_cfg ring_cfg;
1049	__le16 max_msdu_size;
1050	/* Correlated status ring (0-63) */
1051	u8 status_ring_id;
1052	u8 cid;
1053	u8 tid;
1054	u8 encap_trans_type;
1055	u8 mac_ctrl;
1056	u8 to_resolution;
1057	u8 agg_max_wsize;
1058	u8 irq_index;
1059	/* wmi_ring_add_irq_mode */
1060	u8 irq_mode;
1061	u8 reserved;
1062	struct wmi_vring_cfg_schd schd_params;
1063} __packed;
1064
1065struct wmi_rx_desc_ring_add_cmd {
1066	struct wmi_edma_ring_cfg ring_cfg;
1067	u8 irq_index;
1068	/* 0-63 status rings */
1069	u8 status_ring_id;
1070	u8 reserved[2];
1071	__le64 sw_tail_host_addr;
1072} __packed;
1073
1074struct wmi_bcast_desc_ring_add_cmd {
1075	struct wmi_edma_ring_cfg ring_cfg;
1076	__le16 max_msdu_size;
1077	/* Correlated status ring (0-63) */
1078	u8 status_ring_id;
1079	u8 encap_trans_type;
1080	u8 reserved[4];
1081} __packed;
1082
1083/* WMI_LO_POWER_CALIB_FROM_OTP_CMDID */
1084struct wmi_lo_power_calib_from_otp_cmd {
1085	/* index to read from OTP. zero based */
1086	u8 index;
1087	u8 reserved[3];
1088} __packed;
1089
1090/* WMI_LO_POWER_CALIB_FROM_OTP_EVENTID */
1091struct wmi_lo_power_calib_from_otp_event {
1092	/* wmi_fw_status */
1093	u8 status;
1094	u8 reserved[3];
1095} __packed;
1096
1097/* WMI_RING_BA_EN_CMDID */
1098struct wmi_ring_ba_en_cmd {
1099	u8 ring_id;
1100	u8 agg_max_wsize;
1101	__le16 ba_timeout;
1102	u8 amsdu;
1103	u8 reserved[3];
1104} __packed;
1105
1106/* WMI_RING_BA_DIS_CMDID */
1107struct wmi_ring_ba_dis_cmd {
1108	u8 ring_id;
1109	u8 reserved;
1110	__le16 reason;
1111} __packed;
1112
1113/* WMI_NOTIFY_REQ_CMDID */
1114struct wmi_notify_req_cmd {
1115	u8 cid;
1116	u8 year;
1117	u8 month;
1118	u8 day;
1119	__le32 interval_usec;
1120	u8 hour;
1121	u8 minute;
1122	u8 second;
1123	u8 miliseconds;
1124} __packed;
1125
1126/* WMI_CFG_RX_CHAIN_CMDID */
1127enum wmi_sniffer_cfg_mode {
1128	WMI_SNIFFER_OFF	= 0x00,
1129	WMI_SNIFFER_ON	= 0x01,
1130};
1131
1132/* WMI_SILENT_RSSI_TABLE */
1133enum wmi_silent_rssi_table {
1134	RF_TEMPERATURE_CALIB_DEFAULT_DB		= 0x00,
1135	RF_TEMPERATURE_CALIB_HIGH_POWER_DB	= 0x01,
1136};
1137
1138/* WMI_SILENT_RSSI_STATUS */
1139enum wmi_silent_rssi_status {
1140	SILENT_RSSI_SUCCESS	= 0x00,
1141	SILENT_RSSI_FAILURE	= 0x01,
1142};
1143
1144/* WMI_SET_ACTIVE_SILENT_RSSI_TABLE_CMDID */
1145struct wmi_set_active_silent_rssi_table_cmd {
1146	/* enum wmi_silent_rssi_table */
1147	__le32 table;
1148} __packed;
1149
1150enum wmi_sniffer_cfg_phy_info_mode {
1151	WMI_SNIFFER_PHY_INFO_DISABLED	= 0x00,
1152	WMI_SNIFFER_PHY_INFO_ENABLED	= 0x01,
1153};
1154
1155enum wmi_sniffer_cfg_phy_support {
1156	WMI_SNIFFER_CP		= 0x00,
1157	WMI_SNIFFER_DP		= 0x01,
1158	WMI_SNIFFER_BOTH_PHYS	= 0x02,
1159};
1160
1161/* wmi_sniffer_cfg */
1162struct wmi_sniffer_cfg {
1163	/* enum wmi_sniffer_cfg_mode */
1164	__le32 mode;
1165	/* enum wmi_sniffer_cfg_phy_info_mode */
1166	__le32 phy_info_mode;
1167	/* enum wmi_sniffer_cfg_phy_support */
1168	__le32 phy_support;
1169	u8 channel;
1170	u8 reserved[3];
1171} __packed;
1172
1173enum wmi_cfg_rx_chain_cmd_action {
1174	WMI_RX_CHAIN_ADD	= 0x00,
1175	WMI_RX_CHAIN_DEL	= 0x01,
1176};
1177
1178enum wmi_cfg_rx_chain_cmd_decap_trans_type {
1179	WMI_DECAP_TYPE_802_3		= 0x00,
1180	WMI_DECAP_TYPE_NATIVE_WIFI	= 0x01,
1181	WMI_DECAP_TYPE_NONE		= 0x02,
1182};
1183
1184enum wmi_cfg_rx_chain_cmd_nwifi_ds_trans_type {
1185	WMI_NWIFI_RX_TRANS_MODE_NO		= 0x00,
1186	WMI_NWIFI_RX_TRANS_MODE_PBSS2AP		= 0x01,
1187	WMI_NWIFI_RX_TRANS_MODE_PBSS2STA	= 0x02,
1188};
1189
1190enum wmi_cfg_rx_chain_cmd_reorder_type {
1191	WMI_RX_HW_REORDER	= 0x00,
1192	WMI_RX_SW_REORDER	= 0x01,
1193};
1194
1195#define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_POS	(0)
1196#define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_LEN	(1)
1197#define L2_802_3_OFFLOAD_CTRL_VLAN_TAG_INSERTION_MSK	(0x1)
1198#define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_POS		(1)
1199#define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_LEN		(1)
1200#define L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_MSK		(0x2)
1201#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_POS		(0)
1202#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_LEN		(1)
1203#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_QOS_MSK		(0x1)
1204#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_POS		(1)
1205#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_LEN		(1)
1206#define L2_NWIFI_OFFLOAD_CTRL_REMOVE_PN_MSK		(0x2)
1207#define L3_L4_CTRL_IPV4_CHECKSUM_EN_POS			(0)
1208#define L3_L4_CTRL_IPV4_CHECKSUM_EN_LEN			(1)
1209#define L3_L4_CTRL_IPV4_CHECKSUM_EN_MSK			(0x1)
1210#define L3_L4_CTRL_TCPIP_CHECKSUM_EN_POS		(1)
1211#define L3_L4_CTRL_TCPIP_CHECKSUM_EN_LEN		(1)
1212#define L3_L4_CTRL_TCPIP_CHECKSUM_EN_MSK		(0x2)
1213#define RING_CTRL_OVERRIDE_PREFETCH_THRSH_POS		(0)
1214#define RING_CTRL_OVERRIDE_PREFETCH_THRSH_LEN		(1)
1215#define RING_CTRL_OVERRIDE_PREFETCH_THRSH_MSK		(0x1)
1216#define RING_CTRL_OVERRIDE_WB_THRSH_POS			(1)
1217#define RING_CTRL_OVERRIDE_WB_THRSH_LEN			(1)
1218#define RING_CTRL_OVERRIDE_WB_THRSH_MSK			(0x2)
1219#define RING_CTRL_OVERRIDE_ITR_THRSH_POS		(2)
1220#define RING_CTRL_OVERRIDE_ITR_THRSH_LEN		(1)
1221#define RING_CTRL_OVERRIDE_ITR_THRSH_MSK		(0x4)
1222#define RING_CTRL_OVERRIDE_HOST_THRSH_POS		(3)
1223#define RING_CTRL_OVERRIDE_HOST_THRSH_LEN		(1)
1224#define RING_CTRL_OVERRIDE_HOST_THRSH_MSK		(0x8)
1225
1226/* WMI_CFG_RX_CHAIN_CMDID */
1227struct wmi_cfg_rx_chain_cmd {
1228	__le32 action;
1229	struct wmi_sw_ring_cfg rx_sw_ring;
1230	u8 mid;
1231	u8 decap_trans_type;
1232	u8 l2_802_3_offload_ctrl;
1233	u8 l2_nwifi_offload_ctrl;
1234	u8 vlan_id;
1235	u8 nwifi_ds_trans_type;
1236	u8 l3_l4_ctrl;
1237	u8 ring_ctrl;
1238	__le16 prefetch_thrsh;
1239	__le16 wb_thrsh;
1240	__le32 itr_value;
1241	__le16 host_thrsh;
1242	u8 reorder_type;
1243	u8 reserved;
1244	struct wmi_sniffer_cfg sniffer_cfg;
1245	__le16 max_rx_pl_per_desc;
1246} __packed;
1247
1248/* WMI_RCP_ADDBA_RESP_CMDID */
1249struct wmi_rcp_addba_resp_cmd {
1250	/* Used for cid less than 8. For higher cid set
1251	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
1252	 */
1253	u8 cidxtid;
1254	u8 dialog_token;
1255	__le16 status_code;
1256	/* ieee80211_ba_parameterset field to send */
1257	__le16 ba_param_set;
1258	__le16 ba_timeout;
1259	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
1260	u8 cid;
1261	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
1262	u8 tid;
1263	u8 reserved[2];
1264} __packed;
1265
1266/* WMI_RCP_ADDBA_RESP_EDMA_CMDID */
1267struct wmi_rcp_addba_resp_edma_cmd {
1268	u8 cid;
1269	u8 tid;
1270	u8 dialog_token;
1271	u8 reserved;
1272	__le16 status_code;
1273	/* ieee80211_ba_parameterset field to send */
1274	__le16 ba_param_set;
1275	__le16 ba_timeout;
1276	u8 status_ring_id;
1277	/* wmi_cfg_rx_chain_cmd_reorder_type */
1278	u8 reorder_type;
1279} __packed;
1280
1281/* WMI_RCP_DELBA_CMDID */
1282struct wmi_rcp_delba_cmd {
1283	/* Used for cid less than 8. For higher cid set
1284	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
1285	 */
1286	u8 cidxtid;
1287	u8 reserved;
1288	__le16 reason;
1289	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
1290	u8 cid;
1291	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
1292	u8 tid;
1293	u8 reserved2[2];
1294} __packed;
1295
1296/* WMI_RCP_ADDBA_REQ_CMDID */
1297struct wmi_rcp_addba_req_cmd {
1298	/* Used for cid less than 8. For higher cid set
1299	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
1300	 */
1301	u8 cidxtid;
1302	u8 dialog_token;
1303	/* ieee80211_ba_parameterset field as it received */
1304	__le16 ba_param_set;
1305	__le16 ba_timeout;
1306	/* ieee80211_ba_seqstrl field as it received */
1307	__le16 ba_seq_ctrl;
1308	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
1309	u8 cid;
1310	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
1311	u8 tid;
1312	u8 reserved[2];
1313} __packed;
1314
1315/* WMI_SET_MAC_ADDRESS_CMDID */
1316struct wmi_set_mac_address_cmd {
1317	u8 mac[WMI_MAC_LEN];
1318	u8 reserved[2];
1319} __packed;
1320
1321/* WMI_ECHO_CMDID
1322 * Check FW is alive
 
 
1323 * Returned event: WMI_ECHO_RSP_EVENTID
 
1324 */
1325struct wmi_echo_cmd {
1326	__le32 value;
1327} __packed;
1328
1329/* WMI_DEEP_ECHO_CMDID
1330 * Check FW and uCode is alive
1331 * Returned event: WMI_DEEP_ECHO_RSP_EVENTID
1332 */
1333struct wmi_deep_echo_cmd {
1334	__le32 value;
1335} __packed;
1336
1337/* WMI_RF_PWR_ON_DELAY_CMDID
1338 * set FW time parameters used through RF resetting
1339 *  RF reset consists of bringing its power down for a period of time, then
1340 * bringing the power up
1341 * Returned event: WMI_RF_PWR_ON_DELAY_RSP_EVENTID
1342 */
1343struct wmi_rf_pwr_on_delay_cmd {
1344	/* time in usec the FW waits after bringing the RF PWR down,
1345	 * set 0 for default
1346	 */
1347	__le16 down_delay_usec;
1348	/* time in usec the FW waits after bringing the RF PWR up,
1349	 * set 0 for default
1350	 */
1351	__le16 up_delay_usec;
1352} __packed;
1353
1354/* WMI_SET_HIGH_POWER_TABLE_PARAMS_CMDID
1355 * This API controls the Tx and Rx gain over temperature.
1356 * It controls the Tx D-type, Rx D-type and Rx E-type amplifiers.
1357 * It also controls the Tx gain index, by controlling the Rx to Tx gain index
1358 * offset.
1359 * The control is divided by 3 temperature values to 4 temperature ranges.
1360 * Each parameter uses its own temperature values.
1361 * Returned event: WMI_SET_HIGH_POWER_TABLE_PARAMS_EVENTID
1362 */
1363struct wmi_set_high_power_table_params_cmd {
1364	/* Temperature range for Tx D-type parameters */
1365	u8 tx_dtype_temp[WMI_RF_DTYPE_LENGTH];
1366	u8 reserved0;
1367	/* Tx D-type values to be used for each temperature range */
1368	__le32 tx_dtype_conf[WMI_RF_DTYPE_CONF_LENGTH];
1369	/* Temperature range for Tx E-type parameters */
1370	u8 tx_etype_temp[WMI_RF_ETYPE_LENGTH];
1371	u8 reserved1;
1372	/* Tx E-type values to be used for each temperature range.
1373	 * The last 4 values of any range are the first 4 values of the next
1374	 * range and so on
1375	 */
1376	__le32 tx_etype_conf[WMI_RF_ETYPE_CONF_LENGTH];
1377	/* Temperature range for Rx D-type parameters */
1378	u8 rx_dtype_temp[WMI_RF_DTYPE_LENGTH];
1379	u8 reserved2;
1380	/* Rx D-type values to be used for each temperature range */
1381	__le32 rx_dtype_conf[WMI_RF_DTYPE_CONF_LENGTH];
1382	/* Temperature range for Rx E-type parameters */
1383	u8 rx_etype_temp[WMI_RF_ETYPE_LENGTH];
1384	u8 reserved3;
1385	/* Rx E-type values to be used for each temperature range.
1386	 * The last 4 values of any range are the first 4 values of the next
1387	 * range and so on
1388	 */
1389	__le32 rx_etype_conf[WMI_RF_ETYPE_CONF_LENGTH];
1390	/* Temperature range for rx_2_tx_offs parameters */
1391	u8 rx_2_tx_temp[WMI_RF_RX2TX_LENGTH];
1392	u8 reserved4;
1393	/* Rx to Tx gain index offset */
1394	s8 rx_2_tx_offs[WMI_RF_RX2TX_CONF_LENGTH];
1395} __packed;
1396
1397/* WMI_FIXED_SCHEDULING_UL_CONFIG_CMDID
1398 * This API sets rd parameter per mcs.
1399 * Relevant only in Fixed Scheduling mode.
1400 * Returned event: WMI_FIXED_SCHEDULING_UL_CONFIG_EVENTID
1401 */
1402struct wmi_fixed_scheduling_ul_config_cmd {
1403	/* Use mcs -1 to set for every mcs */
1404	s8 mcs;
1405	/* Number of frames with rd bit set in a single virtual slot */
1406	u8 rd_count_per_slot;
1407	u8 reserved[2];
1408} __packed;
1409
1410/* CMD: WMI_RF_XPM_READ_CMDID */
1411struct wmi_rf_xpm_read_cmd {
1412	u8 rf_id;
1413	u8 reserved[3];
1414	/* XPM bit start address in range [0,8191]bits - rounded by FW to
1415	 * multiple of 8bits
1416	 */
1417	__le32 xpm_bit_address;
1418	__le32 num_bytes;
1419} __packed;
1420
1421/* CMD: WMI_RF_XPM_WRITE_CMDID */
1422struct wmi_rf_xpm_write_cmd {
1423	u8 rf_id;
1424	u8 reserved0[3];
1425	/* XPM bit start address in range [0,8191]bits - rounded by FW to
1426	 * multiple of 8bits
1427	 */
1428	__le32 xpm_bit_address;
1429	__le32 num_bytes;
1430	/* boolean flag indicating whether FW should verify the write
1431	 * operation
1432	 */
1433	u8 verify;
1434	u8 reserved1[3];
1435	/* actual size=num_bytes */
1436	u8 data_bytes[0];
1437} __packed;
1438
1439/* Possible modes for temperature measurement */
 
 
 
 
 
1440enum wmi_temperature_measure_mode {
1441	TEMPERATURE_USE_OLD_VALUE	= 0x01,
1442	TEMPERATURE_MEASURE_NOW		= 0x02,
1443};
1444
1445/* WMI_TEMP_SENSE_CMDID */
1446struct wmi_temp_sense_cmd {
1447	__le32 measure_baseband_en;
1448	__le32 measure_rf_en;
1449	__le32 measure_mode;
1450} __packed;
1451
1452enum wmi_pmc_op {
1453	WMI_PMC_ALLOCATE	= 0x00,
1454	WMI_PMC_RELEASE		= 0x01,
1455};
1456
1457/* WMI_PMC_CMDID */
1458struct wmi_pmc_cmd {
1459	/* enum wmi_pmc_cmd_op_type */
1460	u8 op;
1461	u8 reserved;
1462	__le16 ring_size;
1463	__le64 mem_base;
1464} __packed;
1465
1466enum wmi_aoa_meas_type {
1467	WMI_AOA_PHASE_MEAS	= 0x00,
1468	WMI_AOA_PHASE_AMP_MEAS	= 0x01,
1469};
1470
1471/* WMI_AOA_MEAS_CMDID */
1472struct wmi_aoa_meas_cmd {
1473	u8 mac_addr[WMI_MAC_LEN];
1474	/* channels IDs:
1475	 * 0 - 58320 MHz
1476	 * 1 - 60480 MHz
1477	 * 2 - 62640 MHz
1478	 */
1479	u8 channel;
1480	/* enum wmi_aoa_meas_type */
1481	u8 aoa_meas_type;
1482	__le32 meas_rf_mask;
1483} __packed;
1484
1485/* WMI_SET_MGMT_RETRY_LIMIT_CMDID */
1486struct wmi_set_mgmt_retry_limit_cmd {
1487	/* MAC retransmit limit for mgmt frames */
1488	u8 mgmt_retry_limit;
1489	/* alignment to 32b */
1490	u8 reserved[3];
1491} __packed;
1492
1493/* Zones: HIGH, MAX, CRITICAL */
1494#define WMI_NUM_OF_TT_ZONES	(3)
1495
1496struct wmi_tt_zone_limits {
1497	/* Above this temperature this zone is active */
1498	u8 temperature_high;
1499	/* Below this temperature the adjacent lower zone is active */
1500	u8 temperature_low;
1501	u8 reserved[2];
1502} __packed;
1503
1504/* Struct used for both configuration and status commands of thermal
1505 * throttling
1506 */
1507struct wmi_tt_data {
1508	/* Enable/Disable TT algorithm for baseband */
1509	u8 bb_enabled;
1510	u8 reserved0[3];
1511	/* Define zones for baseband */
1512	struct wmi_tt_zone_limits bb_zones[WMI_NUM_OF_TT_ZONES];
1513	/* Enable/Disable TT algorithm for radio */
1514	u8 rf_enabled;
1515	u8 reserved1[3];
1516	/* Define zones for all radio chips */
1517	struct wmi_tt_zone_limits rf_zones[WMI_NUM_OF_TT_ZONES];
1518} __packed;
1519
1520/* WMI_SET_THERMAL_THROTTLING_CFG_CMDID */
1521struct wmi_set_thermal_throttling_cfg_cmd {
1522	/* Command data */
1523	struct wmi_tt_data tt_data;
1524} __packed;
1525
1526/* WMI_NEW_STA_CMDID */
1527struct wmi_new_sta_cmd {
1528	u8 dst_mac[WMI_MAC_LEN];
1529	u8 aid;
1530} __packed;
1531
1532/* WMI_DEL_STA_CMDID */
1533struct wmi_del_sta_cmd {
1534	u8 dst_mac[WMI_MAC_LEN];
1535	__le16 disconnect_reason;
1536} __packed;
1537
1538enum wmi_tof_burst_duration {
1539	WMI_TOF_BURST_DURATION_250_USEC		= 2,
1540	WMI_TOF_BURST_DURATION_500_USEC		= 3,
1541	WMI_TOF_BURST_DURATION_1_MSEC		= 4,
1542	WMI_TOF_BURST_DURATION_2_MSEC		= 5,
1543	WMI_TOF_BURST_DURATION_4_MSEC		= 6,
1544	WMI_TOF_BURST_DURATION_8_MSEC		= 7,
1545	WMI_TOF_BURST_DURATION_16_MSEC		= 8,
1546	WMI_TOF_BURST_DURATION_32_MSEC		= 9,
1547	WMI_TOF_BURST_DURATION_64_MSEC		= 10,
1548	WMI_TOF_BURST_DURATION_128_MSEC		= 11,
1549	WMI_TOF_BURST_DURATION_NO_PREFERENCES	= 15,
1550};
1551
1552enum wmi_tof_session_start_flags {
1553	WMI_TOF_SESSION_START_FLAG_SECURED	= 0x1,
1554	WMI_TOF_SESSION_START_FLAG_ASAP		= 0x2,
1555	WMI_TOF_SESSION_START_FLAG_LCI_REQ	= 0x4,
1556	WMI_TOF_SESSION_START_FLAG_LCR_REQ	= 0x8,
1557};
1558
1559/* WMI_TOF_SESSION_START_CMDID */
1560struct wmi_ftm_dest_info {
1561	u8 channel;
1562	/* wmi_tof_session_start_flags_e */
1563	u8 flags;
1564	u8 initial_token;
1565	u8 num_of_ftm_per_burst;
1566	u8 num_of_bursts_exp;
1567	/* wmi_tof_burst_duration_e */
1568	u8 burst_duration;
1569	/* Burst Period indicate interval between two consecutive burst
1570	 * instances, in units of 100 ms
1571	 */
1572	__le16 burst_period;
1573	u8 dst_mac[WMI_MAC_LEN];
1574	u8 reserved;
1575	u8 num_burst_per_aoa_meas;
1576} __packed;
1577
1578/* WMI_TOF_SESSION_START_CMDID */
1579struct wmi_tof_session_start_cmd {
1580	__le32 session_id;
1581	u8 reserved1;
1582	u8 aoa_type;
1583	__le16 num_of_dest;
1584	u8 reserved[4];
1585	struct wmi_ftm_dest_info ftm_dest_info[0];
1586} __packed;
1587
1588/* WMI_TOF_CFG_RESPONDER_CMDID */
1589struct wmi_tof_cfg_responder_cmd {
1590	u8 enable;
1591	u8 reserved[3];
1592} __packed;
1593
1594enum wmi_tof_channel_info_report_type {
1595	WMI_TOF_CHANNEL_INFO_TYPE_CIR			= 0x1,
1596	WMI_TOF_CHANNEL_INFO_TYPE_RSSI			= 0x2,
1597	WMI_TOF_CHANNEL_INFO_TYPE_SNR			= 0x4,
1598	WMI_TOF_CHANNEL_INFO_TYPE_DEBUG_DATA		= 0x8,
1599	WMI_TOF_CHANNEL_INFO_TYPE_VENDOR_SPECIFIC	= 0x10,
1600};
1601
1602/* WMI_TOF_CHANNEL_INFO_CMDID */
1603struct wmi_tof_channel_info_cmd {
1604	/* wmi_tof_channel_info_report_type_e */
1605	__le32 channel_info_report_request;
1606} __packed;
1607
1608/* WMI_TOF_SET_TX_RX_OFFSET_CMDID */
1609struct wmi_tof_set_tx_rx_offset_cmd {
1610	/* TX delay offset */
1611	__le32 tx_offset;
1612	/* RX delay offset */
1613	__le32 rx_offset;
1614	/* Mask to define which RFs to configure. 0 means all RFs */
1615	__le32 rf_mask;
1616	/* Offset to strongest tap of CIR */
1617	__le32 precursor;
1618} __packed;
1619
1620/* WMI_TOF_GET_TX_RX_OFFSET_CMDID */
1621struct wmi_tof_get_tx_rx_offset_cmd {
1622	/* rf index to read offsets from */
1623	u8 rf_index;
1624	u8 reserved[3];
1625} __packed;
1626
1627/* WMI_FIXED_SCHEDULING_CONFIG_CMDID */
1628struct wmi_map_mcs_to_schd_params {
1629	u8 mcs;
1630	/* time in usec from start slot to start tx flow - default 15 */
1631	u8 time_in_usec_before_initiate_tx;
1632	/* RD enable - if yes consider RD according to STA mcs */
1633	u8 rd_enabled;
1634	u8 reserved;
1635	/* time in usec from start slot to stop vring */
1636	__le16 time_in_usec_to_stop_vring;
1637	/* timeout to force flush from start of slot */
1638	__le16 flush_to_in_usec;
1639	/* per mcs the mac buffer limit size in bytes */
1640	__le32 mac_buff_size_in_bytes;
1641} __packed;
1642
1643/* WMI_FIXED_SCHEDULING_CONFIG_COMPLETE_EVENTID */
1644struct wmi_fixed_scheduling_config_complete_event {
1645	/* wmi_fw_status */
1646	u8 status;
1647	u8 reserved[3];
1648} __packed;
1649
1650/* This value exists for backwards compatibility only.
1651 * Do not use it in new commands.
1652 * Use dynamic arrays where possible.
1653 */
1654#define WMI_NUM_MCS	(13)
1655
1656/* WMI_FIXED_SCHEDULING_CONFIG_CMDID */
1657struct wmi_fixed_scheduling_config_cmd {
1658	/* defaults in the SAS table */
1659	struct wmi_map_mcs_to_schd_params mcs_to_schd_params_map[WMI_NUM_MCS];
1660	/* default 150 uSec */
1661	__le16 max_sta_rd_ppdu_duration_in_usec;
1662	/* default 300 uSec */
1663	__le16 max_sta_grant_ppdu_duration_in_usec;
1664	/* default 1000 uSec */
1665	__le16 assoc_slot_duration_in_usec;
1666	/* default 360 uSec */
1667	__le16 virtual_slot_duration_in_usec;
1668	/* each this field value slots start with grant frame to the station
1669	 * - default 2
1670	 */
1671	u8 number_of_ap_slots_for_initiate_grant;
1672	u8 reserved[3];
1673} __packed;
1674
1675/* WMI_ENABLE_FIXED_SCHEDULING_CMDID */
1676struct wmi_enable_fixed_scheduling_cmd {
1677	__le32 reserved;
1678} __packed;
1679
1680/* WMI_ENABLE_FIXED_SCHEDULING_COMPLETE_EVENTID */
1681struct wmi_enable_fixed_scheduling_complete_event {
1682	/* wmi_fw_status */
1683	u8 status;
1684	u8 reserved[3];
1685} __packed;
1686
1687/* WMI_SET_MULTI_DIRECTED_OMNIS_CONFIG_CMDID */
1688struct wmi_set_multi_directed_omnis_config_cmd {
1689	/* number of directed omnis at destination AP */
1690	u8 dest_ap_num_directed_omnis;
1691	u8 reserved[3];
1692} __packed;
1693
1694/* WMI_SET_MULTI_DIRECTED_OMNIS_CONFIG_EVENTID */
1695struct wmi_set_multi_directed_omnis_config_event {
1696	/* wmi_fw_status */
1697	u8 status;
1698	u8 reserved[3];
1699} __packed;
1700
1701/* WMI_RADAR_GENERAL_CONFIG_EVENTID */
1702struct wmi_radar_general_config_event {
1703	/* wmi_fw_status */
1704	u8 status;
1705	u8 reserved[3];
1706} __packed;
1707
1708/* WMI_RADAR_CONFIG_SELECT_EVENTID */
1709struct wmi_radar_config_select_event {
1710	/* wmi_fw_status */
1711	u8 status;
1712	u8 reserved[3];
1713	/* In unit of bytes */
1714	__le32 fifo_size;
1715	/* In unit of bytes */
1716	__le32 pulse_size;
1717} __packed;
1718
1719/* WMI_RADAR_PARAMS_CONFIG_EVENTID */
1720struct wmi_radar_params_config_event {
1721	/* wmi_fw_status */
1722	u8 status;
1723	u8 reserved[3];
1724} __packed;
1725
1726/* WMI_RADAR_SET_MODE_EVENTID */
1727struct wmi_radar_set_mode_event {
1728	/* wmi_fw_status */
1729	u8 status;
1730	u8 reserved[3];
1731} __packed;
1732
1733/* WMI_RADAR_CONTROL_EVENTID */
1734struct wmi_radar_control_event {
1735	/* wmi_fw_status */
1736	u8 status;
1737	u8 reserved[3];
1738} __packed;
1739
1740/* WMI_RADAR_PCI_CONTROL_EVENTID */
1741struct wmi_radar_pci_control_event {
1742	/* wmi_fw_status */
1743	u8 status;
1744	u8 reserved[3];
1745} __packed;
1746
1747/* WMI_SET_LONG_RANGE_CONFIG_CMDID */
1748struct wmi_set_long_range_config_cmd {
1749	__le32 reserved;
1750} __packed;
1751
1752/* WMI_SET_LONG_RANGE_CONFIG_COMPLETE_EVENTID */
1753struct wmi_set_long_range_config_complete_event {
1754	/* wmi_fw_status */
1755	u8 status;
1756	u8 reserved[3];
1757} __packed;
1758
1759/* payload max size is 1024 bytes: max event buffer size (1044) - WMI headers
1760 * (16) - prev struct field size (4)
1761 */
1762#define WMI_MAX_IOCTL_PAYLOAD_SIZE		(1024)
1763#define WMI_MAX_IOCTL_REPLY_PAYLOAD_SIZE	(1024)
1764#define WMI_MAX_INTERNAL_EVENT_PAYLOAD_SIZE	(1024)
1765
1766enum wmi_internal_fw_ioctl_code {
1767	WMI_INTERNAL_FW_CODE_NONE	= 0x0,
1768	WMI_INTERNAL_FW_CODE_QCOM	= 0x1,
1769};
1770
1771/* WMI_INTERNAL_FW_IOCTL_CMDID */
1772struct wmi_internal_fw_ioctl_cmd {
1773	/* enum wmi_internal_fw_ioctl_code */
1774	__le16 code;
1775	__le16 length;
1776	/* payload max size is WMI_MAX_IOCTL_PAYLOAD_SIZE
1777	 * Must be the last member of the struct
1778	 */
1779	__le32 payload[0];
1780} __packed;
1781
1782/* WMI_INTERNAL_FW_IOCTL_EVENTID */
1783struct wmi_internal_fw_ioctl_event {
1784	/* wmi_fw_status */
1785	u8 status;
1786	u8 reserved;
1787	__le16 length;
1788	/* payload max size is WMI_MAX_IOCTL_REPLY_PAYLOAD_SIZE
1789	 * Must be the last member of the struct
1790	 */
1791	__le32 payload[0];
1792} __packed;
1793
1794/* WMI_INTERNAL_FW_EVENT_EVENTID */
1795struct wmi_internal_fw_event_event {
1796	__le16 id;
1797	__le16 length;
1798	/* payload max size is WMI_MAX_INTERNAL_EVENT_PAYLOAD_SIZE
1799	 * Must be the last member of the struct
1800	 */
1801	__le32 payload[0];
1802} __packed;
1803
1804/* WMI_SET_VRING_PRIORITY_WEIGHT_CMDID */
1805struct wmi_set_vring_priority_weight_cmd {
1806	/* Array of weights. Valid values are
1807	 * WMI_QOS_MIN_DEFAULT_WEIGHT...WMI_QOS_MAX_WEIGHT. Weight #0 is
1808	 * hard-coded WMI_QOS_MIN_WEIGHT. This array provide the weights
1809	 * #1..#3
1810	 */
1811	u8 weight[3];
1812	u8 reserved;
1813} __packed;
1814
1815/* WMI_SET_VRING_PRIORITY_CMDID */
1816struct wmi_vring_priority {
1817	u8 vring_idx;
1818	/* Weight index. Valid value is 0-3 */
1819	u8 priority;
1820	u8 reserved[2];
1821} __packed;
1822
1823/* WMI_SET_VRING_PRIORITY_CMDID */
1824struct wmi_set_vring_priority_cmd {
1825	/* number of entries in vring_priority. Set to
1826	 * WMI_QOS_SET_VIF_PRIORITY to update the VIF's priority, and there
1827	 * will be only one entry in vring_priority
1828	 */
1829	u8 num_of_vrings;
1830	u8 reserved[3];
1831	struct wmi_vring_priority vring_priority[0];
1832} __packed;
1833
1834/* WMI_BF_CONTROL_CMDID - deprecated */
1835struct wmi_bf_control_cmd {
1836	/* wmi_bf_triggers */
1837	__le32 triggers;
1838	u8 cid;
1839	/* DISABLED = 0, ENABLED = 1 , DRY_RUN = 2 */
1840	u8 txss_mode;
1841	/* DISABLED = 0, ENABLED = 1, DRY_RUN = 2 */
1842	u8 brp_mode;
1843	/* Max cts threshold (correspond to
1844	 * WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_TXOP)
1845	 */
1846	u8 bf_trigger_max_cts_failure_thr;
1847	/* Max cts threshold in dense (correspond to
1848	 * WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_TXOP)
1849	 */
1850	u8 bf_trigger_max_cts_failure_dense_thr;
1851	/* Max b-ack threshold (correspond to
1852	 * WMI_BF_TRIGGER_MAX_BACK_FAILURE)
1853	 */
1854	u8 bf_trigger_max_back_failure_thr;
1855	/* Max b-ack threshold in dense (correspond to
1856	 * WMI_BF_TRIGGER_MAX_BACK_FAILURE)
1857	 */
1858	u8 bf_trigger_max_back_failure_dense_thr;
1859	u8 reserved0;
1860	/* Wrong sectors threshold */
1861	__le32 wrong_sector_bis_thr;
1862	/* BOOL to enable/disable long term trigger */
1863	u8 long_term_enable;
1864	/* 1 = Update long term thresholds from the long_term_mbps_th_tbl and
1865	 * long_term_trig_timeout_per_mcs arrays, 0 = Ignore
1866	 */
1867	u8 long_term_update_thr;
1868	/* Long term throughput threshold [Mbps] */
1869	u8 long_term_mbps_th_tbl[WMI_NUM_MCS];
1870	u8 reserved1;
1871	/* Long term timeout threshold table [msec] */
1872	__le16 long_term_trig_timeout_per_mcs[WMI_NUM_MCS];
1873	u8 reserved2[2];
1874} __packed;
1875
1876/* BF configuration for each MCS */
1877struct wmi_bf_control_ex_mcs {
1878	/* Long term throughput threshold [Mbps] */
1879	u8 long_term_mbps_th_tbl;
1880	u8 reserved;
1881	/* Long term timeout threshold table [msec] */
1882	__le16 long_term_trig_timeout_per_mcs;
1883} __packed;
1884
1885/* WMI_BF_CONTROL_EX_CMDID */
1886struct wmi_bf_control_ex_cmd {
1887	/* wmi_bf_triggers */
1888	__le32 triggers;
1889	/* enum wmi_edmg_tx_mode */
1890	u8 tx_mode;
1891	/* DISABLED = 0, ENABLED = 1 , DRY_RUN = 2 */
1892	u8 txss_mode;
1893	/* DISABLED = 0, ENABLED = 1, DRY_RUN = 2 */
1894	u8 brp_mode;
1895	/* Max cts threshold (correspond to
1896	 * WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_TXOP)
1897	 */
1898	u8 bf_trigger_max_cts_failure_thr;
1899	/* Max cts threshold in dense (correspond to
1900	 * WMI_BF_TRIGGER_MAX_CTS_FAILURE_IN_TXOP)
1901	 */
1902	u8 bf_trigger_max_cts_failure_dense_thr;
1903	/* Max b-ack threshold (correspond to
1904	 * WMI_BF_TRIGGER_MAX_BACK_FAILURE)
1905	 */
1906	u8 bf_trigger_max_back_failure_thr;
1907	/* Max b-ack threshold in dense (correspond to
1908	 * WMI_BF_TRIGGER_MAX_BACK_FAILURE)
1909	 */
1910	u8 bf_trigger_max_back_failure_dense_thr;
1911	u8 reserved0;
1912	/* Wrong sectors threshold */
1913	__le32 wrong_sector_bis_thr;
1914	/* BOOL to enable/disable long term trigger */
1915	u8 long_term_enable;
1916	/* 1 = Update long term thresholds from the long_term_mbps_th_tbl and
1917	 * long_term_trig_timeout_per_mcs arrays, 0 = Ignore
1918	 */
1919	u8 long_term_update_thr;
1920	u8 each_mcs_cfg_size;
1921	u8 reserved1;
1922	/* Configuration for each MCS */
1923	struct wmi_bf_control_ex_mcs each_mcs_cfg[0];
1924} __packed;
1925
1926/* WMI_LINK_STATS_CMD */
1927enum wmi_link_stats_action {
1928	WMI_LINK_STATS_SNAPSHOT		= 0x00,
1929	WMI_LINK_STATS_PERIODIC		= 0x01,
1930	WMI_LINK_STATS_STOP_PERIODIC	= 0x02,
1931};
1932
1933/* WMI_LINK_STATS_EVENT record identifiers */
1934enum wmi_link_stats_record_type {
1935	WMI_LINK_STATS_TYPE_BASIC	= 0x01,
1936	WMI_LINK_STATS_TYPE_GLOBAL	= 0x02,
1937};
1938
1939/* WMI_LINK_STATS_CMDID */
1940struct wmi_link_stats_cmd {
1941	/* bitmask of required record types
1942	 * (wmi_link_stats_record_type_e)
1943	 */
1944	__le32 record_type_mask;
1945	/* 0xff for all cids */
1946	u8 cid;
1947	/* wmi_link_stats_action_e */
1948	u8 action;
1949	u8 reserved[6];
1950	/* range = 100 - 10000 */
1951	__le32 interval_msec;
1952} __packed;
1953
1954/* WMI_SET_GRANT_MCS_CMDID */
1955struct wmi_set_grant_mcs_cmd {
1956	u8 mcs;
1957	u8 reserved[3];
1958} __packed;
1959
1960/* WMI_SET_AP_SLOT_SIZE_CMDID */
1961struct wmi_set_ap_slot_size_cmd {
1962	__le32 slot_size;
1963} __packed;
1964
1965/* WMI_TEMP_SENSE_ALL_CMDID */
1966struct wmi_temp_sense_all_cmd {
1967	u8 measure_baseband_en;
1968	u8 measure_rf_en;
1969	u8 measure_mode;
1970	u8 reserved;
1971} __packed;
1972
1973/* WMI Events
1974 * List of Events (target to host)
1975 */
1976enum wmi_event_id {
1977	WMI_READY_EVENTID				= 0x1001,
1978	WMI_CONNECT_EVENTID				= 0x1002,
1979	WMI_DISCONNECT_EVENTID				= 0x1003,
1980	WMI_START_SCHED_SCAN_EVENTID			= 0x1005,
1981	WMI_STOP_SCHED_SCAN_EVENTID			= 0x1006,
1982	WMI_SCHED_SCAN_RESULT_EVENTID			= 0x1007,
1983	WMI_SCAN_COMPLETE_EVENTID			= 0x100A,
1984	WMI_REPORT_STATISTICS_EVENTID			= 0x100B,
1985	WMI_FT_AUTH_STATUS_EVENTID			= 0x100C,
1986	WMI_FT_REASSOC_STATUS_EVENTID			= 0x100D,
1987	WMI_RADAR_GENERAL_CONFIG_EVENTID		= 0x1100,
1988	WMI_RADAR_CONFIG_SELECT_EVENTID			= 0x1101,
1989	WMI_RADAR_PARAMS_CONFIG_EVENTID			= 0x1102,
1990	WMI_RADAR_SET_MODE_EVENTID			= 0x1103,
1991	WMI_RADAR_CONTROL_EVENTID			= 0x1104,
1992	WMI_RADAR_PCI_CONTROL_EVENTID			= 0x1105,
1993	WMI_RD_MEM_RSP_EVENTID				= 0x1800,
1994	WMI_FW_READY_EVENTID				= 0x1801,
1995	WMI_EXIT_FAST_MEM_ACC_MODE_EVENTID		= 0x200,
1996	WMI_ECHO_RSP_EVENTID				= 0x1803,
1997	WMI_DEEP_ECHO_RSP_EVENTID			= 0x1804,
1998	/* deprecated */
1999	WMI_FS_TUNE_DONE_EVENTID			= 0x180A,
2000	/* deprecated */
2001	WMI_CORR_MEASURE_EVENTID			= 0x180B,
2002	WMI_READ_RSSI_EVENTID				= 0x180C,
2003	WMI_TEMP_SENSE_DONE_EVENTID			= 0x180E,
2004	WMI_DC_CALIB_DONE_EVENTID			= 0x180F,
2005	/* deprecated */
2006	WMI_IQ_TX_CALIB_DONE_EVENTID			= 0x1811,
2007	/* deprecated */
2008	WMI_IQ_RX_CALIB_DONE_EVENTID			= 0x1812,
2009	WMI_SET_WORK_MODE_DONE_EVENTID			= 0x1815,
2010	WMI_LO_LEAKAGE_CALIB_DONE_EVENTID		= 0x1816,
2011	WMI_LO_POWER_CALIB_FROM_OTP_EVENTID		= 0x1817,
2012	WMI_SILENT_RSSI_CALIB_DONE_EVENTID		= 0x181D,
2013	/* deprecated */
2014	WMI_RF_RX_TEST_DONE_EVENTID			= 0x181E,
2015	WMI_CFG_RX_CHAIN_DONE_EVENTID			= 0x1820,
2016	WMI_VRING_CFG_DONE_EVENTID			= 0x1821,
2017	WMI_BA_STATUS_EVENTID				= 0x1823,
2018	WMI_RCP_ADDBA_REQ_EVENTID			= 0x1824,
2019	WMI_RCP_ADDBA_RESP_SENT_EVENTID			= 0x1825,
2020	WMI_DELBA_EVENTID				= 0x1826,
2021	WMI_GET_SSID_EVENTID				= 0x1828,
2022	WMI_GET_PCP_CHANNEL_EVENTID			= 0x182A,
2023	/* Event is shared between WMI_SW_TX_REQ_CMDID and
2024	 * WMI_SW_TX_REQ_EXT_CMDID
2025	 */
2026	WMI_SW_TX_COMPLETE_EVENTID			= 0x182B,
2027	WMI_BEAMFORMING_MGMT_DONE_EVENTID		= 0x1836,
2028	WMI_BF_TXSS_MGMT_DONE_EVENTID			= 0x1837,
2029	WMI_BF_RXSS_MGMT_DONE_EVENTID			= 0x1839,
2030	WMI_BF_TRIG_EVENTID				= 0x183A,
2031	WMI_RS_MGMT_DONE_EVENTID			= 0x1852,
2032	WMI_RF_MGMT_STATUS_EVENTID			= 0x1853,
2033	WMI_BF_SM_MGMT_DONE_EVENTID			= 0x1838,
2034	WMI_RX_MGMT_PACKET_EVENTID			= 0x1840,
2035	WMI_TX_MGMT_PACKET_EVENTID			= 0x1841,
2036	WMI_LINK_MAINTAIN_CFG_WRITE_DONE_EVENTID	= 0x1842,
2037	WMI_LINK_MAINTAIN_CFG_READ_DONE_EVENTID		= 0x1843,
2038	WMI_RF_XPM_READ_RESULT_EVENTID			= 0x1856,
2039	WMI_RF_XPM_WRITE_RESULT_EVENTID			= 0x1857,
2040	WMI_LED_CFG_DONE_EVENTID			= 0x1858,
2041	WMI_SET_SILENT_RSSI_TABLE_DONE_EVENTID		= 0x185C,
2042	WMI_RF_PWR_ON_DELAY_RSP_EVENTID			= 0x185D,
2043	WMI_SET_HIGH_POWER_TABLE_PARAMS_EVENTID		= 0x185E,
2044	WMI_FIXED_SCHEDULING_UL_CONFIG_EVENTID		= 0x185F,
2045	/* Performance monitoring events */
2046	WMI_DATA_PORT_OPEN_EVENTID			= 0x1860,
2047	WMI_WBE_LINK_DOWN_EVENTID			= 0x1861,
2048	WMI_BF_CTRL_DONE_EVENTID			= 0x1862,
2049	WMI_NOTIFY_REQ_DONE_EVENTID			= 0x1863,
2050	WMI_GET_STATUS_DONE_EVENTID			= 0x1864,
2051	WMI_RING_EN_EVENTID				= 0x1865,
2052	WMI_GET_RF_STATUS_EVENTID			= 0x1866,
2053	WMI_GET_BASEBAND_TYPE_EVENTID			= 0x1867,
2054	WMI_VRING_SWITCH_TIMING_CONFIG_EVENTID		= 0x1868,
2055	WMI_UNIT_TEST_EVENTID				= 0x1900,
2056	WMI_FLASH_READ_DONE_EVENTID			= 0x1902,
2057	WMI_FLASH_WRITE_DONE_EVENTID			= 0x1903,
2058	/* Power management */
2059	WMI_TRAFFIC_SUSPEND_EVENTID			= 0x1904,
2060	WMI_TRAFFIC_RESUME_EVENTID			= 0x1905,
2061	/* P2P */
2062	WMI_P2P_CFG_DONE_EVENTID			= 0x1910,
2063	WMI_PORT_ALLOCATED_EVENTID			= 0x1911,
2064	WMI_PORT_DELETED_EVENTID			= 0x1912,
2065	WMI_LISTEN_STARTED_EVENTID			= 0x1914,
2066	WMI_SEARCH_STARTED_EVENTID			= 0x1915,
2067	WMI_DISCOVERY_STARTED_EVENTID			= 0x1916,
2068	WMI_DISCOVERY_STOPPED_EVENTID			= 0x1917,
2069	WMI_PCP_STARTED_EVENTID				= 0x1918,
2070	WMI_PCP_STOPPED_EVENTID				= 0x1919,
2071	WMI_PCP_FACTOR_EVENTID				= 0x191A,
2072	/* Power Save Configuration Events */
2073	WMI_PS_DEV_PROFILE_CFG_EVENTID			= 0x191C,
2074	WMI_RS_ENABLE_EVENTID				= 0x191E,
2075	WMI_RS_CFG_EX_EVENTID				= 0x191F,
2076	WMI_GET_DETAILED_RS_RES_EX_EVENTID		= 0x1920,
2077	/* deprecated */
2078	WMI_RS_CFG_DONE_EVENTID				= 0x1921,
2079	/* deprecated */
2080	WMI_GET_DETAILED_RS_RES_EVENTID			= 0x1922,
2081	WMI_AOA_MEAS_EVENTID				= 0x1923,
2082	WMI_BRP_SET_ANT_LIMIT_EVENTID			= 0x1924,
2083	WMI_SET_MGMT_RETRY_LIMIT_EVENTID		= 0x1930,
2084	WMI_GET_MGMT_RETRY_LIMIT_EVENTID		= 0x1931,
2085	WMI_SET_THERMAL_THROTTLING_CFG_EVENTID		= 0x1940,
2086	WMI_GET_THERMAL_THROTTLING_CFG_EVENTID		= 0x1941,
2087	/* return the Power Save profile */
2088	WMI_PS_DEV_PROFILE_CFG_READ_EVENTID		= 0x1942,
2089	WMI_TSF_SYNC_STATUS_EVENTID			= 0x1973,
2090	WMI_TOF_SESSION_END_EVENTID			= 0x1991,
2091	WMI_TOF_GET_CAPABILITIES_EVENTID		= 0x1992,
2092	WMI_TOF_SET_LCR_EVENTID				= 0x1993,
2093	WMI_TOF_SET_LCI_EVENTID				= 0x1994,
2094	WMI_TOF_FTM_PER_DEST_RES_EVENTID		= 0x1995,
2095	WMI_TOF_CFG_RESPONDER_EVENTID			= 0x1996,
2096	WMI_TOF_SET_TX_RX_OFFSET_EVENTID		= 0x1997,
2097	WMI_TOF_GET_TX_RX_OFFSET_EVENTID		= 0x1998,
2098	WMI_TOF_CHANNEL_INFO_EVENTID			= 0x1999,
2099	WMI_GET_RF_SECTOR_PARAMS_DONE_EVENTID		= 0x19A0,
2100	WMI_SET_RF_SECTOR_PARAMS_DONE_EVENTID		= 0x19A1,
2101	WMI_GET_SELECTED_RF_SECTOR_INDEX_DONE_EVENTID	= 0x19A2,
2102	WMI_SET_SELECTED_RF_SECTOR_INDEX_DONE_EVENTID	= 0x19A3,
2103	WMI_SET_RF_SECTOR_ON_DONE_EVENTID		= 0x19A4,
2104	WMI_PRIO_TX_SECTORS_ORDER_EVENTID		= 0x19A5,
2105	WMI_PRIO_TX_SECTORS_NUMBER_EVENTID		= 0x19A6,
2106	WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID	= 0x19A7,
2107	/* deprecated */
2108	WMI_BF_CONTROL_EVENTID				= 0x19AA,
2109	WMI_BF_CONTROL_EX_EVENTID			= 0x19AB,
2110	WMI_TX_STATUS_RING_CFG_DONE_EVENTID		= 0x19C0,
2111	WMI_RX_STATUS_RING_CFG_DONE_EVENTID		= 0x19C1,
2112	WMI_TX_DESC_RING_CFG_DONE_EVENTID		= 0x19C2,
2113	WMI_RX_DESC_RING_CFG_DONE_EVENTID		= 0x19C3,
2114	WMI_CFG_DEF_RX_OFFLOAD_DONE_EVENTID		= 0x19C5,
2115	WMI_SCHEDULING_SCHEME_EVENTID			= 0x1A01,
2116	WMI_FIXED_SCHEDULING_CONFIG_COMPLETE_EVENTID	= 0x1A02,
2117	WMI_ENABLE_FIXED_SCHEDULING_COMPLETE_EVENTID	= 0x1A03,
2118	WMI_SET_MULTI_DIRECTED_OMNIS_CONFIG_EVENTID	= 0x1A04,
2119	WMI_SET_LONG_RANGE_CONFIG_COMPLETE_EVENTID	= 0x1A05,
2120	WMI_GET_ASSOC_LIST_RES_EVENTID			= 0x1A06,
2121	WMI_GET_CCA_INDICATIONS_EVENTID			= 0x1A07,
2122	WMI_SET_CCA_INDICATIONS_BI_AVG_NUM_EVENTID	= 0x1A08,
2123	WMI_INTERNAL_FW_EVENT_EVENTID			= 0x1A0A,
2124	WMI_INTERNAL_FW_IOCTL_EVENTID			= 0x1A0B,
2125	WMI_LINK_STATS_CONFIG_DONE_EVENTID		= 0x1A0C,
2126	WMI_LINK_STATS_EVENTID				= 0x1A0D,
2127	WMI_SET_GRANT_MCS_EVENTID			= 0x1A0E,
2128	WMI_SET_AP_SLOT_SIZE_EVENTID			= 0x1A0F,
2129	WMI_SET_VRING_PRIORITY_WEIGHT_EVENTID		= 0x1A10,
2130	WMI_SET_VRING_PRIORITY_EVENTID			= 0x1A11,
2131	WMI_RBUFCAP_CFG_EVENTID				= 0x1A12,
2132	WMI_TEMP_SENSE_ALL_DONE_EVENTID			= 0x1A13,
2133	WMI_SET_CHANNEL_EVENTID				= 0x9000,
2134	WMI_ASSOC_REQ_EVENTID				= 0x9001,
2135	WMI_EAPOL_RX_EVENTID				= 0x9002,
2136	WMI_MAC_ADDR_RESP_EVENTID			= 0x9003,
2137	WMI_FW_VER_EVENTID				= 0x9004,
2138	WMI_ACS_PASSIVE_SCAN_COMPLETE_EVENTID		= 0x9005,
2139	WMI_INTERNAL_FW_SET_CHANNEL			= 0x9006,
2140	WMI_COMMAND_NOT_SUPPORTED_EVENTID		= 0xFFFF,
2141};
2142
2143/* Events data structures */
2144enum wmi_fw_status {
2145	WMI_FW_STATUS_SUCCESS	= 0x00,
2146	WMI_FW_STATUS_FAILURE	= 0x01,
2147};
2148
2149/* WMI_RF_MGMT_STATUS_EVENTID */
2150enum wmi_rf_status {
2151	WMI_RF_ENABLED		= 0x00,
2152	WMI_RF_DISABLED_HW	= 0x01,
2153	WMI_RF_DISABLED_SW	= 0x02,
2154	WMI_RF_DISABLED_HW_SW	= 0x03,
2155};
2156
2157/* WMI_RF_MGMT_STATUS_EVENTID */
2158struct wmi_rf_mgmt_status_event {
2159	__le32 rf_status;
2160} __packed;
2161
2162/* WMI_GET_STATUS_DONE_EVENTID */
2163struct wmi_get_status_done_event {
2164	__le32 is_associated;
2165	u8 cid;
2166	u8 reserved0[3];
2167	u8 bssid[WMI_MAC_LEN];
2168	u8 channel;
2169	u8 reserved1;
2170	u8 network_type;
2171	u8 reserved2[3];
2172	__le32 ssid_len;
2173	u8 ssid[WMI_MAX_SSID_LEN];
2174	__le32 rf_status;
2175	__le32 is_secured;
2176} __packed;
2177
2178/* WMI_FW_VER_EVENTID */
2179struct wmi_fw_ver_event {
2180	/* FW image version */
2181	__le32 fw_major;
2182	__le32 fw_minor;
2183	__le32 fw_subminor;
2184	__le32 fw_build;
2185	/* FW image build time stamp */
2186	__le32 hour;
2187	__le32 minute;
2188	__le32 second;
2189	__le32 day;
2190	__le32 month;
2191	__le32 year;
2192	/* Boot Loader image version */
2193	__le32 bl_major;
2194	__le32 bl_minor;
2195	__le32 bl_subminor;
2196	__le32 bl_build;
2197	/* The number of entries in the FW capabilities array */
2198	u8 fw_capabilities_len;
2199	u8 reserved[3];
2200	/* FW capabilities info
2201	 * Must be the last member of the struct
2202	 */
2203	__le32 fw_capabilities[0];
2204} __packed;
2205
2206/* WMI_GET_RF_STATUS_EVENTID */
2207enum rf_type {
2208	RF_UNKNOWN	= 0x00,
2209	RF_MARLON	= 0x01,
2210	RF_SPARROW	= 0x02,
2211	RF_TALYNA1	= 0x03,
2212	RF_TALYNA2	= 0x04,
2213};
2214
2215/* WMI_GET_RF_STATUS_EVENTID */
2216enum board_file_rf_type {
2217	BF_RF_MARLON	= 0x00,
2218	BF_RF_SPARROW	= 0x01,
2219	BF_RF_TALYNA1	= 0x02,
2220	BF_RF_TALYNA2	= 0x03,
2221};
2222
2223/* WMI_GET_RF_STATUS_EVENTID */
2224enum rf_status {
2225	RF_OK			= 0x00,
2226	RF_NO_COMM		= 0x01,
2227	RF_WRONG_BOARD_FILE	= 0x02,
2228};
2229
2230/* WMI_GET_RF_STATUS_EVENTID */
2231struct wmi_get_rf_status_event {
2232	/* enum rf_type */
2233	__le32 rf_type;
2234	/* attached RFs bit vector */
2235	__le32 attached_rf_vector;
2236	/* enabled RFs bit vector */
2237	__le32 enabled_rf_vector;
2238	/* enum rf_status, refers to enabled RFs */
2239	u8 rf_status[32];
2240	/* enum board file RF type */
2241	__le32 board_file_rf_type;
2242	/* board file platform type */
2243	__le32 board_file_platform_type;
2244	/* board file version */
2245	__le32 board_file_version;
2246	/* enabled XIFs bit vector */
2247	__le32 enabled_xif_vector;
2248	__le32 reserved;
2249} __packed;
2250
2251/* WMI_GET_BASEBAND_TYPE_EVENTID */
2252enum baseband_type {
2253	BASEBAND_UNKNOWN	= 0x00,
2254	BASEBAND_SPARROW_M_A0	= 0x03,
2255	BASEBAND_SPARROW_M_A1	= 0x04,
2256	BASEBAND_SPARROW_M_B0	= 0x05,
2257	BASEBAND_SPARROW_M_C0	= 0x06,
2258	BASEBAND_SPARROW_M_D0	= 0x07,
2259	BASEBAND_TALYN_M_A0	= 0x08,
2260	BASEBAND_TALYN_M_B0	= 0x09,
2261};
2262
2263/* WMI_GET_BASEBAND_TYPE_EVENTID */
2264struct wmi_get_baseband_type_event {
2265	/* enum baseband_type */
2266	__le32 baseband_type;
2267} __packed;
2268
2269/* WMI_MAC_ADDR_RESP_EVENTID */
2270struct wmi_mac_addr_resp_event {
2271	u8 mac[WMI_MAC_LEN];
2272	u8 auth_mode;
2273	u8 crypt_mode;
2274	__le32 offload_mode;
2275} __packed;
2276
2277/* WMI_EAPOL_RX_EVENTID */
2278struct wmi_eapol_rx_event {
2279	u8 src_mac[WMI_MAC_LEN];
2280	__le16 eapol_len;
2281	u8 eapol[0];
2282} __packed;
2283
2284/* WMI_READY_EVENTID */
2285enum wmi_phy_capability {
2286	WMI_11A_CAPABILITY		= 0x01,
2287	WMI_11G_CAPABILITY		= 0x02,
2288	WMI_11AG_CAPABILITY		= 0x03,
2289	WMI_11NA_CAPABILITY		= 0x04,
2290	WMI_11NG_CAPABILITY		= 0x05,
2291	WMI_11NAG_CAPABILITY		= 0x06,
2292	WMI_11AD_CAPABILITY		= 0x07,
2293	WMI_11N_CAPABILITY_OFFSET	= 0x03,
2294};
2295
2296struct wmi_ready_event {
2297	__le32 sw_version;
2298	__le32 abi_version;
2299	u8 mac[WMI_MAC_LEN];
2300	/* enum wmi_phy_capability */
2301	u8 phy_capability;
2302	u8 numof_additional_mids;
2303	/* rfc read calibration result. 5..15 */
2304	u8 rfc_read_calib_result;
2305	/* Max associated STAs supported by FW in AP mode (default 0 means 8
2306	 * STA)
2307	 */
2308	u8 max_assoc_sta;
2309	u8 reserved[2];
2310} __packed;
2311
2312/* WMI_NOTIFY_REQ_DONE_EVENTID */
2313struct wmi_notify_req_done_event {
2314	/* beamforming status, 0: fail; 1: OK; 2: retrying */
2315	__le32 status;
2316	__le64 tsf;
2317	s8 rssi;
2318	/* enum wmi_edmg_tx_mode */
2319	u8 tx_mode;
2320	u8 reserved0[2];
2321	__le32 tx_tpt;
2322	__le32 tx_goodput;
2323	__le32 rx_goodput;
2324	__le16 bf_mcs;
2325	__le16 my_rx_sector;
2326	__le16 my_tx_sector;
2327	__le16 other_rx_sector;
2328	__le16 other_tx_sector;
2329	__le16 range;
2330	u8 sqi;
2331	u8 reserved[3];
2332} __packed;
2333
2334/* WMI_CONNECT_EVENTID */
2335struct wmi_connect_event {
2336	/* enum wmi_channel WMI_CHANNEL_1..WMI_CHANNEL_6; for EDMG this is
2337	 * the primary channel number
2338	 */
2339	u8 channel;
2340	/* enum wmi_channel WMI_CHANNEL_9..WMI_CHANNEL_12 */
2341	u8 edmg_channel;
2342	u8 bssid[WMI_MAC_LEN];
2343	__le16 listen_interval;
2344	__le16 beacon_interval;
2345	u8 network_type;
2346	u8 reserved1[3];
2347	u8 beacon_ie_len;
2348	u8 assoc_req_len;
2349	u8 assoc_resp_len;
2350	u8 cid;
2351	u8 aid;
2352	u8 reserved2[2];
2353	/* not in use */
2354	u8 assoc_info[0];
2355} __packed;
2356
2357/* disconnect_reason */
2358enum wmi_disconnect_reason {
2359	WMI_DIS_REASON_NO_NETWORK_AVAIL		= 0x01,
2360	/* bmiss */
2361	WMI_DIS_REASON_LOST_LINK		= 0x02,
2362	WMI_DIS_REASON_DISCONNECT_CMD		= 0x03,
2363	WMI_DIS_REASON_BSS_DISCONNECTED		= 0x04,
2364	WMI_DIS_REASON_AUTH_FAILED		= 0x05,
2365	WMI_DIS_REASON_ASSOC_FAILED		= 0x06,
2366	WMI_DIS_REASON_NO_RESOURCES_AVAIL	= 0x07,
2367	WMI_DIS_REASON_CSERV_DISCONNECT		= 0x08,
2368	WMI_DIS_REASON_INVALID_PROFILE		= 0x0A,
2369	WMI_DIS_REASON_DOT11H_CHANNEL_SWITCH	= 0x0B,
2370	WMI_DIS_REASON_PROFILE_MISMATCH		= 0x0C,
2371	WMI_DIS_REASON_CONNECTION_EVICTED	= 0x0D,
2372	WMI_DIS_REASON_IBSS_MERGE		= 0x0E,
2373	WMI_DIS_REASON_HIGH_TEMPERATURE		= 0x0F,
2374};
2375
2376/* WMI_DISCONNECT_EVENTID */
2377struct wmi_disconnect_event {
2378	/* reason code, see 802.11 spec. */
2379	__le16 protocol_reason_status;
2380	/* set if known */
2381	u8 bssid[WMI_MAC_LEN];
2382	/* see enum wmi_disconnect_reason */
2383	u8 disconnect_reason;
2384	/* last assoc req may passed to host - not in used */
2385	u8 assoc_resp_len;
2386	/* last assoc req may passed to host - not in used */
2387	u8 assoc_info[0];
2388} __packed;
2389
2390/* WMI_SCAN_COMPLETE_EVENTID */
2391enum scan_status {
2392	WMI_SCAN_SUCCESS	= 0x00,
2393	WMI_SCAN_FAILED		= 0x01,
2394	WMI_SCAN_ABORTED	= 0x02,
2395	WMI_SCAN_REJECTED	= 0x03,
2396	WMI_SCAN_ABORT_REJECTED	= 0x04,
2397};
2398
2399struct wmi_scan_complete_event {
2400	/* enum scan_status */
2401	__le32 status;
2402} __packed;
2403
2404/* WMI_FT_AUTH_STATUS_EVENTID */
2405struct wmi_ft_auth_status_event {
2406	/* enum wmi_fw_status */
2407	u8 status;
2408	u8 reserved[3];
2409	u8 mac_addr[WMI_MAC_LEN];
2410	__le16 ie_len;
2411	u8 ie_info[0];
2412} __packed;
2413
2414/* WMI_FT_REASSOC_STATUS_EVENTID */
2415struct wmi_ft_reassoc_status_event {
2416	/* enum wmi_fw_status */
2417	u8 status;
2418	/* association id received from new AP */
2419	u8 aid;
2420	/* enum wmi_channel */
2421	u8 channel;
2422	/* enum wmi_channel */
2423	u8 edmg_channel;
2424	u8 mac_addr[WMI_MAC_LEN];
2425	__le16 beacon_ie_len;
2426	__le16 reassoc_req_ie_len;
2427	__le16 reassoc_resp_ie_len;
2428	u8 reserved[4];
2429	u8 ie_info[0];
2430} __packed;
2431
2432/* wmi_rx_mgmt_info */
2433struct wmi_rx_mgmt_info {
2434	u8 mcs;
2435	s8 rssi;
2436	u8 range;
2437	u8 sqi;
2438	__le16 stype;
2439	__le16 status;
2440	__le32 len;
2441	/* Not resolved when == 0xFFFFFFFF == > Broadcast to all MIDS */
2442	u8 qid;
2443	/* Not resolved when == 0xFFFFFFFF == > Broadcast to all MIDS */
2444	u8 mid;
2445	u8 cid;
2446	/* From Radio MNGR */
2447	u8 channel;
2448} __packed;
2449
2450/* WMI_START_SCHED_SCAN_EVENTID */
2451enum wmi_pno_result {
2452	WMI_PNO_SUCCESS			= 0x00,
2453	WMI_PNO_REJECT			= 0x01,
2454	WMI_PNO_INVALID_PARAMETERS	= 0x02,
2455	WMI_PNO_NOT_ENABLED		= 0x03,
2456};
2457
2458struct wmi_start_sched_scan_event {
2459	/* wmi_pno_result */
2460	u8 result;
2461	u8 reserved[3];
2462} __packed;
2463
2464struct wmi_stop_sched_scan_event {
2465	/* wmi_pno_result */
2466	u8 result;
2467	u8 reserved[3];
2468} __packed;
2469
2470struct wmi_sched_scan_result_event {
2471	struct wmi_rx_mgmt_info info;
2472	u8 payload[0];
2473} __packed;
2474
2475/* WMI_ACS_PASSIVE_SCAN_COMPLETE_EVENT */
2476enum wmi_acs_info_bitmask {
2477	WMI_ACS_INFO_BITMASK_BEACON_FOUND	= 0x01,
2478	WMI_ACS_INFO_BITMASK_BUSY_TIME		= 0x02,
2479	WMI_ACS_INFO_BITMASK_TX_TIME		= 0x04,
2480	WMI_ACS_INFO_BITMASK_RX_TIME		= 0x08,
2481	WMI_ACS_INFO_BITMASK_NOISE		= 0x10,
2482};
2483
2484struct scan_acs_info {
2485	u8 channel;
2486	u8 beacon_found;
2487	/* msec */
2488	__le16 busy_time;
2489	__le16 tx_time;
2490	__le16 rx_time;
2491	u8 noise;
2492	u8 reserved[3];
2493} __packed;
2494
2495struct wmi_acs_passive_scan_complete_event {
2496	__le32 dwell_time;
2497	/* valid fields within channel info according to
2498	 * their appearance in struct order
2499	 */
2500	__le16 filled;
2501	u8 num_scanned_channels;
2502	u8 reserved;
2503	struct scan_acs_info scan_info_list[0];
2504} __packed;
2505
2506/* WMI_BA_STATUS_EVENTID */
2507enum wmi_vring_ba_status {
2508	WMI_BA_AGREED			= 0x00,
2509	WMI_BA_NON_AGREED		= 0x01,
2510	/* BA_EN in middle of teardown flow */
2511	WMI_BA_TD_WIP			= 0x02,
2512	/* BA_DIS or BA_EN in middle of BA SETUP flow */
2513	WMI_BA_SETUP_WIP		= 0x03,
2514	/* BA_EN when the BA session is already active */
2515	WMI_BA_SESSION_ACTIVE		= 0x04,
2516	/* BA_DIS when the BA session is not active */
2517	WMI_BA_SESSION_NOT_ACTIVE	= 0x05,
2518};
2519
2520struct wmi_ba_status_event {
2521	/* enum wmi_vring_ba_status */
2522	__le16 status;
2523	u8 reserved[2];
2524	u8 ringid;
2525	u8 agg_wsize;
2526	__le16 ba_timeout;
2527	u8 amsdu;
2528} __packed;
2529
2530/* WMI_DELBA_EVENTID */
2531struct wmi_delba_event {
2532	/* Used for cid less than 8. For higher cid set
2533	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
2534	 */
2535	u8 cidxtid;
2536	u8 from_initiator;
2537	__le16 reason;
2538	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
2539	u8 cid;
2540	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
2541	u8 tid;
2542	u8 reserved[2];
2543} __packed;
2544
2545/* WMI_VRING_CFG_DONE_EVENTID */
2546struct wmi_vring_cfg_done_event {
2547	u8 ringid;
2548	u8 status;
2549	u8 reserved[2];
2550	__le32 tx_vring_tail_ptr;
2551} __packed;
2552
2553/* WMI_RCP_ADDBA_RESP_SENT_EVENTID */
2554struct wmi_rcp_addba_resp_sent_event {
2555	/* Used for cid less than 8. For higher cid set
2556	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
2557	 */
2558	u8 cidxtid;
2559	u8 reserved;
2560	__le16 status;
2561	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
2562	u8 cid;
2563	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
2564	u8 tid;
2565	u8 reserved2[2];
2566} __packed;
2567
2568/* WMI_TX_STATUS_RING_CFG_DONE_EVENTID */
2569struct wmi_tx_status_ring_cfg_done_event {
2570	u8 ring_id;
2571	/* wmi_fw_status */
2572	u8 status;
2573	u8 reserved[2];
2574	__le32 ring_tail_ptr;
2575} __packed;
2576
2577/* WMI_RX_STATUS_RING_CFG_DONE_EVENTID */
2578struct wmi_rx_status_ring_cfg_done_event {
2579	u8 ring_id;
2580	/* wmi_fw_status */
2581	u8 status;
2582	u8 reserved[2];
2583	__le32 ring_tail_ptr;
2584} __packed;
2585
2586/* WMI_CFG_DEF_RX_OFFLOAD_DONE_EVENTID */
2587struct wmi_cfg_def_rx_offload_done_event {
2588	/* wmi_fw_status */
2589	u8 status;
2590	u8 reserved[3];
2591} __packed;
2592
2593/* WMI_TX_DESC_RING_CFG_DONE_EVENTID */
2594struct wmi_tx_desc_ring_cfg_done_event {
2595	u8 ring_id;
2596	/* wmi_fw_status */
2597	u8 status;
2598	u8 reserved[2];
2599	__le32 ring_tail_ptr;
2600} __packed;
2601
2602/* WMI_RX_DESC_RING_CFG_DONE_EVENTID */
2603struct wmi_rx_desc_ring_cfg_done_event {
2604	u8 ring_id;
2605	/* wmi_fw_status */
2606	u8 status;
2607	u8 reserved[2];
2608	__le32 ring_tail_ptr;
2609} __packed;
2610
2611/* WMI_RCP_ADDBA_REQ_EVENTID */
2612struct wmi_rcp_addba_req_event {
2613	/* Used for cid less than 8. For higher cid set
2614	 * CIDXTID_EXTENDED_CID_TID here and use cid and tid members instead
2615	 */
2616	u8 cidxtid;
2617	u8 dialog_token;
2618	/* ieee80211_ba_parameterset as it received */
2619	__le16 ba_param_set;
2620	__le16 ba_timeout;
2621	/* ieee80211_ba_seqstrl field as it received */
2622	__le16 ba_seq_ctrl;
2623	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
2624	u8 cid;
2625	/* Used when cidxtid = CIDXTID_EXTENDED_CID_TID */
2626	u8 tid;
2627	u8 reserved[2];
2628} __packed;
2629
2630/* WMI_CFG_RX_CHAIN_DONE_EVENTID */
2631enum wmi_cfg_rx_chain_done_event_status {
2632	WMI_CFG_RX_CHAIN_SUCCESS	= 0x01,
2633};
2634
2635struct wmi_cfg_rx_chain_done_event {
2636	/* V-Ring Tail pointer */
2637	__le32 rx_ring_tail_ptr;
2638	__le32 status;
2639} __packed;
2640
2641/* WMI_WBE_LINK_DOWN_EVENTID */
2642enum wmi_wbe_link_down_event_reason {
2643	WMI_WBE_REASON_USER_REQUEST	= 0x00,
2644	WMI_WBE_REASON_RX_DISASSOC	= 0x01,
2645	WMI_WBE_REASON_BAD_PHY_LINK	= 0x02,
2646};
2647
2648/* WMI_WBE_LINK_DOWN_EVENTID */
2649struct wmi_wbe_link_down_event {
2650	u8 cid;
2651	u8 reserved[3];
2652	__le32 reason;
2653} __packed;
2654
2655/* WMI_DATA_PORT_OPEN_EVENTID */
2656struct wmi_data_port_open_event {
2657	u8 cid;
2658	u8 reserved[3];
2659} __packed;
2660
2661/* WMI_RING_EN_EVENTID */
2662struct wmi_ring_en_event {
2663	u8 ring_index;
2664	u8 reserved[3];
2665} __packed;
2666
2667/* WMI_GET_PCP_CHANNEL_EVENTID */
2668struct wmi_get_pcp_channel_event {
2669	u8 channel;
2670	u8 reserved[3];
2671} __packed;
2672
2673/* WMI_P2P_CFG_DONE_EVENTID */
2674struct wmi_p2p_cfg_done_event {
2675	/* wmi_fw_status */
2676	u8 status;
2677	u8 reserved[3];
2678} __packed;
2679
2680/* WMI_PORT_ALLOCATED_EVENTID */
2681struct wmi_port_allocated_event {
2682	/* wmi_fw_status */
2683	u8 status;
2684	u8 reserved[3];
2685} __packed;
2686
2687/* WMI_PORT_DELETED_EVENTID */
2688struct wmi_port_deleted_event {
2689	/* wmi_fw_status */
2690	u8 status;
2691	u8 reserved[3];
2692} __packed;
2693
2694/* WMI_LISTEN_STARTED_EVENTID */
2695struct wmi_listen_started_event {
2696	/* wmi_fw_status */
2697	u8 status;
2698	u8 reserved[3];
2699} __packed;
2700
2701/* WMI_SEARCH_STARTED_EVENTID */
2702struct wmi_search_started_event {
2703	/* wmi_fw_status */
2704	u8 status;
2705	u8 reserved[3];
2706} __packed;
2707
2708/* WMI_PCP_STARTED_EVENTID */
2709struct wmi_pcp_started_event {
2710	/* wmi_fw_status */
2711	u8 status;
2712	u8 reserved[3];
2713} __packed;
2714
2715/* WMI_PCP_FACTOR_EVENTID */
2716struct wmi_pcp_factor_event {
2717	__le32 pcp_factor;
2718} __packed;
2719
2720enum wmi_sw_tx_status {
2721	WMI_TX_SW_STATUS_SUCCESS		= 0x00,
2722	WMI_TX_SW_STATUS_FAILED_NO_RESOURCES	= 0x01,
2723	WMI_TX_SW_STATUS_FAILED_TX		= 0x02,
2724};
2725
2726/* WMI_SW_TX_COMPLETE_EVENTID */
2727struct wmi_sw_tx_complete_event {
2728	/* enum wmi_sw_tx_status */
2729	u8 status;
2730	u8 reserved[3];
2731} __packed;
2732
2733/* WMI_CORR_MEASURE_EVENTID - deprecated */
2734struct wmi_corr_measure_event {
2735	/* signed */
2736	__le32 i;
2737	/* signed */
2738	__le32 q;
2739	/* signed */
2740	__le32 image_i;
2741	/* signed */
2742	__le32 image_q;
2743} __packed;
2744
2745/* WMI_READ_RSSI_EVENTID */
2746struct wmi_read_rssi_event {
2747	__le32 ina_rssi_adc_dbm;
2748} __packed;
2749
2750/* WMI_GET_SSID_EVENTID */
2751struct wmi_get_ssid_event {
2752	__le32 ssid_len;
2753	u8 ssid[WMI_MAX_SSID_LEN];
2754} __packed;
2755
2756/* EVENT: WMI_RF_XPM_READ_RESULT_EVENTID */
2757struct wmi_rf_xpm_read_result_event {
2758	/* enum wmi_fw_status_e - success=0 or fail=1 */
2759	u8 status;
2760	u8 reserved[3];
2761	/* requested num_bytes of data */
2762	u8 data_bytes[0];
2763} __packed;
2764
2765/* EVENT: WMI_RF_XPM_WRITE_RESULT_EVENTID */
2766struct wmi_rf_xpm_write_result_event {
2767	/* enum wmi_fw_status_e - success=0 or fail=1 */
2768	u8 status;
2769	u8 reserved[3];
2770} __packed;
2771
2772/* WMI_TX_MGMT_PACKET_EVENTID */
2773struct wmi_tx_mgmt_packet_event {
2774	u8 payload[0];
2775} __packed;
2776
2777/* WMI_RX_MGMT_PACKET_EVENTID */
2778struct wmi_rx_mgmt_packet_event {
2779	struct wmi_rx_mgmt_info info;
2780	u8 payload[0];
2781} __packed;
2782
2783/* WMI_ECHO_RSP_EVENTID */
2784struct wmi_echo_rsp_event {
2785	__le32 echoed_value;
2786} __packed;
2787
2788/* WMI_DEEP_ECHO_RSP_EVENTID */
2789struct wmi_deep_echo_rsp_event {
2790	__le32 echoed_value;
2791} __packed;
2792
2793/* WMI_RF_PWR_ON_DELAY_RSP_EVENTID */
2794struct wmi_rf_pwr_on_delay_rsp_event {
2795	/* wmi_fw_status */
2796	u8 status;
2797	u8 reserved[3];
2798} __packed;
2799
2800/* WMI_SET_HIGH_POWER_TABLE_PARAMS_EVENTID */
2801struct wmi_set_high_power_table_params_event {
2802	/* wmi_fw_status */
2803	u8 status;
2804	u8 reserved[3];
2805} __packed;
2806
2807/* WMI_FIXED_SCHEDULING_UL_CONFIG_EVENTID */
2808struct wmi_fixed_scheduling_ul_config_event {
2809	/* wmi_fw_status */
2810	u8 status;
2811	u8 reserved[3];
2812} __packed;
2813
2814/* WMI_TEMP_SENSE_DONE_EVENTID
2815 *
2816 * Measure MAC and radio temperatures
2817 */
2818struct wmi_temp_sense_done_event {
2819	/* Temperature times 1000 (actual temperature will be achieved by
2820	 * dividing the value by 1000). When temperature cannot be read from
2821	 * device return WMI_INVALID_TEMPERATURE
2822	 */
2823	__le32 baseband_t1000;
2824	/* Temperature times 1000 (actual temperature will be achieved by
2825	 * dividing the value by 1000). When temperature cannot be read from
2826	 * device return WMI_INVALID_TEMPERATURE
2827	 */
2828	__le32 rf_t1000;
2829} __packed;
2830
2831#define WMI_SCAN_DWELL_TIME_MS	(100)
2832#define WMI_SURVEY_TIMEOUT_MS	(10000)
2833
2834enum wmi_hidden_ssid {
2835	WMI_HIDDEN_SSID_DISABLED	= 0x00,
2836	WMI_HIDDEN_SSID_SEND_EMPTY	= 0x10,
2837	WMI_HIDDEN_SSID_CLEAR		= 0xFE,
2838};
2839
2840/* WMI_LED_CFG_CMDID
2841 *
2842 * Configure LED On\Off\Blinking operation
2843 *
2844 * Returned events:
2845 * - WMI_LED_CFG_DONE_EVENTID
2846 */
2847enum led_mode {
2848	LED_DISABLE	= 0x00,
2849	LED_ENABLE	= 0x01,
2850};
2851
2852/* The names of the led as
2853 * described on HW schemes.
2854 */
2855enum wmi_led_id {
2856	WMI_LED_WLAN	= 0x00,
2857	WMI_LED_WPAN	= 0x01,
2858	WMI_LED_WWAN	= 0x02,
2859};
2860
2861/* Led polarity mode. */
2862enum wmi_led_polarity {
2863	LED_POLARITY_HIGH_ACTIVE	= 0x00,
2864	LED_POLARITY_LOW_ACTIVE		= 0x01,
2865};
2866
2867/* Combination of on and off
2868 * creates the blinking period
2869 */
2870struct wmi_led_blink_mode {
2871	__le32 blink_on;
2872	__le32 blink_off;
2873} __packed;
2874
2875/* WMI_LED_CFG_CMDID */
2876struct wmi_led_cfg_cmd {
2877	/* enum led_mode_e */
2878	u8 led_mode;
2879	/* enum wmi_led_id_e */
2880	u8 id;
2881	/* slow speed blinking combination */
2882	struct wmi_led_blink_mode slow_blink_cfg;
2883	/* medium speed blinking combination */
2884	struct wmi_led_blink_mode medium_blink_cfg;
2885	/* high speed blinking combination */
2886	struct wmi_led_blink_mode fast_blink_cfg;
2887	/* polarity of the led */
2888	u8 led_polarity;
2889	/* reserved */
2890	u8 reserved;
2891} __packed;
2892
2893/* \WMI_SET_CONNECT_SNR_THR_CMDID */
2894struct wmi_set_connect_snr_thr_cmd {
2895	u8 enable;
2896	u8 reserved;
2897	/* 1/4 Db units */
2898	__le16 omni_snr_thr;
2899	/* 1/4 Db units */
2900	__le16 direct_snr_thr;
2901} __packed;
2902
2903/* WMI_LED_CFG_DONE_EVENTID */
2904struct wmi_led_cfg_done_event {
2905	/* led config status */
2906	__le32 status;
2907} __packed;
2908
2909/* Rate search parameters configuration per connection */
2910struct wmi_rs_cfg {
2911	/* The maximal allowed PER for each MCS
2912	 * MCS will be considered as failed if PER during RS is higher
2913	 */
2914	u8 per_threshold[WMI_NUM_MCS];
2915	/* Number of MPDUs for each MCS
2916	 * this is the minimal statistic required to make an educated
2917	 * decision
2918	 */
2919	u8 min_frame_cnt[WMI_NUM_MCS];
2920	/* stop threshold [0-100] */
2921	u8 stop_th;
2922	/* MCS1 stop threshold [0-100] */
2923	u8 mcs1_fail_th;
2924	u8 max_back_failure_th;
2925	/* Debug feature for disabling internal RS trigger (which is
2926	 * currently triggered by BF Done)
2927	 */
2928	u8 dbg_disable_internal_trigger;
2929	__le32 back_failure_mask;
2930	__le32 mcs_en_vec;
2931} __packed;
2932
2933enum wmi_edmg_tx_mode {
2934	WMI_TX_MODE_DMG			= 0x0,
2935	WMI_TX_MODE_EDMG_CB1		= 0x1,
2936	WMI_TX_MODE_EDMG_CB2		= 0x2,
2937	WMI_TX_MODE_EDMG_CB1_LONG_LDPC	= 0x3,
2938	WMI_TX_MODE_EDMG_CB2_LONG_LDPC	= 0x4,
2939	WMI_TX_MODE_MAX,
2940};
2941
2942/* Rate search parameters common configuration */
2943struct wmi_rs_cfg_ex_common {
2944	/* enum wmi_edmg_tx_mode */
2945	u8 mode;
2946	/* stop threshold [0-100] */
2947	u8 stop_th;
2948	/* MCS1 stop threshold [0-100] */
2949	u8 mcs1_fail_th;
2950	u8 max_back_failure_th;
2951	/* Debug feature for disabling internal RS trigger (which is
2952	 * currently triggered by BF Done)
2953	 */
2954	u8 dbg_disable_internal_trigger;
2955	u8 reserved[3];
2956	__le32 back_failure_mask;
2957} __packed;
2958
2959/* Rate search parameters configuration per MCS */
2960struct wmi_rs_cfg_ex_mcs {
2961	/* The maximal allowed PER for each MCS
2962	 * MCS will be considered as failed if PER during RS is higher
2963	 */
2964	u8 per_threshold;
2965	/* Number of MPDUs for each MCS
2966	 * this is the minimal statistic required to make an educated
2967	 * decision
2968	 */
2969	u8 min_frame_cnt;
2970	u8 reserved[2];
2971} __packed;
2972
2973/* WMI_RS_CFG_EX_CMDID */
2974struct wmi_rs_cfg_ex_cmd {
2975	/* Configuration for all MCSs */
2976	struct wmi_rs_cfg_ex_common common_cfg;
2977	u8 each_mcs_cfg_size;
2978	u8 reserved[3];
2979	/* Configuration for each MCS */
2980	struct wmi_rs_cfg_ex_mcs each_mcs_cfg[0];
2981} __packed;
2982
2983/* WMI_RS_CFG_EX_EVENTID */
2984struct wmi_rs_cfg_ex_event {
2985	/* enum wmi_edmg_tx_mode */
2986	u8 mode;
2987	/* enum wmi_fw_status */
2988	u8 status;
2989	u8 reserved[2];
2990} __packed;
2991
2992/* WMI_RS_ENABLE_CMDID */
2993struct wmi_rs_enable_cmd {
2994	u8 cid;
2995	/* enable or disable rate search */
2996	u8 rs_enable;
2997	u8 reserved[2];
2998	__le32 mcs_en_vec;
2999} __packed;
3000
3001/* WMI_RS_ENABLE_EVENTID */
3002struct wmi_rs_enable_event {
3003	/* enum wmi_fw_status */
3004	u8 status;
3005	u8 reserved[3];
3006} __packed;
3007
3008/* Slot types */
3009enum wmi_sched_scheme_slot_type {
3010	WMI_SCHED_SLOT_SP		= 0x0,
3011	WMI_SCHED_SLOT_CBAP		= 0x1,
3012	WMI_SCHED_SLOT_IDLE		= 0x2,
3013	WMI_SCHED_SLOT_ANNOUNCE_NO_ACK	= 0x3,
3014	WMI_SCHED_SLOT_DISCOVERY	= 0x4,
3015};
3016
3017enum wmi_sched_scheme_slot_flags {
3018	WMI_SCHED_SCHEME_SLOT_PERIODIC	= 0x1,
3019};
3020
3021struct wmi_sched_scheme_slot {
3022	/* in microsecond */
3023	__le32 tbtt_offset;
3024	/* wmi_sched_scheme_slot_flags */
3025	u8 flags;
3026	/* wmi_sched_scheme_slot_type */
3027	u8 type;
3028	/* in microsecond */
3029	__le16 duration;
3030	/* frame_exchange_sequence_duration */
3031	__le16 tx_op;
3032	/* time in microseconds between two consecutive slots
3033	 * relevant only if flag WMI_SCHED_SCHEME_SLOT_PERIODIC set
3034	 */
3035	__le16 period;
3036	/* relevant only if flag WMI_SCHED_SCHEME_SLOT_PERIODIC set
3037	 * number of times to repeat allocation
3038	 */
3039	u8 num_of_blocks;
3040	/* relevant only if flag WMI_SCHED_SCHEME_SLOT_PERIODIC set
3041	 * every idle_period allocation will be idle
3042	 */
3043	u8 idle_period;
3044	u8 src_aid;
3045	u8 dest_aid;
3046	__le32 reserved;
3047} __packed;
3048
3049enum wmi_sched_scheme_flags {
3050	/* should not be set when clearing scheduling scheme */
3051	WMI_SCHED_SCHEME_ENABLE		= 0x01,
3052	WMI_SCHED_PROTECTED_SP		= 0x02,
3053	/* should be set only on first WMI fragment of scheme */
3054	WMI_SCHED_FIRST			= 0x04,
3055	/* should be set only on last WMI fragment of scheme */
3056	WMI_SCHED_LAST			= 0x08,
3057	WMI_SCHED_IMMEDIATE_START	= 0x10,
3058};
3059
3060enum wmi_sched_scheme_advertisment {
3061	/* ESE is not advertised at all, STA has to be configured with WMI
3062	 * also
3063	 */
3064	WMI_ADVERTISE_ESE_DISABLED		= 0x0,
3065	WMI_ADVERTISE_ESE_IN_BEACON		= 0x1,
3066	WMI_ADVERTISE_ESE_IN_ANNOUNCE_FRAME	= 0x2,
3067};
3068
3069/* WMI_SCHEDULING_SCHEME_CMD */
3070struct wmi_scheduling_scheme_cmd {
3071	u8 serial_num;
3072	/* wmi_sched_scheme_advertisment */
3073	u8 ese_advertisment;
3074	/* wmi_sched_scheme_flags */
3075	__le16 flags;
3076	u8 num_allocs;
3077	u8 reserved[3];
3078	__le64 start_tbtt;
3079	/* allocations list */
3080	struct wmi_sched_scheme_slot allocs[WMI_SCHED_MAX_ALLOCS_PER_CMD];
3081} __packed;
3082
3083enum wmi_sched_scheme_failure_type {
3084	WMI_SCHED_SCHEME_FAILURE_NO_ERROR		= 0x00,
3085	WMI_SCHED_SCHEME_FAILURE_OLD_START_TSF_ERR	= 0x01,
3086};
3087
3088/* WMI_SCHEDULING_SCHEME_EVENTID */
3089struct wmi_scheduling_scheme_event {
3090	/* wmi_fw_status_e */
3091	u8 status;
3092	/* serial number given in command */
3093	u8 serial_num;
3094	/* wmi_sched_scheme_failure_type */
3095	u8 failure_type;
3096	/* alignment to 32b */
3097	u8 reserved[1];
3098} __packed;
3099
3100/* WMI_RS_CFG_CMDID - deprecated */
3101struct wmi_rs_cfg_cmd {
3102	/* connection id */
3103	u8 cid;
3104	/* enable or disable rate search */
3105	u8 rs_enable;
3106	/* rate search configuration */
3107	struct wmi_rs_cfg rs_cfg;
3108} __packed;
3109
3110/* WMI_RS_CFG_DONE_EVENTID - deprecated */
3111struct wmi_rs_cfg_done_event {
3112	u8 cid;
3113	/* enum wmi_fw_status */
3114	u8 status;
3115	u8 reserved[2];
3116} __packed;
3117
3118/* WMI_GET_DETAILED_RS_RES_CMDID - deprecated */
3119struct wmi_get_detailed_rs_res_cmd {
3120	/* connection id */
3121	u8 cid;
3122	u8 reserved[3];
3123} __packed;
3124
3125/* RS results status */
3126enum wmi_rs_results_status {
3127	WMI_RS_RES_VALID	= 0x00,
3128	WMI_RS_RES_INVALID	= 0x01,
3129};
3130
3131/* Rate search results */
3132struct wmi_rs_results {
3133	/* number of sent MPDUs */
3134	u8 num_of_tx_pkt[WMI_NUM_MCS];
3135	/* number of non-acked MPDUs */
3136	u8 num_of_non_acked_pkt[WMI_NUM_MCS];
3137	/* RS timestamp */
3138	__le32 tsf;
3139	/* RS selected MCS */
3140	u8 mcs;
3141} __packed;
3142
3143/* WMI_GET_DETAILED_RS_RES_EVENTID - deprecated */
3144struct wmi_get_detailed_rs_res_event {
3145	u8 cid;
3146	/* enum wmi_rs_results_status */
3147	u8 status;
3148	/* detailed rs results */
3149	struct wmi_rs_results rs_results;
3150	u8 reserved[3];
3151} __packed;
3152
3153/* WMI_GET_DETAILED_RS_RES_EX_CMDID */
3154struct wmi_get_detailed_rs_res_ex_cmd {
3155	u8 cid;
3156	u8 reserved[3];
3157} __packed;
3158
3159/* Rate search results */
3160struct wmi_rs_results_ex_common {
3161	/* RS timestamp */
3162	__le32 tsf;
3163	/* RS selected MCS */
3164	u8 mcs;
3165	/* enum wmi_edmg_tx_mode */
3166	u8 mode;
3167	u8 reserved[2];
3168} __packed;
3169
3170/* Rate search results */
3171struct wmi_rs_results_ex_mcs {
3172	/* number of sent MPDUs */
3173	u8 num_of_tx_pkt;
3174	/* number of non-acked MPDUs */
3175	u8 num_of_non_acked_pkt;
3176	u8 reserved[2];
3177} __packed;
3178
3179/* WMI_GET_DETAILED_RS_RES_EX_EVENTID */
3180struct wmi_get_detailed_rs_res_ex_event {
3181	u8 cid;
3182	/* enum wmi_rs_results_status */
3183	u8 status;
3184	u8 reserved0[2];
3185	struct wmi_rs_results_ex_common common_rs_results;
3186	u8 each_mcs_results_size;
3187	u8 reserved1[3];
3188	/* Results for each MCS */
3189	struct wmi_rs_results_ex_mcs each_mcs_results[0];
3190} __packed;
3191
3192/* BRP antenna limit mode */
3193enum wmi_brp_ant_limit_mode {
3194	/* Disable BRP force antenna limit */
3195	WMI_BRP_ANT_LIMIT_MODE_DISABLE		= 0x00,
3196	/* Define maximal antennas limit. Only effective antennas will be
3197	 * actually used
3198	 */
3199	WMI_BRP_ANT_LIMIT_MODE_EFFECTIVE	= 0x01,
3200	/* Force a specific number of antennas */
3201	WMI_BRP_ANT_LIMIT_MODE_FORCE		= 0x02,
3202	/* number of BRP antenna limit modes */
3203	WMI_BRP_ANT_LIMIT_MODES_NUM		= 0x03,
3204};
3205
3206/* WMI_BRP_SET_ANT_LIMIT_CMDID */
3207struct wmi_brp_set_ant_limit_cmd {
3208	/* connection id */
3209	u8 cid;
3210	/* enum wmi_brp_ant_limit_mode */
3211	u8 limit_mode;
3212	/* antenna limit count, 1-27
3213	 * disable_mode - ignored
3214	 * effective_mode - upper limit to number of antennas to be used
3215	 * force_mode - exact number of antennas to be used
3216	 */
3217	u8 ant_limit;
3218	u8 reserved;
3219} __packed;
3220
3221/* WMI_BRP_SET_ANT_LIMIT_EVENTID */
3222struct wmi_brp_set_ant_limit_event {
3223	/* wmi_fw_status */
3224	u8 status;
3225	u8 reserved[3];
3226} __packed;
3227
3228enum wmi_bf_type {
3229	WMI_BF_TYPE_SLS		= 0x00,
3230	WMI_BF_TYPE_BRP_RX	= 0x01,
3231};
3232
3233/* WMI_BF_TRIG_CMDID */
3234struct wmi_bf_trig_cmd {
3235	/* enum wmi_bf_type - type of requested beamforming */
3236	u8 bf_type;
3237	/* used only for WMI_BF_TYPE_BRP_RX */
3238	u8 cid;
3239	/* used only for WMI_BF_TYPE_SLS */
3240	u8 dst_mac[WMI_MAC_LEN];
3241	u8 reserved[4];
3242} __packed;
3243
3244/* WMI_BF_TRIG_EVENTID */
3245struct wmi_bf_trig_event {
3246	/* enum wmi_fw_status */
3247	u8 status;
3248	u8 cid;
3249	u8 reserved[2];
3250} __packed;
3251
3252/* broadcast connection ID */
3253#define WMI_LINK_MAINTAIN_CFG_CID_BROADCAST	(0xFFFFFFFF)
3254
3255/* Types wmi_link_maintain_cfg presets for WMI_LINK_MAINTAIN_CFG_WRITE_CMD */
3256enum wmi_link_maintain_cfg_type {
3257	/* AP/PCP default normal (non-FST) configuration settings */
3258	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_NORMAL_AP	= 0x00,
3259	/* AP/PCP  default FST configuration settings */
3260	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_FST_AP	= 0x01,
3261	/* STA default normal (non-FST) configuration settings */
3262	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_NORMAL_STA	= 0x02,
3263	/* STA default FST configuration settings */
3264	WMI_LINK_MAINTAIN_CFG_TYPE_DEFAULT_FST_STA	= 0x03,
3265	/* custom configuration settings */
3266	WMI_LINK_MAINTAIN_CFG_TYPE_CUSTOM		= 0x04,
3267	/* number of defined configuration types */
3268	WMI_LINK_MAINTAIN_CFG_TYPES_NUM			= 0x05,
3269};
3270
3271/* Response status codes for WMI_LINK_MAINTAIN_CFG_WRITE/READ commands */
3272enum wmi_link_maintain_cfg_response_status {
3273	/* WMI_LINK_MAINTAIN_CFG_WRITE/READ command successfully accomplished
3274	 */
3275	WMI_LINK_MAINTAIN_CFG_RESPONSE_STATUS_OK		= 0x00,
3276	/* ERROR due to bad argument in WMI_LINK_MAINTAIN_CFG_WRITE/READ
3277	 * command request
3278	 */
3279	WMI_LINK_MAINTAIN_CFG_RESPONSE_STATUS_BAD_ARGUMENT	= 0x01,
3280};
3281
3282/* Link Loss and Keep Alive configuration */
3283struct wmi_link_maintain_cfg {
3284	/* link_loss_enable_detectors_vec */
3285	__le32 link_loss_enable_detectors_vec;
3286	/* detectors check period usec */
3287	__le32 check_link_loss_period_usec;
3288	/* max allowed tx ageing */
3289	__le32 tx_ageing_threshold_usec;
3290	/* keep alive period for high SNR */
3291	__le32 keep_alive_period_usec_high_snr;
3292	/* keep alive period for low SNR */
3293	__le32 keep_alive_period_usec_low_snr;
3294	/* lower snr limit for keep alive period update */
3295	__le32 keep_alive_snr_threshold_low_db;
3296	/* upper snr limit for keep alive period update */
3297	__le32 keep_alive_snr_threshold_high_db;
3298	/* num of successive bad bcons causing link-loss */
3299	__le32 bad_beacons_num_threshold;
3300	/* SNR limit for bad_beacons_detector */
3301	__le32 bad_beacons_snr_threshold_db;
3302	/* timeout for disassoc response frame in uSec */
3303	__le32 disconnect_timeout;
3304} __packed;
3305
3306/* WMI_LINK_MAINTAIN_CFG_WRITE_CMDID */
3307struct wmi_link_maintain_cfg_write_cmd {
3308	/* enum wmi_link_maintain_cfg_type_e - type of requested default
3309	 * configuration to be applied
3310	 */
3311	__le32 cfg_type;
3312	/* requested connection ID or WMI_LINK_MAINTAIN_CFG_CID_BROADCAST */
3313	__le32 cid;
3314	/* custom configuration settings to be applied (relevant only if
3315	 * cfg_type==WMI_LINK_MAINTAIN_CFG_TYPE_CUSTOM)
3316	 */
3317	struct wmi_link_maintain_cfg lm_cfg;
3318} __packed;
3319
3320/* WMI_LINK_MAINTAIN_CFG_READ_CMDID */
3321struct wmi_link_maintain_cfg_read_cmd {
3322	/* connection ID which configuration settings are requested */
3323	__le32 cid;
3324} __packed;
3325
3326/* WMI_LINK_MAINTAIN_CFG_WRITE_DONE_EVENTID */
3327struct wmi_link_maintain_cfg_write_done_event {
3328	/* requested connection ID */
3329	__le32 cid;
3330	/* wmi_link_maintain_cfg_response_status_e - write status */
3331	__le32 status;
3332} __packed;
3333
3334/* \WMI_LINK_MAINTAIN_CFG_READ_DONE_EVENT */
3335struct wmi_link_maintain_cfg_read_done_event {
3336	/* requested connection ID */
3337	__le32 cid;
3338	/* wmi_link_maintain_cfg_response_status_e - read status */
3339	__le32 status;
3340	/* Retrieved configuration settings */
3341	struct wmi_link_maintain_cfg lm_cfg;
3342} __packed;
3343
3344enum wmi_traffic_suspend_status {
3345	WMI_TRAFFIC_SUSPEND_APPROVED			= 0x0,
3346	WMI_TRAFFIC_SUSPEND_REJECTED_LINK_NOT_IDLE	= 0x1,
3347	WMI_TRAFFIC_SUSPEND_REJECTED_DISCONNECT		= 0x2,
3348	WMI_TRAFFIC_SUSPEND_REJECTED_OTHER		= 0x3,
3349};
3350
3351/* WMI_TRAFFIC_SUSPEND_EVENTID */
3352struct wmi_traffic_suspend_event {
3353	/* enum wmi_traffic_suspend_status_e */
3354	u8 status;
3355} __packed;
3356
3357enum wmi_traffic_resume_status {
3358	WMI_TRAFFIC_RESUME_SUCCESS	= 0x0,
3359	WMI_TRAFFIC_RESUME_FAILED	= 0x1,
3360};
3361
3362enum wmi_resume_trigger {
3363	WMI_RESUME_TRIGGER_UNKNOWN	= 0x0,
3364	WMI_RESUME_TRIGGER_HOST		= 0x1,
3365	WMI_RESUME_TRIGGER_UCAST_RX	= 0x2,
3366	WMI_RESUME_TRIGGER_BCAST_RX	= 0x4,
3367	WMI_RESUME_TRIGGER_WMI_EVT	= 0x8,
3368	WMI_RESUME_TRIGGER_DISCONNECT	= 0x10,
3369};
3370
3371/* WMI_TRAFFIC_RESUME_EVENTID */
3372struct wmi_traffic_resume_event {
3373	/* enum wmi_traffic_resume_status */
3374	u8 status;
3375	u8 reserved[3];
3376	/* enum wmi_resume_trigger bitmap */
3377	__le32 resume_triggers;
3378} __packed;
3379
3380/* Power Save command completion status codes */
3381enum wmi_ps_cfg_cmd_status {
3382	WMI_PS_CFG_CMD_STATUS_SUCCESS	= 0x00,
3383	WMI_PS_CFG_CMD_STATUS_BAD_PARAM	= 0x01,
3384	/* other error */
3385	WMI_PS_CFG_CMD_STATUS_ERROR	= 0x02,
3386};
3387
3388/* Device Power Save Profiles */
3389enum wmi_ps_profile_type {
3390	WMI_PS_PROFILE_TYPE_DEFAULT		= 0x00,
3391	WMI_PS_PROFILE_TYPE_PS_DISABLED		= 0x01,
3392	WMI_PS_PROFILE_TYPE_MAX_PS		= 0x02,
3393	WMI_PS_PROFILE_TYPE_LOW_LATENCY_PS	= 0x03,
3394};
3395
3396/* WMI_PS_DEV_PROFILE_CFG_READ_CMDID */
3397struct wmi_ps_dev_profile_cfg_read_cmd {
3398	/* reserved */
3399	__le32 reserved;
3400} __packed;
3401
3402/* WMI_PS_DEV_PROFILE_CFG_READ_EVENTID */
3403struct wmi_ps_dev_profile_cfg_read_event {
3404	/* wmi_ps_profile_type_e */
3405	u8 ps_profile;
3406	u8 reserved[3];
3407} __packed;
3408
3409/* WMI_PS_DEV_PROFILE_CFG_CMDID
3410 *
3411 * Power save profile to be used by the device
3412 *
3413 * Returned event:
3414 * - WMI_PS_DEV_PROFILE_CFG_EVENTID
3415 */
3416struct wmi_ps_dev_profile_cfg_cmd {
3417	/* wmi_ps_profile_type_e */
3418	u8 ps_profile;
3419	u8 reserved[3];
3420} __packed;
3421
3422/* WMI_PS_DEV_PROFILE_CFG_EVENTID */
3423struct wmi_ps_dev_profile_cfg_event {
3424	/* wmi_ps_cfg_cmd_status_e */
3425	__le32 status;
3426} __packed;
3427
3428enum wmi_ps_level {
3429	WMI_PS_LEVEL_DEEP_SLEEP		= 0x00,
3430	WMI_PS_LEVEL_SHALLOW_SLEEP	= 0x01,
3431	/* awake = all PS mechanisms are disabled */
3432	WMI_PS_LEVEL_AWAKE		= 0x02,
3433};
3434
3435enum wmi_ps_deep_sleep_clk_level {
3436	/* 33k */
3437	WMI_PS_DEEP_SLEEP_CLK_LEVEL_RTC		= 0x00,
3438	/* 10k */
3439	WMI_PS_DEEP_SLEEP_CLK_LEVEL_OSC		= 0x01,
3440	/* @RTC Low latency */
3441	WMI_PS_DEEP_SLEEP_CLK_LEVEL_RTC_LT	= 0x02,
3442	WMI_PS_DEEP_SLEEP_CLK_LEVEL_XTAL	= 0x03,
3443	WMI_PS_DEEP_SLEEP_CLK_LEVEL_SYSCLK	= 0x04,
3444	/* Not Applicable */
3445	WMI_PS_DEEP_SLEEP_CLK_LEVEL_N_A		= 0xFF,
3446};
3447
3448/* Response by the FW to a D3 entry request */
3449enum wmi_ps_d3_resp_policy {
3450	WMI_PS_D3_RESP_POLICY_DEFAULT	= 0x00,
3451	/* debug -D3 req is always denied */
3452	WMI_PS_D3_RESP_POLICY_DENIED	= 0x01,
3453	/* debug -D3 req is always approved */
3454	WMI_PS_D3_RESP_POLICY_APPROVED	= 0x02,
3455};
3456
3457#define WMI_AOA_MAX_DATA_SIZE	(128)
3458
3459enum wmi_aoa_meas_status {
3460	WMI_AOA_MEAS_SUCCESS		= 0x00,
3461	WMI_AOA_MEAS_PEER_INCAPABLE	= 0x01,
3462	WMI_AOA_MEAS_FAILURE		= 0x02,
3463};
3464
3465/* WMI_AOA_MEAS_EVENTID */
3466struct wmi_aoa_meas_event {
3467	u8 mac_addr[WMI_MAC_LEN];
3468	/* channels IDs:
3469	 * 0 - 58320 MHz
3470	 * 1 - 60480 MHz
3471	 * 2 - 62640 MHz
3472	 */
3473	u8 channel;
3474	/* enum wmi_aoa_meas_type */
3475	u8 aoa_meas_type;
3476	/* Measurments are from RFs, defined by the mask */
3477	__le32 meas_rf_mask;
3478	/* enum wmi_aoa_meas_status */
3479	u8 meas_status;
3480	u8 reserved;
3481	/* Length of meas_data in bytes */
3482	__le16 length;
3483	u8 meas_data[WMI_AOA_MAX_DATA_SIZE];
3484} __packed;
3485
3486/* WMI_SET_MGMT_RETRY_LIMIT_EVENTID */
3487struct wmi_set_mgmt_retry_limit_event {
3488	/* enum wmi_fw_status */
3489	u8 status;
3490	/* alignment to 32b */
3491	u8 reserved[3];
3492} __packed;
3493
3494/* WMI_GET_MGMT_RETRY_LIMIT_EVENTID */
3495struct wmi_get_mgmt_retry_limit_event {
3496	/* MAC retransmit limit for mgmt frames */
3497	u8 mgmt_retry_limit;
3498	/* alignment to 32b */
3499	u8 reserved[3];
3500} __packed;
3501
3502/* WMI_TOF_GET_CAPABILITIES_EVENTID */
3503struct wmi_tof_get_capabilities_event {
3504	u8 ftm_capability;
3505	/* maximum supported number of destination to start TOF */
3506	u8 max_num_of_dest;
3507	/* maximum supported number of measurements per burst */
3508	u8 max_num_of_meas_per_burst;
3509	u8 reserved;
3510	/* maximum supported multi bursts */
3511	__le16 max_multi_bursts_sessions;
3512	/* maximum supported FTM burst duration , wmi_tof_burst_duration_e */
3513	__le16 max_ftm_burst_duration;
3514	/* AOA supported types */
3515	__le32 aoa_supported_types;
3516} __packed;
3517
3518/* WMI_SET_THERMAL_THROTTLING_CFG_EVENTID */
3519struct wmi_set_thermal_throttling_cfg_event {
3520	/* wmi_fw_status */
3521	u8 status;
3522	u8 reserved[3];
3523} __packed;
3524
3525/* WMI_GET_THERMAL_THROTTLING_CFG_EVENTID */
3526struct wmi_get_thermal_throttling_cfg_event {
3527	/* Status data */
3528	struct wmi_tt_data tt_data;
3529} __packed;
3530
3531enum wmi_tof_session_end_status {
3532	WMI_TOF_SESSION_END_NO_ERROR		= 0x00,
3533	WMI_TOF_SESSION_END_FAIL		= 0x01,
3534	WMI_TOF_SESSION_END_PARAMS_ERROR	= 0x02,
3535	WMI_TOF_SESSION_END_ABORTED		= 0x03,
3536	WMI_TOF_SESSION_END_BUSY		= 0x04,
3537};
3538
3539/* WMI_TOF_SESSION_END_EVENTID */
3540struct wmi_tof_session_end_event {
3541	/* FTM session ID */
3542	__le32 session_id;
3543	/* wmi_tof_session_end_status_e */
3544	u8 status;
3545	u8 reserved[3];
3546} __packed;
3547
3548/* WMI_TOF_SET_LCI_EVENTID */
3549struct wmi_tof_set_lci_event {
3550	/* enum wmi_fw_status */
3551	u8 status;
3552	u8 reserved[3];
3553} __packed;
3554
3555/* WMI_TOF_SET_LCR_EVENTID */
3556struct wmi_tof_set_lcr_event {
3557	/* enum wmi_fw_status */
3558	u8 status;
3559	u8 reserved[3];
3560} __packed;
3561
3562/* Responder FTM Results */
3563struct wmi_responder_ftm_res {
3564	u8 t1[6];
3565	u8 t2[6];
3566	u8 t3[6];
3567	u8 t4[6];
3568	__le16 tod_err;
3569	__le16 toa_err;
3570	__le16 tod_err_initiator;
3571	__le16 toa_err_initiator;
3572} __packed;
3573
3574enum wmi_tof_ftm_per_dest_res_status {
3575	WMI_PER_DEST_RES_NO_ERROR		= 0x00,
3576	WMI_PER_DEST_RES_TX_RX_FAIL		= 0x01,
3577	WMI_PER_DEST_RES_PARAM_DONT_MATCH	= 0x02,
3578};
3579
3580enum wmi_tof_ftm_per_dest_res_flags {
3581	WMI_PER_DEST_RES_REQ_START		= 0x01,
3582	WMI_PER_DEST_RES_BURST_REPORT_END	= 0x02,
3583	WMI_PER_DEST_RES_REQ_END		= 0x04,
3584	WMI_PER_DEST_RES_PARAM_UPDATE		= 0x08,
3585};
3586
3587/* WMI_TOF_FTM_PER_DEST_RES_EVENTID */
3588struct wmi_tof_ftm_per_dest_res_event {
3589	/* FTM session ID */
3590	__le32 session_id;
3591	/* destination MAC address */
3592	u8 dst_mac[WMI_MAC_LEN];
3593	/* wmi_tof_ftm_per_dest_res_flags_e */
3594	u8 flags;
3595	/* wmi_tof_ftm_per_dest_res_status_e */
3596	u8 status;
3597	/* responder ASAP */
3598	u8 responder_asap;
3599	/* responder number of FTM per burst */
3600	u8 responder_num_ftm_per_burst;
3601	/* responder number of FTM burst exponent */
3602	u8 responder_num_ftm_bursts_exp;
3603	/* responder burst duration ,wmi_tof_burst_duration_e */
3604	u8 responder_burst_duration;
3605	/* responder burst period, indicate interval between two consecutive
3606	 * burst instances, in units of 100 ms
3607	 */
3608	__le16 responder_burst_period;
3609	/* receive burst counter */
3610	__le16 bursts_cnt;
3611	/* tsf of responder start burst */
3612	__le32 tsf_sync;
3613	/* actual received ftm per burst */
3614	u8 actual_ftm_per_burst;
3615	/* Measurments are from RFs, defined by the mask */
3616	__le32 meas_rf_mask;
3617	u8 reserved0[3];
3618	struct wmi_responder_ftm_res responder_ftm_res[0];
3619} __packed;
3620
3621/* WMI_TOF_CFG_RESPONDER_EVENTID */
3622struct wmi_tof_cfg_responder_event {
3623	/* enum wmi_fw_status */
3624	u8 status;
3625	u8 reserved[3];
3626} __packed;
3627
3628enum wmi_tof_channel_info_type {
3629	WMI_TOF_CHANNEL_INFO_AOA		= 0x00,
3630	WMI_TOF_CHANNEL_INFO_LCI		= 0x01,
3631	WMI_TOF_CHANNEL_INFO_LCR		= 0x02,
3632	WMI_TOF_CHANNEL_INFO_VENDOR_SPECIFIC	= 0x03,
3633	WMI_TOF_CHANNEL_INFO_CIR		= 0x04,
3634	WMI_TOF_CHANNEL_INFO_RSSI		= 0x05,
3635	WMI_TOF_CHANNEL_INFO_SNR		= 0x06,
3636	WMI_TOF_CHANNEL_INFO_DEBUG		= 0x07,
3637};
3638
3639/* WMI_TOF_CHANNEL_INFO_EVENTID */
3640struct wmi_tof_channel_info_event {
3641	/* FTM session ID */
3642	__le32 session_id;
3643	/* destination MAC address */
3644	u8 dst_mac[WMI_MAC_LEN];
3645	/* wmi_tof_channel_info_type_e */
3646	u8 type;
3647	/* data report length */
3648	u8 len;
3649	/* data report payload */
3650	u8 report[0];
3651} __packed;
3652
3653/* WMI_TOF_SET_TX_RX_OFFSET_EVENTID */
3654struct wmi_tof_set_tx_rx_offset_event {
3655	/* enum wmi_fw_status */
3656	u8 status;
3657	u8 reserved[3];
3658} __packed;
3659
3660/* WMI_TOF_GET_TX_RX_OFFSET_EVENTID */
3661struct wmi_tof_get_tx_rx_offset_event {
3662	/* enum wmi_fw_status */
3663	u8 status;
3664	/* RF index used to read the offsets */
3665	u8 rf_index;
3666	u8 reserved1[2];
3667	/* TX delay offset */
3668	__le32 tx_offset;
3669	/* RX delay offset */
3670	__le32 rx_offset;
3671	/* Offset to strongest tap of CIR */
3672	__le32 precursor;
3673} __packed;
3674
3675/* Result status codes for WMI commands */
3676enum wmi_rf_sector_status {
3677	WMI_RF_SECTOR_STATUS_SUCCESS			= 0x00,
3678	WMI_RF_SECTOR_STATUS_BAD_PARAMETERS_ERROR	= 0x01,
3679	WMI_RF_SECTOR_STATUS_BUSY_ERROR			= 0x02,
3680	WMI_RF_SECTOR_STATUS_NOT_SUPPORTED_ERROR	= 0x03,
3681};
3682
3683/* Types of the RF sector (TX,RX) */
3684enum wmi_rf_sector_type {
3685	WMI_RF_SECTOR_TYPE_RX	= 0x00,
3686	WMI_RF_SECTOR_TYPE_TX	= 0x01,
3687};
3688
3689/* Content of RF Sector (six 32-bits registers) */
3690struct wmi_rf_sector_info {
3691	/* Phase values for RF Chains[15-0] (2bits per RF chain) */
3692	__le32 psh_hi;
3693	/* Phase values for RF Chains[31-16] (2bits per RF chain) */
3694	__le32 psh_lo;
3695	/* ETYPE Bit0 for all RF chains[31-0] - bit0 of Edge amplifier gain
3696	 * index
3697	 */
3698	__le32 etype0;
3699	/* ETYPE Bit1 for all RF chains[31-0] - bit1 of Edge amplifier gain
3700	 * index
3701	 */
3702	__le32 etype1;
3703	/* ETYPE Bit2 for all RF chains[31-0] - bit2 of Edge amplifier gain
3704	 * index
3705	 */
3706	__le32 etype2;
3707	/* D-Type values (3bits each) for 8 Distribution amplifiers + X16
3708	 * switch bits
3709	 */
3710	__le32 dtype_swch_off;
3711} __packed;
3712
3713#define WMI_INVALID_RF_SECTOR_INDEX	(0xFFFF)
3714#define WMI_MAX_RF_MODULES_NUM		(8)
3715
3716/* WMI_GET_RF_SECTOR_PARAMS_CMD */
3717struct wmi_get_rf_sector_params_cmd {
3718	/* Sector number to be retrieved */
3719	__le16 sector_idx;
3720	/* enum wmi_rf_sector_type - type of requested RF sector */
3721	u8 sector_type;
3722	/* bitmask vector specifying destination RF modules */
3723	u8 rf_modules_vec;
3724} __packed;
3725
3726/* \WMI_GET_RF_SECTOR_PARAMS_DONE_EVENT */
3727struct wmi_get_rf_sector_params_done_event {
3728	/* result status of WMI_GET_RF_SECTOR_PARAMS_CMD (enum
3729	 * wmi_rf_sector_status)
3730	 */
3731	u8 status;
3732	/* align next field to U64 boundary */
3733	u8 reserved[7];
3734	/* TSF timestamp when RF sectors where retrieved */
3735	__le64 tsf;
3736	/* Content of RF sector retrieved from each RF module */
3737	struct wmi_rf_sector_info sectors_info[WMI_MAX_RF_MODULES_NUM];
3738} __packed;
3739
3740/* WMI_SET_RF_SECTOR_PARAMS_CMD */
3741struct wmi_set_rf_sector_params_cmd {
3742	/* Sector number to be retrieved */
3743	__le16 sector_idx;
3744	/* enum wmi_rf_sector_type - type of requested RF sector */
3745	u8 sector_type;
3746	/* bitmask vector specifying destination RF modules */
3747	u8 rf_modules_vec;
3748	/* Content of RF sector to be written to each RF module */
3749	struct wmi_rf_sector_info sectors_info[WMI_MAX_RF_MODULES_NUM];
3750} __packed;
3751
3752/* \WMI_SET_RF_SECTOR_PARAMS_DONE_EVENT */
3753struct wmi_set_rf_sector_params_done_event {
3754	/* result status of WMI_SET_RF_SECTOR_PARAMS_CMD (enum
3755	 * wmi_rf_sector_status)
3756	 */
3757	u8 status;
3758} __packed;
3759
3760/* WMI_GET_SELECTED_RF_SECTOR_INDEX_CMD - Get RF sector index selected by
3761 * TXSS/BRP for communication with specified CID
3762 */
3763struct wmi_get_selected_rf_sector_index_cmd {
3764	/* Connection/Station ID in [0:7] range */
3765	u8 cid;
3766	/* type of requested RF sector (enum wmi_rf_sector_type) */
3767	u8 sector_type;
3768	/* align to U32 boundary */
3769	u8 reserved[2];
3770} __packed;
3771
3772/* \WMI_GET_SELECTED_RF_SECTOR_INDEX_DONE_EVENT - Returns retrieved RF sector
3773 * index selected by TXSS/BRP for communication with specified CID
3774 */
3775struct wmi_get_selected_rf_sector_index_done_event {
3776	/* Retrieved sector index selected in TXSS (for TX sector request) or
3777	 * BRP (for RX sector request)
3778	 */
3779	__le16 sector_idx;
3780	/* result status of WMI_GET_SELECTED_RF_SECTOR_INDEX_CMD (enum
3781	 * wmi_rf_sector_status)
3782	 */
3783	u8 status;
3784	/* align next field to U64 boundary */
3785	u8 reserved[5];
3786	/* TSF timestamp when result was retrieved */
3787	__le64 tsf;
3788} __packed;
3789
3790/* WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD - Force RF sector index for
3791 * communication with specified CID. Assumes that TXSS/BRP is disabled by
3792 * other command
3793 */
3794struct wmi_set_selected_rf_sector_index_cmd {
3795	/* Connection/Station ID in [0:7] range */
3796	u8 cid;
3797	/* type of requested RF sector (enum wmi_rf_sector_type) */
3798	u8 sector_type;
3799	/* Forced sector index */
3800	__le16 sector_idx;
3801} __packed;
3802
3803/* \WMI_SET_SELECTED_RF_SECTOR_INDEX_DONE_EVENT - Success/Fail status for
3804 * WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD
3805 */
3806struct wmi_set_selected_rf_sector_index_done_event {
3807	/* result status of WMI_SET_SELECTED_RF_SECTOR_INDEX_CMD (enum
3808	 * wmi_rf_sector_status)
3809	 */
3810	u8 status;
3811	/* align to U32 boundary */
3812	u8 reserved[3];
3813} __packed;
3814
3815/* WMI_SET_RF_SECTOR_ON_CMD - Activates specified sector for specified rf
3816 * modules
3817 */
3818struct wmi_set_rf_sector_on_cmd {
3819	/* Sector index to be activated */
3820	__le16 sector_idx;
3821	/* type of requested RF sector (enum wmi_rf_sector_type) */
3822	u8 sector_type;
3823	/* bitmask vector specifying destination RF modules */
3824	u8 rf_modules_vec;
3825} __packed;
3826
3827/* \WMI_SET_RF_SECTOR_ON_DONE_EVENT - Success/Fail status for
3828 * WMI_SET_RF_SECTOR_ON_CMD
3829 */
3830struct wmi_set_rf_sector_on_done_event {
3831	/* result status of WMI_SET_RF_SECTOR_ON_CMD (enum
3832	 * wmi_rf_sector_status)
3833	 */
3834	u8 status;
3835	/* align to U32 boundary */
3836	u8 reserved[3];
3837} __packed;
3838
3839enum wmi_sector_sweep_type {
3840	WMI_SECTOR_SWEEP_TYPE_TXSS		= 0x00,
3841	WMI_SECTOR_SWEEP_TYPE_BCON		= 0x01,
3842	WMI_SECTOR_SWEEP_TYPE_TXSS_AND_BCON	= 0x02,
3843	WMI_SECTOR_SWEEP_TYPE_NUM		= 0x03,
3844};
3845
3846/* WMI_PRIO_TX_SECTORS_ORDER_CMDID
3847 *
3848 * Set the order of TX sectors in TXSS and/or Beacon(AP).
3849 *
3850 * Returned event:
3851 * - WMI_PRIO_TX_SECTORS_ORDER_EVENTID
3852 */
3853struct wmi_prio_tx_sectors_order_cmd {
3854	/* tx sectors order to be applied, 0xFF for end of array */
3855	u8 tx_sectors_priority_array[MAX_NUM_OF_SECTORS];
3856	/* enum wmi_sector_sweep_type, TXSS and/or Beacon */
3857	u8 sector_sweep_type;
3858	/* needed only for TXSS configuration */
3859	u8 cid;
3860	/* alignment to 32b */
3861	u8 reserved[2];
3862} __packed;
3863
3864/* completion status codes */
3865enum wmi_prio_tx_sectors_cmd_status {
3866	WMI_PRIO_TX_SECT_CMD_STATUS_SUCCESS	= 0x00,
3867	WMI_PRIO_TX_SECT_CMD_STATUS_BAD_PARAM	= 0x01,
3868	/* other error */
3869	WMI_PRIO_TX_SECT_CMD_STATUS_ERROR	= 0x02,
3870};
3871
3872/* WMI_PRIO_TX_SECTORS_ORDER_EVENTID */
3873struct wmi_prio_tx_sectors_order_event {
3874	/* enum wmi_prio_tx_sectors_cmd_status */
3875	u8 status;
3876	/* alignment to 32b */
3877	u8 reserved[3];
3878} __packed;
3879
3880struct wmi_prio_tx_sectors_num_cmd {
3881	/* [0-128], 0 = No changes */
3882	u8 beacon_number_of_sectors;
3883	/* [0-128], 0 = No changes */
3884	u8 txss_number_of_sectors;
3885	/* [0-8] needed only for TXSS configuration */
3886	u8 cid;
3887} __packed;
3888
3889/* WMI_PRIO_TX_SECTORS_NUMBER_CMDID
3890 *
3891 * Set the number of active sectors in TXSS and/or Beacon.
3892 *
3893 * Returned event:
3894 * - WMI_PRIO_TX_SECTORS_NUMBER_EVENTID
3895 */
3896struct wmi_prio_tx_sectors_number_cmd {
3897	struct wmi_prio_tx_sectors_num_cmd active_sectors_num;
3898	/* alignment to 32b */
3899	u8 reserved;
3900} __packed;
3901
3902/* WMI_PRIO_TX_SECTORS_NUMBER_EVENTID */
3903struct wmi_prio_tx_sectors_number_event {
3904	/* enum wmi_prio_tx_sectors_cmd_status */
3905	u8 status;
3906	/* alignment to 32b */
3907	u8 reserved[3];
3908} __packed;
3909
3910/* WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_CMDID
3911 *
3912 * Set default sectors order and number (hard coded in board file)
3913 * in TXSS and/or Beacon.
3914 *
3915 * Returned event:
3916 * - WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID
3917 */
3918struct wmi_prio_tx_sectors_set_default_cfg_cmd {
3919	/* enum wmi_sector_sweep_type, TXSS and/or Beacon */
3920	u8 sector_sweep_type;
3921	/* needed only for TXSS configuration */
3922	u8 cid;
3923	/* alignment to 32b */
3924	u8 reserved[2];
3925} __packed;
3926
3927/* WMI_PRIO_TX_SECTORS_SET_DEFAULT_CFG_EVENTID */
3928struct wmi_prio_tx_sectors_set_default_cfg_event {
3929	/* enum wmi_prio_tx_sectors_cmd_status */
3930	u8 status;
3931	/* alignment to 32b */
3932	u8 reserved[3];
3933} __packed;
3934
3935/* WMI_SET_SILENT_RSSI_TABLE_DONE_EVENTID */
3936struct wmi_set_silent_rssi_table_done_event {
3937	/* enum wmi_silent_rssi_status */
3938	__le32 status;
3939	/* enum wmi_silent_rssi_table */
3940	__le32 table;
3941} __packed;
3942
3943/* WMI_VRING_SWITCH_TIMING_CONFIG_EVENTID */
3944struct wmi_vring_switch_timing_config_event {
3945	/* enum wmi_fw_status */
3946	u8 status;
3947	u8 reserved[3];
3948} __packed;
3949
3950/* WMI_GET_ASSOC_LIST_RES_EVENTID */
3951struct wmi_assoc_sta_info {
3952	u8 mac[WMI_MAC_LEN];
3953	u8 omni_index_address;
3954	u8 reserved;
3955} __packed;
3956
3957#define WMI_GET_ASSOC_LIST_SIZE	(8)
3958
3959/* WMI_GET_ASSOC_LIST_RES_EVENTID
3960 * Returns up to MAX_ASSOC_STA_LIST_SIZE associated STAs
3961 */
3962struct wmi_get_assoc_list_res_event {
3963	struct wmi_assoc_sta_info assoc_sta_list[WMI_GET_ASSOC_LIST_SIZE];
3964	/* STA count */
3965	u8 count;
3966	u8 reserved[3];
3967} __packed;
3968
3969/* WMI_BF_CONTROL_EVENTID - deprecated */
3970struct wmi_bf_control_event {
3971	/* wmi_fw_status */
3972	u8 status;
3973	u8 reserved[3];
3974} __packed;
3975
3976/* WMI_BF_CONTROL_EX_EVENTID */
3977struct wmi_bf_control_ex_event {
3978	/* wmi_fw_status */
3979	u8 status;
3980	u8 reserved[3];
3981} __packed;
3982
3983/* WMI_COMMAND_NOT_SUPPORTED_EVENTID */
3984struct wmi_command_not_supported_event {
3985	/* device id */
3986	u8 mid;
3987	u8 reserved0;
3988	__le16 command_id;
3989	/* for UT command only, otherwise reserved */
3990	__le16 command_subtype;
3991	__le16 reserved1;
3992} __packed;
3993
3994/* WMI_TSF_SYNC_CMDID */
3995struct wmi_tsf_sync_cmd {
3996	/* The time interval to send announce frame in one BI */
3997	u8 interval_ms;
3998	/* The mcs to send announce frame */
3999	u8 mcs;
4000	u8 reserved[6];
4001} __packed;
4002
4003/* WMI_TSF_SYNC_STATUS_EVENTID */
4004enum wmi_tsf_sync_status {
4005	WMI_TSF_SYNC_SUCCESS	= 0x00,
4006	WMI_TSF_SYNC_FAILED	= 0x01,
4007	WMI_TSF_SYNC_REJECTED	= 0x02,
4008};
4009
4010/* WMI_TSF_SYNC_STATUS_EVENTID */
4011struct wmi_tsf_sync_status_event {
4012	/* enum wmi_tsf_sync_status */
4013	u8 status;
4014	u8 reserved[3];
4015} __packed;
4016
4017/* WMI_GET_CCA_INDICATIONS_EVENTID */
4018struct wmi_get_cca_indications_event {
4019	/* wmi_fw_status */
4020	u8 status;
4021	/* CCA-Energy Detect in percentage over last BI (0..100) */
4022	u8 cca_ed_percent;
4023	/* Averaged CCA-Energy Detect in percent over number of BIs (0..100) */
4024	u8 cca_ed_avg_percent;
4025	/* NAV percent over last BI (0..100) */
4026	u8 nav_percent;
4027	/* Averaged NAV percent over number of BIs (0..100) */
4028	u8 nav_avg_percent;
4029	u8 reserved[3];
4030} __packed;
4031
4032/* WMI_SET_CCA_INDICATIONS_BI_AVG_NUM_CMDID */
4033struct wmi_set_cca_indications_bi_avg_num_cmd {
4034	/* set the number of bis to average cca_ed (0..255) */
4035	u8 bi_number;
4036	u8 reserved[3];
4037} __packed;
4038
4039/* WMI_SET_CCA_INDICATIONS_BI_AVG_NUM_EVENTID */
4040struct wmi_set_cca_indications_bi_avg_num_event {
4041	/* wmi_fw_status */
4042	u8 status;
4043	u8 reserved[3];
4044} __packed;
4045
4046/* WMI_INTERNAL_FW_SET_CHANNEL */
4047struct wmi_internal_fw_set_channel_event {
4048	u8 channel_num;
4049	u8 reserved[3];
4050} __packed;
4051
4052/* WMI_LINK_STATS_CONFIG_DONE_EVENTID */
4053struct wmi_link_stats_config_done_event {
4054	/* wmi_fw_status_e */
4055	u8 status;
4056	u8 reserved[3];
4057} __packed;
4058
4059/* WMI_LINK_STATS_EVENTID */
4060struct wmi_link_stats_event {
4061	__le64 tsf;
4062	__le16 payload_size;
4063	u8 has_next;
4064	u8 reserved[5];
4065	/* a stream of wmi_link_stats_record_s */
4066	u8 payload[0];
4067} __packed;
4068
4069/* WMI_LINK_STATS_EVENT */
4070struct wmi_link_stats_record {
4071	/* wmi_link_stats_record_type_e */
4072	u8 record_type_id;
4073	u8 reserved;
4074	__le16 record_size;
4075	u8 record[0];
4076} __packed;
4077
4078/* WMI_LINK_STATS_TYPE_BASIC */
4079struct wmi_link_stats_basic {
4080	u8 cid;
4081	s8 rssi;
4082	u8 sqi;
4083	u8 bf_mcs;
4084	u8 per_average;
4085	u8 selected_rfc;
4086	u8 rx_effective_ant_num;
4087	u8 my_rx_sector;
4088	u8 my_tx_sector;
4089	u8 other_rx_sector;
4090	u8 other_tx_sector;
4091	u8 reserved[7];
4092	/* 1/4 Db units */
4093	__le16 snr;
4094	__le32 tx_tpt;
4095	__le32 tx_goodput;
4096	__le32 rx_goodput;
4097	__le32 bf_count;
4098	__le32 rx_bcast_frames;
4099} __packed;
4100
4101/* WMI_LINK_STATS_TYPE_GLOBAL */
4102struct wmi_link_stats_global {
4103	/* all ack-able frames */
4104	__le32 rx_frames;
4105	/* all ack-able frames */
4106	__le32 tx_frames;
4107	__le32 rx_ba_frames;
4108	__le32 tx_ba_frames;
4109	__le32 tx_beacons;
4110	__le32 rx_mic_errors;
4111	__le32 rx_crc_errors;
4112	__le32 tx_fail_no_ack;
4113	u8 reserved[8];
4114} __packed;
4115
4116/* WMI_SET_GRANT_MCS_EVENTID */
4117struct wmi_set_grant_mcs_event {
4118	/* wmi_fw_status */
4119	u8 status;
4120	u8 reserved[3];
4121} __packed;
4122
4123/* WMI_SET_AP_SLOT_SIZE_EVENTID */
4124struct wmi_set_ap_slot_size_event {
4125	/* wmi_fw_status */
4126	u8 status;
4127	u8 reserved[3];
4128} __packed;
4129
4130/* WMI_SET_VRING_PRIORITY_WEIGHT_EVENTID */
4131struct wmi_set_vring_priority_weight_event {
4132	/* wmi_fw_status */
4133	u8 status;
4134	u8 reserved[3];
4135} __packed;
4136
4137/* WMI_SET_VRING_PRIORITY_EVENTID */
4138struct wmi_set_vring_priority_event {
4139	/* wmi_fw_status */
4140	u8 status;
4141	u8 reserved[3];
4142} __packed;
4143
4144/* WMI_RADAR_PCI_CTRL_BLOCK struct */
4145struct wmi_radar_pci_ctrl_block {
4146	/* last fw tail address index */
4147	__le32 fw_tail_index;
4148	/* last SW head address index known to FW */
4149	__le32 sw_head_index;
4150	__le32 last_wr_pulse_tsf_low;
4151	__le32 last_wr_pulse_count;
4152	__le32 last_wr_in_bytes;
4153	__le32 last_wr_pulse_id;
4154	__le32 last_wr_burst_id;
4155	/* When pre overflow detected, advance sw head in unit of pulses */
4156	__le32 sw_head_inc;
4157	__le32 reserved[8];
4158} __packed;
4159
4160/* WMI_RBUFCAP_CFG_CMD */
4161struct wmi_rbufcap_cfg_cmd {
4162	u8 enable;
4163	u8 reserved;
4164	/* RBUFCAP indicates rx space unavailable when number of rx
4165	 * descriptors drops below this threshold. Set 0 to use system
4166	 * default
4167	 */
4168	__le16 rx_desc_threshold;
4169} __packed;
4170
4171/* WMI_RBUFCAP_CFG_EVENTID */
4172struct wmi_rbufcap_cfg_event {
4173	/* enum wmi_fw_status */
4174	u8 status;
4175	u8 reserved[3];
4176} __packed;
4177
4178/* WMI_TEMP_SENSE_ALL_DONE_EVENTID
4179 * Measure MAC and all radio temperatures
4180 */
4181struct wmi_temp_sense_all_done_event {
4182	/* enum wmi_fw_status */
4183	u8 status;
4184	/* Bitmap of connected RFs */
4185	u8 rf_bitmap;
4186	u8 reserved[2];
4187	/* Temperature times 1000 (actual temperature will be achieved by
4188	 * dividing the value by 1000). When temperature cannot be read from
4189	 * device return WMI_INVALID_TEMPERATURE
4190	 */
4191	__le32 rf_t1000[WMI_MAX_XIF_PORTS_NUM];
4192	/* Temperature times 1000 (actual temperature will be achieved by
4193	 * dividing the value by 1000). When temperature cannot be read from
4194	 * device return WMI_INVALID_TEMPERATURE
4195	 */
4196	__le32 baseband_t1000;
4197} __packed;
4198
4199#endif /* __WILOCITY_WMI_H__ */