diff --git a/src/capability/msix.rs b/src/capability/msix.rs index 132b6f0..1fe85c3 100644 --- a/src/capability/msix.rs +++ b/src/capability/msix.rs @@ -39,6 +39,11 @@ impl MsixCapability { } } + pub fn enabled(&self, access: impl ConfigRegionAccess) -> bool { + let control = unsafe { access.read(self.address.address, self.address.offset) }; + control.get_bit(31) + } + /// Enable/disable masking of all interrupts for this PCI function. /// /// Individual interrupt sources can be masked using mask field of the corresponding entry in @@ -51,6 +56,11 @@ impl MsixCapability { } } + pub fn function_mask(&self, access: impl ConfigRegionAccess) -> bool { + let control = unsafe { access.read(self.address.address, self.address.offset) }; + control.get_bit(30) + } + /// The index of the BAR that contains the MSI-X table. pub fn table_bar(&self) -> u8 { self.table.get_bits(0..3) as u8