Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb XXX Add a temporary, gruesome hack. It allows t...



details:   https://anonhg.NetBSD.org/src/rev/1442c149c0b9
branches:  trunk
changeset: 480594:1442c149c0b9
user:      augustss <augustss%NetBSD.org@localhost>
date:      Sun Jan 16 13:22:18 2000 +0000

description:
XXX Add a temporary, gruesome hack.  It allows transfers to
XXX be done using delay() instead of tsleep().
XXX This enables transfers to be made from an interrupt context, which
XXX is needed until some more threads are added to the kernel.
XXX Using this hack (which is rare) causes the kernel to busy-wait
XXX for up to 1 ms at splusb().

diffstat:

 sys/dev/usb/usbdi.c |  17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 8e8260f75979 -r 1442c149c0b9 sys/dev/usb/usbdi.c
--- a/sys/dev/usb/usbdi.c       Sun Jan 16 13:14:43 2000 +0000
+++ b/sys/dev/usb/usbdi.c       Sun Jan 16 13:22:18 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdi.c,v 1.54 2000/01/16 09:37:18 augustss Exp $      */
+/*     $NetBSD: usbdi.c,v 1.55 2000/01/16 13:22:18 augustss Exp $      */
 /*     $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $      */
 
 /*
@@ -303,7 +303,20 @@
        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;
+                       for (i = 0; i < xfer->timeout; i += 10) {
+                               delay(10);
+                               bus->methods->do_poll(bus);
+                               if (xfer->done)
+                                       break;
+                       }
+                       if (!xfer->done)
+                               pipe->methods->abort(xfer);
+               } else
+                       tsleep(xfer, PRIBIO, "usbsyn", 0);
        }
        splx(s);
        return (xfer->status);



Home | Main Index | Thread Index | Old Index