From 45a86628d29e4398ea060cbcc6e70b4c2be3dab3 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Fri, 21 Dec 2018 21:55:20 -0600 Subject: [PATCH] rtl8188eu: Routine rtw_get_current_time() is a synonym for jiffies Signed-off-by: Larry Finger --- core/rtw_beamforming.c | 2 +- core/rtw_cmd.c | 12 ++++++------ core/rtw_efuse.c | 2 +- core/rtw_mi.c | 2 +- core/rtw_mlme.c | 12 ++++++------ core/rtw_mlme_ext.c | 38 ++++++++++++++++++------------------- core/rtw_p2p.c | 4 ++-- core/rtw_pwrctrl.c | 32 +++++++++++++++---------------- core/rtw_recv.c | 4 ++-- core/rtw_security.c | 8 ++++---- core/rtw_sreset.c | 2 +- core/rtw_tdls.c | 10 +++++----- core/rtw_wlan_util.c | 2 +- core/rtw_xmit.c | 8 ++++---- hal/hal_btcoex.c | 4 ++-- hal/hal_com.c | 22 ++++++++++----------- hal/hal_intf.c | 2 +- hal/hal_mcc.c | 8 ++++---- hal/phydm/phydm_interface.c | 2 +- hal/rtl8188e_hal_init.c | 20 +++++++++---------- hal/rtl8188e_sreset.c | 2 +- hal/usb_halinit.c | 6 +++--- include/drv_types.h | 4 ++-- include/osdep_service.h | 1 - include/rtw_mlme_ext.h | 2 +- os_dep/ioctl_cfg80211.c | 12 ++++++------ os_dep/ioctl_linux.c | 6 +++--- os_dep/os_intfs.c | 8 ++++---- os_dep/osdep_service.c | 8 +------- os_dep/recv_linux.c | 9 +++++---- os_dep/usb_intf.c | 2 +- os_dep/usb_ops_linux.c | 4 ++-- 32 files changed, 127 insertions(+), 133 deletions(-) diff --git a/core/rtw_beamforming.c b/core/rtw_beamforming.c index 1b32b1f..67f9e19 100644 --- a/core/rtw_beamforming.c +++ b/core/rtw_beamforming.c @@ -1912,7 +1912,7 @@ void rtw_bf_update_traffic(PADAPTER adapter) last_timestamp = bfee->tx_timestamp; last_bytes = bfee->tx_bytes; - bfee->tx_timestamp = rtw_get_current_time(); + bfee->tx_timestamp = jiffies; bfee->tx_bytes = sta->sta_stats.tx_bytes; if (last_timestamp) { if (bfee->tx_bytes >= last_bytes) diff --git a/core/rtw_cmd.c b/core/rtw_cmd.c index ccf77d2..eda101c 100644 --- a/core/rtw_cmd.c +++ b/core/rtw_cmd.c @@ -592,7 +592,7 @@ _next: continue; } - cmd_start_time = rtw_get_current_time(); + cmd_start_time = jiffies; pcmdpriv->cmd_issued_cnt++; if (pcmd->cmdsz > MAX_CMDSZ) { @@ -915,7 +915,7 @@ u8 rtw_sitesurvey_cmd(_adapter *padapter, NDIS_802_11_SSID *ssid, int ssid_num, if (res == _SUCCESS) { - pmlmepriv->scan_start_time = rtw_get_current_time(); + pmlmepriv->scan_start_time = jiffies; #ifdef CONFIG_SCAN_BACKOP if (rtw_mi_buddy_check_mlmeinfo_state(padapter, WIFI_FW_AP_STATE)) { @@ -2690,7 +2690,7 @@ void lps_ctrl_wk_hdl(_adapter *padapter, u8 lps_ctrl_type) break; case LPS_CTRL_SPECIAL_PACKET: /* RTW_INFO("LPS_CTRL_SPECIAL_PACKET\n"); */ - pwrpriv->DelayLPSLastTimeStamp = rtw_get_current_time(); + pwrpriv->DelayLPSLastTimeStamp = jiffies; #ifdef CONFIG_BT_COEXIST rtw_btcoex_SpecialPacketNotify(padapter, PACKET_DHCP); #endif /* CONFIG_BT_COEXIST */ @@ -3228,7 +3228,7 @@ static void rtw_chk_hi_queue_hdl(_adapter *padapter) { struct sta_info *psta_bmc; struct sta_priv *pstapriv = &padapter->stapriv; - u32 start = rtw_get_current_time(); + u32 start = jiffies; u8 empty = false; psta_bmc = rtw_get_bcmc_stainfo(padapter); @@ -4358,7 +4358,7 @@ unlock: st->local_port = cpu_to_be16(local_port); st->remote_naddr = remote_naddr; st->remote_port = cpu_to_be16(remote_port); - st->set_time = rtw_get_current_time(); + st->set_time = jiffies; st->status = ST_STATUS_CHECK; _enter_critical_bh(&st_ctl->tracker_q.lock, &irqL); @@ -4601,7 +4601,7 @@ void rtw_create_ibss_post_hdl(_adapter *padapter, int status) _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); goto createbss_cmd_fail; } - pwlan->last_scanned = rtw_get_current_time(); + pwlan->last_scanned = jiffies; } else list_add_tail(&(pwlan->list), &pmlmepriv->scanned_queue.queue); diff --git a/core/rtw_efuse.c b/core/rtw_efuse.c index fc8f6e4..a7ed43e 100644 --- a/core/rtw_efuse.c +++ b/core/rtw_efuse.c @@ -266,7 +266,7 @@ ReadEFuseByte( u32 value32; u8 readbyte; u16 retry; - /* u32 start=rtw_get_current_time(); */ + /* u32 start=jiffies; */ if (bPseudoTest) { Efuse_Read1ByteFromFakeContent(Adapter, _offset, pbuf); diff --git a/core/rtw_mi.c b/core/rtw_mi.c index 2798e4a..f16b68e 100644 --- a/core/rtw_mi.c +++ b/core/rtw_mi.c @@ -658,7 +658,7 @@ static u8 _rtw_mi_busy_traffic_check(_adapter *padapter, void *data) if (check_sc_interval) { /* Miracast can't do AP scan*/ passtime = rtw_get_passing_time_ms(pmlmepriv->lastscantime); - pmlmepriv->lastscantime = rtw_get_current_time(); + pmlmepriv->lastscantime = jiffies; if (passtime > BUSY_TRAFFIC_SCAN_DENY_PERIOD) { RTW_INFO(ADPT_FMT" bBusyTraffic == true\n", ADPT_ARG(padapter)); return true; diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index abae8a0..20ae7a4 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -349,7 +349,7 @@ struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv) /* (_queue 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; @@ -923,10 +923,10 @@ void rtw_update_scanned_network(_adapter *adapter, WLAN_BSSID_EX *target) rtw_hal_get_odm_var(adapter, HAL_ODM_ANTDIV_SELECT, &(target->PhyInfo.Optimum_antenna), NULL); #endif memcpy(&(pnetwork->network), target, get_WLAN_BSSID_EX_sz(target)); - /* pnetwork->last_scanned = rtw_get_current_time(); */ + /* pnetwork->last_scanned = jiffies; */ /* variable initialize */ pnetwork->fixed = false; - pnetwork->last_scanned = rtw_get_current_time(); + pnetwork->last_scanned = jiffies; pnetwork->network_type = 0; pnetwork->aid = 0; @@ -951,7 +951,7 @@ void rtw_update_scanned_network(_adapter *adapter, WLAN_BSSID_EX *target) #endif memcpy(&(pnetwork->network), target, bssid_ex_sz); - pnetwork->last_scanned = rtw_get_current_time(); + pnetwork->last_scanned = jiffies; /* bss info not receving from the right channel */ if (pnetwork->network.PhyInfo.SignalQuality == 101) @@ -967,7 +967,7 @@ void rtw_update_scanned_network(_adapter *adapter, WLAN_BSSID_EX *target) */ bool update_ie = true; - pnetwork->last_scanned = rtw_get_current_time(); + pnetwork->last_scanned = jiffies; /* target.Reserved[0]==1, means that scaned network is a bcn frame. */ if ((pnetwork->network.IELength > target->IELength) && (target->Reserved[0] == 1)) @@ -1586,7 +1586,7 @@ static u32 _rtw_wait_scan_done(_adapter *adapter, u8 abort, u32 timeout_ms) struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); struct mlme_ext_priv *pmlmeext = &(adapter->mlmeextpriv); - start = rtw_get_current_time(); + start = jiffies; pmlmeext->scan_abort = abort; diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 1e41548..dd84fb2 100755 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -485,7 +485,7 @@ u32 rtw_chset_get_ch_non_ocp_ms(RT_CHANNEL_INFO *ch_set, u8 ch, u8 bw, u8 offset if (rtw_chbw_to_freq_range(ch, bw, offset, &hi, &lo) == false) goto exit; - current_time = rtw_get_current_time(); + current_time = jiffies; for (i = 0; ch_set[i].ChannelNum != 0; i++) { if (!rtw_ch2freq(ch_set[i].ChannelNum)) { @@ -534,9 +534,9 @@ static void _rtw_chset_update_non_ocp(RT_CHANNEL_INFO *ch_set, u8 ch, u8 bw, u8 && rtw_ch2freq(ch_set[i].ChannelNum) <= hi ) { if (ms >= 0) - ch_set[i].non_ocp_end_time = rtw_get_current_time() + rtw_ms_to_systime(ms); + ch_set[i].non_ocp_end_time = jiffies + rtw_ms_to_systime(ms); else - ch_set[i].non_ocp_end_time = rtw_get_current_time() + rtw_ms_to_systime(NON_OCP_TIME_MS); + ch_set[i].non_ocp_end_time = jiffies + rtw_ms_to_systime(NON_OCP_TIME_MS); } } @@ -588,7 +588,7 @@ u32 rtw_get_ch_waiting_ms(_adapter *adapter, u8 ch, u8 bw, u8 offset, u32 *r_non cac_ms = 0; else if (in_rd_range && !non_ocp_ms) { if (IS_CH_WAITING(rfctl)) - cac_ms = rtw_systime_to_ms(rfctl->cac_end_time - rtw_get_current_time()); + cac_ms = rtw_systime_to_ms(rfctl->cac_end_time - jiffies); else cac_ms = 0; } else if (rtw_is_long_cac_ch(ch, bw, offset, rtw_odm_get_dfs_domain(adapter))) @@ -618,7 +618,7 @@ void rtw_reset_cac(_adapter *adapter, u8 ch, u8 bw, u8 offset) , &cac_ms ); - rfctl->cac_start_time = rtw_get_current_time() + rtw_ms_to_systime(non_ocp_ms); + rfctl->cac_start_time = jiffies + rtw_ms_to_systime(non_ocp_ms); rfctl->cac_end_time = rfctl->cac_start_time + rtw_ms_to_systime(cac_ms); /* skip special value */ @@ -817,7 +817,7 @@ void dump_chset(void *sel, RT_CHANNEL_INFO *ch_set) if (rtw_is_dfs_ch(ch_set[i].ChannelNum, CHANNEL_WIDTH_20, HAL_PRIME_CHNL_OFFSET_DONT_CARE)) { if (CH_IS_NON_OCP(&ch_set[i])) _RTW_PRINT_SEL(sel, ", non_ocp:%d" - , rtw_systime_to_ms(ch_set[i].non_ocp_end_time - rtw_get_current_time())); + , rtw_systime_to_ms(ch_set[i].non_ocp_end_time - jiffies)); else _RTW_PRINT_SEL(sel, ", non_ocp:N/A"); } @@ -1247,7 +1247,7 @@ static u8 init_channel_set(_adapter *padapter, u8 ChannelPlan, RT_CHANNEL_INFO * #ifdef CONFIG_DFS_MASTER for (i = 0; i < chanset_size; i++) - channel_set[i].non_ocp_end_time = rtw_get_current_time(); + channel_set[i].non_ocp_end_time = jiffies; #endif #endif /* CONFIG_IEEE80211_BAND_5GHZ */ @@ -6262,7 +6262,7 @@ int issue_probereq_p2p_ex(_adapter *adapter, u8 *da, int try_cnt, int wait_ms) { 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); @@ -8076,7 +8076,7 @@ int issue_probereq_ex(_adapter *padapter, NDIS_802_11_SSID *pssid, u8 *da, u8 ch { int ret = _FAIL; int i = 0; - u32 start = rtw_get_current_time(); + u32 start = jiffies; if (rtw_rfctl_is_tx_blocked_by_ch_waiting(adapter_to_rfctl(padapter))) goto exit; @@ -9025,7 +9025,7 @@ int issue_nulldata(_adapter *padapter, unsigned char *da, unsigned int power_mod { int ret = _FAIL; 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); struct sta_info *psta; @@ -9217,7 +9217,7 @@ int issue_qos_nulldata(_adapter *padapter, unsigned char *da, u16 tid, int try_c { int ret = _FAIL; 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); @@ -9358,7 +9358,7 @@ int issue_deauth_ex(_adapter *padapter, u8 *da, unsigned short reason, int try_c { int ret = _FAIL; int i = 0; - u32 start = rtw_get_current_time(); + u32 start = jiffies; if (rtw_rfctl_is_tx_blocked_by_ch_waiting(adapter_to_rfctl(padapter))) goto exit; @@ -9772,7 +9772,7 @@ inline u8 issue_addba_rsp_wait_ack(_adapter *adapter, unsigned char *ra, u8 tid, { int ret = _FAIL; int i = 0; - u32 start = rtw_get_current_time(); + u32 start = jiffies; if (rtw_rfctl_is_tx_blocked_by_ch_waiting(adapter_to_rfctl(adapter))) goto exit; @@ -9850,7 +9850,7 @@ int issue_del_ba_ex(_adapter *adapter, unsigned char *ra, u8 tid, u16 reason, u8 { int ret = _FAIL; int i = 0; - u32 start = rtw_get_current_time(); + u32 start = jiffies; if (rtw_rfctl_is_tx_blocked_by_ch_waiting(adapter_to_rfctl(adapter))) goto exit; @@ -10130,7 +10130,7 @@ int issue_action_SM_PS_wait_ack(_adapter *padapter, unsigned char *raddr, u8 New { int ret = _FAIL; int i = 0; - u32 start = rtw_get_current_time(); + u32 start = jiffies; if (rtw_rfctl_is_tx_blocked_by_ch_waiting(adapter_to_rfctl(padapter))) goto exit; @@ -10291,7 +10291,7 @@ unsigned int send_beacon(_adapter *padapter) return _SUCCESS; #endif - 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_DL_BCN_SEL, NULL); @@ -13194,7 +13194,7 @@ static u8 rtw_scan_sparse(_adapter *adapter, struct rtw_ieee80211_channel *ch, u goto exit; if (mlmeext->last_scan_time == 0) - mlmeext->last_scan_time = rtw_get_current_time(); + mlmeext->last_scan_time = jiffies; interval = rtw_get_passing_time_ms(mlmeext->last_scan_time); @@ -13250,7 +13250,7 @@ static u8 rtw_scan_sparse(_adapter *adapter, struct rtw_ieee80211_channel *ch, u memset(&ch[k], 0, sizeof(struct rtw_ieee80211_channel)); ret_num = k; - mlmeext->last_scan_time = rtw_get_current_time(); + mlmeext->last_scan_time = jiffies; } exit: @@ -13934,7 +13934,7 @@ operation_by_state: } mlmeext_set_scan_state(pmlmeext, SCAN_BACK_OP); - ss->backop_time = rtw_get_current_time(); + ss->backop_time = jiffies; if (mlmeext_chk_scan_backop_flags(pmlmeext, SS_BACKOP_TX_RESUME)) rtw_mi_os_xmit_schedule(padapter); diff --git a/core/rtw_p2p.c b/core/rtw_p2p.c index 7cb0e62..7e9d41c 100644 --- a/core/rtw_p2p.c +++ b/core/rtw_p2p.c @@ -3338,7 +3338,7 @@ static int cancel_ro_ch_handler(_adapter *padapter, u8 *buf) rtw_cfg80211_set_is_roch(padapter, false); pcfg80211_wdinfo->ro_ch_wdev = NULL; - pcfg80211_wdinfo->last_ro_ch_time = rtw_get_current_time(); + pcfg80211_wdinfo->last_ro_ch_time = jiffies; rtw_cfg80211_remain_on_channel_expired(wdev , pcfg80211_wdinfo->remain_on_ch_cookie @@ -5048,7 +5048,7 @@ void init_wifidirect_info(_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_INFO( "[%s] listen_dwell time is %d00ms\n", __func__, pwdinfo->listen_dwell ); */ memset(&pwdinfo->tx_prov_disc_info, 0x00, sizeof(struct tx_provdisc_req_info)); diff --git a/core/rtw_pwrctrl.c b/core/rtw_pwrctrl.c index 453e46a..22d4906 100644 --- a/core/rtw_pwrctrl.c +++ b/core/rtw_pwrctrl.c @@ -195,7 +195,7 @@ static bool rtw_pwr_unassociated_idle(_adapter *adapter) goto exit; } - if (adapter_to_pwrctl(adapter)->ips_deny_time >= rtw_get_current_time()) { + if (adapter_to_pwrctl(adapter)->ips_deny_time >= jiffies) { /* RTW_INFO("%s ips_deny_time\n", __func__); */ goto exit; } @@ -419,7 +419,7 @@ void traffic_check_for_leave_lps(PADAPTER padapter, u8 tx, u32 tx_packets) xmit_cnt += tx_packets; if (start_time == 0) - start_time = rtw_get_current_time(); + start_time = jiffies; if (rtw_get_passing_time_ms(start_time) > 2000) { /* 2 sec == watch dog timer */ if (xmit_cnt > 8) { @@ -434,7 +434,7 @@ void traffic_check_for_leave_lps(PADAPTER padapter, u8 tx, u32 tx_packets) } } - start_time = rtw_get_current_time(); + start_time = jiffies; xmit_cnt = 0; } @@ -542,7 +542,7 @@ void rtw_set_rpwm(PADAPTER padapter, u8 pslv) u8 cpwm_now; u8 poll_cnt = 0; - start_time = rtw_get_current_time(); + start_time = jiffies; /* polling cpwm */ do { @@ -611,7 +611,7 @@ static u8 PS_RDY_CHECK(_adapter *padapter) return false; #endif - curr_time = rtw_get_current_time(); + curr_time = jiffies; delta_time = curr_time - pwrpriv->DelayLPSLastTimeStamp; @@ -735,7 +735,7 @@ void rtw_set_fw_in_ips_mode(PADAPTER padapter, u8 enable) adapter_to_pwrctl(padapter)->tog = (val8 + 0x80) & 0x80; /* do polling cpwm */ - start_time = rtw_get_current_time(); + start_time = jiffies; do { rtw_mdelay_os(1); @@ -868,7 +868,7 @@ void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode u32 start_time, delay_ms; u8 val8; delay_ms = 20; - start_time = rtw_get_current_time(); + start_time = jiffies; do { rtw_hal_get_hwreg(padapter, HW_VAR_SYS_CLKR, &val8); if (!(val8 & BIT(4))) { /* 0x08 bit4 =1 --> in 32k, bit4 = 0 --> leave 32k */ @@ -994,7 +994,7 @@ s32 LPS_RF_ON_check(PADAPTER 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) @@ -1164,7 +1164,7 @@ void LeaveAllPowerSaveModeDirect(PADAPTER Adapter) #ifndef CONFIG_DETECT_CPWM_BY_POLLING - start_time = rtw_get_current_time(); + start_time = jiffies; /* polling cpwm */ do { @@ -1314,7 +1314,7 @@ void LPS_Leave_check( pwrpriv = adapter_to_pwrctl(padapter); bReady = false; - start_time = rtw_get_current_time(); + start_time = jiffies; rtw_yield_os(); @@ -2241,7 +2241,7 @@ u8 rtw_interface_ps_func(_adapter *padapter, HAL_INTF_PS_FUNC efunc_id, u8 *val) inline void rtw_set_ips_deny(_adapter *padapter, u32 ms) { struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); - pwrpriv->ips_deny_time = rtw_get_current_time() + rtw_ms_to_systime(ms); + pwrpriv->ips_deny_time = jiffies + rtw_ms_to_systime(ms); } /* @@ -2258,7 +2258,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) struct mlme_priv *pmlmepriv; int ret = _SUCCESS; int i; - u32 start = rtw_get_current_time(); + u32 start = jiffies; /* for LPS */ LeaveAllPowerSaveMode(padapter); @@ -2267,8 +2267,8 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) padapter = GET_PRIMARY_ADAPTER(padapter); pmlmepriv = &padapter->mlmepriv; - 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); if (pwrpriv->ps_processing) { @@ -2383,8 +2383,8 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) } 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; } diff --git a/core/rtw_recv.c b/core/rtw_recv.c index bf6fb43..d1d2b78 100755 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -1396,7 +1396,7 @@ sint ap2sta_data_frame( /* RTW_INFO("After send deauth , %u ms has elapsed.\n", rtw_get_passing_time_ms(send_issue_deauth_time)); */ if (rtw_get_passing_time_ms(send_issue_deauth_time) > 10000 || send_issue_deauth_time == 0) { - send_issue_deauth_time = rtw_get_current_time(); + send_issue_deauth_time = jiffies; RTW_INFO("issue_deauth to the ap=" MAC_FMT " for the reason(7)\n", MAC_ARG(pattrib->bssid)); @@ -4076,7 +4076,7 @@ void rx_query_phy_status( if ((start_time == 0) || (rtw_get_passing_time_ms(start_time) > 5000)) { RTW_PRINT("Warning!!! %s: Confilc mac addr!!\n", __func__); - start_time = rtw_get_current_time(); + start_time = jiffies; } pdbgpriv->dbg_rx_conflic_mac_addr_cnt++; } else { diff --git a/core/rtw_security.c b/core/rtw_security.c index 73f24a6..b3a7a00 100644 --- a/core/rtw_security.c +++ b/core/rtw_security.c @@ -830,7 +830,7 @@ u32 rtw_tkip_decrypt(_adapter *padapter, u8 *precvframe) res = _FAIL; if (start == 0) - start = rtw_get_current_time(); + start = jiffies; if (is_broadcast_mac_addr(prxattrib->ra)) no_gkey_bc_cnt++; @@ -842,7 +842,7 @@ u32 rtw_tkip_decrypt(_adapter *padapter, u8 *precvframe) RTW_PRINT(FUNC_ADPT_FMT" no_gkey_bc_cnt:%u, no_gkey_mc_cnt:%u\n", FUNC_ADPT_ARG(padapter), no_gkey_bc_cnt, no_gkey_mc_cnt); } - start = rtw_get_current_time(); + start = jiffies; no_gkey_bc_cnt = 0; no_gkey_mc_cnt = 0; } @@ -1957,7 +1957,7 @@ u32 rtw_aes_decrypt(_adapter *padapter, u8 *precvframe) res = _FAIL; if (start == 0) - start = rtw_get_current_time(); + start = jiffies; if (is_broadcast_mac_addr(prxattrib->ra)) no_gkey_bc_cnt++; @@ -1969,7 +1969,7 @@ u32 rtw_aes_decrypt(_adapter *padapter, u8 *precvframe) RTW_PRINT(FUNC_ADPT_FMT" no_gkey_bc_cnt:%u, no_gkey_mc_cnt:%u\n", FUNC_ADPT_ARG(padapter), no_gkey_bc_cnt, no_gkey_mc_cnt); } - start = rtw_get_current_time(); + start = jiffies; no_gkey_bc_cnt = 0; no_gkey_mc_cnt = 0; } diff --git a/core/rtw_sreset.c b/core/rtw_sreset.c index c5b7505..6282776 100644 --- a/core/rtw_sreset.c +++ b/core/rtw_sreset.c @@ -272,7 +272,7 @@ void sreset_reset(_adapter *padapter) struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct xmit_priv *pxmitpriv = &padapter->xmitpriv; unsigned long irqL; - u32 start = rtw_get_current_time(); + u32 start = jiffies; struct dvobj_priv *psdpriv = padapter->dvobj; struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; diff --git a/core/rtw_tdls.c b/core/rtw_tdls.c index 5579b98..e87dd19 100644 --- a/core/rtw_tdls.c +++ b/core/rtw_tdls.c @@ -222,7 +222,7 @@ int issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsig { 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); @@ -669,7 +669,7 @@ s32 rtw_tdls_do_ch_sw(_adapter *padapter, struct sta_info *ptdls_sta, u8 chnl_ty u8 take_care_iqk; s32 ret = _FAIL; - ch_sw_time_start = rtw_systime_to_ms(rtw_get_current_time()); + ch_sw_time_start = rtw_systime_to_ms(jiffies); rtw_tdls_chsw_oper_init(padapter, TDLS_CH_SWITCH_OPER_OFFLOAD_TIMEOUT); @@ -710,7 +710,7 @@ s32 rtw_tdls_do_ch_sw(_adapter *padapter, struct sta_info *ptdls_sta, u8 chnl_ty if (take_care_iqk == true) rtw_hal_ch_sw_iqk_info_restore(padapter, CH_SW_USE_CASE_TDLS); - ch_sw_time_spent = rtw_systime_to_ms(rtw_get_current_time()) - ch_sw_time_start; + ch_sw_time_spent = rtw_systime_to_ms(jiffies) - ch_sw_time_start; if (chnl_type == TDLS_CH_SW_OFF_CHNL) { if ((u32)ch_switch_time / 1000 > ch_sw_time_spent) @@ -2464,7 +2464,7 @@ void rtw_build_tdls_setup_req_ies(_adapter *padapter, struct xmit_frame *pxmitfr /* SNonce */ if (pattrib->encrypt) { for (i = 0; i < 8; i++) { - time = rtw_get_current_time(); + time = jiffies; memcpy(&ptdls_sta->SNonce[4 * i], (u8 *)&time, 4); } } @@ -2532,7 +2532,7 @@ void rtw_build_tdls_setup_rsp_ies(_adapter *padapter, struct xmit_frame *pxmitfr if (pattrib->encrypt && ptdls_sta != NULL) { for (k = 0; k < 8; k++) { - time = rtw_get_current_time(); + time = jiffies; memcpy(&ptdls_sta->ANonce[4 * k], (u8 *)&time, 4); } } diff --git a/core/rtw_wlan_util.c b/core/rtw_wlan_util.c index 97c6a57..6557da5 100644 --- a/core/rtw_wlan_util.c +++ b/core/rtw_wlan_util.c @@ -453,7 +453,7 @@ inline void rtw_set_oper_ch(_adapter *adapter, u8 ch) struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); if (dvobj->oper_channel != ch) { - dvobj->on_oper_ch_time = rtw_get_current_time(); + dvobj->on_oper_ch_time = jiffies; #ifdef DBG_CH_SWITCH cnt += snprintf(msg + cnt, len - cnt, "switch to ch %3u", ch); diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index 24abbd0..adce453 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -3895,14 +3895,14 @@ s32 rtw_xmit(_adapter *padapter, _pkt **ppkt) DBG_COUNTER(padapter->tx_logs.core_tx); if (start == 0) - start = rtw_get_current_time(); + start = jiffies; pxmitframe = rtw_alloc_xmitframe(pxmitpriv); if (rtw_get_passing_time_ms(start) > 2000) { if (drop_cnt) RTW_INFO("DBG_TX_DROP_FRAME %s no more pxmitframe, drop_cnt:%u\n", __func__, drop_cnt); - start = rtw_get_current_time(); + start = jiffies; drop_cnt = 0; } @@ -5012,7 +5012,7 @@ void rtw_amsdu_cancel_timer(_adapter *padapter, u8 priority) 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; } @@ -5073,7 +5073,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; diff --git a/hal/hal_btcoex.c b/hal/hal_btcoex.c index 831a759..364548f 100644 --- a/hal/hal_btcoex.c +++ b/hal/hal_btcoex.c @@ -362,7 +362,7 @@ void halbtcoutsrc_LeaveLowPower(PBTC_COEXIST pBtCoexist) if (GLBtcBtCoexAliveRegistered == true) return; - stime = rtw_get_current_time(); + stime = jiffies; do { ready = rtw_register_task_alive(padapter, BTCOEX_ALIVE); if (_SUCCESS == ready) @@ -422,7 +422,7 @@ void halbtcoutsrc_AggregationCheck(PBTC_COEXIST pBtCoexist) /* It can only be called after 8 seconds. */ /* ===================================== */ - curTime = rtw_systime_to_ms(rtw_get_current_time()); + curTime = rtw_systime_to_ms(jiffies); if ((curTime - preTime) < HALBTCOUTSRC_AGG_CHK_WINDOW_IN_MS) /* over 8 seconds you can execute this function again. */ return; else diff --git a/hal/hal_com.c b/hal/hal_com.c index 4531a63..3a549c4 100644 --- a/hal/hal_com.c +++ b/hal/hal_com.c @@ -1333,7 +1333,7 @@ int c2h_iqk_offload_wait(_adapter *adapter, u32 timeout_ms) HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter); struct submit_ctx *iqk_sctx = &hal_data->iqk_sctx; - iqk_sctx->submit_time = rtw_get_current_time(); + iqk_sctx->submit_time = jiffies; iqk_sctx->timeout_ms = timeout_ms; iqk_sctx->status = RTW_SCTX_SUBMITTED; @@ -1480,7 +1480,7 @@ int hal_read_mac_hidden_rpt(_adapter *adapter) int ret = _FAIL; int ret_fwdl; u8 mac_hidden_rpt[MAC_HIDDEN_RPT_LEN + MAC_HIDDEN_RPT_2_LEN] = {0}; - u32 start = rtw_get_current_time(); + u32 start = jiffies; u32 cnt = 0; u32 timeout_ms = 800; u32 min_cnt = 10; @@ -1504,7 +1504,7 @@ int hal_read_mac_hidden_rpt(_adapter *adapter) goto mac_hidden_rpt_hdl; /* polling for data ready */ - start = rtw_get_current_time(); + start = jiffies; do { cnt++; id = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL); @@ -1876,7 +1876,7 @@ u32 rtw_sec_read_cam(_adapter *adapter, u8 addr) rtw_write32(adapter, REG_CAMCMD, CAM_POLLINIG | addr); - start = rtw_get_current_time(); + start = jiffies; while (1) { if (rtw_is_surprise_removed(adapter)) { sr = 1; @@ -1892,7 +1892,7 @@ u32 rtw_sec_read_cam(_adapter *adapter, u8 addr) break; } } - end = rtw_get_current_time(); + end = jiffies; rdata = rtw_read32(adapter, REG_CAMREAD); @@ -1919,7 +1919,7 @@ void rtw_sec_write_cam(_adapter *adapter, u8 addr, u32 wdata) rtw_write32(adapter, REG_CAMWRITE, wdata); rtw_write32(adapter, REG_CAMCMD, CAM_POLLINIG | CAM_WRITE | addr); - start = rtw_get_current_time(); + start = jiffies; while (1) { if (rtw_is_surprise_removed(adapter)) { sr = 1; @@ -1935,7 +1935,7 @@ void rtw_sec_write_cam(_adapter *adapter, u8 addr, u32 wdata) break; } } - end = rtw_get_current_time(); + end = jiffies; _exit_critical_mutex(mutex, NULL); @@ -6917,7 +6917,7 @@ static u32 _rtw_wow_pattern_read_cam(_adapter *adapter, u8 addr) rtw_write32(adapter, REG_WKFMCAM_CMD, BIT_WKFCAM_POLLING_V1 | BIT_WKFCAM_ADDR_V2(addr)); - start = rtw_get_current_time(); + start = jiffies; while (1) { if (rtw_is_surprise_removed(adapter)) break; @@ -6988,7 +6988,7 @@ static void _rtw_wow_pattern_write_cam(_adapter *adapter, u8 addr, u32 wdata) rtw_write32(adapter, REG_WKFMCAM_RWD, wdata); rtw_write32(adapter, REG_WKFMCAM_CMD, BIT_WKFCAM_POLLING_V1 | BIT_WKFCAM_WE | BIT_WKFCAM_ADDR_V2(addr)); - start = rtw_get_current_time(); + start = jiffies; while (1) { if (rtw_is_surprise_removed(adapter)) break; @@ -7002,7 +7002,7 @@ static void _rtw_wow_pattern_write_cam(_adapter *adapter, u8 addr, u32 wdata) break; } } - end = rtw_get_current_time(); + end = jiffies; _exit_critical_mutex(mutex, NULL); @@ -7055,7 +7055,7 @@ static u8 _rtw_wow_pattern_clean_cam(_adapter *adapter) _enter_critical_mutex(mutex, NULL); rtw_write32(adapter, REG_WKFMCAM_CMD, BIT_WKFCAM_POLLING_V1 | BIT_WKFCAM_CLR_V1); - start = rtw_get_current_time(); + start = jiffies; while (1) { if (rtw_is_surprise_removed(adapter)) break; diff --git a/hal/hal_intf.c b/hal/hal_intf.c index 8f523ff..b3c65a8 100644 --- a/hal/hal_intf.c +++ b/hal/hal_intf.c @@ -56,7 +56,7 @@ u8 rtw_hal_read_chip_info(_adapter *padapter) { u8 rtn = _SUCCESS; u8 hci_type = rtw_get_intf_type(padapter); - u32 start = rtw_get_current_time(); + u32 start = jiffies; /* before access eFuse, make sure card enable has been called */ if ((hci_type == RTW_SDIO || hci_type == RTW_GSPI) diff --git a/hal/hal_mcc.c b/hal/hal_mcc.c index ee8cae0..859b4cc 100644 --- a/hal/hal_mcc.c +++ b/hal/hal_mcc.c @@ -1059,7 +1059,7 @@ static u8 rtw_hal_set_mcc_setting(PADAPTER padapter, u8 status) u8 ret = _FAIL; struct mcc_obj_priv *pmccobjpriv = &(adapter_to_dvobj(padapter)->mcc_objpriv); u8 stop = (status < MCC_SETCMD_STATUS_START_CONNECT) ? true : false; - u32 start_time = rtw_get_current_time(); + u32 start_time = jiffies; RTW_INFO("===> "FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter)); @@ -1289,14 +1289,14 @@ void rtw_hal_mcc_c2h_handler(PADAPTER padapter, u8 buflen, u8 *tmpBuf) RTW_INFO("[MCC] TXNULL FAIL\n"); break; case MCC_RPT_STOPMCC: - RTW_INFO("[MCC] MCC stop (time:%d)\n", rtw_get_current_time()); + RTW_INFO("[MCC] MCC stop (time:%d)\n", jiffies); pmccobjpriv->mcc_c2h_status = MCC_RPT_STOPMCC; rtw_sctx_done(&mcc_sctx); break; case MCC_RPT_READY: _enter_critical_bh(&pmccobjpriv->mcc_lock, &irqL); /* initialize counter & time */ - pmccobjpriv->mcc_launch_time = rtw_get_current_time(); + pmccobjpriv->mcc_launch_time = jiffies; pmccobjpriv->mcc_c2h_status = MCC_RPT_READY; pmccobjpriv->cur_mcc_success_cnt = 0; pmccobjpriv->prev_mcc_success_cnt = 0; @@ -1811,7 +1811,7 @@ void rtw_hal_mcc_issue_null_data(_adapter *padapter, u8 chbw_allow, u8 ps_mode) { struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); _adapter *iface = NULL; - u32 start = rtw_get_current_time(); + u32 start = jiffies; u8 i = 0; if (!MCC_EN(padapter)) diff --git a/hal/phydm/phydm_interface.c b/hal/phydm/phydm_interface.c index bc79567..facc512 100644 --- a/hal/phydm/phydm_interface.c +++ b/hal/phydm/phydm_interface.c @@ -430,7 +430,7 @@ odm_get_current_time( struct PHY_DM_STRUCT *p_dm_odm ) { - return (u64)rtw_get_current_time(); + return (u64)jiffies; } u64 diff --git a/hal/rtl8188e_hal_init.c b/hal/rtl8188e_hal_init.c index 4395672..ca29e33 100644 --- a/hal/rtl8188e_hal_init.c +++ b/hal/rtl8188e_hal_init.c @@ -63,7 +63,7 @@ static s32 iol_execute(PADAPTER padapter, u8 control) /* RTW_INFO("%s reg_0x88:0x%02x, write 0x%02x\n", __func__, reg_0x88, reg_0x88|control); */ rtw_write8(padapter, REG_HMEBOX_E0, reg_0x88 | control); - t1 = start = rtw_get_current_time(); + t1 = start = jiffies; while ( /* (reg_1c7 = rtw_read8(padapter, 0x1c7) >1) && */ (reg_0x88 = rtw_read8(padapter, REG_HMEBOX_E0)) & control @@ -77,7 +77,7 @@ static s32 iol_execute(PADAPTER padapter, u8 control) status = (reg_0x88 & control) ? _FAIL : _SUCCESS; if (reg_0x88 & control << 4) status = _FAIL; - t2 = rtw_get_current_time(); + t2 = jiffies; return status; } @@ -287,7 +287,7 @@ static void efuse_read_phymap_from_txpktbuf( /* RTW_INFO("%s write reg_0x143:0x00\n", __func__); */ rtw_write8(adapter, REG_TXPKTBUF_DBG, 0); - start = rtw_get_current_time(); + start = jiffies; while (!(reg_0x143 = rtw_read8(adapter, REG_TXPKTBUF_DBG)) /* dbg */ /* while(rtw_read8(adapter, REG_TXPKTBUF_DBG) & BIT0 */ && (passing_time = rtw_get_passing_time_ms(start)) < 1000 @@ -410,7 +410,7 @@ static s32 iol_ioconfig( static int rtl8188e_IOL_exec_cmds_sync(ADAPTER *adapter, struct xmit_frame *xmit_frame, u32 max_wating_ms, u32 bndy_cnt) { - u32 start_time = rtw_get_current_time(); + u32 start_time = jiffies; u32 passing_time_ms; u8 polling_ret, i; int ret = _FAIL; @@ -432,7 +432,7 @@ static int rtl8188e_IOL_exec_cmds_sync(ADAPTER *adapter, struct xmit_frame *xmit dump_mgntframe_and_wait(adapter, xmit_frame, max_wating_ms); - t1 = rtw_get_current_time(); + t1 = jiffies; iol_mode_enable(adapter, 1); for (i = 0; i < bndy_cnt; i++) { u8 page_no = 0; @@ -442,7 +442,7 @@ static int rtl8188e_IOL_exec_cmds_sync(ADAPTER *adapter, struct xmit_frame *xmit break; } iol_mode_enable(adapter, 0); - t2 = rtw_get_current_time(); + t2 = jiffies; exit: /* restore BCN_HEAD */ rtw_write8(adapter, REG_TDECTRL + 1, 0); @@ -693,7 +693,7 @@ static s32 polling_fwdl_chksum(_adapter *adapter, u32 min_cnt, u32 timeout_ms) { s32 ret = _FAIL; u32 value32; - u32 start = rtw_get_current_time(); + u32 start = jiffies; u32 cnt = 0; /* polling CheckSum report */ @@ -724,7 +724,7 @@ static s32 _FWFreeToGo(_adapter *adapter, u32 min_cnt, u32 timeout_ms) { s32 ret = _FAIL; u32 value32; - u32 start = rtw_get_current_time(); + u32 start = jiffies; u32 cnt = 0; value32 = rtw_read32(adapter, REG_MCUFWDL); @@ -909,7 +909,7 @@ s32 rtl8188e_FirmwareDownload(PADAPTER padapter, bool bUsedWoWLANFw) } _FWDownloadEnable_8188E(padapter, true); - fwdl_start_time = rtw_get_current_time(); + fwdl_start_time = jiffies; while (!RTW_CANNOT_IO(padapter) && (write_fw++ < 3 || rtw_get_passing_time_ms(fwdl_start_time) < 500)) { /* reset FWDL chksum */ @@ -4174,7 +4174,7 @@ void SetHwReg8188E(_adapter *adapter, u8 variable, u8 *val) u16 val16; u32 reg_200 = 0, reg_204 = 0; u32 init_reg_200 = 0, init_reg_204 = 0; - u32 start = rtw_get_current_time(); + u32 start = jiffies; u32 pass_ms; int i = 0; diff --git a/hal/rtl8188e_sreset.c b/hal/rtl8188e_sreset.c index 33d6d35..32d3a39 100644 --- a/hal/rtl8188e_sreset.c +++ b/hal/rtl8188e_sreset.c @@ -39,7 +39,7 @@ void rtl8188e_sreset_xmit_status_check(_adapter *padapter) RTW_INFO("%s REG_TXDMA_STATUS:0x%08x\n", __func__, txdma_status); rtw_hal_sreset_reset(padapter); } - current_time = rtw_get_current_time(); + current_time = jiffies; if (0 == pxmitpriv->free_xmitbuf_cnt || 0 == pxmitpriv->free_xmit_extbuf_cnt) { diff --git a/hal/usb_halinit.c b/hal/usb_halinit.c index 04b27e5..74d8de1 100644 --- a/hal/usb_halinit.c +++ b/hal/usb_halinit.c @@ -1064,7 +1064,7 @@ static u32 rtl8188eu_hal_init(PADAPTER Adapter) struct btcoexist_priv *pbtpriv = &(pHalData->bt_coexist); #endif - u32 init_start_time = rtw_get_current_time(); + u32 init_start_time = jiffies; #ifdef DBG_HAL_INIT_PROFILING @@ -1133,7 +1133,7 @@ static u32 rtl8188eu_hal_init(PADAPTER Adapter) for (hal_init_profiling_i = 0; hal_init_profiling_i < HAL_INIT_STAGES_NUM; hal_init_profiling_i++) hal_init_stages_timestamp[hal_init_profiling_i] = 0; -#define HAL_INIT_PROFILE_TAG(stage) do { hal_init_stages_timestamp[(stage)] = rtw_get_current_time(); } while (0) +#define HAL_INIT_PROFILE_TAG(stage) do { hal_init_stages_timestamp[(stage)] = jiffies; } while (0) #else #define HAL_INIT_PROFILE_TAG(stage) do {} while (0) #endif /* DBG_HAL_INIT_PROFILING */ @@ -1463,7 +1463,7 @@ exit: RTW_INFO("%s in %dms\n", __func__, rtw_get_passing_time_ms(init_start_time)); #ifdef DBG_HAL_INIT_PROFILING - hal_init_stages_timestamp[HAL_INIT_STAGES_END] = rtw_get_current_time(); + hal_init_stages_timestamp[HAL_INIT_STAGES_END] = jiffies; for (hal_init_profiling_i = 0; hal_init_profiling_i < HAL_INIT_STAGES_NUM - 1; hal_init_profiling_i++) { RTW_INFO("DBG_HAL_INIT_PROFILING: %35s, %u, %5u, %5u\n" diff --git a/include/drv_types.h b/include/drv_types.h index 432974a..e932563 100644 --- a/include/drv_types.h +++ b/include/drv_types.h @@ -771,8 +771,8 @@ struct rf_ctl_t { #define RTW_CAC_STOPPED 0 #define IS_CAC_STOPPED(rfctl) ((rfctl)->cac_end_time == RTW_CAC_STOPPED) -#define IS_CH_WAITING(rfctl) (!IS_CAC_STOPPED(rfctl) && time_after((unsigned long)(rfctl)->cac_end_time, (unsigned long)rtw_get_current_time())) -#define IS_UNDER_CAC(rfctl) (IS_CH_WAITING(rfctl) && time_after((unsigned long)rtw_get_current_time(), (unsigned long)(rfctl)->cac_start_time)) +#define IS_CH_WAITING(rfctl) (!IS_CAC_STOPPED(rfctl) && time_after((unsigned long)(rfctl)->cac_end_time, (unsigned long)jiffies)) +#define IS_UNDER_CAC(rfctl) (IS_CH_WAITING(rfctl) && time_after((unsigned long)jiffies, (unsigned long)(rfctl)->cac_start_time)) #ifdef CONFIG_MBSSID_CAM #define TOTAL_MBID_CAM_NUM 8 diff --git a/include/osdep_service.h b/include/osdep_service.h index 41578bb..f3ec69f 100644 --- a/include/osdep_service.h +++ b/include/osdep_service.h @@ -268,7 +268,6 @@ extern void _rtw_init_queue(_queue *pqueue); extern u32 _rtw_queue_empty(_queue *pqueue); extern u32 rtw_end_of_queue_search(_list *queue, _list *pelement); -extern u32 rtw_get_current_time(void); extern u32 rtw_systime_to_ms(u32 systime); extern u32 rtw_ms_to_systime(u32 ms); extern s32 rtw_get_passing_time_ms(u32 start); diff --git a/include/rtw_mlme_ext.h b/include/rtw_mlme_ext.h index 73cd9a2..7f908ea 100644 --- a/include/rtw_mlme_ext.h +++ b/include/rtw_mlme_ext.h @@ -506,7 +506,7 @@ void rtw_rfctl_init(_adapter *adapter); #ifdef CONFIG_DFS_MASTER struct rf_ctl_t; -#define CH_IS_NON_OCP(rt_ch_info) (time_after((unsigned long)(rt_ch_info)->non_ocp_end_time, (unsigned long)rtw_get_current_time())) +#define CH_IS_NON_OCP(rt_ch_info) (time_after((unsigned long)(rt_ch_info)->non_ocp_end_time, (unsigned long)jiffies)) bool rtw_is_cac_reset_needed(_adapter *adapter, u8 ch, u8 bw, u8 offset); bool _rtw_rfctl_overlap_radar_detect_ch(struct rf_ctl_t *rfctl, u8 ch, u8 bw, u8 offset); bool rtw_rfctl_overlap_radar_detect_ch(struct rf_ctl_t *rfctl); diff --git a/os_dep/ioctl_cfg80211.c b/os_dep/ioctl_cfg80211.c index 8efcc94..59777af 100644 --- a/os_dep/ioctl_cfg80211.c +++ b/os_dep/ioctl_cfg80211.c @@ -1877,7 +1877,7 @@ u32 rtw_cfg80211_wait_scan_req_empty(_adapter *adapter, u32 timeout_ms) u32 start; u32 pass_ms; - start = rtw_get_current_time(); + start = jiffies; while (rtw_get_passing_time_ms(start) <= timeout_ms) { @@ -5027,7 +5027,7 @@ static s32 cfg80211_rtw_remain_on_channel(struct wiphy *wiphy, RTW_INFO(FUNC_ADPT_FMT" init listen_channel %u\n" , FUNC_ADPT_ARG(padapter), padapter->wdinfo.listen_channel); } else if (rtw_p2p_chk_state(pwdinfo , P2P_STATE_LISTEN) - && (time_after_eq((unsigned long)rtw_get_current_time(), (unsigned long)pwdev_priv->probe_resp_ie_update_time) + && (time_after_eq((unsigned long)jiffies, (unsigned long)pwdev_priv->probe_resp_ie_update_time) && rtw_get_passing_time_ms(pwdev_priv->probe_resp_ie_update_time) < 50) ) { if (padapter->wdinfo.listen_channel != remain_ch) { @@ -5069,7 +5069,7 @@ static s32 cfg80211_rtw_remain_on_channel(struct wiphy *wiphy, rtw_cfg80211_set_is_roch(padapter, true); pcfg80211_wdinfo->ro_ch_wdev = wdev; pcfg80211_wdinfo->remain_on_ch_cookie = *cookie; - pcfg80211_wdinfo->last_ro_ch_time = rtw_get_current_time(); + pcfg80211_wdinfo->last_ro_ch_time = jiffies; memcpy(&pcfg80211_wdinfo->remain_on_ch_channel, channel, sizeof(struct ieee80211_channel)); #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)) pcfg80211_wdinfo->remain_on_ch_type = channel_type; @@ -5592,7 +5592,7 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, u8 category, action; u8 frame_styp; int type = (-1); - u32 start = rtw_get_current_time(); + u32 start = jiffies; _adapter *padapter; struct dvobj_priv *dvobj; struct rtw_wdev_priv *pwdev_priv; @@ -6373,7 +6373,7 @@ int rtw_cfg80211_set_mgnt_wpsp2pie(struct net_device *net, char *buf, int len, ret = rtw_cfg80211_set_probe_resp_wpsp2pie(net, buf, len); #ifdef CONFIG_P2P if (ret == 0) - adapter_wdev_data((_adapter *)rtw_netdev_priv(net))->probe_resp_ie_update_time = rtw_get_current_time(); + adapter_wdev_data((_adapter *)rtw_netdev_priv(net))->probe_resp_ie_update_time = jiffies; #endif break; case 0x4: /* ASSOC_RESP */ @@ -6920,7 +6920,7 @@ int rtw_wdev_alloc(_adapter *padapter, struct wiphy *wiphy) spin_lock_init(&pwdev_priv->scan_req_lock); pwdev_priv->p2p_enabled = false; - pwdev_priv->probe_resp_ie_update_time = rtw_get_current_time(); + pwdev_priv->probe_resp_ie_update_time = jiffies; pwdev_priv->provdisc_req_issued = false; rtw_wdev_invit_info_init(&pwdev_priv->invit_info); rtw_wdev_nego_info_init(&pwdev_priv->nego_info); diff --git a/os_dep/ioctl_linux.c b/os_dep/ioctl_linux.c index 27295bf..1d64fbc 100644 --- a/os_dep/ioctl_linux.c +++ b/os_dep/ioctl_linux.c @@ -7894,7 +7894,7 @@ static int rtw_wowlan_ctrl(struct net_device *dev, struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct sta_info *psta = NULL; int ret = 0; - u32 start_time = rtw_get_current_time(); + u32 start_time = jiffies; poidparam.subcode = 0; RTW_INFO("+rtw_wowlan_ctrl: %s\n", extra); @@ -7963,7 +7963,7 @@ static int rtw_wowlan_set_pattern(struct net_device *dev, struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wowlan_ioctl_param poidparam; int ret = 0, len = 0, i = 0; - u32 start_time = rtw_get_current_time(); + u32 start_time = jiffies; u8 input[wrqu->data.length]; u8 index = 0; @@ -8034,7 +8034,7 @@ static int rtw_ap_wowlan_ctrl(struct net_device *dev, struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct sta_info *psta = NULL; int ret = 0; - u32 start_time = rtw_get_current_time(); + u32 start_time = jiffies; poidparam.subcode = 0; RTW_INFO("+rtw_ap_wowlan_ctrl: %s\n", extra); diff --git a/os_dep/os_intfs.c b/os_dep/os_intfs.c index 6708a7c..eabe3bf 100644 --- a/os_dep/os_intfs.c +++ b/os_dep/os_intfs.c @@ -2894,7 +2894,7 @@ int rtw_ips_pwr_up(_adapter *padapter) #ifdef DBG_CONFIG_ERROR_DETECT struct sreset_priv *psrtpriv = &pHalData->srestpriv; #endif/* #ifdef DBG_CONFIG_ERROR_DETECT */ - u32 start_time = rtw_get_current_time(); + u32 start_time = jiffies; RTW_INFO("===> rtw_ips_pwr_up..............\n"); #if defined(CONFIG_SWLPS_IN_IPS) || defined(CONFIG_FWLPS_IN_IPS) @@ -2915,7 +2915,7 @@ int rtw_ips_pwr_up(_adapter *padapter) void rtw_ips_pwr_down(_adapter *padapter) { - u32 start_time = rtw_get_current_time(); + u32 start_time = jiffies; RTW_INFO("===> rtw_ips_pwr_down...................\n"); padapter->net_closed = true; @@ -3770,7 +3770,7 @@ int rtw_suspend_common(_adapter *padapter) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; int ret = 0; - u32 start_time = rtw_get_current_time(); + u32 start_time = jiffies; RTW_INFO(" suspend start\n"); RTW_INFO("==> %s (%s:%d)\n", __func__, current->comm, current->pid); @@ -4226,7 +4226,7 @@ exit: int rtw_resume_common(_adapter *padapter) { int ret = 0; - u32 start_time = rtw_get_current_time(); + u32 start_time = jiffies; struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index d3b7d92..07cf2ad 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -352,7 +352,7 @@ void rtw_mstat_update(const enum mstat_f flags, const MSTAT_STATUS status, u32 s /* if (rtw_get_passing_time_ms(update_time) > 5000) { */ /* rtw_mstat_dump(RTW_DBGDUMP); */ - update_time = rtw_get_current_time(); + update_time = jiffies; /* } */ } @@ -756,12 +756,6 @@ u32 rtw_end_of_queue_search(_list *head, _list *plist) return false; } - -u32 rtw_get_current_time(void) -{ - return jiffies; -} - inline u32 rtw_systime_to_ms(u32 systime) { return systime * 1000 / HZ; diff --git a/os_dep/recv_linux.c b/os_dep/recv_linux.c index 005ac28..5296249 100644 --- a/os_dep/recv_linux.c +++ b/os_dep/recv_linux.c @@ -507,16 +507,17 @@ void rtw_handle_tkip_mic_err(_adapter *padapter, struct sta_info *sta, 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(); + } else { + psecuritypriv->last_mic_err_time = jiffies; + } } #ifdef CONFIG_IOCTL_CFG80211 diff --git a/os_dep/usb_intf.c b/os_dep/usb_intf.c index eb3ab66..9377d66 100644 --- a/os_dep/usb_intf.c +++ b/os_dep/usb_intf.c @@ -793,7 +793,7 @@ static int rtw_resume(struct usb_interface *pusb_intf) } } - pmlmeext->last_scan_time = rtw_get_current_time(); + pmlmeext->last_scan_time = jiffies; RTW_INFO("<======== %s return %d\n", __func__, ret); return ret; diff --git a/os_dep/usb_ops_linux.c b/os_dep/usb_ops_linux.c index 486f93e..3a27893 100644 --- a/os_dep/usb_ops_linux.c +++ b/os_dep/usb_ops_linux.c @@ -485,7 +485,7 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs) #ifdef DBG_CONFIG_ERROR_DETECT { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); - pHalData->srestpriv.last_tx_complete_time = rtw_get_current_time(); + pHalData->srestpriv.last_tx_complete_time = jiffies; } #endif @@ -604,7 +604,7 @@ u32 usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem) #ifdef DBG_CONFIG_ERROR_DETECT { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); - pHalData->srestpriv.last_tx_time = rtw_get_current_time(); + pHalData->srestpriv.last_tx_time = jiffies; } #endif } else {