aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sungem.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/sungem.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/sungem.c')
-rw-r--r--drivers/net/sungem.c37
1 files changed, 9 insertions, 28 deletions
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 9df1038ec6bb..5da73212ac91 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -64,11 +64,9 @@
64#include <asm/uaccess.h> 64#include <asm/uaccess.h>
65#include <asm/irq.h> 65#include <asm/irq.h>
66 66
67#ifdef __sparc__ 67#ifdef CONFIG_SPARC
68#include <asm/idprom.h> 68#include <asm/idprom.h>
69#include <asm/openprom.h> 69#include <asm/prom.h>
70#include <asm/oplib.h>
71#include <asm/pbm.h>
72#endif 70#endif
73 71
74#ifdef CONFIG_PPC_PMAC 72#ifdef CONFIG_PPC_PMAC
@@ -2846,7 +2844,7 @@ static int gem_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
2846 return rc; 2844 return rc;
2847} 2845}
2848 2846
2849#if (!defined(__sparc__) && !defined(CONFIG_PPC_PMAC)) 2847#if (!defined(CONFIG_SPARC) && !defined(CONFIG_PPC_PMAC))
2850/* Fetch MAC address from vital product data of PCI ROM. */ 2848/* Fetch MAC address from vital product data of PCI ROM. */
2851static int find_eth_addr_in_vpd(void __iomem *rom_base, int len, unsigned char *dev_addr) 2849static int find_eth_addr_in_vpd(void __iomem *rom_base, int len, unsigned char *dev_addr)
2852{ 2850{
@@ -2901,36 +2899,19 @@ static void get_gem_mac_nonobp(struct pci_dev *pdev, unsigned char *dev_addr)
2901 2899
2902static int __devinit gem_get_device_address(struct gem *gp) 2900static int __devinit gem_get_device_address(struct gem *gp)
2903{ 2901{
2904#if defined(__sparc__) || defined(CONFIG_PPC_PMAC) 2902#if defined(CONFIG_SPARC) || defined(CONFIG_PPC_PMAC)
2905 struct net_device *dev = gp->dev; 2903 struct net_device *dev = gp->dev;
2906#endif
2907
2908#if defined(__sparc__)
2909 struct pci_dev *pdev = gp->pdev;
2910 struct pcidev_cookie *pcp = pdev->sysdata;
2911 int use_idprom = 1;
2912
2913 if (pcp != NULL) {
2914 unsigned char *addr;
2915 int len;
2916
2917 addr = of_get_property(pcp->prom_node, "local-mac-address",
2918 &len);
2919 if (addr && len == 6) {
2920 use_idprom = 0;
2921 memcpy(dev->dev_addr, addr, 6);
2922 }
2923 }
2924 if (use_idprom)
2925 memcpy(dev->dev_addr, idprom->id_ethaddr, 6);
2926#elif defined(CONFIG_PPC_PMAC)
2927 const unsigned char *addr; 2904 const unsigned char *addr;
2928 2905
2929 addr = get_property(gp->of_node, "local-mac-address", NULL); 2906 addr = get_property(gp->of_node, "local-mac-address", NULL);
2930 if (addr == NULL) { 2907 if (addr == NULL) {
2908#ifdef CONFIG_SPARC
2909 addr = idprom->id_ethaddr;
2910#else
2931 printk("\n"); 2911 printk("\n");
2932 printk(KERN_ERR "%s: can't get mac-address\n", dev->name); 2912 printk(KERN_ERR "%s: can't get mac-address\n", dev->name);
2933 return -1; 2913 return -1;
2914#endif
2934 } 2915 }
2935 memcpy(dev->dev_addr, addr, 6); 2916 memcpy(dev->dev_addr, addr, 6);
2936#else 2917#else
@@ -3088,7 +3069,7 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
3088 /* On Apple, we want a reference to the Open Firmware device-tree 3069 /* On Apple, we want a reference to the Open Firmware device-tree
3089 * node. We use it for clock control. 3070 * node. We use it for clock control.
3090 */ 3071 */
3091#ifdef CONFIG_PPC_PMAC 3072#if defined(CONFIG_PPC_PMAC) || defined(CONFIG_SPARC)
3092 gp->of_node = pci_device_to_OF_node(pdev); 3073 gp->of_node = pci_device_to_OF_node(pdev);
3093#endif 3074#endif
3094 3075