Commit 11933975 authored by Rene Griessl's avatar Rene Griessl Committed by Marek Vasut
Browse files

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: default avatarRene Griessl <rgriessl@cit-ec.uni-bielefeld.de>
parent 904f2a83
...@@ -271,6 +271,19 @@ static int asix_read_mac(struct eth_device *eth) ...@@ -271,6 +271,19 @@ static int asix_read_mac(struct eth_device *eth)
return 0; 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) static int asix_basic_reset(struct ueth_data *dev)
{ {
struct asix_private *dev_priv = (struct asix_private *)dev->dev_priv; 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, ...@@ -686,6 +699,7 @@ int ax88179_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
eth->send = asix_send; eth->send = asix_send;
eth->recv = asix_recv; eth->recv = asix_recv;
eth->halt = asix_halt; eth->halt = asix_halt;
eth->write_hwaddr = asix_write_mac;
eth->priv = ss; eth->priv = ss;
if (asix_basic_reset(ss)) if (asix_basic_reset(ss))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment