2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
33 #ifndef _IOKIT_IOPOWERCONNECTION_H
34 #define _IOKIT_IOPOWERCONNECTION_H
36 #include <IOKit/IOService.h>
37 #include <IOKit/pwr_mgt/IOPM.h>
39 class IOPowerConnection
: public IOService
41 OSDeclareDefaultStructors(IOPowerConnection
)
44 /*! @field parentKnowsState true: parent knows state of its domain
47 /*! @field currentPowerFlags power flags which describe the current state of the power domain
49 IOPMPowerFlags currentPowerFlags
;
50 /*! @field desiredDomainState state number which corresponds to the child's desire
52 unsigned long desiredDomainState
;
54 /*! @field requestFlag set to true when desiredDomainState is set */
57 /*! @field preventIdleSleepFlag true if child has this bit set in its desired state
59 unsigned long preventIdleSleepFlag
;
61 /*! @field preventSystemSleepFlag true if child has this bit set in its desired state
63 unsigned long preventSystemSleepFlag
;
65 /*! @field awaitingAck true if child has not yet acked our notification
70 /*! @function setParentKnowsState
71 @abstract Sets the stateKnown variable.
72 @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. */
73 void setParentKnowsState (bool );
75 /*! @function setParentCurrentPowerFlags
76 @abstract Sets the currentPowerFlags variable.
77 @discussion Called by the parent when the object is created and called by the child when it discovers that the parent state is changing. */
78 void setParentCurrentPowerFlags (IOPMPowerFlags
);
80 /*! @function parentKnowsState
81 @abstract Returns the stateKnown variable. */
82 bool parentKnowsState (void );
84 /*! @function parentCurrentPowerFlags
85 @abstract Returns the currentPowerFlags variable. */
86 IOPMPowerFlags
parentCurrentPowerFlags (void );
88 /*! @function setDesiredDomainState
89 @abstract Sets the desiredDomainState variable.
90 @discussion Called by the parent. */
91 void setDesiredDomainState (unsigned long );
93 /*! @function getDesiredDomainState
94 @abstract Returns the desiredDomainState variable.
95 @discussion Called by the parent. */
96 unsigned long getDesiredDomainState ( void );
98 /*! @function setChildHasRequestedPower
99 @abstract Set the flag that says that the child has called requestPowerDomainState.
100 @discussion Called by the parent. */
101 void setChildHasRequestedPower ( void );
104 /*! @function childHasRequestedPower
105 @abstract Return the flag that says whether the child has called requestPowerDomainState.
106 @discussion Called by the PCI Aux Power Supply Driver to see if a device driver
108 bool childHasRequestedPower ( void );
110 /*! @function setPreventIdleSleepFlag
111 @abstract Sets the preventIdleSleepFlag variable.
112 @discussion Called by the parent. */
113 void setPreventIdleSleepFlag (unsigned long );
115 /*! @function getPreventIdleSleepFlag
116 @abstract Returns the preventIdleSleepFlag variable.
117 @discussion Called by the parent. */
118 bool getPreventIdleSleepFlag ( void );
120 /*! @function setPreventSystemSleepFlag
121 @abstract Sets the preventSystemSleepFlag variable.
122 @discussion Called by the parent. */
123 void setPreventSystemSleepFlag (unsigned long );
125 /*! @function getPreventSystemSleepFlag
126 @abstract Returns the preventSystemSleepFlag variable.
127 @discussion Called by the parent. */
128 bool getPreventSystemSleepFlag ( void );
130 /*! @function setAwaitingAck
131 @abstract Sets the awaitingAck variable.
132 @discussion Called by the parent. */
133 void setAwaitingAck ( bool );
135 /*! @function getAwaitingAck
136 @abstract Returns the awaitingAck variable.
137 @discussion Called by the parent. */
138 bool getAwaitingAck ( void );
141 #endif /* ! _IOKIT_IOPOWERCONNECTION_H */