phb.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /****************************************************************************
  2. ******* *******
  3. ******* P H B H E A D E R *******
  4. ******* *******
  5. ****************************************************************************
  6. Author : Ian Nandhra, Jeremy Rolls
  7. Date :
  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 _phb_h
  31. #define _phb_h 1
  32. #ifdef SCCS_LABELS
  33. #ifndef lint
  34. /* static char *_rio_phb_h_sccs = "@(#)phb.h 1.12"; */
  35. #endif
  36. #endif
  37. /*************************************************
  38. * Handshake asserted. Deasserted by the LTT(s)
  39. ************************************************/
  40. #define PHB_HANDSHAKE_SET ((ushort) 0x001) /* Set by LRT */
  41. #define PHB_HANDSHAKE_RESET ((ushort) 0x002) /* Set by ISR / driver */
  42. #define PHB_HANDSHAKE_FLAGS (PHB_HANDSHAKE_RESET | PHB_HANDSHAKE_SET)
  43. /* Reset by ltt */
  44. /*************************************************
  45. * Maximum number of PHB's
  46. ************************************************/
  47. #define MAX_PHB ((ushort) 128) /* range 0-127 */
  48. /*************************************************
  49. * Defines for the mode fields
  50. ************************************************/
  51. #define TXPKT_INCOMPLETE 0x0001 /* Previous tx packet not completed */
  52. #define TXINTR_ENABLED 0x0002 /* Tx interrupt is enabled */
  53. #define TX_TAB3 0x0004 /* TAB3 mode */
  54. #define TX_OCRNL 0x0008 /* OCRNL mode */
  55. #define TX_ONLCR 0x0010 /* ONLCR mode */
  56. #define TX_SENDSPACES 0x0020 /* Send n spaces command needs
  57. completing */
  58. #define TX_SENDNULL 0x0040 /* Escaping NULL needs completing */
  59. #define TX_SENDLF 0x0080 /* LF -> CR LF needs completing */
  60. #define TX_PARALLELBUG 0x0100 /* CD1400 LF -> CR LF bug on parallel
  61. port */
  62. #define TX_HANGOVER (TX_SENDSPACES | TX_SENDLF | TX_SENDNULL)
  63. #define TX_DTRFLOW 0x0200 /* DTR tx flow control */
  64. #define TX_DTRFLOWED 0x0400 /* DTR is low - don't allow more data
  65. into the FIFO */
  66. #define TX_DATAINFIFO 0x0800 /* There is data in the FIFO */
  67. #define TX_BUSY 0x1000 /* Data in FIFO, shift or holding regs */
  68. #define RX_SPARE 0x0001 /* SPARE */
  69. #define RXINTR_ENABLED 0x0002 /* Rx interrupt enabled */
  70. #define RX_ICRNL 0x0008 /* ICRNL mode */
  71. #define RX_INLCR 0x0010 /* INLCR mode */
  72. #define RX_IGNCR 0x0020 /* IGNCR mode */
  73. #define RX_CTSFLOW 0x0040 /* CTSFLOW enabled */
  74. #define RX_IXOFF 0x0080 /* IXOFF enabled */
  75. #define RX_CTSFLOWED 0x0100 /* CTSFLOW and CTS dropped */
  76. #define RX_IXOFFED 0x0200 /* IXOFF and xoff sent */
  77. #define RX_BUFFERED 0x0400 /* Try and pass on complete packets */
  78. #define PORT_ISOPEN 0x0001 /* Port open? */
  79. #define PORT_HUPCL 0x0002 /* Hangup on close? */
  80. #define PORT_MOPENPEND 0x0004 /* Modem open pending */
  81. #define PORT_ISPARALLEL 0x0008 /* Parallel port */
  82. #define PORT_BREAK 0x0010 /* Port on break */
  83. #define PORT_STATUSPEND 0x0020 /* Status packet pending */
  84. #define PORT_BREAKPEND 0x0040 /* Break packet pending */
  85. #define PORT_MODEMPEND 0x0080 /* Modem status packet pending */
  86. #define PORT_PARALLELBUG 0x0100 /* CD1400 LF -> CR LF bug on parallel
  87. port */
  88. #define PORT_FULLMODEM 0x0200 /* Full modem signals */
  89. #define PORT_RJ45 0x0400 /* RJ45 connector - no RI signal */
  90. #define PORT_RESTRICTED 0x0600 /* Restricted connector - no RI / DTR */
  91. #define PORT_MODEMBITS 0x0600 /* Mask for modem fields */
  92. #define PORT_WCLOSE 0x0800 /* Waiting for close */
  93. #define PORT_HANDSHAKEFIX 0x1000 /* Port has H/W flow control fix */
  94. #define PORT_WASPCLOSED 0x2000 /* Port closed with PCLOSE */
  95. #define DUMPMODE 0x4000 /* Dump RTA mem */
  96. #define READ_REG 0x8000 /* Read CD1400 register */
  97. /**************************************************************************
  98. * PHB Structure
  99. * A few words.
  100. *
  101. * Normally Packets are added to the end of the list and removed from
  102. * the start. The pointer tx_add points to a SPACE to put a Packet.
  103. * The pointer tx_remove points to the next Packet to remove
  104. *************************************************************************/
  105. typedef struct PHB PHB;
  106. struct PHB {
  107. WORD source;
  108. WORD handshake;
  109. WORD status;
  110. NUMBER timeout; /* Maximum of 1.9 seconds */
  111. WORD link; /* Send down this link */
  112. WORD destination;
  113. PKT_ptr_ptr tx_start;
  114. PKT_ptr_ptr tx_end;
  115. PKT_ptr_ptr tx_add;
  116. PKT_ptr_ptr tx_remove;
  117. PKT_ptr_ptr rx_start;
  118. PKT_ptr_ptr rx_end;
  119. PKT_ptr_ptr rx_add;
  120. PKT_ptr_ptr rx_remove;
  121. };
  122. #endif
  123. /*********** end of file ***********/