config: convert 'kernel_leap' to the new scheme.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2015-08-15 14:29:04 +02:00
parent f2da3cc484
commit 0aff268a4e
4 changed files with 3 additions and 10 deletions

View File

@ -827,7 +827,7 @@ struct clock *clock_create(struct config *config, int phc_index,
c->free_running = config_get_int(config, NULL, "free_running");
c->freq_est_interval = config_get_int(config, NULL, "freq_est_interval");
c->grand_master_capable = config_get_int(config, NULL, "gmCapable");
c->kernel_leap = dds->kernel_leap;
c->kernel_leap = config_get_int(config, NULL, "kernel_leap");
c->utc_offset = CURRENT_UTC_OFFSET;
c->time_source = dds->time_source;
c->desc = dds->clock_desc;

View File

@ -104,6 +104,7 @@ struct config_item config_tab[] = {
PORT_ITEM_INT("freq_est_interval", 1, 0, INT_MAX),
GLOB_ITEM_INT("gmCapable", 1, 0, 1),
PORT_ITEM_INT("ingressLatency", 0, INT_MIN, INT_MAX),
GLOB_ITEM_INT("kernel_leap", 1, 0, 1),
PORT_ITEM_INT("logAnnounceInterval", 1, INT8_MIN, INT8_MAX),
PORT_ITEM_INT("logMinDelayReqInterval", 0, INT8_MIN, INT8_MAX),
PORT_ITEM_INT("logMinPdelayReqInterval", 0, INT8_MIN, INT8_MAX),
@ -553,12 +554,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, "kernel_leap")) {
r = get_ranged_int(value, &val, 0, 1);
if (r != PARSED_OK)
return r;
cfg->dds.kernel_leap = val;
} else if (!strcmp(option, "timeSource")) {
r = get_ranged_int(value, &val, 0x10, 0xfe);
if (r != PARSED_OK)

1
ds.h
View File

@ -52,7 +52,6 @@ struct clock_description {
struct default_ds {
struct defaultDS dds;
int kernel_leap;
int sanity_freq_limit;
int time_source;
struct clock_description clock_desc;

View File

@ -52,7 +52,6 @@ static struct config cfg_settings = {
.priority2 = 128,
.domainNumber = 0,
},
.kernel_leap = 1,
.sanity_freq_limit = 200000000,
.time_source = INTERNAL_OSCILLATOR,
.clock_desc = {
@ -246,7 +245,7 @@ int main(int argc, char *argv[])
ds->clockQuality.clockClass = 255;
}
if (cfg_settings.clock_servo == CLOCK_SERVO_NTPSHM) {
cfg_settings.dds.kernel_leap = 0;
config_set_int(cfg, "kernel_leap", 0);
cfg_settings.dds.sanity_freq_limit = 0;
}