From cd5604a0543581395027d800980d1b43542e6173 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sat, 22 Feb 2025 18:56:14 +0100 Subject: [PATCH] Move config from pcid to pcid_interface This will allow serializing/deserializing to be shared across programs. For pcid-spawner will need to parse the config files and if we want to embed config files into the driver executables at some point it may also be useful. --- pcid/src/{ => driver_interface}/config.rs | 2 +- pcid/src/driver_interface/mod.rs | 1 + pcid/src/main.rs | 4 +--- 3 files changed, 3 insertions(+), 4 deletions(-) rename pcid/src/{ => driver_interface}/config.rs (98%) diff --git a/pcid/src/config.rs b/pcid/src/driver_interface/config.rs similarity index 98% rename from pcid/src/config.rs rename to pcid/src/driver_interface/config.rs index c9610f667c..8278f33c3c 100644 --- a/pcid/src/config.rs +++ b/pcid/src/driver_interface/config.rs @@ -3,7 +3,7 @@ use std::ops::Range; use serde::Deserialize; -use pcid_interface::FullDeviceId; +use crate::driver_interface::FullDeviceId; #[derive(Clone, Debug, Default, Deserialize)] pub struct Config { diff --git a/pcid/src/driver_interface/mod.rs b/pcid/src/driver_interface/mod.rs index 5d1054a23f..2cf16e8bba 100644 --- a/pcid/src/driver_interface/mod.rs +++ b/pcid/src/driver_interface/mod.rs @@ -16,6 +16,7 @@ pub use pci_types::PciAddress; mod bar; pub mod cap; +pub mod config; mod id; pub mod irq_helpers; pub mod msi; diff --git a/pcid/src/main.rs b/pcid/src/main.rs index 6f08c4ff1d..edc48df6a9 100644 --- a/pcid/src/main.rs +++ b/pcid/src/main.rs @@ -15,11 +15,9 @@ use pci_types::{ use structopt::StructOpt; use crate::cfg_access::Pcie; -use crate::config::Config; -use pcid_interface::{FullDeviceId, LegacyInterruptLine, PciBar}; +use pcid_interface::{config::Config, FullDeviceId, LegacyInterruptLine, PciBar}; mod cfg_access; -mod config; mod driver_handler; #[derive(StructOpt)]