From fdb9ea816b99077b320657afadbb6d3fc192c10f Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sat, 15 Jun 2024 15:05:42 +0200 Subject: [PATCH] pcid: Rename PcidServerHandle to PciFunctionHandle --- audio/ac97d/src/main.rs | 4 ++-- audio/ihdad/src/main.rs | 8 ++++---- graphics/bgad/src/main.rs | 4 ++-- graphics/virtio-gpud/src/main.rs | 4 ++-- net/e1000d/src/main.rs | 4 ++-- net/ixgbed/src/main.rs | 4 ++-- net/rtl8139d/src/main.rs | 8 ++++---- net/rtl8168d/src/main.rs | 8 ++++---- net/virtio-netd/src/main.rs | 4 ++-- pcid/src/driver_interface/mod.rs | 4 ++-- storage/ahcid/src/main.rs | 4 ++-- storage/ided/src/main.rs | 4 ++-- storage/nvmed/src/main.rs | 8 ++++---- storage/nvmed/src/nvme/mod.rs | 6 +++--- storage/virtio-blkd/src/main.rs | 2 +- vboxd/src/main.rs | 4 ++-- virtio-core/src/arch/x86_64.rs | 4 ++-- virtio-core/src/probe.rs | 4 ++-- xhcid/src/main.rs | 8 ++++---- xhcid/src/xhci/mod.rs | 6 +++--- 20 files changed, 51 insertions(+), 51 deletions(-) diff --git a/audio/ac97d/src/main.rs b/audio/ac97d/src/main.rs index bbc6143b46..846a8af1a0 100644 --- a/audio/ac97d/src/main.rs +++ b/audio/ac97d/src/main.rs @@ -14,7 +14,7 @@ use std::usize; use event::{user_data, EventQueue}; use libredox::flag; -use pcid_interface::{PciBar, PcidServerHandle}; +use pcid_interface::{PciBar, PciFunctionHandle}; use redox_log::{OutputBuilder, RedoxLogger}; use syscall::{EventFlags, Packet, SchemeBlockMut}; @@ -66,7 +66,7 @@ fn setup_logging() -> Option<&'static RedoxLogger> { fn main() { let mut pcid_handle = - PcidServerHandle::connect_default().expect("ac97d: failed to setup channel to pcid"); + PciFunctionHandle::connect_default().expect("ac97d: failed to setup channel to pcid"); let pci_config = pcid_handle .fetch_config() .expect("ac97d: failed to fetch config"); diff --git a/audio/ihdad/src/main.rs b/audio/ihdad/src/main.rs index a8e6aa4ef3..a7ba09d801 100755 --- a/audio/ihdad/src/main.rs +++ b/audio/ihdad/src/main.rs @@ -16,7 +16,7 @@ use std::cell::RefCell; use std::sync::Arc; use event::{user_data, EventQueue}; -use pcid_interface::{MsiSetFeatureInfo, PcidServerHandle, PciFeature, PciFeatureInfo, SetFeatureInfo}; +use pcid_interface::{MsiSetFeatureInfo, PciFunctionHandle, PciFeature, PciFeatureInfo, SetFeatureInfo}; #[cfg(target_arch = "x86_64")] use pcid_interface::irq_helpers::allocate_single_interrupt_vector_for_msi; use pcid_interface::irq_helpers::read_bsp_apic_id; @@ -76,7 +76,7 @@ fn setup_logging() -> Option<&'static RedoxLogger> { } #[cfg(target_arch = "x86_64")] -fn get_int_method(pcid_handle: &mut PcidServerHandle) -> File { +fn get_int_method(pcid_handle: &mut PciFunctionHandle) -> File { let pci_config = pcid_handle.fetch_config().expect("ihdad: failed to fetch config"); let all_pci_features = pcid_handle.fetch_all_features().expect("ihdad: failed to fetch pci features"); @@ -121,7 +121,7 @@ fn get_int_method(pcid_handle: &mut PcidServerHandle) -> File { //TODO: MSI on non-x86_64? #[cfg(not(target_arch = "x86_64"))] -fn get_int_method(pcid_handle: &mut PcidServerHandle) -> File { +fn get_int_method(pcid_handle: &mut PciFunctionHandle) -> File { let pci_config = pcid_handle.fetch_config().expect("ihdad: failed to fetch config"); if let Some(irq) = pci_config.func.legacy_interrupt_line { @@ -135,7 +135,7 @@ fn get_int_method(pcid_handle: &mut PcidServerHandle) -> File { fn daemon(daemon: redox_daemon::Daemon) -> ! { let _logger_ref = setup_logging(); - let mut pcid_handle = PcidServerHandle::connect_default().expect("ihdad: failed to setup channel to pcid"); + let mut pcid_handle = PciFunctionHandle::connect_default().expect("ihdad: failed to setup channel to pcid"); let pci_config = pcid_handle.fetch_config().expect("ihdad: failed to fetch config"); diff --git a/graphics/bgad/src/main.rs b/graphics/bgad/src/main.rs index a80423f392..b03f81a2f0 100644 --- a/graphics/bgad/src/main.rs +++ b/graphics/bgad/src/main.rs @@ -4,7 +4,7 @@ extern crate syscall; use std::fs::File; use std::io::{Read, Write}; -use pcid_interface::PcidServerHandle; +use pcid_interface::PciFunctionHandle; use syscall::call::iopl; use syscall::data::Packet; use syscall::scheme::SchemeMut; @@ -17,7 +17,7 @@ mod scheme; fn main() { let mut pcid_handle = - PcidServerHandle::connect_default().expect("bgad: failed to setup channel to pcid"); + PciFunctionHandle::connect_default().expect("bgad: failed to setup channel to pcid"); let pci_config = pcid_handle .fetch_config() .expect("bgad: failed to fetch config"); diff --git a/graphics/virtio-gpud/src/main.rs b/graphics/virtio-gpud/src/main.rs index 8a80510fbc..3fbeb0681d 100644 --- a/graphics/virtio-gpud/src/main.rs +++ b/graphics/virtio-gpud/src/main.rs @@ -27,7 +27,7 @@ use std::fs::File; use std::io::{Read, Write}; use std::sync::Arc; -use pcid_interface::PcidServerHandle; +use pcid_interface::PciFunctionHandle; use syscall::{Packet, SchemeMut}; use virtio_core::transport::{self, Queue}; @@ -409,7 +409,7 @@ fn reinit(control_queue: Arc, cursor_queue: Arc) -> Result<(), tra } fn deamon(deamon: redox_daemon::Daemon) -> anyhow::Result<()> { - let mut pcid_handle = PcidServerHandle::connect_default()?; + let mut pcid_handle = PciFunctionHandle::connect_default()?; // Double check that we have the right device. // diff --git a/net/e1000d/src/main.rs b/net/e1000d/src/main.rs index db893106e7..005770f09d 100644 --- a/net/e1000d/src/main.rs +++ b/net/e1000d/src/main.rs @@ -6,14 +6,14 @@ use std::rc::Rc; use driver_network::NetworkScheme; use event::{user_data, EventQueue}; -use pcid_interface::PcidServerHandle; +use pcid_interface::PciFunctionHandle; use syscall::EventFlags; pub mod device; fn main() { let mut pcid_handle = - PcidServerHandle::connect_default().expect("e1000d: failed to setup channel to pcid"); + PciFunctionHandle::connect_default().expect("e1000d: failed to setup channel to pcid"); let pci_config = pcid_handle .fetch_config() .expect("e1000d: failed to fetch config"); diff --git a/net/ixgbed/src/main.rs b/net/ixgbed/src/main.rs index 2c54c73ee2..a9fe183a79 100644 --- a/net/ixgbed/src/main.rs +++ b/net/ixgbed/src/main.rs @@ -6,7 +6,7 @@ use std::rc::Rc; use driver_network::NetworkScheme; use event::{user_data, EventQueue}; -use pcid_interface::PcidServerHandle; +use pcid_interface::PciFunctionHandle; use syscall::EventFlags; pub mod device; @@ -15,7 +15,7 @@ mod ixgbe; fn main() { let mut pcid_handle = - PcidServerHandle::connect_default().expect("ixgbed: failed to setup channel to pcid"); + PciFunctionHandle::connect_default().expect("ixgbed: failed to setup channel to pcid"); let pci_config = pcid_handle .fetch_config() .expect("ixgbed: failed to fetch config"); diff --git a/net/rtl8139d/src/main.rs b/net/rtl8139d/src/main.rs index 04cba8fc48..2eb17379b8 100644 --- a/net/rtl8139d/src/main.rs +++ b/net/rtl8139d/src/main.rs @@ -15,7 +15,7 @@ use pcid_interface::irq_helpers::allocate_single_interrupt_vector_for_msi; use pcid_interface::irq_helpers::read_bsp_apic_id; use pcid_interface::msi::{MsixInfo, MsixTableEntry}; use pcid_interface::{ - MsiSetFeatureInfo, PciFeature, PciFeatureInfo, PcidServerHandle, SetFeatureInfo, + MsiSetFeatureInfo, PciFeature, PciFeatureInfo, PciFunctionHandle, SetFeatureInfo, SubdriverArguments, }; use redox_log::{OutputBuilder, RedoxLogger}; @@ -95,7 +95,7 @@ impl MappedMsixRegs { } #[cfg(target_arch = "x86_64")] -fn get_int_method(pcid_handle: &mut PcidServerHandle) -> File { +fn get_int_method(pcid_handle: &mut PciFunctionHandle) -> File { let pci_config = pcid_handle.fetch_config().expect("rtl8139d: failed to fetch config"); let all_pci_features = pcid_handle.fetch_all_features().expect("rtl8139d: failed to fetch pci features"); @@ -177,7 +177,7 @@ fn get_int_method(pcid_handle: &mut PcidServerHandle) -> File { //TODO: MSI on non-x86_64? #[cfg(not(target_arch = "x86_64"))] -fn get_int_method(pcid_handle: &mut PcidServerHandle) -> File { +fn get_int_method(pcid_handle: &mut PciFunctionHandle) -> File { let pci_config = pcid_handle.fetch_config().expect("rtl8139d: failed to fetch config"); if let Some(irq) = pci_config.func.legacy_interrupt_line { @@ -209,7 +209,7 @@ fn find_bar(pci_config: &SubdriverArguments) -> Option<(usize, usize)> { fn daemon(daemon: redox_daemon::Daemon) -> ! { let _logger_ref = setup_logging(); - let mut pcid_handle = PcidServerHandle::connect_default().expect("rtl8139d: failed to setup channel to pcid"); + let mut pcid_handle = PciFunctionHandle::connect_default().expect("rtl8139d: failed to setup channel to pcid"); let pci_config = pcid_handle.fetch_config().expect("rtl8139d: failed to fetch config"); diff --git a/net/rtl8168d/src/main.rs b/net/rtl8168d/src/main.rs index f8177b98d8..45a16d3ca5 100644 --- a/net/rtl8168d/src/main.rs +++ b/net/rtl8168d/src/main.rs @@ -8,7 +8,7 @@ use std::rc::Rc; use driver_network::NetworkScheme; use event::{user_data, EventQueue}; -use pcid_interface::{MsiSetFeatureInfo, PcidServerHandle, PciFeature, PciFeatureInfo, SetFeatureInfo, SubdriverArguments}; +use pcid_interface::{MsiSetFeatureInfo, PciFunctionHandle, PciFeature, PciFeatureInfo, SetFeatureInfo, SubdriverArguments}; #[cfg(target_arch = "x86_64")] use pcid_interface::irq_helpers::allocate_single_interrupt_vector_for_msi; use pcid_interface::irq_helpers::read_bsp_apic_id; @@ -90,7 +90,7 @@ impl MappedMsixRegs { } #[cfg(target_arch = "x86_64")] -fn get_int_method(pcid_handle: &mut PcidServerHandle) -> File { +fn get_int_method(pcid_handle: &mut PciFunctionHandle) -> File { let pci_config = pcid_handle.fetch_config().expect("rtl8168d: failed to fetch config"); let all_pci_features = pcid_handle.fetch_all_features().expect("rtl8168d: failed to fetch pci features"); @@ -172,7 +172,7 @@ fn get_int_method(pcid_handle: &mut PcidServerHandle) -> File { //TODO: MSI on non-x86_64? #[cfg(not(target_arch = "x86_64"))] -fn get_int_method(pcid_handle: &mut PcidServerHandle) -> File { +fn get_int_method(pcid_handle: &mut PciFunctionHandle) -> File { let pci_config = pcid_handle.fetch_config().expect("rtl8168d: failed to fetch config"); if let Some(irq) = pci_config.func.legacy_interrupt_line { @@ -204,7 +204,7 @@ fn find_bar(pci_config: &SubdriverArguments) -> Option<(usize, usize)> { fn daemon(daemon: redox_daemon::Daemon) -> ! { let _logger_ref = setup_logging(); - let mut pcid_handle = PcidServerHandle::connect_default().expect("rtl8168d: failed to setup channel to pcid"); + let mut pcid_handle = PciFunctionHandle::connect_default().expect("rtl8168d: failed to setup channel to pcid"); let pci_config = pcid_handle.fetch_config().expect("rtl8168d: failed to fetch config"); diff --git a/net/virtio-netd/src/main.rs b/net/virtio-netd/src/main.rs index d2a2411f55..d413e62da8 100644 --- a/net/virtio-netd/src/main.rs +++ b/net/virtio-netd/src/main.rs @@ -5,7 +5,7 @@ use std::io::{Read, Write}; use std::mem; use driver_network::NetworkScheme; -use pcid_interface::PcidServerHandle; +use pcid_interface::PciFunctionHandle; use scheme::VirtioNet; @@ -28,7 +28,7 @@ static_assertions::const_assert_eq!(core::mem::size_of::(), 12); const MAX_BUFFER_LEN: usize = 65535; fn deamon(daemon: redox_daemon::Daemon) -> Result<(), Box> { - let mut pcid_handle = PcidServerHandle::connect_default()?; + let mut pcid_handle = PciFunctionHandle::connect_default()?; // Double check that we have the right device. // diff --git a/pcid/src/driver_interface/mod.rs b/pcid/src/driver_interface/mod.rs index 70bb982c33..6f92124b53 100644 --- a/pcid/src/driver_interface/mod.rs +++ b/pcid/src/driver_interface/mod.rs @@ -227,7 +227,7 @@ pub enum PcidClientResponse { // very similar to crossbeam-channel or libstd's mpsc (except the cycle, enqueue and dequeue fields // are stored in the same buffer as the actual data). /// A handle from a `pcid` client (e.g. `ahcid`) to `pcid`. -pub struct PcidServerHandle { +pub struct PciFunctionHandle { pcid_to_client: File, pcid_from_client: File, } @@ -253,7 +253,7 @@ pub(crate) fn recv(r: &mut R) -> Result { Ok(bincode::deserialize_from(&data[..])?) } -impl PcidServerHandle { +impl PciFunctionHandle { pub fn connect_default() -> Result { let pcid_to_client_fd = env::var("PCID_TO_CLIENT_FD")?.parse::().map_err(PcidClientHandleError::EnvValidityError)?; let pcid_from_client_fd = env::var("PCID_FROM_CLIENT_FD")?.parse::().map_err(PcidClientHandleError::EnvValidityError)?; diff --git a/storage/ahcid/src/main.rs b/storage/ahcid/src/main.rs index a5bb6f79db..a912de71a5 100644 --- a/storage/ahcid/src/main.rs +++ b/storage/ahcid/src/main.rs @@ -9,7 +9,7 @@ use std::os::fd::AsRawFd; use std::usize; use event::{EventFlags, RawEventQueue}; -use pcid_interface::PcidServerHandle; +use pcid_interface::PciFunctionHandle; use redox_scheme::{RequestKind, Response, SignalBehavior, Socket, V2}; use syscall::error::{Error, ENODEV}; @@ -72,7 +72,7 @@ fn main() { fn daemon(daemon: redox_daemon::Daemon) -> ! { let mut pcid_handle = - PcidServerHandle::connect_default().expect("ahcid: failed to setup channel to pcid"); + PciFunctionHandle::connect_default().expect("ahcid: failed to setup channel to pcid"); let pci_config = pcid_handle .fetch_config() .expect("ahcid: failed to fetch config"); diff --git a/storage/ided/src/main.rs b/storage/ided/src/main.rs index 0a10a625a0..b8dd79a70d 100644 --- a/storage/ided/src/main.rs +++ b/storage/ided/src/main.rs @@ -2,7 +2,7 @@ use driver_block::Disk; use event::{EventFlags, RawEventQueue}; use libredox::flag; use log::{error, info}; -use pcid_interface::{PciBar, PcidServerHandle}; +use pcid_interface::{PciBar, PciFunctionHandle}; use redox_log::{OutputBuilder, RedoxLogger}; use redox_scheme::{RequestKind, Response, SignalBehavior, Socket, V2}; use std::{ @@ -75,7 +75,7 @@ fn main() { fn daemon(daemon: redox_daemon::Daemon) -> ! { let mut pcid_handle = - PcidServerHandle::connect_default().expect("ided: failed to setup channel to pcid"); + PciFunctionHandle::connect_default().expect("ided: failed to setup channel to pcid"); let pci_config = pcid_handle.fetch_config().expect("ided: failed to fetch config"); diff --git a/storage/nvmed/src/main.rs b/storage/nvmed/src/main.rs index 6910e0a65b..f00ef3bbb9 100644 --- a/storage/nvmed/src/main.rs +++ b/storage/nvmed/src/main.rs @@ -10,7 +10,7 @@ use std::sync::{Arc, Mutex}; use std::{slice, usize}; use libredox::flag; -use pcid_interface::{PciFeature, PciFeatureInfo, PciFunction, PcidServerHandle}; +use pcid_interface::{PciFeature, PciFeatureInfo, PciFunction, PciFunctionHandle}; use redox_scheme::{CallRequest, RequestKind, SignalBehavior, Socket, V2}; use syscall::{ Event, Mmio, Packet, Result, SchemeBlockMut, @@ -58,7 +58,7 @@ pub struct AllocatedBars(pub [Mutex>; 6]); /// structures), and the handles to the interrupts. #[cfg(target_arch = "x86_64")] fn get_int_method( - pcid_handle: &mut PcidServerHandle, + pcid_handle: &mut PciFunctionHandle, function: &PciFunction, allocated_bars: &AllocatedBars, ) -> Result<(InterruptMethod, InterruptSources)> { @@ -184,7 +184,7 @@ fn get_int_method( //TODO: MSI on non-x86_64? #[cfg(not(target_arch = "x86_64"))] fn get_int_method( - pcid_handle: &mut PcidServerHandle, + pcid_handle: &mut PciFunctionHandle, function: &PciFunction, allocated_bars: &AllocatedBars, ) -> Result<(InterruptMethod, InterruptSources)> { @@ -246,7 +246,7 @@ fn main() { } fn daemon(daemon: redox_daemon::Daemon) -> ! { let mut pcid_handle = - PcidServerHandle::connect_default().expect("nvmed: failed to setup channel to pcid"); + PciFunctionHandle::connect_default().expect("nvmed: failed to setup channel to pcid"); let pci_config = pcid_handle .fetch_config() .expect("nvmed: failed to fetch config"); diff --git a/storage/nvmed/src/nvme/mod.rs b/storage/nvmed/src/nvme/mod.rs index 993736b890..14e502777a 100644 --- a/storage/nvmed/src/nvme/mod.rs +++ b/storage/nvmed/src/nvme/mod.rs @@ -23,7 +23,7 @@ use self::cq_reactor::NotifReq; pub use self::queues::{NvmeCmd, NvmeCmdQueue, NvmeComp, NvmeCompQueue}; use pcid_interface::msi::{MsiInfo, MsixInfo, MsixTableEntry}; -use pcid_interface::PcidServerHandle; +use pcid_interface::PciFunctionHandle; #[cfg(target_arch = "aarch64")] #[inline(always)] @@ -173,7 +173,7 @@ pub type AtomicCmdId = AtomicU16; pub struct Nvme { interrupt_method: Mutex, - pcid_interface: Mutex, + pcid_interface: Mutex, regs: RwLock<&'static mut NvmeRegs>, pub(crate) submission_queues: RwLock, CqId)>>, @@ -209,7 +209,7 @@ impl Nvme { pub fn new( address: usize, interrupt_method: InterruptMethod, - pcid_interface: PcidServerHandle, + pcid_interface: PciFunctionHandle, reactor_sender: Sender, ) -> Result { Ok(Nvme { diff --git a/storage/virtio-blkd/src/main.rs b/storage/virtio-blkd/src/main.rs index abdbacaba7..289a4d91a1 100644 --- a/storage/virtio-blkd/src/main.rs +++ b/storage/virtio-blkd/src/main.rs @@ -109,7 +109,7 @@ pub struct BlockVirtRequest { const_assert_eq!(core::mem::size_of::(), 16); fn deamon(deamon: redox_daemon::Daemon) -> anyhow::Result<()> { - let mut pcid_handle = PcidServerHandle::connect_default()?; + let mut pcid_handle = PciFunctionHandle::connect_default()?; // Double check that we have the right device. // diff --git a/vboxd/src/main.rs b/vboxd/src/main.rs index be65b6a11d..16b1dae847 100644 --- a/vboxd/src/main.rs +++ b/vboxd/src/main.rs @@ -6,7 +6,7 @@ use std::os::unix::io::AsRawFd; use std::fs::File; use std::io::{Result, Read, Write}; -use pcid_interface::{PciBar, PcidServerHandle}; +use pcid_interface::{PciBar, PciFunctionHandle}; use syscall::flag::EventFlags; use syscall::io::{Io, Mmio, Pio}; @@ -181,7 +181,7 @@ impl VboxGuestInfo { fn main() { let mut pcid_handle = - PcidServerHandle::connect_default().expect("vboxd: failed to setup channel to pcid"); + PciFunctionHandle::connect_default().expect("vboxd: failed to setup channel to pcid"); let pci_config = pcid_handle .fetch_config() .expect("vboxd: failed to fetch config"); diff --git a/virtio-core/src/arch/x86_64.rs b/virtio-core/src/arch/x86_64.rs index 95072fd0ac..5413b2f169 100644 --- a/virtio-core/src/arch/x86_64.rs +++ b/virtio-core/src/arch/x86_64.rs @@ -8,7 +8,7 @@ use crate::{probe::MappedMsixRegs, MSIX_PRIMARY_VECTOR}; use pcid_interface::*; -pub fn enable_msix(pcid_handle: &mut PcidServerHandle) -> Result { +pub fn enable_msix(pcid_handle: &mut PciFunctionHandle) -> Result { let pci_config = pcid_handle.fetch_config()?; // Extended message signaled interrupts. @@ -50,7 +50,7 @@ pub fn enable_msix(pcid_handle: &mut PcidServerHandle) -> Result { pub fn probe_legacy_port_transport( pci_config: &SubdriverArguments, - pcid_handle: &mut PcidServerHandle, + pcid_handle: &mut PciFunctionHandle, ) -> Result { let port = pci_config.func.bars[0].expect_port(); diff --git a/virtio-core/src/probe.rs b/virtio-core/src/probe.rs index 3cd6d8d8fb..7da40a958d 100644 --- a/virtio-core/src/probe.rs +++ b/virtio-core/src/probe.rs @@ -41,7 +41,7 @@ static_assertions::const_assert_eq!(std::mem::size_of::(), 16); pub const MSIX_PRIMARY_VECTOR: u16 = 0; #[cfg(not(target_arch = "x86_64"))] -fn enable_msix(pcid_handle: &mut PcidServerHandle) -> Result { +fn enable_msix(pcid_handle: &mut PciFunctionHandle) -> Result { panic!("Msi-X only supported on x86_64"); } @@ -59,7 +59,7 @@ fn enable_msix(pcid_handle: &mut PcidServerHandle) -> Result { /// /// ## Panics /// This function panics if the device is not a virtio device. -pub fn probe_device(pcid_handle: &mut PcidServerHandle) -> Result { +pub fn probe_device(pcid_handle: &mut PciFunctionHandle) -> Result { let pci_config = pcid_handle.fetch_config()?; assert_eq!( diff --git a/xhcid/src/main.rs b/xhcid/src/main.rs index 3c3aa0dbce..9a1bb570f4 100644 --- a/xhcid/src/main.rs +++ b/xhcid/src/main.rs @@ -12,7 +12,7 @@ use std::sync::{Arc, Mutex}; use std::env; use libredox::flag; -use pcid_interface::{MsiSetFeatureInfo, PcidServerHandle, PciFeature, PciFeatureInfo, SetFeatureInfo}; +use pcid_interface::{MsiSetFeatureInfo, PciFunctionHandle, PciFeature, PciFeatureInfo, SetFeatureInfo}; #[cfg(target_arch = "x86_64")] use pcid_interface::irq_helpers::allocate_single_interrupt_vector_for_msi; use pcid_interface::irq_helpers::read_bsp_apic_id; @@ -85,7 +85,7 @@ fn setup_logging(name: &str) -> Option<&'static RedoxLogger> { } #[cfg(target_arch = "x86_64")] -fn get_int_method(pcid_handle: &mut PcidServerHandle, bar0_address: usize) -> (Option, InterruptMethod) { +fn get_int_method(pcid_handle: &mut PciFunctionHandle, bar0_address: usize) -> (Option, InterruptMethod) { let pci_config = pcid_handle.fetch_config().expect("xhcid: failed to fetch config"); let all_pci_features = pcid_handle.fetch_all_features().expect("xhcid: failed to fetch pci features"); @@ -167,7 +167,7 @@ fn get_int_method(pcid_handle: &mut PcidServerHandle, bar0_address: usize) -> (O //TODO: MSI on non-x86_64? #[cfg(not(target_arch = "x86_64"))] -fn get_int_method(pcid_handle: &mut PcidServerHandle, address: usize) -> (Option, InterruptMethod) { +fn get_int_method(pcid_handle: &mut PciFunctionHandle, address: usize) -> (Option, InterruptMethod) { let pci_config = pcid_handle.fetch_config().expect("xhcid: failed to fetch config"); if let Some(irq) = pci_config.func.legacy_interrupt_line { @@ -184,7 +184,7 @@ fn main() { } fn daemon(daemon: redox_daemon::Daemon) -> ! { - let mut pcid_handle = PcidServerHandle::connect_default().expect("xhcid: failed to setup channel to pcid"); + let mut pcid_handle = PciFunctionHandle::connect_default().expect("xhcid: failed to setup channel to pcid"); let pci_config = pcid_handle.fetch_config().expect("xhcid: failed to fetch config"); let mut name = pci_config.func.name(); diff --git a/xhcid/src/xhci/mod.rs b/xhcid/src/xhci/mod.rs index 32eb7f7dd4..f42482f1ea 100644 --- a/xhcid/src/xhci/mod.rs +++ b/xhcid/src/xhci/mod.rs @@ -22,7 +22,7 @@ use serde::Deserialize; use crate::usb; use pcid_interface::msi::{MsixInfo, MsixTableEntry}; -use pcid_interface::{PcidServerHandle, PciFeature}; +use pcid_interface::{PciFunctionHandle, PciFeature}; mod capability; mod context; @@ -198,7 +198,7 @@ pub struct Xhci { scheme_name: String, interrupt_method: InterruptMethod, - pcid_handle: Mutex, + pcid_handle: Mutex, irq_reactor: Mutex>>, @@ -258,7 +258,7 @@ impl EndpointState { } impl Xhci { - pub fn new(scheme_name: String, address: usize, interrupt_method: InterruptMethod, pcid_handle: PcidServerHandle) -> Result { + pub fn new(scheme_name: String, address: usize, interrupt_method: InterruptMethod, pcid_handle: PciFunctionHandle) -> Result { let cap = unsafe { &mut *(address as *mut CapabilityRegs) }; debug!("CAP REGS BASE {:X}", address);