Provide the clock with the estimated neighbor rate ratio.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2012-08-31 15:49:19 +02:00
parent 5e40b5ec01
commit f38338827b
3 changed files with 6 additions and 3 deletions

View File

@ -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;
@ -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)

View File

@ -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.

2
port.c
View File

@ -1183,7 +1183,7 @@ calc:
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);
}
}