wifi: mt76: fix reading current per-tid starting sequence number for aggregation
authorFelix Fietkau <nbd@nbd.name>
Fri, 26 Aug 2022 18:23:29 +0000 (20:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Sep 2022 09:11:43 +0000 (11:11 +0200)
commit c3a510e2b53785df31d882a773c4c0780b4c825f upstream.

The code was accidentally shifting register values down by tid % 32 instead of
(tid * field_size) % 32.

Cc: stable@vger.kernel.org
Fixes: a28bef561a5c ("mt76: mt7615: re-enable offloading of sequence number assignment")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220826182329.18155-1-nbd@nbd.name
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/mediatek/mt76/mt7615/mac.c

index 8f4a5d4929e09cadd683370340abd1f9dd7cfbb6..9ba7963a89f65b0be9a534269d72e4543b4f2b06 100644 (file)
@@ -1038,7 +1038,7 @@ u32 mt7615_mac_get_sta_tid_sn(struct mt7615_dev *dev, int wcid, u8 tid)
        offset %= 32;
 
        val = mt76_rr(dev, addr);
-       val >>= (tid % 32);
+       val >>= offset;
 
        if (offset > 20) {
                addr += 4;