- 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>
This commit is contained in:
Nick Hibma 1999-05-30 12:49:39 +00:00
parent c9efdb87e8
commit 12788196b1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=47621

View File

@ -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);
}
}