• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2019 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 use super::super::host_backend::error::Result;
6 use super::usb_hub::UsbHub;
7 use crate::utils::{EventLoop, FailHandle};
8 use base::RawDescriptor;
9 use std::sync::Arc;
10 
11 /// Xhci backend provider will run on an EventLoop and connect new devices to usb ports.
12 pub trait XhciBackendDeviceProvider: Send {
13     /// Start the provider on EventLoop.
start( &mut self, fail_handle: Arc<dyn FailHandle>, event_loop: Arc<EventLoop>, hub: Arc<UsbHub>, ) -> Result<()>14     fn start(
15         &mut self,
16         fail_handle: Arc<dyn FailHandle>,
17         event_loop: Arc<EventLoop>,
18         hub: Arc<UsbHub>,
19     ) -> Result<()>;
20 
21     /// Keep raw descriptors that should be kept open.
keep_rds(&self) -> Vec<RawDescriptor>22     fn keep_rds(&self) -> Vec<RawDescriptor>;
23 }
24