Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 62738
b: refs/heads/master
c: 110dd8f
h: refs/heads/master
v: v3
  • Loading branch information
James Bottomley authored and James Bottomley committed Jul 20, 2007
1 parent 8b4f002 commit 2e2bfee
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fbc9a5727401442f6972bbddaeb0650f2bf2ebe2
refs/heads/master: 110dd8f19df534b5e464bd1d8f491195a7e62a26
5 changes: 3 additions & 2 deletions trunk/Documentation/DocBook/libata.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,9 @@ void (*irq_clear) (struct ata_port *);

<sect2><title>SATA phy read/write</title>
<programlisting>
u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg);
void (*scr_write) (struct ata_port *ap, unsigned int sc_reg,
int (*scr_read) (struct ata_port *ap, unsigned int sc_reg,
u32 *val);
int (*scr_write) (struct ata_port *ap, unsigned int sc_reg,
u32 val);
</programlisting>

Expand Down
24 changes: 16 additions & 8 deletions trunk/drivers/scsi/libsas/sas_ata.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
qc->tf.nsect = 0;
}

ata_tf_to_fis(&qc->tf, (u8*)&task->ata_task.fis, 0);
ata_tf_to_fis(&qc->tf, 1, 0, (u8*)&task->ata_task.fis);
task->uldd_task = qc;
if (is_atapi_taskfile(&qc->tf)) {
memcpy(task->ata_task.atapi_packet, qc->cdb, qc->dev->cdb_len);
Expand Down Expand Up @@ -298,7 +298,7 @@ static void sas_ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
memcpy(tf, &dev->sata_dev.tf, sizeof (*tf));
}

static void sas_ata_scr_write(struct ata_port *ap, unsigned int sc_reg_in,
static int sas_ata_scr_write(struct ata_port *ap, unsigned int sc_reg_in,
u32 val)
{
struct domain_device *dev = ap->private_data;
Expand All @@ -317,25 +317,33 @@ static void sas_ata_scr_write(struct ata_port *ap, unsigned int sc_reg_in,
case SCR_ACTIVE:
dev->sata_dev.ap->sactive = val;
break;
default:
return -EINVAL;
}
return 0;
}

static u32 sas_ata_scr_read(struct ata_port *ap, unsigned int sc_reg_in)
static int sas_ata_scr_read(struct ata_port *ap, unsigned int sc_reg_in,
u32 *val)
{
struct domain_device *dev = ap->private_data;

SAS_DPRINTK("STUB %s\n", __FUNCTION__);
switch (sc_reg_in) {
case SCR_STATUS:
return dev->sata_dev.sstatus;
*val = dev->sata_dev.sstatus;
return 0;
case SCR_CONTROL:
return dev->sata_dev.scontrol;
*val = dev->sata_dev.scontrol;
return 0;
case SCR_ERROR:
return dev->sata_dev.serror;
*val = dev->sata_dev.serror;
return 0;
case SCR_ACTIVE:
return dev->sata_dev.ap->sactive;
*val = dev->sata_dev.ap->sactive;
return 0;
default:
return 0xffffffffU;
return -EINVAL;
}
}

Expand Down

0 comments on commit 2e2bfee

Please sign in to comment.