This commit is contained in:
Larry Finger 2020-04-11 11:33:40 -05:00
commit 798d7c0de7
10 changed files with 122 additions and 30 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

@ -2005,7 +2005,7 @@ InitLed(
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
timer_setup(&pLed->BlinkTimer, BlinkTimerCallback, 0); timer_setup(&pLed->BlinkTimer, BlinkTimerCallback, 0);
#else #else
_init_timer(&pLed->BlinkTimer, padapter->pnetdev, linkTimerCallback, pLed); _init_timer(&pLed->BlinkTimer, padapter->pnetdev, BlinkTimerCallback, pLed);
#endif #endif
_init_workitem(&(pLed->BlinkWorkItem), BlinkWorkItemCallback, pLed); _init_workitem(&(pLed->BlinkWorkItem), BlinkWorkItemCallback, pLed);
} }

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

@ -1069,14 +1069,15 @@ unsigned int rtw_classify8021d(struct sk_buff *skb)
static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0)
,struct net_device *sb_dev #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
,select_queue_fallback_t fallback , void *accel_priv
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) #else
,void *unused , struct net_device *sb_dev
,select_queue_fallback_t fallback #endif
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0))
, void *accel_priv , select_queue_fallback_t fallback
#endif
#endif #endif
) )
{ {

View File

@ -1161,10 +1161,10 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
.subcmd = BRCM_VENDOR_SCMD_PRIV_STR .subcmd = BRCM_VENDOR_SCMD_PRIV_STR
}, },
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
.doit = wl_cfgvendor_priv_string_handler,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0))
.policy = VENDOR_CMD_RAW_DATA, .policy = VENDOR_CMD_RAW_DATA,
#endif #endif
.doit = wl_cfgvendor_priv_string_handler
}, },
#if defined(GSCAN_SUPPORT) && 0 #if defined(GSCAN_SUPPORT) && 0
{ {
@ -1173,10 +1173,10 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
.subcmd = GSCAN_SUBCMD_GET_CAPABILITIES .subcmd = GSCAN_SUBCMD_GET_CAPABILITIES
}, },
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
.doit = wl_cfgvendor_gscan_get_capabilities,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0))
.policy = VENDOR_CMD_RAW_DATA, .policy = VENDOR_CMD_RAW_DATA,
#endif #endif
.doit = wl_cfgvendor_gscan_get_capabilities
}, },
{ {
{ {
@ -1184,10 +1184,10 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
.subcmd = GSCAN_SUBCMD_SET_CONFIG .subcmd = GSCAN_SUBCMD_SET_CONFIG
}, },
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
.doit = wl_cfgvendor_set_scan_cfg,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0))
.policy = VENDOR_CMD_RAW_DATA, .policy = VENDOR_CMD_RAW_DATA,
#endif #endif
.doit = wl_cfgvendor_set_scan_cfg
}, },
{ {
{ {
@ -1195,10 +1195,10 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
.subcmd = GSCAN_SUBCMD_SET_SCAN_CONFIG .subcmd = GSCAN_SUBCMD_SET_SCAN_CONFIG
}, },
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
.doit = wl_cfgvendor_set_batch_scan_cfg,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0))
.policy = VENDOR_CMD_RAW_DATA, .policy = VENDOR_CMD_RAW_DATA,
#endif #endif
.doit = wl_cfgvendor_set_batch_scan_cfg
}, },
{ {
{ {
@ -1206,10 +1206,10 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
.subcmd = GSCAN_SUBCMD_ENABLE_GSCAN .subcmd = GSCAN_SUBCMD_ENABLE_GSCAN
}, },
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
.doit = wl_cfgvendor_initiate_gscan,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0))
.policy = VENDOR_CMD_RAW_DATA, .policy = VENDOR_CMD_RAW_DATA,
#endif #endif
.doit = wl_cfgvendor_initiate_gscan
}, },
{ {
{ {
@ -1217,10 +1217,10 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
.subcmd = GSCAN_SUBCMD_ENABLE_FULL_SCAN_RESULTS .subcmd = GSCAN_SUBCMD_ENABLE_FULL_SCAN_RESULTS
}, },
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
.doit = wl_cfgvendor_enable_full_scan_result,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0))
.policy = VENDOR_CMD_RAW_DATA, .policy = VENDOR_CMD_RAW_DATA,
#endif #endif
.doit = wl_cfgvendor_enable_full_scan_result
}, },
{ {
{ {
@ -1228,10 +1228,10 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
.subcmd = GSCAN_SUBCMD_SET_HOTLIST .subcmd = GSCAN_SUBCMD_SET_HOTLIST
}, },
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
.doit = wl_cfgvendor_hotlist_cfg,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0))
.policy = VENDOR_CMD_RAW_DATA, .policy = VENDOR_CMD_RAW_DATA,
#endif #endif
.doit = wl_cfgvendor_hotlist_cfg
}, },
{ {
{ {
@ -1239,10 +1239,10 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
.subcmd = GSCAN_SUBCMD_SET_SIGNIFICANT_CHANGE_CONFIG .subcmd = GSCAN_SUBCMD_SET_SIGNIFICANT_CHANGE_CONFIG
}, },
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
.doit = wl_cfgvendor_significant_change_cfg,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0))
.policy = VENDOR_CMD_RAW_DATA, .policy = VENDOR_CMD_RAW_DATA,
#endif #endif
.doit = wl_cfgvendor_significant_change_cfg
}, },
{ {
{ {
@ -1250,10 +1250,10 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
.subcmd = GSCAN_SUBCMD_GET_SCAN_RESULTS .subcmd = GSCAN_SUBCMD_GET_SCAN_RESULTS
}, },
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
.doit = wl_cfgvendor_gscan_get_batch_results,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0))
.policy = VENDOR_CMD_RAW_DATA, .policy = VENDOR_CMD_RAW_DATA,
#endif #endif
.doit = wl_cfgvendor_gscan_get_batch_results
}, },
{ {
{ {
@ -1261,10 +1261,10 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
.subcmd = GSCAN_SUBCMD_GET_CHANNEL_LIST .subcmd = GSCAN_SUBCMD_GET_CHANNEL_LIST
}, },
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
.doit = wl_cfgvendor_gscan_get_channel_list,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0))
.policy = VENDOR_CMD_RAW_DATA, .policy = VENDOR_CMD_RAW_DATA,
#endif #endif
.doit = wl_cfgvendor_gscan_get_channel_list
}, },
#endif /* GSCAN_SUPPORT */ #endif /* GSCAN_SUPPORT */
#if defined(RTT_SUPPORT) && 0 #if defined(RTT_SUPPORT) && 0
@ -1274,10 +1274,10 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
.subcmd = RTT_SUBCMD_SET_CONFIG .subcmd = RTT_SUBCMD_SET_CONFIG
}, },
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
.doit = wl_cfgvendor_rtt_set_config,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0))
.policy = VENDOR_CMD_RAW_DATA, .policy = VENDOR_CMD_RAW_DATA,
#endif #endif
.doit = wl_cfgvendor_rtt_set_config
}, },
{ {
{ {
@ -1285,10 +1285,10 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
.subcmd = RTT_SUBCMD_CANCEL_CONFIG .subcmd = RTT_SUBCMD_CANCEL_CONFIG
}, },
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
.doit = wl_cfgvendor_rtt_cancel_config,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0))
.policy = VENDOR_CMD_RAW_DATA, .policy = VENDOR_CMD_RAW_DATA,
#endif #endif
.doit = wl_cfgvendor_rtt_cancel_config
}, },
{ {
{ {
@ -1296,10 +1296,10 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
.subcmd = RTT_SUBCMD_GETCAPABILITY .subcmd = RTT_SUBCMD_GETCAPABILITY
}, },
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
.doit = wl_cfgvendor_rtt_get_capability,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0))
.policy = VENDOR_CMD_RAW_DATA, .policy = VENDOR_CMD_RAW_DATA,
#endif #endif
.doit = wl_cfgvendor_rtt_get_capability
}, },
#endif /* RTT_SUPPORT */ #endif /* RTT_SUPPORT */
{ {
@ -1308,10 +1308,10 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
.subcmd = ANDR_WIFI_SUBCMD_GET_FEATURE_SET .subcmd = ANDR_WIFI_SUBCMD_GET_FEATURE_SET
}, },
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
.doit = rtw_cfgvendor_get_feature_set,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0))
.policy = VENDOR_CMD_RAW_DATA, .policy = VENDOR_CMD_RAW_DATA,
#endif #endif
.doit = rtw_cfgvendor_get_feature_set
}, },
{ {
{ {
@ -1319,10 +1319,10 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = {
.subcmd = ANDR_WIFI_SUBCMD_GET_FEATURE_SET_MATRIX .subcmd = ANDR_WIFI_SUBCMD_GET_FEATURE_SET_MATRIX
}, },
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
.doit = rtw_cfgvendor_get_feature_set_matrix,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0))
.policy = VENDOR_CMD_RAW_DATA, .policy = VENDOR_CMD_RAW_DATA,
#endif #endif
.doit = rtw_cfgvendor_get_feature_set_matrix
} }
}; };

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)
{ {

View File

@ -1290,7 +1290,7 @@ static int isFileReadable(const char *path, u32 *sz)
ret = PTR_ERR(fp); ret = PTR_ERR(fp);
else { else {
oldfs = get_fs(); oldfs = get_fs();
set_fs(get_ds()); set_fs(KERNEL_DS);
if (1 != readFile(fp, &buf, 1)) if (1 != readFile(fp, &buf, 1))
ret = PTR_ERR(fp); ret = PTR_ERR(fp);
@ -1328,7 +1328,7 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz)
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp); RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
oldfs = get_fs(); oldfs = get_fs();
set_fs(get_ds()); set_fs(KERNEL_DS);
ret = readFile(fp, buf, sz); ret = readFile(fp, buf, sz);
set_fs(oldfs); set_fs(oldfs);
closeFile(fp); closeFile(fp);
@ -1363,7 +1363,7 @@ static int storeToFile(const char *path, u8 *buf, u32 sz)
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp); RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
oldfs = get_fs(); oldfs = get_fs();
set_fs(get_ds()); set_fs(KERNEL_DS);
ret = writeFile(fp, buf, sz); ret = writeFile(fp, buf, sz);
set_fs(oldfs); set_fs(oldfs);
closeFile(fp); closeFile(fp);
@ -1786,7 +1786,7 @@ int map_readN(const struct map_t *map, u16 offset, u16 len, u8 *buf)
else else
c_len = seg->sa + seg->len - offset; c_len = seg->sa + seg->len - offset;
} }
_rtw_memcpy(c_dst, c_src, c_len); _rtw_memcpy(c_dst, c_src, c_len);
} }