* [PATCH] libata atapi work #2.2
@ 2004-05-16 22:56 Jeff Garzik
0 siblings, 0 replies; only message in thread
From: Jeff Garzik @ 2004-05-16 22:56 UTC (permalink / raw)
To: linux-ide
[-- Attachment #1: Type: text/plain, Size: 10 bytes --]
attached.
[-- Attachment #2: patch.2 --]
[-- Type: text/plain, Size: 1789 bytes --]
# ChangeSet
# 2004/05/16 18:35:15-04:00 jgarzik@redhat.com
# [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.
#
diff -Nru a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
--- a/drivers/scsi/libata-scsi.c Sun May 16 18:54:41 2004
+++ b/drivers/scsi/libata-scsi.c Sun May 16 18:54:41 2004
@@ -927,6 +927,12 @@
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;
diff -Nru a/include/linux/ata.h b/include/linux/ata.h
--- a/include/linux/ata.h Sun May 16 18:54:41 2004
+++ b/include/linux/ata.h Sun May 16 18:54:41 2004
@@ -134,6 +134,8 @@
/* 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,
diff -Nru a/include/linux/libata.h b/include/linux/libata.h
--- a/include/linux/libata.h Sun May 16 18:54:41 2004
+++ b/include/linux/libata.h Sun May 16 18:54:41 2004
@@ -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 */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-05-16 22:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-16 22:56 [PATCH] libata atapi work #2.2 Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).