mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-02 23:11:53 -06:00
esp.c: update TC check logic in do_dma_pdma_cb() to check for TC == 0
Invert the logic so that the end of DMA transfer check becomes one that checks for TC == 0 in the from device path in do_dma_pdma_cb(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Tested-by: Helge Deller <deller@gmx.de> Tested-by: Thomas Huth <thuth@redhat.com> Message-Id: <20240112125420.514425-10-mark.cave-ayland@ilande.co.uk> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
This commit is contained in:
parent
f21fe39d9c
commit
0f2eb11071
1 changed files with 11 additions and 13 deletions
|
@ -602,7 +602,11 @@ static void do_dma_pdma_cb(ESPState *s)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (esp_get_tc(s) != 0) {
|
if (esp_get_tc(s) == 0) {
|
||||||
|
esp_lower_drq(s);
|
||||||
|
esp_dma_done(s);
|
||||||
|
}
|
||||||
|
|
||||||
/* Copy device data to FIFO */
|
/* Copy device data to FIFO */
|
||||||
len = MIN(s->async_len, esp_get_tc(s));
|
len = MIN(s->async_len, esp_get_tc(s));
|
||||||
len = MIN(len, fifo8_num_free(&s->fifo));
|
len = MIN(len, fifo8_num_free(&s->fifo));
|
||||||
|
@ -611,12 +615,6 @@ static void do_dma_pdma_cb(ESPState *s)
|
||||||
s->async_len -= len;
|
s->async_len -= len;
|
||||||
s->ti_size -= len;
|
s->ti_size -= len;
|
||||||
esp_set_tc(s, esp_get_tc(s) - len);
|
esp_set_tc(s, esp_get_tc(s) - len);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Partially filled a scsi buffer. Complete immediately. */
|
|
||||||
esp_lower_drq(s);
|
|
||||||
esp_dma_done(s);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue