From: Luis <lxluxo23@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: jjohnson@kernel.org, ath12k@lists.infradead.org,
Luis <lxluxo23@gmail.com>
Subject: [PATCH] wifi: ath12k: allow user regulatory hints when firmware reports world domain
Date: Sat, 28 Feb 2026 17:10:23 -0300 [thread overview]
Message-ID: <20260228201023.116947-1-lxluxo23@gmail.com> (raw)
Some WCN7850 firmware versions (e.g. WLAN.HMT.1.1.c5-00284.1) report
alpha2 "00" (world domain) during initialization instead of a valid
country code. When ath12k applies this via regulatory_set_wiphy_regd(),
cfg80211 marks all 5 GHz channels as no-IR, which prevents active
scanning and makes 5 GHz networks completely invisible to userspace.
Without CONFIG_ATH_REG_DYNAMIC_USER_REG_HINTS, the reg_notifier
unconditionally rejects user hints, leaving no way to recover from
the broken world domain without reverting to an older firmware.
Fix this by allowing user hints when the current regulatory domain is
"00". If the firmware has not provided a valid country code, accepting
a user hint via iw reg set lets the driver send a WMI set-country
command to the firmware. The firmware then responds with a proper
WMI_REG_CHAN_LIST_CC event, restoring 5 GHz channel availability.
Once the firmware acknowledges a valid country code, ath12k_regdom_changes()
returns true for "00" and subsequent user hints are blocked again,
preserving the original security intent of the CONFIG guard.
Tested on WCN7850 hw2.0 (ath12k_pci) with linux-firmware
20240318.git3b128b60-0ubuntu2.25 under Ubuntu 24.04 / kernel 6.17.
Signed-off-by: Luis <lxluxo23@gmail.com>
Assisted-by: Claude:claude-sonnet-4-6
---
drivers/net/wireless/ath/ath12k/reg.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/reg.c b/drivers/net/wireless/ath/ath12k/reg.c
index 7898f6981..0c52d559d 100644
--- a/drivers/net/wireless/ath/ath12k/reg.c
+++ b/drivers/net/wireless/ath/ath12k/reg.c
@@ -87,9 +87,20 @@ ath12k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
}
if (!IS_ENABLED(CONFIG_ATH_REG_DYNAMIC_USER_REG_HINTS)) {
- ath12k_dbg(ar->ab, ATH12K_DBG_REG,
- "Country Setting is not allowed\n");
- return;
+ /* Allow user hints when firmware reports world domain ("00").
+ * Some firmware versions default to alpha2 "00" on init, which
+ * causes cfg80211 to mark all 5 GHz channels as no-IR, blocking
+ * active scanning and making 5 GHz networks invisible. When the
+ * firmware has not provided a valid country code, accept a user
+ * hint so the correct regulatory domain can be applied.
+ * Once the firmware responds with a valid country, subsequent
+ * user hints are blocked again as usual.
+ */
+ if (ath12k_regdom_changes(hw, "00")) {
+ ath12k_dbg(ar->ab, ATH12K_DBG_REG,
+ "Country Setting is not allowed\n");
+ return;
+ }
}
if (!ath12k_regdom_changes(hw, request->alpha2)) {
--
2.43.0
reply other threads:[~2026-02-28 20:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260228201023.116947-1-lxluxo23@gmail.com \
--to=lxluxo23@gmail.com \
--cc=ath12k@lists.infradead.org \
--cc=jjohnson@kernel.org \
--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