[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 15/42] esp: introduce esp_pdma_read() and esp_pdma_write()
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v2 15/42] esp: introduce esp_pdma_read() and esp_pdma_write() functions |
Date: |
Wed, 10 Feb 2021 23:51:29 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 |
Hi Mark,
On 2/9/21 8:29 PM, Mark Cave-Ayland wrote:
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> ---
> hw/scsi/esp.c | 28 ++++++++++++++++++++--------
> 1 file changed, 20 insertions(+), 8 deletions(-)
>
> diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
> index e7cf36f4b8..b0cba889a9 100644
> --- a/hw/scsi/esp.c
> +++ b/hw/scsi/esp.c
> @@ -151,6 +151,20 @@ static uint8_t *get_pdma_buf(ESPState *s)
> return NULL;
> }
>
Can you add get_pdma_len() (similar to get_pdma_buf) and ...
> +static uint8_t esp_pdma_read(ESPState *s)
> +{
> + uint8_t *buf = get_pdma_buf(s);
> +
assert(s->pdma_cur < get_pdma_len(s));
> + return buf[s->pdma_cur++];
> +}
> +
> +static void esp_pdma_write(ESPState *s, uint8_t val)
> +{
> + uint8_t *buf = get_pdma_buf(s);
> +
Ditto.
> + buf[s->pdma_cur++] = val;
> +}
Otherwise:
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
- [PATCH v2 11/42] esp: apply transfer length adjustment when STC is zero at TC load time, (continued)
- [PATCH v2 11/42] esp: apply transfer length adjustment when STC is zero at TC load time, Mark Cave-Ayland, 2021/02/09
- [PATCH v2 12/42] esp: remove dma_counter from ESPState, Mark Cave-Ayland, 2021/02/09
- [PATCH v2 13/42] esp: remove dma_left from ESPState, Mark Cave-Ayland, 2021/02/09
- [PATCH v2 14/42] esp: remove minlen restriction in handle_ti, Mark Cave-Ayland, 2021/02/09
- [PATCH v2 15/42] esp: introduce esp_pdma_read() and esp_pdma_write() functions, Mark Cave-Ayland, 2021/02/09
- Re: [PATCH v2 15/42] esp: introduce esp_pdma_read() and esp_pdma_write() functions,
Philippe Mathieu-Daudé <=
- [PATCH v2 16/42] esp: use pdma_origin directly in esp_pdma_read()/esp_pdma_write(), Mark Cave-Ayland, 2021/02/09
- [PATCH v2 17/42] esp: move pdma_len and TC logic into esp_pdma_read()/esp_pdma_write(), Mark Cave-Ayland, 2021/02/09
- [PATCH v2 18/42] esp: accumulate SCSI commands for PDMA transfers in cmdbuf instead of pdma_buf, Mark Cave-Ayland, 2021/02/09
- [PATCH v2 19/42] esp: remove buf parameter from do_cmd(), Mark Cave-Ayland, 2021/02/09