Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH wireless-next v2] wifi: cfg80211: init S1G properly when creating chandef
@ 2026-03-11  6:43 Lachlan Hodges
  2026-03-11  9:55 ` Johannes Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Lachlan Hodges @ 2026-03-11  6:43 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, arien.judge, Lachlan Hodges

When creating a chandef, the initial width is determined by the
chan_type argument leading to a default width of 20/20_NOHT/40 which
does not make sense for S1G channels. Fix this by ensuring we default
S1G chandefs to a width of 1MHz.

Signed-off-by: Lachlan Hodges <lachlan.hodges@morsemicro.com>
---
v1 -> v2:

- Remove the mac80211-based wording in the commit message and keep it
  simple.
---
 net/wireless/chan.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index 68221b1ab45e..c0c0151fe55f 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -32,6 +32,12 @@ void cfg80211_chandef_create(struct cfg80211_chan_def *chandef,
 		.freq1_offset = chan->freq_offset,
 	};
 
+	if (cfg80211_chandef_is_s1g(chandef)) {
+		chandef->width = NL80211_CHAN_WIDTH_1;
+		chandef->center_freq1 = chan->center_freq;
+		return;
+	}
+
 	switch (chan_type) {
 	case NL80211_CHAN_NO_HT:
 		chandef->width = NL80211_CHAN_WIDTH_20_NOHT;
-- 
2.43.0


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

end of thread, other threads:[~2026-03-11 11:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-11  6:43 [PATCH wireless-next v2] wifi: cfg80211: init S1G properly when creating chandef Lachlan Hodges
2026-03-11  9:55 ` Johannes Berg
2026-03-11 10:21   ` Lachlan Hodges
2026-03-11 10:56     ` Johannes Berg
2026-03-11 11:07       ` Johannes Berg
2026-03-11 11:48       ` Lachlan Hodges
2026-03-11 11:55         ` Johannes Berg

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