From ff98a0f2fa1318fb1fec620ce85a9c79c1e99b29 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 --- 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 01931ad..6b7bb34 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -4840,8 +4840,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_create || + !hwec_factory.get_name(chan)) return false; + return true; } -- 1.7.6