Merge pull request #6 from HonJEK/linux_5.6_fix

Linux 5.6 fix
This commit is contained in:
lwfinger 2020-04-11 11:20:55 -05:00 committed by GitHub
commit 3f74a755b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 93 additions and 2 deletions

View File

@ -1465,7 +1465,7 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
ptable->func = &OnAuth; ptable->func = &OnAuth;
else else
ptable->func = &OnAuthClient; ptable->func = &OnAuthClient;
/* pass through */ __attribute__ ((__fallthrough__));/* FALL THRU */
case WIFI_ASSOCREQ: case WIFI_ASSOCREQ:
case WIFI_REASSOCREQ: case WIFI_REASSOCREQ:
_mgt_dispatcher(padapter, ptable, precv_frame); _mgt_dispatcher(padapter, ptable, precv_frame);

View File

@ -3576,6 +3576,7 @@ static void halbtc8723d1ant_psd_show_antenna_detect_result(IN struct btc_coexist
case 11: case 11:
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE,
"(BT is Disabled)"); "(BT is Disabled)");
break;
case 12: case 12:
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE,
"(BT is available, result from BT"); "(BT is available, result from BT");

View File

@ -4160,6 +4160,7 @@ static void halbtc8723d2ant_psd_show_antenna_detect_result(IN struct btc_coexist
case 11: case 11:
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE,
"(BT is Disabled)"); "(BT is Disabled)");
break;
case 12: case 12:
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE,
"(BT is available, result from BT"); "(BT is available, result from BT");

View File

@ -811,6 +811,7 @@ s32 c2h_handler(_adapter *adapter, u8 id, u8 seq, u8 plen, u8 *payload)
case C2H_EXTEND: case C2H_EXTEND:
sub_id = payload[0]; sub_id = payload[0];
__attribute__((__fallthrough__));
/* no handle, goto default */ /* no handle, goto default */
default: default:

View File

@ -1809,6 +1809,7 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
#if defined(CONFIG_P2P) && ((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)) #if defined(CONFIG_P2P) && ((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE))
case NL80211_IFTYPE_P2P_CLIENT: case NL80211_IFTYPE_P2P_CLIENT:
is_p2p = _TRUE; is_p2p = _TRUE;
__attribute__((__fallthrough__));
#endif #endif
case NL80211_IFTYPE_STATION: case NL80211_IFTYPE_STATION:
networkType = Ndis802_11Infrastructure; networkType = Ndis802_11Infrastructure;
@ -1833,6 +1834,7 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
#if defined(CONFIG_P2P) && ((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)) #if defined(CONFIG_P2P) && ((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE))
case NL80211_IFTYPE_P2P_GO: case NL80211_IFTYPE_P2P_GO:
is_p2p = _TRUE; is_p2p = _TRUE;
__attribute__((__fallthrough__));
#endif #endif
case NL80211_IFTYPE_AP: case NL80211_IFTYPE_AP:
networkType = Ndis802_11APMode; networkType = Ndis802_11APMode;

View File

@ -68,8 +68,14 @@ 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))
#define struct_proc_ops proc_ops
#else
#define struct_proc_ops file_operations
#endif
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 struct_proc_ops *fops, void * data)
{ {
struct proc_dir_entry *entry; struct proc_dir_entry *entry;
@ -219,6 +225,15 @@ static ssize_t rtw_drv_proc_write(struct file *file, const char __user *buffer,
return -EROFS; 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 = { static const struct file_operations rtw_drv_proc_seq_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = rtw_drv_proc_open, .open = rtw_drv_proc_open,
@ -227,7 +242,17 @@ static const struct file_operations rtw_drv_proc_seq_fops = {
.release = seq_release, .release = seq_release,
.write = rtw_drv_proc_write, .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 = { static const struct file_operations rtw_drv_proc_sseq_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = rtw_drv_proc_open, .open = rtw_drv_proc_open,
@ -236,6 +261,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)
{ {
@ -2325,6 +2351,15 @@ static ssize_t rtw_adapter_proc_write(struct file *file, const char __user *buff
return -EROFS; 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 = { static const struct file_operations rtw_adapter_proc_seq_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = rtw_adapter_proc_open, .open = rtw_adapter_proc_open,
@ -2333,7 +2368,17 @@ static const struct file_operations rtw_adapter_proc_seq_fops = {
.release = seq_release, .release = seq_release,
.write = rtw_adapter_proc_write, .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 = { static const struct file_operations rtw_adapter_proc_sseq_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = rtw_adapter_proc_open, .open = rtw_adapter_proc_open,
@ -2342,6 +2387,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_dbg_comp(struct seq_file *m, void *v) int proc_get_odm_dbg_comp(struct seq_file *m, void *v)
{ {
@ -2660,6 +2706,15 @@ static ssize_t rtw_odm_proc_write(struct file *file, const char __user *buffer,
return -EROFS; 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 = { static const struct file_operations rtw_odm_proc_seq_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = rtw_odm_proc_open, .open = rtw_odm_proc_open,
@ -2668,7 +2723,17 @@ static const struct file_operations rtw_odm_proc_seq_fops = {
.release = seq_release, .release = seq_release,
.write = rtw_odm_proc_write, .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 = { static const struct file_operations rtw_odm_proc_sseq_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = rtw_odm_proc_open, .open = rtw_odm_proc_open,
@ -2677,6 +2742,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)
{ {
@ -2799,6 +2865,15 @@ static ssize_t rtw_mcc_proc_write(struct file *file, const char __user *buffer,
return -EROFS; return -EROFS;
} }
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
static const struct proc_ops rtw_mcc_proc_seq_fops = {
.proc_open = rtw_mcc_proc_open,
.proc_read = seq_read,
.proc_lseek = seq_lseek,
.proc_release = seq_release,
.proc_write = rtw_mcc_proc_write,
};
#else
static const struct file_operations rtw_mcc_proc_seq_fops = { static const struct file_operations rtw_mcc_proc_seq_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = rtw_mcc_proc_open, .open = rtw_mcc_proc_open,
@ -2807,7 +2882,17 @@ static const struct file_operations rtw_mcc_proc_seq_fops = {
.release = seq_release, .release = seq_release,
.write = rtw_mcc_proc_write, .write = rtw_mcc_proc_write,
}; };
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
static const struct proc_ops rtw_mcc_proc_sseq_fops = {
.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_sseq_fops = { static const struct file_operations rtw_mcc_proc_sseq_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = rtw_mcc_proc_open, .open = rtw_mcc_proc_open,
@ -2816,6 +2901,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)
{ {