Signed-off-by: Richard Cochran <[email protected]>
---
clock.c | 7 +++++++
clock.h | 8 ++++++++
ds.h | 1 +
ptp4l.c | 1 +
4 files changed, 17 insertions(+)
diff --git a/clock.c b/clock.c
index 1563ba9..83b700e 100644
--- a/clock.c
+++ b/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;
diff --git a/clock.h b/clock.h
index bc66dce..52d50b2 100644
--- a/clock.h
+++ b/clock.h
@@ -101,6 +101,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.
* @return The clock's identity.
diff --git a/ds.h b/ds.h
index 6e2ac61..0cc94b5 100644
--- a/ds.h
+++ b/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;
diff --git a/ptp4l.c b/ptp4l.c
index 5d8749a..e86dd91 100644
--- a/ptp4l.c
+++ b/ptp4l.c
@@ -53,6 +53,7 @@ static struct config cfg_settings = {
},
.free_running = 0,
.freq_est_interval = 1,
+ .grand_master_capable = 1,
.stats_interval = 0,
.kernel_leap = 1,
.sanity_freq_limit = 200000000,
--
1.7.10.4
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel