summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-07-21 16:26:31 +0000
committerShaun Ruffell <sruffell@digium.com>2011-07-21 16:26:31 +0000
commit33aa2f24162af859619b545aa6af8e908cf4cb49 (patch)
tree61c653e38e96773a577bfd9b9d7b77fd70c53868
parent154b031a2c6479ab15d9d506811ba7f18f1ba845 (diff)
dahdi: Drivers that do not support hwec should not report hwec is available.
When attaching software echocans to a channel, if there is a hardware echocan available always give preference to them. Revision 9995 "dahdi: Always attach hwec to a channel if available" had an error where if a driver did not even support an option of hardware echocan, dahdi-base would take that to mean there always was a hardware echocan available on the channel. DAHLIN-246 Reported-by: Michael L. Young Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10070 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/dahdi-base.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index 1ea92f6..f8c0ae1 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -4842,8 +4842,10 @@ static int dahdi_ioctl_shutdown(unsigned long data)
*/
static bool dahdi_is_hwec_available(const struct dahdi_chan *chan)
{
- if (!hwec_factory.get_name(chan))
+ if (!chan->span || !chan->span->ops->echocan_name ||
+ !hwec_factory.get_name(chan))
return false;
+
return true;
}