Don't read the MAC address from a copy of the EEPROM in the softc

that has been recorded earlier and overwrite it again later by
reading it directly from the EEPROM again.

Read the MAC address from the PAR0/PAR1 registers instead, which
are autoloaded on reboot.

Tested on AN985, AN983B. According to the datasheets, it should
also work for the AL981 (I don't have such a chip on a card at home)

PR:             52988
Submitted by:   Andrew Gordon <arg-bsd@arg.me.uk>
MFC after:      2 weeks
This commit is contained in:
Martin Blapp 2003-09-16 05:01:27 +00:00
parent 0c6d0171e6
commit 129eaf7996
2 changed files with 6 additions and 8 deletions

View File

@ -1957,7 +1957,7 @@ dc_attach(device_t dev)
sc->dc_flags |= DC_TX_USE_TX_INTR;
sc->dc_flags |= DC_TX_ADMTEK_WAR;
sc->dc_pmode = DC_PMODE_MII;
dc_read_srom(sc, sc->dc_romwidth);
/* Don't read SROM for - auto-loaded on reset */
break;
case DC_DEVICEID_98713:
case DC_DEVICEID_98713_CP:
@ -2091,9 +2091,8 @@ dc_attach(device_t dev)
break;
case DC_TYPE_AL981:
case DC_TYPE_AN985:
bcopy(sc->dc_srom + DC_AL_EE_NODEADDR, &eaddr,
ETHER_ADDR_LEN);
dc_read_eeprom(sc, (caddr_t)&eaddr, DC_AL_EE_NODEADDR, 3, 0);
*(u_int32_t *)(&eaddr[0]) = CSR_READ_4(sc, DC_AL_PAR0);
*(u_int16_t *)(&eaddr[4]) = CSR_READ_4(sc, DC_AL_PAR1);
break;
case DC_TYPE_CONEXANT:
bcopy(sc->dc_srom + DC_CONEXANT_EE_NODEADDR, &eaddr,

View File

@ -1957,7 +1957,7 @@ dc_attach(device_t dev)
sc->dc_flags |= DC_TX_USE_TX_INTR;
sc->dc_flags |= DC_TX_ADMTEK_WAR;
sc->dc_pmode = DC_PMODE_MII;
dc_read_srom(sc, sc->dc_romwidth);
/* Don't read SROM for - auto-loaded on reset */
break;
case DC_DEVICEID_98713:
case DC_DEVICEID_98713_CP:
@ -2091,9 +2091,8 @@ dc_attach(device_t dev)
break;
case DC_TYPE_AL981:
case DC_TYPE_AN985:
bcopy(sc->dc_srom + DC_AL_EE_NODEADDR, &eaddr,
ETHER_ADDR_LEN);
dc_read_eeprom(sc, (caddr_t)&eaddr, DC_AL_EE_NODEADDR, 3, 0);
*(u_int32_t *)(&eaddr[0]) = CSR_READ_4(sc, DC_AL_PAR0);
*(u_int16_t *)(&eaddr[4]) = CSR_READ_4(sc, DC_AL_PAR1);
break;
case DC_TYPE_CONEXANT:
bcopy(sc->dc_srom + DC_CONEXANT_EE_NODEADDR, &eaddr,