summaryrefslogtreecommitdiff
path: root/Kernel/Net
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2021-09-07 12:08:38 +0300
committerAndreas Kling <kling@serenityos.org>2021-09-07 13:47:37 +0200
commit25ea7461a0e5a6c2ed1a43b80b1db8b2ac3b3764 (patch)
tree135923d84d2dc4244148b9dcd3cb3c77f43378ad /Kernel/Net
parentd1378339f6f4457457167fcf79cbca5f5549a336 (diff)
downloadserenity-25ea7461a0e5a6c2ed1a43b80b1db8b2ac3b3764.zip
Kernel/PCI: Simplify the entire subsystem
A couple of things were changed: 1. Semantic changes - PCI segments are now called PCI domains, to better match what they are really. It's also the name that Linux gave, and it seems that Wikipedia also uses this name. We also remove PCI::ChangeableAddress, because it was used in the past but now it's no longer being used. 2. There are no WindowedMMIOAccess or MMIOAccess classes anymore, as they made a bunch of unnecessary complexity. Instead, Windowed access is removed entirely (this was tested, but never was benchmarked), so we are left with IO access and memory access options. The memory access option is essentially mapping the PCI bus (from the chosen PCI domain), to virtual memory as-is. This means that unless needed, at any time, there is only one PCI bus being mapped, and this is changed if access to another PCI bus in the same PCI domain is needed. For now, we don't support mapping of different PCI buses from different PCI domains at the same time, because basically it's still a non-issue for most machines out there. 2. OOM-safety is increased, especially when constructing the Access object. It means that we pre-allocating any needed resources, and we try to find PCI domains (if requested to initialize memory access) after we attempt to construct the Access object, so it's possible to fail at this point "gracefully". 3. All PCI API functions are now separated into a different header file, which means only "clients" of the PCI subsystem API will need to include that header file. 4. Functional changes - we only allow now to enumerate the bus after a hardware scan. This means that the old method "enumerate_hardware" is removed, so, when initializing an Access object, the initializing function must call rescan on it to force it to find devices. This makes it possible to fail rescan, and also to defer it after construction from both OOM-safety terms and hotplug capabilities.
Diffstat (limited to 'Kernel/Net')
-rw-r--r--Kernel/Net/E1000ENetworkAdapter.cpp1
-rw-r--r--Kernel/Net/E1000NetworkAdapter.cpp1
-rw-r--r--Kernel/Net/NE2000NetworkAdapter.cpp1
-rw-r--r--Kernel/Net/NetworkingManagement.cpp1
-rw-r--r--Kernel/Net/RTL8139NetworkAdapter.cpp1
-rw-r--r--Kernel/Net/RTL8168NetworkAdapter.cpp1
6 files changed, 6 insertions, 0 deletions
diff --git a/Kernel/Net/E1000ENetworkAdapter.cpp b/Kernel/Net/E1000ENetworkAdapter.cpp
index e5677d3aae..f559304238 100644
--- a/Kernel/Net/E1000ENetworkAdapter.cpp
+++ b/Kernel/Net/E1000ENetworkAdapter.cpp
@@ -5,6 +5,7 @@
*/
#include <AK/MACAddress.h>
+#include <Kernel/Bus/PCI/API.h>
#include <Kernel/Bus/PCI/IDs.h>
#include <Kernel/Net/E1000ENetworkAdapter.h>
#include <Kernel/Sections.h>
diff --git a/Kernel/Net/E1000NetworkAdapter.cpp b/Kernel/Net/E1000NetworkAdapter.cpp
index b6492354f7..d562be7bcc 100644
--- a/Kernel/Net/E1000NetworkAdapter.cpp
+++ b/Kernel/Net/E1000NetworkAdapter.cpp
@@ -5,6 +5,7 @@
*/
#include <AK/MACAddress.h>
+#include <Kernel/Bus/PCI/API.h>
#include <Kernel/Bus/PCI/IDs.h>
#include <Kernel/Debug.h>
#include <Kernel/Net/E1000NetworkAdapter.h>
diff --git a/Kernel/Net/NE2000NetworkAdapter.cpp b/Kernel/Net/NE2000NetworkAdapter.cpp
index 98b551f3d4..d7ba71096f 100644
--- a/Kernel/Net/NE2000NetworkAdapter.cpp
+++ b/Kernel/Net/NE2000NetworkAdapter.cpp
@@ -5,6 +5,7 @@
*/
#include <AK/MACAddress.h>
+#include <Kernel/Bus/PCI/API.h>
#include <Kernel/Debug.h>
#include <Kernel/IO.h>
#include <Kernel/Net/NE2000NetworkAdapter.h>
diff --git a/Kernel/Net/NetworkingManagement.cpp b/Kernel/Net/NetworkingManagement.cpp
index e1aada237e..efcaad102b 100644
--- a/Kernel/Net/NetworkingManagement.cpp
+++ b/Kernel/Net/NetworkingManagement.cpp
@@ -5,6 +5,7 @@
*/
#include <AK/Singleton.h>
+#include <Kernel/Bus/PCI/API.h>
#include <Kernel/CommandLine.h>
#include <Kernel/IO.h>
#include <Kernel/Memory/AnonymousVMObject.h>
diff --git a/Kernel/Net/RTL8139NetworkAdapter.cpp b/Kernel/Net/RTL8139NetworkAdapter.cpp
index be2ab32e26..c9f9d5e786 100644
--- a/Kernel/Net/RTL8139NetworkAdapter.cpp
+++ b/Kernel/Net/RTL8139NetworkAdapter.cpp
@@ -5,6 +5,7 @@
*/
#include <AK/MACAddress.h>
+#include <Kernel/Bus/PCI/API.h>
#include <Kernel/Debug.h>
#include <Kernel/IO.h>
#include <Kernel/Net/RTL8139NetworkAdapter.h>
diff --git a/Kernel/Net/RTL8168NetworkAdapter.cpp b/Kernel/Net/RTL8168NetworkAdapter.cpp
index 6aba5ee6e1..ac46ef0379 100644
--- a/Kernel/Net/RTL8168NetworkAdapter.cpp
+++ b/Kernel/Net/RTL8168NetworkAdapter.cpp
@@ -5,6 +5,7 @@
*/
#include <AK/MACAddress.h>
+#include <Kernel/Bus/PCI/API.h>
#include <Kernel/Bus/PCI/IDs.h>
#include <Kernel/Debug.h>
#include <Kernel/Net/RTL8168NetworkAdapter.h>