ReactOS 0.4.17-dev-1371-g303d27d
hubucx.h File Reference
#include <usbiodef.h>
Include dependency graph for hubucx.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  _UCXHUB_RESET_FLAGS
 
struct  _UCXHUB_DEVICE_CREATE_INFO
 
struct  _UCXHUB_ROOTHUB_INFO
 
struct  _UCXHUB_CONTROLLER_INFO
 
struct  _UCXHUB_CONTROLLER_INFO_V2
 
struct  _UCXHUB_STOP_IDLE_CONTEXT
 
struct  _UCXHUB_QUERY_CAPABILITY
 
struct  _UCXHUB_FUNCTION_DATA
 
struct  _UCXHUB_DUMP_DEVICE_INFO
 
struct  _UCXHUB_FORWARD_PROGRESS_PIPE
 
struct  _UCXHUB_FORWARD_PROGRESS_INFO
 
struct  _UCXHUB_STACK_INTERFACE
 
struct  _UCXHUB_PARENT_INTERFACE
 
struct  _UCXHUB_PARENT_INTERFACE_ORIGINAL
 
struct  _UCXHUB_UPDATE_TUNNEL_ANSWER
 

Macros

#define UCXHUB_FN_ADDRESS0_OWNERSHIP_ACQUIRE   0x401
 
#define UCXHUB_FN_ROOTHUB_GET_INFO   0x402
 
#define UCXHUB_FN_ROOTHUB_GET_20PORT_INFO   0x403
 
#define UCXHUB_FN_ROOTHUB_GET_30PORT_INFO   0x404
 
#define UCXHUB_FN_DEVICE_ENABLE   0x405
 
#define UCXHUB_FN_DEVICE_RESET   0x406
 
#define UCXHUB_FN_DEVICE_ADDRESS   0x407
 
#define UCXHUB_FN_DEVICE_UPDATE   0x408
 
#define UCXHUB_FN_DEVICE_HUB_INFO   0x409
 
#define UCXHUB_FN_DEVICE_DISABLE   0x40A
 
#define UCXHUB_FN_DEVICE_PURGE_IO   0x40B
 
#define UCXHUB_FN_DEVICE_START_IO   0x40C
 
#define UCXHUB_FN_ENDPOINTS_CONFIGURE   0x40D
 
#define UCXHUB_FN_DEFAULT_ENDPOINT_UPDATE   0x40E
 
#define UCXHUB_FN_ENDPOINT_RESET   0x40F
 
#define UCXHUB_FN_GET_HUB_INFO   0x410
 
#define UCXHUB_FN_QUERY_USB_CAPABILITY   0x412
 
#define UCXHUB_FN_SET_FUNCTION_HANDLE_DATA   0x413
 
#define UCXHUB_FN_DEVICE_TREE_PURGE_IO   0x414
 
#define UCXHUB_FN_DEVICE_ABORT_IO   0x415
 
#define UCXHUB_FN_GET_DUMP_DATA   0x501
 
#define UCXHUB_FN_FREE_DUMP_DATA   0x502
 
#define UCXHUB_FN_NOTIFY_FORWARD_PROGRESS   0x503
 
#define UCXHUB_IOCTL(Function)    CTL_CODE(FILE_DEVICE_USBEX, (Function), METHOD_NEITHER, FILE_ANY_ACCESS)
 
#define IOCTL_UCXHUB_ADDRESS0_OWNERSHIP_ACQUIRE   UCXHUB_IOCTL(UCXHUB_FN_ADDRESS0_OWNERSHIP_ACQUIRE)
 
#define IOCTL_UCXHUB_ROOTHUB_GET_INFO   UCXHUB_IOCTL(UCXHUB_FN_ROOTHUB_GET_INFO)
 
#define IOCTL_UCXHUB_ROOTHUB_GET_20PORT_INFO   UCXHUB_IOCTL(UCXHUB_FN_ROOTHUB_GET_20PORT_INFO)
 
#define IOCTL_UCXHUB_ROOTHUB_GET_30PORT_INFO   UCXHUB_IOCTL(UCXHUB_FN_ROOTHUB_GET_30PORT_INFO)
 
#define IOCTL_UCXHUB_DEVICE_ENABLE   UCXHUB_IOCTL(UCXHUB_FN_DEVICE_ENABLE)
 
#define IOCTL_UCXHUB_DEVICE_RESET   UCXHUB_IOCTL(UCXHUB_FN_DEVICE_RESET)
 
#define IOCTL_UCXHUB_DEVICE_ADDRESS   UCXHUB_IOCTL(UCXHUB_FN_DEVICE_ADDRESS)
 
#define IOCTL_UCXHUB_DEVICE_UPDATE   UCXHUB_IOCTL(UCXHUB_FN_DEVICE_UPDATE)
 
#define IOCTL_UCXHUB_DEVICE_HUB_INFO   UCXHUB_IOCTL(UCXHUB_FN_DEVICE_HUB_INFO)
 
#define IOCTL_UCXHUB_DEVICE_DISABLE   UCXHUB_IOCTL(UCXHUB_FN_DEVICE_DISABLE)
 
#define IOCTL_UCXHUB_DEVICE_PURGE_IO   UCXHUB_IOCTL(UCXHUB_FN_DEVICE_PURGE_IO)
 
#define IOCTL_UCXHUB_DEVICE_START_IO   UCXHUB_IOCTL(UCXHUB_FN_DEVICE_START_IO)
 
#define IOCTL_UCXHUB_ENDPOINTS_CONFIGURE   UCXHUB_IOCTL(UCXHUB_FN_ENDPOINTS_CONFIGURE)
 
#define IOCTL_UCXHUB_DEFAULT_ENDPOINT_UPDATE   UCXHUB_IOCTL(UCXHUB_FN_DEFAULT_ENDPOINT_UPDATE)
 
#define IOCTL_UCXHUB_ENDPOINT_RESET   UCXHUB_IOCTL(UCXHUB_FN_ENDPOINT_RESET)
 
#define IOCTL_UCXHUB_GET_HUB_INFO   UCXHUB_IOCTL(UCXHUB_FN_GET_HUB_INFO)
 
#define IOCTL_UCXHUB_QUERY_USB_CAPABILITY   UCXHUB_IOCTL(UCXHUB_FN_QUERY_USB_CAPABILITY)
 
#define IOCTL_UCXHUB_SET_FUNCTION_HANDLE_DATA   UCXHUB_IOCTL(UCXHUB_FN_SET_FUNCTION_HANDLE_DATA)
 
#define IOCTL_UCXHUB_DEVICE_TREE_PURGE_IO   UCXHUB_IOCTL(UCXHUB_FN_DEVICE_TREE_PURGE_IO)
 
#define IOCTL_UCXHUB_DEVICE_ABORT_IO   UCXHUB_IOCTL(UCXHUB_FN_DEVICE_ABORT_IO)
 
#define IOCTL_UCXHUB_NOTIFY_FORWARD_PROGRESS   UCXHUB_IOCTL(UCXHUB_FN_NOTIFY_FORWARD_PROGRESS)
 
#define IOCTL_UCXHUB_GET_DUMP_DATA    CTL_CODE(FILE_DEVICE_USBEX, UCXHUB_FN_GET_DUMP_DATA, METHOD_BUFFERED, FILE_ANY_ACCESS)
 
#define IOCTL_UCXHUB_FREE_DUMP_DATA    CTL_CODE(FILE_DEVICE_USBEX, UCXHUB_FN_FREE_DUMP_DATA, METHOD_BUFFERED, FILE_ANY_ACCESS)
 
#define IOCTL_UCXHUB_RESET_PORT_ASYNC    CTL_CODE(FILE_DEVICE_UNKNOWN, 1004, METHOD_NEITHER, FILE_ANY_ACCESS)
 
#define UCXHUB_URB_FLAGS_UCX_MASK   0x00FFFFFF
 
#define UCXHUB_URB_FLAGS_HUB_MASK   0xFF000000
 
#define UCXHUB_URB_FLAG_PEND_INTERRUPT_TX   0x80000000
 
#define UCXHUB_URB_FLAG_ALLOW_LARGE_TRANSFER   0x40000000
 
#define UCXHUB_QUERY_CAPABILITY_VERSION   1
 
#define UCXHUB_WORKITEM_NO_FLAGS   0
 
#define UCXHUB_WORKITEM_FLAG_NEEDS_FLUSH   1
 
#define UCXHUB_STACK_INTERFACE_VERSION_1   1000
 
#define UCXHUB_STACK_INTERFACE_VERSION_2   2000
 
#define UCXHUB_STACK_INTERFACE_VERSION_3   3000
 
#define UCXHUB_STACK_INTERFACE_SIZE_ORIGINAL    FIELD_OFFSET(UCXHUB_STACK_INTERFACE, DeviceGetTimestamp)
 
#define UCXHUB_PARENT_INTERFACE_VERSION   1013
 
#define UCXHUB_TUNNEL_STATE_NOT_ANSWERED   0
 
#define UCXHUB_TUNNEL_STATE_NO_INFORMATION   1
 
#define UCXHUB_TUNNEL_STATE_TUNNELED   2
 
#define UCXHUB_TUNNEL_STATE_NATIVE   3
 
#define UCXHUB_TUNNEL_STATE_UNKNOWN   4
 

Typedefs

typedef union _UCXHUB_RESET_FLAGS UCXHUB_RESET_FLAGS
 
typedef union _UCXHUB_RESET_FLAGS * PUCXHUB_RESET_FLAGS
 
typedef struct _UCXHUB_DEVICE_CREATE_INFO UCXHUB_DEVICE_CREATE_INFO
 
typedef struct _UCXHUB_DEVICE_CREATE_INFO * PUCXHUB_DEVICE_CREATE_INFO
 
typedef struct _UCXHUB_ROOTHUB_INFO UCXHUB_ROOTHUB_INFO
 
typedef struct _UCXHUB_ROOTHUB_INFO * PUCXHUB_ROOTHUB_INFO
 
typedef struct _UCXHUB_CONTROLLER_INFO UCXHUB_CONTROLLER_INFO
 
typedef struct _UCXHUB_CONTROLLER_INFO * PUCXHUB_CONTROLLER_INFO
 
typedef struct _UCXHUB_CONTROLLER_INFO_V2 UCXHUB_CONTROLLER_INFO_V2
 
typedef struct _UCXHUB_CONTROLLER_INFO_V2 * PUCXHUB_CONTROLLER_INFO_V2
 
typedef struct _UCXHUB_STOP_IDLE_CONTEXT UCXHUB_STOP_IDLE_CONTEXT
 
typedef struct _UCXHUB_STOP_IDLE_CONTEXT * PUCXHUB_STOP_IDLE_CONTEXT
 
typedef struct _UCXHUB_QUERY_CAPABILITY UCXHUB_QUERY_CAPABILITY
 
typedef struct _UCXHUB_QUERY_CAPABILITY * PUCXHUB_QUERY_CAPABILITY
 
typedef struct _UCXHUB_FUNCTION_DATA UCXHUB_FUNCTION_DATA
 
typedef struct _UCXHUB_FUNCTION_DATA * PUCXHUB_FUNCTION_DATA
 
typedef struct _UCXHUB_DUMP_DEVICE_INFO UCXHUB_DUMP_DEVICE_INFO
 
typedef struct _UCXHUB_DUMP_DEVICE_INFO * PUCXHUB_DUMP_DEVICE_INFO
 
typedef struct _UCXHUB_FORWARD_PROGRESS_PIPE UCXHUB_FORWARD_PROGRESS_PIPE
 
typedef struct _UCXHUB_FORWARD_PROGRESS_PIPE * PUCXHUB_FORWARD_PROGRESS_PIPE
 
typedef struct _UCXHUB_FORWARD_PROGRESS_INFO UCXHUB_FORWARD_PROGRESS_INFO
 
typedef struct _UCXHUB_FORWARD_PROGRESS_INFO * PUCXHUB_FORWARD_PROGRESS_INFO
 
typedef struct _UCXHUB_WORKITEM * PUCXHUB_WORKITEM
 
typedef enum _UCXHUB_WORKITEM_ENQUEUE_OPTIONS UCXHUB_WORKITEM_ENQUEUE_OPTIONS
 
typedef _In_opt_ PVOID Context
 
typedef _In_opt_ PVOID _In_ PUCXHUB_WORKITEM WorkItem
 
typedef UCXHUB_WORKITEM_ROUTINE * PUCXHUB_WORKITEM_ROUTINE
 
typedef _In_ UCXHUB_DEVICE_CONTEXT DeviceContext
 
typedef _In_ UCXHUB_DEVICE_CONTEXT _In_ UCXENDPOINT Endpoint
 
typedef _In_ UCXHUB_DEVICE_CONTEXT _In_ UCXENDPOINT _In_ ULONG EndpointNumber
 
typedef _In_ UCXHUB_DEVICE_CONTEXT _In_ UCXENDPOINT _In_ ULONG _In_ ULONG TtPortNumber
 
typedef _Must_inspect_result_ _IRQL_requires_(PASSIVE_LEVEL) NTSTATUS(NTAPI *PFN_UCXHUB_DEVICE_CREATE) (_In_ UCXUSBDEVICE Hub
 Turns off link power management below a hub on a tunneled or unknown USB4 port, or below a root hub outside the system container.
 
typedef _Must_inspect_result_ _In_ PUCXHUB_DEVICE_CREATE_INFO CreateInfo
 
typedef _Must_inspect_result_ _In_ PUCXHUB_DEVICE_CREATE_INFO _Out_ UCXUSBDEVICE * Device = NULL
 
typedef _In_ ULONG PortNumber
 
typedef _In_ UCXUSBDEVICE _In_ PDEVICE_OBJECT Pdo
 
typedef _Must_inspect_result_ _In_ UCXUSBDEVICE _In_ ULONG MaxPacketSize
 
typedef _Must_inspect_result_ _In_ UCXUSBDEVICE _In_reads_bytes_(DescriptorBufferLength) PUSB_ENDPOINT_DESCRIPTOR Descriptor
 
typedef _Must_inspect_result_ _In_ UCXUSBDEVICE _In_ ULONG DescriptorBufferLength = 0
 
typedef _Must_inspect_result_ _In_ UCXUSBDEVICE _In_ ULONG _In_opt_ PUSB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR Companion
 
typedef USBD_PIPE_HANDLE(NTAPI * PFN_UCXHUB_ENDPOINT_PIPE_HANDLE) (_In_ UCXENDPOINT Endpoint)
 
typedef ULONG(NTAPI * PFN_UCXHUB_ENDPOINT_MAX_TRANSFER) (_In_ UCXENDPOINT Endpoint)
 
typedef PUCXHUB_WORKITEM(NTAPI * PFN_UCXHUB_WORKITEM_ALLOCATE) (_In_ UCXUSBDEVICE Hub, _In_ PDEVICE_OBJECT DeviceObject, _In_ ULONG Flags)
 
typedef VOID(NTAPI * PFN_UCXHUB_WORKITEM_DELETE) (_In_ PUCXHUB_WORKITEM WorkItem)
 
typedef VOID(NTAPI * PFN_UCXHUB_WORKITEM_ENQUEUE) (_In_ PUCXHUB_WORKITEM WorkItem, _In_ PUCXHUB_WORKITEM_ROUTINE Routine, _In_opt_ PVOID Context, _In_ UCXHUB_WORKITEM_ENQUEUE_OPTIONS Options)
 
typedef BOOLEAN(NTAPI * PFN_UCXHUB_IS_DEVICE_DISCONNECTED) (_In_ UCXUSBDEVICE Device)
 
typedef _Inout_ PUCXHUB_STOP_IDLE_CONTEXT StopIdleContext
 
typedef _Out_ PUCXHUB_CONTROLLER_INFO ControllerInfo
 
typedef ULONG64(NTAPI * PFN_UCXHUB_DEVICE_GET_TIMESTAMP) (_In_ UCXUSBDEVICE Device)
 
typedef _In_ UCXUSBDEVICE _In_ UCXENDPOINT _In_ ULONG Priority
 
typedef struct _UCXHUB_STACK_INTERFACE UCXHUB_STACK_INTERFACE
 
typedef struct _UCXHUB_STACK_INTERFACE * PUCXHUB_STACK_INTERFACE
 
typedef _In_ PUNICODE_STRING SymbolicLinkName
 
typedef struct _UCXHUB_PARENT_INTERFACE UCXHUB_PARENT_INTERFACE
 
typedef struct _UCXHUB_PARENT_INTERFACE * PUCXHUB_PARENT_INTERFACE
 
typedef struct _UCXHUB_PARENT_INTERFACE_ORIGINAL UCXHUB_PARENT_INTERFACE_ORIGINAL
 
typedef struct _UCXHUB_PARENT_INTERFACE_ORIGINAL * PUCXHUB_PARENT_INTERFACE_ORIGINAL
 
typedef struct _UCXHUB_UPDATE_TUNNEL_ANSWER UCXHUB_UPDATE_TUNNEL_ANSWER
 
typedef struct _UCXHUB_UPDATE_TUNNEL_ANSWER * PUCXHUB_UPDATE_TUNNEL_ANSWER
 

Enumerations

enum  _UCXHUB_WORKITEM_ENQUEUE_OPTIONS { UcxHubWorkItemDefault = 0xCAD00000 , UcxHubWorkItemForwardProgressNotRequired }
 

Functions

 DEFINE_GUID (GUID_UCXHUB_STACK_INTERFACE, 0x4fb2b0e1, 0x5fdd, 0x4dab, 0xa6, 0x00, 0x5e, 0x15, 0x16, 0xbb, 0xd8, 0xa7)
 
 DEFINE_GUID (GUID_UCXHUB_PARENT_INTERFACE, 0xa9264c93, 0xeccd, 0x4b40, 0x92, 0x9b, 0xb3, 0x54, 0xf1, 0xe9, 0xa2, 0xdc)
 
 DECLARE_HANDLE (UCXHUB_HUB_CONTEXT)
 
 DECLARE_HANDLE (UCXHUB_DEVICE_CONTEXT)
 
typedef _Function_class_ (UCXHUB_WORKITEM_ROUTINE) VOID NTAPI UCXHUB_WORKITEM_ROUTINE(_In_ PDEVICE_OBJECT DeviceObject
 
typedef _IRQL_requires_max_ (DISPATCH_LEVEL) VOID(NTAPI *PFN_UCXHUB_CLEAR_TT_BUFFER)(_In_ UCXHUB_HUB_CONTEXT HubContext
 
FORCEINLINE PUCXHUB_UPDATE_TUNNEL_ANSWER NTAPI UcxHubUpdateTunnelAnswer (_In_ PUSBDEVICE_UPDATE Update)
 
 C_ASSERT (UCXHUB_STACK_INTERFACE_SIZE_ORIGINAL==0x78)
 
 C_ASSERT (sizeof(UCXHUB_PARENT_INTERFACE_ORIGINAL)==0x58)
 
 C_ASSERT (sizeof(UCXHUB_QUERY_CAPABILITY)==32)
 
 C_ASSERT (sizeof(UCXHUB_ROOTHUB_INFO)==20)
 
 C_ASSERT (sizeof(UCXHUB_DEVICE_CREATE_INFO)==16)
 
 C_ASSERT (FIELD_OFFSET(USBDEVICE_UPDATE, Reserved)==0x2E)
 
 C_ASSERT (sizeof(USBDEVICE_UPDATE)==0x30)
 
 C_ASSERT (FIELD_OFFSET(UCXHUB_UPDATE_TUNNEL_ANSWER, TunnelState)==1)
 
 C_ASSERT (sizeof(UCXHUB_CONTROLLER_INFO)==28)
 
 C_ASSERT (sizeof(UCXHUB_CONTROLLER_INFO_V2)==32)
 
 C_ASSERT (FIELD_OFFSET(UCXHUB_CONTROLLER_INFO_V2, Pci)==8)
 

Macro Definition Documentation

◆ IOCTL_UCXHUB_ADDRESS0_OWNERSHIP_ACQUIRE

#define IOCTL_UCXHUB_ADDRESS0_OWNERSHIP_ACQUIRE   UCXHUB_IOCTL(UCXHUB_FN_ADDRESS0_OWNERSHIP_ACQUIRE)

Definition at line 49 of file hubucx.h.

◆ IOCTL_UCXHUB_DEFAULT_ENDPOINT_UPDATE

#define IOCTL_UCXHUB_DEFAULT_ENDPOINT_UPDATE   UCXHUB_IOCTL(UCXHUB_FN_DEFAULT_ENDPOINT_UPDATE)

Definition at line 62 of file hubucx.h.

◆ IOCTL_UCXHUB_DEVICE_ABORT_IO

#define IOCTL_UCXHUB_DEVICE_ABORT_IO   UCXHUB_IOCTL(UCXHUB_FN_DEVICE_ABORT_IO)

Definition at line 68 of file hubucx.h.

◆ IOCTL_UCXHUB_DEVICE_ADDRESS

#define IOCTL_UCXHUB_DEVICE_ADDRESS   UCXHUB_IOCTL(UCXHUB_FN_DEVICE_ADDRESS)

Definition at line 55 of file hubucx.h.

◆ IOCTL_UCXHUB_DEVICE_DISABLE

#define IOCTL_UCXHUB_DEVICE_DISABLE   UCXHUB_IOCTL(UCXHUB_FN_DEVICE_DISABLE)

Definition at line 58 of file hubucx.h.

◆ IOCTL_UCXHUB_DEVICE_ENABLE

#define IOCTL_UCXHUB_DEVICE_ENABLE   UCXHUB_IOCTL(UCXHUB_FN_DEVICE_ENABLE)

Definition at line 53 of file hubucx.h.

◆ IOCTL_UCXHUB_DEVICE_HUB_INFO

#define IOCTL_UCXHUB_DEVICE_HUB_INFO   UCXHUB_IOCTL(UCXHUB_FN_DEVICE_HUB_INFO)

Definition at line 57 of file hubucx.h.

◆ IOCTL_UCXHUB_DEVICE_PURGE_IO

#define IOCTL_UCXHUB_DEVICE_PURGE_IO   UCXHUB_IOCTL(UCXHUB_FN_DEVICE_PURGE_IO)

Definition at line 59 of file hubucx.h.

◆ IOCTL_UCXHUB_DEVICE_RESET

#define IOCTL_UCXHUB_DEVICE_RESET   UCXHUB_IOCTL(UCXHUB_FN_DEVICE_RESET)

Definition at line 54 of file hubucx.h.

◆ IOCTL_UCXHUB_DEVICE_START_IO

#define IOCTL_UCXHUB_DEVICE_START_IO   UCXHUB_IOCTL(UCXHUB_FN_DEVICE_START_IO)

Definition at line 60 of file hubucx.h.

◆ IOCTL_UCXHUB_DEVICE_TREE_PURGE_IO

#define IOCTL_UCXHUB_DEVICE_TREE_PURGE_IO   UCXHUB_IOCTL(UCXHUB_FN_DEVICE_TREE_PURGE_IO)

Definition at line 67 of file hubucx.h.

◆ IOCTL_UCXHUB_DEVICE_UPDATE

#define IOCTL_UCXHUB_DEVICE_UPDATE   UCXHUB_IOCTL(UCXHUB_FN_DEVICE_UPDATE)

Definition at line 56 of file hubucx.h.

◆ IOCTL_UCXHUB_ENDPOINT_RESET

#define IOCTL_UCXHUB_ENDPOINT_RESET   UCXHUB_IOCTL(UCXHUB_FN_ENDPOINT_RESET)

Definition at line 63 of file hubucx.h.

◆ IOCTL_UCXHUB_ENDPOINTS_CONFIGURE

#define IOCTL_UCXHUB_ENDPOINTS_CONFIGURE   UCXHUB_IOCTL(UCXHUB_FN_ENDPOINTS_CONFIGURE)

Definition at line 61 of file hubucx.h.

◆ IOCTL_UCXHUB_FREE_DUMP_DATA

Definition at line 74 of file hubucx.h.

◆ IOCTL_UCXHUB_GET_DUMP_DATA

Definition at line 72 of file hubucx.h.

◆ IOCTL_UCXHUB_GET_HUB_INFO

#define IOCTL_UCXHUB_GET_HUB_INFO   UCXHUB_IOCTL(UCXHUB_FN_GET_HUB_INFO)

Definition at line 64 of file hubucx.h.

◆ IOCTL_UCXHUB_NOTIFY_FORWARD_PROGRESS

#define IOCTL_UCXHUB_NOTIFY_FORWARD_PROGRESS   UCXHUB_IOCTL(UCXHUB_FN_NOTIFY_FORWARD_PROGRESS)

Definition at line 69 of file hubucx.h.

◆ IOCTL_UCXHUB_QUERY_USB_CAPABILITY

#define IOCTL_UCXHUB_QUERY_USB_CAPABILITY   UCXHUB_IOCTL(UCXHUB_FN_QUERY_USB_CAPABILITY)

Definition at line 65 of file hubucx.h.

◆ IOCTL_UCXHUB_RESET_PORT_ASYNC

#define IOCTL_UCXHUB_RESET_PORT_ASYNC    CTL_CODE(FILE_DEVICE_UNKNOWN, 1004, METHOD_NEITHER, FILE_ANY_ACCESS)

Definition at line 78 of file hubucx.h.

◆ IOCTL_UCXHUB_ROOTHUB_GET_20PORT_INFO

#define IOCTL_UCXHUB_ROOTHUB_GET_20PORT_INFO   UCXHUB_IOCTL(UCXHUB_FN_ROOTHUB_GET_20PORT_INFO)

Definition at line 51 of file hubucx.h.

◆ IOCTL_UCXHUB_ROOTHUB_GET_30PORT_INFO

#define IOCTL_UCXHUB_ROOTHUB_GET_30PORT_INFO   UCXHUB_IOCTL(UCXHUB_FN_ROOTHUB_GET_30PORT_INFO)

Definition at line 52 of file hubucx.h.

◆ IOCTL_UCXHUB_ROOTHUB_GET_INFO

#define IOCTL_UCXHUB_ROOTHUB_GET_INFO   UCXHUB_IOCTL(UCXHUB_FN_ROOTHUB_GET_INFO)

Definition at line 50 of file hubucx.h.

◆ IOCTL_UCXHUB_SET_FUNCTION_HANDLE_DATA

#define IOCTL_UCXHUB_SET_FUNCTION_HANDLE_DATA   UCXHUB_IOCTL(UCXHUB_FN_SET_FUNCTION_HANDLE_DATA)

Definition at line 66 of file hubucx.h.

◆ UCXHUB_FN_ADDRESS0_OWNERSHIP_ACQUIRE

#define UCXHUB_FN_ADDRESS0_OWNERSHIP_ACQUIRE   0x401

Definition at line 22 of file hubucx.h.

◆ UCXHUB_FN_DEFAULT_ENDPOINT_UPDATE

#define UCXHUB_FN_DEFAULT_ENDPOINT_UPDATE   0x40E

Definition at line 35 of file hubucx.h.

◆ UCXHUB_FN_DEVICE_ABORT_IO

#define UCXHUB_FN_DEVICE_ABORT_IO   0x415

Definition at line 41 of file hubucx.h.

◆ UCXHUB_FN_DEVICE_ADDRESS

#define UCXHUB_FN_DEVICE_ADDRESS   0x407

Definition at line 28 of file hubucx.h.

◆ UCXHUB_FN_DEVICE_DISABLE

#define UCXHUB_FN_DEVICE_DISABLE   0x40A

Definition at line 31 of file hubucx.h.

◆ UCXHUB_FN_DEVICE_ENABLE

#define UCXHUB_FN_DEVICE_ENABLE   0x405

Definition at line 26 of file hubucx.h.

◆ UCXHUB_FN_DEVICE_HUB_INFO

#define UCXHUB_FN_DEVICE_HUB_INFO   0x409

Definition at line 30 of file hubucx.h.

◆ UCXHUB_FN_DEVICE_PURGE_IO

#define UCXHUB_FN_DEVICE_PURGE_IO   0x40B

Definition at line 32 of file hubucx.h.

◆ UCXHUB_FN_DEVICE_RESET

#define UCXHUB_FN_DEVICE_RESET   0x406

Definition at line 27 of file hubucx.h.

◆ UCXHUB_FN_DEVICE_START_IO

#define UCXHUB_FN_DEVICE_START_IO   0x40C

Definition at line 33 of file hubucx.h.

◆ UCXHUB_FN_DEVICE_TREE_PURGE_IO

#define UCXHUB_FN_DEVICE_TREE_PURGE_IO   0x414

Definition at line 40 of file hubucx.h.

◆ UCXHUB_FN_DEVICE_UPDATE

#define UCXHUB_FN_DEVICE_UPDATE   0x408

Definition at line 29 of file hubucx.h.

◆ UCXHUB_FN_ENDPOINT_RESET

#define UCXHUB_FN_ENDPOINT_RESET   0x40F

Definition at line 36 of file hubucx.h.

◆ UCXHUB_FN_ENDPOINTS_CONFIGURE

#define UCXHUB_FN_ENDPOINTS_CONFIGURE   0x40D

Definition at line 34 of file hubucx.h.

◆ UCXHUB_FN_FREE_DUMP_DATA

#define UCXHUB_FN_FREE_DUMP_DATA   0x502

Definition at line 43 of file hubucx.h.

◆ UCXHUB_FN_GET_DUMP_DATA

#define UCXHUB_FN_GET_DUMP_DATA   0x501

Definition at line 42 of file hubucx.h.

◆ UCXHUB_FN_GET_HUB_INFO

#define UCXHUB_FN_GET_HUB_INFO   0x410

Definition at line 37 of file hubucx.h.

◆ UCXHUB_FN_NOTIFY_FORWARD_PROGRESS

#define UCXHUB_FN_NOTIFY_FORWARD_PROGRESS   0x503

Definition at line 44 of file hubucx.h.

◆ UCXHUB_FN_QUERY_USB_CAPABILITY

#define UCXHUB_FN_QUERY_USB_CAPABILITY   0x412

Definition at line 38 of file hubucx.h.

◆ UCXHUB_FN_ROOTHUB_GET_20PORT_INFO

#define UCXHUB_FN_ROOTHUB_GET_20PORT_INFO   0x403

Definition at line 24 of file hubucx.h.

◆ UCXHUB_FN_ROOTHUB_GET_30PORT_INFO

#define UCXHUB_FN_ROOTHUB_GET_30PORT_INFO   0x404

Definition at line 25 of file hubucx.h.

◆ UCXHUB_FN_ROOTHUB_GET_INFO

#define UCXHUB_FN_ROOTHUB_GET_INFO   0x402

Definition at line 23 of file hubucx.h.

◆ UCXHUB_FN_SET_FUNCTION_HANDLE_DATA

#define UCXHUB_FN_SET_FUNCTION_HANDLE_DATA   0x413

Definition at line 39 of file hubucx.h.

◆ UCXHUB_IOCTL

Definition at line 46 of file hubucx.h.

◆ UCXHUB_PARENT_INTERFACE_VERSION

#define UCXHUB_PARENT_INTERFACE_VERSION   1013

Definition at line 493 of file hubucx.h.

◆ UCXHUB_QUERY_CAPABILITY_VERSION

#define UCXHUB_QUERY_CAPABILITY_VERSION   1

Definition at line 156 of file hubucx.h.

◆ UCXHUB_STACK_INTERFACE_SIZE_ORIGINAL

#define UCXHUB_STACK_INTERFACE_SIZE_ORIGINAL    FIELD_OFFSET(UCXHUB_STACK_INTERFACE, DeviceGetTimestamp)

Definition at line 469 of file hubucx.h.

◆ UCXHUB_STACK_INTERFACE_VERSION_1

#define UCXHUB_STACK_INTERFACE_VERSION_1   1000

Definition at line 417 of file hubucx.h.

◆ UCXHUB_STACK_INTERFACE_VERSION_2

#define UCXHUB_STACK_INTERFACE_VERSION_2   2000

Definition at line 418 of file hubucx.h.

◆ UCXHUB_STACK_INTERFACE_VERSION_3

#define UCXHUB_STACK_INTERFACE_VERSION_3   3000

Definition at line 419 of file hubucx.h.

◆ UCXHUB_TUNNEL_STATE_NATIVE

#define UCXHUB_TUNNEL_STATE_NATIVE   3

Definition at line 540 of file hubucx.h.

◆ UCXHUB_TUNNEL_STATE_NO_INFORMATION

#define UCXHUB_TUNNEL_STATE_NO_INFORMATION   1

Definition at line 538 of file hubucx.h.

◆ UCXHUB_TUNNEL_STATE_NOT_ANSWERED

#define UCXHUB_TUNNEL_STATE_NOT_ANSWERED   0

Definition at line 537 of file hubucx.h.

◆ UCXHUB_TUNNEL_STATE_TUNNELED

#define UCXHUB_TUNNEL_STATE_TUNNELED   2

Definition at line 539 of file hubucx.h.

◆ UCXHUB_TUNNEL_STATE_UNKNOWN

#define UCXHUB_TUNNEL_STATE_UNKNOWN   4

Definition at line 541 of file hubucx.h.

◆ UCXHUB_URB_FLAG_ALLOW_LARGE_TRANSFER

#define UCXHUB_URB_FLAG_ALLOW_LARGE_TRANSFER   0x40000000

Definition at line 101 of file hubucx.h.

◆ UCXHUB_URB_FLAG_PEND_INTERRUPT_TX

#define UCXHUB_URB_FLAG_PEND_INTERRUPT_TX   0x80000000

Definition at line 100 of file hubucx.h.

◆ UCXHUB_URB_FLAGS_HUB_MASK

#define UCXHUB_URB_FLAGS_HUB_MASK   0xFF000000

Definition at line 99 of file hubucx.h.

◆ UCXHUB_URB_FLAGS_UCX_MASK

#define UCXHUB_URB_FLAGS_UCX_MASK   0x00FFFFFF

Definition at line 98 of file hubucx.h.

◆ UCXHUB_WORKITEM_FLAG_NEEDS_FLUSH

#define UCXHUB_WORKITEM_FLAG_NEEDS_FLUSH   1

Definition at line 212 of file hubucx.h.

◆ UCXHUB_WORKITEM_NO_FLAGS

#define UCXHUB_WORKITEM_NO_FLAGS   0

Definition at line 211 of file hubucx.h.

Typedef Documentation

◆ _In_reads_bytes_

Definition at line 306 of file hubucx.h.

◆ _IRQL_requires_

_Must_inspect_result_ _IRQL_requires_
Initial value:
== 1)
{
DPRINT("Boot device on port %u reported missing again, answering ready\n", Port->Number());
}
if (Ready)
{
HubBootAfterRecovery(Child);
}
return Ready
BOOLEAN Ready
Definition: bootdev.cpp:135
#define TRUE
Definition: types.h:120
CPPORT Port[4]
Definition: headless.c:38
@ SsInactiveSeenForBoot
#define DPRINT
Definition: sndvol32.h:73
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFDEVICE Child
Definition: wdffdo.h:536

Turns off link power management below a hub on a tunneled or unknown USB4 port, or below a root hub outside the system container.

Publishes "<port>#<host>" for every bound port on the hub's PDO. QUIRK: with no bound port an older value is left in place.

Binds USB 3 ports to the host routers named by the USB4 DVSEC; an earlier ACPI mapping wins.

Marks Port as tunneled through the host router Name; ports naming the same host share one record.

Usb4HostName overrides the _DSD USB4 host router name of every USB 3 ACPI port. A string from an earlier start is kept since ports still use it.

Grows a private buffer to what the helper asks for.

Lets KMDF handle the IRP, then hands it back here still uncompleted.

MS OS 2.0 descriptor set. SetInfo is the entry the BOS walk selected; on failure Info->Flags is cleared.

Reread whenever user experience settings change; the open status is returned.

Reads one value of a walk. A missing value only clears Present; FALSE means stop.

Writes a REG_BINARY value into the device's usbflags subkey.

Sets or clears ExtPropertiesInstalled from ExtPropDescSemaphore in the hardware key.

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.

Copies up to Size bytes of a device property; a failed query leaves the field zero.

Only the controller name length is real; both bandwidth fields read 0.

The answer overlays a USB_HUB_NAME on TotalSize, so TotalSize comes back as the name length + 4.

Evaluates a method without arguments into Output.

Drops every MSI descriptor and keeps only lists that still offer a line interrupt.

Picks the list with the best MSI offer: MSI-X first, then the most messages.

Keeps message descriptors covering Wanted messages and removes the others.

Lets UCX hook the controller device init. Call before WdfDeviceCreate.

Drops the binding taken by UcxStubBindClass. Safe to call when not bound.

Definition at line 253 of file hubucx.h.

◆ Companion

◆ Context

Definition at line 226 of file hubucx.h.

◆ ControllerInfo

Definition at line 398 of file hubucx.h.

◆ CreateInfo

◆ DescriptorBufferLength

Definition at line 307 of file hubucx.h.

◆ Device

Definition at line 258 of file hubucx.h.

◆ DeviceContext

typedef _In_ UCXHUB_DEVICE_CONTEXT DeviceContext

Definition at line 237 of file hubucx.h.

◆ Endpoint

Initial value:
{
PFN_UCXENDPOINTCREATE Create
@ Create
Definition: registry.c:563

Definition at line 238 of file hubucx.h.

◆ EndpointNumber

typedef _In_ UCXHUB_DEVICE_CONTEXT _In_ UCXENDPOINT _In_ ULONG EndpointNumber

Definition at line 239 of file hubucx.h.

◆ MaxPacketSize

Definition at line 289 of file hubucx.h.

◆ Pdo

◆ PFN_UCXHUB_DEVICE_GET_TIMESTAMP

typedef ULONG64(NTAPI * PFN_UCXHUB_DEVICE_GET_TIMESTAMP) (_In_ UCXUSBDEVICE Device)

System time the controller extension last handled an event for the device, or 0.

Definition at line 402 of file hubucx.h.

◆ PFN_UCXHUB_ENDPOINT_MAX_TRANSFER

typedef ULONG(NTAPI * PFN_UCXHUB_ENDPOINT_MAX_TRANSFER) (_In_ UCXENDPOINT Endpoint)

Definition at line 331 of file hubucx.h.

◆ PFN_UCXHUB_ENDPOINT_PIPE_HANDLE

typedef USBD_PIPE_HANDLE(NTAPI * PFN_UCXHUB_ENDPOINT_PIPE_HANDLE) (_In_ UCXENDPOINT Endpoint)

Definition at line 326 of file hubucx.h.

◆ PFN_UCXHUB_IS_DEVICE_DISCONNECTED

typedef BOOLEAN(NTAPI * PFN_UCXHUB_IS_DEVICE_DISCONNECTED) (_In_ UCXUSBDEVICE Device)

Definition at line 369 of file hubucx.h.

◆ PFN_UCXHUB_WORKITEM_ALLOCATE

typedef PUCXHUB_WORKITEM(NTAPI * PFN_UCXHUB_WORKITEM_ALLOCATE) (_In_ UCXUSBDEVICE Hub, _In_ PDEVICE_OBJECT DeviceObject, _In_ ULONG Flags)

Definition at line 336 of file hubucx.h.

◆ PFN_UCXHUB_WORKITEM_DELETE

typedef VOID(NTAPI * PFN_UCXHUB_WORKITEM_DELETE) (_In_ PUCXHUB_WORKITEM WorkItem)

Definition at line 343 of file hubucx.h.

◆ PFN_UCXHUB_WORKITEM_ENQUEUE

Definition at line 348 of file hubucx.h.

◆ PortNumber

Initial value:
{
HubFdo * Hub
Definition: bootdev.cpp:261
_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
@ EnumerationFailure
Definition: usbioctl.h:508

Definition at line 272 of file hubucx.h.

◆ Priority

Initial value:
{
PVOID NTAPI ExAllocatePoolWithTagPriority(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes, IN ULONG Tag, IN EX_POOL_PRIORITY Priority)
Definition: expool.c:2963
_In_ UCXUSBDEVICE _In_ UCXENDPOINT _In_ ULONG Priority
Definition: hubucx.h:414
_Must_inspect_result_ _In_ UCXENDPOINT _In_ PVOID Tag
Definition: ucxendpoint.h:325
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3821
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
Definition: iotypes.h:1036

Definition at line 414 of file hubucx.h.

◆ PUCXHUB_CONTROLLER_INFO

◆ PUCXHUB_CONTROLLER_INFO_V2

◆ PUCXHUB_DEVICE_CREATE_INFO

◆ PUCXHUB_DUMP_DEVICE_INFO

◆ PUCXHUB_FORWARD_PROGRESS_INFO

◆ PUCXHUB_FORWARD_PROGRESS_PIPE

◆ PUCXHUB_FUNCTION_DATA

◆ PUCXHUB_PARENT_INTERFACE

◆ PUCXHUB_PARENT_INTERFACE_ORIGINAL

◆ PUCXHUB_QUERY_CAPABILITY

◆ PUCXHUB_RESET_FLAGS

◆ PUCXHUB_ROOTHUB_INFO

◆ PUCXHUB_STACK_INTERFACE

◆ PUCXHUB_STOP_IDLE_CONTEXT

◆ PUCXHUB_UPDATE_TUNNEL_ANSWER

◆ PUCXHUB_WORKITEM

Definition at line 209 of file hubucx.h.

◆ PUCXHUB_WORKITEM_ROUTINE

typedef UCXHUB_WORKITEM_ROUTINE* PUCXHUB_WORKITEM_ROUTINE

Definition at line 228 of file hubucx.h.

◆ StopIdleContext

Definition at line 384 of file hubucx.h.

◆ SymbolicLinkName

Initial value:
{
Globals WdfDriverGlobals
Definition: classlib.cpp:114
_Must_inspect_result_ _In_ PUCXHUB_DEVICE_CREATE_INFO _Out_ UCXUSBDEVICE * Device
Definition: hubucx.h:258
_In_ PUNICODE_STRING SymbolicLinkName
Definition: hubucx.h:491
#define WdfFunctions
Definition: wdf.h:66
@ WdfDeviceCreateSymbolicLinkTableIndex
Definition: wdffuncenum.h:105

Definition at line 491 of file hubucx.h.

◆ TtPortNumber

◆ UCXHUB_CONTROLLER_INFO

QueryControllerBus output: the parent bus identity of the controller.

◆ UCXHUB_CONTROLLER_INFO_V2

◆ UCXHUB_DEVICE_CREATE_INFO

Describes a newly attached device to the stack interface's device create.

◆ UCXHUB_DUMP_DEVICE_INFO

◆ UCXHUB_FORWARD_PROGRESS_INFO

◆ UCXHUB_FORWARD_PROGRESS_PIPE

◆ UCXHUB_FUNCTION_DATA

◆ UCXHUB_PARENT_INTERFACE

◆ UCXHUB_PARENT_INTERFACE_ORIGINAL

◆ UCXHUB_QUERY_CAPABILITY

◆ UCXHUB_RESET_FLAGS

◆ UCXHUB_ROOTHUB_INFO

ROOTHUB_GET_INFO payload; the controller driver sees only the ROOTHUB_INFO part.

◆ UCXHUB_STACK_INTERFACE

◆ UCXHUB_STOP_IDLE_CONTEXT

◆ UCXHUB_UPDATE_TUNNEL_ANSWER

◆ UCXHUB_WORKITEM_ENQUEUE_OPTIONS

◆ WorkItem

_In_ WDFWORKITEM WorkItem
Initial value:
{
_In_ ULONG Attributes
Definition: dispmprt.h:1077
_In_opt_ PVOID _In_ PUCXHUB_WORKITEM WorkItem
Definition: hubucx.h:227
_Must_inspect_result_ _In_ WDFDEVICE _In_ PUCX_CONTROLLER_CONFIG Config
@ WdfWorkItemCreateTableIndex
Definition: wdffuncenum.h:404

Definition at line 227 of file hubucx.h.

Enumeration Type Documentation

◆ _UCXHUB_WORKITEM_ENQUEUE_OPTIONS

Enumerator
UcxHubWorkItemDefault 
UcxHubWorkItemForwardProgressNotRequired 

Definition at line 214 of file hubucx.h.

215{
216 UcxHubWorkItemDefault = 0xCAD00000,
enum _UCXHUB_WORKITEM_ENQUEUE_OPTIONS UCXHUB_WORKITEM_ENQUEUE_OPTIONS
@ UcxHubWorkItemForwardProgressNotRequired
Definition: hubucx.h:217
@ UcxHubWorkItemDefault
Definition: hubucx.h:216

Function Documentation

◆ _Function_class_()

typedef _Function_class_ ( UCXHUB_WORKITEM_ROUTINE  )

◆ _IRQL_requires_max_()

typedef _IRQL_requires_max_ ( DISPATCH_LEVEL  )

Priority 1 to 3, forwarded to the HCD's EvtEndpointSetCharacteristic.

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
LONG NTSTATUS
Definition: precomp.h:26
#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 FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
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: ps.c:97
uint32_t ULONG
Definition: typedefs.h:59
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
#define NT_ASSERT
Definition: rtlfuncs.h:3334

◆ C_ASSERT() [1/11]

C_ASSERT ( FIELD_OFFSET(UCXHUB_CONTROLLER_INFO_V2, Pci)  = =8)

◆ C_ASSERT() [2/11]

C_ASSERT ( FIELD_OFFSET(UCXHUB_UPDATE_TUNNEL_ANSWER, TunnelState)  = =1)

◆ C_ASSERT() [3/11]

C_ASSERT ( FIELD_OFFSET(USBDEVICE_UPDATE, Reserved)  = =0x2E)

◆ C_ASSERT() [4/11]

C_ASSERT ( sizeof(UCXHUB_CONTROLLER_INFO)  = =28)

◆ C_ASSERT() [5/11]

C_ASSERT ( sizeof(UCXHUB_CONTROLLER_INFO_V2)  = =32)

◆ C_ASSERT() [6/11]

C_ASSERT ( sizeof(UCXHUB_DEVICE_CREATE_INFO)  = =16)

◆ C_ASSERT() [7/11]

C_ASSERT ( sizeof(UCXHUB_PARENT_INTERFACE_ORIGINAL)  = =0x58)

◆ C_ASSERT() [8/11]

C_ASSERT ( sizeof(UCXHUB_QUERY_CAPABILITY)  = =32)

◆ C_ASSERT() [9/11]

C_ASSERT ( sizeof(UCXHUB_ROOTHUB_INFO)  = =20)

◆ C_ASSERT() [10/11]

C_ASSERT ( sizeof(USBDEVICE_UPDATE)  = =0x30)

◆ C_ASSERT() [11/11]

C_ASSERT ( UCXHUB_STACK_INTERFACE_SIZE_ORIGINAL  = =0x78)

◆ DECLARE_HANDLE() [1/2]

DECLARE_HANDLE ( UCXHUB_DEVICE_CONTEXT  )

◆ DECLARE_HANDLE() [2/2]

DECLARE_HANDLE ( UCXHUB_HUB_CONTEXT  )

◆ DEFINE_GUID() [1/2]

DEFINE_GUID ( GUID_UCXHUB_PARENT_INTERFACE  ,
0xa9264c93  ,
0xeccd  ,
0x4b40  ,
0x92  ,
0x9b  ,
0xb3  ,
0x54  ,
0xf1  ,
0xe9  ,
0xa2  ,
0xdc   
)

◆ DEFINE_GUID() [2/2]

DEFINE_GUID ( GUID_UCXHUB_STACK_INTERFACE  ,
0x4fb2b0e1  ,
0x5fdd  ,
0x4dab  ,
0xa6  ,
0x00  ,
0x5e  ,
0x15  ,
0x16  ,
0xbb  ,
0xd8  ,
0xa7   
)

◆ UcxHubUpdateTunnelAnswer()