From: Elias Oltmanns Date: Fri, 19 Sep 2008 21:46:01 +0000 (+0200) Subject: [libata] Introduce ata_id_has_unload() X-Git-Tag: v2.6.28-rc1~736^2~7 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ea6ce53cd5d005455ec0a3cc1d45d3af0cb90919;p=linux-2.6-omap-h63xx.git [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 Signed-off-by: Jeff Garzik --- 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