15 { 0x9c0d3eae, 0xfba6, 0x4e08, { 0x9e, 0x8d, 0x18, 0x1c, 0xbb, 0x39, 0x97, 0xd6 } };
19 { { 0xb5a825b8, 0x3907, 0x40b5, { 0xab, 0xca, 0x84, 0x51, 0xe2, 0x45, 0x3d, 0x5f } }, 1 };
23 { { 0x3ab22e31, 0x8264, 0x4b4e, { 0x9a, 0xf5, 0xa8, 0xd2, 0xd8, 0xe3, 0x3e, 0x62 } }, 40 };
25 { { 0x3ab22e31, 0x8264, 0x4b4e, { 0x9a, 0xf5, 0xa8, 0xd2, 0xd8, 0xe3, 0x3e, 0x62 } }, 42 };
28#define HUB_USB4_REFERENCE_PREFIX L"Usb4-Host-Interface-"
29#define HUB_USB4_REFERENCE_PREFIX_CHARS 20
30#define HUB_USB4_REFERENCE_CHARS 256
31#define HUB_USB4_FIELD_SEPARATOR L'^'
34#define HUB_USB4_LINK_CHARS 256
35#define HUB_USB4_OPEN_NAME_CHARS 256
38#define HUB_USB4_HOST_INDEX_MASK 0x07
39#define HUB_USB4_NO_HOST 0x07
40#define HUB_USB4_DVSEC_NAME_CHARS 20
43#define HUB_USB4_MAPPING_EXTRA_BYTES 14
290 DPRINT(
"Hub %p has ports behind a USB4 host router\n",
Hub);
370 DPRINT1(
"Hub %p has a PCI serial number but no USB4 port attributes 0x%lx\n",
Hub,
Status);
377 DPRINT1(
"Hub %p USB4 port attributes are empty\n",
Hub);
402 DPRINT1(
"Hub %p USB4 port attributes name port %lu, which is not a USB 3 port\n",
Hub,
PortNumber);
447HubUsb4AssignPortMappings(
474 DPRINT1(
"Hub %p USB4 port mapping size overflows\n",
Hub);
487 DPRINT1(
"Hub %p USB4 port mapping is too large\n",
Hub);
494 DPRINT1(
"Hub %p no memory for the USB4 port mapping\n",
Hub);
517 if (Remaining < 2 *
sizeof(
WCHAR))
519 DPRINT1(
"Hub %p USB4 port mapping buffer overflowed\n",
Hub);
525 Remaining -=
sizeof(
WCHAR);
539 DPRINT1(
"Hub %p USB4 port mapping property not written 0x%lx\n",
Hub,
Status);
556 DPRINT(
"Hub %p would depend on USB4 host router PDO %p; PoFx component relations are not available\n",
566 DPRINT(
"Hub %p power relations are not reported\n",
Hub);
598HubUsb4AcquireHostPower(
626HubUsb4ReleaseHostPower(
662HubUsb4UpdatePowerRelations(
723 WdfIoTargetCloseForQueryRemove(
Target);
734 DPRINT(
"USB4 host target %p remove canceled\n",
Target);
804 HubUsb4UpdatePowerRelations(
Hub,
Host);
845 DPRINT1(
"Hub %p USB4 host open work item not created 0x%lx\n",
Hub,
Status);
910 DPRINT(
"Hub %p ignores an interface change of another class\n",
Hub);
916 DPRINT1(
"Hub %p cannot read USB4 power interface properties on this kernel\n",
Hub);
921 &DEVPKEY_DeviceInterface_ReferenceString,
930 DPRINT1(
"Hub %p USB4 power interface reference string query failed 0x%lx\n",
Hub,
Status);
936 DPRINT1(
"Hub %p USB4 power interface reference string has type 0x%lx\n",
Hub,
Type);
944 DPRINT1(
"Hub %p USB4 power interface has an invalid reference string %ws\n",
Hub, Reference);
951 DPRINT1(
"Hub %p USB4 power interface reference string %ws has no fields\n",
Hub, Reference);
955 AcpiField =
Mark + 1;
960 DvsecField =
Mark + 1;
984 DPRINT1(
"Hub %p has no USB4 host for %ws\n",
Hub, Reference);
991 DPRINT(
"Hub %p USB4 host %p power interface removed\n",
Hub,
Host);
995 DPRINT(
"Hub %p USB4 host %p power interface arrived\n",
Hub,
Host);
1017HubUsb4RegisterNotification(
1036 DPRINT1(
"Hub %p USB4 power interface notification not registered 0x%lx\n",
Hub,
Status);
1044HubUsb4UnregisterNotification(
1060HubUsb4CloseAllHosts(
#define FILE_NON_DIRECTORY_FILE
#define STATUS_INTEGER_OVERFLOW
RtlInitEmptyUnicodeString(SymbolicLinkName, NULL, 0)
static HubFdo * FromDevice(_In_ WDFDEVICE Device)
WDFWAITLOCK m_Usb4HostsLock
WDFCOLLECTION m_Usb4Hosts
HubPort * FindPort(_In_ ULONG PortNumber)
VOID SetFlag(_In_ PortFlag Flag)
BOOLEAN HasFlag(_In_ PortFlag Flag) const
static VOID Mark(PGUI_CONSOLE_DATA GuiData)
#define DEVPROP_TYPE_STRING_LIST
#define DEVPROP_TYPE_STRING
#define NT_SUCCESS(StatCode)
_ACRTIMP int __cdecl _wcsnicmp(const wchar_t *, const wchar_t *, size_t)
const GUID GUID_DEVICE_INTERFACE_ARRIVAL
#define _IRQL_requires_(irql)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define HUB_TUNNEL_STATE_UNKNOWN
#define HUB_TUNNEL_STATE_TUNNELED
return RtlUnicodeStringPrintf(Name, L"uxd_port_%03u", PortNumber)
static const DEVPROPKEY HubKeyPciSerialNumber
#define HUB_USB4_HOST_INDEX_MASK
static const DEVPROPKEY HubKeyUsb4PortMappings
WdfStringGetUnicodeString(Name, &Text)
WDF_OBJECT_ATTRIBUTES_INIT & Attributes
#define HUB_USB4_MAPPING_EXTRA_BYTES
static VOID NTAPI HubUsb4EscapeName(_In_ WDFSTRING Name)
static HubUsb4Host *NTAPI HubUsb4HostAt(_In_ HubFdo *Hub, _In_ ULONG Index)
BOOLEAN NTAPI HubUsb4NeedsHostPower(_In_ HubChild *Child)
static HubUsb4Host *NTAPI HubUsb4FindHost(_In_ HubFdo *Hub, _In_ PCUNICODE_STRING Name)
#define HUB_USB4_DVSEC_NAME_CHARS
WdfObjectDelete(WorkItem)
static const DEVPROPKEY HubKeyPciUsb4PortAttributes
WdfWorkItemEnqueue(WorkItem)
static EVT_WDF_IO_TARGET_REMOVE_COMPLETE HubUsb4TargetRemoveComplete
static EVT_WDF_IO_TARGET_QUERY_REMOVE HubUsb4TargetQueryRemove
static VOID NTAPI HubUsb4RemovePowerRelation(_In_ HubFdo *Hub, _In_ HubUsb4Host *Host)
static VOID NTAPI HubUsb4InvalidatePowerRelations(_In_ HubFdo *Hub)
static EVT_WDF_IO_TARGET_REMOVE_CANCELED HubUsb4TargetRemoveCanceled
#define HUB_USB4_REFERENCE_CHARS
static EVT_WDF_WORKITEM HubUsb4OpenWorkItem
WDF_WORKITEM_CONFIG_INIT & Config
#define HUB_USB4_REFERENCE_PREFIX
#define HUB_USB4_OPEN_NAME_CHARS
HubUsb4GetTargetContext(Host->Target) -> Hub=Hub
HubUsb4OpenContext * Open
#define HUB_USB4_LINK_CHARS
_In_ HubUsb4Host _In_ PCUNICODE_STRING SymbolicLink
#define HUB_USB4_REFERENCE_PREFIX_CHARS
static const GUID HubUsb4PowerPdoInterface
static DRIVER_NOTIFICATION_CALLBACK_ROUTINE HubUsb4InterfaceChange
static VOID NTAPI HubUsb4AddPowerRelation(_In_ HubFdo *Hub, _In_ HubUsb4Host *Host)
#define HUB_USB4_FIELD_SEPARATOR
_In_opt_ PVOID _In_ PUCXHUB_WORKITEM WorkItem
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_ PVOID Context
#define ExFreePoolWithTag(_P, _T)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
NTSTRSAFEVAPI RtlStringCbPrintfExW(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, _Out_opt_ size_t *pcbRemaining, _In_ STRSAFE_DWORD dwFlags, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
NTSTATUS NTAPI IoRegisterPlugPlayNotification(_In_ IO_NOTIFICATION_EVENT_CATEGORY EventCategory, _In_ ULONG EventCategoryFlags, _In_opt_ PVOID EventCategoryData, _In_ PDRIVER_OBJECT DriverObject, _In_ PDRIVER_NOTIFICATION_CALLBACK_ROUTINE CallbackRoutine, _Inout_opt_ PVOID Context, _Out_ PVOID *NotificationEntry)
NTSTATUS NTAPI IoUnregisterPlugPlayNotification(_In_ PVOID NotificationEntry)
#define IsEqualGUID(rguid1, rguid2)
#define STATUS_BUFFER_OVERFLOW
PFN_HUB_GET_INTERFACE_PROPERTY GetInterfaceProperty
WCHAR SymbolicLink[HUB_USB4_LINK_CHARS]
struct _LIST_ENTRY * Flink
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PUCX_CONTROLLER_CONFIG Config
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
#define STATUS_OBJECT_NAME_NOT_FOUND
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
FORCEINLINE VOID WDF_DEVICE_PROPERTY_DATA_INIT(_Out_ PWDF_DEVICE_PROPERTY_DATA PropertyData, _In_ const DEVPROPKEY *PropertyKey)
FORCEINLINE WDFDRIVER WdfGetDriver(VOID)
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFDEVICE Child
FORCEINLINE VOID WDF_IO_TARGET_OPEN_PARAMS_INIT_OPEN_BY_NAME(_Out_ PWDF_IO_TARGET_OPEN_PARAMS Params, _In_ PCUNICODE_STRING TargetDeviceName, _In_ ACCESS_MASK DesiredAccess)
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG _In_ _Out_ WDFMEMORY * Memory
FORCEINLINE VOID WDF_OBJECT_ATTRIBUTES_INIT(_Out_ PWDF_OBJECT_ATTRIBUTES Attributes)
#define WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(_attributes, _contexttype)
#define WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(_contexttype, _castingfunction)
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
#define WDF_NO_OBJECT_ATTRIBUTES
FORCEINLINE VOID WDF_WORKITEM_CONFIG_INIT(_Out_ PWDF_WORKITEM_CONFIG Config, _In_ PFN_WDF_WORKITEM EvtWorkItemFunc)
_In_ PVOID NotificationStructure
struct _DEVICE_INTERFACE_CHANGE_NOTIFICATION * PDEVICE_INTERFACE_CHANGE_NOTIFICATION
@ EventCategoryDeviceInterfaceChange
#define PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES