diff options
author | n_hibma <n_hibma@FreeBSD.org> | 1999-05-01 23:46:02 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 1999-05-01 23:46:02 +0000 |
commit | 73c36288d4841d05b8824374a254eda877b4dbf0 (patch) | |
tree | 15c66e59b46033c00e7e5da1926682d7d5ec572f /sys/dev/usb | |
parent | 49fc6733477774cd3f967c4d02a5afc838b2a553 (diff) | |
download | FreeBSD-src-73c36288d4841d05b8824374a254eda877b4dbf0.zip FreeBSD-src-73c36288d4841d05b8824374a254eda877b4dbf0.tar.gz |
Clean up uhci_intr. Avoid acknowledging mutliple interrupts with
multiple writes.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/uhci.c | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c index e0afe8f..26ce620 100644 --- a/sys/dev/usb/uhci.c +++ b/sys/dev/usb/uhci.c @@ -654,48 +654,49 @@ uhci_remove_bulk(sc, sqh) } int -uhci_intr(p) - void *p; +uhci_intr(priv) + void *priv; { - uhci_softc_t *sc = p; - int status, ret; + uhci_softc_t *sc = priv; + int status; + int ack = 0; uhci_intr_info_t *ii; sc->sc_intrs++; + #if defined(UHCI_DEBUG) if (uhcidebug > 9) { - DPRINTF(("uhci_intr %p\n", sc)); + printf("%s: uhci_intr\n", USBDEVNAME(sc->sc_bus.bdev)); uhci_dumpregs(sc); } #endif + status = UREAD2(sc, UHCI_STS); - ret = 0; - if (status & UHCI_STS_USBINT) { - UWRITE2(sc, UHCI_STS, UHCI_STS_USBINT); /* acknowledge */ - ret = 1; - } - if (status & UHCI_STS_USBEI) { - UWRITE2(sc, UHCI_STS, UHCI_STS_USBEI); /* acknowledge */ - ret = 1; - } + + if (status & UHCI_STS_USBINT) + ack |= UHCI_STS_USBINT; + if (status & UHCI_STS_USBEI) + ack |= UHCI_STS_USBEI; if (status & UHCI_STS_RD) { - UWRITE2(sc, UHCI_STS, UHCI_STS_RD); /* acknowledge */ - DPRINTF(("%s: resume detect\n", USBDEVNAME(sc->sc_bus.bdev))); - ret = 1; + ack |= UHCI_STS_RD; + printf("%s: resume detect\n", USBDEVNAME(sc->sc_bus.bdev)); } if (status & UHCI_STS_HSE) { - UWRITE2(sc, UHCI_STS, UHCI_STS_HSE); /* acknowledge */ - DPRINTF(("%s: Host System Error\n", USBDEVNAME(sc->sc_bus.bdev))); - ret = 1; + ack |= UHCI_STS_HSE; + printf("%s: Host Controller Process Error\n", USBDEVNAME(sc->sc_bus.bdev)); } if (status & UHCI_STS_HCPE) { - UWRITE2(sc, UHCI_STS, UHCI_STS_HCPE); /* acknowledge */ - DPRINTF(("%s: Host System Error\n", USBDEVNAME(sc->sc_bus.bdev))); - ret = 1; + ack |= UHCI_STS_HCPE; + printf("%s: Host System Error\n", USBDEVNAME(sc->sc_bus.bdev)); } - if (status & UHCI_STS_HCH) - DPRINTF(("%s: controller halted\n", USBDEVNAME(sc->sc_bus.bdev))); - if (!ret) + if (status & UHCI_STS_HCH) { + /* no acknowledge needed */ + printf("%s: controller halted\n", USBDEVNAME(sc->sc_bus.bdev)); + } + + if (ack) /* acknowledge the ints */ + UWRITE2(sc, UHCI_STS, ack); + else /* nothing to acknowledge */ return 0; /* |