Commit efb8bc86 authored by Larry Finger's avatar Larry Finger Committed by Greg Kroah-Hartman
Browse files

staging: r8188eu: Remove tests of kernel version



In the GitHub repository from which this driver was derived, old kernels
had to be supported. Now that the driver is included in the kernel,
this code can be removed as well as all mention of version.h.

Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210729170930.23171-3-Larry.Finger@lwfinger.net


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9a730283
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -9,17 +9,9 @@
/*		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(struct timer_list *t)
#else
void BlinkTimerCallback(void *data)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
	struct LED_871x *pLed = from_timer(pLed, t, BlinkTimer);
#else
	struct LED_871x *pLed = (struct LED_871x *)data;
#endif
	struct adapter *padapter = pLed->padapter;

	if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped))
@@ -69,11 +61,7 @@ void InitLed871x(struct adapter *padapter, struct LED_871x *pLed, enum LED_PIN_8

	ResetLedStatus(pLed);

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
	timer_setup(&pLed->BlinkTimer, BlinkTimerCallback, 0);
#else
	_init_timer(&(pLed->BlinkTimer), padapter->pnetdev, BlinkTimerCallback, pLed);
#endif
	_init_workitem(&(pLed->BlinkWorkItem), BlinkWorkItemCallback, pLed);
}

+0 −53
Original line number Diff line number Diff line
@@ -1728,17 +1728,9 @@ u8 p2p_ps_wk_cmd(struct adapter *padapter, u8 p2p_ps_state, u8 enqueue)
	return res;
}

#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)
	struct adapter *adapter = from_timer(adapter, t, pwrctrlpriv.pwr_state_check_timer);
#else
	struct adapter *adapter = (struct adapter *)FunctionContext;
#endif
	struct	wifidirect_info		*pwdinfo = &adapter->wdinfo;

	if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
@@ -1750,17 +1742,9 @@ 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 (struct timer_list *t)
#else
static void reset_ch_sitesurvey_timer_process2 (void *FunctionContext)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
	struct adapter *adapter = from_timer(adapter, t, pwrctrlpriv.pwr_state_check_timer);
#else
	struct adapter *adapter = (struct adapter *)FunctionContext;
#endif
	struct	wifidirect_info		*pwdinfo = &adapter->wdinfo;

	if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
@@ -1772,17 +1756,9 @@ 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(struct timer_list *t)
#else
static void restore_p2p_state_timer_process (void *FunctionContext)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
	struct adapter *adapter = from_timer(adapter, t, wdinfo.restore_p2p_state_timer);
#else
	struct adapter *adapter = (struct adapter *)FunctionContext;
#endif
	struct	wifidirect_info		*pwdinfo = &adapter->wdinfo;

	if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
@@ -1791,17 +1767,9 @@ 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
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
	struct adapter *adapter = from_timer(adapter, t, wdinfo.pre_tx_scan_timer);
#else
	struct adapter *adapter = (struct adapter *)FunctionContext;
#endif
	struct	wifidirect_info *pwdinfo = &adapter->wdinfo;
	struct mlme_priv *pmlmepriv = &adapter->mlmepriv;

@@ -1829,17 +1797,9 @@ 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(struct timer_list *t)
#else
static void find_phase_timer_process(void *FunctionContext)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
	struct adapter *adapter = from_timer(adapter, t, wdinfo.find_phase_timer);
#else
	struct adapter *adapter = (struct adapter *)FunctionContext;
#endif
	struct	wifidirect_info		*pwdinfo = &adapter->wdinfo;

	if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
@@ -1865,19 +1825,11 @@ void rtw_init_wifidirect_timers(struct adapter *padapter)
{
	struct wifidirect_info *pwdinfo = &padapter->wdinfo;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
	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);
#else
	_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);
#endif
}

void rtw_init_wifidirect_addrs(struct adapter *padapter, u8 *dev_addr, u8 *iface_addr)
@@ -2019,11 +1971,6 @@ 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)
#else
			reset_ch_sitesurvey_timer_process(padapter);
			reset_ch_sitesurvey_timer_process2(padapter);
#endif
			rtw_p2p_set_state(pwdinfo, P2P_STATE_NONE);
			rtw_p2p_set_role(pwdinfo, P2P_ROLE_DISABLE);
			memset(&pwdinfo->rx_prov_disc_info, 0x00, sizeof(struct rx_provdisc_req_info));
+0 −12
Original line number Diff line number Diff line
@@ -192,19 +192,11 @@ void rtw_ps_processor(struct adapter *padapter)
	return;
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
static void pwr_state_check_handler(struct timer_list *t)
#else
static void pwr_state_check_handler(void *FunctionContext)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
	struct adapter *padapter =
		from_timer(padapter, t,
			   pwrctrlpriv.pwr_state_check_timer);
#else
	struct adapter *padapter = (struct adapter *)FunctionContext;
#endif
	rtw_ps_cmd(padapter);
}

@@ -492,11 +484,7 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter)

	pwrctrlpriv->btcoex_rfon = false;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
	timer_setup(&pwrctrlpriv->pwr_state_check_timer, pwr_state_check_handler, 0);
#else
	_init_timer(&(pwrctrlpriv->pwr_state_check_timer), padapter->pnetdev, pwr_state_check_handler, (u8 *)padapter);
#endif
}

void rtw_free_pwrctrl_priv(struct adapter *adapter)
+0 −16
Original line number Diff line number Diff line
@@ -25,11 +25,7 @@ static u8 rtw_rfc1042_header[] = {
       0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00
};

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
void rtw_signal_stat_timer_hdl(struct timer_list *);
#else
void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS);
#endif

void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv)
{
@@ -91,11 +87,7 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter)

	res = rtw_hal_init_recv_priv(padapter);

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
	timer_setup(&precvpriv->signal_stat_timer, rtw_signal_stat_timer_hdl, 0);
#else
	_init_timer(&precvpriv->signal_stat_timer, padapter->pnetdev, RTW_TIMER_HDL_NAME(signal_stat), padapter);
#endif
	precvpriv->signal_stat_sampling_interval = 1000; /* ms */

	rtw_set_signal_stat_timer(precvpriv);
@@ -2174,17 +2166,9 @@ s32 rtw_recv_entry(struct recv_frame *precvframe)
	return ret;
}

#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
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
	struct adapter *adapter = from_timer(adapter, t, recvpriv.signal_stat_timer);
#else
	struct adapter *adapter = (struct adapter *)FunctionContext;
#endif
	struct recv_priv *recvpriv = &adapter->recvpriv;

	u32 tmp_s, tmp_q;
+0 −8
Original line number Diff line number Diff line
@@ -1671,11 +1671,7 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
	void *br_port = NULL;

	rcu_read_lock();
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
	br_port = rcu_dereference(padapter->pnetdev->rx_handler_data);
#else
	br_port = rcu_dereference(padapter->pnetdev->br_port);
#endif
	rcu_read_unlock();
	spin_lock_bh(&padapter->br_ext_lock);
	if (!(skb->data[0] & 1) && br_port &&
@@ -1859,11 +1855,7 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)
	}

	rcu_read_lock();
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
	br_port = rcu_dereference(padapter->pnetdev->rx_handler_data);
#else
	br_port = rcu_dereference(padapter->pnetdev->br_port);
#endif
	rcu_read_unlock();

	if (br_port && check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE)) {
Loading