diff options
Diffstat (limited to 'include/linux/ata.h')
-rw-r--r-- | include/linux/ata.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h index 8263a7b74d34..61535e72834d 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -43,6 +43,7 @@ enum { | |||
43 | ATA_MAX_SECTORS_128 = 128, | 43 | ATA_MAX_SECTORS_128 = 128, |
44 | ATA_MAX_SECTORS = 256, | 44 | ATA_MAX_SECTORS = 256, |
45 | ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */ | 45 | ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */ |
46 | ATA_MAX_SECTORS_TAPE = 65535, | ||
46 | 47 | ||
47 | ATA_ID_WORDS = 256, | 48 | ATA_ID_WORDS = 256, |
48 | ATA_ID_SERNO = 10, | 49 | ATA_ID_SERNO = 10, |
@@ -180,6 +181,7 @@ enum { | |||
180 | ATA_CMD_VERIFY_EXT = 0x42, | 181 | ATA_CMD_VERIFY_EXT = 0x42, |
181 | ATA_CMD_STANDBYNOW1 = 0xE0, | 182 | ATA_CMD_STANDBYNOW1 = 0xE0, |
182 | ATA_CMD_IDLEIMMEDIATE = 0xE1, | 183 | ATA_CMD_IDLEIMMEDIATE = 0xE1, |
184 | ATA_CMD_SLEEP = 0xE6, | ||
183 | ATA_CMD_INIT_DEV_PARAMS = 0x91, | 185 | ATA_CMD_INIT_DEV_PARAMS = 0x91, |
184 | ATA_CMD_READ_NATIVE_MAX = 0xF8, | 186 | ATA_CMD_READ_NATIVE_MAX = 0xF8, |
185 | ATA_CMD_READ_NATIVE_MAX_EXT = 0x27, | 187 | ATA_CMD_READ_NATIVE_MAX_EXT = 0x27, |
@@ -235,6 +237,7 @@ enum { | |||
235 | 237 | ||
236 | /* SETFEATURE Sector counts for SATA features */ | 238 | /* SETFEATURE Sector counts for SATA features */ |
237 | SATA_AN = 0x05, /* Asynchronous Notification */ | 239 | SATA_AN = 0x05, /* Asynchronous Notification */ |
240 | SATA_DIPM = 0x03, /* Device Initiated Power Management */ | ||
238 | 241 | ||
239 | /* ATAPI stuff */ | 242 | /* ATAPI stuff */ |
240 | ATAPI_PKT_DMA = (1 << 0), | 243 | ATAPI_PKT_DMA = (1 << 0), |
@@ -377,6 +380,26 @@ struct ata_taskfile { | |||
377 | 380 | ||
378 | #define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20) | 381 | #define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20) |
379 | 382 | ||
383 | static inline bool ata_id_has_hipm(const u16 *id) | ||
384 | { | ||
385 | u16 val = id[76]; | ||
386 | |||
387 | if (val == 0 || val == 0xffff) | ||
388 | return false; | ||
389 | |||
390 | return val & (1 << 9); | ||
391 | } | ||
392 | |||
393 | static inline bool ata_id_has_dipm(const u16 *id) | ||
394 | { | ||
395 | u16 val = id[78]; | ||
396 | |||
397 | if (val == 0 || val == 0xffff) | ||
398 | return false; | ||
399 | |||
400 | return val & (1 << 3); | ||
401 | } | ||
402 | |||
380 | static inline int ata_id_has_fua(const u16 *id) | 403 | static inline int ata_id_has_fua(const u16 *id) |
381 | { | 404 | { |
382 | if ((id[84] & 0xC000) != 0x4000) | 405 | if ((id[84] & 0xC000) != 0x4000) |
@@ -522,6 +545,11 @@ static inline int atapi_cdb_len(const u16 *dev_id) | |||
522 | } | 545 | } |
523 | } | 546 | } |
524 | 547 | ||
548 | static inline int atapi_command_packet_set(const u16 *dev_id) | ||
549 | { | ||
550 | return (dev_id[0] >> 8) & 0x1f; | ||
551 | } | ||
552 | |||
525 | static inline int is_atapi_taskfile(const struct ata_taskfile *tf) | 553 | static inline int is_atapi_taskfile(const struct ata_taskfile *tf) |
526 | { | 554 | { |
527 | return (tf->protocol == ATA_PROT_ATAPI) || | 555 | return (tf->protocol == ATA_PROT_ATAPI) || |