Make servo and it's current state available outside clock.c Signed-off-by: Vedang Patel <vedang.pa...@intel.com> Change-Id: I2a9a3855059511b793fa4966912b4455a68aa23a --- clock.c | 10 ++++++++++ clock.h | 14 ++++++++++++++ 2 files changed, 24 insertions(+)
diff --git a/clock.c b/clock.c index 8533b3939658..beca9d61e96a 100644 --- a/clock.c +++ b/clock.c @@ -1835,3 +1835,13 @@ double clock_rate_ratio(struct clock *c) } return servo_rate_ratio(c->servo); } + +struct servo *clock_servo(struct clock *c) +{ + return c->servo; +} + +enum servo_state clock_servo_state(struct clock *c) +{ + return c->servo_state; +} diff --git a/clock.h b/clock.h index 07aba18db329..9d3133a60934 100644 --- a/clock.h +++ b/clock.h @@ -254,6 +254,20 @@ void clock_set_sde(struct clock *c, int sde); int clock_poll(struct clock *c); /** + * Obtain the servo struct. + * @param c The clock instance. + * @return A pointer to the clock's servo. + */ +struct servo *clock_servo(struct clock *c); + +/** + * Obtain the current state of clock's servo. + * @param c The clock instance. + * @return The current state of the clock's servo. + */ +enum servo_state clock_servo_state(struct clock *c); + +/** * Obtain the slave-only flag from a clock's default data set. * @param c The clock instance. * @return The value of the clock's slave-only flag. -- 2.7.3 _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel