mt76: mt7615: fix tx status rate index calculation
authorFelix Fietkau <nbd@nbd.name>
Wed, 22 Apr 2020 11:10:00 +0000 (13:10 +0200)
committerFelix Fietkau <nbd@nbd.name>
Tue, 12 May 2020 17:52:32 +0000 (19:52 +0200)
A switch from one rate index to the next only happens when tx count from
the current slot is greater than MT7615_RATE_RETRY, which is 1 has to be
subtracted from count, instead of added to it.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7615/mac.c

index 89aed6d..e7a7603 100644 (file)
@@ -1148,7 +1148,7 @@ static bool mt7615_fill_txs(struct mt7615_dev *dev, struct mt7615_sta *sta,
        if (ampdu || (info->flags & IEEE80211_TX_CTL_AMPDU))
                info->flags |= IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_CTL_AMPDU;
 
-       first_idx = max_t(int, 0, last_idx - (count + 1) / MT7615_RATE_RETRY);
+       first_idx = max_t(int, 0, last_idx - (count - 1) / MT7615_RATE_RETRY);
 
        if (fixed_rate && !probe) {
                info->status.rates[0].count = count;