diff options
author | iedowse <iedowse@FreeBSD.org> | 2005-11-26 17:11:31 +0000 |
---|---|---|
committer | iedowse <iedowse@FreeBSD.org> | 2005-11-26 17:11:31 +0000 |
commit | 35761b145be66c57b4106e70e560cf6cba031133 (patch) | |
tree | a1f8a19cc453669d3f7a2be10a2f37e8d96c79f8 /sys | |
parent | b2bbf4f8ad419c2ffb03ec9002da19d0c41239c6 (diff) | |
download | FreeBSD-src-35761b145be66c57b4106e70e560cf6cba031133.zip FreeBSD-src-35761b145be66c57b4106e70e560cf6cba031133.tar.gz |
Revision 5.0 of the Sony DSC camera appears to require RBC commands
to be padded to 12 bytes in length. Otherwise the requests just
time out.
Reported by: anders
MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/umass.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 71b9f64..b13a047 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -314,6 +314,8 @@ struct umass_devdescr_t { # define NO_INQUIRY 0x0400 /* Device cannot handle INQUIRY EVPD, return CHECK CONDITION */ # define NO_INQUIRY_EVPD 0x0800 + /* Pad all RBC requests to 12 bytes. */ +# define RBC_PAD_TO_12 0x1000 }; Static struct umass_devdescr_t umass_devdescrs[] = { @@ -435,6 +437,10 @@ Static struct umass_devdescr_t umass_devdescrs[] = { UMASS_PROTO_SCSI | UMASS_PROTO_BBB, IGNORE_RESIDUE }, + { USB_VENDOR_SONY, USB_PRODUCT_SONY_DSC, 0x0500, + UMASS_PROTO_RBC | UMASS_PROTO_CBI, + RBC_PAD_TO_12 + }, { USB_VENDOR_SONY, USB_PRODUCT_SONY_DSC, RID_WILDCARD, UMASS_PROTO_RBC | UMASS_PROTO_CBI, NO_QUIRKS @@ -2907,8 +2913,14 @@ umass_rbc_transform(struct umass_softc *sc, unsigned char *cmd, int cmdlen, * appears to support those as well */ case REQUEST_SENSE: case PREVENT_ALLOW: - *rcmd = cmd; /* We don't need to copy it */ - *rcmdlen = cmdlen; + if ((sc->quirks & RBC_PAD_TO_12) && cmdlen < 12) { + *rcmdlen = 12; + bcopy(cmd, *rcmd, cmdlen); + bzero(*rcmd + cmdlen, 12 - cmdlen); + } else { + *rcmd = cmd; /* We don't need to copy it */ + *rcmdlen = cmdlen; + } return 1; /* All other commands are not legal in RBC */ default: |