staging: r8188eu: Replace rtw_get_current_time() with jiffies
authorLarry Finger <Larry.Finger@lwfinger.net>
Fri, 20 Dec 2013 04:38:40 +0000 (22:38 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Dec 2013 16:57:45 +0000 (08:57 -0800)
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
16 files changed:
drivers/staging/rtl8188eu/core/rtw_cmd.c
drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
drivers/staging/rtl8188eu/core/rtw_mlme.c
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
drivers/staging/rtl8188eu/core/rtw_p2p.c
drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
drivers/staging/rtl8188eu/core/rtw_xmit.c
drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
drivers/staging/rtl8188eu/hal/rtl8188e_sreset.c
drivers/staging/rtl8188eu/hal/usb_halinit.c
drivers/staging/rtl8188eu/include/osdep_service.h
drivers/staging/rtl8188eu/os_dep/os_intfs.c
drivers/staging/rtl8188eu/os_dep/osdep_service.c
drivers/staging/rtl8188eu/os_dep/recv_linux.c
drivers/staging/rtl8188eu/os_dep/usb_intf.c
drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c

index 64e29a9e8528fa4427aee97fe4e8f89b601d931a..73cb2be980ab53887e81388fa136a39b8e77988c 100644 (file)
@@ -529,7 +529,7 @@ _func_enter_;
        res = rtw_enqueue_cmd(pcmdpriv, ph2c);
 
        if (res == _SUCCESS) {
-               pmlmepriv->scan_start_time = rtw_get_current_time();
+               pmlmepriv->scan_start_time = jiffies;
 
                _set_timer(&pmlmepriv->scan_to_timer, SCANNING_TIMEOUT);
 
@@ -1717,7 +1717,7 @@ _func_enter_;
                break;
        case LPS_CTRL_SPECIAL_PACKET:
                /* DBG_88E("LPS_CTRL_SPECIAL_PACKET\n"); */
-               pwrpriv->DelayLPSLastTimeStamp = rtw_get_current_time();
+               pwrpriv->DelayLPSLastTimeStamp = jiffies;
                LPS_Leave(padapter);
                break;
        case LPS_CTRL_LEAVE:
@@ -2279,7 +2279,7 @@ _func_enter_;
                                spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
                                goto createbss_cmd_fail;
                        }
-                       pwlan->last_scanned = rtw_get_current_time();
+                       pwlan->last_scanned = jiffies;
                } else {
                        rtw_list_insert_tail(&(pwlan->list), &pmlmepriv->scanned_queue.queue);
                }
index 7b54c1ef0995a0f28f272492001accca8d259ab9..e25b39b97d9e8d9e4c40fa16da0f623f519de75e 100644 (file)
@@ -231,7 +231,7 @@ handle_tkip_countermeasure:
        /* should we add something here...? */
 
        if (padapter->securitypriv.btkip_countermeasure) {
-               cur_time = rtw_get_current_time();
+               cur_time = jiffies;
 
                if ((cur_time - padapter->securitypriv.btkip_countermeasure_time) > 60 * HZ) {
                        padapter->securitypriv.btkip_countermeasure = false;
@@ -343,7 +343,7 @@ _func_enter_;
 handle_tkip_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) {
                        padapter->securitypriv.btkip_countermeasure = false;
index 3ac632cb9eeaad8659b19389de6a69451fd7e093..6078d034961922559fec70443ffb9345c5924574 100644 (file)
@@ -202,7 +202,7 @@ _func_enter_;
        RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("_rtw_alloc_network: ptr=%p\n", plist));
        pnetwork->network_type = 0;
        pnetwork->fixed = false;
-       pnetwork->last_scanned = rtw_get_current_time();
+       pnetwork->last_scanned = jiffies;
        pnetwork->aid = 0;
        pnetwork->join_res = 0;
 
@@ -229,7 +229,7 @@ _func_enter_;
 
        if (pnetwork->fixed)
                goto exit;
-       curr_time = rtw_get_current_time();
+       curr_time = jiffies;
        if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) ||
            (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)))
                lifetime = 1;
@@ -345,7 +345,7 @@ _func_exit_;
 
 void rtw_generate_random_ibss(u8 *pibss)
 {
-       u32     curtime = rtw_get_current_time();
+       u32     curtime = jiffies;
 
 _func_enter_;
        pibss[0] = 0x02;  /* in ad-hoc mode bit1 must set to 1 */
@@ -613,7 +613,7 @@ _func_enter_;
                        memcpy(&(pnetwork->network), target,  get_wlan_bssid_ex_sz(target));
                        /*  variable initialize */
                        pnetwork->fixed = false;
-                       pnetwork->last_scanned = rtw_get_current_time();
+                       pnetwork->last_scanned = jiffies;
 
                        pnetwork->network_type = 0;
                        pnetwork->aid = 0;
@@ -637,7 +637,7 @@ _func_enter_;
                        rtw_hal_get_def_var(adapter, HAL_DEF_CURRENT_ANTENNA, &(target->PhyInfo.Optimum_antenna));
                        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 */
                        if (pnetwork->network.PhyInfo.SignalQuality == 101)
@@ -651,7 +651,7 @@ _func_enter_;
                 */
                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. */
                if ((pnetwork->network.IELength > target->IELength) && (target->Reserved[0] == 1))
@@ -1053,7 +1053,7 @@ void rtw_scan_abort(struct adapter *adapter)
        struct mlme_priv        *pmlmepriv = &(adapter->mlmepriv);
        struct mlme_ext_priv    *pmlmeext = &(adapter->mlmeextpriv);
 
-       start = rtw_get_current_time();
+       start = jiffies;
        pmlmeext->scan_abort = true;
        while (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) &&
               rtw_get_passing_time_ms(start) <= 200) {
index 5f1df23b4d62079e84608a1aaa8635d2529f65ba..bada209034398caebb5e6b9b677dbbc6a2e2dc96 100644 (file)
@@ -3822,7 +3822,7 @@ int issue_probereq_p2p_ex(struct adapter *adapter, u8 *da, int try_cnt, int wait
 {
        int ret;
        int i = 0;
-       u32 start = rtw_get_current_time();
+       u32 start = jiffies;
 
        do {
                ret = _issue_probereq_p2p(adapter, da, wait_ms > 0 ? true : false);
@@ -4968,7 +4968,7 @@ int issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid,
 {
        int ret;
        int i = 0;
-       u32 start = rtw_get_current_time();
+       u32 start = jiffies;
 
        do {
                ret = _issue_probereq(padapter, pssid, da, wait_ms > 0 ? true : false);
@@ -5689,7 +5689,7 @@ int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int pow
 {
        int ret;
        int i = 0;
-       u32 start = rtw_get_current_time();
+       u32 start = jiffies;
        struct mlme_ext_priv    *pmlmeext = &(padapter->mlmeextpriv);
        struct mlme_ext_info    *pmlmeinfo = &(pmlmeext->mlmext_info);
 
@@ -5812,7 +5812,7 @@ int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int
 {
        int ret;
        int i = 0;
-       u32 start = rtw_get_current_time();
+       u32 start = jiffies;
        struct mlme_ext_priv    *pmlmeext = &(padapter->mlmeextpriv);
        struct mlme_ext_info    *pmlmeinfo = &(pmlmeext->mlmext_info);
 
@@ -5930,7 +5930,7 @@ int issue_deauth_ex(struct adapter *padapter, u8 *da, unsigned short reason, int
 {
        int ret;
        int i = 0;
-       u32 start = rtw_get_current_time();
+       u32 start = jiffies;
 
        do {
                ret = _issue_deauth(padapter, da, reason, wait_ms > 0 ? true : false);
@@ -6333,7 +6333,7 @@ unsigned int send_beacon(struct adapter *padapter)
        int     issue = 0;
        int poll = 0;
 
-       u32 start = rtw_get_current_time();
+       u32 start = jiffies;
 
        rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL);
        do {
index f7defc7216bc3af6239a3cfc34f4f7068871737d..402fd21a9028d8f2b38ddb0848a08812d910212a 100644 (file)
@@ -1958,7 +1958,7 @@ void init_wifidirect_info(struct adapter *padapter, enum P2P_ROLE role)
 
        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);
 
        _rtw_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;
index b45461fe20fea50fe86da38e7240e9b18174c315..86b522f0009b63949f273265b1614e51bd4548a1 100644 (file)
@@ -122,7 +122,7 @@ static bool rtw_pwr_unassociated_idle(struct adapter *adapter)
 
        bool ret = false;
 
-       if (adapter->pwrctrlpriv.ips_deny_time >= rtw_get_current_time())
+       if (adapter->pwrctrlpriv.ips_deny_time >= jiffies)
                goto exit;
 
        if (check_fwstate(pmlmepriv, WIFI_ASOC_STATE|WIFI_SITE_MONITOR) ||
@@ -285,7 +285,7 @@ static u8 PS_RDY_CHECK(struct adapter *padapter)
        struct mlme_priv        *pmlmepriv = &(padapter->mlmepriv);
 
 
-       curr_time = rtw_get_current_time();
+       curr_time = jiffies;
        delta_time = curr_time - pwrpriv->DelayLPSLastTimeStamp;
 
        if (delta_time < LPS_DELAY_TIME)
@@ -379,7 +379,7 @@ s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
        s32 err = 0;
 
 
-       start_time = rtw_get_current_time();
+       start_time = jiffies;
        while (1) {
                rtw_hal_get_hwreg(padapter, HW_VAR_FWLPS_RF_ON, &bAwake);
                if (bAwake)
@@ -545,7 +545,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)
 {
        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);
 }
 
 /*
@@ -561,11 +561,11 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
        struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
        int ret = _SUCCESS;
 
-       if (pwrpriv->ips_deny_time < rtw_get_current_time() + rtw_ms_to_systime(ips_deffer_ms))
-               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 = jiffies + rtw_ms_to_systime(ips_deffer_ms);
 
 {
-       u32 start = rtw_get_current_time();
+       u32 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)
@@ -616,8 +616,8 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
        }
 
 exit:
-       if (pwrpriv->ips_deny_time < rtw_get_current_time() + rtw_ms_to_systime(ips_deffer_ms))
-               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 = jiffies + rtw_ms_to_systime(ips_deffer_ms);
        return ret;
 }
 
index a936f819dcf4d5dafe265d85d644e6ca8ff4bd0b..4845d965ffd78edcb44c967d565973027d9ab906 100644 (file)
@@ -2345,7 +2345,7 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst
 void rtw_sctx_init(struct submit_ctx *sctx, int timeout_ms)
 {
        sctx->timeout_ms = timeout_ms;
-       sctx->submit_time = rtw_get_current_time();
+       sctx->submit_time = jiffies;
        init_completion(&sctx->done);
        sctx->status = RTW_SCTX_SUBMITTED;
 }
@@ -2406,7 +2406,7 @@ int rtw_ack_tx_wait(struct xmit_priv *pxmitpriv, u32 timeout_ms)
 {
        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->status = RTW_SCTX_SUBMITTED;
 
index a291d7ae6f4225b19a9cb6dcb123a0ccf5b2b67c..0a0bc411d3c608a469e4a21aa7ff8b10e45deecb 100644 (file)
@@ -60,7 +60,7 @@ static s32 iol_execute(struct adapter *padapter, u8 control)
        reg_0x88 = rtw_read8(padapter, REG_HMEBOX_E0);
        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 &&
               (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_write8(adapter, REG_TXPKTBUF_DBG, 0);
-               start = rtw_get_current_time();
+               start = jiffies;
                while (!(reg_0x143 = rtw_read8(adapter, REG_TXPKTBUF_DBG)) &&
                       (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));
@@ -660,7 +660,7 @@ s32 rtl8188e_FirmwareDownload(struct adapter *padapter)
        }
 
        _FWDownloadEnable(padapter, true);
-       fwdl_start_time = rtw_get_current_time();
+       fwdl_start_time = jiffies;
        while (1) {
                /* reset the FWDL chksum */
                rtw_write8(padapter, REG_MCUFWDL, rtw_read8(padapter, REG_MCUFWDL) | FWDL_ChkSum_rpt);
index 96d698e1f33ee10249f2dd39c18bc66b4e5f4a2f..047b53482e67f06dc1d4eda7fe20493ad9743b80 100644 (file)
@@ -43,7 +43,7 @@ void rtl8188e_sreset_xmit_status_check(struct adapter *padapter)
                rtl8188e_silentreset_for_specific_platform(padapter);
        }
        /* total xmit irp = 4 */
-       current_time = rtw_get_current_time();
+       current_time = jiffies;
        if (0 == pxmitpriv->free_xmitbuf_cnt) {
                diff_time = jiffies_to_msecs(current_time - psrtpriv->last_tx_time);
 
index cca973211b2fe33824eb223674e89074bf62c1eb..b867bbb518858bdd50a0ea687ec3604ddd8b0355 100644 (file)
@@ -705,7 +705,7 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter)
        struct hal_data_8188e           *haldata = GET_HAL_DATA(Adapter);
        struct pwrctrl_priv             *pwrctrlpriv = &Adapter->pwrctrlpriv;
        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)
 
@@ -1251,7 +1251,7 @@ static void _ReadRFType(struct adapter *Adapter)
 
 static int _ReadAdapterInfo8188EU(struct adapter *Adapter)
 {
-       u32 start = rtw_get_current_time();
+       u32 start = jiffies;
 
        MSG_88E("====> %s\n", __func__);
 
index ebfbedc7a9921556cb32d943b986f421d7c0410c..7a0fbe61fb73ca0b97e09b17dfa894d113735232 100644 (file)
@@ -268,7 +268,6 @@ u32  _rtw_queue_empty(struct __queue *pqueue);
 u32  rtw_end_of_queue_search(struct list_head *queue,
                             struct list_head *pelement);
 
-u32  rtw_get_current_time(void);
 u32  rtw_systime_to_ms(u32 systime);
 u32  rtw_ms_to_systime(u32 ms);
 s32  rtw_get_passing_time_ms(u32 start);
index e50e3ad8e3b88fc22329572d3723ab009583281d..21ca9fe52584674a161ba61f821b21075cb545c3 100644 (file)
@@ -1154,7 +1154,7 @@ netdev_open_error:
 int rtw_ips_pwr_up(struct adapter *padapter)
 {
        int result;
-       u32 start_time = rtw_get_current_time();
+       u32 start_time = jiffies;
        DBG_88E("===>  rtw_ips_pwr_up..............\n");
        rtw_reset_drv_sw(padapter);
 
@@ -1168,7 +1168,7 @@ int rtw_ips_pwr_up(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");
 
        padapter->bCardDisableWOHSM = true;
index 787626c8c64608b2abe4ac9d3cdf79f023b6f0c1..59c098f298054da43bbcc0d09c7d546030547707 100644 (file)
@@ -212,11 +212,6 @@ u32 rtw_end_of_queue_search(struct list_head *head, struct list_head *plist)
                return false;
 }
 
-u32    rtw_get_current_time(void)
-{
-       return jiffies;
-}
-
 inline u32 rtw_systime_to_ms(u32 systime)
 {
        return systime * 1000 / HZ;
@@ -227,8 +222,7 @@ inline u32 rtw_ms_to_systime(u32 ms)
        return ms * HZ / 1000;
 }
 
-/*  the input parameter start use the same unit as returned by
- *  rtw_get_current_time */
+/*  the input parameter start must be in jiffies */
 inline s32 rtw_get_passing_time_ms(u32 start)
 {
        return rtw_systime_to_ms(jiffies-start);
index 3852ff43810ddde4944f7f615ba44e503652097f..2a18b3208a004fd00c52c79964d2f7446fe1ed0b 100644 (file)
@@ -90,16 +90,16 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)
        u32 cur_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 {
-               cur_time = rtw_get_current_time();
+               cur_time = jiffies;
 
                if (cur_time - psecuritypriv->last_mic_err_time < 60*HZ) {
                        psecuritypriv->btkip_countermeasure = true;
                        psecuritypriv->last_mic_err_time = 0;
                        psecuritypriv->btkip_countermeasure_time = cur_time;
                } else {
-                       psecuritypriv->last_mic_err_time = rtw_get_current_time();
+                       psecuritypriv->last_mic_err_time = jiffies;
                }
        }
 
index b21b1566424b994019b4c58a90d254e26ec8181b..527d4e73f95edbdf3c92a9004217b539d6fcca56 100644 (file)
@@ -504,7 +504,7 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
        struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
 
        int ret = 0;
-       u32 start_time = rtw_get_current_time();
+       u32 start_time = jiffies;
 
        _func_enter_;
 
@@ -586,7 +586,7 @@ int rtw_resume_process(struct adapter *padapter)
        struct net_device *pnetdev;
        struct pwrctrl_priv *pwrpriv = NULL;
        int ret = -1;
-       u32 start_time = rtw_get_current_time();
+       u32 start_time = jiffies;
        _func_enter_;
 
        DBG_88E("==> %s (%s:%d)\n", __func__, current->comm, current->pid);
index 93fc5ee5d7a136e16d24baf888669b950e81ca29..7e3f2fadd5bf55cb02c3ce7378600cabcef89186 100644 (file)
@@ -146,7 +146,7 @@ _func_enter_;
        }
 
        haldata = GET_HAL_DATA(padapter);
-       haldata->srestpriv.last_tx_complete_time = rtw_get_current_time();
+       haldata->srestpriv.last_tx_complete_time = jiffies;
 
 check_completion:
        rtw_sctx_done_err(&pxmitbuf->sctx,
@@ -230,7 +230,7 @@ _func_enter_;
        if (!status) {
                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 {
                rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_WRITE_PORT_ERR);
                DBG_88E("usb_write_port, status =%d\n", status);