aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r--drivers/net/tg3.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 38383e4e07a1..9488f49ea569 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -47,10 +47,9 @@
47#include <asm/byteorder.h> 47#include <asm/byteorder.h>
48#include <asm/uaccess.h> 48#include <asm/uaccess.h>
49 49
50#ifdef CONFIG_SPARC64 50#ifdef CONFIG_SPARC
51#include <asm/idprom.h> 51#include <asm/idprom.h>
52#include <asm/oplib.h> 52#include <asm/prom.h>
53#include <asm/pbm.h>
54#endif 53#endif
55 54
56#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) 55#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
@@ -10987,24 +10986,20 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10987 return err; 10986 return err;
10988} 10987}
10989 10988
10990#ifdef CONFIG_SPARC64 10989#ifdef CONFIG_SPARC
10991static int __devinit tg3_get_macaddr_sparc(struct tg3 *tp) 10990static int __devinit tg3_get_macaddr_sparc(struct tg3 *tp)
10992{ 10991{
10993 struct net_device *dev = tp->dev; 10992 struct net_device *dev = tp->dev;
10994 struct pci_dev *pdev = tp->pdev; 10993 struct pci_dev *pdev = tp->pdev;
10995 struct pcidev_cookie *pcp = pdev->sysdata; 10994 struct device_node *dp = pci_device_to_OF_node(pdev);
10996 10995 const unsigned char *addr;
10997 if (pcp != NULL) { 10996 int len;
10998 unsigned char *addr; 10997
10999 int len; 10998 addr = of_get_property(dp, "local-mac-address", &len);
11000 10999 if (addr && len == 6) {
11001 addr = of_get_property(pcp->prom_node, "local-mac-address", 11000 memcpy(dev->dev_addr, addr, 6);
11002 &len); 11001 memcpy(dev->perm_addr, dev->dev_addr, 6);
11003 if (addr && len == 6) { 11002 return 0;
11004 memcpy(dev->dev_addr, addr, 6);
11005 memcpy(dev->perm_addr, dev->dev_addr, 6);
11006 return 0;
11007 }
11008 } 11003 }
11009 return -ENODEV; 11004 return -ENODEV;
11010} 11005}
@@ -11025,7 +11020,7 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
11025 u32 hi, lo, mac_offset; 11020 u32 hi, lo, mac_offset;
11026 int addr_ok = 0; 11021 int addr_ok = 0;
11027 11022
11028#ifdef CONFIG_SPARC64 11023#ifdef CONFIG_SPARC
11029 if (!tg3_get_macaddr_sparc(tp)) 11024 if (!tg3_get_macaddr_sparc(tp))
11030 return 0; 11025 return 0;
11031#endif 11026#endif