4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
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.
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]
23 * Copyright (c) 2001 by Sun Microsystems, Inc.
24 * All rights reserved.
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <sys/types.h>
33 #include <sys/param.h>
34 #include <sys/termios.h>
40 #define TTYMUX_MOD_ID (0x540d) /* T^m */
41 #define TTYMUX_DRVNAME "ttymux"
43 #define TTYMUX_MAX_LINKS (16)
45 * Generic serial multiplexor ioctls.
47 #define _TTYMUXIOC (TTYMUX_MOD_ID<<8)
48 #define TTYMUX_ASSOC (_TTYMUXIOC | 1)
49 #define TTYMUX_DISASSOC (_TTYMUXIOC | 2)
50 #define TTYMUX_LIST (_TTYMUXIOC | 3)
51 #define TTYMUX_GETLINK (_TTYMUXIOC | 4)
53 * Ioctls for serial multiplexors acting as the system console.
55 #define TTYMUX_SETABORT (_TTYMUXIOC | 100)
56 #define TTYMUX_GETABORT (_TTYMUXIOC | 101)
57 #define TTYMUX_CONSDEV (_TTYMUXIOC | 102)
58 #define TTYMUX_GETABORTSTR (_TTYMUXIOC | 103)
59 #define TTYMUX_GETCONSOLES (_TTYMUXIOC | 104)
61 * Optional control ioctl.
63 #define TTYMUX_SETCTL (_TTYMUXIOC | 200)
64 #define TTYMUX_GETCTL (_TTYMUXIOC | 201)
66 typedef enum {FORINPUT
= 1, FOROUTPUT
= 2, FORIO
= 3} io_mode_t
;
69 * Create or destroy associations TTYMUX_ASSOC and TTYMUX_DISASSOC
71 #define AMSTAG (0x414d5354)
72 typedef struct ttymux_association
{
73 dev_t ttymux_udev
; /* the upper device to be associated */
74 /* the device type of a linked lower stream */
76 /* the linkid of a linked lower stream */
78 ulong_t ttymux_tag
; /* tagged association */
79 io_mode_t ttymux_ioflag
; /* FORINPUT FOROUTPUT FORIO */
80 /* OBP device path of ldev */
81 char ttymux_path
[MAXPATHLEN
];
85 * List all links known to a mux driver TTYMUX_LIST
86 * If the user ioctl arg is NULL the return value is the
87 * number of links in the driver (to facilitate the user
88 * allocating enough space for the link information.
89 * Otherwise the ioctl arg should point to the following
90 * structure. nlinks indicates how many entries the user
91 * has allocated in the array. The return value indicates the
92 * number of entries that have been filled in.
93 * EINVAL if nlinks is < 1
94 * EAGAIN if no resources.
96 typedef struct ttymux_associations
{
97 ulong_t ttymux_nlinks
;
98 ttymux_assoc_t
*ttymux_assocs
;
102 * Enable or disable aborting to the system monitor
103 * TTYMUX_SETABORT and TTYMUX_GETABORT
105 enum ttymux_break_type
{SOFTWARE_BREAK
, HARDWARE_BREAK
, SOFTHARD_BREAK
};
107 typedef struct ttymux_abort
{
108 /* apply request to this device */
110 enum ttymux_break_type ttymux_method
;
111 uint_t ttymux_enable
;
115 * Ioctl acknowledgement policies.
123 * Set or get the ioctl acknowledgement policy and masking of control bits
124 * TTYMUX_SETCTL and TTYMUX_GETCTL
127 struct ttymux_policy
{
128 dev_t ttymux_udev
; /* apply the request to this device */
129 /* determines the method used to ack M_IOCTLS */
131 tcflag_t ttymux_cmask
; /* never set these control bits */
138 #endif /* _TTYMUXUSER_H */