From: Sepherosa Ziehau Date: Mon, 18 Nov 2013 11:26:34 +0000 (+0800) Subject: ahci: Print "Serial ATA Additional capabilities" X-Git-Tag: v3.9.0~1162 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/b989944d9c9d41d5ac043c4117d250a473e05d4e ahci: Print "Serial ATA Additional capabilities" The 7th bit of this field indicates whether SEND FPDMA QUEUED and RECEIVE FPDMA QUEUED are supported or not. SEND FPDMA QUEUED could be used to support NCQ TRIM. If this bit is set, following steps are needed to determine whether NCQ TRIM could be used or not: READ LOG EXT (0x00, General Purpose Log Directory Log) if (!log8[0x26]) { no NCQ TRIM support return } READ LOG EXT (0x13, NCQ Send and Receive Log) if ((log32[0] & 0x1) == 0) { no NCQ TRIM support return } if ((log32[1] & 0x1) == 0) { no NCQ TRIM support return } /* NCQ TRIM is supported */ --- diff --git a/sys/dev/disk/ahci/ahci_cam.c b/sys/dev/disk/ahci/ahci_cam.c index 1b584af775..82e346b8fc 100644 --- a/sys/dev/disk/ahci/ahci_cam.c +++ b/sys/dev/disk/ahci/ahci_cam.c @@ -450,7 +450,7 @@ ahci_cam_probe(struct ahci_port *ap, struct ata_port *atx) } kprintf("%s: Found %s \"%*.*s %*.*s\" serial=\"%*.*s\"\n" - "%s: tags=%d/%d satacap=%04x satafea=%04x NCQ=%s " + "%s: tags=%d/%d satacap=%04x satacap2=%04x satafea=%04x NCQ=%s " "capacity=%lld.%02dMB\n", ATANAME(ap, atx), @@ -462,6 +462,7 @@ ahci_cam_probe(struct ahci_port *ap, struct ata_port *atx) ATANAME(ap, atx), devncqdepth, ap->ap_sc->sc_ncmds, at->at_identify.satacap, + at->at_identify.satacap2, at->at_identify.satafsup, (at->at_ncqdepth > 1 ? "YES" : "NO"), (long long)capacity_bytes / (1024 * 1024), diff --git a/sys/dev/disk/ahci/atascsi.h b/sys/dev/disk/ahci/atascsi.h index b31213d9cd..33f962e18d 100644 --- a/sys/dev/disk/ahci/atascsi.h +++ b/sys/dev/disk/ahci/atascsi.h @@ -103,7 +103,8 @@ struct ata_identify { u_int16_t reserved5[2]; /* 73 */ u_int16_t qdepth; /* 75 */ u_int16_t satacap; /* 76 */ - u_int16_t reserved6; /* 77 */ + u_int16_t satacap2; /* 77 */ +#define SATA_CAP2_SNDRCV_FPDMA (1 << 6) u_int16_t satafsup; /* 78 */ u_int16_t satafen; /* 79 */ u_int16_t majver; /* 80 */