1: /* @(#)vsio.h 7.1 (MIT) 6/4/86 */
2: /****************************************************************************
3: * *
4: * Copyright (c) 1983, 1984 by *
5: * DIGITAL EQUIPMENT CORPORATION, Maynard, Massachusetts. *
6: * All rights reserved. *
7: * *
8: * This software is furnished on an as-is basis and may be used and copied *
9: * only with inclusion of the above copyright notice. This software or any *
10: * other copies thereof may be provided or otherwise made available to *
11: * others only for non-commercial purposes. No title to or ownership of *
12: * the software is hereby transferred. *
13: * *
14: * The information in this software is subject to change without notice *
15: * and should not be construed as a commitment by DIGITAL EQUIPMENT *
16: * CORPORATION. *
17: * *
18: * DIGITAL assumes no responsibility for the use or reliability of its *
19: * software on equipment which is not supplied by DIGITAL. *
20: * *
21: * *
22: ****************************************************************************/
23: /*
24: * vsio.h - VS100 I/O command definitions
25: *
26: * Author: Christopher A. Kent
27: * Digital Equipment Corporation
28: * Western Research Lab
29: * Date: Tue Jun 21 1983
30: */
31:
32: /*
33: * Possible ioctl calls
34: */
35:
36: #define VSIOINIT _IO(V, 0) /* init the device */
37: #define VSIOSTART _IOW(V, 1, int) /* start microcode */
38: #define VSIOABORT _IO(V, 2) /* abort a command chain */
39: #define VSIOPWRUP _IO(V, 3) /* power-up reset */
40: #define VSIOGETVER _IOR(V, 4, int) /* get rom version */
41: #define VSIOSYNC _IO(V, 6) /* synch with device */
42: #define VSIOBBACTL _IOW(V, 8, int) /* control the BBA */
43: #define VSIOFIBCTL _IOW(V, 9, int) /* lamp on/off */
44: #define VSIOFIBRETRY _IOW(V,10, int) /* fiber retries */
45: #define VSIOGETSTATS _IOR(V,11, vsStats) /* get statistics */
46: #define VSIOGETIOA _IOR(V,13, vsIoAddrAddr)/* get ioreg address */
47: #define VSIOUSERWAIT _IO(V, 15) /* wait for user I/O completion */
48: #define VSIOWAITGO _IOW(V, 16, caddr_t) /* wait then go */
49:
50:
51: #define VSIO_OFF 0 /* option off */
52: #define VSIO_ON 1 /* option on */
53:
54: #define VS_FIB_FINITE 1 /* finite retries */
55: #define VS_FIB_INFINITE 2 /* infinite retries */
56:
57: /*
58: * Event queue entries
59: */
60:
61: typedef struct _vs_event{
62: u_short vse_x; /* x position */
63: u_short vse_y; /* y position */
64: u_short vse_time; /* 10 millisecond units (button only) */
65: char vse_type; /* button or motion? */
66: u_char vse_key; /* the key (button only) */
67: char vse_direction; /* which direction (button only) */
68: char vse_device; /* which device (button only) */
69: }vsEvent;
70:
71: #define VSE_BUTTON 0 /* button moved */
72: #define VSE_MMOTION 1 /* mouse moved */
73: #define VSE_TMOTION 2 /* tablet moved */
74:
75: #define VSE_KBTUP 0 /* up */
76: #define VSE_KBTDOWN 1 /* down */
77:
78: #define VSE_MOUSE 1 /* mouse */
79: #define VSE_DKB 2 /* main keyboard */
80: #define VSE_TABLET 3 /* graphics tablet */
81: #define VSE_AUX 4 /* auxiliary */
82: #define VSE_CONSOLE 5 /* console */
83:
84: typedef struct _vsStats{
85: int errors; /* count errors */
86: int unsolIntr; /* count unsolicited interrupts */
87: int overruns; /* event queue overruns */
88: int flashes; /* flashes on fiber link */
89: int ignites; /* times turned on */
90: int douses; /* times turned off */
91: int linkErrors; /* link errors */
92: }vsStats;
93:
94: typedef struct _vs_cursor{
95: short x;
96: short y;
97: }vsCursor;
98:
99: typedef struct _vs_box {
100: short bottom;
101: short right;
102: short left;
103: short top;
104: }vsBox;
105:
106: typedef struct _vsIoAddr {
107: short *ioreg;
108: short status;
109: caddr_t obuff;
110: int obufflen;
111: int reloc;
112: vsEvent *ibuff;
113: int iqsize; /* may assume power of 2 */
114: int ihead; /* atomic write */
115: int itail; /* atomic read */
116: vsCursor mouse; /* atomic read/write */
117: vsBox mbox; /* atomic read/write */
118: } vsIoAddr;
119: typedef vsIoAddr *vsIoAddrAddr;
Defined struct's
Defined typedef's
Defined macros
Usage of this include