pub fn config_write(&self, offset: usize, width: usize, val: u32) -> ZxResult {
        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 => self.cfg.as_ref().unwrap().write8_offset(offset, val as u8),
            2 => self
                .cfg
                .as_ref()
                .unwrap()
                .write16_offset(offset, val as u16),
            4 => self
                .cfg
                .as_ref()
                .unwrap()
                .write32_offset(offset, val as u32),
            _ => return Err(ZxError::INVALID_ARGS),
        };
        Ok(())
    }
/// Write the device's config.
Write the device's config.
Write the device ' s config .
pub fn config_write(&self, offset: usize, width: usize, val: u32) -> ZxResult {
        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 => self.cfg.as_ref().unwrap().write8_offset(offset, val as u8),
            2 => self
                .cfg
                .as_ref()
                .unwrap()
                .write16_offset(offset, val as u16),
            4 => self
                .cfg
                .as_ref()
                .unwrap()
                .write32_offset(offset, val as u32),
            _ => return Err(ZxError::INVALID_ARGS),
        };
        Ok(())
    }
pub fn config_write ( & self , offset : usize , width : usize , val : u32 ) -> ZxResult { 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 => self . cfg . as_ref ( ) . unwrap ( ) . write8_offset ( offset , val as u8 ) , 2 => self . cfg . as_ref ( ) . unwrap ( ) . write16_offset ( offset , val as u16 ) , 4 => self . cfg . as_ref ( ) . unwrap ( ) . write32_offset ( offset , val as u32 ) , _ => return Err ( ZxError :: INVALID_ARGS ) , } ; Ok ( ( ) ) }
Write the device's config.
Write the device ' s config .
&self
offset
usize
width
usize
val
u32
&self
offset
usize
width
usize
val
u32