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
This commit is contained in:
Shaun Ruffell
2011-07-12 18:08:14 +00:00
committed by Tzafrir Cohen
parent f31c6ad717
commit 80e9aa8098

View File

@@ -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,