Struct mycelium_kernel::drivers::pci::device::StandardDetails
source · #[repr(C)]pub struct StandardDetails {
pub cardbus_cis_ptr: u32,
pub subsystem: SubsystemId,
pub exp_rom_base_addr: u32,
pub cap_ptr: u8,
pub irq_line: u8,
pub min_grant: u8,
pub max_latency: u8,
/* private fields */
}
Expand description
A header describing a standard PCI device (not a bridge).
Much of the documentation for this struct’s fields was copied from the OSDev Wiki.
Fields§
§cardbus_cis_ptr: u32
Points to the Card Information Structure and is used by devices that share silicon between CardBus and PCI.
subsystem: SubsystemId
§exp_rom_base_addr: u32
Expansion ROM base address.
cap_ptr: u8
Points (i.e. an offset into this function’s configuration space) to a linked list of new capabilities implemented by the device. Used if bit 4 of the status register (Capabilities List bit) is set to 1. The bottom two bits are reserved and should be masked before the Pointer is used to access the Configuration Space.
irq_line: u8
Specifies which input of the system interrupt controllers the device’s interrupt pin is connected to and is implemented by any device that makes use of an interrupt pin.
For the x86 architectures, this register corresponds to the PIC IRQ numbers 0-15 (and not I/O APIC IRQ numbers) and a value of 0xFF defines no connection.
min_grant: u8
A read-only register that specifies the burst period length, in 1/4 microsecond units, that the device needs (assuming a 33 MHz clock rate).
max_latency: u8
A read-only register that specifies how often the device needs access to the PCI bus (in 1/4 microsecond units).
Implementations§
source§impl StandardDetails
impl StandardDetails
sourcepub fn base_addrs(
&self
) -> Result<[Option<BaseAddress>; 6], UnexpectedValue<u32>>
pub fn base_addrs( &self ) -> Result<[Option<BaseAddress>; 6], UnexpectedValue<u32>>
Returns this device’s base address registers (BARs).
Returns
Ok
containing an array ofOption
<
BaseAddress
>
if the BARs were successfully decoded.Err
(
error::UnexpectedValue
)
if a BAR value is invalid.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for StandardDetails
impl Send for StandardDetails
impl Sync for StandardDetails
impl Unpin for StandardDetails
impl UnwindSafe for StandardDetails
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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.