This function will allow the TC code to iterate over the ports without calling into the clock logic.
Signed-off-by: Richard Cochran <richardcoch...@gmail.com> --- clock.c | 5 +++++ clock.h | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/clock.c b/clock.c index d8a2616..ab238fb 100644 --- a/clock.c +++ b/clock.c @@ -1066,6 +1066,11 @@ UInteger8 clock_domain_number(struct clock *c) return c->dds.domainNumber; } +struct port *clock_first_port(struct clock *c) +{ + return LIST_FIRST(&c->ports); +} + void clock_follow_up_info(struct clock *c, struct follow_up_info_tlv *f) { c->status.cumulativeScaledRateOffset = f->cumulativeScaledRateOffset; diff --git a/clock.h b/clock.h index 47863dc..ec38146 100644 --- a/clock.h +++ b/clock.h @@ -104,6 +104,13 @@ void clock_destroy(struct clock *c); UInteger8 clock_domain_number(struct clock *c); /** + * Obtains a reference to the first port in the clock's list. + * @param c The clock instance. + * @return A pointer to a port, or NULL if no ports are present. + */ +struct port *clock_first_port(struct clock *c); + +/** * Provide the follow_up info TLV from a slave port. * @param c The clock instance. * @param f Pointer to the TLV. -- 2.1.4 ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/ gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532 _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel