qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 08/42] esp: determine transfer direction directly from SCS


From: Laurent Vivier
Subject: Re: [PATCH v2 08/42] esp: determine transfer direction directly from SCSI phase
Date: Mon, 1 Mar 2021 22:18:38 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0

Le 09/02/2021 à 20:29, Mark Cave-Ayland a écrit :
> The transfer direction is currently determined by checking the sign of ti_size
> but as this series progresses ti_size can be zero at the end of the transfer.
> 
> Use the SCSI phase to determine the transfer direction as used in other SCSI
> controller implementations.
> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> ---
>  hw/scsi/esp.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
> index db2ea02549..e82e75d490 100644
> --- a/hw/scsi/esp.c
> +++ b/hw/scsi/esp.c
> @@ -356,7 +356,7 @@ static void esp_dma_done(ESPState *s)
>  
>  static void do_dma_pdma_cb(ESPState *s)
>  {
> -    int to_device = (s->ti_size < 0);
> +    int to_device = ((s->rregs[ESP_RSTAT] & 7) == STAT_DO);
>      int len = s->pdma_cur - s->pdma_start;
>      if (s->do_cmd) {
>          s->ti_size = 0;
> @@ -392,7 +392,7 @@ static void do_dma_pdma_cb(ESPState *s)
>  static void esp_do_dma(ESPState *s)
>  {
>      uint32_t len;
> -    int to_device;
> +    int to_device = ((s->rregs[ESP_RSTAT] & 7) == STAT_DO);
>  
>      len = s->dma_left;
>      if (s->do_cmd) {
> @@ -425,7 +425,6 @@ static void esp_do_dma(ESPState *s)
>      if (len > s->async_len) {
>          len = s->async_len;
>      }
> -    to_device = (s->ti_size < 0);
>      if (to_device) {
>          if (s->dma_memory_read) {
>              s->dma_memory_read(s->dma_opaque, s->async_buf, len);
> 

Reviewed-by: Laurent Vivier <laurent@vivier.Eu>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]