From: Sepherosa Ziehau Date: Mon, 18 Nov 2013 12:44:05 +0000 (+0800) Subject: ahci: If the "nominal rotation rate" is 1, then disk is SSD X-Git-Tag: v3.9.0~1161 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/6a790b6a8435dc2cde66b486508825650c4d0b72 ahci: If the "nominal rotation rate" is 1, then disk is SSD --- diff --git a/sys/dev/disk/ahci/ahci_cam.c b/sys/dev/disk/ahci/ahci_cam.c index 82e346b8fc..afe5d52299 100644 --- a/sys/dev/disk/ahci/ahci_cam.c +++ b/sys/dev/disk/ahci/ahci_cam.c @@ -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. */ diff --git a/sys/dev/disk/ahci/atascsi.h b/sys/dev/disk/ahci/atascsi.h index 33f962e18d..ffd763ee92 100644 --- a/sys/dev/disk/ahci/atascsi.h +++ b/sys/dev/disk/ahci/atascsi.h @@ -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;