Date: Monday, May 30, 2022 @ 18:38:23 Author: heftig Revision: 1216848
6.30.223.271-31: FS#74338 Replace 012-linux517.patch Modified: broadcom-wl-dkms/trunk/012-linux517.patch broadcom-wl-dkms/trunk/PKGBUILD --------------------+ 012-linux517.patch | 107 +++++++++++++++++++++++++++++++++++---------------- PKGBUILD | 4 - 2 files changed, 76 insertions(+), 35 deletions(-) Modified: 012-linux517.patch =================================================================== --- 012-linux517.patch 2022-05-30 18:34:26 UTC (rev 1216847) +++ 012-linux517.patch 2022-05-30 18:38:23 UTC (rev 1216848) @@ -1,39 +1,80 @@ -diff -u -r a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c ---- a/src/wl/sys/wl_linux.c 2022-03-23 00:35:42.930416350 +0000 -+++ b/src/wl/sys/wl_linux.c 2022-03-23 00:40:12.903771013 +0000 -@@ -2980,7 +2980,11 @@ +From 31b7849092c43805c7fbaf7518b99874aa1b310c Mon Sep 17 00:00:00 2001 +From: Joan Bruguera <[email protected]> +Date: Wed, 12 Jan 2022 20:49:20 +0100 +Subject: [PATCH] Tentative fix for broadcom-wl 6.30.223.271 driver for Linux 5.17-rc1 + +Set netdev->dev_addr through dev_addr_mod + PDE_DATA fix + +Since Linux 5.17 netdev->dev_addr is const and must be changed through +dev_addr_mod, otherwise a warning is logged in dmesg and bad things may happen. + +NB: The #if is not wrong, dev_addr_mod is defined since Linux 5.15-rc1 + +Plus a trivial fix for PDE_DATA. + +Applies on top of all the patches applied to broadcom-wl-dkms 6.30.223.271-28 on Arch Linux. + +See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=adeef3e32146a8d2a73c399dc6f5d76a449131b1 + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=359745d78351c6f5442435f81549f0207ece28aa +--- + src/wl/sys/wl_linux.c | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c +index e491df7..e4614fb 100644 +--- a/src/wl/sys/wl_linux.c ++++ b/src/wl/sys/wl_linux.c +@@ -93,6 +93,10 @@ struct iw_statistics *wl_get_wireless_stats(struct net_device *dev); + + #include <wlc_wowl.h> + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)) ++#define PDE_DATA pde_data ++#endif ++ + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) + static void wl_timer(struct timer_list *tl); + #else +@@ -490,6 +494,12 @@ wl_if_setup(struct net_device *dev) + #endif + } + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) ++static inline void eth_hw_addr_set(struct net_device *dev, const void *addr) { ++ memcpy(dev->dev_addr, addr, ETHER_ADDR_LEN); ++} ++#endif ++ + static wl_info_t * + wl_attach(uint16 vendor, uint16 device, ulong regs, + uint bustype, void *btparam, uint irq, uchar* bar1_addr, uint32 bar1_size) +@@ -634,7 +644,7 @@ wl_attach(uint16 vendor, uint16 device, ulong regs, + WL_ERROR(("wl%d: Error setting MAC ADDRESS\n", unit)); + } + #endif +- bcopy(&wl->pub->cur_etheraddr, dev->dev_addr, ETHER_ADDR_LEN); ++ eth_hw_addr_set(dev, wl->pub->cur_etheraddr.octet); + + online_cpus = 1; + +@@ -1835,7 +1845,7 @@ wl_set_mac_address(struct net_device *dev, void *addr) + + WL_LOCK(wl); + +- bcopy(sa->sa_data, dev->dev_addr, ETHER_ADDR_LEN); ++ eth_hw_addr_set(dev, sa->sa_data); + err = wlc_iovar_op(wl->wlc, "cur_etheraddr", NULL, 0, sa->sa_data, ETHER_ADDR_LEN, + IOV_SET, (WL_DEV_IF(dev))->wlcif); + WL_UNLOCK(wl); +@@ -3010,7 +3020,7 @@ _wl_add_monitor_if(wl_task_t *task) else dev->type = ARPHRD_IEEE80211_RADIOTAP; -+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) - bcopy(wl->dev->dev_addr, dev->dev_addr, ETHER_ADDR_LEN); -+#else -+ eth_hw_addr_set(wl->dev, dev->dev_addr); -+#endif +- bcopy(wl->dev->dev_addr, dev->dev_addr, ETHER_ADDR_LEN); ++ eth_hw_addr_set(dev, wl->dev->dev_addr); #if defined(WL_USE_NETDEV_OPS) dev->netdev_ops = &wl_netdev_monitor_ops; -@@ -3261,7 +3265,11 @@ - static ssize_t - wl_proc_read(struct file *filp, char __user *buffer, size_t length, loff_t *offp) - { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) - wl_info_t * wl = PDE_DATA(file_inode(filp)); -+#else -+ wl_info_t * wl = pde_data(file_inode(filp)); -+#endif - #endif - int bcmerror, len; - int to_user = 0; -@@ -3318,7 +3326,11 @@ - static ssize_t - wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t *offp) - { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) - wl_info_t * wl = PDE_DATA(file_inode(filp)); -+#else -+ wl_info_t * wl = pde_data(file_inode(filp)); -+#endif - #endif - int from_user = 0; - int bcmerror; +-- +2.35.1 + Modified: PKGBUILD =================================================================== --- PKGBUILD 2022-05-30 18:34:26 UTC (rev 1216847) +++ PKGBUILD 2022-05-30 18:38:23 UTC (rev 1216848) @@ -6,7 +6,7 @@ pkgname=broadcom-wl-dkms pkgver=6.30.223.271 -pkgrel=30 +pkgrel=31 pkgdesc='Broadcom 802.11 Linux STA wireless driver' arch=(x86_64) url='https://www.broadcom.com/support/download-search/?pf=Wireless+LAN+Infrastructure' @@ -43,7 +43,7 @@ '7c8012fa51592a3fca6dfde7a7a9c6dd37eb6c406d3f8695927e32c9e714c3faa23295b116a6cd97ec0403b123747b9095883bd7e3abe6c1888c3c9a4630f9f4' '21f7fc163ffcf6857f3a21a8519a42600fd6b3658d14b32191ef1142c817c10c8dc691a3bc39228927ac29d7b7ac5c3a62eb786853046bacb9cc74efb51b6cb0' 'c1f522f6554a7bfe0f7b789b042ada14316ecc87bc196c83bec95f684152f323a4c31f60ff26843e36338b8c7949bf36719a5c8afa439ff71f7c74dae4c755b6' - '978f7ce1e86bcfb8800faaa3b8b40c52e13bfbf13e5b439efe602aa7787c8e230d808519ae43afbe028275cdf01d7ed3cecbeea3e276cd1bd133037ae948f21c' + 'd84d08161530bb9f05f627ec798a0897643869ea9b80781ae9eee85b072922c52e5127e55f04265c53fcfedc4e9da166eb3bb9f9fc2e139d62517ec54c2f45bb' 'e5ae3570dc2f27105c50e6dec807c1f4f1a2824995e0951e7ff405114d519e4f33992d8d2ea2c2d4fc3f9271d57f89bfb5b6b5c79af2c89492209a86ad673456' 'e9d01c1a1a63c07f720e3ee53ee3ef634ab12694135300cb0ce47ade0e9e0084967a0b6df64d983e8184240eb3defb128f650bddb7727e901d50315307f3398a')
