[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>

authored by James Bottomley and committed by James Bottomley 110dd8f1 fbc9a572

+19 -10
+3 -2
Documentation/DocBook/libata.tmpl
··· 456 457 <sect2><title>SATA phy read/write</title> 458 <programlisting> 459 - u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg); 460 - void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, 461 u32 val); 462 </programlisting> 463
··· 456 457 <sect2><title>SATA phy read/write</title> 458 <programlisting> 459 + int (*scr_read) (struct ata_port *ap, unsigned int sc_reg, 460 + u32 *val); 461 + int (*scr_write) (struct ata_port *ap, unsigned int sc_reg, 462 u32 val); 463 </programlisting> 464
+16 -8
drivers/scsi/libsas/sas_ata.c
··· 172 qc->tf.nsect = 0; 173 } 174 175 - ata_tf_to_fis(&qc->tf, (u8*)&task->ata_task.fis, 0); 176 task->uldd_task = qc; 177 if (is_atapi_taskfile(&qc->tf)) { 178 memcpy(task->ata_task.atapi_packet, qc->cdb, qc->dev->cdb_len); ··· 298 memcpy(tf, &dev->sata_dev.tf, sizeof (*tf)); 299 } 300 301 - static void sas_ata_scr_write(struct ata_port *ap, unsigned int sc_reg_in, 302 u32 val) 303 { 304 struct domain_device *dev = ap->private_data; ··· 317 case SCR_ACTIVE: 318 dev->sata_dev.ap->sactive = val; 319 break; 320 } 321 } 322 323 - static u32 sas_ata_scr_read(struct ata_port *ap, unsigned int sc_reg_in) 324 { 325 struct domain_device *dev = ap->private_data; 326 327 SAS_DPRINTK("STUB %s\n", __FUNCTION__); 328 switch (sc_reg_in) { 329 case SCR_STATUS: 330 - return dev->sata_dev.sstatus; 331 case SCR_CONTROL: 332 - return dev->sata_dev.scontrol; 333 case SCR_ERROR: 334 - return dev->sata_dev.serror; 335 case SCR_ACTIVE: 336 - return dev->sata_dev.ap->sactive; 337 default: 338 - return 0xffffffffU; 339 } 340 } 341
··· 172 qc->tf.nsect = 0; 173 } 174 175 + ata_tf_to_fis(&qc->tf, 1, 0, (u8*)&task->ata_task.fis); 176 task->uldd_task = qc; 177 if (is_atapi_taskfile(&qc->tf)) { 178 memcpy(task->ata_task.atapi_packet, qc->cdb, qc->dev->cdb_len); ··· 298 memcpy(tf, &dev->sata_dev.tf, sizeof (*tf)); 299 } 300 301 + static int sas_ata_scr_write(struct ata_port *ap, unsigned int sc_reg_in, 302 u32 val) 303 { 304 struct domain_device *dev = ap->private_data; ··· 317 case SCR_ACTIVE: 318 dev->sata_dev.ap->sactive = val; 319 break; 320 + default: 321 + return -EINVAL; 322 } 323 + return 0; 324 } 325 326 + static int sas_ata_scr_read(struct ata_port *ap, unsigned int sc_reg_in, 327 + u32 *val) 328 { 329 struct domain_device *dev = ap->private_data; 330 331 SAS_DPRINTK("STUB %s\n", __FUNCTION__); 332 switch (sc_reg_in) { 333 case SCR_STATUS: 334 + *val = dev->sata_dev.sstatus; 335 + return 0; 336 case SCR_CONTROL: 337 + *val = dev->sata_dev.scontrol; 338 + return 0; 339 case SCR_ERROR: 340 + *val = dev->sata_dev.serror; 341 + return 0; 342 case SCR_ACTIVE: 343 + *val = dev->sata_dev.ap->sactive; 344 + return 0; 345 default: 346 + return -EINVAL; 347 } 348 } 349