config: port: convert 'follow_up_info' to the new scheme.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
e1dcf8ea11
commit
becc6262cc
9
config.c
9
config.c
|
@ -96,6 +96,7 @@ struct config_item config_tab[] = {
|
||||||
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),
|
||||||
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("logAnnounceInterval", 1, INT8_MIN, INT8_MAX),
|
PORT_ITEM_INT("logAnnounceInterval", 1, INT8_MIN, INT8_MAX),
|
||||||
PORT_ITEM_INT("logMinDelayReqInterval", 0, INT8_MIN, INT8_MAX),
|
PORT_ITEM_INT("logMinDelayReqInterval", 0, INT8_MIN, INT8_MAX),
|
||||||
PORT_ITEM_INT("logMinPdelayReqInterval", 0, INT8_MIN, INT8_MAX),
|
PORT_ITEM_INT("logMinPdelayReqInterval", 0, INT8_MIN, INT8_MAX),
|
||||||
|
@ -271,13 +272,7 @@ static enum parser_result parse_pod_setting(const char *option,
|
||||||
|
|
||||||
enum parser_result r;
|
enum parser_result r;
|
||||||
|
|
||||||
if (!strcmp(option, "follow_up_info")) {
|
if (!strcmp(option, "neighborPropDelayThresh")) {
|
||||||
r = get_ranged_int(value, &val, 0, 1);
|
|
||||||
if (r != PARSED_OK)
|
|
||||||
return r;
|
|
||||||
pod->follow_up_info = val;
|
|
||||||
|
|
||||||
} else if (!strcmp(option, "neighborPropDelayThresh")) {
|
|
||||||
r = get_ranged_uint(value, &uval, 0, UINT32_MAX);
|
r = get_ranged_uint(value, &uval, 0, UINT32_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 {
|
||||||
#define FRI_ASAP (-128)
|
#define FRI_ASAP (-128)
|
||||||
|
|
||||||
struct port_defaults {
|
struct port_defaults {
|
||||||
int follow_up_info;
|
|
||||||
int freq_est_interval; /*log seconds*/
|
int freq_est_interval; /*log seconds*/
|
||||||
struct fault_interval flt_interval_pertype[FT_CNT];
|
struct fault_interval flt_interval_pertype[FT_CNT];
|
||||||
UInteger32 neighborPropDelayThresh; /*nanoseconds*/
|
UInteger32 neighborPropDelayThresh; /*nanoseconds*/
|
||||||
|
|
10
port.c
10
port.c
|
@ -110,6 +110,7 @@ struct port {
|
||||||
Enumeration8 delayMechanism;
|
Enumeration8 delayMechanism;
|
||||||
Integer8 logMinPdelayReqInterval;
|
Integer8 logMinPdelayReqInterval;
|
||||||
UInteger32 neighborPropDelayThresh;
|
UInteger32 neighborPropDelayThresh;
|
||||||
|
int follow_up_info;
|
||||||
int min_neighbor_prop_delay;
|
int min_neighbor_prop_delay;
|
||||||
int path_trace_enabled;
|
int path_trace_enabled;
|
||||||
enum fault_type last_fault_type;
|
enum fault_type last_fault_type;
|
||||||
|
@ -654,7 +655,7 @@ static int port_sync_incapable(struct port *p)
|
||||||
|
|
||||||
static int port_is_ieee8021as(struct port *p)
|
static int port_is_ieee8021as(struct port *p)
|
||||||
{
|
{
|
||||||
return p->pod.follow_up_info ? 1 : 0;
|
return p->follow_up_info ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void port_management_send_error(struct port *p, struct port *ingress,
|
static void port_management_send_error(struct port *p, struct port *ingress,
|
||||||
|
@ -1334,7 +1335,7 @@ static int port_tx_sync(struct port *p)
|
||||||
pdulen = sizeof(struct follow_up_msg);
|
pdulen = sizeof(struct follow_up_msg);
|
||||||
fup->hwts.type = p->timestamping;
|
fup->hwts.type = p->timestamping;
|
||||||
|
|
||||||
if (p->pod.follow_up_info)
|
if (p->follow_up_info)
|
||||||
pdulen += follow_up_info_append(p, fup);
|
pdulen += follow_up_info_append(p, fup);
|
||||||
|
|
||||||
fup->header.tsmt = FOLLOW_UP | p->transportSpecific;
|
fup->header.tsmt = FOLLOW_UP | p->transportSpecific;
|
||||||
|
@ -1687,7 +1688,7 @@ static void process_follow_up(struct port *p, struct ptp_message *m)
|
||||||
if (memcmp(&master, &m->header.sourcePortIdentity, sizeof(master)))
|
if (memcmp(&master, &m->header.sourcePortIdentity, sizeof(master)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (p->pod.follow_up_info) {
|
if (p->follow_up_info) {
|
||||||
struct follow_up_info_tlv *fui = follow_up_info_extract(m);
|
struct follow_up_info_tlv *fui = follow_up_info_extract(m);
|
||||||
if (!fui)
|
if (!fui)
|
||||||
return;
|
return;
|
||||||
|
@ -1861,7 +1862,7 @@ calc:
|
||||||
|
|
||||||
p->peerMeanPathDelay = tmv_to_TimeInterval(p->peer_delay);
|
p->peerMeanPathDelay = tmv_to_TimeInterval(p->peer_delay);
|
||||||
|
|
||||||
if (p->pod.follow_up_info)
|
if (p->follow_up_info)
|
||||||
port_nrate_calculate(p, t3c, t4);
|
port_nrate_calculate(p, t3c, t4);
|
||||||
|
|
||||||
if (p->state == PS_UNCALIBRATED || p->state == PS_SLAVE) {
|
if (p->state == PS_UNCALIBRATED || p->state == PS_SLAVE) {
|
||||||
|
@ -2531,6 +2532,7 @@ struct port *port_open(int phc_index,
|
||||||
p->name = interface->name;
|
p->name = interface->name;
|
||||||
p->asymmetry = config_get_int(cfg, p->name, "delayAsymmetry");
|
p->asymmetry = config_get_int(cfg, p->name, "delayAsymmetry");
|
||||||
p->asymmetry <<= 16;
|
p->asymmetry <<= 16;
|
||||||
|
p->follow_up_info = config_get_int(cfg, p->name, "follow_up_info");
|
||||||
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->clock = clock;
|
p->clock = clock;
|
||||||
p->trp = transport_create(cfg, interface->transport);
|
p->trp = transport_create(cfg, interface->transport);
|
||||||
|
|
1
ptp4l.c
1
ptp4l.c
|
@ -80,7 +80,6 @@ static struct config cfg_settings = {
|
||||||
},
|
},
|
||||||
|
|
||||||
.pod = {
|
.pod = {
|
||||||
.follow_up_info = 0,
|
|
||||||
.freq_est_interval = 1,
|
.freq_est_interval = 1,
|
||||||
/* Default to very a large neighborPropDelay threshold */
|
/* Default to very a large neighborPropDelay threshold */
|
||||||
.neighborPropDelayThresh = 20000000,
|
.neighborPropDelayThresh = 20000000,
|
||||||
|
|
Loading…
Reference in New Issue