summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorThomas Chou <thomas@wytron.com.tw>2010-04-27 20:20:27 +0800
committerBen Warren <biggerbadderben@gmail.com>2010-05-03 14:52:50 -0700
commit3ac9d6c650d94c51645efa446c1d914c5440990d (patch)
treea398627778bd944abf77e37b6afdb81d4274d7c1 /drivers/net
parent6c7c444786fc4022999362fce119c8b731eedcb4 (diff)
downloadu-boot-imx-3ac9d6c650d94c51645efa446c1d914c5440990d.zip
u-boot-imx-3ac9d6c650d94c51645efa446c1d914c5440990d.tar.gz
u-boot-imx-3ac9d6c650d94c51645efa446c1d914c5440990d.tar.bz2
net: ethoc: add write_hwaddr support
Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethoc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
index b912e44..34cc47f 100644
--- a/drivers/net/ethoc.c
+++ b/drivers/net/ethoc.c
@@ -215,13 +215,14 @@ static inline void ethoc_write_bd(struct eth_device *dev, int index,
ethoc_write(dev, offset + 4, bd->addr);
}
-static inline void ethoc_set_mac_address(struct eth_device *dev)
+static int ethoc_set_mac_address(struct eth_device *dev)
{
u8 *mac = dev->enetaddr;
ethoc_write(dev, MAC_ADDR0, (mac[2] << 24) | (mac[3] << 16) |
(mac[4] << 8) | (mac[5] << 0));
ethoc_write(dev, MAC_ADDR1, (mac[0] << 8) | (mac[1] << 0));
+ return 0;
}
static inline void ethoc_ack_irq(struct eth_device *dev, u32 mask)
@@ -308,8 +309,6 @@ static int ethoc_init(struct eth_device *dev, bd_t * bd)
struct ethoc *priv = (struct ethoc *)dev->priv;
printf("ethoc\n");
- ethoc_set_mac_address(dev);
-
priv->num_tx = 1;
priv->num_rx = PKTBUFSRX;
ethoc_write(dev, TX_BD_NUM, priv->num_tx);
@@ -504,6 +503,7 @@ int ethoc_initialize(u8 dev_num, int base_addr)
dev->halt = ethoc_halt;
dev->send = ethoc_send;
dev->recv = ethoc_recv;
+ dev->write_hwaddr = ethoc_set_mac_address;
sprintf(dev->name, "%s-%hu", "ETHOC", dev_num);
eth_register(dev);