summaryrefslogtreecommitdiff
path: root/include/linux/ata.h
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-11 00:39:30 +0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-11 00:39:30 +0400
commit367d7e78dd48cf6ad35182a99d97abb5486e040e (patch)
tree70635fc87e0f094018870346577b3d84caefe61c /include/linux/ata.h
parent5d5870f0a26e2304c4a82592870c5bc88017f7c9 (diff)
downloadlinux-367d7e78dd48cf6ad35182a99d97abb5486e040e.tar.xz
ide: ide_dev_is_sata() -> ata_id_is_sata()
* Use optimized ATA version check from Sergei in ata_id_is_sata(). * ide_dev_is_sata() -> ata_id_is_sata() Cc: Jeff Garzik <jgarzik@pobox.com> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include/linux/ata.h')
-rw-r--r--include/linux/ata.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index be00973d1a8c..d28aad991c75 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -645,7 +645,15 @@ static inline unsigned int ata_id_major_version(const u16 *id)
static inline int ata_id_is_sata(const u16 *id)
{
- return ata_id_major_version(id) >= 5 && id[ATA_ID_HW_CONFIG] == 0;
+ /*
+ * See if word 93 is 0 AND drive is at least ATA-5 compatible
+ * verifying that word 80 by casting it to a signed type --
+ * this trick allows us to filter out the reserved values of
+ * 0x0000 and 0xffff along with the earlier ATA revisions...
+ */
+ if (id[ATA_ID_HW_CONFIG] == 0 && (short)id[ATA_ID_MAJOR_VER] >= 0x0020)
+ return 1;
+ return 0;
}
static inline int ata_id_has_tpm(const u16 *id)