diff --git a/clock.c b/clock.c index 274a6a0..ea2d97e 100644 --- a/clock.c +++ b/clock.c @@ -79,6 +79,7 @@ struct clock { int utc_timescale; int leap_set; int kernel_leap; + int time_source; /* grand master role */ enum servo_state servo_state; tmv_t master_offset; tmv_t path_delay; @@ -436,7 +437,7 @@ static void clock_update_grandmaster(struct clock *c) } else { c->tds.flags = PTP_TIMESCALE; } - c->tds.timeSource = INTERNAL_OSCILLATOR; + c->tds.timeSource = c->time_source; } static void clock_update_slave(struct clock *c) @@ -570,6 +571,7 @@ struct clock *clock_create(int phc_index, struct interface *iface, int count, c->free_running = dds->free_running; c->freq_est_interval = dds->freq_est_interval; c->kernel_leap = dds->kernel_leap; + c->time_source = dds->time_source; c->desc = dds->clock_desc; if (c->free_running) { diff --git a/ds.h b/ds.h index f653aee..9977e40 100644 --- a/ds.h +++ b/ds.h @@ -54,6 +54,7 @@ struct default_ds { int freq_est_interval; /*log seconds*/ int stats_interval; /*log seconds*/ int kernel_leap; + int time_source; struct clock_description clock_desc; }; diff --git a/ptp4l.c b/ptp4l.c index 1e0304e..632166c 100644 --- a/ptp4l.c +++ b/ptp4l.c @@ -54,6 +54,7 @@ static struct config cfg_settings = { .freq_est_interval = 1, .stats_interval = 0, .kernel_leap = 1, + .time_source = INTERNAL_OSCILLATOR, .clock_desc = { .productDescription = { .max_symbols = 64,