1 1.17 dholland /* $NetBSD: ioctl_compat.h,v 1.17 2015/09/06 06:01:02 dholland 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.17 dholland #include <sys/ioccom.h> 43 1.13 matt #include <sys/ttychars.h> 44 1.13 matt #include <sys/ttydev.h> 45 1.13 matt 46 1.6 cgd struct tchars { 47 1.6 cgd char t_intrc; /* interrupt */ 48 1.6 cgd char t_quitc; /* quit */ 49 1.6 cgd char t_startc; /* start output */ 50 1.6 cgd char t_stopc; /* stop output */ 51 1.6 cgd char t_eofc; /* end-of-file */ 52 1.6 cgd char t_brkc; /* input delimiter (like nl) */ 53 1.6 cgd }; 54 1.6 cgd 55 1.6 cgd struct ltchars { 56 1.6 cgd char t_suspc; /* stop process signal */ 57 1.6 cgd char t_dsuspc; /* delayed stop process signal */ 58 1.6 cgd char t_rprntc; /* reprint line */ 59 1.6 cgd char t_flushc; /* flush output (toggles) */ 60 1.6 cgd char t_werasc; /* word erase */ 61 1.6 cgd char t_lnextc; /* literal next character */ 62 1.6 cgd }; 63 1.6 cgd 64 1.6 cgd /* 65 1.6 cgd * Structure for TIOCGETP and TIOCSETP ioctls. 66 1.6 cgd */ 67 1.6 cgd #ifndef _SGTTYB_ 68 1.6 cgd #define _SGTTYB_ 69 1.6 cgd struct sgttyb { 70 1.6 cgd char sg_ispeed; /* input speed */ 71 1.6 cgd char sg_ospeed; /* output speed */ 72 1.6 cgd char sg_erase; /* erase character */ 73 1.6 cgd char sg_kill; /* kill character */ 74 1.6 cgd short sg_flags; /* mode flags */ 75 1.6 cgd }; 76 1.6 cgd #endif 77 1.6 cgd 78 1.6 cgd #ifdef USE_OLD_TTY 79 1.6 cgd # undef TIOCGETD 80 1.6 cgd # define TIOCGETD _IOR('t', 0, int) /* get line discipline */ 81 1.6 cgd # undef TIOCSETD 82 1.6 cgd # define TIOCSETD _IOW('t', 1, int) /* set line discipline */ 83 1.6 cgd #else 84 1.6 cgd # define OTIOCGETD _IOR('t', 0, int) /* get line discipline */ 85 1.6 cgd # define OTIOCSETD _IOW('t', 1, int) /* set line discipline */ 86 1.6 cgd #endif 87 1.6 cgd #define TIOCHPCL _IO('t', 2) /* hang up on last close */ 88 1.6 cgd #define TIOCGETP _IOR('t', 8,struct sgttyb)/* get parameters -- gtty */ 89 1.6 cgd #define TIOCSETP _IOW('t', 9,struct sgttyb)/* set parameters -- stty */ 90 1.6 cgd #define TIOCSETN _IOW('t',10,struct sgttyb)/* as above, but no flushtty*/ 91 1.6 cgd #define TIOCSETC _IOW('t',17,struct tchars)/* set special characters */ 92 1.6 cgd #define TIOCGETC _IOR('t',18,struct tchars)/* get special characters */ 93 1.16 christos /* 94 1.16 christos * The entries marked as termios below, are common and should have the 95 1.16 christos * same values. 96 1.16 christos */ 97 1.6 cgd #define TANDEM 0x00000001 /* send stopc on out q full */ 98 1.6 cgd #define CBREAK 0x00000002 /* half-cooked mode */ 99 1.6 cgd #define LCASE 0x00000004 /* simulate lower case */ 100 1.16 christos /* termios ECHO 0x00000008 enable echoing */ 101 1.6 cgd #define CRMOD 0x00000010 /* map \r to \r\n on output */ 102 1.6 cgd #define RAW 0x00000020 /* no i/o processing */ 103 1.6 cgd #define ODDP 0x00000040 /* get/send odd parity */ 104 1.6 cgd #define EVENP 0x00000080 /* get/send even parity */ 105 1.6 cgd #define ANYP 0x000000c0 /* get any parity/send none */ 106 1.6 cgd #define NLDELAY 0x00000300 /* \n delay */ 107 1.6 cgd #define NL0 0x00000000 108 1.6 cgd #define NL1 0x00000100 /* tty 37 */ 109 1.6 cgd #define NL2 0x00000200 /* vt05 */ 110 1.6 cgd #define NL3 0x00000300 111 1.6 cgd #define TBDELAY 0x00000c00 /* horizontal tab delay */ 112 1.6 cgd #define TAB0 0x00000000 113 1.6 cgd #define TAB1 0x00000400 /* tty 37 */ 114 1.6 cgd #define TAB2 0x00000800 115 1.6 cgd #define XTABS 0x00000c00 /* expand tabs on output */ 116 1.6 cgd #define CRDELAY 0x00003000 /* \r delay */ 117 1.6 cgd #define CR0 0x00000000 118 1.6 cgd #define CR1 0x00001000 /* tn 300 */ 119 1.6 cgd #define CR2 0x00002000 /* tty 37 */ 120 1.6 cgd #define CR3 0x00003000 /* concept 100 */ 121 1.6 cgd #define VTDELAY 0x00004000 /* vertical tab delay */ 122 1.6 cgd #define FF0 0x00000000 123 1.6 cgd #define FF1 0x00004000 /* tty 37 */ 124 1.6 cgd #define BSDELAY 0x00008000 /* \b delay */ 125 1.6 cgd #define BS0 0x00000000 126 1.6 cgd #define BS1 0x00008000 127 1.6 cgd #define ALLDELAY (NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY) 128 1.6 cgd #define CRTBS 0x00010000 /* do backspacing for crt */ 129 1.6 cgd #define PRTERA 0x00020000 /* \ ... / erase */ 130 1.6 cgd #define CRTERA 0x00040000 /* " \b " to wipe out char */ 131 1.6 cgd #define TILDE 0x00080000 /* hazeltine tilde kludge */ 132 1.16 christos /* termios MDMBUF 0x00100000 DTR/DCD hardware flow control */ 133 1.6 cgd #define LITOUT 0x00200000 /* literal output */ 134 1.16 christos /* termios TOSTOP 0x00400000 stop background jobs on output */ 135 1.16 christos /* termios FLUSHO 0x00800000 output being flushed (state) */ 136 1.6 cgd #define NOHANG 0x01000000 /* (no-op) was no SIGHUP on carrier drop */ 137 1.6 cgd #define L001000 0x02000000 138 1.6 cgd #define CRTKIL 0x04000000 /* kill line with " \b " */ 139 1.6 cgd #define PASS8 0x08000000 140 1.6 cgd #define CTLECH 0x10000000 /* echo control chars as ^X */ 141 1.16 christos /* termios PENDIN 0x20000000 re-echo input buffer at next read */ 142 1.6 cgd #define DECCTQ 0x40000000 /* only ^Q starts after ^S */ 143 1.16 christos /* termios NOFLSH 0x80000000 don't flush output on signal */ 144 1.6 cgd #define TIOCLBIS _IOW('t', 127, int) /* bis local mode bits */ 145 1.6 cgd #define TIOCLBIC _IOW('t', 126, int) /* bic local mode bits */ 146 1.6 cgd #define TIOCLSET _IOW('t', 125, int) /* set entire local mode word */ 147 1.6 cgd #define TIOCLGET _IOR('t', 124, int) /* get local modes */ 148 1.6 cgd #define LCRTBS (CRTBS>>16) 149 1.6 cgd #define LPRTERA (PRTERA>>16) 150 1.6 cgd #define LCRTERA (CRTERA>>16) 151 1.6 cgd #define LTILDE (TILDE>>16) 152 1.6 cgd #define LMDMBUF (MDMBUF>>16) 153 1.6 cgd #define LLITOUT (LITOUT>>16) 154 1.6 cgd #define LTOSTOP (TOSTOP>>16) 155 1.6 cgd #define LFLUSHO (FLUSHO>>16) 156 1.6 cgd #define LNOHANG (NOHANG>>16) 157 1.6 cgd #define LCRTKIL (CRTKIL>>16) 158 1.6 cgd #define LPASS8 (PASS8>>16) 159 1.6 cgd #define LCTLECH (CTLECH>>16) 160 1.6 cgd #define LPENDIN (PENDIN>>16) 161 1.6 cgd #define LDECCTQ (DECCTQ>>16) 162 1.6 cgd #define LNOFLSH (NOFLSH>>16) 163 1.6 cgd #define TIOCSLTC _IOW('t',117,struct ltchars)/* set local special chars*/ 164 1.6 cgd #define TIOCGLTC _IOR('t',116,struct ltchars)/* get local special chars*/ 165 1.6 cgd #define OTIOCCONS _IO('t', 98) /* for hp300 -- sans int arg */ 166 1.6 cgd #define OTTYDISC 0 167 1.6 cgd #define NETLDISC 1 168 1.6 cgd #define NTTYDISC 2 169 1.6 cgd 170 1.6 cgd #endif /* !_SYS_IOCTL_COMPAT_H_ */ 171