From c82da16c383f06f552d2bf04312e9294473d4b1d Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Wed, 20 Jul 2011 10:07:31 -0500 Subject: [PATCH] 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 Acked-by: Tzafrir Cohen --- drivers/dahdi/dahdi-base.c | 4 +++- 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; } -- 1.7.6