From 7b611d2299bca77a9844b383a3bc36f6e5be12fa Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Sat, 30 Jul 2011 14:49:05 -0500 Subject: [PATCH] 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) received two packets before the master span received a packet, the older packet on the non-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 (License #6268) Changed dahdi_ec_chunk to dahdi_ec_span. Signed-off-by: Shaun Ruffell --- drivers/dahdi/dahdi_dynamic.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/dahdi/dahdi_dynamic.c b/drivers/dahdi/dahdi_dynamic.c index fd41676..75cb7f0 100644 --- a/drivers/dahdi/dahdi_dynamic.c +++ b/drivers/dahdi/dahdi_dynamic.c @@ -204,12 +204,6 @@ static void __dahdi_dynamic_run(void) rcu_read_lock(); 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); /* Handle all transmissions now */ dahdi_dynamic_sendmessage(d); @@ -370,6 +364,9 @@ void dahdi_dynamic_receive(struct dahdi_span *span, unsigned char *msg, int msgl if (unlikely(rxpos != rxcnt)) 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 (master) dahdi_dynamic_run(); -- 1.7.6