config: convert 'free_running' to the new scheme.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2015-08-15 14:11:17 +02:00
parent 38c891b2c8
commit 5eeea13652
4 changed files with 3 additions and 10 deletions

View File

@ -824,7 +824,7 @@ struct clock *clock_create(struct config *config, int phc_index,
}
c->config = config;
c->free_running = dds->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->grand_master_capable = dds->grand_master_capable;
c->kernel_leap = dds->kernel_leap;

View File

@ -100,6 +100,7 @@ struct config_item config_tab[] = {
PORT_ITEM_INT("egressLatency", 0, INT_MIN, INT_MAX),
GLOB_ITEM_DBL("first_step_threshold", 0.00002, 0.0, DBL_MAX),
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),
PORT_ITEM_INT("ingressLatency", 0, INT_MIN, INT_MAX),
PORT_ITEM_INT("logAnnounceInterval", 1, INT8_MIN, INT8_MAX),
@ -454,12 +455,6 @@ static enum parser_result parse_global_setting(const char *option,
return r;
dds->clockQuality.offsetScaledLogVariance = uval;
} else if (!strcmp(option, "free_running")) {
r = get_ranged_int(value, &val, 0, 1);
if (r != PARSED_OK)
return r;
cfg->dds.free_running = val;
} else if (!strcmp(option, "sanity_freq_limit")) {
r = get_ranged_int(value, &val, 0, INT_MAX);
if (r != PARSED_OK)

1
ds.h
View File

@ -52,7 +52,6 @@ struct clock_description {
struct default_ds {
struct defaultDS dds;
int free_running;
int grand_master_capable; /*802.1AS only*/
int stats_interval; /*log seconds*/
int kernel_leap;

View File

@ -52,7 +52,6 @@ static struct config cfg_settings = {
.priority2 = 128,
.domainNumber = 0,
},
.free_running = 0,
.grand_master_capable = 1,
.stats_interval = 0,
.kernel_leap = 1,
@ -313,7 +312,7 @@ int main(int argc, char *argv[])
/* determine PHC Clock index */
iface = STAILQ_FIRST(&cfg_settings.interfaces);
if (cfg_settings.dds.free_running) {
if (config_get_int(cfg, NULL, "free_running")) {
phc_index = -1;
} else if (*timestamping == TS_SOFTWARE || *timestamping == TS_LEGACY_HW) {
phc_index = -1;