Currently there is no S1G STA bandwidth support throughout mac80211 as existing support is all based on 20MHz widths. With the recent STA NSS/BW handling rework, S1G associations now hit the new WARN within ieee80211_chan_width_to_rx_bw() as the chandef is not a 20MHz based width. For now, skip initialisating link_sta->pub->bandwidth for S1G chandefs to avoid the WARN though this should at some point be properly implemented since there are vendors that offer differing maximum bandwidths. Additionally, currently all S1G hardware out there is 1SS so rather then introducing new parsing code which wouldn't be used anyway, just initialise the NSS related fields to 1 and skip initialising the STA bandwidth for S1G chandefs within ieee80211_sta_init_nss_bw_capa(). Fixes: d879d4da4579 ("wifi: mac80211: clean up initial STA NSS/bandwidth handling") Signed-off-by: Lachlan Hodges --- net/mac80211/sta_info.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index aba2fabfe0db..0ea37016cd4f 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -3516,6 +3516,23 @@ static u8 ieee80211_sta_nss_capability(struct link_sta_info *link_sta) void ieee80211_sta_init_nss_bw_capa(struct link_sta_info *link_sta, struct cfg80211_chan_def *chandef) { + /* + * TODO: The entirety of the STA Tx/Rx bandwidth handling + * assumes 20MHz based widths, so for now don't initialise + * pubsta->bandwidth for S1G bands. Since enum + * ieee80211_sta_rx_bandwidth is ordered, we will probably + * need to introduce ieee80211_s1g_sta_rx_bandwidth with + * S1G widths and associated S1G specific code. Additionally, + * existing S1G hardware is all 1SS, in the future if hardware + * starts supporting >1SS this should be implemented in + * ieee80211_sta_nss_capability(). + */ + if (cfg80211_chandef_is_s1g(chandef)) { + link_sta->capa_nss = 1; + link_sta->pub->rx_nss = 1; + return; + } + link_sta->capa_nss = ieee80211_sta_nss_capability(link_sta); link_sta->pub->rx_nss = link_sta->capa_nss; -- 2.43.0