Signed-off-by: Richard Cochran <[email protected]>
---
bmc.h | 5 +++++
clock.c | 6 +++++-
config.c | 9 +++++++++
default.cfg | 1 +
gPTP.cfg | 1 +
port.c | 6 +++++-
6 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/bmc.h b/bmc.h
index b15bbc9..65b58ab 100644
--- a/bmc.h
+++ b/bmc.h
@@ -29,6 +29,11 @@
#define B_BETTER -1
#define B_BETTER_TOPO -2
+enum {
+ DS_CMP_IEEE1588,
+ DS_CMP_TELECOM,
+};
+
/**
* BMC state decision algorithm.
* @param c The local clock.
diff --git a/clock.c b/clock.c
index ac57cb5..d0ebe46 100644
--- a/clock.c
+++ b/clock.c
@@ -1041,7 +1041,11 @@ struct clock *clock_create(enum clock_type type, struct
config *config,
}
c->servo_state = SERVO_UNLOCKED;
c->servo_type = servo;
- c->dscmp = dscmp;
+ if (config_get_int(config, NULL, "dataset_comparison") ==
DS_CMP_TELECOM) {
+ c->dscmp = telecom_dscmp;
+ } else {
+ c->dscmp = dscmp;
+ }
c->tsproc = tsproc_create(config_get_int(config, NULL, "tsproc_mode"),
config_get_int(config, NULL, "delay_filter"),
config_get_int(config, NULL,
"delay_filter_length"));
diff --git a/config.c b/config.c
index a87598f..97fd649 100644
--- a/config.c
+++ b/config.c
@@ -22,6 +22,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+
+#include "bmc.h"
#include "config.h"
#include "ether.h"
#include "hash.h"
@@ -133,6 +135,12 @@ static struct config_enum clock_servo_enu[] = {
{ NULL, 0 },
};
+static struct config_enum dataset_comp_enu[] = {
+ { "ieee1588", DS_CMP_IEEE1588 },
+ { "telecom", DS_CMP_TELECOM },
+ { NULL, 0 },
+};
+
static struct config_enum delay_filter_enu[] = {
{ "moving_average", FILTER_MOVING_AVERAGE },
{ "moving_median", FILTER_MOVING_MEDIAN },
@@ -176,6 +184,7 @@ struct config_item config_tab[] = {
GLOB_ITEM_INT("clockAccuracy", 0xfe, 0, UINT8_MAX),
GLOB_ITEM_INT("clockClass", 248, 0, UINT8_MAX),
GLOB_ITEM_ENU("clock_servo", CLOCK_SERVO_PI, clock_servo_enu),
+ GLOB_ITEM_ENU("dataset_comparison", DS_CMP_IEEE1588, dataset_comp_enu),
GLOB_ITEM_INT("defaultDS.localPriority", 128, 1, UINT8_MAX),
PORT_ITEM_INT("delayAsymmetry", 0, INT_MIN, INT_MAX),
PORT_ITEM_ENU("delay_filter", FILTER_MOVING_MEDIAN, delay_filter_enu),
diff --git a/default.cfg b/default.cfg
index 726282c..1e8d334 100644
--- a/default.cfg
+++ b/default.cfg
@@ -13,6 +13,7 @@ clockAccuracy 0xFE
offsetScaledLogVariance 0xFFFF
free_running 0
freq_est_interval 1
+dataset_comparison ieee1588
defaultDS.localPriority 128
dscp_event 0
dscp_general 0
diff --git a/gPTP.cfg b/gPTP.cfg
index eced121..b0c94db 100644
--- a/gPTP.cfg
+++ b/gPTP.cfg
@@ -13,6 +13,7 @@ clockAccuracy 0xFE
offsetScaledLogVariance 0xFFFF
free_running 0
freq_est_interval 1
+dataset_comparison ieee1588
defaultDS.localPriority 128
#
# Port Data Set
diff --git a/port.c b/port.c
index a2e6fdf..b957429 100644
--- a/port.c
+++ b/port.c
@@ -2602,7 +2602,11 @@ struct port *port_open(int phc_index,
memset(p, 0, sizeof(*p));
p->state_machine = clock_slave_only(clock) ? ptp_slave_fsm : ptp_fsm;
- p->dscmp = dscmp;
+ if (config_get_int(cfg, NULL, "dataset_comparison") == DS_CMP_TELECOM) {
+ p->dscmp = telecom_dscmp;
+ } else {
+ p->dscmp = dscmp;
+ }
p->phc_index = phc_index;
p->jbod = config_get_int(cfg, interface->name, "boundary_clock_jbod");
transport = config_get_int(cfg, interface->name, "network_transport");
--
2.11.0
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel