summaryrefslogtreecommitdiff
path: root/include/linux/libata.h
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-06-24 20:30:19 +0900
committerJeff Garzik <jeff@garzik.org>2006-06-26 20:59:27 -0400
commit5806db22cffc7557b675d3c9229f327980aee797 (patch)
treee3ad9b2b89ad0525a29ba2e94eb4002ee30035ef /include/linux/libata.h
parent77b08fb56a41e84b5e78b14f24d79879235e3337 (diff)
[PATCH] libata: implement ata_port_max_devices()
Implement ata_port_max_devices(). This function returns the number of possible devices on a port. This will be used by new PM implementation. 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.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index c227dace1d26..f4284bf89758 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -888,6 +888,9 @@ static inline unsigned int ata_tag_internal(unsigned int tag)
return tag == ATA_MAX_QUEUE - 1;
}
+/*
+ * device helpers
+ */
static inline unsigned int ata_class_enabled(unsigned int class)
{
return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI;
@@ -918,6 +921,17 @@ static inline unsigned int ata_dev_absent(const struct ata_device *dev)
return ata_class_absent(dev->class);
}
+/*
+ * port helpers
+ */
+static inline int ata_port_max_devices(const struct ata_port *ap)
+{
+ if (ap->flags & ATA_FLAG_SLAVE_POSS)
+ return 2;
+ return 1;
+}
+
+
static inline u8 ata_chk_status(struct ata_port *ap)
{
return ap->ops->check_status(ap);