From eb2e670cd6f67df447ec009b1ec19870b38af495 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sun, 9 Jun 2024 18:53:19 +0200 Subject: [PATCH] pcid: Explain why PciBar is used instead of pcid_types::Bar --- pcid/src/pci/bar.rs | 2 ++ pcid/src/pci_header.rs | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pcid/src/pci/bar.rs b/pcid/src/pci/bar.rs index b9e8008f51..b279c44577 100644 --- a/pcid/src/pci/bar.rs +++ b/pcid/src/pci/bar.rs @@ -2,6 +2,8 @@ use std::convert::TryInto; use serde::{Deserialize, Serialize}; +// This type is used instead of [pci_types::Bar] in the driver interface as the +// latter can't be serialized and is missing the convenience functions of [PciBar]. #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)] pub enum PciBar { None, diff --git a/pcid/src/pci_header.rs b/pcid/src/pci_header.rs index 95c960851a..5e450ca26c 100644 --- a/pcid/src/pci_header.rs +++ b/pcid/src/pci_header.rs @@ -199,7 +199,6 @@ impl PciEndpointHeader { } /// Return the Headers BARs. - // FIXME use pci_types::Bar instead pub fn bars(&self, access: &impl ConfigRegionAccess) -> [PciBar; 6] { let endpoint_header = self.endpoint_header(access);