diff options
| author | Josef Karthauser <joe@FreeBSD.org> | 2002-04-02 14:54:52 +0000 |
|---|---|---|
| committer | Josef Karthauser <joe@FreeBSD.org> | 2002-04-02 14:54:52 +0000 |
| commit | 86cf1335d502876c29db6dfaa518e05b73c852fb (patch) | |
| tree | f51022b9d0c37f6487ccba7596376cd14452c1b2 /sys/dev/usb/usbdi.c | |
| parent | b784ffe91a96a9f419cfe56c02cf30b809e4c95b (diff) | |
Notes
Diffstat (limited to 'sys/dev/usb/usbdi.c')
| -rw-r--r-- | sys/dev/usb/usbdi.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index 7fcfb4bd9f06..4bf3a13c5ecb 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi.c,v 1.80 2001/04/13 11:19:58 augustss Exp $ */ +/* $NetBSD: usbdi.c,v 1.79 2001/01/21 02:39:53 augustss Exp $ */ /* $FreeBSD$ */ /* @@ -294,7 +294,28 @@ usbd_transfer(usbd_xfer_handle xfer) if (!xfer->done) { if (pipe->device->bus->use_polling) panic("usbd_transfer: not done\n"); - tsleep(xfer, PRIBIO, "usbsyn", 0); + /* XXX Temporary hack XXX */ + if (xfer->flags & USBD_NO_TSLEEP) { + int i; + usbd_bus_handle bus = pipe->device->bus; + int to = xfer->timeout * 1000; + DPRINTFN(2,("usbd_transfer: polling\n")); + for (i = 0; i < to; i += 10) { + delay(10); + bus->methods->do_poll(bus); + if (xfer->done) + break; + } + DPRINTFN(2,("usbd_transfer: polling done =\n", + xfer->done)); + /* XXX Is this right, what about the HC timeout? */ + if (!xfer->done) { + pipe->methods->abort(xfer); + xfer->status = USBD_TIMEOUT; + } + } else + /* XXX End hack XXX */ + tsleep(xfer, PRIBIO, "usbsyn", 0); } splx(s); return (xfer->status); |
