Skip to content

Commit

Permalink
mt76: stop the radar detector after leaving dfs channel
Browse files Browse the repository at this point in the history
[ Upstream commit 4e58ef4 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Xing Song authored and gregkh committed Dec 31, 2022
1 parent ae19622 commit c865901
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drivers/net/wireless/mediatek/mt76/mt7615/main.c
Expand Up @@ -290,7 +290,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 &&
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/mediatek/mt76/mt7915/main.c
Expand Up @@ -302,7 +302,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 &&
Expand Down

0 comments on commit c865901

Please sign in to comment.