[PATCH] hdparm: Show form factor and media rotation rate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make hdparm display form factor and media rotation rate when using -I.

Surprisingly, I have a few devices that export these already.

diff -purN -X /home/mkp/bin/dontdiff hdparm-9.11.orig/identify.c hdparm-9.11/identify.c
--- hdparm-9.11.orig/identify.c	2009-01-27 12:48:41.000000000 -0500
+++ hdparm-9.11/identify.c	2009-02-20 19:56:12.000000000 -0500
@@ -96,6 +96,7 @@
 #define RM_STAT 		127 /* removable media status notification feature set support */
 #define SECU_STATUS		128 /* security status */
 #define CFA_PWR_MODE		160 /* CFA power mode 1 */
+#define FORM_FACTOR		168 /* device nominal form factor */
 #define START_MEDIA             176 /* media serial number */
 #define LENGTH_MEDIA            20  /* 20 words (40 bytes or characters)*/
 #define START_MANUF             196 /* media manufacturer I.D. */
@@ -103,6 +104,7 @@
 #define SCT_SUPP		206 /* SMART command transport (SCT) support */
 #define TRANSPORT_MAJOR		222 /* PATA vs. SATA etc.. */
 #define TRANSPORT_MINOR		223 /* minor revision number */
+#define NMRR			217 /* nominal media rotation rate */
 #define INTEGRITY		255 /* integrity word */
 
 /* bit definitions within the words */
@@ -897,6 +899,35 @@ void identify (__u16 *id_supplied)
 	}
 	putchar('\n');
 
+	/* Form factor */
+	if(val[FORM_FACTOR] > 0) {
+		printf("\tForm Factor: ");
+		switch(val[FORM_FACTOR]) {
+		case 1:
+			printf("5.25 inch");
+			break;
+		case 2:
+			printf("3.5 inch");
+			break;
+		case 3:
+			printf("2.5 inch");
+			break;
+		case 4:
+			printf("1.8 inch");
+			break;
+		default:
+			printf("unknown");
+			break;
+		}
+		printf("\n");
+	}
+
+	/* Spinning disk or solid state? */
+	if(val[NMRR] == 1)
+		printf("\tNominal Media Rotation Rate: Solid State Device\n");
+	else if(val[NMRR] > 0x401)
+		printf("\tNominal Media Rotation Rate: %u\n", val[NMRR]);
+
 	/* hw support of commands (capabilities) */
 	printf("Capabilities:\n");
 	printf("\t");
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux