summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/uhci.c
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2000-01-28 02:15:31 +0000
committerwpaul <wpaul@FreeBSD.org>2000-01-28 02:15:31 +0000
commit10d6a2ddbb724c01ef1314f818671049f0708816 (patch)
treea1981c5e777b282c38e9aff4acf94e539bec6377 /sys/dev/usb/uhci.c
parent607f2f5aee4abee8c590d3c89fb3e4ee377c5ffc (diff)
downloadFreeBSD-src-10d6a2ddbb724c01ef1314f818671049f0708816.zip
FreeBSD-src-10d6a2ddbb724c01ef1314f818671049f0708816.tar.gz
Fix a bug in the uhci driver that breaks large bulk IN transfers. The
uhci_check_intr() routine needs to be more careful about deciding when the end of a transfer has been detected. This allows me to remove the nasty workaround code from if_aue and if_cue. Receive performance is now much better for these adapters (500KB/sec vs. 350KB/sec). Also removed unused KUE_CUTOFF define from if_kuereg.h. Submitted by: Lennart Augustsson Reviewed by: n_hibma
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