diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-01-21 02:42:50 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-01-21 02:42:50 +0000 |
commit | 6477cdd194ae18d13182fbd04f7d056334a5dcd8 (patch) | |
tree | 841389c6ca2cc7a111ca5335c431d37351fe8ac9 /sys/dev/pci/uhci_pci.c | |
parent | 9153c6da4864458de4076f912e7545d78398b878 (diff) |
map and establish interrupts _after_ chip was initialized
and driver has allocated it's internal data structures.
deraadt@ ok
Diffstat (limited to 'sys/dev/pci/uhci_pci.c')
-rw-r--r-- | sys/dev/pci/uhci_pci.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/sys/dev/pci/uhci_pci.c b/sys/dev/pci/uhci_pci.c index 97aa3eb27bc..3678bc01b98 100644 --- a/sys/dev/pci/uhci_pci.c +++ b/sys/dev/pci/uhci_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhci_pci.c,v 1.8 2000/07/04 13:21:59 fgsch Exp $ */ +/* $OpenBSD: uhci_pci.c,v 1.9 2001/01/21 02:42:49 mickey Exp $ */ /* $NetBSD: uhci_pci.c,v 1.14 2000/01/25 11:26:06 augustss Exp $ */ /* @@ -120,24 +120,6 @@ uhci_pci_attach(parent, self, aux) pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, csr | PCI_COMMAND_MASTER_ENABLE); - /* Map and establish the interrupt. */ - if (pci_intr_map(pc, pa->pa_intrtag, pa->pa_intrpin, - pa->pa_intrline, &ih)) { - printf(": couldn't map interrupt\n"); - return; - } - intrstr = pci_intr_string(pc, ih); - sc->sc_ih = pci_intr_establish(pc, ih, IPL_USB, uhci_intr, sc, - sc->sc.sc_bus.bdev.dv_xname); - if (sc->sc_ih == NULL) { - printf(": couldn't establish interrupt"); - if (intrstr != NULL) - printf(" at %s", intrstr); - printf("\n"); - return; - } - printf(": %s\n", intrstr); - /* Verify that the PIRQD enable bit is set, some BIOS's don't do that*/ legsup = pci_conf_read(pc, pa->pa_tag, PCI_LEGSUP); if (!(legsup & PCI_LEGSUP_USBPIRQDEN)) { @@ -166,9 +148,27 @@ uhci_pci_attach(parent, self, aux) return; } + /* Map and establish the interrupt. */ + if (pci_intr_map(pc, pa->pa_intrtag, pa->pa_intrpin, + pa->pa_intrline, &ih)) { + printf(": couldn't map interrupt\n"); + return; + } + intrstr = pci_intr_string(pc, ih); + sc->sc_ih = pci_intr_establish(pc, ih, IPL_USB, uhci_intr, sc, + sc->sc.sc_bus.bdev.dv_xname); + if (sc->sc_ih == NULL) { + printf(": couldn't establish interrupt"); + if (intrstr != NULL) + printf(" at %s", intrstr); + printf("\n"); + return; + } + printf(": %s\n", intrstr); + /* Attach usb device. */ sc->sc.sc_child = config_found((void *)sc, &sc->sc.sc_bus, - usbctlprint); + usbctlprint); } int |