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

UpdatePowerStateMapping

Updates the mapping between system power states to device power states. Used by the system wide power manager to manage power for this device

Request

NameType
mapping [7]

Response

NameType
result Controller_UpdatePowerStateMapping_Result

GetPowerStateMapping

Get the mapping between system power states to device power states. Used by the system wide power manager to manage power for this device.

Request

NameType

Response

NameType
result Controller_GetPowerStateMapping_Result

Suspend

Transition this device from a working to a sleep state or from a sleep state to a deeper sleep state.

Request

NameType
requested_state DevicePowerState

Response

NameType
status int32
out_state DevicePowerState

Resume

Transition this device from a sleep state to a working state.

Request

NameType
requested_state DevicePowerState

Response

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

Controller_UpdatePowerStateMapping_Response

generated

NameTypeDescriptionDefault

Controller_GetPowerStateMapping_Response

generated

NameTypeDescriptionDefault
mapping [7] No default

Controller_Resume_Response

generated

NameTypeDescriptionDefault
out_state DevicePowerState 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

SystemPowerStateInfo

Defined in fuchsia.device/controller.fidl

NameTypeDescriptionDefault
suspend_flag uint32 No default
wakeup_enable bool Should wakeup be enabled from this system state? No default
dev_state DevicePowerState Device power state that the device should be in for this system power state. No default

NameProvider_GetDeviceName_Response

generated

NameTypeDescriptionDefault
name string[255] No default

ENUMS

DevicePowerState

Type: uint8

Defined in fuchsia.device/controller.fidl

NameValueDescription
DEVICE_POWER_STATE_D0 0 Mandatory Working state. Device is fully functional, can take I/O, issue interrrupts. This state is mandatory for all devices The device enters into this state by default, when powered on.
DEVICE_POWER_STATE_D1 1 [OPTIONAL] Device is not working when in this state. It cannot process I/O nor issue interrupts, unless it is armed for some special interrupts that can wake up the system/device. When in this state, the restore time of getting back to working state is less than other low-power states Power savings in this state are lesser than other low power states. Device may retain some hardware context and full initialization may not be needed when resuming from this state.
DEVICE_POWER_STATE_D2 2 [OPTIONAL] Device is not working when in this state. It cannot process I/O nor issue interrupts, unless it is armed for some special interrupts that can wake up the system/device. When in this state, the restore time of getting back to working state is more than DEVICE_POWER_STATE_D1 and less than restore time of getting back from DEVICE_POWER_STATE_D3HOT, DEVICE_POWER_STATE_D3COLD. Power savings in this state are lesser than DEVICE_POWER_STATE_D3COLD, DEVICE_POWER_STATE_D3HOT. Device may retain some hardware context and full initialization may not be needed when resuming from this state.
DEVICE_POWER_STATE_D3HOT 3 [OPTIONAL] Device is not working when in this state. It cannot process I/O nor issue interrupts, unless it is armed for some special interrupts that can wake up the system/device. When in this state, the restore time of getting back to working state is more than DEVICE_POWER_STATE_D1, DEVICE_POWER_STATE_D3HOT and less than restore time of getting back from DEVICE_POWER_STATE_D3COLD. Power savings in this state are lesser than DEVICE_POWER_STATE_D3COLD. Device has no context and full initialization by the device driver when resuming from this state. Although the device is completely off, it is still powered on and is enumerable.
DEVICE_POWER_STATE_D3COLD 4 [MANDATORY] Device is not working when in this state. It cannot process I/O nor issue interrupts, unless it is armed for some special interrupts that can wake up the system/device. When in this state, the restore time of getting back to working state is more than all other low power states. Power savings are more compared to all other low-power states. Device has no context and full initialization by the device driver when resuming from this state. In this state, the power to this device is turned off. Device may be powered by other auxiliary supplies to support wake capability.

UNIONS

Controller_GetDevicePowerCaps_Result

generated

NameTypeDescription
response Controller_GetDevicePowerCaps_Response
err int32

Controller_UpdatePowerStateMapping_Result

generated

NameTypeDescription
response Controller_UpdatePowerStateMapping_Response
err int32

Controller_GetPowerStateMapping_Result

generated

NameTypeDescription
response Controller_GetPowerStateMapping_Response
err int32

Controller_Resume_Result

generated

NameTypeDescription
response Controller_Resume_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
DEVICE_NAME_MAX 255 uint32 Maximum length of a device name (without a null byte), based on HOST_NAME_MAX as defined by .