os/ossrv/genericopenlibs/openenvcore/include/sys/ttycom.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericopenlibs/openenvcore/include/sys/ttycom.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,145 @@
     1.4 +/*-
     1.5 + * Copyright (c) 1982, 1986, 1990, 1993, 1994
     1.6 + *	The Regents of the University of California.  All rights reserved.
     1.7 + * (c) UNIX System Laboratories, Inc.
     1.8 + * All or some portions of this file are derived from material licensed
     1.9 + * to the University of California by American Telephone and Telegraph
    1.10 + * Co. or Unix System Laboratories, Inc. and are reproduced herein with
    1.11 + * the permission of UNIX System Laboratories, Inc.
    1.12 + *
    1.13 + * Redistribution and use in source and binary forms, with or without
    1.14 + * modification, are permitted provided that the following conditions
    1.15 + * are met:
    1.16 + * 1. Redistributions of source code must retain the above copyright
    1.17 + *    notice, this list of conditions and the following disclaimer.
    1.18 + * 2. Redistributions in binary form must reproduce the above copyright
    1.19 + *    notice, this list of conditions and the following disclaimer in the
    1.20 + *    documentation and/or other materials provided with the distribution.
    1.21 + * 4. Neither the name of the University nor the names of its contributors
    1.22 + *    may be used to endorse or promote products derived from this software
    1.23 + *    without specific prior written permission.
    1.24 + *
    1.25 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
    1.26 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    1.27 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    1.28 + * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
    1.29 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    1.30 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    1.31 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    1.32 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    1.33 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    1.34 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.35 + * SUCH DAMAGE.
    1.36 + *
    1.37 + *	@(#)ttycom.h	8.1 (Berkeley) 3/28/94
    1.38 + * $FreeBSD: src/sys/sys/ttycom.h,v 1.23 2004/06/25 21:54:49 phk Exp $
    1.39 + */
    1.40 +
    1.41 +#ifndef	_SYS_TTYCOM_H_
    1.42 +#define	_SYS_TTYCOM_H_
    1.43 +
    1.44 +#include <sys/ioccom.h>
    1.45 +
    1.46 +/*
    1.47 + * Tty ioctl's except for those supported only for backwards compatibility
    1.48 + * with the old tty driver.
    1.49 + */
    1.50 +
    1.51 +/*
    1.52 + * Window/terminal size structure.  This information is stored by the kernel
    1.53 + * in order to provide a consistent interface, but is not used by the kernel.
    1.54 + */
    1.55 +struct winsize {
    1.56 +	unsigned short	ws_row;		/* rows, in characters */
    1.57 +	unsigned short	ws_col;		/* columns, in characters */
    1.58 +	unsigned short	ws_xpixel;	/* horizontal size, pixels */
    1.59 +	unsigned short	ws_ypixel;	/* vertical size, pixels */
    1.60 +};
    1.61 +
    1.62 +						/* 0-2 compat */
    1.63 +						/* 3-4 obsolete */
    1.64 +						/* 5-7 obsolete or unused */
    1.65 +						/* 8-10 compat */
    1.66 +						/* 11-12 obsolete or unused */
    1.67 +#define	TIOCEXCL	 _IO('t', 13)		/* set exclusive use of tty */
    1.68 +#define	TIOCNXCL	 _IO('t', 14)		/* reset exclusive use of tty */
    1.69 +						/* 15 unused */
    1.70 +#define	TIOCFLUSH	_IOW('t', 16, int)	/* flush buffers */
    1.71 +						/* 17-18 compat */
    1.72 +#define	TIOCGETA	_IOR('t', 19, struct termios) /* get termios struct */
    1.73 +#define	TIOCSETA	_IOW('t', 20, struct termios) /* set termios struct */
    1.74 +#define	TIOCSETAW	_IOW('t', 21, struct termios) /* drain output, set */
    1.75 +#define	TIOCSETAF	_IOW('t', 22, struct termios) /* drn out, fls in, set */
    1.76 +						/* 23-25 obsolete or unused */
    1.77 +#define	TIOCGETD	_IOR('t', 26, int)	/* get line discipline */
    1.78 +#define	TIOCSETD	_IOW('t', 27, int)	/* set line discipline */
    1.79 +						/* 28-69 free */
    1.80 +						/* 127-124 compat */
    1.81 +#define	TIOCSBRK	 _IO('t', 123)		/* set break bit */
    1.82 +#define	TIOCCBRK	 _IO('t', 122)		/* clear break bit */
    1.83 +#define	TIOCSDTR	 _IO('t', 121)		/* set data terminal ready */
    1.84 +#define	TIOCCDTR	 _IO('t', 120)		/* clear data terminal ready */
    1.85 +#define	TIOCGPGRP	_IOR('t', 119, int)	/* get pgrp of tty */
    1.86 +#define	TIOCSPGRP	_IOW('t', 118, int)	/* set pgrp of tty */
    1.87 +						/* 117-116 compat */
    1.88 +#define	TIOCOUTQ	_IOR('t', 115, int)	/* output queue size */
    1.89 +#define	TIOCSTI		_IOW('t', 114, char)	/* simulate terminal input */
    1.90 +#define	TIOCNOTTY	 _IO('t', 113)		/* void tty association */
    1.91 +#define	TIOCPKT		_IOW('t', 112, int)	/* pty: set/clear packet mode */
    1.92 +#define		TIOCPKT_DATA		0x00	/* data packet */
    1.93 +#define		TIOCPKT_FLUSHREAD	0x01	/* flush packet */
    1.94 +#define		TIOCPKT_FLUSHWRITE	0x02	/* flush packet */
    1.95 +#define		TIOCPKT_STOP		0x04	/* stop output */
    1.96 +#define		TIOCPKT_START		0x08	/* start output */
    1.97 +#define		TIOCPKT_NOSTOP		0x10	/* no more ^S, ^Q */
    1.98 +#define		TIOCPKT_DOSTOP		0x20	/* now do ^S ^Q */
    1.99 +#define		TIOCPKT_IOCTL		0x40	/* state change of pty driver */
   1.100 +#define	TIOCSTOP	 _IO('t', 111)		/* stop output, like ^S */
   1.101 +#define	TIOCSTART	 _IO('t', 110)		/* start output, like ^Q */
   1.102 +#define	TIOCMSET	_IOW('t', 109, int)	/* set all modem bits */
   1.103 +#define	TIOCMBIS	_IOW('t', 108, int)	/* bis modem bits */
   1.104 +#define	TIOCMBIC	_IOW('t', 107, int)	/* bic modem bits */
   1.105 +#define	TIOCMGET	_IOR('t', 106, int)	/* get all modem bits */
   1.106 +#define		TIOCM_LE	0001		/* line enable */
   1.107 +#define		TIOCM_DTR	0002		/* data terminal ready */
   1.108 +#define		TIOCM_RTS	0004		/* request to send */
   1.109 +#define		TIOCM_ST	0010		/* secondary transmit */
   1.110 +#define		TIOCM_SR	0020		/* secondary receive */
   1.111 +#define		TIOCM_CTS	0040		/* clear to send */
   1.112 +#define		TIOCM_DCD	0100		/* data carrier detect */
   1.113 +#define		TIOCM_RI 	0200		/* ring indicate */
   1.114 +#define		TIOCM_DSR	0400		/* data set ready */
   1.115 +#define		TIOCM_CD	TIOCM_DCD
   1.116 +#define		TIOCM_CAR	TIOCM_DCD
   1.117 +#define		TIOCM_RNG	TIOCM_RI
   1.118 +#define	TIOCGWINSZ	_IOR('t', 104, struct winsize)	/* get window size */
   1.119 +#define	TIOCSWINSZ	_IOW('t', 103, struct winsize)	/* set window size */
   1.120 +#define	TIOCUCNTL	_IOW('t', 102, int)	/* pty: set/clr usr cntl mode */
   1.121 +#define	TIOCSTAT	 _IO('t', 101)		/* simulate ^T status message */
   1.122 +#define		UIOCCMD(n)	_IO('u', n)	/* usr cntl op "n" */
   1.123 +						/* 100 see consio.h */
   1.124 +						/* 99 obsolete or unused */
   1.125 +#define	TIOCCONS	_IOW('t', 98, int)	/* become virtual console */
   1.126 +#define	TIOCSCTTY	 _IO('t', 97)		/* become controlling tty */
   1.127 +						/* 97-90 tun; some conflicts */
   1.128 +#define	TIOCEXT		_IOW('t', 96, int)	/* pty: external processing */
   1.129 +#define	TIOCSIG		 _IO('t', 95)		/* pty: generate signal */
   1.130 +#define	TIOCDRAIN	 _IO('t', 94)		/* wait till output drained */
   1.131 +						/* 92-90 tap; some conflicts */
   1.132 +#define	TIOCMSDTRWAIT	_IOW('t', 91, int)	/* modem: set wait on close */
   1.133 +#define	TIOCMGDTRWAIT	_IOR('t', 90, int)	/* modem: get wait on close */
   1.134 +						/* 90-70 ppp; many conflicts */
   1.135 +#define	TIOCTIMESTAMP	_IOR('t', 89, struct timeval)	/* enable/get timestamp
   1.136 +						 * of last input event */
   1.137 +						/* 88 slip, ppp; conflicts */
   1.138 +#define	TIOCSDRAINWAIT	_IOW('t', 87, int)	/* set ttywait timeout */
   1.139 +#define	TIOCGDRAINWAIT	_IOR('t', 86, int)	/* get ttywait timeout */
   1.140 +						/* 84-80 slip */
   1.141 +
   1.142 +#define	TTYDISC		0		/* termios tty line discipline */
   1.143 +#define	SLIPDISC	4		/* serial IP discipline */
   1.144 +#define	PPPDISC		5		/* PPP discipline */
   1.145 +#define	NETGRAPHDISC	6		/* Netgraph tty node discipline */
   1.146 +#define	H4DISC		7		/* Netgraph Bluetooth H4 discipline */
   1.147 +
   1.148 +#endif /* !_SYS_TTYCOM_H_ */