diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2008-08-11 09:38:48 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2008-08-13 16:30:59 +0200 |
commit | 7b8baf63993c5be91980442fce10290b6226df3c (patch) | |
tree | 2ac9efcb47dd2832c77a23bd0c185e54364cc917 /drivers/net | |
parent | e25cc045ac5fa5002e0e2911e508f07e020a5363 (diff) | |
download | barebox-7b8baf63993c5be91980442fce10290b6226df3c.tar.gz barebox-7b8baf63993c5be91980442fce10290b6226df3c.tar.xz |
mx27 fec ethernet: remove memcpy
Instead of copying the received packet in memory, pass a pointer to the
packet to U-Boot
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/fec_imx27.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/net/fec_imx27.c b/drivers/net/fec_imx27.c index fb4dbf6d51..6c5e17a896 100644 --- a/drivers/net/fec_imx27.c +++ b/drivers/net/fec_imx27.c @@ -195,7 +195,7 @@ static int fec_rbd_init(fec_priv *fec, int count, int size) * * Transmit buffers are created externally. We only have to init the BDs here.\n * Note: There is a race condition in the hardware. When only one BD is in - * use it must be marked with the WRAP bit to use it for every transmitt. + * use it must be marked with the WRAP bit to use it for every transmit. * This bit in combination with the READY bit results into double transmit * of each data buffer. It seems the state machine checks READY earlier then * resetting it after the first transfer. @@ -446,8 +446,9 @@ static int fec_send(struct eth_device *dev, void *eth_data, int data_length) return -1; } - if ((uint32_t)eth_data & (DB_DATA_ALIGNMENT-1)) - printf("%s: Warning: Transmitt data not aligned!\n", __FUNCTION__); + if ((uint32_t)eth_data & (DB_DATA_ALIGNMENT-1)) { + printf("%s: Warning: Transmit data not aligned: %p!\n", __FUNCTION__, eth_data); + } /* * Setup the transmitt buffer @@ -501,7 +502,6 @@ static int fec_recv(struct eth_device *dev) int frame_length, len = 0; NBUF *frame; uint16_t bd_status; - uchar buff[FEC_MAX_PKT_SIZE]; /* * Check if any critical events have happened @@ -542,11 +542,8 @@ static int fec_recv(struct eth_device *dev) */ frame = (NBUF *)readl(&rbd->data_pointer); frame_length = readw(&rbd->data_length) - 4; - /* - * Fill the buffer and pass it to upper layers - */ - memcpy(buff, frame->data, frame_length); - NetReceive(buff, frame_length); + + NetReceive(frame->data, frame_length); len = frame_length; } else { if (bd_status & FEC_RBD_ERR) { |