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
73 /*! @function setParentKnowsState
74 @abstract Sets the stateKnown variable.
75 @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. */
76 void setParentKnowsState (bool );
78 /*! @function setParentCurrentPowerFlags
79 @abstract Sets the currentPowerFlags variable.
80 @discussion Called by the parent when the object is created and called by the child when it discovers that the parent state is changing. */
81 void setParentCurrentPowerFlags (IOPMPowerFlags
);
83 /*! @function parentKnowsState
84 @abstract Returns the stateKnown variable. */
85 bool parentKnowsState (void );
87 /*! @function parentCurrentPowerFlags
88 @abstract Returns the currentPowerFlags variable. */
89 IOPMPowerFlags
parentCurrentPowerFlags (void );
91 /*! @function setDesiredDomainState
92 @abstract Sets the desiredDomainState variable.
93 @discussion Called by the parent. */
94 void setDesiredDomainState (unsigned long );
96 /*! @function getDesiredDomainState
97 @abstract Returns the desiredDomainState variable.
98 @discussion Called by the parent. */
99 unsigned long getDesiredDomainState ( void );
101 /*! @function setChildHasRequestedPower
102 @abstract Set the flag that says that the child has called requestPowerDomainState.
103 @discussion Called by the parent. */
104 void setChildHasRequestedPower ( void );
107 /*! @function childHasRequestedPower
108 @abstract Return the flag that says whether the child has called requestPowerDomainState.
109 @discussion Called by the PCI Aux Power Supply Driver to see if a device driver
111 bool childHasRequestedPower ( void );
113 /*! @function setPreventIdleSleepFlag
114 @abstract Sets the preventIdleSleepFlag variable.
115 @discussion Called by the parent. */
116 void setPreventIdleSleepFlag (unsigned long );
118 /*! @function getPreventIdleSleepFlag
119 @abstract Returns the preventIdleSleepFlag variable.
120 @discussion Called by the parent. */
121 bool getPreventIdleSleepFlag ( void );
123 /*! @function setPreventSystemSleepFlag
124 @abstract Sets the preventSystemSleepFlag variable.
125 @discussion Called by the parent. */
126 void setPreventSystemSleepFlag (unsigned long );
128 /*! @function getPreventSystemSleepFlag
129 @abstract Returns the preventSystemSleepFlag variable.
130 @discussion Called by the parent. */
131 bool getPreventSystemSleepFlag ( void );
133 /*! @function setAwaitingAck
134 @abstract Sets the awaitingAck variable.
135 @discussion Called by the parent. */
136 void setAwaitingAck ( bool );
138 /*! @function getAwaitingAck
139 @abstract Returns the awaitingAck variable.
140 @discussion Called by the parent. */
141 bool getAwaitingAck ( void );
144 #endif /* ! _IOKIT_IOPOWERCONNECTION_H */