diff options
author | Tejun Heo <htejun@gmail.com> | 2008-04-07 15:47:19 +0200 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-17 21:44:22 +0200 |
commit | aa2731ad9ad80ac3fca48bd1c4cf0eceede4810e (patch) | |
tree | db6d3327017b9b84355aba49a5ccd5c322d3f248 /drivers/ata/libata.h | |
parent | libata: restructure SFF post-reset readiness waits (diff) | |
download | linux-aa2731ad9ad80ac3fca48bd1c4cf0eceede4810e.tar.xz linux-aa2731ad9ad80ac3fca48bd1c4cf0eceede4810e.zip |
libata: separate out ata_wait_ready() and implement ata_wait_after_reset()
Factor out waiting logic (which is common to all ATA controllers) from
ata_sff_wait_ready() into ata_wait_ready(). ata_wait_ready() takes
@check_ready function pointer and uses it to poll for readiness. This
allows non-SFF controllers to use ata_wait_ready() to wait for link
readiness.
This patch also implements ata_wait_after_reset() - generic version of
ata_sff_wait_after_reset() - using ata_wait_ready().
ata_sff_wait_ready() is reimplemented using ata_wait_ready() and
ata_sff_check_ready(). Functionality remains the same.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers/ata/libata.h')
-rw-r--r-- | drivers/ata/libata.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index 11b5f67a19d4..08af43e2c081 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h @@ -81,6 +81,8 @@ extern unsigned ata_exec_internal_sg(struct ata_device *dev, int dma_dir, struct scatterlist *sg, unsigned int n_elem, unsigned long timeout); extern unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd); +extern int ata_wait_ready(struct ata_link *link, unsigned long deadline, + int (*check_ready)(struct ata_link *link)); extern int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, unsigned int flags, u16 *id); extern int ata_dev_reread_id(struct ata_device *dev, unsigned int readid_flags); |