Commit 7043d45f authored by Harald Welte's avatar Harald Welte

icE1usb: Add support for reporting remote alarm (RAI) as YELLOW alarm

In osmo-e1-hardware.git Change-Id Ic4f57cf79bd32cf75f81ef3073cb8d4a2d1857d8
the icE1usb firmware gained support for reporting the E1_ERR_F_RAI flag
via USB interrupt transfers.  Make use of that to report YELLOW alarm
via the usual DAHDI alarms infrastructure.
parent 9fdd2e53
......@@ -531,7 +531,8 @@ static void ice1usb_update_counters(struct ice1usb *ieu, const struct ice1usb_ir
memcpy(&ieu->last_err, err, sizeof(ieu->last_err));
}
#define ALL_RED_ALARMS (DAHDI_ALARM_RED | DAHDI_ALARM_LFA | DAHDI_ALARM_LMFA | ICE1USB_ERR_F_LOS)
#define ALL_RY_ALARMS (DAHDI_ALARM_RED | DAHDI_ALARM_YELLOW | \
DAHDI_ALARM_LFA | DAHDI_ALARM_LMFA | ICE1USB_ERR_F_LOS)
/* interrupt EP completes: Process and resubmit */
static void ice1usb_irq_complete(struct urb *urb)
......@@ -558,7 +559,9 @@ static void ice1usb_irq_complete(struct urb *urb)
alarms |= DAHDI_ALARM_RED | DAHDI_ALARM_LOS;
if (err->flags & ICE1USB_ERR_F_ALIGN_ERR)
alarms |= DAHDI_ALARM_RED | DAHDI_ALARM_LFA | DAHDI_ALARM_LMFA;
ieu->dahdi.span.alarms &= ~ALL_RED_ALARMS;
if (err->flags & ICE1USB_ERR_F_RAI)
alarms |= DAHDI_ALARM_YELLOW;
ieu->dahdi.span.alarms &= ~ALL_RY_ALARMS;
ieu->dahdi.span.alarms |= alarms;
dahdi_alarm_notify(&ieu->dahdi.span);
ice1usb_update_counters(ieu, err);
......
......@@ -85,9 +85,10 @@ enum ice1usb_irq_type {
ICE1USB_IRQ_T_ERRCNT = 1,
};
/* Ensue ro keep those in sync with e1.h */
/* Ensue to keep those in sync with e1.h */
#define ICE1USB_ERR_F_ALIGN_ERR 0x01
#define ICE1USB_ERR_F_LOS 0x02
#define ICE1USB_ERR_F_RAI 0x04
struct ice1usb_irq_err {
/* 16-bit little-endian counters */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment