ata: add CFA specific identify data words
[sfrench/cifs-2.6.git] / include / linux / ata.h
index a53318b8cbd0ea9a4b7a69f3376cb11036a5ff32..9a061accd8b8de95f7dcb282d2488f0613418c9e 100644 (file)
@@ -89,6 +89,8 @@ enum {
        ATA_ID_DLF              = 128,
        ATA_ID_CSFO             = 129,
        ATA_ID_CFA_POWER        = 160,
+       ATA_ID_CFA_KEY_MGMT     = 162,
+       ATA_ID_CFA_MODES        = 163,
        ATA_ID_ROT_SPEED        = 217,
        ATA_ID_PIO4             = (1 << 1),
 
@@ -731,12 +733,17 @@ static inline int ata_id_current_chs_valid(const u16 *id)
 
 static inline int ata_id_is_cfa(const u16 *id)
 {
-       if (id[ATA_ID_CONFIG] == 0x848A)        /* Standard CF */
+       if (id[ATA_ID_CONFIG] == 0x848A)        /* Traditional CF */
                return 1;
-       /* Could be CF hiding as standard ATA */
-       if (ata_id_major_version(id) >= 3 &&
-           id[ATA_ID_COMMAND_SET_1] != 0xFFFF &&
-          (id[ATA_ID_COMMAND_SET_1] & (1 << 2)))
+       /*
+        * CF specs don't require specific value in the word 0 anymore and yet
+        * they forbid to report the ATA version in the word 80 and require the
+        * CFA feature set support to be indicated in the word 83 in this case.
+        * Unfortunately, some cards only follow either of this requirements,
+        * and while those that don't indicate CFA feature support need some
+        * sort of quirk list, it seems impractical for the ones that do...
+        */
+       if ((id[ATA_ID_COMMAND_SET_2] & 0xC004) == 0x4004)
                return 1;
        return 0;
 }