clock: Add a method to determine whether a clock is free running.

This will be needed by the end-to-end transparent clock code.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2018-04-29 23:37:56 -07:00
parent 8feaa8ada8
commit 8f2b1db4fd
2 changed files with 12 additions and 0 deletions

View File

@ -1187,6 +1187,11 @@ void clock_follow_up_info(struct clock *c, struct follow_up_info_tlv *f)
sizeof(c->status.lastGmPhaseChange));
}
int clock_free_running(struct clock *c)
{
return c->free_running ? 1 : 0;
}
int clock_gm_capable(struct clock *c)
{
return c->grand_master_capable;

View File

@ -141,6 +141,13 @@ struct port *clock_first_port(struct clock *c);
*/
void clock_follow_up_info(struct clock *c, struct follow_up_info_tlv *f);
/**
* Determine if a clock is free running or not.
* @param c The clock instance.
* @return One if the clock is free running or zero otherwise.
*/
int clock_free_running(struct clock *c);
/**
* Obtain the gmCapable flag from a clock's default data set.
* This function is specific to the 802.1AS standard.