cfg80211: enforce lack of interface combinations
authorJohannes Berg <johannes.berg@intel.com>
Thu, 15 Mar 2012 09:16:16 +0000 (10:16 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 16 Apr 2012 18:16:58 +0000 (14:16 -0400)
My grand plan to allow drivers to gradually move over
to advertising virtual interface combinations and only
enforce with drivers that do want it enforced doesn't
seem to be working out, only Christian ever added the
advertising (to carl9170), nobody else did.

Begin enforcing combinations in cfg80211 so that users
can rely on the information reported about a device.

Cc: "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com>
Cc: Jouni Malinen <jouni@qca.qualcomm.com>
Cc: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com>
Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: Jiri Slaby <jirislaby@gmail.com>
Cc: Nick Kossifidis <mickflemm@gmail.com>
Cc: Bob Copeland <me@bobcopeland.com>
Cc: Bing Zhao <bzhao@marvell.com>
Cc: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: Ivo van Doorn <IvDoorn@gmail.com>
Cc: Gertjan van Wingerde <gwingerde@gmail.com>
Cc: Helmut Schaa <helmut.schaa@googlemail.com>
Cc: Luciano Coelho <coelho@ti.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
include/net/cfg80211.h
net/wireless/core.c
net/wireless/util.c

index d17ad5f2b603f754d19e9b9a700c5d64a7744141..815dc3f37e2b5c0e21d95cbdc5186533aa9f89d7 100644 (file)
@@ -1745,10 +1745,6 @@ 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
@@ -1793,7 +1789,7 @@ enum wiphy_flags {
        WIPHY_FLAG_IBSS_RSN                     = BIT(8),
        WIPHY_FLAG_MESH_AUTH                    = BIT(10),
        WIPHY_FLAG_SUPPORTS_SCHED_SCAN          = BIT(11),
-       WIPHY_FLAG_ENFORCE_COMBINATIONS         = BIT(12),
+       /* use hole at 12 */
        WIPHY_FLAG_SUPPORTS_FW_ROAM             = BIT(13),
        WIPHY_FLAG_AP_UAPSD                     = BIT(14),
        WIPHY_FLAG_SUPPORTS_TDLS                = BIT(15),
index 59f4a7e7c0921f4baaf5c00eb243d3ec70cc60d3..39f2538a46fc03936e7ef4145c7de29c0a624a62 100644 (file)
@@ -422,10 +422,6 @@ 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 1b7a08df933c79bf4ffe62455747464468c84bdb..ffced852284d46c8b69cd72a147cccc715888289 100644 (file)
@@ -946,13 +946,6 @@ int cfg80211_can_change_interface(struct cfg80211_registered_device *rdev,
        if (rdev->wiphy.software_iftypes & BIT(iftype))
                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));
 
        num[iftype] = 1;
@@ -972,6 +965,9 @@ int cfg80211_can_change_interface(struct cfg80211_registered_device *rdev,
        }
        mutex_unlock(&rdev->devlist_mtx);
 
+       if (total == 1)
+               return 0;
+
        for (i = 0; i < rdev->wiphy.n_iface_combinations; i++) {
                const struct ieee80211_iface_combination *c;
                struct ieee80211_iface_limit *limits;