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