diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2008-07-02 13:31:31 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2008-07-02 13:31:31 +0000 |
commit | 1340abc2e710509a9bbe8ca720c91eff896c3d33 (patch) | |
tree | 3d2cffb2090c445da8b3b8e741543c0287a2cc60 /drivers/dahdi/xpp/xbus-pcm.c | |
parent | ef05eedbe6bffbdaaee55f26b0c54a06fd32b6f2 (diff) |
break up large memory allocations made by digital span drivers into smaller ones (one allocation for each dahdi_chan structure, separate from any private structures used by the driver)
(closes issue #12657)
Reported by: tzafrir
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4513 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/xpp/xbus-pcm.c')
-rw-r--r-- | drivers/dahdi/xpp/xbus-pcm.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/dahdi/xpp/xbus-pcm.c b/drivers/dahdi/xpp/xbus-pcm.c index 1e3a915..09ebc13 100644 --- a/drivers/dahdi/xpp/xbus-pcm.c +++ b/drivers/dahdi/xpp/xbus-pcm.c @@ -648,7 +648,7 @@ void fill_beep(u_char *buf, int num, int duration) static void do_ec(xpd_t *xpd) { - struct dahdi_chan *chans = xpd->span.chans; + struct dahdi_chan **chans = xpd->span.chans; int i; for (i = 0;i < xpd->span.channels; i++) { @@ -656,9 +656,9 @@ static void do_ec(xpd_t *xpd) continue; if(!IS_SET(xpd->wanted_pcm_mask, i)) /* No ec for unwanted PCM */ continue; - dahdi_ec_chunk(&chans[i], chans[i].readchunk, xpd->ec_chunk2[i]); + dahdi_ec_chunk(chans[i], chans[i]->readchunk, xpd->ec_chunk2[i]); memcpy(xpd->ec_chunk2[i], xpd->ec_chunk1[i], DAHDI_CHUNKSIZE); - memcpy(xpd->ec_chunk1[i], chans[i].writechunk, DAHDI_CHUNKSIZE); + memcpy(xpd->ec_chunk1[i], chans[i]->writechunk, DAHDI_CHUNKSIZE); } } @@ -764,10 +764,10 @@ dropit: */ void generic_card_pcm_fromspan(xbus_t *xbus, xpd_t *xpd, xpp_line_t lines, xpacket_t *pack) { - byte *pcm; - struct dahdi_chan *chans; - unsigned long flags; - int i; + byte *pcm; + struct dahdi_chan **chans; + unsigned long flags; + int i; BUG_ON(!xbus); BUG_ON(!xpd); @@ -784,7 +784,7 @@ void generic_card_pcm_fromspan(xbus_t *xbus, xpd_t *xpd, xpp_line_t lines, xpack memset((u_char *)pcm, pcmtx, DAHDI_CHUNKSIZE); else #endif - memcpy((u_char *)pcm, chans[i].writechunk, DAHDI_CHUNKSIZE); + memcpy((u_char *)pcm, chans[i]->writechunk, DAHDI_CHUNKSIZE); // fill_beep((u_char *)pcm, xpd->addr.subunit, 2); } else memset((u_char *)pcm, 0x7F, DAHDI_CHUNKSIZE); @@ -808,7 +808,7 @@ void generic_card_pcm_tospan(xbus_t *xbus, xpd_t *xpd, xpacket_t *pack) if(!SPAN_REGISTERED(xpd)) goto out; for (i = 0; i < xpd->channels; i++) { - volatile u_char *r = xpd->span.chans[i].readchunk; + volatile u_char *r = xpd->span.chans[i]->readchunk; if(!IS_SET(xpd->wanted_pcm_mask, i)) { if(IS_SET(xpd->silence_pcm, i)) { |