Skip to content

Commit

Permalink
wifi: mt76: mt7996: use correct phy for background radar event
Browse files Browse the repository at this point in the history
[ Upstream commit 9ffe0d5 ]

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: 98686cd ("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>
  • Loading branch information
StanleyYP Wang authored and gregkh committed Sep 13, 2023
1 parent 7b15d7c commit 08fd174
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
Expand Up @@ -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;

Expand Down

0 comments on commit 08fd174

Please sign in to comment.