summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/if_dc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c
index 6068194..ac095cd 100644
--- a/sys/pci/if_dc.c
+++ b/sys/pci/if_dc.c
@@ -131,6 +131,11 @@ __FBSDID("$FreeBSD$");
#include <pci/if_dcreg.h>
+#ifdef __sparc64__
+#include <dev/ofw/openfirm.h>
+#include <machine/ofw_machdep.h>
+#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_attach(device_t dev)
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);
OpenPOWER on IntegriCloud