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__); printk("###### %s ######\n", __FUNCTION__);
for (i =0;i< buf_len;i++) { for (i =0;i< buf_len;i++) {
printk("%02x-",*(pbuf+i)); printk("%02x-",*(pbuf+i));
if (j%32 == 0)
if (j%32 == 0) printk("\n");j++; printk("\n");
j++;
} }
printk("\n"); printk("\n");
printk("============= ioreg_cmd len = %d ===============\n", buf_len); printk("============= ioreg_cmd len = %d ===============\n", buf_len);

View file

@ -25,9 +25,17 @@
/* Callback function of LED BlinkTimer, */ /* Callback function of LED BlinkTimer, */
/* it just schedules to corresponding BlinkWorkItem/led_blink_hdl */ /* it just schedules to corresponding BlinkWorkItem/led_blink_hdl */
/* */ /* */
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void BlinkTimerCallback(void *data) 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; PLED_871x pLed = (PLED_871x)data;
#else
PLED_871x pLed = from_timer(pLed, t, BlinkTimer);
#endif
struct adapter *padapter = pLed->padapter; struct adapter *padapter = pLed->padapter;
/* DBG_88E("%s\n", __FUNCTION__); */ /* DBG_88E("%s\n", __FUNCTION__); */
@ -89,8 +97,11 @@ InitLed871x(
ResetLedStatus(pLed); ResetLedStatus(pLed);
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_init_timer(&(pLed->BlinkTimer), padapter->pnetdev, BlinkTimerCallback, pLed); _init_timer(&(pLed->BlinkTimer), padapter->pnetdev, BlinkTimerCallback, pLed);
#else
timer_setup(&pLed->BlinkTimer, BlinkTimerCallback, 0);
#endif
_init_workitem(&(pLed->BlinkWorkItem), BlinkWorkItemCallback, pLed); _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) 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; 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); struct rtw_wdev_priv *pwdev_priv = wdev_to_priv(adapter->rtw_wdev);
p2p_protocol_wk_cmd( adapter, P2P_RO_CH_WK); 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) ); 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 ); _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) void p2p_protocol_wk_hdl(struct adapter *padapter, int intCmdType)
@ -4014,9 +4026,17 @@ exit:
} }
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
static void reset_ch_sitesurvey_timer_process (void *FunctionContext) 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; 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; struct wifidirect_info *pwdinfo = &adapter->wdinfo;
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) 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; 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) 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; 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; struct wifidirect_info *pwdinfo = &adapter->wdinfo;
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) 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; 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) 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; 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; struct wifidirect_info *pwdinfo = &adapter->wdinfo;
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) 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 ); 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) static void pre_tx_scan_timer_process (void *FunctionContext)
#else
static void pre_tx_scan_timer_process(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct adapter *adapter = (struct adapter *) FunctionContext; 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; struct wifidirect_info *pwdinfo = &adapter->wdinfo;
unsigned long irqL; unsigned long irqL;
struct mlme_priv *pmlmepriv = &adapter->mlmepriv; struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
@ -4107,9 +4151,17 @@ static void pre_tx_scan_timer_process (void *FunctionContext)
spin_unlock_bh(&pmlmepriv->lock); spin_unlock_bh(&pmlmepriv->lock);
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
static void find_phase_timer_process (void *FunctionContext) 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; 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; struct wifidirect_info *pwdinfo = &adapter->wdinfo;
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) 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; 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->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->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->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_sitesurvey, padapter->pnetdev, reset_ch_sitesurvey_timer_process, padapter );
_init_timer( &pwdinfo->reset_ch_sitesurvey2, padapter->pnetdev, reset_ch_sitesurvey_timer_process2, 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) 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->pre_tx_scan_timer);
_cancel_timer_ex( &pwdinfo->reset_ch_sitesurvey); _cancel_timer_ex( &pwdinfo->reset_ch_sitesurvey);
_cancel_timer_ex( &pwdinfo->reset_ch_sitesurvey2); _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_process( padapter );
reset_ch_sitesurvey_timer_process2( 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_state(pwdinfo, P2P_STATE_NONE);
rtw_p2p_set_pre_state(pwdinfo, P2P_STATE_NONE); rtw_p2p_set_pre_state(pwdinfo, P2P_STATE_NONE);
rtw_p2p_set_role(pwdinfo, P2P_ROLE_DISABLE); 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; struct adapter *padapter = (struct adapter *)FunctionContext;
#else #else
struct dvobj_priv *dvobj = from_timer(dvobj, t, pwrctl_priv.pwr_state_check_timer); struct dvobj_priv *dvobj = from_timer(dvobj, t, pwrctl_priv.pwr_state_check_timer);
struct adapter *padapter = dvobj-> struct adapter *padapter = dvobj->if1;
#endif #endif
rtw_ps_cmd(padapter); rtw_ps_cmd(padapter);

View file

@ -36,7 +36,11 @@
#include <wifi.h> #include <wifi.h>
#include <circ_buf.h> #include <circ_buf.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS); 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) 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); _rtw_init_sema(&precvpriv->allrxreturnevt, 0);
res = rtw_hal_init_recv_priv(padapter); 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); _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 */ precvpriv->signal_stat_sampling_interval = 1000; /* ms */
@ -2836,8 +2844,17 @@ _recv_entry_drop:
return ret; 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; 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; struct recv_priv *recvpriv = &adapter->recvpriv;
u32 tmp_s, tmp_q; u32 tmp_s, tmp_q;

View file

@ -2766,8 +2766,10 @@ ODM_InitAllTimers(
PDM_ODM_T pDM_Odm PDM_ODM_T pDM_Odm
) )
{ {
#if 0
ODM_InitializeTimer(pDM_Odm,&pDM_Odm->DM_SWAT_Table.SwAntennaSwitchTimer, ODM_InitializeTimer(pDM_Odm,&pDM_Odm->DM_SWAT_Table.SwAntennaSwitchTimer,
(RT_TIMER_CALL_BACK)odm_SwAntDivChkAntSwitchCallback, NULL, "SwAntennaSwitchTimer"); (RT_TIMER_CALL_BACK)odm_SwAntDivChkAntSwitchCallback, NULL, "SwAntennaSwitchTimer");
#endif
} }
void void

View file

@ -312,6 +312,7 @@ ODM_SetTimer(
_set_timer(pTimer,msDelay ); /* ms */ _set_timer(pTimer,msDelay ); /* ms */
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void void
ODM_InitializeTimer( ODM_InitializeTimer(
PDM_ODM_T pDM_Odm, PDM_ODM_T pDM_Odm,
@ -324,6 +325,7 @@ ODM_InitializeTimer(
struct adapter *Adapter = pDM_Odm->Adapter; struct adapter *Adapter = pDM_Odm->Adapter;
_init_timer(pTimer,Adapter->pnetdev,CallBackFunc,pDM_Odm); _init_timer(pTimer,Adapter->pnetdev,CallBackFunc,pDM_Odm);
} }
#endif
void void
ODM_CancelTimer( ODM_CancelTimer(

View file

@ -177,7 +177,11 @@ struct led_priv{
(adapter)->ledpriv.LedControlHandler((adapter), (LedAction)); \ (adapter)->ledpriv.LedControlHandler((adapter), (LedAction)); \
} while (0) } while (0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void BlinkTimerCallback(void *data); void BlinkTimerCallback(void *data);
#else
void BlinkTimerCallback(struct timer_list *t);
#endif
void BlinkWorkItemCallback(struct work_struct *work); void BlinkWorkItemCallback(struct work_struct *work);
void ResetLedStatus(PLED_871x pLed); void ResetLedStatus(PLED_871x pLed);

View file

@ -534,8 +534,13 @@ void rtw_atimdone_event_callback(struct adapter *adapter, u8 *pbuf);
void rtw_cpwm_event_callback(struct adapter *adapter, u8 *pbuf); void rtw_cpwm_event_callback(struct adapter *adapter, u8 *pbuf);
int event_thread(void *context); int event_thread(void *context);
void rtw_join_timeout_handler(void* FunctionContext); #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void _rtw_scan_timeout_handler (void *FunctionContext); void _rtw_scan_timeout_handler (void *FunctionContext);
void rtw_join_timeout_handler(void* FunctionContext);
#else
void _rtw_scan_timeout_handler(struct timer_list *t);
void rtw_join_timeout_handler(struct timer_list *t);
#endif
void rtw_free_network_queue(struct adapter *adapter,u8 isfreeall); void rtw_free_network_queue(struct adapter *adapter,u8 isfreeall);
int rtw_init_mlme_priv(struct adapter *adapter);/* (struct mlme_priv *pmlmepriv); */ int rtw_init_mlme_priv(struct adapter *adapter);/* (struct mlme_priv *pmlmepriv); */

View file

@ -674,6 +674,9 @@ check_bss:
struct ieee80211_channel *notify_channel; struct ieee80211_channel *notify_channel;
u32 freq; u32 freq;
u16 channel = cur_network->network.Configuration.DSConfig; u16 channel = cur_network->network.Configuration.DSConfig;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
struct cfg80211_roam_info roam_info = {};
#endif
if (channel <= RTW_CH_MAX_2G_CHANNEL) if (channel <= RTW_CH_MAX_2G_CHANNEL)
freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ); freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ);
@ -684,6 +687,19 @@ check_bss:
#endif #endif
DBG_88E(FUNC_ADPT_FMT" call cfg80211_roamed\n", FUNC_ADPT_ARG(padapter)); DBG_88E(FUNC_ADPT_FMT" call cfg80211_roamed\n", FUNC_ADPT_ARG(padapter));
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
roam_info.channel = notify_channel;
roam_info.bssid = cur_network->network.MacAddress;
roam_info.req_ie =
pmlmepriv->assoc_req+sizeof(struct rtw_ieee80211_hdr_3addr)+2;
roam_info.req_ie_len =
pmlmepriv->assoc_req_len-sizeof(struct rtw_ieee80211_hdr_3addr)-2;
roam_info.resp_ie =
pmlmepriv->assoc_rsp+sizeof(struct rtw_ieee80211_hdr_3addr)+6;
roam_info.resp_ie_len =
pmlmepriv->assoc_rsp_len-sizeof(struct rtw_ieee80211_hdr_3addr)-6;
cfg80211_roamed(padapter->pnetdev, &roam_info, GFP_ATOMIC);
#else
cfg80211_roamed(padapter->pnetdev cfg80211_roamed(padapter->pnetdev
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) || defined(COMPAT_KERNEL_RELEASE) #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) || defined(COMPAT_KERNEL_RELEASE)
, notify_channel , notify_channel
@ -694,6 +710,7 @@ check_bss:
, pmlmepriv->assoc_rsp+sizeof(struct rtw_ieee80211_hdr_3addr)+6 , pmlmepriv->assoc_rsp+sizeof(struct rtw_ieee80211_hdr_3addr)+6
, pmlmepriv->assoc_rsp_len-sizeof(struct rtw_ieee80211_hdr_3addr)-6 , pmlmepriv->assoc_rsp_len-sizeof(struct rtw_ieee80211_hdr_3addr)-6
, GFP_ATOMIC); , GFP_ATOMIC);
#endif
} else { } else {
cfg80211_connect_result(padapter->pnetdev, cur_network->network.MacAddress cfg80211_connect_result(padapter->pnetdev, cur_network->network.MacAddress
, pmlmepriv->assoc_req+sizeof(struct rtw_ieee80211_hdr_3addr)+2 , pmlmepriv->assoc_req+sizeof(struct rtw_ieee80211_hdr_3addr)+2
@ -1643,7 +1660,11 @@ extern int netdev_open(struct net_device *pnetdev);
static int cfg80211_rtw_change_iface(struct wiphy *wiphy, static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
struct net_device *ndev, struct net_device *ndev,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0))
enum nl80211_iftype type, u32 *flags, enum nl80211_iftype type, u32 *flags,
#else
enum nl80211_iftype type,
#endif
struct vif_params *params) struct vif_params *params)
{ {
enum nl80211_iftype old_type; enum nl80211_iftype old_type;
@ -3189,7 +3210,12 @@ static int rtw_cfg80211_add_monitor_if (struct adapter *padapter, char *name, st
mon_ndev->type = ARPHRD_IEEE80211_RADIOTAP; mon_ndev->type = ARPHRD_IEEE80211_RADIOTAP;
strncpy(mon_ndev->name, name, IFNAMSIZ); strncpy(mon_ndev->name, name, IFNAMSIZ);
mon_ndev->name[IFNAMSIZ - 1] = 0; mon_ndev->name[IFNAMSIZ - 1] = 0;
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(4,11,9))
mon_ndev->needs_free_netdev = false;
mon_ndev->priv_destructor = rtw_ndev_destructor;
#else
mon_ndev->destructor = rtw_ndev_destructor; mon_ndev->destructor = rtw_ndev_destructor;
#endif
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29)) #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
mon_ndev->netdev_ops = &rtw_cfg80211_monitor_if_ops; mon_ndev->netdev_ops = &rtw_cfg80211_monitor_if_ops;
@ -3256,7 +3282,11 @@ static int
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
unsigned char name_assign_type, unsigned char name_assign_type,
#endif #endif
enum nl80211_iftype type, u32 *flags, struct vif_params *params) enum nl80211_iftype type,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0))
u32 *flags,
#endif
struct vif_params *params)
{ {
int ret = 0; int ret = 0;
struct net_device* ndev = NULL; struct net_device* ndev = NULL;

View file

@ -26,31 +26,63 @@
#include <drv_types.h> #include <drv_types.h>
#include <mlme_osdep.h> #include <mlme_osdep.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void rtw_join_timeout_handler (void *FunctionContext) void rtw_join_timeout_handler (void *FunctionContext)
#else
void rtw_join_timeout_handler(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct adapter *adapter = (struct adapter *)FunctionContext; struct adapter *adapter = (struct adapter *)FunctionContext;
#else
struct adapter *adapter = from_timer(adapter, t, mlmepriv.assoc_timer);
#endif
_rtw_join_timeout_handler(adapter); _rtw_join_timeout_handler(adapter);
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void _rtw_scan_timeout_handler (void *FunctionContext) void _rtw_scan_timeout_handler (void *FunctionContext)
#else
void _rtw_scan_timeout_handler(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct adapter *adapter = (struct adapter *)FunctionContext; struct adapter *adapter = (struct adapter *)FunctionContext;
#else
struct adapter *adapter = from_timer(adapter, t, mlmepriv.scan_to_timer);
#endif
rtw_scan_timeout_handler(adapter); rtw_scan_timeout_handler(adapter);
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
static void _dynamic_check_timer_handlder (void *FunctionContext) static void _dynamic_check_timer_handlder (void *FunctionContext)
#else
static void _dynamic_check_timer_handlder(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct adapter *adapter = (struct adapter *)FunctionContext; struct adapter *adapter = (struct adapter *)FunctionContext;
#else
struct adapter *adapter = from_timer(adapter, t, mlmepriv.dynamic_chk_timer);
#endif
rtw_dynamic_check_timer_handlder(adapter); rtw_dynamic_check_timer_handlder(adapter);
_set_timer(&adapter->mlmepriv.dynamic_chk_timer, 2000); _set_timer(&adapter->mlmepriv.dynamic_chk_timer, 2000);
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
static void _rtw_set_scan_deny_timer_hdl(void *FunctionContext) static void _rtw_set_scan_deny_timer_hdl(void *FunctionContext)
#else
static void _rtw_set_scan_deny_timer_hdl(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct adapter *adapter = (struct adapter *)FunctionContext; struct adapter *adapter = (struct adapter *)FunctionContext;
#else
struct adapter *adapter = from_timer(adapter, t, mlmepriv.set_scan_deny_timer);
#endif
rtw_set_scan_deny_timer_hdl(adapter); rtw_set_scan_deny_timer_hdl(adapter);
} }
@ -58,12 +90,19 @@ void rtw_init_mlme_timer(struct adapter *padapter)
{ {
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_init_timer(&(pmlmepriv->assoc_timer), padapter->pnetdev, rtw_join_timeout_handler, padapter); _init_timer(&(pmlmepriv->assoc_timer), padapter->pnetdev, rtw_join_timeout_handler, padapter);
_init_timer(&(pmlmepriv->scan_to_timer), padapter->pnetdev, _rtw_scan_timeout_handler, padapter); _init_timer(&(pmlmepriv->scan_to_timer), padapter->pnetdev, _rtw_scan_timeout_handler, padapter);
_init_timer(&(pmlmepriv->dynamic_chk_timer), padapter->pnetdev, _dynamic_check_timer_handlder, padapter); _init_timer(&(pmlmepriv->dynamic_chk_timer), padapter->pnetdev, _dynamic_check_timer_handlder, padapter);
_init_timer(&(pmlmepriv->set_scan_deny_timer), padapter->pnetdev, _rtw_set_scan_deny_timer_hdl, padapter); _init_timer(&(pmlmepriv->set_scan_deny_timer), padapter->pnetdev, _rtw_set_scan_deny_timer_hdl, padapter);
#else
timer_setup(&pmlmepriv->assoc_timer, rtw_join_timeout_handler, 0);
timer_setup(&pmlmepriv->scan_to_timer, _rtw_scan_timeout_handler, 0);
timer_setup(&pmlmepriv->dynamic_chk_timer, _dynamic_check_timer_handlder, 0);
timer_setup(&pmlmepriv->set_scan_deny_timer, _rtw_set_scan_deny_timer_hdl, 0);
#endif
#if defined(CONFIG_CHECK_BT_HANG) && defined(CONFIG_BT_COEXIST) #if defined(CONFIG_CHECK_BT_HANG) && defined(CONFIG_BT_COEXIST)
if (padapter->HalFunc.hal_init_checkbthang_workqueue) if (padapter->HalFunc.hal_init_checkbthang_workqueue)
@ -211,22 +250,46 @@ void rtw_report_sec_ie(struct adapter *adapter,u8 authmode,u8 *sec_ie)
} }
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
static void _survey_timer_hdl (void *FunctionContext) static void _survey_timer_hdl (void *FunctionContext)
#else
static void _survey_timer_hdl(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct adapter *padapter = (struct adapter *)FunctionContext; struct adapter *padapter = (struct adapter *)FunctionContext;
#else
struct adapter *padapter = from_timer(padapter, t, mlmeextpriv.survey_timer);
#endif
survey_timer_hdl(padapter); survey_timer_hdl(padapter);
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
static void _link_timer_hdl (void *FunctionContext) static void _link_timer_hdl (void *FunctionContext)
#else
static void _link_timer_hdl(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct adapter *padapter = (struct adapter *)FunctionContext; struct adapter *padapter = (struct adapter *)FunctionContext;
#else
struct adapter *padapter = from_timer(padapter, t, mlmeextpriv.link_timer);
#endif
link_timer_hdl(padapter); link_timer_hdl(padapter);
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
static void _addba_timer_hdl(void *FunctionContext) static void _addba_timer_hdl(void *FunctionContext)
#else
static void _addba_timer_hdl(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct sta_info *psta = (struct sta_info *)FunctionContext; struct sta_info *psta = (struct sta_info *)FunctionContext;
#else
struct sta_info *psta = from_timer(psta, t, addba_retry_timer);
#endif
addba_timer_hdl(psta); addba_timer_hdl(psta);
} }
@ -241,18 +304,30 @@ void _sa_query_timer_hdl (void *FunctionContext)
void init_addba_retry_timer(struct adapter *padapter, struct sta_info *psta) void init_addba_retry_timer(struct adapter *padapter, struct sta_info *psta)
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_init_timer(&psta->addba_retry_timer, padapter->pnetdev, _addba_timer_hdl, psta); _init_timer(&psta->addba_retry_timer, padapter->pnetdev, _addba_timer_hdl, psta);
#else
timer_setup(&psta->addba_retry_timer, _addba_timer_hdl, 0);
#endif
} }
void init_mlme_ext_timer(struct adapter *padapter) void init_mlme_ext_timer(struct adapter *padapter)
{ {
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_init_timer(&pmlmeext->survey_timer, padapter->pnetdev, _survey_timer_hdl, padapter); _init_timer(&pmlmeext->survey_timer, padapter->pnetdev, _survey_timer_hdl, padapter);
_init_timer(&pmlmeext->link_timer, padapter->pnetdev, _link_timer_hdl, padapter); _init_timer(&pmlmeext->link_timer, padapter->pnetdev, _link_timer_hdl, padapter);
#ifdef CONFIG_IEEE80211W #ifdef CONFIG_IEEE80211W
_init_timer(&pmlmeext->sa_query_timer, padapter->pnetdev, _sa_query_timer_hdl, padapter); _init_timer(&pmlmeext->sa_query_timer, padapter->pnetdev, _sa_query_timer_hdl, padapter);
#endif /* CONFIG_IEEE80211W */ #endif /* CONFIG_IEEE80211W */
#else
timer_setup(&pmlmeext->survey_timer, _survey_timer_hdl, 0);
timer_setup(&pmlmeext->link_timer, _link_timer_hdl, 0);
#ifdef CONFIG_IEEE80211W
timer_setup(&pmlmeext->sa_query_timer, _sa_query_timer_hdl, 0);
#endif /* CONFIG_IEEE80211W */
#endif
} }
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE

View file

@ -396,16 +396,29 @@ void rtw_os_read_port(struct adapter *padapter, struct recv_buf *precvbuf)
} }
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
static void _rtw_reordering_ctrl_timeout_handler (void *FunctionContext) static void _rtw_reordering_ctrl_timeout_handler (void *FunctionContext)
#else
static void _rtw_reordering_ctrl_timeout_handler(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct recv_reorder_ctrl *preorder_ctrl = (struct recv_reorder_ctrl *)FunctionContext; struct recv_reorder_ctrl *preorder_ctrl = (struct recv_reorder_ctrl *)FunctionContext;
#else
struct recv_reorder_ctrl *preorder_ctrl = from_timer(preorder_ctrl, t, reordering_ctrl_timer);
#endif
rtw_reordering_ctrl_timeout_handler(preorder_ctrl); rtw_reordering_ctrl_timeout_handler(preorder_ctrl);
} }
void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl) void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl)
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct adapter *padapter = preorder_ctrl->padapter; struct adapter *padapter = preorder_ctrl->padapter;
_init_timer(&(preorder_ctrl->reordering_ctrl_timer), padapter->pnetdev, _rtw_reordering_ctrl_timeout_handler, preorder_ctrl); _init_timer(&(preorder_ctrl->reordering_ctrl_timer), padapter->pnetdev, _rtw_reordering_ctrl_timeout_handler, preorder_ctrl);
#else
timer_setup(&preorder_ctrl->reordering_ctrl_timer, _rtw_reordering_ctrl_timeout_handler, 0);
#endif
} }