Merge pull request #97 from CGarces/ArmBianPatch

Kernel 5.6 support
This commit is contained in:
Christian Bremvåg
2020-12-27 16:04:46 +01:00
committed by GitHub

View File

@@ -61,8 +61,14 @@ inline struct proc_dir_entry *rtw_proc_create_dir(const char *name, struct proc_
return entry;
}
inline struct proc_dir_entry *rtw_proc_create_entry(const char *name, struct proc_dir_entry *parent,
const struct file_operations *fops, void * data)
inline struct proc_dir_entry *rtw_proc_create_entry(const char *name,
struct proc_dir_entry *parent,
#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;
@@ -238,6 +244,15 @@ static ssize_t rtw_drv_proc_write(struct file *file, const char __user *buffer,
return -EROFS;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
static const struct proc_ops rtw_drv_proc_seq_fops = {
.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
static const struct file_operations rtw_drv_proc_seq_fops = {
.owner = THIS_MODULE,
.open = rtw_drv_proc_open,
@@ -246,7 +261,17 @@ static const struct file_operations rtw_drv_proc_seq_fops = {
.release = seq_release,
.write = rtw_drv_proc_write,
};
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
static const struct proc_ops rtw_drv_proc_sseq_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_sseq_fops = {
.owner = THIS_MODULE,
.open = rtw_drv_proc_open,
@@ -255,6 +280,7 @@ static const struct file_operations rtw_drv_proc_sseq_fops = {
.release = single_release,
.write = rtw_drv_proc_write,
};
#endif
int rtw_drv_proc_init(void)
{
@@ -4394,6 +4420,15 @@ static ssize_t rtw_adapter_proc_write(struct file *file, const char __user *buff
return -EROFS;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
static const struct proc_ops rtw_adapter_proc_seq_fops = {
.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
static const struct file_operations rtw_adapter_proc_seq_fops = {
.owner = THIS_MODULE,
.open = rtw_adapter_proc_open,
@@ -4402,7 +4437,17 @@ static const struct file_operations rtw_adapter_proc_seq_fops = {
.release = seq_release,
.write = rtw_adapter_proc_write,
};
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
static const struct proc_ops rtw_adapter_proc_sseq_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_sseq_fops = {
.owner = THIS_MODULE,
.open = rtw_adapter_proc_open,
@@ -4411,6 +4456,7 @@ static const struct file_operations rtw_adapter_proc_sseq_fops = {
.release = single_release,
.write = rtw_adapter_proc_write,
};
#endif
int proc_get_odm_adaptivity(struct seq_file *m, void *v)
{
@@ -4563,6 +4609,15 @@ static ssize_t rtw_odm_proc_write(struct file *file, const char __user *buffer,
return -EROFS;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
static const struct proc_ops rtw_odm_proc_seq_fops = {
.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
static const struct file_operations rtw_odm_proc_seq_fops = {
.owner = THIS_MODULE,
.open = rtw_odm_proc_open,
@@ -4571,7 +4626,16 @@ static const struct file_operations rtw_odm_proc_seq_fops = {
.release = seq_release,
.write = rtw_odm_proc_write,
};
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
static const struct proc_ops rtw_odm_proc_sseq_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_sseq_fops = {
.owner = THIS_MODULE,
.open = rtw_odm_proc_open,
@@ -4580,6 +4644,7 @@ static const struct file_operations rtw_odm_proc_sseq_fops = {
.release = single_release,
.write = rtw_odm_proc_write,
};
#endif
struct proc_dir_entry *rtw_odm_proc_init(struct net_device *dev)
{