8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * Copyright 1989-2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /*
28 * Pseudo-tty driver data structures.
29 */
30
31 #ifndef _SYS_PTYVAR_H
32 #define _SYS_PTYVAR_H
33
34 #pragma ident "%Z%%M% %I% %E% SMI"
35
36 #include <sys/tty.h>
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42 struct pty {
43 int pt_flags; /* flag bits */
44 mblk_t *pt_stuffqfirst; /* head of queue for ioctls */
45 mblk_t *pt_stuffqlast; /* tail of queue for ioctls */
46 int pt_stuffqlen; /* number of bytes of queued ioctls */
47 tty_common_t pt_ttycommon; /* data common to all tty drivers */
48 bufcall_id_t pt_wbufcid; /* id of pending write-side bufcall */
49 struct proc *pt_selr; /* proc selecting on controller read */
50 struct proc *pt_selw; /* proc selecting on controller write */
51 struct proc *pt_sele; /* proc selecting on exception */
52 dev_t pt_sdev; /* XXX dev no for the slave */
53 struct vnode *pt_vnode; /* XXX vnode for the slave */
54 short pt_pgrp; /* controller side process group */
55 uchar_t pt_send; /* pending message to controller */
56 uchar_t pt_ucntl; /* pending iocontrol for controller */
57 kmutex_t ptc_lock; /* per pty mutex lock */
58 kcondvar_t pt_cv_flags; /* condition variable for flag state */
59 kcondvar_t pt_cv_readq; /* condition variable for read state */
60 kcondvar_t pt_cv_writeq; /* condition variable for write state */
61 };
62
63 #define PF_RCOLL 0x00000001 /* > 1 process selecting for read */
64 #define PF_WCOLL 0x00000002 /* > 1 process selecting for write */
65 #define PF_ECOLL 0x00000004 /* > 1 process selecting for excep. */
66 #define PF_NBIO 0x00000008 /* non-blocking I/O on controller */
67 #define PF_ASYNC 0x00000010 /* asynchronous I/O on controller */
68 #define PF_WOPEN 0x00000020 /* waiting for open to complete */
69 #define PF_CARR_ON 0x00000040 /* "carrier" is on (cntlr. is open) */
70 #define PF_SLAVEGONE 0x00000080 /* slave was open, but is now closed */
71 #define PF_PKT 0x00000100 /* packet mode */
72 #define PF_STOPPED 0x00000200 /* user told stopped */
73 #define PF_REMOTE 0x00000400 /* remote and flow controlled input */
74 #define PF_NOSTOP 0x00000800 /* slave is doing XON/XOFF */
75 #define PF_UCNTL 0x00001000 /* user control mode */
76 #define PF_43UCNTL 0x00002000 /* real 4.3 user control mode */
77 #define PF_IOCTL 0x00004000 /* ioctl call in progress */
78 #define PF_WAIT 0x00008000 /* wait in close */
79 #define PF_READ 0x00010000 /* serialise read */
80 #define PF_WRITE 0x00020000 /* serialise write */
81 #define PF_WREAD 0x00040000 /* want to read */
82 #define PF_WWRITE 0x00080000 /* want to write */
83
84 /*
85 * M_CTL message types.
86 */
87 #define MC_NOCANON 0 /* module below saying it will canonicalize */
88 #define MC_DOCANON 1 /* module below saying it won't canonicalize */
89 #define MC_CANONQUERY 2 /* module above asking whether module below */
90 /* canonicalizes */
91 #define MC_SERVICEIMM 3 /* tell the ZS driver to return input */
92 /* immediately */
93 #define MC_SERVICEDEF 4 /* tell the ZS driver it can wait */
94 #define MC_NOIFLAG 5 /* module below saying don't do i flags */
|
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * Copyright 1989-2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /*
28 * Pseudo-terminal driver data structures.
29 */
30
31 #ifndef _SYS_PTYVAR_H
32 #define _SYS_PTYVAR_H
33
34 #include <sys/tty.h>
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 struct pty {
41 int pt_flags; /* flag bits */
42 mblk_t *pt_stuffqfirst; /* head of queue for ioctls */
43 mblk_t *pt_stuffqlast; /* tail of queue for ioctls */
44 int pt_stuffqlen; /* number of bytes of queued ioctls */
45 tty_common_t pt_ttycommon; /* data common to all tty drivers */
46 bufcall_id_t pt_wbufcid; /* id of pending write-side bufcall */
47 struct proc *pt_selr; /* proc selecting on controller read */
48 struct proc *pt_selw; /* proc selecting on controller write */
49 struct proc *pt_sele; /* proc selecting on exception */
50 dev_t pt_sdev; /* XXX dev no for the subsidiary */
51 struct vnode *pt_vnode; /* XXX vnode for the subsidiary */
52 short pt_pgrp; /* controller side process group */
53 uchar_t pt_send; /* pending message to controller */
54 uchar_t pt_ucntl; /* pending iocontrol for controller */
55 kmutex_t ptc_lock; /* per pty mutex lock */
56 kcondvar_t pt_cv_flags; /* condition variable for flag state */
57 kcondvar_t pt_cv_readq; /* condition variable for read state */
58 kcondvar_t pt_cv_writeq; /* condition variable for write state */
59 };
60
61 #define PF_RCOLL 0x00000001 /* > 1 process selecting for read */
62 #define PF_WCOLL 0x00000002 /* > 1 process selecting for write */
63 #define PF_ECOLL 0x00000004 /* > 1 process selecting for excep. */
64 #define PF_NBIO 0x00000008 /* non-blocking I/O on controller */
65 #define PF_ASYNC 0x00000010 /* asynchronous I/O on controller */
66 #define PF_WOPEN 0x00000020 /* waiting for open to complete */
67 #define PF_CARR_ON 0x00000040 /* "carrier" is on (cntlr. is open) */
68 #define PF_SUBSIDGONE 0x00000080 /* subsidiary was open, now closed */
69 #define PF_PKT 0x00000100 /* packet mode */
70 #define PF_STOPPED 0x00000200 /* user told stopped */
71 #define PF_REMOTE 0x00000400 /* remote and flow controlled input */
72 #define PF_NOSTOP 0x00000800 /* subsidiary is doing XON/XOFF */
73 #define PF_UCNTL 0x00001000 /* user control mode */
74 #define PF_43UCNTL 0x00002000 /* real 4.3 user control mode */
75 #define PF_IOCTL 0x00004000 /* ioctl call in progress */
76 #define PF_WAIT 0x00008000 /* wait in close */
77 #define PF_READ 0x00010000 /* serialise read */
78 #define PF_WRITE 0x00020000 /* serialise write */
79 #define PF_WREAD 0x00040000 /* want to read */
80 #define PF_WWRITE 0x00080000 /* want to write */
81
82 /*
83 * M_CTL message types.
84 */
85 #define MC_NOCANON 0 /* module below saying it will canonicalize */
86 #define MC_DOCANON 1 /* module below saying it won't canonicalize */
87 #define MC_CANONQUERY 2 /* module above asking whether module below */
88 /* canonicalizes */
89 #define MC_SERVICEIMM 3 /* tell the ZS driver to return input */
90 /* immediately */
91 #define MC_SERVICEDEF 4 /* tell the ZS driver it can wait */
92 #define MC_NOIFLAG 5 /* module below saying don't do i flags */
|