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] |
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.
-- 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] |