linux kernel commit 412c53a680a97cb1ae2c0ab60230e193bee86387
y2038: remove unused time32 interfaces
No users remain, so kill these off before we grow new ones.
From 5208da734ed396aa76446613359089e523c93133 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Igor=20Pe=C4=8Dovnik?=
<[email protected]>
Date: Fri, 28 Feb 2020 20:20:13 +0100
Subject: [PATCH 1/4] This fixes compilation
If debug mode is disabled.
---
core/rtw_debug.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/core/rtw_debug.c b/core/rtw_debug.c
index ddc96eb..634c5ad 100755
--- a/core/rtw_debug.c
+++ b/core/rtw_debug.c
@@ -6358,6 +6358,7 @@ ssize_t proc_set_lck(struct file *file, const char __user *buffer, size_t count,
inline void RTW_BUF_DUMP_SEL(uint _loglevel, void *sel, u8 *_titlestring,
bool _idx_show, const u8 *_hexdata, int _hexdatalen)
{
+#ifdef CONFIG_RTW_DEBUG
int __i;
u8 *ptr = (u8 *)_hexdata;
@@ -6383,6 +6384,7 @@ inline void RTW_BUF_DUMP_SEL(uint _loglevel, void *sel, u8 *_titlestring,
}
_RTW_PRINT_SEL(sel, "\n");
}
+#endif
}
#else
inline void _RTW_STR_DUMP_SEL(void *sel, char *str_out)
--
2.17.1
From b41f760f40786117e568d87eb792a662306b22f4 Mon Sep 17 00:00:00 2001
From: Benedikt Schemmer <[email protected]>
Date: Sun, 1 Mar 2020 08:50:03 +0100
Subject: [PATCH 2/4] Changes analog rtl8812au module by muncrief
---
os_dep/linux/rtw_proc.c | 82 ++++++++++++++++++++++++++++++++++++-----
1 file changed, 73 insertions(+), 9 deletions(-)
diff --git a/os_dep/linux/rtw_proc.c b/os_dep/linux/rtw_proc.c
index bf2751c..600cc19 100755
--- a/os_dep/linux/rtw_proc.c
+++ b/os_dep/linux/rtw_proc.c
@@ -62,7 +62,7 @@ inline struct proc_dir_entry *rtw_proc_create_dir(const char *name, struct proc_
}
inline struct proc_dir_entry *rtw_proc_create_entry(const char *name, struct proc_dir_entry *parent,
- const struct file_operations *fops, void * data)
+ const rtw_proc_op_t *fops, void * data)
{
struct proc_dir_entry *entry;
@@ -231,22 +231,38 @@ static ssize_t rtw_drv_proc_write(struct file *file, const char __user *buffer,
return -EROFS;
}
-static const struct file_operations rtw_drv_proc_seq_fops = {
+static const rtw_proc_op_t rtw_drv_proc_seq_fops = {
+#ifdef HAVE_PROC_OPS_STRUCT
+ .proc_open = rtw_drv_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = seq_release,
+ .proc_write = rtw_drv_proc_write,
+#else
.owner = THIS_MODULE,
.open = rtw_drv_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
.write = rtw_drv_proc_write,
+#endif
};
-static const struct file_operations rtw_drv_proc_sseq_fops = {
+static const rtw_proc_op_t rtw_drv_proc_sseq_fops = {
+#ifdef HAVE_PROC_OPS_STRUCT
+ .proc_open = rtw_drv_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+ .proc_write = rtw_drv_proc_write,
+#else
.owner = THIS_MODULE,
.open = rtw_drv_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
.write = rtw_drv_proc_write,
+#endif
};
int rtw_drv_proc_init(void)
@@ -3759,22 +3775,38 @@ static ssize_t rtw_adapter_proc_write(struct file *file, const char __user *buff
return -EROFS;
}
-static const struct file_operations rtw_adapter_proc_seq_fops = {
+static const rtw_proc_op_t rtw_adapter_proc_seq_fops = {
+#ifdef HAVE_PROC_OPS_STRUCT
+ .proc_open = rtw_adapter_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = seq_release,
+ .proc_write = rtw_adapter_proc_write,
+#else
.owner = THIS_MODULE,
.open = rtw_adapter_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
.write = rtw_adapter_proc_write,
+#endif
};
-static const struct file_operations rtw_adapter_proc_sseq_fops = {
+static const rtw_proc_op_t rtw_adapter_proc_sseq_fops = {
+#ifdef HAVE_PROC_OPS_STRUCT
+ .proc_open = rtw_adapter_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+ .proc_write = rtw_adapter_proc_write,
+#else
.owner = THIS_MODULE,
.open = rtw_adapter_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
.write = rtw_adapter_proc_write,
+#endif
};
int proc_get_odm_adaptivity(struct seq_file *m, void *v)
@@ -3928,22 +3960,38 @@ static ssize_t rtw_odm_proc_write(struct file *file, const char __user *buffer,
return -EROFS;
}
-static const struct file_operations rtw_odm_proc_seq_fops = {
+static const rtw_proc_op_t rtw_odm_proc_seq_fops = {
+#ifdef HAVE_PROC_OPS_STRUCT
+ .proc_open = rtw_odm_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = seq_release,
+ .proc_write = rtw_odm_proc_write,
+#else
.owner = THIS_MODULE,
.open = rtw_odm_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
.write = rtw_odm_proc_write,
+#endif
};
-static const struct file_operations rtw_odm_proc_sseq_fops = {
+static const rtw_proc_op_t rtw_odm_proc_sseq_fops = {
+#ifdef HAVE_PROC_OPS_STRUCT
+ .proc_open = rtw_odm_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+ .proc_write = rtw_odm_proc_write,
+#else
.owner = THIS_MODULE,
.open = rtw_odm_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
.write = rtw_odm_proc_write,
+#endif
};
struct proc_dir_entry *rtw_odm_proc_init(struct net_device *dev)
@@ -4069,22 +4117,38 @@ static ssize_t rtw_mcc_proc_write(struct file *file, const char __user *buffer,
return -EROFS;
}
-static const struct file_operations rtw_mcc_proc_seq_fops = {
+static const rtw_proc_op_t rtw_mcc_proc_seq_fops = {
+#ifdef HAVE_PROC_OPS_STRUCT
+ .proc_open = rtw_mcc_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = seq_release,
+ .proc_write = rtw_mcc_proc_write,
+#else
.owner = THIS_MODULE,
.open = rtw_mcc_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
.write = rtw_mcc_proc_write,
+#endif
};
-static const struct file_operations rtw_mcc_proc_sseq_fops = {
+static const rtw_proc_op_t rtw_mcc_proc_sseq_fops = {
+#ifdef HAVE_PROC_OPS_STRUCT
+ .proc_open = rtw_mcc_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+ .proc_write = rtw_mcc_proc_write,
+#else
.owner = THIS_MODULE,
.open = rtw_mcc_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
.write = rtw_mcc_proc_write,
+#endif
};
struct proc_dir_entry *rtw_mcc_proc_init(struct net_device *dev)
--
2.17.1
From bd4c0d0359bd2c18a97e341dfca1dec2fdb8308d Mon Sep 17 00:00:00 2001
From: Benedikt Schemmer <[email protected]>
Date: Sun, 1 Mar 2020 08:50:51 +0100
Subject: [PATCH 3/4] Changes analog to rtl 8812au module by muncrief
---
os_dep/linux/rtw_proc.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/os_dep/linux/rtw_proc.h b/os_dep/linux/rtw_proc.h
index c2c7c8e..839d647 100755
--- a/os_dep/linux/rtw_proc.h
+++ b/os_dep/linux/rtw_proc.h
@@ -21,6 +21,13 @@
#define RTW_PROC_HDL_TYPE_SEQ 0
#define RTW_PROC_HDL_TYPE_SSEQ 1
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
+#define HAVE_PROC_OPS_STRUCT
+typedef struct proc_ops rtw_proc_op_t;
+#else
+typedef struct file_operations rtw_proc_op_t;
+#endif
+
struct rtw_proc_hdl {
char *name;
u8 type;
--
2.17.1
From 9852aa9cb614ae17fb33bf4c6e1e8484c6ffbc8f Mon Sep 17 00:00:00 2001
From: Benedikt Schemmer <[email protected]>
Date: Sun, 1 Mar 2020 08:51:28 +0100
Subject: [PATCH 4/4] Fixup time format for linux 5.6
---
os_dep/linux/ioctl_cfg80211.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c
index 153dbd4..c0df148 100755
--- a/os_dep/linux/ioctl_cfg80211.c
+++ b/os_dep/linux/ioctl_cfg80211.c
@@ -688,8 +688,8 @@ static u64 rtw_get_systime_us(void)
{
// Fix build error for Linux >= 4.19
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
- struct timespec ts;
- getboottime(&ts);
+ struct timespec64 ts;
+ getboottime64(&ts);
return ((u64)ts.tv_sec * 1000000) + ts.tv_nsec / 1000;
#else
struct timeval tv;
--
2.17.1