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
This commit is contained in:
iedowse 2005-11-26 17:11:31 +00:00
parent b2bbf4f8ad
commit 35761b145b

View File

@ -314,6 +314,8 @@ struct umass_devdescr_t {
# define NO_INQUIRY 0x0400 # define NO_INQUIRY 0x0400
/* Device cannot handle INQUIRY EVPD, return CHECK CONDITION */ /* Device cannot handle INQUIRY EVPD, return CHECK CONDITION */
# define NO_INQUIRY_EVPD 0x0800 # 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[] = { Static struct umass_devdescr_t umass_devdescrs[] = {
@ -435,6 +437,10 @@ Static struct umass_devdescr_t umass_devdescrs[] = {
UMASS_PROTO_SCSI | UMASS_PROTO_BBB, UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
IGNORE_RESIDUE 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, { USB_VENDOR_SONY, USB_PRODUCT_SONY_DSC, RID_WILDCARD,
UMASS_PROTO_RBC | UMASS_PROTO_CBI, UMASS_PROTO_RBC | UMASS_PROTO_CBI,
NO_QUIRKS NO_QUIRKS
@ -2907,8 +2913,14 @@ umass_rbc_transform(struct umass_softc *sc, unsigned char *cmd, int cmdlen,
* appears to support those as well */ * appears to support those as well */
case REQUEST_SENSE: case REQUEST_SENSE:
case PREVENT_ALLOW: case PREVENT_ALLOW:
*rcmd = cmd; /* We don't need to copy it */ if ((sc->quirks & RBC_PAD_TO_12) && cmdlen < 12) {
*rcmdlen = cmdlen; *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; return 1;
/* All other commands are not legal in RBC */ /* All other commands are not legal in RBC */
default: default: