Skip to content

Commit

Permalink
Make naming in MsiCapability more uniform with rest of library
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacWoods committed Jun 14, 2024
1 parent 51cd7a0 commit 0030b7b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/capability/msi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl MsiCapability {

/// How many interrupts this device has?
#[inline]
pub fn get_multiple_message_capable(&self) -> MultipleMessageSupport {
pub fn multiple_message_capable(&self) -> MultipleMessageSupport {
self.multiple_message_capable
}

Expand Down Expand Up @@ -108,7 +108,7 @@ impl MsiCapability {
}

/// Return how many interrupts the device is using
pub fn get_multiple_message_enable(&self, access: impl ConfigRegionAccess) -> MultipleMessageSupport {
pub fn multiple_message_enable(&self, access: impl ConfigRegionAccess) -> MultipleMessageSupport {
let reg = unsafe { access.read(self.address.address, self.address.offset) };
MultipleMessageSupport::try_from(reg.get_bits(4..7) as u8).unwrap_or(MultipleMessageSupport::Int1)
}
Expand Down Expand Up @@ -145,7 +145,7 @@ impl MsiCapability {
/// # Note
/// Only supported on when device supports 64-bit addressing and per-vector masking. Otherwise
/// returns `0`
pub fn get_message_mask(&self, access: impl ConfigRegionAccess) -> u32 {
pub fn message_mask(&self, access: impl ConfigRegionAccess) -> u32 {
if self.is_64bit && self.per_vector_masking {
unsafe { access.read(self.address.address, self.address.offset + 0x10) }
} else {
Expand All @@ -158,7 +158,7 @@ impl MsiCapability {
/// # Note
/// Only supported on when device supports 64-bit addressing and per-vector masking. Otherwise
/// will do nothing
pub fn set_message_mask(&self, access: impl ConfigRegionAccess, mask: u32) {
pub fn set_message_mask(&self, mask: u32, access: impl ConfigRegionAccess) {
if self.is_64bit && self.per_vector_masking {
unsafe { access.write(self.address.address, self.address.offset + 0x10, mask) }
}
Expand All @@ -168,7 +168,7 @@ impl MsiCapability {
///
/// # Note
/// Only supported on when device supports 64-bit addressing. Otherwise will return `0`
pub fn get_pending(&self, access: impl ConfigRegionAccess) -> u32 {
pub fn is_pending(&self, access: impl ConfigRegionAccess) -> u32 {
if self.is_64bit {
unsafe { access.read(self.address.address, self.address.offset + 0x14) }
} else {
Expand Down

0 comments on commit 0030b7b

Please sign in to comment.