rtl8188eu: rtw_get_current_time() is jiffies

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2014-12-13 15:18:54 -06:00
parent 209e50ad60
commit 61690cbca6
16 changed files with 46 additions and 53 deletions

View file

@ -495,7 +495,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid,
res = rtw_enqueue_cmd(pcmdpriv, ph2c); res = rtw_enqueue_cmd(pcmdpriv, ph2c);
if (res == _SUCCESS) { if (res == _SUCCESS) {
pmlmepriv->scan_start_time = rtw_get_current_time(); pmlmepriv->scan_start_time = jiffies;
_set_timer(&pmlmepriv->scan_to_timer, SCANNING_TIMEOUT); _set_timer(&pmlmepriv->scan_to_timer, SCANNING_TIMEOUT);
@ -1607,7 +1607,7 @@ static void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type)
break; break;
case LPS_CTRL_SPECIAL_PACKET: case LPS_CTRL_SPECIAL_PACKET:
/* DBG_88E("LPS_CTRL_SPECIAL_PACKET\n"); */ /* DBG_88E("LPS_CTRL_SPECIAL_PACKET\n"); */
pwrpriv->DelayLPSLastTimeStamp = rtw_get_current_time(); pwrpriv->DelayLPSLastTimeStamp = jiffies;
LPS_Leave(padapter); LPS_Leave(padapter);
break; break;
case LPS_CTRL_LEAVE: case LPS_CTRL_LEAVE:
@ -2139,7 +2139,7 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
goto createbss_cmd_fail; goto createbss_cmd_fail;
} }
pwlan->last_scanned = rtw_get_current_time(); pwlan->last_scanned = jiffies;
} else { } else {
list_add_tail(&(pwlan->list), &pmlmepriv->scanned_queue.queue); list_add_tail(&(pwlan->list), &pmlmepriv->scanned_queue.queue);
} }

View file

@ -219,7 +219,7 @@ handle_tkip_countermeasure:
/* should we add something here...? */ /* should we add something here...? */
if (padapter->securitypriv.btkip_countermeasure) { if (padapter->securitypriv.btkip_countermeasure) {
cur_time = rtw_get_current_time(); cur_time = jiffies;
if ((cur_time - padapter->securitypriv.btkip_countermeasure_time) > 60 * HZ) { if ((cur_time - padapter->securitypriv.btkip_countermeasure_time) > 60 * HZ) {
padapter->securitypriv.btkip_countermeasure = false; padapter->securitypriv.btkip_countermeasure = false;
@ -327,7 +327,7 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid)
handle_tkip_countermeasure: handle_tkip_countermeasure:
if (padapter->securitypriv.btkip_countermeasure) { if (padapter->securitypriv.btkip_countermeasure) {
cur_time = rtw_get_current_time(); cur_time = jiffies;
if ((cur_time - padapter->securitypriv.btkip_countermeasure_time) > 60 * HZ) { if ((cur_time - padapter->securitypriv.btkip_countermeasure_time) > 60 * HZ) {
padapter->securitypriv.btkip_countermeasure = false; padapter->securitypriv.btkip_countermeasure = false;

View file

@ -209,7 +209,7 @@ struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv)/* _queue *f
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("_rtw_alloc_network: ptr=%p\n", plist)); RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("_rtw_alloc_network: ptr=%p\n", plist));
pnetwork->network_type = 0; pnetwork->network_type = 0;
pnetwork->fixed = false; pnetwork->fixed = false;
pnetwork->last_scanned = rtw_get_current_time(); pnetwork->last_scanned = jiffies;
pnetwork->aid = 0; pnetwork->aid = 0;
pnetwork->join_res = 0; pnetwork->join_res = 0;
@ -232,7 +232,7 @@ void _rtw_free_network(struct mlme_priv *pmlmepriv , struct wlan_network *pnetwo
if (pnetwork->fixed) if (pnetwork->fixed)
return; return;
curr_time = rtw_get_current_time(); curr_time = jiffies;
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) || if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))) (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)))
lifetime = 1; lifetime = 1;
@ -334,7 +334,7 @@ int rtw_if_up(struct adapter *padapter)
void rtw_generate_random_ibss(u8 *pibss) void rtw_generate_random_ibss(u8 *pibss)
{ {
u32 curtime = rtw_get_current_time(); u32 curtime = jiffies;
pibss[0] = 0x02; /* in ad-hoc mode bit1 must set to 1 */ pibss[0] = 0x02; /* in ad-hoc mode bit1 must set to 1 */
pibss[1] = 0x11; pibss[1] = 0x11;
@ -586,7 +586,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
memcpy(&(pnetwork->network), target, get_wlan_bssid_ex_sz(target)); memcpy(&(pnetwork->network), target, get_wlan_bssid_ex_sz(target));
/* variable initialize */ /* variable initialize */
pnetwork->fixed = false; pnetwork->fixed = false;
pnetwork->last_scanned = rtw_get_current_time(); pnetwork->last_scanned = jiffies;
pnetwork->network_type = 0; pnetwork->network_type = 0;
pnetwork->aid = 0; pnetwork->aid = 0;
@ -610,7 +610,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
rtw_hal_get_def_var(adapter, HAL_DEF_CURRENT_ANTENNA, &(target->PhyInfo.Optimum_antenna)); rtw_hal_get_def_var(adapter, HAL_DEF_CURRENT_ANTENNA, &(target->PhyInfo.Optimum_antenna));
memcpy(&(pnetwork->network), target, bssid_ex_sz); memcpy(&(pnetwork->network), target, bssid_ex_sz);
pnetwork->last_scanned = rtw_get_current_time(); pnetwork->last_scanned = jiffies;
/* bss info not receiving from the right channel */ /* bss info not receiving from the right channel */
if (pnetwork->network.PhyInfo.SignalQuality == 101) if (pnetwork->network.PhyInfo.SignalQuality == 101)
@ -624,7 +624,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
*/ */
bool update_ie = true; bool update_ie = true;
pnetwork->last_scanned = rtw_get_current_time(); pnetwork->last_scanned = jiffies;
/* target.Reserved[0]== 1, means that scanned network is a bcn frame. */ /* target.Reserved[0]== 1, means that scanned network is a bcn frame. */
/* probe resp(3) > beacon(1) > probe req(2) */ /* probe resp(3) > beacon(1) > probe req(2) */
@ -1026,7 +1026,7 @@ void rtw_scan_abort(struct adapter *adapter)
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
struct mlme_ext_priv *pmlmeext = &(adapter->mlmeextpriv); struct mlme_ext_priv *pmlmeext = &(adapter->mlmeextpriv);
start = rtw_get_current_time(); start = jiffies;
pmlmeext->scan_abort = true; pmlmeext->scan_abort = true;
while (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) && while (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) &&
rtw_get_passing_time_ms(start) <= 200) { rtw_get_passing_time_ms(start) <= 200) {

View file

@ -3794,7 +3794,7 @@ int issue_probereq_p2p_ex(struct adapter *adapter, u8 *da, int try_cnt, int wait
{ {
int ret; int ret;
int i = 0; int i = 0;
u32 start = rtw_get_current_time(); u32 start = jiffies;
do { do {
ret = _issue_probereq_p2p(adapter, da, wait_ms > 0 ? true : false); ret = _issue_probereq_p2p(adapter, da, wait_ms > 0 ? true : false);
@ -4933,7 +4933,7 @@ int issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid,
{ {
int ret; int ret;
int i = 0; int i = 0;
u32 start = rtw_get_current_time(); u32 start = jiffies;
do { do {
ret = _issue_probereq(padapter, pssid, da, wait_ms > 0 ? true : false); ret = _issue_probereq(padapter, pssid, da, wait_ms > 0 ? true : false);
@ -5646,7 +5646,7 @@ int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int pow
{ {
int ret; int ret;
int i = 0; int i = 0;
u32 start = rtw_get_current_time(); u32 start = jiffies;
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
@ -5769,7 +5769,7 @@ int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int
{ {
int ret; int ret;
int i = 0; int i = 0;
u32 start = rtw_get_current_time(); u32 start = jiffies;
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
@ -5886,7 +5886,7 @@ int issue_deauth_ex(struct adapter *padapter, u8 *da, unsigned short reason, int
{ {
int ret; int ret;
int i = 0; int i = 0;
u32 start = rtw_get_current_time(); u32 start = jiffies;
do { do {
ret = _issue_deauth(padapter, da, reason, wait_ms > 0 ? true : false); ret = _issue_deauth(padapter, da, reason, wait_ms > 0 ? true : false);
@ -6288,7 +6288,7 @@ unsigned int send_beacon(struct adapter *padapter)
int issue = 0; int issue = 0;
int poll = 0; int poll = 0;
u32 start = rtw_get_current_time(); u32 start = jiffies;
rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL); rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL);
do { do {

View file

@ -1920,7 +1920,7 @@ void init_wifidirect_info(struct adapter *padapter, enum P2P_ROLE role)
rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_NONE); rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_NONE);
pwdinfo->listen_dwell = (u8) ((rtw_get_current_time() % 3) + 1); pwdinfo->listen_dwell = (u8) ((jiffies % 3) + 1);
memset(&pwdinfo->tx_prov_disc_info, 0x00, sizeof(struct tx_provdisc_req_info)); memset(&pwdinfo->tx_prov_disc_info, 0x00, sizeof(struct tx_provdisc_req_info));
pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_NONE; pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_NONE;

View file

@ -121,7 +121,7 @@ static bool rtw_pwr_unassociated_idle(struct adapter *adapter)
bool ret = false; bool ret = false;
if (adapter->pwrctrlpriv.ips_deny_time >= rtw_get_current_time()) if (adapter->pwrctrlpriv.ips_deny_time >= jiffies)
goto exit; goto exit;
if (check_fwstate(pmlmepriv, WIFI_ASOC_STATE|WIFI_SITE_MONITOR) || if (check_fwstate(pmlmepriv, WIFI_ASOC_STATE|WIFI_SITE_MONITOR) ||
@ -280,7 +280,7 @@ static u8 PS_RDY_CHECK(struct adapter *padapter)
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv; struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
curr_time = rtw_get_current_time(); curr_time = jiffies;
delta_time = curr_time - pwrpriv->DelayLPSLastTimeStamp; delta_time = curr_time - pwrpriv->DelayLPSLastTimeStamp;
if (delta_time < LPS_DELAY_TIME) if (delta_time < LPS_DELAY_TIME)
@ -370,7 +370,7 @@ s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
u8 bAwake = false; u8 bAwake = false;
s32 err = 0; s32 err = 0;
start_time = rtw_get_current_time(); start_time = jiffies;
while (1) { while (1) {
rtw_hal_get_hwreg(padapter, HW_VAR_FWLPS_RF_ON, &bAwake); rtw_hal_get_hwreg(padapter, HW_VAR_FWLPS_RF_ON, &bAwake);
if (bAwake) if (bAwake)
@ -521,7 +521,7 @@ u8 rtw_interface_ps_func(struct adapter *padapter, enum hal_intf_ps_func efunc_i
inline void rtw_set_ips_deny(struct adapter *padapter, u32 ms) inline void rtw_set_ips_deny(struct adapter *padapter, u32 ms)
{ {
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv; struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
pwrpriv->ips_deny_time = rtw_get_current_time() + rtw_ms_to_systime(ms); pwrpriv->ips_deny_time = jiffies + rtw_ms_to_systime(ms);
} }
/* /*
@ -536,10 +536,10 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv; struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
int ret = _SUCCESS; int ret = _SUCCESS;
u32 start = rtw_get_current_time(); u32 start = jiffies;
if (pwrpriv->ips_deny_time < rtw_get_current_time() + rtw_ms_to_systime(ips_deffer_ms)) if (pwrpriv->ips_deny_time < jiffies + rtw_ms_to_systime(ips_deffer_ms))
pwrpriv->ips_deny_time = rtw_get_current_time() + rtw_ms_to_systime(ips_deffer_ms); pwrpriv->ips_deny_time = jiffies + rtw_ms_to_systime(ips_deffer_ms);
if (pwrpriv->ps_processing) { if (pwrpriv->ps_processing) {
DBG_88E("%s wait ps_processing...\n", __func__); DBG_88E("%s wait ps_processing...\n", __func__);
@ -596,8 +596,8 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
} }
exit: exit:
if (pwrpriv->ips_deny_time < rtw_get_current_time() + rtw_ms_to_systime(ips_deffer_ms)) if (pwrpriv->ips_deny_time < jiffies + rtw_ms_to_systime(ips_deffer_ms))
pwrpriv->ips_deny_time = rtw_get_current_time() + rtw_ms_to_systime(ips_deffer_ms); pwrpriv->ips_deny_time = jiffies + rtw_ms_to_systime(ips_deffer_ms);
return ret; return ret;
} }

View file

@ -2288,7 +2288,7 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst
void rtw_sctx_init(struct submit_ctx *sctx, int timeout_ms) void rtw_sctx_init(struct submit_ctx *sctx, int timeout_ms)
{ {
sctx->timeout_ms = timeout_ms; sctx->timeout_ms = timeout_ms;
sctx->submit_time = rtw_get_current_time(); sctx->submit_time = jiffies;
init_completion(&sctx->done); init_completion(&sctx->done);
sctx->status = RTW_SCTX_SUBMITTED; sctx->status = RTW_SCTX_SUBMITTED;
} }
@ -2349,7 +2349,7 @@ int rtw_ack_tx_wait(struct xmit_priv *pxmitpriv, u32 timeout_ms)
{ {
struct submit_ctx *pack_tx_ops = &pxmitpriv->ack_tx_ops; struct submit_ctx *pack_tx_ops = &pxmitpriv->ack_tx_ops;
pack_tx_ops->submit_time = rtw_get_current_time(); pack_tx_ops->submit_time = jiffies;
pack_tx_ops->timeout_ms = timeout_ms; pack_tx_ops->timeout_ms = timeout_ms;
pack_tx_ops->status = RTW_SCTX_SUBMITTED; pack_tx_ops->status = RTW_SCTX_SUBMITTED;

View file

@ -60,7 +60,7 @@ static s32 iol_execute(struct adapter *padapter, u8 control)
reg_0x88 = rtw_read8(padapter, REG_HMEBOX_E0); reg_0x88 = rtw_read8(padapter, REG_HMEBOX_E0);
rtw_write8(padapter, REG_HMEBOX_E0, reg_0x88|control); rtw_write8(padapter, REG_HMEBOX_E0, reg_0x88|control);
start = rtw_get_current_time(); start = jiffies;
while ((reg_0x88 = rtw_read8(padapter, REG_HMEBOX_E0)) & control && while ((reg_0x88 = rtw_read8(padapter, REG_HMEBOX_E0)) & control &&
(passing_time = rtw_get_passing_time_ms(start)) < 1000) { (passing_time = rtw_get_passing_time_ms(start)) < 1000) {
; ;
@ -238,7 +238,7 @@ static void efuse_read_phymap_from_txpktbuf(
rtw_write16(adapter, REG_PKTBUF_DBG_ADDR, dbg_addr+i); rtw_write16(adapter, REG_PKTBUF_DBG_ADDR, dbg_addr+i);
rtw_write8(adapter, REG_TXPKTBUF_DBG, 0); rtw_write8(adapter, REG_TXPKTBUF_DBG, 0);
start = rtw_get_current_time(); start = jiffies;
while (!(reg_0x143 = rtw_read8(adapter, REG_TXPKTBUF_DBG)) && while (!(reg_0x143 = rtw_read8(adapter, REG_TXPKTBUF_DBG)) &&
(passing_time = rtw_get_passing_time_ms(start)) < 1000) { (passing_time = rtw_get_passing_time_ms(start)) < 1000) {
DBG_88E("%s polling reg_0x143:0x%02x, reg_0x106:0x%02x\n", __func__, reg_0x143, rtw_read8(adapter, 0x106)); DBG_88E("%s polling reg_0x143:0x%02x, reg_0x106:0x%02x\n", __func__, reg_0x143, rtw_read8(adapter, 0x106));
@ -667,7 +667,7 @@ s32 rtl8188e_FirmwareDownload(struct adapter *padapter)
} }
_FWDownloadEnable(padapter, true); _FWDownloadEnable(padapter, true);
fwdl_start_time = rtw_get_current_time(); fwdl_start_time = jiffies;
while (1) { while (1) {
/* reset the FWDL chksum */ /* reset the FWDL chksum */
rtw_write8(padapter, REG_MCUFWDL, rtw_read8(padapter, REG_MCUFWDL) | FWDL_ChkSum_rpt); rtw_write8(padapter, REG_MCUFWDL, rtw_read8(padapter, REG_MCUFWDL) | FWDL_ChkSum_rpt);

View file

@ -43,7 +43,7 @@ void rtl8188e_sreset_xmit_status_check(struct adapter *padapter)
rtl8188e_silentreset_for_specific_platform(padapter); rtl8188e_silentreset_for_specific_platform(padapter);
} }
/* total xmit irp = 4 */ /* total xmit irp = 4 */
current_time = rtw_get_current_time(); current_time = jiffies;
if (0 == pxmitpriv->free_xmitbuf_cnt) { if (0 == pxmitpriv->free_xmitbuf_cnt) {
diff_time = jiffies_to_msecs(current_time - psrtpriv->last_tx_time); diff_time = jiffies_to_msecs(current_time - psrtpriv->last_tx_time);

View file

@ -705,7 +705,7 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter)
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter); struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
struct pwrctrl_priv *pwrctrlpriv = &Adapter->pwrctrlpriv; struct pwrctrl_priv *pwrctrlpriv = &Adapter->pwrctrlpriv;
struct registry_priv *pregistrypriv = &Adapter->registrypriv; struct registry_priv *pregistrypriv = &Adapter->registrypriv;
u32 init_start_time = rtw_get_current_time(); u32 init_start_time = jiffies;
#define HAL_INIT_PROFILE_TAG(stage) do {} while (0) #define HAL_INIT_PROFILE_TAG(stage) do {} while (0)
@ -1243,7 +1243,7 @@ static void _ReadRFType(struct adapter *Adapter)
static int _ReadAdapterInfo8188EU(struct adapter *Adapter) static int _ReadAdapterInfo8188EU(struct adapter *Adapter)
{ {
u32 start = rtw_get_current_time(); u32 start = jiffies;
MSG_88E("====> %s\n", __func__); MSG_88E("====> %s\n", __func__);

View file

@ -259,7 +259,6 @@ void _rtw_spinlock_free(spinlock_t *plock);
void _rtw_init_queue(struct __queue *pqueue); void _rtw_init_queue(struct __queue *pqueue);
u32 rtw_get_current_time(void);
u32 rtw_systime_to_ms(u32 systime); u32 rtw_systime_to_ms(u32 systime);
u32 rtw_ms_to_systime(u32 ms); u32 rtw_ms_to_systime(u32 ms);
s32 rtw_get_passing_time_ms(u32 start); s32 rtw_get_passing_time_ms(u32 start);

View file

@ -1168,7 +1168,7 @@ netdev_open_error:
int rtw_ips_pwr_up(struct adapter *padapter) int rtw_ips_pwr_up(struct adapter *padapter)
{ {
int result; int result;
u32 start_time = rtw_get_current_time(); u32 start_time = jiffies;
DBG_88E("===> rtw_ips_pwr_up..............\n"); DBG_88E("===> rtw_ips_pwr_up..............\n");
rtw_reset_drv_sw(padapter); rtw_reset_drv_sw(padapter);
@ -1182,7 +1182,7 @@ int rtw_ips_pwr_up(struct adapter *padapter)
void rtw_ips_pwr_down(struct adapter *padapter) void rtw_ips_pwr_down(struct adapter *padapter)
{ {
u32 start_time = rtw_get_current_time(); u32 start_time = jiffies;
DBG_88E("===> rtw_ips_pwr_down...................\n"); DBG_88E("===> rtw_ips_pwr_down...................\n");
padapter->bCardDisableWOHSM = true; padapter->bCardDisableWOHSM = true;

View file

@ -159,11 +159,6 @@ void _rtw_init_queue(struct __queue *pqueue)
spin_lock_init(&(pqueue->lock)); spin_lock_init(&(pqueue->lock));
} }
u32 rtw_get_current_time(void)
{
return jiffies;
}
inline u32 rtw_systime_to_ms(u32 systime) inline u32 rtw_systime_to_ms(u32 systime)
{ {
return systime * 1000 / HZ; return systime * 1000 / HZ;
@ -174,8 +169,7 @@ inline u32 rtw_ms_to_systime(u32 ms)
return ms * HZ / 1000; return ms * HZ / 1000;
} }
/* the input parameter start use the same unit as returned by /* the input parameter start use the same unit as jiffies */
* rtw_get_current_time */
inline s32 rtw_get_passing_time_ms(u32 start) inline s32 rtw_get_passing_time_ms(u32 start)
{ {
return rtw_systime_to_ms(jiffies-start); return rtw_systime_to_ms(jiffies-start);

View file

@ -90,16 +90,16 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)
u32 cur_time = 0; u32 cur_time = 0;
if (psecuritypriv->last_mic_err_time == 0) { if (psecuritypriv->last_mic_err_time == 0) {
psecuritypriv->last_mic_err_time = rtw_get_current_time(); psecuritypriv->last_mic_err_time = jiffies;
} else { } else {
cur_time = rtw_get_current_time(); cur_time = jiffies;
if (cur_time - psecuritypriv->last_mic_err_time < 60*HZ) { if (cur_time - psecuritypriv->last_mic_err_time < 60*HZ) {
psecuritypriv->btkip_countermeasure = true; psecuritypriv->btkip_countermeasure = true;
psecuritypriv->last_mic_err_time = 0; psecuritypriv->last_mic_err_time = 0;
psecuritypriv->btkip_countermeasure_time = cur_time; psecuritypriv->btkip_countermeasure_time = cur_time;
} else { } else {
psecuritypriv->last_mic_err_time = rtw_get_current_time(); psecuritypriv->last_mic_err_time = jiffies;
} }
} }

View file

@ -475,7 +475,7 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv; struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
int ret = 0; int ret = 0;
u32 start_time = rtw_get_current_time(); u32 start_time = jiffies;
DBG_88E("==> %s (%s:%d)\n", __func__, current->comm, current->pid); DBG_88E("==> %s (%s:%d)\n", __func__, current->comm, current->pid);
@ -555,7 +555,7 @@ int rtw_resume_process(struct adapter *padapter)
struct net_device *pnetdev; struct net_device *pnetdev;
struct pwrctrl_priv *pwrpriv = NULL; struct pwrctrl_priv *pwrpriv = NULL;
int ret = -1; int ret = -1;
u32 start_time = rtw_get_current_time(); u32 start_time = jiffies;
DBG_88E("==> %s (%s:%d)\n", __func__, current->comm, current->pid); DBG_88E("==> %s (%s:%d)\n", __func__, current->comm, current->pid);

View file

@ -144,7 +144,7 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
} }
haldata = GET_HAL_DATA(padapter); haldata = GET_HAL_DATA(padapter);
haldata->srestpriv.last_tx_complete_time = rtw_get_current_time(); haldata->srestpriv.last_tx_complete_time = jiffies;
check_completion: check_completion:
rtw_sctx_done_err(&pxmitbuf->sctx, rtw_sctx_done_err(&pxmitbuf->sctx,
@ -225,7 +225,7 @@ u32 usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem)
if (!status) { if (!status) {
struct hal_data_8188e *haldata = GET_HAL_DATA(padapter); struct hal_data_8188e *haldata = GET_HAL_DATA(padapter);
haldata->srestpriv.last_tx_time = rtw_get_current_time(); haldata->srestpriv.last_tx_time = jiffies;
} else { } else {
rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_WRITE_PORT_ERR); rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_WRITE_PORT_ERR);
DBG_88E("usb_write_port, status =%d\n", status); DBG_88E("usb_write_port, status =%d\n", status);