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

Commit 1e691e36 authored by Jiani Liu's avatar Jiani Liu
Browse files

qcacld-3.0: Add qtime & host_time in __hdd_wlan_tsf_show

Add qtime & host_time in __hdd_wlan_tsf_show, so that "cat tsf" will
print out qtime and host_time at the instant.

Change-Id: I4da440f92b7415440f9064a49777c3c3680ac1b1
CRs-Fixed: 2461503
parent 015b793a
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -873,7 +873,7 @@ static ssize_t __hdd_wlan_tsf_show(struct device *dev,
	struct hdd_station_ctx *hdd_sta_ctx;
	struct hdd_adapter *adapter;
	struct hdd_context *hdd_ctx;
	uint64_t tsf_sync_qtime;
	uint64_t tsf_sync_qtime, host_time, reg_qtime, qtime;
	ssize_t size;

	struct net_device *net_dev = container_of(dev, struct net_device, dev);
@@ -900,17 +900,25 @@ static ssize_t __hdd_wlan_tsf_show(struct device *dev,
	tsf_sync_qtime = adapter->last_tsf_sync_soc_time;
	do_div(tsf_sync_qtime, NSEC_PER_USEC);

	reg_qtime = qdf_get_log_timestamp();
	host_time = hdd_get_monotonic_host_time(hdd_ctx);

	qtime = qdf_log_timestamp_to_usecs(reg_qtime);
	do_div(host_time, NSEC_PER_USEC);

	if (adapter->device_mode == QDF_STA_MODE ||
	    adapter->device_mode == QDF_P2P_CLIENT_MODE) {
		size = scnprintf(buf, PAGE_SIZE, "%s%llu %llu %pM\n",
		size = scnprintf(buf, PAGE_SIZE, "%s%llu %llu %pM %llu %llu\n",
				 buf, adapter->last_target_time,
				 tsf_sync_qtime,
				 hdd_sta_ctx->conn_info.bssId.bytes);
				 hdd_sta_ctx->conn_info.bssId.bytes,
				 qtime, host_time);
	} else {
		size = scnprintf(buf, PAGE_SIZE, "%s%llu %llu %pM\n",
		size = scnprintf(buf, PAGE_SIZE, "%s%llu %llu %pM %llu %llu\n",
				 buf, adapter->last_target_time,
				 tsf_sync_qtime,
				 adapter->mac_addr.bytes);
				 adapter->mac_addr.bytes,
				 qtime, host_time);
	}

	return size;