Skip to content

Commit

Permalink
Provide the clock with the estimated neighbor rate ratio.
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Cochran <[email protected]>
  • Loading branch information
richardcochran committed Sep 2, 2012
1 parent 5e40b5e commit f383388
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ struct clock {
tmv_t path_delay;
struct mave *avg_delay;
struct freq_estimator fest;
double nrr;
tmv_t c1;
tmv_t c2;
tmv_t t1;
Expand Down Expand Up @@ -685,9 +686,10 @@ void clock_path_delay(struct clock *c, struct timespec req, struct timestamp rx,
pr_debug("path delay %10lld %10lld", c->path_delay, pd);
}

void clock_peer_delay(struct clock *c, tmv_t ppd)
void clock_peer_delay(struct clock *c, tmv_t ppd, double nrr)
{
c->path_delay = ppd;
c->nrr = nrr;
}

void clock_remove_fda(struct clock *c, struct port *p, struct fdarray fda)
Expand Down
3 changes: 2 additions & 1 deletion clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ void clock_path_delay(struct clock *c, struct timespec req, struct timestamp rx,
* Provide the estimated peer delay from a slave port.
* @param c The clock instance.
* @param ppd The peer delay as measured on a slave port.
* @param nrr The neighbor rate ratio as measured on a slave port.
*/
void clock_peer_delay(struct clock *c, tmv_t ppd);
void clock_peer_delay(struct clock *c, tmv_t ppd, double nrr);

/**
* Poll for events and dispatch them.
Expand Down
2 changes: 1 addition & 1 deletion port.c
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ static void port_peer_delay(struct port *p)
port_nrate_calculate(p, t3, t4, tmv_add(c1, c2));

if (p->state == PS_UNCALIBRATED || p->state == PS_SLAVE) {
clock_peer_delay(p->clock, p->peer_delay);
clock_peer_delay(p->clock, p->peer_delay, p->nrate.ratio);
}
}

Expand Down

0 comments on commit f383388

Please sign in to comment.