AlcapDAQ  1
vme_io.h
Go to the documentation of this file.
1 /*
2  $Id: vme_io.h,v 1.1 2004/09/22 10:36:51 mucap Exp $
3  */
4 #ifndef __LINUX_VME_IO_H
5 #define __LINUX_VME_IO_H
6 
7 #include <linux/ioctl.h>
8 
9 /* ioctl()'s for the VME-Access */
10 /* first start with the control device (/dev/vme_ctl) which is used
11  for operations affecting the entire bus, such as resetting, setting
12  arbitration and so on */
13 
14 /* execute a VMEBus reset */
15 #define VMECTL_RESET _IO('x', 0)
16 
17 /* get/set VMEBus time out, in usec */
18 #define VMECTL_GETVMETO _IOR('x', 1, int)
19 #define VMECTL_SETVMETO _IOW('x', 1, int)
20 
21 #define VMEMAP_DWIDTH_8 (0)
22 #define VMEMAP_DWIDTH_16 (1)
23 #define VMEMAP_DWIDTH_32 (2)
24 #define VMEMAP_DWIDTH_64 (3)
25 
26 #define VMEMAP_ASPACE_A16 (0)
27 #define VMEMAP_ASPACE_A24 (1)
28 #define VMEMAP_ASPACE_A32 (2)
29 #define VMEMAP_ASPACE_CRCSR (5)
30 #define VMEMAP_ASPACE_USR1 (6)
31 #define VMEMAP_ASPACE_USR2 (7)
32 
33 #define VMEMAP_SUPUSERAM_USER (0)
34 #define VMEMAP_SUPUSERAM_SUPER (1)
35 
36 #define VMEMAP_PRGDATAAM_DATA (0)
37 #define VMEMAP_PRGDATAAM_PRG (1)
38 
39 #define VMEMAP_VMESLAVE_USER (0x01)
40 #define VMEMAP_VMESLAVE_SUPER (0x02)
41 
42 #define VMEMAP_VMESLAVE_DATA (0x01)
43 #define VMEMAP_VMESLAVE_PRG (0x02)
44 
45 struct vme_mapping_ctrl {
46  char max_datawidth;
47  char address_space;
48  char supuseram;
49  char prgdataam;
50 };
51 
52 #define VMEIMG_GETMAPPING _IOR('x',2,struct vme_mapping_ctrl)
53 #define VMEIMG_SETMAPPING _IOW('x',2,struct vme_mapping_ctrl)
54 
55 #define VMEIMG_GETVMEADDR _IOR('x',3,unsigned long)
56 #define VMEIMG_SETVMEADDR _IOW('x',3,unsigned long)
57 
58 #define VMEIMG_GETGRANULARITY _IOR('x',4,unsigned long)
59 
60 struct vme_irq_data_type {
62  int vector_number;
63 };
64 
65 struct vme_irq_mapping_type {
66  unsigned char level;
67  unsigned char vector;
68 };
69 
70 #define VMEIRQ_GETLINK _IOR('x',6,struct vme_irq_mapping_type)
71 #define VMEIRQ_SETLINK _IOW('x',6,struct vme_irq_mapping_type)
72 
73 struct DMA_chainblock_type {
74  unsigned int vme_address; /* the VME-Address of the block */
75  size_t n_bytes; /* the size of the block */
76  int offset; /* The offset in bytes from the
77  start of the buffer */
78  struct vme_mapping_ctrl mapping; /* the access mode for the VME bus */
79  int write; /* != 0 for writing to VME,
80  0 for reading from VME */
81 };
82 
83 
84 #define VMEDMA_SETBUFFSIZE _IOW('x',7,size_t)
85 #define VMEDMA_GETBUFFSIZE _IOR('x',7,size_t)
86 #define VMEDMA_DODMA _IO('x',8)
87 #define VMEDMA_ADDBLOCK _IOW('x',9,struct DMA_chainblock_type)
88 #define VMEDMA_CLEARBLOCKS _IO('x',10)
89 
90 
91 #define VMESLAVE_SETSIZE _IOW('x',11,size_t)
92 #define VMESLAVE_GETSIZE _IOR('x',11,size_t)
93 #endif
94 
95 struct vme_dma_req
96 {
97  unsigned int vme_addr;
98  unsigned char *buf;
99  unsigned int count;
100  int fifo_block_size;
101 };
102 
103 #define VMEIMG_DMA_READ _IOW('x', 12, struct vme_dma_req)
104 #define VMEIMG_DMA_WRITE _IOW('x', 13, struct vme_dma_req)
105