commit 42215bf368136b7fa0da25750ad27fce5d9948f1
Author: leigh123linux <leigh123linux(a)googlemail.com>
Date: Fri Dec 20 09:54:36 2019 +0000
Patch for 5.3 and 5.4 kernel
ndiswrapper-5.3-kernel.patch | 16 ++++++++++++++++
ndiswrapper-5.4-kernel.patch | 25 +++++++++++++++++++++++++
ndiswrapper-kmod.spec | 9 ++++++++-
3 files changed, 49 insertions(+), 1 deletion(-)
---
diff --git a/ndiswrapper-5.3-kernel.patch b/ndiswrapper-5.3-kernel.patch
new file mode 100644
index 0000000..c19bde5
--- /dev/null
+++ b/ndiswrapper-5.3-kernel.patch
@@ -0,0 +1,16 @@
+Index: ndiswrapper-1.60/driver/ntoskernel.h
+===================================================================
+--- ndiswrapper-1.60.orig/driver/ntoskernel.h
++++ ndiswrapper-1.60/driver/ntoskernel.h
+@@ -109,7 +109,11 @@ static cpumask_t cpumasks[NR_CPUS];
+ #endif /* CONFIG_SMP */
+
+ #ifndef tsk_cpus_allowed
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
+ #define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed)
++#else
++#define tsk_cpus_allowed(tsk) ((tsk)->cpus_ptr)
++#endif
+ #endif
+
+ #ifndef __packed
diff --git a/ndiswrapper-5.4-kernel.patch b/ndiswrapper-5.4-kernel.patch
new file mode 100644
index 0000000..f5bb0b7
--- /dev/null
+++ b/ndiswrapper-5.4-kernel.patch
@@ -0,0 +1,25 @@
+Description: Fix FTBFS with kernel 5.4
+Author: Paolo Pisati <paolo.pisati(a)canonical.com>
+Bug-Ubuntu:
https://bugs.launchpad.net/bugs/1848588
+
+--- a/driver/wrapndis.c
++++ b/driver/wrapndis.c
+@@ -457,10 +457,18 @@
+ for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
+ skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
+ sg_element++;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0)
+ sg_element->length = frag->size;
++#else
++ sg_element->length = skb_frag_size(frag);
++#endif
+ sg_element->address =
+ pci_map_page(wnd->wd->pci.pdev, skb_frag_page(frag),
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0)
+ frag->page_offset, frag->size,
++#else
++ skb_frag_off(frag), skb_frag_size(frag),
++#endif
+ PCI_DMA_TODEVICE);
+ TRACE3("%llx, %u", sg_element->address, sg_element->length);
+ }
diff --git a/ndiswrapper-kmod.spec b/ndiswrapper-kmod.spec
index a554707..a44ab3f 100644
--- a/ndiswrapper-kmod.spec
+++ b/ndiswrapper-kmod.spec
@@ -13,7 +13,7 @@
Summary: Ndiswrapper kernel module
Name: ndiswrapper-kmod
Version: 1.61
-Release: 11%{?pre}%{?dist}
+Release: 12%{?pre}%{?dist}
License: GPLv2
URL:
http://ndiswrapper.sourceforge.net
Source0:
http://downloads.sf.net/ndiswrapper/ndiswrapper-%{version}%{?pre}.tar.gz
@@ -23,6 +23,8 @@ Patch1: ndiswrapper-4.11-kernel.patch
Patch2: ndiswrapper-4.13-kernel.patch
Patch3: ndiswrapper-4.15-kernel.patch
Patch4: ndiswrapper-5.0-kernel.patch
+Patch5: ndiswrapper-5.3-kernel.patch
+Patch6: ndiswrapper-5.4-kernel.patch
# needed for plague to make sure it builds for i586 and i686
ExclusiveArch: i686 x86_64
@@ -57,6 +59,8 @@ kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name}
--filterfi
%patch2 -p2 -b .orig
%patch3 -p1 -b .orig
%patch4 -p1 -b .orig
+%patch5 -p1 -b .orig
+%patch6 -p1 -b .orig
)
sed -i 's|/sbin/depmod -a|/bin/true|'
ndiswrapper-%{version}%{?pre}/driver/Makefile
for kernel_version in %{?kernel_versions} ; do
@@ -79,6 +83,9 @@ done
%changelog
+* Fri Dec 20 2019 Leigh Scott <leigh123linux(a)googlemail.com> - 1.61-12
+- Patch for 5.3 and 5.4 kernel
+
* Fri Aug 09 2019 RPM Fusion Release Engineering <leigh123linux(a)gmail.com> -
1.61-11
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild