summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2011-06-16 13:21:01 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2011-06-16 13:21:01 +0000
commitf6c1166490ee88b46d9cc40d098a6a9d88289b6c (patch)
tree7f57d61972900c0d10745faf74d0f68ad24cf1ce /sys/dev
parent09b0811c85636b91f73e766e924a7a1a2cb71d9d (diff)
Enable MSI on newish PCIe hardware, essentially everything handled by the Linux
e1000e driver (which enables MSI as well), leaving everything handled by the old Linux e1000 driver (which doesn't enable MSI) use legacy interrupts. tested by many; ok jsg@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_em.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index 8cf06db115e..d3e7b5b545c 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.257 2011/06/03 13:06:06 kettenis Exp $ */
+/* $OpenBSD: if_em.c,v 1.258 2011/06/16 13:21:00 kettenis Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -329,6 +329,10 @@ em_attach(struct device *parent, struct device *self, void *aux)
/* Determine hardware revision */
em_identify_hardware(sc);
+ /* Only use MSIe on the newer PCIe parts */
+ if (sc->hw.mac_type < em_82571)
+ pa->pa_flags &= ~PCI_FLAGS_MSI_ENABLED;
+
/* Parameters (to be read from user) */
if (sc->hw.mac_type >= em_82544) {
sc->num_tx_desc = EM_MAX_TXD;
@@ -1615,7 +1619,7 @@ em_allocate_pci_resources(struct em_softc *sc)
}
}
- if (pci_intr_map(pa, &ih)) {
+ if (pci_intr_map_msi(pa, &ih) && pci_intr_map(pa, &ih)) {
printf(": couldn't map interrupt\n");
return (ENXIO);
}