Revert "cfg80211: enforce lack of interface combinations"
Om Prakash Singh [Tue, 16 Apr 2013 09:29:19 +0000 (14:29 +0530)]
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>

include/net/cfg80211.h
net/wireless/core.c
net/wireless/util.c

index f8f5de7..dd4022a 100644 (file)
@@ -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),
index 64fcbae..97accb8 100644 (file)
@@ -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;
index f5ad4d9..6b0ccfc 100644 (file)
@@ -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));