mt76: stop the radar detector after leaving dfs channel
authorXing Song <xing.song@mediatek.com>
Mon, 24 Jan 2022 03:28:11 +0000 (11:28 +0800)
committerFelix Fietkau <nbd@nbd.name>
Thu, 3 Feb 2022 12:57:59 +0000 (13:57 +0100)
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 <xing.song@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7615/main.c
drivers/net/wireless/mediatek/mt76/mt7915/main.c

index fca38f0e1a276397ba60646cc60f17f88d52768d..7dcf1fb97eca5670c389d17ff91bd8d02b5ec164 100644 (file)
@@ -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 &&
index 1149aae7eff40e548ef5529930ec8fe2ca00c1b1..989298ffffbcb3cc998621f91c4a5df60853badd 100644 (file)
@@ -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 &&