diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-10 16:39:30 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-10 16:39:30 -0400 |
commit | 367d7e78dd48cf6ad35182a99d97abb5486e040e (patch) | |
tree | 70635fc87e0f094018870346577b3d84caefe61c /include/linux | |
parent | 5d5870f0a26e2304c4a82592870c5bc88017f7c9 (diff) |
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')
-rw-r--r-- | include/linux/ata.h | 10 | ||||
-rw-r--r-- | include/linux/ide.h | 13 |
2 files changed, 9 insertions, 14 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) | |||
645 | 645 | ||
646 | static inline int ata_id_is_sata(const u16 *id) | 646 | static inline int ata_id_is_sata(const u16 *id) |
647 | { | 647 | { |
648 | return ata_id_major_version(id) >= 5 && id[ATA_ID_HW_CONFIG] == 0; | 648 | /* |
649 | * See if word 93 is 0 AND drive is at least ATA-5 compatible | ||
650 | * verifying that word 80 by casting it to a signed type -- | ||
651 | * this trick allows us to filter out the reserved values of | ||
652 | * 0x0000 and 0xffff along with the earlier ATA revisions... | ||
653 | */ | ||
654 | if (id[ATA_ID_HW_CONFIG] == 0 && (short)id[ATA_ID_MAJOR_VER] >= 0x0020) | ||
655 | return 1; | ||
656 | return 0; | ||
649 | } | 657 | } |
650 | 658 | ||
651 | static inline int ata_id_has_tpm(const u16 *id) | 659 | static inline int ata_id_has_tpm(const u16 *id) |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 27829c13bef7..87b5b5d39539 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -1382,19 +1382,6 @@ const char *ide_xfer_verbose(u8 mode); | |||
1382 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); | 1382 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); |
1383 | extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); | 1383 | extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); |
1384 | 1384 | ||
1385 | static inline int ide_dev_is_sata(u16 *id) | ||
1386 | { | ||
1387 | /* | ||
1388 | * See if word 93 is 0 AND drive is at least ATA-5 compatible | ||
1389 | * verifying that word 80 by casting it to a signed type -- | ||
1390 | * this trick allows us to filter out the reserved values of | ||
1391 | * 0x0000 and 0xffff along with the earlier ATA revisions... | ||
1392 | */ | ||
1393 | if (id[ATA_ID_HW_CONFIG] == 0 && (short)id[ATA_ID_MAJOR_VER] >= 0x0020) | ||
1394 | return 1; | ||
1395 | return 0; | ||
1396 | } | ||
1397 | |||
1398 | u64 ide_get_lba_addr(struct ide_taskfile *, int); | 1385 | u64 ide_get_lba_addr(struct ide_taskfile *, int); |
1399 | u8 ide_dump_status(ide_drive_t *, const char *, u8); | 1386 | u8 ide_dump_status(ide_drive_t *, const char *, u8); |
1400 | 1387 | ||