From 20c36014e4235ebf662eab671d89adfd8fc67819 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Fri, 26 Jun 2009 19:11:18 +0000 Subject: 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. --- sys/dev/ic/dc.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'sys') 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: -- cgit v1.2.3