config: convert 'gmCapable' to the new scheme.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
5eeea13652
commit
2816133b5e
2
clock.c
2
clock.c
|
@ -826,7 +826,7 @@ struct clock *clock_create(struct config *config, int phc_index,
|
|||
c->config = config;
|
||||
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 = dds->grand_master_capable;
|
||||
c->grand_master_capable = config_get_int(config, NULL, "gmCapable");
|
||||
c->kernel_leap = dds->kernel_leap;
|
||||
c->utc_offset = CURRENT_UTC_OFFSET;
|
||||
c->time_source = dds->time_source;
|
||||
|
|
7
config.c
7
config.c
|
@ -102,6 +102,7 @@ struct config_item config_tab[] = {
|
|||
PORT_ITEM_INT("follow_up_info", 0, 0, 1),
|
||||
GLOB_ITEM_INT("free_running", 0, 0, 1),
|
||||
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),
|
||||
PORT_ITEM_INT("logAnnounceInterval", 1, INT8_MIN, INT8_MAX),
|
||||
PORT_ITEM_INT("logMinDelayReqInterval", 0, INT8_MIN, INT8_MAX),
|
||||
|
@ -412,12 +413,6 @@ static enum parser_result parse_global_setting(const char *option,
|
|||
dds->flags &= ~DDS_SLAVE_ONLY;
|
||||
}
|
||||
|
||||
} else if (!strcmp(option, "gmCapable")) {
|
||||
r = get_ranged_int(value, &val, 0, 1);
|
||||
if (r != PARSED_OK)
|
||||
return r;
|
||||
cfg->dds.grand_master_capable = val;
|
||||
|
||||
} else if (!strcmp(option, "priority1")) {
|
||||
r = get_ranged_uint(value, &uval, 0, UINT8_MAX);
|
||||
if (r != PARSED_OK)
|
||||
|
|
1
ds.h
1
ds.h
|
@ -52,7 +52,6 @@ struct clock_description {
|
|||
|
||||
struct default_ds {
|
||||
struct defaultDS dds;
|
||||
int grand_master_capable; /*802.1AS only*/
|
||||
int stats_interval; /*log seconds*/
|
||||
int kernel_leap;
|
||||
int sanity_freq_limit;
|
||||
|
|
5
ptp4l.c
5
ptp4l.c
|
@ -52,7 +52,6 @@ static struct config cfg_settings = {
|
|||
.priority2 = 128,
|
||||
.domainNumber = 0,
|
||||
},
|
||||
.grand_master_capable = 1,
|
||||
.stats_interval = 0,
|
||||
.kernel_leap = 1,
|
||||
.sanity_freq_limit = 200000000,
|
||||
|
@ -237,13 +236,13 @@ int main(int argc, char *argv[])
|
|||
sk_check_fupsync = config_get_int(cfg, NULL, "check_fup_sync");
|
||||
sk_tx_timeout = config_get_int(cfg, NULL, "tx_timestamp_timeout");
|
||||
|
||||
if (!cfg_settings.dds.grand_master_capable &&
|
||||
if (!config_get_int(cfg, NULL, "gmCapable") &&
|
||||
ds->flags & DDS_SLAVE_ONLY) {
|
||||
fprintf(stderr,
|
||||
"Cannot mix 1588 slaveOnly with 802.1AS !gmCapable.\n");
|
||||
return -1;
|
||||
}
|
||||
if (!cfg_settings.dds.grand_master_capable ||
|
||||
if (!config_get_int(cfg, NULL, "gmCapable") ||
|
||||
ds->flags & DDS_SLAVE_ONLY) {
|
||||
ds->clockQuality.clockClass = 255;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue