* [PATCH] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x @ 2026-07-28 10:35 Georgi Valkov 2026-07-30 2:16 ` Jeff Chen 0 siblings, 1 reply; 12+ messages in thread From: Georgi Valkov @ 2026-07-28 10:35 UTC (permalink / raw) To: briannorris Cc: francesco, johannes.berg, kees, miriam.rachel.korenblit, wenst, rafael.beims, avraham.stern, peddolla.reddy, error27, s.kerkmann, linux-wireless, linux-kernel, 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. 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> --- Please backport to 6.18, which is used by OpenWrt. And let me know if there is a better approach to address this. 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..04f7f58cc7d0 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,wrt3200acm") && + !of_machine_is_compatible("linksys,wrt32x") && regulatory_hint(wiphy, country_code)) mwifiex_dbg(priv->adapter, ERROR, "regulatory_hint() failed\n"); -- 2.55.0 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x 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 0 siblings, 1 reply; 12+ messages in thread From: Jeff Chen @ 2026-07-30 2:16 UTC (permalink / raw) To: Georgi Valkov Cc: briannorris, francesco, johannes.berg, kees, miriam.rachel.korenblit, wenst, rafael.beims, avraham.stern, peddolla.reddy, error27, s.kerkmann, linux-wireless, linux-kernel, stable On Tue, Jul 28, 2026 at 01:35:36 PM +0300, Georgi Valkov wrote: > 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 Hi Georgi, Thanks for the patch. I have a question about these compatible strings: > if (country_code && > + !of_machine_is_compatible("linksys,wrt3200acm") && > + !of_machine_is_compatible("linksys,wrt32x") && I checked the mainline kernel source, but these names are not found in the DTS files under arch/arm/boot/dts/marvell/. Instead, mainline uses "linksys,rango" and "linksys,venom". As a result, this machine check will always fail on a pure mainline kernel, making the quirk ineffective. Jeff ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x 2026-07-30 2:16 ` Jeff Chen @ 2026-07-30 3:06 ` George Valkov 2026-07-30 3:24 ` George Valkov 0 siblings, 1 reply; 12+ messages in thread From: George Valkov @ 2026-07-30 3:06 UTC (permalink / raw) To: Jeff Chen Cc: briannorris, francesco, johannes.berg, kees, miriam.rachel.korenblit, wenst, rafael.beims, avraham.stern, peddolla.reddy, error27, s.kerkmann, linux-wireless, linux-kernel, stable Hi Jeff, Initially I wanted to keep changes easy to read and as simple as possible, hence my current patch is based on device names. Indeed out openwrt-ai also caught this: https://github.com/openwrt/openwrt/pull/24458#pullrequestreview-4803923901 I've been thinking about possible options: 1. Use board names "linksys,rango" and "linksys,venom", where rango is WRT3200ACM, and venom is WRT32x. But a venom dts is also not available in Linux. We do have it in OpenWrt: https://github.com/openwrt/openwrt/blob/main/target/linux/mvebu/files /arch/arm/boot/dts/marvell/armada-385-linksys-venom.dts 2. We could either ignore this or 3. Have another PR with venom board support files, but that will require much more research and work. I don't have WRT32x hardware, and I'm uncomfortable doing this without supervision. 4. We can also implement a dts flag, e.g. ignore_reg_hint, which can be set in the board dts. This might be the best and most flexible option. My experience with dts is almost zero and I will need help to implement it. Georgi On Thu, 30 Jul 2026 at 05:17, Jeff Chen <chunfan.chen@gmail.com> wrote: > > On Tue, Jul 28, 2026 at 01:35:36 PM +0300, Georgi Valkov wrote: > > 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 > > Hi Georgi, > > Thanks for the patch. I have a question about these compatible strings: > > > if (country_code && > > + !of_machine_is_compatible("linksys,wrt3200acm") && > > + !of_machine_is_compatible("linksys,wrt32x") && > > I checked the mainline kernel source, but these names are not found > in the DTS files under arch/arm/boot/dts/marvell/. Instead, mainline uses > "linksys,rango" and "linksys,venom". > > As a result, this machine check will always fail on a pure mainline kernel, > making the quirk ineffective. > > Jeff ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x 2026-07-30 3:06 ` George Valkov @ 2026-07-30 3:24 ` George Valkov 2026-07-30 7:47 ` Jeff Chen 0 siblings, 1 reply; 12+ messages in thread From: George Valkov @ 2026-07-30 3:24 UTC (permalink / raw) To: Jeff Chen Cc: briannorris, francesco, johannes.berg, kees, miriam.rachel.korenblit, wenst, rafael.beims, avraham.stern, peddolla.reddy, error27, s.kerkmann, linux-wireless, linux-kernel, stable Hi Jeff, I forgot to mention: The compatibile strings are added by this OpenWrt patch: https://github.com/openwrt/openwrt/blob/main/target/linux/mvebu/patches-6.18/ 311-adjust-compatible-for-linksys.patch So unless we also upstream this patch, using device names will work only on OpenWrt, which would make the current patch ineffective. Georgi On Thu, 30 Jul 2026 at 06:06, George Valkov <gvalkov@gmail.com> wrote: > > Hi Jeff, > Initially I wanted to keep changes easy to read and as simple as possible, > hence my current patch is based on device names. > > Indeed out openwrt-ai also caught this: > https://github.com/openwrt/openwrt/pull/24458#pullrequestreview-4803923901 > > I've been thinking about possible options: > 1. Use board names "linksys,rango" and "linksys,venom", where > rango is WRT3200ACM, and venom is WRT32x. But a venom dts > is also not available in Linux. We do have it in OpenWrt: > https://github.com/openwrt/openwrt/blob/main/target/linux/mvebu/files > /arch/arm/boot/dts/marvell/armada-385-linksys-venom.dts > 2. We could either ignore this or > 3. Have another PR with venom board support files, but that will require > much more research and work. I don't have WRT32x hardware, and I'm > uncomfortable doing this without supervision. > 4. We can also implement a dts flag, e.g. ignore_reg_hint, which can be > set in the board dts. This might be the best and most flexible option. > My experience with dts is almost zero and I will need help to implement > it. > > Georgi > > On Thu, 30 Jul 2026 at 05:17, Jeff Chen <chunfan.chen@gmail.com> wrote: > > > > On Tue, Jul 28, 2026 at 01:35:36 PM +0300, Georgi Valkov wrote: > > > 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 > > > > Hi Georgi, > > > > Thanks for the patch. I have a question about these compatible strings: > > > > > if (country_code && > > > + !of_machine_is_compatible("linksys,wrt3200acm") && > > > + !of_machine_is_compatible("linksys,wrt32x") && > > > > I checked the mainline kernel source, but these names are not found > > in the DTS files under arch/arm/boot/dts/marvell/. Instead, mainline uses > > "linksys,rango" and "linksys,venom". > > > > As a result, this machine check will always fail on a pure mainline kernel, > > making the quirk ineffective. > > > > Jeff ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x 2026-07-30 3:24 ` George Valkov @ 2026-07-30 7:47 ` Jeff Chen 2026-07-31 6:31 ` [PATCH v2] " Georgi Valkov 0 siblings, 1 reply; 12+ messages in thread From: Jeff Chen @ 2026-07-30 7:47 UTC (permalink / raw) To: George Valkov Cc: Jeff Chen, briannorris, francesco, johannes.berg, kees, miriam.rachel.korenblit, wenst, rafael.beims, avraham.stern, peddolla.reddy, error27, s.kerkmann, linux-wireless, linux-kernel, stable On Thu, Jul 30, 2026 at 06:24:15 AM +0300, George Valkov wrote: > Hi Jeff, I forgot to mention: > The compatibile strings are added by this OpenWrt patch: > https://github.com/openwrt/openwrt/blob/main/target/linux/mvebu/patches-6.18/ > 311-adjust-compatible-for-linksys.patch > > So unless we also upstream this patch, using device names will work > only on OpenWrt, which would make the current patch ineffective. > > Georgi > > On Thu, 30 Jul 2026 at 06:06, George Valkov <gvalkov@gmail.com> wrote: > > > > Hi Jeff, > > Initially I wanted to keep changes easy to read and as simple as possible, > > hence my current patch is based on device names. > > > > Indeed out openwrt-ai also caught this: > > https://github.com/openwrt/openwrt/pull/24458#pullrequestreview-4803923901 > > > > I've been thinking about possible options: > > 1. Use board names "linksys,rango" and "linksys,venom", where > > rango is WRT3200ACM, and venom is WRT32x. But a venom dts > > is also not available in Linux. We do have it in OpenWrt: > > https://github.com/openwrt/openwrt/blob/main/target/linux/mvebu/files > > /arch/arm/boot/dts/marvell/armada-385-linksys-venom.dts > > 2. We could either ignore this or > > 3. Have another PR with venom board support files, but that will require > > much more research and work. I don't have WRT32x hardware, and I'm > > uncomfortable doing this without supervision. > > 4. We can also implement a dts flag, e.g. ignore_reg_hint, which can be > > set in the board dts. This might be the best and most flexible option. > > My experience with dts is almost zero and I will need help to implement > > it. > > > > Georgi > > Hi Georgi, Thanks for the update. My recommendation aligns with openwrt-ai's suggestion. In general, checking board-specific DT strings inside a generic driver is not a good idea. However, since implementing a new DT flag or module parameter requires deeper driver architectural changes, expanding the list of compatible strings is a more pragmatic way considering these are legacy devices. You can update the check to include all four strings for V2: if (country_code && !of_machine_is_compatible("linksys,rango") && !of_machine_is_compatible("linksys,wrt3200acm") && !of_machine_is_compatible("linksys,venom") && !of_machine_is_compatible("linksys,wrt32x") && regulatory_hint(wiphy, country_code)) Combining these four strings ensures the patch works in both pure mainline and OpenWrt environments. We should still wait for feedback from the maintainers or other reviewers to see if they prefer this hardcoded approach or a proper module/DT property. Jeff ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x 2026-07-30 7:47 ` Jeff Chen @ 2026-07-31 6:31 ` Georgi Valkov 2026-08-07 8:26 ` Jeff Chen 0 siblings, 1 reply; 12+ messages in thread From: Georgi Valkov @ 2026-07-31 6:31 UTC (permalink / raw) To: briannorris, chunfan.chen Cc: francesco, johannes.berg, kees, miriam.rachel.korenblit, wenst, rafael.beims, avraham.stern, peddolla.reddy, error27, s.kerkmann, linux-wireless, linux-kernel, 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. 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 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v2] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x 2026-07-31 6:31 ` [PATCH v2] " Georgi Valkov @ 2026-08-07 8:26 ` Jeff Chen 2026-08-07 18:21 ` [PATCH v3 1/2] " Georgi Valkov 0 siblings, 1 reply; 12+ messages in thread From: Jeff Chen @ 2026-08-07 8:26 UTC (permalink / raw) To: Georgi Valkov Cc: briannorris, chunfan.chen, francesco, johannes.berg, kees, miriam.rachel.korenblit, wenst, rafael.beims, avraham.stern, peddolla.reddy, error27, s.kerkmann, linux-wireless, linux-kernel, stable On Fri, Jul 31, 2026 at 09:31:18 AM +0300, Georgi Valkov wrote: > 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> > --- Hi Georgi, Thanks for the V2. The updated strings now match both environments. However, checking board-specific DT strings inside a generic peripheral driver is still not a good idea. Since you asked about a better approach, why not consider the solution mentioned by openwrt-ai using the "reg_alpha2" module parameter? If OpenWrt injects "reg_alpha2=00" via a modprobe conf file under target/linux/mvebu/, the ROM regulatory hint can be overridden from userspace without needing any hardcoded logic inside the upstream driver. Best regards, Jeff ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v3 1/2] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x 2026-08-07 8:26 ` Jeff Chen @ 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; 12+ 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] 12+ 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] " 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; 12+ 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] 12+ 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] " 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; 12+ 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] 12+ 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 2026-08-10 18:30 ` Brian Norris 0 siblings, 1 reply; 12+ 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] 12+ messages in thread
* Re: [PATCH v3 1/2] wifi: mwifiex: ignore ROM regulatory hint on WRT3200ACM/WRT32x 2026-08-07 19:49 ` George Valkov @ 2026-08-10 18:30 ` Brian Norris 0 siblings, 0 replies; 12+ messages in thread From: Brian Norris @ 2026-08-10 18:30 UTC (permalink / raw) To: George Valkov Cc: Johannes Berg, sashiko-bot, 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 On Fri, Aug 07, 2026 at 10:49:40PM +0300, George Valkov wrote: > 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. Johannes is asking about the binding documentation (.txt or .yaml), not the .c (driver) or .dts/.dtsi files. You haven't included "marvell,ignore-regulatory-hint" in any valid binding document, so it's not a valid property to use in this driver. See Documentation/devicetree/bindings/net/wireless/marvell,sd8787.yaml for the correct binding file relevant to this driver. > 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. I'm not sure what you're saying here. Device Tree Blobs are inherently a per-board object. The question here is simply where within the Device Tree we want to add a property. I believe that you're describing problems with the radio, and so you should add DT properties to the node for the radio(s) in question, not the root node. > Also my attempts to use per device nodes or the parent always > return false so they are not usable. That seems like something you need to figure out. Just because you found it difficult doesn't mean we should accept the wrong approach. IIUC, you're using a PCIe-based WiFi card, and that's enabled in arch/arm/boot/dts/marvell/armada-385-linksys.dtsi: &pcie1 { /* Marvell 88W8864, 5GHz-only */ status = "okay"; }; &pcie2 { /* Marvell 88W8864, 2GHz-only */ status = "okay"; }; I think those are the "port" nodes, and there currently is no node that actually represents the PCIe endpoint device (i.e., your wifi cards). You need to add those as children, like: &pcie1 { ... wifi@0 { compatible = "pciXXXX,YYYY"; /* figure out the appropriate IDs here */ marvell,ignore-regulatory-hint; ... }; }; ... > 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. I think if you stop using 'of_root', you'll dodge this problem. And you should not be looking at of_root. > 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? Documentation/devicetree/bindings/net/wireless/marvell,sd8787.yaml. See the other hints above too. Side question: did you consider Jeff's suggestion from v2, to try the 'reg_alpha2' module param? It might already do what you need, and it only requires you configure your OpenWrt builds properly, I think. Brian > 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] 12+ messages in thread
end of thread, other threads:[~2026-08-10 18:30 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 ` [PATCH v2] " Georgi Valkov 2026-08-07 8:26 ` Jeff Chen 2026-08-07 18:21 ` [PATCH v3 1/2] " 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 2026-08-10 18:30 ` Brian Norris
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox