aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-03-15 05:16:16 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-16 14:16:58 -0400
commit8e8b41f9d8c8e63fc92f899ace8da91a490ac573 (patch)
tree154122d12331baa908766b87782cad69b4a7da7d
parent0d920987f900573f9f86b7310147ebd1646657c9 (diff)
cfg80211: enforce lack of interface combinations
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>
-rw-r--r--include/net/cfg80211.h6
-rw-r--r--net/wireless/core.c4
-rw-r--r--net/wireless/util.c10
3 files changed, 4 insertions, 16 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index d17ad5f2b603..815dc3f37e2b 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1745,10 +1745,6 @@ struct cfg80211_ops {
1745 * hints read the documenation for regulatory_hint_found_beacon() 1745 * hints read the documenation for regulatory_hint_found_beacon()
1746 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this 1746 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this
1747 * wiphy at all 1747 * wiphy at all
1748 * @WIPHY_FLAG_ENFORCE_COMBINATIONS: Set this flag to enforce interface
1749 * combinations for this device. This flag is used for backward
1750 * compatibility only until all drivers advertise combinations and
1751 * they will always be enforced.
1752 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled 1748 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled
1753 * by default -- this flag will be set depending on the kernel's default 1749 * by default -- this flag will be set depending on the kernel's default
1754 * on wiphy_new(), but can be changed by the driver if it has a good 1750 * on wiphy_new(), but can be changed by the driver if it has a good
@@ -1793,7 +1789,7 @@ enum wiphy_flags {
1793 WIPHY_FLAG_IBSS_RSN = BIT(8), 1789 WIPHY_FLAG_IBSS_RSN = BIT(8),
1794 WIPHY_FLAG_MESH_AUTH = BIT(10), 1790 WIPHY_FLAG_MESH_AUTH = BIT(10),
1795 WIPHY_FLAG_SUPPORTS_SCHED_SCAN = BIT(11), 1791 WIPHY_FLAG_SUPPORTS_SCHED_SCAN = BIT(11),
1796 WIPHY_FLAG_ENFORCE_COMBINATIONS = BIT(12), 1792 /* use hole at 12 */
1797 WIPHY_FLAG_SUPPORTS_FW_ROAM = BIT(13), 1793 WIPHY_FLAG_SUPPORTS_FW_ROAM = BIT(13),
1798 WIPHY_FLAG_AP_UAPSD = BIT(14), 1794 WIPHY_FLAG_AP_UAPSD = BIT(14),
1799 WIPHY_FLAG_SUPPORTS_TDLS = BIT(15), 1795 WIPHY_FLAG_SUPPORTS_TDLS = BIT(15),
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 59f4a7e7c092..39f2538a46fc 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -422,10 +422,6 @@ static int wiphy_verify_combinations(struct wiphy *wiphy)
422 const struct ieee80211_iface_combination *c; 422 const struct ieee80211_iface_combination *c;
423 int i, j; 423 int i, j;
424 424
425 /* If we have combinations enforce them */
426 if (wiphy->n_iface_combinations)
427 wiphy->flags |= WIPHY_FLAG_ENFORCE_COMBINATIONS;
428
429 for (i = 0; i < wiphy->n_iface_combinations; i++) { 425 for (i = 0; i < wiphy->n_iface_combinations; i++) {
430 u32 cnt = 0; 426 u32 cnt = 0;
431 u16 all_iftypes = 0; 427 u16 all_iftypes = 0;
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 1b7a08df933c..ffced852284d 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -946,13 +946,6 @@ int cfg80211_can_change_interface(struct cfg80211_registered_device *rdev,
946 if (rdev->wiphy.software_iftypes & BIT(iftype)) 946 if (rdev->wiphy.software_iftypes & BIT(iftype))
947 return 0; 947 return 0;
948 948
949 /*
950 * Drivers will gradually all set this flag, until all
951 * have it we only enforce for those that set it.
952 */
953 if (!(rdev->wiphy.flags & WIPHY_FLAG_ENFORCE_COMBINATIONS))
954 return 0;
955
956 memset(num, 0, sizeof(num)); 949 memset(num, 0, sizeof(num));
957 950
958 num[iftype] = 1; 951 num[iftype] = 1;
@@ -972,6 +965,9 @@ int cfg80211_can_change_interface(struct cfg80211_registered_device *rdev,
972 } 965 }
973 mutex_unlock(&rdev->devlist_mtx); 966 mutex_unlock(&rdev->devlist_mtx);
974 967
968 if (total == 1)
969 return 0;
970
975 for (i = 0; i < rdev->wiphy.n_iface_combinations; i++) { 971 for (i = 0; i < rdev->wiphy.n_iface_combinations; i++) {
976 const struct ieee80211_iface_combination *c; 972 const struct ieee80211_iface_combination *c;
977 struct ieee80211_iface_limit *limits; 973 struct ieee80211_iface_limit *limits;