* [PATCH v3 1/2] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x [not found] <anWWr80yAcOQaVVS@nxpwireless-Inspiron-14-Plus-7440> @ 2026-08-07 18:21 ` Georgi Valkov 2026-08-07 18:21 ` [PATCH v3 2/2] ARM: dts: armada: WRT3200ACM: add marvell,ignore-regulatory-hint Georgi Valkov 2026-08-07 18:39 ` [PATCH v3 1/2] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x Johannes Berg 0 siblings, 2 replies; 4+ messages in thread From: Georgi Valkov @ 2026-08-07 18:21 UTC (permalink / raw) To: briannorris, andrew, chunfan.chen Cc: francesco, johannes.berg, kees, miriam.rachel.korenblit, wenst, rafael.beims, avraham.stern, peddolla.reddy, error27, s.kerkmann, gregory.clement, sebastian.hesselbarth, robh, krzk+dt, conor+dt, linux-arm-kernel, linux-wireless, linux-kernel, devicetree, stable, gvalkov 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. Implement a device-tree flag, which allows affected platforms to ignore an incorrect regulatory hint in the ROM, so userspace can set the correct platform regulatory domain. The radios in WRT3200ACM/WRT32x 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 platforms which explicitly define this flag, 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> --- Hi Jeff, I did not consider the idea suggested by openwrt-ai, because I do not understand it and I do not know how to implement it. Any help is welcome! v3: I implemented and tested a better approach with no board specific code: 1. check for a device-tree flag in mwifiex_register_cfg80211in() !of_property_read_bool(of_root, "marvell,ignore-regulatory-hint") 2. 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). 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index abc703441c5d..0239b1c9214b 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -4899,7 +4899,14 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter) country_code = mwifiex_11d_code_2_region( adapter->region_code); + + /* Allow platforms to ignore an incorrect + * regulatory hint from ROM, so userspace + * can set the correct regulatory domain. + */ if (country_code && + !of_property_read_bool(of_root, + "marvell,ignore-regulatory-hint") && regulatory_hint(wiphy, country_code)) mwifiex_dbg(priv->adapter, ERROR, "regulatory_hint() failed\n"); -- 2.55.0 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v3 2/2] ARM: dts: armada: WRT3200ACM: add marvell,ignore-regulatory-hint 2026-08-07 18:21 ` [PATCH v3 1/2] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x Georgi Valkov @ 2026-08-07 18:21 ` Georgi Valkov 2026-08-07 18:39 ` [PATCH v3 1/2] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x Johannes Berg 1 sibling, 0 replies; 4+ messages in thread From: Georgi Valkov @ 2026-08-07 18:21 UTC (permalink / raw) To: briannorris, andrew, chunfan.chen Cc: francesco, johannes.berg, kees, miriam.rachel.korenblit, wenst, rafael.beims, avraham.stern, peddolla.reddy, error27, s.kerkmann, gregory.clement, sebastian.hesselbarth, robh, krzk+dt, conor+dt, linux-arm-kernel, linux-wireless, linux-kernel, devicetree, stable, gvalkov 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. Add a device-tree flag marvell,ignore-regulatory-hint to the WRT3200ACM device-tree, which signals mwifiex to ignore an incorrect regulatory hint in the ROM, so userspace can set the correct platform regulatory domain. The radios in WRT3200ACM/WRT32x 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 Linux kernel sources do not have support for WRT32x. An equivalent patch for these routers has to be sent to OpenWrt. [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> --- arch/arm/boot/dts/marvell/armada-385-linksys-rango.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/marvell/armada-385-linksys-rango.dts b/arch/arm/boot/dts/marvell/armada-385-linksys-rango.dts index 4ab45f294de2..6e283e223ca4 100644 --- a/arch/arm/boot/dts/marvell/armada-385-linksys-rango.dts +++ b/arch/arm/boot/dts/marvell/armada-385-linksys-rango.dts @@ -14,6 +14,7 @@ / { model = "Linksys WRT3200ACM"; compatible = "linksys,rango", "linksys,armada385", "marvell,armada385", "marvell,armada380"; + marvell,ignore-regulatory-hint; }; &expander0 { -- 2.55.0 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v3 1/2] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x 2026-08-07 18:21 ` [PATCH v3 1/2] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x Georgi Valkov 2026-08-07 18:21 ` [PATCH v3 2/2] ARM: dts: armada: WRT3200ACM: add marvell,ignore-regulatory-hint Georgi Valkov @ 2026-08-07 18:39 ` Johannes Berg 2026-08-07 19:49 ` George Valkov 1 sibling, 1 reply; 4+ messages in thread From: Johannes Berg @ 2026-08-07 18:39 UTC (permalink / raw) To: Georgi Valkov, briannorris, andrew, chunfan.chen Cc: francesco, kees, miriam.rachel.korenblit, wenst, rafael.beims, avraham.stern, peddolla.reddy, error27, s.kerkmann, gregory.clement, sebastian.hesselbarth, robh, krzk+dt, conor+dt, linux-arm-kernel, linux-wireless, linux-kernel, devicetree, stable On Fri, 2026-08-07 at 21:21 +0300, Georgi Valkov wrote: > > + /* Allow platforms to ignore an incorrect > + * regulatory hint from ROM, so userspace > + * can set the correct regulatory domain. > + */ > if (country_code && > + !of_property_read_bool(of_root, > + "marvell,ignore-regulatory-hint") && > regulatory_hint(wiphy, country_code)) You're supposed to always update bindings first, no? johannes ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 1/2] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x 2026-08-07 18:39 ` [PATCH v3 1/2] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x Johannes Berg @ 2026-08-07 19:49 ` George Valkov 0 siblings, 0 replies; 4+ messages in thread From: George Valkov @ 2026-08-07 19:49 UTC (permalink / raw) To: Johannes Berg, sashiko-bot Cc: briannorris, andrew, chunfan.chen, francesco, kees, miriam.rachel.korenblit, wenst, rafael.beims, avraham.stern, peddolla.reddy, error27, s.kerkmann, gregory.clement, sebastian.hesselbarth, robh, krzk+dt, conor+dt, linux-arm-kernel, linux-wireless, linux-kernel, devicetree, stable Hello Johannes, and thank you for your quick reply! > You're supposed to always update bindings first, no? To me the logical order is to implement the feature in the driver and then enable it in each board which needs it. For Linux just WRT3200ACM. A separate patch for WRT32x should be sent to OpenWrt. Please let me know if I should reverse the order. Hello Sashiko AI, Yes, I intentionally implemented the flag as a root node. This way the new device-tree property can be reused for the other radios, which use mwlwifi, and also require this fix. It would be inefficient and impractical to define a separate device-tree property for each radio, where it is actually the board that is affected, so it should be a per-board setting. Also my attempts to use per device nodes or the parent always return false so they are not usable. I do not understand the part about dependence on CONFIG_OF. of_property_read_bool() returns false when the flag is not defined. This preserves the original behaviour as if it is set to false, so the feature is disabled. External radios which do not implement support for this flag are not affected. v2 of this PR used of_machine_is_compatible, but there was an objection that this adds platform code to the driver. How can I add binding documentation and where? On Fri, 7 Aug 2026 at 21:39, Johannes Berg <johannes@sipsolutions.net> wrote: > > On Fri, 2026-08-07 at 21:21 +0300, Georgi Valkov wrote: > > > > + /* Allow platforms to ignore an incorrect > > + * regulatory hint from ROM, so userspace > > + * can set the correct regulatory domain. > > + */ > > if (country_code && > > + !of_property_read_bool(of_root, > > + "marvell,ignore-regulatory-hint") && > > regulatory_hint(wiphy, country_code)) > > You're supposed to always update bindings first, no? > > johannes ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-07 19:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <anWWr80yAcOQaVVS@nxpwireless-Inspiron-14-Plus-7440>
2026-08-07 18:21 ` [PATCH v3 1/2] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x Georgi Valkov
2026-08-07 18:21 ` [PATCH v3 2/2] ARM: dts: armada: WRT3200ACM: add marvell,ignore-regulatory-hint Georgi Valkov
2026-08-07 18:39 ` [PATCH v3 1/2] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x Johannes Berg
2026-08-07 19:49 ` George Valkov
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox