ath10k: fix vdev stats for 10.4 firmware
PATCH 1/1 ath10k: fix vdev stats for 10.4 firmware
Currently vdev stats displayed in fw_stats are applicable only for TLV based firmware and fix it for 10.4 firmware as of now. The vdev stats in 10.4 firmware is split into two parts (vdev_stats, vdev_stats_extended). The actual stats are captured only in extended vdev stats. In order to enable vdev stats, appropriate feature bit will be set on extended resource config. As FTM related counters are available only on newer 10.4 based firmware, these counters will be displayed only on valid data.
--- drivers/net/wireless/ath/ath10k/core.c | 6 +- drivers/net/wireless/ath/ath10k/core.h | 22 +++++ drivers/net/wireless/ath/ath10k/wmi.c | 152 ++++++++++++++++++++++++++++----- drivers/net/wireless/ath/ath10k/wmi.h | 28 +++++- 4 files changed, 187 insertions(+), 21 deletions(-)
drivers/net/wireless/ath/ath10k/core.c +5 -1
@@ -2041,7 +2041,8 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar) ar->max_num_vdevs =TARGET_10_4_NUM_VDEVS ; ar->num_tids =TARGET_10_4_TGT_NUM_TIDS ; ar->fw_stats_req_mask =WMI_10_4_STAT_PEER | -WMI_10_4_STAT_PEER_EXTD ; +WMI_10_4_STAT_PEER_EXTD | +WMI_10_4_STAT_VDEV_EXTD ; ar->max_spatial_stream = ar->hw_params.max_spatial_stream; ar->max_num_tdls_vdevs =TARGET_10_4_NUM_TDLS_VDEVS ;
@@ -2282,6 +2283,9 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,if (ath10k_peer_stats_enabled (ar)) val =WMI_10_4_PEER_STATS ; +/* Enable vdev stats by default */ + val |=WMI_10_4_VDEV_STATS ; +if (test_bit (WMI_SERVICE_BSS_CHANNEL_INFO_64 , ar->wmi.svc_map)) val |=WMI_10_4_BSS_CHANNEL_INFO_64 ;
drivers/net/wireless/ath/ath10k/core.h +22 -0
@@ -1,6 +1,7 @@/* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. +* Copyright (c) 2018, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above
@@ -221,6 +222,27 @@ struct ath10k_fw_stats_vdev {u32 beacon_rssi_history[10 ]; }; +struct ath10k_fw_stats_vdev_extd { +struct list_head list; + +u32 vdev_id; +u32 ppdu_aggr_cnt; +u32 ppdu_noack; +u32 mpdu_queued; +u32 ppdu_nonaggr_cnt; +u32 mpdu_sw_requeued; +u32 mpdu_suc_retry; +u32 mpdu_suc_multitry; +u32 mpdu_fail_retry; +u32 tx_ftm_suc; +u32 tx_ftm_suc_retry; +u32 tx_ftm_fail; +u32 rx_ftmr_cnt; +u32 rx_ftmr_dup_cnt; +u32 rx_iftmr_cnt; +u32 rx_iftmr_dup_cnt; +}; +struct ath10k_fw_stats_pdev {struct list_head list;
drivers/net/wireless/ath/ath10k/wmi.c +133 -19
200 lines not on this page · raw message
drivers/net/wireless/ath/ath10k/wmi.h +27 -1
@@ -1,6 +1,7 @@/* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. +* Copyright (c) 2018, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above
@@ -4350,6 +4351,7 @@ enum wmi_10_4_stats_id {WMI_10_4_STAT_AP =BIT (1 ),WMI_10_4_STAT_INST =BIT (2 ),WMI_10_4_STAT_PEER_EXTD =BIT (3 ), + WMI_10_4_STAT_VDEV_EXTD = BIT(4), }; struct wlan_inst_rssi_args {
@@ -4489,12 +4491,36 @@ struct wmi_10_4_pdev_stats {/* * VDEV statistics -* TODO: add all VDEV stats here */ + +#define WMI_VDEV_STATS_FTM_COUNT_VALID BIT(31) +#define WMI_VDEV_STATS_FTM_COUNT_LSB 0 +#define WMI_VDEV_STATS_FTM_COUNT_MASK 0x7fffffff +struct wmi_vdev_stats {__le32 vdev_id; } __packed; +struct wmi_vdev_stats_extd { +__le32 vdev_id; +__le32 ppdu_aggr_cnt; +__le32 ppdu_noack; +__le32 mpdu_queued; +__le32 ppdu_nonaggr_cnt; +__le32 mpdu_sw_requeued; +__le32 mpdu_suc_retry; +__le32 mpdu_suc_multitry; +__le32 mpdu_fail_retry; +__le32 tx_ftm_suc; +__le32 tx_ftm_suc_retry; +__le32 tx_ftm_fail; +__le32 rx_ftmr_cnt; +__le32 rx_ftmr_dup_cnt; +__le32 rx_iftmr_cnt; +__le32 rx_iftmr_dup_cnt; +__le32 reserved[6 ]; +} __packed; +/* * peer statistics. * TODO: add more stats
Signature · 1 line
1.9.1
Quoted 10 lines · Rajkumar Manoharan
Currently vdev stats displayed in
fw_statsare applicable only for TLV based firmware and fix it for 10.4 firmware as of now. The vdev stats in 10.4 firmware is split into two parts (vdev_stats,vdev_stats_extended). The actual stats are captured only in extended vdev stats. In order to enable vdev stats, appropriate feature bit will be set on extended resource config. As FTM related counters are available only on newer 10.4 based firmware, these counters will be displayed only on valid data.
Quoted 2 lines
Signed-off-by Rajkumar Manoharan <[email protected]>Signed-off-by Kalle Valo <[email protected]>
Patch applied to ath-next branch of ath.git, thanks.
1b3fdb50f881 ath10k: fix vdev stats for 10.4 firmware
Signature · 3 lines
https://patchwork.kernel.org/patch/10289879/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 10 lines · Rajkumar Manoharan
Currently vdev stats displayed in
fw_statsare applicable only for TLV based firmware and fix it for 10.4 firmware as of now. The vdev stats in 10.4 firmware is split into two parts (vdev_stats,vdev_stats_extended). The actual stats are captured only in extended vdev stats. In order to enable vdev stats, appropriate feature bit will be set on extended resource config. As FTM related counters are available only on newer 10.4 based firmware, these counters will be displayed only on valid data.
Quoted 2 lines
Signed-off-by Rajkumar Manoharan <[email protected]>Signed-off-by Kalle Valo <[email protected]>
Patch applied to ath-next branch of ath.git, thanks.
1b3fdb50f881 ath10k: fix vdev stats for 10.4 firmware
Signature · 9 lines
https://patchwork.kernel.org/patch/10289879/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k