From 1f20497b86985bd927df9c171174a29cf47ce25f Mon Sep 17 00:00:00 2001 From: Zide Chen Date: Tue, 17 Sep 2019 11:31:53 -0700 Subject: devices: implement MsixConfig struct and generic MSI-X functions The MsixConfig struct is responsible for all the operations of MSI-X Capability Structure and MSI-X Table. A msix_config object is created for each virtio device. BUG=chromium:854765 TEST=cargo test -p devices Change-Id: Ide7c34d335d49a201f20b0a4307bcda97d1d61b7 Signed-off-by: Sebastien Boeuf Signed-off-by: Xiong Zhang Signed-off-by: Zide Chen Signed-off-by: Sainath Grandhi Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1828337 Reviewed-by: Daniel Verkamp Tested-by: Daniel Verkamp Commit-Queue: Stephen Barber --- devices/src/virtio/wl.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'devices/src/virtio/wl.rs') diff --git a/devices/src/virtio/wl.rs b/devices/src/virtio/wl.rs index a4988cb..4531511 100644 --- a/devices/src/virtio/wl.rs +++ b/devices/src/virtio/wl.rs @@ -48,6 +48,7 @@ use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::Arc; use std::thread; use std::time::Duration; +use sync::Mutex; #[cfg(feature = "wl-dmabuf")] use libc::{dup, EBADF, EINVAL}; @@ -73,6 +74,7 @@ use super::resource_bridge::*; use super::{ DescriptorChain, Queue, VirtioDevice, INTERRUPT_STATUS_USED_RING, TYPE_WL, VIRTIO_F_VERSION_1, }; +use crate::pci::MsixConfig; use vm_control::{MaybeOwnedFd, VmMemoryControlRequestSocket, VmMemoryRequest, VmMemoryResponse}; const VIRTWL_SEND_MAX_ALLOCS: usize = 28; @@ -1743,6 +1745,7 @@ impl VirtioDevice for Wl { mem: GuestMemory, interrupt_evt: EventFd, interrupt_resample_evt: EventFd, + _msix_config: Option>>, status: Arc, mut queues: Vec, queue_evts: Vec, -- cgit 1.4.1