aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsas
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2008-04-07 09:47:20 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-04-17 15:44:23 -0400
commit4c9bf4e799ce06a7378f1196587084802a414c03 (patch)
tree70a7d3741e756b975468850537f222349143a0be /drivers/scsi/libsas
parent79f97dadfe9b4b561634d202225ba2fa910dc225 (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.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index 2ec255839dcd..e81f2fd8ba8b 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)
225 return 0; 225 return 0;
226} 226}
227 227
228static bool sas_ata_qc_fill_rtf(struct ata_queued_cmd *qc)
229{
230 struct domain_device *dev = qc->ap->private_data;
231
232 memcpy(&qc->result_tf, &dev->sata_dev.tf, sizeof(qc->result_tf));
233 return true;
234}
235
228static u8 sas_ata_check_status(struct ata_port *ap) 236static u8 sas_ata_check_status(struct ata_port *ap)
229{ 237{
230 struct domain_device *dev = ap->private_data; 238 struct domain_device *dev = ap->private_data;
@@ -292,12 +300,6 @@ static void sas_ata_post_internal(struct ata_queued_cmd *qc)
292 } 300 }
293} 301}
294 302
295static void sas_ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
296{
297 struct domain_device *dev = ap->private_data;
298 memcpy(tf, &dev->sata_dev.tf, sizeof (*tf));
299}
300
301static int sas_ata_scr_write(struct ata_port *ap, unsigned int sc_reg_in, 303static int sas_ata_scr_write(struct ata_port *ap, unsigned int sc_reg_in,
302 u32 val) 304 u32 val)
303{ 305{
@@ -353,10 +355,9 @@ static struct ata_port_operations sas_sata_ops = {
353 .sff_dev_select = ata_noop_dev_select, 355 .sff_dev_select = ata_noop_dev_select,
354 .phy_reset = sas_ata_phy_reset, 356 .phy_reset = sas_ata_phy_reset,
355 .post_internal_cmd = sas_ata_post_internal, 357 .post_internal_cmd = sas_ata_post_internal,
356 .sff_tf_read = sas_ata_tf_read,
357 .qc_prep = ata_noop_qc_prep, 358 .qc_prep = ata_noop_qc_prep,
358 .qc_issue = sas_ata_qc_issue, 359 .qc_issue = sas_ata_qc_issue,
359 .qc_fill_rtf = ata_sff_qc_fill_rtf, 360 .qc_fill_rtf = sas_ata_qc_fill_rtf,
360 .port_start = ata_sas_port_start, 361 .port_start = ata_sas_port_start,
361 .port_stop = ata_sas_port_stop, 362 .port_stop = ata_sas_port_stop,
362 .scr_read = sas_ata_scr_read, 363 .scr_read = sas_ata_scr_read,