diff options
author | Tejun Heo <htejun@gmail.com> | 2008-04-07 22:47:20 +0900 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-17 15:44:23 -0400 |
commit | 4c9bf4e799ce06a7378f1196587084802a414c03 (patch) | |
tree | 70a7d3741e756b975468850537f222349143a0be /drivers/scsi/libsas | |
parent | 79f97dadfe9b4b561634d202225ba2fa910dc225 (diff) |
libata: replace tf_read with qc_fill_rtf for non-SFF drivers
Now that all SFF stuff is separated out of core layer, core layer
doesn't call ops->tf_read directly. It gets called only via
ops->qc_fill_rtf() for non-SFF drivers. This patch directly
implements private ops->qc_fill_rtf() for non-SFF controllers and kill
ops->tf_read().
This is much cleaner for non-SFF controllers as some of them have to
cache SFF register values in private data structure and report the
cached values via ops->tf_read(). Also, ops->tf_read() gets nasty for
controllers which don't have clear notion of TF registers when
operation is not in progress.
As this change makes default ops->qc_fill_rtf unnecessary, move
ata_sff_qc_fill_rtf() form ata_base_port_ops to ata_sff_port_ops where
it belongs.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers/scsi/libsas')
-rw-r--r-- | drivers/scsi/libsas/sas_ata.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 2ec255839dc..e81f2fd8ba8 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -225,6 +225,14 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc) return 0; } +static bool sas_ata_qc_fill_rtf(struct ata_queued_cmd *qc) +{ + struct domain_device *dev = qc->ap->private_data; + + memcpy(&qc->result_tf, &dev->sata_dev.tf, sizeof(qc->result_tf)); + return true; +} + static u8 sas_ata_check_status(struct ata_port *ap) { struct domain_device *dev = ap->private_data; @@ -292,12 +300,6 @@ static void sas_ata_post_internal(struct ata_queued_cmd *qc) } } -static void sas_ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf) -{ - struct domain_device *dev = ap->private_data; - memcpy(tf, &dev->sata_dev.tf, sizeof (*tf)); -} - static int sas_ata_scr_write(struct ata_port *ap, unsigned int sc_reg_in, u32 val) { @@ -353,10 +355,9 @@ static struct ata_port_operations sas_sata_ops = { .sff_dev_select = ata_noop_dev_select, .phy_reset = sas_ata_phy_reset, .post_internal_cmd = sas_ata_post_internal, - .sff_tf_read = sas_ata_tf_read, .qc_prep = ata_noop_qc_prep, .qc_issue = sas_ata_qc_issue, - .qc_fill_rtf = ata_sff_qc_fill_rtf, + .qc_fill_rtf = sas_ata_qc_fill_rtf, .port_start = ata_sas_port_start, .port_stop = ata_sas_port_stop, .scr_read = sas_ata_scr_read, |