Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb fix for Roland/EDIROL UM-880.



details:   https://anonhg.NetBSD.org/src/rev/6d43ee952b6a
branches:  trunk
changeset: 515619:6d43ee952b6a
user:      tshiozak <tshiozak%NetBSD.org@localhost>
date:      Sat Sep 29 22:00:47 2001 +0000

description:
fix for Roland/EDIROL UM-880.
  - add NULL check to UMQ_ISTYPE; sc_quirk is NULL for genuine umidi, but
    forgotten to check.  Thus, kernel will panic after connect the device.
  - fix how to count the number of endpoints in alloc_all_endpoints_genuine().
  - add a quirk for the native mode of UM-880.

diffstat:

 sys/dev/usb/umidi.c        |   5 +++--
 sys/dev/usb/umidi_quirks.c |  19 ++++++++++++++++++-
 sys/dev/usb/umidi_quirks.h |   5 +++--
 3 files changed, 24 insertions(+), 5 deletions(-)

diffs (86 lines):

diff -r b4e4f820ecd9 -r 6d43ee952b6a sys/dev/usb/umidi.c
--- a/sys/dev/usb/umidi.c       Sat Sep 29 22:00:29 2001 +0000
+++ b/sys/dev/usb/umidi.c       Sat Sep 29 22:00:47 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umidi.c,v 1.8 2001/05/28 20:52:06 tshiozak Exp $       */
+/*     $NetBSD: umidi.c,v 1.9 2001/09/29 22:00:47 tshiozak Exp $       */
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -391,6 +391,7 @@
        usbd_status err;
        struct umidi_endpoint *ep;
        int i;
+
        if (UMQ_ISTYPE(sc, UMQ_TYPE_FIXED_EP)) {
                err = alloc_all_endpoints_fixed_ep(sc);
        } else if (UMQ_ISTYPE(sc, UMQ_TYPE_YAMAHA)) {
@@ -646,8 +647,8 @@
                } else if (desc->bDescriptorType==UDESC_CS_ENDPOINT &&
                           remain>=UMIDI_CS_ENDPOINT_DESCRIPTOR_SIZE &&
                           epaddr!=-1) {
-                       num_ep--;
                        if (num_ep>0) {
+                               num_ep--;
                                p->sc = sc;
                                p->addr = epaddr;
                                p->num_jacks = TO_CSEPD(desc)->bNumEmbMIDIJack;
diff -r b4e4f820ecd9 -r 6d43ee952b6a sys/dev/usb/umidi_quirks.c
--- a/sys/dev/usb/umidi_quirks.c        Sat Sep 29 22:00:29 2001 +0000
+++ b/sys/dev/usb/umidi_quirks.c        Sat Sep 29 22:00:47 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umidi_quirks.c,v 1.1 2001/01/30 23:26:48 tshiozak Exp $        */
+/*     $NetBSD: umidi_quirks.c,v 1.2 2001/09/29 22:00:47 tshiozak Exp $        */
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -121,6 +121,22 @@
 };
 
 
+/*
+ * ROLAND UM-880 (native mode)
+ */
+UMQ_FIXED_EP_DEF(ROLAND, ROLAND_UM880N, 0, 1, 1) = {
+       /* out */
+       { 0, 9 },
+       /* in */
+       { 1, 9 }
+};
+
+UMQ_DEF(ROLAND, ROLAND_UM880N, 0) = {
+       UMQ_FIXED_EP_REG(ROLAND, ROLAND_UM880N, 0),
+       UMQ_TERMINATOR
+};
+
+
 
 /*
  * quirk list
@@ -129,6 +145,7 @@
        UMQ_REG(YAMAHA, YAMAHA_UX256, ANYIFACE),
        UMQ_REG(YAMAHA, ANYPRODUCT, ANYIFACE),
        UMQ_REG(ROLAND, ROLAND_UM1, 2),
+       UMQ_REG(ROLAND, ROLAND_UM880N, 0),
        UMQ_TERMINATOR
 };
 
diff -r b4e4f820ecd9 -r 6d43ee952b6a sys/dev/usb/umidi_quirks.h
--- a/sys/dev/usb/umidi_quirks.h        Sat Sep 29 22:00:29 2001 +0000
+++ b/sys/dev/usb/umidi_quirks.h        Sat Sep 29 22:00:47 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umidi_quirks.h,v 1.1 2001/01/30 23:26:48 tshiozak Exp $        */
+/*     $NetBSD: umidi_quirks.h,v 1.2 2001/09/29 22:00:47 tshiozak Exp $        */
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -58,7 +58,8 @@
        struct umq_data         *quirks;
         u_int32_t              type_mask;
 };
-#define UMQ_ISTYPE(q, type) ((sc)->sc_quirk->type_mask & (1<<((type)-1)))
+#define UMQ_ISTYPE(q, type) \
+       ((q)->sc_quirk && ((q)->sc_quirk->type_mask & (1<<((type)-1))))
 
 #define UMQ_TERMINATOR { 0, }
 #define UMQ_DEF(v, p, i)                                       \



Home | Main Index | Thread Index | Old Index