History log of /fuchsia/zircon/system/dev/audio/usb-audio/usb-audio-descriptors.h
Revision Date Author Comments
# 1be83d34 12-Sep-2018 Mike Voydanoff <voydanoff@google.com>

[dev][usb-bus] Refactor usb-bus driver

Previously the usb-bus driver not only managed all USB devices for a USB controller
but also managed creating devmgr devices for each interface on each device.
Now the usb-bus driver only creates devmgr devices for each USB device.
The functionality of creating devmgr devices for USB interfaces is handled by
a new driver called usb-composite, which binds to the devices created by the
usb-bus driver.

We add a new protocol ZX_PROTOCOL_USB_DEVICE to represent a USB device
(the existing ZX_PROTOCOL_USB protocol is used to represent a USB interface).
For now ZX_PROTOCOL_USB_DEVICE and ZX_PROTOCOL_USB both share the same protocol
interface (defined in ddk/protocol/usb.h), but this protocol will be refactored
in an upcoming CL.

The combination of the new usb-bus and usb-composite drivers implement
the same functionality as the old usb-bus driver, so no changes are needed
for existing USB drivers. However drivers have the option of binding directly
to the ZX_PROTOCOL_USB_DEVICE protocol in cases where the driver needs full control
of the USB device. For example, a USB device might have several interfaces that
all need to be accessed by the same driver. In this case, we do not want the
usb-composite driver to create devices for each interface.
To avoid this, the driver can bind to the ZX_PROTOCOL_USB_DEVICE device provided
by the usb-bus driver instead of the usb-composite driver.
The usb-composite driver is marked as a fallback driver to allow that to happen.

Drivers that bind directly to usb-bus with the ZX_PROTOCOL_USB_DEVICE protocol
must do some additional work that is usually handled by usb-composite.
In particular, they must call usb_enable_endpoint() to enable the endpoints
they are using.

In addition to the above, there are some changes to the ioctl interface for USB.
/dev/class/usb-device now contains files for all the USB devices created by the
usb-bus driver. Tools like lsusb should now use this directory instead of
/dev/class/usb.

The devices representing USB interfaces no longer support ioctl. To support that change,
some calls to device_ioctl() have been replaced with protocol calls.
IOCTL_USB_GET_CURRENT_FRAME is replaced by a new usb_get_current_frame() function in the USB protocol.

To help test this new functionality, the usb-hub driver now binds to ZX_PROTOCOL_USB_DEVICE
rather than ZX_PROTOCOL_USB. This means the usb-hub driver binds directly to usb-bus,
with no usb-composite support in between.

TEST: USB on NUC and VIM2 is working as expected. Tested keyboards, USB 2.0 and 3.0 hubs,
mass storage and USB audio.

Change-Id: Ib9f5aa09f8c0ae7ae2e7378f6996181fce5afb11


# f4f2a396 03-Aug-2018 Ruchira Ravoori <ravoorir@google.com>

[zircon][usb-request] Move usb request struct to usb protocol header

usb-request.c is being moved out of the ddk folder and its fucntionality
is either moved into the usb protocol or the usb library. As part of
this effort, this changeset moves the usb_request_t and friends to usb
protocol header.

Test: Build. Tested usb mass storage on vim2

Change-Id: I31659e51d5f6e899d5eb747e7baa86602c0329ea


# 65832870 16-Apr-2018 John Grossman <johngro@google.com>

[usb][audio] Add descriptor helper class.

Add a small class to help with managing the lifecycle/parsing of a
block of descriptors.

Change-Id: I79382da522d03eefd51f1b91618e010e431ba40c