Home | History | Annotate | Line # | Download | only in sys
ioctl_compat.h revision 1.15.120.1
      1  1.15.120.1       tls /*	$NetBSD: ioctl_compat.h,v 1.15.120.1 2014/08/20 00:04:44 tls Exp $	*/
      2         1.9       cgd 
      3         1.6       cgd /*
      4         1.7       cgd  * Copyright (c) 1990, 1993
      5         1.7       cgd  *	The Regents of the University of California.  All rights reserved.
      6         1.6       cgd  * (c) UNIX System Laboratories, Inc.
      7         1.6       cgd  * All or some portions of this file are derived from material licensed
      8         1.6       cgd  * to the University of California by American Telephone and Telegraph
      9         1.6       cgd  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
     10         1.6       cgd  * the permission of UNIX System Laboratories, Inc.
     11         1.6       cgd  *
     12         1.6       cgd  * Redistribution and use in source and binary forms, with or without
     13         1.6       cgd  * modification, are permitted provided that the following conditions
     14         1.6       cgd  * are met:
     15         1.6       cgd  * 1. Redistributions of source code must retain the above copyright
     16         1.6       cgd  *    notice, this list of conditions and the following disclaimer.
     17         1.6       cgd  * 2. Redistributions in binary form must reproduce the above copyright
     18         1.6       cgd  *    notice, this list of conditions and the following disclaimer in the
     19         1.6       cgd  *    documentation and/or other materials provided with the distribution.
     20        1.14       agc  * 3. Neither the name of the University nor the names of its contributors
     21         1.6       cgd  *    may be used to endorse or promote products derived from this software
     22         1.6       cgd  *    without specific prior written permission.
     23         1.6       cgd  *
     24         1.6       cgd  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     25         1.6       cgd  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     26         1.6       cgd  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     27         1.6       cgd  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     28         1.6       cgd  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     29         1.6       cgd  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     30         1.6       cgd  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     31         1.6       cgd  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     32         1.6       cgd  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     33         1.6       cgd  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     34         1.6       cgd  * SUCH DAMAGE.
     35         1.6       cgd  *
     36         1.8       cgd  *	@(#)ioctl_compat.h	8.4 (Berkeley) 1/21/94
     37         1.6       cgd  */
     38         1.6       cgd 
     39        1.15  christos #ifndef _SYS_IOCTL_COMPAT_H_
     40        1.15  christos #define	_SYS_IOCTL_COMPAT_H_
     41        1.15  christos 
     42        1.13      matt #include <sys/ttychars.h>
     43        1.13      matt #include <sys/ttydev.h>
     44        1.13      matt 
     45         1.6       cgd struct tchars {
     46         1.6       cgd 	char	t_intrc;	/* interrupt */
     47         1.6       cgd 	char	t_quitc;	/* quit */
     48         1.6       cgd 	char	t_startc;	/* start output */
     49         1.6       cgd 	char	t_stopc;	/* stop output */
     50         1.6       cgd 	char	t_eofc;		/* end-of-file */
     51         1.6       cgd 	char	t_brkc;		/* input delimiter (like nl) */
     52         1.6       cgd };
     53         1.6       cgd 
     54         1.6       cgd struct ltchars {
     55         1.6       cgd 	char	t_suspc;	/* stop process signal */
     56         1.6       cgd 	char	t_dsuspc;	/* delayed stop process signal */
     57         1.6       cgd 	char	t_rprntc;	/* reprint line */
     58         1.6       cgd 	char	t_flushc;	/* flush output (toggles) */
     59         1.6       cgd 	char	t_werasc;	/* word erase */
     60         1.6       cgd 	char	t_lnextc;	/* literal next character */
     61         1.6       cgd };
     62         1.6       cgd 
     63         1.6       cgd /*
     64         1.6       cgd  * Structure for TIOCGETP and TIOCSETP ioctls.
     65         1.6       cgd  */
     66         1.6       cgd #ifndef _SGTTYB_
     67         1.6       cgd #define	_SGTTYB_
     68         1.6       cgd struct sgttyb {
     69         1.6       cgd 	char	sg_ispeed;		/* input speed */
     70         1.6       cgd 	char	sg_ospeed;		/* output speed */
     71         1.6       cgd 	char	sg_erase;		/* erase character */
     72         1.6       cgd 	char	sg_kill;		/* kill character */
     73         1.6       cgd 	short	sg_flags;		/* mode flags */
     74         1.6       cgd };
     75         1.6       cgd #endif
     76         1.6       cgd 
     77         1.6       cgd #ifdef USE_OLD_TTY
     78         1.6       cgd # undef  TIOCGETD
     79         1.6       cgd # define TIOCGETD	_IOR('t', 0, int)	/* get line discipline */
     80         1.6       cgd # undef  TIOCSETD
     81         1.6       cgd # define TIOCSETD	_IOW('t', 1, int)	/* set line discipline */
     82         1.6       cgd #else
     83         1.6       cgd # define OTIOCGETD	_IOR('t', 0, int)	/* get line discipline */
     84         1.6       cgd # define OTIOCSETD	_IOW('t', 1, int)	/* set line discipline */
     85         1.6       cgd #endif
     86         1.6       cgd #define	TIOCHPCL	_IO('t', 2)		/* hang up on last close */
     87         1.6       cgd #define	TIOCGETP	_IOR('t', 8,struct sgttyb)/* get parameters -- gtty */
     88         1.6       cgd #define	TIOCSETP	_IOW('t', 9,struct sgttyb)/* set parameters -- stty */
     89         1.6       cgd #define	TIOCSETN	_IOW('t',10,struct sgttyb)/* as above, but no flushtty*/
     90         1.6       cgd #define	TIOCSETC	_IOW('t',17,struct tchars)/* set special characters */
     91         1.6       cgd #define	TIOCGETC	_IOR('t',18,struct tchars)/* get special characters */
     92  1.15.120.1       tls /*
     93  1.15.120.1       tls  * The entries marked as termios below, are common and should have the
     94  1.15.120.1       tls  * same values.
     95  1.15.120.1       tls  */
     96         1.6       cgd #define		TANDEM		0x00000001	/* send stopc on out q full */
     97         1.6       cgd #define		CBREAK		0x00000002	/* half-cooked mode */
     98         1.6       cgd #define		LCASE		0x00000004	/* simulate lower case */
     99  1.15.120.1       tls /* termios	ECHO		0x00000008	   enable echoing */
    100         1.6       cgd #define		CRMOD		0x00000010	/* map \r to \r\n on output */
    101         1.6       cgd #define		RAW		0x00000020	/* no i/o processing */
    102         1.6       cgd #define		ODDP		0x00000040	/* get/send odd parity */
    103         1.6       cgd #define		EVENP		0x00000080	/* get/send even parity */
    104         1.6       cgd #define		ANYP		0x000000c0	/* get any parity/send none */
    105         1.6       cgd #define		NLDELAY		0x00000300	/* \n delay */
    106         1.6       cgd #define			NL0	0x00000000
    107         1.6       cgd #define			NL1	0x00000100	/* tty 37 */
    108         1.6       cgd #define			NL2	0x00000200	/* vt05 */
    109         1.6       cgd #define			NL3	0x00000300
    110         1.6       cgd #define		TBDELAY		0x00000c00	/* horizontal tab delay */
    111         1.6       cgd #define			TAB0	0x00000000
    112         1.6       cgd #define			TAB1	0x00000400	/* tty 37 */
    113         1.6       cgd #define			TAB2	0x00000800
    114         1.6       cgd #define		XTABS		0x00000c00	/* expand tabs on output */
    115         1.6       cgd #define		CRDELAY		0x00003000	/* \r delay */
    116         1.6       cgd #define			CR0	0x00000000
    117         1.6       cgd #define			CR1	0x00001000	/* tn 300 */
    118         1.6       cgd #define			CR2	0x00002000	/* tty 37 */
    119         1.6       cgd #define			CR3	0x00003000	/* concept 100 */
    120         1.6       cgd #define		VTDELAY		0x00004000	/* vertical tab delay */
    121         1.6       cgd #define			FF0	0x00000000
    122         1.6       cgd #define			FF1	0x00004000	/* tty 37 */
    123         1.6       cgd #define		BSDELAY		0x00008000	/* \b delay */
    124         1.6       cgd #define			BS0	0x00000000
    125         1.6       cgd #define			BS1	0x00008000
    126         1.6       cgd #define		ALLDELAY	(NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY)
    127         1.6       cgd #define		CRTBS		0x00010000	/* do backspacing for crt */
    128         1.6       cgd #define		PRTERA		0x00020000	/* \ ... / erase */
    129         1.6       cgd #define		CRTERA		0x00040000	/* " \b " to wipe out char */
    130         1.6       cgd #define		TILDE		0x00080000	/* hazeltine tilde kludge */
    131  1.15.120.1       tls /* termios	MDMBUF		0x00100000	   DTR/DCD hardware flow control */
    132         1.6       cgd #define		LITOUT		0x00200000	/* literal output */
    133  1.15.120.1       tls /* termios	TOSTOP		0x00400000	   stop background jobs on output */
    134  1.15.120.1       tls /* termios	FLUSHO		0x00800000	   output being flushed (state) */
    135         1.6       cgd #define		NOHANG		0x01000000	/* (no-op) was no SIGHUP on carrier drop */
    136         1.6       cgd #define		L001000		0x02000000
    137         1.6       cgd #define		CRTKIL		0x04000000	/* kill line with " \b " */
    138         1.6       cgd #define		PASS8		0x08000000
    139         1.6       cgd #define		CTLECH		0x10000000	/* echo control chars as ^X */
    140  1.15.120.1       tls /* termios	PENDIN		0x20000000	   re-echo input buffer at next read */
    141         1.6       cgd #define		DECCTQ		0x40000000	/* only ^Q starts after ^S */
    142  1.15.120.1       tls /* termios 	NOFLSH		0x80000000	   don't flush output on signal */
    143         1.6       cgd #define	TIOCLBIS	_IOW('t', 127, int)	/* bis local mode bits */
    144         1.6       cgd #define	TIOCLBIC	_IOW('t', 126, int)	/* bic local mode bits */
    145         1.6       cgd #define	TIOCLSET	_IOW('t', 125, int)	/* set entire local mode word */
    146         1.6       cgd #define	TIOCLGET	_IOR('t', 124, int)	/* get local modes */
    147         1.6       cgd #define		LCRTBS		(CRTBS>>16)
    148         1.6       cgd #define		LPRTERA		(PRTERA>>16)
    149         1.6       cgd #define		LCRTERA		(CRTERA>>16)
    150         1.6       cgd #define		LTILDE		(TILDE>>16)
    151         1.6       cgd #define		LMDMBUF		(MDMBUF>>16)
    152         1.6       cgd #define		LLITOUT		(LITOUT>>16)
    153         1.6       cgd #define		LTOSTOP		(TOSTOP>>16)
    154         1.6       cgd #define		LFLUSHO		(FLUSHO>>16)
    155         1.6       cgd #define		LNOHANG		(NOHANG>>16)
    156         1.6       cgd #define		LCRTKIL		(CRTKIL>>16)
    157         1.6       cgd #define		LPASS8		(PASS8>>16)
    158         1.6       cgd #define		LCTLECH		(CTLECH>>16)
    159         1.6       cgd #define		LPENDIN		(PENDIN>>16)
    160         1.6       cgd #define		LDECCTQ		(DECCTQ>>16)
    161         1.6       cgd #define		LNOFLSH		(NOFLSH>>16)
    162         1.6       cgd #define	TIOCSLTC	_IOW('t',117,struct ltchars)/* set local special chars*/
    163         1.6       cgd #define	TIOCGLTC	_IOR('t',116,struct ltchars)/* get local special chars*/
    164         1.6       cgd #define OTIOCCONS	_IO('t', 98)	/* for hp300 -- sans int arg */
    165         1.6       cgd #define	OTTYDISC	0
    166         1.6       cgd #define	NETLDISC	1
    167         1.6       cgd #define	NTTYDISC	2
    168         1.6       cgd 
    169         1.6       cgd #endif /* !_SYS_IOCTL_COMPAT_H_ */
    170