diff options
author | Marian Rotariu <marian.rotariu@freescale.com> | 2013-11-06 16:21:52 (GMT) |
---|---|---|
committer | J. German Rivera <German.Rivera@freescale.com> | 2013-11-14 19:21:44 (GMT) |
commit | 1454e5494020d5377c5f26343032393afd94d595 (patch) | |
tree | ddd19de27bc3d6ef1b054265c207de98350a9087 /drivers/net/ethernet/freescale/dpa | |
parent | bc45838cfff13521f1bb95c011223107db30985e (diff) | |
download | linux-fsl-qoriq-1454e5494020d5377c5f26343032393afd94d595.tar.xz |
dpaa_eth: fix MAC address for macless interface
If a macless interface controls a MAC device it should ignore the
"local-mac-address" attribute from the device tree and use the 'native' MAC
address. The 'native' MAC address is the address that is set by uboot at kernel
boot-up.
Change-Id: Ie387ea5d82dd0cd5292439a66d09a182fd4b9a8a
Signed-off-by: Marian Rotariu <marian.rotariu@freescale.com>
Reviewed-on: http://git.am.freescale.net:8181/6313
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Cristian-Constantin Sovaiala <Cristian.Sovaiala@freescale.com>
Reviewed-by: Ruxandra Ioana Radulescu <ruxandra.radulescu@freescale.com>
Reviewed-by: Thomas Trefny <Tom.Trefny@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/dpa')
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c index 87215c3..119f891 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c @@ -217,21 +217,26 @@ static int dpa_macless_netdev_init(struct device_node *dpa_node, net_dev->netdev_ops = &dpa_macless_ops; - /* Get the MAC address */ - mac_addr = of_get_mac_address(dpa_node); - if (mac_addr == NULL) { - if (netif_msg_probe(priv)) - dev_err(dev, "No MAC address found!\n"); - return -EINVAL; - } - if (proxy_dev) { struct mac_device *mac_dev = proxy_dev->mac_dev; net_dev->mem_start = mac_dev->res->start; net_dev->mem_end = mac_dev->res->end; - } - return dpa_netdev_init(dpa_node, net_dev, mac_addr, tx_timeout); + return dpa_netdev_init(dpa_node, net_dev, mac_dev->addr, + tx_timeout); + } else { + /* Get the MAC address from device tree */ + mac_addr = of_get_mac_address(dpa_node); + + if (mac_addr == NULL) { + if (netif_msg_probe(priv)) + dev_err(dev, "No MAC address found!\n"); + return -EINVAL; + } + + return dpa_netdev_init(dpa_node, net_dev, mac_addr, + tx_timeout); + } } /* Probing of FQs for MACless ports */ |