]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
can: tree-wide: advertise software timestamping capabilities
authorVincent Mailhol <mailhol.vincent@wanadoo.fr>
Wed, 27 Jul 2022 10:16:32 +0000 (19:16 +0900)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 28 Jul 2022 09:44:01 +0000 (11:44 +0200)
commit409c188c57cdb5cb1dfcac79e72b5169f0463fe4
tree7a1f501d9a814c5d8730d9d090a2595b015ab0d8
parent6a37a28b1864c447a20a1609f90f3e2dfaff0705
can: tree-wide: advertise software timestamping capabilities

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@wanadoo.fr>
Link: https://lore.kernel.org/all/20220727101641.198847-6-mailhol.vincent@wanadoo.fr
[mkl: mscan: add missing mscan_ethtool_ops]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
30 files changed:
drivers/net/can/at91_can.c
drivers/net/can/c_can/c_can_ethtool.c
drivers/net/can/can327.c
drivers/net/can/cc770/cc770.c
drivers/net/can/ctucanfd/ctucanfd_base.c
drivers/net/can/flexcan/flexcan-ethtool.c
drivers/net/can/grcan.c
drivers/net/can/ifi_canfd/ifi_canfd.c
drivers/net/can/janz-ican3.c
drivers/net/can/m_can/m_can.c
drivers/net/can/mscan/mscan.c
drivers/net/can/pch_can.c
drivers/net/can/rcar/rcar_can.c
drivers/net/can/rcar/rcar_canfd.c
drivers/net/can/sja1000/sja1000.c
drivers/net/can/slcan/slcan-ethtool.c
drivers/net/can/softing/softing_main.c
drivers/net/can/spi/hi311x.c
drivers/net/can/spi/mcp251x.c
drivers/net/can/sun4i_can.c
drivers/net/can/ti_hecc.c
drivers/net/can/usb/ems_usb.c
drivers/net/can/usb/esd_usb.c
drivers/net/can/usb/gs_usb.c
drivers/net/can/usb/mcba_usb.c
drivers/net/can/usb/ucan.c
drivers/net/can/usb/usb_8dev.c
drivers/net/can/vcan.c
drivers/net/can/vxcan.c
drivers/net/can/xilinx_can.c