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