diff options
author | Elias Oltmanns <eo@nebensachen.de> | 2008-09-19 23:46:01 +0200 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-09-29 00:25:50 -0400 |
commit | ea6ce53cd5d005455ec0a3cc1d45d3af0cb90919 (patch) | |
tree | a6868997eafc92becb5a94646fae4e6485f209ea | |
parent | 2ad69677b626fc311783b47af25dfecf7be2845b (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>
-rw-r--r-- | include/linux/ata.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h index 8a12d718c16..a26ebd25bac 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 |