forked from openwrt/openwrt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mwlwifi: fix compilation with 6.6 and 64-bit
Upstream patch updated to fix kernel 6.6 compilation. It was also split up into 5. Do the same here. The patches are taken from this upstreasm PR: kaloz/mwlwifi#413 Renamed other patches so as to not overlap. Signed-off-by: Rosen Penev <[email protected]> Link: openwrt#15452 Signed-off-by: Hauke Mehrtens <[email protected]>
- Loading branch information
Showing
9 changed files
with
166 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
165 changes: 0 additions & 165 deletions
165
package/kernel/mwlwifi/patches/001-Fix-compilation-warning-with-64-bit-system.patch
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
...e/kernel/mwlwifi/patches/001-Simplify-coredump-memcpy-in-mwl_fwcmd_get_fw_core_dump.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
From 8daab38dfc1fe4d3df9fb5fc18610b942d5cc3b2 Mon Sep 17 00:00:00 2001 | ||
From: Christian Marangi <[email protected]> | ||
Date: Sun, 12 May 2024 14:28:19 +0200 | ||
Subject: [PATCH] Simplify coredump memcpy in mwl_fwcmd_get_fw_core_dump | ||
|
||
Simplify coredump memcpy in mwl_fwcmd_get_fw_core_dump. Instead of doing | ||
fragile address additions, just access the buffer member in pcmd and | ||
reference the pointer. | ||
|
||
This fix a compilation warning in 64Bit system: | ||
|
||
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/fwcmd.c: In function 'mwl_fwcmd_get_fw_core_dump': /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/fwcmd.c:3608:31: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] | ||
3608 | (const void *)((u32)pcmd + | ||
| ^ | ||
|
||
Signed-off-by: Christian Marangi <[email protected]> | ||
--- | ||
hif/fwcmd.c | 6 +----- | ||
1 file changed, 1 insertion(+), 5 deletions(-) | ||
|
||
--- a/hif/fwcmd.c | ||
+++ b/hif/fwcmd.c | ||
@@ -3622,11 +3622,7 @@ int mwl_fwcmd_get_fw_core_dump(struct ie | ||
core_dump->context = pcmd->cmd_data.coredump.context; | ||
core_dump->size_kb = pcmd->cmd_data.coredump.size_kb; | ||
core_dump->flags = pcmd->cmd_data.coredump.flags; | ||
- memcpy(buff, | ||
- (const void *)((u32)pcmd + | ||
- sizeof(struct hostcmd_cmd_get_fw_core_dump) - | ||
- sizeof(struct hostcmd_cmd_get_fw_core_dump_)), | ||
- MAX_CORE_DUMP_BUFFER); | ||
+ memcpy(buff, pcmd->buffer, MAX_CORE_DUMP_BUFFER); | ||
|
||
mutex_unlock(&priv->fwcmd_mutex); | ||
|
32 changes: 32 additions & 0 deletions
32
package/kernel/mwlwifi/patches/002-Correctly-use-PTR_ERR-in-pcie_bf_mimo_ctrl_decode.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
From 37c7a798719f1d04326d36c35711c4249bc7492e Mon Sep 17 00:00:00 2001 | ||
From: Christian Marangi <[email protected]> | ||
Date: Sun, 12 May 2024 14:32:20 +0200 | ||
Subject: [PATCH] Correctly use PTR_ERR in pcie_bf_mimo_ctrl_decode | ||
|
||
Correctly use PTR_ERR instead of cast to unsigned int in | ||
pcie_bf_mimo_ctrl_decode if fp_data pointer contains errors. | ||
|
||
This fix a compilation warning on 64Bit: | ||
|
||
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/pcie.c:1325:37: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] | ||
1325 | filename, (unsigned int)fp_data); | ||
| ^ | ||
|
||
Signed-off-by: Christian Marangi <[email protected]> | ||
--- | ||
hif/pcie/pcie.c | 4 ++-- | ||
1 file changed, 2 insertions(+), 2 deletions(-) | ||
|
||
--- a/hif/pcie/pcie.c | ||
+++ b/hif/pcie/pcie.c | ||
@@ -1466,8 +1466,8 @@ static void pcie_bf_mimo_ctrl_decode(str | ||
&fp_data->f_pos); | ||
filp_close(fp_data, current->files); | ||
} else { | ||
- wiphy_err(priv->hw->wiphy, "Error opening %s! %x\n", | ||
- filename, (unsigned int)fp_data); | ||
+ wiphy_err(priv->hw->wiphy, "Error opening %s! %ld\n", | ||
+ filename, PTR_ERR(fp_data)); | ||
} | ||
|
||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0) |
36 changes: 36 additions & 0 deletions
36
package/kernel/mwlwifi/patches/003-Use-zu-and-zd-for-ssize_t-and-size_t.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
From 5fe83bd36c035099a6d721a8e42cf3d04a1ce2b6 Mon Sep 17 00:00:00 2001 | ||
From: Christian Marangi <[email protected]> | ||
Date: Sun, 12 May 2024 14:36:32 +0200 | ||
Subject: [PATCH] Use %zu and %zd for ssize_t and size_t | ||
|
||
Use %zu and %zu for ssize_t and size_t to fix compilation warning on | ||
64Bit. | ||
|
||
Signed-off-by: Christian Marangi <[email protected]> | ||
--- | ||
debugfs.c | 2 +- | ||
hif/pcie/8964/tx_ndp.c | 2 +- | ||
2 files changed, 2 insertions(+), 2 deletions(-) | ||
|
||
--- a/debugfs.c | ||
+++ b/debugfs.c | ||
@@ -1342,7 +1342,7 @@ done: | ||
priv->reg_value); | ||
else | ||
len += scnprintf(p + len, size - len, | ||
- "error: %d(%u 0x%08x 0x%08x)\n", | ||
+ "error: %zd(%u 0x%08x 0x%08x)\n", | ||
ret, priv->reg_type, priv->reg_offset, | ||
priv->reg_value); | ||
|
||
--- a/hif/pcie/8964/tx_ndp.c | ||
+++ b/hif/pcie/8964/tx_ndp.c | ||
@@ -336,7 +336,7 @@ int pcie_tx_init_ndp(struct ieee80211_hw | ||
|
||
if (sizeof(struct pcie_tx_ctrl_ndp) > | ||
sizeof(tx_info->driver_data)) { | ||
- wiphy_err(hw->wiphy, "driver data is not enough: %d (%d)\n", | ||
+ wiphy_err(hw->wiphy, "driver data is not enough: %zu (%zu)\n", | ||
sizeof(struct pcie_tx_ctrl_ndp), | ||
sizeof(tx_info->driver_data)); | ||
return -ENOMEM; |
28 changes: 28 additions & 0 deletions
28
...kernel/mwlwifi/patches/004-Fix-debugfs-compilation-warning-in-mwl_debugfs_info_read.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
From 44419b1feae3eedda21cdc71da9acb611ca1a6fd Mon Sep 17 00:00:00 2001 | ||
From: Christian Marangi <[email protected]> | ||
Date: Sun, 12 May 2024 14:42:01 +0200 | ||
Subject: [PATCH] Fix debugfs compilation warning in mwl_debugfs_info_read | ||
|
||
Fix debugfs compilation warning on 64Bit mwl_debugfs_info_read by | ||
casing for uintptr_t and use %zx. | ||
|
||
Signed-off-by: Christian Marangi <[email protected]> | ||
--- | ||
debugfs.c | 4 ++-- | ||
1 file changed, 2 insertions(+), 2 deletions(-) | ||
|
||
--- a/debugfs.c | ||
+++ b/debugfs.c | ||
@@ -364,10 +364,10 @@ static ssize_t mwl_debugfs_info_read(str | ||
"-----------------------=> address| address|qlen|fw_desc_cnt\n"); | ||
spin_lock_irqsave(&pcie_priv->tx_desc_lock, flags); | ||
len += scnprintf(p + len, size - len, | ||
- "wcb_base0 : %x => %8x|%8p|%4d|%d\n", get_hw_spec->wcb_base0, *((unsigned int *)le32_to_cpu(get_hw_spec->wcb_base0)),(void *)*((unsigned int *)le32_to_cpu(get_hw_spec->wcb_base0)),skb_queue_len(&pcie_priv->txq[0]),pcie_priv->fw_desc_cnt[0]); | ||
+ "wcb_base0 : %x => %8px|%8p|%4d|%d\n", get_hw_spec->wcb_base0, (void *)(uintptr_t)le32_to_cpu(get_hw_spec->wcb_base0),(void *)(uintptr_t)le32_to_cpu(get_hw_spec->wcb_base0),skb_queue_len(&pcie_priv->txq[0]),pcie_priv->fw_desc_cnt[0]); | ||
for(i = 0; i < SYSADPT_TOTAL_TX_QUEUES - 1; i++) | ||
len += scnprintf(p + len, size - len, | ||
- "wcb_base[%2d]: %x => %8x|%8p|%4d|%d\n", i, get_hw_spec->wcb_base[i], *((unsigned int *)le32_to_cpu(get_hw_spec->wcb_base[i])),(void *)*((unsigned int *)le32_to_cpu(get_hw_spec->wcb_base[i])),skb_queue_len(&pcie_priv->txq[i + 1]),pcie_priv->fw_desc_cnt[i + 1]); | ||
+ "wcb_base[%2d]: %x => %8px|%8p|%4d|%d\n", i, get_hw_spec->wcb_base[i], (void *)(uintptr_t)le32_to_cpu(get_hw_spec->wcb_base[i]),(void *)(uintptr_t)le32_to_cpu(get_hw_spec->wcb_base[i]),skb_queue_len(&pcie_priv->txq[i + 1]),pcie_priv->fw_desc_cnt[i + 1]); | ||
spin_unlock_irqrestore(&pcie_priv->tx_desc_lock, flags); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
From dba74289f74095944b39fc96b069c512b5321b7a Mon Sep 17 00:00:00 2001 | ||
From: Christian Marangi <[email protected]> | ||
Date: Sun, 12 May 2024 14:53:45 +0200 | ||
Subject: [PATCH] Use BUILD_BUG_ON instead of checking size at runtime for | ||
pcie_tx_init_ndp | ||
|
||
Use BUILD_BUG_ON instead of checking size at runtime for | ||
pcie_tx_init_ndp. | ||
|
||
Signed-off-by: Christian Marangi <[email protected]> | ||
--- | ||
hif/pcie/8964/tx_ndp.c | 9 ++------- | ||
1 file changed, 2 insertions(+), 7 deletions(-) | ||
|
||
--- a/hif/pcie/8964/tx_ndp.c | ||
+++ b/hif/pcie/8964/tx_ndp.c | ||
@@ -334,13 +334,8 @@ int pcie_tx_init_ndp(struct ieee80211_hw | ||
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(&skb); | ||
int rc; | ||
|
||
- if (sizeof(struct pcie_tx_ctrl_ndp) > | ||
- sizeof(tx_info->driver_data)) { | ||
- wiphy_err(hw->wiphy, "driver data is not enough: %zu (%zu)\n", | ||
- sizeof(struct pcie_tx_ctrl_ndp), | ||
- sizeof(tx_info->driver_data)); | ||
- return -ENOMEM; | ||
- } | ||
+ BUILD_BUG_ON(sizeof(struct pcie_tx_ctrl_ndp) > | ||
+ sizeof(tx_info->driver_data)); | ||
|
||
rc = pcie_tx_ring_alloc_ndp(priv); | ||
if (rc) { |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters