diff options
author | 2022-08-22 12:01:10 +0200 | |
---|---|---|
committer | 2022-09-06 08:21:47 +0200 | |
commit | 45dfa45f52e66f8eee30a64b16550a9c47915044 (patch) | |
tree | 64534cc5b2a1b9f863492bd8f3de065400327ad8 /drivers/net/phy | |
parent | can: gs_usb: use common spelling of GS_USB in macros (diff) | |
download | linux-45dfa45f52e6.tar.gz linux-45dfa45f52e6.tar.bz2 linux-45dfa45f52e6.zip |
can: gs_usb: add RX and TX hardware timestamp support
Add support for hardware timestamps, if the firmware includes it as a
feature via the GS_CAN_FEATURE_HW_TIMESTAMP flag. Check for this
feature during probe, extend the RX expected length if it is and
enable it during open.
The struct classic_can_ts and struct canfd_ts are extended to include
the µs timestamp following data as defined in the firmware. The
timestamp is then captured and set using skb_hwtstamps() on each RX
and TX.
The frame µs timestamp is provided from a 32 bit 1 MHz timer which
rolls over every 4294 seconds, so a cyclecounter, timecounter, and
delayed worker are used to convert the timer into a proper ns
timestamp - same implementation as commit efd8d98dfb900 ("can:
mcp251xfd: add HW timestamp infrastructure").
Hardware timestamps are added to capabilities as commit
b1f6b93e678f ("can: mcp251xfd: advertise timestamping capabilities and
add ioctl support").
Signed-off-by: John Whittington <git@jbrengineering.co.uk>
Link: https://github.com/candle-usb/candleLight_fw/issues/100
Link: https://lore.kernel.org/all/20220827221548.3291393-3-mkl@pengutronix.de
Co-developed-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/phy')
0 files changed, 0 insertions, 0 deletions