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