summaryrefslogtreecommitdiffstats
path: root/net/wireless/core.c
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2012-06-29 12:47:07 +0200
committerJohannes Berg <johannes.berg@intel.com>2012-06-29 13:39:19 +0200
commitd4e50c5917e110451ced8f8de594cea858791f37 (patch)
tree078ac36d0642114f90b57e50ef9b585e2f8a5be9 /net/wireless/core.c
parent2e165b818456ecc1024dd0387eeac64745526377 (diff)
downloadblackbird-op-linux-d4e50c5917e110451ced8f8de594cea858791f37.tar.gz
blackbird-op-linux-d4e50c5917e110451ced8f8de594cea858791f37.zip
cfg80211: add channel checking for iface combinations
.connect cannot be handled since the driver scans and connects on its own. It is up to the driver then to refuse a connection (with -EBUSY for example). Non-fixed channel IBSSes always take a single channel resource. For example two non-fixed channel IBSSes always take up 2 num_different_channels, even if they operate on the same channel at a given point of time. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/core.c')
-rw-r--r--net/wireless/core.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 580551e9caba..b26695ad3e97 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -373,6 +373,14 @@ static int wiphy_verify_combinations(struct wiphy *wiphy)
if (WARN_ON(!c->num_different_channels))
return -EINVAL;
+ /*
+ * Put a sane limit on maximum number of different
+ * channels to simplify channel accounting code.
+ */
+ if (WARN_ON(c->num_different_channels >
+ CFG80211_MAX_NUM_DIFFERENT_CHANNELS))
+ return -EINVAL;
+
if (WARN_ON(!c->n_limits))
return -EINVAL;
OpenPOWER on IntegriCloud