aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata.h
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-10-22 03:34:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 19:05:26 -0400
commit2fca5ccf97d2c28bcfce44f5b07d85e74e3cd18e (patch)
tree483dedd08d6ccbb56959eeb127e82ab8f84edf2e /drivers/ata/libata.h
parent332edc2f7fa58b818dfed1cede60272eecc27c0a (diff)
libata: switch to using block layer tagging support
libata currently has a pretty dumb ATA_MAX_QUEUE loop for finding a free tag to use. Instead of fixing that up, convert libata to using block layer tagging - gets rid of code in libata, and is also much faster. Signed-off-by: Jens Axboe <jens.axboe@oracle.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/ata/libata.h')
-rw-r--r--drivers/ata/libata.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index fe2839e58774..d3831d39bdaa 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -74,7 +74,7 @@ extern struct ata_link *ata_dev_phys_link(struct ata_device *dev);
74extern void ata_force_cbl(struct ata_port *ap); 74extern void ata_force_cbl(struct ata_port *ap);
75extern u64 ata_tf_to_lba(const struct ata_taskfile *tf); 75extern u64 ata_tf_to_lba(const struct ata_taskfile *tf);
76extern u64 ata_tf_to_lba48(const struct ata_taskfile *tf); 76extern u64 ata_tf_to_lba48(const struct ata_taskfile *tf);
77extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev); 77extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev, int tag);
78extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev, 78extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev,
79 u64 block, u32 n_block, unsigned int tf_flags, 79 u64 block, u32 n_block, unsigned int tf_flags,
80 unsigned int tag); 80 unsigned int tag);
@@ -103,7 +103,6 @@ extern int ata_dev_configure(struct ata_device *dev);
103extern int sata_down_spd_limit(struct ata_link *link); 103extern int sata_down_spd_limit(struct ata_link *link);
104extern int ata_down_xfermask_limit(struct ata_device *dev, unsigned int sel); 104extern int ata_down_xfermask_limit(struct ata_device *dev, unsigned int sel);
105extern void ata_sg_clean(struct ata_queued_cmd *qc); 105extern void ata_sg_clean(struct ata_queued_cmd *qc);
106extern void ata_qc_free(struct ata_queued_cmd *qc);
107extern void ata_qc_issue(struct ata_queued_cmd *qc); 106extern void ata_qc_issue(struct ata_queued_cmd *qc);
108extern void __ata_qc_complete(struct ata_queued_cmd *qc); 107extern void __ata_qc_complete(struct ata_queued_cmd *qc);
109extern int atapi_check_dma(struct ata_queued_cmd *qc); 108extern int atapi_check_dma(struct ata_queued_cmd *qc);
@@ -119,6 +118,22 @@ extern struct ata_port *ata_port_alloc(struct ata_host *host);
119extern void ata_dev_enable_pm(struct ata_device *dev, enum link_pm policy); 118extern void ata_dev_enable_pm(struct ata_device *dev, enum link_pm policy);
120extern void ata_lpm_schedule(struct ata_port *ap, enum link_pm); 119extern void ata_lpm_schedule(struct ata_port *ap, enum link_pm);
121 120
121/**
122 * ata_qc_free - free unused ata_queued_cmd
123 * @qc: Command to complete
124 *
125 * Designed to free unused ata_queued_cmd object
126 * in case something prevents using it.
127 *
128 * LOCKING:
129 * spin_lock_irqsave(host lock)
130 */
131static inline void ata_qc_free(struct ata_queued_cmd *qc)
132{
133 qc->flags = 0;
134 qc->tag = ATA_TAG_POISON;
135}
136
122/* libata-acpi.c */ 137/* libata-acpi.c */
123#ifdef CONFIG_ATA_ACPI 138#ifdef CONFIG_ATA_ACPI
124extern void ata_acpi_associate_sata_port(struct ata_port *ap); 139extern void ata_acpi_associate_sata_port(struct ata_port *ap);