clock: offer a method to get the first port in the list.

This function will allow the TC code to iterate over the ports without
calling into the clock logic.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2015-10-31 20:44:15 +01:00
parent 948d511550
commit adf36154f5
2 changed files with 12 additions and 0 deletions

View File

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

View File

@ -103,6 +103,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.