summaryrefslogtreecommitdiff
path: root/Kernel/init.cpp
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2021-06-04 07:43:16 +0300
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-06-09 22:44:09 +0430
commit1c94b5e8eb9723149a76ef54d38224c995c1a765 (patch)
treeaee54ac8ce3e7f2195f3a575aa8848e0e7635343 /Kernel/init.cpp
parent8b1d4d1b8ea7cc0a801b097c977f4d39a39ba5aa (diff)
downloadserenity-1c94b5e8eb9723149a76ef54d38224c995c1a765.zip
Kernel: Introduce the NetworkingManagement singleton
Instead of initializing network adapters in init.cpp, let's move that logic into a separate class to handle this. Also, it seems like a good idea to shift responsiblity on enumeration of network adapters after the boot process, so this singleton will take care of finding the appropriate network adapter when asked to with an IPv4 address or interface name. With this change being merged, we simplify the creation logic of NetworkAdapter derived classes, so we enumerate the PCI bus only once, searching for driver candidates when doing so, and we let each driver to test if it is resposible for the specified PCI device.
Diffstat (limited to 'Kernel/init.cpp')
-rw-r--r--Kernel/init.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/Kernel/init.cpp b/Kernel/init.cpp
index df56ae26e7..3711ec7ed6 100644
--- a/Kernel/init.cpp
+++ b/Kernel/init.cpp
@@ -33,11 +33,8 @@
#include <Kernel/Interrupts/PIC.h>
#include <Kernel/KSyms.h>
#include <Kernel/Multiboot.h>
-#include <Kernel/Net/E1000NetworkAdapter.h>
-#include <Kernel/Net/LoopbackAdapter.h>
-#include <Kernel/Net/NE2000NetworkAdapter.h>
#include <Kernel/Net/NetworkTask.h>
-#include <Kernel/Net/RTL8139NetworkAdapter.h>
+#include <Kernel/Net/NetworkingManagement.h>
#include <Kernel/PCI/Access.h>
#include <Kernel/PCI/Initializer.h>
#include <Kernel/Panic.h>
@@ -243,12 +240,7 @@ void init_stage2(void*)
VirtIO::detect();
- E1000NetworkAdapter::detect();
- NE2000NetworkAdapter::detect();
- RTL8139NetworkAdapter::detect();
-
- LoopbackAdapter::the();
-
+ NetworkingManagement::the().initialize();
Syscall::initialize();
new MemoryDevice;