[svn-commits] tzafrir: linux/trunk r8943 - /linux/trunk/drivers/dahdi/xpp/card_fxs.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jul 19 08:28:08 CDT 2010


Author: tzafrir
Date: Mon Jul 19 08:28:02 2010
New Revision: 8943

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8943
Log:
FXS - fix VMWI compatibility mode:

* If we have vmwi_ioctl=N, we should initialize the vmwi_type
  of all channels. We initialize it to HVAC
* Fix a regression, where curly braces around empty if()'s were removed.
* Also fix the VMWI_TYPE() macro, so it actually uses the 3'rd parameter.
  (this didn't cause damage yet, as we only used HVAC so far)

Modified:
    linux/trunk/drivers/dahdi/xpp/card_fxs.c

Modified: linux/trunk/drivers/dahdi/xpp/card_fxs.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/card_fxs.c?view=diff&rev=8943&r1=8942&r2=8943
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/card_fxs.c (original)
+++ linux/trunk/drivers/dahdi/xpp/card_fxs.c Mon Jul 19 08:28:02 2010
@@ -50,7 +50,7 @@
 #endif
 
 #define	VMWI_TYPE(priv, pos, type)	\
-	((priv)->vmwisetting[pos].vmwi_type & DAHDI_VMWI_HVAC)
+	((priv)->vmwisetting[pos].vmwi_type & DAHDI_VMWI_ ## type)
 #define	VMWI_NEON(priv, pos)		VMWI_TYPE(priv, pos, HVAC)
 
 #define	LINES_DIGI_OUT	2
@@ -515,6 +515,10 @@
 		cur_chan->chanpos = i + 1;
 		cur_chan->pvt = xpd;
 		cur_chan->sigcap = FXS_DEFAULT_SIGCAP;
+		if (!vmwi_ioctl) {
+			/* Old asterisk, assume default VMWI type */
+			priv->vmwisetting[i].vmwi_type = DAHDI_VMWI_HVAC;
+		}
 	}
 	for_each_line(xpd, i) {
 		MARK_ON(priv, i, LED_GREEN);
@@ -797,10 +801,12 @@
 			"%s: VMWI(hvdc) is not implemented yet. Ignored.\n",
 			__func__);
 	}
-	if (VMWI_TYPE(priv, pos, HVAC))
-		/* VMWI_NEON */
-	if (priv->vmwisetting[pos].vmwi_type == 0)
-		/* Disable VMWI */
+	if (VMWI_TYPE(priv, pos, HVAC)) {
+		;	/* VMWI_NEON */
+	}
+	if (priv->vmwisetting[pos].vmwi_type == 0) {
+		;	/* Disable VMWI */
+	}
 	priv->vmwisetting[pos] = vmwisetting;
 	set_vm_led_mode(xpd->xbus, xpd, pos, xpd->msg_waiting[pos]);
 	return 0;




More information about the svn-commits mailing list