From b297f22a8245a51c2ca5c19db1ef9672104e2f22 Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Mon, 10 Aug 2015 20:10:08 +0200 Subject: [PATCH] clock: add a method to obtain the configuration. This function allows the ports to read configuration variables without changing the port method signatures. Signed-off-by: Richard Cochran --- clock.c | 5 +++++ clock.h | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/clock.c b/clock.c index 1569108..a47e1e9 100644 --- a/clock.c +++ b/clock.c @@ -755,6 +755,11 @@ UInteger8 clock_class(struct clock *c) return c->dds.clockQuality.clockClass; } +struct config *clock_config(struct clock *c) +{ + return c->config; +} + static int clock_add_port(struct clock *c, int phc_index, enum timestamp_type timestamping, struct interface *iface) diff --git a/clock.h b/clock.h index 1e6cd98..d7377fe 100644 --- a/clock.h +++ b/clock.h @@ -57,6 +57,13 @@ struct port *clock_best_port(struct clock *c); */ UInteger8 clock_class(struct clock *c); +/** + * Obtains a reference to the configuration database. + * @param c The clock instance. + * @return A pointer to the configuration, without fail. + */ +struct config *clock_config(struct clock *c); + /** * Create a clock instance. There can only be one clock in any system, * so subsequent calls will destroy the previous clock instance.