ReactOS 0.4.17-dev-1281-g065abb3
hubsvc.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum class  HubUxdEvent : ULONG { Disable = 1 , Disconnect = 2 }
 

Functions

 _IRQL_requires_ (PASSIVE_LEVEL) NTSTATUS NTAPI HubAllocateHubNumber(_Out_ PULONG HubNumber)
 Sends a synchronous IOCTL to the specified device object.
 
BOOLEAN NTAPI HubUsb4NeedsHostPower (_In_ HubChild *Child)
 
VOID NTAPI HubClearTtBuffer (_In_ UCXHUB_HUB_CONTEXT HubContext, _In_ UCXHUB_DEVICE_CONTEXT DeviceContext, _In_ UCXENDPOINT Endpoint, _In_ ULONG EndpointNumber, _In_ ULONG TtPortNumber)
 
VOID NTAPI HubNoPingResponse (_In_ UCXHUB_HUB_CONTEXT HubContext, _In_ UCXHUB_DEVICE_CONTEXT DeviceContext)
 
BOOLEAN NTAPI HubValidateHubConfiguration (_In_ HubFdo *Hub, _In_reads_bytes_(Length) PUSB_CONFIGURATION_DESCRIPTOR Descriptor, _In_ ULONG Length)
 
BOOLEAN NTAPI HubCheckUsb2HubDescriptor (_In_ HubFdo *Hub, _In_reads_bytes_(Length) PUSB_HUB_DESCRIPTOR Descriptor, _In_ ULONG Length)
 
BOOLEAN NTAPI HubCheckUsb3HubDescriptor (_In_ HubFdo *Hub, _In_reads_bytes_(Length) PUSB_30_HUB_DESCRIPTOR Descriptor, _In_ ULONG Length)
 
VOID NTAPI HubLogConfigTotalLengthMismatch (_In_ HubFdo *Hub)
 
VOID NTAPI HubWmiNotifyOverCurrent (_In_ HubFdo *Hub, _In_ ULONG PortNumber)
 
PVOID NTAPI HubConnectorNodeForPort (_In_ HubPort *Port)
 
VOID NTAPI HubLogDeviceValidationError (_In_ HubChild *Child, _In_ ULONG Code)
 
BOOLEAN NTAPI HubIdLanguageSupported (_In_ HubChild *Child, _In_ USHORT Language)
 
NTSTATUS NTAPI HubIdBuildHardwareIds (_In_ HubChild *Child, _In_opt_ PWDFDEVICE_INIT DeviceInit, _Out_opt_ PUSB_ID_STRING Ids)
 
NTSTATUS NTAPI HubIdBuildCompatibleIds (_In_ HubChild *Child, _In_opt_ PWDFDEVICE_INIT DeviceInit, _Out_opt_ PUSB_ID_STRING Ids)
 
NTSTATUS NTAPI HubIdListCopy (_Out_ PUSB_ID_STRING Destination, _In_ const USB_ID_STRING *Source)
 
VOID NTAPI HubIdListFree (_Inout_ PUSB_ID_STRING Ids)
 
BOOLEAN NTAPI HubIdGetContainerId (_In_ HubChild *Child, _Out_ GUID *ContainerId)
 
BOOLEAN NTAPI HubIdGetSerialNumberText (_In_ HubChild *Child, _Outptr_result_bytebuffer_(*Length) PCWSTR *Text, _Out_ PULONG Length)
 
VOID NTAPI HubIdFreeDeviceIds (_In_ HubChild *Child)
 
HubPort *NTAPI HubConnectorFindCompanion (_In_ HubPort *Port, _In_ ULONG Index)
 
 _IRQL_requires_max_ (DISPATCH_LEVEL) VOID NTAPI HubNoteHubOverCurrent(_In_ HubFdo *Hub)
 
_In_ PCUNICODE_STRING _In_ ULONG _In_ ULONG _In_reads_bytes_ (Length) PVOID Data)
 
VOID NTAPI HubReleaseRegistryState (_In_ HubChild *Child)
 
VOID NTAPI HubChildForwardToController (_In_ HubChild *Child)
 
 _Out_writes_bytes_ (Length) PUSB_HUB_NAME Name
 
VOID NTAPI HubFreeBillboardInfo (_In_ HubChild *Child)
 
VOID NTAPI HubReleaseTransferState (_In_ HubChild *Child)
 
HubPipe *NTAPI HubFindPipeByHandle (_In_opt_ HubConfiguration *Config, _In_ USBD_PIPE_HANDLE Handle)
 
VOID NTAPI HubMakeUsb2StyleDescriptor (_In_ HubFdo *Hub, _Out_ PUSB_HUB_DESCRIPTOR Descriptor)
 

Variables

_In_ HubPort * Port
 
_In_ HubPort _In_ WDFSTRING Name
 
_In_ ULONG MessageId
 
EVT_WDF_TIMER HubEvtBandwidthRetryTimer
 
_In_ PWDFDEVICE_INIT DeviceInit
 
_Inout_ PIRP Irp
 
_In_ PCUNICODE_STRING _In_ ULONG Type
 
_In_ PCUNICODE_STRING _In_ ULONG _In_ ULONG Length
 
_In_ PCUNICODE_STRING _In_ WDFSTRING Value
 
_In_ HubChild * Child
 
_In_ HubChild _Out_opt_ PBOOLEAN UpdateRequired
 
_In_ HubUxdEvent Event
 
_In_ WDFSTRING String
 
_In_ PDEVICE_OBJECT Pdo
 
_Out_ PUSB_BUS_NOTIFICATION Notification
 
_In_ ULONG PortNumber
 

Enumeration Type Documentation

◆ HubUxdEvent

Enumerator
Disable 
Disconnect 

Definition at line 327 of file hubsvc.h.

328{
329 Disable = 1,
330 Disconnect = 2
331};

Function Documentation

◆ _In_reads_bytes_()

_In_ PCUNICODE_STRING _In_ ULONG _In_ ULONG _In_reads_bytes_ ( Length  )

Definition at line 1072 of file hubregistry.cpp.

1073{
1074 WDFKEY Key;
1076
1077 Status = HubOpenDeviceKey(Child, KEY_WRITE, &Key);
1078 if (!NT_SUCCESS(Status))
1079 {
1080 DPRINT1("Device %p value %wZ: hardware key not opened 0x%lx\n", Child, Name, Status);
1081 return Status;
1082 }
1083
1084 Status = WdfRegistryAssignValue(Key, Name, Type, Length, Data);
1085 if (!NT_SUCCESS(Status))
1086 DPRINT1("Device %p value %wZ not written 0x%lx\n", Child, Name, Status);
1087
1089 return Status;
1090}
Type
Definition: Type.h:7
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
Status
Definition: gdiplustypes.h:24
_In_ PCWSTR _Out_ PULONG _Out_ PBOOLEAN _Inout_ NTSTATUS * Status
WdfRegistryClose(Root)
_In_ PCWSTR Name
_In_ PCUNICODE_STRING _In_ ACCESS_MASK _Out_ WDFKEY * Key
#define KEY_WRITE
Definition: nt_native.h:1034
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFDEVICE Child
Definition: wdffdo.h:536

◆ _IRQL_requires_()

_IRQL_requires_ ( PASSIVE_LEVEL  )

Sends a synchronous IOCTL to the specified device object.

Fails only when a port cannot be bound to the USB4 host router its ACPI node names.

Assigns device, hardware, compatible, container and instance ids to a new child PDO.

Answers IRP_MN_QUERY_DEVICE_TEXT on a child PDO; always completes the IRP.

Takes the connector map lock, needed around HubConnectorFindCompanion.

Device hardware key values read at PDO prepare hardware.

Saves the MS OS 2.0 set info in usbflags when the set asks for alternate enumeration.

MsOs20Flags and EnumerationRetryCount, written at PDO start.

Rereads the UXD record; UpdateRequired says whether the device id changes.

Replacement PnP id of a UXD reserved device, or an empty String. Always succeeds.

Telemetry values under the device's Ceip subkey.

BootPathSurpriseRemovalCount + 1.

This machine's dual role features for a dual role partner.

Tells UCX the WDM PDO of the device; call right after the child PDO was created.

IOCTL_INTERNAL_USB_GET_CONTROLLER_NAME: Argument1 and its length Argument2.

IOCTL_INTERNAL_USB_GET_BUS_INFO for the device: the 16 byte USB_BUS_NOTIFICATION at Argument1.

Registers the GUID_USB_WMI_NODE_INFO instance of a child PDO (not for hubs or composites).

Registers the boot device surprise removal event on an external, non hub boot PDO.

Fires the boot device surprise removal event, if one is registered.

Definition at line 2121 of file class.c.

13175{
13177
13178 PAGED_CODE();
13179
13180 TracePrint((TRACE_LEVEL_VERBOSE,
13181 TRACE_FLAG_PNP,
13182 "ClassDetermineTokenOperationCommandSupport (%p): Entering function.\n",
13183 DeviceObject));
13184
13185 //
13186 // Send down Inquiry for VPD_THIRD_PARTY_COPY_PAGE and cache away the device parameters
13187 // from WINDOWS_BLOCK_DEVICE_TOKEN_LIMITS_DESCRIPTOR.
13188 //
13190
13191 if (NT_SUCCESS(status)) {
13192
13193 ULONG maxListIdentifier = MaxTokenOperationListIdentifier;
13194
13195 //
13196 // Query the maximum list identifier to use for TokenOperation commands.
13197 //
13198 if (NT_SUCCESS(ClasspGetMaximumTokenListIdentifier(DeviceObject, REG_DISK_CLASS_CONTROL, &maxListIdentifier))) {
13199 if (maxListIdentifier >= MIN_TOKEN_LIST_IDENTIFIERS) {
13200
13201 NT_ASSERT(maxListIdentifier <= MAX_TOKEN_LIST_IDENTIFIERS);
13202 MaxTokenOperationListIdentifier = maxListIdentifier;
13203 }
13204 }
13205
13206 }
13207
13208 TracePrint((TRACE_LEVEL_VERBOSE,
13209 TRACE_FLAG_PNP,
13210 "ClassDetermineTokenOperationCommandSupport (%p): Exiting function with status %x.\n",
13212 status));
13213
13214 return status;
13215}
#define PAGED_CODE()
#define REG_DISK_CLASS_CONTROL
Definition: classp.h:218
#define MAX_TOKEN_LIST_IDENTIFIERS
Definition: classp.h:215
#define MIN_TOKEN_LIST_IDENTIFIERS
Definition: classp.h:214
ULONG MaxTokenOperationListIdentifier
Definition: class.c:107
_IRQL_requires_same_ NTSTATUS ClasspGetBlockDeviceTokenLimitsInfo(_Inout_ PDEVICE_OBJECT DeviceObject)
Definition: class.c:13220
#define STATUS_SUCCESS
Definition: shellext.h:65
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
Definition: ps.c:97
uint32_t ULONG
Definition: typedefs.h:59
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2061
#define NT_ASSERT
Definition: rtlfuncs.h:3334

◆ _IRQL_requires_max_()

_IRQL_requires_max_ ( DISPATCH_LEVEL  )

Records hub over current in the hub hardware key, once per devnode.

First selective suspend of the device; the registry write runs in a work item.

"USB device not recognized" popup for a port.

A hub was attached beyond the allowed tier depth.

The selected configuration draws more power than the port can give.

The controller ran out of bandwidth for the device; fired by the out of bandwidth timer.

Definition at line 77 of file common.c.

3587{
3589 BOOLEAN requestSent = FALSE;
3590
3591 BOOLEAN shouldRetry = TRUE;
3592 PCDB cdb = (PCDB)DeviceExtension->PowerContext.Srb.Cdb;
3593 ULONG timeoutValue = DeviceExtension->TimeOutValue;
3594 ULONG retryCount = 1;
3595
3596 // reset some fields.
3597 DeviceExtension->PowerContext.RetryIntervalIn100ns = 0;
3598 status = PowerContextReuseRequest(DeviceExtension);
3599 RequestClearSendTime(DeviceExtension->PowerContext.PowerRequest);
3600
3601 if (!NT_SUCCESS(status))
3602 {
3603 return status;
3604 }
3605
3606 // set proper timeout value and max retry count.
3607 switch(DeviceExtension->PowerContext.PowerChangeState.PowerDown)
3608 {
3612 break;
3613
3615 // Case of issuing SYNC CACHE command. Do not use power irp timeout remaining time in this case
3616 // as we want to give best try on SYNC CACHE command.
3617 retryCount = MAXIMUM_RETRIES;
3618 timeoutValue = DeviceExtension->TimeOutValue;
3619 break;
3620
3622 {
3623 // Case of issuing STOP UNIT command
3624 // As "Imme" bit is set to '1', this command should be completed in short time.
3625 // This command is at low importance, failure of this command has very small impact.
3626 ULONG secondsRemaining = 0;
3627
3628#if (WINVER >= 0x0601)
3629 // this API is introduced in Windows7
3630 PoQueryWatchdogTime(DeviceExtension->LowerPdo, &secondsRemaining);
3631#endif
3632
3633 if (secondsRemaining == 0)
3634 {
3635 // not able to retrieve remaining time from PoQueryWatchdogTime API, use default values.
3636 retryCount = MAXIMUM_RETRIES;
3637 timeoutValue = SCSI_CDROM_TIMEOUT;
3638 }
3639 else
3640 {
3641 // plan to leave about 30 seconds to lower level drivers if possible.
3642 if (secondsRemaining >= 32)
3643 {
3644 retryCount = (secondsRemaining - 30)/SCSI_CDROM_TIMEOUT + 1;
3645 timeoutValue = SCSI_CDROM_TIMEOUT;
3646
3647 if (retryCount > MAXIMUM_RETRIES)
3648 {
3649 retryCount = MAXIMUM_RETRIES;
3650 }
3651
3652 if (retryCount == 1)
3653 {
3654 timeoutValue = secondsRemaining - 30;
3655 }
3656 }
3657 else
3658 {
3659 // issue the command with minimal timeout value and do not retry on it.
3660 retryCount = 1;
3661 timeoutValue = 2;
3662 }
3663 }
3664 }
3665 break;
3666 default:
3667 NT_ASSERT( FALSE );
3669 return status;
3670 }
3671
3672 DeviceExtension->PowerContext.RetryCount = retryCount;
3673
3674 // issue command.
3675 while (shouldRetry)
3676 {
3677
3678 // set SRB fields.
3679 DeviceExtension->PowerContext.Srb.SrbFlags = SRB_FLAGS_NO_DATA_TRANSFER |
3684
3685 DeviceExtension->PowerContext.Srb.Function = SRB_FUNCTION_EXECUTE_SCSI;
3686 DeviceExtension->PowerContext.Srb.TimeOutValue = timeoutValue;
3687
3688 if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceInitial)
3689 {
3690 DeviceExtension->PowerContext.Srb.Function = SRB_FUNCTION_LOCK_QUEUE;
3691 }
3692 else if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceLocked)
3693 {
3694 DeviceExtension->PowerContext.Srb.Function = SRB_FUNCTION_QUIESCE_DEVICE;
3695 }
3696 else if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceQuiesced)
3697 {
3698 // Case of issuing SYNC CACHE command.
3699 DeviceExtension->PowerContext.Srb.CdbLength = 10;
3700 cdb->SYNCHRONIZE_CACHE10.OperationCode = SCSIOP_SYNCHRONIZE_CACHE;
3701 }
3702 else if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceFlushed)
3703 {
3704 // Case of issuing STOP UNIT command.
3705 DeviceExtension->PowerContext.Srb.CdbLength = 6;
3706 cdb->START_STOP.OperationCode = SCSIOP_START_STOP_UNIT;
3707 cdb->START_STOP.Start = 0;
3708 cdb->START_STOP.Immediate = 1;
3709 }
3710 else if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceStopped)
3711 {
3712 DeviceExtension->PowerContext.Srb.Function = SRB_FUNCTION_UNLOCK_QUEUE;
3713 }
3714
3715 // Set up completion routine and context if requested
3717 {
3718 WdfRequestSetCompletionRoutine(DeviceExtension->PowerContext.PowerRequest,
3720 Context);
3721 }
3722
3723 status = RequestSend(DeviceExtension,
3724 DeviceExtension->PowerContext.PowerRequest,
3725 DeviceExtension->IoTarget,
3727 &requestSent);
3728
3729 if (requestSent)
3730 {
3731 if ((CompletionRoutine == NULL) &&
3732 (SRB_STATUS(DeviceExtension->PowerContext.Srb.SrbStatus) != SRB_STATUS_SUCCESS))
3733 {
3734 TracePrint((TRACE_LEVEL_ERROR,
3735 TRACE_FLAG_POWER,
3736 "%p\tError occured when issuing %s command to device. Srb %p, Status %x\n",
3737 DeviceExtension->PowerContext.PowerRequest,
3738 (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceQuiesced) ? "SYNC CACHE" : "STOP UNIT",
3739 &DeviceExtension->PowerContext.Srb,
3740 DeviceExtension->PowerContext.Srb.SrbStatus));
3741
3742 NT_ASSERT(!(TEST_FLAG(DeviceExtension->PowerContext.Srb.SrbStatus, SRB_STATUS_QUEUE_FROZEN)));
3743
3744 shouldRetry = RequestSenseInfoInterpret(DeviceExtension,
3745 DeviceExtension->PowerContext.PowerRequest,
3746 &(DeviceExtension->PowerContext.Srb),
3747 retryCount - DeviceExtension->PowerContext.RetryCount,
3748 &status,
3749 &(DeviceExtension->PowerContext.RetryIntervalIn100ns));
3750
3751 if (shouldRetry && (DeviceExtension->PowerContext.RetryCount-- == 0))
3752 {
3753 shouldRetry = FALSE;
3754 }
3755 }
3756 else
3757 {
3758 // succeeded, do not need to retry.
3759 shouldRetry = FALSE;
3760 }
3761
3762 }
3763 else
3764 {
3765 // request failed to be sent
3766 shouldRetry = FALSE;
3767 }
3768
3769 if (shouldRetry)
3770 {
3772 t.QuadPart = -DeviceExtension->PowerContext.RetryIntervalIn100ns;
3774
3775 status = PowerContextReuseRequest(DeviceExtension);
3776 if (!NT_SUCCESS(status))
3777 {
3778 shouldRetry = FALSE;
3779 }
3780 }
3781 }
3782
3783 if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceQuiesced)
3784 {
3785 // record SYNC CACHE command completion time stamp.
3786 KeQueryTickCount(&DeviceExtension->PowerContext.Step1CompleteTime);
3787 }
3788
3789 return status;
3790}
unsigned char BOOLEAN
Definition: actypes.h:127
#define MAXIMUM_RETRIES
Definition: cdrom.h:124
#define SCSI_CDROM_TIMEOUT
Definition: cdrom.h:680
BOOLEAN RequestSenseInfoInterpret(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ WDFREQUEST Request, _In_ PSCSI_REQUEST_BLOCK Srb, _In_ ULONG RetriedCount, _Out_ NTSTATUS *Status, _Out_opt_ _Deref_out_range_(0, MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) LONGLONG *RetryIntervalIn100ns)
Definition: sense.c:2467
#define TEST_FLAG(Flags, Bit)
Definition: cdrom.h:1495
@ PowerDownDeviceStopped
Definition: cdrom.h:412
@ PowerDownDeviceQuiesced
Definition: cdrom.h:410
@ PowerDownDeviceInitial
Definition: cdrom.h:408
@ PowerDownDeviceLocked
Definition: cdrom.h:409
@ PowerDownDeviceFlushed
Definition: cdrom.h:411
union _CDB * PCDB
#define SCSIOP_START_STOP_UNIT
Definition: cdrw_hw.h:897
#define SCSIOP_SYNCHRONIZE_CACHE
Definition: cdrw_hw.h:918
#define STATUS_NOT_IMPLEMENTED
Definition: d3dkmdt.h:42
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
NTSTATUS RequestSend(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ WDFREQUEST Request, _In_ WDFIOTARGET IoTarget, _In_ ULONG Flags, _Out_opt_ PBOOLEAN RequestSent)
Definition: common.c:3793
VOID RequestClearSendTime(_In_ WDFREQUEST Request)
Definition: common.c:111
#define SRB_FUNCTION_EXECUTE_SCSI
Definition: srb.h:315
#define SRB_FLAGS_NO_DATA_TRANSFER
Definition: srb.h:402
#define SRB_FUNCTION_LOCK_QUEUE
Definition: srb.h:332
#define SRB_FUNCTION_UNLOCK_QUEUE
Definition: srb.h:333
#define SRB_FLAGS_BYPASS_LOCKED_QUEUE
Definition: srb.h:410
#define SRB_FLAGS_DISABLE_SYNCH_TRANSFER
Definition: srb.h:397
#define SRB_STATUS(Status)
Definition: srb.h:389
#define SRB_STATUS_QUEUE_FROZEN
Definition: srb.h:386
#define SRB_FLAGS_NO_QUEUE_FREEZE
Definition: srb.h:404
#define SRB_STATUS_SUCCESS
Definition: srb.h:341
#define KeDelayExecutionThread(mode, foo, t)
Definition: env_spec_w32.h:484
GLdouble GLdouble t
Definition: gl.h:2047
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_ PVOID Context
Definition: kse.h:81
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE CompletionRoutine
Definition: kse.h:80
#define KernelMode
Definition: asm.h:38
#define SRB_FLAGS_D3_PROCESSING
Definition: srb.h:165
#define SRB_FUNCTION_QUIESCE_DEVICE
Definition: srb.h:99
#define KeQueryTickCount(CurrentCount)
Definition: ke.h:43
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
Definition: cdrw_hw.h:28
struct _CDB::_START_STOP START_STOP
struct _CDB::_SYNCHRONIZE_CACHE10 SYNCHRONIZE_CACHE10
@ WDF_REQUEST_SEND_OPTION_SYNCHRONOUS
Definition: wdfrequest.h:109

◆ _Out_writes_bytes_()

_Out_writes_bytes_ ( Length  )

◆ HubCheckUsb2HubDescriptor()

BOOLEAN NTAPI HubCheckUsb2HubDescriptor ( _In_ HubFdo *  Hub,
_In_reads_bytes_(Length) PUSB_HUB_DESCRIPTOR  Descriptor,
_In_ ULONG  Length 
)

Definition at line 59 of file hubdescval.cpp.

63{
65
68}
HubFdo * Hub
Definition: bootdev.cpp:261
BOOLEAN NTAPI HubDescCheck20Hub(_In_ const HubDescContext *Context, _In_reads_bytes_opt_(Length) PUSB_HUB_DESCRIPTOR Descriptor, _In_ ULONG Length)
Definition: desccheck.cpp:3198
static VOID NTAPI HubBuildDescContext(_In_ HubFdo *Hub, _Out_ HubDescContext *Context)
Definition: hubdescval.cpp:35
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342

Referenced by HubMachine::ParseHubDescriptor().

◆ HubCheckUsb3HubDescriptor()

BOOLEAN NTAPI HubCheckUsb3HubDescriptor ( _In_ HubFdo *  Hub,
_In_reads_bytes_(Length) PUSB_30_HUB_DESCRIPTOR  Descriptor,
_In_ ULONG  Length 
)

Definition at line 72 of file hubdescval.cpp.

76{
78
81}
BOOLEAN NTAPI HubDescCheck30Hub(_In_ const HubDescContext *Context, _In_reads_bytes_opt_(Length) PUSB_30_HUB_DESCRIPTOR Descriptor, _In_ ULONG Length)
Definition: desccheck.cpp:3272

Referenced by HubMachine::ParseHubDescriptor().

◆ HubChildForwardToController()

VOID NTAPI HubChildForwardToController ( _In_ HubChild *  Child)

Sends the device's current client request to UCX as is; completes it, then posts ControllerRequestDone.

Definition at line 1352 of file devhcd.cpp.

1354{
1355 WDFREQUEST Request = Child->m_ClientRequest;
1356
1357 WdfRequestFormatRequestUsingCurrentType(Request);
1358 WdfRequestSetCompletionRoutine(Request, HubChildClientRequestComplete, Child);
1359
1360 if (!WdfRequestSend(Request, Child->m_Hub->m_RootHubTarget, WDF_NO_SEND_OPTIONS))
1361 {
1362 DPRINT1("Device %p client request not sent 0x%lx\n", Child, WdfRequestGetStatus(Request));
1363 WdfRequestComplete(Request, WdfRequestGetStatus(Request));
1365 }
1366}
static EVT_WDF_REQUEST_COMPLETION_ROUTINE HubChildClientRequestComplete
Definition: devhcd.cpp:51
@ ControllerRequestDone
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFREQUEST Request
_Must_inspect_result_ FORCEINLINE BOOLEAN WdfRequestSend(_In_ WDFREQUEST Request, _In_ WDFIOTARGET Target, _In_opt_ PWDF_REQUEST_SEND_OPTIONS Options)
Definition: wdfrequest.h:677
#define WDF_NO_SEND_OPTIONS
Definition: wdftypes.h:109

Referenced by DeviceMachine::ForwardToController().

◆ HubClearTtBuffer()

VOID NTAPI HubClearTtBuffer ( _In_ UCXHUB_HUB_CONTEXT  HubContext,
_In_ UCXHUB_DEVICE_CONTEXT  DeviceContext,
_In_ UCXENDPOINT  Endpoint,
_In_ ULONG  EndpointNumber,
_In_ ULONG  TtPortNumber 
)

Definition at line 220 of file hubreq.cpp.

226{
230 WDFREQUEST Request = NULL;
234
236 goto Done;
237
238 /* Computed even for RESET_TT, which does not use it */
242 if (!NT_SUCCESS(Status))
243 goto Done;
244
246 if (Clear == NULL)
247 {
248 DPRINT1("Hub %p no memory for a TT clear\n", Hub);
249 goto Done;
250 }
251
252 Clear->Hub = Hub;
253 Clear->Endpoint = Endpoint;
254
255 if (!NT_SUCCESS(Clear->Control.Create(Hub->m_Device, WdfDeviceGetIoTarget(Hub->m_Device))))
256 goto Done;
257 Request = Clear->Control.Request;
258
259 Clear->Control.SetSetup(0x23,
261 ResetTt ? 0 : Value,
263 0);
264
265 Status = Clear->Control.Send(Hub->m_RootHubTarget,
266 Hub->UsbDevice(),
268 Clear,
269 NULL,
270 0,
271 FALSE,
273 if (NT_SUCCESS(Status))
274 return;
275
276Done:
277 if (Request != NULL)
279 if (Clear != NULL)
281
283}
Definition: fdo.h:132
WDFDEVICE m_Device
Definition: fdo.h:349
static HubFdo * FromContext(_In_ UCXHUB_HUB_CONTEXT Context)
Definition: fdo.h:144
WDFIOTARGET m_RootHubTarget
Definition: fdo.h:368
UCXHUB_STACK_INTERFACE m_Stack
Definition: fdo.h:356
BOOLEAN HasFlag(_In_ HubFlag Flag) const
Definition: fdo.h:153
UCXUSBDEVICE UsbDevice() const
Definition: fdo.h:180
BOOLEAN NeedsForwardProgress() const
Definition: fdo.h:208
KEVENT Done
Definition: devreq.cpp:1162
#define NonPagedPool
Definition: env_spec_w32.h:307
static NTSTATUS NTAPI HubTtClearValue(_In_ HubChild *Child, _In_ UCXENDPOINT Endpoint, _In_ ULONG EndpointAddress, _Out_ PUSHORT Value)
Definition: hubreq.cpp:130
static const char HubTagClearTt[]
Definition: hubreq.cpp:116
static VOID NTAPI HubTtClearComplete(_In_ WDFREQUEST Request, _In_ WDFIOTARGET Target, _In_ PWDF_REQUEST_COMPLETION_PARAMS Params, _In_ WDFCONTEXT Context)
Definition: hubreq.cpp:194
#define HUB_REQUEST_CLEAR_TT_BUFFER
Definition: hubreq.h:89
#define HUB_REQUEST_RESET_TT
Definition: hubreq.h:90
_In_ UCXHUB_DEVICE_CONTEXT _In_ UCXENDPOINT _In_ ULONG _In_ ULONG TtPortNumber
Definition: hubucx.h:240
_In_ UCXHUB_DEVICE_CONTEXT DeviceContext
Definition: hubucx.h:237
_In_ UCXHUB_DEVICE_CONTEXT _In_ UCXENDPOINT Endpoint
Definition: hubucx.h:238
_In_ UCXHUB_DEVICE_CONTEXT _In_ UCXENDPOINT _In_ ULONG EndpointNumber
Definition: hubucx.h:239
#define HUB_TAG_HUB
Definition: hubutil.h:12
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
static PVOID ExAllocatePoolZero(ULONG PoolType, SIZE_T NumberOfBytes, ULONG Tag)
Definition: precomp.h:45
static void Clear(void)
Definition: treeview.c:388
unsigned short USHORT
Definition: pedump.c:61
UCXUSBDEVICE Hub
Definition: hubucx.h:430
PFN_UCXHUB_CLEAR_TT_BUFFER_COMPLETE ClearTtBufferComplete
Definition: hubucx.h:450
@ ResetTtOnCancel
@ NoClearTtOnCancel
_In_opt_ PVOID HubContext
Definition: usbdhub.h:41
WdfObjectDelete(String)
#define WdfObjectDereferenceWithTag(Handle, Tag)
Definition: wdfobject.h:829
#define WdfObjectReferenceWithTag(Handle, Tag)
Definition: wdfobject.h:806
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413

◆ HubConnectorFindCompanion()

HubPort *NTAPI HubConnectorFindCompanion ( _In_ HubPort *  Port,
_In_ ULONG  Index 
)

Companion port 0 or 1 sharing Port's connector, or NULL. Only valid under the map lock.

Definition at line 287 of file portconn.cpp.

290{
292
293 if (Index > 1)
294 {
295 DPRINT1("Companion index %lu out of range\n", Index);
296 return NULL;
297 }
298
300 if (Node == NULL)
301 {
302 if (Port->HasProperty(PortProperty::InConnectorMap))
303 DPRINT1("Port %u: registered port has no connector\n", Port->Number());
304
305 return NULL;
306 }
307
308 if (!Port->IsUsb30())
309 return (Index == 0) ? Node->Usb30 : Node->Usb30Second;
310
311 if (Index == 0)
312 return Node->Usb20;
313
314 return (Node->Usb30 == Port) ? Node->Usb30Second : Node->Usb30;
315}
union node Node
Definition: types.h:1255
CPPORT Port[4]
Definition: headless.c:38
static HubConnectorNode *NTAPI HubConnectorFindByPort(_In_ HubPort *Port)
Definition: portconn.cpp:97
Definition: dlist.c:348
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by HubIoGetConnectorProperties().

◆ HubConnectorNodeForPort()

PVOID NTAPI HubConnectorNodeForPort ( _In_ HubPort *  Port)

Connector map node of a port, or NULL when the port is not mapped.

Definition at line 320 of file portconn.cpp.

322{
324
325 if (!Port->HasProperty(PortProperty::InConnectorMap))
326 return NULL;
327
328 HubConnectorLock();
330 HubConnectorUnlock();
331
332 return Node;
333}

Referenced by DeviceMachine::AddChildToHub().

◆ HubFindPipeByHandle()

HubPipe *NTAPI HubFindPipeByHandle ( _In_opt_ HubConfiguration *  Config,
_In_ USBD_PIPE_HANDLE  Handle 
)

Pipe of Config whose USBD pipe handle is Handle, or NULL. The caller protects Config.

Definition at line 858 of file devreq.cpp.

861{
864 ULONG Index;
865
866 if (Config == NULL)
867 return NULL;
868
869 for (Entry = Config->Interfaces.Flink; Entry != &Config->Interfaces; Entry = Entry->Flink)
870 {
872
873 for (Index = 0; Index < Interface->PipeCount; Index++)
874 {
875 if (Interface->Pipes[Index].PipeHandle == Handle)
876 return &Interface->Pipes[Index];
877 }
878 }
879
880 return NULL;
881}
PLIST_ENTRY Entry
Definition: devhcd.cpp:1262
ULONG Handle
Definition: gdb_input.c:15
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
_Must_inspect_result_ _In_ WDFDEVICE _In_ PUCX_CONTROLLER_CONFIG Config
_In_ UCXUSBDEVICE _In_ ULONG Interface
Definition: ucxusbdevice.h:428

Referenced by DeviceMachine::FindClientPipe().

◆ HubFreeBillboardInfo()

VOID NTAPI HubFreeBillboardInfo ( _In_ HubChild *  Child)

Frees the billboard record and its descriptor copy, if any.

Definition at line 348 of file devdesc.cpp.

350{
351 HubBillboardInfo* Billboard = Child->m_Billboard;
352
353 if (Billboard == NULL)
354 return;
355
356 if (Billboard->Descriptor != NULL)
358
359 ExFreePoolWithTag(Billboard, HUB_TAG_HUB);
360 Child->m_Billboard = NULL;
361}
PUSB_DEVICE_CAPABILITY_BILLBOARD_DESCRIPTOR Descriptor
Definition: hubchild.h:232

Referenced by HubKeepBillboardData(), HubReleaseTransferState(), and DeviceMachine::ReadBosHeader().

◆ HubIdBuildCompatibleIds()

NTSTATUS NTAPI HubIdBuildCompatibleIds ( _In_ HubChild *  Child,
_In_opt_ PWDFDEVICE_INIT  DeviceInit,
_Out_opt_ PUSB_ID_STRING  Ids 
)

Compatible ids into a PDO init and/or a multi-sz list, which is zeroed first.

Definition at line 597 of file hubid.cpp.

601{
604
605 if (Ids != NULL)
606 RtlZeroMemory(Ids, sizeof(*Ids));
607
609 {
610 const HubFailureId* Failure = HubFailureIdFor(Child);
611 return HubIdEmitCounted(&Sink, Failure->Id, Failure->IdBytes);
612 }
613
614 if (Child->HasProperty(ChildProperty::IsComposite))
616
617 if (Child->HasProperty(ChildProperty::IsHub))
618 {
619 switch (Child->Speed())
620 {
621 case UsbHighSpeed:
622 case UsbFullSpeed:
623 Text.Set(L"USB\\USB20_HUB");
624 return HubIdEmitText(&Sink, &Text);
625
626 case UsbSuperSpeed:
627 Text.Set(L"USB\\USB30_HUB");
628 return HubIdEmitText(&Sink, &Text);
629
630 default:
631 return STATUS_SUCCESS;
632 }
633 }
634
635 if (Child->HasProperty(ChildProperty::HasBillboard))
637
638 return HubIdBuildClassIds(Child, &Sink);
639}
#define L(x)
Definition: resources.c:13
static BOOLEAN NTAPI HubIdUsesFailureId(_In_ HubChild *Child)
Definition: hubid.cpp:289
static const WCHAR HubBillboardId[]
Definition: hubid.cpp:56
static NTSTATUS NTAPI HubIdBuildCompositeIds(_In_ HubChild *Child, _In_ const HubIdSink *Sink)
Definition: hubid.cpp:422
static const HubFailureId *NTAPI HubFailureIdFor(_In_ HubChild *Child)
Definition: hubid.cpp:61
static NTSTATUS NTAPI HubIdBuildClassIds(_In_ HubChild *Child, _In_ const HubIdSink *Sink)
Definition: hubid.cpp:541
static NTSTATUS NTAPI HubIdEmitCounted(_In_ const HubIdSink *Sink, _In_reads_bytes_(IdBytes) PCWSTR Id, _In_ USHORT IdBytes)
Definition: hubid.cpp:261
return STATUS_SUCCESS
Definition: hubid.cpp:973
Text
Definition: hubid.cpp:956
_In_ PWDFDEVICE_INIT DeviceInit
Definition: hubid.cpp:832
static NTSTATUS NTAPI HubIdEmitText(_In_ const HubIdSink *Sink, _In_ const HubIdText *Text)
Definition: hubid.cpp:241
_In_ const HubIdStrings * Ids
PCWSTR Id
Definition: hubid.cpp:34
USHORT IdBytes
Definition: hubid.cpp:35
Definition: precomp.h:83
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
@ UsbSuperSpeed
Definition: usb200.h:45
@ UsbHighSpeed
Definition: usb200.h:44
@ UsbFullSpeed
Definition: usb200.h:43

◆ HubIdBuildHardwareIds()

NTSTATUS NTAPI HubIdBuildHardwareIds ( _In_ HubChild *  Child,
_In_opt_ PWDFDEVICE_INIT  DeviceInit,
_Out_opt_ PUSB_ID_STRING  Ids 
)

Hardware ids into a PDO init and/or a multi-sz list, which is zeroed first.

Definition at line 381 of file hubid.cpp.

385{
387 const USB_DEVICE_DESCRIPTOR* Descriptor = &Child->m_DeviceDescriptor;
389 WCHAR Revision[5];
391
392 if (Ids != NULL)
393 RtlZeroMemory(Ids, sizeof(*Ids));
394
396 {
397 const HubFailureId* Failure = HubFailureIdFor(Child);
398 return HubIdEmitCounted(&Sink, Failure->Id, Failure->IdBytes);
399 }
400
402 return HubIdEmit(&Sink, &Child->m_VmReservedId);
403
404 HubIdRevisionText(Descriptor->bcdUSB, Descriptor->bcdDevice, Revision);
405
406 Text.Format(L"USB\\VID_%04X&PID_%04X&REV_", Descriptor->idVendor, Descriptor->idProduct);
407 Text.Append(Revision);
409 if (!NT_SUCCESS(Status))
410 return Status;
411
412 Text.Format(L"USB\\VID_%04X&PID_%04X", Descriptor->idVendor, Descriptor->idProduct);
413 return HubIdEmitText(&Sink, &Text);
414}
static NTSTATUS NTAPI HubIdEmit(_In_ const HubIdSink *Sink, _In_ PCUNICODE_STRING Id)
Definition: hubid.cpp:198
static BOOLEAN NTAPI HubIdIsVmReserved(_In_ HubChild *Child)
Definition: hubid.cpp:298
NTSTATUS Status
Definition: hubid.cpp:837
static VOID NTAPI HubIdRevisionText(_In_ USHORT BcdUsb, _In_ USHORT BcdDevice, _Out_writes_(5) PWCHAR Text)
Definition: hubid.cpp:309
short WCHAR
Definition: pedump.c:58
_In_ const GUID _In_ ULONG Revision
Definition: slotdev.cpp:85
_In_ PWDFDEVICE_INIT DeviceInit
Definition: wdfcontrol.h:113

◆ HubIdFreeDeviceIds()

VOID NTAPI HubIdFreeDeviceIds ( _In_ HubChild *  Child)

Frees the identity buffers of a device; called when the device object is destroyed.

Definition at line 813 of file hubid.cpp.

815{
816 if (Child->m_VmReservedId.Buffer != NULL)
817 ExFreePoolWithTag(Child->m_VmReservedId.Buffer, HUB_TAG_DEVICE);
818
819 RtlZeroMemory(&Child->m_VmReservedId, sizeof(Child->m_VmReservedId));
820}
#define HUB_TAG_DEVICE
Definition: hubutil.h:13

◆ HubIdGetContainerId()

BOOLEAN NTAPI HubIdGetContainerId ( _In_ HubChild *  Child,
_Out_ GUID *  ContainerId 
)

Container id the PDO got; FALSE when it got none.

Definition at line 749 of file hubid.cpp.

752{
754
756 return FALSE;
757
758 *ContainerId = Child->m_ContainerId;
759 return TRUE;
760}
_Check_return_ _In_ ULONG _Inout_ PDXGK_CHILD_CONTAINER_ID ContainerId
Definition: dispmprt.h:1484
static BOOLEAN NTAPI HubIdHasContainerId(_In_ HubChild *Child)
Definition: hubid.cpp:708

◆ HubIdGetSerialNumberText()

BOOLEAN NTAPI HubIdGetSerialNumberText ( _In_ HubChild *  Child,
_Outptr_result_bytebuffer_ *Length PCWSTR *  Text,
_Out_ PULONG  Length 
)

Cached serial number text without its decoration, for the serial string IOCTL.

Definition at line 1111 of file hubid.cpp.

1115{
1116 *Text = NULL;
1117 *Length = 0;
1118
1119 if (Child->m_SerialNumber == NULL ||
1120 Child->m_SerialNumberLength < Child->m_SerialPrefixLength + sizeof(WCHAR))
1121 {
1122 return FALSE;
1123 }
1124
1125 *Text = Child->m_SerialNumber + Child->m_SerialPrefixLength / sizeof(WCHAR);
1126 *Length = Child->m_SerialNumberLength - Child->m_SerialPrefixLength - sizeof(WCHAR);
1127 return TRUE;
1128}

Referenced by HubIoGetDescriptor(), and DeviceMachine::SameSerialNumber().

◆ HubIdLanguageSupported()

BOOLEAN NTAPI HubIdLanguageSupported ( _In_ HubChild *  Child,
_In_ USHORT  Language 
)

TRUE when the device lists Language among its string languages.

Definition at line 911 of file hubid.cpp.

914{
915 const USB_STRING_DESCRIPTOR* List = Child->m_LanguageIds;
916 ULONG Count;
917 ULONG Index;
918
919 if (List == NULL || List->bLength <= 2)
920 return FALSE;
921
922 Count = (List->bLength - 2) / sizeof(WCHAR);
923 for (Index = 0; Index < Count && List->bString[Index] != 0; Index++)
924 {
925 if (List->bString[Index] == Language)
926 return TRUE;
927 }
928
929 return FALSE;
930}
USHORT Count
Definition: userreq.cpp:200
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550

Referenced by DeviceMachine::ProductNameWanted().

◆ HubIdListCopy()

NTSTATUS NTAPI HubIdListCopy ( _Out_ PUSB_ID_STRING  Destination,
_In_ const USB_ID_STRING *  Source 
)

Duplicates a multi-sz id list into nonpaged pool.

Definition at line 173 of file hubid.cpp.

176{
178
179 if (Source->Buffer == NULL || Source->LengthInBytes == 0)
180 return STATUS_SUCCESS;
181
184 if (Destination->Buffer == NULL)
185 {
186 DPRINT1("Id list copy of %lu bytes could not be allocated\n", Source->LengthInBytes);
188 }
189
190 RtlCopyMemory(Destination->Buffer, Source->Buffer, Source->LengthInBytes);
191 return STATUS_SUCCESS;
192}
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3169
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:3051
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint16_t * PWCHAR
Definition: typedefs.h:56
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158

Referenced by if().

◆ HubIdListFree()

VOID NTAPI HubIdListFree ( _Inout_ PUSB_ID_STRING  Ids)

Frees a multi-sz id list; an empty list is fine.

Definition at line 159 of file hubid.cpp.

161{
162 if (Ids->Buffer == NULL)
163 return;
164
166 Ids->Buffer = NULL;
167 Ids->LengthInBytes = 0;
168}

◆ HubLogConfigTotalLengthMismatch()

VOID NTAPI HubLogConfigTotalLengthMismatch ( _In_ HubFdo *  Hub)

Definition at line 85 of file hubdescval.cpp.

87{
89
92}
VOID NTAPI HubDescLog(_In_ const HubDescContext *Context, _In_ HubDescCode Code, _In_ BOOLEAN Warning)
Definition: desccheck.cpp:383
@ ConfigTotalLengthTooLarge

Referenced by HubMachine::CacheConfigDescriptor().

◆ HubLogDeviceValidationError()

VOID NTAPI HubLogDeviceValidationError ( _In_ HubChild *  Child,
_In_ ULONG  Code 
)

Records a descriptor validation code against the device.

Definition at line 483 of file devmisc.cpp.

486{
487 RtlSetBit(&Child->m_ValidationBitmap, Code);
488}
#define RtlSetBit
Definition: dbgbitmap.h:344
_In_ UCHAR _In_ UCHAR _In_ ULONG Code
Definition: wdfdevice.h:1707

Referenced by DeviceMachine::AddChildToHub().

◆ HubMakeUsb2StyleDescriptor()

VOID NTAPI HubMakeUsb2StyleDescriptor ( _In_ HubFdo *  Hub,
_Out_ PUSB_HUB_DESCRIPTOR  Descriptor 
)

The 71 byte USB 2.0 style hub descriptor legacy tools expect, for any hub speed.

Definition at line 135 of file hubwmi.cpp.

138{
139 ULONG MaskBytes;
140
142
143 if (Hub->IsRootHub())
144 {
145 Descriptor->bPowerOnToPowerGood = 2;
146 }
148 {
150 return;
151 }
152 else if (Hub->m_Parent.HubSpeed == UsbSuperSpeed)
153 {
154 Descriptor->wHubCharacteristics = Hub->m_HubDescriptor.Usb30.wHubCharacteristics & 0x1F;
157 }
158 else
159 {
160 /* A low speed hub cannot exist */
161 return;
162 }
163
164 /* Always 9, even when more than 7 ports need a longer mask */
165 Descriptor->bDescriptorLength = 9;
166 Descriptor->bDescriptorType = USB_20_HUB_DESCRIPTOR_TYPE;
167 Descriptor->bNumberOfPorts = (UCHAR)Hub->m_PortCount;
168
169 /* All ports removable, followed by an all ones power control mask */
170 MaskBytes = Descriptor->bNumberOfPorts / 8 + 1;
171 RtlFillMemory(&Descriptor->bRemoveAndPowerMask[MaskBytes], MaskBytes, 0xFF);
172}
USB_HUB_DESCRIPTOR Usb20
Definition: fdo.h:419
ULONG m_PortCount
Definition: fdo.h:379
USB_30_HUB_DESCRIPTOR Usb30
Definition: fdo.h:420
UCXHUB_PARENT_INTERFACE m_Parent
Definition: fdo.h:355
BOOLEAN IsRootHub() const
Definition: fdo.h:174
union HubFdo::@1628 m_HubDescriptor
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:603
USB_DEVICE_SPEED HubSpeed
Definition: hubucx.h:504
UCHAR bPowerOnToPowerGood
Definition: usb300.h:289
USHORT wHubCharacteristics
Definition: usb300.h:288
UCHAR bHubControlCurrent
Definition: usb300.h:290
unsigned char UCHAR
Definition: typedefs.h:53
#define USB_20_HUB_DESCRIPTOR_TYPE
Definition: usb200.h:280

Referenced by HubWmiQueryHubNode().

◆ HubNoPingResponse()

VOID NTAPI HubNoPingResponse ( _In_ UCXHUB_HUB_CONTEXT  HubContext,
_In_ UCXHUB_DEVICE_CONTEXT  DeviceContext 
)

Definition at line 2955 of file childpdo.cpp.

2958{
2960
2961 DPRINT1("Device %p did not answer a ping\n", DeviceContext);
2963}
@ NoPingResponse
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329

◆ HubReleaseRegistryState()

VOID NTAPI HubReleaseRegistryState ( _In_ HubChild *  Child)

Frees the buffers the registry and MS OS code keep in the device. Call at destroy.

Definition at line 2115 of file hubregistry.cpp.

2117{
2118 if (Child->m_FriendlyName != NULL)
2119 {
2120 ExFreePoolWithTag(Child->m_FriendlyName, HUB_TAG_DEVICE);
2121 Child->m_FriendlyName = NULL;
2122 Child->m_FriendlyNameLength = 0;
2123 }
2124
2125 if (Child->m_MsOs20Set != NULL)
2126 {
2127 ExFreePoolWithTag(Child->m_MsOs20Set, HUB_TAG_DEVICE);
2128 Child->m_MsOs20Set = NULL;
2129 }
2130
2131 if (Child->m_ExtProperties != NULL)
2132 {
2133 ExFreePoolWithTag(Child->m_ExtProperties, HUB_TAG_DEVICE);
2134 Child->m_ExtProperties = NULL;
2135 }
2136}

◆ HubReleaseTransferState()

VOID NTAPI HubReleaseTransferState ( _In_ HubChild *  Child)

Frees the buffers only the transfer module owns. Call when the device object is destroyed.

Definition at line 973 of file devdesc.cpp.

975{
977
978 if (Child->m_SublinkSpeedAttr != NULL)
979 {
980 ExFreePoolWithTag(Child->m_SublinkSpeedAttr, HUB_TAG_DEVICE);
981 Child->m_SublinkSpeedAttr = NULL;
982 Child->m_SublinkSpeedAttrCount = 0;
983 }
984
985 if (Child->m_MsOsExtConfig != NULL)
986 {
987 ExFreePoolWithTag(Child->m_MsOsExtConfig, HUB_TAG_DEVICE);
988 Child->m_MsOsExtConfig = NULL;
989 }
990}
VOID NTAPI HubFreeBillboardInfo(_In_ HubChild *Child)
Definition: devdesc.cpp:348

◆ HubUsb4NeedsHostPower()

BOOLEAN NTAPI HubUsb4NeedsHostPower ( _In_ HubChild *  Child)

A device behind a USB4 port holds its host router powered while tunneled or not known yet.

Definition at line 587 of file hubtunnel.cpp.

589{
590 return Child->m_Port->HasFlag(PortFlag::Usb4Host) &&
591 (Child->m_TunnelState == HUB_TUNNEL_STATE_TUNNELED ||
592 Child->m_TunnelState == HUB_TUNNEL_STATE_UNKNOWN);
593}
#define HUB_TUNNEL_STATE_UNKNOWN
Definition: hubchild.h:54
#define HUB_TUNNEL_STATE_TUNNELED
Definition: hubchild.h:52

◆ HubValidateHubConfiguration()

BOOLEAN NTAPI HubValidateHubConfiguration ( _In_ HubFdo *  Hub,
_In_reads_bytes_(Length) PUSB_CONFIGURATION_DESCRIPTOR  Descriptor,
_In_ ULONG  Length 
)

Definition at line 46 of file hubdescval.cpp.

50{
52
55}
BOOLEAN NTAPI HubDescCheckConfiguration(_In_ const HubDescContext *Context, _In_reads_bytes_opt_(Length) PUSB_CONFIGURATION_DESCRIPTOR Descriptor, _In_ ULONG Length, _Out_opt_ PBOOLEAN SupportsStreams)
Definition: desccheck.cpp:1237

Referenced by HubMachine::CacheConfigDescriptor().

◆ HubWmiNotifyOverCurrent()

VOID NTAPI HubWmiNotifyOverCurrent ( _In_ HubFdo *  Hub,
_In_ ULONG  PortNumber 
)

Definition at line 750 of file hubwmi.cpp.

753{
755}
_In_ ULONG PortNumber
Definition: hubucx.h:272
static VOID NTAPI HubWmiFirePortEvent(_In_ HubFdo *Hub, _In_ ULONG PortNumber, _In_ USB_NOTIFICATION_TYPE Type)
Definition: hubwmi.cpp:72
@ OverCurrent
Definition: usbioctl.h:511

Referenced by PortMachine::NotifyUserOfOverCurrent().

Variable Documentation

◆ Child

Definition at line 385 of file hubsvc.h.

◆ DeviceInit

Definition at line 246 of file hubsvc.h.

◆ Event

Definition at line 393 of file hubsvc.h.

◆ HubEvtBandwidthRetryTimer

EVT_WDF_TIMER HubEvtBandwidthRetryTimer

Definition at line 214 of file hubsvc.h.

Referenced by HubChild::Create().

◆ Irp

Definition at line 283 of file hubsvc.h.

◆ Length

Definition at line 354 of file hubsvc.h.

◆ MessageId

_In_ ULONG MessageId

Definition at line 157 of file hubsvc.h.

◆ Name

Definition at line 93 of file hubsvc.h.

◆ Notification

Definition at line 473 of file hubsvc.h.

◆ Pdo

Definition at line 450 of file hubsvc.h.

◆ Port

_In_ HubPort* Port

Definition at line 92 of file hubsvc.h.

◆ PortNumber

Definition at line 524 of file hubsvc.h.

◆ String

_In_ WDFSTRING String

Definition at line 401 of file hubsvc.h.

◆ Type

Definition at line 353 of file hubsvc.h.

◆ UpdateRequired

_In_ HubChild _Out_opt_ PBOOLEAN UpdateRequired

Definition at line 386 of file hubsvc.h.

◆ Value

Definition at line 363 of file hubsvc.h.