diff options
author | Albert Lee <albertcc@tw.ibm.com> | 2005-10-12 03:06:27 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-18 17:16:13 -0400 |
commit | 8cbd6df1f0ce977ab7b61feffa59879bb5e0ed8f (patch) | |
tree | c460778581293ad479ec4983690ccc46bcb4df56 /drivers/scsi/libata-scsi.c | |
parent | 07506697d1c615924298406f2357810709c09bcd (diff) |
[PATCH] libata CHS: calculate read/write commands and protocol on the fly (revise #6)
- merge ata_prot_to_cmd() and ata_dev_set_protocol() as
ata_rwcmd_protocol()
- pave road for read/write multiple support
- remove usage of pre-cached command and protocol values and call
ata_rwcmd_protocol() instead
Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
==============
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/scsi/libata-scsi.c')
-rw-r--r-- | drivers/scsi/libata-scsi.c | 13 |
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; |