Skip to content

Commit

Permalink
mISDN: Fix DTMF detection enable/disable
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andreas Eversberg authored and David S. Miller committed May 25, 2009
1 parent 8c90e11 commit b0579d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/isdn/mISDN/dsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 2 additions & 0 deletions drivers/isdn/mISDN/dsp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions drivers/isdn/mISDN/dsp_dtmf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit b0579d7

Please sign in to comment.