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
This commit is contained in:
Shaun Ruffell
2011-07-21 16:26:31 +00:00
parent 071cfdc983
commit 00764f705c

View File

@@ -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;
}