diff --git a/Makefile b/Makefile index da2b50f..abf66d2 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,15 @@ EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS) ##################### Optimization Flags ########################## -#EXTRA_CFLAGS += -O1 EXTRA_CFLAGS += -O2 -#EXTRA_CFLAGS += -O3 ##################### Compile-time Warnings ####################### -#EXTRA_CFLAGS += -Wall -#EXTRA_CFLAGS += -Wextra -#EXTRA_CFLAGS += -Werror -#EXTRA_CFLAGS += -pedantic -#EXTRA_CFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -#EXTRA_CFLAGS += -Wno-uninitialized EXTRA_CFLAGS += -Wno-unused-variable EXTRA_CFLAGS += -Wno-unused-value EXTRA_CFLAGS += -Wno-unused-label EXTRA_CFLAGS += -Wno-unused-parameter EXTRA_CFLAGS += -Wno-unused-function EXTRA_CFLAGS += -Wno-unused -EXTRA_CFLAGS += -Wno-incompatible-pointer-types +#EXTRA_CFLAGS += -Wno-incompatible-pointer-types EXTRA_CFLAGS += -Wno-date-time GCC_VER_49 := $(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.9 | bc ) diff --git a/os_dep/linux/rtw_proc.c b/os_dep/linux/rtw_proc.c index 9754a25..1aa1430 100644 --- a/os_dep/linux/rtw_proc.c +++ b/os_dep/linux/rtw_proc.c @@ -62,7 +62,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; @@ -238,6 +243,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_seq_fops = { .owner = THIS_MODULE, .open = rtw_drv_proc_open, @@ -255,6 +261,23 @@ static const struct file_operations rtw_drv_proc_sseq_fops = { .release = single_release, .write = rtw_drv_proc_write, }; +#else +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, +}; + +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, +}; +#endif int rtw_drv_proc_init(void) { @@ -4146,6 +4169,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_seq_fops = { .owner = THIS_MODULE, .open = rtw_adapter_proc_open, @@ -4163,6 +4187,23 @@ static const struct file_operations rtw_adapter_proc_sseq_fops = { .release = single_release, .write = rtw_adapter_proc_write, }; +#else +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, +}; + +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, +}; +#endif int proc_get_odm_adaptivity(struct seq_file *m, void *v) { @@ -4315,6 +4356,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_seq_fops = { .owner = THIS_MODULE, .open = rtw_odm_proc_open, @@ -4332,6 +4374,23 @@ static const struct file_operations rtw_odm_proc_sseq_fops = { .release = single_release, .write = rtw_odm_proc_write, }; +#else +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, +}; + +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, +}; +#endif struct proc_dir_entry *rtw_odm_proc_init(struct net_device *dev) { @@ -4456,6 +4515,7 @@ static ssize_t rtw_mcc_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_mcc_proc_seq_fops = { .owner = THIS_MODULE, .open = rtw_mcc_proc_open, @@ -4473,6 +4533,25 @@ static const struct file_operations rtw_mcc_proc_sseq_fops = { .release = single_release, .write = rtw_mcc_proc_write, }; +#else +static const struct proc_ops rtw_mcc_proc_seq_fops = { + .proc_owner = THIS_MODULE, + .proc_open = rtw_mcc_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = seq_release, + .proc_write = rtw_mcc_proc_write, +}; + +static const struct proc_ops rtw_mcc_proc_sseq_fops = { + .proc_owner = THIS_MODULE, + .proc_open = rtw_mcc_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = rtw_mcc_proc_write, +}; +#endif struct proc_dir_entry *rtw_mcc_proc_init(struct net_device *dev) {