commit 76cb558738f7943194ecdc5e1619bc2c727f4ee4
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Wed Apr 22 18:41:55 2020 +0100
Update to 1.62
kernel-5.3.patch | 69 ++++++++
ndiswrapper-5.4-kernel.patch => kernel-5.4.patch | 9 +-
kernel-5.5.patch | 72 ++++++++
kernel-5.6.patch | 85 ++++++++++
ndiswrapper-4.11-kernel.patch | 47 ------
ndiswrapper-4.13-kernel.patch | 30 ----
ndiswrapper-4.15-kernel.patch | 199 -----------------------
ndiswrapper-5.0-kernel.patch | 48 ------
ndiswrapper-5.3-kernel.patch | 16 --
ndiswrapper-kmod-nomodinfo.patch | 2 +-
ndiswrapper-kmod.spec | 21 ++-
sources | 2 +-
12 files changed, 241 insertions(+), 359 deletions(-)
---
diff --git a/kernel-5.3.patch b/kernel-5.3.patch
new file mode 100644
index 0000000..6125c78
--- /dev/null
+++ b/kernel-5.3.patch
@@ -0,0 +1,69 @@
+diff --git a/driver/ntoskernel.c b/driver/ntoskernel.c
+index 4fe0dc1..4dd7a89 100644
+--- a/driver/ntoskernel.c
++++ b/driver/ntoskernel.c
+@@ -2546,7 +2546,11 @@ int ntoskernel_init(void)
+ info->task = NULL;
+ info->count = 0;
+ #ifdef CONFIG_SMP
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
+ cpumask_setall(&info->cpus_allowed);
++#else
++ cpumask_setall(&info->cpus_mask);
++#endif
+ #endif
+ }
+ } while (0);
+diff --git a/driver/ntoskernel.h b/driver/ntoskernel.h
+index 3c4c6ff..8a71ae3 100644
+--- a/driver/ntoskernel.h
++++ b/driver/ntoskernel.h
+@@ -110,7 +110,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_mask)
++#endif
+ #endif
+
+ #ifndef __packed
+@@ -638,7 +642,12 @@ struct irql_info {
+ int count;
+ struct mutex lock;
+ #ifdef CONFIG_SMP
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
+ cpumask_t cpus_allowed;
++#else
++ const cpumask_t *cpus_ptr;
++ cpumask_t cpus_mask;
++#endif
+ #endif
+ struct task_struct *task;
+ };
+@@ -665,7 +674,11 @@ static inline KIRQL raise_irql(KIRQL newirql)
+ /* TODO: is this enough to pin down to current cpu? */
+ #ifdef CONFIG_SMP
+ assert(task_cpu(current) == smp_processor_id());
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
+ cpumask_copy(&info->cpus_allowed, tsk_cpus_allowed(current));
++#else
++ cpumask_copy(&info->cpus_mask, tsk_cpus_allowed(current));
++#endif
+ set_cpus_allowed_ptr(current, cpumask_of(smp_processor_id()));
+ #endif
+ put_cpu_var(irql_info);
+@@ -689,7 +702,11 @@ static inline void lower_irql(KIRQL oldirql)
+ if (--info->count == 0) {
+ info->task = NULL;
+ #ifdef CONFIG_SMP
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
+ set_cpus_allowed_ptr(current, &info->cpus_allowed);
++#else
++ set_cpus_allowed_ptr(current, &info->cpus_mask);
++#endif
+ #endif
+ mutex_unlock(&info->lock);
+ }
diff --git a/ndiswrapper-5.4-kernel.patch b/kernel-5.4.patch
similarity index 76%
rename from ndiswrapper-5.4-kernel.patch
rename to kernel-5.4.patch
index f5bb0b7..08495d6 100644
--- a/ndiswrapper-5.4-kernel.patch
+++ b/kernel-5.4.patch
@@ -1,9 +1,6 @@
-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
+diff -u -r a/driver/wrapndis.c b/driver/wrapndis.c
+--- a/driver/wrapndis.c 2019-02-11 04:11:14.000000000 +0000
++++ b/driver/wrapndis.c 2019-11-26 00:02:39.035464963 +0000
@@ -457,10 +457,18 @@
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
diff --git a/kernel-5.5.patch b/kernel-5.5.patch
new file mode 100644
index 0000000..45cd0c1
--- /dev/null
+++ b/kernel-5.5.patch
@@ -0,0 +1,72 @@
+diff -u -r a/driver/lin2win.S b/driver/lin2win.S
+--- a/driver/lin2win.S 2019-02-11 04:11:14.000000000 +0000
++++ b/driver/lin2win.S 2020-01-27 22:33:17.363779223 +0000
+@@ -14,6 +14,7 @@
+ */
+
+ #include <linux/linkage.h>
++#include <linux/version.h>
+
+ .text
+
+@@ -71,8 +72,12 @@
+ * We get (ARGC + 1) arguments.
+ */
+ .macro lin2win name, argc
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0)
+ .type \name, @function
+ ENTRY(\name)
++#else
++ SYM_FUNC_START(\name)
++#endif
+
+ /* Create a call frame - it's optional, but good for debugging */
+ .cfi_startproc
+@@ -125,7 +130,11 @@
+ .cfi_restore %rbp
+ ret
+ .cfi_endproc
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0)
+ .size \name, (. - \name)
++#else
++ SYM_FUNC_END(\name)
++#endif
+ .endm
+
+ /* Define lin2winN functions */
+diff -u -r a/driver/win2lin_stubs.S b/driver/win2lin_stubs.S
+--- a/driver/win2lin_stubs.S 2019-02-11 04:11:14.000000000 +0000
++++ b/driver/win2lin_stubs.S 2020-01-27 22:33:20.867163026 +0000
+@@ -14,6 +14,7 @@
+ */
+
+ #include <linux/linkage.h>
++#include <linux/version.h>
+
+ #ifdef CONFIG_X86_64
+
+@@ -141,8 +142,12 @@
+
+ /* Declare function LONGNAME, call function SHORTNAME with ARGC arguments */
+ .macro win2linm longname, shortname, argc
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0)
+ .type \longname, @function
+ ENTRY(\longname)
++#else
++ SYM_FUNC_START(\longname)
++#endif
+
+ /* Create a call frame - it's optional, but good for debugging */
+ .cfi_startproc
+@@ -243,7 +248,11 @@
+ .cfi_restore %rbp
+ ret
+ .cfi_endproc
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0)
+ .size \longname, (. - \longname)
++#else
++ SYM_FUNC_END(\longname)
++#endif
+ .endm
+
+ #define win2lin(name, argc) win2linm win2lin_ ## name ## _ ## argc, name, argc
diff --git a/kernel-5.6.patch b/kernel-5.6.patch
new file mode 100644
index 0000000..9fd7d61
--- /dev/null
+++ b/kernel-5.6.patch
@@ -0,0 +1,85 @@
+diff --git a/driver/ntoskernel.c b/driver/ntoskernel.c
+index fccb28e..cd87740 100644
+--- a/driver/ntoskernel.c
++++ b/driver/ntoskernel.c
+@@ -1763,9 +1763,9 @@ wstdcall void __iomem *WIN_FUNC(MmMapIoSpace,3)
+ void __iomem *virt;
+ ENTER1("cache type: %d", cache);
+ if (cache == MmCached)
+- virt = ioremap(phys_addr, size);
++ virt = ioremap_cache(phys_addr, size);
+ else
+- virt = ioremap_nocache(phys_addr, size);
++ virt = ioremap(phys_addr, size);
+ TRACE1("%llx, %zu, %p", phys_addr, size, virt);
+ return virt;
+ }
+diff --git a/driver/proc.c b/driver/proc.c
+index 8a8cf2b..2622228 100644
+--- a/driver/proc.c
++++ b/driver/proc.c
+@@ -70,7 +70,11 @@ static inline void *PDE_DATA(const struct inode *inode)
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
+ static inline struct proc_dir_entry *proc_create_data(const char *name,
+ umode_t mode, struct proc_dir_entry *parent,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
++ struct proc_ops *fops, void *data)
++#else
+ struct file_operations *fops, void *data)
++#endif
+ {
+ struct proc_dir_entry *de;
+
+@@ -86,7 +90,11 @@ static inline struct proc_dir_entry *proc_create_data(const char
*name,
+
+ static int do_proc_make_entry(const char *name, umode_t mode,
+ struct proc_dir_entry *parent,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
++ struct proc_ops *fops, kuid_t uid,
++#else
+ struct file_operations *fops, kuid_t uid,
++#endif
+ kgid_t gid, struct ndis_device *wnd)
+ {
+ struct proc_dir_entry *de;
+@@ -100,6 +108,32 @@ static int do_proc_make_entry(const char *name, umode_t mode,
+ return 0;
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
++#define PROC_DECLARE_RO(name) \
++ static int proc_##name##_open(struct inode *inode, struct file *file) \
++ { \
++ return single_open(file, proc_##name##_read, PDE_DATA(inode)); \
++ } \
++ static struct proc_ops name##_fops = { \
++ .proc_open = proc_##name##_open, \
++ .proc_read = seq_read, \
++ .proc_lseek = seq_lseek, \
++ .proc_release = single_release, \
++ };
++
++#define PROC_DECLARE_RW(name) \
++ static int proc_##name##_open(struct inode *inode, struct file *file) \
++ { \
++ return single_open(file, proc_##name##_read, PDE_DATA(inode)); \
++ } \
++ static struct proc_ops name##_fops = { \
++ .proc_open = proc_##name##_open, \
++ .proc_read = seq_read, \
++ .proc_lseek = seq_lseek, \
++ .proc_release = single_release, \
++ .proc_write = proc_##name##_write, \
++ };
++#else
+ #define PROC_DECLARE_RO(name) \
+ static int proc_##name##_open(struct inode *inode, struct file *file) \
+ { \
+@@ -126,6 +160,7 @@ static int do_proc_make_entry(const char *name, umode_t mode,
+ .release = single_release, \
+ .write = proc_##name##_write, \
+ };
++#endif
+
+ #define proc_make_entry_ro(name, parent, wnd) \
+ do_proc_make_entry(#name, S_IFREG | S_IRUSR | S_IRGRP, parent, \
diff --git a/ndiswrapper-kmod-nomodinfo.patch b/ndiswrapper-kmod-nomodinfo.patch
index ebc2024..632b8b0 100644
--- a/ndiswrapper-kmod-nomodinfo.patch
+++ b/ndiswrapper-kmod-nomodinfo.patch
@@ -1,7 +1,7 @@
diff -up ndiswrapper-1.57/driver/Makefile.orig ndiswrapper-1.57/driver/Makefile
--- ndiswrapper-1.57/driver/Makefile.orig 2012-01-11 22:04:35.103054918 +0100
+++ ndiswrapper-1.57/driver/Makefile 2012-01-11 22:06:37.880672013 +0100
-@@ -192,8 +192,8 @@ clean:
+@@ -191,8 +191,8 @@ clean:
rm -rf .tmp_versions
install: config_check $(MODULE)
diff --git a/ndiswrapper-kmod.spec b/ndiswrapper-kmod.spec
index 93912c7..26a08f5 100644
--- a/ndiswrapper-kmod.spec
+++ b/ndiswrapper-kmod.spec
@@ -12,19 +12,17 @@
Summary: Ndiswrapper kernel module
Name: ndiswrapper-kmod
-Version: 1.61
-Release: 13%{?pre}%{?dist}
+Version: 1.62
+Release: 1%{?pre}%{?dist}
License: GPLv2
URL:
http://ndiswrapper.sourceforge.net
Source0:
http://downloads.sf.net/ndiswrapper/ndiswrapper-%{version}%{?pre}.tar.gz
Source11: ndiswrapper-kmodtool-excludekernel-filterfile
Patch0: ndiswrapper-kmod-nomodinfo.patch
-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
+Patch1: kernel-5.3.patch
+Patch2: kernel-5.4.patch
+Patch3: kernel-5.5.patch
+Patch4: kernel-5.6.patch
# needed for plague to make sure it builds for i586 and i686
ExclusiveArch: i686 x86_64
@@ -56,11 +54,9 @@ kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name}
--filterfi
(cd ndiswrapper-%{version}%{?pre} ;
%patch0 -p1 -b .orig
%patch1 -p1 -b .orig
-%patch2 -p2 -b .orig
+%patch2 -p1 -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
@@ -83,6 +79,9 @@ done
%changelog
+* Wed Apr 22 2020 Leigh Scott <leigh123linux(a)gmail.com> - 1.62-1
+- Update to 1.62
+
* Wed Feb 05 2020 RPM Fusion Release Engineering <leigh123linux(a)gmail.com> -
1.61-13
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
diff --git a/sources b/sources
index d3b7d83..649f4c6 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-fe6056a87dfaa1ea7a4500919baf7905 ndiswrapper-1.61.tar.gz
+SHA512 (ndiswrapper-1.62.tar.gz) =
a6e111bc699572642e44d6d31cc2f06374648a01b8dd7dd4e74d6ad5e187e39f99faee38f792c83a94d4618ae4d8866914fb3f60b1d80e838a753285ea7cf783