Linux wireless drivers development
 help / color / mirror / Atom feed
From: Ria Thomas <ria.thomas@morsemicro.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, lachlan.hodges@morsemicro.com,
	arien.judge@morsemicro.com, pradeep.reddy@morsemicro.com,
	simon@morsemicro.com, Ria Thomas <ria.thomas@morsemicro.com>
Subject: [PATCH wireless-next v2 2/3] wifi: mac80211: track S1G Response Indication (RI) and notify drivers
Date: Tue,  9 Dec 2025 11:54:23 +0530	[thread overview]
Message-ID: <20251209062424.3926297-3-ria.thomas@morsemicro.com> (raw)
In-Reply-To: <20251209062424.3926297-1-ria.thomas@morsemicro.com>

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 <ria.thomas@morsemicro.com>
---

v1 -> v2
- fixed kernel doc
---
 include/linux/ieee80211-s1g.h | 14 ++++++++++++++
 include/net/mac80211.h        |  5 +++++
 net/mac80211/cfg.c            | 18 ++++++++++++++++++
 net/mac80211/link.c           |  1 +
 net/mac80211/util.c           |  3 +++
 5 files changed, 41 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..89084ae46d26 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -365,6 +365,7 @@ struct ieee80211_vif_chanctx_switch {
  * @BSS_CHANGED_MLD_VALID_LINKS: MLD valid links status changed.
  * @BSS_CHANGED_MLD_TTLM: negotiated TID to link mapping was changed
  * @BSS_CHANGED_TPE: transmit power envelope changed
+ * @BSS_CHANGED_S1G_RI: S1G response indication type changed
  */
 enum ieee80211_bss_change {
 	BSS_CHANGED_ASSOC		= 1<<0,
@@ -402,6 +403,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 */
 };
@@ -760,6 +762,8 @@ struct ieee80211_parsed_tpe {
  *	(as opposed to hearing its value from another link's beacon).
  * @s1g_long_beacon_period: number of beacon intervals between each long
  *	beacon transmission.
+ * @s1g_ri: Response indication type expected for the frame sent on this
+ *	BSS
  */
 struct ieee80211_bss_conf {
 	struct ieee80211_vif *vif;
@@ -861,6 +865,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


  parent reply	other threads:[~2025-12-09  6:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-09  6:24 [PATCH wireless-next v2 0/3] wifi: add S1G response indication configuration with NDP BA support Ria Thomas
2025-12-09  6:24 ` [PATCH wireless-next v2 1/3] wifi: cfg80211: Add support for S1G Response Indication Configuration Ria Thomas
2026-01-08 12:27   ` Johannes Berg
2026-01-09  4:00     ` Ria Thomas
2026-01-13  8:50       ` Johannes Berg
2026-01-16  5:31         ` Ria Thomas
2026-02-06  6:11         ` Ria Thomas
2026-02-06  7:57           ` Johannes Berg
2026-02-12  8:43             ` Ria Thomas
2026-02-17 11:41               ` Johannes Berg
2025-12-09  6:24 ` Ria Thomas [this message]
2025-12-09  6:24 ` [PATCH wireless-next v2 3/3] wifi: mac80211: add support for NDP ADDBA/DELBA for S1G Ria Thomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251209062424.3926297-3-ria.thomas@morsemicro.com \
    --to=ria.thomas@morsemicro.com \
    --cc=arien.judge@morsemicro.com \
    --cc=johannes@sipsolutions.net \
    --cc=lachlan.hodges@morsemicro.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pradeep.reddy@morsemicro.com \
    --cc=simon@morsemicro.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox