提交 2999b58b 编写于 作者: S Sergei Shtylyov 提交者: Jeff Garzik

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: NSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
上级 5eb66fe0
...@@ -731,12 +731,17 @@ static inline int ata_id_current_chs_valid(const u16 *id) ...@@ -731,12 +731,17 @@ static inline int ata_id_current_chs_valid(const u16 *id)
static inline int ata_id_is_cfa(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; return 1;
/* Could be CF hiding as standard ATA */ /*
if (ata_id_major_version(id) >= 3 && * CF specs don't require specific value in the word 0 anymore and yet
id[ATA_ID_COMMAND_SET_1] != 0xFFFF && * they forbid to report the ATA version in the word 80 and require the
(id[ATA_ID_COMMAND_SET_1] & (1 << 2))) * 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 1;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册