1
#ifndef _PCILIB_DMA_NWL_PRIVATE_H
2
#define _PCILIB_DMA_NWL_PRIVATE_H
4
typedef struct nwl_dma_s nwl_dma_t;
5
typedef struct pcilib_nwl_engine_description_s pcilib_nwl_engine_description_t;
7
#define NWL_DMA_IRQ_SOURCE 0
9
#define NWL_XAUI_ENGINE 0
10
#define NWL_XRAWDATA_ENGINE 1
11
#define NWL_MAX_PACKET_SIZE 4096 //16384
12
//#define NWL_GENERATE_DMA_IRQ
14
#define PCILIB_NWL_ALIGNMENT 64 // in bytes
15
#define PCILIB_NWL_DMA_DESCRIPTOR_SIZE 64 // in bytes
16
#define PCILIB_NWL_DMA_PAGES 256 // 1024
18
//#define DEBUG_HARDWARE
23
#include "nwl_register.h"
24
#include "nwl_engine.h"
25
#include "nwl_loopback.h"
27
#define nwl_read_register(var, ctx, base, reg) pcilib_datacpy(&var, base + reg, 4, 1, ctx->dma_bank->raw_endianess)
28
#define nwl_write_register(var, ctx, base, reg) pcilib_datacpy(base + reg, &var, 4, 1, ctx->dma_bank->raw_endianess)
30
struct pcilib_nwl_engine_description_s {
31
pcilib_dma_engine_description_t desc;
34
size_t ring_size, page_size;
36
pcilib_kmem_handle_t *ring;
37
pcilib_kmem_handle_t *pages;
39
int started; /**< indicates that DMA buffers are initialized and reading is allowed */
40
int writting; /**< indicates that we are in middle of writting packet */
41
int reused; /**< indicates that DMA was found intialized, buffers were reused, and no additional initialization is needed */
42
int preserve; /**< indicates that DMA should not be stopped during clean-up */
47
struct pcilib_dma_context_s dmactx;
51
pcilib_dma_modification_t type;
53
pcilib_register_bank_description_t *dma_bank;
56
pcilib_irq_type_t irq_enabled; /**< indicates that IRQs are enabled */
57
pcilib_irq_type_t irq_preserve; /**< indicates that IRQs should not be disabled during clean-up */
58
int started; /**< indicates that DMA subsystem is initialized and DMA engine can start */
59
int irq_started; /**< indicates that IRQ subsystem is initialized (detecting which types should be preserverd) */
60
int loopback_started; /**< indicates that benchmarking subsystem is initialized */
62
pcilib_dma_engine_t n_engines;
63
pcilib_nwl_engine_description_t engines[PCILIB_MAX_DMA_ENGINES + 1];
67
#endif /* _PCILIB_DMA_NWL_PRIVATE_H */