net: phy: delay only if reset handler is registered
[oweals/u-boot.git] / drivers / net / fm / eth.c
index 1d1089d0173df0c25697044d159e5c5d23afac2b..6702f5a5202809a56ef9c73c1c2c60fd86a78f34 100644 (file)
@@ -15,7 +15,7 @@
 #include <phy.h>
 #include <asm/fsl_dtsec.h>
 #include <asm/fsl_tgec.h>
-#include <asm/fsl_memac.h>
+#include <fsl_memac.h>
 
 #include "fm.h"
 
@@ -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;
@@ -530,10 +531,10 @@ static int fm_eth_recv(struct eth_device *dev)
                if (!(status & RxBD_ERROR)) {
                        data = (u8 *)rxbd->buf_ptr_lo;
                        len = rxbd->len;
-                       NetReceive(data, len);
+                       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)