summaryrefslogtreecommitdiffstats
path: root/net/wireless/util.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-05-05 11:48:40 +0200
committerJohannes Berg <johannes.berg@intel.com>2014-05-13 15:50:06 +0200
commit8c48b50a1a888ac5511fe856d63f72fb688c6bb4 (patch)
tree34e897f3799273001f9e546f5bf356c43b6fbdca /net/wireless/util.c
parentf6837ba8c98afcf28ec25f6863a8597274aeefd6 (diff)
downloadop-kernel-dev-8c48b50a1a888ac5511fe856d63f72fb688c6bb4.zip
op-kernel-dev-8c48b50a1a888ac5511fe856d63f72fb688c6bb4.tar.gz
cfg80211: allow restricting supported dfs regions
At the moment, the ath9k/ath10k DFS module only supports detecting ETSI radar patterns. Add a bitmap in the interface combinations, indicating which DFS regions are supported by the detector. If unset, support for all regions is assumed. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/util.c')
-rw-r--r--net/wireless/util.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c
index a756429..8c61d5c 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -1274,10 +1274,20 @@ int cfg80211_iter_combinations(struct wiphy *wiphy,
void *data),
void *data)
{
+ const struct ieee80211_regdomain *regdom;
+ enum nl80211_dfs_regions region = 0;
int i, j, iftype;
int num_interfaces = 0;
u32 used_iftypes = 0;
+ if (radar_detect) {
+ rcu_read_lock();
+ regdom = rcu_dereference(cfg80211_regdomain);
+ if (regdom)
+ region = regdom->dfs_region;
+ rcu_read_unlock();
+ }
+
for (iftype = 0; iftype < NUM_NL80211_IFTYPES; iftype++) {
num_interfaces += iftype_num[iftype];
if (iftype_num[iftype] > 0 &&
@@ -1318,6 +1328,10 @@ int cfg80211_iter_combinations(struct wiphy *wiphy,
if (radar_detect != (c->radar_detect_widths & radar_detect))
goto cont;
+ if (radar_detect && c->radar_detect_regions &&
+ !(c->radar_detect_regions & BIT(region)))
+ goto cont;
+
/* Finally check that all iftypes that we're currently
* using are actually part of this combination. If they
* aren't then we can't use this combination and have
OpenPOWER on IntegriCloud