diff --git a/Kernel/Bus/PCI/Access.cpp b/Kernel/Bus/PCI/Access.cpp index c32eb68d6a..0392a15cb1 100644 --- a/Kernel/Bus/PCI/Access.cpp +++ b/Kernel/Bus/PCI/Access.cpp @@ -160,7 +160,7 @@ UNMAP_AFTER_INIT void Access::rescan_hardware() SpinlockLocker scan_locker(m_scan_lock); VERIFY(m_device_identifiers.is_empty()); for (auto& [_, host_controller] : m_host_controllers) { - host_controller->enumerate_attached_devices([this](EnumerableDeviceIdentifier device_identifier) { + host_controller->enumerate_attached_devices([this](EnumerableDeviceIdentifier const& device_identifier) { auto device_identifier_or_error = DeviceIdentifier::from_enumerable_identifier(device_identifier); if (device_identifier_or_error.is_error()) { dmesgln("Failed during PCI Access::rescan_hardware due to {}", device_identifier_or_error.error()); diff --git a/Kernel/Bus/PCI/Controller/HostController.cpp b/Kernel/Bus/PCI/Controller/HostController.cpp index 75fdef264f..7fb59e6984 100644 --- a/Kernel/Bus/PCI/Controller/HostController.cpp +++ b/Kernel/Bus/PCI/Controller/HostController.cpp @@ -54,7 +54,7 @@ u16 HostController::read16_field(BusNumber bus, DeviceNumber device, FunctionNum return read16_field(bus, device, function, to_underlying(field)); } -UNMAP_AFTER_INIT void HostController::enumerate_functions(Function const& callback, BusNumber bus, DeviceNumber device, FunctionNumber function, bool recursive_search_into_bridges) +UNMAP_AFTER_INIT void HostController::enumerate_functions(Function const& callback, BusNumber bus, DeviceNumber device, FunctionNumber function, bool recursive_search_into_bridges) { dbgln_if(PCI_DEBUG, "PCI: Enumerating function, bus={}, device={}, function={}", bus, device, function); Address address(domain_number(), bus.value(), device.value(), function.value()); @@ -83,7 +83,7 @@ UNMAP_AFTER_INIT void HostController::enumerate_functions(Function const& callback, BusNumber bus, DeviceNumber device, bool recursive_search_into_bridges) +UNMAP_AFTER_INIT void HostController::enumerate_device(Function const& callback, BusNumber bus, DeviceNumber device, bool recursive_search_into_bridges) { dbgln_if(PCI_DEBUG, "PCI: Enumerating device in bus={}, device={}", bus, device); if (read16_field(bus, device, 0, PCI::RegisterOffset::VENDOR_ID) == PCI::none_value) @@ -97,14 +97,14 @@ UNMAP_AFTER_INIT void HostController::enumerate_device(Function const& callback, BusNumber bus, bool recursive_search_into_bridges) +UNMAP_AFTER_INIT void HostController::enumerate_bus(Function const& callback, BusNumber bus, bool recursive_search_into_bridges) { dbgln_if(PCI_DEBUG, "PCI: Enumerating bus {}", bus); for (u8 device = 0; device < 32; ++device) enumerate_device(callback, bus, device, recursive_search_into_bridges); } -UNMAP_AFTER_INIT void HostController::enumerate_attached_devices(Function callback) +UNMAP_AFTER_INIT void HostController::enumerate_attached_devices(Function callback) { VERIFY(Access::the().access_lock().is_locked()); VERIFY(Access::the().scan_lock().is_locked()); diff --git a/Kernel/Bus/PCI/Controller/HostController.h b/Kernel/Bus/PCI/Controller/HostController.h index a9d34a3bb6..624d346f48 100644 --- a/Kernel/Bus/PCI/Controller/HostController.h +++ b/Kernel/Bus/PCI/Controller/HostController.h @@ -31,12 +31,12 @@ public: u32 domain_number() const { return m_domain.domain_number(); } - void enumerate_attached_devices(Function callback); + void enumerate_attached_devices(Function callback); private: - void enumerate_bus(Function const& callback, BusNumber, bool recursive); - void enumerate_functions(Function const& callback, BusNumber, DeviceNumber, FunctionNumber, bool recursive); - void enumerate_device(Function const& callback, BusNumber bus, DeviceNumber device, bool recursive); + void enumerate_bus(Function const& callback, BusNumber, bool recursive_search_into_bridges); + void enumerate_functions(Function const& callback, BusNumber, DeviceNumber, FunctionNumber, bool recursive_search_into_bridges); + void enumerate_device(Function const& callback, BusNumber bus, DeviceNumber device, bool recursive_search_into_bridges); u8 read8_field(BusNumber, DeviceNumber, FunctionNumber, RegisterOffset field); u16 read16_field(BusNumber, DeviceNumber, FunctionNumber, RegisterOffset field);