Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 36 additions & 5 deletions os_dep/linux/rtw_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,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,
const struct file_operations *fops, void * data)
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)
const struct file_operations *fops,
#else
const struct proc_ops *fops,
#endif
void * data)
{
struct proc_dir_entry *entry;

Expand Down Expand Up @@ -166,7 +171,7 @@ 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 file_operations rtw_drv_proc_fops = {
.owner = THIS_MODULE,
.open = rtw_drv_proc_open,
Expand All @@ -175,7 +180,15 @@ static const struct file_operations rtw_drv_proc_fops = {
.release = single_release,
.write = rtw_drv_proc_write,
};

#else
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,
};
#endif
int rtw_drv_proc_init(void)
{
int ret = _FAIL;
Expand Down Expand Up @@ -775,7 +788,7 @@ 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 file_operations rtw_adapter_proc_fops = {
.owner = THIS_MODULE,
.open = rtw_adapter_proc_open,
Expand All @@ -784,6 +797,15 @@ static const struct file_operations rtw_adapter_proc_fops = {
.release = single_release,
.write = rtw_adapter_proc_write,
};
#else
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,
};
#endif

int proc_get_odm_dbg_comp(struct seq_file *m, void *v)
{
Expand Down Expand Up @@ -1029,7 +1051,7 @@ 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 file_operations rtw_odm_proc_fops = {
.owner = THIS_MODULE,
.open = rtw_odm_proc_open,
Expand All @@ -1038,6 +1060,15 @@ static const struct file_operations rtw_odm_proc_fops = {
.release = single_release,
.write = rtw_odm_proc_write,
};
#else
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,
};
#endif

struct proc_dir_entry *rtw_odm_proc_init(struct net_device *dev)
{
Expand Down