From e84427e0f42ed762c82cf5b68a25ec8b84639377 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Mon, 1 Oct 2012 13:53:06 -0500 Subject: [PATCH] wct4xxp: EC channel calculation in TONEDETECT assumes TE820. Since r10290 "wct4xxp: Add support for TE820 and VPMOCT256." [1], the TONEDETECT ioctl was not calculating the VPM channel correctly on non TE820 cards. This fixes a regression first introduced in 2.6.0. [1] http://svnview.digium.com/svn/dahdi?view=revision&revision=10290 Signed-off-by: Shaun Ruffell --- drivers/dahdi/wct4xxp/base.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/dahdi/wct4xxp/base.c b/drivers/dahdi/wct4xxp/base.c index 7891c61..be172d2 100644 --- a/drivers/dahdi/wct4xxp/base.c +++ b/drivers/dahdi/wct4xxp/base.c @@ -1236,9 +1236,11 @@ static int t4_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long dat else clear_bit(chan->chanpos - 1, &ts->dtmfmutemask); - channel = (chan->chanpos) << 3; - if (!has_e1_span(wc)) - channel += (4 << 3); + channel = has_e1_span(wc) ? chan->chanpos : chan->chanpos + 4; + if (is_octal(wc)) + channel = channel << 3; + else + channel = channel << 2; channel |= chan->span->offset; vpm450m_setdtmf(wc->vpm, channel, j & DAHDI_TONEDETECT_ON, j & DAHDI_TONEDETECT_MUTE); -- 1.7.9.5