diff options
author | russell <russell@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-09-11 17:50:34 +0000 |
---|---|---|
committer | russell <russell@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-09-11 17:50:34 +0000 |
commit | 1f0a059c7f501eed084f24ef4b51baa4068d6b1c (patch) | |
tree | 1e6263dffa856d9ec28d93e77ac6711c143130c2 | |
parent | 692d99b745fb55b033915bf0638c12aa5ac27d9d (diff) |
Make ringdebounce a module parameter
(closes issue #10218, pnlarsson
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@3011 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r-- | wctdm.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -251,12 +251,13 @@ static struct fxo_mode { #define FLAG_WRITE 1 #define FLAG_READ 2 +#define DEFAULT_RING_DEBOUNCE 64 /* Ringer Debounce (64 ms) */ + /* the constants below control the 'debounce' periods enforced by the check_hook routines; these routines are called once every 4 interrupts (the interrupt cycles around the four modules), so the periods are specified in _4 millisecond_ increments */ -#define RING_DEBOUNCE 4 /* Ringer Debounce (64 ms) */ #define DEFAULT_BATT_DEBOUNCE 4 /* Battery debounce (64 ms) */ #define POLARITY_DEBOUNCE 4 /* Polarity debounce (64 ms) */ #define DEFAULT_BATT_THRESH 3 /* Anything under this is "no battery" */ @@ -368,6 +369,7 @@ static void wctdm_release(struct wctdm *wc); static int battdebounce = DEFAULT_BATT_DEBOUNCE; static int battthresh = DEFAULT_BATT_THRESH; +static int ringdebounce = DEFAULT_RING_DEBOUNCE; static int debug = 0; static int robust = 0; static int timingonly = 0; @@ -862,14 +864,14 @@ static inline void wctdm_voicedaa_check_hook(struct wctdm *wc, int card) res = wc->reg0shadow[card]; if ((res & 0x60) && wc->mod[card].fxo.battery) { wc->mod[card].fxo.ringdebounce += (ZT_CHUNKSIZE * 16); - if (wc->mod[card].fxo.ringdebounce >= ZT_CHUNKSIZE * 64) { + if (wc->mod[card].fxo.ringdebounce >= ZT_CHUNKSIZE * ringdebounce) { if (!wc->mod[card].fxo.wasringing) { wc->mod[card].fxo.wasringing = 1; zt_hooksig(&wc->chans[card], ZT_RXSIG_RING); if (debug) printk("RING on %d/%d!\n", wc->span.spanno, card + 1); } - wc->mod[card].fxo.ringdebounce = ZT_CHUNKSIZE * 64; + wc->mod[card].fxo.ringdebounce = ZT_CHUNKSIZE * ringdebounce; } } else { wc->mod[card].fxo.ringdebounce -= ZT_CHUNKSIZE * 4; @@ -2479,6 +2481,7 @@ module_param(fastringer, int, 0600); module_param(fxshonormode, int, 0600); module_param(battdebounce, int, 0600); module_param(battthresh, int, 0600); +module_param(ringdebounce, int, 0600); module_param(alawoverride, int, 0600); module_param(fastpickup, int, 0600); module_param(fxotxgain, int, 0600); @@ -2499,6 +2502,7 @@ MODULE_PARM(fastringer, "i"); MODULE_PARM(fxshonormode, "i"); MODULE_PARM(battdebounce, "i"); MODULE_PARM(battthresh, "i"); +MODULE_PARM(ringdebounce, "i"); MODULE_PARM(alawoverride, "i"); MODULE_PARM(fastpickup, "i"); MODULE_PARM(fxotxgain, "i"); |