summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>1999-05-30 12:49:39 +0000
committern_hibma <n_hibma@FreeBSD.org>1999-05-30 12:49:39 +0000
commit6dc9d0ed10ee69e634f3fdfd4d5bd97f3a6464ba (patch)
tree1daac46187a9e230767d415227b772fd2aaff08c
parent678ee57ac43a401a3aeb2644429792fc440ec926 (diff)
downloadFreeBSD-src-6dc9d0ed10ee69e634f3fdfd4d5bd97f3a6464ba.zip
FreeBSD-src-6dc9d0ed10ee69e634f3fdfd4d5bd97f3a6464ba.tar.gz
- When aborting an interrupt pipe, just wait for 1ms for the completion
of the current interrupt trasaction. - Do not schedule the next interrupt transaction if the pipe is being aborted or the last round of the interrupt transaction ended with error. Submitted by: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
-rw-r--r--sys/dev/usb/uhci.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index 52cc9aa..b27cb00 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -332,6 +332,7 @@ uhci_init(sc)
UHCI_FRAMELIST_ALIGN, &dma);
if (r != USBD_NORMAL_COMPLETION)
return (r);
+
sc->sc_pframes = KERNADDR(&dma);
UWRITE2(sc, UHCI_FRNUM, 0); /* set frame number to 0 */
UWRITE4(sc, UHCI_FLBASEADDR, DMAADDR(&dma)); /* set frame list */
@@ -749,7 +750,6 @@ uhci_check_intr(sc, ii)
if (ii->stdend->td->td_status & UHCI_TD_ACTIVE) {
for (std = ii->stdstart; std != ii->stdend; std = std->td->link.std){
status = std->td->td_status;
- DPRINTF(("status=0x%04x\n", status));
if ((status & UHCI_TD_STALLED) ||
(status & (UHCI_TD_SPD | UHCI_TD_ACTIVE)) == UHCI_TD_SPD)
goto done;
@@ -1471,16 +1471,12 @@ void
uhci_device_intr_abort(reqh)
usbd_request_handle reqh;
{
- struct uhci_pipe *upipe;
-
DPRINTFN(1, ("uhci_device_intr_abort: reqh=%p\n", reqh));
- /* XXX inactivate */
- usb_delay_ms(reqh->pipe->device->bus, 2); /* make sure it is done */
if (reqh->pipe->intrreqh == reqh) {
DPRINTF(("uhci_device_intr_abort: remove\n"));
reqh->pipe->intrreqh = 0;
- upipe = (struct uhci_pipe *)reqh->pipe;
- uhci_intr_done(upipe->u.intr.qhs[0]->intr_info);
+ /* make sure it is done */
+ usb_delay_ms(reqh->pipe->device->bus, 2);
}
}
@@ -1859,7 +1855,8 @@ uhci_intr_done(ii)
uhci_free_std_chain(sc, ii->stdstart, 0);
/* XXX Wasteful. */
- if (reqh->pipe->intrreqh == reqh) {
+ if (reqh->pipe->intrreqh == reqh
+ && reqh->status == USBD_NORMAL_COMPLETION) {
uhci_soft_td_t *xfer, *xferend;
/* This alloc cannot fail since we freed the chain above. */
@@ -1889,7 +1886,6 @@ uhci_intr_done(ii)
} else {
usb_freemem(sc->sc_dmatag, dma);
ii->stdstart = 0; /* mark as inactive */
- usb_start_next(reqh->pipe);
}
}
OpenPOWER on IntegriCloud