fuchsia.device.manager

PROTOCOLS

Administrator

Defined in fuchsia.device.manager/administrator.fidl

Provides administration services for the device manager service and the device tree it controls.

Suspend

Ask all devices to enter the suspend state indicated by flags. Flags should be some combination of DEVICE_SUSPEND_FLAG_* from the DDK.

Request

NameType
flags uint32

Response

NameType
status int32

DeviceController

Defined in fuchsia.device.manager/coordinator.fidl

Protocol for controlling devices in a devhost process from the devcoordinator

BindDriver

Bind the requested driver to this device. driver_path is informational, but all calls to BindDriver/CreateDevice should use the same driver_path each time they use a driver VMO with the same contents. Returns a status and optionally a channel to the driver's test output. test_output will be not present unless the driver is configured to run its run_unit_tests hook, in which case the other end of the channel will have been passed to the driver.

Request

NameType
driver_path string[1024]
driver handle<vmo>

Response

NameType
status int32
test_output handle<channel>?

ConnectProxy

Give this device a channel to its shadow in another process.

Request

NameType
shadow handle<channel>

Unbind

Ask devhost to unbind this device. On success, the remote end of this interface channel will close instead of returning a result.

Request

NameType

CompleteRemoval

Ask the devhost to complete the removal of this device, which previously had invoked |ScheduleRemove|. This is a special case that can be removed once |device_remove| invokes |unbind|.

Request

NameType

RemoveDevice

Ask the devhost to remove this device. On success, the remote end of this interface channel will close instead of returning a result.

Request

NameType

Suspend

Ask devhost to suspend this device, using the target state indicated by flags.

Request

NameType
flags uint32

Response

NameType
status int32

CompleteCompatibilityTests

Inform devhost about the compatibility test status when compatibility tests fail or complete successfully.

Request

NameType
status CompatibilityTestStatus

DevhostController

Defined in fuchsia.device.manager/coordinator.fidl

Protocol for controlling a devhost process from the devcoordinator

CreateDeviceStub

Create a device in the devhost that only implements the device protocol and claims to support the given protocol_id. This device will communicate with the devcoordinator via rpc.

Request

NameType
rpc handle<channel>
protocol_id uint32
local_device_id uint64

CreateDevice

Create a device in the devhost representing the shadowed half of device in another devhost. This new device will communicate with the devcoordinator via rpc, and with its other half via parent_proxy.

The new device will have the given driver responsible for running its half of the driver's cross-process protocol. It's create() method will be invoked, giving it access to parent_proxy and proxy_args.

parent_proxy, if present, will usually be a channel to the upper half of a shadowed device. The one exception is when this method is used to create the Platform Bus, in which case it will be a channel to a fuchsia.boot.Items protocol.

local_device_id will be a unique value within the device's devhost

Request

NameType
rpc handle<channel>
driver_path string[1024]
driver handle<vmo>
parent_proxy handle<handle>?
proxy_args string[1024]?
local_device_id uint64

CreateCompositeDevice

Introduce a composite device that has the given name and properties. components will be a list of all of the composite's components, described using devhost local device ids. The order of the components will match the original composite creation request. The new device will communicate with devcoordinator via rpc.

local_device_id will be a unique value within the device's devhost, identifying the resulting composite device.

Request

NameType
rpc handle<channel>
components vector<uint64>[8]
name string[31]
local_device_id uint64

Response

NameType
status int32

Coordinator

Defined in fuchsia.device.manager/coordinator.fidl

Interface for the devices in devhosts to coordinate with the devcoordinator.

AddDevice

Record the addition of a new device that can be communicated with via rpc. For binding purposes, it is has properties props. name and driver_path are informational and used for debugging. The device will have protocol_id as its primary protocol id. args should only be used for shadowed devices, and will be forwarded to the shadow device. client_remote, if present, will be passed to the device as an open connection for the client. On success, the returned local_device_id is the identifier assigned by devmgr.

Request

NameType
rpc handle<channel>
props vector<uint64>[256]
name string[31]
protocol_id uint32
driver_path string[1024]?
args string[1024]?
device_add_config AddDeviceConfig
client_remote handle<channel>?

Response

NameType
result Coordinator_AddDevice_Result

AddDeviceInvisible

Behaves as AddDevice, but marks the device as initially invisible. This means that it will not be visible to other devices or the devfs until it is later marked visible (via MakeVisible).

Request

NameType
rpc handle<channel>
props vector<uint64>[256]
name string[31]
protocol_id uint32
driver_path string[1024]?
args string[1024]?
client_remote handle<channel>?

Response

NameType
result Coordinator_AddDeviceInvisible_Result

ScheduleRemove

Requests the devcoordinator schedule the removal of this device, and the unbinding of its children. If |unbind_self| is true, the unbind hook for this device will also be called.

Request

NameType
unbind_self bool

ScheduleUnbindChildren

Requests the devcoordinator schedule the unbinding of this device's children.

Request

NameType

UnbindDone

Sent as the response to |Unbind|.

Request

NameType

RemoveDone

Sent as the response to |CompleteRemoval|.

Request

NameType

RemoveDevice

Record the removal of this device.

Request

NameType

Response

NameType
result Coordinator_RemoveDevice_Result

MakeVisible

Mark this device as visible.

Request

NameType

Response

NameType
result Coordinator_MakeVisible_Result

BindDevice

Attempt to bind a driver against this device. If driver_path is null, this will initiate the driver matching algorithm. TODO(teisenbe): Specify the behavior of invoking this multiple times. I believe the current behavior is a bug.

Request

NameType
driver_path string[1024]?

Response

NameType
result Coordinator_BindDevice_Result

GetTopologicalPath

Returns the topological path of this device.

Request

NameType

Response

NameType
result Coordinator_GetTopologicalPath_Result

LoadFirmware

Requests that the firmware at the given path be loaded and returned.

Request

NameType
fw_path string[1024]

Response

NameType
result Coordinator_LoadFirmware_Result

GetMetadata

Retrieve the metadata blob associated with this device and the given key.

Request

NameType
key uint32

Response

NameType
result Coordinator_GetMetadata_Result

GetMetadataSize

Retrieve the metadata size associated with this device and the given key.

Request

NameType
key uint32

Response

NameType
result Coordinator_GetMetadataSize_Result

AddMetadata

Add metadata blob associated with this device and the given key. TODO(teisenbe): Document the behavior of calling this twice with the same key. I believe the current behavior results in inaccessible data that is kept around for the lifetime of the device.

Request

NameType
key uint32
data vector<uint8>[8192]?

Response

NameType
result Coordinator_AddMetadata_Result

PublishMetadata

Behaves like AddMetadata, but instead of associating it with the requesting device, associates it with the device at device_path. If the device at device_path is not a child of the requesting device AND the requesting device is not running in the sys devhost, then this will fail.

Request

NameType
device_path string[1024]
key uint32
data vector<uint8>[8192]?

Response

NameType
result Coordinator_PublishMetadata_Result

AddCompositeDevice

Adds the given composite device. This causes the devcoordinator to try to match the components against the existing device tree, and to monitor all new device additions in order to find the components as they are created.

Request

NameType
name string[31]
props vector<uint64>[256]
components vector<DeviceComponent>
coresident_device_index uint32

Response

NameType
result Coordinator_AddCompositeDevice_Result

DirectoryWatch

Watches a directory, receiving events of added messages on the watcher request channel. See fuchsia.io.Directory for more information.

Request

NameType
mask uint32
options uint32
watcher handle<channel>

Response

NameType
result Coordinator_DirectoryWatch_Result

RunCompatibilityTests

Run Compatibility tests for the driver that binds to this device. The hook_wait_time is the time that the driver expects to take for each device hook in nanoseconds. Returns whether the compatibility tests started, and does not convey anything about the status of the test.

Request

NameType
hook_wait_time int64

Response

NameType
result Coordinator_RunCompatibilityTests_Result

DebugDumper

Defined in fuchsia.device.manager/debug.fidl

Dumps text debug information.

All methods dump ascii text into a VMO, this allows the caller the flexibility to decide how much data they want. Use the returned written value to read the data, no string termination is guaranteed.

DumpTree

Print device tree into output, returns bytes written and bytes available to write.

Request

NameType
output handle<vmo>

Response

NameType
status int32
written uint64
available uint64

DumpDrivers

Print information about all drivers into output, returns bytes written and bytes available to write.

Request

NameType
output handle<vmo>

Response

NameType
status int32
written uint64
available uint64

DumpBindingProperties

Print all devices and their binding properties into output, returns bytes written and bytes available to write.

Request

NameType
output handle<vmo>

Response

NameType
status int32
written uint64
available uint64

STRUCTS

Coordinator_AddDevice_Response

Defined in fuchsia.device.manager/generated

NameTypeDescriptionDefault
local_device_id uint64 No default

Coordinator_AddDeviceInvisible_Response

Defined in fuchsia.device.manager/generated

NameTypeDescriptionDefault
local_device_id uint64 No default

Coordinator_RemoveDevice_Response

Defined in fuchsia.device.manager/generated

NameTypeDescriptionDefault

Coordinator_MakeVisible_Response

Defined in fuchsia.device.manager/generated

NameTypeDescriptionDefault

Coordinator_BindDevice_Response

Defined in fuchsia.device.manager/generated

NameTypeDescriptionDefault

Coordinator_GetTopologicalPath_Response

Defined in fuchsia.device.manager/generated

NameTypeDescriptionDefault
path string[1024] No default

Coordinator_LoadFirmware_Response

Defined in fuchsia.device.manager/generated

NameTypeDescriptionDefault
vmo handle<vmo> No default
size uint64 No default

Coordinator_GetMetadata_Response

Defined in fuchsia.device.manager/generated

NameTypeDescriptionDefault
data vector<uint8>[8192] No default

Coordinator_GetMetadataSize_Response

Defined in fuchsia.device.manager/generated

NameTypeDescriptionDefault
size uint64 No default

Coordinator_AddMetadata_Response

Defined in fuchsia.device.manager/generated

NameTypeDescriptionDefault

Coordinator_PublishMetadata_Response

Defined in fuchsia.device.manager/generated

NameTypeDescriptionDefault

Coordinator_AddCompositeDevice_Response

Defined in fuchsia.device.manager/generated

NameTypeDescriptionDefault

Coordinator_DirectoryWatch_Response

Defined in fuchsia.device.manager/generated

NameTypeDescriptionDefault

Coordinator_RunCompatibilityTests_Response

Defined in fuchsia.device.manager/generated

NameTypeDescriptionDefault

BindInstruction

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescriptionDefault
op uint32 bitfield that encodes the operation and execution conditions No default
arg uint32 bitfield that encodes the arguments No default

DeviceComponentPart

Defined in fuchsia.device.manager/coordinator.fidl

A part of a description of a DeviceComponent

NameTypeDescriptionDefault
match_program_count uint32 No default
match_program [32] No default

DeviceComponent

Defined in fuchsia.device.manager/coordinator.fidl

A piece of a composite device

NameTypeDescriptionDefault
parts_count uint32 No default
parts [16] No default

ENUMS

CompatibilityTestStatus

Type: uint32

Defined in fuchsia.device.manager/coordinator.fidl

A enum of CompatibilityTestStatus

NameValueDescription
OK 1
ERR_BIND_NO_DDKADD 2
ERR_BIND_TIMEOUT 3
ERR_UNBIND_NO_DDKREMOVE 4
ERR_UNBIND_TIMEOUT 5
ERR_SUSPEND_DDKREMOVE 6
ERR_INTERNAL 7

UNIONS

Coordinator_AddDevice_Result

Defined in fuchsia.device.manager/generated

NameTypeDescription
response Coordinator_AddDevice_Response
err int32

Coordinator_AddDeviceInvisible_Result

Defined in fuchsia.device.manager/generated

NameTypeDescription
response Coordinator_AddDeviceInvisible_Response
err int32

Coordinator_RemoveDevice_Result

Defined in fuchsia.device.manager/generated

NameTypeDescription
response Coordinator_RemoveDevice_Response
err int32

Coordinator_MakeVisible_Result

Defined in fuchsia.device.manager/generated

NameTypeDescription
response Coordinator_MakeVisible_Response
err int32

Coordinator_BindDevice_Result

Defined in fuchsia.device.manager/generated

NameTypeDescription
response Coordinator_BindDevice_Response
err int32

Coordinator_GetTopologicalPath_Result

Defined in fuchsia.device.manager/generated

NameTypeDescription
response Coordinator_GetTopologicalPath_Response
err int32

Coordinator_LoadFirmware_Result

Defined in fuchsia.device.manager/generated

NameTypeDescription
response Coordinator_LoadFirmware_Response
err int32

Coordinator_GetMetadata_Result

Defined in fuchsia.device.manager/generated

NameTypeDescription
response Coordinator_GetMetadata_Response
err int32

Coordinator_GetMetadataSize_Result

Defined in fuchsia.device.manager/generated

NameTypeDescription
response Coordinator_GetMetadataSize_Response
err int32

Coordinator_AddMetadata_Result

Defined in fuchsia.device.manager/generated

NameTypeDescription
response Coordinator_AddMetadata_Response
err int32

Coordinator_PublishMetadata_Result

Defined in fuchsia.device.manager/generated

NameTypeDescription
response Coordinator_PublishMetadata_Response
err int32

Coordinator_AddCompositeDevice_Result

Defined in fuchsia.device.manager/generated

NameTypeDescription
response Coordinator_AddCompositeDevice_Response
err int32

Coordinator_DirectoryWatch_Result

Defined in fuchsia.device.manager/generated

NameTypeDescription
response Coordinator_DirectoryWatch_Response
err int32

Coordinator_RunCompatibilityTests_Result

Defined in fuchsia.device.manager/generated

NameTypeDescription
response Coordinator_RunCompatibilityTests_Response
err int32

BITS

AddDeviceConfig

Type: uint32

NameValueDescription
ALLOW_MULTI_COMPOSITE 1 Device can be a component in multiple composite devices

CONSTANTS

NameValueType
SUSPEND_FLAG_REBOOT 3705405696 uint32
SUSPEND_FLAG_POWEROFF 3705405952 uint32
DEVICE_NAME_MAX 31 uint32
DEVICE_PATH_MAX 1024 uint32
DEVICE_ARGS_MAX 1024 uint32
METADATA_MAX 8192 uint32
PROPERTIES_MAX 256 uint32
COMPONENTS_MAX 8 uint32
DEVICE_COMPONENT_PARTS_MAX 16 uint32
DEVICE_COMPONENT_PART_INSTRUCTIONS_MAX 32 uint32