*PHC*:::
PTP hardware clock (PHC) driver. The parameter is the path to the device of
the PTP clock, which for example can be synchronised by *ptp4l* from
-http://linuxptp.sourceforge.net[*linuxptp*]. PTP clocks are typically kept in
-TAI instead of UTC, so the *offset* option should be used to compensate for the
-current UTC-TAI offset. For example:
+http://linuxptp.sourceforge.net[*linuxptp*]. String *:nocrossts* can be
+appended to the path to disable use of precise cross timestamping. PTP clocks
+are typically kept in TAI instead of UTC, so the *offset* option should be used
+to compensate for the current UTC-TAI offset. For example:
+
----
refclock PHC /dev/ptp0 poll 3 dpoll -2 offset -36
struct phc_instance {
int fd;
int mode;
+ int nocrossts;
};
static int phc_initialise(RCL_Instance instance)
phc = MallocNew(struct phc_instance);
phc->fd = phc_fd;
phc->mode = 0;
+ phc->nocrossts = RCL_GetDriverOption(instance, "nocrossts") ? 1 : 0;
RCL_SetDriverData(instance, phc);
return 1;
phc = (struct phc_instance *)RCL_GetDriverData(instance);
- if (!SYS_Linux_GetPHCSample(phc->fd, 0, RCL_GetPrecision(instance), &phc->mode,
- &phc_ts, &sys_ts, &err))
+ if (!SYS_Linux_GetPHCSample(phc->fd, phc->nocrossts, RCL_GetPrecision(instance),
+ &phc->mode, &phc_ts, &sys_ts, &err))
return 0;
offset = UTI_DiffTimespecsToDouble(&phc_ts, &sys_ts);