aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-29 16:51:02 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-29 16:51:02 +0000
commitfc4d65da26449765724098520d36ad51959e1d8a (patch)
tree6f579c8a4de48a3c68e281c3b91c9abf297d69b0 /hw
parentb44c08fab34d35e19e4a58be1012ce0ce2740045 (diff)
Fix command len detection (esp_3_cmdlen.diff)
When command is not DMA, TCMID and TCLO registers are not filled. Use command buffer len instead Signed-off-by: Herve Poussineau <hpoussin@reactos.org> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5813 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/esp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/esp.c b/hw/esp.c
index 33f4432173..10c465f4d4 100644
--- a/hw/esp.c
+++ b/hw/esp.c
@@ -167,16 +167,16 @@ static uint32_t get_cmd(ESPState *s, uint8_t *buf)
uint32_t dmalen;
int target;
- dmalen = s->rregs[ESP_TCLO] | (s->rregs[ESP_TCMID] << 8);
target = s->wregs[ESP_WBUSID] & BUSID_DID;
- DPRINTF("get_cmd: len %d target %d\n", dmalen, target);
if (s->dma) {
+ dmalen = s->rregs[ESP_TCLO] | (s->rregs[ESP_TCMID] << 8);
s->dma_memory_read(s->dma_opaque, buf, dmalen);
} else {
+ dmalen = s->ti_size;
+ memcpy(buf, s->ti_buf, dmalen);
buf[0] = 0;
- memcpy(&buf[1], s->ti_buf, dmalen);
- dmalen++;
}
+ DPRINTF("get_cmd: len %d target %d\n", dmalen, target);
s->ti_size = 0;
s->ti_rptr = 0;