mirror of
https://github.com/drygdryg/rtl8188eus.git
synced 2025-04-29 02:37:16 +09:00
Added kernel v5.6 support
This commit is contained in:
parent
1d7c67f0ec
commit
a75a5d3471
@ -686,9 +686,13 @@ static int rtw_cfg80211_sync_iftype(_adapter *adapter)
|
||||
|
||||
static u64 rtw_get_systime_us(void)
|
||||
{
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
|
||||
struct timespec64 ts;
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
|
||||
struct timespec ts;
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0))
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
|
||||
getboottime64(&ts);
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0))
|
||||
getboottime(&ts);
|
||||
#else
|
||||
get_monotonic_boottime(&ts);
|
||||
|
@ -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 proc_ops *fops, void * data)
|
||||
#else
|
||||
const struct file_operations *fops, void * data)
|
||||
#endif
|
||||
|
||||
{
|
||||
struct proc_dir_entry *entry;
|
||||
|
||||
@ -230,6 +235,26 @@ 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_owner = THIS_MODULE,
|
||||
.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_owner = THIS_MODULE,
|
||||
.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_seq_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = rtw_drv_proc_open,
|
||||
@ -247,6 +272,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)
|
||||
{
|
||||
@ -3683,6 +3709,27 @@ 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_owner = THIS_MODULE,
|
||||
.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_owner = THIS_MODULE,
|
||||
.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_seq_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = rtw_adapter_proc_open,
|
||||
@ -3700,6 +3747,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)
|
||||
{
|
||||
@ -3855,6 +3903,26 @@ 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_owner = THIS_MODULE,
|
||||
.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_owner = THIS_MODULE,
|
||||
.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_seq_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = rtw_odm_proc_open,
|
||||
@ -3873,6 +3941,8 @@ static const struct file_operations rtw_odm_proc_sseq_fops = {
|
||||
.write = rtw_odm_proc_write,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
struct proc_dir_entry *rtw_odm_proc_init(struct net_device *dev)
|
||||
{
|
||||
struct proc_dir_entry *dir_odm = NULL;
|
||||
@ -3996,6 +4066,26 @@ 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 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,
|
||||
};
|
||||
|
||||
#else
|
||||
static const struct file_operations rtw_mcc_proc_seq_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = rtw_mcc_proc_open,
|
||||
@ -4013,6 +4103,7 @@ static const struct file_operations rtw_mcc_proc_sseq_fops = {
|
||||
.release = single_release,
|
||||
.write = rtw_mcc_proc_write,
|
||||
};
|
||||
#endif
|
||||
|
||||
struct proc_dir_entry *rtw_mcc_proc_init(struct net_device *dev)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user