ReactOS 0.4.16-dev-91-g764881a
power.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS USB Port Driver
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: USBPort power handling functions
5 * COPYRIGHT: Copyright 2017 Vadim Galyant <vgal@rambler.ru>
6 */
7
8#include "usbport.h"
9
10#define NDEBUG
11#include <debug.h>
12
13VOID
16{
18 PDEVICE_OBJECT PdoDevice;
20 PIRP Irp;
22
23 DPRINT("USBPORT_CompletePdoWaitWake: ... \n");
24
25 FdoExtension = FdoDevice->DeviceExtension;
26 PdoDevice = FdoExtension->RootHubPdo;
27 PdoExtension = PdoDevice->DeviceExtension;
28
29 KeAcquireSpinLock(&FdoExtension->PowerWakeSpinLock, &OldIrql);
30
31 Irp = PdoExtension->WakeIrp;
32
34 {
35 PdoExtension->WakeIrp = NULL;
36 KeReleaseSpinLock(&FdoExtension->PowerWakeSpinLock, OldIrql);
37
38 DPRINT("USBPORT_CompletePdoWaitWake: Complete Irp - %p\n", Irp);
39
40 Irp->IoStatus.Status = STATUS_SUCCESS;
41 Irp->IoStatus.Information = 0;
43
44 return;
45 }
46
47 KeReleaseSpinLock(&FdoExtension->PowerWakeSpinLock, OldIrql);
48}
49
50VOID
56{
57 DPRINT("USBPORT_HcWakeDpc: ... \n");
59}
60
61VOID
64{
66
67 DPRINT("USBPORT_HcQueueWakeDpc: ... \n");
68
69 FdoExtension = FdoDevice->DeviceExtension;
71}
72
73VOID
76{
78 PDEVICE_OBJECT FdoDevice;
80 PIRP Irp;
81
82 DPRINT("USBPORT_CompletePendingIdleIrp: ... \n");
83
84 PdoExtension = PdoDevice->DeviceExtension;
85 FdoDevice = PdoExtension->FdoDevice;
86 FdoExtension = FdoDevice->DeviceExtension;
87
88 Irp = IoCsqRemoveNextIrp(&FdoExtension->IdleIoCsq, 0);
89
90 if (Irp)
91 {
92 InterlockedDecrement(&FdoExtension->IdleLockCounter);
93
94 DPRINT("USBPORT_CompletePendingIdleIrp: Complete Irp - %p\n", Irp);
95
96 Irp->IoStatus.Status = STATUS_CANCELLED;
97 Irp->IoStatus.Information = 0;
99 }
100}
101
102VOID
103NTAPI
105{
106 DPRINT("USBPORT_DoSetPowerD0: FIXME!\n");
107 return;
108}
109
110VOID
111NTAPI
113{
116
117 DPRINT1("USBPORT_SuspendController \n");
118
119 FdoExtension = FdoDevice->DeviceExtension;
120 Packet = &FdoExtension->MiniPortInterface->Packet;
121
123
124 USBPORT_FlushController(FdoDevice);
125
127 {
128 return;
129 }
130
132
134 {
135 FdoExtension->MiniPortFlags |= USBPORT_MPFLAG_SUSPENDED;
136
137 USBPORT_Wait(FdoDevice, 10);
138 Packet->SuspendController(FdoExtension->MiniPortExt);
139 }
140
142}
143
145NTAPI
147{
152 MPSTATUS MpStatus;
153
154 DPRINT1("USBPORT_ResumeController: ... \n");
155
156 FdoExtension = FdoDevice->DeviceExtension;
157 Packet = &FdoExtension->MiniPortInterface->Packet;
158
160 {
161 return Status;
162 }
163
164 KeAcquireSpinLock(&FdoExtension->TimerFlagsSpinLock, &OldIrql);
165
168
169 KeReleaseSpinLock(&FdoExtension->TimerFlagsSpinLock, OldIrql);
170
171 if (!(FdoExtension->MiniPortFlags & USBPORT_MPFLAG_SUSPENDED))
172 {
173 FdoExtension->Flags &= ~USBPORT_FLAG_HC_SUSPEND;
174 return Status;
175 }
176
177 FdoExtension->MiniPortFlags &= ~USBPORT_MPFLAG_SUSPENDED;
178
179 if (!Packet->ResumeController(FdoExtension->MiniPortExt))
180 {
181 Status = USBPORT_Wait(FdoDevice, 100);
182
183 FdoExtension->Flags &= ~USBPORT_FLAG_HC_SUSPEND;
184 return Status;
185 }
186
187 KeAcquireSpinLock(&FdoExtension->TimerFlagsSpinLock, &OldIrql);
190 KeReleaseSpinLock(&FdoExtension->TimerFlagsSpinLock, OldIrql);
191
193
194 Packet->StopController(FdoExtension->MiniPortExt, 1);
195
196 USBPORT_NukeAllEndpoints(FdoDevice);
197
198 RtlZeroMemory(FdoExtension->MiniPortExt, Packet->MiniPortExtensionSize);
199
200 RtlZeroMemory((PVOID)FdoExtension->UsbPortResources.StartVA,
201 Packet->MiniPortResourcesSize);
202
203 FdoExtension->UsbPortResources.IsChirpHandled = TRUE;
204
205 MpStatus = Packet->StartController(FdoExtension->MiniPortExt,
206 &FdoExtension->UsbPortResources);
207
208 FdoExtension->UsbPortResources.IsChirpHandled = FALSE;
209
210 if (!MpStatus)
211 {
213 }
214
215 KeAcquireSpinLock(&FdoExtension->TimerFlagsSpinLock, &OldIrql);
216
220
221 KeReleaseSpinLock(&FdoExtension->TimerFlagsSpinLock, OldIrql);
222
223 Status = USBPORT_Wait(FdoDevice, 100);
224
225 FdoExtension->Flags &= ~USBPORT_FLAG_HC_SUSPEND;
226
227 return Status;
228}
229
231NTAPI
233 IN PIRP Irp)
234{
236 PDEVICE_OBJECT FdoDevice;
238 PIO_STACK_LOCATION IoStack;
241
242 PdoExtension = PdoDevice->DeviceExtension;
243 FdoDevice = PdoExtension->FdoDevice;
244 FdoExtension = FdoDevice->DeviceExtension;
246
247 State = IoStack->Parameters.Power.State;
248
249 DPRINT1("USBPORT_PdoDevicePowerState: Irp - %p, State - %x\n",
250 Irp,
251 State.DeviceState);
252
253 if (State.DeviceState == PowerDeviceD0)
254 {
255 if (FdoExtension->CommonExtension.DevicePowerState == PowerDeviceD0)
256 {
257 // FIXME FdoExtension->Flags
258 while (FdoExtension->SetPowerLockCounter)
259 {
260 USBPORT_Wait(FdoDevice, 10);
261 }
262
263 USBPORT_ResumeController(FdoDevice);
264
265 PdoExtension->CommonExtension.DevicePowerState = PowerDeviceD0;
266
269 }
270 else
271 {
272 DPRINT1("USBPORT_PdoDevicePowerState: FdoExtension->Flags - %lx\n",
273 FdoExtension->Flags);
274
277 }
278 }
279 else if (State.DeviceState == PowerDeviceD1 ||
280 State.DeviceState == PowerDeviceD2 ||
281 State.DeviceState == PowerDeviceD3)
282 {
283 FdoExtension->TimerFlags |= USBPORT_TMFLAG_WAKE;
284 USBPORT_SuspendController(FdoDevice);
285 PdoExtension->CommonExtension.DevicePowerState = State.DeviceState;
286 }
287
288 return Status;
289}
290
291VOID
292NTAPI
294 IN PIRP Irp)
295{
299
300 DPRINT("USBPORT_CancelPendingWakeIrp: ... \n");
301
302 IoReleaseCancelSpinLock(Irp->CancelIrql);
303 PdoExtension = PdoDevice->DeviceExtension;
304 FdoExtension = PdoExtension->FdoDevice->DeviceExtension;
305
306 KeAcquireSpinLock(&FdoExtension->PowerWakeSpinLock, &OldIrql);
307
308 if (PdoExtension->WakeIrp == Irp)
309 {
310 PdoExtension->WakeIrp = NULL;
311 }
312
313 KeReleaseSpinLock(&FdoExtension->PowerWakeSpinLock, OldIrql);
314
315 Irp->IoStatus.Status = STATUS_CANCELLED;
316 Irp->IoStatus.Information = 0;
318}
319
321NTAPI
323 IN PIRP Irp)
324{
326 PDEVICE_OBJECT FdoDevice;
327 PIO_STACK_LOCATION IoStack;
331
332 DPRINT("USBPORT_PdoPower: Irp - %p\n", Irp);
333
334 PdoExtension = PdoDevice->DeviceExtension;
335 FdoDevice = PdoExtension->FdoDevice;
336 FdoExtension = FdoDevice->DeviceExtension;
338
339 Status = Irp->IoStatus.Status;
340
341 switch (IoStack->MinorFunction)
342 {
343 case IRP_MN_WAIT_WAKE:
344 DPRINT("USBPORT_PdoPower: IRP_MN_WAIT_WAKE\n");
345
347 {
348 /* The device does not support wake-up */
350 break;
351 }
352
353 KeAcquireSpinLock(&FdoExtension->PowerWakeSpinLock, &OldIrql);
354
356
357 /* Check if the IRP has been cancelled */
358 if (Irp->Cancel)
359 {
361 {
362 /* IRP has been cancelled, release cancel spinlock */
363 KeReleaseSpinLock(&FdoExtension->PowerWakeSpinLock, OldIrql);
364
365 DPRINT("USBPORT_PdoPower: IRP_MN_WAIT_WAKE - STATUS_CANCELLED\n");
366
367 /* IRP is cancelled */
369 break;
370 }
371 }
372
373 if (!PdoExtension->WakeIrp)
374 {
375 /* The driver received the IRP
376 and is waiting for the device to signal wake-up. */
377
378 DPRINT("USBPORT_PdoPower: IRP_MN_WAIT_WAKE - No WakeIrp\n");
379
381 PdoExtension->WakeIrp = Irp;
382
383 KeReleaseSpinLock(&FdoExtension->PowerWakeSpinLock, OldIrql);
384 return STATUS_PENDING;
385 }
386 else
387 {
388 /* An IRP_MN_WAIT_WAKE request is already pending and must be
389 completed or canceled before another IRP_MN_WAIT_WAKE request
390 can be issued. */
391
393 {
394 DPRINT("USBPORT_PdoPower: IRP_MN_WAIT_WAKE - STATUS_DEVICE_BUSY\n");
395
396 KeReleaseSpinLock(&FdoExtension->PowerWakeSpinLock, OldIrql);
399 break;
400 }
401 else
402 {
403 ASSERT(FALSE);
404 KeReleaseSpinLock(&FdoExtension->PowerWakeSpinLock, OldIrql);
405 return Status;
406 }
407 }
408
410 DPRINT("USBPORT_PdoPower: IRP_MN_POWER_SEQUENCE\n");
412 break;
413
414 case IRP_MN_SET_POWER:
415 DPRINT("USBPORT_PdoPower: IRP_MN_SET_POWER\n");
416
417 if (IoStack->Parameters.Power.Type == DevicePowerState)
418 {
419 DPRINT("USBPORT_PdoPower: IRP_MN_SET_POWER/DevicePowerState\n");
422 break;
423 }
424
425 DPRINT("USBPORT_PdoPower: IRP_MN_SET_POWER/SystemPowerState \n");
426
427 if (IoStack->Parameters.Power.State.SystemState == PowerSystemWorking)
428 {
429 FdoExtension->TimerFlags |= USBPORT_TMFLAG_WAKE;
430 }
431 else
432 {
433 FdoExtension->TimerFlags &= ~USBPORT_TMFLAG_WAKE;
434 }
435
437
439 break;
440
442 DPRINT("USBPORT_PdoPower: IRP_MN_QUERY_POWER\n");
445 break;
446
447 default:
448 DPRINT1("USBPORT_PdoPower: unknown IRP_MN_POWER!\n");
450 break;
451 }
452
453 Irp->IoStatus.Status = Status;
454 Irp->IoStatus.Information = 0;
456
457 return Status;
458}
459
461NTAPI
463 IN PIRP Irp)
464{
465 DPRINT1("USBPORT_HcWake: UNIMPLEMENTED. FIXME. \n");
466 return STATUS_SUCCESS;
467}
468
470NTAPI
472 IN PIRP Irp)
473{
474 DPRINT1("USBPORT_DevicePowerState: UNIMPLEMENTED. FIXME. \n");
475 return STATUS_SUCCESS;
476}
477
479NTAPI
481 IN PIRP Irp)
482{
483 DPRINT1("USBPORT_SystemPowerState: UNIMPLEMENTED. FIXME. \n");
484 return STATUS_SUCCESS;
485}
486
488NTAPI
490 IN PIRP Irp)
491{
493 PIO_STACK_LOCATION IoStack;
495
496 DPRINT("USBPORT_FdoPower: ... \n");
497
498 FdoExtension = FdoDevice->DeviceExtension;
500
501 switch (IoStack->MinorFunction)
502 {
503 case IRP_MN_WAIT_WAKE:
504 DPRINT("USBPORT_FdoPower: IRP_MN_WAIT_WAKE\n");
505 Status = USBPORT_HcWake(FdoDevice, Irp);
506 return Status;
507
509 DPRINT("USBPORT_FdoPower: IRP_MN_POWER_SEQUENCE\n");
510 break;
511
512 case IRP_MN_SET_POWER:
513 DPRINT("USBPORT_FdoPower: IRP_MN_SET_POWER\n");
514 if (IoStack->Parameters.Power.Type == DevicePowerState)
515 {
516 Status = USBPORT_DevicePowerState(FdoDevice, Irp);
517 }
518 else
519 {
520 Status = USBPORT_SystemPowerState(FdoDevice, Irp);
521 }
522
523 if (Status != STATUS_PENDING)
524 break;
525
526 return Status;
527
529 DPRINT("USBPORT_FdoPower: IRP_MN_QUERY_POWER\n");
530 Irp->IoStatus.Status = STATUS_SUCCESS;
531 break;
532
533 default:
534 DPRINT1("USBPORT_FdoPower: unknown IRP_MN_POWER!\n");
535 break;
536 }
537
540 return PoCallDriver(FdoExtension->CommonExtension.LowerDevice, Irp);
541}
542
543VOID
544NTAPI
546{
547 PIO_STACK_LOCATION IoStack;
548 PDEVICE_OBJECT FdoDevice;
551 PIRP NextIrp;
552 LARGE_INTEGER CurrentTime = {{0, 0}};
553 PTIMER_WORK_QUEUE_ITEM IdleQueueItem;
554 PDEVICE_OBJECT PdoDevice;
555 PUSB_IDLE_CALLBACK_INFO IdleCallbackInfo;
557
558 DPRINT("USBPORT_DoIdleNotificationCallback \n");
559
560 IdleQueueItem = Context;
561
562 FdoDevice = IdleQueueItem->FdoDevice;
563 FdoExtension = FdoDevice->DeviceExtension;
564 PdoDevice = FdoExtension->RootHubPdo;
565 PdoExtension = PdoDevice->DeviceExtension;
566
567 KeQuerySystemTime(&CurrentTime);
568
569 if ((FdoExtension->IdleTime.QuadPart == 0) ||
570 (((CurrentTime.QuadPart - FdoExtension->IdleTime.QuadPart) / 10000) >= 500))
571 {
572 if (PdoExtension->CommonExtension.DevicePowerState == PowerDeviceD0 &&
573 FdoExtension->CommonExtension.DevicePowerState == PowerDeviceD0)
574 {
575 NextIrp = IoCsqRemoveNextIrp(&FdoExtension->IdleIoCsq, NULL);
576
577 if (NextIrp)
578 {
579 IoStack = IoGetCurrentIrpStackLocation(NextIrp);
580 IdleCallbackInfo = IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
581
582 if (IdleCallbackInfo && IdleCallbackInfo->IdleCallback)
583 {
584 IdleCallbackInfo->IdleCallback(IdleCallbackInfo->IdleContext);
585 }
586
587 if (NextIrp->Cancel)
588 {
589 InterlockedDecrement(&FdoExtension->IdleLockCounter);
590
592 NextIrp->IoStatus.Information = 0;
594 }
595 else
596 {
597 IoCsqInsertIrp(&FdoExtension->IdleIoCsq, NextIrp, NULL);
598 }
599 }
600 }
601 }
602
603 KeAcquireSpinLock(&FdoExtension->TimerFlagsSpinLock, &OldIrql);
604 FdoExtension->TimerFlags &= ~USBPORT_TMFLAG_IDLE_QUEUEITEM_ON;
605 KeReleaseSpinLock(&FdoExtension->TimerFlagsSpinLock, OldIrql);
606
607 ExFreePoolWithTag(IdleQueueItem, USB_PORT_TAG);
608}
609
611NTAPI
613 IN PIRP Irp)
614{
616 PDEVICE_OBJECT FdoDevice;
618 LONG LockCounter;
620
621 DPRINT("USBPORT_IdleNotification: Irp - %p\n", Irp);
622
623 PdoExtension = PdoDevice->DeviceExtension;
624 FdoDevice = PdoExtension->FdoDevice;
625 FdoExtension = FdoDevice->DeviceExtension;
626
627 LockCounter = InterlockedIncrement(&FdoExtension->IdleLockCounter);
628
629 if (LockCounter != 0)
630 {
631 if (Status != STATUS_PENDING)
632 {
633 InterlockedDecrement(&FdoExtension->IdleLockCounter);
634
635 Irp->IoStatus.Status = Status;
636 Irp->IoStatus.Information = 0;
638
639 return Status;
640 }
641
643 }
644
645 if (Status != STATUS_PENDING)
646 {
647 InterlockedDecrement(&FdoExtension->IdleLockCounter);
648
649 Irp->IoStatus.Status = Status;
650 Irp->IoStatus.Information = 0;
652
653 return Status;
654 }
655
656 Irp->IoStatus.Status = STATUS_PENDING;
658
660
661 IoCsqInsertIrp(&FdoExtension->IdleIoCsq, Irp, 0);
662
663 return Status;
664}
665
666VOID
667NTAPI
669 IN PDEVICE_OBJECT PdoDevice)
670{
674
675 DPRINT("USBPORT_AdjustDeviceCapabilities: ... \n");
676
677 FdoExtension = FdoDevice->DeviceExtension;
678 PdoExtension = PdoDevice->DeviceExtension;
679 Capabilities = &PdoExtension->Capabilities;
680
682 &FdoExtension->Capabilities,
683 sizeof(DEVICE_CAPABILITIES));
684
685 Capabilities->DeviceD1 = FALSE;
686 Capabilities->DeviceD2 = TRUE;
687
688 Capabilities->Removable = FALSE;
689 Capabilities->UniqueID = FALSE;
690
691 Capabilities->WakeFromD0 = TRUE;
692 Capabilities->WakeFromD1 = FALSE;
693 Capabilities->WakeFromD2 = TRUE;
694 Capabilities->WakeFromD3 = FALSE;
695
696 Capabilities->Address = 0;
697 Capabilities->UINumber = 0;
698
699 if (Capabilities->SystemWake == PowerSystemUnspecified)
700 Capabilities->SystemWake = PowerSystemWorking;
701
702 Capabilities->DeviceWake = PowerDeviceD2;
703
708}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
_In_ PIRP Irp
Definition: csq.h:116
NTKERNELAPI VOID NTAPI IoCsqInsertIrp(_Inout_ PIO_CSQ Csq, _Inout_ PIRP Irp, _Out_opt_ PIO_CSQ_IRP_CONTEXT Context)
Insert an IRP into the CSQ.
Definition: csq.c:177
NTKERNELAPI PIRP NTAPI IoCsqRemoveNextIrp(_Inout_ PIO_CSQ Csq, _In_opt_ PVOID PeekContext)
IoCsqRemoveNextIrp - Removes the next IRP from the queue.
Definition: csq.c:398
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOLEAN NTAPI KeInsertQueueDpc(IN PKDPC Dpc, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
Definition: dpc.c:725
@ PdoExtension
Definition: precomp.h:49
@ FdoExtension
Definition: precomp.h:48
NTSTATUS NTAPI USBPORT_SystemPowerState(IN PDEVICE_OBJECT FdoDevice, IN PIRP Irp)
Definition: power.c:480
VOID NTAPI USBPORT_DoSetPowerD0(IN PDEVICE_OBJECT FdoDevice)
Definition: power.c:104
VOID NTAPI USBPORT_CompletePendingIdleIrp(IN PDEVICE_OBJECT PdoDevice)
Definition: power.c:75
VOID NTAPI USBPORT_HcWakeDpc(IN PRKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
Definition: power.c:52
NTSTATUS NTAPI USBPORT_FdoPower(IN PDEVICE_OBJECT FdoDevice, IN PIRP Irp)
Definition: power.c:489
NTSTATUS NTAPI USBPORT_PdoDevicePowerState(IN PDEVICE_OBJECT PdoDevice, IN PIRP Irp)
Definition: power.c:232
NTSTATUS NTAPI USBPORT_PdoPower(IN PDEVICE_OBJECT PdoDevice, IN PIRP Irp)
Definition: power.c:322
VOID NTAPI USBPORT_AdjustDeviceCapabilities(IN PDEVICE_OBJECT FdoDevice, IN PDEVICE_OBJECT PdoDevice)
Definition: power.c:668
NTSTATUS NTAPI USBPORT_IdleNotification(IN PDEVICE_OBJECT PdoDevice, IN PIRP Irp)
Definition: power.c:612
VOID NTAPI USBPORT_CompletePdoWaitWake(IN PDEVICE_OBJECT FdoDevice)
Definition: power.c:15
NTSTATUS NTAPI USBPORT_DevicePowerState(IN PDEVICE_OBJECT FdoDevice, IN PIRP Irp)
Definition: power.c:471
VOID NTAPI USBPORT_SuspendController(IN PDEVICE_OBJECT FdoDevice)
Definition: power.c:112
VOID NTAPI USBPORT_CancelPendingWakeIrp(IN PDEVICE_OBJECT PdoDevice, IN PIRP Irp)
Definition: power.c:293
VOID NTAPI USBPORT_HcQueueWakeDpc(IN PDEVICE_OBJECT FdoDevice)
Definition: power.c:63
NTSTATUS NTAPI USBPORT_HcWake(IN PDEVICE_OBJECT FdoDevice, IN PIRP Irp)
Definition: power.c:462
VOID NTAPI USBPORT_DoIdleNotificationCallback(IN PVOID Context)
Definition: power.c:545
NTSTATUS NTAPI USBPORT_ResumeController(IN PDEVICE_OBJECT FdoDevice)
Definition: power.c:146
VOID NTAPI USBPORT_FlushController(IN PDEVICE_OBJECT FdoDevice)
Definition: queue.c:1259
VOID NTAPI USBPORT_NukeAllEndpoints(IN PDEVICE_OBJECT FdoDevice)
Definition: endpoint.c:300
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define KeReleaseSpinLock(sl, irql)
Definition: env_spec_w32.h:627
#define KeAcquireSpinLock(sl, irql)
Definition: env_spec_w32.h:609
#define KeQuerySystemTime(t)
Definition: env_spec_w32.h:570
Status
Definition: gdiplustypes.h:25
_Must_inspect_result_ typedef _Out_ PHIDP_CAPS Capabilities
Definition: hidclass.h:103
NTSYSAPI void WINAPI DbgBreakPoint(void)
IoMarkIrpPending(Irp)
IoSetCancelRoutine(Irp, CancelRoutine)
#define ASSERT(a)
Definition: mode.c:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
Definition: ndis.h:1549
#define IoCopyCurrentIrpStackLocationToNext(Irp)
Definition: ntifs_ex.h:413
#define IoCompleteRequest
Definition: irp.c:1240
VOID NTAPI IoReleaseCancelSpinLock(IN KIRQL Irql)
Definition: util.c:150
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
Definition: power.c:758
@ PowerSystemUnspecified
Definition: ntpoapi.h:35
@ PowerSystemSleeping1
Definition: ntpoapi.h:37
@ PowerSystemSleeping2
Definition: ntpoapi.h:38
@ PowerSystemSleeping3
Definition: ntpoapi.h:39
@ PowerSystemWorking
Definition: ntpoapi.h:36
@ PowerSystemHibernate
Definition: ntpoapi.h:40
@ DevicePowerState
Definition: ntpoapi.h:63
@ PowerDeviceD1
Definition: ntpoapi.h:50
@ PowerDeviceD0
Definition: ntpoapi.h:49
@ PowerDeviceD2
Definition: ntpoapi.h:51
@ PowerDeviceD3
Definition: ntpoapi.h:52
#define STATUS_PENDING
Definition: ntstatus.h:82
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
long LONG
Definition: pedump.c:60
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
PVOID DeviceExtension
Definition: env_spec_w32.h:418
struct _IO_STACK_LOCATION::@1575::@1576 DeviceIoControl
struct _IO_STACK_LOCATION::@3974::@4010 Power
union _IO_STACK_LOCATION::@1575 Parameters
IO_STATUS_BLOCK IoStatus
Definition: ketypes.h:699
PDEVICE_OBJECT FdoDevice
Definition: usbport.h:445
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define STATUS_DEVICE_BUSY
Definition: udferr_usr.h:129
#define STATUS_CANCELLED
Definition: udferr_usr.h:170
LONGLONG QuadPart
Definition: typedefs.h:114
ULONG MPSTATUS
Definition: usbmport.h:131
VOID NTAPI USBPORT_MiniportInterrupts(IN PDEVICE_OBJECT FdoDevice, IN BOOLEAN IsEnable)
Definition: usbport.c:555
NTSTATUS NTAPI USBPORT_Wait(IN PVOID MiniPortExtension, IN ULONG Milliseconds)
Definition: usbport.c:543
#define USBPORT_MPFLAG_INTERRUPTS_ENABLED
Definition: usbport.h:102
#define USBPORT_TMFLAG_WAKE
Definition: usbport.h:98
#define USBPORT_TMFLAG_HC_SUSPENDED
Definition: usbport.h:94
#define USB_PORT_TAG
Definition: usbport.h:44
#define USBPORT_FLAG_HC_SUSPEND
Definition: usbport.h:71
#define USBPORT_TMFLAG_RH_SUSPENDED
Definition: usbport.h:96
#define USBPORT_MPFLAG_SUSPENDED
Definition: usbport.h:103
#define USBPORT_FLAG_HC_STARTED
Definition: usbport.h:67
#define USBPORT_TMFLAG_HC_RESUME
Definition: usbport.h:95
_Must_inspect_result_ _In_ PWDF_DPC_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFDPC * Dpc
Definition: wdfdpc.h:112
DEVICE_CAPABILITIES
Definition: iotypes.h:965
#define IRP_MN_WAIT_WAKE
#define IO_NO_INCREMENT
Definition: iotypes.h:598
#define IRP_MN_POWER_SEQUENCE
#define IRP_MN_SET_POWER
* PDEVICE_CAPABILITIES
Definition: iotypes.h:965
#define IRP_MN_QUERY_POWER
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:778
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
Definition: ketypes.h:688
_In_opt_ PVOID DeferredContext
Definition: ketypes.h:687
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
Definition: ketypes.h:689