summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2011-06-22 10:34:16 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2011-06-22 10:34:16 +0000
commit9d5bb522cac4d1588623738d21ca9608b0680a76 (patch)
tree7bb408740cddd269e7fbb1c34b01a14af13ba985 /sys
parent78dc4e2c794a8e20e035ba3fda31b9bc36d750d9 (diff)
msi support. this is a complicated one...
ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_myx.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/dev/pci/if_myx.c b/sys/dev/pci/if_myx.c
index d5dda5b62ac..05a4de86c42 100644
--- a/sys/dev/pci/if_myx.c
+++ b/sys/dev/pci/if_myx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_myx.c,v 1.24 2011/06/22 08:38:45 jsg Exp $ */
+/* $OpenBSD: if_myx.c,v 1.25 2011/06/22 10:34:15 dlg Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org>
@@ -111,6 +111,7 @@ struct myx_softc {
struct myx_dmamem sc_sts_dma;
volatile struct myx_status *sc_sts;
+ int sc_intx;
void *sc_irqh;
u_int32_t sc_irqcoaloff;
u_int32_t sc_irqclaimoff;
@@ -247,9 +248,12 @@ myx_attach(struct device *parent, struct device *self, void *aux)
goto unmap;
/* Map the interrupt */
- if (pci_intr_map(pa, &sc->sc_ih) != 0) {
- printf(": unable to map interrupt\n");
- goto unmap;
+ if (pci_intr_map_msi(pa, &sc->sc_ih) != 0) {
+ if (pci_intr_map(pa, &sc->sc_ih) != 0) {
+ printf(": unable to map interrupt\n");
+ goto unmap;
+ }
+ sc->sc_intx = 1;
}
printf(": %s, model %s, address %s\n",
@@ -1528,8 +1532,10 @@ myx_intr(void *arg)
}
sts->ms_isvalid = 0;
- data = htobe32(0);
- myx_write(sc, sc->sc_irqdeassertoff, &data, sizeof(data));
+ if (sc->sc_intx) {
+ data = htobe32(0);
+ myx_write(sc, sc->sc_irqdeassertoff, &data, sizeof(data));
+ }
if (!ISSET(ifp->if_flags, IFF_UP) &&
sc->sc_linkdown != sts->ms_linkdown) {