17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*9d5056eaSjv227347 * Common Development and Distribution License (the "License"). 6*9d5056eaSjv227347 * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 22*9d5056eaSjv227347 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 277c478bd9Sstevel@tonic-gate /* All Rights Reserved */ 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate #ifndef _SYS_TTCOMPAT_H 307c478bd9Sstevel@tonic-gate #define _SYS_TTCOMPAT_H 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gate #ifdef __cplusplus 337c478bd9Sstevel@tonic-gate extern "C" { 347c478bd9Sstevel@tonic-gate #endif 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate /* 377c478bd9Sstevel@tonic-gate * BSD/XENIX/V7 ttcompat module header file 387c478bd9Sstevel@tonic-gate */ 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gate /* 417c478bd9Sstevel@tonic-gate * Old-style terminal state. 427c478bd9Sstevel@tonic-gate */ 437c478bd9Sstevel@tonic-gate typedef struct { 447c478bd9Sstevel@tonic-gate int t_flags; /* flags */ 457c478bd9Sstevel@tonic-gate char t_ispeed, t_ospeed; /* speeds */ 467c478bd9Sstevel@tonic-gate char t_erase; /* erase last character */ 477c478bd9Sstevel@tonic-gate char t_kill; /* erase entire line */ 487c478bd9Sstevel@tonic-gate char t_intrc; /* interrupt */ 497c478bd9Sstevel@tonic-gate char t_quitc; /* quit */ 507c478bd9Sstevel@tonic-gate char t_startc; /* start output */ 517c478bd9Sstevel@tonic-gate char t_stopc; /* stop output */ 527c478bd9Sstevel@tonic-gate char t_eofc; /* end-of-file */ 537c478bd9Sstevel@tonic-gate char t_brkc; /* input delimiter (like nl) */ 547c478bd9Sstevel@tonic-gate char t_suspc; /* stop process signal */ 557c478bd9Sstevel@tonic-gate char t_dsuspc; /* delayed stop process signal */ 567c478bd9Sstevel@tonic-gate char t_rprntc; /* reprint line */ 577c478bd9Sstevel@tonic-gate char t_flushc; /* flush output (toggles) */ 587c478bd9Sstevel@tonic-gate char t_werasc; /* word erase */ 597c478bd9Sstevel@tonic-gate char t_lnextc; /* literal next character */ 607c478bd9Sstevel@tonic-gate int t_xflags; /* XXX extended flags */ 617c478bd9Sstevel@tonic-gate } compat_state_t; 627c478bd9Sstevel@tonic-gate 637c478bd9Sstevel@tonic-gate /* 647c478bd9Sstevel@tonic-gate * Per-tty structure. 657c478bd9Sstevel@tonic-gate */ 667c478bd9Sstevel@tonic-gate typedef struct { 677c478bd9Sstevel@tonic-gate mblk_t *t_iocpending; /* ioctl pending successful */ 687c478bd9Sstevel@tonic-gate /* allocation */ 697c478bd9Sstevel@tonic-gate compat_state_t t_curstate; /* current emulated state */ 707c478bd9Sstevel@tonic-gate struct sgttyb t_new_sgttyb; /* new sgttyb from TIOCSET[PN] */ 717c478bd9Sstevel@tonic-gate struct tchars t_new_tchars; /* new tchars from TIOCSETC */ 727c478bd9Sstevel@tonic-gate struct ltchars t_new_ltchars; /* new ltchars from TIOCSLTC */ 737c478bd9Sstevel@tonic-gate int t_new_lflags; /* new lflags from TIOCLSET/LBIS/LBIC */ 747c478bd9Sstevel@tonic-gate int t_state; /* state bits */ 757c478bd9Sstevel@tonic-gate int t_iocid; /* ID of "ioctl" we handle specially */ 767c478bd9Sstevel@tonic-gate int t_ioccmd; /* ioctl code for that "ioctl" */ 777c478bd9Sstevel@tonic-gate bufcall_id_t t_bufcallid; /* ID from qbufcall */ 787c478bd9Sstevel@tonic-gate intptr_t t_arg; /* third argument to ioctl */ 797c478bd9Sstevel@tonic-gate } ttcompat_state_t; 807c478bd9Sstevel@tonic-gate 817c478bd9Sstevel@tonic-gate 827c478bd9Sstevel@tonic-gate #define TS_FREE 0x00 /* not in use */ 837c478bd9Sstevel@tonic-gate #define TS_INUSE 0x01 /* allocated */ 847c478bd9Sstevel@tonic-gate #define TS_W_IN 0x02 /* waiting for an M_IOCDATA response to an */ 857c478bd9Sstevel@tonic-gate /* M_COPYIN request */ 867c478bd9Sstevel@tonic-gate #define TS_W_OUT 0x04 /* waiting for an M_IOCDATA response to an */ 877c478bd9Sstevel@tonic-gate /* M_COPYOUT request */ 887c478bd9Sstevel@tonic-gate #define TS_IOCWAIT 0x08 /* waiting for an M_IOCACK/M_IOCNAK from downstream */ 89*9d5056eaSjv227347 #define TS_TIOCNAK 0x10 /* received a NAK in response to a ttcompat message */ 907c478bd9Sstevel@tonic-gate 917c478bd9Sstevel@tonic-gate #ifdef __cplusplus 927c478bd9Sstevel@tonic-gate } 937c478bd9Sstevel@tonic-gate #endif 947c478bd9Sstevel@tonic-gate 957c478bd9Sstevel@tonic-gate #endif /* _SYS_TTCOMPAT_H */ 96