developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 1 | From 9cf96fa56a20d30f7e46e96d9c48c3568fbf11af Mon Sep 17 00:00:00 2001 |
| 2 | From: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 3 | Date: Tue, 7 Mar 2023 17:05:01 +0800 |
| 4 | Subject: [PATCH 08/11] wifi: mt76: mt7996: use correct phy for background |
| 5 | radar event |
| 6 | |
| 7 | If driver directly uses the band_idx reported from the radar event to |
| 8 | access mt76_phy array, it will get the wrong phy for background radar. |
| 9 | Fix this by adjusting the statement. |
| 10 | |
| 11 | Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") |
| 12 | Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 13 | Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> |
| 14 | --- |
| 15 | mt7996/mcu.c | 6 +++++- |
| 16 | 1 file changed, 5 insertions(+), 1 deletion(-) |
| 17 | |
| 18 | diff --git a/mt7996/mcu.c b/mt7996/mcu.c |
| 19 | index 0ede9769..20519bff 100644 |
| 20 | --- a/mt7996/mcu.c |
| 21 | +++ b/mt7996/mcu.c |
| 22 | @@ -339,7 +339,11 @@ mt7996_mcu_rx_radar_detected(struct mt7996_dev *dev, struct sk_buff *skb) |
| 23 | if (r->band_idx >= ARRAY_SIZE(dev->mt76.phys)) |
| 24 | return; |
| 25 | |
| 26 | - mphy = dev->mt76.phys[r->band_idx]; |
| 27 | + if (dev->rdd2_phy && r->band_idx == MT_RX_SEL2) |
| 28 | + mphy = dev->rdd2_phy->mt76; |
| 29 | + else |
| 30 | + mphy = dev->mt76.phys[r->band_idx]; |
| 31 | + |
| 32 | if (!mphy) |
| 33 | return; |
| 34 | |
| 35 | -- |
| 36 | 2.39.2 |
| 37 | |