diff options
Diffstat (limited to 'Kernel/Bus/PCI/DeviceIdentifier.cpp')
-rw-r--r-- | Kernel/Bus/PCI/DeviceIdentifier.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Kernel/Bus/PCI/DeviceIdentifier.cpp b/Kernel/Bus/PCI/DeviceIdentifier.cpp index 785dfebff8..ee07737402 100644 --- a/Kernel/Bus/PCI/DeviceIdentifier.cpp +++ b/Kernel/Bus/PCI/DeviceIdentifier.cpp @@ -17,4 +17,16 @@ ErrorOr<NonnullRefPtr<DeviceIdentifier>> DeviceIdentifier::from_enumerable_ident return adopt_nonnull_ref_or_enomem(new (nothrow) DeviceIdentifier(other_identifier)); } +void DeviceIdentifier::initialize() +{ + for (auto cap : capabilities()) { + if (cap.id() == PCI::Capabilities::ID::MSIX) { + auto msix_bir_bar = (cap.read8(4) & msix_table_bir_mask); + auto msix_bir_offset = (cap.read32(4) & msix_table_offset_mask); + auto msix_count = (cap.read16(2) & msix_control_table_mask) + 1; + m_msix_info = MSIxInfo(msix_count, msix_bir_bar, msix_bir_offset); + } + } +} + } |