Skip to content

Commit

Permalink
ucc_geth: Add support to local-mac-address property
Browse files Browse the repository at this point in the history
IEEE-1275 defines “local-mac-address” to be a standard
property name to specify preassigned network address.
This patch adds support for it.

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Li Yang authored and Jeff Garzik committed Feb 9, 2007
1 parent a1862a5 commit 9b4c7a4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/net/ucc_geth.c
Original file line number Diff line number Diff line change
Expand Up @@ -4072,6 +4072,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
static int mii_mng_configured = 0;
const phandle *ph;
const unsigned int *prop;
const void *mac_addr;

ugeth_vdbg("%s: IN", __FUNCTION__);

Expand Down Expand Up @@ -4197,7 +4198,12 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma

ugeth->ug_info = ug_info;
ugeth->dev = dev;
memcpy(dev->dev_addr, get_property(np, "mac-address", NULL), 6);

mac_addr = get_property(np, "mac-address", NULL);
if (mac_addr == NULL)
mac_addr = get_property(np, "local-mac-address", NULL);
if (mac_addr)
memcpy(dev->dev_addr, mac_addr, 6);

return 0;
}
Expand Down

0 comments on commit 9b4c7a4

Please sign in to comment.