dev->halt = bfin_EMAC_halt;
dev->send = bfin_EMAC_send;
dev->recv = bfin_EMAC_recv;
+ dev->write_hwaddr = bfin_EMAC_setup_addr;
eth_register(dev);
return 0;
}
+static int bfin_EMAC_setup_addr(struct eth_device *dev)
+{
+ *pEMAC_ADDRLO =
+ dev->enetaddr[0] |
+ dev->enetaddr[1] << 8 |
+ dev->enetaddr[2] << 16 |
+ dev->enetaddr[3] << 24;
+ *pEMAC_ADDRHI =
+ dev->enetaddr[4] |
+ dev->enetaddr[5] << 8;
+ return 0;
+}
+
static int bfin_EMAC_init(struct eth_device *dev, bd_t *bd)
{
u32 opmode;
return -1;
/* Initialize EMAC address */
- bfin_EMAC_setup_addr(dev->enetaddr);
+ bfin_EMAC_setup_addr(dev);
/* Initialize TX and RX buffer */
for (i = 0; i < PKTBUFSRX; i++) {
}
-void bfin_EMAC_setup_addr(uchar *enetaddr)
-{
- *pEMAC_ADDRLO =
- enetaddr[0] |
- enetaddr[1] << 8 |
- enetaddr[2] << 16 |
- enetaddr[3] << 24;
- *pEMAC_ADDRHI =
- enetaddr[4] |
- enetaddr[5] << 8;
-}
-
ADI_ETHER_BUFFER *SetupRxBuffer(int no)
{
ADI_ETHER_FRAME_BUFFER *frmbuf;
static void bfin_EMAC_halt(struct eth_device *dev);
static int bfin_EMAC_send(struct eth_device *dev, volatile void *packet, int length);
static int bfin_EMAC_recv(struct eth_device *dev);
-
-void bfin_EMAC_setup_addr(uchar *enetaddr);
+static int bfin_EMAC_setup_addr(struct eth_device *dev);
#endif