mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
{nl,mac}80211: allow 4addr AP operation on crypto controlled devices
As per the current design, in the case of sw crypto controlled devices, it is the device which advertises the support for AP/VLAN iftype based on it's ability to tranmsit packets encrypted in software (In VLAN functionality, group traffic generated for a specific VLAN group is always encrypted in software). Commitdb3bdcb9c3("mac80211: allow AP_VLAN operation on crypto controlled devices") has introduced this change. Since 4addr AP operation also uses AP/VLAN iftype, this conditional way of advertising AP/VLAN support has broken 4addr AP mode operation on crypto controlled devices which do not support VLAN functionality. In the case of ath10k driver, not all firmwares have support for VLAN functionality but all can support 4addr AP operation. Because AP/VLAN support is not advertised for these devices, 4addr AP operations are also blocked. Fix this by allowing 4addr operation on devices which do not support AP/VLAN iftype but can support 4addr AP operation (decision is based on the wiphy flag WIPHY_FLAG_4ADDR_AP). Cc: [email protected] Fixes:db3bdcb9c3("mac80211: allow AP_VLAN operation on crypto controlled devices") Signed-off-by: Manikanta Pubbisetty <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
This commit is contained in:
parent
85a55ff2cf
commit
33d915d9e8
4 changed files with 16 additions and 5 deletions
|
|
@ -1396,8 +1396,12 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
|
|||
}
|
||||
break;
|
||||
case NETDEV_PRE_UP:
|
||||
if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)))
|
||||
if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)) &&
|
||||
!(wdev->iftype == NL80211_IFTYPE_AP_VLAN &&
|
||||
rdev->wiphy.flags & WIPHY_FLAG_4ADDR_AP &&
|
||||
wdev->use_4addr))
|
||||
return notifier_from_errno(-EOPNOTSUPP);
|
||||
|
||||
if (rfkill_blocked(rdev->rfkill))
|
||||
return notifier_from_errno(-ERFKILL);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -3419,8 +3419,7 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
|
|||
if (info->attrs[NL80211_ATTR_IFTYPE])
|
||||
type = nla_get_u32(info->attrs[NL80211_ATTR_IFTYPE]);
|
||||
|
||||
if (!rdev->ops->add_virtual_intf ||
|
||||
!(rdev->wiphy.interface_modes & (1 << type)))
|
||||
if (!rdev->ops->add_virtual_intf)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if ((type == NL80211_IFTYPE_P2P_DEVICE || type == NL80211_IFTYPE_NAN ||
|
||||
|
|
@ -3439,6 +3438,11 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
|
|||
return err;
|
||||
}
|
||||
|
||||
if (!(rdev->wiphy.interface_modes & (1 << type)) &&
|
||||
!(type == NL80211_IFTYPE_AP_VLAN && params.use_4addr &&
|
||||
rdev->wiphy.flags & WIPHY_FLAG_4ADDR_AP))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
err = nl80211_parse_mon_options(rdev, type, info, ¶ms);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
|
|
|||
Loading…
Reference in a new issue