config: convert 'kernel_leap' to the new scheme.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
f2da3cc484
commit
0aff268a4e
2
clock.c
2
clock.c
|
@ -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->free_running = config_get_int(config, NULL, "free_running");
|
||||||
c->freq_est_interval = config_get_int(config, NULL, "freq_est_interval");
|
c->freq_est_interval = config_get_int(config, NULL, "freq_est_interval");
|
||||||
c->grand_master_capable = config_get_int(config, NULL, "gmCapable");
|
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->utc_offset = CURRENT_UTC_OFFSET;
|
||||||
c->time_source = dds->time_source;
|
c->time_source = dds->time_source;
|
||||||
c->desc = dds->clock_desc;
|
c->desc = dds->clock_desc;
|
||||||
|
|
7
config.c
7
config.c
|
@ -104,6 +104,7 @@ struct config_item config_tab[] = {
|
||||||
PORT_ITEM_INT("freq_est_interval", 1, 0, INT_MAX),
|
PORT_ITEM_INT("freq_est_interval", 1, 0, INT_MAX),
|
||||||
GLOB_ITEM_INT("gmCapable", 1, 0, 1),
|
GLOB_ITEM_INT("gmCapable", 1, 0, 1),
|
||||||
PORT_ITEM_INT("ingressLatency", 0, INT_MIN, INT_MAX),
|
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("logAnnounceInterval", 1, INT8_MIN, INT8_MAX),
|
||||||
PORT_ITEM_INT("logMinDelayReqInterval", 0, INT8_MIN, INT8_MAX),
|
PORT_ITEM_INT("logMinDelayReqInterval", 0, INT8_MIN, INT8_MAX),
|
||||||
PORT_ITEM_INT("logMinPdelayReqInterval", 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++)
|
for (i = 0; i < OUI_LEN; i++)
|
||||||
cfg->dds.clock_desc.manufacturerIdentity[i] = oui[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")) {
|
} else if (!strcmp(option, "timeSource")) {
|
||||||
r = get_ranged_int(value, &val, 0x10, 0xfe);
|
r = get_ranged_int(value, &val, 0x10, 0xfe);
|
||||||
if (r != PARSED_OK)
|
if (r != PARSED_OK)
|
||||||
|
|
1
ds.h
1
ds.h
|
@ -52,7 +52,6 @@ struct clock_description {
|
||||||
|
|
||||||
struct default_ds {
|
struct default_ds {
|
||||||
struct defaultDS dds;
|
struct defaultDS dds;
|
||||||
int kernel_leap;
|
|
||||||
int sanity_freq_limit;
|
int sanity_freq_limit;
|
||||||
int time_source;
|
int time_source;
|
||||||
struct clock_description clock_desc;
|
struct clock_description clock_desc;
|
||||||
|
|
3
ptp4l.c
3
ptp4l.c
|
@ -52,7 +52,6 @@ static struct config cfg_settings = {
|
||||||
.priority2 = 128,
|
.priority2 = 128,
|
||||||
.domainNumber = 0,
|
.domainNumber = 0,
|
||||||
},
|
},
|
||||||
.kernel_leap = 1,
|
|
||||||
.sanity_freq_limit = 200000000,
|
.sanity_freq_limit = 200000000,
|
||||||
.time_source = INTERNAL_OSCILLATOR,
|
.time_source = INTERNAL_OSCILLATOR,
|
||||||
.clock_desc = {
|
.clock_desc = {
|
||||||
|
@ -246,7 +245,7 @@ int main(int argc, char *argv[])
|
||||||
ds->clockQuality.clockClass = 255;
|
ds->clockQuality.clockClass = 255;
|
||||||
}
|
}
|
||||||
if (cfg_settings.clock_servo == CLOCK_SERVO_NTPSHM) {
|
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;
|
cfg_settings.dds.sanity_freq_limit = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue