summaryrefslogtreecommitdiff
path: root/wct4xxp
diff options
context:
space:
mode:
authormattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-02-21 16:01:08 +0000
committermattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-02-21 16:01:08 +0000
commitf378c8f6ea890b821678705f7469f4264fc9813f (patch)
treedd9caf3da542b8a89788a6dab21632c4c18b6dd6 /wct4xxp
parent254c4e53b2abb83aaf532342a7f51fb561826507 (diff)
Merged revisions 2200 via svnmerge from
https://origsvn.digium.com/svn/zaptel/branches/1.4 ................ r2200 | mattf | 2007-02-21 09:57:59 -0600 (Wed, 21 Feb 2007) | 10 lines Merged revisions 2198 via svnmerge from https://origsvn.digium.com/svn/zaptel/branches/1.2 ........ r2198 | mattf | 2007-02-21 09:49:50 -0600 (Wed, 21 Feb 2007) | 2 lines Reduce our stack usage when using the vpm450m ........ ................ git-svn-id: http://svn.digium.com/svn/zaptel/trunk@2202 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wct4xxp')
-rw-r--r--wct4xxp/vpm450m.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/wct4xxp/vpm450m.c b/wct4xxp/vpm450m.c
index fa9a47a..8f82376 100644
--- a/wct4xxp/vpm450m.c
+++ b/wct4xxp/vpm450m.c
@@ -204,15 +204,16 @@ static unsigned int tones[] = {
static void vpm450m_setecmode(struct vpm450m *vpm450m, int channel, int mode)
{
- tOCT6100_CHANNEL_MODIFY modify;
+ tOCT6100_CHANNEL_MODIFY *modify;
UINT32 ulResult;
if (vpm450m->ecmode[channel] == mode)
return;
- Oct6100ChannelModifyDef(&modify);
- modify.ulEchoOperationMode = mode;
- modify.ulChannelHndl = vpm450m->aulEchoChanHndl[channel];
- ulResult = Oct6100ChannelModify(vpm450m->pApiInstance, &modify);
+ modify = kmalloc(sizeof(tOCT6100_CHANNEL_MODIFY), GFP_KERNEL);
+ Oct6100ChannelModifyDef(modify);
+ modify->ulEchoOperationMode = mode;
+ modify->ulChannelHndl = vpm450m->aulEchoChanHndl[channel];
+ ulResult = Oct6100ChannelModify(vpm450m->pApiInstance, modify);
if (ulResult != GENERIC_OK) {
printk("Failed to apply echo can changes on channel %d!\n", channel);
} else {
@@ -221,21 +222,23 @@ static void vpm450m_setecmode(struct vpm450m *vpm450m, int channel, int mode)
#endif
vpm450m->ecmode[channel] = mode;
}
+ kfree(modify);
}
void vpm450m_setdtmf(struct vpm450m *vpm450m, int channel, int detect, int mute)
{
- tOCT6100_CHANNEL_MODIFY modify;
+ tOCT6100_CHANNEL_MODIFY *modify;
UINT32 ulResult;
- Oct6100ChannelModifyDef(&modify);
- modify.ulChannelHndl = vpm450m->aulEchoChanHndl[channel];
+ modify = kmalloc(sizeof(tOCT6100_CHANNEL_MODIFY), GFP_KERNEL);
+ Oct6100ChannelModifyDef(modify);
+ modify->ulChannelHndl = vpm450m->aulEchoChanHndl[channel];
if (mute) {
vpm450m->chanflags[channel] |= FLAG_MUTE;
- modify.VqeConfig.fDtmfToneRemoval = TRUE;
+ modify->VqeConfig.fDtmfToneRemoval = TRUE;
} else {
vpm450m->chanflags[channel] &= ~FLAG_MUTE;
- modify.VqeConfig.fDtmfToneRemoval = FALSE;
+ modify->VqeConfig.fDtmfToneRemoval = FALSE;
}
if (detect)
vpm450m->chanflags[channel] |= FLAG_DTMF;
@@ -251,11 +254,12 @@ void vpm450m_setdtmf(struct vpm450m *vpm450m, int channel, int detect, int mute)
vpm450m_setecmode(vpm450m, channel, cOCT6100_ECHO_OP_MODE_DIGITAL);
}
- ulResult = Oct6100ChannelModify(vpm450m->pApiInstance, &modify);
+ ulResult = Oct6100ChannelModify(vpm450m->pApiInstance, modify);
if (ulResult != GENERIC_OK) {
printk("Failed to apply dtmf mute changes on channel %d!\n", channel);
}
/* printk("VPM450m: Setting DTMF on channel %d: %s / %s\n", channel, (detect ? "DETECT" : "NO DETECT"), (mute ? "MUTE" : "NO MUTE")); */
+ kfree(modify);
}
void vpm450m_setec(struct vpm450m *vpm450m, int channel, int eclen)
@@ -352,7 +356,9 @@ int vpm450m_getdtmf(struct vpm450m *vpm450m, int *channel, int *tone, int *start
*tone = 'f';
break;
default:
+#ifdef OCTASIC_DEBUG
printk("Unknown tone value %08x\n", tonefound.ulToneDetected);
+#endif
*tone = 'u';
break;
}