Skip to content

Commit f438136

Browse files
committed
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@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 461ce35 commit f438136

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

net/wireless/core.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@ int wiphy_register(struct wiphy *wiphy)
791791
/* sanity check supported bands/channels */
792792
for (band = 0; band < NUM_NL80211_BANDS; band++) {
793793
u16 types = 0;
794+
bool have_he = false;
794795

795796
sband = wiphy->bands[band];
796797
if (!sband)
@@ -859,8 +860,17 @@ int wiphy_register(struct wiphy *wiphy)
859860
return -EINVAL;
860861

861862
types |= iftd->types_mask;
863+
864+
if (i == 0)
865+
have_he = iftd->he_cap.has_he;
866+
else
867+
have_he = have_he &&
868+
iftd->he_cap.has_he;
862869
}
863870

871+
if (WARN_ON(!have_he && band == NL80211_BAND_6GHZ))
872+
return -EINVAL;
873+
864874
have_band = true;
865875
}
866876

0 commit comments

Comments
 (0)