4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
28 * Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
34 #include <sys/types.h>
36 #include <sys/stermio.h>
37 #include <sys/termiox.h>
40 const struct speeds speeds
[] = {
56 "19200", B19200
, 19200,
57 "19.2", B19200
, 19200,
58 "38400", B38400
, 38400,
59 "38.4", B38400
, 38400,
60 "57600", B57600
, 57600,
61 "57.6", B57600
, 57600,
62 "76800", B76800
, 76800,
63 "76.8", B76800
, 76800,
64 "115200", B115200
, 115200,
65 "115.2", B115200
, 115200,
66 "153600", B153600
, 153600,
67 "153.6", B153600
, 153600,
68 "230400", B230400
, 230400,
69 "230.4", B230400
, 230400,
70 "307200", B307200
, 307200,
71 "307.2", B307200
, 307200,
72 "460800", B460800
, 460800,
73 "460.8", B460800
, 460800,
74 "921600", B921600
, 921600,
75 "921.6", B921600
, 921600,
79 const struct mds cmodes
[] = {
80 "-parity", CS8
, PARENB
|CSIZE
,
81 "-evenp", CS8
, PARENB
|CSIZE
,
82 "-oddp", CS8
, PARENB
|PARODD
|CSIZE
,
83 "parity", PARENB
|CS7
, PARODD
|CSIZE
,
84 "evenp", PARENB
|CS7
, PARODD
|CSIZE
,
85 "oddp", PARENB
|PARODD
|CS7
, CSIZE
,
101 "-clocal", 0, CLOCAL
,
106 "crtscts", (long)CRTSCTS
, 0,
107 "-crtscts", 0, (long)CRTSCTS
,
108 "crtsxoff", CRTSXOFF
, 0,
109 "-crtsxoff", 0, CRTSXOFF
,
110 "raw", CS8
, (CSIZE
|PARENB
),
111 "-raw", (CS7
|PARENB
), CSIZE
,
112 "cooked", (CS7
|PARENB
), CSIZE
,
113 "sane", (CS7
|PARENB
|CREAD
), (CSIZE
|PARODD
|CLOCAL
),
117 const struct mds ncmodes
[] = {
119 "-parext", 0, PAREXT
,
120 "markp", (PARENB
|PARODD
|CS7
|PAREXT
), CSIZE
,
121 "-markp", CS8
, (PARENB
|PARODD
|CSIZE
|PAREXT
),
122 "spacep", (PARENB
|CS7
|PAREXT
), PARODD
|CSIZE
,
123 "-spacep", CS8
, (PARENB
|CSIZE
|PAREXT
),
127 const struct mds imodes
[] = {
129 "-ignbrk", 0, IGNBRK
,
131 "-brkint", 0, BRKINT
,
133 "-ignpar", 0, IGNPAR
,
135 "-parmrk", 0, PARMRK
,
139 "-istrip", 0, ISTRIP
,
147 "-nl", 0, (ICRNL
|INLCR
|IGNCR
),
150 "-nl", ICRNL
, (INLCR
|IGNCR
),
166 "-raw", (BRKINT
|IGNPAR
|ISTRIP
|ICRNL
|IXON
), 0,
167 "cooked", (BRKINT
|IGNPAR
|ISTRIP
|ICRNL
|IXON
), 0,
168 "sane", (BRKINT
|IGNPAR
|ISTRIP
|ICRNL
|IXON
|IMAXBEL
),
169 (IGNBRK
|PARMRK
|INPCK
|INLCR
|IGNCR
|IUCLC
|IXOFF
|IXANY
),
174 const struct mds nimodes
[] = {
175 "imaxbel", IMAXBEL
, 0,
176 "-imaxbel", 0, IMAXBEL
,
180 const struct mds lmodes
[] = {
184 "-icanon", 0, ICANON
,
200 "-echonl", 0, ECHONL
,
202 "-noflsh", 0, NOFLSH
,
203 "raw", 0, (ISIG
|ICANON
|XCASE
),
204 "-raw", (ISIG
|ICANON
), 0,
205 "cooked", (ISIG
|ICANON
), 0,
206 "sane", (ISIG
|ICANON
|IEXTEN
|ECHO
|ECHOK
|ECHOE
|ECHOKE
|ECHOCTL
),
207 (XCASE
|ECHONL
|NOFLSH
|STFLUSH
|STWRAP
|STAPPL
),
208 "stflush", STFLUSH
, 0,
209 "-stflush", 0, STFLUSH
,
211 "-stwrap", 0, STWRAP
,
213 "-stappl", 0, STAPPL
,
217 const struct mds nlmodes
[] = {
219 "-tostop", 0, TOSTOP
,
220 "echoctl", ECHOCTL
, 0,
221 "-echoctl", 0, ECHOCTL
,
222 "echoprt", ECHOPRT
, 0,
223 "-echoprt", 0, ECHOPRT
,
225 "-echoke", 0, ECHOKE
,
226 "defecho", DEFECHO
, 0,
227 "-defecho", 0, DEFECHO
,
229 "-flusho", 0, FLUSHO
,
231 "-pendin", 0, PENDIN
,
233 "-iexten", 0, IEXTEN
,
237 const struct mds omodes
[] = {
248 "-nl", ONLCR
, (OCRNL
|ONLRET
),
255 "-onlret", 0, ONLRET
,
256 "fill", OFILL
, OFDEL
,
257 "-fill", 0, OFILL
|OFDEL
,
258 "nul-fill", OFILL
, OFDEL
,
259 "del-fill", OFILL
|OFDEL
, 0,
268 "tab0", TAB0
, TABDLY
,
269 "tabs", TAB0
, TABDLY
,
270 "tab1", TAB1
, TABDLY
,
271 "tab2", TAB2
, TABDLY
,
272 "tab3", TAB3
, TABDLY
,
273 "-tabs", TAB3
, TABDLY
,
274 "tab8", TAB3
, TABDLY
,
286 "tty33", CR1
, (CRDLY
|TABDLY
|NLDLY
|FFDLY
|VTDLY
|BSDLY
),
287 "tn300", CR1
, (CRDLY
|TABDLY
|NLDLY
|FFDLY
|VTDLY
|BSDLY
),
288 "ti700", CR2
, (CRDLY
|TABDLY
|NLDLY
|FFDLY
|VTDLY
|BSDLY
),
289 "vt05", NL1
, (CRDLY
|TABDLY
|NLDLY
|FFDLY
|VTDLY
|BSDLY
),
290 "tek", FF1
, (CRDLY
|TABDLY
|NLDLY
|FFDLY
|VTDLY
|BSDLY
),
291 "tty37", (FF1
|VT1
|CR2
|TAB1
|NL1
), (NLDLY
|CRDLY
|TABDLY
|BSDLY
|VTDLY
|FFDLY
),
292 "sane", (OPOST
|ONLCR
), (OLCUC
|OCRNL
|ONOCR
|ONLRET
|OFILL
|OFDEL
|
293 NLDLY
|CRDLY
|TABDLY
|BSDLY
|VTDLY
|FFDLY
),
297 const struct mds hmodes
[] = {
298 "-rtsxoff", 0, RTSXOFF
,
299 "rtsxoff", RTSXOFF
, 0,
300 "-ctsxon", 0, CTSXON
,
302 "-dtrxoff", 0, DTRXOFF
,
303 "dtrxoff", DTRXOFF
, 0,
306 "-isxoff", 0, ISXOFF
,
311 const struct mds clkmodes
[] = {
312 "xcibrg", XCIBRG
, XMTCLK
,
313 "xctset", XCTSET
, XMTCLK
,
314 "xcrset", XCRSET
, XMTCLK
,
315 "rcibrg", RCIBRG
, RCVCLK
,
316 "rctset", RCTSET
, RCVCLK
,
317 "rcrset", RCRSET
, RCVCLK
,
318 "tsetcoff", TSETCOFF
, TSETCLK
,
319 "tsetcrbrg", TSETCRBRG
, TSETCLK
,
320 "tsetctbrg", TSETCTBRG
, TSETCLK
,
321 "tsetctset", TSETCTSET
, TSETCLK
,
322 "tsetcrset", TSETCRSET
, TSETCLK
,
323 "rsetcoff", RSETCOFF
, RSETCLK
,
324 "rsetcrbrg", RSETCRBRG
, RSETCLK
,
325 "rsetctbrg", RSETCTBRG
, RSETCLK
,
326 "rsetctset", RSETCTSET
, RSETCLK
,
327 "rsetcrset", RSETCRSET
, RSETCLK
,
328 "async", XCIBRG
|RCIBRG
|TSETCOFF
|RSETCOFF
, XMTCLK
|RCVCLK
|TSETCLK
|RSETCLK
,
332 const char *not_supported
[] = {