pub enum CoordinatorRequest {
AddDevice {
args: AddDeviceArgs,
coordinator: ServerEnd<CoordinatorMarker>,
device_controller: ClientEnd<DeviceControllerMarker>,
inspect: Option<Vmo>,
outgoing_dir: Option<ClientEnd<DirectoryMarker>>,
responder: CoordinatorAddDeviceResponder,
},
ScheduleRemove {
unbind_self: bool,
control_handle: CoordinatorControlHandle,
},
ScheduleUnbindChildren {
responder: CoordinatorScheduleUnbindChildrenResponder,
},
BindDevice {
driver_url_suffix: Option<String>,
responder: CoordinatorBindDeviceResponder,
},
GetTopologicalPath {
responder: CoordinatorGetTopologicalPathResponder,
},
LoadFirmware {
driver_path: String,
fw_path: String,
responder: CoordinatorLoadFirmwareResponder,
},
GetMetadata {
key: u32,
responder: CoordinatorGetMetadataResponder,
},
GetMetadataSize {
key: u32,
responder: CoordinatorGetMetadataSizeResponder,
},
AddMetadata {
key: u32,
data: Option<Vec<u8>>,
responder: CoordinatorAddMetadataResponder,
},
AddCompositeDevice {
name: String,
comp_desc: CompositeDeviceDescriptor,
responder: CoordinatorAddCompositeDeviceResponder,
},
AddCompositeNodeSpec {
name: String,
spec: CompositeNodeSpecDescriptor,
responder: CoordinatorAddCompositeNodeSpecResponder,
},
ConnectFidlProtocol {
fragment_name: Option<String>,
service_name: Option<String>,
protocol_name: String,
server: Channel,
responder: CoordinatorConnectFidlProtocolResponder,
},
}
Expand description
Interface for drivers in driver host to coordinate with the driver manager.
Variants§
AddDevice
Fields
args: AddDeviceArgs
coordinator: ServerEnd<CoordinatorMarker>
device_controller: ClientEnd<DeviceControllerMarker>
responder: CoordinatorAddDeviceResponder
Record the addition of a new device that can be communicated with via device_controller
.
On success, the returned local_device_id
is the identifier assigned by devmgr.
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.
ScheduleUnbindChildren
Fields
responder: CoordinatorScheduleUnbindChildrenResponder
Requests the devcoordinator schedule the unbinding of this device’s children.
If the device has no children, no request will be sent, and has_children
will be false.
BindDevice
Attempt to bind a driver against this device.
- request
driver_url_suffix
only driver’s that match this URL suffix will try to bind to the device (e.g: “fvm.cm”). If this is null, the API will autobind.
- error
ZX_ERR_ALREADY_BOUND
if the device is already bound. - error
ZX_ERR_NOT_FOUND
no drivers were found.
GetTopologicalPath
Fields
responder: CoordinatorGetTopologicalPathResponder
Returns the topological path of this device.
LoadFirmware
Requests that the firmware at the given path be loaded and returned.
GetMetadata
Retrieve the metadata blob associated with this device and the given key.
GetMetadataSize
Retrieve the metadata size associated with this device and the given key.
AddMetadata
Add metadata blob associated with this device and the given key. If the same key is specified multiple times, the new data will be ignored in favor of the data from first call with the specified key.
AddCompositeDevice
Adds the given composite device. This causes the driver manager 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.
AddCompositeNodeSpec
Fields
responder: CoordinatorAddCompositeNodeSpecResponder
Adds the given composite node spec. This causes the driver manager to add the spec to the driver index, and then try to match the parents against the node topology. All device additions will be monitored to see if they matched to the remaining unbound nodes.
ConnectFidlProtocol
Connects the given FIDL protocol inside of a FIDL service. Connection is completed
asynchronously due to pipelining. Returning ZX_OK
does not imply the service exists. A
two way call to the service via the retained client end of the channel pair must be issued
in order to ascertain whether the connection has been successfully established.
- |fragment_name| should be specified if the parent is a composite node.
- |service_name| should be specified if attempting to connect to a service. This will be mandatory in the future: http://fxbug.dev/107155.
- error Reports
ZX_ERR_UNAVAILABLE
if the parent (or fragment) does not have an outgoing directory. - error Reports
ZX_ERR_NOT_FOUND
if |fragment_name| is not the name of a parent. - error Reports
ZX_ERR_NOT_SUPPORTED
if |fragment_name| is specified by the device is not a composite node
Implementations§
source§impl CoordinatorRequest
impl CoordinatorRequest
pub fn into_add_device( self ) -> Option<(AddDeviceArgs, ServerEnd<CoordinatorMarker>, ClientEnd<DeviceControllerMarker>, Option<Vmo>, Option<ClientEnd<DirectoryMarker>>, CoordinatorAddDeviceResponder)>
pub fn into_schedule_remove(self) -> Option<(bool, CoordinatorControlHandle)>
pub fn into_schedule_unbind_children( self ) -> Option<CoordinatorScheduleUnbindChildrenResponder>
pub fn into_bind_device( self ) -> Option<(Option<String>, CoordinatorBindDeviceResponder)>
pub fn into_get_topological_path( self ) -> Option<CoordinatorGetTopologicalPathResponder>
pub fn into_load_firmware( self ) -> Option<(String, String, CoordinatorLoadFirmwareResponder)>
pub fn into_get_metadata(self) -> Option<(u32, CoordinatorGetMetadataResponder)>
pub fn into_get_metadata_size( self ) -> Option<(u32, CoordinatorGetMetadataSizeResponder)>
pub fn into_add_metadata( self ) -> Option<(u32, Option<Vec<u8>>, CoordinatorAddMetadataResponder)>
pub fn into_add_composite_device( self ) -> Option<(String, CompositeDeviceDescriptor, CoordinatorAddCompositeDeviceResponder)>
pub fn into_add_composite_node_spec( self ) -> Option<(String, CompositeNodeSpecDescriptor, CoordinatorAddCompositeNodeSpecResponder)>
pub fn into_connect_fidl_protocol( self ) -> Option<(Option<String>, Option<String>, String, Channel, CoordinatorConnectFidlProtocolResponder)>
sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL