ReactOS 0.4.17-dev-1281-g065abb3
hubinterface.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: Query interfaces the root hub PDO answers
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
13VOID
17{
19}
20
21/* Stack interface members. The Hub argument is unused unless noted. */
22
23static
27 _In_ UCXUSBDEVICE Hub,
29 _Out_ UCXUSBDEVICE* Device)
30{
31 return UcxUsbDevice::CreateFromHub(Hub, CreateInfo, Device);
32}
33
34static
35VOID
38 _In_ UCXUSBDEVICE Hub,
39 _In_ UCXUSBDEVICE Device)
40{
42
43 UcxUsbDevice::FromHandle(Device)->DeleteFromHub();
44}
45
46static
47VOID
50 _In_ UCXUSBDEVICE Hub,
52{
53 UcxUsbDevice::FromHandle(Hub)->DisconnectPort(PortNumber);
54}
55
56static
57VOID
60 _In_ UCXUSBDEVICE Hub,
61 _In_ UCXUSBDEVICE Device,
63{
65
66 UcxUsbDevice::FromHandle(Device)->SetPdo(Pdo);
67}
68
69static
73 _In_ UCXUSBDEVICE Hub,
74 _In_ UCXUSBDEVICE Device,
76 _Out_ UCXENDPOINT* Endpoint)
77{
79
80 return UcxEndpoint::CreateDefaultFromHub(Device, MaxPacketSize, Endpoint);
81}
82
83static
84VOID
87 _In_ UCXUSBDEVICE Hub,
88 _In_ UCXUSBDEVICE Device)
89{
91
92 UcxUsbDevice::FromHandle(Hub)->m_Controller->Address0Release(Hub);
93}
94
95static
99 _In_ UCXUSBDEVICE Hub,
100 _In_ UCXUSBDEVICE Device,
104 _Out_ UCXENDPOINT* Endpoint)
105{
107
108 return UcxEndpoint::CreateFromHub(Device, Descriptor, DescriptorBufferLength, Companion, Endpoint);
109}
110
111static
112VOID
113NTAPI
115 _In_ UCXUSBDEVICE Hub,
116 _In_ UCXUSBDEVICE Device,
117 _In_ UCXENDPOINT Endpoint)
118{
121
122 UcxEndpoint::FromHandle(Endpoint)->DeleteFromHub();
123}
124
125/* Set when the hub hands the pipe to a client driver; never cleared */
126static
127VOID
128NTAPI
130 _In_ UCXENDPOINT Endpoint)
131{
132 UcxEndpoint::FromHandle(Endpoint)->m_ClientHoldsHandle = TRUE;
133}
134
135static
137NTAPI
139 _In_ UCXENDPOINT Endpoint)
140{
141 return UcxEndpoint::FromHandle(Endpoint)->m_Pipe.Handle();
142}
143
144static
145ULONG
146NTAPI
148 _In_ UCXENDPOINT Endpoint)
149{
150 return UcxEndpoint::FromHandle(Endpoint)->m_Pipe.MaximumTransferSize;
151}
152
153static
155NTAPI
157 _In_ UCXUSBDEVICE Hub,
160{
161 return UcxWorkItem::Allocate(UcxUsbDevice::FromHandle(Hub)->m_Controller, DeviceObject, Flags);
162}
163
164static
165VOID
166NTAPI
169{
170 WorkItem->Free();
171}
172
173static
174VOID
175NTAPI
181{
182 WorkItem->Enqueue(Routine, Context, Options);
183}
184
185static
186VOID
187NTAPI
190{
191 WorkItem->Flush();
192}
193
194static
195VOID
196NTAPI
198 _In_ UCXUSBDEVICE Hub,
199 _In_ UCXENDPOINT Endpoint)
200{
202
203 UcxEndpoint::FromHandle(Endpoint)->ReleaseCancelSync();
204}
205
206/* Ancestors are not checked; a disconnect already marked every descendant */
207static
209NTAPI
211 _In_ UCXUSBDEVICE Device)
212{
213 return UcxUsbDevice::FromHandle(Device)->m_Disconnected;
214}
215
216static
218NTAPI
220 _In_ UCXUSBDEVICE Hub)
221{
222 return UcxUsbDevice::FromHandle(Hub)->m_Controller->QueryStreamsSupported();
223}
224
225static
227NTAPI
229 _In_ UCXUSBDEVICE Hub,
231{
232 return UcxUsbDevice::FromHandle(Hub)->m_Controller->StopIdle(Context);
233}
234
235static
236VOID
237NTAPI
239 _In_ UCXUSBDEVICE Hub,
241{
242 UcxUsbDevice::FromHandle(Hub)->m_Controller->ResumeIdle(Context);
243}
244
245static
246VOID
247NTAPI
249 _In_ UCXUSBDEVICE Hub,
251{
252 UcxUsbDevice* HubDevice = UcxUsbDevice::FromHandle(Hub);
253
254 HubDevice->m_Controller->GetInfo(Info, HubDevice->m_HubUsesGrownInterface);
255}
256
257static
259NTAPI
261 _In_ UCXUSBDEVICE Device)
262{
263 return UcxUsbDevice::FromHandle(Device)->Timestamp();
264}
265
266static
267VOID
268NTAPI
270 _In_ UCXUSBDEVICE Hub,
271 _In_ UCXUSBDEVICE Device,
272 _In_ UCXENDPOINT Endpoint,
274{
275 UcxEndpoint* Context = UcxEndpoint::FromHandle(Endpoint);
276 UCX_ENDPOINT_CHARACTERISTIC Characteristic;
277
280
281 if (Context->m_Callbacks.SetCharacteristic == NULL)
282 return;
283
284 RtlZeroMemory(&Characteristic, sizeof(Characteristic));
285 Characteristic.Size = sizeof(Characteristic);
288
289 Context->m_Callbacks.SetCharacteristic(Endpoint, &Characteristic);
290}
291
292/* Parent interface the root hub offers its hub */
293
294static
296NTAPI
299{
300 UcxController* Controller = UcxRootHub::FromHandle((UCXROOTHUB)Context)->m_Controller;
301
302 return InterlockedExchange(&Controller->m_RootHubResetSeen, 0) != 0;
303}
304
305static
307NTAPI
310{
311 UcxController* Controller = UcxRootHub::FromHandle((UCXROOTHUB)Context)->m_Controller;
312
313 return InterlockedExchange(&Controller->m_DeviceContextsLost, 0) != 0;
314}
315
316/* The buffer stays valid until the root hub PDO releases its hardware */
317static
318VOID
319NTAPI
323{
324 UcxRootHub* RootHub = UcxRootHub::FromHandle((UCXROOTHUB)Context);
325
327
328 if (RootHub->m_SymbolicName != NULL)
330}
331
333template <typename T>
334static
335VOID
336NTAPI
338 _Out_ T* Parent,
340{
341 const UCX_CONTROLLER_PCI_INFORMATION* Pci = &RootHub->m_Controller->m_Config.PciDeviceInfo;
342
343 /* Wipes the hub's debug context too, harmlessly */
344 RtlZeroMemory(Parent, sizeof(*Parent));
345
346 Parent->Header.Size = sizeof(*Parent);
347 Parent->Header.Version = UCXHUB_PARENT_INTERFACE_VERSION;
348 Parent->Header.Context = RootHub->m_Handle;
349 Parent->Header.InterfaceReference = UcxInterfaceNoOp;
350 Parent->Header.InterfaceDereference = UcxInterfaceNoOp;
351
352 Parent->HubDepth = 0;
353 Parent->Hub = (UCXUSBDEVICE)RootHub->m_Handle;
354
355 /* UCX wakes the root hub itself on a port change */
356 Parent->ParentCanWake = TRUE;
357
358 Parent->ParentResetDuringResume = UcxParentResetDuringResume;
359 Parent->ParentLostStateDuringResume = UcxParentWasProgrammingLost;
360 Parent->QueryHubLinkName = UcxParentGetHubSymbolicName;
361
362 /* Taken from the PCI fields whatever the parent bus is */
363 Parent->HubTopologyAddress.PciBusNumber = Pci->BusNumber;
364 Parent->HubTopologyAddress.PciDeviceNumber = Pci->DeviceNumber;
365 Parent->HubTopologyAddress.PciFunctionNumber = Pci->FunctionNumber;
366}
367
369NTAPI
371 _In_ WDFDEVICE Device,
375{
376 UcxRootHub* RootHub = UcxGetRootHubPdoContext(Device)->RootHub;
377
380
381 if (ExposedInterface->Size != sizeof(UCXHUB_PARENT_INTERFACE) &&
383 {
384 DPRINT1("Parent interface size %u not accepted\n", ExposedInterface->Size);
386 }
387
389 {
390 DPRINT1("Parent interface version %u not supported\n", ExposedInterface->Version);
392 }
393
394 /* The current layout added the tunnel state, which is 0 for the root hub */
395 if (ExposedInterface->Size == sizeof(UCXHUB_PARENT_INTERFACE))
397 else
399
400 DPRINT("Parent interface size %u handed to root hub %p's hub\n", ExposedInterface->Size, RootHub);
401 return STATUS_SUCCESS;
402}
403
404/* Writes one stack interface slot if the requested size covers it */
405#define UCX_FILL_SLOT(Interface, Limit, Field, Value) \
406 do \
407 { \
408 if (FIELD_OFFSET(UCXHUB_STACK_INTERFACE, Field) + sizeof((Interface)->Field) <= (Limit)) \
409 (Interface)->Field = (Value); \
410 } while (0)
411
412/* Fills only what the requested size and version cover */
414NTAPI
416 _In_ WDFDEVICE Device,
420{
425 ULONG Filled;
426
429
431 {
432 DPRINT1("Stack interface version %u too old, left unfilled\n", Version);
433 return STATUS_SUCCESS;
434 }
435
436 Limit = min(Limit, (ULONG)sizeof(*Stack));
437
438 Stack->Header.Context = Device;
439 Stack->Header.InterfaceReference = UcxInterfaceNoOp;
440 Stack->Header.InterfaceDereference = UcxInterfaceNoOp;
441
444 UCX_FILL_SLOT(Stack, Limit, DeviceDisconnect, UcxHubDeviceDisconnect);
446 UCX_FILL_SLOT(Stack, Limit, CreateControlEndpoint, UcxHubCreateControlEndpoint);
450 UCX_FILL_SLOT(Stack, Limit, MarkEndpointClientOwned, UcxHubEndpointExposed);
451 UCX_FILL_SLOT(Stack, Limit, EndpointGetPipeHandle, UcxHubEndpointPipeHandle);
452 UCX_FILL_SLOT(Stack, Limit, EndpointGetMaxTransferSize, UcxHubEndpointMaxTransfer);
453 UCX_FILL_SLOT(Stack, Limit, WorkItemAllocate, UcxHubWorkItemAllocate);
457 UCX_FILL_SLOT(Stack, Limit, ClearTtBufferComplete, UcxHubClearTtBufferComplete);
458 UCX_FILL_SLOT(Stack, Limit, IsDeviceDisconnected, UcxHubIsDeviceDisconnected);
459 UCX_FILL_SLOT(Stack, Limit, StreamsSupported, UcxHubStreamsSupported);
460 UCX_FILL_SLOT(Stack, Limit, BlockControllerIdle, UcxHubBlockControllerIdle);
461 UCX_FILL_SLOT(Stack, Limit, AllowControllerIdle, UcxHubAllowControllerIdle);
462 UCX_FILL_SLOT(Stack, Limit, QueryControllerBus, UcxHubQueryControllerBus);
463 UCX_FILL_SLOT(Stack, Limit, DeviceGetTimestamp, UcxHubDeviceGetTimestamp);
464
465 Filled = min(Limit, (ULONG)FIELD_OFFSET(UCXHUB_STACK_INTERFACE, EndpointSetPriority));
466 Stack->Header.Version = UCXHUB_STACK_INTERFACE_VERSION_1;
467
469 {
470 UCX_FILL_SLOT(Stack, Limit, EndpointSetPriority, UcxHubEndpointSetPriority);
471 Filled = min(Limit, (ULONG)FIELD_OFFSET(UCXHUB_STACK_INTERFACE, EndpointCreateEx));
472 Stack->Header.Version = UCXHUB_STACK_INTERFACE_VERSION_2;
473 }
474
475 Stack->Header.Size = (USHORT)Filled;
476
477 /* The hub's own half of the interface goes into its device context */
478 Hub = UcxUsbDevice::FromHandle(Stack->Hub);
479 NT_ASSERT(Hub->IsHub());
480 Hub->m_HubContext = Stack->HubContext;
481 Hub->m_HubClearTtBuffer = Stack->ClearTtBuffer;
482 Hub->m_HubNoPingResponse = Stack->NoPingResponse;
483 Hub->m_HubUsesGrownInterface = (ExposedInterface->Size > UCXHUB_STACK_INTERFACE_SIZE_ORIGINAL);
484
485 DPRINT("Stack interface for hub %p, size %lu version %u\n", Hub, Filled, Stack->Header.Version);
486 return STATUS_SUCCESS;
487}
488
489/* GUID_PNP_LOCATION_INTERFACE: the root hub is always USBROOT(0) */
490static
492NTAPI
496{
497 static const WCHAR Location[] = L"USBROOT(0)";
499
501
503
504 /* One extra NUL makes it a multi string; PnP frees it */
505 Buffer = (PWCHAR)ExAllocatePoolZero(PagedPool, sizeof(Location) + sizeof(WCHAR), UCX_POOL_TAG);
506 if (Buffer == NULL)
507 {
508 DPRINT1("Root hub location string allocation failed\n");
510 }
511
512 RtlCopyMemory(Buffer, Location, sizeof(Location));
514 return STATUS_SUCCESS;
515}
516
519{
522 UCXHUB_STACK_INTERFACE StackTemplate;
523 USBD_CLIENT_INTERFACE ClientTemplate;
524 PNP_LOCATION_INTERFACE Location;
526
527 /* Templates use the smallest accepted size; KMDF rejects anything below it */
528 RtlZeroMemory(&ParentTemplate, sizeof(ParentTemplate));
529 ParentTemplate.Header.Size = sizeof(ParentTemplate);
532 (PINTERFACE)&ParentTemplate,
533 &GUID_UCXHUB_PARENT_INTERFACE,
535 Config.ImportInterface = TRUE;
536 Status = WdfDeviceAddQueryInterface(m_Pdo, &Config);
537 if (!NT_SUCCESS(Status))
538 {
539 DPRINT1("Root hub PDO %p parent interface add failed 0x%lx\n", m_Pdo, Status);
540 return Status;
541 }
542
543 RtlZeroMemory(&StackTemplate, sizeof(StackTemplate));
547 (PINTERFACE)&StackTemplate,
548 &GUID_UCXHUB_STACK_INTERFACE,
550 Config.ImportInterface = TRUE;
551 Status = WdfDeviceAddQueryInterface(m_Pdo, &Config);
552 if (!NT_SUCCESS(Status))
553 {
554 DPRINT1("Root hub PDO %p stack interface add failed 0x%lx\n", m_Pdo, Status);
555 return Status;
556 }
557
558 WDF_QUERY_INTERFACE_CONFIG_INIT(&Config, NULL, &USB_BUS_INTERFACE_USBDI_GUID, UcxEvtQueryUsbdiInterface);
559 Config.ImportInterface = TRUE;
560 Status = WdfDeviceAddQueryInterface(m_Pdo, &Config);
561 if (!NT_SUCCESS(Status))
562 {
563 DPRINT1("Root hub PDO %p USBDI interface add failed 0x%lx\n", m_Pdo, Status);
564 return Status;
565 }
566
567 RtlZeroMemory(&ClientTemplate, sizeof(ClientTemplate));
568 ClientTemplate.Header.Size = sizeof(ClientTemplate);
571 (PINTERFACE)&ClientTemplate,
572 &GUID_USBD_CLIENT_INTERFACE,
574 Config.ImportInterface = TRUE;
575 Status = WdfDeviceAddQueryInterface(m_Pdo, &Config);
576 if (!NT_SUCCESS(Status))
577 {
578 DPRINT1("Root hub PDO %p USBD client interface add failed 0x%lx\n", m_Pdo, Status);
579 return Status;
580 }
581
582 RtlZeroMemory(&Location, sizeof(Location));
583 Location.Size = sizeof(Location);
588 WDF_QUERY_INTERFACE_CONFIG_INIT(&Config, (PINTERFACE)&Location, &GUID_PNP_LOCATION_INTERFACE, NULL);
589 Config.ImportInterface = FALSE;
590
591 Status = WdfDeviceAddQueryInterface(m_Pdo, &Config);
592 if (!NT_SUCCESS(Status))
593 DPRINT1("Root hub PDO %p location interface add failed 0x%lx\n", m_Pdo, Status);
594
595 return Status;
596}
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 Parent
Definition: acpixf.h:732
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
HubFdo * Hub
Definition: bootdev.cpp:261
RtlInitEmptyUnicodeString(SymbolicLinkName, NULL, 0)
_Outptr_ PZZWSTR * LocationStrings
Definition: childpdo.cpp:950
WDFDEVICE HubDevice
Definition: childpdo.cpp:989
Definition: bufpool.h:45
NTSTATUS StopIdle(_Inout_ PUCXHUB_STOP_IDLE_CONTEXT Context)
Definition: hostctl.cpp:663
VOID ResumeIdle(_Inout_ PUCXHUB_STOP_IDLE_CONTEXT Context)
Definition: hostctl.cpp:680
BOOLEAN QueryStreamsSupported()
Definition: hostctl.cpp:626
VOID Address0Release(_In_ UCXUSBDEVICE Hub)
Definition: hostctl.cpp:647
VOID ReleaseCancelSync()
Definition: pipe.cpp:360
UcxPipe m_Pipe
Definition: pipe.h:284
VOID DeleteFromHub()
Definition: pipe.cpp:515
BOOLEAN m_ClientHoldsHandle
Definition: pipe.h:313
WDFDEVICE m_Pdo
Definition: rhub.h:135
UcxController * m_Controller
Definition: rhub.h:115
NTSTATUS AddQueryInterfaces()
UcxController * m_Controller
Definition: devobj.h:216
BOOLEAN m_Disconnected
Definition: devobj.h:231
ULONG64 Timestamp() const
Definition: devobj.h:99
VOID DisconnectPort(_In_ ULONG PortNumber)
Definition: devobj.cpp:440
VOID SetPdo(_In_ PDEVICE_OBJECT Pdo)
Definition: devobj.cpp:489
VOID DeleteFromHub()
Definition: devobj.cpp:351
#define STATUS_NOT_SUPPORTED
Definition: d3dkmdt.h:48
PUCHAR Limit
Definition: desccheck.cpp:2230
Hub m_Stack DeviceSetPdo(Hub->UsbDevice(), Child->m_UsbDevice, Pdo)
_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 L(x)
Definition: resources.c:13
#define PagedPool
Definition: env_spec_w32.h:308
Status
Definition: gdiplustypes.h:24
static BOOLEAN NTAPI UcxHubStreamsSupported(_In_ UCXUSBDEVICE Hub)
static NTSTATUS NTAPI UcxGetLocationString(_Inout_ PVOID Context, _Outptr_ PZZWSTR *LocationStrings)
static NTSTATUS NTAPI UcxHubEndpointCreate(_In_ UCXUSBDEVICE Hub, _In_ UCXUSBDEVICE Device, _In_ PUSB_ENDPOINT_DESCRIPTOR Descriptor, _In_ ULONG DescriptorBufferLength, _In_opt_ PUSB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR Companion, _Out_ UCXENDPOINT *Endpoint)
static ULONG NTAPI UcxHubEndpointMaxTransfer(_In_ UCXENDPOINT Endpoint)
static BOOLEAN NTAPI UcxParentWasProgrammingLost(_In_ PVOID Context)
static VOID NTAPI UcxParentGetHubSymbolicName(_In_ PVOID Context, _In_ PUNICODE_STRING SymbolicLinkName)
static USBD_PIPE_HANDLE NTAPI UcxHubEndpointPipeHandle(_In_ UCXENDPOINT Endpoint)
static NTSTATUS NTAPI UcxHubCreateControlEndpoint(_In_ UCXUSBDEVICE Hub, _In_ UCXUSBDEVICE Device, _In_ ULONG MaxPacketSize, _Out_ UCXENDPOINT *Endpoint)
static ULONG64 NTAPI UcxHubDeviceGetTimestamp(_In_ UCXUSBDEVICE Device)
static BOOLEAN NTAPI UcxParentResetDuringResume(_In_ PVOID Context)
static VOID NTAPI UcxHubDeviceDelete(_In_ UCXUSBDEVICE Hub, _In_ UCXUSBDEVICE Device)
VOID NTAPI UcxInterfaceNoOp(_In_ PVOID Context)
static VOID NTAPI UcxHubWorkItemEnqueue(_In_ PUCXHUB_WORKITEM WorkItem, _In_ PUCXHUB_WORKITEM_ROUTINE Routine, _In_opt_ PVOID Context, _In_ UCXHUB_WORKITEM_ENQUEUE_OPTIONS Options)
static VOID NTAPI UcxHubDeviceSetPdo(_In_ UCXUSBDEVICE Hub, _In_ UCXUSBDEVICE Device, _In_ PDEVICE_OBJECT Pdo)
static VOID NTAPI UcxHubQueryControllerBus(_In_ UCXUSBDEVICE Hub, _Out_ PUCXHUB_CONTROLLER_INFO Info)
static PUCXHUB_WORKITEM NTAPI UcxHubWorkItemAllocate(_In_ UCXUSBDEVICE Hub, _In_ PDEVICE_OBJECT DeviceObject, _In_ ULONG Flags)
static VOID NTAPI UcxHubClearTtBufferComplete(_In_ UCXUSBDEVICE Hub, _In_ UCXENDPOINT Endpoint)
static VOID NTAPI UcxHubWorkItemFlush(_In_ PUCXHUB_WORKITEM WorkItem)
static VOID NTAPI UcxHubWorkItemDelete(_In_ PUCXHUB_WORKITEM WorkItem)
static VOID NTAPI UcxHubEndpointDelete(_In_ UCXUSBDEVICE Hub, _In_ UCXUSBDEVICE Device, _In_ UCXENDPOINT Endpoint)
static VOID NTAPI UcxHubEndpointSetPriority(_In_ UCXUSBDEVICE Hub, _In_ UCXUSBDEVICE Device, _In_ UCXENDPOINT Endpoint, _In_ ULONG Priority)
#define UCX_FILL_SLOT(Interface, Limit, Field, Value)
static VOID NTAPI UcxFillParentInterface(_Out_ T *Parent, _In_ UcxRootHub *RootHub)
static VOID NTAPI UcxHubAllowControllerIdle(_In_ UCXUSBDEVICE Hub, _Inout_ PUCXHUB_STOP_IDLE_CONTEXT Context)
static VOID NTAPI UcxHubEndpointExposed(_In_ UCXENDPOINT Endpoint)
static VOID NTAPI UcxHubDeviceDisconnect(_In_ UCXUSBDEVICE Hub, _In_ ULONG PortNumber)
static NTSTATUS NTAPI UcxHubDeviceCreate(_In_ UCXUSBDEVICE Hub, _In_ PUCXHUB_DEVICE_CREATE_INFO CreateInfo, _Out_ UCXUSBDEVICE *Device)
static BOOLEAN NTAPI UcxHubIsDeviceDisconnected(_In_ UCXUSBDEVICE Device)
static VOID NTAPI UcxHubAddress0Release(_In_ UCXUSBDEVICE Hub, _In_ UCXUSBDEVICE Device)
static NTSTATUS NTAPI UcxHubBlockControllerIdle(_In_ UCXUSBDEVICE Hub, _Inout_ PUCXHUB_STOP_IDLE_CONTEXT Context)
_Must_inspect_result_ _In_ PUCXHUB_DEVICE_CREATE_INFO _Out_ UCXUSBDEVICE * Device
Definition: hubucx.h:258
struct _UCXHUB_STACK_INTERFACE * PUCXHUB_STACK_INTERFACE
#define UCXHUB_STACK_INTERFACE_VERSION_2
Definition: hubucx.h:418
#define UCXHUB_STACK_INTERFACE_SIZE_ORIGINAL
Definition: hubucx.h:469
_Must_inspect_result_ _In_ UCXUSBDEVICE _In_ ULONG MaxPacketSize
Definition: hubucx.h:289
UCXHUB_WORKITEM_ROUTINE * PUCXHUB_WORKITEM_ROUTINE
Definition: hubucx.h:228
#define UCXHUB_PARENT_INTERFACE_VERSION
Definition: hubucx.h:493
_In_ UCXUSBDEVICE _In_ UCXENDPOINT _In_ ULONG Priority
Definition: hubucx.h:414
_Must_inspect_result_ _In_ UCXUSBDEVICE _In_ ULONG _In_opt_ PUSB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR Companion
Definition: hubucx.h:308
_In_ PUNICODE_STRING SymbolicLinkName
Definition: hubucx.h:491
#define UCXHUB_STACK_INTERFACE_VERSION_1
Definition: hubucx.h:417
_In_opt_ PVOID _In_ PUCXHUB_WORKITEM WorkItem
Definition: hubucx.h:227
_In_ UCXHUB_DEVICE_CONTEXT _In_ UCXENDPOINT Endpoint
Definition: hubucx.h:238
enum _UCXHUB_WORKITEM_ENQUEUE_OPTIONS UCXHUB_WORKITEM_ENQUEUE_OPTIONS
_Must_inspect_result_ _In_ PUCXHUB_DEVICE_CREATE_INFO CreateInfo
Definition: hubucx.h:257
_In_ ULONG PortNumber
Definition: hubucx.h:272
_Must_inspect_result_ _In_ UCXUSBDEVICE _In_ ULONG DescriptorBufferLength
Definition: hubucx.h:307
_In_ UCXUSBDEVICE _In_ PDEVICE_OBJECT Pdo
Definition: hubucx.h:280
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_ PVOID Context
Definition: kse.h:81
unsigned __int64 ULONG64
Definition: imports.h:198
static PVOID ExAllocatePoolZero(ULONG PoolType, SIZE_T NumberOfBytes, ULONG Tag)
Definition: precomp.h:45
#define min(a, b)
Definition: monoChain.cc:55
#define _Inout_
Definition: no_sal2.h:162
#define _Outptr_
Definition: no_sal2.h:262
#define _Inout_opt_
Definition: no_sal2.h:216
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
_NullNull_terminated_ WCHAR * PZZWSTR
Definition: ntbasedef.h:432
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
short WCHAR
Definition: pedump.c:58
unsigned short USHORT
Definition: pedump.c:61
EVT_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST UcxEvtQueryParentInterface
Definition: rhub.h:190
EVT_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST UcxEvtQueryStackInterface
Definition: rhub.h:191
EVT_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST UcxEvtQueryUsbdClientInterface
Definition: rhub.h:193
EVT_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST UcxEvtQueryUsbdiInterface
Definition: rhub.h:192
#define T(num)
Definition: thunks.c:311
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
#define DPRINT
Definition: sndvol32.h:73
ULONG MaximumTransferSize
Definition: pipe.h:37
USBD_PIPE_HANDLE Handle()
Definition: pipe.h:60
USHORT Version
Definition: miniport.h:122
USHORT Size
Definition: miniport.h:121
PGET_LOCATION_STRING GetLocationString
Definition: iotypes.h:4559
PINTERFACE_REFERENCE InterfaceReference
Definition: iotypes.h:4557
PINTERFACE_DEREFERENCE InterfaceDereference
Definition: iotypes.h:4558
static PUCXHUB_WORKITEM Allocate(_In_ UcxController *Controller, _In_ PDEVICE_OBJECT DeviceObject, _In_ ULONG Flags)
Definition: workitem.cpp:16
UCX_ENDPOINT_CHARACTERISTIC_TYPE CharacteristicType
Definition: ucxendpoint.h:81
UCX_CONTROLLER_ENDPOINT_CHARACTERISTIC_PRIORITY Priority
Definition: ucxendpoint.h:84
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
_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
@ UCX_ENDPOINT_CHARACTERISTIC_TYPE_PRIORITY
Definition: ucxendpoint.h:67
enum _UCX_ENDPOINT_CHARACTERISTIC_PRIORITY UCX_CONTROLLER_ENDPOINT_CHARACTERISTIC_PRIORITY
_Must_inspect_result_ _In_ UCXCONTROLLER _In_ PUCX_ROOTHUB_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ UCXROOTHUB * RootHub
Definition: ucxroothub.h:299
#define UCX_POOL_TAG
Definition: ucxutil.h:11
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define USBD_CLIENT_INTERFACE_VERSION
Definition: usbdclient.h:18
WdfStringGetUnicodeString(Original, &Name)
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2061
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
Definition: wdfdevice.h:3540
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID InterfaceType
Definition: wdffdo.h:463
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469
WDF_EXTERN_C_START typedef _In_ LPGUID _Inout_ PINTERFACE ExposedInterface
WDF_EXTERN_C_START typedef _In_ LPGUID _Inout_ PINTERFACE _Inout_opt_ PVOID ExposedInterfaceSpecificData
FORCEINLINE VOID WDF_QUERY_INTERFACE_CONFIG_INIT(_Out_ PWDF_QUERY_INTERFACE_CONFIG InterfaceConfig, _In_opt_ PINTERFACE Interface, _In_ CONST GUID *InterfaceType, _In_opt_ PFN_WDF_DEVICE_PROCESS_QUERY_INTERFACE_REQUEST EvtDeviceProcessQueryInterfaceRequest)
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:639
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342
#define PNP_LOCATION_INTERFACE_VERSION
Definition: iotypes.h:5536
#define NT_ASSERT
Definition: rtlfuncs.h:3334