summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAlbert Lee <albertcc@tw.ibm.com>2007-06-07 15:49:22 +0800
committerJeff Garzik <jeff@garzik.org>2007-06-09 23:08:11 -0400
commit1dce589c38c36ae69614840ee230183f3a7d43c5 (patch)
treeb236f4ee06cca72bc07d88f6fbbf87ddc6b8ab83 /drivers
parentf93f1078d08e0f63a6a4bdaa154de3642fc03d5d (diff)
downloadlinux-3.10-1dce589c38c36ae69614840ee230183f3a7d43c5.tar.gz
linux-3.10-1dce589c38c36ae69614840ee230183f3a7d43c5.tar.bz2
linux-3.10-1dce589c38c36ae69614840ee230183f3a7d43c5.zip
libata passthru: support PIO multi commands
support the pass through of PIO multi commands. Signed-off-by: Albert Lee <albertcc@tw.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/libata-scsi.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index f70431a4c9e..8a66ca5f953 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2551,10 +2551,6 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
if (tf->protocol == ATA_PROT_DMA && dev->dma_mode == 0)
goto invalid_fld;
- if (cdb[1] & 0xe0)
- /* PIO multi not supported yet */
- goto invalid_fld;
-
/*
* 12 and 16 byte CDBs use different offsets to
* provide the various register values.
@@ -2606,6 +2602,22 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
tf->device = qc->dev->devno ?
tf->device | ATA_DEV1 : tf->device & ~ATA_DEV1;
+ /* sanity check for pio multi commands */
+ if ((cdb[1] & 0xe0) && !is_multi_taskfile(tf))
+ goto invalid_fld;
+
+ if (is_multi_taskfile(tf)) {
+ unsigned int multi_count = 1 << (cdb[1] >> 5);
+
+ /* compare the passed through multi_count
+ * with the cached multi_count of libata
+ */
+ if (multi_count != dev->multi_count)
+ ata_dev_printk(dev, KERN_WARNING,
+ "invalid multi_count %u ignored\n",
+ multi_count);
+ }
+
/* READ/WRITE LONG use a non-standard sect_size */
qc->sect_size = ATA_SECT_SIZE;
switch (tf->command) {