summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2003-08-11 04:52:41 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2003-08-11 04:52:41 +0000
commit3e33bf5684527d729d6f8a0f413ae5c8fdeebaf4 (patch)
treefa6aa0dfc36defc4a44994b0dc6c7dcb5bbbe4b0 /sys
parent2834a9006111e44b1e46874adf41b23a95ba8b0b (diff)
make sure to not attach the card if the int cannot be established and repair the dmesg outputs
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_le_pci.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/sys/dev/pci/if_le_pci.c b/sys/dev/pci/if_le_pci.c
index d8647df313e..7bbea454a7e 100644
--- a/sys/dev/pci/if_le_pci.c
+++ b/sys/dev/pci/if_le_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_le_pci.c,v 1.20 2003/06/02 23:28:03 millert Exp $ */
+/* $OpenBSD: if_le_pci.c,v 1.21 2003/08/11 04:52:40 mickey Exp $ */
/* $NetBSD: if_le_pci.c,v 1.13 1996/10/25 21:33:32 cgd Exp $ */
/*-
@@ -209,7 +209,22 @@ le_pci_attach(parent, self, aux)
sc->sc_mem = kva;
bzero(sc->sc_mem, PCNET_MEMSIZE);
- printf("\n");
+ /* Map and establish the interrupt. */
+ if (pci_intr_map(pa, &ih)) {
+ printf(": couldn't map interrupt\n");
+ return;
+ }
+ intrstr = pci_intr_string(pc, ih);
+ lesc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, am7990_intr, sc,
+ sc->sc_dev.dv_xname);
+ if (lesc->sc_ih == NULL) {
+ printf(": couldn't establish interrupt");
+ if (intrstr != NULL)
+ printf(" at %s", intrstr);
+ printf("\n");
+ return;
+ }
+ printf(": %s\n", intrstr);
lesc->sc_iot = iot;
lesc->sc_ioh = ioh;
@@ -237,22 +252,4 @@ le_pci_attach(parent, self, aux)
PCI_COMMAND_STATUS_REG);
pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
csr | PCI_COMMAND_MASTER_ENABLE);
-
- /* Map and establish the interrupt. */
- if (pci_intr_map(pa, &ih)) {
- printf("%s: couldn't map interrupt\n", sc->sc_dev.dv_xname);
- return;
- }
- intrstr = pci_intr_string(pc, ih);
- lesc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, am7990_intr, sc,
- sc->sc_dev.dv_xname);
- if (lesc->sc_ih == NULL) {
- printf("%s: couldn't establish interrupt",
- sc->sc_dev.dv_xname);
- if (intrstr != NULL)
- printf(" at %s", intrstr);
- printf("\n");
- return;
- }
- printf("%s: interrupting at %s\n", sc->sc_dev.dv_xname, intrstr);
}