mac80211 does not support TX/RX rate reporting for S1G bandwidths and as a result WARNs occur during validation as the default value of 20MHz (0) is always higher then the highest S1G bandwidth of 16MHz. This prevents association from occuring in some instances. Skip bandwidth validation for S1G interfaces to avoid spurious WARNs and ensure a clean association process as there is no support for S1G TX/RX bandwidths. Signed-off-by: Lachlan Hodges --- This is kind of a bandaid fix (hence why RFC), but implementing proper native rate control support for S1G within minstrel and mac80211 is not pretty (lack of flag space, ordering of RX bandwidth enum, aliasing with VHT flags and a myriad of other issues). If an S1G driver is submitted it would be considered a "modern" driver and would probably contain its own rate control. There has been some S1G hostap work recently submitted [1] though it's only STA side though this will need to be fixed in order for proper tests to be run. hwsim tests were run, with the following errors occuring on the tip 31dc1462a Define QCA_NL80211_VENDOR_SUBCMD_GET_COEX_STATS. All dpp errors are related to some OpenSSL python error and the bss config file test fails to open some trace file. dpp_config_connector_error_ext_sign dpp_config_connector_error_too_short_timestamp dpp_config_connector_error_invalid_timestamp_date dpp_config_connector_error_invalid_timestamp dpp_config_connector_error_invalid_time_zone dpp_config_connector_error_invalid_time_zone_2 dpp_config_connector_error_expired_2 dpp_config_connector_error_expired_1 dpp_config_connector_error_expired_4 dpp_config_connector_error_expired_3 dpp_config_connector_error_expired_5 dpp_config_connector_error_expired_6 dpp_config_connector_error_missing_group_id dpp_config_connector_error_no_groups dpp_config_connector_error_empty_groups dpp_config_connector_error_missing_net_role dpp_config_connector_error_net_access_key_mismatch dpp_config_connector_error_missing_net_access_key ap_bss_config_file [1] https://patchwork.ozlabs.org/project/hostap/cover/cover.1759334464.git.james@teledatics.com/ --- drivers/net/wireless/virtual/mac80211_hwsim.c | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/drivers/net/wireless/virtual/mac80211_hwsim.c b/drivers/net/wireless/virtual/mac80211_hwsim.c index dde6a622ff72..e3688beb086b 100644 --- a/drivers/net/wireless/virtual/mac80211_hwsim.c +++ b/drivers/net/wireless/virtual/mac80211_hwsim.c @@ -2096,23 +2096,26 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw, txi->control.rates, ARRAY_SIZE(txi->control.rates)); - for (i = 0; i < ARRAY_SIZE(txi->control.rates); i++) { - u16 rflags = txi->control.rates[i].flags; - /* initialize to data->bw for 5/10 MHz handling */ - enum nl80211_chan_width bw = data->bw; + if (channel->band != NL80211_BAND_S1GHZ) { + for (i = 0; i < ARRAY_SIZE(txi->control.rates); i++) { + u16 rflags = txi->control.rates[i].flags; + /* initialize to data->bw for 5/10 MHz handling */ + enum nl80211_chan_width bw = data->bw; - if (txi->control.rates[i].idx == -1) - break; + if (txi->control.rates[i].idx == -1) + break; - if (rflags & IEEE80211_TX_RC_40_MHZ_WIDTH) - bw = NL80211_CHAN_WIDTH_40; - else if (rflags & IEEE80211_TX_RC_80_MHZ_WIDTH) - bw = NL80211_CHAN_WIDTH_80; - else if (rflags & IEEE80211_TX_RC_160_MHZ_WIDTH) - bw = NL80211_CHAN_WIDTH_160; + if (rflags & IEEE80211_TX_RC_40_MHZ_WIDTH) + bw = NL80211_CHAN_WIDTH_40; + else if (rflags & IEEE80211_TX_RC_80_MHZ_WIDTH) + bw = NL80211_CHAN_WIDTH_80; + else if (rflags & IEEE80211_TX_RC_160_MHZ_WIDTH) + bw = NL80211_CHAN_WIDTH_160; - if (WARN_ON(hwsim_get_chanwidth(bw) > hwsim_get_chanwidth(confbw))) - return; + if (WARN_ON(hwsim_get_chanwidth(bw) > + hwsim_get_chanwidth(confbw))) + return; + } } if (skb->len >= 24 + 8 && @@ -2677,7 +2680,7 @@ mac80211_hwsim_sta_rc_update(struct ieee80211_hw *hw, link_sta = rcu_dereference(sta->link[link_id]); - if (!link_sta) + if (!link_sta || link_sta->s1g_cap.s1g) continue; switch (link_sta->bandwidth) { -- 2.43.0