1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:47:35 +00:00

Kernel/PCI: Propagate usage of DeviceIdentifier everywhere

This allows us to remove a bunch of PCI API functions, and instead to
leverage the cached data from DeviceIdentifier object in many places.
This commit is contained in:
Liav A 2021-09-23 10:20:54 +03:00 committed by Andreas Kling
parent da327746a2
commit 057f5a12c2
40 changed files with 150 additions and 186 deletions

View file

@ -44,15 +44,15 @@ UNMAP_AFTER_INIT void StorageManagement::enumerate_controllers(bool force_pio)
VERIFY(m_controllers.is_empty());
if (!kernel_command_line().disable_physical_storage()) {
if (kernel_command_line().is_ide_enabled()) {
PCI::enumerate([&](const PCI::Address& address, PCI::DeviceIdentifier const& device_identifier) {
PCI::enumerate([&](const PCI::Address&, PCI::DeviceIdentifier const& device_identifier) {
if (device_identifier.class_code().value() == PCI_MASS_STORAGE_CLASS_ID && device_identifier.subclass_code().value() == PCI_IDE_CTRL_SUBCLASS_ID) {
m_controllers.append(IDEController::initialize(address, force_pio));
m_controllers.append(IDEController::initialize(device_identifier, force_pio));
}
});
}
PCI::enumerate([&](const PCI::Address& address, PCI::DeviceIdentifier const& device_identifier) {
PCI::enumerate([&](const PCI::Address&, PCI::DeviceIdentifier const& device_identifier) {
if (device_identifier.class_code().value() == PCI_MASS_STORAGE_CLASS_ID && device_identifier.subclass_code().value() == PCI_SATA_CTRL_SUBCLASS_ID && device_identifier.prog_if().value() == PCI_AHCI_IF_PROGIF) {
m_controllers.append(AHCIController::initialize(address));
m_controllers.append(AHCIController::initialize(device_identifier));
}
});
}