diff options
author | Lorenzo Bianconi <lorenzo.bianconi@redhat.com> | 2018-06-04 11:19:41 +0200 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2018-06-27 18:05:15 +0200 |
commit | 2d1e9be0016230f3707812243561fbd16f1aea4b (patch) | |
tree | 7f2f7b0fef5b9275689934f3fb7f042274ce3d3e /drivers/net/wireless | |
parent | net: ipw2x00: Replace NULL comparison with !priv (diff) | |
download | linux-2d1e9be0016230f3707812243561fbd16f1aea4b.tar.xz linux-2d1e9be0016230f3707812243561fbd16f1aea4b.zip |
mt76x2: fix mrr idx/count estimation in mt76x2_mac_fill_tx_status()
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")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76x2_mac.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x2_mac.c index b49aea4da2d6..8985446570bd 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2_mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2_mac.c @@ -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; |