Initialize the time properties data set.

We can reuse the same function that sets the data sets in case of
becoming grand master.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2012-02-26 18:03:16 +01:00
parent d6ce3fbb3d
commit 6daff667c5
1 changed files with 1 additions and 6 deletions

View File

@ -203,15 +203,10 @@ struct clock *clock_create(char *phc, struct interface *iface, int count,
c->dds = *ds; c->dds = *ds;
/* Initialize the parentDS. */ /* Initialize the parentDS. */
c->dad.parentPortIdentity.clockIdentity = c->dds.clockIdentity; clock_update_grandmaster(c);
c->dad.parentPortIdentity.portNumber = 0;
c->dad.parentStats = 0; c->dad.parentStats = 0;
c->dad.observedParentOffsetScaledLogVariance = 0xffff; c->dad.observedParentOffsetScaledLogVariance = 0xffff;
c->dad.observedParentClockPhaseChangeRate = 0x7fffffff; c->dad.observedParentClockPhaseChangeRate = 0x7fffffff;
c->dad.grandmasterPriority1 = c->dds.priority1;
c->dad.grandmasterClockQuality = c->dds.clockQuality;
c->dad.grandmasterPriority2 = c->dds.priority2;
c->dad.grandmasterIdentity = c->dds.clockIdentity;
for (i = 0; i < ARRAY_SIZE(c->pollfd); i++) { for (i = 0; i < ARRAY_SIZE(c->pollfd); i++) {
c->pollfd[i].fd = -1; c->pollfd[i].fd = -1;