From 3c2688ae3fff795fefa68b31534b1207c3c7716f Mon Sep 17 00:00:00 2001 From: Mike Spiceland Date: Fri, 30 Jan 2009 16:53:30 +0000 Subject: Do a stricter test for FXS modules. FXO modules will be hi-z during this time and the value will be undefined. This test ensures that FXO modules will not falsely trigger during FXS probes. The value of 0x88 from register 1 has been confirmed during this stage on quad and single port modules. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5916 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/wctdm24xxp/base.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'drivers/dahdi/wctdm24xxp') diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c index 6c7fd27..da48cfe 100644 --- a/drivers/dahdi/wctdm24xxp/base.c +++ b/drivers/dahdi/wctdm24xxp/base.c @@ -1622,7 +1622,7 @@ static int wctdm_voicedaa_insane(struct wctdm *wc, int card) static int wctdm_proslic_insane(struct wctdm *wc, int card) { - int blah,insane_report; + int blah, reg1, insane_report; insane_report=0; blah = wctdm_getreg(wc, card, 0); @@ -1639,6 +1639,15 @@ static int wctdm_proslic_insane(struct wctdm *wc, int card) /* SLIC not loaded */ return -1; } + + /* let's be really sure this is an FXS before we continue */ + reg1 = wctdm_getreg(wc, card, 1); + if ((0x80 != (blah & 0xf0)) || (0x88 != reg1)) { + if (debug & DEBUG_CARD) + printk("DEBUG: not FXS b/c reg0=%x or reg1 != 0x88 (%x).\n", blah, reg1); + return -1; + } + if ((blah & 0xf) < 2) { printk(KERN_INFO "ProSLIC 3210 version %d is too old\n", blah & 0xf); return -1; -- cgit v1.2.3