Skip to content

Commit 8f05bf8

Browse files
committed
[cru] Improve ONU status logic
1 parent 4d8a8da commit 8f05bf8

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/Cru/Ttc.cxx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,18 @@ OnuStickyStatus Ttc::getOnuStickyStatus(bool monitoring)
166166
is = mBar->readRegister(Cru::Registers::TTC_ONU_STICKY.index);
167167
}
168168

169-
if (is == 0x0 || is == 0x8) {
169+
// onu sticky bits: [mgtRxPllLocked][mgtTxPllLocked][mgtRxReady][mgtTxReady][operational][rxLocked][phaseGood][rx40Locked]
170+
// bit 0 = no error = GOOD | bit 1 = error = BAD
171+
// first we invert the sticky status: after inversion 1 = GOOD
172+
auto notIs = ~is;
173+
174+
// mgtTxPllLocked | mgtTxReady | operational | phaseGood <-- these should be GOOD for upstream to be UP
175+
if ((notIs & 0xb01011010) == 0xb01011010) {
170176
upstreamStatus = LinkStatus::Up;
171-
downstreamStatus = LinkStatus::Up;
172-
} else if (is == 0x1a) {
177+
}
178+
179+
// mgtRxPllLocked | mgtRxReady | rxLocked | rx40Locked <-- these should be GOOD for upstream to be UP
180+
if ((notIs & 0xb10100101) == 0xb10100101) {
173181
downstreamStatus = LinkStatus::Up;
174182
}
175183

0 commit comments

Comments
 (0)