Skip to content

Commit

Permalink
esp.c: update esp_set_tc() to set STAT_TC flag
Browse files Browse the repository at this point in the history
This flag is set once the transfer counter counts down to zero.

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-7-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 1bcaf71 commit c5d7df2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hw/scsi/esp.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,15 @@ static uint32_t esp_get_tc(ESPState *s)

static void esp_set_tc(ESPState *s, uint32_t dmalen)
{
uint32_t old_tc = esp_get_tc(s);

s->rregs[ESP_TCLO] = dmalen;
s->rregs[ESP_TCMID] = dmalen >> 8;
s->rregs[ESP_TCHI] = dmalen >> 16;

if (old_tc && dmalen == 0) {
s->rregs[ESP_RSTAT] |= STAT_TC;
}
}

static uint32_t esp_get_stc(ESPState *s)
Expand Down

0 comments on commit c5d7df2

Please sign in to comment.