From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23413 invoked by alias); 31 May 2008 08:12:42 -0000 Received: (qmail 23403 invoked by uid 22791); 31 May 2008 08:12:42 -0000 X-Spam-Check-By: sourceware.org Received: from mail.ic-bresler.ru (HELO ic-bresler.ru) (91.197.172.40) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 31 May 2008 08:12:24 +0000 Received: from IYanaslov (95.mail.ic-bresler.ru [10.10.10.95]) by ic-bresler.ru (8.13.8/8.13.8) with SMTP id m4V8FNaq042950; Sat, 31 May 2008 12:15:23 +0400 (MSD) (envelope-from yanaslov_iv@ic-bresler.ru) Message-ID: <001001c8c2f5$d81574c0$5a64a8c0@icbresler> From: "I-Yanaslov" To: =?ISO-8859-1?Q?Lambrecht_J=FCrgen?= , References: <369C2E4EDB94C34881A8178BEA192A1205247D@nt-email.TELEVIC.COM> Date: Sat, 31 May 2008 08:12:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=original Content-Transfer-Encoding: 8bit X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release X-SpamTest-Info: Not protected X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] bugs in AT91 Ethernet driver X-SW-Source: 2008-05/txt/msg00128.txt.bz2 ----- Original Message ----- From: "Lambrecht Jürgen" To: Sent: Saturday, May 31, 2008 2:23 AM Subject: [ECOS] bugs in AT91 Ethernet driver Hello. >I found some bugs in the AT91 EMAC Ethernet driver - >/packages/devs/eth/arm/at91/current/src/if_at91.c. >This is my version of at91_eth_recv(..): > .................. > memcpy(sg_buf, /* &sg_buf[bytes_in_list], */ > &priv->rb[priv->curr_rbd_idx].rb[buffer_pos], > bytes_needed_list); > .................. > memcpy(sg_buf, /* wrong: &sg_buf[bytes_in_list], */ > &priv->rb[priv->curr_rbd_idx].rb[buffer_pos], > bytes_in_buffer); > > priv->rbd[priv->curr_rbd_idx].addr &= > ~(AT91_EMAC_RBD_ADDR_OWNER_SW); > priv->curr_rbd_idx++; > if(priv->curr_rbd_idx >= CYGNUM_DEVS_ETH_ARM_AT91_RX_BUFS) > { > priv->curr_rbd_idx = 0; > } > buffer_pos = 0; > } > } > bytes_in_list = 0; /* go to next list */ > } >} Don't understand, why "memcpy(&sg_buf[bytes_in_list]," is wrong. Know, you must iterate sg_buf before memcpy next RXbuffer. About a TX driver. At91sam9260 errata says, TX buffer and buffer descriptors must be allocated in fast memory, e.g. internal SRAM. So, eCos scheme with TX buffers which dinamically allocated from the heap (heap is in external SDRAM at 9260EK) is do not work in interrupt mode. Ivan Yanaslov. -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss