Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb More DIAGNOSTIC.



details:   https://anonhg.NetBSD.org/src/rev/5413e1836bea
branches:  trunk
changeset: 484089:5413e1836bea
user:      augustss <augustss%NetBSD.org@localhost>
date:      Sat Mar 25 07:13:05 2000 +0000

description:
More DIAGNOSTIC.
Initialize a callout handle I forgot.

diffstat:

 sys/dev/usb/uhci.c     |  39 ++++++++++++++++++++++++++++-----------
 sys/dev/usb/usbdivar.h |   6 ++++--
 2 files changed, 32 insertions(+), 13 deletions(-)

diffs (113 lines):

diff -r ba5abc53b018 -r 5413e1836bea sys/dev/usb/uhci.c
--- a/sys/dev/usb/uhci.c        Sat Mar 25 06:33:50 2000 +0000
+++ b/sys/dev/usb/uhci.c        Sat Mar 25 07:13:05 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhci.c,v 1.93 2000/03/25 00:11:21 augustss Exp $       */
+/*     $NetBSD: uhci.c,v 1.94 2000/03/25 07:13:05 augustss Exp $       */
 /*     $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $       */
 
 /*
@@ -558,19 +558,25 @@
        usbd_xfer_handle xfer;
 
        xfer = SIMPLEQ_FIRST(&sc->sc_free_xfers);
-       if (xfer != NULL)
+       if (xfer != NULL) {
                SIMPLEQ_REMOVE_HEAD(&sc->sc_free_xfers, xfer, next);
-       else
+               if (xfer->busy_free != XFER_FREE) {
+                       printf("uhci_freex: xfer=%p not free, 0x%08x\n", xfer,
+                              xfer->busy_free);
+               }
+       } else {
                xfer = malloc(sizeof(struct uhci_xfer), M_USB, M_NOWAIT);
+       }
        if (xfer != NULL) {
                memset(xfer, 0, sizeof (struct uhci_xfer));
                UXFER(xfer)->iinfo.sc = sc;
+               usb_callout_init(UXFER(xfer)->iinfo.timeout_handle);
 #ifdef DIAGNOSTIC
                UXFER(xfer)->iinfo.isdone = 1;
 #endif
        }
 #ifdef DIAGNOSTIC
-       xfer->isfree = 0;
+       xfer->busy_free = XFER_BUSY;
 #endif
        return (xfer);
 }
@@ -583,11 +589,19 @@
        struct uhci_softc *sc = (struct uhci_softc *)bus;
 
 #ifdef DIAGNOSTIC
-       if (xfer->isfree) {
-               printf("uhci_freex: xfer=%p already free\n", xfer);
+#ifdef __NetBSD__
+       if (callout_pending(&UXFER(xfer)->iinfo.timeout_handle)) {
+               printf("uhci_free_intr_info: pending callout");
                return;
        }
-       xfer->isfree = 1;
+#endif
+
+       if (xfer->busy_free != XFER_BUSY) {
+               printf("uhci_freex: xfer=%p not busy, 0x%08x\n", xfer,
+                      xfer->busy_free);
+               return;
+       }
+       xfer->busy_free = XFER_FREE;
 #endif
        SIMPLEQ_INSERT_HEAD(&sc->sc_free_xfers, xfer, next);
 }
@@ -2584,8 +2598,9 @@
        DPRINTFN(4, ("uhci_isoc_done: length=%d\n", xfer->actlen));
 
 #ifdef DIAGNOSTIC
-       if (xfer->isfree) {
-               printf("uhci_device_isoc_done: xfer=%p is free\n", xfer);
+       if (xfer->busy_free != XFER_BUSY) {
+               printf("uhci_device_isoc_done: xfer=%p not busy 0x%08x\n",
+                      xfer, xfer->busy_free);
                return;
        }
 
@@ -2820,6 +2835,7 @@
                     pipe, pipe->device->address, 
                     ed->bEndpointAddress, sc->sc_addr));
 
+       usb_callout_init(upipe->abort_timeout);
        upipe->aborting = 0;
        upipe->nexttoggle = 0;
 
@@ -2979,8 +2995,9 @@
        if (err)
                return (err);
 
-       /* Pipe isn't running (otherwise err would be USBD_INPROG),
-        * start first
+       /* 
+        * Pipe isn't running (otherwise err would be USBD_INPROG),
+        * so start it first.
         */
        return (uhci_root_ctrl_start(SIMPLEQ_FIRST(&xfer->pipe->queue)));
 }
diff -r ba5abc53b018 -r 5413e1836bea sys/dev/usb/usbdivar.h
--- a/sys/dev/usb/usbdivar.h    Sat Mar 25 06:33:50 2000 +0000
+++ b/sys/dev/usb/usbdivar.h    Sat Mar 25 07:13:05 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdivar.h,v 1.50 2000/03/25 00:10:19 augustss Exp $   */
+/*     $NetBSD: usbdivar.h,v 1.51 2000/03/25 07:13:05 augustss Exp $   */
 /*     $FreeBSD: src/sys/dev/usb/usbdivar.h,v 1.11 1999/11/17 22:33:51 n_hibma Exp $   */
 
 /*
@@ -181,7 +181,9 @@
        usbd_callback           callback;
        __volatile char         done;
 #ifdef DIAGNOSTIC
-       char                    isfree;
+       u_int32_t               busy_free;
+#define XFER_FREE 0x46524545
+#define XFER_BUSY 0x42555357
 #endif
 
        /* For control pipe */



Home | Main Index | Thread Index | Old Index