summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2001-11-23 17:35:35 +0000
committeriedowse <iedowse@FreeBSD.org>2001-11-23 17:35:35 +0000
commit1d5e042937b176d831548ada0a5cc90c3ab425d7 (patch)
tree559f5c38431abc70171be9326e6c67eb17125ea6
parentd8f0ad876ab2eaf419e43d6c6c2525222a78868b (diff)
downloadFreeBSD-src-1d5e042937b176d831548ada0a5cc90c3ab425d7.zip
FreeBSD-src-1d5e042937b176d831548ada0a5cc90c3ab425d7.tar.gz
The Olympus C-1 digital camera uses a non-standard BBB command-status
signature, but otherwise behaves just like a normal USB mass-storage device. Add a new quirk to cover this case, and enable it for C-1 cameras. The quirk enables translation from the C-1 signature to the normal CSWSIGNATURE value. Reviewed by: n_hibma
-rw-r--r--sys/dev/usb/umass.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c
index 6b8cfd9..bd3aaa1 100644
--- a/sys/dev/usb/umass.c
+++ b/sys/dev/usb/umass.c
@@ -206,6 +206,7 @@ typedef struct {
typedef struct {
uDWord dCSWSignature;
# define CSWSIGNATURE 0x53425355
+# define CSWSIGNATURE_OLYMPUS_C1 0x55425355
uDWord dCSWTag;
uDWord dCSWDataResidue;
uByte bCSWStatus;
@@ -298,6 +299,8 @@ struct umass_softc {
* Yano ATAPI-USB
*/
# define FORCE_SHORT_INQUIRY 0x08
+ /* The device uses a weird CSWSIGNATURE. */
+# define WRONG_CSWSIG 0x10
unsigned int proto;
# define PROTO_UNKNOWN 0x0000 /* unknown protocol */
@@ -673,6 +676,15 @@ umass_match_proto(struct umass_softc *sc, usbd_interface_handle iface,
*/
sc->transfer_speed = 500;
}
+
+ 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;
+ }
switch (id->bInterfaceSubClass) {
case USUBCLASS_SCSI:
@@ -1448,6 +1460,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
OpenPOWER on IntegriCloud