mt76: mt7615: fix fixed-rate tx status reporting
authorFelix Fietkau <nbd@nbd.name>
Fri, 7 May 2021 12:07:53 +0000 (14:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jul 2021 07:44:50 +0000 (09:44 +0200)
[ Upstream commit ec8f1a90d006f7cedcf86ef19fd034a406a213d6 ]

Rely on the txs fixed-rate bit instead of info->control.rates

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

index 5795e44..f44f478 100644 (file)
@@ -1177,22 +1177,20 @@ static bool mt7615_fill_txs(struct mt7615_dev *dev, struct mt7615_sta *sta,
        int first_idx = 0, last_idx;
        int i, idx, count;
        bool fixed_rate, ack_timeout;
-       bool probe, ampdu, cck = false;
+       bool ampdu, cck = false;
        bool rs_idx;
        u32 rate_set_tsf;
        u32 final_rate, final_rate_flags, final_nss, txs;
 
-       fixed_rate = info->status.rates[0].count;
-       probe = !!(info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE);
-
        txs = le32_to_cpu(txs_data[1]);
-       ampdu = !fixed_rate && (txs & MT_TXS1_AMPDU);
+       ampdu = txs & MT_TXS1_AMPDU;
 
        txs = le32_to_cpu(txs_data[3]);
        count = FIELD_GET(MT_TXS3_TX_COUNT, txs);
        last_idx = FIELD_GET(MT_TXS3_LAST_TX_RATE, txs);
 
        txs = le32_to_cpu(txs_data[0]);
+       fixed_rate = txs & MT_TXS0_FIXED_RATE;
        final_rate = FIELD_GET(MT_TXS0_TX_RATE, txs);
        ack_timeout = txs & MT_TXS0_ACK_TIMEOUT;
 
@@ -1214,7 +1212,7 @@ static bool mt7615_fill_txs(struct mt7615_dev *dev, struct mt7615_sta *sta,
 
        first_idx = max_t(int, 0, last_idx - (count - 1) / MT7615_RATE_RETRY);
 
-       if (fixed_rate && !probe) {
+       if (fixed_rate) {
                info->status.rates[0].count = count;
                i = 0;
                goto out;