aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/libata-scsi.c')
-rw-r--r--drivers/scsi/libata-scsi.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index ea7a4d8a6fc9..90bf22204668 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -742,15 +742,10 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd)
742 u32 n_block; 742 u32 n_block;
743 743
744 tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; 744 tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
745 tf->protocol = qc->dev->xfer_protocol;
746 745
747 if (scsicmd[0] == READ_10 || scsicmd[0] == READ_6 || 746 if (scsicmd[0] == WRITE_10 || scsicmd[0] == WRITE_6 ||
748 scsicmd[0] == READ_16) { 747 scsicmd[0] == WRITE_16)
749 tf->command = qc->dev->read_cmd;
750 } else {
751 tf->command = qc->dev->write_cmd;
752 tf->flags |= ATA_TFLAG_WRITE; 748 tf->flags |= ATA_TFLAG_WRITE;
753 }
754 749
755 /* Calculate the SCSI LBA and transfer length. */ 750 /* Calculate the SCSI LBA and transfer length. */
756 switch (scsicmd[0]) { 751 switch (scsicmd[0]) {
@@ -812,6 +807,8 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd)
812 tf->device |= (block >> 24) & 0xf; 807 tf->device |= (block >> 24) & 0xf;
813 } 808 }
814 809
810 ata_rwcmd_protocol(qc);
811
815 qc->nsect = n_block; 812 qc->nsect = n_block;
816 tf->nsect = n_block & 0xff; 813 tf->nsect = n_block & 0xff;
817 814
@@ -828,6 +825,8 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd)
828 if ((block >> 28) || (n_block > 256)) 825 if ((block >> 28) || (n_block > 256))
829 goto out_of_range; 826 goto out_of_range;
830 827
828 ata_rwcmd_protocol(qc);
829
831 /* Convert LBA to CHS */ 830 /* Convert LBA to CHS */
832 track = (u32)block / dev->sectors; 831 track = (u32)block / dev->sectors;
833 cyl = track / dev->heads; 832 cyl = track / dev->heads;