Skip to content

Commit 4913e67

Browse files
Wen GongKalle Valo
authored andcommitted
ath10k: enable rx duration report default for wmi tlv
When run command "iw dev wlan0 station dump", the rx duration is 0. When firmware indicate WMI_UPDATE_STATS_EVENTID, extended flag of statsis not set by default, so firmware do not report rx duration. one sample: localhost # iw wlan0 station dump Station c4:04:15:5d:97:22 (on wlan0) inactive time: 48 ms rx bytes: 21670 rx packets: 147 tx bytes: 11529 tx packets: 100 tx retries: 88 tx failed: 36 beacon loss: 1 beacon rx: 31 rx drop misc: 47 signal: -72 [-74, -75] dBm signal avg: -71 [-74, -75] dBm beacon signal avg: -71 dBm tx bitrate: 54.0 MBit/s MCS 3 40MHz rx bitrate: 1.0 MBit/s rx duration: 0 us This patch enable firmware's extened flag of stats by setting flag WMI_TLV_STAT_PEER_EXTD of ar->fw_stats_req_mask which is set in ath10k_core_init_firmware_features via WMI_REQUEST_STATS_CMDID. After apply this patch, rx duration show value with the command: Station c4:04:15:5d:97:22 (on wlan0) inactive time: 883 ms rx bytes: 44289 rx packets: 265 tx bytes: 10838 tx packets: 93 tx retries: 899 tx failed: 103 beacon loss: 0 beacon rx: 78 rx drop misc: 46 signal: -71 [-74, -76] dBm signal avg: -70 [-74, -76] dBm beacon signal avg: -70 dBm tx bitrate: 54.0 MBit/s MCS 3 40MHz rx bitrate: 1.0 MBit/s rx duration: 358004 us This patch do not have side effect for all chips, because function ath10k_debug_fw_stats_request is already exported to debugfs "fw_stats" and WMI_REQUEST_STATS_CMDID is safely sent after condition checked by ath10k_peer_stats_enabled in ath10k_sta_statistics. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00042. Signed-off-by: Wen Gong <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5cb899d commit 4913e67

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

drivers/net/wireless/ath/ath10k/debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ void ath10k_debug_fw_stats_process(struct ath10k *ar, struct sk_buff *skb)
349349
spin_unlock_bh(&ar->data_lock);
350350
}
351351

352-
static int ath10k_debug_fw_stats_request(struct ath10k *ar)
352+
int ath10k_debug_fw_stats_request(struct ath10k *ar)
353353
{
354354
unsigned long timeout, time_left;
355355
int ret;

drivers/net/wireless/ath/ath10k/debug.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ static inline int ath10k_debug_is_extd_tx_stats_enabled(struct ath10k *ar)
125125
{
126126
return ar->debug.enable_extd_tx_stats;
127127
}
128+
129+
int ath10k_debug_fw_stats_request(struct ath10k *ar);
130+
128131
#else
129132

130133
static inline int ath10k_debug_start(struct ath10k *ar)
@@ -192,6 +195,11 @@ static inline int ath10k_debug_is_extd_tx_stats_enabled(struct ath10k *ar)
192195
return 0;
193196
}
194197

198+
static inline int ath10k_debug_fw_stats_request(struct ath10k *ar)
199+
{
200+
return 0;
201+
}
202+
195203
#define ATH10K_DFS_STAT_INC(ar, c) do { } while (0)
196204

197205
#define ath10k_debug_get_et_strings NULL

drivers/net/wireless/ath/ath10k/mac.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8311,6 +8311,8 @@ static void ath10k_sta_statistics(struct ieee80211_hw *hw,
83118311
if (!ath10k_peer_stats_enabled(ar))
83128312
return;
83138313

8314+
ath10k_debug_fw_stats_request(ar);
8315+
83148316
sinfo->rx_duration = arsta->rx_duration;
83158317
sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_DURATION);
83168318

0 commit comments

Comments
 (0)