https://git.reactos.org/?p=reactos.git;a=commitdiff;h=68bcc2df7c06377903a17…
commit 68bcc2df7c06377903a17d6fcd0253c280958446
Author: Serge Gautherie <reactos-git_serge_171003(a)gautherie.fr>
AuthorDate: Sat Jun 8 03:03:40 2019 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Thu Aug 15 21:08:10 2019 +0200
[NDIS] Enforce '#if DBG' around MiniDisplayPacket[2]()
Also add 'static' on MiniDisplayPacket2().
---
drivers/network/ndis/ndis/miniport.c | 9 +++++----
drivers/network/ndis/ndis/protocol.c | 2 ++
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/network/ndis/ndis/miniport.c b/drivers/network/ndis/ndis/miniport.c
index 645291cab92..ad5f7741e6c 100644
--- a/drivers/network/ndis/ndis/miniport.c
+++ b/drivers/network/ndis/ndis/miniport.c
@@ -57,12 +57,12 @@ KSPIN_LOCK MiniportListLock;
LIST_ENTRY AdapterListHead;
KSPIN_LOCK AdapterListLock;
+#if DBG
VOID
MiniDisplayPacket(
PNDIS_PACKET Packet,
PCSTR Reason)
{
-#if DBG
ULONG i, Length;
UCHAR Buffer[64];
if ((DebugTraceLevel & DEBUG_PACKET) > 0) {
@@ -82,9 +82,9 @@ MiniDisplayPacket(
DbgPrint("\n*** %s PACKET STOP ***\n", Reason);
}
-#endif /* DBG */
}
+static
VOID
MiniDisplayPacket2(
PVOID HeaderBuffer,
@@ -92,7 +92,6 @@ MiniDisplayPacket2(
PVOID LookaheadBuffer,
UINT LookaheadBufferSize)
{
-#if DBG
if ((DebugTraceLevel & DEBUG_PACKET) > 0) {
ULONG i, Length;
PUCHAR p;
@@ -118,8 +117,8 @@ MiniDisplayPacket2(
DbgPrint("\n*** RECEIVE PACKET STOP ***\n");
}
-#endif /* DBG */
}
+#endif /* DBG */
PNDIS_MINIPORT_WORK_ITEM
MiniGetFirstWorkItem(
@@ -201,7 +200,9 @@ MiniIndicateData(
"HeaderBufferSize (0x%X) LookaheadBuffer (0x%X) LookaheadBufferSize
(0x%X).\n",
Adapter, HeaderBuffer, HeaderBufferSize, LookaheadBuffer, LookaheadBufferSize));
+#if DBG
MiniDisplayPacket2(HeaderBuffer, HeaderBufferSize, LookaheadBuffer,
LookaheadBufferSize);
+#endif
NDIS_DbgPrint(MAX_TRACE, ("acquiring miniport block lock\n"));
KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql);
diff --git a/drivers/network/ndis/ndis/protocol.c b/drivers/network/ndis/ndis/protocol.c
index d584d36f15e..83c2797e2ab 100644
--- a/drivers/network/ndis/ndis/protocol.c
+++ b/drivers/network/ndis/ndis/protocol.c
@@ -404,7 +404,9 @@ proSendPacketToMiniport(PLOGICAL_ADAPTER Adapter, PNDIS_PACKET
Packet)
return NDIS_STATUS_PENDING;
}
+#if DBG
MiniDisplayPacket(Packet, "SEND");
+#endif
if(Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)
{