feat: kernel network statistics reporting, new Network configuration applet
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user