ahci: Print "Serial ATA Additional capabilities"
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 18 Nov 2013 11:26:34 +0000 (19:26 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 18 Nov 2013 11:26:34 +0000 (19:26 +0800)
commitb989944d9c9d41d5ac043c4117d250a473e05d4e
tree2978d4baa1a2844c643ad9d0069aad5d61178cc0
parentd30569eb03ea28304151942cc95a474e5258629d
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 */
sys/dev/disk/ahci/ahci_cam.c
sys/dev/disk/ahci/atascsi.h