2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
30 #ifndef _IOKIT_IOPOWERCONNECTION_H
31 #define _IOKIT_IOPOWERCONNECTION_H
33 #include <IOKit/IOService.h>
34 #include <IOKit/pwr_mgt/IOPM.h>
36 class IOPowerConnection
: public IOService
38 OSDeclareDefaultStructors(IOPowerConnection
)
41 /*! @field parentKnowsState true: parent knows state of its domain
44 /*! @field currentPowerFlags power flags which describe the current state of the power domain
46 IOPMPowerFlags currentPowerFlags
;
47 /*! @field desiredDomainState state number which corresponds to the child's desire
49 unsigned long desiredDomainState
;
51 /*! @field requestFlag set to true when desiredDomainState is set */
54 /*! @field preventIdleSleepFlag true if child has this bit set in its desired state
56 unsigned long preventIdleSleepFlag
;
58 /*! @field preventSystemSleepFlag true if child has this bit set in its desired state
60 unsigned long preventSystemSleepFlag
;
62 /*! @field awaitingAck true if child has not yet acked our notification
67 /*! @function setParentKnowsState
68 @abstract Sets the stateKnown variable.
69 @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. */
70 void setParentKnowsState (bool );
72 /*! @function setParentCurrentPowerFlags
73 @abstract Sets the currentPowerFlags variable.
74 @discussion Called by the parent when the object is created and called by the child when it discovers that the parent state is changing. */
75 void setParentCurrentPowerFlags (IOPMPowerFlags
);
77 /*! @function parentKnowsState
78 @abstract Returns the stateKnown variable. */
79 bool parentKnowsState (void );
81 /*! @function parentCurrentPowerFlags
82 @abstract Returns the currentPowerFlags variable. */
83 IOPMPowerFlags
parentCurrentPowerFlags (void );
85 /*! @function setDesiredDomainState
86 @abstract Sets the desiredDomainState variable.
87 @discussion Called by the parent. */
88 void setDesiredDomainState (unsigned long );
90 /*! @function getDesiredDomainState
91 @abstract Returns the desiredDomainState variable.
92 @discussion Called by the parent. */
93 unsigned long getDesiredDomainState ( void );
95 /*! @function setChildHasRequestedPower
96 @abstract Set the flag that says that the child has called requestPowerDomainState.
97 @discussion Called by the parent. */
98 void setChildHasRequestedPower ( void );
101 /*! @function childHasRequestedPower
102 @abstract Return the flag that says whether the child has called requestPowerDomainState.
103 @discussion Called by the PCI Aux Power Supply Driver to see if a device driver
105 bool childHasRequestedPower ( void );
107 /*! @function setPreventIdleSleepFlag
108 @abstract Sets the preventIdleSleepFlag variable.
109 @discussion Called by the parent. */
110 void setPreventIdleSleepFlag (unsigned long );
112 /*! @function getPreventIdleSleepFlag
113 @abstract Returns the preventIdleSleepFlag variable.
114 @discussion Called by the parent. */
115 bool getPreventIdleSleepFlag ( void );
117 /*! @function setPreventSystemSleepFlag
118 @abstract Sets the preventSystemSleepFlag variable.
119 @discussion Called by the parent. */
120 void setPreventSystemSleepFlag (unsigned long );
122 /*! @function getPreventSystemSleepFlag
123 @abstract Returns the preventSystemSleepFlag variable.
124 @discussion Called by the parent. */
125 bool getPreventSystemSleepFlag ( void );
127 /*! @function setAwaitingAck
128 @abstract Sets the awaitingAck variable.
129 @discussion Called by the parent. */
130 void setAwaitingAck ( bool );
132 /*! @function getAwaitingAck
133 @abstract Returns the awaitingAck variable.
134 @discussion Called by the parent. */
135 bool getAwaitingAck ( void );
138 #endif /* ! _IOKIT_IOPOWERCONNECTION_H */