xref: /illumos-gate/usr/src/cmd/ttymon/sttytable.c (revision d9c3e05c)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5de81e71eSTim Marsland  * Common Development and Distribution License (the "License").
6de81e71eSTim Marsland  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
21de81e71eSTim Marsland 
227c478bd9Sstevel@tonic-gate /*
23de81e71eSTim Marsland  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate /*
287c478bd9Sstevel@tonic-gate  * Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
297c478bd9Sstevel@tonic-gate  * All Rights Reserved
307c478bd9Sstevel@tonic-gate  *
317c478bd9Sstevel@tonic-gate  */
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #include <stdio.h>
347c478bd9Sstevel@tonic-gate #include <sys/types.h>
357c478bd9Sstevel@tonic-gate #include <termio.h>
367c478bd9Sstevel@tonic-gate #include <sys/stermio.h>
377c478bd9Sstevel@tonic-gate #include <sys/termiox.h>
387c478bd9Sstevel@tonic-gate #include "stty.h"
397c478bd9Sstevel@tonic-gate 
40*d9c3e05cSJoshua M. Clulow const struct speeds speeds[] = {
417c478bd9Sstevel@tonic-gate 	"0",		B0,		0,
427c478bd9Sstevel@tonic-gate 	"50",		B50,		50,
437c478bd9Sstevel@tonic-gate 	"75",		B75,		75,
447c478bd9Sstevel@tonic-gate 	"110",		B110,		110,
457c478bd9Sstevel@tonic-gate 	"134",		B134,		134,
467c478bd9Sstevel@tonic-gate 	"134.5", 	B134,		134,
477c478bd9Sstevel@tonic-gate 	"150",		B150,		150,
487c478bd9Sstevel@tonic-gate 	"200",		B200,		200,
497c478bd9Sstevel@tonic-gate 	"300",		B300,		300,
507c478bd9Sstevel@tonic-gate 	"600",		B600,		600,
517c478bd9Sstevel@tonic-gate 	"1200",		B1200,		1200,
527c478bd9Sstevel@tonic-gate 	"1800",		B1800,		1800,
537c478bd9Sstevel@tonic-gate 	"2400",		B2400,		2400,
547c478bd9Sstevel@tonic-gate 	"4800",		B4800,		4800,
557c478bd9Sstevel@tonic-gate 	"9600",		B9600,		9600,
567c478bd9Sstevel@tonic-gate 	"19200",	B19200,		19200,
577c478bd9Sstevel@tonic-gate 	"19.2",		B19200,		19200,
587c478bd9Sstevel@tonic-gate 	"38400",	B38400,		38400,
597c478bd9Sstevel@tonic-gate 	"38.4",		B38400,		38400,
607c478bd9Sstevel@tonic-gate 	"57600",	B57600,		57600,
617c478bd9Sstevel@tonic-gate 	"57.6",		B57600,		57600,
627c478bd9Sstevel@tonic-gate 	"76800",	B76800,		76800,
637c478bd9Sstevel@tonic-gate 	"76.8",		B76800,		76800,
647c478bd9Sstevel@tonic-gate 	"115200",	B115200,	115200,
657c478bd9Sstevel@tonic-gate 	"115.2",	B115200,	115200,
667c478bd9Sstevel@tonic-gate 	"153600",	B153600,	153600,
677c478bd9Sstevel@tonic-gate 	"153.6",	B153600,	153600,
687c478bd9Sstevel@tonic-gate 	"230400",	B230400,	230400,
697c478bd9Sstevel@tonic-gate 	"230.4",	B230400,	230400,
707c478bd9Sstevel@tonic-gate 	"307200",	B307200,	307200,
717c478bd9Sstevel@tonic-gate 	"307.2",	B307200,	307200,
727c478bd9Sstevel@tonic-gate 	"460800",	B460800,	460800,
737c478bd9Sstevel@tonic-gate 	"460.8",	B460800,	460800,
74de81e71eSTim Marsland 	"921600",	B921600,	921600,
75de81e71eSTim Marsland 	"921.6",	B921600,	921600,
76*d9c3e05cSJoshua M. Clulow 	"1000000",	B1000000,	1000000,
77*d9c3e05cSJoshua M. Clulow 	"1152000",	B1152000,	1152000,
78*d9c3e05cSJoshua M. Clulow 	"1500000",	B1500000,	1500000,
79*d9c3e05cSJoshua M. Clulow 	"2000000",	B2000000,	2000000,
80*d9c3e05cSJoshua M. Clulow 	"2500000",	B2500000,	2500000,
81*d9c3e05cSJoshua M. Clulow 	"3000000",	B3000000,	3000000,
82*d9c3e05cSJoshua M. Clulow 	"3500000",	B3500000,	3500000,
83*d9c3e05cSJoshua M. Clulow 	"4000000",	B4000000,	4000000,
847c478bd9Sstevel@tonic-gate 	0,
857c478bd9Sstevel@tonic-gate };
867c478bd9Sstevel@tonic-gate 
877c478bd9Sstevel@tonic-gate const struct mds cmodes[] = {
887c478bd9Sstevel@tonic-gate 	"-parity", CS8, PARENB|CSIZE,
897c478bd9Sstevel@tonic-gate 	"-evenp", CS8, PARENB|CSIZE,
907c478bd9Sstevel@tonic-gate 	"-oddp", CS8, PARENB|PARODD|CSIZE,
917c478bd9Sstevel@tonic-gate 	"parity", PARENB|CS7, PARODD|CSIZE,
927c478bd9Sstevel@tonic-gate 	"evenp", PARENB|CS7, PARODD|CSIZE,
937c478bd9Sstevel@tonic-gate 	"oddp", PARENB|PARODD|CS7, CSIZE,
947c478bd9Sstevel@tonic-gate 	"parenb", PARENB, 0,
957c478bd9Sstevel@tonic-gate 	"-parenb", 0, PARENB,
967c478bd9Sstevel@tonic-gate 	"parodd", PARODD, 0,
977c478bd9Sstevel@tonic-gate 	"-parodd", 0, PARODD,
987c478bd9Sstevel@tonic-gate 	"cs8", CS8, CSIZE,
997c478bd9Sstevel@tonic-gate 	"cs7", CS7, CSIZE,
1007c478bd9Sstevel@tonic-gate 	"cs6", CS6, CSIZE,
1017c478bd9Sstevel@tonic-gate 	"cs5", CS5, CSIZE,
1027c478bd9Sstevel@tonic-gate 	"cstopb", CSTOPB, 0,
1037c478bd9Sstevel@tonic-gate 	"-cstopb", 0, CSTOPB,
1047c478bd9Sstevel@tonic-gate 	"hupcl", HUPCL, 0,
1057c478bd9Sstevel@tonic-gate 	"hup", HUPCL, 0,
1067c478bd9Sstevel@tonic-gate 	"-hupcl", 0, HUPCL,
1077c478bd9Sstevel@tonic-gate 	"-hup", 0, HUPCL,
1087c478bd9Sstevel@tonic-gate 	"clocal", CLOCAL, 0,
1097c478bd9Sstevel@tonic-gate 	"-clocal", 0, CLOCAL,
1107c478bd9Sstevel@tonic-gate 	"loblk", LOBLK, 0,
1117c478bd9Sstevel@tonic-gate 	"-loblk", 0, LOBLK,
1127c478bd9Sstevel@tonic-gate 	"cread", CREAD, 0,
1137c478bd9Sstevel@tonic-gate 	"-cread", 0, CREAD,
1147c478bd9Sstevel@tonic-gate 	"crtscts", (long)CRTSCTS, 0,
1157c478bd9Sstevel@tonic-gate 	"-crtscts", 0, (long)CRTSCTS,
1167c478bd9Sstevel@tonic-gate 	"crtsxoff", CRTSXOFF, 0,
1177c478bd9Sstevel@tonic-gate 	"-crtsxoff", 0, CRTSXOFF,
1187c478bd9Sstevel@tonic-gate 	"raw", CS8, (CSIZE|PARENB),
1197c478bd9Sstevel@tonic-gate 	"-raw", (CS7|PARENB), CSIZE,
1207c478bd9Sstevel@tonic-gate 	"cooked", (CS7|PARENB), CSIZE,
1217c478bd9Sstevel@tonic-gate 	"sane", (CS7|PARENB|CREAD), (CSIZE|PARODD|CLOCAL),
1227c478bd9Sstevel@tonic-gate 	0
1237c478bd9Sstevel@tonic-gate };
1247c478bd9Sstevel@tonic-gate 
1257c478bd9Sstevel@tonic-gate const struct mds ncmodes[] = {
1267c478bd9Sstevel@tonic-gate 	"parext", PAREXT, 0,
1277c478bd9Sstevel@tonic-gate 	"-parext", 0, PAREXT,
1287c478bd9Sstevel@tonic-gate 	"markp", (PARENB|PARODD|CS7|PAREXT), CSIZE,
1297c478bd9Sstevel@tonic-gate 	"-markp", CS8, (PARENB|PARODD|CSIZE|PAREXT),
1307c478bd9Sstevel@tonic-gate 	"spacep", (PARENB|CS7|PAREXT), PARODD|CSIZE,
1317c478bd9Sstevel@tonic-gate 	"-spacep", CS8, (PARENB|CSIZE|PAREXT),
1327c478bd9Sstevel@tonic-gate 	0
1337c478bd9Sstevel@tonic-gate };
1347c478bd9Sstevel@tonic-gate 
1357c478bd9Sstevel@tonic-gate const struct mds imodes[] = {
1367c478bd9Sstevel@tonic-gate 	"ignbrk", IGNBRK, 0,
1377c478bd9Sstevel@tonic-gate 	"-ignbrk", 0, IGNBRK,
1387c478bd9Sstevel@tonic-gate 	"brkint", BRKINT, 0,
1397c478bd9Sstevel@tonic-gate 	"-brkint", 0, BRKINT,
1407c478bd9Sstevel@tonic-gate 	"ignpar", IGNPAR, 0,
1417c478bd9Sstevel@tonic-gate 	"-ignpar", 0, IGNPAR,
1427c478bd9Sstevel@tonic-gate 	"parmrk", PARMRK, 0,
1437c478bd9Sstevel@tonic-gate 	"-parmrk", 0, PARMRK,
1447c478bd9Sstevel@tonic-gate 	"inpck", INPCK, 0,
1457c478bd9Sstevel@tonic-gate 	"-inpck", 0, INPCK,
1467c478bd9Sstevel@tonic-gate 	"istrip", ISTRIP, 0,
1477c478bd9Sstevel@tonic-gate 	"-istrip", 0, ISTRIP,
1487c478bd9Sstevel@tonic-gate 	"inlcr", INLCR, 0,
1497c478bd9Sstevel@tonic-gate 	"-inlcr", 0, INLCR,
1507c478bd9Sstevel@tonic-gate 	"igncr", IGNCR, 0,
1517c478bd9Sstevel@tonic-gate 	"-igncr", 0, IGNCR,
1527c478bd9Sstevel@tonic-gate 	"icrnl", ICRNL, 0,
1537c478bd9Sstevel@tonic-gate 	"-icrnl", 0, ICRNL,
1547c478bd9Sstevel@tonic-gate #ifdef XPG4
1557c478bd9Sstevel@tonic-gate 	"-nl", 0, (ICRNL|INLCR|IGNCR),
1567c478bd9Sstevel@tonic-gate 	"nl", ICRNL, 0,
1577c478bd9Sstevel@tonic-gate #else
1587c478bd9Sstevel@tonic-gate 	"-nl", ICRNL, (INLCR|IGNCR),
1597c478bd9Sstevel@tonic-gate 	"nl", 0, ICRNL,
1607c478bd9Sstevel@tonic-gate #endif
1617c478bd9Sstevel@tonic-gate 	"iuclc", IUCLC, 0,
1627c478bd9Sstevel@tonic-gate 	"-iuclc", 0, IUCLC,
1637c478bd9Sstevel@tonic-gate 	"lcase", IUCLC, 0,
1647c478bd9Sstevel@tonic-gate 	"-lcase", 0, IUCLC,
1657c478bd9Sstevel@tonic-gate 	"LCASE", IUCLC, 0,
1667c478bd9Sstevel@tonic-gate 	"-LCASE", 0, IUCLC,
1677c478bd9Sstevel@tonic-gate 	"ixon", IXON, 0,
1687c478bd9Sstevel@tonic-gate 	"-ixon", 0, IXON,
1697c478bd9Sstevel@tonic-gate 	"ixany", IXANY, 0,
1707c478bd9Sstevel@tonic-gate 	"-ixany", 0, IXANY,
1717c478bd9Sstevel@tonic-gate 	"ixoff", IXOFF, 0,
1727c478bd9Sstevel@tonic-gate 	"-ixoff", 0, IXOFF,
1737c478bd9Sstevel@tonic-gate 	"raw", 0, -1,
1747c478bd9Sstevel@tonic-gate 	"-raw", (BRKINT|IGNPAR|ISTRIP|ICRNL|IXON), 0,
1757c478bd9Sstevel@tonic-gate 	"cooked", (BRKINT|IGNPAR|ISTRIP|ICRNL|IXON), 0,
1767c478bd9Sstevel@tonic-gate 	"sane", (BRKINT|IGNPAR|ISTRIP|ICRNL|IXON|IMAXBEL),
1777c478bd9Sstevel@tonic-gate 		(IGNBRK|PARMRK|INPCK|INLCR|IGNCR|IUCLC|IXOFF|IXANY),
1787c478bd9Sstevel@tonic-gate 	0
1797c478bd9Sstevel@tonic-gate };
1807c478bd9Sstevel@tonic-gate 
1817c478bd9Sstevel@tonic-gate 
1827c478bd9Sstevel@tonic-gate const struct mds nimodes[] = {
1837c478bd9Sstevel@tonic-gate 	"imaxbel", IMAXBEL, 0,
1847c478bd9Sstevel@tonic-gate 	"-imaxbel", 0, IMAXBEL,
1857c478bd9Sstevel@tonic-gate 	0
1867c478bd9Sstevel@tonic-gate };
1877c478bd9Sstevel@tonic-gate 
1887c478bd9Sstevel@tonic-gate const struct mds lmodes[] = {
1897c478bd9Sstevel@tonic-gate 	"isig", ISIG, 0,
1907c478bd9Sstevel@tonic-gate 	"-isig", 0, ISIG,
1917c478bd9Sstevel@tonic-gate 	"icanon", ICANON, 0,
1927c478bd9Sstevel@tonic-gate 	"-icanon", 0, ICANON,
1937c478bd9Sstevel@tonic-gate 	"xcase", XCASE, 0,
1947c478bd9Sstevel@tonic-gate 	"-xcase", 0, XCASE,
1957c478bd9Sstevel@tonic-gate 	"lcase", XCASE, 0,
1967c478bd9Sstevel@tonic-gate 	"-lcase", 0, XCASE,
1977c478bd9Sstevel@tonic-gate 	"LCASE", XCASE, 0,
1987c478bd9Sstevel@tonic-gate 	"-LCASE", 0, XCASE,
1997c478bd9Sstevel@tonic-gate 	"echo", ECHO, 0,
2007c478bd9Sstevel@tonic-gate 	"-echo", 0, ECHO,
2017c478bd9Sstevel@tonic-gate 	"echoe", ECHOE, 0,
2027c478bd9Sstevel@tonic-gate 	"-echoe", 0, ECHOE,
2037c478bd9Sstevel@tonic-gate 	"echok", ECHOK, 0,
2047c478bd9Sstevel@tonic-gate 	"-echok", 0, ECHOK,
2057c478bd9Sstevel@tonic-gate 	"lfkc", ECHOK, 0,
2067c478bd9Sstevel@tonic-gate 	"-lfkc", 0, ECHOK,
2077c478bd9Sstevel@tonic-gate 	"echonl", ECHONL, 0,
2087c478bd9Sstevel@tonic-gate 	"-echonl", 0, ECHONL,
2097c478bd9Sstevel@tonic-gate 	"noflsh", NOFLSH, 0,
2107c478bd9Sstevel@tonic-gate 	"-noflsh", 0, NOFLSH,
2117c478bd9Sstevel@tonic-gate 	"raw", 0, (ISIG|ICANON|XCASE),
2127c478bd9Sstevel@tonic-gate 	"-raw", (ISIG|ICANON), 0,
2137c478bd9Sstevel@tonic-gate 	"cooked", (ISIG|ICANON), 0,
2147c478bd9Sstevel@tonic-gate 	"sane", (ISIG|ICANON|IEXTEN|ECHO|ECHOK|ECHOE|ECHOKE|ECHOCTL),
2157c478bd9Sstevel@tonic-gate 		(XCASE|ECHONL|NOFLSH|STFLUSH|STWRAP|STAPPL),
2167c478bd9Sstevel@tonic-gate 	"stflush", STFLUSH, 0,
2177c478bd9Sstevel@tonic-gate 	"-stflush", 0, STFLUSH,
2187c478bd9Sstevel@tonic-gate 	"stwrap", STWRAP, 0,
2197c478bd9Sstevel@tonic-gate 	"-stwrap", 0, STWRAP,
2207c478bd9Sstevel@tonic-gate 	"stappl", STAPPL, 0,
2217c478bd9Sstevel@tonic-gate 	"-stappl", 0, STAPPL,
2227c478bd9Sstevel@tonic-gate 	0,
2237c478bd9Sstevel@tonic-gate };
2247c478bd9Sstevel@tonic-gate 
2257c478bd9Sstevel@tonic-gate const struct mds nlmodes[] = {
2267c478bd9Sstevel@tonic-gate 	"tostop", TOSTOP, 0,
2277c478bd9Sstevel@tonic-gate 	"-tostop", 0, TOSTOP,
2287c478bd9Sstevel@tonic-gate 	"echoctl", ECHOCTL, 0,
2297c478bd9Sstevel@tonic-gate 	"-echoctl", 0, ECHOCTL,
2307c478bd9Sstevel@tonic-gate 	"echoprt", ECHOPRT, 0,
2317c478bd9Sstevel@tonic-gate 	"-echoprt", 0, ECHOPRT,
2327c478bd9Sstevel@tonic-gate 	"echoke", ECHOKE, 0,
2337c478bd9Sstevel@tonic-gate 	"-echoke", 0, ECHOKE,
2347c478bd9Sstevel@tonic-gate 	"defecho", DEFECHO, 0,
2357c478bd9Sstevel@tonic-gate 	"-defecho", 0, DEFECHO,
2367c478bd9Sstevel@tonic-gate 	"flusho", FLUSHO, 0,
2377c478bd9Sstevel@tonic-gate 	"-flusho", 0, FLUSHO,
2387c478bd9Sstevel@tonic-gate 	"pendin", PENDIN, 0,
2397c478bd9Sstevel@tonic-gate 	"-pendin", 0, PENDIN,
2407c478bd9Sstevel@tonic-gate 	"iexten", IEXTEN, 0,
2417c478bd9Sstevel@tonic-gate 	"-iexten", 0, IEXTEN,
2427c478bd9Sstevel@tonic-gate 	0
2437c478bd9Sstevel@tonic-gate };
2447c478bd9Sstevel@tonic-gate 
2457c478bd9Sstevel@tonic-gate const struct mds omodes[] = {
2467c478bd9Sstevel@tonic-gate 	"opost", OPOST, 0,
2477c478bd9Sstevel@tonic-gate 	"-opost", 0, OPOST,
2487c478bd9Sstevel@tonic-gate 	"olcuc", OLCUC, 0,
2497c478bd9Sstevel@tonic-gate 	"-olcuc", 0, OLCUC,
2507c478bd9Sstevel@tonic-gate 	"lcase", OLCUC, 0,
2517c478bd9Sstevel@tonic-gate 	"-lcase", 0, OLCUC,
2527c478bd9Sstevel@tonic-gate 	"LCASE", OLCUC, 0,
2537c478bd9Sstevel@tonic-gate 	"-LCASE", 0, OLCUC,
2547c478bd9Sstevel@tonic-gate 	"onlcr", ONLCR, 0,
2557c478bd9Sstevel@tonic-gate 	"-onlcr", 0, ONLCR,
2567c478bd9Sstevel@tonic-gate 	"-nl", ONLCR, (OCRNL|ONLRET),
2577c478bd9Sstevel@tonic-gate 	"nl", 0, ONLCR,
2587c478bd9Sstevel@tonic-gate 	"ocrnl", OCRNL, 0,
2597c478bd9Sstevel@tonic-gate 	"-ocrnl", 0, OCRNL,
2607c478bd9Sstevel@tonic-gate 	"onocr", ONOCR, 0,
2617c478bd9Sstevel@tonic-gate 	"-onocr", 0, ONOCR,
2627c478bd9Sstevel@tonic-gate 	"onlret", ONLRET, 0,
2637c478bd9Sstevel@tonic-gate 	"-onlret", 0, ONLRET,
2647c478bd9Sstevel@tonic-gate 	"fill", OFILL, OFDEL,
2657c478bd9Sstevel@tonic-gate 	"-fill", 0, OFILL|OFDEL,
2667c478bd9Sstevel@tonic-gate 	"nul-fill", OFILL, OFDEL,
2677c478bd9Sstevel@tonic-gate 	"del-fill", OFILL|OFDEL, 0,
2687c478bd9Sstevel@tonic-gate 	"ofill", OFILL, 0,
2697c478bd9Sstevel@tonic-gate 	"-ofill", 0, OFILL,
2707c478bd9Sstevel@tonic-gate 	"ofdel", OFDEL, 0,
2717c478bd9Sstevel@tonic-gate 	"-ofdel", 0, OFDEL,
2727c478bd9Sstevel@tonic-gate 	"cr0", CR0, CRDLY,
2737c478bd9Sstevel@tonic-gate 	"cr1", CR1, CRDLY,
2747c478bd9Sstevel@tonic-gate 	"cr2", CR2, CRDLY,
2757c478bd9Sstevel@tonic-gate 	"cr3", CR3, CRDLY,
2767c478bd9Sstevel@tonic-gate 	"tab0", TAB0, TABDLY,
2777c478bd9Sstevel@tonic-gate 	"tabs", TAB0, TABDLY,
2787c478bd9Sstevel@tonic-gate 	"tab1", TAB1, TABDLY,
2797c478bd9Sstevel@tonic-gate 	"tab2", TAB2, TABDLY,
2807c478bd9Sstevel@tonic-gate 	"tab3", TAB3, TABDLY,
2817c478bd9Sstevel@tonic-gate 	"-tabs", TAB3, TABDLY,
2827c478bd9Sstevel@tonic-gate 	"tab8", TAB3, TABDLY,
2837c478bd9Sstevel@tonic-gate 	"nl0", NL0, NLDLY,
2847c478bd9Sstevel@tonic-gate 	"nl1", NL1, NLDLY,
2857c478bd9Sstevel@tonic-gate 	"ff0", FF0, FFDLY,
2867c478bd9Sstevel@tonic-gate 	"ff1", FF1, FFDLY,
2877c478bd9Sstevel@tonic-gate 	"vt0", VT0, VTDLY,
2887c478bd9Sstevel@tonic-gate 	"vt1", VT1, VTDLY,
2897c478bd9Sstevel@tonic-gate 	"bs0", BS0, BSDLY,
2907c478bd9Sstevel@tonic-gate 	"bs1", BS1, BSDLY,
2917c478bd9Sstevel@tonic-gate 	"raw", 0, OPOST,
2927c478bd9Sstevel@tonic-gate 	"-raw", OPOST, 0,
2937c478bd9Sstevel@tonic-gate 	"cooked", OPOST, 0,
2947c478bd9Sstevel@tonic-gate 	"tty33", CR1, (CRDLY|TABDLY|NLDLY|FFDLY|VTDLY|BSDLY),
2957c478bd9Sstevel@tonic-gate 	"tn300", CR1, (CRDLY|TABDLY|NLDLY|FFDLY|VTDLY|BSDLY),
2967c478bd9Sstevel@tonic-gate 	"ti700", CR2, (CRDLY|TABDLY|NLDLY|FFDLY|VTDLY|BSDLY),
2977c478bd9Sstevel@tonic-gate 	"vt05", NL1, (CRDLY|TABDLY|NLDLY|FFDLY|VTDLY|BSDLY),
2987c478bd9Sstevel@tonic-gate 	"tek", FF1, (CRDLY|TABDLY|NLDLY|FFDLY|VTDLY|BSDLY),
2997c478bd9Sstevel@tonic-gate 	"tty37", (FF1|VT1|CR2|TAB1|NL1), (NLDLY|CRDLY|TABDLY|BSDLY|VTDLY|FFDLY),
3007c478bd9Sstevel@tonic-gate 	"sane", (OPOST|ONLCR), (OLCUC|OCRNL|ONOCR|ONLRET|OFILL|OFDEL|
3017c478bd9Sstevel@tonic-gate 			NLDLY|CRDLY|TABDLY|BSDLY|VTDLY|FFDLY),
3027c478bd9Sstevel@tonic-gate 	0,
3037c478bd9Sstevel@tonic-gate };
3047c478bd9Sstevel@tonic-gate 
3057c478bd9Sstevel@tonic-gate const struct mds hmodes[] = {
3067c478bd9Sstevel@tonic-gate 	"-rtsxoff", 0, RTSXOFF,
3077c478bd9Sstevel@tonic-gate 	"rtsxoff", RTSXOFF, 0,
3087c478bd9Sstevel@tonic-gate 	"-ctsxon", 0, CTSXON,
3097c478bd9Sstevel@tonic-gate 	"ctsxon", CTSXON, 0,
3107c478bd9Sstevel@tonic-gate 	"-dtrxoff", 0, DTRXOFF,
3117c478bd9Sstevel@tonic-gate 	"dtrxoff", DTRXOFF, 0,
3127c478bd9Sstevel@tonic-gate 	"-cdxon", 0, CDXON,
3137c478bd9Sstevel@tonic-gate 	"cdxon", CDXON, 0,
3147c478bd9Sstevel@tonic-gate 	"-isxoff", 0, ISXOFF,
3157c478bd9Sstevel@tonic-gate 	"isxoff", ISXOFF, 0,
3167c478bd9Sstevel@tonic-gate 	0,
3177c478bd9Sstevel@tonic-gate };
3187c478bd9Sstevel@tonic-gate 
3197c478bd9Sstevel@tonic-gate const struct mds clkmodes[] = {
3207c478bd9Sstevel@tonic-gate 	"xcibrg", XCIBRG, XMTCLK,
3217c478bd9Sstevel@tonic-gate 	"xctset", XCTSET, XMTCLK,
3227c478bd9Sstevel@tonic-gate 	"xcrset", XCRSET, XMTCLK,
3237c478bd9Sstevel@tonic-gate 	"rcibrg", RCIBRG, RCVCLK,
3247c478bd9Sstevel@tonic-gate 	"rctset", RCTSET, RCVCLK,
3257c478bd9Sstevel@tonic-gate 	"rcrset", RCRSET, RCVCLK,
3267c478bd9Sstevel@tonic-gate 	"tsetcoff", TSETCOFF, TSETCLK,
3277c478bd9Sstevel@tonic-gate 	"tsetcrbrg", TSETCRBRG, TSETCLK,
3287c478bd9Sstevel@tonic-gate 	"tsetctbrg", TSETCTBRG, TSETCLK,
3297c478bd9Sstevel@tonic-gate 	"tsetctset", TSETCTSET, TSETCLK,
3307c478bd9Sstevel@tonic-gate 	"tsetcrset", TSETCRSET, TSETCLK,
3317c478bd9Sstevel@tonic-gate 	"rsetcoff", RSETCOFF, RSETCLK,
3327c478bd9Sstevel@tonic-gate 	"rsetcrbrg", RSETCRBRG, RSETCLK,
3337c478bd9Sstevel@tonic-gate 	"rsetctbrg", RSETCTBRG, RSETCLK,
3347c478bd9Sstevel@tonic-gate 	"rsetctset", RSETCTSET, RSETCLK,
3357c478bd9Sstevel@tonic-gate 	"rsetcrset", RSETCRSET, RSETCLK,
3367c478bd9Sstevel@tonic-gate 	"async", XCIBRG|RCIBRG|TSETCOFF|RSETCOFF, XMTCLK|RCVCLK|TSETCLK|RSETCLK,
3377c478bd9Sstevel@tonic-gate 	0,
3387c478bd9Sstevel@tonic-gate };
3397c478bd9Sstevel@tonic-gate 
3407c478bd9Sstevel@tonic-gate const char *not_supported[] =  {
3417c478bd9Sstevel@tonic-gate 	"rtsxoff",
3427c478bd9Sstevel@tonic-gate 	"ctsxon",
3437c478bd9Sstevel@tonic-gate 	"dtrxoff",
3447c478bd9Sstevel@tonic-gate 	"cdxon",
3457c478bd9Sstevel@tonic-gate 	"isxoff",
3467c478bd9Sstevel@tonic-gate 	"xcibrg",
3477c478bd9Sstevel@tonic-gate 	"xctset",
3487c478bd9Sstevel@tonic-gate 	"scrset",
3497c478bd9Sstevel@tonic-gate 	"rcibrg",
3507c478bd9Sstevel@tonic-gate 	"rctset",
3517c478bd9Sstevel@tonic-gate 	"rcrset",
3527c478bd9Sstevel@tonic-gate 	"tsetcoff",
3537c478bd9Sstevel@tonic-gate 	"tsetcrbrg",
3547c478bd9Sstevel@tonic-gate 	"rsetcbrg",
3557c478bd9Sstevel@tonic-gate 	"rsetctbrg",
3567c478bd9Sstevel@tonic-gate 	"rsetctset",
3577c478bd9Sstevel@tonic-gate 	"rsetcrset",
3587c478bd9Sstevel@tonic-gate 	0,
3597c478bd9Sstevel@tonic-gate };
360