Просмотр исходного кода

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
guangde 5 лет назад
Родитель
Сommit
45e45e7aff
1 измененных файлов с 15 добавлено и 11 удалено
  1. 15 11
      core/hdd/src/wlan_hdd_tsf.c

+ 15 - 11
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;
 
-	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);
+	}
 
-	/* 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);