2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_OSREFERENCE_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
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
31 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
38 #ifndef _IOKIT_IOPOWERCONNECTION_H
39 #define _IOKIT_IOPOWERCONNECTION_H
41 #include <IOKit/IOService.h>
42 #include <IOKit/pwr_mgt/IOPM.h>
44 class IOPowerConnection
: public IOService
46 OSDeclareDefaultStructors(IOPowerConnection
)
49 /*! @field parentKnowsState true: parent knows state of its domain
52 /*! @field currentPowerFlags power flags which describe the current state of the power domain
54 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
75 /*! @function setParentKnowsState
76 @abstract Sets the stateKnown variable.
77 @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. */
78 void setParentKnowsState (bool );
80 /*! @function setParentCurrentPowerFlags
81 @abstract Sets the currentPowerFlags variable.
82 @discussion Called by the parent when the object is created and called by the child when it discovers that the parent state is changing. */
83 void setParentCurrentPowerFlags (IOPMPowerFlags
);
85 /*! @function parentKnowsState
86 @abstract Returns the stateKnown variable. */
87 bool parentKnowsState (void );
89 /*! @function parentCurrentPowerFlags
90 @abstract Returns the currentPowerFlags variable. */
91 IOPMPowerFlags
parentCurrentPowerFlags (void );
93 /*! @function setDesiredDomainState
94 @abstract Sets the desiredDomainState variable.
95 @discussion Called by the parent. */
96 void setDesiredDomainState (unsigned long );
98 /*! @function getDesiredDomainState
99 @abstract Returns the desiredDomainState variable.
100 @discussion Called by the parent. */
101 unsigned long getDesiredDomainState ( void );
103 /*! @function setChildHasRequestedPower
104 @abstract Set the flag that says that the child has called requestPowerDomainState.
105 @discussion Called by the parent. */
106 void setChildHasRequestedPower ( void );
109 /*! @function childHasRequestedPower
110 @abstract Return the flag that says whether the child has called requestPowerDomainState.
111 @discussion Called by the PCI Aux Power Supply Driver to see if a device driver
113 bool childHasRequestedPower ( void );
115 /*! @function setPreventIdleSleepFlag
116 @abstract Sets the preventIdleSleepFlag variable.
117 @discussion Called by the parent. */
118 void setPreventIdleSleepFlag (unsigned long );
120 /*! @function getPreventIdleSleepFlag
121 @abstract Returns the preventIdleSleepFlag variable.
122 @discussion Called by the parent. */
123 bool getPreventIdleSleepFlag ( void );
125 /*! @function setPreventSystemSleepFlag
126 @abstract Sets the preventSystemSleepFlag variable.
127 @discussion Called by the parent. */
128 void setPreventSystemSleepFlag (unsigned long );
130 /*! @function getPreventSystemSleepFlag
131 @abstract Returns the preventSystemSleepFlag variable.
132 @discussion Called by the parent. */
133 bool getPreventSystemSleepFlag ( void );
135 /*! @function setAwaitingAck
136 @abstract Sets the awaitingAck variable.
137 @discussion Called by the parent. */
138 void setAwaitingAck ( bool );
140 /*! @function getAwaitingAck
141 @abstract Returns the awaitingAck variable.
142 @discussion Called by the parent. */
143 bool getAwaitingAck ( void );
146 #endif /* ! _IOKIT_IOPOWERCONNECTION_H */