8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / lib / libdevice / libdevice.h
blob22a8ab1028736210e1cd61ba9ca35d60f64e2bf1
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 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _LIBDEVICE_H
28 #define _LIBDEVICE_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <sys/sunddi.h>
33 #include <sys/ddi_impldefs.h>
34 #include <sys/devctl.h>
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
40 #define DC_EXCL 0x01
41 #define DC_RDONLY 0x02
43 typedef struct devctl_dummy_struct *devctl_hdl_t;
44 typedef struct devctl_dummy_ddef *devctl_ddef_t;
47 devctl_hdl_t
48 devctl_device_acquire(char *devfs_path, uint_t flags);
50 devctl_hdl_t
51 devctl_bus_acquire(char *devfs_path, uint_t flags);
53 devctl_hdl_t
54 devctl_ap_acquire(char *devfs_path, uint_t flags);
56 devctl_hdl_t
57 devctl_pm_dev_acquire(char *devfs_path, uint_t flags);
59 devctl_hdl_t
60 devctl_pm_bus_acquire(char *devfs_path, uint_t flags);
62 void
63 devctl_release(devctl_hdl_t hdl);
65 int
66 devctl_device_offline(devctl_hdl_t hdl);
68 int
69 devctl_device_remove(devctl_hdl_t hdl);
71 int
72 devctl_pm_raisepower(devctl_hdl_t hdl);
74 int
75 devctl_pm_changepowerlow(devctl_hdl_t hdl);
77 int
78 devctl_pm_changepowerhigh(devctl_hdl_t hdl);
80 int
81 devctl_pm_idlecomponent(devctl_hdl_t hdl);
83 int
84 devctl_pm_busycomponent(devctl_hdl_t hdl);
86 int
87 devctl_pm_testbusy(devctl_hdl_t hdl, uint_t *busyp);
89 int
90 devctl_pm_failsuspend(devctl_hdl_t hdl);
92 int
93 devctl_pm_bus_teststrict(devctl_hdl_t hdl, uint_t *strict);
95 int
96 devctl_pm_device_changeonresume(devctl_hdl_t hdl);
98 int
99 devctl_pm_device_no_lower_power(devctl_hdl_t hdl);
102 devctl_pm_bus_no_invol(devctl_hdl_t hdl);
105 devctl_pm_device_promprintf(devctl_hdl_t hdl);
108 devctl_device_online(devctl_hdl_t hdl);
111 devctl_device_reset(devctl_hdl_t hdl);
114 devctl_device_getstate(devctl_hdl_t hdl, uint_t *statep);
117 devctl_bus_quiesce(devctl_hdl_t hdl);
120 devctl_bus_unquiesce(devctl_hdl_t hdl);
123 devctl_bus_reset(devctl_hdl_t hdl);
126 devctl_bus_resetall(devctl_hdl_t hdl);
129 devctl_bus_getstate(devctl_hdl_t hdl, uint_t *statep);
132 devctl_bus_configure(devctl_hdl_t hdl);
135 devctl_bus_unconfigure(devctl_hdl_t hdl);
138 devctl_ap_insert(devctl_hdl_t, nvlist_t *);
141 devctl_ap_remove(devctl_hdl_t, nvlist_t *);
144 devctl_ap_connect(devctl_hdl_t, nvlist_t *);
147 devctl_ap_disconnect(devctl_hdl_t, nvlist_t *);
150 devctl_ap_configure(devctl_hdl_t, nvlist_t *);
153 devctl_ap_unconfigure(devctl_hdl_t, nvlist_t *);
156 devctl_ap_getstate(devctl_hdl_t, nvlist_t *, devctl_ap_state_t *);
158 devctl_ddef_t
159 devctl_ddef_alloc(char *, int);
161 void
162 devctl_ddef_free(devctl_ddef_t);
165 devctl_ddef_int(devctl_ddef_t, char *, int32_t);
168 devctl_ddef_int_array(devctl_ddef_t, char *, int, int32_t *);
171 devctl_ddef_string(devctl_ddef_t ddef_hdl, char *, char *);
174 devctl_ddef_string_array(devctl_ddef_t, char *, int, char **);
177 devctl_ddef_byte_array(devctl_ddef_t, char *, int, uchar_t *);
180 devctl_bus_dev_create(devctl_hdl_t, devctl_ddef_t, uint_t, devctl_hdl_t *);
182 char *
183 devctl_get_pathname(devctl_hdl_t, char *, size_t);
185 #ifdef __cplusplus
187 #endif
189 #endif /* _LIBDEVICE_H */