Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Dec 2009 23:01:29 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r200008 - in head/sys: cam/ata sys
Message-ID:  <200912012301.nB1N1TgN079287@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Tue Dec  1 23:01:29 2009
New Revision: 200008
URL: http://svn.freebsd.org/changeset/base/200008

Log:
  Add CAM_ATAIO_DMA ATA command flag to mark DMA protocol commands.
  It is not needed for SATA controllers, but required for PATA.

Modified:
  head/sys/cam/ata/ata_all.c
  head/sys/cam/ata/ata_all.h
  head/sys/sys/ata.h

Modified: head/sys/cam/ata/ata_all.c
==============================================================================
--- head/sys/cam/ata/ata_all.c	Tue Dec  1 22:59:37 2009	(r200007)
+++ head/sys/cam/ata/ata_all.c	Tue Dec  1 23:01:29 2009	(r200008)
@@ -93,8 +93,8 @@ ata_op_string(struct ata_cmd *cmd)
 	case 0x39: return ("WRITE_MUL48");
 	case 0x3a: return ("WRITE_STREAM_DMA48");
 	case 0x3b: return ("WRITE_STREAM48");
-	case 0x3d: return ("WRITE_DMA_FUA");
-	case 0x3e: return ("WRITE_DMA_FUA48");
+	case 0x3d: return ("WRITE_DMA_FUA48");
+	case 0x3e: return ("WRITE_DMA_QUEUED_FUA48");
 	case 0x3f: return ("WRITE_LOG_EXT");
 	case 0x40: return ("READ_VERIFY");
 	case 0x42: return ("READ_VERIFY48");
@@ -119,7 +119,7 @@ ata_op_string(struct ata_cmd *cmd)
 	case 0xca: return ("WRITE_DMA");
 	case 0xcc: return ("WRITE_DMA_QUEUED");
 	case 0xcd: return ("CFA_WRITE_MULTIPLE_WITHOUT_ERASE");
-	case 0xce: return ("WRITE_MULTIPLE_FUA48");
+	case 0xce: return ("WRITE_MUL_FUA48");
 	case 0xd1: return ("CHECK_MEDIA_CARD_TYPE");
 	case 0xda: return ("GET_MEDIA_STATUS");
 	case 0xde: return ("MEDIA_LOCK");
@@ -309,6 +309,11 @@ ata_28bit_cmd(struct ccb_ataio *ataio, u
 {
 	bzero(&ataio->cmd, sizeof(ataio->cmd));
 	ataio->cmd.flags = 0;
+	if (cmd == ATA_READ_DMA ||
+	    cmd == ATA_READ_DMA_QUEUED ||
+	    cmd == ATA_WRITE_DMA ||
+	    cmd == ATA_WRITE_DMA_QUEUED)
+		ataio->cmd.flags |= CAM_ATAIO_DMA;
 	ataio->cmd.command = cmd;
 	ataio->cmd.features = features;
 	ataio->cmd.lba_low = lba;
@@ -324,6 +329,15 @@ ata_48bit_cmd(struct ccb_ataio *ataio, u
 {
 	bzero(&ataio->cmd, sizeof(ataio->cmd));
 	ataio->cmd.flags = CAM_ATAIO_48BIT;
+	if (cmd == ATA_READ_DMA48 ||
+	    cmd == ATA_READ_DMA_QUEUED48 ||
+	    cmd == ATA_READ_STREAM_DMA48 ||
+	    cmd == ATA_WRITE_DMA48 ||
+	    cmd == ATA_WRITE_DMA_FUA48 ||
+	    cmd == ATA_WRITE_DMA_QUEUED48 ||
+	    cmd == ATA_WRITE_DMA_QUEUED_FUA48 ||
+	    cmd == ATA_WRITE_STREAM_DMA48)
+		ataio->cmd.flags |= CAM_ATAIO_DMA;
 	ataio->cmd.command = cmd;
 	ataio->cmd.features = features;
 	ataio->cmd.lba_low = lba;

Modified: head/sys/cam/ata/ata_all.h
==============================================================================
--- head/sys/cam/ata/ata_all.h	Tue Dec  1 22:59:37 2009	(r200007)
+++ head/sys/cam/ata/ata_all.h	Tue Dec  1 23:01:29 2009	(r200008)
@@ -41,6 +41,7 @@ struct ata_cmd {
 #define		CAM_ATAIO_FPDMA		0x02	/* FPDMA command */
 #define		CAM_ATAIO_CONTROL	0x04	/* Control, not a command */
 #define		CAM_ATAIO_NEEDRESULT	0x08	/* Request requires result. */
+#define		CAM_ATAIO_DMA		0x10	/* DMA command */
 
 	u_int8_t	command;
 	u_int8_t	features;

Modified: head/sys/sys/ata.h
==============================================================================
--- head/sys/sys/ata.h	Tue Dec  1 22:59:37 2009	(r200007)
+++ head/sys/sys/ata.h	Tue Dec  1 23:01:29 2009	(r200008)
@@ -291,12 +291,21 @@ struct ata_params {
 #define ATA_READ_DMA_QUEUED48           0x26    /* read DMA QUEUED 48bit LBA */
 #define ATA_READ_NATIVE_MAX_ADDRESS48   0x27    /* read native max addr 48bit */
 #define ATA_READ_MUL48                  0x29    /* read multi 48bit LBA */
+#define ATA_READ_STREAM_DMA48           0x2a    /* read DMA stream 48bit LBA */
+#define ATA_READ_STREAM48               0x2b    /* read stream 48bit LBA */
 #define ATA_WRITE                       0x30    /* write */
 #define ATA_WRITE48                     0x34    /* write 48bit LBA */
 #define ATA_WRITE_DMA48                 0x35    /* write DMA 48bit LBA */
 #define ATA_WRITE_DMA_QUEUED48          0x36    /* write DMA QUEUED 48bit LBA*/
 #define ATA_SET_MAX_ADDRESS48           0x37    /* set max address 48bit */
 #define ATA_WRITE_MUL48                 0x39    /* write multi 48bit LBA */
+#define ATA_WRITE_STREAM_DMA48          0x3a
+#define ATA_WRITE_STREAM48              0x3b
+#define ATA_WRITE_DMA_FUA48             0x3d
+#define ATA_WRITE_DMA_QUEUED_FUA48      0x3e
+#define ATA_WRITE_LOG_EXT               0x3f
+#define ATA_READ_VERIFY                 0x40
+#define ATA_READ_VERIFY48               0x42
 #define ATA_READ_FPDMA_QUEUED           0x60    /* read DMA NCQ */
 #define ATA_WRITE_FPDMA_QUEUED          0x61    /* write DMA NCQ */
 #define ATA_SEEK                        0x70    /* seek */
@@ -312,6 +321,7 @@ struct ata_params {
 #define ATA_READ_DMA                    0xc8    /* read DMA */
 #define ATA_WRITE_DMA                   0xca    /* write DMA */
 #define ATA_WRITE_DMA_QUEUED            0xcc    /* write DMA QUEUED */
+#define ATA_WRITE_MUL_FUA48             0xce
 #define ATA_STANDBY_IMMEDIATE           0xe0    /* standby immediate */
 #define ATA_IDLE_IMMEDIATE              0xe1    /* idle immediate */
 #define ATA_STANDBY_CMD                 0xe2    /* standby */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912012301.nB1N1TgN079287>