summaryrefslogtreecommitdiff
path: root/drivers/dahdi/wct4xxp
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-02-10 16:22:49 +0000
committerShaun Ruffell <sruffell@digium.com>2011-02-10 16:22:49 +0000
commitb178fa79f5c8c2fcab3ca8ac2998e28510e5dc00 (patch)
tree223b541e654e5765e7882a487637666a06638c19 /drivers/dahdi/wct4xxp
parent20c13564c8d539bfc02155217484fc04a71f4c68 (diff)
wct4xxp: Reduce the memory footprint of the hardware echocanceler.
This saves ~300K of kernel memory for each quad or dual span VPM. Due to the fact that this change disables caching of the NLP words (among other things), the time to disable the echocans appears to have increased by ~1ms. Before this change: ======================================================================= 0) ! 356.498 us | vpm450m_setecmode(); <--- disable 0) ! 387.762 us | vpm450m_setecmode(); <--- enable 0) ! 429.839 us | vpm450m_setecmode(); <--- disable ]# echo 1 > /proc/sys/vm/drop_caches && free -k total used free shared buffers cached Mem: 2005352 228368 1776984 0 132 5540 -/+ buffers/cache: 222696 1782656 Swap: 983036 0 983036 After this change: ======================================================================= 0) ! 1109.515 us | vpm450m_setecmode(); <--- disable 0) ! 339.017 us | vpm450m_setecmode(); <--- enable 0) ! 1431.460 us | vpm450m_setecmode(); <--- disable ]# echo 1 > /proc/sys/vm/drop_caches && free -k total used free shared buffers cached Mem: 2005352 228080 1777272 0 112 5484 -/+ buffers/cache: 222484 1782868 Swap: 983036 0 983036 Signed-off-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9750 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wct4xxp')
-rw-r--r--drivers/dahdi/wct4xxp/vpm450m.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/dahdi/wct4xxp/vpm450m.c b/drivers/dahdi/wct4xxp/vpm450m.c
index e04922e..a6931fb 100644
--- a/drivers/dahdi/wct4xxp/vpm450m.c
+++ b/drivers/dahdi/wct4xxp/vpm450m.c
@@ -172,7 +172,7 @@ UINT32 Oct6100UserDriverReadBurstApi(tPOCT6100_READ_BURST_PARAMS f_pBurstParams)
struct vpm450m {
tPOCT6100_INSTANCE_API pApiInstance;
- UINT32 aulEchoChanHndl[ 128 ];
+ UINT32 aulEchoChanHndl[128];
int chanflags[128];
int ecmode[128];
int numchans;
@@ -237,7 +237,7 @@ static void vpm450m_setecmode(struct vpm450m *vpm450m, int channel, int mode)
modify->ulChannelHndl = vpm450m->aulEchoChanHndl[channel];
ulResult = Oct6100ChannelModify(vpm450m->pApiInstance, modify);
if (ulResult != GENERIC_OK) {
- printk(KERN_NOTICE "Failed to apply echo can changes on channel %d!\n", channel);
+ printk(KERN_NOTICE "Failed to apply echo can changes on channel %d %08x!\n", channel, ulResult);
} else {
#ifdef OCTASIC_DEBUG
printk(KERN_DEBUG "Echo can on channel %d set to %d\n", channel, mode);
@@ -449,7 +449,7 @@ struct vpm450m *init_vpm450m(void *wc, int *isalaw, int numspans, const struct f
memset(ChannelOpen, 0, sizeof(tOCT6100_CHANNEL_OPEN));
- for (x=0;x<128;x++)
+ for (x = 0; x < ARRAY_SIZE(vpm450m->ecmode); x++)
vpm450m->ecmode[x] = -1;
vpm450m->numchans = numspans * 32;
@@ -474,6 +474,12 @@ struct vpm450m *init_vpm450m(void *wc, int *isalaw, int numspans, const struct f
ChipOpen->ulMaxTdmStreams = 4;
ChipOpen->aulTdmStreamFreqs[0] = cOCT6100_TDM_STREAM_FREQ_8MHZ;
ChipOpen->ulTdmSampling = cOCT6100_TDM_SAMPLE_AT_FALLING_EDGE;
+ ChipOpen->ulMaxFlexibleConfParticipants = 0;
+ ChipOpen->ulMaxConfBridges = 0;
+ ChipOpen->ulMaxRemoteDebugSessions = 0;
+ ChipOpen->fEnableChannelRecording = FALSE;
+ ChipOpen->ulSoftToneEventsBufSize = 64;
+
#if 0
ChipOpen->fEnableAcousticEcho = TRUE;
#endif
@@ -487,7 +493,6 @@ struct vpm450m *init_vpm450m(void *wc, int *isalaw, int numspans, const struct f
return NULL;
}
-
vpm450m->pApiInstance = vmalloc(InstanceSize.ulApiInstanceSize);
if (!vpm450m->pApiInstance) {
printk(KERN_NOTICE "Out of memory (can't allocate %d bytes)!\n", InstanceSize.ulApiInstanceSize);
@@ -517,7 +522,7 @@ struct vpm450m *init_vpm450m(void *wc, int *isalaw, int numspans, const struct f
kfree(ChannelOpen);
return NULL;
}
- for (x=0;x<128;x++) {
+ for (x = 0; x < ARRAY_SIZE(vpm450m->aulEchoChanHndl); x++) {
/* execute this loop always on 4 span cards but
* on 2 span cards only execute for the channels related to our spans */
if (( numspans > 2) || ((x & 0x03) <2)) {
@@ -554,8 +559,9 @@ struct vpm450m *init_vpm450m(void *wc, int *isalaw, int numspans, const struct f
ulResult = Oct6100ChannelOpen(vpm450m->pApiInstance, ChannelOpen);
if (ulResult != GENERIC_OK) {
printk(KERN_NOTICE "Failed to open channel %d!\n", x);
+ continue;
}
- for (y=0;y<sizeof(tones) / sizeof(tones[0]); y++) {
+ for (y = 0; y < ARRAY_SIZE(tones); y++) {
tOCT6100_TONE_DETECTION_ENABLE enable;
Oct6100ToneDetectionEnableDef(&enable);
enable.ulChannelHndl = vpm450m->aulEchoChanHndl[x];