blob: 2663ca0306e2a0567f0d4fa2728e9e4ddb4a8df5 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/****************************************************************************
2 ******* *******
3 ******* P H B H E A D E R *******
4 ******* *******
5 ****************************************************************************
6
7 Author : Ian Nandhra, Jeremy Rolls
8 Date :
9
10 *
11 * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
12 *
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.
17 *
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.
22 *
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.
26
27 Version : 0.01
28
29
30 Mods
31 ----------------------------------------------------------------------------
32 Date By Description
33 ----------------------------------------------------------------------------
34
35 ***************************************************************************/
36
37#ifndef _phb_h
38#define _phb_h 1
39
40#ifdef SCCS_LABELS
41#ifndef lint
42/* static char *_rio_phb_h_sccs = "@(#)phb.h 1.12"; */
43#endif
44#endif
45
46
Linus Torvalds1da177e2005-04-16 15:20:36 -070047/*************************************************
48 * Handshake asserted. Deasserted by the LTT(s)
49 ************************************************/
Andrew Morton8d8706e2006-01-11 12:17:49 -080050#define PHB_HANDSHAKE_SET ((ushort) 0x001) /* Set by LRT */
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
Andrew Morton8d8706e2006-01-11 12:17:49 -080052#define PHB_HANDSHAKE_RESET ((ushort) 0x002) /* Set by ISR / driver */
Linus Torvalds1da177e2005-04-16 15:20:36 -070053
54#define PHB_HANDSHAKE_FLAGS (PHB_HANDSHAKE_RESET | PHB_HANDSHAKE_SET)
Andrew Morton8d8706e2006-01-11 12:17:49 -080055 /* Reset by ltt */
Linus Torvalds1da177e2005-04-16 15:20:36 -070056
57
58/*************************************************
59 * Maximum number of PHB's
60 ************************************************/
Andrew Morton8d8706e2006-01-11 12:17:49 -080061#define MAX_PHB ((ushort) 128) /* range 0-127 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070062
63/*************************************************
64 * Defines for the mode fields
65 ************************************************/
Andrew Morton8d8706e2006-01-11 12:17:49 -080066#define TXPKT_INCOMPLETE 0x0001 /* Previous tx packet not completed */
67#define TXINTR_ENABLED 0x0002 /* Tx interrupt is enabled */
68#define TX_TAB3 0x0004 /* TAB3 mode */
69#define TX_OCRNL 0x0008 /* OCRNL mode */
70#define TX_ONLCR 0x0010 /* ONLCR mode */
71#define TX_SENDSPACES 0x0020 /* Send n spaces command needs
72 completing */
73#define TX_SENDNULL 0x0040 /* Escaping NULL needs completing */
74#define TX_SENDLF 0x0080 /* LF -> CR LF needs completing */
75#define TX_PARALLELBUG 0x0100 /* CD1400 LF -> CR LF bug on parallel
76 port */
Linus Torvalds1da177e2005-04-16 15:20:36 -070077#define TX_HANGOVER (TX_SENDSPACES | TX_SENDLF | TX_SENDNULL)
78#define TX_DTRFLOW 0x0200 /* DTR tx flow control */
79#define TX_DTRFLOWED 0x0400 /* DTR is low - don't allow more data
80 into the FIFO */
81#define TX_DATAINFIFO 0x0800 /* There is data in the FIFO */
82#define TX_BUSY 0x1000 /* Data in FIFO, shift or holding regs */
83
Andrew Morton8d8706e2006-01-11 12:17:49 -080084#define RX_SPARE 0x0001 /* SPARE */
85#define RXINTR_ENABLED 0x0002 /* Rx interrupt enabled */
86#define RX_ICRNL 0x0008 /* ICRNL mode */
87#define RX_INLCR 0x0010 /* INLCR mode */
88#define RX_IGNCR 0x0020 /* IGNCR mode */
89#define RX_CTSFLOW 0x0040 /* CTSFLOW enabled */
90#define RX_IXOFF 0x0080 /* IXOFF enabled */
91#define RX_CTSFLOWED 0x0100 /* CTSFLOW and CTS dropped */
92#define RX_IXOFFED 0x0200 /* IXOFF and xoff sent */
93#define RX_BUFFERED 0x0400 /* Try and pass on complete packets */
Linus Torvalds1da177e2005-04-16 15:20:36 -070094
Andrew Morton8d8706e2006-01-11 12:17:49 -080095#define PORT_ISOPEN 0x0001 /* Port open? */
96#define PORT_HUPCL 0x0002 /* Hangup on close? */
97#define PORT_MOPENPEND 0x0004 /* Modem open pending */
98#define PORT_ISPARALLEL 0x0008 /* Parallel port */
99#define PORT_BREAK 0x0010 /* Port on break */
100#define PORT_STATUSPEND 0x0020 /* Status packet pending */
101#define PORT_BREAKPEND 0x0040 /* Break packet pending */
102#define PORT_MODEMPEND 0x0080 /* Modem status packet pending */
103#define PORT_PARALLELBUG 0x0100 /* CD1400 LF -> CR LF bug on parallel
104 port */
105#define PORT_FULLMODEM 0x0200 /* Full modem signals */
106#define PORT_RJ45 0x0400 /* RJ45 connector - no RI signal */
107#define PORT_RESTRICTED 0x0600 /* Restricted connector - no RI / DTR */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108
Andrew Morton8d8706e2006-01-11 12:17:49 -0800109#define PORT_MODEMBITS 0x0600 /* Mask for modem fields */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110
Andrew Morton8d8706e2006-01-11 12:17:49 -0800111#define PORT_WCLOSE 0x0800 /* Waiting for close */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112#define PORT_HANDSHAKEFIX 0x1000 /* Port has H/W flow control fix */
113#define PORT_WASPCLOSED 0x2000 /* Port closed with PCLOSE */
114#define DUMPMODE 0x4000 /* Dump RTA mem */
115#define READ_REG 0x8000 /* Read CD1400 register */
116
117
118
119/**************************************************************************
120 * PHB Structure
121 * A few words.
122 *
123 * Normally Packets are added to the end of the list and removed from
124 * the start. The pointer tx_add points to a SPACE to put a Packet.
125 * The pointer tx_remove points to the next Packet to remove
126 *************************************************************************/
Andrew Morton8d8706e2006-01-11 12:17:49 -0800127typedef struct PHB PHB;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700128struct PHB {
Andrew Morton8d8706e2006-01-11 12:17:49 -0800129 WORD source;
Andrew Morton8d8706e2006-01-11 12:17:49 -0800130 WORD handshake;
131 WORD status;
132 NUMBER timeout; /* Maximum of 1.9 seconds */
133 WORD link; /* Send down this link */
Andrew Morton8d8706e2006-01-11 12:17:49 -0800134 WORD destination;
Andrew Morton8d8706e2006-01-11 12:17:49 -0800135 PKT_ptr_ptr tx_start;
136 PKT_ptr_ptr tx_end;
137 PKT_ptr_ptr tx_add;
138 PKT_ptr_ptr tx_remove;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700139
Andrew Morton8d8706e2006-01-11 12:17:49 -0800140 PKT_ptr_ptr rx_start;
141 PKT_ptr_ptr rx_end;
142 PKT_ptr_ptr rx_add;
143 PKT_ptr_ptr rx_remove;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700144
Andrew Morton8d8706e2006-01-11 12:17:49 -0800145};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146
147#endif
148
149/*********** end of file ***********/