hw/ide/ide-internal: Move dma_buf_commit() into ide "namespace"
The identifier suggests that it is a generic DMA function while it is tied to IDE. Fix this by adding an "ide_" prefix. Signed-off-by: Bernhard Beschow <shentey@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20251019210303.104718-7-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
f3c0c9da66
commit
dd012373a5
3 changed files with 10 additions and 10 deletions
|
|
@ -1417,7 +1417,7 @@ static void ahci_pio_transfer(const IDEDMA *dma)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update number of transferred bytes, destroy sglist */
|
/* Update number of transferred bytes, destroy sglist */
|
||||||
dma_buf_commit(s, size);
|
ide_dma_buf_commit(s, size);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
/* declare that we processed everything */
|
/* declare that we processed everything */
|
||||||
|
|
@ -1482,8 +1482,8 @@ static int32_t ahci_dma_prepare_buf(const IDEDMA *dma, int32_t limit)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the command header with a bytes-read value.
|
* Updates the command header with a bytes-read value.
|
||||||
* Called via dma_buf_commit, for both DMA and PIO paths.
|
* Called via ide_dma_buf_commit, for both DMA and PIO paths.
|
||||||
* sglist destruction is handled within dma_buf_commit.
|
* sglist destruction is handled within ide_dma_buf_commit.
|
||||||
*/
|
*/
|
||||||
static void ahci_commit_buf(const IDEDMA *dma, uint32_t tx_bytes)
|
static void ahci_commit_buf(const IDEDMA *dma, uint32_t tx_bytes)
|
||||||
{
|
{
|
||||||
|
|
@ -1511,7 +1511,7 @@ static int ahci_dma_rw_buf(const IDEDMA *dma, bool is_write)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* free sglist, update byte count */
|
/* free sglist, update byte count */
|
||||||
dma_buf_commit(s, l);
|
ide_dma_buf_commit(s, l);
|
||||||
s->io_buffer_index += l;
|
s->io_buffer_index += l;
|
||||||
|
|
||||||
trace_ahci_dma_rw_buf(ad->hba, ad->port_no, l);
|
trace_ahci_dma_rw_buf(ad->hba, ad->port_no, l);
|
||||||
|
|
|
||||||
|
|
@ -827,7 +827,7 @@ static void ide_sector_read(IDEState *s)
|
||||||
ide_sector_read_cb, s);
|
ide_sector_read_cb, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dma_buf_commit(IDEState *s, uint32_t tx_bytes)
|
void ide_dma_buf_commit(IDEState *s, uint32_t tx_bytes)
|
||||||
{
|
{
|
||||||
if (s->bus->dma->ops->commit_buf) {
|
if (s->bus->dma->ops->commit_buf) {
|
||||||
s->bus->dma->ops->commit_buf(s->bus->dma, tx_bytes);
|
s->bus->dma->ops->commit_buf(s->bus->dma, tx_bytes);
|
||||||
|
|
@ -848,7 +848,7 @@ void ide_set_inactive(IDEState *s, bool more)
|
||||||
|
|
||||||
void ide_dma_error(IDEState *s)
|
void ide_dma_error(IDEState *s)
|
||||||
{
|
{
|
||||||
dma_buf_commit(s, 0);
|
ide_dma_buf_commit(s, 0);
|
||||||
ide_abort_command(s);
|
ide_abort_command(s);
|
||||||
ide_set_inactive(s, false);
|
ide_set_inactive(s, false);
|
||||||
ide_bus_set_irq(s->bus);
|
ide_bus_set_irq(s->bus);
|
||||||
|
|
@ -893,7 +893,7 @@ static void ide_dma_cb(void *opaque, int ret)
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
if (ide_handle_rw_error(s, -ret, ide_dma_cmd_to_retry(s->dma_cmd))) {
|
if (ide_handle_rw_error(s, -ret, ide_dma_cmd_to_retry(s->dma_cmd))) {
|
||||||
s->bus->dma->aiocb = NULL;
|
s->bus->dma->aiocb = NULL;
|
||||||
dma_buf_commit(s, 0);
|
ide_dma_buf_commit(s, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -912,7 +912,7 @@ static void ide_dma_cb(void *opaque, int ret)
|
||||||
sector_num = ide_get_sector(s);
|
sector_num = ide_get_sector(s);
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
assert(n * 512 == s->sg.size);
|
assert(n * 512 == s->sg.size);
|
||||||
dma_buf_commit(s, s->sg.size);
|
ide_dma_buf_commit(s, s->sg.size);
|
||||||
sector_num += n;
|
sector_num += n;
|
||||||
ide_set_sector(s, sector_num);
|
ide_set_sector(s, sector_num);
|
||||||
s->nsector -= n;
|
s->nsector -= n;
|
||||||
|
|
@ -944,7 +944,7 @@ static void ide_dma_cb(void *opaque, int ret)
|
||||||
* Reset the Active bit and don't raise the interrupt.
|
* Reset the Active bit and don't raise the interrupt.
|
||||||
*/
|
*/
|
||||||
s->status = READY_STAT | SEEK_STAT;
|
s->status = READY_STAT | SEEK_STAT;
|
||||||
dma_buf_commit(s, 0);
|
ide_dma_buf_commit(s, 0);
|
||||||
goto eot;
|
goto eot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -398,7 +398,7 @@ int64_t ide_get_sector(IDEState *s);
|
||||||
void ide_set_sector(IDEState *s, int64_t sector_num);
|
void ide_set_sector(IDEState *s, int64_t sector_num);
|
||||||
|
|
||||||
void ide_start_dma(IDEState *s, BlockCompletionFunc *cb);
|
void ide_start_dma(IDEState *s, BlockCompletionFunc *cb);
|
||||||
void dma_buf_commit(IDEState *s, uint32_t tx_bytes);
|
void ide_dma_buf_commit(IDEState *s, uint32_t tx_bytes);
|
||||||
void ide_dma_error(IDEState *s);
|
void ide_dma_error(IDEState *s);
|
||||||
void ide_abort_command(IDEState *s);
|
void ide_abort_command(IDEState *s);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue