Commit 2070f3cc authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Kalle Valo

mt76x2: dfs: add set_domain handler

Add mt76x2_dfs_set_domain routine in order to properly reconfigure
pattern detector when DFS domain has been changed
Signed-off-by: default avatarLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 8c9f6491
...@@ -490,3 +490,16 @@ void mt76x2_dfs_init_detector(struct mt76x2_dev *dev) ...@@ -490,3 +490,16 @@ void mt76x2_dfs_init_detector(struct mt76x2_dev *dev)
(unsigned long)dev); (unsigned long)dev);
} }
void mt76x2_dfs_set_domain(struct mt76x2_dev *dev,
enum nl80211_dfs_regions region)
{
struct mt76x2_dfs_pattern_detector *dfs_pd = &dev->dfs_pd;
if (dfs_pd->region != region) {
tasklet_disable(&dfs_pd->dfs_tasklet);
dfs_pd->region = region;
mt76x2_dfs_init_params(dev);
tasklet_enable(&dfs_pd->dfs_tasklet);
}
}
...@@ -76,5 +76,7 @@ struct mt76x2_dfs_pattern_detector { ...@@ -76,5 +76,7 @@ struct mt76x2_dfs_pattern_detector {
void mt76x2_dfs_init_params(struct mt76x2_dev *dev); void mt76x2_dfs_init_params(struct mt76x2_dev *dev);
void mt76x2_dfs_init_detector(struct mt76x2_dev *dev); void mt76x2_dfs_init_detector(struct mt76x2_dev *dev);
void mt76x2_dfs_adjust_agc(struct mt76x2_dev *dev); void mt76x2_dfs_adjust_agc(struct mt76x2_dev *dev);
void mt76x2_dfs_set_domain(struct mt76x2_dev *dev,
enum nl80211_dfs_regions region);
#endif /* __MT76x2_DFS_H */ #endif /* __MT76x2_DFS_H */
...@@ -652,7 +652,7 @@ static void mt76x2_regd_notifier(struct wiphy *wiphy, ...@@ -652,7 +652,7 @@ static void mt76x2_regd_notifier(struct wiphy *wiphy,
struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
struct mt76x2_dev *dev = hw->priv; struct mt76x2_dev *dev = hw->priv;
dev->dfs_pd.region = request->dfs_region; mt76x2_dfs_set_domain(dev, request->dfs_region);
} }
#define CCK_RATE(_idx, _rate) { \ #define CCK_RATE(_idx, _rate) { \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment