Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18e8f98b authored by guangde's avatar guangde Committed by nshrivas
Browse files

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
parent e63a59a4
Loading
Loading
Loading
Loading
+15 −11
Original line number Diff line number Diff line
@@ -657,20 +657,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;
	}

		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);
	}

	if (in_cap_state)
		qdf_spin_unlock_bh(&adapter->host_target_sync_lock);