From: Shayne Chen <shayne.chen@mediatek.com>
To: Felix Fietkau <nbd@nbd.name>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
Lorenzo Bianconi <lorenzo@kernel.org>,
Ryder Lee <ryder.lee@mediatek.com>,
Evelyn Tsai <evelyn.tsai@mediatek.com>,
Money Wang <money.wang@mediatek.com>,
linux-mediatek <linux-mediatek@lists.infradead.org>,
StanleyYP Wang <StanleyYP.Wang@mediatek.com>,
Shayne Chen <shayne.chen@mediatek.com>
Subject: [PATCH mt76 6/6] wifi: mt76: mt7996: fix issues with manually triggered radar detection
Date: Thu, 12 Mar 2026 17:57:24 +0800 [thread overview]
Message-ID: <20260312095724.2117448-6-shayne.chen@mediatek.com> (raw)
In-Reply-To: <20260312095724.2117448-1-shayne.chen@mediatek.com>
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Disallow triggering radar detection on non-DFS channels to prevent paused
TX queues from failing to resume, as a channel switch is not performed in
this case.
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
---
.../wireless/mediatek/mt76/mt7996/debugfs.c | 22 +++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c
index 76d623b2cafb..e26bed6b97e7 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c
@@ -226,14 +226,23 @@ mt7996_radar_trigger(void *data, u64 val)
#define RADAR_BACKGROUND 2
struct mt7996_dev *dev = data;
struct mt7996_phy *phy = mt7996_band_phy(dev, NL80211_BAND_5GHZ);
- int rdd_idx;
+ struct cfg80211_chan_def *chandef;
+ int rdd_idx, ret;
if (!phy || !val || val > RADAR_BACKGROUND)
return -EINVAL;
- if (val == RADAR_BACKGROUND && !dev->rdd2_phy) {
- dev_err(dev->mt76.dev, "Background radar is not enabled\n");
- return -EINVAL;
+ if (test_bit(MT76_SCANNING, &phy->mt76->state))
+ return -EBUSY;
+
+ if (val == RADAR_BACKGROUND) {
+ if (!dev->rdd2_phy || !cfg80211_chandef_valid(&dev->rdd2_chandef)) {
+ dev_err(dev->mt76.dev, "Background radar is not enabled\n");
+ return -EINVAL;
+ }
+ chandef = &dev->rdd2_chandef;
+ } else {
+ chandef = &phy->mt76->chandef;
}
rdd_idx = mt7996_get_rdd_idx(phy, val == RADAR_BACKGROUND);
@@ -242,6 +251,11 @@ mt7996_radar_trigger(void *data, u64 val)
return -EINVAL;
}
+ ret = cfg80211_chandef_dfs_required(dev->mt76.hw->wiphy, chandef,
+ NL80211_IFTYPE_AP);
+ if (ret <= 0)
+ return ret;
+
return mt7996_mcu_rdd_cmd(dev, RDD_RADAR_EMULATE, rdd_idx, 0);
}
--
2.51.0
next prev parent reply other threads:[~2026-03-12 9:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 9:57 [PATCH mt76 1/6] wifi: mt76: mt7996: fix RRO EMU configuration Shayne Chen
2026-03-12 9:57 ` [PATCH mt76 2/6] wifi: mt76: mt7996: support critical packet mode for MT7990 chipsets Shayne Chen
2026-03-12 10:42 ` Lorenzo Bianconi
2026-03-12 9:57 ` [PATCH mt76 3/6] wifi: mt76: mt7996: update WFSYS reset flow " Shayne Chen
2026-03-12 10:42 ` Lorenzo Bianconi
2026-03-12 9:57 ` [PATCH mt76 4/6] wifi: mt76: mt7996: adjust timeout value for boot-up calibration commands Shayne Chen
2026-03-12 10:43 ` Lorenzo Bianconi
2026-03-12 9:57 ` [PATCH mt76 5/6] wifi: mt76: mt7996: fix the temporary buffer for calibration-free data Shayne Chen
2026-03-12 10:49 ` Lorenzo Bianconi
2026-03-13 5:55 ` Shayne Chen (陳軒丞)
2026-03-12 9:57 ` Shayne Chen [this message]
2026-03-12 10:56 ` [PATCH mt76 6/6] wifi: mt76: mt7996: fix issues with manually triggered radar detection Lorenzo Bianconi
2026-03-13 6:00 ` Shayne Chen
2026-03-12 10:39 ` [PATCH mt76 1/6] wifi: mt76: mt7996: fix RRO EMU configuration Lorenzo Bianconi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260312095724.2117448-6-shayne.chen@mediatek.com \
--to=shayne.chen@mediatek.com \
--cc=StanleyYP.Wang@mediatek.com \
--cc=evelyn.tsai@mediatek.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=money.wang@mediatek.com \
--cc=nbd@nbd.name \
--cc=ryder.lee@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox