diff mbox series

[v2,35/42] esp: raise interrupt after every non-DMA byte transferred to the FIFO

Message ID 20210209193018.31339-36-mark.cave-ayland@ilande.co.uk (mailing list archive)
State New, archived
Headers show
Series esp: consolidate PDMA transfer buffers and other fixes | expand

Commit Message

Mark Cave-Ayland Feb. 9, 2021, 7:30 p.m. UTC
This matches the description in the datasheet and is required as support for
non-DMA transfers is added.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/scsi/esp.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Laurent Vivier March 3, 2021, 7:59 p.m. UTC | #1
Le 09/02/2021 à 20:30, Mark Cave-Ayland a écrit :
> This matches the description in the datasheet and is required as support for
> non-DMA transfers is added.
> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> ---
>  hw/scsi/esp.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
> index 8b856155d1..617fdcb3ed 100644
> --- a/hw/scsi/esp.c
> +++ b/hw/scsi/esp.c
> @@ -767,6 +767,12 @@ void esp_reg_write(ESPState *s, uint32_t saddr, uint64_t val)
>              s->ti_size++;
>              s->ti_buf[s->ti_wptr++] = val & 0xff;
>          }
> +
> +        /* Non-DMA transfers raise an interrupt after every byte */
> +        if (s->rregs[ESP_CMD] == CMD_TI) {
> +            s->rregs[ESP_RINTR] |= INTR_FC | INTR_BS;
> +            esp_raise_irq(s);
> +        }
>          break;
>      case ESP_CMD:
>          s->rregs[saddr] = val;
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
diff mbox series

Patch

diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index 8b856155d1..617fdcb3ed 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -767,6 +767,12 @@  void esp_reg_write(ESPState *s, uint32_t saddr, uint64_t val)
             s->ti_size++;
             s->ti_buf[s->ti_wptr++] = val & 0xff;
         }
+
+        /* Non-DMA transfers raise an interrupt after every byte */
+        if (s->rregs[ESP_CMD] == CMD_TI) {
+            s->rregs[ESP_RINTR] |= INTR_FC | INTR_BS;
+            esp_raise_irq(s);
+        }
         break;
     case ESP_CMD:
         s->rregs[saddr] = val;