ntp: add support for HW timestamping on Linux

Add a new directive to specify interfaces which should be used for HW
timestamping. Extend the Linux ntp_io initialization to enable HW
timestamping, configure the RX filter using the SIOCSHWTSTAMP ioctl,
open their PHC devices, and track them as hwclock instances. When
messages with HW timestamps are received, use the PTP_SYS_OFFSET ioctl
to make PHC samples for hwclock.
This commit is contained in:
Miroslav Lichvar
2016-10-24 12:44:59 +02:00
parent 4449259d88
commit 14a1059e43
5 changed files with 263 additions and 8 deletions

View File

@@ -363,6 +363,9 @@ NIO_Initialise(int family)
#ifdef HAVE_LINUX_TIMESTAMPING
NIO_Linux_Initialise();
#else
if (ARR_GetSize(CNF_GetHwTsInterfaces()))
LOG_FATAL(LOGF_NtpIO, "HW timestamping not supported");
#endif
recv_messages = ARR_CreateInstance(sizeof (struct Message));