Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
use14_ioc.h
Go to the documentation of this file.
1 /* use14_ioc.h
2 ** definitions of use1401 module stuff that is shared between use1401 and the driver.
3 ** Copyright (C) Cambridge Electronic Design Limited 2010
4 ** Author Greg P Smith
5 ************************************************************************************/
6 #ifndef __USE14_IOC_H__
7 #define __USE14_IOC_H__
8 
9 #define MAX_TRANSAREAS 8 /* The number of transfer areas supported by driver */
10 
11 #define i386
12 #include "winioctl.h" /* needed so we can access driver */
13 
14 /*
15 ** Defines for IOCTL functions to ask driver to perform. These must be matched
16 ** in both use1401 and in the driver. The IOCTL code contains a command
17 ** identifier, plus other information about the device, the type of access
18 ** with which the file must have been opened, and the type of buffering.
19 ** The IOCTL function codes from 0x80 to 0xFF are for developer use.
20 */
21 #define FILE_DEVICE_CED1401 0x8001
22 #define FNNUMBASE 0x800
23 
24 #define U14_OPEN1401 CTL_CODE( FILE_DEVICE_CED1401, \
25  FNNUMBASE, \
26  METHOD_BUFFERED, \
27  FILE_ANY_ACCESS)
28 
29 #define U14_CLOSE1401 CTL_CODE( FILE_DEVICE_CED1401, \
30  FNNUMBASE+1, \
31  METHOD_BUFFERED, \
32  FILE_ANY_ACCESS)
33 
34 #define U14_SENDSTRING CTL_CODE( FILE_DEVICE_CED1401, \
35  FNNUMBASE+2, \
36  METHOD_BUFFERED, \
37  FILE_ANY_ACCESS)
38 
39 #define U14_RESET1401 CTL_CODE( FILE_DEVICE_CED1401, \
40  FNNUMBASE+3, \
41  METHOD_BUFFERED, \
42  FILE_ANY_ACCESS)
43 
44 #define U14_GETCHAR CTL_CODE( FILE_DEVICE_CED1401, \
45  FNNUMBASE+4, \
46  METHOD_BUFFERED, \
47  FILE_ANY_ACCESS)
48 
49 #define U14_SENDCHAR CTL_CODE( FILE_DEVICE_CED1401, \
50  FNNUMBASE+5, \
51  METHOD_BUFFERED, \
52  FILE_ANY_ACCESS)
53 
54 #define U14_STAT1401 CTL_CODE( FILE_DEVICE_CED1401, \
55  FNNUMBASE+6, \
56  METHOD_BUFFERED, \
57  FILE_ANY_ACCESS)
58 
59 #define U14_LINECOUNT CTL_CODE( FILE_DEVICE_CED1401, \
60  FNNUMBASE+7, \
61  METHOD_BUFFERED, \
62  FILE_ANY_ACCESS)
63 
64 #define U14_GETSTRING CTL_CODE( FILE_DEVICE_CED1401, \
65  FNNUMBASE+8, \
66  METHOD_BUFFERED, \
67  FILE_ANY_ACCESS)
68 
69 #define U14_REGCALLBACK CTL_CODE( FILE_DEVICE_CED1401, \
70  FNNUMBASE+9, \
71  METHOD_BUFFERED, \
72  FILE_ANY_ACCESS)
73 
74 #define U14_GETMONITORBUF CTL_CODE( FILE_DEVICE_CED1401, \
75  FNNUMBASE+10, \
76  METHOD_BUFFERED, \
77  FILE_ANY_ACCESS)
78 
79 #define U14_SETTRANSFER CTL_CODE( FILE_DEVICE_CED1401, \
80  FNNUMBASE+11, \
81  METHOD_BUFFERED, \
82  FILE_ANY_ACCESS)
83 
84 #define U14_UNSETTRANSFER CTL_CODE( FILE_DEVICE_CED1401, \
85  FNNUMBASE+12, \
86  METHOD_BUFFERED, \
87  FILE_ANY_ACCESS)
88 
89 #define U14_SETTRANSEVENT CTL_CODE( FILE_DEVICE_CED1401, \
90  FNNUMBASE+13, \
91  METHOD_BUFFERED, \
92  FILE_ANY_ACCESS)
93 
94 #define U14_GETOUTBUFSPACE CTL_CODE( FILE_DEVICE_CED1401, \
95  FNNUMBASE+14, \
96  METHOD_BUFFERED, \
97  FILE_ANY_ACCESS)
98 
99 #define U14_GETBASEADDRESS CTL_CODE( FILE_DEVICE_CED1401, \
100  FNNUMBASE+15, \
101  METHOD_BUFFERED, \
102  FILE_ANY_ACCESS)
103 
104 #define U14_GETDRIVERREVISION CTL_CODE( FILE_DEVICE_CED1401, \
105  FNNUMBASE+16, \
106  METHOD_BUFFERED, \
107  FILE_ANY_ACCESS)
108 
109 #define U14_GETTRANSFER CTL_CODE( FILE_DEVICE_CED1401, \
110  FNNUMBASE+17, \
111  METHOD_BUFFERED, \
112  FILE_ANY_ACCESS)
113 
114 #define U14_KILLIO1401 CTL_CODE( FILE_DEVICE_CED1401, \
115  FNNUMBASE+18, \
116  METHOD_BUFFERED, \
117  FILE_ANY_ACCESS)
118 
119 #define U14_BLKTRANSSTATE CTL_CODE( FILE_DEVICE_CED1401, \
120  FNNUMBASE+19, \
121  METHOD_BUFFERED, \
122  FILE_ANY_ACCESS)
123 
124 #define U14_BYTECOUNT CTL_CODE( FILE_DEVICE_CED1401, \
125  FNNUMBASE+20, \
126  METHOD_BUFFERED, \
127  FILE_ANY_ACCESS)
128 
129 #define U14_ZEROBLOCKCOUNT CTL_CODE( FILE_DEVICE_CED1401, \
130  FNNUMBASE+21, \
131  METHOD_BUFFERED, \
132  FILE_ANY_ACCESS)
133 
134 #define U14_STOPCIRCULAR CTL_CODE( FILE_DEVICE_CED1401, \
135  FNNUMBASE+22, \
136  METHOD_BUFFERED, \
137  FILE_ANY_ACCESS)
138 
139 #define U14_STATEOF1401 CTL_CODE( FILE_DEVICE_CED1401, \
140  FNNUMBASE+23, \
141  METHOD_BUFFERED, \
142  FILE_ANY_ACCESS)
143 
144 #define U14_REGISTERS1401 CTL_CODE( FILE_DEVICE_CED1401, \
145  FNNUMBASE+24, \
146  METHOD_BUFFERED, \
147  FILE_ANY_ACCESS)
148 
149 #define U14_GRAB1401 CTL_CODE( FILE_DEVICE_CED1401, \
150  FNNUMBASE+25, \
151  METHOD_BUFFERED, \
152  FILE_ANY_ACCESS)
153 
154 #define U14_FREE1401 CTL_CODE( FILE_DEVICE_CED1401, \
155  FNNUMBASE+26, \
156  METHOD_BUFFERED, \
157  FILE_ANY_ACCESS)
158 
159 #define U14_STEP1401 CTL_CODE( FILE_DEVICE_CED1401, \
160  FNNUMBASE+27, \
161  METHOD_BUFFERED, \
162  FILE_ANY_ACCESS)
163 
164 #define U14_SET1401REGISTERS CTL_CODE( FILE_DEVICE_CED1401, \
165  FNNUMBASE+28, \
166  METHOD_BUFFERED, \
167  FILE_ANY_ACCESS)
168 
169 #define U14_STEPTILL1401 CTL_CODE( FILE_DEVICE_CED1401, \
170  FNNUMBASE+29, \
171  METHOD_BUFFERED, \
172  FILE_ANY_ACCESS)
173 
174 #define U14_SETORIN CTL_CODE( FILE_DEVICE_CED1401, \
175  FNNUMBASE+30, \
176  METHOD_BUFFERED, \
177  FILE_ANY_ACCESS)
178 
179 #define U14_STARTSELFTEST CTL_CODE( FILE_DEVICE_CED1401, \
180  FNNUMBASE+31, \
181  METHOD_BUFFERED, \
182  FILE_ANY_ACCESS)
183 
184 #define U14_CHECKSELFTEST CTL_CODE( FILE_DEVICE_CED1401, \
185  FNNUMBASE+32, \
186  METHOD_BUFFERED, \
187  FILE_ANY_ACCESS)
188 
189 #define U14_TYPEOF1401 CTL_CODE( FILE_DEVICE_CED1401, \
190  FNNUMBASE+33, \
191  METHOD_BUFFERED, \
192  FILE_ANY_ACCESS)
193 
194 #define U14_TRANSFERFLAGS CTL_CODE( FILE_DEVICE_CED1401, \
195  FNNUMBASE+34, \
196  METHOD_BUFFERED, \
197  FILE_ANY_ACCESS)
198 
199 #define U14_DBGPEEK CTL_CODE( FILE_DEVICE_CED1401, \
200  FNNUMBASE+35, \
201  METHOD_BUFFERED, \
202  FILE_ANY_ACCESS)
203 
204 #define U14_DBGPOKE CTL_CODE( FILE_DEVICE_CED1401, \
205  FNNUMBASE+36, \
206  METHOD_BUFFERED, \
207  FILE_ANY_ACCESS)
208 
209 #define U14_DBGRAMPDATA CTL_CODE( FILE_DEVICE_CED1401, \
210  FNNUMBASE+37, \
211  METHOD_BUFFERED, \
212  FILE_ANY_ACCESS)
213 
214 #define U14_DBGRAMPADDR CTL_CODE( FILE_DEVICE_CED1401, \
215  FNNUMBASE+38, \
216  METHOD_BUFFERED, \
217  FILE_ANY_ACCESS)
218 
219 #define U14_DBGGETDATA CTL_CODE( FILE_DEVICE_CED1401, \
220  FNNUMBASE+39, \
221  METHOD_BUFFERED, \
222  FILE_ANY_ACCESS)
223 
224 #define U14_DBGSTOPLOOP CTL_CODE( FILE_DEVICE_CED1401, \
225  FNNUMBASE+40, \
226  METHOD_BUFFERED, \
227  FILE_ANY_ACCESS)
228 
229 #define U14_FULLRESET CTL_CODE( FILE_DEVICE_CED1401, \
230  FNNUMBASE+41, \
231  METHOD_BUFFERED, \
232  FILE_ANY_ACCESS)
233 
234 #define U14_SETCIRCULAR CTL_CODE( FILE_DEVICE_CED1401, \
235  FNNUMBASE+42, \
236  METHOD_BUFFERED, \
237  FILE_ANY_ACCESS)
238 
239 #define U14_GETCIRCBLK CTL_CODE( FILE_DEVICE_CED1401, \
240  FNNUMBASE+43, \
241  METHOD_BUFFERED, \
242  FILE_ANY_ACCESS)
243 
244 #define U14_FREECIRCBLK CTL_CODE( FILE_DEVICE_CED1401, \
245  FNNUMBASE+44, \
246  METHOD_BUFFERED, \
247  FILE_ANY_ACCESS)
248 
249 //--------------- Structures that are shared with the driver -------------
250 #pragma pack(1)
251 
252 typedef struct /* used for get/set standard 1401 registers */
253 {
254  short sPC;
255  char A;
256  char X;
257  char Y;
258  char stat;
259  char rubbish;
261 
262 typedef union /* to communicate with 1401 driver status & control funcs */
263 {
264  char chrs[22];
265  short ints[11];
266  long longs[5];
268 } TCSBLOCK;
269 
271 
272 typedef struct paramBlk
273 {
274  short sState;
276 } PARAMBLK;
277 
279 
280 typedef struct TransferDesc /* Structure and type for SetTransArea */
281 {
282  WORD wArea; /* number of transfer area to set up */
283  void FAR * lpvBuff; /* address of transfer area */
284  DWORD dwLength; /* length of area to set up */
285  short eSize; /* size to move (for swapping on MAC) */
286 } TRANSFERDESC;
287 
289 
290 /* This is the structure used to set up a transfer area */
291 typedef struct VXTransferDesc /* use1401.c and use1432x.x use only */
292 {
293  WORD wArea; /* number of transfer area to set up */
294  WORD wAddrSel; /* 16 bit selector for area */
295  DWORD dwAddrOfs; /* 32 bit offset for area start */
296  DWORD dwLength; /* length of area to set up */
298 
299 #pragma pack()
300 
301 #endif