diff options
Diffstat (limited to 'drivers/net/sungem.c')
-rw-r--r-- | drivers/net/sungem.c | 37 |
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. */ |
2851 | static int find_eth_addr_in_vpd(void __iomem *rom_base, int len, unsigned char *dev_addr) | 2849 | static 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 | ||
2902 | static int __devinit gem_get_device_address(struct gem *gp) | 2900 | static 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 | ||