[Asterisk-cvs] zaptel wct4xxp.c,1.35,1.36
markster at lists.digium.com
markster at lists.digium.com
Fri Apr 9 23:00:37 CDT 2004
Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/tmp/cvs-serv18362
Modified Files:
wct4xxp.c
Log Message:
Implement manual yellow alarm on things we should (like RECOVER and NOTOPEN) for bug 1091
Index: wct4xxp.c
===================================================================
RCS file: /usr/cvsroot/zaptel/wct4xxp.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- wct4xxp.c 9 Apr 2004 19:12:15 -0000 1.35
+++ wct4xxp.c 10 Apr 2004 03:01:57 -0000 1.36
@@ -1184,6 +1184,14 @@
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 @@
/* 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 @@
__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 @@
__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);
More information about the svn-commits
mailing list