blob: 8a508c2a2b0690e1b095964ceaad30a1095f897a [file] [log] [blame]
// Copyright 2022 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.driver.compat;
using zx;
type Metadata = resource struct {
type uint32;
data zx.handle:VMO;
};
/// This API communicates with the DFv1 parent device.
protocol Device {
/// Get this device's topological path that it is exporting in /dev.
GetTopologicalPath() -> (struct {
path string:MAX;
});
/// Get all of the metadata associated with this device.
GetMetadata() -> (resource struct {
metadata vector<Metadata>:MAX;
}) error zx.status;
/// Connect to a FIDL protocol that this device is exposing.
/// TODO(fxbug.dev/98844): This should be replaced by routing
/// services instead, and services can be routed directly into the
// incoming namespace.
ConnectFidl(resource struct {
name string:MAX;
server zx.handle:CHANNEL;
}) -> ();
};
/// This represents a service that the compatibility driver will offer to
/// its children, so that DFv1 drivers can communicate with each other.
/// This is a service because a driver will create one instance per device
/// the driver creates. Each child of the driver gets a single instance of
/// this service.
service Service {
device client_end:Device;
};