mirror of
https://github.com/amazingfate/rtl8723ds.git
synced 2026-01-28 13:53:18 +00:00
rtl8723ds: Update source for recent API changes
The source will now compile on kernels up to 4.20. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
@@ -3370,9 +3370,17 @@ exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
#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, wdinfo.reset_ch_sitesurvey);
|
||||
#else
|
||||
_adapter *adapter = (_adapter *)FunctionContext;
|
||||
#endif
|
||||
|
||||
p2p_cancel_roch_cmd(adapter, 0, NULL, 0);
|
||||
}
|
||||
@@ -4203,7 +4211,11 @@ 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)
|
||||
_init_timer(&pcfg80211_wdinfo->remain_on_ch_timer, padapter->pnetdev, ro_ch_timer_process, padapter);
|
||||
#else
|
||||
timer_setup(&pcfg80211_wdinfo->remain_on_ch_timer, ro_ch_timer_process, 0);
|
||||
#endif
|
||||
}
|
||||
#endif /* CONFIG_IOCTL_CFG80211 */
|
||||
|
||||
@@ -4515,9 +4527,17 @@ 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_sitesurvey2);
|
||||
#else
|
||||
_adapter *adapter = (_adapter *)FunctionContext;
|
||||
#endif
|
||||
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
|
||||
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
@@ -4534,9 +4554,17 @@ static void reset_ch_sitesurvey_timer_process(void *FunctionContext)
|
||||
pwdinfo->rx_invitereq_info.scan_op_ch_only = 0;
|
||||
}
|
||||
|
||||
static void reset_ch_sitesurvey_timer_process2(void *FunctionContext)
|
||||
#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))
|
||||
@@ -4553,9 +4581,17 @@ static void reset_ch_sitesurvey_timer_process2(void *FunctionContext)
|
||||
pwdinfo->p2p_info.scan_op_ch_only = 0;
|
||||
}
|
||||
|
||||
static void restore_p2p_state_timer_process(void *FunctionContext)
|
||||
#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))
|
||||
@@ -4564,9 +4600,17 @@ 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
|
||||
{
|
||||
_adapter *adapter = (_adapter *) FunctionContext;
|
||||
#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
|
||||
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
|
||||
_irqL irqL;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
@@ -4596,9 +4640,17 @@ static void pre_tx_scan_timer_process(void *FunctionContext)
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
}
|
||||
|
||||
static void find_phase_timer_process(void *FunctionContext)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
|
||||
static void find_phase_timer_process (void *FunctionContext)
|
||||
#else
|
||||
static void find_phase_timer_process(struct timer_list *t)
|
||||
#endif
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
|
||||
_adapter *adapter = (_adapter *)FunctionContext;
|
||||
#else
|
||||
_adapter *adapter = from_timer(adapter, t, wdinfo.find_phase_timer);
|
||||
#endif
|
||||
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
|
||||
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
@@ -4610,9 +4662,17 @@ static void find_phase_timer_process(void *FunctionContext)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
void ap_p2p_switch_timer_process(void *FunctionContext)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
|
||||
void ap_p2p_switch_timer_process(struct timer_list *t)
|
||||
#else
|
||||
void ap_p2p_switch_timer_process (void *FunctionContext)
|
||||
#endif
|
||||
{
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
|
||||
_adapter *adapter = from_timer(adapter, t, wdinfo.ap_p2p_switch_timer);
|
||||
#else
|
||||
_adapter *adapter = (_adapter *)FunctionContext;
|
||||
#endif
|
||||
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
struct rtw_wdev_priv *pwdev_priv = adapter_wdev_data(adapter);
|
||||
@@ -4855,6 +4915,7 @@ void rtw_init_wifidirect_timers(_adapter *padapter)
|
||||
{
|
||||
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
|
||||
_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);
|
||||
@@ -4863,6 +4924,16 @@ 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
|
||||
#else
|
||||
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
|
||||
#endif
|
||||
}
|
||||
|
||||
void rtw_init_wifidirect_addrs(_adapter *padapter, u8 *dev_addr, u8 *iface_addr)
|
||||
@@ -5244,8 +5315,13 @@ 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);
|
||||
reset_ch_sitesurvey_timer_process(padapter);
|
||||
reset_ch_sitesurvey_timer_process2(padapter);
|
||||
#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
|
||||
|
||||
@@ -393,10 +393,18 @@ exit:
|
||||
return;
|
||||
}
|
||||
|
||||
void pwr_state_check_handler(RTW_TIMER_HDL_ARGS);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
|
||||
void pwr_state_check_handler(RTW_TIMER_HDL_ARGS)
|
||||
#else
|
||||
void pwr_state_check_handler(struct timer_list *t)
|
||||
#endif
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
|
||||
_adapter *padapter = (_adapter *)FunctionContext;
|
||||
#else
|
||||
struct pwrctrl_priv *pwrpriv = from_timer(pwrpriv, t, pwr_state_check_timer);
|
||||
_adapter *padapter = pwrpriv->padapter;
|
||||
#endif
|
||||
rtw_ps_cmd(padapter);
|
||||
}
|
||||
|
||||
@@ -1438,14 +1446,18 @@ exit:
|
||||
/*
|
||||
* This function is a timer handler, can't do any IO in it.
|
||||
*/
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
|
||||
static void pwr_rpwm_timeout_handler(void *FunctionContext)
|
||||
#else
|
||||
static void pwr_rpwm_timeout_handler(struct timer_list *t)
|
||||
#endif
|
||||
{
|
||||
PADAPTER padapter;
|
||||
struct pwrctrl_priv *pwrpriv;
|
||||
|
||||
|
||||
padapter = (PADAPTER)FunctionContext;
|
||||
pwrpriv = adapter_to_pwrctl(padapter);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
|
||||
PADAPTER padapter = (PADAPTER)FunctionContext;
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
#else
|
||||
struct pwrctrl_priv *pwrpriv = from_timer(pwrpriv, t, pwr_rpwm_timer);
|
||||
#endif
|
||||
RTW_INFO("+%s: rpwm=0x%02X cpwm=0x%02X\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm);
|
||||
|
||||
if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2)) {
|
||||
@@ -1934,7 +1946,7 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter)
|
||||
pwrctrlpriv->smart_ps = padapter->registrypriv.smart_ps;
|
||||
pwrctrlpriv->bcn_ant_mode = 0;
|
||||
pwrctrlpriv->dtim = 0;
|
||||
|
||||
pwrctrlpriv->padapter = padapter;
|
||||
pwrctrlpriv->tog = 0x80;
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
@@ -1945,11 +1957,21 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter)
|
||||
#ifdef CONFIG_LPS_RPWM_TIMER
|
||||
pwrctrlpriv->brpwmtimeout = _FALSE;
|
||||
_init_workitem(&pwrctrlpriv->rpwmtimeoutwi, rpwmtimeout_workitem_callback, NULL);
|
||||
_init_timer(&pwrctrlpriv->pwr_rpwm_timer, padapter->pnetdev, pwr_rpwm_timeout_handler, padapter);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
|
||||
_init_timer(&pwrctrlpriv->pwr_rpwm_timer, padapter->pnetdev,
|
||||
pwr_rpwm_timeout_handler, padapter);
|
||||
#else
|
||||
timer_setup(&pwrctrlpriv->pwr_rpwm_timer, pwr_rpwm_timeout_handler, 0);
|
||||
#endif
|
||||
#endif /* CONFIG_LPS_RPWM_TIMER */
|
||||
#endif /* CONFIG_LPS_LCLK */
|
||||
|
||||
rtw_init_timer(&pwrctrlpriv->pwr_state_check_timer, padapter, pwr_state_check_handler);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
|
||||
rtw_init_timer(&pwrctrlpriv->pwr_state_check_timer, padapter,
|
||||
pwr_state_check_handler);
|
||||
#else
|
||||
timer_setup(&pwrctrlpriv->pwr_state_check_timer, pwr_state_check_handler, 0);
|
||||
#endif
|
||||
|
||||
pwrctrlpriv->wowlan_mode = _FALSE;
|
||||
pwrctrlpriv->wowlan_ap_mode = _FALSE;
|
||||
|
||||
@@ -23,7 +23,11 @@
|
||||
#include <hal_data.h>
|
||||
|
||||
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0))
|
||||
void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS);
|
||||
#else
|
||||
void rtw_signal_stat_timer_hdl(struct timer_list *t);
|
||||
#endif
|
||||
|
||||
enum {
|
||||
SIGNAL_STAT_CALC_PROFILE_0 = 0,
|
||||
@@ -132,8 +136,11 @@ 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))
|
||||
rtw_init_timer(&precvpriv->signal_stat_timer, padapter, RTW_TIMER_HDL_NAME(signal_stat));
|
||||
|
||||
#else
|
||||
timer_setup(&precvpriv->signal_stat_timer, rtw_signal_stat_timer_hdl, 0);
|
||||
#endif
|
||||
precvpriv->signal_stat_sampling_interval = 2000; /* ms */
|
||||
/* precvpriv->signal_stat_converging_constant = 5000; */ /* ms */
|
||||
|
||||
@@ -4184,9 +4191,17 @@ _recv_entry_drop:
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0))
|
||||
void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS)
|
||||
#else
|
||||
void rtw_signal_stat_timer_hdl(struct timer_list *t)
|
||||
#endif
|
||||
{
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0))
|
||||
_adapter *adapter = (_adapter *)FunctionContext;
|
||||
#else
|
||||
_adapter *adapter = from_timer(adapter, t, recvpriv.signal_stat_timer);
|
||||
#endif
|
||||
struct recv_priv *recvpriv = &adapter->recvpriv;
|
||||
|
||||
u32 tmp_s, tmp_q;
|
||||
|
||||
Reference in New Issue
Block a user