summaryrefslogtreecommitdiff
path: root/Kernel/Net/E1000NetworkAdapter.cpp
diff options
context:
space:
mode:
authorasynts <asynts@gmail.com>2021-01-23 23:29:11 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-25 09:47:36 +0100
commit1a3a0836c017ab5e5672472033f3ff369dc33c39 (patch)
tree354552e5dae4f7baf2b8ee05eb33e2f7587826f6 /Kernel/Net/E1000NetworkAdapter.cpp
parent76f29184162e35d570034a8438a683695faa273f (diff)
downloadserenity-1a3a0836c017ab5e5672472033f3ff369dc33c39.zip
Everywhere: Use CMake to generate AK/Debug.h.
This was done with the help of several scripts, I dump them here to easily find them later: awk '/#ifdef/ { print "#cmakedefine01 "$2 }' AK/Debug.h.in for debug_macro in $(awk '/#ifdef/ { print $2 }' AK/Debug.h.in) do find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/#ifdef '$debug_macro'/#if '$debug_macro'/' {} \; done # Remember to remove WRAPPER_GERNERATOR_DEBUG from the list. awk '/#cmake/ { print "set("$2" ON)" }' AK/Debug.h.in
Diffstat (limited to 'Kernel/Net/E1000NetworkAdapter.cpp')
-rw-r--r--Kernel/Net/E1000NetworkAdapter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Kernel/Net/E1000NetworkAdapter.cpp b/Kernel/Net/E1000NetworkAdapter.cpp
index 49b4067167..188f2fec09 100644
--- a/Kernel/Net/E1000NetworkAdapter.cpp
+++ b/Kernel/Net/E1000NetworkAdapter.cpp
@@ -423,7 +423,7 @@ void E1000NetworkAdapter::send_raw(ReadonlyBytes payload)
{
disable_irq();
size_t tx_current = in32(REG_TXDESCTAIL) % number_of_tx_descriptors;
-#ifdef E1000_DEBUG
+#if E1000_DEBUG
klog() << "E1000: Sending packet (" << payload.size() << " bytes)";
#endif
auto* tx_descriptors = (e1000_tx_desc*)m_tx_descriptors_region->vaddr().as_ptr();
@@ -434,7 +434,7 @@ void E1000NetworkAdapter::send_raw(ReadonlyBytes payload)
descriptor.length = payload.size();
descriptor.status = 0;
descriptor.cmd = CMD_EOP | CMD_IFCS | CMD_RS;
-#ifdef E1000_DEBUG
+#if E1000_DEBUG
klog() << "E1000: Using tx descriptor " << tx_current << " (head is at " << in32(REG_TXDESCHEAD) << ")";
#endif
tx_current = (tx_current + 1) % number_of_tx_descriptors;
@@ -448,7 +448,7 @@ void E1000NetworkAdapter::send_raw(ReadonlyBytes payload)
}
m_wait_queue.wait_on({}, "E1000NetworkAdapter");
}
-#ifdef E1000_DEBUG
+#if E1000_DEBUG
dbgln("E1000: Sent packet, status is now {:#02x}!", (u8)descriptor.status);
#endif
}
@@ -467,7 +467,7 @@ void E1000NetworkAdapter::receive()
auto* buffer = m_rx_buffers_regions[rx_current].vaddr().as_ptr();
u16 length = rx_descriptors[rx_current].length;
ASSERT(length <= 8192);
-#ifdef E1000_DEBUG
+#if E1000_DEBUG
klog() << "E1000: Received 1 packet @ " << buffer << " (" << length << ") bytes!";
#endif
did_receive({ buffer, length });