Commit f4381365 authored by Johannes Berg's avatar Johannes Berg

cfg80211: require HE capabilities for 6 GHz band

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@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 461ce35d
...@@ -791,6 +791,7 @@ int wiphy_register(struct wiphy *wiphy) ...@@ -791,6 +791,7 @@ int wiphy_register(struct wiphy *wiphy)
/* sanity check supported bands/channels */ /* sanity check supported bands/channels */
for (band = 0; band < NUM_NL80211_BANDS; band++) { for (band = 0; band < NUM_NL80211_BANDS; band++) {
u16 types = 0; u16 types = 0;
bool have_he = false;
sband = wiphy->bands[band]; sband = wiphy->bands[band];
if (!sband) if (!sband)
...@@ -859,8 +860,17 @@ int wiphy_register(struct wiphy *wiphy) ...@@ -859,8 +860,17 @@ int wiphy_register(struct wiphy *wiphy)
return -EINVAL; return -EINVAL;
types |= iftd->types_mask; 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; have_band = true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment