aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/networking
diff options
context:
space:
mode:
authorStefan Tatschner <rumpelsepp@sevenbyte.org>2015-11-24 09:06:29 -0500
committerJonathan Corbet <corbet@lwn.net>2015-12-10 13:29:11 -0500
commitaecd89e85534d31b161bbe16e31d98f67947e1eb (patch)
treeeff6df8fafb57c543a94a518dfa56568e094cc4c /Documentation/networking
parentbcebb4cc20c8932f614d273a065190fe3614ca42 (diff)
can-doc: Add hint about getting timestamps
This patch adds a hint about how to get timestamps of received CAN frames with ioctl(2). This hint has been applied to the former SocketCAN Documentation, but it got lost during mainlining the first bits and pieces to linux kernel. Signed-off-by: Stefan Tatschner <rumpelsepp@sevenbyte.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/networking')
-rw-r--r--Documentation/networking/can.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/Documentation/networking/can.txt b/Documentation/networking/can.txt
index 05fd83bb3596..6ab619fcc517 100644
--- a/Documentation/networking/can.txt
+++ b/Documentation/networking/can.txt
@@ -372,6 +372,15 @@ solution for a couple of reasons:
372 nbytes = sendto(s, &frame, sizeof(struct can_frame), 372 nbytes = sendto(s, &frame, sizeof(struct can_frame),
373 0, (struct sockaddr*)&addr, sizeof(addr)); 373 0, (struct sockaddr*)&addr, sizeof(addr));
374 374
375 An accurate timestamp can be obtained with an ioctl(2) call after reading
376 a message from the socket:
377
378 struct timeval tv;
379 ioctl(s, SIOCGSTAMP, &tv);
380
381 The timestamp has a resolution of one microsecond and is set automatically
382 at the reception of a CAN frame.
383
375 Remark about CAN FD (flexible data rate) support: 384 Remark about CAN FD (flexible data rate) support:
376 385
377 Generally the handling of CAN FD is very similar to the formerly described 386 Generally the handling of CAN FD is very similar to the formerly described