developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 1 | From 7f45a6881d88e92180fe2b162800b8334d005a5f Mon Sep 17 00:00:00 2001 |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 2 | From: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 3 | Date: Wed, 6 Mar 2024 11:30:34 +0800 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 1049/1052] wifi: mt76: mt7915: add foolproof mechanism for |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 5 | ZWDFS during radar detected & triggered |
| 6 | |
| 7 | Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 8 | --- |
| 9 | mt7915/debugfs.c | 5 +++++ |
| 10 | mt7915/mcu.c | 3 +++ |
| 11 | 2 files changed, 8 insertions(+) |
| 12 | |
| 13 | diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 14 | index 3fd1654c..522e2999 100644 |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 15 | --- a/mt7915/debugfs.c |
| 16 | +++ b/mt7915/debugfs.c |
| 17 | @@ -231,6 +231,11 @@ mt7915_radar_trigger(void *data, u64 val) |
| 18 | if (val > MT_RX_SEL2) |
| 19 | return -EINVAL; |
| 20 | |
| 21 | + if (val == MT_RX_SEL2 && !dev->rdd2_phy) { |
| 22 | + dev_err(dev->mt76.dev, "Background radar is not enabled\n"); |
| 23 | + return -EINVAL; |
| 24 | + } |
| 25 | + |
| 26 | return mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_RADAR_EMULATE, |
| 27 | val, 0, 0); |
| 28 | } |
| 29 | diff --git a/mt7915/mcu.c b/mt7915/mcu.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 30 | index 272db06a..250b05ec 100644 |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 31 | --- a/mt7915/mcu.c |
| 32 | +++ b/mt7915/mcu.c |
| 33 | @@ -302,6 +302,9 @@ mt7915_mcu_rx_radar_detected(struct mt7915_dev *dev, struct sk_buff *skb) |
| 34 | if (r->band_idx > MT_RX_SEL2) |
| 35 | return; |
| 36 | |
| 37 | + if (r->band_idx == MT_RX_SEL2 && !dev->rdd2_phy) |
| 38 | + return; |
| 39 | + |
| 40 | if ((r->band_idx && !dev->phy.mt76->band_idx) && |
| 41 | dev->mt76.phys[MT_BAND1]) |
| 42 | mphy = dev->mt76.phys[MT_BAND1]; |
| 43 | -- |
| 44 | 2.18.0 |
| 45 | |