diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2009-02-01 11:46:39 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2009-02-02 22:45:10 -0500 |
commit | 2999b58b795ad81f10e34bdbbfd2742172f247e4 (patch) | |
tree | 6ff5484a5a7083d105d5824d0ada16654484e7b8 /include | |
parent | 5eb66fe05f08d515a7377787473bc4e4b1ed5b59 (diff) |
ide/libata: fix ata_id_is_cfa() (take 4)
When checking for the CFA feature set support, ata_id_is_cfa() tests bit 2 in
word 82 of the identify data instead the word 83; it also checks the ATA/PI
version support in the word 80 (which the CompactFlash specifications have as
reserved), this having no slightest chance to work on the modern CF cards that
don't have 0x848A in the word 0...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ata.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h index a53318b8cbd0..08a86d5cdf1b 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -731,12 +731,17 @@ static inline int ata_id_current_chs_valid(const u16 *id) | |||
731 | 731 | ||
732 | static inline int ata_id_is_cfa(const u16 *id) | 732 | static inline int ata_id_is_cfa(const u16 *id) |
733 | { | 733 | { |
734 | if (id[ATA_ID_CONFIG] == 0x848A) /* Standard CF */ | 734 | if (id[ATA_ID_CONFIG] == 0x848A) /* Traditional CF */ |
735 | return 1; | 735 | return 1; |
736 | /* Could be CF hiding as standard ATA */ | 736 | /* |
737 | if (ata_id_major_version(id) >= 3 && | 737 | * CF specs don't require specific value in the word 0 anymore and yet |
738 | id[ATA_ID_COMMAND_SET_1] != 0xFFFF && | 738 | * they forbid to report the ATA version in the word 80 and require the |
739 | (id[ATA_ID_COMMAND_SET_1] & (1 << 2))) | 739 | * CFA feature set support to be indicated in the word 83 in this case. |
740 | * Unfortunately, some cards only follow either of this requirements, | ||
741 | * and while those that don't indicate CFA feature support need some | ||
742 | * sort of quirk list, it seems impractical for the ones that do... | ||
743 | */ | ||
744 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC004) == 0x4004) | ||
740 | return 1; | 745 | return 1; |
741 | return 0; | 746 | return 0; |
742 | } | 747 | } |