Commit b0579d74 authored by Andreas Eversberg's avatar Andreas Eversberg Committed by David S. Miller

mISDN: Fix DTMF detection enable/disable

DTMF detection was enabled when it was not supposed to.
Signed-off-by: default avatarAndreas Eversberg <andreas@eversberg.eu>
Signed-off-by: default avatarKarsten Keil <keil@b1-systems.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8c90e11e
...@@ -116,6 +116,7 @@ struct dsp_conf { ...@@ -116,6 +116,7 @@ struct dsp_conf {
#define ECHOCAN_BUFF_MASK 0x3ff /* -1 */ #define ECHOCAN_BUFF_MASK 0x3ff /* -1 */
struct dsp_dtmf { struct dsp_dtmf {
int enable; /* dtmf is enabled */
int treshold; /* above this is dtmf (square of) */ int treshold; /* above this is dtmf (square of) */
int software; /* dtmf uses software decoding */ int software; /* dtmf uses software decoding */
int hardware; /* dtmf uses hardware decoding */ int hardware; /* dtmf uses hardware decoding */
......
...@@ -306,6 +306,7 @@ dsp_control_req(struct dsp *dsp, struct mISDNhead *hh, struct sk_buff *skb) ...@@ -306,6 +306,7 @@ dsp_control_req(struct dsp *dsp, struct mISDNhead *hh, struct sk_buff *skb)
"to %d\n", *((int *)data)); "to %d\n", *((int *)data));
dsp->dtmf.treshold = (*(int *)data) * 10000; dsp->dtmf.treshold = (*(int *)data) * 10000;
} }
dsp->dtmf.enable = 1;
/* init goertzel */ /* init goertzel */
dsp_dtmf_goertzel_init(dsp); dsp_dtmf_goertzel_init(dsp);
...@@ -316,6 +317,7 @@ dsp_control_req(struct dsp *dsp, struct mISDNhead *hh, struct sk_buff *skb) ...@@ -316,6 +317,7 @@ dsp_control_req(struct dsp *dsp, struct mISDNhead *hh, struct sk_buff *skb)
case DTMF_TONE_STOP: /* turn off DTMF */ case DTMF_TONE_STOP: /* turn off DTMF */
if (dsp_debug & DEBUG_DSP_CORE) if (dsp_debug & DEBUG_DSP_CORE)
printk(KERN_DEBUG "%s: stop dtmf\n", __func__); printk(KERN_DEBUG "%s: stop dtmf\n", __func__);
dsp->dtmf.enable = 0;
dsp->dtmf.hardware = 0; dsp->dtmf.hardware = 0;
dsp->dtmf.software = 0; dsp->dtmf.software = 0;
break; break;
......
...@@ -51,6 +51,9 @@ void dsp_dtmf_hardware(struct dsp *dsp) ...@@ -51,6 +51,9 @@ void dsp_dtmf_hardware(struct dsp *dsp)
{ {
int hardware = 1; int hardware = 1;
if (!dsp->dtmf.enable)
return;
if (!dsp->features.hfc_dtmf) if (!dsp->features.hfc_dtmf)
hardware = 0; hardware = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment