[svn-commits] kmoore: linux/trunk r9520 - /linux/trunk/drivers/dahdi/dahdi-base.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Dec 9 14:19:15 CST 2010


Author: kmoore
Date: Thu Dec  9 14:19:13 2010
New Revision: 9520

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9520
Log:
dahdi-base: Allow HWEC to use the modular echocan interface

This change adds an echocan factory to dahdi-base that will allow hardware
echo cancellation to use the same interface as the current software echo
cancellers.  The additions in this commit will not have any effect until the
current HWEC mechanism is removed.

Signed-off-by: Kinsey Moore <kmoore at digium.com>
Acked-by: Shaun Ruffell <sruffell at digium.com>

Modified:
    linux/trunk/drivers/dahdi/dahdi-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=9520&r1=9519&r2=9520
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Thu Dec  9 14:19:13 2010
@@ -8920,6 +8920,22 @@
 	return 0;
 }
 
+static int hwec_echocan_create(struct dahdi_chan *chan,
+	struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p,
+	struct dahdi_echocan_state **ec)
+{
+	if (chan->span && chan->span->ops->echocan_create)
+		return chan->span->ops->echocan_create(chan, ecp, p, ec);
+	else
+		return -ENODEV;
+}
+
+static const struct dahdi_echocan_factory hwec_factory = {
+	.name = "HWEC",
+	.owner = THIS_MODULE,
+	.echocan_create = hwec_echocan_create,
+};
+
 static int __init dahdi_init(void)
 {
 	int res = 0;
@@ -8948,6 +8964,12 @@
 	watchdog_init();
 #endif
 	coretimer_init();
+
+	if (dahdi_register_echocan_factory(&hwec_factory)) {
+		WARN_ON(1);
+		return -EFAULT;
+	}
+
 	return res;
 }
 
@@ -8955,6 +8977,7 @@
 {
 	int x;
 
+	dahdi_unregister_echocan_factory(&hwec_factory);
 	coretimer_cleanup();
 
 	CLASS_DEV_DESTROY(dahdi_class, MKDEV(DAHDI_MAJOR, 253)); /* timer */




More information about the svn-commits mailing list