- 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

svn path=/trunk/; revision=40475
This commit is contained in:
Cameron Gutman 2009-04-13 03:11:42 +00:00
parent 8cf11060a9
commit c68f8590f1

View file

@ -299,6 +299,60 @@ MiniIndicateReceivePacket(
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);
}
}
CurrentEntry = CurrentEntry->Flink;
}