summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOm Prakash Singh <omp@nvidia.com>2013-04-16 14:59:19 +0530
committerBharat Nihalani <bnihalani@nvidia.com>2013-09-30 17:41:03 -0700
commite2d427f7acfd08cf723c5816107edad0a3d141bd (patch)
tree4433353e61041ed317515b1b52c7688eca04582e
parent00014640a333dd90e220ec6b848e74c6a689d96e (diff)
Revert "cfg80211: enforce lack of interface combinations"
This reverts commit 8e8b41f9d8c8e63fc92f899ace8da91a490ac573. Bug 1211946 Change-Id: Ie30436e7e2528708d6d9752f231172e784bca917 Signed-off-by: Om Prakash Singh <omp@nvidia.com> Reviewed-on: http://git-master/r/219753 (cherry picked from commit b1983bf9f869d08595d333ff464a2ffc655a8ae9) Reviewed-on: http://git-master/r/279378 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--include/net/cfg80211.h6
-rw-r--r--net/wireless/core.c4
-rw-r--r--net/wireless/util.c7
3 files changed, 16 insertions, 1 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index f8f5de74d8fa..dd4022a6537e 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2285,6 +2285,10 @@ struct cfg80211_ops {
* hints read the documenation for regulatory_hint_found_beacon()
* @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this
* wiphy at all
+ * @WIPHY_FLAG_ENFORCE_COMBINATIONS: Set this flag to enforce interface
+ * combinations for this device. This flag is used for backward
+ * compatibility only until all drivers advertise combinations and
+ * they will always be enforced.
* @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled
* by default -- this flag will be set depending on the kernel's default
* on wiphy_new(), but can be changed by the driver if it has a good
@@ -2329,7 +2333,7 @@ enum wiphy_flags {
WIPHY_FLAG_IBSS_RSN = BIT(8),
WIPHY_FLAG_MESH_AUTH = BIT(10),
WIPHY_FLAG_SUPPORTS_SCHED_SCAN = BIT(11),
- /* use hole at 12 */
+ WIPHY_FLAG_ENFORCE_COMBINATIONS = BIT(12),
WIPHY_FLAG_SUPPORTS_FW_ROAM = BIT(13),
WIPHY_FLAG_AP_UAPSD = BIT(14),
WIPHY_FLAG_SUPPORTS_TDLS = BIT(15),
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 64fcbae020d2..97accb853423 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -412,6 +412,10 @@ static int wiphy_verify_combinations(struct wiphy *wiphy)
const struct ieee80211_iface_combination *c;
int i, j;
+ /* If we have combinations enforce them */
+ if (wiphy->n_iface_combinations)
+ wiphy->flags |= WIPHY_FLAG_ENFORCE_COMBINATIONS;
+
for (i = 0; i < wiphy->n_iface_combinations; i++) {
u32 cnt = 0;
u16 all_iftypes = 0;
diff --git a/net/wireless/util.c b/net/wireless/util.c
index f5ad4d94ba88..6b0ccfcec092 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -1257,6 +1257,13 @@ int cfg80211_can_use_iftype_chan(struct cfg80211_registered_device *rdev,
return 0;
}
+ /*
+ * Drivers will gradually all set this flag, until all
+ * have it we only enforce for those that set it.
+ */
+ if (!(rdev->wiphy.flags & WIPHY_FLAG_ENFORCE_COMBINATIONS))
+ return 0;
+
memset(num, 0, sizeof(num));
memset(used_channels, 0, sizeof(used_channels));