aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlbert Lee <albertcc@tw.ibm.com>2007-06-07 03:49:22 -0400
committerJeff Garzik <jeff@garzik.org>2007-06-09 23:08:11 -0400
commit1dce589c38c36ae69614840ee230183f3a7d43c5 (patch)
treeb236f4ee06cca72bc07d88f6fbbf87ddc6b8ab83 /drivers
parentf93f1078d08e0f63a6a4bdaa154de3642fc03d5d (diff)
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 f70431a4c9e9..8a66ca5f9530 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)
2551 if (tf->protocol == ATA_PROT_DMA && dev->dma_mode == 0) 2551 if (tf->protocol == ATA_PROT_DMA && dev->dma_mode == 0)
2552 goto invalid_fld; 2552 goto invalid_fld;
2553 2553
2554 if (cdb[1] & 0xe0)
2555 /* PIO multi not supported yet */
2556 goto invalid_fld;
2557
2558 /* 2554 /*
2559 * 12 and 16 byte CDBs use different offsets to 2555 * 12 and 16 byte CDBs use different offsets to
2560 * provide the various register values. 2556 * provide the various register values.
@@ -2606,6 +2602,22 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
2606 tf->device = qc->dev->devno ? 2602 tf->device = qc->dev->devno ?
2607 tf->device | ATA_DEV1 : tf->device & ~ATA_DEV1; 2603 tf->device | ATA_DEV1 : tf->device & ~ATA_DEV1;
2608 2604
2605 /* sanity check for pio multi commands */
2606 if ((cdb[1] & 0xe0) && !is_multi_taskfile(tf))
2607 goto invalid_fld;
2608
2609 if (is_multi_taskfile(tf)) {
2610 unsigned int multi_count = 1 << (cdb[1] >> 5);
2611
2612 /* compare the passed through multi_count
2613 * with the cached multi_count of libata
2614 */
2615 if (multi_count != dev->multi_count)
2616 ata_dev_printk(dev, KERN_WARNING,
2617 "invalid multi_count %u ignored\n",
2618 multi_count);
2619 }
2620
2609 /* READ/WRITE LONG use a non-standard sect_size */ 2621 /* READ/WRITE LONG use a non-standard sect_size */
2610 qc->sect_size = ATA_SECT_SIZE; 2622 qc->sect_size = ATA_SECT_SIZE;
2611 switch (tf->command) { 2623 switch (tf->command) {