wifi: cfg80211: don't apply HT flags to S1G channels

HT flags don't really make sense when applied to S1G channels
especially given the bandwidths both used for calculations and
conveyed (i.e 20MHz). Similarly with the 80/160/..MHz channels,
each bonded subchannel is validated individually within
cfg80211_s1g_usable(), so the regulatory validation is similarly
redundant. Additionally, usermode application output (such as iwinfo
below) doesn't particularly make sense when enumerating S1G channels:

before:

925.500 MHz (Band: 900 MHz, Channel 47) [NO_HT40+, NO_HT40-, NO_16MHZ]
926.500 MHz (Band: 900 MHz, Channel 49) [NO_HT40+, NO_HT40-, NO_16MHZ]
927.500 MHz (Band: 900 MHz, Channel 51) [NO_HT40+, NO_HT40-, NO_16MHZ, NO_PRIMARY]

after:

925.500 MHz (Band: 900 MHz, Channel 47) [NO_16MHZ]
926.500 MHz (Band: 900 MHz, Channel 49) [NO_16MHZ]
927.500 MHz (Band: 900 MHz, Channel 51) [NO_16MHZ, NO_PRIMARY]

Don't process the S1G band when applying HT flags as both the regulatory
component is redundant and the flags don't make sense for S1G channels.

Signed-off-by: Lachlan Hodges <lachlan.hodges@morsemicro.com>
Link: https://patch.msgid.link/20260113030934.18726-1-lachlan.hodges@morsemicro.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Lachlan Hodges 2026-01-13 14:09:34 +11:00 committed by Johannes Berg
parent 669aa3e3fa
commit 24a5798567

View File

@ -2332,8 +2332,17 @@ static void reg_process_ht_flags(struct wiphy *wiphy)
if (!wiphy)
return;
for (band = 0; band < NUM_NL80211_BANDS; band++)
for (band = 0; band < NUM_NL80211_BANDS; band++) {
/*
* Don't apply HT flags to channels within the S1G band.
* Each bonded channel will instead be validated individually
* within cfg80211_s1g_usable().
*/
if (band == NL80211_BAND_S1GHZ)
continue;
reg_process_ht_flags_band(wiphy, wiphy->bands[band]);
}
}
static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev)