From 90f791d88191d5a6974481560e94187979594e33 Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Sun, 27 Jan 2013 11:17:18 +0100 Subject: [PATCH] Introduce a test for running in 802.1AS mode. We use the follow_up_info to control behavior that is specific to the 802.1AS standard. In several instances, that standard goes against the 1588 standard or requires new run time logic that exceeds what can be reasonably described as a 1588 profile. Since we will need a few more run time exceptions in order to support 802.1AS, we introduce a helper function to identify this case, rather than hard coding a test for follow_up_info, in order to be more clear about it. Signed-off-by: Richard Cochran --- port.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/port.c b/port.c index 6f5a28e..c249c34 100644 --- a/port.c +++ b/port.c @@ -392,6 +392,11 @@ static int port_ignore(struct port *p, struct ptp_message *m) return 0; } +static int port_is_ieee8021as(struct port *p) +{ + return p->pod.follow_up_info ? 1 : 0; +} + static int port_management_get_response(struct port *target, struct port *ingress, int id, struct ptp_message *req) @@ -592,7 +597,7 @@ static int port_pdelay_request(struct port *p) msg->header.sourcePortIdentity = p->portIdentity; msg->header.sequenceId = p->seqnum.delayreq++; msg->header.control = CTL_OTHER; - msg->header.logMessageInterval = p->pod.follow_up_info ? + msg->header.logMessageInterval = port_is_ieee8021as(p) ? p->logMinPdelayReqInterval : 0x7f; if (msg_pre_send(msg))