Merge from vendor branch OPENSSH:
[dragonfly.git] / sys / dev / serial / rp2 / rpvar.h
1 /* 
2  * Copyright (c) Comtrol Corporation <support@comtrol.com>
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted prodived that the follwoing conditions
7  * are met.
8  * 1. Redistributions of source code must retain the above copyright 
9  *    notive, this list of conditions and the following disclainer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials prodided with the distribution.
13  * 3. All advertising materials mentioning features or use of this software
14  *    must display the following acknowledgement:
15  *       This product includes software developed by Comtrol Corporation.
16  * 4. The name of Comtrol Corporation may not be used to endorse or 
17  *    promote products derived from this software without specific 
18  *    prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY COMTROL CORPORATION ``AS IS'' AND ANY
21  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED.  IN NO EVENT SHALL COMTROL CORPORATION BE LIABLE FOR
24  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26  * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
27  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30  * SUCH DAMAGE.
31  *
32  * $FreeBSD: src/sys/i386/isa/rpvar.h,v 1.1.6.1 2000/08/03 01:01:20 peter Exp $
33  * $DragonFly: src/sys/dev/serial/rp2/Attic/rpvar.h,v 1.2 2003/06/17 04:28:37 dillon Exp $
34  */
35
36 /*
37  * rpvar.h --- RocketPort data structure includes for FreeBSD
38  */
39
40 #define RP_UNIT(x) dv_unit(x)
41 #define RP_PORT(x) (minor(x) & 0x3f)
42 #define MAX_RP_PORTS    128
43
44
45 struct rp_port {
46         struct tty *            rp_tty; /* cross reference */
47
48 /* Initial state */
49         struct termios          it_in;
50         struct termios          it_out;
51
52 /* Lock state */
53         struct termios          lt_in;
54         struct termios          lt_out;
55
56 /* Nonzero if callout device is open */
57         unsigned char           active_out;
58         unsigned char           state;  /* state of dtr */
59
60 /* Time to hold DTR down on close */
61         int                     dtr_wait;
62         int                     wopeners;       /* processes waiting for DCD */
63
64         int                     rp_port;
65         int                     rp_flags;
66         int                     rp_unit:2;
67         int                     rp_aiop:2;
68         int                     rp_chan:3;
69         int                     rp_intmask;
70         int                     rp_imask; /* Input mask */
71         int                     rp_fifo_lw;
72         int                     rp_restart;
73         int                     rp_overflows;
74         int                     rp_rts_iflow:1;
75         int                     rp_disable_writes:1;
76         int                     rp_cts:1;
77         int                     rp_waiting:1;
78         int                     rp_xmit_stopped:1;
79         CONTROLLER_t *          rp_ctlp;
80         CHANNEL_t               rp_channel;
81 };
82
83 struct termios deftermios = {
84         TTYDEF_IFLAG,
85         TTYDEF_OFLAG,
86         TTYDEF_CFLAG,
87         TTYDEF_LFLAG,
88         { CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT,
89         _POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT,
90         CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE },
91         TTYDEF_SPEED,
92         TTYDEF_SPEED
93 };