10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*8770SJordan.Vaughan@Sun.com * Common Development and Distribution License (the "License"). 6*8770SJordan.Vaughan@Sun.com * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 22*8770SJordan.Vaughan@Sun.com * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 270Sstevel@tonic-gate /* All Rights Reserved */ 280Sstevel@tonic-gate 290Sstevel@tonic-gate #ifndef _SYS_TTCOMPAT_H 300Sstevel@tonic-gate #define _SYS_TTCOMPAT_H 310Sstevel@tonic-gate 320Sstevel@tonic-gate #ifdef __cplusplus 330Sstevel@tonic-gate extern "C" { 340Sstevel@tonic-gate #endif 350Sstevel@tonic-gate 360Sstevel@tonic-gate /* 370Sstevel@tonic-gate * BSD/XENIX/V7 ttcompat module header file 380Sstevel@tonic-gate */ 390Sstevel@tonic-gate 400Sstevel@tonic-gate /* 410Sstevel@tonic-gate * Old-style terminal state. 420Sstevel@tonic-gate */ 430Sstevel@tonic-gate typedef struct { 440Sstevel@tonic-gate int t_flags; /* flags */ 450Sstevel@tonic-gate char t_ispeed, t_ospeed; /* speeds */ 460Sstevel@tonic-gate char t_erase; /* erase last character */ 470Sstevel@tonic-gate char t_kill; /* erase entire line */ 480Sstevel@tonic-gate char t_intrc; /* interrupt */ 490Sstevel@tonic-gate char t_quitc; /* quit */ 500Sstevel@tonic-gate char t_startc; /* start output */ 510Sstevel@tonic-gate char t_stopc; /* stop output */ 520Sstevel@tonic-gate char t_eofc; /* end-of-file */ 530Sstevel@tonic-gate char t_brkc; /* input delimiter (like nl) */ 540Sstevel@tonic-gate char t_suspc; /* stop process signal */ 550Sstevel@tonic-gate char t_dsuspc; /* delayed stop process signal */ 560Sstevel@tonic-gate char t_rprntc; /* reprint line */ 570Sstevel@tonic-gate char t_flushc; /* flush output (toggles) */ 580Sstevel@tonic-gate char t_werasc; /* word erase */ 590Sstevel@tonic-gate char t_lnextc; /* literal next character */ 600Sstevel@tonic-gate int t_xflags; /* XXX extended flags */ 610Sstevel@tonic-gate } compat_state_t; 620Sstevel@tonic-gate 630Sstevel@tonic-gate /* 640Sstevel@tonic-gate * Per-tty structure. 650Sstevel@tonic-gate */ 660Sstevel@tonic-gate typedef struct { 670Sstevel@tonic-gate mblk_t *t_iocpending; /* ioctl pending successful */ 680Sstevel@tonic-gate /* allocation */ 690Sstevel@tonic-gate compat_state_t t_curstate; /* current emulated state */ 700Sstevel@tonic-gate struct sgttyb t_new_sgttyb; /* new sgttyb from TIOCSET[PN] */ 710Sstevel@tonic-gate struct tchars t_new_tchars; /* new tchars from TIOCSETC */ 720Sstevel@tonic-gate struct ltchars t_new_ltchars; /* new ltchars from TIOCSLTC */ 730Sstevel@tonic-gate int t_new_lflags; /* new lflags from TIOCLSET/LBIS/LBIC */ 740Sstevel@tonic-gate int t_state; /* state bits */ 750Sstevel@tonic-gate int t_iocid; /* ID of "ioctl" we handle specially */ 760Sstevel@tonic-gate int t_ioccmd; /* ioctl code for that "ioctl" */ 770Sstevel@tonic-gate bufcall_id_t t_bufcallid; /* ID from qbufcall */ 780Sstevel@tonic-gate intptr_t t_arg; /* third argument to ioctl */ 790Sstevel@tonic-gate } ttcompat_state_t; 800Sstevel@tonic-gate 810Sstevel@tonic-gate 820Sstevel@tonic-gate #define TS_FREE 0x00 /* not in use */ 830Sstevel@tonic-gate #define TS_INUSE 0x01 /* allocated */ 840Sstevel@tonic-gate #define TS_W_IN 0x02 /* waiting for an M_IOCDATA response to an */ 850Sstevel@tonic-gate /* M_COPYIN request */ 860Sstevel@tonic-gate #define TS_W_OUT 0x04 /* waiting for an M_IOCDATA response to an */ 870Sstevel@tonic-gate /* M_COPYOUT request */ 880Sstevel@tonic-gate #define TS_IOCWAIT 0x08 /* waiting for an M_IOCACK/M_IOCNAK from downstream */ 89*8770SJordan.Vaughan@Sun.com #define TS_TIOCNAK 0x10 /* received a NAK in response to a ttcompat message */ 900Sstevel@tonic-gate 910Sstevel@tonic-gate #ifdef __cplusplus 920Sstevel@tonic-gate } 930Sstevel@tonic-gate #endif 940Sstevel@tonic-gate 950Sstevel@tonic-gate #endif /* _SYS_TTCOMPAT_H */ 96