Skip to content

Commit 5b7cc6d

Browse files
committed
mt76: mt76x02: use mt76_phy_dfs_state to determine radar detector state
Fixes corner cases in enabling/disabling detector Signed-off-by: Felix Fietkau <[email protected]>
1 parent 2c86f67 commit 5b7cc6d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -823,10 +823,7 @@ EXPORT_SYMBOL_GPL(mt76x02_phy_dfs_adjust_agc);
823823

824824
void mt76x02_dfs_init_params(struct mt76x02_dev *dev)
825825
{
826-
struct cfg80211_chan_def *chandef = &dev->mphy.chandef;
827-
828-
if ((chandef->chan->flags & IEEE80211_CHAN_RADAR) &&
829-
dev->mt76.region != NL80211_DFS_UNSET) {
826+
if (mt76_phy_dfs_state(&dev->mphy) > MT_DFS_STATE_DISABLED) {
830827
mt76x02_dfs_init_sw_detector(dev);
831828
mt76x02_dfs_set_bbp_params(dev);
832829
/* enable debug mode */

0 commit comments

Comments
 (0)