summaryrefslogtreecommitdiff
path: root/net/wireless/core.c
diff options
context:
space:
mode:
authorSimon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>2013-01-08 13:04:07 (GMT)
committerJohannes Berg <johannes.berg@intel.com>2013-01-16 22:41:54 (GMT)
commit11c4a075db2f8774d37544342c8cb9752b4db9e1 (patch)
treedbd28f1bbac2a42ebe4aade8d1a4bc2871431924 /net/wireless/core.c
parentcee00a959c0a86571e6f99cf42f0261d7e54d2ae (diff)
downloadlinux-11c4a075db2f8774d37544342c8cb9752b4db9e1.tar.xz
cfg80211: check radar interface combinations
To ease further DFS development regarding interface combinations, use the interface combinations structure to test for radar capabilities. Drivers can specify which channel widths they support, and in which modes. Right now only a single AP interface is allowed, but as the DFS code evolves other combinations can be enabled. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/core.c')
-rw-r--r--net/wireless/core.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 747dd93..0e702cd 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -382,8 +382,11 @@ static int wiphy_verify_combinations(struct wiphy *wiphy)
c = &wiphy->iface_combinations[i];
- /* Combinations with just one interface aren't real */
- if (WARN_ON(c->max_interfaces < 2))
+ /*
+ * Combinations with just one interface aren't real,
+ * however we make an exception for DFS.
+ */
+ if (WARN_ON((c->max_interfaces < 2) && !c->radar_detect_widths))
return -EINVAL;
/* Need at least one channel */
@@ -398,6 +401,11 @@ static int wiphy_verify_combinations(struct wiphy *wiphy)
CFG80211_MAX_NUM_DIFFERENT_CHANNELS))
return -EINVAL;
+ /* DFS only works on one channel. */
+ if (WARN_ON(c->radar_detect_widths &&
+ (c->num_different_channels > 1)))
+ return -EINVAL;
+
if (WARN_ON(!c->n_limits))
return -EINVAL;