summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Wasko <michal.wasko@intel.com>2017-08-24 13:24:31 +0200
committerMichal Wasko <michal.wasko@intel.com>2017-08-24 13:24:31 +0200
commita7a8e45f5d96538b362a7b4b0f780b41be5ec512 (patch)
treeaf6c07a8ae967a01b2772b3ed1797975e9342d76
parent5faee0055827e70360e14f9b06f95785172ef3ab (diff)
downloadOpen-AVB-a7a8e45f5d96538b362a7b4b0f780b41be5ec512.tar.gz
PTP Port role restore on Link Up event
PTP Master/Slave port role restore added to Link Up event processing to guarantee proper gPTP daemon re-sync after Link loss situation due to partner platform reboot. The PTP role restore is especially important for the case when platforms are connected directly with ethernet cable - no switch in between. Signed-off-by: Michal Wasko <michal.wasko@intel.com>
-rw-r--r--daemons/gptp/common/ether_port.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/daemons/gptp/common/ether_port.cpp b/daemons/gptp/common/ether_port.cpp
index f517c181..024531cc 100644
--- a/daemons/gptp/common/ether_port.cpp
+++ b/daemons/gptp/common/ether_port.cpp
@@ -403,6 +403,14 @@ bool EtherPort::_processEvent( Event e )
GPTP_LOG_STATUS("LINKUP");
}
+ if( clock->getPriority1() == 255 || getPortState() == PTP_SLAVE ) {
+ becomeSlave( true );
+ } else if( getPortState() == PTP_MASTER ) {
+ becomeMaster( true );
+ } else {
+ startAnnounce();
+ }
+
if (automotive_profile) {
setAsCapable( true );