umct.h revision 1.1.2.2 1 1.1.2.2 nathanw /* $NetBSD: umct.h,v 1.1.2.2 2001/04/09 01:57:37 nathanw Exp $ */
2 1.1.2.2 nathanw /*
3 1.1.2.2 nathanw * Copyright (c) 2001 The NetBSD Foundation, Inc.
4 1.1.2.2 nathanw * All rights reserved.
5 1.1.2.2 nathanw *
6 1.1.2.2 nathanw * This code is derived from software contributed to The NetBSD Foundation
7 1.1.2.2 nathanw * by Ichiro FUKUHARA (ichiro (at) ichiro.org).
8 1.1.2.2 nathanw *
9 1.1.2.2 nathanw * Redistribution and use in source and binary forms, with or without
10 1.1.2.2 nathanw * modification, are permitted provided that the following conditions
11 1.1.2.2 nathanw * are met:
12 1.1.2.2 nathanw * 1. Redistributions of source code must retain the above copyright
13 1.1.2.2 nathanw * notice, this list of conditions and the following disclaimer.
14 1.1.2.2 nathanw * 2. Redistributions in binary form must reproduce the above copyright
15 1.1.2.2 nathanw * notice, this list of conditions and the following disclaimer in the
16 1.1.2.2 nathanw * documentation and/or other materials provided with the distribution.
17 1.1.2.2 nathanw * 3. All advertising materials mentioning features or use of this software
18 1.1.2.2 nathanw * must display the following acknowledgement:
19 1.1.2.2 nathanw * This product includes software developed by the NetBSD
20 1.1.2.2 nathanw * Foundation, Inc. and its contributors.
21 1.1.2.2 nathanw * 4. Neither the name of The NetBSD Foundation nor the names of its
22 1.1.2.2 nathanw * contributors may be used to endorse or promote products derived
23 1.1.2.2 nathanw * from this software without specific prior written permission.
24 1.1.2.2 nathanw *
25 1.1.2.2 nathanw * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26 1.1.2.2 nathanw * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27 1.1.2.2 nathanw * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 1.1.2.2 nathanw * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29 1.1.2.2 nathanw * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 1.1.2.2 nathanw * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 1.1.2.2 nathanw * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 1.1.2.2 nathanw * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 1.1.2.2 nathanw * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 1.1.2.2 nathanw * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 1.1.2.2 nathanw * POSSIBILITY OF SUCH DAMAGE.
36 1.1.2.2 nathanw */
37 1.1.2.2 nathanw
38 1.1.2.2 nathanw /*
39 1.1.2.2 nathanw * Vendor Request Interface
40 1.1.2.2 nathanw */
41 1.1.2.2 nathanw #define UMCT_SET_REQUEST 0x40
42 1.1.2.2 nathanw #define UMCT_GET_REQUEST 0xc0
43 1.1.2.2 nathanw
44 1.1.2.2 nathanw #define REQ_SET_BAUD_RATE 5 /* Set Baud Rate Divisor */
45 1.1.2.2 nathanw #define LENGTH_BAUD_RATE 4
46 1.1.2.2 nathanw
47 1.1.2.2 nathanw #define REQ_GET_MSR 2 /* Get Modem Status Register (MSR) */
48 1.1.2.2 nathanw #define LENGTH_GET_MSR 1
49 1.1.2.2 nathanw
50 1.1.2.2 nathanw #define REQ_GET_LCR 6 /* Get Line Control Register (LCR) */
51 1.1.2.2 nathanw #define LENGTH_GET_LCR 1
52 1.1.2.2 nathanw
53 1.1.2.2 nathanw #define REQ_SET_LCR 7 /* Set Line Control Register (LCR) */
54 1.1.2.2 nathanw #define LENGTH_SET_LCR 1
55 1.1.2.2 nathanw
56 1.1.2.2 nathanw #define REQ_SET_MCR 10 /* Set Modem Control Register (MCR) */
57 1.1.2.2 nathanw #define LENGTH_SET_MCR 1
58 1.1.2.2 nathanw
59 1.1.2.2 nathanw /*
60 1.1.2.2 nathanw * Baud rate (divisor)
61 1.1.2.2 nathanw */
62 1.1.2.2 nathanw #define UMCT_BAUD_RATE(b) (115200/b)
63 1.1.2.2 nathanw
64 1.1.2.2 nathanw /*
65 1.1.2.2 nathanw * Line Control Register (LCR)
66 1.1.2.2 nathanw */
67 1.1.2.2 nathanw #define LCR_SET_BREAK 0x40
68 1.1.2.2 nathanw #define LCR_PARITY_EVEN 0x18
69 1.1.2.2 nathanw #define LCR_PARITY_ODD 0x08
70 1.1.2.2 nathanw #define LCR_PARITY_NONE 0x00
71 1.1.2.2 nathanw #define LCR_DATA_BITS_5 0x00
72 1.1.2.2 nathanw #define LCR_DATA_BITS_6 0x01
73 1.1.2.2 nathanw #define LCR_DATA_BITS_7 0x02
74 1.1.2.2 nathanw #define LCR_DATA_BITS_8 0x03
75 1.1.2.2 nathanw #define LCR_STOP_BITS_2 0x04
76 1.1.2.2 nathanw #define LCR_STOP_BITS_1 0x00
77 1.1.2.2 nathanw
78 1.1.2.2 nathanw /*
79 1.1.2.2 nathanw * Modem Control Register (MCR)
80 1.1.2.2 nathanw */
81 1.1.2.2 nathanw #define MCR_NONE 0x8
82 1.1.2.2 nathanw #define MCR_RTS 0xa
83 1.1.2.2 nathanw #define MCR_DTR 0x9
84 1.1.2.2 nathanw
85 1.1.2.2 nathanw /*
86 1.1.2.2 nathanw * Modem Status Register (MSR)
87 1.1.2.2 nathanw */
88 1.1.2.2 nathanw #define MSR_CD 0x80 /* Current CD */
89 1.1.2.2 nathanw #define MSR_RI 0x40 /* Current RI */
90 1.1.2.2 nathanw #define MSR_DSR 0x20 /* Current DSR */
91 1.1.2.2 nathanw #define MSR_CTS 0x10 /* Current CTS */
92 1.1.2.2 nathanw #define MSR_DCD 0x08 /* Delta CD */
93 1.1.2.2 nathanw #define MSR_DRI 0x04 /* Delta RI */
94 1.1.2.2 nathanw #define MSR_DDSR 0x02 /* Delta DSR */
95 1.1.2.2 nathanw #define MSR_DCTS 0x01 /* Delta CTS */
96 1.1.2.2 nathanw
97 1.1.2.2 nathanw /*
98 1.1.2.2 nathanw * Line Status Register (LSR)
99 1.1.2.2 nathanw */
100 1.1.2.2 nathanw #define LSR_ERR 0x80 /* OE | PE | FE | BI */
101 1.1.2.2 nathanw #define LSR_TEMT 0x40 /* transmit register empty */
102 1.1.2.2 nathanw #define LSR_THRE 0x20 /* transmit holding register empty */
103 1.1.2.2 nathanw #define LSR_BI 0x10 /* break indicator */
104 1.1.2.2 nathanw #define LSR_FE 0x08 /* framing error */
105 1.1.2.2 nathanw #define LSR_OE 0x02 /* overrun error */
106 1.1.2.2 nathanw #define LSR_PE 0x04 /* parity error */
107 1.1.2.2 nathanw #define LSR_OE 0x02 /* overrun error */
108 1.1.2.2 nathanw #define LSR_DR 0x01 /* receive data ready */
109