]> git.saurik.com Git - apple/xnu.git/blame - iokit/IOKit/pwr_mgt/IOPowerConnection.h
xnu-1699.32.7.tar.gz
[apple/xnu.git] / iokit / IOKit / pwr_mgt / IOPowerConnection.h
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
3 *
2d21ac55 4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
1c79356b 5 *
2d21ac55
A
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.
8f6c56a5 14 *
2d21ac55
A
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
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
8f6c56a5
A
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2d21ac55
A
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.
8f6c56a5 25 *
2d21ac55 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
1c79356b
A
27 */
28/*
29 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
30 *
31 * HISTORY
32 *
33 */
34
35
36#ifndef _IOKIT_IOPOWERCONNECTION_H
37#define _IOKIT_IOPOWERCONNECTION_H
38
39#include <IOKit/IOService.h>
40#include <IOKit/pwr_mgt/IOPM.h>
41
42class IOPowerConnection : public IOService
43{
44 OSDeclareDefaultStructors(IOPowerConnection)
45
46protected:
47 /*! @field parentKnowsState true: parent knows state of its domain
48 used by child */
6d2010ae
A
49 bool stateKnown;
50
1c79356b
A
51 /*! @field currentPowerFlags power flags which describe the current state of the power domain
52 used by child */
53 IOPMPowerFlags currentPowerFlags;
6d2010ae 54
1c79356b
A
55 /*! @field desiredDomainState state number which corresponds to the child's desire
56 used by parent */
57 unsigned long desiredDomainState;
58
0b4e3aa0 59 /*! @field requestFlag set to true when desiredDomainState is set */
6d2010ae 60 bool requestFlag;
0b4e3aa0
A
61
62 /*! @field preventIdleSleepFlag true if child has this bit set in its desired state
63 used by parent */
64 unsigned long preventIdleSleepFlag;
65
66 /*! @field preventSystemSleepFlag true if child has this bit set in its desired state
67 used by parent */
68 unsigned long preventSystemSleepFlag;
69
70 /*! @field awaitingAck true if child has not yet acked our notification
71 used by parent */
6d2010ae 72 bool awaitingAck;
0b4e3aa0 73
2d21ac55
A
74 /*! @field readyFlag true if the child has been added as a power child
75 used by parent */
6d2010ae 76 bool readyFlag;
2d21ac55 77
6d2010ae 78#ifdef XNU_KERNEL_PRIVATE
1c79356b 79public:
6d2010ae
A
80 bool delayChildNotification;
81#endif
82
83public:
84 /*! @function setParentKnowsState
85 @abstract Sets the stateKnown variable.
86 @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. */
1c79356b
A
87 void setParentKnowsState (bool );
88
89 /*! @function setParentCurrentPowerFlags
90 @abstract Sets the currentPowerFlags variable.
91 @discussion Called by the parent when the object is created and called by the child when it discovers that the parent state is changing. */
92 void setParentCurrentPowerFlags (IOPMPowerFlags );
93
94 /*! @function parentKnowsState
95 @abstract Returns the stateKnown variable. */
96 bool parentKnowsState (void );
97
98 /*! @function parentCurrentPowerFlags
99 @abstract Returns the currentPowerFlags variable. */
100 IOPMPowerFlags parentCurrentPowerFlags (void );
101
102 /*! @function setDesiredDomainState
103 @abstract Sets the desiredDomainState variable.
0b4e3aa0 104 @discussion Called by the parent. */
1c79356b
A
105 void setDesiredDomainState (unsigned long );
106
107 /*! @function getDesiredDomainState
108 @abstract Returns the desiredDomainState variable.
0b4e3aa0 109 @discussion Called by the parent. */
1c79356b 110 unsigned long getDesiredDomainState ( void );
0b4e3aa0
A
111
112 /*! @function setChildHasRequestedPower
113 @abstract Set the flag that says that the child has called requestPowerDomainState.
114 @discussion Called by the parent. */
115 void setChildHasRequestedPower ( void );
116
0b4e3aa0
A
117 /*! @function childHasRequestedPower
118 @abstract Return the flag that says whether the child has called requestPowerDomainState.
119 @discussion Called by the PCI Aux Power Supply Driver to see if a device driver
120 is power managed. */
121 bool childHasRequestedPower ( void );
122
123 /*! @function setPreventIdleSleepFlag
124 @abstract Sets the preventIdleSleepFlag variable.
125 @discussion Called by the parent. */
126 void setPreventIdleSleepFlag (unsigned long );
127
128 /*! @function getPreventIdleSleepFlag
129 @abstract Returns the preventIdleSleepFlag variable.
130 @discussion Called by the parent. */
131 bool getPreventIdleSleepFlag ( void );
132
133 /*! @function setPreventSystemSleepFlag
134 @abstract Sets the preventSystemSleepFlag variable.
135 @discussion Called by the parent. */
136 void setPreventSystemSleepFlag (unsigned long );
137
138 /*! @function getPreventSystemSleepFlag
139 @abstract Returns the preventSystemSleepFlag variable.
140 @discussion Called by the parent. */
141 bool getPreventSystemSleepFlag ( void );
142
143 /*! @function setAwaitingAck
144 @abstract Sets the awaitingAck variable.
145 @discussion Called by the parent. */
146 void setAwaitingAck ( bool );
147
148 /*! @function getAwaitingAck
149 @abstract Returns the awaitingAck variable.
150 @discussion Called by the parent. */
151 bool getAwaitingAck ( void );
2d21ac55
A
152
153 /*! @function setReadyFlag
154 @abstract Sets the readyFlag variable.
155 @discussion Called by the parent. */
156 void setReadyFlag( bool flag );
157
158 /*! @function getReadyFlag
159 @abstract Returns the readyFlag variable.
160 @discussion Called by the parent. */
161 bool getReadyFlag( void ) const;
1c79356b
A
162};
163
164#endif /* ! _IOKIT_IOPOWERCONNECTION_H */
165