summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-01-08 06:03:00 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-01-08 06:03:00 +0000
commitee672b4ec5d07fbefb74848011c2a4ad045e3d10 (patch)
tree509f9634bf9310012f57e503418a8f7980eddcd3 /sys
parent9d4e7136b55e386dc10fdbb5b98970754ad2c4da (diff)
rev 1.125
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. From FreeBSD Thanks to David Snyder <dasnyderx at yahoo dot com> for testing on a AN983 based card which used to come up with a MAC address of ff:ff:ff:ff:ff:ff.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/dc.c8
-rw-r--r--sys/dev/pci/if_dc_pci.c8
2 files changed, 10 insertions, 6 deletions
diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c
index 23e1fb7d557..b8bd247de92 100644
--- a/sys/dev/ic/dc.c
+++ b/sys/dev/ic/dc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dc.c,v 1.77 2004/12/17 02:26:27 brad Exp $ */
+/* $OpenBSD: dc.c,v 1.78 2005/01/08 06:02:59 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -1657,8 +1657,10 @@ dc_attach(sc)
break;
case DC_TYPE_AL981:
case DC_TYPE_AN983:
- bcopy(&sc->dc_srom[DC_AL_EE_NODEADDR], &sc->sc_arpcom.ac_enaddr,
- ETHER_ADDR_LEN);
+ *(u_int32_t *)(&sc->sc_arpcom.ac_enaddr[0]) =
+ CSR_READ_4(sc, DC_AL_PAR0);
+ *(u_int16_t *)(&sc->sc_arpcom.ac_enaddr[4]) =
+ CSR_READ_4(sc, DC_AL_PAR1);
break;
case DC_TYPE_XIRCOM:
break;
diff --git a/sys/dev/pci/if_dc_pci.c b/sys/dev/pci/if_dc_pci.c
index e372f42d82a..f839eb92286 100644
--- a/sys/dev/pci/if_dc_pci.c
+++ b/sys/dev/pci/if_dc_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_dc_pci.c,v 1.45 2004/09/28 16:58:56 brad Exp $ */
+/* $OpenBSD: if_dc_pci.c,v 1.46 2005/01/08 06:02:59 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -345,6 +345,8 @@ void dc_pci_attach(parent, self, aux)
sc->dc_flags |= DC_TX_USE_TX_INTR;
sc->dc_flags |= DC_TX_ADMTEK_WAR;
sc->dc_pmode = DC_PMODE_MII;
+ dc_eeprom_width(sc);
+ dc_read_srom(sc, sc->dc_romwidth);
}
if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ADMTEK_AN983) {
found = 1;
@@ -353,9 +355,9 @@ void dc_pci_attach(parent, self, aux)
sc->dc_flags |= DC_TX_ADMTEK_WAR;
sc->dc_flags |= DC_64BIT_HASH;
sc->dc_pmode = DC_PMODE_MII;
+ dc_eeprom_width(sc);
+ /* Don't read SROM for - auto-loaded on reset */
}
- dc_eeprom_width(sc);
- dc_read_srom(sc, sc->dc_romwidth);
break;
case PCI_VENDOR_MACRONIX:
case PCI_VENDOR_ACCTON: