Commit f44124f4 authored by Vincent Mailhol's avatar Vincent Mailhol Committed by Greg Kroah-Hartman
Browse files

can: etas_es58x: advertise timestamping capabilities and add ioctl support

[ Upstream commit 1d46efa0 ]

Currently, userland has no method to query which timestamping features
are supported by the etas_es58x driver (aside maybe of getting RX
messages and observe whether or not hardware timestamps stay at zero).

The canonical way for a network driver to advertise what kind of
timestamping is supports is to implement
ethtool_ops::get_ts_info(). Here, we use the CAN specific
can_ethtool_op_get_ts_info_hwts() function to achieve this.

In addition, the driver currently does not support the hardware
timestamps ioctls. According to [1], SIOCSHWTSTAMP is "must" and
SIOCGHWTSTAMP is "should". This patch fills up that gap by
implementing net_device_ops::ndo_eth_ioctl() using the CAN specific
function can_eth_ioctl_hwts().

[1] kernel doc Timestamping, section 3.1: "Hardware Timestamping
Implementation: Device Drivers"
Link: https://docs.kernel.org/networking/timestamping.html#hardware-timestamping-implementation-device-drivers



Signed-off-by: default avatarVincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://lore.kernel.org/all/20220727101641.198847-11-mailhol.vincent@wanadoo.fr


Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
Stable-dep-of: 38c0abad ("can: etas_es58x: populate ndo_change_mtu() to prevent buffer overflow")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 0a6e1bd2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment