ReactOS 0.4.17-dev-1281-g065abb3
rhub.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS USB Host Controller Extension
3 * LICENSE: MIT (https://spdx.org/licenses/MIT)
4 * PURPOSE: UCXROOTHUB object and its two virtual endpoints
5 * COPYRIGHT: Copyright 2026 Justin Miller <justin.miller@reactos.org>
6 */
7
8#include "ucx01000.h"
9
10#define NDEBUG
11#include <debug.h>
12
15 _In_ UCXROOTHUB Handle)
16{
17 return UcxGetRootHubContext(Handle);
18}
19
23 _In_ UCXCONTROLLER Controller,
26 _Out_ UCXROOTHUB* RootHub)
27{
28 WDF_OBJECT_ATTRIBUTES UcxAttributes;
35
36 PAGED_CODE();
37
38 *RootHub = NULL;
39
42
43 if (Attributes != NULL)
44 Attributes->ParentObject = Controller;
45 else
46 UcxAttributes.ParentObject = Controller;
47
49 Attributes != NULL ? &UcxAttributes : NULL,
50 &Object);
51 if (!NT_SUCCESS(Status))
52 {
53 DPRINT1("Root hub object create failed 0x%lx\n", Status);
54 return Status;
55 }
56
57 Context = new (UcxGetRootHubContext(Object)) UcxRootHub();
58 Context->m_Handle = (UCXROOTHUB)Object;
59
60 /* The same handle doubles as the root hub's UCXUSBDEVICE */
63 if (NT_SUCCESS(Status))
64 {
65 Context->m_Device = new (DeviceContext) UcxUsbDevice();
66 Status = Context->Initialize(ControllerContext, Config);
67 }
68 else
69 {
70 DPRINT1("Root hub device context allocation failed 0x%lx\n", Status);
71 }
72
73 if (!NT_SUCCESS(Status))
74 {
76 return Status;
77 }
78
79 {
80 SpinLockGuard Guard(&ControllerContext->m_TopologyLock);
81
82 ControllerContext->m_RootHub = Context;
83 ControllerContext->m_ChildDeviceCount = 1;
84 }
85
86 *RootHub = Context->m_Handle;
87 DPRINT("Root hub %p created for controller %p\n", Context, ControllerContext);
88 return STATUS_SUCCESS;
89}
90
95{
97
100
101 /* The HCD's size is trusted only as far as the structure we know */
103 RtlCopyMemory(&m_Config, Config, min(Config->Size, (ULONG)sizeof(m_Config)));
104
105 /* Speed is set first so the endpoints get the SuperSpeed transfer limits */
107
109 if (!NT_SUCCESS(Status))
110 return Status;
111
113 if (!NT_SUCCESS(Status))
114 return Status;
115
116 return CreatePdo();
117}
118
123{
126 WDF_IO_QUEUE_CONFIG QueueConfig;
129 UCXENDPOINT EndpointHandle;
130 WDFQUEUE Queue;
132
133 if (Interrupt)
134 {
138 }
139 else
140 {
142 QueueConfig.Settings.Parallel.NumberOfPresentedRequests =
146 }
147 QueueAttributes.ParentObject = m_Handle;
148
149 Status = WdfIoQueueCreate(m_Controller->m_Fdo, &QueueConfig, &QueueAttributes, &Queue);
150 if (!NT_SUCCESS(Status))
151 {
152 DPRINT1("Root hub %s queue create failed 0x%lx\n", Interrupt ? "interrupt" : "control", Status);
153 return Status;
154 }
155
157 Status = WdfIoQueueAssignForwardProgressPolicy(Queue, &Policy);
158 if (!NT_SUCCESS(Status))
159 {
160 DPRINT1("Root hub %s queue forward progress setup failed 0x%lx\n", Interrupt ? "interrupt" : "control", Status);
161 return Status;
162 }
163
164 RtlZeroMemory(&Init, sizeof(Init));
165 Init.Kind = Interrupt ? UcxEndpointKind::Generic : UcxEndpointKind::Default;
166 Init.TransferType = Interrupt ? UcxTransferType::Interrupt : UcxTransferType::Control;
167 Init.Device = (UCXUSBDEVICE)m_Handle;
168 Init.CreateMachine = FALSE;
169
170 Status = UcxEndpoint::Create((UCXUSBDEVICE)m_Handle, &InitPointer, NULL, &EndpointHandle);
171 if (!NT_SUCCESS(Status))
172 {
173 DPRINT1("Root hub %s endpoint create failed 0x%lx\n", Interrupt ? "interrupt" : "control", Status);
174 return Status;
175 }
176
177 UcxEndpoint::FromHandle(EndpointHandle)->SetWdfIoQueue(Queue);
178
179 if (Interrupt)
180 {
181 UcxInterruptQueueState* State = UcxGetInterruptQueueState(Queue);
182
183 KeInitializeSpinLock(&State->PortChangeLock);
184
185 /* Different start values, so the very first transfer always reaches the HCD */
186 State->PortChangeGeneration = 1;
187 State->PortChangeGenerationProcessed = 0;
188 KeInitializeEvent(&State->NoIndicateWakeInProgress, NotificationEvent, TRUE);
189 State->RootHub = this;
190
193 m_InterruptEndpoint = UcxEndpoint::FromHandle(EndpointHandle);
194 DPRINT("Root hub %p interrupt endpoint %p\n", this, m_InterruptEndpoint);
195 }
196 else
197 {
198 UcxGetControlQueueContext(Queue)->RootHub = this;
199
201 m_ControlEndpoint = UcxEndpoint::FromHandle(EndpointHandle);
202 DPRINT("Root hub %p control endpoint %p\n", this, m_ControlEndpoint);
203 }
204
205 return STATUS_SUCCESS;
206}
207
208VOID
209UcxRootHub::EvtCleanup(
211{
212 UcxRootHub* RootHub = UcxGetRootHubContext(Object);
213 UcxController* Controller = RootHub->m_Controller;
214
215 if (Controller == NULL)
216 return;
217
218 SpinLockGuard Guard(&Controller->m_TopologyLock);
219
220 Controller->m_RootHub = NULL;
221 Controller->m_ChildDeviceCount--;
222}
223
224/* Port changes and the status change transfer */
225
226VOID
228{
230 WDFREQUEST Release = NULL;
231 BOOLEAN IndicateWake;
232
233 DPRINT("Root hub %p port change\n", this);
234
235 {
236 SpinLockGuard Guard(&State->PortChangeLock);
237
238 State->PortChangeGeneration++;
239
240 /* If the cancel routine already owns the held transfer, it completes it */
241 if (State->HeldTransfer != NULL &&
242 NT_SUCCESS(WdfRequestUnmarkCancelable(State->HeldTransfer)))
243 {
244 Release = State->HeldTransfer;
245 State->HeldTransfer = NULL;
246 State->PortChangeGenerationProcessed = State->PortChangeGeneration;
247 }
248
249 IndicateWake = State->IndicateWakeEnabled;
250 if (IndicateWake)
251 KeClearEvent(&State->NoIndicateWakeInProgress);
252 }
253
254 if (IndicateWake)
255 {
256 /* Raised so a D0 IRP the wake triggers never runs inline on this thread */
257 {
258 DispatchLevelGuard Raise;
259
260 WdfDeviceIndicateWakeStatus(m_Pdo, STATUS_SUCCESS);
261 }
262 KeSetEvent(&State->NoIndicateWakeInProgress, IO_NO_INCREMENT, FALSE);
263 }
264
265 if (Release == NULL)
266 return;
267
268 if (!m_Controller->BlockReset())
269 {
270 DPRINT1("Root hub %p failing held status change transfer %p, controller resetting\n", this, Release);
271 WdfRequestComplete(Release, STATUS_NO_SUCH_DEVICE);
272 return;
273 }
274
277}
278
279VOID
280NTAPI
282 _In_ WDFREQUEST Request)
283{
284 UcxInterruptQueueState* State = UcxGetInterruptQueueState(WdfRequestGetIoQueue(Request));
285
286 {
287 SpinLockGuard Guard(&State->PortChangeLock);
288
289 State->HeldTransfer = NULL;
290 State->LastTransferCanceled = TRUE;
291 }
292
293 DPRINT("Held status change transfer %p canceled\n", Request);
294 WdfRequestComplete(Request, STATUS_CANCELLED);
295}
296
297/* A transfer marked as nothing changed is held by UCX until a port changes */
298VOID
299NTAPI
301 _In_ WDFQUEUE Queue,
302 _In_ WDFREQUEST Request,
304 _In_ size_t InputBufferLength,
306{
307 UcxInterruptQueueState* State = UcxGetInterruptQueueState(Queue);
308 UcxRootHub* RootHub = State->RootHub;
310 NTSTATUS HoldStatus = STATUS_SUCCESS;
311 BOOLEAN Hold;
312
316
318
319 {
320 SpinLockGuard Guard(&State->PortChangeLock);
321
322 State->LastTransferCanceled = FALSE;
323
324 Hold = (Urb->UrbHeader.UsbdFlags & UCXHUB_URB_FLAG_PEND_INTERRUPT_TX) != 0 &&
325 State->PortChangeGeneration == State->PortChangeGenerationProcessed;
326
327 if (!Hold)
328 {
329 State->PortChangeGenerationProcessed = State->PortChangeGeneration;
330 }
331 else
332 {
333 HoldStatus = WdfRequestMarkCancelableEx(Request, UcxEvtRootHubHeldTransferCancel);
334 if (NT_SUCCESS(HoldStatus))
335 State->HeldTransfer = Request;
336 }
337 }
338
339 if (!NT_SUCCESS(HoldStatus))
340 {
341 DPRINT1("Root hub %p could not hold status change transfer %p 0x%lx\n", RootHub, Request, HoldStatus);
342 WdfRequestComplete(Request, HoldStatus);
343 return;
344 }
345
346 if (Hold)
347 return;
348
349 if (!RootHub->m_Controller->BlockReset())
350 {
351 DPRINT1("Root hub %p failing status change transfer %p, controller resetting\n", RootHub, Request);
352 WdfRequestComplete(Request, STATUS_NO_SUCH_DEVICE);
353 return;
354 }
355
356 RootHub->m_Config.EvtRootHubInterruptTx(RootHub->m_Handle, Request);
357 RootHub->m_Controller->UnblockReset();
358}
359
360/* Hub class requests to the root hub */
361
362/* bmRequestType decoding: recipient bits 0 and 1 only, type bits 5 and 6, direction bit 7 */
363#define UCX_RECIPIENT(Type) ((Type) & 0x03)
364#define UCX_REQUEST_TYPE(Type) (((Type) >> 5) & 0x03)
365#define UCX_DIRECTION_IN(Type) (((Type) & 0x80) != 0)
366
367#define UCX_RECIPIENT_DEVICE 0
368#define UCX_RECIPIENT_OTHER 3
369#define UCX_TYPE_STANDARD 0
370#define UCX_TYPE_CLASS 1
371
373static
375NTAPI
380{
381 UCHAR Recipient = UCX_RECIPIENT(Setup->bmRequestType.B);
382 UCHAR Type = UCX_REQUEST_TYPE(Setup->bmRequestType.B);
383 BOOLEAN In = UCX_DIRECTION_IN(Setup->bmRequestType.B);
384 BOOLEAN ToDevice = (Recipient == UCX_RECIPIENT_DEVICE);
385 BOOLEAN ToPort = (Recipient == UCX_RECIPIENT_OTHER);
386
387 *Callback = NULL;
388
389 if (Type == UCX_TYPE_CLASS && (ToDevice || ToPort))
390 {
391 switch (Setup->bRequest)
392 {
394 if (In)
395 break;
396 *Callback = ToDevice ? Config->EvtRootHubClearHubFeature
397 : Config->EvtRootHubClearPortFeature;
398 return TRUE;
399
401 if (!In)
402 break;
403 *Callback = ToDevice ? Config->EvtRootHubGetHubStatus
404 : Config->EvtRootHubGetPortStatus;
405 return TRUE;
406
408 if (In)
409 break;
410 *Callback = ToDevice ? Config->EvtRootHubSetHubFeature
411 : Config->EvtRootHubSetPortFeature;
412 return TRUE;
413 }
414 }
415
416 /* Matched as a standard device request, not the hub class form */
417 if (Type == UCX_TYPE_STANDARD && ToDevice && In &&
419 {
420 *Callback = Config->EvtRootHubGetPortErrorCount;
421 return TRUE;
422 }
423
424 return FALSE;
425}
426
427VOID
428NTAPI
430 _In_ WDFQUEUE Queue,
431 _In_ WDFREQUEST Request,
433 _In_ size_t InputBufferLength,
435{
436 UcxRootHub* RootHub = UcxGetControlQueueContext(Queue)->RootHub;
440
444
445 if (!RootHub->m_Controller->BlockReset())
446 {
447 DPRINT1("Root hub %p failing control transfer %p, controller resetting\n", RootHub, Request);
448 WdfRequestComplete(Request, STATUS_NO_SUCH_DEVICE);
449 return;
450 }
451
452 /* Same offset in the plain and the _EX control transfer URBs */
453 Setup = (PUSB_DEFAULT_PIPE_SETUP_PACKET)Urb->UrbControlTransfer.SetupPacket;
454
455 /* A recognized hub request with no callback is not offered to EvtRootHubControlUrb */
457 Callback = RootHub->m_Config.EvtRootHubControlUrb;
458
459 if (Callback != NULL)
460 Callback(RootHub->m_Handle, Request);
461
462 RootHub->m_Controller->UnblockReset();
463
464 if (Callback == NULL)
465 {
466 DPRINT1("Root hub %p has no callback for request 0x%x type 0x%x\n",
467 RootHub, Setup->bRequest, Setup->bmRequestType.B);
469 WdfRequestComplete(Request, STATUS_NOT_SUPPORTED);
470 }
471}
472
473/* Controller reset hooks */
474
475/* Queued requests fail and new ones are refused until ResumeIo */
476VOID
478{
479 DPRINT("Root hub %p failing I/O for controller reset\n", this);
480 WdfIoQueuePurge(m_InterruptQueue, NULL, NULL);
481 WdfIoQueuePurge(m_ControlQueue, NULL, NULL);
482}
483
484VOID
486{
487 {
489
490 /* The next status change transfer goes to the HCD even if flagged */
492 }
493
494 DPRINT("Root hub %p resuming I/O\n", this);
495 WdfIoQueueStart(m_InterruptQueue);
496 WdfIoQueueStart(m_ControlQueue);
497}
498
499VOID
502{
505
507
509 Flags->AsUlong = 0;
510
512 Flags->HostContextLost = 1;
513
515
516 if (!Succeeded)
517 DPRINT1("Root hub %p async reset IRP %p failed\n", this, Irp);
518
519 Irp->IoStatus.Status = Succeeded ? STATUS_SUCCESS : STATUS_NO_SUCH_DEVICE;
520 Irp->IoStatus.Information = 0;
522}
523
524/* ROOTHUB_GET_INFO, called with a reset reference held */
525VOID
527 _In_ WDFREQUEST Request,
529{
530 /* The HCD only knows ROOTHUB_INFO; the completion routine restores the size */
531 Info->Info.Size = sizeof(Info->Info);
532 Info->InterruptPipe = m_InterruptEndpoint->m_Pipe.Handle();
533
534 DPRINT("Root hub %p GetInfo request %p to HCD\n", this, Request);
536}
537
541 _Out_ WDFSTRING* Name)
542{
544
546 {
547 *Name = NULL;
548 return STATUS_UNSUCCESSFUL;
549 }
550
553 return STATUS_SUCCESS;
554}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define PAGED_CODE()
Type
Definition: Type.h:7
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE ACPI_ADR_SPACE_HANDLER ACPI_ADR_SPACE_SETUP Setup
Definition: acpixf.h:834
unsigned char BOOLEAN
Definition: actypes.h:127
#define InterlockedExchange
Definition: armddk.h:54
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
_In_ BOOLEAN Release
Definition: cdrom.h:920
WDFDEVICE m_Fdo
Definition: hostctl.h:288
BOOLEAN BlockReset()
Definition: hostctl.cpp:507
UcxRootHub * m_RootHub
Definition: hostctl.h:302
static UcxController * FromHandle(_In_ UCXCONTROLLER Handle)
Definition: hostctl.cpp:14
LONG m_RootHubResetSeen
Definition: hostctl.h:321
KSPIN_LOCK m_TopologyLock
Definition: hostctl.h:310
LONG m_DeviceContextsLost
Definition: hostctl.h:320
VOID UnblockReset()
Definition: hostctl.cpp:522
ULONG m_ChildDeviceCount
Definition: hostctl.h:311
VOID SetWdfIoQueue(_In_ WDFQUEUE Queue)
Definition: pipe.cpp:313
UcxPipe m_Pipe
Definition: pipe.h:284
UcxEndpoint * m_ControlEndpoint
Definition: rhub.h:121
VOID FailIo()
Definition: rhub.cpp:477
WDFSTRING m_SymbolicName
Definition: rhub.h:137
WDFDEVICE m_Pdo
Definition: rhub.h:135
WDFQUEUE m_InterruptQueue
Definition: rhub.h:124
static UcxRootHub * FromHandle(_In_ UCXROOTHUB Handle)
Definition: rhub.cpp:14
WDFQUEUE m_ControlQueue
Definition: rhub.h:123
VOID DispatchGetInfo(_In_ WDFREQUEST Request, _Inout_ PUCXHUB_ROOTHUB_INFO Info)
Definition: rhub.cpp:526
NTSTATUS CreatePdo()
Definition: rhubpdo.cpp:129
KSPIN_LOCK m_PdoInfoLock
Definition: rhub.h:134
UcxInterruptQueueState * m_InterruptState
Definition: rhub.h:125
NTSTATUS Initialize(_In_ UcxController *Controller, _In_ PUCX_ROOTHUB_CONFIG Config)
Definition: rhub.cpp:92
VOID PortChanged()
Definition: rhub.cpp:227
static EVT_WDF_OBJECT_CONTEXT_CLEANUP EvtCleanup
Definition: rhub.h:165
UCX_ROOTHUB_CONFIG m_Config
Definition: rhub.h:116
UcxController * m_Controller
Definition: rhub.h:115
UcxEndpoint * m_InterruptEndpoint
Definition: rhub.h:122
VOID FinishPortResetRequest(_In_ BOOLEAN Succeeded)
Definition: rhub.cpp:500
UCXROOTHUB m_Handle
Definition: rhub.h:114
BOOLEAN m_PdoStarted
Definition: rhub.h:136
NTSTATUS ReferenceSymbolicName(_Out_ WDFSTRING *Name)
Definition: rhub.cpp:540
VOID ResumeIo()
Definition: rhub.cpp:485
static _Must_inspect_result_ NTSTATUS Create(_In_ UCXCONTROLLER Controller, _In_ PUCX_ROOTHUB_CONFIG Config, _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes, _Out_ UCXROOTHUB *RootHub)
Definition: rhub.cpp:22
UcxUsbDevice * m_Device
Definition: rhub.h:119
PIRP m_PendingAsyncReset
Definition: rhub.h:140
NTSTATUS CreateEndpoint(_In_ BOOLEAN Interrupt)
Definition: rhub.cpp:121
VOID InitializeAsRootHub(_In_ UCXROOTHUB Handle, _In_ UcxController *Controller)
Definition: devobj.cpp:50
#define STATUS_NOT_SUPPORTED
Definition: d3dkmdt.h:48
LPWSTR Name
Definition: desk.c:124
@ In
_In_ ULONG Attributes
Definition: dispmprt.h:1077
_In_ ULONG _In_ ULONG _In_opt_ DXGKCB_MIRACAST_SEND_MESSAGE_CALLBACK Callback
Definition: dispmprt.h:620
_In_ D3DDDI_VIDEO_PRESENT_TARGET_ID _In_ ULONG _In_ ULONG Flags
Definition: dispmprt.h:245
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
#define KeSetEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:476
#define KeInitializeSpinLock(sl)
Definition: env_spec_w32.h:604
VOID NTAPI KeClearEvent(IN PKEVENT Event)
Definition: eventobj.c:22
ULONG Handle
Definition: gdb_input.c:15
Status
Definition: gdiplustypes.h:24
_In_ UCXHUB_DEVICE_CONTEXT DeviceContext
Definition: hubucx.h:237
union _UCXHUB_RESET_FLAGS * PUCXHUB_RESET_FLAGS
#define UCXHUB_URB_FLAG_PEND_INTERRUPT_TX
Definition: hubucx.h:100
_In_ PIRP Irp
Definition: kse.h:79
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_ PVOID Context
Definition: kse.h:81
if(dx< 0)
Definition: linetemp.h:194
#define min(a, b)
Definition: monoChain.cc:55
#define _Inout_
Definition: no_sal2.h:162
#define _Must_inspect_result_
Definition: no_sal2.h:62
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
@ NotificationEvent
#define IoCompleteRequest
Definition: irp.c:1272
#define UCX_RECIPIENT(Type)
Definition: rhub.cpp:363
static BOOLEAN NTAPI UcxClassifyRootHubRequest(_In_ const UCX_ROOTHUB_CONFIG *Config, _In_ const USB_DEFAULT_PIPE_SETUP_PACKET *Setup, _Out_ PFN_UCX_ROOTHUB_CONTROL_URB *Callback)
Definition: rhub.cpp:376
#define UCX_RECIPIENT_DEVICE
Definition: rhub.cpp:367
#define UCX_TYPE_CLASS
Definition: rhub.cpp:370
#define UCX_TYPE_STANDARD
Definition: rhub.cpp:369
#define UCX_REQUEST_TYPE(Type)
Definition: rhub.cpp:364
#define UCX_DIRECTION_IN(Type)
Definition: rhub.cpp:365
#define UCX_RECIPIENT_OTHER
Definition: rhub.cpp:368
EVT_WDF_REQUEST_CANCEL UcxEvtRootHubHeldTransferCancel
Definition: rhub.h:175
EVT_WDF_IO_QUEUE_IO_INTERNAL_DEVICE_CONTROL UcxEvtRootHubControlTransfer
Definition: rhub.h:174
EVT_WDF_IO_QUEUE_IO_INTERNAL_DEVICE_CONTROL UcxEvtRootHubInterruptTransfer
Definition: rhub.h:173
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
KSPIN_LOCK PortChangeLock
Definition: rhub.h:13
USHORT PortChangeGeneration
Definition: rhub.h:16
USBD_PIPE_HANDLE Handle()
Definition: pipe.h:60
PVOID Arg1
Definition: ucxutil.h:103
struct _IO_STACK_LOCATION::@5100::@5139 Others
union _IO_STACK_LOCATION::@1823 Parameters
ULONG NumberOfPresentedControlUrbCallbacks
Definition: ucxroothub.h:191
PFN_UCX_ROOTHUB_GET_INFO EvtRootHubGetInfo
Definition: ucxroothub.h:201
PFN_UCX_ROOTHUB_INTERRUPT_TX EvtRootHubInterruptTx
Definition: ucxroothub.h:200
Definition: usb.h:565
PFN_WDF_IO_QUEUE_IO_INTERNAL_DEVICE_CONTROL EvtIoInternalDeviceControl
Definition: wdfio.h:407
struct _WDF_IO_QUEUE_CONFIG::@4710::@4711 Parallel
union _WDF_IO_QUEUE_CONFIG::@4710 Settings
WDFOBJECT ParentObject
Definition: wdfobject.h:130
PFN_WDF_OBJECT_CONTEXT_CLEANUP EvtCleanupCallback
Definition: wdfobject.h:109
unsigned char UCHAR
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFREQUEST _In_ size_t _In_ size_t _In_ ULONG IoControlCode
_Must_inspect_result_ _In_ WDFDEVICE _In_ PUCX_CONTROLLER_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ UCXCONTROLLER * Controller
_Must_inspect_result_ _In_ WDFDEVICE _In_ PUCX_CONTROLLER_CONFIG Config
_In_ PGUID _In_ ULONG OutputBufferLength
Definition: ucxcontroller.h:81
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFREQUEST Request
EVT_UCX_ROOTHUB_CONTROL_URB * PFN_UCX_ROOTHUB_CONTROL_URB
Definition: ucxroothub.h:151
_Must_inspect_result_ _In_ UCXCONTROLLER _In_ PUCX_ROOTHUB_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ UCXROOTHUB * RootHub
Definition: ucxroothub.h:299
_Must_inspect_result_ NTSTATUS NTAPI UcxCreateObjectWithTwoContexts(_In_ PWDF_OBJECT_ATTRIBUTES Primary, _In_opt_ PWDF_OBJECT_ATTRIBUTES Secondary, _Out_ WDFOBJECT *Object)
Definition: ucxutil.cpp:19
#define UCX_POOL_TAG
Definition: ucxutil.h:11
#define STATUS_NO_SUCH_DEVICE
Definition: udferr_usr.h:136
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define STATUS_CANCELLED
Definition: udferr_usr.h:170
#define USB_REQUEST_GET_STATUS
Definition: usb100.h:78
#define USB_REQUEST_SET_FEATURE
Definition: usb100.h:80
#define USB_REQUEST_CLEAR_FEATURE
Definition: usb100.h:79
struct _USB_DEFAULT_PIPE_SETUP_PACKET * PUSB_DEFAULT_PIPE_SETUP_PACKET
#define USB_REQUEST_GET_PORT_ERR_COUNT
Definition: usb200.h:289
struct _URB * PURB
#define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER
Definition: usb.h:95
_In_opt_ PUSB_CONFIGURATION_DESCRIPTOR _Inout_ PUSBD_INTERFACE_LIST_ENTRY _Outptr_ PURB * Urb
Definition: usbdlib.h:333
WdfObjectDelete(String)
BOOL InitPointer(PPDEV ppdev)
Definition: pointer.c:143
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
Definition: wdfdevice.h:2231
_Must_inspect_result_ _Inout_ PWDFDEVICE_INIT _In_opt_ PWDF_OBJECT_ATTRIBUTES DeviceAttributes
Definition: wdfdevice.h:3569
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFINTERRUPT * Interrupt
Definition: wdfinterrupt.h:379
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY Policy
Definition: wdfinterrupt.h:653
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_IO_QUEUE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES QueueAttributes
Definition: wdfio.h:617
FORCEINLINE VOID WDF_IO_QUEUE_FORWARD_PROGRESS_POLICY_DEFAULT_INIT(_Out_ PWDF_IO_QUEUE_FORWARD_PROGRESS_POLICY Policy, _In_ ULONG TotalForwardProgressRequests)
Definition: wdfio.h:556
FORCEINLINE VOID WDF_IO_QUEUE_CONFIG_INIT(_Out_ PWDF_IO_QUEUE_CONFIG Config, _In_ WDF_IO_QUEUE_DISPATCH_TYPE DispatchType)
Definition: wdfio.h:426
@ WdfIoQueueDispatchSequential
Definition: wdfio.h:78
@ WdfIoQueueDispatchParallel
Definition: wdfio.h:79
#define WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(_attributes, _contexttype)
Definition: wdfobject.h:170
#define WdfObjectReferenceWithTag(Handle, Tag)
Definition: wdfobject.h:806
FORCEINLINE NTSTATUS WdfObjectAllocateContext(_In_ WDFOBJECT Handle, _In_ PWDF_OBJECT_ATTRIBUTES ContextAttributes, _Outptr_opt_ PVOID *Context)
Definition: wdfobject.h:587
#define IO_NO_INCREMENT
Definition: iotypes.h:598
#define NT_ASSERT
Definition: rtlfuncs.h:3334