This saves a few bytes of static storage and less instructions are
executed when looking for the best offset.
Signed-off-by: Georg Sauthoff <mail@gms.tf>
The sysoff_measure() function gained an additional parameter some time
ago, but the legacy method for older kernels without PTP_SYS_OFFSET was
overlooked. This patch brings the legacy method up to date again.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
This is a more accurate variant of the the PTP_SYS_OFFSET ioctl, which
will probably be supported in future kernel versions.
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
This ioctl uses cross timestamping for a more accurate measurement of
the offset. It is supported on some onboard Intel NICs using the e1000e
driver and a virtual PHC with the ptp_kvm driver.
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
The kernel supports different PTP_SYS_OFFSET* ioctls. Use the sysoff
enum to allow selecting between them in sysoff_measure().
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
If the delay is known, print it together with the offset and frequency.
Remove the time stamp from the output to fit it into 80 chars.
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>