| // Copyright 2020 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.framework; |
| |
| using fuchsia.url; |
| |
| using zx; |
| |
| /// Driver matched by the driver index. |
| type MatchedDriver = table { |
| /// URL of the driver component. |
| 1: url string:fuchsia.url.MAX_URL_LENGTH; |
| |
| /// Node index for a composite driver (optional). |
| 2: node_index uint32; |
| |
| /// Total number of nodes for a composite driver (optional). |
| 3: num_nodes uint32; |
| |
| /// URL of the driver library. |
| /// This should only be used by DriverManager before Drivers-As-Components. |
| 4: driver_url string:fuchsia.url.MAX_URL_LENGTH; |
| }; |
| |
| /// Protocol through which the driver index can be queried. |
| @discoverable |
| protocol DriverIndex { |
| /// Match a set of device arguments to a driver package URL. |
| MatchDriver(struct { |
| args NodeAddArgs; |
| }) -> (struct { |
| driver MatchedDriver; |
| }) error zx.status; |
| |
| /// This function will block until base drivers are loaded. |
| WaitForBaseDrivers() -> (); |
| |
| // TODO(fxbug.dev/81175): Remove V1 APIs |
| /// This function returns a vector of drivers that match a device. |
| /// This should only be used by DFv1 and should be removed. |
| /// If more than MAX drivers match, only MAX drivers will be returned. |
| MatchDriversV1(struct { |
| args NodeAddArgs; |
| }) -> (struct { |
| drivers vector<MatchedDriver>:MAX; |
| }) error zx.status; |
| }; |