summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorle <le@FreeBSD.org>2004-07-19 20:49:02 +0000
committerle <le@FreeBSD.org>2004-07-19 20:49:02 +0000
commit9c4b73ba32efaac59b6256a1ac77668165f87fed (patch)
treec8f571c3becda663c404c813f6be58d966acc42a /sys
parent60a6d65c03d3c6854fe163b7ff696b378712b2cc (diff)
downloadFreeBSD-src-9c4b73ba32efaac59b6256a1ac77668165f87fed.zip
FreeBSD-src-9c4b73ba32efaac59b6256a1ac77668165f87fed.tar.gz
Diff reduction to NetBSD.
usbdi.c rev. 1.104, author: mycroft ugen_isoc_rintr() may recycle the xfer immediately. Therefore, we avoid touching the xfer after calling the callback in usb_transfer_complete(). From PR 25960.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/usbdi.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c
index ece049d..1a0c7ad 100644
--- a/sys/dev/usb/usbdi.c
+++ b/sys/dev/usb/usbdi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: usbdi.c,v 1.103 2002/09/27 15:37:38 provos Exp $ */
+/* $NetBSD: usbdi.c,v 1.104 2004/07/17 20:16:13 mycroft Exp $ */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -758,6 +758,9 @@ usb_transfer_complete(usbd_xfer_handle xfer)
{
usbd_pipe_handle pipe = xfer->pipe;
usb_dma_t *dmap = &xfer->dmabuf;
+ int sync = xfer->flags & USBD_SYNCHRONOUS;
+ int erred = xfer->status == USBD_CANCELLED ||
+ xfer->status == USBD_TIMEOUT;
int repeat = pipe->repeat;
int polling;
@@ -842,14 +845,12 @@ usb_transfer_complete(usbd_xfer_handle xfer)
pipe->methods->done(xfer);
#endif
- if ((xfer->flags & USBD_SYNCHRONOUS) && !polling)
+ if (sync && !polling)
wakeup(xfer);
if (!repeat) {
/* XXX should we stop the queue on all errors? */
- if ((xfer->status == USBD_CANCELLED ||
- xfer->status == USBD_TIMEOUT) &&
- pipe->iface != NULL) /* not control pipe */
+ if (erred && pipe->iface != NULL) /* not control pipe */
pipe->running = 0;
else
usbd_start_next(pipe);
OpenPOWER on IntegriCloud