diff options
author | Shaun Ruffell <sruffell@digium.com> | 2011-03-19 16:58:54 -0500 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2011-04-15 14:19:02 -0500 |
commit | 14a54798c26ce41f9e6d636e97aa98daecb9ba87 (patch) | |
tree | 70a2efd69758653da16b30aea923aca4847b66fe /drivers | |
parent | 86901a4f35bf94ac804eaa86fbbadb8fab9fc807 (diff) |
wctdm24xxp: Use time interval for checking fxs modules.
Part of preparations for not needing to call the misc_isr function for each
frame.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dahdi/wctdm24xxp/base.c | 8 | ||||
-rw-r--r-- | drivers/dahdi/wctdm24xxp/wctdm24xxp.h | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c index 2fe0bdd..afdbc89 100644 --- a/drivers/dahdi/wctdm24xxp/base.c +++ b/drivers/dahdi/wctdm24xxp/base.c @@ -2213,8 +2213,9 @@ static void wctdm_isr_misc_fxs(struct wctdm *wc, struct wctdm_module *const mod) struct fxs *const fxs = &mod->mod.fxs; unsigned long flags; - if (!(wc->framecount % 10000)) { + if (time_after(wc->framecount, fxs->check_alarm)) { /* Accept an alarm once per 10 seconds */ + fxs->check_alarm = wc->framecount + (1000*10); if (fxs->palarms) fxs->palarms--; } @@ -2222,8 +2223,11 @@ static void wctdm_isr_misc_fxs(struct wctdm *wc, struct wctdm_module *const mod) wctdm_proslic_check_oppending(wc, mod); - if (!(wc->framecount & 0xfc)) /* every 256ms */ + if (time_after(wc->framecount, fxs->check_proslic)) { + fxs->check_proslic = wc->framecount + 250; /* every 250ms */ wctdm_proslic_recheck_sanity(wc, mod); + } + if (SLIC_LF_RINGING == fxs->lasttxhook) { /* RINGing, prepare for OHT */ fxs->ohttimer = OHT_TIMER << 3; diff --git a/drivers/dahdi/wctdm24xxp/wctdm24xxp.h b/drivers/dahdi/wctdm24xxp/wctdm24xxp.h index 535cf8e..8dafb10 100644 --- a/drivers/dahdi/wctdm24xxp/wctdm24xxp.h +++ b/drivers/dahdi/wctdm24xxp/wctdm24xxp.h @@ -186,6 +186,8 @@ struct fxs { int vmwi_linereverse; int reversepolarity; /* polarity reversal */ struct calregs calregs; + unsigned long check_alarm; + unsigned long check_proslic; }; struct qrv { |