1 /****************************************************************************
3 ******* P H B H E A D E R *******
5 ****************************************************************************
7 Author : Ian Nandhra, Jeremy Rolls
11 * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 ----------------------------------------------------------------------------
33 ----------------------------------------------------------------------------
35 ***************************************************************************/
42 /* static char *_rio_phb_h_sccs = "@(#)phb.h 1.12"; */
47 /*************************************************
48 * Set the LIMIT values.
49 ************************************************/
51 #define RX_LIMIT (ushort) 3
54 #define RX_LIMIT (ushort) 1
58 /*************************************************
59 * Handshake asserted. Deasserted by the LTT(s)
60 ************************************************/
61 #define PHB_HANDSHAKE_SET ((ushort) 0x001) /* Set by LRT */
63 #define PHB_HANDSHAKE_RESET ((ushort) 0x002) /* Set by ISR / driver */
65 #define PHB_HANDSHAKE_FLAGS (PHB_HANDSHAKE_RESET | PHB_HANDSHAKE_SET)
69 /*************************************************
70 * Maximum number of PHB's
71 ************************************************/
72 #if defined (HOST) || defined (INKERNEL)
73 #define MAX_PHB ((ushort) 128) /* range 0-127 */
75 #define MAX_PHB ((ushort) 8) /* range 0-7 */
78 /*************************************************
79 * Defines for the mode fields
80 ************************************************/
81 #define TXPKT_INCOMPLETE 0x0001 /* Previous tx packet not completed */
82 #define TXINTR_ENABLED 0x0002 /* Tx interrupt is enabled */
83 #define TX_TAB3 0x0004 /* TAB3 mode */
84 #define TX_OCRNL 0x0008 /* OCRNL mode */
85 #define TX_ONLCR 0x0010 /* ONLCR mode */
86 #define TX_SENDSPACES 0x0020 /* Send n spaces command needs
88 #define TX_SENDNULL 0x0040 /* Escaping NULL needs completing */
89 #define TX_SENDLF 0x0080 /* LF -> CR LF needs completing */
90 #define TX_PARALLELBUG 0x0100 /* CD1400 LF -> CR LF bug on parallel
92 #define TX_HANGOVER (TX_SENDSPACES | TX_SENDLF | TX_SENDNULL)
93 #define TX_DTRFLOW 0x0200 /* DTR tx flow control */
94 #define TX_DTRFLOWED 0x0400 /* DTR is low - don't allow more data
96 #define TX_DATAINFIFO 0x0800 /* There is data in the FIFO */
97 #define TX_BUSY 0x1000 /* Data in FIFO, shift or holding regs */
99 #define RX_SPARE 0x0001 /* SPARE */
100 #define RXINTR_ENABLED 0x0002 /* Rx interrupt enabled */
101 #define RX_ICRNL 0x0008 /* ICRNL mode */
102 #define RX_INLCR 0x0010 /* INLCR mode */
103 #define RX_IGNCR 0x0020 /* IGNCR mode */
104 #define RX_CTSFLOW 0x0040 /* CTSFLOW enabled */
105 #define RX_IXOFF 0x0080 /* IXOFF enabled */
106 #define RX_CTSFLOWED 0x0100 /* CTSFLOW and CTS dropped */
107 #define RX_IXOFFED 0x0200 /* IXOFF and xoff sent */
108 #define RX_BUFFERED 0x0400 /* Try and pass on complete packets */
110 #define PORT_ISOPEN 0x0001 /* Port open? */
111 #define PORT_HUPCL 0x0002 /* Hangup on close? */
112 #define PORT_MOPENPEND 0x0004 /* Modem open pending */
113 #define PORT_ISPARALLEL 0x0008 /* Parallel port */
114 #define PORT_BREAK 0x0010 /* Port on break */
115 #define PORT_STATUSPEND 0x0020 /* Status packet pending */
116 #define PORT_BREAKPEND 0x0040 /* Break packet pending */
117 #define PORT_MODEMPEND 0x0080 /* Modem status packet pending */
118 #define PORT_PARALLELBUG 0x0100 /* CD1400 LF -> CR LF bug on parallel
120 #define PORT_FULLMODEM 0x0200 /* Full modem signals */
121 #define PORT_RJ45 0x0400 /* RJ45 connector - no RI signal */
122 #define PORT_RESTRICTED 0x0600 /* Restricted connector - no RI / DTR */
124 #define PORT_MODEMBITS 0x0600 /* Mask for modem fields */
126 #define PORT_WCLOSE 0x0800 /* Waiting for close */
127 #define PORT_HANDSHAKEFIX 0x1000 /* Port has H/W flow control fix */
128 #define PORT_WASPCLOSED 0x2000 /* Port closed with PCLOSE */
129 #define DUMPMODE 0x4000 /* Dump RTA mem */
130 #define READ_REG 0x8000 /* Read CD1400 register */
134 /**************************************************************************
138 * Normally Packets are added to the end of the list and removed from
139 * the start. The pointer tx_add points to a SPACE to put a Packet.
140 * The pointer tx_remove points to the next Packet to remove
141 *************************************************************************/
143 #define src_unit u2.s2.unit
144 #define src_port u2.s2.port
145 #define dest_unit u1.s1.unit
146 #define dest_port u1.s1.port
149 #define tx_start u3.s1.tx_start_ptr_ptr
150 #define tx_add u3.s1.tx_add_ptr_ptr
151 #define tx_end u3.s1.tx_end_ptr_ptr
152 #define tx_remove u3.s1.tx_remove_ptr_ptr
153 #define rx_start u4.s1.rx_start_ptr_ptr
154 #define rx_add u4.s1.rx_add_ptr_ptr
155 #define rx_end u4.s1.rx_end_ptr_ptr
156 #define rx_remove u4.s1.rx_remove_ptr_ptr
158 typedef struct PHB PHB
;
168 ushort source
; /* Complete source */
171 unsigned char unit
; /* Source unit */
172 unsigned char port
; /* Source port */
178 NUMBER timeout
; /* Maximum of 1.9 seconds */
179 WORD link
; /* Send down this link */
185 ushort destination
; /* Complete destination */
188 unsigned char unit
; /* Destination unit */
189 unsigned char port
; /* Destination port */
194 ushort tx_pkts_added
;
195 ushort tx_pkts_removed
;
196 Q_BUF_ptr tx_q_start
; /* Start of the Q list chain */
197 short num_tx_q_bufs
; /* Number of Q buffers in the chain */
198 PKT_ptr_ptr tx_add
; /* Add a new Packet here */
199 Q_BUF_ptr tx_add_qb
; /* Pointer to the add Q buf */
200 PKT_ptr_ptr tx_add_st_qbb
; /* Pointer to start of the Q's buf */
201 PKT_ptr_ptr tx_add_end_qbb
; /* Pointer to the end of the Q's buf */
202 PKT_ptr_ptr tx_remove
; /* Remove a Packet here */
203 Q_BUF_ptr tx_remove_qb
; /* Pointer to the remove Q buf */
204 PKT_ptr_ptr tx_remove_st_qbb
; /* Pointer to the start of the Q buf */
205 PKT_ptr_ptr tx_remove_end_qbb
; /* Pointer to the end of the Q buf */
208 PKT_ptr_ptr tx_start
;
211 PKT_ptr_ptr tx_remove
;
218 PKT_ptr_ptr tx_start_ptr_ptr
;
219 PKT_ptr_ptr tx_end_ptr_ptr
;
220 PKT_ptr_ptr tx_add_ptr_ptr
;
221 PKT_ptr_ptr tx_remove_ptr_ptr
;
225 ushort
* tx_start_ptr
;
228 ushort
* tx_remove_ptr
;
234 ushort rx_pkts_added
;
235 ushort rx_pkts_removed
;
236 Q_BUF_ptr rx_q_start
; /* Start of the Q list chain */
237 short num_rx_q_bufs
; /* Number of Q buffers in the chain */
238 PKT_ptr_ptr rx_add
; /* Add a new Packet here */
239 Q_BUF_ptr rx_add_qb
; /* Pointer to the add Q buf */
240 PKT_ptr_ptr rx_add_st_qbb
; /* Pointer to start of the Q's buf */
241 PKT_ptr_ptr rx_add_end_qbb
; /* Pointer to the end of the Q's buf */
242 PKT_ptr_ptr rx_remove
; /* Remove a Packet here */
243 Q_BUF_ptr rx_remove_qb
; /* Pointer to the remove Q buf */
244 PKT_ptr_ptr rx_remove_st_qbb
; /* Pointer to the start of the Q buf */
245 PKT_ptr_ptr rx_remove_end_qbb
; /* Pointer to the end of the Q buf */
248 PKT_ptr_ptr rx_start
;
251 PKT_ptr_ptr rx_remove
;
258 PKT_ptr_ptr rx_start_ptr_ptr
;
259 PKT_ptr_ptr rx_end_ptr_ptr
;
260 PKT_ptr_ptr rx_add_ptr_ptr
;
261 PKT_ptr_ptr rx_remove_ptr_ptr
;
265 ushort
* rx_start_ptr
;
268 ushort
* rx_remove_ptr
;
273 #ifdef RTA /* some fields for the remotes */
274 ushort flush_count
; /* Count of write flushes */
275 ushort txmode
; /* Modes for tx */
276 ushort rxmode
; /* Modes for rx */
277 ushort portmode
; /* Generic modes */
278 ushort column
; /* TAB3 column count */
279 ushort tx_subscript
; /* (TX) Subscript into data field */
280 ushort rx_subscript
; /* (RX) Subscript into data field */
281 PKT_ptr rx_incomplete
; /* Hold an incomplete packet here */
282 ushort modem_bits
; /* Modem bits to mask */
283 ushort lastModem
; /* Modem control lines. */
284 ushort addr
; /* Address for sub commands */
285 ushort MonitorTstate
; /* TRUE if monitoring tstop */
292 /*********** end of file ***********/