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