diff options
author | n_hibma <n_hibma@FreeBSD.org> | 2000-01-26 08:46:41 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 2000-01-26 08:46:41 +0000 |
commit | 4a29dd1cc9c6cafad16282641b92dd12b7a7ec01 (patch) | |
tree | 64b5bff5399897e1b8b3dba1de07cd640858b576 | |
parent | a67280b2ce3330fea1a0e36e05ae8291e599e6ec (diff) | |
download | FreeBSD-src-4a29dd1cc9c6cafad16282641b92dd12b7a7ec01.zip FreeBSD-src-4a29dd1cc9c6cafad16282641b92dd12b7a7ec01.tar.gz |
Add comments
-rw-r--r-- | sys/dev/usb/ohci.c | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c index 595a597..e42d60f 100644 --- a/sys/dev/usb/ohci.c +++ b/sys/dev/usb/ohci.c @@ -970,20 +970,41 @@ ohci_intr1(sc) intrs = 0; done = LE(sc->sc_hcca->hcca_done_head); + + /* The LSb of done is used to inform the HC Driver that an interrupt + * condition exists for both the Done list and for another event + * recorded in HcInterruptStatus. On an interrupt from the HC, the HC + * Driver checks the HccaDoneHead Value. If this value is 0, then the + * interrupt was caused by other than the HccaDoneHead update and the + * HcInterruptStatus register needs to be accessed to determine that + * exact interrupt cause. If HccaDoneHead is nonzero, then a Done list + * update interrupt is indicated and if the LSb of done is nonzero, + * then an additional interrupt event is indicated and + * HcInterruptStatus should be checked to determine its cause. + */ if (done != 0) { sc->sc_hcca->hcca_done_head = 0; if (done & ~OHCI_DONE_INTRS) intrs = OHCI_WDH; - if (done & OHCI_DONE_INTRS) + if (done & OHCI_DONE_INTRS) { intrs |= OREAD4(sc, OHCI_INTERRUPT_STATUS); - } else + done &= ~OHCI_DONE_INTRS; + } + } else { intrs = OREAD4(sc, OHCI_INTERRUPT_STATUS); + } - if (!intrs) + if (intrs == 0) { + /* nothing to be done ?! */ return (0); + } + + intrs &= ~OHCI_MIE; /* mask out Master Interrupt Enable */ + + /* Acknowledge any interrupts that have happened */ + OWRITE4(sc, OHCI_INTERRUPT_STATUS, intrs); - intrs &= ~OHCI_MIE; - OWRITE4(sc, OHCI_INTERRUPT_STATUS, intrs); /* Acknowledge */ + /* Any interrupts we had enabled? */ eintrs = intrs & sc->sc_eintrs; if (!eintrs) return (0); @@ -1000,7 +1021,7 @@ ohci_intr1(sc) intrs &= ~OHCI_SO; } if (eintrs & OHCI_WDH) { - ohci_process_done(sc, done &~ OHCI_DONE_INTRS); + ohci_process_done(sc, done); intrs &= ~OHCI_WDH; } if (eintrs & OHCI_RD) { |