This patch adds a configuration option that allows running a boundary clock
using "just a bunch of devices". Normally each port is probed to make sure
they all share the same PTP hardware clock, but this option will allow a
heterogeneous collection of devices, should the user really want it.

Signed-off-by: Richard Cochran <richardcoch...@gmail.com>
---
 config.c    |   13 +++++++++++++
 config.h    |    1 +
 default.cfg |    1 +
 ds.h        |    1 +
 gPTP.cfg    |    1 +
 ptp4l.8     |   12 +++++++++++-
 ptp4l.c     |    1 +
 7 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/config.c b/config.c
index d5fa378..154c191 100644
--- a/config.c
+++ b/config.c
@@ -205,6 +205,12 @@ static enum parser_result parse_port_setting(const char 
*option,
                        return r;
                iface->delay_filter_length = val;
 
+       } else if (!strcmp(option, "boundary_clock_jbod")) {
+               r = get_ranged_int(value, &val, 0, 1);
+               if (r != PARSED_OK)
+                       return r;
+               iface->boundary_clock_jbod = val;
+
        } else
                return NOT_PARSED;
 
@@ -562,6 +568,12 @@ static enum parser_result parse_global_setting(const char 
*option,
                        return r;
                cfg->dds.delay_filter_length = val;
 
+       } else if (!strcmp(option, "boundary_clock_jbod")) {
+               r = get_ranged_int(value, &val, 0, 1);
+               if (r != PARSED_OK)
+                       return r;
+               cfg->dds.boundary_clock_jbod = val;
+
        } else
                return NOT_PARSED;
 
@@ -750,6 +762,7 @@ void config_init_interface(struct interface *iface, struct 
config *cfg)
 
        iface->delay_filter = cfg->dds.delay_filter;
        iface->delay_filter_length = cfg->dds.delay_filter_length;
+       iface->boundary_clock_jbod = cfg->dds.boundary_clock_jbod;
 }
 
 void config_destroy(struct config *cfg)
diff --git a/config.h b/config.h
index d580496..c870e42 100644
--- a/config.h
+++ b/config.h
@@ -41,6 +41,7 @@ struct interface {
        struct sk_ts_info ts_info;
        enum filter_type delay_filter;
        int delay_filter_length;
+       int boundary_clock_jbod;
 };
 
 #define CFG_IGNORE_DM           (1 << 0)
diff --git a/default.cfg b/default.cfg
index 9e794ba..4e3ea65 100644
--- a/default.cfg
+++ b/default.cfg
@@ -70,6 +70,7 @@ delay_mechanism               E2E
 time_stamping          hardware
 delay_filter           moving_median
 delay_filter_length    10
+boundary_clock_jbod    0
 #
 # Clock description
 #
diff --git a/ds.h b/ds.h
index ea25fbb..496b120 100644
--- a/ds.h
+++ b/ds.h
@@ -61,6 +61,7 @@ struct default_ds {
        struct clock_description clock_desc;
        enum filter_type delay_filter;
        int delay_filter_length;
+       int boundary_clock_jbod;
 };
 
 struct dataset {
diff --git a/gPTP.cfg b/gPTP.cfg
index e15a05a..824b854 100644
--- a/gPTP.cfg
+++ b/gPTP.cfg
@@ -69,3 +69,4 @@ delay_mechanism               P2P
 time_stamping          hardware
 delay_filter           moving_median
 delay_filter_length    10
+boundary_clock_jbod    0
diff --git a/ptp4l.8 b/ptp4l.8
index 687beb6..6a9e331 100644
--- a/ptp4l.8
+++ b/ptp4l.8
@@ -1,4 +1,4 @@
-.TH PTP4l 8 "October 2013" "linuxptp"
+.TH PTP4l 8 "November 2014" "linuxptp"
 .SH NAME
 ptp4l \- PTP Boundary/Ordinary Clock
 
@@ -205,6 +205,16 @@ The default is moving_median.
 .B delay_filter_length
 The length of the delay filter in samples.
 The default is 10.
+.TP
+.B boundary_clock_jbod
+When running as a boundary clock (that is, when more than one network
+interface is configured), ptp4l performs a sanity check to make sure
+that all of the ports share the same hardware clock device. This
+option allows ptp4l to work as a boundary clock using "just a bunch of
+devices" that are not synchronized to each other. For this mode, the
+collection of clocks must be synchronized by an external program, for
+example phc2sys(8) in "automatic" mode.
+The default is 0 (disabled).
 
 .SH PROGRAM AND CLOCK OPTIONS
 
diff --git a/ptp4l.c b/ptp4l.c
index 83824f7..dadc4da 100644
--- a/ptp4l.c
+++ b/ptp4l.c
@@ -75,6 +75,7 @@ static struct config cfg_settings = {
                },
                .delay_filter = FILTER_MOVING_MEDIAN,
                .delay_filter_length = 10,
+               .boundary_clock_jbod = 0,
        },
 
        .pod = {
-- 
1.7.10.4


------------------------------------------------------------------------------
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to