[PATCH 169/379][SRU][OEM-5.6] cfg80211: require HE capabilities for 6 GHz band
You-Sheng Yang
vicamo.yang at canonical.com
Wed Dec 23 08:48:22 UTC 2020
From: Johannes Berg <johannes.berg at intel.com>
BugLink: https://bugs.launchpad.net/bugs/1879633
On 6 GHz band, HE capabilities must be available for all of
the interface types, otherwise we shouldn't use 6 GHz. Check
this.
Link: https://lore.kernel.org/r/20200528213443.5881cb3c8c4a.I583b54172f91f98d44af64a16c5826fe458cbb27@changeid
Signed-off-by: Johannes Berg <johannes.berg at intel.com>
(cherry picked from commit f438136528482f98535889c9a6f99bbacdd92870)
Signed-off-by: You-Sheng Yang <vicamo.yang at canonical.com>
---
net/wireless/core.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 8c2828b5241f..e52fd39ece70 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -788,6 +788,7 @@ int wiphy_register(struct wiphy *wiphy)
/* sanity check supported bands/channels */
for (band = 0; band < NUM_NL80211_BANDS; band++) {
u16 types = 0;
+ bool have_he = false;
sband = wiphy->bands[band];
if (!sband)
@@ -853,8 +854,17 @@ int wiphy_register(struct wiphy *wiphy)
return -EINVAL;
types |= iftd->types_mask;
+
+ if (i == 0)
+ have_he = iftd->he_cap.has_he;
+ else
+ have_he = have_he &&
+ iftd->he_cap.has_he;
}
+ if (WARN_ON(!have_he && band == NL80211_BAND_6GHZ))
+ return -EINVAL;
+
have_band = true;
}
--
2.29.2
More information about the kernel-team
mailing list