/* We need to convert the system time value stored in the RX/TXSTMP registers into a hwtstamp which can be used by the upper level timestamping functions  */
static void igb_systim_to_hwtstamp(struct igb_adapter *adapter, struct skb_shared_hwtstamps *shhwtstamps, u64 regval)
/* We need to convert the system time value stored in the RX/TXSTMP registers into a hwtstamp which can be used by the upper level timestamping functions  */
static void igb_systim_to_hwtstamp(struct igb_adapter *adapter, struct skb_shared_hwtstamps *shhwtstamps, u64 regval)
{
	u64 ns;
	if (adapter->hw.mac.type == e1000_82580)
		regval <<= IGB_82580_TSYNC_SHIFT;
	ns = timecounter_cyc2time(&adapter->clock, regval);
	timecompare_update(&adapter->compare, ns);
	memset(shhwtstamps, 0, sizeof(struct skb_shared_hwtstamps));
	shhwtstamps->hwtstamp = ns_to_ktime(ns);
	shhwtstamps->syststamp = timecompare_transform(&adapter->compare, ns);
}