On Thu. 28 juil. 2022 at 18:42, Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> wrote: > 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 <mailhol.vincent@xxxxxxxxxx> > > [...] > > > 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. Thanks for catching this. mscan does not show up in the menuconfig by default because it requires CONFIG_PPC. And it is not possible to add CONFIG_COMPILE_TEST to mscan's KBUILD file because some PPC specific symbols would be missing. So this is yet another pitfall. Yours sincerely, Vincent Mailhol