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

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 zx/status

BindDebugger

Defined in fuchsia.device.manager/coordinator.fidl

Protocol for getting the information needed to debug bind programs from the devcoordinator.

GetBindProgram

Returns the bind program of the given driver. ZX_ERR_NOT_FOUND indicates that there is no driver matching the given path. ZX_ERR_BUFFER_TOO_SMALL indicates that the driver's bind program is longer than the maximum number of instructions (BIND_PROGRAM_INSTRUCTIONS_MAX).

Request

NameType
driver_path string[1024]

Response

NameType
result BindDebugger_GetBindProgram_Result

GetDeviceProperties

Returns the list of properties of the given device. ZX_ERR_NOT_FOUND indicates that there is no device matching the given path. ZX_ERR_BAD_PATH indicates that the given path is not valid. ZX_ERR_BUFFER_TOO_SMALL indicates either that the given path is too long, or that the device has more than the maximum number of properties (PROPERTIES_MAX).

Request

NameType
device_path string[1024]

Response

NameType
result BindDebugger_GetDeviceProperties_Result

Coordinator

Defined in fuchsia.device.manager/coordinator.fidl

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

AddCompositeDevice

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

Request

NameType
name string[31]
comp_desc CompositeDeviceDescriptor

Response

NameType
result Coordinator_AddCompositeDevice_Result

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
coordinator request<Coordinator>
device_controller DeviceController
props vector<DeviceProperty>[256]
name string[31]
protocol_id uint32
driver_path string[1024]?
args string[1024]?
device_add_config AddDeviceConfig
has_init bool
inspect handle<vmo>?
client_remote handle<channel>?

Response

NameType
result Coordinator_AddDevice_Result

AddMetadata

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

Request

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

Response

NameType
result Coordinator_AddMetadata_Result

BindDevice

Attempt to bind a driver against this device. If driver_path is null, this will initiate the driver matching algorithm.

Request

NameType
driver_path string[1024]?

Response

NameType
result Coordinator_BindDevice_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

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

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

MakeVisible

Mark this device as visible.

Request

NameType

Response

NameType
result Coordinator_MakeVisible_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

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

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

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.

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 zx/status
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 zx/status
written uint64
available uint64

DumpTree

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

Request

NameType
output handle<vmo>

Response

NameType
status zx/status
written uint64
available uint64

DevhostController

Defined in fuchsia.device.manager/coordinator.fidl

Protocol for controlling a devhost process from the devcoordinator

CreateCompositeDevice

Introduce a composite device that has the given name and properties. fragments will be a list of all of the composite's fragments, described using devhost local device ids. The order of the fragments 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
coordinator_rpc Coordinator
device_controller_rpc request<DeviceController>
fragments vector<uint64>[16]
name string[31]
local_device_id LocalDeviceId

Response

NameType
status zx/status

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
coordinator_rpc Coordinator
device_controller_rpc request<DeviceController>
driver_path string[1024]
driver handle<vmo>
parent_proxy handle<handle>?
proxy_args string[1024]?
local_device_id LocalDeviceId

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 coordinator. Implements DeviceController on device_controller_rpc

Request

NameType
coordinator_rpc Coordinator
device_controller_rpc request<DeviceController>
protocol_id uint32
local_device_id LocalDeviceId

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 zx/status
test_output handle<channel>?

CompleteCompatibilityTests

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

Request

NameType
status CompatibilityTestStatus

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

Response

NameType
result DeviceController_CompleteRemoval_Result

ConnectProxy

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

Request

NameType
shadow handle<channel>

Init

Ask devhost to call the device init hook.

Request

NameType

Response

NameType
status zx/status

Resume

Ask devhost to resume this device, using the target system state indicated by 'target_system_state'.

Request

NameType
target_system_state uint32

Response

NameType
status zx/status

Suspend

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

Request

NameType
flags uint32

Response

NameType
status zx/status

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

Response

NameType
result DeviceController_Unbind_Result

SystemStateTransition

Defined in fuchsia.device.manager/system-state-transition.fidl

Provides protocol for managing driver manager and all the devices during a system state transition.

SetTerminationSystemState

Sets and updates the termination SystemPowerState of driver_manager. On Success, the system power state is cached. The next time driver_manager's stop event is triggered, driver_manager suspends the system to "state". Returns ZX_ERR_INVALID_ARGS if the system power state is not a shutdown/reboot state(POWEROFF, REBOOT, REBOOT_BOOTLOADER, REBOOT_RECOVERY, MEXEC) Returns ZX_ERR_BAD_STATE if driver_manager is unable to save the state. Each time the api is called the termination state is updated and cached.

Request

NameType
state fuchsia.hardware.power.statecontrol/SystemPowerState

Response

NameType
result SystemStateTransition_SetTerminationSystemState_Result

STRUCTS

BindDebugger_GetBindProgram_Response

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescriptionDefault
instructions vector<BindInstruction>[256] No default

BindDebugger_GetDeviceProperties_Response

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescriptionDefault
props vector<DeviceProperty>[256] No default

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
debug uint32

bitfield that encodes debugging information

No default

CompositeDeviceDescriptor

Defined in fuchsia.device.manager/coordinator.fidl

Composite device parts and properties

NameTypeDescriptionDefault
props vector<DeviceProperty>[256] No default
fragments vector<DeviceFragment>[16] No default
coresident_device_index uint32 No default
metadata vector<DeviceMetadata>[32]? No default

Coordinator_AddCompositeDevice_Response

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescriptionDefault

Coordinator_AddDevice_Response

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescriptionDefault
local_device_id LocalDeviceId No default

Coordinator_AddMetadata_Response

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescriptionDefault

Coordinator_BindDevice_Response

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescriptionDefault

Coordinator_DirectoryWatch_Response

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescriptionDefault

Coordinator_GetMetadataSize_Response

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescriptionDefault
size uint64 No default

Coordinator_GetMetadata_Response

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescriptionDefault
data vector<uint8>[8192] No default

Coordinator_GetTopologicalPath_Response

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescriptionDefault
path string[1024] No default

Coordinator_LoadFirmware_Response

Defined in fuchsia.device.manager/coordinator.fidl

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

Coordinator_MakeVisible_Response

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescriptionDefault

Coordinator_PublishMetadata_Response

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescriptionDefault

Coordinator_RunCompatibilityTests_Response

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescriptionDefault

DeviceController_CompleteRemoval_Response

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescriptionDefault

DeviceController_Unbind_Response

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescriptionDefault

DeviceFragment

Defined in fuchsia.device.manager/coordinator.fidl

A piece of a composite device

NameTypeDescriptionDefault
parts_count uint32 No default
parts [16] No default

DeviceFragmentPart

Defined in fuchsia.device.manager/coordinator.fidl

A part of a description of a DeviceFragment

NameTypeDescriptionDefault
match_program_count uint32 No default
match_program [32] No default

DeviceMetadata

Defined in fuchsia.device.manager/coordinator.fidl

Metadata that can be added to a device

NameTypeDescriptionDefault
key uint32 No default
data vector<uint8>[8192] No default

DeviceProperty

Defined in fuchsia.device.manager/coordinator.fidl

This has the same structure as zx_device_prop_t.

NameTypeDescriptionDefault
id uint16 No default
reserved uint16 No default
value uint32 No default

SystemStateTransition_SetTerminationSystemState_Response

Defined in fuchsia.device.manager/system-state-transition.fidl

NameTypeDescriptionDefault

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

BindDebugger_GetBindProgram_Result

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescription
response BindDebugger_GetBindProgram_Response
err zx/status

BindDebugger_GetDeviceProperties_Result

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescription
response BindDebugger_GetDeviceProperties_Response
err zx/status

Coordinator_AddCompositeDevice_Result

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescription
response Coordinator_AddCompositeDevice_Response
err zx/status

Coordinator_AddDevice_Result

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescription
response Coordinator_AddDevice_Response
err zx/status

Coordinator_AddMetadata_Result

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescription
response Coordinator_AddMetadata_Response
err zx/status

Coordinator_BindDevice_Result

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescription
response Coordinator_BindDevice_Response
err zx/status

Coordinator_DirectoryWatch_Result

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescription
response Coordinator_DirectoryWatch_Response
err zx/status

Coordinator_GetMetadataSize_Result

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescription
response Coordinator_GetMetadataSize_Response
err zx/status

Coordinator_GetMetadata_Result

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescription
response Coordinator_GetMetadata_Response
err zx/status

Coordinator_GetTopologicalPath_Result

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescription
response Coordinator_GetTopologicalPath_Response
err zx/status

Coordinator_LoadFirmware_Result

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescription
response Coordinator_LoadFirmware_Response
err zx/status

Coordinator_MakeVisible_Result

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescription
response Coordinator_MakeVisible_Response
err zx/status

Coordinator_PublishMetadata_Result

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescription
response Coordinator_PublishMetadata_Response
err zx/status

Coordinator_RunCompatibilityTests_Result

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescription
response Coordinator_RunCompatibilityTests_Response
err zx/status

DeviceController_CompleteRemoval_Result

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescription
response DeviceController_CompleteRemoval_Response
err zx/status

DeviceController_Unbind_Result

Defined in fuchsia.device.manager/coordinator.fidl

NameTypeDescription
response DeviceController_Unbind_Response
err zx/status

SystemStateTransition_SetTerminationSystemState_Result

Defined in fuchsia.device.manager/system-state-transition.fidl

NameTypeDescription
response SystemStateTransition_SetTerminationSystemState_Response
err zx/status

BITS

AddDeviceConfig

Type: uint32

Defined in fuchsia.device.manager/coordinator.fidl

Bit flags for device add configuration

NameValueDescription
ALLOW_MULTI_COMPOSITE 1

Device can be a fragment in multiple composite devices

INVISIBLE 2

Device should be marked invisible initially (used for deprecated DEVICE_ADD_INVISIBLE)

SKIP_AUTOBIND 4

Device should not trigger the auto-bind mechanism

CONSTANTS

NameValueTypeDescription
BIND_PROGRAM_INSTRUCTIONS_MAX 256 uint32
DEVICE_ARGS_MAX 1024 uint32

Maximum number of bytes in a device arguments string.

DEVICE_FRAGMENT_PARTS_MAX 16 uint32

Maximum number of parts that a composite device fragment can have

DEVICE_FRAGMENT_PART_INSTRUCTIONS_MAX 32 uint32

Maximum number of instructions in the match program of a device fragment part

DEVICE_NAME_MAX 31 uint32

This definition must match ZX_DEVICE_NAME_MAX and is checked by a static assert.

DEVICE_PATH_MAX 1024 uint32

Maximum number of bytes in a path

FRAGMENTS_MAX 16 uint32

Maximum number of fragments that a composite device can have

METADATA_BYTES_MAX 8192 uint32

Maximum number of bytes in a metadata payload

METADATA_MAX 32 uint32

Maximum number of metadata that can be added to a device

PROPERTIES_MAX 256 uint32

Maximum number of properties that can be attached to a device

SUSPEND_FLAG_MEXEC 3705406208 uint32
SUSPEND_FLAG_POWEROFF 3705405952 uint32
SUSPEND_FLAG_REBOOT 3705405696 uint32

All available suspend flags

SUSPEND_FLAG_REBOOT_BOOTLOADER 3705405697 uint32
SUSPEND_FLAG_REBOOT_RECOVERY 3705405698 uint32
SUSPEND_FLAG_SUSPEND_RAM 3705406464 uint32

TYPE ALIASES

NameValueDescription
LocalDeviceId uint64