Commit | Line | Data |
---|---|---|
1da177e4 LT |
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 | ||
8d8706e2 | 47 | struct Error { |
27c6e526 AC |
48 | unsigned int Error; |
49 | unsigned int Entry; | |
50 | unsigned int Other; | |
1da177e4 LT |
51 | }; |
52 | ||
8d8706e2 | 53 | struct DownLoad { |
d886cb58 | 54 | char __user *DataP; |
27c6e526 AC |
55 | unsigned int Count; |
56 | unsigned int ProductCode; | |
1da177e4 LT |
57 | }; |
58 | ||
59 | /* | |
60 | ** A few constants.... | |
61 | */ | |
62 | #ifndef MAX_VERSION_LEN | |
63 | #define MAX_VERSION_LEN 256 | |
64 | #endif | |
65 | ||
66 | #ifndef MAX_XP_CTRL_LEN | |
8d8706e2 | 67 | #define MAX_XP_CTRL_LEN 16 /* ALSO IN PORT.H */ |
1da177e4 LT |
68 | #endif |
69 | ||
8d8706e2 | 70 | struct PortSetup { |
27c6e526 AC |
71 | unsigned int From; /* Set/Clear XP & IXANY Control from this port.... */ |
72 | unsigned int To; /* .... to this port */ | |
73 | unsigned int XpCps; /* at this speed */ | |
8d8706e2 AM |
74 | char XpOn[MAX_XP_CTRL_LEN]; /* this is the start string */ |
75 | char XpOff[MAX_XP_CTRL_LEN]; /* this is the stop string */ | |
27c6e526 AC |
76 | u8 IxAny; /* enable/disable IXANY */ |
77 | u8 IxOn; /* enable/disable IXON */ | |
78 | u8 Lock; /* lock port params */ | |
79 | u8 Store; /* store params across closes */ | |
80 | u8 Drain; /* close only when drained */ | |
1da177e4 LT |
81 | }; |
82 | ||
8d8706e2 | 83 | struct LpbReq { |
27c6e526 AC |
84 | unsigned int Host; |
85 | unsigned int Link; | |
d886cb58 | 86 | struct LPB __user *LpbP; |
1da177e4 LT |
87 | }; |
88 | ||
8d8706e2 | 89 | struct RupReq { |
27c6e526 AC |
90 | unsigned int HostNum; |
91 | unsigned int RupNum; | |
d886cb58 | 92 | struct RUP __user *RupP; |
1da177e4 LT |
93 | }; |
94 | ||
8d8706e2 | 95 | struct PortReq { |
27c6e526 | 96 | unsigned int SysPort; |
d886cb58 | 97 | struct Port __user *PortP; |
1da177e4 LT |
98 | }; |
99 | ||
8d8706e2 | 100 | struct StreamInfo { |
27c6e526 | 101 | unsigned int SysPort; |
1da177e4 LT |
102 | int RQueue; |
103 | int WQueue; | |
1da177e4 LT |
104 | }; |
105 | ||
8d8706e2 | 106 | struct HostReq { |
27c6e526 | 107 | unsigned int HostNum; |
d886cb58 | 108 | struct Host __user *HostP; |
1da177e4 LT |
109 | }; |
110 | ||
8d8706e2 | 111 | struct HostDpRam { |
27c6e526 | 112 | unsigned int HostNum; |
d886cb58 | 113 | struct DpRam __user *DpRamP; |
1da177e4 LT |
114 | }; |
115 | ||
8d8706e2 | 116 | struct DebugCtrl { |
27c6e526 AC |
117 | unsigned int SysPort; |
118 | unsigned int Debug; | |
119 | unsigned int Wait; | |
1da177e4 LT |
120 | }; |
121 | ||
8d8706e2 | 122 | struct MapInfo { |
27c6e526 AC |
123 | unsigned int FirstPort; /* 8 ports, starting from this (tty) number */ |
124 | unsigned int RtaUnique; /* reside on this RTA (unique number) */ | |
1da177e4 LT |
125 | }; |
126 | ||
8d8706e2 | 127 | struct MapIn { |
27c6e526 | 128 | unsigned int NumEntries; /* How many port sets are we mapping? */ |
8d8706e2 | 129 | struct MapInfo *MapInfoP; /* Pointer to (user space) info */ |
1da177e4 LT |
130 | }; |
131 | ||
8d8706e2 AM |
132 | struct SendPack { |
133 | unsigned int PortNum; | |
134 | unsigned char Len; | |
135 | unsigned char Data[PKT_MAX_DATA_LEN]; | |
1da177e4 LT |
136 | }; |
137 | ||
8d8706e2 AM |
138 | struct SpecialRupCmd { |
139 | struct PKT Packet; | |
140 | unsigned short Host; | |
141 | unsigned short RupNum; | |
1da177e4 LT |
142 | }; |
143 | ||
8d8706e2 | 144 | struct IdentifyRta { |
27c6e526 AC |
145 | unsigned long RtaUnique; |
146 | u8 ID; | |
1da177e4 LT |
147 | }; |
148 | ||
8d8706e2 | 149 | struct KillNeighbour { |
27c6e526 AC |
150 | unsigned long UniqueNum; |
151 | u8 Link; | |
1da177e4 LT |
152 | }; |
153 | ||
154 | struct rioVersion { | |
8d8706e2 AM |
155 | char version[MAX_VERSION_LEN]; |
156 | char relid[MAX_VERSION_LEN]; | |
157 | int buildLevel; | |
158 | char buildDate[MAX_VERSION_LEN]; | |
1da177e4 LT |
159 | }; |
160 | ||
161 | ||
162 | /* | |
163 | ** RIOC commands are for the daemon type operations | |
164 | ** | |
165 | ** 09.12.1998 ARG - ESIL 0776 part fix | |
166 | ** Definition for 'RIOC' also appears in rioioctl.h, so we'd better do a | |
167 | ** #ifndef here first. | |
168 | ** rioioctl.h also now has #define 'RIO_QUICK_CHECK' as this ioctl is now | |
169 | ** allowed to be used by customers. | |
170 | */ | |
171 | #ifndef RIOC | |
172 | #define RIOC ('R'<<8)|('i'<<16)|('o'<<24) | |
173 | #endif | |
174 | ||
175 | /* | |
176 | ** Boot stuff | |
177 | */ | |
178 | #define RIO_GET_TABLE (RIOC | 100) | |
179 | #define RIO_PUT_TABLE (RIOC | 101) | |
180 | #define RIO_ASSIGN_RTA (RIOC | 102) | |
181 | #define RIO_DELETE_RTA (RIOC | 103) | |
182 | #define RIO_HOST_FOAD (RIOC | 104) | |
183 | #define RIO_QUICK_CHECK (RIOC | 105) | |
184 | #define RIO_SIGNALS_ON (RIOC | 106) | |
185 | #define RIO_SIGNALS_OFF (RIOC | 107) | |
186 | #define RIO_CHANGE_NAME (RIOC | 108) | |
187 | #define RIO_DOWNLOAD (RIOC | 109) | |
188 | #define RIO_GET_LOG (RIOC | 110) | |
189 | #define RIO_SETUP_PORTS (RIOC | 111) | |
190 | #define RIO_ALL_MODEM (RIOC | 112) | |
191 | ||
192 | /* | |
193 | ** card state, debug stuff | |
194 | */ | |
195 | #define RIO_NUM_HOSTS (RIOC | 120) | |
196 | #define RIO_HOST_LPB (RIOC | 121) | |
197 | #define RIO_HOST_RUP (RIOC | 122) | |
198 | #define RIO_HOST_PORT (RIOC | 123) | |
199 | #define RIO_PARMS (RIOC | 124) | |
200 | #define RIO_HOST_REQ (RIOC | 125) | |
201 | #define RIO_READ_CONFIG (RIOC | 126) | |
202 | #define RIO_SET_CONFIG (RIOC | 127) | |
203 | #define RIO_VERSID (RIOC | 128) | |
204 | #define RIO_FLAGS (RIOC | 129) | |
205 | #define RIO_SETDEBUG (RIOC | 130) | |
206 | #define RIO_GETDEBUG (RIOC | 131) | |
207 | #define RIO_READ_LEVELS (RIOC | 132) | |
208 | #define RIO_SET_FAST_BUS (RIOC | 133) | |
209 | #define RIO_SET_SLOW_BUS (RIOC | 134) | |
210 | #define RIO_SET_BYTE_MODE (RIOC | 135) | |
211 | #define RIO_SET_WORD_MODE (RIOC | 136) | |
212 | #define RIO_STREAM_INFO (RIOC | 137) | |
213 | #define RIO_START_POLLER (RIOC | 138) | |
214 | #define RIO_STOP_POLLER (RIOC | 139) | |
215 | #define RIO_LAST_ERROR (RIOC | 140) | |
216 | #define RIO_TICK (RIOC | 141) | |
217 | #define RIO_TOCK (RIOC | 241) /* I did this on purpose, you know. */ | |
218 | #define RIO_SEND_PACKET (RIOC | 142) | |
219 | #define RIO_SET_BUSY (RIOC | 143) | |
220 | #define SPECIAL_RUP_CMD (RIOC | 144) | |
221 | #define RIO_FOAD_RTA (RIOC | 145) | |
222 | #define RIO_ZOMBIE_RTA (RIOC | 146) | |
223 | #define RIO_IDENTIFY_RTA (RIOC | 147) | |
224 | #define RIO_KILL_NEIGHBOUR (RIOC | 148) | |
225 | #define RIO_DEBUG_MEM (RIOC | 149) | |
226 | /* | |
227 | ** 150 - 167 used..... See below | |
228 | */ | |
229 | #define RIO_GET_PORT_SETUP (RIOC | 168) | |
230 | #define RIO_RESUME (RIOC | 169) | |
231 | #define RIO_MESG (RIOC | 170) | |
232 | #define RIO_NO_MESG (RIOC | 171) | |
233 | #define RIO_WHAT_MESG (RIOC | 172) | |
234 | #define RIO_HOST_DPRAM (RIOC | 173) | |
235 | #define RIO_MAP_B50_TO_50 (RIOC | 174) | |
236 | #define RIO_MAP_B50_TO_57600 (RIOC | 175) | |
237 | #define RIO_MAP_B110_TO_110 (RIOC | 176) | |
238 | #define RIO_MAP_B110_TO_115200 (RIOC | 177) | |
239 | #define RIO_GET_PORT_PARAMS (RIOC | 178) | |
240 | #define RIO_SET_PORT_PARAMS (RIOC | 179) | |
241 | #define RIO_GET_PORT_TTY (RIOC | 180) | |
242 | #define RIO_SET_PORT_TTY (RIOC | 181) | |
243 | #define RIO_SYSLOG_ONLY (RIOC | 182) | |
244 | #define RIO_SYSLOG_CONS (RIOC | 183) | |
245 | #define RIO_CONS_ONLY (RIOC | 184) | |
246 | #define RIO_BLOCK_OPENS (RIOC | 185) | |
247 | ||
248 | /* | |
249 | ** 02.03.1999 ARG - ESIL 0820 fix : | |
250 | ** RIOBootMode is no longer use by the driver, so these ioctls | |
251 | ** are now obsolete : | |
252 | ** | |
253 | #define RIO_GET_BOOT_MODE (RIOC | 186) | |
254 | #define RIO_SET_BOOT_MODE (RIOC | 187) | |
255 | ** | |
256 | */ | |
257 | ||
258 | #define RIO_MEM_DUMP (RIOC | 189) | |
259 | #define RIO_READ_REGISTER (RIOC | 190) | |
260 | #define RIO_GET_MODTYPE (RIOC | 191) | |
261 | #define RIO_SET_TIMER (RIOC | 192) | |
262 | #define RIO_READ_CHECK (RIOC | 196) | |
263 | #define RIO_WAITING_FOR_RESTART (RIOC | 197) | |
264 | #define RIO_BIND_RTA (RIOC | 198) | |
265 | #define RIO_GET_BINDINGS (RIOC | 199) | |
266 | #define RIO_PUT_BINDINGS (RIOC | 200) | |
267 | ||
268 | #define RIO_MAKE_DEV (RIOC | 201) | |
269 | #define RIO_MINOR (RIOC | 202) | |
270 | ||
271 | #define RIO_IDENTIFY_DRIVER (RIOC | 203) | |
272 | #define RIO_DISPLAY_HOST_CFG (RIOC | 204) | |
273 | ||
274 | ||
275 | /* | |
276 | ** MAKE_DEV / MINOR stuff | |
277 | */ | |
278 | #define RIO_DEV_DIRECT 0x0000 | |
279 | #define RIO_DEV_MODEM 0x0200 | |
280 | #define RIO_DEV_XPRINT 0x0400 | |
281 | #define RIO_DEV_MASK 0x0600 | |
282 | ||
283 | /* | |
284 | ** port management, xprint stuff | |
285 | */ | |
286 | #define rIOCN(N) (RIOC|(N)) | |
287 | #define rIOCR(N,T) (RIOC|(N)) | |
288 | #define rIOCW(N,T) (RIOC|(N)) | |
289 | ||
290 | #define RIO_GET_XP_ON rIOCR(150,char[16]) /* start xprint string */ | |
291 | #define RIO_SET_XP_ON rIOCW(151,char[16]) | |
292 | #define RIO_GET_XP_OFF rIOCR(152,char[16]) /* finish xprint string */ | |
293 | #define RIO_SET_XP_OFF rIOCW(153,char[16]) | |
294 | #define RIO_GET_XP_CPS rIOCR(154,int) /* xprint CPS */ | |
295 | #define RIO_SET_XP_CPS rIOCW(155,int) | |
296 | #define RIO_GET_IXANY rIOCR(156,int) /* ixany allowed? */ | |
297 | #define RIO_SET_IXANY rIOCW(157,int) | |
8d8706e2 AM |
298 | #define RIO_SET_IXANY_ON rIOCN(158) /* allow ixany */ |
299 | #define RIO_SET_IXANY_OFF rIOCN(159) /* disallow ixany */ | |
1da177e4 LT |
300 | #define RIO_GET_MODEM rIOCR(160,int) /* port is modem/direct line? */ |
301 | #define RIO_SET_MODEM rIOCW(161,int) | |
8d8706e2 AM |
302 | #define RIO_SET_MODEM_ON rIOCN(162) /* port is a modem */ |
303 | #define RIO_SET_MODEM_OFF rIOCN(163) /* port is direct */ | |
1da177e4 LT |
304 | #define RIO_GET_IXON rIOCR(164,int) /* ixon allowed? */ |
305 | #define RIO_SET_IXON rIOCW(165,int) | |
8d8706e2 AM |
306 | #define RIO_SET_IXON_ON rIOCN(166) /* allow ixon */ |
307 | #define RIO_SET_IXON_OFF rIOCN(167) /* disallow ixon */ | |
1da177e4 LT |
308 | |
309 | #define RIO_GET_SIVIEW ((('s')<<8) | 106) /* backwards compatible with SI */ | |
310 | ||
311 | #define RIO_IOCTL_UNKNOWN -2 | |
312 | ||
313 | #endif |