diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/wmi.h')
| -rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi.h | 1326 | 
1 files changed, 1286 insertions, 40 deletions
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index 2c5a4f8daf2..e93df2c1041 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -198,15 +198,117 @@ struct wmi_mac_addr {  	} __packed;  } __packed; -/* macro to convert MAC address from WMI word format to char array */ -#define WMI_MAC_ADDR_TO_CHAR_ARRAY(pwmi_mac_addr, c_macaddr) do { \ -	(c_macaddr)[0] =  ((pwmi_mac_addr)->word0) & 0xff; \ -	(c_macaddr)[1] = (((pwmi_mac_addr)->word0) >> 8) & 0xff; \ -	(c_macaddr)[2] = (((pwmi_mac_addr)->word0) >> 16) & 0xff; \ -	(c_macaddr)[3] = (((pwmi_mac_addr)->word0) >> 24) & 0xff; \ -	(c_macaddr)[4] =  ((pwmi_mac_addr)->word1) & 0xff; \ -	(c_macaddr)[5] = (((pwmi_mac_addr)->word1) >> 8) & 0xff; \ -	} while (0) +struct wmi_cmd_map { +	u32 init_cmdid; +	u32 start_scan_cmdid; +	u32 stop_scan_cmdid; +	u32 scan_chan_list_cmdid; +	u32 scan_sch_prio_tbl_cmdid; +	u32 pdev_set_regdomain_cmdid; +	u32 pdev_set_channel_cmdid; +	u32 pdev_set_param_cmdid; +	u32 pdev_pktlog_enable_cmdid; +	u32 pdev_pktlog_disable_cmdid; +	u32 pdev_set_wmm_params_cmdid; +	u32 pdev_set_ht_cap_ie_cmdid; +	u32 pdev_set_vht_cap_ie_cmdid; +	u32 pdev_set_dscp_tid_map_cmdid; +	u32 pdev_set_quiet_mode_cmdid; +	u32 pdev_green_ap_ps_enable_cmdid; +	u32 pdev_get_tpc_config_cmdid; +	u32 pdev_set_base_macaddr_cmdid; +	u32 vdev_create_cmdid; +	u32 vdev_delete_cmdid; +	u32 vdev_start_request_cmdid; +	u32 vdev_restart_request_cmdid; +	u32 vdev_up_cmdid; +	u32 vdev_stop_cmdid; +	u32 vdev_down_cmdid; +	u32 vdev_set_param_cmdid; +	u32 vdev_install_key_cmdid; +	u32 peer_create_cmdid; +	u32 peer_delete_cmdid; +	u32 peer_flush_tids_cmdid; +	u32 peer_set_param_cmdid; +	u32 peer_assoc_cmdid; +	u32 peer_add_wds_entry_cmdid; +	u32 peer_remove_wds_entry_cmdid; +	u32 peer_mcast_group_cmdid; +	u32 bcn_tx_cmdid; +	u32 pdev_send_bcn_cmdid; +	u32 bcn_tmpl_cmdid; +	u32 bcn_filter_rx_cmdid; +	u32 prb_req_filter_rx_cmdid; +	u32 mgmt_tx_cmdid; +	u32 prb_tmpl_cmdid; +	u32 addba_clear_resp_cmdid; +	u32 addba_send_cmdid; +	u32 addba_status_cmdid; +	u32 delba_send_cmdid; +	u32 addba_set_resp_cmdid; +	u32 send_singleamsdu_cmdid; +	u32 sta_powersave_mode_cmdid; +	u32 sta_powersave_param_cmdid; +	u32 sta_mimo_ps_mode_cmdid; +	u32 pdev_dfs_enable_cmdid; +	u32 pdev_dfs_disable_cmdid; +	u32 roam_scan_mode; +	u32 roam_scan_rssi_threshold; +	u32 roam_scan_period; +	u32 roam_scan_rssi_change_threshold; +	u32 roam_ap_profile; +	u32 ofl_scan_add_ap_profile; +	u32 ofl_scan_remove_ap_profile; +	u32 ofl_scan_period; +	u32 p2p_dev_set_device_info; +	u32 p2p_dev_set_discoverability; +	u32 p2p_go_set_beacon_ie; +	u32 p2p_go_set_probe_resp_ie; +	u32 p2p_set_vendor_ie_data_cmdid; +	u32 ap_ps_peer_param_cmdid; +	u32 ap_ps_peer_uapsd_coex_cmdid; +	u32 peer_rate_retry_sched_cmdid; +	u32 wlan_profile_trigger_cmdid; +	u32 wlan_profile_set_hist_intvl_cmdid; +	u32 wlan_profile_get_profile_data_cmdid; +	u32 wlan_profile_enable_profile_id_cmdid; +	u32 wlan_profile_list_profile_id_cmdid; +	u32 pdev_suspend_cmdid; +	u32 pdev_resume_cmdid; +	u32 add_bcn_filter_cmdid; +	u32 rmv_bcn_filter_cmdid; +	u32 wow_add_wake_pattern_cmdid; +	u32 wow_del_wake_pattern_cmdid; +	u32 wow_enable_disable_wake_event_cmdid; +	u32 wow_enable_cmdid; +	u32 wow_hostwakeup_from_sleep_cmdid; +	u32 rtt_measreq_cmdid; +	u32 rtt_tsf_cmdid; +	u32 vdev_spectral_scan_configure_cmdid; +	u32 vdev_spectral_scan_enable_cmdid; +	u32 request_stats_cmdid; +	u32 set_arp_ns_offload_cmdid; +	u32 network_list_offload_config_cmdid; +	u32 gtk_offload_cmdid; +	u32 csa_offload_enable_cmdid; +	u32 csa_offload_chanswitch_cmdid; +	u32 chatter_set_mode_cmdid; +	u32 peer_tid_addba_cmdid; +	u32 peer_tid_delba_cmdid; +	u32 sta_dtim_ps_method_cmdid; +	u32 sta_uapsd_auto_trig_cmdid; +	u32 sta_keepalive_cmd; +	u32 echo_cmdid; +	u32 pdev_utf_cmdid; +	u32 dbglog_cfg_cmdid; +	u32 pdev_qvit_cmdid; +	u32 pdev_ftm_intg_cmdid; +	u32 vdev_set_keepalive_cmdid; +	u32 vdev_get_keepalive_cmdid; +	u32 force_fw_hang_cmdid; +	u32 gpio_config_cmdid; +	u32 gpio_output_cmdid; +};  /*   * wmi command groups. @@ -247,7 +349,9 @@ enum wmi_cmd_group {  #define WMI_CMD_GRP(grp_id) (((grp_id) << 12) | 0x1)  #define WMI_EVT_GRP_START_ID(grp_id) (((grp_id) << 12) | 0x1) -/* Command IDs and commande events. */ +#define WMI_CMD_UNSUPPORTED 0 + +/* Command IDs and command events for MAIN FW. */  enum wmi_cmd_id {  	WMI_INIT_CMDID = 0x1, @@ -488,6 +592,217 @@ enum wmi_event_id {  	WMI_GPIO_INPUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GPIO),  }; +/* Command IDs and command events for 10.X firmware */ +enum wmi_10x_cmd_id { +	WMI_10X_START_CMDID = 0x9000, +	WMI_10X_END_CMDID = 0x9FFF, + +	/* initialize the wlan sub system */ +	WMI_10X_INIT_CMDID, + +	/* Scan specific commands */ + +	WMI_10X_START_SCAN_CMDID = WMI_10X_START_CMDID, +	WMI_10X_STOP_SCAN_CMDID, +	WMI_10X_SCAN_CHAN_LIST_CMDID, +	WMI_10X_ECHO_CMDID, + +	/* PDEV(physical device) specific commands */ +	WMI_10X_PDEV_SET_REGDOMAIN_CMDID, +	WMI_10X_PDEV_SET_CHANNEL_CMDID, +	WMI_10X_PDEV_SET_PARAM_CMDID, +	WMI_10X_PDEV_PKTLOG_ENABLE_CMDID, +	WMI_10X_PDEV_PKTLOG_DISABLE_CMDID, +	WMI_10X_PDEV_SET_WMM_PARAMS_CMDID, +	WMI_10X_PDEV_SET_HT_CAP_IE_CMDID, +	WMI_10X_PDEV_SET_VHT_CAP_IE_CMDID, +	WMI_10X_PDEV_SET_BASE_MACADDR_CMDID, +	WMI_10X_PDEV_SET_DSCP_TID_MAP_CMDID, +	WMI_10X_PDEV_SET_QUIET_MODE_CMDID, +	WMI_10X_PDEV_GREEN_AP_PS_ENABLE_CMDID, +	WMI_10X_PDEV_GET_TPC_CONFIG_CMDID, + +	/* VDEV(virtual device) specific commands */ +	WMI_10X_VDEV_CREATE_CMDID, +	WMI_10X_VDEV_DELETE_CMDID, +	WMI_10X_VDEV_START_REQUEST_CMDID, +	WMI_10X_VDEV_RESTART_REQUEST_CMDID, +	WMI_10X_VDEV_UP_CMDID, +	WMI_10X_VDEV_STOP_CMDID, +	WMI_10X_VDEV_DOWN_CMDID, +	WMI_10X_VDEV_STANDBY_RESPONSE_CMDID, +	WMI_10X_VDEV_RESUME_RESPONSE_CMDID, +	WMI_10X_VDEV_SET_PARAM_CMDID, +	WMI_10X_VDEV_INSTALL_KEY_CMDID, + +	/* peer specific commands */ +	WMI_10X_PEER_CREATE_CMDID, +	WMI_10X_PEER_DELETE_CMDID, +	WMI_10X_PEER_FLUSH_TIDS_CMDID, +	WMI_10X_PEER_SET_PARAM_CMDID, +	WMI_10X_PEER_ASSOC_CMDID, +	WMI_10X_PEER_ADD_WDS_ENTRY_CMDID, +	WMI_10X_PEER_REMOVE_WDS_ENTRY_CMDID, +	WMI_10X_PEER_MCAST_GROUP_CMDID, + +	/* beacon/management specific commands */ + +	WMI_10X_BCN_TX_CMDID, +	WMI_10X_BCN_PRB_TMPL_CMDID, +	WMI_10X_BCN_FILTER_RX_CMDID, +	WMI_10X_PRB_REQ_FILTER_RX_CMDID, +	WMI_10X_MGMT_TX_CMDID, + +	/* commands to directly control ba negotiation directly from host. */ +	WMI_10X_ADDBA_CLEAR_RESP_CMDID, +	WMI_10X_ADDBA_SEND_CMDID, +	WMI_10X_ADDBA_STATUS_CMDID, +	WMI_10X_DELBA_SEND_CMDID, +	WMI_10X_ADDBA_SET_RESP_CMDID, +	WMI_10X_SEND_SINGLEAMSDU_CMDID, + +	/* Station power save specific config */ +	WMI_10X_STA_POWERSAVE_MODE_CMDID, +	WMI_10X_STA_POWERSAVE_PARAM_CMDID, +	WMI_10X_STA_MIMO_PS_MODE_CMDID, + +	/* set debug log config */ +	WMI_10X_DBGLOG_CFG_CMDID, + +	/* DFS-specific commands */ +	WMI_10X_PDEV_DFS_ENABLE_CMDID, +	WMI_10X_PDEV_DFS_DISABLE_CMDID, + +	/* QVIT specific command id */ +	WMI_10X_PDEV_QVIT_CMDID, + +	/* Offload Scan and Roaming related  commands */ +	WMI_10X_ROAM_SCAN_MODE, +	WMI_10X_ROAM_SCAN_RSSI_THRESHOLD, +	WMI_10X_ROAM_SCAN_PERIOD, +	WMI_10X_ROAM_SCAN_RSSI_CHANGE_THRESHOLD, +	WMI_10X_ROAM_AP_PROFILE, +	WMI_10X_OFL_SCAN_ADD_AP_PROFILE, +	WMI_10X_OFL_SCAN_REMOVE_AP_PROFILE, +	WMI_10X_OFL_SCAN_PERIOD, + +	/* P2P specific commands */ +	WMI_10X_P2P_DEV_SET_DEVICE_INFO, +	WMI_10X_P2P_DEV_SET_DISCOVERABILITY, +	WMI_10X_P2P_GO_SET_BEACON_IE, +	WMI_10X_P2P_GO_SET_PROBE_RESP_IE, + +	/* AP power save specific config */ +	WMI_10X_AP_PS_PEER_PARAM_CMDID, +	WMI_10X_AP_PS_PEER_UAPSD_COEX_CMDID, + +	/* Rate-control specific commands */ +	WMI_10X_PEER_RATE_RETRY_SCHED_CMDID, + +	/* WLAN Profiling commands. */ +	WMI_10X_WLAN_PROFILE_TRIGGER_CMDID, +	WMI_10X_WLAN_PROFILE_SET_HIST_INTVL_CMDID, +	WMI_10X_WLAN_PROFILE_GET_PROFILE_DATA_CMDID, +	WMI_10X_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID, +	WMI_10X_WLAN_PROFILE_LIST_PROFILE_ID_CMDID, + +	/* Suspend resume command Ids */ +	WMI_10X_PDEV_SUSPEND_CMDID, +	WMI_10X_PDEV_RESUME_CMDID, + +	/* Beacon filter commands */ +	WMI_10X_ADD_BCN_FILTER_CMDID, +	WMI_10X_RMV_BCN_FILTER_CMDID, + +	/* WOW Specific WMI commands*/ +	WMI_10X_WOW_ADD_WAKE_PATTERN_CMDID, +	WMI_10X_WOW_DEL_WAKE_PATTERN_CMDID, +	WMI_10X_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID, +	WMI_10X_WOW_ENABLE_CMDID, +	WMI_10X_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID, + +	/* RTT measurement related cmd */ +	WMI_10X_RTT_MEASREQ_CMDID, +	WMI_10X_RTT_TSF_CMDID, + +	/* transmit beacon by value */ +	WMI_10X_PDEV_SEND_BCN_CMDID, + +	/* F/W stats */ +	WMI_10X_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID, +	WMI_10X_VDEV_SPECTRAL_SCAN_ENABLE_CMDID, +	WMI_10X_REQUEST_STATS_CMDID, + +	/* GPIO Configuration */ +	WMI_10X_GPIO_CONFIG_CMDID, +	WMI_10X_GPIO_OUTPUT_CMDID, + +	WMI_10X_PDEV_UTF_CMDID = WMI_10X_END_CMDID - 1, +}; + +enum wmi_10x_event_id { +	WMI_10X_SERVICE_READY_EVENTID = 0x8000, +	WMI_10X_READY_EVENTID, +	WMI_10X_START_EVENTID = 0x9000, +	WMI_10X_END_EVENTID = 0x9FFF, + +	/* Scan specific events */ +	WMI_10X_SCAN_EVENTID = WMI_10X_START_EVENTID, +	WMI_10X_ECHO_EVENTID, +	WMI_10X_DEBUG_MESG_EVENTID, +	WMI_10X_UPDATE_STATS_EVENTID, + +	/* Instantaneous RSSI event */ +	WMI_10X_INST_RSSI_STATS_EVENTID, + +	/* VDEV specific events */ +	WMI_10X_VDEV_START_RESP_EVENTID, +	WMI_10X_VDEV_STANDBY_REQ_EVENTID, +	WMI_10X_VDEV_RESUME_REQ_EVENTID, +	WMI_10X_VDEV_STOPPED_EVENTID, + +	/* peer  specific events */ +	WMI_10X_PEER_STA_KICKOUT_EVENTID, + +	/* beacon/mgmt specific events */ +	WMI_10X_HOST_SWBA_EVENTID, +	WMI_10X_TBTTOFFSET_UPDATE_EVENTID, +	WMI_10X_MGMT_RX_EVENTID, + +	/* Channel stats event */ +	WMI_10X_CHAN_INFO_EVENTID, + +	/* PHY Error specific WMI event */ +	WMI_10X_PHYERR_EVENTID, + +	/* Roam event to trigger roaming on host */ +	WMI_10X_ROAM_EVENTID, + +	/* matching AP found from list of profiles */ +	WMI_10X_PROFILE_MATCH, + +	/* debug print message used for tracing FW code while debugging */ +	WMI_10X_DEBUG_PRINT_EVENTID, +	/* VI spoecific event */ +	WMI_10X_PDEV_QVIT_EVENTID, +	/* FW code profile data in response to profile request */ +	WMI_10X_WLAN_PROFILE_DATA_EVENTID, + +	/*RTT related event ID*/ +	WMI_10X_RTT_MEASUREMENT_REPORT_EVENTID, +	WMI_10X_TSF_MEASUREMENT_REPORT_EVENTID, +	WMI_10X_RTT_ERROR_REPORT_EVENTID, + +	WMI_10X_WOW_WAKEUP_HOST_EVENTID, +	WMI_10X_DCS_INTERFERENCE_EVENTID, + +	/* TPC config for the current operating channel */ +	WMI_10X_PDEV_TPC_CONFIG_EVENTID, + +	WMI_10X_GPIO_INPUT_EVENTID, +	WMI_10X_PDEV_UTF_EVENTID = WMI_10X_END_EVENTID-1, +}; +  enum wmi_phy_mode {  	MODE_11A        = 0,   /* 11a Mode */  	MODE_11G        = 1,   /* 11b/g Mode */ @@ -508,6 +823,48 @@ enum wmi_phy_mode {  	MODE_MAX        = 14  }; +static inline const char *ath10k_wmi_phymode_str(enum wmi_phy_mode mode) +{ +	switch (mode) { +	case MODE_11A: +		return "11a"; +	case MODE_11G: +		return "11g"; +	case MODE_11B: +		return "11b"; +	case MODE_11GONLY: +		return "11gonly"; +	case MODE_11NA_HT20: +		return "11na-ht20"; +	case MODE_11NG_HT20: +		return "11ng-ht20"; +	case MODE_11NA_HT40: +		return "11na-ht40"; +	case MODE_11NG_HT40: +		return "11ng-ht40"; +	case MODE_11AC_VHT20: +		return "11ac-vht20"; +	case MODE_11AC_VHT40: +		return "11ac-vht40"; +	case MODE_11AC_VHT80: +		return "11ac-vht80"; +	case MODE_11AC_VHT20_2G: +		return "11ac-vht20-2g"; +	case MODE_11AC_VHT40_2G: +		return "11ac-vht40-2g"; +	case MODE_11AC_VHT80_2G: +		return "11ac-vht80-2g"; +	case MODE_UNKNOWN: +		/* skip */ +		break; + +		/* no default handler to allow compiler to check that the +		 * enum is fully handled */ +	}; + +	return "<unknown>"; +} +  #define WMI_CHAN_LIST_TAG	0x1  #define WMI_SSID_LIST_TAG	0x2  #define WMI_BSSID_LIST_TAG	0x3 @@ -526,6 +883,7 @@ struct wmi_channel {  	union {  		__le32 reginfo0;  		struct { +			/* note: power unit is 0.5 dBm */  			u8 min_power;  			u8 max_power;  			u8 reg_power; @@ -548,7 +906,8 @@ struct wmi_channel_arg {  	bool allow_ht;  	bool allow_vht;  	bool ht40plus; -	/* note: power unit is 1/4th of dBm */ +	bool chan_radar; +	/* note: power unit is 0.5 dBm */  	u32 min_power;  	u32 max_power;  	u32 max_reg_power; @@ -763,13 +1122,45 @@ struct wmi_service_ready_event {  	struct wlan_host_mem_req mem_reqs[1];  } __packed; -/* - * status consists of  upper 16 bits fo int status and lower 16 bits of - * module ID that retuned status - */ -#define WLAN_INIT_STATUS_SUCCESS   0x0 -#define WLAN_GET_INIT_STATUS_REASON(status)    ((status) & 0xffff) -#define WLAN_GET_INIT_STATUS_MODULE_ID(status) (((status) >> 16) & 0xffff) +/* This is the definition from 10.X firmware branch */ +struct wmi_service_ready_event_10x { +	__le32 sw_version; +	__le32 abi_version; + +	/* WMI_PHY_CAPABILITY */ +	__le32 phy_capability; + +	/* Maximum number of frag table entries that SW will populate less 1 */ +	__le32 max_frag_entry; +	__le32 wmi_service_bitmap[WMI_SERVICE_BM_SIZE]; +	__le32 num_rf_chains; + +	/* +	 * The following field is only valid for service type +	 * WMI_SERVICE_11AC +	 */ +	__le32 ht_cap_info; /* WMI HT Capability */ +	__le32 vht_cap_info; /* VHT capability info field of 802.11ac */ +	__le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */ +	__le32 hw_min_tx_power; +	__le32 hw_max_tx_power; + +	struct hal_reg_capabilities hal_reg_capabilities; + +	__le32 sys_cap_info; +	__le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */ + +	/* +	 * request to host to allocate a chuck of memory and pss it down to FW +	 * via WM_INIT. FW uses this as FW extesnsion memory for saving its +	 * data structures. Only valid for low latency interfaces like PCIE +	 * where FW can access this memory directly (or) by DMA. +	 */ +	__le32 num_mem_reqs; + +	struct wlan_host_mem_req mem_reqs[1]; +} __packed; +  #define WMI_SERVICE_READY_TIMEOUT_HZ (5*HZ)  #define WMI_UNIFIED_READY_TIMEOUT_HZ (5*HZ) @@ -864,7 +1255,7 @@ struct wmi_resource_config {  	 */  	__le32 rx_decap_mode; -	/* what is the maximum scan requests than can be queued */ +	/* what is the maximum number of scan requests that can be queued */  	__le32 scan_max_pending_reqs;  	/* maximum VDEV that could use BMISS offload */ @@ -978,6 +1369,192 @@ struct wmi_resource_config {  	__le32 max_frag_entries;  } __packed; +struct wmi_resource_config_10x { +	/* number of virtual devices (VAPs) to support */ +	__le32 num_vdevs; + +	/* number of peer nodes to support */ +	__le32 num_peers; + +	/* number of keys per peer */ +	__le32 num_peer_keys; + +	/* total number of TX/RX data TIDs */ +	__le32 num_tids; + +	/* +	 * max skid for resolving hash collisions +	 * +	 *   The address search table is sparse, so that if two MAC addresses +	 *   result in the same hash value, the second of these conflicting +	 *   entries can slide to the next index in the address search table, +	 *   and use it, if it is unoccupied.  This ast_skid_limit parameter +	 *   specifies the upper bound on how many subsequent indices to search +	 *   over to find an unoccupied space. +	 */ +	__le32 ast_skid_limit; + +	/* +	 * the nominal chain mask for transmit +	 * +	 *   The chain mask may be modified dynamically, e.g. to operate AP +	 *   tx with a reduced number of chains if no clients are associated. +	 *   This configuration parameter specifies the nominal chain-mask that +	 *   should be used when not operating with a reduced set of tx chains. +	 */ +	__le32 tx_chain_mask; + +	/* +	 * the nominal chain mask for receive +	 * +	 *   The chain mask may be modified dynamically, e.g. for a client +	 *   to use a reduced number of chains for receive if the traffic to +	 *   the client is low enough that it doesn't require downlink MIMO +	 *   or antenna diversity. +	 *   This configuration parameter specifies the nominal chain-mask that +	 *   should be used when not operating with a reduced set of rx chains. +	 */ +	__le32 rx_chain_mask; + +	/* +	 * what rx reorder timeout (ms) to use for the AC +	 * +	 *   Each WMM access class (voice, video, best-effort, background) will +	 *   have its own timeout value to dictate how long to wait for missing +	 *   rx MPDUs to arrive before flushing subsequent MPDUs that have +	 *   already been received. +	 *   This parameter specifies the timeout in milliseconds for each +	 *   class. +	 */ +	__le32 rx_timeout_pri_vi; +	__le32 rx_timeout_pri_vo; +	__le32 rx_timeout_pri_be; +	__le32 rx_timeout_pri_bk; + +	/* +	 * what mode the rx should decap packets to +	 * +	 *   MAC can decap to RAW (no decap), native wifi or Ethernet types +	 *   THis setting also determines the default TX behavior, however TX +	 *   behavior can be modified on a per VAP basis during VAP init +	 */ +	__le32 rx_decap_mode; + +	/* what is the maximum number of scan requests that can be queued */ +	__le32 scan_max_pending_reqs; + +	/* maximum VDEV that could use BMISS offload */ +	__le32 bmiss_offload_max_vdev; + +	/* maximum VDEV that could use offload roaming */ +	__le32 roam_offload_max_vdev; + +	/* maximum AP profiles that would push to offload roaming */ +	__le32 roam_offload_max_ap_profiles; + +	/* +	 * how many groups to use for mcast->ucast conversion +	 * +	 *   The target's WAL maintains a table to hold information regarding +	 *   which peers belong to a given multicast group, so that if +	 *   multicast->unicast conversion is enabled, the target can convert +	 *   multicast tx frames to a series of unicast tx frames, to each +	 *   peer within the multicast group. +	     This num_mcast_groups configuration parameter tells the target how +	 *   many multicast groups to provide storage for within its multicast +	 *   group membership table. +	 */ +	__le32 num_mcast_groups; + +	/* +	 * size to alloc for the mcast membership table +	 * +	 *   This num_mcast_table_elems configuration parameter tells the +	 *   target how many peer elements it needs to provide storage for in +	 *   its multicast group membership table. +	 *   These multicast group membership table elements are shared by the +	 *   multicast groups stored within the table. +	 */ +	__le32 num_mcast_table_elems; + +	/* +	 * whether/how to do multicast->unicast conversion +	 * +	 *   This configuration parameter specifies whether the target should +	 *   perform multicast --> unicast conversion on transmit, and if so, +	 *   what to do if it finds no entries in its multicast group +	 *   membership table for the multicast IP address in the tx frame. +	 *   Configuration value: +	 *   0 -> Do not perform multicast to unicast conversion. +	 *   1 -> Convert multicast frames to unicast, if the IP multicast +	 *        address from the tx frame is found in the multicast group +	 *        membership table.  If the IP multicast address is not found, +	 *        drop the frame. +	 *   2 -> Convert multicast frames to unicast, if the IP multicast +	 *        address from the tx frame is found in the multicast group +	 *        membership table.  If the IP multicast address is not found, +	 *        transmit the frame as multicast. +	 */ +	__le32 mcast2ucast_mode; + +	/* +	 * how much memory to allocate for a tx PPDU dbg log +	 * +	 *   This parameter controls how much memory the target will allocate +	 *   to store a log of tx PPDU meta-information (how large the PPDU +	 *   was, when it was sent, whether it was successful, etc.) +	 */ +	__le32 tx_dbg_log_size; + +	/* how many AST entries to be allocated for WDS */ +	__le32 num_wds_entries; + +	/* +	 * MAC DMA burst size, e.g., For target PCI limit can be +	 * 0 -default, 1 256B +	 */ +	__le32 dma_burst_size; + +	/* +	 * Fixed delimiters to be inserted after every MPDU to +	 * account for interface latency to avoid underrun. +	 */ +	__le32 mac_aggr_delim; + +	/* +	 *   determine whether target is responsible for detecting duplicate +	 *   non-aggregate MPDU and timing out stale fragments. +	 * +	 *   A-MPDU reordering is always performed on the target. +	 * +	 *   0: target responsible for frag timeout and dup checking +	 *   1: host responsible for frag timeout and dup checking +	 */ +	__le32 rx_skip_defrag_timeout_dup_detection_check; + +	/* +	 * Configuration for VoW : +	 * No of Video Nodes to be supported +	 * and Max no of descriptors for each Video link (node). +	 */ +	__le32 vow_config; + +	/* Number of msdu descriptors target should use */ +	__le32 num_msdu_desc; + +	/* +	 * Max. number of Tx fragments per MSDU +	 *  This parameter controls the max number of Tx fragments per MSDU. +	 *  This is sent by the target as part of the WMI_SERVICE_READY event +	 *  and is overriden by the OS shim as required. +	 */ +	__le32 max_frag_entries; +} __packed; + + +#define NUM_UNITS_IS_NUM_VDEVS   0x1 +#define NUM_UNITS_IS_NUM_PEERS   0x2 +  /* strucutre describing host memory chunk. */  struct host_memory_chunk {  	/* id of the request that is passed up in service ready */ @@ -999,6 +1576,18 @@ struct wmi_init_cmd {  	struct host_memory_chunk host_mem_chunks[1];  } __packed; +/* _10x stucture is from 10.X FW API */ +struct wmi_init_cmd_10x { +	struct wmi_resource_config_10x resource_config; +	__le32 num_host_mem_chunks; + +	/* +	 * variable number of host memory chunks. +	 * This should be the last element in the structure +	 */ +	struct host_memory_chunk host_mem_chunks[1]; +} __packed; +  /* TLV for channel list */  struct wmi_chan_list {  	__le32 tag; /* WMI_CHAN_LIST_TAG */ @@ -1118,6 +1707,88 @@ struct wmi_start_scan_cmd {  	 */  } __packed; +/* This is the definition from 10.X firmware branch */ +struct wmi_start_scan_cmd_10x { +	/* Scan ID */ +	__le32 scan_id; + +	/* Scan requestor ID */ +	__le32 scan_req_id; + +	/* VDEV id(interface) that is requesting scan */ +	__le32 vdev_id; + +	/* Scan Priority, input to scan scheduler */ +	__le32 scan_priority; + +	/* Scan events subscription */ +	__le32 notify_scan_events; + +	/* dwell time in msec on active channels */ +	__le32 dwell_time_active; + +	/* dwell time in msec on passive channels */ +	__le32 dwell_time_passive; + +	/* +	 * min time in msec on the BSS channel,only valid if atleast one +	 * VDEV is active +	 */ +	__le32 min_rest_time; + +	/* +	 * max rest time in msec on the BSS channel,only valid if at least +	 * one VDEV is active +	 */ +	/* +	 * the scanner will rest on the bss channel at least min_rest_time +	 * after min_rest_time the scanner will start checking for tx/rx +	 * activity on all VDEVs. if there is no activity the scanner will +	 * switch to off channel. if there is activity the scanner will let +	 * the radio on the bss channel until max_rest_time expires.at +	 * max_rest_time scanner will switch to off channel irrespective of +	 * activity. activity is determined by the idle_time parameter. +	 */ +	__le32 max_rest_time; + +	/* +	 * time before sending next set of probe requests. +	 * The scanner keeps repeating probe requests transmission with +	 * period specified by repeat_probe_time. +	 * The number of probe requests specified depends on the ssid_list +	 * and bssid_list +	 */ +	__le32 repeat_probe_time; + +	/* time in msec between 2 consequetive probe requests with in a set. */ +	__le32 probe_spacing_time; + +	/* +	 * data inactivity time in msec on bss channel that will be used by +	 * scanner for measuring the inactivity. +	 */ +	__le32 idle_time; + +	/* maximum time in msec allowed for scan  */ +	__le32 max_scan_time; + +	/* +	 * delay in msec before sending first probe request after switching +	 * to a channel +	 */ +	__le32 probe_delay; + +	/* Scan control flags */ +	__le32 scan_ctrl_flags; + +	/* +	 * TLV (tag length value )  paramerters follow the scan_cmd structure. +	 * TLV can contain channel list, bssid list, ssid list and +	 * ie. the TLV tags are defined above; +	 */ +} __packed; + +  struct wmi_ssid_arg {  	int len;  	const u8 *ssid; @@ -1268,7 +1939,7 @@ struct wmi_scan_event {   * good idea to pass all the fields in the RX status   * descriptor up to the host.   */ -struct wmi_mgmt_rx_hdr { +struct wmi_mgmt_rx_hdr_v1 {  	__le32 channel;  	__le32 snr;  	__le32 rate; @@ -1277,8 +1948,18 @@ struct wmi_mgmt_rx_hdr {  	__le32 status; /* %WMI_RX_STATUS_ */  } __packed; -struct wmi_mgmt_rx_event { -	struct wmi_mgmt_rx_hdr hdr; +struct wmi_mgmt_rx_hdr_v2 { +	struct wmi_mgmt_rx_hdr_v1 v1; +	__le32 rssi_ctl[4]; +} __packed; + +struct wmi_mgmt_rx_event_v1 { +	struct wmi_mgmt_rx_hdr_v1 hdr; +	u8 buf[0]; +} __packed; + +struct wmi_mgmt_rx_event_v2 { +	struct wmi_mgmt_rx_hdr_v2 hdr;  	u8 buf[0];  } __packed; @@ -1288,6 +1969,10 @@ struct wmi_mgmt_rx_event {  #define WMI_RX_STATUS_ERR_MIC			0x10  #define WMI_RX_STATUS_ERR_KEY_CACHE_MISS	0x20 +#define PHY_ERROR_SPECTRAL_SCAN		0x26 +#define PHY_ERROR_FALSE_RADAR_EXT		0x24 +#define PHY_ERROR_RADAR				0x05 +  struct wmi_single_phyerr_rx_hdr {  	/* TSF timestamp */  	__le32 tsf_timestamp; @@ -1379,6 +2064,87 @@ struct wmi_comb_phyerr_rx_event {  	u8 bufp[0];  } __packed; +#define PHYERR_TLV_SIG				0xBB +#define PHYERR_TLV_TAG_SEARCH_FFT_REPORT	0xFB +#define PHYERR_TLV_TAG_RADAR_PULSE_SUMMARY	0xF8 + +struct phyerr_radar_report { +	__le32 reg0; /* RADAR_REPORT_REG0_* */ +	__le32 reg1; /* REDAR_REPORT_REG1_* */ +} __packed; + +#define RADAR_REPORT_REG0_PULSE_IS_CHIRP_MASK		0x80000000 +#define RADAR_REPORT_REG0_PULSE_IS_CHIRP_LSB		31 + +#define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_MASK	0x40000000 +#define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_LSB	30 + +#define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_MASK		0x3FF00000 +#define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_LSB		20 + +#define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_MASK		0x000F0000 +#define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_LSB		16 + +#define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_MASK		0x0000FC00 +#define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_LSB		10 + +#define RADAR_REPORT_REG0_PULSE_SIDX_MASK		0x000003FF +#define RADAR_REPORT_REG0_PULSE_SIDX_LSB		0 + +#define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_MASK	0x80000000 +#define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_LSB	31 + +#define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_MASK	0x7F000000 +#define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_LSB		24 + +#define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_MASK	0x00FF0000 +#define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_LSB	16 + +#define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_MASK		0x0000FF00 +#define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_LSB		8 + +#define RADAR_REPORT_REG1_PULSE_DUR_MASK		0x000000FF +#define RADAR_REPORT_REG1_PULSE_DUR_LSB			0 + +struct phyerr_fft_report { +	__le32 reg0; /* SEARCH_FFT_REPORT_REG0_ * */ +	__le32 reg1; /* SEARCH_FFT_REPORT_REG1_ * */ +} __packed; + +#define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_MASK	0xFF800000 +#define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_LSB	23 + +#define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_MASK		0x007FC000 +#define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_LSB		14 + +#define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_MASK		0x00003000 +#define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_LSB		12 + +#define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_MASK		0x00000FFF +#define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_LSB		0 + +#define SEARCH_FFT_REPORT_REG1_RELPWR_DB_MASK		0xFC000000 +#define SEARCH_FFT_REPORT_REG1_RELPWR_DB_LSB		26 + +#define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_MASK		0x03FC0000 +#define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_LSB		18 + +#define SEARCH_FFT_REPORT_REG1_PEAK_MAG_MASK		0x0003FF00 +#define SEARCH_FFT_REPORT_REG1_PEAK_MAG_LSB		8 + +#define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_MASK	0x000000FF +#define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_LSB	0 + + +struct phyerr_tlv { +	__le16 len; +	u8 tag; +	u8 sig; +} __packed; + +#define DFS_RSSI_POSSIBLY_FALSE			50 +#define DFS_PEAK_MAG_THOLD_POSSIBLY_FALSE	40 +  struct wmi_mgmt_tx_hdr {  	__le32 vdev_id;  	struct wmi_mac_addr peer_macaddr; @@ -1409,6 +2175,31 @@ struct wmi_pdev_set_regdomain_cmd {  	__le32 conformance_test_limit_5G;  } __packed; +enum wmi_dfs_region { +	/* Uninitialized dfs domain */ +	WMI_UNINIT_DFS_DOMAIN = 0, + +	/* FCC3 dfs domain */ +	WMI_FCC_DFS_DOMAIN = 1, + +	/* ETSI dfs domain */ +	WMI_ETSI_DFS_DOMAIN = 2, + +	/*Japan dfs domain */ +	WMI_MKK4_DFS_DOMAIN = 3, +}; + +struct wmi_pdev_set_regdomain_cmd_10x { +	__le32 reg_domain; +	__le32 reg_domain_2G; +	__le32 reg_domain_5G; +	__le32 conformance_test_limit_2G; +	__le32 conformance_test_limit_5G; + +	/* dfs domain from wmi_dfs_region */ +	__le32 dfs_domain; +} __packed; +  /* Command to set/unset chip in quiet mode */  struct wmi_pdev_set_quiet_cmd {  	/* period in TUs */ @@ -1434,6 +2225,19 @@ enum ath10k_protmode {  	ATH10K_PROT_RTSCTS   = 2,    /* RTS-CTS */  }; +enum wmi_rtscts_profile { +	WMI_RTSCTS_FOR_NO_RATESERIES = 0, +	WMI_RTSCTS_FOR_SECOND_RATESERIES, +	WMI_RTSCTS_ACROSS_SW_RETRIES +}; + +#define WMI_RTSCTS_ENABLED		1 +#define WMI_RTSCTS_SET_MASK		0x0f +#define WMI_RTSCTS_SET_LSB		0 + +#define WMI_RTSCTS_PROFILE_MASK		0xf0 +#define WMI_RTSCTS_PROFILE_LSB		4 +  enum wmi_beacon_gen_mode {  	WMI_BEACON_STAGGERED_MODE = 0,  	WMI_BEACON_BURST_MODE = 1 @@ -1465,10 +2269,63 @@ struct wmi_csa_event {  #define VDEV_DEFAULT_STATS_UPDATE_PERIOD    500  #define PEER_DEFAULT_STATS_UPDATE_PERIOD    500 +struct wmi_pdev_param_map { +	u32 tx_chain_mask; +	u32 rx_chain_mask; +	u32 txpower_limit2g; +	u32 txpower_limit5g; +	u32 txpower_scale; +	u32 beacon_gen_mode; +	u32 beacon_tx_mode; +	u32 resmgr_offchan_mode; +	u32 protection_mode; +	u32 dynamic_bw; +	u32 non_agg_sw_retry_th; +	u32 agg_sw_retry_th; +	u32 sta_kickout_th; +	u32 ac_aggrsize_scaling; +	u32 ltr_enable; +	u32 ltr_ac_latency_be; +	u32 ltr_ac_latency_bk; +	u32 ltr_ac_latency_vi; +	u32 ltr_ac_latency_vo; +	u32 ltr_ac_latency_timeout; +	u32 ltr_sleep_override; +	u32 ltr_rx_override; +	u32 ltr_tx_activity_timeout; +	u32 l1ss_enable; +	u32 dsleep_enable; +	u32 pcielp_txbuf_flush; +	u32 pcielp_txbuf_watermark; +	u32 pcielp_txbuf_tmo_en; +	u32 pcielp_txbuf_tmo_value; +	u32 pdev_stats_update_period; +	u32 vdev_stats_update_period; +	u32 peer_stats_update_period; +	u32 bcnflt_stats_update_period; +	u32 pmf_qos; +	u32 arp_ac_override; +	u32 dcs; +	u32 ani_enable; +	u32 ani_poll_period; +	u32 ani_listen_period; +	u32 ani_ofdm_level; +	u32 ani_cck_level; +	u32 dyntxchain; +	u32 proxy_sta; +	u32 idle_ps_config; +	u32 power_gating_sleep; +	u32 fast_channel_reset; +	u32 burst_dur; +	u32 burst_enable; +}; + +#define WMI_PDEV_PARAM_UNSUPPORTED 0 +  enum wmi_pdev_param { -	/* TX chian mask */ +	/* TX chain mask */  	WMI_PDEV_PARAM_TX_CHAIN_MASK = 0x1, -	/* RX chian mask */ +	/* RX chain mask */  	WMI_PDEV_PARAM_RX_CHAIN_MASK,  	/* TX power limit for 2G Radio */  	WMI_PDEV_PARAM_TXPOWER_LIMIT2G, @@ -1490,7 +2347,12 @@ enum wmi_pdev_param {  	 * 0: no protection 1:use CTS-to-self 2: use RTS/CTS  	 */  	WMI_PDEV_PARAM_PROTECTION_MODE, -	/* Dynamic bandwidth 0: disable 1: enable */ +	/* +	 * Dynamic bandwidth - 0: disable, 1: enable +	 * +	 * When enabled HW rate control tries different bandwidths when +	 * retransmitting frames. +	 */  	WMI_PDEV_PARAM_DYNAMIC_BW,  	/* Non aggregrate/ 11g sw retry threshold.0-disable */  	WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH, @@ -1564,6 +2426,97 @@ enum wmi_pdev_param {  	WMI_PDEV_PARAM_POWER_GATING_SLEEP,  }; +enum wmi_10x_pdev_param { +	/* TX chian mask */ +	WMI_10X_PDEV_PARAM_TX_CHAIN_MASK = 0x1, +	/* RX chian mask */ +	WMI_10X_PDEV_PARAM_RX_CHAIN_MASK, +	/* TX power limit for 2G Radio */ +	WMI_10X_PDEV_PARAM_TXPOWER_LIMIT2G, +	/* TX power limit for 5G Radio */ +	WMI_10X_PDEV_PARAM_TXPOWER_LIMIT5G, +	/* TX power scale */ +	WMI_10X_PDEV_PARAM_TXPOWER_SCALE, +	/* Beacon generation mode . 0: host, 1: target   */ +	WMI_10X_PDEV_PARAM_BEACON_GEN_MODE, +	/* Beacon generation mode . 0: staggered 1: bursted   */ +	WMI_10X_PDEV_PARAM_BEACON_TX_MODE, +	/* +	 * Resource manager off chan mode . +	 * 0: turn off off chan mode. 1: turn on offchan mode +	 */ +	WMI_10X_PDEV_PARAM_RESMGR_OFFCHAN_MODE, +	/* +	 * Protection mode: +	 * 0: no protection 1:use CTS-to-self 2: use RTS/CTS +	 */ +	WMI_10X_PDEV_PARAM_PROTECTION_MODE, +	/* Dynamic bandwidth 0: disable 1: enable */ +	WMI_10X_PDEV_PARAM_DYNAMIC_BW, +	/* Non aggregrate/ 11g sw retry threshold.0-disable */ +	WMI_10X_PDEV_PARAM_NON_AGG_SW_RETRY_TH, +	/* aggregrate sw retry threshold. 0-disable*/ +	WMI_10X_PDEV_PARAM_AGG_SW_RETRY_TH, +	/* Station kickout threshold (non of consecutive failures).0-disable */ +	WMI_10X_PDEV_PARAM_STA_KICKOUT_TH, +	/* Aggerate size scaling configuration per AC */ +	WMI_10X_PDEV_PARAM_AC_AGGRSIZE_SCALING, +	/* LTR enable */ +	WMI_10X_PDEV_PARAM_LTR_ENABLE, +	/* LTR latency for BE, in us */ +	WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BE, +	/* LTR latency for BK, in us */ +	WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BK, +	/* LTR latency for VI, in us */ +	WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VI, +	/* LTR latency for VO, in us  */ +	WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VO, +	/* LTR AC latency timeout, in ms */ +	WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT, +	/* LTR platform latency override, in us */ +	WMI_10X_PDEV_PARAM_LTR_SLEEP_OVERRIDE, +	/* LTR-RX override, in us */ +	WMI_10X_PDEV_PARAM_LTR_RX_OVERRIDE, +	/* Tx activity timeout for LTR, in us */ +	WMI_10X_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT, +	/* L1SS state machine enable */ +	WMI_10X_PDEV_PARAM_L1SS_ENABLE, +	/* Deep sleep state machine enable */ +	WMI_10X_PDEV_PARAM_DSLEEP_ENABLE, +	/* pdev level stats update period in ms */ +	WMI_10X_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD, +	/* vdev level stats update period in ms */ +	WMI_10X_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD, +	/* peer level stats update period in ms */ +	WMI_10X_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD, +	/* beacon filter status update period */ +	WMI_10X_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD, +	/* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */ +	WMI_10X_PDEV_PARAM_PMF_QOS, +	/* Access category on which ARP and DHCP frames are sent */ +	WMI_10X_PDEV_PARAM_ARPDHCP_AC_OVERRIDE, +	/* DCS configuration */ +	WMI_10X_PDEV_PARAM_DCS, +	/* Enable/Disable ANI on target */ +	WMI_10X_PDEV_PARAM_ANI_ENABLE, +	/* configure the ANI polling period */ +	WMI_10X_PDEV_PARAM_ANI_POLL_PERIOD, +	/* configure the ANI listening period */ +	WMI_10X_PDEV_PARAM_ANI_LISTEN_PERIOD, +	/* configure OFDM immunity level */ +	WMI_10X_PDEV_PARAM_ANI_OFDM_LEVEL, +	/* configure CCK immunity level */ +	WMI_10X_PDEV_PARAM_ANI_CCK_LEVEL, +	/* Enable/Disable CDD for 1x1 STAs in rate control module */ +	WMI_10X_PDEV_PARAM_DYNTXCHAIN, +	/* Enable/Disable Fast channel reset*/ +	WMI_10X_PDEV_PARAM_FAST_CHANNEL_RESET, +	/* Set Bursting DUR */ +	WMI_10X_PDEV_PARAM_BURST_DUR, +	/* Set Bursting Enable*/ +	WMI_10X_PDEV_PARAM_BURST_ENABLE, +}; +  struct wmi_pdev_set_param_cmd {  	__le32 param_id;  	__le32 param_value; @@ -1757,6 +2710,9 @@ struct wal_dbg_tx_stats {  	/* wal pdev resets  */  	__le32 pdev_resets; +	/* frames dropped due to non-availability of stateless TIDs */ +	__le32 stateless_tid_alloc_failure; +  	__le32 phy_underrun;  	/* MPDU is more than txop limit */ @@ -1813,13 +2769,21 @@ enum wmi_stats_id {  	WMI_REQUEST_AP_STAT	= 0x02  }; +struct wlan_inst_rssi_args { +	__le16 cfg_retry_count; +	__le16 retry_count; +}; +  struct wmi_request_stats_cmd {  	__le32 stats_id; -	/* -	 * Space to add parameters like -	 * peer mac addr -	 */ +	__le32 vdev_id; + +	/* peer MAC address */ +	struct wmi_mac_addr peer_macaddr; + +	/* Instantaneous RSSI arguments */ +	struct wlan_inst_rssi_args inst_rssi_args;  } __packed;  /* Suspend option */ @@ -1870,7 +2834,7 @@ struct wmi_stats_event {   * PDEV statistics   * TODO: add all PDEV stats here   */ -struct wmi_pdev_stats { +struct wmi_pdev_stats_old {  	__le32 chan_nf;        /* Channel noise floor */  	__le32 tx_frame_count; /* TX frame count */  	__le32 rx_frame_count; /* RX frame count */ @@ -1881,6 +2845,23 @@ struct wmi_pdev_stats {  	struct wal_dbg_stats wal; /* WAL dbg stats */  } __packed; +struct wmi_pdev_stats_10x { +	__le32 chan_nf;        /* Channel noise floor */ +	__le32 tx_frame_count; /* TX frame count */ +	__le32 rx_frame_count; /* RX frame count */ +	__le32 rx_clear_count; /* rx clear count */ +	__le32 cycle_count;    /* cycle count */ +	__le32 phy_err_count;  /* Phy error count */ +	__le32 chan_tx_pwr;    /* channel tx power */ +	struct wal_dbg_stats wal; /* WAL dbg stats */ +	__le32 ack_rx_bad; +	__le32 rts_bad; +	__le32 rts_good; +	__le32 fcs_bad; +	__le32 no_beacons; +	__le32 mib_int_count; +} __packed; +  /*   * VDEV statistics   * TODO: add all VDEV stats here @@ -1893,10 +2874,17 @@ struct wmi_vdev_stats {   * peer statistics.   * TODO: add more stats   */ -struct wmi_peer_stats { +struct wmi_peer_stats_old { +	struct wmi_mac_addr peer_macaddr; +	__le32 peer_rssi; +	__le32 peer_tx_rate; +} __packed; + +struct wmi_peer_stats_10x {  	struct wmi_mac_addr peer_macaddr;  	__le32 peer_rssi;  	__le32 peer_tx_rate; +	__le32 peer_rx_rate;  } __packed;  struct wmi_vdev_create_cmd { @@ -2077,6 +3065,18 @@ struct wmi_vdev_install_key_arg {  	const void *key_data;  }; +/* + * vdev fixed rate format: + * - preamble - b7:b6 - see WMI_RATE_PREMABLE_ + * - nss      - b5:b4 - ss number (0 mean 1ss) + * - rate_mcs - b3:b0 - as below + *    CCK:  0 - 11Mbps, 1 - 5,5Mbps, 2 - 2Mbps, 3 - 1Mbps, + *          4 - 11Mbps (s), 5 - 5,5Mbps (s), 6 - 2Mbps (s) + *    OFDM: 0 - 48Mbps, 1 - 24Mbps, 2 - 12Mbps, 3 - 6Mbps, + *          4 - 54Mbps, 5 - 36Mbps, 6 - 18Mbps, 7 - 9Mbps + *    HT/VHT: MCS index + */ +  /* Preamble types to be used with VDEV fixed rate configuration */  enum wmi_rate_preamble {  	WMI_RATE_PREAMBLE_OFDM, @@ -2088,6 +3088,61 @@ enum wmi_rate_preamble {  /* Value to disable fixed rate setting */  #define WMI_FIXED_RATE_NONE    (0xff) +struct wmi_vdev_param_map { +	u32 rts_threshold; +	u32 fragmentation_threshold; +	u32 beacon_interval; +	u32 listen_interval; +	u32 multicast_rate; +	u32 mgmt_tx_rate; +	u32 slot_time; +	u32 preamble; +	u32 swba_time; +	u32 wmi_vdev_stats_update_period; +	u32 wmi_vdev_pwrsave_ageout_time; +	u32 wmi_vdev_host_swba_interval; +	u32 dtim_period; +	u32 wmi_vdev_oc_scheduler_air_time_limit; +	u32 wds; +	u32 atim_window; +	u32 bmiss_count_max; +	u32 bmiss_first_bcnt; +	u32 bmiss_final_bcnt; +	u32 feature_wmm; +	u32 chwidth; +	u32 chextoffset; +	u32 disable_htprotection; +	u32 sta_quickkickout; +	u32 mgmt_rate; +	u32 protection_mode; +	u32 fixed_rate; +	u32 sgi; +	u32 ldpc; +	u32 tx_stbc; +	u32 rx_stbc; +	u32 intra_bss_fwd; +	u32 def_keyid; +	u32 nss; +	u32 bcast_data_rate; +	u32 mcast_data_rate; +	u32 mcast_indicate; +	u32 dhcp_indicate; +	u32 unknown_dest_indicate; +	u32 ap_keepalive_min_idle_inactive_time_secs; +	u32 ap_keepalive_max_idle_inactive_time_secs; +	u32 ap_keepalive_max_unresponsive_time_secs; +	u32 ap_enable_nawds; +	u32 mcast2ucast_set; +	u32 enable_rtscts; +	u32 txbf; +	u32 packet_powersave; +	u32 drop_unencry; +	u32 tx_encap_type; +	u32 ap_detect_out_of_sync_sleeping_sta_time_secs; +}; + +#define WMI_VDEV_PARAM_UNSUPPORTED 0 +  /* the definition of different VDEV parameters */  enum wmi_vdev_param {  	/* RTS Threshold */ @@ -2219,6 +3274,121 @@ enum wmi_vdev_param {  	WMI_VDEV_PARAM_TX_ENCAP_TYPE,  }; +/* the definition of different VDEV parameters */ +enum wmi_10x_vdev_param { +	/* RTS Threshold */ +	WMI_10X_VDEV_PARAM_RTS_THRESHOLD = 0x1, +	/* Fragmentation threshold */ +	WMI_10X_VDEV_PARAM_FRAGMENTATION_THRESHOLD, +	/* beacon interval in TUs */ +	WMI_10X_VDEV_PARAM_BEACON_INTERVAL, +	/* Listen interval in TUs */ +	WMI_10X_VDEV_PARAM_LISTEN_INTERVAL, +	/* muticast rate in Mbps */ +	WMI_10X_VDEV_PARAM_MULTICAST_RATE, +	/* management frame rate in Mbps */ +	WMI_10X_VDEV_PARAM_MGMT_TX_RATE, +	/* slot time (long vs short) */ +	WMI_10X_VDEV_PARAM_SLOT_TIME, +	/* preamble (long vs short) */ +	WMI_10X_VDEV_PARAM_PREAMBLE, +	/* SWBA time (time before tbtt in msec) */ +	WMI_10X_VDEV_PARAM_SWBA_TIME, +	/* time period for updating VDEV stats */ +	WMI_10X_VDEV_STATS_UPDATE_PERIOD, +	/* age out time in msec for frames queued for station in power save */ +	WMI_10X_VDEV_PWRSAVE_AGEOUT_TIME, +	/* +	 * Host SWBA interval (time in msec before tbtt for SWBA event +	 * generation). +	 */ +	WMI_10X_VDEV_HOST_SWBA_INTERVAL, +	/* DTIM period (specified in units of num beacon intervals) */ +	WMI_10X_VDEV_PARAM_DTIM_PERIOD, +	/* +	 * scheduler air time limit for this VDEV. used by off chan +	 * scheduler. +	 */ +	WMI_10X_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT, +	/* enable/dsiable WDS for this VDEV  */ +	WMI_10X_VDEV_PARAM_WDS, +	/* ATIM Window */ +	WMI_10X_VDEV_PARAM_ATIM_WINDOW, +	/* BMISS max */ +	WMI_10X_VDEV_PARAM_BMISS_COUNT_MAX, +	/* WMM enables/disabled */ +	WMI_10X_VDEV_PARAM_FEATURE_WMM, +	/* Channel width */ +	WMI_10X_VDEV_PARAM_CHWIDTH, +	/* Channel Offset */ +	WMI_10X_VDEV_PARAM_CHEXTOFFSET, +	/* Disable HT Protection */ +	WMI_10X_VDEV_PARAM_DISABLE_HTPROTECTION, +	/* Quick STA Kickout */ +	WMI_10X_VDEV_PARAM_STA_QUICKKICKOUT, +	/* Rate to be used with Management frames */ +	WMI_10X_VDEV_PARAM_MGMT_RATE, +	/* Protection Mode */ +	WMI_10X_VDEV_PARAM_PROTECTION_MODE, +	/* Fixed rate setting */ +	WMI_10X_VDEV_PARAM_FIXED_RATE, +	/* Short GI Enable/Disable */ +	WMI_10X_VDEV_PARAM_SGI, +	/* Enable LDPC */ +	WMI_10X_VDEV_PARAM_LDPC, +	/* Enable Tx STBC */ +	WMI_10X_VDEV_PARAM_TX_STBC, +	/* Enable Rx STBC */ +	WMI_10X_VDEV_PARAM_RX_STBC, +	/* Intra BSS forwarding  */ +	WMI_10X_VDEV_PARAM_INTRA_BSS_FWD, +	/* Setting Default xmit key for Vdev */ +	WMI_10X_VDEV_PARAM_DEF_KEYID, +	/* NSS width */ +	WMI_10X_VDEV_PARAM_NSS, +	/* Set the custom rate for the broadcast data frames */ +	WMI_10X_VDEV_PARAM_BCAST_DATA_RATE, +	/* Set the custom rate (rate-code) for multicast data frames */ +	WMI_10X_VDEV_PARAM_MCAST_DATA_RATE, +	/* Tx multicast packet indicate Enable/Disable */ +	WMI_10X_VDEV_PARAM_MCAST_INDICATE, +	/* Tx DHCP packet indicate Enable/Disable */ +	WMI_10X_VDEV_PARAM_DHCP_INDICATE, +	/* Enable host inspection of Tx unicast packet to unknown destination */ +	WMI_10X_VDEV_PARAM_UNKNOWN_DEST_INDICATE, + +	/* The minimum amount of time AP begins to consider STA inactive */ +	WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS, + +	/* +	 * An associated STA is considered inactive when there is no recent +	 * TX/RX activity and no downlink frames are buffered for it. Once a +	 * STA exceeds the maximum idle inactive time, the AP will send an +	 * 802.11 data-null as a keep alive to verify the STA is still +	 * associated. If the STA does ACK the data-null, or if the data-null +	 * is buffered and the STA does not retrieve it, the STA will be +	 * considered unresponsive +	 * (see WMI_10X_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS). +	 */ +	WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS, + +	/* +	 * An associated STA is considered unresponsive if there is no recent +	 * TX/RX activity and downlink frames are buffered for it. Once a STA +	 * exceeds the maximum unresponsive time, the AP will send a +	 * WMI_10X_STA_KICKOUT event to the host so the STA can be deleted. */ +	WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS, + +	/* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */ +	WMI_10X_VDEV_PARAM_AP_ENABLE_NAWDS, + +	WMI_10X_VDEV_PARAM_MCAST2UCAST_SET, +	/* Enable/Disable RTS-CTS */ +	WMI_10X_VDEV_PARAM_ENABLE_RTSCTS, + +	WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS, +}; +  /* slot time long */  #define WMI_VDEV_SLOT_TIME_LONG		0x1  /* slot time short */ @@ -2295,6 +3465,24 @@ struct wmi_bcn_tx_arg {  	const void *bcn;  }; +enum wmi_bcn_tx_ref_flags { +	WMI_BCN_TX_REF_FLAG_DTIM_ZERO = 0x1, +	WMI_BCN_TX_REF_FLAG_DELIVER_CAB = 0x2, +}; + +struct wmi_bcn_tx_ref_cmd { +	__le32 vdev_id; +	__le32 data_len; +	/* physical address of the frame - dma pointer */ +	__le32 data_ptr; +	/* id for host to track */ +	__le32 msdu_id; +	/* frame ctrl to setup PPDU desc */ +	__le32 frame_control; +	/* to control CABQ traffic: WMI_BCN_TX_REF_FLAG_ */ +	__le32 flags; +} __packed; +  /* Beacon filter */  #define WMI_BCN_FILTER_ALL   0 /* Filter all beacons */  #define WMI_BCN_FILTER_NONE  1 /* Pass all beacons */ @@ -2751,6 +3939,12 @@ enum wmi_peer_smps_state {  	WMI_PEER_SMPS_DYNAMIC = 0x2  }; +enum wmi_peer_chwidth { +	WMI_PEER_CHWIDTH_20MHZ = 0, +	WMI_PEER_CHWIDTH_40MHZ = 1, +	WMI_PEER_CHWIDTH_80MHZ = 2, +}; +  enum wmi_peer_param {  	WMI_PEER_SMPS_STATE = 0x1, /* see %wmi_peer_smps_state */  	WMI_PEER_AMPDU      = 0x2, @@ -2931,6 +4125,10 @@ struct wmi_chan_info_event {  	__le32 cycle_count;  } __packed; +struct wmi_peer_sta_kickout_event { +	struct wmi_mac_addr peer_macaddr; +} __packed; +  #define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0)  /* FIXME: empirically extrapolated */ @@ -2994,13 +4192,60 @@ struct wmi_force_fw_hang_cmd {  	__le32 delay_ms;  } __packed; +enum ath10k_dbglog_level { +	ATH10K_DBGLOG_LEVEL_VERBOSE = 0, +	ATH10K_DBGLOG_LEVEL_INFO = 1, +	ATH10K_DBGLOG_LEVEL_WARN = 2, +	ATH10K_DBGLOG_LEVEL_ERR = 3, +}; + +/* VAP ids to enable dbglog */ +#define ATH10K_DBGLOG_CFG_VAP_LOG_LSB		0 +#define ATH10K_DBGLOG_CFG_VAP_LOG_MASK		0x0000ffff + +/* to enable dbglog in the firmware */ +#define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_LSB	16 +#define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_MASK	0x00010000 + +/* timestamp resolution */ +#define ATH10K_DBGLOG_CFG_RESOLUTION_LSB	17 +#define ATH10K_DBGLOG_CFG_RESOLUTION_MASK	0x000E0000 + +/* number of queued messages before sending them to the host */ +#define ATH10K_DBGLOG_CFG_REPORT_SIZE_LSB	20 +#define ATH10K_DBGLOG_CFG_REPORT_SIZE_MASK	0x0ff00000 + +/* + * Log levels to enable. This defines the minimum level to enable, this is + * not a bitmask. See enum ath10k_dbglog_level for the values. + */ +#define ATH10K_DBGLOG_CFG_LOG_LVL_LSB		28 +#define ATH10K_DBGLOG_CFG_LOG_LVL_MASK		0x70000000 + +/* + * Note: this is a cleaned up version of a struct firmware uses. For + * example, config_valid was hidden inside an array. + */ +struct wmi_dbglog_cfg_cmd { +	/* bitmask to hold mod id config*/ +	__le32 module_enable; + +	/* see ATH10K_DBGLOG_CFG_ */ +	__le32 config_enable; + +	/* mask of module id bits to be changed */ +	__le32 module_valid; + +	/* mask of config bits to be changed, see ATH10K_DBGLOG_CFG_ */ +	__le32 config_valid; +} __packed; +  #define ATH10K_RTS_MAX		2347  #define ATH10K_FRAGMT_THRESHOLD_MIN	540  #define ATH10K_FRAGMT_THRESHOLD_MAX	2346  #define WMI_MAX_EVENT 0x1000  /* Maximum number of pending TXed WMI packets */ -#define WMI_MAX_PENDING_TX_COUNT 128  #define WMI_SKB_HEADROOM sizeof(struct wmi_cmd_hdr)  /* By default disable power save for IBSS */ @@ -3013,17 +4258,16 @@ int ath10k_wmi_attach(struct ath10k *ar);  void ath10k_wmi_detach(struct ath10k *ar);  int ath10k_wmi_wait_for_service_ready(struct ath10k *ar);  int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar); -void ath10k_wmi_flush_tx(struct ath10k *ar); -int ath10k_wmi_connect_htc_service(struct ath10k *ar); +int ath10k_wmi_connect(struct ath10k *ar);  int ath10k_wmi_pdev_set_channel(struct ath10k *ar,  				const struct wmi_channel_arg *); -int ath10k_wmi_pdev_suspend_target(struct ath10k *ar); +int ath10k_wmi_pdev_suspend_target(struct ath10k *ar, u32 suspend_opt);  int ath10k_wmi_pdev_resume_target(struct ath10k *ar);  int ath10k_wmi_pdev_set_regdomain(struct ath10k *ar, u16 rd, u16 rd2g, -				  u16 rd5g, u16 ctl2g, u16 ctl5g); -int ath10k_wmi_pdev_set_param(struct ath10k *ar, enum wmi_pdev_param id, -			      u32 value); +				  u16 rd5g, u16 ctl2g, u16 ctl5g, +				  enum wmi_dfs_region dfs_reg); +int ath10k_wmi_pdev_set_param(struct ath10k *ar, u32 id, u32 value);  int ath10k_wmi_cmd_init(struct ath10k *ar);  int ath10k_wmi_start_scan(struct ath10k *ar, const struct wmi_start_scan_arg *);  void ath10k_wmi_start_scan_init(struct ath10k *ar, struct wmi_start_scan_arg *); @@ -3043,7 +4287,7 @@ int ath10k_wmi_vdev_up(struct ath10k *ar, u32 vdev_id, u32 aid,  		       const u8 *bssid);  int ath10k_wmi_vdev_down(struct ath10k *ar, u32 vdev_id);  int ath10k_wmi_vdev_set_param(struct ath10k *ar, u32 vdev_id, -			      enum wmi_vdev_param param_id, u32 param_value); +			      u32 param_id, u32 param_value);  int ath10k_wmi_vdev_install_key(struct ath10k *ar,  				const struct wmi_vdev_install_key_arg *arg);  int ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id, @@ -3066,11 +4310,13 @@ int ath10k_wmi_set_ap_ps_param(struct ath10k *ar, u32 vdev_id, const u8 *mac,  			       enum wmi_ap_ps_peer_param param_id, u32 value);  int ath10k_wmi_scan_chan_list(struct ath10k *ar,  			      const struct wmi_scan_chan_list_arg *arg); -int ath10k_wmi_beacon_send(struct ath10k *ar, const struct wmi_bcn_tx_arg *arg); +int ath10k_wmi_beacon_send_ref_nowait(struct ath10k_vif *arvif);  int ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar,  			const struct wmi_pdev_set_wmm_params_arg *arg);  int ath10k_wmi_request_stats(struct ath10k *ar, enum wmi_stats_id stats_id);  int ath10k_wmi_force_fw_hang(struct ath10k *ar,  			     enum wmi_force_fw_hang_type type, u32 delay_ms); +int ath10k_wmi_mgmt_tx(struct ath10k *ar, struct sk_buff *skb); +int ath10k_wmi_dbglog_cfg(struct ath10k *ar, u32 module_enable);  #endif /* _WMI_H_ */  | 
