Introduce the gmCapable flag for use with 802.1AS clocks.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
7f7012eab5
commit
bdbda10c73
7
clock.c
7
clock.c
|
@ -76,6 +76,7 @@ struct clock {
|
|||
int nports; /* does not include the UDS port */
|
||||
int free_running;
|
||||
int freq_est_interval;
|
||||
int grand_master_capable; /* for 802.1AS only */
|
||||
int utc_timescale;
|
||||
int leap_set;
|
||||
int kernel_leap;
|
||||
|
@ -587,6 +588,7 @@ struct clock *clock_create(int phc_index, struct interface *iface, int count,
|
|||
|
||||
c->free_running = dds->free_running;
|
||||
c->freq_est_interval = dds->freq_est_interval;
|
||||
c->grand_master_capable = dds->grand_master_capable;
|
||||
c->kernel_leap = dds->kernel_leap;
|
||||
c->utc_offset = CURRENT_UTC_OFFSET;
|
||||
c->time_source = dds->time_source;
|
||||
|
@ -745,6 +747,11 @@ void clock_follow_up_info(struct clock *c, struct follow_up_info_tlv *f)
|
|||
sizeof(c->status.lastGmPhaseChange));
|
||||
}
|
||||
|
||||
int clock_gm_capable(struct clock *c)
|
||||
{
|
||||
return c->grand_master_capable;
|
||||
}
|
||||
|
||||
struct ClockIdentity clock_identity(struct clock *c)
|
||||
{
|
||||
return c->dds.clockIdentity;
|
||||
|
|
8
clock.h
8
clock.h
|
@ -100,6 +100,14 @@ UInteger8 clock_domain_number(struct clock *c);
|
|||
*/
|
||||
void clock_follow_up_info(struct clock *c, struct follow_up_info_tlv *f);
|
||||
|
||||
/**
|
||||
* Obtain the gmCapable flag from a clock's default data set.
|
||||
* This function is specific to the 802.1AS standard.
|
||||
* @param c The clock instance.
|
||||
* @return One if the clock is capable of becoming grand master, zero otherwise.
|
||||
*/
|
||||
int clock_gm_capable(struct clock *c);
|
||||
|
||||
/**
|
||||
* Obtain a clock's identity from its default data set.
|
||||
* @param c The clock instance.
|
||||
|
|
1
ds.h
1
ds.h
|
@ -53,6 +53,7 @@ struct default_ds {
|
|||
struct defaultDS dds;
|
||||
int free_running;
|
||||
int freq_est_interval; /*log seconds*/
|
||||
int grand_master_capable; /*802.1AS only*/
|
||||
int stats_interval; /*log seconds*/
|
||||
int kernel_leap;
|
||||
int sanity_freq_limit;
|
||||
|
|
Loading…
Reference in New Issue