mISDN: Fix DTMF detection enable/disable
authorAndreas Eversberg <andreas@eversberg.eu>
Fri, 22 May 2009 11:04:58 +0000 (11:04 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 May 2009 07:55:47 +0000 (00:55 -0700)
DTMF detection was enabled when it was not supposed to.

Signed-off-by: Andreas Eversberg <andreas@eversberg.eu>
Signed-off-by: Karsten Keil <keil@b1-systems.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/isdn/mISDN/dsp.h
drivers/isdn/mISDN/dsp_core.c
drivers/isdn/mISDN/dsp_dtmf.c

index 564ea3efd5e3190116b0ab6b4a58c9238fbf1391..18af86879c054456eff40f6c35f70836cabbfa40 100644 (file)
@@ -116,6 +116,7 @@ struct dsp_conf {
 #define ECHOCAN_BUFF_MASK 0x3ff /* -1 */
 
 struct dsp_dtmf {
+       int             enable; /* dtmf is enabled */
        int             treshold; /* above this is dtmf (square of) */
        int             software; /* dtmf uses software decoding */
        int             hardware; /* dtmf uses hardware decoding */
index c35750647c6601e1709a076aadfd845752049b75..c12cd2f942549623426b55456afe047acbf95bfe 100644 (file)
@@ -306,6 +306,7 @@ dsp_control_req(struct dsp *dsp, struct mISDNhead *hh, struct sk_buff *skb)
                                        "to %d\n", *((int *)data));
                        dsp->dtmf.treshold = (*(int *)data) * 10000;
                }
+               dsp->dtmf.enable = 1;
                /* init goertzel */
                dsp_dtmf_goertzel_init(dsp);
 
@@ -316,6 +317,7 @@ dsp_control_req(struct dsp *dsp, struct mISDNhead *hh, struct sk_buff *skb)
        case DTMF_TONE_STOP: /* turn off DTMF */
                if (dsp_debug & DEBUG_DSP_CORE)
                        printk(KERN_DEBUG "%s: stop dtmf\n", __func__);
+               dsp->dtmf.enable = 0;
                dsp->dtmf.hardware = 0;
                dsp->dtmf.software = 0;
                break;
index efc371c1f0dc02a6f86d4f146fe348051aa111ab..9ae2d33b06f7c5a819157d20bfce9ad5d81bca19 100644 (file)
@@ -51,6 +51,9 @@ void dsp_dtmf_hardware(struct dsp *dsp)
 {
        int hardware = 1;
 
+       if (!dsp->dtmf.enable)
+               return;
+
        if (!dsp->features.hfc_dtmf)
                hardware = 0;