Browse Source

qcacld-3.0: use hwtstamp to pass HW timestamp info

Based on the current codes, Host driver use "tstamp" of skb buffer
structure to store HW timestamp info. But this parameter is designed
for SW timestamp. If host driver fill the value to "tstamp", it will
affect other functions, for example, NTP, PING etc.
The host driver use "hwtstamp" of skb buffer structure to store
the HW timestamp info now.

Change-Id: I8d92e0afe212bc4a5cdad1b30cd12f36ab9a0ebc
CRs-Fixed: 2547514
guangde 5 years ago
parent
commit
44f9ab7ee1
1 changed files with 6 additions and 3 deletions
  1. 6 3
      core/hdd/src/wlan_hdd_tsf.c

+ 6 - 3
core/hdd/src/wlan_hdd_tsf.c

@@ -1439,6 +1439,7 @@ enum hdd_tsf_op_result hdd_netbuf_timestamp(qdf_nbuf_t netbuf,
 {
 	struct hdd_adapter *adapter;
 	struct net_device *net_dev = netbuf->dev;
+	struct skb_shared_hwtstamps hwtstamps;
 
 	if (!net_dev)
 		return HDD_TSF_OP_FAIL;
@@ -1451,7 +1452,9 @@ enum hdd_tsf_op_result hdd_netbuf_timestamp(qdf_nbuf_t netbuf,
 		int32_t ret = hdd_get_soctime_from_tsf64time(adapter,
 				tsf64_time, &soc_time);
 		if (!ret) {
-			netbuf->tstamp = soc_time;
+			hwtstamps.hwtstamp = soc_time;
+			*skb_hwtstamps(netbuf) = hwtstamps;
+			netbuf->tstamp = 0;
 			return HDD_TSF_OP_SUCC;
 		}
 	}
@@ -1503,7 +1506,7 @@ int hdd_tx_timestamp(qdf_nbuf_t netbuf, uint64_t target_time)
 	if (!sk)
 		return -EINVAL;
 
-	if ((skb_shinfo(netbuf)->tx_flags & SKBTX_SW_TSTAMP) &&
+	if ((skb_shinfo(netbuf)->tx_flags & SKBTX_HW_TSTAMP) &&
 	    !(skb_shinfo(netbuf)->tx_flags & SKBTX_IN_PROGRESS)) {
 		struct sock_exterr_skb *serr;
 		qdf_nbuf_t new_netbuf;
@@ -1540,7 +1543,7 @@ int hdd_rx_timestamp(qdf_nbuf_t netbuf, uint64_t target_time)
 		return 0;
 
 	/* reset tstamp when failed */
-	netbuf->tstamp = ns_to_ktime(0);
+	netbuf->tstamp = 0;
 	return -EINVAL;
 }