diff options
author | Liav A <liavalb@gmail.com> | 2021-06-04 07:43:16 +0300 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-06-09 22:44:09 +0430 |
commit | 1c94b5e8eb9723149a76ef54d38224c995c1a765 (patch) | |
tree | aee54ac8ce3e7f2195f3a575aa8848e0e7635343 /Kernel/Net/E1000NetworkAdapter.h | |
parent | 8b1d4d1b8ea7cc0a801b097c977f4d39a39ba5aa (diff) | |
download | serenity-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/Net/E1000NetworkAdapter.h')
-rw-r--r-- | Kernel/Net/E1000NetworkAdapter.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Net/E1000NetworkAdapter.h b/Kernel/Net/E1000NetworkAdapter.h index e7fa10ad70..6458ae9d45 100644 --- a/Kernel/Net/E1000NetworkAdapter.h +++ b/Kernel/Net/E1000NetworkAdapter.h @@ -20,9 +20,8 @@ namespace Kernel { class E1000NetworkAdapter final : public NetworkAdapter , public PCI::Device { public: - static void detect(); + static RefPtr<E1000NetworkAdapter> try_to_initialize(PCI::Address); - E1000NetworkAdapter(PCI::Address, u8 irq); virtual ~E1000NetworkAdapter() override; virtual void send_raw(ReadonlyBytes) override; @@ -31,6 +30,7 @@ public: virtual const char* purpose() const override { return class_name(); } private: + E1000NetworkAdapter(PCI::Address, u8 irq); virtual void handle_irq(const RegisterState&) override; virtual const char* class_name() const override { return "E1000NetworkAdapter"; } |