USBA_DEVICE(9S) | Data Structures for Drivers | USBA_DEVICE(9S) |
usba_device
,
usba_device_t
— USBA Device
Data Structure
#include
<sys/usb/usba/hcdi.h>
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.
The usba_device_t structure is used by the illumos USB Architecture (USBA) to represent a physical USB device. While a given USB device may be a composite device, a USB device that implements two or more classes, there will still only be a single device structure. A USB device is always plugged into a port on some hub, excepting the root hub, and has an address on the USB fabric.
Many of the USB HCD driver operations pass a usba_device_t to the HCD driver. The usba_device_t should be used by an HCD driver in a read-only fashion. A subset of the structure's fields that are useful for HCD drivers to read are listed below.
In addition, there are two optional HCD entry points that interact with this structure and give the change for a driver to store per-device state. If the driver implements the usba_hcdi_device_init(9E) and usba_hcdi_device_fini(9E) functions, then the private data stored from usba_hcdi_device_init(9E) can be retrieved with usba_hcdi_get_device_private(9F).
The usba_device_t structure includes the following members:
dev_info_t *usb_dip usba_hubdi_t *usb_hubdi; usb_addr_t usb_addr; usb_dev_descr_t *usb_dev_descr; char *usb_mfg_str; char *usb_product_str; char *usb_serialno_str; usb_port_status_t usb_port_status; usb_port_t usb_port; usba_device_t *usb_hs_hub_usba_dev; usba_device_t *usb_parent_hub;
The usb_dip member is a pointer to the device's dev_info_t structure. This generally is used if the HCD driver wants to get naming information for diagnostic purposes. When duplicating requests for isochronous and interrupt requests, HCD drivers should use the dev_info_t from the usba_pipe_handle_data_t(9S).
The
usb_hubdi
member can be used to determine whether or not the
usba_device_t in question is a hub or not. HCD drivers
should compare this member to NULL
. If the member is
not NULL
, then this USB device corresponds to a
hub.
the usb_addr member indicates the address of the USB device on the broader USB bus. Note, that the actual address assigned to the device may be different, especially if the HCD driver implements the optional usba_hcdi_device_address(9E) entry point. See the section USB addressing in usba_hcdi(9E) for more information.
The
usb_dev_descr
member points to the device descriptor for a given device. This structure is
documented in
usb_dev_descr(9S). This member
may be NULL
as it may not have been populated during
device attachment. This member may be NULL
. HCD
drivers should always check for NULL
before
dereferencing it.
The
usb_mfg_str
member may contain a pointer to a character string with the name of the
manufacturer as retrieved from the device. This member may be
NULL
. HCD drivers should always check for
NULL
before dereferencing it.
The
usb_product_str
member may contain a pointer to a character string with the name of the
product as retrieved from the device. This member may be
NULL
. HCD drivers should always check for
NULL
before dereferencing it.
The
usb_serialno_str
member may contain a pointer to a character string with the serial number of
the device as retrieved from the device. This member may be
NULL
. HCD drivers should always check for
NULL
before dereferencing it.
The usb_port_status contains a usb_port_status_t(9T) entry, which describes the current negotiated speed of the device. See usb_port_status_t(9T) for more information on the values and types.
The usb_port member contains the port on a hub that the device is plugged into. Ports are always numbered starting at 1.
The
usb_hs_hub_usba_dev
member is set when there is a parent high-speed hub. This is most notable
for low- and full- speed devices which require split transaction support.
This points to the
usb_device_t
structure that is the closest high-speed parent hub. This member should
always be set to NULL
for super-speed devices. A
device operating a super-speed can never be plugged into a high-speed
hub.
The
usb_parent_hub
member points to the usba_device_t structure that the
device in question is plugged into. If the device represents the root hub,
then this field will be NULL
.
usba_hcdi(9E), usba_hcdi_device_address(9E), usba_hcdi_device_fini(9E), usba_hcdi_device_init(9E), usba_pipe_handle_data_t(9S), usb_port_status_t(9T)
December 20, 2016 | OmniOS |