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

can: dev: add generic function can_eth_ioctl_hwts()

[ Upstream commit 90f942c5 ]

Tools based on libpcap (such as tcpdump) expect the SIOCSHWTSTAMP
ioctl call to be supported. This is also specified in the kernel doc
[1]. The purpose of this ioctl is to toggle the hardware timestamps.

Currently, CAN devices which support hardware timestamping have those
always activated. can_eth_ioctl_hwts() is a dumb function that will
always succeed when requested to set tx_type to HWTSTAMP_TX_ON or
rx_filter to HWTSTAMP_FILTER_ALL.

[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-9-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 b9a0e6f3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment