mirror of
https://github.com/reactos/reactos.git
synced 2024-08-29 14:48:37 +00:00
- 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:
parent
8cf11060a9
commit
c68f8590f1
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue