summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDaniel Inderbitzin <daniel.inderbitzin@crypto.ch>2015-07-10 14:06:02 +0200
committerJoe Hershberger <joe.hershberger@ni.com>2015-08-11 13:46:16 -0500
commit466f775e02bcde5ea7454cd73ecf1a0f79275a30 (patch)
tree45b096158fe52c1f0031b9723fed5480845daca7 /drivers
parent1a791892dcb5904c8b208535704714b07802e0b8 (diff)
downloadblackbird-obmc-uboot-466f775e02bcde5ea7454cd73ecf1a0f79275a30.tar.gz
blackbird-obmc-uboot-466f775e02bcde5ea7454cd73ecf1a0f79275a30.zip
qoriq eth.c bugfix: handle received corrupted frames correctly
The rxbd is not correctly handled in case of a frame physical error (FPE) or frame size error (FSE). The rxbd must be cleared and advanced in case of an error to avoid receive stall. Signed-off-by: Daniel Inderbitzin <daniel.inderbitzin@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/fm/eth.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c
index d7a37f39a8..6702f5a520 100644
--- a/drivers/net/fm/eth.c
+++ b/drivers/net/fm/eth.c
@@ -520,6 +520,7 @@ static int fm_eth_recv(struct eth_device *dev)
u16 status, len;
u8 *data;
u16 offset_out;
+ int ret = 1;
fm_eth = (struct fm_eth *)dev->priv;
pram = fm_eth->rx_pram;
@@ -533,7 +534,7 @@ static int fm_eth_recv(struct eth_device *dev)
net_process_received_packet(data, len);
} else {
printf("%s: Rx error\n", dev->name);
- return 0;
+ ret = 0;
}
/* clear the RxBDs */
@@ -559,7 +560,7 @@ static int fm_eth_recv(struct eth_device *dev)
}
fm_eth->cur_rxbd = (void *)rxbd;
- return 1;
+ return ret;
}
static int fm_eth_init_mac(struct fm_eth *fm_eth, struct ccsr_fman *reg)
OpenPOWER on IntegriCloud