diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2002-03-15 21:35:29 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2002-03-15 21:35:29 +0000 |
commit | 95b13325476dd5114a97010e5cffb1a38740bb62 (patch) | |
tree | 3c5380a5d82c5f0a0a9878fa7ead2f02790f75bb | |
parent | 56c7eeba0442710df88eec65f8031f4acd84bde4 (diff) |
Try 'local-mac-address' before myetheraddr(). This allows us to correctly
get the mac address on the second ethernet of a Netra T1 AC200; tested by
Joey Coleman <joeycoleman@acm.org>
-rw-r--r-- | sys/dev/pci/if_gem_pci.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/dev/pci/if_gem_pci.c b/sys/dev/pci/if_gem_pci.c index 720f1e70bba..da6e226db4d 100644 --- a/sys/dev/pci/if_gem_pci.c +++ b/sys/dev/pci/if_gem_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_gem_pci.c,v 1.8 2002/03/14 01:26:58 millert Exp $ */ +/* $OpenBSD: if_gem_pci.c,v 1.9 2002/03/15 21:35:28 jason Exp $ */ /* $NetBSD: if_gem_pci.c,v 1.1 2001/09/16 00:11:42 eeh Exp $ */ /* @@ -62,6 +62,10 @@ #include <machine/bus.h> #include <machine/intr.h> +#ifdef __sparc64__ +#include <dev/ofw/openfirm.h> +#endif + #include <dev/mii/mii.h> #include <dev/mii/miivar.h> #include <dev/mii/mii_bitbang.h> @@ -151,16 +155,10 @@ gem_attach_pci(parent, self, aux) sc->sc_bustag = gsc->gsc_memt; sc->sc_h = gsc->gsc_memh; -#if 0 -/* SBUS compatible stuff? */ - sc->sc_seb = gsc->gsc_memh; - sc->sc_etx = gsc->gsc_memh + 0x2000; - sc->sc_erx = gsc->gsc_memh + 0x4000; - sc->sc_mac = gsc->gsc_memh + 0x6000; - sc->sc_mif = gsc->gsc_memh + 0x7000; -#endif #ifdef __sparc__ - myetheraddr(sc->sc_enaddr); + if (OF_getprop(PCITAG_NODE(pa->pa_tag), "local-mac-address", + sc->sc_enaddr, ETHER_ADDR_LEN) <= 0) + myetheraddr(sc->sc_enaddr); #endif #ifdef __powerpc__ pci_ether_hw_addr(pa->pa_pc, sc->sc_enaddr); |