diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-06-26 19:11:18 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-06-26 19:11:18 +0000 |
commit | 20c36014e4235ebf662eab671d89adfd8fc67819 (patch) | |
tree | ab45e351b971b916ad176fb010ce28a6adf4c7d6 /sys/dev/ic | |
parent | af288356a195a6b9427c4daebbdedd9c9b2c71f7 (diff) |
If we are going to move to the eeprom-based MAC address finding instead of
CIS-based... some newer devices have the MAC address at offset 8 instead of
offset 3. But we can tell by the first three octets, Intel says.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/dc.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c index 0e0ab657965..3c4701be4ba 100644 --- a/sys/dev/ic/dc.c +++ b/sys/dev/ic/dc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dc.c,v 1.110 2009/06/26 16:58:46 deraadt Exp $ */ +/* $OpenBSD: dc.c,v 1.111 2009/06/26 19:11:17 deraadt Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -1651,6 +1651,17 @@ dc_attach(struct dc_softc *sc) &sc->sc_arpcom.ac_enaddr, ETHER_ADDR_LEN); break; case DC_TYPE_XIRCOM: + /* Some newer units have the MAC at offset 8 */ + dc_read_eeprom(sc, (caddr_t)&sc->sc_arpcom.ac_enaddr, 8, 3, 0); + + if (sc->sc_arpcom.ac_enaddr[0] == 0x00 && + sc->sc_arpcom.ac_enaddr[1] == 0x10 && + sc->sc_arpcom.ac_enaddr[2] == 0xa4) + break; + if (sc->sc_arpcom.ac_enaddr[0] == 0x00 && + sc->sc_arpcom.ac_enaddr[1] == 0x80 && + sc->sc_arpcom.ac_enaddr[2] == 0xc7) + break; dc_read_eeprom(sc, (caddr_t)&sc->sc_arpcom.ac_enaddr, 3, 3, 0); break; default: |