EVT_UCX_ENDPOINT_STATIC_STREAMS_ADD callback function (ucxendpoint.h)
The client driver's implementation that UCX calls to create static streams.
Syntax
EVT_UCX_ENDPOINT_STATIC_STREAMS_ADD EvtUcxEndpointStaticStreamsAdd;
NTSTATUS EvtUcxEndpointStaticStreamsAdd(
[in] UCXENDPOINT UcxEndpoint,
[in] ULONG NumberOfStreams,
[in] PUCXSSTREAMS_INIT UcxStaticStreamsInit
)
{...}
Parameters
[in] UcxEndpoint
A handle to a UCXENDPOINT object that represents the endpoint.
[in] NumberOfStreams
The number of non-default streams to create.
[in] UcxStaticStreamsInit
A pointer to an opaque structure containing initialization information. This structure is managed by UCX.
Return value
If the operation is successful, the callback function must return STATUS_SUCCESS, or another status value for which NT_SUCCESS(status) equals TRUE. Otherwise it must return a status value for which NT_SUCCESS(status) equals FALSE.
Remarks
The UCX client driver registers this callback function with the USB host controller extension (UCX) by calling the UcxEndpointCreate method.
This callback function creates a UCX static streams object by calling the UcxStaticStreamsCreate method. Only one UCX static streams object can be associated with a single endpoint. The driver then calls UcxStaticStreamsSetStreamInfo once per stream to create a queue for each stream.
A static streams object is not enabled until UCX calls the client driver's EVT_UCX_ENDPOINT_STATIC_STREAMS_ENABLE callback function.
Examples
NTSTATUS
Endpoint_EvtEndpointStaticStreamsAdd(
UCXENDPOINT UcxEndpoint,
ULONG NumberOfStreams,
PUCXSSTREAMS_INIT UcxStaticStreamsInit
)
{
NTSTATUS status;
WDF_OBJECT_ATTRIBUTES wdfAttributes;
UCXSSTREAMS ucxStaticStreams;
STREAM_INFO streamInfo;
ULONG streamId;
TRY {
WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&wdfAttributes, STATIC_STREAMS_CONTEXT);
status = UcxStaticStreamsCreate(UcxEndpoint,
&UcxStaticStreamsInit,
&wdfAttributes,
&ucxStaticStreams);
// … error handling …
for (i = 0, streamId = 1; i < NumberOfStreams; i += 1, streamId += 1) {
// … create WDF queue …
STREAM_INFO_INIT(&streamInfo,
wdfQueue,
streamId);
UcxStaticStreamsSetStreamInfo(ucxStaticStreams, &streamInfo);
}
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Minimum KMDF version | 1.0 |
Minimum UMDF version | 2.0 |
Header | ucxendpoint.h (include Ucxclass.h, Ucxendpoint.h) |
IRQL | PASSIVE_LEVEL |