At the moment, a clock which emits PPS is not synchronizable, and
therefore called "master", and a clock which timestamps PPS is
synchronizable, and therefore called "slave".

The ts2phc program is preparing to decouple the concept of clock
synchronization from the concept of who emits PPS and who timestamps
PPS.

When that will happen, the "master" and "slave" terminology will become
vague. Rename what is today a "master" to a "PPS source" and a "slave"
to a "PPS sink". Temporarily, the clock representing the time reference
still coincides with the "PPS source", and the target clocks for
synchronization still coincide with the "PPS sinks".

The change only renames files and their occurrences in the source code
(include paths and makefile). No functional change intended.

Suggested-by: Richard Cochran <richardcoch...@gmail.com>
Signed-off-by: Vladimir Oltean <olte...@gmail.com>
---
v4->v5: patch is new

 makefile                                               | 4 ++--
 ts2phc.c                                               | 4 ++--
 ts2phc_generic_master.c => ts2phc_generic_pps_source.c | 4 ++--
 ts2phc_generic_master.h => ts2phc_generic_pps_source.h | 4 ++--
 ts2phc_nmea_master.c => ts2phc_nmea_pps_source.c       | 6 +++---
 ts2phc_nmea_master.h => ts2phc_nmea_pps_source.h       | 4 ++--
 ts2phc_phc_master.c => ts2phc_phc_pps_source.c         | 6 +++---
 ts2phc_phc_master.h => ts2phc_phc_pps_source.h         | 4 ++--
 ts2phc_slave.c => ts2phc_pps_sink.c                    | 4 ++--
 ts2phc_slave.h => ts2phc_pps_sink.h                    | 4 ++--
 ts2phc_master.c => ts2phc_pps_source.c                 | 8 ++++----
 ts2phc_master.h => ts2phc_pps_source.h                 | 2 +-
 ts2phc_master_private.h => ts2phc_pps_source_private.h | 4 ++--
 13 files changed, 29 insertions(+), 29 deletions(-)
 rename ts2phc_generic_master.c => ts2phc_generic_pps_source.c (94%)
 rename ts2phc_generic_master.h => ts2phc_generic_pps_source.h (81%)
 rename ts2phc_nmea_master.c => ts2phc_nmea_pps_source.c (98%)
 rename ts2phc_nmea_master.h => ts2phc_nmea_pps_source.h (81%)
 rename ts2phc_phc_master.c => ts2phc_phc_pps_source.c (96%)
 rename ts2phc_phc_master.h => ts2phc_phc_pps_source.h (82%)
 rename ts2phc_slave.c => ts2phc_pps_sink.c (99%)
 rename ts2phc_slave.h => ts2phc_pps_sink.h (88%)
 rename ts2phc_master.c => ts2phc_pps_source.c (84%)
 rename ts2phc_master.h => ts2phc_pps_source.h (97%)
 rename ts2phc_master_private.h => ts2phc_pps_source_private.h (86%)

diff --git a/makefile b/makefile
index 33e7ca0f038b..5295b60b5dac 100644
--- a/makefile
+++ b/makefile
@@ -26,8 +26,8 @@ PRG   = ptp4l hwstamp_ctl nsm phc2sys phc_ctl pmc timemaster 
ts2phc
 FILTERS        = filter.o mave.o mmedian.o
 SERVOS = linreg.o ntpshm.o nullf.o pi.o servo.o
 TRANSP = raw.o transport.o udp.o udp6.o uds.o
-TS2PHC = ts2phc.o lstab.o nmea.o serial.o sock.o ts2phc_generic_master.o \
- ts2phc_master.o ts2phc_phc_master.o ts2phc_nmea_master.o ts2phc_slave.o
+TS2PHC = ts2phc.o lstab.o nmea.o serial.o sock.o ts2phc_generic_pps_source.o \
+ ts2phc_nmea_pps_source.o ts2phc_phc_pps_source.o ts2phc_pps_sink.o 
ts2phc_pps_source.o
 OBJ    = bmc.o clock.o clockadj.o clockcheck.o config.o designated_fsm.o \
  e2e_tc.o fault.o $(FILTERS) fsm.o hash.o interface.o monitor.o msg.o phc.o \
  port.o port_signaling.o pqueue.o print.o ptp4l.o p2p_tc.o rtnl.o $(SERVOS) \
diff --git a/ts2phc.c b/ts2phc.c
index bc410415dfc6..8f2039085812 100644
--- a/ts2phc.c
+++ b/ts2phc.c
@@ -11,8 +11,8 @@
 #include "config.h"
 #include "interface.h"
 #include "print.h"
-#include "ts2phc_master.h"
-#include "ts2phc_slave.h"
+#include "ts2phc_pps_source.h"
+#include "ts2phc_pps_sink.h"
 #include "version.h"
 
 struct interface {
diff --git a/ts2phc_generic_master.c b/ts2phc_generic_pps_source.c
similarity index 94%
rename from ts2phc_generic_master.c
rename to ts2phc_generic_pps_source.c
index ad4f7f1cf1d7..0afea8ec1594 100644
--- a/ts2phc_generic_master.c
+++ b/ts2phc_generic_pps_source.c
@@ -8,8 +8,8 @@
 
 #include "missing.h"
 #include "print.h"
-#include "ts2phc_generic_master.h"
-#include "ts2phc_master_private.h"
+#include "ts2phc_generic_pps_source.h"
+#include "ts2phc_pps_source_private.h"
 #include "util.h"
 
 struct ts2phc_generic_master {
diff --git a/ts2phc_generic_master.h b/ts2phc_generic_pps_source.h
similarity index 81%
rename from ts2phc_generic_master.h
rename to ts2phc_generic_pps_source.h
index ac0ce4f11cb8..94ab29b30bcb 100644
--- a/ts2phc_generic_master.h
+++ b/ts2phc_generic_pps_source.h
@@ -1,12 +1,12 @@
 /**
- * @file ts2phc_generic_master.h
+ * @file ts2phc_generic_pps_source.h
  * @note Copyright (C) 2019 Richard Cochran <richardcoch...@gmail.com>
  * @note SPDX-License-Identifier: GPL-2.0+
  */
 #ifndef HAVE_TS2PHC_GENERIC_MASTER_H
 #define HAVE_TS2PHC_GENERIC_MASTER_H
 
-#include "ts2phc_master.h"
+#include "ts2phc_pps_source.h"
 
 struct ts2phc_master *ts2phc_generic_master_create(struct config *cfg,
                                                   const char *dev);
diff --git a/ts2phc_nmea_master.c b/ts2phc_nmea_pps_source.c
similarity index 98%
rename from ts2phc_nmea_master.c
rename to ts2phc_nmea_pps_source.c
index a383429ea385..17ba9883e724 100644
--- a/ts2phc_nmea_master.c
+++ b/ts2phc_nmea_pps_source.c
@@ -1,5 +1,5 @@
 /**
- * @file ts2phc_nmea_master.c
+ * @file ts2phc_nmea_pps_source.c
  * @note Copyright (C) 2019 Richard Cochran <richardcoch...@gmail.com>
  * @note SPDX-License-Identifier: GPL-2.0+
  */
@@ -19,8 +19,8 @@
 #include "serial.h"
 #include "sock.h"
 #include "tmv.h"
-#include "ts2phc_master_private.h"
-#include "ts2phc_nmea_master.h"
+#include "ts2phc_pps_source_private.h"
+#include "ts2phc_nmea_pps_source.h"
 #include "util.h"
 
 #define MAX_RMC_AGE    5000000000ULL
diff --git a/ts2phc_nmea_master.h b/ts2phc_nmea_pps_source.h
similarity index 81%
rename from ts2phc_nmea_master.h
rename to ts2phc_nmea_pps_source.h
index 7430e20662b9..d05be1cc31a0 100644
--- a/ts2phc_nmea_master.h
+++ b/ts2phc_nmea_pps_source.h
@@ -1,12 +1,12 @@
 /**
- * @file ts2phc_nmea_master.h
+ * @file ts2phc_nmea_pps_source.h
  * @note Copyright (C) 2019 Richard Cochran <richardcoch...@gmail.com>
  * @note SPDX-License-Identifier: GPL-2.0+
  */
 #ifndef HAVE_TS2PHC_NMEA_MASTER_H
 #define HAVE_TS2PHC_NMEA_MASTER_H
 
-#include "ts2phc_master.h"
+#include "ts2phc_pps_source.h"
 
 struct ts2phc_master *ts2phc_nmea_master_create(struct config *cfg,
                                                const char *dev);
diff --git a/ts2phc_phc_master.c b/ts2phc_phc_pps_source.c
similarity index 96%
rename from ts2phc_phc_master.c
rename to ts2phc_phc_pps_source.c
index 9f1837bc80eb..faf9bb779684 100644
--- a/ts2phc_phc_master.c
+++ b/ts2phc_phc_pps_source.c
@@ -1,5 +1,5 @@
 /**
- * @file ts2phc_phc_master.c
+ * @file ts2phc_phc_pps_source.c
  * @note Copyright (C) 2019 Richard Cochran <richardcoch...@gmail.com>
  * @note SPDX-License-Identifier: GPL-2.0+
  */
@@ -12,8 +12,8 @@
 #include "phc.h"
 #include "print.h"
 #include "missing.h"
-#include "ts2phc_master_private.h"
-#include "ts2phc_phc_master.h"
+#include "ts2phc_pps_source_private.h"
+#include "ts2phc_phc_pps_source.h"
 #include "util.h"
 
 struct ts2phc_phc_master {
diff --git a/ts2phc_phc_master.h b/ts2phc_phc_pps_source.h
similarity index 82%
rename from ts2phc_phc_master.h
rename to ts2phc_phc_pps_source.h
index 568df1a403d4..d0e130066068 100644
--- a/ts2phc_phc_master.h
+++ b/ts2phc_phc_pps_source.h
@@ -1,12 +1,12 @@
 /**
- * @file ts2phc_phc_master.h
+ * @file ts2phc_phc_pps_source.h
  * @note Copyright (C) 2019 Richard Cochran <richardcoch...@gmail.com>
  * @note SPDX-License-Identifier: GPL-2.0+
  */
 #ifndef HAVE_TS2PHC_PHC_MASTER_H
 #define HAVE_TS2PHC_PHC_MASTER_H
 
-#include "ts2phc_master.h"
+#include "ts2phc_pps_source.h"
 
 struct ts2phc_master *ts2phc_phc_master_create(struct config *cfg,
                                               const char *dev);
diff --git a/ts2phc_slave.c b/ts2phc_pps_sink.c
similarity index 99%
rename from ts2phc_slave.c
rename to ts2phc_pps_sink.c
index 652d9b7a106b..a2245e62d58c 100644
--- a/ts2phc_slave.c
+++ b/ts2phc_pps_sink.c
@@ -21,8 +21,8 @@
 #include "phc.h"
 #include "print.h"
 #include "servo.h"
-#include "ts2phc_master.h"
-#include "ts2phc_slave.h"
+#include "ts2phc_pps_source.h"
+#include "ts2phc_pps_sink.h"
 #include "util.h"
 
 #define NS_PER_SEC             1000000000LL
diff --git a/ts2phc_slave.h b/ts2phc_pps_sink.h
similarity index 88%
rename from ts2phc_slave.h
rename to ts2phc_pps_sink.h
index 2de5ab7dd0ff..842e5b9ebe6e 100644
--- a/ts2phc_slave.h
+++ b/ts2phc_pps_sink.h
@@ -1,5 +1,5 @@
 /**
- * @file ts2phc_slave.h
+ * @file ts2phc_pps_sink.h
  * @brief Utility program to synchronize the PHC clock to external events
  * @note Copyright (C) 2019 Balint Ferencz <fer...@sch.bme.hu>
  * @note SPDX-License-Identifier: GPL-2.0+
@@ -7,7 +7,7 @@
 #ifndef HAVE_TS2PHC_SLAVE_H
 #define HAVE_TS2PHC_SLAVE_H
 
-#include "ts2phc_master.h"
+#include "ts2phc_pps_source.h"
 
 int ts2phc_slave_add(struct config *cfg, const char *name);
 
diff --git a/ts2phc_master.c b/ts2phc_pps_source.c
similarity index 84%
rename from ts2phc_master.c
rename to ts2phc_pps_source.c
index 9283580df3fc..a2e8ed5ccd4b 100644
--- a/ts2phc_master.c
+++ b/ts2phc_pps_source.c
@@ -3,10 +3,10 @@
  * @note Copyright (C) 2019 Richard Cochran <richardcoch...@gmail.com>
  * @note SPDX-License-Identifier: GPL-2.0+
  */
-#include "ts2phc_generic_master.h"
-#include "ts2phc_master_private.h"
-#include "ts2phc_nmea_master.h"
-#include "ts2phc_phc_master.h"
+#include "ts2phc_generic_pps_source.h"
+#include "ts2phc_pps_source_private.h"
+#include "ts2phc_nmea_pps_source.h"
+#include "ts2phc_phc_pps_source.h"
 
 struct ts2phc_master *ts2phc_master_create(struct config *cfg, const char *dev,
                                           enum ts2phc_master_type type)
diff --git a/ts2phc_master.h b/ts2phc_pps_source.h
similarity index 97%
rename from ts2phc_master.h
rename to ts2phc_pps_source.h
index 79765b696d71..7a05df35e01b 100644
--- a/ts2phc_master.h
+++ b/ts2phc_pps_source.h
@@ -1,5 +1,5 @@
 /**
- * @file ts2phc_master.h
+ * @file ts2phc_pps_source.h
  * @note Copyright (C) 2019 Richard Cochran <richardcoch...@gmail.com>
  * @note SPDX-License-Identifier: GPL-2.0+
  */
diff --git a/ts2phc_master_private.h b/ts2phc_pps_source_private.h
similarity index 86%
rename from ts2phc_master_private.h
rename to ts2phc_pps_source_private.h
index 463a1f003a21..e98827ac2f6f 100644
--- a/ts2phc_master_private.h
+++ b/ts2phc_pps_source_private.h
@@ -1,5 +1,5 @@
 /**
- * @file ts2phc_master_private.h
+ * @file ts2phc_pps_source_private.h
  * @note Copyright (C) 2019 Richard Cochran <richardcoch...@gmail.com>
  * @note SPDX-License-Identifier: GPL-2.0+
  */
@@ -10,7 +10,7 @@
 #include <time.h>
 
 #include "contain.h"
-#include "ts2phc_master.h"
+#include "ts2phc_pps_source.h"
 
 struct ts2phc_master {
        void (*destroy)(struct ts2phc_master *ts2phc_master);
-- 
2.25.1



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

Reply via email to