From 45e45e7aff331e42026723e99c103c5180f69727 Mon Sep 17 00:00:00 2001 From: guangde Date: Fri, 12 Jul 2019 10:21:31 +0800 Subject: [PATCH] qcacld-3.0: update Rx timestamp every time Host fill netbuf with qtime instead of tsf. In function "hdd_get_soctime_from_tsf64time", when Host check RX packet tsf value less than last_target_global_tsf_time, it will return error. Then, Host will the default value 0 to upper layer.Sometimes, User will found some packets FW recvTime is not increasing compared with last packets. So modify it to calculate qtime from tsf all the time. Change-Id: Icc53f22b4213fb46ff3bfc3e3df940cb28c632f5 CRs-Fixed: 2485600 --- core/hdd/src/wlan_hdd_tsf.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/core/hdd/src/wlan_hdd_tsf.c b/core/hdd/src/wlan_hdd_tsf.c index 7e97f6d2b5cd..bb50d6faa29a 100644 --- a/core/hdd/src/wlan_hdd_tsf.c +++ b/core/hdd/src/wlan_hdd_tsf.c @@ -709,20 +709,24 @@ static inline int32_t hdd_get_soctime_from_tsf64time( qdf_spin_lock_bh(&adapter->host_target_sync_lock); /* at present, target_time is 64bit (g_tsf64), us*/ - if (tsf64_time > adapter->last_target_global_tsf_time) + if (tsf64_time > adapter->last_target_global_tsf_time) { delta64_tsf64time = tsf64_time - - adapter->last_target_global_tsf_time; - else { - if (in_cap_state) - qdf_spin_unlock_bh(&adapter->host_target_sync_lock); - return -EINVAL; + adapter->last_target_global_tsf_time; + delta64_soctime = delta64_tsf64time * NSEC_PER_USEC; + + /* soc_time (ns)*/ + ret = hdd_uint64_plus(adapter->last_tsf_sync_soc_time, + delta64_soctime, soc_time); + } else { + delta64_tsf64time = adapter->last_target_global_tsf_time - + tsf64_time; + delta64_soctime = delta64_tsf64time * NSEC_PER_USEC; + + /* soc_time (ns)*/ + ret = hdd_uint64_minus(adapter->last_tsf_sync_soc_time, + delta64_soctime, soc_time); } - delta64_soctime = delta64_tsf64time * NSEC_PER_USEC; - - /* soc_time (ns)*/ - ret = hdd_uint64_plus(adapter->last_tsf_sync_soc_time, - delta64_soctime, soc_time); if (in_cap_state) qdf_spin_unlock_bh(&adapter->host_target_sync_lock);