bzr branch
http://suren.me/webbzr/alps/pcitool
45
by root
North West Logick DMA implementation |
1 |
#ifndef _PCILIB_DMA_H
|
2 |
#define _PCILIB_DMA_H
|
|
3 |
||
4 |
#define PCILIB_DMA_BUFFER_INVALID ((size_t)-1)
|
|
70
by Suren A. Chilingaryan
Support modifications of DMA engine and allow DMA customizations by Event engine |
5 |
#define PCILIB_DMA_MODIFICATION_DEFAULT 0 /**< first 0x100 are reserved */ |
6 |
||
7 |
typedef uint32_t pcilib_dma_modification_t; |
|
8 |
||
103
by Suren A. Chilingaryan
Provide information about active DMA engines & buffers |
9 |
typedef struct { |
10 |
int started; |
|
11 |
size_t ring_size, buffer_size; |
|
12 |
size_t ring_head, ring_tail; |
|
13 |
} pcilib_dma_engine_status_t; |
|
14 |
||
15 |
typedef struct { |
|
16 |
int used; |
|
17 |
int error; |
|
18 |
int first; |
|
19 |
int last; |
|
20 |
size_t size; |
|
21 |
} pcilib_dma_buffer_status_t; |
|
22 |
||
45
by root
North West Logick DMA implementation |
23 |
struct pcilib_dma_api_description_s { |
70
by Suren A. Chilingaryan
Support modifications of DMA engine and allow DMA customizations by Event engine |
24 |
pcilib_dma_context_t *(*init)(pcilib_t *ctx, pcilib_dma_modification_t type, void *arg); |
45
by root
North West Logick DMA implementation |
25 |
void (*free)(pcilib_dma_context_t *ctx); |
103
by Suren A. Chilingaryan
Provide information about active DMA engines & buffers |
26 |
|
109
by Suren A. Chilingaryan
Improvements of DMA engine |
27 |
int (*status)(pcilib_dma_context_t *ctx, pcilib_dma_engine_t dma, pcilib_dma_engine_status_t *status, size_t n_buffers, pcilib_dma_buffer_status_t *buffers); |
45
by root
North West Logick DMA implementation |
28 |
|
63
by Suren A. Chilingaryan
Provide IRQ enable/disable call |
29 |
int (*enable_irq)(pcilib_dma_context_t *ctx, pcilib_irq_type_t irq_type, pcilib_dma_flags_t flags); |
30 |
int (*disable_irq)(pcilib_dma_context_t *ctx, pcilib_dma_flags_t flags); |
|
88
by Suren A. Chilingaryan
IRQ acknowledgement support in the engine API |
31 |
int (*acknowledge_irq)(pcilib_dma_context_t *ctx, pcilib_irq_type_t irq_type, pcilib_irq_source_t irq_source); |
62
by Suren A. Chilingaryan
Suppport DMA modes in console application (not functional yet) |
32 |
|
63
by Suren A. Chilingaryan
Provide IRQ enable/disable call |
33 |
int (*start_dma)(pcilib_dma_context_t *ctx, pcilib_dma_engine_t dma, pcilib_dma_flags_t flags); |
34 |
int (*stop_dma)(pcilib_dma_context_t *ctx, pcilib_dma_engine_t dma, pcilib_dma_flags_t flags); |
|
62
by Suren A. Chilingaryan
Suppport DMA modes in console application (not functional yet) |
35 |
|
36 |
int (*push)(pcilib_dma_context_t *ctx, pcilib_dma_engine_t dma, uintptr_t addr, size_t size, pcilib_dma_flags_t flags, pcilib_timeout_t timeout, void *buf, size_t *written); |
|
37 |
int (*stream)(pcilib_dma_context_t *ctx, pcilib_dma_engine_t dma, uintptr_t addr, size_t size, pcilib_dma_flags_t flags, pcilib_timeout_t timeout, pcilib_dma_callback_t cb, void *cbattr); |
|
45
by root
North West Logick DMA implementation |
38 |
|
49
by Suren A. Chilingaryan
A bit of renaming |
39 |
double (*benchmark)(pcilib_dma_context_t *ctx, pcilib_dma_engine_addr_t dma, uintptr_t addr, size_t size, size_t iterations, pcilib_dma_direction_t direction); |
45
by root
North West Logick DMA implementation |
40 |
};
|
41 |
||
109
by Suren A. Chilingaryan
Improvements of DMA engine |
42 |
struct pcilib_dma_context_s { |
43 |
int ignore_eop; |
|
44 |
};
|
|
45 |
||
46 |
||
49
by Suren A. Chilingaryan
A bit of renaming |
47 |
int pcilib_set_dma_engine_description(pcilib_t *ctx, pcilib_dma_engine_t engine, pcilib_dma_engine_description_t *desc); |
103
by Suren A. Chilingaryan
Provide information about active DMA engines & buffers |
48 |
int pcilib_get_dma_status(pcilib_t *ctx, pcilib_dma_engine_t dma, pcilib_dma_engine_status_t *status, size_t n_buffers, pcilib_dma_buffer_status_t *buffers); |
45
by root
North West Logick DMA implementation |
49 |
|
50 |
#endif /* _PCILIB_DMA_H */ |