[mISDN PATCH v2 19/19] Fix DTMF detection enable/disable

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Karsten Keil
Date: Friday, May 22, 2009 - 2:04 pm

From: Andreas Eversberg <andreas@eversberg.eu>

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>
---
 drivers/isdn/mISDN/dsp.h      |    1 +
 drivers/isdn/mISDN/dsp_core.c |    2 ++
 drivers/isdn/mISDN/dsp_dtmf.c |    3 +++
 3 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/isdn/mISDN/dsp.h b/drivers/isdn/mISDN/dsp.h
index 564ea3e..18af868 100644
--- a/drivers/isdn/mISDN/dsp.h
+++ b/drivers/isdn/mISDN/dsp.h
@@ -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 */
diff --git a/drivers/isdn/mISDN/dsp_core.c b/drivers/isdn/mISDN/dsp_core.c
index c357506..c12cd2f 100644
--- a/drivers/isdn/mISDN/dsp_core.c
+++ b/drivers/isdn/mISDN/dsp_core.c
@@ -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;
diff --git a/drivers/isdn/mISDN/dsp_dtmf.c b/drivers/isdn/mISDN/dsp_dtmf.c
index efc371c..9ae2d33 100644
--- a/drivers/isdn/mISDN/dsp_dtmf.c
+++ b/drivers/isdn/mISDN/dsp_dtmf.c
@@ -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;
 
-- 
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[mISDN PATCH v2 00/19] mISDN patchset for next, Karsten Keil, (Fri May 22, 1:42 pm)
[mISDN PATCH v2 07/19] Fix DTMF locking bug issue, Karsten Keil, (Fri May 22, 2:04 pm)
[mISDN PATCH v2 06/19] Added layer-1-hold feature, Karsten Keil, (Fri May 22, 2:04 pm)
[mISDN PATCH v2 09/19] Fix TEI and SAPI handling, Karsten Keil, (Fri May 22, 2:04 pm)
[mISDN PATCH v2 12/19] Fix skb leak in error cases, Karsten Keil, (Fri May 22, 2:04 pm)
[mISDN PATCH v2 15/19] Add PCI ID for Junghanns 8S card, Karsten Keil, (Fri May 22, 2:04 pm)
[mISDN PATCH v2 17/19] Cleanup debug messages, Karsten Keil, (Fri May 22, 2:04 pm)
[mISDN PATCH v2 19/19] Fix DTMF detection enable/disable, Karsten Keil, (Fri May 22, 2:04 pm)
Re: [mISDN PATCH v2 00/19] mISDN patchset for next, David Miller, (Mon May 25, 12:53 am)