USBA_HCDI_PIPE_RESET(9E) Driver Entry Points USBA_HCDI_PIPE_RESET(9E)

usba_hcdi_pipe_reset
reset an open USB pipe

#include <sys/usb/usba/hcdi.h>

int
prefix_hcdi_pipe_reset(usba_pipe_handle_data_t *ph, usb_flags_t usb_flags);

Volatile - illumos USB HCD private function

This is a private function that is not part of the stable DDI. It may be removed or changed at any time.

ph
A pointer to a USB pipe handle as defined in usba_pipe_handle_data(9S).
usb_flags
Flags which describe how allocations should be performed. Valid flags are:
USB_FLAGS_NOSLEEP
Do not block waiting for memory. If memory is not available the allocation will fail.
USB_FLAGS_SLEEP
Perform a blocking allocation. If memory is not available, the function will wait until memory is made available.

Note, the request may still fail even if USB_FLAGS_SLEEP is specified.

The usba_hcdi_pipe_reset() entry point is designed to take a pipe in an arbitrary state and return it to the same state it was in after a call to usba_hcdi_pipe_open(9E). While this entry point does some similar things to the usba_hcdi_pipe_stop_intr_polling(9E) and usba_hcdi_pipe_stop_isoc_polling(9E) entry points, there are some notable differences.

This entry point is synchronous. The host controller driver should take the following steps on the pipe before returning:

  1. Quiesce and stop the endpoint.
  2. If the endpoint has any errors they should be cleared at this time.
  3. Remove any remaining, scheduled or queued transfers. For each one call usba_hcdi_cb(9F) with the code USB_CR_PIPE_RESET.
  4. Perform any other necessary steps on the controller to have the endpoint be ready to perform I/O.

This entry point is called by the broader USBA framework as part of closing a pipe or in response to a device stall.

Upon successful completion, the usba_hcdi_pipe_reset() function should return USB_SUCCESS. Otherwise, it should return the appropriate USB error. If uncertain, use USB_FAILURE.

usba_hcdi_pipe_open(9E), usba_hcdi_pipe_stop_intr_polling(9E), usba_hcdi_pipe_stop_isoc_polling(9E), usba_hcdi_cb(9F), usba_pipe_handle_data(9S)
August 20, 2019 illumos