usb_pipe_bulk_alloc_streams - Allocate and set up streams on a USB bulk pipe
#include <sys/usb/usba.h>
int usb_pipe_bulk_alloc_streams(usb_pipe_handle_t * pipe_handle, uint16_t stream_cnt, usb_flag_t usb_flags);
Solaris DDI specific (Solaris DDI)
Pointer to a usb bulk pipe handle on which streams are set up.
The streams count to allocate.
USB_FLAGS_SLEEP is the only flag that is recognized. Wait for memory resources if not immediately available.
A standard USB Bulk Pipe represents the ability to move single stream of (FIFO) data between the host and a device via a host memory buffer and a device endpoint. SuperSpeed Streams provide protocol-level support for a multi-stream model and utilize stream pipe communications mode.
The usb_pipe_bulk_alloc_streams() function creates and initializes SuperSpeed Streams on a given USB bulk pipe.
The USB 3.0 defines that a bulk pipe can support up to 65535 streams. However, host and device may be not able to support all the range. The usb_pipe_get_max_bulk_streams(9F) returns the maximum streams count.
All explicit streams allocation is exclusive on a bulk pipe. Attempts to allocate streams on a stream pipe will fail.
Streams resource was allocated and streams were set up.
Called from interrupt handler with USB_FLAGS_SLEEP set.
Pipe_handle is NULL. The stream_cnt is zero or exceeds the maximum streams count.
The host does not support SuperSpeed Streams.
Host was not in operational state. Host failed to allocate resources. Streams are already set up.
The allocation routines can always be called from kernel and user context regardless of arguments. They may be called from interrupt context only if USB_FLAGS_SLEEP is not specified.
usb_pipe_handle_t *pipe; uint16_t stream_cnt; /* Open the pipe */ if (usb_pipe_open(dip, epdescr, &policy, USB_FLAGS_SLEEP, pipe) != USB_SUCCESS) { } /* Decide how many streams can be allocated. */ if(usb_pipe_get_max_bulk_streams(pipe, &stream_cnt) != USB_SUCCESS) { }; /* Allocate streams resource. */ if (usb_pipe_bulk_alloc_streams(*pipe, stream_cnt, USB_FLAGS_SLEEP) != USB_SUCCESS) { }
See attributes(7) for descriptions of the following attributes:
|
attributes(7), usb_pipe_get_max_bulk_streams(9F), usb_pipe_bulk_free_streams(9F), usb_pipe_bulk_reset_stream(9F), usb_pipe_bulk_xfer(9F), usb_pipe_close(9F), usb_pipe_open(9F), usb_pipe_reset(9F), usb_bulk_request(9S), usb_callback_flags(9S), usb_request_attributes(9S)