config: clock, port: convert 'freq_est_interval' to the new scheme.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
becc6262cc
commit
ffa7d49df6
2
clock.c
2
clock.c
|
@ -823,7 +823,7 @@ struct clock *clock_create(struct config *config, int phc_index,
|
|||
|
||||
c->config = config;
|
||||
c->free_running = dds->free_running;
|
||||
c->freq_est_interval = dds->freq_est_interval;
|
||||
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;
|
||||
c->utc_offset = CURRENT_UTC_OFFSET;
|
||||
|
|
8
config.c
8
config.c
|
@ -97,6 +97,7 @@ struct config_item config_tab[] = {
|
|||
PORT_ITEM_INT("delayAsymmetry", 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),
|
||||
PORT_ITEM_INT("freq_est_interval", 1, 0, INT_MAX),
|
||||
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),
|
||||
|
@ -492,13 +493,6 @@ static enum parser_result parse_global_setting(const char *option,
|
|||
return r;
|
||||
cfg->dds.free_running = val;
|
||||
|
||||
} else if (!strcmp(option, "freq_est_interval")) {
|
||||
r = get_ranged_int(value, &val, 0, INT_MAX);
|
||||
if (r != PARSED_OK)
|
||||
return r;
|
||||
cfg->dds.freq_est_interval = val;
|
||||
pod->freq_est_interval = val;
|
||||
|
||||
} else if (!strcmp(option, "sanity_freq_limit")) {
|
||||
r = get_ranged_int(value, &val, 0, INT_MAX);
|
||||
if (r != PARSED_OK)
|
||||
|
|
2
ds.h
2
ds.h
|
@ -53,7 +53,6 @@ struct clock_description {
|
|||
struct default_ds {
|
||||
struct defaultDS dds;
|
||||
int free_running;
|
||||
int freq_est_interval; /*log seconds*/
|
||||
int grand_master_capable; /*802.1AS only*/
|
||||
int stats_interval; /*log seconds*/
|
||||
int kernel_leap;
|
||||
|
@ -125,7 +124,6 @@ struct portDS {
|
|||
#define FRI_ASAP (-128)
|
||||
|
||||
struct port_defaults {
|
||||
int freq_est_interval; /*log seconds*/
|
||||
struct fault_interval flt_interval_pertype[FT_CNT];
|
||||
UInteger32 neighborPropDelayThresh; /*nanoseconds*/
|
||||
int min_neighbor_prop_delay; /*nanoseconds*/
|
||||
|
|
4
port.c
4
port.c
|
@ -111,6 +111,7 @@ struct port {
|
|||
Integer8 logMinPdelayReqInterval;
|
||||
UInteger32 neighborPropDelayThresh;
|
||||
int follow_up_info;
|
||||
int freq_est_interval;
|
||||
int min_neighbor_prop_delay;
|
||||
int path_trace_enabled;
|
||||
enum fault_type last_fault_type;
|
||||
|
@ -926,7 +927,7 @@ static void port_nrate_calculate(struct port *p, tmv_t origin, tmv_t ingress)
|
|||
|
||||
static void port_nrate_initialize(struct port *p)
|
||||
{
|
||||
int shift = p->pod.freq_est_interval - p->logMinPdelayReqInterval;
|
||||
int shift = p->freq_est_interval - p->logMinPdelayReqInterval;
|
||||
|
||||
if (shift < 0)
|
||||
shift = 0;
|
||||
|
@ -2533,6 +2534,7 @@ struct port *port_open(int phc_index,
|
|||
p->asymmetry = config_get_int(cfg, p->name, "delayAsymmetry");
|
||||
p->asymmetry <<= 16;
|
||||
p->follow_up_info = config_get_int(cfg, p->name, "follow_up_info");
|
||||
p->freq_est_interval = config_get_int(cfg, p->name, "freq_est_interval");
|
||||
p->path_trace_enabled = config_get_int(cfg, p->name, "path_trace_enabled");
|
||||
p->clock = clock;
|
||||
p->trp = transport_create(cfg, interface->transport);
|
||||
|
|
2
ptp4l.c
2
ptp4l.c
|
@ -53,7 +53,6 @@ static struct config cfg_settings = {
|
|||
.domainNumber = 0,
|
||||
},
|
||||
.free_running = 0,
|
||||
.freq_est_interval = 1,
|
||||
.grand_master_capable = 1,
|
||||
.stats_interval = 0,
|
||||
.kernel_leap = 1,
|
||||
|
@ -80,7 +79,6 @@ static struct config cfg_settings = {
|
|||
},
|
||||
|
||||
.pod = {
|
||||
.freq_est_interval = 1,
|
||||
/* Default to very a large neighborPropDelay threshold */
|
||||
.neighborPropDelayThresh = 20000000,
|
||||
.min_neighbor_prop_delay = -20000000,
|
||||
|
|
Loading…
Reference in New Issue