summaryrefslogtreecommitdiff
path: root/Kernel/Net
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2021-09-23 09:05:34 +0300
committerAndreas Kling <kling@serenityos.org>2021-09-29 11:24:33 +0200
commit82bb08a15cbe447b5b0deeac16cccc22bf1c1c57 (patch)
treeecb5dc7c013c1f11516fb8c74561be10179fa7d2 /Kernel/Net
parente22d9dc360d123b5b3c847a9ec882da220dc8e66 (diff)
downloadserenity-82bb08a15cbe447b5b0deeac16cccc22bf1c1c57.zip
Kernel/PCI: Cache more details about PCI devices when enumerating them
There's no good reason to fetch these values each time we need them.
Diffstat (limited to 'Kernel/Net')
-rw-r--r--Kernel/Net/NetworkingManagement.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Net/NetworkingManagement.cpp b/Kernel/Net/NetworkingManagement.cpp
index efcaad102b..92cc562148 100644
--- a/Kernel/Net/NetworkingManagement.cpp
+++ b/Kernel/Net/NetworkingManagement.cpp
@@ -91,9 +91,9 @@ UNMAP_AFTER_INIT RefPtr<NetworkAdapter> NetworkingManagement::determine_network_
bool NetworkingManagement::initialize()
{
if (!kernel_command_line().is_physical_networking_disabled()) {
- PCI::enumerate([&](const PCI::Address& address, PCI::ID) {
+ PCI::enumerate([&](const PCI::Address& address, PCI::PhysicalID const& physical_id) {
// Note: PCI class 2 is the class of Network devices
- if (PCI::get_class(address) != 0x02)
+ if (physical_id.class_code().value() != 0x02)
return;
if (auto adapter = determine_network_device(address); !adapter.is_null())
m_adapters.append(adapter.release_nonnull());