feat: kernel network statistics reporting, new Network configuration applet

This commit is contained in:
2026-05-03 10:45:33 +02:00
parent 3919d166f7
commit 3ad5ae2e75
28 changed files with 1167 additions and 115 deletions
+14 -1
View File
@@ -502,8 +502,21 @@ namespace Drivers::Net::E1000 {
return g_initialized;
}
bool IsLinkUp() {
if (!g_initialized || g_mmioBase == nullptr) return false;
return (ReadReg(REG_STATUS) & (1 << 1)) != 0;
}
uint64_t GetRxPacketCount() {
return g_rxPacketCount;
}
uint64_t GetTxPacketCount() {
return g_txPacketCount;
}
void SetRxCallback(RxCallback callback) {
g_rxCallback = callback;
}
};
};
+8 -1
View File
@@ -115,10 +115,17 @@ namespace Drivers::Net::E1000 {
// Check if the device was found and initialized
bool IsInitialized();
// Read current carrier/link state from the device status register
bool IsLinkUp();
// Packet counters maintained by the driver
uint64_t GetRxPacketCount();
uint64_t GetTxPacketCount();
// RX callback type: called with (packet data, length)
using RxCallback = void(*)(const uint8_t* data, uint16_t length);
// Register a callback for received packets
void SetRxCallback(RxCallback callback);
};
};
+13
View File
@@ -740,10 +740,23 @@ namespace Drivers::Net::E1000E {
return g_initialized;
}
bool IsLinkUp() {
if (!g_initialized || g_mmioBase == nullptr) return false;
return (ReadReg(REG_STATUS) & (1 << 1)) != 0;
}
bool RequiresPolling() {
return g_initialized && g_pollingMode;
}
uint64_t GetRxPacketCount() {
return g_rxPacketCount;
}
uint64_t GetTxPacketCount() {
return g_txPacketCount;
}
void SetRxCallback(RxCallback callback) {
g_rxCallback = callback;
}
+7
View File
@@ -149,9 +149,16 @@ namespace Drivers::Net::E1000E {
// Check if the device was found and initialized
bool IsInitialized();
// Read current carrier/link state from the device status register
bool IsLinkUp();
// Returns true only when the driver had to fall back to timer polling.
bool RequiresPolling();
// Packet counters maintained by the driver
uint64_t GetRxPacketCount();
uint64_t GetTxPacketCount();
// RX callback type: called with (packet data, length)
using RxCallback = void(*)(const uint8_t* data, uint16_t length);