/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 driver/pciDriver.h

  • Committer: Suren A. Chilingaryan
  • Date: 2015-11-19 01:21:30 UTC
  • Revision ID: csa@suren.me-20151119012130-e7qfp7563fqxqhiy
Driver versioning

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
 
59
59
#include <linux/ioctl.h>
60
60
 
 
61
#define PCIDRIVER_INTERFACE_VERSION 1                                   /**< Driver API version, only the pcilib with the same driver interface version is allowed */
 
62
 
61
63
/* Identifies the PCI-E Xilinx ML605 */
62
64
#define PCIE_XILINX_VENDOR_ID 0x10ee
63
65
#define PCIE_ML605_DEVICE_ID 0x6024
119
121
#define KMEM_FLAG_REUSED_HW             PCILIB_KMEM_FLAG_HARDWARE       /**< Indicates that reused buffer had a HW reference before the call */
120
122
 
121
123
/* Types */
 
124
 
 
125
typedef struct {
 
126
    unsigned long version;                              /**< pcilib version */
 
127
    unsigned long interface;                            /**< driver interface version */
 
128
    unsigned long ioctls;                               /**< number of supporterd ioctls */
 
129
    unsigned long reserved[5];                          /**< reserved for the future use */
 
130
} pcilib_driver_version_t;
 
131
 
 
132
typedef struct {
 
133
    unsigned long iommu;
 
134
    unsigned long dma_mask;
 
135
} pcilib_device_state_t;
 
136
 
122
137
typedef struct {
123
138
    unsigned short vendor_id;
124
139
    unsigned short device_id;
193
208
 * This type is only 8-bits wide, and half-documented in 
194
209
 * <linux-src>/Documentation/ioctl-number.txt.
195
210
 * previous SHL -> 'S' definition, conflicts with several devices,
196
 
 * so I changed it to be pci -> 'p', in the range 0xA0-AF
 
211
 * so I changed it to be pci -> 'p', in the range 0xA0-BF
197
212
 */
198
213
#define PCIDRIVER_IOC_MAGIC 'p'
199
214
#define PCIDRIVER_IOC_BASE  0xA0
200
215
 
201
 
#define PCIDRIVER_IOC_MMAP_MODE  _IO(  PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 0 )
202
 
#define PCIDRIVER_IOC_MMAP_AREA  _IO(  PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 1 )
203
 
#define PCIDRIVER_IOC_KMEM_ALLOC _IOWR( PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 2, kmem_handle_t * )
204
 
#define PCIDRIVER_IOC_KMEM_FREE  _IOW ( PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 3, kmem_handle_t * )
205
 
#define PCIDRIVER_IOC_KMEM_SYNC  _IOWR( PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 4, kmem_sync_t * )
206
 
#define PCIDRIVER_IOC_UMEM_SGMAP _IOWR( PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 5, umem_handle_t * )
207
 
#define PCIDRIVER_IOC_UMEM_SGUNMAP _IOW(  PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 6, umem_handle_t * )
208
 
#define PCIDRIVER_IOC_UMEM_SGGET _IOWR( PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 7, umem_sglist_t * )
209
 
#define PCIDRIVER_IOC_UMEM_SYNC  _IOW(  PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 8, umem_handle_t * )
210
 
#define PCIDRIVER_IOC_WAITI      _IO(   PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 9 )
 
216
#define PCIDRIVER_IOC_MMAP_MODE         _IO(   PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 0 )
 
217
#define PCIDRIVER_IOC_MMAP_AREA         _IO(   PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 1 )
 
218
#define PCIDRIVER_IOC_KMEM_ALLOC        _IOWR( PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 2, kmem_handle_t * )
 
219
#define PCIDRIVER_IOC_KMEM_FREE         _IOW ( PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 3, kmem_handle_t * )
 
220
#define PCIDRIVER_IOC_KMEM_SYNC         _IOWR( PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 4, kmem_sync_t * )
 
221
#define PCIDRIVER_IOC_UMEM_SGMAP        _IOWR( PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 5, umem_handle_t * )
 
222
#define PCIDRIVER_IOC_UMEM_SGUNMAP      _IOW(  PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 6, umem_handle_t * )
 
223
#define PCIDRIVER_IOC_UMEM_SGGET        _IOWR( PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 7, umem_sglist_t * )
 
224
#define PCIDRIVER_IOC_UMEM_SYNC         _IOW(  PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 8, umem_handle_t * )
 
225
#define PCIDRIVER_IOC_WAITI             _IO(   PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 9 )
211
226
 
212
227
/* And now, the methods to access the PCI configuration area */
213
 
#define PCIDRIVER_IOC_PCI_CFG_RD  _IOWR(  PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 10, pci_cfg_cmd * )
214
 
#define PCIDRIVER_IOC_PCI_CFG_WR  _IOWR(  PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 11, pci_cfg_cmd * )
215
 
#define PCIDRIVER_IOC_PCI_INFO    _IOWR(  PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 12, pcilib_board_info_t * )
 
228
#define PCIDRIVER_IOC_PCI_CFG_RD        _IOWR(  PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 10, pci_cfg_cmd * )
 
229
#define PCIDRIVER_IOC_PCI_CFG_WR        _IOWR(  PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 11, pci_cfg_cmd * )
 
230
#define PCIDRIVER_IOC_PCI_INFO          _IOWR(  PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 12, pcilib_board_info_t * )
216
231
 
217
232
/* Clear interrupt queues */
218
 
#define PCIDRIVER_IOC_CLEAR_IOQ   _IO(   PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 13 )
219
 
 
220
 
#define PCIDRIVER_IOC_SET_DMA_MASK      _IO(  PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 14 )
221
 
 
 
233
#define PCIDRIVER_IOC_CLEAR_IOQ         _IO(   PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 13 )
 
234
 
 
235
#define PCIDRIVER_IOC_VERSION           _IOR(  PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 14, pcilib_driver_version_t * )
 
236
#define PCIDRIVER_IOC_DEVICE_STATE      _IOR(  PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 15, pcilib_device_state_t * )
 
237
#define PCIDRIVER_IOC_DMA_MASK          _IO(   PCIDRIVER_IOC_MAGIC, PCIDRIVER_IOC_BASE + 16)
 
238
 
 
239
#define PCIDRIVER_IOC_MAX 16
222
240
 
223
241
#endif