dahdi_dynamic: Call dahdi_receive in rx packet handler.

Currently dahdi_receive is called on all channels in the context of the
master dynamic span. If one span (not the master) receive two packets
before the master span received a packet, the older packet on the
dynamic span would end up lost because the "readchunk" for the
channels would be overwritten by the new packet. DAHLIN-245

Signed-off-by: Wagner Gegler <wagner@aligera.com.br> (License #6268)
Changed dahdi_ec_chunk to dahdi_ec_span.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10110 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
Wagner Gegler 2011-08-10 19:22:01 +00:00 committed by Shaun Ruffell
parent 77113b822f
commit 4f8b2dded1

View File

@ -200,16 +200,9 @@ static void __dahdi_dynamic_run(void)
{ {
struct dahdi_dynamic *d; struct dahdi_dynamic *d;
struct dahdi_dynamic_driver *drv; struct dahdi_dynamic_driver *drv;
int y;
rcu_read_lock(); rcu_read_lock();
list_for_each_entry_rcu(d, &dspan_list, list) { list_for_each_entry_rcu(d, &dspan_list, list) {
for (y = 0; y < d->span.channels; y++) {
struct dahdi_chan *const c = d->span.chans[y];
/* Echo cancel double buffered data */
dahdi_ec_chunk(c, c->readchunk, c->writechunk);
}
dahdi_receive(&d->span);
dahdi_transmit(&d->span); dahdi_transmit(&d->span);
/* Handle all transmissions now */ /* Handle all transmissions now */
dahdi_dynamic_sendmessage(d); dahdi_dynamic_sendmessage(d);
@ -370,6 +363,9 @@ void dahdi_dynamic_receive(struct dahdi_span *span, unsigned char *msg, int msgl
if (unlikely(rxpos != rxcnt)) if (unlikely(rxpos != rxcnt))
printk(KERN_NOTICE "Span %s: Expected seq no %d, but received %d instead\n", span->name, rxcnt, rxpos); printk(KERN_NOTICE "Span %s: Expected seq no %d, but received %d instead\n", span->name, rxcnt, rxpos);
dahdi_ec_span(span);
dahdi_receive(span);
/* If this is our master span, then run everything */ /* If this is our master span, then run everything */
if (master) if (master)
dahdi_dynamic_run(); dahdi_dynamic_run();