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

Go to the source code of this file.

Classes

struct  UcxPipe
 
struct  UcxEndpointCallbacks
 
struct  _UCXENDPOINT_INIT
 
struct  _UCXSSTREAMS_INIT
 
class  UcxEndpoint
 
struct  UcxStream
 
class  UcxStaticStreams
 

Typedefs

typedef _In_ ULONG MaxTransferSize
 
typedef struct _UCXENDPOINT_INIT UcxEndpointInit
 
typedef struct _UCXSSTREAMS_INIT UcxStaticStreamsInit
 

Enumerations

enum class  UcxEndpointKind : ULONG { Generic = 0 , ZeroBandwidth = 1 , Default = 2 }
 
enum class  UcxTransferType : ULONG {
  Unknown = 0 , Control = 1 , Bulk = 2 , Isochronous = 3 ,
  Interrupt = 4
}
 

Functions

typedef _IRQL_requires_ (PASSIVE_LEVEL) NTSTATUS(NTAPI *PFN_UCX_HCD_ENDPOINT_ENABLE_FORWARD_PROGRESS)(_In_ UCXENDPOINT Endpoint
 Sends a synchronous IOCTL to the specified device object.
 
 WDF_DECLARE_CONTEXT_TYPE_WITH_NAME (UcxEndpoint, UcxGetEndpointContext)
 
 WDF_DECLARE_CONTEXT_TYPE_WITH_NAME (UcxStaticStreams, UcxGetStaticStreamsContext)
 
ULONG NTAPI UcxComputeMaxTransferSize (_In_ USB_DEVICE_SPEED Speed, _In_ USHORT BcdUsb, _In_ const UcxEndpointInit *Init)
 

Typedef Documentation

◆ MaxTransferSize

Definition at line 72 of file pipe.h.

◆ UcxEndpointInit

◆ UcxStaticStreamsInit

Definition at line 119 of file pipe.h.

Enumeration Type Documentation

◆ UcxEndpointKind

Enumerator
Generic 
ZeroBandwidth 
Default 

Definition at line 12 of file pipe.h.

13{
14 Generic = 0,
15 ZeroBandwidth = 1,
16 Default = 2
17};

◆ UcxTransferType

Enumerator
Unknown 
Control 
Bulk 
Isochronous 
Interrupt 

Definition at line 19 of file pipe.h.

20{
21 Unknown = 0,
22 Control = 1,
23 Bulk = 2,
24 Isochronous = 3,
25 Interrupt = 4
26};
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFINTERRUPT * Interrupt
Definition: wdfinterrupt.h:379
_In_ WDF_WMI_PROVIDER_CONTROL Control
Definition: wdfwmi.h:166

Function Documentation

◆ _IRQL_requires_()

typedef _IRQL_requires_ ( PASSIVE_LEVEL  )

Sends a synchronous IOCTL to the specified device object.

Parameters
[in]IoControlCodeThe IOCTL to send to the device.
[in]DeviceObjectPointer to the device object that will handle the IOCTL.
[in]InputBufferOptional pointer to a buffer containing input data for the IOCTL. When specified, the buffer should be at least of InputBufferLength size.
[in]InputBufferLengthSize in bytes, of the buffer pointed by InputBuffer.
[out]OutputBufferOptional pointer to a buffer that will receive output data from the IOCTL. When specified, the buffer should be at least of OutputBufferLength size.
[in]OutputBufferLengthSize in bytes, of the buffer pointed by OutputBuffer.
[in]FileObjectOptional pointer to a file object that may be necessary for the IOCTL.
Returns
An NTSTATUS code indicating success or failure of this function.
Note
Must be called at PASSIVE_LEVEL with all APCs enabled.

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()
LONG NTSTATUS
Definition: precomp.h:26
#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
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
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

◆ UcxComputeMaxTransferSize()

ULONG NTAPI UcxComputeMaxTransferSize ( _In_ USB_DEVICE_SPEED  Speed,
_In_ USHORT  BcdUsb,
_In_ const UcxEndpointInit *  Init 
)

Definition at line 49 of file pipe.cpp.

53{
54 ULONG Row = UcxSpeedRow(Speed);
55 USHORT MaxPacket;
56 ULONG PacketBytes;
57
58 if (Init->TransferType != UcxTransferType::Isochronous)
59 {
60 if (Init->TransferType == UcxTransferType::Control &&
61 UcxIsSlowSpeed(Speed) &&
62 UcxDriver.Allow64KLowOrFullSpeedControl)
63 {
64 return UCX_KB(64);
65 }
66
67 return UcxMaxTransferTable[Row][(ULONG)Init->TransferType];
68 }
69
70 if (Row == (ULONG)UsbSuperSpeed)
71 {
72 if (Init->Companion.bmAttributes.Isochronous.SspCompanion)
73 return 1024 * Init->IsochCompanion.dwBytesPerInterval;
74
75 return 1024 * Init->Companion.wBytesPerInterval;
76 }
77
78 /* Before USB 2.5 the top bits carry the additional transactions per microframe */
79 MaxPacket = Init->Descriptor.wMaxPacketSize;
80 if (BcdUsb < 0x0250)
81 PacketBytes = (MaxPacket & 0x7FF) * (((MaxPacket >> 11) & 0x3) + 1);
82 else
83 PacketBytes = MaxPacket;
84
85 return ((Row == (ULONG)UsbHighSpeed) ? 1024 : 256) * PacketBytes;
86}
InitializeListHead & UcxDriver
Definition: driver.cpp:138
#define UCX_KB(x)
Definition: pipe.cpp:15
static const ULONG UcxMaxTransferTable[4][5]
Definition: pipe.cpp:19
static ULONG NTAPI UcxSpeedRow(_In_ USB_DEVICE_SPEED Speed)
Definition: pipe.cpp:32
static BOOLEAN NTAPI UcxIsSlowSpeed(_In_ USB_DEVICE_SPEED Speed)
Definition: pipe.cpp:41
unsigned short USHORT
Definition: pedump.c:61
@ UsbSuperSpeed
Definition: usb200.h:45
@ UsbHighSpeed
Definition: usb200.h:44

Referenced by UcxEndpoint::Initialize().

◆ WDF_DECLARE_CONTEXT_TYPE_WITH_NAME() [1/2]

WDF_DECLARE_CONTEXT_TYPE_WITH_NAME ( UcxEndpoint  ,
UcxGetEndpointContext   
)

◆ WDF_DECLARE_CONTEXT_TYPE_WITH_NAME() [2/2]

WDF_DECLARE_CONTEXT_TYPE_WITH_NAME ( UcxStaticStreams  ,
UcxGetStaticStreamsContext   
)