cirrus.h 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. /****************************************************************************
  2. ******* *******
  3. ******* CIRRUS.H *******
  4. ******* *******
  5. ****************************************************************************
  6. Author : Jeremy Rolls
  7. Date : 3 Aug 1990
  8. *
  9. * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24. Version : 0.01
  25. Mods
  26. ----------------------------------------------------------------------------
  27. Date By Description
  28. ----------------------------------------------------------------------------
  29. ***************************************************************************/
  30. #ifndef _cirrus_h
  31. #ifndef lint
  32. /* static char* _cirrus_h_sccs = "@(#)cirrus.h 1.16"; */
  33. #endif
  34. #define _cirrus_h 1
  35. /* Bit fields for particular registers shared with driver */
  36. /* COR1 - driver and RTA */
  37. #define COR1_ODD 0x80 /* Odd parity */
  38. #define COR1_EVEN 0x00 /* Even parity */
  39. #define COR1_NOP 0x00 /* No parity */
  40. #define COR1_FORCE 0x20 /* Force parity */
  41. #define COR1_NORMAL 0x40 /* With parity */
  42. #define COR1_1STOP 0x00 /* 1 stop bit */
  43. #define COR1_15STOP 0x04 /* 1.5 stop bits */
  44. #define COR1_2STOP 0x08 /* 2 stop bits */
  45. #define COR1_5BITS 0x00 /* 5 data bits */
  46. #define COR1_6BITS 0x01 /* 6 data bits */
  47. #define COR1_7BITS 0x02 /* 7 data bits */
  48. #define COR1_8BITS 0x03 /* 8 data bits */
  49. #define COR1_HOST 0xef /* Safe host bits */
  50. /* RTA only */
  51. #define COR1_CINPCK 0x00 /* Check parity of received characters */
  52. #define COR1_CNINPCK 0x10 /* Don't check parity */
  53. /* COR2 bits for both RTA and driver use */
  54. #define COR2_IXANY 0x80 /* IXANY - any character is XON */
  55. #define COR2_IXON 0x40 /* IXON - enable tx soft flowcontrol */
  56. #define COR2_RTSFLOW 0x02 /* Enable tx hardware flow control */
  57. /* Additional driver bits */
  58. #define COR2_HUPCL 0x20 /* Hang up on close */
  59. #define COR2_CTSFLOW 0x04 /* Enable rx hardware flow control */
  60. #define COR2_IXOFF 0x01 /* Enable rx software flow control */
  61. #define COR2_DTRFLOW 0x08 /* Enable tx hardware flow control */
  62. /* RTA use only */
  63. #define COR2_ETC 0x20 /* Embedded transmit options */
  64. #define COR2_LOCAL 0x10 /* Local loopback mode */
  65. #define COR2_REMOTE 0x08 /* Remote loopback mode */
  66. #define COR2_HOST 0xc2 /* Safe host bits */
  67. /* COR3 - RTA use only */
  68. #define COR3_SCDRNG 0x80 /* Enable special char detect for range */
  69. #define COR3_SCD34 0x40 /* Special character detect for SCHR's 3 + 4 */
  70. #define COR3_FCT 0x20 /* Flow control transparency */
  71. #define COR3_SCD12 0x10 /* Special character detect for SCHR's 1 + 2 */
  72. #define COR3_FIFO12 0x0c /* 12 chars for receive FIFO threshold */
  73. #define COR3_FIFO10 0x0a /* 10 chars for receive FIFO threshold */
  74. #define COR3_FIFO8 0x08 /* 8 chars for receive FIFO threshold */
  75. #define COR3_FIFO6 0x06 /* 6 chars for receive FIFO threshold */
  76. #define COR3_THRESHOLD COR3_FIFO8 /* MUST BE LESS THAN MCOR_THRESHOLD */
  77. #define COR3_DEFAULT (COR3_FCT | COR3_THRESHOLD)
  78. /* Default bits for COR3 */
  79. /* COR4 driver and RTA use */
  80. #define COR4_IGNCR 0x80 /* Throw away CR's on input */
  81. #define COR4_ICRNL 0x40 /* Map CR -> NL on input */
  82. #define COR4_INLCR 0x20 /* Map NL -> CR on input */
  83. #define COR4_IGNBRK 0x10 /* Ignore Break */
  84. #define COR4_NBRKINT 0x08 /* No interrupt on break (-BRKINT) */
  85. #define COR4_RAISEMOD 0x01 /* Raise modem output lines on non-zero baud */
  86. /* COR4 driver only */
  87. #define COR4_IGNPAR 0x04 /* IGNPAR (ignore characters with errors) */
  88. #define COR4_PARMRK 0x02 /* PARMRK */
  89. #define COR4_HOST 0xf8 /* Safe host bits */
  90. /* COR4 RTA only */
  91. #define COR4_CIGNPAR 0x02 /* Thrown away bad characters */
  92. #define COR4_CPARMRK 0x04 /* PARMRK characters */
  93. #define COR4_CNPARMRK 0x03 /* Don't PARMRK */
  94. /* COR5 driver and RTA use */
  95. #define COR5_ISTRIP 0x80 /* Strip input chars to 7 bits */
  96. #define COR5_LNE 0x40 /* Enable LNEXT processing */
  97. #define COR5_CMOE 0x20 /* Match good and errored characters */
  98. #define COR5_ONLCR 0x02 /* NL -> CR NL on output */
  99. #define COR5_OCRNL 0x01 /* CR -> NL on output */
  100. /*
  101. ** Spare bits - these are not used in the CIRRUS registers, so we use
  102. ** them to set various other features.
  103. */
  104. /*
  105. ** tstop and tbusy indication
  106. */
  107. #define COR5_TSTATE_ON 0x08 /* Turn on monitoring of tbusy and tstop */
  108. #define COR5_TSTATE_OFF 0x04 /* Turn off monitoring of tbusy and tstop */
  109. /*
  110. ** TAB3
  111. */
  112. #define COR5_TAB3 0x10 /* TAB3 mode */
  113. #define COR5_HOST 0xc3 /* Safe host bits */
  114. /* CCSR */
  115. #define CCSR_TXFLOFF 0x04 /* Tx is xoffed */
  116. /* MSVR1 */
  117. /* NB. DTR / CD swapped from Cirrus spec as the pins are also reversed on the
  118. RTA. This is because otherwise DCD would get lost on the 1 parallel / 3
  119. serial option.
  120. */
  121. #define MSVR1_CD 0x80 /* CD (DSR on Cirrus) */
  122. #define MSVR1_RTS 0x40 /* RTS (CTS on Cirrus) */
  123. #define MSVR1_RI 0x20 /* RI */
  124. #define MSVR1_DTR 0x10 /* DTR (CD on Cirrus) */
  125. #define MSVR1_CTS 0x01 /* CTS output pin (RTS on Cirrus) */
  126. /* Next two used to indicate state of tbusy and tstop to driver */
  127. #define MSVR1_TSTOP 0x08 /* Set if port flow controlled */
  128. #define MSVR1_TEMPTY 0x04 /* Set if port tx buffer empty */
  129. #define MSVR1_HOST 0xf3 /* The bits the host wants */
  130. /* Defines for the subscripts of a CONFIG packet */
  131. #define CONFIG_COR1 1 /* Option register 1 */
  132. #define CONFIG_COR2 2 /* Option register 2 */
  133. #define CONFIG_COR4 3 /* Option register 4 */
  134. #define CONFIG_COR5 4 /* Option register 5 */
  135. #define CONFIG_TXXON 5 /* Tx XON character */
  136. #define CONFIG_TXXOFF 6 /* Tx XOFF character */
  137. #define CONFIG_RXXON 7 /* Rx XON character */
  138. #define CONFIG_RXXOFF 8 /* Rx XOFF character */
  139. #define CONFIG_LNEXT 9 /* LNEXT character */
  140. #define CONFIG_TXBAUD 10 /* Tx baud rate */
  141. #define CONFIG_RXBAUD 11 /* Rx baud rate */
  142. #define PRE_EMPTIVE 0x80 /* Pre-emptive bit in command field */
  143. /* Packet types going from Host to remote - with the exception of OPEN, MOPEN,
  144. CONFIG, SBREAK and MEMDUMP the remaining bytes of the data array will not
  145. be used
  146. */
  147. #define OPEN 0x00 /* Open a port */
  148. #define CONFIG 0x01 /* Configure a port */
  149. #define MOPEN 0x02 /* Modem open (block for DCD) */
  150. #define CLOSE 0x03 /* Close a port */
  151. #define WFLUSH (0x04 | PRE_EMPTIVE) /* Write flush */
  152. #define RFLUSH (0x05 | PRE_EMPTIVE) /* Read flush */
  153. #define RESUME (0x06 | PRE_EMPTIVE) /* Resume if xoffed */
  154. #define SBREAK 0x07 /* Start break */
  155. #define EBREAK 0x08 /* End break */
  156. #define SUSPEND (0x09 | PRE_EMPTIVE) /* Susp op (behave as tho xoffed) */
  157. #define FCLOSE (0x0a | PRE_EMPTIVE) /* Force close */
  158. #define XPRINT 0x0b /* Xprint packet */
  159. #define MBIS (0x0c | PRE_EMPTIVE) /* Set modem lines */
  160. #define MBIC (0x0d | PRE_EMPTIVE) /* Clear modem lines */
  161. #define MSET (0x0e | PRE_EMPTIVE) /* Set modem lines */
  162. #define PCLOSE 0x0f /* Pseudo close - Leaves rx/tx enabled */
  163. #define MGET (0x10 | PRE_EMPTIVE) /* Force update of modem status */
  164. #define MEMDUMP (0x11 | PRE_EMPTIVE) /* Send back mem from addr supplied */
  165. #define READ_REGISTER (0x12 | PRE_EMPTIVE) /* Read CD1400 register (debug) */
  166. /* "Command" packets going from remote to host COMPLETE and MODEM_STATUS
  167. use data[4] / data[3] to indicate current state and modem status respectively
  168. */
  169. #define COMPLETE (0x20 | PRE_EMPTIVE)
  170. /* Command complete */
  171. #define BREAK_RECEIVED (0x21 | PRE_EMPTIVE)
  172. /* Break received */
  173. #define MODEM_STATUS (0x22 | PRE_EMPTIVE)
  174. /* Change in modem status */
  175. /* "Command" packet that could go either way - handshake wake-up */
  176. #define HANDSHAKE (0x23 | PRE_EMPTIVE)
  177. /* Wake-up to HOST / RTA */
  178. #endif