aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ata.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ata.h')
-rw-r--r--include/linux/ata.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 1648026e06b4..b666b773e111 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -94,6 +94,8 @@ enum {
94 ATA_ID_SECTOR_SIZE = 106, 94 ATA_ID_SECTOR_SIZE = 106,
95 ATA_ID_WWN = 108, 95 ATA_ID_WWN = 108,
96 ATA_ID_LOGICAL_SECTOR_SIZE = 117, /* and 118 */ 96 ATA_ID_LOGICAL_SECTOR_SIZE = 117, /* and 118 */
97 ATA_ID_COMMAND_SET_3 = 119,
98 ATA_ID_COMMAND_SET_4 = 120,
97 ATA_ID_LAST_LUN = 126, 99 ATA_ID_LAST_LUN = 126,
98 ATA_ID_DLF = 128, 100 ATA_ID_DLF = 128,
99 ATA_ID_CSFO = 129, 101 ATA_ID_CSFO = 129,
@@ -177,7 +179,7 @@ enum {
177 ATA_DSC = (1 << 4), /* drive seek complete */ 179 ATA_DSC = (1 << 4), /* drive seek complete */
178 ATA_DRQ = (1 << 3), /* data request i/o */ 180 ATA_DRQ = (1 << 3), /* data request i/o */
179 ATA_CORR = (1 << 2), /* corrected data error */ 181 ATA_CORR = (1 << 2), /* corrected data error */
180 ATA_IDX = (1 << 1), /* index */ 182 ATA_SENSE = (1 << 1), /* sense code available */
181 ATA_ERR = (1 << 0), /* have an error */ 183 ATA_ERR = (1 << 0), /* have an error */
182 ATA_SRST = (1 << 2), /* software reset */ 184 ATA_SRST = (1 << 2), /* software reset */
183 ATA_ICRC = (1 << 7), /* interface CRC error */ 185 ATA_ICRC = (1 << 7), /* interface CRC error */
@@ -382,6 +384,8 @@ enum {
382 SATA_SSP = 0x06, /* Software Settings Preservation */ 384 SATA_SSP = 0x06, /* Software Settings Preservation */
383 SATA_DEVSLP = 0x09, /* Device Sleep */ 385 SATA_DEVSLP = 0x09, /* Device Sleep */
384 386
387 SETFEATURE_SENSE_DATA = 0xC3, /* Sense Data Reporting feature */
388
385 /* feature values for SET_MAX */ 389 /* feature values for SET_MAX */
386 ATA_SET_MAX_ADDR = 0x00, 390 ATA_SET_MAX_ADDR = 0x00,
387 ATA_SET_MAX_PASSWD = 0x01, 391 ATA_SET_MAX_PASSWD = 0x01,
@@ -525,6 +529,8 @@ struct ata_bmdma_prd {
525#define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20) 529#define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20)
526#define ata_id_has_da(id) ((id)[ATA_ID_SATA_CAPABILITY_2] & (1 << 4)) 530#define ata_id_has_da(id) ((id)[ATA_ID_SATA_CAPABILITY_2] & (1 << 4))
527#define ata_id_has_devslp(id) ((id)[ATA_ID_FEATURE_SUPP] & (1 << 8)) 531#define ata_id_has_devslp(id) ((id)[ATA_ID_FEATURE_SUPP] & (1 << 8))
532#define ata_id_has_ncq_autosense(id) \
533 ((id)[ATA_ID_FEATURE_SUPP] & (1 << 7))
528 534
529static inline bool ata_id_has_hipm(const u16 *id) 535static inline bool ata_id_has_hipm(const u16 *id)
530{ 536{
@@ -696,6 +702,27 @@ static inline bool ata_id_wcache_enabled(const u16 *id)
696 return id[ATA_ID_CFS_ENABLE_1] & (1 << 5); 702 return id[ATA_ID_CFS_ENABLE_1] & (1 << 5);
697} 703}
698 704
705static inline bool ata_id_has_read_log_dma_ext(const u16 *id)
706{
707 if (!(id[ATA_ID_CFS_ENABLE_2] & (1 << 15)))
708 return false;
709 return id[ATA_ID_COMMAND_SET_3] & (1 << 3);
710}
711
712static inline bool ata_id_has_sense_reporting(const u16 *id)
713{
714 if (!(id[ATA_ID_CFS_ENABLE_2] & (1 << 15)))
715 return false;
716 return id[ATA_ID_COMMAND_SET_3] & (1 << 6);
717}
718
719static inline bool ata_id_sense_reporting_enabled(const u16 *id)
720{
721 if (!(id[ATA_ID_CFS_ENABLE_2] & (1 << 15)))
722 return false;
723 return id[ATA_ID_COMMAND_SET_4] & (1 << 6);
724}
725
699/** 726/**
700 * ata_id_major_version - get ATA level of drive 727 * ata_id_major_version - get ATA level of drive
701 * @id: Identify data 728 * @id: Identify data