diff options
author | Christoph Hellwig <hch@lst.de> | 2011-05-19 10:58:09 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2011-06-15 14:36:16 +0200 |
commit | 4e1e00515e2522bbae98a0653ea2692ec20851ac (patch) | |
tree | 2dac7026a92db73d672d259fd3c125c02a0c5554 /hw/ide/macio.c | |
parent | cb144ccb2ffdb3bca4026455074e434d8db34d73 (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/macio.c')
-rw-r--r-- | hw/ide/macio.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/ide/macio.c b/hw/ide/macio.c index 7107f6b3c2..099b8cbfe9 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -145,12 +145,17 @@ static void pmac_ide_transfer_cb(void *opaque, int ret) io->addr += io->len; io->len = 0; - if (s->is_read) + switch (s->dma_cmd) { + case IDE_DMA_READ: m->aiocb = dma_bdrv_read(s->bs, &s->sg, sector_num, pmac_ide_transfer_cb, io); - else + break; + case IDE_DMA_WRITE: m->aiocb = dma_bdrv_write(s->bs, &s->sg, sector_num, pmac_ide_transfer_cb, io); + break; + } + if (!m->aiocb) pmac_ide_transfer_cb(io, -1); } |