commit c89e5d9808189084cf2f48b9040b4b00939bd180
Author: Nicolas Viéville <nicolas.vieville(a)uphf.fr>
Date: Sat Apr 2 12:48:15 2022 +0200
Add patch for kernel >= 5.17 - fixes RFBZ#6260
wl-kmod-021_kernel_5.17_adaptation.patch | 78 ++++++++++++++++++++++++++++++++
wl-kmod.spec | 7 ++-
2 files changed, 84 insertions(+), 1 deletion(-)
---
diff --git a/wl-kmod-021_kernel_5.17_adaptation.patch
b/wl-kmod-021_kernel_5.17_adaptation.patch
new file mode 100644
index 0000000..89dc158
--- /dev/null
+++ b/wl-kmod-021_kernel_5.17_adaptation.patch
@@ -0,0 +1,78 @@
+diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_iw.h
hybrid-v35_64-nodebug-pcoem-6_30_223_271-021_kernel_5.17_adaptation/src/wl/sys/wl_iw.h
+--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_iw.h 2020-12-29
18:29:39.463940664 +0100
++++
hybrid-v35_64-nodebug-pcoem-6_30_223_271-021_kernel_5.17_adaptation/src/wl/sys/wl_iw.h 2022-04-01
10:25:05.515054893 +0200
+@@ -70,7 +70,9 @@
+ #define WL_IW_RSSI_EXCELLENT -57
+ #define WL_IW_RSSI_INVALID 0
+ #define MAX_WX_STRING 80
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
+ #define isprint(c) bcm_isprint(c)
++#endif
+ #define WL_IW_SET_ACTIVE_SCAN (SIOCIWFIRSTPRIV+1)
+ #define WL_IW_GET_RSSI (SIOCIWFIRSTPRIV+3)
+ #define WL_IW_SET_PASSIVE_SCAN (SIOCIWFIRSTPRIV+5)
+diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c
hybrid-v35_64-nodebug-pcoem-6_30_223_271-021_kernel_5.17_adaptation/src/wl/sys/wl_linux.c
+--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c 2020-12-29
21:55:44.899067286 +0100
++++
hybrid-v35_64-nodebug-pcoem-6_30_223_271-021_kernel_5.17_adaptation/src/wl/sys/wl_linux.c 2022-04-01
10:00:24.985252480 +0200
+@@ -638,7 +638,11 @@
+ WL_ERROR(("wl%d: Error setting MAC ADDRESS\n", unit));
+ }
+ #endif
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
+ bcopy(&wl->pub->cur_etheraddr, dev->dev_addr, ETHER_ADDR_LEN);
++#else
++ dev_addr_mod(dev, 0, &wl->pub->cur_etheraddr, ETHER_ADDR_LEN);
++#endif
+
+ online_cpus = 1;
+
+@@ -1862,7 +1866,11 @@
+
+ WL_LOCK(wl);
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
+ bcopy(sa->sa_data, dev->dev_addr, ETHER_ADDR_LEN);
++#else
++ dev_addr_mod(dev, 0, sa->sa_data, ETHER_ADDR_LEN);
++#endif
+ 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);
+@@ -3054,7 +3062,11 @@
+ 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
++ dev_addr_mod(dev, 0, wl->dev->dev_addr, ETHER_ADDR_LEN);
++#endif
+
+ #if defined(WL_USE_NETDEV_OPS)
+ dev->netdev_ops = &wl_netdev_monitor_ops;
+@@ -3335,8 +3347,12 @@
+ 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;
+ char tmp[8];
+@@ -3392,8 +3408,12 @@
+ 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;
+
diff --git a/wl-kmod.spec b/wl-kmod.spec
index d84f60f..a56103c 100644
--- a/wl-kmod.spec
+++ b/wl-kmod.spec
@@ -10,7 +10,7 @@
Name: wl-kmod
Version: 6.30.223.271
-Release: 40%{?dist}
+Release: 41%{?dist}
Summary: Kernel module for Broadcom wireless devices
Group: System Environment/Kernel
License: Redistributable, no modification permitted
@@ -38,6 +38,7 @@ Patch16: wl-kmod-017_fix_gcc_fallthrough_warning.patch
Patch17: wl-kmod-018_kernel_5.6_adaptations.patch
Patch18: wl-kmod-019_kernel_5.9_segment_eq_removed.patch
Patch19: wl-kmod-020_kernel_5.10_get_set_fs_removed.patch
+Patch20: wl-kmod-021_kernel_5.17_adaptation.patch
# needed for plague to make sure it builds for i586 and i686
ExclusiveArch: i686 x86_64
@@ -98,6 +99,7 @@ pushd %{name}-%{version}-src
%patch17 -p1 -b .kernel_5.6_adaptations.patch
%patch18 -p1 -b .kernel_5.9_segment_eq_removed
%patch19 -p1 -b .kernel_5.10_get_set_fs_removed
+%patch20 -p1 -b .kernel_5.17_adaptation
# Manual patching to build for RHEL - inspired by CentOS wl-kmod.spec
# Actually works for RHEL 6.x and 7.x
@@ -287,6 +289,9 @@ chmod 0755
$RPM_BUILD_ROOT%{kmodinstdir_prefix}*%{kmodinstdir_postfix}/* || :
rm -rf $RPM_BUILD_ROOT
%changelog
+* Fri Apr 01 2022 Nicolas Viéville <nicolas.vieville(a)uphf.fr> - 6.30.223.271-41
+- Add patch for kernel >= 5.17 - fixes RFBZ#6260
+
* Thu Feb 10 2022 RPM Fusion Release Engineering <sergiomb(a)rpmfusion.org> -
6.30.223.271-40
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild