From 4e42e55ce636a4b9dd471fc9ccdfe97dec04fa7d Mon Sep 17 00:00:00 2001 From: Xing Song Date: Mon, 24 Jan 2022 11:28:11 +0800 Subject: [PATCH] mt76: stop the radar detector after leaving dfs channel The radar detctor is used for dfs channel. So it will start after switching to dfs channel and will stop after leaving. The TX will be blocked if radar detctor isn't stopped in non-dfs channel. This patch resets the dfs state to indicate the radar detector needs to be stopped. Signed-off-by: Xing Song Signed-off-by: Felix Fietkau --- mt7615/main.c | 3 ++- mt7915/main.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mt7615/main.c b/mt7615/main.c index fca38f0e..7dcf1fb9 100644 --- a/mt7615/main.c +++ b/mt7615/main.c @@ -291,7 +291,8 @@ static void mt7615_init_dfs_state(struct mt7615_phy *phy) if (hw->conf.flags & IEEE80211_CONF_OFFCHANNEL) return; - if (!(chandef->chan->flags & IEEE80211_CHAN_RADAR)) + if (!(chandef->chan->flags & IEEE80211_CHAN_RADAR) && + !(mphy->chandef.chan->flags & IEEE80211_CHAN_RADAR)) return; if (mphy->chandef.chan->center_freq == chandef->chan->center_freq && diff --git a/mt7915/main.c b/mt7915/main.c index 1149aae7..989298ff 100644 --- a/mt7915/main.c +++ b/mt7915/main.c @@ -311,7 +311,8 @@ static void mt7915_init_dfs_state(struct mt7915_phy *phy) if (hw->conf.flags & IEEE80211_CONF_OFFCHANNEL) return; - if (!(chandef->chan->flags & IEEE80211_CHAN_RADAR)) + if (!(chandef->chan->flags & IEEE80211_CHAN_RADAR) && + !(mphy->chandef.chan->flags & IEEE80211_CHAN_RADAR)) return; if (mphy->chandef.chan->center_freq == chandef->chan->center_freq &&