Home | History | Annotate | Line # | Download | only in mips
linux_termios.h revision 1.2
      1 /*	$NetBSD: linux_termios.h,v 1.2 2001/09/02 07:56:11 manu Exp $ */
      2 
      3 /*-
      4  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
      5  * All rights reserved.
      6  *
      7  * This code is derived from software contributed to The NetBSD Foundation
      8  * by Eric Haszlakiewicz and Emmanuel Dreyfus.
      9  *
     10  * Redistribution and use in source and binary forms, with or without
     11  * modification, are permitted provided that the following conditions
     12  * are met:
     13  * 1. Redistributions of source code must retain the above copyright
     14  *    notice, this list of conditions and the following disclaimer.
     15  * 2. Redistributions in binary form must reproduce the above copyright
     16  *    notice, this list of conditions and the following disclaimer in the
     17  *    documentation and/or other materials provided with the distribution.
     18  * 3. All advertising materials mentioning features or use of this software
     19  *    must display the following acknowledgement:
     20  *	This product includes software developed by the NetBSD
     21  *	Foundation, Inc. and its contributors.
     22  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  *    contributors may be used to endorse or promote products derived
     24  *    from this software without specific prior written permission.
     25  *
     26  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  * POSSIBILITY OF SUCH DAMAGE.
     37  */
     38 
     39 #ifndef _MIPS_LINUX_TERMIOS_H
     40 #define _MIPS_LINUX_TERMIOS_H
     41 
     42 /*
     43  * From Linux's include/asm-mips/termios.h
     44  */
     45 #define LINUX_NCC 8
     46 /*
     47  * From Linux's include/asm-mips/termbits.h
     48  */
     49 #define LINUX_NCCS 23
     50 
     51 /*
     52  * From Linux's include/asm-mips/ioctls.h
     53  */
     54 #define LINUX_tIOC		('t' << 8)
     55 
     56 #define LINUX_TCGETS		0x540d
     57 #define LINUX_TCSETS		0x540e
     58 #define LINUX_TCSETSW		0x540f
     59 #define LINUX_TCSETSF		0x5410
     60 #define LINUX_TCGETA		0x5401
     61 #define LINUX_TCSETA		0x5402
     62 #define LINUX_TCSETAW		0x5403
     63 #define LINUX_TCSETAF		0x5404
     64 #define LINUX_TCSBRK		0x5405
     65 #define LINUX_TCXONC		0x5406
     66 #define LINUX_TCFLSH		0x5407
     67 #define LINUX_TIOCEXCL		0x740d
     68 #define LINUX_TIOCNXCL		0x740e
     69 #define LINUX_TIOCSCTTY		0x5480
     70 #define LINUX_TIOCSPGRP		_LINUX_IOW('t', 118, int)
     71 #define LINUX_TIOCGPGRP		_LINUX_IOR('t', 119, int)
     72 #define LINUX_TIOCOUTQ		0x7472
     73 #define LINUX_TIOCSTI		0x5472
     74 #define LINUX_TIOCSWINSZ 	_LINUX_IOW('t', 103, struct linux_winsize)
     75 #define LINUX_TIOCGWINSZ 	_LINUX_IOR('t', 104, struct linux_winsize)
     76 #define LINUX_TIOCMGET		0x741d
     77 #define LINUX_TIOCMBIS		0x741b
     78 #define LINUX_TIOCMBIC		0x741c
     79 #define LINUX_TIOCMSET		0x741a
     80 #define LINUX_TIOCGSOFTCAR	0x5481
     81 #define LINUX_TIOCSSOFTCAR	0x5482
     82 #define LINUX_FIONREAD		0x467f
     83 #define LINUX_TIOCINQ		LINUX_FIONREAD
     84 #define LINUX_TIOCLINUX		0x5483
     85 #define LINUX_TIOCCONS		_IOW('t', 120, int)
     86 #define LINUX_TIOCGSERIAL	0x5484
     87 #define LINUX_TIOCSSERIAL	0x5485
     88 #define LINUX_TIOCPKT		0x5470
     89 #define LINUX_FIONBIO		0x667e
     90 #define LINUX_TIOCNOTTY		0x5471
     91 #define LINUX_TIOCSETD		(LINUX_tIOC | 1)
     92 #define LINUX_TIOCGETD		(LINUX_tIOC | 0)
     93 #define LINUX_TCSBRKP		0x5425
     94 #define LINUX_TIOCTTYGSTRUCT	0x5426
     95 
     96 #define LINUX_FIONCLEX		0x6602 /* Linux sources: "need to be adjusted" */
     97 #define LINUX_FIOCLEX		0x6601
     98 #define LINUX_FIOASYNC		0x667d
     99 #define LINUX_TIOCSERCONFIG	0x5488
    100 #define LINUX_TIOCSERGWILD	0x5489
    101 #define LINUX_TIOCSERSWILD	0x548a
    102 #define LINUX_TIOCGLCKTRMIOS	0x548b
    103 #define LINUX_TIOCSLCKTRMIOS	0x548c
    104 #define LINUX_TIOCSERGSTRUCT	0x548d
    105 #define LINUX_TIOCSERGETLSR	0x548e
    106 #define LINUX_TIOCSERGETMULTI	0x548f
    107 #define LINUX_TIOCSERSETMULTI	0x5490
    108 
    109 /*
    110  * linux_termios c_cc chars:
    111  * From Linux's include/asm-mips/termbits.h
    112  */
    113 #define LINUX_VINTR 	0
    114 #define LINUX_VQUIT 	1
    115 #define LINUX_VERASE	2
    116 #define LINUX_VKILL 	3
    117 #define LINUX_VMIN 	4
    118 #define LINUX_VTIME 	5
    119 #define LINUX_VEOL2 	6
    120 #define LINUX_VSWTC 	7
    121 #define LINUX_VSWTCH	LINUX_VSWTC
    122 #define LINUX_VSTART	8
    123 #define LINUX_VSTOP 	9
    124 #define LINUX_VSUSP	10
    125 /* #define LINUX_VDSUSP	11 is not defined in Linux */
    126 #define LINUX_VREPRINT	12
    127 #define LINUX_VDISCARD	13
    128 #define LINUX_VWERASE	14
    129 #define LINUX_VLNEXT	15
    130 #define LINUX_VEOF	16
    131 #define LINUX_VEOL	17
    132 
    133 /*
    134  * Old style linux_termio
    135  * XXX Not found anywhere in Linux
    136  */
    137 #define	LINUX_OLD_VINTR		LINUX_VINTR
    138 #define	LINUX_OLD_VQUIT		LINUX_VQUIT
    139 #define	LINUX_OLD_VERASE	LINUX_VERASE
    140 #define	LINUX_OLD_VKILL		LINUX_VKILL
    141 #define	LINUX_OLD_VEOF		LINUX_VEOF
    142 #define	LINUX_OLD_VMIN		LINUX_VMIN
    143 #define	LINUX_OLD_VEOL		LINUX_VEOL
    144 #define	LINUX_OLD_VTIME		LINUX_VTIME
    145 #define	LINUX_OLD_VEOL2		LINUX_VEOL2
    146 #define	LINUX_OLD_VSWTC		LINUX_VSWTC
    147 
    148 /*
    149  * All the remaining stuff is from  Linux's include/asm-mips/termbits.h
    150  * Note that most of theses values are octal (one leading 0), not hex...
    151  * Linux c_iflag masks
    152  */
    153 #define LINUX_IGNBRK	0000001
    154 #define LINUX_BRKINT	0000002
    155 #define LINUX_IGNPAR	0000004
    156 #define LINUX_PARMRK	0000010
    157 #define LINUX_INPCK	0000020
    158 #define LINUX_ISTRIP	0000040
    159 #define LINUX_INLCR	0000100
    160 #define LINUX_IGNCR	0000200
    161 #define LINUX_ICRNL	0000400
    162 #define LINUX_IXON	0002000
    163 #define LINUX_IXOFF	0010000
    164 #define LINUX_IXANY	0004000
    165 #define LINUX_IUCLC	0001000
    166 #define LINUX_IMAXBEL	0020000
    167 
    168 /*
    169  * Linux c_oflag masks
    170  */
    171 #define LINUX_OPOST	0020000
    172 #define LINUX_ONLCR	0000004
    173 #define LINUX_OLCUC	0000002
    174 #define LINUX_OCRNL	0000010
    175 #define LINUX_ONOCR	0000020
    176 #define LINUX_ONLRET	0000040
    177 #define LINUX_OFILL	0000040
    178 #define LINUX_OFDEL	0000200
    179 #define LINUX_NLDLY	0000400
    180 #define LINUX_NL0	0000000
    181 #define LINUX_NL1	0000400
    182 #define LINUX_TABDLY	0014000
    183 #define LINUX_TAB0	0000000
    184 #define LINUX_TAB1	0004000
    185 #define LINUX_TAB2	0010000
    186 #define LINUX_TAB3	0014000
    187 #define LINUX_CRDLY	0003000
    188 #define LINUX_CR0	0000000
    189 #define LINUX_CR1	0001000
    190 #define LINUX_CR2	0002000
    191 #define LINUX_CR3	0003000
    192 #define LINUX_FFDLY	0100000
    193 #define LINUX_FF0	0000000
    194 #define LINUX_FF1	0100000
    195 #define LINUX_BSDLY	0020000
    196 #define LINUX_BS0	0000000
    197 #define LINUX_BS1	0020000
    198 #define LINUX_VTDLY	0040000
    199 #define LINUX_VT0	0000000
    200 #define LINUX_VT1	0040000
    201 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
    202 #define LINUX_XTABS  0014000
    203 
    204 /*
    205  * Linux c_cflag bit masks
    206  * XXX not found in Linux, but it is needed to build
    207  */
    208 #define LINUX_NSPEEDS   16
    209 
    210 #define LINUX_CBAUD	0010017
    211 #define LINUX_B0	0000000     /* hang up */
    212 #define LINUX_B50  	0000001
    213 #define LINUX_B75   	0000002
    214 #define LINUX_B110  	0000003
    215 #define LINUX_B134  	0000004
    216 #define LINUX_B150  	0000005
    217 #define LINUX_B200  	0000006
    218 #define LINUX_B300  	0000007
    219 #define LINUX_B600  	0000010
    220 #define LINUX_B1200 	0000011
    221 #define LINUX_B1800 	0000012
    222 #define LINUX_B2400 	0000013
    223 #define LINUX_B4800 	0000014
    224 #define LINUX_B9600 	0000015
    225 #define LINUX_B19200	0000016
    226 #define LINUX_B38400	0000017
    227 #define LINUX_EXTA 	LINUX_B19200
    228 #define LINUX_EXTB 	LINUX_B38400
    229 #define LINUX_CBAUDEX	0010000
    230 #define LINUX_B57600 	0010001
    231 #define LINUX_B115200	0010002
    232 #define LINUX_B230400	0010003
    233 #define LINUX_B460800	0010004
    234 #define LINUX_B500000	0010005
    235 #define LINUX_B576000	0010006
    236 #define LINUX_B921600	0010007
    237 #define LINUX_B1000000	0010010
    238 #define LINUX_B1152000	0010011
    239 #define LINUX_B1500000	0010011
    240 #define LINUX_B2000000	0010013
    241 #define LINUX_B2500000	0010014
    242 #define LINUX_B3000000	0010015
    243 #define LINUX_B3500000	0010016
    244 #define LINUX_B4000000	0010017
    245 
    246 #define LINUX_CSIZE	0000060
    247 #define LINUX_CS5	0000000
    248 #define LINUX_CS6	0000020
    249 #define LINUX_CS7 	0000040
    250 #define LINUX_CS8	0000060
    251 
    252 #define LINUX_CSTOPB 	0000100
    253 #define LINUX_CREAD  	0000200
    254 #define LINUX_PARENB 	0000400
    255 #define LINUX_PARODD 	0001000
    256 #define LINUX_HUPCL  	0002000
    257 
    258 #define LINUX_CLOCAL 	0004000
    259 #define LINUX_CRTSCTS	020000000000    /* flow control */
    260 
    261 /*
    262  * Linux c_lflag masks
    263  */
    264 #define LINUX_ISIG   	0000001
    265 #define LINUX_ICANON 	0000002
    266 #define LINUX_XCASE  	0000004
    267 #define LINUX_ECHO   	0000010
    268 #define LINUX_ECHOE  	0000020
    269 #define LINUX_ECHOK  	0000040
    270 #define LINUX_ECHONL 	0000100
    271 #define LINUX_NOFLSH 	0000200
    272 #define LINUX_TOSTOP 	0100000
    273 #define LINUX_ECHOCTL	0001000
    274 #define LINUX_ECHOPRT	0002000
    275 #define LINUX_ECHOKE 	0004000
    276 #define LINUX_FLUSHO 	0020000
    277 #define LINUX_PENDIN 	0040000
    278 #define LINUX_IEXTEN 	0000400
    279 
    280 #endif /* !_MIPS_LINUX_TERMIOS_H */
    281