This patch adds a new timer to be used by the client side unicast
negotiation logic.

Signed-off-by: Richard Cochran <richardcoch...@gmail.com>
---
 e2e_tc.c | 1 +
 fd.h     | 3 ++-
 p2p_tc.c | 1 +
 port.c   | 6 ++++++
 4 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/e2e_tc.c b/e2e_tc.c
index 03b1a4f..3c75fe0 100644
--- a/e2e_tc.c
+++ b/e2e_tc.c
@@ -116,6 +116,7 @@ enum fsm_event e2e_event(struct port *p, int fd_index)
 
        case FD_MANNO_TIMER:
        case FD_SYNC_TX_TIMER:
+       case FD_UNICAST_REQ_TIMER:
                pr_err("unexpected timer expiration");
                return EV_NONE;
 
diff --git a/fd.h b/fd.h
index 78d1141..215a963 100644
--- a/fd.h
+++ b/fd.h
@@ -20,7 +20,7 @@
 #ifndef HAVE_FD_H
 #define HAVE_FD_H
 
-#define N_TIMER_FDS 6
+#define N_TIMER_FDS 7
 
 /*
  * The order matters here.  The DELAY timer must appear before the
@@ -37,6 +37,7 @@ enum {
        FD_QUALIFICATION_TIMER,
        FD_MANNO_TIMER,
        FD_SYNC_TX_TIMER,
+       FD_UNICAST_REQ_TIMER,
        FD_RTNL,
        N_POLLFD,
 };
diff --git a/p2p_tc.c b/p2p_tc.c
index 22ec9a7..2562b72 100644
--- a/p2p_tc.c
+++ b/p2p_tc.c
@@ -119,6 +119,7 @@ enum fsm_event p2p_event(struct port *p, int fd_index)
 
        case FD_MANNO_TIMER:
        case FD_SYNC_TX_TIMER:
+       case FD_UNICAST_REQ_TIMER:
                pr_err("unexpected timer expiration");
                return EV_NONE;
 
diff --git a/port.c b/port.c
index ce25b61..a0355dc 100644
--- a/port.c
+++ b/port.c
@@ -2243,6 +2243,7 @@ static void port_e2e_transition(struct port *p, enum 
port_state next)
        port_clr_tmo(p->fda.fd[FD_QUALIFICATION_TIMER]);
        port_clr_tmo(p->fda.fd[FD_MANNO_TIMER]);
        port_clr_tmo(p->fda.fd[FD_SYNC_TX_TIMER]);
+       /* Leave FD_UNICAST_REQ_TIMER running. */
 
        switch (next) {
        case PS_INITIALIZING:
@@ -2284,6 +2285,7 @@ static void port_p2p_transition(struct port *p, enum 
port_state next)
        port_clr_tmo(p->fda.fd[FD_QUALIFICATION_TIMER]);
        port_clr_tmo(p->fda.fd[FD_MANNO_TIMER]);
        port_clr_tmo(p->fda.fd[FD_SYNC_TX_TIMER]);
+       /* Leave FD_UNICAST_REQ_TIMER running. */
 
        switch (next) {
        case PS_INITIALIZING:
@@ -2452,6 +2454,10 @@ static enum fsm_event bc_event(struct port *p, int 
fd_index)
                port_set_sync_tx_tmo(p);
                return port_tx_sync(p, NULL) ? EV_FAULT_DETECTED : EV_NONE;
 
+       case FD_UNICAST_REQ_TIMER:
+               pr_debug("port %hu: unicast request timeout", portnum(p));
+               return EV_NONE;
+
        case FD_RTNL:
                pr_debug("port %hu: received link status notification", 
portnum(p));
                rtnl_link_status(fd, p->name, port_link_status, p);
-- 
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
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to