aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-27 12:29:04 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-27 12:29:04 -0400
commit0278ef8b484a71917bd4f03a763285cdaac10954 (patch)
tree8f6f7bf2e2a85b4643dfe3d0475811ce858fb4fc /drivers/net/tg3.c
parent15c54033964a943de7b0763efd3bd0ede7326395 (diff)
parentcd9ad58d4061494e7fdd70ded7bcf2418daf356a (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6: (67 commits) [SCSI] SUNESP: Complete driver rewrite to version 2.0 [SPARC64]: Convert PCI over to generic struct iommu/strbuf. [SPARC]: device_node name constification fallout [SPARC64]: Convert SBUS over to generic iommu/strbuf structs. [SPARC64]: Add generic iommu and strbuf structs to iommu.h [SPARC64]: Consolidate {sbus,pci}_iommu_arena. [SPARC]: Make device_node name and type const [SPARC64]: constify some paramaters of OF routines [TIGON3]: of_get_property() returns const. [SPARC64]: Fix PCI rework to adhere to of_get_property() const return. [SPARC64]: Document and fix calculation of pages_avail. [SPARC64]: Make sure pbm->prom_node is setup easly enough in psycho.c [SPARC64]: Use bootmem_bootmap_pages() in choose_bootmap_pfn(). [SPARC64]: Add proper header file extern for cmdline_memory_size. [SPARC64]: Kill sparc_ultra_dump_{i,d}tlb() [SPARC64]: Use DECLARE_BITMAP and BITS_TO_LONGS in mm/init.c [SPARC64]: Give move verbose show_mem() output just like i386. [SPARC64]: Mark show_mem() printk's with KERN_INFO. [SPARC64]: Kill kvaddr_to_phys() and friends. [SPARC64]: Privatize sun4u_get_pte() and fix name. ...
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