class Device

Defined at line 41 of file ../../src/devices/misc/drivers/compat/device.h

Device is an implementation of a DFv1 device.

Public Methods

void set_fragments (std::vector<std::string> names)

Defined at line 115 of file ../../src/devices/misc/drivers/compat/device.h

Driver * driver ()

Defined at line 116 of file ../../src/devices/misc/drivers/compat/device.h

async_dispatcher_t * dispatcher ()

Defined at line 118 of file ../../src/devices/misc/drivers/compat/device.h

fpromise::scope & scope ()

Defined at line 119 of file ../../src/devices/misc/drivers/compat/device.h

fdf::Logger & logger ()

Defined at line 120 of file ../../src/devices/misc/drivers/compat/device.h

async::Executor & executor ()

Defined at line 121 of file ../../src/devices/misc/drivers/compat/device.h

DeviceServer & device_server ()

Defined at line 122 of file ../../src/devices/misc/drivers/compat/device.h

devfs_fidl::DeviceServer & devfs_server ()

Defined at line 123 of file ../../src/devices/misc/drivers/compat/device.h

void set_logger (std::shared_ptr<fdf::Logger> logger)

Defined at line 125 of file ../../src/devices/misc/drivers/compat/device.h

const std::vector<std::string> & fragments ()

Defined at line 127 of file ../../src/devices/misc/drivers/compat/device.h

std::optional<Device *> & parent ()

Public for testing.

Defined at line 130 of file ../../src/devices/misc/drivers/compat/device.h

void Device (device_t device, const zx_protocol_device_t * ops, Driver * driver, std::optional<Device *> parent, std::shared_ptr<fdf::Logger> logger, async_dispatcher_t * dispatcher)

Defined at line 163 of file ../../src/devices/misc/drivers/compat/device.cc

void ~Device ()

Defined at line 183 of file ../../src/devices/misc/drivers/compat/device.cc

zx_device_t * ZxDevice ()

Defined at line 209 of file ../../src/devices/misc/drivers/compat/device.cc

void Bind (fidl::WireSharedClient<fuchsia_driver_framework::Node> node)

Binds a device to a DFv2 node.

Defined at line 211 of file ../../src/devices/misc/drivers/compat/device.cc

void Unbind ()

Unbinds a device from a DFv2 node.

Defined at line 213 of file ../../src/devices/misc/drivers/compat/device.cc

fpromise::promise<void> HandleStopSignal ()

Call Unbind or Suspend based on the power state.

Defined at line 222 of file ../../src/devices/misc/drivers/compat/device.cc

fpromise::promise<void> UnbindOp ()

Call the Unbind op for the device.

Defined at line 232 of file ../../src/devices/misc/drivers/compat/device.cc

fpromise::promise<void> SuspendOp ()

Call the Suspend op for the device.

Defined at line 252 of file ../../src/devices/misc/drivers/compat/device.cc

fpromise::promise<void> RemoveChildren ()

Removes all of the child devices.

Defined at line 632 of file ../../src/devices/misc/drivers/compat/device.cc

fpromise::promise<void> SuspendChildren ()

Suspends all of the child devices.

Defined at line 651 of file ../../src/devices/misc/drivers/compat/device.cc

const char * Name ()

Defined at line 297 of file ../../src/devices/misc/drivers/compat/device.cc

bool HasChildren ()

Defined at line 299 of file ../../src/devices/misc/drivers/compat/device.cc

zx_status_t Add (device_add_args_t * zx_args, zx_device_t ** out)

Functions to implement the DFv1 device API.

Defined at line 307 of file ../../src/devices/misc/drivers/compat/device.cc

fpromise::promise<void> Remove ()

Remove this device. This call will make sure that DFv1 unbind and release

are called in the correct order. This promise will finish once the device

has been completely removed.

Defined at line 670 of file ../../src/devices/misc/drivers/compat/device.cc

zx_status_t GetProtocol (uint32_t proto_id, void * out)

Defined at line 753 of file ../../src/devices/misc/drivers/compat/device.cc

zx_status_t GetFragmentProtocol (const char * fragment, uint32_t proto_id, void * out)

Defined at line 788 of file ../../src/devices/misc/drivers/compat/device.cc

zx_status_t AddMetadata (uint32_t type, const void * data, size_t size)

Defined at line 797 of file ../../src/devices/misc/drivers/compat/device.cc

zx_status_t GetMetadata (uint32_t type, void * buf, size_t buflen, size_t * actual)

Defined at line 801 of file ../../src/devices/misc/drivers/compat/device.cc

zx_status_t RegisterServiceMember (component::AnyHandler handler, const char * service_name, const char * instance_name, const char * member_name)

Defined at line 805 of file ../../src/devices/misc/drivers/compat/device.cc

void InitReply (zx_status_t status)

Defined at line 824 of file ../../src/devices/misc/drivers/compat/device.cc

zx_status_t ConnectFragmentFidl (const char * fragment_name, const char * service_name, const char * protocol_name, zx::channel request, bool zircon_transport)

Defined at line 894 of file ../../src/devices/misc/drivers/compat/device.cc

zx_status_t AddCompositeNodeSpec (const char * name, const composite_node_spec_t * spec)

Defined at line 926 of file ../../src/devices/misc/drivers/compat/device.cc

zx_status_t ConnectFragmentRuntime (const char * fragment_name, const char * service_name, const char * protocol_name, fdf::Channel request)

Connects to the runtime service using the v2 protocol discovery with tokens.

Defined at line 966 of file ../../src/devices/misc/drivers/compat/device.cc

zx_status_t ConnectNsProtocol (const char * protocol_name, zx::channel request)

Defined at line 982 of file ../../src/devices/misc/drivers/compat/device.cc

fpromise::promise<void, zx_status_t> WaitForInitToComplete ()

Defined at line 880 of file ../../src/devices/misc/drivers/compat/device.cc

zx_status_t CreateNode ()

Defined at line 435 of file ../../src/devices/misc/drivers/compat/device.cc

void CompleteUnbind ()

Defined at line 274 of file ../../src/devices/misc/drivers/compat/device.cc

void CompleteSuspend ()

Defined at line 292 of file ../../src/devices/misc/drivers/compat/device.cc

zx_status_t PublishInspect (zx::vmo inspect_vmo)

Defined at line 988 of file ../../src/devices/misc/drivers/compat/device.cc

void AddDelayedChildReleaseOp (std::unique_ptr<DelayedReleaseOp> op)

Stores the child's release op, to be called after dispatcher shutdown.

Defined at line 1008 of file ../../src/devices/misc/drivers/compat/device.cc