| From 1de92bb3d5a816769f306322ae3c213adbacc6f1 Mon Sep 17 00:00:00 2001 |
| From: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| Date: Wed, 6 Mar 2024 11:30:34 +0800 |
| Subject: [PATCH 1049/1051] wifi: mt76: mt7915: add foolproof mechanism for |
| ZWDFS during radar detected & triggered |
| |
| Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| --- |
| mt7915/debugfs.c | 5 +++++ |
| mt7915/mcu.c | 3 +++ |
| 2 files changed, 8 insertions(+) |
| |
| diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c |
| index 03daf44..d8ca90a 100644 |
| --- a/mt7915/debugfs.c |
| +++ b/mt7915/debugfs.c |
| @@ -231,6 +231,11 @@ mt7915_radar_trigger(void *data, u64 val) |
| if (val > MT_RX_SEL2) |
| return -EINVAL; |
| |
| + if (val == MT_RX_SEL2 && !dev->rdd2_phy) { |
| + dev_err(dev->mt76.dev, "Background radar is not enabled\n"); |
| + return -EINVAL; |
| + } |
| + |
| return mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_RADAR_EMULATE, |
| val, 0, 0); |
| } |
| diff --git a/mt7915/mcu.c b/mt7915/mcu.c |
| index f890063..853a50e 100644 |
| --- a/mt7915/mcu.c |
| +++ b/mt7915/mcu.c |
| @@ -302,6 +302,9 @@ mt7915_mcu_rx_radar_detected(struct mt7915_dev *dev, struct sk_buff *skb) |
| if (r->band_idx > MT_RX_SEL2) |
| return; |
| |
| + if (r->band_idx == MT_RX_SEL2 && !dev->rdd2_phy) |
| + return; |
| + |
| if ((r->band_idx && !dev->phy.mt76->band_idx) && |
| dev->mt76.phys[MT_BAND1]) |
| mphy = dev->mt76.phys[MT_BAND1]; |
| -- |
| 2.18.0 |
| |