]> Pileus Git - ~andy/linux/blobdiff - drivers/usb/storage/cypress_atacb.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[~andy/linux] / drivers / usb / storage / cypress_atacb.c
index 070b5c0ebbf98d0d822723c4fe04b9ee984c5bf5..8514a2d82b72a2404420cd813f6aebff08e19f57 100644 (file)
@@ -159,7 +159,7 @@ static void cypress_atacb_passthrough(struct scsi_cmnd *srb, struct us_data *us)
        if (srb->result == SAM_STAT_CHECK_CONDITION &&
                        memcmp(srb->sense_buffer, usb_stor_sense_invalidCDB,
                                sizeof(usb_stor_sense_invalidCDB)) == 0) {
-               US_DEBUGP("cypress atacb not supported ???\n");
+               usb_stor_dbg(us, "cypress atacb not supported ???\n");
                goto end;
        }
 
@@ -248,14 +248,26 @@ static int cypress_probe(struct usb_interface *intf,
 {
        struct us_data *us;
        int result;
+       struct usb_device *device;
 
        result = usb_stor_probe1(&us, intf, id,
                        (id - cypress_usb_ids) + cypress_unusual_dev_list);
        if (result)
                return result;
 
-       us->protocol_name = "Transparent SCSI with Cypress ATACB";
-       us->proto_handler = cypress_atacb_passthrough;
+       /* Among CY7C68300 chips, the A revision does not support Cypress ATACB
+        * Filter out this revision from EEPROM default descriptor values
+        */
+       device = interface_to_usbdev(intf);
+       if (device->descriptor.iManufacturer != 0x38 ||
+           device->descriptor.iProduct != 0x4e ||
+           device->descriptor.iSerialNumber != 0x64) {
+               us->protocol_name = "Transparent SCSI with Cypress ATACB";
+               us->proto_handler = cypress_atacb_passthrough;
+       } else {
+               us->protocol_name = "Transparent SCSI";
+               us->proto_handler = usb_stor_transparent_scsi_command;
+       }
 
        result = usb_stor_probe2(us);
        return result;