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/8851da8697b7
branches:  trunk
changeset: 812591:8851da8697b7
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 ad8aa548a64c -r 8851da8697b7 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