class EndpointClientBase
Defined at line 28 of file ../../src/devices/usb/lib/usb-endpoint/include/usb-endpoint/usb-endpoint-client.h
EndpointClientBase is self contained helps manage common functionality for the client side of
`fuchsia_hardware_usb_endpoint::Endpoint` without needing any references outside.
EndpointClientBase should only be inherited by EndpointClient and should not be used
independently. One of the largest uses of EndpointClientBase is managing mapped VMOs.
Protected Members
SharedClient client_
Public Methods
void EndpointClientBase (usb::EndpointType ep_type)
Defined at line 30 of file ../../src/devices/usb/lib/usb-endpoint/include/usb-endpoint/usb-endpoint-client.h
void ~EndpointClientBase ()
Upon destruction, EndpointClientBase ensures that all allocated requests have been freed and
unmaps VMOs.
Defined at line 31 of file ../../src/devices/usb/lib/usb-endpoint/usb-endpoint-client.cc
fidl::SharedClient<fuchsia_hardware_usb_endpoint::Endpoint> & operator-> ()
Only allow access to client_. Generally this should only be used to call GetInfo,
QueueRequests, and CancelAll, where RegisterVmos and UnregisterVmos will be called accordingly
by AddRequests and DeleteRequest.
Defined at line 38 of file ../../src/devices/usb/lib/usb-endpoint/include/usb-endpoint/usb-endpoint-client.h
std::optional<usb::FidlRequest> GetRequest ()
Defined at line 46 of file ../../src/devices/usb/lib/usb-endpoint/include/usb-endpoint/usb-endpoint-client.h
void PutRequest (usb::FidlRequest && request)
Defined at line 47 of file ../../src/devices/usb/lib/usb-endpoint/include/usb-endpoint/usb-endpoint-client.h
bool RequestsFull ()
Defined at line 48 of file ../../src/devices/usb/lib/usb-endpoint/include/usb-endpoint/usb-endpoint-client.h
bool RequestsEmpty ()
Defined at line 49 of file ../../src/devices/usb/lib/usb-endpoint/include/usb-endpoint/usb-endpoint-client.h
std::mutex & mutex ()
Defined at line 55 of file ../../src/devices/usb/lib/usb-endpoint/include/usb-endpoint/usb-endpoint-client.h
(lambda at ../../src/devices/usb/lib/usb-endpoint/include/usb-endpoint/usb-endpoint-client.h:58:12) GetMapped ()
Defined at line 57 of file ../../src/devices/usb/lib/usb-endpoint/include/usb-endpoint/usb-endpoint-client.h
(lambda at ../../src/devices/usb/lib/usb-endpoint/include/usb-endpoint/usb-endpoint-client.h:65:12) GetMappedLocked ()
Defined at line 64 of file ../../src/devices/usb/lib/usb-endpoint/include/usb-endpoint/usb-endpoint-client.h
std::optional<zx_vaddr_t> GetMappedAddr (const fuchsia_hardware_usb_request::Request & request, size_t idx)
Defined at line 69 of file ../../src/devices/usb/lib/usb-endpoint/include/usb-endpoint/usb-endpoint-client.h
size_t AddRequests (size_t req_count, size_t size, fuchsia_hardware_usb_request::Buffer::Tag type)
Helper functions that manage access to the request pool. Buffer regions of a request will be
mapped upon addition to the pool. If mapping upon addition is not desired, one may use
fuchsia_hardware_usb_request::Buffer::Tag::kData types or manage its own requests (i.e. not
using a pool). Note that all functions specified in EndpointClient expect that the requests
have been previously mapped and the mapped addresses are saved and managed by EndpointClient.
Defined at line 72 of file ../../src/devices/usb/lib/usb-endpoint/usb-endpoint-client.cc
std::optional<zx_vaddr_t> GetMappedAddrLocked (const fuchsia_hardware_usb_request::Request & request, size_t idx)
Defined at line 74 of file ../../src/devices/usb/lib/usb-endpoint/include/usb-endpoint/usb-endpoint-client.h
zx_status_t DeleteRequest (usb::FidlRequest && request)
Helper function that deletes a request from the pool. If this function is not called when
deleting a request from the pool, it will stay mapped (and registered) until the endpoint is
destructed.
Defined at line 87 of file ../../src/devices/usb/lib/usb-endpoint/usb-endpoint-client.cc