]> git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/pwr_mgt/IOPowerConnection.h
xnu-792.21.3.tar.gz
[apple/xnu.git] / iokit / IOKit / pwr_mgt / IOPowerConnection.h
1 /*
2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
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.
14 *
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
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.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
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
42 class IOPowerConnection : public IOService
43 {
44 OSDeclareDefaultStructors(IOPowerConnection)
45
46 protected:
47 /*! @field parentKnowsState true: parent knows state of its domain
48 used by child */
49 bool stateKnown;
50 /*! @field currentPowerFlags power flags which describe the current state of the power domain
51 used by child */
52 IOPMPowerFlags currentPowerFlags;
53 /*! @field desiredDomainState state number which corresponds to the child's desire
54 used by parent */
55 unsigned long desiredDomainState;
56
57 /*! @field requestFlag set to true when desiredDomainState is set */
58 bool requestFlag;
59
60 /*! @field preventIdleSleepFlag true if child has this bit set in its desired state
61 used by parent */
62 unsigned long preventIdleSleepFlag;
63
64 /*! @field preventSystemSleepFlag true if child has this bit set in its desired state
65 used by parent */
66 unsigned long preventSystemSleepFlag;
67
68 /*! @field awaitingAck true if child has not yet acked our notification
69 used by parent */
70 bool awaitingAck;
71
72 public:
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 );
77
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 );
82
83 /*! @function parentKnowsState
84 @abstract Returns the stateKnown variable. */
85 bool parentKnowsState (void );
86
87 /*! @function parentCurrentPowerFlags
88 @abstract Returns the currentPowerFlags variable. */
89 IOPMPowerFlags parentCurrentPowerFlags (void );
90
91 /*! @function setDesiredDomainState
92 @abstract Sets the desiredDomainState variable.
93 @discussion Called by the parent. */
94 void setDesiredDomainState (unsigned long );
95
96 /*! @function getDesiredDomainState
97 @abstract Returns the desiredDomainState variable.
98 @discussion Called by the parent. */
99 unsigned long getDesiredDomainState ( void );
100
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 );
105
106
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
110 is power managed. */
111 bool childHasRequestedPower ( void );
112
113 /*! @function setPreventIdleSleepFlag
114 @abstract Sets the preventIdleSleepFlag variable.
115 @discussion Called by the parent. */
116 void setPreventIdleSleepFlag (unsigned long );
117
118 /*! @function getPreventIdleSleepFlag
119 @abstract Returns the preventIdleSleepFlag variable.
120 @discussion Called by the parent. */
121 bool getPreventIdleSleepFlag ( void );
122
123 /*! @function setPreventSystemSleepFlag
124 @abstract Sets the preventSystemSleepFlag variable.
125 @discussion Called by the parent. */
126 void setPreventSystemSleepFlag (unsigned long );
127
128 /*! @function getPreventSystemSleepFlag
129 @abstract Returns the preventSystemSleepFlag variable.
130 @discussion Called by the parent. */
131 bool getPreventSystemSleepFlag ( void );
132
133 /*! @function setAwaitingAck
134 @abstract Sets the awaitingAck variable.
135 @discussion Called by the parent. */
136 void setAwaitingAck ( bool );
137
138 /*! @function getAwaitingAck
139 @abstract Returns the awaitingAck variable.
140 @discussion Called by the parent. */
141 bool getAwaitingAck ( void );
142 };
143
144 #endif /* ! _IOKIT_IOPOWERCONNECTION_H */
145