4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _LIBRCM_IMPL_H
27 #define _LIBRCM_IMPL_H
29 #pragma ident "%Z%%M% %I% %E% SMI"
49 #include <sys/types.h>
51 #include <sys/param.h>
52 #include <sys/systeminfo.h>
56 * This file contains information private to librcm rcm_daemon.
58 #define RCM_DAEMON_START "/usr/lib/rcm/rcm_daemon"
59 #define RCM_SERVICE_DOOR "/var/run/rcm_daemon_door"
60 #define RCM_MODULE_SUFFIX "_rcm.so"
63 * flag fields supported by individual librcm interfaces
65 #define RCM_ALLOC_HDL_MASK (RCM_NOPID)
66 #define RCM_GET_INFO_MASK (RCM_INCLUDE_SUBTREE|RCM_INCLUDE_DEPENDENT|\
67 RCM_DR_OPERATION|RCM_MOD_INFO|RCM_FILESYS)
68 #define RCM_REGISTER_MASK (RCM_FILESYS|RCM_REGISTER_DR|\
69 RCM_REGISTER_EVENT|RCM_REGISTER_CAPACITY)
70 #define RCM_REQUEST_MASK (RCM_QUERY|RCM_SCOPE|RCM_FORCE|RCM_FILESYS|\
71 RCM_QUERY_CANCEL|RCM_RETIRE_REQUEST)
72 #define RCM_NOTIFY_MASK (RCM_FILESYS|RCM_RETIRE_NOTIFY)
74 /* event data names */
75 #define RCM_CMD "rcm.cmd"
76 #define RCM_RESULT "rcm.result"
77 #define RCM_RESULT_INFO "rcm.result_info"
78 #define RCM_RSRCNAMES "rcm.rsrcnames"
79 #define RCM_RSRCSTATE "rcm.rsrcstate"
80 #define RCM_CLIENT_ID "rcm.client_id"
81 #define RCM_CLIENT_INFO "rcm.client_info"
82 #define RCM_CLIENT_ERROR "rcm.client_error"
83 #define RCM_CLIENT_MODNAME "rcm.client_modname"
84 #define RCM_CLIENT_PROPERTIES "rcm.client_properties"
85 #define RCM_SEQ_NUM "rcm.seq_num"
86 #define RCM_REQUEST_FLAG "rcm.request_flag"
87 #define RCM_SUSPEND_INTERVAL "rcm.suspend_interval"
88 #define RCM_CHANGE_DATA "rcm.change_data"
89 #define RCM_EVENT_DATA "rcm.event_data"
92 * action commands shared by librcm and rcm_daemon
95 #define CMD_REGISTER 1
96 #define CMD_UNREGISTER 2
100 #define CMD_OFFLINE 6
104 #define CMD_REQUEST_CHANGE 10
105 #define CMD_NOTIFY_CHANGE 11
106 #define CMD_GETSTATE 12
109 * Ops vector for calling directly into daemon from RCM modules
112 int (*librcm_regis
)();
113 int (*librcm_unregis
)();
114 int (*librcm_getinfo
)();
115 int (*librcm_suspend
)();
116 int (*librcm_resume
)();
117 int (*librcm_offline
)();
118 int (*librcm_online
)();
119 int (*librcm_remove
)();
120 int (*librcm_request_change
)();
121 int (*librcm_notify_change
)();
122 int (*librcm_notify_event
)();
123 int (*librcm_getstate
)();
127 * rcm handle struture
133 librcm_ops_t
*lrcm_ops
;
134 struct module
*module
;
139 struct rcm_info
*next
;
143 * module utility routines
145 char *rcm_module_dir(uint_t
);
146 void *rcm_module_open(char *);
147 void rcm_module_close(void *);
150 * rcm scripting utility routines
152 char *rcm_script_dir(uint_t dirnum
);
153 char *rcm_dir(uint_t dirnum
, int *rcm_script
);
154 char *rcm_get_script_dir(char *script_name
);
155 int rcm_is_script(char *filename
);
162 #endif /* _LIBRCM_IMPL_H */