#include "usbport.h"
#include <debug.h>
Go to the source code of this file.
|
VOID NTAPI | USBPORT_CompletePdoWaitWake (IN PDEVICE_OBJECT FdoDevice) |
|
VOID NTAPI | USBPORT_HcWakeDpc (IN PRKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2) |
|
VOID NTAPI | USBPORT_HcQueueWakeDpc (IN PDEVICE_OBJECT FdoDevice) |
|
VOID NTAPI | USBPORT_CompletePendingIdleIrp (IN PDEVICE_OBJECT PdoDevice) |
|
VOID NTAPI | USBPORT_DoSetPowerD0 (IN PDEVICE_OBJECT FdoDevice) |
|
VOID NTAPI | USBPORT_SuspendController (IN PDEVICE_OBJECT FdoDevice) |
|
NTSTATUS NTAPI | USBPORT_ResumeController (IN PDEVICE_OBJECT FdoDevice) |
|
NTSTATUS NTAPI | USBPORT_PdoDevicePowerState (IN PDEVICE_OBJECT PdoDevice, IN PIRP Irp) |
|
VOID NTAPI | USBPORT_CancelPendingWakeIrp (IN PDEVICE_OBJECT PdoDevice, IN PIRP Irp) |
|
NTSTATUS NTAPI | USBPORT_PdoPower (IN PDEVICE_OBJECT PdoDevice, IN PIRP Irp) |
|
NTSTATUS NTAPI | USBPORT_HcWake (IN PDEVICE_OBJECT FdoDevice, IN PIRP Irp) |
|
NTSTATUS NTAPI | USBPORT_DevicePowerState (IN PDEVICE_OBJECT FdoDevice, IN PIRP Irp) |
|
NTSTATUS NTAPI | USBPORT_SystemPowerState (IN PDEVICE_OBJECT FdoDevice, IN PIRP Irp) |
|
NTSTATUS NTAPI | USBPORT_FdoPower (IN PDEVICE_OBJECT FdoDevice, IN PIRP Irp) |
|
VOID NTAPI | USBPORT_DoIdleNotificationCallback (IN PVOID Context) |
|
NTSTATUS NTAPI | USBPORT_IdleNotification (IN PDEVICE_OBJECT PdoDevice, IN PIRP Irp) |
|
VOID NTAPI | USBPORT_AdjustDeviceCapabilities (IN PDEVICE_OBJECT FdoDevice, IN PDEVICE_OBJECT PdoDevice) |
|
◆ NDEBUG
◆ USBPORT_AdjustDeviceCapabilities()
Definition at line 668 of file power.c.
670{
674
675 DPRINT(
"USBPORT_AdjustDeviceCapabilities: ... \n");
676
680
684
687
690
695
698
701
703
708}
_Must_inspect_result_ typedef _Out_ PHIDP_CAPS Capabilities
#define RtlCopyMemory(Destination, Source, Length)
Referenced by USBPORT_CreatePdo().
◆ USBPORT_CancelPendingWakeIrp()
Definition at line 293 of file power.c.
295{
299
300 DPRINT(
"USBPORT_CancelPendingWakeIrp: ... \n");
301
305
307
309 {
311 }
312
314
316 Irp->IoStatus.Information = 0;
318}
#define KeReleaseSpinLock(sl, irql)
#define KeAcquireSpinLock(sl, irql)
#define IoCompleteRequest
VOID NTAPI IoReleaseCancelSpinLock(IN KIRQL Irql)
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Referenced by USBPORT_PdoPower().
◆ USBPORT_CompletePdoWaitWake()
◆ USBPORT_CompletePendingIdleIrp()
Definition at line 75 of file power.c.
76{
81
82 DPRINT(
"USBPORT_CompletePendingIdleIrp: ... \n");
83
87
89
91 {
93
94 DPRINT(
"USBPORT_CompletePendingIdleIrp: Complete Irp - %p\n",
Irp);
95
97 Irp->IoStatus.Information = 0;
99 }
100}
#define InterlockedDecrement
NTKERNELAPI PIRP NTAPI IoCsqRemoveNextIrp(_Inout_ PIO_CSQ Csq, _In_opt_ PVOID PeekContext)
IoCsqRemoveNextIrp - Removes the next IRP from the queue.
Referenced by USBPORT_PdoDevicePowerState().
◆ USBPORT_DevicePowerState()
◆ USBPORT_DoIdleNotificationCallback()
Definition at line 545 of file power.c.
546{
555 PUSB_IDLE_CALLBACK_INFO IdleCallbackInfo;
557
558 DPRINT(
"USBPORT_DoIdleNotificationCallback \n");
559
561
566
568
571 {
574 {
576
577 if (NextIrp)
578 {
581
582 if (IdleCallbackInfo && IdleCallbackInfo->IdleCallback)
583 {
584 IdleCallbackInfo->IdleCallback(IdleCallbackInfo->IdleContext);
585 }
586
587 if (NextIrp->Cancel)
588 {
590
594 }
595 else
596 {
598 }
599 }
600 }
601 }
602
604 FdoExtension->TimerFlags &= ~USBPORT_TMFLAG_IDLE_QUEUEITEM_ON;
606
608}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
NTKERNELAPI VOID NTAPI IoCsqInsertIrp(_Inout_ PIO_CSQ Csq, _Inout_ PIRP Irp, _Out_opt_ PIO_CSQ_IRP_CONTEXT Context)
Insert an IRP into the CSQ.
#define KeQuerySystemTime(t)
#define ExFreePoolWithTag(_P, _T)
struct _IO_STACK_LOCATION::@1579::@1580 DeviceIoControl
union _IO_STACK_LOCATION::@1579 Parameters
Referenced by USBPORT_TimerDpc().
◆ USBPORT_DoSetPowerD0()
◆ USBPORT_FdoPower()
Definition at line 489 of file power.c.
491{
495
496 DPRINT(
"USBPORT_FdoPower: ... \n");
497
500
502 {
504 DPRINT(
"USBPORT_FdoPower: IRP_MN_WAIT_WAKE\n");
507
509 DPRINT(
"USBPORT_FdoPower: IRP_MN_POWER_SEQUENCE\n");
510 break;
511
513 DPRINT(
"USBPORT_FdoPower: IRP_MN_SET_POWER\n");
515 {
517 }
518 else
519 {
521 }
522
524 break;
525
527
529 DPRINT(
"USBPORT_FdoPower: IRP_MN_QUERY_POWER\n");
531 break;
532
533 default:
534 DPRINT1(
"USBPORT_FdoPower: unknown IRP_MN_POWER!\n");
535 break;
536 }
537
541}
NTSTATUS NTAPI USBPORT_SystemPowerState(IN PDEVICE_OBJECT FdoDevice, IN PIRP Irp)
NTSTATUS NTAPI USBPORT_DevicePowerState(IN PDEVICE_OBJECT FdoDevice, IN PIRP Irp)
NTSTATUS NTAPI USBPORT_HcWake(IN PDEVICE_OBJECT FdoDevice, IN PIRP Irp)
#define IoCopyCurrentIrpStackLocationToNext(Irp)
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
struct _IO_STACK_LOCATION::@3978::@4014 Power
#define IRP_MN_POWER_SEQUENCE
#define IRP_MN_QUERY_POWER
Referenced by USBPORT_Dispatch().
◆ USBPORT_HcQueueWakeDpc()
Definition at line 63 of file power.c.
64{
66
67 DPRINT(
"USBPORT_HcQueueWakeDpc: ... \n");
68
71}
BOOLEAN NTAPI KeInsertQueueDpc(IN PKDPC Dpc, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
Referenced by USBPORT_InvalidateRootHub().
◆ USBPORT_HcWake()
◆ USBPORT_HcWakeDpc()
Definition at line 52 of file power.c.
56{
57 DPRINT(
"USBPORT_HcWakeDpc: ... \n");
59}
VOID NTAPI USBPORT_CompletePdoWaitWake(IN PDEVICE_OBJECT FdoDevice)
_In_opt_ PVOID DeferredContext
Referenced by USBPORT_StartDevice().
◆ USBPORT_IdleNotification()
Definition at line 612 of file power.c.
614{
620
621 DPRINT(
"USBPORT_IdleNotification: Irp - %p\n",
Irp);
622
626
628
629 if (LockCounter != 0)
630 {
632 {
634
636 Irp->IoStatus.Information = 0;
638
640 }
641
643 }
644
646 {
648
650 Irp->IoStatus.Information = 0;
652
654 }
655
658
660
662
664}
#define InterlockedIncrement
#define STATUS_DEVICE_BUSY
Referenced by USBPORT_PdoInternalDeviceControl().
◆ USBPORT_PdoDevicePowerState()
Definition at line 232 of file power.c.
234{
241
246
248
249 DPRINT1(
"USBPORT_PdoDevicePowerState: Irp - %p, State - %x\n",
252
254 {
256 {
257
259 {
261 }
262
264
266
269 }
270 else
271 {
272 DPRINT1(
"USBPORT_PdoDevicePowerState: FdoExtension->Flags - %lx\n",
274
277 }
278 }
282 {
286 }
287
289}
VOID NTAPI USBPORT_CompletePendingIdleIrp(IN PDEVICE_OBJECT PdoDevice)
VOID NTAPI USBPORT_SuspendController(IN PDEVICE_OBJECT FdoDevice)
NTSTATUS NTAPI USBPORT_ResumeController(IN PDEVICE_OBJECT FdoDevice)
NTSYSAPI void WINAPI DbgBreakPoint(void)
#define STATUS_UNSUCCESSFUL
NTSTATUS NTAPI USBPORT_Wait(IN PVOID MiniPortExtension, IN ULONG Milliseconds)
#define USBPORT_TMFLAG_WAKE
Referenced by USBPORT_PdoPower().
◆ USBPORT_PdoPower()
Definition at line 322 of file power.c.
324{
331
332 DPRINT(
"USBPORT_PdoPower: Irp - %p\n",
Irp);
333
338
340
342 {
344 DPRINT(
"USBPORT_PdoPower: IRP_MN_WAIT_WAKE\n");
345
347 {
348
350 break;
351 }
352
354
356
357
359 {
361 {
362
364
365 DPRINT(
"USBPORT_PdoPower: IRP_MN_WAIT_WAKE - STATUS_CANCELLED\n");
366
367
369 break;
370 }
371 }
372
374 {
375
376
377
378 DPRINT(
"USBPORT_PdoPower: IRP_MN_WAIT_WAKE - No WakeIrp\n");
379
382
385 }
386 else
387 {
388
389
390
391
393 {
394 DPRINT(
"USBPORT_PdoPower: IRP_MN_WAIT_WAKE - STATUS_DEVICE_BUSY\n");
395
399 break;
400 }
401 else
402 {
406 }
407 }
408
410 DPRINT(
"USBPORT_PdoPower: IRP_MN_POWER_SEQUENCE\n");
412 break;
413
415 DPRINT(
"USBPORT_PdoPower: IRP_MN_SET_POWER\n");
416
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
428 {
430 }
431 else
432 {
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
454 Irp->IoStatus.Information = 0;
456
458}
#define STATUS_NOT_SUPPORTED
NTSTATUS NTAPI USBPORT_PdoDevicePowerState(IN PDEVICE_OBJECT PdoDevice, IN PIRP Irp)
VOID NTAPI USBPORT_CancelPendingWakeIrp(IN PDEVICE_OBJECT PdoDevice, IN PIRP Irp)
#define USBPORT_FLAG_HC_STARTED
Referenced by USBPORT_Dispatch().
◆ USBPORT_ResumeController()
Definition at line 146 of file power.c.
147{
153
154 DPRINT1(
"USBPORT_ResumeController: ... \n");
155
158
160 {
162 }
163
165
168
170
172 {
175 }
176
177 FdoExtension->MiniPortFlags &= ~USBPORT_MPFLAG_SUSPENDED;
178
180 {
182
185 }
186
191
193
195
197
199
201 Packet->MiniPortResourcesSize);
202
204
207
209
210 if (!MpStatus)
211 {
213 }
214
216
220
222
224
226
228}
VOID NTAPI USBPORT_NukeAllEndpoints(IN PDEVICE_OBJECT FdoDevice)
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
#define RtlZeroMemory(Destination, Length)
VOID NTAPI USBPORT_MiniportInterrupts(IN PDEVICE_OBJECT FdoDevice, IN BOOLEAN IsEnable)
#define USBPORT_TMFLAG_HC_SUSPENDED
#define USBPORT_FLAG_HC_SUSPEND
#define USBPORT_TMFLAG_RH_SUSPENDED
#define USBPORT_MPFLAG_SUSPENDED
#define USBPORT_TMFLAG_HC_RESUME
Referenced by USBPORT_PdoDevicePowerState().
◆ USBPORT_SuspendController()
Definition at line 112 of file power.c.
113{
116
117 DPRINT1(
"USBPORT_SuspendController \n");
118
121
123
125
127 {
128 return;
129 }
130
132
134 {
136
139 }
140
142}
VOID NTAPI USBPORT_FlushController(IN PDEVICE_OBJECT FdoDevice)
#define USBPORT_MPFLAG_INTERRUPTS_ENABLED
Referenced by USBPORT_PdoDevicePowerState().
◆ USBPORT_SystemPowerState()