From f2da3cc48438cf9dc3523177221c954d7121e25f Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Sat, 15 Aug 2015 14:24:33 +0200 Subject: [PATCH] config: convert 'summary_interval' to the new scheme. Signed-off-by: Richard Cochran --- clock.c | 2 +- config.c | 7 +------ ds.h | 1 - ptp4l.c | 1 - 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/clock.c b/clock.c index f31ae42..c64fdaa 100644 --- a/clock.c +++ b/clock.c @@ -882,7 +882,7 @@ struct clock *clock_create(struct config *config, int phc_index, return NULL; } c->nrr = 1.0; - c->stats_interval = dds->stats_interval; + c->stats_interval = config_get_int(config, NULL, "summary_interval"); c->stats.offset = stats_create(); c->stats.freq = stats_create(); c->stats.delay = stats_create(); diff --git a/config.c b/config.c index 24774af..f97cd2d 100644 --- a/config.c +++ b/config.c @@ -123,6 +123,7 @@ struct config_item config_tab[] = { GLOB_ITEM_DBL("pi_proportional_norm_max", 0.7, DBL_MIN, 1.0), GLOB_ITEM_DBL("pi_proportional_scale", 0.0, 0.0, DBL_MAX), GLOB_ITEM_DBL("step_threshold", 0.0, 0.0, DBL_MAX), + GLOB_ITEM_INT("summary_interval", 0, INT_MIN, INT_MAX), PORT_ITEM_INT("syncReceiptTimeout", 0, 0, UINT8_MAX), PORT_ITEM_INT("transportSpecific", 0, 0, 0x0F), GLOB_ITEM_INT("tx_timestamp_timeout", 1, 1, INT_MAX), @@ -552,12 +553,6 @@ static enum parser_result parse_global_setting(const char *option, for (i = 0; i < OUI_LEN; i++) cfg->dds.clock_desc.manufacturerIdentity[i] = oui[i]; - } else if (!strcmp(option, "summary_interval")) { - r = get_ranged_int(value, &val, INT_MIN, INT_MAX); - if (r != PARSED_OK) - return r; - cfg->dds.stats_interval = val; - } else if (!strcmp(option, "kernel_leap")) { r = get_ranged_int(value, &val, 0, 1); if (r != PARSED_OK) diff --git a/ds.h b/ds.h index 1248b7c..b2802cf 100644 --- a/ds.h +++ b/ds.h @@ -52,7 +52,6 @@ struct clock_description { struct default_ds { struct defaultDS dds; - int stats_interval; /*log seconds*/ int kernel_leap; int sanity_freq_limit; int time_source; diff --git a/ptp4l.c b/ptp4l.c index 1070d44..30c43a9 100644 --- a/ptp4l.c +++ b/ptp4l.c @@ -52,7 +52,6 @@ static struct config cfg_settings = { .priority2 = 128, .domainNumber = 0, }, - .stats_interval = 0, .kernel_leap = 1, .sanity_freq_limit = 200000000, .time_source = INTERNAL_OSCILLATOR,