|  | // 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; | 
|  |  | 
|  | /// A list of all the node names for this composite driver (optional). | 
|  | /// These are ordered according to index. | 
|  | 6: composite_node_names vector<string:MAX>:MAX; | 
|  |  | 
|  | /// The name of the composite device that is created (optional). | 
|  | 5: composite_name string:MAX; | 
|  |  | 
|  | /// 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; | 
|  |  | 
|  | /// If this is true then the driver should be colocated in its parent's DriverHost. | 
|  | 7: colocate bool; | 
|  | }; | 
|  |  | 
|  | /// 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; | 
|  | }; |