59
59
#include <linux/ioctl.h>
60
#include "../pcilib_types.h"
62
61
/* Identifies the PCI-E Xilinx ML605 */
63
62
#define PCIE_XILINX_VENDOR_ID 0x10ee
64
63
#define PCIE_ML605_DEVICE_ID 0x6024
66
/* Identifies the PCI-E IPE Camera */
65
/* Identifies the PCI-E IPE Hardware */
67
66
#define PCIE_IPECAMERA_DEVICE_ID 0x6081
68
67
#define PCIE_KAPTURE_DEVICE_ID 0x6028
69
//#define PCIE_IPECAMERA_DEVICE_ID 0x6018
72
70
/* Possible values for ioctl commands */
74
72
/* PCI mmap areas */
75
#define PCIDRIVER_BAR0 0
76
#define PCIDRIVER_BAR1 1
77
#define PCIDRIVER_BAR2 2
78
#define PCIDRIVER_BAR3 3
79
#define PCIDRIVER_BAR4 4
80
#define PCIDRIVER_BAR5 5
73
#define PCIDRIVER_BAR0 0
74
#define PCIDRIVER_BAR1 1
75
#define PCIDRIVER_BAR2 2
76
#define PCIDRIVER_BAR3 3
77
#define PCIDRIVER_BAR4 4
78
#define PCIDRIVER_BAR5 5
82
80
/* mmap mode of the device */
83
#define PCIDRIVER_MMAP_PCI 0
84
#define PCIDRIVER_MMAP_KMEM 1
81
#define PCIDRIVER_MMAP_PCI 0
82
#define PCIDRIVER_MMAP_KMEM 1
86
84
/* Direction of a DMA operation */
87
85
#define PCIDRIVER_DMA_BIDIRECTIONAL 0
88
#define PCIDRIVER_DMA_TODEVICE PCILIB_KMEM_SYNC_TODEVICE
89
#define PCIDRIVER_DMA_FROMDEVICE PCILIB_KMEM_SYNC_FROMDEVICE
86
#define PCIDRIVER_DMA_TODEVICE 1//PCILIB_KMEM_SYNC_TODEVICE
87
#define PCIDRIVER_DMA_FROMDEVICE 2//PCILIB_KMEM_SYNC_FROMDEVICE
91
89
/* Possible sizes in a PCI command */
92
#define PCIDRIVER_PCI_CFG_SZ_BYTE 1
93
#define PCIDRIVER_PCI_CFG_SZ_WORD 2
94
#define PCIDRIVER_PCI_CFG_SZ_DWORD 3
90
#define PCIDRIVER_PCI_CFG_SZ_BYTE 1
91
#define PCIDRIVER_PCI_CFG_SZ_WORD 2
92
#define PCIDRIVER_PCI_CFG_SZ_DWORD 3
96
94
/* Possible types of SG lists */
97
#define PCIDRIVER_SG_NONMERGED 0
98
#define PCIDRIVER_SG_MERGED 1
95
#define PCIDRIVER_SG_NONMERGED 0
96
#define PCIDRIVER_SG_MERGED 1
100
98
/* Maximum number of interrupt sources */
101
#define PCIDRIVER_INT_MAXSOURCES 16
104
#define KMEM_FLAG_REUSE 1 /**< Try to reuse existing buffer with the same use & item */
105
#define KMEM_FLAG_EXCLUSIVE 2 /**< Allow only a single application accessing a specified use & item */
106
#define KMEM_FLAG_PERSISTENT 4 /**< Sets persistent mode */
107
#define KMEM_FLAG_HW 8 /**< The buffer may be accessed by hardware, the hardware access will not occur any more if passed to _free function */
108
#define KMEM_FLAG_FORCE 16 /**< Force memory cleanup even if references are present */
109
#define KMEM_FLAG_MASS 32 /**< Apply to all buffers of selected use */
110
#define KMEM_FLAG_TRY 64 /**< Do not allocate buffers, try to reuse and fail if not possible */
112
#define KMEM_FLAG_REUSED 1 /**< Indicates if buffer with specified use & item was already allocated and reused */
113
#define KMEM_FLAG_REUSED_PERSISTENT 4 /**< Indicates that reused buffer was persistent before the call */
114
#define KMEM_FLAG_REUSED_HW 8 /**< Indicates that reused buffer had a HW reference before the call */
99
#define PCIDRIVER_INT_MAXSOURCES 16
101
#define KMEM_REF_HW 0x80000000 /**< Special reference to indicate hardware access */
102
#define KMEM_REF_COUNT 0x0FFFFFFF /**< Mask of reference counter (mmap/munmap), couting in mmaped memory pages */
104
#define KMEM_MODE_REUSABLE 0x80000000 /**< Indicates reusable buffer */
105
#define KMEM_MODE_EXCLUSIVE 0x40000000 /**< Only a single process is allowed to mmap the buffer */
106
#define KMEM_MODE_PERSISTENT 0x20000000 /**< Persistent mode instructs kmem_free to preserve buffer in memory */
107
#define KMEM_MODE_COUNT 0x0FFFFFFF /**< Mask of reuse counter (alloc/free) */
109
#define KMEM_FLAG_REUSE PCILIB_KMEM_FLAG_REUSE /**< Try to reuse existing buffer with the same use & item */
110
#define KMEM_FLAG_EXCLUSIVE PCILIB_KMEM_FLAG_EXCLUSIVE /**< Allow only a single application accessing a specified use & item */
111
#define KMEM_FLAG_PERSISTENT PCILIB_KMEM_FLAG_PERSISTENT /**< Sets persistent mode */
112
#define KMEM_FLAG_HW PCILIB_KMEM_FLAG_HARDWARE /**< The buffer may be accessed by hardware, the hardware access will not occur any more if passed to _free function */
113
#define KMEM_FLAG_FORCE PCILIB_KMEM_FLAG_FORCE /**< Force memory cleanup even if references are present */
114
#define KMEM_FLAG_MASS PCILIB_KMEM_FLAG_MASS /**< Apply to all buffers of selected use */
115
#define KMEM_FLAG_TRY PCILIB_KMEM_FLAG_TRY /**< Do not allocate buffers, try to reuse and fail if not possible */
117
#define KMEM_FLAG_REUSED PCILIB_KMEM_FLAG_REUSE /**< Indicates if buffer with specified use & item was already allocated and reused */
118
#define KMEM_FLAG_REUSED_PERSISTENT PCILIB_KMEM_FLAG_PERSISTENT /**< Indicates that reused buffer was persistent before the call */
119
#define KMEM_FLAG_REUSED_HW PCILIB_KMEM_FLAG_HARDWARE /**< Indicates that reused buffer had a HW reference before the call */
123
unsigned short vendor_id;
124
unsigned short device_id;
128
unsigned short devfn;
129
unsigned char interrupt_pin;
130
unsigned char interrupt_line;
132
unsigned long bar_start[6];
133
unsigned long bar_length[6];
134
unsigned long bar_flags[6];
135
} pcilib_board_info_t;
119
138
unsigned long type;
120
139
unsigned long pa;
121
140
unsigned long size;