ReactOS 0.4.15-dev-8109-gd7be748
powerstatemachinekm.cpp
Go to the documentation of this file.
1/*++
2Copyright (c) Microsoft. All rights reserved.
3
4Module Name:
5
6 PowerStateMachineKm.cpp
7
8Abstract:
9
10 This module implements the Power state machine for the driver framework.
11 This code was split out from FxPkgPnp.cpp.
12
13Author:
14
15
16
17
18Environment:
19
20 Kernel mode only
21
22Revision History:
23
24--*/
25
26#include "../pnppriv.hpp"
27
28extern "C" {
29#if defined(EVENT_TRACING)
30#include "PowerStateMachineKm.tmh"
31#endif
32}
33
37 VOID
38 )
39/*++
40
41Routine Description:
42 Calls FxDmaEnabler::PowerUp on all registered FxDmaEnabler objects. As soon
43 as a PowerUp call fails, we stop iterating over the list.
44
45Arguments:
46 None
47
48Return Value:
49 TRUE if PowerUp succeeded on all enablers, FALSE otherwise
50
51 --*/
52
53{
54 // FxTransactionedEntry* ple;
55 // NTSTATUS status;
57
58 result = TRUE;
59
60 //
61 // Power up each dma enabler
62 //
63 // if (m_DmaEnablerList != NULL) {
64 // m_DmaEnablerList->LockForEnum(GetDriverGlobals());
65
66 // ple = NULL;
67 // while ((ple = m_DmaEnablerList->GetNextEntry(ple)) != NULL) {
68 // status = ((FxDmaEnabler*) ple->GetTransactionedObject())->PowerUp();
69
70 // if (!NT_SUCCESS(status)) {
71 // result = FALSE;
72 // break;
73 // }
74 // }
75
76 // m_DmaEnablerList->UnlockFromEnum(GetDriverGlobals());
77 // }
78
79 return result;
80}
81
84 VOID
85 )
86/*++
87
88Routine Description:
89 Calls FxDmaEnabler::PowerDown on all registered FxDmaEnabler objects. All
90 errors are accumulated, all enablers will be PowerDown'ed.
91
92Arguments:
93 None
94
95Return Value:
96 TRUE if PowerDown succeeded on all enablers, FALSE otherwise
97
98 --*/
99{
100 // FxTransactionedEntry* ple;
101 // NTSTATUS status;
103
104 result = TRUE;
105
106 //
107 // Power up each dma enabler
108 //
109 // if (m_DmaEnablerList != NULL) {
110 // m_DmaEnablerList->LockForEnum(GetDriverGlobals());
111
112 // ple = NULL;
113 // while ((ple = m_DmaEnablerList->GetNextEntry(ple)) != NULL) {
114 // status = ((FxDmaEnabler*) ple->GetTransactionedObject())->PowerDown();
115
116 // if (!NT_SUCCESS(status)) {
117 // //
118 // // We do not break out of the loop on power down failure. We will
119 // // continue to power down each channel regardless of the previous
120 // // channel's power down status.
121 // //
122 // result = FALSE;
123 // }
124 // }
125
126 // m_DmaEnablerList->UnlockFromEnum(GetDriverGlobals());
127 // }
128
129 return result;
130}
131
132VOID
134 __in FxIrp* Irp
135 )
136/*++
137
138Routine Description:
139 Set source of wake if OS supports this.
140
141Arguments:
142 Irp
143
144Return Value:
145 None
146
147 --*/
148{
149 PoSetSystemWake(Irp->GetIrp());
150}
151
unsigned char BOOLEAN
Definition: fxirp.hpp:28
static VOID _PowerSetSystemWakeSource(__in FxIrp *Irp)
BOOLEAN PowerDmaPowerDown(VOID)
_Must_inspect_result_ BOOLEAN PowerDmaPowerUp(VOID)
_In_ PIRP Irp
Definition: csq.h:116
#define __in
Definition: dbghelp.h:35
#define TRUE
Definition: types.h:120
GLuint64EXT * result
Definition: glext.h:11304
#define _Must_inspect_result_
Definition: ms_sal.h:558