linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch libata-dev-2.6 1/1] libata: sync SMART ioctls with ATA pass thru spec (T10/04-262r7)
@ 2005-02-02 18:37 John W. Linville
  2005-02-02 18:51 ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: John W. Linville @ 2005-02-02 18:37 UTC (permalink / raw)
  To: linux-kernel, linux-ide; +Cc: andyw, jgarzik

Update libata's SMART-related ioctl handlers to match the current
ATA command pass-through specification (T10/04-262r7).  Also change
related SCSI op-code definition to match current spec.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
Contact w/ spec author (Curtis Stevens @ Western Digital) indicates
that while a revision 8 of the spec is expected, that it is really
only a re-formatting of the text to match T10 requirements.  According
to Stevens, revision 8 is expected to be the last version of the spec.

 drivers/scsi/libata-scsi.c |    6 ++++--
 include/scsi/scsi.h        |    6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)

--- sata-smart-2.6/drivers/scsi/libata-scsi.c.orig	2005-02-01 16:24:01.687622085 -0500
+++ sata-smart-2.6/drivers/scsi/libata-scsi.c	2005-02-01 16:49:18.213876086 -0500
@@ -109,14 +109,16 @@ int ata_cmd_ioctl(struct scsi_device *sc
 			return -ENOMEM;
 
 		scsi_cmd[1]  = (4 << 1); /* PIO Data-in */
+		scsi_cmd[2]  = 0x0e;     /* no off.line or cc, read from dev,
+		                            block count in sector count field */
 		sreq->sr_data_direction = DMA_FROM_DEVICE;
 	} else {
 		scsi_cmd[1]  = (3 << 1); /* Non-data */
+		/* scsi_cmd[2] is already 0 -- no off.line, cc, or data xfer */
 		sreq->sr_data_direction = DMA_NONE;
 	}
 
 	scsi_cmd[0] = ATA_16;
-	scsi_cmd[2] = 0x1f;     /* no off.line or cc, yes all registers */
 
 	scsi_cmd[4] = args[2];
 	if (args[0] == WIN_SMART) { /* hack -- ide driver does this too... */
@@ -179,7 +181,7 @@ int ata_task_ioctl(struct scsi_device *s
 	memset(scsi_cmd, 0, sizeof(scsi_cmd));
 	scsi_cmd[0]  = ATA_16;
 	scsi_cmd[1]  = (3 << 1); /* Non-data */
-	scsi_cmd[2]  = 0x1f;     /* no off.line or cc, yes all registers */
+	/* scsi_cmd[2] is already 0 -- no off.line, cc, or data xfer */
 	scsi_cmd[4]  = args[1];
 	scsi_cmd[6]  = args[2];
 	scsi_cmd[8]  = args[3];
--- sata-smart-2.6/include/scsi/scsi.h.orig	2005-02-01 16:22:12.390234346 -0500
+++ sata-smart-2.6/include/scsi/scsi.h	2005-02-01 16:23:02.828491161 -0500
@@ -113,9 +113,9 @@ extern const char *const scsi_device_typ
 /* values for service action in */
 #define	SAI_READ_CAPACITY_16  0x10
 
-/* Temporary values for T10/04-262 until official values are allocated */
-#define	ATA_16		      0x85	/* 16-byte pass-thru [0x85 == unused]*/
-#define	ATA_12		      0xb3	/* 12-byte pass-thru [0xb3 == obsolete set limits command] */
+/* Values for T10/04-262r7 */
+#define	ATA_16		      0x85	/* 16-byte pass-thru */
+#define	ATA_12		      0xa1	/* 12-byte pass-thru */
 
 /*
  *  SCSI Architecture Model (SAM) Status codes. Taken from SAM-3 draft
-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: [patch libata-dev-2.6 1/1] libata: sync SMART ioctls with ATA pass thru spec (T10/04-262r7)
@ 2005-02-02 23:05 Douglas Gilbert
  2005-02-02 23:36 ` Jeff Garzik
  0 siblings, 1 reply; 5+ messages in thread
From: Douglas Gilbert @ 2005-02-02 23:05 UTC (permalink / raw)
  To: axboe; +Cc: linville, linux-kernel, linux-ide

Jens Axboe wrote:
<snip>
 > >
 > > -/* Temporary values for T10/04-262 until official values are
 > allocated */
 > > -#define	ATA_16		      0x85	/* 16-byte pass-thru
 > [0x85 == unused]*/
 > -#define	ATA_12		      0xb3	/* 12-byte pass-thru
 > [0xb3 == obsolete set limits command] */
 > > +/* Values for T10/04-262r7 */
 > > +#define	ATA_16		      0x85	/* 16-byte pass-thru */
 > > +#define	ATA_12		      0xa1	/* 12-byte pass-thru */
 >
 > Ehh are you sure that is correct? 0xa1 is the BLANK command, I would
 > hate to think there would be a collision like that.

That very point came up recently in a MMC meeting:
http://www.t10.org/ftp/t10/document.05/05-056r0.pdf

To confuse things further "ATA_16" is shown as opcode 0x98
in the latest draft of SPC-3 (rev 21c 15 January 2005)
http://www.t10.org/ftp/t10/drafts/spc3/spc3r21c.pdf [annex D.3.1].

Hopefully these matters will be sorted out at the next t10
meeting in March.

Doug Gilbert


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-02-02 23:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-02 18:37 [patch libata-dev-2.6 1/1] libata: sync SMART ioctls with ATA pass thru spec (T10/04-262r7) John W. Linville
2005-02-02 18:51 ` Jens Axboe
2005-02-02 18:59   ` John W. Linville
  -- strict thread matches above, loose matches on Subject: below --
2005-02-02 23:05 Douglas Gilbert
2005-02-02 23:36 ` 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).