All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: linux-ide@vger.kernel.org
Subject: [PATCH] libata atapi work #2.2
Date: Sun, 16 May 2004 18:56:28 -0400	[thread overview]
Message-ID: <40A7F19C.3000602@pobox.com> (raw)

[-- 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 */

                 reply	other threads:[~2004-05-16 22:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40A7F19C.3000602@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.