ieee1394: sbp2: add support for disks >2 TB (and 16 bytes long CDBs)
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Wed, 29 Jul 2009 19:29:13 +0000 (21:29 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 16 Aug 2009 21:26:57 +0000 (14:26 -0700)
Commit ebbb16bffa646f853899ef3fdc0ac7abab888703 upstream.

Increase the command ORB data structure to transport up to 16 bytes long
CDBs (instead of 12 bytes), and tell the SCSI mid layer about it.  This
is notably necessary for READ CAPACITY(16) and friends, i.e. support of
large disks.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/ieee1394/sbp2.c
drivers/ieee1394/sbp2.h

index 0c0fdbb66e233ce4a71305c63cbe7f73472aee38..e21c2d5ef7e8f6dfae21ef5cc23c8aeae7cabedc 100644 (file)
@@ -874,6 +874,7 @@ static struct sbp2_lu *sbp2_alloc_device(struct unit_directory *ud)
        }
 
        shost->hostdata[0] = (unsigned long)lu;
+       shost->max_cmd_len = SBP2_MAX_CDB_SIZE;
 
        if (!scsi_add_host(shost, &ud->device)) {
                lu->shost = shost;
index 875428bc8d2995fc475b332ca596552d1ebbabfa..e547b16e0c672dc43b583173a2e34b79e5ced2b7 100644 (file)
 
 #define SBP2_DEVICE_NAME               "sbp2"
 
+/*
+ * There is no transport protocol limit to the CDB length,  but we implement
+ * a fixed length only.  16 bytes is enough for disks larger than 2 TB.
+ */
+#define SBP2_MAX_CDB_SIZE              16
+
 /*
  * SBP-2 specific definitions
  */
@@ -51,7 +57,7 @@ struct sbp2_command_orb {
        u32 data_descriptor_hi;
        u32 data_descriptor_lo;
        u32 misc;
-       u8 cdb[12];
+       u8 cdb[SBP2_MAX_CDB_SIZE];
 } __attribute__((packed));
 
 #define SBP2_LOGIN_REQUEST             0x0