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

UnregisterSystemStorageForShutdown

This is a temporary API until DriverManager can ensure that base drivers will be shut down automatically before fshost exits. This will happen once drivers-as-components is implemented. In the meantime, this API should only be called by fshost, and it must be called before fshost exits. This function iterates over the devices and suspends any device whose driver lives in storage. This API must be called by fshost before it shuts down. Otherwise the devices that live in storage may page fault as it access memory that should be provided by the exited fshost. This function will not return until the devices are suspended. If there are no devices that live in storage, this function will immediatetly return.

Request

<EMPTY>

Response

NameType
status zx/status

Coordinator

Defined in fuchsia.device.manager/coordinator.fidl

Interface for drivers in driver host to coordinate with the driver manager.

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
property_list DevicePropertyList
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>?
outgoing_dir fuchsia.io/Directory?

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

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

<EMPTY>

Response

NameType
result Coordinator_GetTopologicalPath_Result

LoadFirmware

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

Request

NameType
driver_path string[1024]
fw_path string[1024]

Response

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

<EMPTY>

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

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>?

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

<EMPTY>

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

<EMPTY>

Response

NameType
status zx/status

Open

See fuchsia.io.Directory/Open for information.

Request

NameType
flags uint32
mode uint32
path string[4096]
object request<fuchsia.io/Node>

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

<EMPTY>

Response

NameType
result DeviceController_Unbind_Result

DeviceWatcher

Defined in fuchsia.device.manager/device-watcher.fidl

This protocol represents watching a specific class of devices. Each client that connects will be able to poll NextDevice to be able to get all devices.

NextDevice

A Hanging-Get API that returns the next device. This will not return until there is a new device available. Call this repeatedly to get all devices. If there is already an outstanding request then calling this again will return ZX_ERR_ALREADY_BOUND.

Request

<EMPTY>

Response

NameType
result DeviceWatcher_NextDevice_Result

DriverHostController

Defined in fuchsia.device.manager/coordinator.fidl

Protocol for controlling a driver host process from the driver manager

CreateDevice

Create a device in the driver host. |type| describes what type of device is set up, how it communicates with it's parent (if it has one).

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

Request

NameType
coordinator Coordinator
device_controller request<DeviceController>
type DeviceType
local_device_id LocalDeviceId

Response

NameType
status zx/status

Restart

Request to restart the driver host. Also restarts all children devices and drivers and rebinds them once the Driver Host has restarted.

Request

<EMPTY>

Response

NameType
status zx/status

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

BindInstruction

Defined in fuchsia.device.manager/coordinator.fidl

FieldTypeDescriptionDefault
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

CompositeDevice

Defined in fuchsia.device.manager/coordinator.fidl

FieldTypeDescriptionDefault
fragments vector<Fragment>[16] No default
name string[31] No default

CompositeDeviceDescriptor

Defined in fuchsia.device.manager/coordinator.fidl

Composite device parts and properties

FieldTypeDescriptionDefault
props vector<DeviceProperty>[256] No default
str_props vector<DeviceStrProperty>[256] No default
fragments vector<DeviceFragment>[16] No default
primary_fragment_index uint32 No default
spawn_colocated bool No default
metadata vector<DeviceMetadata>[32]? No default

Coordinator_AddCompositeDevice_Response

Defined in fuchsia.device.manager/coordinator.fidl

<EMPTY>

Coordinator_AddDevice_Response

Defined in fuchsia.device.manager/coordinator.fidl

FieldTypeDescriptionDefault
local_device_id LocalDeviceId No default

Coordinator_AddMetadata_Response

Defined in fuchsia.device.manager/coordinator.fidl

<EMPTY>

Coordinator_BindDevice_Response

Defined in fuchsia.device.manager/coordinator.fidl

<EMPTY>

Coordinator_GetMetadataSize_Response

Defined in fuchsia.device.manager/coordinator.fidl

FieldTypeDescriptionDefault
size uint64 No default

Coordinator_GetMetadata_Response

Defined in fuchsia.device.manager/coordinator.fidl

FieldTypeDescriptionDefault
data vector<uint8>[8192] No default

Coordinator_GetTopologicalPath_Response

Defined in fuchsia.device.manager/coordinator.fidl

FieldTypeDescriptionDefault
path string[1024] No default

Coordinator_LoadFirmware_Response resource

Defined in fuchsia.device.manager/coordinator.fidl

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

Coordinator_RunCompatibilityTests_Response

Defined in fuchsia.device.manager/coordinator.fidl

FieldTypeDescriptionDefault
status CompatibilityTestStatus No default

DeviceController_CompleteRemoval_Response

Defined in fuchsia.device.manager/coordinator.fidl

<EMPTY>

DeviceController_Unbind_Response

Defined in fuchsia.device.manager/coordinator.fidl

<EMPTY>

DeviceFragment

Defined in fuchsia.device.manager/coordinator.fidl

A piece of a composite device

FieldTypeDescriptionDefault
name string[32] No default
parts vector<DeviceFragmentPart>[16] No default

DeviceFragmentPart

Defined in fuchsia.device.manager/coordinator.fidl

A part of a description of a DeviceFragment

FieldTypeDescriptionDefault
match_program vector<BindInstruction>[32] No default

DeviceMetadata

Defined in fuchsia.device.manager/coordinator.fidl

Metadata that can be added to a device

FieldTypeDescriptionDefault
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.

FieldTypeDescriptionDefault
id uint16 No default
reserved uint16 No default
value uint32 No default

DevicePropertyList

Defined in fuchsia.device.manager/coordinator.fidl

FieldTypeDescriptionDefault
props vector<DeviceProperty>[256] No default
str_props vector<DeviceStrProperty>[256] No default

DeviceStrProperty

Defined in fuchsia.device.manager/coordinator.fidl

FieldTypeDescriptionDefault
key string[255] No default
value PropertyValue No default

DeviceWatcher_NextDevice_Response resource

Defined in fuchsia.device.manager/device-watcher.fidl

FieldTypeDescriptionDefault
device handle<channel> No default

Fragment

Defined in fuchsia.device.manager/coordinator.fidl

FieldTypeDescriptionDefault
name string[32] No default
id LocalDeviceId No default

NewProxyDevice resource

Defined in fuchsia.device.manager/coordinator.fidl

FieldTypeDescriptionDefault
incoming_dir fuchsia.io/Directory No default

ProxyDevice resource

Defined in fuchsia.device.manager/coordinator.fidl

FieldTypeDescriptionDefault
driver_path string[1024] No default
driver handle<vmo> No default
parent_proxy handle<channel> No default
proxy_args string[1024]? No default

StubDevice

Defined in fuchsia.device.manager/coordinator.fidl

FieldTypeDescriptionDefault
protocol_id uint32 No default

SystemStateTransition_SetTerminationSystemState_Response

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

<EMPTY>

ENUMS

CompatibilityTestStatus strict

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_AddCompositeDevice_Result strict

Defined in fuchsia.device.manager/coordinator.fidl

Ordinal
VariantTypeDescription
1 response Coordinator_AddCompositeDevice_Response
2 err zx/status

Coordinator_AddDevice_Result strict

Defined in fuchsia.device.manager/coordinator.fidl

Ordinal
VariantTypeDescription
1 response Coordinator_AddDevice_Response
2 err zx/status

Coordinator_AddMetadata_Result strict

Defined in fuchsia.device.manager/coordinator.fidl

Ordinal
VariantTypeDescription
1 response Coordinator_AddMetadata_Response
2 err zx/status

Coordinator_BindDevice_Result strict

Defined in fuchsia.device.manager/coordinator.fidl

Ordinal
VariantTypeDescription
1 response Coordinator_BindDevice_Response
2 err zx/status

Coordinator_GetMetadataSize_Result strict

Defined in fuchsia.device.manager/coordinator.fidl

Ordinal
VariantTypeDescription
1 response Coordinator_GetMetadataSize_Response
2 err zx/status

Coordinator_GetMetadata_Result strict

Defined in fuchsia.device.manager/coordinator.fidl

Ordinal
VariantTypeDescription
1 response Coordinator_GetMetadata_Response
2 err zx/status

Coordinator_GetTopologicalPath_Result strict

Defined in fuchsia.device.manager/coordinator.fidl

Ordinal
VariantTypeDescription
1 response Coordinator_GetTopologicalPath_Response
2 err zx/status

Coordinator_LoadFirmware_Result strict resource

Defined in fuchsia.device.manager/coordinator.fidl

Ordinal
VariantTypeDescription
1 response Coordinator_LoadFirmware_Response
2 err zx/status

Coordinator_RunCompatibilityTests_Result strict

Defined in fuchsia.device.manager/coordinator.fidl

Ordinal
VariantTypeDescription
1 response Coordinator_RunCompatibilityTests_Response
2 err zx/status

DeviceController_CompleteRemoval_Result strict

Defined in fuchsia.device.manager/coordinator.fidl

Ordinal
VariantTypeDescription
1 response DeviceController_CompleteRemoval_Response
2 err zx/status

DeviceController_Unbind_Result strict

Defined in fuchsia.device.manager/coordinator.fidl

Ordinal
VariantTypeDescription
1 response DeviceController_Unbind_Response
2 err zx/status

DeviceType flexible resource

Defined in fuchsia.device.manager/coordinator.fidl

Ordinal
VariantTypeDescription
1 stub StubDevice

The device has no parent to communicate with and no driver to load.

2 proxy ProxyDevice

The device acts as a proxy for it's parent and talks to it via it's proxy channel.

3 new_proxy NewProxyDevice

The parent device lives in another driver host, and provides a directory of protocols. This will replace ProxyDevice eventually.

4 composite CompositeDevice

The device is a composite device with several parents, referred to as fragments. The device aggregates all parent devices together. The order of the fragments will match the original composite creation request.

DeviceWatcher_NextDevice_Result strict resource

Defined in fuchsia.device.manager/device-watcher.fidl

Ordinal
VariantTypeDescription
1 response DeviceWatcher_NextDevice_Response
2 err zx/status

PropertyValue strict

Defined in fuchsia.device.manager/coordinator.fidl

Ordinal
VariantTypeDescription
1 int_value uint32
2 str_value string[255]
3 bool_value bool

SystemStateTransition_SetTerminationSystemState_Result strict

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

Ordinal
VariantTypeDescription
1 response SystemStateTransition_SetTerminationSystemState_Response
2 err zx/status

BITS

AddDeviceConfig strict

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

SKIP_AUTOBIND 4

Device should not trigger the auto-bind mechanism

CONSTANTS

NameValueTypeDescription
BIND_RULES_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

FRAGMENT_NAME_MAX 32 uint32
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

STR_LENGTH_MAX 255 uint32

Maximum length of a string property key and value.

STR_PROPERTIES_MAX 256 uint32

Maximum number of string 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