Store decoded MSI info instead of full capability in PciFeatureInfo

This commit is contained in:
bjorn3
2024-06-11 16:47:08 +02:00
parent 7a67110109
commit 4f583b1cfb
5 changed files with 24 additions and 10 deletions
+5 -1
View File
@@ -199,7 +199,11 @@ impl DriverHandler {
.iter()
.find_map(|capability| capability.as_msi())
{
PciFeatureInfo::Msi(*info)
PciFeatureInfo::Msi(msi::MsiInfo {
log2_multiple_message_capable: info.multi_message_capable(),
is_64bit: info.has_64_bit_addr(),
has_per_vector_masking: info.is_pvt_capable(),
})
} else {
return PcidClientResponse::Error(
PcidServerResponseError::NonexistentFeature(feature),
+1 -1
View File
@@ -132,7 +132,7 @@ impl PciFeature {
}
#[derive(Debug, Serialize, Deserialize)]
pub enum PciFeatureInfo {
Msi(msi::MsiCapability),
Msi(msi::MsiInfo),
MsiX(msi::MsixInfo),
}
+7
View File
@@ -23,6 +23,13 @@ impl MsiAddrAndData {
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct MsiInfo {
pub log2_multiple_message_capable: u8,
pub is_64bit: bool,
pub has_per_vector_masking: bool,
}
impl MsiCapability {
pub const MC_PVT_CAPABLE_BIT: u16 = 1 << 8;
pub const MC_64_BIT_ADDR_BIT: u16 = 1 << 7;