From 14a54798c26ce41f9e6d636e97aa98daecb9ba87 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Sat, 19 Mar 2011 16:58:54 -0500 Subject: 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 --- drivers/dahdi/wctdm24xxp/base.c | 8 ++++++-- 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 { -- cgit v1.2.3