Author: cgutman
Date: Mon Apr 13 07:11:42 2009
New Revision: 40475
URL:
http://svn.reactos.org/svn/reactos?rev=40475&view=rev
Log:
- Implement the rest of MiniIndicateReceivePacket
- rtl8139 partially works now
- It gets an IP address and can ping other computers but attempting to download something
results in a page fault during the download
Modified:
trunk/reactos/drivers/network/ndis/ndis/miniport.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] Mon Apr 13 07:11:42
2009
@@ -297,6 +297,60 @@
(*AdapterBinding->ProtocolBinding->Chars.ReceivePacketHandler)(
AdapterBinding->NdisOpenBlock.ProtocolBindingContext,
PacketArray[i]);
+ }
+ }
+ else
+ {
+ for (i = 0; i < NumberOfPackets; i++)
+ {
+ UINT FirstBufferLength, TotalBufferLength, LookAheadSize, HeaderSize;
+ PNDIS_BUFFER NdisBuffer;
+ PVOID NdisBufferVA, LookAheadBuffer;
+ NDIS_STATUS NdisStatus;
+
+
+ NdisGetFirstBufferFromPacket(PacketArray[i],
+ &NdisBuffer,
+ &NdisBufferVA,
+ &FirstBufferLength,
+ &TotalBufferLength);
+
+ HeaderSize = NDIS_GET_PACKET_HEADER_SIZE(PacketArray[i]);
+
+ if (Adapter->NdisMiniportBlock.CurrentLookahead < (TotalBufferLength
- HeaderSize))
+ {
+ LookAheadSize = Adapter->NdisMiniportBlock.CurrentLookahead;
+ }
+ else
+ {
+ LookAheadSize = TotalBufferLength - HeaderSize;
+ }
+
+
+ LookAheadBuffer = ExAllocatePool(NonPagedPool, LookAheadSize);
+ if (!LookAheadSize)
+ {
+ NDIS_DbgPrint(MIN_TRACE, ("Failed to allocate lookahead
buffer!\n"));
+ return;
+ }
+
+ CopyBufferChainToBuffer(LookAheadBuffer,
+ NdisBuffer,
+ HeaderSize,
+ LookAheadSize);
+
+ NdisStatus =
(*AdapterBinding->ProtocolBinding->Chars.ReceiveHandler)(
+ AdapterBinding->NdisOpenBlock.ProtocolBindingContext,
+ AdapterBinding->NdisOpenBlock.MacHandle,
+ NdisBufferVA,
+ HeaderSize,
+ LookAheadBuffer,
+ LookAheadSize,
+ TotalBufferLength - HeaderSize);
+
+ NDIS_SET_PACKET_STATUS(PacketArray[i], NdisStatus);
+
+ ExFreePool(LookAheadBuffer);
}
}