OpenCores
URL https://opencores.org/ocsvn/pcie_ds_dma/pcie_ds_dma/trunk

Subversion Repositories pcie_ds_dma

[/] [pcie_ds_dma/] [trunk/] [soft/] [linux/] [driver/] [pexdrv/] [pexmodule.h] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dsmv
 
2
#ifndef _PEXDEV_H_
3
#define _PEXDEV_H_
4
 
5
#include <linux/cdev.h>
6
#include <linux/sched.h>
7
#include <linux/version.h>
8
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,37)
9
#include <linux/semaphore.h>
10
#endif
11
 
12
//-----------------------------------------------------------------------------
13
 
14
#ifndef _EVENT_H_
15
    #include "event.h"
16
#endif
17
#ifndef  _DMA_CHAN_H_
18
    #include "dmachan.h"
19
#endif
20
#ifndef _STREAMLL_H_
21
    #include "streamll.h"
22
#endif
23
 
24
//-----------------------------------------------------------------------------
25
 
26
struct address_t {
27
 
28
    size_t physical_address;
29
    void  *virtual_address;
30
    size_t size;
31
 
32
};
33
 
34
//-----------------------------------------------------------------------------
35
 
36
struct mem_t {
37
 
38
    struct list_head list;
39
    dma_addr_t dma_handle;
40
    void  *cpu_addr;
41
    size_t size;
42
 
43
};
44
 
45
//-----------------------------------------------------------------------------
46
 
47
struct dma_channel {
48
    int                     m_Number;
49
    int                     m_Use;
50
    struct pci_dev         *m_pci;
51
    spinlock_t              m_MemListLock;
52
    atomic_t                m_MemListCount;
53
    struct list_head        m_MemList;
54
    struct mem_t            m_MemStub;
55
};
56
 
57
//-----------------------------------------------------------------------------
58
 
59
#define PEX_DRIVER_NAME             "pex_driver"
60
#define MAX_NUMBER_OF_DMACHANNELS   4
61
#define NUMBER_OF_PLDS              4
62
#define IRQ_NUMBER                  1
63
#define NUM_TETR_IRQ                8
64
 
65
//-----------------------------------------------------------------------------
66
 
67
struct pex_device {
68
 
69
    struct list_head        m_list;
70
    char                    m_name[128];
71
    atomic_t                m_TotalIRQ;
72
    dev_t                   m_devno;
73
    struct class           *m_class;
74
    struct device          *m_device;
75
    struct pci_dev         *m_pci;
76
 
77
    struct address_t        m_BAR0;
78
    struct address_t        m_BAR1;
79
 
80
    spinlock_t              m_BoardLock;
81
    struct mutex            m_BoardMutex;
82
    struct semaphore        m_BoardSem;
83
    u32                     m_Interrupt;
84
    u32                     m_DmaIrqEnbl;
85
    u32                     m_FlgIrqEnbl;
86
    u32                     m_BoardIndex;
87
    wait_queue_head_t       m_WaitQueue;
88
    struct timer_list       m_TimeoutTimer;
89
    atomic_t                m_IsTimeout;
90
    struct cdev             m_cdev;
91
 
92
    spinlock_t              m_MemListLock;
93
    atomic_t                m_MemListCount;
94
    struct list_head        m_MemList;
95
 
96
    struct CDmaChannel     *m_DmaChannel[MAX_NUMBER_OF_DMACHANNELS];    //
97
    u32                     m_PldStatus[NUMBER_OF_PLDS];                        //
98
    u32                     m_MemOpUseCount;    // счетчик использования диапазона памяти (PE_MAIN on AMBPEX8)
99
    u16                     m_BlockCnt;
100
    u32                     m_DmaChanMask;
101
    u32                     m_DmaChanEnbl[MAX_NUMBER_OF_DMACHANNELS];
102
    u32                     m_DmaFifoSize[MAX_NUMBER_OF_DMACHANNELS];
103
    u32                     m_DmaDir[MAX_NUMBER_OF_DMACHANNELS];
104
    u32                     m_MaxDmaSize[MAX_NUMBER_OF_DMACHANNELS];
105
    u16                     m_BlockFifoId[MAX_NUMBER_OF_DMACHANNELS];
106
    u32                     m_FifoAddr[MAX_NUMBER_OF_DMACHANNELS];
107
    u32                     m_TetrIrq[NUM_TETR_IRQ];
108
    u32                     m_primChan;
109
};
110
 
111
//-----------------------------------------------------------------------------
112
 
113
extern int dbg_trace;
114
extern int err_trace;
115
 
116
#ifndef PRINTK
117
#define PRINTK(S...) printk(S)
118
#endif
119
 
120
#define dbg_msg(flag, S...) do { if(flag) PRINTK(KERN_DEBUG S); } while(0)
121
#define err_msg(flag, S...) do { if(flag) PRINTK(KERN_ERR S); } while(0)
122
 
123
//-----------------------------------------------------------------------------
124
 
125
#endif //_PEXDEV_H_

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.