2019-06-15 04:35:06 +00:00
|
|
|
From 33d915d9e8ce811d8958915ccd18d71a66c7c495 Mon Sep 17 00:00:00 2001
|
2019-02-26 19:41:03 +00:00
|
|
|
From: Manikanta Pubbisetty <mpubbise@codeaurora.org>
|
2019-06-15 04:35:06 +00:00
|
|
|
Date: Wed, 8 May 2019 14:55:33 +0530
|
2019-02-26 19:41:03 +00:00
|
|
|
Subject: [PATCH] {nl,mac}80211: allow 4addr AP operation on crypto controlled
|
|
|
|
devices
|
|
|
|
|
2019-06-15 04:35:06 +00:00
|
|
|
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
|
2019-02-26 19:41:03 +00:00
|
|
|
(In VLAN functionality, group traffic generated for a specific
|
|
|
|
VLAN group is always encrypted in software). Commit db3bdcb9c3ff
|
|
|
|
("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.
|
|
|
|
|
2019-06-15 04:35:06 +00:00
|
|
|
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).
|
2019-02-26 19:41:03 +00:00
|
|
|
|
2019-06-15 04:35:06 +00:00
|
|
|
Cc: stable@vger.kernel.org
|
|
|
|
Fixes: db3bdcb9c3ff ("mac80211: allow AP_VLAN operation on crypto controlled devices")
|
2019-02-26 19:41:03 +00:00
|
|
|
Signed-off-by: Manikanta Pubbisetty <mpubbise@codeaurora.org>
|
2019-06-15 04:35:06 +00:00
|
|
|
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
2019-02-26 19:41:03 +00:00
|
|
|
---
|
2019-06-15 04:35:06 +00:00
|
|
|
include/net/cfg80211.h | 3 ++-
|
|
|
|
net/mac80211/util.c | 4 +++-
|
|
|
|
net/wireless/core.c | 6 +++++-
|
|
|
|
net/wireless/nl80211.c | 8 ++++++--
|
|
|
|
4 files changed, 16 insertions(+), 5 deletions(-)
|
2019-02-26 19:41:03 +00:00
|
|
|
|
|
|
|
--- a/include/net/cfg80211.h
|
|
|
|
+++ b/include/net/cfg80211.h
|
2019-03-13 19:08:16 +00:00
|
|
|
@@ -3457,7 +3457,8 @@ struct cfg80211_ops {
|
2019-02-26 19:41:03 +00:00
|
|
|
* on wiphy_new(), but can be changed by the driver if it has a good
|
|
|
|
* reason to override the default
|
|
|
|
* @WIPHY_FLAG_4ADDR_AP: supports 4addr mode even on AP (with a single station
|
|
|
|
- * on a VLAN interface)
|
|
|
|
+ * on a VLAN interface). This flag also serves an extra purpose of
|
|
|
|
+ * supporting 4ADDR AP mode on devices which do not support AP/VLAN iftype.
|
|
|
|
* @WIPHY_FLAG_4ADDR_STATION: supports 4addr mode even as a station
|
|
|
|
* @WIPHY_FLAG_CONTROL_PORT_PROTOCOL: This device supports setting the
|
|
|
|
* control port protocol ethertype. The device also honours the
|
|
|
|
--- a/net/mac80211/util.c
|
|
|
|
+++ b/net/mac80211/util.c
|
2019-03-28 15:00:43 +00:00
|
|
|
@@ -3626,7 +3626,9 @@ int ieee80211_check_combinations(struct
|
2019-02-26 19:41:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Always allow software iftypes */
|
|
|
|
- if (local->hw.wiphy->software_iftypes & BIT(iftype)) {
|
|
|
|
+ if (local->hw.wiphy->software_iftypes & BIT(iftype) ||
|
|
|
|
+ (iftype == NL80211_IFTYPE_AP_VLAN &&
|
|
|
|
+ local->hw.wiphy->flags & WIPHY_FLAG_4ADDR_AP)) {
|
|
|
|
if (radar_detect)
|
|
|
|
return -EINVAL;
|
|
|
|
return 0;
|
|
|
|
--- a/net/wireless/core.c
|
|
|
|
+++ b/net/wireless/core.c
|
2019-06-15 04:35:06 +00:00
|
|
|
@@ -1351,8 +1351,12 @@ static int cfg80211_netdev_notifier_call
|
2019-02-26 19:41:03 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case NETDEV_PRE_UP:
|
|
|
|
- if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)))
|
2019-06-15 04:35:06 +00:00
|
|
|
+ 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);
|
2019-02-26 19:41:03 +00:00
|
|
|
+
|
|
|
|
if (rfkill_blocked(rdev->rfkill))
|
|
|
|
return notifier_from_errno(-ERFKILL);
|
|
|
|
break;
|
|
|
|
--- a/net/wireless/nl80211.c
|
|
|
|
+++ b/net/wireless/nl80211.c
|
2019-03-13 19:08:16 +00:00
|
|
|
@@ -3194,8 +3194,7 @@ static int nl80211_new_interface(struct
|
2019-02-26 19:41:03 +00:00
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
- 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 ||
|
2019-06-15 04:35:06 +00:00
|
|
|
@@ -3214,6 +3213,11 @@ static int nl80211_new_interface(struct
|
2019-02-26 19:41:03 +00:00
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
2019-06-15 04:35:06 +00:00
|
|
|
+ if (!(rdev->wiphy.interface_modes & (1 << type)) &&
|
|
|
|
+ !(type == NL80211_IFTYPE_AP_VLAN && params.use_4addr &&
|
|
|
|
+ rdev->wiphy.flags & WIPHY_FLAG_4ADDR_AP))
|
|
|
|
+ return -EOPNOTSUPP;
|
2019-02-26 19:41:03 +00:00
|
|
|
+
|
|
|
|
err = nl80211_parse_mon_options(rdev, type, info, ¶ms);
|
|
|
|
if (err < 0)
|
|
|
|
return err;
|