From 7a5f134424805b006dbaa5603a65dd6001e17644 Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Thu, 14 Oct 2021 21:34:26 +0200 Subject: [PATCH] Replace rtw_get_current_time() with jiffies Port of c01fb49636b65ceea513c00966c58b8bdb095c8f --- core/efuse/rtw_efuse.c | 2 +- core/mesh/rtw_mesh.c | 28 +++++++++++----------- core/mesh/rtw_mesh.h | 8 +++---- core/mesh/rtw_mesh_hwmp.c | 40 ++++++++++++++++---------------- core/mesh/rtw_mesh_pathtbl.c | 14 +++++------ core/rtw_beamforming.c | 2 +- core/rtw_chplan.c | 2 +- core/rtw_cmd.c | 10 ++++---- core/rtw_debug.c | 2 +- core/rtw_mlme.c | 16 ++++++------- core/rtw_mlme_ext.c | 40 ++++++++++++++++---------------- core/rtw_p2p.c | 2 +- core/rtw_pwrctrl.c | 38 +++++++++++++++--------------- core/rtw_recv.c | 10 ++++---- 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 | 30 ++++++++++++------------ hal/hal_halmac.c | 4 ++-- hal/hal_intf.c | 4 ++-- hal/hal_mcc.c | 6 ++--- hal/phydm/phydm_interface.c | 6 ++--- hal/rtl8192e/rtl8192e_hal_init.c | 10 ++++---- hal/rtl8192e/rtl8192e_sreset.c | 2 +- hal/rtl8192e/usb/usb_halinit.c | 6 ++--- hal/rtl8192e/usb/usb_ops_linux.c | 2 +- include/drv_types.h | 4 ++-- include/osdep_service.h | 3 --- include/rtw_mlme_ext.h | 2 +- os_dep/linux/ioctl_cfg80211.c | 16 ++++++------- os_dep/linux/ioctl_linux.c | 6 ++--- os_dep/linux/os_intfs.c | 12 +++++----- os_dep/linux/recv_linux.c | 6 ++--- os_dep/linux/rtw_cfgvendor.c | 4 ++-- os_dep/linux/usb_intf.c | 2 +- os_dep/linux/usb_ops_linux.c | 4 ++-- os_dep/osdep_service.c | 33 ++++++++++---------------- 40 files changed, 199 insertions(+), 211 deletions(-) diff --git a/core/efuse/rtw_efuse.c b/core/efuse/rtw_efuse.c index 4c0043a..1c3eb8d 100644 --- a/core/efuse/rtw_efuse.c +++ b/core/efuse/rtw_efuse.c @@ -1952,7 +1952,7 @@ ReadEFuseByte( u32 value32; u8 readbyte; u16 retry; - /* systime start=rtw_get_current_time(); */ + /* systime start=jiffies; */ if (bPseudoTest) { Efuse_Read1ByteFromFakeContent(Adapter, _offset, pbuf); diff --git a/core/mesh/rtw_mesh.c b/core/mesh/rtw_mesh.c index 1807993..95349ba 100644 --- a/core/mesh/rtw_mesh.c +++ b/core/mesh/rtw_mesh.c @@ -269,7 +269,7 @@ void rtw_mesh_update_scanned_acnode_status(_adapter *adapter, struct wlan_networ acnode = !nop && accept; if (acnode && scanned->acnode_stime == 0) { - scanned->acnode_stime = rtw_get_current_time(); + scanned->acnode_stime = jiffies; if (scanned->acnode_stime == 0) scanned->acnode_stime++; } else if (!acnode) { @@ -288,7 +288,7 @@ bool rtw_mesh_scanned_is_acnode_confirmed(_adapter *adapter, struct wlan_network static bool rtw_mesh_scanned_is_acnode_allow_notify(_adapter *adapter, struct wlan_network *scanned) { return scanned->acnode_notify_etime - && rtw_time_after(scanned->acnode_notify_etime, rtw_get_current_time()); + && rtw_time_after(scanned->acnode_notify_etime, jiffies); } bool rtw_mesh_acnode_prevent_allow_sacrifice(_adapter *adapter) @@ -466,7 +466,7 @@ static void rtw_mesh_acnode_set_notify_etime(_adapter *adapter, u8 *rframe_whdr) struct wlan_network *scanned = rtw_find_network(&adapter->mlmepriv.scanned_queue, get_addr2_ptr(rframe_whdr)); if (rtw_mesh_scanned_is_acnode_confirmed(adapter, scanned)) { - scanned->acnode_notify_etime = rtw_get_current_time() + scanned->acnode_notify_etime = jiffies + rtw_ms_to_systime(adapter->mesh_cfg.peer_sel_policy.acnode_notify_timeout_ms); if (scanned->acnode_notify_etime == 0) scanned->acnode_notify_etime++; @@ -631,7 +631,7 @@ static void rtw_mesh_cto_mgate_blacklist_chk(_adapter *adapter) ent = LIST_CONTAINOR(list, struct blacklist_ent, list); list = get_next(list); - if (rtw_time_after(rtw_get_current_time(), ent->exp_time)) { + if (rtw_time_after(jiffies, ent->exp_time)) { rtw_list_delete(&ent->list); rtw_mfree(ent, sizeof(struct blacklist_ent)); continue; @@ -2344,7 +2344,7 @@ void dump_mesh_plink_ctl(void *sel, _adapter *adapter) #if CONFIG_RTW_MESH_PEER_BLACKLIST if (!IS_PEER_CONF_DISABLED(ent)) { if (!IS_PEER_CONF_TIMEOUT(ent)) - RTW_PRINT_SEL(sel, "peer_conf:%d\n", rtw_systime_to_ms(ent->peer_conf_end_time - rtw_get_current_time())); + RTW_PRINT_SEL(sel, "peer_conf:%d\n", rtw_systime_to_ms(ent->peer_conf_end_time - jiffies)); else RTW_PRINT_SEL(sel, "peer_conf:TIMEOUT\n"); } @@ -2353,7 +2353,7 @@ void dump_mesh_plink_ctl(void *sel, _adapter *adapter) #if CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST if (!IS_CTO_MGATE_CONF_DISABLED(ent)) { if (!IS_CTO_MGATE_CONF_TIMEOUT(ent)) - RTW_PRINT_SEL(sel, "cto_mgate_conf:%d\n", rtw_systime_to_ms(ent->cto_mgate_conf_end_time - rtw_get_current_time())); + RTW_PRINT_SEL(sel, "cto_mgate_conf:%d\n", rtw_systime_to_ms(ent->cto_mgate_conf_end_time - jiffies)); else RTW_PRINT_SEL(sel, "cto_mgate_conf:TIMEOUT\n"); } @@ -2924,7 +2924,7 @@ static int rtw_mrc_check(_adapter *adapter, const u8 *msa, u32 seq) idx = seq & mrc->idx_mask; rtw_hlist_for_each_entry_safe(p, np, n, &mrc->bucket[idx], list) { ++entries; - timeout = rtw_time_after(rtw_get_current_time(), p->exp_time); + timeout = rtw_time_after(jiffies, p->exp_time); if (timeout || entries == RTW_MRC_QUEUE_MAX_LEN) { if (!timeout) minfo->mshstats.mrc_del_qlen++; @@ -2941,7 +2941,7 @@ static int rtw_mrc_check(_adapter *adapter, const u8 *msa, u32 seq) return 0; p->seqnum = seq; - p->exp_time = rtw_get_current_time() + rtw_ms_to_systime(RTW_MRC_TIMEOUT_MS); + p->exp_time = jiffies + rtw_ms_to_systime(RTW_MRC_TIMEOUT_MS); memcpy(p->msa, msa, ETH_ALEN); rtw_hlist_add_head(&p->list, &mrc->bucket[idx]); return 0; @@ -3081,9 +3081,9 @@ void rtw_mesh_init_mesh_info(_adapter *adapter) rtw_mesh_plink_ctl_init(adapter); - minfo->last_preq = rtw_get_current_time(); - /* minfo->last_sn_update = rtw_get_current_time(); */ - minfo->next_perr = rtw_get_current_time(); + minfo->last_preq = jiffies; + /* minfo->last_sn_update = jiffies; */ + minfo->next_perr = jiffies; atomic_set(&minfo->mpaths, 0); rtw_mesh_pathtbl_init(adapter); @@ -3213,7 +3213,7 @@ int rtw_mesh_nexthop_lookup(_adapter *adapter, if (!mpath || !(mpath->flags & RTW_MESH_PATH_ACTIVE)) goto endlookup; - if (rtw_time_after(rtw_get_current_time(), + if (rtw_time_after(jiffies, mpath->exp_time - rtw_ms_to_systime(adapter->mesh_cfg.path_refresh_time)) && _rtw_memcmp(adapter_mac_addr(adapter), msa, ETH_ALEN) == _TRUE && @@ -3366,7 +3366,7 @@ int rtw_mesh_addr_resolve(_adapter *adapter, struct xmit_frame *xframe, _pkt *pk if (mpp_lookup) { mppath = rtw_mpp_path_lookup(adapter, etherhdr.h_dest); if (mppath) - mppath->exp_time = rtw_get_current_time(); + mppath->exp_time = jiffies; } if (mppath && mpath) @@ -3801,7 +3801,7 @@ int rtw_mesh_rx_msdu_act_check(union recv_frame *rframe enter_critical_bh(&mppath->state_lock); if (_rtw_memcmp(mppath->mpp, mpp_addr, ETH_ALEN) == _FALSE) memcpy(mppath->mpp, mpp_addr, ETH_ALEN); - mppath->exp_time = rtw_get_current_time(); + mppath->exp_time = jiffies; exit_critical_bh(&mppath->state_lock); } rtw_rcu_read_unlock(); diff --git a/core/mesh/rtw_mesh.h b/core/mesh/rtw_mesh.h index 63d66d8..b8fae8e 100644 --- a/core/mesh/rtw_mesh.h +++ b/core/mesh/rtw_mesh.h @@ -155,11 +155,11 @@ enum rtw_mesh_deferred_task_flags { #define RTW_MESH_PEER_CONF_DISABLED 0 /* special time value means no confirmation ongoing */ #if CONFIG_RTW_MESH_PEER_BLACKLIST #define IS_PEER_CONF_DISABLED(plink) ((plink)->peer_conf_end_time == RTW_MESH_PEER_CONF_DISABLED) -#define IS_PEER_CONF_TIMEOUT(plink)(!IS_PEER_CONF_DISABLED(plink) && rtw_time_after(rtw_get_current_time(), (plink)->peer_conf_end_time)) +#define IS_PEER_CONF_TIMEOUT(plink)(!IS_PEER_CONF_DISABLED(plink) && rtw_time_after(jiffies, (plink)->peer_conf_end_time)) #define SET_PEER_CONF_DISABLED(plink) (plink)->peer_conf_end_time = RTW_MESH_PEER_CONF_DISABLED #define SET_PEER_CONF_END_TIME(plink, timeout_ms) \ do { \ - (plink)->peer_conf_end_time = rtw_get_current_time() + rtw_ms_to_systime(timeout_ms); \ + (plink)->peer_conf_end_time = jiffies + rtw_ms_to_systime(timeout_ms); \ if ((plink)->peer_conf_end_time == RTW_MESH_PEER_CONF_DISABLED) \ (plink)->peer_conf_end_time++; \ } while (0) @@ -173,11 +173,11 @@ enum rtw_mesh_deferred_task_flags { #define RTW_MESH_CTO_MGATE_CONF_DISABLED 0 /* special time value means no confirmation ongoing */ #if CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST #define IS_CTO_MGATE_CONF_DISABLED(plink) ((plink)->cto_mgate_conf_end_time == RTW_MESH_CTO_MGATE_CONF_DISABLED) -#define IS_CTO_MGATE_CONF_TIMEOUT(plink)(!IS_CTO_MGATE_CONF_DISABLED(plink) && rtw_time_after(rtw_get_current_time(), (plink)->cto_mgate_conf_end_time)) +#define IS_CTO_MGATE_CONF_TIMEOUT(plink)(!IS_CTO_MGATE_CONF_DISABLED(plink) && rtw_time_after(jiffies, (plink)->cto_mgate_conf_end_time)) #define SET_CTO_MGATE_CONF_DISABLED(plink) (plink)->cto_mgate_conf_end_time = RTW_MESH_CTO_MGATE_CONF_DISABLED #define SET_CTO_MGATE_CONF_END_TIME(plink, timeout_ms) \ do { \ - (plink)->cto_mgate_conf_end_time = rtw_get_current_time() + rtw_ms_to_systime(timeout_ms); \ + (plink)->cto_mgate_conf_end_time = jiffies + rtw_ms_to_systime(timeout_ms); \ if ((plink)->cto_mgate_conf_end_time == RTW_MESH_CTO_MGATE_CONF_DISABLED) \ (plink)->cto_mgate_conf_end_time++; \ } while (0) diff --git a/core/mesh/rtw_mesh_hwmp.c b/core/mesh/rtw_mesh_hwmp.c index 8d76622..879372e 100644 --- a/core/mesh/rtw_mesh_hwmp.c +++ b/core/mesh/rtw_mesh_hwmp.c @@ -146,7 +146,7 @@ static inline u16 rtw_u16_field_get(const u8 *preq_elem, int shift, BOOLEAN ae) #define RTW_PERR_IE_TARGET_RCODE(x) rtw_u16_field_get(x, 13, 0) #define RTW_TU_TO_SYSTIME(x) (rtw_us_to_systime((x) * 1024)) -#define RTW_TU_TO_EXP_TIME(x) (rtw_get_current_time() + RTW_TU_TO_SYSTIME(x)) +#define RTW_TU_TO_EXP_TIME(x) (jiffies + RTW_TU_TO_SYSTIME(x)) #define RTW_MSEC_TO_TU(x) (x*1000/1024) #define RTW_SN_GT(x, y) ((s32)(y - x) < 0) #define RTW_SN_LT(x, y) ((s32)(x - y) < 0) @@ -335,7 +335,7 @@ int rtw_mesh_path_error_tx(_adapter *adapter, u8 *pos, ie_len; u16 *fctrl = NULL; - if (rtw_time_before(rtw_get_current_time(), minfo->next_perr)) + if (rtw_time_before(jiffies, minfo->next_perr)) return -1; pmgntframe = alloc_mgtxmitframe(pxmitpriv); @@ -669,11 +669,11 @@ static void rtw_hwmp_preq_frame_process(_adapter *adapter, reply = _TRUE; to_gate_ask = 1; target_metric = 0; - if (rtw_time_after(rtw_get_current_time(), minfo->last_sn_update + + if (rtw_time_after(jiffies, minfo->last_sn_update + rtw_net_traversal_jiffies(adapter)) || - rtw_time_before(rtw_get_current_time(), minfo->last_sn_update)) { + rtw_time_before(jiffies, minfo->last_sn_update)) { ++minfo->sn; - minfo->last_sn_update = rtw_get_current_time(); + minfo->last_sn_update = jiffies; } target_sn = minfo->sn; } else if (is_broadcast_mac_addr(target_addr) && @@ -686,7 +686,7 @@ static void rtw_hwmp_preq_frame_process(_adapter *adapter, target_addr = adapter_mac_addr(adapter); target_sn = ++minfo->sn; target_metric = 0; - minfo->last_sn_update = rtw_get_current_time(); + minfo->last_sn_update = jiffies; } if (preq_is_gate) { @@ -998,9 +998,9 @@ static void rtw_hwmp_rann_frame_process(_adapter *adapter, } if ((!(path->flags & (RTW_MESH_PATH_ACTIVE | RTW_MESH_PATH_RESOLVING)) || - (rtw_time_after(rtw_get_current_time(), path->last_preq_to_root + + (rtw_time_after(jiffies, path->last_preq_to_root + rtw_root_path_confirmation_jiffies(adapter)) || - rtw_time_before(rtw_get_current_time(), path->last_preq_to_root))) && + rtw_time_before(jiffies, path->last_preq_to_root))) && !(path->flags & RTW_MESH_PATH_FIXED) && (ttl != 0)) { u8 preq_node_flag = RTW_PREQ_Q_F_START | RTW_PREQ_Q_F_REFRESH; @@ -1022,7 +1022,7 @@ static void rtw_hwmp_rann_frame_process(_adapter *adapter, } #endif rtw_mesh_queue_preq(path, preq_node_flag); - path->last_preq_to_root = rtw_get_current_time(); + path->last_preq_to_root = jiffies; } path->sn = originator_sn; @@ -1325,12 +1325,12 @@ void rtw_mesh_queue_preq(struct rtw_mesh_path *path, u8 flags) ++minfo->preq_queue_len; exit_critical_bh(&minfo->mesh_preq_queue_lock); - if (rtw_time_after(rtw_get_current_time(), minfo->last_preq + rtw_min_preq_int_jiff(adapter))) + if (rtw_time_after(jiffies, minfo->last_preq + rtw_min_preq_int_jiff(adapter))) rtw_mesh_work(&adapter->mesh_work); - else if (rtw_time_before(rtw_get_current_time(), minfo->last_preq)) { + else if (rtw_time_before(jiffies, minfo->last_preq)) { /* systime wrapped around issue */ - minfo->last_preq = rtw_get_current_time() - rtw_min_preq_int_jiff(adapter) - 1; + minfo->last_preq = jiffies - rtw_min_preq_int_jiff(adapter) - 1; rtw_mesh_work(&adapter->mesh_work); } else rtw_mod_timer(&adapter->mesh_path_timer, minfo->last_preq + @@ -1372,7 +1372,7 @@ void rtw_mesh_path_start_discovery(_adapter *adapter) enter_critical_bh(&minfo->mesh_preq_queue_lock); if (!minfo->preq_queue_len || - rtw_time_before(rtw_get_current_time(), minfo->last_preq + + rtw_time_before(jiffies, minfo->last_preq + rtw_min_preq_int_jiff(adapter))) { exit_critical_bh(&minfo->mesh_preq_queue_lock); return; @@ -1412,13 +1412,13 @@ void rtw_mesh_path_start_discovery(_adapter *adapter) goto enddiscovery; } - minfo->last_preq = rtw_get_current_time(); + minfo->last_preq = jiffies; - if (rtw_time_after(rtw_get_current_time(), minfo->last_sn_update + + if (rtw_time_after(jiffies, minfo->last_sn_update + rtw_net_traversal_jiffies(adapter)) || - rtw_time_before(rtw_get_current_time(), minfo->last_sn_update)) { + rtw_time_before(jiffies, minfo->last_sn_update)) { ++minfo->sn; - minfo->last_sn_update = rtw_get_current_time(); + minfo->last_sn_update = jiffies; } lifetime = rtw_default_lifetime(adapter); ttl = mshcfg->element_ttl; @@ -1448,7 +1448,7 @@ void rtw_mesh_path_start_discovery(_adapter *adapter) rtw_mesh_path_sel_frame_tx(RTW_MPATH_PREQ, flags, adapter_mac_addr(adapter), minfo->sn, target_flags, path->dst, path->sn, da, 0, ttl, lifetime, 0, minfo->preq_id++, adapter); - rtw_mod_timer(&path->timer, rtw_get_current_time() + path->discovery_timeout); + rtw_mod_timer(&path->timer, jiffies + path->discovery_timeout); enddiscovery: rtw_rcu_read_unlock(); @@ -1496,7 +1496,7 @@ void rtw_mesh_path_timer(void *ctx) RTW_MESH_PATH_REQ_QUEUED | RTW_MESH_PATH_ROOT_ADD_CHK | RTW_MESH_PATH_PEER_AKA); - path->exp_time = rtw_get_current_time(); + path->exp_time = jiffies; exit_critical_bh(&path->state_lock); if (!path->is_gate && rtw_mesh_gate_num(adapter) > 0) { ret = rtw_mesh_path_send_to_gates(path); @@ -1602,7 +1602,7 @@ void rtw_mesh_work_hdl(_workitem *work) _adapter *adapter = container_of(work, _adapter, mesh_work); while(adapter->mesh_info.preq_queue_len) { - if (rtw_time_after(rtw_get_current_time(), + if (rtw_time_after(jiffies, adapter->mesh_info.last_preq + rtw_min_preq_int_jiff(adapter))) /* It will consume preq_queue_len */ rtw_mesh_path_start_discovery(adapter); diff --git a/core/mesh/rtw_mesh_pathtbl.c b/core/mesh/rtw_mesh_pathtbl.c index 194ec42..2202b20 100644 --- a/core/mesh/rtw_mesh_pathtbl.c +++ b/core/mesh/rtw_mesh_pathtbl.c @@ -61,7 +61,7 @@ static const rtw_rhashtable_params rtw_mesh_rht_params = { static inline bool rtw_mpath_expired(struct rtw_mesh_path *mpath) { return (mpath->flags & RTW_MESH_PATH_ACTIVE) && - rtw_time_after(rtw_get_current_time(), mpath->exp_time) && + rtw_time_after(jiffies, mpath->exp_time) && !(mpath->flags & RTW_MESH_PATH_FIXED); } @@ -359,7 +359,7 @@ int rtw_mesh_path_add_gate(struct rtw_mesh_path *mpath) enter_critical_bh(&mpath->state_lock); mcfg = &mpath->adapter->mesh_cfg; - mpath->gate_timeout = rtw_get_current_time() + + mpath->gate_timeout = jiffies + rtw_ms_to_systime(mcfg->path_gate_timeout_factor * mpath->gate_ann_int); if (mpath->is_gate) { @@ -551,7 +551,7 @@ struct rtw_mesh_path *rtw_mesh_path_new(_adapter *adapter, new_mpath->gate_asked = false; _rtw_init_queue(&new_mpath->frame_queue); new_mpath->frame_queue_len = 0; - new_mpath->exp_time = rtw_get_current_time(); + new_mpath->exp_time = jiffies; _rtw_spinlock_init(&new_mpath->state_lock); rtw_init_timer(&new_mpath->timer, adapter, rtw_mesh_path_timer, new_mpath); @@ -1134,21 +1134,21 @@ void rtw_mesh_path_tbl_expire(_adapter *adapter, break; if ((!(mpath->flags & RTW_MESH_PATH_RESOLVING)) && (!(mpath->flags & RTW_MESH_PATH_FIXED)) && - rtw_time_after(rtw_get_current_time(), mpath->exp_time + RTW_MESH_PATH_EXPIRE)) + rtw_time_after(jiffies, mpath->exp_time + RTW_MESH_PATH_EXPIRE)) __rtw_mesh_path_del(tbl, mpath); if (mpath->is_gate && /* need not to deal with non-gate case */ - rtw_time_after(rtw_get_current_time(), mpath->gate_timeout)) { + rtw_time_after(jiffies, mpath->gate_timeout)) { RTW_MPATH_DBG(FUNC_ADPT_FMT"mpath [%pM] expired systime is %lu systime is %lu\n", FUNC_ADPT_ARG(adapter), mpath->dst, - mpath->gate_timeout, rtw_get_current_time()); + mpath->gate_timeout, jiffies); enter_critical_bh(&mpath->state_lock); if (mpath->gate_asked) { /* asked gate before */ rtw_mesh_gate_del(tbl, mpath); exit_critical_bh(&mpath->state_lock); } else { mpath->gate_asked = true; - mpath->gate_timeout = rtw_get_current_time() + rtw_ms_to_systime(mpath->gate_ann_int); + mpath->gate_timeout = jiffies + rtw_ms_to_systime(mpath->gate_ann_int); exit_critical_bh(&mpath->state_lock); rtw_mesh_queue_preq(mpath, RTW_PREQ_Q_F_START | RTW_PREQ_Q_F_REFRESH); RTW_MPATH_DBG(FUNC_ADPT_FMT"mpath [%pM] ask mesh gate existence (is_root=%d)\n", diff --git a/core/rtw_beamforming.c b/core/rtw_beamforming.c index bccef9f..91ff1ae 100644 --- a/core/rtw_beamforming.c +++ b/core/rtw_beamforming.c @@ -1952,7 +1952,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_chplan.c b/core/rtw_chplan.c index a77d4d8..106a0c3 100644 --- a/core/rtw_chplan.c +++ b/core/rtw_chplan.c @@ -569,7 +569,7 @@ u8 init_channel_set(_adapter *padapter, u8 ChannelPlan, RT_CHANNEL_INFO *channel #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 */ diff --git a/core/rtw_cmd.c b/core/rtw_cmd.c index 0031d17..c704bba 100644 --- a/core/rtw_cmd.c +++ b/core/rtw_cmd.c @@ -579,7 +579,7 @@ _next: continue; } - cmd_start_time = rtw_get_current_time(); + cmd_start_time = jiffies; pcmdpriv->cmd_issued_cnt++; if (pcmd->cmdsz > MAX_CMDSZ) { @@ -895,7 +895,7 @@ u8 rtw_sitesurvey_cmd(_adapter *padapter, struct sitesurvey_parm *pparm) if (res == _SUCCESS) { u32 scan_timeout_ms; - pmlmepriv->scan_start_time = rtw_get_current_time(); + pmlmepriv->scan_start_time = jiffies; scan_timeout_ms = rtw_scan_timeout_decision(padapter); mlme_set_scan_to_timer(pmlmepriv,scan_timeout_ms); @@ -4128,7 +4128,7 @@ static void rtw_chk_hi_queue_hdl(_adapter *padapter) { struct sta_info *psta_bmc; struct sta_priv *pstapriv = &padapter->stapriv; - systime start = rtw_get_current_time(); + systime start = jiffies; u8 empty = _FALSE; psta_bmc = rtw_get_bcmc_stainfo(padapter); @@ -5402,7 +5402,7 @@ unlock: st->local_port = local_port; st->remote_naddr = remote_naddr; st->remote_port = 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); @@ -5751,7 +5751,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 rtw_list_insert_tail(&(pwlan->list), &pmlmepriv->scanned_queue.queue); diff --git a/core/rtw_debug.c b/core/rtw_debug.c index a6e07ed..3dc999b 100644 --- a/core/rtw_debug.c +++ b/core/rtw_debug.c @@ -2132,7 +2132,7 @@ static u8 sta_linking_test_force_fail = 0; void rtw_sta_linking_test_set_start(void) { - sta_linking_test_start_time = rtw_get_current_time(); + sta_linking_test_start_time = jiffies; } bool rtw_sta_linking_test_wait_done(void) diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index 34d46dd..2c87107 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -129,7 +129,7 @@ sint _rtw_init_mlme_priv(_adapter *padapter) pmlmepriv->roam_scan_int = RTW_ROAM_SCAN_INTERVAL; pmlmepriv->roam_rssi_threshold = RTW_ROAM_RSSI_THRESHOLD; pmlmepriv->need_to_roam = _FALSE; - pmlmepriv->last_roaming = rtw_get_current_time(); + pmlmepriv->last_roaming = jiffies; #endif /* CONFIG_LAYER2_ROAMING */ #ifdef CONFIG_RTW_80211R @@ -380,7 +380,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; #if defined(CONFIG_RTW_MESH) && CONFIG_RTW_MESH_ACNODE_PREVENT pnetwork->acnode_stime = 0; pnetwork->acnode_notify_etime = 0; @@ -1033,10 +1033,10 @@ bool 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; #if defined(CONFIG_RTW_MESH) && CONFIG_RTW_MESH_ACNODE_PREVENT pnetwork->acnode_stime = 0; pnetwork->acnode_notify_etime = 0; @@ -1063,7 +1063,7 @@ bool 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) @@ -1081,7 +1081,7 @@ bool rtw_update_scanned_network(_adapter *adapter, WLAN_BSSID_EX *target) systime last_scanned = pnetwork->last_scanned; #endif - pnetwork->last_scanned = rtw_get_current_time(); + pnetwork->last_scanned = jiffies; /* target.Reserved[0]==BSS_TYPE_BCN, means that scanned network is a bcn frame. */ if ((pnetwork->network.IELength > target->IELength) && (target->Reserved[0] == BSS_TYPE_BCN)) @@ -1877,7 +1877,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; @@ -1945,7 +1945,7 @@ static u32 _rtw_wait_join_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->join_abort = abort; if (abort) diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index fe23027..0b2967a 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -458,7 +458,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; i < MAX_CHANNEL_NUM && ch_set[i].ChannelNum != 0; i++) { if (!rtw_ch2freq(ch_set[i].ChannelNum)) { @@ -507,9 +507,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); } } @@ -560,7 +560,7 @@ u32 rtw_get_ch_waiting_ms(struct rf_ctl_t *rfctl, u8 ch, u8 bw, u8 offset, u32 * 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(dvobj))) @@ -589,7 +589,7 @@ void rtw_reset_cac(struct rf_ctl_t *rfctl, 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 */ @@ -607,7 +607,7 @@ u32 rtw_force_stop_cac(struct rf_ctl_t *rfctl, u32 timeout_ms) systime start; u32 pass_ms; - start = rtw_get_current_time(); + start = jiffies; rfctl->cac_force_stop = 1; @@ -767,7 +767,7 @@ void dump_chset(void *sel, RT_CHANNEL_INFO *ch_set) if (rtw_is_dfs_ch(ch_set[i].ChannelNum)) { 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"); } @@ -6114,7 +6114,7 @@ int issue_probereq_p2p_ex(_adapter *adapter, u8 *da, int try_cnt, int wait_ms) { int ret; int i = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; do { ret = _issue_probereq_p2p(adapter, da, wait_ms > 0 ? _TRUE : _FALSE); @@ -8533,7 +8533,7 @@ int issue_probereq_ex(_adapter *padapter, const NDIS_802_11_SSID *pssid, const u { int ret = _FAIL; int i = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; if (rtw_rfctl_is_tx_blocked_by_ch_waiting(adapter_to_rfctl(padapter))) goto exit; @@ -9537,7 +9537,7 @@ int issue_nulldata(_adapter *padapter, unsigned char *da, unsigned int power_mod { int ret = _FAIL; int i = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -9691,7 +9691,7 @@ int issue_qos_nulldata(_adapter *padapter, unsigned char *da, u16 tid, u8 ps, in { int ret = _FAIL; int i = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -9832,7 +9832,7 @@ int issue_deauth_ex(_adapter *padapter, u8 *da, unsigned short reason, int try_c { int ret = _FAIL; int i = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; if (rtw_rfctl_is_tx_blocked_by_ch_waiting(adapter_to_rfctl(padapter))) goto exit; @@ -10248,7 +10248,7 @@ inline u8 issue_addba_rsp_wait_ack(_adapter *adapter, unsigned char *ra, u8 tid, { int ret = _FAIL; int i = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; if (rtw_rfctl_is_tx_blocked_by_ch_waiting(adapter_to_rfctl(adapter))) goto exit; @@ -10326,7 +10326,7 @@ int issue_del_ba_ex(_adapter *adapter, unsigned char *ra, u8 tid, u16 reason, u8 { int ret = _FAIL; int i = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; if (rtw_rfctl_is_tx_blocked_by_ch_waiting(adapter_to_rfctl(adapter))) goto exit; @@ -10607,7 +10607,7 @@ int issue_action_SM_PS_wait_ack(_adapter *padapter, unsigned char *raddr, u8 New { int ret = _FAIL; int i = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; if (rtw_rfctl_is_tx_blocked_by_ch_waiting(adapter_to_rfctl(padapter))) goto exit; @@ -10798,7 +10798,7 @@ unsigned int send_beacon(_adapter *padapter) u8 bxmitok = _FALSE; int issue = 0; int poll = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; #ifdef CONFIG_FW_HANDLE_TXBCN u8 vap_id = padapter->vap_id; @@ -12791,7 +12791,7 @@ void linked_status_chk(_adapter *padapter, u8 from_timer) #endif pmlmepriv->need_to_roam = _TRUE; rtw_drv_scan_by_self(padapter, RTW_AUTO_SCAN_REASON_ROAM); - pmlmepriv->last_roaming = rtw_get_current_time(); + pmlmepriv->last_roaming = jiffies; } else pmlmepriv->need_to_roam = _FALSE; } @@ -14250,7 +14250,7 @@ u8 rtw_scan_sparse(_adapter *adapter, struct rtw_ieee80211_channel *ch, u8 ch_nu 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); @@ -14306,7 +14306,7 @@ u8 rtw_scan_sparse(_adapter *adapter, struct rtw_ieee80211_channel *ch, u8 ch_nu 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: @@ -15235,7 +15235,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 662bdaf..a2d2a41 100644 --- a/core/rtw_p2p.c +++ b/core/rtw_p2p.c @@ -5123,7 +5123,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", __FUNCTION__, 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 b6309de..c030ed4 100644 --- a/core/rtw_pwrctrl.c +++ b/core/rtw_pwrctrl.c @@ -95,7 +95,7 @@ void _ips_enter(_adapter *padapter) pwrpriv->bkeepfwalive = _TRUE; #ifdef CONFIG_RTW_CFGVEDNOR_LLSTATS - pwrpriv->pwr_saving_start_time = rtw_get_current_time(); + pwrpriv->pwr_saving_start_time = jiffies; #endif /* CONFIG_RTW_CFGVEDNOR_LLSTATS */ rtw_ips_pwr_down(padapter); @@ -212,7 +212,7 @@ bool rtw_pwr_unassociated_idle(_adapter *adapter) goto exit; } - if (rtw_time_after(adapter_to_pwrctl(adapter)->ips_deny_time, rtw_get_current_time())) { + if (rtw_time_after(adapter_to_pwrctl(adapter)->ips_deny_time, jiffies)) { /* RTW_INFO("%s ips_deny_time\n", __func__); */ goto exit; } @@ -480,7 +480,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) { @@ -495,7 +495,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; } @@ -538,7 +538,7 @@ u8 rtw_cpwm_polling(_adapter *adapter, u8 rpwm, u8 cpwm_orig) pwrpriv->rpwm_retry = 0; do { - start_time = rtw_get_current_time(); + start_time = jiffies; do { msleep(1); rtw_hal_get_hwreg(adapter, HW_VAR_CPWM, &cpwm_now); @@ -706,7 +706,7 @@ u8 PS_RDY_CHECK(_adapter *padapter) return _FALSE; #endif - if (rtw_time_after(pwrpriv->lps_deny_time, rtw_get_current_time())) + if (rtw_time_after(pwrpriv->lps_deny_time, jiffies)) return _FALSE; if (check_fwstate(pmlmepriv, WIFI_SITE_MONITOR) @@ -829,7 +829,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 { mdelay(1); @@ -972,7 +972,7 @@ void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode u32 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 */ @@ -1197,7 +1197,7 @@ void LPS_Enter(PADAPTER padapter, const char *msg) pwrpriv->bpower_saving = _TRUE; #ifdef CONFIG_RTW_CFGVEDNOR_LLSTATS - pwrpriv->pwr_saving_start_time = rtw_get_current_time(); + pwrpriv->pwr_saving_start_time = jiffies; #endif /* CONFIG_RTW_CFGVEDNOR_LLSTATS */ rtw_set_ps_mode(padapter, pwrpriv->power_mgnt, padapter->registrypriv.smart_ps, 0, buf); @@ -1433,7 +1433,7 @@ void LPS_Leave_check( pwrpriv = adapter_to_pwrctl(padapter); bReady = _FALSE; - start_time = rtw_get_current_time(); + start_time = jiffies; yield(); @@ -2128,7 +2128,7 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter) pwrctrlpriv->ips_mode = padapter->registrypriv.ips_mode; pwrctrlpriv->ips_mode_req = padapter->registrypriv.ips_mode; - pwrctrlpriv->ips_deny_time = rtw_get_current_time(); + pwrctrlpriv->ips_deny_time = jiffies; pwrctrlpriv->lps_level = padapter->registrypriv.lps_level; pwrctrlpriv->pwr_state_check_interval = RTW_PWR_STATE_CHK_INTERVAL; @@ -2159,7 +2159,7 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter) pwrctrlpriv->bLeisurePs = (PS_MODE_ACTIVE != pwrctrlpriv->power_mgnt) ? _TRUE : _FALSE; pwrctrlpriv->bFwCurrentInPSMode = _FALSE; - pwrctrlpriv->lps_deny_time = rtw_get_current_time(); + pwrctrlpriv->lps_deny_time = jiffies; pwrctrlpriv->rpwm = 0; pwrctrlpriv->cpwm = PS_STATE_S4; @@ -2475,7 +2475,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); } /* @@ -2491,7 +2491,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(dvobj); struct mlme_priv *pmlmepriv; int ret = _SUCCESS; - systime start = rtw_get_current_time(); + systime start = jiffies; /*RTW_INFO(FUNC_ADPT_FMT "===>\n", FUNC_ADPT_ARG(padapter));*/ /* for LPS */ @@ -2501,8 +2501,8 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) padapter = GET_PRIMARY_ADAPTER(padapter); pmlmepriv = &padapter->mlmepriv; - if (rtw_time_after(rtw_get_current_time() + rtw_ms_to_systime(ips_deffer_ms), pwrpriv->ips_deny_time)) - pwrpriv->ips_deny_time = rtw_get_current_time() + rtw_ms_to_systime(ips_deffer_ms); + if (rtw_time_after(jiffies + rtw_ms_to_systime(ips_deffer_ms), pwrpriv->ips_deny_time)) + pwrpriv->ips_deny_time = jiffies + rtw_ms_to_systime(ips_deffer_ms); if (pwrpriv->ps_processing) { @@ -2627,8 +2627,8 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) } exit: - if (rtw_time_after(rtw_get_current_time() + rtw_ms_to_systime(ips_deffer_ms), pwrpriv->ips_deny_time)) - pwrpriv->ips_deny_time = rtw_get_current_time() + rtw_ms_to_systime(ips_deffer_ms); + if (rtw_time_after(jiffies + rtw_ms_to_systime(ips_deffer_ms), pwrpriv->ips_deny_time)) + pwrpriv->ips_deny_time = jiffies + rtw_ms_to_systime(ips_deffer_ms); /*RTW_INFO(FUNC_ADPT_FMT "<===\n", FUNC_ADPT_ARG(padapter));*/ return ret; @@ -2675,7 +2675,7 @@ int rtw_pm_set_lps_level(_adapter *padapter, u8 level) inline void rtw_set_lps_deny(_adapter *adapter, u32 ms) { struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(adapter); - pwrpriv->lps_deny_time = rtw_get_current_time() + rtw_ms_to_systime(ms); + pwrpriv->lps_deny_time = jiffies + rtw_ms_to_systime(ms); } int rtw_pm_set_ips(_adapter *padapter, u8 mode) diff --git a/core/rtw_recv.c b/core/rtw_recv.c index 292646e..c0b67fc 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -1119,7 +1119,7 @@ void count_rx_stats(_adapter *padapter, union recv_frame *prframe, struct sta_in pstats = &psta->sta_stats; - pstats->last_rx_time = rtw_get_current_time(); + pstats->last_rx_time = jiffies; pstats->rx_data_pkts++; pstats->rx_bytes += sz; if (is_broadcast_mac_addr(pattrib->ra)) { @@ -1450,7 +1450,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)); @@ -1581,7 +1581,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) return _FAIL; /* for rx pkt statistics */ - psta->sta_stats.last_rx_time = rtw_get_current_time(); + psta->sta_stats.last_rx_time = jiffies; psta->sta_stats.rx_ctrl_pkts++; /* only handle ps-poll */ @@ -1965,7 +1965,7 @@ sint validate_recv_mgnt_frame(PADAPTER padapter, union recv_frame *precv_frame) /* for rx pkt statistics */ if (psta) { - psta->sta_stats.last_rx_time = rtw_get_current_time(); + psta->sta_stats.last_rx_time = jiffies; psta->sta_stats.rx_mgnt_pkts++; if (get_frame_sub_type(precv_frame->u.hdr.rx_data) == WIFI_BEACON) psta->sta_stats.rx_beacon_pkts++; @@ -4803,7 +4803,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; } precvpriv->dbg_rx_conflic_mac_addr_cnt++; } else { diff --git a/core/rtw_security.c b/core/rtw_security.c index 44b1d69..c16be72 100644 --- a/core/rtw_security.c +++ b/core/rtw_security.c @@ -829,7 +829,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++; @@ -841,7 +841,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; } @@ -1950,7 +1950,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++; @@ -1962,7 +1962,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 03dba20..1823148 100644 --- a/core/rtw_sreset.c +++ b/core/rtw_sreset.c @@ -273,7 +273,7 @@ void sreset_reset(_adapter *padapter) struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct xmit_priv *pxmitpriv = &padapter->xmitpriv; _irqL irqL; - systime start = rtw_get_current_time(); + systime 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 67926b5..993aafa 100644 --- a/core/rtw_tdls.c +++ b/core/rtw_tdls.c @@ -355,7 +355,7 @@ int issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsig { int ret; int i = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -991,7 +991,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); /* set mac_id sleep before channel switch */ rtw_hal_macid_sleep(padapter, ptdls_sta->cmn.mac_id); @@ -1043,7 +1043,7 @@ s32 rtw_tdls_do_ch_sw(_adapter *padapter, struct sta_info *ptdls_sta, u8 chnl_ty #endif if (ret == _SUCCESS) { - 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) wait_time = (u32)ch_switch_time / 1000 - ch_sw_time_spent; @@ -2807,7 +2807,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); } } @@ -2883,7 +2883,7 @@ void rtw_build_tdls_setup_rsp_ies(_adapter *padapter, struct xmit_frame *pxmitfr if (pattrib->encrypt) { 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 499e5f7..1c9df57 100644 --- a/core/rtw_wlan_util.c +++ b/core/rtw_wlan_util.c @@ -419,7 +419,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 158e679..91b6994 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -4543,14 +4543,14 @@ s32 rtw_xmit(_adapter *padapter, _pkt **ppkt) return -1; 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", __FUNCTION__, drop_cnt); - start = rtw_get_current_time(); + start = jiffies; drop_cnt = 0; } @@ -5762,7 +5762,7 @@ u8 rtw_get_tx_desc_backup(_adapter *padapter, u8 hwq, struct rtw_tx_desc_backup 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; #ifdef PLATFORM_LINUX /* TODO: add condition wating interface for other os */ init_completion(&sctx->done); #endif @@ -5829,7 +5829,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 58701f1..bc68787 100644 --- a/hal/hal_btcoex.c +++ b/hal/hal_btcoex.c @@ -394,7 +394,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) @@ -454,7 +454,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 825bfba..be3b371 100644 --- a/hal/hal_com.c +++ b/hal/hal_com.c @@ -1376,7 +1376,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; @@ -1536,7 +1536,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}; - systime start = rtw_get_current_time(); + systime start = jiffies; u32 cnt = 0; u32 timeout_ms = 800; u32 min_cnt = 10; @@ -1562,7 +1562,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); @@ -2249,7 +2249,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; @@ -2265,7 +2265,7 @@ u32 rtw_sec_read_cam(_adapter *adapter, u8 addr) break; } } - end = rtw_get_current_time(); + end = jiffies; rdata = rtw_read32(adapter, REG_CAMREAD); @@ -2292,7 +2292,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; @@ -2308,7 +2308,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); @@ -3366,7 +3366,7 @@ static void rtw_hal_tsf_update_pause(_adapter *adapter) rtw_hal_set_tsf_update(iface, 0); if (iface->mlmeextpriv.tsf_update_required) { - iface->mlmeextpriv.tsf_update_pause_stime = rtw_get_current_time(); + iface->mlmeextpriv.tsf_update_pause_stime = jiffies; if (!iface->mlmeextpriv.tsf_update_pause_stime) iface->mlmeextpriv.tsf_update_pause_stime++; } @@ -3413,7 +3413,7 @@ void rtw_hal_periodic_tsf_update_chk(_adapter *adapter) u32 restore_ms = 0; if (dvobj->periodic_tsf_update_etime) { - if (rtw_time_after(rtw_get_current_time(), dvobj->periodic_tsf_update_etime)) { + if (rtw_time_after(jiffies, dvobj->periodic_tsf_update_etime)) { /* end for restore status */ dvobj->periodic_tsf_update_etime = 0; rtw_hal_rcr_set_chk_bssid(adapter, MLME_ACTION_NONE); @@ -3448,7 +3448,7 @@ void rtw_hal_periodic_tsf_update_chk(_adapter *adapter) if (!restore_ms) return; - dvobj->periodic_tsf_update_etime = rtw_get_current_time() + rtw_ms_to_systime(restore_ms); + dvobj->periodic_tsf_update_etime = jiffies + rtw_ms_to_systime(restore_ms); if (!dvobj->periodic_tsf_update_etime) dvobj->periodic_tsf_update_etime++; @@ -9280,7 +9280,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; @@ -9351,7 +9351,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; @@ -9365,7 +9365,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); @@ -9418,7 +9418,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; @@ -14424,7 +14424,7 @@ u8 rtw_ap_bcn_recovery(_adapter *padapter) #ifdef CONFIG_BCN_XMIT_PROTECT u8 rtw_ap_bcn_queue_empty_check(_adapter *padapter, u32 txbcn_timer_ms) { - u32 start_time = rtw_get_current_time(); + u32 start_time = jiffies; u8 bcn_queue_empty = _FALSE; do { diff --git a/hal/hal_halmac.c b/hal/hal_halmac.c index 021a4bb..b8c10f8 100644 --- a/hal/hal_halmac.c +++ b/hal/hal_halmac.c @@ -3150,7 +3150,7 @@ static int _cpu_sleep(struct dvobj_priv *d, u32 timeout) mac = dvobj_to_halmac(d); api = HALMAC_GET_API(mac); - start_t = rtw_get_current_time(); + start_t = jiffies; status = _enter_cpu_sleep_mode(d); if (status != HALMAC_RET_SUCCESS) { @@ -3650,7 +3650,7 @@ int rtw_halmac_txfifo_wait_empty(struct dvobj_priv *d, u32 timeout) a = dvobj_get_primary_adapter(d); - start_time = rtw_get_current_time(); + start_time = jiffies; do { cnt++; diff --git a/hal/hal_intf.c b/hal/hal_intf.c index 9f52d0c..e11347f 100644 --- a/hal/hal_intf.c +++ b/hal/hal_intf.c @@ -54,7 +54,7 @@ u8 rtw_hal_read_chip_info(_adapter *padapter) { u8 rtn = _SUCCESS; u8 hci_type = rtw_get_intf_type(padapter); - systime start = rtw_get_current_time(); + systime start = jiffies; /* before access eFuse, make sure card enable has been called */ if ((hci_type == RTW_SDIO || hci_type == RTW_GSPI) @@ -472,7 +472,7 @@ s32 rtw_hal_fw_dl(_adapter *padapter, u8 wowlan) #ifdef RTW_HALMAC s32 rtw_hal_fw_mem_dl(_adapter *padapter, enum fw_mem mem) { - systime dlfw_start_time = rtw_get_current_time(); + systime dlfw_start_time = jiffies; struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); struct debug_priv *pdbgpriv = &dvobj->drv_dbg; s32 rst = _FALSE; diff --git a/hal/hal_mcc.c b/hal/hal_mcc.c index 0555d73..b8843f6 100644 --- a/hal/hal_mcc.c +++ b/hal/hal_mcc.c @@ -2249,7 +2249,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)); @@ -2538,7 +2538,7 @@ void rtw_hal_mcc_c2h_handler(PADAPTER padapter, u8 buflen, u8 *tmpBuf) 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; @@ -3236,7 +3236,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; - systime start = rtw_get_current_time(); + systime start = jiffies; u8 i = 0; if (!MCC_EN(padapter)) diff --git a/hal/phydm/phydm_interface.c b/hal/phydm/phydm_interface.c index 40ba9f3..1c96c90 100644 --- a/hal/phydm/phydm_interface.c +++ b/hal/phydm/phydm_interface.c @@ -1059,17 +1059,17 @@ u8 phydm_c2H_content_parsing(void *dm_void, u8 c2h_cmd_id, u8 c2h_cmd_len, u64 odm_get_current_time(struct dm_struct *dm) { #if (DM_ODM_SUPPORT_TYPE & (ODM_AP)) - return (u64)rtw_get_current_time(); + return (u64)jiffies; #elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211) return jiffies; #elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211_V2) return jiffies; #elif (DM_ODM_SUPPORT_TYPE & ODM_CE) - return rtw_get_current_time(); + return jiffies; #elif (DM_ODM_SUPPORT_TYPE & ODM_WIN) return PlatformGetCurrentTime(); #elif (DM_ODM_SUPPORT_TYPE & ODM_IOT) - return rtw_get_current_time(); + return jiffies; #endif } diff --git a/hal/rtl8192e/rtl8192e_hal_init.c b/hal/rtl8192e/rtl8192e_hal_init.c index e9ee441..9bc4ec2 100644 --- a/hal/rtl8192e/rtl8192e_hal_init.c +++ b/hal/rtl8192e/rtl8192e_hal_init.c @@ -76,7 +76,7 @@ s32 InitLLTTable8192E(PADAPTER padapter, u8 txpktbuf_bndy) value32 = rtw_read32(padapter, REG_AUTO_LLT); rtw_write32(padapter, REG_AUTO_LLT, value32 | BIT_AUTO_INIT_LLT); - start = rtw_get_current_time(); + start = jiffies; while (((value32 = rtw_read32(padapter, REG_AUTO_LLT)) & BIT_AUTO_INIT_LLT) && ((passing_time = rtw_get_passing_time_ms(start)) < 1000) ) @@ -367,7 +367,7 @@ static s32 polling_fwdl_chksum(_adapter *adapter, u32 min_cnt, u32 timeout_ms) { s32 ret = _FAIL; u32 value32; - systime start = rtw_get_current_time(); + systime start = jiffies; u32 cnt = 0; /* polling CheckSum report */ @@ -398,7 +398,7 @@ static s32 _FWFreeToGo8192E(_adapter *adapter, u32 min_cnt, u32 timeout_ms) { s32 ret = _FAIL; u32 value32; - systime start = rtw_get_current_time(); + systime start = jiffies; u32 cnt = 0; value32 = rtw_read32(adapter, REG_MCUFWDL); @@ -554,7 +554,7 @@ FirmwareDownload8192E( } _FWDownloadEnable_8192E(Adapter, _TRUE); - fwdl_start_time = rtw_get_current_time(); + fwdl_start_time = jiffies; while (!RTW_CANNOT_IO(Adapter) && (write_fw++ < 3 || rtw_get_passing_time_ms(fwdl_start_time) < 500)) { /* reset FWDL chksum */ @@ -3963,7 +3963,7 @@ u8 SetHwReg8192E(PADAPTER Adapter, u8 variable, u8 *val) u16 val16; u32 reg_200 = 0, reg_204 = 0, reg_214 = 0; u32 init_reg_200 = 0, init_reg_204 = 0, init_reg_214 = 0; - systime start = rtw_get_current_time(); + systime start = jiffies; u32 pass_ms; int i = 0; diff --git a/hal/rtl8192e/rtl8192e_sreset.c b/hal/rtl8192e/rtl8192e_sreset.c index c7085a4..3f5ea29 100644 --- a/hal/rtl8192e/rtl8192e_sreset.c +++ b/hal/rtl8192e/rtl8192e_sreset.c @@ -38,7 +38,7 @@ void rtl8192e_sreset_xmit_status_check(_adapter *padapter) /* total xmit irp = 4 */ /* RTW_INFO("==>%s free_xmitbuf_cnt(%d),txirp_cnt(%d)\n",__FUNCTION__,pxmitpriv->free_xmitbuf_cnt,pxmitpriv->txirp_cnt); */ /* if(pxmitpriv->txirp_cnt == NR_XMITBUFF+1) */ - 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/rtl8192e/usb/usb_halinit.c b/hal/rtl8192e/usb/usb_halinit.c index c3f42c9..2714f6a 100644 --- a/hal/rtl8192e/usb/usb_halinit.c +++ b/hal/rtl8192e/usb/usb_halinit.c @@ -693,7 +693,7 @@ u32 rtl8192eu_hal_init(PADAPTER Adapter) rt_rf_power_state eRfPowerStateToSet; - systime init_start_time = rtw_get_current_time(); + systime init_start_time = jiffies; #ifdef DBG_HAL_INIT_PROFILING @@ -763,7 +763,7 @@ u32 rtl8192eu_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 */ @@ -1123,7 +1123,7 @@ exit: RTW_INFO("%s in %dms\n", __FUNCTION__, 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/hal/rtl8192e/usb/usb_ops_linux.c b/hal/rtl8192e/usb/usb_ops_linux.c index 81e1b14..1ad2a75 100644 --- a/hal/rtl8192e/usb/usb_ops_linux.c +++ b/hal/rtl8192e/usb/usb_ops_linux.c @@ -50,7 +50,7 @@ void interrupt_handler_8192eu(_adapter *padapter, u16 pkt_len, u8 *pbuf) if (pHalData->IntArray[0] & IMR_BCNDMAINT0_88E) { struct tdls_ch_switch *pchsw_info = &padapter->tdlsinfo.chsw_info; u32 last_time = pchsw_info->cur_time; - pchsw_info->cur_time = rtw_systime_to_ms(rtw_get_current_time()); + pchsw_info->cur_time = rtw_systime_to_ms(jiffies); if ((atomic_read(&pchsw_info->chsw_on) == _TRUE) && /* Sometimes we receive multiple interrupts in very little time period, use the follow condition test to filter */ (pchsw_info->cur_time - last_time > padapter->mlmeextpriv.mlmext_info.bcn_interval - 5) && diff --git a/include/drv_types.h b/include/drv_types.h index 0bc36a0..d71d15c 100644 --- a/include/drv_types.h +++ b/include/drv_types.h @@ -907,8 +907,8 @@ struct rf_ctl_t { #define RTW_CAC_STOPPED 0 #ifdef CONFIG_DFS_MASTER #define IS_CAC_STOPPED(rfctl) ((rfctl)->cac_end_time == RTW_CAC_STOPPED) -#define IS_CH_WAITING(rfctl) (!IS_CAC_STOPPED(rfctl) && rtw_time_after((rfctl)->cac_end_time, rtw_get_current_time())) -#define IS_UNDER_CAC(rfctl) (IS_CH_WAITING(rfctl) && rtw_time_after(rtw_get_current_time(), (rfctl)->cac_start_time)) +#define IS_CH_WAITING(rfctl) (!IS_CAC_STOPPED(rfctl) && rtw_time_after((rfctl)->cac_end_time, jiffies)) +#define IS_UNDER_CAC(rfctl) (IS_CH_WAITING(rfctl) && rtw_time_after(jiffies, (rfctl)->cac_start_time)) #define IS_RADAR_DETECTED(rfctl) ((rfctl)->radar_detected) #else #define IS_CAC_STOPPED(rfctl) 1 diff --git a/include/osdep_service.h b/include/osdep_service.h index 2baa01a..9070544 100644 --- a/include/osdep_service.h +++ b/include/osdep_service.h @@ -276,7 +276,6 @@ extern void _rtw_deinit_queue(_queue *pqueue); extern u32 _rtw_queue_empty(_queue *pqueue); extern u32 rtw_end_of_queue_search(_list *queue, _list *pelement); -extern systime _rtw_get_current_time(void); extern u32 _rtw_systime_to_ms(systime stime); extern systime _rtw_ms_to_systime(u32 ms); extern systime _rtw_us_to_systime(u32 us); @@ -286,7 +285,6 @@ extern s32 _rtw_get_time_interval_ms(systime start, systime end); extern bool _rtw_time_after(systime a, systime b); #ifdef DBG_SYSTIME -#define rtw_get_current_time() ({systime __stime = _rtw_get_current_time(); __stime;}) #define rtw_systime_to_ms(stime) ({u32 __ms = _rtw_systime_to_ms(stime); typecheck(systime, stime); __ms;}) #define rtw_ms_to_systime(ms) ({systime __stime = _rtw_ms_to_systime(ms); __stime;}) #define rtw_us_to_systime(us) ({systime __stime = _rtw_us_to_systime(us); __stime;}) @@ -296,7 +294,6 @@ extern bool _rtw_time_after(systime a, systime b); #define rtw_time_after(a,b) ({bool __r = _rtw_time_after(a,b); typecheck(systime, a); typecheck(systime, b); __r;}) #define rtw_time_before(a,b) ({bool __r = _rtw_time_after(b, a); typecheck(systime, a); typecheck(systime, b); __r;}) #else -#define rtw_get_current_time() _rtw_get_current_time() #define rtw_systime_to_ms(stime) _rtw_systime_to_ms(stime) #define rtw_ms_to_systime(ms) _rtw_ms_to_systime(ms) #define rtw_us_to_systime(us) _rtw_us_to_systime(us) diff --git a/include/rtw_mlme_ext.h b/include/rtw_mlme_ext.h index 4324816..20cfa29 100644 --- a/include/rtw_mlme_ext.h +++ b/include/rtw_mlme_ext.h @@ -392,7 +392,7 @@ void rtw_rfctl_deinit(_adapter *adapter); #ifdef CONFIG_DFS_MASTER struct rf_ctl_t; -#define CH_IS_NON_OCP(rt_ch_info) (rtw_time_after((rt_ch_info)->non_ocp_end_time, rtw_get_current_time())) +#define CH_IS_NON_OCP(rt_ch_info) (rtw_time_after((rt_ch_info)->non_ocp_end_time, jiffies)) bool rtw_is_cac_reset_needed(struct rf_ctl_t *rfctl, 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/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 411c5f6..2a478ff 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -2527,7 +2527,7 @@ u32 rtw_cfg80211_wait_scan_req_empty(_adapter *adapter, u32 timeout_ms) systime start; u32 pass_ms; - start = rtw_get_current_time(); + start = jiffies; while (rtw_get_passing_time_ms(start) <= timeout_ms) { @@ -3227,7 +3227,7 @@ cancel_ps_deny: exit: if (pmlmepriv) - pmlmepriv->lastscantime = rtw_get_current_time(); + pmlmepriv->lastscantime = jiffies; return ret; } @@ -6604,7 +6604,7 @@ inline bool rtw_cfg80211_is_ro_ch_once(_adapter *adapter) inline void rtw_cfg80211_set_last_ro_ch_time(_adapter *adapter) { - adapter->cfg80211_wdinfo.last_ro_ch_time = rtw_get_current_time(); + adapter->cfg80211_wdinfo.last_ro_ch_time = jiffies; if (!adapter->cfg80211_wdinfo.last_ro_ch_time) adapter->cfg80211_wdinfo.last_ro_ch_time++; @@ -6711,7 +6711,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(rtw_get_current_time(), pwdev_priv->probe_resp_ie_update_time) + && (time_after_eq(jiffies, 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) { @@ -7247,7 +7247,7 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, u8 is_p2p = 0; #endif int type = (-1); - systime start = rtw_get_current_time(); + systime start = jiffies; _adapter *padapter; struct dvobj_priv *dvobj; struct rtw_wdev_priv *pwdev_priv; @@ -8598,7 +8598,7 @@ static void rtw_cfg80211_mpath_set_pinfo(struct rtw_mesh_path *mpath, u8 *next_h pinfo->frame_qlen = mpath->frame_queue_len; pinfo->sn = mpath->sn; pinfo->metric = mpath->metric; - if (rtw_time_after(mpath->exp_time, rtw_get_current_time())) + if (rtw_time_after(mpath->exp_time, jiffies)) pinfo->exptime = rtw_get_remaining_time_ms(mpath->exp_time); pinfo->discovery_timeout = rtw_systime_to_ms(mpath->discovery_timeout); pinfo->discovery_retries = mpath->discovery_retries; @@ -9192,7 +9192,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 */ @@ -10068,7 +10068,7 @@ int rtw_wdev_alloc(_adapter *padapter, struct wiphy *wiphy) _rtw_spinlock_init(&pwdev_priv->connect_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/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 04b23a9..54aad5d 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -7960,7 +7960,7 @@ static int rtw_wowlan_ctrl(struct net_device *dev, struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct sta_info *psta = NULL; int ret = 0; - systime start_time = rtw_get_current_time(); + systime start_time = jiffies; poidparam.subcode = 0; RTW_INFO("+rtw_wowlan_ctrl: %s\n", extra); @@ -8032,7 +8032,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; - systime start_time = rtw_get_current_time(); + systime start_time = jiffies; u8 input[wrqu->data.length]; u8 index = 0; @@ -8103,7 +8103,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; - systime start_time = rtw_get_current_time(); + systime start_time = jiffies; poidparam.subcode = 0; RTW_INFO("+rtw_ap_wowlan_ctrl: %s\n", extra); diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index dbabac2..cd0a7c9 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -3485,8 +3485,8 @@ netdev_open_normal_process: #endif #ifdef CONFIG_RTW_CFGVEDNOR_LLSTATS - pwrctrlpriv->radio_on_start_time = rtw_get_current_time(); - pwrctrlpriv->pwr_saving_start_time = rtw_get_current_time(); + pwrctrlpriv->radio_on_start_time = jiffies; + pwrctrlpriv->pwr_saving_start_time = jiffies; pwrctrlpriv->pwr_saving_time = 0; pwrctrlpriv->on_time = 0; pwrctrlpriv->tx_time = 0; @@ -3607,7 +3607,7 @@ int rtw_ips_pwr_up(_adapter *padapter) struct sreset_priv *psrtpriv = &pHalData->srestpriv; #endif/* #ifdef DBG_CONFIG_ERROR_DETECT */ #endif /* defined(CONFIG_SWLPS_IN_IPS) || defined(CONFIG_FWLPS_IN_IPS) */ - systime start_time = rtw_get_current_time(); + systime start_time = jiffies; RTW_INFO("===> rtw_ips_pwr_up..............\n"); #if defined(CONFIG_SWLPS_IN_IPS) || defined(CONFIG_FWLPS_IN_IPS) @@ -3628,7 +3628,7 @@ int rtw_ips_pwr_up(_adapter *padapter) void rtw_ips_pwr_down(_adapter *padapter) { - systime start_time = rtw_get_current_time(); + systime start_time = jiffies; RTW_INFO("===> rtw_ips_pwr_down...................\n"); padapter->net_closed = _TRUE; @@ -4629,7 +4629,7 @@ int rtw_suspend_common(_adapter *padapter) #endif int ret = 0; - systime start_time = rtw_get_current_time(); + systime start_time = jiffies; RTW_PRINT(" suspend start\n"); RTW_INFO("==> %s (%s:%d)\n", __FUNCTION__, current->comm, current->pid); @@ -5096,7 +5096,7 @@ exit: int rtw_resume_common(_adapter *padapter) { int ret = 0; - systime start_time = rtw_get_current_time(); + systime start_time = jiffies; struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); if (pwrpriv->bInSuspend == _FALSE) diff --git a/os_dep/linux/recv_linux.c b/os_dep/linux/recv_linux.c index ad3e27f..d79221f 100644 --- a/os_dep/linux/recv_linux.c +++ b/os_dep/linux/recv_linux.c @@ -562,16 +562,16 @@ void rtw_handle_tkip_mic_err(_adapter *padapter, struct sta_info *sta, u8 bgroup systime 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; } #ifdef CONFIG_IOCTL_CFG80211 diff --git a/os_dep/linux/rtw_cfgvendor.c b/os_dep/linux/rtw_cfgvendor.c index da94074..578567a 100644 --- a/os_dep/linux/rtw_cfgvendor.c +++ b/os_dep/linux/rtw_cfgvendor.c @@ -1167,13 +1167,13 @@ static void LinkLayerStats(_adapter *padapter) if (rtw_mi_check_fwstate(padapter, _FW_LINKED)) { if ( pwrpriv->bpower_saving == _TRUE ) { pwrpriv->pwr_saving_time += rtw_get_passing_time_ms(pwrpriv->pwr_saving_start_time); - pwrpriv->pwr_saving_start_time = rtw_get_current_time(); + pwrpriv->pwr_saving_start_time = jiffies; } } else { #ifdef CONFIG_IPS if ( pwrpriv->bpower_saving == _TRUE ) { pwrpriv->pwr_saving_time += rtw_get_passing_time_ms(pwrpriv->pwr_saving_start_time); - pwrpriv->pwr_saving_start_time = rtw_get_current_time(); + pwrpriv->pwr_saving_start_time = jiffies; } #else pwrpriv->pwr_saving_time = pwrpriv->on_time; diff --git a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c index de37244..28e4764 100644 --- a/os_dep/linux/usb_intf.c +++ b/os_dep/linux/usb_intf.c @@ -1122,7 +1122,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", __FUNCTION__, ret); return ret; diff --git a/os_dep/linux/usb_ops_linux.c b/os_dep/linux/usb_ops_linux.c index 8b0bdd7..f09e332 100644 --- a/os_dep/linux/usb_ops_linux.c +++ b/os_dep/linux/usb_ops_linux.c @@ -442,7 +442,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 @@ -563,7 +563,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 { diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index 49969a4..e02eb68 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -367,7 +367,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; /* } */ } @@ -1008,15 +1008,6 @@ u32 rtw_end_of_queue_search(_list *head, _list *plist) return _FALSE; } - -systime _rtw_get_current_time(void) -{ - -#ifdef PLATFORM_LINUX - return jiffies; -#endif -} - inline u32 _rtw_systime_to_ms(systime stime) { #ifdef PLATFORM_LINUX @@ -1040,15 +1031,15 @@ inline systime _rtw_us_to_systime(u32 us) #endif } -/* the input parameter start use the same unit as returned by rtw_get_current_time */ +/* the input parameter start use the same unit as returned by jiffies */ inline s32 _rtw_get_passing_time_ms(systime start) { - return _rtw_systime_to_ms(_rtw_get_current_time() - start); + return _rtw_systime_to_ms(jiffies - start); } inline s32 _rtw_get_remaining_time_ms(systime end) { - return _rtw_systime_to_ms(end - _rtw_get_current_time()); + return _rtw_systime_to_ms(end - jiffies); } inline s32 _rtw_get_time_interval_ms(systime start, systime end) @@ -1924,14 +1915,14 @@ int rtw_blacklist_add(_queue *blist, const u8 *addr, u32 timeout_ms) if (_rtw_memcmp(ent->addr, addr, ETH_ALEN) == _TRUE) { exist = _TRUE; - if (rtw_time_after(rtw_get_current_time(), ent->exp_time)) + if (rtw_time_after(jiffies, ent->exp_time)) timeout = _TRUE; - ent->exp_time = rtw_get_current_time() + ent->exp_time = jiffies + rtw_ms_to_systime(timeout_ms); break; } - if (rtw_time_after(rtw_get_current_time(), ent->exp_time)) { + if (rtw_time_after(jiffies, ent->exp_time)) { rtw_list_delete(&ent->list); rtw_mfree(ent, sizeof(struct blacklist_ent)); } @@ -1941,7 +1932,7 @@ int rtw_blacklist_add(_queue *blist, const u8 *addr, u32 timeout_ms) ent = rtw_malloc(sizeof(struct blacklist_ent)); if (ent) { memcpy(ent->addr, addr, ETH_ALEN); - ent->exp_time = rtw_get_current_time() + ent->exp_time = jiffies + rtw_ms_to_systime(timeout_ms); rtw_list_insert_tail(&ent->list, head); } @@ -1973,7 +1964,7 @@ int rtw_blacklist_del(_queue *blist, const u8 *addr) break; } - if (rtw_time_after(rtw_get_current_time(), ent->exp_time)) { + if (rtw_time_after(jiffies, ent->exp_time)) { rtw_list_delete(&ent->list); rtw_mfree(ent, sizeof(struct blacklist_ent)); } @@ -1999,7 +1990,7 @@ int rtw_blacklist_search(_queue *blist, const u8 *addr) list = get_next(list); if (_rtw_memcmp(ent->addr, addr, ETH_ALEN) == _TRUE) { - if (rtw_time_after(rtw_get_current_time(), ent->exp_time)) { + if (rtw_time_after(jiffies, ent->exp_time)) { rtw_list_delete(&ent->list); rtw_mfree(ent, sizeof(struct blacklist_ent)); } else @@ -2007,7 +1998,7 @@ int rtw_blacklist_search(_queue *blist, const u8 *addr) break; } - if (rtw_time_after(rtw_get_current_time(), ent->exp_time)) { + if (rtw_time_after(jiffies, ent->exp_time)) { rtw_list_delete(&ent->list); rtw_mfree(ent, sizeof(struct blacklist_ent)); } @@ -2058,7 +2049,7 @@ void dump_blacklist(void *sel, _queue *blist, const char *title) ent = LIST_CONTAINOR(list, struct blacklist_ent, list); list = get_next(list); - if (rtw_time_after(rtw_get_current_time(), ent->exp_time)) + if (rtw_time_after(jiffies, ent->exp_time)) RTW_PRINT_SEL(sel, MAC_FMT" expired\n", MAC_ARG(ent->addr)); else RTW_PRINT_SEL(sel, MAC_FMT" %u\n", MAC_ARG(ent->addr)