fuchsia.device

PROTOCOLS

Controller

Defined in fuchsia.device/controller.fidl

Interface for manipulating a device in a devhost

Bind

Attempt to bind the requested driver to this device

Request

NameType
driver string[1024]

Response

NameType
status int32

ScheduleUnbind

Disconnect this device and allow its parent to be bound again. This may not complete before it returns.

Request

NameType

Response

NameType
status int32

GetDriverName

Return the name of the driver managing this the device

Request

NameType

Response

NameType
status int32
name string[32]?

GetDeviceName

Return the name of the device

Request

NameType

Response

NameType
name string[32]

GetTopologicalPath

Return the topological path for this device

Request

NameType

Response

NameType
status int32
path string[1024]?

GetEventHandle

Get an event for monitoring device conditions (see DEVICE_SIGNAL_* constants)

Request

NameType

Response

NameType
status int32
event handle<event>?

GetDriverLogFlags

Return the current logging flags for this device's driver

Request

NameType

Response

NameType
status int32
flags uint32

SetDriverLogFlags

Set the logging flags for this device's driver. Each set bit in clear_flags will be cleared in the log flags state. Each set bit in set_flags will then be set in the log flags state.

Request

NameType
clear_flags uint32
set_flags uint32

Response

NameType
status int32

DebugSuspend

Debug command: execute the device's suspend hook

Request

NameType

Response

NameType
status int32

DebugResume

Debug command: execute the device's resume hook

Request

NameType

Response

NameType
status int32

RunCompatibilityTests

Runs 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 driver passed the compatibility check.

Request

NameType
hook_wait_time int64

Response

NameType
status uint32

GetDevicePowerCaps

Gets the device power capabilities. Used by the system wide power manager to manage power for this device.

Request

NameType

Response

NameType
result Controller_GetDevicePowerCaps_Result

NameProvider

Defined in fuchsia.device/name-provider.fidl

Interface for getting device names.

GetDeviceName

Return the name of this Fuchsia device.

Request

NameType

Response

NameType
result NameProvider_GetDeviceName_Result

STRUCTS

Controller_GetDevicePowerCaps_Response

generated

NameTypeDescriptionDefault
dpstates [5] No default

DevicePowerStateInfo

Defined in fuchsia.device/controller.fidl

NameTypeDescriptionDefault
state_id DevicePowerState No default
is_supported bool Is this state supported? No default
restore_latency int64 Restore time for coming out of this state to working D0 state. No default
wakeup_capable bool Is this device wakeup_capable? No default
system_wake_state int32 Deepest system system sleep state that the device can wake the system from. No default

NameProvider_GetDeviceName_Response

generated

NameTypeDescriptionDefault
name string No default

ENUMS

DevicePowerState

Type: uint8

Defined in fuchsia.device/controller.fidl

NameValueDescription
DEVICE_POWER_STATE_D0 0
DEVICE_POWER_STATE_D1 1
DEVICE_POWER_STATE_D2 2
DEVICE_POWER_STATE_D3HOT 3
DEVICE_POWER_STATE_D3COLD 4

UNIONS

Controller_GetDevicePowerCaps_Result

generated

NameTypeDescription
response Controller_GetDevicePowerCaps_Response
err int32

NameProvider_GetDeviceName_Result

generated

NameTypeDescription
response NameProvider_GetDeviceName_Response
err int32

CONSTANTS

NameValueTypeDescription
MAX_DEVICE_NAME_LEN 32 uint64 Maxmium length for a device name
MAX_DEVICE_PATH_LEN 1024 uint64 Maximum length of a device path
MAX_DRIVER_NAME_LEN 32 uint64 Maxmium length for a driver name
MAX_DRIVER_PATH_LEN 1024 uint64 Maximum length for a driver path
MAX_DEVICE_POWER_STATES 5 uint32 Maximum device power states. In future this should account for performant states.
MIN_DEVICE_POWER_STATES 2 uint32
DEVICE_SIGNAL_READABLE 16777216 uint32 Signal that will be active on a device event handle if the device's read() method will return data.
DEVICE_SIGNAL_OOB 33554432 uint32 Signal that will be active on a device event handle if the device has some out-of-band mechanism that needs attention. This is primarily used by the PTY support.
DEVICE_SIGNAL_WRITABLE 67108864 uint32 Signal that will be active on a device event handle if the device's write() method will accept data.
DEVICE_SIGNAL_ERROR 134217728 uint32 Signal that will be active on a device event handle if the device has encountered an error. This is primarily used by the PTY support.
DEVICE_SIGNAL_HANGUP 268435456 uint32 Signal that will be active on a device event handle if the device has been disconnected. This is primarily used by the PTY support.
DEFAULT_DEVICE_NAME fuchsia String