|
|
@@ -1670,7 +1670,7 @@ int cfg80211_iter_combinations(struct wiphy *wiphy,
|
|
|
for (iftype = 0; iftype < NUM_NL80211_IFTYPES; iftype++) {
|
|
|
num_interfaces += params->iftype_num[iftype];
|
|
|
if (params->iftype_num[iftype] > 0 &&
|
|
|
- !(wiphy->software_iftypes & BIT(iftype)))
|
|
|
+ !cfg80211_iftype_allowed(wiphy, iftype, 0, 1))
|
|
|
used_iftypes |= BIT(iftype);
|
|
|
}
|
|
|
|
|
|
@@ -1692,7 +1692,7 @@ int cfg80211_iter_combinations(struct wiphy *wiphy,
|
|
|
return -ENOMEM;
|
|
|
|
|
|
for (iftype = 0; iftype < NUM_NL80211_IFTYPES; iftype++) {
|
|
|
- if (wiphy->software_iftypes & BIT(iftype))
|
|
|
+ if (cfg80211_iftype_allowed(wiphy, iftype, 0, 1))
|
|
|
continue;
|
|
|
for (j = 0; j < c->n_limits; j++) {
|
|
|
all_iftypes |= limits[j].types;
|
|
|
@@ -1895,3 +1895,26 @@ EXPORT_SYMBOL(rfc1042_header);
|
|
|
const unsigned char bridge_tunnel_header[] __aligned(2) =
|
|
|
{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
|
|
|
EXPORT_SYMBOL(bridge_tunnel_header);
|
|
|
+
|
|
|
+bool cfg80211_iftype_allowed(struct wiphy *wiphy, enum nl80211_iftype iftype,
|
|
|
+ bool is_4addr, u8 check_swif)
|
|
|
+
|
|
|
+{
|
|
|
+ bool is_vlan = iftype == NL80211_IFTYPE_AP_VLAN;
|
|
|
+
|
|
|
+ switch (check_swif) {
|
|
|
+ case 0:
|
|
|
+ if (is_vlan && is_4addr)
|
|
|
+ return wiphy->flags & WIPHY_FLAG_4ADDR_AP;
|
|
|
+ return wiphy->interface_modes & BIT(iftype);
|
|
|
+ case 1:
|
|
|
+ if (!(wiphy->software_iftypes & BIT(iftype)) && is_vlan)
|
|
|
+ return wiphy->flags & WIPHY_FLAG_4ADDR_AP;
|
|
|
+ return wiphy->software_iftypes & BIT(iftype);
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(cfg80211_iftype_allowed);
|