diff options
author | Tejun Heo <htejun@gmail.com> | 2007-12-05 02:43:07 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-01-23 05:24:14 -0500 |
commit | 55dba3120fbcbea6800f9a18503d25f73212a347 (patch) | |
tree | 1b23e606aad8bc58dbe68ca905c0658625fb176e /include/linux/libata.h | |
parent | ceb0c642624f634c5b4f46b0e22df19be87a2e53 (diff) |
libata: update ->data_xfer hook for ATAPI
Depending on how many bytes are transferred as a unit, PIO data
transfer may consume more bytes than requested. Knowing how much
data is consumed is necessary to determine how much is left for
draining. This patch update ->data_xfer such that it returns the
number of consumed bytes.
While at it, it also makes the following changes.
* s/adev/dev/
* use READ/WRITE constants for rw indication
* misc clean ups
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 | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index 03afcd63202d..7fa96cb4f6db 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -701,7 +701,8 @@ struct ata_port_operations { | |||
701 | void (*bmdma_setup) (struct ata_queued_cmd *qc); | 701 | void (*bmdma_setup) (struct ata_queued_cmd *qc); |
702 | void (*bmdma_start) (struct ata_queued_cmd *qc); | 702 | void (*bmdma_start) (struct ata_queued_cmd *qc); |
703 | 703 | ||
704 | void (*data_xfer) (struct ata_device *, unsigned char *, unsigned int, int); | 704 | unsigned int (*data_xfer) (struct ata_device *dev, unsigned char *buf, |
705 | unsigned int buflen, int rw); | ||
705 | 706 | ||
706 | int (*qc_defer) (struct ata_queued_cmd *qc); | 707 | int (*qc_defer) (struct ata_queued_cmd *qc); |
707 | void (*qc_prep) (struct ata_queued_cmd *qc); | 708 | void (*qc_prep) (struct ata_queued_cmd *qc); |
@@ -881,10 +882,10 @@ extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf) | |||
881 | extern int ata_port_start(struct ata_port *ap); | 882 | extern int ata_port_start(struct ata_port *ap); |
882 | extern int ata_sff_port_start(struct ata_port *ap); | 883 | extern int ata_sff_port_start(struct ata_port *ap); |
883 | extern irqreturn_t ata_interrupt(int irq, void *dev_instance); | 884 | extern irqreturn_t ata_interrupt(int irq, void *dev_instance); |
884 | extern void ata_data_xfer(struct ata_device *adev, unsigned char *buf, | 885 | extern unsigned int ata_data_xfer(struct ata_device *dev, |
885 | unsigned int buflen, int write_data); | 886 | unsigned char *buf, unsigned int buflen, int rw); |
886 | extern void ata_data_xfer_noirq(struct ata_device *adev, unsigned char *buf, | 887 | extern unsigned int ata_data_xfer_noirq(struct ata_device *dev, |
887 | unsigned int buflen, int write_data); | 888 | unsigned char *buf, unsigned int buflen, int rw); |
888 | extern int ata_std_qc_defer(struct ata_queued_cmd *qc); | 889 | extern int ata_std_qc_defer(struct ata_queued_cmd *qc); |
889 | extern void ata_dumb_qc_prep(struct ata_queued_cmd *qc); | 890 | extern void ata_dumb_qc_prep(struct ata_queued_cmd *qc); |
890 | extern void ata_qc_prep(struct ata_queued_cmd *qc); | 891 | extern void ata_qc_prep(struct ata_queued_cmd *qc); |