aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/ide-iops.c2
-rw-r--r--drivers/ide/pci/hpt366.c4
-rw-r--r--include/linux/ata.h10
-rw-r--r--include/linux/ide.h13
4 files changed, 12 insertions, 17 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 6256c2df62cc..0a2fd3b37ac4 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -630,7 +630,7 @@ u8 eighty_ninty_three (ide_drive_t *drive)
630 printk(KERN_DEBUG "%s: skipping word 93 validity check\n", 630 printk(KERN_DEBUG "%s: skipping word 93 validity check\n",
631 drive->name); 631 drive->name);
632 632
633 if (ide_dev_is_sata(id) && !ivb) 633 if (ata_id_is_sata(id) && !ivb)
634 return 1; 634 return 1;
635 635
636 if (hwif->cbl != ATA_CBL_PATA80 && !ivb) 636 if (hwif->cbl != ATA_CBL_PATA80 && !ivb)
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index d706eb6b8acd..9056e3acc78b 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -654,7 +654,7 @@ static u8 hpt3xx_udma_filter(ide_drive_t *drive)
654 case HPT372A: 654 case HPT372A:
655 case HPT372N: 655 case HPT372N:
656 case HPT374 : 656 case HPT374 :
657 if (ide_dev_is_sata(drive->id)) 657 if (ata_id_is_sata(drive->id))
658 mask &= ~0x0e; 658 mask &= ~0x0e;
659 /* Fall thru */ 659 /* Fall thru */
660 default: 660 default:
@@ -674,7 +674,7 @@ static u8 hpt3xx_mdma_filter(ide_drive_t *drive)
674 case HPT372A: 674 case HPT372A:
675 case HPT372N: 675 case HPT372N:
676 case HPT374 : 676 case HPT374 :
677 if (ide_dev_is_sata(drive->id)) 677 if (ata_id_is_sata(drive->id))
678 return 0x00; 678 return 0x00;
679 /* Fall thru */ 679 /* Fall thru */
680 default: 680 default:
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
646static inline int ata_id_is_sata(const u16 *id) 646static 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
651static inline int ata_id_has_tpm(const u16 *id) 659static 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);
1382extern void ide_toggle_bounce(ide_drive_t *drive, int on); 1382extern void ide_toggle_bounce(ide_drive_t *drive, int on);
1383extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); 1383extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate);
1384 1384
1385static 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
1398u64 ide_get_lba_addr(struct ide_taskfile *, int); 1385u64 ide_get_lba_addr(struct ide_taskfile *, int);
1399u8 ide_dump_status(ide_drive_t *, const char *, u8); 1386u8 ide_dump_status(ide_drive_t *, const char *, u8);
1400 1387