]> git.saurik.com Git - apple/xnu.git/blame - iokit/Kernel/IOPowerConnection.cpp
xnu-344.21.73.tar.gz
[apple/xnu.git] / iokit / Kernel / IOPowerConnection.cpp
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#include <IOKit/pwr_mgt/IOPowerConnection.h>
27
28#define super IOService
29OSDefineMetaClassAndStructors(IOPowerConnection,IOService)
30
31
32// **********************************************************************************
33// setDesiredDomainState
34//
35// Parent of the connection calls here to save the childs desire
36// **********************************************************************************
37void IOPowerConnection::setDesiredDomainState (unsigned long stateNumber )
38{
39 desiredDomainState = stateNumber;
40}
41
42
43// **********************************************************************************
44// getDesiredDomainState
45//
46// **********************************************************************************
47unsigned long IOPowerConnection::getDesiredDomainState ( void )
48{
49 return desiredDomainState;
50}
51
52
0b4e3aa0
A
53// **********************************************************************************
54// setChildHasRequestedPower
55//
56// Parent of the connection calls here when the child requests power
57// **********************************************************************************
58void IOPowerConnection::setChildHasRequestedPower ( void )
59{
60 requestFlag = true;
61}
62
63// **********************************************************************************
64// childHasRequestedPower
65//
66// Parent of the connection calls here when the child requests power
67// **********************************************************************************
68bool IOPowerConnection::childHasRequestedPower ( void )
69{
70 return requestFlag;
71}
72
73
74// **********************************************************************************
75// setPreventIdleSleepFlag
76//
77// **********************************************************************************
78void IOPowerConnection::setPreventIdleSleepFlag ( unsigned long flag )
79{
80 preventIdleSleepFlag = (flag != 0);
81}
82
83
84// **********************************************************************************
85// getPreventIdleSleepFlag
86//
87// **********************************************************************************
88bool IOPowerConnection::getPreventIdleSleepFlag ( void )
89{
90 return preventIdleSleepFlag;
91}
92
93
94// **********************************************************************************
95// setPreventSystemSleepFlag
96//
97// **********************************************************************************
98void IOPowerConnection::setPreventSystemSleepFlag ( unsigned long flag )
99{
100 preventSystemSleepFlag = (flag != 0);
101}
102
103
104// **********************************************************************************
105// getPreventSystemSleepFlag
106//
107// **********************************************************************************
108bool IOPowerConnection::getPreventSystemSleepFlag ( void )
109{
110 return preventSystemSleepFlag;
111}
112
113
1c79356b
A
114// **********************************************************************************
115// setParentKnowsState
116//
117// Child of the connection calls here to set its reminder that the parent does
118// or does not yet know the state if its domain.
119// **********************************************************************************
120void IOPowerConnection::setParentKnowsState (bool flag )
121{
122 stateKnown = flag;
123}
124
125
126// **********************************************************************************
127// setParentCurrentPowerFlags
128//
129// Child of the connection calls here to save what the parent says
130// is the state if its domain.
131// **********************************************************************************
132void IOPowerConnection::setParentCurrentPowerFlags (IOPMPowerFlags flags )
133{
134 currentPowerFlags = flags;
135}
136
137
138// **********************************************************************************
139// parentKnowsState
140//
141// **********************************************************************************
142bool IOPowerConnection::parentKnowsState (void )
143{
144 return stateKnown;
145}
146
147
148// **********************************************************************************
149// parentCurrentPowerFlags
150//
151// **********************************************************************************
152IOPMPowerFlags IOPowerConnection::parentCurrentPowerFlags (void )
153{
154 return currentPowerFlags;
155}
156
157
0b4e3aa0
A
158// **********************************************************************************
159// setAwaitingAck
160//
161// **********************************************************************************
162void IOPowerConnection::setAwaitingAck ( bool value )
163{
164 awaitingAck = value;
165}
166
167
168// **********************************************************************************
169// getAwaitingAck
170//
171// **********************************************************************************
172bool IOPowerConnection::getAwaitingAck ( void )
173{
174 return awaitingAck;
175}