xref: /titanic_52/usr/src/lib/libdevice/llib-ldevice (revision 25cf1a301a396c38e8adf52c15f537b80d2483f7)
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/*
26 * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
27 * Use is subject to license terms.
28 */
29#pragma ident	"%Z%%M%	%I%	%E% SMI"
30
31#include <sys/types.h>
32#include "libdevice.h"
33
34/*
35 * usr/src/lib/libdevice
36 */
37
38/* devctl.c */
39devctl_hdl_t devctl_device_acquire(char *devfs_path, uint_t flags);
40devctl_hdl_t devctl_bus_acquire(char *devfs_path, uint_t flags);
41void devctl_release(devctl_hdl_t hdl);
42int devctl_pm_raisepower(devctl_hdl_t hdl);
43int devctl_pm_changepowerlow(devctl_hdl_t hdl);
44int devctl_pm_changepowerhigh(devctl_hdl_t hdl);
45int devctl_pm_idlecomponent(devctl_hdl_t hdl);
46int devctl_pm_busycomponent(devctl_hdl_t hdl);
47int devctl_pm_testbusy(devctl_hdl_t hdl, uint_t *busyp);
48int devctl_pm_failsuspend(devctl_hdl_t hdl);
49int devctl_pm_bus_teststrict(devctl_hdl_t hdl, uint_t *strict);
50int devctl_pm_device_changeonresume(devctl_hdl_t hdl);
51int devctl_pm_device_no_lower_power(devctl_hdl_t hdl);
52int devctl_pm_bus_no_invol(devctl_hdl_t hdl);
53int devctl_pm_device_promprintf(devctl_hdl_t hdl);
54int devctl_device_offline(devctl_hdl_t hdl);
55int devctl_device_online(devctl_hdl_t hdl);
56int devctl_device_reset(devctl_hdl_t hdl);
57int devctl_device_getstate(devctl_hdl_t hdl, uint_t *statep);
58int devctl_bus_quiesce(devctl_hdl_t hdl);
59int devctl_bus_unquiesce(devctl_hdl_t hdl);
60int devctl_bus_reset(devctl_hdl_t hdl);
61int devctl_bus_resetall(devctl_hdl_t hdl);
62int devctl_bus_getstate(devctl_hdl_t hdl, uint_t *statep);
63devctl_hdl_t devctl_ap_acquire(char *devfs_path, uint_t flags);
64devctl_hdl_t devctl_pm_dev_acquire(char *devfs_path, uint_t flags);
65devctl_hdl_t devctl_pm_bus_acquire(char *devfs_path, uint_t flags);
66int devctl_ap_insert(devctl_hdl_t hdl, nvlist_t *ap_data);
67int devctl_ap_remove(devctl_hdl_t hdl, nvlist_t *ap_data);
68int devctl_ap_connect(devctl_hdl_t hdl, nvlist_t *ap_data);
69int devctl_ap_disconnect(devctl_hdl_t hdl, nvlist_t *ap_data);
70int devctl_ap_configure(devctl_hdl_t hdl, nvlist_t *ap_data);
71int devctl_ap_unconfigure(devctl_hdl_t hdl, nvlist_t *ap_data);
72int devctl_ap_getstate(devctl_hdl_t hdl, nvlist_t *ap_data,
73    devctl_ap_state_t *statep);
74devctl_ddef_t devctl_ddef_alloc(char *, int);
75void devctl_ddef_free(devctl_ddef_t);
76int devctl_ddef_int(devctl_ddef_t, char *, int32_t);
77int devctl_ddef_int_array(devctl_ddef_t, char *, int, int32_t *value);
78int devctl_ddef_string(devctl_ddef_t ddef_hdl, char *name, char *value);
79int devctl_ddef_string_array(devctl_ddef_t, char *, int, char **);
80int devctl_ddef_byte_array(devctl_ddef_t, char *, int, uchar_t *value);
81int devctl_bus_dev_create(devctl_hdl_t, devctl_ddef_t, uint_t, devctl_hdl_t *);
82char *devctl_get_pathname(devctl_hdl_t, char *, size_t);
83