diff options
Diffstat (limited to 'wct4xxp.c')
-rwxr-xr-x | wct4xxp.c | 32 |
1 files changed, 20 insertions, 12 deletions
@@ -1184,6 +1184,14 @@ static void __t4_do_counters(struct t4 *wc) for (span=0;span<4;span++) { if (wc->alarmtimer[span]) { if (!--wc->alarmtimer[span]) { + unsigned char fmr4; +#if 1 + printk("wct4xxp: Clearing yellow alarm on span %d\n", span + 1); +#endif + + /* We manually do yellow alarm to handle RECOVER */ + fmr4 = __t4_framer_in(wc, span, 0x20); + __t4_framer_out(wc, span, 0x20, fmr4 & ~0x20); wc->spans[span].alarms &= ~(ZT_ALARM_RECOVER); wc->checktiming = 1; zt_alarm_notify(&wc->spans[span]); @@ -1271,20 +1279,20 @@ static void __t4_check_alarms(struct t4 *wc, int span) /* Keep track of recovering */ if ((!alarms) && wc->spans[span].alarms) wc->alarmtimer[span] = ZT_ALARMSETTLE_TIME; + if (wc->alarmtimer[span]) + alarms |= ZT_ALARM_RECOVER; /* If receiving alarms, go into Yellow alarm state */ if (alarms && (!wc->spans[span].alarms)) { -#if 0 - printk("Going into yellow alarm\n"); + unsigned char fmr4; +#if 1 + printk("wct4xxp: Setting yellow alarm on span %d\n", span + 1); #endif -#if 0 - /* The quadfalc automatically generates yellow alarm */ - if (wc->spantype[span] == TYPE_E1) - __t1_set_reg(wc, 0x21, 0x7f); - else - __t1_set_reg(wc, 0x35, 0x11); -#endif + + /* We manually do yellow alarm to handle RECOVER and NOTOPEN, otherwise it's auto anyway */ + fmr4 = __t4_framer_in(wc, span, 0x20); + __t4_framer_out(wc, span, 0x20, fmr4 | 0x20); } #if 0 @@ -1303,8 +1311,6 @@ static void __t4_check_alarms(struct t4 *wc, int span) __control_set_reg(wc, WC_CLOCK, d); } #endif - if (wc->alarmtimer[span]) - alarms |= ZT_ALARM_RECOVER; if (c & 0x10) alarms |= ZT_ALARM_YELLOW; @@ -1468,10 +1474,12 @@ static void t4_interrupt(int irq, void *dev_id, struct pt_regs *regs) __t4_check_alarms(wc, x - 4); break; } - + +#if 0 /* periodically check timing */ if (!(wc->intcount % (8000/ZT_CHUNKSIZE))) wc->checktiming = 1; +#endif if (wc->checktiming > 0) __t4_set_timing_source_auto(wc); |