Author: cgutman
Date: Sat Mar 31 05:55:33 2012
New Revision: 56285
URL:
http://svn.reactos.org/svn/reactos?rev=56285&view=rev
Log:
[NDIS]
- Don't rely on the current lookahead size for loopback packets. Instead, indicate the
entire packet at once.
- The current lookahead size doesn't matter when indicating full packets. The packets
are indicated in their entirety regardless of the lookahead size.
- The Parallels Tools NIC driver now works on ROS. Dedicated to Alex Ionescu.
Modified:
trunk/reactos/drivers/network/ndis/ndis/miniport.c
trunk/reactos/drivers/network/ndis/ndis/protocol.c
Modified: trunk/reactos/drivers/network/ndis/ndis/miniport.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] Sat Mar 31 05:55:33
2012
@@ -339,14 +339,7 @@
HeaderSize = NDIS_GET_PACKET_HEADER_SIZE(PacketArray[i]);
- if (Adapter->NdisMiniportBlock.CurrentLookahead <
(TotalBufferLength - HeaderSize))
- {
- LookAheadSize = Adapter->NdisMiniportBlock.CurrentLookahead;
- }
- else
- {
- LookAheadSize = TotalBufferLength - HeaderSize;
- }
+ LookAheadSize = TotalBufferLength - HeaderSize;
LookAheadBuffer = ExAllocatePool(NonPagedPool, LookAheadSize);
if (!LookAheadBuffer)
Modified: trunk/reactos/drivers/network/ndis/ndis/protocol.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] Sat Mar 31 05:55:33
2012
@@ -267,19 +267,18 @@
MiniDisplayPacket(Packet);
#endif
- LookaheadBuffer = ExAllocatePool(NonPagedPool,
Adapter->NdisMiniportBlock.CurrentLookahead + Adapter->MediumHeaderSize);
+ NdisQueryPacket(Packet, NULL, NULL, NULL, &PacketLength);
+
+ LookaheadBuffer = ExAllocatePool(NonPagedPool, PacketLength);
if (!LookaheadBuffer) {
NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources\n"));
return NDIS_STATUS_RESOURCES;
}
- NdisQueryPacket(Packet, NULL, NULL, NULL, &PacketLength);
-
NDIS_DbgPrint(MAX_TRACE, ("acquiring miniport block lock\n"));
KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql);
{
- BufferedLength = CopyPacketToBuffer(LookaheadBuffer, Packet, 0,
Adapter->NdisMiniportBlock.CurrentLookahead +
-
Adapter->MediumHeaderSize);
+ BufferedLength = CopyPacketToBuffer(LookaheadBuffer, Packet, 0, PacketLength);
Adapter->NdisMiniportBlock.IndicatedPacket[KeGetCurrentProcessorNumber()] =
Packet;
}
KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql);