]> www.infradead.org Git - users/hch/misc.git/commitdiff
mt76x2: dfs: take into account dfs region in mt76x2_dfs_init_params()
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Tue, 9 Jan 2018 13:13:12 +0000 (14:13 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 24 Jan 2018 15:15:34 +0000 (17:15 +0200)
Do not enable DFS state machine if dfs region is set to NL80211_DFS_UNSET

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mediatek/mt76/mt76x2_dfs.c

index df23ba5ef900c8aeb8be80c7df188bed75d2b53e..f936dc9a5476f786645b8353b93d8bba97768da6 100644 (file)
@@ -460,7 +460,8 @@ void mt76x2_dfs_init_params(struct mt76x2_dev *dev)
 {
        struct cfg80211_chan_def *chandef = &dev->mt76.chandef;
 
-       if (chandef->chan->flags & IEEE80211_CHAN_RADAR) {
+       if ((chandef->chan->flags & IEEE80211_CHAN_RADAR) &&
+           dev->dfs_pd.region != NL80211_DFS_UNSET) {
                mt76x2_dfs_set_bbp_params(dev);
                /* enable debug mode */
                mt76x2_dfs_set_capture_mode_ctrl(dev, true);