Skip to content

Commit

Permalink
mt76: mt76x02: use mt76_phy_dfs_state to determine radar detector state
Browse files Browse the repository at this point in the history
Fixes corner cases in enabling/disabling detector

Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
Felix Fietkau committed Feb 3, 2022
1 parent 2c86f67 commit 5b7cc6d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,10 +823,7 @@ EXPORT_SYMBOL_GPL(mt76x02_phy_dfs_adjust_agc);

void mt76x02_dfs_init_params(struct mt76x02_dev *dev)
{
struct cfg80211_chan_def *chandef = &dev->mphy.chandef;

if ((chandef->chan->flags & IEEE80211_CHAN_RADAR) &&
dev->mt76.region != NL80211_DFS_UNSET) {
if (mt76_phy_dfs_state(&dev->mphy) > MT_DFS_STATE_DISABLED) {
mt76x02_dfs_init_sw_detector(dev);
mt76x02_dfs_set_bbp_params(dev);
/* enable debug mode */
Expand Down

0 comments on commit 5b7cc6d

Please sign in to comment.