diff options
Diffstat (limited to 'usr/src/uts/sun/sys')
| -rw-r--r-- | usr/src/uts/sun/sys/Makefile | 4 | ||||
| -rw-r--r-- | usr/src/uts/sun/sys/ttymux.h | 192 | ||||
| -rw-r--r-- | usr/src/uts/sun/sys/ttymuxuser.h | 138 |
3 files changed, 2 insertions, 332 deletions
diff --git a/usr/src/uts/sun/sys/Makefile b/usr/src/uts/sun/sys/Makefile index 778e8394f4..a85f7bae30 100644 --- a/usr/src/uts/sun/sys/Makefile +++ b/usr/src/uts/sun/sys/Makefile @@ -22,6 +22,7 @@ # # Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. +# Copyright 2019 Peter Tribble. # # include global definitions include ../../../Makefile.master @@ -36,7 +37,6 @@ promif.h promimpl.h \ ser_async.h ser_zscc.h \ socalio.h socalreg.h \ socal_cq_defs.h socalmap.h socalvar.h \ -ttymux.h ttymuxuser.h \ zsdev.h SCSIADHDRS= \ @@ -103,7 +103,7 @@ devops.check := CSTYLE_TAIL = | grep -v "line > 80 characters" | true $(ROOTSCSIADHDRS) $(ROOTSCSITARGHDRS) $(ROOTXHDRS) \ $(ROOTFCHDRS) -install_h: $(ROOTDIRS) .WAIT $(ROOTHDRS) \ +install_h: $(ROOTDIRS) .WAIT $(ROOTHDRS) \ $(ROOTAUDHDRS) $(ROOTAUDIMPLHDRS) \ $(ROOTSCSIADHDRS) $(ROOTSCSITARGHDRS) $(ROOTFCHDRS) diff --git a/usr/src/uts/sun/sys/ttymux.h b/usr/src/uts/sun/sys/ttymux.h deleted file mode 100644 index 56596a66dc..0000000000 --- a/usr/src/uts/sun/sys/ttymux.h +++ /dev/null @@ -1,192 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright (c) 2001 by Sun Microsystems, Inc. - * All rights reserved. - */ - -#ifndef _TTYMUX_H -#define _TTYMUX_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/obpdefs.h> -#include <sys/tty.h> -#include <sys/ttymuxuser.h> - -#ifdef __cplusplus -extern "C" { -#endif - -#define SM_MAX_ABSLEN 24 /* maximum length for the s/w abort sequence */ -#define SM_MIN_ABSLEN 2 - -#define SM_COPYIN 0x1 -#define SM_COPYOUT 0x2 - -typedef -struct sm_iocdata { - int sm_iocid; - int sm_nacks; /* number of responses expected */ - int sm_ackcnt; /* number of ACKs received */ - int sm_nakcnt; /* number of NAKs received */ - int sm_acnt; /* number of responses received */ - int sm_acked; /* has the message been acked (only one of them) */ - int sm_policy; /* which policy is used for acknowleding this ioctl */ - uint_t sm_flags; - /* indicates when copyin/out has been sent upstream */ - ulong_t sm_timeval; -} sm_iocdata_t; - -/* - * Each minor (refered to as a logical device) created by the multiplexor - * maps onto multiple real devices. - * I/O on a logical device is duplicated across multiple real devices. - * i.e. input from any of the real devices (identified by lqs) is funneled - * through the queue identified in the ttycommon field of a logical unit. - * output arriving on the queue identified in the ttycommon field of a logical - * unit is distributed to all real devices identified by lqs. - * - * When a logical unit is open there is a unique queue upstream (identified - * by ttycommon). - * When a real unit is open there is a unique lower queue to the h/w driver - * (identified by ttycommon). - * - * If the control lines on RS232 port for a physical unit are unknown and - * a request for their status has been issued then flags contains the bits - * TIOCM_PEND and tiocmgetid contains the id of the M_IOCTL streams message - * sent down the write queue to obtain the current status (placed in mbits). - */ -typedef -struct sm_uqi { - int sm_lunit; /* logical unit */ - int sm_protocol; /* in use for this protocol */ - uint_t sm_flags; /* flags */ - uint_t sm_mbits; /* consolidated status of modem lines */ - tcflag_t sm_cmask; /* ignore these control bits */ - uint_t sm_policy; /* ioctl response policy */ - struct sm_lqi *sm_lqs; /* lower queues mapped to this lunit */ - int sm_nlqs; - kmutex_t sm_umutex[1]; /* protects uflags */ - kcondvar_t sm_ucv[1]; /* waiting for uflags to change */ - bufcall_id_t sm_ttybid; /* ttycommon bufcall */ - dev_t sm_dev; /* currently attached device */ - int sm_nwaiters; /* no. of threads waiting for carrier */ - queue_t *sm_waitq; /* identity of blocked queue */ - tty_common_t sm_ttycommon[1]; - /* queue common data when is open */ - sm_iocdata_t sm_siocdata; /* active ioctl */ - sm_iocdata_t sm_piocdata; /* active private ioctl */ -} sm_uqi_t; - -typedef -struct sm_lqi { - struct sm_lqi *sm_nlqi; /* chain units together into lists */ - sm_uqi_t *sm_uqi; /* this lunit and uqi are associated */ - int sm_linkid; /* mux id for the link */ - uint64_t sm_tag; /* tag for the link */ - uint_t sm_flags; /* flags */ - uint_t sm_uqflags; /* written by an upper queue */ - io_mode_t sm_ioflag; /* input and/or output stream */ - int sm_ctrla_abort_on; - int sm_break_abort_on; - uint_t sm_mbits; /* status of the modem control lines */ - tcflag_t sm_cmask; /* ignore these control bits */ - mblk_t *sm_mp; /* mblk for next write */ - bufcall_id_t sm_bid; /* bufcall id */ - bufcall_id_t sm_ttybid; /* ttymodes changed bufcall */ - kmutex_t sm_umutex[1]; /* protects open code */ - kcondvar_t sm_ucv[1]; - dev_info_t *sm_dip; - dev_t sm_dev; - int sm_unit; - unsigned char *sm_hadkadbchar; - char *sm_nachar; - int sm_piocid; - tty_common_t sm_ttycommon[1]; - /* queue common data when open */ - char sm_path[MAXPATHLEN]; -} sm_lqi_t; - -/* - * This structure maintains the state of the console. - */ -typedef struct console { - dev_t sm_dev; /* the minor node of a console */ - int sm_muxid; /* STREAM's link identifier */ - io_mode_t sm_mode; /* I/O mode */ - boolean_t sm_obp_con; /* is it an OBP console */ - ihandle_t sm_i_ihdl; /* ihandle of the OBP input device */ - ihandle_t sm_o_ihdl; /* ihandle of the OBP output device */ - char *sm_path; /* device tree device path */ - char *sm_alias; /* device path alias */ -} sm_console_t; - -/* - * This structure contains the information for an open device. - * If an instance of it exists it is available as a named pointer: - */ -#define TTYMUXPTR "ttymuxconfig" - -typedef struct mux_state { - - /* protects ttymux configuration */ - kmutex_t sm_cons_mutex; - - /* Information about the standard I/O devices */ - sm_console_t sm_cons_stdin; - sm_console_t sm_cons_stdout; - - /* List of multiplexed serial consoles */ - uint_t sm_cons_cnt; - char *sm_ialias; - char *sm_oalias; - sm_console_t sm_cons_links[TTYMUX_MAX_LINKS]; - -} sm_mux_state_t; - -/* - * Driver instance private information. - */ -typedef -struct sm_ss -{ - dev_info_t *sm_dip; /* device tree information */ - uint_t sm_trflag; /* debug and information levels */ - sm_uqi_t *sm_lconsole; /* the current logical console */ - sm_mux_state_t *sm_ms; /* state associated with a console */ - - sm_lqi_t *sm_lqs; - sm_uqi_t *sm_uqs; - uint_t sm_break_abort_on; - uint_t sm_ctrla_abort_on; - - int sm_min_redundancy; - char sm_abs[SM_MAX_ABSLEN]; - -} sm_ss_t; - -#ifdef __cplusplus -} -#endif - -#endif /* _TTYMUX_H */ diff --git a/usr/src/uts/sun/sys/ttymuxuser.h b/usr/src/uts/sun/sys/ttymuxuser.h deleted file mode 100644 index deb0d7b2e8..0000000000 --- a/usr/src/uts/sun/sys/ttymuxuser.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright (c) 2001 by Sun Microsystems, Inc. - * All rights reserved. - */ - -#ifndef _TTYMUXUSER_H -#define _TTYMUXUSER_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/types.h> -#include <sys/param.h> -#include <sys/termios.h> - -#ifdef __cplusplus -extern "C" { -#endif - -#define TTYMUX_MOD_ID (0x540d) /* T^m */ -#define TTYMUX_DRVNAME "ttymux" - -#define TTYMUX_MAX_LINKS (16) -/* - * Generic serial multiplexor ioctls. - */ -#define _TTYMUXIOC (TTYMUX_MOD_ID<<8) -#define TTYMUX_ASSOC (_TTYMUXIOC | 1) -#define TTYMUX_DISASSOC (_TTYMUXIOC | 2) -#define TTYMUX_LIST (_TTYMUXIOC | 3) -#define TTYMUX_GETLINK (_TTYMUXIOC | 4) -/* - * Ioctls for serial multiplexors acting as the system console. - */ -#define TTYMUX_SETABORT (_TTYMUXIOC | 100) -#define TTYMUX_GETABORT (_TTYMUXIOC | 101) -#define TTYMUX_CONSDEV (_TTYMUXIOC | 102) -#define TTYMUX_GETABORTSTR (_TTYMUXIOC | 103) -#define TTYMUX_GETCONSOLES (_TTYMUXIOC | 104) -/* - * Optional control ioctl. - */ -#define TTYMUX_SETCTL (_TTYMUXIOC | 200) -#define TTYMUX_GETCTL (_TTYMUXIOC | 201) - -typedef enum {FORINPUT = 1, FOROUTPUT = 2, FORIO = 3} io_mode_t; - -/* - * Create or destroy associations TTYMUX_ASSOC and TTYMUX_DISASSOC - */ -#define AMSTAG (0x414d5354) -typedef struct ttymux_association { - dev_t ttymux_udev; /* the upper device to be associated */ - /* the device type of a linked lower stream */ - dev_t ttymux_ldev; - /* the linkid of a linked lower stream */ - int ttymux_linkid; - ulong_t ttymux_tag; /* tagged association */ - io_mode_t ttymux_ioflag; /* FORINPUT FOROUTPUT FORIO */ - /* OBP device path of ldev */ - char ttymux_path[MAXPATHLEN]; -} ttymux_assoc_t; - -/* - * List all links known to a mux driver TTYMUX_LIST - * If the user ioctl arg is NULL the return value is the - * number of links in the driver (to facilitate the user - * allocating enough space for the link information. - * Otherwise the ioctl arg should point to the following - * structure. nlinks indicates how many entries the user - * has allocated in the array. The return value indicates the - * number of entries that have been filled in. - * EINVAL if nlinks is < 1 - * EAGAIN if no resources. - */ -typedef struct ttymux_associations { - ulong_t ttymux_nlinks; - ttymux_assoc_t *ttymux_assocs; -} ttymux_assocs_t; - -/* - * Enable or disable aborting to the system monitor - * TTYMUX_SETABORT and TTYMUX_GETABORT - */ -enum ttymux_break_type {SOFTWARE_BREAK, HARDWARE_BREAK, SOFTHARD_BREAK}; - -typedef struct ttymux_abort { - /* apply request to this device */ - dev_t ttymux_ldev; - enum ttymux_break_type ttymux_method; - uint_t ttymux_enable; -} ttymux_abort_t; - -/* - * Ioctl acknowledgement policies. - */ -#define FIRSTACK 0 -#define LASTACK 1 -#define CONSENSUS 2 -#define PERIOCTL 3 - -/* - * Set or get the ioctl acknowledgement policy and masking of control bits - * TTYMUX_SETCTL and TTYMUX_GETCTL - */ - -struct ttymux_policy { - dev_t ttymux_udev; /* apply the request to this device */ - /* determines the method used to ack M_IOCTLS */ - int ttymux_policy; - tcflag_t ttymux_cmask; /* never set these control bits */ -}; - -#ifdef __cplusplus -} -#endif - -#endif /* _TTYMUXUSER_H */ |
