From: Rosen Penev Date: Fri, 10 May 2024 22:55:25 +0000 (-0700) Subject: mwlwifi: fix compilation with 6.6 and 64-bit X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=2d6e433e1d2a3884ed6767ba00f5ed97472c8c3d;p=openwrt%2Fstaging%2Fstintel.git 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: https://github.com/kaloz/mwlwifi/pull/413 Renamed other patches so as to not overlap. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/15452 Signed-off-by: Hauke Mehrtens --- diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile index 94e687ce4a..3f2d5e0949 100644 --- a/package/kernel/mwlwifi/Makefile +++ b/package/kernel/mwlwifi/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mwlwifi -PKG_RELEASE=1 +PKG_RELEASE=2 PKG_LICENSE:=ISC PKG_LICENSE_FILES:= diff --git a/package/kernel/mwlwifi/patches/001-Fix-compilation-warning-with-64-bit-system.patch b/package/kernel/mwlwifi/patches/001-Fix-compilation-warning-with-64-bit-system.patch deleted file mode 100644 index ee64e05047..0000000000 --- a/package/kernel/mwlwifi/patches/001-Fix-compilation-warning-with-64-bit-system.patch +++ /dev/null @@ -1,165 +0,0 @@ -From ed4422e98ababf956674da3438ac42b3aa32c66e Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Wed, 10 May 2023 00:41:06 +0200 -Subject: [PATCH] Fix compilation warning with 64 bit system - -Use %zu and %zd where possible for ssize_t and size_t. -Use PTR_ERR to correctly convert to negative error. -Use universal pointer to support both 32 and 64bit systems. - -Fix compilation warning: -/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 + - | ^ -In file included from ./include/linux/device.h:15, - from /home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/device.h:3, - from ./include/linux/dma-mapping.h:7, - from /home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/dma-mapping.h:3, - from ./include/linux/skbuff.h:31, - from /home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/skbuff.h:3, - from ./include/linux/if_ether.h:19, - from /home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/if_ether.h:3, - from ./include/linux/etherdevice.h:20, - from /home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/etherdevice.h:3, - from /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/tx_ndp.c:20: -/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/tx_ndp.c: In function 'pcie_tx_init_ndp': -/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/tx_ndp.c:338:38: error: format '%d' expects argument of type 'int', but argument 3 has type 'long unsigned int' [-Werror=format=] - 338 | wiphy_err(hw->wiphy, "driver data is not enough: %d (%d)\n", - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap' - 110 | _p_func(dev, fmt, ##__VA_ARGS__); \ - | ^~~ -./include/linux/dev_printk.h:144:56: note: in expansion of macro 'dev_fmt' - 144 | dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__) - | ^~~~~~~ -/home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211/net/cfg80211.h:8828:9: note: in expansion of macro 'dev_err' - 8828 | dev_err(&(wiphy)->dev, format, ##args) - | ^~~~~~~ -/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/tx_ndp.c:338:17: note: in expansion of macro 'wiphy_err' - 338 | wiphy_err(hw->wiphy, "driver data is not enough: %d (%d)\n", - | ^~~~~~~~~ -/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/tx_ndp.c:338:67: note: format string is defined here - 338 | wiphy_err(hw->wiphy, "driver data is not enough: %d (%d)\n", - | ~^ - | | - | int - | %ld -/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/tx_ndp.c:338:38: error: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Werror=format=] - 338 | wiphy_err(hw->wiphy, "driver data is not enough: %d (%d)\n", - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap' - 110 | _p_func(dev, fmt, ##__VA_ARGS__); \ - | ^~~ -./include/linux/dev_printk.h:144:56: note: in expansion of macro 'dev_fmt' - 144 | dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__) - | ^~~~~~~ -/home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211/net/cfg80211.h:8828:9: note: in expansion of macro 'dev_err' - 8828 | dev_err(&(wiphy)->dev, format, ##args) - | ^~~~~~~ -/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/tx_ndp.c:338:17: note: in expansion of macro 'wiphy_err' - 338 | wiphy_err(hw->wiphy, "driver data is not enough: %d (%d)\n", - | ^~~~~~~~~ -/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/tx_ndp.c:338:71: note: format string is defined here - 338 | wiphy_err(hw->wiphy, "driver data is not enough: %d (%d)\n", - | ~^ - | | - | int - | %ld - CC [M] /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/debugfs.o -In file included from ./include/linux/device.h:15, - from /home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/device.h:3, - from ./include/linux/dma-mapping.h:7, - from /home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/dma-mapping.h:3, - from ./include/linux/skbuff.h:31, - from /home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/skbuff.h:3, - from ./include/linux/if_ether.h:19, - from /home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/if_ether.h:3, - from ./include/linux/etherdevice.h:20, - from /home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/etherdevice.h:3, - from /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/pcie.c:19: -/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/pcie.c: In function 'pcie_bf_mimo_ctrl_decode': -/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); - | ^ -./include/linux/dev_printk.h:110:37: note: in definition of macro 'dev_printk_index_wrap' - 110 | _p_func(dev, fmt, ##__VA_ARGS__); \ - | ^~~~~~~~~~~ -/home/ansuel/openwrt-ansuel/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211/net/cfg80211.h:8828:9: note: in expansion of macro 'dev_err' - 8828 | dev_err(&(wiphy)->dev, format, ##args) - | ^~~~~~~ -/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/pcie.c:1324:17: note: in expansion of macro 'wiphy_err' - 1324 | wiphy_err(priv->hw->wiphy, "Error opening %s! %x\n", - | ^~~~~~~~~ -cc1: all warnings being treated as errors -make[4]: *** [scripts/Makefile.build:289: /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/tx_ndp.o] Error 1 -make[4]: *** Waiting for unfinished jobs.... -cc1: all warnings being treated as errors -make[4]: *** [scripts/Makefile.build:289: /home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/hif/pcie/pcie.o] Error 1 -/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/debugfs.c: In function 'mwl_debugfs_regrdwr_read': -/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-ipq807x_generic/mwlwifi-2023-04-29-6a436714/debugfs.c:1335:43: error: format '%d' expects argument of type 'int', but argument 4 has type 'ssize_t' {aka 'long int'} [-Werror=format=] - 1335 | "error: %d(%u 0x%08x 0x%08x)\n", - | ~^ - | | - | int - | %ld - 1336 | ret, priv->reg_type, priv->reg_offset, - | ~~~ - | | - | ssize_t {aka long int} -cc1: all warnings being treated as errors - -Signed-off-by: Christian Marangi ---- - debugfs.c | 2 +- - hif/fwcmd.c | 2 +- - hif/pcie/8964/tx_ndp.c | 2 +- - hif/pcie/pcie.c | 4 ++-- - 4 files changed, 5 insertions(+), 5 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/fwcmd.c -+++ b/hif/fwcmd.c -@@ -3623,7 +3623,7 @@ int mwl_fwcmd_get_fw_core_dump(struct ie - core_dump->size_kb = pcmd->cmd_data.coredump.size_kb; - core_dump->flags = pcmd->cmd_data.coredump.flags; - memcpy(buff, -- (const void *)((u32)pcmd + -+ (const void *)((uintptr_t)pcmd + - sizeof(struct hostcmd_cmd_get_fw_core_dump) - - sizeof(struct hostcmd_cmd_get_fw_core_dump_)), - MAX_CORE_DUMP_BUFFER); ---- 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; ---- a/hif/pcie/pcie.c -+++ b/hif/pcie/pcie.c -@@ -1466,8 +1466,8 @@ static void pcie_bf_mimo_ctrl_decode(struct mwl_priv *priv, - &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) diff --git a/package/kernel/mwlwifi/patches/001-Simplify-coredump-memcpy-in-mwl_fwcmd_get_fw_core_dump.patch b/package/kernel/mwlwifi/patches/001-Simplify-coredump-memcpy-in-mwl_fwcmd_get_fw_core_dump.patch new file mode 100644 index 0000000000..4b0feeb17e --- /dev/null +++ b/package/kernel/mwlwifi/patches/001-Simplify-coredump-memcpy-in-mwl_fwcmd_get_fw_core_dump.patch @@ -0,0 +1,35 @@ +From 8daab38dfc1fe4d3df9fb5fc18610b942d5cc3b2 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +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 +--- + 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); + diff --git a/package/kernel/mwlwifi/patches/002-Correctly-use-PTR_ERR-in-pcie_bf_mimo_ctrl_decode.patch b/package/kernel/mwlwifi/patches/002-Correctly-use-PTR_ERR-in-pcie_bf_mimo_ctrl_decode.patch new file mode 100644 index 0000000000..f204e9fe73 --- /dev/null +++ b/package/kernel/mwlwifi/patches/002-Correctly-use-PTR_ERR-in-pcie_bf_mimo_ctrl_decode.patch @@ -0,0 +1,32 @@ +From 37c7a798719f1d04326d36c35711c4249bc7492e Mon Sep 17 00:00:00 2001 +From: Christian Marangi +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 +--- + 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) diff --git a/package/kernel/mwlwifi/patches/003-Use-zu-and-zd-for-ssize_t-and-size_t.patch b/package/kernel/mwlwifi/patches/003-Use-zu-and-zd-for-ssize_t-and-size_t.patch new file mode 100644 index 0000000000..d615e13380 --- /dev/null +++ b/package/kernel/mwlwifi/patches/003-Use-zu-and-zd-for-ssize_t-and-size_t.patch @@ -0,0 +1,36 @@ +From 5fe83bd36c035099a6d721a8e42cf3d04a1ce2b6 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +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 +--- + 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; diff --git a/package/kernel/mwlwifi/patches/004-Fix-debugfs-compilation-warning-in-mwl_debugfs_info_read.patch b/package/kernel/mwlwifi/patches/004-Fix-debugfs-compilation-warning-in-mwl_debugfs_info_read.patch new file mode 100644 index 0000000000..0c1eae7e6b --- /dev/null +++ b/package/kernel/mwlwifi/patches/004-Fix-debugfs-compilation-warning-in-mwl_debugfs_info_read.patch @@ -0,0 +1,28 @@ +From 44419b1feae3eedda21cdc71da9acb611ca1a6fd Mon Sep 17 00:00:00 2001 +From: Christian Marangi +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 +--- + 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); + } + diff --git a/package/kernel/mwlwifi/patches/004-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch b/package/kernel/mwlwifi/patches/004-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch deleted file mode 100644 index f37d2f8171..0000000000 --- a/package/kernel/mwlwifi/patches/004-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 8e809b241695252e397bf0d7fc5f36e115c38831 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Fri, 5 Mar 2021 11:47:59 +0100 -Subject: [PATCH] mwlwifi: fix PCIe DT node null pointer dereference - -pci_bus_to_OF_node() used to get the PCI bus DT node -returns node if found or NULL if none is found. - -Since the return of pci_bus_to_OF_node() is not checked in -the DT node name print it will cause a null pointer -dereference and crash the kernel. - -So first check whether the node is not NULL and then print. - -Signed-off-by: Robert Marko ---- - hif/pcie/pcie.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/hif/pcie/pcie.c -+++ b/hif/pcie/pcie.c -@@ -685,7 +685,8 @@ static struct device_node *pcie_get_devi - struct device_node *dev_node; - - dev_node = pci_bus_to_OF_node(pcie_priv->pdev->bus); -- wiphy_info(priv->hw->wiphy, "device node: %s\n", dev_node->full_name); -+ if (dev_node) -+ wiphy_info(priv->hw->wiphy, "device node: %s\n", dev_node->full_name); - - return dev_node; - } diff --git a/package/kernel/mwlwifi/patches/005-Use-BUILD_BUG_ON.patch b/package/kernel/mwlwifi/patches/005-Use-BUILD_BUG_ON.patch new file mode 100644 index 0000000000..d8c527b99b --- /dev/null +++ b/package/kernel/mwlwifi/patches/005-Use-BUILD_BUG_ON.patch @@ -0,0 +1,32 @@ +From dba74289f74095944b39fc96b069c512b5321b7a Mon Sep 17 00:00:00 2001 +From: Christian Marangi +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 +--- + 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) { diff --git a/package/kernel/mwlwifi/patches/005-mac80211_update.patch b/package/kernel/mwlwifi/patches/005-mac80211_update.patch deleted file mode 100644 index 2ceee4732d..0000000000 --- a/package/kernel/mwlwifi/patches/005-mac80211_update.patch +++ /dev/null @@ -1,531 +0,0 @@ ---- a/core.c -+++ b/core.c -@@ -718,8 +718,8 @@ static void mwl_chnl_switch_event(struct - vif = container_of((void *)mwl_vif, struct ieee80211_vif, - drv_priv); - -- if (vif->csa_active) -- ieee80211_csa_finish(vif); -+ if (vif->bss_conf.csa_active) -+ ieee80211_csa_finish(vif, 0); - } - spin_unlock_bh(&priv->vif_lock); - ---- a/debugfs.c -+++ b/debugfs.c -@@ -498,9 +498,9 @@ static ssize_t mwl_debugfs_vif_read(stru - switch (vif->type) { - case NL80211_IFTYPE_AP: - len += scnprintf(p + len, size - len, "type: ap\n"); -- memcpy(ssid, vif->bss_conf.ssid, -- vif->bss_conf.ssid_len); -- ssid[vif->bss_conf.ssid_len] = 0; -+ memcpy(ssid, vif->cfg.ssid, -+ vif->cfg.ssid_len); -+ ssid[vif->cfg.ssid_len] = 0; - len += scnprintf(p + len, size - len, - "ssid: %s\n", ssid); - len += scnprintf(p + len, size - len, -@@ -522,8 +522,8 @@ static ssize_t mwl_debugfs_vif_read(stru - "type: unknown\n"); - break; - } -- if (vif->chanctx_conf) { -- chan_def = &vif->chanctx_conf->def; -+ if (vif->bss_conf.chanctx_conf) { -+ chan_def = &vif->bss_conf.chanctx_conf->def; - len += scnprintf(p + len, size - len, - "channel: %d: width: %d\n", - chan_def->chan->hw_value, -@@ -596,18 +596,18 @@ static ssize_t mwl_debugfs_sta_read(stru - sta_info->wds ? "true" : "false", - sta_info->ba_hist.enable ? "enable" : "disable", - sta_info->is_amsdu_allowed ? sta_info->amsdu_ctrl.cap : 0 , -- sta->ht_cap.ht_supported ? sta->ht_cap.cap : 0, -- sta->ht_cap.ht_supported ? sta->ht_cap.ampdu_factor : 0, -- sta->ht_cap.ht_supported ? sta->ht_cap.ampdu_density : 0, -- sta->ht_cap.ht_supported ? sta->ht_cap.mcs.rx_mask[0] : 0, -- sta->ht_cap.ht_supported ? sta->ht_cap.mcs.rx_mask[1] : 0, -- sta->ht_cap.ht_supported ? sta->ht_cap.mcs.rx_mask[2] : 0, -- sta->ht_cap.ht_supported ? sta->ht_cap.mcs.rx_mask[3] : 0, -- sta->vht_cap.vht_supported ? sta->vht_cap.cap : 0, -- sta->vht_cap.vht_supported ? sta->vht_cap.vht_mcs.rx_mcs_map : 0, -- sta->vht_cap.vht_supported ? sta->vht_cap.vht_mcs.tx_mcs_map : 0, -- sta->bandwidth, -- sta->rx_nss, -+ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.cap : 0, -+ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.ampdu_factor : 0, -+ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.ampdu_density : 0, -+ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.mcs.rx_mask[0] : 0, -+ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.mcs.rx_mask[1] : 0, -+ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.mcs.rx_mask[2] : 0, -+ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.mcs.rx_mask[3] : 0, -+ sta->deflink.vht_cap.vht_supported ? sta->deflink.vht_cap.cap : 0, -+ sta->deflink.vht_cap.vht_supported ? sta->deflink.vht_cap.vht_mcs.rx_mcs_map : 0, -+ sta->deflink.vht_cap.vht_supported ? sta->deflink.vht_cap.vht_mcs.tx_mcs_map : 0, -+ sta->deflink.bandwidth, -+ sta->deflink.rx_nss, - sta->tdls, - sta->tdls_initiator, - sta->wme, -@@ -1158,7 +1158,7 @@ static ssize_t mwl_debugfs_dfs_radar_wri - struct mwl_priv *priv = (struct mwl_priv *)file->private_data; - - wiphy_info(priv->hw->wiphy, "simulate radar detected\n"); -- ieee80211_radar_detected(priv->hw); -+ ieee80211_radar_detected(priv->hw, NULL); - - return count; - } ---- a/hif/fwcmd.c -+++ b/hif/fwcmd.c -@@ -633,11 +633,15 @@ einval: - } - - static int mwl_fwcmd_set_ap_beacon(struct mwl_priv *priv, -- struct mwl_vif *mwl_vif, -- struct ieee80211_bss_conf *bss_conf) -+ struct ieee80211_vif *vif) - { - struct hostcmd_cmd_ap_beacon *pcmd; - struct ds_params *phy_ds_param_set; -+ struct mwl_vif *mwl_vif; -+ struct ieee80211_bss_conf *bss_conf; -+ -+ mwl_vif = mwl_dev_get_vif(vif); -+ bss_conf = &vif->bss_conf; - - /* wmm structure of start command is defined less one byte, - * due to following field country is not used, add byte one -@@ -664,7 +668,7 @@ static int mwl_fwcmd_set_ap_beacon(struc - pcmd->cmd_hdr.macid = mwl_vif->macid; - - ether_addr_copy(pcmd->start_cmd.sta_mac_addr, mwl_vif->bssid); -- memcpy(pcmd->start_cmd.ssid, bss_conf->ssid, bss_conf->ssid_len); -+ memcpy(pcmd->start_cmd.ssid, vif->cfg.ssid, vif->cfg.ssid_len); - if (priv->chip_type == MWL8997) - ether_addr_copy(pcmd->start_cmd.bssid, mwl_vif->bssid); - pcmd->start_cmd.bss_type = 1; -@@ -674,7 +678,7 @@ static int mwl_fwcmd_set_ap_beacon(struc - phy_ds_param_set = &pcmd->start_cmd.phy_param_set.ds_param_set; - phy_ds_param_set->elem_id = WLAN_EID_DS_PARAMS; - phy_ds_param_set->len = sizeof(phy_ds_param_set->current_chnl); -- phy_ds_param_set->current_chnl = bss_conf->chandef.chan->hw_value; -+ phy_ds_param_set->current_chnl = bss_conf->chanreq.oper.chan->hw_value; - - pcmd->start_cmd.probe_delay = cpu_to_le16(10); - pcmd->start_cmd.cap_info = cpu_to_le16(mwl_vif->beacon_info.cap_info); -@@ -768,9 +772,9 @@ static int mwl_fwcmd_set_country_code(st - bool enable = false; - - if (b_inf->ie_country_ptr) { -- if (bss_conf->chandef.chan->band == NL80211_BAND_2GHZ) -+ if (bss_conf->chanreq.oper.chan->band == NL80211_BAND_2GHZ) - a_band = false; -- else if (bss_conf->chandef.chan->band == NL80211_BAND_5GHZ) -+ else if (bss_conf->chanreq.oper.chan->band == NL80211_BAND_5GHZ) - a_band = true; - else - return -EINVAL; -@@ -2090,7 +2094,7 @@ int mwl_fwcmd_set_beacon(struct ieee8021 - if (mwl_fwcmd_set_wsc_ie(hw, b_inf->ie_wsc_len, b_inf->ie_wsc_ptr)) - goto err; - -- if (mwl_fwcmd_set_ap_beacon(priv, mwl_vif, &vif->bss_conf)) -+ if (mwl_fwcmd_set_ap_beacon(priv, vif)) - goto err; - - if (b_inf->cap_info & WLAN_CAPABILITY_SPECTRUM_MGMT) -@@ -2152,38 +2156,38 @@ int mwl_fwcmd_set_new_stn_add(struct iee - ether_addr_copy(pcmd->mac_addr, sta->addr); - - if (hw->conf.chandef.chan->band == NL80211_BAND_2GHZ) -- rates = sta->supp_rates[NL80211_BAND_2GHZ]; -+ rates = sta->deflink.supp_rates[NL80211_BAND_2GHZ]; - else -- rates = sta->supp_rates[NL80211_BAND_5GHZ] << 5; -+ rates = sta->deflink.supp_rates[NL80211_BAND_5GHZ] << 5; - pcmd->peer_info.legacy_rate_bitmap = cpu_to_le32(rates); - -- if (sta->ht_cap.ht_supported) { -+ if (sta->deflink.ht_cap.ht_supported) { - int i; - - for (i = 0; i < 4; i++) { -- if (i < sta->rx_nss) { -+ if (i < sta->deflink.rx_nss) { - pcmd->peer_info.ht_rates[i] = -- sta->ht_cap.mcs.rx_mask[i]; -+ sta->deflink.ht_cap.mcs.rx_mask[i]; - } else { - pcmd->peer_info.ht_rates[i] = 0; - } - } -- pcmd->peer_info.ht_cap_info = cpu_to_le16(sta->ht_cap.cap); -+ pcmd->peer_info.ht_cap_info = cpu_to_le16(sta->deflink.ht_cap.cap); - pcmd->peer_info.mac_ht_param_info = -- (sta->ht_cap.ampdu_factor & 3) | -- ((sta->ht_cap.ampdu_density & 7) << 2); -+ (sta->deflink.ht_cap.ampdu_factor & 3) | -+ ((sta->deflink.ht_cap.ampdu_density & 7) << 2); - } - -- if (sta->vht_cap.vht_supported) { -+ if (sta->deflink.vht_cap.vht_supported) { - u32 rx_mcs_map_mask = 0; - -- rx_mcs_map_mask = ((0x0000FFFF) >> (sta->rx_nss * 2)) -- << (sta->rx_nss * 2); -+ rx_mcs_map_mask = ((0x0000FFFF) >> (sta->deflink.rx_nss * 2)) -+ << (sta->deflink.rx_nss * 2); - pcmd->peer_info.vht_max_rx_mcs = - cpu_to_le32((*((u32 *) -- &sta->vht_cap.vht_mcs.rx_mcs_map)) | rx_mcs_map_mask); -- pcmd->peer_info.vht_cap = cpu_to_le32(sta->vht_cap.cap); -- pcmd->peer_info.vht_rx_channel_width = sta->bandwidth; -+ &sta->deflink.vht_cap.vht_mcs.rx_mcs_map)) | rx_mcs_map_mask); -+ pcmd->peer_info.vht_cap = cpu_to_le32(sta->deflink.vht_cap.cap); -+ pcmd->peer_info.vht_rx_channel_width = sta->deflink.bandwidth; - } - - pcmd->is_qos_sta = sta->wme; -@@ -2239,38 +2243,38 @@ int mwl_fwcmd_set_new_stn_add_sc4(struct - ether_addr_copy(pcmd->mac_addr, sta->addr); - - if (hw->conf.chandef.chan->band == NL80211_BAND_2GHZ) -- rates = sta->supp_rates[NL80211_BAND_2GHZ]; -+ rates = sta->deflink.supp_rates[NL80211_BAND_2GHZ]; - else -- rates = sta->supp_rates[NL80211_BAND_5GHZ] << 5; -+ rates = sta->deflink.supp_rates[NL80211_BAND_5GHZ] << 5; - pcmd->peer_info.legacy_rate_bitmap = cpu_to_le32(rates); - -- if (sta->ht_cap.ht_supported) { -+ if (sta->deflink.ht_cap.ht_supported) { - int i; - - for (i = 0; i < 4; i++) { -- if (i < sta->rx_nss) { -+ if (i < sta->deflink.rx_nss) { - pcmd->peer_info.ht_rates[i] = -- sta->ht_cap.mcs.rx_mask[i]; -+ sta->deflink.ht_cap.mcs.rx_mask[i]; - } else { - pcmd->peer_info.ht_rates[i] = 0; - } - } -- pcmd->peer_info.ht_cap_info = cpu_to_le16(sta->ht_cap.cap); -+ pcmd->peer_info.ht_cap_info = cpu_to_le16(sta->deflink.ht_cap.cap); - pcmd->peer_info.mac_ht_param_info = -- (sta->ht_cap.ampdu_factor & 3) | -- ((sta->ht_cap.ampdu_density & 7) << 2); -+ (sta->deflink.ht_cap.ampdu_factor & 3) | -+ ((sta->deflink.ht_cap.ampdu_density & 7) << 2); - } - -- if (sta->vht_cap.vht_supported) { -+ if (sta->deflink.vht_cap.vht_supported) { - u32 rx_mcs_map_mask = 0; - -- rx_mcs_map_mask = ((0x0000FFFF) >> (sta->rx_nss * 2)) -- << (sta->rx_nss * 2); -+ rx_mcs_map_mask = ((0x0000FFFF) >> (sta->deflink.rx_nss * 2)) -+ << (sta->deflink.rx_nss * 2); - pcmd->peer_info.vht_max_rx_mcs = - cpu_to_le32((*((u32 *) -- &sta->vht_cap.vht_mcs.rx_mcs_map)) | rx_mcs_map_mask); -- pcmd->peer_info.vht_cap = cpu_to_le32(sta->vht_cap.cap); -- pcmd->peer_info.vht_rx_channel_width = sta->bandwidth; -+ &sta->deflink.vht_cap.vht_mcs.rx_mcs_map)) | rx_mcs_map_mask); -+ pcmd->peer_info.vht_cap = cpu_to_le32(sta->deflink.vht_cap.cap); -+ pcmd->peer_info.vht_rx_channel_width = sta->deflink.bandwidth; - } - - pcmd->is_qos_sta = sta->wme; -@@ -2787,9 +2791,9 @@ int mwl_fwcmd_create_ba(struct ieee80211 - pcmd->ba_info.create_params.flags = cpu_to_le32(ba_flags); - pcmd->ba_info.create_params.queue_id = stream->idx; - pcmd->ba_info.create_params.param_info = -- (stream->sta->ht_cap.ampdu_factor & -+ (stream->sta->deflink.ht_cap.ampdu_factor & - IEEE80211_HT_AMPDU_PARM_FACTOR) | -- ((stream->sta->ht_cap.ampdu_density << 2) & -+ ((stream->sta->deflink.ht_cap.ampdu_density << 2) & - IEEE80211_HT_AMPDU_PARM_DENSITY); - if (direction == BA_FLAG_DIRECTION_UP) { - pcmd->ba_info.create_params.reset_seq_no = 0; -@@ -2799,9 +2803,9 @@ int mwl_fwcmd_create_ba(struct ieee80211 - pcmd->ba_info.create_params.current_seq = cpu_to_le16(0); - } - if (priv->chip_type == MWL8964 && -- stream->sta->vht_cap.vht_supported) { -+ stream->sta->deflink.vht_cap.vht_supported) { - pcmd->ba_info.create_params.vht_rx_factor = -- cpu_to_le32((stream->sta->vht_cap.cap & -+ cpu_to_le32((stream->sta->deflink.vht_cap.cap & - IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK) >> - IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT); - } ---- a/hif/pcie/8864/tx.c -+++ b/hif/pcie/8864/tx.c -@@ -490,7 +490,7 @@ static void pcie_non_pfu_tx_done(struct - } else - memmove(dma_data->data - hdrlen, &dma_data->wh, hdrlen); - skb_pull(done_skb, sizeof(*dma_data) - hdrlen); -- ieee80211_tx_status(priv->hw, done_skb); -+ ieee80211_tx_status_skb(priv->hw, done_skb); - dev_kfree_skb_any(done_skb); - done_skb = NULL; - } -@@ -743,7 +743,7 @@ void pcie_8864_tx_xmit(struct ieee80211_ - index = SYSADPT_TX_WMM_QUEUES - index - 1; - txpriority = index; - -- if (sta && sta->ht_cap.ht_supported && -+ if (sta && sta->deflink.ht_cap.ht_supported && - !(xmitcontrol & EAGLE_TXD_XMITCTRL_USE_MC_RATE) && - ieee80211_is_data_qos(wh->frame_control)) { - tid = qos & 0xf; -@@ -925,4 +925,4 @@ void pcie_8864_tx_del_sta_amsdu_pkts(str - } - } - spin_unlock_bh(&sta_info->amsdu_lock); --} -\ No newline at end of file -+} ---- a/hif/pcie/8964/tx_ndp.c -+++ b/hif/pcie/8964/tx_ndp.c -@@ -287,7 +287,7 @@ static inline int pcie_tx_skb_ndp(struct - skb_get(tx_skb); - pcie_tx_prepare_info(priv, tx_ctrl->rate, tx_info); - tx_ctrl->flags |= TX_CTRL_TYPE_DATA; -- ieee80211_tx_status(priv->hw, tx_skb); -+ ieee80211_tx_status_skb(priv->hw, tx_skb); - } - - if (++tx_send_head_new >= MAX_NUM_TX_DESC) -@@ -488,7 +488,7 @@ void pcie_tx_done_ndp(struct ieee80211_h - } - - pcie_tx_prepare_info(priv, 0, tx_info); -- ieee80211_tx_status(hw, skb); -+ ieee80211_tx_status_skb(hw, skb); - - bypass_ack: - if (++tx_done_tail >= MAX_TX_RING_DONE_SIZE) -@@ -601,13 +601,13 @@ void pcie_tx_xmit_ndp(struct ieee80211_h - ack_skb = skb_copy(skb, GFP_ATOMIC); - ack_info = IEEE80211_SKB_CB(ack_skb); - pcie_tx_prepare_info(priv, 0, ack_info); -- ieee80211_tx_status(hw, ack_skb); -+ ieee80211_tx_status_skb(hw, ack_skb); - } - - pcie_tx_encapsulate_frame(priv, skb, k_conf); - } else { - tid = qos & 0x7; -- if (sta && sta->ht_cap.ht_supported && !eapol_frame && -+ if (sta && sta->deflink.ht_cap.ht_supported && !eapol_frame && - qos != 0xFFFF) { - pcie_tx_count_packet(sta, tid); - spin_lock_bh(&priv->stream_lock); ---- a/hif/pcie/8997/tx.c -+++ b/hif/pcie/8997/tx.c -@@ -81,7 +81,7 @@ static int pcie_txbd_ring_create(struct - wiphy_info(priv->hw->wiphy, - "TX ring: - base: %p, pbase: 0x%x, len: %d\n", - pcie_priv->txbd_ring_vbase, -- pcie_priv->txbd_ring_pbase, -+ (u32)pcie_priv->txbd_ring_pbase, - pcie_priv->txbd_ring_size); - - for (num = 0; num < PCIE_MAX_TXRX_BD; num++) { -@@ -444,7 +444,7 @@ static void pcie_pfu_tx_done(struct mwl_ - } else - memmove(dma_data->data - hdrlen, &dma_data->wh, hdrlen); - skb_pull(done_skb, sizeof(*pfu_dma) - hdrlen); -- ieee80211_tx_status(priv->hw, done_skb); -+ ieee80211_tx_status_skb(priv->hw, done_skb); - } - } - next: -@@ -694,7 +694,7 @@ void pcie_8997_tx_xmit(struct ieee80211_ - index = SYSADPT_TX_WMM_QUEUES - index - 1; - txpriority = index; - -- if (sta && sta->ht_cap.ht_supported && -+ if (sta && sta->deflink.ht_cap.ht_supported && - !(xmitcontrol & EAGLE_TXD_XMITCTRL_USE_MC_RATE) && - ieee80211_is_data_qos(wh->frame_control)) { - tid = qos & 0xf; -@@ -875,4 +875,4 @@ void pcie_8997_tx_del_sta_amsdu_pkts(str - } - } - spin_unlock_bh(&sta_info->amsdu_lock); --} -\ No newline at end of file -+} ---- a/mac80211.c -+++ b/mac80211.c -@@ -159,7 +159,7 @@ fwcmd_fail: - return rc; - } - --static void mwl_mac80211_stop(struct ieee80211_hw *hw) -+static void mwl_mac80211_stop(struct ieee80211_hw *hw, bool suspend) - { - mwl_fwcmd_radio_disable(hw); - -@@ -368,15 +368,15 @@ static void mwl_mac80211_bss_info_change - } - } - -- if ((changed & BSS_CHANGED_ASSOC) && vif->bss_conf.assoc) -+ if ((changed & BSS_CHANGED_ASSOC) && vif->cfg.assoc) - mwl_fwcmd_set_aid(hw, vif, (u8 *)vif->bss_conf.bssid, -- vif->bss_conf.aid); -+ vif->cfg.aid); - } - - static void mwl_mac80211_bss_info_changed_ap(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, - struct ieee80211_bss_conf *info, -- u32 changed) -+ u64 changed) - { - struct mwl_priv *priv = hw->priv; - struct mwl_vif *mwl_vif; -@@ -426,8 +426,8 @@ static void mwl_mac80211_bss_info_change - if (changed & (BSS_CHANGED_BEACON_INT | BSS_CHANGED_BEACON)) { - struct sk_buff *skb; - -- if ((info->ssid[0] != '\0') && -- (info->ssid_len != 0) && -+ if ((vif->cfg.ssid[0] != '\0') && -+ (vif->cfg.ssid_len != 0) && - (!info->hidden_ssid)) { - if (mwl_vif->broadcast_ssid != true) { - mwl_fwcmd_broadcast_ssid_enable(hw, vif, true); -@@ -441,7 +441,7 @@ static void mwl_mac80211_bss_info_change - } - - if (!mwl_vif->set_beacon) { -- skb = ieee80211_beacon_get(hw, vif); -+ skb = ieee80211_beacon_get(hw, vif, 0); - - if (skb) { - mwl_fwcmd_set_beacon(hw, vif, skb->data, skb->len); -@@ -458,7 +458,7 @@ static void mwl_mac80211_bss_info_change - static void mwl_mac80211_bss_info_changed(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, - struct ieee80211_bss_conf *info, -- u32 changed) -+ u64 changed) - { - switch (vif->type) { - case NL80211_IFTYPE_AP: -@@ -583,10 +583,10 @@ static int mwl_mac80211_sta_add(struct i - if (vif->type == NL80211_IFTYPE_MESH_POINT) - sta_info->is_mesh_node = true; - -- if (sta->ht_cap.ht_supported) { -+ if (sta->deflink.ht_cap.ht_supported) { - sta_info->is_ampdu_allowed = true; - sta_info->is_amsdu_allowed = false; -- if (sta->ht_cap.cap & IEEE80211_HT_CAP_MAX_AMSDU) { -+ if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_MAX_AMSDU) { - sta_info->amsdu_ctrl.cap = MWL_AMSDU_SIZE_8K; - sta_info->amsdu_ctrl.amsdu_allow_size = SYSADPT_AMSDU_8K_MAX_SIZE; - } -@@ -670,7 +670,7 @@ static int mwl_mac80211_sta_remove(struc - - static int mwl_mac80211_conf_tx(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, -- u16 queue, -+ unsigned int link_id, u16 queue, - const struct ieee80211_tx_queue_params *params) - { - struct mwl_priv *priv = hw->priv; -@@ -934,4 +934,9 @@ const struct ieee80211_ops mwl_mac80211_ - .pre_channel_switch = mwl_mac80211_chnl_switch, - .sw_scan_start = mwl_mac80211_sw_scan_start, - .sw_scan_complete = mwl_mac80211_sw_scan_complete, -+ .wake_tx_queue = ieee80211_handle_wake_tx_queue, -+ .add_chanctx = ieee80211_emulate_add_chanctx, -+ .remove_chanctx = ieee80211_emulate_remove_chanctx, -+ .change_chanctx = ieee80211_emulate_change_chanctx, -+ .switch_vif_chanctx = ieee80211_emulate_switch_vif_chanctx, - }; ---- a/utils.c -+++ b/utils.c -@@ -173,9 +173,9 @@ u32 utils_get_init_tx_rate(struct mwl_pr - u32 tx_rate; - u16 format, nss, bw, rate_mcs; - -- if (sta->vht_cap.vht_supported) -+ if (sta->deflink.vht_cap.vht_supported) - format = TX_RATE_FORMAT_11AC; -- else if (sta->ht_cap.ht_supported) -+ else if (sta->deflink.ht_cap.ht_supported) - format = TX_RATE_FORMAT_11N; - else - format = TX_RATE_FORMAT_LEGACY; -@@ -192,11 +192,11 @@ u32 utils_get_init_tx_rate(struct mwl_pr - nss = 3; - break; - default: -- nss = sta->rx_nss; -+ nss = sta->deflink.rx_nss; - break; - } -- if (nss > sta->rx_nss) -- nss = sta->rx_nss; -+ if (nss > sta->deflink.rx_nss) -+ nss = sta->deflink.rx_nss; - - switch (conf->chandef.width) { - case NL80211_CHAN_WIDTH_20_NOHT: -@@ -213,11 +213,11 @@ u32 utils_get_init_tx_rate(struct mwl_pr - bw = TX_RATE_BANDWIDTH_160; - break; - default: -- bw = sta->bandwidth; -+ bw = sta->deflink.bandwidth; - break; - } -- if (bw > sta->bandwidth) -- bw = sta->bandwidth; -+ if (bw > sta->deflink.bandwidth) -+ bw = sta->deflink.bandwidth; - - switch (format) { - case TX_RATE_FORMAT_LEGACY: ---- a/hif/pcie/pcie.c -+++ b/hif/pcie/pcie.c -@@ -546,7 +546,7 @@ static irqreturn_t pcie_isr_8864(struct - - if (int_status & MACREG_A2HRIC_BIT_RADAR_DETECT) { - wiphy_info(hw->wiphy, "radar detected by firmware\n"); -- ieee80211_radar_detected(hw); -+ ieee80211_radar_detected(hw, NULL); - } - - if (int_status & MACREG_A2HRIC_BIT_CHAN_SWITCH) ieee80211_queue_work(hw, &priv->chnl_switch_handle); -@@ -593,7 +593,7 @@ static irqreturn_t pcie_isr_8997(struct - - if (int_status & MACREG_A2HRIC_BIT_RADAR_DETECT) { - wiphy_info(hw->wiphy, "radar detected by firmware\n"); -- ieee80211_radar_detected(hw); -+ ieee80211_radar_detected(hw, NULL); - } - - if (int_status & MACREG_A2HRIC_BIT_CHAN_SWITCH) -@@ -1071,7 +1071,7 @@ static irqreturn_t pcie_isr_ndp(struct i - - if (int_status & MACREG_A2HRIC_NEWDP_DFS) { - wiphy_info(hw->wiphy, "radar detected by firmware\n"); -- ieee80211_radar_detected(hw); -+ ieee80211_radar_detected(hw, NULL); - } - - if (int_status & MACREG_A2HRIC_NEWDP_CHANNEL_SWITCH) diff --git a/package/kernel/mwlwifi/patches/010-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch b/package/kernel/mwlwifi/patches/010-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch new file mode 100644 index 0000000000..f37d2f8171 --- /dev/null +++ b/package/kernel/mwlwifi/patches/010-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch @@ -0,0 +1,31 @@ +From 8e809b241695252e397bf0d7fc5f36e115c38831 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Fri, 5 Mar 2021 11:47:59 +0100 +Subject: [PATCH] mwlwifi: fix PCIe DT node null pointer dereference + +pci_bus_to_OF_node() used to get the PCI bus DT node +returns node if found or NULL if none is found. + +Since the return of pci_bus_to_OF_node() is not checked in +the DT node name print it will cause a null pointer +dereference and crash the kernel. + +So first check whether the node is not NULL and then print. + +Signed-off-by: Robert Marko +--- + hif/pcie/pcie.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/hif/pcie/pcie.c ++++ b/hif/pcie/pcie.c +@@ -685,7 +685,8 @@ static struct device_node *pcie_get_devi + struct device_node *dev_node; + + dev_node = pci_bus_to_OF_node(pcie_priv->pdev->bus); +- wiphy_info(priv->hw->wiphy, "device node: %s\n", dev_node->full_name); ++ if (dev_node) ++ wiphy_info(priv->hw->wiphy, "device node: %s\n", dev_node->full_name); + + return dev_node; + } diff --git a/package/kernel/mwlwifi/patches/020-mac80211_update.patch b/package/kernel/mwlwifi/patches/020-mac80211_update.patch new file mode 100644 index 0000000000..1c5d581939 --- /dev/null +++ b/package/kernel/mwlwifi/patches/020-mac80211_update.patch @@ -0,0 +1,531 @@ +--- a/core.c ++++ b/core.c +@@ -718,8 +718,8 @@ static void mwl_chnl_switch_event(struct + vif = container_of((void *)mwl_vif, struct ieee80211_vif, + drv_priv); + +- if (vif->csa_active) +- ieee80211_csa_finish(vif); ++ if (vif->bss_conf.csa_active) ++ ieee80211_csa_finish(vif, 0); + } + spin_unlock_bh(&priv->vif_lock); + +--- a/debugfs.c ++++ b/debugfs.c +@@ -498,9 +498,9 @@ static ssize_t mwl_debugfs_vif_read(stru + switch (vif->type) { + case NL80211_IFTYPE_AP: + len += scnprintf(p + len, size - len, "type: ap\n"); +- memcpy(ssid, vif->bss_conf.ssid, +- vif->bss_conf.ssid_len); +- ssid[vif->bss_conf.ssid_len] = 0; ++ memcpy(ssid, vif->cfg.ssid, ++ vif->cfg.ssid_len); ++ ssid[vif->cfg.ssid_len] = 0; + len += scnprintf(p + len, size - len, + "ssid: %s\n", ssid); + len += scnprintf(p + len, size - len, +@@ -522,8 +522,8 @@ static ssize_t mwl_debugfs_vif_read(stru + "type: unknown\n"); + break; + } +- if (vif->chanctx_conf) { +- chan_def = &vif->chanctx_conf->def; ++ if (vif->bss_conf.chanctx_conf) { ++ chan_def = &vif->bss_conf.chanctx_conf->def; + len += scnprintf(p + len, size - len, + "channel: %d: width: %d\n", + chan_def->chan->hw_value, +@@ -596,18 +596,18 @@ static ssize_t mwl_debugfs_sta_read(stru + sta_info->wds ? "true" : "false", + sta_info->ba_hist.enable ? "enable" : "disable", + sta_info->is_amsdu_allowed ? sta_info->amsdu_ctrl.cap : 0 , +- sta->ht_cap.ht_supported ? sta->ht_cap.cap : 0, +- sta->ht_cap.ht_supported ? sta->ht_cap.ampdu_factor : 0, +- sta->ht_cap.ht_supported ? sta->ht_cap.ampdu_density : 0, +- sta->ht_cap.ht_supported ? sta->ht_cap.mcs.rx_mask[0] : 0, +- sta->ht_cap.ht_supported ? sta->ht_cap.mcs.rx_mask[1] : 0, +- sta->ht_cap.ht_supported ? sta->ht_cap.mcs.rx_mask[2] : 0, +- sta->ht_cap.ht_supported ? sta->ht_cap.mcs.rx_mask[3] : 0, +- sta->vht_cap.vht_supported ? sta->vht_cap.cap : 0, +- sta->vht_cap.vht_supported ? sta->vht_cap.vht_mcs.rx_mcs_map : 0, +- sta->vht_cap.vht_supported ? sta->vht_cap.vht_mcs.tx_mcs_map : 0, +- sta->bandwidth, +- sta->rx_nss, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.cap : 0, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.ampdu_factor : 0, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.ampdu_density : 0, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.mcs.rx_mask[0] : 0, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.mcs.rx_mask[1] : 0, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.mcs.rx_mask[2] : 0, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.mcs.rx_mask[3] : 0, ++ sta->deflink.vht_cap.vht_supported ? sta->deflink.vht_cap.cap : 0, ++ sta->deflink.vht_cap.vht_supported ? sta->deflink.vht_cap.vht_mcs.rx_mcs_map : 0, ++ sta->deflink.vht_cap.vht_supported ? sta->deflink.vht_cap.vht_mcs.tx_mcs_map : 0, ++ sta->deflink.bandwidth, ++ sta->deflink.rx_nss, + sta->tdls, + sta->tdls_initiator, + sta->wme, +@@ -1158,7 +1158,7 @@ static ssize_t mwl_debugfs_dfs_radar_wri + struct mwl_priv *priv = (struct mwl_priv *)file->private_data; + + wiphy_info(priv->hw->wiphy, "simulate radar detected\n"); +- ieee80211_radar_detected(priv->hw); ++ ieee80211_radar_detected(priv->hw, NULL); + + return count; + } +--- a/hif/fwcmd.c ++++ b/hif/fwcmd.c +@@ -633,11 +633,15 @@ einval: + } + + static int mwl_fwcmd_set_ap_beacon(struct mwl_priv *priv, +- struct mwl_vif *mwl_vif, +- struct ieee80211_bss_conf *bss_conf) ++ struct ieee80211_vif *vif) + { + struct hostcmd_cmd_ap_beacon *pcmd; + struct ds_params *phy_ds_param_set; ++ struct mwl_vif *mwl_vif; ++ struct ieee80211_bss_conf *bss_conf; ++ ++ mwl_vif = mwl_dev_get_vif(vif); ++ bss_conf = &vif->bss_conf; + + /* wmm structure of start command is defined less one byte, + * due to following field country is not used, add byte one +@@ -664,7 +668,7 @@ static int mwl_fwcmd_set_ap_beacon(struc + pcmd->cmd_hdr.macid = mwl_vif->macid; + + ether_addr_copy(pcmd->start_cmd.sta_mac_addr, mwl_vif->bssid); +- memcpy(pcmd->start_cmd.ssid, bss_conf->ssid, bss_conf->ssid_len); ++ memcpy(pcmd->start_cmd.ssid, vif->cfg.ssid, vif->cfg.ssid_len); + if (priv->chip_type == MWL8997) + ether_addr_copy(pcmd->start_cmd.bssid, mwl_vif->bssid); + pcmd->start_cmd.bss_type = 1; +@@ -674,7 +678,7 @@ static int mwl_fwcmd_set_ap_beacon(struc + phy_ds_param_set = &pcmd->start_cmd.phy_param_set.ds_param_set; + phy_ds_param_set->elem_id = WLAN_EID_DS_PARAMS; + phy_ds_param_set->len = sizeof(phy_ds_param_set->current_chnl); +- phy_ds_param_set->current_chnl = bss_conf->chandef.chan->hw_value; ++ phy_ds_param_set->current_chnl = bss_conf->chanreq.oper.chan->hw_value; + + pcmd->start_cmd.probe_delay = cpu_to_le16(10); + pcmd->start_cmd.cap_info = cpu_to_le16(mwl_vif->beacon_info.cap_info); +@@ -768,9 +772,9 @@ static int mwl_fwcmd_set_country_code(st + bool enable = false; + + if (b_inf->ie_country_ptr) { +- if (bss_conf->chandef.chan->band == NL80211_BAND_2GHZ) ++ if (bss_conf->chanreq.oper.chan->band == NL80211_BAND_2GHZ) + a_band = false; +- else if (bss_conf->chandef.chan->band == NL80211_BAND_5GHZ) ++ else if (bss_conf->chanreq.oper.chan->band == NL80211_BAND_5GHZ) + a_band = true; + else + return -EINVAL; +@@ -2090,7 +2094,7 @@ int mwl_fwcmd_set_beacon(struct ieee8021 + if (mwl_fwcmd_set_wsc_ie(hw, b_inf->ie_wsc_len, b_inf->ie_wsc_ptr)) + goto err; + +- if (mwl_fwcmd_set_ap_beacon(priv, mwl_vif, &vif->bss_conf)) ++ if (mwl_fwcmd_set_ap_beacon(priv, vif)) + goto err; + + if (b_inf->cap_info & WLAN_CAPABILITY_SPECTRUM_MGMT) +@@ -2152,38 +2156,38 @@ int mwl_fwcmd_set_new_stn_add(struct iee + ether_addr_copy(pcmd->mac_addr, sta->addr); + + if (hw->conf.chandef.chan->band == NL80211_BAND_2GHZ) +- rates = sta->supp_rates[NL80211_BAND_2GHZ]; ++ rates = sta->deflink.supp_rates[NL80211_BAND_2GHZ]; + else +- rates = sta->supp_rates[NL80211_BAND_5GHZ] << 5; ++ rates = sta->deflink.supp_rates[NL80211_BAND_5GHZ] << 5; + pcmd->peer_info.legacy_rate_bitmap = cpu_to_le32(rates); + +- if (sta->ht_cap.ht_supported) { ++ if (sta->deflink.ht_cap.ht_supported) { + int i; + + for (i = 0; i < 4; i++) { +- if (i < sta->rx_nss) { ++ if (i < sta->deflink.rx_nss) { + pcmd->peer_info.ht_rates[i] = +- sta->ht_cap.mcs.rx_mask[i]; ++ sta->deflink.ht_cap.mcs.rx_mask[i]; + } else { + pcmd->peer_info.ht_rates[i] = 0; + } + } +- pcmd->peer_info.ht_cap_info = cpu_to_le16(sta->ht_cap.cap); ++ pcmd->peer_info.ht_cap_info = cpu_to_le16(sta->deflink.ht_cap.cap); + pcmd->peer_info.mac_ht_param_info = +- (sta->ht_cap.ampdu_factor & 3) | +- ((sta->ht_cap.ampdu_density & 7) << 2); ++ (sta->deflink.ht_cap.ampdu_factor & 3) | ++ ((sta->deflink.ht_cap.ampdu_density & 7) << 2); + } + +- if (sta->vht_cap.vht_supported) { ++ if (sta->deflink.vht_cap.vht_supported) { + u32 rx_mcs_map_mask = 0; + +- rx_mcs_map_mask = ((0x0000FFFF) >> (sta->rx_nss * 2)) +- << (sta->rx_nss * 2); ++ rx_mcs_map_mask = ((0x0000FFFF) >> (sta->deflink.rx_nss * 2)) ++ << (sta->deflink.rx_nss * 2); + pcmd->peer_info.vht_max_rx_mcs = + cpu_to_le32((*((u32 *) +- &sta->vht_cap.vht_mcs.rx_mcs_map)) | rx_mcs_map_mask); +- pcmd->peer_info.vht_cap = cpu_to_le32(sta->vht_cap.cap); +- pcmd->peer_info.vht_rx_channel_width = sta->bandwidth; ++ &sta->deflink.vht_cap.vht_mcs.rx_mcs_map)) | rx_mcs_map_mask); ++ pcmd->peer_info.vht_cap = cpu_to_le32(sta->deflink.vht_cap.cap); ++ pcmd->peer_info.vht_rx_channel_width = sta->deflink.bandwidth; + } + + pcmd->is_qos_sta = sta->wme; +@@ -2239,38 +2243,38 @@ int mwl_fwcmd_set_new_stn_add_sc4(struct + ether_addr_copy(pcmd->mac_addr, sta->addr); + + if (hw->conf.chandef.chan->band == NL80211_BAND_2GHZ) +- rates = sta->supp_rates[NL80211_BAND_2GHZ]; ++ rates = sta->deflink.supp_rates[NL80211_BAND_2GHZ]; + else +- rates = sta->supp_rates[NL80211_BAND_5GHZ] << 5; ++ rates = sta->deflink.supp_rates[NL80211_BAND_5GHZ] << 5; + pcmd->peer_info.legacy_rate_bitmap = cpu_to_le32(rates); + +- if (sta->ht_cap.ht_supported) { ++ if (sta->deflink.ht_cap.ht_supported) { + int i; + + for (i = 0; i < 4; i++) { +- if (i < sta->rx_nss) { ++ if (i < sta->deflink.rx_nss) { + pcmd->peer_info.ht_rates[i] = +- sta->ht_cap.mcs.rx_mask[i]; ++ sta->deflink.ht_cap.mcs.rx_mask[i]; + } else { + pcmd->peer_info.ht_rates[i] = 0; + } + } +- pcmd->peer_info.ht_cap_info = cpu_to_le16(sta->ht_cap.cap); ++ pcmd->peer_info.ht_cap_info = cpu_to_le16(sta->deflink.ht_cap.cap); + pcmd->peer_info.mac_ht_param_info = +- (sta->ht_cap.ampdu_factor & 3) | +- ((sta->ht_cap.ampdu_density & 7) << 2); ++ (sta->deflink.ht_cap.ampdu_factor & 3) | ++ ((sta->deflink.ht_cap.ampdu_density & 7) << 2); + } + +- if (sta->vht_cap.vht_supported) { ++ if (sta->deflink.vht_cap.vht_supported) { + u32 rx_mcs_map_mask = 0; + +- rx_mcs_map_mask = ((0x0000FFFF) >> (sta->rx_nss * 2)) +- << (sta->rx_nss * 2); ++ rx_mcs_map_mask = ((0x0000FFFF) >> (sta->deflink.rx_nss * 2)) ++ << (sta->deflink.rx_nss * 2); + pcmd->peer_info.vht_max_rx_mcs = + cpu_to_le32((*((u32 *) +- &sta->vht_cap.vht_mcs.rx_mcs_map)) | rx_mcs_map_mask); +- pcmd->peer_info.vht_cap = cpu_to_le32(sta->vht_cap.cap); +- pcmd->peer_info.vht_rx_channel_width = sta->bandwidth; ++ &sta->deflink.vht_cap.vht_mcs.rx_mcs_map)) | rx_mcs_map_mask); ++ pcmd->peer_info.vht_cap = cpu_to_le32(sta->deflink.vht_cap.cap); ++ pcmd->peer_info.vht_rx_channel_width = sta->deflink.bandwidth; + } + + pcmd->is_qos_sta = sta->wme; +@@ -2787,9 +2791,9 @@ int mwl_fwcmd_create_ba(struct ieee80211 + pcmd->ba_info.create_params.flags = cpu_to_le32(ba_flags); + pcmd->ba_info.create_params.queue_id = stream->idx; + pcmd->ba_info.create_params.param_info = +- (stream->sta->ht_cap.ampdu_factor & ++ (stream->sta->deflink.ht_cap.ampdu_factor & + IEEE80211_HT_AMPDU_PARM_FACTOR) | +- ((stream->sta->ht_cap.ampdu_density << 2) & ++ ((stream->sta->deflink.ht_cap.ampdu_density << 2) & + IEEE80211_HT_AMPDU_PARM_DENSITY); + if (direction == BA_FLAG_DIRECTION_UP) { + pcmd->ba_info.create_params.reset_seq_no = 0; +@@ -2799,9 +2803,9 @@ int mwl_fwcmd_create_ba(struct ieee80211 + pcmd->ba_info.create_params.current_seq = cpu_to_le16(0); + } + if (priv->chip_type == MWL8964 && +- stream->sta->vht_cap.vht_supported) { ++ stream->sta->deflink.vht_cap.vht_supported) { + pcmd->ba_info.create_params.vht_rx_factor = +- cpu_to_le32((stream->sta->vht_cap.cap & ++ cpu_to_le32((stream->sta->deflink.vht_cap.cap & + IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK) >> + IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT); + } +--- a/hif/pcie/8864/tx.c ++++ b/hif/pcie/8864/tx.c +@@ -490,7 +490,7 @@ static void pcie_non_pfu_tx_done(struct + } else + memmove(dma_data->data - hdrlen, &dma_data->wh, hdrlen); + skb_pull(done_skb, sizeof(*dma_data) - hdrlen); +- ieee80211_tx_status(priv->hw, done_skb); ++ ieee80211_tx_status_skb(priv->hw, done_skb); + dev_kfree_skb_any(done_skb); + done_skb = NULL; + } +@@ -743,7 +743,7 @@ void pcie_8864_tx_xmit(struct ieee80211_ + index = SYSADPT_TX_WMM_QUEUES - index - 1; + txpriority = index; + +- if (sta && sta->ht_cap.ht_supported && ++ if (sta && sta->deflink.ht_cap.ht_supported && + !(xmitcontrol & EAGLE_TXD_XMITCTRL_USE_MC_RATE) && + ieee80211_is_data_qos(wh->frame_control)) { + tid = qos & 0xf; +@@ -925,4 +925,4 @@ void pcie_8864_tx_del_sta_amsdu_pkts(str + } + } + spin_unlock_bh(&sta_info->amsdu_lock); +-} +\ No newline at end of file ++} +--- a/hif/pcie/8964/tx_ndp.c ++++ b/hif/pcie/8964/tx_ndp.c +@@ -287,7 +287,7 @@ static inline int pcie_tx_skb_ndp(struct + skb_get(tx_skb); + pcie_tx_prepare_info(priv, tx_ctrl->rate, tx_info); + tx_ctrl->flags |= TX_CTRL_TYPE_DATA; +- ieee80211_tx_status(priv->hw, tx_skb); ++ ieee80211_tx_status_skb(priv->hw, tx_skb); + } + + if (++tx_send_head_new >= MAX_NUM_TX_DESC) +@@ -483,7 +483,7 @@ void pcie_tx_done_ndp(struct ieee80211_h + } + + pcie_tx_prepare_info(priv, 0, tx_info); +- ieee80211_tx_status(hw, skb); ++ ieee80211_tx_status_skb(hw, skb); + + bypass_ack: + if (++tx_done_tail >= MAX_TX_RING_DONE_SIZE) +@@ -596,13 +596,13 @@ void pcie_tx_xmit_ndp(struct ieee80211_h + ack_skb = skb_copy(skb, GFP_ATOMIC); + ack_info = IEEE80211_SKB_CB(ack_skb); + pcie_tx_prepare_info(priv, 0, ack_info); +- ieee80211_tx_status(hw, ack_skb); ++ ieee80211_tx_status_skb(hw, ack_skb); + } + + pcie_tx_encapsulate_frame(priv, skb, k_conf); + } else { + tid = qos & 0x7; +- if (sta && sta->ht_cap.ht_supported && !eapol_frame && ++ if (sta && sta->deflink.ht_cap.ht_supported && !eapol_frame && + qos != 0xFFFF) { + pcie_tx_count_packet(sta, tid); + spin_lock_bh(&priv->stream_lock); +--- a/hif/pcie/8997/tx.c ++++ b/hif/pcie/8997/tx.c +@@ -81,7 +81,7 @@ static int pcie_txbd_ring_create(struct + wiphy_info(priv->hw->wiphy, + "TX ring: - base: %p, pbase: 0x%x, len: %d\n", + pcie_priv->txbd_ring_vbase, +- pcie_priv->txbd_ring_pbase, ++ (u32)pcie_priv->txbd_ring_pbase, + pcie_priv->txbd_ring_size); + + for (num = 0; num < PCIE_MAX_TXRX_BD; num++) { +@@ -444,7 +444,7 @@ static void pcie_pfu_tx_done(struct mwl_ + } else + memmove(dma_data->data - hdrlen, &dma_data->wh, hdrlen); + skb_pull(done_skb, sizeof(*pfu_dma) - hdrlen); +- ieee80211_tx_status(priv->hw, done_skb); ++ ieee80211_tx_status_skb(priv->hw, done_skb); + } + } + next: +@@ -694,7 +694,7 @@ void pcie_8997_tx_xmit(struct ieee80211_ + index = SYSADPT_TX_WMM_QUEUES - index - 1; + txpriority = index; + +- if (sta && sta->ht_cap.ht_supported && ++ if (sta && sta->deflink.ht_cap.ht_supported && + !(xmitcontrol & EAGLE_TXD_XMITCTRL_USE_MC_RATE) && + ieee80211_is_data_qos(wh->frame_control)) { + tid = qos & 0xf; +@@ -875,4 +875,4 @@ void pcie_8997_tx_del_sta_amsdu_pkts(str + } + } + spin_unlock_bh(&sta_info->amsdu_lock); +-} +\ No newline at end of file ++} +--- a/mac80211.c ++++ b/mac80211.c +@@ -159,7 +159,7 @@ fwcmd_fail: + return rc; + } + +-static void mwl_mac80211_stop(struct ieee80211_hw *hw) ++static void mwl_mac80211_stop(struct ieee80211_hw *hw, bool suspend) + { + mwl_fwcmd_radio_disable(hw); + +@@ -368,15 +368,15 @@ static void mwl_mac80211_bss_info_change + } + } + +- if ((changed & BSS_CHANGED_ASSOC) && vif->bss_conf.assoc) ++ if ((changed & BSS_CHANGED_ASSOC) && vif->cfg.assoc) + mwl_fwcmd_set_aid(hw, vif, (u8 *)vif->bss_conf.bssid, +- vif->bss_conf.aid); ++ vif->cfg.aid); + } + + static void mwl_mac80211_bss_info_changed_ap(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_bss_conf *info, +- u32 changed) ++ u64 changed) + { + struct mwl_priv *priv = hw->priv; + struct mwl_vif *mwl_vif; +@@ -426,8 +426,8 @@ static void mwl_mac80211_bss_info_change + if (changed & (BSS_CHANGED_BEACON_INT | BSS_CHANGED_BEACON)) { + struct sk_buff *skb; + +- if ((info->ssid[0] != '\0') && +- (info->ssid_len != 0) && ++ if ((vif->cfg.ssid[0] != '\0') && ++ (vif->cfg.ssid_len != 0) && + (!info->hidden_ssid)) { + if (mwl_vif->broadcast_ssid != true) { + mwl_fwcmd_broadcast_ssid_enable(hw, vif, true); +@@ -441,7 +441,7 @@ static void mwl_mac80211_bss_info_change + } + + if (!mwl_vif->set_beacon) { +- skb = ieee80211_beacon_get(hw, vif); ++ skb = ieee80211_beacon_get(hw, vif, 0); + + if (skb) { + mwl_fwcmd_set_beacon(hw, vif, skb->data, skb->len); +@@ -458,7 +458,7 @@ static void mwl_mac80211_bss_info_change + static void mwl_mac80211_bss_info_changed(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_bss_conf *info, +- u32 changed) ++ u64 changed) + { + switch (vif->type) { + case NL80211_IFTYPE_AP: +@@ -583,10 +583,10 @@ static int mwl_mac80211_sta_add(struct i + if (vif->type == NL80211_IFTYPE_MESH_POINT) + sta_info->is_mesh_node = true; + +- if (sta->ht_cap.ht_supported) { ++ if (sta->deflink.ht_cap.ht_supported) { + sta_info->is_ampdu_allowed = true; + sta_info->is_amsdu_allowed = false; +- if (sta->ht_cap.cap & IEEE80211_HT_CAP_MAX_AMSDU) { ++ if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_MAX_AMSDU) { + sta_info->amsdu_ctrl.cap = MWL_AMSDU_SIZE_8K; + sta_info->amsdu_ctrl.amsdu_allow_size = SYSADPT_AMSDU_8K_MAX_SIZE; + } +@@ -670,7 +670,7 @@ static int mwl_mac80211_sta_remove(struc + + static int mwl_mac80211_conf_tx(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, +- u16 queue, ++ unsigned int link_id, u16 queue, + const struct ieee80211_tx_queue_params *params) + { + struct mwl_priv *priv = hw->priv; +@@ -934,4 +934,9 @@ const struct ieee80211_ops mwl_mac80211_ + .pre_channel_switch = mwl_mac80211_chnl_switch, + .sw_scan_start = mwl_mac80211_sw_scan_start, + .sw_scan_complete = mwl_mac80211_sw_scan_complete, ++ .wake_tx_queue = ieee80211_handle_wake_tx_queue, ++ .add_chanctx = ieee80211_emulate_add_chanctx, ++ .remove_chanctx = ieee80211_emulate_remove_chanctx, ++ .change_chanctx = ieee80211_emulate_change_chanctx, ++ .switch_vif_chanctx = ieee80211_emulate_switch_vif_chanctx, + }; +--- a/utils.c ++++ b/utils.c +@@ -173,9 +173,9 @@ u32 utils_get_init_tx_rate(struct mwl_pr + u32 tx_rate; + u16 format, nss, bw, rate_mcs; + +- if (sta->vht_cap.vht_supported) ++ if (sta->deflink.vht_cap.vht_supported) + format = TX_RATE_FORMAT_11AC; +- else if (sta->ht_cap.ht_supported) ++ else if (sta->deflink.ht_cap.ht_supported) + format = TX_RATE_FORMAT_11N; + else + format = TX_RATE_FORMAT_LEGACY; +@@ -192,11 +192,11 @@ u32 utils_get_init_tx_rate(struct mwl_pr + nss = 3; + break; + default: +- nss = sta->rx_nss; ++ nss = sta->deflink.rx_nss; + break; + } +- if (nss > sta->rx_nss) +- nss = sta->rx_nss; ++ if (nss > sta->deflink.rx_nss) ++ nss = sta->deflink.rx_nss; + + switch (conf->chandef.width) { + case NL80211_CHAN_WIDTH_20_NOHT: +@@ -213,11 +213,11 @@ u32 utils_get_init_tx_rate(struct mwl_pr + bw = TX_RATE_BANDWIDTH_160; + break; + default: +- bw = sta->bandwidth; ++ bw = sta->deflink.bandwidth; + break; + } +- if (bw > sta->bandwidth) +- bw = sta->bandwidth; ++ if (bw > sta->deflink.bandwidth) ++ bw = sta->deflink.bandwidth; + + switch (format) { + case TX_RATE_FORMAT_LEGACY: +--- a/hif/pcie/pcie.c ++++ b/hif/pcie/pcie.c +@@ -546,7 +546,7 @@ static irqreturn_t pcie_isr_8864(struct + + if (int_status & MACREG_A2HRIC_BIT_RADAR_DETECT) { + wiphy_info(hw->wiphy, "radar detected by firmware\n"); +- ieee80211_radar_detected(hw); ++ ieee80211_radar_detected(hw, NULL); + } + + if (int_status & MACREG_A2HRIC_BIT_CHAN_SWITCH) ieee80211_queue_work(hw, &priv->chnl_switch_handle); +@@ -593,7 +593,7 @@ static irqreturn_t pcie_isr_8997(struct + + if (int_status & MACREG_A2HRIC_BIT_RADAR_DETECT) { + wiphy_info(hw->wiphy, "radar detected by firmware\n"); +- ieee80211_radar_detected(hw); ++ ieee80211_radar_detected(hw, NULL); + } + + if (int_status & MACREG_A2HRIC_BIT_CHAN_SWITCH) +@@ -1071,7 +1071,7 @@ static irqreturn_t pcie_isr_ndp(struct i + + if (int_status & MACREG_A2HRIC_NEWDP_DFS) { + wiphy_info(hw->wiphy, "radar detected by firmware\n"); +- ieee80211_radar_detected(hw); ++ ieee80211_radar_detected(hw, NULL); + } + + if (int_status & MACREG_A2HRIC_NEWDP_CHANNEL_SWITCH)