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/RTL8139NetworkAdapter.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/RTL8139NetworkAdapter.h')
-rw-r--r-- | Kernel/Net/RTL8139NetworkAdapter.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Net/RTL8139NetworkAdapter.h b/Kernel/Net/RTL8139NetworkAdapter.h index 9d1ebe2f1a..b04ec65d1f 100644 --- a/Kernel/Net/RTL8139NetworkAdapter.h +++ b/Kernel/Net/RTL8139NetworkAdapter.h @@ -20,9 +20,8 @@ namespace Kernel { class RTL8139NetworkAdapter final : public NetworkAdapter , public PCI::Device { public: - static void detect(); + static RefPtr<RTL8139NetworkAdapter> try_to_initialize(PCI::Address); - RTL8139NetworkAdapter(PCI::Address, u8 irq); virtual ~RTL8139NetworkAdapter() override; virtual void send_raw(ReadonlyBytes) override; @@ -31,6 +30,7 @@ public: virtual const char* purpose() const override { return class_name(); } private: + RTL8139NetworkAdapter(PCI::Address, u8 irq); virtual void handle_irq(const RegisterState&) override; virtual const char* class_name() const override { return "RTL8139NetworkAdapter"; } |