summaryrefslogtreecommitdiff
path: root/wct4xxp.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-06-14 22:34:12 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-06-14 22:34:12 +0000
commit47d58520eed5b098d5579a7dee1a4c9f03185e05 (patch)
tree1dcdbe241ae746bccd6c4f293a91b09e91c10ca5 /wct4xxp.c
parent26c79e9cecfaf0e122965ca8313290bfd1c27b77 (diff)
Add optional debounce timer for red alarm
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@408 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wct4xxp.c')
-rwxr-xr-xwct4xxp.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/wct4xxp.c b/wct4xxp.c
index 527df1f..d39822f 100755
--- a/wct4xxp.c
+++ b/wct4xxp.c
@@ -59,6 +59,7 @@ static int timingcable;
static int highestorder;
static int t1e1override = -1;
static int loopback = 0;
+static int alarmdebounce = 0;
#ifdef FANCY_ALARM
static int altab[] = {
@@ -93,6 +94,7 @@ struct t4 {
int alarmtimer[4]; /* Alarm timer */
int redalarms[4];
int blinktimer;
+ int alarmcount[4]; /* How much red alarm we've seen */
#ifdef FANCY_ALARM
int alarmpos;
#endif
@@ -1169,8 +1171,13 @@ static void __t4_check_alarms(struct t4 *wc, int span)
alarms |= ZT_ALARM_NOTOPEN;
}
- if (c & 0xa0)
- alarms |= ZT_ALARM_RED;
+ if (c & 0xa0) {
+ if (wc->alarmcount[span] >= alarmdebounce)
+ alarms |= ZT_ALARM_RED;
+ else
+ wc->alarmcount[span]++;
+ } else
+ wc->alarmcount[span] = 0;
if (c & 0x4)
alarms |= ZT_ALARM_BLUE;
@@ -1714,6 +1721,7 @@ MODULE_PARM(debug, "i");
MODULE_PARM(loopback, "i");
MODULE_PARM(timingcable, "i");
MODULE_PARM(t1e1override, "i");
+MODULE_PARM(alarmdebounce, "i");
MODULE_DEVICE_TABLE(pci, t4_pci_tbl);