Signed-off-by: Richard Cochran <[email protected]>
---
port.c | 28 +++++++++++++---------------
port_private.h | 17 +++++++++++++++++
2 files changed, 30 insertions(+), 15 deletions(-)
diff --git a/port.c b/port.c
index c1d2f04..eba46a0 100644
--- a/port.c
+++ b/port.c
@@ -51,8 +51,6 @@ enum syfu_event {
FUP_MATCH,
};
-#define portnum(p) (p->portIdentity.portNumber)
-
static int port_capable(struct port *p);
static int port_is_ieee8021as(struct port *p);
static void port_nrate_initialize(struct port *p);
@@ -129,7 +127,7 @@ static int pid_eq(struct PortIdentity *a, struct
PortIdentity *b)
return 0 == memcmp(a, b, sizeof(*a));
}
-static int source_pid_eq(struct ptp_message *m1, struct ptp_message *m2)
+int source_pid_eq(struct ptp_message *m1, struct ptp_message *m2)
{
return pid_eq(&m1->header.sourcePortIdentity,
&m2->header.sourcePortIdentity);
@@ -264,7 +262,7 @@ static void fc_prune(struct foreign_clock *fc)
}
}
-static void ts_add(struct timespec *ts, int ns)
+void ts_add(struct timespec *ts, int ns)
{
if (!ns) {
return;
@@ -535,7 +533,7 @@ not_capable:
return 0;
}
-static int port_clr_tmo(int fd)
+int port_clr_tmo(int fd)
{
struct itimerspec tmo = {
{0, 0}, {0, 0}
@@ -895,7 +893,7 @@ static int port_set_announce_tmo(struct port *p)
p->announce_span, p->logAnnounceInterval);
}
-static int port_set_delay_tmo(struct port *p)
+int port_set_delay_tmo(struct port *p)
{
if (p->delayMechanism == DM_P2P) {
return set_tmo_log(p->fda.fd[FD_DELAY_TIMER], 1,
@@ -928,8 +926,8 @@ static int port_set_sync_tx_tmo(struct port *p)
return set_tmo_log(p->fda.fd[FD_SYNC_TX_TIMER], 1, p->logSyncInterval);
}
-static void port_show_transition(struct port *p,
- enum port_state next, enum fsm_event event)
+void port_show_transition(struct port *p, enum port_state next,
+ enum fsm_event event)
{
if (event == EV_FAULT_DETECTED) {
pr_notice("port %hu: %s to %s on %s (%s)", portnum(p),
@@ -1121,7 +1119,7 @@ out:
return -1;
}
-static int port_delay_request(struct port *p)
+int port_delay_request(struct port *p)
{
struct ptp_message *msg;
@@ -1306,7 +1304,7 @@ out:
/*
* port initialize and disable
*/
-static int port_is_enabled(struct port *p)
+int port_is_enabled(struct port *p)
{
switch (p->state) {
case PS_INITIALIZING:
@@ -1365,7 +1363,7 @@ static void port_clear_fda(struct port *p, int count)
p->fda.fd[i] = -1;
}
-static void port_disable(struct port *p)
+void port_disable(struct port *p)
{
int i;
@@ -1386,7 +1384,7 @@ static void port_disable(struct port *p)
clock_fda_changed(p->clock);
}
-static int port_initialize(struct port *p)
+int port_initialize(struct port *p)
{
struct config *cfg = clock_config(p->clock);
int fd[N_TIMER_FDS], i;
@@ -1675,7 +1673,7 @@ static void process_follow_up(struct port *p, struct
ptp_message *m)
port_syfufsm(p, event, m);
}
-static int process_pdelay_req(struct port *p, struct ptp_message *m)
+int process_pdelay_req(struct port *p, struct ptp_message *m)
{
struct ptp_message *rsp, *fup;
int err;
@@ -1846,7 +1844,7 @@ calc:
p->peer_delay_req = NULL;
}
-static int process_pdelay_resp(struct port *p, struct ptp_message *m)
+int process_pdelay_resp(struct port *p, struct ptp_message *m)
{
if (p->peer_delay_resp) {
if (!source_pid_eq(p->peer_delay_resp, m)) {
@@ -1890,7 +1888,7 @@ static int process_pdelay_resp(struct port *p, struct
ptp_message *m)
return 0;
}
-static void process_pdelay_resp_fup(struct port *p, struct ptp_message *m)
+void process_pdelay_resp_fup(struct port *p, struct ptp_message *m)
{
if (!p->peer_delay_req)
return;
diff --git a/port_private.h b/port_private.h
index 8815bd4..dc69df0 100644
--- a/port_private.h
+++ b/port_private.h
@@ -22,6 +22,7 @@
#include <sys/queue.h>
#include "clock.h"
+#include "fsm.h"
#include "msg.h"
#include "tmv.h"
@@ -110,4 +111,20 @@ struct port {
LIST_HEAD(fm, foreign_clock) foreign_masters;
};
+#define portnum(p) (p->portIdentity.portNumber)
+
+int source_pid_eq(struct ptp_message *m1, struct ptp_message *m2);
+void ts_add(struct timespec *ts, int ns);
+int port_clr_tmo(int fd);
+int port_set_delay_tmo(struct port *p);
+void port_show_transition(struct port *p, enum port_state next,
+ enum fsm_event event);
+int port_delay_request(struct port *p);
+int port_is_enabled(struct port *p);
+void port_disable(struct port *p);
+int port_initialize(struct port *p);
+int process_pdelay_req(struct port *p, struct ptp_message *m);
+int process_pdelay_resp(struct port *p, struct ptp_message *m);
+void process_pdelay_resp_fup(struct port *p, struct ptp_message *m);
+
#endif
--
2.13.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