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 15

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 7 v.karak
#ifndef _MEMORY_H_
24
    #include "memory.h"
25
#endif
26 2 dsmv
 
27
//-----------------------------------------------------------------------------
28
 
29
#define PEX_DRIVER_NAME             "pex_driver"
30
#define MAX_NUMBER_OF_DMACHANNELS   4
31
#define NUMBER_OF_PLDS              4
32
#define IRQ_NUMBER                  1
33
#define NUM_TETR_IRQ                8
34
 
35
//-----------------------------------------------------------------------------
36
 
37
struct pex_device {
38
 
39
    struct list_head        m_list;
40
    char                    m_name[128];
41
    atomic_t                m_TotalIRQ;
42
    dev_t                   m_devno;
43
    struct class           *m_class;
44
    struct device          *m_device;
45
    struct pci_dev         *m_pci;
46
 
47
    struct address_t        m_BAR0;
48
    struct address_t        m_BAR1;
49
 
50
    spinlock_t              m_BoardLock;
51
    struct mutex            m_BoardMutex;
52
    struct semaphore        m_BoardSem;
53
    u32                     m_Interrupt;
54
    u32                     m_DmaIrqEnbl;
55
    u32                     m_FlgIrqEnbl;
56
    u32                     m_BoardIndex;
57
    wait_queue_head_t       m_WaitQueue;
58
    struct timer_list       m_TimeoutTimer;
59
    atomic_t                m_IsTimeout;
60
    struct cdev             m_cdev;
61
 
62
    spinlock_t              m_MemListLock;
63
    atomic_t                m_MemListCount;
64
    struct list_head        m_MemList;
65
 
66
    struct CDmaChannel     *m_DmaChannel[MAX_NUMBER_OF_DMACHANNELS];    //
67
    u32                     m_PldStatus[NUMBER_OF_PLDS];                        //
68
    u32                     m_MemOpUseCount;    // счетчик использования диапазона памяти (PE_MAIN on AMBPEX8)
69
    u16                     m_BlockCnt;
70
    u32                     m_DmaChanMask;
71
    u32                     m_DmaChanEnbl[MAX_NUMBER_OF_DMACHANNELS];
72
    u32                     m_DmaFifoSize[MAX_NUMBER_OF_DMACHANNELS];
73
    u32                     m_DmaDir[MAX_NUMBER_OF_DMACHANNELS];
74
    u32                     m_MaxDmaSize[MAX_NUMBER_OF_DMACHANNELS];
75
    u16                     m_BlockFifoId[MAX_NUMBER_OF_DMACHANNELS];
76
    u32                     m_FifoAddr[MAX_NUMBER_OF_DMACHANNELS];
77
    u32                     m_TetrIrq[NUM_TETR_IRQ];
78
    u32                     m_primChan;
79
};
80
 
81
//-----------------------------------------------------------------------------
82
 
83
extern int dbg_trace;
84
extern int err_trace;
85
 
86
#ifndef PRINTK
87
#define PRINTK(S...) printk(S)
88
#endif
89
 
90
#define dbg_msg(flag, S...) do { if(flag) PRINTK(KERN_DEBUG S); } while(0)
91
#define err_msg(flag, S...) do { if(flag) PRINTK(KERN_ERR S); } while(0)
92
 
93
//-----------------------------------------------------------------------------
94
 
95
#endif //_PEXDEV_H_

powered by: WebSVN 2.1.0

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