USBA_HCDI_OPS(9S) Data Structures for Drivers USBA_HCDI_OPS(9S)
NAME
usba_hcdi_ops,
usba_hcdi_ops_t - USBA host controller driver operations
vector
SYNOPSIS
#include <sys/usb/usba/hcdi.h>INTERFACE LEVEL
Volatile - illumos USB HCD private
This is a private data structure that is not part of the stable DDI. It
may be removed or changed at any time.
DESCRIPTION
The
usba_hcdi_ops structure is usbed HCD drivers to register operations
vectors and callbacks from the USBA HCD interface. See
usba_hcdi(9E) for
more information on USB HCD device drivers.
The structure is allocated through a call to the
usba_alloc_hcdi_ops(9F) function and is used with a call to
usba_hcdi_register(9F). When the
driver is done with the operations vector, either because registering has
failed or it is unregistering, it should call
usba_free_hcdi_ops(9F) to
free the associated memory.
STRUCTURE MEMBERS
The
usba_hcdi_ops structure has the following members:
int usba_hcdi_ops_version;
dev_info_t *usba_hcdi_dip;
int (*usba_hcdi_pm_support)(dev_info_t *);
int (*usba_hcdi_pipe_open)(usba_pipe_handle_data_t *, usb_flags_t);
int (*usba_hcdi_pipe_close)(usba_pipe_handle_data_t *, usb_flags_t);
int (*usba_hcdi_pipe_reset)(usba_pipe_handle_data_t *, usb_flags_t);
void (*usba_hcdi_pipe_reset_data_toggle)(usba_pipe_handle_data_t *);
int (*usba_hcdi_pipe_ctrl_xfer)(usba_pipe_handle_data_t *,
usb_ctrl_req_t *, usb_flags_t);
int (*usba_hcdi_bulk_transfer_size)(usba_device_t *, size_t *);
int (*usba_hcdi_pipe_bulk_xfer)(usba_pipe_handle_data_t *,
usb_bulk_req_t *, usb_flags_t);
int (*usba_hcdi_pipe_intr_xfer)(usba_pipe_handle_data_t *,
usb_intr_req_t *, usb_flags_t);
int (*usba_hcdi_pipe_stop_intr_polling)(usba_pipe_handle_data_t *,
usb_flags_t);
int (*usba_hcdi_pipe_isoc_xfer)(usba_pipe_handle_data_t *,
usb_isoc_req_t *, usb_flags_t);
int (*usba_hcdi_pipe_stop_isoc_polling)(usba_pipe_handle_data_t *,
usb_flags_t);
int (*usba_hcdi_get_current_frame_number)(usba_device_t *,
usb_frame_number_t *);
int (*usba_hcdi_get_max_isoc_pkts)(usba_device_t *, uint_t *);
int (*usba_hcdi_console_input_init)(usba_pipe_handle_data_t *,
uchar_t **, usb_console_info_impl_t *);
int (*usba_hcdi_console_input_fini)(usb_console_info_impl_t *);
int (*usba_hcdi_console_input_enter)(usb_console_info_impl_t *);
int (*usba_hcdi_console_read)(usb_console_info_impl_t *, uint_t);
int (*usba_hcdi_console_input_exit)(usb_console_info_impl_t *);
int (*usba_hcdi_console_output_init)(usba_pipe_handle_data_t *,
usb_console_info_impl_t *);
int (*usba_hcdi_console_output_fini)(usb_console_info_impl_t *);
int (*usba_hcdi_console_output_enter)(usb_console_info_impl_t *);
int (*usba_hcdi_console_write)(usb_console_info_impl_t *, uchar_t *,
uint_t, uint_t *);
int (*usba_hcdi_console_output_exit)(usb_console_info_impl_t *);
int (*usba_hcdi_device_init)(usba_device_t *, usb_port_t, void **);
void (*usba_hcdi_device_fini)(usba_device_t *, void *);
int (*usba_hcdi_device_address)(usba_device_t *);
int (*usba_hcdi_hub_update)(usba_device_t *, uint8_t, uint8_t);
The
usba_hcdi_ops_version member is used to indicate the revision of the
operations vector. HCD drivers should generally set this to
HCDI_OPS_VERSION.
The
usba_hcdi_dip member should be set to the
dev_info_t structure of the
HCD driver that was received in
attach(9E).
The
usba_hcdi_pm_support member is vestigial. If may be set to NULL or to
a function which only returns
USB_FAILURE.
The
usba_hcdi_pipe_open member should be set to a function which takes care
of the all of the controller-specific actions of opening up an endpoint on
a device and associating it with the pipe. See
usba_hcdi_pipe_open(9E) for
more information.
The
usba_hcdi_pipe_close member should be set to a function which takes
care of releasing all of the controller-specific resources and actions
taken when the pipe was opened. This function also has the responsibility
to clean up any outstanding polling on the endpoint. See
usba_hcdi_pipe_close(9E) for more information.
The
usba_hcdi_pipe_reset member should be set to a function that takes care
of resetting a pipe. A pipe reset not only performs controller-specific
functionality, but it also cleans up any outstanding requests and
terminates polling. See
usba_hcdi_pipe_reset(9E) for more information.
The
usba_hcdi_pipe_reset_data_toggle member should be set to a function
that takes care of the USB data toggle, if the controller exposes this
functionality to the host.
The
usba_hcdi_pipe_ctrl_xfer member should be set to a function that
handles control transfers for any device, including the root hub. See
usba_hcdi_pipe_ctrl_xfer(9E) for more information.
The
usba_hcdi_bulk_transfer_size member should be a set to a function which
can return the maximum amount of data that can be performed in a given USB
transfer for a bulk transfer.
The
usba_hcdi_pipe_bulk_xfer member should be set set to a function which
performs a bulk transfer. See
usba_hcdi_pipe_bulk_xfer(9E) for more
information.
The
usba_hcdi_pipe_intr_xfer member should be set to a function which
performs interrupt transfers. These may be both periodic and one-shot
transfers. In addition, this may need to handle requests for the root hub.
See
usba_hcdi_pipe_intr_xfer(9E) for more information.
The
usba_hcdi_pipe_stop_intr_polling member should be set to a function
which is used to terminate interrupt polling and return the original
interrupt request. See
usba_hcdi_pipe_stop_intr_polling(9E) for more
information.
The
usba_hcdi_pipe_isoc_xfer member should be set to a function which
performs isochronous transfers. These may be both periodic and one-shot
transfers. See
usba_hcdi_pipe_isoc_xfer(9E) for more information.
The
usba_hcdi_pipe_stop_isoc_polling member should be set to a function
which is used to terminate isochronous polling and return the original
isochronous request. See
usba_hcdi_pipe_stop_isoc_polling(9E) for more
information.
The
usba_hcdi_get_current_frame_number member should be set to a function
which returns the current virtual frame number. While this entry point is
required, at this time, nothing uses this functionality in illumos, so
having a dummy function which just returns
USB_FAILURE is acceptable.
The
usba_hcdi_max_isoc_pkts member should be set to a function that returns
the maximum number of isochronous fragments that can be queued in a given
transfer.
The
usba_hcdi_console_input_init,
usba_hcdi_console_input_fini,
usba_hcdi_console_input_enter,
usba_hcdi_console_read, and
usba_hcdi_console_input_exit members are used to facilitate a USB device
acting as the system console and reading input from it. Support for this
is optional in an HCD driver. HCD drivers which do not support this
functionality should have functions which return
USB_FAILURE.
The
usba_hcdi_console_output_init,
usba_hcdi_console_output_fini,
usba_hcdi_console_output_enter,
usba_hcdi_console_writ, and
usba_hcdi_console_output_exit members are used to facilitate a USB device
acting as the system console and outputting data to it. Support for this
is optional in an HCD driver. HCD drivers which do not support this
functionality should have functions which return
USB_FAILURE.
The
usba_hcdi_device_init member is an
optional entry point that will be
called every time a new device is initialized and detected by the system.
If an HCD does not need this functionality, the member should be set to
NULL. See
usba_hcdi_device_init(9E) for more information.
The
usba_hcdi_device_fini member is an
optional entry point that will be
called every time a device is removed from the system, whether through it
being unplugged or a
cfgadm(8) action. If an HCD does not need this
functionality, the member should be set to NULL. See
usba_hcdi_device_fini(9E) for more information.
The
usba_hcdi_device_address member is an
optional entry point that will be
called every time a USB device needs to be addressed. If an HCD driver
does not need this functionality, the member should be set to NULL. See
usba_hcdi_device_address(9E) for more information.
The
usba_hcdi_hub_update member is an
optional entry point that will be
called every time a device descriptor is read that turns out to be a hub.
This gives HCD drivers a chance to perform any needed controller-specific
functionality before the device is used. If an HCD driver does not need
this functionality, the member should be set to NULL. See
usba_hcdi_hub_update(9E) for more information.
SEE ALSO
cfgadm(8),
attach(9E),
usba_hcdi(9E),
usba_hcdi_device_address(9E),
usba_hcdi_device_fini(9E),
usba_hcdi_device_init(9E),
usba_hcdi_hub_update(9E),
usba_hcdi_pipe_bulk_xfer(9E),
usba_hcdi_pipe_close(9E),
usba_hcdi_pipe_ctrl_xfer(9E),
usba_hcdi_pipe_intr_xfer(9E),
usba_hcdi_pipe_isoc_xfer(9E),
usba_hcdi_pipe_open(9E),
usba_hcdi_pipe_reset(9E),
usba_hcdi_pipe_stop_intr_polling(9E),
usba_hcdi_pipe_stop_isoc_polling(9E),
usba_alloc_hcdi_ops(9F),
usba_free_hcdi_ops(9F),
usba_hcdi_register(9F)OmniOS December 20, 2016 OmniOS