ndiswrapper rebuild

This commit is contained in:
idriskalp
2020-04-13 21:35:31 +03:00
parent 1f75bd912b
commit bf8baae42c
2 changed files with 95 additions and 2 deletions
@@ -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, \
+10 -2
View File
@@ -18,12 +18,13 @@
<AdditionalFile owner="root" permission="0644" target="dkms.conf">dkms.conf</AdditionalFile>
</AdditionalFiles>
<BuildDependencies>
<Dependency version="5.5.15">kernel-module-headers</Dependency>
<Dependency version="5.6.4">kernel-module-headers</Dependency>
</BuildDependencies>
<Patches>
<Patch>kernel-5.3.patch</Patch>
<Patch>kernel-5.4.patch</Patch>
<Patch>kernel-5.5.patch</Patch>
<Patch>kernel-5.6.patch</Patch>
</Patches>
</Source>
@@ -44,7 +45,7 @@
<Package>
<Name>module-ndiswrapper</Name>
<RuntimeDependencies>
<Dependency version="5.5.15">kernel</Dependency>
<Dependency version="5.6.4">kernel</Dependency>
<Dependency release="current">ndiswrapper-common</Dependency>
</RuntimeDependencies>
<Files>
@@ -76,6 +77,13 @@
</Package>
<History>
<Update release="32">
<Date>2020-04-13</Date>
<Version>1.62</Version>
<Comment>Rebuild</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
<Update release="31">
<Date>2020-04-03</Date>
<Version>1.62</Version>