mirror of
https://github.com/aircrack-ng/rtl8812au.git
synced 2024-11-22 13:24:36 +00:00
Add kernel v5.6 support
This commit is contained in:
parent
1bf08b78b1
commit
19398a4630
@ -61,12 +61,19 @@ inline struct proc_dir_entry *rtw_proc_create_dir(const char *name, struct proc_
|
|||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
|
||||||
|
inline struct proc_dir_entry *rtw_proc_create_entry(const char *name, struct proc_dir_entry *parent,
|
||||||
|
const struct proc_ops *pops, void * data)
|
||||||
|
#else
|
||||||
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)
|
const struct file_operations *fops, void * data)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
struct proc_dir_entry *entry;
|
struct proc_dir_entry *entry;
|
||||||
|
|
||||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26))
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
|
||||||
|
entry = proc_create_data(name, S_IFREG | S_IRUGO | S_IWUGO, parent, pops, data);
|
||||||
|
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26))
|
||||||
entry = proc_create_data(name, S_IFREG | S_IRUGO | S_IWUGO, parent, fops, data);
|
entry = proc_create_data(name, S_IFREG | S_IRUGO | S_IWUGO, parent, fops, data);
|
||||||
#else
|
#else
|
||||||
entry = create_proc_entry(name, S_IFREG | S_IRUGO | S_IWUGO, parent);
|
entry = create_proc_entry(name, S_IFREG | S_IRUGO | S_IWUGO, parent);
|
||||||
@ -238,7 +245,24 @@ static ssize_t rtw_drv_proc_write(struct file *file, const char __user *buffer,
|
|||||||
return -EROFS;
|
return -EROFS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct file_operations rtw_drv_proc_seq_fops = {
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
|
||||||
|
static const struct proc_ops rtw_drv_proc_seq_ops = {
|
||||||
|
.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_ops = {
|
||||||
|
.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_ops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.open = rtw_drv_proc_open,
|
.open = rtw_drv_proc_open,
|
||||||
.read = seq_read,
|
.read = seq_read,
|
||||||
@ -247,7 +271,7 @@ static const struct file_operations rtw_drv_proc_seq_fops = {
|
|||||||
.write = rtw_drv_proc_write,
|
.write = rtw_drv_proc_write,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct file_operations rtw_drv_proc_sseq_fops = {
|
static const struct file_operations rtw_drv_proc_sseq_ops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.open = rtw_drv_proc_open,
|
.open = rtw_drv_proc_open,
|
||||||
.read = seq_read,
|
.read = seq_read,
|
||||||
@ -255,6 +279,7 @@ static const struct file_operations rtw_drv_proc_sseq_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)
|
||||||
{
|
{
|
||||||
@ -276,9 +301,9 @@ int rtw_drv_proc_init(void)
|
|||||||
|
|
||||||
for (i = 0; i < drv_proc_hdls_num; i++) {
|
for (i = 0; i < drv_proc_hdls_num; i++) {
|
||||||
if (drv_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
|
if (drv_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
|
||||||
entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_seq_fops, (void *)i);
|
entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_seq_ops, (void *)i);
|
||||||
else if (drv_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
|
else if (drv_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
|
||||||
entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_sseq_fops, (void *)i);
|
entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_sseq_ops, (void *)i);
|
||||||
else
|
else
|
||||||
entry = NULL;
|
entry = NULL;
|
||||||
|
|
||||||
@ -3633,7 +3658,7 @@ static void tpt_mode_default(struct _ADAPTER *adapter)
|
|||||||
dvobj->scan_deny = _FALSE;
|
dvobj->scan_deny = _FALSE;
|
||||||
|
|
||||||
/* 2. back to original LPS mode */
|
/* 2. back to original LPS mode */
|
||||||
#ifdef CONFIG_LPS
|
#ifdef CONFIG_LPS
|
||||||
rtw_pm_set_lps(adapter, adapter->registrypriv.power_mgnt);
|
rtw_pm_set_lps(adapter, adapter->registrypriv.power_mgnt);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -3648,7 +3673,7 @@ static void rtw_tpt_mode(struct _ADAPTER *adapter)
|
|||||||
|
|
||||||
if (dvobj->tpt_mode > 0) {
|
if (dvobj->tpt_mode > 0) {
|
||||||
|
|
||||||
/* when enable each tpt mode
|
/* when enable each tpt mode
|
||||||
1. scan deny
|
1. scan deny
|
||||||
2. disable LPS */
|
2. disable LPS */
|
||||||
|
|
||||||
@ -4162,7 +4187,24 @@ static ssize_t rtw_adapter_proc_write(struct file *file, const char __user *buff
|
|||||||
return -EROFS;
|
return -EROFS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct file_operations rtw_adapter_proc_seq_fops = {
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
|
||||||
|
static const struct proc_ops rtw_adapter_proc_seq_ops = {
|
||||||
|
.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_ops = {
|
||||||
|
.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_ops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.open = rtw_adapter_proc_open,
|
.open = rtw_adapter_proc_open,
|
||||||
.read = seq_read,
|
.read = seq_read,
|
||||||
@ -4171,7 +4213,7 @@ static const struct file_operations rtw_adapter_proc_seq_fops = {
|
|||||||
.write = rtw_adapter_proc_write,
|
.write = rtw_adapter_proc_write,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct file_operations rtw_adapter_proc_sseq_fops = {
|
static const struct file_operations rtw_adapter_proc_sseq_ops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.open = rtw_adapter_proc_open,
|
.open = rtw_adapter_proc_open,
|
||||||
.read = seq_read,
|
.read = seq_read,
|
||||||
@ -4179,6 +4221,7 @@ static const struct file_operations rtw_adapter_proc_sseq_fops = {
|
|||||||
.release = single_release,
|
.release = single_release,
|
||||||
.write = rtw_adapter_proc_write,
|
.write = rtw_adapter_proc_write,
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
int proc_get_odm_adaptivity(struct seq_file *m, void *v)
|
int proc_get_odm_adaptivity(struct seq_file *m, void *v)
|
||||||
{
|
{
|
||||||
@ -4331,7 +4374,24 @@ static ssize_t rtw_odm_proc_write(struct file *file, const char __user *buffer,
|
|||||||
return -EROFS;
|
return -EROFS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct file_operations rtw_odm_proc_seq_fops = {
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
|
||||||
|
static const struct proc_ops rtw_odm_proc_seq_ops = {
|
||||||
|
.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_ops = {
|
||||||
|
.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_ops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.open = rtw_odm_proc_open,
|
.open = rtw_odm_proc_open,
|
||||||
.read = seq_read,
|
.read = seq_read,
|
||||||
@ -4340,7 +4400,7 @@ static const struct file_operations rtw_odm_proc_seq_fops = {
|
|||||||
.write = rtw_odm_proc_write,
|
.write = rtw_odm_proc_write,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct file_operations rtw_odm_proc_sseq_fops = {
|
static const struct file_operations rtw_odm_proc_sseq_ops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.open = rtw_odm_proc_open,
|
.open = rtw_odm_proc_open,
|
||||||
.read = seq_read,
|
.read = seq_read,
|
||||||
@ -4348,6 +4408,7 @@ static const struct file_operations rtw_odm_proc_sseq_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)
|
||||||
{
|
{
|
||||||
@ -4376,9 +4437,9 @@ struct proc_dir_entry *rtw_odm_proc_init(struct net_device *dev)
|
|||||||
|
|
||||||
for (i = 0; i < odm_proc_hdls_num; i++) {
|
for (i = 0; i < odm_proc_hdls_num; i++) {
|
||||||
if (odm_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
|
if (odm_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
|
||||||
entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_seq_fops, (void *)i);
|
entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_seq_ops, (void *)i);
|
||||||
else if (odm_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
|
else if (odm_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
|
||||||
entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_sseq_fops, (void *)i);
|
entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_sseq_ops, (void *)i);
|
||||||
else
|
else
|
||||||
entry = NULL;
|
entry = NULL;
|
||||||
|
|
||||||
@ -4472,7 +4533,24 @@ static ssize_t rtw_mcc_proc_write(struct file *file, const char __user *buffer,
|
|||||||
return -EROFS;
|
return -EROFS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct file_operations rtw_mcc_proc_seq_fops = {
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
|
||||||
|
static const struct proc_ops rtw_mcc_proc_seq_ops = {
|
||||||
|
.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 file_operations rtw_mcc_proc_sseq_ops = {
|
||||||
|
.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_ops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.open = rtw_mcc_proc_open,
|
.open = rtw_mcc_proc_open,
|
||||||
.read = seq_read,
|
.read = seq_read,
|
||||||
@ -4481,7 +4559,7 @@ static const struct file_operations rtw_mcc_proc_seq_fops = {
|
|||||||
.write = rtw_mcc_proc_write,
|
.write = rtw_mcc_proc_write,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct file_operations rtw_mcc_proc_sseq_fops = {
|
static const struct file_operations rtw_mcc_proc_sseq_ops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.open = rtw_mcc_proc_open,
|
.open = rtw_mcc_proc_open,
|
||||||
.read = seq_read,
|
.read = seq_read,
|
||||||
@ -4489,6 +4567,7 @@ static const struct file_operations rtw_mcc_proc_sseq_fops = {
|
|||||||
.release = single_release,
|
.release = single_release,
|
||||||
.write = rtw_mcc_proc_write,
|
.write = rtw_mcc_proc_write,
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
struct proc_dir_entry *rtw_mcc_proc_init(struct net_device *dev)
|
struct proc_dir_entry *rtw_mcc_proc_init(struct net_device *dev)
|
||||||
{
|
{
|
||||||
@ -4517,9 +4596,9 @@ struct proc_dir_entry *rtw_mcc_proc_init(struct net_device *dev)
|
|||||||
|
|
||||||
for (i = 0; i < mcc_proc_hdls_num; i++) {
|
for (i = 0; i < mcc_proc_hdls_num; i++) {
|
||||||
if (mcc_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
|
if (mcc_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
|
||||||
entry = rtw_proc_create_entry(mcc_proc_hdls[i].name, dir_mcc, &rtw_mcc_proc_seq_fops, (void *)i);
|
entry = rtw_proc_create_entry(mcc_proc_hdls[i].name, dir_mcc, &rtw_mcc_proc_seq_ops, (void *)i);
|
||||||
else if (mcc_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
|
else if (mcc_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
|
||||||
entry = rtw_proc_create_entry(mcc_proc_hdls[i].name, dir_mcc, &rtw_mcc_proc_sseq_fops, (void *)i);
|
entry = rtw_proc_create_entry(mcc_proc_hdls[i].name, dir_mcc, &rtw_mcc_proc_sseq_ops, (void *)i);
|
||||||
else
|
else
|
||||||
entry = NULL;
|
entry = NULL;
|
||||||
|
|
||||||
@ -4582,9 +4661,9 @@ struct proc_dir_entry *rtw_adapter_proc_init(struct net_device *dev)
|
|||||||
|
|
||||||
for (i = 0; i < adapter_proc_hdls_num; i++) {
|
for (i = 0; i < adapter_proc_hdls_num; i++) {
|
||||||
if (adapter_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
|
if (adapter_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
|
||||||
entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_seq_fops, (void *)i);
|
entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_seq_ops, (void *)i);
|
||||||
else if (adapter_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
|
else if (adapter_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
|
||||||
entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_sseq_fops, (void *)i);
|
entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_sseq_ops, (void *)i);
|
||||||
else
|
else
|
||||||
entry = NULL;
|
entry = NULL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user