phb.h 5.7 KB

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