mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 21:48:11 +00:00
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.
This commit is contained in:
parent
e22d9dc360
commit
82bb08a15c
14 changed files with 85 additions and 41 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue