Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Add a quirk for Olympus C-1. From FreeBSD (by i...



details:   https://anonhg.NetBSD.org/src/rev/e3d693b55a01
branches:  trunk
changeset: 518162:e3d693b55a01
user:      augustss <augustss%NetBSD.org@localhost>
date:      Sun Nov 25 19:15:46 2001 +0000

description:
Add a quirk for Olympus C-1.  From FreeBSD (by iedowse)

diffstat:

 sys/dev/usb/umass.c    |  18 ++++++++++++++++--
 sys/dev/usb/umassvar.h |   8 ++++++--
 2 files changed, 22 insertions(+), 4 deletions(-)

diffs (75 lines):

diff -r e2eaf6d1107d -r e3d693b55a01 sys/dev/usb/umass.c
--- a/sys/dev/usb/umass.c       Sun Nov 25 19:05:22 2001 +0000
+++ b/sys/dev/usb/umass.c       Sun Nov 25 19:15:46 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umass.c,v 1.67 2001/11/25 19:05:22 augustss Exp $      */
+/*     $NetBSD: umass.c,v 1.68 2001/11/25 19:15:46 augustss Exp $      */
 /*-
  * Copyright (c) 1999 MAEKAWA Masahide <bishop%rr.iij4u.or.jp@localhost>,
  *                   Nick Hibma <n_hibma%freebsd.org@localhost>
@@ -94,7 +94,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.67 2001/11/25 19:05:22 augustss Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.68 2001/11/25 19:15:46 augustss Exp $");
 
 #include "atapibus.h"
 
@@ -342,6 +342,15 @@
                sc->quirks |= NO_TEST_UNIT_READY;
        }
 
+       if (UGETW(dd->idVendor) == USB_VENDOR_OLYMPUS &&
+           UGETW(dd->idProduct) == USB_PRODUCT_OLYMPUS_C1) {
+               /*
+                * The Olympus C-1 camera uses a different command-status
+                * signature.
+                */
+               sc->quirks |= WRONG_CSWSIG;
+       }
+
        id = usbd_get_interface_descriptor(iface);
        if (id == NULL || id->bInterfaceClass != UICLASS_MASS)
                return (UMATCH_NONE);
@@ -1205,6 +1214,11 @@
 
                DIF(UDMASS_BBB, umass_bbb_dump_csw(sc, &sc->csw));
 
+               /* Translate weird command-status signatures. */
+               if ((sc->quirks & WRONG_CSWSIG) &&
+                   UGETDW(sc->csw.dCSWSignature) == CSWSIGNATURE_OLYMPUS_C1)
+                       USETDW(sc->csw.dCSWSignature, CSWSIGNATURE);
+
                /* Check CSW and handle any error */
                if (UGETDW(sc->csw.dCSWSignature) != CSWSIGNATURE) {
                        /* Invalid CSW: Wrong signature or wrong tag might
diff -r e2eaf6d1107d -r e3d693b55a01 sys/dev/usb/umassvar.h
--- a/sys/dev/usb/umassvar.h    Sun Nov 25 19:05:22 2001 +0000
+++ b/sys/dev/usb/umassvar.h    Sun Nov 25 19:15:46 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umassvar.h,v 1.4 2001/11/25 19:05:23 augustss Exp $    */
+/*     $NetBSD: umassvar.h,v 1.5 2001/11/25 19:15:47 augustss Exp $    */
 /*-
  * Copyright (c) 1999 MAEKAWA Masahide <bishop%rr.iij4u.or.jp@localhost>,
  *                   Nick Hibma <n_hibma%freebsd.org@localhost>
@@ -93,7 +93,8 @@
 /* Command Status Wrapper */
 typedef struct {
        uDWord          dCSWSignature;
-#define CSWSIGNATURE   0x53425355
+#define CSWSIGNATURE           0x53425355
+#define CSWSIGNATURE_OLYMPUS_C1        0x55425355
        uDWord          dCSWTag;
        uDWord          dCSWDataResidue;
        uByte           bCSWStatus;
@@ -179,6 +180,9 @@
         */
 #define FORCE_SHORT_INQUIRY      0x08
 
+       /* The device uses a weird CSWSIGNATURE. */
+#define WRONG_CSWSIG           0x10
+
        u_int8_t        wire_proto;             /* USB wire protocol */
 #define WPROTO_BBB     1
 #define WPROTO_CBI     2



Home | Main Index | Thread Index | Old Index