summaryrefslogtreecommitdiff
path: root/include/linux/ata.h
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2016-04-04 11:43:55 +0200
committerTejun Heo <tj@kernel.org>2016-04-04 12:07:40 -0400
commite87fd28cf9a2d9018ac4b6dd92f0b417714bc18d (patch)
tree768ef4257ff8ae50cdb54e63a05919c14bf29e1c /include/linux/ata.h
parent5b01e4b9efa0b78672cbbea830c9fbcc7f239e29 (diff)
libata: Implement support for sense data reporting
ACS-4 defines a sense data reporting feature set. This patch implements support for it. tj: Cosmetic formatting updates. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/ata.h')
-rw-r--r--include/linux/ata.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index e797e1b53006..00aebc4c83ad 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -385,6 +385,8 @@ enum {
SATA_SSP = 0x06, /* Software Settings Preservation */
SATA_DEVSLP = 0x09, /* Device Sleep */
+ SETFEATURE_SENSE_DATA = 0xC3, /* Sense Data Reporting feature */
+
/* feature values for SET_MAX */
ATA_SET_MAX_ADDR = 0x00,
ATA_SET_MAX_PASSWD = 0x01,
@@ -718,6 +720,20 @@ static inline bool ata_id_has_read_log_dma_ext(const u16 *id)
return false;
}
+static inline bool ata_id_has_sense_reporting(const u16 *id)
+{
+ if (!(id[ATA_ID_CFS_ENABLE_2] & (1 << 15)))
+ return false;
+ return id[ATA_ID_COMMAND_SET_3] & (1 << 6);
+}
+
+static inline bool ata_id_sense_reporting_enabled(const u16 *id)
+{
+ if (!(id[ATA_ID_CFS_ENABLE_2] & (1 << 15)))
+ return false;
+ return id[ATA_ID_COMMAND_SET_4] & (1 << 6);
+}
+
/**
* ata_id_major_version - get ATA level of drive
* @id: Identify data