daemon.h 8.2 KB

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