aboutsummaryrefslogtreecommitdiff
path: root/hw/ide/pci.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2011-05-19 10:58:09 +0200
committerKevin Wolf <kwolf@redhat.com>2011-06-15 14:36:16 +0200
commit4e1e00515e2522bbae98a0653ea2692ec20851ac (patch)
tree2dac7026a92db73d672d259fd3c125c02a0c5554 /hw/ide/pci.c
parentcb144ccb2ffdb3bca4026455074e434d8db34d73 (diff)
ide: allow other dma comands than read and write
Replace the is_read flag with a dma_cmd flag to allow the dma and restart logic to handler other commands like TRIM. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/ide/pci.c')
-rw-r--r--hw/ide/pci.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 7fa32bdff1..80c579457a 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -169,7 +169,7 @@ static int bmdma_set_inactive(IDEDMA *dma)
return 0;
}
-static void bmdma_restart_dma(BMDMAState *bm, int is_read)
+static void bmdma_restart_dma(BMDMAState *bm, enum ide_dma_cmd dma_cmd)
{
IDEState *s = bmdma_active_if(bm);
@@ -177,7 +177,7 @@ static void bmdma_restart_dma(BMDMAState *bm, int is_read)
s->io_buffer_index = 0;
s->io_buffer_size = 0;
s->nsector = bm->nsector;
- s->is_read = is_read;
+ s->dma_cmd = dma_cmd;
bm->cur_addr = bm->addr;
bm->dma_cb = ide_dma_cb;
bmdma_start_dma(&bm->dma, s, bm->dma_cb);
@@ -201,7 +201,7 @@ static void bmdma_restart_bh(void *opaque)
if (bus->error_status & BM_STATUS_DMA_RETRY) {
bus->error_status &= ~(BM_STATUS_DMA_RETRY | BM_STATUS_RETRY_READ);
- bmdma_restart_dma(bm, is_read);
+ bmdma_restart_dma(bm, is_read ? IDE_DMA_READ : IDE_DMA_WRITE);
} else if (bus->error_status & BM_STATUS_PIO_RETRY) {
bus->error_status &= ~(BM_STATUS_PIO_RETRY | BM_STATUS_RETRY_READ);
if (is_read) {