This is the mail archive of the ecos-discuss@sourceware.org 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: bugs in AT91 Ethernet driver



----- Original Message ----- From: "Lambrecht Jürgen" <J.Lambrecht@TELEVIC.com>
To: <ecos-discuss@sources.redhat.com>
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


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