}
EXPORT_SYMBOL_GPL(rcar_gen4_ptp_clock_index);
+void rcar_gen4_ptp_gettime64(struct rcar_gen4_ptp_private *priv,
+ struct timespec64 *ts)
+{
+ if (!priv->initialized)
+ return;
+
+ priv->info.gettime64(&priv->info, ts);
+}
+EXPORT_SYMBOL_GPL(rcar_gen4_ptp_gettime64);
+
MODULE_AUTHOR("Yoshihiro Shimoda");
MODULE_DESCRIPTION("Renesas R-Car Gen4 gPTP driver");
MODULE_LICENSE("GPL");
void __iomem *addr);
int rcar_gen4_ptp_clock_index(struct rcar_gen4_ptp_private *priv);
+void rcar_gen4_ptp_gettime64(struct rcar_gen4_ptp_private *priv,
+ struct timespec64 *ts);
#endif /* #ifndef __RCAR_GEN4_PTP_H__ */
}
}
-static void rtsn_get_timestamp(struct rtsn_private *priv, struct timespec64 *ts)
-{
- struct rcar_gen4_ptp_private *ptp_priv = priv->ptp_priv;
-
- ptp_priv->info.gettime64(&ptp_priv->info, ts);
-}
-
static int rtsn_tx_free(struct net_device *ndev, bool free_txed_only)
{
struct rtsn_private *priv = netdev_priv(ndev);
struct skb_shared_hwtstamps shhwtstamps;
struct timespec64 ts;
- rtsn_get_timestamp(priv, &ts);
+ rcar_gen4_ptp_gettime64(priv->ptp_priv, &ts);
memset(&shhwtstamps, 0, sizeof(shhwtstamps));
shhwtstamps.hwtstamp = timespec64_to_ktime(ts);
skb_tstamp_tx(skb, &shhwtstamps);