summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/uhci.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/uhci.c')
-rw-r--r--sys/dev/usb/uhci.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index 8d754b8..efc86a2 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -1062,16 +1062,27 @@ uhci_check_intr(sc, ii)
DPRINTFN(15, ("uhci_check_intr: active ii=%p\n", ii));
for (std = ii->stdstart; std != lstd; std = std->link.std) {
status = LE(std->td.td_status);
- if ((status & UHCI_TD_STALLED) ||
- (status & (UHCI_TD_SPD | UHCI_TD_ACTIVE)) ==
- UHCI_TD_SPD)
+ /* If there's an active TD the xfer isn't done. */
+ if (status & UHCI_TD_ACTIVE)
+ break;
+ /* Any kind of error makes the xfer done. */
+ if (status & UHCI_TD_STALLED)
+ goto done;
+ /*
+ * We want short packets,
+ * and it is short: it's done
+ */
+ if ((status & UHCI_TD_SPD) &&
+ UHCI_TD_GET_ACTLEN(status) <
+ UHCI_TD_GET_MAXLEN(LE(std->td.td_token)))
goto done;
}
DPRINTFN(15, ("uhci_check_intr: ii=%p std=%p still active\n",
- ii, ii->stdstart));
+ ii, ii->stdstart));
return;
}
- done:
+done:
+
usb_untimeout(uhci_timeout, ii, ii->timeout_handle);
uhci_idone(ii);
}
OpenPOWER on IntegriCloud