ahci: add ncq_err helper
Set some appropriate error bits for NCQ for us. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1435016308-6150-4-git-send-email-jsnow@redhat.com
This commit is contained in:
parent
b6fe41fa6d
commit
a55c8231d0
|
@ -922,6 +922,15 @@ out:
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ncq_err(NCQTransferState *ncq_tfs)
|
||||||
|
{
|
||||||
|
IDEState *ide_state = &ncq_tfs->drive->port.ifs[0];
|
||||||
|
|
||||||
|
ide_state->error = ABRT_ERR;
|
||||||
|
ide_state->status = READY_STAT | ERR_STAT;
|
||||||
|
ncq_tfs->drive->port_regs.scr_err |= (1 << ncq_tfs->tag);
|
||||||
|
}
|
||||||
|
|
||||||
static void ncq_cb(void *opaque, int ret)
|
static void ncq_cb(void *opaque, int ret)
|
||||||
{
|
{
|
||||||
NCQTransferState *ncq_tfs = (NCQTransferState *)opaque;
|
NCQTransferState *ncq_tfs = (NCQTransferState *)opaque;
|
||||||
|
@ -934,10 +943,7 @@ static void ncq_cb(void *opaque, int ret)
|
||||||
ncq_tfs->drive->port_regs.scr_act &= ~(1 << ncq_tfs->tag);
|
ncq_tfs->drive->port_regs.scr_act &= ~(1 << ncq_tfs->tag);
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
/* error */
|
ncq_err(ncq_tfs);
|
||||||
ide_state->error = ABRT_ERR;
|
|
||||||
ide_state->status = READY_STAT | ERR_STAT;
|
|
||||||
ncq_tfs->drive->port_regs.scr_err |= (1 << ncq_tfs->tag);
|
|
||||||
} else {
|
} else {
|
||||||
ide_state->status = READY_STAT | SEEK_STAT;
|
ide_state->status = READY_STAT | SEEK_STAT;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue