Author: cgutman
Date: Wed Apr 22 07:27:33 2009
New Revision: 40643
URL:
http://svn.reactos.org/svn/reactos?rev=40643&view=rev
Log:
- Don't attempt to store packets and buffers in the same place
Modified:
trunk/reactos/drivers/network/ndis/ndis/buffer.c
trunk/reactos/drivers/network/ndis/ndis/miniport.c
trunk/reactos/drivers/network/ndis/ndis/protocol.c
Modified: trunk/reactos/drivers/network/ndis/ndis/buffer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/buffer.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/buffer.c [iso-8859-1] Wed Apr 22 07:27:33
2009
@@ -420,7 +420,7 @@
if (Pool->FreeList) {
Temp = Pool->FreeList;
- Pool->FreeList = (PNDIS_PACKET)Temp->Private.Head;
+ Pool->FreeList = (PNDIS_PACKET)Temp->Reserved[0];
KeReleaseSpinLock(&Pool->SpinLock.SpinLock, OldIrql);
@@ -521,11 +521,11 @@
NextPacket = (PNDIS_PACKET)((ULONG_PTR)Packet + Length);
for (i = 1; i < NumberOfDescriptors; i++)
{
- Packet->Private.Head = (PNDIS_BUFFER)NextPacket;
+ Packet->Reserved[0] = (ULONG_PTR)NextPacket;
Packet = NextPacket;
NextPacket = (PNDIS_PACKET)((ULONG_PTR)Packet + Length);
}
- Packet->Private.Head = NULL;
+ Packet->Reserved[0] = 0;
}
else
Pool->FreeList = NULL;
@@ -701,7 +701,7 @@
if (Pool->FreeList) {
Temp = Pool->FreeList;
- Pool->FreeList = (PNDIS_PACKET)Temp->Private.Head;
+ Pool->FreeList = (PNDIS_PACKET)Temp->Reserved[0];
KeReleaseSpinLockFromDpcLevel(&Pool->SpinLock.SpinLock);
@@ -750,7 +750,7 @@
if (Pool->FreeList) {
Temp = Pool->FreeList;
- Pool->FreeList = (PNDIS_PACKET)Temp->Private.Head;
+ Pool->FreeList = (PNDIS_PACKET)Temp->Reserved[0];
RtlZeroMemory(&Temp->Private, sizeof(NDIS_PACKET_PRIVATE));
Temp->Private.Pool = Pool;
@@ -779,7 +779,7 @@
NDIS_DbgPrint(MAX_TRACE, ("Packet (0x%X).\n", Packet));
KeAcquireSpinLockAtDpcLevel(&((NDISI_PACKET_POOL*)Packet->Private.Pool)->SpinLock.SpinLock);
- Packet->Private.Head =
(PNDIS_BUFFER)((NDISI_PACKET_POOL*)Packet->Private.Pool)->FreeList;
+ Packet->Reserved[0] =
(ULONG_PTR)((NDISI_PACKET_POOL*)Packet->Private.Pool)->FreeList;
((NDISI_PACKET_POOL*)Packet->Private.Pool)->FreeList = Packet;
KeReleaseSpinLockFromDpcLevel(&((NDISI_PACKET_POOL*)Packet->Private.Pool)->SpinLock.SpinLock);
}
@@ -800,7 +800,7 @@
{
NDIS_DbgPrint(MAX_TRACE, ("Packet (0x%X).\n", Packet));
- Packet->Private.Head =
(PNDIS_BUFFER)((NDISI_PACKET_POOL*)Packet->Private.Pool)->FreeList;
+ Packet->Reserved[0] =
(ULONG_PTR)((NDISI_PACKET_POOL*)Packet->Private.Pool)->FreeList;
((NDISI_PACKET_POOL*)Packet->Private.Pool)->FreeList = Packet;
}
@@ -874,7 +874,7 @@
NDIS_DbgPrint(MAX_TRACE, ("Packet (0x%X).\n", Packet));
KeAcquireSpinLock(&((NDISI_PACKET_POOL*)Packet->Private.Pool)->SpinLock.SpinLock,
&OldIrql);
- Packet->Private.Head =
(PNDIS_BUFFER)((NDISI_PACKET_POOL*)Packet->Private.Pool)->FreeList;
+ Packet->Reserved[0] =
(ULONG_PTR)((NDISI_PACKET_POOL*)Packet->Private.Pool)->FreeList;
((NDISI_PACKET_POOL*)Packet->Private.Pool)->FreeList = Packet;
KeReleaseSpinLock(&((NDISI_PACKET_POOL*)Packet->Private.Pool)->SpinLock.SpinLock,
OldIrql);
}
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] Wed Apr 22 07:27:33
2009
@@ -457,7 +457,7 @@
NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n"));
- AdapterBinding = (PADAPTER_BINDING)Packet->Reserved[0];
+ AdapterBinding = (PADAPTER_BINDING)Packet->Reserved[1];
KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
(*AdapterBinding->ProtocolBinding->Chars.SendCompleteHandler)(
@@ -490,7 +490,7 @@
NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n"));
- AdapterBinding = (PADAPTER_BINDING)Packet->Reserved[0];
+ AdapterBinding = (PADAPTER_BINDING)Packet->Reserved[1];
KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
(*AdapterBinding->ProtocolBinding->Chars.TransferDataCompleteHandler)(
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] Wed Apr 22 07:27:33
2009
@@ -279,7 +279,7 @@
ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);
/* XXX what is this crazy black magic? */
- Packet->Reserved[0] = (ULONG_PTR)MacBindingHandle;
+ Packet->Reserved[1] = (ULONG_PTR)MacBindingHandle;
/*
* Test the packet to see if it is a MAC loopback.