[svn-commits] sruffell: linux/trunk r9943 - in /linux/trunk/drivers/dahdi: ./ wct4xxp/ wctd...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jun 2 15:01:53 CDT 2011


Author: sruffell
Date: Thu Jun  2 15:01:49 2011
New Revision: 9943

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9943
Log:
dahdi: Do not allow 'hwec' to be attached to channels that do not have one.

This defines a NULL value for the name of an echocan as invalid. This
will allow dahdi_genconf to probe for the presence of a hardware echocan
on a channel by trying to attach one. If there is not a hardware echocan
available DAHDI_ATTACH_ECHOCAN ioctl will return -EINVAL if 'hwec' was
specified as the name of the echo canceler now.

Signed-off-by: Shaun Ruffell <sruffell at digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>

Modified:
    linux/trunk/drivers/dahdi/dahdi-base.c
    linux/trunk/drivers/dahdi/wct4xxp/base.c
    linux/trunk/drivers/dahdi/wctdm24xxp/base.c
    linux/trunk/drivers/dahdi/wcte12xp/base.c

Modified: linux/trunk/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi-base.c?view=diff&rev=9943&r1=9942&r2=9943
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Thu Jun  2 15:01:49 2011
@@ -4904,6 +4904,11 @@
 		new = find_echocan(ae.echocan);
 		if (!new)
 			return -EINVAL;
+
+		if (!new->get_name(chan)) {
+			release_echocan(new);
+			return -EINVAL;
+		}
 	}
 
 	spin_lock_irqsave(&chan->lock, flags);

Modified: linux/trunk/drivers/dahdi/wct4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wct4xxp/base.c?view=diff&rev=9943&r1=9942&r2=9943
==============================================================================
--- linux/trunk/drivers/dahdi/wct4xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wct4xxp/base.c Thu Jun  2 15:01:49 2011
@@ -246,7 +246,6 @@
 static const char *vpm400_name = "VPM400M";
 static const char *vpmoct064_name = "VPMOCT064";
 static const char *vpmoct128_name = "VPMOCT128";
-static const char *noec_name = "NONE";
 
 #define PORTS_PER_FRAMER 4
 
@@ -1296,7 +1295,7 @@
 			else if (wc->numspans == 4)
 				return vpmoct128_name;
 	}
-	return noec_name;
+	return NULL;
 }
 
 static int t4_echocan_create(struct dahdi_chan *chan,

Modified: linux/trunk/drivers/dahdi/wctdm24xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=9943&r1=9942&r2=9943
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wctdm24xxp/base.c Thu Jun  2 15:01:49 2011
@@ -162,7 +162,6 @@
 
 /* names of HWEC modules */
 static const char *vpmadt032_name = "VPMADT032";
-static const char *noec_name = "NONE";
 
 /* Undefine to enable Power alarm / Transistor debug -- note: do not
    enable for normal operation! */
@@ -1872,7 +1871,7 @@
 	struct wctdm *wc = chan->pvt;
 	if (wc->vpmadt032)
 		return vpmadt032_name;
-	return noec_name;
+	return NULL;
 }
 
 static int wctdm_echocan_create(struct dahdi_chan *chan,

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=9943&r1=9942&r2=9943
==============================================================================
--- linux/trunk/drivers/dahdi/wcte12xp/base.c (original)
+++ linux/trunk/drivers/dahdi/wcte12xp/base.c Thu Jun  2 15:01:49 2011
@@ -96,7 +96,6 @@
 
 /* names of HWEC modules */
 static const char *vpmadt032_name = "VPMADT032";
-static const char *noec_name = "NONE";
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
 static kmem_cache_t *cmd_cache;
@@ -1291,7 +1290,7 @@
 	struct t1 *wc = chan->pvt;
 	if (wc->vpmadt032)
 		return vpmadt032_name;
-	return noec_name;
+	return NULL;
 }
 
 static int t1xxp_echocan_create(struct dahdi_chan *chan,




More information about the svn-commits mailing list