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

This commit is contained in:
augustss 2001-11-25 19:15:46 +00:00
parent 596224e54f
commit a6ba091eef
2 changed files with 22 additions and 4 deletions

View File

@ -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>,
* Nick Hibma <n_hibma@freebsd.org>
@ -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 @@ umass_match_proto(struct umass_softc *sc, usbd_interface_handle iface,
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 @@ umass_bbb_state(usbd_xfer_handle xfer, usbd_private_handle priv,
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

View File

@ -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>,
* Nick Hibma <n_hibma@freebsd.org>
@ -93,7 +93,8 @@ typedef struct {
/* 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 @@ struct umass_softc {
*/
#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