Google is committed to advancing racial equity for Black communities. See how.

fuchsia.hardware.usb.function

PROTOCOLS

UsbFunction

Defined in fuchsia.hardware.usb.function/usb-function.fidl

AllocEp

Allocates a unique endpoint descriptor number.

Request

NameType
direction uint8

Response

NameType
s zx/status
address uint8

AllocInterface

Allocates a unique interface descriptor number.

Request

NameType

Response

NameType
s zx/status
intf_num uint8

AllocStringDesc

Adds a string descriptor to the device configuration.

Request

NameType
string string

Response

NameType
s zx/status
index uint8

CancelAll

Cancels all transactions currently queued on the specified endpoint.

Request

NameType
ep_address uint8

Response

NameType
s zx/status

ConfigEp

Configures an endpoint based on provided descriptors.

Request

NameType
ep_desc fuchsia.hardware.usb.descriptor/UsbEndpointDescriptor
ss_comp_desc fuchsia.hardware.usb.descriptor/UsbSsEpCompDescriptor

Response

NameType
s zx/status

DisableEp

Disables the specified endpoint.

Request

NameType
address uint8

Response

NameType
s zx/status

EpClearStall

Clears a stall condition for the specified endpoint.

Request

NameType
ep_address uint8

Response

NameType
s zx/status

EpSetStall

Stalls the specified endpoint.

Request

NameType
ep_address uint8

Response

NameType
s zx/status

GetRequestSize

Returns the size needed for a |usb_request_t|, including private storage needed by the HCI driver.

Request

NameType

Response

NameType
size uint64

RequestQueue

Queues a USB request with the lower level driver.

Request

NameType
usb_request fuchsia.hardware.usb.request/UsbRequest
complete_cb fuchsia.hardware.usb.request/UsbRequestCompleteCallback

Response

NameType

SetInterface

Registers callbacks to the USB function driver.

Request

NameType
interface UsbFunctionInterface

Response

NameType
s zx/status

UsbFunctionInterface

Defined in fuchsia.hardware.usb.function/usb-function.fidl

Interface implemented by the USB function driver.

Control

Callback for handling ep0 control requests.

Request

NameType
setup fuchsia.hardware.usb.descriptor/UsbSetup
write vector<uint8>

Response

NameType
status zx/status
read vector<uint8>

GetDescriptors

Returns the descriptor list for the function. TODO(voydanoff) - descriptors will likely vary (different max packet sizes, etc) depending on whether we are in low/full, high or super speed mode. We will need to add a usb_speed_t argument to this callback.

Request

NameType

Response

NameType
descriptors vector<uint8>

GetDescriptorsSize

Returns the size of the descriptor list for the function.

Request

NameType

Response

NameType
size uint64

SetConfigured

Called to inform the function driver when the USB device configured state changes. Called with configured == true in response to a SET_CONFIGURATION control request that selects a configuration that contains this function. In this case, the function driver should call usb_function_config_ep() to configure its endpoints. Called with configured == false when configuration is disabled or USB is disconnected. The function driver should then call usb_function_disable_ep() to disable its endpoints.

Request

NameType
configured bool
speed fuchsia.hardware.usb.descriptor/UsbSpeed

Response

NameType
s zx/status

SetInterface

Called to set an alternate setting for an interface due to a SET_INTERFACE control request. The function driver should call usb_function_config_ep() and/or usb_function_config_ep() to configure or disable the interface's endpoints as appropriate.

Request

NameType
interface uint8
alt_setting uint8

Response

NameType
s zx/status

STRUCTS