config: port: convert 'delay_filter_length' to the new scheme.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
83e26ec68b
commit
eaa70f165f
6
clock.c
6
clock.c
|
@ -819,7 +819,9 @@ struct clock *clock_create(struct config *config, int phc_index,
|
||||||
|
|
||||||
snprintf(udsif->name, sizeof(udsif->name), "%s", uds_path);
|
snprintf(udsif->name, sizeof(udsif->name), "%s", uds_path);
|
||||||
udsif->transport = TRANS_UDS;
|
udsif->transport = TRANS_UDS;
|
||||||
udsif->delay_filter_length = 1;
|
if (config_set_section_int(config, udsif->name, "delay_filter_length", 1)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
c->config = config;
|
c->config = config;
|
||||||
c->free_running = dds->free_running;
|
c->free_running = dds->free_running;
|
||||||
|
@ -874,7 +876,7 @@ struct clock *clock_create(struct config *config, int phc_index,
|
||||||
c->servo_state = SERVO_UNLOCKED;
|
c->servo_state = SERVO_UNLOCKED;
|
||||||
c->servo_type = servo;
|
c->servo_type = servo;
|
||||||
c->tsproc = tsproc_create(dds->tsproc_mode, dds->delay_filter,
|
c->tsproc = tsproc_create(dds->tsproc_mode, dds->delay_filter,
|
||||||
dds->delay_filter_length);
|
config_get_int(config, NULL, "delay_filter_length"));
|
||||||
if (!c->tsproc) {
|
if (!c->tsproc) {
|
||||||
pr_err("Failed to create time stamp processor");
|
pr_err("Failed to create time stamp processor");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
14
config.c
14
config.c
|
@ -95,6 +95,7 @@ struct config_item config_tab[] = {
|
||||||
GLOB_ITEM_INT("assume_two_step", 0, 0, 1),
|
GLOB_ITEM_INT("assume_two_step", 0, 0, 1),
|
||||||
GLOB_ITEM_INT("check_fup_sync", 0, 0, 1),
|
GLOB_ITEM_INT("check_fup_sync", 0, 0, 1),
|
||||||
PORT_ITEM_INT("delayAsymmetry", 0, INT_MIN, INT_MAX),
|
PORT_ITEM_INT("delayAsymmetry", 0, INT_MIN, INT_MAX),
|
||||||
|
PORT_ITEM_INT("delay_filter_length", 10, 1, INT_MAX),
|
||||||
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),
|
||||||
|
@ -355,12 +356,6 @@ static enum parser_result parse_port_setting(struct config *cfg,
|
||||||
else
|
else
|
||||||
return BAD_VALUE;
|
return BAD_VALUE;
|
||||||
|
|
||||||
} else if (!strcmp(option, "delay_filter_length")) {
|
|
||||||
r = get_ranged_int(value, &val, 1, INT_MAX);
|
|
||||||
if (r != PARSED_OK)
|
|
||||||
return r;
|
|
||||||
iface->delay_filter_length = val;
|
|
||||||
|
|
||||||
} else if (!strcmp(option, "boundary_clock_jbod")) {
|
} else if (!strcmp(option, "boundary_clock_jbod")) {
|
||||||
r = get_ranged_int(value, &val, 0, 1);
|
r = get_ranged_int(value, &val, 0, 1);
|
||||||
if (r != PARSED_OK)
|
if (r != PARSED_OK)
|
||||||
|
@ -611,12 +606,6 @@ static enum parser_result parse_global_setting(const char *option,
|
||||||
else
|
else
|
||||||
return BAD_VALUE;
|
return BAD_VALUE;
|
||||||
|
|
||||||
} else if (!strcmp(option, "delay_filter_length")) {
|
|
||||||
r = get_ranged_int(value, &val, 1, INT_MAX);
|
|
||||||
if (r != PARSED_OK)
|
|
||||||
return r;
|
|
||||||
cfg->dds.delay_filter_length = val;
|
|
||||||
|
|
||||||
} else if (!strcmp(option, "boundary_clock_jbod")) {
|
} else if (!strcmp(option, "boundary_clock_jbod")) {
|
||||||
r = get_ranged_int(value, &val, 0, 1);
|
r = get_ranged_int(value, &val, 0, 1);
|
||||||
if (r != PARSED_OK)
|
if (r != PARSED_OK)
|
||||||
|
@ -810,7 +799,6 @@ void config_init_interface(struct interface *iface, struct config *cfg)
|
||||||
sk_get_ts_info(iface->name, &iface->ts_info);
|
sk_get_ts_info(iface->name, &iface->ts_info);
|
||||||
|
|
||||||
iface->delay_filter = cfg->dds.delay_filter;
|
iface->delay_filter = cfg->dds.delay_filter;
|
||||||
iface->delay_filter_length = cfg->dds.delay_filter_length;
|
|
||||||
iface->boundary_clock_jbod = cfg->dds.boundary_clock_jbod;
|
iface->boundary_clock_jbod = cfg->dds.boundary_clock_jbod;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
1
config.h
1
config.h
|
@ -41,7 +41,6 @@ struct interface {
|
||||||
struct sk_ts_info ts_info;
|
struct sk_ts_info ts_info;
|
||||||
enum tsproc_mode tsproc_mode;
|
enum tsproc_mode tsproc_mode;
|
||||||
enum filter_type delay_filter;
|
enum filter_type delay_filter;
|
||||||
int delay_filter_length;
|
|
||||||
int boundary_clock_jbod;
|
int boundary_clock_jbod;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
1
ds.h
1
ds.h
|
@ -61,7 +61,6 @@ struct default_ds {
|
||||||
struct clock_description clock_desc;
|
struct clock_description clock_desc;
|
||||||
enum tsproc_mode tsproc_mode;
|
enum tsproc_mode tsproc_mode;
|
||||||
enum filter_type delay_filter;
|
enum filter_type delay_filter;
|
||||||
int delay_filter_length;
|
|
||||||
int boundary_clock_jbod;
|
int boundary_clock_jbod;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
2
port.c
2
port.c
|
@ -2553,7 +2553,7 @@ struct port *port_open(int phc_index,
|
||||||
|
|
||||||
p->tsproc = tsproc_create(interface->tsproc_mode,
|
p->tsproc = tsproc_create(interface->tsproc_mode,
|
||||||
interface->delay_filter,
|
interface->delay_filter,
|
||||||
interface->delay_filter_length);
|
config_get_int(cfg, p->name, "delay_filter_length"));
|
||||||
if (!p->tsproc) {
|
if (!p->tsproc) {
|
||||||
pr_err("Failed to create time stamp processor");
|
pr_err("Failed to create time stamp processor");
|
||||||
goto err_transport;
|
goto err_transport;
|
||||||
|
|
1
ptp4l.c
1
ptp4l.c
|
@ -74,7 +74,6 @@ static struct config cfg_settings = {
|
||||||
},
|
},
|
||||||
.tsproc_mode = TSPROC_FILTER,
|
.tsproc_mode = TSPROC_FILTER,
|
||||||
.delay_filter = FILTER_MOVING_MEDIAN,
|
.delay_filter = FILTER_MOVING_MEDIAN,
|
||||||
.delay_filter_length = 10,
|
|
||||||
.boundary_clock_jbod = 0,
|
.boundary_clock_jbod = 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue