Notify subscribers about port state changes.

Signed-off-by: Jiri Benc <jb...@redhat.com>
---
 notification.h |    2 +-
 port.c         |    6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/notification.h b/notification.h
index 57e7a7856360..47c9b56c4f7e 100644
--- a/notification.h
+++ b/notification.h
@@ -21,7 +21,7 @@
 #define HAVE_NOTIFICATION_H
 
 enum notification {
-       NOTIFY_DUMMY,
+       NOTIFY_PORT_STATE,
 };
 
 #endif
diff --git a/port.c b/port.c
index 29e98ceb66ce..64c01be127e3 100644
--- a/port.c
+++ b/port.c
@@ -2038,6 +2038,7 @@ int port_dispatch(struct port *p, enum fsm_event event, 
int mdiff)
                if (next == PS_LISTENING && p->delayMechanism == DM_P2P) {
                        port_set_delay_tmo(p);
                }
+               port_notify_event(p, NOTIFY_PORT_STATE);
                return 1;
        }
 
@@ -2053,6 +2054,7 @@ int port_dispatch(struct port *p, enum fsm_event event, 
int mdiff)
        }
 
        p->state = next;
+       port_notify_event(p, NOTIFY_PORT_STATE);
        return 0;
 }
 
@@ -2350,7 +2352,9 @@ void port_notify_event(struct port *p, enum notification 
event)
        int id;
 
        switch (event) {
-       /* set id */
+       case NOTIFY_PORT_STATE:
+               id = PORT_DATA_SET;
+               break;
        default:
                return;
        }
-- 
1.7.6.5


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to