[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/4] Refactor lsi_do_command to queue read and write
From: |
Ryan Harper |
Subject: |
[Qemu-devel] [PATCH 2/4] Refactor lsi_do_command to queue read and write ops |
Date: |
Fri, 3 Oct 2008 17:05:29 -0500 |
The patch refactors lsi_do_command to queue both read and write operations where
previously the code only queue'ed read operations.
Signed-off-by: Ryan Harper <address@hidden>
diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
index 5c161a1..5c0535c 100644
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -649,18 +649,23 @@ static void lsi_do_command(LSIState *s)
}
if (!s->command_complete) {
- if (n) {
- /* Command did not complete immediately so disconnect. */
- lsi_add_msg_byte(s, 2); /* SAVE DATA POINTER */
- lsi_add_msg_byte(s, 4); /* DISCONNECT */
- /* wait data */
- lsi_set_phase(s, PHASE_MI);
- s->msg_action = 1;
- lsi_queue_command(s, 0);
- } else {
- /* wait command complete */
+ if (n == 0) {
+ /* not a read or write command, just wait on completion */
lsi_set_phase(s, PHASE_DI);
+ return;
}
+
+ /* read or write command that did not complete immediately so
+ * inject a disconnect message, and queue the command */
+ lsi_add_msg_byte(s, 2); /* SAVE DATA POINTER */
+ lsi_add_msg_byte(s, 4); /* DISCONNECT */
+ /* wait data */
+ lsi_set_phase(s, PHASE_MI);
+ s->msg_action = 1;
+ if (n > 0) /* read operation */
+ lsi_queue_command(s, 0);
+ else /* write operation */
+ lsi_queue_command(s, 1);
}
}
- [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, 2008/10/03
- [Qemu-devel] [PATCH 2/4] Refactor lsi_do_command to queue read and write ops,
Ryan Harper <=
- [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
- Re: [Qemu-devel] [PATCH 4/4] Reallocate dma buffers in read/write path if needed, Ryan Harper, 2008/10/05