From: Lachlan Hodges <lachlan.hodges@morsemicro.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, arien.judge@morsemicro.com,
Lachlan Hodges <lachlan.hodges@morsemicro.com>
Subject: [PATCH wireless-next] wifi: cfg80211: init S1G properly when creating chandef
Date: Wed, 11 Mar 2026 17:18:00 +1100 [thread overview]
Message-ID: <20260311061800.517849-1-lachlan.hodges@morsemicro.com> (raw)
When emulating channel contexts, the first chandef passed to the
driver when starting an interface is the local->dflt_chandef
via ieee80211_calc_hw_conf_chan(). This means that currently an
S1G driver will be given a chandef with a width of 20MHz. This will
lead to either the driver or firmware rejecting this configuration
and a non-zero ret code - leading to a WARN within
ieee80211_hw_conf_init().
In the case of emulation, ensure we initialise with a width of
1MHz for S1G channels such that the default chandef is valid.
Signed-off-by: Lachlan Hodges <lachlan.hodges@morsemicro.com>
---
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
next reply other threads:[~2026-03-11 6:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-11 6:18 Lachlan Hodges [this message]
2026-03-11 6:24 ` [PATCH wireless-next] wifi: cfg80211: init S1G properly when creating chandef Johannes Berg
2026-03-11 6:27 ` Lachlan Hodges
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=20260311061800.517849-1-lachlan.hodges@morsemicro.com \
--to=lachlan.hodges@morsemicro.com \
--cc=arien.judge@morsemicro.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/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