diff options
author | Steve French <sfrench@hera.kernel.org> | 2005-06-06 09:57:33 -0700 |
---|---|---|
committer | Steve French <sfrench@hera.kernel.org> | 2005-06-06 09:57:33 -0700 |
commit | 0b68177ccd12866d9f19cafad212b861c9d02a8c (patch) | |
tree | 6fc26aa59fb183fe9c86d44ae14ce423ad7211da /include/linux/libata.h | |
parent | d0d2f2df65ddea9a30ddd117f769bfff65d3fc56 (diff) | |
parent | 7cef5677ef3a8084f2588ce0a129dc95d65161f6 (diff) | |
download | kernel-crypto-0b68177ccd12866d9f19cafad212b861c9d02a8c.tar.gz kernel-crypto-0b68177ccd12866d9f19cafad212b861c9d02a8c.tar.xz kernel-crypto-0b68177ccd12866d9f19cafad212b861c9d02a8c.zip |
Merge with rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r-- | include/linux/libata.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index e74f301e9ba..b009f801e7c 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -467,12 +467,34 @@ static inline u8 ata_chk_status(struct ata_port *ap) return ap->ops->check_status(ap); } + +/** + * ata_pause - Flush writes and pause 400 nanoseconds. + * @ap: Port to wait for. + * + * LOCKING: + * Inherited from caller. + */ + static inline void ata_pause(struct ata_port *ap) { ata_altstatus(ap); ndelay(400); } + +/** + * ata_busy_wait - Wait for a port status register + * @ap: Port to wait for. + * + * Waits up to max*10 microseconds for the selected bits in the port's + * status register to be cleared. + * Returns final value of status register. + * + * LOCKING: + * Inherited from caller. + */ + static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits, unsigned int max) { @@ -487,6 +509,18 @@ static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits, return status; } + +/** + * ata_wait_idle - Wait for a port to be idle. + * @ap: Port to wait for. + * + * Waits up to 10ms for port's BUSY and DRQ signals to clear. + * Returns final value of status register. + * + * LOCKING: + * Inherited from caller. + */ + static inline u8 ata_wait_idle(struct ata_port *ap) { u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); @@ -525,6 +559,18 @@ static inline void ata_tf_init(struct ata_port *ap, struct ata_taskfile *tf, uns tf->device = ATA_DEVICE_OBS | ATA_DEV1; } + +/** + * ata_irq_on - Enable interrupts on a port. + * @ap: Port on which interrupts are enabled. + * + * Enable interrupts on a legacy IDE device using MMIO or PIO, + * wait for idle, clear any pending interrupts. + * + * LOCKING: + * Inherited from caller. + */ + static inline u8 ata_irq_on(struct ata_port *ap) { struct ata_ioports *ioaddr = &ap->ioaddr; @@ -544,6 +590,18 @@ static inline u8 ata_irq_on(struct ata_port *ap) return tmp; } + +/** + * ata_irq_ack - Acknowledge a device interrupt. + * @ap: Port on which interrupts are enabled. + * + * Wait up to 10 ms for legacy IDE device to become idle (BUSY + * or BUSY+DRQ clear). Obtain dma status and port status from + * device. Clear the interrupt. Return port status. + * + * LOCKING: + */ + static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq) { unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY; |