aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ata.h
diff options
context:
space:
mode:
authorElias Oltmanns <eo@nebensachen.de>2008-09-19 17:46:01 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-09-29 00:25:50 -0400
commitea6ce53cd5d005455ec0a3cc1d45d3af0cb90919 (patch)
treea6868997eafc92becb5a94646fae4e6485f209ea /include/linux/ata.h
parent2ad69677b626fc311783b47af25dfecf7be2845b (diff)
[libata] Introduce ata_id_has_unload()
Add a function to check an ATA device's id for head unload support as specified in ATA-7. Signed-off-by: Elias Oltmanns <eo@nebensachen.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'include/linux/ata.h')
-rw-r--r--include/linux/ata.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 8a12d718c169..a26ebd25bac1 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -667,6 +667,15 @@ static inline int ata_id_has_dword_io(const u16 *id)
667 return 0; 667 return 0;
668} 668}
669 669
670static inline int ata_id_has_unload(const u16 *id)
671{
672 if (ata_id_major_version(id) >= 7 &&
673 (id[ATA_ID_CFSSE] & 0xC000) == 0x4000 &&
674 id[ATA_ID_CFSSE] & (1 << 13))
675 return 1;
676 return 0;
677}
678
670static inline int ata_id_current_chs_valid(const u16 *id) 679static inline int ata_id_current_chs_valid(const u16 *id)
671{ 680{
672 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command 681 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command