summaryrefslogtreecommitdiffstats
path: root/drivers/usb/eth
diff options
context:
space:
mode:
authorRene Griessl <rgriessl@cit-ec.uni-bielefeld.de>2015-01-12 17:51:16 +0100
committerMarek Vasut <marex@denx.de>2015-01-18 12:31:36 +0100
commit119339759266b81af1aa8883702b6b651d7752dd (patch)
treed6d3e6785f8f298914e8a2875500deb95827a35a /drivers/usb/eth
parent904f2a83a8c620ceb3974cc6b1529b966d7899b1 (diff)
downloadu-boot-119339759266b81af1aa8883702b6b651d7752dd.tar.gz
u-boot-119339759266b81af1aa8883702b6b651d7752dd.tar.xz
u-boot-119339759266b81af1aa8883702b6b651d7752dd.zip
usb: eth: asix88179: add ability to modify MAC address
This patch enables U-Boot to modify the MAC address of the AX88179. Tested on RECS5250 (similar to Arndale5250) Signed-off-by: Rene Griessl <rgriessl@cit-ec.uni-bielefeld.de>
Diffstat (limited to 'drivers/usb/eth')
-rw-r--r--drivers/usb/eth/asix88179.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/usb/eth/asix88179.c b/drivers/usb/eth/asix88179.c
index b8ca720e25..0ef85db7b5 100644
--- a/drivers/usb/eth/asix88179.c
+++ b/drivers/usb/eth/asix88179.c
@@ -271,6 +271,19 @@ static int asix_read_mac(struct eth_device *eth)
return 0;
}
+static int asix_write_mac(struct eth_device *eth)
+{
+ struct ueth_data *dev = (struct ueth_data *)eth->priv;
+ int ret;
+
+ ret = asix_write_cmd(dev, AX_ACCESS_MAC, AX_NODE_ID, ETH_ALEN,
+ ETH_ALEN, eth->enetaddr);
+ if (ret < 0)
+ debug("Failed to set MAC address: %02x\n", ret);
+
+ return ret;
+}
+
static int asix_basic_reset(struct ueth_data *dev)
{
struct asix_private *dev_priv = (struct asix_private *)dev->dev_priv;
@@ -686,6 +699,7 @@ int ax88179_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
eth->send = asix_send;
eth->recv = asix_recv;
eth->halt = asix_halt;
+ eth->write_hwaddr = asix_write_mac;
eth->priv = ss;
if (asix_basic_reset(ss))