From: Christopher S M Hall <christopher.s.h...@intel.com>

IEEE1588-2019 and 802.1AS-2020 both require the field to be 0 in
transmitted messages except when the "version 1 hardware option" is set
(IEEE1588-2019 C.4.2) and only with IPv4.  Since ptp4l isn't padding
the UDP messages to 124 bytes as required for compatibility with the
"V.1 Hardware" implementations, assume that we're not dealing with such
hardware, do not implement the option as defined in C.4.2.

Since the default behaviour changes, in principle this could break
things.  It is similar to 2a2532d66121 ("Bump to IEEE 1588-2019 version")
however, where ptp4l switches the version field to the IEEE1588-2019
value.

[ RPC: Remove every last trace of the control field codes. ]

Signed-off-by: Andrew Zaborowski <andrew.zaborow...@intel.com>
Signed-off-by: Richard Cochran <richardcoch...@gmail.com>
---
 msg.h            | 9 ---------
 nsm.c            | 1 -
 pmc_common.c     | 1 -
 port.c           | 9 ---------
 port_signaling.c | 1 -
 tc.c             | 1 -
 6 files changed, 22 deletions(-)

diff --git a/msg.h b/msg.h
index b7423ee..9fba51b 100644
--- a/msg.h
+++ b/msg.h
@@ -83,15 +83,6 @@ struct hw_timestamp {
        tmv_t sw;
 };
 
-enum controlField {
-       CTL_SYNC,
-       CTL_DELAY_REQ,
-       CTL_FOLLOW_UP,
-       CTL_DELAY_RESP,
-       CTL_MANAGEMENT,
-       CTL_OTHER,
-};
-
 struct ptp_header {
        uint8_t             tsmt; /* transportSpecific | messageType */
        uint8_t             ver;  /* minorVersionPTP   | versionPTP  */
diff --git a/nsm.c b/nsm.c
index 8d4a362..9f9db5e 100644
--- a/nsm.c
+++ b/nsm.c
@@ -394,7 +394,6 @@ static int nsm_request(struct nsm *nsm, char *target)
        msg->header.correction         = -asymmetry;
        msg->header.sourcePortIdentity = nsm->port_identity;
        msg->header.sequenceId         = nsm->sequence_id++;
-       msg->header.control            = CTL_DELAY_REQ;
        msg->header.logMessageInterval = 0x7f;
 
        msg->address = dst;
diff --git a/pmc_common.c b/pmc_common.c
index a03f191..9e251c4 100644
--- a/pmc_common.c
+++ b/pmc_common.c
@@ -563,7 +563,6 @@ static struct ptp_message *pmc_message(struct pmc *pmc, 
uint8_t action)
        msg->header.domainNumber       = pmc->domain_number;
        msg->header.sourcePortIdentity = pmc->port_identity;
        msg->header.sequenceId         = pmc->sequence_id++;
-       msg->header.control            = CTL_MANAGEMENT;
        msg->header.logMessageInterval = 0x7f;
 
        msg->management.targetPortIdentity = pmc->target;
diff --git a/port.c b/port.c
index 3453716..76f817c 100644
--- a/port.c
+++ b/port.c
@@ -1544,7 +1544,6 @@ static int port_pdelay_request(struct port *p)
        msg->header.correction         = -p->asymmetry;
        msg->header.sourcePortIdentity = p->portIdentity;
        msg->header.sequenceId         = p->seqnum.delayreq++;
-       msg->header.control            = CTL_OTHER;
        msg->header.logMessageInterval = port_is_ieee8021as(p) ?
                p->logPdelayReqInterval : 0x7f;
 
@@ -1608,7 +1607,6 @@ int port_delay_request(struct port *p)
        msg->header.correction         = -p->asymmetry;
        msg->header.sourcePortIdentity = p->portIdentity;
        msg->header.sequenceId         = p->seqnum.delayreq++;
-       msg->header.control            = CTL_DELAY_REQ;
        msg->header.logMessageInterval = 0x7f;
 
        if (p->hybrid_e2e) {
@@ -1660,7 +1658,6 @@ int port_tx_announce(struct port *p, struct address *dst, 
uint16_t sequence_id)
        msg->header.domainNumber       = clock_domain_number(p->clock);
        msg->header.sourcePortIdentity = p->portIdentity;
        msg->header.sequenceId         = sequence_id;
-       msg->header.control            = CTL_OTHER;
        msg->header.logMessageInterval = p->logAnnounceInterval;
 
        msg->header.flagField[1] = tp.flags;
@@ -1743,7 +1740,6 @@ int port_tx_sync(struct port *p, struct address *dst, 
uint16_t sequence_id)
        msg->header.domainNumber       = clock_domain_number(p->clock);
        msg->header.sourcePortIdentity = p->portIdentity;
        msg->header.sequenceId         = sequence_id;
-       msg->header.control            = CTL_SYNC;
        msg->header.logMessageInterval = p->logSyncInterval;
 
        if (p->timestamping != TS_ONESTEP && p->timestamping != TS_P2P1STEP) {
@@ -1779,7 +1775,6 @@ int port_tx_sync(struct port *p, struct address *dst, 
uint16_t sequence_id)
        fup->header.domainNumber       = clock_domain_number(p->clock);
        fup->header.sourcePortIdentity = p->portIdentity;
        fup->header.sequenceId         = sequence_id;
-       fup->header.control            = CTL_FOLLOW_UP;
        fup->header.logMessageInterval = p->logSyncInterval;
 
        fup->follow_up.preciseOriginTimestamp = tmv_to_Timestamp(msg->hwts.ts);
@@ -2130,7 +2125,6 @@ static int process_delay_req(struct port *p, struct 
ptp_message *m)
        msg->header.correction         = m->header.correction;
        msg->header.sourcePortIdentity = p->portIdentity;
        msg->header.sequenceId         = m->header.sequenceId;
-       msg->header.control            = CTL_DELAY_RESP;
        msg->header.logMessageInterval = p->logMinDelayReqInterval;
 
        msg->delay_resp.receiveTimestamp = tmv_to_Timestamp(m->hwts.ts);
@@ -2321,7 +2315,6 @@ int process_pdelay_req(struct port *p, struct ptp_message 
*m)
        rsp->header.domainNumber       = m->header.domainNumber;
        rsp->header.sourcePortIdentity = p->portIdentity;
        rsp->header.sequenceId         = m->header.sequenceId;
-       rsp->header.control            = CTL_OTHER;
        rsp->header.logMessageInterval = 0x7f;
 
        /*
@@ -2369,7 +2362,6 @@ int process_pdelay_req(struct port *p, struct ptp_message 
*m)
        fup->header.correction         = m->header.correction;
        fup->header.sourcePortIdentity = p->portIdentity;
        fup->header.sequenceId         = m->header.sequenceId;
-       fup->header.control            = CTL_OTHER;
        fup->header.logMessageInterval = 0x7f;
 
        fup->pdelay_resp_fup.requestingPortIdentity = 
m->header.sourcePortIdentity;
@@ -3210,7 +3202,6 @@ port_management_construct(struct PortIdentity pid, struct 
port *ingress,
        msg->header.domainNumber       = clock_domain_number(ingress->clock);
        msg->header.sourcePortIdentity = pid;
        msg->header.sequenceId         = sequenceId;
-       msg->header.control            = CTL_MANAGEMENT;
        msg->header.logMessageInterval = 0x7f;
 
        if (targetPortIdentity)
diff --git a/port_signaling.c b/port_signaling.c
index 5a764d6..ca4202f 100644
--- a/port_signaling.c
+++ b/port_signaling.c
@@ -46,7 +46,6 @@ struct ptp_message *port_signaling_construct(struct port *p,
        msg->header.domainNumber       = clock_domain_number(p->clock);
        msg->header.sourcePortIdentity = p->portIdentity;
        msg->header.sequenceId         = p->seqnum.signaling++;
-       msg->header.control            = CTL_OTHER;
        msg->header.logMessageInterval = 0x7F;
        msg->signaling.targetPortIdentity = *tpid;
 
diff --git a/tc.c b/tc.c
index 2e3830c..1847041 100644
--- a/tc.c
+++ b/tc.c
@@ -456,7 +456,6 @@ int tc_fwd_sync(struct port *q, struct ptp_message *msg)
                fup->header.domainNumber       = msg->header.domainNumber;
                fup->header.sourcePortIdentity = msg->header.sourcePortIdentity;
                fup->header.sequenceId         = msg->header.sequenceId;
-               fup->header.control            = CTL_FOLLOW_UP;
                fup->header.logMessageInterval = msg->header.logMessageInterval;
                fup->follow_up.preciseOriginTimestamp = 
msg->sync.originTimestamp;
                msg->header.flagField[0]      |= TWO_STEP;
-- 
2.30.2



_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to