From a7a8e45f5d96538b362a7b4b0f780b41be5ec512 Mon Sep 17 00:00:00 2001 From: Michal Wasko Date: Thu, 24 Aug 2017 13:24:31 +0200 Subject: 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 --- daemons/gptp/common/ether_port.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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 ); -- cgit v1.2.1