Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed737494 authored by Rémy Oudompheng's avatar Rémy Oudompheng Committed by Greg Kroah-Hartman
Browse files

staging: rtl8188eu: jiffies are unsigned long



Remove rtw_get_passing_time_ms function and adjust type
of relevant variables.

Signed-off-by: default avatarRémy Oudompheng <remyoudompheng@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f7ec22b5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ static void efuse_read_phymap_from_txpktbuf(
	)
{
	u16 dbg_addr = 0;
	u32 start  = 0, passing_time = 0;
	unsigned long start = 0;
	u8 reg_0x143 = 0;
	u32 lo32 = 0, hi32 = 0;
	u16 len = 0, count = 0;
@@ -248,7 +248,7 @@ static void efuse_read_phymap_from_txpktbuf(
		usb_write8(adapter, REG_TXPKTBUF_DBG, 0);
		start = jiffies;
		while (!(reg_0x143 = usb_read8(adapter, REG_TXPKTBUF_DBG)) &&
		       (passing_time = rtw_get_passing_time_ms(start)) < 1000) {
		       jiffies_to_msecs(jiffies - start) < 1000) {
			DBG_88E("%s polling reg_0x143:0x%02x, reg_0x106:0x%02x\n", __func__, reg_0x143, usb_read8(adapter, 0x106));
			usleep_range(1000, 2000);
		}
+8 −5
Original line number Diff line number Diff line
@@ -163,7 +163,8 @@ struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv)/* _queue *f

static void _rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork, u8 isfreeall)
{
	u32 curr_time, delta_time;
	unsigned long curr_time;
	u32 delta_time;
	u32 lifetime = SCANQUEUE_LIFETIME;
	struct __queue *free_queue = &(pmlmepriv->free_bss_pool);

@@ -272,7 +273,7 @@ int rtw_if_up(struct adapter *padapter)

void rtw_generate_random_ibss(u8 *pibss)
{
	u32	curtime = jiffies;
	unsigned long curtime = jiffies;

	pibss[0] = 0x02;  /* in ad-hoc mode bit1 must set to 1 */
	pibss[1] = 0x11;
@@ -878,14 +879,14 @@ inline void rtw_indicate_scan_done(struct adapter *padapter, bool aborted)

void rtw_scan_abort(struct adapter *adapter)
{
	u32 start;
	unsigned long start;
	struct mlme_priv	*pmlmepriv = &(adapter->mlmepriv);
	struct mlme_ext_priv	*pmlmeext = &(adapter->mlmeextpriv);

	start = jiffies;
	pmlmeext->scan_abort = true;
	while (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) &&
	       rtw_get_passing_time_ms(start) <= 200) {
	       jiffies_to_msecs(jiffies - start) <= 200) {
		if (adapter->bDriverStopped || adapter->bSurpriseRemoved)
			break;
		DBG_88E(FUNC_NDEV_FMT"fw_state=_FW_UNDER_SURVEY!\n", FUNC_NDEV_ARG(adapter->pnetdev));
@@ -1474,6 +1475,7 @@ static int rtw_check_join_candidate(struct mlme_priv *pmlmepriv
	, struct wlan_network **candidate, struct wlan_network *competitor)
{
	int updated = false;
	unsigned long since_scan;
	struct adapter *adapter = container_of(pmlmepriv, struct adapter, mlmepriv);


@@ -1494,7 +1496,8 @@ static int rtw_check_join_candidate(struct mlme_priv *pmlmepriv
		goto exit;

	if (pmlmepriv->to_roaming) {
		if (rtw_get_passing_time_ms((u32)competitor->last_scanned) >= RTW_SCAN_RESULT_EXPIRE ||
		since_scan = jiffies - competitor->last_scanned;
		if (jiffies_to_msecs(since_scan) >= RTW_SCAN_RESULT_EXPIRE ||
		    is_same_ess(&competitor->network, &pmlmepriv->cur_network.network) == false)
			goto exit;
	}
+27 −16
Original line number Diff line number Diff line
@@ -708,7 +708,7 @@ static int issue_probereq_ex(struct adapter *padapter,
{
	int ret;
	int i = 0;
	u32 start = jiffies;
	unsigned long start = jiffies;

	do {
		ret = issue_probereq(padapter, pssid, da, wait_ms > 0 ? true : false);
@@ -732,11 +732,13 @@ static int issue_probereq_ex(struct adapter *padapter,
		if (da)
			DBG_88E(FUNC_ADPT_FMT" to %pM, ch:%u%s, %d/%d in %u ms\n",
				FUNC_ADPT_ARG(padapter), da, rtw_get_oper_ch(padapter),
				ret == _SUCCESS ? ", acked" : "", i, try_cnt, rtw_get_passing_time_ms(start));
				ret == _SUCCESS ? ", acked" : "", i, try_cnt,
				jiffies_to_msecs(jiffies - start));
		else
			DBG_88E(FUNC_ADPT_FMT", ch:%u%s, %d/%d in %u ms\n",
				FUNC_ADPT_ARG(padapter), rtw_get_oper_ch(padapter),
				ret == _SUCCESS ? ", acked" : "", i, try_cnt, rtw_get_passing_time_ms(start));
				ret == _SUCCESS ? ", acked" : "", i, try_cnt,
				jiffies_to_msecs(jiffies - start));
	}
exit:
	return ret;
@@ -1293,7 +1295,7 @@ int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int pow
{
	int ret;
	int i = 0;
	u32 start = jiffies;
	unsigned long start = jiffies;
	struct mlme_ext_priv	*pmlmeext = &(padapter->mlmeextpriv);
	struct mlme_ext_info	*pmlmeinfo = &(pmlmeext->mlmext_info);
	struct wlan_bssid_ex    *pnetwork = &(pmlmeinfo->network);
@@ -1323,11 +1325,13 @@ int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int pow
		if (da)
			DBG_88E(FUNC_ADPT_FMT" to %pM, ch:%u%s, %d/%d in %u ms\n",
				FUNC_ADPT_ARG(padapter), da, rtw_get_oper_ch(padapter),
				ret == _SUCCESS ? ", acked" : "", i, try_cnt, rtw_get_passing_time_ms(start));
				ret == _SUCCESS ? ", acked" : "", i, try_cnt,
				jiffies_to_msecs(jiffies - start));
		else
			DBG_88E(FUNC_ADPT_FMT", ch:%u%s, %d/%d in %u ms\n",
				FUNC_ADPT_ARG(padapter), rtw_get_oper_ch(padapter),
				ret == _SUCCESS ? ", acked" : "", i, try_cnt, rtw_get_passing_time_ms(start));
				ret == _SUCCESS ? ", acked" : "", i, try_cnt,
				jiffies_to_msecs(jiffies - start));
	}
exit:
	return ret;
@@ -1418,7 +1422,7 @@ int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int
{
	int ret;
	int i = 0;
	u32 start = jiffies;
	unsigned long start = jiffies;
	struct mlme_ext_priv	*pmlmeext = &(padapter->mlmeextpriv);
	struct mlme_ext_info	*pmlmeinfo = &(pmlmeext->mlmext_info);
	struct wlan_bssid_ex    *pnetwork = &(pmlmeinfo->network);
@@ -1448,11 +1452,13 @@ int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int
		if (da)
			DBG_88E(FUNC_ADPT_FMT" to %pM, ch:%u%s, %d/%d in %u ms\n",
				FUNC_ADPT_ARG(padapter), da, rtw_get_oper_ch(padapter),
				ret == _SUCCESS ? ", acked" : "", i, try_cnt, rtw_get_passing_time_ms(start));
				ret == _SUCCESS ? ", acked" : "", i, try_cnt,
				jiffies_to_msecs(jiffies - start));
		else
			DBG_88E(FUNC_ADPT_FMT", ch:%u%s, %d/%d in %u ms\n",
				FUNC_ADPT_ARG(padapter), rtw_get_oper_ch(padapter),
				ret == _SUCCESS ? ", acked" : "", i, try_cnt, rtw_get_passing_time_ms(start));
				ret == _SUCCESS ? ", acked" : "", i, try_cnt,
				jiffies_to_msecs(jiffies - start));
	}
exit:
	return ret;
@@ -1530,7 +1536,7 @@ static int issue_deauth_ex(struct adapter *padapter, u8 *da,
{
	int ret;
	int i = 0;
	u32 start = jiffies;
	unsigned long start = jiffies;

	do {
		ret = _issue_deauth(padapter, da, reason, wait_ms > 0 ? true : false);
@@ -1553,11 +1559,13 @@ static int issue_deauth_ex(struct adapter *padapter, u8 *da,
		if (da)
			DBG_88E(FUNC_ADPT_FMT" to %pM, ch:%u%s, %d/%d in %u ms\n",
				FUNC_ADPT_ARG(padapter), da, rtw_get_oper_ch(padapter),
				ret == _SUCCESS ? ", acked" : "", i, try_cnt, rtw_get_passing_time_ms(start));
				ret == _SUCCESS ? ", acked" : "", i, try_cnt,
				jiffies_to_msecs(jiffies - start));
		else
			DBG_88E(FUNC_ADPT_FMT", ch:%u%s, %d/%d in %u ms\n",
				FUNC_ADPT_ARG(padapter), rtw_get_oper_ch(padapter),
				ret == _SUCCESS ? ", acked" : "", i, try_cnt, rtw_get_passing_time_ms(start));
				ret == _SUCCESS ? ", acked" : "", i, try_cnt,
				jiffies_to_msecs(jiffies - start));
	}
exit:
	return ret;
@@ -1959,7 +1967,7 @@ unsigned int send_beacon(struct adapter *padapter)
	int	issue = 0;
	int poll = 0;

	u32 start = jiffies;
	unsigned long start = jiffies;

	rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL);
	do {
@@ -1975,13 +1983,16 @@ unsigned int send_beacon(struct adapter *padapter)
	if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
		return _FAIL;
	if (!bxmitok) {
		DBG_88E("%s fail! %u ms\n", __func__, rtw_get_passing_time_ms(start));
		DBG_88E("%s fail! %u ms\n", __func__,
			jiffies_to_msecs(jiffies - start));
		return _FAIL;
	} else {
		u32 passing_time = rtw_get_passing_time_ms(start);
		u32 passing_time = jiffies_to_msecs(jiffies - start);

		if (passing_time > 100 || issue > 3)
			DBG_88E("%s success, issue:%d, poll:%d, %u ms\n", __func__, issue, poll, rtw_get_passing_time_ms(start));
			DBG_88E("%s success, issue:%d, poll:%d, %u ms\n",
				__func__, issue, poll,
				jiffies_to_msecs(jiffies - start));
		return _SUCCESS;
	}
}
+7 −7
Original line number Diff line number Diff line
@@ -348,7 +348,7 @@ void rtw_set_rpwm(struct adapter *padapter, u8 pslv)

static u8 PS_RDY_CHECK(struct adapter *padapter)
{
	u32 curr_time, delta_time;
	unsigned long curr_time, delta_time;
	struct pwrctrl_priv	*pwrpriv = &padapter->pwrctrlpriv;
	struct mlme_priv	*pmlmepriv = &(padapter->mlmepriv);

@@ -418,7 +418,7 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a
 */
s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
{
	u32 start_time;
	unsigned long start_time;
	u8 bAwake = false;
	s32 err = 0;

@@ -435,7 +435,7 @@ s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
			break;
		}

		if (rtw_get_passing_time_ms(start_time) > delay_ms) {
		if (jiffies_to_msecs(jiffies - start_time) > delay_ms) {
			err = -1;
			DBG_88E("%s: Wait for FW LPS leave more than %u ms!!!\n", __func__, delay_ms);
			break;
@@ -561,24 +561,24 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
	struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
	unsigned long expires;
	unsigned long start;
	int ret = _SUCCESS;

	expires = jiffies + msecs_to_jiffies(ips_deffer_ms);
	if (time_before(pwrpriv->ips_deny_time, expires))
		pwrpriv->ips_deny_time = jiffies + msecs_to_jiffies(ips_deffer_ms);

{
	u32 start = jiffies;
	start = jiffies;
	if (pwrpriv->ps_processing) {
		DBG_88E("%s wait ps_processing...\n", __func__);
		while (pwrpriv->ps_processing && rtw_get_passing_time_ms(start) <= 3000)
		while (pwrpriv->ps_processing &&
		       jiffies_to_msecs(jiffies - start) <= 3000)
			usleep_range(1000, 3000);
		if (pwrpriv->ps_processing)
			DBG_88E("%s wait ps_processing timeout\n", __func__);
		else
			DBG_88E("%s wait ps_processing done\n", __func__);
	}
}

	/* System suspend is not allowed to wakeup */
	if ((!pwrpriv->bInternalAutoSuspend) && (pwrpriv->bInSuspend)) {
+2 −2
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ s32 iol_execute(struct adapter *padapter, u8 control)
{
	s32 status = _FAIL;
	u8 reg_0x88 = 0;
	u32 start = 0, passing_time = 0;
	unsigned long start = 0;

	control = control&0x0f;
	reg_0x88 = usb_read8(padapter, REG_HMEBOX_E0);
@@ -61,7 +61,7 @@ s32 iol_execute(struct adapter *padapter, u8 control)

	start = jiffies;
	while ((reg_0x88 = usb_read8(padapter, REG_HMEBOX_E0)) & control &&
	       (passing_time = rtw_get_passing_time_ms(start)) < 1000) {
	       jiffies_to_msecs(jiffies - start) < 1000) {
		;
	}

Loading