xref: /titanic_52/usr/src/lib/librcm/llib-lrcm (revision 2f172c55ef76964744bc62b4500ece87f3089b4d)
1/*
2 * CDDL HEADER START
3 *
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.
8 *
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.
13 *
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]
19 *
20 * CDDL HEADER END
21 */
22/*LINTLIBRARY*/
23/*PROTOLIB1*/
24/*
25 * Copyright 1999-2000, 2003 Sun Microsystems, Inc.  All rights reserved.
26 * Use is subject to license terms.
27 *
28 * usr/src/lib/librcm/llib-ldevinfo
29 */
30
31#pragma ident	"%Z%%M%	%I%	%E% SMI"
32
33#include "librcm.h"
34#include "librcm_event.h"
35
36/* librcm interfaces */
37
38int rcm_get_handle(char *, uint_t, void *, rcm_handle_t **);
39int rcm_free_handle(rcm_handle_t *);
40int rcm_get_info(rcm_handle_t *, char *, uint_t, rcm_info_t **);
41int rcm_get_rsrcstate(rcm_handle_t *, char *, int *);
42void rcm_free_info(rcm_info_t *);
43int rcm_append_info(rcm_info_t **, rcm_info_t *);
44rcm_info_tuple_t *rcm_info_next(rcm_info_t *, rcm_info_tuple_t *);
45const char *rcm_info_rsrc(rcm_info_tuple_t *);
46const char *rcm_info_info(rcm_info_tuple_t *);
47const char *rcm_info_modname(rcm_info_tuple_t *);
48const char *rcm_info_error(rcm_info_tuple_t *);
49pid_t rcm_info_pid(rcm_info_tuple_t *);
50int rcm_info_state(rcm_info_tuple_t *);
51int rcm_info_seqnum(rcm_info_tuple_t *);
52nvlist_t *rcm_info_properties(rcm_info_tuple_t *);
53int rcm_request_offline(rcm_handle_t *, char *, uint_t, rcm_info_t **);
54int rcm_request_offline_list(rcm_handle_t *, char **, uint_t, rcm_info_t **);
55int rcm_notify_online(rcm_handle_t *, char *, uint_t, rcm_info_t **);
56int rcm_notify_online_list(rcm_handle_t *, char **, uint_t, rcm_info_t **);
57int rcm_notify_remove(rcm_handle_t *, char *, uint_t, rcm_info_t **);
58int rcm_notify_remove_list(rcm_handle_t *, char **, uint_t, rcm_info_t **);
59int rcm_request_suspend(rcm_handle_t *, char *, uint_t, timespec_t *,
60    rcm_info_t **);
61int rcm_request_suspend_list(rcm_handle_t *, char **, uint_t, timespec_t *,
62    rcm_info_t **);
63int rcm_notify_resume(rcm_handle_t *, char *, uint_t, rcm_info_t **);
64int rcm_notify_resume_list(rcm_handle_t *, char **, uint_t, rcm_info_t **);
65int rcm_notify_event(rcm_handle_t *, char *, uint_t, nvlist_t *, rcm_info_t **);
66int rcm_register_event(rcm_handle_t *, char *, uint_t, rcm_info_t **);
67int rcm_unregister_event(rcm_handle_t *, char *, uint_t);
68int rcm_register_capacity(rcm_handle_t *, char *, uint_t, rcm_info_t **);
69int rcm_unregister_capacity(rcm_handle_t *, char *, uint_t);
70int rcm_register_interest(rcm_handle_t *, char *, uint_t, rcm_info_t **);
71int rcm_unregister_interest(rcm_handle_t *, char *, uint_t);
72int rcm_exec_cmd(char *);
73char *rcm_module_dir(uint_t);
74void *rcm_module_open(char *);
75void rcm_module_close(void *);
76const char *rcm_get_client_name(rcm_handle_t *);
77
78char *rcm_script_dir(uint_t);
79char *rcm_dir(uint_t, int *);
80char *rcm_get_script_dir(char *);
81int rcm_is_script(char *);
82
83/* event related interfaces */
84
85int get_event_service(char *, void *, size_t, void **, size_t *);
86int create_event_service(char *, void (*)(void **, size_t *));
87int revoke_event_service(int);
88