Преглед на файлове

[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>
Elias Oltmanns преди 16 години
родител
ревизия
ea6ce53cd5
променени са 1 файла, в които са добавени 9 реда и са изтрити 0 реда
  1. 9 0
      include/linux/ata.h

+ 9 - 0
include/linux/ata.h

@@ -667,6 +667,15 @@ static inline int ata_id_has_dword_io(const u16 *id)
 	return 0;
 	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)
 static inline int ata_id_current_chs_valid(const u16 *id)
 {
 {
 	/* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command
 	/* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command