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
50 /*! @field currentPowerFlags power flags which describe the current state of the power domain
52 IOPMPowerFlags currentPowerFlags
;
53 /*! @field desiredDomainState state number which corresponds to the child's desire
55 unsigned long desiredDomainState
;
57 /*! @field requestFlag set to true when desiredDomainState is set */
60 /*! @field preventIdleSleepFlag true if child has this bit set in its desired state
62 unsigned long preventIdleSleepFlag
;
64 /*! @field preventSystemSleepFlag true if child has this bit set in its desired state
66 unsigned long preventSystemSleepFlag
;
68 /*! @field awaitingAck true if child has not yet acked our notification
72 /*! @field readyFlag true if the child has been added as a power child
77 /*! @function setParentKnowsState
78 @abstract Sets the stateKnown variable.
79 @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. */
80 void setParentKnowsState (bool );
82 /*! @function setParentCurrentPowerFlags
83 @abstract Sets the currentPowerFlags variable.
84 @discussion Called by the parent when the object is created and called by the child when it discovers that the parent state is changing. */
85 void setParentCurrentPowerFlags (IOPMPowerFlags
);
87 /*! @function parentKnowsState
88 @abstract Returns the stateKnown variable. */
89 bool parentKnowsState (void );
91 /*! @function parentCurrentPowerFlags
92 @abstract Returns the currentPowerFlags variable. */
93 IOPMPowerFlags
parentCurrentPowerFlags (void );
95 /*! @function setDesiredDomainState
96 @abstract Sets the desiredDomainState variable.
97 @discussion Called by the parent. */
98 void setDesiredDomainState (unsigned long );
100 /*! @function getDesiredDomainState
101 @abstract Returns the desiredDomainState variable.
102 @discussion Called by the parent. */
103 unsigned long getDesiredDomainState ( void );
105 /*! @function setChildHasRequestedPower
106 @abstract Set the flag that says that the child has called requestPowerDomainState.
107 @discussion Called by the parent. */
108 void setChildHasRequestedPower ( void );
111 /*! @function childHasRequestedPower
112 @abstract Return the flag that says whether the child has called requestPowerDomainState.
113 @discussion Called by the PCI Aux Power Supply Driver to see if a device driver
115 bool childHasRequestedPower ( void );
117 /*! @function setPreventIdleSleepFlag
118 @abstract Sets the preventIdleSleepFlag variable.
119 @discussion Called by the parent. */
120 void setPreventIdleSleepFlag (unsigned long );
122 /*! @function getPreventIdleSleepFlag
123 @abstract Returns the preventIdleSleepFlag variable.
124 @discussion Called by the parent. */
125 bool getPreventIdleSleepFlag ( void );
127 /*! @function setPreventSystemSleepFlag
128 @abstract Sets the preventSystemSleepFlag variable.
129 @discussion Called by the parent. */
130 void setPreventSystemSleepFlag (unsigned long );
132 /*! @function getPreventSystemSleepFlag
133 @abstract Returns the preventSystemSleepFlag variable.
134 @discussion Called by the parent. */
135 bool getPreventSystemSleepFlag ( void );
137 /*! @function setAwaitingAck
138 @abstract Sets the awaitingAck variable.
139 @discussion Called by the parent. */
140 void setAwaitingAck ( bool );
142 /*! @function getAwaitingAck
143 @abstract Returns the awaitingAck variable.
144 @discussion Called by the parent. */
145 bool getAwaitingAck ( void );
147 /*! @function setReadyFlag
148 @abstract Sets the readyFlag variable.
149 @discussion Called by the parent. */
150 void setReadyFlag( bool flag
);
152 /*! @function getReadyFlag
153 @abstract Returns the readyFlag variable.
154 @discussion Called by the parent. */
155 bool getReadyFlag( void ) const;
158 #endif /* ! _IOKIT_IOPOWERCONNECTION_H */