xref: /illumos-gate/usr/src/lib/libdevice/libdevice.h (revision 1da57d55)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate #ifndef	_LIBDEVICE_H
28*7c478bd9Sstevel@tonic-gate #define	_LIBDEVICE_H
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate #include <sys/sunddi.h>
31*7c478bd9Sstevel@tonic-gate #include <sys/ddi_impldefs.h>
32*7c478bd9Sstevel@tonic-gate #include <sys/devctl.h>
33*7c478bd9Sstevel@tonic-gate 
34*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
35*7c478bd9Sstevel@tonic-gate extern "C" {
36*7c478bd9Sstevel@tonic-gate #endif
37*7c478bd9Sstevel@tonic-gate 
38*7c478bd9Sstevel@tonic-gate #define	DC_EXCL		0x01
39*7c478bd9Sstevel@tonic-gate #define	DC_RDONLY	0x02
40*7c478bd9Sstevel@tonic-gate 
41*7c478bd9Sstevel@tonic-gate typedef struct devctl_dummy_struct *devctl_hdl_t;
42*7c478bd9Sstevel@tonic-gate typedef struct devctl_dummy_ddef *devctl_ddef_t;
43*7c478bd9Sstevel@tonic-gate 
44*7c478bd9Sstevel@tonic-gate 
45*7c478bd9Sstevel@tonic-gate devctl_hdl_t
46*7c478bd9Sstevel@tonic-gate devctl_device_acquire(char *devfs_path, uint_t flags);
47*7c478bd9Sstevel@tonic-gate 
48*7c478bd9Sstevel@tonic-gate devctl_hdl_t
49*7c478bd9Sstevel@tonic-gate devctl_bus_acquire(char *devfs_path, uint_t flags);
50*7c478bd9Sstevel@tonic-gate 
51*7c478bd9Sstevel@tonic-gate devctl_hdl_t
52*7c478bd9Sstevel@tonic-gate devctl_ap_acquire(char *devfs_path, uint_t flags);
53*7c478bd9Sstevel@tonic-gate 
54*7c478bd9Sstevel@tonic-gate devctl_hdl_t
55*7c478bd9Sstevel@tonic-gate devctl_pm_dev_acquire(char *devfs_path, uint_t flags);
56*7c478bd9Sstevel@tonic-gate 
57*7c478bd9Sstevel@tonic-gate devctl_hdl_t
58*7c478bd9Sstevel@tonic-gate devctl_pm_bus_acquire(char *devfs_path, uint_t flags);
59*7c478bd9Sstevel@tonic-gate 
60*7c478bd9Sstevel@tonic-gate void
61*7c478bd9Sstevel@tonic-gate devctl_release(devctl_hdl_t hdl);
62*7c478bd9Sstevel@tonic-gate 
63*7c478bd9Sstevel@tonic-gate int
64*7c478bd9Sstevel@tonic-gate devctl_device_offline(devctl_hdl_t hdl);
65*7c478bd9Sstevel@tonic-gate 
66*7c478bd9Sstevel@tonic-gate int
67*7c478bd9Sstevel@tonic-gate devctl_device_remove(devctl_hdl_t hdl);
68*7c478bd9Sstevel@tonic-gate 
69*7c478bd9Sstevel@tonic-gate int
70*7c478bd9Sstevel@tonic-gate devctl_pm_raisepower(devctl_hdl_t hdl);
71*7c478bd9Sstevel@tonic-gate 
72*7c478bd9Sstevel@tonic-gate int
73*7c478bd9Sstevel@tonic-gate devctl_pm_changepowerlow(devctl_hdl_t hdl);
74*7c478bd9Sstevel@tonic-gate 
75*7c478bd9Sstevel@tonic-gate int
76*7c478bd9Sstevel@tonic-gate devctl_pm_changepowerhigh(devctl_hdl_t hdl);
77*7c478bd9Sstevel@tonic-gate 
78*7c478bd9Sstevel@tonic-gate int
79*7c478bd9Sstevel@tonic-gate devctl_pm_idlecomponent(devctl_hdl_t hdl);
80*7c478bd9Sstevel@tonic-gate 
81*7c478bd9Sstevel@tonic-gate int
82*7c478bd9Sstevel@tonic-gate devctl_pm_busycomponent(devctl_hdl_t hdl);
83*7c478bd9Sstevel@tonic-gate 
84*7c478bd9Sstevel@tonic-gate int
85*7c478bd9Sstevel@tonic-gate devctl_pm_testbusy(devctl_hdl_t hdl, uint_t *busyp);
86*7c478bd9Sstevel@tonic-gate 
87*7c478bd9Sstevel@tonic-gate int
88*7c478bd9Sstevel@tonic-gate devctl_pm_failsuspend(devctl_hdl_t hdl);
89*7c478bd9Sstevel@tonic-gate 
90*7c478bd9Sstevel@tonic-gate int
91*7c478bd9Sstevel@tonic-gate devctl_pm_bus_teststrict(devctl_hdl_t hdl, uint_t *strict);
92*7c478bd9Sstevel@tonic-gate 
93*7c478bd9Sstevel@tonic-gate int
94*7c478bd9Sstevel@tonic-gate devctl_pm_device_changeonresume(devctl_hdl_t hdl);
95*7c478bd9Sstevel@tonic-gate 
96*7c478bd9Sstevel@tonic-gate int
97*7c478bd9Sstevel@tonic-gate devctl_pm_device_no_lower_power(devctl_hdl_t hdl);
98*7c478bd9Sstevel@tonic-gate 
99*7c478bd9Sstevel@tonic-gate int
100*7c478bd9Sstevel@tonic-gate devctl_pm_bus_no_invol(devctl_hdl_t hdl);
101*7c478bd9Sstevel@tonic-gate 
102*7c478bd9Sstevel@tonic-gate int
103*7c478bd9Sstevel@tonic-gate devctl_pm_device_promprintf(devctl_hdl_t hdl);
104*7c478bd9Sstevel@tonic-gate 
105*7c478bd9Sstevel@tonic-gate int
106*7c478bd9Sstevel@tonic-gate devctl_device_online(devctl_hdl_t hdl);
107*7c478bd9Sstevel@tonic-gate 
108*7c478bd9Sstevel@tonic-gate int
109*7c478bd9Sstevel@tonic-gate devctl_device_reset(devctl_hdl_t hdl);
110*7c478bd9Sstevel@tonic-gate 
111*7c478bd9Sstevel@tonic-gate int
112*7c478bd9Sstevel@tonic-gate devctl_device_getstate(devctl_hdl_t hdl, uint_t *statep);
113*7c478bd9Sstevel@tonic-gate 
114*7c478bd9Sstevel@tonic-gate int
115*7c478bd9Sstevel@tonic-gate devctl_bus_quiesce(devctl_hdl_t hdl);
116*7c478bd9Sstevel@tonic-gate 
117*7c478bd9Sstevel@tonic-gate int
118*7c478bd9Sstevel@tonic-gate devctl_bus_unquiesce(devctl_hdl_t hdl);
119*7c478bd9Sstevel@tonic-gate 
120*7c478bd9Sstevel@tonic-gate int
121*7c478bd9Sstevel@tonic-gate devctl_bus_reset(devctl_hdl_t hdl);
122*7c478bd9Sstevel@tonic-gate 
123*7c478bd9Sstevel@tonic-gate int
124*7c478bd9Sstevel@tonic-gate devctl_bus_resetall(devctl_hdl_t hdl);
125*7c478bd9Sstevel@tonic-gate 
126*7c478bd9Sstevel@tonic-gate int
127*7c478bd9Sstevel@tonic-gate devctl_bus_getstate(devctl_hdl_t hdl, uint_t *statep);
128*7c478bd9Sstevel@tonic-gate 
129*7c478bd9Sstevel@tonic-gate int
130*7c478bd9Sstevel@tonic-gate devctl_bus_configure(devctl_hdl_t hdl);
131*7c478bd9Sstevel@tonic-gate 
132*7c478bd9Sstevel@tonic-gate int
133*7c478bd9Sstevel@tonic-gate devctl_bus_unconfigure(devctl_hdl_t hdl);
134*7c478bd9Sstevel@tonic-gate 
135*7c478bd9Sstevel@tonic-gate int
136*7c478bd9Sstevel@tonic-gate devctl_ap_insert(devctl_hdl_t, nvlist_t *);
137*7c478bd9Sstevel@tonic-gate 
138*7c478bd9Sstevel@tonic-gate int
139*7c478bd9Sstevel@tonic-gate devctl_ap_remove(devctl_hdl_t, nvlist_t *);
140*7c478bd9Sstevel@tonic-gate 
141*7c478bd9Sstevel@tonic-gate int
142*7c478bd9Sstevel@tonic-gate devctl_ap_connect(devctl_hdl_t, nvlist_t *);
143*7c478bd9Sstevel@tonic-gate 
144*7c478bd9Sstevel@tonic-gate int
145*7c478bd9Sstevel@tonic-gate devctl_ap_disconnect(devctl_hdl_t, nvlist_t *);
146*7c478bd9Sstevel@tonic-gate 
147*7c478bd9Sstevel@tonic-gate int
148*7c478bd9Sstevel@tonic-gate devctl_ap_configure(devctl_hdl_t, nvlist_t *);
149*7c478bd9Sstevel@tonic-gate 
150*7c478bd9Sstevel@tonic-gate int
151*7c478bd9Sstevel@tonic-gate devctl_ap_unconfigure(devctl_hdl_t, nvlist_t *);
152*7c478bd9Sstevel@tonic-gate 
153*7c478bd9Sstevel@tonic-gate int
154*7c478bd9Sstevel@tonic-gate devctl_ap_getstate(devctl_hdl_t, nvlist_t *, devctl_ap_state_t *);
155*7c478bd9Sstevel@tonic-gate 
156*7c478bd9Sstevel@tonic-gate devctl_ddef_t
157*7c478bd9Sstevel@tonic-gate devctl_ddef_alloc(char *, int);
158*7c478bd9Sstevel@tonic-gate 
159*7c478bd9Sstevel@tonic-gate void
160*7c478bd9Sstevel@tonic-gate devctl_ddef_free(devctl_ddef_t);
161*7c478bd9Sstevel@tonic-gate 
162*7c478bd9Sstevel@tonic-gate int
163*7c478bd9Sstevel@tonic-gate devctl_ddef_int(devctl_ddef_t, char *, int32_t);
164*7c478bd9Sstevel@tonic-gate 
165*7c478bd9Sstevel@tonic-gate int
166*7c478bd9Sstevel@tonic-gate devctl_ddef_int_array(devctl_ddef_t, char *, int, int32_t *);
167*7c478bd9Sstevel@tonic-gate 
168*7c478bd9Sstevel@tonic-gate int
169*7c478bd9Sstevel@tonic-gate devctl_ddef_string(devctl_ddef_t ddef_hdl, char *, char *);
170*7c478bd9Sstevel@tonic-gate 
171*7c478bd9Sstevel@tonic-gate int
172*7c478bd9Sstevel@tonic-gate devctl_ddef_string_array(devctl_ddef_t, char *, int, char **);
173*7c478bd9Sstevel@tonic-gate 
174*7c478bd9Sstevel@tonic-gate int
175*7c478bd9Sstevel@tonic-gate devctl_ddef_byte_array(devctl_ddef_t, char *, int, uchar_t *);
176*7c478bd9Sstevel@tonic-gate 
177*7c478bd9Sstevel@tonic-gate int
178*7c478bd9Sstevel@tonic-gate devctl_bus_dev_create(devctl_hdl_t, devctl_ddef_t, uint_t, devctl_hdl_t *);
179*7c478bd9Sstevel@tonic-gate 
180*7c478bd9Sstevel@tonic-gate char *
181*7c478bd9Sstevel@tonic-gate devctl_get_pathname(devctl_hdl_t, char *, size_t);
182*7c478bd9Sstevel@tonic-gate 
183*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
184*7c478bd9Sstevel@tonic-gate }
185*7c478bd9Sstevel@tonic-gate #endif
186*7c478bd9Sstevel@tonic-gate 
187*7c478bd9Sstevel@tonic-gate #endif	/* _LIBDEVICE_H */
188