[svn-commits] tzafrir: linux/trunk r10036 - /linux/trunk/drivers/dahdi/dahdi-base.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Tue Jul 12 13:08:17 CDT 2011
Author: tzafrir
Date: Tue Jul 12 13:08:14 2011
New Revision: 10036
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10036
Log:
dahdi: Add dynamic dahdi parameter hwec_overrides_swec.
If set to true (default) a HWEC, if available on the channel, takes
priority over any software echocan configured in /etc/dahdi/system.conf.
This has historically been the default behavior in all released versions
of DAHDI that support module echocans.
Otherwise, hwec_overrides_swec is set to false, HWEC is chosen only via
the "echocanceller=hwec" directive.
Signed-off-by: Shaun Ruffell <sruffell at digium.com>
Signed-off-By: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Acked-By: Oron Peled <oron.peled at xorcom.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=10036&r1=10035&r2=10036
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Tue Jul 12 13:08:14 2011
@@ -145,6 +145,8 @@
int debug;
#define DEBUG_MAIN (1 << 0)
#define DEBUG_RBS (1 << 5)
+
+static int hwec_overrides_swec = 1;
/*!
* \brief states for transmit signalling
@@ -4857,13 +4859,23 @@
if (!chan)
return -EINVAL;
+ ae.echocan[sizeof(ae.echocan) - 1] = '\0';
if (dahdi_is_hwec_available(chan)) {
- /* If there is a hardware echocan available we'll always use
- * it instead of any configured software echocan. This matches
- * the behavior in dahdi 2.4.1.2 and earlier releases. */
- strlcpy(ae.echocan, hwec_def_name, sizeof(ae.echocan));
- } else {
- ae.echocan[sizeof(ae.echocan) - 1] = 0;
+ if (hwec_overrides_swec) {
+ chan_dbg(GENERAL, chan,
+ "Using echocan '%s' instead of requested " \
+ "'%s'.\n", hwec_def_name, ae.echocan);
+ /* If there is a hardware echocan available we'll
+ * always use it instead of any configured software
+ * echocan. This matches the behavior in dahdi 2.4.1.2
+ * and earlier releases. */
+ strlcpy(ae.echocan, hwec_def_name, sizeof(ae.echocan));
+
+ } else if (strcasecmp(ae.echocan, hwec_def_name) != 0) {
+ chan_dbg(GENERAL, chan,
+ "Using '%s' on channel even though '%s' is " \
+ "available.\n", ae.echocan, hwec_def_name);
+ }
}
if (ae.echocan[0]) {
@@ -9348,6 +9360,9 @@
module_param(max_pseudo_channels, int, 0644);
MODULE_PARM_DESC(max_pseudo_channels, "Maximum number of pseudo channels.");
+module_param(hwec_overrides_swec, int, 0644);
+MODULE_PARM_DESC(hwec_overrides_swec, "When true, a hardware echo canceller is used instead of configured SWEC.");
+
static const struct file_operations dahdi_fops = {
.owner = THIS_MODULE,
.open = dahdi_open,
More information about the svn-commits
mailing list