blob: 88a4024bf9af523051a50387f1fc40d36528fca8 [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.
closed protocol Device {
/// Get this device's topological path that it is exporting in /dev.
strict GetTopologicalPath() -> (struct {
path string:MAX;
});
/// Get all of the metadata associated with this device.
strict GetMetadata() -> (resource struct {
metadata vector<Metadata>:MAX;
}) error zx.Status;
/// Connect to a banjo protocol that this device is exposing.
/// The caller needs to send a copy of their process koid so the callee can verify
/// that both drivers are in the same process.
strict GetBanjoProtocol(struct {
proto_id uint32;
process_koid zx.Koid;
}) -> (struct {
ops uint64;
context uint64;
}) error zx.Status;
};
/// 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;
};