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

fuchsia.hardware.usb.request

PROTOCOLS

UsbRequestCompleteCallback

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

Callback

Request

NameType
req UsbRequest

Response

NameType

STRUCTS

UsbHeader

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

Should be set by the requestor.

NameTypeDescriptionDefault
frame uint64

Frame number for scheduling isochronous transfers.

No default
device_id uint32 No default
ep_address uint8

bEndpointAddress from endpoint descriptor.

No default
length zx/off

Number of bytes to transfer.

No default
send_zlp bool

Send zero length packet if length is multiple of max packet size.

No default

UsbRequest resource

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

NameTypeDescriptionDefault
header UsbHeader No default
setup fuchsia.hardware.usb.descriptor/UsbSetup

For control transactions.

No default
vmo_handle handle<vmo>

VMO handle for payload.

No default
size uint64 No default
offset zx/off

Offset of the start of data from first page address of the vmo.

No default
virt uint64

Mapped address of the first page of the vmo. Add offset to get actual data.

No default
pmt handle<handle> No default
phys vector<uint64>

Phys addresses of the payload.

No default
sg vector<ddk.hw.physiter/SgEntry> No default
response UsbResponse No default
release_frees bool

usb_request_release() frees the request if this is true.

No default
alloc_size uint64 No default
cb_on_error_only bool

Set by the requester if the callback should be skipped on successful completion. This is useful for isochronous requests, where the requester does not care about most callbacks. The requester is in charge of keeping track of the order of queued requests and requeuing silently completed requests.

There may be cases where a request completes out of order. For example, errors are reported as soon as possible, rather than preserving queue order. Due to this, the requester may receive additional callbacks on top of those requested.

If the requester receives a callback, they should check the response's |silent_completions_count| to know how many consecutive requests prior to this one (in relation to queue order for the endpoint) have completed successfully.

No default
direct bool

Direct mode -- if set to true, this packet is handled with high priority directly in interrupt context. It will NOT be safe to block in any callbacks, and all layers should take the most direct path to route the packet to the requesting driver from hardware.

No default
reset bool

If true, resets an endpoint and does not transfer any data.

No default
reset_address uint8

The address of the endpoint to reset.

No default

UsbResponse

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

Response data. (Filled in by processor before |UsbRequestComplete()| is called)

NameTypeDescriptionDefault
status zx/status

Status of transaction. ZX_ERR_IO_INVALID indicates that the device stalled the transfer.

No default
actual zx/off

Number of bytes actually transferred (on success).

No default
silent_completions_count uint64

Number of consecutive requests that were silently completed immediately prior to this request. This only needs to be checked if the client has set |cb_on_error_only| on any requests, otherwise it will always be zero.

No default