diff options
author | James Bottomley <James.Bottomley@steeleye.com> | 2007-07-20 14:11:44 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.localdomain> | 2007-07-20 16:52:08 -0400 |
commit | 110dd8f19df534b5e464bd1d8f491195a7e62a26 (patch) | |
tree | 4c6b1875b4ed081feb898ff62206a1c140df8bea /drivers/scsi/libsas | |
parent | fbc9a5727401442f6972bbddaeb0650f2bf2ebe2 (diff) |
[SCSI] libsas: fix scr_read/write users and update the libata documentation
This fixes up the usage in libsas (which are easy to miss, since they're
only in the scsi-misc tree) ... and also corrects the documentation on
the point of what these two function pointers actually return.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/libsas')
-rw-r--r-- | drivers/scsi/libsas/sas_ata.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 2db258996751..359391f5735f 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c | |||
@@ -172,7 +172,7 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc) | |||
172 | qc->tf.nsect = 0; | 172 | qc->tf.nsect = 0; |
173 | } | 173 | } |
174 | 174 | ||
175 | ata_tf_to_fis(&qc->tf, (u8*)&task->ata_task.fis, 0); | 175 | ata_tf_to_fis(&qc->tf, 1, 0, (u8*)&task->ata_task.fis); |
176 | task->uldd_task = qc; | 176 | task->uldd_task = qc; |
177 | if (is_atapi_taskfile(&qc->tf)) { | 177 | if (is_atapi_taskfile(&qc->tf)) { |
178 | memcpy(task->ata_task.atapi_packet, qc->cdb, qc->dev->cdb_len); | 178 | memcpy(task->ata_task.atapi_packet, qc->cdb, qc->dev->cdb_len); |
@@ -298,7 +298,7 @@ static void sas_ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf) | |||
298 | memcpy(tf, &dev->sata_dev.tf, sizeof (*tf)); | 298 | memcpy(tf, &dev->sata_dev.tf, sizeof (*tf)); |
299 | } | 299 | } |
300 | 300 | ||
301 | static void sas_ata_scr_write(struct ata_port *ap, unsigned int sc_reg_in, | 301 | static int sas_ata_scr_write(struct ata_port *ap, unsigned int sc_reg_in, |
302 | u32 val) | 302 | u32 val) |
303 | { | 303 | { |
304 | struct domain_device *dev = ap->private_data; | 304 | struct domain_device *dev = ap->private_data; |
@@ -317,25 +317,33 @@ static void sas_ata_scr_write(struct ata_port *ap, unsigned int sc_reg_in, | |||
317 | case SCR_ACTIVE: | 317 | case SCR_ACTIVE: |
318 | dev->sata_dev.ap->sactive = val; | 318 | dev->sata_dev.ap->sactive = val; |
319 | break; | 319 | break; |
320 | default: | ||
321 | return -EINVAL; | ||
320 | } | 322 | } |
323 | return 0; | ||
321 | } | 324 | } |
322 | 325 | ||
323 | static u32 sas_ata_scr_read(struct ata_port *ap, unsigned int sc_reg_in) | 326 | static int sas_ata_scr_read(struct ata_port *ap, unsigned int sc_reg_in, |
327 | u32 *val) | ||
324 | { | 328 | { |
325 | struct domain_device *dev = ap->private_data; | 329 | struct domain_device *dev = ap->private_data; |
326 | 330 | ||
327 | SAS_DPRINTK("STUB %s\n", __FUNCTION__); | 331 | SAS_DPRINTK("STUB %s\n", __FUNCTION__); |
328 | switch (sc_reg_in) { | 332 | switch (sc_reg_in) { |
329 | case SCR_STATUS: | 333 | case SCR_STATUS: |
330 | return dev->sata_dev.sstatus; | 334 | *val = dev->sata_dev.sstatus; |
335 | return 0; | ||
331 | case SCR_CONTROL: | 336 | case SCR_CONTROL: |
332 | return dev->sata_dev.scontrol; | 337 | *val = dev->sata_dev.scontrol; |
338 | return 0; | ||
333 | case SCR_ERROR: | 339 | case SCR_ERROR: |
334 | return dev->sata_dev.serror; | 340 | *val = dev->sata_dev.serror; |
341 | return 0; | ||
335 | case SCR_ACTIVE: | 342 | case SCR_ACTIVE: |
336 | return dev->sata_dev.ap->sactive; | 343 | *val = dev->sata_dev.ap->sactive; |
344 | return 0; | ||
337 | default: | 345 | default: |
338 | return 0xffffffffU; | 346 | return -EINVAL; |
339 | } | 347 | } |
340 | } | 348 | } |
341 | 349 | ||