summaryrefslogtreecommitdiff
path: root/drivers/dahdi/dahdi-base.c
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2011-07-12 18:08:14 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2011-07-12 18:08:14 +0000
commit49c51b6c73ca059ed9e0b83a5ae420a99606536a (patch)
tree77e26ff37a38b6466552339d447005a4431afa41 /drivers/dahdi/dahdi-base.c
parentd1d970ae2be45ef76c6c30a7da9ca9b2347d2ad6 (diff)
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@digium.com> Signed-off-By: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Acked-By: Oron Peled <oron.peled@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10036 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/dahdi-base.c')
-rw-r--r--drivers/dahdi/dahdi-base.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index dd9cd78..01931ad 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -146,6 +146,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 @@ static int dahdi_ioctl_attach_echocan(unsigned long data)
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(deftaps, int, 0644);
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,