Merge branch 'master' of git://git.denx.de/u-boot
[oweals/u-boot.git] / drivers / net / macb.c
index 9c2ff487a709f57eae7caa6df51a8dce7292f2cd..f9491617382ca2659078d047d6d4f31a794f4f64 100644 (file)
@@ -347,14 +347,14 @@ static int macb_recv(struct eth_device *netdev)
                                headlen = 128 * (MACB_RX_RING_SIZE
                                                 - macb->rx_tail);
                                taillen = length - headlen;
-                               memcpy((void *)NetRxPackets[0],
+                               memcpy((void *)net_rx_packets[0],
                                       buffer, headlen);
-                               memcpy((void *)NetRxPackets[0] + headlen,
+                               memcpy((void *)net_rx_packets[0] + headlen,
                                       macb->rx_buffer, taillen);
-                               buffer = (void *)NetRxPackets[0];
+                               buffer = (void *)net_rx_packets[0];
                        }
 
-                       NetReceive(buffer, length);
+                       net_process_received_packet(buffer, length);
                        if (++rx_tail >= MACB_RX_RING_SIZE)
                                rx_tail = 0;
                        reclaim_rx_buffers(macb, rx_tail);
@@ -515,7 +515,7 @@ static int macb_phy_init(struct macb_device *macb)
               lpa);
 
        ncfgr = macb_readl(macb, NCFGR);
-       ncfgr &= ~(MACB_BIT(SPD) | MACB_BIT(FD));
+       ncfgr &= ~(MACB_BIT(SPD) | MACB_BIT(FD) | GEM_BIT(GBE));
        if (speed)
                ncfgr |= MACB_BIT(SPD);
        if (duplex)
@@ -525,7 +525,6 @@ static int macb_phy_init(struct macb_device *macb)
        return 1;
 }
 
-static int macb_write_hwaddr(struct eth_device *dev);
 static int macb_init(struct eth_device *netdev, bd_t *bd)
 {
        struct macb_device *macb = to_macb(netdev);
@@ -594,14 +593,6 @@ static int macb_init(struct eth_device *netdev, bd_t *bd)
 #endif /* CONFIG_RMII */
        }
 
-       /* update the ethaddr */
-       if (is_valid_ether_addr(netdev->enetaddr)) {
-               macb_write_hwaddr(netdev);
-       } else {
-               printf("%s: mac address is not valid\n", netdev->name);
-               return -1;
-       }
-
        if (!macb_phy_init(macb))
                return -1;