This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: EDOSK-2674 ethernet drivers -TCP problem


At Wed, 19 Nov 2003 15:06:12 +0100 (CET),
Uwe Kindler wrote:
> 
> Hello,
> 
> i buildet the Redboot image for the EDOSK-2674 platform including
> ethernetdrivers for the onboard SMSC LAN91C96 chip.
> The ping command works fine an so I tried to connect GDB via Remote/TCP. But
> the connection does not work. In the gdb console is printed: Ignorig packet
> error and continuing.
> 
> When I analyze the net traffic with Packetyzer and follow the TCP stream, i
> can see the following:
> 
> RedBoot>0+$Hc-1#09RedBoot>0$Hc-1#09RedBoot>0RedBoot>0$Hc-1#09RedBoot>0RedBoo
> t>0$Hc-1#09RedBoot>0$Hc-1#09RedBoot>0RedBoot>0RedBoot>0-$Hc-1#09-RedBoot>0Re
> dBoot>0-RedBoot>0-+$qC#b4RedBoot>0RedBoot>0.....
> 
> From the EDOSK-board is only the "RedBoot>0" part.
> 
> When I look into the TCP part of the "RedBoot>0" packet then the ckecksum is
> wrong
> 
> tcp.checksum = Checksum: 0x442d (incorrect, should be 0x342d)
> 
> Is there a bug within the TCP part of the Redboot stand alone stack or does
> it look like a bug within
> the ethernet device driver or did i missed a configuration option?
> 
> Regards, Uwe
> 

Bug in smsc91cxx driver.
Send odd length packet to last byte broken.

Fix patch (sorry adhoc).

Index: packages/devs/eth/smsc/lan91cxx/current/src/if_lan91cxx.c
===================================================================
RCS file: /cvsroot/ecos-h8/ecos/packages/devs/eth/smsc/lan91cxx/current/src/if_lan91cxx.c,v
retrieving revision 1.3
diff -u -r1.3 if_lan91cxx.c
--- packages/devs/eth/smsc/lan91cxx/current/src/if_lan91cxx.c	22 May 2003 12:45:22 -0000	1.3
+++ packages/devs/eth/smsc/lan91cxx/current/src/if_lan91cxx.c	29 Nov 2003 13:42:54 -0000
@@ -794,7 +794,7 @@
     // Prepare header:
     put_data(sc, CYG_CPU_TO_LE16(0));        // reserve space for status word
     // packet length (includes status, byte-count and control shorts)
-    put_data(sc, CYG_CPU_TO_LE16(0x7FE & (plen + 6)) ); // Always even, always < 15xx(dec)
+    put_data(sc, CYG_CPU_TO_LE16(0x7FE & (plen + 6 + 1)) ); // Always even, always < 15xx(dec)
 
     // Put data into buffer
     for (i = 0;  i < sg_len;  i++) {
@@ -803,7 +803,7 @@
 
         CYG_ASSERT(0 == (len & 1) || (i == (sg_len-1)), "odd length");
         CYG_ASSERT( sdata, "No sg data pointer here" );
-        while(len >= sizeof(*sdata)) {
+        while(len > 0) {
             put_data(sc, *sdata++);
             len -= sizeof(*sdata);
         }

-- 
Yoshinori Sato
<ysato@users.sourceforge.jp>

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]