pub struct BusSchemeServer {
drivers: Vec<(String, Box<dyn BusDriver>)>,
port_handle: u64,
handles: BTreeMap<u64, OpenHandle>,
next_id: u64,
pci_cache: Vec<PciDeviceInfo>,
}Fields§
§drivers: Vec<(String, Box<dyn BusDriver>)>§port_handle: u64§handles: BTreeMap<u64, OpenHandle>§next_id: u64§pci_cache: Vec<PciDeviceInfo>Implementations§
Source§impl BusSchemeServer
impl BusSchemeServer
Sourcepub fn new(drivers: Vec<(String, Box<dyn BusDriver>)>, port_handle: u64) -> Self
pub fn new(drivers: Vec<(String, Box<dyn BusDriver>)>, port_handle: u64) -> Self
Creates a new instance.
Sourcepub fn refresh_pci_cache(&mut self) -> Result<usize, ()>
pub fn refresh_pci_cache(&mut self) -> Result<usize, ()>
Performs the refresh pci cache operation.
Returns Ok(count) with the number of devices found, or Err(()) if the
underlying pci_enum syscall failed (cache remains unchanged).
fn ok_reply(sender: u64) -> IpcMessage
fn err_reply(sender: u64, code: usize) -> IpcMessage
fn alloc_id(&mut self) -> u64
Sourcefn resolve_driver_path<'a>(&self, path: &'a str) -> Option<(usize, &'a str)>
fn resolve_driver_path<'a>(&self, path: &'a str) -> Option<(usize, &'a str)>
Split a normalised path into a driver index + sub-path, or detect PCI / root.
fn is_pci_path(path: &str) -> bool
fn path_exists(&self, path: &str) -> bool
fn parse_reg_offset(path: &str) -> Option<usize>
fn handle_open(&mut self, sender: u64, payload: &[u8]) -> IpcMessage
fn handle_read(&self, sender: u64, payload: &[u8]) -> IpcMessage
fn generate_read_content(&self, kind: &HandleKind, offset: usize) -> Vec<u8>
fn read_pci_content(&self, path: &str) -> Vec<u8>
fn read_driver_content( &self, driver: &Box<dyn BusDriver>, name: &str, sub_path: &str, ) -> Vec<u8>
fn handle_write(&mut self, sender: u64, payload: &[u8]) -> IpcMessage
fn handle_close(&mut self, sender: u64, payload: &[u8]) -> IpcMessage
fn handle_readdir(&self, sender: u64, payload: &[u8]) -> IpcMessage
fn normalize_path(path: &str) -> String
fn parse_hex_u8(s: &str) -> Option<u8>
fn parse_hex_u16(s: &str) -> Option<u16>
fn parse_pci_bdf(s: &str) -> Option<PciAddress>
fn parse_cfg_path(path: &str) -> Option<(PciAddress, u8, u8)>
fn parse_find_path(path: &str) -> Option<(u16, u16)>
fn render_inventory(&self) -> Vec<u8>
Auto Trait Implementations§
impl !RefUnwindSafe for BusSchemeServer
impl !UnwindSafe for BusSchemeServer
impl Freeze for BusSchemeServer
impl Send for BusSchemeServer
impl Sync for BusSchemeServer
impl Unpin for BusSchemeServer
impl UnsafeUnpin for BusSchemeServer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more