summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-08-11 19:54:48 +0000
committerShaun Ruffell <sruffell@digium.com>2011-08-11 19:54:48 +0000
commit6fafceb7f628b5e0ff16f5215a3485dbacec2b06 (patch)
tree9cff794ab4ea3856e330bb47f20c391e04bdd335
parent017cc4809b9e032c80cc69426528147cff22f13a (diff)
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> 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
-rw-r--r--drivers/dahdi/dahdi_dynamic.c9
1 files 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;y<z->span.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();