Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH wireless 0/2] S1G channel fixes
@ 2026-05-06 12:43 Lachlan Hodges
  2026-05-06 12:43 ` [PATCH wireless 1/2] wifi: mac80211: skip NSS and BW init for S1G sta Lachlan Hodges
  2026-05-06 12:43 ` [PATCH wireless 2/2] wifi: mac80211: don't recalc min def for S1G chan ctx Lachlan Hodges
  0 siblings, 2 replies; 3+ messages in thread
From: Lachlan Hodges @ 2026-05-06 12:43 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, arien.judge, Lachlan Hodges

Some recent changes to the STA BW handling now lead to WARNs during
S1G association. These are more or less bandaids that will need to
be fixed in the future hence the TODO.

This will definitely need to be sorted out in the future, even if it's
just a rudimentary implementation especially if we ever want channel
switching and "proper" interop with other vendors such as Newracomm
who have different maximum bandwidths. I've sent these two atleast
while the driver is under review, though I know TODOs can very easily
remain as TODOs 10 years from now...

[1] https://lore.kernel.org/linux-wireless/20251008014006.219605-1-lachlan.hodges@morsemicro.com/

Lachlan Hodges (2):
  wifi: mac80211: skip NSS and BW init for S1G sta
  wifi: mac80211: don't recalc min def for S1G chan ctx

 net/mac80211/chan.c     | 10 ++++++++--
 net/mac80211/sta_info.c | 17 +++++++++++++++++
 2 files changed, 25 insertions(+), 2 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH wireless 1/2] wifi: mac80211: skip NSS and BW init for S1G sta
  2026-05-06 12:43 [PATCH wireless 0/2] S1G channel fixes Lachlan Hodges
@ 2026-05-06 12:43 ` Lachlan Hodges
  2026-05-06 12:43 ` [PATCH wireless 2/2] wifi: mac80211: don't recalc min def for S1G chan ctx Lachlan Hodges
  1 sibling, 0 replies; 3+ messages in thread
From: Lachlan Hodges @ 2026-05-06 12:43 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, arien.judge, Lachlan Hodges

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 <lachlan.hodges@morsemicro.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH wireless 2/2] wifi: mac80211: don't recalc min def for S1G chan ctx
  2026-05-06 12:43 [PATCH wireless 0/2] S1G channel fixes Lachlan Hodges
  2026-05-06 12:43 ` [PATCH wireless 1/2] wifi: mac80211: skip NSS and BW init for S1G sta Lachlan Hodges
@ 2026-05-06 12:43 ` Lachlan Hodges
  1 sibling, 0 replies; 3+ messages in thread
From: Lachlan Hodges @ 2026-05-06 12:43 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, arien.judge, Lachlan Hodges

__ieee80211_recalc_chanctx_min_def() currently does not attempt
to find the min def for S1G widths, meaning the BW will never change.
However, the following call into ieee80211_chan_bw_change() will
lead to a WARN within ieee80211_chan_width_to_rx_bw(). Not only that,
this entire path is geared towards 20MHz based channels, so it doesn't
make sense anyway. For now, return early when calculating the mindef
for S1G channels.

Fixes: d879d4da4579 ("wifi: mac80211: clean up initial STA NSS/bandwidth handling")
Signed-off-by: Lachlan Hodges <lachlan.hodges@morsemicro.com>
---
 net/mac80211/chan.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index b9d563f927da..c64a99131954 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -751,8 +751,14 @@ _ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local,
 				  struct ieee80211_link_data *rsvd_for,
 				  bool check_reserved)
 {
-	u32 changed = __ieee80211_recalc_chanctx_min_def(local, ctx, rsvd_for,
-							 check_reserved);
+	u32 changed;
+
+	/* No recalc for S1G chan ctx's */
+	if (cfg80211_chandef_is_s1g(&ctx->conf.def))
+		return;
+
+	changed = __ieee80211_recalc_chanctx_min_def(local, ctx, rsvd_for,
+						     check_reserved);
 
 	/* check is BW narrowed */
 	ieee80211_chan_bw_change(local, ctx, false, true);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-06 12:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-06 12:43 [PATCH wireless 0/2] S1G channel fixes Lachlan Hodges
2026-05-06 12:43 ` [PATCH wireless 1/2] wifi: mac80211: skip NSS and BW init for S1G sta Lachlan Hodges
2026-05-06 12:43 ` [PATCH wireless 2/2] wifi: mac80211: don't recalc min def for S1G chan ctx Lachlan Hodges

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox