Home | History | Annotate | Line # | Download | only in common
linux_termios.h revision 1.14
      1 /*	$NetBSD: linux_termios.h,v 1.14 2005/12/11 12:20:19 christos Exp $	*/
      2 
      3 /*-
      4  * Copyright (c) 1998 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.
      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 _LINUX_TERMIOS_H
     40 #define _LINUX_TERMIOS_H
     41 
     42 #if defined(__i386__)
     43 #include <compat/linux/arch/i386/linux_termios.h>
     44 #elif defined(__m68k__)
     45 #include <compat/linux/arch/m68k/linux_termios.h>
     46 #elif defined(__alpha__)
     47 #include <compat/linux/arch/alpha/linux_termios.h>
     48 #elif defined(__powerpc__)
     49 #include <compat/linux/arch/powerpc/linux_termios.h>
     50 #elif defined(__mips__)
     51 #include <compat/linux/arch/mips/linux_termios.h>
     52 #elif defined(__arm__)
     53 #include <compat/linux/arch/arm/linux_termios.h>
     54 #elif defined(__amd64__)
     55 #include <compat/linux/arch/amd64/linux_termios.h>
     56 #else
     57 #error Undefined linux_termios.h machine type.
     58 #endif
     59 
     60 struct linux_winsize {
     61 	unsigned short ws_row;
     62 	unsigned short ws_col;
     63 	unsigned short ws_xpixel;
     64 	unsigned short ws_ypixel;
     65 };
     66 
     67 /*
     68  * LINUX_NCC is architecture dependent. It is now
     69  * defined in sys/compat/linux/<arch>/linux_termios.h
     70  */
     71 struct linux_termio {
     72 	unsigned short c_iflag;
     73 	unsigned short c_oflag;
     74 	unsigned short c_cflag;
     75 	unsigned short c_lflag;
     76 	unsigned char c_line;
     77 	unsigned char c_cc[LINUX_NCC];
     78 };
     79 
     80 struct linux_termios {
     81 	linux_tcflag_t	c_iflag;
     82 	linux_tcflag_t	c_oflag;
     83 	linux_tcflag_t	c_cflag;
     84 	linux_tcflag_t	c_lflag;
     85 	linux_cc_t	c_line;
     86 	linux_cc_t	c_cc[LINUX_NCCS];
     87 #ifdef LINUX_LARGE_STRUCT_TERMIOS
     88 	/*
     89     * Present on some linux ports but unused:
     90 	 * However we must enable it, else it breaks ioctl
     91 	 * definitions (the size does not match anymore)
     92     */
     93 	linux_speed_t	c_ispeed;
     94 	linux_speed_t	c_ospeed;
     95 #endif
     96 };
     97 
     98 /* Linux modem line defines.. not sure if they'll be used */
     99 #define LINUX_TIOCM_LE		0x0001
    100 #define LINUX_TIOCM_DTR		0x0002
    101 #define LINUX_TIOCM_RTS		0x0004
    102 #define LINUX_TIOCM_ST		0x0008
    103 #define LINUX_TIOCM_SR		0x0010
    104 #define LINUX_TIOCM_CTS		0x0020
    105 #define LINUX_TIOCM_CAR		0x0040
    106 #define LINUX_TIOCM_RNG		0x0080
    107 #define LINUX_TIOCM_DSR		0x0100
    108 #define LINUX_TIOCM_CD		LINUX_TIOCM_CAR
    109 #define LINUX_TIOCM_RI 		LINUX_TIOCM_RNG
    110 
    111 #define	LINUX_TCIFLUSH		0
    112 #define	LINUX_TCOFLUSH		1
    113 #define	LINUX_TCIOFLUSH		2
    114 
    115 #define	LINUX_TCOOFF		0
    116 #define	LINUX_TCOON		1
    117 #define	LINUX_TCIOFF		2
    118 #define	LINUX_TCION		3
    119 
    120 #define	LINUX_TCSANOW		0
    121 #define	LINUX_TCSADRAIN		1
    122 #define	LINUX_TCSAFLUSH		2
    123 
    124 /* Linux line disciplines */
    125 #define LINUX_N_TTY		0
    126 #define LINUX_N_SLIP		1
    127 #define LINUX_N_MOUSE		2
    128 #define LINUX_N_PPP		3
    129 #define	LINUX_N_STRIP		4
    130 
    131 /* currently unused: */
    132 #define	LINUX_N_AX25		5
    133 #define	LINUX_N_X25		6
    134 #define	LINUX_N_6PACK		7
    135 
    136 /* values passed to TIOCLINUX ioctl */
    137 #define LINUX_TIOCLINUX_COPY		 2
    138 #define LINUX_TIOCLINUX_PASTE		 3
    139 #define LINUX_TIOCLINUX_UNBLANK		 4
    140 #define LINUX_TIOCLINUX_LOADLUT		 5
    141 #define LINUX_TIOCLINUX_READSHIFT	 6
    142 #define LINUX_TIOCLINUX_READMOUSE	 7
    143 #define LINUX_TIOCLINUX_VESABLANK	10
    144 #define LINUX_TIOCLINUX_KERNMSG		11
    145 #define LINUX_TIOCLINUX_CURCONS		12
    146 
    147 #endif /* !_LINUX_TERMIOS_H */
    148