diff options
author | Hannes Reinecke <hare@suse.de> | 2016-04-25 13:45:54 +0300 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2016-05-09 19:36:46 +0300 |
commit | 284b3b77ea883234dadb2cbf97b145c3c30fe4bd (patch) | |
tree | 2faa832ef21a350e2d6b5e4c238f70e38e0e6502 /include | |
parent | 27708a9579ee069c6e0ebb6e61ac1114ed1d546c (diff) | |
download | linux-284b3b77ea883234dadb2cbf97b145c3c30fe4bd.tar.xz |
libata: NCQ encapsulation for ZAC MANAGEMENT OUT
Add NCQ encapsulation for ZAC MANAGEMENT OUT and evaluate
NCQ Non-Data log pages to figure out if NCQ encapsulation
is supported.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ata.h | 7 | ||||
-rw-r--r-- | include/linux/libata.h | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h index 9d7c47075ebc..e62703201e84 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h @@ -320,6 +320,7 @@ enum { ATA_SUBCMD_NCQ_NON_DATA_ABORT_QUEUE = 0x00, ATA_SUBCMD_NCQ_NON_DATA_SET_FEATURES = 0x05, ATA_SUBCMD_NCQ_NON_DATA_ZERO_EXT = 0x06, + ATA_SUBCMD_NCQ_NON_DATA_ZAC_MGMT_OUT = 0x07, /* Subcmds for ATA_CMD_ZAC_MGMT_IN */ ATA_SUBCMD_ZAC_MGMT_IN_REPORT_ZONES = 0x00, @@ -333,6 +334,7 @@ enum { /* READ_LOG_EXT pages */ ATA_LOG_DIRECTORY = 0x0, ATA_LOG_SATA_NCQ = 0x10, + ATA_LOG_NCQ_NON_DATA = 0x12, ATA_LOG_NCQ_SEND_RECV = 0x13, ATA_LOG_SATA_ID_DEV_DATA = 0x30, ATA_LOG_SATA_SETTINGS = 0x08, @@ -877,6 +879,11 @@ static inline bool ata_id_has_ncq_send_and_recv(const u16 *id) return id[ATA_ID_SATA_CAPABILITY_2] & BIT(6); } +static inline bool ata_id_has_ncq_non_data(const u16 *id) +{ + return id[ATA_ID_SATA_CAPABILITY_2] & BIT(5); +} + static inline bool ata_id_has_trim(const u16 *id) { if (ata_id_major_version(id) >= 7 && diff --git a/include/linux/libata.h b/include/linux/libata.h index c0806b60c4fa..0019d4b51b11 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -729,6 +729,7 @@ struct ata_device { /* NCQ send and receive log subcommand support */ u8 ncq_send_recv_cmds[ATA_LOG_NCQ_SEND_RECV_SIZE]; + u8 ncq_non_data_cmds[ATA_LOG_NCQ_NON_DATA_SIZE]; /* error history */ int spdn_cnt; @@ -1658,6 +1659,12 @@ static inline bool ata_fpdma_zac_mgmt_in_supported(struct ata_device *dev) ATA_LOG_NCQ_SEND_RECV_ZAC_MGMT_IN_SUPPORTED); } +static inline bool ata_fpdma_zac_mgmt_out_supported(struct ata_device *dev) +{ + return (dev->ncq_non_data_cmds[ATA_LOG_NCQ_NON_DATA_ZAC_MGMT_OFFSET] & + ATA_LOG_NCQ_NON_DATA_ZAC_MGMT_OUT); +} + static inline void ata_qc_set_polling(struct ata_queued_cmd *qc) { qc->tf.ctl |= ATA_NIEN; |