aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:31 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:31 -0400
commitff2779b568e70822e0ef2cc7afeeefbe7c607652 (patch)
treeb14a77664e9d4c8284805c5691017245e6c35e4b /include/linux
parent4b58f17d7c45a8e5f4acda641bec388398b9c0fa (diff)
ide: ide_id_has_flush_cache_ext() -> ata_id_flush_ext_enabled()
* Add ata_id_flush_ext_enabled() inline helper to <linux/ata.h>. * ide_id_has_flush_cache_ext() -> ata_id_flush_ext_enabled() The latter one also checks if the command is marked as supported in word 83 and validity of words 83 & 86. Cc: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ata.h13
-rw-r--r--include/linux/ide.h4
2 files changed, 13 insertions, 4 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 921cf0fc337f..81d9adeb819e 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -574,6 +574,19 @@ static inline int ata_id_has_flush_ext(const u16 *id)
574 return id[ATA_ID_COMMAND_SET_2] & (1 << 13); 574 return id[ATA_ID_COMMAND_SET_2] & (1 << 13);
575} 575}
576 576
577static inline int ata_id_flush_ext_enabled(const u16 *id)
578{
579 if (ata_id_has_flush_ext(id) == 0)
580 return 0;
581 if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000)
582 return 0;
583 /*
584 * some Maxtor disks have bit 13 defined incorrectly
585 * so check bit 10 too
586 */
587 return (id[ATA_ID_CFS_ENABLE_2] & 0x2400) == 0x2400;
588}
589
577static inline int ata_id_has_lba48(const u16 *id) 590static inline int ata_id_has_lba48(const u16 *id)
578{ 591{
579 if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) 592 if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000)
diff --git a/include/linux/ide.h b/include/linux/ide.h
index d2213d7cc4cb..432eb98f7fe7 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1453,10 +1453,6 @@ extern struct mutex ide_cfg_mtx;
1453extern struct bus_type ide_bus_type; 1453extern struct bus_type ide_bus_type;
1454extern struct class *ide_port_class; 1454extern struct class *ide_port_class;
1455 1455
1456/* some Maxtor disks have bit 13 defined incorrectly so check bit 10 too */
1457#define ide_id_has_flush_cache_ext(id) \
1458 (((id)[ATA_ID_CFS_ENABLE_2] & 0x2400) == 0x2400)
1459
1460static inline void ide_dump_identify(u8 *id) 1456static inline void ide_dump_identify(u8 *id)
1461{ 1457{
1462 print_hex_dump(KERN_INFO, "", DUMP_PREFIX_NONE, 16, 2, id, 512, 0); 1458 print_hex_dump(KERN_INFO, "", DUMP_PREFIX_NONE, 16, 2, id, 512, 0);