From 6fafceb7f628b5e0ff16f5215a3485dbacec2b06 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Thu, 11 Aug 2011 19:54:48 +0000 Subject: 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 (License #6268) Changed dahdi_ec_chunk to dahdi_ec_span. Signed-off-by: Shaun Ruffell Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10110 Conflicts: drivers/dahdi/dahdi_dynamic.c git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@10113 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/dahdi_dynamic.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/dahdi/dahdi_dynamic.c b/drivers/dahdi/dahdi_dynamic.c index f0b61ff..10af931 100644 --- a/drivers/dahdi/dahdi_dynamic.c +++ b/drivers/dahdi/dahdi_dynamic.c @@ -222,16 +222,10 @@ static void __ztdynamic_run(void) { struct dahdi_dynamic *z; struct dahdi_dynamic_driver *drv; - int y; rcu_read_lock(); list_for_each_entry_rcu(z, &dspan_list, list) { if (!z->dead) { - for (y=0;yspan.channels;y++) { - /* Echo cancel double buffered data */ - dahdi_ec_chunk(z->span.chans[y], z->span.chans[y]->readchunk, z->span.chans[y]->writechunk); - } - dahdi_receive(&z->span); dahdi_transmit(&z->span); /* Handle all transmissions now */ ztd_sendmessage(z); @@ -397,6 +391,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) ztdynamic_run(); -- cgit v1.2.3