Commit 9c406c41 authored by Alessandro Rubini's avatar Alessandro Rubini

proto-standard: we are always two-step

The master chooses whether it is one-step or two-step (page 66).  It
doesn't make sense to be one-step (but we accept one-step masters when
we are slave).
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 7c14152c
......@@ -141,8 +141,7 @@ void msg_pack_header(struct pp_instance *ppi, void *buf)
*(UInteger4 *) (buf + 1) = DSPOR(ppi)->versionNumber;
*(UInteger8 *) (buf + 4) = DSDEF(ppi)->domainNumber;
if (DSDEF(ppi)->twoStepFlag)
*(UInteger8 *) (buf + 6) = PP_TWO_STEP_FLAG;
*(UInteger8 *) (buf + 6) = PP_TWO_STEP_FLAG;
memset((buf + 8), 0, 8);
memcpy((buf + 20), DSPOR(ppi)->portIdentity.clockIdentity,
......
......@@ -28,8 +28,10 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen)
port->portState = PPS_INITIALIZING;
/* Initialize default data set */
def->twoStepFlag = PP_TWO_STEP_FLAG;
/*
* Initialize default data set
*/
def->twoStepFlag = TRUE;
/* Clock identity comes from mac address with 0xff:0xfe intermixed */
id = def->clockIdentity;
mac = NP(ppi)->ch[PP_NP_GEN].addr;
......@@ -42,19 +44,20 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen)
id[6] = mac[4];
id[7] = mac[5];
def->numberPorts = 1;
memcpy(&def->clockQuality, &opt->clock_quality,
sizeof(ClockQuality));
def->numberPorts = 1; /* Change this when multi-port */
memcpy(&def->clockQuality, &opt->clock_quality, sizeof(ClockQuality));
def->priority1 = opt->prio1;
def->priority2 = opt->prio2;
def->domainNumber = opt->domain_number;
def->slaveOnly = opt->slave_only;
if (opt->slave_only)
ppi->defaultDS->clockQuality.clockClass = 255;
def->clockQuality.clockClass = 255;
/* Initialize port data set */
memcpy(ppi->portDS->portIdentity.clockIdentity,
ppi->defaultDS->clockIdentity, PP_CLOCK_IDENTITY_LENGTH);
/*
* Initialize port data set
*/
memcpy(port->portIdentity.clockIdentity,
def->clockIdentity, PP_CLOCK_IDENTITY_LENGTH);
port->portIdentity.portNumber = 1;
port->logMinDelayReqInterval = PP_DEFAULT_DELAYREQ_INTERVAL;
clear_TimeInternal(&port->peerMeanPathDelay);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment