2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
29 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
36 #ifndef _IOKIT_IOPOWERCONNECTION_H
37 #define _IOKIT_IOPOWERCONNECTION_H
39 #include <IOKit/IOService.h>
40 #include <IOKit/pwr_mgt/IOPM.h>
42 class IOPowerConnection
: public IOService
44 OSDeclareDefaultStructors(IOPowerConnection
)
47 /*! @field parentKnowsState true: parent knows state of its domain
51 /*! @field currentPowerFlags power flags which describe the current state of the power domain
53 IOPMPowerFlags currentPowerFlags
;
55 /*! @field desiredDomainState state number which corresponds to the child's desire
57 unsigned long desiredDomainState
;
59 /*! @field requestFlag set to true when desiredDomainState is set */
62 /*! @field preventIdleSleepFlag true if child has this bit set in its desired state
64 unsigned long preventIdleSleepFlag
;
66 /*! @field preventSystemSleepFlag true if child has this bit set in its desired state
68 unsigned long preventSystemSleepFlag
;
70 /*! @field awaitingAck true if child has not yet acked our notification
74 /*! @field readyFlag true if the child has been added as a power child
78 #ifdef XNU_KERNEL_PRIVATE
80 bool delayChildNotification
;
84 /*! @function setParentKnowsState
85 @abstract Sets the stateKnown variable.
86 @discussion Called by the parent when the object is created and called by the child when it discovers that the parent now knows its state. */
87 void setParentKnowsState (bool );
89 /*! @function setParentCurrentPowerFlags
90 @abstract Sets the currentPowerFlags variable.
91 @discussion Called by the parent when the object is created and called by the child when it discovers that the parent state is changing. */
92 void setParentCurrentPowerFlags (IOPMPowerFlags
);
94 /*! @function parentKnowsState
95 @abstract Returns the stateKnown variable. */
96 bool parentKnowsState (void );
98 /*! @function parentCurrentPowerFlags
99 @abstract Returns the currentPowerFlags variable. */
100 IOPMPowerFlags
parentCurrentPowerFlags (void );
102 /*! @function setDesiredDomainState
103 @abstract Sets the desiredDomainState variable.
104 @discussion Called by the parent. */
105 void setDesiredDomainState (unsigned long );
107 /*! @function getDesiredDomainState
108 @abstract Returns the desiredDomainState variable.
109 @discussion Called by the parent. */
110 unsigned long getDesiredDomainState ( void );
112 /*! @function setChildHasRequestedPower
113 @abstract Set the flag that says that the child has called requestPowerDomainState.
114 @discussion Called by the parent. */
115 void setChildHasRequestedPower ( void );
117 /*! @function childHasRequestedPower
118 @abstract Return the flag that says whether the child has called requestPowerDomainState.
119 @discussion Called by the PCI Aux Power Supply Driver to see if a device driver
121 bool childHasRequestedPower ( void );
123 /*! @function setPreventIdleSleepFlag
124 @abstract Sets the preventIdleSleepFlag variable.
125 @discussion Called by the parent. */
126 void setPreventIdleSleepFlag (unsigned long );
128 /*! @function getPreventIdleSleepFlag
129 @abstract Returns the preventIdleSleepFlag variable.
130 @discussion Called by the parent. */
131 bool getPreventIdleSleepFlag ( void );
133 /*! @function setPreventSystemSleepFlag
134 @abstract Sets the preventSystemSleepFlag variable.
135 @discussion Called by the parent. */
136 void setPreventSystemSleepFlag (unsigned long );
138 /*! @function getPreventSystemSleepFlag
139 @abstract Returns the preventSystemSleepFlag variable.
140 @discussion Called by the parent. */
141 bool getPreventSystemSleepFlag ( void );
143 /*! @function setAwaitingAck
144 @abstract Sets the awaitingAck variable.
145 @discussion Called by the parent. */
146 void setAwaitingAck ( bool );
148 /*! @function getAwaitingAck
149 @abstract Returns the awaitingAck variable.
150 @discussion Called by the parent. */
151 bool getAwaitingAck ( void );
153 /*! @function setReadyFlag
154 @abstract Sets the readyFlag variable.
155 @discussion Called by the parent. */
156 void setReadyFlag( bool flag
);
158 /*! @function getReadyFlag
159 @abstract Returns the readyFlag variable.
160 @discussion Called by the parent. */
161 bool getReadyFlag( void ) const;
164 #endif /* ! _IOKIT_IOPOWERCONNECTION_H */