Home | History | Annotate | Line # | Download | only in common
linux_termios.h revision 1.3
      1  1.3      erh /*	$NetBSD: linux_termios.h,v 1.3 1998/10/01 01:52:59 erh Exp $	*/
      2  1.1  mycroft 
      3  1.3      erh /*-
      4  1.3      erh  * Copyright (c) 1998 The NetBSD Foundation, Inc.
      5  1.3      erh  * All rights reserved.
      6  1.3      erh  *
      7  1.3      erh  * This code is derived from software contributed to The NetBSD Foundation
      8  1.3      erh  * by Eric Haszlakiewicz.
      9  1.3      erh  *
     10  1.3      erh  * Redistribution and use in source and binary forms, with or without
     11  1.3      erh  * modification, are permitted provided that the following conditions
     12  1.3      erh  * are met:
     13  1.3      erh  * 1. Redistributions of source code must retain the above copyright
     14  1.3      erh  *    notice, this list of conditions and the following disclaimer.
     15  1.3      erh  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.3      erh  *    notice, this list of conditions and the following disclaimer in the
     17  1.3      erh  *    documentation and/or other materials provided with the distribution.
     18  1.3      erh  * 3. All advertising materials mentioning features or use of this software
     19  1.3      erh  *    must display the following acknowledgement:
     20  1.3      erh  *	This product includes software developed by the NetBSD
     21  1.3      erh  *	Foundation, Inc. and its contributors.
     22  1.3      erh  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  1.3      erh  *    contributors may be used to endorse or promote products derived
     24  1.3      erh  *    from this software without specific prior written permission.
     25  1.3      erh  *
     26  1.3      erh  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  1.3      erh  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  1.3      erh  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  1.3      erh  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  1.3      erh  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  1.3      erh  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  1.3      erh  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  1.3      erh  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  1.3      erh  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  1.3      erh  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  1.3      erh  * POSSIBILITY OF SUCH DAMAGE.
     37  1.3      erh  */
     38  1.3      erh 
     39  1.3      erh #ifndef _COMMON_LINUX_TERMIOS_H
     40  1.3      erh #define _COMMON_LINUX_TERMIOS_H
     41  1.3      erh 
     42  1.3      erh struct linux_winsize {
     43  1.3      erh 	unsigned short ws_row;
     44  1.3      erh 	unsigned short ws_col;
     45  1.3      erh 	unsigned short ws_xpixel;
     46  1.3      erh 	unsigned short ws_ypixel;
     47  1.3      erh };
     48  1.1  mycroft 
     49  1.1  mycroft #define LINUX_NCC 8
     50  1.1  mycroft struct linux_termio {
     51  1.1  mycroft 	unsigned short c_iflag;
     52  1.1  mycroft 	unsigned short c_oflag;
     53  1.1  mycroft 	unsigned short c_cflag;
     54  1.1  mycroft 	unsigned short c_lflag;
     55  1.1  mycroft 	unsigned char c_line;
     56  1.1  mycroft 	unsigned char c_cc[LINUX_NCC];
     57  1.1  mycroft };
     58  1.1  mycroft 
     59  1.1  mycroft #define LINUX_NCCS 19
     60  1.1  mycroft struct linux_termios {
     61  1.3      erh 	linux_tcflag_t	c_iflag;
     62  1.3      erh 	linux_tcflag_t	c_oflag;
     63  1.3      erh 	linux_tcflag_t	c_cflag;
     64  1.3      erh 	linux_tcflag_t	c_lflag;
     65  1.3      erh 	linux_cc_t	c_line;
     66  1.3      erh 	linux_cc_t	c_cc[LINUX_NCCS];
     67  1.3      erh #if 0
     68  1.3      erh 	/* Present on some linux ports but unused: */
     69  1.3      erh 	linux_speed_t	c_ispeed;
     70  1.3      erh 	linux_speed_t	c_ospeed;
     71  1.3      erh #endif
     72  1.1  mycroft };
     73  1.1  mycroft 
     74  1.1  mycroft /* Linux modem line defines.. not sure if they'll be used */
     75  1.1  mycroft #define LINUX_TIOCM_LE		0x0001
     76  1.1  mycroft #define LINUX_TIOCM_DTR		0x0002
     77  1.1  mycroft #define LINUX_TIOCM_RTS		0x0004
     78  1.1  mycroft #define LINUX_TIOCM_ST		0x0008
     79  1.1  mycroft #define LINUX_TIOCM_SR		0x0010
     80  1.1  mycroft #define LINUX_TIOCM_CTS		0x0020
     81  1.1  mycroft #define LINUX_TIOCM_CAR		0x0040
     82  1.1  mycroft #define LINUX_TIOCM_RNG		0x0080
     83  1.1  mycroft #define LINUX_TIOCM_DSR		0x0100
     84  1.1  mycroft #define LINUX_TIOCM_CD		LINUX_TIOCM_CAR
     85  1.1  mycroft #define LINUX_TIOCM_RI 		LINUX_TIOCM_RNG
     86  1.1  mycroft 
     87  1.1  mycroft #define	LINUX_TCIFLUSH		0
     88  1.1  mycroft #define	LINUX_TCOFLUSH		1
     89  1.1  mycroft #define	LINUX_TCIOFLUSH		2
     90  1.1  mycroft 
     91  1.1  mycroft #define	LINUX_TCOOFF		0
     92  1.1  mycroft #define	LINUX_TCOON		1
     93  1.1  mycroft #define	LINUX_TCIOFF		2
     94  1.1  mycroft #define	LINUX_TCION		3
     95  1.1  mycroft 
     96  1.1  mycroft #define	LINUX_TCSANOW		0
     97  1.1  mycroft #define	LINUX_TCSADRAIN		1
     98  1.1  mycroft #define	LINUX_TCSAFLUSH		2
     99  1.1  mycroft 
    100  1.1  mycroft /* Linux line disciplines */
    101  1.1  mycroft #define LINUX_N_TTY		0
    102  1.1  mycroft #define LINUX_N_SLIP		1
    103  1.1  mycroft #define LINUX_N_MOUSE		2
    104  1.1  mycroft #define LINUX_N_PPP		3
    105  1.3      erh #define	LINUX_N_STRIP		4
    106  1.3      erh 
    107  1.3      erh /* currently unused: */
    108  1.3      erh #define	LINUX_N_AX25		5
    109  1.3      erh #define	LINUX_N_X25		6
    110  1.3      erh #define	LINUX_N_6PACK		7
    111  1.3      erh 
    112  1.3      erh #endif /* !_COMMON_LINUX_TERMIOS_H */
    113