linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath11k: remove return for empty tx bitrate in mac_op_sta_statistics
@ 2021-10-11  8:49 Wen Gong
  2021-11-15  9:23 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Wen Gong @ 2021-10-11  8:49 UTC (permalink / raw)
  To: ath11k; +Cc: linux-wireless, wgong

Currently in ath11k_mac_op_sta_statistics() there is the following
logic:
    if (!arsta->txrate.legacy && !arsta->txrate.nss)
        return;

Unfortunately if this condition is true then the function returns
without setting parameters that follow the txrate.

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

Same change which is upstream also exists in ath10k:
1cd6ba8ae33e ("ath10k: remove return for NL80211_STA_INFO_TX_BITRATE")

Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1

Signed-off-by: Wen Gong <wgong@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/mac.c | 29 +++++++++++++--------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 0f54332bc24c..8714f971ad67 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -6965,21 +6965,20 @@ static void ath11k_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.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.flags = arsta->txrate.flags;
+		sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE);
+	}
 
 	/* TODO: Use real NF instead of default one. */
 	sinfo->signal = arsta->rssi_comb + ATH11K_DEFAULT_NOISE_FLOOR;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ath11k: remove return for empty tx bitrate in mac_op_sta_statistics
  2021-10-11  8:49 [PATCH] ath11k: remove return for empty tx bitrate in mac_op_sta_statistics Wen Gong
@ 2021-11-15  9:23 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2021-11-15  9:23 UTC (permalink / raw)
  To: Wen Gong; +Cc: ath11k, linux-wireless, wgong

Wen Gong <wgong@codeaurora.org> wrote:

> Currently in ath11k_mac_op_sta_statistics() there is the following
> logic:
> 
>     if (!arsta->txrate.legacy && !arsta->txrate.nss)
>         return;
> 
> Unfortunately if this condition is true then the function returns without
> setting parameters that follow the txrate. 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 ath10k in commit 1cd6ba8ae33e ("ath10k: remove return
> for NL80211_STA_INFO_TX_BITRATE").
> 
> Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
> 
> Signed-off-by: Wen Gong <wgong@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

1d795645e1ee ath11k: remove return for empty tx bitrate in mac_op_sta_statistics

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20211011084957.31024-1-wgong@codeaurora.org/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-15  9:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11  8:49 [PATCH] ath11k: remove return for empty tx bitrate in mac_op_sta_statistics Wen Gong
2021-11-15  9:23 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).