Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / pm_busy_component.9f
blob0221e06fac16f68fb0a2b6102c61ffe9735f291b
1 '\" te
2 .\" Copyright (c) 2004, Sun Microsystems, Inc.,  All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH PM_BUSY_COMPONENT 9F "Jul 21, 2004"
7 .SH NAME
8 pm_busy_component, pm_idle_component \- control device component availability
9 for Power Management
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/ddi.h>
14 #include <sys/sunddi.h>
18 \fBint\fR \fBpm_busy_component\fR(\fBdev_info_t\fR \fI*dip\fR, \fBint\fR \fIcomponent\fR);
19 .fi
21 .LP
22 .nf
23 \fBint\fR \fBpm_idle_component\fR(\fBdev_info_t\fR \fI*dip\fR, \fBint\fR \fIcomponent\fR);
24 .fi
26 .SH INTERFACE LEVEL
27 .sp
28 .LP
29 Solaris DDI specific (Solaris DDI)
30 .SH PARAMETERS
31 .sp
32 .ne 2
33 .na
34 \fB\fIdip\fR\fR
35 .ad
36 .RS 13n
37 Pointer to the device's \fBdev_info\fR structure.
38 .RE
40 .sp
41 .ne 2
42 .na
43 \fB\fIcomponent\fR\fR
44 .ad
45 .RS 13n
46 The number of the component to be power-managed.
47 .RE
49 .SH DESCRIPTION
50 .sp
51 .LP
52 The \fBpm_busy_component()\fR function sets \fIcomponent\fR of \fIdip\fR to be
53 busy. Calls to \fBpm_busy_component()\fR are stacked, requiring a corresponding
54 number of calls to \fBpm_idle_component()\fR to make the component idle again.
55 When a device is busy it will not be power-managed by the system.
56 .sp
57 .LP
58 The \fBpm_idle_component()\fR function marks \fIcomponent\fR idle, recording
59 the time that \fIcomponent\fR went idle. This function must be called once for
60 each call to \fBpm_busy_component()\fR. A component which is idle is available
61 to be power-managed by the system. The \fBpm_idle_component()\fR function has
62 no effect if the component is already idle, except to update the system's
63 notion of when the device went idle.
64 .sp
65 .LP
66 If these functions are called as a result of entry into the driver's
67 \fBattach\fR(9E), \fBdetach\fR(9E) or \fBpower\fR(9E) entry point, these
68 functions must be called from the same thread which entered \fBattach\fR(9E),
69 \fBdetach\fR(9E) or \fBpower\fR(9E).
70 .SH RETURN VALUES
71 .sp
72 .LP
73 The \fBpm_busy_component()\fR and \fBpm_idle_component()\fR functions return:
74 .sp
75 .ne 2
76 .na
77 \fB\fBDDI_SUCCESS\fR\fR
78 .ad
79 .RS 15n
80 Successfully set the indicated component busy or idle.
81 .RE
83 .sp
84 .ne 2
85 .na
86 \fB\fBDDI_FAILURE\fR\fR
87 .ad
88 .RS 15n
89 Invalid component number \fIcomponent\fR or the device has no components.
90 .RE
92 .SH CONTEXT
93 .sp
94 .LP
95 These functions can be called from user or kernel context. These functions may
96 also be called from interrupt context, providing they are not the first Power
97 Management function called by the driver.
98 .SH ATTRIBUTES
99 .sp
101 See \fBattributes\fR(5) for descriptions of the following attributes:
106 box;
107 c | c
108 l | l .
109 ATTRIBUTE TYPE  ATTRIBUTE VALUE
111 Interface stability     Committed
114 .SH SEE ALSO
117 \fBpower.conf\fR(4), \fBpm\fR(7D), \fBattach\fR(9E), \fBdetach\fR(9E),
118 \fBpower\fR(9E), \fBpm_raise_power\fR(9F), \fBpm\fR(9P),
119 \fBpm-components\fR(9P)
122 \fIWriting Device Drivers\fR