[dahdi-commits] sruffell: linux/trunk r8473 - in /linux/trunk/drivers/dahdi: voicebus/ wcte12xp/

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Mon Apr 5 14:16:00 CDT 2010


Author: sruffell
Date: Mon Apr  5 14:15:59 2010
New Revision: 8473

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8473
Log:
wcte12xp: Try to reconfigure the VPM if we fail to configure the channels.

Also, fall back to any software echocan configured for this channel for new
calls while we're in the middle of a recovery.

Modified:
    linux/trunk/drivers/dahdi/voicebus/GpakCust.c
    linux/trunk/drivers/dahdi/wcte12xp/base.c

Modified: linux/trunk/drivers/dahdi/voicebus/GpakCust.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/voicebus/GpakCust.c?view=diff&rev=8473&r1=8472&r2=8473
==============================================================================
--- linux/trunk/drivers/dahdi/voicebus/GpakCust.c (original)
+++ linux/trunk/drivers/dahdi/voicebus/GpakCust.c Mon Apr  5 14:15:59 2010
@@ -222,7 +222,7 @@
 
 static struct change_order *alloc_change_order(void)
 {
-	return kzalloc(sizeof(struct change_order), GFP_KERNEL);
+	return kzalloc(sizeof(struct change_order), GFP_ATOMIC);
 }
 
 static void free_change_order(struct change_order *order)
@@ -617,6 +617,11 @@
 
 	might_sleep();
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
+	INIT_WORK(&vpm->work, vpmadt032_bh, vpm);
+#else
+	INIT_WORK(&vpm->work, vpmadt032_bh);
+#endif
 	if (vpm->options.debug & DEBUG_VPMADT032_ECHOCAN)
 		dev_info(&vpm->vb->pdev->dev, "VPMADT032 Testing page access: ");
 
@@ -688,12 +693,6 @@
 		res = -EIO;
 		goto failed_exit;
 	}
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
-	INIT_WORK(&vpm->work, vpmadt032_bh, vpm);
-#else
-	INIT_WORK(&vpm->work, vpmadt032_bh);
-#endif
 
 	return 0;
 

Modified: linux/trunk/drivers/dahdi/wcte12xp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wcte12xp/base.c?view=diff&rev=8473&r1=8472&r2=8473
==============================================================================
--- linux/trunk/drivers/dahdi/wcte12xp/base.c (original)
+++ linux/trunk/drivers/dahdi/wcte12xp/base.c Mon Apr  5 14:15:59 2010
@@ -1301,9 +1301,8 @@
 	struct t1 *wc = chan->pvt;
 	enum adt_companding comp;
 
-	if (!wc->vpmadt032) {
+	if (!wc->vpmadt032 || !test_bit(4, &wc->ctlreg))
 		return -ENODEV;
-	}
 
 	*ec = wc->ec[chan->chanpos - 1];
 	(*ec)->ops = &vpm150m_ec_ops;
@@ -1413,16 +1412,20 @@
 		} else if (res) {
 			wc->vpm_check = jiffies + HZ/2;
 		} else {
-			config_vpmadt032(vpm, wc);
-
 			set_span_devicetype(wc);
-			/* turn on vpm (RX audio from vpm module) */
-			wc->ctlreg |= 0x10;
-			wc->vpm_check = HZ*5;
-			if (vpmtsisupport) {
-				debug_printk(wc, 1, "enabling VPM TSI pin\n");
-				/* turn on vpm timeslot interchange pin */
-				wc->ctlreg |= 0x01;
+			if (config_vpmadt032(vpm, wc)) {
+				wc->vpm_check = jiffies + HZ/2;
+			} else {
+				/* turn on vpm (RX audio from vpm module) */
+				set_bit(4, &wc->ctlreg);
+				wc->vpm_check = jiffies + HZ*5;
+				if (vpmtsisupport) {
+					debug_printk(wc, 1,
+						     "enabling VPM TSI pin\n");
+					/* turn on vpm timeslot
+					 * interchange pin */
+					set_bit(0, &wc->ctlreg);
+				}
 			}
 		}
 	} else {
@@ -1937,31 +1940,27 @@
 #endif
 	int res;
 	u16 version;
-	unsigned long flags;
 
 	res = gpakPingDsp(wc->vpmadt032->dspid, &version);
 	if (!res) {
-		spin_lock_irqsave(&wc->reglock, flags);
-		wc->ctlreg |= 0x10;
-		spin_unlock_irqrestore(&wc->reglock, flags);
+		set_bit(4, &wc->ctlreg);
 		return;
 	}
 
-	/* Bypass the rx audio from the VPM module. */
-	spin_lock_irqsave(&wc->reglock, flags);
-	wc->ctlreg &= ~(0x10);
-	spin_unlock_irqrestore(&wc->reglock, flags);
+	clear_bit(4, &wc->ctlreg);
 
 	t1_info(wc, "VPMADT032 is non-responsive.  Resetting.\n");
 
 	res = vpmadt032_reset(wc->vpmadt032);
 	if (!res) {
-		config_vpmadt032(wc->vpmadt032, wc);
+		res = config_vpmadt032(wc->vpmadt032, wc);
+		if (res) {
+			queue_work(wc->vpmadt032->wq, &wc->vpm_check_work);
+			return;
+		}
 		/* Looks like the reset went ok so we can put the VPM module
 		 * back in the TDM path. */
-		spin_lock_irqsave(&wc->reglock, flags);
-		wc->ctlreg |= 0x10;
-		spin_unlock_irqrestore(&wc->reglock, flags);
+		set_bit(4, &wc->ctlreg);
 		t1_info(wc, "VPMADT032 is reenabled.\n");
 	} else {
 		t1_info(wc, "Failed VPMADT032 reset. "
@@ -1995,16 +1994,11 @@
 static void t1_handle_error(struct voicebus *vb)
 {
 	struct t1 *wc = container_of(vb, struct t1, vb);
-	unsigned long flags;
-
-	if (wc->vpmadt032) {
-		/* Bypass the rx audio from the VPM module. */
-		spin_lock_irqsave(&wc->reglock, flags);
-		wc->ctlreg &= ~(0x10);
-		spin_unlock_irqrestore(&wc->reglock, flags);
-
-		queue_work(wc->vpmadt032->wq, &wc->vpm_check_work);
-	}
+
+	if (!wc->vpmadt032)
+		return;
+	clear_bit(4, &wc->ctlreg);
+	queue_work(wc->vpmadt032->wq, &wc->vpm_check_work);
 }
 
 static const struct voicebus_operations voicebus_operations = {




More information about the dahdi-commits mailing list