]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: mt76: mt7996: fix max nss value when getting rx chainmask
authorStanleyYP Wang <StanleyYP.Wang@mediatek.com>
Thu, 6 Nov 2025 06:41:52 +0000 (14:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:03:13 +0000 (14:03 +0100)
[ Upstream commit 361b59b6be7c33c43b619d5cada394efc0f3b398 ]

Since wiphy->available_antennas_tx now accumulates the chainmask of all
the radios of a wiphy, use phy->orig_antenna_mask to get the original
max nss for comparison.

Fixes: 69d54ce7491d ("wifi: mt76: mt7996: switch to single multi-radio wiphy")
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Link: https://patch.msgid.link/20251106064203.1000505-1-shayne.chen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h

index 718e4d4ad85f2736b17804ad021a98c857c807ab..1727e73a99ce69e85a2daeff7311833cdc034c35 100644 (file)
@@ -786,7 +786,7 @@ void mt7996_memcpy_fromio(struct mt7996_dev *dev, void *buf, u32 offset,
 
 static inline u16 mt7996_rx_chainmask(struct mt7996_phy *phy)
 {
-       int max_nss = hweight8(phy->mt76->hw->wiphy->available_antennas_tx);
+       int max_nss = hweight16(phy->orig_antenna_mask);
        int cur_nss = hweight8(phy->mt76->antenna_mask);
        u16 tx_chainmask = phy->mt76->chainmask;