]> git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/pwr_mgt/IOPowerConnection.h
xnu-792.13.8.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_LICENSE_OSREFERENCE_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
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
14 * agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * file.
19 *
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
27 *
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
29 */
30 /*
31 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
32 *
33 * HISTORY
34 *
35 */
36
37
38 #ifndef _IOKIT_IOPOWERCONNECTION_H
39 #define _IOKIT_IOPOWERCONNECTION_H
40
41 #include <IOKit/IOService.h>
42 #include <IOKit/pwr_mgt/IOPM.h>
43
44 class IOPowerConnection : public IOService
45 {
46 OSDeclareDefaultStructors(IOPowerConnection)
47
48 protected:
49 /*! @field parentKnowsState true: parent knows state of its domain
50 used by child */
51 bool stateKnown;
52 /*! @field currentPowerFlags power flags which describe the current state of the power domain
53 used by child */
54 IOPMPowerFlags currentPowerFlags;
55 /*! @field desiredDomainState state number which corresponds to the child's desire
56 used by parent */
57 unsigned long desiredDomainState;
58
59 /*! @field requestFlag set to true when desiredDomainState is set */
60 bool requestFlag;
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 */
72 bool awaitingAck;
73
74 public:
75 /*! @function setParentKnowsState
76 @abstract Sets the stateKnown variable.
77 @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. */
78 void setParentKnowsState (bool );
79
80 /*! @function setParentCurrentPowerFlags
81 @abstract Sets the currentPowerFlags variable.
82 @discussion Called by the parent when the object is created and called by the child when it discovers that the parent state is changing. */
83 void setParentCurrentPowerFlags (IOPMPowerFlags );
84
85 /*! @function parentKnowsState
86 @abstract Returns the stateKnown variable. */
87 bool parentKnowsState (void );
88
89 /*! @function parentCurrentPowerFlags
90 @abstract Returns the currentPowerFlags variable. */
91 IOPMPowerFlags parentCurrentPowerFlags (void );
92
93 /*! @function setDesiredDomainState
94 @abstract Sets the desiredDomainState variable.
95 @discussion Called by the parent. */
96 void setDesiredDomainState (unsigned long );
97
98 /*! @function getDesiredDomainState
99 @abstract Returns the desiredDomainState variable.
100 @discussion Called by the parent. */
101 unsigned long getDesiredDomainState ( void );
102
103 /*! @function setChildHasRequestedPower
104 @abstract Set the flag that says that the child has called requestPowerDomainState.
105 @discussion Called by the parent. */
106 void setChildHasRequestedPower ( void );
107
108
109 /*! @function childHasRequestedPower
110 @abstract Return the flag that says whether the child has called requestPowerDomainState.
111 @discussion Called by the PCI Aux Power Supply Driver to see if a device driver
112 is power managed. */
113 bool childHasRequestedPower ( void );
114
115 /*! @function setPreventIdleSleepFlag
116 @abstract Sets the preventIdleSleepFlag variable.
117 @discussion Called by the parent. */
118 void setPreventIdleSleepFlag (unsigned long );
119
120 /*! @function getPreventIdleSleepFlag
121 @abstract Returns the preventIdleSleepFlag variable.
122 @discussion Called by the parent. */
123 bool getPreventIdleSleepFlag ( void );
124
125 /*! @function setPreventSystemSleepFlag
126 @abstract Sets the preventSystemSleepFlag variable.
127 @discussion Called by the parent. */
128 void setPreventSystemSleepFlag (unsigned long );
129
130 /*! @function getPreventSystemSleepFlag
131 @abstract Returns the preventSystemSleepFlag variable.
132 @discussion Called by the parent. */
133 bool getPreventSystemSleepFlag ( void );
134
135 /*! @function setAwaitingAck
136 @abstract Sets the awaitingAck variable.
137 @discussion Called by the parent. */
138 void setAwaitingAck ( bool );
139
140 /*! @function getAwaitingAck
141 @abstract Returns the awaitingAck variable.
142 @discussion Called by the parent. */
143 bool getAwaitingAck ( void );
144 };
145
146 #endif /* ! _IOKIT_IOPOWERCONNECTION_H */
147