adapt for 5.6

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
This commit is contained in:
Icenowy Zheng 2020-02-11 23:37:25 +08:00
parent d7db077004
commit ab6b5789a6
2 changed files with 37 additions and 2 deletions

View file

@ -1,2 +1,2 @@
#define DRIVERVERSION "v4.3.22.9_16440.20151221_BTCOEX20151214-0700-ML20190826" #define DRIVERVERSION "v4.3.22.9_16440.20151221_BTCOEX20151214-0700-ML20200211"
#define BTCOEXVERSION "BTCOEX20151214-0700" #define BTCOEXVERSION "BTCOEX20151214-0700"

View file

@ -69,7 +69,12 @@ 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, inline struct proc_dir_entry *rtw_proc_create_entry(const char *name, struct proc_dir_entry *parent,
const struct file_operations *fops, void * data) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
const struct proc_ops *fops,
#else
const struct file_operations *fops,
#endif
void * data)
{ {
struct proc_dir_entry *entry; struct proc_dir_entry *entry;
@ -195,6 +200,15 @@ static ssize_t rtw_drv_proc_write(struct file *file, const char __user *buffer,
return -EROFS; return -EROFS;
} }
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
static const struct proc_ops rtw_drv_proc_fops = {
.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
static const struct file_operations rtw_drv_proc_fops = { static const struct file_operations rtw_drv_proc_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = rtw_drv_proc_open, .open = rtw_drv_proc_open,
@ -203,6 +217,7 @@ static const struct file_operations rtw_drv_proc_fops = {
.release = single_release, .release = single_release,
.write = rtw_drv_proc_write, .write = rtw_drv_proc_write,
}; };
#endif
int rtw_drv_proc_init(void) int rtw_drv_proc_init(void)
{ {
@ -1597,6 +1612,15 @@ static ssize_t rtw_adapter_proc_write(struct file *file, const char __user *buff
return -EROFS; return -EROFS;
} }
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
static const struct proc_ops rtw_adapter_proc_fops = {
.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
static const struct file_operations rtw_adapter_proc_fops = { static const struct file_operations rtw_adapter_proc_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = rtw_adapter_proc_open, .open = rtw_adapter_proc_open,
@ -1605,6 +1629,7 @@ static const struct file_operations rtw_adapter_proc_fops = {
.release = single_release, .release = single_release,
.write = rtw_adapter_proc_write, .write = rtw_adapter_proc_write,
}; };
#endif
int proc_get_odm_dbg_comp(struct seq_file *m, void *v) int proc_get_odm_dbg_comp(struct seq_file *m, void *v)
{ {
@ -1871,6 +1896,15 @@ static ssize_t rtw_odm_proc_write(struct file *file, const char __user *buffer,
return -EROFS; return -EROFS;
} }
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
static const struct proc_ops rtw_odm_proc_fops = {
.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
static const struct file_operations rtw_odm_proc_fops = { static const struct file_operations rtw_odm_proc_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = rtw_odm_proc_open, .open = rtw_odm_proc_open,
@ -1879,6 +1913,7 @@ static const struct file_operations rtw_odm_proc_fops = {
.release = single_release, .release = single_release,
.write = rtw_odm_proc_write, .write = rtw_odm_proc_write,
}; };
#endif
struct proc_dir_entry *rtw_odm_proc_init(struct net_device *dev) struct proc_dir_entry *rtw_odm_proc_init(struct net_device *dev)
{ {