mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-17 07:02:03 -06:00
esp.c: don't use get_cmd() for CMD_SEL DMA commands
This can now be done using the existing logic in esp_do_dma() and 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-52-mark.cave-ayland@ilande.co.uk> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
This commit is contained in:
parent
3fd325a2de
commit
9ff0fd12a2
1 changed files with 10 additions and 12 deletions
|
@ -396,8 +396,6 @@ static void handle_satn(ESPState *s)
|
||||||
|
|
||||||
static void handle_s_without_atn(ESPState *s)
|
static void handle_s_without_atn(ESPState *s)
|
||||||
{
|
{
|
||||||
int32_t cmdlen;
|
|
||||||
|
|
||||||
if (s->dma && !s->dma_enabled) {
|
if (s->dma && !s->dma_enabled) {
|
||||||
s->dma_cb = handle_s_without_atn;
|
s->dma_cb = handle_s_without_atn;
|
||||||
return;
|
return;
|
||||||
|
@ -406,17 +404,17 @@ static void handle_s_without_atn(ESPState *s)
|
||||||
if (esp_select(s) < 0) {
|
if (esp_select(s) < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cmdlen = get_cmd(s, ESP_CMDFIFO_SZ);
|
|
||||||
if (cmdlen > 0) {
|
esp_set_phase(s, STAT_CD);
|
||||||
s->cmdfifo_cdb_offset = 0;
|
s->rregs[ESP_RSEQ] = SEQ_CD;
|
||||||
do_cmd(s);
|
s->cmdfifo_cdb_offset = 0;
|
||||||
} else if (cmdlen == 0) {
|
|
||||||
if (s->dma) {
|
if (s->dma) {
|
||||||
esp_raise_drq(s);
|
esp_do_dma(s);
|
||||||
|
} else {
|
||||||
|
if (get_cmd(s, ESP_CMDFIFO_SZ)) {
|
||||||
|
do_cmd(s);
|
||||||
}
|
}
|
||||||
/* Target present, but no cmd yet - switch to command phase */
|
|
||||||
s->rregs[ESP_RSEQ] = SEQ_CD;
|
|
||||||
esp_set_phase(s, STAT_CD);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue