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