From 806d1e9b77d8fa72db3c54019d954499429fe65e Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Thu, 5 Apr 2012 14:04:15 +0200 Subject: [PATCH] Add a clock method to accept a peer delay estimate from a slave port. Signed-off-by: Richard Cochran --- clock.c | 6 +++++- clock.h | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/clock.c b/clock.c index 6d4ee9b..b71bfbe 100644 --- a/clock.c +++ b/clock.c @@ -32,7 +32,6 @@ #include "port.h" #include "servo.h" #include "print.h" -#include "tmv.h" #include "util.h" #define FAULT_RESET_SECONDS 15 @@ -411,6 +410,11 @@ 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) +{ + c->path_delay = ppd; +} + void clock_remove_fda(struct clock *c, struct port *p, struct fdarray fda) { int i, j, k; diff --git a/clock.h b/clock.h index 42ee692..558a3ae 100644 --- a/clock.h +++ b/clock.h @@ -22,6 +22,7 @@ #include "ds.h" #include "servo.h" +#include "tmv.h" #include "transport.h" #define MAX_PORTS 8 @@ -128,6 +129,13 @@ struct PortIdentity clock_parent_identity(struct clock *c); void clock_path_delay(struct clock *c, struct timespec req, struct timestamp rx, Integer64 correction); +/** + * 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. + */ +void clock_peer_delay(struct clock *c, tmv_t ppd); + /** * Poll for events and dispatch them. * @param c A pointer to a clock instance obtained with clock_create().