ttycom.h

Go to the documentation of this file.
00001 /*-
00002  * Copyright (c) 1982, 1986, 1990, 1993, 1994
00003  *      The Regents of the University of California.  All rights reserved.
00004  * (c) UNIX System Laboratories, Inc.
00005  * All or some portions of this file are derived from material licensed
00006  * to the University of California by American Telephone and Telegraph
00007  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
00008  * the permission of UNIX System Laboratories, Inc.
00009  *
00010  * Redistribution and use in source and binary forms, with or without
00011  * modification, are permitted provided that the following conditions
00012  * are met:
00013  * 1. Redistributions of source code must retain the above copyright
00014  *    notice, this list of conditions and the following disclaimer.
00015  * 2. Redistributions in binary form must reproduce the above copyright
00016  *    notice, this list of conditions and the following disclaimer in the
00017  *    documentation and/or other materials provided with the distribution.
00018  * 4. Neither the name of the University nor the names of its contributors
00019  *    may be used to endorse or promote products derived from this software
00020  *    without specific prior written permission.
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00023  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00024  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00025  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00026  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00027  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00028  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00029  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00030  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00031  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00032  * SUCH DAMAGE.
00033  *
00034  *      @(#)ttycom.h    8.1 (Berkeley) 3/28/94
00035  * $FreeBSD: src/sys/sys/ttycom.h,v 1.23 2004/06/25 21:54:49 phk Exp $
00036  */
00037 
00038 #ifndef _SYS_TTYCOM_H_
00039 #define _SYS_TTYCOM_H_
00040 
00041 #include <sys/ioccom.h>
00042 
00043 /*
00044  * Tty ioctl's except for those supported only for backwards compatibility
00045  * with the old tty driver.
00046  */
00047 
00048 /*
00049  * Window/terminal size structure.  This information is stored by the kernel
00050  * in order to provide a consistent interface, but is not used by the kernel.
00051  */
00052 struct winsize {
00053         unsigned short  ws_row;         /* rows, in characters */
00054         unsigned short  ws_col;         /* columns, in characters */
00055         unsigned short  ws_xpixel;      /* horizontal size, pixels */
00056         unsigned short  ws_ypixel;      /* vertical size, pixels */
00057 };
00058 
00059                                                 /* 0-2 compat */
00060                                                 /* 3-4 obsolete */
00061                                                 /* 5-7 obsolete or unused */
00062                                                 /* 8-10 compat */
00063                                                 /* 11-12 obsolete or unused */
00064 #define TIOCEXCL         _IO('t', 13)           /* set exclusive use of tty */
00065 #define TIOCNXCL         _IO('t', 14)           /* reset exclusive use of tty */
00066                                                 /* 15 unused */
00067 #define TIOCFLUSH       _IOW('t', 16, int)      /* flush buffers */
00068                                                 /* 17-18 compat */
00069 #define TIOCGETA        _IOR('t', 19, struct termios) /* get termios struct */
00070 #define TIOCSETA        _IOW('t', 20, struct termios) /* set termios struct */
00071 #define TIOCSETAW       _IOW('t', 21, struct termios) /* drain output, set */
00072 #define TIOCSETAF       _IOW('t', 22, struct termios) /* drn out, fls in, set */
00073                                                 /* 23-25 obsolete or unused */
00074 #define TIOCGETD        _IOR('t', 26, int)      /* get line discipline */
00075 #define TIOCSETD        _IOW('t', 27, int)      /* set line discipline */
00076                                                 /* 28-69 free */
00077                                                 /* 127-124 compat */
00078 #define TIOCSBRK         _IO('t', 123)          /* set break bit */
00079 #define TIOCCBRK         _IO('t', 122)          /* clear break bit */
00080 #define TIOCSDTR         _IO('t', 121)          /* set data terminal ready */
00081 #define TIOCCDTR         _IO('t', 120)          /* clear data terminal ready */
00082 #define TIOCGPGRP       _IOR('t', 119, int)     /* get pgrp of tty */
00083 #define TIOCSPGRP       _IOW('t', 118, int)     /* set pgrp of tty */
00084                                                 /* 117-116 compat */
00085 #define TIOCOUTQ        _IOR('t', 115, int)     /* output queue size */
00086 #define TIOCSTI         _IOW('t', 114, char)    /* simulate terminal input */
00087 #define TIOCNOTTY        _IO('t', 113)          /* void tty association */
00088 #define TIOCPKT         _IOW('t', 112, int)     /* pty: set/clear packet mode */
00089 #define         TIOCPKT_DATA            0x00    /* data packet */
00090 #define         TIOCPKT_FLUSHREAD       0x01    /* flush packet */
00091 #define         TIOCPKT_FLUSHWRITE      0x02    /* flush packet */
00092 #define         TIOCPKT_STOP            0x04    /* stop output */
00093 #define         TIOCPKT_START           0x08    /* start output */
00094 #define         TIOCPKT_NOSTOP          0x10    /* no more ^S, ^Q */
00095 #define         TIOCPKT_DOSTOP          0x20    /* now do ^S ^Q */
00096 #define         TIOCPKT_IOCTL           0x40    /* state change of pty driver */
00097 #define TIOCSTOP         _IO('t', 111)          /* stop output, like ^S */
00098 #define TIOCSTART        _IO('t', 110)          /* start output, like ^Q */
00099 #define TIOCMSET        _IOW('t', 109, int)     /* set all modem bits */
00100 #define TIOCMBIS        _IOW('t', 108, int)     /* bis modem bits */
00101 #define TIOCMBIC        _IOW('t', 107, int)     /* bic modem bits */
00102 #define TIOCMGET        _IOR('t', 106, int)     /* get all modem bits */
00103 #define         TIOCM_LE        0001            /* line enable */
00104 #define         TIOCM_DTR       0002            /* data terminal ready */
00105 #define         TIOCM_RTS       0004            /* request to send */
00106 #define         TIOCM_ST        0010            /* secondary transmit */
00107 #define         TIOCM_SR        0020            /* secondary receive */
00108 #define         TIOCM_CTS       0040            /* clear to send */
00109 #define         TIOCM_DCD       0100            /* data carrier detect */
00110 #define         TIOCM_RI        0200            /* ring indicate */
00111 #define         TIOCM_DSR       0400            /* data set ready */
00112 #define         TIOCM_CD        TIOCM_DCD
00113 #define         TIOCM_CAR       TIOCM_DCD
00114 #define         TIOCM_RNG       TIOCM_RI
00115 #define TIOCGWINSZ      _IOR('t', 104, struct winsize)  /* get window size */
00116 #define TIOCSWINSZ      _IOW('t', 103, struct winsize)  /* set window size */
00117 #define TIOCUCNTL       _IOW('t', 102, int)     /* pty: set/clr usr cntl mode */
00118 #define TIOCSTAT         _IO('t', 101)          /* simulate ^T status message */
00119 #define         UIOCCMD(n)      _IO('u', n)     /* usr cntl op "n" */
00120                                                 /* 100 see consio.h */
00121                                                 /* 99 obsolete or unused */
00122 #define TIOCCONS        _IOW('t', 98, int)      /* become virtual console */
00123 #define TIOCSCTTY        _IO('t', 97)           /* become controlling tty */
00124                                                 /* 97-90 tun; some conflicts */
00125 #define TIOCEXT         _IOW('t', 96, int)      /* pty: external processing */
00126 #define TIOCSIG          _IO('t', 95)           /* pty: generate signal */
00127 #define TIOCDRAIN        _IO('t', 94)           /* wait till output drained */
00128                                                 /* 92-90 tap; some conflicts */
00129 #define TIOCMSDTRWAIT   _IOW('t', 91, int)      /* modem: set wait on close */
00130 #define TIOCMGDTRWAIT   _IOR('t', 90, int)      /* modem: get wait on close */
00131                                                 /* 90-70 ppp; many conflicts */
00132 #define TIOCTIMESTAMP   _IOR('t', 89, struct timeval)   /* enable/get timestamp
00133                                                  * of last input event */
00134                                                 /* 88 slip, ppp; conflicts */
00135 #define TIOCSDRAINWAIT  _IOW('t', 87, int)      /* set ttywait timeout */
00136 #define TIOCGDRAINWAIT  _IOR('t', 86, int)      /* get ttywait timeout */
00137                                                 /* 84-80 slip */
00138 
00139 #define TTYDISC         0               /* termios tty line discipline */
00140 #define SLIPDISC        4               /* serial IP discipline */
00141 #define PPPDISC         5               /* PPP discipline */
00142 #define NETGRAPHDISC    6               /* Netgraph tty node discipline */
00143 #define H4DISC          7               /* Netgraph Bluetooth H4 discipline */
00144 
00145 #endif /* !_SYS_TTYCOM_H_ */

Copyright © Nokia Corporation 2001-2008
Back to top