config: port: convert 'egressLatency' to the new scheme.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
3ff0e4a589
commit
a19318b413
9
config.c
9
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("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),
|
||||||
PORT_ITEM_INT("freq_est_interval", 1, 0, INT_MAX),
|
PORT_ITEM_INT("freq_est_interval", 1, 0, INT_MAX),
|
||||||
|
@ -273,13 +274,7 @@ static enum parser_result parse_pod_setting(const char *option,
|
||||||
int val;
|
int val;
|
||||||
enum parser_result r;
|
enum parser_result r;
|
||||||
|
|
||||||
if (!strcmp(option, "egressLatency")) {
|
if (!strcmp(option, "ingressLatency")) {
|
||||||
r = get_ranged_int(value, &val, INT_MIN, INT_MAX);
|
|
||||||
if (r != PARSED_OK)
|
|
||||||
return r;
|
|
||||||
pod->tx_timestamp_offset = val;
|
|
||||||
|
|
||||||
} else if (!strcmp(option, "ingressLatency")) {
|
|
||||||
r = get_ranged_int(value, &val, INT_MIN, INT_MAX);
|
r = get_ranged_int(value, &val, INT_MIN, INT_MAX);
|
||||||
if (r != PARSED_OK)
|
if (r != PARSED_OK)
|
||||||
return r;
|
return r;
|
||||||
|
|
1
ds.h
1
ds.h
|
@ -125,7 +125,6 @@ struct portDS {
|
||||||
|
|
||||||
struct port_defaults {
|
struct port_defaults {
|
||||||
struct fault_interval flt_interval_pertype[FT_CNT];
|
struct fault_interval flt_interval_pertype[FT_CNT];
|
||||||
int tx_timestamp_offset; /*nanoseconds*/
|
|
||||||
int rx_timestamp_offset; /*nanoseconds*/
|
int rx_timestamp_offset; /*nanoseconds*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
6
port.c
6
port.c
|
@ -114,6 +114,7 @@ struct port {
|
||||||
int freq_est_interval;
|
int freq_est_interval;
|
||||||
int min_neighbor_prop_delay;
|
int min_neighbor_prop_delay;
|
||||||
int path_trace_enabled;
|
int path_trace_enabled;
|
||||||
|
int tx_timestamp_offset;
|
||||||
enum fault_type last_fault_type;
|
enum fault_type last_fault_type;
|
||||||
unsigned int versionNumber; /*UInteger4*/
|
unsigned int versionNumber; /*UInteger4*/
|
||||||
/* foreignMasterDS */
|
/* foreignMasterDS */
|
||||||
|
@ -521,7 +522,7 @@ static int peer_prepare_and_send(struct port *p, struct ptp_message *msg,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (msg_sots_valid(msg)) {
|
if (msg_sots_valid(msg)) {
|
||||||
ts_add(&msg->hwts.ts, p->pod.tx_timestamp_offset);
|
ts_add(&msg->hwts.ts, p->tx_timestamp_offset);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -2311,7 +2312,7 @@ int port_prepare_and_send(struct port *p, struct ptp_message *msg, int event)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (msg_sots_valid(msg)) {
|
if (msg_sots_valid(msg)) {
|
||||||
ts_add(&msg->hwts.ts, p->pod.tx_timestamp_offset);
|
ts_add(&msg->hwts.ts, p->tx_timestamp_offset);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -2536,6 +2537,7 @@ struct port *port_open(int phc_index,
|
||||||
p->follow_up_info = config_get_int(cfg, p->name, "follow_up_info");
|
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->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->path_trace_enabled = config_get_int(cfg, p->name, "path_trace_enabled");
|
||||||
|
p->tx_timestamp_offset = config_get_int(cfg, p->name, "egressLatency");
|
||||||
p->clock = clock;
|
p->clock = clock;
|
||||||
p->trp = transport_create(cfg, interface->transport);
|
p->trp = transport_create(cfg, interface->transport);
|
||||||
if (!p->trp)
|
if (!p->trp)
|
||||||
|
|
Loading…
Reference in New Issue