ttymux_impl.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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
* 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_IMPL_H
#define _TTYMUX_IMPL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Local definitions.
*/
extern uint_t sm_max_units;
#define MAX_LQS (sm_max_units)
/*
* Re-use minor device encoding used by the se(7D) driver.
*/
#define ASYNC_DEVICE (0)
#define NULL_PROTOCOL 0
#define ASYN_PROTOCOL 1
#define OUTD_PROTOCOL 2
/*
* Driver id
*/
#define SM_MOD_ID 0x534d
/*
* Access modes of the two halves to each others flags
* Q uq->flags lq->flags
* uq rw r
* lq - rw
*/
/*
* A lower queue is associated with an upper queue
* (used for synchronising dissasociate reqests with the lower half)
* A lower q will not forward messages if SM_UQVALID is set in uqflags.
*/
/*
* unused flags
*/
/*
* An open has completed on this stream.
*/
#define FULLY_OPEN (0x2)
#define EXCL_OPEN (0x4)
#define SM_CARON (0x8)
/*
* Flags to disable queues controlled from below.
*/
/* unset by M_UNHANGUP/M_ERROR) */
/*
* Flags to disable queues controlled from above.
* Also used by set on queues which are OBP consoles
*/
/*
* A stream wants something.
*/
#define WANT_CDSTAT (0xe00)
#define SM_IOCPENDING (0x80000)
#define SM_CLOSE (0x100000)
#define SM_INTERNALIOC (0x200000)
#define SM_LOGINREQ (0x400000)
/*
* Checks whether an open could potentially block.
*/
/*
* Update termios style control flag with a termio style flag.
*/
/*
*
*/
struct sm_iocinfo {
int sm_id;
int sm_cmd;
void *sm_data;
};
/*
* Perform a per instance search for a specified per stream structure.
*/
#define CNTRL(c) ((c)&037)
/*
* macro to improve performance. The cond is checked before deciding whether
* to create a new stack frame for the debug call
* Calls to sm_dbg should not occur in hanging statements - alternatively
* bracket SM_CMD with a do .... while (0)
*/
#define SM_SLOT_RED 3
#define SM_MAX_SLOT_WAIT 3
#define LQI2ASSOC(a, l) \
(a)->ttymux_linkid = (l)->sm_linkid; \
(a)->ttymux_tag = (l)->sm_tag; \
(a)->ttymux_ioflag = (l)->sm_ioflag; \
(a)->ttymux_ldev = (l)->sm_dev; \
#define LQI2ASSOC32(a, l) \
(a)->ttymux32_linkid = (l)->sm_linkid; \
(a)->ttymux32_ioflag = (l)->sm_ioflag; \
((void) cmpldev(&(a)->ttymux32_udev, \
(a)->ttymux32_udev); \
#define CNTRL(c) ((c)&037)
/*
* 32 bit eqivalents of structures defined in sys/ttymuxuser.h
*/
typedef struct ttymux_association32 {
/* the device type of a linked lower stream */
int ttymux32_linkid;
/* the linkid of a linked lower stream */
typedef struct ttymux_associations32 {
#ifdef __cplusplus
}
#endif
#endif /* _TTYMUX_IMPL_H */