[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 20/42] esp: remove the buf and buflen parameters from get_cmd(
From: |
Mark Cave-Ayland |
Subject: |
[PATCH v3 20/42] esp: remove the buf and buflen parameters from get_cmd() |
Date: |
Thu, 4 Mar 2021 22:10:41 +0000 |
Now that all SCSI commands are accumulated in cmdbuf, remove the buf and buflen
parameters from get_cmd() since these always reference cmdbuf and ESP_CMDBUF_SZ
respectively.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
---
hw/scsi/esp.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index 8ebf5e8d4b..44fddf082c 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -236,15 +236,16 @@ static int get_cmd_cb(ESPState *s)
return 0;
}
-static uint32_t get_cmd(ESPState *s, uint8_t *buf, uint8_t buflen)
+static uint32_t get_cmd(ESPState *s)
{
+ uint8_t *buf = s->cmdbuf;
uint32_t dmalen;
int target;
target = s->wregs[ESP_WBUSID] & BUSID_DID;
if (s->dma) {
dmalen = esp_get_tc(s);
- if (dmalen > buflen) {
+ if (dmalen > ESP_CMDBUF_SZ) {
return 0;
}
if (s->dma_memory_read) {
@@ -323,7 +324,7 @@ static void handle_satn(ESPState *s)
return;
}
s->pdma_cb = satn_pdma_cb;
- s->cmdlen = get_cmd(s, s->cmdbuf, sizeof(s->cmdbuf));
+ s->cmdlen = get_cmd(s);
if (s->cmdlen) {
do_cmd(s);
} else {
@@ -349,7 +350,7 @@ static void handle_s_without_atn(ESPState *s)
return;
}
s->pdma_cb = s_without_satn_pdma_cb;
- s->cmdlen = get_cmd(s, s->cmdbuf, sizeof(s->cmdbuf));
+ s->cmdlen = get_cmd(s);
if (s->cmdlen) {
do_busid_cmd(s, s->cmdbuf, 0);
} else {
@@ -380,7 +381,7 @@ static void handle_satn_stop(ESPState *s)
return;
}
s->pdma_cb = satn_stop_pdma_cb;
- s->cmdlen = get_cmd(s, s->cmdbuf, sizeof(s->cmdbuf));
+ s->cmdlen = get_cmd(s);
if (s->cmdlen) {
trace_esp_handle_satn_stop(s->cmdlen);
s->do_cmd = 1;
--
2.20.1
- [PATCH v3 10/42] esp: introduce esp_get_stc(), (continued)
- [PATCH v3 10/42] esp: introduce esp_get_stc(), Mark Cave-Ayland, 2021/03/04
- [PATCH v3 11/42] esp: apply transfer length adjustment when STC is zero at TC load time, Mark Cave-Ayland, 2021/03/04
- [PATCH v3 12/42] esp: remove dma_counter from ESPState, Mark Cave-Ayland, 2021/03/04
- [PATCH v3 13/42] esp: remove dma_left from ESPState, Mark Cave-Ayland, 2021/03/04
- [PATCH v3 14/42] esp: remove minlen restriction in handle_ti, Mark Cave-Ayland, 2021/03/04
- [PATCH v3 15/42] esp: introduce esp_pdma_read() and esp_pdma_write() functions, Mark Cave-Ayland, 2021/03/04
- [PATCH v3 16/42] esp: use pdma_origin directly in esp_pdma_read()/esp_pdma_write(), Mark Cave-Ayland, 2021/03/04
- [PATCH v3 17/42] esp: move pdma_len and TC logic into esp_pdma_read()/esp_pdma_write(), Mark Cave-Ayland, 2021/03/04
- [PATCH v3 18/42] esp: accumulate SCSI commands for PDMA transfers in cmdbuf instead of pdma_buf, Mark Cave-Ayland, 2021/03/04
- [PATCH v3 19/42] esp: remove buf parameter from do_cmd(), Mark Cave-Ayland, 2021/03/04
- [PATCH v3 20/42] esp: remove the buf and buflen parameters from get_cmd(),
Mark Cave-Ayland <=
- [PATCH v3 21/42] esp: remove redundant pdma_start from ESPState, Mark Cave-Ayland, 2021/03/04
- [PATCH v3 22/42] esp: move PDMA length adjustments into esp_pdma_read()/esp_pdma_write(), Mark Cave-Ayland, 2021/03/04
- [PATCH v3 23/42] esp: use ti_wptr/ti_rptr to manage the current FIFO position for PDMA, Mark Cave-Ayland, 2021/03/04
- [PATCH v3 24/42] esp: use in-built TC to determine PDMA transfer length, Mark Cave-Ayland, 2021/03/04
- [PATCH v3 25/42] esp: remove CMD pdma_origin, Mark Cave-Ayland, 2021/03/04
- [PATCH v3 26/42] esp: rename get_cmd_cb() to esp_select(), Mark Cave-Ayland, 2021/03/04
- [PATCH v3 27/42] esp: fix PDMA target selection, Mark Cave-Ayland, 2021/03/04
- [PATCH v3 28/42] esp: use FIFO for PDMA transfers between initiator and device, Mark Cave-Ayland, 2021/03/04
- [PATCH v3 29/42] esp: remove pdma_origin from ESPState, Mark Cave-Ayland, 2021/03/04
- [PATCH v3 30/42] esp: add 4 byte PDMA read and write transfers, Mark Cave-Ayland, 2021/03/04