xref: /openbmc/qemu/include/hw/ide/ide-dma.h (revision 1b986676)
1 #ifndef HW_IDE_DMA_H
2 #define HW_IDE_DMA_H
3 
4 #include "block/aio.h"
5 #include "qemu/iov.h"
6 
7 typedef struct IDEState IDEState;
8 typedef struct IDEDMAOps IDEDMAOps;
9 typedef struct IDEDMA IDEDMA;
10 
11 typedef void DMAStartFunc(const IDEDMA *, IDEState *, BlockCompletionFunc *);
12 typedef void DMAVoidFunc(const IDEDMA *);
13 typedef int DMAIntFunc(const IDEDMA *, bool);
14 typedef int32_t DMAInt32Func(const IDEDMA *, int32_t len);
15 typedef void DMAu32Func(const IDEDMA *, uint32_t);
16 typedef void DMAStopFunc(const IDEDMA *, bool);
17 
18 struct IDEDMAOps {
19     DMAStartFunc *start_dma;
20     DMAVoidFunc *pio_transfer;
21     DMAInt32Func *prepare_buf;
22     DMAu32Func *commit_buf;
23     DMAIntFunc *rw_buf;
24     DMAVoidFunc *restart;
25     DMAVoidFunc *restart_dma;
26     DMAStopFunc *set_inactive;
27     DMAVoidFunc *cmd_done;
28     DMAVoidFunc *reset;
29 };
30 
31 struct IDEDMA {
32     const IDEDMAOps *ops;
33     QEMUIOVector qiov;
34     BlockAIOCB *aiocb;
35 };
36 
37 #endif
38