From: Georgi Valkov <gvalkov@gmail.com>
To: briannorris@chromium.org, chunfan.chen@gmail.com
Cc: francesco@dolcini.it, johannes.berg@intel.com, kees@kernel.org,
miriam.rachel.korenblit@intel.com, wenst@chromium.org,
rafael.beims@toradex.com, avraham.stern@intel.com,
peddolla.reddy@oss.qualcomm.com, error27@gmail.com,
s.kerkmann@pengutronix.de, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
gvalkov@gmail.com
Subject: [PATCH v2] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x
Date: Fri, 31 Jul 2026 09:31:18 +0300 [thread overview]
Message-ID: <20260731063118.26171-1-gvalkov@gmail.com> (raw)
In-Reply-To: <amsBes9fCF9ZdkCS@nxpwireless-Inspiron-14-Plus-7440>
WRT3200ACM and WRT32x routers always report a fixed US regulatory domain
from the mwifiex ROM, which conflicts with the platform regulatory
configuration on units sold outside the US market. For example:
- phy0 mwlwifi 5 GHz, hard-coded region 98 EU mapped to FR
- phy1 mwlwifi 2.4 GHz, hard-coded region 98 EU mapped to FR
- phy2 mwifiex 2.4 and 5 GHz, hard-coded region US
When the system boots, it detects a conflict between the user selected
region and the radios, e.g. BG FR US, and applies extreme restrictions,
preventing use of 5 GHz and DFS channels. This also affects phy0.
Ignore the incorrect regulatory hint in the ROM of these devices, so
userspace can set the correct platform regulatory domain. These radios
are locked to the hard-coded configuration for which they are certified,
so the only impact is that the region conflict is avoided and the 5 GHz
radios can be used.
The change affects only WRT3200ACM and WRT32x routers, and helps
overcome the incorrect behaviour of proprietary radio firmware.
[1] https://github.com/kaloz/mwlwifi/issues/173#issuecomment-307879699
[2] https://github.com/openwrt/openwrt/issues/9956
Tested-on: WRT3200ACM, OpenWrt
Cc: stable@vger.kernel.org
Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
---
The dts files on Linux use only board names. A patch in OpenWrt adds
device names which are easier to understand. If we want to be compatible
with both, we can either use board names or accept this patch in Linux:
https://github.com/openwrt/openwrt/blob/main/target/linux/mvebu/patches-6.18/
311-adjust-compatible-for-linksys.patch
I implemented and tested a better approach with no board specific code:
- check for a device-tree flag in mwifiex_register_cfg80211in()
!of_property_read_bool(of_root, "marvell,ignore-regulatory-hint")
- add this flag to the root device tree of each affected board
Currently this affects only armada-385-linksys-rango.dts,
because Linux has no dts for venom. OpenWrt will take care of that.
This approach is more flexible and scalable, because the flag can
also be used in other drivers, e.g. mwlwifi (not part of Linux).
Any help is welcome!
v2:
Replace the compatible device names, which are currently only available on
OpenWrt with board names which are available on both Linux and OpenWrt.
drivers/net/wireless/marvell/mwifiex/cfg80211.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index abc703441c5d..ff6a22237a0f 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -4899,7 +4899,15 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
country_code =
mwifiex_11d_code_2_region(
adapter->region_code);
+
+ /* WRT3200ACM/WRT32x ROM always reports US, which
+ * conflicts with routers sold outside the US.
+ * Ignore this hint so userspace can
+ * set the correct regulatory domain.
+ */
if (country_code &&
+ !of_machine_is_compatible("linksys,rango") &&
+ !of_machine_is_compatible("linksys,venom") &&
regulatory_hint(wiphy, country_code))
mwifiex_dbg(priv->adapter, ERROR,
"regulatory_hint() failed\n");
--
2.55.0
prev parent reply other threads:[~2026-07-31 6:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 10:35 [PATCH] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x Georgi Valkov
2026-07-30 2:16 ` Jeff Chen
2026-07-30 3:06 ` George Valkov
2026-07-30 3:24 ` George Valkov
2026-07-30 7:47 ` Jeff Chen
2026-07-31 6:31 ` Georgi Valkov [this message]
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=20260731063118.26171-1-gvalkov@gmail.com \
--to=gvalkov@gmail.com \
--cc=avraham.stern@intel.com \
--cc=briannorris@chromium.org \
--cc=chunfan.chen@gmail.com \
--cc=error27@gmail.com \
--cc=francesco@dolcini.it \
--cc=johannes.berg@intel.com \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=miriam.rachel.korenblit@intel.com \
--cc=peddolla.reddy@oss.qualcomm.com \
--cc=rafael.beims@toradex.com \
--cc=s.kerkmann@pengutronix.de \
--cc=stable@vger.kernel.org \
--cc=wenst@chromium.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