dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / rcm_daemon / common / ttymux_rcm_impl.h
blob0e5dc707e39da5802e79ce564e688dc8d0041b03
1 /*
2 * CDDL HEADER START
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
7 * with the License.
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]
20 * CDDL HEADER END
23 * Copyright (c) 2001 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #ifndef _TTYMUX_RCM_IMPL_H
28 #define _TTYMUX_RCM_IMPL_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
36 #define _(x) gettext(x)
38 #define UNKNOWN 1 /* flags */
39 #define PRESENT 2 /* flags */
40 #define REGISTERED 4 /* flags */
41 #define CONNECTED 8 /* flags */
42 #define DISCONNECTED 0x10 /* flags */
44 /* RCM operations */
45 #define TTYMUX_OFFLINE 1
46 #define TTYMUX_ONLINE 2
47 #define TTYMUX_REMOVE 3
48 #define TTYMUX_SUSPEND 4
49 #define TTYMUX_RESUME 5
52 * Representation of a resource.
53 * All resources are placed in a cache structured as a doubly linked list
54 * (ie the next and prev fields).
55 * The dependencies list identifies which resources this resource is
56 * depending upon.
58 typedef struct rsrc {
59 char *id;
60 dev_t dev;
61 int flags;
62 struct rsrc *next;
63 struct rsrc *prev;
64 struct link *dependencies;
65 } rsrc_t;
68 * Representation of a pair of resources participating in a
69 * dependency relationship
70 * The dependency is cast in terms of a resource that is using
71 * another resource in order to provide a service.
72 * This structure is used to represent a ttymux minor node that
73 * has another serial device multiplexed under it. In this
74 * case user resource would correspond to the ttymux minor node and the
75 * the used resource would correspond to the multiplexed serial device.
76 * The linkid field refers to the STREAM's link identifier.
78 typedef struct link {
79 rsrc_t *user; /* the using resource */
80 rsrc_t *used; /* the used resource */
81 int linkid; /* STREAM's link identifier */
82 uint_t state;
83 int flags;
84 int (*connect)(struct link *);
85 int (*disconnect)(struct link *);
86 struct link *next;
87 } link_t;
89 #define MUXCTLLINK "/devices/multiplexer@0,0:ctl"
90 #define MUXCONLINK "/devices/multiplexer@0,0:con"
92 #ifdef __cplusplus
94 #endif
96 #endif /* _TTYMUX_RCM_IMPL_H */