[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 03/16] ahci: add ncq_err helper
From: |
John Snow |
Subject: |
[Qemu-devel] [PATCH v2 03/16] ahci: add ncq_err helper |
Date: |
Mon, 22 Jun 2015 19:38:15 -0400 |
Set some appropriate error bits for NCQ for us.
Signed-off-by: John Snow <address@hidden>
---
hw/ide/ahci.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index 14eccb8..375aa44 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -922,6 +922,15 @@ out:
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)
{
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);
if (ret < 0) {
- /* error */
- ide_state->error = ABRT_ERR;
- ide_state->status = READY_STAT | ERR_STAT;
- ncq_tfs->drive->port_regs.scr_err |= (1 << ncq_tfs->tag);
+ ncq_err(ncq_tfs);
} else {
ide_state->status = READY_STAT | SEEK_STAT;
}
--
2.1.0
- [Qemu-devel] [PATCH v2 00/16] ahci: ncq cleanup, part 1, John Snow, 2015/06/22
- [Qemu-devel] [PATCH v2 01/16] ahci: Rename NCQFIS structure fields, John Snow, 2015/06/22
- [Qemu-devel] [PATCH v2 03/16] ahci: add ncq_err helper,
John Snow <=
- [Qemu-devel] [PATCH v2 04/16] ahci: check for ncq prdtl overflow, John Snow, 2015/06/22
- [Qemu-devel] [PATCH v2 02/16] ahci: use shorter variables, John Snow, 2015/06/22
- [Qemu-devel] [PATCH v2 06/16] ahci: add ncq debug checks, John Snow, 2015/06/22
- [Qemu-devel] [PATCH v2 05/16] ahci: separate prdtl from opts, John Snow, 2015/06/22
- [Qemu-devel] [PATCH v2 07/16] ahci: ncq sector count correction, John Snow, 2015/06/22
- [Qemu-devel] [PATCH v2 08/16] ahci/qtest: Execute IDENTIFY prior to data commands, John Snow, 2015/06/22
- [Qemu-devel] [PATCH v2 09/16] libqos/ahci: fix cmd_sanity for ncq, John Snow, 2015/06/22
- [Qemu-devel] [PATCH v2 10/16] libqos/ahci: add NCQ frame support, John Snow, 2015/06/22
- [Qemu-devel] [PATCH v2 11/16] libqos/ahci: edit wait to be ncq aware, John Snow, 2015/06/22
- [Qemu-devel] [PATCH v2 12/16] libqos/ahci: adjust expected NCQ interrupts, John Snow, 2015/06/22