From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24645 invoked by alias); 5 Dec 2003 08:54:24 -0000 Mailing-List: contact ecos-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@sources.redhat.com Received: (qmail 24636 invoked from network); 5 Dec 2003 08:54:23 -0000 Received: from unknown (HELO londo.lunn.ch) (80.238.139.98) by sources.redhat.com with SMTP; 5 Dec 2003 08:54:23 -0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1ASBj3-0001JY-00; Fri, 05 Dec 2003 09:54:13 +0100 Date: Fri, 05 Dec 2003 08:54:00 -0000 To: Yoshinori Sato Cc: Uwe Kindler , ecos-discuss@sources.redhat.com Message-ID: <20031205085413.GG2527@lunn.ch> Mail-Followup-To: Yoshinori Sato , Uwe Kindler , ecos-discuss@sources.redhat.com References: <49977.141.55.192.70.1069250772.squirrel@www.htwm.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i From: Andrew Lunn Subject: Re: [ECOS] Re: EDOSK-2674 ethernet drivers -TCP problem X-SW-Source: 2003-12/txt/msg00071.txt.bz2 Hi Yoshinori > @@ -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); > } I don't know this chip at all, im just reading the code and deciding if to commit your patch. sizeof(*sdata) is 2. The original code will exist the loop when len == 0 or 1 and in these cases *sdata points to the end of the packet, or the last byte. Your change means it will exit when len == 0 or -1 and in these cases, *sdata points to the end of the packet, or one byte after the end of the packet. So when len is odd, the original code *sdate points to the last byte and your code *sdata points to some junk after the end of the packet. The code that follows is: control = 0; if ( 1 & plen ) { // Need to set ODD flag and insert the data unsigned char onebyte = *(unsigned char*)sdata; control = onebyte; control |= LAN91CXX_CONTROLBYTE_ODD; } ie if we have an odd length packet, get the last byte at *sdata and put it into a control word. It looks to me your change causes random junk to be in the control word. Am i reading this wrong? Thanks Andrew -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss