diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index bd7a8db..3549f11 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -1465,7 +1465,7 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) ptable->func = &OnAuth; else ptable->func = &OnAuthClient; - /* pass through */ + __attribute__ ((__fallthrough__));/* FALL THRU */ case WIFI_ASSOCREQ: case WIFI_REASSOCREQ: _mgt_dispatcher(padapter, ptable, precv_frame); diff --git a/hal/btc/halbtc8723d1ant.c b/hal/btc/halbtc8723d1ant.c index df0f4e9..bcbdaee 100644 --- a/hal/btc/halbtc8723d1ant.c +++ b/hal/btc/halbtc8723d1ant.c @@ -3576,6 +3576,7 @@ static void halbtc8723d1ant_psd_show_antenna_detect_result(IN struct btc_coexist case 11: CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, "(BT is Disabled)"); + break; case 12: CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, "(BT is available, result from BT"); diff --git a/hal/btc/halbtc8723d2ant.c b/hal/btc/halbtc8723d2ant.c index b4d122f..460a091 100644 --- a/hal/btc/halbtc8723d2ant.c +++ b/hal/btc/halbtc8723d2ant.c @@ -4160,6 +4160,7 @@ static void halbtc8723d2ant_psd_show_antenna_detect_result(IN struct btc_coexist case 11: CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, "(BT is Disabled)"); + break; case 12: CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, "(BT is available, result from BT"); diff --git a/hal/hal_intf.c b/hal/hal_intf.c index bf7a65f..feb1a07 100644 --- a/hal/hal_intf.c +++ b/hal/hal_intf.c @@ -811,6 +811,7 @@ s32 c2h_handler(_adapter *adapter, u8 id, u8 seq, u8 plen, u8 *payload) case C2H_EXTEND: sub_id = payload[0]; + __attribute__((__fallthrough__)); /* no handle, goto default */ default: diff --git a/hal/led/hal_sdio_led.c b/hal/led/hal_sdio_led.c index ec84d5e..8edc14b 100644 --- a/hal/led/hal_sdio_led.c +++ b/hal/led/hal_sdio_led.c @@ -2005,7 +2005,7 @@ InitLed( #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) timer_setup(&pLed->BlinkTimer, BlinkTimerCallback, 0); #else - _init_timer(&pLed->BlinkTimer, padapter->pnetdev, linkTimerCallback, pLed); + _init_timer(&pLed->BlinkTimer, padapter->pnetdev, BlinkTimerCallback, pLed); #endif _init_workitem(&(pLed->BlinkWorkItem), BlinkWorkItemCallback, pLed); } diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index cd1bfe7..564c2c5 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -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)) case NL80211_IFTYPE_P2P_CLIENT: is_p2p = _TRUE; + __attribute__((__fallthrough__)); #endif case NL80211_IFTYPE_STATION: 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)) case NL80211_IFTYPE_P2P_GO: is_p2p = _TRUE; + __attribute__((__fallthrough__)); #endif case NL80211_IFTYPE_AP: networkType = Ndis802_11APMode; diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 43bfc39..f4ba3b1 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -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 -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) - ,struct net_device *sb_dev - ,select_queue_fallback_t fallback -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) - ,void *unused - ,select_queue_fallback_t fallback -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) - , void *accel_priv +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) + #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) + , void *accel_priv + #else + , struct net_device *sb_dev + #endif + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)) + , select_queue_fallback_t fallback + #endif #endif ) { diff --git a/os_dep/linux/rtw_cfgvendor.c b/os_dep/linux/rtw_cfgvendor.c index 4aa761c..43e2f82 100644 --- a/os_dep/linux/rtw_cfgvendor.c +++ b/os_dep/linux/rtw_cfgvendor.c @@ -1161,10 +1161,10 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = { .subcmd = BRCM_VENDOR_SCMD_PRIV_STR }, .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)) .policy = VENDOR_CMD_RAW_DATA, #endif - .doit = wl_cfgvendor_priv_string_handler }, #if defined(GSCAN_SUPPORT) && 0 { @@ -1173,10 +1173,10 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = { .subcmd = GSCAN_SUBCMD_GET_CAPABILITIES }, .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)) .policy = VENDOR_CMD_RAW_DATA, #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 }, .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)) .policy = VENDOR_CMD_RAW_DATA, #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 }, .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)) .policy = VENDOR_CMD_RAW_DATA, #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 }, .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)) .policy = VENDOR_CMD_RAW_DATA, #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 }, .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)) .policy = VENDOR_CMD_RAW_DATA, #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 }, .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)) .policy = VENDOR_CMD_RAW_DATA, #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 }, .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)) .policy = VENDOR_CMD_RAW_DATA, #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 }, .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)) .policy = VENDOR_CMD_RAW_DATA, #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 }, .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)) .policy = VENDOR_CMD_RAW_DATA, #endif - .doit = wl_cfgvendor_gscan_get_channel_list }, #endif /* GSCAN_SUPPORT */ #if defined(RTT_SUPPORT) && 0 @@ -1274,10 +1274,10 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = { .subcmd = RTT_SUBCMD_SET_CONFIG }, .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)) .policy = VENDOR_CMD_RAW_DATA, #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 }, .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)) .policy = VENDOR_CMD_RAW_DATA, #endif - .doit = wl_cfgvendor_rtt_cancel_config }, { { @@ -1296,10 +1296,10 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = { .subcmd = RTT_SUBCMD_GETCAPABILITY }, .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)) .policy = VENDOR_CMD_RAW_DATA, #endif - .doit = wl_cfgvendor_rtt_get_capability }, #endif /* RTT_SUPPORT */ { @@ -1308,10 +1308,10 @@ static const struct wiphy_vendor_command rtw_vendor_cmds[] = { .subcmd = ANDR_WIFI_SUBCMD_GET_FEATURE_SET }, .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)) .policy = VENDOR_CMD_RAW_DATA, #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 }, .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)) .policy = VENDOR_CMD_RAW_DATA, #endif - .doit = rtw_cfgvendor_get_feature_set_matrix } }; diff --git a/os_dep/linux/rtw_proc.c b/os_dep/linux/rtw_proc.c index 74c4e19..eb3d8ce 100644 --- a/os_dep/linux/rtw_proc.c +++ b/os_dep/linux/rtw_proc.c @@ -68,8 +68,14 @@ inline struct proc_dir_entry *rtw_proc_create_dir(const char *name, struct proc_ 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, - const struct file_operations *fops, void * data) + const struct struct_proc_ops *fops, void * data) { 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; } +#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 = { .owner = THIS_MODULE, .open = rtw_drv_proc_open, @@ -227,7 +242,17 @@ static const struct file_operations rtw_drv_proc_seq_fops = { .release = seq_release, .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 = { .owner = THIS_MODULE, .open = rtw_drv_proc_open, @@ -236,6 +261,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) { @@ -2325,6 +2351,15 @@ 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_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 = { .owner = THIS_MODULE, .open = rtw_adapter_proc_open, @@ -2333,7 +2368,17 @@ static const struct file_operations rtw_adapter_proc_seq_fops = { .release = seq_release, .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 = { .owner = THIS_MODULE, .open = rtw_adapter_proc_open, @@ -2342,6 +2387,7 @@ static const struct file_operations rtw_adapter_proc_sseq_fops = { .release = single_release, .write = rtw_adapter_proc_write, }; +#endif 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; } +#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 = { .owner = THIS_MODULE, .open = rtw_odm_proc_open, @@ -2668,7 +2723,17 @@ static const struct file_operations rtw_odm_proc_seq_fops = { .release = seq_release, .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 = { .owner = THIS_MODULE, .open = rtw_odm_proc_open, @@ -2677,6 +2742,7 @@ static const struct file_operations rtw_odm_proc_sseq_fops = { .release = single_release, .write = rtw_odm_proc_write, }; +#endif 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; } +#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 = { .owner = THIS_MODULE, .open = rtw_mcc_proc_open, @@ -2807,7 +2882,17 @@ static const struct file_operations rtw_mcc_proc_seq_fops = { .release = seq_release, .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 = { .owner = THIS_MODULE, .open = rtw_mcc_proc_open, @@ -2816,6 +2901,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) { diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index a7a1ef0..d98de2f 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -1290,7 +1290,7 @@ static int isFileReadable(const char *path, u32 *sz) ret = PTR_ERR(fp); else { oldfs = get_fs(); - set_fs(get_ds()); + set_fs(KERNEL_DS); if (1 != readFile(fp, &buf, 1)) 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); oldfs = get_fs(); - set_fs(get_ds()); + set_fs(KERNEL_DS); ret = readFile(fp, buf, sz); set_fs(oldfs); 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); oldfs = get_fs(); - set_fs(get_ds()); + set_fs(KERNEL_DS); ret = writeFile(fp, buf, sz); set_fs(oldfs); closeFile(fp); @@ -1786,7 +1786,7 @@ int map_readN(const struct map_t *map, u16 offset, u16 len, u8 *buf) else c_len = seg->sa + seg->len - offset; } - + _rtw_memcpy(c_dst, c_src, c_len); }