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.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index e672e80202a8..3fbe6d7784ab 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -379,7 +379,6 @@ struct ata_taskfile {
379#define ata_id_has_ncq(id) ((id)[76] & (1 << 8)) 379#define ata_id_has_ncq(id) ((id)[76] & (1 << 8))
380#define ata_id_queue_depth(id) (((id)[75] & 0x1f) + 1) 380#define ata_id_queue_depth(id) (((id)[75] & 0x1f) + 1)
381#define ata_id_removeable(id) ((id)[0] & (1 << 7)) 381#define ata_id_removeable(id) ((id)[0] & (1 << 7))
382#define ata_id_has_dword_io(id) ((id)[48] & (1 << 0))
383#define ata_id_has_atapi_AN(id) \ 382#define ata_id_has_atapi_AN(id) \
384 ( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \ 383 ( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \
385 ((id)[78] & (1 << 5)) ) 384 ((id)[78] & (1 << 5)) )
@@ -415,6 +414,7 @@ static inline bool ata_id_has_dipm(const u16 *id)
415 return val & (1 << 3); 414 return val & (1 << 3);
416} 415}
417 416
417
418static inline int ata_id_has_fua(const u16 *id) 418static inline int ata_id_has_fua(const u16 *id)
419{ 419{
420 if ((id[84] & 0xC000) != 0x4000) 420 if ((id[84] & 0xC000) != 0x4000)
@@ -519,6 +519,26 @@ static inline int ata_id_is_sata(const u16 *id)
519 return ata_id_major_version(id) >= 5 && id[93] == 0; 519 return ata_id_major_version(id) >= 5 && id[93] == 0;
520} 520}
521 521
522static inline int ata_id_has_tpm(const u16 *id)
523{
524 /* The TPM bits are only valid on ATA8 */
525 if (ata_id_major_version(id) < 8)
526 return 0;
527 if ((id[48] & 0xC000) != 0x4000)
528 return 0;
529 return id[48] & (1 << 0);
530}
531
532static inline int ata_id_has_dword_io(const u16 *id)
533{
534 /* ATA 8 reuses this flag for "trusted" computing */
535 if (ata_id_major_version(id) > 7)
536 return 0;
537 if (id[48] & (1 << 0))
538 return 1;
539 return 0;
540}
541
522static inline int ata_id_current_chs_valid(const u16 *id) 542static inline int ata_id_current_chs_valid(const u16 *id)
523{ 543{
524 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command 544 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command