summaryrefslogtreecommitdiff
path: root/drivers/dahdi/wctdm24xxp/base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dahdi/wctdm24xxp/base.c')
-rw-r--r--drivers/dahdi/wctdm24xxp/base.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c
index 637cda2..86a577f 100644
--- a/drivers/dahdi/wctdm24xxp/base.c
+++ b/drivers/dahdi/wctdm24xxp/base.c
@@ -2246,15 +2246,14 @@ static void wctdm_isr_misc_fxs(struct wctdm *wc, struct wctdm_module *const mod)
if (SLIC_LF_RINGING == fxs->lasttxhook) {
/* RINGing, prepare for OHT */
- fxs->ohttimer = OHT_TIMER << 3;
+ fxs->ohttimer = wc->framecount + OHT_TIMER;
/* OHT mode when idle */
fxs->idletxhookstate = POLARITY_XOR(fxs) ? SLIC_LF_OHTRAN_REV :
SLIC_LF_OHTRAN_FWD;
- } else if (fxs->ohttimer) {
+ } else if (fxs->oht_active) {
/* check if still OnHook */
if (!fxs->oldrxhook) {
- fxs->ohttimer -= DAHDI_CHUNKSIZE;
- if (fxs->ohttimer)
+ if (time_before(wc->framecount, fxs->ohttimer))
return;
/* Switch to active */
@@ -2284,7 +2283,7 @@ static void wctdm_isr_misc_fxs(struct wctdm *wc, struct wctdm_module *const mod)
}
spin_unlock_irqrestore(&fxs->lasttxhooklock, flags);
} else {
- fxs->ohttimer = 0;
+ fxs->oht_active = 0;
/* Switch to active */
fxs->idletxhookstate = POLARITY_XOR(fxs) ? SLIC_LF_ACTIVE_REV : SLIC_LF_ACTIVE_FWD;
if (debug & DEBUG_CARD) {
@@ -3490,7 +3489,6 @@ static int wctdm_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
return -EINVAL;
if (get_user(x, (__user int *) data))
return -EFAULT;
- fxs->ohttimer = x << 3;
/* Active mode when idle */
fxs->idletxhookstate = POLARITY_XOR(fxs) ?
@@ -3519,6 +3517,10 @@ static int wctdm_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long
}
}
+
+ fxs->ohttimer = wc->framecount + x;
+ fxs->oht_active = 1;
+
break;
case DAHDI_VMWI_CONFIG:
if (mod->type != FXS)