1 /*
2 ** -----------------------------------------------------------------------------
3 **
4 **  Perle Specialix driver for Linux
5 **  Ported from existing RIO Driver for SCO sources.
6  *
7  *  (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
8  *
9  *      This program is free software; you can redistribute it and/or modify
10  *      it under the terms of the GNU General Public License as published by
11  *      the Free Software Foundation; either version 2 of the License, or
12  *      (at your option) any later version.
13  *
14  *      This program is distributed in the hope that it will be useful,
15  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *      GNU General Public License for more details.
18  *
19  *      You should have received a copy of the GNU General Public License
20  *      along with this program; if not, write to the Free Software
21  *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 **
23 **	Module		: daemon.h
24 **	SID		: 1.3
25 **	Last Modified	: 11/6/98 11:34:09
26 **	Retrieved	: 11/6/98 11:34:21
27 **
28 **  ident @(#)daemon.h	1.3
29 **
30 ** -----------------------------------------------------------------------------
31 */
32 
33 #ifndef	__rio_daemon_h__
34 #define	__rio_daemon_h__
35 
36 #ifdef SCCS_LABELS
37 #ifndef lint
38 static char *_daemon_h_sccs_ = "@(#)daemon.h	1.3";
39 #endif
40 #endif
41 
42 
43 /*
44 ** structures used on /dev/rio
45 */
46 
47 struct Error
48 {
49 	uint	Error;
50 	uint	Entry;
51 	uint	Other;
52 };
53 
54 struct DownLoad
55 {
56 	char	*DataP;
57 	uint	Count;
58 	uint	ProductCode;
59 };
60 
61 /*
62 ** A few constants....
63 */
64 #ifndef MAX_VERSION_LEN
65 #define	MAX_VERSION_LEN	256
66 #endif
67 
68 #ifndef MAX_XP_CTRL_LEN
69 #define	MAX_XP_CTRL_LEN 16		/* ALSO IN PORT.H */
70 #endif
71 
72 struct	PortSetup
73 {
74 	uint	From;	/* Set/Clear XP & IXANY Control from this port.... */
75 	uint	To;	/* .... to this port */
76 	uint	XpCps;			/* at this speed */
77 	char	XpOn[MAX_XP_CTRL_LEN];	/* this is the start string */
78 	char	XpOff[MAX_XP_CTRL_LEN];	/* this is the stop string */
79 	uchar	IxAny;			/* enable/disable IXANY */
80 	uchar	IxOn;			/* enable/disable IXON */
81 	uchar	Lock;			/* lock port params */
82 	uchar	Store;			/* store params across closes */
83 	uchar	Drain;			/* close only when drained */
84 };
85 
86 struct	LpbReq
87 {
88 	uint	Host;
89 	uint	Link;
90 	struct  LPB     *LpbP;
91 };
92 
93 struct	RupReq
94 {
95 	uint	HostNum;
96 	uint	RupNum;
97 	struct  RUP 	*RupP;
98 };
99 
100 struct	PortReq
101 {
102 	uint	SysPort;
103 	struct  Port 	*PortP;
104 };
105 
106 struct  StreamInfo
107 {
108 	uint	SysPort;
109 #if 0
110 	queue_t RQueue;
111 	queue_t WQueue;
112 #else
113 	int RQueue;
114 	int WQueue;
115 #endif
116 };
117 
118 struct	HostReq
119 {
120 	uint	HostNum;
121 	struct  Host 	*HostP;
122 };
123 
124 struct	HostDpRam
125 {
126 	uint	HostNum;
127 	struct	DpRam	*DpRamP;
128 };
129 
130 struct	DebugCtrl
131 {
132 	uint	SysPort;
133 	uint	Debug;
134 	uint	Wait;
135 };
136 
137 struct	MapInfo
138 {
139 	uint	FirstPort;	/* 8 ports, starting from this (tty) number */
140 	uint	RtaUnique;	/* reside on this RTA (unique number) */
141 };
142 
143 struct	MapIn
144 {
145 	uint	NumEntries;		/* How many port sets are we mapping? */
146 	struct  MapInfo	*MapInfoP;	/* Pointer to (user space) info */
147 };
148 
149 struct  SendPack
150 {
151         unsigned int	PortNum;
152 	unsigned char	Len;
153 	unsigned char	Data[PKT_MAX_DATA_LEN];
154 };
155 
156 struct SpecialRupCmd
157 {
158 	struct	PKT		Packet;
159 	unsigned short	Host;
160 	unsigned short	RupNum;
161 };
162 
163 struct	IdentifyRta
164 {
165 	ulong	RtaUnique;
166 	uchar	ID;
167 };
168 
169 struct	KillNeighbour
170 {
171 	ulong	UniqueNum;
172 	uchar	Link;
173 };
174 
175 struct rioVersion {
176     char        version[MAX_VERSION_LEN];
177     char        relid[MAX_VERSION_LEN];
178     int         buildLevel;
179     char        buildDate[MAX_VERSION_LEN];
180 };
181 
182 
183 /*
184 **	RIOC commands are for the daemon type operations
185 **
186 ** 09.12.1998 ARG - ESIL 0776 part fix
187 ** Definition for 'RIOC' also appears in rioioctl.h, so we'd better do a
188 ** #ifndef here first.
189 ** rioioctl.h also now has #define 'RIO_QUICK_CHECK' as this ioctl is now
190 ** allowed to be used by customers.
191 */
192 #ifndef RIOC
193 #define	RIOC	('R'<<8)|('i'<<16)|('o'<<24)
194 #endif
195 
196 /*
197 ** Boot stuff
198 */
199 #define	RIO_GET_TABLE     (RIOC | 100)
200 #define RIO_PUT_TABLE     (RIOC | 101)
201 #define RIO_ASSIGN_RTA    (RIOC | 102)
202 #define RIO_DELETE_RTA    (RIOC | 103)
203 #define	RIO_HOST_FOAD	  (RIOC | 104)
204 #define	RIO_QUICK_CHECK	  (RIOC | 105)
205 #define RIO_SIGNALS_ON    (RIOC | 106)
206 #define RIO_SIGNALS_OFF   (RIOC | 107)
207 #define	RIO_CHANGE_NAME   (RIOC | 108)
208 #define RIO_DOWNLOAD      (RIOC | 109)
209 #define	RIO_GET_LOG	  (RIOC | 110)
210 #define	RIO_SETUP_PORTS   (RIOC | 111)
211 #define RIO_ALL_MODEM     (RIOC | 112)
212 
213 /*
214 ** card state, debug stuff
215 */
216 #define	RIO_NUM_HOSTS	  (RIOC | 120)
217 #define	RIO_HOST_LPB	  (RIOC | 121)
218 #define	RIO_HOST_RUP	  (RIOC | 122)
219 #define	RIO_HOST_PORT	  (RIOC | 123)
220 #define	RIO_PARMS 	  (RIOC | 124)
221 #define RIO_HOST_REQ	  (RIOC | 125)
222 #define	RIO_READ_CONFIG	  (RIOC | 126)
223 #define	RIO_SET_CONFIG	  (RIOC | 127)
224 #define	RIO_VERSID	  (RIOC | 128)
225 #define	RIO_FLAGS	  (RIOC | 129)
226 #define	RIO_SETDEBUG	  (RIOC | 130)
227 #define	RIO_GETDEBUG	  (RIOC | 131)
228 #define	RIO_READ_LEVELS   (RIOC | 132)
229 #define	RIO_SET_FAST_BUS  (RIOC | 133)
230 #define	RIO_SET_SLOW_BUS  (RIOC | 134)
231 #define	RIO_SET_BYTE_MODE (RIOC | 135)
232 #define	RIO_SET_WORD_MODE (RIOC | 136)
233 #define RIO_STREAM_INFO   (RIOC | 137)
234 #define	RIO_START_POLLER  (RIOC | 138)
235 #define	RIO_STOP_POLLER   (RIOC | 139)
236 #define	RIO_LAST_ERROR    (RIOC | 140)
237 #define	RIO_TICK	  (RIOC | 141)
238 #define	RIO_TOCK	  (RIOC | 241)	/* I did this on purpose, you know. */
239 #define	RIO_SEND_PACKET   (RIOC | 142)
240 #define	RIO_SET_BUSY	  (RIOC | 143)
241 #define	SPECIAL_RUP_CMD   (RIOC | 144)
242 #define	RIO_FOAD_RTA      (RIOC | 145)
243 #define	RIO_ZOMBIE_RTA    (RIOC | 146)
244 #define RIO_IDENTIFY_RTA  (RIOC | 147)
245 #define RIO_KILL_NEIGHBOUR (RIOC | 148)
246 #define RIO_DEBUG_MEM     (RIOC | 149)
247 /*
248 ** 150 - 167 used.....   See below
249 */
250 #define RIO_GET_PORT_SETUP (RIOC | 168)
251 #define RIO_RESUME        (RIOC | 169)
252 #define	RIO_MESG	(RIOC | 170)
253 #define	RIO_NO_MESG	(RIOC | 171)
254 #define	RIO_WHAT_MESG	(RIOC | 172)
255 #define RIO_HOST_DPRAM	(RIOC | 173)
256 #define RIO_MAP_B50_TO_50	(RIOC | 174)
257 #define RIO_MAP_B50_TO_57600	(RIOC | 175)
258 #define RIO_MAP_B110_TO_110	(RIOC | 176)
259 #define RIO_MAP_B110_TO_115200	(RIOC | 177)
260 #define RIO_GET_PORT_PARAMS	(RIOC | 178)
261 #define RIO_SET_PORT_PARAMS	(RIOC | 179)
262 #define RIO_GET_PORT_TTY	(RIOC | 180)
263 #define RIO_SET_PORT_TTY	(RIOC | 181)
264 #define RIO_SYSLOG_ONLY	(RIOC | 182)
265 #define RIO_SYSLOG_CONS	(RIOC | 183)
266 #define RIO_CONS_ONLY	(RIOC | 184)
267 #define RIO_BLOCK_OPENS	(RIOC | 185)
268 
269 /*
270 ** 02.03.1999 ARG - ESIL 0820 fix :
271 ** RIOBootMode is no longer use by the driver, so these ioctls
272 ** are now obsolete :
273 **
274 #define RIO_GET_BOOT_MODE	(RIOC | 186)
275 #define RIO_SET_BOOT_MODE	(RIOC | 187)
276 **
277 */
278 
279 #define RIO_MEM_DUMP	(RIOC | 189)
280 #define RIO_READ_REGISTER	(RIOC | 190)
281 #define RIO_GET_MODTYPE	(RIOC | 191)
282 #define RIO_SET_TIMER	(RIOC | 192)
283 #define RIO_READ_CHECK	(RIOC | 196)
284 #define RIO_WAITING_FOR_RESTART	(RIOC | 197)
285 #define RIO_BIND_RTA	(RIOC | 198)
286 #define RIO_GET_BINDINGS	(RIOC | 199)
287 #define RIO_PUT_BINDINGS	(RIOC | 200)
288 
289 #define	RIO_MAKE_DEV		(RIOC | 201)
290 #define	RIO_MINOR		(RIOC | 202)
291 
292 #define	RIO_IDENTIFY_DRIVER	(RIOC | 203)
293 #define	RIO_DISPLAY_HOST_CFG	(RIOC | 204)
294 
295 
296 /*
297 ** MAKE_DEV / MINOR stuff
298 */
299 #define	RIO_DEV_DIRECT		0x0000
300 #define	RIO_DEV_MODEM		0x0200
301 #define	RIO_DEV_XPRINT		0x0400
302 #define	RIO_DEV_MASK		0x0600
303 
304 /*
305 ** port management, xprint stuff
306 */
307 #define	rIOCN(N)	(RIOC|(N))
308 #define	rIOCR(N,T)	(RIOC|(N))
309 #define	rIOCW(N,T)	(RIOC|(N))
310 
311 #define	RIO_GET_XP_ON     rIOCR(150,char[16])	/* start xprint string */
312 #define	RIO_SET_XP_ON     rIOCW(151,char[16])
313 #define	RIO_GET_XP_OFF    rIOCR(152,char[16])	/* finish xprint string */
314 #define	RIO_SET_XP_OFF    rIOCW(153,char[16])
315 #define	RIO_GET_XP_CPS    rIOCR(154,int)	/* xprint CPS */
316 #define	RIO_SET_XP_CPS    rIOCW(155,int)
317 #define RIO_GET_IXANY     rIOCR(156,int)	/* ixany allowed? */
318 #define RIO_SET_IXANY     rIOCW(157,int)
319 #define RIO_SET_IXANY_ON  rIOCN(158)		/* allow ixany */
320 #define RIO_SET_IXANY_OFF rIOCN(159)		/* disallow ixany */
321 #define RIO_GET_MODEM     rIOCR(160,int)	/* port is modem/direct line? */
322 #define RIO_SET_MODEM     rIOCW(161,int)
323 #define RIO_SET_MODEM_ON  rIOCN(162)		/* port is a modem */
324 #define RIO_SET_MODEM_OFF rIOCN(163)		/* port is direct */
325 #define RIO_GET_IXON      rIOCR(164,int)	/* ixon allowed? */
326 #define RIO_SET_IXON      rIOCW(165,int)
327 #define RIO_SET_IXON_ON   rIOCN(166)		/* allow ixon */
328 #define RIO_SET_IXON_OFF  rIOCN(167)		/* disallow ixon */
329 
330 #define RIO_GET_SIVIEW	  ((('s')<<8) | 106)	/* backwards compatible with SI */
331 
332 #define	RIO_IOCTL_UNKNOWN	-2
333 
334 #endif
335