aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ieee488/ibfoo_int.h
blob: 28f72897a9dfe45fe8ad8473dd03c82dde9a77e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*-
 * Copyright (c) 2005 Poul-Henning Kamp
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * This file defines the ABI between the userland gpib library and the
 * kernel.  This file should not be used anywhere else.
 *
 * $FreeBSD$
 */

#include <sys/ioccom.h>

typedef void ibsrq_t(void);
enum ibfoo_id {
	__ID_INVALID = 0,
	__ID_IBASK,
	__ID_IBBNA,
	__ID_IBCAC,
	__ID_IBCLR,
	__ID_IBCMD,
	__ID_IBCMDA,
	__ID_IBCONFIG,
	__ID_IBDEV,
	__ID_IBDIAG,
	__ID_IBDMA,
	__ID_IBEOS,
	__ID_IBEOT,
	__ID_IBEVENT,
	__ID_IBFIND,
	__ID_IBGTS,
	__ID_IBIST,
	__ID_IBLINES,
	__ID_IBLLO,
	__ID_IBLN,
	__ID_IBLOC,
	__ID_IBONL,
	__ID_IBPAD,
	__ID_IBPCT,
	__ID_IBPOKE,
	__ID_IBPPC,
	__ID_IBRD,
	__ID_IBRDA,
	__ID_IBRDF,
	__ID_IBRDKEY,
	__ID_IBRPP,
	__ID_IBRSC,
	__ID_IBRSP,
	__ID_IBRSV,
	__ID_IBSAD,
	__ID_IBSGNL,
	__ID_IBSIC,
	__ID_IBSRE,
	__ID_IBSRQ,
	__ID_IBSTOP,
	__ID_IBTMO,
	__ID_IBTRAP,
	__ID_IBTRG,
	__ID_IBWAIT,
	__ID_IBWRT,
	__ID_IBWRTA,
	__ID_IBWRTF,
	__ID_IBWRTKEY,
	__ID_IBXTRC
};

#define __F_HANDLE              (1 << 0)
#define __F_SPR                 (1 << 1)
#define __F_BUFFER              (1 << 2)
#define __F_RETVAL              (1 << 3)
#define __F_BDNAME              (1 << 4)
#define __F_MASK                (1 << 5)
#define __F_PADVAL              (1 << 6)
#define __F_SADVAL              (1 << 7)
#define __F_CNT                 (1 << 8)
#define __F_TMO                 (1 << 9)
#define __F_EOS                 (1 << 10)
#define __F_PPR                 (1 << 11)
#define __F_EOT                 (1 << 12)
#define __F_V                   (1 << 13)
#define __F_VALUE               (1 << 14)
#define __F_SAD                 (1 << 15)
#define __F_BOARDID             (1 << 16)
#define __F_OPTION              (1 << 17)
#define __F_FLNAME              (1 << 18)
#define __F_FUNC                (1 << 19)
#define __F_LINES               (1 << 20)
#define __F_PAD                 (1 << 21)
#define __F_MODE                (1 << 22)
#define __F_LISTENFLAG          (1 << 23)
#define __F_EVENT               (1 << 24)

struct ibarg {
	enum ibfoo_id       __ident;
	unsigned int        __field;
	int		    __retval;
	int		    __ibsta;
	int		    __iberr;
	int		    __ibcnt;
	int                 handle;
	char *              spr;
	void *              buffer;
	int *               retval;
	char *              bdname;
	int                 mask;
	int                 padval;
	int                 sadval;
	long                cnt;
	int                 tmo;
	int                 eos;
	char *              ppr;
	int                 eot;
	int                 v;
	int                 value;
	int                 sad;
	int                 boardID;
	int                 option;
	char *              flname;
	ibsrq_t *           func;
	short *             lines;
	int                 pad;
	int                 mode;
	short *             listenflag;
	short *             event;
};

#define GPIB_IBFOO	_IOWR(4, 0, struct ibarg)