Commit d89ee021 authored by Jeff Garzik's avatar Jeff Garzik

[libata] DMADIR support

DMADIR bit is necessary for some PATA->SATA bridges.  These
bridges require the OS driver to specify the data xfer direction,
for PACKET (a.k.a. scsi) commands.

A reliable DMADIR detection method hasn't yet been developed,
and ATAPI is still a WIP, so DMADIR is enabled with an ifdef for
now.
parent 80e00375
......@@ -927,6 +927,12 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc, u8 *scsicmd)
qc->flags |= ATA_QCFLAG_SG; /* data is present; dma-map it */
qc->tf.protocol = ATA_PROT_ATAPI_DMA;
qc->tf.feature |= ATAPI_PKT_DMA;
#ifdef ATAPI_ENABLE_DMADIR
/* some SATA bridges need us to indicate data xfer direction */
if (cmd->sc_data_direction != SCSI_DATA_WRITE)
qc->tf.feature |= ATAPI_DMADIR;
#endif
}
return 0;
......
......@@ -134,6 +134,8 @@ enum {
/* ATAPI stuff */
ATAPI_PKT_DMA = (1 << 0),
ATAPI_DMADIR = (1 << 2), /* ATAPI data dir:
0=to device, 1=to host */
/* cable types */
ATA_CBL_NONE = 0,
......
......@@ -40,6 +40,7 @@
#undef ATA_ENABLE_ATAPI /* define to enable ATAPI support */
#undef ATA_ENABLE_PATA /* define to enable PATA support in some
* low-level drivers */
#undef ATAPI_ENABLE_DMADIR /* enables ATAPI DMADIR bridge support */
/* note: prints function name for you */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment