Skip to content

Commit 6949a9c

Browse files
committed
Add methods to get the current MSI-X enable and function mask status
1 parent 05a544e commit 6949a9c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/capability/msix.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ impl MsixCapability {
3939
}
4040
}
4141

42+
pub fn get_enabled(&self, access: impl ConfigRegionAccess) -> bool {
43+
let control = unsafe { access.read(self.address.address, self.address.offset) };
44+
control.get_bit(31)
45+
}
46+
4247
/// Enable/disable masking of all interrupts for this PCI function.
4348
///
4449
/// Individual interrupt sources can be masked using mask field of the corresponding entry in
@@ -51,6 +56,11 @@ impl MsixCapability {
5156
}
5257
}
5358

59+
pub fn get_function_mask(&self, access: impl ConfigRegionAccess) -> bool {
60+
let control = unsafe { access.read(self.address.address, self.address.offset) };
61+
control.get_bit(30)
62+
}
63+
5464
/// The index of the BAR that contains the MSI-X table.
5565
pub fn table_bar(&self) -> u8 {
5666
self.table.get_bits(0..3) as u8

0 commit comments

Comments
 (0)