[zaptel-commits] mspiceland: branch 1.2 r3405 - /branches/1.2/wcte12xp/

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Mon Dec 10 18:07:20 CST 2007


Author: mspiceland
Date: Mon Dec 10 18:07:19 2007
New Revision: 3405

URL: http://svn.digium.com/view/zaptel?view=rev&rev=3405
Log:
If we detect that we have a VPMADT032 module but there is an error during
initialization, we don't proceed and register with Zaptel.  This will prevent
customers with faulty VPMADT032 modules from going undetected.  Customers
can always load with vpmsupport=0 to proceed with this error but will do so
knowingly.

Modified:
    branches/1.2/wcte12xp/base.c
    branches/1.2/wcte12xp/vpmadt032.c
    branches/1.2/wcte12xp/vpmadt032.h

Modified: branches/1.2/wcte12xp/base.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/wcte12xp/base.c?view=diff&rev=3405&r1=3404&r2=3405
==============================================================================
--- branches/1.2/wcte12xp/base.c (original)
+++ branches/1.2/wcte12xp/base.c Mon Dec 10 18:07:19 2007
@@ -1425,7 +1425,10 @@
 	t1_setleds(wc, wc->ledtestreg, 0);
 
 #ifdef VPM_SUPPORT
-	t1_vpm150m_init(wc);
+	if (t1_vpm150m_init(wc) < 0) {
+		module_printk("VPMADT032 module detected but there was an error during initialization.  If you still wish to use this card, please disable echo cancellation using vpmsupport=0 as a module parameter or replace the echo cancellation module.\n");
+		return -1;
+	}
 	if (wc->vpm150m) {
 		module_printk("VPM present and operational (Firmware version %x)\n", wc->vpm150m->version);
 		wc->ctlreg |= 0x10; /* turn on vpm (RX audio from vpm module) */
@@ -1955,7 +1958,10 @@
 	
 	t1_enable_interrupts(wc);
 	t1_start_dma(wc);
-	t1_hardware_post_init(wc);
+	if (t1_hardware_post_init(wc) < 0) {
+		module_printk("Hardware init failed.  Refusing to register broken hardware interface.\n");
+		return 0;
+	}
 	t1_software_init(wc);
 	module_printk("Found a %s\n", wc->variety);
 

Modified: branches/1.2/wcte12xp/vpmadt032.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/wcte12xp/vpmadt032.c?view=diff&rev=3405&r1=3404&r2=3405
==============================================================================
--- branches/1.2/wcte12xp/vpmadt032.c (original)
+++ branches/1.2/wcte12xp/vpmadt032.c Mon Dec 10 18:07:19 2007
@@ -641,7 +641,7 @@
 	return;
 }
 
-void t1_vpm150m_init(struct t1 *wc) {	
+int t1_vpm150m_init(struct t1 *wc) {	
 	struct vpm150m *vpm150m;
 	unsigned short i;
 	unsigned short reg;
@@ -666,14 +666,14 @@
 	if (!vpmsupport) {
 		module_printk("VPM Support Disabled\n");
 		wc->vpm150m = NULL;
-		return;
+		return 0; /* not fatal for the card */
 	}
 
 	vpm150m = kmalloc(sizeof(struct vpm150m), GFP_KERNEL);
 
 	if (!vpm150m) {
 		module_printk("Unable to allocate VPMADT032!\n");
-		return;
+		return -1;
 	}
 	memset(vpm150m, 0, sizeof(struct vpm150m));
 	
@@ -873,7 +873,7 @@
 		if ((request_firmware(&firmware, vpmadt032_firmware, &wc->dev->dev) != 0) ||
 		    !firmware) {
 			printk("VPMADT032: firmware %s not available from userspace\n", vpmadt032_firmware);
-			return;
+			return -1;
 		}
 #else
 		embedded_firmware.data = _binary_vpmadt032_bin_start;
@@ -942,7 +942,7 @@
 		goto failed_exit;
 	}
 
-	return;
+	return 0;
 
 failed_exit:
 	spin_lock_irqsave(&wc->reglock, flags);
@@ -950,7 +950,7 @@
 	spin_unlock_irqrestore(&wc->reglock, flags);
 	kfree(vpm150m);
 
-	return;
+	return -1;
 }
 
 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Modified: branches/1.2/wcte12xp/vpmadt032.h
URL: http://svn.digium.com/view/zaptel/branches/1.2/wcte12xp/vpmadt032.h?view=diff&rev=3405&r1=3404&r2=3405
==============================================================================
--- branches/1.2/wcte12xp/vpmadt032.h (original)
+++ branches/1.2/wcte12xp/vpmadt032.h Mon Dec 10 18:07:19 2007
@@ -112,7 +112,7 @@
 extern int vpmdtmfsupport;
 extern struct pci_driver te12xp_driver;
 
-void t1_vpm150m_init(struct t1 *wc);
+int t1_vpm150m_init(struct t1 *wc);
 void vpm150m_cmd_dequeue(struct t1 *wc, volatile unsigned char *writechunk, int whichframe);
 void vpm150m_cmd_decipher(struct t1 *wc, volatile unsigned char *readchunk);
 int vpm150m_config_hw(struct t1 *wc);




More information about the zaptel-commits mailing list