diff options
author | Tejun Heo <htejun@gmail.com> | 2006-03-31 11:38:18 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-04-01 12:33:45 -0500 |
commit | e1211e3fa7fd05ff0d4f597fd37e40de8acc6784 (patch) | |
tree | 672018d7facf99ad4d45b09e2e2980accebdfe38 /include/linux/libata.h | |
parent | 9974e7cc6c8b8ea796c92cdf28db93e4579a4000 (diff) |
[PATCH] libata: implement ata_dev_enabled and disabled()
This patch renames ata_dev_present() to ata_dev_enabled() and adds
ata_dev_disabled(). This is to discern the state where a device is
present but disabled from not-present state. This disctinction is
necessary when configuring transfer mode because device selection
timing must not be violated even if a device fails to configure.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r-- | include/linux/libata.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index 0d61357604d5..c6883ba8cba9 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -672,14 +672,24 @@ static inline unsigned int ata_tag_valid(unsigned int tag) | |||
672 | return (tag < ATA_MAX_QUEUE) ? 1 : 0; | 672 | return (tag < ATA_MAX_QUEUE) ? 1 : 0; |
673 | } | 673 | } |
674 | 674 | ||
675 | static inline unsigned int ata_class_present(unsigned int class) | 675 | static inline unsigned int ata_class_enabled(unsigned int class) |
676 | { | 676 | { |
677 | return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; | 677 | return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; |
678 | } | 678 | } |
679 | 679 | ||
680 | static inline unsigned int ata_dev_present(const struct ata_device *dev) | 680 | static inline unsigned int ata_class_disabled(unsigned int class) |
681 | { | 681 | { |
682 | return ata_class_present(dev->class); | 682 | return class == ATA_DEV_ATA_UNSUP || class == ATA_DEV_ATAPI_UNSUP; |
683 | } | ||
684 | |||
685 | static inline unsigned int ata_dev_enabled(const struct ata_device *dev) | ||
686 | { | ||
687 | return ata_class_enabled(dev->class); | ||
688 | } | ||
689 | |||
690 | static inline unsigned int ata_dev_disabled(const struct ata_device *dev) | ||
691 | { | ||
692 | return ata_class_disabled(dev->class); | ||
683 | } | 693 | } |
684 | 694 | ||
685 | static inline u8 ata_chk_status(struct ata_port *ap) | 695 | static inline u8 ata_chk_status(struct ata_port *ap) |