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
result Controller_Bind_Result

Rebind

This api will unbind all the children of this device and bind the requested driver. If the driver is empty, it will autobind. The Rebind will not return until the bind completes.

Request

NameType
driver string[1024]

Response

NameType
result Controller_Rebind_Result

ScheduleUnbind

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

Request

NameType

Response

NameType
result Controller_ScheduleUnbind_Result

GetDriverName

Return the name of the driver managing this the device

Request

NameType

Response

NameType
status zx/status
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
result Controller_GetTopologicalPath_Result

GetEventHandle

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

Request

NameType

Response

NameType
status zx/status
event handle<event>?

GetDriverLogFlags

Return the current logging flags for this device's driver

Request

NameType

Response

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

DebugSuspend

Debug command: execute the device's suspend hook

Request

NameType

Response

NameType
status zx/status

DebugResume

Debug command: execute the device's resume hook

Request

NameType

Response

NameType
status zx/status

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

GetDevicePerformanceStates

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

Request

NameType

Response

NameType
states [20]
status zx/status

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

SetPerformanceState

Set the performance state of this device to the requested performance state. This is only called for the current device and none of the descendants are aware of the state transition. On success, the out_state and the requested_state is same. If the device is in a working state, the performance state will be changed to requested_state immediately. If the device is in non-working state, the performance state will be the requested_state whenever the device transitions to working state. On failure, the out_state will have the state that the device can go into.

Request

NameType
requested_state uint32

Response

NameType
status zx/status
out_state uint32

ConfigureAutoSuspend

Configure autosuspend of device to this deepest sleep state.

Request

NameType
enable bool
requested_deepest_sleep_state DevicePowerState

Response

NameType
status zx/status

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_Bind_Response

generated

NameTypeDescriptionDefault

Controller_Rebind_Response

generated

NameTypeDescriptionDefault

Controller_ScheduleUnbind_Response

generated

NameTypeDescriptionDefault

Controller_GetTopologicalPath_Response

generated

NameTypeDescriptionDefault
path string[1024] No default

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

DevicePerformanceStateInfo

Defined in fuchsia.device/controller.fidl

Performance state info for a device. A performance state is relevant only when the device is in non-sleeping working device power state.

NameTypeDescriptionDefault
state_id int32 No default
restore_latency int64

Restore time for coming out of this state to fully working performance state.

No default
is_supported bool

Is this state supported?

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_Bind_Result

generated

NameTypeDescription
response Controller_Bind_Response
err zx/status

Controller_Rebind_Result

generated

NameTypeDescription
response Controller_Rebind_Response
err zx/status

Controller_ScheduleUnbind_Result

generated

NameTypeDescription
response Controller_ScheduleUnbind_Response
err zx/status

Controller_GetTopologicalPath_Result

generated

NameTypeDescription
response Controller_GetTopologicalPath_Response
err zx/status

Controller_GetDevicePowerCaps_Result

generated

NameTypeDescription
response Controller_GetDevicePowerCaps_Response
err zx/status

Controller_UpdatePowerStateMapping_Result

generated

NameTypeDescription
response Controller_UpdatePowerStateMapping_Response
err zx/status

Controller_GetPowerStateMapping_Result

generated

NameTypeDescription
response Controller_GetPowerStateMapping_Response
err zx/status

Controller_Resume_Result

generated

NameTypeDescription
response Controller_Resume_Response
err zx/status

NameProvider_GetDeviceName_Result

generated

NameTypeDescription
response NameProvider_GetDeviceName_Response
err zx/status

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 performance states.

MIN_DEVICE_POWER_STATES 2 uint32
MAX_DEVICE_PERFORMANCE_STATES 20 uint32
MIN_DEVICE_PERFORMANCE_STATES 1 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.

DEVICE_PERFORMANCE_STATE_P0 0 uint32

[MANDATORY] Default performance state when the device is in DEVICE_POWER_STATE_D0

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 <limits.h>.