Skip to contentSkip to conversation

mt76x2: fix mrr idx/count estimation in mt76x2_mac_fill_tx_status()

PATCH In review Lorenzo Bianconi 2 participants 2 messages Jun 4, 2018 – Jun 27, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

PATCH 1/1 mt76x2: fix mrr idx/count estimation in mt76x2_mac_fill_tx_status()

In reply to a message not in the archive

Fix mcs and attempt count estimation in mt76x2_mac_fill_tx_status routine if the number of tx retries reported by the hw is grater than IEEE80211_TX_MAX_RATES

Fixes 7bc04215a66b ("mt76: add driver code for MT76x2e")
---
 drivers/net/wireless/mediatek/mt76/mt76x2_mac.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/wireless/mediatek/mt76/mt76x2_mac.c +2 -4
index b49aea4da2d6..8985446570bd 100644
@@ -439,15 +439,13 @@ mt76x2_mac_fill_tx_status(struct mt76x2_dev *dev,
 	if (last_rate < IEEE80211_TX_MAX_RATES - 1)
 		rate[last_rate + 1].idx = -1;
 
-	cur_idx = rate[last_rate].idx + st->retry;
+	cur_idx = rate[last_rate].idx + last_rate;
 	for (i = 0; i <= last_rate; i++) {
 		rate[i].flags = rate[last_rate].flags;
 		rate[i].idx = max_t(int, 0, cur_idx - i);
 		rate[i].count = 1;
 	}
-
-	if (last_rate > 0)
-		rate[last_rate - 1].count = st->retry + 1 - last_rate;
+	rate[last_rate].count = st->retry + 1 - last_rate;
 
 	info->status.ampdu_len = n_frames;
 	info->status.ampdu_ack_len = st->success ? n_frames : 0;
Signature · 1 line
2.14.4
#2 lore raw
Quoted 6 lines · Lorenzo Bianconi

Fix mcs and attempt count estimation in mt76x2_mac_fill_tx_status routine if the number of tx retries reported by the hw is grater than IEEE80211_TX_MAX_RATES

Fixes 7bc04215a66b ("mt76: add driver code for MT76x2e")

Patch applied to wireless-drivers-next.git, thanks.

2d1e9be00162 mt76x2: fix mrr idx/count estimation in mt76x2_mac_fill_tx_status()

Signature · 3 lines
https://patchwork.kernel.org/patch/10446149/

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