aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2007-09-11 16:28:36 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-09-11 16:28:36 -0400
commit6c3c22f3cb2b7cd0a42a024b93db76b5c3133d37 (patch)
tree13cd84e47c9d354930443ef7db2df1985446ffc4 /include/linux
parent7293136810936bbde403bcb67ac1b4dbae4dd790 (diff)
ide: add ide_dev_is_sata() helper (take 2)
Make the SATA drive detection code from eighty_ninty_three() into inline ide_dev_is_sata() helper fixing it along the way to be more strict while checking word 80 for the reserved values... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ide.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index c792b4fd1588..b9f66c10caa0 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1378,6 +1378,19 @@ static inline int ide_dev_has_iordy(struct hd_driveid *id)
1378 return ((id->field_valid & 2) && (id->capability & 8)) ? 1 : 0; 1378 return ((id->field_valid & 2) && (id->capability & 8)) ? 1 : 0;
1379} 1379}
1380 1380
1381static inline int ide_dev_is_sata(struct hd_driveid *id)
1382{
1383 /*
1384 * See if word 93 is 0 AND drive is at least ATA-5 compatible
1385 * verifying that word 80 by casting it to a signed type --
1386 * this trick allows us to filter out the reserved values of
1387 * 0x0000 and 0xffff along with the earlier ATA revisions...
1388 */
1389 if (id->hw_config == 0 && (short)id->major_rev_num >= 0x0020)
1390 return 1;
1391 return 0;
1392}
1393
1381u8 ide_dump_status(ide_drive_t *, const char *, u8); 1394u8 ide_dump_status(ide_drive_t *, const char *, u8);
1382 1395
1383typedef struct ide_pio_timings_s { 1396typedef struct ide_pio_timings_s {