diff options
| author | Daiane Angolini <daiane.angolini@foundries.io> | 2025-07-25 11:13:47 -0300 |
|---|---|---|
| committer | Daiane Angolini <daiane.angolini@foundries.io> | 2025-07-25 12:20:01 -0300 |
| commit | ad8957f11d00960773a014278265db03a2eee2da (patch) | |
| tree | 63c5e07bc977766a233c719bcce42236da4d5493 | |
| parent | 7d7c7e2b25037b20be5d230f33b6fbaee2e94ea0 (diff) | |
| download | meta-freescale-ad8957f11d00960773a014278265db03a2eee2da.tar.gz | |
kernel-module-nxp-wlan: Fix build error
It backports two commits from lf-6.12.3_1.0.0
| ERROR: modpost: "__aeabi_uldivmod" [/fslc/source/scarthgap/build-imx6ullevk-fsl-xwayland-nxp/tmp/work/imx6ullevk-fsl-linux-gnueabi/kernel-module-nxp-wlan/git/git/mlan.ko] undefined!
| ERROR: modpost: "__aeabi_ldivmod" [/fslc/source/scarthgap/build-imx6ullevk-fsl-xwayland-nxp/tmp/work/imx6ullevk-fsl-linux-gnueabi/kernel-module-nxp-wlan/git/git/mlan.ko] undefined!
| ERROR: modpost: "__bad_udelay" [/fslc/source/scarthgap/build-imx6ullevk-fsl-xwayland-nxp/tmp/work/imx6ullevk-fsl-linux-gnueabi/kernel-module-nxp-wlan/git/git/moal.ko] undefined!
Signed-off-by: Daiane Angolini <daiane.angolini@foundries.io>
3 files changed, 138 insertions, 0 deletions
diff --git a/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/mxm_wifiex_fix_build_error_for_64-bit_division.patch b/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/mxm_wifiex_fix_build_error_for_64-bit_division.patch new file mode 100644 index 000000000..06ae7246e --- /dev/null +++ b/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/mxm_wifiex_fix_build_error_for_64-bit_division.patch | |||
| @@ -0,0 +1,105 @@ | |||
| 1 | From b2bcca5c812b654e39d8709070266d6fbf37c121 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Luke Wang <ziniu.wang_1@nxp.com> | ||
| 3 | Date: Tue, 15 Oct 2024 15:49:05 +0800 | ||
| 4 | Subject: [PATCH] mxm_wifiex: fix build error for 64-bit division | ||
| 5 | |||
| 6 | When build on 32-bit platform, error log shows: | ||
| 7 | ERROR: modpost: "__aeabi_uldivmod" [mwifiex/mlan.ko] undefined! | ||
| 8 | ERROR: modpost: "__aeabi_ldivmod" [mwifiex/mlan.ko] undefined! | ||
| 9 | |||
| 10 | 32-bit platform need to use do_div() to support 64-bit division. | ||
| 11 | |||
| 12 | Upstream-Status: Backport [https://github.com/nxp-imx/mwifiex/commit/fd7dd188a1ad7eb8bc110d30815e087362f91d72] | ||
| 13 | |||
| 14 | Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com> | ||
| 15 | --- | ||
| 16 | mlan/mlan_wmm.c | 33 +++++++++++++++++---------------- | ||
| 17 | 1 file changed, 17 insertions(+), 16 deletions(-) | ||
| 18 | |||
| 19 | diff --git a/mlan/mlan_wmm.c b/mlan/mlan_wmm.c | ||
| 20 | index 6da49ea..8815ca5 100644 | ||
| 21 | --- a/mlan/mlan_wmm.c | ||
| 22 | +++ b/mlan/mlan_wmm.c | ||
| 23 | @@ -840,11 +840,11 @@ static raListTbl *wlan_wmm_get_highest_priolist_ptr(pmlan_adapter pmadapter, | ||
| 24 | * | ||
| 25 | * @return byte budget | ||
| 26 | */ | ||
| 27 | -static t_u32 wlan_wmm_get_byte_budget(t_u32 time_budget_us, t_u32 phy_rate_kbps) | ||
| 28 | +static t_u32 wlan_wmm_get_byte_budget(pmlan_adapter pmadapter, t_u32 time_budget_us, t_u32 phy_rate_kbps) | ||
| 29 | { | ||
| 30 | const t_u32 min_budget = MV_ETH_FRAME_LEN; | ||
| 31 | - t_u64 byte_budget = | ||
| 32 | - ((t_u64)phy_rate_kbps * time_budget_us) / (8 * 1000u); | ||
| 33 | + t_u64 byte_budget = pmadapter->callbacks.moal_do_div((t_u64)phy_rate_kbps * time_budget_us, | ||
| 34 | + 8 * 1000u); | ||
| 35 | |||
| 36 | if (byte_budget > INT_MAX) | ||
| 37 | return INT_MAX; | ||
| 38 | @@ -891,7 +891,7 @@ wlan_wmm_allocate_sta_table(pmlan_adapter pmadapter, t_u8 *ra) | ||
| 39 | |||
| 40 | sta_table->budget.time_budget_init_us = pmadapter->init_para.tx_budget; | ||
| 41 | sta_table->budget.byte_budget_init = wlan_wmm_get_byte_budget( | ||
| 42 | - sta_table->budget.time_budget_init_us, default_rate); | ||
| 43 | + pmadapter, sta_table->budget.time_budget_init_us, default_rate); | ||
| 44 | sta_table->budget.queue_packets = default_queue_packets; | ||
| 45 | sta_table->budget.phy_rate_kbps = default_rate; | ||
| 46 | |||
| 47 | @@ -900,14 +900,14 @@ wlan_wmm_allocate_sta_table(pmlan_adapter pmadapter, t_u8 *ra) | ||
| 48 | sta_table->budget.mpdu_no_amsdu_pps_cap = | ||
| 49 | pmadapter->tx_mpdu_no_amsdu_pps; | ||
| 50 | |||
| 51 | - sta_table->budget.mpdu_with_amsdu_budget_init = | ||
| 52 | - ((t_u64)sta_table->budget.mpdu_with_amsdu_pps_cap * | ||
| 53 | - sta_table->budget.time_budget_init_us) / | ||
| 54 | - 1000000; | ||
| 55 | - sta_table->budget.mpdu_no_amsdu_budget_init = | ||
| 56 | - ((t_u64)sta_table->budget.mpdu_no_amsdu_pps_cap * | ||
| 57 | - sta_table->budget.time_budget_init_us) / | ||
| 58 | - 1000000; | ||
| 59 | + sta_table->budget.mpdu_with_amsdu_budget_init = pmadapter->callbacks.moal_do_div( | ||
| 60 | + (t_u64)sta_table->budget.mpdu_with_amsdu_pps_cap * | ||
| 61 | + sta_table->budget.time_budget_init_us, | ||
| 62 | + 1000000); | ||
| 63 | + sta_table->budget.mpdu_no_amsdu_budget_init = pmadapter->callbacks.moal_do_div( | ||
| 64 | + (t_u64)sta_table->budget.mpdu_no_amsdu_pps_cap * | ||
| 65 | + sta_table->budget.time_budget_init_us, | ||
| 66 | + 1000000); | ||
| 67 | |||
| 68 | for (i = 0; i < NELEMENTS(sta_table->budget.bytes); ++i) { | ||
| 69 | sta_table->budget.bytes[i] = sta_table->budget.byte_budget_init; | ||
| 70 | @@ -3142,12 +3142,12 @@ static t_void wlan_wmm_update_queue_packets_budget(pmlan_adapter pmadapter, | ||
| 71 | list_entry, struct wmm_sta_table, active_sta_entry); | ||
| 72 | const t_u64 sta_capacity = sta->budget.byte_budget_init; | ||
| 73 | const t_u32 max_pkts_by_airtime = | ||
| 74 | - wlan_wmm_get_byte_budget(max_pending_tx_time_us, | ||
| 75 | + wlan_wmm_get_byte_budget(pmadapter, max_pending_tx_time_us, | ||
| 76 | sta->budget.phy_rate_kbps) / | ||
| 77 | MV_ETH_FRAME_LEN; | ||
| 78 | + t_u32 sta_share = pmadapter->callbacks.moal_do_div((t_u64)queue_packets_limit * sta_capacity, | ||
| 79 | + total_capacity); | ||
| 80 | |||
| 81 | - t_u32 sta_share = | ||
| 82 | - queue_packets_limit * sta_capacity / total_capacity; | ||
| 83 | sta_share = MAX(sta_share, min_sta_share); | ||
| 84 | sta_share = MIN(sta_share, queue_packets_limit * 7 / 8); | ||
| 85 | sta_share = MIN(sta_share, max_pkts_by_airtime); | ||
| 86 | @@ -5183,6 +5183,7 @@ static void wlan_wmm_adjust_sta_tx_budget(pmlan_private priv, | ||
| 87 | struct wmm_sta_table *sta, | ||
| 88 | HostCmd_TX_RATE_QUERY *rate) | ||
| 89 | { | ||
| 90 | + mlan_adapter *pmadapter = priv->adapter; | ||
| 91 | const t_u8 ppdu_type_legacy = 0; | ||
| 92 | const t_u8 ppdu_type_ht = 1; | ||
| 93 | const t_u8 ppdu_type_vht = 2; | ||
| 94 | @@ -5210,7 +5211,7 @@ static void wlan_wmm_adjust_sta_tx_budget(pmlan_private priv, | ||
| 95 | if (phy_rate > 0) { | ||
| 96 | const t_u32 old_phy_rate = sta->budget.phy_rate_kbps; | ||
| 97 | sta->budget.byte_budget_init = wlan_wmm_get_byte_budget( | ||
| 98 | - sta->budget.time_budget_init_us, phy_rate); | ||
| 99 | + pmadapter, sta->budget.time_budget_init_us, phy_rate); | ||
| 100 | sta->budget.phy_rate_kbps = phy_rate; | ||
| 101 | |||
| 102 | if (old_phy_rate / phy_rate >= 2 || | ||
| 103 | -- | ||
| 104 | 2.25.1 | ||
| 105 | |||
diff --git a/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/mxm_wifiex_fix_build_error_for_udelay.patch b/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/mxm_wifiex_fix_build_error_for_udelay.patch new file mode 100644 index 000000000..ee50f39b4 --- /dev/null +++ b/recipes-kernel/kernel-modules/kernel-module-nxp-wlan/mxm_wifiex_fix_build_error_for_udelay.patch | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | From f45013f26a7045e882e4a0ac99ae126571fa60af Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Luke Wang <ziniu.wang_1@nxp.com> | ||
| 3 | Date: Tue, 15 Oct 2024 15:49:48 +0800 | ||
| 4 | Subject: [PATCH] mxm_wifiex: fix build error for udelay | ||
| 5 | |||
| 6 | When build on 32-bit platform, error log shows: | ||
| 7 | ERROR: modpost: "__bad_udelay" [mwifiex/moal.ko] undefined! | ||
| 8 | |||
| 9 | 32-bit platform udelay has 2000us limition. Split it as workaround. | ||
| 10 | |||
| 11 | Upstream-Status: Backport [https://github.com/nxp-imx/mwifiex/commit/f45013f26a7045e882e4a0ac99ae126571fa60af] | ||
| 12 | |||
| 13 | Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com> | ||
| 14 | --- | ||
| 15 | mlinux/moal_sdio_mmc.c | 3 ++- | ||
| 16 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
| 17 | |||
| 18 | diff --git a/mlinux/moal_sdio_mmc.c b/mlinux/moal_sdio_mmc.c | ||
| 19 | index 746f434..299829e 100644 | ||
| 20 | --- a/mlinux/moal_sdio_mmc.c | ||
| 21 | +++ b/mlinux/moal_sdio_mmc.c | ||
| 22 | @@ -3322,7 +3322,8 @@ static int woal_sdiommc_reset_fw(moal_handle *handle) | ||
| 23 | ret = -EFAULT; | ||
| 24 | goto done; | ||
| 25 | } | ||
| 26 | - udelay(4000); | ||
| 27 | + udelay(2000); | ||
| 28 | + udelay(2000); | ||
| 29 | /** wait SOC fully wake up */ | ||
| 30 | for (tries = 0; tries < MAX_POLL_TRIES; ++tries) { | ||
| 31 | ret = handle->ops.write_reg(handle, reset_reg, 0xba); | ||
diff --git a/recipes-kernel/kernel-modules/kernel-module-nxp-wlan_git.bb b/recipes-kernel/kernel-modules/kernel-module-nxp-wlan_git.bb index e0790bd2d..ece9ff4c2 100644 --- a/recipes-kernel/kernel-modules/kernel-module-nxp-wlan_git.bb +++ b/recipes-kernel/kernel-modules/kernel-module-nxp-wlan_git.bb | |||
| @@ -14,6 +14,8 @@ SRC_URI = " \ | |||
| 14 | ${MRVL_SRC};branch=${SRCBRANCH} \ | 14 | ${MRVL_SRC};branch=${SRCBRANCH} \ |
| 15 | file://wlan_src_driver_patch_release_lf-6.6.52-2.2.0.patch \ | 15 | file://wlan_src_driver_patch_release_lf-6.6.52-2.2.0.patch \ |
| 16 | file://mlinux-moal_main-lower-PRINTM_MMSG-log-level-to-KERN_INFO.patch \ | 16 | file://mlinux-moal_main-lower-PRINTM_MMSG-log-level-to-KERN_INFO.patch \ |
| 17 | file://mxm_wifiex_fix_build_error_for_64-bit_division.patch \ | ||
| 18 | file://mxm_wifiex_fix_build_error_for_udelay.patch \ | ||
| 17 | " | 19 | " |
| 18 | SRCREV = "5ad19e194f49ed9447bee7864eb562618ccaf9b1" | 20 | SRCREV = "5ad19e194f49ed9447bee7864eb562618ccaf9b1" |
| 19 | 21 | ||
