This patch will fix the frame lost problem for who use usb
controller isp1362 liked. Due to the bug in firmware of eagle
modem, sometimes the modem assemble badly the frame, so we have
had the "non-integral number of cells..." and lost that frame, the
counter of oversize on eaglestat was increased as well. To fix the
problem I just reassemble the bad frames into one good frame.
Jianliang Lu
-----------
Following are the patch:
--- eu_main.c.orig 2005-05-20 15:27:45.000000000 +0200
+++ eu_main.c 2005-07-28 11:35:39.000000000 +0200
@@ -1891,6 +1891,8 @@
return size;
}
+static eu_rb_t *pbuf_pre = NULL;
+static eu_bulk_rb_t *pbulk_pre = NULL;
/**
* eu_process_rcv - Process completed receive queue
@@ -1946,6 +1948,52 @@
pbulk = (eu_bulk_rb_t *) pbuf;
+ if ( (pbulk->length % ATM_CELL_SIZE) != 0 )
+ {
+ printk ("eu_process_rcv: non integral size (%d)!
\n", pbulk->leng
th);
+ if (!pbuf_pre)
+ {
+ pbuf_pre = (eu_rb_t *) pbuf;
+ pbulk_pre = (eu_bulk_rb_t *) pbulk;
+ continue;
+ }
+ else
+ {
+ if ( ((pbulk_pre->length + pbulk->length)
% ATM_CELL_SIZ
E) != 0 )
+ {
+ printk ("eu_process_rcv: somma non
integral size
(%d)! free all!\n", (pbulk->length + pbulk_pre->length));
+ kmem_cache_free ( ins->rb_cache,
pbuf );
kmem_cache_free ( ins->rb_cache,
pbuf_pre );
+ pbuf_pre = NULL;
+ pbulk_pre = NULL;
+ continue;
+ }
+ else
+ {
+ printk ("eu_process_rcv: ok somma
size (%d)!\n",
(pbulk->length + pbulk_pre->length));
+ memcpy (&pbulk_pre->data[pbulk_pre-
>length], &pb
ulk->data[0], pbulk->length);
+ pbulk_pre->length += pbulk->length;
+ kmem_cache_free ( ins->rb_cache,
pbuf );
+ pbuf = (eu_rb_t *) pbuf_pre;
+ pbulk = (eu_bulk_rb_t *) pbulk_pre;
+
+ pbuf_pre = NULL;
+ pbulk_pre = NULL;
+
+ }
+ }
+
+ }
+ else
+ {
+ if (pbuf_pre)
+ {
+ printk ("eu_process_rcv: integral size (%
d, %d)! free pr
evious buf\n", pbulk_pre->length, pbulk->length);
+ kmem_cache_free ( ins->rb_cache,
pbuf_pre );
+ pbuf_pre = NULL;
+ pbulk_pre = NULL;
+ }
+ }
+
count ++;
result = eu_uni_process_in_data ( ins, &pbulk->data[0],
pbulk->length )
;