1 /*- 2 * Copyright (c) 2005 Poul-Henning Kamp 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 * This file defines the ABI between the userland gpib library and the 27 * kernel. This file should not be used anywhere else. 28 * 29 * $FreeBSD$ 30 */ 31 32 #include <sys/ioccom.h> 33 34 typedef void ibsrq_t(void); 35 enum ibfoo_id { 36 __ID_INVALID = 0, 37 __ID_IBASK, 38 __ID_IBBNA, 39 __ID_IBCAC, 40 __ID_IBCLR, 41 __ID_IBCMD, 42 __ID_IBCMDA, 43 __ID_IBCONFIG, 44 __ID_IBDEV, 45 __ID_IBDIAG, 46 __ID_IBDMA, 47 __ID_IBEOS, 48 __ID_IBEOT, 49 __ID_IBEVENT, 50 __ID_IBFIND, 51 __ID_IBGTS, 52 __ID_IBIST, 53 __ID_IBLINES, 54 __ID_IBLLO, 55 __ID_IBLN, 56 __ID_IBLOC, 57 __ID_IBONL, 58 __ID_IBPAD, 59 __ID_IBPCT, 60 __ID_IBPOKE, 61 __ID_IBPPC, 62 __ID_IBRD, 63 __ID_IBRDA, 64 __ID_IBRDF, 65 __ID_IBRDKEY, 66 __ID_IBRPP, 67 __ID_IBRSC, 68 __ID_IBRSP, 69 __ID_IBRSV, 70 __ID_IBSAD, 71 __ID_IBSGNL, 72 __ID_IBSIC, 73 __ID_IBSRE, 74 __ID_IBSRQ, 75 __ID_IBSTOP, 76 __ID_IBTMO, 77 __ID_IBTRAP, 78 __ID_IBTRG, 79 __ID_IBWAIT, 80 __ID_IBWRT, 81 __ID_IBWRTA, 82 __ID_IBWRTF, 83 __ID_IBWRTKEY, 84 __ID_IBXTRC 85 }; 86 87 #define __F_HANDLE (1 << 0) 88 #define __F_SPR (1 << 1) 89 #define __F_BUFFER (1 << 2) 90 #define __F_RETVAL (1 << 3) 91 #define __F_BDNAME (1 << 4) 92 #define __F_MASK (1 << 5) 93 #define __F_PADVAL (1 << 6) 94 #define __F_SADVAL (1 << 7) 95 #define __F_CNT (1 << 8) 96 #define __F_TMO (1 << 9) 97 #define __F_EOS (1 << 10) 98 #define __F_PPR (1 << 11) 99 #define __F_EOT (1 << 12) 100 #define __F_V (1 << 13) 101 #define __F_VALUE (1 << 14) 102 #define __F_SAD (1 << 15) 103 #define __F_BOARDID (1 << 16) 104 #define __F_OPTION (1 << 17) 105 #define __F_FLNAME (1 << 18) 106 #define __F_FUNC (1 << 19) 107 #define __F_LINES (1 << 20) 108 #define __F_PAD (1 << 21) 109 #define __F_MODE (1 << 22) 110 #define __F_LISTENFLAG (1 << 23) 111 #define __F_EVENT (1 << 24) 112 113 struct ibarg { 114 enum ibfoo_id __ident; 115 unsigned int __field; 116 int __retval; 117 int __ibsta; 118 int __iberr; 119 int __ibcnt; 120 int handle; 121 char * spr; 122 void * buffer; 123 int * retval; 124 char * bdname; 125 int mask; 126 int padval; 127 int sadval; 128 long cnt; 129 int tmo; 130 int eos; 131 char * ppr; 132 int eot; 133 int v; 134 int value; 135 int sad; 136 int boardID; 137 int option; 138 char * flname; 139 ibsrq_t * func; 140 short * lines; 141 int pad; 142 int mode; 143 short * listenflag; 144 short * event; 145 }; 146 147 #define GPIB_IBFOO _IOWR(4, 0, struct ibarg) 148