summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/uhci.c
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2004-08-11 04:21:44 +0000
committerdlg <dlg@openbsd.org>2004-08-11 04:21:44 +0000
commit8c777c3a98e854e549b0d105018eeebb4f6e9a29 (patch)
treef4e18a93f0bf31e6898fff68f42ea591310185d4 /sys/dev/usb/uhci.c
parentfrom netbsd-bugs, pr 26547: (diff)
downloadwireguard-openbsd-8c777c3a98e854e549b0d105018eeebb4f6e9a29.tar.xz
wireguard-openbsd-8c777c3a98e854e549b0d105018eeebb4f6e9a29.zip
from netbsd, uhci.c revision 1.176
Ignore a CRCTO error on a SETUP transaction in combination with STALLED or NAK. This fixes problems with the GL641.
Diffstat (limited to 'sys/dev/usb/uhci.c')
-rw-r--r--sys/dev/usb/uhci.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index 5cca24f927a..2aed4158471 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhci.c,v 1.32 2004/07/11 05:29:16 deraadt Exp $ */
+/* $OpenBSD: uhci.c,v 1.33 2004/08/11 04:21:44 dlg Exp $ */
/* $NetBSD: uhci.c,v 1.172 2003/02/23 04:19:26 simonb Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -1426,8 +1426,17 @@ uhci_idone(uhci_intr_info_t *ii)
status = nstatus;
if (UHCI_TD_GET_PID(le32toh(std->td.td_token)) !=
- UHCI_TD_PID_SETUP)
+ UHCI_TD_PID_SETUP)
actlen += UHCI_TD_GET_ACTLEN(status);
+ else {
+ /*
+ * UHCI will report CRCTO in addition to a STALL or NAK
+ * for a SETUP transaction. See section 3.2.2, "TD
+ * CONTROL AND STATUS".
+ */
+ if (status & (UHCI_TD_STALLED | UHCI_TD_NAK))
+ status &= ~UHCI_TD_CRCTO;
+ }
}
/* If there are left over TDs we need to update the toggle. */
if (std != NULL)