diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-05-25 04:39:39 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-05-25 04:39:39 -0400 |
commit | 6c7b7d2b7615110edbc4ea7816831c13b0250ebb (patch) | |
tree | 63c408afb9290dbcaac53f46f3c1b6b19910bc70 /drivers/ata | |
parent | ddfc87a098a0172ad13ce50edf55d5fe266f1352 (diff) |
[libata] Fix decoding of 6-byte commands
The code for parsing 6-byte SCSI command LBAs
missed the top 5 bits (the MSB).
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/libata-scsi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 242c43eef807..b3900cfbd880 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -1050,14 +1050,15 @@ static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc) | |||
1050 | static void scsi_6_lba_len(const u8 *cdb, u64 *plba, u32 *plen) | 1050 | static void scsi_6_lba_len(const u8 *cdb, u64 *plba, u32 *plen) |
1051 | { | 1051 | { |
1052 | u64 lba = 0; | 1052 | u64 lba = 0; |
1053 | u32 len = 0; | 1053 | u32 len; |
1054 | 1054 | ||
1055 | VPRINTK("six-byte command\n"); | 1055 | VPRINTK("six-byte command\n"); |
1056 | 1056 | ||
1057 | lba |= ((u64)(cdb[1] & 0x1f)) << 16; | ||
1057 | lba |= ((u64)cdb[2]) << 8; | 1058 | lba |= ((u64)cdb[2]) << 8; |
1058 | lba |= ((u64)cdb[3]); | 1059 | lba |= ((u64)cdb[3]); |
1059 | 1060 | ||
1060 | len |= ((u32)cdb[4]); | 1061 | len = cdb[4]; |
1061 | 1062 | ||
1062 | *plba = lba; | 1063 | *plba = lba; |
1063 | *plen = len; | 1064 | *plen = len; |