icE1usb fw: Automatically report alarm condition to remote peer

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I5ccf6b92f7be512bad3dda42caaee5f7eabf3ca3
This commit is contained in:
Sylvain Munaut 2024-04-30 12:55:13 +02:00
parent 594b87bda9
commit 4fe5ea9c14
1 changed files with 6 additions and 0 deletions

View File

@ -646,6 +646,12 @@ e1_poll(int port)
e1->errors.flags &= ~E1_ERR_F_RAI;
}
/* If we have any local alarm, make sure to notify remote side */
if (e1->errors.flags & (E1_ERR_F_LOS | E1_ERR_F_AIS | E1_ERR_F_ALIGN_ERR))
e1_regs->tx.csr = e1->tx.cr.val | E1_TX_CR_ALARM;
else
e1_regs->tx.csr = e1->tx.cr.val;
/* Update leds */
_e1_update_leds(port);