On 27.07.2022 19:16:32, Vincent Mailhol wrote: > Currently, some CAN drivers support hardware timestamping, some do > not. But userland has no method to query which features are supported > (aside maybe of getting RX messages and observe whether or not > hardware timestamps stay at zero). > > The canonical way for a network driver to advertised what kind of > timestamping it supports is to implement ethtool_ops::get_ts_info(). > > This patch only targets the CAN drivers which *do not* support > hardware timestamping. For each of those CAN drivers, implement the > get_ts_info() using the generic ethtool_op_get_ts_info(). > > This way, userland can do: > > | $ ethtool --show-time-stamping canX > > to confirm the device timestamping capacities. > > N.B. the drivers which support hardware timestamping will be migrated > in separate patches. > > Signed-off-by: Vincent Mailhol [...] > diff --git a/drivers/net/can/mscan/mscan.c b/drivers/net/can/mscan/mscan.c > index 78a21ab63601..b1677588a4c8 100644 > --- a/drivers/net/can/mscan/mscan.c > +++ b/drivers/net/can/mscan/mscan.c > @@ -676,6 +676,7 @@ struct net_device *alloc_mscandev(void) > priv = netdev_priv(dev); > > dev->netdev_ops = &mscan_netdev_ops; > + dev->ethtool_ops = &mscan_ethtool_ops; > > dev->flags |= IFF_ECHO; /* we support local echo */ | drivers/net/can/mscan/mscan.c: In function ‘alloc_mscandev’: | drivers/net/can/mscan/mscan.c:679:29: error: ‘mscan_ethtool_ops’ undeclared (first use in this function) | 679 | dev->ethtool_ops = &mscan_ethtool_ops; | | ^~~~~~~~~~~~~~~~~ | drivers/net/can/mscan/mscan.c:679:29: note: each undeclared identifier is reported only once for each function it appears in I'm fixing this. Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |