Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Remove sparc specific code, rely on device prope...



details:   https://anonhg.NetBSD.org/src/rev/8a163e526bf7
branches:  trunk
changeset: 751013:8a163e526bf7
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Jan 21 16:14:39 2010 +0000

description:
Remove sparc specific code, rely on device properties instead

diffstat:

 sys/dev/pci/if_tlp_pci.c |  34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diffs (69 lines):

diff -r f51526ec1be4 -r 8a163e526bf7 sys/dev/pci/if_tlp_pci.c
--- a/sys/dev/pci/if_tlp_pci.c  Thu Jan 21 15:58:32 2010 +0000
+++ b/sys/dev/pci/if_tlp_pci.c  Thu Jan 21 16:14:39 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_tlp_pci.c,v 1.115 2009/09/01 21:46:53 jmcneill Exp $        */
+/*     $NetBSD: if_tlp_pci.c,v 1.116 2010/01/21 16:14:39 martin Exp $  */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tlp_pci.c,v 1.115 2009/09/01 21:46:53 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tlp_pci.c,v 1.116 2010/01/21 16:14:39 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -57,9 +57,6 @@
 
 #include <sys/bus.h>
 #include <sys/intr.h>
-#ifdef __sparc__
-#include <machine/promlib.h>
-#endif
 
 #include <dev/mii/miivar.h>
 #include <dev/mii/mii_bitbang.h>
@@ -645,7 +642,7 @@
                 * XXX dependent wart from the PCI front-end.
                 */
                ea = prop_dictionary_get(device_properties(self),
-                                        "mac-addr");
+                                        "mac-address");
                if (ea != NULL) {
                        extern int tlp_srom_debug;
                        KASSERT(prop_object_type(ea) == PROP_TYPE_DATA);
@@ -930,17 +927,20 @@
                 * multi-port boards).
                 */
                if (!tlp_isv_srom_enaddr(sc, enaddr)) {
-#ifdef __sparc__
-                       if ((sc->sc_srom[20] == 0 &&
-                            sc->sc_srom[21] == 0 &&
-                            sc->sc_srom[22] == 0) ||
-                           (sc->sc_srom[20] == 0xff &&
-                            sc->sc_srom[21] == 0xff &&
-                            sc->sc_srom[22] == 0xff)) {
-                               prom_getether(PCITAG_NODE(pa->pa_tag), enaddr);
-                       } else
-#endif
-                       memcpy(enaddr, &sc->sc_srom[20], ETHER_ADDR_LEN);
+
+                       prop_data_t eaddrprop;
+
+                       eaddrprop = prop_dictionary_get(
+                               device_properties(self), "mac-address");
+
+                       if (eaddrprop != NULL
+                           && prop_data_size(eaddrprop) == ETHER_ADDR_LEN)
+                               memcpy(enaddr,
+                                   prop_data_data_nocopy(eaddrprop),
+                                   ETHER_ADDR_LEN);
+                       else
+                               memcpy(enaddr, &sc->sc_srom[20],
+                                   ETHER_ADDR_LEN);
                }
 
                /*



Home | Main Index | Thread Index | Old Index