[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/4] lsi_queue_command: add dma direction parameter
From: |
Ryan Harper |
Subject: |
[Qemu-devel] [PATCH 1/4] lsi_queue_command: add dma direction parameter |
Date: |
Fri, 3 Oct 2008 17:05:28 -0500 |
The patch changes lsi_queue_command to take a parameter indicating whether the
queue'ed command is a read or write. This is needed because the lsi device may
change phase we've recorded the type of operation.
Signed-off-by: Ryan Harper <address@hidden>
diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
index 53a2add..5c161a1 100644
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -494,7 +494,7 @@ static void lsi_do_dma(LSIState *s, int out)
/* Add a command to the queue. */
-static void lsi_queue_command(LSIState *s)
+static void lsi_queue_command(LSIState *s, int out)
{
lsi_queue *p;
@@ -506,7 +506,9 @@ static void lsi_queue_command(LSIState *s)
p = &s->queue[s->active_commands++];
p->tag = s->current_tag;
p->pending = 0;
- p->out = (s->sstat1 & PHASE_MASK) == PHASE_DO;
+ /* the device may change state before we can queue the command
+ * the caller knows if the command is input/output */
+ p->out = out;
}
/* Queue a byte for a MSG IN phase. */
@@ -654,7 +656,7 @@ static void lsi_do_command(LSIState *s)
/* wait data */
lsi_set_phase(s, PHASE_MI);
s->msg_action = 1;
- lsi_queue_command(s);
+ lsi_queue_command(s, 0);
} else {
/* wait command complete */
lsi_set_phase(s, PHASE_DI);
- [Qemu-devel] [PATCH 0/4] Improve emulated scsi write performance, Ryan Harper, 2008/10/03
- [Qemu-devel] [PATCH 1/4] lsi_queue_command: add dma direction parameter,
Ryan Harper <=
- [Qemu-devel] [PATCH 2/4] Refactor lsi_do_command to queue read and write ops, Ryan Harper, 2008/10/03
- [Qemu-devel] [PATCH 3/4] Refactor scsi-disk layer for queue'ing writes, Ryan Harper, 2008/10/03
- [Qemu-devel] [PATCH 4/4] Reallocate dma buffers in read/write path if needed, Ryan Harper, 2008/10/03
- Re: [Qemu-devel] [PATCH 4/4] Reallocate dma buffers in read/write path if needed, Paul Brook, 2008/10/03
- Re: [Qemu-devel] [PATCH 4/4] Reallocate dma buffers in read/write path if needed, Anthony Liguori, 2008/10/03
- Re: [Qemu-devel] [PATCH 4/4] Reallocate dma buffers in read/write path if needed, Paul Brook, 2008/10/03
- Re: [Qemu-devel] [PATCH 4/4] Reallocate dma buffers in read/write path if needed, Avi Kivity, 2008/10/04
- Message not available
- Re: [Qemu-devel] [PATCH 4/4] Reallocate dma buffers in read/write path if needed, Ryan Harper, 2008/10/04
- Re: [Qemu-devel] [PATCH 4/4] Reallocate dma buffers in read/write path if needed, Anthony Liguori, 2008/10/04
- Re: [Qemu-devel] [PATCH 4/4] Reallocate dma buffers in read/write path if needed, Avi Kivity, 2008/10/05