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 v3 2/3] wifi: cfg80211: restrict cfg80211_chandef_create() to only HT-based bands
Date: Thu, 12 Mar 2026 15:58:03 +1100 [thread overview]
Message-ID: <20260312045804.362974-3-lachlan.hodges@morsemicro.com> (raw)
In-Reply-To: <20260312045804.362974-1-lachlan.hodges@morsemicro.com>
cfg80211_chandef_create() should only be used by bands that are
HT-based and the chantype argument makes sense. Insert a WARN such
that it isn't used on 60GHz and S1GHz bands and to catch any
potential existing uses by those bands.
Suggested-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Lachlan Hodges <lachlan.hodges@morsemicro.com>
---
net/wireless/chan.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index 68221b1ab45e..4d2c2b9f1eed 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -29,9 +29,11 @@ void cfg80211_chandef_create(struct cfg80211_chan_def *chandef,
*chandef = (struct cfg80211_chan_def) {
.chan = chan,
- .freq1_offset = chan->freq_offset,
};
+ WARN_ON(chan->band == NL80211_BAND_60GHZ ||
+ chan->band == NL80211_BAND_S1GHZ);
+
switch (chan_type) {
case NL80211_CHAN_NO_HT:
chandef->width = NL80211_CHAN_WIDTH_20_NOHT;
--
2.43.0
next prev parent reply other threads:[~2026-03-12 4:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 4:58 [PATCH wireless-next v3 0/3] misc chandef cleanups Lachlan Hodges
2026-03-12 4:58 ` [PATCH wireless-next v3 1/3] wifi: mac80211: don't use cfg80211_chandef_create() for default chandef Lachlan Hodges
2026-03-12 4:58 ` Lachlan Hodges [this message]
2026-03-12 4:58 ` [PATCH wireless-next v3 3/3] wifi: cfg80211: check non-S1G width with S1G chandef Lachlan Hodges
2026-03-12 5:02 ` Lachlan Hodges
2026-03-12 5:06 ` [PATCH wireless-next v3 0/3] misc chandef cleanups Lachlan Hodges
2026-03-13 8:45 ` [syzbot ci] " syzbot ci
2026-03-13 9:05 ` Johannes Berg
2026-03-13 9:48 ` Lachlan Hodges
2026-03-13 11:41 ` Johannes Berg
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=20260312045804.362974-3-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