1
0
mirror of https://github.com/aircrack-ng/rtl8812au.git synced 2025-01-03 21:04:05 +00:00

Update rtw_recv.c

This commit is contained in:
Christian B 2017-12-17 12:09:20 +01:00 committed by GitHub
parent ee85b4850e
commit 623eb9d850
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,11 +29,7 @@
#endif #endif
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS #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); void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS);
#endif
enum { enum {
SIGNAL_STAT_CALC_PROFILE_0 = 0, 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); res = rtw_hal_init_recv_priv(padapter);
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS #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)); 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_sampling_interval = 2000; /* ms */
/* precvpriv->signal_stat_converging_constant = 5000; */ /* 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); rtw_set_signal_stat_timer(precvpriv);
#endif
#endif /* CONFIG_NEW_SIGNAL_STAT_PROCESS */ #endif /* CONFIG_NEW_SIGNAL_STAT_PROCESS */
exit: exit:
@ -4188,18 +4176,11 @@ _recv_entry_drop:
return ret; return ret;
} }
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
void rtw_signal_stat_timer_hdl(struct timer_list *t)
#else
void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS) void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS)
#endif
{ {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) _adapter *adapter = (_adapter *)FunctionContext;
_adapter *padapter = from_timer(padapter, t, recvpriv.signal_stat_timer); struct recv_priv *recvpriv = &adapter->recvpriv;
#else
_adapter *padapter = (_adapter *)FunctionContext;
#endif
struct recv_priv *recvpriv = &padapter->recvpriv;
u32 tmp_s, tmp_q; u32 tmp_s, tmp_q;
u8 avg_signal_strength = 0; u8 avg_signal_strength = 0;
@ -4208,10 +4189,10 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS)
u32 num_signal_qual = 0; u32 num_signal_qual = 0;
u8 ratio_pre_stat = 0, ratio_curr_stat = 0, ratio_total = 0, ratio_profile = SIGNAL_STAT_CALC_PROFILE_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 */ /* update the user specific value, signal_strength_dbg, to signal_strength, rssi */
padapter->recvpriv.signal_strength = padapter->recvpriv.signal_strength_dbg; adapter->recvpriv.signal_strength = adapter->recvpriv.signal_strength_dbg;
padapter->recvpriv.rssi=(s8)translate_percentage_to_dbm((u8)padapter->recvpriv.signal_strength_dbg); adapter->recvpriv.rssi = (s8)translate_percentage_to_dbm((u8)adapter->recvpriv.signal_strength_dbg);
} else { } else {
if (recvpriv->signal_strength_data.update_req == 0) { /* update_req is clear, means we got rx */ 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; goto set_timer;
} }
if (check_fwstate(&padapter->mlmepriv, _FW_UNDER_SURVEY) == _TRUE if (check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY) == _TRUE
|| check_fwstate(&padapter->mlmepriv, _FW_LINKED) == _FALSE || check_fwstate(&adapter->mlmepriv, _FW_LINKED) == _FALSE
) )
goto set_timer; goto set_timer;
@ -4289,12 +4270,10 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS)
} }
set_timer: 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); 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) static void rx_process_rssi(_adapter *padapter, union recv_frame *prframe)
{ {