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