From e2916408c38be7ee3cadb3ee9218e922dd2b143e Mon Sep 17 00:00:00 2001 From: Gonzalo Ruiz Date: Wed, 2 Jul 2025 18:35:28 +0200 Subject: [PATCH] kernel-module-nxp-wlan: fix automatic regulatory configuration mwifiex driver is not able to automatically download the corresponding rgpower binary after receiving CountryIE beacon information from country XX, so we have to do it manually running "iw reg set XX". However, the driver considers country XX is already configured and ignores the rgpower download request. Fix it by not processing the countryIE information in the driver by adding a patch from NXP that will be integrated in their next official release. https://onedigi.atlassian.net/browse/DEL-8974 Signed-off-by: Gonzalo Ruiz --- ...-do-not-process-countryIE-internally.patch | 47 +++++++++++++++++++ .../kernel-module-nxp-wlan_git.bbappend | 1 + 2 files changed, 48 insertions(+) create mode 100644 meta-digi-arm/dynamic-layers/freescale-layer/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/0001-mxm_wifiex-do-not-process-countryIE-internally.patch diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/0001-mxm_wifiex-do-not-process-countryIE-internally.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/0001-mxm_wifiex-do-not-process-countryIE-internally.patch new file mode 100644 index 000000000..c248dfcd5 --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/0001-mxm_wifiex-do-not-process-countryIE-internally.patch @@ -0,0 +1,47 @@ +From: Gonzalo Ruiz +Date: Fri, 25 Jul 2025 09:44:32 +0200 +Subject: [PATCH 1/1] mxm_wifiex: do not process countryIE internally + +Driver does not support processing countryIE, however when argument +'country_ie_ignore=0' was set, driver could receive and store the +country code but not apply the country power table. + +If a regulatory change was issued afterwards by the user (i.e. iw reg +set) for the same country, change request was ignored and the power +table was still not applied. + +Correct that by ignoring the countryIE when there is a self-managed +wiphy registered. + +Patch provided by NXP. + +Signed-off-by: Gonzalo Ruiz +--- + mlinux/moal_sta_cfg80211.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/mlinux/moal_sta_cfg80211.c b/mlinux/moal_sta_cfg80211.c +index f30134c..32822ac 100644 +--- a/mlinux/moal_sta_cfg80211.c ++++ b/mlinux/moal_sta_cfg80211.c +@@ -1847,6 +1847,20 @@ static int woal_process_country_ie(moal_private *priv, struct cfg80211_bss *bss) + mlan_status status = MLAN_STATUS_SUCCESS; + + ENTER(); ++ ++ if (!priv) { ++ PRINTM(MERROR, "%s(): priv is NULL!\n", __func__); ++ LEAVE(); ++ return 0; ++ } ++#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) ++ if (priv->wdev && priv->wdev->wiphy && ++ (priv->wdev->wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED)) { ++ LEAVE(); ++ return 0; ++ } ++#endif ++ + rcu_read_lock(); + country_ie = (u8 *)ieee80211_bss_get_ie(bss, WLAN_EID_COUNTRY); + if (!country_ie) { diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-kernel/kernel-modules/kernel-module-nxp-wlan_git.bbappend b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-kernel/kernel-modules/kernel-module-nxp-wlan_git.bbappend index c71130c87..33b3b80c9 100644 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-kernel/kernel-modules/kernel-module-nxp-wlan_git.bbappend +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-kernel/kernel-modules/kernel-module-nxp-wlan_git.bbappend @@ -8,6 +8,7 @@ SRC_URI:append = " \ file://watch_regdomain.sh \ file://watch-regdomain.service \ file://watch-regdomain.timer \ + file://0001-mxm_wifiex-do-not-process-countryIE-internally.patch \ " do_install:append () {