[dahdi-commits] mspiceland: linux/trunk r5916 - /linux/trunk/drivers/dahdi/wctdm24xxp/base.c

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Fri Jan 30 10:53:31 CST 2009


Author: mspiceland
Date: Fri Jan 30 10:53:30 2009
New Revision: 5916

URL: http://svn.digium.com/svn-view/dahdi?view=rev&rev=5916
Log:
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.

Modified:
    linux/trunk/drivers/dahdi/wctdm24xxp/base.c

Modified: linux/trunk/drivers/dahdi/wctdm24xxp/base.c
URL: http://svn.digium.com/svn-view/dahdi/linux/trunk/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=5916&r1=5915&r2=5916
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wctdm24xxp/base.c Fri Jan 30 10:53:30 2009
@@ -1622,7 +1622,7 @@
 
 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 @@
 		/* 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;




More information about the dahdi-commits mailing list