Skip to content

Commit

Permalink
esp.c: move CMD_TI end of message phase detection to esp_do_dma() and…
Browse files Browse the repository at this point in the history
… do_dma_pdma_cb()

The existing check for TC == 0 is only valid during a TI command.

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-51-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  • Loading branch information
mcayland committed Feb 13, 2024
1 parent 3ee9a47 commit 3fd325a
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions hw/scsi/esp.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,14 +555,16 @@ static void do_dma_pdma_cb(ESPState *s)
}
}
break;
}

/* ATN remains asserted until TC == 0 */
if (esp_get_tc(s) == 0) {
esp_set_phase(s, STAT_CD);
s->rregs[ESP_RSEQ] = SEQ_CD;
s->rregs[ESP_RINTR] |= INTR_BS;
esp_raise_irq(s);
case CMD_TI | CMD_DMA:
/* ATN remains asserted until TC == 0 */
if (esp_get_tc(s) == 0) {
esp_set_phase(s, STAT_CD);
s->rregs[ESP_RSEQ] = SEQ_CD;
s->rregs[ESP_RINTR] |= INTR_BS;
esp_raise_irq(s);
}
break;
}
break;

Expand Down Expand Up @@ -675,14 +677,16 @@ static void esp_do_dma(ESPState *s)
}
}
break;
}

/* ATN remains asserted until TC == 0 */
if (esp_get_tc(s) == 0) {
esp_set_phase(s, STAT_CD);
s->rregs[ESP_RSEQ] = SEQ_CD;
s->rregs[ESP_RINTR] |= INTR_BS;
esp_raise_irq(s);
case CMD_TI | CMD_DMA:
/* ATN remains asserted until TC == 0 */
if (esp_get_tc(s) == 0) {
esp_set_phase(s, STAT_CD);
s->rregs[ESP_RSEQ] = SEQ_CD;
s->rregs[ESP_RINTR] |= INTR_BS;
esp_raise_irq(s);
}
break;
}
break;

Expand Down

0 comments on commit 3fd325a

Please sign in to comment.