summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2008-10-11 13:51:36 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2008-10-11 13:51:36 +0000
commit93577e9c9777ad5e801491d988d6022282075570 (patch)
tree9ec3d5402956631f2a525a5688a2eff1ba63e08b /sys
parent3ad13bc361dd6c334cb54cbd4090ff84b38c81cf (diff)
For none interrupt endpoints call the xfer done function before
calling the xfer callback function to allow a device driver to immediately reschedule the same xfer. This e.g. improves performance for isoc high- fullspeed xfers (ehci). From NetBSD. OK phessler@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/usbdi.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c
index 0f5f50e39ca..cbc1b536028 100644
--- a/sys/dev/usb/usbdi.c
+++ b/sys/dev/usb/usbdi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdi.c,v 1.36 2008/06/26 05:42:19 ray Exp $ */
+/* $OpenBSD: usbdi.c,v 1.37 2008/10/11 13:51:35 mglocker Exp $ */
/* $NetBSD: usbdi.c,v 1.103 2002/09/27 15:37:38 provos Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */
@@ -801,17 +801,15 @@ usb_transfer_complete(usbd_xfer_handle xfer)
xfer->status = USBD_SHORT_XFER;
}
- if (xfer->callback)
- xfer->callback(xfer, xfer->priv, xfer->status);
-
-#ifdef DIAGNOSTIC
- if (pipe->methods->done != NULL)
+ if (repeat) {
+ if (xfer->callback)
+ xfer->callback(xfer, xfer->priv, xfer->status);
pipe->methods->done(xfer);
- else
- printf("usb_transfer_complete: pipe->methods->done == NULL\n");
-#else
- pipe->methods->done(xfer);
-#endif
+ } else {
+ pipe->methods->done(xfer);
+ if (xfer->callback)
+ xfer->callback(xfer, xfer->priv, xfer->status);
+ }
if ((xfer->flags & USBD_SYNCHRONOUS) && !polling)
wakeup(xfer);