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