Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Improve debug/comments (mostly from nhusb)



details:   https://anonhg.NetBSD.org/src/rev/f61a4d6fea80
branches:  trunk
changeset: 342449:f61a4d6fea80
user:      skrll <skrll%NetBSD.org@localhost>
date:      Tue Dec 22 15:12:39 2015 +0000

description:
Improve debug/comments (mostly from nhusb)

diffstat:

 sys/dev/usb/usbdi.c |  19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diffs (44 lines):

diff -r 1dea5c2d0584 -r f61a4d6fea80 sys/dev/usb/usbdi.c
--- a/sys/dev/usb/usbdi.c       Tue Dec 22 14:31:36 2015 +0000
+++ b/sys/dev/usb/usbdi.c       Tue Dec 22 15:12:39 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdi.c,v 1.166 2015/12/22 13:37:01 skrll Exp $        */
+/*     $NetBSD: usbdi.c,v 1.167 2015/12/22 15:12:39 skrll Exp $        */
 
 /*
  * Copyright (c) 1998, 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.166 2015/12/22 13:37:01 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.167 2015/12/22 15:12:39 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -326,17 +326,18 @@
        }
 
        if (!(flags & USBD_SYNCHRONOUS)) {
-               USBHIST_LOG(usbdebug, "<- done xfer %p, not sync", xfer, 0, 0,
-                   0);
+               USBHIST_LOG(usbdebug, "<- done xfer %p, not sync (err %d)",
+                   xfer, err, 0, 0);
+               return (err);
+       }
+
+       if (err != USBD_IN_PROGRESS) {
+               USBHIST_LOG(usbdebug, "<- done xfer %p, not in progress "
+                   "(err %d)", xfer, err, 0, 0);
                return (err);
        }
 
        /* Sync transfer, wait for completion. */
-       if (err != USBD_IN_PROGRESS) {
-               USBHIST_LOG(usbdebug, "<- done xfer %p, not in progress", xfer,
-                   0, 0, 0);
-               return (err);
-       }
        usbd_lock_pipe(pipe);
        while (!xfer->done) {
                if (pipe->device->bus->use_polling)



Home | Main Index | Thread Index | Old Index