Kernel: Instantiate network adapters in their own detect() methods

This commit is one step forward for pluggable driver modules.
Instead of creating instances of network adapter classes, we let
their detect() methods to figure out if there are existing devices
to initialize.
This commit is contained in:
Liav A 2020-04-10 20:33:30 +03:00 committed by Andreas Kling
commit ea58563970
Notes: sideshowbarker 2024-07-19 07:44:04 +09:00
6 changed files with 27 additions and 22 deletions

View file

@ -58,11 +58,8 @@ void initialize()
MMIOAccess::initialize(ACPI::Parser::the()->find_table("MCFG"));
else
IOAccess::initialize();
enumerate([&](const Address& address, ID id) {
PCI::enumerate([&](const Address& address, ID id) {
klog() << address << " " << id;
E1000NetworkAdapter::detect(address);
RTL8139NetworkAdapter::detect(address);
});
}