2011-12-21 18:11:35 +04:00
|
|
|
struct dma_context_metadata {
|
|
|
|
/* data descriptor md */
|
|
|
|
uint16_t metadata;
|
|
|
|
};
|
|
|
|
|
2008-05-11 19:03:06 +04:00
|
|
|
struct etraxfs_dma_client
|
|
|
|
{
|
|
|
|
/* DMA controller. */
|
|
|
|
int channel;
|
|
|
|
void *ctrl;
|
|
|
|
|
|
|
|
/* client. */
|
2011-12-21 18:11:35 +04:00
|
|
|
struct {
|
|
|
|
int (*push)(void *opaque, unsigned char *buf,
|
|
|
|
int len, bool eop);
|
2008-05-11 19:03:06 +04:00
|
|
|
void (*pull)(void *opaque);
|
2011-12-21 18:11:35 +04:00
|
|
|
void (*metadata_push)(void *opaque,
|
|
|
|
const struct dma_context_metadata *md);
|
2008-05-11 19:03:06 +04:00
|
|
|
void *opaque;
|
|
|
|
} client;
|
|
|
|
};
|
|
|
|
|
2012-10-23 14:30:10 +04:00
|
|
|
void *etraxfs_dmac_init(hwaddr base, int nr_channels);
|
2008-05-11 19:03:06 +04:00
|
|
|
void etraxfs_dmac_connect(void *opaque, int channel, qemu_irq *line,
|
|
|
|
int input);
|
|
|
|
void etraxfs_dmac_connect_client(void *opaque, int c,
|
|
|
|
struct etraxfs_dma_client *cl);
|
|
|
|
int etraxfs_dmac_input(struct etraxfs_dma_client *client,
|
|
|
|
void *buf, int len, int eop);
|