commit d18601cec354466a11aae2e9598121519fd8c74e
Author: Nicolas Viéville <nicolas.vieville(a)uphf.fr>
Date: Fri Dec 4 08:31:49 2020 +0100
Add patch for kernel >= 5.10 - get_fs and set_fs macros removed - first attempt
wl-kmod-020_kernel_5.10_get_set_fs_removed.patch | 93 ++++++++++++++++++++++++
wl-kmod.spec | 7 +-
2 files changed, 99 insertions(+), 1 deletion(-)
---
diff --git a/wl-kmod-020_kernel_5.10_get_set_fs_removed.patch
b/wl-kmod-020_kernel_5.10_get_set_fs_removed.patch
new file mode 100644
index 0000000..7d886cd
--- /dev/null
+++ b/wl-kmod-020_kernel_5.10_get_set_fs_removed.patch
@@ -0,0 +1,93 @@
+diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_cfg80211_hybrid.c
hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_cfg80211_hybrid.c
+---
hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_cfg80211_hybrid.c 2019-10-16
16:33:57.319456000 +0200
++++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_cfg80211_hybrid.c 2020-11-12
14:33:56.075438464 +0100
+@@ -477,7 +477,9 @@
+ {
+ struct ifreq ifr;
+ struct wl_ioctl ioc;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
+ mm_segment_t fs;
++#endif
+ s32 err = 0;
+
+ BUG_ON(len < sizeof(int));
+@@ -489,18 +491,22 @@
+ strcpy(ifr.ifr_name, dev->name);
+ ifr.ifr_data = (caddr_t)&ioc;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
+ fs = get_fs();
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
+ set_fs(KERNEL_DS);
+ #else
+ set_fs(get_ds());
+ #endif
++#endif
+ #if defined(WL_USE_NETDEV_OPS)
+ err = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
+ #else
+ err = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
+ #endif
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
+ set_fs(fs);
++#endif
+
+ return err;
+ }
+diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_iw.c
hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_iw.c
+--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_iw.c 2019-05-30
01:32:34.421426000 +0200
++++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_iw.c 2020-11-12
14:33:56.101438714 +0100
+@@ -105,7 +105,9 @@
+ {
+ struct ifreq ifr;
+ wl_ioctl_t ioc;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
+ mm_segment_t fs;
++#endif
+ int ret;
+
+ memset(&ioc, 0, sizeof(ioc));
+@@ -116,18 +118,22 @@
+ strcpy(ifr.ifr_name, dev->name);
+ ifr.ifr_data = (caddr_t) &ioc;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
+ fs = get_fs();
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
+ set_fs(KERNEL_DS);
+ #else
+ set_fs(get_ds());
+ #endif
++#endif
+ #if defined(WL_USE_NETDEV_OPS)
+ ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
+ #else
+ ret = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
+ #endif
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
+ set_fs(fs);
++#endif
+
+ return ret;
+ }
+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/src/wl/sys/wl_linux.c
+--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c 2020-11-11
13:39:00.579562572 +0100
++++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.c 2020-11-11
23:14:57.451165706 +0100
+@@ -1659,6 +1659,7 @@
+ goto done2;
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
+ if (uaccess_kernel())
+ #else
+@@ -1667,6 +1668,9 @@
+ buf = ioc.buf;
+
+ else if (ioc.buf) {
++#else
++ if (ioc.buf) {
++#endif
+ if (!(buf = (void *) MALLOC(wl->osh, MAX(ioc.len, WLC_IOCTL_MAXLEN)))) {
+ bcmerror = BCME_NORESOURCE;
+ goto done2;
diff --git a/wl-kmod.spec b/wl-kmod.spec
index b58f209..fbb6e31 100644
--- a/wl-kmod.spec
+++ b/wl-kmod.spec
@@ -10,7 +10,7 @@
Name: wl-kmod
Version: 6.30.223.271
-Release: 34%{?dist}
+Release: 35%{?dist}
Summary: Kernel module for Broadcom wireless devices
Group: System Environment/Kernel
License: Redistributable, no modification permitted
@@ -37,6 +37,7 @@ Patch15: wl-kmod-016_fix_unsupported_mesh_point.patch
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
# needed for plague to make sure it builds for i586 and i686
ExclusiveArch: i686 x86_64
@@ -96,6 +97,7 @@ pushd %{name}-%{version}-src
%patch16 -p1 -b .fix_gcc_fallthrough_warning.patch
%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
# Manual patching to build for RHEL - inspired by CentOS wl-kmod.spec
# Actually works for RHEL 6.x and 7.x
@@ -285,6 +287,9 @@ chmod 0755
$RPM_BUILD_ROOT%{kmodinstdir_prefix}*%{kmodinstdir_postfix}/* || :
rm -rf $RPM_BUILD_ROOT
%changelog
+* Sat Nov 28 2020 Nicolas Viéville <nicolas.vieville(a)uphf.fr> - 6.30.223.271-35
+- Add patch for kernel >= 5.10 - get_fs and set_fs macros removed - first attempt
+
* Wed Nov 11 2020 Nicolas Viéville <nicolas.vieville(a)uphf.fr> - 6.30.223.271-34
- Add patch for kernel >= 5.9 - fixes RFBZ#5835