rtl8188eu: Fix builds for branch v4.1.8_9499 for newer kernels

These changes allow builds up through kernel 4.16.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2018-04-11 10:19:48 -05:00
parent 10737c73b1
commit 594a5a050d
13 changed files with 235 additions and 10 deletions

View file

@ -235,8 +235,9 @@ void rtw_IOL_cmd_buf_dump(struct adapter *Adapter, int buf_len, u8 *pbuf)
printk("###### %s ######\n", __FUNCTION__);
for (i =0;i< buf_len;i++) {
printk("%02x-",*(pbuf+i));
if (j%32 == 0) printk("\n");j++;
if (j%32 == 0)
printk("\n");
j++;
}
printk("\n");
printk("============= ioreg_cmd len = %d ===============\n", buf_len);

View file

@ -25,9 +25,17 @@
/* 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(void *data)
#else
void BlinkTimerCallback(struct timer_list *t)
#endif
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
PLED_871x pLed = (PLED_871x)data;
#else
PLED_871x pLed = from_timer(pLed, t, BlinkTimer);
#endif
struct adapter *padapter = pLed->padapter;
/* DBG_88E("%s\n", __FUNCTION__); */
@ -89,8 +97,11 @@ InitLed871x(
ResetLedStatus(pLed);
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_init_timer(&(pLed->BlinkTimer), padapter->pnetdev, BlinkTimerCallback, pLed);
#else
timer_setup(&pLed->BlinkTimer, BlinkTimerCallback, 0);
#endif
_init_workitem(&(pLed->BlinkWorkItem), BlinkWorkItemCallback, pLed);
}

View file

@ -3203,9 +3203,17 @@ static void ro_ch_handler(struct adapter *padapter)
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
static void ro_ch_timer_process (void *FunctionContext)
#else
static void ro_ch_timer_process(struct timer_list *t)
#endif
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct adapter *adapter = (struct adapter *)FunctionContext;
#else
struct adapter *adapter = from_timer(adapter, t, cfg80211_wdinfo.remain_on_ch_timer);
#endif
struct rtw_wdev_priv *pwdev_priv = wdev_to_priv(adapter->rtw_wdev);
p2p_protocol_wk_cmd( adapter, P2P_RO_CH_WK);
@ -3771,7 +3779,11 @@ void rtw_init_cfg80211_wifidirect_info( struct adapter* padapter)
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
}
void p2p_protocol_wk_hdl(struct adapter *padapter, int intCmdType)
@ -4014,9 +4026,17 @@ exit:
}
#endif /* CONFIG_P2P */
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
static void reset_ch_sitesurvey_timer_process (void *FunctionContext)
#else
static void reset_ch_sitesurvey_timer_process(struct timer_list *t)
#endif
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct adapter *adapter = (struct adapter *)FunctionContext;
#else
struct adapter *adapter = from_timer(adapter, t, wdinfo.reset_ch_sitesurvey);
#endif
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
@ -4033,9 +4053,17 @@ 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 (void *FunctionContext)
#else
static void reset_ch_sitesurvey_timer_process2(struct timer_list *t)
#endif
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct adapter *adapter = (struct adapter *)FunctionContext;
#else
struct adapter *adapter = from_timer(adapter, t, wdinfo.reset_ch_sitesurvey2);
#endif
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
@ -4052,9 +4080,17 @@ 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 (void *FunctionContext)
#else
static void restore_p2p_state_timer_process(struct timer_list *t)
#endif
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct adapter *adapter = (struct adapter *)FunctionContext;
#else
struct adapter *adapter = from_timer(adapter, t, wdinfo.restore_p2p_state_timer);
#endif
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
@ -4063,9 +4099,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 (void *FunctionContext)
#else
static void pre_tx_scan_timer_process(struct timer_list *t)
#endif
{
struct adapter *adapter = (struct adapter *) FunctionContext;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct adapter *adapter = (struct adapter *) FunctionContext;
#else
struct adapter *adapter = from_timer(adapter, t, wdinfo.pre_tx_scan_timer);
#endif
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
unsigned long irqL;
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
@ -4107,9 +4151,17 @@ static void pre_tx_scan_timer_process (void *FunctionContext)
spin_unlock_bh(&pmlmepriv->lock);
}
#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)
struct adapter *adapter = (struct adapter *)FunctionContext;
#else
struct 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))
@ -4160,11 +4212,19 @@ void rtw_init_wifidirect_timers(struct 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 );
_init_timer( &pwdinfo->reset_ch_sitesurvey, padapter->pnetdev, reset_ch_sitesurvey_timer_process, padapter );
_init_timer( &pwdinfo->reset_ch_sitesurvey2, padapter->pnetdev, reset_ch_sitesurvey_timer_process2, padapter );
#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);
#endif
}
void rtw_init_wifidirect_addrs(struct adapter* padapter, u8 *dev_addr, u8 *iface_addr)
@ -4473,8 +4533,13 @@ int rtw_p2p_enable(struct 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( padapter );
reset_ch_sitesurvey_timer_process2( padapter );
#else
reset_ch_sitesurvey_timer_process(&padapter->wdinfo.reset_ch_sitesurvey);
reset_ch_sitesurvey_timer_process(&padapter->wdinfo.reset_ch_sitesurvey2);
#endif
rtw_p2p_set_state(pwdinfo, P2P_STATE_NONE);
rtw_p2p_set_pre_state(pwdinfo, P2P_STATE_NONE);
rtw_p2p_set_role(pwdinfo, P2P_ROLE_DISABLE);

View file

@ -319,7 +319,7 @@ void pwr_state_check_handler(struct timer_list *t)
struct adapter *padapter = (struct adapter *)FunctionContext;
#else
struct dvobj_priv *dvobj = from_timer(dvobj, t, pwrctl_priv.pwr_state_check_timer);
struct adapter *padapter = dvobj->
struct adapter *padapter = dvobj->if1;
#endif
rtw_ps_cmd(padapter);

View file

@ -36,7 +36,11 @@
#include <wifi.h>
#include <circ_buf.h>
#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
void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv)
{
@ -111,7 +115,11 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter)
_rtw_init_sema(&precvpriv->allrxreturnevt, 0);
res = rtw_hal_init_recv_priv(padapter);
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_init_timer(&precvpriv->signal_stat_timer, padapter->pnetdev, RTW_TIMER_HDL_NAME(signal_stat), padapter);
#else
timer_setup(&precvpriv->signal_stat_timer, RTW_TIMER_HDL_NAME(signal_stat), 0);
#endif
precvpriv->signal_stat_sampling_interval = 1000; /* ms */
@ -2836,8 +2844,17 @@ _recv_entry_drop:
return ret;
}
void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS) {
#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)
struct adapter *adapter = (struct adapter *)FunctionContext;
#else
struct adapter *adapter = from_timer(adapter, t, recvpriv.signal_stat_timer);
#endif
struct recv_priv *recvpriv = &adapter->recvpriv;
u32 tmp_s, tmp_q;