From 5f246dabef77ca80caf992ebb9f6e55297f5b64b Mon Sep 17 00:00:00 2001 From: Christian B Date: Sun, 17 Dec 2017 11:21:20 +0100 Subject: [PATCH 01/14] Update rtw_mlme.c * Removed kernel v4.15 support. It introduced several bugs, so it needs more work. --- core/rtw_mlme.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index 5954790..4cb54db 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -1228,11 +1228,7 @@ void rtw_surveydone_event_callback(_adapter *adapter, u8 *pbuf) _enter_critical_bh(&pmlmepriv->lock, &irqL); #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - _set_timer(&adapter->recvpriv.signal_stat_timer, adapter->recvpriv.signal_stat_sampling_interval); -#else rtw_set_signal_stat_timer(&adapter->recvpriv); -#endif #endif if (pmlmepriv->to_join == _TRUE) { @@ -1829,11 +1825,7 @@ static void rtw_joinbss_update_network(_adapter *padapter, struct wlan_network * #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - _set_timer(&padapter->recvpriv.signal_stat_timer, padapter->recvpriv.signal_stat_sampling_interval); -#else rtw_set_signal_stat_timer(&padapter->recvpriv); -#endif #endif padapter->recvpriv.signal_strength = ptarget_wlan->network.PhyInfo.SignalStrength; padapter->recvpriv.signal_qual = ptarget_wlan->network.PhyInfo.SignalQuality; @@ -1849,11 +1841,7 @@ static void rtw_joinbss_update_network(_adapter *padapter, struct wlan_network * ); #endif #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - _set_timer(&padapter->recvpriv.signal_stat_timer, padapter->recvpriv.signal_stat_sampling_interval); -#else rtw_set_signal_stat_timer(&padapter->recvpriv); -#endif #endif /* update fw_state */ /* will clr _FW_UNDER_LINKING here indirectly */ From e0d013558162b9fc3393740e809950d9a64ffcea Mon Sep 17 00:00:00 2001 From: Christian B Date: Sun, 17 Dec 2017 11:47:40 +0100 Subject: [PATCH 02/14] Update rtw_p2p.c --- core/rtw_p2p.c | 72 +++----------------------------------------------- 1 file changed, 3 insertions(+), 69 deletions(-) diff --git a/core/rtw_p2p.c b/core/rtw_p2p.c index 7b6bd4f..a5d6d97 100644 --- a/core/rtw_p2p.c +++ b/core/rtw_p2p.c @@ -3269,17 +3269,9 @@ static void ro_ch_handler(_adapter *padapter) } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) -static void ro_ch_timer_process(struct timer_list *t) -#else static void ro_ch_timer_process(void *FunctionContext) -#endif { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - _adapter *adapter = from_timer(adapter, t, cfg80211_wdinfo.remain_on_ch_timer); -#else _adapter *adapter = (_adapter *)FunctionContext; -#endif struct rtw_wdev_priv *pwdev_priv = adapter_wdev_data(adapter); /* printk("%s\n", __FUNCTION__); */ @@ -4074,11 +4066,7 @@ void rtw_init_cfg80211_wifidirect_info(_adapter *padapter) _rtw_memset(pcfg80211_wdinfo, 0x00, sizeof(struct cfg80211_wifidirect_info)); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - timer_setup(&pcfg80211_wdinfo->remain_on_ch_timer, ro_ch_timer_process, 0); -#else _init_timer(&pcfg80211_wdinfo->remain_on_ch_timer, padapter->pnetdev, ro_ch_timer_process, padapter); -#endif } #endif /* CONFIG_IOCTL_CFG80211 */ @@ -4381,17 +4369,9 @@ exit: } #endif /* CONFIG_P2P_PS */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) -static void reset_ch_sitesurvey_timer_process(struct timer_list *t) -#else static void reset_ch_sitesurvey_timer_process(void *FunctionContext) -#endif { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - _adapter *adapter = from_timer(adapter, t, wdinfo.reset_ch_sitesurvey); -#else _adapter *adapter = (_adapter *)FunctionContext; -#endif struct wifidirect_info *pwdinfo = &adapter->wdinfo; if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) @@ -4408,17 +4388,9 @@ static void reset_ch_sitesurvey_timer_process(void *FunctionContext) pwdinfo->rx_invitereq_info.scan_op_ch_only = 0; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) -static void reset_ch_sitesurvey_timer_process2(struct timer_list *t) -#else static void reset_ch_sitesurvey_timer_process2(void *FunctionContext) -#endif { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - _adapter *adapter = from_timer(adapter, t, wdinfo.reset_ch_sitesurvey2); -#else _adapter *adapter = (_adapter *)FunctionContext; -#endif struct wifidirect_info *pwdinfo = &adapter->wdinfo; if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) @@ -4435,17 +4407,9 @@ static void reset_ch_sitesurvey_timer_process2(void *FunctionContext) pwdinfo->p2p_info.scan_op_ch_only = 0; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) -static void restore_p2p_state_timer_process (struct timer_list *t) -#else static void restore_p2p_state_timer_process(void *FunctionContext) -#endif { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - _adapter *adapter = from_timer(adapter, t, wdinfo.restore_p2p_state_timer); -#else _adapter *adapter = (_adapter *)FunctionContext; -#endif struct wifidirect_info *pwdinfo = &adapter->wdinfo; if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) @@ -4454,17 +4418,9 @@ static void restore_p2p_state_timer_process(void *FunctionContext) p2p_protocol_wk_cmd(adapter, P2P_RESTORE_STATE_WK); } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) -static void pre_tx_scan_timer_process (struct timer_list *t) -#else static void pre_tx_scan_timer_process(void *FunctionContext) -#endif { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - _adapter *adapter = from_timer(adapter, t, wdinfo.pre_tx_scan_timer); -#else - _adapter *adapter = (_adapter *) FunctionContext; -#endif + _adapter *adapter = (_adapter *) FunctionContext; struct wifidirect_info *pwdinfo = &adapter->wdinfo; _irqL irqL; struct mlme_priv *pmlmepriv = &adapter->mlmepriv; @@ -4493,17 +4449,9 @@ static void pre_tx_scan_timer_process(void *FunctionContext) _exit_critical_bh(&pmlmepriv->lock, &irqL); } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) -static void find_phase_timer_process(struct timer_list *t) -#else static void find_phase_timer_process(void *FunctionContext) -#endif { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - _adapter *adapter = from_timer(adapter, t, wdinfo.find_phase_timer); -#else _adapter *adapter = (_adapter *)FunctionContext; -#endif struct wifidirect_info *pwdinfo = &adapter->wdinfo; if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) @@ -4760,16 +4708,6 @@ void rtw_init_wifidirect_timers(_adapter *padapter) { struct wifidirect_info *pwdinfo = &padapter->wdinfo; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - timer_setup(&pwdinfo->find_phase_timer, find_phase_timer_process, 0); - timer_setup(&pwdinfo->restore_p2p_state_timer, restore_p2p_state_timer_process, 0); - timer_setup(&pwdinfo->pre_tx_scan_timer, pre_tx_scan_timer_process, 0); - timer_setup(&pwdinfo->reset_ch_sitesurvey, reset_ch_sitesurvey_timer_process, 0); - timer_setup(&pwdinfo->reset_ch_sitesurvey2, reset_ch_sitesurvey_timer_process2, 0); -#ifdef CONFIG_CONCURRENT_MODE - timer_setup(&pwdinfo->ap_p2p_switch_timer, ap_p2p_switch_timer_process, 0); -#endif -#else _init_timer(&pwdinfo->find_phase_timer, padapter->pnetdev, find_phase_timer_process, padapter); _init_timer(&pwdinfo->restore_p2p_state_timer, padapter->pnetdev, restore_p2p_state_timer_process, padapter); _init_timer(&pwdinfo->pre_tx_scan_timer, padapter->pnetdev, pre_tx_scan_timer_process, padapter); @@ -4778,7 +4716,6 @@ void rtw_init_wifidirect_timers(_adapter *padapter) #ifdef CONFIG_CONCURRENT_MODE _init_timer(&pwdinfo->ap_p2p_switch_timer, padapter->pnetdev, ap_p2p_switch_timer_process, padapter); #endif -#endif } void rtw_init_wifidirect_addrs(_adapter *padapter, u8 *dev_addr, u8 *iface_addr) @@ -5141,13 +5078,10 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role) _cancel_timer_ex(&pwdinfo->pre_tx_scan_timer); _cancel_timer_ex(&pwdinfo->reset_ch_sitesurvey); _cancel_timer_ex(&pwdinfo->reset_ch_sitesurvey2); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - reset_ch_sitesurvey_timer_process(&pwdinfo->reset_ch_sitesurvey); - reset_ch_sitesurvey_timer_process2(&pwdinfo->reset_ch_sitesurvey2); -#else + reset_ch_sitesurvey_timer_process(padapter); reset_ch_sitesurvey_timer_process2(padapter); -#endif + #ifdef CONFIG_CONCURRENT_MODE _cancel_timer_ex(&pwdinfo->ap_p2p_switch_timer); #endif From f1ef700e29b9db8557d3d7cc5eb8092d6a10d5d8 Mon Sep 17 00:00:00 2001 From: Christian B Date: Sun, 17 Dec 2017 11:49:39 +0100 Subject: [PATCH 03/14] Update rtw_pwrctrl.c --- core/rtw_pwrctrl.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/core/rtw_pwrctrl.c b/core/rtw_pwrctrl.c index f61a5b3..d8b45f4 100644 --- a/core/rtw_pwrctrl.c +++ b/core/rtw_pwrctrl.c @@ -393,17 +393,10 @@ exit: return; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) -void pwr_state_check_handler(struct timer_list *t) -#else +void pwr_state_check_handler(RTW_TIMER_HDL_ARGS); void pwr_state_check_handler(RTW_TIMER_HDL_ARGS) -#endif { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - _adapter *padapter = from_timer(padapter, t, pwrctrlpriv.pwr_state_check_timer); -#else _adapter *padapter = (_adapter *)FunctionContext; -#endif rtw_ps_cmd(padapter); } @@ -1975,11 +1968,7 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter) #endif /* CONFIG_LPS_RPWM_TIMER */ #endif /* CONFIG_LPS_LCLK */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - timer_setup(&pwrctrlpriv->pwr_state_check_timer, pwr_state_check_handler, 0); -#else rtw_init_timer(&pwrctrlpriv->pwr_state_check_timer, padapter, pwr_state_check_handler); -#endif pwrctrlpriv->wowlan_mode = _FALSE; pwrctrlpriv->wowlan_ap_mode = _FALSE; From dd6d41d60bf3b3105eeb145bb564c375aed0ccf4 Mon Sep 17 00:00:00 2001 From: Christian B Date: Sun, 17 Dec 2017 11:51:14 +0100 Subject: [PATCH 04/14] Update rtw_tdls.c --- core/rtw_tdls.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/core/rtw_tdls.c b/core/rtw_tdls.c index 1e4c8d1..be31530 100644 --- a/core/rtw_tdls.c +++ b/core/rtw_tdls.c @@ -3141,17 +3141,9 @@ void rtw_build_tunneled_probe_rsp_ies(_adapter *padapter, struct xmit_frame *pxm } #endif /* CONFIG_WFD */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) -void _tdls_tpk_timer_hdl(struct timer_list *t) -#else void _tdls_tpk_timer_hdl(void *FunctionContext) -#endif { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - struct sta_info *ptdls_sta = from_timer(ptdls_sta, t, sta.TPK_timer); -#else struct sta_info *ptdls_sta = (struct sta_info *)FunctionContext; -#endif struct tdls_txmgmt txmgmt; _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); @@ -3254,11 +3246,7 @@ void _tdls_pti_timer_hdl(void *FunctionContext) void rtw_init_tdls_timer(_adapter *padapter, struct sta_info *psta) { psta->padapter = padapter; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - timer_setup(&psta->TPK_timer, _TPK_timer_hdl, 0); -#else _init_timer(&psta->TPK_timer, padapter->pnetdev, _tdls_tpk_timer_hdl, psta); -#endif #ifdef CONFIG_TDLS_CH_SW _init_timer(&psta->ch_sw_timer, padapter->pnetdev, _tdls_ch_switch_timer_hdl, psta); _init_timer(&psta->delay_timer, padapter->pnetdev, _tdls_delay_timer_hdl, psta); From d91f4be99d2deac55e0fbde190655e55e80ab44d Mon Sep 17 00:00:00 2001 From: Christian B Date: Sun, 17 Dec 2017 11:53:07 +0100 Subject: [PATCH 05/14] Update hal_usb_led.c --- hal/led/hal_usb_led.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/hal/led/hal_usb_led.c b/hal/led/hal_usb_led.c index ae0535c..117bc93 100644 --- a/hal/led/hal_usb_led.c +++ b/hal/led/hal_usb_led.c @@ -1815,17 +1815,9 @@ void BlinkHandler(PLED_USB pLed) * Callback function of LED BlinkTimer, * it just schedules to corresponding BlinkWorkItem/led_blink_hdl * */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) -void BlinkTimerCallback(struct timer_list *t) -#else void BlinkTimerCallback(void *data) -#endif { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - PLED_USB pLed = from_timer(pLed, t, BlinkTimer); -#else PLED_USB pLed = (PLED_USB)data; -#endif _adapter *padapter = pLed->padapter; /* RTW_INFO("%s\n", __FUNCTION__); */ @@ -4237,11 +4229,7 @@ InitLed( pLed->LedPin = LedPin; ResetLedStatus(pLed); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - timer_setup(&pLed->BlinkTimer, BlinkTimerCallback, 0); -#else - _init_timer(&pLed->BlinkTimer, padapter->pnetdev, BlinkTimerCallback, pLed); -#endif + _init_timer(&(pLed->BlinkTimer), padapter->pnetdev, BlinkTimerCallback, pLed); _init_workitem(&(pLed->BlinkWorkItem), BlinkWorkItemCallback, pLed); } From 43c6c987b0dd39a1aaa98d26d546a1d89a4ba902 Mon Sep 17 00:00:00 2001 From: Christian B Date: Sun, 17 Dec 2017 11:54:43 +0100 Subject: [PATCH 06/14] Update recv_linux.c --- os_dep/linux/recv_linux.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/os_dep/linux/recv_linux.c b/os_dep/linux/recv_linux.c index fa84bcb..52fbba5 100644 --- a/os_dep/linux/recv_linux.c +++ b/os_dep/linux/recv_linux.c @@ -784,17 +784,10 @@ void rtw_os_read_port(_adapter *padapter, struct recv_buf *precvbuf) } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) -void _rtw_reordering_ctrl_timeout_handler(struct timer_list *t) -#else +void _rtw_reordering_ctrl_timeout_handler(void *FunctionContext); void _rtw_reordering_ctrl_timeout_handler(void *FunctionContext) -#endif { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - struct recv_reorder_ctrl *preorder_ctrl = from_timer(preorder_ctrl, t, reordering_ctrl_timer); -#else struct recv_reorder_ctrl *preorder_ctrl = (struct recv_reorder_ctrl *)FunctionContext; -#endif rtw_reordering_ctrl_timeout_handler(preorder_ctrl); } @@ -802,9 +795,5 @@ void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl) { _adapter *padapter = preorder_ctrl->padapter; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - timer_setup(&preorder_ctrl->reordering_ctrl_timer, _rtw_reordering_ctrl_timeout_handler, 0); -#else _init_timer(&(preorder_ctrl->reordering_ctrl_timer), padapter->pnetdev, _rtw_reordering_ctrl_timeout_handler, preorder_ctrl); -#endif } From c39d6bcf0a75aef6a0a6604b77f40c619a23139c Mon Sep 17 00:00:00 2001 From: Christian B Date: Sun, 17 Dec 2017 11:56:50 +0100 Subject: [PATCH 07/14] Update osdep_service.c --- os_dep/osdep_service.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index 6fa4e82..88a3ff5 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -996,15 +996,21 @@ void rtw_list_insert_tail(_list *plist, _list *phead) } -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) void rtw_init_timer(_timer *ptimer, void *padapter, void *pfunc) { _adapter *adapter = (_adapter *)padapter; +#ifdef PLATFORM_LINUX _init_timer(ptimer, adapter->pnetdev, pfunc, adapter); +#endif +#ifdef PLATFORM_FREEBSD + _init_timer(ptimer, adapter->pifp, pfunc, adapter->mlmepriv.nic_hdl); +#endif +#ifdef PLATFORM_WINDOWS + _init_timer(ptimer, adapter->hndis_adapter, pfunc, adapter->mlmepriv.nic_hdl); +#endif } -#endif /* From e4f96b01153bf4af8457357f90f435b3799e89a8 Mon Sep 17 00:00:00 2001 From: Christian B Date: Sun, 17 Dec 2017 11:58:34 +0100 Subject: [PATCH 08/14] Update os_intfs.c --- os_dep/linux/os_intfs.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 6d34c0e..09c54e5 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1826,11 +1826,7 @@ u8 rtw_reset_drv_sw(_adapter *padapter) mlmeext_set_scan_state(&padapter->mlmeextpriv, SCAN_DISABLE); #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - _set_timer(&padapter->recvpriv.signal_stat_timer, padapter->recvpriv.signal_stat_sampling_interval); -#else rtw_set_signal_stat_timer(&padapter->recvpriv); -#endif #endif return ret8; From 87aec9ad1c269443efec497bec292c0ff2d6d280 Mon Sep 17 00:00:00 2001 From: Christian B Date: Sun, 17 Dec 2017 12:01:00 +0100 Subject: [PATCH 09/14] Update rtw_recv.h --- include/rtw_recv.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/rtw_recv.h b/include/rtw_recv.h index f6dcd82..475aca7 100644 --- a/include/rtw_recv.h +++ b/include/rtw_recv.h @@ -482,9 +482,7 @@ struct recv_priv { }; #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) #define rtw_set_signal_stat_timer(recvpriv) _set_timer(&(recvpriv)->signal_stat_timer, (recvpriv)->signal_stat_sampling_interval) -#endif #endif /* CONFIG_NEW_SIGNAL_STAT_PROCESS */ struct sta_recv_priv { From ee85b4850eba69528d478dcfffbde97c841725f7 Mon Sep 17 00:00:00 2001 From: Christian B Date: Sun, 17 Dec 2017 12:02:26 +0100 Subject: [PATCH 10/14] Update osdep_service_linux.h --- include/osdep_service_linux.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/osdep_service_linux.h b/include/osdep_service_linux.h index 342c2aa..b2410f2 100644 --- a/include/osdep_service_linux.h +++ b/include/osdep_service_linux.h @@ -269,14 +269,13 @@ __inline static void rtw_list_delete(_list *plist) } #define RTW_TIMER_HDL_ARGS void *FunctionContext -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) __inline static void _init_timer(_timer *ptimer, _nic_hdl nic_hdl, void *pfunc, void *cntx) { + /* setup_timer(ptimer, pfunc,(u32)cntx); */ ptimer->function = pfunc; ptimer->data = (unsigned long)cntx; init_timer(ptimer); } -#endif __inline static void _set_timer(_timer *ptimer, u32 delay_time) { From 623eb9d850cc52442c4ab82dac8f4d4eaa80b4e9 Mon Sep 17 00:00:00 2001 From: Christian B Date: Sun, 17 Dec 2017 12:09:20 +0100 Subject: [PATCH 11/14] Update rtw_recv.c --- core/rtw_recv.c | 41 ++++++++++------------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/core/rtw_recv.c b/core/rtw_recv.c index ff37aa0..59707a1 100755 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -29,11 +29,7 @@ #endif #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) -void rtw_signal_stat_timer_hdl(struct timer_list *t); -#else void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS); -#endif enum { SIGNAL_STAT_CALC_PROFILE_0 = 0, @@ -137,20 +133,12 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, _adapter *padapter) res = rtw_hal_init_recv_priv(padapter); #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - timer_setup(&precvpriv->signal_stat_timer, rtw_signal_stat_timer_hdl, 0); -#else rtw_init_timer(&precvpriv->signal_stat_timer, padapter, RTW_TIMER_HDL_NAME(signal_stat)); -#endif precvpriv->signal_stat_sampling_interval = 2000; /* ms */ /* precvpriv->signal_stat_converging_constant = 5000; */ /* ms */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - _set_timer(&precvpriv->signal_stat_timer, precvpriv->signal_stat_sampling_interval); -#else rtw_set_signal_stat_timer(precvpriv); -#endif #endif /* CONFIG_NEW_SIGNAL_STAT_PROCESS */ exit: @@ -4188,18 +4176,11 @@ _recv_entry_drop: return ret; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) -void rtw_signal_stat_timer_hdl(struct timer_list *t) -#else +#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS) -#endif { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - _adapter *padapter = from_timer(padapter, t, recvpriv.signal_stat_timer); -#else - _adapter *padapter = (_adapter *)FunctionContext; -#endif - struct recv_priv *recvpriv = &padapter->recvpriv; + _adapter *adapter = (_adapter *)FunctionContext; + struct recv_priv *recvpriv = &adapter->recvpriv; u32 tmp_s, tmp_q; u8 avg_signal_strength = 0; @@ -4208,10 +4189,10 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS) u32 num_signal_qual = 0; u8 ratio_pre_stat = 0, ratio_curr_stat = 0, ratio_total = 0, ratio_profile = SIGNAL_STAT_CALC_PROFILE_0; - if(padapter->recvpriv.is_signal_dbg) { + if (adapter->recvpriv.is_signal_dbg) { /* update the user specific value, signal_strength_dbg, to signal_strength, rssi */ - padapter->recvpriv.signal_strength = padapter->recvpriv.signal_strength_dbg; - padapter->recvpriv.rssi=(s8)translate_percentage_to_dbm((u8)padapter->recvpriv.signal_strength_dbg); + adapter->recvpriv.signal_strength = adapter->recvpriv.signal_strength_dbg; + adapter->recvpriv.rssi = (s8)translate_percentage_to_dbm((u8)adapter->recvpriv.signal_strength_dbg); } else { if (recvpriv->signal_strength_data.update_req == 0) { /* update_req is clear, means we got rx */ @@ -4235,8 +4216,8 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS) goto set_timer; } - if (check_fwstate(&padapter->mlmepriv, _FW_UNDER_SURVEY) == _TRUE - || check_fwstate(&padapter->mlmepriv, _FW_LINKED) == _FALSE + if (check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY) == _TRUE + || check_fwstate(&adapter->mlmepriv, _FW_LINKED) == _FALSE ) goto set_timer; @@ -4289,12 +4270,10 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS) } set_timer: -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) - _set_timer(&recvpriv->signal_stat_timer, recvpriv->signal_stat_sampling_interval); -#else rtw_set_signal_stat_timer(recvpriv); -#endif /* CONFIG_NEW_SIGNAL_STAT_PROCESS */ + } +#endif /* CONFIG_NEW_SIGNAL_STAT_PROCESS */ static void rx_process_rssi(_adapter *padapter, union recv_frame *prframe) { From e941a44db4fa1678fe69cef95152ba64a80620d3 Mon Sep 17 00:00:00 2001 From: Christian B Date: Sun, 17 Dec 2017 12:10:27 +0100 Subject: [PATCH 12/14] Update rtw_mlme.h --- include/rtw_mlme.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/include/rtw_mlme.h b/include/rtw_mlme.h index 6205484..669d8f6 100644 --- a/include/rtw_mlme.h +++ b/include/rtw_mlme.h @@ -771,13 +771,8 @@ extern void rtw_wmm_event_callback(PADAPTER padapter, u8 *pbuf); void rtw_sta_timeout_event_callback(_adapter *adapter, u8 *pbuf); #endif /* CONFIG_IEEE80211W */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) -void rtw_join_timeout_handler(struct timer_list *t); -void _rtw_scan_timeout_handler(struct timer_list *t); -#else extern void rtw_join_timeout_handler(RTW_TIMER_HDL_ARGS); extern void _rtw_scan_timeout_handler(RTW_TIMER_HDL_ARGS); -#endif thread_return event_thread(thread_context context); From 399388ed30ee269932a9412d018d0e95023d7d5b Mon Sep 17 00:00:00 2001 From: Christian B Date: Sun, 17 Dec 2017 12:13:05 +0100 Subject: [PATCH 13/14] 80211W & ADAPTIVITY disabled due to kernel v4.15 * 802.11 security & adaptivity turned off due to preparation of kernel v4.15 support. will take a look at these on a later stage. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2802bf9..ef959e7 100755 --- a/Makefile +++ b/Makefile @@ -62,10 +62,10 @@ CONFIG_TRAFFIC_PROTECT = y CONFIG_LOAD_PHY_PARA_FROM_FILE = y CONFIG_CALIBRATE_TX_POWER_BY_REGULATORY = n CONFIG_CALIBRATE_TX_POWER_TO_MAX = y -CONFIG_RTW_ADAPTIVITY_EN = auto +CONFIG_RTW_ADAPTIVITY_EN = disable CONFIG_RTW_ADAPTIVITY_MODE = normal CONFIG_SIGNAL_SCALE_MAPPING = n -CONFIG_80211W = y +CONFIG_80211W = n CONFIG_REDUCE_TX_CPU_LOADING = n CONFIG_BR_EXT = y CONFIG_TDLS = n From e24a462e569dcfad6edf6724c8fe23e9fa802c23 Mon Sep 17 00:00:00 2001 From: Christian B Date: Sun, 17 Dec 2017 12:25:08 +0100 Subject: [PATCH 14/14] Update rtw_recv.c --- core/rtw_recv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/rtw_recv.c b/core/rtw_recv.c index 59707a1..8bd46aa 100755 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -4210,8 +4210,8 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS) } if (num_signal_strength == 0) { - if (rtw_get_on_cur_ch_time(padapter) == 0 - || rtw_get_passing_time_ms(rtw_get_on_cur_ch_time(padapter)) < 2 * padapter->mlmeextpriv.mlmext_info.bcn_interval + if (rtw_get_on_cur_ch_time(adapter) == 0 + || rtw_get_passing_time_ms(rtw_get_on_cur_ch_time(adapter)) < 2 * adapter->mlmeextpriv.mlmext_info.bcn_interval ) goto set_timer; }