pub fn config_read(&self, offset: usize, width: usize) -> ZxResult<u32> {
        let inner = self.inner.lock();
        let cfg_size: usize = if inner.pcie().is_some() {
            PCIE_BASE_CONFIG_SIZE
        } else {
            PCIE_EXTENDED_CONFIG_SIZE
        };
        if offset + width > cfg_size {
            return Err(ZxError::INVALID_ARGS);
        }
        match width {
            1 => Ok(self.cfg.as_ref().unwrap().read8_offset(offset) as u32),
            2 => Ok(self.cfg.as_ref().unwrap().read16_offset(offset) as u32),
            4 => Ok(self.cfg.as_ref().unwrap().read32_offset(offset) as u32),
            _ => Err(ZxError::INVALID_ARGS),
        }
    }
/// Read the device's config.
Read the device's config.
Read the device ' s config .
pub fn config_read(&self, offset: usize, width: usize) -> ZxResult<u32> {
        let inner = self.inner.lock();
        let cfg_size: usize = if inner.pcie().is_some() {
            PCIE_BASE_CONFIG_SIZE
        } else {
            PCIE_EXTENDED_CONFIG_SIZE
        };
        if offset + width > cfg_size {
            return Err(ZxError::INVALID_ARGS);
        }
        match width {
            1 => Ok(self.cfg.as_ref().unwrap().read8_offset(offset) as u32),
            2 => Ok(self.cfg.as_ref().unwrap().read16_offset(offset) as u32),
            4 => Ok(self.cfg.as_ref().unwrap().read32_offset(offset) as u32),
            _ => Err(ZxError::INVALID_ARGS),
        }
    }
pub fn config_read ( & self , offset : usize , width : usize ) -> ZxResult < u32 > { let inner = self . inner . lock ( ) ; let cfg_size : usize = if inner . pcie ( ) . is_some ( ) { PCIE_BASE_CONFIG_SIZE } else { PCIE_EXTENDED_CONFIG_SIZE } ; if offset + width > cfg_size { return Err ( ZxError :: INVALID_ARGS ) ; } match width { 1 => Ok ( self . cfg . as_ref ( ) . unwrap ( ) . read8_offset ( offset ) as u32 ) , 2 => Ok ( self . cfg . as_ref ( ) . unwrap ( ) . read16_offset ( offset ) as u32 ) , 4 => Ok ( self . cfg . as_ref ( ) . unwrap ( ) . read32_offset ( offset ) as u32 ) , _ => Err ( ZxError :: INVALID_ARGS ) , } }
Read the device's config.
Read the device ' s config .
&self
offset
usize
width
usize
&self
offset
usize
width
usize