diff options
author | Tomasz Jeznach <tjeznach@chromium.org> | 2020-04-29 12:58:11 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-05-01 05:49:39 +0000 |
commit | da0e0f939b731d89d067fb9382bbdc05e47f4067 (patch) | |
tree | 1233cb599fb9aa82c004f77a42692a0fd8728b62 /devices/src/pci/pci_device.rs | |
parent | a4dd4af5de2d260b307eff873f5c5eb194f4ba57 (diff) | |
download | crosvm-da0e0f939b731d89d067fb9382bbdc05e47f4067.tar crosvm-da0e0f939b731d89d067fb9382bbdc05e47f4067.tar.gz crosvm-da0e0f939b731d89d067fb9382bbdc05e47f4067.tar.bz2 crosvm-da0e0f939b731d89d067fb9382bbdc05e47f4067.tar.lz crosvm-da0e0f939b731d89d067fb9382bbdc05e47f4067.tar.xz crosvm-da0e0f939b731d89d067fb9382bbdc05e47f4067.tar.zst crosvm-da0e0f939b731d89d067fb9382bbdc05e47f4067.zip |
devices: pci: refactor PCI devices to use PciAddress.
Simple refactor of PCI device addressing to use PciAddress type providing bus:device.function number. BUG=None TEST=build_test & tast run crostini.Sanity Change-Id: I7755ad6b31aa8c882475cd8212630e1cc86ef49e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2172766 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Tomasz Jeznach <tjeznach@chromium.org>
Diffstat (limited to 'devices/src/pci/pci_device.rs')
-rw-r--r-- | devices/src/pci/pci_device.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/devices/src/pci/pci_device.rs b/devices/src/pci/pci_device.rs index 2f74ea1..244edbd 100644 --- a/devices/src/pci/pci_device.rs +++ b/devices/src/pci/pci_device.rs @@ -10,7 +10,7 @@ use resources::{Error as SystemAllocatorFaliure, SystemAllocator}; use sys_util::EventFd; use crate::pci::pci_configuration; -use crate::pci::PciInterruptPin; +use crate::pci::{PciAddress, PciInterruptPin}; use crate::BusDevice; #[derive(Debug)] @@ -48,8 +48,8 @@ impl Display for Error { pub trait PciDevice: Send { /// Returns a label suitable for debug output. fn debug_label(&self) -> String; - /// Assign a unique bus and device number to this device. - fn assign_bus_dev(&mut self, _bus: u8, _device: u8 /*u5*/) {} + /// Assign a unique bus, device and function number to this device. + fn assign_address(&mut self, _address: PciAddress) {} /// A vector of device-specific file descriptors that must be kept open /// after jailing. Must be called before the process is jailed. fn keep_fds(&self) -> Vec<RawFd>; @@ -148,8 +148,8 @@ impl<T: PciDevice + ?Sized> PciDevice for Box<T> { fn debug_label(&self) -> String { (**self).debug_label() } - fn assign_bus_dev(&mut self, bus: u8, device: u8 /*u5*/) { - (**self).assign_bus_dev(bus, device) + fn assign_address(&mut self, address: PciAddress) { + (**self).assign_address(address) } fn keep_fds(&self) -> Vec<RawFd> { (**self).keep_fds() |