ahci: If the "nominal rotation rate" is 1, then disk is SSD
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 18 Nov 2013 12:44:05 +0000 (20:44 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 18 Nov 2013 12:44:05 +0000 (20:44 +0800)
sys/dev/disk/ahci/ahci_cam.c
sys/dev/disk/ahci/atascsi.h

index 82e346b..afe5d52 100644 (file)
@@ -333,6 +333,9 @@ ahci_cam_probe(struct ahci_port *ap, struct ata_port *atx)
 
        ata_fix_identify(&at->at_identify);
 
+       if (at->at_type == ATA_PORT_T_DISK && at->at_identify.nomrota_rate == 1)
+               type = "SSD";
+
        /*
         * Read capacity using SATA probe info.
         */
index 33f962e..ffd763e 100644 (file)
@@ -153,7 +153,9 @@ struct ata_identify {
        u_int16_t       padding5[6];    /* 170 */
        u_int16_t       curmedser[30];  /* 176 */
        u_int16_t       sctsupport;     /* 206 */
-       u_int16_t       padding4[48];   /* 207 */
+       u_int16_t       padding4[10];   /* 207 */
+       u_int16_t       nomrota_rate;   /* 217 */
+       u_int16_t       padding6[37];   /* 218 */
        u_int16_t       integrity;      /* 255 */
 } __packed;