summaryrefslogtreecommitdiff
path: root/wct4xxp.c
diff options
context:
space:
mode:
authorcitats <citats@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-04-10 07:00:25 +0000
committercitats <citats@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-04-10 07:00:25 +0000
commitc0a35bb70a6d3f56f7cb675ef05792ad4a3873e0 (patch)
tree755322c1e4ec3de6e068313a0ba354648a0a5857 /wct4xxp.c
parent01ddfd42f69e40558650319072abc8a5de3c87de (diff)
Hopefully get Yellow alarm working properly on wct4xxp
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@360 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wct4xxp.c')
-rwxr-xr-xwct4xxp.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/wct4xxp.c b/wct4xxp.c
index 30b93dd..b19e27d 100755
--- a/wct4xxp.c
+++ b/wct4xxp.c
@@ -70,6 +70,7 @@ static int altab[] = {
#define FLAG_STARTED (1 << 0)
#define FLAG_NMF (1 << 1)
+#define FLAG_SENDINGYELLOW (1 << 2)
#define TYPE_T1 1 /* is a T1 card */
#define TYPE_E1 2 /* is an E1 card */
@@ -1184,14 +1185,6 @@ 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]);
@@ -1218,7 +1211,7 @@ static void __t4_check_alarms(struct t4 *wc, int span)
oldalarms = wc->spans[span].alarms;
/* And consider only carrier alarms */
- wc->spans[span].alarms &= (ZT_ALARM_RED | ZT_ALARM_BLUE | ZT_ALARM_RECOVER | ZT_ALARM_NOTOPEN);
+ wc->spans[span].alarms &= (ZT_ALARM_RED | ZT_ALARM_BLUE | ZT_ALARM_NOTOPEN);
if (wc->spantype[span] == TYPE_E1) {
if (c & 0x04) {
@@ -1281,18 +1274,26 @@ static void __t4_check_alarms(struct t4 *wc, int span)
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 (alarms && !(wc->spanflags[span] & FLAG_SENDINGYELLOW)) {
unsigned char fmr4;
#if 1
printk("wct4xxp: Setting yellow alarm on span %d\n", span + 1);
#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);
+ wc->spanflags[span] |= FLAG_SENDINGYELLOW;
+ } else if (!alarms && wc->spanflags[span] & FLAG_SENDINGYELLOW) {
+ 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->spanflags[span] &= ~FLAG_SENDINGYELLOW;
}
#if 0