summaryrefslogtreecommitdiffstats
path: root/include/linux/ata.h
diff options
context:
space:
mode:
authorElias Oltmanns <eo@nebensachen.de>2008-09-19 23:46:01 +0200
committerJeff Garzik <jgarzik@redhat.com>2008-09-29 00:25:50 -0400
commitea6ce53cd5d005455ec0a3cc1d45d3af0cb90919 (patch)
treea6868997eafc92becb5a94646fae4e6485f209ea /include/linux/ata.h
parent2ad69677b626fc311783b47af25dfecf7be2845b (diff)
downloadlinux-ea6ce53cd5d005455ec0a3cc1d45d3af0cb90919.tar.gz
linux-ea6ce53cd5d005455ec0a3cc1d45d3af0cb90919.tar.bz2
linux-ea6ce53cd5d005455ec0a3cc1d45d3af0cb90919.zip
[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)
return 0;
}
+static inline int ata_id_has_unload(const u16 *id)
+{
+ if (ata_id_major_version(id) >= 7 &&
+ (id[ATA_ID_CFSSE] & 0xC000) == 0x4000 &&
+ id[ATA_ID_CFSSE] & (1 << 13))
+ return 1;
+ return 0;
+}
+
static inline int ata_id_current_chs_valid(const u16 *id)
{
/* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command