diff options
| -rw-r--r-- | drivers/scsi/libata-scsi.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index cdc0a10a606c..c1cf5e038967 100644 --- a/drivers/scsi/libata-scsi.c +++ b/drivers/scsi/libata-scsi.c | |||
| @@ -582,7 +582,11 @@ void ata_gen_fixed_sense(struct ata_queued_cmd *qc) | |||
| 582 | 582 | ||
| 583 | sb[0] = 0x70; | 583 | sb[0] = 0x70; |
| 584 | sb[7] = 0x0a; | 584 | sb[7] = 0x0a; |
| 585 | |||
| 586 | #if 0 /* when C/H/S support is merged */ | ||
| 585 | if (tf->flags & ATA_TFLAG_LBA && !(tf->flags & ATA_TFLAG_LBA48)) { | 587 | if (tf->flags & ATA_TFLAG_LBA && !(tf->flags & ATA_TFLAG_LBA48)) { |
| 588 | #endif | ||
| 589 | if (!(tf->flags & ATA_TFLAG_LBA48)) { | ||
| 586 | /* A small (28b) LBA will fit in the 32b info field */ | 590 | /* A small (28b) LBA will fit in the 32b info field */ |
| 587 | sb[0] |= 0x80; /* set valid bit */ | 591 | sb[0] |= 0x80; /* set valid bit */ |
| 588 | sb[3] = tf->device & 0x0f; | 592 | sb[3] = tf->device & 0x0f; |
| @@ -977,8 +981,8 @@ static void ata_scsi_translate(struct ata_port *ap, struct ata_device *dev, | |||
| 977 | return; | 981 | return; |
| 978 | 982 | ||
| 979 | /* data is present; dma-map it */ | 983 | /* data is present; dma-map it */ |
| 980 | if (cmd->sc_data_direction == SCSI_DATA_READ || | 984 | if (cmd->sc_data_direction == DMA_FROM_DEVICE || |
| 981 | cmd->sc_data_direction == SCSI_DATA_WRITE) { | 985 | cmd->sc_data_direction == DMA_TO_DEVICE) { |
| 982 | if (unlikely(cmd->request_bufflen < 1)) { | 986 | if (unlikely(cmd->request_bufflen < 1)) { |
| 983 | printk(KERN_WARNING "ata%u(%u): WARNING: zero len r/w req\n", | 987 | printk(KERN_WARNING "ata%u(%u): WARNING: zero len r/w req\n", |
| 984 | ap->id, dev->devno); | 988 | ap->id, dev->devno); |
| @@ -1609,7 +1613,7 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) | |||
| 1609 | struct scsi_cmnd *cmd = qc->scsicmd; | 1613 | struct scsi_cmnd *cmd = qc->scsicmd; |
| 1610 | struct ata_device *dev = qc->dev; | 1614 | struct ata_device *dev = qc->dev; |
| 1611 | int using_pio = (dev->flags & ATA_DFLAG_PIO); | 1615 | int using_pio = (dev->flags & ATA_DFLAG_PIO); |
| 1612 | int nodata = (cmd->sc_data_direction == SCSI_DATA_NONE); | 1616 | int nodata = (cmd->sc_data_direction == DMA_NONE); |
| 1613 | 1617 | ||
| 1614 | if (!using_pio) | 1618 | if (!using_pio) |
| 1615 | /* Check whether ATAPI DMA is safe */ | 1619 | /* Check whether ATAPI DMA is safe */ |
| @@ -1621,7 +1625,7 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) | |||
| 1621 | qc->complete_fn = atapi_qc_complete; | 1625 | qc->complete_fn = atapi_qc_complete; |
| 1622 | 1626 | ||
| 1623 | qc->tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; | 1627 | qc->tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; |
| 1624 | if (cmd->sc_data_direction == SCSI_DATA_WRITE) { | 1628 | if (cmd->sc_data_direction == DMA_TO_DEVICE) { |
| 1625 | qc->tf.flags |= ATA_TFLAG_WRITE; | 1629 | qc->tf.flags |= ATA_TFLAG_WRITE; |
| 1626 | DPRINTK("direction: write\n"); | 1630 | DPRINTK("direction: write\n"); |
| 1627 | } | 1631 | } |
| @@ -1645,7 +1649,7 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc, u8 *scsicmd) | |||
| 1645 | 1649 | ||
| 1646 | #ifdef ATAPI_ENABLE_DMADIR | 1650 | #ifdef ATAPI_ENABLE_DMADIR |
| 1647 | /* some SATA bridges need us to indicate data xfer direction */ | 1651 | /* some SATA bridges need us to indicate data xfer direction */ |
| 1648 | if (cmd->sc_data_direction != SCSI_DATA_WRITE) | 1652 | if (cmd->sc_data_direction != DMA_TO_DEVICE) |
| 1649 | qc->tf.feature |= ATAPI_DMADIR; | 1653 | qc->tf.feature |= ATAPI_DMADIR; |
| 1650 | #endif | 1654 | #endif |
| 1651 | } | 1655 | } |
| @@ -1821,7 +1825,7 @@ ata_scsi_pass_thru(struct ata_queued_cmd *qc, u8 *scsicmd) | |||
| 1821 | */ | 1825 | */ |
| 1822 | tf->flags |= (ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE); | 1826 | tf->flags |= (ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE); |
| 1823 | 1827 | ||
| 1824 | if (cmd->sc_data_direction == SCSI_DATA_WRITE) | 1828 | if (cmd->sc_data_direction == DMA_TO_DEVICE) |
| 1825 | tf->flags |= ATA_TFLAG_WRITE; | 1829 | tf->flags |= ATA_TFLAG_WRITE; |
| 1826 | 1830 | ||
| 1827 | /* | 1831 | /* |
