diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c index 7164a99..57b5d44 100644 --- a/drivers/net/can/sja1000/sja1000.c +++ b/drivers/net/can/sja1000/sja1000.c @@ -326,6 +326,8 @@ static void sja1000_rx(struct net_device *dev) struct net_device_stats *stats = &dev->stats; struct can_frame *cf; struct sk_buff *skb; + struct timespec tsraw, tsreal; + struct skb_shared_hwtstamps *hwts; uint8_t fi; uint8_t dreg; canid_t id; @@ -366,6 +368,11 @@ static void sja1000_rx(struct net_device *dev) /* release receive buffer */ sja1000_write_cmdreg(priv, CMD_RRB); + getnstime_raw_and_real(&tsraw, &tsreal); + skb->tstamp = timespec_to_ktime(tsreal); + hwts = skb_hwtstamps(skb); + hwts->syststamp = timespec_to_ktime(tsraw); + netif_rx(skb); stats->rx_packets++; diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 947ba25..19fc013 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -431,8 +431,6 @@ ktime_t ktime_get_clocktai(void) } EXPORT_SYMBOL(ktime_get_clocktai); -#ifdef CONFIG_NTP_PPS - /** * getnstime_raw_and_real - get day and raw monotonic time in timespec format * @ts_raw: pointer to the timespec to be set to raw monotonic time @@ -467,8 +465,6 @@ void getnstime_raw_and_real(struct timespec *ts_raw, struct timespec *ts_real) } EXPORT_SYMBOL(getnstime_raw_and_real); -#endif /* CONFIG_NTP_PPS */ - /** * do_gettimeofday - Returns the time of day in a timeval * @tv: pointer to the timeval to be set