[Asterisk-cvs] zaptel wcfxs.c,1.21,1.22
markster at lists.digium.com
markster at lists.digium.com
Fri Oct 3 10:37:39 CDT 2003
Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/tmp/cvs-serv17879
Modified Files:
wcfxs.c
Log Message:
Make power alarm handling less aggressive / more effective
Index: wcfxs.c
===================================================================
RCS file: /usr/cvsroot/zaptel/wcfxs.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- wcfxs.c 25 Sep 2003 02:01:46 -0000 1.21
+++ wcfxs.c 3 Oct 2003 15:38:50 -0000 1.22
@@ -246,6 +246,7 @@
}
static inline void wcfxs_check_hook(struct wcfxs *wc, int card);
+static inline void wcfxs_recheck_sanity(struct wcfxs *wc, int card);
static void wcfxs_stop_dma(struct wcfxs *wc);
static void wcfxs_reset_tdm(struct wcfxs *wc);
@@ -281,6 +282,8 @@
x = wc->intcount % 4;
if ((x < wc->cards) && (wc->cardflag & (1 << x))) {
wcfxs_check_hook(wc, x);
+ if (!(wc->intcount & 0xfc))
+ wcfxs_recheck_sanity(wc, x);
}
if (!(wc->intcount % 10000)) {
/* Accept an alarm once per 10 seconds */
@@ -899,14 +902,9 @@
return 0;
}
-static inline void wcfxs_check_hook(struct wcfxs *wc, int card)
+static inline void wcfxs_recheck_sanity(struct wcfxs *wc, int card)
{
- char res;
- int hook;
-
- /* For some reason we have to debounce the
- hook detector. */
-
+ int res;
/* Check loopback */
res = wcfxs_getreg(wc, card, 8);
if (res) {
@@ -926,6 +924,16 @@
}
}
}
+}
+
+static inline void wcfxs_check_hook(struct wcfxs *wc, int card)
+{
+ char res;
+ int hook;
+
+ /* For some reason we have to debounce the
+ hook detector. */
+
res = wcfxs_getreg(wc, card, 68);
hook = (res & 1);
if (hook != wc->lastrxhook[card]) {
More information about the svn-commits
mailing list