S1G STAs advertise a Response Indication (RI) that signals which immediate response (at SIFS) is expected to the eliciting frame. Updates mac80211 to track this configured response indication throughout the device's operation. It ensures that changes are recognized and communicated to the driver layer via BSS_CHANGED_S1G_RI, allowing firmware/hardware to be configured accordingly while also maintaining correct behaviour during interface restarts and ensuring that non-S1G interfaces are unaffected. enum defined for the RI types per IEEE Std 802.11-2024 Table 10-7. Signed-off-by: Ria Thomas --- include/linux/ieee80211-s1g.h | 14 ++++++++++++++ include/net/mac80211.h | 2 ++ net/mac80211/cfg.c | 18 ++++++++++++++++++ net/mac80211/link.c | 1 + net/mac80211/util.c | 3 +++ 5 files changed, 38 insertions(+) diff --git a/include/linux/ieee80211-s1g.h b/include/linux/ieee80211-s1g.h index 5b9ed2dcc00e..df5e37d07bf5 100644 --- a/include/linux/ieee80211-s1g.h +++ b/include/linux/ieee80211-s1g.h @@ -109,6 +109,20 @@ enum ieee80211_s1g_pri_chanwidth { IEEE80211_S1G_PRI_CHANWIDTH_1MHZ = 1, }; +/** + * enum ieee80211_s1g_ri - S1G Response Indication type + * @IEEE80211_S1G_RI_NO_RESPONSE: No immediate response + * @IEEE80211_S1G_RI_NDP_RESPONSE: NDP Ack/CTS/BlockAck + * @IEEE80211_S1G_RI_NORMAL_RESPONSE: Ack/CTS/BlockAck/TACK + * @IEEE80211_S1G_RI_LONG_RESPONSE: Not an individual control response frame + */ +enum ieee80211_s1g_ri { + IEEE80211_S1G_RI_NO_RESPONSE = 0, + IEEE80211_S1G_RI_NDP_RESPONSE = 1, + IEEE80211_S1G_RI_NORMAL_RESPONSE = 2, + IEEE80211_S1G_RI_LONG_RESPONSE = 3, +}; + /** * struct ieee80211_s1g_bcn_compat_ie - S1G Beacon Compatibility element * @compat_info: Compatibility Information diff --git a/include/net/mac80211.h b/include/net/mac80211.h index c2e49542626c..8aa7640bb49f 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -402,6 +402,7 @@ enum ieee80211_bss_change { BSS_CHANGED_MLD_VALID_LINKS = BIT_ULL(33), BSS_CHANGED_MLD_TTLM = BIT_ULL(34), BSS_CHANGED_TPE = BIT_ULL(35), + BSS_CHANGED_S1G_RI = BIT_ULL(36), /* when adding here, make sure to change ieee80211_reconfig */ }; @@ -861,6 +862,7 @@ struct ieee80211_bss_conf { u8 bss_param_ch_cnt_link_id; u8 s1g_long_beacon_period; + enum ieee80211_s1g_ri s1g_ri; }; /** diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index b51c2c8584ae..ae47ae70d36a 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -5533,6 +5533,23 @@ ieee80211_set_epcs(struct wiphy *wiphy, struct net_device *dev, bool enable) return ieee80211_mgd_set_epcs(sdata, enable); } +static int +ieee80211_set_s1g_ri(struct wiphy *wiphy, struct net_device *dev, u8 ri) +{ + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); + + if (!sdata->vif.cfg.s1g) + return -EOPNOTSUPP; + + sdata->vif.bss_conf.s1g_ri = ri; + + if (ieee80211_sdata_running(sdata)) + ieee80211_link_info_change_notify(sdata, &sdata->deflink, + BSS_CHANGED_S1G_RI); + + return 0; +} + const struct cfg80211_ops mac80211_config_ops = { .add_virtual_intf = ieee80211_add_iface, .del_virtual_intf = ieee80211_del_iface, @@ -5649,4 +5666,5 @@ const struct cfg80211_ops mac80211_config_ops = { .get_radio_mask = ieee80211_get_radio_mask, .assoc_ml_reconf = ieee80211_assoc_ml_reconf, .set_epcs = ieee80211_set_epcs, + .set_s1g_ri = ieee80211_set_s1g_ri, }; diff --git a/net/mac80211/link.c b/net/mac80211/link.c index 1e05845872af..4bf8155b4935 100644 --- a/net/mac80211/link.c +++ b/net/mac80211/link.c @@ -109,6 +109,7 @@ void ieee80211_link_init(struct ieee80211_sub_if_data *sdata, link->ap_power_level = IEEE80211_UNSET_POWER_LEVEL; link->user_power_level = sdata->local->user_power_level; link_conf->txpower = INT_MIN; + link_conf->s1g_ri = IEEE80211_S1G_RI_NDP_RESPONSE; wiphy_work_init(&link->csa.finalize_work, ieee80211_csa_finalize_work); diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 0c46009a3d63..309a3a3b9441 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -1960,6 +1960,9 @@ int ieee80211_reconfig(struct ieee80211_local *local) ieee80211_assign_chanctx(local, sdata, link); } + if (sdata->vif.cfg.s1g) + changed |= BSS_CHANGED_S1G_RI; + switch (sdata->vif.type) { case NL80211_IFTYPE_AP_VLAN: case NL80211_IFTYPE_MONITOR: -- 2.25.1