linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libata support for rotation speed
@ 2008-06-19 16:02 Matthew Wilcox
  2008-06-19 17:59 ` Matthew Wilcox
  0 siblings, 1 reply; 11+ messages in thread
From: Matthew Wilcox @ 2008-06-19 16:02 UTC (permalink / raw)
  To: linux-scsi, linux-ide

Add support for VPD page b1 to libata

SCSI VPD page b1 reports the nominal rotation speed of the device.
ATA devices return this information in word 217 of the identify data.
b1 can also report the physical size of the device (5.25", 3.5", etc)
but that doesn't surrently seem to be defined in the ATA specification.

I also added 0x89 to the list of pages that libata supports.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 2e6e162..64e20bb 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1778,7 +1778,9 @@ static unsigned int ata_scsiop_inq_00(struct ata_scsi_args *args, u8 *rbuf)
 	const u8 pages[] = {
 		0x00,	/* page 0x00, this page */
 		0x80,	/* page 0x80, unit serial no page */
-		0x83	/* page 0x83, device ident page */
+		0x83,	/* page 0x83, device ident page */
+		0x89,	/* page 0x89, ata info page */
+		0xb1,	/* page 0xb1, block device characteristics page */
 	};
 
 	rbuf[3] = sizeof(pages);	/* number of supported VPD pages */
@@ -1899,6 +1901,16 @@ static unsigned int ata_scsiop_inq_89(struct ata_scsi_args *args, u8 *rbuf)
 	return 0;
 }
 
+static unsigned int ata_scsiop_inq_b1(struct ata_scsi_args *args, u8 *rbuf)
+{
+	rbuf[1] = 0xb1;
+	rbuf[3] = 0x3c;
+	rbuf[4] = args->id[217] >> 8;
+	rbuf[5] = args->id[217];
+
+	return 0;
+}
+
 /**
  *	ata_scsiop_noop - Command handler that simply returns success.
  *	@args: device IDENTIFY data / SCSI command of interest.
@@ -2922,6 +2934,9 @@ void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd,
 		case 0x89:
 			ata_scsi_rbuf_fill(&args, ata_scsiop_inq_89);
 			break;
+		case 0xb1:
+			ata_scsi_rbuf_fill(&args, ata_scsiop_inq_b1);
+			break;
 		default:
 			ata_scsi_invalid_field(cmd, done);
 			break;
-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

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

end of thread, other threads:[~2008-06-27  6:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-19 16:02 [PATCH] libata support for rotation speed Matthew Wilcox
2008-06-19 17:59 ` Matthew Wilcox
2008-06-19 18:24   ` James Bottomley
2008-06-19 18:31     ` Matthew Wilcox
2008-06-19 19:01       ` Jeff Garzik
2008-06-19 19:13         ` Matthew Wilcox
2008-06-22 12:41           ` Boaz Harrosh
2008-06-22 13:31             ` Matthew Wilcox
2008-06-22 13:44               ` James Bottomley
2008-06-22 14:18               ` Boaz Harrosh
2008-06-27  6:56           ` 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).