xref: /titanic_52/usr/src/lib/libdevice/libdevice.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate #include <sys/sunddi.h>
33*7c478bd9Sstevel@tonic-gate #include <sys/ddi_impldefs.h>
34*7c478bd9Sstevel@tonic-gate #include <sys/devctl.h>
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
37*7c478bd9Sstevel@tonic-gate extern "C" {
38*7c478bd9Sstevel@tonic-gate #endif
39*7c478bd9Sstevel@tonic-gate 
40*7c478bd9Sstevel@tonic-gate #define	DC_EXCL		0x01
41*7c478bd9Sstevel@tonic-gate #define	DC_RDONLY	0x02
42*7c478bd9Sstevel@tonic-gate 
43*7c478bd9Sstevel@tonic-gate typedef struct devctl_dummy_struct *devctl_hdl_t;
44*7c478bd9Sstevel@tonic-gate typedef struct devctl_dummy_ddef *devctl_ddef_t;
45*7c478bd9Sstevel@tonic-gate 
46*7c478bd9Sstevel@tonic-gate 
47*7c478bd9Sstevel@tonic-gate devctl_hdl_t
48*7c478bd9Sstevel@tonic-gate devctl_device_acquire(char *devfs_path, uint_t flags);
49*7c478bd9Sstevel@tonic-gate 
50*7c478bd9Sstevel@tonic-gate devctl_hdl_t
51*7c478bd9Sstevel@tonic-gate devctl_bus_acquire(char *devfs_path, uint_t flags);
52*7c478bd9Sstevel@tonic-gate 
53*7c478bd9Sstevel@tonic-gate devctl_hdl_t
54*7c478bd9Sstevel@tonic-gate devctl_ap_acquire(char *devfs_path, uint_t flags);
55*7c478bd9Sstevel@tonic-gate 
56*7c478bd9Sstevel@tonic-gate devctl_hdl_t
57*7c478bd9Sstevel@tonic-gate devctl_pm_dev_acquire(char *devfs_path, uint_t flags);
58*7c478bd9Sstevel@tonic-gate 
59*7c478bd9Sstevel@tonic-gate devctl_hdl_t
60*7c478bd9Sstevel@tonic-gate devctl_pm_bus_acquire(char *devfs_path, uint_t flags);
61*7c478bd9Sstevel@tonic-gate 
62*7c478bd9Sstevel@tonic-gate void
63*7c478bd9Sstevel@tonic-gate devctl_release(devctl_hdl_t hdl);
64*7c478bd9Sstevel@tonic-gate 
65*7c478bd9Sstevel@tonic-gate int
66*7c478bd9Sstevel@tonic-gate devctl_device_offline(devctl_hdl_t hdl);
67*7c478bd9Sstevel@tonic-gate 
68*7c478bd9Sstevel@tonic-gate int
69*7c478bd9Sstevel@tonic-gate devctl_device_remove(devctl_hdl_t hdl);
70*7c478bd9Sstevel@tonic-gate 
71*7c478bd9Sstevel@tonic-gate int
72*7c478bd9Sstevel@tonic-gate devctl_pm_raisepower(devctl_hdl_t hdl);
73*7c478bd9Sstevel@tonic-gate 
74*7c478bd9Sstevel@tonic-gate int
75*7c478bd9Sstevel@tonic-gate devctl_pm_changepowerlow(devctl_hdl_t hdl);
76*7c478bd9Sstevel@tonic-gate 
77*7c478bd9Sstevel@tonic-gate int
78*7c478bd9Sstevel@tonic-gate devctl_pm_changepowerhigh(devctl_hdl_t hdl);
79*7c478bd9Sstevel@tonic-gate 
80*7c478bd9Sstevel@tonic-gate int
81*7c478bd9Sstevel@tonic-gate devctl_pm_idlecomponent(devctl_hdl_t hdl);
82*7c478bd9Sstevel@tonic-gate 
83*7c478bd9Sstevel@tonic-gate int
84*7c478bd9Sstevel@tonic-gate devctl_pm_busycomponent(devctl_hdl_t hdl);
85*7c478bd9Sstevel@tonic-gate 
86*7c478bd9Sstevel@tonic-gate int
87*7c478bd9Sstevel@tonic-gate devctl_pm_testbusy(devctl_hdl_t hdl, uint_t *busyp);
88*7c478bd9Sstevel@tonic-gate 
89*7c478bd9Sstevel@tonic-gate int
90*7c478bd9Sstevel@tonic-gate devctl_pm_failsuspend(devctl_hdl_t hdl);
91*7c478bd9Sstevel@tonic-gate 
92*7c478bd9Sstevel@tonic-gate int
93*7c478bd9Sstevel@tonic-gate devctl_pm_bus_teststrict(devctl_hdl_t hdl, uint_t *strict);
94*7c478bd9Sstevel@tonic-gate 
95*7c478bd9Sstevel@tonic-gate int
96*7c478bd9Sstevel@tonic-gate devctl_pm_device_changeonresume(devctl_hdl_t hdl);
97*7c478bd9Sstevel@tonic-gate 
98*7c478bd9Sstevel@tonic-gate int
99*7c478bd9Sstevel@tonic-gate devctl_pm_device_no_lower_power(devctl_hdl_t hdl);
100*7c478bd9Sstevel@tonic-gate 
101*7c478bd9Sstevel@tonic-gate int
102*7c478bd9Sstevel@tonic-gate devctl_pm_bus_no_invol(devctl_hdl_t hdl);
103*7c478bd9Sstevel@tonic-gate 
104*7c478bd9Sstevel@tonic-gate int
105*7c478bd9Sstevel@tonic-gate devctl_pm_device_promprintf(devctl_hdl_t hdl);
106*7c478bd9Sstevel@tonic-gate 
107*7c478bd9Sstevel@tonic-gate int
108*7c478bd9Sstevel@tonic-gate devctl_device_online(devctl_hdl_t hdl);
109*7c478bd9Sstevel@tonic-gate 
110*7c478bd9Sstevel@tonic-gate int
111*7c478bd9Sstevel@tonic-gate devctl_device_reset(devctl_hdl_t hdl);
112*7c478bd9Sstevel@tonic-gate 
113*7c478bd9Sstevel@tonic-gate int
114*7c478bd9Sstevel@tonic-gate devctl_device_getstate(devctl_hdl_t hdl, uint_t *statep);
115*7c478bd9Sstevel@tonic-gate 
116*7c478bd9Sstevel@tonic-gate int
117*7c478bd9Sstevel@tonic-gate devctl_bus_quiesce(devctl_hdl_t hdl);
118*7c478bd9Sstevel@tonic-gate 
119*7c478bd9Sstevel@tonic-gate int
120*7c478bd9Sstevel@tonic-gate devctl_bus_unquiesce(devctl_hdl_t hdl);
121*7c478bd9Sstevel@tonic-gate 
122*7c478bd9Sstevel@tonic-gate int
123*7c478bd9Sstevel@tonic-gate devctl_bus_reset(devctl_hdl_t hdl);
124*7c478bd9Sstevel@tonic-gate 
125*7c478bd9Sstevel@tonic-gate int
126*7c478bd9Sstevel@tonic-gate devctl_bus_resetall(devctl_hdl_t hdl);
127*7c478bd9Sstevel@tonic-gate 
128*7c478bd9Sstevel@tonic-gate int
129*7c478bd9Sstevel@tonic-gate devctl_bus_getstate(devctl_hdl_t hdl, uint_t *statep);
130*7c478bd9Sstevel@tonic-gate 
131*7c478bd9Sstevel@tonic-gate int
132*7c478bd9Sstevel@tonic-gate devctl_bus_configure(devctl_hdl_t hdl);
133*7c478bd9Sstevel@tonic-gate 
134*7c478bd9Sstevel@tonic-gate int
135*7c478bd9Sstevel@tonic-gate devctl_bus_unconfigure(devctl_hdl_t hdl);
136*7c478bd9Sstevel@tonic-gate 
137*7c478bd9Sstevel@tonic-gate int
138*7c478bd9Sstevel@tonic-gate devctl_ap_insert(devctl_hdl_t, nvlist_t *);
139*7c478bd9Sstevel@tonic-gate 
140*7c478bd9Sstevel@tonic-gate int
141*7c478bd9Sstevel@tonic-gate devctl_ap_remove(devctl_hdl_t, nvlist_t *);
142*7c478bd9Sstevel@tonic-gate 
143*7c478bd9Sstevel@tonic-gate int
144*7c478bd9Sstevel@tonic-gate devctl_ap_connect(devctl_hdl_t, nvlist_t *);
145*7c478bd9Sstevel@tonic-gate 
146*7c478bd9Sstevel@tonic-gate int
147*7c478bd9Sstevel@tonic-gate devctl_ap_disconnect(devctl_hdl_t, nvlist_t *);
148*7c478bd9Sstevel@tonic-gate 
149*7c478bd9Sstevel@tonic-gate int
150*7c478bd9Sstevel@tonic-gate devctl_ap_configure(devctl_hdl_t, nvlist_t *);
151*7c478bd9Sstevel@tonic-gate 
152*7c478bd9Sstevel@tonic-gate int
153*7c478bd9Sstevel@tonic-gate devctl_ap_unconfigure(devctl_hdl_t, nvlist_t *);
154*7c478bd9Sstevel@tonic-gate 
155*7c478bd9Sstevel@tonic-gate int
156*7c478bd9Sstevel@tonic-gate devctl_ap_getstate(devctl_hdl_t, nvlist_t *, devctl_ap_state_t *);
157*7c478bd9Sstevel@tonic-gate 
158*7c478bd9Sstevel@tonic-gate devctl_ddef_t
159*7c478bd9Sstevel@tonic-gate devctl_ddef_alloc(char *, int);
160*7c478bd9Sstevel@tonic-gate 
161*7c478bd9Sstevel@tonic-gate void
162*7c478bd9Sstevel@tonic-gate devctl_ddef_free(devctl_ddef_t);
163*7c478bd9Sstevel@tonic-gate 
164*7c478bd9Sstevel@tonic-gate int
165*7c478bd9Sstevel@tonic-gate devctl_ddef_int(devctl_ddef_t, char *, int32_t);
166*7c478bd9Sstevel@tonic-gate 
167*7c478bd9Sstevel@tonic-gate int
168*7c478bd9Sstevel@tonic-gate devctl_ddef_int_array(devctl_ddef_t, char *, int, int32_t *);
169*7c478bd9Sstevel@tonic-gate 
170*7c478bd9Sstevel@tonic-gate int
171*7c478bd9Sstevel@tonic-gate devctl_ddef_string(devctl_ddef_t ddef_hdl, char *, char *);
172*7c478bd9Sstevel@tonic-gate 
173*7c478bd9Sstevel@tonic-gate int
174*7c478bd9Sstevel@tonic-gate devctl_ddef_string_array(devctl_ddef_t, char *, int, char **);
175*7c478bd9Sstevel@tonic-gate 
176*7c478bd9Sstevel@tonic-gate int
177*7c478bd9Sstevel@tonic-gate devctl_ddef_byte_array(devctl_ddef_t, char *, int, uchar_t *);
178*7c478bd9Sstevel@tonic-gate 
179*7c478bd9Sstevel@tonic-gate int
180*7c478bd9Sstevel@tonic-gate devctl_bus_dev_create(devctl_hdl_t, devctl_ddef_t, uint_t, devctl_hdl_t *);
181*7c478bd9Sstevel@tonic-gate 
182*7c478bd9Sstevel@tonic-gate char *
183*7c478bd9Sstevel@tonic-gate devctl_get_pathname(devctl_hdl_t, char *, size_t);
184*7c478bd9Sstevel@tonic-gate 
185*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
186*7c478bd9Sstevel@tonic-gate }
187*7c478bd9Sstevel@tonic-gate #endif
188*7c478bd9Sstevel@tonic-gate 
189*7c478bd9Sstevel@tonic-gate #endif	/* _LIBDEVICE_H */
190