Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/dev/lib/libugenhc * allow one more request



details:   https://anonhg.NetBSD.org/src/rev/196cbc38bfcc
branches:  trunk
changeset: 752168:196cbc38bfcc
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Feb 17 20:39:53 2010 +0000

description:
* allow one more request
* print warning if a request which might fail, fails
* report error from bulk transfers

diffstat:

 sys/rump/dev/lib/libugenhc/ugenhc.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (51 lines):

diff -r 6884fb064b7d -r 196cbc38bfcc sys/rump/dev/lib/libugenhc/ugenhc.c
--- a/sys/rump/dev/lib/libugenhc/ugenhc.c       Wed Feb 17 18:55:14 2010 +0000
+++ b/sys/rump/dev/lib/libugenhc/ugenhc.c       Wed Feb 17 20:39:53 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ugenhc.c,v 1.1 2010/02/11 02:22:09 pooka Exp $ */
+/*     $NetBSD: ugenhc.c,v 1.2 2010/02/17 20:39:53 pooka Exp $ */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ugenhc.c,v 1.1 2010/02/11 02:22:09 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ugenhc.c,v 1.2 2010/02/17 20:39:53 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -491,6 +491,7 @@
        case C(0x22, UT_WRITE_CLASS_INTERFACE):
        case C(0x0a, UT_WRITE_CLASS_INTERFACE):
        case C(UR_SET_FEATURE, UT_WRITE_CLASS_OTHER):
+       case C(UR_SET_FEATURE, UT_WRITE_DEVICE):
        case C(UR_CLEAR_FEATURE, UT_WRITE_CLASS_OTHER):
        case C(UR_SET_REPORT, UT_WRITE_CLASS_INTERFACE):
        case C(UR_CLEAR_FEATURE, UT_WRITE_ENDPOINT):
@@ -501,10 +502,12 @@
                ucr.ucr_data = buf;
                if (rumpuser_ioctl(sc->sc_ugenfd[UGEN_EPT_CTRL],
                    USB_DO_REQUEST, &ucr, &ru_error) == -1) {
-                       if (!mightfail)
+                       if (!mightfail) {
                                panic("request failed: %d", ru_error);
-                       else
+                       } else {
                                err = ru_error;
+                               printf("warning: request failed: %d\n", err);
+                       }
                }
                }
                break;
@@ -719,7 +722,9 @@
        }
  out:
        val = 0;
+       error = 0;
        rumpuser_ioctl(sc->sc_ugenfd[endpt], USB_SET_SHORT_XFER, &val, &error);
+       xfer->status = error;
        usb_transfer_complete(xfer);
        return (USBD_IN_PROGRESS);
 }



Home | Main Index | Thread Index | Old Index