Index: pci/if_dc.c =================================================================== RCS file: /space/ncvs/src/sys/pci/if_dc.c,v retrieving revision 1.137 diff -u -r1.137 if_dc.c --- pci/if_dc.c 6 Dec 2003 02:29:31 -0000 1.137 +++ pci/if_dc.c 7 Jan 2004 23:32:51 -0000 @@ -131,6 +131,11 @@ #include +#ifdef __sparc64__ +#include +#include +#endif + MODULE_DEPEND(dc, pci, 1, 1, 1); MODULE_DEPEND(dc, ether, 1, 1, 1); MODULE_DEPEND(dc, miibus, 1, 1, 1); @@ -2106,6 +2111,19 @@ dc_read_eeprom(sc, (caddr_t)&eaddr, 0, 3, 1); break; case DC_TYPE_DM9102: + dc_read_eeprom(sc, (caddr_t)&eaddr, DC_EE_NODEADDR, 3, 0); +#ifdef __sparc64__ + /* + * If this is an onboard dc(4) the station address read from + * the EEPROM is all zero and we have to get it from the fcode. + */ + for (i = 0; i < ETHER_ADDR_LEN; i++) + if (eaddr[i] != 0x00) + break; + if (i >= ETHER_ADDR_LEN && OF_getetheraddr2(dev, eaddr) == -1) + OF_getetheraddr(dev, eaddr); +#endif + break; case DC_TYPE_21143: case DC_TYPE_ASIX: dc_read_eeprom(sc, (caddr_t)&eaddr, DC_EE_NODEADDR, 3, 0); Index: sparc64/include/ofw_machdep.h =================================================================== RCS file: /space/ncvs/src/sys/sparc64/include/ofw_machdep.h,v retrieving revision 1.3 diff -u -r1.3 ofw_machdep.h --- sparc64/include/ofw_machdep.h 2 Sep 2003 20:32:12 -0000 1.3 +++ sparc64/include/ofw_machdep.h 7 Jan 2004 21:31:14 -0000 @@ -32,6 +32,7 @@ int OF_decode_addr(phandle_t, int *, bus_addr_t *); void OF_getetheraddr(device_t, u_char *); +int OF_getetheraddr2(device_t, u_char *); void cpu_shutdown(void *); void openfirmware_exit(void *); Index: sparc64/sparc64/ofw_machdep.c =================================================================== RCS file: /space/ncvs/src/sys/sparc64/sparc64/ofw_machdep.c,v retrieving revision 1.6 diff -u -r1.6 ofw_machdep.c --- sparc64/sparc64/ofw_machdep.c 26 Dec 2003 14:30:19 -0000 1.6 +++ sparc64/sparc64/ofw_machdep.c 7 Jan 2004 23:44:38 -0000 @@ -29,6 +29,8 @@ * Some OpenFirmware helper functions that are likely machine dependent. */ +#include "opt_ofw_pci.h" + #include #include @@ -56,6 +58,21 @@ if (node <= 0 || OF_getprop(node, "idprom", &idp, sizeof(idp)) == -1) panic("Could not determine the machine ethernet address"); bcopy(&idp.id_ether, addr, ETHER_ADDR_LEN); +} + +int +OF_getetheraddr2(device_t dev, u_char *addr) +{ + phandle_t node; + +#ifdef OFW_NEWPCI + node = ofw_pci_get_node(dev); +#else + node = ofw_pci_node(dev); +#endif + if (node <= 0) + return (-1); + return (OF_getprop(node, "local-mac-address", addr, ETHER_ADDR_LEN)); } int