/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to dma/nwl_private.h

  • Committer: Suren A. Chilingaryan
  • Date: 2015-04-20 20:01:04 UTC
  • Revision ID: csa@suren.me-20150420200104-b5xny65io8lvoz3w
Big redign of model structures

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#define _PCILIB_DMA_NWL_PRIVATE_H
3
3
 
4
4
typedef struct nwl_dma_s nwl_dma_t;
5
 
typedef struct pcilib_nwl_engine_description_s pcilib_nwl_engine_description_t;
 
5
typedef struct pcilib_nwl_engine_context_s pcilib_nwl_engine_context_t;
6
6
 
7
7
#define NWL_DMA_IRQ_SOURCE 0
8
8
 
20
20
 
21
21
#include "nwl.h"
22
22
#include "nwl_irq.h"
23
 
#include "nwl_register.h"
24
23
#include "nwl_engine.h"
25
24
#include "nwl_loopback.h"
26
25
 
27
26
#define nwl_read_register(var, ctx, base, reg) pcilib_datacpy(&var, base + reg, 4, 1, ctx->dma_bank->raw_endianess)
28
27
#define nwl_write_register(var, ctx, base, reg) pcilib_datacpy(base + reg, &var, 4, 1, ctx->dma_bank->raw_endianess)
29
28
 
30
 
struct pcilib_nwl_engine_description_s {
31
 
    pcilib_dma_engine_description_t desc;
 
29
 
 
30
struct pcilib_nwl_engine_context_s {
 
31
    const pcilib_dma_engine_description_t *desc;
32
32
    char *base_addr;
33
 
    
 
33
 
34
34
    size_t ring_size, page_size;
35
35
    size_t head, tail;
36
36
    pcilib_kmem_handle_t *ring;
42
42
    int preserve;                       /**< indicates that DMA should not be stopped during clean-up */
43
43
};
44
44
 
 
45
typedef enum {
 
46
    NWL_MODIFICATION_DEFAULT,
 
47
    NWL_MODIFICATION_IPECAMERA
 
48
} nwl_modification_t;
45
49
 
46
50
struct nwl_dma_s {
47
 
    struct pcilib_dma_context_s dmactx;
48
 
    
49
 
    pcilib_t *pcilib;
50
 
    
51
 
    pcilib_dma_modification_t type;
52
 
    
53
 
    pcilib_register_bank_description_t *dma_bank;
 
51
    pcilib_dma_context_t dmactx;
 
52
 
 
53
    nwl_modification_t type;
 
54
    int ignore_eop;                     /**< always set end-of-packet */
 
55
 
 
56
    const pcilib_register_bank_description_t *dma_bank;
54
57
    char *base_addr;
55
58
 
56
59
    pcilib_irq_type_t irq_enabled;      /**< indicates that IRQs are enabled */
59
62
    int irq_started;                    /**< indicates that IRQ subsystem is initialized (detecting which types should be preserverd) */    
60
63
    int loopback_started;               /**< indicates that benchmarking subsystem is initialized */
61
64
 
62
 
    pcilib_dma_engine_t n_engines;
63
 
    pcilib_nwl_engine_description_t engines[PCILIB_MAX_DMA_ENGINES + 1];
 
65
//    pcilib_dma_engine_t n_engines;
 
66
    pcilib_nwl_engine_context_t engines[PCILIB_MAX_DMA_ENGINES + 1];
64
67
};
65
68
 
 
69
int nwl_add_registers(nwl_dma_t *ctx);
66
70
 
67
71
#endif /* _PCILIB_DMA_NWL_PRIVATE_H */