From: Johannes Berg Date: Fri, 18 Jun 2021 10:41:40 +0000 (+0300) Subject: mac80211: conditionally advertise HE in probe requests X-Git-Tag: v5.14-rc1~119^2~25^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0bc47057b54b73e5f6d36bfc7c5c96e15be1f221;p=thirdparty%2Flinux.git mac80211: conditionally advertise HE in probe requests While building probe requests, only enable HE capability if there are actually any channels in the band with HE enabled, otherwise we're not really capable. We're doing the same in association requests, so doing it here makes it consistent. This also makes HE not appear available if it isn't due to regulatory constraints. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210618133832.b5513f2af335.Ic01862678712ae4238cea43ad2185928865efad2@changeid Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/util.c b/net/mac80211/util.c index b352d1d87bf00..fab4bb1948e32 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -1939,7 +1939,9 @@ static int ieee80211_build_preq_ies_band(struct ieee80211_sub_if_data *sdata, he_cap = ieee80211_get_he_iftype_cap(sband, ieee80211_vif_type_p2p(&sdata->vif)); - if (he_cap) { + if (he_cap && + cfg80211_any_usable_channels(local->hw.wiphy, BIT(sband->band), + IEEE80211_CHAN_NO_HE)) { pos = ieee80211_ie_build_he_cap(pos, he_cap, end); if (!pos) goto out_err;