ReactOS 0.4.17-dev-1133-gc25e4fd
hub.cpp File Reference
#include "usbhub3.h"
#include <debug.h>
Include dependency graph for hub.cpp:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

NTSTATUS NTAPI HubEvtDeviceAdd (_In_ WDFDRIVER Driver, _Inout_ PWDFDEVICE_INIT DeviceInit)
 
NTSTATUS NTAPI HubEvtDevicePrepareHardware (_In_ WDFDEVICE Device, _In_ WDFCMRESLIST ResourcesRaw, _In_ WDFCMRESLIST ResourcesTranslated)
 
NTSTATUS NTAPI HubEvtDeviceReleaseHardware (_In_ WDFDEVICE Device, _In_ WDFCMRESLIST ResourcesTranslated)
 
NTSTATUS NTAPI HubEvtDeviceD0Entry (_In_ WDFDEVICE Device, _In_ WDF_POWER_DEVICE_STATE PreviousState)
 
NTSTATUS NTAPI HubEvtDeviceD0Exit (_In_ WDFDEVICE Device, _In_ WDF_POWER_DEVICE_STATE TargetState)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 10 of file hub.cpp.

Function Documentation

◆ HubEvtDeviceAdd()

NTSTATUS NTAPI HubEvtDeviceAdd ( _In_ WDFDRIVER  Driver,
_Inout_ PWDFDEVICE_INIT  DeviceInit 
)

Definition at line 15 of file hub.cpp.

18{
22 WDFDEVICE Device;
24
26 PAGED_CODE();
27
28 WdfDeviceInitSetDeviceType(DeviceInit, FILE_DEVICE_USB);
29
35 WdfDeviceInitSetPnpPowerEventCallbacks(DeviceInit, &PnpPower);
36
38
39 Status = WdfDeviceCreate(&DeviceInit, &Attributes, &Device);
40 if (!NT_SUCCESS(Status))
41 {
42 DPRINT1("WdfDeviceCreate failed 0x%lx\n", Status);
43 return Status;
44 }
45
46 Hub = HubGetFdoContext(Device);
47 Hub->Device = Device;
48 Hub->ParentTarget = WdfDeviceGetIoTarget(Device);
49
50 return STATUS_SUCCESS;
51}
#define PAGED_CODE()
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
_In_ ULONG Attributes
Definition: dispmprt.h:1077
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
Status
Definition: gdiplustypes.h:24
_Must_inspect_result_ _In_ PUCXHUB_DEVICE_CREATE_INFO _Out_ UCXUSBDEVICE * Device
Definition: hubucx.h:258
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
#define STATUS_SUCCESS
Definition: shellext.h:65
WDFIOTARGET ParentTarget
Definition: usbhub3.h:21
WDFDEVICE Device
Definition: usbhub3.h:20
PFN_WDF_DEVICE_D0_ENTRY EvtDeviceD0Entry
Definition: wdfdevice.h:1164
PFN_WDF_DEVICE_D0_EXIT EvtDeviceD0Exit
Definition: wdfdevice.h:1166
PFN_WDF_DEVICE_PREPARE_HARDWARE EvtDevicePrepareHardware
Definition: wdfdevice.h:1168
PFN_WDF_DEVICE_RELEASE_HARDWARE EvtDeviceReleaseHardware
Definition: wdfdevice.h:1169
EVT_WDF_DEVICE_D0_ENTRY HubEvtDeviceD0Entry
Definition: usbhub3.h:33
EVT_WDF_DEVICE_RELEASE_HARDWARE HubEvtDeviceReleaseHardware
Definition: usbhub3.h:32
EVT_WDF_DEVICE_PREPARE_HARDWARE HubEvtDevicePrepareHardware
Definition: usbhub3.h:31
EVT_WDF_DEVICE_D0_EXIT HubEvtDeviceD0Exit
Definition: usbhub3.h:34
#define FILE_DEVICE_USB
Definition: usbiodef.h:90
_In_ PWDFDEVICE_INIT DeviceInit
Definition: wdfcontrol.h:113
_Must_inspect_result_ _In_ WDFDRIVER Driver
Definition: wdfcontrol.h:83
FORCEINLINE VOID WDF_PNPPOWER_EVENT_CALLBACKS_INIT(_Out_ PWDF_PNPPOWER_EVENT_CALLBACKS Callbacks)
Definition: wdfdevice.h:1214
#define WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(_attributes, _contexttype)
Definition: wdfobject.h:170

◆ HubEvtDeviceD0Entry()

NTSTATUS NTAPI HubEvtDeviceD0Entry ( _In_ WDFDEVICE  Device,
_In_ WDF_POWER_DEVICE_STATE  PreviousState 
)

Definition at line 84 of file hub.cpp.

87{
90
91 /* Power the ports and arm the status change interrupt transfer */
93 return STATUS_SUCCESS;
94}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
_In_ WDF_POWER_DEVICE_STATE PreviousState
Definition: wdfdevice.h:829

◆ HubEvtDeviceD0Exit()

NTSTATUS NTAPI HubEvtDeviceD0Exit ( _In_ WDFDEVICE  Device,
_In_ WDF_POWER_DEVICE_STATE  TargetState 
)

Definition at line 98 of file hub.cpp.

101{
104
106 return STATUS_SUCCESS;
107}
_In_ WDF_POWER_DEVICE_STATE TargetState
Definition: wdfdevice.h:859

◆ HubEvtDevicePrepareHardware()

NTSTATUS NTAPI HubEvtDevicePrepareHardware ( _In_ WDFDEVICE  Device,
_In_ WDFCMRESLIST  ResourcesRaw,
_In_ WDFCMRESLIST  ResourcesTranslated 
)

Definition at line 55 of file hub.cpp.

59{
63
64 /* Query the controller stack interface from the parent, read the hub descriptor */
66 return STATUS_SUCCESS;
67}
_In_ WDFCMRESLIST _In_ WDFCMRESLIST ResourcesTranslated
Definition: wdfdevice.h:891
_In_ WDFCMRESLIST ResourcesRaw
Definition: wdfdevice.h:888

◆ HubEvtDeviceReleaseHardware()

NTSTATUS NTAPI HubEvtDeviceReleaseHardware ( _In_ WDFDEVICE  Device,
_In_ WDFCMRESLIST  ResourcesTranslated 
)

Definition at line 71 of file hub.cpp.