Commit fc4d65da26449765724098520d36ad51959e1d8a
1 parent
b44c08fa
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
Showing
1 changed file
with
4 additions
and
4 deletions
hw/esp.c
... | ... | @@ -167,16 +167,16 @@ static uint32_t get_cmd(ESPState *s, uint8_t *buf) |
167 | 167 | uint32_t dmalen; |
168 | 168 | int target; |
169 | 169 | |
170 | - dmalen = s->rregs[ESP_TCLO] | (s->rregs[ESP_TCMID] << 8); | |
171 | 170 | target = s->wregs[ESP_WBUSID] & BUSID_DID; |
172 | - DPRINTF("get_cmd: len %d target %d\n", dmalen, target); | |
173 | 171 | if (s->dma) { |
172 | + dmalen = s->rregs[ESP_TCLO] | (s->rregs[ESP_TCMID] << 8); | |
174 | 173 | s->dma_memory_read(s->dma_opaque, buf, dmalen); |
175 | 174 | } else { |
175 | + dmalen = s->ti_size; | |
176 | + memcpy(buf, s->ti_buf, dmalen); | |
176 | 177 | buf[0] = 0; |
177 | - memcpy(&buf[1], s->ti_buf, dmalen); | |
178 | - dmalen++; | |
179 | 178 | } |
179 | + DPRINTF("get_cmd: len %d target %d\n", dmalen, target); | |
180 | 180 | |
181 | 181 | s->ti_size = 0; |
182 | 182 | s->ti_rptr = 0; | ... | ... |