From 3933ffd3505374ce8850fee067ad3949dc552d49 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Fri, 20 Dec 2013 13:54:19 -0600 Subject: [PATCH] wctdm24xxp: Reset module specific type information on probe. This fixes an issue that affects TDM410 modules when there is not a module installed in the first port, but there is an FXO module installed in the third port. When scaning for QRV modules in the first port, the 3rd port will have the 'hook' struct.qrv set to 0xff. When a QRV module is not detected, that value will be left, which then maps to an invalid state for both fxo.ring_state and fxo.battery_state. The result would be that FXO ports would fail to run the ring detector state machine since it did not know what the current state was. Now we'll just reset all the values in struct fxo or struct fxs to the expected init state. Internal-Issue-ID: DAHLIN-332 Signed-off-by: Shaun Ruffell --- drivers/dahdi/wctdm24xxp/base.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c index 5e35fde..abf6073 100644 --- a/drivers/dahdi/wctdm24xxp/base.c +++ b/drivers/dahdi/wctdm24xxp/base.c @@ -3100,6 +3100,8 @@ wctdm_init_voicedaa(struct wctdm *wc, struct wctdm_module *mod, spin_unlock_irqrestore(&wc->reglock, flags); msleep(20); + memset(&mod->mod.fxo, 0, sizeof(mod->mod.fxo)); + if (!sane && wctdm_voicedaa_insane(wc, mod)) return -2; @@ -3244,8 +3246,7 @@ wctdm_init_proslic(struct wctdm *wc, struct wctdm_module *const mod, return -2; /* Initialize VMWI settings */ - memset(&(fxs->vmwisetting), 0, sizeof(fxs->vmwisetting)); - fxs->vmwi_linereverse = 0; + memset(fxs, 0, sizeof(*fxs)); /* By default, don't send on hook */ if (!reversepolarity != !fxs->reversepolarity)