diff options
Diffstat (limited to 'include/linux/ata.h')
| -rw-r--r-- | include/linux/ata.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h index e21c002c3a4a..128dc7ad4901 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
| @@ -236,6 +236,7 @@ enum { | |||
| 236 | 236 | ||
| 237 | /* SETFEATURE Sector counts for SATA features */ | 237 | /* SETFEATURE Sector counts for SATA features */ |
| 238 | SATA_AN = 0x05, /* Asynchronous Notification */ | 238 | SATA_AN = 0x05, /* Asynchronous Notification */ |
| 239 | SATA_DIPM = 0x03, /* Device Initiated Power Management */ | ||
| 239 | 240 | ||
| 240 | /* ATAPI stuff */ | 241 | /* ATAPI stuff */ |
| 241 | ATAPI_PKT_DMA = (1 << 0), | 242 | ATAPI_PKT_DMA = (1 << 0), |
| @@ -378,6 +379,26 @@ struct ata_taskfile { | |||
| 378 | 379 | ||
| 379 | #define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20) | 380 | #define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20) |
| 380 | 381 | ||
| 382 | static inline bool ata_id_has_hipm(const u16 *id) | ||
| 383 | { | ||
| 384 | u16 val = id[76]; | ||
| 385 | |||
| 386 | if (val == 0 || val == 0xffff) | ||
| 387 | return false; | ||
| 388 | |||
| 389 | return val & (1 << 9); | ||
| 390 | } | ||
| 391 | |||
| 392 | static inline bool ata_id_has_dipm(const u16 *id) | ||
| 393 | { | ||
| 394 | u16 val = id[78]; | ||
| 395 | |||
| 396 | if (val == 0 || val == 0xffff) | ||
| 397 | return false; | ||
| 398 | |||
| 399 | return val & (1 << 3); | ||
| 400 | } | ||
| 401 | |||
| 381 | static inline int ata_id_has_fua(const u16 *id) | 402 | static inline int ata_id_has_fua(const u16 *id) |
| 382 | { | 403 | { |
| 383 | if ((id[84] & 0xC000) != 0x4000) | 404 | if ((id[84] & 0xC000) != 0x4000) |
