Commit 0b7daa31 authored by Alessandro Rubini's avatar Alessandro Rubini

bmc: cleanup m1()

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent f9f487ff
...@@ -16,27 +16,24 @@ ...@@ -16,27 +16,24 @@
/* Local clock is becoming Master. Table 13 (9.3.5) of the spec. */ /* Local clock is becoming Master. Table 13 (9.3.5) of the spec. */
void m1(struct pp_instance *ppi) void m1(struct pp_instance *ppi)
{ {
struct DSParent *parent = DSPAR(ppi);
struct DSDefault *defds = DSDEF(ppi);
/* Current data set update */ /* Current data set update */
DSCUR(ppi)->stepsRemoved = 0; DSCUR(ppi)->stepsRemoved = 0;
clear_TimeInternal(&DSCUR(ppi)->offsetFromMaster); clear_TimeInternal(&DSCUR(ppi)->offsetFromMaster);
clear_TimeInternal(&DSCUR(ppi)->meanPathDelay); clear_TimeInternal(&DSCUR(ppi)->meanPathDelay);
/* Parent data set */ /* Parent data set: we are the parent */
memcpy(&DSPAR(ppi)->parentPortIdentity.clockIdentity, memset(parent, 0, sizeof(*parent));
&DSDEF(ppi)->clockIdentity, PP_CLOCK_IDENTITY_LENGTH); parent->parentPortIdentity.clockIdentity = defds->clockIdentity;
DSPAR(ppi)->parentPortIdentity.portNumber = 0; /* FIXME: the port? */
DSPAR(ppi)->observedParentClockPhaseChangeRate = 0;
DSPAR(ppi)->observedParentOffsetScaledLogVariance = 0; /* Copy grandmaster params from our defds (FIXME: is ir right?) */
memcpy(&DSPAR(ppi)->grandmasterIdentity, &DSDEF(ppi)->clockIdentity, parent->grandmasterIdentity = defds->clockIdentity;
PP_CLOCK_IDENTITY_LENGTH); parent->grandmasterClockQuality = defds->clockQuality;
DSPAR(ppi)->grandmasterClockQuality.clockAccuracy = parent->grandmasterPriority1 = defds->priority1;
DSDEF(ppi)->clockQuality.clockAccuracy; parent->grandmasterPriority2 = defds->priority2;
DSPAR(ppi)->grandmasterClockQuality.clockClass =
DSDEF(ppi)->clockQuality.clockClass;
DSPAR(ppi)->grandmasterClockQuality.offsetScaledLogVariance =
DSDEF(ppi)->clockQuality.offsetScaledLogVariance;
DSPAR(ppi)->grandmasterPriority1 = DSDEF(ppi)->priority1;
DSPAR(ppi)->grandmasterPriority2 = DSDEF(ppi)->priority2;
/* Time Properties data set */ /* Time Properties data set */
DSPRO(ppi)->timeSource = INTERNAL_OSCILLATOR; DSPRO(ppi)->timeSource = INTERNAL_OSCILLATOR;
......
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