8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / rcm_daemon / common / ttymux_rcm_impl.h
blobe1ae3acfb8941cce35c5074527c63dfdad879477
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 #ifndef lint
37 #define _(x) gettext(x)
38 #else
39 #define _(x) x
40 #endif
42 #define UNKNOWN 1 /* flags */
43 #define PRESENT 2 /* flags */
44 #define REGISTERED 4 /* flags */
45 #define CONNECTED 8 /* flags */
46 #define DISCONNECTED 0x10 /* flags */
48 /* RCM operations */
49 #define TTYMUX_OFFLINE 1
50 #define TTYMUX_ONLINE 2
51 #define TTYMUX_REMOVE 3
52 #define TTYMUX_SUSPEND 4
53 #define TTYMUX_RESUME 5
56 * Representation of a resource.
57 * All resources are placed in a cache structured as a doubly linked list
58 * (ie the next and prev fields).
59 * The dependencies list identifies which resources this resource is
60 * depending upon.
62 typedef struct rsrc {
63 char *id;
64 dev_t dev;
65 int flags;
66 struct rsrc *next;
67 struct rsrc *prev;
68 struct link *dependencies;
69 } rsrc_t;
72 * Representation of a pair of resources participating in a
73 * dependency relationship
74 * The dependency is cast in terms of a resource that is using
75 * another resource in order to provide a service.
76 * This structure is used to represent a ttymux minor node that
77 * has another serial device multiplexed under it. In this
78 * case user resource would correspond to the ttymux minor node and the
79 * the used resource would correspond to the multiplexed serial device.
80 * The linkid field refers to the STREAM's link identifier.
82 typedef struct link {
83 rsrc_t *user; /* the using resource */
84 rsrc_t *used; /* the used resource */
85 int linkid; /* STREAM's link identifier */
86 uint_t state;
87 int flags;
88 int (*connect)(struct link *);
89 int (*disconnect)(struct link *);
90 struct link *next;
91 } link_t;
93 #define MUXCTLLINK "/devices/multiplexer@0,0:ctl"
94 #define MUXCONLINK "/devices/multiplexer@0,0:con"
96 #ifdef __cplusplus
98 #endif
100 #endif /* _TTYMUX_RCM_IMPL_H */