Apply utc offset correction even when free running.

When using software time stamping and a free running clock, the
statistics appear to be off by the TAI offset. This patch fixes the
issue by setting the internal UTC timescale flag in such cases.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2013-04-05 14:32:24 +02:00
parent fce0aa0a2f
commit 2ec3829bd4
1 changed files with 3 additions and 0 deletions

View File

@ -574,6 +574,9 @@ struct clock *clock_create(int phc_index, struct interface *iface, int count,
if (c->free_running) {
c->clkid = CLOCK_INVALID;
if (timestamping == TS_SOFTWARE || timestamping == TS_LEGACY_HW) {
c->utc_timescale = 1;
}
} else if (phc_index >= 0) {
snprintf(phc, 31, "/dev/ptp%d", phc_index);
c->clkid = phc_open(phc);