]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: ath12k: remove return for empty tx bitrate in mac_op_sta_statistics
authorRemi Pommarel <repk@triplefau.lt>
Wed, 29 Jan 2025 16:55:17 +0000 (17:55 +0100)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Fri, 31 Jan 2025 19:32:31 +0000 (11:32 -0800)
Currently in ath12k_mac_op_sta_statistics() there is the following
logic:

    if (!arsta->txrate.legacy && !arsta->txrate.nss)
        return;

Because ath12k_sta_statistics is used to report many info to iw wlan0 link,
if it return for empty legacy and nss of arsta->txrate, then the other
stats after it will not be set.

To address this issue remove the return and instead invert the logic to set
the txrate logic if (arsta->txrate.legacy || arsta->txrate.nss).

The same was done also in both ath10k with commit 1cd6ba8ae33e ("ath10k:
remove return for NL80211_STA_INFO_TX_BITRATE") and ath11k as well with
commit 1d795645e1ee ("ath11k: remove return for empty tx bitrate in
mac_op_sta_statistics").

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1

Signed-off-by: Remi Pommarel <repk@triplefau.lt>
Reviewed-by: Aditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com>
Link: https://patch.msgid.link/38c2a7c4f7eaf57b9306bb95a9e6c42b7d987e05.1738169458.git.repk@triplefau.lt
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/mac.c

index 4fb7e235be66706931ec2ec2e1136b0f33f2fa3f..e9663c6ac72cd88f4510c7f509358b6477130dfb 100644 (file)
@@ -10170,23 +10170,22 @@ static void ath12k_mac_op_sta_statistics(struct ieee80211_hw *hw,
        sinfo->tx_duration = arsta->tx_duration;
        sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_DURATION);
 
-       if (!arsta->txrate.legacy && !arsta->txrate.nss)
-               return;
-
-       if (arsta->txrate.legacy) {
-               sinfo->txrate.legacy = arsta->txrate.legacy;
-       } else {
-               sinfo->txrate.mcs = arsta->txrate.mcs;
-               sinfo->txrate.nss = arsta->txrate.nss;
-               sinfo->txrate.bw = arsta->txrate.bw;
-               sinfo->txrate.he_gi = arsta->txrate.he_gi;
-               sinfo->txrate.he_dcm = arsta->txrate.he_dcm;
-               sinfo->txrate.he_ru_alloc = arsta->txrate.he_ru_alloc;
-               sinfo->txrate.eht_gi = arsta->txrate.eht_gi;
-               sinfo->txrate.eht_ru_alloc = arsta->txrate.eht_ru_alloc;
-       }
-       sinfo->txrate.flags = arsta->txrate.flags;
-       sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE);
+       if (arsta->txrate.legacy || arsta->txrate.nss) {
+               if (arsta->txrate.legacy) {
+                       sinfo->txrate.legacy = arsta->txrate.legacy;
+               } else {
+                       sinfo->txrate.mcs = arsta->txrate.mcs;
+                       sinfo->txrate.nss = arsta->txrate.nss;
+                       sinfo->txrate.bw = arsta->txrate.bw;
+                       sinfo->txrate.he_gi = arsta->txrate.he_gi;
+                       sinfo->txrate.he_dcm = arsta->txrate.he_dcm;
+                       sinfo->txrate.he_ru_alloc = arsta->txrate.he_ru_alloc;
+                       sinfo->txrate.eht_gi = arsta->txrate.eht_gi;
+                       sinfo->txrate.eht_ru_alloc = arsta->txrate.eht_ru_alloc;
+               }
+               sinfo->txrate.flags = arsta->txrate.flags;
+               sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE);
+       }
 
        /* TODO: Use real NF instead of default one. */
        signal = arsta->rssi_comb;