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.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 4fb357312b3b..e2595e877e44 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -87,6 +87,7 @@ enum {
87 ATA_ID_HW_CONFIG = 93, 87 ATA_ID_HW_CONFIG = 93,
88 ATA_ID_SPG = 98, 88 ATA_ID_SPG = 98,
89 ATA_ID_LBA_CAPACITY_2 = 100, 89 ATA_ID_LBA_CAPACITY_2 = 100,
90 ATA_ID_SECTOR_SIZE = 106,
90 ATA_ID_LAST_LUN = 126, 91 ATA_ID_LAST_LUN = 126,
91 ATA_ID_DLF = 128, 92 ATA_ID_DLF = 128,
92 ATA_ID_CSFO = 129, 93 ATA_ID_CSFO = 129,
@@ -638,6 +639,18 @@ static inline int ata_id_flush_ext_enabled(const u16 *id)
638 return (id[ATA_ID_CFS_ENABLE_2] & 0x2400) == 0x2400; 639 return (id[ATA_ID_CFS_ENABLE_2] & 0x2400) == 0x2400;
639} 640}
640 641
642static inline int ata_id_has_large_logical_sectors(const u16 *id)
643{
644 if ((id[ATA_ID_SECTOR_SIZE] & 0xc000) != 0x4000)
645 return 0;
646 return id[ATA_ID_SECTOR_SIZE] & (1 << 13);
647}
648
649static inline u8 ata_id_logical_per_physical_sectors(const u16 *id)
650{
651 return id[ATA_ID_SECTOR_SIZE] & 0xf;
652}
653
641static inline int ata_id_has_lba48(const u16 *id) 654static inline int ata_id_has_lba48(const u16 *id)
642{ 655{
643 if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) 656 if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000)