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
parent
948d511550
commit
adf36154f5
5
clock.c
5
clock.c
|
@ -1066,6 +1066,11 @@ UInteger8 clock_domain_number(struct clock *c)
|
||||||
return c->dds.domainNumber;
|
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)
|
void clock_follow_up_info(struct clock *c, struct follow_up_info_tlv *f)
|
||||||
{
|
{
|
||||||
c->status.cumulativeScaledRateOffset = f->cumulativeScaledRateOffset;
|
c->status.cumulativeScaledRateOffset = f->cumulativeScaledRateOffset;
|
||||||
|
|
7
clock.h
7
clock.h
|
@ -103,6 +103,13 @@ void clock_destroy(struct clock *c);
|
||||||
*/
|
*/
|
||||||
UInteger8 clock_domain_number(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.
|
* Provide the follow_up info TLV from a slave port.
|
||||||
* @param c The clock instance.
|
* @param c The clock instance.
|
||||||
|
|
Loading…
Reference in New Issue