Advertise both services, so that the stack can be tested without hardware. mac80211 implements them in software, so the two extended feature flags are all a simulated device needs for classification. Also implement sta_set_scs, since mac80211 declines every descriptor with a traffic description when no driver answers it. Nothing here schedules a stream, so the answer comes from debugfs, which lets a test cover both outcomes. Set the SCS Traffic Description Support subfield of the EHT MAC Capabilities for AP interfaces on every band. Without it, a non-AP EHT STA sends no QoS Characteristics element to a simulated AP. Signed-off-by: Felix Fietkau --- drivers/net/wireless/virtual/mac80211_hwsim_i.h | 3 +- drivers/net/wireless/virtual/mac80211_hwsim_main.c | 31 +++++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/virtual/mac80211_hwsim_i.h b/drivers/net/wireless/virtual/mac80211_hwsim_i.h index 0f0f2ac6d80e..7f1c85ea6813 100644 --- a/drivers/net/wireless/virtual/mac80211_hwsim_i.h +++ b/drivers/net/wireless/virtual/mac80211_hwsim_i.h @@ -137,6 +137,9 @@ struct mac80211_hwsim_data { /* RSSI in rx status of the receiver */ int rx_rssi; + /* Status code for a traffic description, 0 accepts */ + u16 scs_status; + /* only used when pmsr capability is supplied */ struct cfg80211_pmsr_capabilities pmsr_capa; struct cfg80211_pmsr_request *pmsr_request; diff --git a/drivers/net/wireless/virtual/mac80211_hwsim_main.c b/drivers/net/wireless/virtual/mac80211_hwsim_main.c index e53714b81ec2..f9304a32183b 100644 --- a/drivers/net/wireless/virtual/mac80211_hwsim_main.c +++ b/drivers/net/wireless/virtual/mac80211_hwsim_main.c @@ -4301,6 +4301,23 @@ static int mac80211_hwsim_set_radar_background(struct ieee80211_hw *hw, return 0; } +/* The status code for a traffic description is set via debugfs for testing */ +static int mac80211_hwsim_sta_set_scs(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + struct cfg80211_scs_desc * const *desc, + u16 *status, u8 n_desc) +{ + struct mac80211_hwsim_data *data = hw->priv; + u8 i; + + for (i = 0; i < n_desc; i++) + if (desc[i]->qos_char) + status[i] = data->scs_status; + + return 0; +} + #ifdef CONFIG_MAC80211_DEBUGFS #define HWSIM_DEBUGFS_OPS \ .link_add_debugfs = mac80211_hwsim_link_add_debugfs, @@ -4325,6 +4342,7 @@ static int mac80211_hwsim_set_radar_background(struct ieee80211_hw *hw, .link_sta_rc_update = mac80211_hwsim_sta_rc_update, \ .conf_tx = mac80211_hwsim_conf_tx, \ .get_survey = mac80211_hwsim_get_survey, \ + .sta_set_scs = mac80211_hwsim_sta_set_scs, \ CFG80211_TESTMODE_CMD(mac80211_hwsim_testmode_cmd) \ .ampdu_action = mac80211_hwsim_ampdu_action, \ .flush = mac80211_hwsim_flush, \ @@ -4698,7 +4716,8 @@ static const struct ieee80211_sband_iftype_data sband_capa_2ghz[] = { .mac_cap_info[0] = IEEE80211_EHT_MAC_CAP0_EPCS_PRIO_ACCESS | IEEE80211_EHT_MAC_CAP0_OM_CONTROL | - IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE1, + IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE1 | + IEEE80211_EHT_MAC_CAP0_SCS_TRAFFIC_DESC, .phy_cap_info[0] = IEEE80211_EHT_PHY_CAP0_242_TONE_RU_GT20MHZ | IEEE80211_EHT_PHY_CAP0_NDP_4_EHT_LFT_32_GI | @@ -4994,7 +5013,8 @@ static const struct ieee80211_sband_iftype_data sband_capa_5ghz[] = { .mac_cap_info[0] = IEEE80211_EHT_MAC_CAP0_EPCS_PRIO_ACCESS | IEEE80211_EHT_MAC_CAP0_OM_CONTROL | - IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE1, + IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE1 | + IEEE80211_EHT_MAC_CAP0_SCS_TRAFFIC_DESC, .phy_cap_info[0] = IEEE80211_EHT_PHY_CAP0_242_TONE_RU_GT20MHZ | IEEE80211_EHT_PHY_CAP0_NDP_4_EHT_LFT_32_GI | @@ -5337,7 +5357,8 @@ static const struct ieee80211_sband_iftype_data sband_capa_6ghz[] = { .mac_cap_info[0] = IEEE80211_EHT_MAC_CAP0_EPCS_PRIO_ACCESS | IEEE80211_EHT_MAC_CAP0_OM_CONTROL | - IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE1, + IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE1 | + IEEE80211_EHT_MAC_CAP0_SCS_TRAFFIC_DESC, .phy_cap_info[0] = IEEE80211_EHT_PHY_CAP0_320MHZ_IN_6GHZ | IEEE80211_EHT_PHY_CAP0_242_TONE_RU_GT20MHZ | @@ -6015,6 +6036,8 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_ASSOC_FRAME_ENCRYPTION); wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_UPDATE_BEACON); + wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_SCS); + wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_MSCS); hw->wiphy->interface_modes = param->iftypes; @@ -6204,6 +6227,8 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, &hwsim_fops_group); debugfs_create_file("rx_rssi", 0666, data->debugfs, data, &hwsim_fops_rx_rssi); + debugfs_create_u16("scs_status", 0600, data->debugfs, + &data->scs_status); if (!data->use_chanctx) debugfs_create_file("dfs_simulate_radar", 0222, data->debugfs, -- git-series 0.9.1