It will be used to store the current value of Pdelay Request Interval. It will be represented as power of two in seconds.
Signed-off-by: Vedang Patel <vedang.pa...@intel.com> --- port.c | 7 ++++--- port_private.h | 1 + unicast_client.c | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/port.c b/port.c index 50e32d04998e..4c845358f612 100644 --- a/port.c +++ b/port.c @@ -1014,7 +1014,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->freq_est_interval - p->logMinPdelayReqInterval; + int shift = p->freq_est_interval - p->logPdelayReqInterval; if (shift < 0) shift = 0; @@ -1047,7 +1047,7 @@ int port_set_delay_tmo(struct port *p) { if (p->delayMechanism == DM_P2P) { return set_tmo_log(p->fda.fd[FD_DELAY_TIMER], 1, - p->logMinPdelayReqInterval); + p->logPdelayReqInterval); } else { return set_tmo_random(p->fda.fd[FD_DELAY_TIMER], 0, 2, p->logMinDelayReqInterval); @@ -1243,7 +1243,7 @@ static int port_pdelay_request(struct port *p) msg->header.sequenceId = p->seqnum.delayreq++; msg->header.control = CTL_OTHER; msg->header.logMessageInterval = port_is_ieee8021as(p) ? - p->logMinPdelayReqInterval : 0x7f; + p->logPdelayReqInterval : 0x7f; if (unicast_client_enabled(p) && p->unicast_master_table->peer_name) { msg->address = p->unicast_master_table->peer_addr.address; @@ -1601,6 +1601,7 @@ int port_initialize(struct port *p) p->localPriority = config_get_int(cfg, p->name, "G.8275.portDS.localPriority"); p->logSyncInterval = config_get_int(cfg, p->name, "logSyncInterval"); p->logMinPdelayReqInterval = config_get_int(cfg, p->name, "logMinPdelayReqInterval"); + p->logPdelayReqInterval = p->logMinPdelayReqInterval; p->neighborPropDelayThresh = config_get_int(cfg, p->name, "neighborPropDelayThresh"); p->min_neighbor_prop_delay = config_get_int(cfg, p->name, "min_neighbor_prop_delay"); diff --git a/port_private.h b/port_private.h index 0bcfb4ae6cab..b51a29121fc8 100644 --- a/port_private.h +++ b/port_private.h @@ -116,6 +116,7 @@ struct port { Integer8 logSyncInterval; Enumeration8 delayMechanism; Integer8 logMinPdelayReqInterval; + Integer8 logPdelayReqInterval; UInteger32 neighborPropDelayThresh; int follow_up_info; int freq_est_interval; diff --git a/unicast_client.c b/unicast_client.c index 5c57c1873315..04a73d275606 100644 --- a/unicast_client.c +++ b/unicast_client.c @@ -144,7 +144,7 @@ static int unicast_client_peer_renew(struct port *p) if (!msg) { return -1; } - err = attach_request(msg, p->logMinPdelayReqInterval, PDELAY_RESP, + err = attach_request(msg, p->logPdelayReqInterval, PDELAY_RESP, p->unicast_req_duration); if (err) { goto out; @@ -403,7 +403,7 @@ void unicast_client_grant(struct port *p, struct ptp_message *m, unicast_client_set_renewal(p, &p->unicast_master_table->peer_addr, g->durationField); - p->logMinPdelayReqInterval = g->logInterMessagePeriod; + p->logPdelayReqInterval = g->logInterMessagePeriod; return; default: break; -- 2.7.3 _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel