]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: mt76: mt7996: use correct phy for background radar event
authorStanleyYP Wang <StanleyYP.Wang@mediatek.com>
Mon, 5 Jun 2023 15:21:38 +0000 (23:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:48:01 +0000 (09:48 +0200)
[ Upstream commit 9ffe0d5690ed916e09baad2cc9ee7ec65b110038 ]

If driver directly uses the band_idx reported from the radar event to
access mt76_phy array, it will get the wrong phy for background radar.
Fix this by adjusting the statement.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Signed-off-by: Shayne Chen <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/mcu.c

index cd54e81d73044699d84affd09b04f7b2d3472e0d..62a02b03d83baa8b1af36b965304f8ffd52d6b3b 100644 (file)
@@ -339,7 +339,11 @@ mt7996_mcu_rx_radar_detected(struct mt7996_dev *dev, struct sk_buff *skb)
        if (r->band_idx >= ARRAY_SIZE(dev->mt76.phys))
                return;
 
-       mphy = dev->mt76.phys[r->band_idx];
+       if (dev->rdd2_phy && r->band_idx == MT_RX_SEL2)
+               mphy = dev->rdd2_phy->mt76;
+       else
+               mphy = dev->mt76.phys[r->band_idx];
+
        if (!mphy)
                return;