config: convert 'free_running' to the new scheme.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
38c891b2c8
commit
5eeea13652
2
clock.c
2
clock.c
|
@ -824,7 +824,7 @@ struct clock *clock_create(struct config *config, int phc_index,
|
||||||
}
|
}
|
||||||
|
|
||||||
c->config = config;
|
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->freq_est_interval = config_get_int(config, NULL, "freq_est_interval");
|
||||||
c->grand_master_capable = dds->grand_master_capable;
|
c->grand_master_capable = dds->grand_master_capable;
|
||||||
c->kernel_leap = dds->kernel_leap;
|
c->kernel_leap = dds->kernel_leap;
|
||||||
|
|
7
config.c
7
config.c
|
@ -100,6 +100,7 @@ struct config_item config_tab[] = {
|
||||||
PORT_ITEM_INT("egressLatency", 0, INT_MIN, INT_MAX),
|
PORT_ITEM_INT("egressLatency", 0, INT_MIN, INT_MAX),
|
||||||
GLOB_ITEM_DBL("first_step_threshold", 0.00002, 0.0, DBL_MAX),
|
GLOB_ITEM_DBL("first_step_threshold", 0.00002, 0.0, DBL_MAX),
|
||||||
PORT_ITEM_INT("follow_up_info", 0, 0, 1),
|
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("freq_est_interval", 1, 0, INT_MAX),
|
||||||
PORT_ITEM_INT("ingressLatency", 0, INT_MIN, INT_MAX),
|
PORT_ITEM_INT("ingressLatency", 0, INT_MIN, INT_MAX),
|
||||||
PORT_ITEM_INT("logAnnounceInterval", 1, INT8_MIN, INT8_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;
|
return r;
|
||||||
dds->clockQuality.offsetScaledLogVariance = uval;
|
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")) {
|
} else if (!strcmp(option, "sanity_freq_limit")) {
|
||||||
r = get_ranged_int(value, &val, 0, INT_MAX);
|
r = get_ranged_int(value, &val, 0, INT_MAX);
|
||||||
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 free_running;
|
|
||||||
int grand_master_capable; /*802.1AS only*/
|
int grand_master_capable; /*802.1AS only*/
|
||||||
int stats_interval; /*log seconds*/
|
int stats_interval; /*log seconds*/
|
||||||
int kernel_leap;
|
int kernel_leap;
|
||||||
|
|
3
ptp4l.c
3
ptp4l.c
|
@ -52,7 +52,6 @@ static struct config cfg_settings = {
|
||||||
.priority2 = 128,
|
.priority2 = 128,
|
||||||
.domainNumber = 0,
|
.domainNumber = 0,
|
||||||
},
|
},
|
||||||
.free_running = 0,
|
|
||||||
.grand_master_capable = 1,
|
.grand_master_capable = 1,
|
||||||
.stats_interval = 0,
|
.stats_interval = 0,
|
||||||
.kernel_leap = 1,
|
.kernel_leap = 1,
|
||||||
|
@ -313,7 +312,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
/* determine PHC Clock index */
|
/* determine PHC Clock index */
|
||||||
iface = STAILQ_FIRST(&cfg_settings.interfaces);
|
iface = STAILQ_FIRST(&cfg_settings.interfaces);
|
||||||
if (cfg_settings.dds.free_running) {
|
if (config_get_int(cfg, NULL, "free_running")) {
|
||||||
phc_index = -1;
|
phc_index = -1;
|
||||||
} else if (*timestamping == TS_SOFTWARE || *timestamping == TS_LEGACY_HW) {
|
} else if (*timestamping == TS_SOFTWARE || *timestamping == TS_LEGACY_HW) {
|
||||||
phc_index = -1;
|
phc_index = -1;
|
||||||
|
|
Loading…
Reference in New Issue