diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-08-08 12:53:17 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-08-08 12:53:17 +0000 |
commit | 7a75092cea4dde772a6c162d5de922b0c618941e (patch) | |
tree | 0d82fd0d2ba4fe48e7173b741cca717fb8b49e9d | |
parent | 9853314bf016aef89ce4521c1fe91917d920910b (diff) |
Make sure hw.revision_id gets initialized before it's used by em_set_mac_type()
and move it back to the location where it was before rev. 1.239, while
keeping the horrible override for em_pchlan. From Holger Mikolon.
ok jsg@, deraadt@
-rw-r--r-- | sys/dev/pci/if_em.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c index 5e58cef0277..eb14257cd78 100644 --- a/sys/dev/pci/if_em.c +++ b/sys/dev/pci/if_em.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_em.c,v 1.243 2010/08/04 17:10:34 jsg Exp $ */ +/* $OpenBSD: if_em.c,v 1.244 2010/08/08 12:53:16 kettenis Exp $ */ /* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */ #include <dev/pci/if_em.h> @@ -1535,6 +1535,9 @@ em_identify_hardware(struct em_softc *sc) sc->hw.vendor_id = PCI_VENDOR(pa->pa_id); sc->hw.device_id = PCI_PRODUCT(pa->pa_id); + reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_CLASS_REG); + sc->hw.revision_id = PCI_REVISION(reg); + reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG); sc->hw.subsystem_vendor_id = PCI_VENDOR(reg); sc->hw.subsystem_id = PCI_PRODUCT(reg); @@ -1545,10 +1548,6 @@ em_identify_hardware(struct em_softc *sc) if (sc->hw.mac_type == em_pchlan) sc->hw.revision_id = PCI_PRODUCT(pa->pa_id) & 0x0f; - else { - reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_CLASS_REG); - sc->hw.revision_id = PCI_REVISION(reg); - } if (sc->hw.mac_type == em_82541 || sc->hw.mac_type == em_82541_rev_2 || |