]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
qoriq eth.c bugfix: handle received corrupted frames correctly
authorDaniel Inderbitzin <daniel.inderbitzin@crypto.ch>
Fri, 10 Jul 2015 12:06:02 +0000 (14:06 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 10 Sep 2015 06:17:42 +0000 (08:17 +0200)
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>
drivers/net/fm/eth.c

index d7a37f39a8e3e23b24735d10a152ebff494504c8..6702f5a5202809a56ef9c73c1c2c60fd86a78f34 100644 (file)
@@ -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)