Store decoded MSI info instead of full capability in PciFeatureInfo
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -132,7 +132,7 @@ impl PciFeature {
|
||||
}
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub enum PciFeatureInfo {
|
||||
Msi(msi::MsiCapability),
|
||||
Msi(msi::MsiInfo),
|
||||
MsiX(msi::MsixInfo),
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user