summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/if_em.c
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2010-06-27 20:13:04 +0000
committerjsg <jsg@openbsd.org>2010-06-27 20:13:04 +0000
commitf852dd1c18a058cecea2d1405edbbbef59f9a5bd (patch)
tree71d5b7cb5da239fc8d83b83df98fe7bf4e411051 /sys/dev/pci/if_em.c
parentFix a crash when the directory entry isn't complete. (diff)
downloadwireguard-openbsd-f852dd1c18a058cecea2d1405edbbbef59f9a5bd.tar.xz
wireguard-openbsd-f852dd1c18a058cecea2d1405edbbbef59f9a5bd.zip
More PCH/82577 bits from FreeBSD, this does not include
all the workarounds but is enough to make things run at faster than 10 Mbit speeds, though these aren't always reflecting in ifmedia properly just yet. ok claudio@
Diffstat (limited to 'sys/dev/pci/if_em.c')
-rw-r--r--sys/dev/pci/if_em.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index fc75b239b21..2c13e27faf0 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.238 2010/06/21 21:11:52 jsg Exp $ */
+/* $OpenBSD: if_em.c,v 1.239 2010/06/27 20:13:04 jsg Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -1533,9 +1533,6 @@ 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);
@@ -1544,6 +1541,13 @@ em_identify_hardware(struct em_softc *sc)
if (em_set_mac_type(&sc->hw))
printf("%s: Unknown MAC Type\n", sc->sc_dv.dv_xname);
+ 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 ||
sc->hw.mac_type == em_82547 ||